@velaro/cli 1.4.246 → 1.4.247

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.
@@ -4,6 +4,9 @@
4
4
  * velaro campaigns benchmarks Your broadcast open/click rate vs. the Velaro average
5
5
  * velaro campaigns revenue [--days N] Order revenue attributed to campaign email
6
6
  * velaro campaigns revenue-window [--set DAYS] Read or set the attribution window (1-30 days)
7
+ * velaro campaigns hub overview Campaign Hub: 30 day sends, rates, revenue, list growth, top campaigns
8
+ * velaro campaigns hub calendar [--from D] [--to D] Send calendar: broadcasts and sequence emails sent or scheduled
9
+ * velaro campaigns hub health Deliverability health score (0-100) and what to fix
7
10
  * velaro campaigns sender [--source campaign|ticket|notification] [--name N] [--address A] [--reset] Read or set the From sender per mail source
8
11
  */
9
12
 
@@ -71,6 +74,41 @@ async function senderHandler(argv) {
71
74
  console.log(`Verified sending domains: ${(r.verifiedDomains || []).join(', ') || 'none'}`);
72
75
  }
73
76
 
77
+ // -- Campaign Hub (needs the Campaign Hub suite) ---------------------
78
+
79
+ async function hubOverviewHandler(argv) {
80
+ const r = await request('GET', '/CampaignHub/Overview');
81
+ if (argv.json) { console.log(JSON.stringify(r, null, 2)); return; }
82
+ console.log(`\n${BOLD}Campaign Hub (last ${r.windowDays} days)${RST}\n`);
83
+ console.log(` Sent ${CYN}${r.sent}${RST} | open ${CYN}${r.openRatePct}%${RST} | click ${CYN}${r.clickRatePct}%${RST}`);
84
+ console.log(` Revenue from campaign email: ${GRN}${r.revenue} ${r.currency}${RST} from ${r.attributedOrders} orders${r.mixedCurrencies ? ' (other currencies not included)' : ''}`);
85
+ const g = r.listGrowth || {};
86
+ console.log(` List: ${g.activeContacts} contacts, ${g.added} added, ${g.unsubscribed} unsubscribed, net ${g.net}`);
87
+ for (const c of r.topCampaigns || []) console.log(` top: ${c.name} open ${c.openRatePct}% click ${c.clickRatePct}% revenue ${c.revenue}`);
88
+ console.log('');
89
+ }
90
+
91
+ async function hubCalendarHandler(argv) {
92
+ const qs = [];
93
+ if (argv.from) qs.push(`from=${encodeURIComponent(argv.from)}`);
94
+ if (argv.to) qs.push(`to=${encodeURIComponent(argv.to)}`);
95
+ const r = await request('GET', `/CampaignHub/Calendar${qs.length ? '?' + qs.join('&') : ''}`);
96
+ if (argv.json) { console.log(JSON.stringify(r, null, 2)); return; }
97
+ console.log(`\n${BOLD}Send calendar ${r.from} to ${r.to}${RST}\n`);
98
+ if (!(r.items || []).length) { console.log(' Nothing sent or scheduled in this range.\n'); return; }
99
+ for (const i of r.items) console.log(` ${i.date} ${i.kind.padEnd(9)} ${i.status.padEnd(9)} ${i.name} (${i.count})`);
100
+ console.log('');
101
+ }
102
+
103
+ async function hubHealthHandler(argv) {
104
+ const r = await request('GET', '/CampaignHub/HealthScore');
105
+ if (argv.json) { console.log(JSON.stringify(r, null, 2)); return; }
106
+ console.log(`\n${BOLD}Deliverability health score: ${CYN}${r.score}/100${RST} (${r.label})\n`);
107
+ for (const c of r.components || []) console.log(` ${c.label}: ${c.points}/${c.maxPoints} ${DIM}${c.detail}${RST}`);
108
+ for (const f of r.fixes || []) console.log(` - ${f.message}`);
109
+ console.log('');
110
+ }
111
+
74
112
  // -- command export ------------------------------------------------------------------
75
113
 
76
114
  export const campaignsCommand = {
@@ -104,6 +142,23 @@ export const campaignsCommand = {
104
142
  .option('reset', { type: 'boolean', describe: 'Back to the account default' }),
105
143
  handler: runCommand(senderHandler),
106
144
  })
145
+ .command({
146
+ command: 'hub <view>',
147
+ describe: 'Campaign Hub: overview, calendar and deliverability health score (needs the Campaign Hub suite)',
148
+ builder: y2 => y2
149
+ .command({ command: 'overview', describe: 'Last 30 days: sends, open and click rate, revenue, list growth, top campaigns',
150
+ builder: y3 => y3.option('json', { type: 'boolean', describe: 'Print the raw response' }), handler: runCommand(hubOverviewHandler) })
151
+ .command({ command: 'calendar', describe: 'Broadcasts and sequence emails sent or scheduled in a date range',
152
+ builder: y3 => y3
153
+ .option('from', { type: 'string', describe: 'First day, like 2026-11-01' })
154
+ .option('to', { type: 'string', describe: 'Day after the last day, like 2026-12-01' })
155
+ .option('json', { type: 'boolean', describe: 'Print the raw response' }), handler: runCommand(hubCalendarHandler) })
156
+ .command({ command: 'health', describe: 'Deliverability health score (0 to 100) and what to fix',
157
+ builder: y3 => y3.option('json', { type: 'boolean', describe: 'Print the raw response' }), handler: runCommand(hubHealthHandler) })
158
+ .demandCommand(1, 'Specify a view: overview | calendar | health')
159
+ .strict(),
160
+ handler: () => {},
161
+ })
107
162
  .demandCommand(1, 'Specify a subcommand. Try: velaro campaigns --help')
108
163
  .strict(),
109
164
  handler: () => {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.246",
3
+ "version": "1.4.247",
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": {