@velaro/cli 1.4.165 → 1.4.166

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.
@@ -39,6 +39,30 @@ export const dynamicsCommand = {
39
39
  console.log(JSON.stringify(await request('PUT', `${base(argv.config)}/${argv.team}`, body), null, 2));
40
40
  }),
41
41
  })
42
- .demandCommand(1, 'Specify a subcommand: team-overrides'),
42
+ .command({
43
+ command: 'copy-mappings',
44
+ describe: 'Copy field mappings + activity type from one Dynamics connection to another on the same site',
45
+ builder: y => y
46
+ .option('config', { type: 'number', demandOption: true, describe: 'Target Dynamics config id' })
47
+ .option('from', { type: 'number', demandOption: true, describe: 'Source Dynamics config id' })
48
+ .option('team-overrides', { type: 'boolean', default: false, describe: 'Also replace the target\'s per-group overrides with the source\'s' }),
49
+ handler: runCommand(async argv => {
50
+ const res = await request('POST', `/Dynamics/Configs/${argv.config}/copy-mappings-from/${argv.from}`, { includeTeamOverrides: argv.teamOverrides === true });
51
+ console.log(JSON.stringify(res, null, 2));
52
+ }),
53
+ })
54
+ .command({
55
+ command: 'restore-mappings',
56
+ describe: 'Put the connection field mappings + activity type back to given values (undo of copy-mappings; uses PUT Configs/{id}, other settings untouched)',
57
+ builder: y => y
58
+ .option('config', { type: 'number', demandOption: true, describe: 'Dynamics config id to restore' })
59
+ .option('mappings', { type: 'string', demandOption: true, describe: 'customFieldMappingsJson to put back (the `previous` value; empty string if it was empty)' })
60
+ .option('activity', { type: 'string', demandOption: true, describe: 'activityLogicalName to put back (empty string if it was empty)' }),
61
+ handler: runCommand(async argv => {
62
+ const res = await request('PUT', `/Dynamics/Configs/${argv.config}`, { customFieldMappingsJson: argv.mappings, activityLogicalName: argv.activity });
63
+ console.log(JSON.stringify(res, null, 2));
64
+ }),
65
+ })
66
+ .demandCommand(1, 'Specify a subcommand: team-overrides | copy-mappings | restore-mappings'),
43
67
  handler: () => {},
44
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.165",
3
+ "version": "1.4.166",
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": {