groundmail-cli 0.38.0 → 0.40.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 +20 -8
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -2106,7 +2106,7 @@ function trimUrl(value) {
2106
2106
  }
2107
2107
 
2108
2108
  // package.json
2109
- var version = "0.38.0";
2109
+ var version = "0.40.0";
2110
2110
 
2111
2111
  // src/user-agent.ts
2112
2112
  function buildUserAgent(own) {
@@ -4609,11 +4609,12 @@ async function runMigrateCommand(provider, args, env = process.env) {
4609
4609
  var MISSING_KEY4 = "Missing API key. Set GROUNDMAIL_API_KEY, pass --api-key, or run `groundmail login`.";
4610
4610
  var USAGE = [
4611
4611
  "Usage: groundmail burrowguard sites [list]",
4612
- ' groundmail burrowguard sites create --name "Sign-up form" --hostname app.example.com [--hostname localhost] [--block-free-webmail] [--allow-data-center-ips]',
4612
+ ' groundmail burrowguard sites create --name "Sign-up form" --hostname app.example.com [--hostname localhost] [--block-free-webmail] [--allow-data-center-ips] [--watch-only]',
4613
4613
  ' groundmail burrowguard sites create --name "Contact form" --email-checks-only',
4614
+ " groundmail burrowguard sites update <id> --watch-only | --no-watch-only",
4614
4615
  " groundmail burrowguard sites delete <id> --yes",
4615
4616
  " groundmail burrowguard sites roll-secret <id> --yes",
4616
- " groundmail burrowguard checks [--site <id>] [--result passed|blocked|no_token] [--range 24h|7d|30d] [--limit 25]"
4617
+ " groundmail burrowguard checks [--site <id>] [--result passed|blocked|would_block|no_token] [--range 24h|7d|30d] [--limit 25]"
4617
4618
  ].join("\n");
4618
4619
  function readAll(args, flag) {
4619
4620
  return args.flatMap((arg, index) => arg === flag && args[index + 1] ? [args[index + 1]] : []);
@@ -4649,10 +4650,20 @@ ${USAGE}` };
4649
4650
  ...hostnames.length > 0 ? { allowed_hostnames: hostnames } : {},
4650
4651
  ...emailOnly ? { email_checks_only: true } : {},
4651
4652
  ...rest.includes("--block-free-webmail") ? { block_free_webmail: true } : {},
4652
- ...rest.includes("--allow-data-center-ips") ? { allow_data_center_ips: true } : {}
4653
+ ...rest.includes("--allow-data-center-ips") ? { allow_data_center_ips: true } : {},
4654
+ ...rest.includes("--watch-only") ? { watch_only: true } : {}
4653
4655
  })
4654
4656
  );
4655
4657
  }
4658
+ if (action === "update") {
4659
+ const id = rest[0] && !rest[0].startsWith("--") ? rest[0] : void 0;
4660
+ if (!id) return { exitCode: 1, error: `Missing site id.
4661
+ ${USAGE}` };
4662
+ const on = rest.includes("--watch-only");
4663
+ if (on === rest.includes("--no-watch-only")) return { exitCode: 1, error: `Pass --watch-only or --no-watch-only.
4664
+ ${USAGE}` };
4665
+ return withClient4(rest, env, (client2) => client2.burrowguard.sites.update(id, { watch_only: on }));
4666
+ }
4656
4667
  if (action === "delete" || action === "roll-secret") {
4657
4668
  const id = rest[0] && !rest[0].startsWith("--") ? rest[0] : void 0;
4658
4669
  if (!id) return { exitCode: 1, error: `Missing site id.
@@ -4674,8 +4685,8 @@ ${USAGE}` };
4674
4685
  }
4675
4686
  function runChecks(args, env) {
4676
4687
  const result = readFlag19(args, "--result");
4677
- if (result && !["passed", "blocked", "no_token"].includes(result)) {
4678
- return Promise.resolve({ exitCode: 1, error: "--result must be passed, blocked or no_token" });
4688
+ if (result && !["passed", "blocked", "would_block", "no_token"].includes(result)) {
4689
+ return Promise.resolve({ exitCode: 1, error: "--result must be passed, blocked, would_block or no_token" });
4679
4690
  }
4680
4691
  const range = readFlag19(args, "--range");
4681
4692
  if (range && !["24h", "7d", "30d"].includes(range)) {
@@ -4957,10 +4968,11 @@ var USAGE_LINES = [
4957
4968
  " groundmail webhooks deliveries resend --webhook <webhook-id> --id <delivery-id>",
4958
4969
  " groundmail validate user@example.com Groundmail validation: verdict, reasons, typo suggestion (exit 2 when invalid)",
4959
4970
  " groundmail burrowguard sites the forms BurrowGuard protects",
4960
- ' groundmail burrowguard sites create --name "Sign-up form" --hostname app.example.com [--hostname localhost] [--block-free-webmail] [--allow-data-center-ips] [--email-checks-only] prints the secret once',
4971
+ ' groundmail burrowguard sites create --name "Sign-up form" --hostname app.example.com [--hostname localhost] [--block-free-webmail] [--allow-data-center-ips] [--email-checks-only] [--watch-only] prints the secret once',
4972
+ " groundmail burrowguard sites update <id> --watch-only | --no-watch-only show what would be blocked without blocking anyone, or start blocking",
4961
4973
  " groundmail burrowguard sites roll-secret <id> --yes the old secret stops working at once",
4962
4974
  " groundmail burrowguard sites delete <id> --yes",
4963
- " groundmail burrowguard checks [--site <id>] [--result passed|blocked|no_token] [--range 24h|7d|30d] [--limit 25]",
4975
+ " groundmail burrowguard checks [--site <id>] [--result passed|blocked|would_block|no_token] [--range 24h|7d|30d] [--limit 25]",
4964
4976
  " groundmail suppressions list [--tenant <tenant>]",
4965
4977
  " groundmail suppressions add --email user@example.com [--reason \u2026] [--tenant <tenant>]",
4966
4978
  " groundmail suppressions remove --id <id> | --email user@example.com [--tenant <tenant>]",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-cli",
3
- "version": "0.38.0",
3
+ "version": "0.40.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.41.0"
41
+ "groundmail": "0.43.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsup": "^8.5.0",