@velaro/cli 1.4.249 → 1.4.251

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
@@ -30,6 +30,7 @@ import { aiConfigCommand } from '../lib/commands/ai-config.js';
30
30
  import { updateCommand } from '../lib/commands/update.js';
31
31
  import { agentCommand } from '../lib/commands/agent.js';
32
32
  import { linkedIdentityCommand } from '../lib/commands/linked-identity.js';
33
+ import { securityCatalogCommand } from '../lib/commands/security-catalog.js';
33
34
  import { notificationsCommand } from '../lib/commands/notifications.js';
34
35
  import { signatureCommand } from '../lib/commands/signature.js';
35
36
  import { articleCommand } from '../lib/commands/article.js';
@@ -41,6 +42,7 @@ import { appointmentsCommand } from '../lib/commands/appointments.js';
41
42
  import { schedulerCommand } from '../lib/commands/scheduler.js';
42
43
  import { publicApiCommand } from '../lib/commands/public-api.js';
43
44
  import { bookingDefaultsCommand } from '../lib/commands/booking-defaults.js';
45
+ import { reservationBackupCommand } from '../lib/commands/reservation-backup.js';
44
46
  import { bookingCommand } from '../lib/commands/booking.js';
45
47
  import { reportCommand } from '../lib/commands/report.js';
46
48
  import { reportSubscriptionCommand } from '../lib/commands/report-subscription.js';
@@ -197,6 +199,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
197
199
  .command(updateCommand)
198
200
  .command(agentCommand)
199
201
  .command(linkedIdentityCommand)
202
+ .command(securityCatalogCommand)
200
203
  .command(notificationsCommand)
201
204
  .command(signatureCommand)
202
205
  .command(articleCommand)
@@ -208,6 +211,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
208
211
  .command(schedulerCommand)
209
212
  .command(publicApiCommand)
210
213
  .command(bookingDefaultsCommand)
214
+ .command(reservationBackupCommand)
211
215
  .command(bookingCommand)
212
216
  .command(reportCommand)
213
217
  .command(conversationEfficiencyCommand)
@@ -0,0 +1,74 @@
1
+ import fs from 'node:fs';
2
+ import { messagingGet, messagingPost, messagingPut, messagingRequest } from '../api.js';
3
+ import { runCommand } from '../run.js';
4
+
5
+ // ── velaro reservation-backup ─────────────────────────────────────────────────
6
+ // CLI surface for reservation export (CSV / ICS / printable) and the emailed backup.
7
+ // Mirrors the reservation_backup_* MCP tools. Routes live in velaro-messaging at
8
+ // /ReservationExport (ReservationExportController); the site always comes from the login.
9
+
10
+ export const reservationBackupCommand = {
11
+ command: 'reservation-backup <subcommand>',
12
+ describe: 'Download reservations and manage the emailed daily/weekly backup',
13
+ builder: yargs => yargs
14
+ .command({
15
+ command: 'get',
16
+ describe: 'Show the backup settings and the last send result',
17
+ handler: runCommand(async () => {
18
+ console.log(JSON.stringify(await messagingGet('/ReservationExport/Settings'), null, 2));
19
+ }),
20
+ })
21
+ .command({
22
+ command: 'set',
23
+ describe: 'Change the backup settings (only the flags you pass change)',
24
+ builder: y => y
25
+ .option('enabled', { type: 'string', describe: 'on | off' })
26
+ .option('frequency', { type: 'string', describe: 'daily | weekly' })
27
+ .option('recipients', { type: 'string', describe: 'Email addresses, separated by commas or semicolons' })
28
+ .option('lookahead', { type: 'number', describe: 'Days ahead to include (1-366)' }),
29
+ handler: runCommand(async argv => {
30
+ const body = {};
31
+ if (argv.enabled !== undefined) {
32
+ if (!['on', 'off'].includes(argv.enabled)) throw new Error('--enabled must be on or off');
33
+ body.enabled = argv.enabled === 'on';
34
+ }
35
+ if (argv.frequency !== undefined) body.frequency = argv.frequency;
36
+ if (argv.recipients !== undefined) body.recipients = argv.recipients;
37
+ if (argv.lookahead !== undefined) body.lookaheadDays = argv.lookahead;
38
+ const saved = await messagingPut('/ReservationExport/Settings', body);
39
+ console.log('\n✓ Reservation backup settings saved');
40
+ console.log(JSON.stringify(saved, null, 2));
41
+ }),
42
+ })
43
+ .command({
44
+ command: 'send-now',
45
+ describe: 'Email the backup to the saved recipients now',
46
+ handler: runCommand(async () => {
47
+ console.log(JSON.stringify(await messagingPost('/ReservationExport/SendNow', {}), null, 2));
48
+ }),
49
+ })
50
+ .command({
51
+ command: 'download',
52
+ describe: 'Download reservations to a file',
53
+ builder: y => y
54
+ .option('format', { type: 'string', choices: ['csv', 'ics', 'print'], default: 'csv' })
55
+ .option('out', { type: 'string', describe: 'Output file (default reservations.<ext>)' })
56
+ .option('from', { type: 'string', describe: 'ISO date-time start' })
57
+ .option('to', { type: 'string', describe: 'ISO date-time end' })
58
+ .option('status', { type: 'string' })
59
+ .option('provider', { type: 'string' })
60
+ .option('resource', { type: 'number', describe: 'Resource id' }),
61
+ handler: runCommand(async argv => {
62
+ const q = new URLSearchParams();
63
+ for (const [k, v] of [['from', argv.from], ['to', argv.to], ['status', argv.status], ['provider', argv.provider], ['resourceId', argv.resource]]) {
64
+ if (v !== undefined && v !== '') q.set(k, String(v));
65
+ }
66
+ const kind = { csv: 'Csv', ics: 'Ics', print: 'Print' }[argv.format];
67
+ const text = await messagingRequest('GET', `/ReservationExport/${kind}${q.toString() ? '?' + q : ''}`, undefined, undefined, {}, { text: true });
68
+ const out = argv.out || `reservations.${argv.format === 'print' ? 'html' : argv.format}`;
69
+ fs.writeFileSync(out, text);
70
+ console.log(`\n✓ Saved ${out}`);
71
+ }),
72
+ })
73
+ .demandCommand(1),
74
+ };
@@ -0,0 +1,24 @@
1
+ import { get } from '../api.js';
2
+ import { runCommand } from '../run.js';
3
+
4
+ export const securityCatalogCommand = {
5
+ command: 'security-catalog',
6
+ describe: 'List every security and compliance setting with its level (included / Professional / Enterprise) and default retention per level',
7
+ builder: (yargs) => yargs,
8
+ handler: runCommand(async () => {
9
+ const c = await get('/Entitlements/security-catalog');
10
+ if (!c || !Array.isArray(c.items)) {
11
+ throw new Error('Failed to load the security catalog.');
12
+ }
13
+ for (const g of c.groups ?? []) {
14
+ console.log(`\n${g.label} (${g.page})`);
15
+ for (const i of c.items.filter((x) => x.group === g.id)) {
16
+ console.log(` [${i.level}] ${i.label}`);
17
+ }
18
+ }
19
+ console.log('\nDefault retention in days (basic / standard / enterprise)');
20
+ for (const r of c.retentionDefaults ?? []) {
21
+ console.log(` ${r.label}: ${r.basicDays ?? 'you choose'} / ${r.standardDays ?? 'you choose'} / ${r.enterpriseDays ?? 'you choose'}`);
22
+ }
23
+ }),
24
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.249",
3
+ "version": "1.4.251",
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": {