@theholocron/holocron-plugin-cloudflare 5.0.0-alpha.230 → 5.0.0-alpha.232

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
@@ -73,6 +73,7 @@ declare class CloudflareWorkers implements Workers {
73
73
  }>;
74
74
  deployScript(name: string, config: DeployScriptConfig): Promise<DeployScriptResult>;
75
75
  setSecret(script: string, name: string, value: string): Promise<void>;
76
+ secretNames(script: string): Promise<string[]>;
76
77
  /** Idempotent create-or-update for one route pattern — shared by both public methods. */
77
78
  private upsertRoute;
78
79
  private resolveZone;
@@ -109,6 +110,9 @@ declare function deployment(ctx: PluginContext): Deployment;
109
110
  declare function workersCapability(ctx: PluginContext): Workers;
110
111
  declare function createPlugin(options?: CloudflarePluginOptions): {
111
112
  name: string;
113
+ probes: {
114
+ connection: import("@theholocron/cli").Probe;
115
+ };
112
116
  capabilities: {
113
117
  deployment?: (() => Deployment) | undefined;
114
118
  workers?: (() => Workers) | undefined;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthError, ProviderApiError, createResolveToken } from "@theholocron/cli";
1
+ import { AuthError, ProviderApiError, connectionProbe, createResolveToken } from "@theholocron/cli";
2
2
  import { createCloudflareClient } from "@theholocron/cloudflare-client";
3
3
  import { errorMessage } from "@theholocron/misc-utils";
4
4
  //#region src/auth.ts
@@ -227,6 +227,9 @@ var CloudflareWorkers = class {
227
227
  async setSecret(script, name, value) {
228
228
  await this.client().workers.putSecret(this.accountId, script, name, value);
229
229
  }
230
+ async secretNames(script) {
231
+ return (await this.client().workers.listSecrets(this.accountId, script)).map((secret) => secret.name);
232
+ }
230
233
  /** Idempotent create-or-update for one route pattern — shared by both public methods. */
231
234
  async upsertRoute(pattern, scriptName) {
232
235
  const hostname = pattern.split("/")[0];
@@ -337,6 +340,16 @@ function createPlugin(options = {}) {
337
340
  const ctx = createContext(options);
338
341
  return {
339
342
  name: "@theholocron/holocron-plugin-cloudflare",
343
+ probes: { connection: connectionProbe({
344
+ provider: "Cloudflare",
345
+ url: options.baseUrl ?? "https://api.cloudflare.com",
346
+ fetch: options.fetch,
347
+ token: () => resolveToken(options),
348
+ verify: (token) => verifyToken(token, {
349
+ baseUrl: options.baseUrl,
350
+ fetch: options.fetch
351
+ })
352
+ }) },
340
353
  capabilities: {
341
354
  dns: () => dns(ctx),
342
355
  ...ctx.options.accountId ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-cloudflare",
3
- "version": "5.0.0-alpha.230",
3
+ "version": "5.0.0-alpha.232",
4
4
  "description": "Holocron plugin for Cloudflare. Implements the dns capability against Cloudflare's REST API — zone resolution, DNS record management.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -48,12 +48,12 @@
48
48
  "tsx": "4.23.15",
49
49
  "typescript": "^5.9.3",
50
50
  "vitest": "^4.1.11",
51
- "@theholocron/cli": "5.0.0-alpha.230"
51
+ "@theholocron/cli": "5.0.0-alpha.232"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@theholocron/cloudflare-client": "^1.53.1",
55
55
  "@theholocron/misc-utils": "^1.16.0",
56
- "@theholocron/cli": "5.0.0-alpha.230"
56
+ "@theholocron/cli": "5.0.0-alpha.232"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@theholocron/cloudflare-client": {}