updown.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.
@@ -1,19 +1,19 @@
1
1
  export declare const Endpoint: {
2
2
  CHECKS: string;
3
- DOWNTIMES: string;
4
- METRICS: string;
5
- NODES: string;
6
- IPV4: string;
7
- IPV6: string;
8
3
  Checks: {
9
4
  check(token: string): string;
10
5
  downtimes(token: string): string;
11
6
  metrics(token: string): string;
12
7
  };
8
+ checks(token?: string): string;
9
+ DOWNTIMES: string;
10
+ IPV4: string;
11
+ IPV6: string;
12
+ METRICS: string;
13
+ NODES: string;
13
14
  Nodes: {
14
15
  ipv4(): string;
15
16
  ipv6(): string;
16
17
  };
17
- checks(token?: string): string;
18
18
  nodes(): string;
19
19
  };
package/dist/Endpoints.js CHANGED
@@ -4,11 +4,6 @@ exports.Endpoint = void 0;
4
4
  const encode = encodeURIComponent;
5
5
  exports.Endpoint = {
6
6
  CHECKS: 'checks',
7
- DOWNTIMES: 'downtimes',
8
- METRICS: 'metrics',
9
- NODES: 'nodes',
10
- IPV4: 'ipv4',
11
- IPV6: 'ipv6',
12
7
  Checks: {
13
8
  check(token) {
14
9
  return `/${exports.Endpoint.CHECKS}/${encode(token)}/`;
@@ -20,6 +15,14 @@ exports.Endpoint = {
20
15
  return `/${exports.Endpoint.CHECKS}/${encode(token)}/${exports.Endpoint.METRICS}/`;
21
16
  },
22
17
  },
18
+ checks(token) {
19
+ return `/${exports.Endpoint.CHECKS}/${token ? `${encode(token)}/` : ''}`;
20
+ },
21
+ DOWNTIMES: 'downtimes',
22
+ IPV4: 'ipv4',
23
+ IPV6: 'ipv6',
24
+ METRICS: 'metrics',
25
+ NODES: 'nodes',
23
26
  Nodes: {
24
27
  ipv4() {
25
28
  return `/${exports.Endpoint.NODES}/${exports.Endpoint.IPV4}/`;
@@ -28,9 +31,6 @@ exports.Endpoint = {
28
31
  return `/${exports.Endpoint.NODES}/${exports.Endpoint.IPV6}/`;
29
32
  },
30
33
  },
31
- checks(token) {
32
- return `/${exports.Endpoint.CHECKS}/${token ? `${encode(token)}/` : ''}`;
33
- },
34
34
  nodes() {
35
35
  return `/${exports.Endpoint.NODES}/`;
36
36
  },
@@ -38,7 +38,7 @@ export declare class ChecksAPI {
38
38
  * The time range needs to be at least one hour to get data.
39
39
  *
40
40
  * @param token The check unique token
41
- * @param page The page to fetch (100 per page)
41
+ * @param options Metrics options
42
42
  */
43
43
  getMetrics(token: string, options?: MetricsOptions): Promise<Metrics>;
44
44
  /**
@@ -81,7 +81,7 @@ class ChecksAPI {
81
81
  * The time range needs to be at least one hour to get data.
82
82
  *
83
83
  * @param token The check unique token
84
- * @param page The page to fetch (100 per page)
84
+ * @param options Metrics options
85
85
  */
86
86
  getMetrics(token, options) {
87
87
  return __awaiter(this, void 0, void 0, function* () {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from './UpdownIO';
1
+ export * from './api/';
2
2
  export * from './interfaces/';
3
+ export * from './UpdownIO';
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("./UpdownIO"), exports);
17
+ __exportStar(require("./api/"), exports);
18
18
  __exportStar(require("./interfaces/"), exports);
19
+ __exportStar(require("./UpdownIO"), exports);
@@ -5,18 +5,18 @@ export interface Check {
5
5
  custom_headers: CustomHeaders;
6
6
  disabled_locations: string[];
7
7
  down: boolean;
8
- down_since: string | null;
8
+ down_since: null | string;
9
9
  enabled: boolean;
10
- error: string | null;
11
- favicon_url: string | null;
10
+ error: null | string;
11
+ favicon_url: null | string;
12
12
  last_check_at: string;
13
13
  last_status: number;
14
- mute_until: string | null;
14
+ mute_until: null | string;
15
15
  next_check_at: string;
16
16
  period: number;
17
17
  published: boolean;
18
18
  ssl: {
19
- error: string | null;
19
+ error: null | string;
20
20
  tested_at: string;
21
21
  valid: boolean;
22
22
  };
@@ -1,12 +1,40 @@
1
+ export interface CheckOptions {
2
+ /** Human readable name */
3
+ alias?: string;
4
+ /** APDEX threshold in seconds (0.125, 0.25, 0.5, 1.0 or 2.0) */
5
+ apdex_t?: number;
6
+ /** The HTTP headers you want in updown requests. Ex: custom_headers[X-Api-Key]=xxxxxxxxx */
7
+ customHeaders?: CustomHeaders;
8
+ /** Disabled monitoring locations. It's an array of abbreviated location names. Can be any of these: ["lan", "mia", "bhs", "gra", "fra", "sin", "tok", "syd"]. Ex: disabled_locations[]=lan&disabled_locations[]=syd */
9
+ disabledLocations?: string[];
10
+ /** Is the check enabled (true or false) */
11
+ enabled?: boolean;
12
+ /** Mute notifications until given time, accepts a time, 'recovery' or 'forever' */
13
+ mute_until?: string;
14
+ /** Interval in seconds (15, 30, 60, 120, 300, 600, 1800 or 3600) */
15
+ period?: number;
16
+ /** Shall the status page be public (true or false) */
17
+ published?: boolean;
18
+ /** Search for this string in the page */
19
+ string_match?: string;
20
+ }
1
21
  export interface ClientOptions {
2
22
  apiKey: string;
3
23
  apiUrl?: string;
4
24
  }
5
25
  export interface CustomHeaders {
6
- [key: string]: string | number | boolean;
26
+ [key: string]: boolean | number | string;
7
27
  }
8
28
  export type HttpMethod = 'delete' | 'get' | 'post' | 'put';
9
- type MetricsGroup = 'time' | 'host';
29
+ export type MetricsGroup = 'host' | 'time';
30
+ export interface MetricsOptions {
31
+ /** Start time, default to 1 month ago */
32
+ from?: string;
33
+ /** Group data by 'time' (hour) or 'host' (location) */
34
+ group: MetricsGroup;
35
+ /** End time, default to now */
36
+ to?: string;
37
+ }
10
38
  export interface RequestOptions {
11
39
  alias?: string;
12
40
  apdex_t?: number;
@@ -25,32 +53,3 @@ export interface RequestOptions {
25
53
  to?: string;
26
54
  url?: string;
27
55
  }
28
- export interface MetricsOptions {
29
- /** Start time, default to 1 month ago */
30
- from?: string;
31
- /** Group data by 'time' (hour) or 'host' (location) */
32
- group: MetricsGroup;
33
- /** End time, default to now */
34
- to?: string;
35
- }
36
- export interface CheckOptions {
37
- /** Human readable name */
38
- alias?: string;
39
- /** APDEX threshold in seconds (0.125, 0.25, 0.5, 1.0 or 2.0) */
40
- apdex_t?: number;
41
- /** The HTTP headers you want in updown requests. Ex: custom_headers[X-Api-Key]=xxxxxxxxx */
42
- customHeaders?: CustomHeaders;
43
- /** Disabled monitoring locations. It's an array of abbreviated location names. Can be any of these: ["lan", "mia", "bhs", "gra", "fra", "sin", "tok", "syd"]. Ex: disabled_locations[]=lan&disabled_locations[]=syd */
44
- disabledLocations?: string[];
45
- /** Is the check enabled (true or false) */
46
- enabled?: boolean;
47
- /** Mute notifications until given time, accepts a time, 'recovery' or 'forever' */
48
- mute_until?: string;
49
- /** Interval in seconds (15, 30, 60, 120, 300, 600, 1800 or 3600) */
50
- period?: number;
51
- /** Shall the status page be public (true or false) */
52
- published?: boolean;
53
- /** Search for this string in the page */
54
- string_match?: string;
55
- }
56
- export {};
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.2.0"
4
+ "@ffflorian/api-client": "2.5.1"
5
5
  },
6
6
  "description": "An updown.io API client",
7
7
  "devDependencies": {
8
8
  "@types/node": "~24",
9
- "rimraf": "6.1.2",
10
- "typedoc": "0.28.15",
11
- "typescript": "5.9.3"
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/updown.io src/index.ts",
34
35
  "clean": "rimraf dist",
35
- "dist": "yarn clean && yarn build:ts",
36
+ "dist": "yarn clean && yarn build",
36
37
  "test": "exit 0"
37
38
  },
38
- "version": "3.4.5",
39
- "gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
39
+ "version": "3.4.7"
40
40
  }