autark-cli 0.3.2 → 0.4.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/autark.mjs +32 -2
  2. package/package.json +1 -1
package/autark.mjs CHANGED
@@ -856,10 +856,35 @@ async function mail(command, rest) {
856
856
  if (command === 'raw') return mailRaw(rest)
857
857
  if (command === 'attachment') return mailAttachment(rest)
858
858
  if (command === 'request') return mailRequest(rest)
859
+ if (command === 'suppress') return mailSuppress(rest)
860
+ if (command === 'unsuppress') return mailUnsuppress(rest)
861
+ if (command === 'suppressed') return mailSuppressed(rest)
859
862
  mailUsage()
860
863
  process.exit(1)
861
864
  }
862
865
 
866
+ async function mailSuppress(rest) {
867
+ const opts = parseArgs(rest)
868
+ const entry = required(opts.email || opts._[0], 'email')
869
+ const reason = opts.reason || 'manual'
870
+ const result = await api('POST', '/v1/suppression', { entry, reason })
871
+ printJson(result)
872
+ }
873
+
874
+ async function mailUnsuppress(rest) {
875
+ const opts = parseArgs(rest)
876
+ const entry = required(opts.email || opts._[0], 'email')
877
+ const result = await api('DELETE', `/v1/suppression/${encodeURIComponent(entry)}`)
878
+ printJson(result)
879
+ }
880
+
881
+ async function mailSuppressed(rest) {
882
+ const opts = parseArgs(rest)
883
+ const limit = opts.limit ? Number(opts.limit) : 100
884
+ const result = await api('GET', `/v1/suppression?limit=${limit}`)
885
+ printJson(result)
886
+ }
887
+
863
888
  async function mailSetup(rest) {
864
889
  const opts = parseArgs(rest)
865
890
  const existing = loadCredentials() || {}
@@ -1304,7 +1329,7 @@ function mailUsage() {
1304
1329
  console.log(`autark mail
1305
1330
 
1306
1331
  setup --prefix <name> [--force]
1307
- send --to <email[,email]> --subject <s> --text @body.txt [--run-id <id>]
1332
+ send --to <email[,email]> --subject <s> --text @body.txt [--run-id <id>] [--dry-run]
1308
1333
  reply --message-id <id> --text @reply.txt [--run-id <id>]
1309
1334
  reply-all --message-id <id> --text @reply.txt [--run-id <id>]
1310
1335
  forward --message-id <id> --to <email> [--text @body.txt] [--run-id <id>]
@@ -1315,8 +1340,13 @@ function mailUsage() {
1315
1340
  raw <message_id>
1316
1341
  attachment --message-id <id> --attachment-id <id> [--out file]
1317
1342
  request <METHOD> <path> [--body @json] [--raw]
1343
+ suppress <email> [--reason "<text>"] add to org-wide send-block list
1344
+ unsuppress <email> remove from send-block list
1345
+ suppressed [--limit N] list blocked addresses
1318
1346
 
1319
- Mail uses the inbox-scoped token in ~/.autark/credentials.json.`)
1347
+ Mail uses the inbox-scoped token in ~/.autark/credentials.json. Suppression
1348
+ verbs proxy through the autark worker (org-scoped). --dry-run prints the
1349
+ payload without hitting SES.`)
1320
1350
  }
1321
1351
 
1322
1352
  function usage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autark-cli",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "CLI for autark \u2014 hypothesis-driven product runbooks. Track products, hypotheses, runs, and actions from the terminal.",
5
5
  "type": "module",
6
6
  "license": "MIT",