@velaro/cli 1.4.218 → 1.4.220
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
|
@@ -149,6 +149,7 @@ import { billingInsightsGroup } from '../lib/commands/billing-insights.js';
|
|
|
149
149
|
import { supportTicketsCommand } from '../lib/commands/support-tickets.js';
|
|
150
150
|
import { aiAckGroup } from '../lib/commands/ai-ack.js';
|
|
151
151
|
import { afterHoursSupportCommand } from '../lib/commands/after-hours-support.js';
|
|
152
|
+
import { automationAddonCommand } from '../lib/commands/automation-addon.js';
|
|
152
153
|
import { startUpdateCheck } from '../lib/update-check.js';
|
|
153
154
|
import { printBanner, printBannerIfFirstRun } from '../lib/banner.js';
|
|
154
155
|
import { createRequire } from 'module';
|
|
@@ -312,6 +313,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
|
|
|
312
313
|
.command(supportTicketsCommand)
|
|
313
314
|
.command(aiAckGroup)
|
|
314
315
|
.command(afterHoursSupportCommand)
|
|
316
|
+
.command(automationAddonCommand)
|
|
315
317
|
.command(usageCommand)
|
|
316
318
|
.command(campaignsCommand)
|
|
317
319
|
.command(senderDomainHealthCommand)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// velaro automation-addon: status, limits and usage of the Automation and API add-on, and pause / resume.
|
|
2
|
+
// Site scoping is server-side (token). Pausing needs a site administrator and keeps all keys, webhooks and settings.
|
|
3
|
+
import { request } from '../api.js';
|
|
4
|
+
|
|
5
|
+
function show(r) {
|
|
6
|
+
console.log(`\nAutomation and API: ${r.status}`);
|
|
7
|
+
const l = r.limits || {};
|
|
8
|
+
console.log(`API keys: ${l.maxApiKeys || 'unlimited'}`);
|
|
9
|
+
console.log(`API calls per month: ${l.maxApiCallsPerMonth || 'unlimited'}`);
|
|
10
|
+
console.log(`Webhook subscriptions: ${l.maxWebhookEndpoints || 'unlimited'}`);
|
|
11
|
+
console.log(`Webhook calls / month: ${l.maxWebhookInvocationsPerMonth || 'unlimited'}`);
|
|
12
|
+
console.log(`Workflow triggers / mo: ${l.maxWorkflowTriggersPerMonth || 'unlimited'}`);
|
|
13
|
+
for (const u of r.usage || []) console.log(` ${u.label}: ${u.used}${u.limit ? ' of ' + u.limit : ''}`);
|
|
14
|
+
console.log('');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const automationAddonCommand = {
|
|
18
|
+
command: 'automation-addon <subcommand>',
|
|
19
|
+
describe: 'Automation and API add-on: status, pause, resume',
|
|
20
|
+
builder: (yargs) =>
|
|
21
|
+
yargs
|
|
22
|
+
.command('get', 'Show status, limits and usage', {}, async () => show(await request('GET', 'AutomationAddon')))
|
|
23
|
+
.command('pause', 'Pause the add-on (keeps all configuration)', {}, async () => show(await request('PUT', 'AutomationAddon', { enabled: false })))
|
|
24
|
+
.command('resume', 'Resume the add-on', {}, async () => show(await request('PUT', 'AutomationAddon', { enabled: true })))
|
|
25
|
+
.demandCommand(1, 'Specify a subcommand: get | pause | resume'),
|
|
26
|
+
handler: () => {},
|
|
27
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// NetSuite role permissions the Velaro AI skills need. Keep in step with
|
|
2
|
+
// client/src/pages/Messaging/Integrations/NetSuite/NetSuiteRequiredPermissions.ts and CopilotNetSuiteSetupTools.cs.
|
|
3
|
+
const rows = [
|
|
4
|
+
['Connection', 'Log in using OAuth 2.0 Access Tokens', 'Setup', 'Full'],
|
|
5
|
+
['Connection', 'REST Web Services', 'Setup', 'Full'],
|
|
6
|
+
['SuiteQL', 'SuiteAnalytics Workbook', 'Reports', 'Edit'],
|
|
7
|
+
['SuiteQL', 'Find Transaction', 'Transactions', 'View'],
|
|
8
|
+
['Customers, contacts and leads', 'Customers', 'Lists', 'Full'],
|
|
9
|
+
['Customers, contacts and leads', 'Contacts', 'Lists', 'Full'],
|
|
10
|
+
['Orders', 'Sales Orders', 'Transactions', 'View'],
|
|
11
|
+
['Orders', 'Fulfill Orders', 'Transactions', 'View'],
|
|
12
|
+
['Orders', 'Opportunity', 'Transactions', 'View'],
|
|
13
|
+
['Products and inventory', 'Items', 'Lists', 'View'],
|
|
14
|
+
['Products and inventory', 'Check Item Availability', 'Lists', 'View'],
|
|
15
|
+
['Products and inventory', 'Locations', 'Lists', 'View'],
|
|
16
|
+
['Products and inventory', 'Subsidiaries', 'Setup', 'View'],
|
|
17
|
+
['Returns (RMA)', 'Return Authorization', 'Transactions', 'Create'],
|
|
18
|
+
['Cases', 'Cases', 'Lists', 'Full'],
|
|
19
|
+
['Cases', 'Track Messages', 'Lists', 'Create'],
|
|
20
|
+
['Cases', 'Messages for Analytics and REST', 'Lists', 'View'],
|
|
21
|
+
['Invoices, credit memos and payments', 'Invoice', 'Transactions', 'View'],
|
|
22
|
+
['Invoices, credit memos and payments', 'Credit Memo', 'Transactions', 'View'],
|
|
23
|
+
['Invoices, credit memos and payments', 'Customer Payment', 'Transactions', 'View'],
|
|
24
|
+
['Invoices, credit memos and payments', 'Cash Sale', 'Transactions', 'View'],
|
|
25
|
+
['Estimates and quotes', 'Quote / Estimate', 'Transactions', 'Create'],
|
|
26
|
+
['Purchasing', 'Purchase Order', 'Transactions', 'View'],
|
|
27
|
+
['Purchasing', 'Item Receipt', 'Transactions', 'View'],
|
|
28
|
+
['Purchasing', 'Bills', 'Transactions', 'View'],
|
|
29
|
+
['Purchasing', 'Vendors', 'Lists', 'View'],
|
|
30
|
+
['Notes and transcripts', 'Notes Tab', 'Lists', 'View'],
|
|
31
|
+
['Notes and transcripts', 'Employees', 'Lists', 'View'],
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export const NETSUITE_REQUIRED_PERMISSIONS = rows.map(([area, permission, subtab, level]) => ({ area, permission, subtab, level }));
|
package/lib/commands/netsuite.js
CHANGED
|
@@ -267,6 +267,41 @@ export const netsuiteCommand = {
|
|
|
267
267
|
.strict(),
|
|
268
268
|
handler: () => {},
|
|
269
269
|
})
|
|
270
|
+
.command({
|
|
271
|
+
command: 'permissions [configId]',
|
|
272
|
+
describe: 'List the NetSuite role permissions Velaro needs; with a config id, run the permission check on that connection',
|
|
273
|
+
handler: async argv => {
|
|
274
|
+
if (argv.configId == null) {
|
|
275
|
+
const { NETSUITE_REQUIRED_PERMISSIONS } = await import('./netsuite-permissions.js');
|
|
276
|
+
for (const p of NETSUITE_REQUIRED_PERMISSIONS) console.log(`${p.area} | ${p.subtab} > ${p.permission} (${p.level})`);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const r = await messagingPost(`/NetSuite/Configs/${encodeURIComponent(argv.configId)}/permission-preflight`, {});
|
|
280
|
+
console.log(JSON.stringify(r, null, 2));
|
|
281
|
+
},
|
|
282
|
+
})
|
|
283
|
+
.command({
|
|
284
|
+
command: 'transcript <action> <configId>',
|
|
285
|
+
describe: 'Show or change how transcripts are saved (get | set)',
|
|
286
|
+
builder: a => a.option('mode', { type: 'string' }).option('field', { type: 'string' }),
|
|
287
|
+
handler: async argv => {
|
|
288
|
+
if (argv.action === 'get') {
|
|
289
|
+
const list = await messagingGet('/NetSuite/Integrations/List');
|
|
290
|
+
const arr = Array.isArray(list) ? list : Object.values(list || {}).find(Array.isArray) || [];
|
|
291
|
+
const c = arr.find(x => String(x.id) === String(argv.configId));
|
|
292
|
+
if (!c) { console.error(`NetSuite config ${argv.configId} not found.`); process.exit(1); }
|
|
293
|
+
console.log(`mode: ${c.transcriptPushMode ?? '(default)'} field: ${c.transcriptFieldName ?? '(none)'}`);
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (argv.action !== 'set') { console.error('Use get or set.'); process.exit(1); }
|
|
297
|
+
const body = {};
|
|
298
|
+
if (argv.mode) body.transcriptPushMode = argv.mode;
|
|
299
|
+
if (argv.field) body.transcriptFieldName = argv.field;
|
|
300
|
+
if (!Object.keys(body).length) { console.error('Pass --mode and/or --field.'); process.exit(1); }
|
|
301
|
+
await messagingPut(`/NetSuite/Integrations/${encodeURIComponent(argv.configId)}`, body);
|
|
302
|
+
console.log(`Updated config ${argv.configId}: ${JSON.stringify(body)}`);
|
|
303
|
+
},
|
|
304
|
+
})
|
|
270
305
|
.demandCommand(1, 'Specify a netsuite subcommand.')
|
|
271
306
|
.strict(),
|
|
272
307
|
handler: () => {},
|
package/package.json
CHANGED