statuspage.io 3.4.6 → 3.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ export declare const Endpoint: {
2
+ ACTIVE_JSON: string;
3
+ API_V2_BASE: string;
4
+ components(): string;
5
+ COMPONENTS_JSON: string;
6
+ INCIDENTS: string;
7
+ Incidents: {
8
+ all(): string;
9
+ unresolved(): string;
10
+ };
11
+ INCIDENTS_JSON: string;
12
+ SCHEDULED_MAINTENANCES: string;
13
+ SCHEDULED_MAINTENANCES_JSON: string;
14
+ ScheduledMaintenances: {
15
+ active(): string;
16
+ all(): string;
17
+ upcoming(): string;
18
+ };
19
+ status(): string;
20
+ STATUS_JSON: string;
21
+ subscribers(): string;
22
+ SUBSCRIBERS_JSON: string;
23
+ summary(): string;
24
+ SUMMARY_JSON: string;
25
+ UNRESOLVED_JSON: string;
26
+ UPCOMING_JSON: string;
27
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Endpoint = void 0;
4
+ exports.Endpoint = {
5
+ ACTIVE_JSON: 'upcoming.json',
6
+ API_V2_BASE: 'api/v2',
7
+ components() {
8
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.COMPONENTS_JSON}`;
9
+ },
10
+ COMPONENTS_JSON: 'components.json',
11
+ INCIDENTS: 'incidents',
12
+ Incidents: {
13
+ all() {
14
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.INCIDENTS_JSON}`;
15
+ },
16
+ unresolved() {
17
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.INCIDENTS}/${exports.Endpoint.UNRESOLVED_JSON}`;
18
+ },
19
+ },
20
+ INCIDENTS_JSON: 'incidents.json',
21
+ SCHEDULED_MAINTENANCES: 'scheduled-maintenances',
22
+ SCHEDULED_MAINTENANCES_JSON: 'scheduled-maintenances.json',
23
+ ScheduledMaintenances: {
24
+ active() {
25
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES}/${exports.Endpoint.ACTIVE_JSON}`;
26
+ },
27
+ all() {
28
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES_JSON}`;
29
+ },
30
+ upcoming() {
31
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES}/${exports.Endpoint.UPCOMING_JSON}`;
32
+ },
33
+ },
34
+ status() {
35
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.STATUS_JSON}`;
36
+ },
37
+ STATUS_JSON: 'status.json',
38
+ subscribers() {
39
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SUBSCRIBERS_JSON}`;
40
+ },
41
+ SUBSCRIBERS_JSON: 'subscribers.json',
42
+ summary() {
43
+ return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SUMMARY_JSON}`;
44
+ },
45
+ SUMMARY_JSON: 'summary.json',
46
+ UNRESOLVED_JSON: 'unresolved.json',
47
+ UPCOMING_JSON: 'upcoming.json',
48
+ };
@@ -0,0 +1,28 @@
1
+ import type { API } from './interfaces/API';
2
+ export declare class Statuspage {
3
+ readonly api: API;
4
+ private readonly apiClient;
5
+ constructor(pageId: string);
6
+ /**
7
+ * Set a new API URL.
8
+ * @param newURL The new API url
9
+ */
10
+ setApiUrl(newURL: string): void;
11
+ /**
12
+ * Get the components for the page. Each component is listed along with its status -
13
+ * one of `operational`, `degraded_performance`, `partial_outage`, or `major_outage`.
14
+ */
15
+ private readonly getComponents;
16
+ /**
17
+ * Get the status rollup for the whole page. This endpoint includes an indicator -
18
+ * one of `none`, `minor`, `major`, or `critical`, as well as a human description of the
19
+ * blended component status. Examples of the blended status include "All Systems
20
+ * Operational", "Partially Degraded Service", and "Major Service Outage".
21
+ */
22
+ private readonly getStatus;
23
+ /**
24
+ * Get a summary of the status page, including a status indicator, component statuses,
25
+ * unresolved incidents, and any upcoming or in-progress scheduled maintenances.
26
+ */
27
+ private readonly getSummary;
28
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Statuspage = void 0;
13
+ const api_client_1 = require("@ffflorian/api-client");
14
+ const api_1 = require("./api");
15
+ const Endpoints_1 = require("./Endpoints");
16
+ class Statuspage {
17
+ constructor(pageId) {
18
+ /**
19
+ * Get the components for the page. Each component is listed along with its status -
20
+ * one of `operational`, `degraded_performance`, `partial_outage`, or `major_outage`.
21
+ */
22
+ this.getComponents = () => __awaiter(this, void 0, void 0, function* () {
23
+ const endpoint = Endpoints_1.Endpoint.components();
24
+ const { data } = yield this.apiClient.get(endpoint);
25
+ return data;
26
+ });
27
+ /**
28
+ * Get the status rollup for the whole page. This endpoint includes an indicator -
29
+ * one of `none`, `minor`, `major`, or `critical`, as well as a human description of the
30
+ * blended component status. Examples of the blended status include "All Systems
31
+ * Operational", "Partially Degraded Service", and "Major Service Outage".
32
+ */
33
+ this.getStatus = () => __awaiter(this, void 0, void 0, function* () {
34
+ const endpoint = Endpoints_1.Endpoint.status();
35
+ const { data } = yield this.apiClient.get(endpoint);
36
+ return data;
37
+ });
38
+ /**
39
+ * Get a summary of the status page, including a status indicator, component statuses,
40
+ * unresolved incidents, and any upcoming or in-progress scheduled maintenances.
41
+ */
42
+ this.getSummary = () => __awaiter(this, void 0, void 0, function* () {
43
+ const endpoint = Endpoints_1.Endpoint.summary();
44
+ const { data } = yield this.apiClient.get(endpoint);
45
+ return data;
46
+ });
47
+ if (!pageId) {
48
+ throw new Error('A page ID needs to be set in order to use the client.');
49
+ }
50
+ this.apiClient = new api_client_1.APIClient(`https://${pageId}.statuspage.io`);
51
+ this.api = {
52
+ getComponents: this.getComponents,
53
+ getStatus: this.getStatus,
54
+ getSummary: this.getSummary,
55
+ incidents: new api_1.IncidentsAPI(this.apiClient),
56
+ scheduledMaintenances: new api_1.ScheduledMaintenancesAPI(this.apiClient),
57
+ subscribers: new api_1.SubscribersAPI(this.apiClient),
58
+ };
59
+ }
60
+ /**
61
+ * Set a new API URL.
62
+ * @param newURL The new API url
63
+ */
64
+ setApiUrl(newURL) {
65
+ this.apiClient.setBaseURL(newURL);
66
+ }
67
+ }
68
+ exports.Statuspage = Statuspage;
@@ -0,0 +1,16 @@
1
+ import type { APIClient } from '@ffflorian/api-client';
2
+ import type { Incidents } from '../interfaces/Result';
3
+ export declare class IncidentsAPI {
4
+ private readonly apiClient;
5
+ constructor(apiClient: APIClient);
6
+ /**
7
+ * Get a list of the 50 most recent incidents. This includes all unresolved
8
+ * incidents as described above, as well as those in the *Resolved* and *Postmortem* state.
9
+ */
10
+ getAll(): Promise<Incidents>;
11
+ /**
12
+ * Get a list of any unresolved incidents. This endpoint will only return
13
+ * incidents in the *Investigating*, *Identified*, or *Monitoring* state.
14
+ */
15
+ getUnresolved(): Promise<Incidents>;
16
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IncidentsAPI = void 0;
13
+ const Endpoints_1 = require("../Endpoints");
14
+ class IncidentsAPI {
15
+ constructor(apiClient) {
16
+ this.apiClient = apiClient;
17
+ }
18
+ /**
19
+ * Get a list of the 50 most recent incidents. This includes all unresolved
20
+ * incidents as described above, as well as those in the *Resolved* and *Postmortem* state.
21
+ */
22
+ getAll() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const endpoint = Endpoints_1.Endpoint.Incidents.all();
25
+ const { data } = yield this.apiClient.get(endpoint);
26
+ return data;
27
+ });
28
+ }
29
+ /**
30
+ * Get a list of any unresolved incidents. This endpoint will only return
31
+ * incidents in the *Investigating*, *Identified*, or *Monitoring* state.
32
+ */
33
+ getUnresolved() {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const endpoint = Endpoints_1.Endpoint.Incidents.unresolved();
36
+ const { data } = yield this.apiClient.get(endpoint);
37
+ return data;
38
+ });
39
+ }
40
+ }
41
+ exports.IncidentsAPI = IncidentsAPI;
@@ -0,0 +1,22 @@
1
+ import type { APIClient } from '@ffflorian/api-client';
2
+ import type { ScheduledMaintenances } from '../interfaces/Result';
3
+ export declare class ScheduledMaintenancesAPI {
4
+ private readonly apiClient;
5
+ constructor(requestService: APIClient);
6
+ /**
7
+ * Get a list of any active maintenances. This endpoint will only return
8
+ * scheduled maintenances in the *In Progress* or *Verifying* state.
9
+ */
10
+ getActive(): Promise<ScheduledMaintenances>;
11
+ /**
12
+ * Get a list of the 50 most recent scheduled maintenances. This includes
13
+ * scheduled maintenances as described in the above two endpoints, as well
14
+ * as those in the *Completed* state.
15
+ */
16
+ getAll(): Promise<ScheduledMaintenances>;
17
+ /**
18
+ * Get a list of any upcoming maintenances. This endpoint will only return
19
+ * scheduled maintenances still in the *Scheduled* state.
20
+ */
21
+ getUpcoming(): Promise<ScheduledMaintenances>;
22
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ScheduledMaintenancesAPI = void 0;
13
+ const Endpoints_1 = require("../Endpoints");
14
+ class ScheduledMaintenancesAPI {
15
+ constructor(requestService) {
16
+ this.apiClient = requestService;
17
+ }
18
+ /**
19
+ * Get a list of any active maintenances. This endpoint will only return
20
+ * scheduled maintenances in the *In Progress* or *Verifying* state.
21
+ */
22
+ getActive() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.upcoming();
25
+ const { data } = yield this.apiClient.get(endpoint);
26
+ return data;
27
+ });
28
+ }
29
+ /**
30
+ * Get a list of the 50 most recent scheduled maintenances. This includes
31
+ * scheduled maintenances as described in the above two endpoints, as well
32
+ * as those in the *Completed* state.
33
+ */
34
+ getAll() {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.upcoming();
37
+ const { data } = yield this.apiClient.get(endpoint);
38
+ return data;
39
+ });
40
+ }
41
+ /**
42
+ * Get a list of any upcoming maintenances. This endpoint will only return
43
+ * scheduled maintenances still in the *Scheduled* state.
44
+ */
45
+ getUpcoming() {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.upcoming();
48
+ const { data } = yield this.apiClient.get(endpoint);
49
+ return data;
50
+ });
51
+ }
52
+ }
53
+ exports.ScheduledMaintenancesAPI = ScheduledMaintenancesAPI;
@@ -0,0 +1,33 @@
1
+ import type { APIClient } from '@ffflorian/api-client';
2
+ import type { ComponentSubscriberData, EmailSubscriberData, IncidentSubscriberData, PhoneSubscriberData, WebhookSubscriberData } from '../interfaces/Request';
3
+ import type { CombinedSubscriber, EmailSubscriber, PhoneSubscriber, WebhookSubscriber } from '../interfaces/Result';
4
+ export declare class SubscribersAPI {
5
+ private readonly apiClient;
6
+ constructor(apiClient: APIClient);
7
+ createComponentSubscription(emailSubscriber: ComponentSubscriberData & EmailSubscriberData): Promise<EmailSubscriber>;
8
+ createComponentSubscription(smsSubscriber: ComponentSubscriberData & PhoneSubscriberData): Promise<PhoneSubscriber>;
9
+ createComponentSubscription(webhookSubscriber: ComponentSubscriberData & WebhookSubscriberData): Promise<WebhookSubscriber>;
10
+ /**
11
+ * When an incident is created, a subscriber can be associated
12
+ * to that incident to receive notifications on updates until the
13
+ * incident is resolved. The incident must be in an unresolved
14
+ * state to subscribe to it.
15
+ */
16
+ createIncidentSubscription(emailSubscriber: EmailSubscriberData & IncidentSubscriberData): Promise<EmailSubscriber>;
17
+ createIncidentSubscription(smsSubscriber: IncidentSubscriberData & PhoneSubscriberData): Promise<PhoneSubscriber>;
18
+ createIncidentSubscription(webhookSubscriber: IncidentSubscriberData & WebhookSubscriberData): Promise<WebhookSubscriber>;
19
+ /**
20
+ * A page subscriber is by default subscribed to all incidents associated with a page.
21
+ */
22
+ createPageSubscription(emailSubscriber: EmailSubscriberData): Promise<EmailSubscriber>;
23
+ createPageSubscription(smsSubscriber: PhoneSubscriberData): Promise<PhoneSubscriber>;
24
+ createPageSubscription(webhookSubscriber: WebhookSubscriberData): Promise<WebhookSubscriber>;
25
+ /**
26
+ * @param subscriberId The subscriber ID.
27
+ */
28
+ getSubscription(subscriberId: string): Promise<CombinedSubscriber>;
29
+ /**
30
+ * To cancel a subscription, you need to submit a 'DELETE' request with the the subscription id.
31
+ */
32
+ removeSubscription(subscriberId: string): Promise<boolean>;
33
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SubscribersAPI = void 0;
13
+ const Endpoints_1 = require("../Endpoints");
14
+ class SubscribersAPI {
15
+ constructor(apiClient) {
16
+ this.apiClient = apiClient;
17
+ }
18
+ createComponentSubscription(subscriberData) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = Endpoints_1.Endpoint.subscribers();
21
+ const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: subscriberData } });
22
+ return data;
23
+ });
24
+ }
25
+ createIncidentSubscription(subscriberData) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const endpoint = Endpoints_1.Endpoint.subscribers();
28
+ const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: subscriberData } });
29
+ return data;
30
+ });
31
+ }
32
+ createPageSubscription(subscriptionData) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const endpoint = Endpoints_1.Endpoint.subscribers();
35
+ const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: subscriptionData } });
36
+ return data;
37
+ });
38
+ }
39
+ /**
40
+ * @param subscriberId The subscriber ID.
41
+ */
42
+ getSubscription(subscriberId) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const endpoint = Endpoints_1.Endpoint.subscribers();
45
+ const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: { id: subscriberId } } });
46
+ return data;
47
+ });
48
+ }
49
+ /**
50
+ * To cancel a subscription, you need to submit a 'DELETE' request with the the subscription id.
51
+ */
52
+ removeSubscription(subscriberId) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const endpoint = Endpoints_1.Endpoint.Incidents.all();
55
+ const { data } = yield this.apiClient.delete(endpoint, { params: { subscriber: { id: subscriberId } } });
56
+ return data;
57
+ });
58
+ }
59
+ }
60
+ exports.SubscribersAPI = SubscribersAPI;
@@ -0,0 +1,3 @@
1
+ export * from './IncidentsAPI';
2
+ export * from './ScheduledMaintenancesAPI';
3
+ export * from './SubscribersAPI';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./IncidentsAPI"), exports);
18
+ __exportStar(require("./ScheduledMaintenancesAPI"), exports);
19
+ __exportStar(require("./SubscribersAPI"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './api/';
2
+ export * from './interfaces/';
3
+ export * from './Statuspage';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/"), exports);
18
+ __exportStar(require("./interfaces/"), exports);
19
+ __exportStar(require("./Statuspage"), exports);
@@ -0,0 +1,34 @@
1
+ import type { Components, Status, Summary } from './Result';
2
+ import { IncidentsAPI, ScheduledMaintenancesAPI, SubscribersAPI } from '../api';
3
+ export interface API {
4
+ getComponents(): Promise<Components>;
5
+ getStatus(): Promise<Status>;
6
+ getSummary(): Promise<Summary>;
7
+ /**
8
+ * Incidents are the cornerstone of any status page, being composed of many incident
9
+ * updates. Each incident usually goes through a progression of statuses listed below,
10
+ * with an impact calculated from a blend of component statuses (or an optional override).
11
+ *
12
+ * **Status**: *Investigating*, *Identified*, *Monitoring*, *Resolved*, or *Postmortem*
13
+ *
14
+ * **Impact**: *None (black*), *Minor (yellow*), *Major (orange*), or *Critical (red)*
15
+ */
16
+ incidents: IncidentsAPI;
17
+ /**
18
+ * Scheduled Maintenances are planned outages, upgrades, or general notices that
19
+ * you're working on infrastructure and disruptions may occurr. A close sibling
20
+ * of Incidents, each usually goes through a progression of statuses listed below,
21
+ * with an impact calculated from a blend of component statuses (or an optional
22
+ * override).
23
+ *
24
+ * **Status**: *Scheduled*, *In Progress*, *Verifying*, or *Completed*
25
+ *
26
+ * **Impact**: *None (black)*, *Minor (yellow)*, *Major (orange)*, or *Critical (red)*
27
+ */
28
+ scheduledMaintenances: ScheduledMaintenancesAPI;
29
+ /**
30
+ * Subscribers receive notifications via a webhook, email or SMS. You can create and
31
+ * disable subscriptions for pages and unresolved incidents using the subscribers api.
32
+ */
33
+ subscribers: SubscribersAPI;
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ export type CombinedSubscriberData = EmailSubscriberData | PhoneSubscriberData | WebhookSubscriberData;
2
+ export interface ComponentSubscriberData {
3
+ component_id: string;
4
+ }
5
+ export interface EmailSubscriberData {
6
+ email: string;
7
+ }
8
+ export interface IncidentSubscriberData {
9
+ incident_id: string;
10
+ }
11
+ export interface PhoneSubscriberData {
12
+ /** Defaults to `us` if not supplied. */
13
+ phone_country?: string;
14
+ phone_number: string;
15
+ }
16
+ export interface RequestOptions {
17
+ subscriber?: {
18
+ id: string;
19
+ } | CombinedSubscriberData | (CombinedSubscriberData & IncidentSubscriberData);
20
+ }
21
+ export interface SubscriberOptions {
22
+ isSubscribed: boolean;
23
+ }
24
+ export interface WebhookSubscriberData extends EmailSubscriberData {
25
+ endpoint: string;
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,102 @@
1
+ export declare enum IncidentImpact {
2
+ Critical = "critical",
3
+ Major = "major",
4
+ Minor = "minor",
5
+ None = "none"
6
+ }
7
+ export declare enum IncidentStatus {
8
+ Identified = "identified",
9
+ Investigating = "investigating",
10
+ Monitoring = "monitoring",
11
+ Postmortem = "postmortem",
12
+ Resolved = "resolved"
13
+ }
14
+ export declare enum MaintenanceStatus {
15
+ Completed = "completed",
16
+ InProgress = "in_progress",
17
+ Scheduled = "scheduled",
18
+ Verifying = "verifying"
19
+ }
20
+ export type CombinedSubscriber = EmailSubscriber | PhoneSubscriber | WebhookSubscriber;
21
+ export interface Component {
22
+ created_at: string;
23
+ description: null | string;
24
+ group: boolean;
25
+ group_id: null | string;
26
+ id: string;
27
+ name: string;
28
+ only_show_if_degraded: boolean;
29
+ page_id: string;
30
+ position: number;
31
+ showcase: boolean;
32
+ start_date: null | string;
33
+ status: string;
34
+ updated_at: string;
35
+ }
36
+ export interface Components extends Page {
37
+ components: Component[];
38
+ }
39
+ export interface EmailSubscriber extends Subscriber {
40
+ email: string;
41
+ mode: 'email_sms';
42
+ }
43
+ export interface Incident {
44
+ created_at: string;
45
+ id: string;
46
+ impact: IncidentImpact;
47
+ incident_updates: IncidentUpdate[];
48
+ monitoring_at: null | string;
49
+ name: string;
50
+ page_id: string;
51
+ resolved_at: null | string;
52
+ shortlink: string;
53
+ status: IncidentStatus;
54
+ updated_at: string;
55
+ }
56
+ export interface Incidents extends Page {
57
+ incidents: Incident[];
58
+ }
59
+ export interface IncidentUpdate {
60
+ body: string;
61
+ created_at: string;
62
+ display_at: string;
63
+ id: string;
64
+ incident_id: string;
65
+ status: IncidentStatus;
66
+ updated_at: string;
67
+ }
68
+ export interface Page {
69
+ page: {
70
+ id: string;
71
+ name: string;
72
+ time_zone: string;
73
+ updated_at: string;
74
+ url: string;
75
+ };
76
+ }
77
+ export interface PhoneSubscriber extends Subscriber {
78
+ mode: 'email_sms';
79
+ phone: string;
80
+ }
81
+ export type ScheduledMaintenance = {
82
+ scheduled_for: string;
83
+ scheduled_until: string;
84
+ status: MaintenanceStatus;
85
+ } & Omit<Incident, 'status'>;
86
+ export interface ScheduledMaintenances extends Page {
87
+ scheduled_maintenances: ScheduledMaintenance[];
88
+ }
89
+ export interface Status extends Page {
90
+ status: {
91
+ description: string;
92
+ indicator: string;
93
+ };
94
+ }
95
+ export interface Subscriber extends Page {
96
+ can_select_components: boolean;
97
+ }
98
+ export type Summary = Components & Incidents & ScheduledMaintenances & Status;
99
+ export interface WebhookSubscriber extends Subscriber {
100
+ mode: 'webhook';
101
+ webhook: string;
102
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaintenanceStatus = exports.IncidentStatus = exports.IncidentImpact = void 0;
4
+ var IncidentImpact;
5
+ (function (IncidentImpact) {
6
+ IncidentImpact["Critical"] = "critical";
7
+ IncidentImpact["Major"] = "major";
8
+ IncidentImpact["Minor"] = "minor";
9
+ IncidentImpact["None"] = "none";
10
+ })(IncidentImpact || (exports.IncidentImpact = IncidentImpact = {}));
11
+ var IncidentStatus;
12
+ (function (IncidentStatus) {
13
+ IncidentStatus["Identified"] = "identified";
14
+ IncidentStatus["Investigating"] = "investigating";
15
+ IncidentStatus["Monitoring"] = "monitoring";
16
+ IncidentStatus["Postmortem"] = "postmortem";
17
+ IncidentStatus["Resolved"] = "resolved";
18
+ })(IncidentStatus || (exports.IncidentStatus = IncidentStatus = {}));
19
+ var MaintenanceStatus;
20
+ (function (MaintenanceStatus) {
21
+ MaintenanceStatus["Completed"] = "completed";
22
+ MaintenanceStatus["InProgress"] = "in_progress";
23
+ MaintenanceStatus["Scheduled"] = "scheduled";
24
+ MaintenanceStatus["Verifying"] = "verifying";
25
+ })(MaintenanceStatus || (exports.MaintenanceStatus = MaintenanceStatus = {}));
@@ -0,0 +1,3 @@
1
+ export * from './API';
2
+ export * from './Request';
3
+ export * from './Result';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./API"), exports);
18
+ __exportStar(require("./Request"), exports);
19
+ __exportStar(require("./Result"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "@ffflorian/api-client": "2.5.0"
4
+ "@ffflorian/api-client": "2.5.1"
5
5
  },
6
6
  "description": "A statuspage.io API client",
7
7
  "devDependencies": {
@@ -29,11 +29,12 @@
29
29
  "readme": "https://github.com/ffflorian/api-clients#readme",
30
30
  "repository": "https://github.com/ffflorian/api-clients.git",
31
31
  "scripts": {
32
+ "build": "yarn build:ts",
32
33
  "build:ts": "tsc -p tsconfig.build.json",
33
34
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/statuspage.io src/index.ts",
34
35
  "clean": "rimraf dist",
35
- "dist": "yarn clean && yarn build:ts",
36
+ "dist": "yarn clean && yarn build",
36
37
  "test": "exit 0"
37
38
  },
38
- "version": "3.4.6"
39
+ "version": "3.4.7"
39
40
  }