@velaro/cli 1.4.188 → 1.4.190
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 +2 -0
- package/lib/commands/booking.js +20 -0
- package/lib/commands/workforce.js +21 -0
- package/package.json +1 -1
package/bin/velaro.js
CHANGED
|
@@ -120,6 +120,7 @@ import { applePayCommand } from '../lib/commands/apple-pay.js';
|
|
|
120
120
|
import { siteBuilderCommand } from '../lib/commands/site-builder.js';
|
|
121
121
|
import { paymentRecoveryCommand } from '../lib/commands/payment-recovery.js';
|
|
122
122
|
import { recruitingCommand } from '../lib/commands/recruiting.js';
|
|
123
|
+
import { workforceCommand } from '../lib/commands/workforce.js';
|
|
123
124
|
import { surveyCommand } from '../lib/commands/survey.js';
|
|
124
125
|
import { bundleCommand } from '../lib/commands/bundle.js';
|
|
125
126
|
import { chatWindowCommand } from '../lib/commands/chat-window.js';
|
|
@@ -286,6 +287,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
|
|
|
286
287
|
.command(siteBuilderCommand)
|
|
287
288
|
.command(paymentRecoveryCommand)
|
|
288
289
|
.command(recruitingCommand)
|
|
290
|
+
.command(workforceCommand)
|
|
289
291
|
.command(surveyCommand)
|
|
290
292
|
.command(bundleCommand)
|
|
291
293
|
.command(chatWindowCommand)
|
package/lib/commands/booking.js
CHANGED
|
@@ -299,6 +299,26 @@ export const bookingCommand = {
|
|
|
299
299
|
})
|
|
300
300
|
.demandCommand(1, 'Specify an availability action: list | get | create | update | delete'),
|
|
301
301
|
})
|
|
302
|
+
// -- link (signed public booking link slug; POST /Bookings/Slug) ----------------
|
|
303
|
+
.command({
|
|
304
|
+
command: 'link <action>',
|
|
305
|
+
describe: 'Public booking link slugs (signed; required by the public slots/bookings endpoints)',
|
|
306
|
+
builder: y => y
|
|
307
|
+
.command({
|
|
308
|
+
command: 'create',
|
|
309
|
+
describe: 'Issue a signed booking link slug, optionally scoped to a resource and/or service',
|
|
310
|
+
builder: y2 => y2
|
|
311
|
+
.option('resource-id', { type: 'number', describe: 'Limit the link to one bookable resource' })
|
|
312
|
+
.option('service-id', { type: 'number', describe: 'Limit the link to one bookable service' }),
|
|
313
|
+
handler: runCommand(async argv => {
|
|
314
|
+
const r = await messagingPost('/Bookings/Slug', { resourceId: argv['resource-id'], serviceId: argv['service-id'] });
|
|
315
|
+
console.log(`
|
|
316
|
+
✓ Booking link slug: ${r.slug}
|
|
317
|
+
`);
|
|
318
|
+
}),
|
|
319
|
+
})
|
|
320
|
+
.demandCommand(1, 'Specify a link action: create'),
|
|
321
|
+
})
|
|
302
322
|
// -- appointment (Phase 1c: real bookings, staff-facing) ------------------------
|
|
303
323
|
.command({
|
|
304
324
|
command: 'appointment <action>',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { messagingGet } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
// -- velaro workforce ----------------------------------------------------------
|
|
5
|
+
// Read-only view of each work schedule's Workforce Management settings.
|
|
6
|
+
// Backend: velaro-messaging GET WorkSchedules (siteId from the vmsg-siteId header, never an arg).
|
|
7
|
+
// Writes are UI-only (Settings > Schedules): the WorkSchedules save replaces the whole set.
|
|
8
|
+
export const workforceCommand = {
|
|
9
|
+
command: 'workforce',
|
|
10
|
+
describe: 'Show Workforce Management settings (break allowance, enforce availability, after-hours action) per schedule',
|
|
11
|
+
builder: (y) => y.option('json', { type: 'boolean', default: false, describe: 'Raw JSON output' }),
|
|
12
|
+
handler: runCommand(async (argv) => {
|
|
13
|
+
const rows = await messagingGet('/WorkSchedules');
|
|
14
|
+
const list = Array.isArray(rows) ? rows : (rows?.schedules ?? []);
|
|
15
|
+
if (argv.json) { console.log(JSON.stringify(list, null, 2)); return; }
|
|
16
|
+
if (list.length === 0) { console.log('No work schedules configured.'); return; }
|
|
17
|
+
for (const x of list) {
|
|
18
|
+
console.log(`[${x.id}] ${x.name}: break ${x.dailyBreakAllowanceMinutes ?? 0}m, enforce availability ${x.enforceAvailability ? 'on' : 'off'}, after hours ${x.afterHoursAction ?? 'None'}`);
|
|
19
|
+
}
|
|
20
|
+
}),
|
|
21
|
+
};
|
package/package.json
CHANGED