refactor: deprecate status check handler
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-common': patch
|
||||
---
|
||||
|
||||
Deprecate legacy status check factory, handler and types.
|
||||
@@ -184,7 +184,7 @@ export function createRootLogger(
|
||||
// @public @deprecated
|
||||
export function createServiceBuilder(_module: NodeModule): ServiceBuilder;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export function createStatusCheckRouter(options: {
|
||||
logger: LoggerService;
|
||||
path?: string;
|
||||
@@ -645,15 +645,15 @@ export type StaticAuthOptions = {
|
||||
logger?: LoggerService;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type StatusCheck = () => Promise<any>;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export function statusCheckHandler(
|
||||
options?: StatusCheckHandlerOptions,
|
||||
): Promise<RequestHandler>;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export interface StatusCheckHandlerOptions {
|
||||
statusCheck?: StatusCheck;
|
||||
}
|
||||
|
||||
@@ -17,3 +17,4 @@
|
||||
export * from './errorHandler';
|
||||
export * from './notFoundHandler';
|
||||
export * from './requestLoggingHandler';
|
||||
export * from './statusCheckHandler';
|
||||
|
||||
+3
@@ -21,6 +21,7 @@ import { NextFunction, Request, Response, RequestHandler } from 'express';
|
||||
* {@link createStatusCheckRouter}.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead.
|
||||
*/
|
||||
export type StatusCheck = () => Promise<any>;
|
||||
|
||||
@@ -28,6 +29,7 @@ export type StatusCheck = () => Promise<any>;
|
||||
* Options passed to {@link statusCheckHandler}.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead.
|
||||
*/
|
||||
export interface StatusCheckHandlerOptions {
|
||||
/**
|
||||
@@ -44,6 +46,7 @@ export interface StatusCheckHandlerOptions {
|
||||
* @public
|
||||
* @param options - An optional configuration object.
|
||||
* @returns An Express error request handler
|
||||
* @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead.
|
||||
*/
|
||||
export async function statusCheckHandler(
|
||||
options: StatusCheckHandlerOptions = {},
|
||||
+2
-2
@@ -17,8 +17,7 @@
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import Router from 'express-promise-router';
|
||||
import express from 'express';
|
||||
import { errorHandler } from '../deprecated';
|
||||
import { statusCheckHandler, StatusCheck } from '../middleware';
|
||||
import { errorHandler, statusCheckHandler, StatusCheck } from '..';
|
||||
|
||||
/**
|
||||
* Creates a default status checking router, that you can add to your express
|
||||
@@ -31,6 +30,7 @@ import { statusCheckHandler, StatusCheck } from '../middleware';
|
||||
* requests.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/ | new backend system} and use the {@link https://backstage.io/docs/backend-system/core-services/root-health | Root Health Service} instead.
|
||||
*/
|
||||
export async function createStatusCheckRouter(options: {
|
||||
logger: LoggerService;
|
||||
@@ -15,4 +15,5 @@
|
||||
*/
|
||||
|
||||
export { createServiceBuilder } from './createServiceBuilder';
|
||||
export { createStatusCheckRouter } from './createStatusCheckRouter';
|
||||
export type { ServiceBuilder, RequestLoggingHandlerFactory } from './types';
|
||||
|
||||
@@ -22,5 +22,3 @@
|
||||
|
||||
export * from './deprecated';
|
||||
export * from './compat';
|
||||
export * from './middleware';
|
||||
export * from './service';
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './statusCheckHandler';
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createStatusCheckRouter } from './createStatusCheckRouter';
|
||||
Reference in New Issue
Block a user