@velaro/cli 1.4.181 → 1.4.183

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
@@ -67,6 +67,7 @@ import { sapCommand } from '../lib/commands/sap.js';
67
67
  import { salesforceCommand } from '../lib/commands/salesforce.js';
68
68
  import { actionsCommand } from '../lib/commands/actions.js';
69
69
  import { mondayCommand } from '../lib/commands/monday.js';
70
+ import { makeCommand } from '../lib/commands/make.js';
70
71
  import { notionCommand } from '../lib/commands/notion.js';
71
72
  import { callrailCommand } from '../lib/commands/callrail.js';
72
73
  import { emailCampaignCommand } from '../lib/commands/email-campaign.js';
@@ -230,6 +231,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
230
231
  .command(salesforceCommand)
231
232
  .command(actionsCommand)
232
233
  .command(mondayCommand)
234
+ .command(makeCommand)
233
235
  .command(notionCommand)
234
236
  .command(callrailCommand)
235
237
  .command(emailCampaignCommand)
@@ -0,0 +1,57 @@
1
+ /**
2
+ * velaro make - Make (Integromat) Payload Fields
3
+ *
4
+ * velaro make fields Show the declared Payload Fields
5
+ * velaro make fields-set --fields a,b,c Replace the declared Payload Fields (empty clears them)
6
+ *
7
+ * Declared fields are the required keys of the AI tool; the AI is told the exact keys and
8
+ * a call with other keys is returned to it with the valid keys so it can retry.
9
+ */
10
+
11
+ import { request } from '../api.js';
12
+
13
+ const GRN = '\x1b[32m';
14
+ const RED = '\x1b[31m';
15
+ const BOLD = '\x1b[1m';
16
+ const RST = '\x1b[0m';
17
+ const PATH = '/Make/attribute-allowlist?kind=data';
18
+
19
+ async function fieldsHandler() {
20
+ const res = await request('GET', PATH);
21
+ const keys = Array.isArray(res?.allowedKeys) ? res.allowedKeys : [];
22
+ console.log(`\n${BOLD}Make Payload Fields (${keys.length})${RST}\n`);
23
+ console.log(keys.length ? keys.map(k => ` ${k}`).join('\n') : ' none declared: the AI chooses its own keys');
24
+ console.log('');
25
+ }
26
+
27
+ async function fieldsSetHandler(argv) {
28
+ const raw = typeof argv.fields === 'string' ? argv.fields : '';
29
+ const keys = raw.split(',').map(k => k.trim()).filter(Boolean);
30
+ const bad = keys.find(k => !/^[A-Za-z0-9_-]{1,100}$/.test(k));
31
+ if (bad) {
32
+ console.error(`${RED}Invalid field name "${bad}": letters, numbers, underscore and hyphen only (max 100).${RST}`);
33
+ process.exitCode = 1;
34
+ return;
35
+ }
36
+ await request('PUT', PATH, { allowedKeys: keys });
37
+ console.log(`${GRN}Saved ${keys.length} Payload Field(s).${RST}`);
38
+ }
39
+
40
+ export const makeCommand = {
41
+ command: 'make <subcommand>',
42
+ describe: 'Make integration Payload Fields',
43
+ builder: y => y
44
+ .command({
45
+ command: 'fields',
46
+ describe: 'Show the declared Payload Fields',
47
+ handler: fieldsHandler,
48
+ })
49
+ .command({
50
+ command: 'fields-set',
51
+ describe: 'Replace the declared Payload Fields',
52
+ builder: yy => yy.option('fields', { describe: 'Comma-separated field names (empty clears)', type: 'string', default: '' }),
53
+ handler: fieldsSetHandler,
54
+ })
55
+ .demandCommand(1, 'Specify a subcommand. Try: velaro make --help'),
56
+ handler: () => {},
57
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.181",
3
+ "version": "1.4.183",
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": {