diff --git a/.changeset/healthy-parents-enjoy.md b/.changeset/healthy-parents-enjoy.md new file mode 100644 index 0000000000..8e7157fadd --- /dev/null +++ b/.changeset/healthy-parents-enjoy.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': patch +--- + +Moving the generated types to `@backstage/plugin-catalog-common`. diff --git a/.changeset/wet-hairs-pretend.md b/.changeset/wet-hairs-pretend.md new file mode 100644 index 0000000000..bd2c3b9af9 --- /dev/null +++ b/.changeset/wet-hairs-pretend.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-common': minor +--- + +Moved the OpenAPI generated client from `@backstage/catalog-client` to this package. Use `@backstage/plugin-catalog-common/client` to directly access it. diff --git a/packages/catalog-client/api-report-alpha.md b/packages/catalog-client/api-report-alpha.md deleted file mode 100644 index 99e457e276..0000000000 --- a/packages/catalog-client/api-report-alpha.md +++ /dev/null @@ -1,558 +0,0 @@ -## API Report File for "@backstage/catalog-client" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts -// @public (undocumented) -export type AnalyzeLocation = { - body: AnalyzeLocationRequest; -}; - -// @public (undocumented) -export interface AnalyzeLocationEntityField { - description: string; - field: string; - state: AnalyzeLocationEntityFieldStateEnum; - // (undocumented) - value: string | null; -} - -// @public (undocumented) -export type AnalyzeLocationEntityFieldStateEnum = - | 'analysisSuggestedValue' - | 'analysisSuggestedNoValue' - | 'needsUserInput'; - -// @public -export interface AnalyzeLocationExistingEntity { - // (undocumented) - entity: Entity; - // (undocumented) - isRegistered: boolean; - // (undocumented) - location: LocationSpec; -} - -// @public -export interface AnalyzeLocationGenerateEntity { - // (undocumented) - entity: RecursivePartialEntity; - // (undocumented) - fields: Array; -} - -// @public (undocumented) -export interface AnalyzeLocationRequest { - // (undocumented) - catalogFileName?: string; - // (undocumented) - location: LocationInput; -} - -// @public (undocumented) -export interface AnalyzeLocationResponse { - // (undocumented) - existingEntityFiles: Array; - // (undocumented) - generateEntities: Array; -} - -// @public (undocumented) -export type CreateLocation = { - body: CreateLocationRequest; - query: { - dryRun?: string; - }; -}; - -// @public (undocumented) -export interface CreateLocation201Response { - // (undocumented) - entities: Array; - // (undocumented) - exists?: boolean; - // (undocumented) - location: Location_2; -} - -// @public (undocumented) -export interface CreateLocationRequest { - // (undocumented) - target: string; - // (undocumented) - type: string; -} - -// @public -export class DefaultApiClient { - constructor(options: { - discoveryApi: { - getBaseUrl(pluginId: string): Promise; - }; - fetchApi?: { - fetch: typeof fetch; - }; - }); - analyzeLocation( - request: AnalyzeLocation, - options?: RequestOptions, - ): Promise>; - createLocation( - request: CreateLocation, - options?: RequestOptions, - ): Promise>; - deleteEntityByUid( - request: DeleteEntityByUid, - options?: RequestOptions, - ): Promise>; - deleteLocation( - request: DeleteLocation, - options?: RequestOptions, - ): Promise>; - getEntities( - request: GetEntities, - options?: RequestOptions, - ): Promise>>; - getEntitiesByQuery( - request: GetEntitiesByQuery, - options?: RequestOptions, - ): Promise>; - getEntitiesByRefs( - request: GetEntitiesByRefs, - options?: RequestOptions, - ): Promise>; - getEntityAncestryByName( - request: GetEntityAncestryByName, - options?: RequestOptions, - ): Promise>; - getEntityByName( - request: GetEntityByName, - options?: RequestOptions, - ): Promise>; - getEntityByUid( - request: GetEntityByUid, - options?: RequestOptions, - ): Promise>; - getEntityFacets( - request: GetEntityFacets, - options?: RequestOptions, - ): Promise>; - getLocation( - request: GetLocation, - options?: RequestOptions, - ): Promise>; - getLocationByEntity( - request: GetLocationByEntity, - options?: RequestOptions, - ): Promise>; - getLocations( - request: GetLocations, - options?: RequestOptions, - ): Promise>>; - refreshEntity( - request: RefreshEntity, - options?: RequestOptions, - ): Promise>; - validateEntity( - request: ValidateEntity, - options?: RequestOptions, - ): Promise>; -} - -// @public (undocumented) -export type DeleteEntityByUid = { - path: { - uid: string; - }; -}; - -// @public (undocumented) -export type DeleteLocation = { - path: { - id: string; - }; -}; - -// @public (undocumented) -export interface EntitiesBatchResponse { - items: Array; -} - -// @public (undocumented) -export interface EntitiesQueryResponse { - items: Array; - // (undocumented) - pageInfo: EntitiesQueryResponsePageInfo; - // (undocumented) - totalItems: number; -} - -// @public (undocumented) -export interface EntitiesQueryResponsePageInfo { - nextCursor?: string; - prevCursor?: string; -} - -// @public -export interface Entity { - apiVersion: string; - kind: string; - // (undocumented) - metadata: EntityMeta; - relations?: Array; - spec?: { - [key: string]: any; - }; -} - -// @public (undocumented) -export interface EntityAncestryResponse { - // (undocumented) - items: Array; - // (undocumented) - rootEntityRef: string; -} - -// @public (undocumented) -export interface EntityAncestryResponseItemsInner { - // (undocumented) - entity: Entity; - // (undocumented) - parentEntityRefs: Array; -} - -// @public (undocumented) -export interface EntityFacet { - // (undocumented) - count: number; - // (undocumented) - value: string; -} - -// @public (undocumented) -export interface EntityFacetsResponse { - // (undocumented) - facets: { - [key: string]: Array; - }; -} - -// @public -export interface EntityLink { - icon?: string; - title?: string; - type?: string; - url: string; -} - -// @public -export interface EntityMeta { - // (undocumented) - [key: string]: any; - annotations?: { - [key: string]: string; - }; - description?: string; - etag?: string; - labels?: { - [key: string]: string; - }; - links?: Array; - name: string; - namespace?: string; - tags?: Array; - title?: string; - uid?: string; -} - -// @public -export interface EntityRelation { - targetRef: string; - type: string; -} - -// @public (undocumented) -export interface ErrorError { - // (undocumented) - code?: string; - // (undocumented) - message: string; - // (undocumented) - name: string; - // (undocumented) - stack?: string; -} - -// @public (undocumented) -export interface ErrorRequest { - // (undocumented) - method: string; - // (undocumented) - url: string; -} - -// @public (undocumented) -export interface ErrorResponse { - // (undocumented) - statusCode: number; -} - -// @public (undocumented) -export type GetEntities = { - query: { - fields?: Array; - limit?: number; - filter?: Array; - offset?: number; - after?: string; - order?: Array; - }; -}; - -// @public (undocumented) -export type GetEntitiesByQuery = { - query: { - fields?: Array; - limit?: number; - orderField?: Array; - cursor?: string; - filter?: Array; - fullTextFilterTerm?: string; - fullTextFilterFields?: Array; - }; -}; - -// @public (undocumented) -export type GetEntitiesByRefs = { - body: GetEntitiesByRefsRequest; - query: { - filter?: Array; - }; -}; - -// @public (undocumented) -export interface GetEntitiesByRefsRequest { - // (undocumented) - entityRefs: Array; - // (undocumented) - fields?: Array; -} - -// @public (undocumented) -export type GetEntityAncestryByName = { - path: { - kind: string; - namespace: string; - name: string; - }; -}; - -// @public (undocumented) -export type GetEntityByName = { - path: { - kind: string; - namespace: string; - name: string; - }; -}; - -// @public (undocumented) -export type GetEntityByUid = { - path: { - uid: string; - }; -}; - -// @public (undocumented) -export type GetEntityFacets = { - query: { - facet: Array; - filter?: Array; - }; -}; - -// @public (undocumented) -export type GetLocation = { - path: { - id: string; - }; -}; - -// @public (undocumented) -export type GetLocationByEntity = { - path: { - kind: string; - namespace: string; - name: string; - }; -}; - -// @public (undocumented) -export type GetLocations = {}; - -// @public (undocumented) -export interface GetLocations200ResponseInner { - // (undocumented) - data: Location_2; -} - -// @public -interface Location_2 { - // (undocumented) - id: string; - // (undocumented) - target: string; - // (undocumented) - type: string; -} -export { Location_2 as Location }; - -// @public (undocumented) -export interface LocationInput { - // (undocumented) - target: string; - // (undocumented) - type: string; -} - -// @public -export interface LocationSpec { - // (undocumented) - target: string; - // (undocumented) - type: string; -} - -// @public (undocumented) -export interface ModelError { - // (undocumented) - [key: string]: any; - // (undocumented) - error: ErrorError; - // (undocumented) - request?: ErrorRequest; - // (undocumented) - response: ErrorResponse; -} - -// @public -export type NullableEntity = { - relations?: Array; - spec?: { - [key: string]: any; - }; - metadata: EntityMeta; - kind: string; - apiVersion: string; -} | null; - -// @public -export interface RecursivePartialEntity { - apiVersion?: string; - kind?: string; - // (undocumented) - metadata?: RecursivePartialEntityMeta; - relations?: Array; - spec?: { - [key: string]: any; - }; -} - -// @public (undocumented) -export interface RecursivePartialEntityMeta { - annotations?: { - [key: string]: string; - }; - description?: string; - etag?: string; - labels?: { - [key: string]: string; - }; - links?: Array; - name?: string; - namespace?: string; - tags?: Array; - title?: string; - uid?: string; -} - -// @public -export interface RecursivePartialEntityMetaAllOf { - annotations?: { - [key: string]: string; - }; - description?: string; - etag?: string; - labels?: { - [key: string]: string; - }; - links?: Array; - name?: string; - namespace?: string; - tags?: Array; - title?: string; - uid?: string; -} - -// @public -export interface RecursivePartialEntityRelation { - targetRef?: string; - type?: string; -} - -// @public (undocumented) -export type RefreshEntity = { - body: RefreshEntityRequest; -}; - -// @public -export interface RefreshEntityRequest { - // (undocumented) - authorizationToken?: string; - entityRef: string; -} - -// @public -export interface RequestOptions { - // (undocumented) - token?: string; -} - -// @public -export type TypedResponse = Omit & { - json: () => Promise; -}; - -// @public (undocumented) -export type ValidateEntity = { - body: ValidateEntityRequest; -}; - -// @public (undocumented) -export interface ValidateEntity400Response { - // (undocumented) - errors: Array; -} - -// @public (undocumented) -export interface ValidateEntity400ResponseErrorsInner { - // (undocumented) - [key: string]: any; - // (undocumented) - message: string; - // (undocumented) - name: string; -} - -// @public (undocumented) -export interface ValidateEntityRequest { - // (undocumented) - entity: { - [key: string]: any; - }; - // (undocumented) - location: string; -} - -// (No @packageDocumentation comment for this package) -``` diff --git a/packages/catalog-client/src/alpha.ts b/packages/catalog-client/src/alpha.ts deleted file mode 100644 index 730b2f3c45..0000000000 --- a/packages/catalog-client/src/alpha.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2024 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. - */ -export * from './generated';