diff --git a/.changeset/clever-pigs-drum.md b/.changeset/clever-pigs-drum.md new file mode 100644 index 0000000000..bbc8ee5f90 --- /dev/null +++ b/.changeset/clever-pigs-drum.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': patch +--- + +Export `CatalogRequestOptions` type diff --git a/.changeset/nasty-worms-approve.md b/.changeset/nasty-worms-approve.md new file mode 100644 index 0000000000..c3ed7c1b35 --- /dev/null +++ b/.changeset/nasty-worms-approve.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Export `CatalogClientWrapper` class diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 52757614a7..c356deed4f 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -34,8 +34,6 @@ export interface CatalogApi { location: AddLocationRequest, options?: CatalogRequestOptions, ): Promise; - // Warning: (ae-forgotten-export) The symbol "CatalogRequestOptions" needs to be exported by the entry point index.d.ts - // // (undocumented) getEntities( request?: CatalogEntitiesRequest, @@ -138,6 +136,13 @@ export type CatalogListResponse = { items: T[]; }; +// Warning: (ae-missing-release-tag) "CatalogRequestOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type CatalogRequestOptions = { + token?: string; +}; + // Warning: (ae-missing-release-tag) "ENTITY_STATUS_CATALOG_PROCESSING_TYPE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/catalog-client/src/types/index.ts b/packages/catalog-client/src/types/index.ts index 842d0393a4..6ec17fbae1 100644 --- a/packages/catalog-client/src/types/index.ts +++ b/packages/catalog-client/src/types/index.ts @@ -20,5 +20,6 @@ export type { CatalogApi, CatalogEntitiesRequest, CatalogListResponse, + CatalogRequestOptions, } from './api'; export { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from './status'; diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index a85954906a..ec8bd66385 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -5,12 +5,21 @@ ```ts /// +import { AddLocationRequest } from '@backstage/catalog-client'; +import { AddLocationResponse } from '@backstage/catalog-client'; import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { CatalogApi } from '@backstage/catalog-client'; +import { CatalogClient } from '@backstage/catalog-client'; +import { CatalogEntitiesRequest } from '@backstage/catalog-client'; +import { CatalogListResponse } from '@backstage/catalog-client'; +import { CatalogRequestOptions } from '@backstage/catalog-client'; import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { IconComponent } from '@backstage/core-plugin-api'; +import { IdentityApi } from '@backstage/core-plugin-api'; import { InfoCardVariants } from '@backstage/core-components'; +import { Location as Location_2 } from '@backstage/catalog-model'; import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; import { ReactNode } from 'react'; @@ -43,6 +52,53 @@ export const AboutField: ({ children, }: Props_3) => JSX.Element; +// Warning: (ae-missing-release-tag) "CatalogClientWrapper" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export class CatalogClientWrapper implements CatalogApi { + constructor(options: { client: CatalogClient; identityApi: IdentityApi }); + // (undocumented) + addLocation( + request: AddLocationRequest, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getEntities( + request?: CatalogEntitiesRequest, + options?: CatalogRequestOptions, + ): Promise>; + // (undocumented) + getEntityByName( + compoundName: EntityName, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getOriginLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeEntityByUid( + uid: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; +} + // Warning: (ae-missing-release-tag) "CatalogEntityPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog/src/CatalogClientWrapper.ts b/plugins/catalog/src/CatalogClientWrapper.ts index a10b968216..a46edb56b7 100644 --- a/plugins/catalog/src/CatalogClientWrapper.ts +++ b/plugins/catalog/src/CatalogClientWrapper.ts @@ -19,16 +19,13 @@ import { AddLocationRequest, AddLocationResponse, CatalogApi, + CatalogClient, CatalogEntitiesRequest, CatalogListResponse, - CatalogClient, + CatalogRequestOptions, } from '@backstage/catalog-client'; import { IdentityApi } from '@backstage/core-plugin-api'; -type CatalogRequestOptions = { - token?: string; -}; - /** * CatalogClient wrapper that injects identity token for all requests */ diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index f2f28679a5..4bef0950a2 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -15,6 +15,7 @@ */ export * from './components/AboutCard'; +export { CatalogClientWrapper } from './CatalogClientWrapper'; export { CatalogLayout } from './components/CatalogPage'; export { CatalogResultListItem } from './components/CatalogResultListItem'; export { CatalogTable } from './components/CatalogTable';