groundmail-cli 0.44.0 → 0.46.0

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 +25 -2
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -2090,7 +2090,7 @@ async function runListKeysCommandWithClient(args, env = process.env) {
2090
2090
  }
2091
2091
 
2092
2092
  // package.json
2093
- var version = "0.44.0";
2093
+ var version = "0.46.0";
2094
2094
 
2095
2095
  // src/help.ts
2096
2096
  var USAGE_LINES = [
@@ -2124,6 +2124,7 @@ var USAGE_LINES = [
2124
2124
  " groundmail mailboxes create [--local-part signup-bot] [--domain agents.example.com] [--display-name \u2026] [--external-id \u2026] [--tenant <tenant>] [--retention-days 7] [--spam-threshold 5] [--metadata JSON] [--forward-from <mailbox>] [--json] a real address your agent reads and sends from; no --domain: a hosted address, which can only reply; --forward-from: a hosted mailbox this one replaces",
2125
2125
  " groundmail mailboxes list [--tenant <tenant>] [--limit 25] [--cursor \u2026] [--json]",
2126
2126
  " groundmail mailboxes get <mailbox> [--json]",
2127
+ " groundmail mailboxes update <mailbox> [--send-as support@example.com] [--allowed-senders you@example.com,example.com] [--blocked-senders spam.example] none clears one",
2127
2128
  " groundmail mailboxes delete <mailbox> --yes the mailbox and all its mail; a hosted address is never given out again",
2128
2129
  " groundmail mailboxes forward <mailbox> --to <new mailbox> --yes move a hosted address to a mailbox on your own domain, for 30 days; it can't send meanwhile",
2129
2130
  " groundmail mailboxes threads <mailbox> [--label \u2026] [--participant \u2026] [--unread] [--archived] [--since <iso>] [--include-held] [--limit 25] [--cursor \u2026] [--json]",
@@ -5161,6 +5162,9 @@ async function runTestInboxCommand(subcommand, args, env = process.env) {
5161
5162
 
5162
5163
  // src/commands/mailboxes/mailboxes.ts
5163
5164
  var VALUE_FLAGS6 = [
5165
+ "--send-as",
5166
+ "--allowed-senders",
5167
+ "--blocked-senders",
5164
5168
  "--api-key",
5165
5169
  "--base-url",
5166
5170
  "--workspace",
@@ -5319,6 +5323,10 @@ function createParams(args) {
5319
5323
  ...v["--forward-from"] ? { forward_from: v["--forward-from"] } : {}
5320
5324
  };
5321
5325
  }
5326
+ function senderList(value) {
5327
+ if (value === void 0) return void 0;
5328
+ return value === "none" ? [] : value.split(/[\s,]+/).filter(Boolean);
5329
+ }
5322
5330
  function paging(args) {
5323
5331
  const limit = numberFlag(args, "--limit");
5324
5332
  if (typeof limit === "object") return limit;
@@ -5349,7 +5357,7 @@ async function createInstant(args) {
5349
5357
  }
5350
5358
  }
5351
5359
  async function runMailboxesCommand(subcommand, argv, env = process.env) {
5352
- if (!subcommand || !["create", "owner", "verify", "list", "get", "delete", "forward", "threads", "read", "wait", "send", "reply"].includes(subcommand)) {
5360
+ if (!subcommand || !["create", "owner", "verify", "list", "get", "update", "delete", "forward", "threads", "read", "wait", "send", "reply"].includes(subcommand)) {
5353
5361
  return { exitCode: 1, error: USAGE3 };
5354
5362
  }
5355
5363
  const parsed = parseArgs(argv, { values: VALUE_FLAGS6, booleans: BOOLEAN_FLAGS });
@@ -5403,6 +5411,21 @@ async function runMailboxesCommand(subcommand, argv, env = process.env) {
5403
5411
  print({ mailbox: found }, () => formatMailbox(found));
5404
5412
  return { exitCode: 0 };
5405
5413
  }
5414
+ if (subcommand === "update") {
5415
+ const sendAs = args.values["--send-as"];
5416
+ const allowed = senderList(args.values["--allowed-senders"]);
5417
+ const blocked = senderList(args.values["--blocked-senders"]);
5418
+ if (sendAs === void 0 && !allowed && !blocked) {
5419
+ return { exitCode: 1, error: "Nothing to change. Usage: groundmail mailboxes update <mailbox> [--send-as support@example.com] [--allowed-senders you@example.com,example.com] [--blocked-senders spam.example]. Use none to clear one." };
5420
+ }
5421
+ const updated = await client2.mailboxes.update(ref, {
5422
+ ...sendAs !== void 0 ? { send_as: sendAs === "none" ? null : sendAs } : {},
5423
+ ...allowed ? { allowed_senders: allowed } : {},
5424
+ ...blocked ? { blocked_senders: blocked } : {}
5425
+ });
5426
+ print({ mailbox: updated }, () => formatMailbox(updated));
5427
+ return { exitCode: 0 };
5428
+ }
5406
5429
  if (subcommand === "delete") {
5407
5430
  if (!on("--yes")) {
5408
5431
  return { exitCode: 1, error: "This deletes the mailbox and all its mail. Add --yes to confirm." };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-cli",
3
- "version": "0.44.0",
3
+ "version": "0.46.0",
4
4
  "description": "Groundmail CLI — send transactional email from the terminal",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "prepublishOnly": "npm run build"
39
39
  },
40
40
  "dependencies": {
41
- "groundmail": "0.46.0"
41
+ "groundmail": "0.48.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsup": "^8.5.0",