@zintrust/cloudflare-email-proxy 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/build-manifest.json +37 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @zintrust/cloudflare-email-proxy
|
|
2
|
+
|
|
3
|
+
Cloudflare Worker service that exposes a small HTTPS API for Cloudflare Email Routing sends.
|
|
4
|
+
|
|
5
|
+
Docs: https://zintrust.com/mail
|
|
6
|
+
|
|
7
|
+
This is intended for server-to-server use when a ZinTrust app runs outside Cloudflare Workers but still wants to use the built-in `MAIL_DRIVER=cl` or `MAIL_DRIVER=cloudflare` path.
|
|
8
|
+
|
|
9
|
+
## Endpoint
|
|
10
|
+
|
|
11
|
+
All requests are `POST` and require signed request headers.
|
|
12
|
+
|
|
13
|
+
- `/zin/mail/cloudflare/send` → `{ binding?, message }` → `{ ok: true, messageId? }`
|
|
14
|
+
|
|
15
|
+
## Required bindings
|
|
16
|
+
|
|
17
|
+
- `SEND_EMAIL` send_email binding
|
|
18
|
+
|
|
19
|
+
If your binding name is not `SEND_EMAIL`, set Worker var `MAIL_CLOUDFLARE_BINDING` or pass `binding` in the signed payload.
|
|
20
|
+
|
|
21
|
+
Optional but recommended:
|
|
22
|
+
|
|
23
|
+
- `ZT_NONCES` KV binding for replay protection
|
|
24
|
+
|
|
25
|
+
## Required secrets / vars
|
|
26
|
+
|
|
27
|
+
Secret:
|
|
28
|
+
|
|
29
|
+
- `MAIL_CLOUDFLARE_PROXY_SECRET` shared signing secret used to verify requests
|
|
30
|
+
- `APP_KEY` fallback shared signing secret if `MAIL_CLOUDFLARE_PROXY_SECRET` is not set
|
|
31
|
+
|
|
32
|
+
Optional vars:
|
|
33
|
+
|
|
34
|
+
- `ZT_PROXY_SIGNING_WINDOW_MS` default `60000`
|
|
35
|
+
- `ZT_MAX_BODY_BYTES` default `131072`
|
|
36
|
+
|
|
37
|
+
## Deploy
|
|
38
|
+
|
|
39
|
+
From this package directory:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
wrangler deploy
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Set secrets:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
wrangler secret put MAIL_CLOUDFLARE_PROXY_SECRET
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Use from ZinTrust
|
|
52
|
+
|
|
53
|
+
Configure your app:
|
|
54
|
+
|
|
55
|
+
- `MAIL_DRIVER=cl`
|
|
56
|
+
- `MAIL_CLOUDFLARE_PROXY_URL=https://<your-worker-host>`
|
|
57
|
+
- `MAIL_CLOUDFLARE_PROXY_KEY_ID=k1`
|
|
58
|
+
- `MAIL_CLOUDFLARE_PROXY_SECRET=super-secret-shared-key`
|
|
59
|
+
- `MAIL_CLOUDFLARE_BINDING=SEND_EMAIL` if needed
|
|
60
|
+
|
|
61
|
+
Then use `Mail.send(...)` as normal.
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
This package and its dependencies are MIT licensed, permitting free commercial use.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zintrust/cloudflare-email-proxy",
|
|
3
|
+
"version": "2.1.3",
|
|
4
|
+
"buildDate": "2026-05-27T04:04:24.860Z",
|
|
5
|
+
"buildEnvironment": {
|
|
6
|
+
"node": "v22.22.1",
|
|
7
|
+
"platform": "darwin",
|
|
8
|
+
"arch": "arm64"
|
|
9
|
+
},
|
|
10
|
+
"git": {
|
|
11
|
+
"commit": "c82f6263",
|
|
12
|
+
"branch": "release"
|
|
13
|
+
},
|
|
14
|
+
"package": {
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20.0.0"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": [],
|
|
19
|
+
"peerDependencies": [
|
|
20
|
+
"@zintrust/core"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"files": {
|
|
24
|
+
"build-manifest.json": {
|
|
25
|
+
"size": 836,
|
|
26
|
+
"sha256": "93369490a28e61401c8b3cd1db2461f88d133616d8d254d9de72bbab6598c8c2"
|
|
27
|
+
},
|
|
28
|
+
"index.d.ts": {
|
|
29
|
+
"size": 90,
|
|
30
|
+
"sha256": "578d6be2afb098df77accb6f0292cc41b8cc722c02ae86afcb4b9b88d94e1559"
|
|
31
|
+
},
|
|
32
|
+
"index.js": {
|
|
33
|
+
"size": 295,
|
|
34
|
+
"sha256": "72cf3b42eb23cd171b5c4fa447a24f914bc67d0f9317bfea9f8f5c17916b6110"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ZintrustEmailProxy, ZintrustEmailProxy as default } from '@zintrust/core/proxy';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ZintrustEmailProxy, ZintrustEmailProxy as default } from '@zintrust/core/proxy';
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zintrust/cloudflare-email-proxy",
|
|
3
|
+
"version": "2.1.3",
|
|
4
|
+
"description": "Cloudflare email proxy package for ZinTrust.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20.0.0"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@zintrust/core": "*"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"zintrust",
|
|
27
|
+
"cloudflare",
|
|
28
|
+
"email",
|
|
29
|
+
"mail",
|
|
30
|
+
"proxy",
|
|
31
|
+
"workers"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
|
|
35
|
+
"prepublishOnly": "npm run build",
|
|
36
|
+
"type-check": "tsc -p tsconfig.json --noEmit"
|
|
37
|
+
}
|
|
38
|
+
}
|