shipmail-cli 0.5.1 → 0.5.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 +2 -0
- package/dist/cli.js +30 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -89,6 +89,8 @@ shipmail inbox thread 550e8400-e29b-41d4-a716-446655440000 thr_123
|
|
|
89
89
|
shipmail inbox draft 550e8400-e29b-41d4-a716-446655440000 thr_123 --expected-version 7 --text "Thanks for the note"
|
|
90
90
|
# Apply your approval policy; stale drafts fail with 409 without delivery.
|
|
91
91
|
shipmail inbox send-draft 550e8400-e29b-41d4-a716-446655440000 thr_123 drf_123
|
|
92
|
+
# Save a new message to Drafts for a human to review and send; this never sends
|
|
93
|
+
shipmail inbox compose-draft 550e8400-e29b-41d4-a716-446655440000 --to user@example.com --subject "Kickoff" --text "Draft for review"
|
|
92
94
|
shipmail inbox thread-attention 550e8400-e29b-41d4-a716-446655440000 thr_123 --done true --expected-version 8
|
|
93
95
|
shipmail inbox reply-message 550e8400-e29b-41d4-a716-446655440000 eml_123 --to user@example.com --text "Thanks"
|
|
94
96
|
shipmail inbox reply-thread 550e8400-e29b-41d4-a716-446655440000 thr_123 --to user@example.com --text "Following up"
|
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "shipmail";
|
|
16
16
|
|
|
17
17
|
// src/version.ts
|
|
18
|
-
var VERSION = "0.5.
|
|
18
|
+
var VERSION = "0.5.3";
|
|
19
19
|
|
|
20
20
|
// src/cli.ts
|
|
21
21
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -385,12 +385,13 @@ Usage:
|
|
|
385
385
|
shipmail inbox thread <mailbox-id> <thread-id>
|
|
386
386
|
shipmail inbox thread-attention <mailbox-id> <thread-id> --done true --expected-version 3
|
|
387
387
|
shipmail inbox draft <mailbox-id> <thread-id> --expected-version 3 (--text "Hello" | --html "<p>Hello</p>") [--reply-mode reply_all]
|
|
388
|
+
shipmail inbox compose-draft <mailbox-id> --to user@example.com [--cc ...] [--bcc ...] [--subject "Hi"] (--text "Hello" | --html "<p>Hello</p>") [--idempotency-key key] (saves a new message to Drafts; never sends)
|
|
388
389
|
shipmail inbox send-draft <mailbox-id> <thread-id> <draft-id>
|
|
389
390
|
shipmail inbox reply-message <mailbox-id> <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--track-reply true|false]
|
|
390
391
|
shipmail inbox reply-thread <mailbox-id> <thread-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--track-reply true|false]
|
|
391
392
|
shipmail inbox update <mailbox-id> <message-id> [--read true] [--starred false]
|
|
392
393
|
shipmail inbox move <mailbox-id> <message-id> (--target-role archive | --target-folder-id fld)
|
|
393
|
-
shipmail messages send --mailbox-id mbx --to user@example.com --subject "Hi" --text "Hello" [--track-reply true|false] [--sandbox-outcome delivered|bounced|complained] [--client-reference crm-123] [--metadata JSON|@file] [--source-rfc-message-id '<crm-123@example.com>'] [--header 'X-CRM-ID: 123']
|
|
394
|
+
shipmail messages send (--mailbox-id mbx | --from 'Acme Support <hello@example.com>') --to user@example.com --subject "Hi" --text "Hello" [--track-reply true|false] [--sandbox-outcome delivered|bounced|complained] [--client-reference crm-123] [--metadata JSON|@file] [--source-rfc-message-id '<crm-123@example.com>'] [--header 'X-CRM-ID: 123']
|
|
394
395
|
shipmail messages list (--mailbox-id mbx | --client-reference crm-123) [--limit 25] [--cursor cur]
|
|
395
396
|
shipmail messages analytics [--updated-after ISO] [--updated-before ISO] [--limit 100] [--cursor cur]
|
|
396
397
|
shipmail messages get <message-id>
|
|
@@ -1069,6 +1070,33 @@ async function runInbox(client, parsed, out) {
|
|
|
1069
1070
|
);
|
|
1070
1071
|
return;
|
|
1071
1072
|
}
|
|
1073
|
+
if (subcommand === "compose-draft") {
|
|
1074
|
+
const to = messageRecipients(parsed.options, "to");
|
|
1075
|
+
const cc = messageRecipients(parsed.options, "cc");
|
|
1076
|
+
const bcc = messageRecipients(parsed.options, "bcc");
|
|
1077
|
+
const subject = getString(parsed.options, "subject");
|
|
1078
|
+
const text = await readTextInput(getString(parsed.options, "text"));
|
|
1079
|
+
const html = await readTextInput(getString(parsed.options, "html"));
|
|
1080
|
+
const idempotencyKey = getString(parsed.options, "idempotency-key");
|
|
1081
|
+
if (to.length === 0) throw new CliUsageError("Provide at least one --to recipient.");
|
|
1082
|
+
if (!text && !html) throw new CliUsageError("Provide --text or --html.");
|
|
1083
|
+
writeJson(
|
|
1084
|
+
out,
|
|
1085
|
+
await client.mailboxes.createInboxDraft(
|
|
1086
|
+
requirePositional(parsed.positional, 2, "mailbox id"),
|
|
1087
|
+
{
|
|
1088
|
+
to,
|
|
1089
|
+
...cc.length > 0 ? { cc } : {},
|
|
1090
|
+
...bcc.length > 0 ? { bcc } : {},
|
|
1091
|
+
...subject !== void 0 ? { subject } : {},
|
|
1092
|
+
...text ? { text } : {},
|
|
1093
|
+
...html ? { html } : {}
|
|
1094
|
+
},
|
|
1095
|
+
idempotencyKey ? { idempotencyKey } : void 0
|
|
1096
|
+
)
|
|
1097
|
+
);
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1072
1100
|
if (subcommand === "send-draft") {
|
|
1073
1101
|
writeJson(
|
|
1074
1102
|
out,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipmail-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Official CLI for the Shipmail API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"shipmail": "0.5.
|
|
44
|
+
"shipmail": "0.5.8"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.4.0",
|