arcane-os 0.24.0 → 0.24.1
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/docs/reference/cli.md +82 -38
- package/docs/reference/mail.md +77 -20
- package/docs/reviews/mail-server-purpose-review.md +35 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.24.1
|
|
4
|
+
|
|
5
|
+
- Add a mail CLI parameter table with command scope, purpose, and defaults.
|
|
6
|
+
Explain the difference between `--app`, `X-Mail-App`, `--report-stdin`, and
|
|
7
|
+
the nonsecret `--report-key` used for intentional same-message retries.
|
|
8
|
+
- Remove redundant default-profile configuration and the alternate-account
|
|
9
|
+
placeholder from the main mail example. Align the CLI reference with the
|
|
10
|
+
shared configuration and credential files while preserving named-profile APIs.
|
|
11
|
+
- Clarify when subscription headers are required, how ordinary delivery failures
|
|
12
|
+
retain their existing report, and the separate browser callback and verification
|
|
13
|
+
service paths that can create feedback. Runtime behavior is unchanged.
|
|
14
|
+
|
|
3
15
|
## 0.24.0
|
|
4
16
|
|
|
5
17
|
- Read nonsecret mail settings from `arcane.config.json.mail` and provider keys
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ version-locked SDK runtime, while an integrated Arcane checkout uses its live
|
|
|
19
19
|
`arcane/` runtime. Both profiles preserve the same app URLs, theme, packaging,
|
|
20
20
|
event, cancellation, and browser run contracts.
|
|
21
21
|
|
|
22
|
-
This checkout defines the `0.24.
|
|
22
|
+
This checkout defines the `0.24.1` SDK contract. Applications pin one exact npm
|
|
23
23
|
version and lockfile; registry state is deliberately not baked into application
|
|
24
24
|
artifacts.
|
|
25
25
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -812,10 +812,13 @@ npm exec -- arcane repo status
|
|
|
812
812
|
|
|
813
813
|
## `arcane mail`
|
|
814
814
|
|
|
815
|
-
###
|
|
815
|
+
### Configuration and provider credentials
|
|
816
816
|
|
|
817
|
-
|
|
818
|
-
|
|
817
|
+
Mail reads nonsecret settings from `arcane.config.json.mail` and the Resend key
|
|
818
|
+
from `.arcane.env.json.mail.apiKey` in the invocation directory on Windows,
|
|
819
|
+
Linux, and macOS. See [Mail CLI parameters](mail.md#mail-cli-parameters) for the
|
|
820
|
+
complete parameter, configuration-field, default, and precedence reference.
|
|
821
|
+
The credential subcommands manage the provider key:
|
|
819
822
|
|
|
820
823
|
```text
|
|
821
824
|
arcane mail key set [profile] [--secret-stdin]
|
|
@@ -826,26 +829,43 @@ arcane mail key delete [profile]
|
|
|
826
829
|
`key set` reads the Resend API key from a hidden terminal prompt. The
|
|
827
830
|
`--secret-stdin` form is for deliberately redirected non-interactive input and
|
|
828
831
|
rejects a TTY before reading. The key is written to `.arcane.env.json` and is never
|
|
829
|
-
accepted in argv or returned in status output. The optional
|
|
830
|
-
to `mail`,
|
|
831
|
-
selects `MAIL_PROFILES[profile].RESEND_API_KEY`, with no default-key fallback.
|
|
832
|
+
accepted in argv or returned in status output. The optional credential-command
|
|
833
|
+
profile defaults to `mail`, independently of the send/serve configuration.
|
|
832
834
|
|
|
833
|
-
The minimal
|
|
835
|
+
The minimal `.arcane.env.json` is:
|
|
834
836
|
|
|
835
837
|
```json
|
|
836
838
|
{
|
|
837
|
-
"
|
|
839
|
+
"mail": {
|
|
840
|
+
"apiKey": ""
|
|
841
|
+
}
|
|
838
842
|
}
|
|
839
843
|
```
|
|
840
844
|
|
|
841
845
|
Fill in the key before starting mail, and add `.arcane.env.json` to the project's
|
|
842
|
-
`.gitignore`; the SDK repository already ignores it.
|
|
843
|
-
|
|
846
|
+
`.gitignore`; the SDK repository already ignores it. Keep nonsecret listener
|
|
847
|
+
settings, including certificate file paths, in `arcane.config.json.mail`.
|
|
848
|
+
|
|
849
|
+
Named profiles remain an optional CLI/toolchain compatibility feature for
|
|
850
|
+
selecting another stored Resend key. An exact name selects
|
|
851
|
+
`mail.profiles[name].apiKey`; the name is independent of incoming application
|
|
852
|
+
names, domains, and subscription keys. One server process uses one selected
|
|
853
|
+
Resend key for all its requests. An absent named key never falls back to the
|
|
854
|
+
default account. Existing root `RESEND_API_KEY` and
|
|
855
|
+
`MAIL_PROFILES[name].RESEND_API_KEY` remain fallbacks when the corresponding
|
|
856
|
+
nested key property is absent. A nested property containing null or an empty
|
|
857
|
+
string means the selected key is absent and takes precedence over a legacy key.
|
|
858
|
+
|
|
859
|
+
Set and delete preserve the file's other settings and profile containers. New
|
|
860
|
+
keys are written to the nested mail member. Existing legacy keys are updated
|
|
861
|
+
in place unless the selected nested key property exists; delete removes both
|
|
862
|
+
representations of only the selected key. Status returns the selected profile,
|
|
844
863
|
`provider:'resend'`, `storage:'.arcane.env.json'`, and `exists`. Delete returns
|
|
845
864
|
`exists:false` for both a removed and an already-absent credential.
|
|
846
865
|
|
|
847
|
-
Programmatic `createToolchain().mail(...)` resolves the
|
|
848
|
-
|
|
866
|
+
Programmatic `createToolchain().mail(...)` resolves both files from the directory
|
|
867
|
+
selected by `cwd ?? workspaceRoot ?? process.cwd()`, with no upward search.
|
|
868
|
+
This uses ordinary Node file
|
|
849
869
|
access rather than platform-specific credential processes. An Android host
|
|
850
870
|
supplies a compatible Node runtime and an accessible configuration directory.
|
|
851
871
|
Existing Windows Credential Manager records remain untouched; the JSON reader
|
|
@@ -854,11 +874,13 @@ populate or depend on process environment variables for this key.
|
|
|
854
874
|
|
|
855
875
|
The SDK's installation directory does not affect this location. With an SDK
|
|
856
876
|
under `my-site/arcane-os-sdk/`, run the command from `my-site/` and keep
|
|
857
|
-
`my-site/.arcane.env.json` alongside that
|
|
877
|
+
`my-site/arcane.config.json` and `my-site/.arcane.env.json` alongside that
|
|
878
|
+
directory. Existing deployments using
|
|
858
879
|
SDK 0.22.1 or earlier must rename `.env.json` to `.arcane.env.json` while
|
|
859
880
|
preserving its contents; the loader reads only the new name.
|
|
860
881
|
|
|
861
|
-
|
|
882
|
+
Each file is an optional configuration source. Missing or empty selected keys
|
|
883
|
+
stop `send` and `serve` with the
|
|
862
884
|
configuration path and exact JSON setting to fill in. Invalid JSON and file
|
|
863
885
|
access failures remain observable without printing credential content.
|
|
864
886
|
|
|
@@ -890,11 +912,16 @@ shape:
|
|
|
890
912
|
|
|
891
913
|
The CLI forwards the complete provider fields, including template requests.
|
|
892
914
|
Resend owns their accepted shape. The adapter removes the application-only
|
|
893
|
-
`type` field and applies
|
|
894
|
-
template supplies the sender. Direct
|
|
895
|
-
no configured fallback recipients
|
|
896
|
-
|
|
897
|
-
|
|
915
|
+
`type` field and applies the shared sender from `--from` or `mail.from` when
|
|
916
|
+
supplied; otherwise the report or provider template supplies the sender. Direct
|
|
917
|
+
CLI sending has no configured fallback recipients and requires no listener TLS
|
|
918
|
+
paths. It consumes the configured provider timeout and retry guidance.
|
|
919
|
+
|
|
920
|
+
The Resend credential comes from the selected `.arcane.env.json` entry.
|
|
921
|
+
An explicit `--profile` overrides `arcane.config.json.mail.profile`; omitting
|
|
922
|
+
both selects the default `mail.apiKey`, with the legacy fallback described
|
|
923
|
+
above. Neither the key nor report content is accepted through argv or process
|
|
924
|
+
environment variables.
|
|
898
925
|
|
|
899
926
|
The caller owns the nonempty `--report-key`, which is forwarded unchanged.
|
|
900
927
|
Reuse the same key only with the same
|
|
@@ -918,22 +945,28 @@ loss after the attempt begins is ambiguous because Resend may have accepted it.
|
|
|
918
945
|
arcane mail serve [--profile <profile>] [--from <verified-sender>] [--app <label>] [--origin <exact-origin>] [--allow-to <addresses>] [--host 0.0.0.0] [--port 4433] [--request-timeout <ms>]
|
|
919
946
|
```
|
|
920
947
|
|
|
921
|
-
The selected `.arcane.env.json`
|
|
922
|
-
|
|
948
|
+
The selected `.arcane.env.json` entry supplies only the server-side Resend API
|
|
949
|
+
key. An explicit `--profile` overrides `arcane.config.json.mail.profile`;
|
|
950
|
+
omitting both selects the default key.
|
|
923
951
|
|
|
924
|
-
Add the listener's certificate
|
|
952
|
+
Add the listener's certificate paths to `arcane.config.json`:
|
|
925
953
|
|
|
926
954
|
```json
|
|
927
955
|
{
|
|
928
|
-
"
|
|
929
|
-
|
|
930
|
-
|
|
956
|
+
"mail": {
|
|
957
|
+
"certPath": ".arcane/mail/fullchain.pem",
|
|
958
|
+
"keyPath": ".arcane/mail/private-key.pem"
|
|
959
|
+
}
|
|
931
960
|
}
|
|
932
961
|
```
|
|
933
962
|
|
|
934
963
|
Supply an existing PEM certificate chain and its private key. Paths resolve
|
|
935
|
-
relative to
|
|
936
|
-
|
|
964
|
+
relative to the selected configuration directory, or may be absolute. They
|
|
965
|
+
belong to the listener regardless of the provider key selected. Legacy root
|
|
966
|
+
`MAIL_TLS_CERT_PATH` and `MAIL_TLS_KEY_PATH` in `.arcane.env.json` remain
|
|
967
|
+
fallbacks for omitted config paths. Explicit programmatic `certPath` and
|
|
968
|
+
`keyPath` options override those files. Missing TLS settings name the fields
|
|
969
|
+
to fill in before a listener
|
|
937
970
|
opens; the TLS owner reports PEM file errors. Keep private-key material outside
|
|
938
971
|
tracked source. The SDK repository already ignores `.arcane/` and `.arcane.env.json`.
|
|
939
972
|
|
|
@@ -949,7 +982,7 @@ server; the incoming request's `X-Mail-App` identifies the application for
|
|
|
949
982
|
subscription verification. The HTTP authentication contract pairs that
|
|
950
983
|
application with `Authorization: Bearer <subscription_key>`.
|
|
951
984
|
|
|
952
|
-
Subscription verification is disabled
|
|
985
|
+
Subscription verification is disabled when no callback is configured. The
|
|
953
986
|
programmatic `createToolchain().mail({action: 'serve', ...})` path accepts
|
|
954
987
|
`verifySubscription({appName, subscriptionKey, signal})`; supplying that callback
|
|
955
988
|
enables verification before each provider attempt. It must resolve to `true`
|
|
@@ -958,16 +991,27 @@ failure receives retryable 503; cancellation stops verification before sending.
|
|
|
958
991
|
The callback connects the actual TWiN Stripe endpoint when its contract is
|
|
959
992
|
ready. There is no guessed URL, response schema, or command-line endpoint flag.
|
|
960
993
|
|
|
961
|
-
The listener defaults to `0.0.0.0`;
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
994
|
+
The listener defaults to `0.0.0.0:4433`; `mail.host` and `mail.port` configure
|
|
995
|
+
the listener, and explicit `--host` and `--port` override them. Browser mail
|
|
996
|
+
defaults to `/v1/mail` on the current domain. `mail.origins` supplies an exact
|
|
997
|
+
origin array; `--origin` replaces it with one origin. Repeated `--origin`
|
|
998
|
+
options keep the last value. An absent or empty list selects the current
|
|
999
|
+
request authority. Other Origins receive `403 mail_origin_not_allowed`;
|
|
1000
|
+
requests without an Origin continue normally. This CORS configuration does
|
|
1001
|
+
not filter client IPs or give loopback special treatment.
|
|
1002
|
+
|
|
1003
|
+
`mail.recipientAllowlist` supplies the recipient list; `--allow-to` replaces it
|
|
1004
|
+
with a comma-separated list. CLI parsing preserves supplied address spelling
|
|
1005
|
+
and repeated entries. Programmatic `errorTo` or `mail.errorRecipients` selects
|
|
1006
|
+
fallback recipients for error reports. When neither is supplied, the effective
|
|
1007
|
+
recipient allowlist supplies that fallback; an explicit empty array supplies
|
|
1008
|
+
none. The [Mail CLI parameters](mail.md#mail-cli-parameters) reference also
|
|
1009
|
+
documents programmatic aliases and list-replacement precedence.
|
|
1010
|
+
|
|
1011
|
+
`--request-timeout` overrides `mail.providerTimeoutMs` and accepts 1 through
|
|
1012
|
+
2147483647 milliseconds, the Node timer range. An absent effective timeout
|
|
1013
|
+
adds no provider deadline; programmatic/configured null also selects no
|
|
1014
|
+
deadline. `mail.bodyTimeoutMs` selects the optional request-body deadline.
|
|
971
1015
|
|
|
972
1016
|
After binding, `server.ready` reports lifecycle fields such as
|
|
973
1017
|
protocol, optional app label, bind address, port, URL, and `callerAuthentication`
|
package/docs/reference/mail.md
CHANGED
|
@@ -272,6 +272,40 @@ committed acceptance result.
|
|
|
272
272
|
|
|
273
273
|
## Operate the CLI and gateway
|
|
274
274
|
|
|
275
|
+
### Mail CLI parameters
|
|
276
|
+
|
|
277
|
+
`mail serve` starts the shared mail server. `mail send` makes one direct Resend
|
|
278
|
+
request. `mail key set|status|delete` manages the provider credential.
|
|
279
|
+
|
|
280
|
+
| Parameter | Command | What it does | When omitted |
|
|
281
|
+
| --- | --- | --- | --- |
|
|
282
|
+
| `--app <label>` | `mail serve` | Supplies a fallback application label for server events. An incoming `X-Mail-App` supplies the request's label. This option does not choose a Stripe account or limit which apps may send mail. | Uses `mail.appId` when configured; otherwise adds no fallback label. |
|
|
283
|
+
| `--from <sender>` | `mail serve`, `mail send` | Overrides the sender, for example `"Dragon Dispatch <dispatch@example.com>"`. On the server, the override applies to every report. Resend must accept that sender. | Uses `mail.from` when configured, then the report's `from` or provider template default. |
|
|
284
|
+
| `--report-stdin` | `mail send` | Reads one complete UTF-8 report JSON object from redirected standard input, including recipients, subject, body, and other provider fields. | Required; the command reports a usage error. |
|
|
285
|
+
| `--report-key <id>` | `mail send` | Identifies one intended email and is forwarded unchanged as Resend's `Idempotency-Key`. Use a new value for a new email; reuse the value and unchanged report for an intentional retry. It is not a credential. | Required; the command reports a usage error. |
|
|
286
|
+
| `--host <address>` | `mail serve` | Selects the listener bind address. `0.0.0.0` accepts connections through all IPv4 interfaces. | Uses `mail.host`, then `0.0.0.0`. |
|
|
287
|
+
| `--port <number>` | `mail serve` | Selects the HTTPS listener port. Explicit `0` asks the operating system for an available port. | Uses `mail.port`, then `4433`. |
|
|
288
|
+
| `--origin <origin>` | `mail serve` | Replaces the configured CORS origins with one exact browser origin, including scheme and any nondefault port. Use the JSON `origins` array for multiple origins; repeated flags keep only the last value. | Uses `mail.origins`; an absent or empty list uses the current request authority. Requests without an `Origin` header continue normally. |
|
|
289
|
+
| `--allow-to <addresses>` | `mail serve` | Replaces the recipient allowlist with a comma-separated list. Applies to `to`, `cc`, and `bcc`, and supplies error-report fallback recipients unless `mail.errorRecipients` is configured separately. | Uses `mail.recipientAllowlist`; an absent or empty list leaves recipients unrestricted. |
|
|
290
|
+
| `--request-timeout <ms>` | `mail serve`, `mail send` | Sets the deadline for one Resend request, in milliseconds. A timeout after sending begins leaves delivery uncertain; it does not schedule a retry. | Uses `mail.providerTimeoutMs`; absent or null adds no provider deadline. |
|
|
291
|
+
| `--profile <name>` | `mail serve`, `mail send` | Selects an alternate saved Resend credential for this invocation. One listener uses that selected provider key for all callers. | Uses `mail.profile` if configured, otherwise the normal `mail.apiKey`. The single-key setup needs no profile setting. |
|
|
292
|
+
| `[profile]` | `mail key set\|status\|delete` | Optional positional name of the credential to manage; it is not a flag. | Manages the normal `mail.apiKey`, independently of `mail.profile`. |
|
|
293
|
+
| `--secret-stdin` | `mail key set` | Reads the Resend API key from deliberately redirected standard input instead of the hidden terminal prompt. | Prompts with hidden input. Machine-output mode requires redirected input. |
|
|
294
|
+
| `--output human\|json\|ndjson` | All mail commands | Selects readable console output, one JSON result, or newline-delimited JSON events. | Uses `human`. |
|
|
295
|
+
| `--help` | CLI | Displays CLI help instead of running the mail operation. | Runs the requested operation. |
|
|
296
|
+
| `--version` | CLI | Displays the SDK version instead of running the mail operation. | Runs the requested operation. |
|
|
297
|
+
|
|
298
|
+
There is no `--report` flag. `--report-stdin` supplies the message;
|
|
299
|
+
`--report-key` identifies that same message across attempts. Browser `Mail.send()`
|
|
300
|
+
generates and retains its report key automatically.
|
|
301
|
+
|
|
302
|
+
Mail reads configuration from the directory in which the command runs;
|
|
303
|
+
`--workspace` does not relocate these mail files. Mail HTTPS uses `mail.certPath`
|
|
304
|
+
and `mail.keyPath` in JSON. The `--cert`, `--key`, `--https`, and `--http-port`
|
|
305
|
+
flags belong to browser `dev`/`run`, and `--http` belongs to `dev`.
|
|
306
|
+
|
|
307
|
+
### Mail configuration
|
|
308
|
+
|
|
275
309
|
Keep app-supplied SDK settings under named capability members, starting with
|
|
276
310
|
`mail`. Put the nonsecret mail settings in `arcane.config.json` in the directory
|
|
277
311
|
from which the command runs:
|
|
@@ -285,7 +319,6 @@ from which the command runs:
|
|
|
285
319
|
"https://dragons.example",
|
|
286
320
|
"https://www.dragons.example"
|
|
287
321
|
],
|
|
288
|
-
"profile": "mail",
|
|
289
322
|
"certPath": "certificates/fullchain.pem",
|
|
290
323
|
"keyPath": "certificates/private-key.pem"
|
|
291
324
|
}
|
|
@@ -333,24 +366,16 @@ injected providers, `fetchImpl`, `onEvent`, `requestIdFactory`,
|
|
|
333
366
|
runtime inputs, not JSON settings. Reports and their idempotency keys remain
|
|
334
367
|
inputs to each send operation.
|
|
335
368
|
|
|
336
|
-
The
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```json
|
|
340
|
-
{
|
|
341
|
-
"mail": {
|
|
342
|
-
"apiKey": "",
|
|
343
|
-
"profiles": {
|
|
344
|
-
"another-provider-account": {
|
|
345
|
-
"apiKey": ""
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
```
|
|
369
|
+
The single-key configuration above needs no `profile` or `profiles` member.
|
|
370
|
+
Omitting the selection uses `.arcane.env.json.mail.apiKey`; multiple apps and
|
|
371
|
+
domains can share that provider key.
|
|
351
372
|
|
|
352
|
-
|
|
353
|
-
|
|
373
|
+
For callers that already select an alternate credential, named-profile support
|
|
374
|
+
remains available: `--profile <name>` or `mail.profile` selects
|
|
375
|
+
`.arcane.env.json.mail.profiles[name].apiKey`. An absent named profile does not
|
|
376
|
+
fall back to the default key. Selection happens once when send or serve starts;
|
|
377
|
+
it does not map incoming apps or domains to different provider accounts.
|
|
378
|
+
The profile selects Resend provider credentials, separately from the incoming
|
|
354
379
|
application name and subscriber key. Existing top-level `RESEND_API_KEY` and
|
|
355
380
|
`MAIL_PROFILES[profile].RESEND_API_KEY` remain supported. A nested selected
|
|
356
381
|
`apiKey` takes precedence when the property exists, including null or an empty
|
|
@@ -449,8 +474,8 @@ arcane mail send --from "Arcane <verified@example.com>" --report-key <stable-id>
|
|
|
449
474
|
The redirected UTF-8 JSON object is read completely. Its fields and values
|
|
450
475
|
are retained; the Resend adapter removes the SDK's `type` routing field,
|
|
451
476
|
uses `from` when configured (otherwise the report or provider template supplies
|
|
452
|
-
the sender)
|
|
453
|
-
|
|
477
|
+
the sender). Direct sending supplies no fallback recipients. Resend evaluates
|
|
478
|
+
its own required provider fields. Message
|
|
454
479
|
content is not accepted in argv. Programmatic results and observer events
|
|
455
480
|
preserve the complete report, provider request, provider response, and error detail while
|
|
456
481
|
never exposing either credential.
|
|
@@ -579,6 +604,12 @@ key, and `signal` follows the request lifecycle. These control fields stay
|
|
|
579
604
|
separate from the mail report and Resend payload. The verifier runs for each
|
|
580
605
|
POST request before any provider attempt; results are not cached.
|
|
581
606
|
|
|
607
|
+
`X-Mail-App` identifies the originating app so the verifier can select that
|
|
608
|
+
app's subscription account, such as the appropriate Stripe account for `BOSS`
|
|
609
|
+
or `TWiN`. It is separate from the gateway's optional `--app` event label.
|
|
610
|
+
The missing-header and Bearer errors below apply only when `verifySubscription`
|
|
611
|
+
is configured. Ordinary `mail serve` does not require either header.
|
|
612
|
+
|
|
582
613
|
| Configured-verifier outcome | Gateway response |
|
|
583
614
|
| --- | --- |
|
|
584
615
|
| Missing or empty `X-Mail-App` | `400 mail_invalid_headers` |
|
|
@@ -602,6 +633,32 @@ CLI startup output says `Subscription verification: disabled` or
|
|
|
602
633
|
`Subscription verification: configured`. Structured `server.ready` output
|
|
603
634
|
includes the corresponding `callerAuthentication` value.
|
|
604
635
|
|
|
636
|
+
## Error reports and retries
|
|
637
|
+
|
|
638
|
+
An incoming report with `type: 'error'` is an email supplied by its caller.
|
|
639
|
+
The gateway's `errorRecipients` setting only supplies fallback recipients for
|
|
640
|
+
that report when its `to` array is empty. A gateway or provider failure returns
|
|
641
|
+
an HTTP error and diagnostic events; it does not generate another error email.
|
|
642
|
+
Gateway event-handler failures are written to the console. Each POST and each
|
|
643
|
+
direct CLI send performs at most one provider attempt, with no automatic server retry.
|
|
644
|
+
|
|
645
|
+
The browser outbox retains the same report and key after a retryable delivery
|
|
646
|
+
failure. Each drain attempts each eligible record once; a later startup,
|
|
647
|
+
connectivity event, or explicit drain can retry it. Browser `Errors` notification
|
|
648
|
+
failure retains the same pending occurrence and logs a warning without scheduling
|
|
649
|
+
itself again.
|
|
650
|
+
|
|
651
|
+
A separate browser callback path can feed back into error reporting: a mail-event
|
|
652
|
+
subscriber that repeatedly throws can reach global error capture, create another
|
|
653
|
+
error report, and trigger another mail event. Subscriber failures cannot change
|
|
654
|
+
an already committed mail result, though global capture can report them as new
|
|
655
|
+
errors. This is a source-level possibility, not evidence of a deployed loop.
|
|
656
|
+
|
|
657
|
+
For a verification service that sends its own emails, its host integration must
|
|
658
|
+
also avoid the circular request path `mail -> verify subscription -> send mail ->
|
|
659
|
+
verify subscription`. The SDK supplies a callback for verification; it does not
|
|
660
|
+
choose that service's caller flow or enable it in ordinary CLI startup.
|
|
661
|
+
|
|
605
662
|
## Gateway request lifecycle
|
|
606
663
|
|
|
607
664
|
The gateway uses the published `node-http-server` instance lifecycle. Its raw
|
|
@@ -480,7 +480,7 @@ files. Their explicit precedence and credential compatibility rules are in the
|
|
|
480
480
|
| `readMailConfiguration` | Y/Y/N | Keep the cohesive configuration at the SDK owner. Send/serve read each required file once, in parallel when both are needed. A send with an injected credential reader skips the unused secrets file; incoming HTTP requests use the resolved configuration without file reads. Other capability settings stay untouched. |
|
|
481
481
|
| CLI's early default host, port, and send/serve profile values | Y/Y/Y | Remove premature default assignment. The same defaults remain after file configuration resolves, while explicit CLI values retain priority. Assigning defaults before reading JSON would conceal the deployment's chosen settings. |
|
|
482
482
|
| `origins` string array and list replacement | Y/Y/N | Keep one exact list for multiple caller domains. Explicit options replace the file list, including empty arrays. Existing `origin`, `allowTo`, `errorTo`, and `requestTimeout` aliases remain compatible and win over their canonical programmatic names when both are supplied. No normalization or list-merging helper is needed. |
|
|
483
|
-
| Root provider-key, named-profile, and TLS compatibility | Y/Y/N | Preserve
|
|
483
|
+
| Root provider-key, named-profile, and TLS compatibility | Y/Y/N | Preserve supported inputs using `RESEND_API_KEY`, `MAIL_PROFILES`, `MAIL_TLS_CERT_PATH`, and `MAIL_TLS_KEY_PATH`. Nested selected key presence takes priority even when null or empty. Named profiles never select a different account's default key. Named-profile deployment use is unverified; the retained behavior is a compatibility contract. |
|
|
484
484
|
| Key set/status/delete operations | Y/Y/N | Preserve credential management and secret-free status. New keys use the nested member; existing legacy keys are updated in place unless a nested key exists. Delete removes both selected representations to prevent an old credential reappearing, preserving other keys, settings, and profile containers. Key commands still default to `mail` independently of the serving profile. |
|
|
485
485
|
| Send configuration | Y/Y/N | Use the same profile, sender, provider-timeout, and retry-guidance settings for direct sending. A send needs provider authority and its report, so listener certificates remain a serve-only prerequisite. Reports and idempotency keys remain per-operation inputs. |
|
|
486
486
|
| Explicit runtime dependencies and callbacks | Y/Y/N | Preserve `readCredential`, provider injection, observation, cancellation, and subscription callbacks as programmatic inputs. A function or signal is not JSON configuration. The portable browser mail import retains its existing dependency boundary. |
|
|
@@ -507,3 +507,37 @@ adaptation. Local tests, checks, server launches, live mail sends, and platform
|
|
|
507
507
|
execution were not performed by this documentation author. Selected package
|
|
508
508
|
verification and publication outcomes belong to the release owner's delivery
|
|
509
509
|
record.
|
|
510
|
+
|
|
511
|
+
## Parameter examples and error-report path clarification
|
|
512
|
+
|
|
513
|
+
The ordinary shared mail server needs one Resend key. Its current-domain
|
|
514
|
+
behavior, origin list, and incoming application/subscription verification do
|
|
515
|
+
not select among provider profiles. A named profile selects one stored key
|
|
516
|
+
for an entire send or server invocation. Source inspection found named CLI and
|
|
517
|
+
toolchain inputs plus synthetic tests; it did not establish a deployment that
|
|
518
|
+
uses named mail profiles.
|
|
519
|
+
|
|
520
|
+
| Method or action | Gates | Decision, callers, and concrete purpose |
|
|
521
|
+
| --- | --- | --- |
|
|
522
|
+
| Explicit default `profile: 'mail'` in setup examples | N/N/Y | Remove the redundant setting. Omission already selects the default key when no named configuration is supplied. CLI send/serve still honor an explicitly selected profile or `mail.profile`. |
|
|
523
|
+
| Extra `another-provider-account` credential placeholder | N/N/Y | Remove it from ordinary setup. It adds an unused account choice to a one-key configuration. Existing optional named-profile behavior remains documented without presenting another account as a setup requirement. |
|
|
524
|
+
| Named-profile CLI/toolchain capability and credential CRUD | Y/Y/N for compatibility | Retain the supported optional profile argument and exact named-key operations. Concrete application/deployment use is unverified. This is an account-selection contract, separate from removing redundant default arguments; its retention makes no claim that the nominal deployment needs it. |
|
|
525
|
+
| Full CLI parameter explanation | Y/Y/N | Keep one canonical [Mail CLI parameters](../reference/mail.md#mail-cli-parameters) table. The CLI reference links to it and describes the current split configuration, selected values, defaults, aliases, and provider behavior without another competing table. |
|
|
526
|
+
| Claim that mail errors can never produce an error-report loop | N/N/Y | Replace the absolute claim with the source-path qualification below. Ordinary server failures do not send another mail; a repeatedly failing browser event subscriber can produce new global error incidents during error-mail delivery. |
|
|
527
|
+
|
|
528
|
+
The Node gateway reports ordinary request/provider failures through responses,
|
|
529
|
+
observer results, or its console logger. Its error reporter does not call the
|
|
530
|
+
mail sender. In the browser, `Errors` owns global `error` and
|
|
531
|
+
`unhandledrejection` capture and sends error notifications through Mail. A
|
|
532
|
+
failed notification remains pending with a warning rather than immediately
|
|
533
|
+
creating another notification from that send failure.
|
|
534
|
+
|
|
535
|
+
There is a separate conditional path: a subscriber that repeatedly throws
|
|
536
|
+
while handling Mail events reaches the event authority's listener-failure
|
|
537
|
+
reporter. In browsers with `reportError`, that failure can become a new global
|
|
538
|
+
error incident. Sending that incident through Mail can invoke the same failing
|
|
539
|
+
subscriber again. A loop therefore depends on that subscriber and the active
|
|
540
|
+
global error handler; it is not an automatic server response to an ordinary
|
|
541
|
+
mail failure. This is a static source-path finding, not an observed production
|
|
542
|
+
incident or an executed reproduction. This documentation clarification changes
|
|
543
|
+
no error, subscription, retry, or delivery behavior.
|
package/package.json
CHANGED