diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index 42e05722c4..7737cdc7cf 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -14,11 +14,8 @@ import { Config } from '@backstage/config'; import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { Entity } from '@backstage/catalog-model'; import { EntityPolicy } from '@backstage/catalog-model'; -import express from 'express'; import { GetEntitiesRequest } from '@backstage/catalog-client'; -import { JsonObject } from '@backstage/types'; import { JsonValue } from '@backstage/types'; -import { Location as Location_2 } from '@backstage/catalog-client'; import { Logger } from 'winston'; import { Permission } from '@backstage/plugin-permission-common'; import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; @@ -121,10 +118,7 @@ export class CatalogBuilder { ): void; addProcessor(...processors: CatalogProcessor[]): CatalogBuilder; build(): Promise<{ - entitiesCatalog: EntitiesCatalog; - locationAnalyzer: LocationAnalyzer; processingEngine: CatalogProcessingEngine; - locationService: LocationService; router: Router; }>; static create(env: CatalogEnvironment): CatalogBuilder; @@ -187,12 +181,6 @@ export interface CatalogProcessingEngine { stop(): Promise; } -// @public -export interface CatalogProcessingOrchestrator { - // (undocumented) - process(request: EntityProcessingRequest): Promise; -} - // @public (undocumented) export type CatalogProcessor = { getProcessorName(): string; @@ -320,9 +308,6 @@ export function createRandomProcessingInterval(options: { maxSeconds: number; }): ProcessingIntervalFunction; -// @public -export function createRouter(options: RouterOptions): Promise; - // @public @deprecated (undocumented) export class DefaultCatalogCollator { constructor(options: { @@ -389,22 +374,6 @@ export type DefaultCatalogCollatorFactoryOptions = { catalogClient?: CatalogApi; }; -// @public (undocumented) -export class DefaultCatalogProcessingOrchestrator - implements CatalogProcessingOrchestrator -{ - constructor(options: { - processors: CatalogProcessor[]; - integrations: ScmIntegrationRegistry; - logger: Logger; - parser: CatalogProcessorParser; - policy: EntityPolicy; - rulesEnforcer: CatalogRulesEnforcer; - }); - // (undocumented) - process(request: EntityProcessingRequest): Promise; -} - // @public export class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer { constructor(rules: CatalogRule[]); @@ -504,27 +473,6 @@ export type EntityPagination = { after?: string; }; -// @public -export type EntityProcessingRequest = { - entity: Entity; - state?: JsonObject; -}; - -// @public -export type EntityProcessingResult = - | { - ok: true; - state: JsonObject; - completedEntity: Entity; - deferredEntities: DeferredEntity[]; - relations: EntityRelationSpec[]; - errors: Error[]; - } - | { - ok: false; - errors: Error[]; - }; - // @public export interface EntityProvider { connect(connection: EntityProviderConnection): Promise; @@ -593,48 +541,6 @@ export type LocationEntityProcessorOptions = { integrations: ScmIntegrationRegistry; }; -// @public -export interface LocationInput { - // (undocumented) - target: string; - // (undocumented) - type: string; -} - -// @public -export interface LocationService { - // (undocumented) - createLocation( - location: LocationInput, - dryRun: boolean, - options?: { - authorizationToken?: string; - }, - ): Promise<{ - location: Location_2; - entities: Entity[]; - exists?: boolean; - }>; - // (undocumented) - deleteLocation( - id: string, - options?: { - authorizationToken?: string; - }, - ): Promise; - // (undocumented) - getLocation( - id: string, - options?: { - authorizationToken?: string; - }, - ): Promise; - // (undocumented) - listLocations(options?: { - authorizationToken?: string; - }): Promise; -} - // @public export type LocationSpec = { type: string; @@ -642,18 +548,6 @@ export type LocationSpec = { presence?: 'optional' | 'required'; }; -// @public -export interface LocationStore { - // (undocumented) - createLocation(location: LocationInput): Promise; - // (undocumented) - deleteLocation(id: string): Promise; - // (undocumented) - getLocation(id: string): Promise; - // (undocumented) - listLocations(): Promise; -} - // @public (undocumented) export type PageInfo = | { @@ -760,35 +654,6 @@ export const processingResult: Readonly<{ readonly relation: (spec: EntityRelationSpec) => CatalogProcessorResult; }>; -// @public -export type RefreshOptions = { - entityRef: string; - authorizationToken?: string; -}; - -// @public -export interface RefreshService { - refresh(options: RefreshOptions): Promise; -} - -// @public -export interface RouterOptions { - // (undocumented) - config: Config; - // (undocumented) - entitiesCatalog?: EntitiesCatalog; - // (undocumented) - locationAnalyzer?: LocationAnalyzer; - // (undocumented) - locationService: LocationService; - // (undocumented) - logger: Logger; - // (undocumented) - permissionIntegrationRouter?: express.Router; - // (undocumented) - refreshService?: RefreshService; -} - // @public (undocumented) export class UrlReaderProcessor implements CatalogProcessor { constructor(options: { reader: UrlReader; logger: Logger }); diff --git a/plugins/catalog-backend/src/modules/core/DefaultLocationStore.ts b/plugins/catalog-backend/src/modules/core/DefaultLocationStore.ts index d637f4eda0..0d4bedabbb 100644 --- a/plugins/catalog-backend/src/modules/core/DefaultLocationStore.ts +++ b/plugins/catalog-backend/src/modules/core/DefaultLocationStore.ts @@ -22,7 +22,7 @@ import { DbLocationsRow } from '../../database/tables'; import { getEntityLocationRef } from '../../processing/util'; import { EntityProvider, EntityProviderConnection } from '../../api'; import { locationSpecToLocationEntity } from '../../util/conversion'; -import { LocationInput, LocationStore } from '../../service'; +import { LocationInput, LocationStore } from '../../service/types'; export class DefaultLocationStore implements LocationStore, EntityProvider { private _connection: EntityProviderConnection | undefined; diff --git a/plugins/catalog-backend/src/processing/index.ts b/plugins/catalog-backend/src/processing/index.ts index 315cea37d7..b392c3aa76 100644 --- a/plugins/catalog-backend/src/processing/index.ts +++ b/plugins/catalog-backend/src/processing/index.ts @@ -14,14 +14,7 @@ * limitations under the License. */ -export type { - CatalogProcessingOrchestrator, - CatalogProcessingEngine, - EntityProcessingRequest, - EntityProcessingResult, - DeferredEntity, -} from './types'; -export { DefaultCatalogProcessingOrchestrator } from './DefaultCatalogProcessingOrchestrator'; +export type { CatalogProcessingEngine, DeferredEntity } from './types'; export { createRandomProcessingInterval } from './refresh'; export type { ProcessingIntervalFunction } from './refresh'; diff --git a/plugins/catalog-backend/src/service/CatalogBuilder.ts b/plugins/catalog-backend/src/service/CatalogBuilder.ts index 8dd507c74e..fb4ed6086f 100644 --- a/plugins/catalog-backend/src/service/CatalogBuilder.ts +++ b/plugins/catalog-backend/src/service/CatalogBuilder.ts @@ -32,7 +32,7 @@ import { ScmIntegrations } from '@backstage/integration'; import { createHash } from 'crypto'; import { Router } from 'express'; import lodash, { keyBy } from 'lodash'; -import { EntitiesCatalog, EntitiesSearchFilter } from '../catalog'; +import { EntitiesSearchFilter } from '../catalog'; import { CatalogProcessor, @@ -76,7 +76,6 @@ import { AuthorizedRefreshService } from './AuthorizedRefreshService'; import { DefaultCatalogRulesEnforcer } from '../ingestion/CatalogRules'; import { Config } from '@backstage/config'; import { Logger } from 'winston'; -import { LocationService } from './types'; import { connectEntityProviders } from '../processing/connectEntityProviders'; import { permissionRules as catalogPermissionRules } from '../permissions/rules'; import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; @@ -355,10 +354,7 @@ export class CatalogBuilder { * Wires up and returns all of the component parts of the catalog */ async build(): Promise<{ - entitiesCatalog: EntitiesCatalog; - locationAnalyzer: LocationAnalyzer; processingEngine: CatalogProcessingEngine; - locationService: LocationService; router: Router; }> { const { config, database, logger, permissions } = this.env; @@ -460,10 +456,7 @@ export class CatalogBuilder { await connectEntityProviders(processingDatabase, entityProviders); return { - entitiesCatalog, - locationAnalyzer, processingEngine, - locationService, router, }; } diff --git a/plugins/catalog-backend/src/service/index.ts b/plugins/catalog-backend/src/service/index.ts index e1c7f54475..b1e91e4382 100644 --- a/plugins/catalog-backend/src/service/index.ts +++ b/plugins/catalog-backend/src/service/index.ts @@ -14,14 +14,5 @@ * limitations under the License. */ -export type { - LocationService, - RefreshService, - RefreshOptions, - LocationStore, - LocationInput, -} from './types'; -export { createRouter } from './createRouter'; -export type { RouterOptions } from './createRouter'; export type { CatalogEnvironment } from './CatalogBuilder'; export { CatalogBuilder } from './CatalogBuilder';