From e117ad2fec48d680dc85701e275f594ea9461d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 09:38:13 +0200 Subject: [PATCH 01/41] code-climate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/code-climate/api-report.md | 22 +------------------ .../code-climate/src/api/code-climate-api.ts | 2 ++ .../code-climate/src/api/code-climate-data.ts | 1 + plugins/code-climate/src/api/mock/index.ts | 1 - plugins/code-climate/src/api/mock/mock-api.ts | 1 + .../code-climate/src/api/production-api.ts | 8 ++----- .../CodeClimateTable.test.tsx | 2 +- plugins/code-climate/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 1 - 9 files changed, 10 insertions(+), 30 deletions(-) diff --git a/plugins/code-climate/api-report.md b/plugins/code-climate/api-report.md index 5ef53cf543..f4a2d3a26d 100644 --- a/plugins/code-climate/api-report.md +++ b/plugins/code-climate/api-report.md @@ -11,21 +11,15 @@ import { DiscoveryApi } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "CodeClimateApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface CodeClimateApi { // (undocumented) fetchData(repoID: string): Promise; } -// Warning: (ae-missing-release-tag) "codeClimateApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const codeClimateApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "CodeClimateData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type CodeClimateData = { repoID: string; @@ -42,8 +36,6 @@ export type CodeClimateData = { numberOfOtherIssues: number; }; -// Warning: (ae-missing-release-tag) "codeClimatePlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const codeClimatePlugin: BackstagePlugin< { @@ -53,30 +45,18 @@ export const codeClimatePlugin: BackstagePlugin< {} >; -// Warning: (ae-missing-release-tag) "EntityCodeClimateCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityCodeClimateCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "MockCodeClimateApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class MockCodeClimateApi implements CodeClimateApi { // (undocumented) fetchData(): Promise; } -// Warning: (ae-missing-release-tag) "mockData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const mockData: CodeClimateData; - -// Warning: (ae-missing-release-tag) "ProductionCodeClimateApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class ProductionCodeClimateApi implements CodeClimateApi { - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - constructor(options: Options); + constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi }); // (undocumented) fetchAllData(options: { apiUrl: string; diff --git a/plugins/code-climate/src/api/code-climate-api.ts b/plugins/code-climate/src/api/code-climate-api.ts index fb4f41ebb5..d58d355d75 100644 --- a/plugins/code-climate/src/api/code-climate-api.ts +++ b/plugins/code-climate/src/api/code-climate-api.ts @@ -17,10 +17,12 @@ import { CodeClimateData } from './code-climate-data'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const codeClimateApiRef = createApiRef({ id: 'plugin.code-climate.service', }); +/** @public */ export interface CodeClimateApi { fetchData(repoID: string): Promise; } diff --git a/plugins/code-climate/src/api/code-climate-data.ts b/plugins/code-climate/src/api/code-climate-data.ts index 9271905157..77e10d67d9 100644 --- a/plugins/code-climate/src/api/code-climate-data.ts +++ b/plugins/code-climate/src/api/code-climate-data.ts @@ -164,6 +164,7 @@ export type CodeClimateIssuesData = { meta: { current_page: number; total_pages: number; total_count: number }; }; +/** @public */ export type CodeClimateData = { repoID: string; maintainability: { diff --git a/plugins/code-climate/src/api/mock/index.ts b/plugins/code-climate/src/api/mock/index.ts index 56ba9c7974..0044fec7bb 100644 --- a/plugins/code-climate/src/api/mock/index.ts +++ b/plugins/code-climate/src/api/mock/index.ts @@ -14,5 +14,4 @@ * limitations under the License. */ -export { mockData } from './mock-api'; export { MockCodeClimateApi } from './mock-api'; diff --git a/plugins/code-climate/src/api/mock/mock-api.ts b/plugins/code-climate/src/api/mock/mock-api.ts index 74e4d83027..65ac6de3b8 100644 --- a/plugins/code-climate/src/api/mock/mock-api.ts +++ b/plugins/code-climate/src/api/mock/mock-api.ts @@ -47,6 +47,7 @@ export const mockData: CodeClimateData = { numberOfOtherIssues: 26, }; +/** @public */ export class MockCodeClimateApi implements CodeClimateApi { fetchData(): Promise { return new Promise(resolve => { diff --git a/plugins/code-climate/src/api/production-api.ts b/plugins/code-climate/src/api/production-api.ts index 81ba6b9ad6..e227201b9d 100644 --- a/plugins/code-climate/src/api/production-api.ts +++ b/plugins/code-climate/src/api/production-api.ts @@ -34,16 +34,12 @@ const codeSmellsQuery = `${basicIssuesOptions}&${categoriesFilter}=Complexity`; const duplicationQuery = `${basicIssuesOptions}&${categoriesFilter}=Duplication`; const otherIssuesQuery = `${basicIssuesOptions}&${categoriesFilter}=Bug%20Risk`; -type Options = { - discoveryApi: DiscoveryApi; - fetchApi: FetchApi; -}; - +/** @public */ export class ProductionCodeClimateApi implements CodeClimateApi { private readonly discoveryApi: DiscoveryApi; private readonly fetchApi: FetchApi; - constructor(options: Options) { + constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi }) { this.discoveryApi = options.discoveryApi; this.fetchApi = options.fetchApi; } diff --git a/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.test.tsx b/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.test.tsx index a2ced6f5a2..70d34d0298 100644 --- a/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.test.tsx +++ b/plugins/code-climate/src/components/CodeClimateTable/CodeClimateTable.test.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { CodeClimateTable } from './CodeClimateTable'; -import { mockData } from '../../api/mock'; +import { mockData } from '../../api/mock/mock-api'; import { ThemeProvider } from '@material-ui/core'; import { lightTheme } from '@backstage/theme'; diff --git a/plugins/code-climate/src/plugin.ts b/plugins/code-climate/src/plugin.ts index 54502b6355..38bb268388 100644 --- a/plugins/code-climate/src/plugin.ts +++ b/plugins/code-climate/src/plugin.ts @@ -30,6 +30,7 @@ export const rootRouteRef = createRouteRef({ id: 'code-climate', }); +/** @public */ export const codeClimatePlugin = createPlugin({ id: 'code-climate', apis: [ @@ -48,6 +49,7 @@ export const codeClimatePlugin = createPlugin({ }, }); +/** @public */ export const EntityCodeClimateCard = codeClimatePlugin.provide( createComponentExtension({ name: 'EntityCodeClimateCard', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index be1f9ce038..ca710e1885 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -210,7 +210,6 @@ const ALLOW_WARNINGS = [ 'plugins/cicd-statistics', 'plugins/circleci', 'plugins/cloudbuild', - 'plugins/code-climate', 'plugins/config-schema', 'plugins/cost-insights', 'plugins/dynatrace', From dbd7365130d78bbf0832fd92a246fe3d80bb3844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 09:52:22 +0200 Subject: [PATCH 02/41] rollbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/rollbar/api-report.md | 191 +++++++++++++++--- plugins/rollbar/src/api/RollbarApi.ts | 2 + plugins/rollbar/src/api/RollbarClient.ts | 1 + plugins/rollbar/src/api/index.ts | 1 + plugins/rollbar/src/api/types.ts | 12 ++ .../EntityPageRollbar/EntityPageRollbar.tsx | 1 + plugins/rollbar/src/components/Router.tsx | 6 +- plugins/rollbar/src/constants.ts | 1 + plugins/rollbar/src/plugin.ts | 2 + scripts/api-extractor.ts | 1 - 10 files changed, 187 insertions(+), 31 deletions(-) diff --git a/plugins/rollbar/api-report.md b/plugins/rollbar/api-report.md index 27f0e4641b..5ee8a50ce3 100644 --- a/plugins/rollbar/api-report.md +++ b/plugins/rollbar/api-report.md @@ -12,44 +12,28 @@ import { Entity } from '@backstage/catalog-model'; import { IdentityApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "EntityPageRollbar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityPageRollbar: () => JSX.Element; -// Warning: (ae-missing-release-tag) "EntityRollbarContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const EntityRollbarContent: (_props: {}) => JSX.Element; +export const EntityRollbarContent: () => JSX.Element; -// Warning: (ae-missing-release-tag) "isPluginApplicableToEntity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; export { isPluginApplicableToEntity }; export { isPluginApplicableToEntity as isRollbarAvailable }; -// Warning: (ae-missing-release-tag) "ROLLBAR_ANNOTATION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ROLLBAR_ANNOTATION = 'rollbar.com/project-slug'; -// Warning: (ae-missing-release-tag) "RollbarApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface RollbarApi { - // Warning: (ae-forgotten-export) The symbol "RollbarProject" needs to be exported by the entry point index.d.ts - // // (undocumented) getAllProjects(): Promise; // (undocumented) getProject(projectName: string): Promise; - // Warning: (ae-forgotten-export) The symbol "RollbarItemsResponse" needs to be exported by the entry point index.d.ts - // // (undocumented) getProjectItems(project: string): Promise; - // Warning: (ae-forgotten-export) The symbol "RollbarTopActiveItem" needs to be exported by the entry point index.d.ts - // // (undocumented) getTopActiveItems( project: string, @@ -57,13 +41,9 @@ export interface RollbarApi { ): Promise; } -// Warning: (ae-missing-release-tag) "rollbarApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const rollbarApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "RollbarClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class RollbarClient implements RollbarApi { constructor(options: { @@ -84,8 +64,131 @@ export class RollbarClient implements RollbarApi { ): Promise; } -// Warning: (ae-missing-release-tag) "rollbarPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type RollbarEnvironment = 'production' | string; + +// @public (undocumented) +export enum RollbarFrameworkId { + // (undocumented) + 'browser-js' = 7, + // (undocumented) + 'node-js' = 4, + // (undocumented) + 'rollbar-system' = 8, + // (undocumented) + 'android' = 9, + // (undocumented) + 'celery' = 17, + // (undocumented) + 'django' = 2, + // (undocumented) + 'flask' = 16, + // (undocumented) + 'ios' = 10, + // (undocumented) + 'logentries' = 12, + // (undocumented) + 'mailgun' = 11, + // (undocumented) + 'php' = 6, + // (undocumented) + 'pylons' = 5, + // (undocumented) + 'pyramid' = 3, + // (undocumented) + 'python' = 13, + // (undocumented) + 'rails' = 1, + // (undocumented) + 'rq' = 18, + // (undocumented) + 'ruby' = 14, + // (undocumented) + 'sidekiq' = 15, + // (undocumented) + 'unknown' = 0, +} + +// @public (undocumented) +export type RollbarItem = { + publicItemId: number; + integrationsData: null; + levelLock: number; + controllingId: number; + lastActivatedTimestamp: number; + assignedUserId: number; + groupStatus: number; + hash: string; + id: number; + environment: RollbarEnvironment; + titleLock: number; + title: string; + lastOccurrenceId: number; + lastOccurrenceTimestamp: number; + platform: RollbarPlatformId; + firstOccurrenceTimestamp: number; + project_id: number; + resolvedInVersion: string; + status: 'enabled' | string; + uniqueOccurrences: number; + groupItemId: number; + framework: RollbarFrameworkId; + totalOccurrences: number; + level: RollbarLevel; + counter: number; + lastModifiedBy: number; + firstOccurrenceId: number; + activatingOccurrenceId: number; + lastResolvedTimestamp: number; +}; + +// @public (undocumented) +export type RollbarItemCount = { + timestamp: number; + count: number; +}; + +// @public (undocumented) +export type RollbarItemsResponse = { + items: RollbarItem[]; + page: number; + totalCount: number; +}; + +// @public (undocumented) +export enum RollbarLevel { + // (undocumented) + critical = 50, + // (undocumented) + debug = 10, + // (undocumented) + error = 40, + // (undocumented) + info = 20, + // (undocumented) + warning = 30, +} + +// @public (undocumented) +export enum RollbarPlatformId { + // (undocumented) + 'google-app-engine' = 6, + // (undocumented) + 'android' = 3, + // (undocumented) + 'browser' = 1, + // (undocumented) + 'client' = 7, + // (undocumented) + 'flash' = 2, + // (undocumented) + 'heroku' = 5, + // (undocumented) + 'ios' = 4, + // (undocumented) + 'unknown' = 0, +} + // @public (undocumented) const rollbarPlugin: BackstagePlugin< { @@ -97,9 +200,43 @@ const rollbarPlugin: BackstagePlugin< export { rollbarPlugin as plugin }; export { rollbarPlugin }; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const Router: (_props: Props) => JSX.Element; +export type RollbarProject = { + id: number; + name: string; + accountId: number; + status: 'enabled' | string; +}; + +// @public (undocumented) +export type RollbarProjectAccessToken = { + projectId: number; + name: string; + scopes: RollbarProjectAccessTokenScope[]; + accessToken: string; + status: 'enabled' | string; +}; + +// @public (undocumented) +export type RollbarProjectAccessTokenScope = 'read' | 'write'; + +// @public (undocumented) +export type RollbarTopActiveItem = { + item: { + id: number; + counter: number; + environment: RollbarEnvironment; + framework: RollbarFrameworkId; + lastOccurrenceTimestamp: number; + level: number; + occurrences: number; + projectId: number; + title: string; + uniqueOccurrences: number; + }; + counts: number[]; +}; + +// @public (undocumented) +export const Router: () => JSX.Element; ``` diff --git a/plugins/rollbar/src/api/RollbarApi.ts b/plugins/rollbar/src/api/RollbarApi.ts index 3da52338ec..d5d6fe6aca 100644 --- a/plugins/rollbar/src/api/RollbarApi.ts +++ b/plugins/rollbar/src/api/RollbarApi.ts @@ -21,10 +21,12 @@ import { } from './types'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const rollbarApiRef = createApiRef({ id: 'plugin.rollbar.service', }); +/** @public */ export interface RollbarApi { getAllProjects(): Promise; getProject(projectName: string): Promise; diff --git a/plugins/rollbar/src/api/RollbarClient.ts b/plugins/rollbar/src/api/RollbarClient.ts index b87a6c8cc8..71c9f74ff0 100644 --- a/plugins/rollbar/src/api/RollbarClient.ts +++ b/plugins/rollbar/src/api/RollbarClient.ts @@ -22,6 +22,7 @@ import { } from './types'; import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; +/** @public */ export class RollbarClient implements RollbarApi { private readonly discoveryApi: DiscoveryApi; private readonly identityApi: IdentityApi; diff --git a/plugins/rollbar/src/api/index.ts b/plugins/rollbar/src/api/index.ts index 56c23f07dd..882024f90f 100644 --- a/plugins/rollbar/src/api/index.ts +++ b/plugins/rollbar/src/api/index.ts @@ -16,3 +16,4 @@ export * from './RollbarApi'; export * from './RollbarClient'; +export * from './types'; diff --git a/plugins/rollbar/src/api/types.ts b/plugins/rollbar/src/api/types.ts index 549bdbbbb7..0a8f718a26 100644 --- a/plugins/rollbar/src/api/types.ts +++ b/plugins/rollbar/src/api/types.ts @@ -16,9 +16,13 @@ // TODO: Make this shared/dry with backend +/** @public */ export type RollbarProjectAccessTokenScope = 'read' | 'write'; + +/** @public */ export type RollbarEnvironment = 'production' | string; +/** @public */ export enum RollbarLevel { debug = 10, info = 20, @@ -27,6 +31,7 @@ export enum RollbarLevel { critical = 50, } +/** @public */ export enum RollbarFrameworkId { 'unknown' = 0, 'rails' = 1, @@ -49,6 +54,7 @@ export enum RollbarFrameworkId { 'rq' = 18, } +/** @public */ export enum RollbarPlatformId { 'unknown' = 0, 'browser' = 1, @@ -60,6 +66,7 @@ export enum RollbarPlatformId { 'client' = 7, } +/** @public */ export type RollbarProject = { id: number; name: string; @@ -67,6 +74,7 @@ export type RollbarProject = { status: 'enabled' | string; }; +/** @public */ export type RollbarProjectAccessToken = { projectId: number; name: string; @@ -75,6 +83,7 @@ export type RollbarProjectAccessToken = { status: 'enabled' | string; }; +/** @public */ export type RollbarItem = { publicItemId: number; integrationsData: null; @@ -107,17 +116,20 @@ export type RollbarItem = { lastResolvedTimestamp: number; }; +/** @public */ export type RollbarItemsResponse = { items: RollbarItem[]; page: number; totalCount: number; }; +/** @public */ export type RollbarItemCount = { timestamp: number; count: number; }; +/** @public */ export type RollbarTopActiveItem = { item: { id: number; diff --git a/plugins/rollbar/src/components/EntityPageRollbar/EntityPageRollbar.tsx b/plugins/rollbar/src/components/EntityPageRollbar/EntityPageRollbar.tsx index 626b3442e5..cde396674e 100644 --- a/plugins/rollbar/src/components/EntityPageRollbar/EntityPageRollbar.tsx +++ b/plugins/rollbar/src/components/EntityPageRollbar/EntityPageRollbar.tsx @@ -18,6 +18,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import React from 'react'; import { RollbarProject } from '../RollbarProject/RollbarProject'; +/** @public */ export const EntityPageRollbar = () => { const { entity } = useEntity(); diff --git a/plugins/rollbar/src/components/Router.tsx b/plugins/rollbar/src/components/Router.tsx index a11acb379c..9cd63e74aa 100644 --- a/plugins/rollbar/src/components/Router.tsx +++ b/plugins/rollbar/src/components/Router.tsx @@ -22,12 +22,12 @@ import { ROLLBAR_ANNOTATION } from '../constants'; import { EntityPageRollbar } from './EntityPageRollbar/EntityPageRollbar'; import { MissingAnnotationEmptyState } from '@backstage/core-components'; +/** @public */ export const isPluginApplicableToEntity = (entity: Entity) => Boolean(entity.metadata.annotations?.[ROLLBAR_ANNOTATION]); -type Props = {}; - -export const Router = (_props: Props) => { +/** @public */ +export const Router = () => { const { entity } = useEntity(); if (!isPluginApplicableToEntity(entity)) { diff --git a/plugins/rollbar/src/constants.ts b/plugins/rollbar/src/constants.ts index 8697c3239f..42031ddcef 100644 --- a/plugins/rollbar/src/constants.ts +++ b/plugins/rollbar/src/constants.ts @@ -14,4 +14,5 @@ * limitations under the License. */ +/** @public */ export const ROLLBAR_ANNOTATION = 'rollbar.com/project-slug'; diff --git a/plugins/rollbar/src/plugin.ts b/plugins/rollbar/src/plugin.ts index 3ca456058f..de3dd38b1a 100644 --- a/plugins/rollbar/src/plugin.ts +++ b/plugins/rollbar/src/plugin.ts @@ -29,6 +29,7 @@ export const rootRouteRef = createRouteRef({ id: 'rollbar', }); +/** @public */ export const rollbarPlugin = createPlugin({ id: 'rollbar', apis: [ @@ -44,6 +45,7 @@ export const rollbarPlugin = createPlugin({ }, }); +/** @public */ export const EntityRollbarContent = rollbarPlugin.provide( createRoutableExtension({ name: 'EntityRollbarContent', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index ca710e1885..0683c1efbd 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -233,7 +233,6 @@ const ALLOW_WARNINGS = [ 'plugins/newrelic', 'plugins/newrelic-dashboard', 'plugins/pagerduty', - 'plugins/rollbar', 'plugins/rollbar-backend', 'plugins/search-backend-module-pg', 'plugins/sentry', From 17f07f307041c4c08c6678e8f19c50075d060ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 09:56:50 +0200 Subject: [PATCH 03/41] rollbar-backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/rollbar-backend/api-report.md | 175 ++++++++++++++++-- plugins/rollbar-backend/src/api/RollbarApi.ts | 2 + plugins/rollbar-backend/src/api/index.ts | 3 +- plugins/rollbar-backend/src/api/types.ts | 12 ++ plugins/rollbar-backend/src/service/router.ts | 2 + scripts/api-extractor.ts | 1 - 6 files changed, 180 insertions(+), 15 deletions(-) diff --git a/plugins/rollbar-backend/api-report.md b/plugins/rollbar-backend/api-report.md index 1c0800a393..58a5fb0252 100644 --- a/plugins/rollbar-backend/api-report.md +++ b/plugins/rollbar-backend/api-report.md @@ -7,13 +7,9 @@ import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createRouter(options: RouterOptions): Promise; -// Warning: (ae-missing-release-tag) "getRequestHeaders" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function getRequestHeaders(token: string): { headers: { @@ -21,8 +17,6 @@ export function getRequestHeaders(token: string): { }; }; -// Warning: (ae-missing-release-tag) "RollbarApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class RollbarApi { constructor(accessToken: string, logger: Logger); @@ -100,8 +94,168 @@ export class RollbarApi { >; } -// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type RollbarEnvironment = 'production' | string; + +// @public (undocumented) +export enum RollbarFrameworkId { + // (undocumented) + 'browser-js' = 7, + // (undocumented) + 'node-js' = 4, + // (undocumented) + 'rollbar-system' = 8, + // (undocumented) + 'android' = 9, + // (undocumented) + 'celery' = 17, + // (undocumented) + 'django' = 2, + // (undocumented) + 'flask' = 16, + // (undocumented) + 'ios' = 10, + // (undocumented) + 'logentries' = 12, + // (undocumented) + 'mailgun' = 11, + // (undocumented) + 'php' = 6, + // (undocumented) + 'pylons' = 5, + // (undocumented) + 'pyramid' = 3, + // (undocumented) + 'python' = 13, + // (undocumented) + 'rails' = 1, + // (undocumented) + 'rq' = 18, + // (undocumented) + 'ruby' = 14, + // (undocumented) + 'sidekiq' = 15, + // (undocumented) + 'unknown' = 0, +} + +// @public (undocumented) +export type RollbarItem = { + publicItemId: number; + integrationsData: null; + levelLock: number; + controllingId: number; + lastActivatedTimestamp: number; + assignedUserId: number; + groupStatus: number; + hash: string; + id: number; + environment: RollbarEnvironment; + titleLock: number; + title: string; + lastOccurrenceId: number; + lastOccurrenceTimestamp: number; + platform: RollbarPlatformId; + firstOccurrenceTimestamp: number; + project_id: number; + resolvedInVersion: string; + status: 'enabled' | string; + uniqueOccurrences: number; + groupItemId: number; + framework: RollbarFrameworkId; + totalOccurrences: number; + level: RollbarLevel; + counter: number; + lastModifiedBy: number; + firstOccurrenceId: number; + activatingOccurrenceId: number; + lastResolvedTimestamp: number; +}; + +// @public (undocumented) +export type RollbarItemCount = { + timestamp: number; + count: number; +}; + +// @public (undocumented) +export type RollbarItemsResponse = { + items: RollbarItem[]; + page: number; + totalCount: number; +}; + +// @public (undocumented) +export enum RollbarLevel { + // (undocumented) + critical = 50, + // (undocumented) + debug = 10, + // (undocumented) + error = 40, + // (undocumented) + info = 20, + // (undocumented) + warning = 30, +} + +// @public (undocumented) +export enum RollbarPlatformId { + // (undocumented) + 'google-app-engine' = 6, + // (undocumented) + 'android' = 3, + // (undocumented) + 'browser' = 1, + // (undocumented) + 'client' = 7, + // (undocumented) + 'flash' = 2, + // (undocumented) + 'heroku' = 5, + // (undocumented) + 'ios' = 4, + // (undocumented) + 'unknown' = 0, +} + +// @public (undocumented) +export type RollbarProject = { + id: number; + name: string; + accountId: number; + status: 'enabled' | string; +}; + +// @public (undocumented) +export type RollbarProjectAccessToken = { + projectId: number; + name: string; + scopes: RollbarProjectAccessTokenScope[]; + accessToken: string; + status: 'enabled' | string; +}; + +// @public (undocumented) +export type RollbarProjectAccessTokenScope = 'read' | 'write'; + +// @public (undocumented) +export type RollbarTopActiveItem = { + item: { + id: number; + counter: number; + environment: RollbarEnvironment; + framework: RollbarFrameworkId; + lastOccurrenceTimestamp: number; + level: number; + occurrences: number; + projectId: number; + title: string; + uniqueOccurrences: number; + }; + counts: number[]; +}; + // @public (undocumented) export interface RouterOptions { // (undocumented) @@ -111,9 +265,4 @@ export interface RouterOptions { // (undocumented) rollbarApi?: RollbarApi; } - -// Warnings were encountered during analysis: -// -// src/api/RollbarApi.d.ts:21:9 - (ae-forgotten-export) The symbol "RollbarItem" needs to be exported by the entry point index.d.ts -// src/api/RollbarApi.d.ts:32:13 - (ae-forgotten-export) The symbol "RollbarFrameworkId" needs to be exported by the entry point index.d.ts ``` diff --git a/plugins/rollbar-backend/src/api/RollbarApi.ts b/plugins/rollbar-backend/src/api/RollbarApi.ts index 245164b531..59394d7ad0 100644 --- a/plugins/rollbar-backend/src/api/RollbarApi.ts +++ b/plugins/rollbar-backend/src/api/RollbarApi.ts @@ -30,6 +30,7 @@ const baseUrl = 'https://api.rollbar.com/api/1'; const buildUrl = (url: string) => `${baseUrl}${url}`; +/** @public */ export class RollbarApi { private projectMap: ProjectMetadataMap | undefined; @@ -165,6 +166,7 @@ export class RollbarApi { } } +/** @public */ export function getRequestHeaders(token: string) { return { headers: { diff --git a/plugins/rollbar-backend/src/api/index.ts b/plugins/rollbar-backend/src/api/index.ts index a2ce96e16a..08d6c4b061 100644 --- a/plugins/rollbar-backend/src/api/index.ts +++ b/plugins/rollbar-backend/src/api/index.ts @@ -14,4 +14,5 @@ * limitations under the License. */ -export { RollbarApi, getRequestHeaders } from './RollbarApi'; +export { getRequestHeaders, RollbarApi } from './RollbarApi'; +export * from './types'; diff --git a/plugins/rollbar-backend/src/api/types.ts b/plugins/rollbar-backend/src/api/types.ts index 1133f84b67..a1a6202656 100644 --- a/plugins/rollbar-backend/src/api/types.ts +++ b/plugins/rollbar-backend/src/api/types.ts @@ -16,9 +16,13 @@ // TODO: Make this re-usable with backend +/** @public */ export type RollbarProjectAccessTokenScope = 'read' | 'write'; + +/** @public */ export type RollbarEnvironment = 'production' | string; +/** @public */ export enum RollbarLevel { debug = 10, info = 20, @@ -27,6 +31,7 @@ export enum RollbarLevel { critical = 50, } +/** @public */ export enum RollbarFrameworkId { 'unknown' = 0, 'rails' = 1, @@ -49,6 +54,7 @@ export enum RollbarFrameworkId { 'rq' = 18, } +/** @public */ export enum RollbarPlatformId { 'unknown' = 0, 'browser' = 1, @@ -60,6 +66,7 @@ export enum RollbarPlatformId { 'client' = 7, } +/** @public */ export type RollbarProject = { id: number; name: string; @@ -67,6 +74,7 @@ export type RollbarProject = { status: 'enabled' | string; }; +/** @public */ export type RollbarProjectAccessToken = { projectId: number; name: string; @@ -75,6 +83,7 @@ export type RollbarProjectAccessToken = { status: 'enabled' | string; }; +/** @public */ export type RollbarItem = { publicItemId: number; integrationsData: null; @@ -107,17 +116,20 @@ export type RollbarItem = { lastResolvedTimestamp: number; }; +/** @public */ export type RollbarItemsResponse = { items: RollbarItem[]; page: number; totalCount: number; }; +/** @public */ export type RollbarItemCount = { timestamp: number; count: number; }; +/** @public */ export type RollbarTopActiveItem = { item: { id: number; diff --git a/plugins/rollbar-backend/src/service/router.ts b/plugins/rollbar-backend/src/service/router.ts index 6d578af29f..a5646fdf06 100644 --- a/plugins/rollbar-backend/src/service/router.ts +++ b/plugins/rollbar-backend/src/service/router.ts @@ -21,12 +21,14 @@ import { errorHandler } from '@backstage/backend-common'; import { Config } from '@backstage/config'; import { RollbarApi } from '../api'; +/** @public */ export interface RouterOptions { rollbarApi?: RollbarApi; logger: Logger; config: Config; } +/** @public */ export async function createRouter( options: RouterOptions, ): Promise { diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 0683c1efbd..ed0fb5ad8e 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -233,7 +233,6 @@ const ALLOW_WARNINGS = [ 'plugins/newrelic', 'plugins/newrelic-dashboard', 'plugins/pagerduty', - 'plugins/rollbar-backend', 'plugins/search-backend-module-pg', 'plugins/sentry', 'plugins/shortcuts', From 37bfd1a4dd88b4f7283583005857fb39378e94c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 10:21:26 +0200 Subject: [PATCH 04/41] sentry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/sentry/api-report.md | 57 +++++++++++-------- plugins/sentry/src/api/index.ts | 9 ++- plugins/sentry/src/api/mock/mock-api.ts | 3 + plugins/sentry/src/api/sentry-issue.ts | 14 +++-- .../SentryIssuesTable/SentryIssuesTable.tsx | 7 +-- plugins/sentry/src/extensions.tsx | 20 +++---- plugins/sentry/src/index.ts | 1 + scripts/api-extractor.ts | 1 - 8 files changed, 68 insertions(+), 44 deletions(-) diff --git a/plugins/sentry/api-report.md b/plugins/sentry/api-report.md index bd77c46aa6..2a1b041546 100644 --- a/plugins/sentry/api-report.md +++ b/plugins/sentry/api-report.md @@ -14,28 +14,18 @@ import { InfoCardVariants } from '@backstage/core-components'; import { Options } from '@material-table/core'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-forgotten-export) The symbol "SentryPageProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "EntitySentryCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const EntitySentryCard: ({ - statsFor, - tableOptions, -}: SentryPageProps) => JSX.Element; +export const EntitySentryCard: (props: SentryPageProps) => JSX.Element; -// Warning: (ae-missing-release-tag) "EntitySentryContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const EntitySentryContent: ({ - statsFor, - tableOptions, -}: SentryPageProps) => JSX.Element; +export const EntitySentryContent: (props: SentryPageProps) => JSX.Element; + +// @public (undocumented) +export type EventPoint = number[]; // @public export const isSentryAvailable: (entity: Entity) => boolean; -// Warning: (ae-missing-release-tag) "MockSentryApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class MockSentryApi implements SentryApi { // (undocumented) @@ -74,11 +64,14 @@ export interface SentryApi { ): Promise; } +// @public (undocumented) +export type SentryApiError = { + detail: string; +}; + // @public (undocumented) export const sentryApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "SentryIssue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type SentryIssue = { platform: SentryPlatform; @@ -113,6 +106,14 @@ export type SentryIssue = { statusDetails: any; }; +// @public (undocumented) +export type SentryIssueMetadata = { + function?: string; + type?: string; + value?: string; + filename?: string; +}; + // @public (undocumented) export const SentryIssuesWidget: (props: { entity: Entity; @@ -122,6 +123,15 @@ export const SentryIssuesWidget: (props: { query?: string; }) => JSX.Element; +// @public (undocumented) +export type SentryPageProps = { + statsFor?: '24h' | '14d' | ''; + tableOptions?: Options; +}; + +// @public (undocumented) +export type SentryPlatform = 'javascript' | 'javascript-react' | string; + // @public (undocumented) const sentryPlugin: BackstagePlugin< { @@ -133,10 +143,11 @@ const sentryPlugin: BackstagePlugin< export { sentryPlugin as plugin }; export { sentryPlugin }; -// Warnings were encountered during analysis: -// -// src/api/sentry-issue.d.ts:16:5 - (ae-forgotten-export) The symbol "SentryPlatform" needs to be exported by the entry point index.d.ts -// src/api/sentry-issue.d.ts:21:9 - (ae-forgotten-export) The symbol "EventPoint" needs to be exported by the entry point index.d.ts -// src/api/sentry-issue.d.ts:31:5 - (ae-forgotten-export) The symbol "SentryIssueMetadata" needs to be exported by the entry point index.d.ts -// src/api/sentry-issue.d.ts:44:5 - (ae-forgotten-export) The symbol "SentryProject" needs to be exported by the entry point index.d.ts +// @public (undocumented) +export type SentryProject = { + platform: SentryPlatform; + slug: string; + id: string; + name: string; +}; ``` diff --git a/plugins/sentry/src/api/index.ts b/plugins/sentry/src/api/index.ts index 66ac07eda2..9ae6d4eea2 100644 --- a/plugins/sentry/src/api/index.ts +++ b/plugins/sentry/src/api/index.ts @@ -17,5 +17,12 @@ export * from './mock'; export type { SentryApi } from './sentry-api'; export { sentryApiRef } from './sentry-api'; -export type { SentryIssue } from './sentry-issue'; +export type { + EventPoint, + SentryApiError, + SentryIssue, + SentryIssueMetadata, + SentryPlatform, + SentryProject, +} from './sentry-issue'; export { ProductionSentryApi } from './production-api'; diff --git a/plugins/sentry/src/api/mock/mock-api.ts b/plugins/sentry/src/api/mock/mock-api.ts index af64d8656a..4f9f4254fc 100644 --- a/plugins/sentry/src/api/mock/mock-api.ts +++ b/plugins/sentry/src/api/mock/mock-api.ts @@ -30,9 +30,12 @@ function getMockIssue(): SentryIssue { stats: randomizedStats, }; } + function getMockIssues(number: number): SentryIssue[] { return new Array(number).fill(0).map(getMockIssue); } + +/** @public */ export class MockSentryApi implements SentryApi { fetchIssues(): Promise { return new Promise(resolve => { diff --git a/plugins/sentry/src/api/sentry-issue.ts b/plugins/sentry/src/api/sentry-issue.ts index ef0e99adb8..e25cf88829 100644 --- a/plugins/sentry/src/api/sentry-issue.ts +++ b/plugins/sentry/src/api/sentry-issue.ts @@ -14,24 +14,29 @@ * limitations under the License. */ -type SentryPlatform = 'javascript' | 'javascript-react' | string; +/** @public */ +export type SentryPlatform = 'javascript' | 'javascript-react' | string; -type EventPoint = number[]; +/** @public */ +export type EventPoint = number[]; -type SentryProject = { +/** @public */ +export type SentryProject = { platform: SentryPlatform; slug: string; id: string; name: string; }; -type SentryIssueMetadata = { +/** @public */ +export type SentryIssueMetadata = { function?: string; type?: string; value?: string; filename?: string; }; +/** @public */ export type SentryIssue = { platform: SentryPlatform; lastSeen: string; @@ -65,6 +70,7 @@ export type SentryIssue = { statusDetails: any; }; +/** @public */ export type SentryApiError = { detail: string; }; diff --git a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx index e8e4c44a11..abe29efd7f 100644 --- a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx +++ b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx @@ -64,11 +64,8 @@ type SentryIssuesTableProps = { tableOptions: Options; }; -const SentryIssuesTable = ({ - sentryIssues, - statsFor, - tableOptions, -}: SentryIssuesTableProps) => { +const SentryIssuesTable = (props: SentryIssuesTableProps) => { + const { sentryIssues, statsFor, tableOptions } = props; return ( ; }; +/** @public */ export const EntitySentryContent = sentryPlugin.provide( createRoutableExtension({ name: 'EntitySentryContent', @@ -35,7 +37,7 @@ export const EntitySentryContent = sentryPlugin.provide( component: () => import('./components/SentryIssuesWidget').then( ({ SentryIssuesWidget }) => { - const SentryPage = ({ statsFor, tableOptions }: SentryPageProps) => { + const SentryPage = (props: SentryPageProps) => { const { entity } = useEntity(); const defaultOptions: Options = { padding: 'dense', @@ -46,8 +48,8 @@ export const EntitySentryContent = sentryPlugin.provide( return ( ); }; @@ -57,6 +59,7 @@ export const EntitySentryContent = sentryPlugin.provide( }), ); +/** @public */ export const EntitySentryCard = sentryPlugin.provide( createComponentExtension({ name: 'EntitySentryCard', @@ -64,17 +67,14 @@ export const EntitySentryCard = sentryPlugin.provide( lazy: () => import('./components/SentryIssuesWidget').then( ({ SentryIssuesWidget }) => { - const SentryCard = ({ - statsFor, - tableOptions, - }: SentryPageProps) => { + const SentryCard = (props: SentryPageProps) => { const { entity } = useEntity(); return ( Date: Fri, 19 Aug 2022 10:24:00 +0200 Subject: [PATCH 05/41] xcmetrics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/xcmetrics/api-report.md | 4 ---- plugins/xcmetrics/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/xcmetrics/api-report.md b/plugins/xcmetrics/api-report.md index 373748e9e2..8dd87cc7d6 100644 --- a/plugins/xcmetrics/api-report.md +++ b/plugins/xcmetrics/api-report.md @@ -8,13 +8,9 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "XcmetricsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const XcmetricsPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "xcmetricsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const xcmetricsPlugin: BackstagePlugin< { diff --git a/plugins/xcmetrics/src/plugin.ts b/plugins/xcmetrics/src/plugin.ts index f6b7dd7e43..ffa72d1ff3 100644 --- a/plugins/xcmetrics/src/plugin.ts +++ b/plugins/xcmetrics/src/plugin.ts @@ -22,6 +22,7 @@ import { import { xcmetricsApiRef, XcmetricsClient } from './api'; import { rootRouteRef } from './routes'; +/** @public */ export const xcmetricsPlugin = createPlugin({ id: 'xcmetrics', routes: { @@ -40,6 +41,7 @@ export const xcmetricsPlugin = createPlugin({ ], }); +/** @public */ export const XcmetricsPage = xcmetricsPlugin.provide( createRoutableExtension({ name: 'XcmetricsPage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index f2a71ad03f..974cdf88a5 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -238,7 +238,6 @@ const ALLOW_WARNINGS = [ 'plugins/splunk-on-call', 'plugins/tech-radar', 'plugins/user-settings', - 'plugins/xcmetrics', ]; async function resolvePackagePath( From 2dd66bfe2b5b291dc3ddca9a89482420bd621979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 11:50:00 +0200 Subject: [PATCH 06/41] home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/home/api-report.md | 71 +++++++++++-------- .../home/src/assets/TemplateBackstageLogo.tsx | 17 ++--- .../src/assets/TemplateBackstageLogoIcon.tsx | 1 + plugins/home/src/components/SettingsModal.tsx | 1 + plugins/home/src/extensions.tsx | 15 +++- .../HeaderWorldClock/HeaderWorldClock.tsx | 1 + .../homePageComponents/Toolkit/Content.tsx | 18 ++--- .../homePageComponents/Toolkit/Context.tsx | 1 + .../src/homePageComponents/Toolkit/index.ts | 1 + plugins/home/src/homePageComponents/index.ts | 3 +- plugins/home/src/index.ts | 9 ++- plugins/home/src/plugin.ts | 2 +- scripts/api-extractor.ts | 1 - 13 files changed, 82 insertions(+), 59 deletions(-) diff --git a/plugins/home/api-report.md b/plugins/home/api-report.md index 0870a23ba7..cbd36cd627 100644 --- a/plugins/home/api-report.md +++ b/plugins/home/api-report.md @@ -11,8 +11,11 @@ import { default as React_2 } from 'react'; import { ReactNode } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "ClockConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type CardExtensionProps = ComponentRenderer & { + title?: string; +} & T; + // @public (undocumented) export type ClockConfig = { label: string; @@ -29,6 +32,14 @@ export const ComponentAccordion: (props: { ContextProvider?: ((props: any) => JSX.Element) | undefined; }) => JSX.Element; +// @public (undocumented) +export type ComponentParts = { + Content: (props?: any) => JSX.Element; + Actions?: () => JSX.Element; + Settings?: () => JSX.Element; + ContextProvider?: (props: any) => JSX.Element; +}; + // @public (undocumented) export type ComponentRenderer = { Renderer?: (props: RendererProps) => JSX.Element; @@ -50,8 +61,6 @@ export const ComponentTabs: (props: { }[]; }) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "CardExtensionProps" needs to be exported by the entry point index.d.ts -// // @public export function createCardExtension(options: { title: string; @@ -79,27 +88,19 @@ export const HomepageCompositionRoot: (props: { // @public (undocumented) export const HomePageRandomJoke: ( - props: ComponentRenderer & { - title?: string | undefined; - } & { + props: CardExtensionProps<{ defaultCategory?: 'any' | 'programming' | undefined; - }, + }>, ) => JSX.Element; // @public export const HomePageStarredEntities: ( - props: ComponentRenderer & { - title?: string | undefined; - }, + props: CardExtensionProps, ) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "ToolkitContentProps" needs to be exported by the entry point index.d.ts -// // @public export const HomePageToolkit: ( - props: ComponentRenderer & { - title?: string | undefined; - } & ToolkitContentProps, + props: CardExtensionProps, ) => JSX.Element; // @public (undocumented) @@ -111,8 +112,11 @@ export const homePlugin: BackstagePlugin< {} >; -// Warning: (ae-missing-release-tag) "SettingsModal" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type RendererProps = { + title: string; +} & ComponentParts; + // @public (undocumented) export const SettingsModal: (props: { open: boolean; @@ -121,24 +125,29 @@ export const SettingsModal: (props: { children: JSX.Element; }) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "TemplateBackstageLogoProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "TemplateBackstageLogo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const TemplateBackstageLogo: ( - props: TemplateBackstageLogoProps, -) => JSX.Element; +export const TemplateBackstageLogo: (props: { + classes: { + svg: string; + path: string; + }; +}) => JSX.Element; -// Warning: (ae-missing-release-tag) "TemplateBackstageLogoIcon" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const TemplateBackstageLogoIcon: () => JSX.Element; +// @public (undocumented) +export type Tool = { + label: string; + url: string; + icon: React_2.ReactNode; +}; + +// @public +export type ToolkitContentProps = { + tools: Tool[]; +}; + // @public export const WelcomeTitle: () => JSX.Element; - -// Warnings were encountered during analysis: -// -// src/extensions.d.ts:6:5 - (ae-forgotten-export) The symbol "RendererProps" needs to be exported by the entry point index.d.ts -// src/extensions.d.ts:27:5 - (ae-forgotten-export) The symbol "ComponentParts" needs to be exported by the entry point index.d.ts ``` diff --git a/plugins/home/src/assets/TemplateBackstageLogo.tsx b/plugins/home/src/assets/TemplateBackstageLogo.tsx index 9088cfa58c..231e65e0c6 100644 --- a/plugins/home/src/assets/TemplateBackstageLogo.tsx +++ b/plugins/home/src/assets/TemplateBackstageLogo.tsx @@ -16,16 +16,13 @@ import React from 'react'; -type Classes = { - svg: string; - path: string; -}; - -type TemplateBackstageLogoProps = { - classes: Classes; -}; - -export const TemplateBackstageLogo = (props: TemplateBackstageLogoProps) => { +/** @public */ +export const TemplateBackstageLogo = (props: { + classes: { + svg: string; + path: string; + }; +}) => { return ( { const classes = useStyles(); diff --git a/plugins/home/src/components/SettingsModal.tsx b/plugins/home/src/components/SettingsModal.tsx index 4ee25f9f5c..ace9944f28 100644 --- a/plugins/home/src/components/SettingsModal.tsx +++ b/plugins/home/src/components/SettingsModal.tsx @@ -23,6 +23,7 @@ import { DialogTitle, } from '@material-ui/core'; +/** @public */ export const SettingsModal = (props: { open: boolean; close: Function; diff --git a/plugins/home/src/extensions.tsx b/plugins/home/src/extensions.tsx index f1edbc99b6..af5dbee3ed 100644 --- a/plugins/home/src/extensions.tsx +++ b/plugins/home/src/extensions.tsx @@ -28,16 +28,25 @@ export type ComponentRenderer = { Renderer?: (props: RendererProps) => JSX.Element; }; -type ComponentParts = { +/** + * @public + */ +export type ComponentParts = { Content: (props?: any) => JSX.Element; Actions?: () => JSX.Element; Settings?: () => JSX.Element; ContextProvider?: (props: any) => JSX.Element; }; -type RendererProps = { title: string } & ComponentParts; +/** + * @public + */ +export type RendererProps = { title: string } & ComponentParts; -type CardExtensionProps = ComponentRenderer & { title?: string } & T; +/** + * @public + */ +export type CardExtensionProps = ComponentRenderer & { title?: string } & T; /** * An extension creator to create card based components for the homepage diff --git a/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.tsx b/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.tsx index 6672fe6a22..a45a51e0ad 100644 --- a/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.tsx +++ b/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.tsx @@ -27,6 +27,7 @@ type TimeObj = { label: string; }; +/** @public */ export type ClockConfig = { label: string; timeZone: string; diff --git a/plugins/home/src/homePageComponents/Toolkit/Content.tsx b/plugins/home/src/homePageComponents/Toolkit/Content.tsx index e73a834a7e..a1ada00b0b 100644 --- a/plugins/home/src/homePageComponents/Toolkit/Content.tsx +++ b/plugins/home/src/homePageComponents/Toolkit/Content.tsx @@ -52,15 +52,6 @@ const useStyles = makeStyles(theme => ({ }, })); -/** - * Props for Toolkit content component {@link Content}. - * - * @public - */ -export type ToolkitContentProps = { - tools: Tool[]; -}; - /** * A component to display a list of tools for the user. * @@ -85,3 +76,12 @@ export const Content = (props: ToolkitContentProps) => { ); }; + +/** + * Props for Toolkit Content component. + * + * @public + */ +export type ToolkitContentProps = { + tools: Tool[]; +}; diff --git a/plugins/home/src/homePageComponents/Toolkit/Context.tsx b/plugins/home/src/homePageComponents/Toolkit/Context.tsx index 3e7b121252..20f8b16b6d 100644 --- a/plugins/home/src/homePageComponents/Toolkit/Context.tsx +++ b/plugins/home/src/homePageComponents/Toolkit/Context.tsx @@ -16,6 +16,7 @@ import React, { createContext } from 'react'; +/** @public */ export type Tool = { label: string; url: string; diff --git a/plugins/home/src/homePageComponents/Toolkit/index.ts b/plugins/home/src/homePageComponents/Toolkit/index.ts index 67ea1f3c84..266a8afffb 100644 --- a/plugins/home/src/homePageComponents/Toolkit/index.ts +++ b/plugins/home/src/homePageComponents/Toolkit/index.ts @@ -17,3 +17,4 @@ export { Content } from './Content'; export type { ToolkitContentProps } from './Content'; export { ContextProvider } from './Context'; +export type { Tool } from './Context'; diff --git a/plugins/home/src/homePageComponents/index.ts b/plugins/home/src/homePageComponents/index.ts index d318226dbd..6a3978c595 100644 --- a/plugins/home/src/homePageComponents/index.ts +++ b/plugins/home/src/homePageComponents/index.ts @@ -14,6 +14,5 @@ * limitations under the License. */ -export * from './CompanyLogo'; -export * from './Toolkit'; +export type { ToolkitContentProps, Tool } from './Toolkit'; export type { ClockConfig } from './HeaderWorldClock'; diff --git a/plugins/home/src/index.ts b/plugins/home/src/index.ts index 1776b5aa9c..83eb72b613 100644 --- a/plugins/home/src/index.ts +++ b/plugins/home/src/index.ts @@ -35,6 +35,11 @@ export { } from './plugin'; export { SettingsModal } from './components'; export * from './assets'; -export type { ClockConfig } from './homePageComponents'; +export * from './homePageComponents'; export { createCardExtension } from './extensions'; -export type { ComponentRenderer } from './extensions'; +export type { + CardExtensionProps, + ComponentParts, + ComponentRenderer, + RendererProps, +} from './extensions'; diff --git a/plugins/home/src/plugin.ts b/plugins/home/src/plugin.ts index 9b221ad8dc..5ae72ae510 100644 --- a/plugins/home/src/plugin.ts +++ b/plugins/home/src/plugin.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { createComponentExtension, createPlugin, @@ -20,7 +21,6 @@ import { } from '@backstage/core-plugin-api'; import { createCardExtension } from './extensions'; import { ToolkitContentProps } from './homePageComponents'; - import { rootRouteRef } from './routes'; /** @public */ diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 974cdf88a5..3f61a8c930 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -224,7 +224,6 @@ const ALLOW_WARNINGS = [ 'plugins/github-pull-requests-board', 'plugins/gitops-profiles', 'plugins/graphql-backend', - 'plugins/home', 'plugins/ilert', 'plugins/jenkins', 'plugins/jenkins-backend', From eec0b15d3b0aada9cdf174b49154fb99ba890260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 11:51:55 +0200 Subject: [PATCH 07/41] app-backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/app-backend/api-report.md | 4 ---- plugins/app-backend/src/service/router.ts | 2 ++ scripts/api-extractor.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/app-backend/api-report.md b/plugins/app-backend/api-report.md index e1b0c63469..0383129823 100644 --- a/plugins/app-backend/api-report.md +++ b/plugins/app-backend/api-report.md @@ -8,13 +8,9 @@ import express from 'express'; import { Logger } from 'winston'; import { PluginDatabaseManager } from '@backstage/backend-common'; -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createRouter(options: RouterOptions): Promise; -// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface RouterOptions { appPackageName: string; diff --git a/plugins/app-backend/src/service/router.ts b/plugins/app-backend/src/service/router.ts index 46ecd470da..de299fd895 100644 --- a/plugins/app-backend/src/service/router.ts +++ b/plugins/app-backend/src/service/router.ts @@ -40,6 +40,7 @@ import { // express uses mime v1 while we only have types for mime v2 type Mime = { lookup(arg0: string): string }; +/** @public */ export interface RouterOptions { config: Config; logger: Logger; @@ -85,6 +86,7 @@ export interface RouterOptions { disableConfigInjection?: boolean; } +/** @public */ export async function createRouter( options: RouterOptions, ): Promise { diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 3f61a8c930..1fd8131b4d 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -201,7 +201,6 @@ const ALLOW_WARNINGS = [ 'packages/core-components', 'plugins/allure', 'plugins/apache-airflow', - 'plugins/app-backend', 'plugins/auth-backend', 'plugins/bitrise', 'plugins/catalog', From 77a9d2f6cf9fc4c548cc994468bb7e5749b1c542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 11:56:16 +0200 Subject: [PATCH 08/41] shortcuts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/shortcuts/api-report.md | 12 ------------ plugins/shortcuts/src/api/LocalStoredShortcuts.ts | 2 ++ plugins/shortcuts/src/api/ShortcutApi.ts | 2 ++ plugins/shortcuts/src/plugin.ts | 2 ++ plugins/shortcuts/src/types.ts | 1 + scripts/api-extractor.ts | 1 - 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/plugins/shortcuts/api-report.md b/plugins/shortcuts/api-report.md index 7f81df835d..1aa1dea003 100644 --- a/plugins/shortcuts/api-report.md +++ b/plugins/shortcuts/api-report.md @@ -12,8 +12,6 @@ import { Observable } from '@backstage/types'; import { default as Observable_2 } from 'zen-observable'; import { StorageApi } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "LocalStoredShortcuts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class LocalStoredShortcuts implements ShortcutApi { constructor(storageApi: StorageApi); @@ -31,8 +29,6 @@ export class LocalStoredShortcuts implements ShortcutApi { update(shortcut: Shortcut): Promise; } -// Warning: (ae-missing-release-tag) "Shortcut" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Shortcut = { id: string; @@ -40,8 +36,6 @@ export type Shortcut = { title: string; }; -// Warning: (ae-missing-release-tag) "ShortcutApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ShortcutApi { add(shortcut: Omit): Promise; @@ -52,18 +46,12 @@ export interface ShortcutApi { update(shortcut: Shortcut): Promise; } -// Warning: (ae-missing-release-tag) "Shortcuts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const Shortcuts: (props: ShortcutsProps) => JSX.Element; -// Warning: (ae-missing-release-tag) "shortcutsApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const shortcutsApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "shortcutsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const shortcutsPlugin: BackstagePlugin<{}, {}, {}>; diff --git a/plugins/shortcuts/src/api/LocalStoredShortcuts.ts b/plugins/shortcuts/src/api/LocalStoredShortcuts.ts index 82f4b7dd1a..9f3561be67 100644 --- a/plugins/shortcuts/src/api/LocalStoredShortcuts.ts +++ b/plugins/shortcuts/src/api/LocalStoredShortcuts.ts @@ -23,6 +23,8 @@ import Observable from 'zen-observable'; /** * Implementation of the ShortcutApi that uses the StorageApi to store shortcuts. + * + * @public */ export class LocalStoredShortcuts implements ShortcutApi { constructor(private readonly storageApi: StorageApi) {} diff --git a/plugins/shortcuts/src/api/ShortcutApi.ts b/plugins/shortcuts/src/api/ShortcutApi.ts index 1f93baa66c..96c5de1697 100644 --- a/plugins/shortcuts/src/api/ShortcutApi.ts +++ b/plugins/shortcuts/src/api/ShortcutApi.ts @@ -18,10 +18,12 @@ import { Shortcut } from '../types'; import { createApiRef } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; +/** @public */ export const shortcutsApiRef = createApiRef({ id: 'plugin.shortcuts.api', }); +/** @public */ export interface ShortcutApi { /** * Returns an Observable that will subscribe to changes. diff --git a/plugins/shortcuts/src/plugin.ts b/plugins/shortcuts/src/plugin.ts index d20cfa8401..2b0d0559e0 100644 --- a/plugins/shortcuts/src/plugin.ts +++ b/plugins/shortcuts/src/plugin.ts @@ -22,6 +22,7 @@ import { storageApiRef, } from '@backstage/core-plugin-api'; +/** @public */ export const shortcutsPlugin = createPlugin({ id: 'shortcuts', apis: [ @@ -34,6 +35,7 @@ export const shortcutsPlugin = createPlugin({ ], }); +/** @public */ export const Shortcuts = shortcutsPlugin.provide( createComponentExtension({ name: 'Shortcuts', diff --git a/plugins/shortcuts/src/types.ts b/plugins/shortcuts/src/types.ts index 2421f0e369..75ef561f74 100644 --- a/plugins/shortcuts/src/types.ts +++ b/plugins/shortcuts/src/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export type Shortcut = { id: string; url: string; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 1fd8131b4d..13c252a991 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -232,7 +232,6 @@ const ALLOW_WARNINGS = [ 'plugins/newrelic-dashboard', 'plugins/pagerduty', 'plugins/search-backend-module-pg', - 'plugins/shortcuts', 'plugins/splunk-on-call', 'plugins/tech-radar', 'plugins/user-settings', From cd819fc01520b95c2d393b33b6509402442288db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 12:01:23 +0200 Subject: [PATCH 09/41] tech-radar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/tech-radar/api-report.md | 30 ------------------- plugins/tech-radar/src/api.ts | 17 +++++++++++ .../src/components/RadarComponent.tsx | 4 +++ .../tech-radar/src/components/RadarPage.tsx | 4 +++ plugins/tech-radar/src/index.ts | 2 ++ plugins/tech-radar/src/plugin.ts | 5 +++- scripts/api-extractor.ts | 1 - 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/plugins/tech-radar/api-report.md b/plugins/tech-radar/api-report.md index a55cf79f28..39fa19da43 100644 --- a/plugins/tech-radar/api-report.md +++ b/plugins/tech-radar/api-report.md @@ -9,8 +9,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "MovedState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export enum MovedState { Down = -1, @@ -18,8 +16,6 @@ export enum MovedState { Up = 1, } -// Warning: (ae-missing-release-tag) "RadarEntry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface RadarEntry { description?: string; @@ -31,8 +27,6 @@ export interface RadarEntry { url: string; } -// Warning: (ae-missing-release-tag) "RadarEntrySnapshot" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface RadarEntrySnapshot { date: Date; @@ -41,21 +35,15 @@ export interface RadarEntrySnapshot { ringId: string; } -// Warning: (ae-missing-release-tag) "RadarPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function RadarPage(props: TechRadarPageProps): JSX.Element; -// Warning: (ae-missing-release-tag) "RadarQuadrant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface RadarQuadrant { id: string; name: string; } -// Warning: (ae-missing-release-tag) "RadarRing" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface RadarRing { color: string; @@ -63,30 +51,20 @@ export interface RadarRing { name: string; } -// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export const Router: typeof RadarPage; -// Warning: (ae-missing-release-tag) "TechRadarApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface TechRadarApi { load: (id: string | undefined) => Promise; } -// Warning: (ae-missing-release-tag) "techRadarApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export const techRadarApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "RadarComponent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function TechRadarComponent(props: TechRadarComponentProps): JSX.Element; -// Warning: (ae-missing-release-tag) "TechRadarComponentProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface TechRadarComponentProps { height: number; @@ -96,8 +74,6 @@ export interface TechRadarComponentProps { width: number; } -// Warning: (ae-missing-release-tag) "TechRadarLoaderResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface TechRadarLoaderResponse { entries: RadarEntry[]; @@ -105,13 +81,9 @@ export interface TechRadarLoaderResponse { rings: RadarRing[]; } -// Warning: (ae-missing-release-tag) "TechRadarPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export const TechRadarPage: RadarPage; -// Warning: (ae-missing-release-tag) "TechRadarPageProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface TechRadarPageProps extends TechRadarComponentProps { pageTitle?: string; @@ -119,8 +91,6 @@ export interface TechRadarPageProps extends TechRadarComponentProps { title?: string; } -// Warning: (ae-missing-release-tag) "techRadarPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public const techRadarPlugin: BackstagePlugin< { diff --git a/plugins/tech-radar/src/api.ts b/plugins/tech-radar/src/api.ts index 241f3dce85..c932ec98e2 100644 --- a/plugins/tech-radar/src/api.ts +++ b/plugins/tech-radar/src/api.ts @@ -13,10 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { ApiRef, createApiRef } from '@backstage/core-plugin-api'; /** * {@link @backstage/core-plugin-api#ApiRef} for the {@link TechRadarApi} + * + * @public */ export const techRadarApiRef: ApiRef = createApiRef( { @@ -31,6 +34,8 @@ export const techRadarApiRef: ApiRef = createApiRef( * * This should be implemented by user, as {@link https://github.com/backstage/backstage/blob/master/plugins/tech-radar/src/sample.ts | default} * serves only some static data for example purposes + * + * @public */ export interface TechRadarApi { /** @@ -46,6 +51,8 @@ export interface TechRadarApi { /** * Tech Radar Ring which indicates stage of {@link RadarEntry} + * + * @public */ export interface RadarRing { /** @@ -68,6 +75,8 @@ export interface RadarRing { /** * Tech Radar Quadrant which represent area/topic of {@link RadarEntry} + * + * @public */ export interface RadarQuadrant { /** @@ -82,6 +91,8 @@ export interface RadarQuadrant { /** * Single Entry in Tech Radar + * + * @public */ export interface RadarEntry { /** @@ -120,6 +131,8 @@ export interface RadarEntry { /** * State of {@link RadarEntry} at given point in time + * + * @public */ export interface RadarEntrySnapshot { /** @@ -142,6 +155,8 @@ export interface RadarEntrySnapshot { /** * Indicates how {@link RadarEntry} moved though {@link RadarRing} on {@link RadarEntry.timeline} + * + * @public */ export enum MovedState { /** @@ -164,6 +179,8 @@ export enum MovedState { /** * Response from {@link TechRadarApi} + * + * @public */ export interface TechRadarLoaderResponse { /** diff --git a/plugins/tech-radar/src/components/RadarComponent.tsx b/plugins/tech-radar/src/components/RadarComponent.tsx index e7cca7d45f..4ed7626d52 100644 --- a/plugins/tech-radar/src/components/RadarComponent.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.tsx @@ -61,6 +61,8 @@ function matchFilter(filter?: string): (entry: RadarEntry) => boolean { /** * Properties of {@link TechRadarComponent} + * + * @public */ export interface TechRadarComponentProps { /** @@ -95,6 +97,8 @@ export interface TechRadarComponentProps { * @remarks * * For advanced use cases. Typically, you want to use {@link TechRadarPage} + * + * @public */ export function RadarComponent(props: TechRadarComponentProps) { const { loading, error, value: data } = useTechRadarLoader(props.id); diff --git a/plugins/tech-radar/src/components/RadarPage.tsx b/plugins/tech-radar/src/components/RadarPage.tsx index 17e481fcc4..49f856eddd 100644 --- a/plugins/tech-radar/src/components/RadarPage.tsx +++ b/plugins/tech-radar/src/components/RadarPage.tsx @@ -34,6 +34,8 @@ const useStyles = makeStyles(() => ({ /** * Properties for {@link TechRadarPage} + * + * @public */ export interface TechRadarPageProps extends TechRadarComponentProps { /** @@ -52,6 +54,8 @@ export interface TechRadarPageProps extends TechRadarComponentProps { /** * Main Page of Tech Radar + * + * @public */ export function RadarPage(props: TechRadarPageProps) { const { diff --git a/plugins/tech-radar/src/index.ts b/plugins/tech-radar/src/index.ts index dbffcca553..0ea02cabe5 100644 --- a/plugins/tech-radar/src/index.ts +++ b/plugins/tech-radar/src/index.ts @@ -32,6 +32,8 @@ export * from './components'; /** * @deprecated Use plugin extensions instead + * + * @public */ export const Router = RadarPage; diff --git a/plugins/tech-radar/src/plugin.ts b/plugins/tech-radar/src/plugin.ts index 495aa47879..7f042a1b6f 100644 --- a/plugins/tech-radar/src/plugin.ts +++ b/plugins/tech-radar/src/plugin.ts @@ -15,7 +15,6 @@ */ import { techRadarApiRef } from './api'; - import { SampleTechRadarApi } from './sample'; import { createPlugin, @@ -30,6 +29,8 @@ const rootRouteRef = createRouteRef({ /** * Tech Radar plugin instance + * + * @public */ export const techRadarPlugin = createPlugin({ id: 'tech-radar', @@ -45,6 +46,8 @@ export const techRadarPlugin = createPlugin({ * @remarks * * Uses {@link TechRadarPageProps} as props + * + * @public */ export const TechRadarPage = techRadarPlugin.provide( createRoutableExtension({ diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 13c252a991..80ed5d5130 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -233,7 +233,6 @@ const ALLOW_WARNINGS = [ 'plugins/pagerduty', 'plugins/search-backend-module-pg', 'plugins/splunk-on-call', - 'plugins/tech-radar', 'plugins/user-settings', ]; From d467b7e3321a099e36717624f931bf6ceada1143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 12:10:03 +0200 Subject: [PATCH 10/41] user-settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/user-settings/api-report.md | 67 ++------ .../AuthProviders/DefaultProviderSettings.tsx | 143 +++++++++--------- .../AuthProviders/ProviderSettingsItem.tsx | 13 +- .../UserSettingsAuthProviders.tsx | 9 +- .../FeatureFlags/UserSettingsFeatureFlags.tsx | 2 +- .../General/UserSettingsAppearanceCard.tsx | 2 + .../General/UserSettingsGeneral.tsx | 2 + .../General/UserSettingsIdentityCard.tsx | 2 + .../components/General/UserSettingsMenu.tsx | 1 + .../General/UserSettingsPinToggle.tsx | 1 + .../General/UserSettingsProfileCard.tsx | 2 + .../General/UserSettingsSignInAvatar.tsx | 5 +- .../General/UserSettingsThemeToggle.tsx | 1 + .../user-settings/src/components/Settings.tsx | 7 +- .../src/components/UserSettingsTab/index.ts | 1 + plugins/user-settings/src/components/index.ts | 1 + .../src/components/useUserProfileInfo.ts | 1 + plugins/user-settings/src/plugin.ts | 2 + scripts/api-extractor.ts | 1 - 19 files changed, 120 insertions(+), 143 deletions(-) diff --git a/plugins/user-settings/api-report.md b/plugins/user-settings/api-report.md index d6aca3c46f..bc5c3a9c70 100644 --- a/plugins/user-settings/api-report.md +++ b/plugins/user-settings/api-report.md @@ -14,84 +14,56 @@ import { PropsWithChildren } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { SessionApi } from '@backstage/core-plugin-api'; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "DefaultProviderSettings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const DefaultProviderSettings: ({ - configuredProviders, -}: Props_2) => JSX.Element; +export const DefaultProviderSettings: (props: { + configuredProviders: string[]; +}) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "ProviderSettingsItem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const ProviderSettingsItem: ({ - title, - description, - icon: Icon, - apiRef, -}: Props_3) => JSX.Element; +export const ProviderSettingsItem: (props: { + title: string; + description: string; + icon: IconComponent; + apiRef: ApiRef; +}) => JSX.Element; // @public (undocumented) export const Router: (props: { providerSettings?: JSX.Element }) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "SettingsProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const Settings: (props: SettingsProps) => JSX.Element; +export const Settings: (props: { icon?: IconComponent }) => JSX.Element; // @public (undocumented) export const USER_SETTINGS_TAB_KEY = 'user-settings.tab'; -// Warning: (ae-missing-release-tag) "UserSettingsAppearanceCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsAppearanceCard: () => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "UserSettingsAuthProviders" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const UserSettingsAuthProviders: ({ - providerSettings, -}: Props) => JSX.Element; +export const UserSettingsAuthProviders: (props: { + providerSettings?: JSX.Element; +}) => JSX.Element; -// Warning: (ae-missing-release-tag) "UserSettingsFeatureFlags" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsFeatureFlags: () => JSX.Element; -// Warning: (ae-missing-release-tag) "UserSettingsGeneral" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsGeneral: () => JSX.Element; -// Warning: (ae-missing-release-tag) "UserSettingsIdentityCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsIdentityCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "UserSettingsMenu" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsMenu: () => JSX.Element; -// Warning: (ae-missing-release-tag) "UserSettingsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsPage: (props: { providerSettings?: JSX.Element | undefined; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "UserSettingsPinToggle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsPinToggle: () => JSX.Element; -// Warning: (ae-missing-release-tag) "userSettingsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const userSettingsPlugin: BackstagePlugin< { @@ -103,16 +75,13 @@ const userSettingsPlugin: BackstagePlugin< export { userSettingsPlugin as plugin }; export { userSettingsPlugin }; -// Warning: (ae-missing-release-tag) "UserSettingsProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsProfileCard: () => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "UserSettingsSignInAvatar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const UserSettingsSignInAvatar: ({ size }: Props_4) => JSX.Element; +export const UserSettingsSignInAvatar: (props: { + size?: number; +}) => JSX.Element; // @public export const UserSettingsTab: (props: UserSettingsTabProps) => JSX.Element; @@ -123,13 +92,9 @@ export type UserSettingsTabProps = PropsWithChildren<{ title: string; }>; -// Warning: (ae-missing-release-tag) "UserSettingsThemeToggle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const UserSettingsThemeToggle: () => JSX.Element; -// Warning: (ae-missing-release-tag) "useUserProfile" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const useUserProfile: () => | { diff --git a/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx b/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx index 019967cf55..f8e1fb190c 100644 --- a/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx +++ b/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import Star from '@material-ui/icons/Star'; import React from 'react'; import { ProviderSettingsItem } from './ProviderSettingsItem'; @@ -27,75 +28,77 @@ import { oneloginAuthApiRef, } from '@backstage/core-plugin-api'; -type Props = { +/** @public */ +export const DefaultProviderSettings = (props: { configuredProviders: string[]; +}) => { + const { configuredProviders } = props; + return ( + <> + {configuredProviders.includes('google') && ( + + )} + {configuredProviders.includes('microsoft') && ( + + )} + {configuredProviders.includes('github') && ( + + )} + {configuredProviders.includes('gitlab') && ( + + )} + {configuredProviders.includes('okta') && ( + + )} + {configuredProviders.includes('bitbucket') && ( + + )} + {configuredProviders.includes('onelogin') && ( + + )} + {configuredProviders.includes('atlassian') && ( + + )} + + ); }; - -export const DefaultProviderSettings = ({ configuredProviders }: Props) => ( - <> - {configuredProviders.includes('google') && ( - - )} - {configuredProviders.includes('microsoft') && ( - - )} - {configuredProviders.includes('github') && ( - - )} - {configuredProviders.includes('gitlab') && ( - - )} - {configuredProviders.includes('okta') && ( - - )} - {configuredProviders.includes('bitbucket') && ( - - )} - {configuredProviders.includes('onelogin') && ( - - )} - {configuredProviders.includes('atlassian') && ( - - )} - -); diff --git a/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx b/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx index 53fa127e36..e170aa2daa 100644 --- a/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx +++ b/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React, { useEffect, useState } from 'react'; import { Button, @@ -30,19 +31,15 @@ import { SessionState, } from '@backstage/core-plugin-api'; -type Props = { +/** @public */ +export const ProviderSettingsItem = (props: { title: string; description: string; icon: IconComponent; apiRef: ApiRef; -}; +}) => { + const { title, description, icon: Icon, apiRef } = props; -export const ProviderSettingsItem = ({ - title, - description, - icon: Icon, - apiRef, -}: Props) => { const api = useApi(apiRef); const [signedIn, setSignedIn] = useState(false); diff --git a/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx b/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx index 8107944781..d23716c2bf 100644 --- a/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx +++ b/plugins/user-settings/src/components/AuthProviders/UserSettingsAuthProviders.tsx @@ -18,15 +18,14 @@ import React from 'react'; import { List } from '@material-ui/core'; import { EmptyProviders } from './EmptyProviders'; import { DefaultProviderSettings } from './DefaultProviderSettings'; - import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { InfoCard } from '@backstage/core-components'; -type Props = { +/** @public */ +export const UserSettingsAuthProviders = (props: { providerSettings?: JSX.Element; -}; - -export const UserSettingsAuthProviders = ({ providerSettings }: Props) => { +}) => { + const { providerSettings } = props; const configApi = useApi(configApiRef); const providersConfig = configApi.getOptionalConfig('auth.providers'); const configuredProviders = providersConfig?.keys() || []; diff --git a/plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx b/plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx index e8f488de85..21aafc089e 100644 --- a/plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx +++ b/plugins/user-settings/src/components/FeatureFlags/UserSettingsFeatureFlags.tsx @@ -24,7 +24,6 @@ import { } from '@material-ui/core'; import { EmptyFlags } from './EmptyFlags'; import { FlagItem } from './FeatureFlagsItem'; - import { featureFlagsApiRef, FeatureFlagState, @@ -33,6 +32,7 @@ import { import { InfoCard } from '@backstage/core-components'; import ClearIcon from '@material-ui/icons/Clear'; +/** @public */ export const UserSettingsFeatureFlags = () => { const featureFlagsApi = useApi(featureFlagsApiRef); const featureFlags = featureFlagsApi.getRegisteredFlags(); diff --git a/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx b/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx index cd55218db5..6b61edb83b 100644 --- a/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx @@ -13,12 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { InfoCard, useSidebarPinState } from '@backstage/core-components'; import { List } from '@material-ui/core'; import React from 'react'; import { UserSettingsPinToggle } from './UserSettingsPinToggle'; import { UserSettingsThemeToggle } from './UserSettingsThemeToggle'; +/** @public */ export const UserSettingsAppearanceCard = () => { const { isMobile } = useSidebarPinState(); diff --git a/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx b/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx index db7fdd7be6..8dde87ba5c 100644 --- a/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx @@ -13,12 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Grid } from '@material-ui/core'; import React from 'react'; import { UserSettingsProfileCard } from './UserSettingsProfileCard'; import { UserSettingsAppearanceCard } from './UserSettingsAppearanceCard'; import { UserSettingsIdentityCard } from './UserSettingsIdentityCard'; +/** @public */ export const UserSettingsGeneral = () => { return ( diff --git a/plugins/user-settings/src/components/General/UserSettingsIdentityCard.tsx b/plugins/user-settings/src/components/General/UserSettingsIdentityCard.tsx index 908cda1423..1369f4aab8 100644 --- a/plugins/user-settings/src/components/General/UserSettingsIdentityCard.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsIdentityCard.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { InfoCard } from '@backstage/core-components'; import React from 'react'; import { useUserProfile } from '../useUserProfileInfo'; @@ -20,6 +21,7 @@ import Chip from '@material-ui/core/Chip'; import Grid from '@material-ui/core/Grid'; import Typography from '@material-ui/core/Typography'; +/** @public */ export const UserSettingsIdentityCard = () => { const { backstageIdentity } = useUserProfile(); diff --git a/plugins/user-settings/src/components/General/UserSettingsMenu.tsx b/plugins/user-settings/src/components/General/UserSettingsMenu.tsx index c93de9c636..2483f6cd36 100644 --- a/plugins/user-settings/src/components/General/UserSettingsMenu.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsMenu.tsx @@ -20,6 +20,7 @@ import SignOutIcon from '@material-ui/icons/MeetingRoom'; import MoreVertIcon from '@material-ui/icons/MoreVert'; import { identityApiRef, useApi } from '@backstage/core-plugin-api'; +/** @public */ export const UserSettingsMenu = () => { const identityApi = useApi(identityApiRef); const [open, setOpen] = React.useState(false); diff --git a/plugins/user-settings/src/components/General/UserSettingsPinToggle.tsx b/plugins/user-settings/src/components/General/UserSettingsPinToggle.tsx index d218787c05..a06b079e8e 100644 --- a/plugins/user-settings/src/components/General/UserSettingsPinToggle.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsPinToggle.tsx @@ -24,6 +24,7 @@ import { } from '@material-ui/core'; import { useSidebarPinState } from '@backstage/core-components'; +/** @public */ export const UserSettingsPinToggle = () => { const { isPinned, toggleSidebarPinState } = useSidebarPinState(); diff --git a/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx b/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx index 93bb32c5db..3c49121cfc 100644 --- a/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Grid, Typography } from '@material-ui/core'; import React from 'react'; import { UserSettingsSignInAvatar } from './UserSettingsSignInAvatar'; @@ -20,6 +21,7 @@ import { UserSettingsMenu } from './UserSettingsMenu'; import { useUserProfile } from '../useUserProfileInfo'; import { InfoCard } from '@backstage/core-components'; +/** @public */ export const UserSettingsProfileCard = () => { const { profile, displayName } = useUserProfile(); diff --git a/plugins/user-settings/src/components/General/UserSettingsSignInAvatar.tsx b/plugins/user-settings/src/components/General/UserSettingsSignInAvatar.tsx index eced74c29c..af1d2969e6 100644 --- a/plugins/user-settings/src/components/General/UserSettingsSignInAvatar.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsSignInAvatar.tsx @@ -29,9 +29,10 @@ const useStyles = makeStyles(theme => ({ }, })); -type Props = { size?: number }; +/** @public */ +export const UserSettingsSignInAvatar = (props: { size?: number }) => { + const { size } = props; -export const UserSettingsSignInAvatar = ({ size }: Props) => { const { iconSize } = sidebarConfig; const classes = useStyles(size ? { size } : { size: iconSize }); const { profile } = useUserProfile(); diff --git a/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx b/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx index 4a28a72818..156ac210fd 100644 --- a/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx @@ -97,6 +97,7 @@ const TooltipToggleButton = ({ ); +/** @public */ export const UserSettingsThemeToggle = () => { const classes = useStyles(); const appThemeApi = useApi(appThemeApiRef); diff --git a/plugins/user-settings/src/components/Settings.tsx b/plugins/user-settings/src/components/Settings.tsx index e9b3ae7d0a..6735b20f87 100644 --- a/plugins/user-settings/src/components/Settings.tsx +++ b/plugins/user-settings/src/components/Settings.tsx @@ -20,11 +20,8 @@ import { settingsRouteRef } from '../plugin'; import { SidebarItem } from '@backstage/core-components'; import { useRouteRef, IconComponent } from '@backstage/core-plugin-api'; -type SettingsProps = { - icon?: IconComponent; -}; - -export const Settings = (props: SettingsProps) => { +/** @public */ +export const Settings = (props: { icon?: IconComponent }) => { const routePath = useRouteRef(settingsRouteRef); const Icon = props.icon ? props.icon : SettingsIcon; return ; diff --git a/plugins/user-settings/src/components/UserSettingsTab/index.ts b/plugins/user-settings/src/components/UserSettingsTab/index.ts index ec7228b7a6..d0645d4efb 100644 --- a/plugins/user-settings/src/components/UserSettingsTab/index.ts +++ b/plugins/user-settings/src/components/UserSettingsTab/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export * from './UserSettingsTab'; diff --git a/plugins/user-settings/src/components/index.ts b/plugins/user-settings/src/components/index.ts index 90a7105876..8dc76ee7f1 100644 --- a/plugins/user-settings/src/components/index.ts +++ b/plugins/user-settings/src/components/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { Settings } from './Settings'; export { SettingsPage as Router } from './SettingsPage'; export * from './AuthProviders'; diff --git a/plugins/user-settings/src/components/useUserProfileInfo.ts b/plugins/user-settings/src/components/useUserProfileInfo.ts index c168fc12b4..8b2a41a55f 100644 --- a/plugins/user-settings/src/components/useUserProfileInfo.ts +++ b/plugins/user-settings/src/components/useUserProfileInfo.ts @@ -23,6 +23,7 @@ import { import { useEffect } from 'react'; import useAsync from 'react-use/lib/useAsync'; +/** @public */ export const useUserProfile = () => { const identityApi = useApi(identityApiRef); const alertApi = useApi(alertApiRef); diff --git a/plugins/user-settings/src/plugin.ts b/plugins/user-settings/src/plugin.ts index 01793dc418..4b538b7296 100644 --- a/plugins/user-settings/src/plugin.ts +++ b/plugins/user-settings/src/plugin.ts @@ -24,6 +24,7 @@ export const settingsRouteRef = createRouteRef({ id: 'user-settings', }); +/** @public */ export const userSettingsPlugin = createPlugin({ id: 'user-settings', routes: { @@ -31,6 +32,7 @@ export const userSettingsPlugin = createPlugin({ }, }); +/** @public */ export const UserSettingsPage = userSettingsPlugin.provide( createRoutableExtension({ name: 'UserSettingsPage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 80ed5d5130..aa24fb2e06 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -233,7 +233,6 @@ const ALLOW_WARNINGS = [ 'plugins/pagerduty', 'plugins/search-backend-module-pg', 'plugins/splunk-on-call', - 'plugins/user-settings', ]; async function resolvePackagePath( From 680b8baebd8323e59edea56519face6fac7ba8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 12:13:09 +0200 Subject: [PATCH 11/41] gcalendar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/gcalendar/api-report.md | 21 +-------------------- plugins/gcalendar/src/api/client.ts | 11 ++++------- plugins/gcalendar/src/api/index.ts | 1 + plugins/gcalendar/src/api/types.ts | 5 +++++ plugins/gcalendar/src/index.ts | 1 + plugins/gcalendar/src/plugin.ts | 4 +++- scripts/api-extractor.ts | 1 - 7 files changed, 15 insertions(+), 29 deletions(-) diff --git a/plugins/gcalendar/api-report.md b/plugins/gcalendar/api-report.md index 61c39aaf2a..8c86e4d2c9 100644 --- a/plugins/gcalendar/api-report.md +++ b/plugins/gcalendar/api-report.md @@ -12,22 +12,15 @@ import { FetchApi } from '@backstage/core-plugin-api'; import { OAuthApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "EventAttendee" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type EventAttendee = gapi.client.calendar.EventAttendee; -// Warning: (ae-missing-release-tag) "GCalendar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GCalendar = gapi.client.calendar.CalendarListEntry; -// Warning: (ae-missing-release-tag) "GCalendarApiClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class GCalendarApiClient { - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - constructor(options: Options); + constructor(options: { authApi: OAuthApi; fetchApi: FetchApi }); // (undocumented) getCalendars(params?: any): Promise; // (undocumented) @@ -39,13 +32,9 @@ export class GCalendarApiClient { }>; } -// Warning: (ae-missing-release-tag) "gcalendarApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const gcalendarApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "GCalendarEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GCalendarEvent = gapi.client.calendar.Event & Pick & @@ -53,13 +42,9 @@ export type GCalendarEvent = gapi.client.calendar.Event & calendarId?: string; }; -// Warning: (ae-missing-release-tag) "GCalendarList" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GCalendarList = gapi.client.calendar.CalendarList; -// Warning: (ae-missing-release-tag) "gcalendarPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const gcalendarPlugin: BackstagePlugin< { @@ -69,13 +54,9 @@ export const gcalendarPlugin: BackstagePlugin< {} >; -// Warning: (ae-missing-release-tag) "HomePageCalendar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const HomePageCalendar: () => JSX.Element; -// Warning: (ae-missing-release-tag) "ResponseStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum ResponseStatus { // (undocumented) diff --git a/plugins/gcalendar/src/api/client.ts b/plugins/gcalendar/src/api/client.ts index 084c302636..0f5b56cc08 100644 --- a/plugins/gcalendar/src/api/client.ts +++ b/plugins/gcalendar/src/api/client.ts @@ -13,25 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { OAuthApi, createApiRef, FetchApi } from '@backstage/core-plugin-api'; +import { OAuthApi, createApiRef, FetchApi } from '@backstage/core-plugin-api'; import { GCalendarEvent, GCalendarList } from './types'; import { ResponseError } from '@backstage/errors'; -type Options = { - authApi: OAuthApi; - fetchApi: FetchApi; -}; - +/** @public */ export const gcalendarApiRef = createApiRef({ id: 'plugin.gcalendar.service', }); +/** @public */ export class GCalendarApiClient { private readonly authApi: OAuthApi; private readonly fetchApi: FetchApi; - constructor(options: Options) { + constructor(options: { authApi: OAuthApi; fetchApi: FetchApi }) { this.authApi = options.authApi; this.fetchApi = options.fetchApi; } diff --git a/plugins/gcalendar/src/api/index.ts b/plugins/gcalendar/src/api/index.ts index 4c195158d3..09cc21a2d0 100644 --- a/plugins/gcalendar/src/api/index.ts +++ b/plugins/gcalendar/src/api/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export * from './client'; export * from './types'; diff --git a/plugins/gcalendar/src/api/types.ts b/plugins/gcalendar/src/api/types.ts index 5c8bbdd1c1..9b1b508762 100644 --- a/plugins/gcalendar/src/api/types.ts +++ b/plugins/gcalendar/src/api/types.ts @@ -16,18 +16,23 @@ /// +/** @public */ export type GCalendarList = gapi.client.calendar.CalendarList; +/** @public */ export type GCalendar = gapi.client.calendar.CalendarListEntry; +/** @public */ export type EventAttendee = gapi.client.calendar.EventAttendee; +/** @public */ export type GCalendarEvent = gapi.client.calendar.Event & Pick & Pick & { calendarId?: string; }; +/** @public */ export enum ResponseStatus { needsAction = 'needsAction', accepted = 'accepted', diff --git a/plugins/gcalendar/src/index.ts b/plugins/gcalendar/src/index.ts index 7c7f0c6374..37d51d0ef4 100644 --- a/plugins/gcalendar/src/index.ts +++ b/plugins/gcalendar/src/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { gcalendarPlugin, HomePageCalendar } from './plugin'; export * from './api'; diff --git a/plugins/gcalendar/src/plugin.ts b/plugins/gcalendar/src/plugin.ts index 1f98f560f1..06c3922087 100644 --- a/plugins/gcalendar/src/plugin.ts +++ b/plugins/gcalendar/src/plugin.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { createApiFactory, createComponentExtension, @@ -20,10 +21,10 @@ import { fetchApiRef, googleAuthApiRef, } from '@backstage/core-plugin-api'; - import { GCalendarApiClient, gcalendarApiRef } from './api'; import { rootRouteRef } from './routes'; +/** @public */ export const gcalendarPlugin = createPlugin({ id: 'gcalendar', routes: { @@ -40,6 +41,7 @@ export const gcalendarPlugin = createPlugin({ ], }); +/** @public */ export const HomePageCalendar = gcalendarPlugin.provide( createComponentExtension({ name: 'HomePageCalendar', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index aa24fb2e06..98398ca5d9 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -215,7 +215,6 @@ const ALLOW_WARNINGS = [ 'plugins/explore', 'plugins/explore-react', 'plugins/firehydrant', - 'plugins/gcalendar', 'plugins/gcp-projects', 'plugins/git-release-manager', 'plugins/github-actions', From 3ec16d2c4187dc9e3a1e4bbb94a75d80ad98c612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 12:25:57 +0200 Subject: [PATCH 12/41] splunk-on-call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/splunk-on-call/api-report.md | 246 +++++++++++++++--- plugins/splunk-on-call/src/api/client.ts | 3 + plugins/splunk-on-call/src/api/index.ts | 2 +- plugins/splunk-on-call/src/api/types.ts | 10 + .../src/components/EntitySplunkOnCallCard.tsx | 1 + .../src/components/SplunkOnCallPage.tsx | 1 + .../splunk-on-call/src/components/index.ts | 20 ++ .../splunk-on-call/src/components/types.ts | 16 ++ plugins/splunk-on-call/src/index.ts | 8 +- plugins/splunk-on-call/src/plugin.ts | 3 + scripts/api-extractor.ts | 1 - 11 files changed, 269 insertions(+), 42 deletions(-) create mode 100644 plugins/splunk-on-call/src/components/index.ts diff --git a/plugins/splunk-on-call/api-report.md b/plugins/splunk-on-call/api-report.md index b24a68e07a..e0609c5b82 100644 --- a/plugins/splunk-on-call/api-report.md +++ b/plugins/splunk-on-call/api-report.md @@ -12,62 +12,207 @@ import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-forgotten-export) The symbol "EntitySplunkOnCallCardProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "EntitySplunkOnCallCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type ClientApiConfig = { + eventsRestEndpoint: string | null; + discoveryApi: DiscoveryApi; +}; + // @public (undocumented) export const EntitySplunkOnCallCard: ( props: EntitySplunkOnCallCardProps, ) => JSX.Element; -// Warning: (ae-missing-release-tag) "isSplunkOnCallAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type EntitySplunkOnCallCardProps = { + readOnly?: boolean; +}; + +// @public (undocumented) +export type EscalationPolicyInfo = { + policy: EscalationPolicySummary; + team?: EscalationPolicyTeam; +}; + +// @public (undocumented) +export type EscalationPolicyResponse = { + policies: EscalationPolicyInfo[]; +}; + +// @public (undocumented) +export type EscalationPolicySummary = { + name: string; + slug: string; + _selfUrl: string; +}; + +// @public (undocumented) +export type EscalationPolicyTeam = { + name: string; + slug: string; +}; + +// @public (undocumented) +export type Incident = { + incidentNumber?: string; + startTime?: string; + currentPhase: IncidentPhase; + entityState?: string; + entityType?: string; + routingKey?: string; + alertCount?: number; + lastAlertTime?: string; + lastAlertId?: string; + entityId: string; + host?: string; + service?: string; + pagedUsers?: string[]; + pagedTeams?: string[]; + entityDisplayName?: string; + pagedPolicies?: EscalationPolicyInfo[]; + transitions?: IncidentTransition[]; + firstAlertUuid?: string; + monitorName?: string; + monitorType?: string; + incidentLink?: string; +}; + +// @public (undocumented) +export type IncidentPhase = 'UNACKED' | 'ACKED' | 'RESOLVED'; + +// @public (undocumented) +export type IncidentsResponse = { + incidents: Incident[]; +}; + +// @public (undocumented) +export type IncidentTransition = { + name?: string; + at?: string; + by?: string; + message?: string; + manually?: boolean; + alertId?: string; + alertUrl?: string; +}; + // @public (undocumented) export const isSplunkOnCallAvailable: (entity: Entity) => boolean; -// Warning: (ae-forgotten-export) The symbol "SplunkOnCallApi" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "splunkOnCallApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type ListRoutingKeyResponse = { + routingKeys: RoutingKey[]; + _selfUrl?: string; +}; + +// @public (undocumented) +export type ListUserResponse = { + users: User[]; + _selfUrl?: string; +}; + +// @public (undocumented) +export type MessageType = + | 'CRITICAL' + | 'WARNING' + | 'ACKNOWLEDGEMENT' + | 'INFO' + | 'RECOVERY'; + +// @public (undocumented) +export type OnCall = { + team?: OnCallTeamResource; + oncallNow?: OnCallNowResource[]; +}; + +// @public (undocumented) +export type OnCallEscalationPolicyResource = { + name?: string; + slug?: string; +}; + +// @public (undocumented) +export type OnCallNowResource = { + escalationPolicy?: OnCallEscalationPolicyResource; + users?: OnCallUsersResource[]; +}; + +// @public (undocumented) +export type OnCallsResponse = { + teamsOnCall: OnCall[]; +}; + +// @public (undocumented) +export type OnCallTeamResource = { + name?: string; + slug?: string; +}; + +// @public (undocumented) +export type OnCallUser = { + username?: string; +}; + +// @public (undocumented) +export type OnCallUsersResource = { + onCalluser?: OnCallUser; +}; + +// @public (undocumented) +export type RequestOptions = { + method: string; + headers: HeadersInit; + body?: BodyInit; +}; + +// @public (undocumented) +export type RoutingKey = { + routingKey: string; + targets: RoutingKeyTarget[]; + isDefault: boolean; +}; + +// @public (undocumented) +export type RoutingKeyTarget = { + policyName: string; + policySlug: string; + _teamUrl: string; +}; + +// @public (undocumented) +export interface SplunkOnCallApi { + getEscalationPolicies(): Promise; + getIncidents(): Promise; + getOnCallUsers(): Promise; + getRoutingKeys(): Promise; + getTeams(): Promise; + getUsers(): Promise; + incidentAction(request: TriggerAlarmRequest): Promise; +} + // @public (undocumented) export const splunkOnCallApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "SplunkOnCallClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class SplunkOnCallClient implements SplunkOnCallApi { - // Warning: (ae-forgotten-export) The symbol "ClientApiConfig" needs to be exported by the entry point index.d.ts constructor(config: ClientApiConfig); // (undocumented) static fromConfig( configApi: ConfigApi, discoveryApi: DiscoveryApi, ): SplunkOnCallClient; - // Warning: (ae-forgotten-export) The symbol "EscalationPolicyInfo" needs to be exported by the entry point index.d.ts - // // (undocumented) getEscalationPolicies(): Promise; - // Warning: (ae-forgotten-export) The symbol "Incident" needs to be exported by the entry point index.d.ts - // // (undocumented) getIncidents(): Promise; - // Warning: (ae-forgotten-export) The symbol "OnCall" needs to be exported by the entry point index.d.ts - // // (undocumented) getOnCallUsers(): Promise; - // Warning: (ae-forgotten-export) The symbol "RoutingKey" needs to be exported by the entry point index.d.ts - // // (undocumented) getRoutingKeys(): Promise; - // Warning: (ae-forgotten-export) The symbol "Team" needs to be exported by the entry point index.d.ts - // // (undocumented) getTeams(): Promise; - // Warning: (ae-forgotten-export) The symbol "User" needs to be exported by the entry point index.d.ts - // // (undocumented) getUsers(): Promise; - // Warning: (ae-forgotten-export) The symbol "TriggerAlarmRequest" needs to be exported by the entry point index.d.ts - // // (undocumented) incidentAction({ routingKey, @@ -79,8 +224,6 @@ export class SplunkOnCallClient implements SplunkOnCallApi { }: TriggerAlarmRequest): Promise; } -// Warning: (ae-missing-release-tag) "SplunkOnCallPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const SplunkOnCallPage: { ({ title, subtitle, pageTitle }: SplunkOnCallPageProps): JSX.Element; @@ -91,8 +234,13 @@ export const SplunkOnCallPage: { }; }; -// Warning: (ae-missing-release-tag) "splunkOnCallPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type SplunkOnCallPageProps = { + title?: string; + subtitle?: string; + pageTitle?: string; +}; + // @public (undocumented) const splunkOnCallPlugin: BackstagePlugin< { @@ -104,12 +252,42 @@ const splunkOnCallPlugin: BackstagePlugin< export { splunkOnCallPlugin as plugin }; export { splunkOnCallPlugin }; -// Warning: (ae-missing-release-tag) "UnauthorizedError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type Team = { + name?: string; + slug?: string; + memberCount?: number; + version?: number; + isDefaultTeam?: boolean; + _selfUrl?: string; + _policiesUrl?: string; + _membersUrl?: string; + _adminsUrl?: string; +}; + +// @public (undocumented) +export type TriggerAlarmRequest = { + routingKey?: string; + incidentType: MessageType; + incidentId?: string; + incidentDisplayName?: string; + incidentMessage?: string; + incidentStartTime?: number; +}; + // @public (undocumented) export class UnauthorizedError extends Error {} -// Warnings were encountered during analysis: -// -// src/plugin.d.ts:7:5 - (ae-forgotten-export) The symbol "SplunkOnCallPageProps" needs to be exported by the entry point index.d.ts +// @public (undocumented) +export type User = { + firstName?: string; + lastName?: string; + displayName?: string; + username?: string; + email?: string; + createdAt?: string; + passwordLastUpdated?: string; + verified?: boolean; + _selfUrl?: string; +}; ``` diff --git a/plugins/splunk-on-call/src/api/client.ts b/plugins/splunk-on-call/src/api/client.ts index 6c0ff9bdc4..aa655a4772 100644 --- a/plugins/splunk-on-call/src/api/client.ts +++ b/plugins/splunk-on-call/src/api/client.ts @@ -39,12 +39,15 @@ import { ConfigApi, } from '@backstage/core-plugin-api'; +/** @public */ export class UnauthorizedError extends Error {} +/** @public */ export const splunkOnCallApiRef = createApiRef({ id: 'plugin.splunk-on-call.api', }); +/** @public */ export class SplunkOnCallClient implements SplunkOnCallApi { static fromConfig(configApi: ConfigApi, discoveryApi: DiscoveryApi) { const eventsRestEndpoint: string | null = diff --git a/plugins/splunk-on-call/src/api/index.ts b/plugins/splunk-on-call/src/api/index.ts index 8b38168fc9..ecfb7acca7 100644 --- a/plugins/splunk-on-call/src/api/index.ts +++ b/plugins/splunk-on-call/src/api/index.ts @@ -19,4 +19,4 @@ export { splunkOnCallApiRef, UnauthorizedError, } from './client'; -export type { SplunkOnCallApi } from './types'; +export * from './types'; diff --git a/plugins/splunk-on-call/src/api/types.ts b/plugins/splunk-on-call/src/api/types.ts index 6a414d18bd..427eb8bbca 100644 --- a/plugins/splunk-on-call/src/api/types.ts +++ b/plugins/splunk-on-call/src/api/types.ts @@ -24,6 +24,7 @@ import { } from '../components/types'; import { DiscoveryApi } from '@backstage/core-plugin-api'; +/** @public */ export type MessageType = | 'CRITICAL' | 'WARNING' @@ -31,6 +32,7 @@ export type MessageType = | 'INFO' | 'RECOVERY'; +/** @public */ export type TriggerAlarmRequest = { routingKey?: string; incidentType: MessageType; @@ -40,6 +42,7 @@ export type TriggerAlarmRequest = { incidentStartTime?: number; }; +/** @public */ export interface SplunkOnCallApi { /** * Fetches a list of incidents @@ -77,33 +80,40 @@ export interface SplunkOnCallApi { getEscalationPolicies(): Promise; } +/** @public */ export type EscalationPolicyResponse = { policies: EscalationPolicyInfo[]; }; +/** @public */ export type ListUserResponse = { users: User[]; _selfUrl?: string; }; +/** @public */ export type ListRoutingKeyResponse = { routingKeys: RoutingKey[]; _selfUrl?: string; }; +/** @public */ export type IncidentsResponse = { incidents: Incident[]; }; +/** @public */ export type OnCallsResponse = { teamsOnCall: OnCall[]; }; +/** @public */ export type ClientApiConfig = { eventsRestEndpoint: string | null; discoveryApi: DiscoveryApi; }; +/** @public */ export type RequestOptions = { method: string; headers: HeadersInit; diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 4f6bcd9a0e..d635f7328f 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -99,6 +99,7 @@ export const MissingEventsRestEndpoint = () => ( ); +/** @public */ export const isSplunkOnCallAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_TEAM]) || Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_ROUTING_KEY]); diff --git a/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx b/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx index 1f5bb49410..0c8b223857 100644 --- a/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx +++ b/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx @@ -31,6 +31,7 @@ const useStyles = makeStyles(() => ({ }, })); +/** @public */ export type SplunkOnCallPageProps = { title?: string; subtitle?: string; diff --git a/plugins/splunk-on-call/src/components/index.ts b/plugins/splunk-on-call/src/components/index.ts new file mode 100644 index 0000000000..47fd7fbf27 --- /dev/null +++ b/plugins/splunk-on-call/src/components/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type { SplunkOnCallPageProps } from './SplunkOnCallPage'; +export type { EntitySplunkOnCallCardProps } from './EntitySplunkOnCallCard'; +export { isSplunkOnCallAvailable } from './EntitySplunkOnCallCard'; +export * from './types'; diff --git a/plugins/splunk-on-call/src/components/types.ts b/plugins/splunk-on-call/src/components/types.ts index 0feefe8b03..7e83de84a7 100644 --- a/plugins/splunk-on-call/src/components/types.ts +++ b/plugins/splunk-on-call/src/components/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export type Team = { name?: string; slug?: string; @@ -26,34 +27,41 @@ export type Team = { _adminsUrl?: string; }; +/** @public */ export type OnCall = { team?: OnCallTeamResource; oncallNow?: OnCallNowResource[]; }; +/** @public */ export type OnCallTeamResource = { name?: string; slug?: string; }; +/** @public */ export type OnCallNowResource = { escalationPolicy?: OnCallEscalationPolicyResource; users?: OnCallUsersResource[]; }; +/** @public */ export type OnCallEscalationPolicyResource = { name?: string; slug?: string; }; +/** @public */ export type OnCallUsersResource = { onCalluser?: OnCallUser; }; +/** @public */ export type OnCallUser = { username?: string; }; +/** @public */ export type User = { firstName?: string; lastName?: string; @@ -66,8 +74,10 @@ export type User = { _selfUrl?: string; }; +/** @public */ export type IncidentPhase = 'UNACKED' | 'ACKED' | 'RESOLVED'; +/** @public */ export type Incident = { incidentNumber?: string; startTime?: string; @@ -92,11 +102,13 @@ export type Incident = { incidentLink?: string; }; +/** @public */ export type EscalationPolicyInfo = { policy: EscalationPolicySummary; team?: EscalationPolicyTeam; }; +/** @public */ export type IncidentTransition = { name?: string; at?: string; @@ -107,23 +119,27 @@ export type IncidentTransition = { alertUrl?: string; }; +/** @public */ export type EscalationPolicySummary = { name: string; slug: string; _selfUrl: string; }; +/** @public */ export type EscalationPolicyTeam = { name: string; slug: string; }; +/** @public */ export type RoutingKey = { routingKey: string; targets: RoutingKeyTarget[]; isDefault: boolean; }; +/** @public */ export type RoutingKeyTarget = { policyName: string; policySlug: string; diff --git a/plugins/splunk-on-call/src/index.ts b/plugins/splunk-on-call/src/index.ts index 917106504b..285e6c8f89 100644 --- a/plugins/splunk-on-call/src/index.ts +++ b/plugins/splunk-on-call/src/index.ts @@ -26,9 +26,5 @@ export { splunkOnCallPlugin as plugin, SplunkOnCallPage, } from './plugin'; -export { isSplunkOnCallAvailable } from './components/EntitySplunkOnCallCard'; -export { - SplunkOnCallClient, - splunkOnCallApiRef, - UnauthorizedError, -} from './api/client'; +export * from './components'; +export * from './api'; diff --git a/plugins/splunk-on-call/src/plugin.ts b/plugins/splunk-on-call/src/plugin.ts index 2256b382ee..f1fa08bfcc 100644 --- a/plugins/splunk-on-call/src/plugin.ts +++ b/plugins/splunk-on-call/src/plugin.ts @@ -26,6 +26,7 @@ import { export const rootRouteRef = createRouteRef({ id: 'splunk-on-call' }); +/** @public */ export const splunkOnCallPlugin = createPlugin({ id: 'splunk-on-call', apis: [ @@ -41,6 +42,7 @@ export const splunkOnCallPlugin = createPlugin({ }, }); +/** @public */ export const SplunkOnCallPage = splunkOnCallPlugin.provide( createRoutableExtension({ name: 'SplunkOnCallPage', @@ -50,6 +52,7 @@ export const SplunkOnCallPage = splunkOnCallPlugin.provide( }), ); +/** @public */ export const EntitySplunkOnCallCard = splunkOnCallPlugin.provide( createComponentExtension({ name: 'EntitySplunkOnCallCard', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 98398ca5d9..4713d85487 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -231,7 +231,6 @@ const ALLOW_WARNINGS = [ 'plugins/newrelic-dashboard', 'plugins/pagerduty', 'plugins/search-backend-module-pg', - 'plugins/splunk-on-call', ]; async function resolvePackagePath( From 6a001acf8c69b645e398631874cde8a2f053db6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 12:31:26 +0200 Subject: [PATCH 13/41] plugin-search-backend-module-pg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../search-backend-module-pg/api-report.md | 26 +++++++------------ .../src/PgSearchEngine/PgSearchEngine.ts | 2 ++ .../PgSearchEngine/PgSearchEngineIndexer.ts | 2 ++ .../src/PgSearchEngine/index.ts | 1 + .../src/database/DatabaseDocumentStore.ts | 1 + .../src/database/index.ts | 8 +++++- .../src/database/types.ts | 4 +++ scripts/api-extractor.ts | 1 - 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/plugins/search-backend-module-pg/api-report.md b/plugins/search-backend-module-pg/api-report.md index 33d0f4318c..d35bac66aa 100644 --- a/plugins/search-backend-module-pg/api-report.md +++ b/plugins/search-backend-module-pg/api-report.md @@ -18,8 +18,6 @@ export type ConcretePgSearchQuery = { pageSize: number; }; -// Warning: (ae-missing-release-tag) "DatabaseDocumentStore" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class DatabaseDocumentStore implements DatabaseStore { constructor(db: Knex); @@ -39,8 +37,6 @@ export class DatabaseDocumentStore implements DatabaseStore { ): Promise; // (undocumented) prepareInsert(tx: Knex.Transaction): Promise; - // Warning: (ae-forgotten-export) The symbol "DocumentResultRow" needs to be exported by the entry point index.d.ts - // // (undocumented) query( tx: Knex.Transaction, @@ -52,8 +48,6 @@ export class DatabaseDocumentStore implements DatabaseStore { transaction(fn: (tx: Knex.Transaction) => Promise): Promise; } -// Warning: (ae-missing-release-tag) "DatabaseStore" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface DatabaseStore { // (undocumented) @@ -77,8 +71,16 @@ export interface DatabaseStore { transaction(fn: (tx: Knex.Transaction) => Promise): Promise; } -// Warning: (ae-missing-release-tag) "PgSearchEngine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export interface DocumentResultRow { + // (undocumented) + document: IndexableDocument; + // (undocumented) + highlight: IndexableDocument; + // (undocumented) + type: string; +} + // @public (undocumented) export class PgSearchEngine implements SearchEngine { // @deprecated @@ -108,8 +110,6 @@ export class PgSearchEngine implements SearchEngine { ): ConcretePgSearchQuery; } -// Warning: (ae-missing-release-tag) "PgSearchEngineIndexer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class PgSearchEngineIndexer extends BatchSearchEngineIndexer { constructor(options: PgSearchEngineIndexerOptions); @@ -121,8 +121,6 @@ export class PgSearchEngineIndexer extends BatchSearchEngineIndexer { initialize(): Promise; } -// Warning: (ae-missing-release-tag) "PgSearchEngineIndexerOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PgSearchEngineIndexerOptions = { batchSize: number; @@ -148,8 +146,6 @@ export type PgSearchOptions = { database: PluginDatabaseManager; }; -// Warning: (ae-missing-release-tag) "PgSearchQuery" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface PgSearchQuery { // (undocumented) @@ -177,8 +173,6 @@ export type PgSearchQueryTranslatorOptions = { highlightOptions: PgSearchHighlightOptions; }; -// Warning: (ae-missing-release-tag) "RawDocumentRow" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface RawDocumentRow { // (undocumented) diff --git a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts index cd99a8c4b1..01fe0fff82 100644 --- a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts +++ b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { PluginDatabaseManager } from '@backstage/backend-common'; import { SearchEngine } from '@backstage/plugin-search-common'; import { @@ -79,6 +80,7 @@ export type PgSearchHighlightOptions = { postTag: string; }; +/** @public */ export class PgSearchEngine implements SearchEngine { private readonly highlightOptions: PgSearchHighlightOptions; diff --git a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts index fa27509a69..e3dbe82751 100644 --- a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts +++ b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts @@ -19,12 +19,14 @@ import { IndexableDocument } from '@backstage/plugin-search-common'; import { Knex } from 'knex'; import { DatabaseStore } from '../database'; +/** @public */ export type PgSearchEngineIndexerOptions = { batchSize: number; type: string; databaseStore: DatabaseStore; }; +/** @public */ export class PgSearchEngineIndexer extends BatchSearchEngineIndexer { private store: DatabaseStore; private type: string; diff --git a/plugins/search-backend-module-pg/src/PgSearchEngine/index.ts b/plugins/search-backend-module-pg/src/PgSearchEngine/index.ts index e9ea04e5c4..e62e709f26 100644 --- a/plugins/search-backend-module-pg/src/PgSearchEngine/index.ts +++ b/plugins/search-backend-module-pg/src/PgSearchEngine/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { PgSearchEngine } from './PgSearchEngine'; export type { ConcretePgSearchQuery, diff --git a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts index 4da3cca082..023992a335 100644 --- a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts +++ b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts @@ -32,6 +32,7 @@ const migrationsDir = resolvePackagePath( 'migrations', ); +/** @public */ export class DatabaseDocumentStore implements DatabaseStore { static async create( database: PluginDatabaseManager, diff --git a/plugins/search-backend-module-pg/src/database/index.ts b/plugins/search-backend-module-pg/src/database/index.ts index d2ca3ba3da..69441d56ec 100644 --- a/plugins/search-backend-module-pg/src/database/index.ts +++ b/plugins/search-backend-module-pg/src/database/index.ts @@ -13,5 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { DatabaseDocumentStore } from './DatabaseDocumentStore'; -export type { DatabaseStore, PgSearchQuery, RawDocumentRow } from './types'; +export type { + DatabaseStore, + DocumentResultRow, + PgSearchQuery, + RawDocumentRow, +} from './types'; diff --git a/plugins/search-backend-module-pg/src/database/types.ts b/plugins/search-backend-module-pg/src/database/types.ts index 151be7d13f..f330651cef 100644 --- a/plugins/search-backend-module-pg/src/database/types.ts +++ b/plugins/search-backend-module-pg/src/database/types.ts @@ -17,6 +17,7 @@ import { IndexableDocument } from '@backstage/plugin-search-common'; import { Knex } from 'knex'; import { PgSearchHighlightOptions } from '../PgSearchEngine'; +/** @public */ export interface PgSearchQuery { fields?: Record; types?: string[]; @@ -26,6 +27,7 @@ export interface PgSearchQuery { options: PgSearchHighlightOptions; } +/** @public */ export interface DatabaseStore { transaction(fn: (tx: Knex.Transaction) => Promise): Promise; getTransaction(): Promise; @@ -42,12 +44,14 @@ export interface DatabaseStore { ): Promise; } +/** @public */ export interface RawDocumentRow { document: IndexableDocument; type: string; hash: unknown; } +/** @public */ export interface DocumentResultRow { document: IndexableDocument; type: string; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 4713d85487..fd1254b07d 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -230,7 +230,6 @@ const ALLOW_WARNINGS = [ 'plugins/newrelic', 'plugins/newrelic-dashboard', 'plugins/pagerduty', - 'plugins/search-backend-module-pg', ]; async function resolvePackagePath( From 9a5a1681c10ab83020e6eaaf9b7c6d9fd7ca083f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:10:51 +0200 Subject: [PATCH 14/41] pagerduty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/pagerduty/api-report.md | 61 +++++-------------- plugins/pagerduty/src/api/client.ts | 3 + plugins/pagerduty/src/api/index.ts | 1 + plugins/pagerduty/src/api/types.ts | 8 +++ .../src/components/PagerDutyCard/index.tsx | 2 + .../src/components/TriggerButton/index.tsx | 7 +-- plugins/pagerduty/src/components/types.ts | 7 +++ plugins/pagerduty/src/plugin.ts | 2 + plugins/pagerduty/src/types.ts | 1 + scripts/api-extractor.ts | 1 - 10 files changed, 40 insertions(+), 53 deletions(-) diff --git a/plugins/pagerduty/api-report.md b/plugins/pagerduty/api-report.md index 8bd8df6f7c..5bfe84e63f 100644 --- a/plugins/pagerduty/api-report.md +++ b/plugins/pagerduty/api-report.md @@ -13,26 +13,30 @@ import { Entity } from '@backstage/catalog-model'; import { FetchApi } from '@backstage/core-plugin-api'; import { ReactNode } from 'react'; -// Warning: (ae-missing-release-tag) "EntityPagerDutyCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityPagerDutyCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "isPluginApplicableToEntity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; export { isPluginApplicableToEntity as isPagerDutyAvailable }; export { isPluginApplicableToEntity }; -// Warning: (ae-forgotten-export) The symbol "PagerDutyApi" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "pagerDutyApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export interface PagerDutyApi { + getChangeEventsByServiceId( + serviceId: string, + ): Promise; + getIncidentsByServiceId( + serviceId: string, + ): Promise; + getOnCallByPolicyId(policyId: string): Promise; + getServiceByEntity(entity: Entity): Promise; + triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise; +} + // @public (undocumented) export const pagerDutyApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "PagerDutyAssignee" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyAssignee = { id: string; @@ -40,13 +44,9 @@ export type PagerDutyAssignee = { html_url: string; }; -// Warning: (ae-missing-release-tag) "PagerDutyCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const PagerDutyCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "PagerDutyChangeEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyChangeEvent = { id: string; @@ -67,15 +67,11 @@ export type PagerDutyChangeEvent = { timestamp: string; }; -// Warning: (ae-missing-release-tag) "PagerDutyChangeEventsResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyChangeEventsResponse = { change_events: PagerDutyChangeEvent[]; }; -// Warning: (ae-missing-release-tag) "PagerDutyClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class PagerDutyClient implements PagerDutyApi { constructor(config: PagerDutyClientApiConfig); @@ -100,23 +96,17 @@ export class PagerDutyClient implements PagerDutyApi { triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise; } -// Warning: (ae-missing-release-tag) "PagerDutyClientApiConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyClientApiConfig = PagerDutyClientApiDependencies & { eventsBaseUrl?: string; }; -// Warning: (ae-missing-release-tag) "PagerDutyClientApiDependencies" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyClientApiDependencies = { discoveryApi: DiscoveryApi; fetchApi: FetchApi; }; -// Warning: (ae-missing-release-tag) "PagerDutyEntity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyEntity = { integrationKey?: string; @@ -124,8 +114,6 @@ export type PagerDutyEntity = { name: string; }; -// Warning: (ae-missing-release-tag) "PagerDutyIncident" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyIncident = { id: string; @@ -141,37 +129,27 @@ export type PagerDutyIncident = { created_at: string; }; -// Warning: (ae-missing-release-tag) "PagerDutyIncidentsResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyIncidentsResponse = { incidents: PagerDutyIncident[]; }; -// Warning: (ae-missing-release-tag) "PagerDutyOnCall" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyOnCall = { user: PagerDutyUser; escalation_level: number; }; -// Warning: (ae-missing-release-tag) "PagerDutyOnCallsResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyOnCallsResponse = { oncalls: PagerDutyOnCall[]; }; -// Warning: (ae-missing-release-tag) "pagerDutyPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const pagerDutyPlugin: BackstagePlugin<{}, {}, {}>; export { pagerDutyPlugin }; export { pagerDutyPlugin as plugin }; -// Warning: (ae-missing-release-tag) "PagerDutyService" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyService = { id: string; @@ -185,15 +163,11 @@ export type PagerDutyService = { }; }; -// Warning: (ae-missing-release-tag) "PagerDutyServiceResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyServiceResponse = { service: PagerDutyService; }; -// Warning: (ae-missing-release-tag) "PagerDutyTriggerAlarmRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyTriggerAlarmRequest = { integrationKey: string; @@ -202,8 +176,6 @@ export type PagerDutyTriggerAlarmRequest = { userName: string; }; -// Warning: (ae-missing-release-tag) "PagerDutyUser" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type PagerDutyUser = { id: string; @@ -213,14 +185,9 @@ export type PagerDutyUser = { name: string; }; -// Warning: (ae-forgotten-export) The symbol "TriggerButtonProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "TriggerButton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export function TriggerButton(props: TriggerButtonProps): JSX.Element; +export function TriggerButton(props: { children?: ReactNode }): JSX.Element; -// Warning: (ae-missing-release-tag) "UnauthorizedError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class UnauthorizedError extends Error {} ``` diff --git a/plugins/pagerduty/src/api/client.ts b/plugins/pagerduty/src/api/client.ts index edc87d4b4a..7266d5e9eb 100644 --- a/plugins/pagerduty/src/api/client.ts +++ b/plugins/pagerduty/src/api/client.ts @@ -31,8 +31,10 @@ import { NotFoundError } from '@backstage/errors'; import { Entity } from '@backstage/catalog-model'; import { getPagerDutyEntity } from '../components/pagerDutyEntity'; +/** @public */ export class UnauthorizedError extends Error {} +/** @public */ export const pagerDutyApiRef = createApiRef({ id: 'plugin.pagerduty.api', }); @@ -40,6 +42,7 @@ export const pagerDutyApiRef = createApiRef({ const commonGetServiceParams = 'time_zone=UTC&include[]=integrations&include[]=escalation_policies'; +/** @public */ export class PagerDutyClient implements PagerDutyApi { static fromConfig( configApi: ConfigApi, diff --git a/plugins/pagerduty/src/api/index.ts b/plugins/pagerduty/src/api/index.ts index 9a0c08973d..031920fa62 100644 --- a/plugins/pagerduty/src/api/index.ts +++ b/plugins/pagerduty/src/api/index.ts @@ -16,6 +16,7 @@ export { PagerDutyClient, pagerDutyApiRef, UnauthorizedError } from './client'; export type { + PagerDutyApi, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, diff --git a/plugins/pagerduty/src/api/types.ts b/plugins/pagerduty/src/api/types.ts index 786b0bdffd..f1971d53d5 100644 --- a/plugins/pagerduty/src/api/types.ts +++ b/plugins/pagerduty/src/api/types.ts @@ -27,22 +27,27 @@ export type PagerDutyServicesResponse = { services: PagerDutyService[]; }; +/** @public */ export type PagerDutyServiceResponse = { service: PagerDutyService; }; +/** @public */ export type PagerDutyIncidentsResponse = { incidents: PagerDutyIncident[]; }; +/** @public */ export type PagerDutyChangeEventsResponse = { change_events: PagerDutyChangeEvent[]; }; +/** @public */ export type PagerDutyOnCallsResponse = { oncalls: PagerDutyOnCall[]; }; +/** @public */ export type PagerDutyTriggerAlarmRequest = { integrationKey: string; source: string; @@ -50,6 +55,7 @@ export type PagerDutyTriggerAlarmRequest = { userName: string; }; +/** @public */ export interface PagerDutyApi { /** * Fetches the service for the provided Entity. @@ -85,11 +91,13 @@ export interface PagerDutyApi { triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise; } +/** @public */ export type PagerDutyClientApiDependencies = { discoveryApi: DiscoveryApi; fetchApi: FetchApi; }; +/** @public */ export type PagerDutyClientApiConfig = PagerDutyClientApiDependencies & { eventsBaseUrl?: string; }; diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index e8ba2c522c..15967fae01 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -46,12 +46,14 @@ const BasicCard = ({ children }: { children: ReactNode }) => ( {children} ); +/** @public */ export const isPluginApplicableToEntity = (entity: Entity) => Boolean( entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] || entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID], ); +/** @public */ export const PagerDutyCard = () => { const { entity } = useEntity(); const pagerDutyEntity = getPagerDutyEntity(entity); diff --git a/plugins/pagerduty/src/components/TriggerButton/index.tsx b/plugins/pagerduty/src/components/TriggerButton/index.tsx index 6f83effcf4..732298c6d8 100644 --- a/plugins/pagerduty/src/components/TriggerButton/index.tsx +++ b/plugins/pagerduty/src/components/TriggerButton/index.tsx @@ -20,10 +20,6 @@ import { BackstageTheme } from '@backstage/theme'; import { usePagerdutyEntity } from '../../hooks'; import { TriggerDialog } from '../TriggerDialog'; -export type TriggerButtonProps = { - children?: ReactNode; -}; - const useStyles = makeStyles(theme => ({ buttonStyle: { backgroundColor: theme.palette.error.main, @@ -34,7 +30,8 @@ const useStyles = makeStyles(theme => ({ }, })); -export function TriggerButton(props: TriggerButtonProps) { +/** @public */ +export function TriggerButton(props: { children?: ReactNode }) { const { buttonStyle } = useStyles(); const { integrationKey } = usePagerdutyEntity(); const [dialogShown, setDialogShown] = useState(false); diff --git a/plugins/pagerduty/src/components/types.ts b/plugins/pagerduty/src/components/types.ts index 89cdffea16..156b5c9b9d 100644 --- a/plugins/pagerduty/src/components/types.ts +++ b/plugins/pagerduty/src/components/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export type PagerDutyChangeEvent = { id: string; integration: [ @@ -33,6 +34,7 @@ export type PagerDutyChangeEvent = { timestamp: string; }; +/** @public */ export type PagerDutyIncident = { id: string; title: string; @@ -47,6 +49,7 @@ export type PagerDutyIncident = { created_at: string; }; +/** @public */ export type PagerDutyService = { id: string; name: string; @@ -59,17 +62,20 @@ export type PagerDutyService = { }; }; +/** @public */ export type PagerDutyOnCall = { user: PagerDutyUser; escalation_level: number; }; +/** @public */ export type PagerDutyAssignee = { id: string; summary: string; html_url: string; }; +/** @public */ export type PagerDutyUser = { id: string; summary: string; @@ -78,6 +84,7 @@ export type PagerDutyUser = { name: string; }; +/** @public */ export type SubHeaderLink = { title: string; href?: string; diff --git a/plugins/pagerduty/src/plugin.ts b/plugins/pagerduty/src/plugin.ts index d49de29416..73e7e0b397 100644 --- a/plugins/pagerduty/src/plugin.ts +++ b/plugins/pagerduty/src/plugin.ts @@ -28,6 +28,7 @@ export const rootRouteRef = createRouteRef({ id: 'pagerduty', }); +/** @public */ export const pagerDutyPlugin = createPlugin({ id: 'pagerduty', apis: [ @@ -44,6 +45,7 @@ export const pagerDutyPlugin = createPlugin({ ], }); +/** @public */ export const EntityPagerDutyCard = pagerDutyPlugin.provide( createComponentExtension({ name: 'EntityPagerDutyCard', diff --git a/plugins/pagerduty/src/types.ts b/plugins/pagerduty/src/types.ts index 07f7f2bbe3..9f38b429ef 100644 --- a/plugins/pagerduty/src/types.ts +++ b/plugins/pagerduty/src/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export type PagerDutyEntity = { integrationKey?: string; serviceId?: string; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index fd1254b07d..fbd5b71196 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -229,7 +229,6 @@ const ALLOW_WARNINGS = [ 'plugins/kubernetes-common', 'plugins/newrelic', 'plugins/newrelic-dashboard', - 'plugins/pagerduty', ]; async function resolvePackagePath( From 93b552b34cf709ce1d84250657917c385653c790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:12:39 +0200 Subject: [PATCH 15/41] gcp-projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/gcp-projects/api-report.md | 18 ------------------ plugins/gcp-projects/src/api/GcpApi.ts | 2 ++ plugins/gcp-projects/src/api/GcpClient.ts | 1 + plugins/gcp-projects/src/api/types.ts | 4 ++++ plugins/gcp-projects/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 1 - 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/plugins/gcp-projects/api-report.md b/plugins/gcp-projects/api-report.md index 46c8dd2c2f..5b7604c935 100644 --- a/plugins/gcp-projects/api-report.md +++ b/plugins/gcp-projects/api-report.md @@ -10,8 +10,6 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { OAuthApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "GcpApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GcpApi = { listProjects(): Promise; @@ -22,13 +20,9 @@ export type GcpApi = { }): Promise; }; -// Warning: (ae-missing-release-tag) "gcpApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const gcpApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "GcpClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class GcpClient implements GcpApi { constructor(googleAuthApi: OAuthApi); @@ -45,13 +39,9 @@ export class GcpClient implements GcpApi { listProjects(): Promise; } -// Warning: (ae-missing-release-tag) "GcpProjectsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const GcpProjectsPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "gcpProjectsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const gcpProjectsPlugin: BackstagePlugin< { @@ -63,8 +53,6 @@ const gcpProjectsPlugin: BackstagePlugin< export { gcpProjectsPlugin }; export { gcpProjectsPlugin as plugin }; -// Warning: (ae-missing-release-tag) "Operation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Operation = { name: string; @@ -74,8 +62,6 @@ export type Operation = { response: string; }; -// Warning: (ae-missing-release-tag) "Project" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Project = { name: string; @@ -85,15 +71,11 @@ export type Project = { createTime?: string; }; -// Warning: (ae-missing-release-tag) "ProjectDetails" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type ProjectDetails = { details: string; }; -// Warning: (ae-missing-release-tag) "Status" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Status = { code: number; diff --git a/plugins/gcp-projects/src/api/GcpApi.ts b/plugins/gcp-projects/src/api/GcpApi.ts index 9167d2983f..434da5fd28 100644 --- a/plugins/gcp-projects/src/api/GcpApi.ts +++ b/plugins/gcp-projects/src/api/GcpApi.ts @@ -17,10 +17,12 @@ import { Project, Operation } from './types'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const gcpApiRef = createApiRef({ id: 'plugin.gcpprojects.service', }); +/** @public */ export type GcpApi = { listProjects(): Promise; getProject(projectId: string): Promise; diff --git a/plugins/gcp-projects/src/api/GcpClient.ts b/plugins/gcp-projects/src/api/GcpClient.ts index f226e3b20c..10dcb5a4c8 100644 --- a/plugins/gcp-projects/src/api/GcpClient.ts +++ b/plugins/gcp-projects/src/api/GcpClient.ts @@ -21,6 +21,7 @@ import { OAuthApi } from '@backstage/core-plugin-api'; const BASE_URL = 'https://content-cloudresourcemanager.googleapis.com/v1/projects'; +/** @public */ export class GcpClient implements GcpApi { constructor(private readonly googleAuthApi: OAuthApi) {} diff --git a/plugins/gcp-projects/src/api/types.ts b/plugins/gcp-projects/src/api/types.ts index 6b70c627d2..8e3dd39519 100644 --- a/plugins/gcp-projects/src/api/types.ts +++ b/plugins/gcp-projects/src/api/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export type Project = { name: string; projectNumber?: string; @@ -22,10 +23,12 @@ export type Project = { createTime?: string; }; +/** @public */ export type ProjectDetails = { details: string; }; +/** @public */ export type Operation = { name: string; metadata: string; @@ -34,6 +37,7 @@ export type Operation = { response: string; }; +/** @public */ export type Status = { code: number; message: string; diff --git a/plugins/gcp-projects/src/plugin.ts b/plugins/gcp-projects/src/plugin.ts index 080d051ee3..fede29e3b5 100644 --- a/plugins/gcp-projects/src/plugin.ts +++ b/plugins/gcp-projects/src/plugin.ts @@ -23,6 +23,7 @@ import { googleAuthApiRef, } from '@backstage/core-plugin-api'; +/** @public */ export const gcpProjectsPlugin = createPlugin({ id: 'gcp-projects', routes: { @@ -39,6 +40,7 @@ export const gcpProjectsPlugin = createPlugin({ ], }); +/** @public */ export const GcpProjectsPage = gcpProjectsPlugin.provide( createRoutableExtension({ name: 'GcpProjectsPage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index fbd5b71196..7e79e14ade 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -215,7 +215,6 @@ const ALLOW_WARNINGS = [ 'plugins/explore', 'plugins/explore-react', 'plugins/firehydrant', - 'plugins/gcp-projects', 'plugins/git-release-manager', 'plugins/github-actions', 'plugins/github-deployments', From 71ce2d1c62d3440de19e86a94242576cd6f37f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:16:21 +0200 Subject: [PATCH 16/41] cloudbuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/cloudbuild/api-report.md | 52 ------------------- plugins/cloudbuild/src/api/CloudbuildApi.ts | 1 + plugins/cloudbuild/src/api/types.ts | 16 ++++++ .../cloudbuild/src/components/Cards/Cards.tsx | 3 ++ .../cloudbuild/src/components/Cards/index.ts | 1 + plugins/cloudbuild/src/components/Router.tsx | 2 + .../src/components/useProjectName.ts | 1 + plugins/cloudbuild/src/plugin.ts | 4 ++ plugins/firehydrant/api-report.md | 4 -- plugins/firehydrant/src/plugin.ts | 2 + scripts/api-extractor.ts | 2 - 11 files changed, 30 insertions(+), 58 deletions(-) diff --git a/plugins/cloudbuild/api-report.md b/plugins/cloudbuild/api-report.md index 34b50b54d8..deacf96acd 100644 --- a/plugins/cloudbuild/api-report.md +++ b/plugins/cloudbuild/api-report.md @@ -11,8 +11,6 @@ import { Entity } from '@backstage/catalog-model'; import { OAuthApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "ActionsGetWorkflowResponseData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type ActionsGetWorkflowResponseData = { id: string; @@ -37,16 +35,12 @@ export type ActionsGetWorkflowResponseData = { timing: Timing2; }; -// Warning: (ae-missing-release-tag) "ActionsListWorkflowRunsForRepoResponseData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ActionsListWorkflowRunsForRepoResponseData { // (undocumented) builds: ActionsGetWorkflowResponseData[]; } -// Warning: (ae-missing-release-tag) "BUILD" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BUILD { // (undocumented) @@ -55,8 +49,6 @@ export interface BUILD { startTime: string; } -// Warning: (ae-missing-release-tag) "CLOUDBUILD_ANNOTATION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; @@ -79,8 +71,6 @@ export type CloudbuildApi = { }) => Promise; }; -// Warning: (ae-missing-release-tag) "cloudbuildApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const cloudbuildApiRef: ApiRef; @@ -107,8 +97,6 @@ export class CloudbuildClient implements CloudbuildApi { reRunWorkflow(options: { projectId: string; runId: string }): Promise; } -// Warning: (ae-missing-release-tag) "cloudbuildPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const cloudbuildPlugin: BackstagePlugin< { @@ -120,27 +108,19 @@ const cloudbuildPlugin: BackstagePlugin< export { cloudbuildPlugin }; export { cloudbuildPlugin as plugin }; -// Warning: (ae-missing-release-tag) "EntityCloudbuildContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityCloudbuildContent: () => JSX.Element; -// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityLatestCloudbuildRunCard: (props: { branch: string; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "EntityLatestCloudbuildsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityLatestCloudbuildsForBranchCard: (props: { branch: string; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "FETCHSOURCE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface FETCHSOURCE { // (undocumented) @@ -149,27 +129,19 @@ export interface FETCHSOURCE { startTime: string; } -// Warning: (ae-missing-release-tag) "isCloudbuildAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const isCloudbuildAvailable: (entity: Entity) => boolean; export { isCloudbuildAvailable }; export { isCloudbuildAvailable as isPluginApplicableToEntity }; -// Warning: (ae-missing-release-tag) "LatestWorkflowRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const LatestWorkflowRunCard: (props: { branch: string }) => JSX.Element; -// Warning: (ae-missing-release-tag) "LatestWorkflowsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const LatestWorkflowsForBranchCard: (props: { branch: string; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "Options" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Options { // (undocumented) @@ -182,8 +154,6 @@ export interface Options { substitutionOption: string; } -// Warning: (ae-missing-release-tag) "PullTiming" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface PullTiming { // (undocumented) @@ -192,8 +162,6 @@ export interface PullTiming { startTime: string; } -// Warning: (ae-missing-release-tag) "ResolvedStorageSource" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ResolvedStorageSource { // (undocumented) @@ -204,8 +172,6 @@ export interface ResolvedStorageSource { object: string; } -// Warning: (ae-missing-release-tag) "Results" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Results { // (undocumented) @@ -214,21 +180,15 @@ export interface Results { buildStepOutputs: string[]; } -// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const Router: () => JSX.Element; -// Warning: (ae-missing-release-tag) "Source" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Source { // (undocumented) storageSource: StorageSource; } -// Warning: (ae-missing-release-tag) "SourceProvenance" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface SourceProvenance { // (undocumented) @@ -237,8 +197,6 @@ export interface SourceProvenance { resolvedStorageSource: {}; } -// Warning: (ae-missing-release-tag) "Step" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Step { // (undocumented) @@ -263,8 +221,6 @@ export interface Step { waitFor: string[]; } -// Warning: (ae-missing-release-tag) "StorageSource" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface StorageSource { // (undocumented) @@ -273,8 +229,6 @@ export interface StorageSource { object: string; } -// Warning: (ae-missing-release-tag) "Substitutions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Substitutions { // (undocumented) @@ -289,8 +243,6 @@ export interface Substitutions { SHORT_SHA: string; } -// Warning: (ae-missing-release-tag) "Timing" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Timing { // (undocumented) @@ -299,8 +251,6 @@ export interface Timing { startTime: string; } -// Warning: (ae-missing-release-tag) "Timing2" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Timing2 { // (undocumented) @@ -309,8 +259,6 @@ export interface Timing2 { FETCHSOURCE: FETCHSOURCE; } -// Warning: (ae-missing-release-tag) "Volume" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Volume { // (undocumented) diff --git a/plugins/cloudbuild/src/api/CloudbuildApi.ts b/plugins/cloudbuild/src/api/CloudbuildApi.ts index eeaf269cde..cb29b49fbf 100644 --- a/plugins/cloudbuild/src/api/CloudbuildApi.ts +++ b/plugins/cloudbuild/src/api/CloudbuildApi.ts @@ -20,6 +20,7 @@ import { } from '../api/types'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const cloudbuildApiRef = createApiRef({ id: 'plugin.cloudbuild.service', }); diff --git a/plugins/cloudbuild/src/api/types.ts b/plugins/cloudbuild/src/api/types.ts index c9f6481b9e..1dd03265bc 100644 --- a/plugins/cloudbuild/src/api/types.ts +++ b/plugins/cloudbuild/src/api/types.ts @@ -14,10 +14,12 @@ * limitations under the License. */ +/** @public */ export interface ActionsListWorkflowRunsForRepoResponseData { builds: ActionsGetWorkflowResponseData[]; } +/** @public */ export type ActionsGetWorkflowResponseData = { id: string; status: string; @@ -41,6 +43,7 @@ export type ActionsGetWorkflowResponseData = { timing: Timing2; }; +/** @public */ export interface Step { name: string; args: string[]; @@ -54,16 +57,19 @@ export interface Step { pullTiming: PullTiming; } +/** @public */ export interface Timing2 { BUILD: BUILD; FETCHSOURCE: FETCHSOURCE; } +/** @public */ export interface SourceProvenance { resolvedStorageSource: {}; fileHashes: {}; } +/** @public */ export interface Options { machineType: string; substitutionOption: string; @@ -71,6 +77,7 @@ export interface Options { dynamicSubstitutions: boolean; } +/** @public */ export interface Substitutions { COMMIT_SHA: string; SHORT_SHA: string; @@ -79,45 +86,54 @@ export interface Substitutions { REVISION_ID: string; } +/** @public */ export interface Results { buildStepImages: string[]; buildStepOutputs: string[]; } +/** @public */ export interface BUILD { startTime: string; endTime: string; } +/** @public */ export interface FETCHSOURCE { startTime: string; endTime: string; } +/** @public */ export interface StorageSource { bucket: string; object: string; } +/** @public */ export interface Source { storageSource: StorageSource; } +/** @public */ export interface Volume { name: string; path: string; } +/** @public */ export interface Timing { startTime: string; endTime: string; } +/** @public */ export interface PullTiming { startTime: string; endTime: string; } +/** @public */ export interface ResolvedStorageSource { bucket: string; object: string; diff --git a/plugins/cloudbuild/src/components/Cards/Cards.tsx b/plugins/cloudbuild/src/components/Cards/Cards.tsx index 75c9ee432b..2b7a8607b7 100644 --- a/plugins/cloudbuild/src/components/Cards/Cards.tsx +++ b/plugins/cloudbuild/src/components/Cards/Cards.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React, { useEffect } from 'react'; import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunsTable } from '../WorkflowRunsTable'; @@ -72,6 +73,7 @@ const WidgetContent = ({ ); }; +/** @public */ export const LatestWorkflowRunCard = (props: { branch: string }) => { const { branch = 'master' } = props; const { entity } = useEntity(); @@ -100,6 +102,7 @@ export const LatestWorkflowRunCard = (props: { branch: string }) => { ); }; +/** @public */ export const LatestWorkflowsForBranchCard = (props: { branch: string }) => { const { branch = 'master' } = props; const { entity } = useEntity(); diff --git a/plugins/cloudbuild/src/components/Cards/index.ts b/plugins/cloudbuild/src/components/Cards/index.ts index 669f723c2d..7149bdf3ca 100644 --- a/plugins/cloudbuild/src/components/Cards/index.ts +++ b/plugins/cloudbuild/src/components/Cards/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { LatestWorkflowRunCard, LatestWorkflowsForBranchCard } from './Cards'; diff --git a/plugins/cloudbuild/src/components/Router.tsx b/plugins/cloudbuild/src/components/Router.tsx index e4c590bcaf..6ac025fef1 100644 --- a/plugins/cloudbuild/src/components/Router.tsx +++ b/plugins/cloudbuild/src/components/Router.tsx @@ -23,9 +23,11 @@ import { WorkflowRunsTable } from './WorkflowRunsTable'; import { CLOUDBUILD_ANNOTATION } from './useProjectName'; import { MissingAnnotationEmptyState } from '@backstage/core-components'; +/** @public */ export const isCloudbuildAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[CLOUDBUILD_ANNOTATION]); +/** @public */ export const Router = () => { const { entity } = useEntity(); diff --git a/plugins/cloudbuild/src/components/useProjectName.ts b/plugins/cloudbuild/src/components/useProjectName.ts index 3f314aaa47..ae6ae07b56 100644 --- a/plugins/cloudbuild/src/components/useProjectName.ts +++ b/plugins/cloudbuild/src/components/useProjectName.ts @@ -17,6 +17,7 @@ import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; +/** @public */ export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; export const useProjectName = (entity: Entity) => { diff --git a/plugins/cloudbuild/src/plugin.ts b/plugins/cloudbuild/src/plugin.ts index fc96d154b7..2933bfb0be 100644 --- a/plugins/cloudbuild/src/plugin.ts +++ b/plugins/cloudbuild/src/plugin.ts @@ -23,6 +23,7 @@ import { createComponentExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const cloudbuildPlugin = createPlugin({ id: 'cloudbuild', apis: [ @@ -39,6 +40,7 @@ export const cloudbuildPlugin = createPlugin({ }, }); +/** @public */ export const EntityCloudbuildContent = cloudbuildPlugin.provide( createRoutableExtension({ name: 'EntityCloudbuildContent', @@ -47,6 +49,7 @@ export const EntityCloudbuildContent = cloudbuildPlugin.provide( }), ); +/** @public */ export const EntityLatestCloudbuildRunCard = cloudbuildPlugin.provide( createComponentExtension({ name: 'EntityLatestCloudbuildRunCard', @@ -57,6 +60,7 @@ export const EntityLatestCloudbuildRunCard = cloudbuildPlugin.provide( }), ); +/** @public */ export const EntityLatestCloudbuildsForBranchCard = cloudbuildPlugin.provide( createComponentExtension({ name: 'EntityLatestCloudbuildsForBranchCard', diff --git a/plugins/firehydrant/api-report.md b/plugins/firehydrant/api-report.md index c12048e81f..2e3bcf6385 100644 --- a/plugins/firehydrant/api-report.md +++ b/plugins/firehydrant/api-report.md @@ -8,13 +8,9 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "FirehydrantCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const FirehydrantCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "firehydrantPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const firehydrantPlugin: BackstagePlugin< { diff --git a/plugins/firehydrant/src/plugin.ts b/plugins/firehydrant/src/plugin.ts index df21ee7f9c..6deefe4fce 100644 --- a/plugins/firehydrant/src/plugin.ts +++ b/plugins/firehydrant/src/plugin.ts @@ -23,6 +23,7 @@ import { import { rootRouteRef } from './routes'; +/** @public */ export const firehydrantPlugin = createPlugin({ id: 'firehydrant', apis: [ @@ -37,6 +38,7 @@ export const firehydrantPlugin = createPlugin({ }, }); +/** @public */ export const FirehydrantCard = firehydrantPlugin.provide( createComponentExtension({ name: 'FirehydrantCard', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 7e79e14ade..5718f7a458 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -208,13 +208,11 @@ const ALLOW_WARNINGS = [ 'plugins/catalog-import', 'plugins/cicd-statistics', 'plugins/circleci', - 'plugins/cloudbuild', 'plugins/config-schema', 'plugins/cost-insights', 'plugins/dynatrace', 'plugins/explore', 'plugins/explore-react', - 'plugins/firehydrant', 'plugins/git-release-manager', 'plugins/github-actions', 'plugins/github-deployments', From c16fcd21dec89128b0ab4e7a77c12118944eb79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:17:56 +0200 Subject: [PATCH 17/41] config-schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/config-schema/api-report.md | 16 ++++++---------- plugins/config-schema/src/api/index.ts | 2 +- plugins/config-schema/src/api/types.ts | 3 +++ plugins/config-schema/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 1 - 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/config-schema/api-report.md b/plugins/config-schema/api-report.md index 4b9f47c950..7d110c34d4 100644 --- a/plugins/config-schema/api-report.md +++ b/plugins/config-schema/api-report.md @@ -11,28 +11,18 @@ import { Observable } from '@backstage/types'; import { RouteRef } from '@backstage/core-plugin-api'; import { Schema } from 'jsonschema'; -// Warning: (ae-missing-release-tag) "ConfigSchemaApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ConfigSchemaApi { - // Warning: (ae-forgotten-export) The symbol "ConfigSchemaResult" needs to be exported by the entry point index.d.ts - // // (undocumented) schema$(): Observable; } -// Warning: (ae-missing-release-tag) "configSchemaApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const configSchemaApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "ConfigSchemaPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ConfigSchemaPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "configSchemaPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const configSchemaPlugin: BackstagePlugin< { @@ -42,6 +32,12 @@ export const configSchemaPlugin: BackstagePlugin< {} >; +// @public (undocumented) +export interface ConfigSchemaResult { + // (undocumented) + schema?: Schema; +} + // @public export class StaticSchemaLoader implements ConfigSchemaApi { constructor(options?: { url?: string }); diff --git a/plugins/config-schema/src/api/index.ts b/plugins/config-schema/src/api/index.ts index 8c1532ed0c..18319a2fe7 100644 --- a/plugins/config-schema/src/api/index.ts +++ b/plugins/config-schema/src/api/index.ts @@ -15,5 +15,5 @@ */ export { configSchemaApiRef } from './types'; -export type { ConfigSchemaApi } from './types'; +export type { ConfigSchemaApi, ConfigSchemaResult } from './types'; export { StaticSchemaLoader } from './StaticSchemaLoader'; diff --git a/plugins/config-schema/src/api/types.ts b/plugins/config-schema/src/api/types.ts index 13cd4f602b..b0c43495cf 100644 --- a/plugins/config-schema/src/api/types.ts +++ b/plugins/config-schema/src/api/types.ts @@ -18,14 +18,17 @@ import { Schema } from 'jsonschema'; import { createApiRef } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; +/** @public */ export interface ConfigSchemaResult { schema?: Schema; } +/** @public */ export interface ConfigSchemaApi { schema$(): Observable; } +/** @public */ export const configSchemaApiRef = createApiRef({ id: 'plugin.config-schema', }); diff --git a/plugins/config-schema/src/plugin.ts b/plugins/config-schema/src/plugin.ts index 91d7daa871..a0ad45f18c 100644 --- a/plugins/config-schema/src/plugin.ts +++ b/plugins/config-schema/src/plugin.ts @@ -20,6 +20,7 @@ import { createRoutableExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const configSchemaPlugin = createPlugin({ id: 'config-schema', routes: { @@ -27,6 +28,7 @@ export const configSchemaPlugin = createPlugin({ }, }); +/** @public */ export const ConfigSchemaPage = configSchemaPlugin.provide( createRoutableExtension({ name: 'ConfigSchemaPage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 5718f7a458..b4fc287c03 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -208,7 +208,6 @@ const ALLOW_WARNINGS = [ 'plugins/catalog-import', 'plugins/cicd-statistics', 'plugins/circleci', - 'plugins/config-schema', 'plugins/cost-insights', 'plugins/dynatrace', 'plugins/explore', From 08c87dd8546ad5f98dc08dfebfd2f48b494364ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:24:22 +0200 Subject: [PATCH 18/41] explore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/explore/api-report.md | 48 +++++++++---------- .../src/components/DomainCard/DomainCard.tsx | 9 ++-- .../src/components/DomainCard/index.ts | 1 + .../ExploreLayout/ExploreLayout.tsx | 17 +++---- .../src/components/ExploreLayout/index.ts | 1 + plugins/explore/src/components/index.ts | 4 +- plugins/explore/src/extensions.tsx | 4 ++ plugins/explore/src/plugin.ts | 1 + plugins/explore/src/routes.ts | 2 + scripts/api-extractor.ts | 1 - 10 files changed, 46 insertions(+), 42 deletions(-) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index f4c7345b6c..9653c0fb63 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -12,8 +12,6 @@ import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; import { TabProps } from '@material-ui/core'; -// Warning: (ae-missing-release-tag) "catalogEntityRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export const catalogEntityRouteRef: ExternalRouteRef< { @@ -24,34 +22,30 @@ export const catalogEntityRouteRef: ExternalRouteRef< true >; -// Warning: (ae-forgotten-export) The symbol "DomainCardProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "DomainCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const DomainCard: ({ entity }: DomainCardProps) => JSX.Element; +export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; -// Warning: (ae-missing-release-tag) "DomainExplorerContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const DomainExplorerContent: (props: { title?: string | undefined; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "ExploreLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export const ExploreLayout: { - ({ title, subtitle, children }: ExploreLayoutProps): JSX.Element; + (props: ExploreLayoutProps): JSX.Element; Route: (props: SubRoute) => null; }; -// Warning: (ae-missing-release-tag) "ExplorePage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type ExploreLayoutProps = { + title?: string; + subtitle?: string; + children?: default_2.ReactNode; +}; + // @public (undocumented) export const ExplorePage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "explorePlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const explorePlugin: BackstagePlugin< { @@ -72,27 +66,29 @@ const explorePlugin: BackstagePlugin< export { explorePlugin }; export { explorePlugin as plugin }; -// Warning: (ae-missing-release-tag) "exploreRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const exploreRouteRef: RouteRef; -// Warning: (ae-missing-release-tag) "GroupsExplorerContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const GroupsExplorerContent: (props: { title?: string | undefined; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "ToolExplorerContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type SubRoute = { + path: string; + title: string; + children: JSX.Element; + tabProps?: TabProps< + default_2.ElementType, + { + component?: default_2.ElementType; + } + >; +}; + // @public (undocumented) export const ToolExplorerContent: (props: { title?: string | undefined; }) => JSX.Element; - -// Warnings were encountered during analysis: -// -// src/components/ExploreLayout/ExploreLayout.d.ts:29:5 - (ae-forgotten-export) The symbol "ExploreLayoutProps" needs to be exported by the entry point index.d.ts -// src/components/ExploreLayout/ExploreLayout.d.ts:30:5 - (ae-forgotten-export) The symbol "SubRoute" needs to be exported by the entry point index.d.ts ``` diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/DomainCard/DomainCard.tsx index 94e4f145c3..a20a5e1f0c 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.tsx +++ b/plugins/explore/src/components/DomainCard/DomainCard.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { DomainEntity, RELATION_OWNED_BY } from '@backstage/catalog-model'; import { EntityRefLinks, @@ -33,13 +34,11 @@ import React from 'react'; import { Button, ItemCardHeader } from '@backstage/core-components'; import { useRouteRef } from '@backstage/core-plugin-api'; -type DomainCardProps = { - entity: DomainEntity; -}; +/** @public */ +export const DomainCard = (props: { entity: DomainEntity }) => { + const { entity } = props; -export const DomainCard = ({ entity }: DomainCardProps) => { const catalogEntityRoute = useRouteRef(entityRouteRef); - const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY); const url = catalogEntityRoute(entityRouteParams(entity)); diff --git a/plugins/explore/src/components/DomainCard/index.ts b/plugins/explore/src/components/DomainCard/index.ts index 5d62a09e89..dbae755460 100644 --- a/plugins/explore/src/components/DomainCard/index.ts +++ b/plugins/explore/src/components/DomainCard/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { DomainCard } from './DomainCard'; diff --git a/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx b/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx index bc9553c612..3ddf0b17f8 100644 --- a/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx +++ b/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx @@ -24,8 +24,8 @@ import { default as React } from 'react'; // TODO: This layout could be a shared based component if it was possible to create custom TabbedLayouts // A generalized version of createSubRoutesFromChildren, etc. would be required - -type SubRoute = { +/** @public */ +export type SubRoute = { path: string; title: string; children: JSX.Element; @@ -40,7 +40,8 @@ attachComponentData(Route, dataKey, true); // This causes all mount points that are discovered within this route to use the path of the route itself attachComponentData(Route, 'core.gatherMountPoints', true); -type ExploreLayoutProps = { +/** @public */ +export type ExploreLayoutProps = { title?: string; subtitle?: string; children?: React.ReactNode; @@ -57,12 +58,12 @@ type ExploreLayoutProps = { * * * ``` + * + * @public */ -export const ExploreLayout = ({ - title, - subtitle, - children, -}: ExploreLayoutProps) => { +export const ExploreLayout = (props: ExploreLayoutProps) => { + const { title, subtitle, children } = props; + const routes = useElementFilter(children, elements => elements .selectByComponentData({ diff --git a/plugins/explore/src/components/ExploreLayout/index.ts b/plugins/explore/src/components/ExploreLayout/index.ts index fa98ec78da..4d1781b3f4 100644 --- a/plugins/explore/src/components/ExploreLayout/index.ts +++ b/plugins/explore/src/components/ExploreLayout/index.ts @@ -14,4 +14,5 @@ * limitations under the License. */ +export type { ExploreLayoutProps, SubRoute } from './ExploreLayout'; export { ExploreLayout } from './ExploreLayout'; diff --git a/plugins/explore/src/components/index.ts b/plugins/explore/src/components/index.ts index cefc549684..f8fba16910 100644 --- a/plugins/explore/src/components/index.ts +++ b/plugins/explore/src/components/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { DomainCard } from './DomainCard'; -export { ExploreLayout } from './ExploreLayout'; +export * from './DomainCard'; +export * from './ExploreLayout'; diff --git a/plugins/explore/src/extensions.tsx b/plugins/explore/src/extensions.tsx index 6800f86966..c6d66c4c12 100644 --- a/plugins/explore/src/extensions.tsx +++ b/plugins/explore/src/extensions.tsx @@ -21,6 +21,7 @@ import { createRoutableExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const ExplorePage = explorePlugin.provide( createRoutableExtension({ name: 'ExplorePage', @@ -30,6 +31,7 @@ export const ExplorePage = explorePlugin.provide( }), ); +/** @public */ export const DomainExplorerContent = explorePlugin.provide( createComponentExtension({ name: 'DomainExplorerContent', @@ -42,6 +44,7 @@ export const DomainExplorerContent = explorePlugin.provide( }), ); +/** @public */ export const GroupsExplorerContent = explorePlugin.provide( createComponentExtension({ name: 'GroupsExplorerContent', @@ -54,6 +57,7 @@ export const GroupsExplorerContent = explorePlugin.provide( }), ); +/** @public */ export const ToolExplorerContent = explorePlugin.provide( createComponentExtension({ name: 'ToolExplorerContent', diff --git a/plugins/explore/src/plugin.ts b/plugins/explore/src/plugin.ts index cefb884834..a4bb538265 100644 --- a/plugins/explore/src/plugin.ts +++ b/plugins/explore/src/plugin.ts @@ -19,6 +19,7 @@ import { catalogEntityRouteRef, exploreRouteRef } from './routes'; import { exampleTools } from './util/examples'; import { createApiFactory, createPlugin } from '@backstage/core-plugin-api'; +/** @public */ export const explorePlugin = createPlugin({ id: 'explore', apis: [ diff --git a/plugins/explore/src/routes.ts b/plugins/explore/src/routes.ts index e8b393c4f6..0f66974a03 100644 --- a/plugins/explore/src/routes.ts +++ b/plugins/explore/src/routes.ts @@ -19,12 +19,14 @@ import { createRouteRef, } from '@backstage/core-plugin-api'; +/** @public */ export const exploreRouteRef = createRouteRef({ id: 'explore', }); /** * @deprecated This route is no longer used and can be removed + * @public */ export const catalogEntityRouteRef = createExternalRouteRef({ id: 'catalog-entity', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index b4fc287c03..000f0b8c84 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -210,7 +210,6 @@ const ALLOW_WARNINGS = [ 'plugins/circleci', 'plugins/cost-insights', 'plugins/dynatrace', - 'plugins/explore', 'plugins/explore-react', 'plugins/git-release-manager', 'plugins/github-actions', From 689df685fb50451d92d6e28e3029cef052f9ccb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:29:04 +0200 Subject: [PATCH 19/41] allure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/allure/api-report.md | 8 -------- plugins/allure/src/components/annotationHelpers.ts | 2 ++ plugins/allure/src/plugin.ts | 2 ++ plugins/bitrise/api-report.md | 9 +++------ .../BitriseBuildsComponent/BitriseBuildsComponent.tsx | 2 ++ plugins/bitrise/src/extensions.ts | 1 + plugins/bitrise/src/index.ts | 5 ++++- plugins/bitrise/src/plugin.ts | 1 + scripts/api-extractor.ts | 2 -- 9 files changed, 15 insertions(+), 17 deletions(-) diff --git a/plugins/allure/api-report.md b/plugins/allure/api-report.md index e6f5d2aa67..c1ce499ab2 100644 --- a/plugins/allure/api-report.md +++ b/plugins/allure/api-report.md @@ -9,13 +9,9 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "ALLURE_PROJECT_ID_ANNOTATION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ALLURE_PROJECT_ID_ANNOTATION = 'qameta.io/allure-project'; -// Warning: (ae-missing-release-tag) "allurePlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const allurePlugin: BackstagePlugin< { @@ -25,13 +21,9 @@ export const allurePlugin: BackstagePlugin< {} >; -// Warning: (ae-missing-release-tag) "EntityAllureReportContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityAllureReportContent: () => JSX.Element; -// Warning: (ae-missing-release-tag) "isAllureReportAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const isAllureReportAvailable: (entity: Entity) => boolean; ``` diff --git a/plugins/allure/src/components/annotationHelpers.ts b/plugins/allure/src/components/annotationHelpers.ts index 7500c1d88b..21b1a8161d 100644 --- a/plugins/allure/src/components/annotationHelpers.ts +++ b/plugins/allure/src/components/annotationHelpers.ts @@ -15,8 +15,10 @@ */ import { Entity } from '@backstage/catalog-model'; +/** @public */ export const ALLURE_PROJECT_ID_ANNOTATION = 'qameta.io/allure-project'; +/** @public */ export const isAllureReportAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION]); diff --git a/plugins/allure/src/plugin.ts b/plugins/allure/src/plugin.ts index a2eaa06a38..a6cfb25c88 100644 --- a/plugins/allure/src/plugin.ts +++ b/plugins/allure/src/plugin.ts @@ -26,6 +26,7 @@ export const allureRouteRef = createRouteRef({ id: 'allure', }); +/** @public */ export const allurePlugin = createPlugin({ id: 'allure', apis: [ @@ -42,6 +43,7 @@ export const allurePlugin = createPlugin({ }, }); +/** @public */ export const EntityAllureReportContent = allurePlugin.provide( createRoutableExtension({ name: 'EntityAllureReportContent', diff --git a/plugins/bitrise/api-report.md b/plugins/bitrise/api-report.md index f8421a532a..01d10c61cf 100644 --- a/plugins/bitrise/api-report.md +++ b/plugins/bitrise/api-report.md @@ -8,18 +8,15 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -// Warning: (ae-missing-release-tag) "bitrisePlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export const BITRISE_APP_ANNOTATION = 'bitrise.io/app'; + // @public (undocumented) export const bitrisePlugin: BackstagePlugin<{}, {}, {}>; -// Warning: (ae-missing-release-tag) "EntityBitriseContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityBitriseContent: () => JSX.Element; -// Warning: (ae-missing-release-tag) "isBitriseAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const isBitriseAvailable: (entity: Entity) => boolean; ``` diff --git a/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx b/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx index f805f050fa..3c93fb20d7 100644 --- a/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx +++ b/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx @@ -32,8 +32,10 @@ export type Props = { entity: Entity; }; +/** @public */ export const BITRISE_APP_ANNOTATION = 'bitrise.io/app'; +/** @public */ export const isBitriseAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[BITRISE_APP_ANNOTATION]); diff --git a/plugins/bitrise/src/extensions.ts b/plugins/bitrise/src/extensions.ts index ccb5fb24dd..e588f092d8 100644 --- a/plugins/bitrise/src/extensions.ts +++ b/plugins/bitrise/src/extensions.ts @@ -17,6 +17,7 @@ import { bitrisePlugin } from './plugin'; import { createComponentExtension } from '@backstage/core-plugin-api'; +/** @public */ export const EntityBitriseContent = bitrisePlugin.provide( createComponentExtension({ name: 'EntityBitriseContent', diff --git a/plugins/bitrise/src/index.ts b/plugins/bitrise/src/index.ts index 3cf1389013..54cce62cec 100644 --- a/plugins/bitrise/src/index.ts +++ b/plugins/bitrise/src/index.ts @@ -22,4 +22,7 @@ export { bitrisePlugin } from './plugin'; export { EntityBitriseContent } from './extensions'; -export { isBitriseAvailable } from './components/BitriseBuildsComponent'; +export { + isBitriseAvailable, + BITRISE_APP_ANNOTATION, +} from './components/BitriseBuildsComponent'; diff --git a/plugins/bitrise/src/plugin.ts b/plugins/bitrise/src/plugin.ts index 92beda287c..2b75f6d8b5 100644 --- a/plugins/bitrise/src/plugin.ts +++ b/plugins/bitrise/src/plugin.ts @@ -28,6 +28,7 @@ export const bitriseApiRef = createApiRef({ id: 'plugin.bitrise.service', }); +/** @public */ export const bitrisePlugin = createPlugin({ id: 'bitrise', apis: [ diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 000f0b8c84..b53c5b0769 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -199,10 +199,8 @@ const PACKAGE_ROOTS = ['packages', 'plugins']; const ALLOW_WARNINGS = [ 'packages/core-components', - 'plugins/allure', 'plugins/apache-airflow', 'plugins/auth-backend', - 'plugins/bitrise', 'plugins/catalog', 'plugins/catalog-graphql', 'plugins/catalog-import', From fa07cc8ff260883135a6cfde671a0fe743d424ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:30:23 +0200 Subject: [PATCH 20/41] apache-airflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/apache-airflow/api-report.md | 4 ---- plugins/apache-airflow/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/apache-airflow/api-report.md b/plugins/apache-airflow/api-report.md index 2f03d34205..b427a0148e 100644 --- a/plugins/apache-airflow/api-report.md +++ b/plugins/apache-airflow/api-report.md @@ -13,13 +13,9 @@ export const ApacheAirflowDagTable: (props: { dagIds?: string[] | undefined; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "ApacheAirflowPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ApacheAirflowPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "apacheAirflowPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const apacheAirflowPlugin: BackstagePlugin< { diff --git a/plugins/apache-airflow/src/plugin.ts b/plugins/apache-airflow/src/plugin.ts index 664cde36cc..4118857b05 100644 --- a/plugins/apache-airflow/src/plugin.ts +++ b/plugins/apache-airflow/src/plugin.ts @@ -25,6 +25,7 @@ import { discoveryApiRef, } from '@backstage/core-plugin-api'; +/** @public */ export const apacheAirflowPlugin = createPlugin({ id: 'apache-airflow', routes: { @@ -43,6 +44,7 @@ export const apacheAirflowPlugin = createPlugin({ ], }); +/** @public */ export const ApacheAirflowPage = apacheAirflowPlugin.provide( createRoutableExtension({ name: 'ApacheAirflowPage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index b53c5b0769..1239cfd935 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -199,7 +199,6 @@ const PACKAGE_ROOTS = ['packages', 'plugins']; const ALLOW_WARNINGS = [ 'packages/core-components', - 'plugins/apache-airflow', 'plugins/auth-backend', 'plugins/catalog', 'plugins/catalog-graphql', From 2fc41ebf0734f86cb7737988d42d12435c1e119b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 13:54:05 +0200 Subject: [PATCH 21/41] auth-backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/funny-years-speak.md | 5 + plugins/auth-backend/api-report.md | 111 ++++++------------ .../src/lib/catalog/CatalogIdentityClient.ts | 20 ++-- .../src/lib/flow/authFlowHelpers.ts | 2 + plugins/auth-backend/src/lib/flow/types.ts | 2 + .../src/lib/oauth/OAuthAdapter.ts | 12 +- .../src/lib/oauth/OAuthEnvironmentHandler.ts | 1 + plugins/auth-backend/src/lib/oauth/helpers.ts | 3 + plugins/auth-backend/src/lib/oauth/index.ts | 1 + plugins/auth-backend/src/lib/oauth/types.ts | 7 ++ .../src/providers/atlassian/index.ts | 2 +- .../src/providers/atlassian/provider.ts | 5 +- .../src/providers/bitbucket/provider.ts | 2 + .../providers/cloudflare-access/provider.ts | 1 - .../createAuthProviderIntegration.ts | 2 + .../src/providers/github/provider.ts | 1 + plugins/auth-backend/src/providers/index.ts | 2 +- plugins/auth-backend/src/providers/types.ts | 4 + plugins/auth-backend/src/service/router.ts | 6 +- scripts/api-extractor.ts | 1 - 20 files changed, 89 insertions(+), 101 deletions(-) create mode 100644 .changeset/funny-years-speak.md diff --git a/.changeset/funny-years-speak.md b/.changeset/funny-years-speak.md new file mode 100644 index 0000000000..b82c10a59f --- /dev/null +++ b/.changeset/funny-years-speak.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': minor +--- + +Removed the previously deprecated class `AtlassianAuthProvider`. Please use `providers.atlassian.create(...)` instead. diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index 649a31c963..be295f65f5 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -24,26 +24,6 @@ import { TokenSet } from 'openid-client'; import { UserEntity } from '@backstage/catalog-model'; import { UserinfoResponse } from 'openid-client'; -// @public @deprecated (undocumented) -export class AtlassianAuthProvider implements OAuthHandlers { - // Warning: (ae-forgotten-export) The symbol "AtlassianAuthProviderOptions" needs to be exported by the entry point index.d.ts - constructor(options: AtlassianAuthProviderOptions); - // (undocumented) - handler(req: express.Request): Promise<{ - response: OAuthResponse; - refreshToken: string | undefined; - }>; - // (undocumented) - refresh(req: OAuthRefreshRequest): Promise<{ - response: OAuthResponse; - refreshToken: string | undefined; - }>; - // Warning: (ae-forgotten-export) The symbol "RedirectInfo" needs to be exported by the entry point index.d.ts - // - // (undocumented) - start(req: OAuthStartRequest): Promise; -} - // @public export type AuthHandler = ( input: TAuthResult, @@ -63,8 +43,6 @@ export type AuthProviderConfig = { cookieConfigurer?: CookieConfigurer; }; -// Warning: (ae-missing-release-tag) "AuthProviderFactory" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type AuthProviderFactory = (options: { providerId: string; @@ -74,8 +52,6 @@ export type AuthProviderFactory = (options: { resolverContext: AuthResolverContext; }) => AuthProviderRouteHandlers; -// Warning: (ae-missing-release-tag) "AuthProviderRouteHandlers" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface AuthProviderRouteHandlers { frameHandler(req: express.Request, res: express.Response): Promise; @@ -129,8 +105,6 @@ export type AwsAlbResult = { accessToken: string; }; -// Warning: (ae-missing-release-tag) "BitbucketOAuthResult" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BitbucketOAuthResult = { fullProfile: BitbucketPassportProfile; @@ -143,8 +117,6 @@ export type BitbucketOAuthResult = { refreshToken?: string; }; -// Warning: (ae-missing-release-tag) "BitbucketPassportProfile" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BitbucketPassportProfile = Profile & { id?: string; @@ -160,15 +132,14 @@ export type BitbucketPassportProfile = Profile & { }; }; -// Warning: (ae-missing-release-tag) "CatalogIdentityClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class CatalogIdentityClient { constructor(options: { catalogApi: CatalogApi; tokenManager: TokenManager }); - // Warning: (ae-forgotten-export) The symbol "UserQuery" needs to be exported by the entry point index.d.ts - findUser(query: UserQuery): Promise; - // Warning: (ae-forgotten-export) The symbol "MemberClaimQuery" needs to be exported by the entry point index.d.ts - resolveCatalogMembership(query: MemberClaimQuery): Promise; + findUser(query: { annotations: Record }): Promise; + resolveCatalogMembership(query: { + entityRefs: string[]; + logger?: Logger; + }): Promise; } // @public @@ -217,8 +188,6 @@ export type CookieConfigurer = (ctx: { secure: boolean; }; -// Warning: (ae-missing-release-tag) "createAuthProviderIntegration" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function createAuthProviderIntegration< TCreateOptions extends unknown[], @@ -233,13 +202,9 @@ export function createAuthProviderIntegration< resolvers: Readonly; }>; -// Warning: (ae-missing-release-tag) "createOriginFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createOriginFilter(config: Config): (origin: string) => boolean; -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createRouter(options: RouterOptions): Promise; @@ -248,13 +213,9 @@ export const defaultAuthProviderFactories: { [providerId: string]: AuthProviderFactory; }; -// Warning: (ae-missing-release-tag) "encodeState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const encodeState: (state: OAuthState) => string; -// Warning: (ae-missing-release-tag) "ensuresXRequestedWith" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ensuresXRequestedWith: (req: express.Request) => boolean; @@ -273,8 +234,6 @@ export type GcpIapTokenInfo = { // @public export function getDefaultOwnershipEntityRefs(entity: Entity): string[]; -// Warning: (ae-missing-release-tag) "GithubOAuthResult" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GithubOAuthResult = { fullProfile: Profile; @@ -295,20 +254,19 @@ export type OAuth2ProxyResult = { getHeader(name: string): string | undefined; }; -// Warning: (ae-missing-release-tag) "OAuthAdapter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class OAuthAdapter implements AuthProviderRouteHandlers { - constructor(handlers: OAuthHandlers, options: Options); + constructor(handlers: OAuthHandlers, options: OAuthAdapterOptions); // (undocumented) frameHandler(req: express.Request, res: express.Response): Promise; - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - // // (undocumented) static fromConfig( config: AuthProviderConfig, handlers: OAuthHandlers, - options: Pick, + options: Pick< + OAuthAdapterOptions, + 'providerId' | 'persistScopes' | 'callbackUrl' + >, ): OAuthAdapter; // (undocumented) logout(req: express.Request, res: express.Response): Promise; @@ -318,8 +276,18 @@ export class OAuthAdapter implements AuthProviderRouteHandlers { start(req: express.Request, res: express.Response): Promise; } -// Warning: (ae-missing-release-tag) "OAuthEnvironmentHandler" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type OAuthAdapterOptions = { + providerId: string; + secure: boolean; + persistScopes?: boolean; + cookieDomain: string; + cookiePath: string; + appOrigin: string; + isOriginAllowed: (origin: string) => boolean; + callbackUrl: string; +}; + // @public (undocumented) export class OAuthEnvironmentHandler implements AuthProviderRouteHandlers { constructor(handlers: Map); @@ -352,8 +320,6 @@ export interface OAuthHandlers { start(req: OAuthStartRequest): Promise; } -// Warning: (ae-missing-release-tag) "OAuthProviderInfo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type OAuthProviderInfo = { accessToken: string; @@ -362,8 +328,6 @@ export type OAuthProviderInfo = { scope: string; }; -// Warning: (ae-missing-release-tag) "OAuthProviderOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type OAuthProviderOptions = { clientId: string; @@ -371,8 +335,6 @@ export type OAuthProviderOptions = { callbackUrl: string; }; -// Warning: (ae-missing-release-tag) "OAuthRefreshRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type OAuthRefreshRequest = express.Request<{}> & { scope: string; @@ -386,8 +348,6 @@ export type OAuthResponse = { backstageIdentity?: BackstageSignInResult; }; -// Warning: (ae-missing-release-tag) "OAuthResult" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type OAuthResult = { fullProfile: Profile; @@ -400,16 +360,12 @@ export type OAuthResult = { refreshToken?: string; }; -// Warning: (ae-missing-release-tag) "OAuthStartRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type OAuthStartRequest = express.Request<{}> & { scope: string; state: OAuthState; }; -// Warning: (ae-missing-release-tag) "OAuthState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type OAuthState = { nonce: string; @@ -424,8 +380,6 @@ export type OidcAuthResult = { userinfo: UserinfoResponse; }; -// Warning: (ae-missing-release-tag) "postMessageResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const postMessageResponse: ( res: express.Response, @@ -445,6 +399,11 @@ export type ProfileInfo = { picture?: string; }; +// @public (undocumented) +export type ProviderFactories = { + [s: string]: AuthProviderFactory; +}; + // @public export const providers: Readonly<{ atlassian: Readonly<{ @@ -692,13 +651,15 @@ export const providers: Readonly<{ }>; }>; -// Warning: (ae-missing-release-tag) "readState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const readState: (stateString: string) => OAuthState; -// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type RedirectInfo = { + url: string; + status?: number; +}; + // @public (undocumented) export interface RouterOptions { // (undocumented) @@ -709,8 +670,6 @@ export interface RouterOptions { discovery: PluginEndpointDiscovery; // (undocumented) logger: Logger; - // Warning: (ae-forgotten-export) The symbol "ProviderFactories" needs to be exported by the entry point index.d.ts - // // (undocumented) providerFactories?: ProviderFactories; // (undocumented) @@ -749,13 +708,9 @@ export type TokenParams = { }; }; -// Warning: (ae-missing-release-tag) "verifyNonce" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const verifyNonce: (req: express.Request, providerId: string) => void; -// Warning: (ae-missing-release-tag) "WebMessageResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type WebMessageResponse = | { diff --git a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts index 502da913af..494e8b4d38 100644 --- a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts +++ b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts @@ -26,17 +26,10 @@ import { } from '@backstage/catalog-model'; import { TokenManager } from '@backstage/backend-common'; -type UserQuery = { - annotations: Record; -}; - -type MemberClaimQuery = { - entityRefs: string[]; - logger?: Logger; -}; - /** * A catalog client tailored for reading out identity data from the catalog. + * + * @public */ export class CatalogIdentityClient { private readonly catalogApi: CatalogApi; @@ -52,7 +45,9 @@ export class CatalogIdentityClient { * * Throws a NotFoundError or ConflictError if 0 or multiple users are found. */ - async findUser(query: UserQuery): Promise { + async findUser(query: { + annotations: Record; + }): Promise { const filter: Record = { kind: 'user', }; @@ -81,7 +76,10 @@ export class CatalogIdentityClient { * * Returns a superset of the entity names that can be passed directly to `issueToken` as `ent`. */ - async resolveCatalogMembership(query: MemberClaimQuery): Promise { + async resolveCatalogMembership(query: { + entityRefs: string[]; + logger?: Logger; + }): Promise { const { entityRefs, logger } = query; const resolvedEntityRefs = entityRefs .map((ref: string) => { diff --git a/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts b/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts index a924c80242..94ac4fba15 100644 --- a/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts +++ b/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts @@ -24,6 +24,7 @@ export const safelyEncodeURIComponent = (value: string) => { return encodeURIComponent(value).replace(/'/g, '%27'); }; +/** @public */ export const postMessageResponse = ( res: express.Response, appOrigin: string, @@ -68,6 +69,7 @@ export const postMessageResponse = ( res.end(``); }; +/** @public */ export const ensuresXRequestedWith = (req: express.Request) => { const requiredHeader = req.header('X-Requested-With'); if (!requiredHeader || requiredHeader !== 'XMLHttpRequest') { diff --git a/plugins/auth-backend/src/lib/flow/types.ts b/plugins/auth-backend/src/lib/flow/types.ts index aaa8b55d1c..f67198a1b0 100644 --- a/plugins/auth-backend/src/lib/flow/types.ts +++ b/plugins/auth-backend/src/lib/flow/types.ts @@ -19,6 +19,8 @@ import { AuthResponse } from '../../providers/types'; /** * Payload sent as a post message after the auth request is complete. * If successful then has a valid payload with Auth information else contains an error. + * + * @public */ export type WebMessageResponse = | { diff --git a/plugins/auth-backend/src/lib/oauth/OAuthAdapter.ts b/plugins/auth-backend/src/lib/oauth/OAuthAdapter.ts index 9c28ed8fad..6caa9fed12 100644 --- a/plugins/auth-backend/src/lib/oauth/OAuthAdapter.ts +++ b/plugins/auth-backend/src/lib/oauth/OAuthAdapter.ts @@ -44,7 +44,8 @@ import { prepareBackstageIdentityResponse } from '../../providers/prepareBacksta export const THOUSAND_DAYS_MS = 1000 * 24 * 60 * 60 * 1000; export const TEN_MINUTES_MS = 600 * 1000; -export type Options = { +/** @public */ +export type OAuthAdapterOptions = { providerId: string; secure: boolean; persistScopes?: boolean; @@ -54,11 +55,16 @@ export type Options = { isOriginAllowed: (origin: string) => boolean; callbackUrl: string; }; + +/** @public */ export class OAuthAdapter implements AuthProviderRouteHandlers { static fromConfig( config: AuthProviderConfig, handlers: OAuthHandlers, - options: Pick, + options: Pick< + OAuthAdapterOptions, + 'providerId' | 'persistScopes' | 'callbackUrl' + >, ): OAuthAdapter { const { origin: appOrigin } = new URL(config.appUrl); @@ -83,7 +89,7 @@ export class OAuthAdapter implements AuthProviderRouteHandlers { constructor( private readonly handlers: OAuthHandlers, - private readonly options: Options, + private readonly options: OAuthAdapterOptions, ) { this.baseCookieOptions = { httpOnly: true, diff --git a/plugins/auth-backend/src/lib/oauth/OAuthEnvironmentHandler.ts b/plugins/auth-backend/src/lib/oauth/OAuthEnvironmentHandler.ts index 95a0547a5e..1c6d45d0a4 100644 --- a/plugins/auth-backend/src/lib/oauth/OAuthEnvironmentHandler.ts +++ b/plugins/auth-backend/src/lib/oauth/OAuthEnvironmentHandler.ts @@ -20,6 +20,7 @@ import { InputError, NotFoundError } from '@backstage/errors'; import { readState } from './helpers'; import { AuthProviderRouteHandlers } from '../../providers/types'; +/** @public */ export class OAuthEnvironmentHandler implements AuthProviderRouteHandlers { static mapConfig( config: Config, diff --git a/plugins/auth-backend/src/lib/oauth/helpers.ts b/plugins/auth-backend/src/lib/oauth/helpers.ts index eec25696a3..63d5d62ef9 100644 --- a/plugins/auth-backend/src/lib/oauth/helpers.ts +++ b/plugins/auth-backend/src/lib/oauth/helpers.ts @@ -19,6 +19,7 @@ import { OAuthState } from './types'; import pickBy from 'lodash/pickBy'; import { CookieConfigurer } from '../../providers/types'; +/** @public */ export const readState = (stateString: string): OAuthState => { const state = Object.fromEntries( new URLSearchParams(Buffer.from(stateString, 'hex').toString('utf-8')), @@ -35,6 +36,7 @@ export const readState = (stateString: string): OAuthState => { return state as OAuthState; }; +/** @public */ export const encodeState = (state: OAuthState): string => { const stateString = new URLSearchParams( pickBy(state, value => value !== undefined), @@ -43,6 +45,7 @@ export const encodeState = (state: OAuthState): string => { return Buffer.from(stateString, 'utf-8').toString('hex'); }; +/** @public */ export const verifyNonce = (req: express.Request, providerId: string) => { const cookieNonce = req.cookies[`${providerId}-nonce`]; const state: OAuthState = readState(req.query.state?.toString() ?? ''); diff --git a/plugins/auth-backend/src/lib/oauth/index.ts b/plugins/auth-backend/src/lib/oauth/index.ts index b7b37f5920..671e8e48e9 100644 --- a/plugins/auth-backend/src/lib/oauth/index.ts +++ b/plugins/auth-backend/src/lib/oauth/index.ts @@ -15,6 +15,7 @@ */ export { OAuthEnvironmentHandler } from './OAuthEnvironmentHandler'; +export type { OAuthAdapterOptions } from './OAuthAdapter'; export { OAuthAdapter } from './OAuthAdapter'; export { encodeState, verifyNonce, readState } from './helpers'; export type { diff --git a/plugins/auth-backend/src/lib/oauth/types.ts b/plugins/auth-backend/src/lib/oauth/types.ts index 6e5fe19859..bfe0aaff50 100644 --- a/plugins/auth-backend/src/lib/oauth/types.ts +++ b/plugins/auth-backend/src/lib/oauth/types.ts @@ -21,6 +21,8 @@ import { RedirectInfo, ProfileInfo } from '../../providers/types'; /** * Common options for passport.js-based OAuth providers + * + * @public */ export type OAuthProviderOptions = { /** @@ -37,6 +39,7 @@ export type OAuthProviderOptions = { callbackUrl: string; }; +/** @public */ export type OAuthResult = { fullProfile: PassportProfile; params: { @@ -59,6 +62,7 @@ export type OAuthResponse = { backstageIdentity?: BackstageSignInResult; }; +/** @public */ export type OAuthProviderInfo = { /** * An access token issued for the signed in user. @@ -78,6 +82,7 @@ export type OAuthProviderInfo = { scope: string; }; +/** @public */ export type OAuthState = { /* A type for the serialized value in the `state` parameter of the OAuth authorization flow */ @@ -87,11 +92,13 @@ export type OAuthState = { scope?: string; }; +/** @public */ export type OAuthStartRequest = express.Request<{}> & { scope: string; state: OAuthState; }; +/** @public */ export type OAuthRefreshRequest = express.Request<{}> & { scope: string; refreshToken: string; diff --git a/plugins/auth-backend/src/providers/atlassian/index.ts b/plugins/auth-backend/src/providers/atlassian/index.ts index 8dff0197a3..f001463694 100644 --- a/plugins/auth-backend/src/providers/atlassian/index.ts +++ b/plugins/auth-backend/src/providers/atlassian/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { atlassian, AtlassianAuthProvider } from './provider'; +export { atlassian } from './provider'; diff --git a/plugins/auth-backend/src/providers/atlassian/provider.ts b/plugins/auth-backend/src/providers/atlassian/provider.ts index b693d226a2..eb6890a5a4 100644 --- a/plugins/auth-backend/src/providers/atlassian/provider.ts +++ b/plugins/auth-backend/src/providers/atlassian/provider.ts @@ -44,6 +44,7 @@ import { import express from 'express'; import { createAuthProviderIntegration } from '../createAuthProviderIntegration'; +/** @public */ export type AtlassianAuthProviderOptions = OAuthProviderOptions & { scopes: string; signInResolver?: SignInResolver; @@ -58,10 +59,6 @@ export const atlassianDefaultAuthHandler: AuthHandler = async ({ profile: makeProfileInfo(fullProfile, params.id_token), }); -/** - * @public - * @deprecated This export is deprecated and will be removed in the future. - */ export class AtlassianAuthProvider implements OAuthHandlers { private readonly _strategy: AtlassianStrategy; private readonly signInResolver?: SignInResolver; diff --git a/plugins/auth-backend/src/providers/bitbucket/provider.ts b/plugins/auth-backend/src/providers/bitbucket/provider.ts index e3bd044466..0bbebd2097 100644 --- a/plugins/auth-backend/src/providers/bitbucket/provider.ts +++ b/plugins/auth-backend/src/providers/bitbucket/provider.ts @@ -54,6 +54,7 @@ type Options = OAuthProviderOptions & { resolverContext: AuthResolverContext; }; +/** @public */ export type BitbucketOAuthResult = { fullProfile: BitbucketPassportProfile; params: { @@ -65,6 +66,7 @@ export type BitbucketOAuthResult = { refreshToken?: string; }; +/** @public */ export type BitbucketPassportProfile = PassportProfile & { id?: string; displayName?: string; diff --git a/plugins/auth-backend/src/providers/cloudflare-access/provider.ts b/plugins/auth-backend/src/providers/cloudflare-access/provider.ts index a2c16fcebf..4f9730dfaf 100644 --- a/plugins/auth-backend/src/providers/cloudflare-access/provider.ts +++ b/plugins/auth-backend/src/providers/cloudflare-access/provider.ts @@ -146,7 +146,6 @@ export type CloudflareAccessIdentityProfile = { }; /** - * * @public */ export type CloudflareAccessResult = { diff --git a/plugins/auth-backend/src/providers/createAuthProviderIntegration.ts b/plugins/auth-backend/src/providers/createAuthProviderIntegration.ts index c6e9107353..9143d63143 100644 --- a/plugins/auth-backend/src/providers/createAuthProviderIntegration.ts +++ b/plugins/auth-backend/src/providers/createAuthProviderIntegration.ts @@ -22,6 +22,8 @@ import { AuthProviderFactory, SignInResolver } from './types'; * * The returned object facilitates the creation of provider instances, and * supplies built-in sign-in resolvers for the specific provider. + * + * @public */ export function createAuthProviderIntegration< TCreateOptions extends unknown[], diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index 9c115b5eb8..4ac91516a3 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -52,6 +52,7 @@ type PrivateInfo = { refreshToken?: string; }; +/** @public */ export type GithubOAuthResult = { fullProfile: PassportProfile; params: { diff --git a/plugins/auth-backend/src/providers/index.ts b/plugins/auth-backend/src/providers/index.ts index 83dd1c6c1f..e0860d3f78 100644 --- a/plugins/auth-backend/src/providers/index.ts +++ b/plugins/auth-backend/src/providers/index.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -export { AtlassianAuthProvider } from './atlassian'; export type { AwsAlbResult } from './aws-alb'; export type { BitbucketOAuthResult, @@ -50,6 +49,7 @@ export type { StateEncoder, AuthResponse, ProfileInfo, + RedirectInfo, } from './types'; export { prepareBackstageIdentityResponse } from './prepareBackstageIdentityResponse'; diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index c99bdfbadb..f0f94f1936 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -126,6 +126,7 @@ export type AuthProviderConfig = { cookieConfigurer?: CookieConfigurer; }; +/** @public */ export type RedirectInfo = { /** * URL to redirect to @@ -147,6 +148,8 @@ export type RedirectInfo = { * `/auth/[provider]/handler/frame -> frameHandler` * `/auth/[provider]/refresh -> refresh` * `/auth/[provider]/logout -> logout` + * + * @public */ export interface AuthProviderRouteHandlers { /** @@ -192,6 +195,7 @@ export interface AuthProviderRouteHandlers { logout?(req: express.Request, res: express.Response): Promise; } +/** @public */ export type AuthProviderFactory = (options: { providerId: string; globalConfig: AuthProviderConfig; diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index e4fa5eeea4..8fd758f1b4 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -36,8 +36,10 @@ import passport from 'passport'; import { Minimatch } from 'minimatch'; import { CatalogAuthResolverContext } from '../lib/resolvers'; -type ProviderFactories = { [s: string]: AuthProviderFactory }; +/** @public */ +export type ProviderFactories = { [s: string]: AuthProviderFactory }; +/** @public */ export interface RouterOptions { logger: Logger; database: PluginDatabaseManager; @@ -48,6 +50,7 @@ export interface RouterOptions { providerFactories?: ProviderFactories; } +/** @public */ export async function createRouter( options: RouterOptions, ): Promise { @@ -187,6 +190,7 @@ export async function createRouter( return router; } +/** @public */ export function createOriginFilter( config: Config, ): (origin: string) => boolean { diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 1239cfd935..a68aa62249 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -199,7 +199,6 @@ const PACKAGE_ROOTS = ['packages', 'plugins']; const ALLOW_WARNINGS = [ 'packages/core-components', - 'plugins/auth-backend', 'plugins/catalog', 'plugins/catalog-graphql', 'plugins/catalog-import', From 7f7cbf1796b1bc3b95f6418647d41fd987d1624a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:03:47 +0200 Subject: [PATCH 22/41] catalog, but just partial MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog/api-report.md | 19 ++++++++++++------- .../EntityLinksCard/EntityLinksCard.tsx | 4 ++-- .../src/components/EntityLinksCard/index.ts | 1 + .../src/components/EntityLinksCard/types.ts | 2 ++ plugins/catalog/src/index.ts | 3 +++ plugins/catalog/src/options.ts | 1 + 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 98bc7ab89e..f3bec2ba43 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -64,12 +64,20 @@ export type BackstageOverrides = Overrides & { >; }; +// @public (undocumented) +export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; + // @public (undocumented) export const CatalogEntityPage: () => JSX.Element; // @public (undocumented) export const CatalogIndexPage: (props: DefaultCatalogPageProps) => JSX.Element; +// @public (undocumented) +export type CatalogInputPluginOptions = { + createButtonTitle: string; +}; + // @public (undocumented) export function CatalogKindHeader(props: CatalogKindHeaderProps): JSX.Element; @@ -79,8 +87,6 @@ export interface CatalogKindHeaderProps { initialFilter?: string; } -// Warning: (ae-forgotten-export) The symbol "CatalogInputPluginOptions" needs to be exported by the entry point index.d.ts -// // @public (undocumented) export const catalogPlugin: BackstagePlugin< { @@ -176,6 +182,9 @@ export interface CatalogTableRow { }; } +// @public (undocumented) +export type ColumnBreakpoints = Record; + // @public export interface DefaultCatalogPageProps { // (undocumented) @@ -296,15 +305,11 @@ export type EntityLayoutRouteProps = { >; }; -// Warning: (ae-forgotten-export) The symbol "EntityLinksCard" needs to be exported by the entry point index.d.ts -// // @public (undocumented) -export const EntityLinksCard: EntityLinksCard_2; +export const EntityLinksCard: (props: EntityLinksCardProps) => JSX.Element; // @public (undocumented) export interface EntityLinksCardProps { - // Warning: (ae-forgotten-export) The symbol "ColumnBreakpoints" needs to be exported by the entry point index.d.ts - // // (undocumented) cols?: ColumnBreakpoints | number; // (undocumented) diff --git a/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx b/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx index 10302d7837..ebc551c29f 100644 --- a/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx +++ b/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx @@ -29,7 +29,7 @@ export interface EntityLinksCardProps { variant?: InfoCardVariants; } -export function EntityLinksCard(props: EntityLinksCardProps) { +export const EntityLinksCard = (props: EntityLinksCardProps) => { const { cols = undefined, variant } = props; const { entity } = useEntity(); const app = useApp(); @@ -55,4 +55,4 @@ export function EntityLinksCard(props: EntityLinksCardProps) { )} ); -} +}; diff --git a/plugins/catalog/src/components/EntityLinksCard/index.ts b/plugins/catalog/src/components/EntityLinksCard/index.ts index dcd4366066..eb3beda6ea 100644 --- a/plugins/catalog/src/components/EntityLinksCard/index.ts +++ b/plugins/catalog/src/components/EntityLinksCard/index.ts @@ -17,3 +17,4 @@ export { EntityLinksCard } from './EntityLinksCard'; export type { EntityLinksCardProps } from './EntityLinksCard'; export type { EntityLinksEmptyStateClassKey } from './EntityLinksEmptyState'; +export type { Breakpoint, ColumnBreakpoints } from './types'; diff --git a/plugins/catalog/src/components/EntityLinksCard/types.ts b/plugins/catalog/src/components/EntityLinksCard/types.ts index e3cd1a94ac..fdd9c9c07c 100644 --- a/plugins/catalog/src/components/EntityLinksCard/types.ts +++ b/plugins/catalog/src/components/EntityLinksCard/types.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +/** @public */ export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; +/** @public */ export type ColumnBreakpoints = Record; diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index f0f94656d5..a69d4004a1 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -37,6 +37,7 @@ export * from './components/EntityProcessingErrorsPanel'; export * from './components/EntitySwitch'; export * from './components/FilteredEntityLayout'; export * from './overridableComponents'; +export type { CatalogInputPluginOptions } from './options'; export { CatalogEntityPage, CatalogIndexPage, @@ -59,6 +60,8 @@ export type { DependsOnResourcesCardProps } from './components/DependsOnResource export type { EntityLinksEmptyStateClassKey, EntityLinksCardProps, + Breakpoint, + ColumnBreakpoints, } from './components/EntityLinksCard'; export type { SystemDiagramCardClassKey } from './components/SystemDiagramCard'; export type { DefaultCatalogPageProps } from './components/CatalogPage'; diff --git a/plugins/catalog/src/options.ts b/plugins/catalog/src/options.ts index 1d8b972ec2..4061f512ac 100644 --- a/plugins/catalog/src/options.ts +++ b/plugins/catalog/src/options.ts @@ -20,6 +20,7 @@ export type CatalogPluginOptions = { createButtonTitle: string; }; +/** @public */ export type CatalogInputPluginOptions = { createButtonTitle: string; }; From 8b0d2528fbce2364ed78865f8fd4b6edce3fb36d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:05:29 +0200 Subject: [PATCH 23/41] catalog-graphql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog-graphql/api-report.md | 4 ---- plugins/catalog-graphql/src/graphql/module.ts | 2 ++ scripts/api-extractor.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-graphql/api-report.md b/plugins/catalog-graphql/api-report.md index e14fd988d0..f03ed94af5 100644 --- a/plugins/catalog-graphql/api-report.md +++ b/plugins/catalog-graphql/api-report.md @@ -7,13 +7,9 @@ import { Config } from '@backstage/config'; import { Logger } from 'winston'; import { Module } from 'graphql-modules'; -// Warning: (ae-missing-release-tag) "createModule" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createModule(options: ModuleOptions): Promise; -// Warning: (ae-missing-release-tag) "ModuleOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ModuleOptions { // (undocumented) diff --git a/plugins/catalog-graphql/src/graphql/module.ts b/plugins/catalog-graphql/src/graphql/module.ts index e33ee429b4..e27adbbaf1 100644 --- a/plugins/catalog-graphql/src/graphql/module.ts +++ b/plugins/catalog-graphql/src/graphql/module.ts @@ -27,11 +27,13 @@ import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json'; import { Entity } from '@backstage/catalog-model'; import typeDefs from '../schema'; +/** @public */ export interface ModuleOptions { logger: Logger; config: Config; } +/** @public */ export async function createModule(options: ModuleOptions): Promise { const catalogClient = new CatalogClient( options.config.getString('backend.baseUrl'), diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index a68aa62249..18031e5486 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -200,7 +200,6 @@ const PACKAGE_ROOTS = ['packages', 'plugins']; const ALLOW_WARNINGS = [ 'packages/core-components', 'plugins/catalog', - 'plugins/catalog-graphql', 'plugins/catalog-import', 'plugins/cicd-statistics', 'plugins/circleci', From 842cc7ab0692aa1ed427d94f20d9d782668b18d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:36:21 +0200 Subject: [PATCH 24/41] ilert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/ilert/api-report.md | 592 ++++++++++++++++-- plugins/ilert/src/api/client.ts | 18 +- plugins/ilert/src/api/index.ts | 1 + plugins/ilert/src/api/types.ts | 22 +- .../src/components/ILertCard/ILertCard.tsx | 2 + .../src/components/ILertPage/ILertPage.tsx | 1 + plugins/ilert/src/index.ts | 3 + plugins/ilert/src/plugin.ts | 3 + plugins/ilert/src/route-refs.tsx | 1 + plugins/ilert/src/types.ts | 41 ++ scripts/api-extractor.ts | 1 - 11 files changed, 613 insertions(+), 72 deletions(-) diff --git a/plugins/ilert/api-report.md b/plugins/ilert/api-report.md index a4e6a7a76c..96576a8358 100644 --- a/plugins/ilert/api-report.md +++ b/plugins/ilert/api-report.md @@ -13,20 +13,252 @@ import { Entity } from '@backstage/catalog-model'; import { IconComponent } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "EntityILertCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export const ACCEPTED = 'ACCEPTED'; + +// @public (undocumented) +export interface AlertSource { + // (undocumented) + active?: boolean; + // (undocumented) + autoResolutionTimeout?: string; + // (undocumented) + autotaskMetadata?: AlertSourceAutotaskMetadata; + // (undocumented) + darkIconUrl?: string; + // (undocumented) + emailFiltered?: boolean; + // (undocumented) + emailPredicates?: AlertSourceEmailPredicate[]; + // (undocumented) + emailResolveFiltered?: boolean; + // (undocumented) + emailResolvePredicates?: AlertSourceEmailPredicate[]; + // (undocumented) + escalationPolicy: EscalationPolicy; + // (undocumented) + filterOperator?: AlertSourceFilterOperator; + // (undocumented) + heartbeat?: AlertSourceHeartbeat; + // (undocumented) + iconUrl?: string; + // (undocumented) + id: number; + // (undocumented) + incidentCreation?: AlertSourceIncidentCreation; + // (undocumented) + incidentPriorityRule?: AlertSourceIncidentPriorityRule; + // (undocumented) + integrationKey?: string; + // (undocumented) + integrationType: AlertSourceIntegrationType; + // (undocumented) + lightIconUrl?: string; + // (undocumented) + name: string; + // (undocumented) + resolveFilterOperator?: AlertSourceFilterOperator; + // (undocumented) + status: AlertSourceStatus; + // (undocumented) + supportHours?: AlertSourceSupportHours; + // (undocumented) + teams: TeamShort[]; +} + +// @public (undocumented) +export interface AlertSourceAutotaskMetadata { + // (undocumented) + apiIntegrationCode: string; + // (undocumented) + secret: string; + // (undocumented) + userName: string; + // (undocumented) + webServer: string; +} + +// @public (undocumented) +export interface AlertSourceEmailPredicate { + // (undocumented) + criteria: + | 'CONTAINS_ANY_WORDS' + | 'CONTAINS_NOT_WORDS' + | 'CONTAINS_STRING' + | 'CONTAINS_NOT_STRING' + | 'IS_STRING' + | 'IS_NOT_STRING' + | 'MATCHES_REGEX' + | 'MATCHES_NOT_REGEX'; + // (undocumented) + field: 'EMAIL_FROM' | 'EMAIL_SUBJECT' | 'EMAIL_BODY'; + // (undocumented) + value: string; +} + +// @public (undocumented) +export type AlertSourceFilterOperator = 'AND' | 'OR'; + +// @public (undocumented) +export interface AlertSourceHeartbeat { + // (undocumented) + intervalSec: number; + // (undocumented) + status: 'OVERDUE' | 'ON_TIME' | 'NEVER_RECEIVED'; + // (undocumented) + summary: string; +} + +// @public (undocumented) +export type AlertSourceIncidentCreation = + | 'ONE_INCIDENT_PER_EMAIL' + | 'ONE_INCIDENT_PER_EMAIL_SUBJECT' + | 'ONE_PENDING_INCIDENT_ALLOWED' + | 'ONE_OPEN_INCIDENT_ALLOWED' + | 'OPEN_RESOLVE_ON_EXTRACTION'; + +// @public (undocumented) +export type AlertSourceIncidentPriorityRule = + | 'HIGH' + | 'LOW' + | 'HIGH_DURING_SUPPORT_HOURS' + | 'LOW_DURING_SUPPORT_HOURS'; + +// @public (undocumented) +export type AlertSourceIntegrationType = + | 'NAGIOS' + | 'ICINGA' + | 'EMAIL' + | 'SMS' + | 'API' + | 'CRN' + | 'HEARTBEAT' + | 'PRTG' + | 'PINGDOM' + | 'CLOUDWATCH' + | 'AWSPHD' + | 'STACKDRIVER' + | 'INSTANA' + | 'ZABBIX' + | 'SOLARWINDS' + | 'PROMETHEUS' + | 'NEWRELIC' + | 'GRAFANA' + | 'GITHUB' + | 'DATADOG' + | 'UPTIMEROBOT' + | 'APPDYNAMICS' + | 'DYNATRACE' + | 'TOPDESK' + | 'STATUSCAKE' + | 'MONITOR' + | 'TOOL' + | 'CHECKMK' + | 'AUTOTASK' + | 'AWSBUDGET' + | 'KENTIXAM' + | 'CONSUL' + | 'ZAMMAD' + | 'SIGNALFX' + | 'SPLUNK' + | 'KUBERNETES' + | 'SEMATEXT' + | 'SENTRY' + | 'SUMOLOGIC' + | 'RAYGUN' + | 'MXTOOLBOX' + | 'ESWATCHER' + | 'AMAZONSNS' + | 'KAPACITOR' + | 'CORTEXXSOAR' + | string; + +// @public (undocumented) +export type AlertSourceStatus = + | 'PENDING' + | 'ALL_ACCEPTED' + | 'ALL_RESOLVED' + | 'IN_MAINTENANCE' + | 'DISABLED'; + +// @public (undocumented) +export interface AlertSourceSupportDay { + // (undocumented) + end: string; + // (undocumented) + start: string; +} + +// @public (undocumented) +export interface AlertSourceSupportHours { + // (undocumented) + autoRaiseIncidents: boolean; + // (undocumented) + supportDays: { + MONDAY: AlertSourceSupportDay; + TUESDAY: AlertSourceSupportDay; + WEDNESDAY: AlertSourceSupportDay; + THURSDAY: AlertSourceSupportDay; + FRIDAY: AlertSourceSupportDay; + SATURDAY: AlertSourceSupportDay; + SUNDAY: AlertSourceSupportDay; + }; + // (undocumented) + timezone: AlertSourceTimeZone; +} + +// @public (undocumented) +export type AlertSourceTimeZone = + | 'Europe/Berlin' + | 'America/New_York' + | 'America/Los_Angeles' + | 'Asia/Istanbul'; + // @public (undocumented) export const EntityILertCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "GetIncidentsCountOpts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export interface EscalationPolicy { + // (undocumented) + escalationRules: EscalationRule[]; + // (undocumented) + frequency?: number; + // (undocumented) + id: number; + // (undocumented) + name: string; + // (undocumented) + newEscalationRule: EscalationRule; + // (undocumented) + repeating?: boolean; + // (undocumented) + teams: TeamShort[]; +} + +// @public (undocumented) +export interface EscalationRule { + // (undocumented) + escalationTimeout: number; + // (undocumented) + schedule: Schedule | null; + // (undocumented) + user: User | null; +} + +// @public (undocumented) +export type EventRequest = { + integrationKey: string; + summary: string; + details: string; + userName: string; + source: string; +}; + // @public (undocumented) export type GetIncidentsCountOpts = { states?: IncidentStatus[]; }; -// Warning: (ae-missing-release-tag) "GetIncidentsOpts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GetIncidentsOpts = { maxResults?: number; @@ -35,8 +267,6 @@ export type GetIncidentsOpts = { alertSources?: number[]; }; -// Warning: (ae-missing-release-tag) "ILertApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ILertApi { // (undocumented) @@ -51,8 +281,6 @@ export interface ILertApi { incident: Incident, responder: IncidentResponder, ): Promise; - // Warning: (ae-forgotten-export) The symbol "EventRequest" needs to be exported by the entry point index.d.ts - // // (undocumented) createIncident(eventRequest: EventRequest): Promise; // (undocumented) @@ -61,48 +289,30 @@ export interface ILertApi { enableAlertSource(alertSource: AlertSource): Promise; // (undocumented) fetchAlertSource(idOrIntegrationKey: number | string): Promise; - // Warning: (ae-forgotten-export) The symbol "OnCall" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchAlertSourceOnCalls(alertSource: AlertSource): Promise; - // Warning: (ae-forgotten-export) The symbol "AlertSource" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchAlertSources(): Promise; // (undocumented) fetchIncident(id: number): Promise; - // Warning: (ae-forgotten-export) The symbol "IncidentAction" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchIncidentActions(incident: Incident): Promise; - // Warning: (ae-forgotten-export) The symbol "IncidentResponder" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchIncidentResponders(incident: Incident): Promise; - // Warning: (ae-forgotten-export) The symbol "Incident" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchIncidents(opts?: GetIncidentsOpts): Promise; // (undocumented) fetchIncidentsCount(opts?: GetIncidentsCountOpts): Promise; - // Warning: (ae-forgotten-export) The symbol "Schedule" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchOnCallSchedules(): Promise; // (undocumented) fetchUptimeMonitor(id: number): Promise; - // Warning: (ae-forgotten-export) The symbol "UptimeMonitor" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchUptimeMonitors(): Promise; - // Warning: (ae-forgotten-export) The symbol "User" needs to be exported by the entry point index.d.ts - // // (undocumented) fetchUsers(): Promise; // (undocumented) getAlertSourceDetailsURL(alertSource: AlertSource | null): string; - // Warning: (ae-forgotten-export) The symbol "EscalationPolicy" needs to be exported by the entry point index.d.ts - // // (undocumented) getEscalationPolicyDetailsURL(escalationPolicy: EscalationPolicy): string; // (undocumented) @@ -135,22 +345,19 @@ export interface ILertApi { ): Promise; } -// Warning: (ae-missing-release-tag) "ilertApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ilertApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "ILertCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ILertCard: () => JSX.Element; -// Warning: (ae-missing-release-tag) "ILertClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class ILertClient implements ILertApi { - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - constructor(opts: Options); + constructor(opts: { + discoveryApi: DiscoveryApi; + baseUrl: string; + proxyPath: string; + }); // (undocumented) acceptIncident(incident: Incident, userName: string): Promise; // (undocumented) @@ -232,18 +439,12 @@ export class ILertClient implements ILertApi { ): Promise; } -// Warning: (ae-missing-release-tag) "ILertIcon" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ILertIcon: IconComponent; -// Warning: (ae-missing-release-tag) "ILertPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const ILertPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "ilertPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const ilertPlugin: BackstagePlugin< { @@ -255,34 +456,319 @@ const ilertPlugin: BackstagePlugin< export { ilertPlugin }; export { ilertPlugin as plugin }; -// Warning: (ae-missing-release-tag) "iLertRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const iLertRouteRef: RouteRef; -// Warning: (ae-missing-release-tag) "isPluginApplicableToEntity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +interface Image_2 { + // (undocumented) + alt: string; + // (undocumented) + href: string; + // (undocumented) + src: string; +} +export { Image_2 as Image }; + +// @public (undocumented) +export interface Incident { + // (undocumented) + alertSource: AlertSource | null; + // (undocumented) + assignedTo: User | null; + // (undocumented) + commentPublishToSubscribers: boolean; + // (undocumented) + commentText: string; + // (undocumented) + details: string; + // (undocumented) + id: number; + // (undocumented) + images: Image_2[]; + // (undocumented) + incidentKey: string; + // (undocumented) + links: Link[]; + // (undocumented) + logEntries: LogEntry[]; + // (undocumented) + priority: IncidentPriority; + // (undocumented) + reportTime: string; + // (undocumented) + resolvedOn: string; + // (undocumented) + status: IncidentStatus; + // (undocumented) + subscribers: Subscriber[]; + // (undocumented) + summary: string; +} + +// @public (undocumented) +export interface IncidentAction { + // (undocumented) + extensionId?: string; + // (undocumented) + history?: IncidentActionHistory[]; + // (undocumented) + name: string; + // (undocumented) + type: string; + // (undocumented) + webhookId: string; +} + +// @public (undocumented) +export interface IncidentActionHistory { + // (undocumented) + actor: User; + // (undocumented) + id: string; + // (undocumented) + incidentId: number; + // (undocumented) + success: boolean; + // (undocumented) + webhookId: string; +} + +// @public (undocumented) +export type IncidentPriority = 'HIGH' | 'LOW'; + +// @public (undocumented) +export interface IncidentResponder { + // (undocumented) + disabled: boolean; + // (undocumented) + group: 'SUGGESTED' | 'USER' | 'ESCALATION_POLICY' | 'ON_CALL_SCHEDULE'; + // (undocumented) + id: number; + // (undocumented) + name: string; +} + +// @public (undocumented) +export type IncidentStatus = typeof PENDING | typeof ACCEPTED | typeof RESOLVED; + // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; export { isPluginApplicableToEntity as isILertAvailable }; export { isPluginApplicableToEntity }; -// Warning: (ae-missing-release-tag) "ILertPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type Language = 'de' | 'en'; + +// @public (undocumented) +export interface Link { + // (undocumented) + href: string; + // (undocumented) + text: string; +} + +// @public (undocumented) +export interface LogEntry { + // (undocumented) + filterTypes?: string[]; + // (undocumented) + iconClass?: string; + // (undocumented) + iconName?: string; + // (undocumented) + id: number; + // (undocumented) + incidentId?: number; + // (undocumented) + logEntryType: string; + // (undocumented) + text: string; + // (undocumented) + timestamp: string; +} + +// @public (undocumented) +export interface OnCall { + // (undocumented) + end: string; + // (undocumented) + escalationLevel: number; + // (undocumented) + escalationPolicy: EscalationPolicy; + // (undocumented) + schedule?: Schedule; + // (undocumented) + start: string; + // (undocumented) + user: User; +} + +// @public (undocumented) +export const PENDING = 'PENDING'; + +// @public (undocumented) +export interface Phone { + // (undocumented) + number: string; + // (undocumented) + regionCode: string; +} + +// @public (undocumented) +export const RESOLVED = 'RESOLVED'; + // @public (undocumented) export const Router: () => JSX.Element; -// Warning: (ae-missing-release-tag) "TableState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export interface Schedule { + // (undocumented) + currentShift: Shift; + // (undocumented) + id: number; + // (undocumented) + name: string; + // (undocumented) + nextShift: Shift; + // (undocumented) + overrides: Shift[]; + // (undocumented) + shifts: Shift[]; + // (undocumented) + startsOn: string; + // (undocumented) + teams: TeamShort[]; + // (undocumented) + timezone: string; +} + +// @public (undocumented) +export interface Shift { + // (undocumented) + end: string; + // (undocumented) + start: string; + // (undocumented) + user: User; +} + +// @public (undocumented) +export interface Subscriber { + // (undocumented) + id: number; + // (undocumented) + name: string; + // (undocumented) + type: SubscriberType; +} + +// @public (undocumented) +export type SubscriberType = 'TEAM' | 'USER'; + // @public (undocumented) export type TableState = { page: number; pageSize: number; }; -// Warnings were encountered during analysis: -// -// src/api/types.d.ts:14:5 - (ae-forgotten-export) The symbol "IncidentStatus" needs to be exported by the entry point index.d.ts +// @public (undocumented) +export interface TeamMember { + // (undocumented) + role: 'STAKEHOLDER' | 'RESPONDER' | 'USER' | 'ADMIN'; + // (undocumented) + user: User; +} + +// @public (undocumented) +export interface TeamShort { + // (undocumented) + id: number; + // (undocumented) + name: string; +} + +// @public (undocumented) +export interface UptimeMonitor { + // (undocumented) + checkParams: UptimeMonitorCheckParams; + // (undocumented) + checkType: 'http' | 'tcp' | 'udp' | 'ping'; + // (undocumented) + createIncidentAfterFailedChecks: number; + // (undocumented) + embedUrl: string; + // (undocumented) + escalationPolicy: EscalationPolicy; + // (undocumented) + id: number; + // (undocumented) + intervalSec: number; + // (undocumented) + lastStatusChange: string; + // (undocumented) + name: string; + // (undocumented) + paused: boolean; + // (undocumented) + region: 'EU' | 'US'; + // (undocumented) + shareUrl: string; + // (undocumented) + status: string; + // (undocumented) + teams: TeamShort[]; + // (undocumented) + timeoutMs: number; +} + +// @public (undocumented) +export interface UptimeMonitorCheckParams { + // (undocumented) + host?: string; + // (undocumented) + port?: number; + // (undocumented) + url?: string; +} + +// @public (undocumented) +export interface User { + // (undocumented) + department: string; + // (undocumented) + email: string; + // (undocumented) + firstName: string; + // (undocumented) + id: number; + // (undocumented) + landline: Phone; + // (undocumented) + language?: Language; + // (undocumented) + lastName: string; + // (undocumented) + mobile: Phone; + // (undocumented) + notificationPreferences?: any[]; + // (undocumented) + position: string; + // (undocumented) + role?: UserRole; + // (undocumented) + timezone?: string; + // (undocumented) + username: string; +} + +// @public (undocumented) +export type UserRole = + | 'USER' + | 'ADMIN' + | 'STAKEHOLDER' + | 'ACCOUNT_OWNER' + | 'RESPONDER'; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/ilert/src/api/client.ts b/plugins/ilert/src/api/client.ts index 13de8c1f2c..7ab9a6d08c 100644 --- a/plugins/ilert/src/api/client.ts +++ b/plugins/ilert/src/api/client.ts @@ -29,7 +29,6 @@ import { ILertApi, GetIncidentsOpts, GetIncidentsCountOpts, - Options, EventRequest, } from './types'; import { DateTime as dt } from 'luxon'; @@ -39,6 +38,7 @@ import { DiscoveryApi, } from '@backstage/core-plugin-api'; +/** @public */ export const ilertApiRef = createApiRef({ id: 'plugin.ilert.service', }); @@ -49,6 +49,7 @@ const JSON_HEADERS = { Accept: 'application/json', }; +/** @public */ export class ILertClient implements ILertApi { private readonly discoveryApi: DiscoveryApi; private readonly proxyPath: string; @@ -66,7 +67,20 @@ export class ILertClient implements ILertApi { }); } - constructor(opts: Options) { + constructor(opts: { + discoveryApi: DiscoveryApi; + + /** + * URL used by users to access iLert web UI. + * Example: https://my-org.ilert.com/ + */ + baseUrl: string; + + /** + * Path to use for requests via the proxy, defaults to /ilert/api + */ + proxyPath: string; + }) { this.discoveryApi = opts.discoveryApi; this.baseUrl = opts.baseUrl; this.proxyPath = opts.proxyPath; diff --git a/plugins/ilert/src/api/index.ts b/plugins/ilert/src/api/index.ts index 02ee9706f7..e1163090ec 100644 --- a/plugins/ilert/src/api/index.ts +++ b/plugins/ilert/src/api/index.ts @@ -17,6 +17,7 @@ export { ILertClient, ilertApiRef } from './client'; export type { ILertApi, + EventRequest, GetIncidentsCountOpts, GetIncidentsOpts, TableState, diff --git a/plugins/ilert/src/api/types.ts b/plugins/ilert/src/api/types.ts index 3a085bdb5b..2e9ea30f2f 100644 --- a/plugins/ilert/src/api/types.ts +++ b/plugins/ilert/src/api/types.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AlertSource, Incident, @@ -25,13 +26,14 @@ import { IncidentAction, OnCall, } from '../types'; -import { DiscoveryApi } from '@backstage/core-plugin-api'; +/** @public */ export type TableState = { page: number; pageSize: number; }; +/** @public */ export type GetIncidentsOpts = { maxResults?: number; startIndex?: number; @@ -39,10 +41,12 @@ export type GetIncidentsOpts = { alertSources?: number[]; }; +/** @public */ export type GetIncidentsCountOpts = { states?: IncidentStatus[]; }; +/** @public */ export type EventRequest = { integrationKey: string; summary: string; @@ -51,6 +55,7 @@ export type EventRequest = { source: string; }; +/** @public */ export interface ILertApi { fetchIncidents(opts?: GetIncidentsOpts): Promise; fetchIncidentsCount(opts?: GetIncidentsCountOpts): Promise; @@ -103,18 +108,3 @@ export interface ILertApi { getUserPhoneNumber(user: User | null): string; getUserInitials(user: User | null): string; } - -export type Options = { - discoveryApi: DiscoveryApi; - - /** - * URL used by users to access iLert web UI. - * Example: https://my-org.ilert.com/ - */ - baseUrl: string; - - /** - * Path to use for requests via the proxy, defaults to /ilert/api - */ - proxyPath: string; -}; diff --git a/plugins/ilert/src/components/ILertCard/ILertCard.tsx b/plugins/ilert/src/components/ILertCard/ILertCard.tsx index a014c265c2..6330189a01 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCard.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCard.tsx @@ -35,6 +35,7 @@ import { ILertCardEmptyState } from './ILertCardEmptyState'; import { ILertCardOnCall } from './ILertCardOnCall'; import { ResponseErrorPanel } from '@backstage/core-components'; +/** @public */ export const isPluginApplicableToEntity = (entity: Entity) => Boolean(entity.metadata.annotations?.[ILERT_INTEGRATION_KEY_ANNOTATION]); @@ -50,6 +51,7 @@ const useStyles = makeStyles({ }, }); +/** @public */ export const ILertCard = () => { const classes = useStyles(); const { integrationKey, name } = useILertEntity(); diff --git a/plugins/ilert/src/components/ILertPage/ILertPage.tsx b/plugins/ilert/src/components/ILertPage/ILertPage.tsx index c532cd7f64..89dae215e4 100644 --- a/plugins/ilert/src/components/ILertPage/ILertPage.tsx +++ b/plugins/ilert/src/components/ILertPage/ILertPage.tsx @@ -25,6 +25,7 @@ import { Content, } from '@backstage/core-components'; +/** @public */ export const ILertPage = () => { const [selectedTab, setSelectedTab] = React.useState(0); const tabs = [ diff --git a/plugins/ilert/src/index.ts b/plugins/ilert/src/index.ts index 9a3119516f..5fcf42011b 100644 --- a/plugins/ilert/src/index.ts +++ b/plugins/ilert/src/index.ts @@ -37,4 +37,7 @@ export { } from './components'; export * from './api'; export * from './route-refs'; +export * from './types'; + +/** @public */ export const ILertIcon: IconComponent = ILertIconComponent as IconComponent; diff --git a/plugins/ilert/src/plugin.ts b/plugins/ilert/src/plugin.ts index 89df59b0b6..96e57e6f48 100644 --- a/plugins/ilert/src/plugin.ts +++ b/plugins/ilert/src/plugin.ts @@ -25,6 +25,7 @@ import { createComponentExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const ilertPlugin = createPlugin({ id: 'ilert', apis: [ @@ -44,6 +45,7 @@ export const ilertPlugin = createPlugin({ }, }); +/** @public */ export const ILertPage = ilertPlugin.provide( createRoutableExtension({ name: 'ILertPage', @@ -52,6 +54,7 @@ export const ILertPage = ilertPlugin.provide( }), ); +/** @public */ export const EntityILertCard = ilertPlugin.provide( createComponentExtension({ name: 'EntityILertCard', diff --git a/plugins/ilert/src/route-refs.tsx b/plugins/ilert/src/route-refs.tsx index 8a3d53001d..fd61bd2bbd 100644 --- a/plugins/ilert/src/route-refs.tsx +++ b/plugins/ilert/src/route-refs.tsx @@ -16,6 +16,7 @@ import { createRouteRef } from '@backstage/core-plugin-api'; +/** @public */ export const iLertRouteRef = createRouteRef({ id: 'ilert', }); diff --git a/plugins/ilert/src/types.ts b/plugins/ilert/src/types.ts index c3e863c6a6..3d1531329a 100644 --- a/plugins/ilert/src/types.ts +++ b/plugins/ilert/src/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export interface Incident { id: number; summary: string; @@ -33,31 +34,43 @@ export interface Incident { commentPublishToSubscribers: boolean; } +/** @public */ export const PENDING = 'PENDING'; +/** @public */ export const ACCEPTED = 'ACCEPTED'; +/** @public */ export const RESOLVED = 'RESOLVED'; + +/** @public */ export type IncidentStatus = typeof PENDING | typeof ACCEPTED | typeof RESOLVED; + +/** @public */ export type IncidentPriority = 'HIGH' | 'LOW'; +/** @public */ export interface Link { href: string; text: string; } +/** @public */ export interface Image { src: string; href: string; alt: string; } +/** @public */ export type SubscriberType = 'TEAM' | 'USER'; +/** @public */ export interface Subscriber { id: number; name: string; type: SubscriberType; } +/** @public */ export interface LogEntry { id: number; timestamp: string; @@ -69,6 +82,7 @@ export interface LogEntry { filterTypes?: string[]; } +/** @public */ export interface User { id: number; username: string; @@ -85,18 +99,22 @@ export interface User { department: string; } +/** @public */ export type UserRole = | 'USER' | 'ADMIN' | 'STAKEHOLDER' | 'ACCOUNT_OWNER' | 'RESPONDER'; +/** @public */ export type Language = 'de' | 'en'; +/** @public */ export interface Phone { regionCode: string; number: string; } +/** @public */ export interface AlertSource { id: number; name: string; @@ -123,22 +141,26 @@ export interface AlertSource { teams: TeamShort[]; } +/** @public */ export interface TeamShort { id: number; name: string; } +/** @public */ export interface TeamMember { user: User; role: 'STAKEHOLDER' | 'RESPONDER' | 'USER' | 'ADMIN'; } +/** @public */ export type AlertSourceStatus = | 'PENDING' | 'ALL_ACCEPTED' | 'ALL_RESOLVED' | 'IN_MAINTENANCE' | 'DISABLED'; +/** @public */ export type AlertSourceIntegrationType = | 'NAGIOS' | 'ICINGA' @@ -186,18 +208,22 @@ export type AlertSourceIntegrationType = | 'KAPACITOR' | 'CORTEXXSOAR' | string; +/** @public */ export type AlertSourceIncidentCreation = | 'ONE_INCIDENT_PER_EMAIL' | 'ONE_INCIDENT_PER_EMAIL_SUBJECT' | 'ONE_PENDING_INCIDENT_ALLOWED' | 'ONE_OPEN_INCIDENT_ALLOWED' | 'OPEN_RESOLVE_ON_EXTRACTION'; +/** @public */ export type AlertSourceFilterOperator = 'AND' | 'OR'; +/** @public */ export type AlertSourceIncidentPriorityRule = | 'HIGH' | 'LOW' | 'HIGH_DURING_SUPPORT_HOURS' | 'LOW_DURING_SUPPORT_HOURS'; +/** @public */ export interface AlertSourceEmailPredicate { field: 'EMAIL_FROM' | 'EMAIL_SUBJECT' | 'EMAIL_BODY'; criteria: @@ -211,15 +237,18 @@ export interface AlertSourceEmailPredicate { | 'MATCHES_NOT_REGEX'; value: string; } +/** @public */ export type AlertSourceTimeZone = | 'Europe/Berlin' | 'America/New_York' | 'America/Los_Angeles' | 'Asia/Istanbul'; +/** @public */ export interface AlertSourceSupportDay { start: string; end: string; } +/** @public */ export interface AlertSourceSupportHours { timezone: AlertSourceTimeZone; autoRaiseIncidents: boolean; @@ -233,12 +262,14 @@ export interface AlertSourceSupportHours { SUNDAY: AlertSourceSupportDay; }; } +/** @public */ export interface AlertSourceHeartbeat { summary: string; intervalSec: number; status: 'OVERDUE' | 'ON_TIME' | 'NEVER_RECEIVED'; } +/** @public */ export interface AlertSourceAutotaskMetadata { userName: string; secret: string; @@ -246,6 +277,7 @@ export interface AlertSourceAutotaskMetadata { webServer: string; } +/** @public */ export interface EscalationPolicy { id: number; name: string; @@ -256,12 +288,14 @@ export interface EscalationPolicy { teams: TeamShort[]; } +/** @public */ export interface EscalationRule { user: User | null; schedule: Schedule | null; escalationTimeout: number; } +/** @public */ export interface Schedule { id: number; name: string; @@ -274,12 +308,14 @@ export interface Schedule { teams: TeamShort[]; } +/** @public */ export interface Shift { user: User; start: string; end: string; } +/** @public */ export interface UptimeMonitor { id: number; name: string; @@ -298,12 +334,14 @@ export interface UptimeMonitor { teams: TeamShort[]; } +/** @public */ export interface UptimeMonitorCheckParams { host?: string; port?: number; url?: string; } +/** @public */ export interface IncidentResponder { group: 'SUGGESTED' | 'USER' | 'ESCALATION_POLICY' | 'ON_CALL_SCHEDULE'; id: number; @@ -311,6 +349,7 @@ export interface IncidentResponder { disabled: boolean; } +/** @public */ export interface IncidentAction { name: string; type: string; @@ -319,6 +358,7 @@ export interface IncidentAction { history?: IncidentActionHistory[]; } +/** @public */ export interface IncidentActionHistory { id: string; webhookId: string; @@ -327,6 +367,7 @@ export interface IncidentActionHistory { success: boolean; } +/** @public */ export interface OnCall { user: User; escalationPolicy: EscalationPolicy; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 18031e5486..383a1848a5 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -212,7 +212,6 @@ const ALLOW_WARNINGS = [ 'plugins/github-pull-requests-board', 'plugins/gitops-profiles', 'plugins/graphql-backend', - 'plugins/ilert', 'plugins/jenkins', 'plugins/jenkins-backend', 'plugins/kubernetes', From f918d327a974b84d14a0ddcced6e6a09fee5e2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:42:13 +0200 Subject: [PATCH 25/41] cicd-statistics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/cicd-statistics/api-report.md | 46 +------------------ .../src/apis/cicd-statistics.ts | 2 +- plugins/cicd-statistics/src/apis/types.ts | 44 ++++++++++++++++++ plugins/cicd-statistics/src/entity-page.tsx | 1 + plugins/cicd-statistics/src/plugin.ts | 2 + scripts/api-extractor.ts | 1 - 6 files changed, 49 insertions(+), 47 deletions(-) diff --git a/plugins/cicd-statistics/api-report.md b/plugins/cicd-statistics/api-report.md index e49c6b27dc..b0966aa281 100644 --- a/plugins/cicd-statistics/api-report.md +++ b/plugins/cicd-statistics/api-report.md @@ -10,13 +10,9 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "AbortError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class AbortError extends Error {} -// Warning: (ae-missing-release-tag) "Build" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface Build { branchType: FilterBranchType; @@ -30,25 +26,17 @@ export interface Build { triggeredBy?: TriggerReason; } -// Warning: (ae-missing-release-tag) "BuildWithRaw" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type BuildWithRaw = Build & { raw: T; }; -// Warning: (ae-missing-release-tag) "ChartType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type ChartType = 'duration' | 'count'; -// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export type ChartTypes = Array; -// Warning: (ae-missing-release-tag) "CicdConfiguration" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface CicdConfiguration { availableStatuses: ReadonlyArray; @@ -56,8 +44,6 @@ export interface CicdConfiguration { formatStageName: (parentNames: Array, stageName: string) => string; } -// Warning: (ae-missing-release-tag) "CicdDefaults" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface CicdDefaults { chartTypes: Record; @@ -75,16 +61,12 @@ export interface CicdDefaults { timeTo: Date; } -// Warning: (ae-missing-release-tag) "CicdState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface CicdState { // (undocumented) builds: Array; } -// Warning: (ae-missing-release-tag) "CicdStatisticsApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface CicdStatisticsApi { // (undocumented) @@ -95,13 +77,9 @@ export interface CicdStatisticsApi { ): Promise>; } -// Warning: (ae-missing-release-tag) "cicdStatisticsApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const cicdStatisticsApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "cicdStatisticsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const cicdStatisticsPlugin: BackstagePlugin< { @@ -111,18 +89,12 @@ export const cicdStatisticsPlugin: BackstagePlugin< {} >; -// Warning: (ae-missing-release-tag) "EntityCicdStatisticsContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityCicdStatisticsContent: EntityPageCicdCharts; -// Warning: (ae-missing-release-tag) "EntityPageCicdCharts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function EntityPageCicdCharts(): JSX.Element; -// Warning: (ae-missing-release-tag) "FetchBuildsOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface FetchBuildsOptions { // (undocumented) @@ -141,13 +113,9 @@ export interface FetchBuildsOptions { updateProgress: UpdateProgress; } -// Warning: (ae-missing-release-tag) "FilterBranchType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type FilterBranchType = 'master' | 'branch'; -// Warning: (ae-missing-release-tag) "FilterStatusType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type FilterStatusType = | 'unknown' @@ -160,16 +128,12 @@ export type FilterStatusType = | 'stalled' | 'expired'; -// Warning: (ae-missing-release-tag) "GetConfigurationOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface GetConfigurationOptions { // (undocumented) entity: Entity; } -// Warning: (ae-missing-release-tag) "Stage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface Stage { duration: number; @@ -179,13 +143,9 @@ export interface Stage { status: FilterStatusType; } -// Warning: (ae-missing-release-tag) "statusTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const statusTypes: Array; -// Warning: (ae-missing-release-tag) "TriggerReason" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type TriggerReason = /** Triggered by source code management, e.g. a Github hook */ @@ -197,13 +157,9 @@ export type TriggerReason = /** Triggered for some other reason */ | 'other'; -// Warning: (ae-missing-release-tag) "triggerReasons" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const triggerReasons: Array; -// Warning: (ae-missing-release-tag) "UpdateProgress" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface UpdateProgress { // (undocumented) diff --git a/plugins/cicd-statistics/src/apis/cicd-statistics.ts b/plugins/cicd-statistics/src/apis/cicd-statistics.ts index 714900a1bd..3ece331ec9 100644 --- a/plugins/cicd-statistics/src/apis/cicd-statistics.ts +++ b/plugins/cicd-statistics/src/apis/cicd-statistics.ts @@ -15,9 +15,9 @@ */ import { createApiRef } from '@backstage/core-plugin-api'; - import { CicdStatisticsApi } from './types'; +/** @public */ export const cicdStatisticsApiRef = createApiRef({ id: 'cicd-statistics-api', }); diff --git a/plugins/cicd-statistics/src/apis/types.ts b/plugins/cicd-statistics/src/apis/types.ts index 32d9d3f2df..226fa3f55d 100644 --- a/plugins/cicd-statistics/src/apis/types.ts +++ b/plugins/cicd-statistics/src/apis/types.ts @@ -21,6 +21,8 @@ import { Entity } from '@backstage/catalog-model'; * * If all of these aren't applicable to the underlying CI/CD, these can be * configured to be hidden, using the `availableStatuses` in `CicdConfiguration`. + * + * @public */ export type FilterStatusType = | 'unknown' @@ -32,6 +34,10 @@ export type FilterStatusType = | 'failed' | 'stalled' | 'expired'; + +/** + * @public + */ export const statusTypes: Array = [ 'succeeded', 'failed', @@ -50,9 +56,14 @@ export const statusTypes: Array = [ * The concept of what constitutes a master branch is generic. It might be called * something like 'release' or 'main' or 'trunk' in the underlying CI/CD system, * which is then up to the Api to map accordingly. + * + * @public */ export type FilterBranchType = 'master' | 'branch'; +/** + * @public + */ export type TriggerReason = /** Triggered by source code management, e.g. a Github hook */ | 'scm' @@ -63,6 +74,9 @@ export type TriggerReason = /** Triggered for some other reason */ | 'other'; +/** + * @public + */ export const triggerReasons: Array = [ 'scm', 'manual', @@ -76,6 +90,8 @@ export const triggerReasons: Array = [ * This may be called things like Stage or Step or Task in CI/CD systems, but is * generic here. There's also no concept of parallelism which might exist within * some stages. + * + * @public */ export interface Stage { name: string; @@ -94,6 +110,8 @@ export interface Stage { * Generic Build type. * * A build has e.g. a build type (master/branch), a status and (possibly) sub stages. + * + * @public */ export interface Build { raw?: unknown; @@ -125,6 +143,8 @@ export interface Build { * * This can be useful in an Api to use while mapping internal data structures * (raw) into generic builds. + * + * @public */ export type BuildWithRaw = Build & { raw: T; @@ -136,8 +156,16 @@ export type BuildWithRaw = Build & { * Values are: * * `duration`: shows an area chart of the duration over time * * `count`: shows a bar chart of the number of build per day + * + * @public */ export type ChartType = 'duration' | 'count'; + +/** + * Chart types. + * + * @public + */ export type ChartTypes = Array; /** @@ -145,6 +173,8 @@ export type ChartTypes = Array; * * These are all optional, but can be overridden from the Api to whatever makes * most sense for that implementation. + * + * @public */ export interface CicdDefaults { timeFrom: Date; @@ -171,6 +201,8 @@ export interface CicdDefaults { * configuration before anything else. * * All of these fields are optional though, and will fallback to hard-coded defaults. + * + * @public */ export interface CicdConfiguration { /** @@ -200,11 +232,15 @@ export interface CicdConfiguration { /** * If the Api implements support for aborting the fetching of builds, throw an * AbortError of this type (or any other error with name === 'AbortError'). + * + * @public */ export class AbortError extends Error {} /** * The result type for `fetchBuilds`. + * + * @public */ export interface CicdState { builds: Array; @@ -222,6 +258,8 @@ export interface CicdState { * the UI. * * Optionally this can signal multiple progresses in several steps + * + * @public */ export interface UpdateProgress { (completed: number, total: number, started?: number): void; @@ -238,6 +276,8 @@ export interface UpdateProgress { /** * When reading configuration, the Api can return a custom settings depending on * the entity being viewed. + * + * @public */ export interface GetConfigurationOptions { entity: Entity; @@ -252,6 +292,8 @@ export interface GetConfigurationOptions { * * When the UI re-fetches, it will abort any previous fetching, so polling * `abortSignal.aborted`, and possibly throwing an `AbortError`, can be useful. + * + * @public */ export interface FetchBuildsOptions { entity: Entity; @@ -266,6 +308,8 @@ export interface FetchBuildsOptions { /** * The interface which is mapped to the `cicdStatisticsApiRef` which is used by * the UI. + * + * @public */ export interface CicdStatisticsApi { getConfiguration( diff --git a/plugins/cicd-statistics/src/entity-page.tsx b/plugins/cicd-statistics/src/entity-page.tsx index 3c51dabf2a..db5cba42aa 100644 --- a/plugins/cicd-statistics/src/entity-page.tsx +++ b/plugins/cicd-statistics/src/entity-page.tsx @@ -46,6 +46,7 @@ import { cleanupBuildTree } from './utils/stage-names'; import { renderFallbacks, useAsyncChain } from './components/progress'; import { sortFilterStatusType } from './utils/api'; +/** @public */ export function EntityPageCicdCharts() { const state = useCicdConfiguration(); diff --git a/plugins/cicd-statistics/src/plugin.ts b/plugins/cicd-statistics/src/plugin.ts index ca9506475a..2abac90d03 100644 --- a/plugins/cicd-statistics/src/plugin.ts +++ b/plugins/cicd-statistics/src/plugin.ts @@ -26,6 +26,7 @@ const rootCatalogCicdStatsRouteRef = createRouteRef({ id: 'cicd-statistics', }); +/** @public */ export const cicdStatisticsPlugin = createPlugin({ id: 'cicd-statistics', routes: { @@ -33,6 +34,7 @@ export const cicdStatisticsPlugin = createPlugin({ }, }); +/** @public */ export const EntityCicdStatisticsContent = cicdStatisticsPlugin.provide( createRoutableExtension({ component: () => import('./entity-page').then(m => m.EntityPageCicdCharts), diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 383a1848a5..007c93b146 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -201,7 +201,6 @@ const ALLOW_WARNINGS = [ 'packages/core-components', 'plugins/catalog', 'plugins/catalog-import', - 'plugins/cicd-statistics', 'plugins/circleci', 'plugins/cost-insights', 'plugins/dynatrace', From 9d322594ac02a2e6a1f3cd07e9337531d130a6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:43:32 +0200 Subject: [PATCH 26/41] explore-react MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/explore-react/api-report.md | 6 ------ plugins/explore-react/src/tools/api.ts | 3 +++ scripts/api-extractor.ts | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/explore-react/api-report.md b/plugins/explore-react/api-report.md index 75fb01064d..8a9d2b8b13 100644 --- a/plugins/explore-react/api-report.md +++ b/plugins/explore-react/api-report.md @@ -5,8 +5,6 @@ ```ts import { ApiRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "ExploreTool" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type ExploreTool = { title: string; @@ -17,16 +15,12 @@ export type ExploreTool = { lifecycle?: string; }; -// Warning: (ae-missing-release-tag) "ExploreToolsConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ExploreToolsConfig { // (undocumented) getTools: () => Promise; } -// Warning: (ae-missing-release-tag) "exploreToolsConfigRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const exploreToolsConfigRef: ApiRef; ``` diff --git a/plugins/explore-react/src/tools/api.ts b/plugins/explore-react/src/tools/api.ts index 8a91b84785..0fae2ce0fb 100644 --- a/plugins/explore-react/src/tools/api.ts +++ b/plugins/explore-react/src/tools/api.ts @@ -16,10 +16,12 @@ import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const exploreToolsConfigRef = createApiRef({ id: 'plugin.explore.toolsconfig', }); +/** @public */ export type ExploreTool = { title: string; description?: string; @@ -29,6 +31,7 @@ export type ExploreTool = { lifecycle?: string; }; +/** @public */ export interface ExploreToolsConfig { getTools: () => Promise; } diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 007c93b146..dc05f00b84 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -204,7 +204,6 @@ const ALLOW_WARNINGS = [ 'plugins/circleci', 'plugins/cost-insights', 'plugins/dynatrace', - 'plugins/explore-react', 'plugins/git-release-manager', 'plugins/github-actions', 'plugins/github-deployments', From 12d29b72ebafd6b41d16a73a373d90dd609ed076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:44:58 +0200 Subject: [PATCH 27/41] graphql-backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/graphql-backend/api-report.md | 4 ---- plugins/graphql-backend/src/service/router.ts | 2 ++ scripts/api-extractor.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/graphql-backend/api-report.md b/plugins/graphql-backend/api-report.md index f1707288b7..a787c4f209 100644 --- a/plugins/graphql-backend/api-report.md +++ b/plugins/graphql-backend/api-report.md @@ -7,13 +7,9 @@ import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createRouter(options: RouterOptions): Promise; -// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface RouterOptions { // (undocumented) diff --git a/plugins/graphql-backend/src/service/router.ts b/plugins/graphql-backend/src/service/router.ts index 22d284eb27..773eebd608 100644 --- a/plugins/graphql-backend/src/service/router.ts +++ b/plugins/graphql-backend/src/service/router.ts @@ -25,11 +25,13 @@ import { Config } from '@backstage/config'; import helmet from 'helmet'; import { makeExecutableSchema } from '@graphql-tools/schema'; +/** @public */ export interface RouterOptions { logger: Logger; config: Config; } +/** @public */ export async function createRouter( options: RouterOptions, ): Promise { diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index dc05f00b84..3cd7ad57d0 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -209,7 +209,6 @@ const ALLOW_WARNINGS = [ 'plugins/github-deployments', 'plugins/github-pull-requests-board', 'plugins/gitops-profiles', - 'plugins/graphql-backend', 'plugins/jenkins', 'plugins/jenkins-backend', 'plugins/kubernetes', From 9d85eaf58ad54988f192ac121d9a2294967ebb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:46:34 +0200 Subject: [PATCH 28/41] gitops-profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/gitops-profiles/api-report.md | 38 --------------------------- plugins/gitops-profiles/src/api.ts | 16 +++++++++++ plugins/gitops-profiles/src/plugin.ts | 4 +++ scripts/api-extractor.ts | 1 - 4 files changed, 20 insertions(+), 39 deletions(-) diff --git a/plugins/gitops-profiles/api-report.md b/plugins/gitops-profiles/api-report.md index 245a1fb30b..9449417bba 100644 --- a/plugins/gitops-profiles/api-report.md +++ b/plugins/gitops-profiles/api-report.md @@ -9,8 +9,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "ApplyProfileRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ApplyProfileRequest { // (undocumented) @@ -25,8 +23,6 @@ export interface ApplyProfileRequest { targetRepo: string; } -// Warning: (ae-missing-release-tag) "ChangeClusterStateRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ChangeClusterStateRequest { // (undocumented) @@ -41,8 +37,6 @@ export interface ChangeClusterStateRequest { targetRepo: string; } -// Warning: (ae-missing-release-tag) "CloneFromTemplateRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface CloneFromTemplateRequest { // (undocumented) @@ -62,8 +56,6 @@ export interface CloneFromTemplateRequest { templateRepository: string; } -// Warning: (ae-missing-release-tag) "ClusterStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ClusterStatus { // (undocumented) @@ -78,8 +70,6 @@ export interface ClusterStatus { status: string; } -// Warning: (ae-missing-release-tag) "FetchError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class FetchError extends Error { // (undocumented) @@ -88,24 +78,18 @@ export class FetchError extends Error { get name(): string; } -// Warning: (ae-missing-release-tag) "GithubUserInfoRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface GithubUserInfoRequest { // (undocumented) accessToken: string; } -// Warning: (ae-missing-release-tag) "GithubUserInfoResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface GithubUserInfoResponse { // (undocumented) login: string; } -// Warning: (ae-missing-release-tag) "GitOpsApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GitOpsApi = { url: string; @@ -117,28 +101,18 @@ export type GitOpsApi = { fetchUserInfo(req: GithubUserInfoRequest): Promise; }; -// Warning: (ae-missing-release-tag) "gitOpsApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const gitOpsApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "GitopsProfilesClusterListPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const GitopsProfilesClusterListPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "GitopsProfilesClusterPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const GitopsProfilesClusterPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "GitopsProfilesCreatePage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const GitopsProfilesCreatePage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "gitopsProfilesPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const gitopsProfilesPlugin: BackstagePlugin< { @@ -155,8 +129,6 @@ const gitopsProfilesPlugin: BackstagePlugin< export { gitopsProfilesPlugin }; export { gitopsProfilesPlugin as plugin }; -// Warning: (ae-missing-release-tag) "GitOpsRestApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class GitOpsRestApi implements GitOpsApi { constructor(url?: string); @@ -176,8 +148,6 @@ export class GitOpsRestApi implements GitOpsApi { url: string; } -// Warning: (ae-missing-release-tag) "ListClusterRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ListClusterRequest { // (undocumented) @@ -186,16 +156,12 @@ export interface ListClusterRequest { gitHubUser: string; } -// Warning: (ae-missing-release-tag) "ListClusterStatusesResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ListClusterStatusesResponse { // (undocumented) result: ClusterStatus[]; } -// Warning: (ae-missing-release-tag) "PollLogRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface PollLogRequest { // (undocumented) @@ -208,8 +174,6 @@ export interface PollLogRequest { targetRepo: string; } -// Warning: (ae-missing-release-tag) "Status" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface Status { // (undocumented) @@ -220,8 +184,6 @@ export interface Status { status: string; } -// Warning: (ae-missing-release-tag) "StatusResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface StatusResponse { // (undocumented) diff --git a/plugins/gitops-profiles/src/api.ts b/plugins/gitops-profiles/src/api.ts index ca141140d8..fe47d20336 100644 --- a/plugins/gitops-profiles/src/api.ts +++ b/plugins/gitops-profiles/src/api.ts @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export interface CloneFromTemplateRequest { templateRepository: string; secrets: { @@ -27,6 +29,7 @@ export interface CloneFromTemplateRequest { gitHubToken: string; } +/** @public */ export interface ApplyProfileRequest { targetOrg: string; targetRepo: string; @@ -35,6 +38,7 @@ export interface ApplyProfileRequest { profiles: string[]; } +/** @public */ export interface ChangeClusterStateRequest { targetOrg: string; targetRepo: string; @@ -43,6 +47,7 @@ export interface ChangeClusterStateRequest { clusterState: 'present' | 'absent'; // /api/cluster/state } +/** @public */ export interface PollLogRequest { targetOrg: string; targetRepo: string; @@ -50,18 +55,21 @@ export interface PollLogRequest { gitHubToken: string; } +/** @public */ export interface Status { status: string; // queued, in_progress, or completed message: string; conclusion: string; // success, failure, neutral, cancelled, skipped, timed_out, or action_required } +/** @public */ export interface StatusResponse { result: Status[]; link: string; status: string; } +/** @public */ export interface ClusterStatus { name: string; link: string; @@ -70,23 +78,28 @@ export interface ClusterStatus { runStatus: Status[]; } +/** @public */ export interface ListClusterStatusesResponse { result: ClusterStatus[]; } +/** @public */ export interface ListClusterRequest { gitHubUser: string; gitHubToken: string; } +/** @public */ export interface GithubUserInfoRequest { accessToken: string; } +/** @public */ export interface GithubUserInfoResponse { login: string; } +/** @public */ export class FetchError extends Error { get name(): string { return this.constructor.name; @@ -101,6 +114,7 @@ export class FetchError extends Error { } } +/** @public */ export type GitOpsApi = { url: string; fetchLog(req: PollLogRequest): Promise; @@ -111,10 +125,12 @@ export type GitOpsApi = { fetchUserInfo(req: GithubUserInfoRequest): Promise; }; +/** @public */ export const gitOpsApiRef = createApiRef({ id: 'plugin.gitops.service', }); +/** @public */ export class GitOpsRestApi implements GitOpsApi { constructor(public url: string = '') {} diff --git a/plugins/gitops-profiles/src/plugin.ts b/plugins/gitops-profiles/src/plugin.ts index fc961d7026..8c8bfc52fa 100644 --- a/plugins/gitops-profiles/src/plugin.ts +++ b/plugins/gitops-profiles/src/plugin.ts @@ -26,6 +26,7 @@ import { createRoutableExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const gitopsProfilesPlugin = createPlugin({ id: 'gitops-profiles', apis: [ @@ -38,6 +39,7 @@ export const gitopsProfilesPlugin = createPlugin({ }, }); +/** @public */ export const GitopsProfilesClusterListPage = gitopsProfilesPlugin.provide( createRoutableExtension({ name: 'GitopsProfilesClusterListPage', @@ -46,6 +48,7 @@ export const GitopsProfilesClusterListPage = gitopsProfilesPlugin.provide( }), ); +/** @public */ export const GitopsProfilesClusterPage = gitopsProfilesPlugin.provide( createRoutableExtension({ name: 'GitopsProfilesClusterPage', @@ -54,6 +57,7 @@ export const GitopsProfilesClusterPage = gitopsProfilesPlugin.provide( }), ); +/** @public */ export const GitopsProfilesCreatePage = gitopsProfilesPlugin.provide( createRoutableExtension({ name: 'GitopsProfilesCreatePage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 3cd7ad57d0..19fbfd79be 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -208,7 +208,6 @@ const ALLOW_WARNINGS = [ 'plugins/github-actions', 'plugins/github-deployments', 'plugins/github-pull-requests-board', - 'plugins/gitops-profiles', 'plugins/jenkins', 'plugins/jenkins-backend', 'plugins/kubernetes', From 96081d960a6b441bde8c8d0e80de2c595bfd6b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:49:13 +0200 Subject: [PATCH 29/41] newrelic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/newrelic-dashboard/api-report.md | 2 -- plugins/newrelic-dashboard/src/Router.tsx | 1 + plugins/newrelic-dashboard/src/index.ts | 1 + plugins/newrelic/api-report.md | 4 ---- plugins/newrelic/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 2 -- 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/newrelic-dashboard/api-report.md b/plugins/newrelic-dashboard/api-report.md index 223a327d20..740fc46ef7 100644 --- a/plugins/newrelic-dashboard/api-report.md +++ b/plugins/newrelic-dashboard/api-report.md @@ -22,8 +22,6 @@ export const EntityNewRelicDashboardCard: () => JSX.Element; // @public (undocumented) export const EntityNewRelicDashboardContent: () => JSX.Element; -// Warning: (ae-missing-release-tag) "isNewRelicDashboardAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const isNewRelicDashboardAvailable: (entity: Entity) => boolean; diff --git a/plugins/newrelic-dashboard/src/Router.tsx b/plugins/newrelic-dashboard/src/Router.tsx index 24a5a1037f..b549d1107b 100644 --- a/plugins/newrelic-dashboard/src/Router.tsx +++ b/plugins/newrelic-dashboard/src/Router.tsx @@ -21,6 +21,7 @@ import { NewRelicDashboard } from './components/NewRelicDashboard'; import { useEntity } from '@backstage/plugin-catalog-react'; import { NEWRELIC_GUID_ANNOTATION } from './constants'; +/** @public */ export const isNewRelicDashboardAvailable = (entity: Entity) => Boolean(entity?.metadata?.annotations?.[NEWRELIC_GUID_ANNOTATION]); diff --git a/plugins/newrelic-dashboard/src/index.ts b/plugins/newrelic-dashboard/src/index.ts index 060306524f..ba87b8a514 100644 --- a/plugins/newrelic-dashboard/src/index.ts +++ b/plugins/newrelic-dashboard/src/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { newRelicDashboardPlugin, EntityNewRelicDashboardCard, diff --git a/plugins/newrelic/api-report.md b/plugins/newrelic/api-report.md index fbf639ee9d..302b7c918a 100644 --- a/plugins/newrelic/api-report.md +++ b/plugins/newrelic/api-report.md @@ -8,13 +8,9 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "NewRelicPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const NewRelicPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "newRelicPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const newRelicPlugin: BackstagePlugin< { diff --git a/plugins/newrelic/src/plugin.ts b/plugins/newrelic/src/plugin.ts index 6cf77a785f..0387c50aa9 100644 --- a/plugins/newrelic/src/plugin.ts +++ b/plugins/newrelic/src/plugin.ts @@ -27,6 +27,7 @@ export const rootRouteRef = createRouteRef({ id: 'newrelic', }); +/** @public */ export const newRelicPlugin = createPlugin({ id: 'newrelic', apis: [ @@ -41,6 +42,7 @@ export const newRelicPlugin = createPlugin({ }, }); +/** @public */ export const NewRelicPage = newRelicPlugin.provide( createRoutableExtension({ name: 'NewRelicPage', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 19fbfd79be..61f304730f 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -212,8 +212,6 @@ const ALLOW_WARNINGS = [ 'plugins/jenkins-backend', 'plugins/kubernetes', 'plugins/kubernetes-common', - 'plugins/newrelic', - 'plugins/newrelic-dashboard', ]; async function resolvePackagePath( From 37fe3f71b74806effbb82a5b0651c3f01d19ae86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 14:51:34 +0200 Subject: [PATCH 30/41] dynatrace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/dynatrace/api-report.md | 2 -- plugins/dynatrace/src/index.ts | 1 + plugins/dynatrace/src/plugin.ts | 3 ++- scripts/api-extractor.ts | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/dynatrace/api-report.md b/plugins/dynatrace/api-report.md index 59fd145250..1677318a9f 100644 --- a/plugins/dynatrace/api-report.md +++ b/plugins/dynatrace/api-report.md @@ -14,8 +14,6 @@ export const dynatracePlugin: BackstagePlugin<{}, {}, {}>; // @public export const DynatraceTab: () => JSX.Element; -// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' -// // @public export const isDynatraceAvailable: (entity: Entity) => boolean; diff --git a/plugins/dynatrace/src/index.ts b/plugins/dynatrace/src/index.ts index c96c16201d..0c5da219a5 100644 --- a/plugins/dynatrace/src/index.ts +++ b/plugins/dynatrace/src/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { dynatracePlugin, DynatraceTab, isDynatraceAvailable } from './plugin'; diff --git a/plugins/dynatrace/src/plugin.ts b/plugins/dynatrace/src/plugin.ts index 26ecb1aba1..1488ae7417 100644 --- a/plugins/dynatrace/src/plugin.ts +++ b/plugins/dynatrace/src/plugin.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { dynatraceApiRef, DynatraceClient } from './api'; import { createApiFactory, @@ -55,7 +56,7 @@ export const dynatracePlugin = createPlugin({ /** * Checks if the entity has a dynatrace id annotation. * @public - * @param entity {Entity} - The entity to check for the dynatrace id annotation. + * @param entity - The entity to check for the dynatrace id annotation. */ export const isDynatraceAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]) || diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 61f304730f..a508a13496 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -203,7 +203,6 @@ const ALLOW_WARNINGS = [ 'plugins/catalog-import', 'plugins/circleci', 'plugins/cost-insights', - 'plugins/dynatrace', 'plugins/git-release-manager', 'plugins/github-actions', 'plugins/github-deployments', From 0f668b58eb55e8925a8bd2e4612064dcdf768e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:01:04 +0200 Subject: [PATCH 31/41] circleci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/circleci/api-report.md | 21 +-------------------- plugins/circleci/src/api/CircleCIApi.ts | 21 ++++++++++++--------- plugins/circleci/src/api/index.ts | 3 ++- plugins/circleci/src/components/Router.tsx | 2 ++ plugins/circleci/src/constants.ts | 1 + plugins/circleci/src/plugin.ts | 2 ++ plugins/circleci/src/route-refs.tsx | 2 ++ scripts/api-extractor.ts | 1 - 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/plugins/circleci/api-report.md b/plugins/circleci/api-report.md index 034cfae3ee..277b5720de 100644 --- a/plugins/circleci/api-report.md +++ b/plugins/circleci/api-report.md @@ -26,17 +26,12 @@ export { BuildSummary }; export { BuildWithSteps }; -// Warning: (ae-missing-release-tag) "CIRCLECI_ANNOTATION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const CIRCLECI_ANNOTATION = 'circleci.com/project-slug'; -// Warning: (ae-missing-release-tag) "CircleCIApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class CircleCIApi { - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - constructor(options: Options); + constructor(options: { discoveryApi: DiscoveryApi; proxyPath?: string }); // (undocumented) getBuild( buildNumber: number, @@ -59,44 +54,30 @@ export class CircleCIApi { ): Promise; } -// Warning: (ae-missing-release-tag) "circleCIApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const circleCIApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "circleCIBuildRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const circleCIBuildRouteRef: SubRouteRef>; -// Warning: (ae-missing-release-tag) "circleCIPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const circleCIPlugin: BackstagePlugin<{}, {}, {}>; export { circleCIPlugin }; export { circleCIPlugin as plugin }; -// Warning: (ae-missing-release-tag) "circleCIRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const circleCIRouteRef: RouteRef; -// Warning: (ae-missing-release-tag) "EntityCircleCIContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityCircleCIContent: () => JSX.Element; export { GitType }; -// Warning: (ae-missing-release-tag) "isCircleCIAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const isCircleCIAvailable: (entity: Entity) => boolean; export { isCircleCIAvailable }; export { isCircleCIAvailable as isPluginApplicableToEntity }; -// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const Router: () => JSX.Element; ``` diff --git a/plugins/circleci/src/api/CircleCIApi.ts b/plugins/circleci/src/api/CircleCIApi.ts index 931feec4d5..6ec8addd76 100644 --- a/plugins/circleci/src/api/CircleCIApi.ts +++ b/plugins/circleci/src/api/CircleCIApi.ts @@ -28,28 +28,31 @@ import { } from 'circleci-api'; import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api'; +/** @public */ export { GitType }; + +/** @public */ export type { BuildWithSteps, BuildStepAction, BuildSummary }; +/** @public */ export const circleCIApiRef = createApiRef({ id: 'plugin.circleci.service', }); const DEFAULT_PROXY_PATH = '/circleci/api'; -type Options = { - discoveryApi: DiscoveryApi; - /** - * Path to use for requests via the proxy, defaults to /circleci/api - */ - proxyPath?: string; -}; - +/** @public */ export class CircleCIApi { private readonly discoveryApi: DiscoveryApi; private readonly proxyPath: string; - constructor(options: Options) { + constructor(options: { + discoveryApi: DiscoveryApi; + /** + * Path to use for requests via the proxy, defaults to /circleci/api + */ + proxyPath?: string; + }) { this.discoveryApi = options.discoveryApi; this.proxyPath = options.proxyPath ?? DEFAULT_PROXY_PATH; } diff --git a/plugins/circleci/src/api/index.ts b/plugins/circleci/src/api/index.ts index 213ce2de8b..08a549b1ee 100644 --- a/plugins/circleci/src/api/index.ts +++ b/plugins/circleci/src/api/index.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -export { CircleCIApi, circleCIApiRef, GitType } from './CircleCIApi'; +export type { GitType } from './CircleCIApi'; +export { CircleCIApi, circleCIApiRef } from './CircleCIApi'; export type { BuildWithSteps, BuildStepAction, diff --git a/plugins/circleci/src/components/Router.tsx b/plugins/circleci/src/components/Router.tsx index e16c91f2a0..09c74dbbe8 100644 --- a/plugins/circleci/src/components/Router.tsx +++ b/plugins/circleci/src/components/Router.tsx @@ -24,9 +24,11 @@ import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; import { MissingAnnotationEmptyState } from '@backstage/core-components'; +/** @public */ export const isCircleCIAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[CIRCLECI_ANNOTATION]); +/** @public */ export const Router = () => { const { entity } = useEntity(); diff --git a/plugins/circleci/src/constants.ts b/plugins/circleci/src/constants.ts index 97c016826e..3478c22aee 100644 --- a/plugins/circleci/src/constants.ts +++ b/plugins/circleci/src/constants.ts @@ -14,4 +14,5 @@ * limitations under the License. */ +/** @public */ export const CIRCLECI_ANNOTATION = 'circleci.com/project-slug'; diff --git a/plugins/circleci/src/plugin.ts b/plugins/circleci/src/plugin.ts index 890e40ae9a..0cf7fb52ea 100644 --- a/plugins/circleci/src/plugin.ts +++ b/plugins/circleci/src/plugin.ts @@ -23,6 +23,7 @@ import { createRoutableExtension, } from '@backstage/core-plugin-api'; +/** @public */ export const circleCIPlugin = createPlugin({ id: 'circleci', apis: [ @@ -34,6 +35,7 @@ export const circleCIPlugin = createPlugin({ ], }); +/** @public */ export const EntityCircleCIContent = circleCIPlugin.provide( createRoutableExtension({ name: 'EntityCircleCIContent', diff --git a/plugins/circleci/src/route-refs.tsx b/plugins/circleci/src/route-refs.tsx index e8579b9f0d..22295c4ebc 100644 --- a/plugins/circleci/src/route-refs.tsx +++ b/plugins/circleci/src/route-refs.tsx @@ -16,10 +16,12 @@ import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api'; +/** @public */ export const circleCIRouteRef = createRouteRef({ id: 'circle-ci', }); +/** @public */ export const circleCIBuildRouteRef = createSubRouteRef({ id: 'circle-ci/build', parent: circleCIRouteRef, diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index a508a13496..530c29dd18 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -201,7 +201,6 @@ const ALLOW_WARNINGS = [ 'packages/core-components', 'plugins/catalog', 'plugins/catalog-import', - 'plugins/circleci', 'plugins/cost-insights', 'plugins/git-release-manager', 'plugins/github-actions', From 9053fd9ad3969c3fc9f2712c8531cfb4871d7181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:03:08 +0200 Subject: [PATCH 32/41] jenkins-backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/jenkins-backend/api-report.md | 14 -------------- .../src/service/jenkinsInfoProvider.ts | 7 +++++++ plugins/jenkins-backend/src/service/router.ts | 2 ++ scripts/api-extractor.ts | 1 - 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/plugins/jenkins-backend/api-report.md b/plugins/jenkins-backend/api-report.md index 029f2c7af3..489a5e4fb2 100644 --- a/plugins/jenkins-backend/api-report.md +++ b/plugins/jenkins-backend/api-report.md @@ -11,13 +11,9 @@ import { Logger } from 'winston'; import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; import { PermissionEvaluator } from '@backstage/plugin-permission-common'; -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createRouter(options: RouterOptions): Promise; -// Warning: (ae-missing-release-tag) "DefaultJenkinsInfoProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class DefaultJenkinsInfoProvider implements JenkinsInfoProvider { // (undocumented) @@ -37,8 +33,6 @@ export class DefaultJenkinsInfoProvider implements JenkinsInfoProvider { static readonly OLD_JENKINS_ANNOTATION = 'jenkins.io/github-folder'; } -// Warning: (ae-missing-release-tag) "JenkinsConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class JenkinsConfig { constructor(instances: JenkinsInstanceConfig[]); @@ -48,8 +42,6 @@ export class JenkinsConfig { readonly instances: JenkinsInstanceConfig[]; } -// Warning: (ae-missing-release-tag) "JenkinsInfo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface JenkinsInfo { // (undocumented) @@ -62,8 +54,6 @@ export interface JenkinsInfo { jobFullName: string; } -// Warning: (ae-missing-release-tag) "JenkinsInfoProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface JenkinsInfoProvider { // (undocumented) @@ -74,8 +64,6 @@ export interface JenkinsInfoProvider { }): Promise; } -// Warning: (ae-missing-release-tag) "JenkinsInstanceConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface JenkinsInstanceConfig { // (undocumented) @@ -90,8 +78,6 @@ export interface JenkinsInstanceConfig { username: string; } -// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface RouterOptions { // (undocumented) diff --git a/plugins/jenkins-backend/src/service/jenkinsInfoProvider.ts b/plugins/jenkins-backend/src/service/jenkinsInfoProvider.ts index fcce944dc8..37aae5cb1c 100644 --- a/plugins/jenkins-backend/src/service/jenkinsInfoProvider.ts +++ b/plugins/jenkins-backend/src/service/jenkinsInfoProvider.ts @@ -22,6 +22,7 @@ import { } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; +/** @public */ export interface JenkinsInfoProvider { getInstance(options: { /** @@ -37,6 +38,7 @@ export interface JenkinsInfoProvider { }): Promise; } +/** @public */ export interface JenkinsInfo { baseUrl: string; headers?: Record; @@ -44,6 +46,7 @@ export interface JenkinsInfo { crumbIssuer?: boolean; } +/** @public */ export interface JenkinsInstanceConfig { name: string; baseUrl: string; @@ -54,6 +57,8 @@ export interface JenkinsInstanceConfig { /** * Holds multiple Jenkins configurations. + * + * @public */ export class JenkinsConfig { constructor(public readonly instances: JenkinsInstanceConfig[]) {} @@ -163,6 +168,8 @@ export class JenkinsConfig { * Use default config and annotations, build using fromConfig static function. * * This will fallback through various deprecated config and annotation schemes. + * + * @public */ export class DefaultJenkinsInfoProvider implements JenkinsInfoProvider { static readonly OLD_JENKINS_ANNOTATION = 'jenkins.io/github-folder'; diff --git a/plugins/jenkins-backend/src/service/router.ts b/plugins/jenkins-backend/src/service/router.ts index b4c06314e1..bc0e978396 100644 --- a/plugins/jenkins-backend/src/service/router.ts +++ b/plugins/jenkins-backend/src/service/router.ts @@ -28,12 +28,14 @@ import { import { getBearerTokenFromAuthorizationHeader } from '@backstage/plugin-auth-node'; import { stringifyEntityRef } from '@backstage/catalog-model'; +/** @public */ export interface RouterOptions { logger: Logger; jenkinsInfoProvider: JenkinsInfoProvider; permissions?: PermissionEvaluator | PermissionAuthorizer; } +/** @public */ export async function createRouter( options: RouterOptions, ): Promise { diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 530c29dd18..a00427579d 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -207,7 +207,6 @@ const ALLOW_WARNINGS = [ 'plugins/github-deployments', 'plugins/github-pull-requests-board', 'plugins/jenkins', - 'plugins/jenkins-backend', 'plugins/kubernetes', 'plugins/kubernetes-common', ]; From 22022c45d05b87ae65a077665486749e6ad3c528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:08:13 +0200 Subject: [PATCH 33/41] github-actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/github-actions/api-report.md | 48 +++++-------------- .../src/api/GithubActionsApi.ts | 1 + plugins/github-actions/src/api/types.ts | 4 ++ .../src/components/Cards/Cards.tsx | 2 + .../Cards/RecentWorkflowRunsCard.test.tsx | 3 +- .../Cards/RecentWorkflowRunsCard.tsx | 16 +++---- .../src/components/Cards/index.ts | 1 + .../github-actions/src/components/Router.tsx | 3 ++ .../components/getProjectNameFromEntity.ts | 2 + scripts/api-extractor.ts | 1 - 10 files changed, 34 insertions(+), 47 deletions(-) diff --git a/plugins/github-actions/api-report.md b/plugins/github-actions/api-report.md index 8cf70eabcc..b1628996e0 100644 --- a/plugins/github-actions/api-report.md +++ b/plugins/github-actions/api-report.md @@ -14,8 +14,6 @@ import { OAuthApi } from '@backstage/core-plugin-api'; import { RestEndpointMethodTypes } from '@octokit/rest'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "BuildStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum BuildStatus { // (undocumented) @@ -43,18 +41,14 @@ export const EntityLatestGithubActionsForBranchCard: (props: { variant?: InfoCardVariants | undefined; }) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// // @public (undocumented) -export const EntityRecentGithubActionsRunsCard: ({ - branch, - dense, - limit, - variant, -}: Props) => JSX.Element; +export const EntityRecentGithubActionsRunsCard: (props: { + branch?: string | undefined; + dense?: boolean | undefined; + limit?: number | undefined; + variant?: InfoCardVariants | undefined; +}) => JSX.Element; -// Warning: (ae-missing-release-tag) "GITHUB_ACTIONS_ANNOTATION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; @@ -112,8 +106,6 @@ export type GithubActionsApi = { >; }; -// Warning: (ae-missing-release-tag) "githubActionsApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const githubActionsApiRef: ApiRef; @@ -189,15 +181,11 @@ const githubActionsPlugin: BackstagePlugin< export { githubActionsPlugin }; export { githubActionsPlugin as plugin }; -// Warning: (ae-missing-release-tag) "isGithubActionsAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const isGithubActionsAvailable: (entity: Entity) => boolean; export { isGithubActionsAvailable }; export { isGithubActionsAvailable as isPluginApplicableToEntity }; -// Warning: (ae-missing-release-tag) "Job" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Job = { html_url?: string; @@ -210,47 +198,35 @@ export type Job = { steps?: Step[]; }; -// Warning: (ae-missing-release-tag) "Jobs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Jobs = { total_count: number; jobs: Job[]; }; -// Warning: (ae-missing-release-tag) "LatestWorkflowRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const LatestWorkflowRunCard: (props: { branch: string; variant?: InfoCardVariants; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "LatestWorkflowsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const LatestWorkflowsForBranchCard: (props: { branch: string; variant?: InfoCardVariants; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "RecentWorkflowRunsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const RecentWorkflowRunsCard: ({ - branch, - dense, - limit, - variant, -}: Props) => JSX.Element; +export const RecentWorkflowRunsCard: (props: { + branch?: string; + dense?: boolean; + limit?: number; + variant?: InfoCardVariants; +}) => JSX.Element; -// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const Router: () => JSX.Element; -// Warning: (ae-missing-release-tag) "Step" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Step = { name: string; diff --git a/plugins/github-actions/src/api/GithubActionsApi.ts b/plugins/github-actions/src/api/GithubActionsApi.ts index 25bbf0b809..14dbc3210e 100644 --- a/plugins/github-actions/src/api/GithubActionsApi.ts +++ b/plugins/github-actions/src/api/GithubActionsApi.ts @@ -17,6 +17,7 @@ import { RestEndpointMethodTypes } from '@octokit/rest'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export const githubActionsApiRef = createApiRef({ id: 'plugin.githubactions.service', }); diff --git a/plugins/github-actions/src/api/types.ts b/plugins/github-actions/src/api/types.ts index db926d9c03..2e997d9bf7 100644 --- a/plugins/github-actions/src/api/types.ts +++ b/plugins/github-actions/src/api/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export type Step = { name: string; status: string; @@ -23,6 +24,7 @@ export type Step = { completed_at?: string; }; +/** @public */ export type Job = { html_url?: string; status: string; @@ -34,11 +36,13 @@ export type Job = { steps?: Step[]; }; +/** @public */ export type Jobs = { total_count: number; jobs: Job[]; }; +/** @public */ export enum BuildStatus { 'success', 'failure', diff --git a/plugins/github-actions/src/components/Cards/Cards.tsx b/plugins/github-actions/src/components/Cards/Cards.tsx index 5e53096ba4..79777ed8c3 100644 --- a/plugins/github-actions/src/components/Cards/Cards.tsx +++ b/plugins/github-actions/src/components/Cards/Cards.tsx @@ -78,6 +78,7 @@ const WidgetContent = (props: { ); }; +/** @public */ export const LatestWorkflowRunCard = (props: { branch: string; variant?: InfoCardVariants; @@ -118,6 +119,7 @@ export const LatestWorkflowRunCard = (props: { ); }; +/** @public */ export const LatestWorkflowsForBranchCard = (props: { branch: string; variant?: InfoCardVariants; diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx index a987a8569f..7a20501072 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx @@ -21,7 +21,6 @@ import { render } from '@testing-library/react'; import React from 'react'; import { MemoryRouter } from 'react-router'; import { useWorkflowRuns } from '../useWorkflowRuns'; -import type { Props as RecentWorkflowRunsCardProps } from './RecentWorkflowRunsCard'; import { RecentWorkflowRunsCard } from './RecentWorkflowRunsCard'; import { ConfigReader } from '@backstage/core-app-api'; @@ -75,7 +74,7 @@ describe('', () => { jest.resetAllMocks(); }); - const renderSubject = (props: RecentWorkflowRunsCardProps = {}) => + const renderSubject = (props: any = {}) => render( diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx index 3eba4981e7..fcd0f194a3 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx @@ -32,29 +32,28 @@ import { const firstLine = (message: string): string => message.split('\n')[0]; -export type Props = { +/** @public */ +export const RecentWorkflowRunsCard = (props: { branch?: string; dense?: boolean; limit?: number; variant?: InfoCardVariants; -}; +}) => { + const { branch, dense = false, limit = 5, variant } = props; -export const RecentWorkflowRunsCard = ({ - branch, - dense = false, - limit = 5, - variant, -}: Props) => { const { entity } = useEntity(); const config = useApi(configApiRef); const errorApi = useApi(errorApiRef); + // TODO: Get github hostname from metadata annotation const hostname = readGitHubIntegrationConfigs( config.getOptionalConfigArray('integrations.github') ?? [], )[0].host; + const [owner, repo] = ( entity?.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] ?? '/' ).split('/'); + const [{ runs = [], loading, error }] = useWorkflowRuns({ hostname, owner, @@ -62,6 +61,7 @@ export const RecentWorkflowRunsCard = ({ branch, initialPageSize: limit, }); + useEffect(() => { if (error) { errorApi.post(error); diff --git a/plugins/github-actions/src/components/Cards/index.ts b/plugins/github-actions/src/components/Cards/index.ts index 1457b9c86f..335c0c42da 100644 --- a/plugins/github-actions/src/components/Cards/index.ts +++ b/plugins/github-actions/src/components/Cards/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { LatestWorkflowRunCard, LatestWorkflowsForBranchCard } from './Cards'; export { RecentWorkflowRunsCard } from './RecentWorkflowRunsCard'; diff --git a/plugins/github-actions/src/components/Router.tsx b/plugins/github-actions/src/components/Router.tsx index 793293cce8..d8b8a87d38 100644 --- a/plugins/github-actions/src/components/Router.tsx +++ b/plugins/github-actions/src/components/Router.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; @@ -23,9 +24,11 @@ import { WorkflowRunsTable } from './WorkflowRunsTable'; import { GITHUB_ACTIONS_ANNOTATION } from './getProjectNameFromEntity'; import { MissingAnnotationEmptyState } from '@backstage/core-components'; +/** @public */ export const isGithubActionsAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]); +/** @public */ export const Router = () => { const { entity } = useEntity(); diff --git a/plugins/github-actions/src/components/getProjectNameFromEntity.ts b/plugins/github-actions/src/components/getProjectNameFromEntity.ts index 13e0a2bdd5..24e546754e 100644 --- a/plugins/github-actions/src/components/getProjectNameFromEntity.ts +++ b/plugins/github-actions/src/components/getProjectNameFromEntity.ts @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Entity } from '@backstage/catalog-model'; +/** @public */ export const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; export const getProjectNameFromEntity = (entity: Entity) => diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index a00427579d..6368414951 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -203,7 +203,6 @@ const ALLOW_WARNINGS = [ 'plugins/catalog-import', 'plugins/cost-insights', 'plugins/git-release-manager', - 'plugins/github-actions', 'plugins/github-deployments', 'plugins/github-pull-requests-board', 'plugins/jenkins', From 3195aafd94bfe66fc09b9d2bbe6507ab1b2c4b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:20:47 +0200 Subject: [PATCH 34/41] github-deployments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/github-deployments/api-report.md | 100 ++++++++---------- plugins/github-deployments/src/Router.tsx | 3 + plugins/github-deployments/src/api/index.ts | 4 +- .../src/components/GithubDeploymentsCard.tsx | 1 + .../GithubDeploymentsTable.tsx | 11 +- .../GithubDeploymentsTable/columns.tsx | 91 ++++++++-------- .../GithubDeploymentsTable/index.ts | 1 + .../GithubDeploymentsTable/presets.ts | 19 ++-- plugins/github-deployments/src/index.ts | 6 +- plugins/github-deployments/src/plugin.ts | 2 + scripts/api-extractor.ts | 1 - 11 files changed, 121 insertions(+), 118 deletions(-) diff --git a/plugins/github-deployments/api-report.md b/plugins/github-deployments/api-report.md index 3e75b2f9bc..82d2222127 100644 --- a/plugins/github-deployments/api-report.md +++ b/plugins/github-deployments/api-report.md @@ -9,34 +9,6 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { TableColumn } from '@backstage/core-components'; -// Warning: (ae-forgotten-export) The symbol "GithubDeployment" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "createCommitColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -function createCommitColumn(): TableColumn; - -// Warning: (ae-missing-release-tag) "createCreatorColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -function createCreatorColumn(): TableColumn; - -// Warning: (ae-missing-release-tag) "createEnvironmentColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -function createEnvironmentColumn(): TableColumn; - -// Warning: (ae-missing-release-tag) "createLastUpdatedColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -function createLastUpdatedColumn(): TableColumn; - -// Warning: (ae-missing-release-tag) "createStatusColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -function createStatusColumn(): TableColumn; - -// Warning: (ae-missing-release-tag) "EntityGithubDeploymentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityGithubDeploymentsCard: (props: { last?: number | undefined; @@ -44,37 +16,57 @@ export const EntityGithubDeploymentsCard: (props: { columns?: TableColumn[] | undefined; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "githubDeploymentsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export const GITHUB_PROJECT_SLUG_ANNOTATION = 'github.com/project-slug'; + +// @public (undocumented) +export type GithubDeployment = { + environment: string; + state: string; + updatedAt: string; + commit: { + abbreviatedOid: string; + commitUrl: string; + } | null; + statuses: { + nodes: Node_2[]; + }; + creator: { + login: string; + }; + repository: { + nameWithOwner: string; + }; + payload: string; +}; + // @public (undocumented) export const githubDeploymentsPlugin: BackstagePlugin<{}, {}, {}>; -// Warning: (ae-forgotten-export) The symbol "GithubDeploymentsTableProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "GithubDeploymentsTable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "GithubDeploymentsTable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export function GithubDeploymentsTable( - props: GithubDeploymentsTableProps, -): JSX.Element; +export const GithubDeploymentsTable: { + (props: { + deployments: GithubDeployment[]; + isLoading: boolean; + reload: () => void; + columns: TableColumn[]; + }): JSX.Element; + columns: Readonly<{ + createEnvironmentColumn(): TableColumn; + createStatusColumn(): TableColumn; + createCommitColumn(): TableColumn; + createCreatorColumn(): TableColumn; + createLastUpdatedColumn(): TableColumn; + }>; + defaultDeploymentColumns: TableColumn[]; +}; -// @public (undocumented) -export namespace GithubDeploymentsTable { - var // Warning: (ae-forgotten-export) The symbol "columnFactories" needs to be exported by the entry point index.d.ts - // - // (undocumented) - columns: typeof columnFactories; - var // (undocumented) - defaultDeploymentColumns: TableColumn[]; -} - -// Warning: (ae-missing-release-tag) "GithubStateIndicator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -const GithubStateIndicator: (props: { state: string }) => JSX.Element; - -// Warning: (ae-missing-release-tag) "isGithubDeploymentsAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const isGithubDeploymentsAvailable: (entity: Entity) => boolean; + +// @public (undocumented) +type Node_2 = { + logUrl?: string; +}; +export { Node_2 as Node }; ``` diff --git a/plugins/github-deployments/src/Router.tsx b/plugins/github-deployments/src/Router.tsx index 5425a49710..1e6990b991 100644 --- a/plugins/github-deployments/src/Router.tsx +++ b/plugins/github-deployments/src/Router.tsx @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Entity } from '@backstage/catalog-model'; +/** @public */ export const GITHUB_PROJECT_SLUG_ANNOTATION = 'github.com/project-slug'; +/** @public */ export const isGithubDeploymentsAvailable = (entity: Entity) => Boolean(entity?.metadata.annotations?.[GITHUB_PROJECT_SLUG_ANNOTATION]); diff --git a/plugins/github-deployments/src/api/index.ts b/plugins/github-deployments/src/api/index.ts index 48363557ff..6e246f7569 100644 --- a/plugins/github-deployments/src/api/index.ts +++ b/plugins/github-deployments/src/api/index.ts @@ -53,10 +53,12 @@ const getBaseUrl = ( return config?.config.apiBaseUrl; }; -type Node = { +/** @public */ +export type Node = { logUrl?: string; }; +/** @public */ export type GithubDeployment = { environment: string; state: string; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx index 68881617f4..e828116f41 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { GithubDeployment, githubDeploymentsApiRef } from '../api'; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx index 2c48f3eef1..61295abff0 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { GithubDeployment } from '../../api'; import { Typography, makeStyles } from '@material-ui/core'; import SyncIcon from '@material-ui/icons/Sync'; -import * as columnFactories from './columns'; +import { columnFactories } from './columns'; import { defaultDeploymentColumns } from './presets'; import { Table, TableColumn } from '@backstage/core-components'; @@ -29,14 +29,13 @@ const useStyles = makeStyles(theme => ({ }, })); -type GithubDeploymentsTableProps = { +/** @public */ +export const GithubDeploymentsTable = (props: { deployments: GithubDeployment[]; isLoading: boolean; reload: () => void; columns: TableColumn[]; -}; - -export function GithubDeploymentsTable(props: GithubDeploymentsTableProps) { +}) => { const { deployments, isLoading, reload, columns } = props; const classes = useStyles(); @@ -64,7 +63,7 @@ export function GithubDeploymentsTable(props: GithubDeploymentsTableProps) { } /> ); -} +}; GithubDeploymentsTable.columns = columnFactories; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx index 9a720c0e75..5dffdd9089 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import { GithubDeployment } from '../../api'; import { DateTime } from 'luxon'; @@ -43,50 +44,54 @@ export const GithubStateIndicator = (props: { state: string }) => { } }; -export function createEnvironmentColumn(): TableColumn { - return { - title: 'Environment', - field: 'environment', - highlight: true, - }; -} +export const columnFactories = Object.freeze({ + createEnvironmentColumn(): TableColumn { + return { + title: 'Environment', + field: 'environment', + highlight: true, + }; + }, -export function createStatusColumn(): TableColumn { - return { - title: 'Status', - render: (row: GithubDeployment): JSX.Element => ( - - - {row.state} - - ), - }; -} - -export function createCommitColumn(): TableColumn { - return { - title: 'Commit', - render: (row: GithubDeployment) => - row.commit && ( - - {row.commit.abbreviatedOid} - + createStatusColumn(): TableColumn { + return { + title: 'Status', + render: (row: GithubDeployment): JSX.Element => ( + + + {row.state} + ), - }; -} + }; + }, -export function createCreatorColumn(): TableColumn { - return { - title: 'Creator', - field: 'creator.login', - }; -} + createCommitColumn(): TableColumn { + return { + title: 'Commit', + render: (row: GithubDeployment) => + row.commit && ( + + {row.commit.abbreviatedOid} + + ), + }; + }, -export function createLastUpdatedColumn(): TableColumn { - return { - title: 'Last Updated', - render: (row: GithubDeployment): JSX.Element => ( - {DateTime.fromISO(row.updatedAt).toRelative({ locale: 'en' })} - ), - }; -} + createCreatorColumn(): TableColumn { + return { + title: 'Creator', + field: 'creator.login', + }; + }, + + createLastUpdatedColumn(): TableColumn { + return { + title: 'Last Updated', + render: (row: GithubDeployment): JSX.Element => ( + + {DateTime.fromISO(row.updatedAt).toRelative({ locale: 'en' })} + + ), + }; + }, +}); diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/index.ts b/plugins/github-deployments/src/components/GithubDeploymentsTable/index.ts index 14cf093337..e3d57629b5 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/index.ts +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { GithubDeploymentsTable } from './GithubDeploymentsTable'; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts b/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts index ba48857c3c..af0e21ea23 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts @@ -13,20 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { GithubDeployment } from '../../api'; -import { - createEnvironmentColumn, - createStatusColumn, - createCommitColumn, - createLastUpdatedColumn, - createCreatorColumn, -} from './columns'; +import { columnFactories } from './columns'; import { TableColumn } from '@backstage/core-components'; export const defaultDeploymentColumns: TableColumn[] = [ - createEnvironmentColumn(), - createStatusColumn(), - createCommitColumn(), - createCreatorColumn(), - createLastUpdatedColumn(), + columnFactories.createEnvironmentColumn(), + columnFactories.createStatusColumn(), + columnFactories.createCommitColumn(), + columnFactories.createCreatorColumn(), + columnFactories.createLastUpdatedColumn(), ]; diff --git a/plugins/github-deployments/src/index.ts b/plugins/github-deployments/src/index.ts index 55c1d2f2d2..7806da54ba 100644 --- a/plugins/github-deployments/src/index.ts +++ b/plugins/github-deployments/src/index.ts @@ -20,6 +20,10 @@ * @packageDocumentation */ +export type { Node, GithubDeployment } from './api'; export { githubDeploymentsPlugin, EntityGithubDeploymentsCard } from './plugin'; export { GithubDeploymentsTable } from './components/GithubDeploymentsTable'; -export { isGithubDeploymentsAvailable } from './Router'; +export { + isGithubDeploymentsAvailable, + GITHUB_PROJECT_SLUG_ANNOTATION, +} from './Router'; diff --git a/plugins/github-deployments/src/plugin.ts b/plugins/github-deployments/src/plugin.ts index 5c4ef9c3e4..1d5dee57bc 100644 --- a/plugins/github-deployments/src/plugin.ts +++ b/plugins/github-deployments/src/plugin.ts @@ -22,6 +22,7 @@ import { githubAuthApiRef, } from '@backstage/core-plugin-api'; +/** @public */ export const githubDeploymentsPlugin = createPlugin({ id: 'github-deployments', apis: [ @@ -37,6 +38,7 @@ export const githubDeploymentsPlugin = createPlugin({ ], }); +/** @public */ export const EntityGithubDeploymentsCard = githubDeploymentsPlugin.provide( createComponentExtension({ name: 'EntityGithubDeploymentsCard', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 6368414951..3ba5af6c7b 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -203,7 +203,6 @@ const ALLOW_WARNINGS = [ 'plugins/catalog-import', 'plugins/cost-insights', 'plugins/git-release-manager', - 'plugins/github-deployments', 'plugins/github-pull-requests-board', 'plugins/jenkins', 'plugins/kubernetes', From 249a3b47dffc2541d23dcdcb9a42c3b95d0181bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:37:12 +0200 Subject: [PATCH 35/41] cost-insights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/cost-insights/api-report.md | 261 +++++------------- .../src/alerts/ProjectGrowthAlert.tsx | 3 +- .../src/alerts/UnlabeledDataflowAlert.tsx | 3 +- .../cost-insights/src/api/CostInsightsApi.ts | 3 + .../src/components/BarChart/BarChart.tsx | 22 +- .../components/BarChart/BarChartLegend.tsx | 14 +- .../components/BarChart/BarChartTooltip.tsx | 15 +- .../BarChart/BarChartTooltipItem.tsx | 8 +- .../src/components/CostGrowth/CostGrowth.tsx | 6 +- .../CostGrowth/CostGrowthIndicator.tsx | 13 +- .../src/components/LegendItem/LegendItem.tsx | 12 +- plugins/cost-insights/src/example/client.ts | 1 + plugins/cost-insights/src/hooks/useConfig.tsx | 1 + .../cost-insights/src/hooks/useCurrency.tsx | 1 + plugins/cost-insights/src/index.ts | 5 + plugins/cost-insights/src/plugin.ts | 4 + .../cost-insights/src/testUtils/providers.tsx | 52 ++-- plugins/cost-insights/src/types/Alert.ts | 27 +- .../src/types/ChangeStatistic.ts | 3 + .../cost-insights/src/types/CurrencyType.ts | 1 + plugins/cost-insights/src/types/DateFormat.ts | 1 + plugins/cost-insights/src/types/Icon.ts | 2 + plugins/cost-insights/src/types/Loading.ts | 1 + plugins/cost-insights/src/types/Theme.ts | 11 +- plugins/cost-insights/src/types/index.ts | 11 + scripts/api-extractor.ts | 1 - 26 files changed, 222 insertions(+), 260 deletions(-) diff --git a/plugins/cost-insights/api-report.md b/plugins/cost-insights/api-report.md index 2a4cecc4eb..f4c8c9bd6f 100644 --- a/plugins/cost-insights/api-report.md +++ b/plugins/cost-insights/api-report.md @@ -25,8 +25,6 @@ import { SetStateAction } from 'react'; import { TooltipProps } from 'recharts'; import { TypographyProps } from '@material-ui/core'; -// Warning: (ae-missing-release-tag) "Alert" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type Alert = { title: string | JSX.Element; @@ -43,8 +41,6 @@ export type Alert = { onDismissed?(options: AlertOptions): Promise; }; -// Warning: (ae-missing-release-tag) "AlertCost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface AlertCost { // (undocumented) @@ -53,8 +49,6 @@ export interface AlertCost { id: string; } -// Warning: (ae-missing-release-tag) "AlertDismissFormData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface AlertDismissFormData { // (undocumented) @@ -65,8 +59,6 @@ export interface AlertDismissFormData { reason: AlertDismissReason; } -// Warning: (ae-missing-release-tag) "AlertDismissOption" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface AlertDismissOption { // (undocumented) @@ -75,13 +67,9 @@ export interface AlertDismissOption { reason: string; } -// Warning: (ae-missing-release-tag) "AlertDismissOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const AlertDismissOptions: AlertDismissOption[]; -// Warning: (ae-missing-release-tag) "AlertDismissReason" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum AlertDismissReason { // (undocumented) @@ -98,8 +86,6 @@ export enum AlertDismissReason { Seasonal = 'seasonal', } -// Warning: (ae-missing-release-tag) "AlertForm" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type AlertForm< A extends Alert = any, @@ -108,8 +94,6 @@ export type AlertForm< AlertFormProps & RefAttributes >; -// Warning: (ae-missing-release-tag) "AlertFormProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type AlertFormProps = { alert: A; @@ -117,8 +101,6 @@ export type AlertFormProps = { disableSubmit: (isDisabled: boolean) => void; }; -// Warning: (ae-missing-release-tag) "AlertOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface AlertOptions { // (undocumented) @@ -127,29 +109,21 @@ export interface AlertOptions { group: string; } -// Warning: (ae-missing-release-tag) "AlertSnoozeFormData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface AlertSnoozeFormData { // (undocumented) intervals: string; } -// Warning: (ae-missing-release-tag) "AlertSnoozeOption" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type AlertSnoozeOption = { label: string; duration: Duration; }; -// Warning: (ae-missing-release-tag) "AlertSnoozeOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const AlertSnoozeOptions: AlertSnoozeOption[]; -// Warning: (ae-missing-release-tag) "AlertStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum AlertStatus { // (undocumented) @@ -160,36 +134,17 @@ export enum AlertStatus { Snoozed = 'snoozed', } -// Warning: (ae-missing-release-tag) "BarChart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const BarChart: ({ - resources, - responsive, - displayAmount, - options, - tooltip, - onClick, - onMouseMove, -}: BarChartProps) => JSX.Element; +export const BarChart: (props: BarChartProps) => JSX.Element; -// Warning: (ae-missing-release-tag) "BarChartData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public +// @public @deprecated (undocumented) export interface BarChartData extends BarChartOptions {} -// Warning: (ae-missing-release-tag) "BarChartLegend" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const BarChartLegend: ({ - costStart, - costEnd, - options, - children, -}: PropsWithChildren) => JSX.Element; +export const BarChartLegend: ( + props: PropsWithChildren, +) => JSX.Element; -// Warning: (ae-missing-release-tag) "BarChartLegendOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BarChartLegendOptions = { previousName: string; @@ -199,8 +154,6 @@ export type BarChartLegendOptions = { hideMarker?: boolean; }; -// Warning: (ae-missing-release-tag) "BarChartLegendProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BarChartLegendProps = { costStart: number; @@ -208,8 +161,6 @@ export type BarChartLegendProps = { options?: Partial; }; -// Warning: (ae-missing-release-tag) "BarChartOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface BarChartOptions { // (undocumented) @@ -222,8 +173,6 @@ export interface BarChartOptions { previousName: string; } -// Warning: (ae-missing-release-tag) "BarChartProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BarChartProps = { resources: ResourceData[]; @@ -235,34 +184,21 @@ export type BarChartProps = { onMouseMove?: RechartsFunction; }; -// Warning: (ae-missing-release-tag) "BarChartTooltip" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const BarChartTooltip: ({ - title, - content, - subtitle, - topRight, - actions, - children, -}: PropsWithChildren) => JSX.Element; +export const BarChartTooltip: ( + props: PropsWithChildren, +) => JSX.Element; -// Warning: (ae-missing-release-tag) "BarChartTooltipItem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const BarChartTooltipItem: ({ - item, -}: BarChartTooltipItemProps) => JSX.Element; +export const BarChartTooltipItem: ( + props: BarChartTooltipItemProps, +) => JSX.Element; -// Warning: (ae-missing-release-tag) "BarChartTooltipItemProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BarChartTooltipItemProps = { item: TooltipItem; }; -// Warning: (ae-missing-release-tag) "BarChartTooltipProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type BarChartTooltipProps = { title: string; @@ -272,13 +208,9 @@ export type BarChartTooltipProps = { actions?: ReactNode; }; -// Warning: (ae-missing-release-tag) "ChangeStatistic" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type ChangeStatistic = common.ChangeStatistic; -// Warning: (ae-missing-release-tag) "ChangeThreshold" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum ChangeThreshold { // (undocumented) @@ -295,28 +227,26 @@ export type ChartData = { [key: string]: number; }; -// Warning: (ae-missing-release-tag) "Cost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type ConfigContextProps = { + metrics: Metric[]; + products: Product[]; + icons: Icon[]; + engineerCost: number; + currencies: Currency[]; +}; + // @public @deprecated (undocumented) export type Cost = common.Cost; -// Warning: (ae-missing-release-tag) "CostGrowth" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const CostGrowth: ({ change, duration }: CostGrowthProps) => JSX.Element; +export const CostGrowth: (props: CostGrowthProps) => JSX.Element; -// Warning: (ae-missing-release-tag) "CostGrowthIndicator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const CostGrowthIndicator: ({ - change, - formatter, - className, - ...props -}: CostGrowthIndicatorProps) => JSX.Element; +export const CostGrowthIndicator: ( + props: CostGrowthIndicatorProps, +) => JSX.Element; -// Warning: (ae-missing-release-tag) "CostGrowthIndicatorProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type CostGrowthIndicatorProps = TypographyProps & { change: ChangeStatistic; @@ -328,16 +258,12 @@ export type CostGrowthIndicatorProps = TypographyProps & { ) => Maybe; }; -// Warning: (ae-missing-release-tag) "CostGrowthProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type CostGrowthProps = { change: ChangeStatistic; duration: Duration; }; -// Warning: (ae-missing-release-tag) "CostInsightsApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type CostInsightsApi = { getLastCompleteBillingDate(): Promise; @@ -350,36 +276,36 @@ export type CostInsightsApi = { getAlerts(group: string): Promise; }; -// Warning: (ae-missing-release-tag) "costInsightsApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const costInsightsApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "CostInsightsLabelDataflowInstructionsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const CostInsightsLabelDataflowInstructionsPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "CostInsightsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const CostInsightsPage: () => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "CostInsightsPaletteAdditions" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "CostInsightsPalette" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type CostInsightsPalette = BackstagePalette & CostInsightsPaletteAdditions; -// Warning: (ae-missing-release-tag) "CostInsightsPaletteOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type CostInsightsPaletteAdditions = { + blue: string; + lightBlue: string; + darkBlue: string; + magenta: string; + yellow: string; + tooltip: CostInsightsTooltipOptions; + navigationText: string; + alertBackground: string; + dataViz: string[]; +}; + // @public (undocumented) export type CostInsightsPaletteOptions = PaletteOptions & CostInsightsPaletteAdditions; -// Warning: (ae-missing-release-tag) "costInsightsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) const costInsightsPlugin: BackstagePlugin< { @@ -393,27 +319,27 @@ const costInsightsPlugin: BackstagePlugin< export { costInsightsPlugin }; export { costInsightsPlugin as plugin }; -// Warning: (ae-missing-release-tag) "CostInsightsProjectGrowthInstructionsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const CostInsightsProjectGrowthInstructionsPage: () => JSX.Element; -// Warning: (ae-missing-release-tag) "CostInsightsTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface CostInsightsTheme extends BackstageTheme { // (undocumented) palette: CostInsightsPalette; } -// Warning: (ae-missing-release-tag) "CostInsightsThemeOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface CostInsightsThemeOptions extends PaletteOptions { // (undocumented) palette: CostInsightsPaletteOptions; } +// @public (undocumented) +export type CostInsightsTooltipOptions = { + background: string; + color: string; +}; + // @public (undocumented) export interface Currency { // (undocumented) @@ -428,8 +354,12 @@ export interface Currency { unit: string; } -// Warning: (ae-missing-release-tag) "CurrencyType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export type CurrencyContextProps = { + currency: Currency; + setCurrency: Dispatch>; +}; + // @public (undocumented) export enum CurrencyType { // (undocumented) @@ -442,8 +372,6 @@ export enum CurrencyType { USD = 'USD', } -// Warning: (ae-missing-release-tag) "DataKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum DataKey { // (undocumented) @@ -454,13 +382,9 @@ export enum DataKey { Previous = 'previous', } -// Warning: (ae-missing-release-tag) "DateAggregation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type DateAggregation = common.DateAggregation; -// Warning: (ae-missing-release-tag) "DEFAULT_DATE_FORMAT" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd'; @@ -476,18 +400,12 @@ export enum Duration { P90D = 'P90D', } -// Warning: (ae-missing-release-tag) "EngineerThreshold" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EngineerThreshold = 0.5; -// Warning: (ae-missing-release-tag) "Entity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Entity = common.Entity; -// Warning: (ae-missing-release-tag) "ExampleCostInsightsClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class ExampleCostInsightsClient implements CostInsightsApi { // (undocumented) @@ -508,13 +426,9 @@ export class ExampleCostInsightsClient implements CostInsightsApi { getUserGroups(userId: string): Promise; } -// Warning: (ae-missing-release-tag) "Group" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Group = common.Group; -// Warning: (ae-missing-release-tag) "GrowthType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum GrowthType { // (undocumented) @@ -525,16 +439,12 @@ export enum GrowthType { Savings = 1, } -// Warning: (ae-missing-release-tag) "Icon" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Icon = { kind: string; component: JSX.Element; }; -// Warning: (ae-missing-release-tag) "IconType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum IconType { // (undocumented) @@ -551,18 +461,11 @@ export enum IconType { Storage = 'storage', } -// Warning: (ae-missing-release-tag) "LegendItem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const LegendItem: ({ - title, - tooltipText, - markerColor, - children, -}: PropsWithChildren) => JSX.Element; +export const LegendItem: ( + props: PropsWithChildren, +) => JSX.Element; -// Warning: (ae-missing-release-tag) "LegendItemProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type LegendItemProps = { title: string; @@ -570,43 +473,37 @@ export type LegendItemProps = { markerColor?: string; }; -// Warning: (ae-missing-release-tag) "Loading" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type Loading = Record; -// Warning: (ae-missing-release-tag) "Maybe" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Maybe = common.Maybe; -// Warning: (ae-missing-release-tag) "Metric" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Metric = common.Metric; -// Warning: (ae-missing-release-tag) "MetricData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type MetricData = common.MetricData; -// Warning: (ae-forgotten-export) The symbol "MockConfigProviderProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "MockConfigProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const MockConfigProvider: ({ - children, - ...context -}: MockConfigProviderProps) => JSX.Element; +export const MockConfigProvider: ( + props: MockConfigProviderProps, +) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "MockCurrencyProviderProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "MockCurrencyProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export const MockCurrencyProvider: ({ - children, - ...context -}: MockCurrencyProviderProps) => JSX.Element; +export type MockConfigProviderProps = PropsWithChildren< + Partial +>; + +// @public (undocumented) +export const MockCurrencyProvider: ( + props: MockCurrencyProviderProps, +) => JSX.Element; + +// @public (undocumented) +export type MockCurrencyProviderProps = PropsWithChildren< + Partial +>; // @public (undocumented) export interface PageFilters { @@ -620,16 +517,12 @@ export interface PageFilters { project: Maybe_2; } -// Warning: (ae-missing-release-tag) "Product" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Product = common.Product; // @public (undocumented) export type ProductFilters = Array; -// Warning: (ae-missing-release-tag) "ProductInsightsOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type ProductInsightsOptions = { product: string; @@ -646,13 +539,9 @@ export interface ProductPeriod { productType: string; } -// Warning: (ae-missing-release-tag) "Project" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Project = common.Project; -// Warning: (ae-missing-release-tag) "ProjectGrowthAlert" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class ProjectGrowthAlert implements Alert { constructor(data: ProjectGrowthData); @@ -668,8 +557,6 @@ export class ProjectGrowthAlert implements Alert { get url(): string; } -// Warning: (ae-missing-release-tag) "ProjectGrowthData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ProjectGrowthData { // (undocumented) @@ -686,8 +573,6 @@ export interface ProjectGrowthData { project: string; } -// Warning: (ae-missing-release-tag) "ResourceData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ResourceData { // (undocumented) @@ -698,8 +583,6 @@ export interface ResourceData { previous: number; } -// Warning: (ae-missing-release-tag) "TooltipItem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type TooltipItem = { fill: string; @@ -707,13 +590,9 @@ export type TooltipItem = { value: string; }; -// Warning: (ae-missing-release-tag) "Trendline" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public @deprecated (undocumented) export type Trendline = common.Trendline; -// Warning: (ae-missing-release-tag) "UnlabeledDataflowAlert" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export class UnlabeledDataflowAlert implements Alert { constructor(data: UnlabeledDataflowData); @@ -731,8 +610,6 @@ export class UnlabeledDataflowAlert implements Alert { get url(): string; } -// Warning: (ae-missing-release-tag) "UnlabeledDataflowAlertProject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface UnlabeledDataflowAlertProject { // (undocumented) @@ -743,8 +620,6 @@ export interface UnlabeledDataflowAlertProject { unlabeledCost: number; } -// Warning: (ae-missing-release-tag) "UnlabeledDataflowData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface UnlabeledDataflowData { // (undocumented) diff --git a/plugins/cost-insights/src/alerts/ProjectGrowthAlert.tsx b/plugins/cost-insights/src/alerts/ProjectGrowthAlert.tsx index 6767477f67..f432a14ff8 100644 --- a/plugins/cost-insights/src/alerts/ProjectGrowthAlert.tsx +++ b/plugins/cost-insights/src/alerts/ProjectGrowthAlert.tsx @@ -22,8 +22,9 @@ import { Alert, ProjectGrowthData } from '../types'; * The alert below is an example of an Alert implementation; the CostInsightsApi permits returning * any implementation of the Alert type, so adopters can create their own. The CostInsightsApi * fetches alert data from the backend, then creates Alert classes with the data. + * + * @public */ - export class ProjectGrowthAlert implements Alert { data: ProjectGrowthData; diff --git a/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.tsx b/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.tsx index da96f7d1f8..b4ee3d559c 100644 --- a/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.tsx +++ b/plugins/cost-insights/src/alerts/UnlabeledDataflowAlert.tsx @@ -22,8 +22,9 @@ import { Alert, AlertStatus, UnlabeledDataflowData } from '../types'; * The alert below is an example of an Alert implementation; the CostInsightsApi permits returning * any implementation of the Alert type, so adopters can create their own. The CostInsightsApi * fetches alert data from the backend, then creates Alert classes with the data. + * + * @public */ - export class UnlabeledDataflowAlert implements Alert { data: UnlabeledDataflowData; status?: AlertStatus; diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index 558cb57c0e..3c97407f08 100644 --- a/plugins/cost-insights/src/api/CostInsightsApi.ts +++ b/plugins/cost-insights/src/api/CostInsightsApi.ts @@ -25,6 +25,7 @@ import { } from '../types'; import { createApiRef } from '@backstage/core-plugin-api'; +/** @public */ export type ProductInsightsOptions = { /** * The product from the cost-insights configuration in app-config.yaml @@ -47,6 +48,7 @@ export type ProductInsightsOptions = { project: Maybe; }; +/** @public */ export type CostInsightsApi = { /** * Get the most current date for which billing data is complete, in YYYY-MM-DD format. This helps @@ -146,6 +148,7 @@ export type CostInsightsApi = { getAlerts(group: string): Promise; }; +/** @public */ export const costInsightsApiRef = createApiRef({ id: 'plugin.costinsights.service', }); diff --git a/plugins/cost-insights/src/components/BarChart/BarChart.tsx b/plugins/cost-insights/src/components/BarChart/BarChart.tsx index 27ef69db7a..145819db08 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChart.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChart.tsx @@ -61,6 +61,7 @@ export const defaultTooltip: ContentRenderer = ({ ); }; +/** @public */ export type BarChartProps = { resources: ResourceData[]; responsive?: boolean; @@ -71,15 +72,18 @@ export type BarChartProps = { onMouseMove?: RechartsFunction; }; -export const BarChart = ({ - resources, - responsive = true, - displayAmount = 6, - options = {}, - tooltip = defaultTooltip, - onClick, - onMouseMove, -}: BarChartProps) => { +/** @public */ +export const BarChart = (props: BarChartProps) => { + const { + resources, + responsive = true, + displayAmount = 6, + options = {}, + tooltip = defaultTooltip, + onClick, + onMouseMove, + } = props; + const theme = useTheme(); const styles = useBarChartStyles(theme); const [activeChart, setActiveChart] = useState(false); diff --git a/plugins/cost-insights/src/components/BarChart/BarChartLegend.tsx b/plugins/cost-insights/src/components/BarChart/BarChartLegend.tsx index e7afe5fa59..72c3120dd4 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChartLegend.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChartLegend.tsx @@ -21,6 +21,7 @@ import { currencyFormatter } from '../../utils/formatters'; import { CostInsightsTheme } from '../../types'; import { useBarChartLayoutStyles as useStyles } from '../../utils/styles'; +/** @public */ export type BarChartLegendOptions = { previousName: string; previousFill: string; @@ -29,18 +30,19 @@ export type BarChartLegendOptions = { hideMarker?: boolean; }; +/** @public */ export type BarChartLegendProps = { costStart: number; costEnd: number; options?: Partial; }; -export const BarChartLegend = ({ - costStart, - costEnd, - options = {}, - children, -}: PropsWithChildren) => { +/** @public */ +export const BarChartLegend = ( + props: PropsWithChildren, +) => { + const { costStart, costEnd, options = {}, children } = props; + const theme = useTheme(); const classes = useStyles(); diff --git a/plugins/cost-insights/src/components/BarChart/BarChartTooltip.tsx b/plugins/cost-insights/src/components/BarChart/BarChartTooltip.tsx index 101f0cbb8c..0b522e5e09 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChartTooltip.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChartTooltip.tsx @@ -19,6 +19,7 @@ import classnames from 'classnames'; import { Box, Divider, Typography } from '@material-ui/core'; import { useTooltipStyles as useStyles } from '../../utils/styles'; +/** @public */ export type BarChartTooltipProps = { title: string; content?: ReactNode | string; @@ -27,14 +28,12 @@ export type BarChartTooltipProps = { actions?: ReactNode; }; -export const BarChartTooltip = ({ - title, - content, - subtitle, - topRight, - actions, - children, -}: PropsWithChildren) => { +/** @public */ +export const BarChartTooltip = ( + props: PropsWithChildren, +) => { + const { title, content, subtitle, topRight, actions, children } = props; + const classes = useStyles(); const titleClassName = classnames(classes.truncate, { [classes.maxWidth]: topRight === undefined, diff --git a/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx b/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx index 758bc9ffa0..fc50ab979a 100644 --- a/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx +++ b/plugins/cost-insights/src/components/BarChart/BarChartTooltipItem.tsx @@ -19,18 +19,24 @@ import { Box, Typography } from '@material-ui/core'; import LensIcon from '@material-ui/icons/Lens'; import { useTooltipStyles as useStyles } from '../../utils/styles'; +/** @public */ export type TooltipItem = { fill: string; label: string; value: string; }; +/** @public */ export type BarChartTooltipItemProps = { item: TooltipItem; }; -export const BarChartTooltipItem = ({ item }: BarChartTooltipItemProps) => { +/** @public */ +export const BarChartTooltipItem = (props: BarChartTooltipItemProps) => { + const { item } = props; + const classes = useStyles(); + return ( { +/** @public */ +export const CostGrowth = (props: CostGrowthProps) => { + const { change, duration } = props; + const styles = useStyles(); const { engineerCost } = useConfig(); const [currency] = useCurrency(); diff --git a/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx b/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx index e7746495d6..8993504c84 100644 --- a/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx +++ b/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx @@ -23,6 +23,7 @@ import { growthOf } from '../../utils/change'; import { ChangeStatistic, GrowthType, Maybe } from '../../types'; import { useCostGrowthStyles as useStyles } from '../../utils/styles'; +/** @public */ export type CostGrowthIndicatorProps = TypographyProps & { change: ChangeStatistic; formatter?: ( @@ -31,12 +32,10 @@ export type CostGrowthIndicatorProps = TypographyProps & { ) => Maybe; }; -export const CostGrowthIndicator = ({ - change, - formatter, - className, - ...props -}: CostGrowthIndicatorProps) => { +/** @public */ +export const CostGrowthIndicator = (props: CostGrowthIndicatorProps) => { + const { change, formatter, className, ...extraProps } = props; + const classes = useStyles(); const growth = growthOf(change); @@ -46,7 +45,7 @@ export const CostGrowthIndicator = ({ }); return ( - + {formatter ? formatter(change, { absolute: true }) : change.ratio} {growth === GrowthType.Excess && } {growth === GrowthType.Savings && } diff --git a/plugins/cost-insights/src/components/LegendItem/LegendItem.tsx b/plugins/cost-insights/src/components/LegendItem/LegendItem.tsx index 92dc706003..0b8a993b39 100644 --- a/plugins/cost-insights/src/components/LegendItem/LegendItem.tsx +++ b/plugins/cost-insights/src/components/LegendItem/LegendItem.tsx @@ -20,19 +20,19 @@ import LensIcon from '@material-ui/icons/Lens'; import HelpOutlineOutlinedIcon from '@material-ui/icons/HelpOutlineOutlined'; import { useCostGrowthLegendStyles } from '../../utils/styles'; +/** @public */ export type LegendItemProps = { title: string; tooltipText?: string; markerColor?: string; }; -export const LegendItem = ({ - title, - tooltipText, - markerColor, - children, -}: PropsWithChildren) => { +/** @public */ +export const LegendItem = (props: PropsWithChildren) => { + const { title, tooltipText, markerColor, children } = props; + const classes = useCostGrowthLegendStyles(); + return ( { return new Promise(resolve => setTimeout(resolve, 0, res)); diff --git a/plugins/cost-insights/src/hooks/useConfig.tsx b/plugins/cost-insights/src/hooks/useConfig.tsx index 236c142b3b..322e1e35f1 100644 --- a/plugins/cost-insights/src/hooks/useConfig.tsx +++ b/plugins/cost-insights/src/hooks/useConfig.tsx @@ -58,6 +58,7 @@ import { configApiRef, useApi } from '@backstage/core-plugin-api'; * rate: 3.5 */ +/** @public */ export type ConfigContextProps = { metrics: Metric[]; products: Product[]; diff --git a/plugins/cost-insights/src/hooks/useCurrency.tsx b/plugins/cost-insights/src/hooks/useCurrency.tsx index 13458ee432..32dc907578 100644 --- a/plugins/cost-insights/src/hooks/useCurrency.tsx +++ b/plugins/cost-insights/src/hooks/useCurrency.tsx @@ -23,6 +23,7 @@ import React, { import { Currency } from '../types'; import { useConfig } from './useConfig'; +/** @public */ export type CurrencyContextProps = { currency: Currency; setCurrency: Dispatch>; diff --git a/plugins/cost-insights/src/index.ts b/plugins/cost-insights/src/index.ts index b9a4bb83e0..2c46156005 100644 --- a/plugins/cost-insights/src/index.ts +++ b/plugins/cost-insights/src/index.ts @@ -38,8 +38,13 @@ export { LegendItem, } from './components'; export { MockConfigProvider, MockCurrencyProvider } from './testUtils'; +export type { + MockConfigProviderProps, + MockCurrencyProviderProps, +} from './testUtils'; export * from './api'; export * from './alerts'; +export type { ConfigContextProps, CurrencyContextProps } from './hooks'; export * from './types'; export type { diff --git a/plugins/cost-insights/src/plugin.ts b/plugins/cost-insights/src/plugin.ts index a422098e08..789d803438 100644 --- a/plugins/cost-insights/src/plugin.ts +++ b/plugins/cost-insights/src/plugin.ts @@ -32,6 +32,7 @@ export const unlabeledDataflowAlertRef = createRouteRef({ id: 'cost-insights:labeling-jobs', }); +/** @public */ export const costInsightsPlugin = createPlugin({ id: 'cost-insights', featureFlags: [{ name: 'cost-insights-currencies' }], @@ -42,6 +43,7 @@ export const costInsightsPlugin = createPlugin({ }, }); +/** @public */ export const CostInsightsPage = costInsightsPlugin.provide( createRoutableExtension({ name: 'CostInsightsPage', @@ -51,6 +53,7 @@ export const CostInsightsPage = costInsightsPlugin.provide( }), ); +/** @public */ export const CostInsightsProjectGrowthInstructionsPage = costInsightsPlugin.provide( createRoutableExtension({ @@ -63,6 +66,7 @@ export const CostInsightsProjectGrowthInstructionsPage = }), ); +/** @public */ export const CostInsightsLabelDataflowInstructionsPage = costInsightsPlugin.provide( createRoutableExtension({ diff --git a/plugins/cost-insights/src/testUtils/providers.tsx b/plugins/cost-insights/src/testUtils/providers.tsx index efcb15b5a3..8088fca3c6 100644 --- a/plugins/cost-insights/src/testUtils/providers.tsx +++ b/plugins/cost-insights/src/testUtils/providers.tsx @@ -27,12 +27,11 @@ import { import { ScrollContext, ScrollContextProps } from '../hooks/useScroll'; import { Group, Duration } from '../types'; -type PartialPropsWithChildren = PropsWithChildren>; - export const MockGroups: Group[] = [{ id: 'tech' }, { id: 'mock-group' }]; -export type MockFilterProviderProps = - PartialPropsWithChildren; +export type MockFilterProviderProps = PropsWithChildren< + Partial +>; export const MockFilterProvider = ({ children, @@ -56,8 +55,9 @@ export const MockFilterProvider = ({ ); }; -export type MockLoadingProviderProps = - PartialPropsWithChildren; +export type MockLoadingProviderProps = PropsWithChildren< + Partial +>; export const MockLoadingProvider = ({ children, @@ -75,13 +75,15 @@ export const MockLoadingProvider = ({ ); }; -export type MockConfigProviderProps = - PartialPropsWithChildren; +/** @public */ +export type MockConfigProviderProps = PropsWithChildren< + Partial +>; + +/** @public */ +export const MockConfigProvider = (props: MockConfigProviderProps) => { + const { children, ...context } = props; -export const MockConfigProvider = ({ - children, - ...context -}: MockConfigProviderProps) => { const defaultContext: ConfigContextProps = { metrics: [], products: [], @@ -89,6 +91,7 @@ export const MockConfigProvider = ({ engineerCost: 0, currencies: [], }; + return ( {children} @@ -96,13 +99,15 @@ export const MockConfigProvider = ({ ); }; -export type MockCurrencyProviderProps = - PartialPropsWithChildren; +/** @public */ +export type MockCurrencyProviderProps = PropsWithChildren< + Partial +>; + +/** @public */ +export const MockCurrencyProvider = (props: MockCurrencyProviderProps) => { + const { children, ...context } = props; -export const MockCurrencyProvider = ({ - children, - ...context -}: MockCurrencyProviderProps) => { const defaultContext: CurrencyContextProps = { currency: { kind: null, @@ -111,6 +116,7 @@ export const MockCurrencyProvider = ({ }, setCurrency: jest.fn(), }; + return ( {children} @@ -118,8 +124,9 @@ export const MockCurrencyProvider = ({ ); }; -export type MockBillingDateProviderProps = - PartialPropsWithChildren; +export type MockBillingDateProviderProps = PropsWithChildren< + Partial +>; export const MockBillingDateProvider = ({ children, @@ -149,8 +156,9 @@ export const MockScrollProvider = ({ children }: MockScrollProviderProps) => { ); }; -export type MockGroupsProviderProps = - PartialPropsWithChildren; +export type MockGroupsProviderProps = PropsWithChildren< + Partial +>; export const MockGroupsProvider = ({ children, diff --git a/plugins/cost-insights/src/types/Alert.ts b/plugins/cost-insights/src/types/Alert.ts index 483b9a654d..0b6773b3a8 100644 --- a/plugins/cost-insights/src/types/Alert.ts +++ b/plugins/cost-insights/src/types/Alert.ts @@ -31,8 +31,9 @@ import { Duration } from './Duration'; * React.forwardRef. See https://reactjs.org/docs/forwarding-refs * * Errors thrown within hooks will generate a snackbar error notification. + * + * @public */ - export type Alert = { title: string | JSX.Element; subtitle: string | JSX.Element; @@ -48,6 +49,7 @@ export type Alert = { onDismissed?(options: AlertOptions): Promise; }; +/** @public */ export type AlertForm< A extends Alert = any, Data = any, @@ -55,6 +57,7 @@ export type AlertForm< AlertFormProps & RefAttributes >; +/** @public */ export interface AlertOptions { data: T; group: string; @@ -69,11 +72,14 @@ export interface AlertOptions { * inclusive of the last day. * * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals + * + * @public */ export interface AlertSnoozeFormData { intervals: string; } +/** @public */ export interface AlertDismissFormData { other: Maybe; reason: AlertDismissReason; @@ -81,23 +87,27 @@ export interface AlertDismissFormData { } // TODO: Convert enum to literal +/** @public */ export enum AlertStatus { Snoozed = 'snoozed', Accepted = 'accepted', Dismissed = 'dismissed', } +/** @public */ export type AlertFormProps = { alert: A; onSubmit: (data: FormData) => void; disableSubmit: (isDisabled: boolean) => void; }; +/** @public */ export interface AlertDismissOption { label: string; reason: string; } +/** @public */ export enum AlertDismissReason { Other = 'other', Resolved = 'resolved', @@ -107,6 +117,7 @@ export enum AlertDismissReason { NotApplicable = 'not-applicable', } +/** @public */ export const AlertDismissOptions: AlertDismissOption[] = [ { reason: AlertDismissReason.Resolved, @@ -134,11 +145,13 @@ export const AlertDismissOptions: AlertDismissOption[] = [ }, ]; +/** @public */ export type AlertSnoozeOption = { label: string; duration: Duration; }; +/** @public */ export const AlertSnoozeOptions: AlertSnoozeOption[] = [ { duration: Duration.P7D, @@ -154,17 +167,20 @@ export const AlertSnoozeOptions: AlertSnoozeOption[] = [ }, ]; +/** @public */ export interface AlertCost { id: string; aggregation: [number, number]; } +/** @public */ export interface ResourceData { previous: number; current: number; name: Maybe; } +/** @public */ export interface BarChartOptions { previousFill: string; currentFill: string; @@ -172,15 +188,20 @@ export interface BarChartOptions { currentName: string; } -/** deprecated use BarChartOptions instead */ +/** + * @public + * @deprecated use BarChartOptions instead + */ export interface BarChartData extends BarChartOptions {} +/** @public */ export enum DataKey { Previous = 'previous', Current = 'current', Name = 'name', } +/** @public */ export interface ProjectGrowthData { project: string; periodStart: string; @@ -190,6 +211,7 @@ export interface ProjectGrowthData { products: Array; } +/** @public */ export interface UnlabeledDataflowData { periodStart: string; periodEnd: string; @@ -198,6 +220,7 @@ export interface UnlabeledDataflowData { labeledCost: number; } +/** @public */ export interface UnlabeledDataflowAlertProject { id: string; unlabeledCost: number; diff --git a/plugins/cost-insights/src/types/ChangeStatistic.ts b/plugins/cost-insights/src/types/ChangeStatistic.ts index 8264b23c8d..ba022aacf3 100644 --- a/plugins/cost-insights/src/types/ChangeStatistic.ts +++ b/plugins/cost-insights/src/types/ChangeStatistic.ts @@ -14,13 +14,16 @@ * limitations under the License. */ +/** @public */ export const EngineerThreshold = 0.5; +/** @public */ export enum ChangeThreshold { upper = 0.05, lower = -0.05, } +/** @public */ export enum GrowthType { Negligible, Savings, diff --git a/plugins/cost-insights/src/types/CurrencyType.ts b/plugins/cost-insights/src/types/CurrencyType.ts index 0316e8f90e..b20c57393f 100644 --- a/plugins/cost-insights/src/types/CurrencyType.ts +++ b/plugins/cost-insights/src/types/CurrencyType.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +/** @public */ export enum CurrencyType { USD = 'USD', CarbonOffsetTons = 'CARBON_OFFSET_TONS', diff --git a/plugins/cost-insights/src/types/DateFormat.ts b/plugins/cost-insights/src/types/DateFormat.ts index c5d9c83f6e..4ada898905 100644 --- a/plugins/cost-insights/src/types/DateFormat.ts +++ b/plugins/cost-insights/src/types/DateFormat.ts @@ -14,4 +14,5 @@ * limitations under the License. */ +/** @public */ export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd'; diff --git a/plugins/cost-insights/src/types/Icon.ts b/plugins/cost-insights/src/types/Icon.ts index 24312677c9..968abd18a6 100644 --- a/plugins/cost-insights/src/types/Icon.ts +++ b/plugins/cost-insights/src/types/Icon.ts @@ -14,11 +14,13 @@ * limitations under the License. */ +/** @public */ export type Icon = { kind: string; component: JSX.Element; }; +/** @public */ export enum IconType { Compute = 'compute', Data = 'data', diff --git a/plugins/cost-insights/src/types/Loading.ts b/plugins/cost-insights/src/types/Loading.ts index eddab2401e..36dc0159c5 100644 --- a/plugins/cost-insights/src/types/Loading.ts +++ b/plugins/cost-insights/src/types/Loading.ts @@ -14,4 +14,5 @@ * limitations under the License. */ +/** @public */ export type Loading = Record; diff --git a/plugins/cost-insights/src/types/Theme.ts b/plugins/cost-insights/src/types/Theme.ts index 943bf29a12..39b4428a9f 100644 --- a/plugins/cost-insights/src/types/Theme.ts +++ b/plugins/cost-insights/src/types/Theme.ts @@ -13,15 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { BackstagePalette, BackstageTheme } from '@backstage/theme'; import { PaletteOptions } from '@material-ui/core/styles/createPalette'; -type CostInsightsTooltipOptions = { +/** @public */ +export type CostInsightsTooltipOptions = { background: string; color: string; }; -type CostInsightsPaletteAdditions = { +/** @public */ +export type CostInsightsPaletteAdditions = { blue: string; lightBlue: string; darkBlue: string; @@ -33,16 +36,20 @@ type CostInsightsPaletteAdditions = { dataViz: string[]; }; +/** @public */ export type CostInsightsPalette = BackstagePalette & CostInsightsPaletteAdditions; +/** @public */ export type CostInsightsPaletteOptions = PaletteOptions & CostInsightsPaletteAdditions; +/** @public */ export interface CostInsightsThemeOptions extends PaletteOptions { palette: CostInsightsPaletteOptions; } +/** @public */ export interface CostInsightsTheme extends BackstageTheme { palette: CostInsightsPalette; } diff --git a/plugins/cost-insights/src/types/index.ts b/plugins/cost-insights/src/types/index.ts index b836914e73..750114d3ec 100644 --- a/plugins/cost-insights/src/types/index.ts +++ b/plugins/cost-insights/src/types/index.ts @@ -35,45 +35,56 @@ import * as common from '@backstage/plugin-cost-insights-common'; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type ChangeStatistic = common.ChangeStatistic; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Cost = common.Cost; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type DateAggregation = common.DateAggregation; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Entity = common.Entity; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Group = common.Group; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Maybe = common.Maybe; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Metric = common.Metric; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type MetricData = common.MetricData; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Product = common.Product; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Project = common.Project; /** * @deprecated use the same type from `@backstage/plugin-cost-insights-common` instead + * @public */ export type Trendline = common.Trendline; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 3ba5af6c7b..8407f5350a 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -201,7 +201,6 @@ const ALLOW_WARNINGS = [ 'packages/core-components', 'plugins/catalog', 'plugins/catalog-import', - 'plugins/cost-insights', 'plugins/git-release-manager', 'plugins/github-pull-requests-board', 'plugins/jenkins', From 75a5e2948962a1f7095fac07dd11ad75dd549528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:38:51 +0200 Subject: [PATCH 36/41] github-pull-requests-board MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/github-pull-requests-board/api-report.md | 4 ---- plugins/github-pull-requests-board/src/plugin.ts | 2 ++ scripts/api-extractor.ts | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/github-pull-requests-board/api-report.md b/plugins/github-pull-requests-board/api-report.md index 33814c76b4..1657d455b5 100644 --- a/plugins/github-pull-requests-board/api-report.md +++ b/plugins/github-pull-requests-board/api-report.md @@ -7,13 +7,9 @@ import { FunctionComponent } from 'react'; -// Warning: (ae-missing-release-tag) "EntityTeamPullRequestsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityTeamPullRequestsCard: FunctionComponent<{}>; -// Warning: (ae-missing-release-tag) "EntityTeamPullRequestsContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const EntityTeamPullRequestsContent: FunctionComponent<{}>; diff --git a/plugins/github-pull-requests-board/src/plugin.ts b/plugins/github-pull-requests-board/src/plugin.ts index c3ed426dec..87aea76d31 100644 --- a/plugins/github-pull-requests-board/src/plugin.ts +++ b/plugins/github-pull-requests-board/src/plugin.ts @@ -27,6 +27,7 @@ const githubPullRequestsBoardPlugin = createPlugin({ }, }); +/** @public */ export const EntityTeamPullRequestsCard = githubPullRequestsBoardPlugin.provide( createComponentExtension({ name: 'EntityTeamPullRequestsCard', @@ -39,6 +40,7 @@ export const EntityTeamPullRequestsCard = githubPullRequestsBoardPlugin.provide( }), ); +/** @public */ export const EntityTeamPullRequestsContent = githubPullRequestsBoardPlugin.provide( createRoutableExtension({ diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 8407f5350a..27b42d7bd5 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -202,7 +202,6 @@ const ALLOW_WARNINGS = [ 'plugins/catalog', 'plugins/catalog-import', 'plugins/git-release-manager', - 'plugins/github-pull-requests-board', 'plugins/jenkins', 'plugins/kubernetes', 'plugins/kubernetes-common', From 4ad7c486844a0423cb35cd58dfb6db9449b9087c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:42:12 +0200 Subject: [PATCH 37/41] kubernetes-common MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/kubernetes-common/api-report.md | 50 ------------------------- plugins/kubernetes-common/src/types.ts | 25 +++++++++++++ scripts/api-extractor.ts | 1 - 3 files changed, 25 insertions(+), 51 deletions(-) diff --git a/plugins/kubernetes-common/api-report.md b/plugins/kubernetes-common/api-report.md index f8a8c6b460..ef36d5ce28 100644 --- a/plugins/kubernetes-common/api-report.md +++ b/plugins/kubernetes-common/api-report.md @@ -18,13 +18,9 @@ import { V1ReplicaSet } from '@kubernetes/client-node'; import { V1Service } from '@kubernetes/client-node'; import { V1StatefulSet } from '@kubernetes/client-node'; -// Warning: (ae-missing-release-tag) "AuthProviderType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type AuthProviderType = 'google' | 'serviceAccount' | 'aws' | 'azure'; -// Warning: (ae-missing-release-tag) "ClientContainerStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ClientContainerStatus { // (undocumented) @@ -35,8 +31,6 @@ export interface ClientContainerStatus { memoryUsage: ClientCurrentResourceUsage; } -// Warning: (ae-missing-release-tag) "ClientCurrentResourceUsage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ClientCurrentResourceUsage { // (undocumented) @@ -47,8 +41,6 @@ export interface ClientCurrentResourceUsage { requestTotal: number | string; } -// Warning: (ae-missing-release-tag) "ClientPodStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ClientPodStatus { // (undocumented) @@ -61,8 +53,6 @@ export interface ClientPodStatus { pod: V1Pod; } -// Warning: (ae-missing-release-tag) "ClusterAttributes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ClusterAttributes { dashboardApp?: string; @@ -71,8 +61,6 @@ export interface ClusterAttributes { name: string; } -// Warning: (ae-missing-release-tag) "ClusterObjects" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ClusterObjects { // (undocumented) @@ -85,8 +73,6 @@ export interface ClusterObjects { resources: FetchResponse[]; } -// Warning: (ae-missing-release-tag) "ConfigMapFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ConfigMapFetchResponse { // (undocumented) @@ -95,8 +81,6 @@ export interface ConfigMapFetchResponse { type: 'configmaps'; } -// Warning: (ae-missing-release-tag) "CronJobsFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface CronJobsFetchResponse { // (undocumented) @@ -105,8 +89,6 @@ export interface CronJobsFetchResponse { type: 'cronjobs'; } -// Warning: (ae-missing-release-tag) "CustomResourceFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface CustomResourceFetchResponse { // (undocumented) @@ -115,8 +97,6 @@ export interface CustomResourceFetchResponse { type: 'customresources'; } -// Warning: (ae-missing-release-tag) "DaemonSetsFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface DaemonSetsFetchResponse { // (undocumented) @@ -125,8 +105,6 @@ export interface DaemonSetsFetchResponse { type: 'daemonsets'; } -// Warning: (ae-missing-release-tag) "DeploymentFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface DeploymentFetchResponse { // (undocumented) @@ -135,8 +113,6 @@ export interface DeploymentFetchResponse { type: 'deployments'; } -// Warning: (ae-missing-release-tag) "FetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type FetchResponse = | PodFetchResponse @@ -153,8 +129,6 @@ export type FetchResponse = | StatefulSetsFetchResponse | DaemonSetsFetchResponse; -// Warning: (ae-missing-release-tag) "HorizontalPodAutoscalersFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface HorizontalPodAutoscalersFetchResponse { // (undocumented) @@ -163,8 +137,6 @@ export interface HorizontalPodAutoscalersFetchResponse { type: 'horizontalpodautoscalers'; } -// Warning: (ae-missing-release-tag) "IngressesFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface IngressesFetchResponse { // (undocumented) @@ -173,8 +145,6 @@ export interface IngressesFetchResponse { type: 'ingresses'; } -// Warning: (ae-missing-release-tag) "JobsFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface JobsFetchResponse { // (undocumented) @@ -183,8 +153,6 @@ export interface JobsFetchResponse { type: 'jobs'; } -// Warning: (ae-missing-release-tag) "KubernetesErrorTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type KubernetesErrorTypes = | 'BAD_REQUEST' @@ -192,8 +160,6 @@ export type KubernetesErrorTypes = | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR'; -// Warning: (ae-missing-release-tag) "KubernetesFetchError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface KubernetesFetchError { // (undocumented) @@ -204,8 +170,6 @@ export interface KubernetesFetchError { statusCode?: number; } -// Warning: (ae-missing-release-tag) "KubernetesRequestAuth" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface KubernetesRequestAuth { // (undocumented) @@ -216,8 +180,6 @@ export interface KubernetesRequestAuth { }; } -// Warning: (ae-missing-release-tag) "KubernetesRequestBody" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface KubernetesRequestBody { // (undocumented) @@ -226,8 +188,6 @@ export interface KubernetesRequestBody { entity: Entity; } -// Warning: (ae-missing-release-tag) "LimitRangeFetchReponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface LimitRangeFetchReponse { // (undocumented) @@ -236,16 +196,12 @@ export interface LimitRangeFetchReponse { type: 'limitranges'; } -// Warning: (ae-missing-release-tag) "ObjectsByEntityResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ObjectsByEntityResponse { // (undocumented) items: ClusterObjects[]; } -// Warning: (ae-missing-release-tag) "PodFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface PodFetchResponse { // (undocumented) @@ -254,8 +210,6 @@ export interface PodFetchResponse { type: 'pods'; } -// Warning: (ae-missing-release-tag) "ReplicaSetsFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ReplicaSetsFetchResponse { // (undocumented) @@ -264,8 +218,6 @@ export interface ReplicaSetsFetchResponse { type: 'replicasets'; } -// Warning: (ae-missing-release-tag) "ServiceFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface ServiceFetchResponse { // (undocumented) @@ -274,8 +226,6 @@ export interface ServiceFetchResponse { type: 'services'; } -// Warning: (ae-missing-release-tag) "StatefulSetsFetchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export interface StatefulSetsFetchResponse { // (undocumented) diff --git a/plugins/kubernetes-common/src/types.ts b/plugins/kubernetes-common/src/types.ts index 53f6a5a640..830c32c32c 100644 --- a/plugins/kubernetes-common/src/types.ts +++ b/plugins/kubernetes-common/src/types.ts @@ -31,6 +31,7 @@ import { } from '@kubernetes/client-node'; import { Entity } from '@backstage/catalog-model'; +/** @public */ export interface KubernetesRequestAuth { google?: string; oidc?: { @@ -38,11 +39,13 @@ export interface KubernetesRequestAuth { }; } +/** @public */ export interface KubernetesRequestBody { auth?: KubernetesRequestAuth; entity: Entity; } +/** @public */ export interface ClusterAttributes { /** * Specifies the name of the Kubernetes cluster. @@ -81,6 +84,7 @@ export interface ClusterAttributes { dashboardParameters?: JsonObject; } +/** @public */ export interface ClusterObjects { cluster: ClusterAttributes; resources: FetchResponse[]; @@ -88,12 +92,15 @@ export interface ClusterObjects { errors: KubernetesFetchError[]; } +/** @public */ export interface ObjectsByEntityResponse { items: ClusterObjects[]; } +/** @public */ export type AuthProviderType = 'google' | 'serviceAccount' | 'aws' | 'azure'; +/** @public */ export type FetchResponse = | PodFetchResponse | ServiceFetchResponse @@ -109,95 +116,113 @@ export type FetchResponse = | StatefulSetsFetchResponse | DaemonSetsFetchResponse; +/** @public */ export interface PodFetchResponse { type: 'pods'; resources: Array; } +/** @public */ export interface ServiceFetchResponse { type: 'services'; resources: Array; } +/** @public */ export interface ConfigMapFetchResponse { type: 'configmaps'; resources: Array; } +/** @public */ export interface DeploymentFetchResponse { type: 'deployments'; resources: Array; } +/** @public */ export interface ReplicaSetsFetchResponse { type: 'replicasets'; resources: Array; } +/** @public */ export interface LimitRangeFetchReponse { type: 'limitranges'; resources: Array; } +/** @public */ export interface HorizontalPodAutoscalersFetchResponse { type: 'horizontalpodautoscalers'; resources: Array; } +/** @public */ export interface JobsFetchResponse { type: 'jobs'; resources: Array; } +/** @public */ export interface CronJobsFetchResponse { type: 'cronjobs'; resources: Array; } +/** @public */ export interface IngressesFetchResponse { type: 'ingresses'; resources: Array; } +/** @public */ export interface CustomResourceFetchResponse { type: 'customresources'; resources: Array; } +/** @public */ export interface StatefulSetsFetchResponse { type: 'statefulsets'; resources: Array; } +/** @public */ export interface DaemonSetsFetchResponse { type: 'daemonsets'; resources: Array; } +/** @public */ export interface KubernetesFetchError { errorType: KubernetesErrorTypes; statusCode?: number; resourcePath?: string; } +/** @public */ export type KubernetesErrorTypes = | 'BAD_REQUEST' | 'UNAUTHORIZED_ERROR' | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR'; +/** @public */ export interface ClientCurrentResourceUsage { currentUsage: number | string; requestTotal: number | string; limitTotal: number | string; } +/** @public */ export interface ClientContainerStatus { container: string; cpuUsage: ClientCurrentResourceUsage; memoryUsage: ClientCurrentResourceUsage; } +/** @public */ export interface ClientPodStatus { pod: V1Pod; cpu: ClientCurrentResourceUsage; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 27b42d7bd5..f18358cfcc 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -204,7 +204,6 @@ const ALLOW_WARNINGS = [ 'plugins/git-release-manager', 'plugins/jenkins', 'plugins/kubernetes', - 'plugins/kubernetes-common', ]; async function resolvePackagePath( From d669d89206224f8a0c51bb2b4df81f349f2fb3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:45:06 +0200 Subject: [PATCH 38/41] changeset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/red-numbers-suffer.md | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .changeset/red-numbers-suffer.md diff --git a/.changeset/red-numbers-suffer.md b/.changeset/red-numbers-suffer.md new file mode 100644 index 0000000000..863a701984 --- /dev/null +++ b/.changeset/red-numbers-suffer.md @@ -0,0 +1,45 @@ +--- +'@backstage/plugin-allure': patch +'@backstage/plugin-apache-airflow': patch +'@backstage/plugin-app-backend': patch +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-bitrise': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-catalog-graphql': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-cicd-statistics': patch +'@backstage/plugin-circleci': patch +'@backstage/plugin-cloudbuild': patch +'@backstage/plugin-code-climate': patch +'@backstage/plugin-config-schema': patch +'@backstage/plugin-cost-insights': patch +'@backstage/plugin-dynatrace': patch +'@backstage/plugin-explore': patch +'@backstage/plugin-explore-react': patch +'@backstage/plugin-firehydrant': patch +'@backstage/plugin-gcalendar': patch +'@backstage/plugin-gcp-projects': patch +'@backstage/plugin-github-actions': patch +'@backstage/plugin-github-deployments': patch +'@backstage/plugin-github-pull-requests-board': patch +'@backstage/plugin-gitops-profiles': patch +'@backstage/plugin-graphql-backend': patch +'@backstage/plugin-home': patch +'@backstage/plugin-ilert': patch +'@backstage/plugin-jenkins-backend': patch +'@backstage/plugin-kubernetes-common': patch +'@backstage/plugin-newrelic': patch +'@backstage/plugin-newrelic-dashboard': patch +'@backstage/plugin-pagerduty': patch +'@backstage/plugin-rollbar': patch +'@backstage/plugin-rollbar-backend': patch +'@backstage/plugin-search-backend-module-pg': patch +'@backstage/plugin-sentry': patch +'@backstage/plugin-shortcuts': patch +'@backstage/plugin-splunk-on-call': patch +'@backstage/plugin-tech-radar': patch +'@backstage/plugin-user-settings': patch +'@backstage/plugin-xcmetrics': patch +--- + +Minor API signatures cleanup From 32fc7d3716982c2f58c954039b99f03d9af90fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 15:51:27 +0200 Subject: [PATCH 39/41] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/red-numbers-suffer.md | 1 - plugins/stack-overflow/api-report.md | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.changeset/red-numbers-suffer.md b/.changeset/red-numbers-suffer.md index 863a701984..c1baae1e92 100644 --- a/.changeset/red-numbers-suffer.md +++ b/.changeset/red-numbers-suffer.md @@ -6,7 +6,6 @@ '@backstage/plugin-bitrise': patch '@backstage/plugin-catalog': patch '@backstage/plugin-catalog-graphql': patch -'@backstage/plugin-catalog-import': patch '@backstage/plugin-cicd-statistics': patch '@backstage/plugin-circleci': patch '@backstage/plugin-cloudbuild': patch diff --git a/plugins/stack-overflow/api-report.md b/plugins/stack-overflow/api-report.md index 9404c74700..81cfe1395b 100644 --- a/plugins/stack-overflow/api-report.md +++ b/plugins/stack-overflow/api-report.md @@ -6,14 +6,12 @@ /// import { BackstagePlugin } from '@backstage/core-plugin-api'; -import { ComponentRenderer } from '@backstage/plugin-home'; +import { CardExtensionProps } from '@backstage/plugin-home'; import { ReactNode } from 'react'; // @public export const HomePageStackOverflowQuestions: ( - props: ComponentRenderer & { - title?: string | undefined; - } & StackOverflowQuestionsContentProps, + props: CardExtensionProps, ) => JSX.Element; // @public From a291688bc58ace6423b92b8a2e5d1d7cf2dbc015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 16:28:04 +0200 Subject: [PATCH 40/41] Renamed the RedirectInfo type to OAuthStartResponse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/metal-crabs-wash.md | 5 +++++ plugins/auth-backend/api-report.md | 14 +++++++------- plugins/auth-backend/src/lib/oauth/types.ts | 4 ++-- .../lib/passport/PassportStrategyHelper.test.ts | 2 +- .../src/lib/passport/PassportStrategyHelper.ts | 4 ++-- .../src/providers/atlassian/provider.ts | 4 ++-- .../auth-backend/src/providers/auth0/provider.ts | 4 ++-- .../src/providers/bitbucket/provider.ts | 4 ++-- .../auth-backend/src/providers/github/provider.ts | 4 ++-- .../auth-backend/src/providers/gitlab/provider.ts | 4 ++-- .../auth-backend/src/providers/google/provider.ts | 4 ++-- plugins/auth-backend/src/providers/index.ts | 2 +- .../src/providers/microsoft/provider.ts | 4 ++-- .../auth-backend/src/providers/oauth2/provider.ts | 4 ++-- .../auth-backend/src/providers/oidc/provider.ts | 4 ++-- .../auth-backend/src/providers/okta/provider.ts | 4 ++-- .../src/providers/onelogin/provider.ts | 4 ++-- plugins/auth-backend/src/providers/types.ts | 2 +- 18 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 .changeset/metal-crabs-wash.md diff --git a/.changeset/metal-crabs-wash.md b/.changeset/metal-crabs-wash.md new file mode 100644 index 0000000000..6ecb50ef67 --- /dev/null +++ b/.changeset/metal-crabs-wash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': minor +--- + +Renamed the `RedirectInfo` type to `OAuthStartResponse` diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index be295f65f5..43bf2f3fa2 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -317,7 +317,7 @@ export interface OAuthHandlers { response: OAuthResponse; refreshToken?: string; }>; - start(req: OAuthStartRequest): Promise; + start(req: OAuthStartRequest): Promise; } // @public (undocumented) @@ -366,6 +366,12 @@ export type OAuthStartRequest = express.Request<{}> & { state: OAuthState; }; +// @public (undocumented) +export type OAuthStartResponse = { + url: string; + status?: number; +}; + // @public (undocumented) export type OAuthState = { nonce: string; @@ -654,12 +660,6 @@ export const providers: Readonly<{ // @public (undocumented) export const readState: (stateString: string) => OAuthState; -// @public (undocumented) -export type RedirectInfo = { - url: string; - status?: number; -}; - // @public (undocumented) export interface RouterOptions { // (undocumented) diff --git a/plugins/auth-backend/src/lib/oauth/types.ts b/plugins/auth-backend/src/lib/oauth/types.ts index bfe0aaff50..e8b5282aad 100644 --- a/plugins/auth-backend/src/lib/oauth/types.ts +++ b/plugins/auth-backend/src/lib/oauth/types.ts @@ -17,7 +17,7 @@ import express from 'express'; import { Profile as PassportProfile } from 'passport'; import { BackstageSignInResult } from '@backstage/plugin-auth-node'; -import { RedirectInfo, ProfileInfo } from '../../providers/types'; +import { OAuthStartResponse, ProfileInfo } from '../../providers/types'; /** * Common options for passport.js-based OAuth providers @@ -115,7 +115,7 @@ export interface OAuthHandlers { /** * Initiate a sign in request with an auth provider. */ - start(req: OAuthStartRequest): Promise; + start(req: OAuthStartRequest): Promise; /** * Handle the redirect from the auth provider when the user has signed in. diff --git a/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.test.ts b/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.test.ts index 893be26852..660b96f018 100644 --- a/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.test.ts +++ b/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.test.ts @@ -33,7 +33,7 @@ describe('PassportStrategyHelper', () => { } describe('executeRedirectStrategy', () => { - it('should call authenticate and resolve with RedirectInfo', async () => { + it('should call authenticate and resolve with OAuthStartResponse', async () => { const mockStrategy = new MyCustomRedirectStrategy(); const spyAuthenticate = jest.spyOn(mockStrategy, 'authenticate'); const redirectStrategyPromise = executeRedirectStrategy( diff --git a/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.ts b/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.ts index 6117736e21..16377f17f2 100644 --- a/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.ts +++ b/plugins/auth-backend/src/lib/passport/PassportStrategyHelper.ts @@ -20,7 +20,7 @@ import jwtDecoder from 'jwt-decode'; import { InternalOAuthError } from 'passport-oauth2'; import { PassportProfile } from './types'; -import { ProfileInfo, RedirectInfo } from '../../providers/types'; +import { ProfileInfo, OAuthStartResponse } from '../../providers/types'; export type PassportDoneCallback = ( err?: Error, @@ -77,7 +77,7 @@ export const executeRedirectStrategy = async ( req: express.Request, providerStrategy: passport.Strategy, options: Record, -): Promise => { +): Promise => { return new Promise(resolve => { const strategy = Object.create(providerStrategy); strategy.redirect = (url: string, status?: number) => { diff --git a/plugins/auth-backend/src/providers/atlassian/provider.ts b/plugins/auth-backend/src/providers/atlassian/provider.ts index eb6890a5a4..e02d899fb1 100644 --- a/plugins/auth-backend/src/providers/atlassian/provider.ts +++ b/plugins/auth-backend/src/providers/atlassian/provider.ts @@ -38,7 +38,7 @@ import { import { AuthHandler, AuthResolverContext, - RedirectInfo, + OAuthStartResponse, SignInResolver, } from '../types'; import express from 'express'; @@ -94,7 +94,7 @@ export class AtlassianAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { state: encodeState(req.state), }); diff --git a/plugins/auth-backend/src/providers/auth0/provider.ts b/plugins/auth-backend/src/providers/auth0/provider.ts index a53f504f50..8e0255ebe6 100644 --- a/plugins/auth-backend/src/providers/auth0/provider.ts +++ b/plugins/auth-backend/src/providers/auth0/provider.ts @@ -37,7 +37,7 @@ import { PassportDoneCallback, } from '../../lib/passport'; import { - RedirectInfo, + OAuthStartResponse, AuthHandler, SignInResolver, AuthResolverContext, @@ -98,7 +98,7 @@ export class Auth0AuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { accessType: 'offline', prompt: 'consent', diff --git a/plugins/auth-backend/src/providers/bitbucket/provider.ts b/plugins/auth-backend/src/providers/bitbucket/provider.ts index 0bbebd2097..cfa30e9a73 100644 --- a/plugins/auth-backend/src/providers/bitbucket/provider.ts +++ b/plugins/auth-backend/src/providers/bitbucket/provider.ts @@ -39,7 +39,7 @@ import { import { createAuthProviderIntegration } from '../createAuthProviderIntegration'; import { AuthHandler, - RedirectInfo, + OAuthStartResponse, SignInResolver, AuthResolverContext, } from '../types'; @@ -121,7 +121,7 @@ export class BitbucketAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { accessType: 'offline', prompt: 'consent', diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index 4ac91516a3..7571b4a327 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -26,7 +26,7 @@ import { PassportDoneCallback, } from '../../lib/passport'; import { - RedirectInfo, + OAuthStartResponse, AuthHandler, SignInResolver, StateEncoder, @@ -107,7 +107,7 @@ export class GithubAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { scope: req.scope, state: (await this.stateEncoder(req)).encodedState, diff --git a/plugins/auth-backend/src/providers/gitlab/provider.ts b/plugins/auth-backend/src/providers/gitlab/provider.ts index c24c2e128d..7f5489d391 100644 --- a/plugins/auth-backend/src/providers/gitlab/provider.ts +++ b/plugins/auth-backend/src/providers/gitlab/provider.ts @@ -25,7 +25,7 @@ import { PassportDoneCallback, } from '../../lib/passport'; import { - RedirectInfo, + OAuthStartResponse, SignInResolver, AuthHandler, AuthResolverContext, @@ -110,7 +110,7 @@ export class GitlabAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { scope: req.scope, state: encodeState(req.state), diff --git a/plugins/auth-backend/src/providers/google/provider.ts b/plugins/auth-backend/src/providers/google/provider.ts index f60d4e9947..7689cd1a3a 100644 --- a/plugins/auth-backend/src/providers/google/provider.ts +++ b/plugins/auth-backend/src/providers/google/provider.ts @@ -39,7 +39,7 @@ import { import { AuthHandler, AuthResolverContext, - RedirectInfo, + OAuthStartResponse, SignInResolver, } from '../types'; import { createAuthProviderIntegration } from '../createAuthProviderIntegration'; @@ -98,7 +98,7 @@ export class GoogleAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this.strategy, { accessType: 'offline', prompt: 'consent', diff --git a/plugins/auth-backend/src/providers/index.ts b/plugins/auth-backend/src/providers/index.ts index e0860d3f78..67d3a62990 100644 --- a/plugins/auth-backend/src/providers/index.ts +++ b/plugins/auth-backend/src/providers/index.ts @@ -49,7 +49,7 @@ export type { StateEncoder, AuthResponse, ProfileInfo, - RedirectInfo, + OAuthStartResponse, } from './types'; export { prepareBackstageIdentityResponse } from './prepareBackstageIdentityResponse'; diff --git a/plugins/auth-backend/src/providers/microsoft/provider.ts b/plugins/auth-backend/src/providers/microsoft/provider.ts index db79dba225..fd2a1529a7 100644 --- a/plugins/auth-backend/src/providers/microsoft/provider.ts +++ b/plugins/auth-backend/src/providers/microsoft/provider.ts @@ -38,7 +38,7 @@ import { } from '../../lib/passport'; import { AuthHandler, - RedirectInfo, + OAuthStartResponse, SignInResolver, AuthResolverContext, } from '../types'; @@ -97,7 +97,7 @@ export class MicrosoftAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { scope: req.scope, state: encodeState(req.state), diff --git a/plugins/auth-backend/src/providers/oauth2/provider.ts b/plugins/auth-backend/src/providers/oauth2/provider.ts index 6fa649c421..3e7720b14a 100644 --- a/plugins/auth-backend/src/providers/oauth2/provider.ts +++ b/plugins/auth-backend/src/providers/oauth2/provider.ts @@ -39,7 +39,7 @@ import { import { AuthHandler, AuthResolverContext, - RedirectInfo, + OAuthStartResponse, SignInResolver, } from '../types'; import { createAuthProviderIntegration } from '../createAuthProviderIntegration'; @@ -114,7 +114,7 @@ export class OAuth2AuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { accessType: 'offline', prompt: 'consent', diff --git a/plugins/auth-backend/src/providers/oidc/provider.ts b/plugins/auth-backend/src/providers/oidc/provider.ts index eb963a3711..bce8ba843b 100644 --- a/plugins/auth-backend/src/providers/oidc/provider.ts +++ b/plugins/auth-backend/src/providers/oidc/provider.ts @@ -40,7 +40,7 @@ import { import { AuthHandler, AuthResolverContext, - RedirectInfo, + OAuthStartResponse, SignInResolver, } from '../types'; import { createAuthProviderIntegration } from '../createAuthProviderIntegration'; @@ -91,7 +91,7 @@ export class OidcAuthProvider implements OAuthHandlers { this.resolverContext = options.resolverContext; } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { const { strategy } = await this.implementation; const options: Record = { scope: req.scope || this.scope || 'openid profile email', diff --git a/plugins/auth-backend/src/providers/okta/provider.ts b/plugins/auth-backend/src/providers/okta/provider.ts index cb686f17e9..05e0451bdb 100644 --- a/plugins/auth-backend/src/providers/okta/provider.ts +++ b/plugins/auth-backend/src/providers/okta/provider.ts @@ -38,7 +38,7 @@ import { } from '../../lib/passport'; import { AuthHandler, - RedirectInfo, + OAuthStartResponse, SignInResolver, AuthResolverContext, } from '../types'; @@ -125,7 +125,7 @@ export class OktaAuthProvider implements OAuthHandlers { ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this.strategy, { accessType: 'offline', prompt: 'consent', diff --git a/plugins/auth-backend/src/providers/onelogin/provider.ts b/plugins/auth-backend/src/providers/onelogin/provider.ts index 59b57b3851..ac636f92cc 100644 --- a/plugins/auth-backend/src/providers/onelogin/provider.ts +++ b/plugins/auth-backend/src/providers/onelogin/provider.ts @@ -37,7 +37,7 @@ import { PassportDoneCallback, } from '../../lib/passport'; import { - RedirectInfo, + OAuthStartResponse, AuthHandler, SignInResolver, AuthResolverContext, @@ -95,7 +95,7 @@ export class OneLoginProvider implements OAuthHandlers { }, ); } - async start(req: OAuthStartRequest): Promise { + async start(req: OAuthStartRequest): Promise { return await executeRedirectStrategy(req, this._strategy, { accessType: 'offline', prompt: 'consent', diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index f0f94f1936..574afade79 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -127,7 +127,7 @@ export type AuthProviderConfig = { }; /** @public */ -export type RedirectInfo = { +export type OAuthStartResponse = { /** * URL to redirect to */ From 6c905ee2278609276fc2dd1c56e5bcc4fab77c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 16:54:51 +0200 Subject: [PATCH 41/41] ignore CatalogInputPluginOptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog/api-report.md | 5 ----- plugins/catalog/src/index.ts | 1 - plugins/catalog/src/options.ts | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index f3bec2ba43..377b62a1e6 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -73,11 +73,6 @@ export const CatalogEntityPage: () => JSX.Element; // @public (undocumented) export const CatalogIndexPage: (props: DefaultCatalogPageProps) => JSX.Element; -// @public (undocumented) -export type CatalogInputPluginOptions = { - createButtonTitle: string; -}; - // @public (undocumented) export function CatalogKindHeader(props: CatalogKindHeaderProps): JSX.Element; diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index a69d4004a1..886039e329 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -37,7 +37,6 @@ export * from './components/EntityProcessingErrorsPanel'; export * from './components/EntitySwitch'; export * from './components/FilteredEntityLayout'; export * from './overridableComponents'; -export type { CatalogInputPluginOptions } from './options'; export { CatalogEntityPage, CatalogIndexPage, diff --git a/plugins/catalog/src/options.ts b/plugins/catalog/src/options.ts index 4061f512ac..bb248c16b6 100644 --- a/plugins/catalog/src/options.ts +++ b/plugins/catalog/src/options.ts @@ -20,7 +20,7 @@ export type CatalogPluginOptions = { createButtonTitle: string; }; -/** @public */ +/** @ignore */ export type CatalogInputPluginOptions = { createButtonTitle: string; };