statuspage.io 3.3.8 → 3.4.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.
@@ -5,9 +5,9 @@ export declare class Statuspage {
5
5
  constructor(pageId: string);
6
6
  /**
7
7
  * Set a new API URL.
8
- * @param newUrl The new API url
8
+ * @param newURL The new API url
9
9
  */
10
- setApiUrl(newUrl: string): void;
10
+ setApiUrl(newURL: string): void;
11
11
  /**
12
12
  * Get the components for the page. Each component is listed along with its status -
13
13
  * one of `operational`, `degraded_performance`, `partial_outage`, or `major_outage`.
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Statuspage = void 0;
13
- const axios_1 = require("axios");
13
+ const api_client_1 = require("@ffflorian/api-client");
14
14
  const api_1 = require("./api");
15
15
  const Endpoints_1 = require("./Endpoints");
16
16
  class Statuspage {
@@ -47,9 +47,7 @@ class Statuspage {
47
47
  if (!pageId) {
48
48
  throw new Error('A page ID needs to be set in order to use the client.');
49
49
  }
50
- this.apiClient = axios_1.default.create({
51
- baseURL: `https://${pageId}.statuspage.io`,
52
- });
50
+ this.apiClient = new api_client_1.APIClient(`https://${pageId}.statuspage.io`);
53
51
  this.api = {
54
52
  getComponents: this.getComponents,
55
53
  getStatus: this.getStatus,
@@ -61,10 +59,10 @@ class Statuspage {
61
59
  }
62
60
  /**
63
61
  * Set a new API URL.
64
- * @param newUrl The new API url
62
+ * @param newURL The new API url
65
63
  */
66
- setApiUrl(newUrl) {
67
- this.apiClient.defaults.baseURL = newUrl;
64
+ setApiUrl(newURL) {
65
+ this.apiClient.setBaseURL(newURL);
68
66
  }
69
67
  }
70
68
  exports.Statuspage = Statuspage;
@@ -1,8 +1,8 @@
1
- import type { AxiosInstance } from 'axios';
1
+ import type { APIClient } from '@ffflorian/api-client';
2
2
  import type { Incidents } from '../interfaces/Result';
3
3
  export declare class IncidentsAPI {
4
4
  private readonly apiClient;
5
- constructor(apiClient: AxiosInstance);
5
+ constructor(apiClient: APIClient);
6
6
  /**
7
7
  * Get a list of the 50 most recent incidents. This includes all unresolved
8
8
  * incidents as described above, as well as those in the *Resolved* and *Postmortem* state.
@@ -1,8 +1,8 @@
1
- import type { AxiosInstance } from 'axios';
1
+ import type { APIClient } from '@ffflorian/api-client';
2
2
  import type { ScheduledMaintenances } from '../interfaces/Result';
3
3
  export declare class ScheduledMaintenancesAPI {
4
4
  private readonly apiClient;
5
- constructor(requestService: AxiosInstance);
5
+ constructor(requestService: APIClient);
6
6
  /**
7
7
  * Get a list of any active maintenances. This endpoint will only return
8
8
  * scheduled maintenances in the *In Progress* or *Verifying* state.
@@ -1,9 +1,9 @@
1
- import type { AxiosInstance } from 'axios';
1
+ import type { APIClient } from '@ffflorian/api-client';
2
2
  import type { ComponentSubscriberData, EmailSubscriberData, IncidentSubscriberData, PhoneSubscriberData, WebhookSubscriberData } from '../interfaces/Request';
3
3
  import type { CombinedSubscriber, EmailSubscriber, PhoneSubscriber, WebhookSubscriber } from '../interfaces/Result';
4
4
  export declare class SubscribersAPI {
5
5
  private readonly apiClient;
6
- constructor(apiClient: AxiosInstance);
6
+ constructor(apiClient: APIClient);
7
7
  /**
8
8
  * @param options Subscriber options.
9
9
  */
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "axios": "1.12.2"
4
+ "@ffflorian/api-client": "2.1.2"
5
5
  },
6
6
  "description": "A statuspage.io API client",
7
7
  "devDependencies": {
8
8
  "@types/node": "~24",
9
- "typedoc": "0.28.13",
9
+ "rimraf": "6.1.0",
10
+ "typedoc": "0.28.14",
10
11
  "typescript": "5.9.3"
11
12
  },
12
13
  "engines": {
13
- "node": ">= 10.9"
14
+ "node": ">= 21"
14
15
  },
15
16
  "files": [
16
17
  "dist"
@@ -26,12 +27,12 @@
26
27
  "name": "statuspage.io",
27
28
  "repository": "https://github.com/ffflorian/api-clients/tree/main/packages/statuspage.io",
28
29
  "scripts": {
29
- "build:ts": "tsc",
30
- "build:docs": "typedoc --options ../../typedoc.json --out ../../docs/packages/statuspage.io src/index.ts",
30
+ "build:ts": "tsc -p tsconfig.build.json",
31
+ "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/statuspage.io src/index.ts",
31
32
  "clean": "rimraf dist",
32
33
  "dist": "yarn clean && yarn build:ts",
33
34
  "test": "exit 0"
34
35
  },
35
- "version": "3.3.8",
36
- "gitHead": "2ece1d399cc1f60310ff4dd4daa566df760751ed"
36
+ "version": "3.4.0",
37
+ "gitHead": "b6392f3b78cc68d334526b7ebd5f1375511c769f"
37
38
  }