@velaro/cli 1.4.197 → 1.4.199

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.
package/bin/velaro.js CHANGED
@@ -64,6 +64,7 @@ import { moshkyWriteAccessCommand } from '../lib/commands/moshky-write-access.js
64
64
  import { chatIntelligenceTopicsCommand } from '../lib/commands/chat-intelligence-topics.js';
65
65
  import { focusCommand } from '../lib/commands/focus.js';
66
66
  import { automationDraftCommand } from '../lib/commands/automation-draft.js';
67
+ import { serviceStateCommand } from '../lib/commands/service-state.js';
67
68
  import { magentoCommand } from '../lib/commands/magento.js';
68
69
  import { sapCommand } from '../lib/commands/sap.js';
69
70
  import { salesforceCommand } from '../lib/commands/salesforce.js';
@@ -109,6 +110,7 @@ import { signupFormCommand } from '../lib/commands/signup-form.js';
109
110
  import { authorityCommand } from '../lib/commands/authority.js';
110
111
  import { caseCommand } from '../lib/commands/case.js';
111
112
  import { dealCommand } from '../lib/commands/deal.js';
113
+ import { salesCommand } from '../lib/commands/sales.js';
112
114
  import { ticketCommand } from '../lib/commands/ticket.js';
113
115
  import { crmCommand } from '../lib/commands/crm-studio.js';
114
116
  import { emailRouteCommand } from '../lib/commands/email-route.js';
@@ -231,6 +233,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
231
233
  .command(moshkyWriteAccessCommand)
232
234
  .command(focusCommand)
233
235
  .command(automationDraftCommand)
236
+ .command(serviceStateCommand)
234
237
  .command(magentoCommand)
235
238
  .command(sapCommand)
236
239
  .command(salesforceCommand)
@@ -277,6 +280,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
277
280
  .command(authorityCommand)
278
281
  .command(caseCommand)
279
282
  .command(dealCommand)
283
+ .command(salesCommand)
280
284
  .command(ticketCommand)
281
285
  .command(crmCommand)
282
286
  .command(emailRouteCommand)
@@ -119,8 +119,8 @@ async function contactHandler(argv) {
119
119
  const sharedOptions = yy => yy
120
120
  .option('take', { describe: 'Page size (1-100)', type: 'number', default: 25 })
121
121
  .option('skip', { describe: 'Rows to skip', type: 'number', default: 0 })
122
- .option('source', { describe: 'Transactional | Campaign | Broadcast', type: 'string' })
123
- .option('status', { describe: 'Sent | Pending | Failed | Unsubscribed | Skipped', type: 'string' });
122
+ .option('source', { describe: 'Transactional | Campaign | Broadcast | ServiceHold', type: 'string' })
123
+ .option('status', { describe: 'Sent | Pending | Failed | Unsubscribed | Held | Skipped', type: 'string' });
124
124
 
125
125
  export const outboundActivityCommand = {
126
126
  command: 'outbound-activity <subcommand>',
@@ -0,0 +1,205 @@
1
+ import { request } from '../api.js';
2
+ import { runCommand } from '../run.js';
3
+
4
+ // -- velaro sales -------------------------------------------------------------
5
+ // CLI for the Revenue Suite (sales sequences and speed to lead), velaro-admin SalesAutomationController:
6
+ // status GET /SalesAutomation/Status
7
+ // step-types GET /SalesAutomation/StepTypes
8
+ // templates GET /SalesAutomation/Templates
9
+ // template-install POST /SalesAutomation/Templates/{key}/Install
10
+ // enroll POST /SalesAutomation/Enroll
11
+ // rules GET /SalesAutomation/SpeedToLead/Rules
12
+ // rule-upsert PUT /SalesAutomation/SpeedToLead/Rules
13
+ // rule-delete DELETE /SalesAutomation/SpeedToLead/Rules/{id}
14
+ // report GET /SalesAutomation/SpeedToLead/Report
15
+ // leads GET /SalesAutomation/SpeedToLead/Leads
16
+ // The site always comes from the signed-in credential; no command takes a site id.
17
+ // MCP parity: mcp/parity/sales-automation.customer.js (sales_* and speed_to_lead_* tools).
18
+
19
+ const BOLD = '\x1b[1m';
20
+ const DIM = '\x1b[2m';
21
+ const RST = '\x1b[0m';
22
+
23
+ const printJson = (v) => console.log(JSON.stringify(v, null, 2));
24
+ const list = (v) => (Array.isArray(v) ? v : []);
25
+ const csv = (v) => (v === undefined ? undefined : String(v).split(',').map((s) => s.trim()).filter(Boolean));
26
+
27
+ async function statusHandler(argv) {
28
+ const v = await request('GET', '/SalesAutomation/Status');
29
+ if (argv.json) return printJson(v);
30
+ const on = (b) => (b ? 'on' : 'off');
31
+ console.log(`\n${BOLD}${v.package ?? 'Revenue Suite'}${RST}`);
32
+ console.log(` Sales sequences: ${on(v.salesSequences)}`);
33
+ console.log(` Speed to lead: ${on(v.speedToLead)}`);
34
+ console.log(` Deal automation: ${on(v.dealAutomation)}`);
35
+ if (!v.salesSequences && !v.speedToLead && v.missingMessage) console.log(` ${DIM}${v.missingMessage}${RST}`);
36
+ console.log('');
37
+ }
38
+
39
+ async function stepTypesHandler(argv) {
40
+ const v = list(await request('GET', '/SalesAutomation/StepTypes'));
41
+ if (argv.json) return printJson(v);
42
+ console.log(`\n${BOLD}Sequence step types${RST} (${v.length})`);
43
+ for (const t of v) {
44
+ console.log(` ${String(t.type).padEnd(22)} ${t.label ?? ''}`);
45
+ if (t.description) console.log(` ${DIM}${t.description}${RST}`);
46
+ }
47
+ console.log('');
48
+ }
49
+
50
+ async function templatesHandler(argv) {
51
+ const v = list(await request('GET', '/SalesAutomation/Templates'));
52
+ if (argv.json) return printJson(v);
53
+ console.log(`\n${BOLD}Starter sequences${RST}`);
54
+ for (const t of v) {
55
+ const state = t.installed ? (t.isActive ? 'installed, on' : 'installed, off') : 'not installed';
56
+ console.log(` ${String(t.key).padEnd(24)} ${t.name} ${DIM}(${t.stepCount} steps, ${state}${t.campaignId ? `, campaign ${t.campaignId}` : ''})${RST}`);
57
+ if (t.needsBookingLink) console.log(` ${DIM}Needs a scheduler link: pass --booking-link when installing.${RST}`);
58
+ }
59
+ console.log('');
60
+ }
61
+
62
+ async function templateInstallHandler(argv) {
63
+ const body = { bookingLinkUrl: argv.bookingLink, activate: !!argv.activate, reset: !!argv.reset };
64
+ const v = await request('POST', `/SalesAutomation/Templates/${encodeURIComponent(argv.key)}/Install`, body);
65
+ if (argv.json) return printJson(v);
66
+ console.log(`\n Starter sequence "${argv.key}" is installed.`);
67
+ if (v?.campaignId !== undefined) console.log(` Campaign ${v.campaignId}, ${v.isActive ? 'on' : 'off'}.`);
68
+ for (const n of list(v?.notes)) console.log(` ${DIM}${n}${RST}`);
69
+ console.log('');
70
+ }
71
+
72
+ async function enrollHandler(argv) {
73
+ const body = { campaignId: argv.campaignId, email: argv.email, name: argv.name };
74
+ const v = await request('POST', '/SalesAutomation/Enroll', body);
75
+ if (argv.json) return printJson(v);
76
+ console.log(`\n ${v?.enrolled ? `Enrolled ${argv.email}.` : `${argv.email} was already enrolled.`}\n`);
77
+ }
78
+
79
+ async function rulesHandler(argv) {
80
+ const v = list(await request('GET', '/SalesAutomation/SpeedToLead/Rules'));
81
+ if (argv.json) return printJson(v);
82
+ console.log(`\n${BOLD}Speed to lead rules${RST} (${v.length})`);
83
+ for (const r of v) {
84
+ console.log(` #${r.id} ${r.name} ${r.isActive ? 'on' : 'off'} ${DIM}notify in ${r.notifySeconds}s, escalate after ${r.escalateAfterMinutes} min, ${r.maxEscalations} escalations at most${RST}`);
85
+ }
86
+ console.log('');
87
+ }
88
+
89
+ async function ruleUpsertHandler(argv) {
90
+ const body = { name: argv.name };
91
+ if (argv.id !== undefined) body.id = argv.id;
92
+ if (argv.active !== undefined) body.isActive = argv.active;
93
+ if (argv.triggers !== undefined) body.triggerTypes = csv(argv.triggers);
94
+ if (argv.sources !== undefined) body.sources = csv(argv.sources);
95
+ if (argv.minScore !== undefined) body.minScore = argv.minScore;
96
+ if (argv.notifySeconds !== undefined) body.notifySeconds = argv.notifySeconds;
97
+ if (argv.escalateAfterMinutes !== undefined) body.escalateAfterMinutes = argv.escalateAfterMinutes;
98
+ if (argv.maxEscalations !== undefined) body.maxEscalations = argv.maxEscalations;
99
+ if (argv.teamId !== undefined) body.teamId = argv.teamId;
100
+ if (argv.skillId !== undefined) body.skillId = argv.skillId;
101
+ if (argv.channels !== undefined) body.notifyChannels = csv(argv.channels);
102
+ if (argv.sequence !== undefined) body.sequenceCampaignId = argv.sequence;
103
+ const v = await request('PUT', '/SalesAutomation/SpeedToLead/Rules', body);
104
+ if (argv.json) return printJson(v);
105
+ console.log(`\n Saved rule #${v?.id ?? argv.id ?? ''} "${v?.name ?? argv.name}".\n`);
106
+ }
107
+
108
+ async function ruleDeleteHandler(argv) {
109
+ await request('DELETE', `/SalesAutomation/SpeedToLead/Rules/${argv.id}`);
110
+ console.log(`\n Deleted rule #${argv.id}.\n`);
111
+ }
112
+
113
+ async function reportHandler(argv) {
114
+ const qs = argv.days ? `?days=${argv.days}` : '';
115
+ const v = await request('GET', `/SalesAutomation/SpeedToLead/Report${qs}`);
116
+ if (argv.json) return printJson(v);
117
+ console.log(`\n${BOLD}Speed to lead report${RST}${argv.days ? ` (last ${argv.days} days)` : ''}`);
118
+ printJson(v);
119
+ console.log('');
120
+ }
121
+
122
+ async function leadsHandler(argv) {
123
+ const qs = new URLSearchParams();
124
+ if (argv.page) qs.set('page', String(argv.page));
125
+ if (argv.pageSize) qs.set('pageSize', String(argv.pageSize));
126
+ if (argv.status) qs.set('status', argv.status);
127
+ const q = qs.toString();
128
+ const v = await request('GET', `/SalesAutomation/SpeedToLead/Leads${q ? `?${q}` : ''}`);
129
+ if (argv.json) return printJson(v);
130
+ const items = list(v?.items);
131
+ console.log(`\n${BOLD}Speed to lead leads${RST} page ${v?.page ?? 1}, ${items.length} of ${v?.total ?? items.length}`);
132
+ for (const l of items) {
133
+ const secs = l.secondsToFirstTouch == null ? 'no touch yet' : `first touch in ${l.secondsToFirstTouch}s`;
134
+ console.log(` ${l.arrivedAt} ${l.contactName ?? '-'} <${l.contactEmail}> ${l.status} ${DIM}${secs}${l.ownerName ? `, owner ${l.ownerName}` : ''}${RST}`);
135
+ }
136
+ console.log('');
137
+ }
138
+
139
+ const json = (y) => y.option('json', { type: 'boolean' });
140
+
141
+ export const salesCommand = {
142
+ command: 'sales',
143
+ describe: 'Revenue Suite: sales sequences and speed to lead (native CRM)',
144
+ builder: (y) => y
145
+ .command({ command: 'status', describe: 'Which Revenue Suite features are on', builder: json, handler: runCommand(statusHandler) })
146
+ .command({ command: 'step-types', describe: 'Step types a sequence can use', builder: json, handler: runCommand(stepTypesHandler) })
147
+ .command({ command: 'templates', describe: 'Starter sequences and their install state', builder: json, handler: runCommand(templatesHandler) })
148
+ .command({
149
+ command: 'template-install <key>',
150
+ describe: 'Install (or re-open) a starter sequence; repeating it creates nothing new',
151
+ builder: (yy) => json(yy
152
+ .option('booking-link', { type: 'string', describe: 'Full https scheduler link for booking steps' })
153
+ .option('activate', { type: 'boolean', describe: 'Turn the sequence on' })
154
+ .option('reset', { type: 'boolean', describe: 'Start over: replace steps (snapshot saved to the audit trail)' })),
155
+ handler: runCommand(templateInstallHandler),
156
+ })
157
+ .command({
158
+ command: 'enroll',
159
+ describe: 'Enroll one contact in a sequence',
160
+ builder: (yy) => json(yy
161
+ .option('campaign-id', { type: 'number', demandOption: true, describe: 'Sequence (campaign) id' })
162
+ .option('email', { type: 'string', demandOption: true })
163
+ .option('name', { type: 'string' })),
164
+ handler: runCommand(enrollHandler),
165
+ })
166
+ .command({ command: 'rules', describe: 'List speed to lead rules', builder: json, handler: runCommand(rulesHandler) })
167
+ .command({
168
+ command: 'rule-upsert',
169
+ describe: 'Create a speed to lead rule, or update one with --id',
170
+ builder: (yy) => json(yy
171
+ .option('name', { type: 'string', demandOption: true })
172
+ .option('id', { type: 'number', describe: 'Update this rule' })
173
+ .option('active', { type: 'boolean' })
174
+ .option('triggers', { type: 'string', describe: 'Comma separated trigger ids' })
175
+ .option('sources', { type: 'string', describe: 'Comma separated lead sources' })
176
+ .option('min-score', { type: 'number' })
177
+ .option('notify-seconds', { type: 'number', describe: 'Notify the owner within this many seconds' })
178
+ .option('escalate-after-minutes', { type: 'number' })
179
+ .option('max-escalations', { type: 'number' })
180
+ .option('team-id', { type: 'number' })
181
+ .option('skill-id', { type: 'number' })
182
+ .option('channels', { type: 'string', describe: 'Comma separated: desktop, teams, slack' })
183
+ .option('sequence', { type: 'number', describe: 'Sequence (campaign) id to enroll the lead in' })),
184
+ handler: runCommand(ruleUpsertHandler),
185
+ })
186
+ .command({ command: 'rule-delete <id>', describe: 'Delete a speed to lead rule', builder: (yy) => yy.positional('id', { type: 'number' }), handler: runCommand(ruleDeleteHandler) })
187
+ .command({
188
+ command: 'report',
189
+ describe: 'Time to first touch report',
190
+ builder: (yy) => json(yy.option('days', { type: 'number', describe: 'Days to cover' })),
191
+ handler: runCommand(reportHandler),
192
+ })
193
+ .command({
194
+ command: 'leads',
195
+ describe: 'Page through speed to lead leads',
196
+ builder: (yy) => json(yy
197
+ .option('page', { type: 'number' })
198
+ .option('page-size', { type: 'number' })
199
+ .option('status', { type: 'string', choices: ['pending', 'touched', 'breached'] })),
200
+ handler: runCommand(leadsHandler),
201
+ })
202
+ .demandCommand(1, 'Specify a sales subcommand.')
203
+ .strict(),
204
+ handler: () => {},
205
+ };
@@ -0,0 +1,183 @@
1
+ import { request } from '../api.js';
2
+ import { runCommand } from '../run.js';
3
+
4
+ // -- velaro service-state ------------------------------------------------------
5
+ // Conversation Intelligence: pause promotional email and text for contacts who need service
6
+ // (open case, bad recent chat or call, unanswered call, failed delivery), and follow up after
7
+ // unanswered calls. siteId is applied server-side from the authenticated session, never a CLI arg.
8
+ //
9
+ // Backend contract (server/Velaro.Admin/Controllers/ServiceStateController.cs):
10
+ // GET ServiceState/policy PUT ServiceState/policy
11
+ // POST ServiceState/policy/reset GET ServiceState/holds
12
+ // POST ServiceState/holds/{id}/release GET ServiceState/preview
13
+ // POST ServiceState/voice-flow/ensure-default GET ServiceState/voice-enrollments
14
+ // Every endpoint answers 402 {error, package, fallback} when the site lacks Conversation Intelligence.
15
+
16
+ const qs = (o) => {
17
+ const p = new URLSearchParams();
18
+ for (const [k, v] of Object.entries(o)) if (v !== undefined && v !== null && v !== '') p.set(k, String(v));
19
+ const s = p.toString();
20
+ return s ? '?' + s : '';
21
+ };
22
+
23
+ function fmtDate(d) {
24
+ return d ? new Date(d).toISOString().replace('T', ' ').slice(0, 19) : '-';
25
+ }
26
+
27
+ function printPolicy(p) {
28
+ const row = (l, v) => console.log(` ${l.padEnd(34)}${v ?? '-'}`);
29
+ console.log(`\nService pauses${p.isDefault ? ' (recommended defaults, never edited)' : ''}\n`);
30
+ row('On', p.enabled);
31
+ row('Pause for an open case', p.holdOpenCase);
32
+ row('Pause after a bad chat or call', `${p.holdNegativeSentiment} (${p.negativeSentimentWindowDays} days)`);
33
+ row('Pause after an unanswered call', `${p.holdUnresolvedVoice} (${p.unresolvedVoiceWindowDays} days)`);
34
+ row('Pause after a failed message', `${p.holdFailedDelivery} (${p.failedDeliveryWindowDays} days)`);
35
+ row('Longest a message waits (days)', p.maxHoldDays);
36
+ row('Check again every (minutes)', p.recheckMinutes);
37
+ row('Quiet hours', `${p.quietHoursStart} to ${p.quietHoursEnd} (${p.quietHoursTimeZone})`);
38
+ row('Follow up after unanswered calls', p.voiceFlowEnabled);
39
+ row('Follow-up sequence id', p.voiceFlowCampaignId);
40
+ row('Minimum call length (seconds)', p.voiceFlowMinCallSeconds);
41
+ row('Updated', fmtDate(p.updatedAt));
42
+ console.log('');
43
+ }
44
+
45
+ const toBool = (v) => (v === undefined ? undefined : v === true || v === 'true');
46
+
47
+ export const serviceStateCommand = {
48
+ command: 'service-state <subcommand>',
49
+ describe: 'Pause promotions for customers who need service, and follow up after unanswered calls',
50
+ builder: (y) => y
51
+ .command({
52
+ command: 'policy',
53
+ describe: 'Show the current service pause settings',
54
+ handler: runCommand(async () => printPolicy(await request('GET', 'ServiceState/policy'))),
55
+ })
56
+ .command({
57
+ command: 'set-policy',
58
+ describe: 'Change service pause settings (only the options you pass change)',
59
+ builder: (y2) => y2
60
+ .option('enabled', { type: 'boolean' })
61
+ .option('hold-open-case', { type: 'boolean' })
62
+ .option('hold-negative-sentiment', { type: 'boolean' })
63
+ .option('negative-sentiment-window-days', { type: 'number' })
64
+ .option('hold-unresolved-voice', { type: 'boolean' })
65
+ .option('unresolved-voice-window-days', { type: 'number' })
66
+ .option('hold-failed-delivery', { type: 'boolean' })
67
+ .option('failed-delivery-window-days', { type: 'number' })
68
+ .option('max-hold-days', { type: 'number' })
69
+ .option('recheck-minutes', { type: 'number' })
70
+ .option('quiet-hours-start', { type: 'number' })
71
+ .option('quiet-hours-end', { type: 'number' })
72
+ .option('quiet-hours-time-zone', { type: 'string', describe: 'For example America/Los_Angeles' })
73
+ .option('voice-flow-enabled', { type: 'boolean' })
74
+ .option('voice-flow-campaign-id', { type: 'number' })
75
+ .option('voice-flow-min-call-seconds', { type: 'number' }),
76
+ handler: runCommand(async (a) => {
77
+ const body = {
78
+ enabled: toBool(a.enabled),
79
+ holdOpenCase: toBool(a.holdOpenCase),
80
+ holdNegativeSentiment: toBool(a.holdNegativeSentiment),
81
+ negativeSentimentWindowDays: a.negativeSentimentWindowDays,
82
+ holdUnresolvedVoice: toBool(a.holdUnresolvedVoice),
83
+ unresolvedVoiceWindowDays: a.unresolvedVoiceWindowDays,
84
+ holdFailedDelivery: toBool(a.holdFailedDelivery),
85
+ failedDeliveryWindowDays: a.failedDeliveryWindowDays,
86
+ maxHoldDays: a.maxHoldDays,
87
+ recheckMinutes: a.recheckMinutes,
88
+ quietHoursStart: a.quietHoursStart,
89
+ quietHoursEnd: a.quietHoursEnd,
90
+ quietHoursTimeZone: a.quietHoursTimeZone,
91
+ voiceFlowEnabled: toBool(a.voiceFlowEnabled),
92
+ voiceFlowCampaignId: a.voiceFlowCampaignId,
93
+ voiceFlowMinCallSeconds: a.voiceFlowMinCallSeconds,
94
+ };
95
+ Object.keys(body).forEach((k) => body[k] === undefined && delete body[k]);
96
+ if (!Object.keys(body).length) throw new Error('Pass at least one option to change.');
97
+ printPolicy(await request('PUT', 'ServiceState/policy', body));
98
+ }),
99
+ })
100
+ .command({
101
+ command: 'reset-policy',
102
+ describe: 'Go back to the recommended defaults (prints the previous settings so you can restore them)',
103
+ handler: runCommand(async () => {
104
+ const r = await request('POST', 'ServiceState/policy/reset');
105
+ console.log('\nSettings reset. Previous settings (pass these to set-policy to restore):\n');
106
+ console.log(JSON.stringify(r?.snapshot ?? {}, null, 2));
107
+ console.log('');
108
+ }),
109
+ })
110
+ .command({
111
+ command: 'holds',
112
+ describe: 'List promotions held for service reasons',
113
+ builder: (y2) => y2
114
+ .option('status', { type: 'string', choices: ['held', 'released', 'expired'], default: 'held' })
115
+ .option('contact-email', { type: 'string' })
116
+ .option('page', { type: 'number', default: 1 })
117
+ .option('page-size', { type: 'number', default: 25 }),
118
+ handler: runCommand(async (a) => {
119
+ const r = await request('GET', 'ServiceState/holds' + qs({
120
+ status: a.status, contactEmail: a.contactEmail, page: a.page, pageSize: a.pageSize,
121
+ }));
122
+ const items = r?.items ?? [];
123
+ if (!items.length) { console.log('\nNothing is held.\n'); return; }
124
+ console.log(`\nHolds (${r.total} total, page ${r.page}):\n`);
125
+ for (const h of items) {
126
+ console.log(` #${h.id} ${h.status.padEnd(9)} ${h.contactEmail} ${h.channel} held ${fmtDate(h.heldAt)} expires ${fmtDate(h.expiresAt)}`);
127
+ console.log(` ${h.reasonText ?? (h.reasons || []).join(', ')}`);
128
+ }
129
+ console.log('');
130
+ }),
131
+ })
132
+ .command({
133
+ command: 'release-hold <id>',
134
+ describe: 'Send a held promotion now',
135
+ builder: (y2) => y2.positional('id', { type: 'number' }),
136
+ handler: runCommand(async (a) => {
137
+ await request('POST', `ServiceState/holds/${a.id}/release`);
138
+ console.log(`\nHold #${a.id} released.\n`);
139
+ }),
140
+ })
141
+ .command({
142
+ command: 'preview',
143
+ describe: 'Check whether a promotion to a contact would be held right now (nothing is sent)',
144
+ builder: (y2) => y2
145
+ .option('email', { type: 'string' })
146
+ .option('phone', { type: 'string' })
147
+ .option('message-class', { type: 'string', choices: ['promotional', 'transactional'], default: 'promotional' }),
148
+ handler: runCommand(async (a) => {
149
+ if (!a.email && !a.phone) throw new Error('Pass --email or --phone.');
150
+ const r = await request('GET', 'ServiceState/preview' + qs({ email: a.email, phone: a.phone, messageClass: a.messageClass }));
151
+ console.log(`\n${r.held ? 'HELD' : 'Would send'}${r.reasonText ? ': ' + r.reasonText : ''}`);
152
+ if (r.stateAvailable === false) console.log('Support status could not be checked, so promotions are held to be safe.');
153
+ console.log('');
154
+ }),
155
+ })
156
+ .command({
157
+ command: 'voice-flow-setup',
158
+ describe: 'Create (or reuse) the ready-made follow-up sequence for unanswered calls',
159
+ handler: runCommand(async () => {
160
+ const r = await request('POST', 'ServiceState/voice-flow/ensure-default');
161
+ console.log(`\nFollow-up sequence #${r.campaignId} ${r.created ? 'created' : 'already in place'}.\n`);
162
+ }),
163
+ })
164
+ .command({
165
+ command: 'voice-enrollments',
166
+ describe: 'List callers followed up after unanswered calls (and callers skipped, with the reason)',
167
+ builder: (y2) => y2
168
+ .option('page', { type: 'number', default: 1 })
169
+ .option('page-size', { type: 'number', default: 25 }),
170
+ handler: runCommand(async (a) => {
171
+ const r = await request('GET', 'ServiceState/voice-enrollments' + qs({ page: a.page, pageSize: a.pageSize }));
172
+ const items = r?.items ?? [];
173
+ if (!items.length) { console.log('\nNo unanswered calls have been followed up yet.\n'); return; }
174
+ console.log(`\nVoice follow-ups (${r.total} total, page ${r.page}):\n`);
175
+ for (const e of items) {
176
+ console.log(` #${e.id} ${e.outcome.padEnd(8)} ${e.contactEmail} call ${e.callConversationId} ${fmtDate(e.createdAt)} ${e.reasonText ?? ''}`);
177
+ }
178
+ console.log('');
179
+ }),
180
+ })
181
+ .demandCommand(1),
182
+ handler: () => {},
183
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.197",
3
+ "version": "1.4.199",
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": {