@samva/cli 0.15.0 → 0.17.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.
- package/AGENTS.md +23 -7
- package/dist/bin.mjs +1407 -323
- package/package.json +7 -7
package/AGENTS.md
CHANGED
|
@@ -21,9 +21,15 @@ response writes its body to stderr and exits `4` for 401 and 403, otherwise `1`.
|
|
|
21
21
|
is no built-in filter.
|
|
22
22
|
|
|
23
23
|
`samva api-keys` manages the organization's keys: `list`, `get`, `create`, `update`, `rotate`, and
|
|
24
|
-
`revoke`. `create` takes `--name` and
|
|
25
|
-
<resource>=read|write`
|
|
26
|
-
|
|
24
|
+
`revoke`. `create` takes `--name` and either `--full-access` or restricted access built from repeatable
|
|
25
|
+
`--grant <resource>=read|write` and mailbox access: repeatable `--mailbox-permission
|
|
26
|
+
read|update|send|quarantine.read`, optionally narrowed to repeatable `--mailbox <id>` (default:
|
|
27
|
+
every mailbox the owner reaches) with `--send-mode approval` (each send waits for a person other
|
|
28
|
+
than the key). `--namespace <id>` confines a restricted key to one namespace. Passing no access, or both
|
|
29
|
+
`--full-access` and restricted access, exits `2`, as does `--mailbox` or `--send-mode` without a
|
|
30
|
+
`--mailbox-permission`. `--description` and `--expires-at` are optional. `update` renames a key,
|
|
31
|
+
sets its description, or changes a mailbox key's `--send-mode` (a person signed in with `samva
|
|
32
|
+
login`); every other part of a key's access is fixed at creation. The API refuses a key with more access than the
|
|
27
33
|
caller holds. `create` and `rotate` return the secret once: `--json` carries `{apiKey, key,
|
|
28
34
|
displayOnce, warning}`, so `samva api-keys create ... --json | jq -r .data.key` yields the key, and
|
|
29
35
|
human mode prints it to stdout with the warning on stderr. `rotate` and `revoke` require
|
|
@@ -136,7 +142,10 @@ calls to you, rather than to an installation. Read what exists with `list`, `ver
|
|
|
136
142
|
`run <id> <run-id>` (adds the handler's log lines); the list commands page with `--limit`,
|
|
137
143
|
`--cursor`, and `--all --jsonl`.
|
|
138
144
|
|
|
139
|
-
`samva mailboxes` reads and sends as a mailbox
|
|
145
|
+
`samva mailboxes` reads and sends as a mailbox. Every command except `list` and `create`
|
|
146
|
+
takes the mailbox ID as its first argument and the message, action, or endpoint ID second,
|
|
147
|
+
as in `read <mailbox-id> <message-id>` and `endpoints update <mailbox-id> <endpoint-id>`; `events`
|
|
148
|
+
takes any number of mailbox IDs, or none for every mailbox the credential reads. `list` pages with `--limit`, `--cursor`, `--after`,
|
|
140
149
|
and `--before`. `create --address <address> --name <name>` makes a mailbox with one email endpoint; the
|
|
141
150
|
slug defaults to the address's local part, and a collision asks for `--slug` rather than suffixing.
|
|
142
151
|
`get <id>` inspects a mailbox; `update <id> --data <JSON-or-@file>` changes
|
|
@@ -146,12 +155,19 @@ stops sending and receiving, and `resume <id>` resumes without backfilling mail
|
|
|
146
155
|
paused. These mutations support `--dry-run`. `remove <id>` deletes a mailbox (`--yes` outside a terminal, `--dry-run` to
|
|
147
156
|
preview), `threads` searches, `read` prints a message (human output marks the body as
|
|
148
157
|
untrusted email), and `send` and `reply` take `--idempotency-key` so a retry cannot send twice.
|
|
158
|
+
`create`, `endpoints add`, and `send` take `--channel email|whatsapp|sms` (default `email`); on a
|
|
159
|
+
phone channel the address is a connected number in E.164 form, and `send` takes one `--to` number
|
|
160
|
+
with `--text` or, on WhatsApp, an approved `--template <templateId>` with `--data`. `reply` answers a
|
|
161
|
+
WhatsApp or SMS message on its thread; a bare `--text` reply reads the message first to learn its
|
|
162
|
+
channel. Free-form WhatsApp text outside the customer's 24-hour window fails with
|
|
163
|
+
`WhatsAppServiceWindowClosedError`; send a template. These commands call the API directly because the
|
|
164
|
+
public SDK describes email only.
|
|
149
165
|
Quarantine `list` pages the same way, bounded by `--after` and `--before` on when a message was
|
|
150
166
|
held; `release` and `discard` take the held message's `id` and require a person signed in with
|
|
151
167
|
`samva login`. Discard requires confirmation (`--yes` outside a terminal) and supports `--dry-run`.
|
|
152
|
-
`actions list
|
|
153
|
-
`--all --jsonl`. `actions approve <
|
|
154
|
-
|
|
168
|
+
`actions list <mailbox-id>` filters by `--state` and pages with `--limit`, `--cursor`, and
|
|
169
|
+
`--all --jsonl`. `actions approve <mailbox-id> <action-id>` and `actions deny <mailbox-id>
|
|
170
|
+
<action-id> [--reason <text>]` require a person different from the proposer, confirmation
|
|
155
171
|
(`--yes` outside a terminal), and offer `--dry-run`.
|
|
156
172
|
Human mailbox and extension results retain the same facts as JSON: mailbox endpoints (channel, address,
|
|
157
173
|
sender name, default), thread state and activity, message bodies, attachments, authentication and actor,
|