@velaro/cli 1.4.223 → 1.4.224
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/appointments.js +23 -1
- package/lib/commands/scheduler.js +30 -0
- package/package.json +1 -1
package/bin/velaro.js
CHANGED
|
@@ -41,6 +41,7 @@ import { copilotStudioCommand } from '../lib/commands/copilotstudio.js';
|
|
|
41
41
|
import { applePayPresetCommand } from '../lib/commands/apple-pay-preset.js';
|
|
42
42
|
import { integrationCommand } from '../lib/commands/integration.js';
|
|
43
43
|
import { appointmentsCommand } from '../lib/commands/appointments.js';
|
|
44
|
+
import { schedulerCommand } from '../lib/commands/scheduler.js';
|
|
44
45
|
import { publicApiCommand } from '../lib/commands/public-api.js';
|
|
45
46
|
import { bookingDefaultsCommand } from '../lib/commands/booking-defaults.js';
|
|
46
47
|
import { bookingCommand } from '../lib/commands/booking.js';
|
|
@@ -216,6 +217,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
|
|
|
216
217
|
.command(applePayPresetCommand)
|
|
217
218
|
.command(integrationCommand)
|
|
218
219
|
.command(appointmentsCommand)
|
|
220
|
+
.command(schedulerCommand)
|
|
219
221
|
.command(publicApiCommand)
|
|
220
222
|
.command(bookingDefaultsCommand)
|
|
221
223
|
.command(bookingCommand)
|
|
@@ -194,5 +194,27 @@ export const appointmentsCommand = {
|
|
|
194
194
|
console.log(`\n✓ Appointment ${argv.appointmentId} status set to ${statusLabel(result.status)}.\n`);
|
|
195
195
|
}),
|
|
196
196
|
})
|
|
197
|
-
.
|
|
197
|
+
.command({
|
|
198
|
+
command: 'get-scheduler',
|
|
199
|
+
describe: 'Show which scheduler receives new bookings',
|
|
200
|
+
handler: runCommand(async () => {
|
|
201
|
+
const r = await messagingGet('/Appointments/Settings');
|
|
202
|
+
console.log(`
|
|
203
|
+
New bookings go to: ${r?.writeTargetSlug || 'Velaro (first connected calendar)'}
|
|
204
|
+
`);
|
|
205
|
+
}),
|
|
206
|
+
})
|
|
207
|
+
.command({
|
|
208
|
+
command: 'set-scheduler <slug>',
|
|
209
|
+
describe: 'Choose the scheduler for new bookings (GoogleCalendar | OutlookCalendar | MicrosoftBookings | Calendly | Acuity | CalCom | none for Velaro)',
|
|
210
|
+
builder: y => y.positional('slug', { describe: 'Provider slug, or "none"', type: 'string' }),
|
|
211
|
+
handler: runCommand(async (argv) => {
|
|
212
|
+
const slug = argv.slug.toLowerCase() === 'none' ? null : argv.slug;
|
|
213
|
+
await messagingPost('/Appointments/Settings', { writeTargetSlug: slug });
|
|
214
|
+
console.log(`
|
|
215
|
+
✓ New bookings now go to ${slug ?? 'Velaro (first connected calendar)'}.
|
|
216
|
+
`);
|
|
217
|
+
}),
|
|
218
|
+
})
|
|
219
|
+
.demandCommand(1, 'Specify a subcommand: list-slots | book | manage | install-template | manual-book | list-appointments | set-status | get-scheduler | set-scheduler'),
|
|
198
220
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { messagingGet, messagingPost } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
// velaro scheduler get | set <slug>
|
|
5
|
+
// Mirrors the scheduler_selection_get / scheduler_selection_update MCP tools.
|
|
6
|
+
// Same endpoints as `velaro appointments get-scheduler|set-scheduler` (kept as aliases).
|
|
7
|
+
export const schedulerCommand = {
|
|
8
|
+
command: 'scheduler <subcommand>',
|
|
9
|
+
describe: 'Choose which calendar/scheduler receives new bookings',
|
|
10
|
+
builder: yargs => yargs
|
|
11
|
+
.command({
|
|
12
|
+
command: 'get',
|
|
13
|
+
describe: 'Show which scheduler receives new bookings',
|
|
14
|
+
handler: runCommand(async () => {
|
|
15
|
+
const r = await messagingGet('/Appointments/Settings');
|
|
16
|
+
console.log(`\nNew bookings go to: ${r?.writeTargetSlug || 'Velaro (first connected calendar)'}\n`);
|
|
17
|
+
}),
|
|
18
|
+
})
|
|
19
|
+
.command({
|
|
20
|
+
command: 'set <slug>',
|
|
21
|
+
describe: 'Choose the scheduler (GoogleCalendar | OutlookCalendar | MicrosoftBookings | Calendly | Acuity | CalCom | none for Velaro)',
|
|
22
|
+
builder: y => y.positional('slug', { describe: 'Provider slug, or "none"', type: 'string' }),
|
|
23
|
+
handler: runCommand(async (argv) => {
|
|
24
|
+
const slug = argv.slug.toLowerCase() === 'none' ? null : argv.slug;
|
|
25
|
+
await messagingPost('/Appointments/Settings', { writeTargetSlug: slug });
|
|
26
|
+
console.log(`\n✓ New bookings now go to ${slug ?? 'Velaro (first connected calendar)'}.\n`);
|
|
27
|
+
}),
|
|
28
|
+
})
|
|
29
|
+
.demandCommand(1, 'Specify a subcommand: get | set'),
|
|
30
|
+
};
|
package/package.json
CHANGED