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.
Implements
Section titled “Implements”Workers
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudflareWorkers(
client,accountId):CloudflareWorkers
Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:21
Parameters
Section titled “Parameters”client
Section titled “client”() => Pick<CloudflareClient, "workers" | "zones">
accountId
Section titled “accountId”string
Returns
Section titled “Returns”CloudflareWorkers
Properties
Section titled “Properties”
readonlykey:"workers"
Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:15
The capability this class provides, always "workers".
Implementation of
Section titled “Implementation of”Workers.key
providerName
Section titled “providerName”
readonlyproviderName:"cloudflare"="cloudflare"
Defined in: plugins/holocron-plugin-cloudflare/src/capabilities/workers.ts:17
The provider name, "cloudflare".
Implementation of
Section titled “Implementation of”Workers.providerName
Methods
Section titled “Methods”deployScript()
Section titled “deployScript()”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.
Parameters
Section titled “Parameters”string
config
Section titled “config”DeployScriptConfig
Returns
Section titled “Returns”Promise<DeployScriptResult>
Implementation of
Section titled “Implementation of”Workers.deployScript
inspectScript()
Section titled “inspectScript()”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.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<WorkerScriptState>
Implementation of
Section titled “Implementation of”Workers.inspectScript
latestDeployment()
Section titled “latestDeployment()”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.
Parameters
Section titled “Parameters”script
Section titled “script”string
Returns
Section titled “Returns”Promise<WorkerDeploymentState | null>
Implementation of
Section titled “Implementation of”Workers.latestDeployment
proxyScriptName()
Section titled “proxyScriptName()”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.
Parameters
Section titled “Parameters”hostname
Section titled “hostname”string
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”Workers.proxyScriptName
secretNames()
Section titled “secretNames()”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.
Parameters
Section titled “Parameters”script
Section titled “script”string
Returns
Section titled “Returns”Promise<string[]>
Implementation of
Section titled “Implementation of”Workers.secretNames
setSecret()
Section titled “setSecret()”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.
Parameters
Section titled “Parameters”script
Section titled “script”string
string
string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Workers.setSecret
upsertProxy()
Section titled “upsertProxy()”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.
Parameters
Section titled “Parameters”hostname
Section titled “hostname”string
config
Section titled “config”WikiProxyConfig
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Workers.upsertProxy
whoami()
Section titled “whoami()”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.
Returns
Section titled “Returns”Promise<{ ok: boolean; scripts: number; }>
Implementation of
Section titled “Implementation of”Workers.whoami