diff --git a/plugins/pagerduty/api-report.md b/plugins/pagerduty/api-report.md index c708a1ca4e..dd6155521b 100644 --- a/plugins/pagerduty/api-report.md +++ b/plugins/pagerduty/api-report.md @@ -13,11 +13,88 @@ import { Entity } from '@backstage/catalog-model'; import { FetchApi } from '@backstage/core-plugin-api'; import { ReactNode } from 'react'; +// Warning: (ae-missing-release-tag) "Assignee" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Assignee = { + id: string; + summary: string; + html_url: string; +}; + +// Warning: (ae-missing-release-tag) "ChangeEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ChangeEvent = { + id: string; + integration: [ + { + service: Service; + }, + ]; + source: string; + html_url: string; + links: [ + { + href: string; + text: string; + }, + ]; + summary: string; + timestamp: string; +}; + +// Warning: (ae-missing-release-tag) "ChangeEventsResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ChangeEventsResponse = { + change_events: ChangeEvent[]; +}; + +// Warning: (ae-missing-release-tag) "ClientApiConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ClientApiConfig = ClientApiDependencies & { + eventsBaseUrl?: string; +}; + +// Warning: (ae-missing-release-tag) "ClientApiDependencies" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ClientApiDependencies = { + discoveryApi: DiscoveryApi; + fetchApi: FetchApi; +}; + // Warning: (ae-missing-release-tag) "EntityPagerDutyCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export const EntityPagerDutyCard: () => JSX.Element; +// Warning: (ae-missing-release-tag) "Incident" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Incident = { + id: string; + title: string; + status: string; + html_url: string; + assignments: [ + { + assignee: Assignee; + }, + ]; + serviceId: string; + created_at: string; +}; + +// Warning: (ae-missing-release-tag) "IncidentsResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type IncidentsResponse = { + incidents: Incident[]; +}; + // Warning: (ae-missing-release-tag) "isPluginApplicableToEntity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -25,6 +102,21 @@ const isPluginApplicableToEntity: (entity: Entity) => boolean; export { isPluginApplicableToEntity as isPagerDutyAvailable }; export { isPluginApplicableToEntity }; +// Warning: (ae-missing-release-tag) "OnCall" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type OnCall = { + user: User; + escalation_level: number; +}; + +// Warning: (ae-missing-release-tag) "OnCallsResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type OnCallsResponse = { + oncalls: OnCall[]; +}; + // Warning: (ae-forgotten-export) The symbol "PagerDutyApi" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "pagerDutyApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -40,38 +132,35 @@ export const PagerDutyCard: () => JSX.Element; // // @public (undocumented) export class PagerDutyClient implements PagerDutyApi { - // Warning: (ae-forgotten-export) The symbol "ClientApiConfig" needs to be exported by the entry point index.d.ts constructor(config: ClientApiConfig); // (undocumented) static fromConfig( configApi: ConfigApi, - discoveryApi: DiscoveryApi, - fetchApi: FetchApi, + { discoveryApi, fetchApi }: ClientApiDependencies, ): PagerDutyClient; - // Warning: (ae-forgotten-export) The symbol "ChangeEvent" needs to be exported by the entry point index.d.ts - // // (undocumented) - getChangeEventsByServiceId(serviceId: string): Promise; - // Warning: (ae-forgotten-export) The symbol "Incident" needs to be exported by the entry point index.d.ts - // + getChangeEventsByServiceId(serviceId: string): Promise; // (undocumented) - getIncidentsByServiceId(serviceId: string): Promise; - // Warning: (ae-forgotten-export) The symbol "OnCall" needs to be exported by the entry point index.d.ts - // + getIncidentsByServiceId(serviceId: string): Promise; // (undocumented) - getOnCallByPolicyId(policyId: string): Promise; - // Warning: (ae-forgotten-export) The symbol "Service" needs to be exported by the entry point index.d.ts - // + getOnCallByPolicyId(policyId: string): Promise; // (undocumented) - getServiceByIntegrationKey(integrationKey: string): Promise; - // (undocumented) - getServiceByServiceId(serviceId: string): Promise; - // Warning: (ae-forgotten-export) The symbol "TriggerAlarmRequest" needs to be exported by the entry point index.d.ts - // + getServiceByEntity( + pagerDutyEntity: PagerDutyEntity, + ): Promise; // (undocumented) triggerAlarm(request: TriggerAlarmRequest): Promise; } +// Warning: (ae-missing-release-tag) "PagerDutyEntity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PagerDutyEntity = { + integrationKey?: string; + serviceId?: string; + name: string; +}; + // Warning: (ae-missing-release-tag) "pagerDutyPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -79,6 +168,38 @@ const pagerDutyPlugin: BackstagePlugin<{}, {}>; export { pagerDutyPlugin }; export { pagerDutyPlugin as plugin }; +// Warning: (ae-missing-release-tag) "Service" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Service = { + id: string; + name: string; + html_url: string; + integrationKey: string; + escalation_policy: { + id: string; + user: User; + html_url: string; + }; +}; + +// Warning: (ae-missing-release-tag) "ServiceResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ServiceResponse = { + service: Service; +}; + +// Warning: (ae-missing-release-tag) "TriggerAlarmRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TriggerAlarmRequest = { + integrationKey: string; + source: string; + description: string; + userName: string; +}; + // Warning: (ae-forgotten-export) The symbol "TriggerButtonProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "TriggerButton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -89,4 +210,15 @@ export function TriggerButton(props: TriggerButtonProps): JSX.Element; // // @public (undocumented) export class UnauthorizedError extends Error {} + +// Warning: (ae-missing-release-tag) "User" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type User = { + id: string; + summary: string; + email: string; + html_url: string; + name: string; +}; ``` diff --git a/plugins/pagerduty/src/api/index.ts b/plugins/pagerduty/src/api/index.ts index 015204b1e8..a88137b979 100644 --- a/plugins/pagerduty/src/api/index.ts +++ b/plugins/pagerduty/src/api/index.ts @@ -15,4 +15,12 @@ */ export { PagerDutyClient, pagerDutyApiRef, UnauthorizedError } from './client'; -export type { PagerDutyApi } from './types'; +export type { + ServiceResponse, + IncidentsResponse, + ChangeEventsResponse, + OnCallsResponse, + TriggerAlarmRequest, + ClientApiDependencies, + ClientApiConfig, +} from './types'; diff --git a/plugins/pagerduty/src/components/index.ts b/plugins/pagerduty/src/components/index.ts new file mode 100644 index 0000000000..a452c12e12 --- /dev/null +++ b/plugins/pagerduty/src/components/index.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +export type { + ChangeEvent, + Incident, + Service, + OnCall, + Assignee, + User, +} from './types'; + +export { + isPluginApplicableToEntity, + isPluginApplicableToEntity as isPagerDutyAvailable, + PagerDutyCard, +} from './PagerDutyCard'; + +export { TriggerButton } from './TriggerButton'; diff --git a/plugins/pagerduty/src/index.ts b/plugins/pagerduty/src/index.ts index 8c970c01bb..2e0eddc9a8 100644 --- a/plugins/pagerduty/src/index.ts +++ b/plugins/pagerduty/src/index.ts @@ -25,14 +25,8 @@ export { pagerDutyPlugin as plugin, EntityPagerDutyCard, } from './plugin'; -export { - isPluginApplicableToEntity, - isPluginApplicableToEntity as isPagerDutyAvailable, - PagerDutyCard, -} from './components/PagerDutyCard'; -export { TriggerButton } from './components/TriggerButton'; -export { - PagerDutyClient, - pagerDutyApiRef, - UnauthorizedError, -} from './api/client'; + +export * from './components'; +export * from './api'; + +export type { PagerDutyEntity } from './types';