statuspage.io 3.4.7 → 3.5.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # statuspage.io [![npm version](https://img.shields.io/npm/v/statuspage.io.svg)](https://www.npmjs.com/package/statuspage.io)
2
2
 
3
- A [statuspage.io](https://statuspage.io) API client. For a documentation on the API see https://developer.statuspage.io/.
3
+ A [statuspage.io](https://statuspage.io) API client. For a documentation on the API see [the statuspage.io API reference](https://developer.statuspage.io).
4
4
 
5
5
  ### Installation
6
6
 
@@ -18,6 +18,7 @@ export declare const Endpoint: {
18
18
  };
19
19
  status(): string;
20
20
  STATUS_JSON: string;
21
+ subscriber(subscriberId: string): string;
21
22
  subscribers(): string;
22
23
  SUBSCRIBERS_JSON: string;
23
24
  summary(): string;
package/dist/Endpoints.js CHANGED
@@ -35,6 +35,9 @@ exports.Endpoint = {
35
35
  return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.STATUS_JSON}`;
36
36
  },
37
37
  STATUS_JSON: 'status.json',
38
+ subscriber(subscriberId) {
39
+ return `/${exports.Endpoint.API_V2_BASE}/subscribers/${encodeURIComponent(subscriberId)}.json`;
40
+ },
38
41
  subscribers() {
39
42
  return `/${exports.Endpoint.API_V2_BASE}/${exports.Endpoint.SUBSCRIBERS_JSON}`;
40
43
  },
@@ -21,7 +21,7 @@ class ScheduledMaintenancesAPI {
21
21
  */
22
22
  getActive() {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
- const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.upcoming();
24
+ const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.active();
25
25
  const { data } = yield this.apiClient.get(endpoint);
26
26
  return data;
27
27
  });
@@ -33,7 +33,7 @@ class ScheduledMaintenancesAPI {
33
33
  */
34
34
  getAll() {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.upcoming();
36
+ const endpoint = Endpoints_1.Endpoint.ScheduledMaintenances.all();
37
37
  const { data } = yield this.apiClient.get(endpoint);
38
38
  return data;
39
39
  });
@@ -18,21 +18,21 @@ class SubscribersAPI {
18
18
  createComponentSubscription(subscriberData) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  const endpoint = Endpoints_1.Endpoint.subscribers();
21
- const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: subscriberData } });
21
+ const { data } = yield this.apiClient.post(endpoint, { subscriber: subscriberData });
22
22
  return data;
23
23
  });
24
24
  }
25
25
  createIncidentSubscription(subscriberData) {
26
26
  return __awaiter(this, void 0, void 0, function* () {
27
27
  const endpoint = Endpoints_1.Endpoint.subscribers();
28
- const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: subscriberData } });
28
+ const { data } = yield this.apiClient.post(endpoint, { subscriber: subscriberData });
29
29
  return data;
30
30
  });
31
31
  }
32
32
  createPageSubscription(subscriptionData) {
33
33
  return __awaiter(this, void 0, void 0, function* () {
34
34
  const endpoint = Endpoints_1.Endpoint.subscribers();
35
- const { data } = yield this.apiClient.get(endpoint, { params: { subscriber: subscriptionData } });
35
+ const { data } = yield this.apiClient.post(endpoint, { subscriber: subscriptionData });
36
36
  return data;
37
37
  });
38
38
  }
@@ -51,8 +51,8 @@ class SubscribersAPI {
51
51
  */
52
52
  removeSubscription(subscriberId) {
53
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 } } });
54
+ const endpoint = Endpoints_1.Endpoint.subscriber(subscriberId);
55
+ const { data } = yield this.apiClient.delete(endpoint);
56
56
  return data;
57
57
  });
58
58
  }
package/package.json CHANGED
@@ -6,9 +6,11 @@
6
6
  "description": "A statuspage.io API client",
7
7
  "devDependencies": {
8
8
  "@types/node": "~24",
9
+ "nock": "14.0.12",
9
10
  "rimraf": "6.1.3",
10
- "typedoc": "0.28.18",
11
- "typescript": "6.0.2"
11
+ "typedoc": "0.28.19",
12
+ "typescript": "6.0.2",
13
+ "vitest": "4.1.4"
12
14
  },
13
15
  "engines": {
14
16
  "node": ">= 21"
@@ -34,7 +36,7 @@
34
36
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/statuspage.io src/index.ts",
35
37
  "clean": "rimraf dist",
36
38
  "dist": "yarn clean && yarn build",
37
- "test": "exit 0"
39
+ "test": "vitest"
38
40
  },
39
- "version": "3.4.7"
41
+ "version": "3.5.0"
40
42
  }