groundmail-cli 0.22.0 → 0.23.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 +24 -3
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -927,7 +927,9 @@ var POSITIONAL_FLAGS3 = [
927
927
  "--tls-mode",
928
928
  "--open-tracking",
929
929
  "--click-tracking",
930
- "--inbound"
930
+ "--inbound",
931
+ "--inbound-spam-threshold",
932
+ "--inbound-spam-action"
931
933
  ];
932
934
  function readFirstPositional4(args) {
933
935
  for (let i = 0; i < args.length; i += 1) {
@@ -968,10 +970,29 @@ async function runUpdateCommand2(args, env = process.env) {
968
970
  if (clickTracking !== void 0) payload.click_tracking = clickTracking;
969
971
  const inbound = parseBooleanFlag(readFlag10(args, "--inbound"), "--inbound");
970
972
  if (inbound !== void 0) payload.inbound_enabled = inbound;
973
+ const spamThreshold = readFlag10(args, "--inbound-spam-threshold");
974
+ if (spamThreshold != null) {
975
+ if (spamThreshold === "default" || spamThreshold === "null") {
976
+ payload.inbound_spam_threshold = null;
977
+ } else {
978
+ const value = Number(spamThreshold);
979
+ if (!Number.isFinite(value) || value < 1 || value > 100) {
980
+ return { exitCode: 1, error: "--inbound-spam-threshold must be a number from 1 to 100, or default" };
981
+ }
982
+ payload.inbound_spam_threshold = value;
983
+ }
984
+ }
985
+ const spamAction = readFlag10(args, "--inbound-spam-action");
986
+ if (spamAction != null) {
987
+ if (spamAction !== "flag" && spamAction !== "drop") {
988
+ return { exitCode: 1, error: "--inbound-spam-action must be flag or drop" };
989
+ }
990
+ payload.inbound_spam_action = spamAction;
991
+ }
971
992
  if (!Object.keys(payload).length) {
972
993
  return {
973
994
  exitCode: 1,
974
- error: "No updates provided. Pass --inbound true|false, --tls-mode opportunistic|enforced, --open-tracking true|false, or --click-tracking true|false."
995
+ error: "No updates provided. Pass --inbound true|false, --tls-mode opportunistic|enforced, --open-tracking true|false, --click-tracking true|false, --inbound-spam-threshold <1-100|default>, or --inbound-spam-action flag|drop."
975
996
  };
976
997
  }
977
998
  const client2 = await createDomainsClient(apiKey, options.baseUrl);
@@ -1420,7 +1441,7 @@ function trimUrl(value) {
1420
1441
  }
1421
1442
 
1422
1443
  // package.json
1423
- var version = "0.22.0";
1444
+ var version = "0.23.0";
1424
1445
 
1425
1446
  // src/user-agent.ts
1426
1447
  function buildUserAgent(own) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-cli",
3
- "version": "0.22.0",
3
+ "version": "0.23.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.19.0"
41
+ "groundmail": "0.20.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsup": "^8.5.0",