diff --git a/plugins/codescene/api-report.md b/plugins/codescene/api-report.md index 99eb2b6256..37018ea14b 100644 --- a/plugins/codescene/api-report.md +++ b/plugins/codescene/api-report.md @@ -6,10 +6,20 @@ /// import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { Entity } from '@backstage/catalog-model'; import { IconComponent } from '@backstage/core-plugin-api'; import { JSX as JSX_2 } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; +// @public (undocumented) +export const CODESCENE_PROJECT_ANNOTATION = 'codescene.io/project-id'; + +// @public (undocumented) +export const CodeSceneEntityKPICard: () => JSX_2.Element; + +// @public (undocumented) +export const CodeSceneEntityPage: () => JSX_2.Element; + // @public (undocumented) export const CodeSceneIcon: IconComponent; @@ -30,5 +40,8 @@ export const codescenePlugin: BackstagePlugin< // @public (undocumented) export const CodeSceneProjectDetailsPage: () => JSX_2.Element; +// @public (undocumented) +export const isCodeSceneAvailable: (entity: Entity) => boolean; + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/codescene/src/plugin.ts b/plugins/codescene/src/plugin.ts index 5c1a8e2e14..70cb3fb2a5 100644 --- a/plugins/codescene/src/plugin.ts +++ b/plugins/codescene/src/plugin.ts @@ -68,6 +68,9 @@ export const CodeSceneProjectDetailsPage = codescenePlugin.provide( }), ); +/** + * @public + */ export const CodeSceneEntityKPICard = codescenePlugin.provide( createRoutableExtension({ name: 'CodeSceneEntityKPICard', @@ -79,6 +82,9 @@ export const CodeSceneEntityKPICard = codescenePlugin.provide( }), ); +/** + * @public + */ export const CodeSceneEntityPage = codescenePlugin.provide( createRoutableExtension({ name: 'CodeSceneEntityPage', diff --git a/plugins/codescene/src/utils/commonUtil.ts b/plugins/codescene/src/utils/commonUtil.ts index 830cc797c9..435cb377e6 100644 --- a/plugins/codescene/src/utils/commonUtil.ts +++ b/plugins/codescene/src/utils/commonUtil.ts @@ -16,8 +16,14 @@ import { Entity } from '@backstage/catalog-model'; +/** + * @public + */ export const CODESCENE_PROJECT_ANNOTATION = 'codescene.io/project-id'; +/** + * @public + */ export const getProjectAnnotation = (entity: Entity) => { const annotation = entity?.metadata.annotations?.[CODESCENE_PROJECT_ANNOTATION]; @@ -25,5 +31,8 @@ export const getProjectAnnotation = (entity: Entity) => { return { projectId: Number(projectId) }; }; +/** + * @public + */ export const isCodeSceneAvailable = (entity: Entity) => Boolean(getProjectAnnotation(entity).projectId);