@samva/cli 0.8.0 → 0.10.0

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.
Files changed (4) hide show
  1. package/AGENTS.md +27 -3
  2. package/README.md +10 -3
  3. package/dist/bin.mjs +1513 -339
  4. package/package.json +7 -7
package/AGENTS.md CHANGED
@@ -27,6 +27,13 @@ a template written in a format the compiler rejects. Templates live in `template
27
27
  `emails/`; a template is a `.tsx` file that default-exports `defineTemplate`, and the compiler reads
28
28
  it without running it.
29
29
 
30
+ `samva email send --attach <path>` (repeatable) attaches local files; the filename is the basename and
31
+ the content type comes from the extension (`application/octet-stream` when unknown). The CLI reads
32
+ and budget-checks every file before any request (at most 10 files, 25 MiB each and in total) and
33
+ exits `2` naming the path or limit. Past the 4 MiB inline limit, the largest files upload through
34
+ `/v1/media` first and travel by `mediaId`; the send's retries reuse them, and rerunning the command
35
+ uploads again. `--dry-run` lists each attachment and uploads nothing.
36
+
30
37
  `--publication-id` and `--input-contract-id` on `email send`, `scheduled-messages create`, and
31
38
  `campaigns create`/`update` choose which publication a template send renders: one exact publication,
32
39
  or the newest publication that still validates input identically. They are mutually exclusive and
@@ -90,18 +97,35 @@ Standalone callers supply their own resolver. The README owns resolution order a
90
97
  `dev` handles mailbox events locally, `publish` records an immutable version, and `install` grants
91
98
  that version scoped mailbox permissions. Hosted extensions run on Samva; webhook extensions use
92
99
  the installation credentials returned once at install. Publishing and installation management
93
- require a person signed in with `samva login`. Local development with that login attributes tool
100
+ require a person signed in with `samva login`. `upgrade <installation-id>` selects the latest
101
+ published version, or `--version <version-or-id>` selects one. `--dry-run` asks the API for the
102
+ from/to versions and added/removed grants without changing the installation; the installation
103
+ shown in a preview is its current state. Applying requires confirmation (`--yes` outside a
104
+ terminal) and an exact, repeatable `--accept-permissions` acknowledgement for each added grant,
105
+ such as `permission:send` or `event:mailbox.message.sent`. Local development with that login attributes tool
94
106
  calls to you, rather than to an installation. Read what exists with `list`, `versions <name>`,
95
107
  `version <name> <version>`, `installations`, `installation <id>`, `runs <id>` (outcomes only), and
96
108
  `run <id> <run-id>` (adds the handler's log lines); the list commands page with `--limit`,
97
109
  `--cursor`, and `--all --jsonl`.
98
110
 
99
111
  `samva mailboxes` reads and sends as a mailbox: `list` pages with `--limit`, `--cursor`, `--after`,
100
- and `--before`, `threads` searches, `read` prints a message (human output marks the body as
112
+ and `--before`. `get <id>` inspects a mailbox; `update <id> --data <JSON-or-@file>` changes
113
+ `displayName`, `defaultFrom`, or `metadata` (merges by key, `null` deletes a key). `pause <id>`
114
+ stops sending and receiving, and `resume <id>` resumes without backfilling mail received while
115
+ paused. These mutations support `--dry-run`. `remove <id>` deletes a mailbox (`--yes` outside a terminal, `--dry-run` to
116
+ preview), `threads` searches, `read` prints a message (human output marks the body as
101
117
  untrusted email), and `send` and `reply` take `--idempotency-key` so a retry cannot send twice.
102
118
  Quarantine `list` pages the same way, bounded by `--after` and `--before` on when a message was
103
119
  held; `release` and `discard` take the held message's `id` and require a person signed in with
104
- `samva login`. `samva mailboxes events` reads the SDK event stream with reconnects off and prints
120
+ `samva login`. Discard requires confirmation (`--yes` outside a terminal) and supports `--dry-run`.
121
+ `actions list --mailbox <id>` filters by `--state` and pages with `--limit`, `--cursor`, and
122
+ `--all --jsonl`. `actions approve <action-id> --mailbox <id>` and `actions deny <action-id>
123
+ --mailbox <id> [--reason <text>]` require a person different from the proposer, confirmation
124
+ (`--yes` outside a terminal), and offer `--dry-run`.
125
+ Human mailbox and extension results retain the same facts as JSON: mailbox addresses and sending
126
+ identity, thread state and activity, message bodies, attachments, authentication and actor,
127
+ receipt waits and skipped recipients, held-mail results, and installation/run details.
128
+ `samva mailboxes events` reads the SDK event stream with reconnects off and prints
105
129
  one record per event, `{cursor, id, event}` (`--jsonl` wraps each in a result envelope, `--quiet`
106
130
  prints none, `--json` is refused). A drop or refusal ends the command with the server's `_tag` as
107
131
  the error `reason`, its `status` and `details`, and a `Try:` line; the last handled cursor, which
package/README.md CHANGED
@@ -420,13 +420,20 @@ review decision, sendable domain and verified sender counts, and domain-verifica
420
420
  `readyToSend` is true when a production send would be admitted and at least one domain or sender can
421
421
  carry it. It is read-only and does not inspect receiving configuration, check DNS itself, send an
422
422
  email, or replay fixtures.
423
- Use `samva email receiving status <domain-id>` to read a domain's receiving prerequisite status.
424
- `samva email receiving enable <domain-id> ...` acts by default; its `--dry-run` is offline and does
425
- not require credentials or call the API. Each check is `passed`, `failed`, or
423
+ Each check is `passed`, `failed`, or
426
424
  `unavailable`. A `failed` check carries the underlying error detail; `unavailable`, such as no
427
425
  sending domain yet or a review in progress, is informational; a rejected review fails. The command always prints the full report, then
428
426
  exits `1` if any check failed and `0` otherwise. The `--json` result's `data` adds an aggregate
429
427
  `ok` boolean, and human output marks checks with `✓`, `!`, and `✗` respectively.
430
428
 
429
+ Use `samva email receiving status <domain-id>` to read a domain's receiving prerequisites in
430
+ order: sending verified, a destination, receiving enabled, and the inbound MX, which it looks up
431
+ live and names when mail is routed elsewhere.
432
+ `samva email receiving enable <domain-id> --domain <name> --catch-all [--endpoint <webhook-id>]`
433
+ routes every address on a verified domain. A catch-all needs a destination, either `--endpoint` or
434
+ an active forwarding rule that covers the domain; mail that matches neither is rejected. Pass
435
+ `--address` for exact recipients instead. The command acts by default; its `--dry-run` is offline
436
+ and does not require credentials or call the API.
437
+
431
438
  A command that needs a subcommand, such as a bare `samva` or a group like `samva email`, prints its
432
439
  help to stdout and exits `2`, so a script never mistakes a missing subcommand for success.