Merge pull request #11655 from leon-vg/export-tech-insights-client
[TechInsights] Export TechInsightsClient so it can be extended
This commit is contained in:
@@ -10,6 +10,8 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
|
||||
import { BulkCheckResponse } from '@backstage/plugin-tech-insights-common';
|
||||
import { CheckResult } from '@backstage/plugin-tech-insights-common';
|
||||
import { CompoundEntityRef } from '@backstage/catalog-model';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
import { IdentityApi } from '@backstage/core-plugin-api';
|
||||
import { default as React_2 } from 'react';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
@@ -78,6 +80,33 @@ export interface TechInsightsApi {
|
||||
// @public
|
||||
export const techInsightsApiRef: ApiRef<TechInsightsApi>;
|
||||
|
||||
// @public (undocumented)
|
||||
export class TechInsightsClient implements TechInsightsApi {
|
||||
constructor(options: {
|
||||
discoveryApi: DiscoveryApi;
|
||||
identityApi: IdentityApi;
|
||||
});
|
||||
// (undocumented)
|
||||
getAllChecks(): Promise<Check[]>;
|
||||
// (undocumented)
|
||||
getScorecardsDefinition(
|
||||
type: string,
|
||||
value: CheckResult[],
|
||||
title?: string,
|
||||
description?: string,
|
||||
): CheckResultRenderer | undefined;
|
||||
// (undocumented)
|
||||
runBulkChecks(
|
||||
entities: CompoundEntityRef[],
|
||||
checks?: Check[],
|
||||
): Promise<BulkCheckResponse>;
|
||||
// (undocumented)
|
||||
runChecks(
|
||||
entityParams: CompoundEntityRef,
|
||||
checks?: string[],
|
||||
): Promise<CheckResult[]>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const techInsightsPlugin: BackstagePlugin<
|
||||
{
|
||||
|
||||
@@ -29,16 +29,15 @@ import {
|
||||
defaultCheckResultRenderers,
|
||||
} from '../components/CheckResultRenderer';
|
||||
|
||||
export type Options = {
|
||||
discoveryApi: DiscoveryApi;
|
||||
identityApi: IdentityApi;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export class TechInsightsClient implements TechInsightsApi {
|
||||
private readonly discoveryApi: DiscoveryApi;
|
||||
private readonly identityApi: IdentityApi;
|
||||
|
||||
constructor(options: Options) {
|
||||
constructor(options: {
|
||||
discoveryApi: DiscoveryApi;
|
||||
identityApi: IdentityApi;
|
||||
}) {
|
||||
this.discoveryApi = options.discoveryApi;
|
||||
this.identityApi = options.identityApi;
|
||||
}
|
||||
|
||||
@@ -15,3 +15,4 @@
|
||||
*/
|
||||
export * from './TechInsightsApi';
|
||||
export * from './TechInsightsClient';
|
||||
export * from './types';
|
||||
|
||||
@@ -19,7 +19,6 @@ export {
|
||||
EntityTechInsightsScorecardCard,
|
||||
} from './plugin';
|
||||
|
||||
export { techInsightsApiRef } from './api/TechInsightsApi';
|
||||
export type { TechInsightsApi } from './api/TechInsightsApi';
|
||||
export type { Check } from './api/types';
|
||||
export { techInsightsApiRef, TechInsightsClient } from './api';
|
||||
export type { TechInsightsApi, Check } from './api';
|
||||
export type { CheckResultRenderer } from './components/CheckResultRenderer';
|
||||
|
||||
Reference in New Issue
Block a user