API reference
cloudflare
Import
Section titled “Import”import * as api from "@fungi.computer/carrier/cloudflare";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | CloudflareCarrierStorage | Native SQLite and alarms; the Cloudflare adapter owns their atomic composition. |
| type alias | CloudflareCarrierOptions | Native storage/wake composition with exactly one provider capability. |
| type alias | CloudflareCarrier | Ordinary submission operations and the native Durable Object alarm door. |
| function | createCloudflareCarrier() | Construct one owner per Durable Object. Forward its native alarm to alarm.
Acceptance commits the Email, recipient Messages, Watchdog job and wake
together. |
| function | cloudflareEmailTransport() | The native binding as a Carrier transport. Exported so a host that holds the binding elsewhere (the Hub’s Cloudflare edge) classifies sends identically. |
CloudflareCarrierStoragetype alias
Section titled “CloudflareCarrierStorage”type CloudflareCarrierStorage = WatchdogSqliteOwner & Pick< DurableObjectStorage, "transaction" | "getAlarm" | "setAlarm" | "deleteAlarm" >;Native SQLite and alarms; the Cloudflare adapter owns their atomic composition.
CloudflareCarrierOptionstype alias
Section titled “CloudflareCarrierOptions”type CloudflareCarrierOptions = Readonly<{ storage: CloudflareCarrierStorage; canSend?: (emailId) => Promise<boolean>;}> & | Readonly<{ email: SendEmail; transport?: never;}> | Readonly<{ transport: Options["transport"]; email?: never;}>;Native storage/wake composition with exactly one provider capability.
CloudflareCarriertype alias
Section titled “CloudflareCarrier”type CloudflareCarrier = Pick<Carrier, "send" | "get"> & Readonly<{ alarm: () => Promise<void>; }>;Ordinary submission operations and the native Durable Object alarm door.
createCloudflareCarrier()function
Section titled “createCloudflareCarrier()”function createCloudflareCarrier(options): Promise<CloudflareCarrier>;Construct one owner per Durable Object. Forward its native alarm to alarm.
Acceptance commits the Email, recipient Messages, Watchdog job and wake
together.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
CloudflareCarrierOptions |
Returns
Section titled “Returns”Promise<CloudflareCarrier>
cloudflareEmailTransport()function
Section titled “cloudflareEmailTransport()”function cloudflareEmailTransport(binding): (email) => Promise<SendEvidence>;The native binding as a Carrier transport. Exported so a host that holds the binding elsewhere (the Hub’s Cloudflare edge) classifies sends identically.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
binding |
SendEmail |
Returns
Section titled “Returns”(email) => Promise<SendEvidence>