shipmail-cli 0.2.0 → 0.2.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/README.md +4 -1
- package/dist/cli.js +25 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,6 +58,8 @@ shipmail mailboxes sandbox-inbound mbx_123 --from customer@example.com --subject
|
|
|
58
58
|
# Read inbound mail
|
|
59
59
|
shipmail inbox list mbx_123 --folder-role inbox --limit 25
|
|
60
60
|
shipmail inbox thread mbx_123 thr_123
|
|
61
|
+
shipmail inbox reply-message mbx_123 eml_123 --to user@example.com --text "Thanks"
|
|
62
|
+
shipmail inbox reply-thread mbx_123 thr_123 --to user@example.com --text "Following up"
|
|
61
63
|
|
|
62
64
|
# Find newsletter sending domain IDs, then create a draft with blocks
|
|
63
65
|
shipmail newsletter-domains list
|
|
@@ -68,6 +70,7 @@ shipmail newsletters create \
|
|
|
68
70
|
--subject "What shipped in July" \
|
|
69
71
|
--blocks @blocks.json
|
|
70
72
|
shipmail newsletters update nws_123 --subject "Updated subject"
|
|
73
|
+
# A concurrent update exits with conflict (409); fetch the latest newsletter before retrying.
|
|
71
74
|
shipmail newsletters preview nws_123
|
|
72
75
|
shipmail newsletters test-send nws_123 --recipient-email owner@example.com
|
|
73
76
|
shipmail newsletters preflight nws_123
|
|
@@ -116,7 +119,7 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
|
|
|
116
119
|
- `api <METHOD> <PATH>`
|
|
117
120
|
- `domains list|search|create|get|verify|delete`
|
|
118
121
|
- `mailboxes list|create|get|suspend|resume|forwarding|forwarding-add|forwarding-remove|app-passwords|folders|identities|rules`
|
|
119
|
-
- `inbox list|thread|update|move`
|
|
122
|
+
- `inbox list|thread|reply-message|reply-thread|update|move`
|
|
120
123
|
- `messages send|list|get|reply` (test keys also support `--sandbox-outcome`)
|
|
121
124
|
- `mailboxes sandbox-inbound`
|
|
122
125
|
- `webhooks list|create|test|deliveries|replay-delivery`
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "shipmail";
|
|
14
14
|
|
|
15
15
|
// src/version.ts
|
|
16
|
-
var VERSION = "0.2.
|
|
16
|
+
var VERSION = "0.2.1";
|
|
17
17
|
|
|
18
18
|
// src/cli.ts
|
|
19
19
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -342,6 +342,8 @@ Usage:
|
|
|
342
342
|
shipmail mailboxes sandbox-inbound <id> --from sender@example.com --subject "Test" (--text "Hello" | --html "<p>Hello</p>") [--to support@example.com]
|
|
343
343
|
shipmail inbox list <mailbox-id> [--folder-role inbox] [--limit 25]
|
|
344
344
|
shipmail inbox thread <mailbox-id> <thread-id>
|
|
345
|
+
shipmail inbox reply-message <mailbox-id> <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>")
|
|
346
|
+
shipmail inbox reply-thread <mailbox-id> <thread-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>")
|
|
345
347
|
shipmail inbox update <mailbox-id> <message-id> [--read true] [--starred false]
|
|
346
348
|
shipmail inbox move <mailbox-id> <message-id> (--target-role archive | --target-folder-id fld)
|
|
347
349
|
shipmail messages send --mailbox-id mbx --to user@example.com --subject "Hi" --text "Hello" [--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']
|
|
@@ -805,6 +807,28 @@ async function runInbox(client, parsed, out) {
|
|
|
805
807
|
);
|
|
806
808
|
return;
|
|
807
809
|
}
|
|
810
|
+
if (subcommand === "reply-message") {
|
|
811
|
+
writeJson(
|
|
812
|
+
out,
|
|
813
|
+
await client.mailboxes.replyToInboxMessage(
|
|
814
|
+
requirePositional(parsed.positional, 2, "mailbox id"),
|
|
815
|
+
requirePositional(parsed.positional, 3, "message id"),
|
|
816
|
+
await replyToMessageParams(parsed.options)
|
|
817
|
+
)
|
|
818
|
+
);
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
if (subcommand === "reply-thread") {
|
|
822
|
+
writeJson(
|
|
823
|
+
out,
|
|
824
|
+
await client.mailboxes.replyToInboxThread(
|
|
825
|
+
requirePositional(parsed.positional, 2, "mailbox id"),
|
|
826
|
+
requirePositional(parsed.positional, 3, "thread id"),
|
|
827
|
+
await replyToMessageParams(parsed.options)
|
|
828
|
+
)
|
|
829
|
+
);
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
808
832
|
if (subcommand === "update") {
|
|
809
833
|
const read = getBoolean(parsed.options, "read");
|
|
810
834
|
const starred = getBoolean(parsed.options, "starred");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipmail-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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.2.
|
|
44
|
+
"shipmail": "0.2.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.4.0",
|