statuspage.io 3.4.4 → 3.4.6
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.
- package/package.json +5 -6
- package/dist/Endpoints.d.ts +0 -27
- package/dist/Endpoints.js +0 -48
- package/dist/Statuspage.d.ts +0 -28
- package/dist/Statuspage.js +0 -68
- package/dist/api/IncidentsAPI.d.ts +0 -16
- package/dist/api/IncidentsAPI.js +0 -41
- package/dist/api/ScheduledMaintenancesAPI.d.ts +0 -22
- package/dist/api/ScheduledMaintenancesAPI.js +0 -53
- package/dist/api/SubscribersAPI.d.ts +0 -38
- package/dist/api/SubscribersAPI.js +0 -60
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.js +0 -19
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -18
- package/dist/interfaces/API.d.ts +0 -34
- package/dist/interfaces/API.js +0 -2
- package/dist/interfaces/Request.d.ts +0 -26
- package/dist/interfaces/Request.js +0 -2
- package/dist/interfaces/Result.d.ts +0 -102
- package/dist/interfaces/Result.js +0 -25
- package/dist/interfaces/index.d.ts +0 -3
- package/dist/interfaces/index.js +0 -19
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@ffflorian/api-client": "2.
|
|
4
|
+
"@ffflorian/api-client": "2.5.0"
|
|
5
5
|
},
|
|
6
6
|
"description": "A statuspage.io API client",
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@types/node": "~24",
|
|
9
|
-
"rimraf": "6.1.
|
|
10
|
-
"typedoc": "0.28.
|
|
11
|
-
"typescript": "
|
|
9
|
+
"rimraf": "6.1.3",
|
|
10
|
+
"typedoc": "0.28.18",
|
|
11
|
+
"typescript": "6.0.2"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">= 21"
|
|
@@ -35,6 +35,5 @@
|
|
|
35
35
|
"dist": "yarn clean && yarn build:ts",
|
|
36
36
|
"test": "exit 0"
|
|
37
37
|
},
|
|
38
|
-
"version": "3.4.
|
|
39
|
-
"gitHead": "12bebfb90528bb894bccb99670373af33c6a5159"
|
|
38
|
+
"version": "3.4.6"
|
|
40
39
|
}
|
package/dist/Endpoints.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare const Endpoint: {
|
|
2
|
-
ACTIVE_JSON: string;
|
|
3
|
-
API_V2_BASE: string;
|
|
4
|
-
COMPONENTS_JSON: string;
|
|
5
|
-
INCIDENTS: string;
|
|
6
|
-
INCIDENTS_JSON: string;
|
|
7
|
-
SCHEDULED_MAINTENANCES: string;
|
|
8
|
-
SCHEDULED_MAINTENANCES_JSON: string;
|
|
9
|
-
STATUS_JSON: string;
|
|
10
|
-
SUBSCRIBERS_JSON: string;
|
|
11
|
-
SUMMARY_JSON: string;
|
|
12
|
-
UNRESOLVED_JSON: string;
|
|
13
|
-
UPCOMING_JSON: string;
|
|
14
|
-
Incidents: {
|
|
15
|
-
all(): string;
|
|
16
|
-
unresolved(): string;
|
|
17
|
-
};
|
|
18
|
-
ScheduledMaintenances: {
|
|
19
|
-
active(): string;
|
|
20
|
-
all(): string;
|
|
21
|
-
upcoming(): string;
|
|
22
|
-
};
|
|
23
|
-
components(): string;
|
|
24
|
-
summary(): string;
|
|
25
|
-
status(): string;
|
|
26
|
-
subscribers(): string;
|
|
27
|
-
};
|
package/dist/Endpoints.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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_JSON: 'components.json',
|
|
8
|
-
INCIDENTS: 'incidents',
|
|
9
|
-
INCIDENTS_JSON: 'incidents.json',
|
|
10
|
-
SCHEDULED_MAINTENANCES: 'scheduled-maintenances',
|
|
11
|
-
SCHEDULED_MAINTENANCES_JSON: 'scheduled-maintenances.json',
|
|
12
|
-
STATUS_JSON: 'status.json',
|
|
13
|
-
SUBSCRIBERS_JSON: 'subscribers.json',
|
|
14
|
-
SUMMARY_JSON: 'summary.json',
|
|
15
|
-
UNRESOLVED_JSON: 'unresolved.json',
|
|
16
|
-
UPCOMING_JSON: 'upcoming.json',
|
|
17
|
-
Incidents: {
|
|
18
|
-
all() {
|
|
19
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.INCIDENTS_JSON}`;
|
|
20
|
-
},
|
|
21
|
-
unresolved() {
|
|
22
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.INCIDENTS}/${exports.Endpoint.UNRESOLVED_JSON}`;
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
ScheduledMaintenances: {
|
|
26
|
-
active() {
|
|
27
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES}/${exports.Endpoint.ACTIVE_JSON}`;
|
|
28
|
-
},
|
|
29
|
-
all() {
|
|
30
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES_JSON}`;
|
|
31
|
-
},
|
|
32
|
-
upcoming() {
|
|
33
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES}/${exports.Endpoint.UPCOMING_JSON}`;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
components() {
|
|
37
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.COMPONENTS_JSON}`;
|
|
38
|
-
},
|
|
39
|
-
summary() {
|
|
40
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SUMMARY_JSON}`;
|
|
41
|
-
},
|
|
42
|
-
status() {
|
|
43
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.STATUS_JSON}`;
|
|
44
|
-
},
|
|
45
|
-
subscribers() {
|
|
46
|
-
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SUBSCRIBERS_JSON}`;
|
|
47
|
-
},
|
|
48
|
-
};
|
package/dist/Statuspage.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/Statuspage.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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;
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/api/IncidentsAPI.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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;
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
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;
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
/**
|
|
8
|
-
* @param options Subscriber options.
|
|
9
|
-
*/
|
|
10
|
-
createComponentSubscription(emailSubscriber: EmailSubscriberData & ComponentSubscriberData): Promise<EmailSubscriber>;
|
|
11
|
-
createComponentSubscription(smsSubscriber: PhoneSubscriberData & ComponentSubscriberData): Promise<PhoneSubscriber>;
|
|
12
|
-
createComponentSubscription(webhookSubscriber: WebhookSubscriberData & ComponentSubscriberData): Promise<WebhookSubscriber>;
|
|
13
|
-
/**
|
|
14
|
-
* When an incident is created, a subscriber can be associated
|
|
15
|
-
* to that incident to receive notifications on updates until the
|
|
16
|
-
* incident is resolved. The incident must be in an unresolved
|
|
17
|
-
* state to subscribe to it.
|
|
18
|
-
* @param options Subscriber options.
|
|
19
|
-
*/
|
|
20
|
-
createIncidentSubscription(emailSubscriber: EmailSubscriberData & IncidentSubscriberData): Promise<EmailSubscriber>;
|
|
21
|
-
createIncidentSubscription(smsSubscriber: PhoneSubscriberData & IncidentSubscriberData): Promise<PhoneSubscriber>;
|
|
22
|
-
createIncidentSubscription(webhookSubscriber: WebhookSubscriberData & IncidentSubscriberData): Promise<WebhookSubscriber>;
|
|
23
|
-
/**
|
|
24
|
-
* A page subscriber is by default subscribed to all incidents associated with a page.
|
|
25
|
-
* @param options Subscriber options.
|
|
26
|
-
*/
|
|
27
|
-
createPageSubscription(emailSubscriber: EmailSubscriberData): Promise<EmailSubscriber>;
|
|
28
|
-
createPageSubscription(smsSubscriber: PhoneSubscriberData): Promise<PhoneSubscriber>;
|
|
29
|
-
createPageSubscription(webhookSubscriber: WebhookSubscriberData): Promise<WebhookSubscriber>;
|
|
30
|
-
/**
|
|
31
|
-
* @param options Subscriber options.
|
|
32
|
-
*/
|
|
33
|
-
getSubscription(subscriberId: string): Promise<CombinedSubscriber>;
|
|
34
|
-
/**
|
|
35
|
-
* To cancel a subscription, you need to submit a 'DELETE' request with the the subscription id.
|
|
36
|
-
*/
|
|
37
|
-
removeSubscription(subscriberId: string): Promise<boolean>;
|
|
38
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
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 options Subscriber options.
|
|
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;
|
package/dist/api/index.d.ts
DELETED
package/dist/api/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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);
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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("./Statuspage"), exports);
|
|
18
|
-
__exportStar(require("./interfaces/"), exports);
|
package/dist/interfaces/API.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IncidentsAPI, ScheduledMaintenancesAPI, SubscribersAPI } from '../api';
|
|
2
|
-
import type { Components, Status, Summary } from './Result';
|
|
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
|
-
}
|
package/dist/interfaces/API.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface ComponentSubscriberData {
|
|
2
|
-
component_id: string;
|
|
3
|
-
}
|
|
4
|
-
export interface EmailSubscriberData {
|
|
5
|
-
email: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IncidentSubscriberData {
|
|
8
|
-
incident_id: string;
|
|
9
|
-
}
|
|
10
|
-
export interface RequestOptions {
|
|
11
|
-
subscriber?: CombinedSubscriberData | (CombinedSubscriberData & IncidentSubscriberData) | {
|
|
12
|
-
id: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface PhoneSubscriberData {
|
|
16
|
-
/** Defaults to `us` if not supplied. */
|
|
17
|
-
phone_country?: string;
|
|
18
|
-
phone_number: string;
|
|
19
|
-
}
|
|
20
|
-
export interface SubscriberOptions {
|
|
21
|
-
isSubscribed: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface WebhookSubscriberData extends EmailSubscriberData {
|
|
24
|
-
endpoint: string;
|
|
25
|
-
}
|
|
26
|
-
export type CombinedSubscriberData = PhoneSubscriberData | EmailSubscriberData | WebhookSubscriberData;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
export interface Component {
|
|
2
|
-
created_at: string;
|
|
3
|
-
description: string | null;
|
|
4
|
-
group: boolean;
|
|
5
|
-
group_id: string | null;
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
only_show_if_degraded: boolean;
|
|
9
|
-
page_id: string;
|
|
10
|
-
position: number;
|
|
11
|
-
showcase: boolean;
|
|
12
|
-
start_date: string | null;
|
|
13
|
-
status: string;
|
|
14
|
-
updated_at: string;
|
|
15
|
-
}
|
|
16
|
-
export interface Page {
|
|
17
|
-
page: {
|
|
18
|
-
id: string;
|
|
19
|
-
name: string;
|
|
20
|
-
time_zone: string;
|
|
21
|
-
updated_at: string;
|
|
22
|
-
url: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export interface Incidents extends Page {
|
|
26
|
-
incidents: Incident[];
|
|
27
|
-
}
|
|
28
|
-
export interface Components extends Page {
|
|
29
|
-
components: Component[];
|
|
30
|
-
}
|
|
31
|
-
export declare enum MaintenanceStatus {
|
|
32
|
-
Completed = "completed",
|
|
33
|
-
InProgress = "in_progress",
|
|
34
|
-
Scheduled = "scheduled",
|
|
35
|
-
Verifying = "verifying"
|
|
36
|
-
}
|
|
37
|
-
export type ScheduledMaintenance = Omit<Incident, 'status'> & {
|
|
38
|
-
scheduled_for: string;
|
|
39
|
-
scheduled_until: string;
|
|
40
|
-
status: MaintenanceStatus;
|
|
41
|
-
};
|
|
42
|
-
export interface ScheduledMaintenances extends Page {
|
|
43
|
-
scheduled_maintenances: ScheduledMaintenance[];
|
|
44
|
-
}
|
|
45
|
-
export interface Subscriber extends Page {
|
|
46
|
-
can_select_components: boolean;
|
|
47
|
-
}
|
|
48
|
-
export interface WebhookSubscriber extends Subscriber {
|
|
49
|
-
mode: 'webhook';
|
|
50
|
-
webhook: string;
|
|
51
|
-
}
|
|
52
|
-
export interface EmailSubscriber extends Subscriber {
|
|
53
|
-
email: string;
|
|
54
|
-
mode: 'email_sms';
|
|
55
|
-
}
|
|
56
|
-
export interface PhoneSubscriber extends Subscriber {
|
|
57
|
-
mode: 'email_sms';
|
|
58
|
-
phone: string;
|
|
59
|
-
}
|
|
60
|
-
export declare enum IncidentImpact {
|
|
61
|
-
Critical = "critical",
|
|
62
|
-
Major = "major",
|
|
63
|
-
Minor = "minor",
|
|
64
|
-
None = "none"
|
|
65
|
-
}
|
|
66
|
-
export declare enum IncidentStatus {
|
|
67
|
-
Identified = "identified",
|
|
68
|
-
Investigating = "investigating",
|
|
69
|
-
Monitoring = "monitoring",
|
|
70
|
-
Postmortem = "postmortem",
|
|
71
|
-
Resolved = "resolved"
|
|
72
|
-
}
|
|
73
|
-
export interface Incident {
|
|
74
|
-
created_at: string;
|
|
75
|
-
id: string;
|
|
76
|
-
impact: IncidentImpact;
|
|
77
|
-
incident_updates: IncidentUpdate[];
|
|
78
|
-
monitoring_at: string | null;
|
|
79
|
-
name: string;
|
|
80
|
-
page_id: string;
|
|
81
|
-
resolved_at: string | null;
|
|
82
|
-
shortlink: string;
|
|
83
|
-
status: IncidentStatus;
|
|
84
|
-
updated_at: string;
|
|
85
|
-
}
|
|
86
|
-
export interface IncidentUpdate {
|
|
87
|
-
body: string;
|
|
88
|
-
created_at: string;
|
|
89
|
-
display_at: string;
|
|
90
|
-
id: string;
|
|
91
|
-
incident_id: string;
|
|
92
|
-
status: IncidentStatus;
|
|
93
|
-
updated_at: string;
|
|
94
|
-
}
|
|
95
|
-
export interface Status extends Page {
|
|
96
|
-
status: {
|
|
97
|
-
description: string;
|
|
98
|
-
indicator: string;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export type CombinedSubscriber = PhoneSubscriber | EmailSubscriber | WebhookSubscriber;
|
|
102
|
-
export type Summary = Status & ScheduledMaintenances & Components & Incidents;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IncidentStatus = exports.IncidentImpact = exports.MaintenanceStatus = void 0;
|
|
4
|
-
var MaintenanceStatus;
|
|
5
|
-
(function (MaintenanceStatus) {
|
|
6
|
-
MaintenanceStatus["Completed"] = "completed";
|
|
7
|
-
MaintenanceStatus["InProgress"] = "in_progress";
|
|
8
|
-
MaintenanceStatus["Scheduled"] = "scheduled";
|
|
9
|
-
MaintenanceStatus["Verifying"] = "verifying";
|
|
10
|
-
})(MaintenanceStatus || (exports.MaintenanceStatus = MaintenanceStatus = {}));
|
|
11
|
-
var IncidentImpact;
|
|
12
|
-
(function (IncidentImpact) {
|
|
13
|
-
IncidentImpact["Critical"] = "critical";
|
|
14
|
-
IncidentImpact["Major"] = "major";
|
|
15
|
-
IncidentImpact["Minor"] = "minor";
|
|
16
|
-
IncidentImpact["None"] = "none";
|
|
17
|
-
})(IncidentImpact || (exports.IncidentImpact = IncidentImpact = {}));
|
|
18
|
-
var IncidentStatus;
|
|
19
|
-
(function (IncidentStatus) {
|
|
20
|
-
IncidentStatus["Identified"] = "identified";
|
|
21
|
-
IncidentStatus["Investigating"] = "investigating";
|
|
22
|
-
IncidentStatus["Monitoring"] = "monitoring";
|
|
23
|
-
IncidentStatus["Postmortem"] = "postmortem";
|
|
24
|
-
IncidentStatus["Resolved"] = "resolved";
|
|
25
|
-
})(IncidentStatus || (exports.IncidentStatus = IncidentStatus = {}));
|
package/dist/interfaces/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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);
|