Skip to content

Cloudflare

Cloudflare for Sanoma: a Container host that stops when its worker is idle, a Durable Object alarm that wakes it, from one Worker, and a zone's DNS records.

Package @sanoma-ai/connector-cloudflare, version 0.11.24. Its README, with how to install and connect it, is on GitHub.

Resource types, which a data file under resources/ declares: cloudflare.host, cloudflare.container, cloudflare.alarm, cloudflare.records.

host

import

cloudflare.host.importreadsafe to retry

Find a host by its name or its binding id and read it; gone when there is none

Input

  • idstringrequired

    at least 1 character

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestring | null

      The company's name: the Worker and its application are sanoma-<name>; by default the repository's name

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestring | null

      The runtime image, an override: by default ghcr.io/sanoma-ai/runtime:<version> of the installed sanoma

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestring | null

      The company repository, an override: by default the one the app runs from (its origin, or the GitHub repository its data file declares)

      at least 1 character

    • refstring | null

      The branch it runs, an override: by default the repository's default branch

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      What apply gives the host, never declared: its database's URL, its keys and the credentials it deploys with, each a secret(...) naming a stored value

    • portinteger | null

      The port the runtime listens on, the image's own (3000): never declared

      at least 1, at most 65535

    • domainsrecord of string | null

      Each public site's domain, by site name, never declared: from defineSite({ public: true, domain })

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

    • databasestring | null

      The declared database it runs on, such as store: apply gives the host its URL

      at least 1 character

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

read

cloudflare.host.readreadsafe to retry

Read a host as it is now; gone when it no longer exists

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestring | null

      The company's name: the Worker and its application are sanoma-<name>; by default the repository's name

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestring | null

      The runtime image, an override: by default ghcr.io/sanoma-ai/runtime:<version> of the installed sanoma

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestring | null

      The company repository, an override: by default the one the app runs from (its origin, or the GitHub repository its data file declares)

      at least 1 character

    • refstring | null

      The branch it runs, an override: by default the repository's default branch

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      What apply gives the host, never declared: its database's URL, its keys and the credentials it deploys with, each a secret(...) naming a stored value

    • portinteger | null

      The port the runtime listens on, the image's own (3000): never declared

      at least 1, at most 65535

    • domainsrecord of string | null

      Each public site's domain, by site name, never declared: from defineSite({ public: true, domain })

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

    • databasestring | null

      The declared database it runs on, such as store: apply gives the host its URL

      at least 1 character

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

plan

cloudflare.host.planreadsafe to retry

Plan how apply would make a host match its declaration (or delete it, given none); nothing changes

Input

  • idstring

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of any

    The declared fields; a write-only one may hold a secret marker

Output

  • action"none" | "create" | "update" | "replace" | "delete"required
  • plannedrecord of any
  • unknownstring[]required
  • replacestring[]required

    The fields whose change replaces the object: not empty exactly when replace

create

cloudflare.host.createwrite

Create a host as declared

Input

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestring | null

      The company's name: the Worker and its application are sanoma-<name>; by default the repository's name

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestring | null

      The runtime image, an override: by default ghcr.io/sanoma-ai/runtime:<version> of the installed sanoma

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestring | null

      The company repository, an override: by default the one the app runs from (its origin, or the GitHub repository its data file declares)

      at least 1 character

    • refstring | null

      The branch it runs, an override: by default the repository's default branch

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      What apply gives the host, never declared: its database's URL, its keys and the credentials it deploys with, each a secret(...) naming a stored value

    • portinteger | null

      The port the runtime listens on, the image's own (3000): never declared

      at least 1, at most 65535

    • domainsrecord of string | null

      Each public site's domain, by site name, never declared: from defineSite({ public: true, domain })

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

    • databasestring | null

      The declared database it runs on, such as store: apply gives the host its URL

      at least 1 character

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

update

cloudflare.host.updatewrite

Change a host to match its declaration, replacing it where a field cannot change in place

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

  • expectobject
    Fields
    • action"none" | "create" | "update" | "replace" | "delete"required
    • replacestring[]required

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestring | null

      The company's name: the Worker and its application are sanoma-<name>; by default the repository's name

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestring | null

      The runtime image, an override: by default ghcr.io/sanoma-ai/runtime:<version> of the installed sanoma

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestring | null

      The company repository, an override: by default the one the app runs from (its origin, or the GitHub repository its data file declares)

      at least 1 character

    • refstring | null

      The branch it runs, an override: by default the repository's default branch

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      What apply gives the host, never declared: its database's URL, its keys and the credentials it deploys with, each a secret(...) naming a stored value

    • portinteger | null

      The port the runtime listens on, the image's own (3000): never declared

      at least 1, at most 65535

    • domainsrecord of string | null

      Each public site's domain, by site name, never declared: from defineSite({ public: true, domain })

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

    • databasestring | null

      The declared database it runs on, such as store: apply gives the host its URL

      at least 1 character

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

delete

cloudflare.host.deletewritesafe to retry

Delete a host; done already when it is gone

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonetruerequired

container

import

cloudflare.container.importreadsafe to retry

Find a container (deprecated: cloudflare.host) by its name or its binding id and read it; gone when there is none

Input

  • idstringrequired

    at least 1 character

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestringrequired

      The company's name: its Worker is sanoma-<name>, its URL https://sanoma-<name>.<account>.workers.dev

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestringrequired

      The Sanoma runtime image, pinned to a tag or a digest: ghcr.io/sanoma-ai/runtime:<version>, which apply copies into the account's registry

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestringrequired

      The company repository's clone URL, or a declared GitHub repository

      at least 1 character

    • refstringrequired

      The branch it runs, such as main, never a commit

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      Environment variables holding secrets, each a secret(...): SANOMA_DATABASE_URL, SANOMA_SECRETS_KEY, SANOMA_WAKEUP_TOKEN

    • portintegerrequired

      The port the runtime listens on in the container (its PORT)

      at least 1, at most 65535

    • domainsrecord of string | null

      A public site's domain, by site name

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

read

cloudflare.container.readreadsafe to retry

Read a container (deprecated: cloudflare.host) as it is now; gone when it no longer exists

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestringrequired

      The company's name: its Worker is sanoma-<name>, its URL https://sanoma-<name>.<account>.workers.dev

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestringrequired

      The Sanoma runtime image, pinned to a tag or a digest: ghcr.io/sanoma-ai/runtime:<version>, which apply copies into the account's registry

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestringrequired

      The company repository's clone URL, or a declared GitHub repository

      at least 1 character

    • refstringrequired

      The branch it runs, such as main, never a commit

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      Environment variables holding secrets, each a secret(...): SANOMA_DATABASE_URL, SANOMA_SECRETS_KEY, SANOMA_WAKEUP_TOKEN

    • portintegerrequired

      The port the runtime listens on in the container (its PORT)

      at least 1, at most 65535

    • domainsrecord of string | null

      A public site's domain, by site name

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

plan

cloudflare.container.planreadsafe to retry

Plan how apply would make a container (deprecated: cloudflare.host) match its declaration (or delete it, given none); nothing changes

Input

  • idstring

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of any

    The declared fields; a write-only one may hold a secret marker

Output

  • action"none" | "create" | "update" | "replace" | "delete"required
  • plannedrecord of any
  • unknownstring[]required
  • replacestring[]required

    The fields whose change replaces the object: not empty exactly when replace

create

cloudflare.container.createwrite

Create a container (deprecated: cloudflare.host) as declared

Input

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestringrequired

      The company's name: its Worker is sanoma-<name>, its URL https://sanoma-<name>.<account>.workers.dev

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestringrequired

      The Sanoma runtime image, pinned to a tag or a digest: ghcr.io/sanoma-ai/runtime:<version>, which apply copies into the account's registry

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestringrequired

      The company repository's clone URL, or a declared GitHub repository

      at least 1 character

    • refstringrequired

      The branch it runs, such as main, never a commit

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      Environment variables holding secrets, each a secret(...): SANOMA_DATABASE_URL, SANOMA_SECRETS_KEY, SANOMA_WAKEUP_TOKEN

    • portintegerrequired

      The port the runtime listens on in the container (its PORT)

      at least 1, at most 65535

    • domainsrecord of string | null

      A public site's domain, by site name

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

update

cloudflare.container.updatewrite

Change a container (deprecated: cloudflare.host) to match its declaration, replacing it where a field cannot change in place

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

  • expectobject
    Fields
    • action"none" | "create" | "update" | "replace" | "delete"required
    • replacestring[]required

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • idstring | null

      The container application's id, which Cloudflare sets

    • namestringrequired

      The company's name: its Worker is sanoma-<name>, its URL https://sanoma-<name>.<account>.workers.dev

      matches ^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$

    • imagestringrequired

      The Sanoma runtime image, pinned to a tag or a digest: ghcr.io/sanoma-ai/runtime:<version>, which apply copies into the account's registry

      matches ^[^\s@]+(:[\w][\w.-]{0,127}|@sha256:[0-9a-f]{64})$

    • sourcestringrequired

      The company repository's clone URL, or a declared GitHub repository

      at least 1 character

    • refstringrequired

      The branch it runs, such as main, never a commit

      at least 1 character

    • revisionstring | null

      The commit it runs, which apply sets from ref

    • configurationRevisionstring | null

      Non-secret deployment configuration revision: advance it to roll out rotated bootstrap values at the same source revision

      matches ^[A-Za-z0-9._-]{1,63}$

    • secretsrecord of string | null

      Environment variables holding secrets, each a secret(...): SANOMA_DATABASE_URL, SANOMA_SECRETS_KEY, SANOMA_WAKEUP_TOKEN

    • portintegerrequired

      The port the runtime listens on in the container (its PORT)

      at least 1, at most 65535

    • domainsrecord of string | null

      A public site's domain, by site name

      each value: matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • hostnamestring | null

      The hostname the app is served at, such as internal.acme.example: attached to the Worker as a custom domain, and its url

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • urlstring | null

      Where the app answers: https://<hostname> once attached, or the Worker's URL on workers.dev

    • worker_urlstring | null

      The Worker's URL on workers.dev, which Cloudflare sets: where its alarm and health checks reach it

    • healthyboolean | null

      Whether the application exists and the Worker answers /__sanoma/health, which starts the container

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

delete

cloudflare.container.deletewritesafe to retry

Delete a container (deprecated: cloudflare.host); done already when it is gone

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonetruerequired

alarm

import

cloudflare.alarm.importreadsafe to retry

Find a alarm by its binding id and read it; gone when there is none

Input

  • idstringrequired

    at least 1 character

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • hoststringrequired

      The host's URL, whose Worker holds the alarm: a data file names the host's declaration

      at least 1 character

    • atstring | null

      When the instance asked to be woken last, null until it has

    • rangstring | null

      When the alarm last rang the host's /wake for that registration, null until it has

    • healthyboolean | null

      Whether the host's Worker answers its wake route with this company's token

    • tokenstring | null

      The secret that holds the host's wakeup token, a secret("NAME"): the one the host's secrets give as SANOMA_WAKEUP_TOKEN, by default SANOMA_WAKEUP_TOKEN itself. A state gives its name when it is another

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

read

cloudflare.alarm.readreadsafe to retry

Read a alarm as it is now; gone when it no longer exists

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • hoststringrequired

      The host's URL, whose Worker holds the alarm: a data file names the host's declaration

      at least 1 character

    • atstring | null

      When the instance asked to be woken last, null until it has

    • rangstring | null

      When the alarm last rang the host's /wake for that registration, null until it has

    • healthyboolean | null

      Whether the host's Worker answers its wake route with this company's token

    • tokenstring | null

      The secret that holds the host's wakeup token, a secret("NAME"): the one the host's secrets give as SANOMA_WAKEUP_TOKEN, by default SANOMA_WAKEUP_TOKEN itself. A state gives its name when it is another

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

plan

cloudflare.alarm.planreadsafe to retry

Plan how apply would make a alarm match its declaration (or delete it, given none); nothing changes

Input

  • idstring

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of any

    The declared fields; a write-only one may hold a secret marker

Output

  • action"none" | "create" | "update" | "replace" | "delete"required
  • plannedrecord of any
  • unknownstring[]required
  • replacestring[]required

    The fields whose change replaces the object: not empty exactly when replace

create

cloudflare.alarm.createwrite

Create a alarm as declared

Input

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • hoststringrequired

      The host's URL, whose Worker holds the alarm: a data file names the host's declaration

      at least 1 character

    • atstring | null

      When the instance asked to be woken last, null until it has

    • rangstring | null

      When the alarm last rang the host's /wake for that registration, null until it has

    • healthyboolean | null

      Whether the host's Worker answers its wake route with this company's token

    • tokenstring | null

      The secret that holds the host's wakeup token, a secret("NAME"): the one the host's secrets give as SANOMA_WAKEUP_TOKEN, by default SANOMA_WAKEUP_TOKEN itself. A state gives its name when it is another

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

update

cloudflare.alarm.updatewrite

Change a alarm to match its declaration, replacing it where a field cannot change in place

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

  • expectobject
    Fields
    • action"none" | "create" | "update" | "replace" | "delete"required
    • replacestring[]required

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • hoststringrequired

      The host's URL, whose Worker holds the alarm: a data file names the host's declaration

      at least 1 character

    • atstring | null

      When the instance asked to be woken last, null until it has

    • rangstring | null

      When the alarm last rang the host's /wake for that registration, null until it has

    • healthyboolean | null

      Whether the host's Worker answers its wake route with this company's token

    • tokenstring | null

      The secret that holds the host's wakeup token, a secret("NAME"): the one the host's secrets give as SANOMA_WAKEUP_TOKEN, by default SANOMA_WAKEUP_TOKEN itself. A state gives its name when it is another

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

delete

cloudflare.alarm.deletewritesafe to retry

Delete a alarm; done already when it is gone

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonetruerequired

register

cloudflare.alarm.registerwritesafe to retry

Set the host's alarm to wake it at at, replacing the wake registered before

Input

  • atstringrequired

    When to wake the host, ISO 8601

    format date-time, matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

Output

object, with no fields.

records

import

cloudflare.records.importreadsafe to retry

Find a dns records by its zone/name or its binding id and read it; gone when there is none

Input

  • idstringrequired

    at least 1 character

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • zonestringrequired

      The zone's name, as the account holds it: example.com

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • namestringrequired

      The set's label, such as resend: its identity is <zone>/<name>, and each record it writes carries the comment sanoma:<zone>/<name>

      matches ^[a-z0-9](?:[a-z0-9_-]{0,61}[a-z0-9])?$

    • recordsobject[]required

      The records, compared as a set: a list, or a declared resend.domain, whose dns_records they are then

      at least 1 item

      Each item
      • type"TXT" | "MX" | "CNAME" | "CAA"required
      • namestringrequired
      • contentstringrequired
      • priorityinteger
      • ttlinteger
    • zone_idstring | null

      The zone's id, which Cloudflare sets

    • record_idsstring[] | null

      Each record's id, which Cloudflare sets, in the order of records as a read gives them

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

read

cloudflare.records.readreadsafe to retry

Read a dns records as it is now; gone when it no longer exists

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonebooleanrequired
  • stateobject
    Fields
    • zonestringrequired

      The zone's name, as the account holds it: example.com

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • namestringrequired

      The set's label, such as resend: its identity is <zone>/<name>, and each record it writes carries the comment sanoma:<zone>/<name>

      matches ^[a-z0-9](?:[a-z0-9_-]{0,61}[a-z0-9])?$

    • recordsobject[]required

      The records, compared as a set: a list, or a declared resend.domain, whose dns_records they are then

      at least 1 item

      Each item
      • type"TXT" | "MX" | "CNAME" | "CAA"required
      • namestringrequired
      • contentstringrequired
      • priorityinteger
      • ttlinteger
    • zone_idstring | null

      The zone's id, which Cloudflare sets

    • record_idsstring[] | null

      Each record's id, which Cloudflare sets, in the order of records as a read gives them

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

plan

cloudflare.records.planreadsafe to retry

Plan how apply would make a dns records match its declaration (or delete it, given none); nothing changes

Input

  • idstring

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of any

    The declared fields; a write-only one may hold a secret marker

Output

  • action"none" | "create" | "update" | "replace" | "delete"required
  • plannedrecord of any
  • unknownstring[]required
  • replacestring[]required

    The fields whose change replaces the object: not empty exactly when replace

create

cloudflare.records.createwrite

Create a dns records as declared

Input

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • zonestringrequired

      The zone's name, as the account holds it: example.com

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • namestringrequired

      The set's label, such as resend: its identity is <zone>/<name>, and each record it writes carries the comment sanoma:<zone>/<name>

      matches ^[a-z0-9](?:[a-z0-9_-]{0,61}[a-z0-9])?$

    • recordsobject[]required

      The records, compared as a set: a list, or a declared resend.domain, whose dns_records they are then

      at least 1 item

      Each item
      • type"TXT" | "MX" | "CNAME" | "CAA"required
      • namestringrequired
      • contentstringrequired
      • priorityinteger
      • ttlinteger
    • zone_idstring | null

      The zone's id, which Cloudflare sets

    • record_idsstring[] | null

      Each record's id, which Cloudflare sets, in the order of records as a read gives them

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

update

cloudflare.records.updatewrite

Change a dns records to match its declaration, replacing it where a field cannot change in place

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

  • desiredrecord of anyrequired

    The declared fields; a write-only one may hold a secret marker

  • expectobject
    Fields
    • action"none" | "create" | "update" | "replace" | "delete"required
    • replacestring[]required

Output

  • idstringrequired

    at least 1 character

  • stateobjectrequired
    Fields
    • zonestringrequired

      The zone's name, as the account holds it: example.com

      matches ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$

    • namestringrequired

      The set's label, such as resend: its identity is <zone>/<name>, and each record it writes carries the comment sanoma:<zone>/<name>

      matches ^[a-z0-9](?:[a-z0-9_-]{0,61}[a-z0-9])?$

    • recordsobject[]required

      The records, compared as a set: a list, or a declared resend.domain, whose dns_records they are then

      at least 1 item

      Each item
      • type"TXT" | "MX" | "CNAME" | "CAA"required
      • namestringrequired
      • contentstringrequired
      • priorityinteger
      • ttlinteger
    • zone_idstring | null

      The zone's id, which Cloudflare sets

    • record_idsstring[] | null

      Each record's id, which Cloudflare sets, in the order of records as a read gives them

  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

delete

cloudflare.records.deletewritesafe to retry

Delete a dns records; done already when it is gone

Input

  • idstringrequired

    at least 1 character

  • staterecord of any
  • handlestring

    The driver's data for the object, opaque: pass it back unchanged

Output

  • idstringrequired

    at least 1 character

  • gonetruerequired

These pages describe sanoma 0.11.24.