shipmail-cli 0.1.10 → 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.
Files changed (3) hide show
  1. package/README.md +11 -2
  2. package/dist/cli.js +78 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -34,6 +34,9 @@ shipmail mailboxes resume mbx_123
34
34
  shipmail mailboxes forwarding-add mbx_123 --destination owner@example.net
35
35
  shipmail mailboxes forwarding mbx_123
36
36
  shipmail mailboxes forwarding-remove mbx_123 fwd_123
37
+ shipmail mailboxes app-passwords list mbx_123
38
+ shipmail mailboxes app-passwords create mbx_123 --name "Desktop mail" --expires-at 2026-10-01T00:00:00Z
39
+ shipmail mailboxes app-passwords revoke mbx_123 appwd_123
37
40
 
38
41
  # Send email
39
42
  shipmail messages send \
@@ -55,6 +58,8 @@ shipmail mailboxes sandbox-inbound mbx_123 --from customer@example.com --subject
55
58
  # Read inbound mail
56
59
  shipmail inbox list mbx_123 --folder-role inbox --limit 25
57
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"
58
63
 
59
64
  # Find newsletter sending domain IDs, then create a draft with blocks
60
65
  shipmail newsletter-domains list
@@ -65,6 +70,7 @@ shipmail newsletters create \
65
70
  --subject "What shipped in July" \
66
71
  --blocks @blocks.json
67
72
  shipmail newsletters update nws_123 --subject "Updated subject"
73
+ # A concurrent update exits with conflict (409); fetch the latest newsletter before retrying.
68
74
  shipmail newsletters preview nws_123
69
75
  shipmail newsletters test-send nws_123 --recipient-email owner@example.com
70
76
  shipmail newsletters preflight nws_123
@@ -83,6 +89,8 @@ shipmail webhooks replay-delivery whk_123 dlv_123 --idempotency-key replay-123
83
89
  # Partner beta lifecycle and delegated infrastructure
84
90
  shipmail partner organizations create --name "Operator" --external-reference operator_123 --owner-email owner@example.com --mailbox-limit 3 --data-classification internal_test
85
91
  shipmail partner usage
92
+ shipmail partner credential-grants list
93
+ shipmail partner credential-grants consume grant_123 --name "Embedded webmail"
86
94
  shipmail domains list --organization-id 00000000-0000-4000-8000-000000000123
87
95
  shipmail mailboxes create --organization-id 00000000-0000-4000-8000-000000000123 --domain-id dom_123 --address support --generate-password
88
96
  ```
@@ -110,8 +118,8 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
110
118
  - `status`
111
119
  - `api <METHOD> <PATH>`
112
120
  - `domains list|search|create|get|verify|delete`
113
- - `mailboxes list|create|get|suspend|resume|forwarding|forwarding-add|forwarding-remove|folders|identities|rules`
114
- - `inbox list|thread|update|move`
121
+ - `mailboxes list|create|get|suspend|resume|forwarding|forwarding-add|forwarding-remove|app-passwords|folders|identities|rules`
122
+ - `inbox list|thread|reply-message|reply-thread|update|move`
115
123
  - `messages send|list|get|reply` (test keys also support `--sandbox-outcome`)
116
124
  - `mailboxes sandbox-inbound`
117
125
  - `webhooks list|create|test|deliveries|replay-delivery`
@@ -120,6 +128,7 @@ Use repeatable `--header "Name: value"` flags for request headers. Use `--output
120
128
  - `newsletters create|update|preview|preflight|test-send|schedule|cancel|resume`
121
129
  - `newsletter-assets list|upload|register-url`
122
130
  - `partner organizations list|create|get|update|invite|suspend|resume|offboard`
131
+ - `partner credential-grants list|consume`
123
132
  - `partner usage`
124
133
 
125
134
  Run `shipmail --help` for flags and examples.
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.1.10";
16
+ var VERSION = "0.2.1";
17
17
 
18
18
  // src/cli.ts
19
19
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -330,6 +330,9 @@ Usage:
330
330
  shipmail mailboxes resume <id>
331
331
  shipmail mailboxes export <id>
332
332
  shipmail mailboxes export-status <id> <export-id>
333
+ shipmail mailboxes app-passwords list <id>
334
+ shipmail mailboxes app-passwords create <id> --name "Desktop mail" [--expires-at 2026-10-01T00:00:00Z] [--allowed-cidr 203.0.113.0/24]
335
+ shipmail mailboxes app-passwords revoke <id> <app-password-id>
333
336
  shipmail mailboxes folders <id>
334
337
  shipmail mailboxes identities <id>
335
338
  shipmail mailboxes rules <id>
@@ -339,6 +342,8 @@ Usage:
339
342
  shipmail mailboxes sandbox-inbound <id> --from sender@example.com --subject "Test" (--text "Hello" | --html "<p>Hello</p>") [--to support@example.com]
340
343
  shipmail inbox list <mailbox-id> [--folder-role inbox] [--limit 25]
341
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>")
342
347
  shipmail inbox update <mailbox-id> <message-id> [--read true] [--starred false]
343
348
  shipmail inbox move <mailbox-id> <message-id> (--target-role archive | --target-folder-id fld)
344
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']
@@ -399,6 +404,8 @@ Usage:
399
404
  shipmail partner organizations suspend <id>
400
405
  shipmail partner organizations resume <id>
401
406
  shipmail partner organizations offboard <id>
407
+ shipmail partner credential-grants list
408
+ shipmail partner credential-grants consume <grant-id> [--name "Marketstead webmail"] [--expires-at 2026-10-01T00:00:00Z] [--allowed-cidr 203.0.113.0/24]
402
409
  shipmail partner usage
403
410
 
404
411
  Booking page conferencing:
@@ -677,6 +684,32 @@ async function runMailboxes(client, parsed, out) {
677
684
  );
678
685
  return;
679
686
  }
687
+ if (subcommand === "app-passwords") {
688
+ const command = requirePositional(parsed.positional, 2, "app-password command");
689
+ const mailboxId = requirePositional(parsed.positional, 3, "mailbox id");
690
+ if (command === "list") {
691
+ writeJson(out, await client.mailboxes.listAppPasswords(mailboxId));
692
+ return;
693
+ }
694
+ if (command === "create") {
695
+ const expiresAt = getString(parsed.options, "expires-at");
696
+ const allowedCidrs = getStringList(parsed.options, "allowed-cidr");
697
+ const params = {
698
+ name: getRequiredString(parsed.options, "name"),
699
+ ...expiresAt ? { expires_at: expiresAt } : {},
700
+ ...allowedCidrs.length > 0 ? { allowed_cidrs: allowedCidrs } : {}
701
+ };
702
+ writeJson(out, await client.mailboxes.createAppPassword(mailboxId, params));
703
+ return;
704
+ }
705
+ if (command === "revoke") {
706
+ const appPasswordId = requirePositional(parsed.positional, 4, "app password id");
707
+ await client.mailboxes.revokeAppPassword(mailboxId, appPasswordId);
708
+ writeJson(out, { ok: true, id: appPasswordId });
709
+ return;
710
+ }
711
+ throw new CliUsageError("Unknown mailboxes app-passwords command.");
712
+ }
680
713
  if (subcommand === "folders") {
681
714
  writeJson(
682
715
  out,
@@ -774,6 +807,28 @@ async function runInbox(client, parsed, out) {
774
807
  );
775
808
  return;
776
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
+ }
777
832
  if (subcommand === "update") {
778
833
  const read = getBoolean(parsed.options, "read");
779
834
  const starred = getBoolean(parsed.options, "starred");
@@ -1471,6 +1526,28 @@ async function runPartner(client, parsed, out) {
1471
1526
  writeJson(out, await client.partner.usage());
1472
1527
  return;
1473
1528
  }
1529
+ if (group === "credential-grants") {
1530
+ const command2 = requirePositional(parsed.positional, 2, "credential grant command");
1531
+ if (command2 === "list") {
1532
+ writeJson(out, await client.partner.listMailboxCredentialGrants());
1533
+ return;
1534
+ }
1535
+ if (command2 !== "consume")
1536
+ throw new CliUsageError("Unknown partner credential-grants command.");
1537
+ const grantId = requirePositional(parsed.positional, 3, "credential grant id");
1538
+ const name = getString(parsed.options, "name");
1539
+ const expiresAt = getString(parsed.options, "expires-at");
1540
+ const allowedCidrs = getStringList(parsed.options, "allowed-cidr");
1541
+ writeJson(
1542
+ out,
1543
+ await client.partner.consumeMailboxCredentialGrant(grantId, {
1544
+ ...name ? { name } : {},
1545
+ ...expiresAt ? { expires_at: expiresAt } : {},
1546
+ ...allowedCidrs.length > 0 ? { allowed_cidrs: allowedCidrs } : {}
1547
+ })
1548
+ );
1549
+ return;
1550
+ }
1474
1551
  if (group !== "organizations") throw new CliUsageError("Unknown partner command.");
1475
1552
  const command = parsed.positional[2];
1476
1553
  if (command === "list") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipmail-cli",
3
- "version": "0.1.10",
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.1.33"
44
+ "shipmail": "0.2.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",