@dcupl/cli 1.4.0-beta.1 → 1.4.0-beta.11

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.
Files changed (272) hide show
  1. package/README.md +34 -0
  2. package/dist/cli.js +737 -169
  3. package/dist/cli.js.map +1 -1
  4. package/dist/functions/app/app-id.js +34 -2
  5. package/dist/functions/app/app-id.js.map +1 -1
  6. package/dist/functions/app/client/daemon-client.js.map +1 -1
  7. package/dist/functions/app/commands/cdn-host.d.ts +16 -0
  8. package/dist/functions/app/commands/cdn-host.js +47 -0
  9. package/dist/functions/app/commands/cdn-host.js.map +1 -0
  10. package/dist/functions/app/commands/create.js +50 -34
  11. package/dist/functions/app/commands/create.js.map +1 -1
  12. package/dist/functions/app/commands/destroy.js +10 -4
  13. package/dist/functions/app/commands/destroy.js.map +1 -1
  14. package/dist/functions/app/commands/detect-serve.js +17 -6
  15. package/dist/functions/app/commands/detect-serve.js.map +1 -1
  16. package/dist/functions/app/commands/fn/_fn-helpers.js +11 -3
  17. package/dist/functions/app/commands/fn/_fn-helpers.js.map +1 -1
  18. package/dist/functions/app/commands/fn/aggregate.js +4 -1
  19. package/dist/functions/app/commands/fn/aggregate.js.map +1 -1
  20. package/dist/functions/app/commands/fn/pivot.js.map +1 -1
  21. package/dist/functions/app/commands/list.js +6 -2
  22. package/dist/functions/app/commands/list.js.map +1 -1
  23. package/dist/functions/app/commands/loader-hash.js.map +1 -1
  24. package/dist/functions/app/commands/loaders/add.js +6 -0
  25. package/dist/functions/app/commands/loaders/add.js.map +1 -1
  26. package/dist/functions/app/commands/loaders/process-flags.js +4 -1
  27. package/dist/functions/app/commands/loaders/process-flags.js.map +1 -1
  28. package/dist/functions/app/commands/loaders/process.js +3 -1
  29. package/dist/functions/app/commands/loaders/process.js.map +1 -1
  30. package/dist/functions/app/commands/models/get.js.map +1 -1
  31. package/dist/functions/app/commands/models/keys.js.map +1 -1
  32. package/dist/functions/app/commands/models/remove.js.map +1 -1
  33. package/dist/functions/app/commands/models/set.js +3 -1
  34. package/dist/functions/app/commands/models/set.js.map +1 -1
  35. package/dist/functions/app/commands/query/execute.js +5 -2
  36. package/dist/functions/app/commands/query/execute.js.map +1 -1
  37. package/dist/functions/app/commands/query/one.js +3 -1
  38. package/dist/functions/app/commands/query/one.js.map +1 -1
  39. package/dist/functions/app/commands/render.js +10 -4
  40. package/dist/functions/app/commands/render.js.map +1 -1
  41. package/dist/functions/app/commands/resolve-app.js.map +1 -1
  42. package/dist/functions/app/commands/resolve-source.d.ts +1 -0
  43. package/dist/functions/app/commands/resolve-source.js +20 -5
  44. package/dist/functions/app/commands/resolve-source.js.map +1 -1
  45. package/dist/functions/app/commands/validate-report.d.ts +31 -0
  46. package/dist/functions/app/commands/validate-report.js +20 -1
  47. package/dist/functions/app/commands/validate-report.js.map +1 -1
  48. package/dist/functions/app/commands/validate.d.ts +1 -0
  49. package/dist/functions/app/commands/validate.js +31 -10
  50. package/dist/functions/app/commands/validate.js.map +1 -1
  51. package/dist/functions/app/daemon/app-server.module.js +6 -1
  52. package/dist/functions/app/daemon/app-server.module.js.map +1 -1
  53. package/dist/functions/app/daemon/controllers/data.controller.js +17 -6
  54. package/dist/functions/app/daemon/controllers/data.controller.js.map +1 -1
  55. package/dist/functions/app/daemon/controllers/lifecycle.controller.js.map +1 -1
  56. package/dist/functions/app/daemon/controllers/query.controller.js +4 -1
  57. package/dist/functions/app/daemon/controllers/query.controller.js.map +1 -1
  58. package/dist/functions/app/daemon/daemon-args.js +2 -2
  59. package/dist/functions/app/daemon/daemon-args.js.map +1 -1
  60. package/dist/functions/app/daemon/filters/envelope-exception.filter.js +6 -1
  61. package/dist/functions/app/daemon/filters/envelope-exception.filter.js.map +1 -1
  62. package/dist/functions/app/daemon/main.js +14 -7
  63. package/dist/functions/app/daemon/main.js.map +1 -1
  64. package/dist/functions/app/daemon/services/attribute-validation.d.ts +21 -0
  65. package/dist/functions/app/daemon/services/attribute-validation.js +164 -0
  66. package/dist/functions/app/daemon/services/attribute-validation.js.map +1 -0
  67. package/dist/functions/app/daemon/services/dcupl-host.service.d.ts +5 -0
  68. package/dist/functions/app/daemon/services/dcupl-host.service.js +83 -16
  69. package/dist/functions/app/daemon/services/dcupl-host.service.js.map +1 -1
  70. package/dist/functions/app/daemon/services/idle-watchdog.service.js.map +1 -1
  71. package/dist/functions/app/daemon/services/ingest.service.js +8 -4
  72. package/dist/functions/app/daemon/services/ingest.service.js.map +1 -1
  73. package/dist/functions/app/daemon/services/init-options.js.map +1 -1
  74. package/dist/functions/app/daemon/services/loaders.service.d.ts +3 -1
  75. package/dist/functions/app/daemon/services/loaders.service.js +22 -6
  76. package/dist/functions/app/daemon/services/loaders.service.js.map +1 -1
  77. package/dist/functions/app/e2e/port-lock.d.ts +8 -0
  78. package/dist/functions/app/e2e/port-lock.js +66 -2
  79. package/dist/functions/app/e2e/port-lock.js.map +1 -1
  80. package/dist/functions/app/registry/registry.js +11 -10
  81. package/dist/functions/app/registry/registry.js.map +1 -1
  82. package/dist/functions/app/registry/serve-registry.js +13 -9
  83. package/dist/functions/app/registry/serve-registry.js.map +1 -1
  84. package/dist/functions/app/types.d.ts +2 -0
  85. package/dist/functions/config/commands/set.js +2 -2
  86. package/dist/functions/config/commands/set.js.map +1 -1
  87. package/dist/functions/config/io.js +1 -3
  88. package/dist/functions/config/io.js.map +1 -1
  89. package/dist/functions/config/prompts.js +1 -3
  90. package/dist/functions/config/prompts.js.map +1 -1
  91. package/dist/functions/files/commands/copy.js +1 -1
  92. package/dist/functions/files/commands/copy.js.map +1 -1
  93. package/dist/functions/files/commands/delete.js +1 -1
  94. package/dist/functions/files/commands/delete.js.map +1 -1
  95. package/dist/functions/files/commands/list.js +6 -3
  96. package/dist/functions/files/commands/list.js.map +1 -1
  97. package/dist/functions/files/commands/move.js +1 -1
  98. package/dist/functions/files/commands/move.js.map +1 -1
  99. package/dist/functions/files/commands/pull.d.ts +16 -1
  100. package/dist/functions/files/commands/pull.js +135 -1
  101. package/dist/functions/files/commands/pull.js.map +1 -1
  102. package/dist/functions/files/commands/push.d.ts +1 -0
  103. package/dist/functions/files/commands/push.js +25 -3
  104. package/dist/functions/files/commands/push.js.map +1 -1
  105. package/dist/functions/files/commands/read.js +3 -2
  106. package/dist/functions/files/commands/read.js.map +1 -1
  107. package/dist/functions/files/commands/render.d.ts +29 -0
  108. package/dist/functions/files/commands/render.js +8 -4
  109. package/dist/functions/files/commands/render.js.map +1 -1
  110. package/dist/functions/files/commands/status.js +1 -0
  111. package/dist/functions/files/commands/status.js.map +1 -1
  112. package/dist/functions/files/commands/versions/copy.js +1 -1
  113. package/dist/functions/files/commands/versions/copy.js.map +1 -1
  114. package/dist/functions/files/commands/versions/delete.js +1 -1
  115. package/dist/functions/files/commands/versions/delete.js.map +1 -1
  116. package/dist/functions/files/commands/versions/list.js +4 -0
  117. package/dist/functions/files/commands/versions/list.js.map +1 -1
  118. package/dist/functions/files/commands/write.js +13 -3
  119. package/dist/functions/files/commands/write.js.map +1 -1
  120. package/dist/functions/files/files-push.js +1 -1
  121. package/dist/functions/files/files-push.js.map +1 -1
  122. package/dist/functions/files/helper/text-policy.d.ts +5 -0
  123. package/dist/functions/files/helper/text-policy.js +31 -0
  124. package/dist/functions/files/helper/text-policy.js.map +1 -0
  125. package/dist/functions/files/sync/large-upload.d.ts +20 -0
  126. package/dist/functions/files/sync/large-upload.js +140 -0
  127. package/dist/functions/files/sync/large-upload.js.map +1 -0
  128. package/dist/functions/files/sync/manifest.js +2 -1
  129. package/dist/functions/files/sync/manifest.js.map +1 -1
  130. package/dist/functions/files/sync/transfer.d.ts +5 -0
  131. package/dist/functions/files/sync/transfer.js +47 -10
  132. package/dist/functions/files/sync/transfer.js.map +1 -1
  133. package/dist/functions/files/test-helpers.d.ts +11 -0
  134. package/dist/functions/files/test-helpers.js +28 -0
  135. package/dist/functions/files/test-helpers.js.map +1 -1
  136. package/dist/functions/generate/files/generate-code.d.ts +1 -1
  137. package/dist/functions/generate/files/generate-files.d.ts +14 -1
  138. package/dist/functions/generate/files/generate-files.js +152 -38
  139. package/dist/functions/generate/files/generate-files.js.map +1 -1
  140. package/dist/functions/generate/files/rest-api-template.d.ts +16 -0
  141. package/dist/functions/generate/files/rest-api-template.js +63 -0
  142. package/dist/functions/generate/files/rest-api-template.js.map +1 -0
  143. package/dist/functions/generate/files/script-starters.d.ts +6 -0
  144. package/dist/functions/generate/files/script-starters.js +74 -0
  145. package/dist/functions/generate/files/script-starters.js.map +1 -0
  146. package/dist/functions/generate/files/workflow-presets.d.ts +6 -0
  147. package/dist/functions/generate/files/workflow-presets.js +158 -0
  148. package/dist/functions/generate/files/workflow-presets.js.map +1 -0
  149. package/dist/functions/generate/model-from-data/generate-model-from-data.js +8 -3
  150. package/dist/functions/generate/model-from-data/generate-model-from-data.js.map +1 -1
  151. package/dist/functions/generate/model-from-data/infer-key.js +1 -4
  152. package/dist/functions/generate/model-from-data/infer-key.js.map +1 -1
  153. package/dist/functions/generate/model-from-data/infer-to-model.js +1 -2
  154. package/dist/functions/generate/model-from-data/infer-to-model.js.map +1 -1
  155. package/dist/functions/generate/projects/generate-project.d.ts +5 -0
  156. package/dist/functions/generate/projects/generate-project.js +29 -8
  157. package/dist/functions/generate/projects/generate-project.js.map +1 -1
  158. package/dist/functions/helper/api-client.d.ts +3 -0
  159. package/dist/functions/helper/api-client.js +10 -3
  160. package/dist/functions/helper/api-client.js.map +1 -1
  161. package/dist/functions/helper/config.helper.d.ts +1 -0
  162. package/dist/functions/helper/config.helper.js.map +1 -1
  163. package/dist/functions/helper/output.d.ts +1 -1
  164. package/dist/functions/helper/output.js +10 -12
  165. package/dist/functions/helper/output.js.map +1 -1
  166. package/dist/functions/helper/parse-fail.js +4 -1
  167. package/dist/functions/helper/parse-fail.js.map +1 -1
  168. package/dist/functions/schemas/command.js.map +1 -1
  169. package/dist/functions/schemas/examples/AppLoaderConfiguration.example.json +1 -3
  170. package/dist/functions/schemas/examples/DataMapperStepConfig.example.json +6 -1
  171. package/dist/functions/schemas/examples/ModelDefinition.example.json +8 -1
  172. package/dist/functions/schemas/examples/ScriptStepConfig.example.json +3 -1
  173. package/dist/functions/schemas/examples/TemplateV3.example.json +5 -1
  174. package/dist/functions/schemas/extract.js +1 -1
  175. package/dist/functions/schemas/extract.js.map +1 -1
  176. package/dist/functions/schemas/format.js +4 -4
  177. package/dist/functions/schemas/format.js.map +1 -1
  178. package/dist/functions/schemas/registry.d.ts +14 -0
  179. package/dist/functions/schemas/registry.js +103 -30
  180. package/dist/functions/schemas/registry.js.map +1 -1
  181. package/dist/functions/schemas/resolve.js +1 -2
  182. package/dist/functions/schemas/resolve.js.map +1 -1
  183. package/dist/functions/schemas/validate.d.ts +22 -0
  184. package/dist/functions/schemas/validate.js +67 -0
  185. package/dist/functions/schemas/validate.js.map +1 -0
  186. package/dist/functions/serve/commands/list.js +2 -1
  187. package/dist/functions/serve/commands/list.js.map +1 -1
  188. package/dist/functions/serve/commands/stop.js +10 -5
  189. package/dist/functions/serve/commands/stop.js.map +1 -1
  190. package/dist/functions/serve/dev-server/dev-server-access.guard.d.ts +11 -0
  191. package/dist/functions/serve/dev-server/dev-server-access.guard.js +41 -0
  192. package/dist/functions/serve/dev-server/dev-server-access.guard.js.map +1 -0
  193. package/dist/functions/serve/dev-server/dev-server.controller.d.ts +3 -0
  194. package/dist/functions/serve/dev-server/dev-server.controller.js +20 -0
  195. package/dist/functions/serve/dev-server/dev-server.controller.js.map +1 -1
  196. package/dist/functions/serve/dev-server/dev-server.module.d.ts +3 -0
  197. package/dist/functions/serve/dev-server/dev-server.module.js +34 -23
  198. package/dist/functions/serve/dev-server/dev-server.module.js.map +1 -1
  199. package/dist/functions/serve/dev-server/dev-server.options.d.ts +8 -0
  200. package/dist/functions/serve/dev-server/dev-server.options.js +5 -0
  201. package/dist/functions/serve/dev-server/dev-server.options.js.map +1 -0
  202. package/dist/functions/serve/dev-server/dev-server.service.d.ts +11 -3
  203. package/dist/functions/serve/dev-server/dev-server.service.js +72 -65
  204. package/dist/functions/serve/dev-server/dev-server.service.js.map +1 -1
  205. package/dist/functions/serve/dev-server/path-scope.d.ts +5 -0
  206. package/dist/functions/serve/dev-server/path-scope.js +88 -0
  207. package/dist/functions/serve/dev-server/path-scope.js.map +1 -0
  208. package/dist/functions/serve/dev-server/request-security.d.ts +34 -0
  209. package/dist/functions/serve/dev-server/request-security.js +145 -0
  210. package/dist/functions/serve/dev-server/request-security.js.map +1 -0
  211. package/dist/functions/serve/main.d.ts +13 -0
  212. package/dist/functions/serve/main.js +85 -13
  213. package/dist/functions/serve/main.js.map +1 -1
  214. package/dist/functions/serve/serve-self-register.js +2 -1
  215. package/dist/functions/serve/serve-self-register.js.map +1 -1
  216. package/dist/functions/version/command.js +1 -6
  217. package/dist/functions/version/command.js.map +1 -1
  218. package/dist/functions/workflow/commands/deploy.d.ts +9 -1
  219. package/dist/functions/workflow/commands/deploy.js +39 -10
  220. package/dist/functions/workflow/commands/deploy.js.map +1 -1
  221. package/dist/functions/workflow/commands/get.js.map +1 -1
  222. package/dist/functions/workflow/commands/history.js.map +1 -1
  223. package/dist/functions/workflow/commands/run.d.ts +26 -0
  224. package/dist/functions/workflow/commands/run.js +101 -0
  225. package/dist/functions/workflow/commands/run.js.map +1 -0
  226. package/dist/functions/workflow/commands/runners-get.js.map +1 -1
  227. package/dist/functions/workflow/commands/runners.d.ts +2 -0
  228. package/dist/functions/workflow/commands/runners.js +10 -1
  229. package/dist/functions/workflow/commands/runners.js.map +1 -1
  230. package/dist/functions/workflow/commands/status.d.ts +1 -1
  231. package/dist/functions/workflow/commands/status.js +7 -1
  232. package/dist/functions/workflow/commands/status.js.map +1 -1
  233. package/dist/functions/workflow/commands/template.js.map +1 -1
  234. package/dist/functions/workflow/commands/test.d.ts +3 -0
  235. package/dist/functions/workflow/commands/test.js +22 -73
  236. package/dist/functions/workflow/commands/test.js.map +1 -1
  237. package/dist/functions/workflow/commands/trace.d.ts +4 -2
  238. package/dist/functions/workflow/commands/trace.js +22 -1
  239. package/dist/functions/workflow/commands/trace.js.map +1 -1
  240. package/dist/functions/workflow/commands/undeploy.js +3 -1
  241. package/dist/functions/workflow/commands/undeploy.js.map +1 -1
  242. package/dist/functions/workflow/commands/validate.d.ts +2 -0
  243. package/dist/functions/workflow/commands/validate.js +16 -2
  244. package/dist/functions/workflow/commands/validate.js.map +1 -1
  245. package/dist/functions/workflow/resolve-runner.d.ts +17 -0
  246. package/dist/functions/workflow/resolve-runner.js +41 -0
  247. package/dist/functions/workflow/resolve-runner.js.map +1 -0
  248. package/dist/functions/workflow/run-failure.d.ts +11 -0
  249. package/dist/functions/workflow/run-failure.js +74 -0
  250. package/dist/functions/workflow/run-failure.js.map +1 -0
  251. package/dist/functions/workflow/runner-health.d.ts +16 -0
  252. package/dist/functions/workflow/runner-health.js +36 -0
  253. package/dist/functions/workflow/runner-health.js.map +1 -0
  254. package/dist/functions/workflow/script-lint.d.ts +10 -0
  255. package/dist/functions/workflow/script-lint.js +513 -0
  256. package/dist/functions/workflow/script-lint.js.map +1 -0
  257. package/dist/functions/workflow/trace.js.map +1 -1
  258. package/dist/functions/workflow/types.d.ts +11 -2
  259. package/dist/functions/workflow/types.js +4 -0
  260. package/dist/functions/workflow/types.js.map +1 -1
  261. package/dist/functions/workflow/validate.js +4 -1
  262. package/dist/functions/workflow/validate.js.map +1 -1
  263. package/dist/functions/workflow/wait-for-swap.d.ts +24 -1
  264. package/dist/functions/workflow/wait-for-swap.js +58 -0
  265. package/dist/functions/workflow/wait-for-swap.js.map +1 -1
  266. package/dist/functions/workflow/workflow-api.js +3 -1
  267. package/dist/functions/workflow/workflow-api.js.map +1 -1
  268. package/files/dev-server/index.html +2 -1
  269. package/package.json +24 -18
  270. package/dist/functions/serve/guards/apiKey.guard.d.ts +0 -4
  271. package/dist/functions/serve/guards/apiKey.guard.js +0 -23
  272. package/dist/functions/serve/guards/apiKey.guard.js.map +0 -1
package/dist/cli.js CHANGED
@@ -7,6 +7,8 @@ const api_client_1 = require("./functions/helper/api-client");
7
7
  const output_1 = require("./functions/helper/output");
8
8
  const parse_fail_1 = require("./functions/helper/parse-fail");
9
9
  const command_js_1 = require("./functions/schemas/command.js");
10
+ const workflow_presets_js_1 = require("./functions/generate/files/workflow-presets.js");
11
+ const script_starters_js_1 = require("./functions/generate/files/script-starters.js");
10
12
  const command_js_2 = require("./functions/version/command.js");
11
13
  const init_options_js_1 = require("./functions/app/daemon/services/init-options.js");
12
14
  function parseAutoServePort(raw) {
@@ -21,9 +23,14 @@ function parseAutoServePort(raw) {
21
23
  }
22
24
  return n;
23
25
  }
26
+ const CDN_BASE_URL_DESCRIBE = 'CDN base url for the remote source. Default: derived from consoleApiUrl in dcupl.config.json' +
27
+ ' (api.dcupl.com → cdn.dcupl.com, api.dev.dcupl.com → cdn.dev.dcupl.com), else the prod CDN;' +
28
+ ' also DCUPL_CDN_BASE_URL env or `cdnBaseUrl` in dcupl.config.json. Overrides the workspace consoleApiUrl' +
29
+ ' even with an explicit --project-id. api-key + cache-busting only apply to dcupl CDN hosts (cdn*.dcupl.com, cdn.dev.dcupl.com);' +
30
+ ' see docs/flows/workflow-app-remote.md';
24
31
  function buildCli(rawArgs) {
25
32
  const instance = (0, yargs_1.default)(rawArgs);
26
- return instance
33
+ return (instance
27
34
  .version(false)
28
35
  .locale('en')
29
36
  .strict()
@@ -53,7 +60,7 @@ function buildCli(rawArgs) {
53
60
  })
54
61
  .option('project-id', {
55
62
  type: 'string',
56
- describe: 'Console project ID (required with --starter existing)',
63
+ describe: 'Console project ID (implies --starter existing when --starter is omitted)',
57
64
  })
58
65
  .option('api-key', {
59
66
  type: 'string',
@@ -86,13 +93,25 @@ function buildCli(rawArgs) {
86
93
  const output = (0, output_1.createOutput)(!!argv.json);
87
94
  await serveListCommand(output);
88
95
  })
89
- .command('stop', 'Stop a running serve by port', (a) => a
90
- .option('port', { type: 'number', demandOption: true, default: undefined, describe: 'Port of the serve to stop' }), async (argv) => {
96
+ .command('stop', 'Stop a running serve by port', (a) => a.option('port', {
97
+ type: 'number',
98
+ demandOption: true,
99
+ default: undefined,
100
+ describe: 'Port of the serve to stop',
101
+ }), async (argv) => {
91
102
  const { serveStopCommand } = await import('./functions/serve/commands/stop.js');
92
103
  const output = (0, output_1.createOutput)(!!argv.json);
93
104
  await serveStopCommand(output, { port: argv.port });
94
105
  })
95
106
  .option('port', { default: '8083' })
107
+ .option('host', {
108
+ type: 'string',
109
+ describe: 'Address to listen on. Default 127.0.0.1 (this machine only); a bare --host listens on all interfaces (0.0.0.0). File edits from other machines need the printed token.',
110
+ })
111
+ .option('allow-origin', {
112
+ type: 'string',
113
+ describe: 'Let another browser origin read files and, from this machine, edit them without the token, like the dcupl Console (repeatable). Example: http://localhost:4200 for a locally running Console.',
114
+ })
96
115
  .option('open-browser', {
97
116
  type: 'boolean',
98
117
  describe: 'Open the welcome screen in a browser on start. Overrides openBrowser in dcupl.config.json.',
@@ -107,7 +126,7 @@ function buildCli(rawArgs) {
107
126
  const { bootstrap } = await import('./functions/serve/main.js');
108
127
  bootstrap(argv);
109
128
  })
110
- .command('generate [type]', 'Generate models, types, schemas and more from your data', (args) => {
129
+ .command('generate [type]', 'Generate models, scripts, REST API templates, types, schemas and more from your data', (args) => {
111
130
  return args
112
131
  .positional('type', {
113
132
  describe: 'type of content to generate',
@@ -122,17 +141,49 @@ function buildCli(rawArgs) {
122
141
  'test-setup',
123
142
  'test',
124
143
  'test-config',
144
+ 'workflow',
145
+ 'api',
125
146
  ],
126
147
  })
127
- .option('name', { describe: 'Name for model generation', type: 'string' })
148
+ .option('name', {
149
+ describe: 'Name for model generation, the workflow key for `generate workflow`, or the template key for `generate api`',
150
+ type: 'string',
151
+ })
128
152
  .option('file-name', { describe: 'File name for generation', type: 'string' })
153
+ .option('mode', {
154
+ describe: `Script mode starter for \`generate script\` (default: ${script_starters_js_1.DEFAULT_SCRIPT_MODE}); the scriptKey is derived from --file-name`,
155
+ type: 'string',
156
+ choices: script_starters_js_1.SCRIPT_MODES,
157
+ })
158
+ .option('endpoint', {
159
+ describe: 'Scripted endpoint for `generate api` as "<GET|POST> <path>=<scriptKey>" (repeatable); unknown scripts are scaffolded in endpoint mode and registered',
160
+ type: 'string',
161
+ array: true,
162
+ })
129
163
  .option('operator', { describe: 'Operator name for operator generation', type: 'string' })
164
+ .option('template', {
165
+ describe: `Workflow preset (used by \`generate workflow\`, default: ${workflow_presets_js_1.WORKFLOW_PRESETS[0]})`,
166
+ type: 'string',
167
+ choices: workflow_presets_js_1.WORKFLOW_PRESETS,
168
+ })
130
169
  .option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
131
170
  .option('from', { describe: 'Data file (CSV/JSON/NDJSON) to infer a model from', type: 'string' })
132
- .option('register', { describe: 'Register the generated model + data resource in dcupl.lc.json', type: 'boolean' })
133
- .option('sample-size', { describe: 'Max rows to scan when inferring types from --from', type: 'number' })
134
- .option('key-property', { describe: 'Override inferred keyProperty for --from. Comma-separate for a composite key (a,b,c). Skips inference + prompts.', type: 'string' })
135
- .option('dry-run', { describe: 'Preview the proposed model + lc.json additions without writing.', type: 'boolean' });
171
+ .option('register', {
172
+ describe: 'Register the generated model + data resource in dcupl.lc.json',
173
+ type: 'boolean',
174
+ })
175
+ .option('sample-size', {
176
+ describe: 'Max rows to scan when inferring types from --from',
177
+ type: 'number',
178
+ })
179
+ .option('key-property', {
180
+ describe: 'Override inferred keyProperty for --from. Comma-separate for a composite key (a,b,c). Skips inference + prompts.',
181
+ type: 'string',
182
+ })
183
+ .option('dry-run', {
184
+ describe: 'Preview the proposed model + lc.json additions without writing.',
185
+ type: 'boolean',
186
+ });
136
187
  }, async (argv) => {
137
188
  const { generateFn } = await import('./functions/generate/files/generate-files.js');
138
189
  generateFn(argv);
@@ -144,19 +195,56 @@ function buildCli(rawArgs) {
144
195
  (0, command_js_1.schemasListCommand)(argv, output);
145
196
  })
146
197
  .command('get <name>', 'Print the source of a schema', (args) => args
147
- .positional('name', { type: 'string', describe: 'Schema name (see `dcupl schemas list`)', demandOption: true })
198
+ .positional('name', {
199
+ type: 'string',
200
+ describe: 'Schema name (see `dcupl schemas list`)',
201
+ demandOption: true,
202
+ })
148
203
  .option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
149
204
  const output = (0, output_1.createOutput)(argv.json);
150
205
  (0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
206
+ })
207
+ .command('validate <file>', 'Validate a JSON file against a registry schema (Zod-kind, e.g. TemplateV3)', (args) => args
208
+ .positional('file', {
209
+ type: 'string',
210
+ describe: 'Path to the JSON file to validate',
211
+ demandOption: true,
212
+ })
213
+ .option('against', {
214
+ type: 'string',
215
+ demandOption: true,
216
+ describe: 'Schema name to validate against (see `dcupl schemas list` — [Zod] entries only)',
217
+ }), async (argv) => {
218
+ const output = (0, output_1.createOutput)(argv.json);
219
+ try {
220
+ const { schemasValidateCommand } = await import('./functions/schemas/validate.js');
221
+ const valid = await schemasValidateCommand({ file: argv.file, against: argv.against, json: argv.json }, output);
222
+ if (!valid)
223
+ process.exitCode = 1;
224
+ }
225
+ catch (err) {
226
+ output.error(err.message, err.code || 'SCHEMA_VALIDATE_FAILED');
227
+ }
151
228
  })
152
229
  .demandCommand(1);
153
230
  }, () => { })
154
231
  .command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
155
232
  return yy
156
233
  .command('validate', 'Validate a TemplateV3 file locally (and remotely if --runner is given).', (a) => a
157
- .option('file', { type: 'string', demandOption: true, describe: 'Path to a local *.workflow-v3.json template' })
158
- .option('runner', { type: 'string', describe: 'Runner uid for remote validation (feature limits, cycles, expressions)' })
159
- .option('local-only', { type: 'boolean', default: false, describe: 'Skip remote validation even if --runner is set' }), async (argv) => {
234
+ .option('file', {
235
+ type: 'string',
236
+ demandOption: true,
237
+ describe: 'Path to a local *.workflow-v3.json template',
238
+ })
239
+ .option('runner', {
240
+ type: 'string',
241
+ describe: 'Runner uid or runnerKey for remote validation (feature limits, cycles, expressions)',
242
+ })
243
+ .option('local-only', {
244
+ type: 'boolean',
245
+ default: false,
246
+ describe: 'Skip remote validation even if --runner is set',
247
+ }), async (argv) => {
160
248
  const { validateCommand } = await import('./functions/workflow/commands/validate.js');
161
249
  const output = (0, output_1.createOutput)(!!argv.json);
162
250
  try {
@@ -165,7 +253,11 @@ function buildCli(rawArgs) {
165
253
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
166
254
  deps.client = mkClient();
167
255
  }
168
- await validateCommand(output, { file: argv.file, runner: argv.runner, localOnly: !!argv['local-only'] }, deps);
256
+ await validateCommand(output, {
257
+ file: argv.file,
258
+ runner: argv.runner,
259
+ localOnly: !!argv['local-only'],
260
+ }, deps);
169
261
  }
170
262
  catch (err) {
171
263
  output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
@@ -228,20 +320,29 @@ function buildCli(rawArgs) {
228
320
  })
229
321
  .command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
230
322
  .option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
231
- .option('run', { type: 'string', demandOption: true, describe: 'Execution runId (from `workflow history`)' }), async (argv) => {
323
+ .option('run', { type: 'string', describe: 'Execution runId (from `workflow history`)' })
324
+ .option('last', {
325
+ type: 'boolean',
326
+ default: false,
327
+ describe: 'Trace the most recent run instead of naming one with --run',
328
+ }), async (argv) => {
232
329
  const { traceCommand } = await import('./functions/workflow/commands/trace.js');
233
330
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
234
331
  const output = (0, output_1.createOutput)(!!argv.json);
235
332
  try {
236
- await traceCommand(output, mkClient(), { id: argv.id, run: argv.run });
333
+ await traceCommand(output, mkClient(), {
334
+ id: argv.id,
335
+ run: argv.run,
336
+ last: !!argv.last,
337
+ });
237
338
  }
238
339
  catch (err) {
239
340
  output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
240
341
  }
241
342
  })
242
- .command('runners <subcommand>', 'Inspect the runners available to this project.', (rr) => {
243
- return rr
244
- .command('list', 'List the runners available to this project (uid / key / type / url).', () => { }, async (argv) => {
343
+ .command('runners [subcommand]', 'Inspect the runners available to this project.', (rr) => {
344
+ return (rr
345
+ .command(['list', '$0'], 'List the runners available to this project (uid / key / type / url / health).', () => { }, async (argv) => {
245
346
  const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
246
347
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
247
348
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -262,44 +363,133 @@ function buildCli(rawArgs) {
262
363
  catch (err) {
263
364
  output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
264
365
  }
265
- })
266
- .demandCommand(1);
366
+ }));
267
367
  }, () => { })
268
368
  .command('test', 'Deploy to a (dev) runner then exercise it: --node for one node, otherwise a full run.', (a) => a
269
- .option('file', { type: 'string', demandOption: true, describe: 'Path to a local *.workflow-v3.json template' })
270
- .option('runner', { type: 'string', demandOption: true, describe: 'Runner uid to deploy+run against (use a dev/test runner)' })
369
+ .option('file', {
370
+ type: 'string',
371
+ demandOption: true,
372
+ describe: 'Path to a local *.workflow-v3.json template',
373
+ })
374
+ .option('runner', {
375
+ type: 'string',
376
+ demandOption: true,
377
+ describe: 'Runner uid or runnerKey to deploy+run against (use a dev/test runner)',
378
+ })
271
379
  .option('node', { type: 'string', describe: 'Test a single node by id (uses test-node)' })
272
- .option('input', { type: 'string', describe: 'Path to a JSON file: test-node inputData, or full-run request body' })
380
+ .option('input', {
381
+ type: 'string',
382
+ describe: 'Path to a JSON file: test-node inputData, or full-run request body',
383
+ })
273
384
  .option('state', { type: 'string', describe: 'Path to a JSON file: $state seed for test-node' })
274
- .option('trigger-key', { type: 'string', describe: 'api-key to pass to the runner if the trigger requires auth' })
275
- .option('wait', { type: 'boolean', default: true, describe: 'Wait for the runner to hot-swap before triggering (--no-wait to skip)' })
276
- .option('swap-timeout', { type: 'number', describe: 'Max ms to wait for swap confirmation (default 30000)' }), async (argv) => {
385
+ .option('trigger-key', {
386
+ type: 'string',
387
+ describe: 'api-key to pass to the runner if the trigger requires auth',
388
+ })
389
+ .option('wait', {
390
+ type: 'boolean',
391
+ default: true,
392
+ describe: 'Wait for the runner to hot-swap before triggering (--no-wait to skip)',
393
+ })
394
+ .option('swap-timeout', {
395
+ type: 'number',
396
+ describe: 'Max ms to wait for swap confirmation (default 30000)',
397
+ }), async (argv) => {
277
398
  const { testCommand } = await import('./functions/workflow/commands/test.js');
278
399
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
279
400
  const output = (0, output_1.createOutput)(!!argv.json);
280
401
  try {
281
402
  await testCommand(output, mkClient(), {
282
- file: argv.file, runner: argv.runner,
283
- node: argv.node, input: argv.input,
284
- state: argv.state, triggerKey: argv['trigger-key'],
285
- wait: argv.wait, swapTimeout: argv['swap-timeout'],
403
+ file: argv.file,
404
+ runner: argv.runner,
405
+ node: argv.node,
406
+ input: argv.input,
407
+ state: argv.state,
408
+ triggerKey: argv['trigger-key'],
409
+ wait: argv.wait,
410
+ swapTimeout: argv['swap-timeout'],
286
411
  });
287
412
  }
288
413
  catch (err) {
289
414
  output.error(err.message, err.code || 'WORKFLOW_TEST_FAILED');
290
415
  }
416
+ })
417
+ .command('run <key>', 'Trigger an already-deployed workflow (no redeploy): --node for one node, otherwise a full run.', (a) => a
418
+ .positional('key', {
419
+ type: 'string',
420
+ demandOption: true,
421
+ describe: 'Deployed workflow key (as shown by `workflow list`; the bare template key also works)',
422
+ })
423
+ .option('runner', {
424
+ type: 'string',
425
+ demandOption: true,
426
+ describe: 'Runner uid or runnerKey the workflow is deployed on',
427
+ })
428
+ .option('body', {
429
+ type: 'string',
430
+ describe: 'Inline JSON: test-node inputData, or full-run request body (mutually exclusive with --input)',
431
+ })
432
+ .option('input', {
433
+ type: 'string',
434
+ describe: 'Path to a JSON file: test-node inputData, or full-run request body',
435
+ })
436
+ .option('node', {
437
+ type: 'string',
438
+ describe: 'Run a single node of the deployed workflow by id (uses test-node)',
439
+ })
440
+ .option('trigger-key', {
441
+ type: 'string',
442
+ describe: 'api-key to pass to the runner if the trigger requires auth',
443
+ }), async (argv) => {
444
+ const { runCommand } = await import('./functions/workflow/commands/run.js');
445
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
446
+ const output = (0, output_1.createOutput)(!!argv.json);
447
+ try {
448
+ await runCommand(output, mkClient(), {
449
+ key: argv.key,
450
+ runner: argv.runner,
451
+ body: argv.body,
452
+ input: argv.input,
453
+ node: argv.node,
454
+ triggerKey: argv['trigger-key'],
455
+ });
456
+ }
457
+ catch (err) {
458
+ output.error(err.message, err.code || 'WORKFLOW_RUN_FAILED');
459
+ }
291
460
  })
292
461
  .command('deploy', 'Validate (remote) then deploy a template to a runner. Confirms before going live.', (a) => a
293
- .option('file', { type: 'string', demandOption: true, describe: 'Path to a local *.workflow-v3.json template' })
294
- .option('runner', { type: 'string', demandOption: true, describe: 'Runner uid to deploy to' })
462
+ .option('file', {
463
+ type: 'string',
464
+ demandOption: true,
465
+ describe: 'Path to a local *.workflow-v3.json template',
466
+ })
467
+ .option('runner', {
468
+ type: 'string',
469
+ demandOption: true,
470
+ describe: 'Runner uid or runnerKey to deploy to',
471
+ })
295
472
  .option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI)' })
296
- .option('wait', { type: 'boolean', default: true, describe: 'Wait for the runner to hot-swap to this version before returning (--no-wait to skip)' })
297
- .option('swap-timeout', { type: 'number', describe: 'Max ms to wait for swap confirmation (default 30000)' }), async (argv) => {
473
+ .option('wait', {
474
+ type: 'boolean',
475
+ default: true,
476
+ describe: 'Wait for the runner to hot-swap to this version before returning (--no-wait to skip)',
477
+ })
478
+ .option('swap-timeout', {
479
+ type: 'number',
480
+ describe: 'Max ms to wait for swap confirmation (default 30000)',
481
+ }), async (argv) => {
298
482
  const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
299
483
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
300
484
  const output = (0, output_1.createOutput)(!!argv.json);
301
485
  try {
302
- await deployCommand(output, mkClient(), { file: argv.file, runner: argv.runner, yes: !!argv.yes, wait: argv.wait, swapTimeout: argv['swap-timeout'] });
486
+ await deployCommand(output, mkClient(), {
487
+ file: argv.file,
488
+ runner: argv.runner,
489
+ yes: !!argv.yes,
490
+ wait: argv.wait,
491
+ swapTimeout: argv['swap-timeout'],
492
+ });
303
493
  }
304
494
  catch (err) {
305
495
  output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
@@ -307,7 +497,11 @@ function buildCli(rawArgs) {
307
497
  })
308
498
  .command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
309
499
  .option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
310
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI)' }), async (argv) => {
500
+ .option('yes', {
501
+ type: 'boolean',
502
+ default: false,
503
+ describe: 'Skip the confirmation prompt (for CI)',
504
+ }), async (argv) => {
311
505
  const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
312
506
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
313
507
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -361,13 +555,29 @@ function buildCli(rawArgs) {
361
555
  describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
362
556
  })
363
557
  .option('name', { type: 'string', hidden: true })
364
- .option('strict', { type: 'boolean', default: false, describe: 'Delete server files no longer present locally. Default (additive) never deletes on the server.' })
365
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the deletion confirmation prompt (for CI).' })
366
- .option('force', { type: 'boolean', default: false, describe: 'Resolve conflicts by uploading the local copy.' })
558
+ .option('strict', {
559
+ type: 'boolean',
560
+ default: false,
561
+ describe: 'Delete server files no longer present locally. Default (additive) never deletes on the server.',
562
+ })
563
+ .option('yes', {
564
+ type: 'boolean',
565
+ default: false,
566
+ describe: 'Skip the deletion confirmation prompt (for CI).',
567
+ })
568
+ .option('force', {
569
+ type: 'boolean',
570
+ default: false,
571
+ describe: 'Resolve conflicts by uploading the local copy.',
572
+ })
367
573
  .option('path', {
368
574
  type: 'array',
369
575
  string: true,
370
576
  describe: 'Restrict the push to one or more files / folders / globs (relative to baseFolder). Repeatable. With --strict, deletion is also confined to the scope. Example: --path models/ --path data/products.csv',
577
+ })
578
+ .option('concurrency', {
579
+ type: 'number',
580
+ describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
371
581
  }), async (argv) => {
372
582
  const { pushCommand } = await import('./functions/files/commands/push.js');
373
583
  const { createApiClient } = await import('./functions/helper/api-client.js');
@@ -386,6 +596,9 @@ function buildCli(rawArgs) {
386
596
  yes: argv.yes,
387
597
  force: argv.force,
388
598
  paths: argv.path,
599
+ concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
600
+ ? Math.floor(argv.concurrency)
601
+ : undefined,
389
602
  });
390
603
  }
391
604
  catch (err) {
@@ -399,13 +612,33 @@ function buildCli(rawArgs) {
399
612
  describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
400
613
  })
401
614
  .option('name', { type: 'string', hidden: true })
402
- .option('strict', { type: 'boolean', default: false, describe: 'Delete local files no longer present on the server. Default (additive) never deletes locally.' })
403
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the deletion confirmation prompt (for CI).' })
404
- .option('force', { type: 'boolean', default: false, describe: 'Resolve conflicts by overwriting local with server. Also overrides the dirty-workspace switch refusal.' })
615
+ .option('strict', {
616
+ type: 'boolean',
617
+ default: false,
618
+ describe: 'Delete local files no longer present on the server. Default (additive) never deletes locally.',
619
+ })
620
+ .option('yes', {
621
+ type: 'boolean',
622
+ default: false,
623
+ describe: 'Skip the deletion confirmation prompt (for CI).',
624
+ })
625
+ .option('force', {
626
+ type: 'boolean',
627
+ default: false,
628
+ describe: 'Resolve conflicts by overwriting local with server. Also overrides the dirty-workspace switch refusal.',
629
+ })
405
630
  .option('path', {
406
631
  type: 'array',
407
632
  string: true,
408
633
  describe: 'Restrict the pull to one or more files / folders / globs (relative to baseFolder). Repeatable. With --strict, local deletion is also confined to the scope. Example: --path models/ --path data/products.csv',
634
+ })
635
+ .option('dest', {
636
+ type: 'string',
637
+ describe: 'Sandbox fetch: write the pulled files to this path instead of the workspace — no baseline/HEAD update, no conflict checks. An existing directory, a path ending in "/", or any multi-file match mirrors remote paths beneath it; with exactly one matching file, a plain file path is written as-is. Example: --path customers.csv --dest pulled/',
638
+ })
639
+ .option('concurrency', {
640
+ type: 'number',
641
+ describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
409
642
  }), async (argv) => {
410
643
  const { pullCommand } = await import('./functions/files/commands/pull.js');
411
644
  const { createApiClient } = await import('./functions/helper/api-client.js');
@@ -424,6 +657,10 @@ function buildCli(rawArgs) {
424
657
  yes: argv.yes,
425
658
  force: argv.force,
426
659
  paths: argv.path,
660
+ dest: argv.dest,
661
+ concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
662
+ ? Math.floor(argv.concurrency)
663
+ : undefined,
427
664
  });
428
665
  }
429
666
  catch (err) {
@@ -431,9 +668,17 @@ function buildCli(rawArgs) {
431
668
  }
432
669
  })
433
670
  .command('list', 'List files in a version', (a) => a
434
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' })
671
+ .option('version', {
672
+ alias: 'v',
673
+ type: 'string',
674
+ describe: 'Version id (defaults to HEAD, then "draft")',
675
+ })
435
676
  .option('search', { type: 'string', describe: 'Filter files by search query' })
436
- .option('tree', { type: 'boolean', default: false, describe: 'Render a nested directory tree instead of a flat list. Ignored when --json is set.' }), async (argv) => {
677
+ .option('tree', {
678
+ type: 'boolean',
679
+ default: false,
680
+ describe: 'Render a nested directory tree instead of a flat list. Ignored when --json is set.',
681
+ }), async (argv) => {
437
682
  const { listFilesCommand } = await import('./functions/files/commands/list.js');
438
683
  const { createApiClient } = await import('./functions/helper/api-client.js');
439
684
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -450,9 +695,11 @@ function buildCli(rawArgs) {
450
695
  output.error(err.error || err.message, err.code || 'LIST_FAILED');
451
696
  }
452
697
  })
453
- .command('read', 'Read a single file from a version', (a) => a
454
- .option('path', { type: 'string', demandOption: true, describe: 'File path' })
455
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' }), async (argv) => {
698
+ .command('read', 'Read a single file from a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'File path' }).option('version', {
699
+ alias: 'v',
700
+ type: 'string',
701
+ describe: 'Version id (defaults to HEAD, then "draft")',
702
+ }), async (argv) => {
456
703
  const { readFileCommand } = await import('./functions/files/commands/read.js');
457
704
  const { createApiClient } = await import('./functions/helper/api-client.js');
458
705
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -472,7 +719,11 @@ function buildCli(rawArgs) {
472
719
  .option('path', { type: 'string', demandOption: true, describe: 'File path' })
473
720
  .option('content', { type: 'string', describe: 'Inline content to write' })
474
721
  .option('file', { type: 'string', describe: 'Path to local file to upload' })
475
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' }), async (argv) => {
722
+ .option('version', {
723
+ alias: 'v',
724
+ type: 'string',
725
+ describe: 'Version id (defaults to HEAD, then "draft")',
726
+ }), async (argv) => {
476
727
  const { writeFileCommand } = await import('./functions/files/commands/write.js');
477
728
  const { createApiClient } = await import('./functions/helper/api-client.js');
478
729
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -492,9 +743,21 @@ function buildCli(rawArgs) {
492
743
  })
493
744
  .command('delete', 'Delete a single file from a version', (a) => a
494
745
  .option('path', { type: 'string', demandOption: true, describe: 'File path' })
495
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' })
496
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI).' })
497
- .option('dry-run', { type: 'boolean', default: false, describe: 'Preview the delete without executing it.' }), async (argv) => {
746
+ .option('version', {
747
+ alias: 'v',
748
+ type: 'string',
749
+ describe: 'Version id (defaults to HEAD, then "draft")',
750
+ })
751
+ .option('yes', {
752
+ type: 'boolean',
753
+ default: false,
754
+ describe: 'Skip the confirmation prompt (for CI).',
755
+ })
756
+ .option('dry-run', {
757
+ type: 'boolean',
758
+ default: false,
759
+ describe: 'Preview the delete without executing it.',
760
+ }), async (argv) => {
498
761
  const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
499
762
  const { createApiClient } = await import('./functions/helper/api-client.js');
500
763
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -515,9 +778,21 @@ function buildCli(rawArgs) {
515
778
  .command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
516
779
  .option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
517
780
  .option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
518
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' })
519
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI).' })
520
- .option('dry-run', { type: 'boolean', default: false, describe: 'Preview the move without executing it.' }), async (argv) => {
781
+ .option('version', {
782
+ alias: 'v',
783
+ type: 'string',
784
+ describe: 'Version id (defaults to HEAD, then "draft")',
785
+ })
786
+ .option('yes', {
787
+ type: 'boolean',
788
+ default: false,
789
+ describe: 'Skip the confirmation prompt (for CI).',
790
+ })
791
+ .option('dry-run', {
792
+ type: 'boolean',
793
+ default: false,
794
+ describe: 'Preview the move without executing it.',
795
+ }), async (argv) => {
521
796
  const { moveFileCommand } = await import('./functions/files/commands/move.js');
522
797
  const { createApiClient } = await import('./functions/helper/api-client.js');
523
798
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -539,7 +814,11 @@ function buildCli(rawArgs) {
539
814
  .command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
540
815
  .option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
541
816
  .option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
542
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' }), async (argv) => {
817
+ .option('version', {
818
+ alias: 'v',
819
+ type: 'string',
820
+ describe: 'Version id (defaults to HEAD, then "draft")',
821
+ }), async (argv) => {
543
822
  const { copyFileCommand } = await import('./functions/files/commands/copy.js');
544
823
  const { createApiClient } = await import('./functions/helper/api-client.js');
545
824
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -556,9 +835,11 @@ function buildCli(rawArgs) {
556
835
  output.error(err.error || err.message, err.code || 'COPY_FAILED');
557
836
  }
558
837
  })
559
- .command('create-folder', 'Create a folder in a version', (a) => a
560
- .option('path', { type: 'string', demandOption: true, describe: 'Folder path' })
561
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' }), async (argv) => {
838
+ .command('create-folder', 'Create a folder in a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'Folder path' }).option('version', {
839
+ alias: 'v',
840
+ type: 'string',
841
+ describe: 'Version id (defaults to HEAD, then "draft")',
842
+ }), async (argv) => {
562
843
  const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
563
844
  const { createApiClient } = await import('./functions/helper/api-client.js');
564
845
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -588,10 +869,26 @@ function buildCli(rawArgs) {
588
869
  }
589
870
  })
590
871
  .command('copy', 'Snapshot all files from one version into another (creates the target, or replaces its contents if it already exists)', (a) => a
591
- .option('from', { type: 'string', demandOption: true, describe: 'Source version to copy files from' })
592
- .option('to', { type: 'string', demandOption: true, describe: 'Target version id — created if new, otherwise its contents are replaced' })
593
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI).' })
594
- .option('dry-run', { type: 'boolean', default: false, describe: 'Preview the copy without executing it.' }), async (argv) => {
872
+ .option('from', {
873
+ type: 'string',
874
+ demandOption: true,
875
+ describe: 'Source version to copy files from',
876
+ })
877
+ .option('to', {
878
+ type: 'string',
879
+ demandOption: true,
880
+ describe: 'Target version id — created if new, otherwise its contents are replaced',
881
+ })
882
+ .option('yes', {
883
+ type: 'boolean',
884
+ default: false,
885
+ describe: 'Skip the confirmation prompt (for CI).',
886
+ })
887
+ .option('dry-run', {
888
+ type: 'boolean',
889
+ default: false,
890
+ describe: 'Preview the copy without executing it.',
891
+ }), async (argv) => {
595
892
  const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
596
893
  const { createApiClient } = await import('./functions/helper/api-client.js');
597
894
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -610,8 +907,16 @@ function buildCli(rawArgs) {
610
907
  })
611
908
  .command('delete <id>', 'Delete a version', (a) => a
612
909
  .positional('id', { type: 'string', demandOption: true, describe: 'Version id to delete' })
613
- .option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI).' })
614
- .option('dry-run', { type: 'boolean', default: false, describe: 'Preview the delete without executing it.' }), async (argv) => {
910
+ .option('yes', {
911
+ type: 'boolean',
912
+ default: false,
913
+ describe: 'Skip the confirmation prompt (for CI).',
914
+ })
915
+ .option('dry-run', {
916
+ type: 'boolean',
917
+ default: false,
918
+ describe: 'Preview the delete without executing it.',
919
+ }), async (argv) => {
615
920
  const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
616
921
  const { createApiClient } = await import('./functions/helper/api-client.js');
617
922
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -634,8 +939,15 @@ function buildCli(rawArgs) {
634
939
  .command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
635
940
  .option('project-id', { type: 'string', describe: 'dcupl Console project id' })
636
941
  .option('api-key', { type: 'string', describe: 'dcupl Console API key' })
637
- .option('console-api-url', { type: 'string', describe: 'Override console API URL (for self-hosted / internal dev; leave unset for default)' })
638
- .option('yes', { type: 'boolean', default: false, describe: 'Non-interactive mode. Requires --project-id and --api-key (or existing values in the files).' }), async (argv) => {
942
+ .option('console-api-url', {
943
+ type: 'string',
944
+ describe: 'Override console API URL (for self-hosted / internal dev; leave unset for default)',
945
+ })
946
+ .option('yes', {
947
+ type: 'boolean',
948
+ default: false,
949
+ describe: 'Non-interactive mode. Requires --project-id and --api-key (or existing values in the files).',
950
+ }), async (argv) => {
639
951
  const { configSetCommand } = await import('./functions/config/commands/set.js');
640
952
  try {
641
953
  await configSetCommand({
@@ -646,12 +958,14 @@ function buildCli(rawArgs) {
646
958
  });
647
959
  }
648
960
  catch (err) {
649
- console.error(err.message);
650
- process.exit(1);
961
+ (0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_SET_FAILED');
651
962
  }
652
963
  })
653
- .command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a
654
- .option('show-secrets', { type: 'boolean', default: false, describe: 'Reveal apiKey instead of ***last4' }), async (argv) => {
964
+ .command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a.option('show-secrets', {
965
+ type: 'boolean',
966
+ default: false,
967
+ describe: 'Reveal apiKey instead of ***last4',
968
+ }), async (argv) => {
655
969
  const { configGetCommand } = await import('./functions/config/commands/get.js');
656
970
  try {
657
971
  await configGetCommand({
@@ -660,26 +974,51 @@ function buildCli(rawArgs) {
660
974
  });
661
975
  }
662
976
  catch (err) {
663
- console.error(err.message);
664
- process.exit(1);
977
+ (0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_GET_FAILED');
665
978
  }
666
979
  })
667
980
  .demandCommand(1);
668
981
  })
669
982
  .command('validate', 'Load a whole project (local workspace or remote) and report its health — errors, empty models, auto-generated models. Exits 0 whenever a report is produced.', (a) => a
670
- .option('source', { type: 'string', choices: ['local', 'remote'], describe: 'Project source (inferred when omitted)' })
983
+ .option('source', {
984
+ type: 'string',
985
+ choices: ['local', 'remote'],
986
+ describe: 'Project source (inferred when omitted)',
987
+ })
671
988
  .option('lc-json', { type: 'string', describe: 'Loader config path (local source)' })
672
- .option('auto-serve', { type: 'boolean', describe: 'Auto-spawn dcupl serve for local source (default: on; throwaway, auto-cleaned). Use --no-auto-serve to opt out.' })
989
+ .option('auto-serve', {
990
+ type: 'boolean',
991
+ describe: 'Auto-spawn dcupl serve for local source (default: on; throwaway, auto-cleaned). Use --no-auto-serve to opt out.',
992
+ })
673
993
  .option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
674
994
  .option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
675
995
  .option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
996
+ .option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
676
997
  .option('app-key', { type: 'string', describe: 'Application key for the process step' })
677
- .option('env', { type: 'array', string: true, describe: 'Environment keys for the process step (repeatable)' })
998
+ .option('env', {
999
+ type: 'array',
1000
+ string: true,
1001
+ describe: 'Environment keys for the process step (repeatable)',
1002
+ })
678
1003
  .option('tag', { type: 'array', string: true, describe: 'Resource tags for the process step (repeatable)' })
679
- .option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE for the process step (repeatable)' })
680
- .option('limit', { type: 'number', default: 10, describe: 'Max error records in the report (top findings)' })
681
- .option('quality', { type: 'boolean', describe: 'Enable model & data quality checks incl. error tracking (default: true). Use --quality false for a structural-only load.' })
682
- .option('max-memory', { type: 'number', describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.' }), async (argv) => {
1004
+ .option('var', {
1005
+ type: 'array',
1006
+ string: true,
1007
+ describe: 'Variables KEY=VALUE for the process step (repeatable)',
1008
+ })
1009
+ .option('limit', {
1010
+ type: 'number',
1011
+ default: 10,
1012
+ describe: 'Max error records in the report (top findings)',
1013
+ })
1014
+ .option('quality', {
1015
+ type: 'boolean',
1016
+ describe: 'Enable model & data quality checks incl. error tracking (default: true). Use --quality false for a structural-only load.',
1017
+ })
1018
+ .option('max-memory', {
1019
+ type: 'number',
1020
+ describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
1021
+ }), async (argv) => {
683
1022
  const { validateCommand } = await import('./functions/app/commands/validate.js');
684
1023
  const output = (0, output_1.createOutput)(argv.json);
685
1024
  try {
@@ -690,6 +1029,7 @@ function buildCli(rawArgs) {
690
1029
  projectId: argv['project-id'],
691
1030
  apiKey: argv['api-key'],
692
1031
  version: argv.version,
1032
+ cdnBaseUrl: argv['cdn-base-url'],
693
1033
  appKey: argv['app-key'],
694
1034
  env: argv.env,
695
1035
  tag: argv.tag,
@@ -704,40 +1044,123 @@ function buildCli(rawArgs) {
704
1044
  }
705
1045
  })
706
1046
  .command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
707
- return yy
1047
+ return (yy
708
1048
  .command('create', 'Start a new daemon and register an app', (a) => a
709
1049
  .option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
710
1050
  .option('idle-timeout', { type: 'number', default: 30, describe: 'Idle timeout in minutes' })
711
- .option('auto-update', { type: 'boolean', default: false, describe: 'Auto-run update() after every mutation. Default (off): mutations stage changes, run `dcupl app build` to apply (mirrors the SDK).' })
712
- .option('auto-generate-properties', { type: 'boolean', default: false, describe: 'Infer model schema from the data on first ingest. Daemon-wide default; override per call on `app data <verb>`.' })
713
- .option('auto-generate-deep', { type: 'boolean', default: false, describe: 'When inferring model schema, walk every row and reconcile types (handles row-1 blanks). Implies --auto-generate-properties.' })
714
- .option('auto-generate-sample-size', { type: 'number', describe: 'When inferring model schema, sample at most N rows (implies deep). Useful for large CSVs where row 1 may not represent the schema.' })
715
- .option('quality', { type: 'boolean', describe: 'Enable model & data quality checks (default: true). Use `--quality false` to opt out.' })
1051
+ .option('auto-update', {
1052
+ type: 'boolean',
1053
+ default: false,
1054
+ describe: 'Auto-run update() after every mutation. Default (off): mutations stage changes, run `dcupl app build` to apply (mirrors the SDK).',
1055
+ })
1056
+ .option('auto-generate-properties', {
1057
+ type: 'boolean',
1058
+ default: false,
1059
+ describe: 'Infer model schema from the data on first ingest. Daemon-wide default; override per call on `app data <verb>`.',
1060
+ })
1061
+ .option('auto-generate-deep', {
1062
+ type: 'boolean',
1063
+ default: false,
1064
+ describe: 'When inferring model schema, walk every row and reconcile types (handles row-1 blanks). Implies --auto-generate-properties.',
1065
+ })
1066
+ .option('auto-generate-sample-size', {
1067
+ type: 'number',
1068
+ describe: 'When inferring model schema, sample at most N rows (implies deep). Useful for large CSVs where row 1 may not represent the schema.',
1069
+ })
1070
+ .option('quality', {
1071
+ type: 'boolean',
1072
+ describe: 'Enable model & data quality checks (default: true). Use `--quality false` to opt out.',
1073
+ })
716
1074
  .option('cache', { type: 'boolean', describe: 'Enable internal API caching (default: true)' })
717
- .option('clone', { type: 'boolean', describe: 'Enable deep data clones to avoid mutation side-effects (default: false)' })
718
- .option('analytics', { type: 'boolean', describe: 'Enable analytics instrumentation (default: true)' })
719
- .option('reference-metadata', { type: 'boolean', describe: 'Enable reference metadata resolution (default: true)' })
1075
+ .option('clone', {
1076
+ type: 'boolean',
1077
+ describe: 'Enable deep data clones to avoid mutation side-effects (default: false)',
1078
+ })
1079
+ .option('analytics', {
1080
+ type: 'boolean',
1081
+ describe: 'Enable analytics instrumentation (default: true)',
1082
+ })
1083
+ .option('reference-metadata', {
1084
+ type: 'boolean',
1085
+ describe: 'Enable reference metadata resolution (default: true)',
1086
+ })
720
1087
  .option('logging-level', { type: 'string', choices: init_options_js_1.LOG_LEVELS, describe: 'Minimum SDK log level' })
721
- .option('logging-format', { type: 'string', choices: [...init_options_js_1.LOG_FORMATS], describe: 'SDK log output format' })
722
- .option('max-memory', { type: 'number', describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.' })
723
- .option('max-body', { type: 'string', default: '2gb', describe: 'Max request body size, e.g. 2gb, 500mb' })
724
- .option('load', { type: 'boolean', describe: 'After creating the daemon, register, process, and build a loader so the app is immediately queryable' })
1088
+ .option('logging-format', {
1089
+ type: 'string',
1090
+ choices: [...init_options_js_1.LOG_FORMATS],
1091
+ describe: 'SDK log output format',
1092
+ })
1093
+ .option('max-memory', {
1094
+ type: 'number',
1095
+ describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
1096
+ })
1097
+ .option('max-body', {
1098
+ type: 'string',
1099
+ default: '2gb',
1100
+ describe: 'Max request body size, e.g. 2gb, 500mb',
1101
+ })
1102
+ .option('load', {
1103
+ type: 'boolean',
1104
+ describe: 'After creating the daemon, register, process, and build a loader so the app is immediately queryable',
1105
+ })
725
1106
  .option('key', { type: 'string', describe: 'Loader key for --load (auto-generated if omitted)' })
726
- .option('source', { type: 'string', choices: ['local', 'remote', 'url'], describe: 'Loader source for --load (default: local in a workspace). Aliases: --workspace/--project-id/--base-url' })
727
- .option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as loader source (--load)' })
728
- .option('project-id', { type: 'string', describe: 'dcupl Console project id (cdn loader source, --load)' })
1107
+ .option('source', {
1108
+ type: 'string',
1109
+ choices: ['local', 'remote', 'url'],
1110
+ describe: 'Loader source for --load (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
1111
+ })
1112
+ .option('workspace', {
1113
+ type: 'boolean',
1114
+ describe: 'Use local dcupl workspace as loader source (--load)',
1115
+ })
1116
+ .option('project-id', {
1117
+ type: 'string',
1118
+ describe: 'dcupl Console project id (cdn loader source, --load). CDN host: see --cdn-base-url',
1119
+ })
729
1120
  .option('api-key', { type: 'string', describe: 'Console API key (--load)' })
730
- .option('version', { type: 'string', describe: 'Console version id (cdn loader source, default: draft)' })
1121
+ .option('version', {
1122
+ type: 'string',
1123
+ describe: 'Console version id (cdn loader source, default: draft)',
1124
+ })
1125
+ .option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
731
1126
  .option('base-url', { type: 'string', describe: 'Custom base URL loader source (--load)' })
732
- .option('loader-file', { type: 'string', describe: 'Loader file name for base-url source (--load)' })
733
- .option('header', { type: 'array', string: true, describe: 'HTTP headers for base-url source KEY=VALUE (repeatable, --load)' })
734
- .option('lc-json', { type: 'string', describe: 'Path to loader config file (workspace source, --load)' })
735
- .option('auto-serve', { type: 'boolean', describe: 'Auto-spawn dcupl serve if not running (workspace source, --load)' })
736
- .option('auto-serve-port', { type: 'string', describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned (--load)' })
1127
+ .option('loader-file', {
1128
+ type: 'string',
1129
+ describe: 'Loader file name for base-url source (--load)',
1130
+ })
1131
+ .option('header', {
1132
+ type: 'array',
1133
+ string: true,
1134
+ describe: 'HTTP headers for base-url source KEY=VALUE (repeatable, --load)',
1135
+ })
1136
+ .option('lc-json', {
1137
+ type: 'string',
1138
+ describe: 'Path to loader config file (workspace source, --load)',
1139
+ })
1140
+ .option('auto-serve', {
1141
+ type: 'boolean',
1142
+ describe: 'Auto-spawn dcupl serve if not running (workspace source, --load)',
1143
+ })
1144
+ .option('auto-serve-port', {
1145
+ type: 'string',
1146
+ describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned (--load)',
1147
+ })
737
1148
  .option('app-key', { type: 'string', describe: 'Application key for process step (--load)' })
738
- .option('env', { type: 'array', string: true, describe: 'Environment keys for process step (repeatable, --load)' })
739
- .option('tag', { type: 'array', string: true, describe: 'Resource tags for process step (repeatable, comma-separate for AND, --load)' })
740
- .option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE for process step (repeatable, --load)' }), async (argv) => {
1149
+ .option('env', {
1150
+ type: 'array',
1151
+ string: true,
1152
+ describe: 'Environment keys for process step (repeatable, --load)',
1153
+ })
1154
+ .option('tag', {
1155
+ type: 'array',
1156
+ string: true,
1157
+ describe: 'Resource tags for process step (repeatable, comma-separate for AND, --load)',
1158
+ })
1159
+ .option('var', {
1160
+ type: 'array',
1161
+ string: true,
1162
+ describe: 'Variables KEY=VALUE for process step (repeatable, --load)',
1163
+ }), async (argv) => {
741
1164
  const { createCommand } = await import('./functions/app/commands/create.js');
742
1165
  const output = (0, output_1.createOutput)(argv.json);
743
1166
  try {
@@ -765,6 +1188,7 @@ function buildCli(rawArgs) {
765
1188
  projectId: argv['project-id'],
766
1189
  apiKey: argv['api-key'],
767
1190
  version: argv.version,
1191
+ cdnBaseUrl: argv['cdn-base-url'],
768
1192
  baseUrl: argv['base-url'],
769
1193
  loaderFile: argv['loader-file'],
770
1194
  header: argv.header,
@@ -781,12 +1205,14 @@ function buildCli(rawArgs) {
781
1205
  });
782
1206
  }
783
1207
  catch (err) {
784
- output.error(err.message, err.code || 'CREATE_FAILED');
1208
+ output.error(err.message, err.code || 'CREATE_FAILED', err.details === undefined ? undefined : { details: err.details });
785
1209
  }
786
1210
  })
787
- .command('destroy', 'Stop a daemon', (a) => a
788
- .option('app', { type: 'string' })
789
- .option('keep-logs', { type: 'boolean', default: false, describe: 'Keep the daemon log file after destroy' }), async (argv) => {
1211
+ .command('destroy', 'Stop a daemon', (a) => a.option('app', { type: 'string' }).option('keep-logs', {
1212
+ type: 'boolean',
1213
+ default: false,
1214
+ describe: 'Keep the daemon log file after destroy',
1215
+ }), async (argv) => {
790
1216
  const { destroyCommand } = await import('./functions/app/commands/destroy.js');
791
1217
  const output = (0, output_1.createOutput)(argv.json);
792
1218
  try {
@@ -862,12 +1288,17 @@ function buildCli(rawArgs) {
862
1288
  .command('set', 'Set a model from a JSON file or inline content', (a) => a
863
1289
  .option('app', { type: 'string' })
864
1290
  .option('file', { type: 'string', describe: 'Path to model JSON file' })
865
- .option('content', { type: 'string', describe: 'Inline JSON model definition (use "-" to read from stdin)' }), async (argv) => {
1291
+ .option('content', {
1292
+ type: 'string',
1293
+ describe: 'Inline JSON model definition (use "-" to read from stdin)',
1294
+ }), async (argv) => {
866
1295
  const { setCommand } = await import('./functions/app/commands/models/set.js');
867
1296
  const output = (0, output_1.createOutput)(argv.json);
868
1297
  try {
869
1298
  const content = argv.content !== undefined
870
- ? (argv.content === '' && argv._.includes('-') ? '-' : argv.content)
1299
+ ? argv.content === '' && argv._.includes('-')
1300
+ ? '-'
1301
+ : argv.content
871
1302
  : undefined;
872
1303
  await setCommand(output, { appId: argv.app, file: argv.file, content });
873
1304
  }
@@ -889,26 +1320,46 @@ function buildCli(rawArgs) {
889
1320
  .command('data <verb>', 'Ingest data', (yyy) => {
890
1321
  const dataOpts = (a) => a
891
1322
  .option('app', { type: 'string' })
892
- .option('file', { type: 'string', describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest' })
1323
+ .option('file', {
1324
+ type: 'string',
1325
+ describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest',
1326
+ })
893
1327
  .option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
894
1328
  .option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
895
1329
  .option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
896
1330
  .option('model', { type: 'string', demandOption: true })
897
1331
  .option('key-property', { type: 'string' })
898
1332
  .option('auto-generate-key', { type: 'boolean', default: false })
899
- .option('auto-generate-properties', { type: 'boolean', describe: 'Override daemon default for this call (use --no-auto-generate-properties to force off)' })
900
- .option('auto-generate-deep', { type: 'boolean', describe: 'Walk every row when inferring (implies --auto-generate-properties)' })
901
- .option('auto-generate-sample-size', { type: 'number', describe: 'Sample N rows when inferring (implies deep)' });
1333
+ .option('auto-generate-properties', {
1334
+ type: 'boolean',
1335
+ describe: 'Override daemon default for this call (use --no-auto-generate-properties to force off)',
1336
+ })
1337
+ .option('auto-generate-deep', {
1338
+ type: 'boolean',
1339
+ describe: 'Walk every row when inferring (implies --auto-generate-properties)',
1340
+ })
1341
+ .option('auto-generate-sample-size', {
1342
+ type: 'number',
1343
+ describe: 'Sample N rows when inferring (implies deep)',
1344
+ });
902
1345
  const handler = (mod, exportName, code) => async (argv) => {
903
1346
  const m = await import(`./functions/app/commands/data/${mod}.js`);
904
1347
  const output = (0, output_1.createOutput)(argv.json);
905
1348
  try {
906
1349
  const content = argv.content !== undefined
907
- ? (argv.content === '' && argv._.includes('-') ? '-' : argv.content)
1350
+ ? argv.content === '' && argv._.includes('-')
1351
+ ? '-'
1352
+ : argv.content
908
1353
  : undefined;
909
1354
  await m[exportName](output, {
910
- appId: argv.app, file: argv.file, url: argv.url, content, format: argv.format,
911
- model: argv.model, keyProperty: argv.keyProperty, autoGenerateKey: argv.autoGenerateKey,
1355
+ appId: argv.app,
1356
+ file: argv.file,
1357
+ url: argv.url,
1358
+ content,
1359
+ format: argv.format,
1360
+ model: argv.model,
1361
+ keyProperty: argv.keyProperty,
1362
+ autoGenerateKey: argv.autoGenerateKey,
912
1363
  autoGenerateProperties: argv.autoGenerateProperties,
913
1364
  autoGenerateDeep: argv.autoGenerateDeep,
914
1365
  autoGenerateSampleSize: argv.autoGenerateSampleSize,
@@ -936,7 +1387,10 @@ function buildCli(rawArgs) {
936
1387
  .demandCommand(1);
937
1388
  })
938
1389
  .command('query <verb>', 'Query records', (yyy) => yyy
939
- .command('one', 'Fetch single record', (a) => a.option('app', { type: 'string' }).option('model', { type: 'string', demandOption: true }).option('item-key', { type: 'string', demandOption: true }), async (argv) => {
1390
+ .command('one', 'Fetch single record', (a) => a
1391
+ .option('app', { type: 'string' })
1392
+ .option('model', { type: 'string', demandOption: true })
1393
+ .option('item-key', { type: 'string', demandOption: true }), async (argv) => {
940
1394
  const { oneCommand } = await import('./functions/app/commands/query/one.js');
941
1395
  const output = (0, output_1.createOutput)(argv.json);
942
1396
  try {
@@ -959,9 +1413,13 @@ function buildCli(rawArgs) {
959
1413
  const output = (0, output_1.createOutput)(argv.json);
960
1414
  try {
961
1415
  await executeCommand(output, {
962
- appId: argv.app, model: argv.model,
963
- query: argv.query, queryFile: argv.queryFile,
964
- sort: argv.sort, limit: argv.limit, start: argv.start,
1416
+ appId: argv.app,
1417
+ model: argv.model,
1418
+ query: argv.query,
1419
+ queryFile: argv.queryFile,
1420
+ sort: argv.sort,
1421
+ limit: argv.limit,
1422
+ start: argv.start,
965
1423
  projection: argv.projection,
966
1424
  });
967
1425
  }
@@ -986,15 +1444,32 @@ function buildCli(rawArgs) {
986
1444
  choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
987
1445
  describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
988
1446
  })
989
- .option('full', { type: 'boolean', default: false, describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)' })
990
- .option('include-results', { type: 'boolean', default: false, describe: 'Keep resultKeys in compact output' }), async (argv) => {
1447
+ .option('full', {
1448
+ type: 'boolean',
1449
+ default: false,
1450
+ describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)',
1451
+ })
1452
+ .option('include-results', {
1453
+ type: 'boolean',
1454
+ default: false,
1455
+ describe: 'Keep resultKeys in compact output',
1456
+ }), async (argv) => {
991
1457
  const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
992
1458
  const output = (0, output_1.createOutput)(argv.json);
993
1459
  try {
994
1460
  await facetsCommand(output, {
995
- appId: argv.app, model: argv.model, attribute: argv.attribute,
996
- excludeZeros: argv.excludeZeros, excludeUndefineds: argv.excludeUndefineds, excludeUnresolved: argv.excludeUnresolved, query: argv.query, queryFile: argv.queryFile,
997
- limit: argv.limit, sort: argv.sort, full: argv.full, includeResults: argv.includeResults,
1461
+ appId: argv.app,
1462
+ model: argv.model,
1463
+ attribute: argv.attribute,
1464
+ excludeZeros: argv.excludeZeros,
1465
+ excludeUndefineds: argv.excludeUndefineds,
1466
+ excludeUnresolved: argv.excludeUnresolved,
1467
+ query: argv.query,
1468
+ queryFile: argv.queryFile,
1469
+ limit: argv.limit,
1470
+ sort: argv.sort,
1471
+ full: argv.full,
1472
+ includeResults: argv.includeResults,
998
1473
  });
999
1474
  }
1000
1475
  catch (err) {
@@ -1005,11 +1480,21 @@ function buildCli(rawArgs) {
1005
1480
  .option('app', { type: 'string' })
1006
1481
  .option('model', { type: 'string', demandOption: true })
1007
1482
  .option('attribute', { type: 'string', demandOption: true })
1008
- .option('types', { type: 'string', describe: 'Comma-separated: distinct,count,sum,avg,min,max,group. Optional when --bins/--group-options supply grouping.' })
1483
+ .option('types', {
1484
+ type: 'string',
1485
+ describe: 'Comma-separated: distinct,count,sum,avg,min,max,group. Optional when --bins/--group-options supply grouping.',
1486
+ })
1009
1487
  .option('query', { type: 'string' })
1010
1488
  .option('query-file', { type: 'string' })
1011
- .option('include-keys', { type: 'boolean', default: false, describe: 'Include row keys in distinct results' })
1012
- .option('bins', { type: 'string', describe: 'Numeric ranges for grouping, e.g. 0-100,100-200,200-' })
1489
+ .option('include-keys', {
1490
+ type: 'boolean',
1491
+ default: false,
1492
+ describe: 'Include row keys in distinct results',
1493
+ })
1494
+ .option('bins', {
1495
+ type: 'string',
1496
+ describe: 'Numeric ranges for grouping, e.g. 0-100,100-200,200-',
1497
+ })
1013
1498
  .option('group-options', { type: 'string', describe: 'Full groupOptions JSON' })
1014
1499
  .option('group-options-file', { type: 'string', describe: 'Path to groupOptions JSON' })
1015
1500
  .option('distinct-limit', { type: 'number', describe: 'Cap distinct values' })
@@ -1020,10 +1505,20 @@ function buildCli(rawArgs) {
1020
1505
  const output = (0, output_1.createOutput)(argv.json);
1021
1506
  try {
1022
1507
  await aggregateCommand(output, {
1023
- appId: argv.app, model: argv.model, attribute: argv.attribute, types: argv.types, query: argv.query, queryFile: argv.queryFile, includeKeys: argv.includeKeys,
1024
- bins: argv.bins, groupOptions: argv.groupOptions, groupOptionsFile: argv.groupOptionsFile,
1025
- distinctLimit: argv.distinctLimit, excludeZeros: argv.excludeZeros,
1026
- excludeUndefineds: argv.excludeUndefineds, excludeUnresolved: argv.excludeUnresolved,
1508
+ appId: argv.app,
1509
+ model: argv.model,
1510
+ attribute: argv.attribute,
1511
+ types: argv.types,
1512
+ query: argv.query,
1513
+ queryFile: argv.queryFile,
1514
+ includeKeys: argv.includeKeys,
1515
+ bins: argv.bins,
1516
+ groupOptions: argv.groupOptions,
1517
+ groupOptionsFile: argv.groupOptionsFile,
1518
+ distinctLimit: argv.distinctLimit,
1519
+ excludeZeros: argv.excludeZeros,
1520
+ excludeUndefineds: argv.excludeUndefineds,
1521
+ excludeUnresolved: argv.excludeUnresolved,
1027
1522
  });
1028
1523
  }
1029
1524
  catch (err) {
@@ -1036,7 +1531,10 @@ function buildCli(rawArgs) {
1036
1531
  .option('attribute', { type: 'string', demandOption: true })
1037
1532
  .option('query', { type: 'string' })
1038
1533
  .option('query-file', { type: 'string' })
1039
- .option('aggregate', { type: 'array', describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.' })
1534
+ .option('aggregate', {
1535
+ type: 'array',
1536
+ describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.',
1537
+ })
1040
1538
  .option('exclude-zeros', { type: 'boolean' })
1041
1539
  .option('exclude-undefineds', { type: 'boolean' })
1042
1540
  .option('exclude-unresolved', { type: 'boolean' })
@@ -1047,9 +1545,18 @@ function buildCli(rawArgs) {
1047
1545
  const output = (0, output_1.createOutput)(argv.json);
1048
1546
  try {
1049
1547
  await groupByCommand(output, {
1050
- appId: argv.app, model: argv.model, attribute: argv.attribute, query: argv.query, queryFile: argv.queryFile, aggregate: argv.aggregate,
1051
- excludeZeros: argv.excludeZeros, excludeUndefineds: argv.excludeUndefineds,
1052
- excludeUnresolved: argv.excludeUnresolved, sort: argv.sort, limit: argv.limit, start: argv.start,
1548
+ appId: argv.app,
1549
+ model: argv.model,
1550
+ attribute: argv.attribute,
1551
+ query: argv.query,
1552
+ queryFile: argv.queryFile,
1553
+ aggregate: argv.aggregate,
1554
+ excludeZeros: argv.excludeZeros,
1555
+ excludeUndefineds: argv.excludeUndefineds,
1556
+ excludeUnresolved: argv.excludeUnresolved,
1557
+ sort: argv.sort,
1558
+ limit: argv.limit,
1559
+ start: argv.start,
1053
1560
  });
1054
1561
  }
1055
1562
  catch (err) {
@@ -1064,7 +1571,12 @@ function buildCli(rawArgs) {
1064
1571
  const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
1065
1572
  const output = (0, output_1.createOutput)(argv.json);
1066
1573
  try {
1067
- await metadataCommand(output, { appId: argv.app, model: argv.model, query: argv.query, queryFile: argv.queryFile });
1574
+ await metadataCommand(output, {
1575
+ appId: argv.app,
1576
+ model: argv.model,
1577
+ query: argv.query,
1578
+ queryFile: argv.queryFile,
1579
+ });
1068
1580
  }
1069
1581
  catch (err) {
1070
1582
  output.error(err.message, err.code || 'FN_METADATA_FAILED');
@@ -1073,11 +1585,20 @@ function buildCli(rawArgs) {
1073
1585
  .command('pivot', 'Multi-dimensional cross-tab (rows x columns x values)', (a) => a
1074
1586
  .option('app', { type: 'string' })
1075
1587
  .option('model', { type: 'string', demandOption: true })
1076
- .option('rows', { type: 'array', describe: 'Row attribute(s); append :totals for row totals. Repeatable.' })
1077
- .option('columns', { type: 'array', describe: 'Column attribute(s); append :totals. Repeatable.' })
1588
+ .option('rows', {
1589
+ type: 'array',
1590
+ describe: 'Row attribute(s); append :totals for row totals. Repeatable.',
1591
+ })
1592
+ .option('columns', {
1593
+ type: 'array',
1594
+ describe: 'Column attribute(s); append :totals. Repeatable.',
1595
+ })
1078
1596
  .option('values', { type: 'array', describe: 'Aggregations <attr>:<type[,type]>. Repeatable.' })
1079
1597
  .option('totals', { type: 'boolean', describe: 'Compute grand totals' })
1080
- .option('spec', { type: 'string', describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)' })
1598
+ .option('spec', {
1599
+ type: 'string',
1600
+ describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)',
1601
+ })
1081
1602
  .option('spec-file', { type: 'string', describe: 'Path to PivotOptions JSON' })
1082
1603
  .option('query', { type: 'string' })
1083
1604
  .option('query-file', { type: 'string' }), async (argv) => {
@@ -1085,10 +1606,16 @@ function buildCli(rawArgs) {
1085
1606
  const output = (0, output_1.createOutput)(argv.json);
1086
1607
  try {
1087
1608
  await pivotCommand(output, {
1088
- appId: argv.app, model: argv.model,
1089
- rows: argv.rows, columns: argv.columns,
1090
- values: argv.values, totals: argv.totals,
1091
- spec: argv.spec, specFile: argv.specFile, query: argv.query, queryFile: argv.queryFile,
1609
+ appId: argv.app,
1610
+ model: argv.model,
1611
+ rows: argv.rows,
1612
+ columns: argv.columns,
1613
+ values: argv.values,
1614
+ totals: argv.totals,
1615
+ spec: argv.spec,
1616
+ specFile: argv.specFile,
1617
+ query: argv.query,
1618
+ queryFile: argv.queryFile,
1092
1619
  });
1093
1620
  }
1094
1621
  catch (err) {
@@ -1101,7 +1628,10 @@ function buildCli(rawArgs) {
1101
1628
  .option('attribute', { type: 'string', demandOption: true })
1102
1629
  .option('value', { type: 'string', demandOption: true })
1103
1630
  .option('max', { type: 'number' })
1104
- .option('relevant-data', { type: 'string', choices: ['filtered', 'all', 'excludeQuery'] })
1631
+ .option('relevant-data', {
1632
+ type: 'string',
1633
+ choices: ['filtered', 'all', 'excludeQuery'],
1634
+ })
1105
1635
  .option('calculate-result-keys', { type: 'boolean' })
1106
1636
  .option('exclude-undefineds', { type: 'boolean' })
1107
1637
  .option('exclude-nulls', { type: 'boolean' })
@@ -1113,11 +1643,19 @@ function buildCli(rawArgs) {
1113
1643
  const output = (0, output_1.createOutput)(argv.json);
1114
1644
  try {
1115
1645
  await suggestCommand(output, {
1116
- appId: argv.app, model: argv.model, attribute: argv.attribute, value: argv.value,
1117
- max: argv.max, relevantData: argv.relevantData,
1118
- calculateResultKeys: argv.calculateResultKeys, excludeUndefineds: argv.excludeUndefineds,
1119
- excludeNulls: argv.excludeNulls, excludeQuery: argv.excludeQuery, excludeQueryFile: argv.excludeQueryFile,
1120
- query: argv.query, queryFile: argv.queryFile,
1646
+ appId: argv.app,
1647
+ model: argv.model,
1648
+ attribute: argv.attribute,
1649
+ value: argv.value,
1650
+ max: argv.max,
1651
+ relevantData: argv.relevantData,
1652
+ calculateResultKeys: argv.calculateResultKeys,
1653
+ excludeUndefineds: argv.excludeUndefineds,
1654
+ excludeNulls: argv.excludeNulls,
1655
+ excludeQuery: argv.excludeQuery,
1656
+ excludeQueryFile: argv.excludeQueryFile,
1657
+ query: argv.query,
1658
+ queryFile: argv.queryFile,
1121
1659
  });
1122
1660
  }
1123
1661
  catch (err) {
@@ -1129,17 +1667,38 @@ function buildCli(rawArgs) {
1129
1667
  .command('add', 'Register a loader source', (a) => a
1130
1668
  .option('app', { type: 'string', describe: 'App id' })
1131
1669
  .option('key', { type: 'string', describe: 'Loader key (auto-generated if omitted)' })
1132
- .option('source', { type: 'string', choices: ['local', 'remote', 'url'], describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url' })
1670
+ .option('source', {
1671
+ type: 'string',
1672
+ choices: ['local', 'remote', 'url'],
1673
+ describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
1674
+ })
1133
1675
  .option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
1134
- .option('project-id', { type: 'string', describe: 'dcupl Console project id (cdn source)' })
1676
+ .option('project-id', {
1677
+ type: 'string',
1678
+ describe: 'dcupl Console project id (cdn source). CDN host: see --cdn-base-url',
1679
+ })
1135
1680
  .option('api-key', { type: 'string', describe: 'Console API key' })
1136
- .option('version', { type: 'string', describe: 'Console version id (cdn source, default: draft)' })
1681
+ .option('version', {
1682
+ type: 'string',
1683
+ describe: 'Console version id (cdn source, default: draft)',
1684
+ })
1685
+ .option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
1137
1686
  .option('base-url', { type: 'string', describe: 'Custom base URL source' })
1138
1687
  .option('loader-file', { type: 'string', describe: 'Loader file name for base-url source' })
1139
- .option('header', { type: 'array', string: true, describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)' })
1688
+ .option('header', {
1689
+ type: 'array',
1690
+ string: true,
1691
+ describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)',
1692
+ })
1140
1693
  .option('lc-json', { type: 'string', describe: 'Path to loader config (workspace source)' })
1141
- .option('auto-serve', { type: 'boolean', describe: 'Auto-spawn dcupl serve if not running (workspace source)' })
1142
- .option('auto-serve-port', { type: 'string', describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned' }), async (argv) => {
1694
+ .option('auto-serve', {
1695
+ type: 'boolean',
1696
+ describe: 'Auto-spawn dcupl serve if not running (workspace source)',
1697
+ })
1698
+ .option('auto-serve-port', {
1699
+ type: 'string',
1700
+ describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned',
1701
+ }), async (argv) => {
1143
1702
  const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
1144
1703
  const output = (0, output_1.createOutput)(argv.json);
1145
1704
  try {
@@ -1152,6 +1711,7 @@ function buildCli(rawArgs) {
1152
1711
  projectId: argv['project-id'],
1153
1712
  apiKey: argv['api-key'],
1154
1713
  version: argv.version,
1714
+ cdnBaseUrl: argv['cdn-base-url'],
1155
1715
  baseUrl: argv['base-url'],
1156
1716
  loaderFile: argv['loader-file'],
1157
1717
  header: argv.header,
@@ -1162,7 +1722,7 @@ function buildCli(rawArgs) {
1162
1722
  });
1163
1723
  }
1164
1724
  catch (err) {
1165
- output.error(err.message, err.code || 'LOADERS_ADD_FAILED');
1725
+ output.error(err.message, err.code || 'LOADERS_ADD_FAILED', err.details === undefined ? undefined : { details: err.details });
1166
1726
  }
1167
1727
  })
1168
1728
  .command('process', 'Process (re-load) a loader', (a) => a
@@ -1170,7 +1730,11 @@ function buildCli(rawArgs) {
1170
1730
  .option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
1171
1731
  .option('app-key', { type: 'string', describe: 'Application key' })
1172
1732
  .option('env', { type: 'array', string: true, describe: 'Environment keys (repeatable)' })
1173
- .option('tag', { type: 'array', string: true, describe: 'Resource tags (repeatable, comma-separate for AND)' })
1733
+ .option('tag', {
1734
+ type: 'array',
1735
+ string: true,
1736
+ describe: 'Resource tags (repeatable, comma-separate for AND)',
1737
+ })
1174
1738
  .option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
1175
1739
  const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
1176
1740
  const output = (0, output_1.createOutput)(argv.json);
@@ -1225,7 +1789,7 @@ function buildCli(rawArgs) {
1225
1789
  }
1226
1790
  })
1227
1791
  .demandCommand(1))
1228
- .demandCommand(1);
1792
+ .demandCommand(1));
1229
1793
  }, () => { })
1230
1794
  .command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
1231
1795
  (0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
@@ -1263,8 +1827,8 @@ function buildCli(rawArgs) {
1263
1827
  const output = (0, output_1.createOutput)(argv.json);
1264
1828
  if (!output.isJson()) {
1265
1829
  process.stderr.write(`⚠️ Deprecation: 'dcupl files:push' is deprecated and will be removed in a future release.\n` +
1266
- ` Use 'dcupl files push' (sync-aware) instead. Note: binary file uploads are not yet\n` +
1267
- ` supported by the new command — continue using 'files:push' until that lands.\n`);
1830
+ ` Use 'dcupl files push' (sync-aware, changed-only; accepts .csv, .json, .txt, .md, .js).\n` +
1831
+ ` This legacy zip upload keeps only .csv, .json and .js and silently drops everything else.\n`);
1268
1832
  }
1269
1833
  const { pushFiles } = await import('./functions/files/files-push.js');
1270
1834
  pushFiles(argv, output);
@@ -1278,9 +1842,8 @@ function buildCli(rawArgs) {
1278
1842
  const output = (0, output_1.createOutput)(argv.json);
1279
1843
  if (!output.isJson()) {
1280
1844
  process.stderr.write(`⚠️ Deprecation: 'dcupl files:pull' is deprecated and will be removed in a future release.\n` +
1281
- ` Use 'dcupl files pull' (sync-aware) instead. Note: the new 'files <verb>' pair only\n` +
1282
- ` supports text/UTF-8 round-trips — projects containing binary files originally pushed\n` +
1283
- ` via 'files:push' should continue using 'files:pull' to stay in lockstep.\n`);
1845
+ ` Use 'dcupl files pull' (sync-aware, changed-only) instead. The dcupl CDN stores text files\n` +
1846
+ ` only, so there is nothing the new command cannot round-trip.\n`);
1284
1847
  }
1285
1848
  const { pullFiles } = await import('./functions/files/files-pull.js');
1286
1849
  pullFiles(argv, output);
@@ -1298,7 +1861,12 @@ function buildCli(rawArgs) {
1298
1861
  try {
1299
1862
  const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
1300
1863
  const client = (0, api_client_1.createApiClient)();
1301
- await copyVersionCommand(client, output, { from: argv.from, to: argv.to, yes: true, dryRun: false });
1864
+ await copyVersionCommand(client, output, {
1865
+ from: argv.from,
1866
+ to: argv.to,
1867
+ yes: true,
1868
+ dryRun: false,
1869
+ });
1302
1870
  }
1303
1871
  catch (err) {
1304
1872
  output.error(err.error || err.message, err.code || 'UNKNOWN');
@@ -1319,6 +1887,6 @@ function buildCli(rawArgs) {
1319
1887
  output.error(err.error || err.message, err.code || 'UNKNOWN');
1320
1888
  }
1321
1889
  })
1322
- .demandCommand(1);
1890
+ .demandCommand(1));
1323
1891
  }
1324
1892
  //# sourceMappingURL=cli.js.map