From 7250b6993d703c025021fdd7409458c2dc2fc269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 14 Mar 2022 14:20:25 +0100 Subject: [PATCH] remove results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/moody-stingrays-tap.md | 5 + plugins/catalog-backend/api-report.md | 45 --------- .../src/api/deprecatedResult.ts | 93 ------------------- plugins/catalog-backend/src/api/index.ts | 4 - 4 files changed, 5 insertions(+), 142 deletions(-) create mode 100644 .changeset/moody-stingrays-tap.md delete mode 100644 plugins/catalog-backend/src/api/deprecatedResult.ts diff --git a/.changeset/moody-stingrays-tap.md b/.changeset/moody-stingrays-tap.md new file mode 100644 index 0000000000..de86127eba --- /dev/null +++ b/.changeset/moody-stingrays-tap.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +**BREAKING**: Removed the previously deprecated `results` export. Please use `processingResult` instead. diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index d648e16173..b28ff55f8c 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -457,12 +457,6 @@ export type EntitiesSearchFilter = { values?: string[]; }; -// @public @deprecated (undocumented) -function entity( - atLocation: LocationSpec, - newEntity: Entity, -): CatalogProcessorResult; - // @public (undocumented) export type EntityAncestryResponse = { rootEntityRef: string; @@ -574,24 +568,6 @@ export class FileReaderProcessor implements CatalogProcessor { ): Promise; } -// @public @deprecated (undocumented) -function generalError( - atLocation: LocationSpec, - message: string, -): CatalogProcessorResult; - -// @public @deprecated (undocumented) -function inputError( - atLocation: LocationSpec, - message: string, -): CatalogProcessorResult; - -// @public @deprecated (undocumented) -function location_2( - newLocation: LocationSpec, - _optional?: boolean, -): CatalogProcessorResult; - // @public (undocumented) export type LocationAnalyzer = { analyzeLocation( @@ -680,12 +656,6 @@ export interface LocationStore { listLocations(): Promise; } -// @public @deprecated (undocumented) -function notFoundError( - atLocation: LocationSpec, - message: string, -): CatalogProcessorResult; - // @public (undocumented) export type PageInfo = | { @@ -812,21 +782,6 @@ export interface RefreshService { refresh(options: RefreshOptions): Promise; } -// @public @deprecated (undocumented) -function relation(spec: EntityRelationSpec): CatalogProcessorResult; - -declare namespace results { - export { - notFoundError, - inputError, - generalError, - location_2 as location, - entity, - relation, - }; -} -export { results }; - // @public export interface RouterOptions { // (undocumented) diff --git a/plugins/catalog-backend/src/api/deprecatedResult.ts b/plugins/catalog-backend/src/api/deprecatedResult.ts deleted file mode 100644 index e616f3cf7d..0000000000 --- a/plugins/catalog-backend/src/api/deprecatedResult.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2020 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. - */ - -import { InputError, NotFoundError } from '@backstage/errors'; -import { Entity } from '@backstage/catalog-model'; -import { CatalogProcessorResult } from './processor'; -import { EntityRelationSpec, LocationSpec } from './common'; - -// NOTE: This entire file is deprecated and should be eventually removed along with the `result` export - -/** - * @public - * @deprecated import the processingResult symbol instead and use its fields - */ -export function notFoundError( - atLocation: LocationSpec, - message: string, -): CatalogProcessorResult { - return { - type: 'error', - location: atLocation, - error: new NotFoundError(message), - }; -} - -/** - * @public - * @deprecated import the processingResult symbol instead and use its fields - */ -export function inputError( - atLocation: LocationSpec, - message: string, -): CatalogProcessorResult { - return { - type: 'error', - location: atLocation, - error: new InputError(message), - }; -} - -/** - * @public - * @deprecated import the processingResult symbol instead and use its fields - */ -export function generalError( - atLocation: LocationSpec, - message: string, -): CatalogProcessorResult { - return { type: 'error', location: atLocation, error: new Error(message) }; -} - -/** - * @public - * @deprecated import the processingResult symbol instead and use its fields - */ -export function location( - newLocation: LocationSpec, - _optional?: boolean, -): CatalogProcessorResult { - return { type: 'location', location: newLocation }; -} - -/** - * @public - * @deprecated import the processingResult symbol instead and use its fields - */ -export function entity( - atLocation: LocationSpec, - newEntity: Entity, -): CatalogProcessorResult { - return { type: 'entity', location: atLocation, entity: newEntity }; -} - -/** - * @public - * @deprecated import the processingResult symbol instead and use its fields - */ -export function relation(spec: EntityRelationSpec): CatalogProcessorResult { - return { type: 'relation', relation: spec }; -} diff --git a/plugins/catalog-backend/src/api/index.ts b/plugins/catalog-backend/src/api/index.ts index 3f1c627743..1cb4b71aa3 100644 --- a/plugins/catalog-backend/src/api/index.ts +++ b/plugins/catalog-backend/src/api/index.ts @@ -14,10 +14,6 @@ * limitations under the License. */ -import * as results from './deprecatedResult'; - -export { results }; - export { processingResult } from './processingResult'; export type { EntityRelationSpec, LocationSpec } from './common'; export type {