update contrib read/write split doc to match new client methods
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -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<ValidateEntityResponse> {
|
||||
return this.#write.validateEntity(entity, locationRef, options);
|
||||
}
|
||||
|
||||
analyzeLocation(
|
||||
location: AnalyzeLocationRequest,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<AnalyzeLocationResponse> {
|
||||
return this.#write.analyzeLocation(location, options);
|
||||
}
|
||||
}
|
||||
|
||||
// You should pass this to createApp.
|
||||
|
||||
@@ -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<AnalyzeLocationResponse> {
|
||||
return this.#catalogWrite.analyzeLocation(
|
||||
location,
|
||||
await this.#getOptions(options),
|
||||
);
|
||||
}
|
||||
|
||||
async #getOptions(
|
||||
options: CatalogServiceRequestOptions,
|
||||
): Promise<CatalogRequestOptions> {
|
||||
|
||||
Reference in New Issue
Block a user