diff --git a/.changeset/cyan-oranges-sit.md b/.changeset/cyan-oranges-sit.md new file mode 100644 index 0000000000..8a3244745f --- /dev/null +++ b/.changeset/cyan-oranges-sit.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-model': patch +--- + +Deprecates the `Location` type export from this package. Imports of the `Location` type should now be done from the `@backstage/catalog-client` package instead. diff --git a/.changeset/fast-stingrays-hope.md b/.changeset/fast-stingrays-hope.md new file mode 100644 index 0000000000..688f14c548 --- /dev/null +++ b/.changeset/fast-stingrays-hope.md @@ -0,0 +1,8 @@ +--- +'@backstage/plugin-catalog': patch +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-catalog-backend-module-ldap': patch +--- + +Import `Location` from the `@backstage/catalog-client` package. diff --git a/.changeset/purple-files-hang.md b/.changeset/purple-files-hang.md new file mode 100644 index 0000000000..680de46a80 --- /dev/null +++ b/.changeset/purple-files-hang.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': patch +--- + +Export the `Location` type that was previously exported by the `@backstage/catalog-model` package. diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 829acc221b..090a1dbcc4 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -5,7 +5,7 @@ ```ts import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; -import { Location as Location_2 } from '@backstage/catalog-model'; +import { LocationSpec } from '@backstage/catalog-model'; // @public export type AddLocationRequest = { @@ -177,4 +177,10 @@ export interface GetEntityAncestorsResponse { // (undocumented) rootEntityRef: string; } + +// @public +type Location_2 = { + id: string; +} & LocationSpec; +export { Location_2 as Location }; ``` diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index 618df7b607..eea77d3f98 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -17,7 +17,6 @@ import { Entity, EntityName, - Location, LOCATION_ANNOTATION, ORIGIN_LOCATION_ANNOTATION, parseEntityRef, @@ -36,6 +35,7 @@ import { CatalogRequestOptions, GetEntityAncestorsRequest, GetEntityAncestorsResponse, + Location, } from './types/api'; import { DiscoveryApi } from './types/discovery'; import { FetchApi } from './types/fetch'; diff --git a/packages/catalog-client/src/types/api.ts b/packages/catalog-client/src/types/api.ts index 10e2e14a81..bf5a7327c6 100644 --- a/packages/catalog-client/src/types/api.ts +++ b/packages/catalog-client/src/types/api.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Entity, EntityName, Location } from '@backstage/catalog-model'; +import { Entity, EntityName, LocationSpec } from '@backstage/catalog-model'; /** * This symbol can be used in place of a value when passed to filters in e.g. @@ -151,6 +151,15 @@ export interface CatalogRequestOptions { token?: string; } +/** + * Entity location for a specific entity. + * + * @public + */ +export type Location = { + id: string; +} & LocationSpec; + /** * The request type for {@link CatalogClient.addLocation}. * diff --git a/packages/catalog-client/src/types/index.ts b/packages/catalog-client/src/types/index.ts index 95a9a10416..580bb7330d 100644 --- a/packages/catalog-client/src/types/index.ts +++ b/packages/catalog-client/src/types/index.ts @@ -24,6 +24,7 @@ export type { GetEntitiesResponse, GetEntityAncestorsRequest, GetEntityAncestorsResponse, + Location, } from './api'; export { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from './status'; export * from './deprecated'; diff --git a/packages/catalog-model/api-report.md b/packages/catalog-model/api-report.md index 18e66813fb..5124945933 100644 --- a/packages/catalog-model/api-report.md +++ b/packages/catalog-model/api-report.md @@ -319,7 +319,7 @@ export class KubernetesValidatorFunctions { static isValidObjectName(value: unknown): boolean; } -// @public +// @public @deprecated type Location_2 = { id: string; } & LocationSpec; diff --git a/packages/catalog-model/src/location/types.ts b/packages/catalog-model/src/location/types.ts index 725f873f2d..2ed8fd717b 100644 --- a/packages/catalog-model/src/location/types.ts +++ b/packages/catalog-model/src/location/types.ts @@ -35,6 +35,7 @@ export type LocationSpec = { * Entity location for a specific entity. * * @public + * @deprecated import from {@link @backstage/catalog-client#Location} instead. */ export type Location = { id: string; diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index b4984fb8c7..d97df9967c 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -22,7 +22,7 @@ import { GitHubIntegrationConfig } from '@backstage/integration'; import { IndexableDocument } from '@backstage/search-common'; import { JsonObject } from '@backstage/types'; import { JsonValue } from '@backstage/types'; -import { Location as Location_2 } from '@backstage/catalog-model'; +import { Location as Location_2 } from '@backstage/catalog-client'; import { LocationSpec } from '@backstage/catalog-model'; import { Logger as Logger_2 } from 'winston'; import { Organizations } from 'aws-sdk'; diff --git a/plugins/catalog-backend/src/providers/DefaultLocationStore.ts b/plugins/catalog-backend/src/providers/DefaultLocationStore.ts index 9214cd0bc1..f93afedbaa 100644 --- a/plugins/catalog-backend/src/providers/DefaultLocationStore.ts +++ b/plugins/catalog-backend/src/providers/DefaultLocationStore.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Location, LocationSpec } from '@backstage/catalog-model'; +import { LocationSpec } from '@backstage/catalog-model'; +import { Location } from '@backstage/catalog-client'; import { ConflictError, NotFoundError } from '@backstage/errors'; import { Knex } from 'knex'; import { v4 as uuid } from 'uuid'; diff --git a/plugins/catalog-backend/src/service/AuthorizedLocationService.ts b/plugins/catalog-backend/src/service/AuthorizedLocationService.ts index 1ae2833cd0..13557102c9 100644 --- a/plugins/catalog-backend/src/service/AuthorizedLocationService.ts +++ b/plugins/catalog-backend/src/service/AuthorizedLocationService.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { LocationSpec, Location, Entity } from '@backstage/catalog-model'; +import { Location } from '@backstage/catalog-client'; +import { LocationSpec, Entity } from '@backstage/catalog-model'; import { NotAllowedError, NotFoundError } from '@backstage/errors'; import { catalogLocationCreatePermission, diff --git a/plugins/catalog-backend/src/service/DefaultLocationService.ts b/plugins/catalog-backend/src/service/DefaultLocationService.ts index 8dd2274842..abc82084e2 100644 --- a/plugins/catalog-backend/src/service/DefaultLocationService.ts +++ b/plugins/catalog-backend/src/service/DefaultLocationService.ts @@ -15,12 +15,12 @@ */ import { Entity, - Location, LocationSpec, LOCATION_ANNOTATION, ORIGIN_LOCATION_ANNOTATION, stringifyEntityRef, } from '@backstage/catalog-model'; +import { Location } from '@backstage/catalog-client'; import { CatalogProcessingOrchestrator, DeferredEntity, diff --git a/plugins/catalog-backend/src/service/createRouter.test.ts b/plugins/catalog-backend/src/service/createRouter.test.ts index 205be01b42..6ae24ecd27 100644 --- a/plugins/catalog-backend/src/service/createRouter.test.ts +++ b/plugins/catalog-backend/src/service/createRouter.test.ts @@ -17,7 +17,8 @@ import { getVoidLogger } from '@backstage/backend-common'; import { ConfigReader } from '@backstage/config'; import { NotFoundError } from '@backstage/errors'; -import type { Entity, LocationSpec, Location } from '@backstage/catalog-model'; +import type { Location } from '@backstage/catalog-client'; +import type { Entity, LocationSpec } from '@backstage/catalog-model'; import express from 'express'; import request from 'supertest'; import { EntitiesCatalog } from '../catalog'; diff --git a/plugins/catalog-backend/src/service/types.ts b/plugins/catalog-backend/src/service/types.ts index 02d234b6a8..c923949a04 100644 --- a/plugins/catalog-backend/src/service/types.ts +++ b/plugins/catalog-backend/src/service/types.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Entity, LocationSpec, Location } from '@backstage/catalog-model'; +import { Entity, LocationSpec } from '@backstage/catalog-model'; +import { Location } from '@backstage/catalog-client'; export interface LocationService { createLocation( diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx index 8d6083f111..d9d9fcf1db 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx @@ -14,12 +14,8 @@ * limitations under the License. */ -import { - Entity, - Location, - ORIGIN_LOCATION_ANNOTATION, -} from '@backstage/catalog-model'; -import { CatalogApi } from '@backstage/catalog-client'; +import { Entity, ORIGIN_LOCATION_ANNOTATION } from '@backstage/catalog-model'; +import { CatalogApi, Location } from '@backstage/catalog-client'; import { catalogApiRef } from '../../api'; import { act, diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 22a9dffaba..d526d4dee1 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -22,7 +22,7 @@ import { GetEntityAncestorsResponse } from '@backstage/catalog-client'; 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 { Location as Location_2 } from '@backstage/catalog-client'; import { Overrides } from '@material-ui/core/styles/overrides'; import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; diff --git a/plugins/catalog/src/CatalogClientWrapper.ts b/plugins/catalog/src/CatalogClientWrapper.ts index e34273c19f..b54ac0ed61 100644 --- a/plugins/catalog/src/CatalogClientWrapper.ts +++ b/plugins/catalog/src/CatalogClientWrapper.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Entity, EntityName, Location } from '@backstage/catalog-model'; +import { Entity, EntityName } from '@backstage/catalog-model'; import { AddLocationRequest, AddLocationResponse, @@ -25,6 +25,7 @@ import { CatalogRequestOptions, GetEntityAncestorsRequest, GetEntityAncestorsResponse, + Location, } from '@backstage/catalog-client'; import { IdentityApi } from '@backstage/core-plugin-api';