From 5e1a83e4f172fee1d3249ce408acf4b8cc2d86f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Sun, 16 Jan 2022 15:55:01 +0100 Subject: [PATCH] remove batchAddOrUpdateEntities too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/khaki-adults-own.md | 4 +++ plugins/catalog-backend/api-report.md | 24 ---------------- plugins/catalog-backend/src/catalog/index.ts | 2 -- plugins/catalog-backend/src/catalog/types.ts | 28 +------------------ .../src/service/NextEntitiesCatalog.ts | 4 --- .../src/service/createRouter.test.ts | 3 -- 6 files changed, 5 insertions(+), 60 deletions(-) diff --git a/.changeset/khaki-adults-own.md b/.changeset/khaki-adults-own.md index 9b7bebbff0..3e61917ecf 100644 --- a/.changeset/khaki-adults-own.md +++ b/.changeset/khaki-adults-own.md @@ -36,6 +36,10 @@ The following classes and interfaces have been removed: - `DbLocationsRow` - `DbLocationsRowWithStatus` - `DbPageInfo` +- `EntitiesCatalog.batchAddOrUpdateEntities` (was only used by the legacy + engine) +- `EntityUpsertRequest` +- `EntityUpsertResponse` - `HigherOrderOperation` - `HigherOrderOperations` - `LocationReader` diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index fd253695a2..e76da7bd6c 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -554,14 +554,6 @@ export type EntitiesCatalog = { authorizationToken?: string; }, ): Promise; - batchAddOrUpdateEntities?( - requests: EntityUpsertRequest[], - options?: { - locationId?: string; - dryRun?: boolean; - outputEntities?: boolean; - }, - ): Promise; entityAncestry(entityRef: string): Promise; }; @@ -689,22 +681,6 @@ export type EntityProviderMutation = removed: DeferredEntity[]; }; -// Warning: (ae-missing-release-tag) "EntityUpsertRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public @deprecated (undocumented) -export type EntityUpsertRequest = { - entity: Entity; - relations: EntityRelationSpec[]; -}; - -// Warning: (ae-missing-release-tag) "EntityUpsertResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public @deprecated (undocumented) -export type EntityUpsertResponse = { - entityId: string; - entity?: Entity; -}; - // Warning: (ae-missing-release-tag) "FileReaderProcessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog-backend/src/catalog/index.ts b/plugins/catalog-backend/src/catalog/index.ts index 885a2f5389..95c6572b10 100644 --- a/plugins/catalog-backend/src/catalog/index.ts +++ b/plugins/catalog-backend/src/catalog/index.ts @@ -19,8 +19,6 @@ export type { EntitiesRequest, EntitiesResponse, EntityAncestryResponse, - EntityUpsertRequest, - EntityUpsertResponse, PageInfo, EntitiesSearchFilter, EntityFilter, diff --git a/plugins/catalog-backend/src/catalog/types.ts b/plugins/catalog-backend/src/catalog/types.ts index de78e4ac84..669f0258d8 100644 --- a/plugins/catalog-backend/src/catalog/types.ts +++ b/plugins/catalog-backend/src/catalog/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Entity, EntityRelationSpec } from '@backstage/catalog-model'; +import { Entity } from '@backstage/catalog-model'; /** * A filter expression for entities. @@ -78,18 +78,6 @@ export type EntitiesResponse = { pageInfo: PageInfo; }; -/** @deprecated This was part of the legacy catalog engine */ -export type EntityUpsertRequest = { - entity: Entity; - relations: EntityRelationSpec[]; -}; - -/** @deprecated This was part of the legacy catalog engine */ -export type EntityUpsertResponse = { - entityId: string; - entity?: Entity; -}; - /** @public */ export type EntityAncestryResponse = { rootEntityRef: string; @@ -118,20 +106,6 @@ export type EntitiesCatalog = { options?: { authorizationToken?: string }, ): Promise; - /** - * Writes a number of entities efficiently to storage. - * - * @deprecated This method was part of the legacy catalog engine and will be removed. - */ - batchAddOrUpdateEntities?( - requests: EntityUpsertRequest[], - options?: { - locationId?: string; - dryRun?: boolean; - outputEntities?: boolean; - }, - ): Promise; - /** * Returns the full ancestry tree upward along reference edges. * diff --git a/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts b/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts index d27a3be95a..8ca28260af 100644 --- a/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts +++ b/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts @@ -295,8 +295,4 @@ export class NextEntitiesCatalog implements EntitiesCatalog { items, }; } - - async batchAddOrUpdateEntities(): Promise { - throw new Error('Not implemented'); - } } diff --git a/plugins/catalog-backend/src/service/createRouter.test.ts b/plugins/catalog-backend/src/service/createRouter.test.ts index 4adcf244b8..a747a4cf23 100644 --- a/plugins/catalog-backend/src/service/createRouter.test.ts +++ b/plugins/catalog-backend/src/service/createRouter.test.ts @@ -38,7 +38,6 @@ describe('createRouter readonly disabled', () => { entitiesCatalog = { entities: jest.fn(), removeEntityByUid: jest.fn(), - batchAddOrUpdateEntities: jest.fn(), entityAncestry: jest.fn(), }; locationService = { @@ -332,7 +331,6 @@ describe('createRouter readonly enabled', () => { entitiesCatalog = { entities: jest.fn(), removeEntityByUid: jest.fn(), - batchAddOrUpdateEntities: jest.fn(), entityAncestry: jest.fn(), }; locationService = { @@ -466,7 +464,6 @@ describe('NextRouter permissioning', () => { entitiesCatalog = { entities: jest.fn(), removeEntityByUid: jest.fn(), - batchAddOrUpdateEntities: jest.fn(), entityAncestry: jest.fn(), }; locationService = {