@velaro/cli 1.4.80 → 1.4.81

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
@@ -92,6 +92,7 @@ import { supportCommand } from '../lib/commands/support.js';
92
92
  import { routingCommand } from '../lib/commands/routing.js';
93
93
  import { diagnosticsCommand } from '../lib/commands/diagnostics.js';
94
94
  import { aiSpendCommand } from '../lib/commands/ai-spend.js';
95
+ import { statusPageCommand } from '../lib/commands/status-page.js';
95
96
  import { emailInboxCommand } from '../lib/commands/email-inbox.js';
96
97
  import { callbackCommand } from '../lib/commands/callback.js';
97
98
  import { caseCommand } from '../lib/commands/case.js';
@@ -209,6 +210,7 @@ await yargs(hideBin(process.argv))
209
210
  .command(routingCommand)
210
211
  .command(diagnosticsCommand)
211
212
  .command(aiSpendCommand)
213
+ .command(statusPageCommand)
212
214
  .command(emailInboxCommand)
213
215
  .command(callbackCommand)
214
216
  .command(caseCommand)
@@ -0,0 +1,95 @@
1
+ import { messagingRequest } from '../api.js';
2
+
3
+ const COMPONENTS = 'Messaging, Voice & Calls, AI Assistant, Database, API, Integrations, Email Campaigns, Velaro Sign, Velaro Forms, Agent Console, Core API, Chat Engagement';
4
+ const TOKENS = 'AffectedServices is a comma-separated list of component names (' + COMPONENTS + ') plus optional uptime tokens: "counts-uptime" forces the incident to count against uptime, "no-uptime-impact" forces it not to. Default: only a core chat outage counts.';
5
+
6
+ const listCommand = {
7
+ command: 'list',
8
+ describe: 'List status incidents (SuperAdmin, velaro-messaging GET /superadmin/status-incidents)',
9
+ builder: (y) => y.option('filter', { type: 'string', default: 'active', choices: ['active', 'resolved', 'all'] }).option('json', { type: 'boolean', default: false }),
10
+ handler: async (argv) => {
11
+ const rows = await messagingRequest('GET', `/superadmin/status-incidents?filter=${argv.filter}`);
12
+ if (argv.json) { console.log(JSON.stringify(rows, null, 2)); return; }
13
+ for (const r of rows ?? []) console.log(`#${r.id} ${r.status} ${r.incidentType}/${r.severity} ${r.title} [${r.affectedServices ?? ''}]`);
14
+ },
15
+ };
16
+
17
+ const createCommand = {
18
+ command: 'create',
19
+ describe: 'Create a status incident. ' + TOKENS,
20
+ builder: (y) => y
21
+ .option('title', { type: 'string', demandOption: true })
22
+ .option('description', { type: 'string', default: '' })
23
+ .option('status', { type: 'string', default: 'Investigating', describe: 'Investigating, Identified, Monitoring, Resolved' })
24
+ .option('type', { type: 'string', default: 'Incident', describe: 'Incident or Maintenance' })
25
+ .option('severity', { type: 'string', default: 'Minor', describe: 'Minor or Major' })
26
+ .option('services', { type: 'string', default: '', describe: 'AffectedServices CSV. ' + TOKENS })
27
+ .option('regions', { type: 'string', default: '' })
28
+ .option('exclude-from-uptime', { type: 'boolean', default: false })
29
+ .option('hidden', { type: 'boolean', default: false, describe: 'Hide from the public page' }),
30
+ handler: async (argv) => {
31
+ const r = await messagingRequest('POST', '/superadmin/status-incidents', {
32
+ title: argv.title, description: argv.description, status: argv.status, incidentType: argv.type, severity: argv.severity,
33
+ affectedServices: argv.services, affectedRegions: argv.regions, excludeFromUptime: argv.excludeFromUptime, isVisibleToCustomers: !argv.hidden,
34
+ });
35
+ console.log(`Created incident #${r.id}: ${r.title}`);
36
+ },
37
+ };
38
+
39
+ const updateCommand = {
40
+ command: 'update <id>',
41
+ describe: 'Update a status incident (pass every field you want kept). ' + TOKENS,
42
+ builder: (y) => y
43
+ .positional('id', { type: 'number' })
44
+ .option('title', { type: 'string' }).option('description', { type: 'string' })
45
+ .option('status', { type: 'string' }).option('type', { type: 'string' }).option('severity', { type: 'string' })
46
+ .option('services', { type: 'string', describe: 'AffectedServices CSV. ' + TOKENS })
47
+ .option('regions', { type: 'string' })
48
+ .option('end-time', { type: 'string', describe: 'ISO timestamp the incident ended' })
49
+ .option('exclude-from-uptime', { type: 'boolean' })
50
+ .option('hidden', { type: 'boolean' }),
51
+ handler: async (argv) => {
52
+ const body = {
53
+ title: argv.title, description: argv.description, status: argv.status, incidentType: argv.type, severity: argv.severity,
54
+ affectedServices: argv.services, affectedRegions: argv.regions, endTime: argv.endTime,
55
+ excludeFromUptime: argv.excludeFromUptime ?? false, isVisibleToCustomers: argv.hidden === undefined ? true : !argv.hidden,
56
+ };
57
+ const r = await messagingRequest('PUT', `/superadmin/status-incidents/${argv.id}`, body);
58
+ console.log(`Updated incident #${r?.id ?? argv.id}`);
59
+ },
60
+ };
61
+
62
+ const deleteCommand = {
63
+ command: 'delete <id>',
64
+ describe: 'Delete a status incident or clear an override',
65
+ builder: (y) => y.positional('id', { type: 'number' }),
66
+ handler: async (argv) => {
67
+ await messagingRequest('DELETE', `/superadmin/status-incidents/${argv.id}`);
68
+ console.log(`Deleted incident #${argv.id}`);
69
+ },
70
+ };
71
+
72
+ const overrideCommand = {
73
+ command: 'override',
74
+ describe: 'Force a public status page component to a status (POST /superadmin/status-overrides). Components: ' + COMPONENTS + '. Clear with: velaro status-page delete <id>',
75
+ builder: (y) => y
76
+ .option('component', { type: 'string', demandOption: true, describe: COMPONENTS })
77
+ .option('status', { type: 'string', demandOption: true, choices: ['operational', 'degraded', 'outage', 'maintenance'] })
78
+ .option('note', { type: 'string', default: '' })
79
+ .option('expires-at', { type: 'string', describe: 'ISO timestamp the override auto-clears' })
80
+ .option('counts-against-uptime', { type: 'boolean', describe: 'true adds counts-uptime, false adds no-uptime-impact; omit for default' }),
81
+ handler: async (argv) => {
82
+ const r = await messagingRequest('POST', '/superadmin/status-overrides', {
83
+ component: argv.component, status: argv.status, note: argv.note, expiresAt: argv.expiresAt ?? null, countsAgainstUptime: argv.countsAgainstUptime ?? null,
84
+ });
85
+ console.log(`Override #${r.id} created: ${r.title}`);
86
+ },
87
+ };
88
+
89
+ export const statusPageCommand = {
90
+ command: 'status-page <subcommand>',
91
+ describe: 'Public status page incidents and component overrides (SuperAdmin only)',
92
+ builder: (y) => y.command(listCommand).command(createCommand).command(updateCommand).command(deleteCommand).command(overrideCommand)
93
+ .demandCommand(1, 'Specify a subcommand: list, create, update, delete, override').strict(),
94
+ handler: () => {},
95
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.80",
3
+ "version": "1.4.81",
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": {