@dcupl/cli 1.4.0-beta.0 → 1.4.0-beta.10

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 (302) hide show
  1. package/README.md +45 -0
  2. package/dist/cli.js +782 -149
  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.d.ts +13 -0
  17. package/dist/functions/app/commands/fn/_fn-helpers.js +64 -0
  18. package/dist/functions/app/commands/fn/_fn-helpers.js.map +1 -1
  19. package/dist/functions/app/commands/fn/aggregate.d.ts +8 -1
  20. package/dist/functions/app/commands/fn/aggregate.js +32 -3
  21. package/dist/functions/app/commands/fn/aggregate.js.map +1 -1
  22. package/dist/functions/app/commands/fn/facets.d.ts +1 -0
  23. package/dist/functions/app/commands/fn/facets.js +2 -0
  24. package/dist/functions/app/commands/fn/facets.js.map +1 -1
  25. package/dist/functions/app/commands/fn/group-by.d.ts +6 -0
  26. package/dist/functions/app/commands/fn/group-by.js +13 -22
  27. package/dist/functions/app/commands/fn/group-by.js.map +1 -1
  28. package/dist/functions/app/commands/fn/pivot.d.ts +14 -0
  29. package/dist/functions/app/commands/fn/pivot.js +72 -0
  30. package/dist/functions/app/commands/fn/pivot.js.map +1 -0
  31. package/dist/functions/app/commands/fn/suggest.d.ts +17 -0
  32. package/dist/functions/app/commands/fn/suggest.js +34 -0
  33. package/dist/functions/app/commands/fn/suggest.js.map +1 -0
  34. package/dist/functions/app/commands/list.js +6 -2
  35. package/dist/functions/app/commands/list.js.map +1 -1
  36. package/dist/functions/app/commands/loader-hash.js.map +1 -1
  37. package/dist/functions/app/commands/loaders/add.js +6 -0
  38. package/dist/functions/app/commands/loaders/add.js.map +1 -1
  39. package/dist/functions/app/commands/loaders/process-flags.js +4 -1
  40. package/dist/functions/app/commands/loaders/process-flags.js.map +1 -1
  41. package/dist/functions/app/commands/loaders/process.js +3 -1
  42. package/dist/functions/app/commands/loaders/process.js.map +1 -1
  43. package/dist/functions/app/commands/models/get.js.map +1 -1
  44. package/dist/functions/app/commands/models/keys.js.map +1 -1
  45. package/dist/functions/app/commands/models/remove.js.map +1 -1
  46. package/dist/functions/app/commands/models/set.js +3 -1
  47. package/dist/functions/app/commands/models/set.js.map +1 -1
  48. package/dist/functions/app/commands/query/execute.js +5 -2
  49. package/dist/functions/app/commands/query/execute.js.map +1 -1
  50. package/dist/functions/app/commands/query/one.js +3 -1
  51. package/dist/functions/app/commands/query/one.js.map +1 -1
  52. package/dist/functions/app/commands/render.js +10 -4
  53. package/dist/functions/app/commands/render.js.map +1 -1
  54. package/dist/functions/app/commands/resolve-app.js.map +1 -1
  55. package/dist/functions/app/commands/resolve-source.d.ts +1 -0
  56. package/dist/functions/app/commands/resolve-source.js +29 -6
  57. package/dist/functions/app/commands/resolve-source.js.map +1 -1
  58. package/dist/functions/app/commands/validate-report.d.ts +31 -0
  59. package/dist/functions/app/commands/validate-report.js +20 -1
  60. package/dist/functions/app/commands/validate-report.js.map +1 -1
  61. package/dist/functions/app/commands/validate.d.ts +1 -0
  62. package/dist/functions/app/commands/validate.js +32 -14
  63. package/dist/functions/app/commands/validate.js.map +1 -1
  64. package/dist/functions/app/daemon/app-server.module.js +6 -1
  65. package/dist/functions/app/daemon/app-server.module.js.map +1 -1
  66. package/dist/functions/app/daemon/controllers/data.controller.js +17 -6
  67. package/dist/functions/app/daemon/controllers/data.controller.js.map +1 -1
  68. package/dist/functions/app/daemon/controllers/fn.controller.d.ts +8 -0
  69. package/dist/functions/app/daemon/controllers/fn.controller.js +20 -0
  70. package/dist/functions/app/daemon/controllers/fn.controller.js.map +1 -1
  71. package/dist/functions/app/daemon/controllers/lifecycle.controller.js.map +1 -1
  72. package/dist/functions/app/daemon/controllers/query.controller.js +4 -1
  73. package/dist/functions/app/daemon/controllers/query.controller.js.map +1 -1
  74. package/dist/functions/app/daemon/daemon-args.js +2 -2
  75. package/dist/functions/app/daemon/daemon-args.js.map +1 -1
  76. package/dist/functions/app/daemon/filters/envelope-exception.filter.js +6 -1
  77. package/dist/functions/app/daemon/filters/envelope-exception.filter.js.map +1 -1
  78. package/dist/functions/app/daemon/main.js +14 -7
  79. package/dist/functions/app/daemon/main.js.map +1 -1
  80. package/dist/functions/app/daemon/services/attribute-validation.d.ts +21 -0
  81. package/dist/functions/app/daemon/services/attribute-validation.js +164 -0
  82. package/dist/functions/app/daemon/services/attribute-validation.js.map +1 -0
  83. package/dist/functions/app/daemon/services/dcupl-host.service.d.ts +7 -0
  84. package/dist/functions/app/daemon/services/dcupl-host.service.js +93 -16
  85. package/dist/functions/app/daemon/services/dcupl-host.service.js.map +1 -1
  86. package/dist/functions/app/daemon/services/idle-watchdog.service.js.map +1 -1
  87. package/dist/functions/app/daemon/services/ingest.service.js +8 -4
  88. package/dist/functions/app/daemon/services/ingest.service.js.map +1 -1
  89. package/dist/functions/app/daemon/services/init-options.js.map +1 -1
  90. package/dist/functions/app/daemon/services/loaders.service.d.ts +3 -1
  91. package/dist/functions/app/daemon/services/loaders.service.js +22 -6
  92. package/dist/functions/app/daemon/services/loaders.service.js.map +1 -1
  93. package/dist/functions/app/e2e/port-lock.d.ts +8 -0
  94. package/dist/functions/app/e2e/port-lock.js +66 -2
  95. package/dist/functions/app/e2e/port-lock.js.map +1 -1
  96. package/dist/functions/app/registry/registry.js +11 -10
  97. package/dist/functions/app/registry/registry.js.map +1 -1
  98. package/dist/functions/app/registry/serve-registry.js +13 -9
  99. package/dist/functions/app/registry/serve-registry.js.map +1 -1
  100. package/dist/functions/app/types.d.ts +2 -0
  101. package/dist/functions/config/commands/get.d.ts +3 -3
  102. package/dist/functions/config/commands/get.js +34 -16
  103. package/dist/functions/config/commands/get.js.map +1 -1
  104. package/dist/functions/config/commands/set.js +9 -4
  105. package/dist/functions/config/commands/set.js.map +1 -1
  106. package/dist/functions/config/io.d.ts +4 -1
  107. package/dist/functions/config/io.js +44 -11
  108. package/dist/functions/config/io.js.map +1 -1
  109. package/dist/functions/config/prompts.js +1 -3
  110. package/dist/functions/config/prompts.js.map +1 -1
  111. package/dist/functions/files/commands/copy.js +1 -1
  112. package/dist/functions/files/commands/copy.js.map +1 -1
  113. package/dist/functions/files/commands/delete.js +1 -1
  114. package/dist/functions/files/commands/delete.js.map +1 -1
  115. package/dist/functions/files/commands/list.js +6 -3
  116. package/dist/functions/files/commands/list.js.map +1 -1
  117. package/dist/functions/files/commands/move.js +1 -1
  118. package/dist/functions/files/commands/move.js.map +1 -1
  119. package/dist/functions/files/commands/pull.d.ts +16 -1
  120. package/dist/functions/files/commands/pull.js +135 -1
  121. package/dist/functions/files/commands/pull.js.map +1 -1
  122. package/dist/functions/files/commands/push.d.ts +1 -0
  123. package/dist/functions/files/commands/push.js +25 -3
  124. package/dist/functions/files/commands/push.js.map +1 -1
  125. package/dist/functions/files/commands/read.js +3 -2
  126. package/dist/functions/files/commands/read.js.map +1 -1
  127. package/dist/functions/files/commands/render.d.ts +29 -0
  128. package/dist/functions/files/commands/render.js +8 -4
  129. package/dist/functions/files/commands/render.js.map +1 -1
  130. package/dist/functions/files/commands/status.js +1 -0
  131. package/dist/functions/files/commands/status.js.map +1 -1
  132. package/dist/functions/files/commands/versions/copy.js +1 -1
  133. package/dist/functions/files/commands/versions/copy.js.map +1 -1
  134. package/dist/functions/files/commands/versions/delete.js +1 -1
  135. package/dist/functions/files/commands/versions/delete.js.map +1 -1
  136. package/dist/functions/files/commands/versions/list.js +4 -0
  137. package/dist/functions/files/commands/versions/list.js.map +1 -1
  138. package/dist/functions/files/commands/write.js +13 -3
  139. package/dist/functions/files/commands/write.js.map +1 -1
  140. package/dist/functions/files/files-pull.js +10 -7
  141. package/dist/functions/files/files-pull.js.map +1 -1
  142. package/dist/functions/files/files-push.js +11 -8
  143. package/dist/functions/files/files-push.js.map +1 -1
  144. package/dist/functions/files/helper/text-policy.d.ts +5 -0
  145. package/dist/functions/files/helper/text-policy.js +31 -0
  146. package/dist/functions/files/helper/text-policy.js.map +1 -0
  147. package/dist/functions/files/sync/large-upload.d.ts +20 -0
  148. package/dist/functions/files/sync/large-upload.js +140 -0
  149. package/dist/functions/files/sync/large-upload.js.map +1 -0
  150. package/dist/functions/files/sync/manifest.js +2 -1
  151. package/dist/functions/files/sync/manifest.js.map +1 -1
  152. package/dist/functions/files/sync/transfer.d.ts +5 -0
  153. package/dist/functions/files/sync/transfer.js +47 -10
  154. package/dist/functions/files/sync/transfer.js.map +1 -1
  155. package/dist/functions/files/test-helpers.d.ts +11 -0
  156. package/dist/functions/files/test-helpers.js +28 -0
  157. package/dist/functions/files/test-helpers.js.map +1 -1
  158. package/dist/functions/generate/files/generate-code.d.ts +1 -1
  159. package/dist/functions/generate/files/generate-files.d.ts +7 -1
  160. package/dist/functions/generate/files/generate-files.js +63 -15
  161. package/dist/functions/generate/files/generate-files.js.map +1 -1
  162. package/dist/functions/generate/files/workflow-presets.d.ts +6 -0
  163. package/dist/functions/generate/files/workflow-presets.js +158 -0
  164. package/dist/functions/generate/files/workflow-presets.js.map +1 -0
  165. package/dist/functions/generate/model-from-data/generate-model-from-data.js +11 -5
  166. package/dist/functions/generate/model-from-data/generate-model-from-data.js.map +1 -1
  167. package/dist/functions/generate/model-from-data/infer-key.js +1 -4
  168. package/dist/functions/generate/model-from-data/infer-key.js.map +1 -1
  169. package/dist/functions/generate/model-from-data/infer-to-model.js +6 -3
  170. package/dist/functions/generate/model-from-data/infer-to-model.js.map +1 -1
  171. package/dist/functions/generate/projects/generate-project.d.ts +5 -0
  172. package/dist/functions/generate/projects/generate-project.js +29 -8
  173. package/dist/functions/generate/projects/generate-project.js.map +1 -1
  174. package/dist/functions/helper/api-client.d.ts +3 -0
  175. package/dist/functions/helper/api-client.js +19 -17
  176. package/dist/functions/helper/api-client.js.map +1 -1
  177. package/dist/functions/helper/config.helper.d.ts +1 -0
  178. package/dist/functions/helper/config.helper.js.map +1 -1
  179. package/dist/functions/helper/credentials.helper.d.ts +21 -0
  180. package/dist/functions/helper/credentials.helper.js +39 -0
  181. package/dist/functions/helper/credentials.helper.js.map +1 -0
  182. package/dist/functions/helper/load-env.d.ts +1 -0
  183. package/dist/functions/helper/load-env.js +10 -0
  184. package/dist/functions/helper/load-env.js.map +1 -0
  185. package/dist/functions/helper/output.d.ts +1 -1
  186. package/dist/functions/helper/output.js +10 -12
  187. package/dist/functions/helper/output.js.map +1 -1
  188. package/dist/functions/helper/parse-fail.js +4 -1
  189. package/dist/functions/helper/parse-fail.js.map +1 -1
  190. package/dist/functions/schemas/command.js.map +1 -1
  191. package/dist/functions/schemas/examples/AppLoaderConfiguration.example.json +1 -3
  192. package/dist/functions/schemas/examples/AttributeQualityConfig.example.json +10 -0
  193. package/dist/functions/schemas/examples/DataMapperStepConfig.example.json +6 -1
  194. package/dist/functions/schemas/examples/ModelDefinition.example.json +29 -3
  195. package/dist/functions/schemas/examples/ScriptStepConfig.example.json +3 -1
  196. package/dist/functions/schemas/examples/TemplateV3.example.json +5 -1
  197. package/dist/functions/schemas/extract.js +1 -1
  198. package/dist/functions/schemas/extract.js.map +1 -1
  199. package/dist/functions/schemas/format.js +4 -4
  200. package/dist/functions/schemas/format.js.map +1 -1
  201. package/dist/functions/schemas/registry.d.ts +14 -0
  202. package/dist/functions/schemas/registry.js +122 -30
  203. package/dist/functions/schemas/registry.js.map +1 -1
  204. package/dist/functions/schemas/resolve.js +1 -2
  205. package/dist/functions/schemas/resolve.js.map +1 -1
  206. package/dist/functions/schemas/validate.d.ts +22 -0
  207. package/dist/functions/schemas/validate.js +67 -0
  208. package/dist/functions/schemas/validate.js.map +1 -0
  209. package/dist/functions/serve/commands/list.js +2 -1
  210. package/dist/functions/serve/commands/list.js.map +1 -1
  211. package/dist/functions/serve/commands/stop.js +10 -5
  212. package/dist/functions/serve/commands/stop.js.map +1 -1
  213. package/dist/functions/serve/dev-server/dev-server-access.guard.d.ts +11 -0
  214. package/dist/functions/serve/dev-server/dev-server-access.guard.js +41 -0
  215. package/dist/functions/serve/dev-server/dev-server-access.guard.js.map +1 -0
  216. package/dist/functions/serve/dev-server/dev-server.controller.d.ts +3 -0
  217. package/dist/functions/serve/dev-server/dev-server.controller.js +20 -0
  218. package/dist/functions/serve/dev-server/dev-server.controller.js.map +1 -1
  219. package/dist/functions/serve/dev-server/dev-server.module.d.ts +3 -0
  220. package/dist/functions/serve/dev-server/dev-server.module.js +34 -23
  221. package/dist/functions/serve/dev-server/dev-server.module.js.map +1 -1
  222. package/dist/functions/serve/dev-server/dev-server.options.d.ts +8 -0
  223. package/dist/functions/serve/dev-server/dev-server.options.js +5 -0
  224. package/dist/functions/serve/dev-server/dev-server.options.js.map +1 -0
  225. package/dist/functions/serve/dev-server/dev-server.service.d.ts +11 -3
  226. package/dist/functions/serve/dev-server/dev-server.service.js +72 -65
  227. package/dist/functions/serve/dev-server/dev-server.service.js.map +1 -1
  228. package/dist/functions/serve/dev-server/path-scope.d.ts +5 -0
  229. package/dist/functions/serve/dev-server/path-scope.js +88 -0
  230. package/dist/functions/serve/dev-server/path-scope.js.map +1 -0
  231. package/dist/functions/serve/dev-server/request-security.d.ts +34 -0
  232. package/dist/functions/serve/dev-server/request-security.js +145 -0
  233. package/dist/functions/serve/dev-server/request-security.js.map +1 -0
  234. package/dist/functions/serve/main.d.ts +13 -0
  235. package/dist/functions/serve/main.js +90 -17
  236. package/dist/functions/serve/main.js.map +1 -1
  237. package/dist/functions/serve/serve-self-register.js +2 -1
  238. package/dist/functions/serve/serve-self-register.js.map +1 -1
  239. package/dist/functions/version/command.d.ts +12 -1
  240. package/dist/functions/version/command.js +55 -7
  241. package/dist/functions/version/command.js.map +1 -1
  242. package/dist/functions/workflow/commands/deploy.d.ts +9 -1
  243. package/dist/functions/workflow/commands/deploy.js +39 -10
  244. package/dist/functions/workflow/commands/deploy.js.map +1 -1
  245. package/dist/functions/workflow/commands/get.js.map +1 -1
  246. package/dist/functions/workflow/commands/history.js.map +1 -1
  247. package/dist/functions/workflow/commands/run.d.ts +26 -0
  248. package/dist/functions/workflow/commands/run.js +101 -0
  249. package/dist/functions/workflow/commands/run.js.map +1 -0
  250. package/dist/functions/workflow/commands/runners-get.js.map +1 -1
  251. package/dist/functions/workflow/commands/runners.d.ts +2 -0
  252. package/dist/functions/workflow/commands/runners.js +10 -1
  253. package/dist/functions/workflow/commands/runners.js.map +1 -1
  254. package/dist/functions/workflow/commands/status.d.ts +1 -1
  255. package/dist/functions/workflow/commands/status.js +7 -1
  256. package/dist/functions/workflow/commands/status.js.map +1 -1
  257. package/dist/functions/workflow/commands/template.js.map +1 -1
  258. package/dist/functions/workflow/commands/test.d.ts +3 -0
  259. package/dist/functions/workflow/commands/test.js +22 -73
  260. package/dist/functions/workflow/commands/test.js.map +1 -1
  261. package/dist/functions/workflow/commands/trace.d.ts +4 -2
  262. package/dist/functions/workflow/commands/trace.js +22 -1
  263. package/dist/functions/workflow/commands/trace.js.map +1 -1
  264. package/dist/functions/workflow/commands/undeploy.js +3 -1
  265. package/dist/functions/workflow/commands/undeploy.js.map +1 -1
  266. package/dist/functions/workflow/commands/validate.d.ts +2 -0
  267. package/dist/functions/workflow/commands/validate.js +16 -2
  268. package/dist/functions/workflow/commands/validate.js.map +1 -1
  269. package/dist/functions/workflow/resolve-runner.d.ts +17 -0
  270. package/dist/functions/workflow/resolve-runner.js +41 -0
  271. package/dist/functions/workflow/resolve-runner.js.map +1 -0
  272. package/dist/functions/workflow/run-failure.d.ts +11 -0
  273. package/dist/functions/workflow/run-failure.js +74 -0
  274. package/dist/functions/workflow/run-failure.js.map +1 -0
  275. package/dist/functions/workflow/runner-health.d.ts +16 -0
  276. package/dist/functions/workflow/runner-health.js +36 -0
  277. package/dist/functions/workflow/runner-health.js.map +1 -0
  278. package/dist/functions/workflow/script-lint.d.ts +10 -0
  279. package/dist/functions/workflow/script-lint.js +513 -0
  280. package/dist/functions/workflow/script-lint.js.map +1 -0
  281. package/dist/functions/workflow/template-io.js +1 -1
  282. package/dist/functions/workflow/template-io.js.map +1 -1
  283. package/dist/functions/workflow/trace.js.map +1 -1
  284. package/dist/functions/workflow/types.d.ts +11 -2
  285. package/dist/functions/workflow/types.js +4 -0
  286. package/dist/functions/workflow/types.js.map +1 -1
  287. package/dist/functions/workflow/validate.js +4 -1
  288. package/dist/functions/workflow/validate.js.map +1 -1
  289. package/dist/functions/workflow/wait-for-swap.d.ts +24 -1
  290. package/dist/functions/workflow/wait-for-swap.js +58 -0
  291. package/dist/functions/workflow/wait-for-swap.js.map +1 -1
  292. package/dist/functions/workflow/workflow-api.js +3 -1
  293. package/dist/functions/workflow/workflow-api.js.map +1 -1
  294. package/dist/index.js +6 -3
  295. package/dist/index.js.map +1 -1
  296. package/files/common/.env.example +4 -0
  297. package/files/common/_gitignore +3 -1
  298. package/files/dev-server/index.html +2 -1
  299. package/package.json +45 -42
  300. package/dist/functions/serve/guards/apiKey.guard.d.ts +0 -4
  301. package/dist/functions/serve/guards/apiKey.guard.js +0 -23
  302. package/dist/functions/serve/guards/apiKey.guard.js.map +0 -1
package/dist/cli.js CHANGED
@@ -7,6 +7,7 @@ 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");
10
11
  const command_js_2 = require("./functions/version/command.js");
11
12
  const init_options_js_1 = require("./functions/app/daemon/services/init-options.js");
12
13
  function parseAutoServePort(raw) {
@@ -21,9 +22,14 @@ function parseAutoServePort(raw) {
21
22
  }
22
23
  return n;
23
24
  }
25
+ const CDN_BASE_URL_DESCRIBE = 'CDN base url for the remote source. Default: derived from consoleApiUrl in dcupl.config.json' +
26
+ ' (api.dcupl.com → cdn.dcupl.com, api.dev.dcupl.com → cdn.dev.dcupl.com), else the prod CDN;' +
27
+ ' also DCUPL_CDN_BASE_URL env or `cdnBaseUrl` in dcupl.config.json. Overrides the workspace consoleApiUrl' +
28
+ ' even with an explicit --project-id. api-key + cache-busting only apply to dcupl CDN hosts (cdn*.dcupl.com, cdn.dev.dcupl.com);' +
29
+ ' see docs/flows/workflow-app-remote.md';
24
30
  function buildCli(rawArgs) {
25
31
  const instance = (0, yargs_1.default)(rawArgs);
26
- return instance
32
+ return (instance
27
33
  .version(false)
28
34
  .locale('en')
29
35
  .strict()
@@ -53,7 +59,7 @@ function buildCli(rawArgs) {
53
59
  })
54
60
  .option('project-id', {
55
61
  type: 'string',
56
- describe: 'Console project ID (required with --starter existing)',
62
+ describe: 'Console project ID (implies --starter existing when --starter is omitted)',
57
63
  })
58
64
  .option('api-key', {
59
65
  type: 'string',
@@ -86,13 +92,25 @@ function buildCli(rawArgs) {
86
92
  const output = (0, output_1.createOutput)(!!argv.json);
87
93
  await serveListCommand(output);
88
94
  })
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) => {
95
+ .command('stop', 'Stop a running serve by port', (a) => a.option('port', {
96
+ type: 'number',
97
+ demandOption: true,
98
+ default: undefined,
99
+ describe: 'Port of the serve to stop',
100
+ }), async (argv) => {
91
101
  const { serveStopCommand } = await import('./functions/serve/commands/stop.js');
92
102
  const output = (0, output_1.createOutput)(!!argv.json);
93
103
  await serveStopCommand(output, { port: argv.port });
94
104
  })
95
105
  .option('port', { default: '8083' })
106
+ .option('host', {
107
+ type: 'string',
108
+ 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.',
109
+ })
110
+ .option('allow-origin', {
111
+ type: 'string',
112
+ 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.',
113
+ })
96
114
  .option('open-browser', {
97
115
  type: 'boolean',
98
116
  describe: 'Open the welcome screen in a browser on start. Overrides openBrowser in dcupl.config.json.',
@@ -122,17 +140,38 @@ function buildCli(rawArgs) {
122
140
  'test-setup',
123
141
  'test',
124
142
  'test-config',
143
+ 'workflow',
125
144
  ],
126
145
  })
127
- .option('name', { describe: 'Name for model generation', type: 'string' })
146
+ .option('name', {
147
+ describe: 'Name for model generation, or the workflow key for `generate workflow`',
148
+ type: 'string',
149
+ })
128
150
  .option('file-name', { describe: 'File name for generation', type: 'string' })
129
151
  .option('operator', { describe: 'Operator name for operator generation', type: 'string' })
152
+ .option('template', {
153
+ describe: `Workflow preset (used by \`generate workflow\`, default: ${workflow_presets_js_1.WORKFLOW_PRESETS[0]})`,
154
+ type: 'string',
155
+ choices: workflow_presets_js_1.WORKFLOW_PRESETS,
156
+ })
130
157
  .option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
131
158
  .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' });
159
+ .option('register', {
160
+ describe: 'Register the generated model + data resource in dcupl.lc.json',
161
+ type: 'boolean',
162
+ })
163
+ .option('sample-size', {
164
+ describe: 'Max rows to scan when inferring types from --from',
165
+ type: 'number',
166
+ })
167
+ .option('key-property', {
168
+ describe: 'Override inferred keyProperty for --from. Comma-separate for a composite key (a,b,c). Skips inference + prompts.',
169
+ type: 'string',
170
+ })
171
+ .option('dry-run', {
172
+ describe: 'Preview the proposed model + lc.json additions without writing.',
173
+ type: 'boolean',
174
+ });
136
175
  }, async (argv) => {
137
176
  const { generateFn } = await import('./functions/generate/files/generate-files.js');
138
177
  generateFn(argv);
@@ -144,19 +183,56 @@ function buildCli(rawArgs) {
144
183
  (0, command_js_1.schemasListCommand)(argv, output);
145
184
  })
146
185
  .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 })
186
+ .positional('name', {
187
+ type: 'string',
188
+ describe: 'Schema name (see `dcupl schemas list`)',
189
+ demandOption: true,
190
+ })
148
191
  .option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
149
192
  const output = (0, output_1.createOutput)(argv.json);
150
193
  (0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
194
+ })
195
+ .command('validate <file>', 'Validate a JSON file against a registry schema (Zod-kind, e.g. TemplateV3)', (args) => args
196
+ .positional('file', {
197
+ type: 'string',
198
+ describe: 'Path to the JSON file to validate',
199
+ demandOption: true,
200
+ })
201
+ .option('against', {
202
+ type: 'string',
203
+ demandOption: true,
204
+ describe: 'Schema name to validate against (see `dcupl schemas list` — [Zod] entries only)',
205
+ }), async (argv) => {
206
+ const output = (0, output_1.createOutput)(argv.json);
207
+ try {
208
+ const { schemasValidateCommand } = await import('./functions/schemas/validate.js');
209
+ const valid = await schemasValidateCommand({ file: argv.file, against: argv.against, json: argv.json }, output);
210
+ if (!valid)
211
+ process.exitCode = 1;
212
+ }
213
+ catch (err) {
214
+ output.error(err.message, err.code || 'SCHEMA_VALIDATE_FAILED');
215
+ }
151
216
  })
152
217
  .demandCommand(1);
153
218
  }, () => { })
154
219
  .command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
155
220
  return yy
156
221
  .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) => {
222
+ .option('file', {
223
+ type: 'string',
224
+ demandOption: true,
225
+ describe: 'Path to a local *.workflow-v3.json template',
226
+ })
227
+ .option('runner', {
228
+ type: 'string',
229
+ describe: 'Runner uid or runnerKey for remote validation (feature limits, cycles, expressions)',
230
+ })
231
+ .option('local-only', {
232
+ type: 'boolean',
233
+ default: false,
234
+ describe: 'Skip remote validation even if --runner is set',
235
+ }), async (argv) => {
160
236
  const { validateCommand } = await import('./functions/workflow/commands/validate.js');
161
237
  const output = (0, output_1.createOutput)(!!argv.json);
162
238
  try {
@@ -165,7 +241,11 @@ function buildCli(rawArgs) {
165
241
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
166
242
  deps.client = mkClient();
167
243
  }
168
- await validateCommand(output, { file: argv.file, runner: argv.runner, localOnly: !!argv['local-only'] }, deps);
244
+ await validateCommand(output, {
245
+ file: argv.file,
246
+ runner: argv.runner,
247
+ localOnly: !!argv['local-only'],
248
+ }, deps);
169
249
  }
170
250
  catch (err) {
171
251
  output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
@@ -228,20 +308,29 @@ function buildCli(rawArgs) {
228
308
  })
229
309
  .command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
230
310
  .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) => {
311
+ .option('run', { type: 'string', describe: 'Execution runId (from `workflow history`)' })
312
+ .option('last', {
313
+ type: 'boolean',
314
+ default: false,
315
+ describe: 'Trace the most recent run instead of naming one with --run',
316
+ }), async (argv) => {
232
317
  const { traceCommand } = await import('./functions/workflow/commands/trace.js');
233
318
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
234
319
  const output = (0, output_1.createOutput)(!!argv.json);
235
320
  try {
236
- await traceCommand(output, mkClient(), { id: argv.id, run: argv.run });
321
+ await traceCommand(output, mkClient(), {
322
+ id: argv.id,
323
+ run: argv.run,
324
+ last: !!argv.last,
325
+ });
237
326
  }
238
327
  catch (err) {
239
328
  output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
240
329
  }
241
330
  })
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) => {
331
+ .command('runners [subcommand]', 'Inspect the runners available to this project.', (rr) => {
332
+ return (rr
333
+ .command(['list', '$0'], 'List the runners available to this project (uid / key / type / url / health).', () => { }, async (argv) => {
245
334
  const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
246
335
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
247
336
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -262,44 +351,133 @@ function buildCli(rawArgs) {
262
351
  catch (err) {
263
352
  output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
264
353
  }
265
- })
266
- .demandCommand(1);
354
+ }));
267
355
  }, () => { })
268
356
  .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)' })
357
+ .option('file', {
358
+ type: 'string',
359
+ demandOption: true,
360
+ describe: 'Path to a local *.workflow-v3.json template',
361
+ })
362
+ .option('runner', {
363
+ type: 'string',
364
+ demandOption: true,
365
+ describe: 'Runner uid or runnerKey to deploy+run against (use a dev/test runner)',
366
+ })
271
367
  .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' })
368
+ .option('input', {
369
+ type: 'string',
370
+ describe: 'Path to a JSON file: test-node inputData, or full-run request body',
371
+ })
273
372
  .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) => {
373
+ .option('trigger-key', {
374
+ type: 'string',
375
+ describe: 'api-key to pass to the runner if the trigger requires auth',
376
+ })
377
+ .option('wait', {
378
+ type: 'boolean',
379
+ default: true,
380
+ describe: 'Wait for the runner to hot-swap before triggering (--no-wait to skip)',
381
+ })
382
+ .option('swap-timeout', {
383
+ type: 'number',
384
+ describe: 'Max ms to wait for swap confirmation (default 30000)',
385
+ }), async (argv) => {
277
386
  const { testCommand } = await import('./functions/workflow/commands/test.js');
278
387
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
279
388
  const output = (0, output_1.createOutput)(!!argv.json);
280
389
  try {
281
390
  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'],
391
+ file: argv.file,
392
+ runner: argv.runner,
393
+ node: argv.node,
394
+ input: argv.input,
395
+ state: argv.state,
396
+ triggerKey: argv['trigger-key'],
397
+ wait: argv.wait,
398
+ swapTimeout: argv['swap-timeout'],
286
399
  });
287
400
  }
288
401
  catch (err) {
289
402
  output.error(err.message, err.code || 'WORKFLOW_TEST_FAILED');
290
403
  }
404
+ })
405
+ .command('run <key>', 'Trigger an already-deployed workflow (no redeploy): --node for one node, otherwise a full run.', (a) => a
406
+ .positional('key', {
407
+ type: 'string',
408
+ demandOption: true,
409
+ describe: 'Deployed workflow key (as shown by `workflow list`; the bare template key also works)',
410
+ })
411
+ .option('runner', {
412
+ type: 'string',
413
+ demandOption: true,
414
+ describe: 'Runner uid or runnerKey the workflow is deployed on',
415
+ })
416
+ .option('body', {
417
+ type: 'string',
418
+ describe: 'Inline JSON: test-node inputData, or full-run request body (mutually exclusive with --input)',
419
+ })
420
+ .option('input', {
421
+ type: 'string',
422
+ describe: 'Path to a JSON file: test-node inputData, or full-run request body',
423
+ })
424
+ .option('node', {
425
+ type: 'string',
426
+ describe: 'Run a single node of the deployed workflow by id (uses test-node)',
427
+ })
428
+ .option('trigger-key', {
429
+ type: 'string',
430
+ describe: 'api-key to pass to the runner if the trigger requires auth',
431
+ }), async (argv) => {
432
+ const { runCommand } = await import('./functions/workflow/commands/run.js');
433
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
434
+ const output = (0, output_1.createOutput)(!!argv.json);
435
+ try {
436
+ await runCommand(output, mkClient(), {
437
+ key: argv.key,
438
+ runner: argv.runner,
439
+ body: argv.body,
440
+ input: argv.input,
441
+ node: argv.node,
442
+ triggerKey: argv['trigger-key'],
443
+ });
444
+ }
445
+ catch (err) {
446
+ output.error(err.message, err.code || 'WORKFLOW_RUN_FAILED');
447
+ }
291
448
  })
292
449
  .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' })
450
+ .option('file', {
451
+ type: 'string',
452
+ demandOption: true,
453
+ describe: 'Path to a local *.workflow-v3.json template',
454
+ })
455
+ .option('runner', {
456
+ type: 'string',
457
+ demandOption: true,
458
+ describe: 'Runner uid or runnerKey to deploy to',
459
+ })
295
460
  .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) => {
461
+ .option('wait', {
462
+ type: 'boolean',
463
+ default: true,
464
+ describe: 'Wait for the runner to hot-swap to this version before returning (--no-wait to skip)',
465
+ })
466
+ .option('swap-timeout', {
467
+ type: 'number',
468
+ describe: 'Max ms to wait for swap confirmation (default 30000)',
469
+ }), async (argv) => {
298
470
  const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
299
471
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
300
472
  const output = (0, output_1.createOutput)(!!argv.json);
301
473
  try {
302
- await deployCommand(output, mkClient(), { file: argv.file, runner: argv.runner, yes: !!argv.yes, wait: argv.wait, swapTimeout: argv['swap-timeout'] });
474
+ await deployCommand(output, mkClient(), {
475
+ file: argv.file,
476
+ runner: argv.runner,
477
+ yes: !!argv.yes,
478
+ wait: argv.wait,
479
+ swapTimeout: argv['swap-timeout'],
480
+ });
303
481
  }
304
482
  catch (err) {
305
483
  output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
@@ -307,7 +485,11 @@ function buildCli(rawArgs) {
307
485
  })
308
486
  .command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
309
487
  .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) => {
488
+ .option('yes', {
489
+ type: 'boolean',
490
+ default: false,
491
+ describe: 'Skip the confirmation prompt (for CI)',
492
+ }), async (argv) => {
311
493
  const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
312
494
  const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
313
495
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -361,13 +543,29 @@ function buildCli(rawArgs) {
361
543
  describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
362
544
  })
363
545
  .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.' })
546
+ .option('strict', {
547
+ type: 'boolean',
548
+ default: false,
549
+ describe: 'Delete server files no longer present locally. Default (additive) never deletes on the server.',
550
+ })
551
+ .option('yes', {
552
+ type: 'boolean',
553
+ default: false,
554
+ describe: 'Skip the deletion confirmation prompt (for CI).',
555
+ })
556
+ .option('force', {
557
+ type: 'boolean',
558
+ default: false,
559
+ describe: 'Resolve conflicts by uploading the local copy.',
560
+ })
367
561
  .option('path', {
368
562
  type: 'array',
369
563
  string: true,
370
564
  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',
565
+ })
566
+ .option('concurrency', {
567
+ type: 'number',
568
+ describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
371
569
  }), async (argv) => {
372
570
  const { pushCommand } = await import('./functions/files/commands/push.js');
373
571
  const { createApiClient } = await import('./functions/helper/api-client.js');
@@ -386,6 +584,9 @@ function buildCli(rawArgs) {
386
584
  yes: argv.yes,
387
585
  force: argv.force,
388
586
  paths: argv.path,
587
+ concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
588
+ ? Math.floor(argv.concurrency)
589
+ : undefined,
389
590
  });
390
591
  }
391
592
  catch (err) {
@@ -399,13 +600,33 @@ function buildCli(rawArgs) {
399
600
  describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
400
601
  })
401
602
  .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.' })
603
+ .option('strict', {
604
+ type: 'boolean',
605
+ default: false,
606
+ describe: 'Delete local files no longer present on the server. Default (additive) never deletes locally.',
607
+ })
608
+ .option('yes', {
609
+ type: 'boolean',
610
+ default: false,
611
+ describe: 'Skip the deletion confirmation prompt (for CI).',
612
+ })
613
+ .option('force', {
614
+ type: 'boolean',
615
+ default: false,
616
+ describe: 'Resolve conflicts by overwriting local with server. Also overrides the dirty-workspace switch refusal.',
617
+ })
405
618
  .option('path', {
406
619
  type: 'array',
407
620
  string: true,
408
621
  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',
622
+ })
623
+ .option('dest', {
624
+ type: 'string',
625
+ 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/',
626
+ })
627
+ .option('concurrency', {
628
+ type: 'number',
629
+ describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
409
630
  }), async (argv) => {
410
631
  const { pullCommand } = await import('./functions/files/commands/pull.js');
411
632
  const { createApiClient } = await import('./functions/helper/api-client.js');
@@ -424,6 +645,10 @@ function buildCli(rawArgs) {
424
645
  yes: argv.yes,
425
646
  force: argv.force,
426
647
  paths: argv.path,
648
+ dest: argv.dest,
649
+ concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
650
+ ? Math.floor(argv.concurrency)
651
+ : undefined,
427
652
  });
428
653
  }
429
654
  catch (err) {
@@ -431,9 +656,17 @@ function buildCli(rawArgs) {
431
656
  }
432
657
  })
433
658
  .command('list', 'List files in a version', (a) => a
434
- .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' })
659
+ .option('version', {
660
+ alias: 'v',
661
+ type: 'string',
662
+ describe: 'Version id (defaults to HEAD, then "draft")',
663
+ })
435
664
  .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) => {
665
+ .option('tree', {
666
+ type: 'boolean',
667
+ default: false,
668
+ describe: 'Render a nested directory tree instead of a flat list. Ignored when --json is set.',
669
+ }), async (argv) => {
437
670
  const { listFilesCommand } = await import('./functions/files/commands/list.js');
438
671
  const { createApiClient } = await import('./functions/helper/api-client.js');
439
672
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -450,9 +683,11 @@ function buildCli(rawArgs) {
450
683
  output.error(err.error || err.message, err.code || 'LIST_FAILED');
451
684
  }
452
685
  })
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) => {
686
+ .command('read', 'Read a single file from a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'File path' }).option('version', {
687
+ alias: 'v',
688
+ type: 'string',
689
+ describe: 'Version id (defaults to HEAD, then "draft")',
690
+ }), async (argv) => {
456
691
  const { readFileCommand } = await import('./functions/files/commands/read.js');
457
692
  const { createApiClient } = await import('./functions/helper/api-client.js');
458
693
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -472,7 +707,11 @@ function buildCli(rawArgs) {
472
707
  .option('path', { type: 'string', demandOption: true, describe: 'File path' })
473
708
  .option('content', { type: 'string', describe: 'Inline content to write' })
474
709
  .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) => {
710
+ .option('version', {
711
+ alias: 'v',
712
+ type: 'string',
713
+ describe: 'Version id (defaults to HEAD, then "draft")',
714
+ }), async (argv) => {
476
715
  const { writeFileCommand } = await import('./functions/files/commands/write.js');
477
716
  const { createApiClient } = await import('./functions/helper/api-client.js');
478
717
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -492,9 +731,21 @@ function buildCli(rawArgs) {
492
731
  })
493
732
  .command('delete', 'Delete a single file from a version', (a) => a
494
733
  .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) => {
734
+ .option('version', {
735
+ alias: 'v',
736
+ type: 'string',
737
+ describe: 'Version id (defaults to HEAD, then "draft")',
738
+ })
739
+ .option('yes', {
740
+ type: 'boolean',
741
+ default: false,
742
+ describe: 'Skip the confirmation prompt (for CI).',
743
+ })
744
+ .option('dry-run', {
745
+ type: 'boolean',
746
+ default: false,
747
+ describe: 'Preview the delete without executing it.',
748
+ }), async (argv) => {
498
749
  const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
499
750
  const { createApiClient } = await import('./functions/helper/api-client.js');
500
751
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -515,9 +766,21 @@ function buildCli(rawArgs) {
515
766
  .command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
516
767
  .option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
517
768
  .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) => {
769
+ .option('version', {
770
+ alias: 'v',
771
+ type: 'string',
772
+ describe: 'Version id (defaults to HEAD, then "draft")',
773
+ })
774
+ .option('yes', {
775
+ type: 'boolean',
776
+ default: false,
777
+ describe: 'Skip the confirmation prompt (for CI).',
778
+ })
779
+ .option('dry-run', {
780
+ type: 'boolean',
781
+ default: false,
782
+ describe: 'Preview the move without executing it.',
783
+ }), async (argv) => {
521
784
  const { moveFileCommand } = await import('./functions/files/commands/move.js');
522
785
  const { createApiClient } = await import('./functions/helper/api-client.js');
523
786
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -539,7 +802,11 @@ function buildCli(rawArgs) {
539
802
  .command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
540
803
  .option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
541
804
  .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) => {
805
+ .option('version', {
806
+ alias: 'v',
807
+ type: 'string',
808
+ describe: 'Version id (defaults to HEAD, then "draft")',
809
+ }), async (argv) => {
543
810
  const { copyFileCommand } = await import('./functions/files/commands/copy.js');
544
811
  const { createApiClient } = await import('./functions/helper/api-client.js');
545
812
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -556,9 +823,11 @@ function buildCli(rawArgs) {
556
823
  output.error(err.error || err.message, err.code || 'COPY_FAILED');
557
824
  }
558
825
  })
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) => {
826
+ .command('create-folder', 'Create a folder in a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'Folder path' }).option('version', {
827
+ alias: 'v',
828
+ type: 'string',
829
+ describe: 'Version id (defaults to HEAD, then "draft")',
830
+ }), async (argv) => {
562
831
  const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
563
832
  const { createApiClient } = await import('./functions/helper/api-client.js');
564
833
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -588,10 +857,26 @@ function buildCli(rawArgs) {
588
857
  }
589
858
  })
590
859
  .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) => {
860
+ .option('from', {
861
+ type: 'string',
862
+ demandOption: true,
863
+ describe: 'Source version to copy files from',
864
+ })
865
+ .option('to', {
866
+ type: 'string',
867
+ demandOption: true,
868
+ describe: 'Target version id — created if new, otherwise its contents are replaced',
869
+ })
870
+ .option('yes', {
871
+ type: 'boolean',
872
+ default: false,
873
+ describe: 'Skip the confirmation prompt (for CI).',
874
+ })
875
+ .option('dry-run', {
876
+ type: 'boolean',
877
+ default: false,
878
+ describe: 'Preview the copy without executing it.',
879
+ }), async (argv) => {
595
880
  const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
596
881
  const { createApiClient } = await import('./functions/helper/api-client.js');
597
882
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -610,8 +895,16 @@ function buildCli(rawArgs) {
610
895
  })
611
896
  .command('delete <id>', 'Delete a version', (a) => a
612
897
  .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) => {
898
+ .option('yes', {
899
+ type: 'boolean',
900
+ default: false,
901
+ describe: 'Skip the confirmation prompt (for CI).',
902
+ })
903
+ .option('dry-run', {
904
+ type: 'boolean',
905
+ default: false,
906
+ describe: 'Preview the delete without executing it.',
907
+ }), async (argv) => {
615
908
  const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
616
909
  const { createApiClient } = await import('./functions/helper/api-client.js');
617
910
  const output = (0, output_1.createOutput)(!!argv.json);
@@ -634,8 +927,15 @@ function buildCli(rawArgs) {
634
927
  .command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
635
928
  .option('project-id', { type: 'string', describe: 'dcupl Console project id' })
636
929
  .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) => {
930
+ .option('console-api-url', {
931
+ type: 'string',
932
+ describe: 'Override console API URL (for self-hosted / internal dev; leave unset for default)',
933
+ })
934
+ .option('yes', {
935
+ type: 'boolean',
936
+ default: false,
937
+ describe: 'Non-interactive mode. Requires --project-id and --api-key (or existing values in the files).',
938
+ }), async (argv) => {
639
939
  const { configSetCommand } = await import('./functions/config/commands/set.js');
640
940
  try {
641
941
  await configSetCommand({
@@ -646,12 +946,14 @@ function buildCli(rawArgs) {
646
946
  });
647
947
  }
648
948
  catch (err) {
649
- console.error(err.message);
650
- process.exit(1);
949
+ (0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_SET_FAILED');
651
950
  }
652
951
  })
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) => {
952
+ .command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a.option('show-secrets', {
953
+ type: 'boolean',
954
+ default: false,
955
+ describe: 'Reveal apiKey instead of ***last4',
956
+ }), async (argv) => {
655
957
  const { configGetCommand } = await import('./functions/config/commands/get.js');
656
958
  try {
657
959
  await configGetCommand({
@@ -660,26 +962,51 @@ function buildCli(rawArgs) {
660
962
  });
661
963
  }
662
964
  catch (err) {
663
- console.error(err.message);
664
- process.exit(1);
965
+ (0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_GET_FAILED');
665
966
  }
666
967
  })
667
968
  .demandCommand(1);
668
969
  })
669
970
  .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)' })
971
+ .option('source', {
972
+ type: 'string',
973
+ choices: ['local', 'remote'],
974
+ describe: 'Project source (inferred when omitted)',
975
+ })
671
976
  .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.' })
977
+ .option('auto-serve', {
978
+ type: 'boolean',
979
+ describe: 'Auto-spawn dcupl serve for local source (default: on; throwaway, auto-cleaned). Use --no-auto-serve to opt out.',
980
+ })
673
981
  .option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
674
982
  .option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
675
983
  .option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
984
+ .option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
676
985
  .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)' })
986
+ .option('env', {
987
+ type: 'array',
988
+ string: true,
989
+ describe: 'Environment keys for the process step (repeatable)',
990
+ })
678
991
  .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) => {
992
+ .option('var', {
993
+ type: 'array',
994
+ string: true,
995
+ describe: 'Variables KEY=VALUE for the process step (repeatable)',
996
+ })
997
+ .option('limit', {
998
+ type: 'number',
999
+ default: 10,
1000
+ describe: 'Max error records in the report (top findings)',
1001
+ })
1002
+ .option('quality', {
1003
+ type: 'boolean',
1004
+ describe: 'Enable model & data quality checks incl. error tracking (default: true). Use --quality false for a structural-only load.',
1005
+ })
1006
+ .option('max-memory', {
1007
+ type: 'number',
1008
+ describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
1009
+ }), async (argv) => {
683
1010
  const { validateCommand } = await import('./functions/app/commands/validate.js');
684
1011
  const output = (0, output_1.createOutput)(argv.json);
685
1012
  try {
@@ -690,6 +1017,7 @@ function buildCli(rawArgs) {
690
1017
  projectId: argv['project-id'],
691
1018
  apiKey: argv['api-key'],
692
1019
  version: argv.version,
1020
+ cdnBaseUrl: argv['cdn-base-url'],
693
1021
  appKey: argv['app-key'],
694
1022
  env: argv.env,
695
1023
  tag: argv.tag,
@@ -704,40 +1032,123 @@ function buildCli(rawArgs) {
704
1032
  }
705
1033
  })
706
1034
  .command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
707
- return yy
1035
+ return (yy
708
1036
  .command('create', 'Start a new daemon and register an app', (a) => a
709
1037
  .option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
710
1038
  .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.' })
1039
+ .option('auto-update', {
1040
+ type: 'boolean',
1041
+ default: false,
1042
+ describe: 'Auto-run update() after every mutation. Default (off): mutations stage changes, run `dcupl app build` to apply (mirrors the SDK).',
1043
+ })
1044
+ .option('auto-generate-properties', {
1045
+ type: 'boolean',
1046
+ default: false,
1047
+ describe: 'Infer model schema from the data on first ingest. Daemon-wide default; override per call on `app data <verb>`.',
1048
+ })
1049
+ .option('auto-generate-deep', {
1050
+ type: 'boolean',
1051
+ default: false,
1052
+ describe: 'When inferring model schema, walk every row and reconcile types (handles row-1 blanks). Implies --auto-generate-properties.',
1053
+ })
1054
+ .option('auto-generate-sample-size', {
1055
+ type: 'number',
1056
+ describe: 'When inferring model schema, sample at most N rows (implies deep). Useful for large CSVs where row 1 may not represent the schema.',
1057
+ })
1058
+ .option('quality', {
1059
+ type: 'boolean',
1060
+ describe: 'Enable model & data quality checks (default: true). Use `--quality false` to opt out.',
1061
+ })
716
1062
  .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)' })
1063
+ .option('clone', {
1064
+ type: 'boolean',
1065
+ describe: 'Enable deep data clones to avoid mutation side-effects (default: false)',
1066
+ })
1067
+ .option('analytics', {
1068
+ type: 'boolean',
1069
+ describe: 'Enable analytics instrumentation (default: true)',
1070
+ })
1071
+ .option('reference-metadata', {
1072
+ type: 'boolean',
1073
+ describe: 'Enable reference metadata resolution (default: true)',
1074
+ })
720
1075
  .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' })
1076
+ .option('logging-format', {
1077
+ type: 'string',
1078
+ choices: [...init_options_js_1.LOG_FORMATS],
1079
+ describe: 'SDK log output format',
1080
+ })
1081
+ .option('max-memory', {
1082
+ type: 'number',
1083
+ describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
1084
+ })
1085
+ .option('max-body', {
1086
+ type: 'string',
1087
+ default: '2gb',
1088
+ describe: 'Max request body size, e.g. 2gb, 500mb',
1089
+ })
1090
+ .option('load', {
1091
+ type: 'boolean',
1092
+ describe: 'After creating the daemon, register, process, and build a loader so the app is immediately queryable',
1093
+ })
725
1094
  .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)' })
1095
+ .option('source', {
1096
+ type: 'string',
1097
+ choices: ['local', 'remote', 'url'],
1098
+ describe: 'Loader source for --load (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
1099
+ })
1100
+ .option('workspace', {
1101
+ type: 'boolean',
1102
+ describe: 'Use local dcupl workspace as loader source (--load)',
1103
+ })
1104
+ .option('project-id', {
1105
+ type: 'string',
1106
+ describe: 'dcupl Console project id (cdn loader source, --load). CDN host: see --cdn-base-url',
1107
+ })
729
1108
  .option('api-key', { type: 'string', describe: 'Console API key (--load)' })
730
- .option('version', { type: 'string', describe: 'Console version id (cdn loader source, default: draft)' })
1109
+ .option('version', {
1110
+ type: 'string',
1111
+ describe: 'Console version id (cdn loader source, default: draft)',
1112
+ })
1113
+ .option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
731
1114
  .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)' })
1115
+ .option('loader-file', {
1116
+ type: 'string',
1117
+ describe: 'Loader file name for base-url source (--load)',
1118
+ })
1119
+ .option('header', {
1120
+ type: 'array',
1121
+ string: true,
1122
+ describe: 'HTTP headers for base-url source KEY=VALUE (repeatable, --load)',
1123
+ })
1124
+ .option('lc-json', {
1125
+ type: 'string',
1126
+ describe: 'Path to loader config file (workspace source, --load)',
1127
+ })
1128
+ .option('auto-serve', {
1129
+ type: 'boolean',
1130
+ describe: 'Auto-spawn dcupl serve if not running (workspace source, --load)',
1131
+ })
1132
+ .option('auto-serve-port', {
1133
+ type: 'string',
1134
+ describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned (--load)',
1135
+ })
737
1136
  .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) => {
1137
+ .option('env', {
1138
+ type: 'array',
1139
+ string: true,
1140
+ describe: 'Environment keys for process step (repeatable, --load)',
1141
+ })
1142
+ .option('tag', {
1143
+ type: 'array',
1144
+ string: true,
1145
+ describe: 'Resource tags for process step (repeatable, comma-separate for AND, --load)',
1146
+ })
1147
+ .option('var', {
1148
+ type: 'array',
1149
+ string: true,
1150
+ describe: 'Variables KEY=VALUE for process step (repeatable, --load)',
1151
+ }), async (argv) => {
741
1152
  const { createCommand } = await import('./functions/app/commands/create.js');
742
1153
  const output = (0, output_1.createOutput)(argv.json);
743
1154
  try {
@@ -765,6 +1176,7 @@ function buildCli(rawArgs) {
765
1176
  projectId: argv['project-id'],
766
1177
  apiKey: argv['api-key'],
767
1178
  version: argv.version,
1179
+ cdnBaseUrl: argv['cdn-base-url'],
768
1180
  baseUrl: argv['base-url'],
769
1181
  loaderFile: argv['loader-file'],
770
1182
  header: argv.header,
@@ -781,12 +1193,14 @@ function buildCli(rawArgs) {
781
1193
  });
782
1194
  }
783
1195
  catch (err) {
784
- output.error(err.message, err.code || 'CREATE_FAILED');
1196
+ output.error(err.message, err.code || 'CREATE_FAILED', err.details === undefined ? undefined : { details: err.details });
785
1197
  }
786
1198
  })
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) => {
1199
+ .command('destroy', 'Stop a daemon', (a) => a.option('app', { type: 'string' }).option('keep-logs', {
1200
+ type: 'boolean',
1201
+ default: false,
1202
+ describe: 'Keep the daemon log file after destroy',
1203
+ }), async (argv) => {
790
1204
  const { destroyCommand } = await import('./functions/app/commands/destroy.js');
791
1205
  const output = (0, output_1.createOutput)(argv.json);
792
1206
  try {
@@ -862,12 +1276,17 @@ function buildCli(rawArgs) {
862
1276
  .command('set', 'Set a model from a JSON file or inline content', (a) => a
863
1277
  .option('app', { type: 'string' })
864
1278
  .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) => {
1279
+ .option('content', {
1280
+ type: 'string',
1281
+ describe: 'Inline JSON model definition (use "-" to read from stdin)',
1282
+ }), async (argv) => {
866
1283
  const { setCommand } = await import('./functions/app/commands/models/set.js');
867
1284
  const output = (0, output_1.createOutput)(argv.json);
868
1285
  try {
869
1286
  const content = argv.content !== undefined
870
- ? (argv.content === '' && argv._.includes('-') ? '-' : argv.content)
1287
+ ? argv.content === '' && argv._.includes('-')
1288
+ ? '-'
1289
+ : argv.content
871
1290
  : undefined;
872
1291
  await setCommand(output, { appId: argv.app, file: argv.file, content });
873
1292
  }
@@ -889,26 +1308,46 @@ function buildCli(rawArgs) {
889
1308
  .command('data <verb>', 'Ingest data', (yyy) => {
890
1309
  const dataOpts = (a) => a
891
1310
  .option('app', { type: 'string' })
892
- .option('file', { type: 'string', describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest' })
1311
+ .option('file', {
1312
+ type: 'string',
1313
+ describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest',
1314
+ })
893
1315
  .option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
894
1316
  .option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
895
1317
  .option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
896
1318
  .option('model', { type: 'string', demandOption: true })
897
1319
  .option('key-property', { type: 'string' })
898
1320
  .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)' });
1321
+ .option('auto-generate-properties', {
1322
+ type: 'boolean',
1323
+ describe: 'Override daemon default for this call (use --no-auto-generate-properties to force off)',
1324
+ })
1325
+ .option('auto-generate-deep', {
1326
+ type: 'boolean',
1327
+ describe: 'Walk every row when inferring (implies --auto-generate-properties)',
1328
+ })
1329
+ .option('auto-generate-sample-size', {
1330
+ type: 'number',
1331
+ describe: 'Sample N rows when inferring (implies deep)',
1332
+ });
902
1333
  const handler = (mod, exportName, code) => async (argv) => {
903
1334
  const m = await import(`./functions/app/commands/data/${mod}.js`);
904
1335
  const output = (0, output_1.createOutput)(argv.json);
905
1336
  try {
906
1337
  const content = argv.content !== undefined
907
- ? (argv.content === '' && argv._.includes('-') ? '-' : argv.content)
1338
+ ? argv.content === '' && argv._.includes('-')
1339
+ ? '-'
1340
+ : argv.content
908
1341
  : undefined;
909
1342
  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,
1343
+ appId: argv.app,
1344
+ file: argv.file,
1345
+ url: argv.url,
1346
+ content,
1347
+ format: argv.format,
1348
+ model: argv.model,
1349
+ keyProperty: argv.keyProperty,
1350
+ autoGenerateKey: argv.autoGenerateKey,
912
1351
  autoGenerateProperties: argv.autoGenerateProperties,
913
1352
  autoGenerateDeep: argv.autoGenerateDeep,
914
1353
  autoGenerateSampleSize: argv.autoGenerateSampleSize,
@@ -936,7 +1375,10 @@ function buildCli(rawArgs) {
936
1375
  .demandCommand(1);
937
1376
  })
938
1377
  .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) => {
1378
+ .command('one', 'Fetch single record', (a) => a
1379
+ .option('app', { type: 'string' })
1380
+ .option('model', { type: 'string', demandOption: true })
1381
+ .option('item-key', { type: 'string', demandOption: true }), async (argv) => {
940
1382
  const { oneCommand } = await import('./functions/app/commands/query/one.js');
941
1383
  const output = (0, output_1.createOutput)(argv.json);
942
1384
  try {
@@ -959,9 +1401,13 @@ function buildCli(rawArgs) {
959
1401
  const output = (0, output_1.createOutput)(argv.json);
960
1402
  try {
961
1403
  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,
1404
+ appId: argv.app,
1405
+ model: argv.model,
1406
+ query: argv.query,
1407
+ queryFile: argv.queryFile,
1408
+ sort: argv.sort,
1409
+ limit: argv.limit,
1410
+ start: argv.start,
965
1411
  projection: argv.projection,
966
1412
  });
967
1413
  }
@@ -977,6 +1423,7 @@ function buildCli(rawArgs) {
977
1423
  .option('attribute', { type: 'string', demandOption: true })
978
1424
  .option('exclude-zeros', { type: 'boolean' })
979
1425
  .option('exclude-undefineds', { type: 'boolean' })
1426
+ .option('exclude-unresolved', { type: 'boolean' })
980
1427
  .option('query', { type: 'string' })
981
1428
  .option('query-file', { type: 'string' })
982
1429
  .option('limit', { type: 'number', describe: 'Top-N facets (passed to SDK as count)' })
@@ -985,15 +1432,32 @@ function buildCli(rawArgs) {
985
1432
  choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
986
1433
  describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
987
1434
  })
988
- .option('full', { type: 'boolean', default: false, describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)' })
989
- .option('include-results', { type: 'boolean', default: false, describe: 'Keep resultKeys in compact output' }), async (argv) => {
1435
+ .option('full', {
1436
+ type: 'boolean',
1437
+ default: false,
1438
+ describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)',
1439
+ })
1440
+ .option('include-results', {
1441
+ type: 'boolean',
1442
+ default: false,
1443
+ describe: 'Keep resultKeys in compact output',
1444
+ }), async (argv) => {
990
1445
  const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
991
1446
  const output = (0, output_1.createOutput)(argv.json);
992
1447
  try {
993
1448
  await facetsCommand(output, {
994
- appId: argv.app, model: argv.model, attribute: argv.attribute,
995
- excludeZeros: argv.excludeZeros, excludeUndefineds: argv.excludeUndefineds, query: argv.query, queryFile: argv.queryFile,
996
- limit: argv.limit, sort: argv.sort, full: argv.full, includeResults: argv.includeResults,
1449
+ appId: argv.app,
1450
+ model: argv.model,
1451
+ attribute: argv.attribute,
1452
+ excludeZeros: argv.excludeZeros,
1453
+ excludeUndefineds: argv.excludeUndefineds,
1454
+ excludeUnresolved: argv.excludeUnresolved,
1455
+ query: argv.query,
1456
+ queryFile: argv.queryFile,
1457
+ limit: argv.limit,
1458
+ sort: argv.sort,
1459
+ full: argv.full,
1460
+ includeResults: argv.includeResults,
997
1461
  });
998
1462
  }
999
1463
  catch (err) {
@@ -1004,14 +1468,46 @@ function buildCli(rawArgs) {
1004
1468
  .option('app', { type: 'string' })
1005
1469
  .option('model', { type: 'string', demandOption: true })
1006
1470
  .option('attribute', { type: 'string', demandOption: true })
1007
- .option('types', { type: 'string', demandOption: true, describe: 'Comma-separated: distinct,count,sum,avg,min,max,group' })
1471
+ .option('types', {
1472
+ type: 'string',
1473
+ describe: 'Comma-separated: distinct,count,sum,avg,min,max,group. Optional when --bins/--group-options supply grouping.',
1474
+ })
1008
1475
  .option('query', { type: 'string' })
1009
1476
  .option('query-file', { type: 'string' })
1010
- .option('include-keys', { type: 'boolean', default: false, describe: 'Include row keys in distinct results' }), async (argv) => {
1477
+ .option('include-keys', {
1478
+ type: 'boolean',
1479
+ default: false,
1480
+ describe: 'Include row keys in distinct results',
1481
+ })
1482
+ .option('bins', {
1483
+ type: 'string',
1484
+ describe: 'Numeric ranges for grouping, e.g. 0-100,100-200,200-',
1485
+ })
1486
+ .option('group-options', { type: 'string', describe: 'Full groupOptions JSON' })
1487
+ .option('group-options-file', { type: 'string', describe: 'Path to groupOptions JSON' })
1488
+ .option('distinct-limit', { type: 'number', describe: 'Cap distinct values' })
1489
+ .option('exclude-zeros', { type: 'boolean' })
1490
+ .option('exclude-undefineds', { type: 'boolean' })
1491
+ .option('exclude-unresolved', { type: 'boolean' }), async (argv) => {
1011
1492
  const { aggregateCommand } = await import('./functions/app/commands/fn/aggregate.js');
1012
1493
  const output = (0, output_1.createOutput)(argv.json);
1013
1494
  try {
1014
- await aggregateCommand(output, { appId: argv.app, model: argv.model, attribute: argv.attribute, types: argv.types, query: argv.query, queryFile: argv.queryFile, includeKeys: argv.includeKeys });
1495
+ await aggregateCommand(output, {
1496
+ appId: argv.app,
1497
+ model: argv.model,
1498
+ attribute: argv.attribute,
1499
+ types: argv.types,
1500
+ query: argv.query,
1501
+ queryFile: argv.queryFile,
1502
+ includeKeys: argv.includeKeys,
1503
+ bins: argv.bins,
1504
+ groupOptions: argv.groupOptions,
1505
+ groupOptionsFile: argv.groupOptionsFile,
1506
+ distinctLimit: argv.distinctLimit,
1507
+ excludeZeros: argv.excludeZeros,
1508
+ excludeUndefineds: argv.excludeUndefineds,
1509
+ excludeUnresolved: argv.excludeUnresolved,
1510
+ });
1015
1511
  }
1016
1512
  catch (err) {
1017
1513
  output.error(err.message, err.code || 'FN_AGGREGATE_FAILED');
@@ -1023,11 +1519,33 @@ function buildCli(rawArgs) {
1023
1519
  .option('attribute', { type: 'string', demandOption: true })
1024
1520
  .option('query', { type: 'string' })
1025
1521
  .option('query-file', { type: 'string' })
1026
- .option('aggregate', { type: 'array', describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.' }), async (argv) => {
1522
+ .option('aggregate', {
1523
+ type: 'array',
1524
+ describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.',
1525
+ })
1526
+ .option('exclude-zeros', { type: 'boolean' })
1527
+ .option('exclude-undefineds', { type: 'boolean' })
1528
+ .option('exclude-unresolved', { type: 'boolean' })
1529
+ .option('sort', { type: 'string', describe: 'attr:DIR ordering, e.g. price:DESC' })
1530
+ .option('limit', { type: 'number' })
1531
+ .option('start', { type: 'number', describe: '0-based offset' }), async (argv) => {
1027
1532
  const { groupByCommand } = await import('./functions/app/commands/fn/group-by.js');
1028
1533
  const output = (0, output_1.createOutput)(argv.json);
1029
1534
  try {
1030
- await groupByCommand(output, { appId: argv.app, model: argv.model, attribute: argv.attribute, query: argv.query, queryFile: argv.queryFile, aggregate: argv.aggregate });
1535
+ await groupByCommand(output, {
1536
+ appId: argv.app,
1537
+ model: argv.model,
1538
+ attribute: argv.attribute,
1539
+ query: argv.query,
1540
+ queryFile: argv.queryFile,
1541
+ aggregate: argv.aggregate,
1542
+ excludeZeros: argv.excludeZeros,
1543
+ excludeUndefineds: argv.excludeUndefineds,
1544
+ excludeUnresolved: argv.excludeUnresolved,
1545
+ sort: argv.sort,
1546
+ limit: argv.limit,
1547
+ start: argv.start,
1548
+ });
1031
1549
  }
1032
1550
  catch (err) {
1033
1551
  output.error(err.message, err.code || 'FN_GROUPBY_FAILED');
@@ -1041,28 +1559,134 @@ function buildCli(rawArgs) {
1041
1559
  const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
1042
1560
  const output = (0, output_1.createOutput)(argv.json);
1043
1561
  try {
1044
- await metadataCommand(output, { appId: argv.app, model: argv.model, query: argv.query, queryFile: argv.queryFile });
1562
+ await metadataCommand(output, {
1563
+ appId: argv.app,
1564
+ model: argv.model,
1565
+ query: argv.query,
1566
+ queryFile: argv.queryFile,
1567
+ });
1045
1568
  }
1046
1569
  catch (err) {
1047
1570
  output.error(err.message, err.code || 'FN_METADATA_FAILED');
1048
1571
  }
1572
+ })
1573
+ .command('pivot', 'Multi-dimensional cross-tab (rows x columns x values)', (a) => a
1574
+ .option('app', { type: 'string' })
1575
+ .option('model', { type: 'string', demandOption: true })
1576
+ .option('rows', {
1577
+ type: 'array',
1578
+ describe: 'Row attribute(s); append :totals for row totals. Repeatable.',
1579
+ })
1580
+ .option('columns', {
1581
+ type: 'array',
1582
+ describe: 'Column attribute(s); append :totals. Repeatable.',
1583
+ })
1584
+ .option('values', { type: 'array', describe: 'Aggregations <attr>:<type[,type]>. Repeatable.' })
1585
+ .option('totals', { type: 'boolean', describe: 'Compute grand totals' })
1586
+ .option('spec', {
1587
+ type: 'string',
1588
+ describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)',
1589
+ })
1590
+ .option('spec-file', { type: 'string', describe: 'Path to PivotOptions JSON' })
1591
+ .option('query', { type: 'string' })
1592
+ .option('query-file', { type: 'string' }), async (argv) => {
1593
+ const { pivotCommand } = await import('./functions/app/commands/fn/pivot.js');
1594
+ const output = (0, output_1.createOutput)(argv.json);
1595
+ try {
1596
+ await pivotCommand(output, {
1597
+ appId: argv.app,
1598
+ model: argv.model,
1599
+ rows: argv.rows,
1600
+ columns: argv.columns,
1601
+ values: argv.values,
1602
+ totals: argv.totals,
1603
+ spec: argv.spec,
1604
+ specFile: argv.specFile,
1605
+ query: argv.query,
1606
+ queryFile: argv.queryFile,
1607
+ });
1608
+ }
1609
+ catch (err) {
1610
+ output.error(err.message, err.code || 'FN_PIVOT_FAILED');
1611
+ }
1612
+ })
1613
+ .command('suggest', 'Typeahead suggestions for an attribute value', (a) => a
1614
+ .option('app', { type: 'string' })
1615
+ .option('model', { type: 'string', demandOption: true })
1616
+ .option('attribute', { type: 'string', demandOption: true })
1617
+ .option('value', { type: 'string', demandOption: true })
1618
+ .option('max', { type: 'number' })
1619
+ .option('relevant-data', {
1620
+ type: 'string',
1621
+ choices: ['filtered', 'all', 'excludeQuery'],
1622
+ })
1623
+ .option('calculate-result-keys', { type: 'boolean' })
1624
+ .option('exclude-undefineds', { type: 'boolean' })
1625
+ .option('exclude-nulls', { type: 'boolean' })
1626
+ .option('exclude-query', { type: 'string' })
1627
+ .option('exclude-query-file', { type: 'string' })
1628
+ .option('query', { type: 'string' })
1629
+ .option('query-file', { type: 'string' }), async (argv) => {
1630
+ const { suggestCommand } = await import('./functions/app/commands/fn/suggest.js');
1631
+ const output = (0, output_1.createOutput)(argv.json);
1632
+ try {
1633
+ await suggestCommand(output, {
1634
+ appId: argv.app,
1635
+ model: argv.model,
1636
+ attribute: argv.attribute,
1637
+ value: argv.value,
1638
+ max: argv.max,
1639
+ relevantData: argv.relevantData,
1640
+ calculateResultKeys: argv.calculateResultKeys,
1641
+ excludeUndefineds: argv.excludeUndefineds,
1642
+ excludeNulls: argv.excludeNulls,
1643
+ excludeQuery: argv.excludeQuery,
1644
+ excludeQueryFile: argv.excludeQueryFile,
1645
+ query: argv.query,
1646
+ queryFile: argv.queryFile,
1647
+ });
1648
+ }
1649
+ catch (err) {
1650
+ output.error(err.message, err.code || 'FN_SUGGEST_FAILED');
1651
+ }
1049
1652
  })
1050
1653
  .demandCommand(1))
1051
1654
  .command('loaders <subcommand>', 'Manage loaders on a daemon', (yyy) => yyy
1052
1655
  .command('add', 'Register a loader source', (a) => a
1053
1656
  .option('app', { type: 'string', describe: 'App id' })
1054
1657
  .option('key', { type: 'string', describe: 'Loader key (auto-generated if omitted)' })
1055
- .option('source', { type: 'string', choices: ['local', 'remote', 'url'], describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url' })
1658
+ .option('source', {
1659
+ type: 'string',
1660
+ choices: ['local', 'remote', 'url'],
1661
+ describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
1662
+ })
1056
1663
  .option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
1057
- .option('project-id', { type: 'string', describe: 'dcupl Console project id (cdn source)' })
1664
+ .option('project-id', {
1665
+ type: 'string',
1666
+ describe: 'dcupl Console project id (cdn source). CDN host: see --cdn-base-url',
1667
+ })
1058
1668
  .option('api-key', { type: 'string', describe: 'Console API key' })
1059
- .option('version', { type: 'string', describe: 'Console version id (cdn source, default: draft)' })
1669
+ .option('version', {
1670
+ type: 'string',
1671
+ describe: 'Console version id (cdn source, default: draft)',
1672
+ })
1673
+ .option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
1060
1674
  .option('base-url', { type: 'string', describe: 'Custom base URL source' })
1061
1675
  .option('loader-file', { type: 'string', describe: 'Loader file name for base-url source' })
1062
- .option('header', { type: 'array', string: true, describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)' })
1676
+ .option('header', {
1677
+ type: 'array',
1678
+ string: true,
1679
+ describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)',
1680
+ })
1063
1681
  .option('lc-json', { type: 'string', describe: 'Path to loader config (workspace source)' })
1064
- .option('auto-serve', { type: 'boolean', describe: 'Auto-spawn dcupl serve if not running (workspace source)' })
1065
- .option('auto-serve-port', { type: 'string', describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned' }), async (argv) => {
1682
+ .option('auto-serve', {
1683
+ type: 'boolean',
1684
+ describe: 'Auto-spawn dcupl serve if not running (workspace source)',
1685
+ })
1686
+ .option('auto-serve-port', {
1687
+ type: 'string',
1688
+ describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned',
1689
+ }), async (argv) => {
1066
1690
  const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
1067
1691
  const output = (0, output_1.createOutput)(argv.json);
1068
1692
  try {
@@ -1075,6 +1699,7 @@ function buildCli(rawArgs) {
1075
1699
  projectId: argv['project-id'],
1076
1700
  apiKey: argv['api-key'],
1077
1701
  version: argv.version,
1702
+ cdnBaseUrl: argv['cdn-base-url'],
1078
1703
  baseUrl: argv['base-url'],
1079
1704
  loaderFile: argv['loader-file'],
1080
1705
  header: argv.header,
@@ -1085,7 +1710,7 @@ function buildCli(rawArgs) {
1085
1710
  });
1086
1711
  }
1087
1712
  catch (err) {
1088
- output.error(err.message, err.code || 'LOADERS_ADD_FAILED');
1713
+ output.error(err.message, err.code || 'LOADERS_ADD_FAILED', err.details === undefined ? undefined : { details: err.details });
1089
1714
  }
1090
1715
  })
1091
1716
  .command('process', 'Process (re-load) a loader', (a) => a
@@ -1093,7 +1718,11 @@ function buildCli(rawArgs) {
1093
1718
  .option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
1094
1719
  .option('app-key', { type: 'string', describe: 'Application key' })
1095
1720
  .option('env', { type: 'array', string: true, describe: 'Environment keys (repeatable)' })
1096
- .option('tag', { type: 'array', string: true, describe: 'Resource tags (repeatable, comma-separate for AND)' })
1721
+ .option('tag', {
1722
+ type: 'array',
1723
+ string: true,
1724
+ describe: 'Resource tags (repeatable, comma-separate for AND)',
1725
+ })
1097
1726
  .option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
1098
1727
  const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
1099
1728
  const output = (0, output_1.createOutput)(argv.json);
@@ -1148,7 +1777,7 @@ function buildCli(rawArgs) {
1148
1777
  }
1149
1778
  })
1150
1779
  .demandCommand(1))
1151
- .demandCommand(1);
1780
+ .demandCommand(1));
1152
1781
  }, () => { })
1153
1782
  .command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
1154
1783
  (0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
@@ -1186,8 +1815,8 @@ function buildCli(rawArgs) {
1186
1815
  const output = (0, output_1.createOutput)(argv.json);
1187
1816
  if (!output.isJson()) {
1188
1817
  process.stderr.write(`⚠️ Deprecation: 'dcupl files:push' is deprecated and will be removed in a future release.\n` +
1189
- ` Use 'dcupl files push' (sync-aware) instead. Note: binary file uploads are not yet\n` +
1190
- ` supported by the new command — continue using 'files:push' until that lands.\n`);
1818
+ ` Use 'dcupl files push' (sync-aware, changed-only; accepts .csv, .json, .txt, .md, .js).\n` +
1819
+ ` This legacy zip upload keeps only .csv, .json and .js and silently drops everything else.\n`);
1191
1820
  }
1192
1821
  const { pushFiles } = await import('./functions/files/files-push.js');
1193
1822
  pushFiles(argv, output);
@@ -1201,9 +1830,8 @@ function buildCli(rawArgs) {
1201
1830
  const output = (0, output_1.createOutput)(argv.json);
1202
1831
  if (!output.isJson()) {
1203
1832
  process.stderr.write(`⚠️ Deprecation: 'dcupl files:pull' is deprecated and will be removed in a future release.\n` +
1204
- ` Use 'dcupl files pull' (sync-aware) instead. Note: the new 'files <verb>' pair only\n` +
1205
- ` supports text/UTF-8 round-trips — projects containing binary files originally pushed\n` +
1206
- ` via 'files:push' should continue using 'files:pull' to stay in lockstep.\n`);
1833
+ ` Use 'dcupl files pull' (sync-aware, changed-only) instead. The dcupl CDN stores text files\n` +
1834
+ ` only, so there is nothing the new command cannot round-trip.\n`);
1207
1835
  }
1208
1836
  const { pullFiles } = await import('./functions/files/files-pull.js');
1209
1837
  pullFiles(argv, output);
@@ -1221,7 +1849,12 @@ function buildCli(rawArgs) {
1221
1849
  try {
1222
1850
  const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
1223
1851
  const client = (0, api_client_1.createApiClient)();
1224
- await copyVersionCommand(client, output, { from: argv.from, to: argv.to, yes: true, dryRun: false });
1852
+ await copyVersionCommand(client, output, {
1853
+ from: argv.from,
1854
+ to: argv.to,
1855
+ yes: true,
1856
+ dryRun: false,
1857
+ });
1225
1858
  }
1226
1859
  catch (err) {
1227
1860
  output.error(err.error || err.message, err.code || 'UNKNOWN');
@@ -1242,6 +1875,6 @@ function buildCli(rawArgs) {
1242
1875
  output.error(err.error || err.message, err.code || 'UNKNOWN');
1243
1876
  }
1244
1877
  })
1245
- .demandCommand(1);
1878
+ .demandCommand(1));
1246
1879
  }
1247
1880
  //# sourceMappingURL=cli.js.map