| 1 | /** |
| 2 | * Reserved entry-socket path that dispatches an inbound email to the user |
| 3 | * worker's `email()` handler, mirroring Miniflare's `CorePaths.EMAIL` |
| 4 | * (`workers-sdk/packages/miniflare/src/workers/core/constants.ts`). |
| 5 | * |
| 6 | * Required query parameters (matching Miniflare's `workers/core/email.ts`): |
| 7 | * - `from` — the SMTP envelope MAIL FROM address |
| 8 | * - `to` — the SMTP envelope RCPT TO address |
| 9 | * |
| 10 | * The request body carries the raw MIME message. |
| 11 | */ |
| 12 | export const PATH_EMAIL = "/cdn-cgi/handler/email"; |
| 13 | |
| 14 | /** |
| 15 | * Prefix shared by all trigger-handler paths (`CorePaths.HANDLER_PREFIX`). |
| 16 | * Unknown paths under it get a 404 pointing at the valid handlers. |
| 17 | */ |
| 18 | export const PATH_HANDLER_PREFIX = "/cdn-cgi/handler/"; |
| 19 | |
| 20 | /** |
| 21 | * Disk service rooted at `{storage}/email` — the same directory the |
| 22 | * send-email simulator persists to — that the entry worker writes email |
| 23 | * replies through (Miniflare stores replies via its loopback |
| 24 | * `store-temp-file` endpoint instead). |
| 25 | */ |
| 26 | export const SERVICE_EMAIL_STORAGE = "email:storage"; |
| 27 | |
| 28 | /** Disk service binding the entry worker writes email replies through. */ |
| 29 | export const BINDING_EMAIL_DISK = "EMAIL_DISK"; |
| 30 | |
| 31 | /** |
| 32 | * JSON binding carrying the node-side absolute path of the email persistence |
| 33 | * directory (`{storage}/email`), so logged file paths point at real files. |
| 34 | */ |
| 35 | export const BINDING_EMAIL_DIRECTORY = "EMAIL_DIRECTORY"; |