updown.io 3.3.7 → 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.
- package/dist/UpdownIO.d.ts +2 -2
- package/dist/UpdownIO.js +7 -8
- package/dist/api/ChecksAPI.d.ts +4 -4
- package/dist/api/ChecksAPI.js +4 -4
- package/dist/api/NodesAPI.d.ts +4 -4
- package/dist/api/NodesAPI.js +3 -3
- package/package.json +8 -8
package/dist/UpdownIO.d.ts
CHANGED
package/dist/UpdownIO.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdownIO = void 0;
|
|
4
|
-
const
|
|
4
|
+
const api_client_1 = require("@ffflorian/api-client");
|
|
5
5
|
const api_1 = require("./api");
|
|
6
6
|
class UpdownIO {
|
|
7
7
|
constructor(options) {
|
|
8
8
|
if (typeof options === 'string') {
|
|
9
9
|
options = { apiKey: options };
|
|
10
10
|
}
|
|
11
|
-
this.apiClient =
|
|
12
|
-
|
|
13
|
-
headers: Object.assign({}, (options && options.apiKey && { 'X-API-KEY': options.apiKey })),
|
|
11
|
+
this.apiClient = new api_client_1.APIClient('https://updown.io/api/', {
|
|
12
|
+
headers: Object.assign({}, ((options === null || options === void 0 ? void 0 : options.apiKey) && { 'X-API-KEY': options.apiKey })),
|
|
14
13
|
});
|
|
15
14
|
this.api = {
|
|
16
15
|
checks: new api_1.ChecksAPI(this.apiClient),
|
|
@@ -19,11 +18,11 @@ class UpdownIO {
|
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Set a new API URL.
|
|
22
|
-
* @param
|
|
21
|
+
* @param newURL The new API url
|
|
23
22
|
*/
|
|
24
|
-
setApiUrl(
|
|
25
|
-
this.api.checks.setApiUrl(
|
|
26
|
-
this.api.nodes.setApiUrl(
|
|
23
|
+
setApiUrl(newURL) {
|
|
24
|
+
this.api.checks.setApiUrl(newURL);
|
|
25
|
+
this.api.nodes.setApiUrl(newURL);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
exports.UpdownIO = UpdownIO;
|
package/dist/api/ChecksAPI.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { APIClient } from '@ffflorian/api-client';
|
|
2
2
|
import type { Check, CheckOptions, Deleted, Downtime, Metrics, MetricsOptions } from '../interfaces';
|
|
3
3
|
export declare class ChecksAPI {
|
|
4
4
|
private readonly apiClient;
|
|
5
|
-
constructor(apiClient:
|
|
5
|
+
constructor(apiClient: APIClient);
|
|
6
6
|
/**
|
|
7
7
|
* Add a new check.
|
|
8
8
|
* @param url The URL you want to monitor.
|
|
@@ -43,9 +43,9 @@ export declare class ChecksAPI {
|
|
|
43
43
|
getMetrics(token: string, options?: MetricsOptions): Promise<Metrics>;
|
|
44
44
|
/**
|
|
45
45
|
* Set a new API URL.
|
|
46
|
-
* @param
|
|
46
|
+
* @param newURL The new API url
|
|
47
47
|
*/
|
|
48
|
-
setApiUrl(
|
|
48
|
+
setApiUrl(newURL: string): void;
|
|
49
49
|
/**
|
|
50
50
|
* Update a check.
|
|
51
51
|
* @param token The check unique token
|
package/dist/api/ChecksAPI.js
CHANGED
|
@@ -92,10 +92,10 @@ class ChecksAPI {
|
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* Set a new API URL.
|
|
95
|
-
* @param
|
|
95
|
+
* @param newURL The new API url
|
|
96
96
|
*/
|
|
97
|
-
setApiUrl(
|
|
98
|
-
this.apiClient.
|
|
97
|
+
setApiUrl(newURL) {
|
|
98
|
+
this.apiClient.setBaseURL(newURL);
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Update a check.
|
|
@@ -105,7 +105,7 @@ class ChecksAPI {
|
|
|
105
105
|
updateCheck(token, options) {
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
107
|
const endpoint = Endpoints_1.Endpoint.checks(token);
|
|
108
|
-
const { data } = yield this.apiClient.put(endpoint,
|
|
108
|
+
const { data } = yield this.apiClient.put(endpoint, options);
|
|
109
109
|
return data;
|
|
110
110
|
});
|
|
111
111
|
}
|
package/dist/api/NodesAPI.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { APIClient } from '@ffflorian/api-client';
|
|
2
2
|
import type { Nodes } from '../interfaces';
|
|
3
3
|
export declare class NodesAPI {
|
|
4
4
|
private readonly apiClient;
|
|
5
|
-
constructor(apiClient:
|
|
5
|
+
constructor(apiClient: APIClient);
|
|
6
6
|
/** List all updown.io monitoring nodes IPv4 addresses. */
|
|
7
7
|
getIpv4Nodes(): Promise<string[]>;
|
|
8
8
|
/** List all updown.io monitoring nodes IPv6 addresses. */
|
|
@@ -11,7 +11,7 @@ export declare class NodesAPI {
|
|
|
11
11
|
getNodes(): Promise<Nodes>;
|
|
12
12
|
/**
|
|
13
13
|
* Set a new API URL.
|
|
14
|
-
* @param
|
|
14
|
+
* @param newURL The new API url
|
|
15
15
|
*/
|
|
16
|
-
setApiUrl(
|
|
16
|
+
setApiUrl(newURL: string): void;
|
|
17
17
|
}
|
package/dist/api/NodesAPI.js
CHANGED
|
@@ -41,10 +41,10 @@ class NodesAPI {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Set a new API URL.
|
|
44
|
-
* @param
|
|
44
|
+
* @param newURL The new API url
|
|
45
45
|
*/
|
|
46
|
-
setApiUrl(
|
|
47
|
-
this.apiClient.
|
|
46
|
+
setApiUrl(newURL) {
|
|
47
|
+
this.apiClient.setBaseURL(newURL);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.NodesAPI = NodesAPI;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"
|
|
4
|
+
"@ffflorian/api-client": "2.1.2"
|
|
5
5
|
},
|
|
6
6
|
"description": "An updown.io API client",
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@types/node": "~24",
|
|
9
|
-
"rimraf": "6.0
|
|
10
|
-
"typedoc": "0.28.
|
|
9
|
+
"rimraf": "6.1.0",
|
|
10
|
+
"typedoc": "0.28.14",
|
|
11
11
|
"typescript": "5.9.3"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">= 21"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"name": "updown.io",
|
|
28
28
|
"repository": "https://github.com/ffflorian/api-clients/tree/main/updown.io",
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build:ts": "tsc",
|
|
31
|
-
"build:docs": "typedoc --options ../../typedoc.json --out ../../docs/packages/updown.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/updown.io src/index.ts",
|
|
32
32
|
"clean": "rimraf dist",
|
|
33
33
|
"dist": "yarn clean && yarn build:ts",
|
|
34
34
|
"test": "exit 0"
|
|
35
35
|
},
|
|
36
|
-
"version": "3.
|
|
37
|
-
"gitHead": "
|
|
36
|
+
"version": "3.4.0",
|
|
37
|
+
"gitHead": "b6392f3b78cc68d334526b7ebd5f1375511c769f"
|
|
38
38
|
}
|