@velaro/cli 1.4.78 → 1.4.79
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/lib/commands/support.js +20 -1
- package/package.json +1 -1
package/lib/commands/support.js
CHANGED
|
@@ -12,6 +12,20 @@ async function toggleFlag(args) {
|
|
|
12
12
|
console.log(`✅ Site ${args.site}: ${result.flag} ${result.oldValue} → ${result.newValue}`);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
async function setLimit(args) {
|
|
16
|
+
const n = Number(args.value);
|
|
17
|
+
if (!args.site || !args.key || !Number.isInteger(n) || n < 0) {
|
|
18
|
+
console.error('Usage: velaro support set-limit --site 1032 --key maxBotTurnsPerMonth --value 10000');
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
const result = await request('POST', `SupportTools/sites/${args.site}/subscription/bulk-flags`, { flags: { [args.key]: n } });
|
|
22
|
+
console.log(`Site ${args.site}: applied ${(result.applied || []).join(', ') || '(none)'}`);
|
|
23
|
+
if ((result.skipped || []).length) {
|
|
24
|
+
console.error(`Skipped: ${result.skipped.join(', ')}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
15
29
|
async function scraperCreateJob(args) {
|
|
16
30
|
if (!args.site || !args.urls) {
|
|
17
31
|
console.error('Usage: velaro support scraper-create-job --site 1032 --urls "https://example.com" [--maxPages 30] [--crawlDepth 2] [--name "job name"]');
|
|
@@ -197,6 +211,11 @@ export function supportCommand(yargs) {
|
|
|
197
211
|
.option('flag', { type: 'string', demandOption: true, desc: 'Flag name, e.g. EnableScraperBotIndexing (must be on SupportToolsController.AllowedFeatureFlags)' })
|
|
198
212
|
.option('enabled', { type: 'string', demandOption: true, desc: 'true or false' })
|
|
199
213
|
, a => toggleFlag(a))
|
|
214
|
+
.command('set-limit', 'Set a numeric Subscription cap on a site, e.g. maxBotTurnsPerMonth (superadmin only; 0 = plan value, never unlimited)', y => y
|
|
215
|
+
.option('site', { type: 'number', demandOption: true, desc: 'Site ID' })
|
|
216
|
+
.option('key', { type: 'string', demandOption: true, desc: 'Cap name, e.g. maxBotTurnsPerMonth' })
|
|
217
|
+
.option('value', { type: 'number', demandOption: true, desc: 'Whole number >= 0' })
|
|
218
|
+
, a => setLimit(a))
|
|
200
219
|
.command('scraper-create-job', 'Trigger a scraper job on behalf of any site (superadmin only — no need to be logged in as that site\'s own user)', y => y
|
|
201
220
|
.option('site', { type: 'number', demandOption: true, desc: 'Target site ID' })
|
|
202
221
|
.option('urls', { type: 'string', demandOption: true, desc: 'Comma-separated URLs to crawl' })
|
|
@@ -211,5 +230,5 @@ export function supportCommand(yargs) {
|
|
|
211
230
|
.option('channel', { type: 'string', desc: 'Conversation source, e.g. Web, TwilioSms (default Web)' })
|
|
212
231
|
.option('overrideIndexes', { type: 'string', desc: 'Comma-separated index names to override the config\'s own IndexName for this query' })
|
|
213
232
|
, a => chatQuery(a))
|
|
214
|
-
.demandCommand(1, 'Specify a subcommand: deployments | impersonate | agent-lookup | add-site-user | toggle-flag | scraper-create-job | chat-query | send-email | tour-insights | connection-timeline | connection-evidence');
|
|
233
|
+
.demandCommand(1, 'Specify a subcommand: deployments | impersonate | agent-lookup | add-site-user | toggle-flag | set-limit | scraper-create-job | chat-query | send-email | tour-insights | connection-timeline | connection-evidence');
|
|
215
234
|
}
|
package/package.json
CHANGED