fix api reports
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
@@ -41,7 +41,6 @@ import { ServiceRegistry } from './ServiceRegistry';
|
||||
import { createInitializationLogger } from './createInitializationLogger';
|
||||
import { deepFreeze, unwrapFeature } from './helpers';
|
||||
import type { RootInstanceMetadataServicePluginInfo } from '@backstage/backend-plugin-api';
|
||||
import { instanceMetadataServiceRef } from '@backstage/backend-plugin-api/alpha';
|
||||
|
||||
export interface BackendRegisterInit {
|
||||
consumes: Set<ServiceOrExtensionPoint>;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
```ts
|
||||
import { ActionsRegistryService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { ActionsService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { InstanceMetadataService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { ServiceFactory } from '@backstage/backend-plugin-api';
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -21,5 +22,12 @@ export const actionsServiceFactory: ServiceFactory<
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
export const instanceMetadataServiceFactory: ServiceFactory<
|
||||
InstanceMetadataService,
|
||||
'plugin',
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
+4
@@ -20,6 +20,10 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { instanceMetadataServiceRef } from '@backstage/backend-plugin-api/alpha';
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
* @deprecated use {@link @backstage/backend-plugin-api#coreServices.rootInstanceMetadata} instead
|
||||
*/
|
||||
export const instanceMetadataServiceFactory = createServiceFactory({
|
||||
service: instanceMetadataServiceRef,
|
||||
deps: {
|
||||
|
||||
@@ -103,5 +103,30 @@ export const actionsServiceRef: ServiceRef<
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type BackendFeatureMeta =
|
||||
| {
|
||||
type: 'plugin';
|
||||
pluginId: string;
|
||||
}
|
||||
| {
|
||||
type: 'module';
|
||||
pluginId: string;
|
||||
moduleId: string;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export interface InstanceMetadataService {
|
||||
// (undocumented)
|
||||
getInstalledFeatures: () => BackendFeatureMeta[];
|
||||
}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const instanceMetadataServiceRef: ServiceRef<
|
||||
InstanceMetadataService,
|
||||
'plugin',
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -232,8 +232,8 @@ export namespace coreServices {
|
||||
const rootLogger: ServiceRef<RootLoggerService, 'root', 'singleton'>;
|
||||
const scheduler: ServiceRef<SchedulerService, 'plugin', 'singleton'>;
|
||||
const urlReader: ServiceRef<UrlReaderService, 'plugin', 'singleton'>;
|
||||
const instanceMetadata: ServiceRef<
|
||||
InstanceMetadataService,
|
||||
const rootInstanceMetadata: ServiceRef<
|
||||
RootInstanceMetadataService,
|
||||
'plugin',
|
||||
'singleton'
|
||||
>;
|
||||
@@ -421,24 +421,6 @@ export interface HttpRouterServiceAuthPolicy {
|
||||
path: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface InstanceMetadataService {
|
||||
// (undocumented)
|
||||
getInstalledPlugins: () => Promise<
|
||||
ReadonlyArray<InstanceMetadataServicePluginInfo>
|
||||
>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface InstanceMetadataServicePluginInfo {
|
||||
// (undocumented)
|
||||
readonly modules: ReadonlyArray<{
|
||||
moduleId: string;
|
||||
}>;
|
||||
// (undocumented)
|
||||
readonly pluginId: string;
|
||||
}
|
||||
|
||||
export { isChildPath };
|
||||
|
||||
// @public
|
||||
@@ -601,6 +583,24 @@ export interface RootHttpRouterService {
|
||||
use(path: string, handler: Handler): void;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface RootInstanceMetadataService {
|
||||
// (undocumented)
|
||||
getInstalledPlugins: () => Promise<
|
||||
ReadonlyArray<RootInstanceMetadataServicePluginInfo>
|
||||
>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface RootInstanceMetadataServicePluginInfo {
|
||||
// (undocumented)
|
||||
readonly modules: ReadonlyArray<{
|
||||
moduleId: string;
|
||||
}>;
|
||||
// (undocumented)
|
||||
readonly pluginId: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface RootLifecycleService extends LifecycleService {
|
||||
// (undocumented)
|
||||
|
||||
@@ -23,7 +23,6 @@ import { ExtendedHttpServer } from '@backstage/backend-defaults/rootHttpRouter';
|
||||
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
import { HttpAuthService } from '@backstage/backend-plugin-api';
|
||||
import { HttpRouterService } from '@backstage/backend-plugin-api';
|
||||
import { InstanceMetadataService } from '@backstage/backend-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import Keyv from 'keyv';
|
||||
import { Knex } from 'knex';
|
||||
@@ -36,6 +35,7 @@ import { PermissionsService } from '@backstage/backend-plugin-api';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { RootHealthService } from '@backstage/backend-plugin-api';
|
||||
import { RootHttpRouterService } from '@backstage/backend-plugin-api';
|
||||
import { RootInstanceMetadataService } from '@backstage/backend-plugin-api';
|
||||
import { RootLifecycleService } from '@backstage/backend-plugin-api';
|
||||
import { RootLoggerService } from '@backstage/backend-plugin-api';
|
||||
import { SchedulerService } from '@backstage/backend-plugin-api';
|
||||
@@ -263,21 +263,6 @@ export namespace mockServices {
|
||||
) => ServiceMock<HttpRouterService>;
|
||||
}
|
||||
// (undocumented)
|
||||
export function instanceMetadata(): InstanceMetadataService;
|
||||
// (undocumented)
|
||||
export namespace instanceMetadata {
|
||||
const // (undocumented)
|
||||
mock: (
|
||||
partialImpl?: Partial<InstanceMetadataService> | undefined,
|
||||
) => ServiceMock<InstanceMetadataService>;
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<
|
||||
InstanceMetadataService,
|
||||
'plugin',
|
||||
'singleton' | 'multiton'
|
||||
>;
|
||||
}
|
||||
// (undocumented)
|
||||
export namespace lifecycle {
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<LifecycleService, 'plugin', 'singleton'>;
|
||||
@@ -360,6 +345,21 @@ export namespace mockServices {
|
||||
) => ServiceMock<RootHttpRouterService>;
|
||||
}
|
||||
// (undocumented)
|
||||
export function rootInstanceMetadata(): RootInstanceMetadataService;
|
||||
// (undocumented)
|
||||
export namespace rootInstanceMetadata {
|
||||
const // (undocumented)
|
||||
mock: (
|
||||
partialImpl?: Partial<RootInstanceMetadataService> | undefined,
|
||||
) => ServiceMock<RootInstanceMetadataService>;
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<
|
||||
RootInstanceMetadataService,
|
||||
'plugin',
|
||||
'singleton' | 'multiton'
|
||||
>;
|
||||
}
|
||||
// (undocumented)
|
||||
export namespace rootLifecycle {
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<RootLifecycleService, 'root', 'singleton'>;
|
||||
|
||||
@@ -24,7 +24,7 @@ export default createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
instanceMetadata: coreServices.instanceMetadata,
|
||||
instanceMetadata: coreServices.rootInstanceMetadata,
|
||||
logger: coreServices.logger,
|
||||
},
|
||||
async init({ instanceMetadata, logger }) {
|
||||
|
||||
@@ -32,7 +32,7 @@ export const gatewayPlugin = createBackendPlugin({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
rootHttpRouter: coreServices.rootHttpRouter,
|
||||
instanceMeta: coreServices.instanceMetadata,
|
||||
instanceMeta: coreServices.rootInstanceMetadata,
|
||||
discovery: coreServices.discovery,
|
||||
},
|
||||
async init({ logger, discovery, instanceMeta, rootHttpRouter }) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import {
|
||||
DiscoveryService,
|
||||
InstanceMetadataService,
|
||||
RootInstanceMetadataService,
|
||||
LoggerService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
@@ -28,7 +28,7 @@ export async function createRouter({
|
||||
instanceMeta,
|
||||
}: {
|
||||
discovery: DiscoveryService;
|
||||
instanceMeta: InstanceMetadataService;
|
||||
instanceMeta: RootInstanceMetadataService;
|
||||
logger: LoggerService;
|
||||
}) {
|
||||
const plugins = await instanceMeta.getInstalledPlugins();
|
||||
|
||||
Reference in New Issue
Block a user