diff --git a/plugins/periskop/api-report.md b/plugins/periskop/api-report.md index 8222f7a1c5..e60f039d4e 100644 --- a/plugins/periskop/api-report.md +++ b/plugins/periskop/api-report.md @@ -10,37 +10,94 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { ConfigApi } from '@backstage/core-plugin-api'; import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { RouteRef } from '@backstage/core-plugin-api'; + +// @public (undocumented) +export interface AggregatedError { + // (undocumented) + aggregation_key: string; + // (undocumented) + latest_errors: ErrorInstance[]; + // (undocumented) + severity: string; + // (undocumented) + total_count: number; +} + +// @public (undocumented) +interface Error_2 { + // (undocumented) + cause?: Error_2 | null; + // (undocumented) + class: string; + // (undocumented) + message: string; + // (undocumented) + stacktrace?: string[]; +} +export { Error_2 as Error }; + +// @public (undocumented) +export interface ErrorInstance { + // (undocumented) + error: Error_2; + // (undocumented) + http_context: HttpContext; + // (undocumented) + severity: string; + // (undocumented) + timestamp: number; + // (undocumented) + uuid: string; +} + +// @public (undocumented) +export interface HttpContext { + // (undocumented) + request_body: string; + // (undocumented) + request_headers: RequestHeaders; + // (undocumented) + request_method: string; + // (undocumented) + request_url: string; +} // @public export const isPeriskopAvailable: (entity: Entity) => boolean; +// @public (undocumented) +export interface NotFoundInInstance { + // (undocumented) + body: string; +} + // @public export const PERISKOP_NAME_ANNOTATION = 'periskop.io/name'; // @public export class PeriskopApi { - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - constructor(options: Options); - // Warning: (ae-forgotten-export) The symbol "AggregatedError" needs to be exported by the entry point index.d.ts - // + constructor(options: PeriskopApiOptions); // (undocumented) getErrorInstanceUrl( - locationName: string, + instanceName: string, serviceName: string, error: AggregatedError, ): string; - // Warning: (ae-forgotten-export) The symbol "NotFoundInLocation" needs to be exported by the entry point index.d.ts - // // (undocumented) getErrors( - locationName: string, + instanceName: string, serviceName: string, - ): Promise; + ): Promise; // (undocumented) - getLocationNames(): string[]; + getInstanceNames(): string[]; } +// @public (undocumented) +export type PeriskopApiOptions = { + discoveryApi: DiscoveryApi; + configApi: ConfigApi; +}; + // @public (undocumented) export const periskopApiRef: ApiRef; @@ -48,12 +105,13 @@ export const periskopApiRef: ApiRef; export const PeriskopErrorsTable: () => JSX.Element; // @public (undocumented) -export const periskopPlugin: BackstagePlugin< - { - root: RouteRef; - }, - {} ->; +export const periskopPlugin: BackstagePlugin<{}, {}>; + +// @public (undocumented) +export interface RequestHeaders { + // (undocumented) + [k: string]: string; +} // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/periskop/src/api/index.ts b/plugins/periskop/src/api/index.ts index 1258529698..c935733a1e 100644 --- a/plugins/periskop/src/api/index.ts +++ b/plugins/periskop/src/api/index.ts @@ -17,7 +17,8 @@ import { ConfigApi, DiscoveryApi } from '@backstage/core-plugin-api'; import { AggregatedError, NotFoundInInstance } from '../types'; -type Options = { +/** @public */ +export type PeriskopApiOptions = { discoveryApi: DiscoveryApi; configApi: ConfigApi; }; @@ -36,7 +37,7 @@ export class PeriskopApi { private readonly discoveryApi: DiscoveryApi; private readonly instances: PeriskopInstance[]; - constructor(options: Options) { + constructor(options: PeriskopApiOptions) { this.discoveryApi = options.discoveryApi; this.instances = options.configApi .getConfigArray('periskop.instances') diff --git a/plugins/periskop/src/index.ts b/plugins/periskop/src/index.ts index 4f66e60228..a22fc65d73 100644 --- a/plugins/periskop/src/index.ts +++ b/plugins/periskop/src/index.ts @@ -21,3 +21,4 @@ export { PERISKOP_NAME_ANNOTATION, } from './components/PeriskopErrorsTable'; export * from './api/index'; +export * from './types'; diff --git a/plugins/periskop/src/types.ts b/plugins/periskop/src/types.ts index 084ba52620..d3d0d6663f 100644 --- a/plugins/periskop/src/types.ts +++ b/plugins/periskop/src/types.ts @@ -14,12 +14,15 @@ * limitations under the License. */ +/** @public */ export interface AggregatedError { aggregation_key: string; total_count: number; severity: string; latest_errors: ErrorInstance[]; } + +/** @public */ export interface ErrorInstance { error: Error; uuid: string; @@ -27,22 +30,29 @@ export interface ErrorInstance { severity: string; http_context: HttpContext; } + +/** @public */ export interface Error { class: string; message: string; stacktrace?: string[]; cause?: Error | null; } + +/** @public */ export interface HttpContext { request_method: string; request_url: string; request_headers: RequestHeaders; request_body: string; } + +/** @public */ export interface RequestHeaders { [k: string]: string; } +/** @public */ export interface NotFoundInInstance { body: string; }