shipmail-cli 0.4.11 → 0.4.13

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 (2) hide show
  1. package/dist/cli.js +66 -5
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  } from "shipmail";
15
15
 
16
16
  // src/version.ts
17
- var VERSION = "0.4.11";
17
+ var VERSION = "0.4.13";
18
18
 
19
19
  // src/cli.ts
20
20
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -360,6 +360,8 @@ Usage:
360
360
  shipmail mailboxes resume <id>
361
361
  shipmail mailboxes export <id>
362
362
  shipmail mailboxes export-status <id> <export-id>
363
+ shipmail mailboxes import-resume <id> <import-id>
364
+ shipmail mailboxes import-restore <id> <import-id> --file-id impf_...
363
365
  shipmail mailboxes app-passwords list <id>
364
366
  shipmail mailboxes app-passwords create <id> --name "Desktop mail" [--expires-at 2026-10-01T00:00:00Z] [--allowed-cidr 203.0.113.0/24]
365
367
  shipmail mailboxes app-passwords revoke <id> <app-password-id>
@@ -372,6 +374,9 @@ Usage:
372
374
  shipmail mailboxes prepare-attachment-upload <id> <file> [--filename name] [--content-type type]
373
375
  shipmail mailboxes stage-attachment <id> <file> [--filename name] [--content-type type]
374
376
  shipmail mailboxes sandbox-inbound <id> --from sender@example.com --subject "Test" (--text "Hello" | --html "<p>Hello</p>") [--to support@example.com]
377
+ shipmail members list [--limit 25] [--cursor cur]
378
+ shipmail members get <id>
379
+ shipmail members update <id> --away-from ISO|null --away-until ISO|null
375
380
  shipmail inbox list <mailbox-id> [--folder-role inbox] [--search text] [--after ISO] [--before ISO] [--limit 25] [--cursor cur]
376
381
  shipmail inbox message <mailbox-id> <message-id>
377
382
  shipmail inbox threads <mailbox-id> [--attention-state needs_reply] [--after ISO] [--before ISO] [--limit 25] [--cursor cur]
@@ -379,15 +384,15 @@ Usage:
379
384
  shipmail inbox thread-attention <mailbox-id> <thread-id> --done true --expected-version 3
380
385
  shipmail inbox draft <mailbox-id> <thread-id> --expected-version 3 (--text "Hello" | --html "<p>Hello</p>") [--reply-mode reply_all]
381
386
  shipmail inbox send-draft <mailbox-id> <thread-id> <draft-id>
382
- shipmail inbox reply-message <mailbox-id> <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>")
383
- shipmail inbox reply-thread <mailbox-id> <thread-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>")
387
+ shipmail inbox reply-message <mailbox-id> <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--track-reply]
388
+ shipmail inbox reply-thread <mailbox-id> <thread-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--track-reply]
384
389
  shipmail inbox update <mailbox-id> <message-id> [--read true] [--starred false]
385
390
  shipmail inbox move <mailbox-id> <message-id> (--target-role archive | --target-folder-id fld)
386
- 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']
391
+ shipmail messages send --mailbox-id mbx --to user@example.com --subject "Hi" --text "Hello" [--track-reply] [--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']
387
392
  shipmail messages list (--mailbox-id mbx | --client-reference crm-123) [--limit 25] [--cursor cur]
388
393
  shipmail messages analytics [--updated-after ISO] [--updated-before ISO] [--limit 100] [--cursor cur]
389
394
  shipmail messages get <message-id>
390
- shipmail messages reply <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--client-reference crm-reply-123]
395
+ shipmail messages reply <message-id> --to user@example.com (--text "Hello" | --html "<p>Hello</p>") [--track-reply] [--client-reference crm-reply-123]
391
396
  shipmail scheduled-messages list [--include-held] [--search text] [--limit 100]
392
397
  shipmail scheduled-messages get <message-id>
393
398
  shipmail scheduled-messages update <message-id> --to user@example.com --subject "Hi" --scheduled-at ISO (--text "Hello" | --html "<p>Hello</p>") [--staged-attachment-id sat_...]
@@ -581,6 +586,7 @@ async function sendMessageParams(options) {
581
586
  ...headers.length > 0 ? { headers } : {},
582
587
  ...getStringList(options, "staged-attachment-id").length > 0 ? { staged_attachment_ids: getStringList(options, "staged-attachment-id") } : {},
583
588
  ...getString(options, "scheduled-at") ? { scheduled_at: getString(options, "scheduled-at") } : {},
589
+ ...getBoolean(options, "track-reply") ? { track_reply: true } : {},
584
590
  ...getString(options, "sandbox-outcome") ? {
585
591
  sandbox_outcome: getEnum(options, "sandbox-outcome", [
586
592
  "delivered",
@@ -609,6 +615,7 @@ async function replyToMessageParams(options) {
609
615
  ...getString(options, "source-rfc-message-id") ? { source_rfc_message_id: getString(options, "source-rfc-message-id") } : {},
610
616
  ...headers.length > 0 ? { headers } : {},
611
617
  ...getString(options, "scheduled-at") ? { scheduled_at: getString(options, "scheduled-at") } : {},
618
+ ...getBoolean(options, "track-reply") ? { track_reply: true } : {},
612
619
  ...getString(options, "sandbox-outcome") ? {
613
620
  sandbox_outcome: getEnum(options, "sandbox-outcome", [
614
621
  "delivered",
@@ -749,6 +756,28 @@ async function runMailboxes(client, parsed, out) {
749
756
  );
750
757
  return;
751
758
  }
759
+ if (subcommand === "import-resume") {
760
+ writeJson(
761
+ out,
762
+ await client.mailboxes.resumeImport(
763
+ requirePositional(parsed.positional, 2, "mailbox id"),
764
+ requirePositional(parsed.positional, 3, "import id")
765
+ )
766
+ );
767
+ return;
768
+ }
769
+ if (subcommand === "import-restore") {
770
+ const fileIds = getStringList(parsed.options, "file-id");
771
+ writeJson(
772
+ out,
773
+ await client.mailboxes.restoreImport(
774
+ requirePositional(parsed.positional, 2, "mailbox id"),
775
+ requirePositional(parsed.positional, 3, "import id"),
776
+ { file_ids: fileIds }
777
+ )
778
+ );
779
+ return;
780
+ }
752
781
  if (subcommand === "app-passwords") {
753
782
  const command = requirePositional(parsed.positional, 2, "app-password command");
754
783
  const mailboxId = requirePositional(parsed.positional, 3, "mailbox id");
@@ -1242,6 +1271,37 @@ async function runWebhooks(client, parsed, out) {
1242
1271
  }
1243
1272
  throw new CliUsageError("Unknown webhooks command.");
1244
1273
  }
1274
+ async function runMembers(client, parsed, out) {
1275
+ const subcommand = parsed.positional[1];
1276
+ if (subcommand === "list") {
1277
+ writeJson(
1278
+ out,
1279
+ await client.members.list({
1280
+ cursor: getString(parsed.options, "cursor"),
1281
+ limit: getNumber(parsed.options, "limit")
1282
+ })
1283
+ );
1284
+ return;
1285
+ }
1286
+ const memberId = requirePositional(parsed.positional, 2, "member id");
1287
+ if (subcommand === "get") {
1288
+ writeJson(out, await client.members.get(memberId));
1289
+ return;
1290
+ }
1291
+ if (subcommand === "update") {
1292
+ const awayFrom = getRequiredString(parsed.options, "away-from");
1293
+ const awayUntil = getRequiredString(parsed.options, "away-until");
1294
+ writeJson(
1295
+ out,
1296
+ await client.members.update(memberId, {
1297
+ away_from: awayFrom === "null" ? null : awayFrom,
1298
+ away_until: awayUntil === "null" ? null : awayUntil
1299
+ })
1300
+ );
1301
+ return;
1302
+ }
1303
+ throw new CliUsageError("Unknown members command.");
1304
+ }
1245
1305
  async function runSuppressions(client, parsed, out) {
1246
1306
  const subcommand = parsed.positional[1];
1247
1307
  if (subcommand === "list") {
@@ -2149,6 +2209,7 @@ async function runCli(argv, options = {}) {
2149
2209
  if (command === "automations") await runAutomations(client, parsed, out);
2150
2210
  else if (command === "domains") await runDomains(client, parsed, out);
2151
2211
  else if (command === "mailboxes") await runMailboxes(client, parsed, out);
2212
+ else if (command === "members") await runMembers(client, parsed, out);
2152
2213
  else if (command === "inbox") await runInbox(client, parsed, out);
2153
2214
  else if (command === "messages") await runMessages(client, parsed, out);
2154
2215
  else if (command === "scheduled-messages") await runScheduledMessages(client, parsed, out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipmail-cli",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
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.4.17"
44
+ "shipmail": "0.4.22"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",