From 635287ead1ba4ce35df323bf8103bc7f4638db00 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 12 Jan 2023 14:42:18 +0100 Subject: [PATCH] backend-plugin-api: remove factory function helper types Signed-off-by: Patrik Oldsberg --- packages/backend-app-api/api-report.md | 69 +++++-------------- packages/backend-plugin-api/api-report.md | 19 ++--- .../src/services/system/types.ts | 13 ++-- packages/backend-plugin-api/src/types.ts | 31 --------- .../src/wiring/factories.ts | 11 ++- .../next/implementations/mockConfigService.ts | 16 +++-- plugins/app-backend/api-report.md | 6 +- .../catalog-backend-module-aws/api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 18 ++--- .../api-report.md | 6 +- plugins/catalog-backend/api-report.md | 3 +- .../api-report.md | 6 +- .../events-backend-module-azure/api-report.md | 6 +- .../api-report.md | 6 +- .../api-report.md | 3 +- .../api-report.md | 5 +- .../api-report.md | 5 +- plugins/events-backend/api-report.md | 3 +- plugins/scaffolder-backend/api-report.md | 10 ++- 25 files changed, 76 insertions(+), 202 deletions(-) delete mode 100644 packages/backend-plugin-api/src/types.ts diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 57f146aad8..199b0863de 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -13,7 +13,6 @@ import { ErrorRequestHandler } from 'express'; import { Express as Express_2 } from 'express'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { Handler } from 'express'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { HelmetOptions } from 'helmet'; import * as http from 'http'; import { HttpRouterService } from '@backstage/backend-plugin-api'; @@ -47,13 +46,10 @@ export interface Backend { } // @public (undocumented) -export const cacheFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const cacheFactory: () => ServiceFactory; // @public (undocumented) -export const configFactory: FactoryFunction, []>; +export const configFactory: () => ServiceFactory; // @public export function createHttpServer( @@ -76,10 +72,7 @@ export interface CreateSpecializedBackendOptions { } // @public (undocumented) -export const databaseFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const databaseFactory: () => ServiceFactory; // @public export class DefaultRootHttpRouter implements RootHttpRouterService { @@ -97,10 +90,7 @@ export interface DefaultRootHttpRouterOptions { } // @public (undocumented) -export const discoveryFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const discoveryFactory: () => ServiceFactory; // @public export interface ExtendedHttpServer extends http.Server { @@ -113,10 +103,9 @@ export interface ExtendedHttpServer extends http.Server { } // @public (undocumented) -export const httpRouterFactory: FactoryFunction< - ServiceFactory, - [options?: HttpRouterFactoryOptions | undefined] ->; +export const httpRouterFactory: ( + options?: HttpRouterFactoryOptions | undefined, +) => ServiceFactory; // @public (undocumented) export interface HttpRouterFactoryOptions { @@ -147,10 +136,7 @@ export type HttpServerOptions = { }; // @public (undocumented) -export const identityFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const identityFactory: () => ServiceFactory; // @public export type IdentityFactoryOptions = { @@ -159,13 +145,10 @@ export type IdentityFactoryOptions = { }; // @public -export const lifecycleFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const lifecycleFactory: () => ServiceFactory; // @public (undocumented) -export const loggerFactory: FactoryFunction, []>; +export const loggerFactory: () => ServiceFactory; // @public export class MiddlewareFactory { @@ -193,10 +176,7 @@ export interface MiddlewareFactoryOptions { } // @public (undocumented) -export const permissionsFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const permissionsFactory: () => ServiceFactory; // @public export function readCorsOptions(config?: Config): CorsOptions; @@ -224,10 +204,7 @@ export interface RootHttpRouterConfigureOptions { } // @public (undocumented) -export const rootHttpRouterFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const rootHttpRouterFactory: () => ServiceFactory; // @public (undocumented) export type RootHttpRouterFactoryOptions = { @@ -236,22 +213,13 @@ export type RootHttpRouterFactoryOptions = { }; // @public -export const rootLifecycleFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const rootLifecycleFactory: () => ServiceFactory; // @public (undocumented) -export const rootLoggerFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const rootLoggerFactory: () => ServiceFactory; // @public (undocumented) -export const schedulerFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const schedulerFactory: () => ServiceFactory; // @public (undocumented) export type ServiceOrExtensionPoint = @@ -259,11 +227,8 @@ export type ServiceOrExtensionPoint = | ServiceRef; // @public (undocumented) -export const tokenManagerFactory: FactoryFunction< - ServiceFactory, - [] ->; +export const tokenManagerFactory: () => ServiceFactory; // @public (undocumented) -export const urlReaderFactory: FactoryFunction, []>; +export const urlReaderFactory: () => ServiceFactory; ``` diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index 848744297e..33190277c9 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -113,13 +113,13 @@ export namespace coreServices { // @public export function createBackendModule( - config: FactoryFunctionConfig, -): FactoryFunction; + config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig), +): (...params: TOptions) => BackendFeature; // @public (undocumented) export function createBackendPlugin( - config: FactoryFunctionConfig, -): FactoryFunction; + config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), +): (...params: TOptions) => BackendFeature; // @public (undocumented) export function createExtensionPoint( @@ -136,11 +136,12 @@ export function createServiceFactory< }, TOpts extends [options?: object] = [], >( - config: FactoryFunctionConfig< - ServiceFactoryConfig, - TOpts - >, -): FactoryFunction, TOpts>; + config: + | ServiceFactoryConfig + | (( + ...options: TOpts + ) => ServiceFactoryConfig), +): (...params: TOpts) => ServiceFactory; // @public export function createServiceRef( diff --git a/packages/backend-plugin-api/src/services/system/types.ts b/packages/backend-plugin-api/src/services/system/types.ts index e9fd7bf971..34c0a50005 100644 --- a/packages/backend-plugin-api/src/services/system/types.ts +++ b/packages/backend-plugin-api/src/services/system/types.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -import { FactoryFunctionConfig, FactoryFunction } from '../../types'; - /** * TODO * @@ -162,11 +160,12 @@ export function createServiceFactory< TDeps extends { [name in string]: ServiceRef }, TOpts extends [options?: object] = [], >( - config: FactoryFunctionConfig< - ServiceFactoryConfig, - TOpts - >, -): FactoryFunction, TOpts> { + config: + | ServiceFactoryConfig + | (( + ...options: TOpts + ) => ServiceFactoryConfig), +): (...params: TOpts) => ServiceFactory { if (typeof config === 'function') { return (...opts: TOpts) => { const c = config(...opts); diff --git a/packages/backend-plugin-api/src/types.ts b/packages/backend-plugin-api/src/types.ts deleted file mode 100644 index a9f2316662..0000000000 --- a/packages/backend-plugin-api/src/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023 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. - */ - -/** - * @ignore - */ -export type FactoryFunctionConfig = - | TConfig - | ((...params: TParams) => TConfig); - -/** - * Helper type that makes the options argument optional if options are not required. - * - * @ignore - */ -export type FactoryFunction = ( - ...params: TParams -) => TResult; diff --git a/packages/backend-plugin-api/src/wiring/factories.ts b/packages/backend-plugin-api/src/wiring/factories.ts index 134471f7c1..31a64778f2 100644 --- a/packages/backend-plugin-api/src/wiring/factories.ts +++ b/packages/backend-plugin-api/src/wiring/factories.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { FactoryFunction, FactoryFunctionConfig } from '../types'; import { BackendRegistrationPoints, BackendFeature, @@ -50,10 +49,10 @@ export interface BackendPluginConfig { /** @public */ export function createBackendPlugin( - config: FactoryFunctionConfig, -): FactoryFunction { + config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), +): (...params: TOptions) => BackendFeature { if (typeof config === 'function') { - return config as FactoryFunction; + return config; } return () => config; @@ -83,8 +82,8 @@ export interface BackendModuleConfig { * The `pluginId` should exactly match the `id` of the plugin that the module extends. */ export function createBackendModule( - config: FactoryFunctionConfig, -): FactoryFunction { + config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig), +): (...params: TOptions) => BackendFeature { if (typeof config === 'function') { return (...options: TOptions) => { const c = config(...options); diff --git a/packages/backend-test-utils/src/next/implementations/mockConfigService.ts b/packages/backend-test-utils/src/next/implementations/mockConfigService.ts index 78a670585d..a5578b866f 100644 --- a/packages/backend-test-utils/src/next/implementations/mockConfigService.ts +++ b/packages/backend-test-utils/src/next/implementations/mockConfigService.ts @@ -22,10 +22,12 @@ import { ConfigReader } from '@backstage/config'; import { JsonObject } from '@backstage/types'; /** @public */ -export const mockConfigFactory = createServiceFactory({ - service: coreServices.config, - deps: {}, - async factory(_, options?: { data?: JsonObject }) { - return new ConfigReader(options?.data, 'mock-config'); - }, -}); +export const mockConfigFactory = createServiceFactory( + (options?: { data?: JsonObject }) => ({ + service: coreServices.config, + deps: {}, + async factory() { + return new ConfigReader(options?.data, 'mock-config'); + }, + }), +); diff --git a/plugins/app-backend/api-report.md b/plugins/app-backend/api-report.md index 1a430879e8..b52132ef51 100644 --- a/plugins/app-backend/api-report.md +++ b/plugins/app-backend/api-report.md @@ -6,15 +6,11 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { Logger } from 'winston'; import { PluginDatabaseManager } from '@backstage/backend-common'; // @alpha -export const appPlugin: FactoryFunction< - BackendFeature, - [options: AppPluginOptions] ->; +export const appPlugin: (options: AppPluginOptions) => BackendFeature; // @alpha (undocumented) export type AppPluginOptions = { diff --git a/plugins/catalog-backend-module-aws/api-report.md b/plugins/catalog-backend-module-aws/api-report.md index a054c48428..63b85f223b 100644 --- a/plugins/catalog-backend-module-aws/api-report.md +++ b/plugins/catalog-backend-module-aws/api-report.md @@ -11,7 +11,6 @@ import { Config } from '@backstage/config'; import { Credentials } from 'aws-sdk'; import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; @@ -91,8 +90,5 @@ export class AwsS3EntityProvider implements EntityProvider { } // @alpha -export const awsS3EntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const awsS3EntityProviderCatalogModule: () => BackendFeature; ``` diff --git a/plugins/catalog-backend-module-azure/api-report.md b/plugins/catalog-backend-module-azure/api-report.md index e7599a4d31..5ffae14b6b 100644 --- a/plugins/catalog-backend-module-azure/api-report.md +++ b/plugins/catalog-backend-module-azure/api-report.md @@ -9,7 +9,6 @@ import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; @@ -59,8 +58,5 @@ export class AzureDevOpsEntityProvider implements EntityProvider { } // @alpha -export const azureDevOpsEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const azureDevOpsEntityProviderCatalogModule: () => BackendFeature; ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/api-report.md b/plugins/catalog-backend-module-bitbucket-cloud/api-report.md index af9aa834ec..7ad6b3b3e0 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/api-report.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/api-report.md @@ -11,7 +11,6 @@ import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; import { EventParams } from '@backstage/plugin-events-node'; import { Events } from '@backstage/plugin-bitbucket-cloud-common'; import { EventSubscriber } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; import { TaskRunner } from '@backstage/backend-tasks'; @@ -49,8 +48,5 @@ export class BitbucketCloudEntityProvider } // @alpha (undocumented) -export const bitbucketCloudEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const bitbucketCloudEntityProviderCatalogModule: () => BackendFeature; ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/api-report.md b/plugins/catalog-backend-module-bitbucket-server/api-report.md index 41ed476c13..213f5d2573 100644 --- a/plugins/catalog-backend-module-bitbucket-server/api-report.md +++ b/plugins/catalog-backend-module-bitbucket-server/api-report.md @@ -9,7 +9,6 @@ import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; @@ -70,10 +69,7 @@ export class BitbucketServerEntityProvider implements EntityProvider { } // @alpha (undocumented) -export const bitbucketServerEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const bitbucketServerEntityProviderCatalogModule: () => BackendFeature; // @public (undocumented) export type BitbucketServerListOptions = { diff --git a/plugins/catalog-backend-module-gerrit/api-report.md b/plugins/catalog-backend-module-gerrit/api-report.md index 99387a1b60..870937f7ec 100644 --- a/plugins/catalog-backend-module-gerrit/api-report.md +++ b/plugins/catalog-backend-module-gerrit/api-report.md @@ -7,7 +7,6 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; import { TaskRunner } from '@backstage/backend-tasks'; @@ -32,10 +31,7 @@ export class GerritEntityProvider implements EntityProvider { } // @alpha (undocumented) -export const gerritEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const gerritEntityProviderCatalogModule: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/api-report.md b/plugins/catalog-backend-module-github/api-report.md index e09658dfc1..a66ec712c7 100644 --- a/plugins/catalog-backend-module-github/api-report.md +++ b/plugins/catalog-backend-module-github/api-report.md @@ -13,7 +13,6 @@ import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; import { EventParams } from '@backstage/plugin-events-node'; import { EventSubscriber } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { GithubCredentialsProvider } from '@backstage/integration'; import { GithubIntegrationConfig } from '@backstage/integration'; import { graphql } from '@octokit/graphql'; @@ -102,10 +101,7 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { } // @alpha -export const githubEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const githubEntityProviderCatalogModule: () => BackendFeature; // @public (undocumented) export class GithubLocationAnalyzer implements ScmLocationAnalyzer { diff --git a/plugins/catalog-backend-module-gitlab/api-report.md b/plugins/catalog-backend-module-gitlab/api-report.md index 21b0d9fdc3..36713d2427 100644 --- a/plugins/catalog-backend-module-gitlab/api-report.md +++ b/plugins/catalog-backend-module-gitlab/api-report.md @@ -9,7 +9,6 @@ import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; @@ -35,10 +34,7 @@ export class GitlabDiscoveryEntityProvider implements EntityProvider { } // @alpha -export const gitlabDiscoveryEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const gitlabDiscoveryEntityProviderCatalogModule: () => BackendFeature; // @public export class GitLabDiscoveryProcessor implements CatalogProcessor { diff --git a/plugins/catalog-backend-module-incremental-ingestion/api-report.md b/plugins/catalog-backend-module-incremental-ingestion/api-report.md index 5dc0c45551..387e505c33 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/api-report.md +++ b/plugins/catalog-backend-module-incremental-ingestion/api-report.md @@ -10,7 +10,6 @@ import { CatalogBuilder } from '@backstage/plugin-catalog-backend'; import type { Config } from '@backstage/config'; import type { DeferredEntity } from '@backstage/plugin-catalog-backend'; import type { DurationObjectUnits } from 'luxon'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import type { Logger } from 'winston'; import type { PermissionEvaluator } from '@backstage/plugin-permission-common'; import type { PluginDatabaseManager } from '@backstage/backend-common'; @@ -69,17 +68,12 @@ export interface IncrementalEntityProviderOptions { } // @alpha -export const incrementalIngestionEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [ - options: { - providers: { - provider: IncrementalEntityProvider; - options: IncrementalEntityProviderOptions; - }[]; - }, - ] ->; +export const incrementalIngestionEntityProviderCatalogModule: (options: { + providers: { + provider: IncrementalEntityProvider; + options: IncrementalEntityProviderOptions; + }[]; +}) => BackendFeature; // @public (undocumented) export type PluginEnvironment = { diff --git a/plugins/catalog-backend-module-msgraph/api-report.md b/plugins/catalog-backend-module-msgraph/api-report.md index 9a0f8cc0db..a5abdc17c6 100644 --- a/plugins/catalog-backend-module-msgraph/api-report.md +++ b/plugins/catalog-backend-module-msgraph/api-report.md @@ -9,7 +9,6 @@ import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-backend'; import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { GroupEntity } from '@backstage/catalog-model'; import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { Logger } from 'winston'; @@ -136,10 +135,7 @@ export class MicrosoftGraphOrgEntityProvider implements EntityProvider { } // @alpha -export const microsoftGraphOrgEntityProviderCatalogModule: FactoryFunction< - BackendFeature, - [] ->; +export const microsoftGraphOrgEntityProviderCatalogModule: () => BackendFeature; // @alpha export interface MicrosoftGraphOrgEntityProviderCatalogModuleOptions { diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index ac5d42a6e9..6ff9ac4b1f 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -34,7 +34,6 @@ import { EntityProvider } from '@backstage/plugin-catalog-node'; import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; import { EntityProviderMutation } from '@backstage/plugin-catalog-node'; import { EntityRelationSpec } from '@backstage/plugin-catalog-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { GetEntitiesRequest } from '@backstage/catalog-client'; import { JsonValue } from '@backstage/types'; import { LocationEntityV1alpha1 } from '@backstage/catalog-model'; @@ -238,7 +237,7 @@ export type CatalogPermissionRule< > = PermissionRule; // @alpha -export const catalogPlugin: FactoryFunction; +export const catalogPlugin: () => BackendFeature; // @public export interface CatalogProcessingEngine { diff --git a/plugins/events-backend-module-aws-sqs/api-report.md b/plugins/events-backend-module-aws-sqs/api-report.md index b50ba0884e..ede18f2787 100644 --- a/plugins/events-backend-module-aws-sqs/api-report.md +++ b/plugins/events-backend-module-aws-sqs/api-report.md @@ -7,7 +7,6 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EventBroker } from '@backstage/plugin-events-node'; import { EventPublisher } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; @@ -24,8 +23,5 @@ export class AwsSqsConsumingEventPublisher implements EventPublisher { } // @alpha -export const awsSqsConsumingEventPublisherEventsModule: FactoryFunction< - BackendFeature, - [] ->; +export const awsSqsConsumingEventPublisherEventsModule: () => BackendFeature; ``` diff --git a/plugins/events-backend-module-azure/api-report.md b/plugins/events-backend-module-azure/api-report.md index d974bfee6b..2e13a7ed4a 100644 --- a/plugins/events-backend-module-azure/api-report.md +++ b/plugins/events-backend-module-azure/api-report.md @@ -5,7 +5,6 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; import { EventParams } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; // @public @@ -16,8 +15,5 @@ export class AzureDevOpsEventRouter extends SubTopicEventRouter { } // @alpha -export const azureDevOpsEventRouterEventsModule: FactoryFunction< - BackendFeature, - [] ->; +export const azureDevOpsEventRouterEventsModule: () => BackendFeature; ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/api-report.md b/plugins/events-backend-module-bitbucket-cloud/api-report.md index 69f5570cf5..c47252ce17 100644 --- a/plugins/events-backend-module-bitbucket-cloud/api-report.md +++ b/plugins/events-backend-module-bitbucket-cloud/api-report.md @@ -5,7 +5,6 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; import { EventParams } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; // @public @@ -16,8 +15,5 @@ export class BitbucketCloudEventRouter extends SubTopicEventRouter { } // @alpha -export const bitbucketCloudEventRouterEventsModule: FactoryFunction< - BackendFeature, - [] ->; +export const bitbucketCloudEventRouterEventsModule: () => BackendFeature; ``` diff --git a/plugins/events-backend-module-gerrit/api-report.md b/plugins/events-backend-module-gerrit/api-report.md index 868505f773..c8d4a7c9b6 100644 --- a/plugins/events-backend-module-gerrit/api-report.md +++ b/plugins/events-backend-module-gerrit/api-report.md @@ -5,7 +5,6 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; import { EventParams } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; // @public @@ -16,5 +15,5 @@ export class GerritEventRouter extends SubTopicEventRouter { } // @alpha -export const gerritEventRouterEventsModule: FactoryFunction; +export const gerritEventRouterEventsModule: () => BackendFeature; ``` diff --git a/plugins/events-backend-module-github/api-report.md b/plugins/events-backend-module-github/api-report.md index 3b8905f6b0..4f14bce789 100644 --- a/plugins/events-backend-module-github/api-report.md +++ b/plugins/events-backend-module-github/api-report.md @@ -6,7 +6,6 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EventParams } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { RequestValidator } from '@backstage/plugin-events-node'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; @@ -23,8 +22,8 @@ export class GithubEventRouter extends SubTopicEventRouter { } // @alpha -export const githubEventRouterEventsModule: FactoryFunction; +export const githubEventRouterEventsModule: () => BackendFeature; // @alpha -export const githubWebhookEventsModule: FactoryFunction; +export const githubWebhookEventsModule: () => BackendFeature; ``` diff --git a/plugins/events-backend-module-gitlab/api-report.md b/plugins/events-backend-module-gitlab/api-report.md index 4900b548a9..2a88295032 100644 --- a/plugins/events-backend-module-gitlab/api-report.md +++ b/plugins/events-backend-module-gitlab/api-report.md @@ -6,7 +6,6 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EventParams } from '@backstage/plugin-events-node'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { RequestValidator } from '@backstage/plugin-events-node'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; @@ -21,8 +20,8 @@ export class GitlabEventRouter extends SubTopicEventRouter { } // @alpha -export const gitlabEventRouterEventsModule: FactoryFunction; +export const gitlabEventRouterEventsModule: () => BackendFeature; // @alpha -export const gitlabWebhookEventsModule: FactoryFunction; +export const gitlabWebhookEventsModule: () => BackendFeature; ``` diff --git a/plugins/events-backend/api-report.md b/plugins/events-backend/api-report.md index 87700237b9..28437772ae 100644 --- a/plugins/events-backend/api-report.md +++ b/plugins/events-backend/api-report.md @@ -9,7 +9,6 @@ import { EventBroker } from '@backstage/plugin-events-node'; import { EventPublisher } from '@backstage/plugin-events-node'; import { EventSubscriber } from '@backstage/plugin-events-node'; import express from 'express'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { HttpPostIngressOptions } from '@backstage/plugin-events-node'; import { Logger } from 'winston'; @@ -30,7 +29,7 @@ export class EventsBackend { } // @alpha -export const eventsPlugin: FactoryFunction; +export const eventsPlugin: () => BackendFeature; // @public export class HttpPostIngressEventPublisher implements EventPublisher { diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 29590f76b1..21026c203c 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -13,7 +13,6 @@ import { Config } from '@backstage/config'; import { createPullRequest } from 'octokit-plugin-create-pull-request'; import { Entity } from '@backstage/catalog-model'; import express from 'express'; -import { FactoryFunction } from '@backstage/backend-plugin-api/src/types'; import { GithubCredentialsProvider } from '@backstage/integration'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { JsonObject } from '@backstage/types'; @@ -626,7 +625,7 @@ export type RunCommandOptions = { }; // @alpha -export const scaffolderCatalogModule: FactoryFunction; +export const scaffolderCatalogModule: () => BackendFeature; // @public (undocumented) export class ScaffolderEntitiesProcessor implements CatalogProcessor { @@ -643,10 +642,9 @@ export class ScaffolderEntitiesProcessor implements CatalogProcessor { } // @alpha -export const scaffolderPlugin: FactoryFunction< - BackendFeature, - [options: ScaffolderPluginOptions] ->; +export const scaffolderPlugin: ( + options: ScaffolderPluginOptions, +) => BackendFeature; // @alpha export type ScaffolderPluginOptions = {