@velaro/cli 1.4.172 → 1.4.173
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/moshky-write-access.js +28 -0
- package/package.json +1 -1
package/bin/velaro.js
CHANGED
|
@@ -57,6 +57,7 @@ import { aiFieldExtractionCommand } from '../lib/commands/ai-field-extraction.js
|
|
|
57
57
|
import { sentimentCommand, qualityCommand, chatIntelligenceThemesCommand } from '../lib/commands/quality-reports.js';
|
|
58
58
|
import { cannedLearningCommand } from '../lib/commands/canned-learning.js';
|
|
59
59
|
import { csatOverrideUnapproveCommand } from '../lib/commands/csat-override.js';
|
|
60
|
+
import { moshkyWriteAccessCommand } from '../lib/commands/moshky-write-access.js';
|
|
60
61
|
import { chatIntelligenceTopicsCommand } from '../lib/commands/chat-intelligence-topics.js';
|
|
61
62
|
import { focusCommand } from '../lib/commands/focus.js';
|
|
62
63
|
import { automationDraftCommand } from '../lib/commands/automation-draft.js';
|
|
@@ -216,6 +217,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
|
|
|
216
217
|
.command(cannedLearningCommand)
|
|
217
218
|
.command(chatIntelligenceTopicsCommand)
|
|
218
219
|
.command(csatOverrideUnapproveCommand)
|
|
220
|
+
.command(moshkyWriteAccessCommand)
|
|
219
221
|
.command(focusCommand)
|
|
220
222
|
.command(automationDraftCommand)
|
|
221
223
|
.command(magentoCommand)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { get as adminGet, put as adminPut } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
// velaro moshky-write-access show state + consent version
|
|
5
|
+
// velaro moshky-write-access --on --acknowledge --consent-version <v> turn on (customer accepted the consent text)
|
|
6
|
+
// velaro moshky-write-access --off turn off
|
|
7
|
+
// REST: admin GET/PUT /Copilot/WriteAccess (site comes from the session; audit-logged)
|
|
8
|
+
export const moshkyWriteAccessCommand = {
|
|
9
|
+
command: 'moshky-write-access',
|
|
10
|
+
describe: "Show or change 'Moshky can make changes' for this site",
|
|
11
|
+
builder: (y) => y
|
|
12
|
+
.option('on', { type: 'boolean', describe: 'Turn on (needs --acknowledge and --consent-version)' })
|
|
13
|
+
.option('off', { type: 'boolean', describe: 'Turn off' })
|
|
14
|
+
.option('acknowledge', { type: 'boolean', describe: 'Customer accepted the consent text' })
|
|
15
|
+
.option('consent-version', { type: 'string', describe: 'Version from the show output' }),
|
|
16
|
+
handler: runCommand(async (a) => {
|
|
17
|
+
if (a.on && a.off) throw new Error('choose --on or --off, not both');
|
|
18
|
+
if (!a.on && !a.off) {
|
|
19
|
+
console.log(JSON.stringify(await adminGet('/Copilot/WriteAccess'), null, 2));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(JSON.stringify(await adminPut('/Copilot/WriteAccess', {
|
|
23
|
+
enabled: !!a.on,
|
|
24
|
+
acknowledged: !!a.acknowledge,
|
|
25
|
+
consentVersion: a['consent-version'] || '',
|
|
26
|
+
}), null, 2));
|
|
27
|
+
}),
|
|
28
|
+
};
|
package/package.json
CHANGED