diff --git a/.changeset/honest-shrimps-clap.md b/.changeset/honest-shrimps-clap.md new file mode 100644 index 0000000000..12ae623704 --- /dev/null +++ b/.changeset/honest-shrimps-clap.md @@ -0,0 +1,9 @@ +--- +'@backstage/catalog-client': minor +--- + +**BREAKING**: Removed the explicit `DiscoveryApi` and `FetchApi` export symbols, +which were unnecessary duplicates from the well known core ones. + +The `CATALOG_FILTER_EXISTS` symbol's value has changed. However, this should not +affect any code in practice. diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 13b2e6b5f0..a489b32179 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -71,7 +71,14 @@ export interface CatalogApi { // @public export class CatalogClient implements CatalogApi { - constructor(options: { discoveryApi: DiscoveryApi; fetchApi?: FetchApi }); + constructor(options: { + discoveryApi: { + getBaseUrl(pluginId: string): Promise; + }; + fetchApi?: { + fetch: typeof fetch; + }; + }); addLocation( { type, target, dryRun, presence }: AddLocationRequest, options?: CatalogRequestOptions, @@ -150,17 +157,7 @@ export type CatalogRequestOptions = { token?: string; }; -// @public -export type DiscoveryApi = { - getBaseUrl(pluginId: string): Promise; -}; - // @public export const ENTITY_STATUS_CATALOG_PROCESSING_TYPE = 'backstage.io/catalog-processing'; - -// @public -export type FetchApi = { - fetch: typeof fetch; -}; ``` diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index a446d249c0..009bc9a6cb 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -49,7 +49,10 @@ export class CatalogClient implements CatalogApi { private readonly discoveryApi: DiscoveryApi; private readonly fetchApi: FetchApi; - constructor(options: { discoveryApi: DiscoveryApi; fetchApi?: FetchApi }) { + constructor(options: { + discoveryApi: { getBaseUrl(pluginId: string): Promise }; + fetchApi?: { fetch: typeof fetch }; + }) { this.discoveryApi = options.discoveryApi; this.fetchApi = options.fetchApi || { fetch: crossFetch }; } diff --git a/packages/catalog-client/src/types/api.ts b/packages/catalog-client/src/types/api.ts index 0622d654fa..2177c41aa2 100644 --- a/packages/catalog-client/src/types/api.ts +++ b/packages/catalog-client/src/types/api.ts @@ -21,7 +21,10 @@ import { Entity, EntityName, Location } from '@backstage/catalog-model'; * * @public */ -export const CATALOG_FILTER_EXISTS = Symbol('CATALOG_FILTER_EXISTS'); +export const CATALOG_FILTER_EXISTS = Symbol.for( + // Random UUID to ensure no collisions + 'CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111', +); /** * A request type for retrieving catalog Entities. diff --git a/packages/catalog-client/src/types/index.ts b/packages/catalog-client/src/types/index.ts index f3c6fab4e9..cb6166c6d5 100644 --- a/packages/catalog-client/src/types/index.ts +++ b/packages/catalog-client/src/types/index.ts @@ -24,7 +24,5 @@ export type { CatalogEntityAncestorsRequest, CatalogEntityAncestorsResponse, } from './api'; -export type { DiscoveryApi } from './discovery'; -export type { FetchApi } from './fetch'; export { CATALOG_FILTER_EXISTS } from './api'; export { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from './status';