@velaro/cli 1.4.98 → 1.4.99
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
|
@@ -26,6 +26,7 @@ import { statusCommand } from '../lib/commands/status.js';
|
|
|
26
26
|
import { activityCommand } from '../lib/commands/activity.js';
|
|
27
27
|
import { ruleCommand } from '../lib/commands/rule.js';
|
|
28
28
|
import { teamCommand } from '../lib/commands/team.js';
|
|
29
|
+
import { dynamicsCommand } from '../lib/commands/dynamics.js';
|
|
29
30
|
import { workflowCommand } from '../lib/commands/workflow.js';
|
|
30
31
|
import { aiConfigCommand } from '../lib/commands/ai-config.js';
|
|
31
32
|
import { deploymentCommand } from '../lib/commands/deployment.js';
|
|
@@ -39,6 +40,7 @@ import { calendlyCommand } from '../lib/commands/calendly.js';
|
|
|
39
40
|
import { copilotStudioCommand } from '../lib/commands/copilotstudio.js';
|
|
40
41
|
import { acuityCommand } from '../lib/commands/acuity.js';
|
|
41
42
|
import { avatarCommand } from '../lib/commands/avatar.js';
|
|
43
|
+
import { imageAnalysisCommand } from '../lib/commands/image-analysis.js';
|
|
42
44
|
import { integrationCommand } from '../lib/commands/integration.js';
|
|
43
45
|
import { appointmentsCommand } from '../lib/commands/appointments.js';
|
|
44
46
|
import { bookingCommand } from '../lib/commands/booking.js';
|
|
@@ -160,6 +162,7 @@ await yargs(hideBin(process.argv))
|
|
|
160
162
|
.command(activityCommand)
|
|
161
163
|
.command(ruleCommand)
|
|
162
164
|
.command(teamCommand)
|
|
165
|
+
.command(dynamicsCommand)
|
|
163
166
|
.command(workflowCommand)
|
|
164
167
|
.command(aiConfigCommand)
|
|
165
168
|
.command(deploymentCommand)
|
|
@@ -173,6 +176,7 @@ await yargs(hideBin(process.argv))
|
|
|
173
176
|
.command(copilotStudioCommand)
|
|
174
177
|
.command(acuityCommand)
|
|
175
178
|
.command(avatarCommand)
|
|
179
|
+
.command(imageAnalysisCommand)
|
|
176
180
|
.command(integrationCommand)
|
|
177
181
|
.command(appointmentsCommand)
|
|
178
182
|
.command(bookingCommand)
|
|
@@ -4,14 +4,16 @@ import { runCommand } from '../run.js';
|
|
|
4
4
|
const print = (data) => console.log(JSON.stringify(data, null, 2));
|
|
5
5
|
const list = (v) => (v == null ? [] : String(v).split(',').map((s) => s.trim()).filter(Boolean));
|
|
6
6
|
|
|
7
|
-
// velaro chat-topics <show|set|template|merge|rename|retire|group|group-suggestions|suggestions|accept|dismiss|
|
|
7
|
+
// velaro chat-topics <show|settings|set|template|merge|rename|retire|group|group-suggestions|suggestions|accept|dismiss|
|
|
8
8
|
// reclassify-estimate|reclassify|analysis-estimate|analysis|proposal>
|
|
9
9
|
// REST: messaging /ChatIntelligenceTopics/* (site comes from the CLI session, never an argument)
|
|
10
10
|
export const chatIntelligenceTopicsCommand = {
|
|
11
11
|
command: 'chat-topics <action>',
|
|
12
12
|
describe: 'Chat Intelligence topics: edit the list, merge/rename/group (no AI cost), suggested topics, optional reclassify and analysis',
|
|
13
13
|
builder: (y) => y
|
|
14
|
-
.positional('action', { choices: ['show', 'set', 'template', 'merge', 'rename', 'retire', 'group', 'group-suggestions', 'suggestions', 'accept', 'dismiss', 'reclassify-estimate', 'reclassify', 'analysis-estimate', 'analysis', 'proposal'] })
|
|
14
|
+
.positional('action', { choices: ['show', 'settings', 'set', 'template', 'merge', 'rename', 'retire', 'group', 'group-suggestions', 'suggestions', 'accept', 'dismiss', 'reclassify-estimate', 'reclassify', 'analysis-estimate', 'analysis', 'proposal'] })
|
|
15
|
+
.option('multi-topic', { type: 'boolean', describe: 'settings: turn multi-topic tracking on (--multi-topic) or off (--no-multi-topic); omit to just show' })
|
|
16
|
+
.option('re-eval', { type: 'number', describe: 'settings: re-check after N new visitor messages (1-50)' })
|
|
15
17
|
.option('topics', { type: 'string', describe: 'set: comma-separated topic list' })
|
|
16
18
|
.option('industry', { type: 'string', describe: 'template: insurance|healthcare|retail|ecommerce|financial|saas|government|manufacturing' })
|
|
17
19
|
.option('from', { type: 'string', describe: 'merge/rename/retire/group: comma-separated topics' })
|
|
@@ -29,6 +31,9 @@ export const chatIntelligenceTopicsCommand = {
|
|
|
29
31
|
const ops = (op) => messagingPost(`${base}/mapping`, { ops: [{ op, from: list(a.from), to: a.to ?? null, group: a.group ?? null }] });
|
|
30
32
|
switch (a.action) {
|
|
31
33
|
case 'show': return print(await messagingGet(base));
|
|
34
|
+
case 'settings':
|
|
35
|
+
if (a.multiTopic == null && a.reEval == null) return print(await messagingGet(`${base}/settings`));
|
|
36
|
+
return print(await messagingPut(`${base}/settings`, { themeMultiTopicEnabled: a.multiTopic ?? null, themeReEvalEveryNMessages: a.reEval ?? null }));
|
|
32
37
|
case 'set': return print(await messagingPut(base, { topics: list(a.topics) }));
|
|
33
38
|
case 'template': return print(await messagingPost(`${base}/template`, { industry: a.industry }));
|
|
34
39
|
case 'merge': case 'rename': case 'retire': case 'group': return print(await ops(a.action));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { request } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
// ── velaro dynamics team-overrides ────────────────────────────────────────────
|
|
5
|
+
// Per-team (group) override of Dynamics field mappings + activity type.
|
|
6
|
+
// Effective value = team override ?? the connection's own setting ("apply to all groups" default).
|
|
7
|
+
// Site is resolved server-side from the caller's credentials, never passed by the client.
|
|
8
|
+
|
|
9
|
+
const base = (config) => `/Dynamics/Configs/${config}/team-overrides`;
|
|
10
|
+
|
|
11
|
+
export const dynamicsCommand = {
|
|
12
|
+
command: 'dynamics <subcommand>',
|
|
13
|
+
describe: 'Dynamics 365 integration settings',
|
|
14
|
+
builder: yargs => yargs
|
|
15
|
+
.command({
|
|
16
|
+
command: 'team-overrides <action>',
|
|
17
|
+
describe: 'Per-team overrides of field mappings / activity type (get | set | reset)',
|
|
18
|
+
builder: y => y
|
|
19
|
+
.positional('action', { choices: ['get', 'set', 'reset'] })
|
|
20
|
+
.option('config', { type: 'number', demandOption: true, describe: 'Dynamics config id (velaro dynamics config list in the admin UI)' })
|
|
21
|
+
.option('team', { type: 'number', describe: 'Team id (required for set/reset; see: velaro team list)' })
|
|
22
|
+
.option('activity', { type: 'string', describe: 'Activity logical name (e.g. phonecall, task). Empty string = inherit the default.' })
|
|
23
|
+
.option('mappings', { type: 'string', describe: 'customFieldMappingsJson (JSON array). Empty string = inherit the default.' }),
|
|
24
|
+
handler: runCommand(async argv => {
|
|
25
|
+
if (argv.action === 'get') {
|
|
26
|
+
const data = await request('GET', base(argv.config));
|
|
27
|
+
console.log(JSON.stringify(data, null, 2));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!argv.team) throw new Error('--team is required for set/reset');
|
|
31
|
+
if (argv.action === 'reset') {
|
|
32
|
+
console.log(JSON.stringify(await request('DELETE', `${base(argv.config)}/${argv.team}`), null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const body = {};
|
|
36
|
+
if (argv.activity !== undefined) body.activityLogicalName = argv.activity;
|
|
37
|
+
if (argv.mappings !== undefined) body.customFieldMappingsJson = argv.mappings;
|
|
38
|
+
if (!Object.keys(body).length) throw new Error('Pass --activity and/or --mappings (omitted fields are left unchanged).');
|
|
39
|
+
console.log(JSON.stringify(await request('PUT', `${base(argv.config)}/${argv.team}`, body), null, 2));
|
|
40
|
+
}),
|
|
41
|
+
})
|
|
42
|
+
.demandCommand(1, 'Specify a subcommand: team-overrides'),
|
|
43
|
+
handler: () => {},
|
|
44
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { request } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
// velaro image-analysis limits --site N
|
|
5
|
+
// Shows the Image Analysis (analyze_image) add-on cap and usage for any site (Velaro admin only).
|
|
6
|
+
// To change the cap: velaro support set-limit --site N --key MaxImageAnalysesPerMonth --value 500
|
|
7
|
+
export const imageAnalysisCommand = {
|
|
8
|
+
command: 'image-analysis <subcommand>',
|
|
9
|
+
describe: 'Image Analysis add-on limits and usage (Velaro admin only)',
|
|
10
|
+
builder: yargs => yargs
|
|
11
|
+
.command({
|
|
12
|
+
command: 'limits',
|
|
13
|
+
describe: 'Show monthly cap, usage this month and per-chat cap for a site',
|
|
14
|
+
builder: y => y.option('site', { type: 'number', demandOption: true, describe: 'Site ID' }),
|
|
15
|
+
handler: runCommand(async argv => {
|
|
16
|
+
const d = await request('GET', `/ImageAnalysisLimits/superadmin?siteId=${argv.site}`);
|
|
17
|
+
const ent = d.entitled === null ? 'unknown' : d.entitled ? 'yes' : 'no';
|
|
18
|
+
console.log(`\nSite ${argv.site}: Image Analysis`);
|
|
19
|
+
console.log(` Entitled: ${ent}`);
|
|
20
|
+
console.log(` Monthly cap: ${d.monthlyCap} (effective ${d.effectiveMonthlyCap}, hard cap, no automatic overage)`);
|
|
21
|
+
console.log(` Used this month: ${d.usedThisMonth === null ? 'unknown' : d.usedThisMonth}`);
|
|
22
|
+
console.log(` Per-chat cap: ${d.perConversationCap}`);
|
|
23
|
+
console.log(` Extra block size: ${d.blockSize}\n`);
|
|
24
|
+
}),
|
|
25
|
+
})
|
|
26
|
+
.demandCommand(1),
|
|
27
|
+
};
|
|
@@ -108,9 +108,10 @@ export const qualityCommand = {
|
|
|
108
108
|
export const chatIntelligenceThemesCommand = {
|
|
109
109
|
command: 'chat-intelligence',
|
|
110
110
|
describe: 'Chat Intelligence themes, optionally per website/team',
|
|
111
|
-
builder: (y) => scope(y.option('from', { type: 'string' }).option('to', { type: 'string' }).option('group-by', { type: 'string', default: 'month' })),
|
|
111
|
+
builder: (y) => scope(y.option('from', { type: 'string' }).option('to', { type: 'string' }).option('group-by', { type: 'string', default: 'month' }).option('include-secondary', { type: 'boolean', default: false, describe: 'Also show secondary topics (needs the site multi-topic setting on)' })),
|
|
112
112
|
handler: runCommand(async (a) => {
|
|
113
113
|
const qs = new URLSearchParams({ groupBy: a.groupBy });
|
|
114
|
+
if (a.includeSecondary) qs.set('includeSecondary', 'true');
|
|
114
115
|
if (a.from) qs.set('startDate', a.from);
|
|
115
116
|
if (a.to) qs.set('endDate', a.to);
|
|
116
117
|
if (a.deployment != null) qs.set('deploymentId', String(a.deployment));
|
package/package.json
CHANGED