api reports

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2024-06-20 12:11:08 +02:00
parent 5c4e876e62
commit 73a45650e2
8 changed files with 18 additions and 20 deletions
-4
View File
@@ -18,7 +18,6 @@ import { ErrorRequestHandler } from 'express';
import { Express as Express_2 } from 'express';
import { Format } from 'logform';
import { Handler } from 'express';
import { HealthService } from '@backstage/backend-plugin-api';
import { HelmetOptions } from 'helmet';
import * as http from 'http';
import { HttpAuthService } from '@backstage/backend-plugin-api';
@@ -127,9 +126,6 @@ export const discoveryServiceFactory: () => ServiceFactory<
// @public @deprecated (undocumented)
export type ExtendedHttpServer = ExtendedHttpServer_2;
// @public (undocumented)
export const healthServiceFactory: () => ServiceFactory<HealthService, 'root'>;
// @public @deprecated
export class HostDiscovery implements DiscoveryService {
static fromConfig(
@@ -121,6 +121,8 @@ export interface RootHttpRouterConfigureContext {
// (undocumented)
config: RootConfigService;
// (undocumented)
healthRouter: RequestHandler;
// (undocumented)
lifecycle: LifecycleService;
// (undocumented)
logger: LoggerService;
@@ -54,7 +54,7 @@ export class DefaultRootHealthService implements RootHealthService {
* @public
*/
export const rootHealthServiceFactory = createServiceFactory({
service: coreServices.health,
service: coreServices.rootHealth,
deps: {
lifecycle: coreServices.rootLifecycle,
},
@@ -77,7 +77,7 @@ export const rootHttpRouterServiceFactory = createServiceFactory(
config: coreServices.rootConfig,
rootLogger: coreServices.rootLogger,
lifecycle: coreServices.rootLifecycle,
health: coreServices.health,
health: coreServices.rootHealth,
},
async factory({ config, rootLogger, lifecycle, health }) {
const { indexPath, configure = defaultConfigure } = options ?? {};
+1 -1
View File
@@ -194,7 +194,7 @@ export namespace coreServices {
const rootConfig: ServiceRef<RootConfigService, 'root'>;
const database: ServiceRef<DatabaseService, 'plugin'>;
const discovery: ServiceRef<DiscoveryService, 'plugin'>;
const health: ServiceRef<RootHealthService, 'root'>;
const rootHealth: ServiceRef<RootHealthService, 'root'>;
const httpAuth: ServiceRef<HttpAuthService, 'plugin'>;
const httpRouter: ServiceRef<HttpRouterService, 'plugin'>;
const lifecycle: ServiceRef<LifecycleService, 'plugin'>;
@@ -105,9 +105,9 @@ export namespace coreServices {
/**
* The service reference for the plugin scoped {@link RootHealthService}.
*/
export const health = createServiceRef<
export const rootHealth = createServiceRef<
import('./RootHealthService').RootHealthService
>({ id: 'core.health', scope: 'root' });
>({ id: 'core.rootHealth', scope: 'root' });
/**
* Authentication of HTTP requests.
+10 -10
View File
@@ -21,7 +21,6 @@ import { DiscoveryService } from '@backstage/backend-plugin-api';
import { EventsService } from '@backstage/plugin-events-node';
import { ExtendedHttpServer } from '@backstage/backend-app-api';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { HealthService } from '@backstage/backend-plugin-api';
import { HttpAuthService } from '@backstage/backend-plugin-api';
import { HttpRouterFactoryOptions } from '@backstage/backend-defaults/httpRouter';
import { HttpRouterService } from '@backstage/backend-plugin-api';
@@ -33,6 +32,7 @@ import { LifecycleService } from '@backstage/backend-plugin-api';
import { LoggerService } from '@backstage/backend-plugin-api';
import { PermissionsService } from '@backstage/backend-plugin-api';
import { RootConfigService } from '@backstage/backend-plugin-api';
import { RootHealthService } from '@backstage/backend-plugin-api';
import { RootHttpRouterFactoryOptions } from '@backstage/backend-defaults/rootHttpRouter';
import { RootHttpRouterService } from '@backstage/backend-plugin-api';
import { RootLifecycleService } from '@backstage/backend-plugin-api';
@@ -200,15 +200,6 @@ export namespace mockServices {
partialImpl?: Partial<EventsService> | undefined,
) => ServiceMock<EventsService>;
}
// (undocumented)
export namespace health {
const // (undocumented)
factory: () => ServiceFactory<HealthService, 'root'>;
const // (undocumented)
mock: (
partialImpl?: Partial<HealthService> | undefined,
) => ServiceMock<HealthService>;
}
export function httpAuth(options?: {
pluginId?: string;
defaultCredentials?: BackstageCredentials;
@@ -290,6 +281,15 @@ export namespace mockServices {
) => ServiceFactory<RootConfigService, 'root'>;
}
// (undocumented)
export namespace rootHealth {
const // (undocumented)
factory: () => ServiceFactory<RootHealthService, 'root'>;
const // (undocumented)
mock: (
partialImpl?: Partial<RootHealthService> | undefined,
) => ServiceMock<RootHealthService>;
}
// (undocumented)
export namespace rootHttpRouter {
const // (undocumented)
factory: (
@@ -347,7 +347,7 @@ export namespace mockServices {
export namespace rootHealth {
export const factory = rootHealthServiceFactory;
export const mock = simpleMock(coreServices.health, () => ({
export const mock = simpleMock(coreServices.rootHealth, () => ({
getLiveness: jest.fn(),
getReadiness: jest.fn(),
}));