From 208b7e7c08bd33f01fb37ea261029b21687f5c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 22 Aug 2025 21:45:24 +0200 Subject: [PATCH] update contrib read/write split doc to match new client methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../workspace/packages/app/src/catalogApi.ts | 11 +++++++++++ .../packages/backend/src/catalogService.ts | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/contrib/catalog/read-write-split/workspace/packages/app/src/catalogApi.ts b/contrib/catalog/read-write-split/workspace/packages/app/src/catalogApi.ts index 0813249f8f..4035e8d336 100644 --- a/contrib/catalog/read-write-split/workspace/packages/app/src/catalogApi.ts +++ b/contrib/catalog/read-write-split/workspace/packages/app/src/catalogApi.ts @@ -27,6 +27,10 @@ import { fetchApiRef, } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; +import { + AnalyzeLocationRequest, + AnalyzeLocationResponse, +} from '@backstage/plugin-catalog-common'; /** * Implements the catalog client for frontends, by using a custom service @@ -159,6 +163,13 @@ export class ReadWriteSplitCatalogClient implements CatalogApi { ): Promise { return this.#write.validateEntity(entity, locationRef, options); } + + analyzeLocation( + location: AnalyzeLocationRequest, + options?: CatalogRequestOptions, + ): Promise { + return this.#write.analyzeLocation(location, options); + } } // You should pass this to createApp. diff --git a/contrib/catalog/read-write-split/workspace/packages/backend/src/catalogService.ts b/contrib/catalog/read-write-split/workspace/packages/backend/src/catalogService.ts index 80711bd4b3..44119947e6 100644 --- a/contrib/catalog/read-write-split/workspace/packages/backend/src/catalogService.ts +++ b/contrib/catalog/read-write-split/workspace/packages/backend/src/catalogService.ts @@ -25,6 +25,10 @@ import { ValidateEntityResponse, } from '@backstage/catalog-client'; import { CompoundEntityRef, Entity } from '@backstage/catalog-model'; +import { + AnalyzeLocationRequest, + AnalyzeLocationResponse, +} from '@backstage/plugin-catalog-common'; import { CatalogService, CatalogServiceRequestOptions, @@ -205,6 +209,16 @@ export class ReadWriteSplitCatalogService implements CatalogService { ); } + async analyzeLocation( + location: AnalyzeLocationRequest, + options: CatalogServiceRequestOptions, + ): Promise { + return this.#catalogWrite.analyzeLocation( + location, + await this.#getOptions(options), + ); + } + async #getOptions( options: CatalogServiceRequestOptions, ): Promise {