@velaro/cli 1.4.156 → 1.4.158

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.
@@ -3,6 +3,9 @@
3
3
  *
4
4
  * velaro sender-domain-health show Health + plain-language history
5
5
  * velaro sender-domain-health settings View or change warning days / grace days
6
+ * velaro sender-domain-health warmup Sender health: authentication, warmup ramp, 7/30 day rates, what to fix
7
+ * velaro sender-domain-health warmup-settings Turn warmup on/off, set the daily schedule or the pause limits
8
+ * velaro sender-domain-health resume <id> Resume a domain that was paused for complaints or bounces
6
9
  */
7
10
  import { request } from '../api.js';
8
11
  import { runCommand } from '../run.js';
@@ -38,6 +41,47 @@ async function dismissHandler(argv) {
38
41
  console.log(JSON.stringify(await request('POST', `/SenderDomains/Health/Events/${argv.id}/Dismiss`, {})));
39
42
  }
40
43
 
44
+ const pct = (n) => `${Number(n ?? 0)}%`;
45
+
46
+ async function warmupHandler(argv) {
47
+ const r = await request('GET', '/SenderHealth');
48
+ if (argv.json) { console.log(JSON.stringify(r, null, 2)); return; }
49
+ const domains = r.domains ?? [];
50
+ if (domains.length === 0) { console.log('No sender domains.'); return; }
51
+ if (!r.signalsAvailable) console.log('Complaint and bounce rates are not available right now.\n');
52
+ for (const d of domains) {
53
+ const w = d.warmup;
54
+ const ramp = w.paused ? `PAUSED (${w.pauseKind}): ${w.pauseReason}`
55
+ : w.state === 'Ramping' ? `day ${Math.min(w.day + 1, w.totalDays)} of ${w.totalDays}, ${w.sentToday} of ${w.todayCap ?? 'no limit'} sent today`
56
+ : w.state;
57
+ console.log(`${d.domainName} [${d.health}] status=${d.status}`);
58
+ console.log(` auth: SPF ${d.auth.spf ? 'on' : 'MISSING'}, DKIM ${d.auth.dkim ? 'on' : 'MISSING'}, DMARC ${d.auth.dmarc ? 'on' : 'MISSING'}, one-click unsubscribe ${d.auth.oneClickUnsubscribeHeader ? 'on' : 'MISSING'}`);
59
+ console.log(` warmup: ${ramp}`);
60
+ console.log(` 7 days: ${d.last7Days.sent} sent, complaints ${pct(d.last7Days.complaintRatePct)}, bounces ${pct(d.last7Days.bounceRatePct)}, unsubscribes ${pct(d.last7Days.unsubscribeRatePct)}`);
61
+ console.log(` 30 days: ${d.last30Days.sent} sent, complaints ${pct(d.last30Days.complaintRatePct)}, bounces ${pct(d.last30Days.bounceRatePct)}, unsubscribes ${pct(d.last30Days.unsubscribeRatePct)}`);
62
+ for (const f of d.fixes ?? []) console.log(` - [${f.severity}] ${f.title}: ${f.detail}`);
63
+ }
64
+ }
65
+
66
+ async function warmupSettingsHandler(argv) {
67
+ if (argv.reset) { console.log(JSON.stringify(await request('PUT', '/SenderHealth/Settings', { reset: true }))); return; }
68
+ const body = {};
69
+ if (argv.enabled !== undefined) body.warmupEnabled = argv.enabled === true;
70
+ if (argv.schedule !== undefined) body.schedule = String(argv.schedule);
71
+ if (argv.complaintPausePct !== undefined) body.complaintPausePct = Number(argv.complaintPausePct);
72
+ if (argv.bouncePausePct !== undefined) body.bouncePausePct = Number(argv.bouncePausePct);
73
+ if (Object.keys(body).length === 0) {
74
+ const r = await request('GET', '/SenderHealth');
75
+ console.log(JSON.stringify(r.thresholds, null, 2));
76
+ return;
77
+ }
78
+ console.log(JSON.stringify(await request('PUT', '/SenderHealth/Settings', body)));
79
+ }
80
+
81
+ async function resumeHandler(argv) {
82
+ console.log(JSON.stringify(await request('POST', `/SenderHealth/${argv.id}/Resume`, {})));
83
+ }
84
+
41
85
  export const senderDomainHealthCommand = {
42
86
  command: 'sender-domain-health <subcommand>',
43
87
  describe: 'Sender domain health: registration expiry, DNS, email-provider state',
@@ -52,7 +96,23 @@ export const senderDomainHealthCommand = {
52
96
  handler: runCommand(settingsHandler),
53
97
  })
54
98
  .command({ command: 'dismiss <id>', describe: 'Dismiss a notice (do not remind me)', handler: runCommand(dismissHandler) })
55
- .demandCommand(1, 'Specify a subcommand: show | settings | dismiss')
99
+ .command({
100
+ command: 'warmup', describe: 'Sender health: authentication, warmup ramp, 7 and 30 day rates, what to fix',
101
+ builder: yy => yy.option('json', { type: 'boolean', describe: 'Print the raw response' }),
102
+ handler: runCommand(warmupHandler),
103
+ })
104
+ .command({
105
+ command: 'warmup-settings', describe: 'View or change warmup (needs Email Growth)',
106
+ builder: yy => yy
107
+ .option('enabled', { type: 'boolean', describe: 'Turn the warmup ramp and automatic pausing on or off' })
108
+ .option('schedule', { type: 'string', describe: 'Daily amounts, comma separated, never decreasing, e.g. 50,100,200,400' })
109
+ .option('complaint-pause-pct', { type: 'number', describe: 'Pause sending at this spam complaint rate in percent (above 0, at most 0.3)' })
110
+ .option('bounce-pause-pct', { type: 'number', describe: 'Pause sending at this bounce rate in percent (1 to 10)' })
111
+ .option('reset', { type: 'boolean', describe: 'Go back to the standard warmup settings' }),
112
+ handler: runCommand(warmupSettingsHandler),
113
+ })
114
+ .command({ command: 'resume <id>', describe: 'Resume a paused sender domain (needs Email Growth)', handler: runCommand(resumeHandler) })
115
+ .demandCommand(1, 'Specify a subcommand: show | settings | dismiss | warmup | warmup-settings | resume')
56
116
  .strict(),
57
117
  handler: () => {},
58
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.156",
3
+ "version": "1.4.158",
4
4
  "description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
5
5
  "type": "module",
6
6
  "bin": {