shipmail-cli 0.4.12 → 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 +36 -1
  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.12";
17
+ var VERSION = "0.4.13";
18
18
 
19
19
  // src/cli.ts
20
20
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
@@ -374,6 +374,9 @@ Usage:
374
374
  shipmail mailboxes prepare-attachment-upload <id> <file> [--filename name] [--content-type type]
375
375
  shipmail mailboxes stage-attachment <id> <file> [--filename name] [--content-type type]
376
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
377
380
  shipmail inbox list <mailbox-id> [--folder-role inbox] [--search text] [--after ISO] [--before ISO] [--limit 25] [--cursor cur]
378
381
  shipmail inbox message <mailbox-id> <message-id>
379
382
  shipmail inbox threads <mailbox-id> [--attention-state needs_reply] [--after ISO] [--before ISO] [--limit 25] [--cursor cur]
@@ -1268,6 +1271,37 @@ async function runWebhooks(client, parsed, out) {
1268
1271
  }
1269
1272
  throw new CliUsageError("Unknown webhooks command.");
1270
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
+ }
1271
1305
  async function runSuppressions(client, parsed, out) {
1272
1306
  const subcommand = parsed.positional[1];
1273
1307
  if (subcommand === "list") {
@@ -2175,6 +2209,7 @@ async function runCli(argv, options = {}) {
2175
2209
  if (command === "automations") await runAutomations(client, parsed, out);
2176
2210
  else if (command === "domains") await runDomains(client, parsed, out);
2177
2211
  else if (command === "mailboxes") await runMailboxes(client, parsed, out);
2212
+ else if (command === "members") await runMembers(client, parsed, out);
2178
2213
  else if (command === "inbox") await runInbox(client, parsed, out);
2179
2214
  else if (command === "messages") await runMessages(client, parsed, out);
2180
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.12",
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.20"
44
+ "shipmail": "0.4.22"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.4.0",