@velaro/cli 1.4.251 → 1.4.253

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.
@@ -19,6 +19,7 @@ export const kbCommand = {
19
19
  .command(overrideCommand)
20
20
  .command(contentCommand)
21
21
  .command(settingsCommand)
22
+ .command(domainCommand)
22
23
  .command(statusCommand)
23
24
  .command(tenantCommand)
24
25
  .demandCommand(1, 'Specify a subcommand: article, qna, override, content, reindex, settings, status, swap-connection, tenant'),
@@ -82,6 +83,40 @@ const statusCommand = {
82
83
  // Settings — branding, domain, layout, SEO/analytics
83
84
  // ────────────────────────────────────────────────────────────────────────────
84
85
 
86
+ const domainCommand = {
87
+ command: 'domain <subcommand>',
88
+ describe: 'Your help center custom domain: get, set, verify',
89
+ builder: (yargs) =>
90
+ yargs
91
+ .command({
92
+ command: 'get', describe: 'Show your custom domain, its status and the CNAME target',
93
+ handler: runCommand(async () => { console.log(JSON.stringify(await get('/api/kb/settings/domain'), null, 2)); }),
94
+ })
95
+ .command({
96
+ command: 'set <domain>', describe: 'Set your custom domain, e.g. help.acme.com. Pass "" to clear.',
97
+ builder: (y) => y.positional('domain', { type: 'string' }),
98
+ handler: runCommand(async (argv) => {
99
+ const c = await get('/api/kb/settings');
100
+ await post('/api/kb/settings', {
101
+ companyName: c.companyName ?? '', themeColor: c.themeColor ?? '', themePreset: c.themePreset ?? null,
102
+ headerText: c.headerText ?? '', returnLinkText: c.returnLinkText ?? '', returnLinkUrl: c.returnLinkUrl ?? '',
103
+ logoUrl: c.logoUrl ?? '', domain: String(argv.domain ?? '').trim(), topicLayout: c.topicLayout ?? 'grid',
104
+ articleLayout: c.articleLayout ?? 'table', showLastUpdated: c.showLastUpdated ?? true,
105
+ enableLiveChat: c.enableLiveChat ?? false, liveChatGroupId: c.liveChatGroupId ?? 0,
106
+ enableKbBot: c.enableKbBot ?? false, kbChatWindowId: c.kbChatWindowId ?? 0,
107
+ seoMetaDescription: c.seoMetaDescription ?? '', ga4MeasurementId: c.ga4MeasurementId ?? '',
108
+ });
109
+ console.log(JSON.stringify(await get('/api/kb/settings/domain'), null, 2));
110
+ }),
111
+ })
112
+ .command({
113
+ command: 'verify', describe: 'Check now whether your domain resolves to Velaro',
114
+ handler: runCommand(async () => { console.log(JSON.stringify(await post('/api/kb/settings/domain/verify', {}), null, 2)); }),
115
+ })
116
+ .demandCommand(1, 'Specify: get, set, verify'),
117
+ handler: () => {},
118
+ };
119
+
85
120
  const settingsCommand = {
86
121
  command: 'settings <subcommand>',
87
122
  describe: 'View or update Knowledge Base settings (branding, domain, layout, SEO/analytics)',
@@ -168,14 +168,30 @@ export const teamsCommand = {
168
168
  .option('daily-digest', { type: 'boolean', describe: 'Daily digest on/off' })
169
169
  .option('pin', { type: 'number', describe: 'Pin alerts to this Teams destination (a refId from --list-targets)' })
170
170
  .option('unpin', { type: 'boolean', describe: 'Unpin and use the most recently active Teams conversation' })
171
+ .option('list-channels', { type: 'boolean', describe: 'List every channel of the connected Teams tenant (needs admin consent; falls back to contacted channels with a message)' })
172
+ .option('adopt-channel', { type: 'string', describe: 'Make a listed channel a destination: teamId:channelId (prints its refId)' })
171
173
  .option('list-targets', { type: 'boolean', describe: 'List the Teams destinations alerts can be pinned to' })
172
174
  .option('daily-cap', { type: 'number', describe: 'Max alerts per day for this account' })
173
175
  .option('reset-daily-cap', { type: 'boolean', describe: 'Clear the account cap and use the platform default' })
174
176
  .option('status-every', { type: 'number', describe: 'Post a status into the channel every N minutes (5-1440; plan limits apply)' })
175
177
  .option('status-off', { type: 'boolean', describe: 'Stop the scheduled status posts' })
176
178
  .option('status-when-queue', { type: 'number', describe: 'Post a status as soon as this many chats are waiting (0 = no limit)' })
177
- .option('status-when-wait', { type: 'number', describe: 'Post a status as soon as the longest wait reaches this many minutes (0 = no limit)' }),
179
+ .option('status-when-wait', { type: 'number', describe: 'Post a status as soon as the longest wait reaches this many minutes (0 = no limit)' })
180
+ .option('channel-mode', { type: 'string', choices: ['mention', 'all'], describe: 'Team channels and group chats: mention (default, only when @mentioned) or all' })
181
+ .option('personal-free-text', { type: 'boolean', describe: 'In a 1:1 chat answer free text (default) or commands only (--no-personal-free-text)' })
182
+ .option('route', { type: 'array', string: true, describe: 'Send an event to a destination: event=refId (repeatable), for example --route new_chat=12' })
183
+ .option('unroute', { type: 'array', string: true, describe: 'Send an event back to the default destination (repeatable)' }),
178
184
  async (argv) => {
185
+ if (argv.listChannels) {
186
+ console.log(JSON.stringify(await request('GET', '/TeamsBot/PushTargets/Channels'), null, 2));
187
+ return;
188
+ }
189
+ if (argv.adoptChannel) {
190
+ const [teamId, channelId] = String(argv.adoptChannel).split(':');
191
+ if (!teamId || !channelId) throw new Error('--adopt-channel expects teamId:channelId');
192
+ console.log(JSON.stringify(await request('POST', '/TeamsBot/PushTargets/AdoptChannel', { teamId, channelId }), null, 2));
193
+ return;
194
+ }
179
195
  if (argv.listTargets) {
180
196
  console.log(JSON.stringify(await request('GET', '/TeamsBot/PushTargets'), null, 2));
181
197
  return;
@@ -194,6 +210,18 @@ export const teamsCommand = {
194
210
  if (argv.statusOff) body.clearStatusPost = true;
195
211
  if (argv.statusWhenQueue !== undefined) body.statusAlertQueue = argv.statusWhenQueue;
196
212
  if (argv.statusWhenWait !== undefined) body.statusAlertWaitMinutes = argv.statusWhenWait;
213
+ if (argv.channelMode !== undefined) body.channelMode = argv.channelMode;
214
+ if (argv.personalFreeText !== undefined) body.personalFreeText = argv.personalFreeText;
215
+ if (argv.route && argv.route.length) {
216
+ body.eventDestinations = {};
217
+ for (const pair of argv.route) {
218
+ const [ev, id] = String(pair).split('=');
219
+ const n = parseInt(id, 10);
220
+ if (!ev || !Number.isFinite(n)) throw new Error(`--route expects event=refId, got "${pair}"`);
221
+ body.eventDestinations[ev] = n;
222
+ }
223
+ }
224
+ if (argv.unroute && argv.unroute.length) body.clearEventDestinations = argv.unroute.map(String);
197
225
  const result = Object.keys(body).length
198
226
  ? await request('PUT', '/TeamsBot/PushSettings', body)
199
227
  : await request('GET', '/TeamsBot/PushSettings');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.251",
3
+ "version": "1.4.253",
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": {