@velaro/cli 1.4.219 → 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.
@@ -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 }));
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.219",
3
+ "version": "1.4.220",
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": {