statuspage.io 3.4.5 → 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.
- package/dist/Endpoints.d.ts +10 -10
- package/dist/Endpoints.js +14 -14
- package/dist/api/SubscribersAPI.d.ts +6 -11
- package/dist/api/SubscribersAPI.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/interfaces/API.d.ts +1 -1
- package/dist/interfaces/Request.d.ts +6 -6
- package/dist/interfaces/Result.d.ts +57 -57
- package/dist/interfaces/Result.js +8 -8
- package/package.json +7 -7
package/dist/Endpoints.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export declare const Endpoint: {
|
|
2
2
|
ACTIVE_JSON: string;
|
|
3
3
|
API_V2_BASE: string;
|
|
4
|
+
components(): string;
|
|
4
5
|
COMPONENTS_JSON: string;
|
|
5
6
|
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
7
|
Incidents: {
|
|
15
8
|
all(): string;
|
|
16
9
|
unresolved(): string;
|
|
17
10
|
};
|
|
11
|
+
INCIDENTS_JSON: string;
|
|
12
|
+
SCHEDULED_MAINTENANCES: string;
|
|
13
|
+
SCHEDULED_MAINTENANCES_JSON: string;
|
|
18
14
|
ScheduledMaintenances: {
|
|
19
15
|
active(): string;
|
|
20
16
|
all(): string;
|
|
21
17
|
upcoming(): string;
|
|
22
18
|
};
|
|
23
|
-
components(): string;
|
|
24
|
-
summary(): string;
|
|
25
19
|
status(): string;
|
|
20
|
+
STATUS_JSON: string;
|
|
26
21
|
subscribers(): string;
|
|
22
|
+
SUBSCRIBERS_JSON: string;
|
|
23
|
+
summary(): string;
|
|
24
|
+
SUMMARY_JSON: string;
|
|
25
|
+
UNRESOLVED_JSON: string;
|
|
26
|
+
UPCOMING_JSON: string;
|
|
27
27
|
};
|
package/dist/Endpoints.js
CHANGED
|
@@ -4,16 +4,11 @@ exports.Endpoint = void 0;
|
|
|
4
4
|
exports.Endpoint = {
|
|
5
5
|
ACTIVE_JSON: 'upcoming.json',
|
|
6
6
|
API_V2_BASE: 'api/v2',
|
|
7
|
+
components() {
|
|
8
|
+
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.COMPONENTS_JSON}`;
|
|
9
|
+
},
|
|
7
10
|
COMPONENTS_JSON: 'components.json',
|
|
8
11
|
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
12
|
Incidents: {
|
|
18
13
|
all() {
|
|
19
14
|
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.INCIDENTS_JSON}`;
|
|
@@ -22,6 +17,9 @@ exports.Endpoint = {
|
|
|
22
17
|
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.INCIDENTS}/${exports.Endpoint.UNRESOLVED_JSON}`;
|
|
23
18
|
},
|
|
24
19
|
},
|
|
20
|
+
INCIDENTS_JSON: 'incidents.json',
|
|
21
|
+
SCHEDULED_MAINTENANCES: 'scheduled-maintenances',
|
|
22
|
+
SCHEDULED_MAINTENANCES_JSON: 'scheduled-maintenances.json',
|
|
25
23
|
ScheduledMaintenances: {
|
|
26
24
|
active() {
|
|
27
25
|
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES}/${exports.Endpoint.ACTIVE_JSON}`;
|
|
@@ -33,16 +31,18 @@ exports.Endpoint = {
|
|
|
33
31
|
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SCHEDULED_MAINTENANCES}/${exports.Endpoint.UPCOMING_JSON}`;
|
|
34
32
|
},
|
|
35
33
|
},
|
|
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
34
|
status() {
|
|
43
35
|
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.STATUS_JSON}`;
|
|
44
36
|
},
|
|
37
|
+
STATUS_JSON: 'status.json',
|
|
45
38
|
subscribers() {
|
|
46
39
|
return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SUBSCRIBERS_JSON}`;
|
|
47
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
48
|
};
|
|
@@ -4,31 +4,26 @@ import type { CombinedSubscriber, EmailSubscriber, PhoneSubscriber, WebhookSubsc
|
|
|
4
4
|
export declare class SubscribersAPI {
|
|
5
5
|
private readonly apiClient;
|
|
6
6
|
constructor(apiClient: APIClient);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
createComponentSubscription(emailSubscriber: EmailSubscriberData & ComponentSubscriberData): Promise<EmailSubscriber>;
|
|
11
|
-
createComponentSubscription(smsSubscriber: PhoneSubscriberData & ComponentSubscriberData): Promise<PhoneSubscriber>;
|
|
12
|
-
createComponentSubscription(webhookSubscriber: WebhookSubscriberData & ComponentSubscriberData): Promise<WebhookSubscriber>;
|
|
7
|
+
createComponentSubscription(emailSubscriber: ComponentSubscriberData & EmailSubscriberData): Promise<EmailSubscriber>;
|
|
8
|
+
createComponentSubscription(smsSubscriber: ComponentSubscriberData & PhoneSubscriberData): Promise<PhoneSubscriber>;
|
|
9
|
+
createComponentSubscription(webhookSubscriber: ComponentSubscriberData & WebhookSubscriberData): Promise<WebhookSubscriber>;
|
|
13
10
|
/**
|
|
14
11
|
* When an incident is created, a subscriber can be associated
|
|
15
12
|
* to that incident to receive notifications on updates until the
|
|
16
13
|
* incident is resolved. The incident must be in an unresolved
|
|
17
14
|
* state to subscribe to it.
|
|
18
|
-
* @param options Subscriber options.
|
|
19
15
|
*/
|
|
20
16
|
createIncidentSubscription(emailSubscriber: EmailSubscriberData & IncidentSubscriberData): Promise<EmailSubscriber>;
|
|
21
|
-
createIncidentSubscription(smsSubscriber:
|
|
22
|
-
createIncidentSubscription(webhookSubscriber:
|
|
17
|
+
createIncidentSubscription(smsSubscriber: IncidentSubscriberData & PhoneSubscriberData): Promise<PhoneSubscriber>;
|
|
18
|
+
createIncidentSubscription(webhookSubscriber: IncidentSubscriberData & WebhookSubscriberData): Promise<WebhookSubscriber>;
|
|
23
19
|
/**
|
|
24
20
|
* A page subscriber is by default subscribed to all incidents associated with a page.
|
|
25
|
-
* @param options Subscriber options.
|
|
26
21
|
*/
|
|
27
22
|
createPageSubscription(emailSubscriber: EmailSubscriberData): Promise<EmailSubscriber>;
|
|
28
23
|
createPageSubscription(smsSubscriber: PhoneSubscriberData): Promise<PhoneSubscriber>;
|
|
29
24
|
createPageSubscription(webhookSubscriber: WebhookSubscriberData): Promise<WebhookSubscriber>;
|
|
30
25
|
/**
|
|
31
|
-
* @param
|
|
26
|
+
* @param subscriberId The subscriber ID.
|
|
32
27
|
*/
|
|
33
28
|
getSubscription(subscriberId: string): Promise<CombinedSubscriber>;
|
|
34
29
|
/**
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./api/"), exports);
|
|
18
18
|
__exportStar(require("./interfaces/"), exports);
|
|
19
|
+
__exportStar(require("./Statuspage"), exports);
|
package/dist/interfaces/API.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IncidentsAPI, ScheduledMaintenancesAPI, SubscribersAPI } from '../api';
|
|
2
1
|
import type { Components, Status, Summary } from './Result';
|
|
2
|
+
import { IncidentsAPI, ScheduledMaintenancesAPI, SubscribersAPI } from '../api';
|
|
3
3
|
export interface API {
|
|
4
4
|
getComponents(): Promise<Components>;
|
|
5
5
|
getStatus(): Promise<Status>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type CombinedSubscriberData = EmailSubscriberData | PhoneSubscriberData | WebhookSubscriberData;
|
|
1
2
|
export interface ComponentSubscriberData {
|
|
2
3
|
component_id: string;
|
|
3
4
|
}
|
|
@@ -7,20 +8,19 @@ export interface EmailSubscriberData {
|
|
|
7
8
|
export interface IncidentSubscriberData {
|
|
8
9
|
incident_id: string;
|
|
9
10
|
}
|
|
10
|
-
export interface RequestOptions {
|
|
11
|
-
subscriber?: CombinedSubscriberData | (CombinedSubscriberData & IncidentSubscriberData) | {
|
|
12
|
-
id: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
11
|
export interface PhoneSubscriberData {
|
|
16
12
|
/** Defaults to `us` if not supplied. */
|
|
17
13
|
phone_country?: string;
|
|
18
14
|
phone_number: string;
|
|
19
15
|
}
|
|
16
|
+
export interface RequestOptions {
|
|
17
|
+
subscriber?: {
|
|
18
|
+
id: string;
|
|
19
|
+
} | CombinedSubscriberData | (CombinedSubscriberData & IncidentSubscriberData);
|
|
20
|
+
}
|
|
20
21
|
export interface SubscriberOptions {
|
|
21
22
|
isSubscribed: boolean;
|
|
22
23
|
}
|
|
23
24
|
export interface WebhookSubscriberData extends EmailSubscriberData {
|
|
24
25
|
endpoint: string;
|
|
25
26
|
}
|
|
26
|
-
export type CombinedSubscriberData = PhoneSubscriberData | EmailSubscriberData | WebhookSubscriberData;
|
|
@@ -1,88 +1,61 @@
|
|
|
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;
|
|
1
21
|
export interface Component {
|
|
2
22
|
created_at: string;
|
|
3
|
-
description:
|
|
23
|
+
description: null | string;
|
|
4
24
|
group: boolean;
|
|
5
|
-
group_id:
|
|
25
|
+
group_id: null | string;
|
|
6
26
|
id: string;
|
|
7
27
|
name: string;
|
|
8
28
|
only_show_if_degraded: boolean;
|
|
9
29
|
page_id: string;
|
|
10
30
|
position: number;
|
|
11
31
|
showcase: boolean;
|
|
12
|
-
start_date:
|
|
32
|
+
start_date: null | string;
|
|
13
33
|
status: string;
|
|
14
34
|
updated_at: string;
|
|
15
35
|
}
|
|
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
36
|
export interface Components extends Page {
|
|
29
37
|
components: Component[];
|
|
30
38
|
}
|
|
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
39
|
export interface EmailSubscriber extends Subscriber {
|
|
53
40
|
email: string;
|
|
54
41
|
mode: 'email_sms';
|
|
55
42
|
}
|
|
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
43
|
export interface Incident {
|
|
74
44
|
created_at: string;
|
|
75
45
|
id: string;
|
|
76
46
|
impact: IncidentImpact;
|
|
77
47
|
incident_updates: IncidentUpdate[];
|
|
78
|
-
monitoring_at:
|
|
48
|
+
monitoring_at: null | string;
|
|
79
49
|
name: string;
|
|
80
50
|
page_id: string;
|
|
81
|
-
resolved_at:
|
|
51
|
+
resolved_at: null | string;
|
|
82
52
|
shortlink: string;
|
|
83
53
|
status: IncidentStatus;
|
|
84
54
|
updated_at: string;
|
|
85
55
|
}
|
|
56
|
+
export interface Incidents extends Page {
|
|
57
|
+
incidents: Incident[];
|
|
58
|
+
}
|
|
86
59
|
export interface IncidentUpdate {
|
|
87
60
|
body: string;
|
|
88
61
|
created_at: string;
|
|
@@ -92,11 +65,38 @@ export interface IncidentUpdate {
|
|
|
92
65
|
status: IncidentStatus;
|
|
93
66
|
updated_at: string;
|
|
94
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
|
+
}
|
|
95
89
|
export interface Status extends Page {
|
|
96
90
|
status: {
|
|
97
91
|
description: string;
|
|
98
92
|
indicator: string;
|
|
99
93
|
};
|
|
100
94
|
}
|
|
101
|
-
export
|
|
102
|
-
|
|
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
|
+
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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 = {}));
|
|
3
|
+
exports.MaintenanceStatus = exports.IncidentStatus = exports.IncidentImpact = void 0;
|
|
11
4
|
var IncidentImpact;
|
|
12
5
|
(function (IncidentImpact) {
|
|
13
6
|
IncidentImpact["Critical"] = "critical";
|
|
@@ -23,3 +16,10 @@ var IncidentStatus;
|
|
|
23
16
|
IncidentStatus["Postmortem"] = "postmortem";
|
|
24
17
|
IncidentStatus["Resolved"] = "resolved";
|
|
25
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 = {}));
|
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.1"
|
|
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"
|
|
@@ -29,12 +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
|
|
36
|
+
"dist": "yarn clean && yarn build",
|
|
36
37
|
"test": "exit 0"
|
|
37
38
|
},
|
|
38
|
-
"version": "3.4.
|
|
39
|
-
"gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
|
|
39
|
+
"version": "3.4.7"
|
|
40
40
|
}
|