Skip to content

CloudflareWorkers

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:13

The Cloudflare implementation of the workers capability, backed by Workers scripts and routes in one account.

  • Workers

new CloudflareWorkers(client, accountId): CloudflareWorkers

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:21

() => Pick<CloudflareClient, "workers" | "zones">

string

CloudflareWorkers

readonly key: "workers"

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:15

The capability this class provides, always "workers".

Workers.key


readonly providerName: "cloudflare" = "cloudflare"

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:17

The provider name, "cloudflare".

Workers.providerName

deployScript(name, config): Promise<DeployScriptResult>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:39

Deploy (or update) an arbitrary Worker script, optionally with secrets and routes.

string

DeployScriptConfig

Promise<DeployScriptResult>

Workers.deployScript


inspectScript(name, host): Promise<WorkerScriptState>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:65

Whether the script exists, which routes in the zone of host point at it, and the names of its secrets. Reads only, and asks Cloudflare for names, so no value is ever fetched.

string

string

Promise<WorkerScriptState>

Workers.inspectScript


latestDeployment(script): Promise<WorkerDeploymentState | null>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:80

The newest deployment of the script, and whether it serves all traffic. Reads only.

string

Promise<WorkerDeploymentState | null>

Workers.latestDeployment


proxyScriptName(hostname): string

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:91

The name upsertProxy gives the reverse-proxy Worker it deploys for hostname, so a check can find it without knowing how the provider names it. Optional — a provider that deploys no proxy omits it.

string

string

Workers.proxyScriptName


secretNames(script): Promise<string[]>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:57

The names (never the values) of the secrets bound to a deployed script. holocron probe uses it to see what a Worker has.

string

Promise<string[]>

Workers.secretNames


setSecret(script, name, value): Promise<void>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:53

Set one secret binding on a script that is already deployed, leaving its code and every other binding alone. The value is write-only. holocron sync secrets --worker uses it to fan a vault out to a Worker.

string

string

string

Promise<void>

Workers.setSecret


upsertProxy(hostname, config): Promise<void>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:26

Deploy (or update) a reverse-proxy Worker for hostname. Forwards all hostname/* requests to config.target, injecting config.headers on each request.

string

WikiProxyConfig

Promise<void>

Workers.upsertProxy


whoami(): Promise<{ ok: boolean; scripts: number; }>

Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:34

holocron doctor has no specific script to check — lists every script the token can see instead.

Promise<{ ok: boolean; scripts: number; }>

Workers.whoami