@theholocron/holocron-plugin-checkly 5.0.0-alpha.278 → 5.0.0-alpha.279

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 CHANGED
@@ -1,14 +1,18 @@
1
1
  import { AuthError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringCheck, MonitoringCheckInput, PluginToken, 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
+ /** Resolves the Checkly API key from `--token`, `HOLOCRON_CHECKLY_TOKEN`, `CHECKLY_API_KEY` or the keyring, and throws an `AuthError` when none is set. */
3
4
  export declare const resolveToken: import("@theholocron/cli").TokenResolver;
4
5
  /** Every token this plugin takes, for `holocron doctor tokens`. */
5
6
  export declare const tokens: PluginToken[];
6
7
  interface ChecklyMonitoringOptions {
7
8
  checks?: MonitoringCheckInput[];
8
9
  }
10
+ /** The Checkly implementation of the `monitoring` capability: ensures the configured API checks and alert channels exist. */
9
11
  export declare class ChecklyMonitoring implements Monitoring {
10
12
  private readonly client;
13
+ /** The capability this class provides, always `"monitoring"`. */
11
14
  readonly key: "monitoring";
15
+ /** The provider name, `"checkly"`. */
12
16
  readonly providerName = "checkly";
13
17
  readonly icon: {
14
18
  readonly url: "https://s3.eu-central-1.amazonaws.com/cdn.checklyhq.com/slack/checkly-slack-icon.png";
@@ -65,7 +69,9 @@ interface VerifyTokenOptions {
65
69
  baseUrl?: string;
66
70
  fetch?: typeof fetch;
67
71
  }
72
+ /** Checks a Checkly API key by listing the accounts it can see; resolves to the account names and ids, or the failure message. */
68
73
  export declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
74
+ /** Options for the Checkly plugin, including how its API key is resolved. */
69
75
  export interface ChecklyPluginOptions extends ResolveTokenInput {
70
76
  /** Checkly account id — required on every request, not a secret (same status as Vercel's teamId). */
71
77
  accountId: string;
@@ -76,13 +82,18 @@ export interface ChecklyPluginOptions extends ResolveTokenInput {
76
82
  /** Override `fetch` for tests. */
77
83
  fetch?: typeof fetch;
78
84
  }
85
+ /** The shared state the Checkly plugin's capabilities and probes are built from. */
79
86
  export interface PluginContext {
87
+ /** The options the plugin was created with. */
80
88
  options: ChecklyPluginOptions;
81
89
  /** Memoized client — the token is resolved on first use, not at plugin load. */
82
90
  client: () => ChecklyClient;
83
91
  }
92
+ /** Builds the plugin context from its options; the API key is resolved lazily on the first client use. */
84
93
  export declare function createContext(options: ChecklyPluginOptions): PluginContext;
94
+ /** Builds the `monitoring` capability for a context, passing it the configured checks. */
85
95
  export declare function monitoring(ctx: PluginContext): Monitoring;
96
+ /** Creates the Checkly plugin: its `monitoring` capability and its `connection` and Checkly probes. */
86
97
  export declare function createPlugin(options: ChecklyPluginOptions): {
87
98
  name: string;
88
99
  probes: {
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { AuthError, ProviderApiError, connectionProbe, createResolveToken, creat
2
2
  import { DISCORD_TEMPLATE, createChecklyClient } from "@theholocron/checkly-client";
3
3
  import { errorMessage } from "@theholocron/misc-utils";
4
4
  // src/auth.ts
5
+ /** Resolves the Checkly API key from `--token`, `HOLOCRON_CHECKLY_TOKEN`, `CHECKLY_API_KEY` or the keyring, and throws an `AuthError` when none is set. */
5
6
  const resolveToken = createResolveToken({
6
7
  envName: "HOLOCRON_CHECKLY_TOKEN",
7
8
  vendorEnvName: "CHECKLY_API_KEY",
@@ -17,7 +18,9 @@ const tokens = [resolveToken.token];
17
18
  * (a 304x304 PNG, about 3 KB) so setup still works when Checkly's CDN cannot be reached.
18
19
  */
19
20
  const CHECKLY_ICON = {
21
+ /** The URL of Checkly's icon, tried first. */
20
22
  url: "https://s3.eu-central-1.amazonaws.com/cdn.checklyhq.com/slack/checkly-slack-icon.png",
23
+ /** The icon embedded as a base64 PNG data URI, used when the URL cannot be reached. */
21
24
  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+PFyGbkVGETOVXYvHOfb5P5qMLmwXWrEccwI0cwmzOfodh8LHHQ56gvE476Tu0KvBnZRN6MCDard37FtUm8e9tkfgKxKVxWEG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8zg6MjutCnTh5N1ZlfmSiyXU631HaO22RgzCcEV6Lzmx6cKP2mDMNbwCXUCskHhxgUNHDUwaLgWdmTTKHEzXDN4SMMcuUTe8OpwS+SNsTlgaIxtAEFjLF9Cg4E5t+3d12lQM/1oSIP7BnN5k0HDTpY3KynldLVpbDU0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ8LX4GOldjeT7Ifd8AAAAASUVORK5CYII="
22
25
  };
23
26
  // src/same-template.ts
@@ -102,9 +105,12 @@ function toChecklyPayload(input) {
102
105
  }
103
106
  };
104
107
  }
108
+ /** The Checkly implementation of the `monitoring` capability: ensures the configured API checks and alert channels exist. */
105
109
  var ChecklyMonitoring = class {
106
110
  client;
111
+ /** The capability this class provides, always `"monitoring"`. */
107
112
  key = "monitoring";
113
+ /** The provider name, `"checkly"`. */
108
114
  providerName = "checkly";
109
115
  icon = CHECKLY_ICON;
110
116
  checks;
@@ -531,6 +537,7 @@ function checklyProbes(deps) {
531
537
  };
532
538
  }
533
539
  // src/verify-token.ts
540
+ /** Checks a Checkly API key by listing the accounts it can see; resolves to the account names and ids, or the failure message. */
534
541
  async function verifyToken(token, opts = {}) {
535
542
  const rest = createRestClient({
536
543
  baseUrl: opts.baseUrl ?? "https://api.checklyhq.com/v1",
@@ -551,6 +558,7 @@ async function verifyToken(token, opts = {}) {
551
558
  }
552
559
  }
553
560
  // src/index.ts
561
+ /** Builds the plugin context from its options; the API key is resolved lazily on the first client use. */
554
562
  function createContext(options) {
555
563
  let client;
556
564
  return {
@@ -567,9 +575,11 @@ function createContext(options) {
567
575
  }
568
576
  };
569
577
  }
578
+ /** Builds the `monitoring` capability for a context, passing it the configured checks. */
570
579
  function monitoring(ctx) {
571
580
  return new ChecklyMonitoring(ctx.client, { checks: ctx.options.checks });
572
581
  }
582
+ /** Creates the Checkly plugin: its `monitoring` capability and its `connection` and Checkly probes. */
573
583
  function createPlugin(options) {
574
584
  const ctx = createContext(options);
575
585
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-checkly",
3
- "version": "5.0.0-alpha.278",
3
+ "version": "5.0.0-alpha.279",
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",
@@ -38,16 +38,16 @@
38
38
  "tsx": "4.23.15",
39
39
  "typescript": "^5.9.3",
40
40
  "vitest": "^5.0.5",
41
+ "@theholocron/checkly-client": "^1.58.0-alpha.3",
42
+ "@theholocron/cli": "5.0.0-alpha.279",
41
43
  "@theholocron/http-client": "^1.58.0-alpha.3",
42
- "@theholocron/misc-utils": "^1.16.1-alpha.3",
43
44
  "@theholocron/tsconfig": "^8.9.0-alpha.4",
44
- "@theholocron/checkly-client": "^1.58.0-alpha.3",
45
- "@theholocron/cli": "5.0.0-alpha.278"
45
+ "@theholocron/misc-utils": "^1.16.1-alpha.3"
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.278"
50
+ "@theholocron/cli": "5.0.0-alpha.279"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=22"