deprecate EntityName, introduce CompoundEntityRef

deprecate getEntityName, introduce getCompoundEntityRef

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-03-02 21:26:22 +01:00
parent 80d2674a31
commit 36aa63022b
84 changed files with 393 additions and 268 deletions
@@ -21,7 +21,7 @@ import {
} from '@backstage/plugin-tech-insights-common';
import { Check } from './types';
import { CheckResultRenderer } from '../components/CheckResultRenderer';
import { EntityName } from '@backstage/catalog-model';
import { CompoundEntityRef } from '@backstage/catalog-model';
/**
* {@link @backstage/core-plugin-api#ApiRef} for the {@link TechInsightsApi}
@@ -45,9 +45,12 @@ export interface TechInsightsApi {
description?: string,
) => CheckResultRenderer | undefined;
getAllChecks(): Promise<Check[]>;
runChecks(entityParams: EntityName, checks?: Check[]): Promise<CheckResult[]>;
runChecks(
entityParams: CompoundEntityRef,
checks?: Check[],
): Promise<CheckResult[]>;
runBulkChecks(
entities: EntityName[],
entities: CompoundEntityRef[],
checks?: Check[],
): Promise<BulkCheckResponse>;
}
@@ -22,7 +22,7 @@ import {
import { Check } from './types';
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
import { ResponseError } from '@backstage/errors';
import { EntityName } from '@backstage/catalog-model';
import { CompoundEntityRef } from '@backstage/catalog-model';
import {
CheckResultRenderer,
@@ -74,7 +74,7 @@ export class TechInsightsClient implements TechInsightsApi {
}
async runChecks(
entityParams: EntityName,
entityParams: CompoundEntityRef,
checks?: Check[],
): Promise<CheckResult[]> {
const url = await this.discoveryApi.getBaseUrl('tech-insights');
@@ -102,7 +102,7 @@ export class TechInsightsClient implements TechInsightsApi {
}
async runBulkChecks(
entities: EntityName[],
entities: CompoundEntityRef[],
checks?: Check[],
): Promise<BulkCheckResponse> {
const url = await this.discoveryApi.getBaseUrl('tech-insights');