@theholocron/holocron-plugin-checkly 5.0.0-alpha.246 → 5.0.0-alpha.248
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/index.d.mts +10 -18
- package/dist/index.mjs +10 -20
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { AuthError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringCheck, MonitoringCheckInput, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
2
2
|
import { ApiCheck, ApiCheckInput, ApiCheckRequest, Assertion, AssertionComparison, AssertionSource, ChecklyClient, ChecklyClientOptions, HttpMethod, ListChecksParams, createChecklyClient } from "@theholocron/checkly-client";
|
|
3
|
-
|
|
4
|
-
declare const resolveToken: (input?: ResolveTokenInput) => string;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/capabilities/monitoring.d.ts
|
|
3
|
+
export declare const resolveToken: (input?: ResolveTokenInput) => string;
|
|
7
4
|
interface ChecklyMonitoringOptions {
|
|
8
5
|
checks?: MonitoringCheckInput[];
|
|
9
6
|
}
|
|
10
|
-
declare class ChecklyMonitoring implements Monitoring {
|
|
7
|
+
export declare class ChecklyMonitoring implements Monitoring {
|
|
11
8
|
private readonly client;
|
|
12
9
|
readonly key: "monitoring";
|
|
13
10
|
readonly providerName = "checkly";
|
|
@@ -53,16 +50,12 @@ declare class ChecklyMonitoring implements Monitoring {
|
|
|
53
50
|
/** Checkly's `search` param is a case-insensitive partial match — narrow to the exact name ourselves. */
|
|
54
51
|
private findByExactName;
|
|
55
52
|
}
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/verify-token.d.ts
|
|
58
53
|
interface VerifyTokenOptions {
|
|
59
54
|
baseUrl?: string;
|
|
60
55
|
fetch?: typeof fetch;
|
|
61
56
|
}
|
|
62
|
-
declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
63
|
-
|
|
64
|
-
//#region src/index.d.ts
|
|
65
|
-
interface ChecklyPluginOptions extends ResolveTokenInput {
|
|
57
|
+
export declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
58
|
+
export interface ChecklyPluginOptions extends ResolveTokenInput {
|
|
66
59
|
/** Checkly account id — required on every request, not a secret (same status as Vercel's teamId). */
|
|
67
60
|
accountId: string;
|
|
68
61
|
/** Checks `holocron repo setup` should ensure exist. */
|
|
@@ -72,14 +65,14 @@ interface ChecklyPluginOptions extends ResolveTokenInput {
|
|
|
72
65
|
/** Override `fetch` for tests. */
|
|
73
66
|
fetch?: typeof fetch;
|
|
74
67
|
}
|
|
75
|
-
interface PluginContext {
|
|
68
|
+
export interface PluginContext {
|
|
76
69
|
options: ChecklyPluginOptions;
|
|
77
70
|
/** Memoized client — the token is resolved on first use, not at plugin load. */
|
|
78
71
|
client: () => ChecklyClient;
|
|
79
72
|
}
|
|
80
|
-
declare function createContext(options: ChecklyPluginOptions): PluginContext;
|
|
81
|
-
declare function monitoring(ctx: PluginContext): Monitoring;
|
|
82
|
-
declare function createPlugin(options: ChecklyPluginOptions): {
|
|
73
|
+
export declare function createContext(options: ChecklyPluginOptions): PluginContext;
|
|
74
|
+
export declare function monitoring(ctx: PluginContext): Monitoring;
|
|
75
|
+
export declare function createPlugin(options: ChecklyPluginOptions): {
|
|
83
76
|
name: string;
|
|
84
77
|
probes: {
|
|
85
78
|
connection: import("@theholocron/cli").Probe;
|
|
@@ -92,6 +85,5 @@ declare function createPlugin(options: ChecklyPluginOptions): {
|
|
|
92
85
|
* One-line hint printed by `holocron auth set checkly` when no token
|
|
93
86
|
* is supplied or the supplied token is rejected.
|
|
94
87
|
*/
|
|
95
|
-
declare const AUTH_HINT: string;
|
|
96
|
-
|
|
97
|
-
export { AUTH_HINT, type ApiCheck, type ApiCheckInput, type ApiCheckRequest, type Assertion, type AssertionComparison, type AssertionSource, AuthError, type ChecklyClient, type ChecklyClientOptions, ChecklyMonitoring, ChecklyPluginOptions, type HttpMethod, type ListChecksParams, PluginContext, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createChecklyClient, createContext, createPlugin, monitoring, resolveToken, verifyToken };
|
|
88
|
+
export declare const AUTH_HINT: string;
|
|
89
|
+
export { type ApiCheck, type ApiCheckInput, type ApiCheckRequest, type Assertion, type AssertionComparison, type AssertionSource, AuthError, type ChecklyClient, type ChecklyClientOptions, type HttpMethod, type ListChecksParams, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createChecklyClient };
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { AuthError, ProviderApiError, connectionProbe, createResolveToken, createRestClient } from "@theholocron/cli";
|
|
2
2
|
import { DISCORD_TEMPLATE, createChecklyClient } from "@theholocron/checkly-client";
|
|
3
3
|
import { errorMessage } from "@theholocron/misc-utils";
|
|
4
|
-
|
|
4
|
+
// src/auth.ts
|
|
5
5
|
const resolveToken = createResolveToken({
|
|
6
6
|
envName: "HOLOCRON_CHECKLY_TOKEN",
|
|
7
7
|
vendorEnvName: "CHECKLY_API_KEY",
|
|
8
8
|
keyringService: "checkly",
|
|
9
9
|
errorMessage: "no Checkly token found. Pass --token <TOKEN>, set HOLOCRON_CHECKLY_TOKEN / CHECKLY_API_KEY, or run: holocron auth set checkly <TOKEN>"
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
//#region src/icon.ts
|
|
11
|
+
// src/icon.ts
|
|
13
12
|
/**
|
|
14
13
|
* Checkly's own icon, the one its Slack and Discord alerts carry. The Monitoring capability offers it so the webhook
|
|
15
14
|
* Checkly posts through can wear it without the config naming a picture. The URL is tried first; the image is embedded
|
|
@@ -19,12 +18,10 @@ const CHECKLY_ICON = {
|
|
|
19
18
|
url: "https://s3.eu-central-1.amazonaws.com/cdn.checklyhq.com/slack/checkly-slack-icon.png",
|
|
20
19
|
dataUri: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATAAAAEwCAMAAAAHJd3BAAAA6lBMVEX////f7v+/3f+fy/+Qwv+Auv9wsv9gqf9QoP9Al/8wj/8ghv8Qff8Adf/P5f/v9v+v1P+gy//f7f8Qfv9wsf+Qw/+w0/8wjv9Qof+v0/+Pwv/v9/9/uv+Pw/+/ydOAkqhQaoggQWgAJlIwT3Pv8fRvsf+QoLNgd5JAXH1gd5Ogrb7f5Omvu8kQNF3v8fWfrb7P197P1t5whZ6/ydSwu8l/k6lwhZ2PoLRvhZ6frr6PoLNfeJN/k6hfd5MwT3KAkqnP199fqP/P5P9gqP+vwNQQYL4QPXMASZ0AcPUAOn0AZt4AK10AWL5Qg77qkM9cAAALsUlEQVR4Aezbh4GsIBRG4QUHkfBPdlP/fb5cwLu7Zs5XwpEk47wAAAAAAAAAAAAAwD45533XnULoY4xD+iWXf6omU8s/6bchxhhC6Drvz+7ysgMXd+1CHHKp2oCSU+xPV7/JdO56irloo/LQX/12htW1T1U7kOPtvHos3xftSR1u9/Vqdalqh3K/ykDzQ9Vu5aXH2SUU7Vy8L5mr6v+R7GTJRTKfdByPMHuvp46lzDvI7lmHM845HasO6Dnfaq9jyjNNyyALFrIgUYxeXypGLylPfM141dEN056/ig5v0kN/UQM8C5hNuUw2IWXCkb/IgknZqRVpmvvVombcWPFtCiuY0Y0VzCYzwJbeKL1M2CijGnP55plCrRlZ8hedk4PEnGRGzjcnX9WexB5p8/jOnHxTgzxLmE1gCbNJfNtk8/h6sKQmuS8Hq7LgUuysNj252rF55wM6m8Kbt9GFTdLmzCZpc+PFyGbkVGETOVXYvHOfb5P5qMLmwXWrEccwI0cwmzOfodh8LHHQ56gvE476Tu0KvBnZRN6MCDard37FtUm8e9tkfgKxKVxWEGxWD75EMeI6jGAE2xTH/SHBCEawdi71Cebn/1MDwYpaQDCCEYxg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mDMNbwCXUCskHhxgUNHDUwaLgWdmTTKHEzXDN4SMMcuUTe8OpwS+SNsTlgaIxtAEFjLF9Cg4E5t+3d12lQM/1oSIP7BnN5k0HDTpY3KynldLVpbDU0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ8LX4GOldjeT7Ifd8AAAAASUVORK5CYII="
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
//#region src/same-template.ts
|
|
21
|
+
// src/same-template.ts
|
|
24
22
|
/** Whether two templates are the same message, whatever the whitespace between the lines. */
|
|
25
23
|
const sameTemplate = (a, b) => (a ?? "").replace(/\s+/g, "") === b.replace(/\s+/g, "");
|
|
26
|
-
|
|
27
|
-
//#region src/capabilities/monitoring.ts
|
|
24
|
+
// src/capabilities/monitoring.ts
|
|
28
25
|
/**
|
|
29
26
|
* `monitoring` capability for Checkly.
|
|
30
27
|
*
|
|
@@ -273,8 +270,7 @@ var ChecklyMonitoring = class {
|
|
|
273
270
|
}
|
|
274
271
|
};
|
|
275
272
|
const channelName = (deps) => (deps.env ?? process.env)["HOLOCRON_CHECKLY_PROBE_CHANNEL"] ?? "Message to #uptime";
|
|
276
|
-
|
|
277
|
-
//#region src/probes/find-channel.ts
|
|
273
|
+
// src/probes/find-channel.ts
|
|
278
274
|
/** The Discord webhook alert channel the probes work with, or an error that says how to name another. */
|
|
279
275
|
async function findChannel(client, deps) {
|
|
280
276
|
const name = channelName(deps);
|
|
@@ -282,8 +278,7 @@ async function findChannel(client, deps) {
|
|
|
282
278
|
if (!channel) throw new Error(`no alert channel named "${name}" (run \`holocron notifications setup\`, or set HOLOCRON_CHECKLY_PROBE_CHANNEL)`);
|
|
283
279
|
return channel;
|
|
284
280
|
}
|
|
285
|
-
|
|
286
|
-
//#region src/probes/channel.ts
|
|
281
|
+
// src/probes/channel.ts
|
|
287
282
|
const PAGE = 100;
|
|
288
283
|
async function allCheckIds(client) {
|
|
289
284
|
const ids = [];
|
|
@@ -343,8 +338,7 @@ function channelProbe(deps) {
|
|
|
343
338
|
}
|
|
344
339
|
};
|
|
345
340
|
}
|
|
346
|
-
|
|
347
|
-
//#region src/probes/deliver.ts
|
|
341
|
+
// src/probes/deliver.ts
|
|
348
342
|
const CHECK_NAME = "holocron-delivery-proof (delete me)";
|
|
349
343
|
const TAG = "delivery-proof";
|
|
350
344
|
/** An API check on a URL that always answers 200: asserting 418 makes it fail, asserting 200 makes it pass. */
|
|
@@ -450,16 +444,14 @@ function deliverProbe(deps) {
|
|
|
450
444
|
}
|
|
451
445
|
};
|
|
452
446
|
}
|
|
453
|
-
|
|
454
|
-
//#region src/probes/index.ts
|
|
447
|
+
// src/probes/index.ts
|
|
455
448
|
function checklyProbes(deps) {
|
|
456
449
|
return {
|
|
457
450
|
channel: channelProbe(deps),
|
|
458
451
|
deliver: deliverProbe(deps)
|
|
459
452
|
};
|
|
460
453
|
}
|
|
461
|
-
|
|
462
|
-
//#region src/verify-token.ts
|
|
454
|
+
// src/verify-token.ts
|
|
463
455
|
async function verifyToken(token, opts = {}) {
|
|
464
456
|
const rest = createRestClient({
|
|
465
457
|
baseUrl: opts.baseUrl ?? "https://api.checklyhq.com/v1",
|
|
@@ -479,8 +471,7 @@ async function verifyToken(token, opts = {}) {
|
|
|
479
471
|
};
|
|
480
472
|
}
|
|
481
473
|
}
|
|
482
|
-
|
|
483
|
-
//#region src/index.ts
|
|
474
|
+
// src/index.ts
|
|
484
475
|
function createContext(options) {
|
|
485
476
|
let client;
|
|
486
477
|
return {
|
|
@@ -525,5 +516,4 @@ function createPlugin(options) {
|
|
|
525
516
|
* is supplied or the supplied token is rejected.
|
|
526
517
|
*/
|
|
527
518
|
const AUTH_HINT = "generate a Checkly API key at https://app.checklyhq.com/settings/user/api-keys, then run: holocron auth set checkly <KEY>";
|
|
528
|
-
//#endregion
|
|
529
519
|
export { AUTH_HINT, AuthError, ChecklyMonitoring, createChecklyClient, createContext, createPlugin, monitoring, resolveToken, verifyToken };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-checkly",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.248",
|
|
4
4
|
"description": "Holocron plugin for Checkly. Implements the monitoring capability against Checkly's REST API, plus exports verifyToken + AUTH_HINT for `holocron auth`.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"checkly",
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
"@theholocron/misc-utils": "^1.16.0",
|
|
36
36
|
"@theholocron/tsconfig": "^8.8.2",
|
|
37
37
|
"@types/node": "^26",
|
|
38
|
-
"@vitest/coverage-v8": "^
|
|
38
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
39
39
|
"eslint": "^10.8.1",
|
|
40
40
|
"globals": "^17.11.0",
|
|
41
|
-
"tsdown": "^0.
|
|
41
|
+
"tsdown": "^0.23.3",
|
|
42
42
|
"tsx": "4.23.15",
|
|
43
43
|
"typescript": "^5.9.3",
|
|
44
|
-
"vitest": "^
|
|
45
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
44
|
+
"vitest": "^5.0.5",
|
|
45
|
+
"@theholocron/cli": "5.0.0-alpha.248"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@theholocron/checkly-client": "^1.55.0",
|
|
49
49
|
"@theholocron/misc-utils": "^1.16.0",
|
|
50
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
50
|
+
"@theholocron/cli": "5.0.0-alpha.248"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22"
|