diff --git a/.changeset/angry-rules-fail.md b/.changeset/angry-rules-fail.md new file mode 100644 index 0000000000..cc52d4478e --- /dev/null +++ b/.changeset/angry-rules-fail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Add unstable prop for disabling unregister entity menu diff --git a/.changeset/big-pens-train.md b/.changeset/big-pens-train.md new file mode 100644 index 0000000000..5c4f8dc7b0 --- /dev/null +++ b/.changeset/big-pens-train.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Unsubscribe from broker after response is flushed diff --git a/.changeset/lemon-crabs-confess.md b/.changeset/lemon-crabs-confess.md new file mode 100644 index 0000000000..0d87843df5 --- /dev/null +++ b/.changeset/lemon-crabs-confess.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Updating fs-extra to 10.0.0 to handle broken symbolic links correctly diff --git a/.changeset/polite-spies-judge.md b/.changeset/polite-spies-judge.md new file mode 100644 index 0000000000..075bcf1598 --- /dev/null +++ b/.changeset/polite-spies-judge.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-rails': patch +--- + +updated paths to consider differences between platform (windows corrected) diff --git a/.changeset/real-plums-vanish.md b/.changeset/real-plums-vanish.md new file mode 100644 index 0000000000..a653a6bdf2 --- /dev/null +++ b/.changeset/real-plums-vanish.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Add Sign In and Handler resolver for Microsoft provider diff --git a/.changeset/shy-rules-design.md b/.changeset/shy-rules-design.md new file mode 100644 index 0000000000..4f009e5aa8 --- /dev/null +++ b/.changeset/shy-rules-design.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-scaffolder-backend': minor +--- + +Updated inputs for the `publish:github:pull-request` action. + +Now requires a `repoUrl` instead of separate `owner` and `repo` inputs. This aligns with the output of the `RepoUrlPicker` ui field used by the pull-request sample template. diff --git a/.changeset/techdocs-typescript-isnt-fun.md b/.changeset/techdocs-typescript-isnt-fun.md new file mode 100644 index 0000000000..9341c1c14a --- /dev/null +++ b/.changeset/techdocs-typescript-isnt-fun.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-techdocs-backend': patch +--- + +It is no longer required to provide a generator and a preparer to the TechDocs +router factory when running TechDocs in the "recommended" (e.g. externally +prepared and generated docs) configuration. diff --git a/.changeset/wise-rockets-smoke.md b/.changeset/wise-rockets-smoke.md new file mode 100644 index 0000000000..c81d20519d --- /dev/null +++ b/.changeset/wise-rockets-smoke.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Document the default behavior of `statusCheck` option in `createStatusCheckRouter`. diff --git a/.changeset/young-tables-reply.md b/.changeset/young-tables-reply.md new file mode 100644 index 0000000000..e08a875c14 --- /dev/null +++ b/.changeset/young-tables-reply.md @@ -0,0 +1,16 @@ +--- +'@backstage/backend-common': patch +'@backstage/cli': patch +'@backstage/config-loader': patch +'@backstage/create-app': patch +'@backstage/techdocs-common': patch +'@backstage/plugin-app-backend': patch +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-kubernetes-backend': patch +'@backstage/plugin-rollbar-backend': patch +'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-techdocs-backend': patch +--- + +Revert the upgrade to `fs-extra@10.0.0` as that seemed to have broken all installs inexplicably. diff --git a/docs/overview/stability-index.md b/docs/overview/stability-index.md index 1cdde89a78..2b730024fd 100644 --- a/docs/overview/stability-index.md +++ b/docs/overview/stability-index.md @@ -332,8 +332,7 @@ Stability: `1` The backend scaffolder plugin that provides an implementation for templates in the catalog. -Stability: `1`. There is planned work to rework the scaffolder in -https://github.com/backstage/backstage/issues/2771. +Stability: `2`. ### `tech-radar` [GitHub](https://github.com/backstage/backstage/tree/master/plugins/tech-radar/) diff --git a/microsite/static/img/backstage-k8s.svg b/microsite/static/img/backstage-k8s.svg index 2796a396e7..28b6ef8f92 100644 --- a/microsite/static/img/backstage-k8s.svg +++ b/microsite/static/img/backstage-k8s.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/microsite/static/img/backstage-software-catalog.svg b/microsite/static/img/backstage-software-catalog.svg index 101439497b..5cad498d35 100644 --- a/microsite/static/img/backstage-software-catalog.svg +++ b/microsite/static/img/backstage-software-catalog.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/microsite/static/img/backstage-software-templates.svg b/microsite/static/img/backstage-software-templates.svg index 3984cd2870..e64428de82 100644 --- a/microsite/static/img/backstage-software-templates.svg +++ b/microsite/static/img/backstage-software-templates.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/microsite/static/img/backstage-techdocs.svg b/microsite/static/img/backstage-techdocs.svg index aa9362b1bc..643cde325c 100644 --- a/microsite/static/img/backstage-techdocs.svg +++ b/microsite/static/img/backstage-techdocs.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/microsite/static/img/rails-icon.png b/microsite/static/img/rails-icon.png index f7b8b69bd9..04f63766fe 100644 Binary files a/microsite/static/img/rails-icon.png and b/microsite/static/img/rails-icon.png differ diff --git a/package.json b/package.json index 09dc55617b..93517d3374 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "yarn workspace example-app start", "start-backend": "yarn workspace example-backend start", "build": "lerna run build", - "build:api-reports": "tsc && yarn build:api-reports:only", + "build:api-reports": "yarn tsc:full && yarn build:api-reports:only", "build:api-reports:only": "ts-node -T -P scripts/tsconfig.json scripts/api-extractor.ts", "build:api-docs": "yarn build:api-reports --docs", "tsc": "tsc", @@ -44,15 +44,14 @@ "**/@roadiehq/**/@backstage/core": "*", "**/@roadiehq/**/@backstage/plugin-catalog": "*", "**/@roadiehq/**/@backstage/catalog-model": "*", - "**/@microsoft/api-extractor/typescript": "^4.0.3", "graphql-language-service-interface": "2.8.2", "graphql-language-service-parser": "1.9.0" }, "version": "1.0.0", "dependencies": { - "@microsoft/api-documenter": "^7.12.16", - "@microsoft/api-extractor": "7.13.2-pr1916.0", - "@microsoft/api-extractor-model": "^7.12.5" + "@microsoft/api-documenter": "^7.13.30", + "@microsoft/api-extractor": "^7.18.1", + "@microsoft/api-extractor-model": "^7.13.3" }, "devDependencies": { "@changesets/cli": "^2.14.0", @@ -61,7 +60,7 @@ "command-exists": "^1.2.9", "concurrently": "^6.0.0", "eslint-plugin-notice": "^0.9.10", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "husky": "^6.0.0", "lerna": "^4.0.0", "lint-staged": "^10.1.0", diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 22eac06ed2..94f1147b5a 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -3,6 +3,8 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// +/// import { AzureIntegration } from '@backstage/integration'; import { BitbucketIntegration } from '@backstage/integration'; @@ -32,105 +34,133 @@ import { Writable } from 'stream'; // @public (undocumented) export class AzureUrlReader implements UrlReader { - constructor(integration: AzureIntegration, deps: { - treeResponseFactory: ReadTreeResponseFactory; - }); - // (undocumented) - static factory: ReaderFactory; - // (undocumented) - read(url: string): Promise; - // (undocumented) - readTree(url: string, options?: ReadTreeOptions): Promise; - // (undocumented) - readUrl(url: string, _options?: ReadUrlOptions): Promise; - // (undocumented) - search(url: string, options?: SearchOptions): Promise; - // (undocumented) - toString(): string; + constructor( + integration: AzureIntegration, + deps: { + treeResponseFactory: ReadTreeResponseFactory; + }, + ); + // (undocumented) + static factory: ReaderFactory; + // (undocumented) + read(url: string): Promise; + // (undocumented) + readTree(url: string, options?: ReadTreeOptions): Promise; + // (undocumented) + readUrl(url: string, _options?: ReadUrlOptions): Promise; + // (undocumented) + search(url: string, options?: SearchOptions): Promise; + // (undocumented) + toString(): string; } // @public export class BitbucketUrlReader implements UrlReader { - constructor(integration: BitbucketIntegration, deps: { - treeResponseFactory: ReadTreeResponseFactory; - }); - // (undocumented) - static factory: ReaderFactory; - // (undocumented) - read(url: string): Promise; - // (undocumented) - readTree(url: string, options?: ReadTreeOptions): Promise; - // (undocumented) - readUrl(url: string, _options?: ReadUrlOptions): Promise; - // (undocumented) - search(url: string, options?: SearchOptions): Promise; - // (undocumented) - toString(): string; + constructor( + integration: BitbucketIntegration, + deps: { + treeResponseFactory: ReadTreeResponseFactory; + }, + ); + // (undocumented) + static factory: ReaderFactory; + // (undocumented) + read(url: string): Promise; + // (undocumented) + readTree(url: string, options?: ReadTreeOptions): Promise; + // (undocumented) + readUrl(url: string, _options?: ReadUrlOptions): Promise; + // (undocumented) + search(url: string, options?: SearchOptions): Promise; + // (undocumented) + toString(): string; } // @public export interface CacheClient { - delete(key: string): Promise; - get(key: string): Promise; - set(key: string, value: JsonValue, options?: CacheSetOptions): Promise; + delete(key: string): Promise; + get(key: string): Promise; + set(key: string, value: JsonValue, options?: CacheSetOptions): Promise; } // @public export class CacheManager { - forPlugin(pluginId: string): PluginCacheManager; - static fromConfig(config: Config, options?: CacheManagerOptions): CacheManager; - } + forPlugin(pluginId: string): PluginCacheManager; + static fromConfig( + config: Config, + options?: CacheManagerOptions, + ): CacheManager; +} // @public (undocumented) export const coloredFormat: winston.Logform.Format; // @public (undocumented) export interface ContainerRunner { - // (undocumented) - runContainer(opts: RunContainerOptions): Promise; + // (undocumented) + runContainer(opts: RunContainerOptions): Promise; } // @public @deprecated export const createDatabase: typeof createDatabaseClient; // @public -export function createDatabaseClient(dbConfig: Config, overrides?: Partial): Knex; +export function createDatabaseClient( + dbConfig: Config, + overrides?: Partial, +): Knex; // @public (undocumented) -export function createRootLogger(options?: winston.LoggerOptions, env?: NodeJS.ProcessEnv): winston.Logger; +export function createRootLogger( + options?: winston.LoggerOptions, + env?: NodeJS.ProcessEnv, +): winston.Logger; // @public export function createServiceBuilder(_module: NodeModule): ServiceBuilderImpl; // @public (undocumented) -export function createStatusCheckRouter(options: StatusCheckRouterOptions): Promise; +export function createStatusCheckRouter( + options: StatusCheckRouterOptions, +): Promise; // @public (undocumented) export class DatabaseManager { - forPlugin(pluginId: string): PluginDatabaseManager; - static fromConfig(config: Config): DatabaseManager; - } + forPlugin(pluginId: string): PluginDatabaseManager; + static fromConfig(config: Config): DatabaseManager; +} // @public (undocumented) export class DockerContainerRunner implements ContainerRunner { - constructor({ dockerClient }: { - dockerClient: Docker; - }); - // (undocumented) - runContainer({ imageName, command, args, logStream, mountDirs, workingDir, envVars, }: RunContainerOptions): Promise; + constructor({ dockerClient }: { dockerClient: Docker }); + // (undocumented) + runContainer({ + imageName, + command, + args, + logStream, + mountDirs, + workingDir, + envVars, + }: RunContainerOptions): Promise; } // @public -export function ensureDatabaseExists(dbConfig: Config, ...databases: Array): Promise; +export function ensureDatabaseExists( + dbConfig: Config, + ...databases: Array +): Promise; // @public -export function errorHandler(options?: ErrorHandlerOptions): ErrorRequestHandler; +export function errorHandler( + options?: ErrorHandlerOptions, +): ErrorRequestHandler; // @public (undocumented) export type ErrorHandlerOptions = { - showStackTraces?: boolean; - logger?: Logger_2; - logClientErrors?: boolean; + showStackTraces?: boolean; + logger?: Logger_2; + logClientErrors?: boolean; }; // @public (undocumented) @@ -141,128 +171,154 @@ export function getVoidLogger(): winston.Logger; // @public (undocumented) export class Git { - // (undocumented) - add({ dir, filepath, }: { - dir: string; - filepath: string; - }): Promise; - // (undocumented) - addRemote({ dir, url, remote, }: { - dir: string; - remote: string; - url: string; - }): Promise; - // (undocumented) - clone({ url, dir, ref, }: { - url: string; - dir: string; - ref?: string; - }): Promise; - // (undocumented) - commit({ dir, message, author, committer, }: { - dir: string; - message: string; - author: { - name: string; - email: string; - }; - committer: { - name: string; - email: string; - }; - }): Promise; - // (undocumented) - currentBranch({ dir, fullName, }: { - dir: string; - fullName?: boolean; - }): Promise; - // (undocumented) - fetch({ dir, remote, }: { - dir: string; - remote?: string; - }): Promise; - // (undocumented) - static fromAuth: ({ username, password, logger, }: { - username?: string | undefined; - password?: string | undefined; - logger?: Logger_2 | undefined; - }) => Git; - // (undocumented) - init({ dir, defaultBranch, }: { - dir: string; - defaultBranch?: string; - }): Promise; - // (undocumented) - merge({ dir, theirs, ours, author, committer, }: { - dir: string; - theirs: string; - ours?: string; - author: { - name: string; - email: string; - }; - committer: { - name: string; - email: string; - }; - }): Promise; - // (undocumented) - push({ dir, remote }: { - dir: string; - remote: string; - }): Promise; - // (undocumented) - readCommit({ dir, sha, }: { - dir: string; - sha: string; - }): Promise; - // (undocumented) - resolveRef({ dir, ref, }: { - dir: string; - ref: string; - }): Promise; + // (undocumented) + add({ dir, filepath }: { dir: string; filepath: string }): Promise; + // (undocumented) + addRemote({ + dir, + url, + remote, + }: { + dir: string; + remote: string; + url: string; + }): Promise; + // (undocumented) + clone({ + url, + dir, + ref, + }: { + url: string; + dir: string; + ref?: string; + }): Promise; + // (undocumented) + commit({ + dir, + message, + author, + committer, + }: { + dir: string; + message: string; + author: { + name: string; + email: string; + }; + committer: { + name: string; + email: string; + }; + }): Promise; + // (undocumented) + currentBranch({ + dir, + fullName, + }: { + dir: string; + fullName?: boolean; + }): Promise; + // (undocumented) + fetch({ dir, remote }: { dir: string; remote?: string }): Promise; + // (undocumented) + static fromAuth: ({ + username, + password, + logger, + }: { + username?: string | undefined; + password?: string | undefined; + logger?: Logger_2 | undefined; + }) => Git; + // (undocumented) + init({ + dir, + defaultBranch, + }: { + dir: string; + defaultBranch?: string; + }): Promise; + // (undocumented) + merge({ + dir, + theirs, + ours, + author, + committer, + }: { + dir: string; + theirs: string; + ours?: string; + author: { + name: string; + email: string; + }; + committer: { + name: string; + email: string; + }; + }): Promise; + // (undocumented) + push({ dir, remote }: { dir: string; remote: string }): Promise; + // (undocumented) + readCommit({ + dir, + sha, + }: { + dir: string; + sha: string; + }): Promise; + // (undocumented) + resolveRef({ dir, ref }: { dir: string; ref: string }): Promise; } // @public export class GithubUrlReader implements UrlReader { - constructor(integration: GitHubIntegration, deps: { - treeResponseFactory: ReadTreeResponseFactory; - credentialsProvider: GithubCredentialsProvider; - }); - // (undocumented) - static factory: ReaderFactory; - // (undocumented) - read(url: string): Promise; - // (undocumented) - readTree(url: string, options?: ReadTreeOptions): Promise; - // (undocumented) - readUrl(url: string, options?: ReadUrlOptions): Promise; - // (undocumented) - search(url: string, options?: SearchOptions): Promise; - // (undocumented) - toString(): string; + constructor( + integration: GitHubIntegration, + deps: { + treeResponseFactory: ReadTreeResponseFactory; + credentialsProvider: GithubCredentialsProvider; + }, + ); + // (undocumented) + static factory: ReaderFactory; + // (undocumented) + read(url: string): Promise; + // (undocumented) + readTree(url: string, options?: ReadTreeOptions): Promise; + // (undocumented) + readUrl(url: string, options?: ReadUrlOptions): Promise; + // (undocumented) + search(url: string, options?: SearchOptions): Promise; + // (undocumented) + toString(): string; } // @public (undocumented) export class GitlabUrlReader implements UrlReader { - constructor(integration: GitLabIntegration, deps: { - treeResponseFactory: ReadTreeResponseFactory; - }); - // (undocumented) - static factory: ReaderFactory; - // (undocumented) - read(url: string): Promise; - // (undocumented) - readTree(url: string, options?: ReadTreeOptions): Promise; - // (undocumented) - readUrl(url: string, options?: ReadUrlOptions): Promise; - // (undocumented) - search(url: string, options?: SearchOptions): Promise; - // (undocumented) - toString(): string; + constructor( + integration: GitLabIntegration, + deps: { + treeResponseFactory: ReadTreeResponseFactory; + }, + ); + // (undocumented) + static factory: ReaderFactory; + // (undocumented) + read(url: string): Promise; + // (undocumented) + readTree(url: string, options?: ReadTreeOptions): Promise; + // (undocumented) + readUrl(url: string, options?: ReadUrlOptions): Promise; + // (undocumented) + search(url: string, options?: SearchOptions): Promise; + // (undocumented) + toString(): string; } -export { isChildPath } +export { isChildPath }; // @public export function loadBackendConfig(options: Options): Promise; @@ -272,32 +328,32 @@ export function notFoundHandler(): RequestHandler; // @public export type PluginCacheManager = { - getClient: (options?: ClientOptions) => CacheClient; + getClient: (options?: ClientOptions) => CacheClient; }; // @public export interface PluginDatabaseManager { - getClient(): Promise; + getClient(): Promise; } // @public export type PluginEndpointDiscovery = { - getBaseUrl(pluginId: string): Promise; - getExternalBaseUrl(pluginId: string): Promise; + getBaseUrl(pluginId: string): Promise; + getExternalBaseUrl(pluginId: string): Promise; }; // @public export type ReadTreeResponse = { - files(): Promise; - archive(): Promise; - dir(options?: ReadTreeResponseDirOptions): Promise; - etag: string; + files(): Promise; + archive(): Promise; + dir(options?: ReadTreeResponseDirOptions): Promise; + etag: string; }; // @public export type ReadTreeResponseFile = { - path: string; - content(): Promise; + path: string; + content(): Promise; }; // @public @@ -311,37 +367,37 @@ export function resolveSafeChildPath(base: string, path: string): string; // @public (undocumented) export type RunContainerOptions = { - imageName: string; - command?: string | string[]; - args: string[]; - logStream?: Writable; - mountDirs?: Record; - workingDir?: string; - envVars?: Record; + imageName: string; + command?: string | string[]; + args: string[]; + logStream?: Writable; + mountDirs?: Record; + workingDir?: string; + envVars?: Record; }; // @public export type SearchResponse = { - files: SearchResponseFile[]; - etag: string; + files: SearchResponseFile[]; + etag: string; }; // @public export type SearchResponseFile = { - url: string; - content(): Promise; + url: string; + content(): Promise; }; // @public (undocumented) export type ServiceBuilder = { - loadConfig(config: ConfigReader): ServiceBuilder; - setPort(port: number): ServiceBuilder; - setHost(host: string): ServiceBuilder; - setLogger(logger: Logger_2): ServiceBuilder; - enableCors(options: cors.CorsOptions): ServiceBuilder; - setHttpsSettings(settings: HttpsSettings): ServiceBuilder; - addRouter(root: string, router: Router | RequestHandler): ServiceBuilder; - start(): Promise; + loadConfig(config: ConfigReader): ServiceBuilder; + setPort(port: number): ServiceBuilder; + setHost(host: string): ServiceBuilder; + setLogger(logger: Logger_2): ServiceBuilder; + enableCors(options: cors.CorsOptions): ServiceBuilder; + setHttpsSettings(settings: HttpsSettings): ServiceBuilder; + addRouter(root: string, router: Router | RequestHandler): ServiceBuilder; + start(): Promise; }; // @public (undocumented) @@ -352,47 +408,53 @@ export const SingleConnectionDatabaseManager: typeof DatabaseManager; // @public export class SingleHostDiscovery implements PluginEndpointDiscovery { - static fromConfig(config: Config, options?: { - basePath?: string; - }): SingleHostDiscovery; - // (undocumented) - getBaseUrl(pluginId: string): Promise; - // (undocumented) - getExternalBaseUrl(pluginId: string): Promise; - } + static fromConfig( + config: Config, + options?: { + basePath?: string; + }, + ): SingleHostDiscovery; + // (undocumented) + getBaseUrl(pluginId: string): Promise; + // (undocumented) + getExternalBaseUrl(pluginId: string): Promise; +} // @public (undocumented) export type StatusCheck = () => Promise; // @public -export function statusCheckHandler(options?: StatusCheckHandlerOptions): Promise; +export function statusCheckHandler( + options?: StatusCheckHandlerOptions, +): Promise; // @public (undocumented) export interface StatusCheckHandlerOptions { - statusCheck?: StatusCheck; + statusCheck?: StatusCheck; } // @public export type UrlReader = { - read(url: string): Promise; - readUrl?(url: string, options?: ReadUrlOptions): Promise; - readTree(url: string, options?: ReadTreeOptions): Promise; - search(url: string, options?: SearchOptions): Promise; + read(url: string): Promise; + readUrl?(url: string, options?: ReadUrlOptions): Promise; + readTree(url: string, options?: ReadTreeOptions): Promise; + search(url: string, options?: SearchOptions): Promise; }; // @public export class UrlReaders { - static create({ logger, config, factories }: CreateOptions): UrlReader; - static default({ logger, config, factories }: CreateOptions): UrlReader; + static create({ logger, config, factories }: CreateOptions): UrlReader; + static default({ logger, config, factories }: CreateOptions): UrlReader; } // @public -export function useHotCleanup(_module: NodeModule, cancelEffect: () => void): void; +export function useHotCleanup( + _module: NodeModule, + cancelEffect: () => void, +): void; // @public export function useHotMemoize(_module: NodeModule, valueFactory: () => T): T; - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index e777e947c2..6cf20b8234 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -47,7 +47,7 @@ "dockerode": "^3.2.1", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "git-url-parse": "~11.4.4", "helmet": "^4.0.0", "isomorphic-git": "^1.8.0", diff --git a/packages/backend-common/src/service/createStatusCheckRouter.ts b/packages/backend-common/src/service/createStatusCheckRouter.ts index ab24a6953b..fd794cc9c4 100644 --- a/packages/backend-common/src/service/createStatusCheckRouter.ts +++ b/packages/backend-common/src/service/createStatusCheckRouter.ts @@ -22,6 +22,10 @@ import { errorHandler, statusCheckHandler, StatusCheck } from '../middleware'; export interface StatusCheckRouterOptions { logger: Logger; path?: string; + /** + * If not implemented, the default express middleware always returns 200. + * Override this to implement your own logic for a health check. + */ statusCheck?: StatusCheck; } diff --git a/packages/backend-test-utils/api-report.md b/packages/backend-test-utils/api-report.md index 28d4a00463..184ed74978 100644 --- a/packages/backend-test-utils/api-report.md +++ b/packages/backend-test-utils/api-report.md @@ -3,29 +3,30 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Knex } from 'knex'; // @public (undocumented) export function isDockerDisabledForTests(): boolean; // @public -export type TestDatabaseId = 'POSTGRES_13' | 'POSTGRES_9' | 'MYSQL_8' | 'SQLITE_3'; +export type TestDatabaseId = + | 'POSTGRES_13' + | 'POSTGRES_9' + | 'MYSQL_8' + | 'SQLITE_3'; // @public export class TestDatabases { - static create(options?: { - ids?: TestDatabaseId[]; - disableDocker?: boolean; - }): TestDatabases; - // (undocumented) - eachSupportedId(): [TestDatabaseId][]; - init(id: TestDatabaseId): Promise; - // (undocumented) - supports(id: TestDatabaseId): boolean; + static create(options?: { + ids?: TestDatabaseId[]; + disableDocker?: boolean; + }): TestDatabases; + // (undocumented) + eachSupportedId(): [TestDatabaseId][]; + init(id: TestDatabaseId): Promise; + // (undocumented) + supports(id: TestDatabaseId): boolean; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 1f911c84e9..2abdeb8c75 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -3,83 +3,130 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; import { Location as Location_2 } from '@backstage/catalog-model'; // @public (undocumented) export type AddLocationRequest = { - type?: string; - target: string; - dryRun?: boolean; - presence?: 'optional' | 'required'; + type?: string; + target: string; + dryRun?: boolean; + presence?: 'optional' | 'required'; }; // @public (undocumented) export type AddLocationResponse = { - location: Location_2; - entities: Entity[]; + location: Location_2; + entities: Entity[]; }; // @public (undocumented) export interface CatalogApi { - // (undocumented) - addLocation(location: AddLocationRequest, options?: CatalogRequestOptions): Promise; - // (undocumented) - getEntities(request?: CatalogEntitiesRequest, options?: CatalogRequestOptions): Promise>; - // (undocumented) - getEntityByName(name: EntityName, options?: CatalogRequestOptions): Promise; - // (undocumented) - getLocationByEntity(entity: Entity, options?: CatalogRequestOptions): Promise; - // (undocumented) - getLocationById(id: string, options?: CatalogRequestOptions): Promise; - // (undocumented) - getOriginLocationByEntity(entity: Entity, options?: CatalogRequestOptions): Promise; - // (undocumented) - removeEntityByUid(uid: string, options?: CatalogRequestOptions): Promise; - // (undocumented) - removeLocationById(id: string, options?: CatalogRequestOptions): Promise; + // (undocumented) + addLocation( + location: AddLocationRequest, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getEntities( + request?: CatalogEntitiesRequest, + options?: CatalogRequestOptions, + ): Promise>; + // (undocumented) + getEntityByName( + name: EntityName, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getOriginLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeEntityByUid( + uid: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; } // @public (undocumented) export class CatalogClient implements CatalogApi { - constructor(options: { - discoveryApi: DiscoveryApi; - }); - // (undocumented) - addLocation({ type, target, dryRun, presence }: AddLocationRequest, options?: CatalogRequestOptions): Promise; - // (undocumented) - getEntities(request?: CatalogEntitiesRequest, options?: CatalogRequestOptions): Promise>; - // (undocumented) - getEntityByName(compoundName: EntityName, options?: CatalogRequestOptions): Promise; - // (undocumented) - getLocationByEntity(entity: Entity, options?: CatalogRequestOptions): Promise; - // (undocumented) - getLocationById(id: string, options?: CatalogRequestOptions): Promise; - // (undocumented) - getOriginLocationByEntity(entity: Entity, options?: CatalogRequestOptions): Promise; - // (undocumented) - removeEntityByUid(uid: string, options?: CatalogRequestOptions): Promise; - // (undocumented) - removeLocationById(id: string, options?: CatalogRequestOptions): Promise; - } + constructor(options: { discoveryApi: DiscoveryApi }); + // (undocumented) + addLocation( + { type, target, dryRun, presence }: AddLocationRequest, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getEntities( + request?: CatalogEntitiesRequest, + options?: CatalogRequestOptions, + ): Promise>; + // (undocumented) + getEntityByName( + compoundName: EntityName, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getOriginLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeEntityByUid( + uid: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; +} // @public (undocumented) export type CatalogEntitiesRequest = { - filter?: Record[] | Record | undefined; - fields?: string[] | undefined; + filter?: + | Record[] + | Record + | undefined; + fields?: string[] | undefined; }; // @public (undocumented) export type CatalogListResponse = { - items: T[]; + items: T[]; }; // @public -export const ENTITY_STATUS_CATALOG_PROCESSING_TYPE = "backstage.io/catalog-processing"; - +export const ENTITY_STATUS_CATALOG_PROCESSING_TYPE = + 'backstage.io/catalog-processing'; // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/catalog-model/api-report.md b/packages/catalog-model/api-report.md index 5d055566be..74027716de 100644 --- a/packages/catalog-model/api-report.md +++ b/packages/catalog-model/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { JsonObject } from '@backstage/config'; import { JSONSchema7 } from 'json-schema'; import { JsonValue } from '@backstage/config'; @@ -11,204 +10,222 @@ import { SerializedError } from '@backstage/errors'; import * as yup from 'yup'; // @public @deprecated (undocumented) -export const analyzeLocationSchema: yup.ObjectSchema<{ +export const analyzeLocationSchema: yup.ObjectSchema< + { location: LocationSpec; -}, object>; + }, + object +>; // @public (undocumented) interface ApiEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'API'; - // (undocumented) - spec: { - type: string; - lifecycle: string; - owner: string; - definition: string; - system?: string; - }; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'API'; + // (undocumented) + spec: { + type: string; + lifecycle: string; + owner: string; + definition: string; + system?: string; + }; } - -export { ApiEntityV1alpha1 as ApiEntity } - -export { ApiEntityV1alpha1 } +export { ApiEntityV1alpha1 as ApiEntity }; +export { ApiEntityV1alpha1 }; // @public (undocumented) export const apiEntityV1alpha1Validator: KindValidator; // @public export class CommonValidatorFunctions { - static isJsonSafe(value: unknown): boolean; - static isValidDnsLabel(value: unknown): boolean; - static isValidDnsSubdomain(value: unknown): boolean; - static isValidPrefixAndOrSuffix(value: unknown, separator: string, isValidPrefix: (value: string) => boolean, isValidSuffix: (value: string) => boolean): boolean; - static isValidString(value: unknown): boolean; - static isValidUrl(value: unknown): boolean; + static isJsonSafe(value: unknown): boolean; + static isValidDnsLabel(value: unknown): boolean; + static isValidDnsSubdomain(value: unknown): boolean; + static isValidPrefixAndOrSuffix( + value: unknown, + separator: string, + isValidPrefix: (value: string) => boolean, + isValidSuffix: (value: string) => boolean, + ): boolean; + static isValidString(value: unknown): boolean; + static isValidUrl(value: unknown): boolean; } // @public -export function compareEntityToRef(entity: Entity, ref: EntityRef | EntityName, context?: EntityRefContext): boolean; +export function compareEntityToRef( + entity: Entity, + ref: EntityRef | EntityName, + context?: EntityRefContext, +): boolean; // @public (undocumented) interface ComponentEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'Component'; - // (undocumented) - spec: { - type: string; - lifecycle: string; - owner: string; - subcomponentOf?: string; - providesApis?: string[]; - consumesApis?: string[]; - dependsOn?: string[]; - system?: string; - }; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'Component'; + // (undocumented) + spec: { + type: string; + lifecycle: string; + owner: string; + subcomponentOf?: string; + providesApis?: string[]; + consumesApis?: string[]; + dependsOn?: string[]; + system?: string; + }; } - -export { ComponentEntityV1alpha1 as ComponentEntity } - -export { ComponentEntityV1alpha1 } +export { ComponentEntityV1alpha1 as ComponentEntity }; +export { ComponentEntityV1alpha1 }; // @public (undocumented) export const componentEntityV1alpha1Validator: KindValidator; // @public export class DefaultNamespaceEntityPolicy implements EntityPolicy { - constructor(namespace?: string); - // (undocumented) - enforce(entity: Entity): Promise; - } + constructor(namespace?: string); + // (undocumented) + enforce(entity: Entity): Promise; +} // @public (undocumented) interface DomainEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'Domain'; - // (undocumented) - spec: { - owner: string; - }; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'Domain'; + // (undocumented) + spec: { + owner: string; + }; } - -export { DomainEntityV1alpha1 as DomainEntity } - -export { DomainEntityV1alpha1 } +export { DomainEntityV1alpha1 as DomainEntity }; +export { DomainEntityV1alpha1 }; // @public (undocumented) export const domainEntityV1alpha1Validator: KindValidator; // @public (undocumented) -export const EDIT_URL_ANNOTATION = "backstage.io/edit-url"; +export const EDIT_URL_ANNOTATION = 'backstage.io/edit-url'; // @public export type Entity = { - apiVersion: string; - kind: string; - metadata: EntityMeta; - spec?: JsonObject; - relations?: EntityRelation[]; - status?: UNSTABLE_EntityStatus; + apiVersion: string; + kind: string; + metadata: EntityMeta; + spec?: JsonObject; + relations?: EntityRelation[]; + status?: UNSTABLE_EntityStatus; }; // @public -export const ENTITY_DEFAULT_NAMESPACE = "default"; +export const ENTITY_DEFAULT_NAMESPACE = 'default'; // @public -export const ENTITY_META_GENERATED_FIELDS: readonly ["uid", "etag", "generation"]; +export const ENTITY_META_GENERATED_FIELDS: readonly [ + 'uid', + 'etag', + 'generation', +]; // @public export type EntityEnvelope = { - apiVersion: string; - kind: string; - metadata: { - name: string; - namespace?: string; - }; + apiVersion: string; + kind: string; + metadata: { + name: string; + namespace?: string; + }; }; // @public -export function entityEnvelopeSchemaValidator(schema?: unknown): (data: unknown) => T; +export function entityEnvelopeSchemaValidator< + T extends EntityEnvelope = EntityEnvelope +>(schema?: unknown): (data: unknown) => T; // @public export function entityHasChanges(previous: Entity, next: Entity): boolean; // @public -export function entityKindSchemaValidator(schema: unknown): (data: unknown) => T | false; +export function entityKindSchemaValidator( + schema: unknown, +): (data: unknown) => T | false; // @public export type EntityLink = { - url: string; - title?: string; - icon?: string; + url: string; + title?: string; + icon?: string; }; // @public export type EntityMeta = JsonObject & { - uid?: string; - etag?: string; - generation?: number; - name: string; - namespace?: string; - description?: string; - labels?: Record; - annotations?: Record; - tags?: string[]; - links?: EntityLink[]; + uid?: string; + etag?: string; + generation?: number; + name: string; + namespace?: string; + description?: string; + labels?: Record; + annotations?: Record; + tags?: string[]; + links?: EntityLink[]; }; // @public export type EntityName = { - kind: string; - namespace: string; - name: string; + kind: string; + namespace: string; + name: string; }; // @public (undocumented) export const EntityPolicies: { - allOf(policies: EntityPolicy[]): AllEntityPolicies; - oneOf(policies: EntityPolicy[]): AnyEntityPolicy; + allOf(policies: EntityPolicy[]): AllEntityPolicies; + oneOf(policies: EntityPolicy[]): AnyEntityPolicy; }; // @public export type EntityPolicy = { - enforce(entity: Entity): Promise; + enforce(entity: Entity): Promise; }; // @public -export type EntityRef = string | { - kind?: string; - namespace?: string; - name: string; -}; +export type EntityRef = + | string + | { + kind?: string; + namespace?: string; + name: string; + }; // @public export type EntityRelation = { - type: string; - target: EntityName; + type: string; + target: EntityName; }; // @public export type EntityRelationSpec = { - source: EntityName; - type: string; - target: EntityName; + source: EntityName; + type: string; + target: EntityName; }; // @public -export function entitySchemaValidator(schema?: unknown): (data: unknown) => T; +export function entitySchemaValidator( + schema?: unknown, +): (data: unknown) => T; // @public export class FieldFormatEntityPolicy implements EntityPolicy { - constructor(validators?: Validators); - // (undocumented) - enforce(entity: Entity): Promise; - } + constructor(validators?: Validators); + // (undocumented) + enforce(entity: Entity): Promise; +} // @public export function generateEntityEtag(): string; @@ -223,95 +240,93 @@ export function generateUpdatedEntity(previous: Entity, next: Entity): Entity; export function getEntityName(entity: Entity): EntityName; // @public -export function getEntitySourceLocation(entity: Entity): { - type: string; - target: string; +export function getEntitySourceLocation( + entity: Entity, +): { + type: string; + target: string; }; // @public (undocumented) interface GroupEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'Group'; - // (undocumented) - spec: { - type: string; - profile?: { - displayName?: string; - email?: string; - picture?: string; - }; - parent?: string; - children: string[]; - members?: string[]; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'Group'; + // (undocumented) + spec: { + type: string; + profile?: { + displayName?: string; + email?: string; + picture?: string; }; + parent?: string; + children: string[]; + members?: string[]; + }; } - -export { GroupEntityV1alpha1 as GroupEntity } - -export { GroupEntityV1alpha1 } +export { GroupEntityV1alpha1 as GroupEntity }; +export { GroupEntityV1alpha1 }; // @public (undocumented) export const groupEntityV1alpha1Validator: KindValidator; // @public (undocumented) -export type JSONSchema = JSONSchema7 & { +export type JSONSchema = JSONSchema7 & + { [key in string]?: JsonValue; -}; + }; // @public export type KindValidator = { - check(entity: Entity): Promise; + check(entity: Entity): Promise; }; // @public export class KubernetesValidatorFunctions { - // (undocumented) - static isValidAnnotationKey(value: unknown): boolean; - // (undocumented) - static isValidAnnotationValue(value: unknown): boolean; - // (undocumented) - static isValidApiVersion(value: unknown): boolean; - // (undocumented) - static isValidKind(value: unknown): boolean; - // (undocumented) - static isValidLabelKey(value: unknown): boolean; - // (undocumented) - static isValidLabelValue(value: unknown): boolean; - // (undocumented) - static isValidNamespace(value: unknown): boolean; - // (undocumented) - static isValidObjectName(value: unknown): boolean; + // (undocumented) + static isValidAnnotationKey(value: unknown): boolean; + // (undocumented) + static isValidAnnotationValue(value: unknown): boolean; + // (undocumented) + static isValidApiVersion(value: unknown): boolean; + // (undocumented) + static isValidKind(value: unknown): boolean; + // (undocumented) + static isValidLabelKey(value: unknown): boolean; + // (undocumented) + static isValidLabelValue(value: unknown): boolean; + // (undocumented) + static isValidNamespace(value: unknown): boolean; + // (undocumented) + static isValidObjectName(value: unknown): boolean; } // @public (undocumented) type Location_2 = { - id: string; + id: string; } & LocationSpec; - -export { Location_2 as Location } +export { Location_2 as Location }; // @public (undocumented) -export const LOCATION_ANNOTATION = "backstage.io/managed-by-location"; +export const LOCATION_ANNOTATION = 'backstage.io/managed-by-location'; // @public (undocumented) interface LocationEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'Location'; - // (undocumented) - spec: { - type?: string; - target?: string; - targets?: string[]; - }; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'Location'; + // (undocumented) + spec: { + type?: string; + target?: string; + targets?: string[]; + }; } - -export { LocationEntityV1alpha1 as LocationEntity } - -export { LocationEntityV1alpha1 } +export { LocationEntityV1alpha1 as LocationEntity }; +export { LocationEntityV1alpha1 }; // @public (undocumented) export const locationEntityV1alpha1Validator: KindValidator; @@ -321,9 +336,9 @@ export const locationSchema: yup.ObjectSchema; // @public (undocumented) export type LocationSpec = { - type: string; - target: string; - presence?: 'optional' | 'required'; + type: string; + target: string; + presence?: 'optional' | 'required'; }; // @public @deprecated (undocumented) @@ -334,190 +349,209 @@ export function makeValidator(overrides?: Partial): Validators; // @public export class NoForeignRootFieldsEntityPolicy implements EntityPolicy { - constructor(knownFields?: string[]); - // (undocumented) - enforce(entity: Entity): Promise; - } + constructor(knownFields?: string[]); + // (undocumented) + enforce(entity: Entity): Promise; +} // @public (undocumented) -export const ORIGIN_LOCATION_ANNOTATION = "backstage.io/managed-by-origin-location"; +export const ORIGIN_LOCATION_ANNOTATION = + 'backstage.io/managed-by-origin-location'; // @public -export function parseEntityName(ref: EntityRef, context?: EntityRefContext): EntityName; +export function parseEntityName( + ref: EntityRef, + context?: EntityRefContext, +): EntityName; // @public -export function parseEntityRef(ref: EntityRef, context?: { +export function parseEntityRef( + ref: EntityRef, + context?: { defaultKind: string; defaultNamespace: string; -}): { - kind: string; - namespace: string; - name: string; + }, +): { + kind: string; + namespace: string; + name: string; }; // @public (undocumented) -export function parseEntityRef(ref: EntityRef, context?: { +export function parseEntityRef( + ref: EntityRef, + context?: { defaultKind: string; -}): { - kind: string; - namespace?: string; - name: string; + }, +): { + kind: string; + namespace?: string; + name: string; }; // @public (undocumented) -export function parseEntityRef(ref: EntityRef, context?: { +export function parseEntityRef( + ref: EntityRef, + context?: { defaultNamespace: string; -}): { - kind?: string; - namespace: string; - name: string; + }, +): { + kind?: string; + namespace: string; + name: string; }; // @public -export function parseLocationReference(ref: string): { - type: string; - target: string; +export function parseLocationReference( + ref: string, +): { + type: string; + target: string; }; // @public (undocumented) -export const RELATION_API_CONSUMED_BY = "apiConsumedBy"; +export const RELATION_API_CONSUMED_BY = 'apiConsumedBy'; // @public (undocumented) -export const RELATION_API_PROVIDED_BY = "apiProvidedBy"; +export const RELATION_API_PROVIDED_BY = 'apiProvidedBy'; // @public (undocumented) -export const RELATION_CHILD_OF = "childOf"; +export const RELATION_CHILD_OF = 'childOf'; // @public -export const RELATION_CONSUMES_API = "consumesApi"; +export const RELATION_CONSUMES_API = 'consumesApi'; // @public (undocumented) -export const RELATION_DEPENDENCY_OF = "dependencyOf"; +export const RELATION_DEPENDENCY_OF = 'dependencyOf'; // @public -export const RELATION_DEPENDS_ON = "dependsOn"; +export const RELATION_DEPENDS_ON = 'dependsOn'; // @public (undocumented) -export const RELATION_HAS_MEMBER = "hasMember"; +export const RELATION_HAS_MEMBER = 'hasMember'; // @public (undocumented) -export const RELATION_HAS_PART = "hasPart"; +export const RELATION_HAS_PART = 'hasPart'; // @public -export const RELATION_MEMBER_OF = "memberOf"; +export const RELATION_MEMBER_OF = 'memberOf'; // @public -export const RELATION_OWNED_BY = "ownedBy"; +export const RELATION_OWNED_BY = 'ownedBy'; // @public (undocumented) -export const RELATION_OWNER_OF = "ownerOf"; +export const RELATION_OWNER_OF = 'ownerOf'; // @public -export const RELATION_PARENT_OF = "parentOf"; +export const RELATION_PARENT_OF = 'parentOf'; // @public -export const RELATION_PART_OF = "partOf"; +export const RELATION_PART_OF = 'partOf'; // @public (undocumented) -export const RELATION_PROVIDES_API = "providesApi"; +export const RELATION_PROVIDES_API = 'providesApi'; // @public (undocumented) interface ResourceEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'Resource'; - // (undocumented) - spec: { - type: string; - owner: string; - dependsOn?: string[]; - system?: string; - }; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'Resource'; + // (undocumented) + spec: { + type: string; + owner: string; + dependsOn?: string[]; + system?: string; + }; } - -export { ResourceEntityV1alpha1 as ResourceEntity } - -export { ResourceEntityV1alpha1 } +export { ResourceEntityV1alpha1 as ResourceEntity }; +export { ResourceEntityV1alpha1 }; // @public (undocumented) export const resourceEntityV1alpha1Validator: KindValidator; // @public export class SchemaValidEntityPolicy implements EntityPolicy { - // (undocumented) - enforce(entity: Entity): Promise; - } + // (undocumented) + enforce(entity: Entity): Promise; +} // @public @deprecated -export function serializeEntityRef(ref: Entity | { - kind?: string; - namespace?: string; - name: string; -}): EntityRef; +export function serializeEntityRef( + ref: + | Entity + | { + kind?: string; + namespace?: string; + name: string; + }, +): EntityRef; // @public (undocumented) -export const SOURCE_LOCATION_ANNOTATION = "backstage.io/source-location"; +export const SOURCE_LOCATION_ANNOTATION = 'backstage.io/source-location'; // @public -export function stringifyEntityRef(ref: Entity | { - kind: string; - namespace?: string; - name: string; -}): string; +export function stringifyEntityRef( + ref: + | Entity + | { + kind: string; + namespace?: string; + name: string; + }, +): string; // @public export function stringifyLocationReference(ref: { - type: string; - target: string; + type: string; + target: string; }): string; // @public (undocumented) interface SystemEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'System'; - // (undocumented) - spec: { - owner: string; - domain?: string; - }; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'System'; + // (undocumented) + spec: { + owner: string; + domain?: string; + }; } - -export { SystemEntityV1alpha1 as SystemEntity } - -export { SystemEntityV1alpha1 } +export { SystemEntityV1alpha1 as SystemEntity }; +export { SystemEntityV1alpha1 }; // @public (undocumented) export const systemEntityV1alpha1Validator: KindValidator; // @public (undocumented) export interface TemplateEntityV1beta2 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1beta2'; - // (undocumented) - kind: 'Template'; - // (undocumented) - metadata: EntityMeta & { - title?: string; - }; - // (undocumented) - spec: { - type: string; - parameters?: JsonObject | JsonObject[]; - steps: Array<{ - id?: string; - name?: string; - action: string; - input?: JsonObject; - if?: string | boolean; - }>; - output?: { - [name: string]: string; - }; - owner?: string; + // (undocumented) + apiVersion: 'backstage.io/v1beta2'; + // (undocumented) + kind: 'Template'; + // (undocumented) + metadata: EntityMeta & { + title?: string; + }; + // (undocumented) + spec: { + type: string; + parameters?: JsonObject | JsonObject[]; + steps: Array<{ + id?: string; + name?: string; + action: string; + input?: JsonObject; + if?: string | boolean; + }>; + output?: { + [name: string]: string; }; + owner?: string; + }; } // @public (undocumented) @@ -525,15 +559,15 @@ export const templateEntityV1beta2Validator: KindValidator; // @alpha export type UNSTABLE_EntityStatus = { - items?: UNSTABLE_EntityStatusItem[]; + items?: UNSTABLE_EntityStatusItem[]; }; // @alpha export type UNSTABLE_EntityStatusItem = { - type: string; - level: UNSTABLE_EntityStatusLevel; - message: string; - error?: SerializedError; + type: string; + level: UNSTABLE_EntityStatusLevel; + message: string; + error?: SerializedError; }; // @alpha @@ -541,45 +575,41 @@ export type UNSTABLE_EntityStatusLevel = 'info' | 'warning' | 'error'; // @public (undocumented) interface UserEntityV1alpha1 extends Entity { - // (undocumented) - apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; - // (undocumented) - kind: 'User'; - // (undocumented) - spec: { - profile?: { - displayName?: string; - email?: string; - picture?: string; - }; - memberOf: string[]; + // (undocumented) + apiVersion: 'backstage.io/v1alpha1' | 'backstage.io/v1beta1'; + // (undocumented) + kind: 'User'; + // (undocumented) + spec: { + profile?: { + displayName?: string; + email?: string; + picture?: string; }; + memberOf: string[]; + }; } - -export { UserEntityV1alpha1 as UserEntity } - -export { UserEntityV1alpha1 } +export { UserEntityV1alpha1 as UserEntity }; +export { UserEntityV1alpha1 }; // @public (undocumented) export const userEntityV1alpha1Validator: KindValidator; // @public (undocumented) export type Validators = { - isValidApiVersion(value: unknown): boolean; - isValidKind(value: unknown): boolean; - isValidEntityName(value: unknown): boolean; - isValidNamespace(value: unknown): boolean; - isValidLabelKey(value: unknown): boolean; - isValidLabelValue(value: unknown): boolean; - isValidAnnotationKey(value: unknown): boolean; - isValidAnnotationValue(value: unknown): boolean; - isValidTag(value: unknown): boolean; + isValidApiVersion(value: unknown): boolean; + isValidKind(value: unknown): boolean; + isValidEntityName(value: unknown): boolean; + isValidNamespace(value: unknown): boolean; + isValidLabelKey(value: unknown): boolean; + isValidLabelValue(value: unknown): boolean; + isValidAnnotationKey(value: unknown): boolean; + isValidAnnotationValue(value: unknown): boolean; + isValidTag(value: unknown): boolean; }; // @public -export const VIEW_URL_ANNOTATION = "backstage.io/view-url"; - +export const VIEW_URL_ANNOTATION = 'backstage.io/view-url'; // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/cli/package.json b/packages/cli/package.json index c9bde05bd7..a7032879bc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -77,7 +77,7 @@ "express": "^4.17.1", "file-loader": "^6.2.0", "fork-ts-checker-webpack-plugin": "^6.2.9", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "handlebars": "^4.7.3", "html-webpack-plugin": "^4.3.0", "inquirer": "^7.0.4", diff --git a/packages/config-loader/api-report.md b/packages/config-loader/api-report.md index a09311b786..ffd15b0c9a 100644 --- a/packages/config-loader/api-report.md +++ b/packages/config-loader/api-report.md @@ -3,15 +3,17 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { AppConfig } from '@backstage/config'; import { JsonObject } from '@backstage/config'; import { JSONSchema7 } from 'json-schema'; // @public export type ConfigSchema = { - process(appConfigs: AppConfig[], options?: ConfigProcessingOptions): AppConfig[]; - serialize(): JsonObject; + process( + appConfigs: AppConfig[], + options?: ConfigProcessingOptions, + ): AppConfig[]; + serialize(): JsonObject; }; // @public @@ -22,10 +24,10 @@ export function loadConfig(options: LoadConfigOptions): Promise; // @public (undocumented) export type LoadConfigOptions = { - configRoot: string; - configPaths: string[]; - env?: string; - experimentalEnvFunc?: EnvFunc; + configRoot: string; + configPaths: string[]; + env?: string; + experimentalEnvFunc?: EnvFunc; }; // @public @@ -36,10 +38,8 @@ export function mergeConfigSchemas(schemas: JSONSchema7[]): JSONSchema7; // @public export function readEnvConfig(env: { - [name: string]: string | undefined; + [name: string]: string | undefined; }): AppConfig[]; - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index d5a4f600fd..cff324484a 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -34,7 +34,7 @@ "@backstage/config": "^0.1.5", "@types/json-schema": "^7.0.6", "ajv": "^7.0.3", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "json-schema": "^0.3.0", "json-schema-merge-allof": "^0.8.1", "typescript-json-schema": "^0.50.1", diff --git a/packages/config/api-report.md b/packages/config/api-report.md index be250778ec..0c243aab48 100644 --- a/packages/config/api-report.md +++ b/packages/config/api-report.md @@ -3,79 +3,82 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - // @public (undocumented) export type AppConfig = { - context: string; - data: JsonObject; + context: string; + data: JsonObject; }; // @public (undocumented) export type Config = { - has(key: string): boolean; - keys(): string[]; - get(key?: string): T; - getOptional(key?: string): T | undefined; - getConfig(key: string): Config; - getOptionalConfig(key: string): Config | undefined; - getConfigArray(key: string): Config[]; - getOptionalConfigArray(key: string): Config[] | undefined; - getNumber(key: string): number; - getOptionalNumber(key: string): number | undefined; - getBoolean(key: string): boolean; - getOptionalBoolean(key: string): boolean | undefined; - getString(key: string): string; - getOptionalString(key: string): string | undefined; - getStringArray(key: string): string[]; - getOptionalStringArray(key: string): string[] | undefined; + has(key: string): boolean; + keys(): string[]; + get(key?: string): T; + getOptional(key?: string): T | undefined; + getConfig(key: string): Config; + getOptionalConfig(key: string): Config | undefined; + getConfigArray(key: string): Config[]; + getOptionalConfigArray(key: string): Config[] | undefined; + getNumber(key: string): number; + getOptionalNumber(key: string): number | undefined; + getBoolean(key: string): boolean; + getOptionalBoolean(key: string): boolean | undefined; + getString(key: string): string; + getOptionalString(key: string): string | undefined; + getStringArray(key: string): string[]; + getOptionalStringArray(key: string): string[] | undefined; }; // @public (undocumented) export class ConfigReader implements Config { - constructor(data: JsonObject | undefined, context?: string, fallback?: ConfigReader | undefined, prefix?: string); - // (undocumented) - static fromConfigs(configs: AppConfig[]): ConfigReader; - // (undocumented) - get(key?: string): T; - // (undocumented) - getBoolean(key: string): boolean; - // (undocumented) - getConfig(key: string): ConfigReader; - // (undocumented) - getConfigArray(key: string): ConfigReader[]; - // (undocumented) - getNumber(key: string): number; - // (undocumented) - getOptional(key?: string): T | undefined; - // (undocumented) - getOptionalBoolean(key: string): boolean | undefined; - // (undocumented) - getOptionalConfig(key: string): ConfigReader | undefined; - // (undocumented) - getOptionalConfigArray(key: string): ConfigReader[] | undefined; - // (undocumented) - getOptionalNumber(key: string): number | undefined; - // (undocumented) - getOptionalString(key: string): string | undefined; - // (undocumented) - getOptionalStringArray(key: string): string[] | undefined; - // (undocumented) - getString(key: string): string; - // (undocumented) - getStringArray(key: string): string[]; - // (undocumented) - has(key: string): boolean; - // (undocumented) - keys(): string[]; - } - -// @public (undocumented) -export interface JsonArray extends Array { + constructor( + data: JsonObject | undefined, + context?: string, + fallback?: ConfigReader | undefined, + prefix?: string, + ); + // (undocumented) + static fromConfigs(configs: AppConfig[]): ConfigReader; + // (undocumented) + get(key?: string): T; + // (undocumented) + getBoolean(key: string): boolean; + // (undocumented) + getConfig(key: string): ConfigReader; + // (undocumented) + getConfigArray(key: string): ConfigReader[]; + // (undocumented) + getNumber(key: string): number; + // (undocumented) + getOptional(key?: string): T | undefined; + // (undocumented) + getOptionalBoolean(key: string): boolean | undefined; + // (undocumented) + getOptionalConfig(key: string): ConfigReader | undefined; + // (undocumented) + getOptionalConfigArray(key: string): ConfigReader[] | undefined; + // (undocumented) + getOptionalNumber(key: string): number | undefined; + // (undocumented) + getOptionalString(key: string): string | undefined; + // (undocumented) + getOptionalStringArray(key: string): string[] | undefined; + // (undocumented) + getString(key: string): string; + // (undocumented) + getStringArray(key: string): string[]; + // (undocumented) + has(key: string): boolean; + // (undocumented) + keys(): string[]; } +// @public (undocumented) +export interface JsonArray extends Array {} + // @public (undocumented) export type JsonObject = { - [key in string]?: JsonValue; + [key in string]?: JsonValue; }; // @public (undocumented) @@ -84,7 +87,5 @@ export type JsonPrimitive = number | string | boolean | null; // @public (undocumented) export type JsonValue = JsonObject | JsonArray | JsonPrimitive; - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 8cb18cf1ce..af86f042a0 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { AlertApi } from '@backstage/core-plugin-api'; import { AlertMessage } from '@backstage/core-plugin-api'; import { AnyApiFactory } from '@backstage/core-plugin-api'; @@ -57,72 +56,97 @@ import { SubRouteRef } from '@backstage/core-plugin-api'; // @public export class AlertApiForwarder implements AlertApi { - // (undocumented) - alert$(): Observable; - // (undocumented) - post(alert: AlertMessage): void; - } + // (undocumented) + alert$(): Observable; + // (undocumented) + post(alert: AlertMessage): void; +} // @public (undocumented) export type ApiFactoryHolder = { - get(api: ApiRef): ApiFactory | undefined; + get( + api: ApiRef, + ): + | ApiFactory< + T, + T, + { + [key in string]: unknown; + } + > + | undefined; }; // @public export class ApiFactoryRegistry implements ApiFactoryHolder { - // (undocumented) - get(api: ApiRef): ApiFactory | undefined; - // (undocumented) - getAllApis(): Set; - register(scope: ApiFactoryScope, factory: ApiFactory): boolean; + // (undocumented) + get( + api: ApiRef, + ): + | ApiFactory< + T, + T, + { + [x: string]: unknown; + } + > + | undefined; + // (undocumented) + getAllApis(): Set; + register< + Api, + Impl extends Api, + Deps extends { + [name in string]: unknown; + } + >(scope: ApiFactoryScope, factory: ApiFactory): boolean; } // @public (undocumented) export const ApiProvider: { - ({ apis, children, }: PropsWithChildren): JSX.Element; - propTypes: { - apis: PropTypes.Validator any>; - }>>; - children: PropTypes.Requireable; - }; + ({ apis, children }: PropsWithChildren): JSX.Element; + propTypes: { + apis: PropTypes.Validator< + PropTypes.InferProps<{ + get: PropTypes.Validator<(...args: any[]) => any>; + }> + >; + children: PropTypes.Requireable; + }; }; // @public (undocumented) export class ApiRegistry implements ApiHolder { - constructor(apis: Map); - // (undocumented) - static builder(): ApiRegistryBuilder; - // (undocumented) - static from(apis: ApiImpl[]): ApiRegistry; - // (undocumented) - get(api: ApiRef): T | undefined; - static with(api: ApiRef, impl: T): ApiRegistry; - with(api: ApiRef, impl: T): ApiRegistry; + constructor(apis: Map); + // (undocumented) + static builder(): ApiRegistryBuilder; + // (undocumented) + static from(apis: ApiImpl[]): ApiRegistry; + // (undocumented) + get(api: ApiRef): T | undefined; + static with(api: ApiRef, impl: T): ApiRegistry; + with(api: ApiRef, impl: T): ApiRegistry; } // @public (undocumented) export class ApiResolver implements ApiHolder { - constructor(factories: ApiFactoryHolder); - // (undocumented) - get(ref: ApiRef): T | undefined; - static validateFactories(factories: ApiFactoryHolder, apis: Iterable): void; + constructor(factories: ApiFactoryHolder); + // (undocumented) + get(ref: ApiRef): T | undefined; + static validateFactories( + factories: ApiFactoryHolder, + apis: Iterable, + ): void; } // @public (undocumented) export type AppComponents = { - NotFoundErrorPage: ComponentType<{}>; - BootErrorPage: ComponentType; - Progress: ComponentType<{}>; - Router: ComponentType<{}>; - ErrorBoundaryFallback: ComponentType; - SignInPage?: ComponentType; + NotFoundErrorPage: ComponentType<{}>; + BootErrorPage: ComponentType; + Progress: ComponentType<{}>; + Router: ComponentType<{}>; + ErrorBoundaryFallback: ComponentType; + SignInPage?: ComponentType; }; // @public @@ -130,72 +154,88 @@ export type AppConfigLoader = () => Promise; // @public (undocumented) export type AppContext = { - getPlugins(): BackstagePlugin[]; - getSystemIcon(key: string): IconComponent | undefined; - getComponents(): AppComponents; + getPlugins(): BackstagePlugin[]; + getSystemIcon(key: string): IconComponent | undefined; + getComponents(): AppComponents; }; // @public (undocumented) export type AppOptions = { - apis?: Iterable; - icons?: Partial & { - [key in string]: IconComponent; + apis?: Iterable; + icons?: Partial & + { + [key in string]: IconComponent; }; - plugins?: BackstagePluginWithAnyOutput[]; - components?: Partial; - themes?: AppTheme[]; - configLoader?: AppConfigLoader; - bindRoutes?(context: { - bind: AppRouteBinder; - }): void; + plugins?: BackstagePluginWithAnyOutput[]; + components?: Partial; + themes?: AppTheme[]; + configLoader?: AppConfigLoader; + bindRoutes?(context: { bind: AppRouteBinder }): void; }; // @public (undocumented) -export type AppRouteBinder = (externalRoutes: ExternalRoutes, targetRoutes: PartialKeys, KeysWithType>>) => void; + } +>( + externalRoutes: ExternalRoutes, + targetRoutes: PartialKeys< + TargetRouteMap, + KeysWithType> + >, +) => void; // @public (undocumented) export class AppThemeSelector implements AppThemeApi { - constructor(themes: AppTheme[]); - // (undocumented) - activeThemeId$(): Observable; - // (undocumented) - static createWithStorage(themes: AppTheme[]): AppThemeSelector; - // (undocumented) - getActiveThemeId(): string | undefined; - // (undocumented) - getInstalledThemes(): AppTheme[]; - // (undocumented) - setActiveThemeId(themeId?: string): void; - } + constructor(themes: AppTheme[]); + // (undocumented) + activeThemeId$(): Observable; + // (undocumented) + static createWithStorage(themes: AppTheme[]): AppThemeSelector; + // (undocumented) + getActiveThemeId(): string | undefined; + // (undocumented) + getInstalledThemes(): AppTheme[]; + // (undocumented) + setActiveThemeId(themeId?: string): void; +} // @public (undocumented) export class Auth0Auth { - // (undocumented) - static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof auth0AuthApiRef.T; + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + oauthRequestApi, + defaultScopes, + }: OAuthApiCreateOptions): typeof auth0AuthApiRef.T; } // @public (undocumented) export type BackstageApp = { - getPlugins(): BackstagePlugin[]; - getSystemIcon(key: string): IconComponent | undefined; - getProvider(): ComponentType<{}>; - getRouter(): ComponentType<{}>; + getPlugins(): BackstagePlugin[]; + getSystemIcon(key: string): IconComponent | undefined; + getProvider(): ComponentType<{}>; + getRouter(): ComponentType<{}>; }; // @public (undocumented) -export type BackstagePluginWithAnyOutput = Omit, 'output'> & { - output(): (PluginOutput | UnknownPluginOutput)[]; +export type BackstagePluginWithAnyOutput = Omit< + BackstagePlugin, + 'output' +> & { + output(): (PluginOutput | UnknownPluginOutput)[]; }; // @public (undocumented) export type BootErrorPageProps = { - step: 'load-config' | 'load-chunk'; - error: Error; + step: 'load-config' | 'load-chunk'; + error: Error; }; -export { ConfigReader } +export { ConfigReader }; // @public export function createApp(options?: AppOptions): PrivateAppImpl; @@ -205,36 +245,36 @@ export const defaultConfigLoader: AppConfigLoader; // @public export class ErrorAlerter implements ErrorApi { - constructor(alertApi: AlertApi, errorApi: ErrorApi); - // (undocumented) - error$(): Observable<{ - error: { - name: string; - message: string; - stack?: string | undefined; - }; - context?: ErrorContext | undefined; - }>; - // (undocumented) - post(error: Error, context?: ErrorContext): void; + constructor(alertApi: AlertApi, errorApi: ErrorApi); + // (undocumented) + error$(): Observable<{ + error: { + name: string; + message: string; + stack?: string | undefined; + }; + context?: ErrorContext | undefined; + }>; + // (undocumented) + post(error: Error, context?: ErrorContext): void; } // @public export class ErrorApiForwarder implements ErrorApi { - // (undocumented) - error$(): Observable<{ - error: Error; - context?: ErrorContext; - }>; - // (undocumented) - post(error: Error, context?: ErrorContext): void; - } + // (undocumented) + error$(): Observable<{ + error: Error; + context?: ErrorContext; + }>; + // (undocumented) + post(error: Error, context?: ErrorContext): void; +} // @public (undocumented) export type ErrorBoundaryFallbackProps = { - plugin?: BackstagePlugin; - error: Error; - resetError: () => void; + plugin?: BackstagePlugin; + error: Error; + resetError: () => void; }; // @public (undocumented) @@ -242,191 +282,254 @@ export const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element; // @public (undocumented) export type FeatureFlaggedProps = { - children: ReactNode; -} & ({ - with: string; -} | { - without: string; -}); + children: ReactNode; +} & ( + | { + with: string; + } + | { + without: string; + } +); // @public (undocumented) export const FlatRoutes: (props: FlatRoutesProps) => JSX.Element | null; // @public (undocumented) export class GithubAuth implements OAuthApi, SessionApi { - constructor(sessionManager: SessionManager); - // (undocumented) - static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): GithubAuth; - // (undocumented) - getAccessToken(scope?: string, options?: AuthRequestOptions): Promise; - // (undocumented) - getBackstageIdentity(options?: AuthRequestOptions): Promise; - // (undocumented) - getProfile(options?: AuthRequestOptions): Promise; - // (undocumented) - static normalizeScope(scope?: string): Set; - // (undocumented) - sessionState$(): Observable; - // (undocumented) - signIn(): Promise; - // (undocumented) - signOut(): Promise; + constructor(sessionManager: SessionManager); + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + oauthRequestApi, + defaultScopes, + }: OAuthApiCreateOptions): GithubAuth; + // (undocumented) + getAccessToken(scope?: string, options?: AuthRequestOptions): Promise; + // (undocumented) + getBackstageIdentity( + options?: AuthRequestOptions, + ): Promise; + // (undocumented) + getProfile(options?: AuthRequestOptions): Promise; + // (undocumented) + static normalizeScope(scope?: string): Set; + // (undocumented) + sessionState$(): Observable; + // (undocumented) + signIn(): Promise; + // (undocumented) + signOut(): Promise; } // @public (undocumented) export type GithubSession = { - providerInfo: { - accessToken: string; - scopes: Set; - expiresAt: Date; - }; - profile: ProfileInfo; - backstageIdentity: BackstageIdentity; + providerInfo: { + accessToken: string; + scopes: Set; + expiresAt: Date; + }; + profile: ProfileInfo; + backstageIdentity: BackstageIdentity; }; // @public (undocumented) export class GitlabAuth { - // (undocumented) - static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof gitlabAuthApiRef.T; + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + oauthRequestApi, + defaultScopes, + }: OAuthApiCreateOptions): typeof gitlabAuthApiRef.T; } // @public (undocumented) export class GoogleAuth { - // (undocumented) - static create({ discoveryApi, oauthRequestApi, environment, provider, defaultScopes, }: OAuthApiCreateOptions): typeof googleAuthApiRef.T; + // (undocumented) + static create({ + discoveryApi, + oauthRequestApi, + environment, + provider, + defaultScopes, + }: OAuthApiCreateOptions): typeof googleAuthApiRef.T; } // @public export class LocalStorageFeatureFlags implements FeatureFlagsApi { - // (undocumented) - getRegisteredFlags(): FeatureFlag[]; - // (undocumented) - isActive(name: string): boolean; - // (undocumented) - registerFlag(flag: FeatureFlag): void; - // (undocumented) - save(options: FeatureFlagsSaveOptions): void; + // (undocumented) + getRegisteredFlags(): FeatureFlag[]; + // (undocumented) + isActive(name: string): boolean; + // (undocumented) + registerFlag(flag: FeatureFlag): void; + // (undocumented) + save(options: FeatureFlagsSaveOptions): void; } // @public (undocumented) export class MicrosoftAuth { - // (undocumented) - static create({ environment, provider, oauthRequestApi, discoveryApi, defaultScopes, }: OAuthApiCreateOptions): typeof microsoftAuthApiRef.T; + // (undocumented) + static create({ + environment, + provider, + oauthRequestApi, + discoveryApi, + defaultScopes, + }: OAuthApiCreateOptions): typeof microsoftAuthApiRef.T; } // @public (undocumented) -export class OAuth2 implements OAuthApi, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, SessionApi { - constructor(options: Options); - // (undocumented) - static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, scopeTransform, }: CreateOptions): OAuth2; - // (undocumented) - getAccessToken(scope?: string | string[], options?: AuthRequestOptions): Promise; - // (undocumented) - getBackstageIdentity(options?: AuthRequestOptions): Promise; - // (undocumented) - getIdToken(options?: AuthRequestOptions): Promise; - // (undocumented) - getProfile(options?: AuthRequestOptions): Promise; - // (undocumented) - sessionState$(): Observable; - // (undocumented) - signIn(): Promise; - // (undocumented) - signOut(): Promise; +export class OAuth2 + implements + OAuthApi, + OpenIdConnectApi, + ProfileInfoApi, + BackstageIdentityApi, + SessionApi { + constructor(options: Options); + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + oauthRequestApi, + defaultScopes, + scopeTransform, + }: CreateOptions): OAuth2; + // (undocumented) + getAccessToken( + scope?: string | string[], + options?: AuthRequestOptions, + ): Promise; + // (undocumented) + getBackstageIdentity( + options?: AuthRequestOptions, + ): Promise; + // (undocumented) + getIdToken(options?: AuthRequestOptions): Promise; + // (undocumented) + getProfile(options?: AuthRequestOptions): Promise; + // (undocumented) + sessionState$(): Observable; + // (undocumented) + signIn(): Promise; + // (undocumented) + signOut(): Promise; } // @public (undocumented) export type OAuth2Session = { - providerInfo: { - idToken: string; - accessToken: string; - scopes: Set; - expiresAt: Date; - }; - profile: ProfileInfo; - backstageIdentity: BackstageIdentity; + providerInfo: { + idToken: string; + accessToken: string; + scopes: Set; + expiresAt: Date; + }; + profile: ProfileInfo; + backstageIdentity: BackstageIdentity; }; // @public export class OAuthRequestManager implements OAuthRequestApi { - // (undocumented) - authRequest$(): Observable; - // (undocumented) - createAuthRequester(options: AuthRequesterOptions): AuthRequester; - } + // (undocumented) + authRequest$(): Observable; + // (undocumented) + createAuthRequester(options: AuthRequesterOptions): AuthRequester; +} // @public (undocumented) export class OktaAuth { - // (undocumented) - static create({ discoveryApi, environment, provider, oauthRequestApi, defaultScopes, }: OAuthApiCreateOptions): typeof oktaAuthApiRef.T; + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + oauthRequestApi, + defaultScopes, + }: OAuthApiCreateOptions): typeof oktaAuthApiRef.T; } // @public (undocumented) export class OneLoginAuth { - // (undocumented) - static create({ discoveryApi, environment, provider, oauthRequestApi, }: CreateOptions_2): typeof oneloginAuthApiRef.T; + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + oauthRequestApi, + }: CreateOptions_2): typeof oneloginAuthApiRef.T; } // @public (undocumented) -export class SamlAuth implements ProfileInfoApi, BackstageIdentityApi, SessionApi { - constructor(sessionManager: SessionManager); - // (undocumented) - static create({ discoveryApi, environment, provider, }: AuthApiCreateOptions): SamlAuth; - // (undocumented) - getBackstageIdentity(options?: AuthRequestOptions): Promise; - // (undocumented) - getProfile(options?: AuthRequestOptions): Promise; - // (undocumented) - sessionState$(): Observable; - // (undocumented) - signIn(): Promise; - // (undocumented) - signOut(): Promise; +export class SamlAuth + implements ProfileInfoApi, BackstageIdentityApi, SessionApi { + constructor(sessionManager: SessionManager); + // (undocumented) + static create({ + discoveryApi, + environment, + provider, + }: AuthApiCreateOptions): SamlAuth; + // (undocumented) + getBackstageIdentity( + options?: AuthRequestOptions, + ): Promise; + // (undocumented) + getProfile(options?: AuthRequestOptions): Promise; + // (undocumented) + sessionState$(): Observable; + // (undocumented) + signIn(): Promise; + // (undocumented) + signOut(): Promise; } // @public (undocumented) export type SignInPageProps = { - onResult(result: SignInResult): void; + onResult(result: SignInResult): void; }; // @public (undocumented) export type SignInResult = { - userId: string; - profile: ProfileInfo; - getIdToken?: () => Promise; - signOut?: () => Promise; + userId: string; + profile: ProfileInfo; + getIdToken?: () => Promise; + signOut?: () => Promise; }; // @public (undocumented) export class UnhandledErrorForwarder { - static forward(errorApi: ErrorApi, errorContext: ErrorContext): void; + static forward(errorApi: ErrorApi, errorContext: ErrorContext): void; } // @public export class UrlPatternDiscovery implements DiscoveryApi { - static compile(pattern: string): UrlPatternDiscovery; - // (undocumented) - getBaseUrl(pluginId: string): Promise; - } + static compile(pattern: string): UrlPatternDiscovery; + // (undocumented) + getBaseUrl(pluginId: string): Promise; +} // @public (undocumented) export class WebStorage implements StorageApi { - constructor(namespace: string, errorApi: ErrorApi); - // (undocumented) - static create(options: CreateStorageApiOptions): WebStorage; - // (undocumented) - forBucket(name: string): WebStorage; - // (undocumented) - get(key: string): T | undefined; - // (undocumented) - observe$(key: string): Observable>; - // (undocumented) - remove(key: string): Promise; - // (undocumented) - set(key: string, data: T): Promise; - } - + constructor(namespace: string, errorApi: ErrorApi); + // (undocumented) + static create(options: CreateStorageApiOptions): WebStorage; + // (undocumented) + forBucket(name: string): WebStorage; + // (undocumented) + get(key: string): T | undefined; + // (undocumented) + observe$(key: string): Observable>; + // (undocumented) + remove(key: string): Promise; + // (undocumented) + set(key: string, data: T): Promise; +} // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md new file mode 100644 index 0000000000..3d8e60d4fb --- /dev/null +++ b/packages/core-components/api-report.md @@ -0,0 +1,2411 @@ +## API Report File for "@backstage/core-components" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstageIdentityApi } from '@backstage/core-plugin-api'; +import { Breadcrumbs as Breadcrumbs_2 } from '@material-ui/core'; +import { ButtonProps } from '@material-ui/core'; +import { ButtonTypeMap } from '@material-ui/core'; +import { CardHeaderProps } from '@material-ui/core'; +import { Column } from 'material-table'; +import { CommonProps } from '@material-ui/core/OverridableComponent'; +import { ComponentClass } from 'react'; +import { ComponentProps } from 'react'; +import { ComponentType } from 'react'; +import { Context } from 'react'; +import { default as CSS_2 } from 'csstype'; +import { CSSProperties } from 'react'; +import { default as dagre_2 } from 'dagre'; +import { ElementType } from 'react'; +import { ErrorInfo } from 'react'; +import { IconComponent } from '@backstage/core-plugin-api'; +import { LinearProgressProps } from '@material-ui/core'; +import { LinkProps as LinkProps_2 } from '@material-ui/core'; +import { LinkProps as LinkProps_3 } from 'react-router-dom'; +import { MaterialTableProps } from 'material-table'; +import { NavLinkProps } from 'react-router-dom'; +import { ProfileInfoApi } from '@backstage/core-plugin-api'; +import { PropsWithChildren } from 'react'; +import PropTypes from 'prop-types'; +import { default as React_2 } from 'react'; +import * as React_3 from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { SessionApi } from '@backstage/core-plugin-api'; +import { SignInPageProps } from '@backstage/core-plugin-api'; +import { SparklinesLineProps } from 'react-sparklines'; +import { SparklinesProps } from 'react-sparklines'; +import { StyledComponentProps } from '@material-ui/core'; +import { StyleRules } from '@material-ui/styles'; +import { TabProps } from '@material-ui/core'; +import { TextTruncateProps } from 'react-text-truncate'; +import { Theme } from '@material-ui/core'; +import { TooltipProps } from '@material-ui/core'; +import { WithStyles } from '@material-ui/core'; + +// @public (undocumented) +export const AlertDisplay: () => JSX.Element | null; + +// @public (undocumented) +enum Alignment { + // (undocumented) + DOWN_LEFT = 'DL', + // (undocumented) + DOWN_RIGHT = 'DR', + // (undocumented) + UP_LEFT = 'UL', + // (undocumented) + UP_RIGHT = 'UR', +} + +// @public (undocumented) +export const Avatar: ({ + displayName, + picture, + customStyles, +}: AvatarProps) => JSX.Element; + +// @public (undocumented) +export const Breadcrumbs: ({ children, ...props }: Props_25) => JSX.Element; + +// @public (undocumented) +export const BrokenImageIcon: IconComponent; + +// @public +export const Button: React_2.ForwardRefExoticComponent< + Pick< + Props, + | 'replace' + | 'media' + | 'hidden' + | 'dir' + | 'form' + | 'slot' + | 'title' + | 'disabled' + | 'color' + | 'size' + | 'underline' + | 'display' + | 'translate' + | 'prefix' + | 'children' + | 'key' + | 'value' + | 'id' + | 'name' + | 'action' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'component' + | 'variant' + | 'download' + | 'href' + | 'hrefLang' + | 'ping' + | 'rel' + | 'target' + | 'type' + | 'referrerPolicy' + | 'disableElevation' + | 'fullWidth' + | 'startIcon' + | 'endIcon' + | 'noWrap' + | 'gutterBottom' + | 'paragraph' + | 'autoFocus' + | 'formAction' + | 'formEncType' + | 'formMethod' + | 'formNoValidate' + | 'formTarget' + | 'disableFocusRipple' + | 'buttonRef' + | 'centerRipple' + | 'disableRipple' + | 'disableTouchRipple' + | 'focusRipple' + | 'focusVisibleClassName' + | 'onFocusVisible' + | 'TouchRippleProps' + | 'align' + | 'variantMapping' + | 'to' + | 'state' + | 'TypographyClasses' + | keyof CommonProps> + > & + React_2.RefAttributes +>; + +// @public (undocumented) +export const CardTab: ({ + children, + ...props +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const CatalogIcon: IconComponent; + +// @public (undocumented) +export const ChatIcon: IconComponent; + +// @public (undocumented) +export const CodeSnippet: ({ + text, + language, + showLineNumbers, + showCopyCodeButton, + highlightedNumbers, + customStyle, +}: Props_2) => JSX.Element; + +// @public (undocumented) +export const Content: ({ + className, + stretch, + noPadding, + children, + ...props +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const ContentHeader: ({ + description, + title, + titleComponent: TitleComponent, + children, + textAlign, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const CopyTextButton: { + (props: Props_3): JSX.Element; + propTypes: { + text: PropTypes.Validator; + tooltipDelay: PropTypes.Requireable; + tooltipText: PropTypes.Requireable; + }; +}; + +// @public (undocumented) +export const DashboardIcon: IconComponent; + +// @public (undocumented) +type DependencyEdge = T & { + from: string; + to: string; + label?: string; +}; + +// @public (undocumented) +export function DependencyGraph({ + edges, + nodes, + renderNode, + direction, + align, + nodeMargin, + edgeMargin, + rankMargin, + paddingX, + paddingY, + acyclicer, + ranker, + labelPosition, + labelOffset, + edgeRanks, + edgeWeight, + renderLabel, + defs, + ...svgProps +}: DependencyGraphProps): JSX.Element; + +declare namespace DependencyGraphTypes { + export { + DependencyEdge, + GraphEdge, + RenderLabelProps, + RenderLabelFunction, + DependencyNode, + GraphNode, + RenderNodeProps, + RenderNodeFunction, + EdgeProperties, + Direction, + Alignment, + Ranker, + LabelPosition, + }; +} +export { DependencyGraphTypes }; + +// @public (undocumented) +type DependencyNode = T & { + id: string; +}; + +// @public (undocumented) +enum Direction { + // (undocumented) + BOTTOM_TOP = 'BT', + // (undocumented) + LEFT_RIGHT = 'LR', + // (undocumented) + RIGHT_LEFT = 'RL', + // (undocumented) + TOP_BOTTOM = 'TB', +} + +// @public (undocumented) +export const DismissableBanner: ({ + variant, + message, + id, + fixed, +}: Props_4) => JSX.Element; + +// @public (undocumented) +export const DocsIcon: IconComponent; + +// @public (undocumented) +type EdgeProperties = { + label?: string; + width?: number; + height?: number; + labeloffset?: number; + labelpos?: LabelPosition; + minlen?: number; + weight?: number; + [customKey: string]: any; +}; + +// @public (undocumented) +export const EmailIcon: IconComponent; + +// @public (undocumented) +export const EmptyState: ({ + title, + description, + missing, + action, +}: Props_5) => JSX.Element; + +// @public (undocumented) +export const ErrorBoundary: ComponentClass; + +// @public (undocumented) +export type ErrorBoundaryProps = { + slackChannel?: string | SlackChannel; + onError?: (error: Error, errorInfo: string) => null; +}; + +// @public (undocumented) +export const ErrorPage: ({ + status, + statusMessage, + additionalInfo, +}: IErrorPageProps) => JSX.Element; + +// @public +export const ErrorPanel: ({ + title, + error, + defaultExpanded, + children, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export type ErrorPanelProps = { + error: Error; + defaultExpanded?: boolean; + title?: string; +}; + +// @public (undocumented) +export const FeatureCalloutCircular: ({ + featureId, + title, + description, + children, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const Gauge: (props: Props_14) => JSX.Element; + +// @public (undocumented) +export const GaugeCard: (props: Props_13) => JSX.Element; + +// @public (undocumented) +export const GitHubIcon: IconComponent; + +// @public (undocumented) +type GraphEdge = DependencyEdge & + dagre_2.GraphEdge & + EdgeProperties; + +// @public (undocumented) +type GraphNode = dagre_2.Node>; + +// @public (undocumented) +export const GroupIcon: IconComponent; + +// @public (undocumented) +export const Header: ({ + children, + pageTitleOverride, + style, + subtitle, + title, + tooltip, + type, + typeLink, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const HeaderIconLinkRow: ({ links }: Props_8) => JSX.Element; + +// @public (undocumented) +export const HeaderLabel: ({ + label, + value, + url, +}: HeaderLabelProps) => JSX.Element; + +// @public (undocumented) +export const HeaderTabs: ({ + tabs, + onChange, + selectedIndex, +}: HeaderTabsProps) => JSX.Element; + +// @public (undocumented) +export const HelpIcon: IconComponent; + +// @public (undocumented) +export const HomepageTimer: () => JSX.Element | null; + +// @public (undocumented) +export const HorizontalScrollGrid: ( + props: PropsWithChildren, +) => JSX.Element; + +// @public (undocumented) +export type IconLinkVerticalProps = { + color?: 'primary' | 'secondary'; + disabled?: boolean; + href?: string; + icon?: React_2.ReactNode; + label: string; + onClick?: React_2.MouseEventHandler; + title?: string; +}; + +// @public (undocumented) +export const InfoCard: ({ + title, + subheader, + divider, + deepLink, + slackChannel, + errorBoundaryProps, + variant, + children, + headerStyle, + headerProps, + action, + actionsClassName, + actions, + cardClassName, + actionsTopRight, + className, + noPadding, + titleTypographyProps, +}: Props_20) => JSX.Element; + +// @public (undocumented) +export type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem'; + +// @public (undocumented) +export const IntroCard: (props: IntroCardProps) => JSX.Element; + +// @public @deprecated +export const ItemCard: ({ + description, + tags, + title, + type, + subtitle, + label, + onClick, + href, +}: ItemCardProps) => JSX.Element; + +// @public +export const ItemCardGrid: (props: ItemCardGridProps) => JSX.Element; + +// @public (undocumented) +export type ItemCardGridProps = Partial> & { + children?: React_2.ReactNode; +}; + +// @public +export const ItemCardHeader: (props: ItemCardHeaderProps) => JSX.Element; + +// @public (undocumented) +export type ItemCardHeaderProps = Partial> & { + title?: React_2.ReactNode; + subtitle?: React_2.ReactNode; + children?: React_2.ReactNode; +}; + +// @public (undocumented) +enum LabelPosition { + // (undocumented) + CENTER = 'c', + // (undocumented) + LEFT = 'l', + // (undocumented) + RIGHT = 'r', +} + +// @public (undocumented) +export const Lifecycle: (props: Props_10) => JSX.Element; + +// @public (undocumented) +export const LinearGauge: ({ value }: Props_15) => JSX.Element | null; + +// @public +export const Link: React_2.ForwardRefExoticComponent< + Pick< + LinkProps, + | 'replace' + | 'media' + | 'hidden' + | 'dir' + | 'slot' + | 'style' + | 'title' + | 'color' + | 'underline' + | 'display' + | 'translate' + | 'prefix' + | 'children' + | 'key' + | 'id' + | 'classes' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'component' + | 'variant' + | 'innerRef' + | 'download' + | 'href' + | 'hrefLang' + | 'ping' + | 'rel' + | 'target' + | 'type' + | 'referrerPolicy' + | 'noWrap' + | 'gutterBottom' + | 'paragraph' + | 'align' + | 'variantMapping' + | 'to' + | 'state' + | 'TypographyClasses' + > & + React_2.RefAttributes +>; + +// @public (undocumented) +export type LinkProps = LinkProps_2 & + LinkProps_3 & { + component?: ElementType; + }; + +// @public +export const MarkdownContent: ({ content, dialect }: Props_11) => JSX.Element; + +// @public (undocumented) +export const MissingAnnotationEmptyState: ({ + annotation, +}: Props_6) => JSX.Element; + +// @public (undocumented) +export const OAuthRequestDialog: () => JSX.Element; + +// @public (undocumented) +export const OverflowTooltip: (props: Props_12) => JSX.Element; + +// @public (undocumented) +export const Page: ({ + themeId, + children, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const Progress: ( + props: PropsWithChildren, +) => JSX.Element; + +// @public (undocumented) +enum Ranker { + // (undocumented) + LONGEST_PATH = 'longest-path', + // (undocumented) + NETWORK_SIMPLEX = 'network-simplex', + // (undocumented) + TIGHT_TREE = 'tight-tree', +} + +// @public (undocumented) +type RenderLabelFunction = (props: RenderLabelProps) => React.ReactNode; + +// @public (undocumented) +type RenderLabelProps = { + edge: DependencyEdge; +}; + +// @public (undocumented) +type RenderNodeFunction = (props: RenderNodeProps) => React.ReactNode; + +// @public (undocumented) +type RenderNodeProps = { + node: DependencyNode; +}; + +// @public +export const ResponseErrorPanel: ({ + title, + error, + defaultExpanded, +}: ErrorPanelProps) => JSX.Element; + +// @public (undocumented) +export const RoutedTabs: ({ routes }: { routes: SubRoute_2[] }) => JSX.Element; + +// @public (undocumented) +export const Select: ({ + multiple, + items, + label, + placeholder, + selected, + onChange, + triggerReset, +}: SelectProps) => JSX.Element; + +// @public (undocumented) +export const Sidebar: ({ + openDelayMs, + closeDelayMs, + children, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const SIDEBAR_INTRO_LOCAL_STORAGE = + '@backstage/core/sidebar-intro-dismissed'; + +// @public (undocumented) +export const sidebarConfig: { + drawerWidthClosed: number; + drawerWidthOpen: number; + defaultOpenDelayMs: number; + defaultCloseDelayMs: number; + defaultFadeDuration: number; + logoHeight: number; + iconContainerWidth: number; + iconSize: number; + iconPadding: number; + selectedIndicatorWidth: number; + userBadgePadding: number; + userBadgeDiameter: number; +}; + +// @public (undocumented) +export const SidebarContext: Context; + +// @public (undocumented) +export type SidebarContextType = { + isOpen: boolean; +}; + +// @public (undocumented) +export const SidebarDivider: React_2.ComponentType< + Pick< + React_2.DetailedHTMLProps< + React_2.HTMLAttributes, + HTMLHRElement + >, + | 'hidden' + | 'dir' + | 'slot' + | 'style' + | 'title' + | 'color' + | 'translate' + | 'prefix' + | 'children' + | 'id' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | keyof React_2.ClassAttributes + > & + StyledComponentProps<'root'> & { + className?: string | undefined; + } +>; + +// @public (undocumented) +export const SidebarIntro: () => JSX.Element | null; + +// @public (undocumented) +export const SidebarItem: React_2.ForwardRefExoticComponent< + SidebarItemProps & React_2.RefAttributes +>; + +// @public (undocumented) +export const SidebarPage: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const SidebarPinStateContext: React_2.Context; + +// @public (undocumented) +export type SidebarPinStateContextType = { + isPinned: boolean; + toggleSidebarPinState: () => any; +}; + +// @public (undocumented) +export const SidebarScrollWrapper: React_2.ComponentType< + Pick< + React_2.DetailedHTMLProps< + React_2.HTMLAttributes, + HTMLDivElement + >, + | 'hidden' + | 'dir' + | 'slot' + | 'style' + | 'title' + | 'color' + | 'translate' + | 'prefix' + | 'children' + | 'id' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | keyof React_2.ClassAttributes + > & + StyledComponentProps<'root'> & { + className?: string | undefined; + } +>; + +// @public (undocumented) +export const SidebarSearchField: ( + props: SidebarSearchFieldProps, +) => JSX.Element; + +// @public (undocumented) +export const SidebarSpace: React_2.ComponentType< + Pick< + React_2.DetailedHTMLProps< + React_2.HTMLAttributes, + HTMLDivElement + >, + | 'hidden' + | 'dir' + | 'slot' + | 'style' + | 'title' + | 'color' + | 'translate' + | 'prefix' + | 'children' + | 'id' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | keyof React_2.ClassAttributes + > & + StyledComponentProps<'root'> & { + className?: string | undefined; + } +>; + +// @public (undocumented) +export const SidebarSpacer: React_2.ComponentType< + Pick< + React_2.DetailedHTMLProps< + React_2.HTMLAttributes, + HTMLDivElement + >, + | 'hidden' + | 'dir' + | 'slot' + | 'style' + | 'title' + | 'color' + | 'translate' + | 'prefix' + | 'children' + | 'id' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | keyof React_2.ClassAttributes + > & + StyledComponentProps<'root'> & { + className?: string | undefined; + } +>; + +// @public (undocumented) +export const SignInPage: (props: Props_23) => JSX.Element; + +// @public (undocumented) +export type SignInProviderConfig = { + id: string; + title: string; + message: string; + apiRef: ApiRef; +}; + +// @public (undocumented) +export const SimpleStepper: ({ + children, + elevated, + onStepChange, + activeStep, +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const SimpleStepperStep: ({ + title, + children, + end, + actions, + ...muiProps +}: PropsWithChildren) => JSX.Element; + +// @public (undocumented) +export const StatusAborted: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const StatusError: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const StatusOK: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const StatusPending: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const StatusRunning: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const StatusWarning: (props: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export const StructuredMetadataTable: ({ + metadata, + dense, + options, +}: Props_16) => JSX.Element; + +// @public (undocumented) +export const SubvalueCell: ({ + value, + subvalue, +}: SubvalueCellProps) => JSX.Element; + +// @public (undocumented) +export const SupportButton: ({ + title, + children, +}: SupportButtonProps) => JSX.Element; + +// @public (undocumented) +export type SupportConfig = { + url: string; + items: SupportItem[]; +}; + +// @public (undocumented) +export type SupportItem = { + title: string; + icon?: string; + links: SupportItemLink[]; +}; + +// @public (undocumented) +export type SupportItemLink = { + url: string; + title: string; +}; + +// @public (undocumented) +export type Tab = { + id: string; + label: string; + tabProps?: TabProps< + React_2.ElementType, + { + component?: React_2.ElementType; + } + >; +}; + +// @public (undocumented) +export const TabbedCard: ({ + slackChannel, + errorBoundaryProps, + children, + title, + deepLink, + value, + onChange, +}: PropsWithChildren) => JSX.Element; + +// @public +export const TabbedLayout: { + ({ children }: PropsWithChildren<{}>): JSX.Element; + Route: (props: SubRoute) => null; +}; + +// @public (undocumented) +export function Table({ + columns, + options, + title, + subtitle, + filters, + initialState, + emptyContent, + onStateChange, + ...props +}: TableProps): JSX.Element; + +// @public (undocumented) +export interface TableColumn extends Column { + // (undocumented) + highlight?: boolean; + // (undocumented) + width?: string; +} + +// @public (undocumented) +export type TableFilter = { + column: string; + type: 'select' | 'multiple-select' | 'checkbox-tree'; +}; + +// @public (undocumented) +export interface TableProps + extends MaterialTableProps { + // (undocumented) + columns: TableColumn[]; + // (undocumented) + emptyContent?: ReactNode; + // (undocumented) + filters?: TableFilter[]; + // (undocumented) + initialState?: TableState; + // (undocumented) + onStateChange?: (state: TableState) => any; + // (undocumented) + subtitle?: string; +} + +// @public (undocumented) +export type TableState = { + search?: string; + filtersOpen?: boolean; + filters?: SelectedFilters; +}; + +// @public (undocumented) +export const Tabs: ({ tabs }: TabsProps) => JSX.Element; + +// @public (undocumented) +export const TrendLine: ( + props: SparklinesProps & + Pick & { + title?: string; + }, +) => JSX.Element | null; + +// @public (undocumented) +export function useQueryParamState( + stateName: string, + debounceTime?: number, +): [T | undefined, SetQueryParams]; + +// @public (undocumented) +export const UserIcon: IconComponent; + +// @public (undocumented) +export function useSupportConfig(): SupportConfig; + +// @public (undocumented) +export const WarningIcon: IconComponent; + +// @public +export const WarningPanel: (props: Props_17) => JSX.Element; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 90ea1f5e46..f3cb134fe1 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstageTheme } from '@backstage/theme'; import { ComponentType } from 'react'; @@ -14,8 +15,8 @@ import { SvgIconProps } from '@material-ui/core'; // @public export type AlertApi = { - post(alert: AlertMessage): void; - alert$(): Observable; + post(alert: AlertMessage): void; + alert$(): Observable; }; // @public (undocumented) @@ -23,43 +24,53 @@ export const alertApiRef: ApiRef; // @public (undocumented) export type AlertMessage = { - message: string; - severity?: 'success' | 'info' | 'warning' | 'error'; + message: string; + severity?: 'success' | 'info' | 'warning' | 'error'; }; // @public (undocumented) -export type AnyApiFactory = ApiFactory; + } +>; // @public (undocumented) export type AnyApiRef = ApiRef; // @public (undocumented) -export type ApiFactory = { - api: ApiRef; - deps: TypesToApiRefs; - factory(deps: Deps): Impl; + } +> = { + api: ApiRef; + deps: TypesToApiRefs; + factory(deps: Deps): Impl; }; // @public (undocumented) export type ApiHolder = { - get(api: ApiRef): T | undefined; + get(api: ApiRef): T | undefined; }; // @public (undocumented) export type ApiRef = { - id: string; - T: T; + id: string; + T: T; }; // @public (undocumented) -export type ApiRefsToTypes; -}> = { - [key in keyof T]: ApiRefType; + } +> = { + [key in keyof T]: ApiRefType; }; // @public (undocumented) @@ -67,93 +78,106 @@ export type ApiRefType = T extends ApiRef ? U : never; // @public (undocumented) export type AppComponents = { - NotFoundErrorPage: ComponentType<{}>; - BootErrorPage: ComponentType; - Progress: ComponentType<{}>; - Router: ComponentType<{}>; - ErrorBoundaryFallback: ComponentType; - SignInPage?: ComponentType; + NotFoundErrorPage: ComponentType<{}>; + BootErrorPage: ComponentType; + Progress: ComponentType<{}>; + Router: ComponentType<{}>; + ErrorBoundaryFallback: ComponentType; + SignInPage?: ComponentType; }; // @public (undocumented) export type AppContext = { - getPlugins(): BackstagePlugin[]; - getSystemIcon(key: string): IconComponent | undefined; - getComponents(): AppComponents; + getPlugins(): BackstagePlugin[]; + getSystemIcon(key: string): IconComponent | undefined; + getComponents(): AppComponents; }; // @public export type AppTheme = { - id: string; - title: string; - variant: 'light' | 'dark'; - theme: BackstageTheme; - icon?: React.ReactElement; + id: string; + title: string; + variant: 'light' | 'dark'; + theme: BackstageTheme; + icon?: React.ReactElement; }; // @public export type AppThemeApi = { - getInstalledThemes(): AppTheme[]; - activeThemeId$(): Observable; - getActiveThemeId(): string | undefined; - setActiveThemeId(themeId?: string): void; + getInstalledThemes(): AppTheme[]; + activeThemeId$(): Observable; + getActiveThemeId(): string | undefined; + setActiveThemeId(themeId?: string): void; }; // @public (undocumented) export const appThemeApiRef: ApiRef; // @public (undocumented) -export function attachComponentData

(component: ComponentType

, type: string, data: unknown): void; +export function attachComponentData

( + component: ComponentType

, + type: string, + data: unknown, +): void; // @public -export const auth0AuthApiRef: ApiRef; +export const auth0AuthApiRef: ApiRef< + OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; // @public export type AuthProvider = { - title: string; - icon: IconComponent; + title: string; + icon: IconComponent; }; // @public -export type AuthRequester = (scopes: Set) => Promise; +export type AuthRequester = ( + scopes: Set, +) => Promise; // @public export type AuthRequesterOptions = { - provider: AuthProvider; - onAuthRequest(scopes: Set): Promise; + provider: AuthProvider; + onAuthRequest(scopes: Set): Promise; }; // @public (undocumented) export type AuthRequestOptions = { - optional?: boolean; - instantPopup?: boolean; + optional?: boolean; + instantPopup?: boolean; }; // @public (undocumented) export type BackstageIdentity = { - id: string; - idToken: string; + id: string; + idToken: string; }; // @public export type BackstageIdentityApi = { - getBackstageIdentity(options?: AuthRequestOptions): Promise; + getBackstageIdentity( + options?: AuthRequestOptions, + ): Promise; }; // @public (undocumented) -export type BackstagePlugin = { - getId(): string; - output(): PluginOutput[]; - getApis(): Iterable; - provide(extension: Extension): T; - routes: Routes; - externalRoutes: ExternalRoutes; +export type BackstagePlugin< + Routes extends AnyRoutes = {}, + ExternalRoutes extends AnyExternalRoutes = {} +> = { + getId(): string; + output(): PluginOutput[]; + getApis(): Iterable; + provide(extension: Extension): T; + routes: Routes; + externalRoutes: ExternalRoutes; }; // @public (undocumented) export type BootErrorPageProps = { - step: 'load-config' | 'load-chunk'; - error: Error; + step: 'load-config' | 'load-chunk'; + error: Error; }; // @public @@ -163,66 +187,89 @@ export type ConfigApi = Config; export const configApiRef: ApiRef; // @public -export function createApiFactory(factory: ApiFactory): ApiFactory; + } +>(factory: ApiFactory): ApiFactory; // @public (undocumented) -export function createApiFactory(api: ApiRef, instance: Impl): ApiFactory; +export function createApiFactory( + api: ApiRef, + instance: Impl, +): ApiFactory; // @public (undocumented) export function createApiRef(config: ApiRefConfig): ApiRef; // @public (undocumented) -export function createComponentExtension JSX.Element | null>(options: { - component: ComponentLoader; -}): Extension; +export function createComponentExtension< + T extends (props: any) => JSX.Element | null +>(options: { component: ComponentLoader }): Extension; // @public (undocumented) -export function createExternalRouteRef(options: { - id: string; - params?: ParamKey[]; - optional?: Optional; + }, + Optional extends boolean = false, + ParamKey extends string = never +>(options: { + id: string; + params?: ParamKey[]; + optional?: Optional; }): ExternalRouteRef, Optional>; // @public (undocumented) -export function createPlugin(config: PluginConfig): BackstagePlugin; +export function createPlugin< + Routes extends AnyRoutes = {}, + ExternalRoutes extends AnyExternalRoutes = {} +>( + config: PluginConfig, +): BackstagePlugin; // @public (undocumented) -export function createReactExtension JSX.Element | null>(options: { - component: ComponentLoader; - data?: Record; +export function createReactExtension< + T extends (props: any) => JSX.Element | null +>(options: { + component: ComponentLoader; + data?: Record; }): Extension; // @public (undocumented) -export function createRoutableExtension JSX.Element | null>(options: { - component: () => Promise; - mountPoint: RouteRef; -}): Extension; +export function createRoutableExtension< + T extends (props: any) => JSX.Element | null +>(options: { component: () => Promise; mountPoint: RouteRef }): Extension; // @public (undocumented) -export function createRouteRef(config: { - id?: string; - params?: ParamKey[]; - path?: string; - icon?: OldIconComponent; - title?: string; + }, + ParamKey extends string = never +>(config: { + id?: string; + params?: ParamKey[]; + path?: string; + icon?: OldIconComponent; + title?: string; }): RouteRef>; // @public (undocumented) -export function createSubRouteRef(config: { - id: string; - path: Path; - parent: RouteRef; +export function createSubRouteRef< + Path extends string, + ParentParams extends AnyParams = never +>(config: { + id: string; + path: Path; + parent: RouteRef; }): MakeSubRouteRef, ParentParams>; // @public export type DiscoveryApi = { - getBaseUrl(pluginId: string): Promise; + getBaseUrl(pluginId: string): Promise; }; // @public (undocumented) @@ -230,25 +277,25 @@ export const discoveryApiRef: ApiRef; // @public export interface ElementCollection { - findComponentData(query: { - key: string; - }): T[]; - getElements(): Array>; - selectByComponentData(query: { - key: string; - withStrictError?: string; - }): ElementCollection; + findComponentData(query: { key: string }): T[]; + getElements< + Props extends { + [name: string]: unknown; + } + >(): Array>; + selectByComponentData(query: { + key: string; + withStrictError?: string; + }): ElementCollection; } // @public export type ErrorApi = { - post(error: Error_2, context?: ErrorContext): void; - error$(): Observable<{ - error: Error_2; - context?: ErrorContext; - }>; + post(error: Error_2, context?: ErrorContext): void; + error$(): Observable<{ + error: Error_2; + context?: ErrorContext; + }>; }; // @public (undocumented) @@ -256,46 +303,49 @@ export const errorApiRef: ApiRef; // @public (undocumented) export type ErrorBoundaryFallbackProps = { - plugin?: BackstagePlugin; - error: Error; - resetError: () => void; + plugin?: BackstagePlugin; + error: Error; + resetError: () => void; }; // @public export type ErrorContext = { - hidden?: boolean; + hidden?: boolean; }; // @public (undocumented) export type Extension = { - expose(plugin: BackstagePlugin): T; + expose(plugin: BackstagePlugin): T; }; // @public (undocumented) -export type ExternalRouteRef = { - readonly [routeRefType]: 'external'; - params: ParamKeys; - optional?: Optional; +export type ExternalRouteRef< + Params extends AnyParams = any, + Optional extends boolean = any +> = { + readonly [routeRefType]: 'external'; + params: ParamKeys; + optional?: Optional; }; // @public export type FeatureFlag = { - name: string; - pluginId: string; + name: string; + pluginId: string; }; // @public (undocumented) export type FeatureFlagOutput = { - type: 'feature-flag'; - name: string; + type: 'feature-flag'; + name: string; }; // @public (undocumented) export interface FeatureFlagsApi { - getRegisteredFlags(): FeatureFlag[]; - isActive(name: string): boolean; - registerFlag(flag: FeatureFlag): void; - save(options: FeatureFlagsSaveOptions): void; + getRegisteredFlags(): FeatureFlag[]; + isActive(name: string): boolean; + registerFlag(flag: FeatureFlag): void; + save(options: FeatureFlagsSaveOptions): void; } // @public (undocumented) @@ -303,66 +353,96 @@ export const featureFlagsApiRef: ApiRef; // @public (undocumented) export type FeatureFlagsHooks = { - register(name: string): void; + register(name: string): void; }; // @public export type FeatureFlagsSaveOptions = { - states: Record; - merge?: boolean; + states: Record; + merge?: boolean; }; // @public (undocumented) export enum FeatureFlagState { - // (undocumented) - Active = 1, - // (undocumented) - None = 0 + // (undocumented) + Active = 1, + // (undocumented) + None = 0, } // @public (undocumented) -export function getComponentData(node: ReactNode, type: string): T | undefined; +export function getComponentData( + node: ReactNode, + type: string, +): T | undefined; // @public -export const githubAuthApiRef: ApiRef; +export const githubAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; // @public -export const gitlabAuthApiRef: ApiRef; +export const gitlabAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; // @public -export const googleAuthApiRef: ApiRef; +export const googleAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public export type IconComponent = ComponentType<{ - fontSize?: 'default' | 'small' | 'large'; + fontSize?: 'default' | 'small' | 'large'; }>; // @public export type IdentityApi = { - getUserId(): string; - getProfile(): ProfileInfo; - getIdToken(): Promise; - signOut(): Promise; + getUserId(): string; + getProfile(): ProfileInfo; + getIdToken(): Promise; + signOut(): Promise; }; // @public (undocumented) export const identityApiRef: ApiRef; // @public -export const microsoftAuthApiRef: ApiRef; +export const microsoftAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public -export const oauth2ApiRef: ApiRef; +export const oauth2ApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public export type OAuthApi = { - getAccessToken(scope?: OAuthScope, options?: AuthRequestOptions): Promise; + getAccessToken( + scope?: OAuthScope, + options?: AuthRequestOptions, + ): Promise; }; // @public export type OAuthRequestApi = { - createAuthRequester(options: AuthRequesterOptions): AuthRequester; - authRequest$(): Observable; + createAuthRequester( + options: AuthRequesterOptions, + ): AuthRequester; + authRequest$(): Observable; }; // @public (undocumented) @@ -373,51 +453,76 @@ export type OAuthScope = string | string[]; // @public export type Observable = { - [Symbol.observable](): Observable; - subscribe(observer: Observer): Subscription; - subscribe(onNext?: (value: T) => void, onError?: (error: Error) => void, onComplete?: () => void): Subscription; + [Symbol.observable](): Observable; + subscribe(observer: Observer): Subscription; + subscribe( + onNext?: (value: T) => void, + onError?: (error: Error) => void, + onComplete?: () => void, + ): Subscription; }; // @public export type Observer = { - next?(value: T): void; - error?(error: Error): void; - complete?(): void; + next?(value: T): void; + error?(error: Error): void; + complete?(): void; }; // @public -export const oidcAuthApiRef: ApiRef; +export const oidcAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public -export const oktaAuthApiRef: ApiRef; +export const oktaAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public (undocumented) -export const oneloginAuthApiRef: ApiRef; +export const oneloginAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public export type OpenIdConnectApi = { - getIdToken(options?: AuthRequestOptions): Promise; + getIdToken(options?: AuthRequestOptions): Promise; }; // @public export type PendingAuthRequest = { - provider: AuthProvider; - reject: () => void; - trigger(): Promise; + provider: AuthProvider; + reject: () => void; + trigger(): Promise; }; // @public (undocumented) -export type PluginConfig = { - id: string; - apis?: Iterable; - register?(hooks: PluginHooks): void; - routes?: Routes; - externalRoutes?: ExternalRoutes; +export type PluginConfig< + Routes extends AnyRoutes, + ExternalRoutes extends AnyExternalRoutes +> = { + id: string; + apis?: Iterable; + register?(hooks: PluginHooks): void; + routes?: Routes; + externalRoutes?: ExternalRoutes; }; // @public (undocumented) export type PluginHooks = { - featureFlags: FeatureFlagsHooks; + featureFlags: FeatureFlagsHooks; }; // @public (undocumented) @@ -425,19 +530,19 @@ export type PluginOutput = FeatureFlagOutput; // @public export type ProfileInfo = { - email?: string; - displayName?: string; - picture?: string; + email?: string; + displayName?: string; + picture?: string; }; // @public export type ProfileInfoApi = { - getProfile(options?: AuthRequestOptions): Promise; + getProfile(options?: AuthRequestOptions): Promise; }; // @public (undocumented) export type RouteOptions = { - exact?: boolean; + exact?: boolean; }; // @public (undocumented) @@ -445,51 +550,53 @@ export type RoutePath = string; // @public (undocumented) export type RouteRef = { - readonly [routeRefType]: 'absolute'; - params: ParamKeys; - path: string; - icon?: OldIconComponent; - title?: string; + readonly [routeRefType]: 'absolute'; + params: ParamKeys; + path: string; + icon?: OldIconComponent; + title?: string; }; // @public -export const samlAuthApiRef: ApiRef; +export const samlAuthApiRef: ApiRef< + ProfileInfoApi & BackstageIdentityApi & SessionApi +>; // @public export type SessionApi = { - signIn(): Promise; - signOut(): Promise; - sessionState$(): Observable; + signIn(): Promise; + signOut(): Promise; + sessionState$(): Observable; }; // @public export enum SessionState { - // (undocumented) - SignedIn = "SignedIn", - // (undocumented) - SignedOut = "SignedOut" + // (undocumented) + SignedIn = 'SignedIn', + // (undocumented) + SignedOut = 'SignedOut', } // @public (undocumented) export type SignInPageProps = { - onResult(result: SignInResult): void; + onResult(result: SignInResult): void; }; // @public (undocumented) export type SignInResult = { - userId: string; - profile: ProfileInfo; - getIdToken?: () => Promise; - signOut?: () => Promise; + userId: string; + profile: ProfileInfo; + getIdToken?: () => Promise; + signOut?: () => Promise; }; // @public (undocumented) export interface StorageApi { - forBucket(name: string): StorageApi; - get(key: string): T | undefined; - observe$(key: string): Observable>; - remove(key: string): Promise; - set(key: string, data: any): Promise; + forBucket(name: string): StorageApi; + get(key: string): T | undefined; + observe$(key: string): Observable>; + remove(key: string): Promise; + set(key: string, data: any): Promise; } // @public (undocumented) @@ -497,27 +604,27 @@ export const storageApiRef: ApiRef; // @public (undocumented) export type StorageValueChange = { - key: string; - newValue?: T; + key: string; + newValue?: T; }; // @public (undocumented) export type SubRouteRef = { - readonly [routeRefType]: 'sub'; - parent: RouteRef; - path: string; - params: ParamKeys; + readonly [routeRefType]: 'sub'; + parent: RouteRef; + path: string; + params: ParamKeys; }; // @public export type Subscription = { - unsubscribe(): void; - readonly closed: boolean; + unsubscribe(): void; + readonly closed: boolean; }; // @public (undocumented) export type TypesToApiRefs = { - [key in keyof T]: ApiRef; + [key in keyof T]: ApiRef; }; // @public (undocumented) @@ -530,27 +637,39 @@ export function useApiHolder(): ApiHolder; export const useApp: () => AppContext; // @public -export function useElementFilter(node: ReactNode, filterFn: (arg: ElementCollection) => T, dependencies?: any[]): T; +export function useElementFilter( + node: ReactNode, + filterFn: (arg: ElementCollection) => T, + dependencies?: any[], +): T; // @public (undocumented) export type UserFlags = {}; // @public (undocumented) -export function useRouteRef(routeRef: ExternalRouteRef): Optional extends true ? RouteFunc | undefined : RouteFunc; +export function useRouteRef( + routeRef: ExternalRouteRef, +): Optional extends true ? RouteFunc | undefined : RouteFunc; // @public (undocumented) -export function useRouteRef(routeRef: RouteRef | SubRouteRef): RouteFunc; +export function useRouteRef( + routeRef: RouteRef | SubRouteRef, +): RouteFunc; // @public (undocumented) -export function useRouteRefParams(_routeRef: RouteRef | SubRouteRef): Params; +export function useRouteRefParams( + _routeRef: RouteRef | SubRouteRef, +): Params; // @public (undocumented) -export function withApis(apis: TypesToApiRefs):

(WrappedComponent: React_2.ComponentType

) => { - (props: React_2.PropsWithChildren>): JSX.Element; - displayName: string; +export function withApis( + apis: TypesToApiRefs, +):

( + WrappedComponent: React_2.ComponentType

, +) => { + (props: React_2.PropsWithChildren>): JSX.Element; + displayName: string; }; - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/create-app/package.json b/packages/create-app/package.json index b961f0ae39..b3f587ac32 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -30,7 +30,7 @@ "@backstage/cli-common": "^0.1.2", "chalk": "^4.0.0", "commander": "^6.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "handlebars": "^4.7.3", "inquirer": "^7.0.4", "ora": "^5.3.0", diff --git a/packages/dev-utils/api-report.md b/packages/dev-utils/api-report.md index d3852b1c95..18bee415ff 100644 --- a/packages/dev-utils/api-report.md +++ b/packages/dev-utils/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiFactory } from '@backstage/core-plugin-api'; import { ComponentType } from 'react'; @@ -16,11 +17,13 @@ import { ReactNode } from 'react'; export function createDevApp(): DevAppBuilder; // @public (undocumented) -export const EntityGridItem: ({ entity, classes, ...rest }: Omit, "container" | "item"> & { - entity: Entity; +export const EntityGridItem: ({ + entity, + classes, + ...rest +}: Omit, 'container' | 'item'> & { + entity: Entity; }) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/docgen/package.json b/packages/docgen/package.json index d6670bcf83..ad47991159 100644 --- a/packages/docgen/package.json +++ b/packages/docgen/package.json @@ -28,7 +28,7 @@ "dependencies": { "chalk": "^4.0.0", "commander": "^6.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "github-slugger": "^1.3.0", "ts-node": "^10.0.0", "typescript": "^4.0.3" diff --git a/packages/e2e-test/package.json b/packages/e2e-test/package.json index b4e61a7cc1..900fbba136 100644 --- a/packages/e2e-test/package.json +++ b/packages/e2e-test/package.json @@ -30,7 +30,7 @@ "chalk": "^4.0.0", "commander": "^6.1.0", "cross-fetch": "^3.0.6", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "handlebars": "^4.7.3", "pgtools": "^0.3.0", "tree-kill": "^1.2.2", diff --git a/packages/errors/api-report.md b/packages/errors/api-report.md index cb24cba80f..019b6dd387 100644 --- a/packages/errors/api-report.md +++ b/packages/errors/api-report.md @@ -3,86 +3,82 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { JsonObject } from '@backstage/config'; // @public -export class AuthenticationError extends CustomErrorBase { -} +export class AuthenticationError extends CustomErrorBase {} // @public -export class ConflictError extends CustomErrorBase { -} +export class ConflictError extends CustomErrorBase {} // @public (undocumented) export class CustomErrorBase extends Error { - constructor(message?: string, cause?: Error); - // (undocumented) - readonly cause?: Error; + constructor(message?: string, cause?: Error); + // (undocumented) + readonly cause?: Error; } // @public -export function deserializeError(data: SerializedError): T; +export function deserializeError( + data: SerializedError, +): T; // @public export type ErrorResponse = { - error: SerializedError; - request?: { - method: string; - url: string; - }; - response: { - statusCode: number; - }; + error: SerializedError; + request?: { + method: string; + url: string; + }; + response: { + statusCode: number; + }; }; // @public -export class InputError extends CustomErrorBase { -} +export class InputError extends CustomErrorBase {} // @public -export class NotAllowedError extends CustomErrorBase { -} +export class NotAllowedError extends CustomErrorBase {} // @public -export class NotFoundError extends CustomErrorBase { -} +export class NotFoundError extends CustomErrorBase {} // @public -export class NotModifiedError extends CustomErrorBase { -} +export class NotModifiedError extends CustomErrorBase {} // @public export function parseErrorResponse(response: Response): Promise; // @public export class ResponseError extends Error { - constructor(props: { - message: string; - response: Response; - data: ErrorResponse; - cause: Error; - }); - readonly cause: Error; - readonly data: ErrorResponse; - static fromResponse(response: Response): Promise; - readonly response: Response; + constructor(props: { + message: string; + response: Response; + data: ErrorResponse; + cause: Error; + }); + readonly cause: Error; + readonly data: ErrorResponse; + static fromResponse(response: Response): Promise; + readonly response: Response; } // @public export type SerializedError = JsonObject & { - name: string; - message: string; - stack?: string; - code?: string; + name: string; + message: string; + stack?: string; + code?: string; }; // @public -export function serializeError(error: Error, options?: { +export function serializeError( + error: Error, + options?: { includeStack?: boolean; -}): SerializedError; - + }, +): SerializedError; // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/integration-react/api-report.md b/packages/integration-react/api-report.md index fee08efe6f..e2574196e0 100644 --- a/packages/integration-react/api-report.md +++ b/packages/integration-react/api-report.md @@ -3,26 +3,27 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { Config } from '@backstage/config'; import { ScmIntegrationRegistry } from '@backstage/integration'; // @public (undocumented) -export const ScmIntegrationIcon: ({ type }: { - type?: string | undefined; +export const ScmIntegrationIcon: ({ + type, +}: { + type?: string | undefined; }) => JSX.Element; // @public (undocumented) export class ScmIntegrationsApi { - // (undocumented) - static fromConfig(config: Config): ScmIntegrationRegistry; + // (undocumented) + static fromConfig(config: Config): ScmIntegrationRegistry; } // @public (undocumented) export const scmIntegrationsApiRef: ApiRef; - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/integration/api-report.md b/packages/integration/api-report.md index afd048cb13..fb06ca0de6 100644 --- a/packages/integration/api-report.md +++ b/packages/integration/api-report.md @@ -3,72 +3,71 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import { RestEndpointMethodTypes } from '@octokit/rest'; // @public (undocumented) export class AzureIntegration implements ScmIntegration { - constructor(integrationConfig: AzureIntegrationConfig); - // (undocumented) - get config(): AzureIntegrationConfig; - // (undocumented) - static factory: ScmIntegrationsFactory; - // (undocumented) - resolveEditUrl(url: string): string; - // (undocumented) - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; - // (undocumented) - get title(): string; - // (undocumented) - get type(): string; + constructor(integrationConfig: AzureIntegrationConfig); + // (undocumented) + get config(): AzureIntegrationConfig; + // (undocumented) + static factory: ScmIntegrationsFactory; + // (undocumented) + resolveEditUrl(url: string): string; + // (undocumented) + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; + // (undocumented) + get title(): string; + // (undocumented) + get type(): string; } // @public export type AzureIntegrationConfig = { - host: string; - token?: string; + host: string; + token?: string; }; // @public (undocumented) export class BitbucketIntegration implements ScmIntegration { - constructor(integrationConfig: BitbucketIntegrationConfig); - // (undocumented) - get config(): BitbucketIntegrationConfig; - // (undocumented) - static factory: ScmIntegrationsFactory; - // (undocumented) - resolveEditUrl(url: string): string; - // (undocumented) - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; - // (undocumented) - get title(): string; - // (undocumented) - get type(): string; + constructor(integrationConfig: BitbucketIntegrationConfig); + // (undocumented) + get config(): BitbucketIntegrationConfig; + // (undocumented) + static factory: ScmIntegrationsFactory; + // (undocumented) + resolveEditUrl(url: string): string; + // (undocumented) + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; + // (undocumented) + get title(): string; + // (undocumented) + get type(): string; } // @public export type BitbucketIntegrationConfig = { - host: string; - apiBaseUrl?: string; - token?: string; - username?: string; - appPassword?: string; + host: string; + apiBaseUrl?: string; + token?: string; + username?: string; + appPassword?: string; }; // @public export function defaultScmResolveUrl(options: { - url: string; - base: string; - lineNumber?: number; + url: string; + base: string; + lineNumber?: number; }): string; // @public @@ -81,212 +80,253 @@ export function getAzureDownloadUrl(url: string): string; export function getAzureFileFetchUrl(url: string): string; // @public -export function getAzureRequestOptions(config: AzureIntegrationConfig, additionalHeaders?: Record): RequestInit; +export function getAzureRequestOptions( + config: AzureIntegrationConfig, + additionalHeaders?: Record, +): RequestInit; // @public -export function getBitbucketDefaultBranch(url: string, config: BitbucketIntegrationConfig): Promise; +export function getBitbucketDefaultBranch( + url: string, + config: BitbucketIntegrationConfig, +): Promise; // @public -export function getBitbucketDownloadUrl(url: string, config: BitbucketIntegrationConfig): Promise; +export function getBitbucketDownloadUrl( + url: string, + config: BitbucketIntegrationConfig, +): Promise; // @public -export function getBitbucketFileFetchUrl(url: string, config: BitbucketIntegrationConfig): string; +export function getBitbucketFileFetchUrl( + url: string, + config: BitbucketIntegrationConfig, +): string; // @public -export function getBitbucketRequestOptions(config: BitbucketIntegrationConfig): RequestInit; +export function getBitbucketRequestOptions( + config: BitbucketIntegrationConfig, +): RequestInit; // @public -export function getGitHubFileFetchUrl(url: string, config: GitHubIntegrationConfig): string; +export function getGitHubFileFetchUrl( + url: string, + config: GitHubIntegrationConfig, +): string; // @public -export function getGitHubRequestOptions(config: GitHubIntegrationConfig): RequestInit; +export function getGitHubRequestOptions( + config: GitHubIntegrationConfig, +): RequestInit; // @public -export function getGitLabFileFetchUrl(url: string, config: GitLabIntegrationConfig): Promise; +export function getGitLabFileFetchUrl( + url: string, + config: GitLabIntegrationConfig, +): Promise; // @public -export function getGitLabRequestOptions(config: GitLabIntegrationConfig): RequestInit; +export function getGitLabRequestOptions( + config: GitLabIntegrationConfig, +): RequestInit; // @public (undocumented) export class GithubAppCredentialsMux { - constructor(config: GitHubIntegrationConfig); - // (undocumented) - getAllInstallations(): Promise; - // (undocumented) - getAppToken(owner: string, repo?: string): Promise; + constructor(config: GitHubIntegrationConfig); + // (undocumented) + getAllInstallations(): Promise< + RestEndpointMethodTypes['apps']['listInstallations']['response']['data'] + >; + // (undocumented) + getAppToken(owner: string, repo?: string): Promise; } // @public (undocumented) export class GithubCredentialsProvider { - // (undocumented) - static create(config: GitHubIntegrationConfig): GithubCredentialsProvider; - getCredentials(opts: { - url: string; - }): Promise; - } + // (undocumented) + static create(config: GitHubIntegrationConfig): GithubCredentialsProvider; + getCredentials(opts: { url: string }): Promise; +} // @public (undocumented) export type GithubCredentialType = 'app' | 'token'; // @public (undocumented) export class GitHubIntegration implements ScmIntegration { - constructor(integrationConfig: GitHubIntegrationConfig); - // (undocumented) - get config(): GitHubIntegrationConfig; - // (undocumented) - static factory: ScmIntegrationsFactory; - // (undocumented) - resolveEditUrl(url: string): string; - // (undocumented) - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; - // (undocumented) - get title(): string; - // (undocumented) - get type(): string; + constructor(integrationConfig: GitHubIntegrationConfig); + // (undocumented) + get config(): GitHubIntegrationConfig; + // (undocumented) + static factory: ScmIntegrationsFactory; + // (undocumented) + resolveEditUrl(url: string): string; + // (undocumented) + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; + // (undocumented) + get title(): string; + // (undocumented) + get type(): string; } // @public export type GitHubIntegrationConfig = { - host: string; - apiBaseUrl?: string; - rawBaseUrl?: string; - token?: string; - apps?: GithubAppConfig[]; + host: string; + apiBaseUrl?: string; + rawBaseUrl?: string; + token?: string; + apps?: GithubAppConfig[]; }; // @public (undocumented) export class GitLabIntegration implements ScmIntegration { - constructor(integrationConfig: GitLabIntegrationConfig); - // (undocumented) - get config(): GitLabIntegrationConfig; - // (undocumented) - static factory: ScmIntegrationsFactory; - // (undocumented) - resolveEditUrl(url: string): string; - // (undocumented) - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; - // (undocumented) - get title(): string; - // (undocumented) - get type(): string; + constructor(integrationConfig: GitLabIntegrationConfig); + // (undocumented) + get config(): GitLabIntegrationConfig; + // (undocumented) + static factory: ScmIntegrationsFactory; + // (undocumented) + resolveEditUrl(url: string): string; + // (undocumented) + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; + // (undocumented) + get title(): string; + // (undocumented) + get type(): string; } // @public export type GitLabIntegrationConfig = { - host: string; - apiBaseUrl: string; - token?: string; - baseUrl: string; + host: string; + apiBaseUrl: string; + token?: string; + baseUrl: string; }; // @public export type GoogleGcsIntegrationConfig = { - clientEmail?: string; - privateKey?: string; + clientEmail?: string; + privateKey?: string; }; // @public -export function readAzureIntegrationConfig(config: Config): AzureIntegrationConfig; +export function readAzureIntegrationConfig( + config: Config, +): AzureIntegrationConfig; // @public -export function readAzureIntegrationConfigs(configs: Config[]): AzureIntegrationConfig[]; +export function readAzureIntegrationConfigs( + configs: Config[], +): AzureIntegrationConfig[]; // @public -export function readBitbucketIntegrationConfig(config: Config): BitbucketIntegrationConfig; +export function readBitbucketIntegrationConfig( + config: Config, +): BitbucketIntegrationConfig; // @public -export function readBitbucketIntegrationConfigs(configs: Config[]): BitbucketIntegrationConfig[]; +export function readBitbucketIntegrationConfigs( + configs: Config[], +): BitbucketIntegrationConfig[]; // @public -export function readGitHubIntegrationConfig(config: Config): GitHubIntegrationConfig; +export function readGitHubIntegrationConfig( + config: Config, +): GitHubIntegrationConfig; // @public -export function readGitHubIntegrationConfigs(configs: Config[]): GitHubIntegrationConfig[]; +export function readGitHubIntegrationConfigs( + configs: Config[], +): GitHubIntegrationConfig[]; // @public -export function readGitLabIntegrationConfig(config: Config): GitLabIntegrationConfig; +export function readGitLabIntegrationConfig( + config: Config, +): GitLabIntegrationConfig; // @public -export function readGitLabIntegrationConfigs(configs: Config[]): GitLabIntegrationConfig[]; +export function readGitLabIntegrationConfigs( + configs: Config[], +): GitLabIntegrationConfig[]; // @public -export function readGoogleGcsIntegrationConfig(config: Config): GoogleGcsIntegrationConfig; +export function readGoogleGcsIntegrationConfig( + config: Config, +): GoogleGcsIntegrationConfig; // @public export interface ScmIntegration { - resolveEditUrl(url: string): string; - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; - title: string; - type: string; + resolveEditUrl(url: string): string; + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; + title: string; + type: string; } // @public -export interface ScmIntegrationRegistry extends ScmIntegrationsGroup { - // (undocumented) - azure: ScmIntegrationsGroup; - // (undocumented) - bitbucket: ScmIntegrationsGroup; - // (undocumented) - github: ScmIntegrationsGroup; - // (undocumented) - gitlab: ScmIntegrationsGroup; - resolveEditUrl(url: string): string; - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; +export interface ScmIntegrationRegistry + extends ScmIntegrationsGroup { + // (undocumented) + azure: ScmIntegrationsGroup; + // (undocumented) + bitbucket: ScmIntegrationsGroup; + // (undocumented) + github: ScmIntegrationsGroup; + // (undocumented) + gitlab: ScmIntegrationsGroup; + resolveEditUrl(url: string): string; + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; } // @public (undocumented) export class ScmIntegrations implements ScmIntegrationRegistry { - constructor(integrationsByType: IntegrationsByType); - // (undocumented) - get azure(): ScmIntegrationsGroup; - // (undocumented) - get bitbucket(): ScmIntegrationsGroup; - // (undocumented) - byHost(host: string): ScmIntegration | undefined; - // (undocumented) - byUrl(url: string | URL): ScmIntegration | undefined; - // (undocumented) - static fromConfig(config: Config): ScmIntegrations; - // (undocumented) - get github(): ScmIntegrationsGroup; - // (undocumented) - get gitlab(): ScmIntegrationsGroup; - // (undocumented) - list(): ScmIntegration[]; - // (undocumented) - resolveEditUrl(url: string): string; - // (undocumented) - resolveUrl(options: { - url: string; - base: string; - lineNumber?: number; - }): string; + constructor(integrationsByType: IntegrationsByType); + // (undocumented) + get azure(): ScmIntegrationsGroup; + // (undocumented) + get bitbucket(): ScmIntegrationsGroup; + // (undocumented) + byHost(host: string): ScmIntegration | undefined; + // (undocumented) + byUrl(url: string | URL): ScmIntegration | undefined; + // (undocumented) + static fromConfig(config: Config): ScmIntegrations; + // (undocumented) + get github(): ScmIntegrationsGroup; + // (undocumented) + get gitlab(): ScmIntegrationsGroup; + // (undocumented) + list(): ScmIntegration[]; + // (undocumented) + resolveEditUrl(url: string): string; + // (undocumented) + resolveUrl(options: { + url: string; + base: string; + lineNumber?: number; + }): string; } // @public export interface ScmIntegrationsGroup { - byHost(host: string): T | undefined; - byUrl(url: string | URL): T | undefined; - list(): T[]; + byHost(host: string): T | undefined; + byUrl(url: string | URL): T | undefined; + list(): T[]; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/search-common/api-report.md b/packages/search-common/api-report.md index a3de27b5a9..0ba995f673 100644 --- a/packages/search-common/api-report.md +++ b/packages/search-common/api-report.md @@ -3,57 +3,54 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { JsonObject } from '@backstage/config'; // @public export interface DocumentCollator { - // (undocumented) - execute(): Promise; - readonly type: string; + // (undocumented) + execute(): Promise; + readonly type: string; } // @public export interface DocumentDecorator { - // (undocumented) - execute(documents: IndexableDocument[]): Promise; - readonly types?: string[]; + // (undocumented) + execute(documents: IndexableDocument[]): Promise; + readonly types?: string[]; } // @public export interface IndexableDocument { - location: string; - text: string; - title: string; + location: string; + text: string; + title: string; } // @public (undocumented) export interface SearchQuery { - // (undocumented) - filters?: JsonObject; - // (undocumented) - pageCursor: string; - // (undocumented) - term: string; - // (undocumented) - types?: string[]; + // (undocumented) + filters?: JsonObject; + // (undocumented) + pageCursor: string; + // (undocumented) + term: string; + // (undocumented) + types?: string[]; } // @public (undocumented) export interface SearchResult { - // (undocumented) - document: IndexableDocument; - // (undocumented) - type: string; + // (undocumented) + document: IndexableDocument; + // (undocumented) + type: string; } // @public (undocumented) export interface SearchResultSet { - // (undocumented) - results: SearchResult[]; + // (undocumented) + results: SearchResult[]; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/techdocs-common/api-report.md b/packages/techdocs-common/api-report.md index d25f55bf3a..8cca624e11 100644 --- a/packages/techdocs-common/api-report.md +++ b/packages/techdocs-common/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { AzureIntegrationConfig } from '@backstage/integration'; import { Config } from '@backstage/config'; @@ -18,166 +19,239 @@ import { UrlReader } from '@backstage/backend-common'; import { Writable } from 'stream'; // @public (undocumented) -export const checkoutGitRepository: (repoUrl: string, config: Config, logger: Logger_2) => Promise; +export const checkoutGitRepository: ( + repoUrl: string, + config: Config, + logger: Logger_2, +) => Promise; // @public (undocumented) export class CommonGitPreparer implements PreparerBase { - constructor(config: Config, logger: Logger_2); - // (undocumented) - prepare(entity: Entity, options?: { - etag?: string; - }): Promise; + constructor(config: Config, logger: Logger_2); + // (undocumented) + prepare( + entity: Entity, + options?: { + etag?: string; + }, + ): Promise; } // @public (undocumented) export class DirectoryPreparer implements PreparerBase { - constructor(config: Config, logger: Logger_2, reader: UrlReader); - // (undocumented) - prepare(entity: Entity): Promise; - } + constructor(config: Config, logger: Logger_2, reader: UrlReader); + // (undocumented) + prepare(entity: Entity): Promise; +} // @public (undocumented) export type GeneratorBase = { - run(opts: GeneratorRunOptions): Promise; + run(opts: GeneratorRunOptions): Promise; }; // @public export type GeneratorBuilder = { - register(protocol: SupportedGeneratorKey, generator: GeneratorBase): void; - get(entity: Entity): GeneratorBase; + register(protocol: SupportedGeneratorKey, generator: GeneratorBase): void; + get(entity: Entity): GeneratorBase; }; // @public (undocumented) export class Generators implements GeneratorBuilder { - // (undocumented) - static fromConfig(config: Config, { logger, containerRunner, }: { - logger: Logger_2; - containerRunner: ContainerRunner; - }): Promise; - // (undocumented) - get(entity: Entity): GeneratorBase; - // (undocumented) - register(generatorKey: SupportedGeneratorKey, generator: GeneratorBase): void; + // (undocumented) + static fromConfig( + config: Config, + { + logger, + containerRunner, + }: { + logger: Logger_2; + containerRunner: ContainerRunner; + }, + ): Promise; + // (undocumented) + get(entity: Entity): GeneratorBase; + // (undocumented) + register(generatorKey: SupportedGeneratorKey, generator: GeneratorBase): void; } // @public (undocumented) -export const getAzureIntegrationConfig: (config: Config, host: string) => AzureIntegrationConfig; +export const getAzureIntegrationConfig: ( + config: Config, + host: string, +) => AzureIntegrationConfig; // @public (undocumented) -export const getDefaultBranch: (repositoryUrl: string, config: Config) => Promise; +export const getDefaultBranch: ( + repositoryUrl: string, + config: Config, +) => Promise; // @public (undocumented) -export const getDocFilesFromRepository: (reader: UrlReader, entity: Entity, opts?: { - etag?: string | undefined; - logger?: Logger_2 | undefined; -} | undefined) => Promise; +export const getDocFilesFromRepository: ( + reader: UrlReader, + entity: Entity, + opts?: + | { + etag?: string | undefined; + logger?: Logger_2 | undefined; + } + | undefined, +) => Promise; // @public (undocumented) export function getGitHost(url: string): string; // @public (undocumented) -export const getGitHubIntegrationConfig: (config: Config, host: string) => GitHubIntegrationConfig; +export const getGitHubIntegrationConfig: ( + config: Config, + host: string, +) => GitHubIntegrationConfig; // @public (undocumented) -export const getGitLabIntegrationConfig: (config: Config, host: string) => GitLabIntegrationConfig; +export const getGitLabIntegrationConfig: ( + config: Config, + host: string, +) => GitLabIntegrationConfig; // @public (undocumented) -export const getGitRepositoryTempFolder: (repositoryUrl: string, config: Config) => Promise; +export const getGitRepositoryTempFolder: ( + repositoryUrl: string, + config: Config, +) => Promise; // @public (undocumented) export function getGitRepoType(url: string): string; // @public (undocumented) -export const getLastCommitTimestamp: (repositoryLocation: string, logger: Logger_2) => Promise; +export const getLastCommitTimestamp: ( + repositoryLocation: string, + logger: Logger_2, +) => Promise; // @public (undocumented) export const getLocationForEntity: (entity: Entity) => ParsedLocationAnnotation; // @public (undocumented) -export const getTokenForGitRepo: (repositoryUrl: string, config: Config) => Promise; +export const getTokenForGitRepo: ( + repositoryUrl: string, + config: Config, +) => Promise; // @public (undocumented) export type ParsedLocationAnnotation = { - type: RemoteProtocol; - target: string; + type: RemoteProtocol; + target: string; }; // @public (undocumented) -export const parseReferenceAnnotation: (annotationName: string, entity: Entity) => ParsedLocationAnnotation; +export const parseReferenceAnnotation: ( + annotationName: string, + entity: Entity, +) => ParsedLocationAnnotation; // @public (undocumented) export type PreparerBase = { - prepare(entity: Entity, options?: { - logger?: Logger_2; - etag?: string; - }): Promise; + prepare( + entity: Entity, + options?: { + logger?: Logger_2; + etag?: string; + }, + ): Promise; }; // @public (undocumented) export type PreparerBuilder = { - register(protocol: RemoteProtocol, preparer: PreparerBase): void; - get(entity: Entity): PreparerBase; + register(protocol: RemoteProtocol, preparer: PreparerBase): void; + get(entity: Entity): PreparerBase; }; // @public (undocumented) export class Preparers implements PreparerBuilder { - // (undocumented) - static fromConfig(config: Config, { logger, reader }: factoryOptions): Promise; - // (undocumented) - get(entity: Entity): PreparerBase; - // (undocumented) - register(protocol: RemoteProtocol, preparer: PreparerBase): void; + // (undocumented) + static fromConfig( + config: Config, + { logger, reader }: factoryOptions, + ): Promise; + // (undocumented) + get(entity: Entity): PreparerBase; + // (undocumented) + register(protocol: RemoteProtocol, preparer: PreparerBase): void; } // @public export class Publisher { - // (undocumented) - static fromConfig(config: Config, { logger, discovery }: factoryOptions_2): Promise; + // (undocumented) + static fromConfig( + config: Config, + { logger, discovery }: factoryOptions_2, + ): Promise; } // @public export interface PublisherBase { - docsRouter(): express.Handler; - fetchTechDocsMetadata(entityName: EntityName): Promise; - getReadiness(): Promise; - hasDocsBeenGenerated(entityName: Entity): Promise; - publish(request: PublishRequest): Promise; + docsRouter(): express.Handler; + fetchTechDocsMetadata(entityName: EntityName): Promise; + getReadiness(): Promise; + hasDocsBeenGenerated(entityName: Entity): Promise; + publish(request: PublishRequest): Promise; } // @public -export type PublisherType = 'local' | 'googleGcs' | 'awsS3' | 'azureBlobStorage' | 'openStackSwift'; +export type PublisherType = + | 'local' + | 'googleGcs' + | 'awsS3' + | 'azureBlobStorage' + | 'openStackSwift'; // @public -export type RemoteProtocol = 'url' | 'dir' | 'github' | 'gitlab' | 'file' | 'azure/api'; +export type RemoteProtocol = + | 'url' + | 'dir' + | 'github' + | 'gitlab' + | 'file' + | 'azure/api'; // @public (undocumented) export class TechdocsGenerator implements GeneratorBase { - constructor({ logger, containerRunner, config, }: { - logger: Logger_2; - containerRunner: ContainerRunner; - config: Config; - }); - // (undocumented) - run({ inputDir, outputDir, parsedLocationAnnotation, etag, }: GeneratorRunOptions): Promise; + constructor({ + logger, + containerRunner, + config, + }: { + logger: Logger_2; + containerRunner: ContainerRunner; + config: Config; + }); + // (undocumented) + run({ + inputDir, + outputDir, + parsedLocationAnnotation, + etag, + }: GeneratorRunOptions): Promise; } // @public export type TechDocsMetadata = { - site_name: string; - site_description: string; - etag: string; + site_name: string; + site_description: string; + etag: string; }; // @public (undocumented) export class UrlPreparer implements PreparerBase { - constructor(reader: UrlReader, logger: Logger_2); - // (undocumented) - prepare(entity: Entity, options?: { - etag?: string; - }): Promise; - } - + constructor(reader: UrlReader, logger: Logger_2); + // (undocumented) + prepare( + entity: Entity, + options?: { + etag?: string; + }, + ): Promise; +} // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/techdocs-common/package.json b/packages/techdocs-common/package.json index 9b5b614177..de97e9815d 100644 --- a/packages/techdocs-common/package.json +++ b/packages/techdocs-common/package.json @@ -48,7 +48,7 @@ "aws-sdk": "^2.840.0", "cross-fetch": "^3.0.6", "express": "^4.17.1", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "git-url-parse": "~11.4.4", "js-yaml": "^4.0.0", "json5": "^2.1.3", diff --git a/packages/test-utils-core/api-report.md b/packages/test-utils-core/api-report.md index 4b603b8e7b..8eb7ee458a 100644 --- a/packages/test-utils-core/api-report.md +++ b/packages/test-utils-core/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { ReactElement } from 'react'; import { RenderResult } from '@testing-library/react'; @@ -12,48 +11,53 @@ export type AsyncLogCollector = () => Promise; // @public (undocumented) export type CollectedLogs = { - [key in T]: string[]; + [key in T]: string[]; }; // @public (undocumented) export class Keyboard { - constructor(target: any, { debug }?: { - debug?: boolean | undefined; - }); - // (undocumented) - click(): Promise; - // (undocumented) - debug: boolean; - // (undocumented) - document: any; - // (undocumented) - enter(value: any): Promise; - // (undocumented) - escape(): Promise; - // (undocumented) - get focused(): any; - // (undocumented) - static fromReadableInput(input: any): any; - // (undocumented) - _log(message: any, ...args: any[]): void; - // (undocumented) - _pretty(element: any): string; - // (undocumented) - send(chars: any): Promise; - // (undocumented) - _sendKey(key: any, charCode: any, action: any): Promise; - // (undocumented) - tab(): Promise; - // (undocumented) - static toReadableInput(chars: any): any; - // (undocumented) - toString(): string; - // (undocumented) - static type(target: any, input: any): Promise; - // (undocumented) - type(input: any): Promise; - // (undocumented) - static typeDebug(target: any, input: any): Promise; + constructor( + target: any, + { + debug, + }?: { + debug?: boolean | undefined; + }, + ); + // (undocumented) + click(): Promise; + // (undocumented) + debug: boolean; + // (undocumented) + document: any; + // (undocumented) + enter(value: any): Promise; + // (undocumented) + escape(): Promise; + // (undocumented) + get focused(): any; + // (undocumented) + static fromReadableInput(input: any): any; + // (undocumented) + _log(message: any, ...args: any[]): void; + // (undocumented) + _pretty(element: any): string; + // (undocumented) + send(chars: any): Promise; + // (undocumented) + _sendKey(key: any, charCode: any, action: any): Promise; + // (undocumented) + tab(): Promise; + // (undocumented) + static toReadableInput(chars: any): any; + // (undocumented) + toString(): string; + // (undocumented) + static type(target: any, input: any): Promise; + // (undocumented) + type(input: any): Promise; + // (undocumented) + static typeDebug(target: any, input: any): Promise; } // @public (undocumented) @@ -69,18 +73,26 @@ export function renderWithEffects(nodes: ReactElement): Promise; export type SyncLogCollector = () => void; // @public (undocumented) -export function withLogCollector(callback: AsyncLogCollector): Promise>; +export function withLogCollector( + callback: AsyncLogCollector, +): Promise>; // @public (undocumented) -export function withLogCollector(callback: SyncLogCollector): CollectedLogs; +export function withLogCollector( + callback: SyncLogCollector, +): CollectedLogs; // @public (undocumented) -export function withLogCollector(logsToCollect: T[], callback: AsyncLogCollector): Promise>; +export function withLogCollector( + logsToCollect: T[], + callback: AsyncLogCollector, +): Promise>; // @public (undocumented) -export function withLogCollector(logsToCollect: T[], callback: SyncLogCollector): CollectedLogs; - +export function withLogCollector( + logsToCollect: T[], + callback: SyncLogCollector, +): CollectedLogs; // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/test-utils/api-report.md b/packages/test-utils/api-report.md index 078fa14399..57020e6221 100644 --- a/packages/test-utils/api-report.md +++ b/packages/test-utils/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { ComponentType } from 'react'; import { ErrorApi } from '@backstage/core-plugin-api'; import { ErrorContext } from '@backstage/core-plugin-api'; @@ -17,66 +16,72 @@ import { StorageApi } from '@backstage/core-plugin-api'; import { StorageValueChange } from '@backstage/core-plugin-api'; // @public (undocumented) -export function mockBreakpoint(initialBreakpoint?: Breakpoint): { - set(breakpoint: Breakpoint): void; - remove(): void; +export function mockBreakpoint( + initialBreakpoint?: Breakpoint, +): { + set(breakpoint: Breakpoint): void; + remove(): void; }; // @public (undocumented) export class MockErrorApi implements ErrorApi { - constructor(options?: Options); - // (undocumented) - error$(): Observable<{ - error: Error; - context?: ErrorContext; - }>; - // (undocumented) - getErrors(): ErrorWithContext[]; - // (undocumented) - post(error: Error, context?: ErrorContext): void; - // (undocumented) - waitForError(pattern: RegExp, timeoutMs?: number): Promise; + constructor(options?: Options); + // (undocumented) + error$(): Observable<{ + error: Error; + context?: ErrorContext; + }>; + // (undocumented) + getErrors(): ErrorWithContext[]; + // (undocumented) + post(error: Error, context?: ErrorContext): void; + // (undocumented) + waitForError(pattern: RegExp, timeoutMs?: number): Promise; } // @public (undocumented) export class MockStorageApi implements StorageApi { - // (undocumented) - static create(data?: MockStorageBucket): MockStorageApi; - // (undocumented) - forBucket(name: string): StorageApi; - // (undocumented) - get(key: string): T | undefined; - // (undocumented) - observe$(key: string): Observable>; - // (undocumented) - remove(key: string): Promise; - // (undocumented) - set(key: string, data: T): Promise; - } + // (undocumented) + static create(data?: MockStorageBucket): MockStorageApi; + // (undocumented) + forBucket(name: string): StorageApi; + // (undocumented) + get(key: string): T | undefined; + // (undocumented) + observe$(key: string): Observable>; + // (undocumented) + remove(key: string): Promise; + // (undocumented) + set(key: string, data: T): Promise; +} // @public (undocumented) export type MockStorageBucket = { - [key: string]: any; + [key: string]: any; }; // @public (undocumented) export const msw: { - setupDefaultHandlers: (worker: { - listen: (t: any) => void; - close: () => void; - resetHandlers: () => void; - }) => void; + setupDefaultHandlers: (worker: { + listen: (t: any) => void; + close: () => void; + resetHandlers: () => void; + }) => void; }; // @public -export function renderInTestApp(Component: ComponentType | ReactNode, options?: TestAppOptions): Promise; +export function renderInTestApp( + Component: ComponentType | ReactNode, + options?: TestAppOptions, +): Promise; // @public -export function wrapInTestApp(Component: ComponentType | ReactNode, options?: TestAppOptions): ReactElement; +export function wrapInTestApp( + Component: ComponentType | ReactNode, + options?: TestAppOptions, +): ReactElement; - -export * from "@backstage/test-utils-core"; +export * from '@backstage/test-utils-core'; // (No @packageDocumentation comment for this package) - ``` diff --git a/packages/theme/api-report.md b/packages/theme/api-report.md index 93d0957f5a..e09f5838c7 100644 --- a/packages/theme/api-report.md +++ b/packages/theme/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Overrides } from '@material-ui/core/styles/overrides'; import { Palette } from '@material-ui/core/styles/createPalette'; import { PaletteOptions } from '@material-ui/core/styles/createPalette'; @@ -18,22 +17,22 @@ export type BackstagePaletteOptions = PaletteOptions & PaletteAdditions; // @public (undocumented) export interface BackstageTheme extends Theme { - // (undocumented) - getPageTheme: ({ themeId }: PageThemeSelector) => PageTheme; - // (undocumented) - page: PageTheme; - // (undocumented) - palette: BackstagePalette; + // (undocumented) + getPageTheme: ({ themeId }: PageThemeSelector) => PageTheme; + // (undocumented) + page: PageTheme; + // (undocumented) + palette: BackstagePalette; } // @public (undocumented) export interface BackstageThemeOptions extends ThemeOptions { - // (undocumented) - getPageTheme: ({ themeId }: PageThemeSelector) => PageTheme; - // (undocumented) - page: PageTheme; - // (undocumented) - palette: BackstagePaletteOptions; + // (undocumented) + getPageTheme: ({ themeId }: PageThemeSelector) => PageTheme; + // (undocumented) + page: PageTheme; + // (undocumented) + palette: BackstagePaletteOptions; } // @public (undocumented) @@ -43,7 +42,9 @@ export const colorVariants: Record; export function createTheme(options: SimpleThemeOptions): BackstageTheme; // @public (undocumented) -export function createThemeOptions(options: SimpleThemeOptions): BackstageThemeOptions; +export function createThemeOptions( + options: SimpleThemeOptions, +): BackstageThemeOptions; // @public (undocumented) export function createThemeOverrides(theme: BackstageTheme): Overrides; @@ -59,9 +60,9 @@ export const lightTheme: BackstageTheme; // @public (undocumented) export type PageTheme = { - colors: string[]; - shape: string; - backgroundImage: string; + colors: string[]; + shape: string; + backgroundImage: string; }; // @public (undocumented) @@ -69,7 +70,7 @@ export const pageTheme: Record; // @public (undocumented) export type PageThemeSelector = { - themeId: string; + themeId: string; }; // @public (undocumented) @@ -77,13 +78,11 @@ export const shapes: Record; // @public export type SimpleThemeOptions = { - palette: BackstagePaletteOptions; - defaultPageTheme: string; - pageTheme?: Record; - fontFamily?: string; + palette: BackstagePaletteOptions; + defaultPageTheme: string; + pageTheme?: Record; + fontFamily?: string; }; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/api-docs/api-report.md b/plugins/api-docs/api-report.md index c7d3fdc694..bb83d4c539 100644 --- a/plugins/api-docs/api-report.md +++ b/plugins/api-docs/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiEntity } from '@backstage/catalog-model'; import { ApiRef } from '@backstage/core-plugin-api'; @@ -20,32 +21,38 @@ export const ApiDefinitionCard: (_: Props) => JSX.Element; // @public (undocumented) export type ApiDefinitionWidget = { - type: string; - title: string; - component: (definition: string) => React_2.ReactElement; - rawLanguage?: string; + type: string; + title: string; + component: (definition: string) => React_2.ReactElement; + rawLanguage?: string; }; // @public (undocumented) export const apiDocsConfigRef: ApiRef; // @public (undocumented) -const apiDocsPlugin: BackstagePlugin<{ +const apiDocsPlugin: BackstagePlugin< + { root: RouteRef; -}, { + }, + { createComponent: ExternalRouteRef; -}>; - -export { apiDocsPlugin } - -export { apiDocsPlugin as plugin } + } +>; +export { apiDocsPlugin }; +export { apiDocsPlugin as plugin }; // @public (undocumented) -export const ApiExplorerPage: ({ initiallySelectedFilter, columns, }: ApiExplorerPageProps) => JSX.Element; +export const ApiExplorerPage: ({ + initiallySelectedFilter, + columns, +}: ApiExplorerPageProps) => JSX.Element; // @public (undocumented) -export const ApiTypeTitle: ({ apiEntity }: { - apiEntity: ApiEntity; +export const ApiTypeTitle: ({ + apiEntity, +}: { + apiEntity: ApiEntity; }) => JSX.Element; // @public (undocumented) @@ -62,36 +69,46 @@ export function defaultDefinitionWidgets(): ApiDefinitionWidget[]; // @public (undocumented) export const EntityApiDefinitionCard: (_: { - apiEntity?: ApiEntity | undefined; + apiEntity?: ApiEntity | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityConsumedApisCard: ({ variant }: { - entity?: Entity| undefined; - variant?: "gridItem" | undefined; +export const EntityConsumedApisCard: ({ + variant, +}: { + entity?: Entity | undefined; + variant?: 'gridItem' | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityConsumingComponentsCard: ({ variant }: { - entity?: Entity| undefined; - variant?: "gridItem" | undefined; +export const EntityConsumingComponentsCard: ({ + variant, +}: { + entity?: Entity | undefined; + variant?: 'gridItem' | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityHasApisCard: ({ variant }: { - variant?: "gridItem" | undefined; +export const EntityHasApisCard: ({ + variant, +}: { + variant?: 'gridItem' | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityProvidedApisCard: ({ variant }: { - entity?: Entity| undefined; - variant?: "gridItem" | undefined; +export const EntityProvidedApisCard: ({ + variant, +}: { + entity?: Entity | undefined; + variant?: 'gridItem' | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityProvidingComponentsCard: ({ variant }: { - entity?: Entity| undefined; - variant?: "gridItem" | undefined; +export const EntityProvidingComponentsCard: ({ + variant, +}: { + entity?: Entity | undefined; + variant?: 'gridItem' | undefined; }) => JSX.Element; // @public (undocumented) @@ -101,7 +118,10 @@ export const HasApisCard: ({ variant }: Props_3) => JSX.Element; export const OpenApiDefinitionWidget: ({ definition }: Props_8) => JSX.Element; // @public (undocumented) -export const PlainApiDefinitionWidget: ({ definition, language }: Props_9) => JSX.Element; +export const PlainApiDefinitionWidget: ({ + definition, + language, +}: Props_9) => JSX.Element; // @public (undocumented) export const ProvidedApisCard: ({ variant }: Props_4) => JSX.Element; @@ -109,7 +129,5 @@ export const ProvidedApisCard: ({ variant }: Props_4) => JSX.Element; // @public (undocumented) export const ProvidingComponentsCard: ({ variant }: Props_7) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/app-backend/api-report.md b/plugins/app-backend/api-report.md index 93aba5596f..7215366ebb 100644 --- a/plugins/app-backend/api-report.md +++ b/plugins/app-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; @@ -13,16 +12,14 @@ export function createRouter(options: RouterOptions): Promise; // @public (undocumented) export interface RouterOptions { - appPackageName: string; - // (undocumented) - config: Config; - disableConfigInjection?: boolean; - // (undocumented) - logger: Logger_2; - staticFallbackHandler?: express.Handler; + appPackageName: string; + // (undocumented) + config: Config; + disableConfigInjection?: boolean; + // (undocumented) + logger: Logger_2; + staticFallbackHandler?: express.Handler; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json index 384d44d82a..cd5b62dfb4 100644 --- a/plugins/app-backend/package.json +++ b/plugins/app-backend/package.json @@ -35,7 +35,7 @@ "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "winston": "^3.2.1", "yn": "^4.0.0" }, diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index 9f9a8d18ef..50341c0392 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; @@ -16,52 +15,67 @@ import { Profile } from 'passport'; import { UserEntity } from '@backstage/catalog-model'; // @public (undocumented) -export type AuthProviderFactory = (options: AuthProviderFactoryOptions) => AuthProviderRouteHandlers; +export type AuthProviderFactory = ( + options: AuthProviderFactoryOptions, +) => AuthProviderRouteHandlers; // @public (undocumented) export type AuthProviderFactoryOptions = { - providerId: string; - globalConfig: AuthProviderConfig; - config: Config; - logger: Logger_2; - tokenIssuer: TokenIssuer; - discovery: PluginEndpointDiscovery; - catalogApi: CatalogApi; - identityResolver?: ExperimentalIdentityResolver; + providerId: string; + globalConfig: AuthProviderConfig; + config: Config; + logger: Logger_2; + tokenIssuer: TokenIssuer; + discovery: PluginEndpointDiscovery; + catalogApi: CatalogApi; + identityResolver?: ExperimentalIdentityResolver; }; // @public export interface AuthProviderRouteHandlers { - frameHandler(req: express.Request, res: express.Response): Promise; - logout?(req: express.Request, res: express.Response): Promise; - refresh?(req: express.Request, res: express.Response): Promise; - start(req: express.Request, res: express.Response): Promise; + frameHandler(req: express.Request, res: express.Response): Promise; + logout?(req: express.Request, res: express.Response): Promise; + refresh?(req: express.Request, res: express.Response): Promise; + start(req: express.Request, res: express.Response): Promise; } // @public (undocumented) export type AuthResponse = { - providerInfo: ProviderInfo; - profile: ProfileInfo; - backstageIdentity?: BackstageIdentity; + providerInfo: ProviderInfo; + profile: ProfileInfo; + backstageIdentity?: BackstageIdentity; }; // @public (undocumented) export type BackstageIdentity = { - id: string; - idToken?: string; - token?: string; - entity?: Entity; + id: string; + idToken?: string; + token?: string; + entity?: Entity; }; // @public (undocumented) -export const createGoogleProvider: (options?: GoogleProviderOptions | undefined) => AuthProviderFactory; +export const createGoogleProvider: ( + options?: GoogleProviderOptions | undefined, +) => AuthProviderFactory; // @public (undocumented) -export function createRouter({ logger, config, discovery, database, providerFactories, }: RouterOptions): Promise; +export const createMicrosoftProvider: ( + options?: MicrosoftProviderOptions | undefined, +) => AuthProviderFactory; + +// @public (undocumented) +export function createRouter({ + logger, + config, + discovery, + database, + providerFactories, +}: RouterOptions): Promise; // @public (undocumented) export const defaultAuthProviderFactories: { - [providerId: string]: AuthProviderFactory; + [providerId: string]: AuthProviderFactory; }; // @public (undocumented) @@ -75,86 +89,108 @@ export const googleEmailSignInResolver: SignInResolver; // @public (undocumented) export type GoogleProviderOptions = { - authHandler?: AuthHandler; - signIn?: { - resolver?: SignInResolver; - }; + authHandler?: AuthHandler; + signIn?: { + resolver?: SignInResolver; + }; }; // @public export class IdentityClient { - constructor(options: { - discovery: PluginEndpointDiscovery; - issuer: string; - }); - authenticate(token: string | undefined): Promise; - static getBearerToken(authorizationHeader: string | undefined): string | undefined; - listPublicKeys(): Promise<{ - keys: JSONWebKey[]; - }>; - } + constructor(options: { discovery: PluginEndpointDiscovery; issuer: string }); + authenticate(token: string | undefined): Promise; + static getBearerToken( + authorizationHeader: string | undefined, + ): string | undefined; + listPublicKeys(): Promise<{ + keys: JSONWebKey[]; + }>; +} + +// @public (undocumented) +export const microsoftEmailSignInResolver: SignInResolver; + +// @public (undocumented) +export type MicrosoftProviderOptions = { + authHandler?: AuthHandler; + signIn?: { + resolver?: SignInResolver; + }; +}; // @public (undocumented) export class OAuthAdapter implements AuthProviderRouteHandlers { - constructor(handlers: OAuthHandlers, options: Options); - // (undocumented) - frameHandler(req: express.Request, res: express.Response): Promise; - // (undocumented) - static fromConfig(config: AuthProviderConfig, handlers: OAuthHandlers, options: Pick): OAuthAdapter; - // (undocumented) - logout(req: express.Request, res: express.Response): Promise; - // (undocumented) - refresh(req: express.Request, res: express.Response): Promise; - // (undocumented) - start(req: express.Request, res: express.Response): Promise; + constructor(handlers: OAuthHandlers, options: Options); + // (undocumented) + frameHandler(req: express.Request, res: express.Response): Promise; + // (undocumented) + static fromConfig( + config: AuthProviderConfig, + handlers: OAuthHandlers, + options: Pick< + Options, + 'providerId' | 'persistScopes' | 'disableRefresh' | 'tokenIssuer' + >, + ): OAuthAdapter; + // (undocumented) + logout(req: express.Request, res: express.Response): Promise; + // (undocumented) + refresh(req: express.Request, res: express.Response): Promise; + // (undocumented) + start(req: express.Request, res: express.Response): Promise; } // @public (undocumented) export class OAuthEnvironmentHandler implements AuthProviderRouteHandlers { - constructor(handlers: Map); - // (undocumented) - frameHandler(req: express.Request, res: express.Response): Promise; - // (undocumented) - logout(req: express.Request, res: express.Response): Promise; - // (undocumented) - static mapConfig(config: Config, factoryFunc: (envConfig: Config) => AuthProviderRouteHandlers): OAuthEnvironmentHandler; - // (undocumented) - refresh(req: express.Request, res: express.Response): Promise; - // (undocumented) - start(req: express.Request, res: express.Response): Promise; + constructor(handlers: Map); + // (undocumented) + frameHandler(req: express.Request, res: express.Response): Promise; + // (undocumented) + logout(req: express.Request, res: express.Response): Promise; + // (undocumented) + static mapConfig( + config: Config, + factoryFunc: (envConfig: Config) => AuthProviderRouteHandlers, + ): OAuthEnvironmentHandler; + // (undocumented) + refresh(req: express.Request, res: express.Response): Promise; + // (undocumented) + start(req: express.Request, res: express.Response): Promise; } // @public export interface OAuthHandlers { - handler(req: express.Request): Promise<{ - response: AuthResponse; - refreshToken?: string; - }>; - logout?(): Promise; - refresh?(req: OAuthRefreshRequest): Promise>; - start(req: OAuthStartRequest): Promise; + handler( + req: express.Request, + ): Promise<{ + response: AuthResponse; + refreshToken?: string; + }>; + logout?(): Promise; + refresh?(req: OAuthRefreshRequest): Promise>; + start(req: OAuthStartRequest): Promise; } // @public (undocumented) export type OAuthProviderInfo = { - accessToken: string; - idToken?: string; - expiresInSeconds?: number; - scope: string; - refreshToken?: string; + accessToken: string; + idToken?: string; + expiresInSeconds?: number; + scope: string; + refreshToken?: string; }; // @public export type OAuthProviderOptions = { - clientId: string; - clientSecret: string; - callbackUrl: string; + clientId: string; + clientSecret: string; + callbackUrl: string; }; // @public (undocumented) export type OAuthRefreshRequest = express.Request<{}> & { - scope: string; - refreshToken: string; + scope: string; + refreshToken: string; }; // @public (undocumented) @@ -162,36 +198,40 @@ export type OAuthResponse = AuthResponse; // @public (undocumented) export type OAuthResult = { - fullProfile: Profile; - params: { - id_token?: string; - scope: string; - expires_in: number; - }; - accessToken: string; - refreshToken?: string; + fullProfile: Profile; + params: { + id_token?: string; + scope: string; + expires_in: number; + }; + accessToken: string; + refreshToken?: string; }; // @public (undocumented) export type OAuthStartRequest = express.Request<{}> & { - scope: string; - state: OAuthState; + scope: string; + state: OAuthState; }; // @public (undocumented) export type OAuthState = { - nonce: string; - env: string; + nonce: string; + env: string; }; // @public (undocumented) -export const postMessageResponse: (res: express.Response, appOrigin: string, response: WebMessageResponse) => void; +export const postMessageResponse: ( + res: express.Response, + appOrigin: string, + response: WebMessageResponse, +) => void; // @public export type ProfileInfo = { - email?: string; - displayName?: string; - picture?: string; + email?: string; + displayName?: string; + picture?: string; }; // @public (undocumented) @@ -199,31 +239,31 @@ export const readState: (stateString: string) => OAuthState; // @public (undocumented) export interface RouterOptions { - // (undocumented) - config: Config; - // (undocumented) - database: PluginDatabaseManager; - // (undocumented) - discovery: PluginEndpointDiscovery; - // (undocumented) - logger: Logger_2; - // (undocumented) - providerFactories?: ProviderFactories; + // (undocumented) + config: Config; + // (undocumented) + database: PluginDatabaseManager; + // (undocumented) + discovery: PluginEndpointDiscovery; + // (undocumented) + logger: Logger_2; + // (undocumented) + providerFactories?: ProviderFactories; } // @public (undocumented) export const verifyNonce: (req: express.Request, providerId: string) => void; // @public -export type WebMessageResponse = { - type: 'authorization_response'; - response: AuthResponse; -} | { - type: 'authorization_response'; - error: Error; -}; - +export type WebMessageResponse = + | { + type: 'authorization_response'; + response: AuthResponse; + } + | { + type: 'authorization_response'; + error: Error; + }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index 719cec7a99..0b108e11cd 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -44,7 +44,7 @@ "express": "^4.17.1", "express-promise-router": "^4.1.0", "express-session": "^1.17.1", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "got": "^11.5.2", "helmet": "^4.0.0", "jose": "^1.27.1", diff --git a/plugins/auth-backend/src/providers/index.ts b/plugins/auth-backend/src/providers/index.ts index 940ceadffe..6b262dcf68 100644 --- a/plugins/auth-backend/src/providers/index.ts +++ b/plugins/auth-backend/src/providers/index.ts @@ -15,6 +15,7 @@ */ export * from './google'; +export * from './microsoft'; export { factories as defaultAuthProviderFactories } from './factories'; // Export the minimal interface required for implementing a diff --git a/plugins/auth-backend/src/providers/microsoft/index.ts b/plugins/auth-backend/src/providers/microsoft/index.ts index 374e451ae9..3167de5d0d 100644 --- a/plugins/auth-backend/src/providers/microsoft/index.ts +++ b/plugins/auth-backend/src/providers/microsoft/index.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export { createMicrosoftProvider } from './provider'; +export { + createMicrosoftProvider, + microsoftEmailSignInResolver, +} from './provider'; export type { MicrosoftProviderOptions } from './provider'; diff --git a/plugins/auth-backend/src/providers/microsoft/provider.test.ts b/plugins/auth-backend/src/providers/microsoft/provider.test.ts new file mode 100644 index 0000000000..c979bed582 --- /dev/null +++ b/plugins/auth-backend/src/providers/microsoft/provider.test.ts @@ -0,0 +1,105 @@ +/* + * Copyright 2020 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. + */ + +import { MicrosoftAuthProvider } from './provider'; +import * as helpers from '../../lib/passport/PassportStrategyHelper'; +import { OAuthResult } from '../../lib/oauth'; +import { getVoidLogger } from '@backstage/backend-common'; +import { TokenIssuer } from '../../identity/types'; +import { CatalogIdentityClient } from '../../lib/catalog'; + +const mockFrameHandler = (jest.spyOn( + helpers, + 'executeFrameHandlerStrategy', +) as unknown) as jest.MockedFunction< + () => Promise<{ result: OAuthResult; privateInfo: any }> +>; + +describe('createMicrosoftProvider', () => { + it('should auth', async () => { + const tokenIssuer = { + issueToken: jest.fn(), + listPublicKeys: jest.fn(), + }; + const catalogIdentityClient = { + findUser: jest.fn(), + }; + + const provider = new MicrosoftAuthProvider({ + logger: getVoidLogger(), + catalogIdentityClient: (catalogIdentityClient as unknown) as CatalogIdentityClient, + tokenIssuer: (tokenIssuer as unknown) as TokenIssuer, + authHandler: async ({ fullProfile }) => ({ + profile: { + email: fullProfile.emails![0]!.value, + displayName: fullProfile.displayName, + picture: 'http://microsoft.com/lols', + }, + }), + clientId: 'mock', + clientSecret: 'mock', + callbackUrl: 'mock', + }); + + mockFrameHandler.mockResolvedValueOnce({ + result: { + fullProfile: { + emails: [ + { + type: 'work', + value: 'conrad@example.com', + }, + ], + displayName: 'Conrad', + name: { + familyName: 'Ribas', + givenName: 'Francisco', + }, + id: 'conrad', + provider: 'microsoft', + photos: [ + { + value: 'some-data', + }, + ], + }, + params: { + id_token: 'idToken', + scope: 'scope', + expires_in: 123, + }, + accessToken: 'accessToken', + }, + privateInfo: { + refreshToken: 'wacka', + }, + }); + const { response } = await provider.handler({} as any); + expect(response).toEqual({ + providerInfo: { + accessToken: 'accessToken', + expiresInSeconds: 123, + idToken: 'idToken', + scope: 'scope', + }, + profile: { + email: 'conrad@example.com', + displayName: 'Conrad', + picture: 'http://microsoft.com/lols', + }, + }); + }); +}); diff --git a/plugins/auth-backend/src/providers/microsoft/provider.ts b/plugins/auth-backend/src/providers/microsoft/provider.ts index 86c7d3a3a4..633844a351 100644 --- a/plugins/auth-backend/src/providers/microsoft/provider.ts +++ b/plugins/auth-backend/src/providers/microsoft/provider.ts @@ -17,45 +17,65 @@ import express from 'express'; import passport from 'passport'; import { Strategy as MicrosoftStrategy } from 'passport-microsoft'; - +import { TokenIssuer } from '../../identity/types'; +import { CatalogIdentityClient, getEntityClaims } from '../../lib/catalog'; import { + encodeState, + OAuthAdapter, + OAuthEnvironmentHandler, + OAuthHandlers, + OAuthProviderOptions, + OAuthRefreshRequest, + OAuthResponse, + OAuthResult, + OAuthStartRequest, +} from '../../lib/oauth'; +import { + executeFetchUserProfileStrategy, executeFrameHandlerStrategy, executeRedirectStrategy, executeRefreshTokenStrategy, makeProfileInfo, - executeFetchUserProfileStrategy, PassportDoneCallback, } from '../../lib/passport'; - -import { RedirectInfo, AuthProviderFactory } from '../types'; - import { - OAuthAdapter, - OAuthProviderOptions, - OAuthHandlers, - OAuthResponse, - OAuthEnvironmentHandler, - OAuthStartRequest, - encodeState, - OAuthRefreshRequest, - OAuthResult, -} from '../../lib/oauth'; - + AuthProviderFactory, + AuthHandler, + RedirectInfo, + SignInResolver, +} from '../types'; +import { Logger } from 'winston'; import got from 'got'; type PrivateInfo = { refreshToken: string; }; -export type MicrosoftAuthProviderOptions = OAuthProviderOptions & { +type Options = OAuthProviderOptions & { + signInResolver?: SignInResolver; + authHandler: AuthHandler; + tokenIssuer: TokenIssuer; + catalogIdentityClient: CatalogIdentityClient; + logger: Logger; authorizationUrl?: string; tokenUrl?: string; }; export class MicrosoftAuthProvider implements OAuthHandlers { private readonly _strategy: MicrosoftStrategy; + private readonly signInResolver?: SignInResolver; + private readonly authHandler: AuthHandler; + private readonly tokenIssuer: TokenIssuer; + private readonly catalogIdentityClient: CatalogIdentityClient; + private readonly logger: Logger; + + constructor(options: Options) { + this.signInResolver = options.signInResolver; + this.authHandler = options.authHandler; + this.tokenIssuer = options.tokenIssuer; + this.logger = options.logger; + this.catalogIdentityClient = options.catalogIdentityClient; - constructor(options: MicrosoftAuthProviderOptions) { this._strategy = new MicrosoftStrategy( { clientID: options.clientId, @@ -92,32 +112,10 @@ export class MicrosoftAuthProvider implements OAuthHandlers { PrivateInfo >(req, this._strategy); - try { - const photoUrl = await this.getUserPhoto(result.accessToken); - - const profile = makeProfileInfo( - { - ...result.fullProfile, - photos: photoUrl ? [{ value: photoUrl }] : undefined, - }, - result.params.id_token, - ); - - return { - response: await this.populateIdentity({ - profile, - providerInfo: { - idToken: result.params.id_token, - accessToken: result.accessToken, - scope: result.params.scope, - expiresInSeconds: result.params.expires_in, - }, - }), - refreshToken: privateInfo.refreshToken, - }; - } catch (error) { - throw new Error(`Error processing auth response: ${error}`); - } + return { + response: await this.handleResult(result), + refreshToken: privateInfo.refreshToken, + }; } async refresh(req: OAuthRefreshRequest): Promise { @@ -131,21 +129,46 @@ export class MicrosoftAuthProvider implements OAuthHandlers { this._strategy, accessToken, ); - const profile = makeProfileInfo(fullProfile, params.id_token); - const photo = await this.getUserPhoto(accessToken); - if (photo) { - profile.picture = photo; - } - return this.populateIdentity({ + return this.handleResult({ + fullProfile, + params, + accessToken, + refreshToken: req.refreshToken, + }); + } + + private async handleResult(result: OAuthResult) { + const photo = await this.getUserPhoto(result.accessToken); + result.fullProfile.photos = photo ? [{ value: photo }] : undefined; + + const { profile } = await this.authHandler(result); + + const response: OAuthResponse = { providerInfo: { - accessToken, - idToken: params.id_token, - expiresInSeconds: params.expires_in, - scope: params.scope, + idToken: result.params.id_token, + accessToken: result.accessToken, + scope: result.params.scope, + expiresInSeconds: result.params.expires_in, }, profile, - }); + }; + + if (this.signInResolver) { + response.backstageIdentity = await this.signInResolver( + { + result, + profile, + }, + { + tokenIssuer: this.tokenIssuer, + catalogIdentityClient: this.catalogIdentityClient, + logger: this.logger, + }, + ); + } + + return response; } private getUserPhoto(accessToken: string): Promise { @@ -165,7 +188,7 @@ export class MicrosoftAuthProvider implements OAuthHandlers { resolve(photoURL); }) .catch(error => { - console.log( + this.logger.warn( `Could not retrieve user profile photo from Microsoft Graph API: ${error}`, ); // User profile photo is optional, ignore errors and resolve undefined @@ -173,29 +196,81 @@ export class MicrosoftAuthProvider implements OAuthHandlers { }); }); } - - private async populateIdentity( - response: OAuthResponse, - ): Promise { - const { profile } = response; - - if (!profile.email) { - throw new Error('Microsoft profile contained no email'); - } - - // Like Google implementation, setting this to local part of email for now - const id = profile.email.split('@')[0]; - - return { ...response, backstageIdentity: { id } }; - } } -export type MicrosoftProviderOptions = {}; +export const microsoftEmailSignInResolver: SignInResolver = async ( + info, + ctx, +) => { + const { profile } = info; + + if (!profile.email) { + throw new Error('Microsoft profile contained no email'); + } + + const entity = await ctx.catalogIdentityClient.findUser({ + annotations: { + 'microsoft.com/email': profile.email, + }, + }); + + const claims = getEntityClaims(entity); + const token = await ctx.tokenIssuer.issueToken({ claims }); + + return { id: entity.metadata.name, entity, token }; +}; + +export const microsoftDefaultSignInResolver: SignInResolver = async ( + info, + ctx, +) => { + const { profile } = info; + + if (!profile.email) { + throw new Error('Profile contained no email'); + } + + const userId = profile.email.split('@')[0]; + + const token = await ctx.tokenIssuer.issueToken({ + claims: { sub: userId, ent: [`user:default/${userId}`] }, + }); + + return { id: userId, token }; +}; + +export type MicrosoftProviderOptions = { + /** + * The profile transformation function used to verify and convert the auth response + * into the profile that will be presented to the user. + */ + authHandler?: AuthHandler; + + /** + * Configure sign-in for this provider, without it the provider can not be used to sign users in. + */ + /** + * Maps an auth result to a Backstage identity for the user. + * + * Set to `'email'` to use the default email-based sign in resolver, which will search + * the catalog for a single user entity that has a matching `microsoft.com/email` annotation. + */ + signIn?: { + resolver?: SignInResolver; + }; +}; export const createMicrosoftProvider = ( - _options?: MicrosoftProviderOptions, + options?: MicrosoftProviderOptions, ): AuthProviderFactory => { - return ({ providerId, globalConfig, config, tokenIssuer }) => + return ({ + providerId, + globalConfig, + config, + tokenIssuer, + catalogApi, + logger, + }) => OAuthEnvironmentHandler.mapConfig(config, envConfig => { const clientId = envConfig.getString('clientId'); const clientSecret = envConfig.getString('clientSecret'); @@ -205,12 +280,38 @@ export const createMicrosoftProvider = ( const authorizationUrl = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/authorize`; const tokenUrl = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`; + const catalogIdentityClient = new CatalogIdentityClient({ + catalogApi, + tokenIssuer, + }); + + const authHandler: AuthHandler = options?.authHandler + ? options.authHandler + : async ({ fullProfile, params }) => ({ + profile: makeProfileInfo(fullProfile, params.id_token), + }); + + const signInResolverFn = + options?.signIn?.resolver ?? microsoftDefaultSignInResolver; + + const signInResolver: SignInResolver = info => + signInResolverFn(info, { + catalogIdentityClient, + tokenIssuer, + logger, + }); + const provider = new MicrosoftAuthProvider({ clientId, clientSecret, callbackUrl, authorizationUrl, tokenUrl, + authHandler, + signInResolver, + catalogIdentityClient, + logger, + tokenIssuer, }); return OAuthAdapter.fromConfig(globalConfig, provider, { diff --git a/plugins/badges-backend/api-report.md b/plugins/badges-backend/api-report.md index 1523d685b4..19f5a956e4 100644 --- a/plugins/badges-backend/api-report.md +++ b/plugins/badges-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; @@ -12,65 +11,71 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; // @public (undocumented) export interface Badge { - color?: string; - description?: string; - kind?: 'entity'; - label: string; - labelColor?: string; - link?: string; - message: string; - style?: BadgeStyle; + color?: string; + description?: string; + kind?: 'entity'; + label: string; + labelColor?: string; + link?: string; + message: string; + style?: BadgeStyle; } // @public (undocumented) -export const BADGE_STYLES: readonly ["plastic", "flat", "flat-square", "for-the-badge", "social"]; +export const BADGE_STYLES: readonly [ + 'plastic', + 'flat', + 'flat-square', + 'for-the-badge', + 'social', +]; // @public (undocumented) export type BadgeBuilder = { - getBadges(): Promise; - createBadgeJson(options: BadgeOptions): Promise; - createBadgeSvg(options: BadgeOptions): Promise; + getBadges(): Promise; + createBadgeJson(options: BadgeOptions): Promise; + createBadgeSvg(options: BadgeOptions): Promise; }; // @public (undocumented) export interface BadgeContext { - // (undocumented) - badgeUrl: string; - // (undocumented) - config: Config; - // (undocumented) - entity?: Entity; + // (undocumented) + badgeUrl: string; + // (undocumented) + config: Config; + // (undocumented) + entity?: Entity; } // @public (undocumented) export interface BadgeFactories { - // (undocumented) - [id: string]: BadgeFactory; + // (undocumented) + [id: string]: BadgeFactory; } // @public (undocumented) export interface BadgeFactory { - // (undocumented) - createBadge(context: BadgeContext): Badge; + // (undocumented) + createBadge(context: BadgeContext): Badge; } // @public (undocumented) export type BadgeInfo = { - id: string; + id: string; }; // @public (undocumented) export type BadgeOptions = { - badgeInfo: BadgeInfo; - context: BadgeContext; + badgeInfo: BadgeInfo; + context: BadgeContext; }; // @public (undocumented) export type BadgeSpec = { - id: string; - badge: Badge; - url: string; - markdown: string; + id: string; + badge: Badge; + url: string; + markdown: string; }; // @public (undocumented) @@ -84,30 +89,28 @@ export function createRouter(options: RouterOptions): Promise; // @public (undocumented) export class DefaultBadgeBuilder implements BadgeBuilder { - constructor(factories: BadgeFactories); - // (undocumented) - createBadgeJson(options: BadgeOptions): Promise; - // (undocumented) - createBadgeSvg(options: BadgeOptions): Promise; - // (undocumented) - getBadges(): Promise; - } + constructor(factories: BadgeFactories); + // (undocumented) + createBadgeJson(options: BadgeOptions): Promise; + // (undocumented) + createBadgeSvg(options: BadgeOptions): Promise; + // (undocumented) + getBadges(): Promise; +} // @public (undocumented) export interface RouterOptions { - // (undocumented) - badgeBuilder?: BadgeBuilder; - // (undocumented) - badgeFactories?: BadgeFactories; - // (undocumented) - catalog?: CatalogApi; - // (undocumented) - config: Config; - // (undocumented) - discovery: PluginEndpointDiscovery; + // (undocumented) + badgeBuilder?: BadgeBuilder; + // (undocumented) + badgeFactories?: BadgeFactories; + // (undocumented) + catalog?: CatalogApi; + // (undocumented) + config: Config; + // (undocumented) + discovery: PluginEndpointDiscovery; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/badges/api-report.md b/plugins/badges/api-report.md index 1dbb256fd1..7e70f65b0e 100644 --- a/plugins/badges/api-report.md +++ b/plugins/badges/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -10,12 +11,13 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; export const badgesPlugin: BackstagePlugin<{}, {}>; // @public (undocumented) -export const EntityBadgesDialog: ({ open, onClose }: { - open: boolean; - onClose?: (() => any) | undefined; +export const EntityBadgesDialog: ({ + open, + onClose, +}: { + open: boolean; + onClose?: (() => any) | undefined; }) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/bitrise/api-report.md b/plugins/bitrise/api-report.md index 15c3c74c99..66adb0ec68 100644 --- a/plugins/bitrise/api-report.md +++ b/plugins/bitrise/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; @@ -16,7 +17,5 @@ export const EntityBitriseContent: () => JSX.Element; // @public (undocumented) export const isBitriseAvailable: (entity: Entity) => boolean; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/catalog-backend-module-ldap/api-report.md b/plugins/catalog-backend-module-ldap/api-report.md index 82b07def03..f18ace927c 100644 --- a/plugins/catalog-backend-module-ldap/api-report.md +++ b/plugins/catalog-backend-module-ldap/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { CatalogProcessor } from '@backstage/plugin-catalog-backend'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; import { Client } from 'ldapjs'; @@ -17,124 +16,159 @@ import { SearchOptions } from 'ldapjs'; import { UserEntity } from '@backstage/catalog-model'; // @public (undocumented) -export function defaultGroupTransformer(vendor: LdapVendor, config: GroupConfig, entry: SearchEntry): Promise; +export function defaultGroupTransformer( + vendor: LdapVendor, + config: GroupConfig, + entry: SearchEntry, +): Promise; // @public (undocumented) -export function defaultUserTransformer(vendor: LdapVendor, config: UserConfig, entry: SearchEntry): Promise; +export function defaultUserTransformer( + vendor: LdapVendor, + config: UserConfig, + entry: SearchEntry, +): Promise; // @public export type GroupConfig = { - dn: string; - options: SearchOptions; - set?: { - [path: string]: JsonValue; - }; - map: { - rdn: string; - name: string; - description: string; - type: string; - displayName: string; - email?: string; - picture?: string; - memberOf: string; - members: string; - }; + dn: string; + options: SearchOptions; + set?: { + [path: string]: JsonValue; + }; + map: { + rdn: string; + name: string; + description: string; + type: string; + displayName: string; + email?: string; + picture?: string; + memberOf: string; + members: string; + }; }; // @public -export type GroupTransformer = (vendor: LdapVendor, config: GroupConfig, group: SearchEntry) => Promise; +export type GroupTransformer = ( + vendor: LdapVendor, + config: GroupConfig, + group: SearchEntry, +) => Promise; // @public -export const LDAP_DN_ANNOTATION = "backstage.io/ldap-dn"; +export const LDAP_DN_ANNOTATION = 'backstage.io/ldap-dn'; // @public -export const LDAP_RDN_ANNOTATION = "backstage.io/ldap-rdn"; +export const LDAP_RDN_ANNOTATION = 'backstage.io/ldap-rdn'; // @public -export const LDAP_UUID_ANNOTATION = "backstage.io/ldap-uuid"; +export const LDAP_UUID_ANNOTATION = 'backstage.io/ldap-uuid'; // @public export class LdapClient { - constructor(client: Client); - // (undocumented) - static create(logger: Logger_2, target: string, bind?: BindConfig): Promise; - getRootDSE(): Promise; - getVendor(): Promise; - search(dn: string, options: SearchOptions): Promise; - } + constructor(client: Client); + // (undocumented) + static create( + logger: Logger_2, + target: string, + bind?: BindConfig, + ): Promise; + getRootDSE(): Promise; + getVendor(): Promise; + search(dn: string, options: SearchOptions): Promise; +} // @public export class LdapOrgReaderProcessor implements CatalogProcessor { - constructor(options: { - providers: LdapProviderConfig[]; - logger: Logger_2; - groupTransformer?: GroupTransformer; - userTransformer?: UserTransformer; - }); - // (undocumented) - static fromConfig(config: Config, options: { - logger: Logger_2; - groupTransformer?: GroupTransformer; - userTransformer?: UserTransformer; - }): LdapOrgReaderProcessor; - // (undocumented) - readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise; - } + constructor(options: { + providers: LdapProviderConfig[]; + logger: Logger_2; + groupTransformer?: GroupTransformer; + userTransformer?: UserTransformer; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + groupTransformer?: GroupTransformer; + userTransformer?: UserTransformer; + }, + ): LdapOrgReaderProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} // @public export type LdapProviderConfig = { - target: string; - bind?: BindConfig; - users: UserConfig; - groups: GroupConfig; + target: string; + bind?: BindConfig; + users: UserConfig; + groups: GroupConfig; }; // @public export type LdapVendor = { - dnAttributeName: string; - uuidAttributeName: string; - decodeStringAttribute: (entry: SearchEntry, name: string) => string[]; + dnAttributeName: string; + uuidAttributeName: string; + decodeStringAttribute: (entry: SearchEntry, name: string) => string[]; }; // @public -export function mapStringAttr(entry: SearchEntry, vendor: LdapVendor, attributeName: string | undefined, setter: (value: string) => void): void; +export function mapStringAttr( + entry: SearchEntry, + vendor: LdapVendor, + attributeName: string | undefined, + setter: (value: string) => void, +): void; // @public export function readLdapConfig(config: Config): LdapProviderConfig[]; // @public -export function readLdapOrg(client: LdapClient, userConfig: UserConfig, groupConfig: GroupConfig, options: { +export function readLdapOrg( + client: LdapClient, + userConfig: UserConfig, + groupConfig: GroupConfig, + options: { groupTransformer?: GroupTransformer; userTransformer?: UserTransformer; logger: Logger_2; -}): Promise<{ - users: UserEntity[]; - groups: GroupEntity[]; + }, +): Promise<{ + users: UserEntity[]; + groups: GroupEntity[]; }>; // @public export type UserConfig = { - dn: string; - options: SearchOptions; - set?: { - [path: string]: JsonValue; - }; - map: { - rdn: string; - name: string; - description?: string; - displayName: string; - email: string; - picture?: string; - memberOf: string; - }; + dn: string; + options: SearchOptions; + set?: { + [path: string]: JsonValue; + }; + map: { + rdn: string; + name: string; + description?: string; + displayName: string; + email: string; + picture?: string; + memberOf: string; + }; }; // @public -export type UserTransformer = (vendor: LdapVendor, config: UserConfig, user: SearchEntry) => Promise; - +export type UserTransformer = ( + vendor: LdapVendor, + config: UserConfig, + user: SearchEntry, +) => Promise; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/catalog-backend-module-msgraph/api-report.md b/plugins/catalog-backend-module-msgraph/api-report.md index c755514b48..1fae2731ad 100644 --- a/plugins/catalog-backend-module-msgraph/api-report.md +++ b/plugins/catalog-backend-module-msgraph/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { CatalogProcessor } from '@backstage/plugin-catalog-backend'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; import { Config } from '@backstage/config'; @@ -15,108 +14,143 @@ import * as msal from '@azure/msal-node'; import { UserEntity } from '@backstage/catalog-model'; // @public (undocumented) -export function defaultGroupTransformer(group: MicrosoftGraph.Group, groupPhoto?: string): Promise; +export function defaultGroupTransformer( + group: MicrosoftGraph.Group, + groupPhoto?: string, +): Promise; // @public (undocumented) -export function defaultOrganizationTransformer(organization: MicrosoftGraph.Organization): Promise; +export function defaultOrganizationTransformer( + organization: MicrosoftGraph.Organization, +): Promise; // @public (undocumented) -export function defaultUserTransformer(user: MicrosoftGraph.User, userPhoto?: string): Promise; +export function defaultUserTransformer( + user: MicrosoftGraph.User, + userPhoto?: string, +): Promise; // @public (undocumented) -export type GroupTransformer = (group: MicrosoftGraph.Group, groupPhoto?: string) => Promise; +export type GroupTransformer = ( + group: MicrosoftGraph.Group, + groupPhoto?: string, +) => Promise; // @public -export const MICROSOFT_GRAPH_GROUP_ID_ANNOTATION = "graph.microsoft.com/group-id"; +export const MICROSOFT_GRAPH_GROUP_ID_ANNOTATION = + 'graph.microsoft.com/group-id'; // @public -export const MICROSOFT_GRAPH_TENANT_ID_ANNOTATION = "graph.microsoft.com/tenant-id"; +export const MICROSOFT_GRAPH_TENANT_ID_ANNOTATION = + 'graph.microsoft.com/tenant-id'; // @public -export const MICROSOFT_GRAPH_USER_ID_ANNOTATION = "graph.microsoft.com/user-id"; +export const MICROSOFT_GRAPH_USER_ID_ANNOTATION = 'graph.microsoft.com/user-id'; // @public (undocumented) export class MicrosoftGraphClient { - constructor(baseUrl: string, pca: msal.ConfidentialClientApplication); - // (undocumented) - static create(config: MicrosoftGraphProviderConfig): MicrosoftGraphClient; - // (undocumented) - getGroupMembers(groupId: string): AsyncIterable; - // (undocumented) - getGroupPhoto(groupId: string, sizeId?: string): Promise; - // (undocumented) - getGroupPhotoWithSizeLimit(groupId: string, maxSize: number): Promise; - // (undocumented) - getGroups(query?: ODataQuery): AsyncIterable; - // (undocumented) - getOrganization(tenantId: string): Promise; - // (undocumented) - getUserPhoto(userId: string, sizeId?: string): Promise; - // (undocumented) - getUserPhotoWithSizeLimit(userId: string, maxSize: number): Promise; - // (undocumented) - getUserProfile(userId: string): Promise; - // (undocumented) - getUsers(query?: ODataQuery): AsyncIterable; - // (undocumented) - requestApi(path: string, query?: ODataQuery): Promise; - // (undocumented) - requestCollection(path: string, query?: ODataQuery): AsyncIterable; - // (undocumented) - requestRaw(url: string): Promise; + constructor(baseUrl: string, pca: msal.ConfidentialClientApplication); + // (undocumented) + static create(config: MicrosoftGraphProviderConfig): MicrosoftGraphClient; + // (undocumented) + getGroupMembers(groupId: string): AsyncIterable; + // (undocumented) + getGroupPhoto(groupId: string, sizeId?: string): Promise; + // (undocumented) + getGroupPhotoWithSizeLimit( + groupId: string, + maxSize: number, + ): Promise; + // (undocumented) + getGroups(query?: ODataQuery): AsyncIterable; + // (undocumented) + getOrganization(tenantId: string): Promise; + // (undocumented) + getUserPhoto(userId: string, sizeId?: string): Promise; + // (undocumented) + getUserPhotoWithSizeLimit( + userId: string, + maxSize: number, + ): Promise; + // (undocumented) + getUserProfile(userId: string): Promise; + // (undocumented) + getUsers(query?: ODataQuery): AsyncIterable; + // (undocumented) + requestApi(path: string, query?: ODataQuery): Promise; + // (undocumented) + requestCollection(path: string, query?: ODataQuery): AsyncIterable; + // (undocumented) + requestRaw(url: string): Promise; } // @public export class MicrosoftGraphOrgReaderProcessor implements CatalogProcessor { - constructor(options: { - providers: MicrosoftGraphProviderConfig[]; - logger: Logger_2; - groupTransformer?: GroupTransformer; - }); - // (undocumented) - static fromConfig(config: Config, options: { - logger: Logger_2; - groupTransformer?: GroupTransformer; - }): MicrosoftGraphOrgReaderProcessor; - // (undocumented) - readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise; + constructor(options: { + providers: MicrosoftGraphProviderConfig[]; + logger: Logger_2; + groupTransformer?: GroupTransformer; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + groupTransformer?: GroupTransformer; + }, + ): MicrosoftGraphOrgReaderProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; } // @public export type MicrosoftGraphProviderConfig = { - target: string; - authority?: string; - tenantId: string; - clientId: string; - clientSecret: string; - userFilter?: string; - groupFilter?: string; + target: string; + authority?: string; + tenantId: string; + clientId: string; + clientSecret: string; + userFilter?: string; + groupFilter?: string; }; // @public (undocumented) export function normalizeEntityName(name: string): string; // @public (undocumented) -export type OrganizationTransformer = (organization: MicrosoftGraph.Organization) => Promise; +export type OrganizationTransformer = ( + organization: MicrosoftGraph.Organization, +) => Promise; // @public (undocumented) -export function readMicrosoftGraphConfig(config: Config): MicrosoftGraphProviderConfig[]; +export function readMicrosoftGraphConfig( + config: Config, +): MicrosoftGraphProviderConfig[]; // @public (undocumented) -export function readMicrosoftGraphOrg(client: MicrosoftGraphClient, tenantId: string, options: { +export function readMicrosoftGraphOrg( + client: MicrosoftGraphClient, + tenantId: string, + options: { userFilter?: string; groupFilter?: string; groupTransformer?: GroupTransformer; logger: Logger_2; -}): Promise<{ - users: UserEntity[]; - groups: GroupEntity[]; + }, +): Promise<{ + users: UserEntity[]; + groups: GroupEntity[]; }>; // @public (undocumented) -export type UserTransformer = (user: MicrosoftGraph.User, userPhoto?: string) => Promise; - +export type UserTransformer = ( + user: MicrosoftGraph.User, + userPhoto?: string, +) => Promise; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md new file mode 100644 index 0000000000..ae7559f5d1 --- /dev/null +++ b/plugins/catalog-backend/api-report.md @@ -0,0 +1,881 @@ +## API Report File for "@backstage/plugin-catalog-backend" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { Account } from 'aws-sdk/clients/organizations'; +import { BitbucketIntegration } from '@backstage/integration'; +import { Config } from '@backstage/config'; +import { DocumentCollator } from '@backstage/search-common'; +import { Entity } from '@backstage/catalog-model'; +import { EntityName } from '@backstage/catalog-model'; +import { EntityPolicy } from '@backstage/catalog-model'; +import { EntityRelationSpec } from '@backstage/catalog-model'; +import express from 'express'; +import { IndexableDocument } from '@backstage/search-common'; +import { JsonObject } from '@backstage/config'; +import { JsonValue } from '@backstage/config'; +import { Knex } from 'knex'; +import { Location as Location_2 } from '@backstage/catalog-model'; +import { LocationSpec } from '@backstage/catalog-model'; +import { Logger as Logger_2 } from 'winston'; +import { Organizations } from 'aws-sdk'; +import { PluginDatabaseManager } from '@backstage/backend-common'; +import { PluginEndpointDiscovery } from '@backstage/backend-common'; +import { ResourceEntityV1alpha1 } from '@backstage/catalog-model'; +import { ScmIntegrationRegistry } from '@backstage/integration'; +import { ScmIntegrations } from '@backstage/integration'; +import { UrlReader } from '@backstage/backend-common'; +import { Validators } from '@backstage/catalog-model'; + +// @public (undocumented) +export type AddLocationResult = { + location: Location_2; + entities: Entity[]; +}; + +// @public (undocumented) +export type AnalyzeLocationRequest = { + location: LocationSpec; +}; + +// @public (undocumented) +export type AnalyzeLocationResponse = { + existingEntityFiles: AnalyzeLocationExistingEntity[]; + generateEntities: AnalyzeLocationGenerateEntity[]; +}; + +// @public (undocumented) +export class AnnotateLocationEntityProcessor implements CatalogProcessor { + constructor(options: Options_2); + // (undocumented) + preProcessEntity( + entity: Entity, + location: LocationSpec, + _: CatalogProcessorEmit, + originLocation: LocationSpec, + ): Promise; +} + +// @public (undocumented) +export class AnnotateScmSlugEntityProcessor implements CatalogProcessor { + constructor(opts: { scmIntegrationRegistry: ScmIntegrationRegistry }); + // (undocumented) + static fromConfig(config: Config): AnnotateScmSlugEntityProcessor; + // (undocumented) + preProcessEntity(entity: Entity, location: LocationSpec): Promise; +} + +// @public +export class AwsOrganizationCloudAccountProcessor implements CatalogProcessor { + constructor(options: { + provider: AwsOrganizationProviderConfig; + logger: Logger_2; + }); + // (undocumented) + extractInformationFromArn( + arn: string, + ): { + accountId: string; + organizationId: string; + }; + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + }, + ): AwsOrganizationCloudAccountProcessor; + // (undocumented) + getAwsAccounts(): Promise; + // (undocumented) + logger: Logger_2; + // (undocumented) + mapAccountToComponent(account: Account): ResourceEntityV1alpha1; + // (undocumented) + normalizeName(name: string): string; + // (undocumented) + organizations: Organizations; + // (undocumented) + provider: AwsOrganizationProviderConfig; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public (undocumented) +export class BitbucketDiscoveryProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrationRegistry; + parser?: BitbucketRepositoryParser; + logger: Logger_2; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + parser?: BitbucketRepositoryParser; + logger: Logger_2; + }, + ): BitbucketDiscoveryProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public (undocumented) +export type BitbucketRepositoryParser = (options: { + integration: BitbucketIntegration; + target: string; + logger: Logger_2; +}) => AsyncIterable; + +// @public (undocumented) +export class BuiltinKindsEntityProcessor implements CatalogProcessor { + // (undocumented) + postProcessEntity( + entity: Entity, + _location: LocationSpec, + emit: CatalogProcessorEmit, + ): Promise; + // (undocumented) + validateEntityKind(entity: Entity): Promise; +} + +// @public +export class CatalogBuilder { + constructor(env: CatalogEnvironment); + addEntityPolicy(...policies: EntityPolicy[]): CatalogBuilder; + addProcessor(...processors: CatalogProcessor[]): CatalogBuilder; + build(): Promise<{ + entitiesCatalog: EntitiesCatalog; + locationsCatalog: LocationsCatalog; + higherOrderOperation: HigherOrderOperation; + locationAnalyzer: LocationAnalyzer; + }>; + // (undocumented) + static create(env: CatalogEnvironment): Promise; + replaceEntityPolicies(policies: EntityPolicy[]): CatalogBuilder; + replaceProcessors(processors: CatalogProcessor[]): CatalogBuilder; + setEntityDataParser(parser: CatalogProcessorParser): CatalogBuilder; + setFieldFormatValidators(validators: Partial): CatalogBuilder; + setPlaceholderResolver( + key: string, + resolver: PlaceholderResolver, + ): CatalogBuilder; +} + +// @public (undocumented) +export interface CatalogEntityDocument extends IndexableDocument { + // (undocumented) + componentType: string; + // (undocumented) + kind: string; + // (undocumented) + lifecycle: string; + // (undocumented) + namespace: string; + // (undocumented) + owner: string; +} + +// @public (undocumented) +export interface CatalogProcessingOrchestrator { + // (undocumented) + process(request: EntityProcessingRequest): Promise; +} + +// @public (undocumented) +export type CatalogProcessor = { + readLocation?( + location: LocationSpec, + optional: boolean, + emit: CatalogProcessorEmit, + parser: CatalogProcessorParser, + ): Promise; + preProcessEntity?( + entity: Entity, + location: LocationSpec, + emit: CatalogProcessorEmit, + originLocation: LocationSpec, + ): Promise; + validateEntityKind?(entity: Entity): Promise; + postProcessEntity?( + entity: Entity, + location: LocationSpec, + emit: CatalogProcessorEmit, + ): Promise; + handleError?( + error: Error, + location: LocationSpec, + emit: CatalogProcessorEmit, + ): Promise; +}; + +// @public (undocumented) +export type CatalogProcessorEmit = (generated: CatalogProcessorResult) => void; + +// @public (undocumented) +export type CatalogProcessorEntityResult = { + type: 'entity'; + entity: Entity; + location: LocationSpec; +}; + +// @public (undocumented) +export type CatalogProcessorErrorResult = { + type: 'error'; + error: Error; + location: LocationSpec; +}; + +// @public (undocumented) +export type CatalogProcessorLocationResult = { + type: 'location'; + location: LocationSpec; + optional: boolean; +}; + +// @public +export type CatalogProcessorParser = (options: { + data: Buffer; + location: LocationSpec; +}) => AsyncIterable; + +// @public (undocumented) +export type CatalogProcessorRelationResult = { + type: 'relation'; + relation: EntityRelationSpec; + entityRef?: string; +}; + +// @public (undocumented) +export type CatalogProcessorResult = + | CatalogProcessorLocationResult + | CatalogProcessorEntityResult + | CatalogProcessorRelationResult + | CatalogProcessorErrorResult; + +// @public (undocumented) +export class CodeOwnersProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrations; + logger: Logger_2; + reader: UrlReader; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + reader: UrlReader; + }, + ): CodeOwnersProcessor; + // (undocumented) + preProcessEntity(entity: Entity, location: LocationSpec): Promise; +} + +// @public +export class CommonDatabase implements Database { + constructor(database: Knex, logger: Logger_2); + // (undocumented) + addEntities( + txOpaque: Transaction, + request: DbEntityRequest[], + ): Promise; + // (undocumented) + addLocation( + txOpaque: Transaction, + location: Location_2, + ): Promise; + // (undocumented) + addLocationUpdateLogEvent( + locationId: string, + status: DatabaseLocationUpdateLogStatus, + entityName?: string | string[], + message?: string, + ): Promise; + // (undocumented) + entities( + txOpaque: Transaction, + request?: DbEntitiesRequest, + ): Promise; + // (undocumented) + entityByName( + txOpaque: Transaction, + name: EntityName, + ): Promise; + // (undocumented) + entityByUid( + txOpaque: Transaction, + uid: string, + ): Promise; + // (undocumented) + location(id: string): Promise; + // (undocumented) + locationHistory(id: string): Promise; + // (undocumented) + locations(): Promise; + // (undocumented) + removeEntityByUid(txOpaque: Transaction, uid: string): Promise; + // (undocumented) + removeLocation(txOpaque: Transaction, id: string): Promise; + // (undocumented) + setRelations( + txOpaque: Transaction, + originatingEntityId: string, + relations: EntityRelationSpec[], + ): Promise; + // (undocumented) + transaction(fn: (tx: Transaction) => Promise): Promise; + // (undocumented) + updateEntity( + txOpaque: Transaction, + request: DbEntityRequest, + matchingEtag?: string, + matchingGeneration?: number, + ): Promise; +} + +// @public (undocumented) +export function createNextRouter( + options: RouterOptions_2, +): Promise; + +// @public (undocumented) +export function createRouter(options: RouterOptions): Promise; + +// @public +export type Database = { + transaction(fn: (tx: Transaction) => Promise): Promise; + addEntities( + tx: Transaction, + request: DbEntityRequest[], + ): Promise; + updateEntity( + tx: Transaction, + request: DbEntityRequest, + matchingEtag?: string, + matchingGeneration?: number, + ): Promise; + entities( + tx: Transaction, + request?: DbEntitiesRequest, + ): Promise; + entityByName( + tx: Transaction, + name: EntityName, + ): Promise; + entityByUid( + tx: Transaction, + uid: string, + ): Promise; + removeEntityByUid(tx: Transaction, uid: string): Promise; + setRelations( + tx: Transaction, + entityUid: string, + relations: EntityRelationSpec[], + ): Promise; + addLocation(tx: Transaction, location: Location_2): Promise; + removeLocation(tx: Transaction, id: string): Promise; + location(id: string): Promise; + locations(): Promise; + locationHistory(id: string): Promise; + addLocationUpdateLogEvent( + locationId: string, + status: DatabaseLocationUpdateLogStatus, + entityName?: string | string[], + message?: string, + ): Promise; +}; + +// @public (undocumented) +export class DatabaseEntitiesCatalog implements EntitiesCatalog { + constructor(database: Database, logger: Logger_2); + // (undocumented) + batchAddOrUpdateEntities( + requests: EntityUpsertRequest[], + options?: { + locationId?: string; + dryRun?: boolean; + outputEntities?: boolean; + }, + ): Promise; + // (undocumented) + entities(request?: EntitiesRequest): Promise; + // (undocumented) + removeEntityByUid(uid: string): Promise; +} + +// @public (undocumented) +export class DatabaseLocationsCatalog implements LocationsCatalog { + constructor(database: Database); + // (undocumented) + addLocation(location: Location_2): Promise; + // (undocumented) + location(id: string): Promise; + // (undocumented) + locationHistory(id: string): Promise; + // (undocumented) + locations(): Promise; + // (undocumented) + logUpdateFailure( + locationId: string, + error?: Error, + entityName?: string, + ): Promise; + // (undocumented) + logUpdateSuccess( + locationId: string, + entityName?: string | string[], + ): Promise; + // (undocumented) + removeLocation(id: string): Promise; +} + +// @public (undocumented) +export class DatabaseManager { + // (undocumented) + static createDatabase( + knex: Knex, + options?: Partial, + ): Promise; + // (undocumented) + static createInMemoryDatabase(): Promise; + // (undocumented) + static createInMemoryDatabaseConnection(): Promise; + // (undocumented) + static createTestDatabase(): Promise; + // (undocumented) + static createTestDatabaseConnection(): Promise; +} + +// @public (undocumented) +export type DbEntityRequest = { + locationId?: string; + entity: Entity; + relations: EntityRelationSpec[]; +}; + +// @public (undocumented) +export type DbEntityResponse = { + locationId?: string; + entity: Entity; +}; + +// @public (undocumented) +export class DefaultCatalogCollator implements DocumentCollator { + constructor({ + discovery, + locationTemplate, + }: { + discovery: PluginEndpointDiscovery; + locationTemplate?: string; + }); + // (undocumented) + protected applyArgsToFormat( + format: string, + args: Record, + ): string; + // (undocumented) + protected discovery: PluginEndpointDiscovery; + // (undocumented) + execute(): Promise; + // (undocumented) + protected locationTemplate: string; + // (undocumented) + readonly type: string; +} + +// @public (undocumented) +export class DefaultCatalogProcessingOrchestrator + implements CatalogProcessingOrchestrator { + constructor(options: { + processors: CatalogProcessor[]; + integrations: ScmIntegrationRegistry; + logger: Logger_2; + parser: CatalogProcessorParser; + policy: EntityPolicy; + }); + // (undocumented) + process(request: EntityProcessingRequest): Promise; +} + +// @public +export function durationText(startTimestamp: [number, number]): string; + +// @public (undocumented) +export type EntitiesCatalog = { + entities(request?: EntitiesRequest): Promise; + removeEntityByUid(uid: string): Promise; + batchAddOrUpdateEntities( + requests: EntityUpsertRequest[], + options?: { + locationId?: string; + dryRun?: boolean; + outputEntities?: boolean; + }, + ): Promise; +}; + +// @public +export type EntitiesSearchFilter = { + key: string; + matchValueIn?: string[]; +}; + +// @public (undocumented) +function entity( + atLocation: LocationSpec, + newEntity: Entity, +): CatalogProcessorResult; + +// @public +export type EntityFilter = { + anyOf: { + allOf: EntitiesSearchFilter[]; + }[]; +}; + +// @public +export type EntityPagination = { + limit?: number; + offset?: number; + after?: string; +}; + +// @public (undocumented) +export type EntityProcessingRequest = { + entity: Entity; + state: Map; +}; + +// @public (undocumented) +export type EntityProcessingResult = + | { + ok: true; + state: Map; + completedEntity: Entity; + deferredEntities: DeferredEntity[]; + relations: EntityRelationSpec[]; + errors: Error[]; + } + | { + ok: false; + errors: Error[]; + }; + +// @public (undocumented) +export class FileReaderProcessor implements CatalogProcessor { + // (undocumented) + readLocation( + location: LocationSpec, + optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public (undocumented) +function generalError( + atLocation: LocationSpec, + message: string, +): CatalogProcessorResult; + +// @public +export class GithubDiscoveryProcessor implements CatalogProcessor { + constructor(options: { integrations: ScmIntegrations; logger: Logger_2 }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + }, + ): GithubDiscoveryProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @alpha +export class GithubMultiOrgReaderProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrations; + logger: Logger_2; + orgs: GithubMultiOrgConfig; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + }, + ): GithubMultiOrgReaderProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public +export class GithubOrgReaderProcessor implements CatalogProcessor { + constructor(options: { integrations: ScmIntegrations; logger: Logger_2 }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger_2; + }, + ): GithubOrgReaderProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public (undocumented) +export type HigherOrderOperation = { + addLocation( + spec: LocationSpec, + options?: { + dryRun?: boolean; + }, + ): Promise; + refreshAllLocations(): Promise; +}; + +// @public +export class HigherOrderOperations implements HigherOrderOperation { + constructor( + entitiesCatalog: EntitiesCatalog, + locationsCatalog: LocationsCatalog, + locationReader: LocationReader, + logger: Logger_2, + ); + addLocation( + spec: LocationSpec, + options?: { + dryRun?: boolean; + }, + ): Promise; + refreshAllLocations(): Promise; +} + +// @public (undocumented) +function inputError( + atLocation: LocationSpec, + message: string, +): CatalogProcessorResult; + +// @public (undocumented) +function location_2( + newLocation: LocationSpec, + optional: boolean, +): CatalogProcessorResult; + +// @public (undocumented) +export type LocationAnalyzer = { + analyzeLocation( + location: AnalyzeLocationRequest, + ): Promise; +}; + +// @public (undocumented) +export class LocationEntityProcessor implements CatalogProcessor { + constructor(options: Options_3); + // (undocumented) + postProcessEntity( + entity: Entity, + location: LocationSpec, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public (undocumented) +export type LocationReader = { + read(location: LocationSpec): Promise; +}; + +// @public +export class LocationReaders implements LocationReader { + constructor(options: Options); + // (undocumented) + read(location: LocationSpec): Promise; +} + +// @public (undocumented) +export type LocationsCatalog = { + addLocation(location: Location_2): Promise; + removeLocation(id: string): Promise; + locations(): Promise; + location(id: string): Promise; + locationHistory(id: string): Promise; + logUpdateSuccess( + locationId: string, + entityName?: string | string[], + ): Promise; + logUpdateFailure( + locationId: string, + error?: Error, + entityName?: string, + ): Promise; +}; + +// @public +export class NextCatalogBuilder { + constructor(env: CatalogEnvironment_2); + addEntityPolicy(...policies: EntityPolicy[]): NextCatalogBuilder; + addEntityProvider(...providers: EntityProvider[]): NextCatalogBuilder; + addProcessor(...processors: CatalogProcessor[]): NextCatalogBuilder; + build(): Promise<{ + entitiesCatalog: EntitiesCatalog; + locationsCatalog: LocationsCatalog; + locationAnalyzer: LocationAnalyzer; + processingEngine: CatalogProcessingEngine; + locationService: LocationService; + }>; + replaceEntityPolicies(policies: EntityPolicy[]): NextCatalogBuilder; + replaceProcessors(processors: CatalogProcessor[]): NextCatalogBuilder; + setEntityDataParser(parser: CatalogProcessorParser): NextCatalogBuilder; + setFieldFormatValidators(validators: Partial): NextCatalogBuilder; + setPlaceholderResolver( + key: string, + resolver: PlaceholderResolver, + ): NextCatalogBuilder; + setRefreshIntervalSeconds(seconds: number): NextCatalogBuilder; +} + +// @public (undocumented) +function notFoundError( + atLocation: LocationSpec, + message: string, +): CatalogProcessorResult; + +// @public (undocumented) +export function parseEntityYaml( + data: Buffer, + location: LocationSpec, +): Iterable; + +// @public +export class PlaceholderProcessor implements CatalogProcessor { + constructor(options: Options_4); + // (undocumented) + preProcessEntity(entity: Entity, location: LocationSpec): Promise; +} + +// @public (undocumented) +export type PlaceholderResolver = ( + params: ResolverParams, +) => Promise; + +// @public (undocumented) +export type ReadLocationEntity = { + location: LocationSpec; + entity: Entity; + relations: EntityRelationSpec[]; +}; + +// @public (undocumented) +export type ReadLocationError = { + location: LocationSpec; + error: Error; +}; + +// @public (undocumented) +export type ReadLocationResult = { + entities: ReadLocationEntity[]; + errors: ReadLocationError[]; +}; + +// @public +export type RecursivePartial = { + [P in keyof T]?: T[P] extends (infer U)[] + ? RecursivePartial[] + : T[P] extends object + ? RecursivePartial + : T[P]; +}; + +// @public (undocumented) +function relation(spec: EntityRelationSpec): CatalogProcessorResult; + +declare namespace results { + export { + notFoundError, + inputError, + generalError, + location_2 as location, + entity, + relation, + }; +} +export { results }; + +// @public (undocumented) +export interface RouterOptions { + // (undocumented) + config: Config; + // (undocumented) + entitiesCatalog?: EntitiesCatalog; + // (undocumented) + higherOrderOperation?: HigherOrderOperation; + // (undocumented) + locationAnalyzer?: LocationAnalyzer; + // (undocumented) + locationsCatalog?: LocationsCatalog; + // (undocumented) + locationService?: LocationService; + // (undocumented) + logger: Logger_2; +} + +// @public +export function runPeriodically(fn: () => any, delayMs: number): () => void; + +// @public (undocumented) +export class StaticLocationProcessor implements StaticLocationProcessor { + constructor(staticLocations: LocationSpec[]); + // (undocumented) + static fromConfig(config: Config): StaticLocationProcessor; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public +export type Transaction = { + rollback(): Promise; +}; + +// @public (undocumented) +export class UrlReaderProcessor implements CatalogProcessor { + constructor(options: Options_5); + // (undocumented) + readLocation( + location: LocationSpec, + optional: boolean, + emit: CatalogProcessorEmit, + parser: CatalogProcessorParser, + ): Promise; +} + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 9ee7aeb7a6..a3d0ff14da 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -46,7 +46,7 @@ "express": "^4.17.1", "express-promise-router": "^4.1.0", "fast-json-stable-stringify": "^2.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "git-url-parse": "~11.4.4", "glob": "^7.1.6", "knex": "^0.95.1", diff --git a/plugins/catalog-graphql/api-report.md b/plugins/catalog-graphql/api-report.md index 40e8a19b66..67beee09da 100644 --- a/plugins/catalog-graphql/api-report.md +++ b/plugins/catalog-graphql/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import { GraphQLModule } from '@graphql-modules/core'; import { Logger as Logger_2 } from 'winston'; @@ -13,13 +12,11 @@ export function createModule(options: ModuleOptions): Promise; // @public (undocumented) export interface ModuleOptions { - // (undocumented) - config: Config; - // (undocumented) - logger: Logger_2; + // (undocumented) + config: Config; + // (undocumented) + logger: Logger_2; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/catalog-import/api-report.md b/plugins/catalog-import/api-report.md index f388c24a55..808d8f1909 100644 --- a/plugins/catalog-import/api-report.md +++ b/plugins/catalog-import/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -27,36 +28,50 @@ import { UseFormMethods } from 'react-hook-form'; import { UseFormOptions } from 'react-hook-form'; // @public (undocumented) -export type AnalyzeResult = { - type: 'locations'; - locations: Array<{ +export type AnalyzeResult = + | { + type: 'locations'; + locations: Array<{ target: string; entities: EntityName[]; - }>; -} | { - type: 'repository'; - url: string; - integrationType: string; - generatedEntities: PartialEntity[]; -}; + }>; + } + | { + type: 'repository'; + url: string; + integrationType: string; + generatedEntities: PartialEntity[]; + }; // @public (undocumented) -export const AutocompleteTextField: ({ name, options, required, control, errors, rules, loading, loadingText, helperText, errorHelperText, textFieldProps, }: Props_4) => JSX.Element; +export const AutocompleteTextField: ({ + name, + options, + required, + control, + errors, + rules, + loading, + loadingText, + helperText, + errorHelperText, + textFieldProps, +}: Props_4) => JSX.Element; // @public (undocumented) export interface CatalogImportApi { - // (undocumented) - analyzeUrl(url: string): Promise; - // (undocumented) - submitPullRequest(options: { - repositoryUrl: string; - fileContent: string; - title: string; - body: string; - }): Promise<{ - link: string; - location: string; - }>; + // (undocumented) + analyzeUrl(url: string): Promise; + // (undocumented) + submitPullRequest(options: { + repositoryUrl: string; + fileContent: string; + title: string; + body: string; + }): Promise<{ + link: string; + location: string; + }>; } // @public (undocumented) @@ -64,67 +79,111 @@ export const catalogImportApiRef: ApiRef; // @public (undocumented) export class CatalogImportClient implements CatalogImportApi { - constructor(options: { - discoveryApi: DiscoveryApi; - githubAuthApi: OAuthApi; - identityApi: IdentityApi; - scmIntegrationsApi: ScmIntegrationRegistry; - catalogApi: CatalogApi; - }); - // (undocumented) - analyzeUrl(url: string): Promise; - // (undocumented) - submitPullRequest({ repositoryUrl, fileContent, title, body, }: { - repositoryUrl: string; - fileContent: string; - title: string; - body: string; - }): Promise<{ - link: string; - location: string; - }>; + constructor(options: { + discoveryApi: DiscoveryApi; + githubAuthApi: OAuthApi; + identityApi: IdentityApi; + scmIntegrationsApi: ScmIntegrationRegistry; + catalogApi: CatalogApi; + }); + // (undocumented) + analyzeUrl(url: string): Promise; + // (undocumented) + submitPullRequest({ + repositoryUrl, + fileContent, + title, + body, + }: { + repositoryUrl: string; + fileContent: string; + title: string; + body: string; + }): Promise<{ + link: string; + location: string; + }>; } // @public (undocumented) export const CatalogImportPage: (opts: StepperProviderOpts) => JSX.Element; // @public (undocumented) -const catalogImportPlugin: BackstagePlugin<{ +const catalogImportPlugin: BackstagePlugin< + { importPage: RouteRef; -}, {}>; - -export { catalogImportPlugin } - -export { catalogImportPlugin as plugin } + }, + {} +>; +export { catalogImportPlugin }; +export { catalogImportPlugin as plugin }; // @public -export function defaultGenerateStepper(flow: ImportFlows, defaults: StepperProvider): StepperProvider; +export function defaultGenerateStepper( + flow: ImportFlows, + defaults: StepperProvider, +): StepperProvider; // @public (undocumented) -export const EntityListComponent: ({ locations, collapsed, locationListItemIcon, onItemClick, firstListItem, withLinks, }: Props_2) => JSX.Element; +export const EntityListComponent: ({ + locations, + collapsed, + locationListItemIcon, + onItemClick, + firstListItem, + withLinks, +}: Props_2) => JSX.Element; // @public (undocumented) -export const ImportStepper: ({ initialUrl, generateStepper, variant, opts, }: Props) => JSX.Element; +export const ImportStepper: ({ + initialUrl, + generateStepper, + variant, + opts, +}: Props) => JSX.Element; // @public -export const PreparePullRequestForm: >({ defaultValues, onSubmit, render, }: Props_5) => JSX.Element; +export const PreparePullRequestForm: < + TFieldValues extends Record +>({ + defaultValues, + onSubmit, + render, +}: Props_5) => JSX.Element; // @public (undocumented) -export const PreviewCatalogInfoComponent: ({ repositoryUrl, entities, classes, }: Props_6) => JSX.Element; +export const PreviewCatalogInfoComponent: ({ + repositoryUrl, + entities, + classes, +}: Props_6) => JSX.Element; // @public (undocumented) -export const PreviewPullRequestComponent: ({ title, description, classes, }: Props_7) => JSX.Element; +export const PreviewPullRequestComponent: ({ + title, + description, + classes, +}: Props_7) => JSX.Element; // @public (undocumented) export const Router: (opts: StepperProviderOpts) => JSX.Element; // @public -export const StepInitAnalyzeUrl: ({ onAnalysis, analysisUrl, disablePullRequest, }: Props_3) => JSX.Element; +export const StepInitAnalyzeUrl: ({ + onAnalysis, + analysisUrl, + disablePullRequest, +}: Props_3) => JSX.Element; // @public (undocumented) -export const StepPrepareCreatePullRequest: ({ analyzeResult, onPrepare, onGoBack, renderFormFields, defaultTitle, defaultBody, }: Props_8) => JSX.Element; - +export const StepPrepareCreatePullRequest: ({ + analyzeResult, + onPrepare, + onGoBack, + renderFormFields, + defaultTitle, + defaultBody, +}: Props_8) => JSX.Element; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md new file mode 100644 index 0000000000..4cc6a017aa --- /dev/null +++ b/plugins/catalog-react/api-report.md @@ -0,0 +1,673 @@ +## API Report File for "@backstage/plugin-catalog-react" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { ApiRef } from '@backstage/core-plugin-api'; +import { AsyncState } from 'react-use/lib/useAsync'; +import { CatalogApi } from '@backstage/catalog-client'; +import { ComponentEntity } from '@backstage/catalog-model'; +import { Context } from 'react'; +import { Entity } from '@backstage/catalog-model'; +import { EntityName } from '@backstage/catalog-model'; +import { LinkProps } from '@backstage/core-components'; +import { PropsWithChildren } from 'react'; +import { default as React_2 } from 'react'; +import { ReactNode } from 'react'; +import { RouteRef } from '@backstage/core-plugin-api'; +import { ScmIntegrationRegistry } from '@backstage/integration'; +import { SystemEntity } from '@backstage/catalog-model'; +import { TableColumn } from '@backstage/core-components'; +import { UserEntity } from '@backstage/catalog-model'; + +export { CatalogApi }; + +// @public (undocumented) +export const catalogApiRef: ApiRef; + +// @public (undocumented) +export const catalogRouteRef: RouteRef; + +// @public (undocumented) +function createDomainColumn(): TableColumn; + +// @public (undocumented) +function createEntityRefColumn({ + defaultKind, +}: { + defaultKind?: string; +}): TableColumn; + +// @public (undocumented) +function createEntityRelationColumn({ + title, + relation, + defaultKind, + filter: entityFilter, +}: { + title: string; + relation: string; + defaultKind?: string; + filter?: { + kind: string; + }; +}): TableColumn; + +// @public (undocumented) +function createMetadataDescriptionColumn(): TableColumn; + +// @public (undocumented) +function createOwnerColumn(): TableColumn; + +// @public (undocumented) +function createSpecLifecycleColumn(): TableColumn; + +// @public (undocumented) +function createSpecTypeColumn(): TableColumn; + +// @public (undocumented) +function createSystemColumn(): TableColumn; + +// @public (undocumented) +export type DefaultEntityFilters = { + kind?: EntityKindFilter; + type?: EntityTypeFilter; + user?: UserListFilter; + owners?: EntityOwnerFilter; + lifecycles?: EntityLifecycleFilter; + tags?: EntityTagFilter; + text?: EntityTextFilter; +}; + +// @public (undocumented) +export const EntityContext: Context; + +// @public (undocumented) +export type EntityFilter = { + getCatalogFilters?: () => Record; + filterEntity?: (entity: Entity) => boolean; + toQueryValue?: () => string | string[]; +}; + +// @public (undocumented) +export class EntityKindFilter implements EntityFilter { + constructor(value: string); + // (undocumented) + getCatalogFilters(): Record; + // (undocumented) + toQueryValue(): string; + // (undocumented) + readonly value: string; +} + +// @public (undocumented) +export const EntityKindPicker: ({ + initialFilter, + hidden, +}: EntityKindFilterProps) => JSX.Element | null; + +// @public (undocumented) +export class EntityLifecycleFilter implements EntityFilter { + constructor(values: string[]); + // (undocumented) + filterEntity(entity: Entity): boolean; + // (undocumented) + toQueryValue(): string[]; + // (undocumented) + readonly values: string[]; +} + +// @public (undocumented) +export const EntityLifecyclePicker: () => JSX.Element | null; + +// @public (undocumented) +export const EntityListContext: React_2.Context< + EntityListContextProps | undefined +>; + +// @public (undocumented) +export const EntityListProvider: ({ + children, +}: PropsWithChildren<{}>) => JSX.Element; + +// @public (undocumented) +export class EntityOwnerFilter implements EntityFilter { + constructor(values: string[]); + // (undocumented) + filterEntity(entity: Entity): boolean; + // (undocumented) + toQueryValue(): string[]; + // (undocumented) + readonly values: string[]; +} + +// @public (undocumented) +export const EntityOwnerPicker: () => JSX.Element | null; + +// @public (undocumented) +export const EntityProvider: ({ + entity, + children, +}: EntityProviderProps) => JSX.Element; + +// @public (undocumented) +export const EntityRefLink: React_2.ForwardRefExoticComponent< + Pick< + EntityRefLinkProps, + | 'replace' + | 'media' + | 'hidden' + | 'dir' + | 'slot' + | 'style' + | 'title' + | 'color' + | 'underline' + | 'display' + | 'translate' + | 'prefix' + | 'children' + | 'key' + | 'id' + | 'classes' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'draggable' + | 'lang' + | 'placeholder' + | 'spellCheck' + | 'tabIndex' + | 'radioGroup' + | 'role' + | 'about' + | 'datatype' + | 'inlist' + | 'property' + | 'resource' + | 'typeof' + | 'vocab' + | 'autoCapitalize' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'inputMode' + | 'is' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerEnterCapture' + | 'onPointerLeave' + | 'onPointerLeaveCapture' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'component' + | 'variant' + | 'innerRef' + | 'download' + | 'href' + | 'hrefLang' + | 'ping' + | 'rel' + | 'target' + | 'type' + | 'referrerPolicy' + | 'noWrap' + | 'gutterBottom' + | 'paragraph' + | 'align' + | 'variantMapping' + | 'state' + | 'TypographyClasses' + | 'entityRef' + | 'defaultKind' + > & + React_2.RefAttributes +>; + +// @public (undocumented) +export const EntityRefLinks: ({ + entityRefs, + defaultKind, + ...linkProps +}: EntityRefLinksProps) => JSX.Element; + +// @public (undocumented) +export const entityRoute: RouteRef<{ + name: string; + kind: string; + namespace: string; +}>; + +// @public (undocumented) +export function entityRouteParams( + entity: Entity, +): { + readonly kind: string; + readonly namespace: string; + readonly name: string; +}; + +// @public (undocumented) +export const entityRouteRef: RouteRef<{ + name: string; + kind: string; + namespace: string; +}>; + +// @public (undocumented) +export const EntitySearchBar: () => JSX.Element; + +// @public (undocumented) +export type EntitySourceLocation = { + locationTargetUrl: string; + integrationType?: string; +}; + +// @public (undocumented) +export function EntityTable({ + entities, + title, + emptyContent, + variant, + columns, +}: Props): JSX.Element; + +// @public (undocumented) +export namespace EntityTable { + var // (undocumented) + columns: typeof columnFactories; + var // (undocumented) + systemEntityColumns: TableColumn[]; + var // (undocumented) + componentEntityColumns: TableColumn[]; +} + +// @public (undocumented) +export class EntityTagFilter implements EntityFilter { + constructor(values: string[]); + // (undocumented) + filterEntity(entity: Entity): boolean; + // (undocumented) + toQueryValue(): string[]; + // (undocumented) + readonly values: string[]; +} + +// @public (undocumented) +export const EntityTagPicker: () => JSX.Element | null; + +// @public (undocumented) +export class EntityTextFilter implements EntityFilter { + constructor(value: string); + // (undocumented) + filterEntity(entity: Entity): boolean; + // (undocumented) + readonly value: string; +} + +// @public (undocumented) +export class EntityTypeFilter implements EntityFilter { + constructor(value: string | string[]); + // (undocumented) + getCatalogFilters(): Record; + // (undocumented) + getTypes(): string[]; + // (undocumented) + toQueryValue(): string[]; + // (undocumented) + readonly value: string | string[]; +} + +// @public (undocumented) +export const EntityTypePicker: () => JSX.Element | null; + +// @public (undocumented) +export function formatEntityRefTitle( + entityRef: Entity | EntityName, + opts?: { + defaultKind?: string; + }, +): string; + +// @public (undocumented) +export function getEntityMetadataEditUrl(entity: Entity): string | undefined; + +// @public (undocumented) +export function getEntityMetadataViewUrl(entity: Entity): string | undefined; + +// @public +export function getEntityRelations( + entity: Entity | undefined, + relationType: string, + filter?: { + kind: string; + }, +): EntityName[]; + +// @public (undocumented) +export function getEntitySourceLocation( + entity: Entity, + scmIntegrationsApi: ScmIntegrationRegistry, +): EntitySourceLocation | undefined; + +// @public +export function isOwnerOf(owner: Entity, owned: Entity): boolean; + +// @public (undocumented) +export const MockEntityListContextProvider: ({ + children, + value, +}: React_2.PropsWithChildren<{ + value: Partial; +}>) => JSX.Element; + +// @public (undocumented) +export function reduceCatalogFilters( + filters: EntityFilter[], +): Record; + +// @public (undocumented) +export function reduceEntityFilters( + filters: EntityFilter[], +): (entity: Entity) => boolean; + +// @public (undocumented) +export const rootRoute: RouteRef; + +// @public +export function useEntity(): { + entity: T; + loading: boolean; + error: Error | undefined; +}; + +// @public +export const useEntityCompoundName: () => { + kind: string; + namespace: string; + name: string; +}; + +// @public (undocumented) +export const useEntityFromUrl: () => EntityLoadingStatus; + +// @public (undocumented) +export function useEntityListProvider< + EntityFilters extends DefaultEntityFilters = DefaultEntityFilters +>(): EntityListContextProps; + +// @public +export function useEntityTypeFilter(): EntityTypeReturn; + +// @public +export function useOwnUser(): AsyncState; + +// @public (undocumented) +export function useRelatedEntities( + entity: Entity, + { + type, + kind, + }: { + type?: string; + kind?: string; + }, +): { + entities: Entity[] | undefined; + loading: boolean; + error: Error | undefined; +}; + +// @public (undocumented) +export class UserListFilter implements EntityFilter { + constructor( + value: UserListFilterKind, + user: UserEntity | undefined, + isStarredEntity: (entity: Entity) => boolean, + ); + // (undocumented) + filterEntity(entity: Entity): boolean; + // (undocumented) + readonly isStarredEntity: (entity: Entity) => boolean; + // (undocumented) + toQueryValue(): string; + // (undocumented) + readonly user: UserEntity | undefined; + // (undocumented) + readonly value: UserListFilterKind; +} + +// @public (undocumented) +export type UserListFilterKind = 'owned' | 'starred' | 'all'; + +// @public (undocumented) +export const UserListPicker: ({ + initialFilter, + availableFilters, +}: UserListPickerProps) => JSX.Element; + +// @public (undocumented) +export const useStarredEntities: () => { + starredEntities: Set; + toggleStarredEntity: (entity: Entity) => void; + isStarredEntity: (entity: Entity) => boolean; +}; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md new file mode 100644 index 0000000000..86b2322246 --- /dev/null +++ b/plugins/catalog/api-report.md @@ -0,0 +1,239 @@ +## API Report File for "@backstage/plugin-catalog" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { Entity } from '@backstage/catalog-model'; +import { EntityName } from '@backstage/catalog-model'; +import { ExternalRouteRef } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/core-plugin-api'; +import { InfoCardVariants } from '@backstage/core-components'; +import { PropsWithChildren } from 'react'; +import { default as React_2 } from 'react'; +import { ReactNode } from 'react'; +import { RouteRef } from '@backstage/core-plugin-api'; +import { TableColumn } from '@backstage/core-components'; +import { TableProps } from '@backstage/core-components'; +import { TabProps } from '@material-ui/core'; +import { UserListFilterKind } from '@backstage/plugin-catalog-react'; + +// @public (undocumented) +export function AboutCard({ variant }: AboutCardProps): JSX.Element; + +// @public (undocumented) +export const AboutContent: ({ entity }: Props_2) => JSX.Element; + +// @public (undocumented) +export const AboutField: ({ + label, + value, + gridSizes, + children, +}: Props_3) => JSX.Element; + +// @public (undocumented) +export const CatalogEntityPage: () => JSX.Element; + +// @public (undocumented) +export const CatalogIndexPage: ({ + initiallySelectedFilter, + columns, + actions, +}: CatalogPageProps) => JSX.Element; + +// @public (undocumented) +export const CatalogLayout: ({ children }: Props) => JSX.Element; + +// @public (undocumented) +const catalogPlugin: BackstagePlugin< + { + catalogIndex: RouteRef; + catalogEntity: RouteRef<{ + name: string; + kind: string; + namespace: string; + }>; + }, + { + createComponent: ExternalRouteRef; + } +>; +export { catalogPlugin }; +export { catalogPlugin as plugin }; + +// @public (undocumented) +export const CatalogResultListItem: ({ result }: any) => JSX.Element; + +// @public (undocumented) +export const CatalogTable: { + ({ columns, actions }: CatalogTableProps): JSX.Element; + columns: typeof columnFactories; +}; + +// @public (undocumented) +export type CatalogTableRow = { + entity: Entity; + resolved: { + name: string; + partOfSystemRelationTitle?: string; + partOfSystemRelations: EntityName[]; + ownedByRelationsTitle?: string; + ownedByRelations: EntityName[]; + }; +}; + +// @public (undocumented) +export const CreateComponentButton: () => JSX.Element | null; + +// @public (undocumented) +export function createMetadataDescriptionColumn(): TableColumn; + +// @public (undocumented) +export function createNameColumn( + props?: NameColumnProps, +): TableColumn; + +// @public (undocumented) +export function createOwnerColumn(): TableColumn; + +// @public (undocumented) +export function createSpecLifecycleColumn(): TableColumn; + +// @public (undocumented) +export function createSpecTypeColumn(): TableColumn; + +// @public (undocumented) +export function createSystemColumn(): TableColumn; + +// @public (undocumented) +export function createTagsColumn(): TableColumn; + +// @public (undocumented) +export const EntityAboutCard: AboutCard; + +// @public (undocumented) +export const EntityDependencyOfComponentsCard: ({ + variant, + title, +}: { + variant?: 'gridItem' | undefined; + title?: string | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const EntityDependsOnComponentsCard: ({ + variant, + title, +}: { + variant?: 'gridItem' | undefined; + title?: string | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const EntityDependsOnResourcesCard: ({ + variant, +}: { + variant?: 'gridItem' | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const EntityHasComponentsCard: ({ + variant, +}: { + variant?: 'gridItem' | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const EntityHasResourcesCard: ({ + variant, +}: { + variant?: 'gridItem' | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const EntityHasSubcomponentsCard: ({ + variant, +}: { + variant?: 'gridItem' | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const EntityHasSystemsCard: ({ + variant, +}: { + variant?: 'gridItem' | undefined; +}) => JSX.Element; + +// @public +export const EntityLayout: { + ({ + UNSTABLE_extraContextMenuItems, + UNSTABLE_contextMenuOptions, + children, + }: EntityLayoutProps): JSX.Element; + Route: (props: SubRoute) => null; +}; + +// @public (undocumented) +export const EntityLinksCard: ({ + cols, + variant, +}: { + entity?: Entity | undefined; + cols?: number | ColumnBreakpoints | undefined; + variant?: 'gridItem' | undefined; +}) => JSX.Element; + +// @public +export const EntityOrphanWarning: () => JSX.Element; + +// @public (undocumented) +export const EntityPageLayout: { + ({ + children, + UNSTABLE_extraContextMenuItems, + UNSTABLE_contextMenuOptions, + }: EntityPageLayoutProps): JSX.Element; + Content: (_props: { + path: string; + title: string; + element: JSX.Element; + }) => null; +}; + +// @public (undocumented) +export const EntitySwitch: { + ({ children }: PropsWithChildren<{}>): JSX.Element | null; + Case: (_: { + if?: ((entity: Entity) => boolean) | undefined; + children: ReactNode; + }) => null; +}; + +// @public (undocumented) +export const EntitySystemDiagramCard: SystemDiagramCard; + +// @public (undocumented) +export function isComponentType(type: string): (entity: Entity) => boolean; + +// @public (undocumented) +export function isKind(kind: string): (entity: Entity) => boolean; + +// @public (undocumented) +export function isNamespace(namespace: string): (entity: Entity) => boolean; + +// @public (undocumented) +export const isOrphan: (entity: Entity) => boolean; + +// @public (undocumented) +export const Router: ({ + EntityPage, +}: { + EntityPage?: React_2.ComponentType<{}> | undefined; +}) => JSX.Element; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx index 05d93078b4..f8a724c9d7 100644 --- a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx +++ b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx @@ -44,13 +44,20 @@ type ExtraContextMenuItem = { onClick: () => void; }; +// unstable context menu option, eg: disable the unregister entity menu +type contextMenuOptions = { + disableUnregister: boolean; +}; + type Props = { UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[]; + UNSTABLE_contextMenuOptions?: contextMenuOptions; onUnregisterEntity: () => void; }; export const EntityContextMenu = ({ UNSTABLE_extraContextMenuItems, + UNSTABLE_contextMenuOptions, onUnregisterEntity, }: Props) => { const [anchorEl, setAnchorEl] = useState(); @@ -82,6 +89,9 @@ export const EntityContextMenu = ({ , ]; + const disableUnregister = + UNSTABLE_contextMenuOptions?.disableUnregister ?? false; + return ( <> diff --git a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx index 9513050400..9cb0b7c961 100644 --- a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx +++ b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx @@ -132,8 +132,14 @@ type ExtraContextMenuItem = { onClick: () => void; }; +// unstable context menu option, eg: disable the unregister entity menu +type contextMenuOptions = { + disableUnregister: boolean; +}; + type EntityLayoutProps = { UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[]; + UNSTABLE_contextMenuOptions?: contextMenuOptions; children?: React.ReactNode; }; @@ -154,6 +160,7 @@ type EntityLayoutProps = { */ export const EntityLayout = ({ UNSTABLE_extraContextMenuItems, + UNSTABLE_contextMenuOptions, children, }: EntityLayoutProps) => { const { kind, namespace, name } = useEntityCompoundName(); @@ -210,6 +217,7 @@ export const EntityLayout = ({ diff --git a/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx b/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx index 99052e51f0..4abac4e01b 100644 --- a/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx +++ b/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx @@ -112,14 +112,21 @@ type ExtraContextMenuItem = { onClick: () => void; }; +// unstable context menu option, eg: disable the unregister entity menu +type contextMenuOptions = { + disableUnregister: boolean; +}; + type EntityPageLayoutProps = { UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[]; + UNSTABLE_contextMenuOptions?: contextMenuOptions; children?: React.ReactNode; }; export const EntityPageLayout = ({ children, UNSTABLE_extraContextMenuItems, + UNSTABLE_contextMenuOptions, }: EntityPageLayoutProps) => { const { kind, namespace, name } = useEntityCompoundName(); const { entity, loading, error } = useContext(EntityContext); @@ -152,6 +159,7 @@ export const EntityPageLayout = ({ diff --git a/plugins/circleci/api-report.md b/plugins/circleci/api-report.md index 00b575efb8..7bb1b7766a 100644 --- a/plugins/circleci/api-report.md +++ b/plugins/circleci/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -17,29 +18,41 @@ import { GitType } from 'circleci-api'; import { Me } from 'circleci-api'; import { RouteRef } from '@backstage/core-plugin-api'; -export { BuildStepAction } +export { BuildStepAction }; -export { BuildSummary } +export { BuildSummary }; -export { BuildWithSteps } +export { BuildWithSteps }; // @public (undocumented) -export const CIRCLECI_ANNOTATION = "circleci.com/project-slug"; +export const CIRCLECI_ANNOTATION = 'circleci.com/project-slug'; // @public (undocumented) export class CircleCIApi { - constructor(options: Options); - // (undocumented) - getBuild(buildNumber: number, options: Partial): Promise; - // (undocumented) - getBuilds({ limit, offset }: { - limit: number; - offset: number; - }, options: Partial): Promise; - // (undocumented) - getUser(options: Partial): Promise; - // (undocumented) - retry(buildNumber: number, options: Partial): Promise; + constructor(options: Options); + // (undocumented) + getBuild( + buildNumber: number, + options: Partial, + ): Promise; + // (undocumented) + getBuilds( + { + limit, + offset, + }: { + limit: number; + offset: number; + }, + options: Partial, + ): Promise; + // (undocumented) + getUser(options: Partial): Promise; + // (undocumented) + retry( + buildNumber: number, + options: Partial, + ): Promise; } // @public (undocumented) @@ -50,32 +63,26 @@ export const circleCIBuildRouteRef: RouteRef; // @public (undocumented) const circleCIPlugin: BackstagePlugin<{}, {}>; - -export { circleCIPlugin } - -export { circleCIPlugin as plugin } +export { circleCIPlugin }; +export { circleCIPlugin as plugin }; // @public (undocumented) export const circleCIRouteRef: RouteRef; // @public (undocumented) export const EntityCircleCIContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; -export { GitType } +export { GitType }; // @public (undocumented) const isCircleCIAvailable: (entity: Entity) => boolean; - -export { isCircleCIAvailable } - -export { isCircleCIAvailable as isPluginApplicableToEntity } +export { isCircleCIAvailable }; +export { isCircleCIAvailable as isPluginApplicableToEntity }; // @public (undocumented) export const Router: (_props: Props) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/cloudbuild/api-report.md b/plugins/cloudbuild/api-report.md index 2ebc1eb737..8c2d7876b2 100644 --- a/plugins/cloudbuild/api-report.md +++ b/plugins/cloudbuild/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -12,62 +13,71 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type ActionsGetWorkflowResponseData = { - id: string; - status: string; - source: Source; - createTime: string; - startTime: string; - steps: Step[]; - timeout: string; - projectId: string; - logsBucket: string; - sourceProvenance: SourceProvenance; - buildTriggerId: string; - options: Options; - logUrl: string; - substitutions: Substitutions; - tags: string[]; - queueTtl: string; - name: string; - finishTime: any; - results: Results; - timing: Timing2; + id: string; + status: string; + source: Source; + createTime: string; + startTime: string; + steps: Step[]; + timeout: string; + projectId: string; + logsBucket: string; + sourceProvenance: SourceProvenance; + buildTriggerId: string; + options: Options; + logUrl: string; + substitutions: Substitutions; + tags: string[]; + queueTtl: string; + name: string; + finishTime: any; + results: Results; + timing: Timing2; }; // @public (undocumented) export interface ActionsListWorkflowRunsForRepoResponseData { - // (undocumented) - builds: ActionsGetWorkflowResponseData[]; + // (undocumented) + builds: ActionsGetWorkflowResponseData[]; } // @public (undocumented) export interface BUILD { - // (undocumented) - endTime: string; - // (undocumented) - startTime: string; + // (undocumented) + endTime: string; + // (undocumented) + startTime: string; } // @public (undocumented) -export const CLOUDBUILD_ANNOTATION = "google.com/cloudbuild-project-slug"; +export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; // @public (undocumented) export type CloudbuildApi = { - listWorkflowRuns: (request: { - projectId: string; - }) => Promise; - getWorkflow: ({ projectId, id, }: { - projectId: string; - id: string; - }) => Promise; - getWorkflowRun: ({ projectId, id, }: { - projectId: string; - id: string; - }) => Promise; - reRunWorkflow: ({ projectId, runId, }: { - projectId: string; - runId: string; - }) => Promise; + listWorkflowRuns: (request: { + projectId: string; + }) => Promise; + getWorkflow: ({ + projectId, + id, + }: { + projectId: string; + id: string; + }) => Promise; + getWorkflowRun: ({ + projectId, + id, + }: { + projectId: string; + id: string; + }) => Promise; + reRunWorkflow: ({ + projectId, + runId, + }: { + projectId: string; + runId: string; + }) => Promise; }; // @public (undocumented) @@ -75,119 +85,137 @@ export const cloudbuildApiRef: ApiRef; // @public (undocumented) export class CloudbuildClient implements CloudbuildApi { - constructor(googleAuthApi: OAuthApi); - // (undocumented) - getToken(): Promise; - // (undocumented) - getWorkflow({ projectId, id, }: { - projectId: string; - id: string; - }): Promise; - // (undocumented) - getWorkflowRun({ projectId, id, }: { - projectId: string; - id: string; - }): Promise; - // (undocumented) - listWorkflowRuns({ projectId, }: { - projectId: string; - }): Promise; - // (undocumented) - reRunWorkflow({ projectId, runId, }: { - projectId: string; - runId: string; - }): Promise; + constructor(googleAuthApi: OAuthApi); + // (undocumented) + getToken(): Promise; + // (undocumented) + getWorkflow({ + projectId, + id, + }: { + projectId: string; + id: string; + }): Promise; + // (undocumented) + getWorkflowRun({ + projectId, + id, + }: { + projectId: string; + id: string; + }): Promise; + // (undocumented) + listWorkflowRuns({ + projectId, + }: { + projectId: string; + }): Promise; + // (undocumented) + reRunWorkflow({ + projectId, + runId, + }: { + projectId: string; + runId: string; + }): Promise; } // @public (undocumented) -const cloudbuildPlugin: BackstagePlugin<{ +const cloudbuildPlugin: BackstagePlugin< + { entityContent: RouteRef; -}, {}>; - -export { cloudbuildPlugin } - -export { cloudbuildPlugin as plugin } + }, + {} +>; +export { cloudbuildPlugin }; +export { cloudbuildPlugin as plugin }; // @public (undocumented) export const EntityCloudbuildContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityLatestCloudbuildRunCard: ({ branch, }: { - entity?: Entity| undefined; - branch: string; +export const EntityLatestCloudbuildRunCard: ({ + branch, +}: { + entity?: Entity | undefined; + branch: string; }) => JSX.Element; // @public (undocumented) -export const EntityLatestCloudbuildsForBranchCard: ({ branch, }: { - entity?: Entity| undefined; - branch: string; +export const EntityLatestCloudbuildsForBranchCard: ({ + branch, +}: { + entity?: Entity | undefined; + branch: string; }) => JSX.Element; // @public (undocumented) export interface FETCHSOURCE { - // (undocumented) - endTime: string; - // (undocumented) - startTime: string; + // (undocumented) + endTime: string; + // (undocumented) + startTime: string; } // @public (undocumented) const isCloudbuildAvailable: (entity: Entity) => boolean; - -export { isCloudbuildAvailable } - -export { isCloudbuildAvailable as isPluginApplicableToEntity } +export { isCloudbuildAvailable }; +export { isCloudbuildAvailable as isPluginApplicableToEntity }; // @public (undocumented) -export const LatestWorkflowRunCard: ({ branch, }: { - entity?: Entity | undefined; - branch: string; +export const LatestWorkflowRunCard: ({ + branch, +}: { + entity?: Entity | undefined; + branch: string; }) => JSX.Element; // @public (undocumented) -export const LatestWorkflowsForBranchCard: ({ branch, }: { - entity?: Entity | undefined; - branch: string; +export const LatestWorkflowsForBranchCard: ({ + branch, +}: { + entity?: Entity | undefined; + branch: string; }) => JSX.Element; // @public (undocumented) export interface Options { - // (undocumented) - dynamicSubstitutions: boolean; - // (undocumented) - logging: string; - // (undocumented) - machineType: string; - // (undocumented) - substitutionOption: string; + // (undocumented) + dynamicSubstitutions: boolean; + // (undocumented) + logging: string; + // (undocumented) + machineType: string; + // (undocumented) + substitutionOption: string; } // @public (undocumented) export interface PullTiming { - // (undocumented) - endTime: string; - // (undocumented) - startTime: string; + // (undocumented) + endTime: string; + // (undocumented) + startTime: string; } // @public (undocumented) export interface ResolvedStorageSource { - // (undocumented) - bucket: string; - // (undocumented) - generation: string; - // (undocumented) - object: string; + // (undocumented) + bucket: string; + // (undocumented) + generation: string; + // (undocumented) + object: string; } // @public (undocumented) export interface Results { - // (undocumented) - buildStepImages: string[]; - // (undocumented) - buildStepOutputs: string[]; + // (undocumented) + buildStepImages: string[]; + // (undocumented) + buildStepOutputs: string[]; } // @public (undocumented) @@ -195,89 +223,87 @@ export const Router: (_props: Props) => JSX.Element; // @public (undocumented) export interface Source { - // (undocumented) - storageSource: StorageSource; + // (undocumented) + storageSource: StorageSource; } // @public (undocumented) export interface SourceProvenance { - // (undocumented) - fileHashes: {}; - // (undocumented) - resolvedStorageSource: {}; + // (undocumented) + fileHashes: {}; + // (undocumented) + resolvedStorageSource: {}; } // @public (undocumented) export interface Step { - // (undocumented) - args: string[]; - // (undocumented) - dir: string; - // (undocumented) - entrypoint: string; - // (undocumented) - id: string; - // (undocumented) - name: string; - // (undocumented) - pullTiming: PullTiming; - // (undocumented) - status: string; - // (undocumented) - timing: Timing; - // (undocumented) - volumes: Volume[]; - // (undocumented) - waitFor: string[]; + // (undocumented) + args: string[]; + // (undocumented) + dir: string; + // (undocumented) + entrypoint: string; + // (undocumented) + id: string; + // (undocumented) + name: string; + // (undocumented) + pullTiming: PullTiming; + // (undocumented) + status: string; + // (undocumented) + timing: Timing; + // (undocumented) + volumes: Volume[]; + // (undocumented) + waitFor: string[]; } // @public (undocumented) export interface StorageSource { - // (undocumented) - bucket: string; - // (undocumented) - object: string; + // (undocumented) + bucket: string; + // (undocumented) + object: string; } // @public (undocumented) export interface Substitutions { - // (undocumented) - BRANCH_NAME: string; - // (undocumented) - COMMIT_SHA: string; - // (undocumented) - REPO_NAME: string; - // (undocumented) - REVISION_ID: string; - // (undocumented) - SHORT_SHA: string; + // (undocumented) + BRANCH_NAME: string; + // (undocumented) + COMMIT_SHA: string; + // (undocumented) + REPO_NAME: string; + // (undocumented) + REVISION_ID: string; + // (undocumented) + SHORT_SHA: string; } // @public (undocumented) export interface Timing { - // (undocumented) - endTime: string; - // (undocumented) - startTime: string; + // (undocumented) + endTime: string; + // (undocumented) + startTime: string; } // @public (undocumented) export interface Timing2 { - // (undocumented) - BUILD: BUILD; - // (undocumented) - FETCHSOURCE: FETCHSOURCE; + // (undocumented) + BUILD: BUILD; + // (undocumented) + FETCHSOURCE: FETCHSOURCE; } // @public (undocumented) export interface Volume { - // (undocumented) - name: string; - // (undocumented) - path: string; + // (undocumented) + name: string; + // (undocumented) + path: string; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/code-coverage-backend/api-report.md b/plugins/code-coverage-backend/api-report.md index 186b76fb39..fb7e844f13 100644 --- a/plugins/code-coverage-backend/api-report.md +++ b/plugins/code-coverage-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; @@ -13,8 +12,8 @@ import { UrlReader } from '@backstage/backend-common'; // @public (undocumented) export interface CodeCoverageApi { - // (undocumented) - name: string; + // (undocumented) + name: string; } // @public (undocumented) @@ -25,19 +24,17 @@ export const makeRouter: (options: RouterOptions) => Promise; // @public (undocumented) export interface RouterOptions { - // (undocumented) - config: Config; - // (undocumented) - database: PluginDatabaseManager; - // (undocumented) - discovery: PluginEndpointDiscovery; - // (undocumented) - logger: Logger_2; - // (undocumented) - urlReader: UrlReader; + // (undocumented) + config: Config; + // (undocumented) + database: PluginDatabaseManager; + // (undocumented) + discovery: PluginEndpointDiscovery; + // (undocumented) + logger: Logger_2; + // (undocumented) + urlReader: UrlReader; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/code-coverage/api-report.md b/plugins/code-coverage/api-report.md index dffbaeec2a..cd69066d4f 100644 --- a/plugins/code-coverage/api-report.md +++ b/plugins/code-coverage/api-report.md @@ -3,30 +3,30 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) -export const codeCoveragePlugin: BackstagePlugin<{ +export const codeCoveragePlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; + }, + {} +>; // @public (undocumented) export const EntityCodeCoverageContent: () => JSX.Element; // @public (undocumented) const isCodeCoverageAvailable: (entity: Entity) => boolean; - -export { isCodeCoverageAvailable } - -export { isCodeCoverageAvailable as isPluginApplicableToEntity } +export { isCodeCoverageAvailable }; +export { isCodeCoverageAvailable as isPluginApplicableToEntity }; // @public (undocumented) export const Router: () => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/config-schema/api-report.md b/plugins/config-schema/api-report.md index f623789076..e01cc67888 100644 --- a/plugins/config-schema/api-report.md +++ b/plugins/config-schema/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -12,8 +13,8 @@ import { Schema } from 'jsonschema'; // @public (undocumented) export interface ConfigSchemaApi { - // (undocumented) - schema$(): Observable; + // (undocumented) + schema$(): Observable; } // @public (undocumented) @@ -23,20 +24,19 @@ export const configSchemaApiRef: ApiRef; export const ConfigSchemaPage: () => JSX.Element; // @public (undocumented) -export const configSchemaPlugin: BackstagePlugin<{ +export const configSchemaPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; + }, + {} +>; // @public export class StaticSchemaLoader implements ConfigSchemaApi { - constructor({ url }?: { - url?: string; - }); - // (undocumented) - schema$(): Observable; - } - + constructor({ url }?: { url?: string }); + // (undocumented) + schema$(): Observable; +} // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/cost-insights/api-report.md b/plugins/cost-insights/api-report.md index 97dd33e5ad..2c32f09c53 100644 --- a/plugins/cost-insights/api-report.md +++ b/plugins/cost-insights/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePalette } from '@backstage/theme'; @@ -23,44 +24,44 @@ import { TypographyProps } from '@material-ui/core'; // @public export type Alert = { - title: string | JSX.Element; - subtitle: string | JSX.Element; - element?: JSX.Element; - status?: AlertStatus; - url?: string; - buttonText?: string; - SnoozeForm?: Maybe; - AcceptForm?: Maybe; - DismissForm?: Maybe; - onSnoozed?(options: AlertOptions): Promise; - onAccepted?(options: AlertOptions): Promise; - onDismissed?(options: AlertOptions): Promise; + title: string | JSX.Element; + subtitle: string | JSX.Element; + element?: JSX.Element; + status?: AlertStatus; + url?: string; + buttonText?: string; + SnoozeForm?: Maybe; + AcceptForm?: Maybe; + DismissForm?: Maybe; + onSnoozed?(options: AlertOptions): Promise; + onAccepted?(options: AlertOptions): Promise; + onDismissed?(options: AlertOptions): Promise; }; // @public (undocumented) export interface AlertCost { - // (undocumented) - aggregation: [number, number]; - // (undocumented) - id: string; + // (undocumented) + aggregation: [number, number]; + // (undocumented) + id: string; } // @public (undocumented) export interface AlertDismissFormData { - // (undocumented) - feedback: Maybe; - // (undocumented) - other: Maybe; - // (undocumented) - reason: AlertDismissReason; + // (undocumented) + feedback: Maybe; + // (undocumented) + other: Maybe; + // (undocumented) + reason: AlertDismissReason; } // @public (undocumented) export interface AlertDismissOption { - // (undocumented) - label: string; - // (undocumented) - reason: string; + // (undocumented) + label: string; + // (undocumented) + reason: string; } // @public (undocumented) @@ -68,48 +69,53 @@ export const AlertDismissOptions: AlertDismissOption[]; // @public (undocumented) export enum AlertDismissReason { - // (undocumented) - Expected = "expected", - // (undocumented) - Migration = "migration", - // (undocumented) - NotApplicable = "not-applicable", - // (undocumented) - Other = "other", - // (undocumented) - Resolved = "resolved", - // (undocumented) - Seasonal = "seasonal" + // (undocumented) + Expected = 'expected', + // (undocumented) + Migration = 'migration', + // (undocumented) + NotApplicable = 'not-applicable', + // (undocumented) + Other = 'other', + // (undocumented) + Resolved = 'resolved', + // (undocumented) + Seasonal = 'seasonal', } // @public (undocumented) -export type AlertForm = ForwardRefExoticComponent & RefAttributes>; +export type AlertForm< + A extends Alert = any, + Data = any +> = ForwardRefExoticComponent< + AlertFormProps & RefAttributes +>; // @public (undocumented) export type AlertFormProps = { - alert: A; - onSubmit: (data: FormData) => void; - disableSubmit: (isDisabled: boolean) => void; + alert: A; + onSubmit: (data: FormData) => void; + disableSubmit: (isDisabled: boolean) => void; }; // @public (undocumented) export interface AlertOptions { - // (undocumented) - data: T; - // (undocumented) - group: string; + // (undocumented) + data: T; + // (undocumented) + group: string; } // @public export interface AlertSnoozeFormData { - // (undocumented) - intervals: string; + // (undocumented) + intervals: string; } // @public (undocumented) export type AlertSnoozeOption = { - label: string; - duration: Duration; + label: string; + duration: Duration; }; // @public (undocumented) @@ -117,149 +123,175 @@ export const AlertSnoozeOptions: AlertSnoozeOption[]; // @public (undocumented) export enum AlertStatus { - // (undocumented) - Accepted = "accepted", - // (undocumented) - Dismissed = "dismissed", - // (undocumented) - Snoozed = "snoozed" + // (undocumented) + Accepted = 'accepted', + // (undocumented) + Dismissed = 'dismissed', + // (undocumented) + Snoozed = 'snoozed', } // @public (undocumented) -export const BarChart: ({ resources, responsive, displayAmount, options, tooltip, onClick, onMouseMove, }: BarChartProps) => JSX.Element; +export const BarChart: ({ + resources, + responsive, + displayAmount, + options, + tooltip, + onClick, + onMouseMove, +}: BarChartProps) => JSX.Element; // @public -export interface BarChartData extends BarChartOptions { -} +export interface BarChartData extends BarChartOptions {} // @public (undocumented) -export const BarChartLegend: ({ costStart, costEnd, options, children, }: PropsWithChildren) => JSX.Element; +export const BarChartLegend: ({ + costStart, + costEnd, + options, + children, +}: PropsWithChildren) => JSX.Element; // @public (undocumented) export type BarChartLegendOptions = { - previousName: string; - previousFill: string; - currentName: string; - currentFill: string; - hideMarker?: boolean; + previousName: string; + previousFill: string; + currentName: string; + currentFill: string; + hideMarker?: boolean; }; // @public (undocumented) export type BarChartLegendProps = { - costStart: number; - costEnd: number; - options?: Partial; + costStart: number; + costEnd: number; + options?: Partial; }; // @public (undocumented) export interface BarChartOptions { - // (undocumented) - currentFill: string; - // (undocumented) - currentName: string; - // (undocumented) - previousFill: string; - // (undocumented) - previousName: string; + // (undocumented) + currentFill: string; + // (undocumented) + currentName: string; + // (undocumented) + previousFill: string; + // (undocumented) + previousName: string; } // @public (undocumented) export type BarChartProps = { - resources: ResourceData[]; - responsive?: boolean; - displayAmount?: number; - options?: Partial; - tooltip?: ContentRenderer; - onClick?: RechartsFunction; - onMouseMove?: RechartsFunction; + resources: ResourceData[]; + responsive?: boolean; + displayAmount?: number; + options?: Partial; + tooltip?: ContentRenderer; + onClick?: RechartsFunction; + onMouseMove?: RechartsFunction; }; // @public (undocumented) -export const BarChartTooltip: ({ title, content, subtitle, topRight, actions, children, }: PropsWithChildren) => JSX.Element; +export const BarChartTooltip: ({ + title, + content, + subtitle, + topRight, + actions, + children, +}: PropsWithChildren) => JSX.Element; // @public (undocumented) -export const BarChartTooltipItem: ({ item }: BarChartTooltipItemProps) => JSX.Element; +export const BarChartTooltipItem: ({ + item, +}: BarChartTooltipItemProps) => JSX.Element; // @public (undocumented) export type BarChartTooltipItemProps = { - item: TooltipItem; + item: TooltipItem; }; // @public (undocumented) export type BarChartTooltipProps = { - title: string; - content?: ReactNode | string; - subtitle?: ReactNode; - topRight?: ReactNode; - actions?: ReactNode; + title: string; + content?: ReactNode | string; + subtitle?: ReactNode; + topRight?: ReactNode; + actions?: ReactNode; }; // @public (undocumented) export interface ChangeStatistic { - // (undocumented) - amount: number; - // (undocumented) - ratio?: number; + // (undocumented) + amount: number; + // (undocumented) + ratio?: number; } // @public (undocumented) export enum ChangeThreshold { - // (undocumented) - lower = -0.05, - // (undocumented) - upper = 0.05 + // (undocumented) + lower = -0.05, + // (undocumented) + upper = 0.05, } // @public (undocumented) export type ChartData = { - date: number; - trend: number; - dailyCost: number; - [key: string]: number; + date: number; + trend: number; + dailyCost: number; + [key: string]: number; }; // @public (undocumented) export interface Cost { - // (undocumented) - aggregation: DateAggregation[]; - // (undocumented) - change?: ChangeStatistic; - // (undocumented) - groupedCosts?: Record; - // (undocumented) - id: string; - // (undocumented) - trendline?: Trendline; + // (undocumented) + aggregation: DateAggregation[]; + // (undocumented) + change?: ChangeStatistic; + // (undocumented) + groupedCosts?: Record; + // (undocumented) + id: string; + // (undocumented) + trendline?: Trendline; } // @public (undocumented) export const CostGrowth: ({ change, duration }: CostGrowthProps) => JSX.Element; // @public (undocumented) -export const CostGrowthIndicator: ({ change, formatter, className, ...props }: CostGrowthIndicatorProps) => JSX.Element; +export const CostGrowthIndicator: ({ + change, + formatter, + className, + ...props +}: CostGrowthIndicatorProps) => JSX.Element; // @public (undocumented) export type CostGrowthIndicatorProps = TypographyProps & { - change: ChangeStatistic; - formatter?: (change: ChangeStatistic) => Maybe; + change: ChangeStatistic; + formatter?: (change: ChangeStatistic) => Maybe; }; // @public (undocumented) export type CostGrowthProps = { - change: ChangeStatistic; - duration: Duration; + change: ChangeStatistic; + duration: Duration; }; // @public (undocumented) export type CostInsightsApi = { - getLastCompleteBillingDate(): Promise; - getUserGroups(userId: string): Promise; - getGroupProjects(group: string): Promise; - getGroupDailyCost(group: string, intervals: string): Promise; - getProjectDailyCost(project: string, intervals: string): Promise; - getDailyMetricData(metric: string, intervals: string): Promise; - getProductInsights(options: ProductInsightsOptions): Promise; - getAlerts(group: string): Promise; + getLastCompleteBillingDate(): Promise; + getUserGroups(userId: string): Promise; + getGroupProjects(group: string): Promise; + getGroupDailyCost(group: string, intervals: string): Promise; + getProjectDailyCost(project: string, intervals: string): Promise; + getDailyMetricData(metric: string, intervals: string): Promise; + getProductInsights(options: ProductInsightsOptions): Promise; + getAlerts(group: string): Promise; }; // @public (undocumented) @@ -272,92 +304,95 @@ export const CostInsightsLabelDataflowInstructionsPage: () => JSX.Element; export const CostInsightsPage: () => JSX.Element; // @public (undocumented) -export type CostInsightsPalette = BackstagePalette & CostInsightsPaletteAdditions; +export type CostInsightsPalette = BackstagePalette & + CostInsightsPaletteAdditions; // @public (undocumented) -export type CostInsightsPaletteOptions = PaletteOptions & CostInsightsPaletteAdditions; +export type CostInsightsPaletteOptions = PaletteOptions & + CostInsightsPaletteAdditions; // @public (undocumented) -const costInsightsPlugin: BackstagePlugin<{ +const costInsightsPlugin: BackstagePlugin< + { root: RouteRef; growthAlerts: RouteRef; unlabeledDataflowAlerts: RouteRef; -}, {}>; - -export { costInsightsPlugin } - -export { costInsightsPlugin as plugin } + }, + {} +>; +export { costInsightsPlugin }; +export { costInsightsPlugin as plugin }; // @public (undocumented) export const CostInsightsProjectGrowthInstructionsPage: () => JSX.Element; // @public (undocumented) export interface CostInsightsTheme extends BackstageTheme { - // (undocumented) - palette: CostInsightsPalette; + // (undocumented) + palette: CostInsightsPalette; } // @public (undocumented) export interface CostInsightsThemeOptions extends PaletteOptions { - // (undocumented) - palette: CostInsightsPaletteOptions; + // (undocumented) + palette: CostInsightsPaletteOptions; } // @public (undocumented) export interface Currency { - // (undocumented) - kind: string | null; - // (undocumented) - label: string; - // (undocumented) - prefix?: string; - // (undocumented) - rate?: number; - // (undocumented) - unit: string; + // (undocumented) + kind: string | null; + // (undocumented) + label: string; + // (undocumented) + prefix?: string; + // (undocumented) + rate?: number; + // (undocumented) + unit: string; } // @public (undocumented) export enum CurrencyType { - // (undocumented) - Beers = "BEERS", - // (undocumented) - CarbonOffsetTons = "CARBON_OFFSET_TONS", - // (undocumented) - IceCream = "PINTS_OF_ICE_CREAM", - // (undocumented) - USD = "USD" + // (undocumented) + Beers = 'BEERS', + // (undocumented) + CarbonOffsetTons = 'CARBON_OFFSET_TONS', + // (undocumented) + IceCream = 'PINTS_OF_ICE_CREAM', + // (undocumented) + USD = 'USD', } // @public (undocumented) export enum DataKey { - // (undocumented) - Current = "current", - // (undocumented) - Name = "name", - // (undocumented) - Previous = "previous" + // (undocumented) + Current = 'current', + // (undocumented) + Name = 'name', + // (undocumented) + Previous = 'previous', } // @public (undocumented) export type DateAggregation = { - date: string; - amount: number; + date: string; + amount: number; }; // @public (undocumented) -export const DEFAULT_DATE_FORMAT = "yyyy-LL-dd"; +export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd'; // @public export enum Duration { - // (undocumented) - P30D = "P30D", - // (undocumented) - P3M = "P3M", - // (undocumented) - P7D = "P7D", - // (undocumented) - P90D = "P90D" + // (undocumented) + P30D = 'P30D', + // (undocumented) + P3M = 'P3M', + // (undocumented) + P7D = 'P7D', + // (undocumented) + P90D = 'P90D', } // @public (undocumented) @@ -365,81 +400,86 @@ export const EngineerThreshold = 0.5; // @public (undocumented) export interface Entity { - // (undocumented) - aggregation: [number, number]; - // (undocumented) - change: ChangeStatistic; - // (undocumented) - entities: Record; - // (undocumented) - id: Maybe; + // (undocumented) + aggregation: [number, number]; + // (undocumented) + change: ChangeStatistic; + // (undocumented) + entities: Record; + // (undocumented) + id: Maybe; } // @public (undocumented) export class ExampleCostInsightsClient implements CostInsightsApi { - // (undocumented) - getAlerts(group: string): Promise; - // (undocumented) - getDailyMetricData(metric: string, intervals: string): Promise; - // (undocumented) - getGroupDailyCost(group: string, intervals: string): Promise; - // (undocumented) - getGroupProjects(group: string): Promise; - // (undocumented) - getLastCompleteBillingDate(): Promise; - // (undocumented) - getProductInsights(options: ProductInsightsOptions): Promise; - // (undocumented) - getProjectDailyCost(project: string, intervals: string): Promise; - // (undocumented) - getUserGroups(userId: string): Promise; - } + // (undocumented) + getAlerts(group: string): Promise; + // (undocumented) + getDailyMetricData(metric: string, intervals: string): Promise; + // (undocumented) + getGroupDailyCost(group: string, intervals: string): Promise; + // (undocumented) + getGroupProjects(group: string): Promise; + // (undocumented) + getLastCompleteBillingDate(): Promise; + // (undocumented) + getProductInsights(options: ProductInsightsOptions): Promise; + // (undocumented) + getProjectDailyCost(project: string, intervals: string): Promise; + // (undocumented) + getUserGroups(userId: string): Promise; +} // @public (undocumented) export type Group = { - id: string; + id: string; }; // @public (undocumented) export enum GrowthType { - // (undocumented) - Excess = 2, - // (undocumented) - Negligible = 0, - // (undocumented) - Savings = 1 + // (undocumented) + Excess = 2, + // (undocumented) + Negligible = 0, + // (undocumented) + Savings = 1, } // @public (undocumented) export type Icon = { - kind: string; - component: JSX.Element; + kind: string; + component: JSX.Element; }; // @public (undocumented) export enum IconType { - // (undocumented) - Compute = "compute", - // (undocumented) - Data = "data", - // (undocumented) - Database = "database", - // (undocumented) - ML = "ml", - // (undocumented) - Search = "search", - // (undocumented) - Storage = "storage" + // (undocumented) + Compute = 'compute', + // (undocumented) + Data = 'data', + // (undocumented) + Database = 'database', + // (undocumented) + ML = 'ml', + // (undocumented) + Search = 'search', + // (undocumented) + Storage = 'storage', } // @public (undocumented) -export const LegendItem: ({ title, tooltipText, markerColor, children, }: PropsWithChildren) => JSX.Element; +export const LegendItem: ({ + title, + tooltipText, + markerColor, + children, +}: PropsWithChildren) => JSX.Element; // @public (undocumented) export type LegendItemProps = { - title: string; - tooltipText?: string; - markerColor?: string; + title: string; + tooltipText?: string; + markerColor?: string; }; // @public (undocumented) @@ -450,47 +490,53 @@ export type Maybe = T | null; // @public (undocumented) export type Metric = { - kind: string; - name: string; - default: boolean; + kind: string; + name: string; + default: boolean; }; // @public (undocumented) export interface MetricData { - // (undocumented) - aggregation: DateAggregation[]; - // (undocumented) - change: ChangeStatistic; - // (undocumented) - format: 'number' | 'currency'; - // (undocumented) - id: string; + // (undocumented) + aggregation: DateAggregation[]; + // (undocumented) + change: ChangeStatistic; + // (undocumented) + format: 'number' | 'currency'; + // (undocumented) + id: string; } // @public (undocumented) -export const MockConfigProvider: ({ children, ...context }: MockConfigProviderProps) => JSX.Element; +export const MockConfigProvider: ({ + children, + ...context +}: MockConfigProviderProps) => JSX.Element; // @public (undocumented) -export const MockCurrencyProvider: ({ children, ...context }: MockCurrencyProviderProps) => JSX.Element; +export const MockCurrencyProvider: ({ + children, + ...context +}: MockCurrencyProviderProps) => JSX.Element; // @public (undocumented) export interface PageFilters { - // (undocumented) - duration: Duration; - // (undocumented) - group: Maybe; - // (undocumented) - metric: string | null; - // (undocumented) - project: Maybe; + // (undocumented) + duration: Duration; + // (undocumented) + group: Maybe; + // (undocumented) + metric: string | null; + // (undocumented) + project: Maybe; } // @public (undocumented) export interface Product { - // (undocumented) - kind: string; - // (undocumented) - name: string; + // (undocumented) + kind: string; + // (undocumented) + name: string; } // @public (undocumented) @@ -498,124 +544,122 @@ export type ProductFilters = Array; // @public (undocumented) export type ProductInsightsOptions = { - product: string; - group: string; - intervals: string; - project: Maybe; + product: string; + group: string; + intervals: string; + project: Maybe; }; // @public (undocumented) export interface ProductPeriod { - // (undocumented) - duration: Duration; - // (undocumented) - productType: string; + // (undocumented) + duration: Duration; + // (undocumented) + productType: string; } // @public (undocumented) export interface Project { - // (undocumented) - id: string; - // (undocumented) - name?: string; + // (undocumented) + id: string; + // (undocumented) + name?: string; } // @public export class ProjectGrowthAlert implements Alert { - constructor(data: ProjectGrowthData); - // (undocumented) - data: ProjectGrowthData; - // (undocumented) - get element(): JSX.Element; - // (undocumented) - get subtitle(): string; - // (undocumented) - get title(): string; - // (undocumented) - get url(): string; + constructor(data: ProjectGrowthData); + // (undocumented) + data: ProjectGrowthData; + // (undocumented) + get element(): JSX.Element; + // (undocumented) + get subtitle(): string; + // (undocumented) + get title(): string; + // (undocumented) + get url(): string; } // @public (undocumented) export interface ProjectGrowthData { - // (undocumented) - aggregation: [number, number]; - // (undocumented) - change: ChangeStatistic; - // (undocumented) - periodEnd: string; - // (undocumented) - periodStart: string; - // (undocumented) - products: Array; - // (undocumented) - project: string; + // (undocumented) + aggregation: [number, number]; + // (undocumented) + change: ChangeStatistic; + // (undocumented) + periodEnd: string; + // (undocumented) + periodStart: string; + // (undocumented) + products: Array; + // (undocumented) + project: string; } // @public (undocumented) export interface ResourceData { - // (undocumented) - current: number; - // (undocumented) - name: Maybe; - // (undocumented) - previous: number; + // (undocumented) + current: number; + // (undocumented) + name: Maybe; + // (undocumented) + previous: number; } // @public (undocumented) export type TooltipItem = { - fill: string; - label: string; - value: string; + fill: string; + label: string; + value: string; }; // @public (undocumented) export type Trendline = { - slope: number; - intercept: number; + slope: number; + intercept: number; }; // @public export class UnlabeledDataflowAlert implements Alert { - constructor(data: UnlabeledDataflowData); - // (undocumented) - data: UnlabeledDataflowData; - // (undocumented) - get element(): JSX.Element; - // (undocumented) - status?: AlertStatus; - // (undocumented) - get subtitle(): string; - // (undocumented) - get title(): string; - // (undocumented) - get url(): string; + constructor(data: UnlabeledDataflowData); + // (undocumented) + data: UnlabeledDataflowData; + // (undocumented) + get element(): JSX.Element; + // (undocumented) + status?: AlertStatus; + // (undocumented) + get subtitle(): string; + // (undocumented) + get title(): string; + // (undocumented) + get url(): string; } // @public (undocumented) export interface UnlabeledDataflowAlertProject { - // (undocumented) - id: string; - // (undocumented) - labeledCost: number; - // (undocumented) - unlabeledCost: number; + // (undocumented) + id: string; + // (undocumented) + labeledCost: number; + // (undocumented) + unlabeledCost: number; } // @public (undocumented) export interface UnlabeledDataflowData { - // (undocumented) - labeledCost: number; - // (undocumented) - periodEnd: string; - // (undocumented) - periodStart: string; - // (undocumented) - projects: Array; - // (undocumented) - unlabeledCost: number; + // (undocumented) + labeledCost: number; + // (undocumented) + periodEnd: string; + // (undocumented) + periodStart: string; + // (undocumented) + projects: Array; + // (undocumented) + unlabeledCost: number; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/explore-react/api-report.md b/plugins/explore-react/api-report.md index cb09408f4b..530c6eedaf 100644 --- a/plugins/explore-react/api-report.md +++ b/plugins/explore-react/api-report.md @@ -3,29 +3,26 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { ApiRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type ExploreTool = { - title: string; - description?: string; - url: string; - image: string; - tags?: string[]; - lifecycle?: string; + title: string; + description?: string; + url: string; + image: string; + tags?: string[]; + lifecycle?: string; }; // @public (undocumented) export interface ExploreToolsConfig { - // (undocumented) - getTools: () => Promise; + // (undocumented) + getTools: () => Promise; } // @public (undocumented) export const exploreToolsConfigRef: ApiRef; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index 6755b0cfc2..4084c6a203 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -4,6 +4,8 @@ ```ts +/// + import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default } from 'react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; @@ -11,10 +13,10 @@ import { RouteRef } from '@backstage/core-plugin-api'; import { TabProps } from '@material-ui/core'; // @public (undocumented) -export const catalogEntityRouteRef: ExternalRouteRef<{ - name: string; - kind: string; - namespace: string; +export const catalogEntityRouteRef: ExternalRouteRef< { +name: string; +kind: string; +namespace: string; }, false>; // @public (undocumented) @@ -32,18 +34,16 @@ export const ExploreLayout: { export const ExplorePage: () => JSX.Element; // @public (undocumented) -const explorePlugin: BackstagePlugin<{ - explore: RouteRef; +const explorePlugin: BackstagePlugin< { +explore: RouteRef; }, { - catalogEntity: ExternalRouteRef<{ - name: string; - kind: string; - namespace: string; - }, false>; +catalogEntity: ExternalRouteRef< { +name: string; +kind: string; +namespace: string; +}, false>; }>; - export { explorePlugin } - export { explorePlugin as plugin } // @public (undocumented) @@ -59,7 +59,6 @@ export const ToolExplorerContent: ({ title }: { title?: string | undefined; }) => JSX.Element; - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/fossa/api-report.md b/plugins/fossa/api-report.md index a02fba732f..2a18f74f1b 100644 --- a/plugins/fossa/api-report.md +++ b/plugins/fossa/api-report.md @@ -3,25 +3,29 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { InfoCardVariants } from '@backstage/core-components'; import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) -export const EntityFossaCard: ({ variant }: { - variant?: InfoCardVariants| undefined; +export const EntityFossaCard: ({ + variant, +}: { + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) export const FossaPage: () => JSX.Element; // @public (undocumented) -export const fossaPlugin: BackstagePlugin<{ +export const fossaPlugin: BackstagePlugin< + { fossaOverview: RouteRef; -}, {}>; - + }, + {} +>; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/gcp-projects/api-report.md b/plugins/gcp-projects/api-report.md index bbe8d3edac..b2347b42ad 100644 --- a/plugins/gcp-projects/api-report.md +++ b/plugins/gcp-projects/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -11,12 +12,12 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type GcpApi = { - listProjects(): Promise; - getProject(projectId: string): Promise; - createProject(options: { - projectId: string; - projectName: string; - }): Promise; + listProjects(): Promise; + getProject(projectId: string): Promise; + createProject(options: { + projectId: string; + projectName: string; + }): Promise; }; // @public (undocumented) @@ -24,63 +25,62 @@ export const gcpApiRef: ApiRef; // @public (undocumented) export class GcpClient implements GcpApi { - constructor(googleAuthApi: OAuthApi); - // (undocumented) - createProject(options: { - projectId: string; - projectName: string; - }): Promise; - // (undocumented) - getProject(projectId: string): Promise; - // (undocumented) - getToken(): Promise; - // (undocumented) - listProjects(): Promise; + constructor(googleAuthApi: OAuthApi); + // (undocumented) + createProject(options: { + projectId: string; + projectName: string; + }): Promise; + // (undocumented) + getProject(projectId: string): Promise; + // (undocumented) + getToken(): Promise; + // (undocumented) + listProjects(): Promise; } // @public (undocumented) export const GcpProjectsPage: () => JSX.Element; // @public (undocumented) -const gcpProjectsPlugin: BackstagePlugin<{ +const gcpProjectsPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { gcpProjectsPlugin } - -export { gcpProjectsPlugin as plugin } + }, + {} +>; +export { gcpProjectsPlugin }; +export { gcpProjectsPlugin as plugin }; // @public (undocumented) export type Operation = { - name: string; - metadata: string; - done: boolean; - error: Status; - response: string; + name: string; + metadata: string; + done: boolean; + error: Status; + response: string; }; // @public (undocumented) export type Project = { - name: string; - projectNumber?: string; - projectId: string; - lifecycleState?: string; - createTime?: string; + name: string; + projectNumber?: string; + projectId: string; + lifecycleState?: string; + createTime?: string; }; // @public (undocumented) export type ProjectDetails = { - details: string; + details: string; }; // @public (undocumented) export type Status = { - code: number; - message: string; - details: string[]; + code: number; + message: string; + details: string[]; }; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/git-release-manager/api-report.md b/plugins/git-release-manager/api-report.md index 2948f441bc..3039bb033f 100644 --- a/plugins/git-release-manager/api-report.md +++ b/plugins/git-release-manager/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -15,11 +16,12 @@ export const gitReleaseManagerApiRef: ApiRef; export const GitReleaseManagerPage: GitReleaseManager; // @public (undocumented) -export const gitReleaseManagerPlugin: BackstagePlugin<{ +export const gitReleaseManagerPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - + }, + {} +>; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/github-actions/api-report.md b/plugins/github-actions/api-report.md index d3fe532c7b..e9fb9e09dc 100644 --- a/plugins/github-actions/api-report.md +++ b/plugins/github-actions/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -15,83 +16,138 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export enum BuildStatus { - // (undocumented) - 'failure' = 1, - // (undocumented) - 'pending' = 2, - // (undocumented) - 'running' = 3, - // (undocumented) - 'success' = 0 + // (undocumented) + 'failure' = 1, + // (undocumented) + 'pending' = 2, + // (undocumented) + 'running' = 3, + // (undocumented) + 'success' = 0, } // @public (undocumented) export const EntityGithubActionsContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityLatestGithubActionRunCard: ({ branch, variant, }: { - entity?: Entity| undefined; - branch: string; - variant?: InfoCardVariants| undefined; +export const EntityLatestGithubActionRunCard: ({ + branch, + variant, +}: { + entity?: Entity | undefined; + branch: string; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityLatestGithubActionsForBranchCard: ({ branch, variant, }: { - entity?: Entity| undefined; - branch: string; - variant?: InfoCardVariants| undefined; +export const EntityLatestGithubActionsForBranchCard: ({ + branch, + variant, +}: { + entity?: Entity | undefined; + branch: string; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityRecentGithubActionsRunsCard: ({ branch, dense, limit, variant, }: Props) => JSX.Element; +export const EntityRecentGithubActionsRunsCard: ({ + branch, + dense, + limit, + variant, +}: Props) => JSX.Element; // @public (undocumented) -export const GITHUB_ACTIONS_ANNOTATION = "github.com/project-slug"; +export const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; // @public (undocumented) export type GithubActionsApi = { - listWorkflowRuns: ({ hostname, owner, repo, pageSize, page, branch, }: { - hostname?: string; - owner: string; - repo: string; - pageSize?: number; - page?: number; - branch?: string; - }) => Promise; - getWorkflow: ({ hostname, owner, repo, id, }: { - hostname?: string; - owner: string; - repo: string; - id: number; - }) => Promise; - getWorkflowRun: ({ hostname, owner, repo, id, }: { - hostname?: string; - owner: string; - repo: string; - id: number; - }) => Promise; - reRunWorkflow: ({ hostname, owner, repo, runId, }: { - hostname?: string; - owner: string; - repo: string; - runId: number; - }) => Promise; - listJobsForWorkflowRun: ({ hostname, owner, repo, id, pageSize, page, }: { - hostname?: string; - owner: string; - repo: string; - id: number; - pageSize?: number; - page?: number; - }) => Promise; - downloadJobLogsForWorkflowRun: ({ hostname, owner, repo, runId, }: { - hostname?: string; - owner: string; - repo: string; - runId: number; - }) => Promise; + listWorkflowRuns: ({ + hostname, + owner, + repo, + pageSize, + page, + branch, + }: { + hostname?: string; + owner: string; + repo: string; + pageSize?: number; + page?: number; + branch?: string; + }) => Promise< + RestEndpointMethodTypes['actions']['listWorkflowRuns']['response']['data'] + >; + getWorkflow: ({ + hostname, + owner, + repo, + id, + }: { + hostname?: string; + owner: string; + repo: string; + id: number; + }) => Promise< + RestEndpointMethodTypes['actions']['getWorkflow']['response']['data'] + >; + getWorkflowRun: ({ + hostname, + owner, + repo, + id, + }: { + hostname?: string; + owner: string; + repo: string; + id: number; + }) => Promise< + RestEndpointMethodTypes['actions']['getWorkflowRun']['response']['data'] + >; + reRunWorkflow: ({ + hostname, + owner, + repo, + runId, + }: { + hostname?: string; + owner: string; + repo: string; + runId: number; + }) => Promise; + listJobsForWorkflowRun: ({ + hostname, + owner, + repo, + id, + pageSize, + page, + }: { + hostname?: string; + owner: string; + repo: string; + id: number; + pageSize?: number; + page?: number; + }) => Promise< + RestEndpointMethodTypes['actions']['listJobsForWorkflowRun']['response']['data'] + >; + downloadJobLogsForWorkflowRun: ({ + hostname, + owner, + repo, + runId, + }: { + hostname?: string; + owner: string; + repo: string; + runId: number; + }) => Promise< + RestEndpointMethodTypes['actions']['downloadJobLogsForWorkflowRun']['response']['data'] + >; }; // @public (undocumented) @@ -99,115 +155,164 @@ export const githubActionsApiRef: ApiRef; // @public (undocumented) export class GithubActionsClient implements GithubActionsApi { - constructor(options: { - configApi: ConfigApi; - githubAuthApi: OAuthApi; - }); - // (undocumented) - downloadJobLogsForWorkflowRun({ hostname, owner, repo, runId, }: { - hostname?: string; - owner: string; - repo: string; - runId: number; - }): Promise; - // (undocumented) - getWorkflow({ hostname, owner, repo, id, }: { - hostname?: string; - owner: string; - repo: string; - id: number; - }): Promise; - // (undocumented) - getWorkflowRun({ hostname, owner, repo, id, }: { - hostname?: string; - owner: string; - repo: string; - id: number; - }): Promise; - // (undocumented) - listJobsForWorkflowRun({ hostname, owner, repo, id, pageSize, page, }: { - hostname?: string; - owner: string; - repo: string; - id: number; - pageSize?: number; - page?: number; - }): Promise; - // (undocumented) - listWorkflowRuns({ hostname, owner, repo, pageSize, page, branch, }: { - hostname?: string; - owner: string; - repo: string; - pageSize?: number; - page?: number; - branch?: string; - }): Promise; - // (undocumented) - reRunWorkflow({ hostname, owner, repo, runId, }: { - hostname?: string; - owner: string; - repo: string; - runId: number; - }): Promise; + constructor(options: { configApi: ConfigApi; githubAuthApi: OAuthApi }); + // (undocumented) + downloadJobLogsForWorkflowRun({ + hostname, + owner, + repo, + runId, + }: { + hostname?: string; + owner: string; + repo: string; + runId: number; + }): Promise< + RestEndpointMethodTypes['actions']['downloadJobLogsForWorkflowRun']['response']['data'] + >; + // (undocumented) + getWorkflow({ + hostname, + owner, + repo, + id, + }: { + hostname?: string; + owner: string; + repo: string; + id: number; + }): Promise< + RestEndpointMethodTypes['actions']['getWorkflow']['response']['data'] + >; + // (undocumented) + getWorkflowRun({ + hostname, + owner, + repo, + id, + }: { + hostname?: string; + owner: string; + repo: string; + id: number; + }): Promise< + RestEndpointMethodTypes['actions']['getWorkflowRun']['response']['data'] + >; + // (undocumented) + listJobsForWorkflowRun({ + hostname, + owner, + repo, + id, + pageSize, + page, + }: { + hostname?: string; + owner: string; + repo: string; + id: number; + pageSize?: number; + page?: number; + }): Promise< + RestEndpointMethodTypes['actions']['listJobsForWorkflowRun']['response']['data'] + >; + // (undocumented) + listWorkflowRuns({ + hostname, + owner, + repo, + pageSize, + page, + branch, + }: { + hostname?: string; + owner: string; + repo: string; + pageSize?: number; + page?: number; + branch?: string; + }): Promise< + RestEndpointMethodTypes['actions']['listWorkflowRuns']['response']['data'] + >; + // (undocumented) + reRunWorkflow({ + hostname, + owner, + repo, + runId, + }: { + hostname?: string; + owner: string; + repo: string; + runId: number; + }): Promise; } // @public (undocumented) -const githubActionsPlugin: BackstagePlugin<{ +const githubActionsPlugin: BackstagePlugin< + { entityContent: RouteRef; -}, {}>; - -export { githubActionsPlugin } - -export { githubActionsPlugin as plugin } + }, + {} +>; +export { githubActionsPlugin }; +export { githubActionsPlugin as plugin }; // @public (undocumented) const isGithubActionsAvailable: (entity: Entity) => boolean; - -export { isGithubActionsAvailable } - -export { isGithubActionsAvailable as isPluginApplicableToEntity } +export { isGithubActionsAvailable }; +export { isGithubActionsAvailable as isPluginApplicableToEntity }; // @public (undocumented) export type Job = { - html_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - id: number; - name: string; - steps: Step[]; + html_url: string; + status: string; + conclusion: string; + started_at: string; + completed_at: string; + id: number; + name: string; + steps: Step[]; }; // @public (undocumented) export type Jobs = { - total_count: number; - jobs: Job[]; + total_count: number; + jobs: Job[]; }; // @public (undocumented) -export const LatestWorkflowRunCard: ({ branch, variant, }: Props_3) => JSX.Element; +export const LatestWorkflowRunCard: ({ + branch, + variant, +}: Props_3) => JSX.Element; // @public (undocumented) -export const LatestWorkflowsForBranchCard: ({ branch, variant, }: Props_3) => JSX.Element; +export const LatestWorkflowsForBranchCard: ({ + branch, + variant, +}: Props_3) => JSX.Element; // @public (undocumented) -export const RecentWorkflowRunsCard: ({ branch, dense, limit, variant, }: Props) => JSX.Element; +export const RecentWorkflowRunsCard: ({ + branch, + dense, + limit, + variant, +}: Props) => JSX.Element; // @public (undocumented) export const Router: (_props: Props_2) => JSX.Element; // @public (undocumented) export type Step = { - name: string; - status: string; - conclusion?: string; - number: number; - started_at: string; - completed_at: string; + name: string; + status: string; + conclusion?: string; + number: number; + started_at: string; + completed_at: string; }; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/github-deployments/api-report.md b/plugins/github-deployments/api-report.md new file mode 100644 index 0000000000..3cdf9f0316 --- /dev/null +++ b/plugins/github-deployments/api-report.md @@ -0,0 +1,64 @@ +## API Report File for "@backstage/plugin-github-deployments" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { Entity } from '@backstage/catalog-model'; +import { TableColumn } from '@backstage/core-components'; + +// @public (undocumented) +function createCommitColumn(): TableColumn; + +// @public (undocumented) +function createCreatorColumn(): TableColumn; + +// @public (undocumented) +function createEnvironmentColumn(): TableColumn; + +// @public (undocumented) +function createLastUpdatedColumn(): TableColumn; + +// @public (undocumented) +function createStatusColumn(): TableColumn; + +// @public (undocumented) +export const EntityGithubDeploymentsCard: ({ + last, + lastStatuses, + columns, +}: { + last?: number | undefined; + lastStatuses?: number | undefined; + columns?: TableColumn[] | undefined; +}) => JSX.Element; + +// @public (undocumented) +export const githubDeploymentsPlugin: BackstagePlugin<{}, {}>; + +// @public (undocumented) +export function GithubDeploymentsTable({ + deployments, + isLoading, + reload, + columns, +}: GithubDeploymentsTableProps): JSX.Element; + +// @public (undocumented) +export namespace GithubDeploymentsTable { + var // (undocumented) + columns: typeof columnFactories; + var // (undocumented) + defaultDeploymentColumns: TableColumn[]; +} + +// @public (undocumented) +const GithubStateIndicator: ({ state }: { state: string }) => JSX.Element; + +// @public (undocumented) +export const isGithubDeploymentsAvailable: (entity: Entity) => boolean; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/gitops-profiles/api-report.md b/plugins/gitops-profiles/api-report.md index 4690e41414..f38f660c77 100644 --- a/plugins/gitops-profiles/api-report.md +++ b/plugins/gitops-profiles/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -10,94 +11,94 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export interface ApplyProfileRequest { - // (undocumented) - gitHubToken: string; - // (undocumented) - gitHubUser: string; - // (undocumented) - profiles: string[]; - // (undocumented) - targetOrg: string; - // (undocumented) - targetRepo: string; + // (undocumented) + gitHubToken: string; + // (undocumented) + gitHubUser: string; + // (undocumented) + profiles: string[]; + // (undocumented) + targetOrg: string; + // (undocumented) + targetRepo: string; } // @public (undocumented) export interface ChangeClusterStateRequest { - // (undocumented) - clusterState: 'present' | 'absent'; - // (undocumented) - gitHubToken: string; - // (undocumented) - gitHubUser: string; - // (undocumented) - targetOrg: string; - // (undocumented) - targetRepo: string; + // (undocumented) + clusterState: 'present' | 'absent'; + // (undocumented) + gitHubToken: string; + // (undocumented) + gitHubUser: string; + // (undocumented) + targetOrg: string; + // (undocumented) + targetRepo: string; } // @public (undocumented) export interface CloneFromTemplateRequest { - // (undocumented) - gitHubToken: string; - // (undocumented) - gitHubUser: string; - // (undocumented) - secrets: { - awsAccessKeyId: string; - awsSecretAccessKey: string; - }; - // (undocumented) - targetOrg: string; - // (undocumented) - targetRepo: string; - // (undocumented) - templateRepository: string; + // (undocumented) + gitHubToken: string; + // (undocumented) + gitHubUser: string; + // (undocumented) + secrets: { + awsAccessKeyId: string; + awsSecretAccessKey: string; + }; + // (undocumented) + targetOrg: string; + // (undocumented) + targetRepo: string; + // (undocumented) + templateRepository: string; } // @public (undocumented) export interface ClusterStatus { - // (undocumented) - conclusion: string; - // (undocumented) - link: string; - // (undocumented) - name: string; - // (undocumented) - runStatus: Status[]; - // (undocumented) - status: string; + // (undocumented) + conclusion: string; + // (undocumented) + link: string; + // (undocumented) + name: string; + // (undocumented) + runStatus: Status[]; + // (undocumented) + status: string; } // @public (undocumented) export class FetchError extends Error { - // (undocumented) - static forResponse(resp: Response): Promise; - // (undocumented) - get name(): string; + // (undocumented) + static forResponse(resp: Response): Promise; + // (undocumented) + get name(): string; } // @public (undocumented) export interface GithubUserInfoRequest { - // (undocumented) - accessToken: string; + // (undocumented) + accessToken: string; } // @public (undocumented) export interface GithubUserInfoResponse { - // (undocumented) - login: string; + // (undocumented) + login: string; } // @public (undocumented) export type GitOpsApi = { - url: string; - fetchLog(req: PollLogRequest): Promise; - changeClusterState(req: ChangeClusterStateRequest): Promise; - cloneClusterFromTemplate(req: CloneFromTemplateRequest): Promise; - applyProfiles(req: ApplyProfileRequest): Promise; - listClusters(req: ListClusterRequest): Promise; - fetchUserInfo(req: GithubUserInfoRequest): Promise; + url: string; + fetchLog(req: PollLogRequest): Promise; + changeClusterState(req: ChangeClusterStateRequest): Promise; + cloneClusterFromTemplate(req: CloneFromTemplateRequest): Promise; + applyProfiles(req: ApplyProfileRequest): Promise; + listClusters(req: ListClusterRequest): Promise; + fetchUserInfo(req: GithubUserInfoRequest): Promise; }; // @public (undocumented) @@ -113,85 +114,84 @@ export const GitopsProfilesClusterPage: () => JSX.Element; export const GitopsProfilesCreatePage: () => JSX.Element; // @public (undocumented) -const gitopsProfilesPlugin: BackstagePlugin<{ +const gitopsProfilesPlugin: BackstagePlugin< + { listPage: RouteRef; detailsPage: RouteRef<{ - owner: string; - repo: string; + owner: string; + repo: string; }>; createPage: RouteRef; -}, {}>; - -export { gitopsProfilesPlugin } - -export { gitopsProfilesPlugin as plugin } + }, + {} +>; +export { gitopsProfilesPlugin }; +export { gitopsProfilesPlugin as plugin }; // @public (undocumented) export class GitOpsRestApi implements GitOpsApi { - constructor(url?: string); - // (undocumented) - applyProfiles(req: ApplyProfileRequest): Promise; - // (undocumented) - changeClusterState(req: ChangeClusterStateRequest): Promise; - // (undocumented) - cloneClusterFromTemplate(req: CloneFromTemplateRequest): Promise; - // (undocumented) - fetchLog(req: PollLogRequest): Promise; - // (undocumented) - fetchUserInfo(req: GithubUserInfoRequest): Promise; - // (undocumented) - listClusters(req: ListClusterRequest): Promise; - // (undocumented) - url: string; + constructor(url?: string); + // (undocumented) + applyProfiles(req: ApplyProfileRequest): Promise; + // (undocumented) + changeClusterState(req: ChangeClusterStateRequest): Promise; + // (undocumented) + cloneClusterFromTemplate(req: CloneFromTemplateRequest): Promise; + // (undocumented) + fetchLog(req: PollLogRequest): Promise; + // (undocumented) + fetchUserInfo(req: GithubUserInfoRequest): Promise; + // (undocumented) + listClusters(req: ListClusterRequest): Promise; + // (undocumented) + url: string; } // @public (undocumented) export interface ListClusterRequest { - // (undocumented) - gitHubToken: string; - // (undocumented) - gitHubUser: string; + // (undocumented) + gitHubToken: string; + // (undocumented) + gitHubUser: string; } // @public (undocumented) export interface ListClusterStatusesResponse { - // (undocumented) - result: ClusterStatus[]; + // (undocumented) + result: ClusterStatus[]; } // @public (undocumented) export interface PollLogRequest { - // (undocumented) - gitHubToken: string; - // (undocumented) - gitHubUser: string; - // (undocumented) - targetOrg: string; - // (undocumented) - targetRepo: string; + // (undocumented) + gitHubToken: string; + // (undocumented) + gitHubUser: string; + // (undocumented) + targetOrg: string; + // (undocumented) + targetRepo: string; } // @public (undocumented) export interface Status { - // (undocumented) - conclusion: string; - // (undocumented) - message: string; - // (undocumented) - status: string; + // (undocumented) + conclusion: string; + // (undocumented) + message: string; + // (undocumented) + status: string; } // @public (undocumented) export interface StatusResponse { - // (undocumented) - link: string; - // (undocumented) - result: Status[]; - // (undocumented) - status: string; + // (undocumented) + link: string; + // (undocumented) + result: Status[]; + // (undocumented) + status: string; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/graphiql/api-report.md b/plugins/graphiql/api-report.md index 4e78e34f6a..673f508e03 100644 --- a/plugins/graphiql/api-report.md +++ b/plugins/graphiql/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -13,22 +14,22 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type EndpointConfig = { - id: string; - title: string; - url: string; - method?: 'POST'; - headers?: { - [name in string]: string; - }; + id: string; + title: string; + url: string; + method?: 'POST'; + headers?: { + [name in string]: string; + }; }; // @public (undocumented) export type GithubEndpointConfig = { - id: string; - title: string; - url?: string; - errorApi?: ErrorApi; - githubAuthApi: OAuthApi; + id: string; + title: string; + url?: string; + errorApi?: ErrorApi; + githubAuthApi: OAuthApi; }; // @public (undocumented) @@ -39,17 +40,15 @@ export const GraphiQLPage: () => JSX.Element; // @public (undocumented) const graphiqlPlugin: BackstagePlugin<{}, {}>; - -export { graphiqlPlugin } - -export { graphiqlPlugin as plugin } +export { graphiqlPlugin }; +export { graphiqlPlugin as plugin }; // @public (undocumented) export const graphiQLRouteRef: RouteRef; // @public (undocumented) export type GraphQLBrowseApi = { - getEndpoints(): Promise; + getEndpoints(): Promise; }; // @public (undocumented) @@ -57,26 +56,24 @@ export const graphQlBrowseApiRef: ApiRef; // @public (undocumented) export type GraphQLEndpoint = { - id: string; - title: string; - fetcher: (body: any) => Promise; + id: string; + title: string; + fetcher: (body: any) => Promise; }; // @public (undocumented) export class GraphQLEndpoints implements GraphQLBrowseApi { - // (undocumented) - static create(config: EndpointConfig): GraphQLEndpoint; - // (undocumented) - static from(endpoints: GraphQLEndpoint[]): GraphQLEndpoints; - // (undocumented) - getEndpoints(): Promise; - static github(config: GithubEndpointConfig): GraphQLEndpoint; + // (undocumented) + static create(config: EndpointConfig): GraphQLEndpoint; + // (undocumented) + static from(endpoints: GraphQLEndpoint[]): GraphQLEndpoints; + // (undocumented) + getEndpoints(): Promise; + static github(config: GithubEndpointConfig): GraphQLEndpoint; } // @public (undocumented) export const Router: () => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/graphql/api-report.md b/plugins/graphql/api-report.md index ef172afbd7..c50312ddf6 100644 --- a/plugins/graphql/api-report.md +++ b/plugins/graphql/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; @@ -13,13 +12,11 @@ export function createRouter(options: RouterOptions): Promise; // @public (undocumented) export interface RouterOptions { - // (undocumented) - config: Config; - // (undocumented) - logger: Logger_2; + // (undocumented) + config: Config; + // (undocumented) + logger: Logger_2; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/ilert/api-report.md b/plugins/ilert/api-report.md index 376e7e4dfd..94a3657e04 100644 --- a/plugins/ilert/api-report.md +++ b/plugins/ilert/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -17,79 +18,93 @@ export const EntityILertCard: () => JSX.Element; // @public (undocumented) export type GetIncidentsCountOpts = { - states?: IncidentStatus[]; + states?: IncidentStatus[]; }; // @public (undocumented) export type GetIncidentsOpts = { - maxResults?: number; - startIndex?: number; - states?: IncidentStatus[]; - alertSources?: number[]; + maxResults?: number; + startIndex?: number; + states?: IncidentStatus[]; + alertSources?: number[]; }; // @public (undocumented) export interface ILertApi { - // (undocumented) - acceptIncident(incident: Incident, userName: string): Promise; - // (undocumented) - addImmediateMaintenance(alertSourceId: number, minutes: number): Promise; - // (undocumented) - assignIncident(incident: Incident, responder: IncidentResponder): Promise; - // (undocumented) - createIncident(eventRequest: EventRequest): Promise; - // (undocumented) - disableAlertSource(alertSource: AlertSource): Promise; - // (undocumented) - enableAlertSource(alertSource: AlertSource): Promise; - // (undocumented) - fetchAlertSource(idOrIntegrationKey: number | string): Promise; - // (undocumented) - fetchAlertSourceOnCalls(alertSource: AlertSource): Promise; - // (undocumented) - fetchAlertSources(): Promise; - // (undocumented) - fetchIncident(id: number): Promise; - // (undocumented) - fetchIncidentActions(incident: Incident): Promise; - // (undocumented) - fetchIncidentResponders(incident: Incident): Promise; - // (undocumented) - fetchIncidents(opts?: GetIncidentsOpts): Promise; - // (undocumented) - fetchIncidentsCount(opts?: GetIncidentsCountOpts): Promise; - // (undocumented) - fetchOnCallSchedules(): Promise; - // (undocumented) - fetchUptimeMonitor(id: number): Promise; - // (undocumented) - fetchUptimeMonitors(): Promise; - // (undocumented) - fetchUsers(): Promise; - // (undocumented) - getAlertSourceDetailsURL(alertSource: AlertSource | null): string; - // (undocumented) - getEscalationPolicyDetailsURL(escalationPolicy: EscalationPolicy): string; - // (undocumented) - getIncidentDetailsURL(incident: Incident): string; - // (undocumented) - getScheduleDetailsURL(schedule: Schedule): string; - // (undocumented) - getUptimeMonitorDetailsURL(uptimeMonitor: UptimeMonitor): string; - // (undocumented) - getUserInitials(user: User | null): string; - // (undocumented) - getUserPhoneNumber(user: User | null): string; - // (undocumented) - overrideShift(scheduleId: number, userId: number, start: string, end: string): Promise; - // (undocumented) - pauseUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; - // (undocumented) - resolveIncident(incident: Incident, userName: string): Promise; - // (undocumented) - resumeUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; - // (undocumented) - triggerIncidentAction(incident: Incident, action: IncidentAction): Promise; + // (undocumented) + acceptIncident(incident: Incident, userName: string): Promise; + // (undocumented) + addImmediateMaintenance( + alertSourceId: number, + minutes: number, + ): Promise; + // (undocumented) + assignIncident( + incident: Incident, + responder: IncidentResponder, + ): Promise; + // (undocumented) + createIncident(eventRequest: EventRequest): Promise; + // (undocumented) + disableAlertSource(alertSource: AlertSource): Promise; + // (undocumented) + enableAlertSource(alertSource: AlertSource): Promise; + // (undocumented) + fetchAlertSource(idOrIntegrationKey: number | string): Promise; + // (undocumented) + fetchAlertSourceOnCalls(alertSource: AlertSource): Promise; + // (undocumented) + fetchAlertSources(): Promise; + // (undocumented) + fetchIncident(id: number): Promise; + // (undocumented) + fetchIncidentActions(incident: Incident): Promise; + // (undocumented) + fetchIncidentResponders(incident: Incident): Promise; + // (undocumented) + fetchIncidents(opts?: GetIncidentsOpts): Promise; + // (undocumented) + fetchIncidentsCount(opts?: GetIncidentsCountOpts): Promise; + // (undocumented) + fetchOnCallSchedules(): Promise; + // (undocumented) + fetchUptimeMonitor(id: number): Promise; + // (undocumented) + fetchUptimeMonitors(): Promise; + // (undocumented) + fetchUsers(): Promise; + // (undocumented) + getAlertSourceDetailsURL(alertSource: AlertSource | null): string; + // (undocumented) + getEscalationPolicyDetailsURL(escalationPolicy: EscalationPolicy): string; + // (undocumented) + getIncidentDetailsURL(incident: Incident): string; + // (undocumented) + getScheduleDetailsURL(schedule: Schedule): string; + // (undocumented) + getUptimeMonitorDetailsURL(uptimeMonitor: UptimeMonitor): string; + // (undocumented) + getUserInitials(user: User | null): string; + // (undocumented) + getUserPhoneNumber(user: User | null): string; + // (undocumented) + overrideShift( + scheduleId: number, + userId: number, + start: string, + end: string, + ): Promise; + // (undocumented) + pauseUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; + // (undocumented) + resolveIncident(incident: Incident, userName: string): Promise; + // (undocumented) + resumeUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; + // (undocumented) + triggerIncidentAction( + incident: Incident, + action: IncidentAction, + ): Promise; } // @public (undocumented) @@ -100,69 +115,86 @@ export const ILertCard: () => JSX.Element; // @public (undocumented) export class ILertClient implements ILertApi { - constructor(opts: Options); - // (undocumented) - acceptIncident(incident: Incident, userName: string): Promise; - // (undocumented) - addImmediateMaintenance(alertSourceId: number, minutes: number): Promise; - // (undocumented) - assignIncident(incident: Incident, responder: IncidentResponder): Promise; - // (undocumented) - createIncident(eventRequest: EventRequest): Promise; - // (undocumented) - disableAlertSource(alertSource: AlertSource): Promise; - // (undocumented) - enableAlertSource(alertSource: AlertSource): Promise; - // (undocumented) - fetchAlertSource(idOrIntegrationKey: number | string): Promise; - // (undocumented) - fetchAlertSourceOnCalls(alertSource: AlertSource): Promise; - // (undocumented) - fetchAlertSources(): Promise; - // (undocumented) - fetchIncident(id: number): Promise; - // (undocumented) - fetchIncidentActions(incident: Incident): Promise; - // (undocumented) - fetchIncidentResponders(incident: Incident): Promise; - // (undocumented) - fetchIncidents(opts?: GetIncidentsOpts): Promise; - // (undocumented) - fetchIncidentsCount(opts?: GetIncidentsCountOpts): Promise; - // (undocumented) - fetchOnCallSchedules(): Promise; - // (undocumented) - fetchUptimeMonitor(id: number): Promise; - // (undocumented) - fetchUptimeMonitors(): Promise; - // (undocumented) - fetchUsers(): Promise; - // (undocumented) - static fromConfig(configApi: ConfigApi, discoveryApi: DiscoveryApi): ILertClient; - // (undocumented) - getAlertSourceDetailsURL(alertSource: AlertSource | null): string; - // (undocumented) - getEscalationPolicyDetailsURL(escalationPolicy: EscalationPolicy): string; - // (undocumented) - getIncidentDetailsURL(incident: Incident): string; - // (undocumented) - getScheduleDetailsURL(schedule: Schedule): string; - // (undocumented) - getUptimeMonitorDetailsURL(uptimeMonitor: UptimeMonitor): string; - // (undocumented) - getUserInitials(user: User | null): string; - // (undocumented) - getUserPhoneNumber(user: User | null): string; - // (undocumented) - overrideShift(scheduleId: number, userId: number, start: string, end: string): Promise; - // (undocumented) - pauseUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; - // (undocumented) - resolveIncident(incident: Incident, userName: string): Promise; - // (undocumented) - resumeUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; - // (undocumented) - triggerIncidentAction(incident: Incident, action: IncidentAction): Promise; + constructor(opts: Options); + // (undocumented) + acceptIncident(incident: Incident, userName: string): Promise; + // (undocumented) + addImmediateMaintenance( + alertSourceId: number, + minutes: number, + ): Promise; + // (undocumented) + assignIncident( + incident: Incident, + responder: IncidentResponder, + ): Promise; + // (undocumented) + createIncident(eventRequest: EventRequest): Promise; + // (undocumented) + disableAlertSource(alertSource: AlertSource): Promise; + // (undocumented) + enableAlertSource(alertSource: AlertSource): Promise; + // (undocumented) + fetchAlertSource(idOrIntegrationKey: number | string): Promise; + // (undocumented) + fetchAlertSourceOnCalls(alertSource: AlertSource): Promise; + // (undocumented) + fetchAlertSources(): Promise; + // (undocumented) + fetchIncident(id: number): Promise; + // (undocumented) + fetchIncidentActions(incident: Incident): Promise; + // (undocumented) + fetchIncidentResponders(incident: Incident): Promise; + // (undocumented) + fetchIncidents(opts?: GetIncidentsOpts): Promise; + // (undocumented) + fetchIncidentsCount(opts?: GetIncidentsCountOpts): Promise; + // (undocumented) + fetchOnCallSchedules(): Promise; + // (undocumented) + fetchUptimeMonitor(id: number): Promise; + // (undocumented) + fetchUptimeMonitors(): Promise; + // (undocumented) + fetchUsers(): Promise; + // (undocumented) + static fromConfig( + configApi: ConfigApi, + discoveryApi: DiscoveryApi, + ): ILertClient; + // (undocumented) + getAlertSourceDetailsURL(alertSource: AlertSource | null): string; + // (undocumented) + getEscalationPolicyDetailsURL(escalationPolicy: EscalationPolicy): string; + // (undocumented) + getIncidentDetailsURL(incident: Incident): string; + // (undocumented) + getScheduleDetailsURL(schedule: Schedule): string; + // (undocumented) + getUptimeMonitorDetailsURL(uptimeMonitor: UptimeMonitor): string; + // (undocumented) + getUserInitials(user: User | null): string; + // (undocumented) + getUserPhoneNumber(user: User | null): string; + // (undocumented) + overrideShift( + scheduleId: number, + userId: number, + start: string, + end: string, + ): Promise; + // (undocumented) + pauseUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; + // (undocumented) + resolveIncident(incident: Incident, userName: string): Promise; + // (undocumented) + resumeUptimeMonitor(uptimeMonitor: UptimeMonitor): Promise; + // (undocumented) + triggerIncidentAction( + incident: Incident, + action: IncidentAction, + ): Promise; } // @public (undocumented) @@ -172,34 +204,31 @@ export const ILertIcon: IconComponent; export const ILertPage: () => JSX.Element; // @public (undocumented) -const ilertPlugin: BackstagePlugin<{ +const ilertPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { ilertPlugin } - -export { ilertPlugin as plugin } + }, + {} +>; +export { ilertPlugin }; +export { ilertPlugin as plugin }; // @public (undocumented) export const iLertRouteRef: RouteRef; // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; - -export { isPluginApplicableToEntity as isILertAvailable } - -export { isPluginApplicableToEntity } +export { isPluginApplicableToEntity as isILertAvailable }; +export { isPluginApplicableToEntity }; // @public (undocumented) export const Router: () => JSX.Element; // @public (undocumented) export type TableState = { - page: number; - pageSize: number; + page: number; + pageSize: number; }; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/jenkins/api-report.md b/plugins/jenkins/api-report.md index 1a1c77479d..47ec8d655f 100644 --- a/plugins/jenkins/api-report.md +++ b/plugins/jenkins/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -13,71 +14,79 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityJenkinsContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityLatestJenkinsRunCard: ({ branch, variant, }: { - branch: string; - variant?: InfoCardVariants| undefined; +export const EntityLatestJenkinsRunCard: ({ + branch, + variant, +}: { + branch: string; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) const isJenkinsAvailable: (entity: Entity) => boolean; - -export { isJenkinsAvailable } - -export { isJenkinsAvailable as isPluginApplicableToEntity } +export { isJenkinsAvailable }; +export { isJenkinsAvailable as isPluginApplicableToEntity }; // @public (undocumented) -export const JENKINS_ANNOTATION = "jenkins.io/github-folder"; +export const JENKINS_ANNOTATION = 'jenkins.io/github-folder'; // @public (undocumented) export class JenkinsApi { - constructor(options: Options); - // (undocumented) - extractJobDetailsFromBuildName(buildName: string): { - jobName: string; - buildNumber: number; - }; - // (undocumented) - extractScmDetailsFromJob(jobDetails: any): any | undefined; - // (undocumented) - getBuild(buildName: string): Promise; - // (undocumented) - getFolder(folderName: string): Promise; - // (undocumented) - getJob(jobName: string): Promise; - // (undocumented) - getLastBuild(jobName: string): Promise; - // (undocumented) - mapJenkinsBuildToCITable(jenkinsResult: any, jobScmInfo?: any): CITableBuildInfo; - // (undocumented) - retry(buildName: string): Promise; + constructor(options: Options); + // (undocumented) + extractJobDetailsFromBuildName( + buildName: string, + ): { + jobName: string; + buildNumber: number; + }; + // (undocumented) + extractScmDetailsFromJob(jobDetails: any): any | undefined; + // (undocumented) + getBuild(buildName: string): Promise; + // (undocumented) + getFolder(folderName: string): Promise; + // (undocumented) + getJob(jobName: string): Promise; + // (undocumented) + getLastBuild(jobName: string): Promise; + // (undocumented) + mapJenkinsBuildToCITable( + jenkinsResult: any, + jobScmInfo?: any, + ): CITableBuildInfo; + // (undocumented) + retry(buildName: string): Promise; } // @public (undocumented) export const jenkinsApiRef: ApiRef; // @public (undocumented) -const jenkinsPlugin: BackstagePlugin<{ +const jenkinsPlugin: BackstagePlugin< + { entityContent: RouteRef; -}, {}>; - -export { jenkinsPlugin } - -export { jenkinsPlugin as plugin } + }, + {} +>; +export { jenkinsPlugin }; +export { jenkinsPlugin as plugin }; // @public (undocumented) -export const LatestRunCard: ({ branch, variant, }: { - branch: string; - variant?: InfoCardVariants | undefined; +export const LatestRunCard: ({ + branch, + variant, +}: { + branch: string; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) export const Router: (_props: Props) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/kafka-backend/api-report.md b/plugins/kafka-backend/api-report.md index 6840bd7527..f817da4a3b 100644 --- a/plugins/kafka-backend/api-report.md +++ b/plugins/kafka-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; @@ -11,7 +10,5 @@ import { Logger as Logger_2 } from 'winston'; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/kafka/api-report.md b/plugins/kafka/api-report.md index 66551aa71e..2a1001773e 100644 --- a/plugins/kafka/api-report.md +++ b/plugins/kafka/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; @@ -10,32 +11,30 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityKafkaContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; - -export { isPluginApplicableToEntity as isKafkaAvailable } - -export { isPluginApplicableToEntity } +export { isPluginApplicableToEntity as isKafkaAvailable }; +export { isPluginApplicableToEntity }; // @public (undocumented) -export const KAFKA_CONSUMER_GROUP_ANNOTATION = "kafka.apache.org/consumer-groups"; +export const KAFKA_CONSUMER_GROUP_ANNOTATION = + 'kafka.apache.org/consumer-groups'; // @public (undocumented) -const kafkaPlugin: BackstagePlugin<{ +const kafkaPlugin: BackstagePlugin< + { entityContent: RouteRef; -}, {}>; - -export { kafkaPlugin } - -export { kafkaPlugin as plugin } + }, + {} +>; +export { kafkaPlugin }; +export { kafkaPlugin as plugin }; // @public (undocumented) export const Router: (_props: Props) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/kubernetes-backend/api-report.md b/plugins/kubernetes-backend/api-report.md index a9389b7e62..bd8a7038c5 100644 --- a/plugins/kubernetes-backend/api-report.md +++ b/plugins/kubernetes-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { FetchResponse } from '@backstage/plugin-kubernetes-common'; @@ -13,16 +12,16 @@ import { Logger as Logger_2 } from 'winston'; // @public (undocumented) export interface ClusterDetails { - // (undocumented) - authProvider: string; - // (undocumented) - name: string; - // (undocumented) - serviceAccountToken?: string | undefined; - // (undocumented) - skipTLSVerify?: boolean; - // (undocumented) - url: string; + // (undocumented) + authProvider: string; + // (undocumented) + name: string; + // (undocumented) + serviceAccountToken?: string | undefined; + // (undocumented) + skipTLSVerify?: boolean; + // (undocumented) + url: string; } // @public (undocumented) @@ -30,74 +29,86 @@ export function createRouter(options: RouterOptions): Promise; // @public (undocumented) export interface CustomResource { - // (undocumented) - apiVersion: string; - // (undocumented) - group: string; - // (undocumented) - plural: string; + // (undocumented) + apiVersion: string; + // (undocumented) + group: string; + // (undocumented) + plural: string; } // @public (undocumented) export interface FetchResponseWrapper { - // (undocumented) - errors: KubernetesFetchError[]; - // (undocumented) - responses: FetchResponse[]; + // (undocumented) + errors: KubernetesFetchError[]; + // (undocumented) + responses: FetchResponse[]; } // @public (undocumented) export interface KubernetesClustersSupplier { - // (undocumented) - getClusters(): Promise; + // (undocumented) + getClusters(): Promise; } // @public (undocumented) export interface KubernetesFetcher { - // (undocumented) - fetchObjectsForService(params: ObjectFetchParams): Promise; + // (undocumented) + fetchObjectsForService( + params: ObjectFetchParams, + ): Promise; } // @public (undocumented) -export type KubernetesObjectTypes = 'pods' | 'services' | 'configmaps' | 'deployments' | 'replicasets' | 'horizontalpodautoscalers' | 'ingresses' | 'customresources'; +export type KubernetesObjectTypes = + | 'pods' + | 'services' + | 'configmaps' + | 'deployments' + | 'replicasets' + | 'horizontalpodautoscalers' + | 'ingresses' + | 'customresources'; // @public (undocumented) export interface KubernetesServiceLocator { - // (undocumented) - getClustersByServiceId(serviceId: string): Promise; + // (undocumented) + getClustersByServiceId(serviceId: string): Promise; } // @public (undocumented) -export const makeRouter: (logger: Logger_2, kubernetesFanOutHandler: KubernetesFanOutHandler, clusterDetails: ClusterDetails[]) => express.Router; +export const makeRouter: ( + logger: Logger_2, + kubernetesFanOutHandler: KubernetesFanOutHandler, + clusterDetails: ClusterDetails[], +) => express.Router; // @public (undocumented) export interface ObjectFetchParams { - // (undocumented) - clusterDetails: ClusterDetails; - // (undocumented) - customResources: CustomResource[]; - // (undocumented) - labelSelector: string; - // (undocumented) - objectTypesToFetch: Set; - // (undocumented) - serviceId: string; + // (undocumented) + clusterDetails: ClusterDetails; + // (undocumented) + customResources: CustomResource[]; + // (undocumented) + labelSelector: string; + // (undocumented) + objectTypesToFetch: Set; + // (undocumented) + serviceId: string; } // @public (undocumented) export interface RouterOptions { - // (undocumented) - clusterSupplier?: KubernetesClustersSupplier; - // (undocumented) - config: Config; - // (undocumented) - logger: Logger_2; + // (undocumented) + clusterSupplier?: KubernetesClustersSupplier; + // (undocumented) + config: Config; + // (undocumented) + logger: Logger_2; } // @public (undocumented) export type ServiceLocatorMethod = 'multiTenant' | 'http'; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index 39bfedbbf4..9888447464 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -44,7 +44,7 @@ "cors": "^2.8.5", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "helmet": "^4.0.0", "lodash": "^4.17.15", "morgan": "^1.10.0", diff --git a/plugins/kubernetes-common/api-report.md b/plugins/kubernetes-common/api-report.md index a8abec517e..34d6bd8414 100644 --- a/plugins/kubernetes-common/api-report.md +++ b/plugins/kubernetes-common/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Entity } from '@backstage/catalog-model'; import { ExtensionsV1beta1Ingress } from '@kubernetes/client-node'; import { V1ConfigMap } from '@kubernetes/client-node'; @@ -18,113 +17,123 @@ export type AuthProviderType = 'google' | 'serviceAccount' | 'aws'; // @public (undocumented) export interface ClusterObjects { - // (undocumented) - cluster: { - name: string; - }; - // (undocumented) - errors: KubernetesFetchError[]; - // (undocumented) - resources: FetchResponse[]; + // (undocumented) + cluster: { + name: string; + }; + // (undocumented) + errors: KubernetesFetchError[]; + // (undocumented) + resources: FetchResponse[]; } // @public (undocumented) export interface ConfigMapFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'configmaps'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'configmaps'; } // @public (undocumented) export interface CustomResourceFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'customresources'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'customresources'; } // @public (undocumented) export interface DeploymentFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'deployments'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'deployments'; } // @public (undocumented) -export type FetchResponse = PodFetchResponse | ServiceFetchResponse | ConfigMapFetchResponse | DeploymentFetchResponse | ReplicaSetsFetchResponse | HorizontalPodAutoscalersFetchResponse | IngressesFetchResponse | CustomResourceFetchResponse; +export type FetchResponse = + | PodFetchResponse + | ServiceFetchResponse + | ConfigMapFetchResponse + | DeploymentFetchResponse + | ReplicaSetsFetchResponse + | HorizontalPodAutoscalersFetchResponse + | IngressesFetchResponse + | CustomResourceFetchResponse; // @public (undocumented) export interface HorizontalPodAutoscalersFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'horizontalpodautoscalers'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'horizontalpodautoscalers'; } // @public (undocumented) export interface IngressesFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'ingresses'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'ingresses'; } // @public (undocumented) -export type KubernetesErrorTypes = 'BAD_REQUEST' | 'UNAUTHORIZED_ERROR' | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR'; +export type KubernetesErrorTypes = + | 'BAD_REQUEST' + | 'UNAUTHORIZED_ERROR' + | 'SYSTEM_ERROR' + | 'UNKNOWN_ERROR'; // @public (undocumented) export interface KubernetesFetchError { - // (undocumented) - errorType: KubernetesErrorTypes; - // (undocumented) - resourcePath?: string; - // (undocumented) - statusCode?: number; + // (undocumented) + errorType: KubernetesErrorTypes; + // (undocumented) + resourcePath?: string; + // (undocumented) + statusCode?: number; } // @public (undocumented) export interface KubernetesRequestBody { - // (undocumented) - auth?: { - google?: string; - }; - // (undocumented) - entity: Entity; + // (undocumented) + auth?: { + google?: string; + }; + // (undocumented) + entity: Entity; } // @public (undocumented) export interface ObjectsByEntityResponse { - // (undocumented) - items: ClusterObjects[]; + // (undocumented) + items: ClusterObjects[]; } // @public (undocumented) export interface PodFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'pods'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'pods'; } // @public (undocumented) export interface ReplicaSetsFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'replicasets'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'replicasets'; } // @public (undocumented) export interface ServiceFetchResponse { - // (undocumented) - resources: Array; - // (undocumented) - type: 'services'; + // (undocumented) + resources: Array; + // (undocumented) + type: 'services'; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/kubernetes/api-report.md b/plugins/kubernetes/api-report.md index 9c8a1fe537..9fe56bc5ca 100644 --- a/plugins/kubernetes/api-report.md +++ b/plugins/kubernetes/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -13,34 +14,34 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityKubernetesContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) export class KubernetesAuthProviders implements KubernetesAuthProvidersApi { - constructor(options: { - googleAuthApi: OAuthApi; - }); - // (undocumented) - decorateRequestBodyForAuth(authProvider: string, requestBody: KubernetesRequestBody): Promise; - } + constructor(options: { googleAuthApi: OAuthApi }); + // (undocumented) + decorateRequestBodyForAuth( + authProvider: string, + requestBody: KubernetesRequestBody, + ): Promise; +} // @public (undocumented) export const kubernetesAuthProvidersApiRef: ApiRef; // @public (undocumented) -const kubernetesPlugin: BackstagePlugin<{ +const kubernetesPlugin: BackstagePlugin< + { entityContent: RouteRef; -}, {}>; - -export { kubernetesPlugin } - -export { kubernetesPlugin as plugin } + }, + {} +>; +export { kubernetesPlugin }; +export { kubernetesPlugin as plugin }; // @public (undocumented) export const Router: (_props: Props) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/lighthouse/api-report.md b/plugins/lighthouse/api-report.md index 1a2295f891..840daa3987 100644 --- a/plugins/lighthouse/api-report.md +++ b/plugins/lighthouse/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -16,92 +17,96 @@ export type Audit = AuditRunning | AuditFailed | AuditCompleted; // @public (undocumented) export interface AuditCompleted extends AuditBase { - // (undocumented) - categories: Record; - // (undocumented) - report: Object; - // (undocumented) - status: 'COMPLETED'; - // (undocumented) - timeCompleted: string; + // (undocumented) + categories: Record; + // (undocumented) + report: Object; + // (undocumented) + status: 'COMPLETED'; + // (undocumented) + timeCompleted: string; } // @public (undocumented) export interface AuditFailed extends AuditBase { - // (undocumented) - status: 'FAILED'; - // (undocumented) - timeCompleted: string; + // (undocumented) + status: 'FAILED'; + // (undocumented) + timeCompleted: string; } // @public (undocumented) export interface AuditRunning extends AuditBase { - // (undocumented) - status: 'RUNNING'; + // (undocumented) + status: 'RUNNING'; } // @public (undocumented) export const EmbeddedRouter: (_props: Props) => JSX.Element; // @public (undocumented) -export const EntityLastLighthouseAuditCard: ({ dense, variant, }: { - dense?: boolean | undefined; - variant?: InfoCardVariants| undefined; +export const EntityLastLighthouseAuditCard: ({ + dense, + variant, +}: { + dense?: boolean | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) export const EntityLighthouseContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) export class FetchError extends Error { - // (undocumented) - static forResponse(resp: Response): Promise; - // (undocumented) - get name(): string; + // (undocumented) + static forResponse(resp: Response): Promise; + // (undocumented) + get name(): string; } // @public (undocumented) const isLighthouseAvailable: (entity: Entity) => boolean; - -export { isLighthouseAvailable } - -export { isLighthouseAvailable as isPluginApplicableToEntity } +export { isLighthouseAvailable }; +export { isLighthouseAvailable as isPluginApplicableToEntity }; // @public (undocumented) export interface LASListRequest { - // (undocumented) - limit?: number; - // (undocumented) - offset?: number; + // (undocumented) + limit?: number; + // (undocumented) + offset?: number; } // @public (undocumented) export interface LASListResponse { - // (undocumented) - items: Item[]; - // (undocumented) - limit: number; - // (undocumented) - offset: number; - // (undocumented) - total: number; + // (undocumented) + items: Item[]; + // (undocumented) + limit: number; + // (undocumented) + offset: number; + // (undocumented) + total: number; } // @public (undocumented) -export const LastLighthouseAuditCard: ({ dense, variant, }: { - dense?: boolean | undefined; - variant?: InfoCardVariants | undefined; +export const LastLighthouseAuditCard: ({ + dense, + variant, +}: { + dense?: boolean | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) export type LighthouseApi = { - url: string; - getWebsiteList: (listOptions: LASListRequest) => Promise; - getWebsiteForAuditId: (auditId: string) => Promise; - triggerAudit: (payload: TriggerAuditPayload) => Promise; - getWebsiteByUrl: (websiteUrl: string) => Promise; + url: string; + getWebsiteList: (listOptions: LASListRequest) => Promise; + getWebsiteForAuditId: (auditId: string) => Promise; + triggerAudit: (payload: TriggerAuditPayload) => Promise; + getWebsiteByUrl: (websiteUrl: string) => Promise; }; // @public (undocumented) @@ -109,45 +114,54 @@ export const lighthouseApiRef: ApiRef; // @public (undocumented) export interface LighthouseCategoryAbbr { - // (undocumented) - id: LighthouseCategoryId; - // (undocumented) - score: number; - // (undocumented) - title: string; + // (undocumented) + id: LighthouseCategoryId; + // (undocumented) + score: number; + // (undocumented) + title: string; } // @public (undocumented) -export type LighthouseCategoryId = 'pwa' | 'seo' | 'performance' | 'accessibility' | 'best-practices'; +export type LighthouseCategoryId = + | 'pwa' + | 'seo' + | 'performance' + | 'accessibility' + | 'best-practices'; // @public (undocumented) export const LighthousePage: () => JSX.Element; // @public (undocumented) -const lighthousePlugin: BackstagePlugin<{ +const lighthousePlugin: BackstagePlugin< + { root: RouteRef; entityContent: RouteRef; -}, {}>; - -export { lighthousePlugin } - -export { lighthousePlugin as plugin } + }, + {} +>; +export { lighthousePlugin }; +export { lighthousePlugin as plugin }; // @public (undocumented) export class LighthouseRestApi implements LighthouseApi { - constructor(url: string); - // (undocumented) - static fromConfig(config: Config): LighthouseRestApi; - // (undocumented) - getWebsiteByUrl(websiteUrl: string): Promise; - // (undocumented) - getWebsiteForAuditId(auditId: string): Promise; - // (undocumented) - getWebsiteList({ limit, offset, }?: LASListRequest): Promise; - // (undocumented) - triggerAudit(payload: TriggerAuditPayload): Promise; - // (undocumented) - url: string; + constructor(url: string); + // (undocumented) + static fromConfig(config: Config): LighthouseRestApi; + // (undocumented) + getWebsiteByUrl(websiteUrl: string): Promise; + // (undocumented) + getWebsiteForAuditId(auditId: string): Promise; + // (undocumented) + getWebsiteList({ + limit, + offset, + }?: LASListRequest): Promise; + // (undocumented) + triggerAudit(payload: TriggerAuditPayload): Promise; + // (undocumented) + url: string; } // @public (undocumented) @@ -155,32 +169,30 @@ export const Router: () => JSX.Element; // @public (undocumented) export interface TriggerAuditPayload { - // (undocumented) - options: { - lighthouseConfig: { - settings: { - emulatedFormFactor: string; - }; - }; + // (undocumented) + options: { + lighthouseConfig: { + settings: { + emulatedFormFactor: string; + }; }; - // (undocumented) - url: string; + }; + // (undocumented) + url: string; } // @public (undocumented) export interface Website { - // (undocumented) - audits: Audit[]; - // (undocumented) - lastAudit: Audit; - // (undocumented) - url: string; + // (undocumented) + audits: Audit[]; + // (undocumented) + lastAudit: Audit; + // (undocumented) + url: string; } // @public (undocumented) export type WebsiteListResponse = LASListResponse; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/newrelic/api-report.md b/plugins/newrelic/api-report.md index db5dd073df..005097c442 100644 --- a/plugins/newrelic/api-report.md +++ b/plugins/newrelic/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; @@ -11,15 +12,14 @@ import { RouteRef } from '@backstage/core-plugin-api'; export const NewRelicPage: () => JSX.Element; // @public (undocumented) -const newRelicPlugin: BackstagePlugin<{ +const newRelicPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { newRelicPlugin } - -export { newRelicPlugin as plugin } - + }, + {} +>; +export { newRelicPlugin }; +export { newRelicPlugin as plugin }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/org/api-report.md b/plugins/org/api-report.md index fa8d3ea80e..d541505265 100644 --- a/plugins/org/api-report.md +++ b/plugins/org/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; @@ -11,59 +12,65 @@ import { InfoCardVariants } from '@backstage/core-components'; import { UserEntity } from '@backstage/catalog-model'; // @public (undocumented) -export const EntityGroupProfileCard: ({ variant, }: { - entity?: GroupEntity| undefined; - variant?: InfoCardVariants| undefined; +export const EntityGroupProfileCard: ({ + variant, +}: { + entity?: GroupEntity | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) export const EntityMembersListCard: (_props: { - entity?: GroupEntity| undefined; + entity?: GroupEntity | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityOwnershipCard: ({ variant, }: { - entity?: Entity| undefined; - variant?: InfoCardVariants| undefined; +export const EntityOwnershipCard: ({ + variant, +}: { + entity?: Entity | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -export const EntityUserProfileCard: ({ variant, }: { - entity?: UserEntity| undefined; - variant?: InfoCardVariants| undefined; +export const EntityUserProfileCard: ({ + variant, +}: { + entity?: UserEntity | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -export const GroupProfileCard: ({ variant, }: { - entity?: GroupEntity | undefined; - variant?: InfoCardVariants | undefined; +export const GroupProfileCard: ({ + variant, +}: { + entity?: GroupEntity | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -export const MembersListCard: (_props: { - entity?: GroupEntity; -}) => JSX.Element; +export const MembersListCard: (_props: { entity?: GroupEntity }) => JSX.Element; // @public (undocumented) const orgPlugin: BackstagePlugin<{}, {}>; - -export { orgPlugin } - -export { orgPlugin as plugin } +export { orgPlugin }; +export { orgPlugin as plugin }; // @public (undocumented) -export const OwnershipCard: ({ variant, }: { - entity?: Entity | undefined; - variant?: InfoCardVariants | undefined; +export const OwnershipCard: ({ + variant, +}: { + entity?: Entity | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -export const UserProfileCard: ({ variant, }: { - entity?: UserEntity | undefined; - variant?: InfoCardVariants | undefined; +export const UserProfileCard: ({ + variant, +}: { + entity?: UserEntity | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/pagerduty/README.md b/plugins/pagerduty/README.md index bdafeb984a..2a898fc740 100644 --- a/plugins/pagerduty/README.md +++ b/plugins/pagerduty/README.md @@ -1,32 +1,41 @@ -# PagerDuty +# PagerDuty + Backstage Integration Benefits -## Overview +- Display relevant PagerDuty information about an entity within Backstage, such as the escalation policy or if there are any active incidents +- Trigger an incident to the currently on-call responder(s) for a service -This plugin displays PagerDuty information about an entity such as if there are any active incidents and what the escalation policy is. +# How it Works -There is also an easy way to trigger an alarm directly to the person who is currently on-call. +- The Backstage PagerDuty plugin allows PagerDuty information about a Backstage entity to be displayed within Backstage. This includes active incidents as well as the current on-call responders' names, email addresses, and links to their profiles in PagerDuty. +- Incidents can be manually triggered via the plugin with a user-provided description, which will in turn notify the current on-call responders. -This plugin requires that entities are annotated with an [integration key](https://support.pagerduty.com/docs/services-and-integrations#add-integrations-to-an-existing-service). See more further down in this document. +# Requirements -## Features +- Setup of the PagerDuty plugin for Backstage requires a PagerDuty Admin role in order to generate the necessary authorizations, such as the API token. If you do not have this role, please reach out to an Admin or Account Owner within your organization to request configuration of this plugin. -### View any open incidents +# Support -![PagerDuty plugin showing no incidents and the on-call rotation](doc/pd1.png) +If you need help with this plugin, please reach out on the [Backstage Discord server](https://discord.gg/MUpMjP2). -### Email link, and view contact information for staff on call +# Integration Walk-through -![PagerDuty plugin showing on-call rotation contact information](doc/pd2.png) +## In PagerDuty -### Trigger an incident for a service +### Integrating With a PagerDuty Service -![PagerDuty plugin popup modal for creating an incident](doc/pd3.png) +1. From the **Configuration** menu, select **Services**. +2. There are two ways to add an integration to a service: + - **If you are adding your integration to an existing service**: Click the **name** of the service you want to add the integration to. Then, select the **Integrations** tab and click the **New Integration** button. + - **If you are creating a new service for your integration**: Please read the documentation in section [Configuring Services and Integrations](https://support.pagerduty.com/docs/services-and-integrations#section-configuring-services-and-integrations) and follow the steps outlined in the [Create a New Service](https://support.pagerduty.com/docs/services-and-integrations#section-create-a-new-service) section, selecting **Backstage** as the **Integration Type** in step 4. Continue with the **In Backstage** section (below) once you have finished these steps. +3. Enter an **Integration Name** in the format `monitoring-tool-service-name` (e.g. `Backstage-Shopping-Cart`) and select **Backstage** from the Integration Type menu. +4. Click the **Add Integration** button to save your new integration. You will be redirected to the Integrations tab for your service. +5. An **Integration Key** will be generated on this screen. Keep this key saved in a safe place, as it will be used when you configure the integration with **Backstage** in the next section. + ![](https://pdpartner.s3.amazonaws.com/ig-template-copy-integration-key.png) -![PagerDuty plugin showing an active incident](doc/pd4.png) +## In Backstage -## Setup instructions +### Install the plugin -Install the plugin: +Install the plugin via a CLI: ```bash # From your Backstage root directory @@ -34,7 +43,7 @@ cd packages/app yarn add @backstage/plugin-pagerduty ``` -Add it to the `EntityPage.tsx`: +Next, add the plugin to `EntityPage.tsx` by adding the following code snippet where appropriate: ```ts import { @@ -51,22 +60,18 @@ import { } ``` -## Client configuration +### Configure the plugin -If you want to override the default URL for events, you can add it to `app-config.yaml`. - -In `app-config.yaml`: +First, annotate the appropriate entity with the PagerDuty integration key: ```yaml -pagerduty: - eventsBaseUrl: 'https://events.pagerduty.com/v2' +annotations: + pagerduty.com/integration-key: [INTEGRATION_KEY] ``` -## Providing the API Token +Next, provide the [API token](https://support.pagerduty.com/docs/generating-api-keys#generating-a-general-access-rest-api-key) that the client will use to make requests to the [PagerDuty API](https://developer.pagerduty.com/docs/rest-api-v2/rest-api/). -In order for the client to make requests to the [PagerDuty API](https://developer.pagerduty.com/docs/rest-api-v2/rest-api/) it needs an [API Token](https://support.pagerduty.com/docs/generating-api-keys#generating-a-general-access-rest-api-key). - -Add the proxy configuration in `app-config.yaml` +Add the proxy configuration in `app-config.yaml`: ```yaml proxy: @@ -77,23 +82,49 @@ proxy: Authorization: Token token=${PAGERDUTY_TOKEN} ``` -Then start the backend passing the token as an environment variable: +Then, start the backend, passing the PagerDuty API token as an environment variable: ```bash $ PAGERDUTY_TOKEN='' yarn start ``` -This will proxy the request by adding `Authorization` header with the provided token. +This will proxy the request by adding an `Authorization` header with the provided token. -## Integration Key +### Optional configuration -The information displayed for each entity is based on the [integration key](https://support.pagerduty.com/docs/services-and-integrations#add-integrations-to-an-existing-service). +If you want to override the default URL used for events, you can add it to `app-config.yaml`: -### Adding the integration key to the entity annotation - -If you want to use this plugin for an entity, you need to label it with the below annotation: - -```yml -annotations: - pagerduty.com/integration-key: [INTEGRATION_KEY] +```yaml +pagerduty: + eventsBaseUrl: 'https://events.pagerduty.com/v2' ``` + +# How to Uninstall + +1. Remove any configuration added in Backstage yaml files, such as the proxy configuration in `app-config.yaml` and the integration key in an entity's annotations. +2. Remove the added code snippets from `EntityPage.tsx` +3. Remove the plugin package: + +```bash +# From your Backstage root directory +cd packages/app +yarn remove @backstage/plugin-pagerduty +``` + +4. [Delete the integration](https://support.pagerduty.com/docs/services-and-integrations#delete-an-integration-from-a-service) from the service in PagerDuty + +# Feature Overview + +## View any open incidents + +![PagerDuty plugin showing no incidents and the on-call rotation](doc/pd1.png) + +## Email link, and view contact information for staff on call + +![PagerDuty plugin showing on-call rotation contact information](doc/pd2.png) + +## Trigger an incident for a service + +![PagerDuty plugin popup modal for creating an incident](doc/pd3.png) + +![PagerDuty plugin showing an active incident](doc/pd4.png) diff --git a/plugins/pagerduty/api-report.md b/plugins/pagerduty/api-report.md index bb3853ae49..e0278c5d27 100644 --- a/plugins/pagerduty/api-report.md +++ b/plugins/pagerduty/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -16,10 +17,8 @@ export const EntityPagerDutyCard: () => JSX.Element; // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; - -export { isPluginApplicableToEntity as isPagerDutyAvailable } - -export { isPluginApplicableToEntity } +export { isPluginApplicableToEntity as isPagerDutyAvailable }; +export { isPluginApplicableToEntity }; // @public (undocumented) export const pagerDutyApiRef: ApiRef; @@ -29,34 +28,39 @@ export const PagerDutyCard: () => JSX.Element; // @public (undocumented) export class PagerDutyClient implements PagerDutyApi { - constructor(config: ClientApiConfig); - // (undocumented) - static fromConfig(configApi: ConfigApi, discoveryApi: DiscoveryApi): PagerDutyClient; - // (undocumented) - getIncidentsByServiceId(serviceId: string): Promise; - // (undocumented) - getOnCallByPolicyId(policyId: string): Promise; - // (undocumented) - getServiceByIntegrationKey(integrationKey: string): Promise; - // (undocumented) - triggerAlarm({ integrationKey, source, description, userName, }: TriggerAlarmRequest): Promise; + constructor(config: ClientApiConfig); + // (undocumented) + static fromConfig( + configApi: ConfigApi, + discoveryApi: DiscoveryApi, + ): PagerDutyClient; + // (undocumented) + getIncidentsByServiceId(serviceId: string): Promise; + // (undocumented) + getOnCallByPolicyId(policyId: string): Promise; + // (undocumented) + getServiceByIntegrationKey(integrationKey: string): Promise; + // (undocumented) + triggerAlarm({ + integrationKey, + source, + description, + userName, + }: TriggerAlarmRequest): Promise; } // @public (undocumented) const pagerDutyPlugin: BackstagePlugin<{}, {}>; - -export { pagerDutyPlugin } - -export { pagerDutyPlugin as plugin } +export { pagerDutyPlugin }; +export { pagerDutyPlugin as plugin }; // @public (undocumented) -export function TriggerButton({ children, }: PropsWithChildren): JSX.Element; +export function TriggerButton({ + children, +}: PropsWithChildren): JSX.Element; // @public (undocumented) -export class UnauthorizedError extends Error { -} - +export class UnauthorizedError extends Error {} // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/pagerduty/doc/pd1.png b/plugins/pagerduty/doc/pd1.png index 8242792b5a..dc5a1a94a2 100644 Binary files a/plugins/pagerduty/doc/pd1.png and b/plugins/pagerduty/doc/pd1.png differ diff --git a/plugins/pagerduty/doc/pd3.png b/plugins/pagerduty/doc/pd3.png index 89d7f1820d..0546b4e7b5 100644 Binary files a/plugins/pagerduty/doc/pd3.png and b/plugins/pagerduty/doc/pd3.png differ diff --git a/plugins/pagerduty/doc/pd4.png b/plugins/pagerduty/doc/pd4.png index 70584bc59e..a9aa93c2ba 100644 Binary files a/plugins/pagerduty/doc/pd4.png and b/plugins/pagerduty/doc/pd4.png differ diff --git a/plugins/proxy-backend/api-report.md b/plugins/proxy-backend/api-report.md index 63469a2017..812c3f7221 100644 --- a/plugins/proxy-backend/api-report.md +++ b/plugins/proxy-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; @@ -12,7 +11,5 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/register-component/api-report.md b/plugins/register-component/api-report.md index b41bf50f05..a150f4be2c 100644 --- a/plugins/register-component/api-report.md +++ b/plugins/register-component/api-report.md @@ -3,30 +3,34 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) -export const RegisterComponentPage: ({ catalogRouteRef, }: { - catalogRouteRef: RouteRef; +export const RegisterComponentPage: ({ + catalogRouteRef, +}: { + catalogRouteRef: RouteRef; }) => JSX.Element; // @public (undocumented) -const registerComponentPlugin: BackstagePlugin<{ +const registerComponentPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { registerComponentPlugin as plugin } - -export { registerComponentPlugin } + }, + {} +>; +export { registerComponentPlugin as plugin }; +export { registerComponentPlugin }; // @public @deprecated -export const Router: ({ catalogRouteRef }: { - catalogRouteRef: RouteRef; +export const Router: ({ + catalogRouteRef, +}: { + catalogRouteRef: RouteRef; }) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/rollbar-backend/api-report.md b/plugins/rollbar-backend/api-report.md index 9fa525cfc3..02a79fa267 100644 --- a/plugins/rollbar-backend/api-report.md +++ b/plugins/rollbar-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; @@ -12,49 +11,58 @@ import { Logger as Logger_2 } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @public (undocumented) -export function getRequestHeaders(token: string): { - headers: { - 'X-Rollbar-Access-Token': string; - }; +export function getRequestHeaders( + token: string, +): { + headers: { + 'X-Rollbar-Access-Token': string; + }; }; // @public (undocumented) export class RollbarApi { - constructor(accessToken: string, logger: Logger_2); - // (undocumented) - getActivatedCounts(projectName: string, options?: { - environment: string; - item_id?: number; - }): Promise; - // (undocumented) - getAllProjects(): Promise; - // (undocumented) - getOccuranceCounts(projectName: string, options?: { - environment: string; - item_id?: number; - }): Promise; - // (undocumented) - getProject(projectName: string): Promise; - // (undocumented) - getProjectItems(projectName: string): Promise; - // (undocumented) - getTopActiveItems(projectName: string, options?: { - hours: number; - environment: string; - }): Promise; - } + constructor(accessToken: string, logger: Logger_2); + // (undocumented) + getActivatedCounts( + projectName: string, + options?: { + environment: string; + item_id?: number; + }, + ): Promise; + // (undocumented) + getAllProjects(): Promise; + // (undocumented) + getOccuranceCounts( + projectName: string, + options?: { + environment: string; + item_id?: number; + }, + ): Promise; + // (undocumented) + getProject(projectName: string): Promise; + // (undocumented) + getProjectItems(projectName: string): Promise; + // (undocumented) + getTopActiveItems( + projectName: string, + options?: { + hours: number; + environment: string; + }, + ): Promise; +} // @public (undocumented) export interface RouterOptions { - // (undocumented) - config: Config; - // (undocumented) - logger: Logger_2; - // (undocumented) - rollbarApi?: RollbarApi; + // (undocumented) + config: Config; + // (undocumented) + logger: Logger_2; + // (undocumented) + rollbarApi?: RollbarApi; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/rollbar-backend/package.json b/plugins/rollbar-backend/package.json index ad3c04698d..6f6d87e30e 100644 --- a/plugins/rollbar-backend/package.json +++ b/plugins/rollbar-backend/package.json @@ -39,7 +39,7 @@ "cors": "^2.8.5", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "helmet": "^4.0.0", "lodash": "^4.17.15", "morgan": "^1.10.0", diff --git a/plugins/rollbar/api-report.md b/plugins/rollbar/api-report.md index 44bd9d0d5e..c2ea5bb364 100644 --- a/plugins/rollbar/api-report.md +++ b/plugins/rollbar/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -16,29 +17,30 @@ export const EntityPageRollbar: (_props: Props) => JSX.Element; // @public (undocumented) export const EntityRollbarContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) const isPluginApplicableToEntity: (entity: Entity) => boolean; - -export { isPluginApplicableToEntity } - -export { isPluginApplicableToEntity as isRollbarAvailable } +export { isPluginApplicableToEntity }; +export { isPluginApplicableToEntity as isRollbarAvailable }; // @public (undocumented) -export const ROLLBAR_ANNOTATION = "rollbar.com/project-slug"; +export const ROLLBAR_ANNOTATION = 'rollbar.com/project-slug'; // @public (undocumented) export interface RollbarApi { - // (undocumented) - getAllProjects(): Promise; - // (undocumented) - getProject(projectName: string): Promise; - // (undocumented) - getProjectItems(project: string): Promise; - // (undocumented) - getTopActiveItems(project: string, hours?: number): Promise; + // (undocumented) + getAllProjects(): Promise; + // (undocumented) + getProject(projectName: string): Promise; + // (undocumented) + getProjectItems(project: string): Promise; + // (undocumented) + getTopActiveItems( + project: string, + hours?: number, + ): Promise; } // @public (undocumented) @@ -46,33 +48,36 @@ export const rollbarApiRef: ApiRef; // @public (undocumented) export class RollbarClient implements RollbarApi { - constructor(options: { - discoveryApi: DiscoveryApi; - identityApi: IdentityApi; - }); - // (undocumented) - getAllProjects(): Promise; - // (undocumented) - getProject(projectName: string): Promise; - // (undocumented) - getProjectItems(project: string): Promise; - // (undocumented) - getTopActiveItems(project: string, hours?: number, environment?: string): Promise; - } + constructor(options: { + discoveryApi: DiscoveryApi; + identityApi: IdentityApi; + }); + // (undocumented) + getAllProjects(): Promise; + // (undocumented) + getProject(projectName: string): Promise; + // (undocumented) + getProjectItems(project: string): Promise; + // (undocumented) + getTopActiveItems( + project: string, + hours?: number, + environment?: string, + ): Promise; +} // @public (undocumented) -const rollbarPlugin: BackstagePlugin<{ +const rollbarPlugin: BackstagePlugin< + { entityContent: RouteRef; -}, {}>; - -export { rollbarPlugin as plugin } - -export { rollbarPlugin } + }, + {} +>; +export { rollbarPlugin as plugin }; +export { rollbarPlugin }; // @public (undocumented) export const Router: (_props: Props_2) => JSX.Element; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/scaffolder-backend-module-rails/api-report.md b/plugins/scaffolder-backend-module-rails/api-report.md index 95d9c1bd9f..dc26d22fe4 100644 --- a/plugins/scaffolder-backend-module-rails/api-report.md +++ b/plugins/scaffolder-backend-module-rails/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { ContainerRunner } from '@backstage/backend-common'; import { ScmIntegrations } from '@backstage/integration'; import { TemplateAction } from '@backstage/plugin-scaffolder-backend'; @@ -11,12 +10,10 @@ import { UrlReader } from '@backstage/backend-common'; // @public (undocumented) export function createFetchRailsAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; - containerRunner: ContainerRunner; + reader: UrlReader; + integrations: ScmIntegrations; + containerRunner: ContainerRunner; }): TemplateAction; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts index b1ddadc6d9..60251a702d 100644 --- a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts +++ b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts @@ -56,6 +56,7 @@ export type RailsRunOptions = { export const railsArgumentResolver = ( projectRoot: string, options: RailsRunOptions, + executionOnContainer = false, ): string[] => { const argumentsToRun: string[] = []; @@ -103,7 +104,7 @@ export const railsArgumentResolver = ( argumentsToRun.push( options.template.replace( `.${separatorPath}`, - `${projectRoot}${separatorPath}`, + `${projectRoot}${executionOnContainer ? '/' : separatorPath}`, ), ); } diff --git a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.test.ts b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.test.ts index dc3f824236..abf89f6a0d 100644 --- a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.test.ts +++ b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.test.ts @@ -137,7 +137,7 @@ describe('Rails Templater', () => { owner: 'angeliski', storePath: 'https://github.com/angeliski/rails-project', name: 'rails-project', - railsArguments: { template: './something.rb' }, + railsArguments: { template: `.${path.sep}something.rb` }, imageName: 'foo/rails-custom-image', }; @@ -210,7 +210,7 @@ describe('Rails Templater', () => { owner: 'angeliski', storePath: 'https://github.com/angeliski/rails-project', name: 'rails-project', - railsArguments: { template: './something.rb' }, + railsArguments: { template: `.${path.sep}something.rb` }, imageName: 'foo/rails-custom-image', }; diff --git a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.ts b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.ts index 3e18490587..a828800e84 100644 --- a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.ts +++ b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsNewRunner.ts @@ -68,7 +68,7 @@ export class RailsNewRunner { command: baseCommand, args: [ ...baseArguments, - `${intermediateDir}/${name}`, + `${intermediateDir}${path.sep}${name}`, ...arrayExtraArguments, ], logStream, @@ -77,6 +77,7 @@ export class RailsNewRunner { const arrayExtraArguments = railsArgumentResolver( '/input', railsArguments as RailsRunOptions, + true, ); await this.containerRunner.runContainer({ imageName: imageName as string, diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index cca05b3333..d6aa1e4e75 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; @@ -22,37 +23,40 @@ import { Writable } from 'stream'; // @public (undocumented) export type ActionContext = { - baseUrl?: string; - logger: Logger_2; - logStream: Writable; - token?: string | undefined; - workspacePath: string; - input: Input; - output(name: string, value: JsonValue): void; - createTemporaryDirectory(): Promise; + baseUrl?: string; + logger: Logger_2; + logStream: Writable; + token?: string | undefined; + workspacePath: string; + input: Input; + output(name: string, value: JsonValue): void; + createTemporaryDirectory(): Promise; }; // @public export class CatalogEntityClient { - constructor(catalogClient: CatalogApi); - findTemplate(templateName: string, options?: { - token?: string; - }): Promise; + constructor(catalogClient: CatalogApi); + findTemplate( + templateName: string, + options?: { + token?: string; + }, + ): Promise; } // @public (undocumented) export const createBuiltinActions: (options: { - reader: UrlReader; - integrations: ScmIntegrations; - catalogClient: CatalogApi; - containerRunner: ContainerRunner; - config: Config; + reader: UrlReader; + integrations: ScmIntegrations; + catalogClient: CatalogApi; + containerRunner: ContainerRunner; + config: Config; }) => TemplateAction[]; // @public (undocumented) export function createCatalogRegisterAction(options: { - catalogClient: CatalogApi; - integrations: ScmIntegrations; + catalogClient: CatalogApi; + integrations: ScmIntegrations; }): TemplateAction; // @public (undocumented) @@ -63,21 +67,21 @@ export function createDebugLogAction(): TemplateAction; // @public (undocumented) export function createFetchCookiecutterAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; - containerRunner: ContainerRunner; + reader: UrlReader; + integrations: ScmIntegrations; + containerRunner: ContainerRunner; }): TemplateAction; // @public (undocumented) export function createFetchPlainAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; + reader: UrlReader; + integrations: ScmIntegrations; }): TemplateAction; // @public (undocumented) export function createFetchTemplateAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; + reader: UrlReader; + integrations: ScmIntegrations; }): TemplateAction; // @public (undocumented) @@ -88,14 +92,14 @@ export const createFilesystemRenameAction: () => TemplateAction; // @public (undocumented) export function createPublishAzureAction(options: { - integrations: ScmIntegrationRegistry; - config: Config; + integrations: ScmIntegrationRegistry; + config: Config; }): TemplateAction; // @public (undocumented) export function createPublishBitbucketAction(options: { - integrations: ScmIntegrationRegistry; - config: Config; + integrations: ScmIntegrationRegistry; + config: Config; }): TemplateAction; // @public @@ -103,81 +107,98 @@ export function createPublishFileAction(): TemplateAction; // @public (undocumented) export function createPublishGithubAction(options: { - integrations: ScmIntegrationRegistry; - config: Config; + integrations: ScmIntegrationRegistry; + config: Config; }): TemplateAction; // @public (undocumented) -export const createPublishGithubPullRequestAction: ({ integrations, clientFactory, }: CreateGithubPullRequestActionOptions) => TemplateAction; +export const createPublishGithubPullRequestAction: ({ + integrations, + clientFactory, +}: CreateGithubPullRequestActionOptions) => TemplateAction; // @public (undocumented) export function createPublishGitlabAction(options: { - integrations: ScmIntegrationRegistry; - config: Config; + integrations: ScmIntegrationRegistry; + config: Config; }): TemplateAction; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; // @public (undocumented) -export const createTemplateAction: | undefined; -}>>(templateAction: TemplateAction) => TemplateAction; +export const createTemplateAction: < + Input extends Partial<{ + [name: string]: JsonValue | Partial | undefined; + }> +>( + templateAction: TemplateAction, +) => TemplateAction; // @public (undocumented) -export function fetchContents({ reader, integrations, baseUrl, fetchUrl, outputPath, }: { - reader: UrlReader; - integrations: ScmIntegrations; - baseUrl?: string; - fetchUrl?: JsonValue; - outputPath: string; +export function fetchContents({ + reader, + integrations, + baseUrl, + fetchUrl, + outputPath, +}: { + reader: UrlReader; + integrations: ScmIntegrations; + baseUrl?: string; + fetchUrl?: JsonValue; + outputPath: string; }): Promise; // @public (undocumented) export interface RouterOptions { - // (undocumented) - actions?: TemplateAction[]; - // (undocumented) - catalogClient: CatalogApi; - // (undocumented) - config: Config; - // (undocumented) - containerRunner: ContainerRunner; - // (undocumented) - database: PluginDatabaseManager; - // (undocumented) - logger: Logger_2; - // (undocumented) - reader: UrlReader; - // (undocumented) - taskWorkers?: number; + // (undocumented) + actions?: TemplateAction[]; + // (undocumented) + catalogClient: CatalogApi; + // (undocumented) + config: Config; + // (undocumented) + containerRunner: ContainerRunner; + // (undocumented) + database: PluginDatabaseManager; + // (undocumented) + logger: Logger_2; + // (undocumented) + reader: UrlReader; + // (undocumented) + taskWorkers?: number; } // @public (undocumented) -export const runCommand: ({ command, args, logStream, }: RunCommandOptions) => Promise; +export const runCommand: ({ + command, + args, + logStream, +}: RunCommandOptions) => Promise; // @public (undocumented) export type TemplateAction = { - id: string; - description?: string; - schema?: { - input?: Schema; - output?: Schema; - }; - handler: (ctx: ActionContext) => Promise; + id: string; + description?: string; + schema?: { + input?: Schema; + output?: Schema; + }; + handler: (ctx: ActionContext) => Promise; }; // @public (undocumented) export class TemplateActionRegistry { - // (undocumented) - get(actionId: string): TemplateAction; - // (undocumented) - list(): TemplateAction[]; - // (undocumented) - register(action: TemplateAction): void; + // (undocumented) + get(actionId: string): TemplateAction; + // (undocumented) + list(): TemplateAction[]; + // (undocumented) + register( + action: TemplateAction, + ): void; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 7a280f7255..d31e6c0d5f 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -46,7 +46,7 @@ "cross-fetch": "^3.0.6", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "10.0.0", "git-url-parse": "~11.4.4", "globby": "^11.0.0", "handlebars": "^4.7.6", diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.test.ts index 32527afd5d..2ba30bb3db 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.test.ts @@ -67,8 +67,7 @@ describe('createPublishGithubPullRequestAction', () => { beforeEach(() => { input = { - owner: 'myorg', - repo: 'myrepo', + repoUrl: 'github.com?owner=myorg&repo=myrepo', title: 'Create my new app', branchName: 'new-app', description: 'This PR is really good', @@ -127,8 +126,7 @@ describe('createPublishGithubPullRequestAction', () => { beforeEach(() => { input = { - owner: 'myorg', - repo: 'myrepo', + repoUrl: 'github.com?owner=myorg&repo=myrepo', title: 'Create my new app', branchName: 'new-app', description: 'This PR is really good', diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts index 18ceeca3c9..1c46e80d03 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts @@ -49,10 +49,7 @@ export type GithubPullRequestActionInput = { title: string; branchName: string; description: string; - owner?: string; - repo?: string; - repoUrl?: string; - host?: string; + repoUrl: string; targetPath?: string; sourcePath?: string; }; @@ -119,18 +116,13 @@ export const createPublishGithubPullRequestAction = ({ id: 'publish:github:pull-request', schema: { input: { - required: ['owner', 'repo', 'title', 'description', 'branchName'], + required: ['repoUrl', 'title', 'description', 'branchName'], type: 'object', properties: { - owner: { + repoUrl: { + title: 'Repository Location', + description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the repository name and 'owner' is an organization or username`, type: 'string', - title: 'Repository owner', - description: 'The owner of the target repository', - }, - repo: { - type: 'string', - title: 'Repository', - description: 'The github repository to create the file in', }, branchName: { type: 'string', @@ -173,8 +165,6 @@ export const createPublishGithubPullRequestAction = ({ }, }, async handler(ctx) { - let { owner, repo } = ctx.input; - let host = 'github.com'; const { repoUrl, branchName, @@ -184,18 +174,7 @@ export const createPublishGithubPullRequestAction = ({ sourcePath, } = ctx.input; - if (repoUrl) { - const parsed = parseRepoUrl(repoUrl); - host = parsed.host; - owner = parsed.owner; - repo = parsed.repo; - } - - if (!host || !owner || !repo) { - throw new InputError( - 'must provide either valid repo URL or owner and repo as parameters', - ); - } + const { owner, repo, host } = parseRepoUrl(repoUrl); const client = await clientFactory({ integrations, host, owner, repo }); const fileRoot = sourcePath diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index 2b5bdb3bf8..cee9d2cfb4 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -233,17 +233,19 @@ export async function createRouter( ); } + let shouldUnsubscribe = false; for (const event of events) { res.write( `event: ${event.type}\ndata: ${JSON.stringify(event)}\n\n`, ); if (event.type === 'completion') { - unsubscribe(); + shouldUnsubscribe = true; // Closing the event stream here would cause the frontend // to automatically reconnect because it lost connection. } } res.flush(); + if (shouldUnsubscribe) unsubscribe(); }, ); // When client closes connection we update the clients list diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 7982ad997e..2f9d10b7ac 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiHolder } from '@backstage/core-plugin-api'; import { ApiRef } from '@backstage/core-plugin-api'; @@ -23,21 +24,29 @@ import { RouteRef } from '@backstage/core-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; // @public (undocumented) -export function createScaffolderFieldExtension(options: FieldExtensionOptions): Extension<() => null>; +export function createScaffolderFieldExtension( + options: FieldExtensionOptions, +): Extension<() => null>; // @public (undocumented) -export type CustomFieldValidator = ((data: T, field: FieldValidation) => void) | ((data: T, field: FieldValidation, context: { - apiHolder: ApiHolder; -}) => void); +export type CustomFieldValidator = + | ((data: T, field: FieldValidation) => void) + | (( + data: T, + field: FieldValidation, + context: { + apiHolder: ApiHolder; + }, + ) => void); // @public (undocumented) export const EntityPickerFieldExtension: () => null; // @public (undocumented) export type FieldExtensionOptions = { - name: string; - component: (props: FieldProps) => JSX.Element | null; - validation?: CustomFieldValidator; + name: string; + component: (props: FieldProps) => JSX.Element | null; + validation?: CustomFieldValidator; }; // @public (undocumented) @@ -48,26 +57,33 @@ export const RepoUrlPickerFieldExtension: () => null; // @public (undocumented) export interface ScaffolderApi { - // (undocumented) - getIntegrationsList(options: { - allowedHosts: string[]; - }): Promise<{ - type: string; - title: string; - host: string; - }[]>; - // (undocumented) - getTask(taskId: string): Promise; - // (undocumented) - getTemplateParameterSchema(templateName: EntityName): Promise; - // (undocumented) - listActions(): Promise; - scaffold(templateName: string, values: Record): Promise; - // (undocumented) - streamLogs({ taskId, after, }: { - taskId: string; - after?: number; - }): Observable; + // (undocumented) + getIntegrationsList(options: { + allowedHosts: string[]; + }): Promise< + { + type: string; + title: string; + host: string; + }[] + >; + // (undocumented) + getTask(taskId: string): Promise; + // (undocumented) + getTemplateParameterSchema( + templateName: EntityName, + ): Promise; + // (undocumented) + listActions(): Promise; + scaffold(templateName: string, values: Record): Promise; + // (undocumented) + streamLogs({ + taskId, + after, + }: { + taskId: string; + after?: number; + }): Observable; } // @public (undocumented) @@ -75,31 +91,38 @@ export const scaffolderApiRef: ApiRef; // @public (undocumented) export class ScaffolderClient implements ScaffolderApi { - constructor(options: { - discoveryApi: DiscoveryApi; - identityApi: IdentityApi; - scmIntegrationsApi: ScmIntegrationRegistry; - }); - // (undocumented) - getIntegrationsList(options: { - allowedHosts: string[]; - }): Promise<{ - type: string; - title: string; - host: string; - }[]>; - // (undocumented) - getTask(taskId: string): Promise; - // (undocumented) - getTemplateParameterSchema(templateName: EntityName): Promise; - // (undocumented) - listActions(): Promise; - scaffold(templateName: string, values: Record): Promise; - // (undocumented) - streamLogs({ taskId, after, }: { - taskId: string; - after?: number; - }): Observable; + constructor(options: { + discoveryApi: DiscoveryApi; + identityApi: IdentityApi; + scmIntegrationsApi: ScmIntegrationRegistry; + }); + // (undocumented) + getIntegrationsList(options: { + allowedHosts: string[]; + }): Promise< + { + type: string; + title: string; + host: string; + }[] + >; + // (undocumented) + getTask(taskId: string): Promise; + // (undocumented) + getTemplateParameterSchema( + templateName: EntityName, + ): Promise; + // (undocumented) + listActions(): Promise; + scaffold(templateName: string, values: Record): Promise; + // (undocumented) + streamLogs({ + taskId, + after, + }: { + taskId: string; + after?: number; + }): Observable; } // @public (undocumented) @@ -109,17 +132,16 @@ export const ScaffolderFieldExtensions: React_2.ComponentType; export const ScaffolderPage: () => JSX.Element; // @public (undocumented) -const scaffolderPlugin: BackstagePlugin<{ +const scaffolderPlugin: BackstagePlugin< + { root: RouteRef; -}, { + }, + { registerComponent: ExternalRouteRef; -}>; - -export { scaffolderPlugin as plugin } - -export { scaffolderPlugin } - + } +>; +export { scaffolderPlugin as plugin }; +export { scaffolderPlugin }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/search-backend-node/api-report.md b/plugins/search-backend-node/api-report.md index ff35515389..d327dee01b 100644 --- a/plugins/search-backend-node/api-report.md +++ b/plugins/search-backend-node/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { DocumentCollator } from '@backstage/search-common'; import { DocumentDecorator } from '@backstage/search-common'; import { IndexableDocument } from '@backstage/search-common'; @@ -14,55 +13,52 @@ import { SearchResultSet } from '@backstage/search-common'; // @public (undocumented) export class IndexBuilder { - constructor({ logger, searchEngine }: IndexBuilderOptions); - addCollator({ collator, defaultRefreshIntervalSeconds, }: RegisterCollatorParameters): void; - addDecorator({ decorator }: RegisterDecoratorParameters): void; - build(): Promise<{ - scheduler: Scheduler; - }>; - // (undocumented) - getSearchEngine(): SearchEngine; - } + constructor({ logger, searchEngine }: IndexBuilderOptions); + addCollator({ + collator, + defaultRefreshIntervalSeconds, + }: RegisterCollatorParameters): void; + addDecorator({ decorator }: RegisterDecoratorParameters): void; + build(): Promise<{ + scheduler: Scheduler; + }>; + // (undocumented) + getSearchEngine(): SearchEngine; +} // @public (undocumented) export class LunrSearchEngine implements SearchEngine { - constructor({ logger }: { - logger: Logger_2; - }); - // (undocumented) - protected docStore: Record; - // (undocumented) - index(type: string, documents: IndexableDocument[]): Promise; - // (undocumented) - protected logger: Logger_2; - // (undocumented) - protected lunrIndices: Record; - // (undocumented) - query(query: SearchQuery): Promise; - // (undocumented) - setTranslator(translator: LunrQueryTranslator): void; - // (undocumented) - protected translator: QueryTranslator; + constructor({ logger }: { logger: Logger_2 }); + // (undocumented) + protected docStore: Record; + // (undocumented) + index(type: string, documents: IndexableDocument[]): Promise; + // (undocumented) + protected logger: Logger_2; + // (undocumented) + protected lunrIndices: Record; + // (undocumented) + query(query: SearchQuery): Promise; + // (undocumented) + setTranslator(translator: LunrQueryTranslator): void; + // (undocumented) + protected translator: QueryTranslator; } // @public export class Scheduler { - constructor({ logger }: { - logger: Logger_2; - }); - addToSchedule(task: Function, interval: number): void; - start(): void; - stop(): void; + constructor({ logger }: { logger: Logger_2 }); + addToSchedule(task: Function, interval: number): void; + start(): void; + stop(): void; } // @public export interface SearchEngine { - index(type: string, documents: IndexableDocument[]): Promise; - query(query: SearchQuery): Promise; - setTranslator(translator: QueryTranslator): void; + index(type: string, documents: IndexableDocument[]): Promise; + query(query: SearchQuery): Promise; + setTranslator(translator: QueryTranslator): void; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/search-backend/api-report.md b/plugins/search-backend/api-report.md index 7eba677439..b4202a1916 100644 --- a/plugins/search-backend/api-report.md +++ b/plugins/search-backend/api-report.md @@ -3,15 +3,15 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import express from 'express'; import { Logger as Logger_2 } from 'winston'; import { SearchEngine } from '@backstage/plugin-search-backend-node'; // @public (undocumented) -export function createRouter({ engine, logger, }: RouterOptions): Promise; - +export function createRouter({ + engine, + logger, +}: RouterOptions): Promise; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/search/api-report.md b/plugins/search/api-report.md index 5451ed9adb..27ecf213bb 100644 --- a/plugins/search/api-report.md +++ b/plugins/search/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { AsyncState } from 'react-use/lib/useAsync'; @@ -17,20 +18,31 @@ import { SearchResult as SearchResult_2 } from '@backstage/search-common'; import { SearchResultSet } from '@backstage/search-common'; // @public (undocumented) -export const DefaultResultListItem: ({ result }: { - result: IndexableDocument; +export const DefaultResultListItem: ({ + result, +}: { + result: IndexableDocument; }) => JSX.Element; // @public (undocumented) -export const Filters: ({ filters, filterOptions, resetFilters, updateSelected, updateChecked, }: FiltersProps) => JSX.Element; +export const Filters: ({ + filters, + filterOptions, + resetFilters, + updateSelected, + updateChecked, +}: FiltersProps) => JSX.Element; // @public (undocumented) -export const FiltersButton: ({ numberOfSelectedFilters, handleToggleFilters, }: FiltersButtonProps) => JSX.Element; +export const FiltersButton: ({ + numberOfSelectedFilters, + handleToggleFilters, +}: FiltersButtonProps) => JSX.Element; // @public (undocumented) export type FiltersState = { - selected: string; - checked: Array; + selected: string; + checked: Array; }; // @public (undocumented) @@ -43,28 +55,34 @@ export const searchApiRef: ApiRef; export const SearchBar: ({ className, debounceTime }: Props) => JSX.Element; // @public @deprecated (undocumented) -export const SearchBarNext: ({ className, debounceTime }: { - className?: string | undefined; - debounceTime?: number | undefined; +export const SearchBarNext: ({ + className, + debounceTime, +}: { + className?: string | undefined; + debounceTime?: number | undefined; }) => JSX.Element; // @public (undocumented) -export const SearchContextProvider: ({ initialState, children, }: React_2.PropsWithChildren<{ - initialState?: SettableSearchContext | undefined; +export const SearchContextProvider: ({ + initialState, + children, +}: React_2.PropsWithChildren<{ + initialState?: SettableSearchContext | undefined; }>) => JSX.Element; // @public (undocumented) export const SearchFilter: { - ({ component: Element, ...props }: Props_2): JSX.Element; - Checkbox(props: Omit & Component): JSX.Element; - Select(props: Omit & Component): JSX.Element; + ({ component: Element, ...props }: Props_2): JSX.Element; + Checkbox(props: Omit & Component): JSX.Element; + Select(props: Omit & Component): JSX.Element; }; // @public @deprecated (undocumented) export const SearchFilterNext: { - ({ component: Element, ...props }: Props_2): JSX.Element; - Checkbox(props: Omit & Component): JSX.Element; - Select(props: Omit & Component): JSX.Element; + ({ component: Element, ...props }: Props_2): JSX.Element; + Checkbox(props: Omit & Component): JSX.Element; + Select(props: Omit & Component): JSX.Element; }; // @public (undocumented) @@ -74,20 +92,21 @@ export const SearchPage: () => JSX.Element; export const SearchPageNext: () => JSX.Element; // @public (undocumented) -const searchPlugin: BackstagePlugin<{ +const searchPlugin: BackstagePlugin< + { root: RouteRef; nextRoot: RouteRef; -}, {}>; - -export { searchPlugin as plugin } - -export { searchPlugin } + }, + {} +>; +export { searchPlugin as plugin }; +export { searchPlugin }; // @public (undocumented) -export const SearchResult: ({ children }: { - children: (results: { - results: SearchResult_2[]; - }) => JSX.Element; +export const SearchResult: ({ + children, +}: { + children: (results: { results: SearchResult_2[] }) => JSX.Element; }) => JSX.Element; // @public (undocumented) @@ -96,7 +115,5 @@ export const SidebarSearch: () => JSX.Element; // @public (undocumented) export const useSearch: () => SearchContextValue; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/sentry/api-report.md b/plugins/sentry/api-report.md index c3cce9ed7c..ebb4cfa357 100644 --- a/plugins/sentry/api-report.md +++ b/plugins/sentry/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -19,26 +20,24 @@ export const EntitySentryContent: () => JSX.Element; // @public (undocumented) export class MockSentryApi implements SentryApi { - // (undocumented) - fetchIssues(): Promise; + // (undocumented) + fetchIssues(): Promise; } // @public (undocumented) export class ProductionSentryApi implements SentryApi { - constructor(discoveryApi: DiscoveryApi, organization: string); - // (undocumented) - fetchIssues(project: string, statsFor: string): Promise; - } + constructor(discoveryApi: DiscoveryApi, organization: string); + // (undocumented) + fetchIssues(project: string, statsFor: string): Promise; +} // @public (undocumented) -export const Router: ({ entity }: { - entity: Entity; -}) => JSX.Element; +export const Router: ({ entity }: { entity: Entity }) => JSX.Element; // @public (undocumented) export interface SentryApi { - // (undocumented) - fetchIssues(project: string, statsFor: string): Promise; + // (undocumented) + fetchIssues(project: string, statsFor: string): Promise; } // @public (undocumented) @@ -46,55 +45,58 @@ export const sentryApiRef: ApiRef; // @public (undocumented) export type SentryIssue = { - platform: SentryPlatform; - lastSeen: string; - numComments: number; - userCount: number; - stats: { - '24h'?: EventPoint[]; - '12h'?: EventPoint[]; - }; - culprit: string; - title: string; - id: string; - assignedTo: any; - logger: any; - type: string; - annotations: any[]; - metadata: SentryIssueMetadata; - status: string; - subscriptionDetails: any; - isPublic: boolean; - hasSeen: boolean; - shortId: string; - shareId: string | null; - firstSeen: string; - count: string; - permalink: string; - level: string; - isSubscribed: boolean; - isBookmarked: boolean; - project: SentryProject; - statusDetails: any; + platform: SentryPlatform; + lastSeen: string; + numComments: number; + userCount: number; + stats: { + '24h'?: EventPoint[]; + '12h'?: EventPoint[]; + }; + culprit: string; + title: string; + id: string; + assignedTo: any; + logger: any; + type: string; + annotations: any[]; + metadata: SentryIssueMetadata; + status: string; + subscriptionDetails: any; + isPublic: boolean; + hasSeen: boolean; + shortId: string; + shareId: string | null; + firstSeen: string; + count: string; + permalink: string; + level: string; + isSubscribed: boolean; + isBookmarked: boolean; + project: SentryProject; + statusDetails: any; }; // @public (undocumented) -export const SentryIssuesWidget: ({ entity, statsFor, variant, }: { - entity: Entity; - statsFor?: "12h" | "24h" | undefined; - variant?: InfoCardVariants | undefined; +export const SentryIssuesWidget: ({ + entity, + statsFor, + variant, +}: { + entity: Entity; + statsFor?: '12h' | '24h' | undefined; + variant?: InfoCardVariants | undefined; }) => JSX.Element; // @public (undocumented) -const sentryPlugin: BackstagePlugin<{ +const sentryPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { sentryPlugin as plugin } - -export { sentryPlugin } - + }, + {} +>; +export { sentryPlugin as plugin }; +export { sentryPlugin }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/shortcuts/api-report.md b/plugins/shortcuts/api-report.md index b29328d2e6..7aa54b8c3b 100644 --- a/plugins/shortcuts/api-report.md +++ b/plugins/shortcuts/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -12,33 +13,33 @@ import { StorageApi } from '@backstage/core-plugin-api'; // @public export class LocalStoredShortcuts implements ShortcutApi { - constructor(storageApi: StorageApi); - // (undocumented) - add(shortcut: Omit): Promise; - // (undocumented) - getColor(url: string): string; - // (undocumented) - remove(id: string): Promise; - // (undocumented) - shortcut$(): ObservableImpl; - // (undocumented) - update(shortcut: Shortcut): Promise; + constructor(storageApi: StorageApi); + // (undocumented) + add(shortcut: Omit): Promise; + // (undocumented) + getColor(url: string): string; + // (undocumented) + remove(id: string): Promise; + // (undocumented) + shortcut$(): ObservableImpl; + // (undocumented) + update(shortcut: Shortcut): Promise; } // @public (undocumented) export type Shortcut = { - id: string; - url: string; - title: string; + id: string; + url: string; + title: string; }; // @public (undocumented) export interface ShortcutApi { - add(shortcut: Omit): Promise; - getColor(url: string): string; - remove(id: string): Promise; - shortcut$(): Observable; - update(shortcut: Shortcut): Promise; + add(shortcut: Omit): Promise; + getColor(url: string): string; + remove(id: string): Promise; + shortcut$(): Observable; + update(shortcut: Shortcut): Promise; } // @public (undocumented) @@ -50,7 +51,5 @@ export const shortcutsApiRef: ApiRef; // @public (undocumented) export const shortcutsPlugin: BackstagePlugin<{}, {}>; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/sonarqube/api-report.md b/plugins/sonarqube/api-report.md index 46bffb0a44..92d0cfa476 100644 --- a/plugins/sonarqube/api-report.md +++ b/plugins/sonarqube/api-report.md @@ -3,39 +3,44 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { InfoCardVariants } from '@backstage/core-components'; // @public (undocumented) -export const EntitySonarQubeCard: ({ variant, duplicationRatings, }: { - entity?: Entity| undefined; - variant?: InfoCardVariants| undefined; - duplicationRatings?: { +export const EntitySonarQubeCard: ({ + variant, + duplicationRatings, +}: { + entity?: Entity | undefined; + variant?: InfoCardVariants | undefined; + duplicationRatings?: + | { greaterThan: number; - rating: "1.0" | "2.0" | "3.0" | "4.0" | "5.0"; - }[] | undefined; + rating: '1.0' | '2.0' | '3.0' | '4.0' | '5.0'; + }[] + | undefined; }) => JSX.Element; // @public (undocumented) export const isSonarQubeAvailable: (entity: Entity) => boolean; // @public (undocumented) -export const SonarQubeCard: ({ variant, duplicationRatings, }: { - entity?: Entity | undefined; - variant?: InfoCardVariants | undefined; - duplicationRatings?: DuplicationRating[] | undefined; +export const SonarQubeCard: ({ + variant, + duplicationRatings, +}: { + entity?: Entity | undefined; + variant?: InfoCardVariants | undefined; + duplicationRatings?: DuplicationRating[] | undefined; }) => JSX.Element; // @public (undocumented) const sonarQubePlugin: BackstagePlugin<{}, {}>; - -export { sonarQubePlugin as plugin } - -export { sonarQubePlugin } - +export { sonarQubePlugin as plugin }; +export { sonarQubePlugin }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/splunk-on-call/api-report.md b/plugins/splunk-on-call/api-report.md index 8ffe13660d..d17eb01564 100644 --- a/plugins/splunk-on-call/api-report.md +++ b/plugins/splunk-on-call/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -22,47 +23,55 @@ export const splunkOnCallApiRef: ApiRef; // @public (undocumented) export class SplunkOnCallClient implements SplunkOnCallApi { - constructor(config: ClientApiConfig); - // (undocumented) - static fromConfig(configApi: ConfigApi, discoveryApi: DiscoveryApi): SplunkOnCallClient; - // (undocumented) - getEscalationPolicies(): Promise; - // (undocumented) - getIncidents(): Promise; - // (undocumented) - getOnCallUsers(): Promise; - // (undocumented) - getTeams(): Promise; - // (undocumented) - getUsers(): Promise; - // (undocumented) - incidentAction({ routingKey, incidentType, incidentId, incidentDisplayName, incidentMessage, incidentStartTime, }: TriggerAlarmRequest): Promise; - } + constructor(config: ClientApiConfig); + // (undocumented) + static fromConfig( + configApi: ConfigApi, + discoveryApi: DiscoveryApi, + ): SplunkOnCallClient; + // (undocumented) + getEscalationPolicies(): Promise; + // (undocumented) + getIncidents(): Promise; + // (undocumented) + getOnCallUsers(): Promise; + // (undocumented) + getTeams(): Promise; + // (undocumented) + getUsers(): Promise; + // (undocumented) + incidentAction({ + routingKey, + incidentType, + incidentId, + incidentDisplayName, + incidentMessage, + incidentStartTime, + }: TriggerAlarmRequest): Promise; +} // @public (undocumented) export const SplunkOnCallPage: { - ({ title, subtitle, pageTitle, }: SplunkOnCallPageProps): JSX.Element; - defaultProps: { - title: string; - subtitle: string; - pageTitle: string; - }; + ({ title, subtitle, pageTitle }: SplunkOnCallPageProps): JSX.Element; + defaultProps: { + title: string; + subtitle: string; + pageTitle: string; + }; }; // @public (undocumented) -const splunkOnCallPlugin: BackstagePlugin<{ +const splunkOnCallPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { splunkOnCallPlugin as plugin } - -export { splunkOnCallPlugin } + }, + {} +>; +export { splunkOnCallPlugin as plugin }; +export { splunkOnCallPlugin }; // @public (undocumented) -export class UnauthorizedError extends Error { -} - +export class UnauthorizedError extends Error {} // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/tech-radar/api-report.md b/plugins/tech-radar/api-report.md index 8b98f1e494..4087e0d196 100644 --- a/plugins/tech-radar/api-report.md +++ b/plugins/tech-radar/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -10,115 +11,116 @@ import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export interface RadarEntry { - // (undocumented) - description?: string; - // (undocumented) - id: string; - // (undocumented) - key: string; - // (undocumented) - quadrant: string; - // (undocumented) - timeline: Array; - // (undocumented) - title: string; - // (undocumented) - url: string; + // (undocumented) + description?: string; + // (undocumented) + id: string; + // (undocumented) + key: string; + // (undocumented) + quadrant: string; + // (undocumented) + timeline: Array; + // (undocumented) + title: string; + // (undocumented) + url: string; } // @public (undocumented) export interface RadarEntrySnapshot { - // (undocumented) - date: Date; - // (undocumented) - description?: string; - // (undocumented) - moved?: MovedState; - // (undocumented) - ringId: string; + // (undocumented) + date: Date; + // (undocumented) + description?: string; + // (undocumented) + moved?: MovedState; + // (undocumented) + ringId: string; } // @public (undocumented) export interface RadarQuadrant { - // (undocumented) - id: string; - // (undocumented) - name: string; + // (undocumented) + id: string; + // (undocumented) + name: string; } // @public (undocumented) export interface RadarRing { - // (undocumented) - color: string; - // (undocumented) - id: string; - // (undocumented) - name: string; + // (undocumented) + color: string; + // (undocumented) + id: string; + // (undocumented) + name: string; } // @public (undocumented) export const Router: { - ({ title, subtitle, pageTitle, ...props }: TechRadarPageProps): JSX.Element; - defaultProps: { - title: string; - subtitle: string; - pageTitle: string; - }; + ({ title, subtitle, pageTitle, ...props }: TechRadarPageProps): JSX.Element; + defaultProps: { + title: string; + subtitle: string; + pageTitle: string; + }; }; // @public (undocumented) export interface TechRadarApi { - load: (id: string | undefined) => Promise; + load: (id: string | undefined) => Promise; } // @public (undocumented) export const techRadarApiRef: ApiRef; // @public (undocumented) -export const TechRadarComponent: (props: TechRadarComponentProps) => JSX.Element; +export const TechRadarComponent: ( + props: TechRadarComponentProps, +) => JSX.Element; // @public (undocumented) export interface TechRadarComponentProps { - // (undocumented) - height: number; - // (undocumented) - id?: string; - // (undocumented) - svgProps?: object; - // (undocumented) - width: number; + // (undocumented) + height: number; + // (undocumented) + id?: string; + // (undocumented) + svgProps?: object; + // (undocumented) + width: number; } // @public (undocumented) export interface TechRadarLoaderResponse { - // (undocumented) - entries: RadarEntry[]; - // (undocumented) - quadrants: RadarQuadrant[]; - // (undocumented) - rings: RadarRing[]; + // (undocumented) + entries: RadarEntry[]; + // (undocumented) + quadrants: RadarQuadrant[]; + // (undocumented) + rings: RadarRing[]; } // @public (undocumented) export const TechRadarPage: { - ({ title, subtitle, pageTitle, ...props }: TechRadarPageProps): JSX.Element; - defaultProps: { - title: string; - subtitle: string; - pageTitle: string; - }; + ({ title, subtitle, pageTitle, ...props }: TechRadarPageProps): JSX.Element; + defaultProps: { + title: string; + subtitle: string; + pageTitle: string; + }; }; // @public (undocumented) -const techRadarPlugin: BackstagePlugin<{ +const techRadarPlugin: BackstagePlugin< + { root: RouteRef; -}, {}>; - -export { techRadarPlugin as plugin } - -export { techRadarPlugin } - + }, + {} +>; +export { techRadarPlugin as plugin }; +export { techRadarPlugin }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/techdocs-backend/api-report.md b/plugins/techdocs-backend/api-report.md index 947439533a..5777a3fd56 100644 --- a/plugins/techdocs-backend/api-report.md +++ b/plugins/techdocs-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { Config } from '@backstage/config'; import express from 'express'; import { GeneratorBuilder } from '@backstage/techdocs-common'; @@ -14,11 +13,9 @@ import { PreparerBuilder } from '@backstage/techdocs-common'; import { PublisherBase } from '@backstage/techdocs-common'; // @public (undocumented) -export function createRouter({ preparers, generators, publisher, config, logger, discovery, }: RouterOptions): Promise; +export function createRouter(options: RouterOptions): Promise; - -export * from "@backstage/techdocs-common"; +export * from '@backstage/techdocs-common'; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index 24d7694fe0..714f3ad442 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -40,7 +40,7 @@ "dockerode": "^3.2.1", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "fs-extra": "^10.0.0", + "fs-extra": "9.1.0", "knex": "^0.95.1", "winston": "^3.2.1" }, diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index eceae2e3d3..7563dfa2f9 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -31,7 +31,11 @@ import { Logger } from 'winston'; import { DocsBuilder } from '../DocsBuilder'; import { shouldCheckForUpdate } from '../DocsBuilder/BuildMetadataStorage'; -type RouterOptions = { +/** + * All of the required dependencies for running TechDocs in the "out-of-the-box" + * deployment configuration (prepare/generate/publish all in the Backend). + */ +type OutOfTheBoxDeploymentOptions = { preparers: PreparerBuilder; generators: GeneratorBuilder; publisher: PublisherBase; @@ -41,15 +45,39 @@ type RouterOptions = { config: Config; }; -export async function createRouter({ - preparers, - generators, - publisher, - config, - logger, - discovery, -}: RouterOptions): Promise { +/** + * Required dependencies for running TechDocs in the "recommended" deployment + * configuration (prepare/generate handled externally in CI/CD). + */ +type RecommendedDeploymentOptions = { + publisher: PublisherBase; + logger: Logger; + discovery: PluginEndpointDiscovery; + config: Config; +}; + +/** + * One of the two deployment configurations must be provided. + */ +type RouterOptions = + | RecommendedDeploymentOptions + | OutOfTheBoxDeploymentOptions; + +/** + * Typeguard to help createRouter() understand when we are in a "recommended" + * deployment vs. when we are in an out-of-the-box deployment configuration. + */ +function isOutOfTheBoxOption( + opt: RouterOptions, +): opt is OutOfTheBoxDeploymentOptions { + return (opt as OutOfTheBoxDeploymentOptions).preparers !== undefined; +} + +export async function createRouter( + options: RouterOptions, +): Promise { const router = Router(); + const { publisher, config, logger, discovery } = options; router.get('/metadata/techdocs/:namespace/:kind/:name', async (req, res) => { const { kind, namespace, name } = req.params; @@ -158,58 +186,63 @@ export async function createRouter({ }); return; } - const docsBuilder = new DocsBuilder({ - preparers, - generators, - publisher, - logger, - entity, - config, - }); - let foundDocs = false; - switch (publisherType) { - case 'local': - case 'awsS3': - case 'azureBlobStorage': - case 'openStackSwift': - case 'googleGcs': { - // This block should be valid for all storage implementations. So no need to duplicate in future, - // add the publisher type in the list here. - const updated = await docsBuilder.build(); - if (!updated) { - throw new NotModifiedError(); - } + // Set up a DocsBuilder if "out-of-the-box" configuration is provided. + if (isOutOfTheBoxOption(options)) { + const { preparers, generators } = options; + const docsBuilder = new DocsBuilder({ + preparers, + generators, + publisher, + logger, + entity, + config, + }); + let foundDocs = false; + switch (publisherType) { + case 'local': + case 'awsS3': + case 'azureBlobStorage': + case 'openStackSwift': + case 'googleGcs': { + // This block should be valid for all storage implementations. So no need to duplicate in future, + // add the publisher type in the list here. + const updated = await docsBuilder.build(); - // With a maximum of ~5 seconds wait, check if the files got published and if docs will be fetched - // on the user's page. If not, respond with a message asking them to check back later. - // The delay here is to make sure GCS/AWS/etc. registers newly uploaded files which is usually <1 second - for (let attempt = 0; attempt < 5; attempt++) { - if (await publisher.hasDocsBeenGenerated(entity)) { - foundDocs = true; - break; + if (!updated) { + throw new NotModifiedError(); } - await new Promise(r => setTimeout(r, 1000)); + + // With a maximum of ~5 seconds wait, check if the files got published and if docs will be fetched + // on the user's page. If not, respond with a message asking them to check back later. + // The delay here is to make sure GCS/AWS/etc. registers newly uploaded files which is usually <1 second + for (let attempt = 0; attempt < 5; attempt++) { + if (await publisher.hasDocsBeenGenerated(entity)) { + foundDocs = true; + break; + } + await new Promise(r => setTimeout(r, 1000)); + } + if (!foundDocs) { + logger.error( + 'Published files are taking longer to show up in storage. Something went wrong.', + ); + throw new NotFoundError( + 'Sorry! It took too long for the generated docs to show up in storage. Check back later.', + ); + } + + res + .status(201) + .json({ message: 'Docs updated or did not need updating' }); + break; } - if (!foundDocs) { - logger.error( - 'Published files are taking longer to show up in storage. Something went wrong.', - ); + + default: throw new NotFoundError( - 'Sorry! It took too long for the generated docs to show up in storage. Check back later.', + `Publisher type ${publisherType} is not supported by techdocs-backend docs builder.`, ); - } - - res - .status(201) - .json({ message: 'Docs updated or did not need updating' }); - break; } - - default: - throw new NotFoundError( - `Publisher type ${publisherType} is not supported by techdocs-backend docs builder.`, - ); } }); diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index dbd5e3ab26..943831d91c 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -16,14 +17,19 @@ import { Location as Location_2 } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) -export const DocsCardGrid: ({ entities, }: { - entities: Entity[] | undefined; +export const DocsCardGrid: ({ + entities, +}: { + entities: Entity[] | undefined; }) => JSX.Element | null; // @public (undocumented) -export const DocsTable: ({ entities, title, }: { - entities: Entity[] | undefined; - title?: string | undefined; +export const DocsTable: ({ + entities, + title, +}: { + entities: Entity[] | undefined; + title?: string | undefined; }) => JSX.Element | null; // @public (undocumented) @@ -31,7 +37,7 @@ export const EmbeddedDocsRouter: (_props: Props) => JSX.Element; // @public (undocumented) export const EntityTechdocsContent: (_props: { - entity?: Entity| undefined; + entity?: Entity | undefined; }) => JSX.Element; // @public (undocumented) @@ -48,12 +54,12 @@ export type SyncResult = 'cached' | 'updated' | 'timeout'; // @public (undocumented) export interface TechDocsApi { - // (undocumented) - getApiOrigin(): Promise; - // (undocumented) - getEntityMetadata(entityId: EntityName): Promise; - // (undocumented) - getTechDocsMetadata(entityId: EntityName): Promise; + // (undocumented) + getApiOrigin(): Promise; + // (undocumented) + getEntityMetadata(entityId: EntityName): Promise; + // (undocumented) + getTechDocsMetadata(entityId: EntityName): Promise; } // @public (undocumented) @@ -61,58 +67,69 @@ export const techdocsApiRef: ApiRef; // @public export class TechDocsClient implements TechDocsApi { - constructor({ configApi, discoveryApi, identityApi, }: { - configApi: Config; - discoveryApi: DiscoveryApi; - identityApi: IdentityApi; - }); - // (undocumented) + constructor({ + configApi, + discoveryApi, + identityApi, + }: { configApi: Config; - // (undocumented) discoveryApi: DiscoveryApi; - // (undocumented) - getApiOrigin(): Promise; - getEntityMetadata(entityId: EntityName): Promise; - getTechDocsMetadata(entityId: EntityName): Promise; - // (undocumented) identityApi: IdentityApi; + }); + // (undocumented) + configApi: Config; + // (undocumented) + discoveryApi: DiscoveryApi; + // (undocumented) + getApiOrigin(): Promise; + getEntityMetadata(entityId: EntityName): Promise; + getTechDocsMetadata(entityId: EntityName): Promise; + // (undocumented) + identityApi: IdentityApi; } // @public (undocumented) -export const TechDocsCustomHome: ({ tabsConfig, }: { - tabsConfig: TabsConfig; +export const TechDocsCustomHome: ({ + tabsConfig, +}: { + tabsConfig: TabsConfig; }) => JSX.Element; // @public (undocumented) export const TechdocsPage: () => JSX.Element; // @public (undocumented) -const techdocsPlugin: BackstagePlugin<{ +const techdocsPlugin: BackstagePlugin< + { root: RouteRef; entityContent: RouteRef; -}, {}>; - -export { techdocsPlugin as plugin } - -export { techdocsPlugin } + }, + {} +>; +export { techdocsPlugin as plugin }; +export { techdocsPlugin }; // @public (undocumented) export const TechDocsReaderPage: () => JSX.Element; // @public (undocumented) export interface TechDocsStorageApi { - // (undocumented) - getApiOrigin(): Promise; - // (undocumented) - getBaseUrl(oldBaseUrl: string, entityId: EntityName, path: string): Promise; - // (undocumented) - getBuilder(): Promise; - // (undocumented) - getEntityDocs(entityId: EntityName, path: string): Promise; - // (undocumented) - getStorageUrl(): Promise; - // (undocumented) - syncEntityDocs(entityId: EntityName): Promise; + // (undocumented) + getApiOrigin(): Promise; + // (undocumented) + getBaseUrl( + oldBaseUrl: string, + entityId: EntityName, + path: string, + ): Promise; + // (undocumented) + getBuilder(): Promise; + // (undocumented) + getEntityDocs(entityId: EntityName, path: string): Promise; + // (undocumented) + getStorageUrl(): Promise; + // (undocumented) + syncEntityDocs(entityId: EntityName): Promise; } // @public (undocumented) @@ -120,30 +137,36 @@ export const techdocsStorageApiRef: ApiRef; // @public export class TechDocsStorageClient implements TechDocsStorageApi { - constructor({ configApi, discoveryApi, identityApi, }: { - configApi: Config; - discoveryApi: DiscoveryApi; - identityApi: IdentityApi; - }); - // (undocumented) + constructor({ + configApi, + discoveryApi, + identityApi, + }: { configApi: Config; - // (undocumented) discoveryApi: DiscoveryApi; - // (undocumented) - getApiOrigin(): Promise; - // (undocumented) - getBaseUrl(oldBaseUrl: string, entityId: EntityName, path: string): Promise; - // (undocumented) - getBuilder(): Promise; - getEntityDocs(entityId: EntityName, path: string): Promise; - // (undocumented) - getStorageUrl(): Promise; - // (undocumented) identityApi: IdentityApi; - syncEntityDocs(entityId: EntityName): Promise; + }); + // (undocumented) + configApi: Config; + // (undocumented) + discoveryApi: DiscoveryApi; + // (undocumented) + getApiOrigin(): Promise; + // (undocumented) + getBaseUrl( + oldBaseUrl: string, + entityId: EntityName, + path: string, + ): Promise; + // (undocumented) + getBuilder(): Promise; + getEntityDocs(entityId: EntityName, path: string): Promise; + // (undocumented) + getStorageUrl(): Promise; + // (undocumented) + identityApi: IdentityApi; + syncEntityDocs(entityId: EntityName): Promise; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/todo-backend/api-report.md b/plugins/todo-backend/api-report.md index d203a52b36..92e133a481 100644 --- a/plugins/todo-backend/api-report.md +++ b/plugins/todo-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { EntityName } from '@backstage/catalog-model'; @@ -20,79 +19,86 @@ export function createTodoParser(options?: TodoParserOptions): TodoParser; // @public (undocumented) export type ListTodosRequest = { - entity?: EntityName; - offset?: number; - limit?: number; - orderBy?: { - field: Fields; - direction: 'asc' | 'desc'; - }; - filters?: { - field: Fields; - value: string; - }[]; + entity?: EntityName; + offset?: number; + limit?: number; + orderBy?: { + field: Fields; + direction: 'asc' | 'desc'; + }; + filters?: { + field: Fields; + value: string; + }[]; }; // @public (undocumented) export type ListTodosResponse = { - items: TodoItem[]; - totalCount: number; - offset: number; - limit: number; + items: TodoItem[]; + totalCount: number; + offset: number; + limit: number; }; // @public (undocumented) export type ReadTodosOptions = { - url: string; + url: string; }; // @public (undocumented) export type ReadTodosResult = { - items: TodoItem[]; + items: TodoItem[]; }; // @public (undocumented) export type TodoItem = { - text: string; - tag: string; - author?: string; - viewUrl?: string; - lineNumber?: number; - repoFilePath?: string; + text: string; + tag: string; + author?: string; + viewUrl?: string; + lineNumber?: number; + repoFilePath?: string; }; // @public (undocumented) export interface TodoReader { - readTodos(options: ReadTodosOptions): Promise; + readTodos(options: ReadTodosOptions): Promise; } // @public (undocumented) export class TodoReaderService implements TodoService { - constructor(options: Options_2); - // (undocumented) - listTodos(req: ListTodosRequest, options?: { - token?: string; - }): Promise; - } + constructor(options: Options_2); + // (undocumented) + listTodos( + req: ListTodosRequest, + options?: { + token?: string; + }, + ): Promise; +} // @public (undocumented) export class TodoScmReader implements TodoReader { - constructor(options: Options); - // (undocumented) - static fromConfig(config: Config, options: Omit): TodoScmReader; - // (undocumented) - readTodos({ url }: ReadTodosOptions): Promise; + constructor(options: Options); + // (undocumented) + static fromConfig( + config: Config, + options: Omit, + ): TodoScmReader; + // (undocumented) + readTodos({ url }: ReadTodosOptions): Promise; } // @public (undocumented) export interface TodoService { - // (undocumented) - listTodos(req: ListTodosRequest, options?: { - token?: string; - }): Promise; + // (undocumented) + listTodos( + req: ListTodosRequest, + options?: { + token?: string; + }, + ): Promise; } - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/todo/api-report.md b/plugins/todo/api-report.md index bdfea8b8f9..1fc8e8f99f 100644 --- a/plugins/todo/api-report.md +++ b/plugins/todo/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -17,7 +18,5 @@ export const todoApiRef: ApiRef; // @public (undocumented) export const todoPlugin: BackstagePlugin<{}, {}>; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/user-settings/api-report.md b/plugins/user-settings/api-report.md index dc85df0d3d..2f3b9b2fed 100644 --- a/plugins/user-settings/api-report.md +++ b/plugins/user-settings/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -12,10 +13,17 @@ import { RouteRef } from '@backstage/core-plugin-api'; import { SessionApi } from '@backstage/core-plugin-api'; // @public (undocumented) -export const DefaultProviderSettings: ({ configuredProviders }: Props_3) => JSX.Element; +export const DefaultProviderSettings: ({ + configuredProviders, +}: Props_3) => JSX.Element; // @public (undocumented) -export const ProviderSettingsItem: ({ title, description, icon: Icon, apiRef, }: Props_4) => JSX.Element; +export const ProviderSettingsItem: ({ + title, + description, + icon: Icon, + apiRef, +}: Props_4) => JSX.Element; // @public (undocumented) export const Router: ({ providerSettings }: Props) => JSX.Element; @@ -27,7 +35,9 @@ export const Settings: () => JSX.Element; export const UserSettingsAppearanceCard: () => JSX.Element; // @public (undocumented) -export const UserSettingsAuthProviders: ({ providerSettings }: Props_2) => JSX.Element; +export const UserSettingsAuthProviders: ({ + providerSettings, +}: Props_2) => JSX.Element; // @public (undocumented) export const UserSettingsFeatureFlags: () => JSX.Element; @@ -39,21 +49,24 @@ export const UserSettingsGeneral: () => JSX.Element; export const UserSettingsMenu: () => JSX.Element; // @public (undocumented) -export const UserSettingsPage: ({ providerSettings }: { - providerSettings?: JSX.Element | undefined; +export const UserSettingsPage: ({ + providerSettings, +}: { + providerSettings?: JSX.Element | undefined; }) => JSX.Element; // @public (undocumented) export const UserSettingsPinToggle: () => JSX.Element; // @public (undocumented) -const userSettingsPlugin: BackstagePlugin<{ +const userSettingsPlugin: BackstagePlugin< + { settingsPage: RouteRef; -}, {}>; - -export { userSettingsPlugin as plugin } - -export { userSettingsPlugin } + }, + {} +>; +export { userSettingsPlugin as plugin }; +export { userSettingsPlugin }; // @public (undocumented) export const UserSettingsProfileCard: () => JSX.Element; @@ -66,11 +79,9 @@ export const UserSettingsThemeToggle: () => JSX.Element; // @public (undocumented) export const useUserProfile: () => { - profile: ProfileInfo; - displayName: string; + profile: ProfileInfo; + displayName: string; }; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/welcome/api-report.md b/plugins/welcome/api-report.md index 727be3ad75..49ccd46994 100644 --- a/plugins/welcome/api-report.md +++ b/plugins/welcome/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -11,12 +12,8 @@ export const WelcomePage: () => JSX.Element; // @public (undocumented) const welcomePlugin: BackstagePlugin<{}, {}>; - -export { welcomePlugin as plugin } - -export { welcomePlugin } - +export { welcomePlugin as plugin }; +export { welcomePlugin }; // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/xcmetrics/.eslintrc.js b/plugins/xcmetrics/.eslintrc.js new file mode 100644 index 0000000000..13573efa9c --- /dev/null +++ b/plugins/xcmetrics/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint')], +}; diff --git a/plugins/xcmetrics/README.md b/plugins/xcmetrics/README.md new file mode 100644 index 0000000000..a3bb93d2af --- /dev/null +++ b/plugins/xcmetrics/README.md @@ -0,0 +1,38 @@ +# XCMetrics + +[XCMetrics](https://xcmetrics.io) is a tool for collecting build metrics from XCode. +With this plugin, you can view data from XCMetrics directly in Backstage. + +![XCMetrics-overview](./docs/XCMetrics-overview.png) + +## Getting started + +From `packages/app`: + +```bash +yarn add @backstage/plugin-xcmetrics +``` + +In `packages/app/src/App.tsx`, add the following: + +```ts +import { XcmetricsPage } from '@backstage/plugin-xcmetrics'; +``` + +```tsx + + {/* Other routes... */} + } /> + +``` + +Add the URL to your XCMetrics backend instance in `app-config.yaml` like so: + +```yaml +proxy: + ... + '/xcmetrics': + target: http://127.0.0.1:8080/v1 +``` + +Start Backstage and navigate to `/xcmetrics` to view your build metrics! diff --git a/plugins/xcmetrics/api-report.md b/plugins/xcmetrics/api-report.md new file mode 100644 index 0000000000..3509fec523 --- /dev/null +++ b/plugins/xcmetrics/api-report.md @@ -0,0 +1,23 @@ +## API Report File for "@backstage/plugin-xcmetrics" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +/// + +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; + +// @public (undocumented) +export const XcmetricsPage: () => JSX.Element; + +// @public (undocumented) +export const xcmetricsPlugin: BackstagePlugin< + { + root: RouteRef; + }, + {} +>; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/xcmetrics/dev/index.tsx b/plugins/xcmetrics/dev/index.tsx new file mode 100644 index 0000000000..f6663dd33d --- /dev/null +++ b/plugins/xcmetrics/dev/index.tsx @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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. + */ +import React from 'react'; +import { createDevApp } from '@backstage/dev-utils'; +import { xcmetricsPlugin, XcmetricsPage } from '../src/plugin'; + +createDevApp() + .registerPlugin(xcmetricsPlugin) + .addPage({ + element: , + title: 'Root Page', + path: '/xcmetrics', + }) + .render(); diff --git a/plugins/xcmetrics/docs/XCMetrics-overview.png b/plugins/xcmetrics/docs/XCMetrics-overview.png new file mode 100644 index 0000000000..69b77f87df Binary files /dev/null and b/plugins/xcmetrics/docs/XCMetrics-overview.png differ diff --git a/plugins/xcmetrics/package.json b/plugins/xcmetrics/package.json new file mode 100644 index 0000000000..e617d12e85 --- /dev/null +++ b/plugins/xcmetrics/package.json @@ -0,0 +1,52 @@ +{ + "name": "@backstage/plugin-xcmetrics", + "version": "0.1.1", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "publishConfig": { + "access": "public", + "main": "dist/index.esm.js", + "types": "dist/index.d.ts" + }, + "scripts": { + "build": "backstage-cli plugin:build", + "start": "backstage-cli plugin:serve", + "lint": "backstage-cli lint", + "test": "backstage-cli test", + "diff": "backstage-cli plugin:diff", + "prepack": "backstage-cli prepack", + "postpack": "backstage-cli postpack", + "clean": "backstage-cli clean" + }, + "dependencies": { + "@backstage/core-components": "^0.1.5", + "@backstage/core-plugin-api": "^0.1.3", + "@backstage/errors": "^0.1.1", + "@backstage/theme": "^0.2.8", + "@material-ui/core": "^4.11.0", + "@material-ui/icons": "^4.9.1", + "@material-ui/lab": "4.0.0-alpha.45", + "luxon": "^1.27.0", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-use": "^17.2.4" + }, + "devDependencies": { + "@backstage/cli": "^0.7.3", + "@backstage/core-app-api": "^0.1.4", + "@backstage/dev-utils": "^0.2.1", + "@backstage/test-utils": "^0.1.14", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^11.2.5", + "@testing-library/user-event": "^13.1.8", + "@types/jest": "^26.0.7", + "@types/luxon": "^1.27.0", + "@types/node": "^14.14.32", + "cross-fetch": "^3.0.6", + "msw": "^0.29.0" + }, + "files": [ + "dist" + ] +} diff --git a/plugins/xcmetrics/src/api/XcmetricsClient.ts b/plugins/xcmetrics/src/api/XcmetricsClient.ts new file mode 100644 index 0000000000..00087ad75d --- /dev/null +++ b/plugins/xcmetrics/src/api/XcmetricsClient.ts @@ -0,0 +1,42 @@ +/* + * Copyright 2021 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. + */ + +import { DiscoveryApi } from '@backstage/core-plugin-api'; +import { ResponseError } from '@backstage/errors'; +import { BuildItem, BuildsResult, XcmetricsApi } from './types'; + +interface Options { + discoveryApi: DiscoveryApi; +} + +export class XcmetricsClient implements XcmetricsApi { + private readonly discoveryApi: DiscoveryApi; + + constructor(options: Options) { + this.discoveryApi = options.discoveryApi; + } + + async getBuilds(): Promise { + const baseUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/xcmetrics`; + const response = await fetch(`${baseUrl}/build`); + + if (!response.ok) { + throw await ResponseError.fromResponse(response); + } + + return ((await response.json()) as BuildsResult).items; + } +} diff --git a/plugins/xcmetrics/src/api/index.ts b/plugins/xcmetrics/src/api/index.ts new file mode 100644 index 0000000000..c184dc950d --- /dev/null +++ b/plugins/xcmetrics/src/api/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2021 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 * from './types'; +export * from './XcmetricsClient'; diff --git a/plugins/xcmetrics/src/api/types.ts b/plugins/xcmetrics/src/api/types.ts new file mode 100644 index 0000000000..add59b1a86 --- /dev/null +++ b/plugins/xcmetrics/src/api/types.ts @@ -0,0 +1,63 @@ +/* + * Copyright 2021 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. + */ + +import { createApiRef } from '@backstage/core-plugin-api'; + +export type BuildStatus = 'succeeded' | 'failed' | 'stopped'; + +export type BuildItem = { + userid: string; + warningCount: number; + duration: number; + startTimestamp: string; + isCi: boolean; + startTimestampMicroseconds: number; + category: string; + endTimestampMicroseconds: number; + day: string; + compilationEndTimestamp: string; + tag: string; + projectName: string; + compilationEndTimestampMicroseconds: number; + errorCount: number; + id: string; + buildStatus: BuildStatus; + compilationDuration: number; + schema: string; + compiledCount: number; + endTimestamp: string; + userid256: string; + machineName: string; + wasSuspended: boolean; +}; + +export type BuildsResult = { + items: BuildItem[]; + metadata: { + per: number; + total: number; + page: number; + }; +}; + +export interface XcmetricsApi { + getBuilds(): Promise; +} + +export const xcmetricsApiRef = createApiRef({ + id: 'plugin.xcmetrics.api', + description: 'Used by the XCMetrics plugin to make requests', +}); diff --git a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx b/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx new file mode 100644 index 0000000000..d386d279ce --- /dev/null +++ b/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx @@ -0,0 +1,75 @@ +/* + * Copyright 2021 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. + */ +import React from 'react'; +import { OverviewComponent } from './OverviewComponent'; +import { renderInTestApp } from '@backstage/test-utils'; +import { XcmetricsApi, xcmetricsApiRef } from '../../api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + +describe('OverviewComponent', () => { + it('should render', async () => { + const mockUserId = 'mockUser'; + const mockApi: jest.Mocked = { + getBuilds: jest.fn().mockResolvedValue([ + { + userid: mockUserId, + warningCount: 1, + duration: 123.45, + isCi: false, + projectName: 'App', + buildStatus: 'succeeded', + schema: 'AppSchema', + }, + ]), + }; + + const rendered = await renderInTestApp( + + + , + ); + expect(rendered.getByText('XCMetrics Dashboard')).toBeInTheDocument(); + expect(rendered.getByText(mockUserId)).toBeInTheDocument(); + expect(rendered.queryByText('CI')).toBeNull(); + }); + + it('should render an empty state when no builds exist', async () => { + const mockApi: jest.Mocked = { + getBuilds: jest.fn().mockResolvedValue([]), + }; + + const rendered = await renderInTestApp( + + + , + ); + expect(rendered.getByText('No builds to show')).toBeInTheDocument(); + }); + + it('should show an error when API not responding', async () => { + const errorMessage = 'MockErrorMessage'; + const mockApi: jest.Mocked = { + getBuilds: jest.fn().mockRejectedValue({ message: errorMessage }), + }; + + const rendered = await renderInTestApp( + + + , + ); + expect(rendered.getByText(errorMessage)).toBeInTheDocument(); + }); +}); diff --git a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.tsx b/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.tsx new file mode 100644 index 0000000000..37b35c9690 --- /dev/null +++ b/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.tsx @@ -0,0 +1,120 @@ +/* + * Copyright 2021 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. + */ +import React from 'react'; +import { + ContentHeader, + SupportButton, + Progress, + StatusOK, + StatusError, + StatusWarning, + Table, + TableColumn, + EmptyState, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; +import { BuildItem, BuildStatus, xcmetricsApiRef } from '../../api'; +import { useAsync } from 'react-use'; +import { Alert } from '@material-ui/lab'; +import { Duration } from 'luxon'; +import { Chip } from '@material-ui/core'; + +const formatStatus = (status: BuildStatus, warningCount: number) => { + const statusIcons = { + succeeded: , + failed: , + stopped: , + }; + + return ( + <> + {statusIcons[status]} {status[0].toUpperCase() + status.slice(1)} + {warningCount > 0 && ` with ${warningCount} warning`} + {warningCount > 1 && 's'} + + ); +}; + +const columns: TableColumn[] = [ + { + title: 'Project', + field: 'projectName', + }, + { + title: 'Schema', + field: 'schema', + }, + { + title: 'Duration', + field: 'duration', + type: 'time', + searchable: false, + render: data => Duration.fromObject({ seconds: data.duration }).toISOTime(), + }, + { + title: 'User', + field: 'userid', + }, + { + title: 'Status', + field: 'buildStatus', + render: data => formatStatus(data.buildStatus, data.warningCount), + }, + { + field: 'isCI', + render: data => data.isCi && , + width: '10', + sorting: false, + }, +]; + +export const OverviewComponent = () => { + const client = useApi(xcmetricsApiRef); + const { value: builds, loading, error } = useAsync( + async (): Promise => client.getBuilds(), + [], + ); + + if (loading) { + return ; + } else if (error) { + return {error.message}; + } + + if (!builds || !builds.length) { + return ( + + ); + } + + return ( + <> + + Dashboard for XCMetrics + + + + ); +}; diff --git a/plugins/xcmetrics/src/components/OverviewComponent/index.ts b/plugins/xcmetrics/src/components/OverviewComponent/index.ts new file mode 100644 index 0000000000..58b284e6f1 --- /dev/null +++ b/plugins/xcmetrics/src/components/OverviewComponent/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2021 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 * from './OverviewComponent'; diff --git a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx new file mode 100644 index 0000000000..96d841b083 --- /dev/null +++ b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx @@ -0,0 +1,30 @@ +/* + * Copyright 2021 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. + */ +import React from 'react'; +import { Content, Header, HeaderLabel, Page } from '@backstage/core-components'; +import { OverviewComponent } from '../OverviewComponent'; + +export const XcmetricsLayout = () => ( + +
+ + +
+ + + +
+); diff --git a/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts b/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts new file mode 100644 index 0000000000..eaaadcbaea --- /dev/null +++ b/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2021 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 * from './XcmetricsLayout'; diff --git a/plugins/xcmetrics/src/index.ts b/plugins/xcmetrics/src/index.ts new file mode 100644 index 0000000000..aa02224738 --- /dev/null +++ b/plugins/xcmetrics/src/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2021 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 { xcmetricsPlugin, XcmetricsPage } from './plugin'; diff --git a/plugins/xcmetrics/src/plugin.test.ts b/plugins/xcmetrics/src/plugin.test.ts new file mode 100644 index 0000000000..055c647dd9 --- /dev/null +++ b/plugins/xcmetrics/src/plugin.test.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2021 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. + */ +import { xcmetricsPlugin } from './plugin'; + +describe('xcmetrics', () => { + it('should export plugin', () => { + expect(xcmetricsPlugin).toBeDefined(); + }); +}); diff --git a/plugins/xcmetrics/src/plugin.ts b/plugins/xcmetrics/src/plugin.ts new file mode 100644 index 0000000000..22250ff627 --- /dev/null +++ b/plugins/xcmetrics/src/plugin.ts @@ -0,0 +1,49 @@ +/* + * Copyright 2021 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. + */ +import { + createApiFactory, + createPlugin, + createRoutableExtension, + discoveryApiRef, +} from '@backstage/core-plugin-api'; +import { xcmetricsApiRef, XcmetricsClient } from './api'; +import { rootRouteRef } from './routes'; + +export const xcmetricsPlugin = createPlugin({ + id: 'xcmetrics', + routes: { + root: rootRouteRef, + }, + apis: [ + createApiFactory({ + api: xcmetricsApiRef, + deps: { + discoveryApi: discoveryApiRef, + }, + factory({ discoveryApi }) { + return new XcmetricsClient({ discoveryApi }); + }, + }), + ], +}); + +export const XcmetricsPage = xcmetricsPlugin.provide( + createRoutableExtension({ + component: () => + import('./components/XcmetricsLayout').then(m => m.XcmetricsLayout), + mountPoint: rootRouteRef, + }), +); diff --git a/plugins/xcmetrics/src/routes.ts b/plugins/xcmetrics/src/routes.ts new file mode 100644 index 0000000000..7acd62c363 --- /dev/null +++ b/plugins/xcmetrics/src/routes.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2021 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. + */ +import { createRouteRef } from '@backstage/core-plugin-api'; + +export const rootRouteRef = createRouteRef({ + title: 'XCMetrics', +}); diff --git a/plugins/xcmetrics/src/setupTests.ts b/plugins/xcmetrics/src/setupTests.ts new file mode 100644 index 0000000000..fc6dbd98f8 --- /dev/null +++ b/plugins/xcmetrics/src/setupTests.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 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. + */ +import '@testing-library/jest-dom'; +import 'cross-fetch/polyfill'; diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 2631f7de93..f88b30d1fd 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -23,6 +23,7 @@ import { dirname, join, } from 'path'; +import prettier from 'prettier'; import fs from 'fs-extra'; import { Extractor, @@ -61,6 +62,27 @@ PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor = function tryGetPackag return old.call(this, path); }; +/** + * Another monkey patch where we apply prettier to the API reports. This has to be patched into + * the middle of the process as API Extractor does a comparison of the contents of the old + * and new files during generation. This inserts the formatting just before that comparison. + */ +const { + ApiReportGenerator, +} = require('@microsoft/api-extractor/lib/generators/ApiReportGenerator'); + +const originalGenerateReviewFileContent = + ApiReportGenerator.generateReviewFileContent; +ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewFileContent( + ...args +) { + const content = originalGenerateReviewFileContent.apply(this, args); + return prettier.format(content, { + ...require('@spotify/prettier-config'), + parser: 'markdown', + }); +}; + const PACKAGE_ROOTS = ['packages', 'plugins']; const SKIPPED_PACKAGES = [ @@ -73,14 +95,6 @@ const SKIPPED_PACKAGES = [ 'packages/e2e-test', 'packages/storybook', 'packages/techdocs-cli', - - // TODO(Rugvip): Enable these once `import * as ...` and `import()` PRs have landed, #1796 & #1916. - 'packages/core-components', - 'plugins/catalog', - 'plugins/catalog-backend', - 'plugins/catalog-react', - 'plugins/github-deployments', - 'plugins/sentry-backend', ]; async function findPackageDirs() { diff --git a/yarn.lock b/yarn.lock index a9a4fb90b3..a8e6f4a167 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3508,20 +3508,20 @@ dependencies: "@types/whatwg-streams" "^0.0.7" -"@microsoft/api-documenter@^7.12.16": - version "7.13.24" - resolved "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.13.24.tgz#3bae26f7520a993c4009569d8bd229c76d266dc3" - integrity sha512-HH8aE7Yo0D+eQuV86lwF4YGW669wNxUevybGMndsTyQEeRqUpnr4wz9ptFi7FGjaUjTKjGWQKH2bm4dt8BZsUg== +"@microsoft/api-documenter@^7.13.30": + version "7.13.30" + resolved "https://registry.npmjs.org/@microsoft/api-documenter/-/api-documenter-7.13.30.tgz#f4832b8747ad9f61b3a0d87eb61b6b1aca2aeb60" + integrity sha512-n91XihJptwcHp1g5FUIcrjDXhg/g2q6+Rj+nuPBkvsCAKQP/OwCLNVO3tYNpz+qa+lWrHPWL3Urc8G3th5cn7w== dependencies: "@microsoft/api-extractor-model" "7.13.3" "@microsoft/tsdoc" "0.13.2" "@rushstack/node-core-library" "3.39.0" - "@rushstack/ts-command-line" "4.7.10" + "@rushstack/ts-command-line" "4.8.0" colors "~1.2.1" js-yaml "~3.13.1" resolve "~1.17.0" -"@microsoft/api-extractor-model@7.13.3", "@microsoft/api-extractor-model@^7.12.5": +"@microsoft/api-extractor-model@7.13.3", "@microsoft/api-extractor-model@^7.13.3": version "7.13.3" resolved "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.13.3.tgz#ac01c064c5af520d3661c85d7e5ef95e1ca8ab92" integrity sha512-uXilAhu2GcvyY/0NwVRk3AN7TFYjkPnjHLV2UywTTz9uglS+Af0YjNrCy+aaK8qXtfbFWdBzkH9N2XU8/YBeRQ== @@ -3530,30 +3530,23 @@ "@microsoft/tsdoc-config" "~0.15.2" "@rushstack/node-core-library" "3.39.0" -"@microsoft/api-extractor-model@workspace:*": - version "7.12.5" - resolved "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.12.5.tgz#28d2804865ceba9cd89ab4f05cff99d16fa6c9b8" - integrity sha512-oeHZW83JWjIVoCDvdwI5nsZGPxThbq4gZTLAYNeJGZE/mKEO0iayMPGmI3EllJBjwQsFvNVU+O/HGULhB2to/g== +"@microsoft/api-extractor@^7.18.1": + version "7.18.1" + resolved "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.18.1.tgz#61b39f972b646261dd49f2de9f5d448aa6497e7a" + integrity sha512-qljUF2Q0zAx1vJrjKkJVGN7OVbsXki+Pji99jywyl6L/FK3YZ7PpstUJYE6uBcLPy6rhNPWPAsHNTMpG/kHIsg== dependencies: - "@microsoft/tsdoc" "0.12.24" - "@rushstack/node-core-library" "3.36.2" - -"@microsoft/api-extractor@7.13.2-pr1916.0": - version "7.13.2-pr1916.0" - resolved "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.13.2-pr1916.0.tgz#2e10cb928ea81b56cd5f63264da11f1f9b9310a5" - integrity sha512-0/HajL+NUixuNGMfFZbHmKJn5VEqiF45q2FXhu8UrggutdJ+9M6wZ++fejUHfxlC/WhQVrVVRtf4xvVM3oIW+A== - dependencies: - "@microsoft/api-extractor-model" "workspace:*" - "@microsoft/tsdoc" "0.12.24" - "@rushstack/node-core-library" "workspace:*" - "@rushstack/rig-package" "workspace:*" - "@rushstack/ts-command-line" "workspace:*" + "@microsoft/api-extractor-model" "7.13.3" + "@microsoft/tsdoc" "0.13.2" + "@microsoft/tsdoc-config" "~0.15.2" + "@rushstack/node-core-library" "3.39.0" + "@rushstack/rig-package" "0.2.12" + "@rushstack/ts-command-line" "4.8.0" colors "~1.2.1" lodash "~4.17.15" resolve "~1.17.0" semver "~7.3.0" source-map "~0.6.1" - typescript "~4.1.3" + typescript "~4.3.2" "@microsoft/fetch-event-source@2.0.1": version "2.0.1" @@ -3575,11 +3568,6 @@ jju "~1.4.0" resolve "~1.19.0" -"@microsoft/tsdoc@0.12.24": - version "0.12.24" - resolved "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.24.tgz#30728e34ebc90351dd3aff4e18d038eed2c3e098" - integrity sha512-Mfmij13RUTmHEMi9vRUhMXD7rnGR2VvxeNYtaGtaJ4redwwjT4UXYJ+nzmVJF7hhd4pn/Fx5sncDKxMVFJSWPg== - "@microsoft/tsdoc@0.13.2": version "0.13.2" resolved "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz#3b0efb6d3903bd49edb073696f60e90df08efb26" @@ -4172,21 +4160,6 @@ estree-walker "^2.0.1" picomatch "^2.2.2" -"@rushstack/node-core-library@3.36.2", "@rushstack/node-core-library@workspace:*": - version "3.36.2" - resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.36.2.tgz#ba00d313577f9b06d5aafaa29da0d94e594874c0" - integrity sha512-5J8xSY/PuCKR+yfxS497l0PP43kBUeD86S4eS3RzrmMle04J4522MWal8mk1T1EIDpYpgi8qScannU9oVxoStA== - dependencies: - "@types/node" "10.17.13" - colors "~1.2.1" - fs-extra "~7.0.1" - import-lazy "~4.0.0" - jju "~1.4.0" - resolve "~1.17.0" - semver "~7.3.0" - timsort "~0.3.0" - z-schema "~3.18.3" - "@rushstack/node-core-library@3.39.0": version "3.39.0" resolved "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.39.0.tgz#38928946d15ae89b773386cf97433d0d1ec83b93" @@ -4202,7 +4175,7 @@ timsort "~0.3.0" z-schema "~3.18.3" -"@rushstack/rig-package@workspace:*": +"@rushstack/rig-package@0.2.12": version "0.2.12" resolved "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.2.12.tgz#c434d62b28e0418a040938226f8913971d0424c7" integrity sha512-nbePcvF8hQwv0ql9aeQxcaMPK/h1OLAC00W7fWCRWIvD2MchZOE8jumIIr66HGrfG2X1sw++m/ZYI4D+BM5ovQ== @@ -4210,10 +4183,10 @@ resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/ts-command-line@4.7.10", "@rushstack/ts-command-line@workspace:*": - version "4.7.10" - resolved "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.7.10.tgz#a2ec6efb1945b79b496671ce90eb1be4f1397d31" - integrity sha512-8t042g8eerypNOEcdpxwRA3uCmz0duMo21rG4Z2mdz7JxJeylDmzjlU3wDdef2t3P1Z61JCdZB6fbm1Mh0zi7w== +"@rushstack/ts-command-line@4.8.0": + version "4.8.0" + resolved "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.8.0.tgz#611accb931b9ac62ff4d078f68f95c47f6606724" + integrity sha512-nZ8cbzVF1VmFPfSJfy8vEohdiFAH/59Y/Y+B4nsJbn4SkifLJ8LqNZ5+LxCC2UR242EXFumxlsY1d6fPBxck5Q== dependencies: "@types/argparse" "1.0.38" argparse "~1.0.9" @@ -9797,13 +9770,13 @@ concat-with-sourcemaps@^1.1.0: source-map "^0.6.1" concurrently@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/concurrently/-/concurrently-6.0.0.tgz#c1a876dd99390979c71f8c6fe6796882f3a13199" - integrity sha512-Ik9Igqnef2ONLjN2o/OVx1Ow5tymVvvEwQeYCQdD/oV+CN9oWhxLk7ibcBdOtv0UzBqHCEKRwbKceYoTK8t3fQ== + version "6.2.0" + resolved "https://registry.npmjs.org/concurrently/-/concurrently-6.2.0.tgz#587e2cb8afca7234172d8ea55176088632c4c56d" + integrity sha512-v9I4Y3wFoXCSY2L73yYgwA9ESrQMpRn80jMcqMgHx720Hecz2GZAvTI6bREVST6lkddNypDKRN22qhK0X8Y00g== dependencies: chalk "^4.1.0" date-fns "^2.16.1" - lodash "^4.17.20" + lodash "^4.17.21" read-pkg "^5.2.0" rxjs "^6.6.3" spawn-command "^0.0.2-1" @@ -13169,6 +13142,25 @@ fs-constants@^1.0.0: resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== +fs-extra@10.0.0: + version "10.0.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-extra@9.1.0, fs-extra@^9.0.0, fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" @@ -13180,15 +13172,6 @@ fs-extra@^0.30.0: path-is-absolute "^1.0.0" rimraf "^2.2.8" -fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^7.0.1, fs-extra@~7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -13207,16 +13190,6 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.0, fs-extra@^9.1.0: - version "9.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-minipass@^1.2.5: version "1.2.7" resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -16207,9 +16180,9 @@ jest-watcher@^26.6.2: string-length "^4.0.1" jest-when@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/jest-when/-/jest-when-3.1.0.tgz#d041191b8d4a8ad3fd9c4dc2eda3237eaeec4004" - integrity sha512-oLANZfF60yxheShbbke3+XXosZhge8Va2xiwIddF8DF5l996Ldy8bL6hT319ovSyjrhBWLOEESKfANyM0Eo/SQ== + version "3.3.1" + resolved "https://registry.npmjs.org/jest-when/-/jest-when-3.3.1.tgz#04f978b2e522a290b1d91db7ab6ca029a7925513" + integrity sha512-nbQxKeHqfmoSE38TfLVPCgxG+rnsgHSXsdH1wdE9bqHt9US6twHjSXV+fD4ncfsIWNXqhv7zRvN5jn/QYL2UwA== dependencies: bunyan "^1.8.12" expect "^24.8.0" @@ -25172,11 +25145,16 @@ typescript-json-schema@^0.50.1: typescript "~4.2.3" yargs "^16.2.0" -typescript@^4.0.3, typescript@~4.1.3, typescript@~4.2.3: +typescript@^4.0.3, typescript@~4.2.3: version "4.2.4" resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== +typescript@~4.3.2: + version "4.3.5" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== + ua-parser-js@^0.7.18: version "0.7.28" resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31"