backend-plugin-api: remove factory function helper types

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-01-12 14:42:18 +01:00
parent d1e86013ef
commit 635287ead1
25 changed files with 76 additions and 202 deletions
+1 -5
View File
@@ -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 = {
@@ -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;
```
@@ -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;
```
@@ -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;
```
@@ -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 = {
@@ -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)
```
@@ -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 {
@@ -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 {
@@ -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<unknown, unknown>;
options: IncrementalEntityProviderOptions;
}[];
},
]
>;
export const incrementalIngestionEntityProviderCatalogModule: (options: {
providers: {
provider: IncrementalEntityProvider<unknown, unknown>;
options: IncrementalEntityProviderOptions;
}[];
}) => BackendFeature;
// @public (undocumented)
export type PluginEnvironment = {
@@ -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 {
+1 -2
View File
@@ -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<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;
// @alpha
export const catalogPlugin: FactoryFunction<BackendFeature, []>;
export const catalogPlugin: () => BackendFeature;
// @public
export interface CatalogProcessingEngine {
@@ -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;
```
@@ -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;
```
@@ -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;
```
@@ -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<BackendFeature, []>;
export const gerritEventRouterEventsModule: () => BackendFeature;
```
@@ -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<BackendFeature, []>;
export const githubEventRouterEventsModule: () => BackendFeature;
// @alpha
export const githubWebhookEventsModule: FactoryFunction<BackendFeature, []>;
export const githubWebhookEventsModule: () => BackendFeature;
```
@@ -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<BackendFeature, []>;
export const gitlabEventRouterEventsModule: () => BackendFeature;
// @alpha
export const gitlabWebhookEventsModule: FactoryFunction<BackendFeature, []>;
export const gitlabWebhookEventsModule: () => BackendFeature;
```
+1 -2
View File
@@ -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<BackendFeature, []>;
export const eventsPlugin: () => BackendFeature;
// @public
export class HttpPostIngressEventPublisher implements EventPublisher {
+4 -6
View File
@@ -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<BackendFeature, []>;
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 = {