Update api-report.md

Signed-off-by: Magnus Persson <magnus.persson@fortnox.se>
This commit is contained in:
Magnus Persson
2022-11-22 12:53:57 +01:00
parent 19f8ad4262
commit 836b30e61c
8 changed files with 91 additions and 14 deletions
+71
View File
@@ -0,0 +1,71 @@
## API Report File for "@backstage/plugin-sonarqube-react"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ApiRef } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
// @alpha (undocumented)
export interface FindingSummary {
// (undocumented)
getComponentMeasuresUrl: SonarUrlProcessorFunc;
// (undocumented)
getIssuesUrl: SonarUrlProcessorFunc;
// (undocumented)
getSecurityHotspotsUrl: () => string;
// (undocumented)
lastAnalysis: string;
// (undocumented)
metrics: Metrics;
// (undocumented)
projectUrl: string;
}
// @public (undocumented)
export const isSonarQubeAvailable: (entity: Entity) => boolean;
// @alpha (undocumented)
export type MetricKey =
| 'alert_status'
| 'bugs'
| 'reliability_rating'
| 'vulnerabilities'
| 'security_rating'
| 'code_smells'
| 'sqale_rating'
| 'security_hotspots_reviewed'
| 'security_review_rating'
| 'coverage'
| 'duplicated_lines_density';
// @alpha
export type Metrics = {
[key in MetricKey]: string | undefined;
};
// @public (undocumented)
export const SONARQUBE_PROJECT_KEY_ANNOTATION = 'sonarqube.org/project-key';
// @alpha (undocumented)
export type SonarQubeApi = {
getFindingSummary(options: {
componentKey?: string;
projectInstance?: string;
}): Promise<FindingSummary | undefined>;
};
// @alpha (undocumented)
export const sonarQubeApiRef: ApiRef<SonarQubeApi>;
// @alpha (undocumented)
export type SonarUrlProcessorFunc = (identifier: string) => string;
// @alpha
export const useProjectInfo: (entity: Entity) => {
projectInstance: string | undefined;
projectKey: string | undefined;
};
// (No @packageDocumentation comment for this package)
```
@@ -16,6 +16,7 @@
import { createApiRef } from '@backstage/core-plugin-api';
/** @alpha */
export type MetricKey =
// alert status
| 'alert_status'
@@ -42,15 +43,19 @@ export type MetricKey =
// duplicated lines
| 'duplicated_lines_density';
/** @alpha */
export type SonarUrlProcessorFunc = (identifier: string) => string;
/**
* @alpha
*
* Define a type to make sure that all metrics are used
*/
export type Metrics = {
[key in MetricKey]: string | undefined;
};
/** @alpha */
export interface FindingSummary {
lastAnalysis: string;
metrics: Metrics;
@@ -60,6 +65,7 @@ export interface FindingSummary {
getSecurityHotspotsUrl: () => string;
}
/** @alpha */
export const sonarQubeApiRef = createApiRef<SonarQubeApi>({
id: 'plugin.sonarqube.service',
});
@@ -17,5 +17,4 @@
export {
isSonarQubeAvailable,
SONARQUBE_PROJECT_KEY_ANNOTATION,
SONARQUBE_PROJECT_INSTANCE_SEPARATOR,
} from './isSonarQubeAvailable';
@@ -16,8 +16,8 @@
import { Entity } from '@backstage/catalog-model';
/** @public */
export const SONARQUBE_PROJECT_KEY_ANNOTATION = 'sonarqube.org/project-key';
export const SONARQUBE_PROJECT_INSTANCE_SEPARATOR = '/';
/** @public */
export const isSonarQubeAvailable = (entity: Entity) =>
@@ -15,11 +15,9 @@
*/
import { Entity } from '@backstage/catalog-model';
import {
SONARQUBE_PROJECT_INSTANCE_SEPARATOR,
SONARQUBE_PROJECT_KEY_ANNOTATION,
} from '../components';
import { SONARQUBE_PROJECT_KEY_ANNOTATION } from '../components';
import { useProjectInfo } from './useProjectInfo';
import { SONARQUBE_PROJECT_INSTANCE_SEPARATOR } from './useProjectInfo';
const createDummyEntity = (sonarqubeAnnotationValue: string): Entity => {
return {
@@ -15,10 +15,9 @@
*/
import { Entity } from '@backstage/catalog-model';
import {
SONARQUBE_PROJECT_INSTANCE_SEPARATOR,
SONARQUBE_PROJECT_KEY_ANNOTATION,
} from '../components';
import { SONARQUBE_PROJECT_KEY_ANNOTATION } from '../components';
export const SONARQUBE_PROJECT_INSTANCE_SEPARATOR = '/';
/**
*
@@ -27,8 +26,8 @@ import {
* If part or all info are not found, they will default to undefined
*
* @alpha
* @param entity entity to find the sonarqube information from.
* @return a ProjectInfo properly populated.
* @param entity - entity to find the sonarqube information from.
* @returns a ProjectInfo properly populated.
*/
export const useProjectInfo = (
entity: Entity,
+2 -2
View File
@@ -26,10 +26,10 @@ export const EntitySonarQubeContentPage: (
props: SonarQubeContentPageProps,
) => JSX.Element;
// @public (undocumented)
// @public @deprecated (undocumented)
export const isSonarQubeAvailable: (entity: Entity) => boolean;
// @public (undocumented)
// @public @deprecated (undocumented)
export const SONARQUBE_PROJECT_KEY_ANNOTATION = 'sonarqube.org/project-key';
// @public (undocumented)
@@ -24,11 +24,15 @@ export type { DuplicationRating } from './SonarQubeCard';
export type { SonarQubeContentPageProps } from './SonarQubeContentPage';
/**
* @public
*
* @deprecated use the same type from `@backstage/plugin-sonarqube-react` instead
*/
export const isSonarQubeAvailable = NonDeprecatedIsSonarQubeAvailable;
/**
* @public
*
* @deprecated use the same type from `@backstage/plugin-sonarqube-react` instead
*/
export const SONARQUBE_PROJECT_KEY_ANNOTATION =