From 0be087f637a58c382930e26d9f3b3b7c72e1b52e Mon Sep 17 00:00:00 2001 From: Alec Jacobs Date: Fri, 3 Jun 2022 17:07:32 -0700 Subject: [PATCH] fix(plugins/pagerduty): define responses types before utilizing them Signed-off-by: Alec Jacobs --- plugins/pagerduty/src/api/client.ts | 1 - plugins/pagerduty/src/api/types.ts | 40 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/plugins/pagerduty/src/api/client.ts b/plugins/pagerduty/src/api/client.ts index 7f9f3d6c59..ebf350add2 100644 --- a/plugins/pagerduty/src/api/client.ts +++ b/plugins/pagerduty/src/api/client.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { Service, Incident, ChangeEvent, OnCall } from '../components/types'; import { PagerDutyApi, TriggerAlarmRequest, diff --git a/plugins/pagerduty/src/api/types.ts b/plugins/pagerduty/src/api/types.ts index d2ab0290d3..ed6c1f222a 100644 --- a/plugins/pagerduty/src/api/types.ts +++ b/plugins/pagerduty/src/api/types.ts @@ -18,6 +18,26 @@ import { Incident, ChangeEvent, OnCall, Service } from '../components/types'; import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'; import { PagerDutyEntity } from '../types'; +export type ServicesResponse = { + services: Service[]; +}; + +export type ServiceResponse = { + service: Service; +}; + +export type IncidentsResponse = { + incidents: Incident[]; +}; + +export type ChangeEventsResponse = { + change_events: ChangeEvent[]; +}; + +export type OnCallsResponse = { + oncalls: OnCall[]; +}; + export type TriggerAlarmRequest = { integrationKey: string; source: string; @@ -58,26 +78,6 @@ export interface PagerDutyApi { triggerAlarm(request: TriggerAlarmRequest): Promise; } -export type ServicesResponse = { - services: Service[]; -}; - -export type ServiceResponse = { - service: Service; -}; - -export type IncidentsResponse = { - incidents: Incident[]; -}; - -export type ChangeEventsResponse = { - change_events: ChangeEvent[]; -}; - -export type OnCallsResponse = { - oncalls: OnCall[]; -}; - export type ClientApiDependencies = { discoveryApi: DiscoveryApi; fetchApi: FetchApi;