diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index 875f589d17..a4d45a2fb7 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -14,8 +14,6 @@ import { PluginTaskScheduler } from '@backstage/backend-tasks'; import { TokenManager } from '@backstage/backend-common'; import { UrlReader } from '@backstage/backend-common'; -// Warning: (ae-missing-release-tag) "AnyServiceFactory" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type AnyServiceFactory = ServiceFactory< unknown, @@ -25,8 +23,6 @@ export type AnyServiceFactory = ServiceFactory< } >; -// Warning: (ae-missing-release-tag) "BackendInitRegistry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BackendInitRegistry { // (undocumented) @@ -47,8 +43,6 @@ export interface BackendInitRegistry { }): void; } -// Warning: (ae-missing-release-tag) "BackendModuleConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BackendModuleConfig { // (undocumented) @@ -62,8 +56,6 @@ export interface BackendModuleConfig { ): void; } -// Warning: (ae-missing-release-tag) "BackendPluginConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BackendPluginConfig { // (undocumented) @@ -72,8 +64,6 @@ export interface BackendPluginConfig { register(reg: BackendInitRegistry, options: TOptions): void; } -// Warning: (ae-missing-release-tag) "BackendRegistrable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BackendRegistrable { // (undocumented) @@ -88,22 +78,16 @@ export const cacheServiceRef: ServiceRef; // @public (undocumented) export const configServiceRef: ServiceRef; -// Warning: (ae-missing-release-tag) "createBackendModule" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createBackendModule( config: BackendModuleConfig, ): (option: TOptions) => BackendRegistrable; -// Warning: (ae-missing-release-tag) "createBackendPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createBackendPlugin( config: BackendPluginConfig, ): (option: TOptions) => BackendRegistrable; -// Warning: (ae-missing-release-tag) "createExtensionPoint" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createExtensionPoint(options: { id: string; @@ -124,6 +108,11 @@ export function createServiceRef(options: { id: string }): ServiceRef; // @public (undocumented) export const databaseServiceRef: ServiceRef; +// @public (undocumented) +export type DepsToDepFactories = { + [key in keyof T]: (pluginId: string) => Promise; +}; + // @public (undocumented) export const discoveryServiceRef: ServiceRef; @@ -135,8 +124,6 @@ export type ExtensionPoint = { $$ref: 'extension-point'; }; -// Warning: (ae-missing-release-tag) "FactoryFunc" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type FactoryFunc = (pluginId: string) => Promise; @@ -168,8 +155,6 @@ export const permissionsServiceRef: ServiceRef< // @public (undocumented) export const schedulerServiceRef: ServiceRef; -// Warning: (ae-missing-release-tag) "ServiceFactory" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type ServiceFactory< TApi, @@ -195,12 +180,10 @@ export type ServiceRef = { export const tokenManagerServiceRef: ServiceRef; // @public (undocumented) -export const urlReaderServiceRef: ServiceRef; +export type TypesToServiceRef = { + [key in keyof T]: ServiceRef; +}; -// Warnings were encountered during analysis: -// -// src/services/system/types.d.ts:27:5 - (ae-forgotten-export) The symbol "TypesToServiceRef" needs to be exported by the entry point index.d.ts -// src/services/system/types.d.ts:28:5 - (ae-forgotten-export) The symbol "DepsToDepFactories" needs to be exported by the entry point index.d.ts -// src/wiring/types.d.ts:10:67 - (tsdoc-code-span-missing-delimiter) The code span is missing its closing backtick -// src/wiring/types.d.ts:11:24 - (tsdoc-code-span-missing-delimiter) The code span is missing its closing backtick +// @public (undocumented) +export const urlReaderServiceRef: ServiceRef; ``` diff --git a/packages/backend-plugin-api/src/services/system/types.ts b/packages/backend-plugin-api/src/services/system/types.ts index 66b3e89e3c..d578434170 100644 --- a/packages/backend-plugin-api/src/services/system/types.ts +++ b/packages/backend-plugin-api/src/services/system/types.ts @@ -33,13 +33,18 @@ export type ServiceRef = { $$ref: 'service'; }; -type TypesToServiceRef = { [key in keyof T]: ServiceRef }; -type DepsToDepFactories = { +/** @public */ +export type TypesToServiceRef = { [key in keyof T]: ServiceRef }; + +/** @public */ +export type DepsToDepFactories = { [key in keyof T]: (pluginId: string) => Promise; }; +/** @public */ export type FactoryFunc = (pluginId: string) => Promise; +/** @public */ export type ServiceFactory< TApi, TImpl extends TApi, @@ -50,6 +55,7 @@ export type ServiceFactory< factory(deps: DepsToDepFactories): Promise>; }; +/** @public */ export type AnyServiceFactory = ServiceFactory< unknown, unknown, diff --git a/packages/backend-plugin-api/src/wiring/types.ts b/packages/backend-plugin-api/src/wiring/types.ts index be4bf949e7..2b4aacb40a 100644 --- a/packages/backend-plugin-api/src/wiring/types.ts +++ b/packages/backend-plugin-api/src/wiring/types.ts @@ -25,9 +25,8 @@ export type ExtensionPoint = { id: string; /** - * Utility for getting the type of the extension point, using `typeof - * extensionPoint.T`. Attempting to actually read this value will result in an - * exception. + * Utility for getting the type of the extension point, using `typeof extensionPoint.T`. + * Attempting to actually read this value will result in an exception. */ T: T; @@ -36,6 +35,7 @@ export type ExtensionPoint = { $$ref: 'extension-point'; }; +/** @public */ export function createExtensionPoint(options: { id: string; }): ExtensionPoint { @@ -51,6 +51,7 @@ export function createExtensionPoint(options: { }; } +/** @public */ export interface BackendInitRegistry { registerExtensionPoint( ref: ServiceRef, @@ -62,16 +63,19 @@ export interface BackendInitRegistry { }): void; } +/** @public */ export interface BackendRegistrable { id: string; register(reg: BackendInitRegistry): void; } +/** @public */ export interface BackendPluginConfig { id: string; register(reg: BackendInitRegistry, options: TOptions): void; } +/** @public */ export function createBackendPlugin( config: BackendPluginConfig, ): (option: TOptions) => BackendRegistrable { @@ -83,6 +87,7 @@ export function createBackendPlugin( }); } +/** @public */ export interface BackendModuleConfig { pluginId: string; moduleId: string; @@ -92,6 +97,7 @@ export interface BackendModuleConfig { ): void; } +/** @public */ export function createBackendModule( config: BackendModuleConfig, ): (option: TOptions) => BackendRegistrable {