@dcupl/cli 1.3.2 → 1.4.0-beta.0

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 (460) hide show
  1. package/README.md +107 -0
  2. package/dist/cli.d.ts +4 -0
  3. package/dist/cli.js +1247 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/functions/app/app-id.d.ts +1 -0
  6. package/dist/functions/app/app-id.js +13 -0
  7. package/dist/functions/app/app-id.js.map +1 -0
  8. package/dist/functions/app/client/daemon-client.d.ts +16 -0
  9. package/dist/functions/app/client/daemon-client.js +67 -0
  10. package/dist/functions/app/client/daemon-client.js.map +1 -0
  11. package/dist/functions/app/commands/build.d.ts +10 -0
  12. package/dist/functions/app/commands/build.js +23 -0
  13. package/dist/functions/app/commands/build.js.map +1 -0
  14. package/dist/functions/app/commands/create.d.ts +35 -0
  15. package/dist/functions/app/commands/create.js +130 -0
  16. package/dist/functions/app/commands/create.js.map +1 -0
  17. package/dist/functions/app/commands/data/_data-helpers.d.ts +23 -0
  18. package/dist/functions/app/commands/data/_data-helpers.js +32 -0
  19. package/dist/functions/app/commands/data/_data-helpers.js.map +1 -0
  20. package/dist/functions/app/commands/data/remove.d.ts +3 -0
  21. package/dist/functions/app/commands/data/remove.js +9 -0
  22. package/dist/functions/app/commands/data/remove.js.map +1 -0
  23. package/dist/functions/app/commands/data/render.d.ts +34 -0
  24. package/dist/functions/app/commands/data/render.js +36 -0
  25. package/dist/functions/app/commands/data/render.js.map +1 -0
  26. package/dist/functions/app/commands/data/reset.d.ts +12 -0
  27. package/dist/functions/app/commands/data/reset.js +15 -0
  28. package/dist/functions/app/commands/data/reset.js.map +1 -0
  29. package/dist/functions/app/commands/data/set.d.ts +3 -0
  30. package/dist/functions/app/commands/data/set.js +9 -0
  31. package/dist/functions/app/commands/data/set.js.map +1 -0
  32. package/dist/functions/app/commands/data/update.d.ts +3 -0
  33. package/dist/functions/app/commands/data/update.js +9 -0
  34. package/dist/functions/app/commands/data/update.js.map +1 -0
  35. package/dist/functions/app/commands/data/upsert.d.ts +3 -0
  36. package/dist/functions/app/commands/data/upsert.js +9 -0
  37. package/dist/functions/app/commands/data/upsert.js.map +1 -0
  38. package/dist/functions/app/commands/destroy.d.ts +18 -0
  39. package/dist/functions/app/commands/destroy.js +55 -0
  40. package/dist/functions/app/commands/destroy.js.map +1 -0
  41. package/dist/functions/app/commands/detect-serve.d.ts +34 -0
  42. package/dist/functions/app/commands/detect-serve.js +169 -0
  43. package/dist/functions/app/commands/detect-serve.js.map +1 -0
  44. package/dist/functions/app/commands/fn/_fn-helpers.d.ts +13 -0
  45. package/dist/functions/app/commands/fn/_fn-helpers.js +11 -0
  46. package/dist/functions/app/commands/fn/_fn-helpers.js.map +1 -0
  47. package/dist/functions/app/commands/fn/aggregate.d.ts +11 -0
  48. package/dist/functions/app/commands/fn/aggregate.js +34 -0
  49. package/dist/functions/app/commands/fn/aggregate.js.map +1 -0
  50. package/dist/functions/app/commands/fn/facets.d.ts +15 -0
  51. package/dist/functions/app/commands/fn/facets.js +35 -0
  52. package/dist/functions/app/commands/fn/facets.js.map +1 -0
  53. package/dist/functions/app/commands/fn/group-by.d.ts +10 -0
  54. package/dist/functions/app/commands/fn/group-by.js +38 -0
  55. package/dist/functions/app/commands/fn/group-by.js.map +1 -0
  56. package/dist/functions/app/commands/fn/metadata.d.ts +8 -0
  57. package/dist/functions/app/commands/fn/metadata.js +13 -0
  58. package/dist/functions/app/commands/fn/metadata.js.map +1 -0
  59. package/dist/functions/app/commands/list.d.ts +7 -0
  60. package/dist/functions/app/commands/list.js +24 -0
  61. package/dist/functions/app/commands/list.js.map +1 -0
  62. package/dist/functions/app/commands/loader-hash.d.ts +2 -0
  63. package/dist/functions/app/commands/loader-hash.js +39 -0
  64. package/dist/functions/app/commands/loader-hash.js.map +1 -0
  65. package/dist/functions/app/commands/loaders/add.d.ts +15 -0
  66. package/dist/functions/app/commands/loaders/add.js +27 -0
  67. package/dist/functions/app/commands/loaders/add.js.map +1 -0
  68. package/dist/functions/app/commands/loaders/get.d.ts +12 -0
  69. package/dist/functions/app/commands/loaders/get.js +16 -0
  70. package/dist/functions/app/commands/loaders/get.js.map +1 -0
  71. package/dist/functions/app/commands/loaders/list.d.ts +11 -0
  72. package/dist/functions/app/commands/loaders/list.js +14 -0
  73. package/dist/functions/app/commands/loaders/list.js.map +1 -0
  74. package/dist/functions/app/commands/loaders/process-flags.d.ts +8 -0
  75. package/dist/functions/app/commands/loaders/process-flags.js +31 -0
  76. package/dist/functions/app/commands/loaders/process-flags.js.map +1 -0
  77. package/dist/functions/app/commands/loaders/process.d.ts +14 -0
  78. package/dist/functions/app/commands/loaders/process.js +23 -0
  79. package/dist/functions/app/commands/loaders/process.js.map +1 -0
  80. package/dist/functions/app/commands/loaders/remove.d.ts +12 -0
  81. package/dist/functions/app/commands/loaders/remove.js +16 -0
  82. package/dist/functions/app/commands/loaders/remove.js.map +1 -0
  83. package/dist/functions/app/commands/loaders/resolve-key.d.ts +6 -0
  84. package/dist/functions/app/commands/loaders/resolve-key.js +26 -0
  85. package/dist/functions/app/commands/loaders/resolve-key.js.map +1 -0
  86. package/dist/functions/app/commands/logs.d.ts +10 -0
  87. package/dist/functions/app/commands/logs.js +25 -0
  88. package/dist/functions/app/commands/logs.js.map +1 -0
  89. package/dist/functions/app/commands/models/get.d.ts +11 -0
  90. package/dist/functions/app/commands/models/get.js +12 -0
  91. package/dist/functions/app/commands/models/get.js.map +1 -0
  92. package/dist/functions/app/commands/models/keys.d.ts +10 -0
  93. package/dist/functions/app/commands/models/keys.js +12 -0
  94. package/dist/functions/app/commands/models/keys.js.map +1 -0
  95. package/dist/functions/app/commands/models/remove.d.ts +11 -0
  96. package/dist/functions/app/commands/models/remove.js +12 -0
  97. package/dist/functions/app/commands/models/remove.js.map +1 -0
  98. package/dist/functions/app/commands/models/set.d.ts +12 -0
  99. package/dist/functions/app/commands/models/set.js +23 -0
  100. package/dist/functions/app/commands/models/set.js.map +1 -0
  101. package/dist/functions/app/commands/query/execute.d.ts +19 -0
  102. package/dist/functions/app/commands/query/execute.js +88 -0
  103. package/dist/functions/app/commands/query/execute.js.map +1 -0
  104. package/dist/functions/app/commands/query/one.d.ts +13 -0
  105. package/dist/functions/app/commands/query/one.js +14 -0
  106. package/dist/functions/app/commands/query/one.js.map +1 -0
  107. package/dist/functions/app/commands/query-input.d.ts +1 -0
  108. package/dist/functions/app/commands/query-input.js +12 -0
  109. package/dist/functions/app/commands/query-input.js.map +1 -0
  110. package/dist/functions/app/commands/render.d.ts +44 -0
  111. package/dist/functions/app/commands/render.js +139 -0
  112. package/dist/functions/app/commands/render.js.map +1 -0
  113. package/dist/functions/app/commands/resolve-app.d.ts +12 -0
  114. package/dist/functions/app/commands/resolve-app.js +34 -0
  115. package/dist/functions/app/commands/resolve-app.js.map +1 -0
  116. package/dist/functions/app/commands/resolve-source.d.ts +31 -0
  117. package/dist/functions/app/commands/resolve-source.js +82 -0
  118. package/dist/functions/app/commands/resolve-source.js.map +1 -0
  119. package/dist/functions/app/commands/status.d.ts +12 -0
  120. package/dist/functions/app/commands/status.js +30 -0
  121. package/dist/functions/app/commands/status.js.map +1 -0
  122. package/dist/functions/app/commands/validate-report.d.ts +89 -0
  123. package/dist/functions/app/commands/validate-report.js +65 -0
  124. package/dist/functions/app/commands/validate-report.js.map +1 -0
  125. package/dist/functions/app/commands/validate.d.ts +32 -0
  126. package/dist/functions/app/commands/validate.js +91 -0
  127. package/dist/functions/app/commands/validate.js.map +1 -0
  128. package/dist/functions/app/commands/warn-if-pending.d.ts +3 -0
  129. package/dist/functions/app/commands/warn-if-pending.js +9 -0
  130. package/dist/functions/app/commands/warn-if-pending.js.map +1 -0
  131. package/dist/functions/app/daemon/app-server.module.d.ts +7 -0
  132. package/dist/functions/app/daemon/app-server.module.js +41 -0
  133. package/dist/functions/app/daemon/app-server.module.js.map +1 -0
  134. package/dist/functions/app/daemon/controllers/data.controller.d.ts +94 -0
  135. package/dist/functions/app/daemon/controllers/data.controller.js +134 -0
  136. package/dist/functions/app/daemon/controllers/data.controller.js.map +1 -0
  137. package/dist/functions/app/daemon/controllers/fn.controller.d.ts +21 -0
  138. package/dist/functions/app/daemon/controllers/fn.controller.js +59 -0
  139. package/dist/functions/app/daemon/controllers/fn.controller.js.map +1 -0
  140. package/dist/functions/app/daemon/controllers/lifecycle.controller.d.ts +29 -0
  141. package/dist/functions/app/daemon/controllers/lifecycle.controller.js +65 -0
  142. package/dist/functions/app/daemon/controllers/lifecycle.controller.js.map +1 -0
  143. package/dist/functions/app/daemon/controllers/loaders.controller.d.ts +31 -0
  144. package/dist/functions/app/daemon/controllers/loaders.controller.js +72 -0
  145. package/dist/functions/app/daemon/controllers/loaders.controller.js.map +1 -0
  146. package/dist/functions/app/daemon/controllers/models.controller.d.ts +30 -0
  147. package/dist/functions/app/daemon/controllers/models.controller.js +80 -0
  148. package/dist/functions/app/daemon/controllers/models.controller.js.map +1 -0
  149. package/dist/functions/app/daemon/controllers/query.controller.d.ts +22 -0
  150. package/dist/functions/app/daemon/controllers/query.controller.js +43 -0
  151. package/dist/functions/app/daemon/controllers/query.controller.js.map +1 -0
  152. package/dist/functions/app/daemon/daemon-args.d.ts +13 -0
  153. package/dist/functions/app/daemon/daemon-args.js +38 -0
  154. package/dist/functions/app/daemon/daemon-args.js.map +1 -0
  155. package/dist/functions/app/daemon/filters/envelope-exception.filter.d.ts +4 -0
  156. package/dist/functions/app/daemon/filters/envelope-exception.filter.js +58 -0
  157. package/dist/functions/app/daemon/filters/envelope-exception.filter.js.map +1 -0
  158. package/dist/functions/app/daemon/guards/api-key.guard.d.ts +7 -0
  159. package/dist/functions/app/daemon/guards/api-key.guard.js +26 -0
  160. package/dist/functions/app/daemon/guards/api-key.guard.js.map +1 -0
  161. package/dist/functions/app/daemon/interceptors/pending-changes.interceptor.d.ts +8 -0
  162. package/dist/functions/app/daemon/interceptors/pending-changes.interceptor.js +25 -0
  163. package/dist/functions/app/daemon/interceptors/pending-changes.interceptor.js.map +1 -0
  164. package/dist/functions/app/daemon/main.d.ts +1 -0
  165. package/dist/functions/app/daemon/main.js +86 -0
  166. package/dist/functions/app/daemon/main.js.map +1 -0
  167. package/dist/functions/app/daemon/services/auto-gen.d.ts +7 -0
  168. package/dist/functions/app/daemon/services/auto-gen.js +18 -0
  169. package/dist/functions/app/daemon/services/auto-gen.js.map +1 -0
  170. package/dist/functions/app/daemon/services/dcupl-host.service.d.ts +69 -0
  171. package/dist/functions/app/daemon/services/dcupl-host.service.js +267 -0
  172. package/dist/functions/app/daemon/services/dcupl-host.service.js.map +1 -0
  173. package/dist/functions/app/daemon/services/idle-watchdog.service.d.ts +12 -0
  174. package/dist/functions/app/daemon/services/idle-watchdog.service.js +38 -0
  175. package/dist/functions/app/daemon/services/idle-watchdog.service.js.map +1 -0
  176. package/dist/functions/app/daemon/services/ingest.service.d.ts +12 -0
  177. package/dist/functions/app/daemon/services/ingest.service.js +126 -0
  178. package/dist/functions/app/daemon/services/ingest.service.js.map +1 -0
  179. package/dist/functions/app/daemon/services/init-options.d.ts +16 -0
  180. package/dist/functions/app/daemon/services/init-options.js +56 -0
  181. package/dist/functions/app/daemon/services/init-options.js.map +1 -0
  182. package/dist/functions/app/daemon/services/loaders.service.d.ts +27 -0
  183. package/dist/functions/app/daemon/services/loaders.service.js +169 -0
  184. package/dist/functions/app/daemon/services/loaders.service.js.map +1 -0
  185. package/dist/functions/app/daemon/services/normalize-query.d.ts +11 -0
  186. package/dist/functions/app/daemon/services/normalize-query.js +29 -0
  187. package/dist/functions/app/daemon/services/normalize-query.js.map +1 -0
  188. package/dist/functions/app/e2e/port-lock.d.ts +2 -0
  189. package/dist/functions/app/e2e/port-lock.js +53 -0
  190. package/dist/functions/app/e2e/port-lock.js.map +1 -0
  191. package/dist/functions/app/registry/daemon-log.d.ts +3 -0
  192. package/dist/functions/app/registry/daemon-log.js +32 -0
  193. package/dist/functions/app/registry/daemon-log.js.map +1 -0
  194. package/dist/functions/app/registry/registry.d.ts +15 -0
  195. package/dist/functions/app/registry/registry.js +111 -0
  196. package/dist/functions/app/registry/registry.js.map +1 -0
  197. package/dist/functions/app/registry/serve-registry.d.ts +16 -0
  198. package/dist/functions/app/registry/serve-registry.js +93 -0
  199. package/dist/functions/app/registry/serve-registry.js.map +1 -0
  200. package/dist/functions/app/types.d.ts +124 -0
  201. package/dist/functions/app/types.js +3 -0
  202. package/dist/functions/app/types.js.map +1 -0
  203. package/dist/functions/config/commands/get.d.ts +14 -0
  204. package/dist/functions/config/commands/get.js +46 -0
  205. package/dist/functions/config/commands/get.js.map +1 -0
  206. package/dist/functions/config/commands/set.d.ts +7 -0
  207. package/dist/functions/config/commands/set.js +66 -0
  208. package/dist/functions/config/commands/set.js.map +1 -0
  209. package/dist/functions/config/io.d.ts +6 -0
  210. package/dist/functions/config/io.js +35 -0
  211. package/dist/functions/config/io.js.map +1 -0
  212. package/dist/functions/config/prompts.d.ts +7 -0
  213. package/dist/functions/config/prompts.js +51 -0
  214. package/dist/functions/config/prompts.js.map +1 -0
  215. package/dist/functions/files/commands/copy.d.ts +22 -0
  216. package/dist/functions/files/commands/copy.js +21 -0
  217. package/dist/functions/files/commands/copy.js.map +1 -0
  218. package/dist/functions/files/commands/create-folder.d.ts +19 -0
  219. package/dist/functions/files/commands/create-folder.js +19 -0
  220. package/dist/functions/files/commands/create-folder.js.map +1 -0
  221. package/dist/functions/files/commands/delete.d.ts +21 -0
  222. package/dist/functions/files/commands/delete.js +37 -0
  223. package/dist/functions/files/commands/delete.js.map +1 -0
  224. package/dist/functions/files/commands/list.d.ts +20 -0
  225. package/dist/functions/files/commands/list.js +29 -0
  226. package/dist/functions/files/commands/list.js.map +1 -0
  227. package/dist/functions/files/commands/move.d.ts +24 -0
  228. package/dist/functions/files/commands/move.js +37 -0
  229. package/dist/functions/files/commands/move.js.map +1 -0
  230. package/dist/functions/files/commands/pull.d.ts +31 -0
  231. package/dist/functions/files/commands/pull.js +132 -0
  232. package/dist/functions/files/commands/pull.js.map +1 -0
  233. package/dist/functions/files/commands/push.d.ts +30 -0
  234. package/dist/functions/files/commands/push.js +116 -0
  235. package/dist/functions/files/commands/push.js.map +1 -0
  236. package/dist/functions/files/commands/read.d.ts +19 -0
  237. package/dist/functions/files/commands/read.js +25 -0
  238. package/dist/functions/files/commands/read.js.map +1 -0
  239. package/dist/functions/files/commands/render.d.ts +89 -0
  240. package/dist/functions/files/commands/render.js +229 -0
  241. package/dist/functions/files/commands/render.js.map +1 -0
  242. package/dist/functions/files/commands/status.d.ts +23 -0
  243. package/dist/functions/files/commands/status.js +58 -0
  244. package/dist/functions/files/commands/status.js.map +1 -0
  245. package/dist/functions/files/commands/versions/copy.d.ts +8 -0
  246. package/dist/functions/files/commands/versions/copy.js +34 -0
  247. package/dist/functions/files/commands/versions/copy.js.map +1 -0
  248. package/dist/functions/files/commands/versions/delete.d.ts +7 -0
  249. package/dist/functions/files/commands/versions/delete.js +35 -0
  250. package/dist/functions/files/commands/versions/delete.js.map +1 -0
  251. package/dist/functions/files/commands/versions/list.d.ts +3 -0
  252. package/dist/functions/files/commands/versions/list.js +10 -0
  253. package/dist/functions/files/commands/versions/list.js.map +1 -0
  254. package/dist/functions/files/commands/write.d.ts +24 -0
  255. package/dist/functions/files/commands/write.js +36 -0
  256. package/dist/functions/files/commands/write.js.map +1 -0
  257. package/dist/functions/files/files-pull.d.ts +26 -2
  258. package/dist/functions/files/files-pull.js +100 -30
  259. package/dist/functions/files/files-pull.js.map +1 -1
  260. package/dist/functions/files/files-push.d.ts +3 -1
  261. package/dist/functions/files/files-push.js +64 -48
  262. package/dist/functions/files/files-push.js.map +1 -1
  263. package/dist/functions/files/helper/confirm.d.ts +5 -0
  264. package/dist/functions/files/helper/confirm.js +14 -0
  265. package/dist/functions/files/helper/confirm.js.map +1 -0
  266. package/dist/functions/files/helper/resolve-version.d.ts +5 -0
  267. package/dist/functions/files/helper/resolve-version.js +15 -0
  268. package/dist/functions/files/helper/resolve-version.js.map +1 -0
  269. package/dist/functions/files/sync/baseline-derive.d.ts +3 -0
  270. package/dist/functions/files/sync/baseline-derive.js +49 -0
  271. package/dist/functions/files/sync/baseline-derive.js.map +1 -0
  272. package/dist/functions/files/sync/diff.d.ts +9 -0
  273. package/dist/functions/files/sync/diff.js +80 -0
  274. package/dist/functions/files/sync/diff.js.map +1 -0
  275. package/dist/functions/files/sync/manifest.d.ts +12 -0
  276. package/dist/functions/files/sync/manifest.js +74 -0
  277. package/dist/functions/files/sync/manifest.js.map +1 -0
  278. package/dist/functions/files/sync/scope.d.ts +4 -0
  279. package/dist/functions/files/sync/scope.js +44 -0
  280. package/dist/functions/files/sync/scope.js.map +1 -0
  281. package/dist/functions/files/sync/state.d.ts +8 -0
  282. package/dist/functions/files/sync/state.js +74 -0
  283. package/dist/functions/files/sync/state.js.map +1 -0
  284. package/dist/functions/files/sync/transfer.d.ts +47 -0
  285. package/dist/functions/files/sync/transfer.js +132 -0
  286. package/dist/functions/files/sync/transfer.js.map +1 -0
  287. package/dist/functions/files/sync/types.d.ts +41 -0
  288. package/dist/functions/files/sync/types.js +3 -0
  289. package/dist/functions/files/sync/types.js.map +1 -0
  290. package/dist/functions/files/test-helpers.d.ts +13 -0
  291. package/dist/functions/files/test-helpers.js +34 -0
  292. package/dist/functions/files/test-helpers.js.map +1 -0
  293. package/dist/functions/generate/files/generate-code.d.ts +3 -1
  294. package/dist/functions/generate/files/generate-code.js +2 -0
  295. package/dist/functions/generate/files/generate-code.js.map +1 -1
  296. package/dist/functions/generate/files/generate-files.d.ts +12 -2
  297. package/dist/functions/generate/files/generate-files.js +155 -224
  298. package/dist/functions/generate/files/generate-files.js.map +1 -1
  299. package/dist/functions/generate/files/generate.helper.d.ts +2 -2
  300. package/dist/functions/generate/files/generate.helper.js +5 -7
  301. package/dist/functions/generate/files/generate.helper.js.map +1 -1
  302. package/dist/functions/generate/model-from-data/generate-model-from-data.d.ts +10 -0
  303. package/dist/functions/generate/model-from-data/generate-model-from-data.js +184 -0
  304. package/dist/functions/generate/model-from-data/generate-model-from-data.js.map +1 -0
  305. package/dist/functions/generate/model-from-data/infer-key.d.ts +19 -0
  306. package/dist/functions/generate/model-from-data/infer-key.js +54 -0
  307. package/dist/functions/generate/model-from-data/infer-key.js.map +1 -0
  308. package/dist/functions/generate/model-from-data/infer-to-model.d.ts +6 -0
  309. package/dist/functions/generate/model-from-data/infer-to-model.js +59 -0
  310. package/dist/functions/generate/model-from-data/infer-to-model.js.map +1 -0
  311. package/dist/functions/generate/projects/generate-project.d.ts +12 -1
  312. package/dist/functions/generate/projects/generate-project.js +338 -65
  313. package/dist/functions/generate/projects/generate-project.js.map +1 -1
  314. package/dist/functions/helper/api-client.d.ts +18 -0
  315. package/dist/functions/helper/api-client.js +88 -0
  316. package/dist/functions/helper/api-client.js.map +1 -0
  317. package/dist/functions/helper/config.helper.d.ts +15 -2
  318. package/dist/functions/helper/config.helper.js +20 -5
  319. package/dist/functions/helper/config.helper.js.map +1 -1
  320. package/dist/functions/helper/output.d.ts +9 -0
  321. package/dist/functions/helper/output.js +71 -0
  322. package/dist/functions/helper/output.js.map +1 -0
  323. package/dist/functions/helper/parse-fail.d.ts +11 -0
  324. package/dist/functions/helper/parse-fail.js +106 -0
  325. package/dist/functions/helper/parse-fail.js.map +1 -0
  326. package/dist/functions/schemas/command.d.ts +21 -0
  327. package/dist/functions/schemas/command.js +57 -0
  328. package/dist/functions/schemas/command.js.map +1 -0
  329. package/dist/functions/schemas/examples/AppLoaderConfiguration.example.json +18 -0
  330. package/dist/functions/schemas/examples/DataMapperStepConfig.example.json +1 -0
  331. package/dist/functions/schemas/examples/ModelDefinition.example.json +21 -0
  332. package/dist/functions/schemas/examples/RequestStepConfig.example.json +1 -0
  333. package/dist/functions/schemas/examples/ResponseScriptConfig.example.json +1 -0
  334. package/dist/functions/schemas/examples/ScriptStepConfig.example.json +1 -0
  335. package/dist/functions/schemas/examples/TemplateV3.example.json +62 -0
  336. package/dist/functions/schemas/examples/TriggerRequestConfig.example.json +1 -0
  337. package/dist/functions/schemas/examples/WorkflowConfigV3.example.json +53 -0
  338. package/dist/functions/schemas/extract.d.ts +2 -0
  339. package/dist/functions/schemas/extract.js +68 -0
  340. package/dist/functions/schemas/extract.js.map +1 -0
  341. package/dist/functions/schemas/format.d.ts +8 -0
  342. package/dist/functions/schemas/format.js +53 -0
  343. package/dist/functions/schemas/format.js.map +1 -0
  344. package/dist/functions/schemas/registry.d.ts +15 -0
  345. package/dist/functions/schemas/registry.js +179 -0
  346. package/dist/functions/schemas/registry.js.map +1 -0
  347. package/dist/functions/schemas/resolve.d.ts +10 -0
  348. package/dist/functions/schemas/resolve.js +28 -0
  349. package/dist/functions/schemas/resolve.js.map +1 -0
  350. package/dist/functions/serve/commands/list.d.ts +9 -0
  351. package/dist/functions/serve/commands/list.js +44 -0
  352. package/dist/functions/serve/commands/list.js.map +1 -0
  353. package/dist/functions/serve/commands/stop.d.ts +11 -0
  354. package/dist/functions/serve/commands/stop.js +34 -0
  355. package/dist/functions/serve/commands/stop.js.map +1 -0
  356. package/dist/functions/serve/dev-server/dev-server.controller.d.ts +11 -8
  357. package/dist/functions/serve/dev-server/dev-server.controller.js +10 -10
  358. package/dist/functions/serve/dev-server/dev-server.controller.js.map +1 -1
  359. package/dist/functions/serve/dev-server/dev-server.module.js +2 -2
  360. package/dist/functions/serve/dev-server/dev-server.module.js.map +1 -1
  361. package/dist/functions/serve/dev-server/dev-server.service.d.ts +8 -6
  362. package/dist/functions/serve/dev-server/dev-server.service.js +25 -19
  363. package/dist/functions/serve/dev-server/dev-server.service.js.map +1 -1
  364. package/dist/functions/serve/main.d.ts +1 -0
  365. package/dist/functions/serve/main.js +19 -2
  366. package/dist/functions/serve/main.js.map +1 -1
  367. package/dist/functions/serve/serve-self-register.d.ts +9 -0
  368. package/dist/functions/serve/serve-self-register.js +30 -0
  369. package/dist/functions/serve/serve-self-register.js.map +1 -0
  370. package/dist/functions/testing/testing-helper.d.ts +1 -1
  371. package/dist/functions/testing/testing-helper.js.map +1 -1
  372. package/dist/functions/testing/testing.d.ts +2 -1
  373. package/dist/functions/testing/testing.js +7 -6
  374. package/dist/functions/testing/testing.js.map +1 -1
  375. package/dist/functions/version/command.d.ts +17 -0
  376. package/dist/functions/version/command.js +54 -0
  377. package/dist/functions/version/command.js.map +1 -0
  378. package/dist/functions/welcome.js.map +1 -1
  379. package/dist/functions/workflow/commands/deploy.d.ts +29 -0
  380. package/dist/functions/workflow/commands/deploy.js +54 -0
  381. package/dist/functions/workflow/commands/deploy.js.map +1 -0
  382. package/dist/functions/workflow/commands/get.d.ts +10 -0
  383. package/dist/functions/workflow/commands/get.js +10 -0
  384. package/dist/functions/workflow/commands/get.js.map +1 -0
  385. package/dist/functions/workflow/commands/history.d.ts +10 -0
  386. package/dist/functions/workflow/commands/history.js +25 -0
  387. package/dist/functions/workflow/commands/history.js.map +1 -0
  388. package/dist/functions/workflow/commands/list.d.ts +7 -0
  389. package/dist/functions/workflow/commands/list.js +11 -0
  390. package/dist/functions/workflow/commands/list.js.map +1 -0
  391. package/dist/functions/workflow/commands/runners-get.d.ts +10 -0
  392. package/dist/functions/workflow/commands/runners-get.js +10 -0
  393. package/dist/functions/workflow/commands/runners-get.js.map +1 -0
  394. package/dist/functions/workflow/commands/runners.d.ts +7 -0
  395. package/dist/functions/workflow/commands/runners.js +11 -0
  396. package/dist/functions/workflow/commands/runners.js.map +1 -0
  397. package/dist/functions/workflow/commands/status.d.ts +10 -0
  398. package/dist/functions/workflow/commands/status.js +10 -0
  399. package/dist/functions/workflow/commands/status.js.map +1 -0
  400. package/dist/functions/workflow/commands/template.d.ts +9 -0
  401. package/dist/functions/workflow/commands/template.js +10 -0
  402. package/dist/functions/workflow/commands/template.js.map +1 -0
  403. package/dist/functions/workflow/commands/test.d.ts +36 -0
  404. package/dist/functions/workflow/commands/test.js +158 -0
  405. package/dist/functions/workflow/commands/test.js.map +1 -0
  406. package/dist/functions/workflow/commands/trace.d.ts +11 -0
  407. package/dist/functions/workflow/commands/trace.js +24 -0
  408. package/dist/functions/workflow/commands/trace.js.map +1 -0
  409. package/dist/functions/workflow/commands/undeploy.d.ts +13 -0
  410. package/dist/functions/workflow/commands/undeploy.js +17 -0
  411. package/dist/functions/workflow/commands/undeploy.js.map +1 -0
  412. package/dist/functions/workflow/commands/validate.d.ts +18 -0
  413. package/dist/functions/workflow/commands/validate.js +35 -0
  414. package/dist/functions/workflow/commands/validate.js.map +1 -0
  415. package/dist/functions/workflow/template-io.d.ts +2 -0
  416. package/dist/functions/workflow/template-io.js +25 -0
  417. package/dist/functions/workflow/template-io.js.map +1 -0
  418. package/dist/functions/workflow/trace.d.ts +20 -0
  419. package/dist/functions/workflow/trace.js +82 -0
  420. package/dist/functions/workflow/trace.js.map +1 -0
  421. package/dist/functions/workflow/types.d.ts +27 -0
  422. package/dist/functions/workflow/types.js +3 -0
  423. package/dist/functions/workflow/types.js.map +1 -0
  424. package/dist/functions/workflow/validate.d.ts +2 -0
  425. package/dist/functions/workflow/validate.js +37 -0
  426. package/dist/functions/workflow/validate.js.map +1 -0
  427. package/dist/functions/workflow/wait-for-swap.d.ts +27 -0
  428. package/dist/functions/workflow/wait-for-swap.js +33 -0
  429. package/dist/functions/workflow/wait-for-swap.js.map +1 -0
  430. package/dist/functions/workflow/workflow-api.d.ts +27 -0
  431. package/dist/functions/workflow/workflow-api.js +68 -0
  432. package/dist/functions/workflow/workflow-api.js.map +1 -0
  433. package/dist/index.js +9 -102
  434. package/dist/index.js.map +1 -1
  435. package/files/common/dcupl.config.json +3 -2
  436. package/files/common/readme.md +1 -1
  437. package/files/dev-server/index.html +6 -6
  438. package/files/starters/starter_empty/dcupl/api/.gitkeep +0 -0
  439. package/files/starters/starter_empty/dcupl/data/.gitkeep +0 -0
  440. package/files/starters/starter_empty/dcupl/dcupl.lc.json +10 -0
  441. package/files/starters/starter_empty/dcupl/models/.gitkeep +0 -0
  442. package/files/starters/starter_empty/dcupl/workflows/.gitkeep +0 -0
  443. package/files/starters/starter_empty/dcupl.config.json +11 -0
  444. package/files/starters/starter_empty/package.json +14 -0
  445. package/package.json +60 -36
  446. package/dist/functions/files/files-copy.d.ts +0 -5
  447. package/dist/functions/files/files-copy.js +0 -43
  448. package/dist/functions/files/files-copy.js.map +0 -1
  449. package/dist/functions/files/files-list-versions.d.ts +0 -2
  450. package/dist/functions/files/files-list-versions.js +0 -39
  451. package/dist/functions/files/files-list-versions.js.map +0 -1
  452. package/dist/functions/start-dcupl/start-dcupl.d.ts +0 -7
  453. package/dist/functions/start-dcupl/start-dcupl.js +0 -51
  454. package/dist/functions/start-dcupl/start-dcupl.js.map +0 -1
  455. package/dist/functions/testing/tests/generated-completeness.spec.d.ts +0 -1
  456. package/dist/functions/testing/tests/generated-completeness.spec.js +0 -143
  457. package/dist/functions/testing/tests/generated-completeness.spec.js.map +0 -1
  458. package/dist/functions/testing/tests/model_tests.spec.d.ts +0 -1
  459. package/dist/functions/testing/tests/model_tests.spec.js +0 -92
  460. package/dist/functions/testing/tests/model_tests.spec.js.map +0 -1
package/dist/cli.js ADDED
@@ -0,0 +1,1247 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCli = buildCli;
4
+ const tslib_1 = require("tslib");
5
+ const yargs_1 = tslib_1.__importDefault(require("yargs"));
6
+ const api_client_1 = require("./functions/helper/api-client");
7
+ const output_1 = require("./functions/helper/output");
8
+ const parse_fail_1 = require("./functions/helper/parse-fail");
9
+ const command_js_1 = require("./functions/schemas/command.js");
10
+ const command_js_2 = require("./functions/version/command.js");
11
+ const init_options_js_1 = require("./functions/app/daemon/services/init-options.js");
12
+ function parseAutoServePort(raw) {
13
+ if (raw === undefined || raw === null || raw === '')
14
+ return undefined;
15
+ const s = String(raw).trim().toLowerCase();
16
+ if (s === 'auto')
17
+ return 'auto';
18
+ const n = Number(s);
19
+ if (!Number.isInteger(n) || n <= 0 || n > 65535) {
20
+ throw new Error(`--auto-serve-port must be a positive integer (1-65535) or "auto", got "${raw}"`);
21
+ }
22
+ return n;
23
+ }
24
+ function buildCli(rawArgs) {
25
+ const instance = (0, yargs_1.default)(rawArgs);
26
+ return instance
27
+ .version(false)
28
+ .locale('en')
29
+ .strict()
30
+ .recommendCommands()
31
+ .fail((msg, err, _y) => {
32
+ (0, parse_fail_1.handleParseFailure)(msg, err, instance, rawArgs);
33
+ })
34
+ .option('json', {
35
+ type: 'boolean',
36
+ default: false,
37
+ describe: 'Output results as JSON (for scripting and AI agents)',
38
+ })
39
+ .command(['init [target]', 'new [target]'], 'Scaffold a new project from a starter template', (args) => args
40
+ .positional('target', {
41
+ type: 'string',
42
+ describe: 'Target folder, or "." to initialize into the current directory',
43
+ })
44
+ .option('name', { type: 'string', describe: 'Project name (folder to create)' })
45
+ .option('here', {
46
+ type: 'boolean',
47
+ describe: 'Initialize into the current directory instead of a new subfolder',
48
+ })
49
+ .option('starter', {
50
+ type: 'string',
51
+ choices: ['minimal', 'empty', 'existing'],
52
+ describe: "Starter to use ('minimal', 'empty', or 'existing')",
53
+ })
54
+ .option('project-id', {
55
+ type: 'string',
56
+ describe: 'Console project ID (required with --starter existing)',
57
+ })
58
+ .option('api-key', {
59
+ type: 'string',
60
+ describe: 'Console API key (required with --starter existing)',
61
+ })
62
+ .option('console-api-url', { type: 'string', hidden: true }), async (argv) => {
63
+ const target = argv.target;
64
+ const here = !!argv.here || target === '.';
65
+ const name = argv.name ?? (target && target !== '.' ? target : undefined);
66
+ try {
67
+ const { generateProject } = await import('./functions/generate/projects/generate-project.js');
68
+ await generateProject({
69
+ name,
70
+ here,
71
+ starter: argv.starter,
72
+ projectId: argv['project-id'],
73
+ apiKey: argv['api-key'],
74
+ consoleApiUrl: argv['console-api-url'],
75
+ json: !!argv.json,
76
+ });
77
+ }
78
+ catch (err) {
79
+ (0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'INIT_FAILED');
80
+ }
81
+ })
82
+ .command('serve [path]', 'Start the local dev server, or run `serve list`', (args) => {
83
+ return args
84
+ .command('list', 'List running serves', () => { }, async (argv) => {
85
+ const { serveListCommand } = await import('./functions/serve/commands/list.js');
86
+ const output = (0, output_1.createOutput)(!!argv.json);
87
+ await serveListCommand(output);
88
+ })
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) => {
91
+ const { serveStopCommand } = await import('./functions/serve/commands/stop.js');
92
+ const output = (0, output_1.createOutput)(!!argv.json);
93
+ await serveStopCommand(output, { port: argv.port });
94
+ })
95
+ .option('port', { default: '8083' })
96
+ .option('open-browser', {
97
+ type: 'boolean',
98
+ describe: 'Open the welcome screen in a browser on start. Overrides openBrowser in dcupl.config.json.',
99
+ })
100
+ .positional('path', {
101
+ describe: 'path to serve',
102
+ default: 'dcupl',
103
+ });
104
+ }, async (argv) => {
105
+ if (argv._.length > 1 && (argv._[1] === 'list' || argv._[1] === 'stop'))
106
+ return;
107
+ const { bootstrap } = await import('./functions/serve/main.js');
108
+ bootstrap(argv);
109
+ })
110
+ .command('generate [type]', 'Generate models, types, schemas and more from your data', (args) => {
111
+ return args
112
+ .positional('type', {
113
+ describe: 'type of content to generate',
114
+ type: 'string',
115
+ choices: [
116
+ 'model',
117
+ 'script',
118
+ 'transformer',
119
+ 'operator',
120
+ 'typescript',
121
+ 'json-schema',
122
+ 'test-setup',
123
+ 'test',
124
+ 'test-config',
125
+ ],
126
+ })
127
+ .option('name', { describe: 'Name for model generation', type: 'string' })
128
+ .option('file-name', { describe: 'File name for generation', type: 'string' })
129
+ .option('operator', { describe: 'Operator name for operator generation', type: 'string' })
130
+ .option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
131
+ .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' });
136
+ }, async (argv) => {
137
+ const { generateFn } = await import('./functions/generate/files/generate-files.js');
138
+ generateFn(argv);
139
+ })
140
+ .command('schemas', 'Inspect dcupl schemas (models, loaders, workflows)', (args) => {
141
+ return args
142
+ .command('list', 'List available schemas', () => { }, (argv) => {
143
+ const output = (0, output_1.createOutput)(argv.json);
144
+ (0, command_js_1.schemasListCommand)(argv, output);
145
+ })
146
+ .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 })
148
+ .option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
149
+ const output = (0, output_1.createOutput)(argv.json);
150
+ (0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
151
+ })
152
+ .demandCommand(1);
153
+ }, () => { })
154
+ .command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
155
+ return yy
156
+ .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) => {
160
+ const { validateCommand } = await import('./functions/workflow/commands/validate.js');
161
+ const output = (0, output_1.createOutput)(!!argv.json);
162
+ try {
163
+ const deps = {};
164
+ if (argv.runner && !argv['local-only']) {
165
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
166
+ deps.client = mkClient();
167
+ }
168
+ await validateCommand(output, { file: argv.file, runner: argv.runner, localOnly: !!argv['local-only'] }, deps);
169
+ }
170
+ catch (err) {
171
+ output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
172
+ }
173
+ })
174
+ .command('list', 'List deployed Workflow v3 instances (uid / key / runner / version).', () => { }, async (argv) => {
175
+ const { listCommand } = await import('./functions/workflow/commands/list.js');
176
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
177
+ const output = (0, output_1.createOutput)(!!argv.json);
178
+ try {
179
+ await listCommand(output, mkClient());
180
+ }
181
+ catch (err) {
182
+ output.error(err.message, err.code || 'WORKFLOW_LIST_FAILED');
183
+ }
184
+ })
185
+ .command('get', 'Show one deployed workflow (template ref, variable overrides, resolved variables).', (a) => a.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' }), async (argv) => {
186
+ const { getCommand } = await import('./functions/workflow/commands/get.js');
187
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
188
+ const output = (0, output_1.createOutput)(!!argv.json);
189
+ try {
190
+ await getCommand(output, mkClient(), { id: argv.id });
191
+ }
192
+ catch (err) {
193
+ output.error(err.message, err.code || 'WORKFLOW_GET_FAILED');
194
+ }
195
+ })
196
+ .command('template', 'Show the template currently running on the runner (drift check vs. your local file).', (a) => a.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' }), async (argv) => {
197
+ const { templateCommand } = await import('./functions/workflow/commands/template.js');
198
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
199
+ const output = (0, output_1.createOutput)(!!argv.json);
200
+ try {
201
+ await templateCommand(output, mkClient(), { id: argv.id });
202
+ }
203
+ catch (err) {
204
+ output.error(err.message, err.code || 'WORKFLOW_TEMPLATE_FAILED');
205
+ }
206
+ })
207
+ .command('status', 'Show the live runner status of a deployed workflow.', (a) => a.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' }), async (argv) => {
208
+ const { statusCommand } = await import('./functions/workflow/commands/status.js');
209
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
210
+ const output = (0, output_1.createOutput)(!!argv.json);
211
+ try {
212
+ await statusCommand(output, mkClient(), { id: argv.id });
213
+ }
214
+ catch (err) {
215
+ output.error(err.message, err.code || 'WORKFLOW_STATUS_FAILED');
216
+ }
217
+ })
218
+ .command('history', 'List past executions of a deployed workflow (runId / status / started / duration).', (a) => a.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' }), async (argv) => {
219
+ const { historyCommand } = await import('./functions/workflow/commands/history.js');
220
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
221
+ const output = (0, output_1.createOutput)(!!argv.json);
222
+ try {
223
+ await historyCommand(output, mkClient(), { id: argv.id });
224
+ }
225
+ catch (err) {
226
+ output.error(err.message, err.code || 'WORKFLOW_HISTORY_FAILED');
227
+ }
228
+ })
229
+ .command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
230
+ .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) => {
232
+ const { traceCommand } = await import('./functions/workflow/commands/trace.js');
233
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
234
+ const output = (0, output_1.createOutput)(!!argv.json);
235
+ try {
236
+ await traceCommand(output, mkClient(), { id: argv.id, run: argv.run });
237
+ }
238
+ catch (err) {
239
+ output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
240
+ }
241
+ })
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) => {
245
+ const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
246
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
247
+ const output = (0, output_1.createOutput)(!!argv.json);
248
+ try {
249
+ await runnersCommand(output, mkClient());
250
+ }
251
+ catch (err) {
252
+ output.error(err.message, err.code || 'WORKFLOW_RUNNERS_LIST_FAILED');
253
+ }
254
+ })
255
+ .command('get', 'Show a single runner by uid.', (a) => a.option('id', { type: 'string', demandOption: true, describe: 'Runner uid' }), async (argv) => {
256
+ const { runnerGetCommand } = await import('./functions/workflow/commands/runners-get.js');
257
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
258
+ const output = (0, output_1.createOutput)(!!argv.json);
259
+ try {
260
+ await runnerGetCommand(output, mkClient(), { id: argv.id });
261
+ }
262
+ catch (err) {
263
+ output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
264
+ }
265
+ })
266
+ .demandCommand(1);
267
+ }, () => { })
268
+ .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)' })
271
+ .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' })
273
+ .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) => {
277
+ const { testCommand } = await import('./functions/workflow/commands/test.js');
278
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
279
+ const output = (0, output_1.createOutput)(!!argv.json);
280
+ try {
281
+ 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'],
286
+ });
287
+ }
288
+ catch (err) {
289
+ output.error(err.message, err.code || 'WORKFLOW_TEST_FAILED');
290
+ }
291
+ })
292
+ .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' })
295
+ .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) => {
298
+ const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
299
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
300
+ const output = (0, output_1.createOutput)(!!argv.json);
301
+ try {
302
+ await deployCommand(output, mkClient(), { file: argv.file, runner: argv.runner, yes: !!argv.yes, wait: argv.wait, swapTimeout: argv['swap-timeout'] });
303
+ }
304
+ catch (err) {
305
+ output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
306
+ }
307
+ })
308
+ .command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
309
+ .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) => {
311
+ const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
312
+ const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
313
+ const output = (0, output_1.createOutput)(!!argv.json);
314
+ try {
315
+ await undeployCommand(output, mkClient(), { workflowId: argv.id, yes: !!argv.yes });
316
+ }
317
+ catch (err) {
318
+ output.error(err.message, err.code || 'WORKFLOW_UNDEPLOY_FAILED');
319
+ }
320
+ })
321
+ .demandCommand(1);
322
+ }, () => { })
323
+ .command('files <subcommand>', 'Sync project files with the dcupl cloud (incremental, changed-only). Auth: run `dcupl config set` to configure projectId, apiKey, and (optionally) consoleApiUrl.', (yy) => {
324
+ return yy
325
+ .command('status', 'Show local vs. server differences for a version. Read-only, no transfer.', (a) => a
326
+ .option('version', {
327
+ alias: 'v',
328
+ type: 'string',
329
+ describe: 'Version id (defaults to HEAD, then "draft")',
330
+ })
331
+ .option('name', { type: 'string', hidden: true })
332
+ .option('path', {
333
+ type: 'array',
334
+ string: true,
335
+ describe: 'Restrict the sync to one or more files / folders / globs (relative to baseFolder). Repeatable. Composes with the config-level include/exclude. Example: --path models/ --path data/products.csv',
336
+ }), async (argv) => {
337
+ const { statusCommand } = await import('./functions/files/commands/status.js');
338
+ const { createApiClient } = await import('./functions/helper/api-client.js');
339
+ const { getConfigFileValue } = await import('./functions/helper/config.helper.js');
340
+ const output = (0, output_1.createOutput)(!!argv.json);
341
+ try {
342
+ const client = createApiClient();
343
+ const cfg = getConfigFileValue(process.cwd());
344
+ await statusCommand(client, output, {
345
+ workspaceRoot: process.cwd(),
346
+ baseFolder: cfg?.baseFolder || 'dcupl',
347
+ include: cfg?.filesUpload?.include || ['**/*.json', '**/*.csv', '**/*.js'],
348
+ exclude: cfg?.filesUpload?.exclude || [],
349
+ versionArg: (argv.version ?? argv.name),
350
+ paths: argv.path,
351
+ });
352
+ }
353
+ catch (err) {
354
+ output.error(err.message, err.code || 'STATUS_FAILED');
355
+ }
356
+ })
357
+ .command('push', 'Upload only the files that have changed since the last sync. Per-file conflict detection.', (a) => a
358
+ .option('version', {
359
+ alias: 'v',
360
+ type: 'string',
361
+ describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
362
+ })
363
+ .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.' })
367
+ .option('path', {
368
+ type: 'array',
369
+ string: true,
370
+ 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',
371
+ }), async (argv) => {
372
+ const { pushCommand } = await import('./functions/files/commands/push.js');
373
+ const { createApiClient } = await import('./functions/helper/api-client.js');
374
+ const { getConfigFileValue } = await import('./functions/helper/config.helper.js');
375
+ const output = (0, output_1.createOutput)(!!argv.json);
376
+ try {
377
+ const client = createApiClient();
378
+ const cfg = getConfigFileValue(process.cwd());
379
+ await pushCommand(client, output, {
380
+ workspaceRoot: process.cwd(),
381
+ baseFolder: cfg?.baseFolder || 'dcupl',
382
+ include: cfg?.filesUpload?.include || ['**/*.json', '**/*.csv', '**/*.js'],
383
+ exclude: cfg?.filesUpload?.exclude || [],
384
+ versionArg: (argv.version ?? argv.name),
385
+ mode: argv.strict ? 'strict' : 'additive',
386
+ yes: argv.yes,
387
+ force: argv.force,
388
+ paths: argv.path,
389
+ });
390
+ }
391
+ catch (err) {
392
+ output.error(err.message, err.code || 'PUSH_FAILED');
393
+ }
394
+ })
395
+ .command('pull', 'Download only the files that have changed on the server since the last sync. Per-file conflict detection.', (a) => a
396
+ .option('version', {
397
+ alias: 'v',
398
+ type: 'string',
399
+ describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
400
+ })
401
+ .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.' })
405
+ .option('path', {
406
+ type: 'array',
407
+ string: true,
408
+ 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',
409
+ }), async (argv) => {
410
+ const { pullCommand } = await import('./functions/files/commands/pull.js');
411
+ const { createApiClient } = await import('./functions/helper/api-client.js');
412
+ const { getConfigFileValue } = await import('./functions/helper/config.helper.js');
413
+ const output = (0, output_1.createOutput)(!!argv.json);
414
+ try {
415
+ const client = createApiClient();
416
+ const cfg = getConfigFileValue(process.cwd());
417
+ await pullCommand(client, output, {
418
+ workspaceRoot: process.cwd(),
419
+ baseFolder: cfg?.baseFolder || 'dcupl',
420
+ include: cfg?.filesUpload?.include || ['**/*.json', '**/*.csv', '**/*.js'],
421
+ exclude: cfg?.filesUpload?.exclude || [],
422
+ versionArg: (argv.version ?? argv.name),
423
+ mode: argv.strict ? 'strict' : 'additive',
424
+ yes: argv.yes,
425
+ force: argv.force,
426
+ paths: argv.path,
427
+ });
428
+ }
429
+ catch (err) {
430
+ output.error(err.message, err.code || 'PULL_FAILED');
431
+ }
432
+ })
433
+ .command('list', 'List files in a version', (a) => a
434
+ .option('version', { alias: 'v', type: 'string', describe: 'Version id (defaults to HEAD, then "draft")' })
435
+ .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) => {
437
+ const { listFilesCommand } = await import('./functions/files/commands/list.js');
438
+ const { createApiClient } = await import('./functions/helper/api-client.js');
439
+ const output = (0, output_1.createOutput)(!!argv.json);
440
+ try {
441
+ const client = createApiClient();
442
+ await listFilesCommand(client, output, {
443
+ version: argv.version,
444
+ search: argv.search,
445
+ workspaceRoot: process.cwd(),
446
+ tree: argv.tree,
447
+ });
448
+ }
449
+ catch (err) {
450
+ output.error(err.error || err.message, err.code || 'LIST_FAILED');
451
+ }
452
+ })
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) => {
456
+ const { readFileCommand } = await import('./functions/files/commands/read.js');
457
+ const { createApiClient } = await import('./functions/helper/api-client.js');
458
+ const output = (0, output_1.createOutput)(!!argv.json);
459
+ try {
460
+ const client = createApiClient();
461
+ await readFileCommand(client, output, {
462
+ path: argv.path,
463
+ version: argv.version,
464
+ workspaceRoot: process.cwd(),
465
+ });
466
+ }
467
+ catch (err) {
468
+ output.error(err.error || err.message, err.code || 'READ_FAILED');
469
+ }
470
+ })
471
+ .command('write', 'Write a single file to a version', (a) => a
472
+ .option('path', { type: 'string', demandOption: true, describe: 'File path' })
473
+ .option('content', { type: 'string', describe: 'Inline content to write' })
474
+ .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) => {
476
+ const { writeFileCommand } = await import('./functions/files/commands/write.js');
477
+ const { createApiClient } = await import('./functions/helper/api-client.js');
478
+ const output = (0, output_1.createOutput)(!!argv.json);
479
+ try {
480
+ const client = createApiClient();
481
+ await writeFileCommand(client, output, {
482
+ path: argv.path,
483
+ content: argv.content,
484
+ file: argv.file,
485
+ version: argv.version,
486
+ workspaceRoot: process.cwd(),
487
+ });
488
+ }
489
+ catch (err) {
490
+ output.error(err.error || err.message, err.code || 'WRITE_FAILED');
491
+ }
492
+ })
493
+ .command('delete', 'Delete a single file from a version', (a) => a
494
+ .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) => {
498
+ const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
499
+ const { createApiClient } = await import('./functions/helper/api-client.js');
500
+ const output = (0, output_1.createOutput)(!!argv.json);
501
+ try {
502
+ const client = createApiClient();
503
+ await deleteFileCommand(client, output, {
504
+ path: argv.path,
505
+ version: argv.version,
506
+ workspaceRoot: process.cwd(),
507
+ yes: argv.yes,
508
+ dryRun: argv['dry-run'],
509
+ });
510
+ }
511
+ catch (err) {
512
+ output.error(err.error || err.message, err.code || 'DELETE_FAILED');
513
+ }
514
+ })
515
+ .command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
516
+ .option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
517
+ .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) => {
521
+ const { moveFileCommand } = await import('./functions/files/commands/move.js');
522
+ const { createApiClient } = await import('./functions/helper/api-client.js');
523
+ const output = (0, output_1.createOutput)(!!argv.json);
524
+ try {
525
+ const client = createApiClient();
526
+ await moveFileCommand(client, output, {
527
+ from: argv.from,
528
+ to: argv.to,
529
+ version: argv.version,
530
+ workspaceRoot: process.cwd(),
531
+ yes: argv.yes,
532
+ dryRun: argv['dry-run'],
533
+ });
534
+ }
535
+ catch (err) {
536
+ output.error(err.error || err.message, err.code || 'MOVE_FAILED');
537
+ }
538
+ })
539
+ .command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
540
+ .option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
541
+ .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) => {
543
+ const { copyFileCommand } = await import('./functions/files/commands/copy.js');
544
+ const { createApiClient } = await import('./functions/helper/api-client.js');
545
+ const output = (0, output_1.createOutput)(!!argv.json);
546
+ try {
547
+ const client = createApiClient();
548
+ await copyFileCommand(client, output, {
549
+ from: argv.from,
550
+ to: argv.to,
551
+ version: argv.version,
552
+ workspaceRoot: process.cwd(),
553
+ });
554
+ }
555
+ catch (err) {
556
+ output.error(err.error || err.message, err.code || 'COPY_FAILED');
557
+ }
558
+ })
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) => {
562
+ const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
563
+ const { createApiClient } = await import('./functions/helper/api-client.js');
564
+ const output = (0, output_1.createOutput)(!!argv.json);
565
+ try {
566
+ const client = createApiClient();
567
+ await createFolderCommand(client, output, {
568
+ path: argv.path,
569
+ version: argv.version,
570
+ workspaceRoot: process.cwd(),
571
+ });
572
+ }
573
+ catch (err) {
574
+ output.error(err.error || err.message, err.code || 'CREATE_FOLDER_FAILED');
575
+ }
576
+ })
577
+ .command('versions <verb>', 'Manage project versions', (yyy) => yyy
578
+ .command(['list', '*'], 'List all versions', () => { }, async (argv) => {
579
+ const { listVersionsCommand } = await import('./functions/files/commands/versions/list.js');
580
+ const { createApiClient } = await import('./functions/helper/api-client.js');
581
+ const output = (0, output_1.createOutput)(!!argv.json);
582
+ try {
583
+ const client = createApiClient();
584
+ await listVersionsCommand(client, output);
585
+ }
586
+ catch (err) {
587
+ output.error(err.error || err.message, err.code || 'VERSIONS_LIST_FAILED');
588
+ }
589
+ })
590
+ .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) => {
595
+ const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
596
+ const { createApiClient } = await import('./functions/helper/api-client.js');
597
+ const output = (0, output_1.createOutput)(!!argv.json);
598
+ try {
599
+ const client = createApiClient();
600
+ await copyVersionCommand(client, output, {
601
+ from: argv.from,
602
+ to: argv.to,
603
+ yes: argv.yes,
604
+ dryRun: argv['dry-run'],
605
+ });
606
+ }
607
+ catch (err) {
608
+ output.error(err.error || err.message, err.code || 'VERSIONS_COPY_FAILED');
609
+ }
610
+ })
611
+ .command('delete <id>', 'Delete a version', (a) => a
612
+ .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) => {
615
+ const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
616
+ const { createApiClient } = await import('./functions/helper/api-client.js');
617
+ const output = (0, output_1.createOutput)(!!argv.json);
618
+ try {
619
+ const client = createApiClient();
620
+ await deleteVersionCommand(client, output, {
621
+ id: argv.id,
622
+ yes: argv.yes,
623
+ dryRun: argv['dry-run'],
624
+ });
625
+ }
626
+ catch (err) {
627
+ output.error(err.error || err.message, err.code || 'VERSIONS_DELETE_FAILED');
628
+ }
629
+ })
630
+ .demandCommand(1));
631
+ })
632
+ .command('config <subcommand>', 'Manage dcupl.config.json and dcupl.secrets.json (projectId, apiKey, consoleApiUrl)', (yy) => {
633
+ return yy
634
+ .command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
635
+ .option('project-id', { type: 'string', describe: 'dcupl Console project id' })
636
+ .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) => {
639
+ const { configSetCommand } = await import('./functions/config/commands/set.js');
640
+ try {
641
+ await configSetCommand({
642
+ projectId: argv['project-id'],
643
+ apiKey: argv['api-key'],
644
+ consoleApiUrl: argv['console-api-url'],
645
+ yes: argv.yes,
646
+ });
647
+ }
648
+ catch (err) {
649
+ console.error(err.message);
650
+ process.exit(1);
651
+ }
652
+ })
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) => {
655
+ const { configGetCommand } = await import('./functions/config/commands/get.js');
656
+ try {
657
+ await configGetCommand({
658
+ showSecrets: argv['show-secrets'],
659
+ json: !!argv.json,
660
+ });
661
+ }
662
+ catch (err) {
663
+ console.error(err.message);
664
+ process.exit(1);
665
+ }
666
+ })
667
+ .demandCommand(1);
668
+ })
669
+ .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)' })
671
+ .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.' })
673
+ .option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
674
+ .option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
675
+ .option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
676
+ .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)' })
678
+ .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) => {
683
+ const { validateCommand } = await import('./functions/app/commands/validate.js');
684
+ const output = (0, output_1.createOutput)(argv.json);
685
+ try {
686
+ await validateCommand(output, {
687
+ source: argv.source,
688
+ lcJson: argv['lc-json'],
689
+ autoServe: argv['auto-serve'],
690
+ projectId: argv['project-id'],
691
+ apiKey: argv['api-key'],
692
+ version: argv.version,
693
+ appKey: argv['app-key'],
694
+ env: argv.env,
695
+ tag: argv.tag,
696
+ var: argv.var,
697
+ limit: argv.limit,
698
+ maxMemoryMb: argv['max-memory'],
699
+ quality: argv.quality,
700
+ });
701
+ }
702
+ catch (err) {
703
+ output.error(err.message, err.code || 'VALIDATE_FAILED');
704
+ }
705
+ })
706
+ .command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
707
+ return yy
708
+ .command('create', 'Start a new daemon and register an app', (a) => a
709
+ .option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
710
+ .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.' })
716
+ .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)' })
720
+ .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' })
725
+ .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)' })
729
+ .option('api-key', { type: 'string', describe: 'Console API key (--load)' })
730
+ .option('version', { type: 'string', describe: 'Console version id (cdn loader source, default: draft)' })
731
+ .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)' })
737
+ .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) => {
741
+ const { createCommand } = await import('./functions/app/commands/create.js');
742
+ const output = (0, output_1.createOutput)(argv.json);
743
+ try {
744
+ await createCommand(output, {
745
+ appId: argv.app,
746
+ idleTimeoutMin: argv['idle-timeout'],
747
+ autoUpdate: argv['auto-update'],
748
+ autoGenerateProperties: argv.autoGenerateProperties,
749
+ autoGenerateDeep: argv.autoGenerateDeep,
750
+ autoGenerateSampleSize: argv.autoGenerateSampleSize,
751
+ quality: argv.quality,
752
+ cache: argv.cache,
753
+ clone: argv.clone,
754
+ analytics: argv.analytics,
755
+ referenceMetadata: argv['reference-metadata'],
756
+ loggingLevel: argv['logging-level'],
757
+ loggingFormat: argv['logging-format'],
758
+ maxMemoryMb: argv['max-memory'],
759
+ maxBody: argv['max-body'],
760
+ load: argv.load,
761
+ key: argv.key,
762
+ loadArgv: {
763
+ source: argv.source,
764
+ workspace: argv.workspace,
765
+ projectId: argv['project-id'],
766
+ apiKey: argv['api-key'],
767
+ version: argv.version,
768
+ baseUrl: argv['base-url'],
769
+ loaderFile: argv['loader-file'],
770
+ header: argv.header,
771
+ lcJson: argv['lc-json'],
772
+ autoServe: argv['auto-serve'],
773
+ autoServePort: parseAutoServePort(argv['auto-serve-port']),
774
+ },
775
+ processArgv: {
776
+ appKey: argv['app-key'],
777
+ env: argv.env,
778
+ tag: argv.tag,
779
+ var: argv.var,
780
+ },
781
+ });
782
+ }
783
+ catch (err) {
784
+ output.error(err.message, err.code || 'CREATE_FAILED');
785
+ }
786
+ })
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) => {
790
+ const { destroyCommand } = await import('./functions/app/commands/destroy.js');
791
+ const output = (0, output_1.createOutput)(argv.json);
792
+ try {
793
+ await destroyCommand(output, { appId: argv.app, keepLogs: argv['keep-logs'] });
794
+ }
795
+ catch (err) {
796
+ output.error(err.message, err.code || 'DESTROY_FAILED');
797
+ }
798
+ })
799
+ .command('list', 'List running apps', () => { }, async (argv) => {
800
+ const { listCommand } = await import('./functions/app/commands/list.js');
801
+ const output = (0, output_1.createOutput)(argv.json);
802
+ try {
803
+ await listCommand(output);
804
+ }
805
+ catch (err) {
806
+ output.error(err.message, err.code || 'LIST_FAILED');
807
+ }
808
+ })
809
+ .command('status', 'Show daemon status', (a) => a.option('app', { type: 'string' }), async (argv) => {
810
+ const { statusCommand } = await import('./functions/app/commands/status.js');
811
+ const output = (0, output_1.createOutput)(argv.json);
812
+ try {
813
+ await statusCommand(output, { appId: argv.app });
814
+ }
815
+ catch (err) {
816
+ output.error(err.message, err.code || 'STATUS_FAILED');
817
+ }
818
+ })
819
+ .command('build', 'Run dcupl.update() on the daemon', (a) => a.option('app', { type: 'string' }), async (argv) => {
820
+ const { buildCommand } = await import('./functions/app/commands/build.js');
821
+ const output = (0, output_1.createOutput)(argv.json);
822
+ try {
823
+ await buildCommand(output, { appId: argv.app });
824
+ }
825
+ catch (err) {
826
+ output.error(err.message, err.code || 'BUILD_FAILED');
827
+ }
828
+ })
829
+ .command('logs', "Show a daemon's log output (works on crashed apps)", (a) => a
830
+ .option('app', { type: 'string' })
831
+ .option('lines', { type: 'number', default: 100, describe: 'Max lines to show (tail of the log)' }), async (argv) => {
832
+ const { logsCommand } = await import('./functions/app/commands/logs.js');
833
+ const output = (0, output_1.createOutput)(argv.json);
834
+ try {
835
+ await logsCommand(output, { appId: argv.app, lines: argv.lines });
836
+ }
837
+ catch (err) {
838
+ output.error(err.message, err.code || 'LOGS_FAILED');
839
+ }
840
+ })
841
+ .command('models <verb>', 'Manage models', (yyy) => yyy
842
+ .command('keys', 'List model keys', (a) => a.option('app', { type: 'string' }), async (argv) => {
843
+ const { keysCommand } = await import('./functions/app/commands/models/keys.js');
844
+ const output = (0, output_1.createOutput)(argv.json);
845
+ try {
846
+ await keysCommand(output, { appId: argv.app });
847
+ }
848
+ catch (err) {
849
+ output.error(err.message, err.code || 'MODELS_KEYS_FAILED');
850
+ }
851
+ })
852
+ .command('get', 'Get a model definition', (a) => a.option('app', { type: 'string' }).option('model', { type: 'string', demandOption: true }), async (argv) => {
853
+ const { getCommand } = await import('./functions/app/commands/models/get.js');
854
+ const output = (0, output_1.createOutput)(argv.json);
855
+ try {
856
+ await getCommand(output, { appId: argv.app, model: argv.model });
857
+ }
858
+ catch (err) {
859
+ output.error(err.message, err.code || 'MODELS_GET_FAILED');
860
+ }
861
+ })
862
+ .command('set', 'Set a model from a JSON file or inline content', (a) => a
863
+ .option('app', { type: 'string' })
864
+ .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) => {
866
+ const { setCommand } = await import('./functions/app/commands/models/set.js');
867
+ const output = (0, output_1.createOutput)(argv.json);
868
+ try {
869
+ const content = argv.content !== undefined
870
+ ? (argv.content === '' && argv._.includes('-') ? '-' : argv.content)
871
+ : undefined;
872
+ await setCommand(output, { appId: argv.app, file: argv.file, content });
873
+ }
874
+ catch (err) {
875
+ output.error(err.message, err.code || 'MODELS_SET_FAILED');
876
+ }
877
+ })
878
+ .command('remove', 'Remove a model', (a) => a.option('app', { type: 'string' }).option('model', { type: 'string', demandOption: true }), async (argv) => {
879
+ const { removeCommand } = await import('./functions/app/commands/models/remove.js');
880
+ const output = (0, output_1.createOutput)(argv.json);
881
+ try {
882
+ await removeCommand(output, { appId: argv.app, model: argv.model });
883
+ }
884
+ catch (err) {
885
+ output.error(err.message, err.code || 'MODELS_REMOVE_FAILED');
886
+ }
887
+ })
888
+ .demandCommand(1))
889
+ .command('data <verb>', 'Ingest data', (yyy) => {
890
+ const dataOpts = (a) => a
891
+ .option('app', { type: 'string' })
892
+ .option('file', { type: 'string', describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest' })
893
+ .option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
894
+ .option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
895
+ .option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
896
+ .option('model', { type: 'string', demandOption: true })
897
+ .option('key-property', { type: 'string' })
898
+ .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)' });
902
+ const handler = (mod, exportName, code) => async (argv) => {
903
+ const m = await import(`./functions/app/commands/data/${mod}.js`);
904
+ const output = (0, output_1.createOutput)(argv.json);
905
+ try {
906
+ const content = argv.content !== undefined
907
+ ? (argv.content === '' && argv._.includes('-') ? '-' : argv.content)
908
+ : undefined;
909
+ 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,
912
+ autoGenerateProperties: argv.autoGenerateProperties,
913
+ autoGenerateDeep: argv.autoGenerateDeep,
914
+ autoGenerateSampleSize: argv.autoGenerateSampleSize,
915
+ });
916
+ }
917
+ catch (err) {
918
+ output.error(err.message, err.code || code);
919
+ }
920
+ };
921
+ return yyy
922
+ .command('update', 'Add/update records', dataOpts, handler('update', 'updateCommand', 'DATA_UPDATE_FAILED'))
923
+ .command('upsert', 'Upsert records', dataOpts, handler('upsert', 'upsertCommand', 'DATA_UPSERT_FAILED'))
924
+ .command('set', 'Replace all records for model', dataOpts, handler('set', 'setCommand', 'DATA_SET_FAILED'))
925
+ .command('remove', 'Remove records by key', dataOpts, handler('remove', 'removeCommand', 'DATA_REMOVE_FAILED'))
926
+ .command('reset', 'Drop all data for model', (a) => a.option('app', { type: 'string' }).option('model', { type: 'string', demandOption: true }), async (argv) => {
927
+ const { resetCommand } = await import('./functions/app/commands/data/reset.js');
928
+ const output = (0, output_1.createOutput)(argv.json);
929
+ try {
930
+ await resetCommand(output, { appId: argv.app, model: argv.model });
931
+ }
932
+ catch (err) {
933
+ output.error(err.message, err.code || 'DATA_RESET_FAILED');
934
+ }
935
+ })
936
+ .demandCommand(1);
937
+ })
938
+ .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) => {
940
+ const { oneCommand } = await import('./functions/app/commands/query/one.js');
941
+ const output = (0, output_1.createOutput)(argv.json);
942
+ try {
943
+ await oneCommand(output, { appId: argv.app, model: argv.model, itemKey: argv.itemKey });
944
+ }
945
+ catch (err) {
946
+ output.error(err.message, err.code || 'QUERY_ONE_FAILED');
947
+ }
948
+ })
949
+ .command('execute', 'Filter+sort+paginate records', (a) => a
950
+ .option('app', { type: 'string' })
951
+ .option('model', { type: 'string', demandOption: true })
952
+ .option('query', { type: 'string' })
953
+ .option('query-file', { type: 'string' })
954
+ .option('sort', { type: 'string' })
955
+ .option('limit', { type: 'number' })
956
+ .option('start', { type: 'number' })
957
+ .option('projection', { type: 'string' }), async (argv) => {
958
+ const { executeCommand } = await import('./functions/app/commands/query/execute.js');
959
+ const output = (0, output_1.createOutput)(argv.json);
960
+ try {
961
+ 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,
965
+ projection: argv.projection,
966
+ });
967
+ }
968
+ catch (err) {
969
+ output.error(err.message, err.code || 'QUERY_EXEC_FAILED');
970
+ }
971
+ })
972
+ .demandCommand(1))
973
+ .command('fn <verb>', 'Run analytical functions', (yyy) => yyy
974
+ .command('facets', 'Value distribution on attribute', (a) => a
975
+ .option('app', { type: 'string' })
976
+ .option('model', { type: 'string', demandOption: true })
977
+ .option('attribute', { type: 'string', demandOption: true })
978
+ .option('exclude-zeros', { type: 'boolean' })
979
+ .option('exclude-undefineds', { type: 'boolean' })
980
+ .option('query', { type: 'string' })
981
+ .option('query-file', { type: 'string' })
982
+ .option('limit', { type: 'number', describe: 'Top-N facets (passed to SDK as count)' })
983
+ .option('sort', {
984
+ type: 'string',
985
+ choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
986
+ describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
987
+ })
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) => {
990
+ const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
991
+ const output = (0, output_1.createOutput)(argv.json);
992
+ try {
993
+ 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,
997
+ });
998
+ }
999
+ catch (err) {
1000
+ output.error(err.message, err.code || 'FN_FACETS_FAILED');
1001
+ }
1002
+ })
1003
+ .command('aggregate', 'Aggregate stats on attribute', (a) => a
1004
+ .option('app', { type: 'string' })
1005
+ .option('model', { type: 'string', demandOption: true })
1006
+ .option('attribute', { type: 'string', demandOption: true })
1007
+ .option('types', { type: 'string', demandOption: true, describe: 'Comma-separated: distinct,count,sum,avg,min,max,group' })
1008
+ .option('query', { type: 'string' })
1009
+ .option('query-file', { type: 'string' })
1010
+ .option('include-keys', { type: 'boolean', default: false, describe: 'Include row keys in distinct results' }), async (argv) => {
1011
+ const { aggregateCommand } = await import('./functions/app/commands/fn/aggregate.js');
1012
+ const output = (0, output_1.createOutput)(argv.json);
1013
+ 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 });
1015
+ }
1016
+ catch (err) {
1017
+ output.error(err.message, err.code || 'FN_AGGREGATE_FAILED');
1018
+ }
1019
+ })
1020
+ .command('groupBy', 'Group records by attribute value', (a) => a
1021
+ .option('app', { type: 'string' })
1022
+ .option('model', { type: 'string', demandOption: true })
1023
+ .option('attribute', { type: 'string', demandOption: true })
1024
+ .option('query', { type: 'string' })
1025
+ .option('query-file', { type: 'string' })
1026
+ .option('aggregate', { type: 'array', describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.' }), async (argv) => {
1027
+ const { groupByCommand } = await import('./functions/app/commands/fn/group-by.js');
1028
+ const output = (0, output_1.createOutput)(argv.json);
1029
+ try {
1030
+ await groupByCommand(output, { appId: argv.app, model: argv.model, attribute: argv.attribute, query: argv.query, queryFile: argv.queryFile, aggregate: argv.aggregate });
1031
+ }
1032
+ catch (err) {
1033
+ output.error(err.message, err.code || 'FN_GROUPBY_FAILED');
1034
+ }
1035
+ })
1036
+ .command('metadata', 'List metadata + currentSize for model', (a) => a
1037
+ .option('app', { type: 'string' })
1038
+ .option('model', { type: 'string', demandOption: true })
1039
+ .option('query', { type: 'string' })
1040
+ .option('query-file', { type: 'string' }), async (argv) => {
1041
+ const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
1042
+ const output = (0, output_1.createOutput)(argv.json);
1043
+ try {
1044
+ await metadataCommand(output, { appId: argv.app, model: argv.model, query: argv.query, queryFile: argv.queryFile });
1045
+ }
1046
+ catch (err) {
1047
+ output.error(err.message, err.code || 'FN_METADATA_FAILED');
1048
+ }
1049
+ })
1050
+ .demandCommand(1))
1051
+ .command('loaders <subcommand>', 'Manage loaders on a daemon', (yyy) => yyy
1052
+ .command('add', 'Register a loader source', (a) => a
1053
+ .option('app', { type: 'string', describe: 'App id' })
1054
+ .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' })
1056
+ .option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
1057
+ .option('project-id', { type: 'string', describe: 'dcupl Console project id (cdn source)' })
1058
+ .option('api-key', { type: 'string', describe: 'Console API key' })
1059
+ .option('version', { type: 'string', describe: 'Console version id (cdn source, default: draft)' })
1060
+ .option('base-url', { type: 'string', describe: 'Custom base URL source' })
1061
+ .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)' })
1063
+ .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) => {
1066
+ const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
1067
+ const output = (0, output_1.createOutput)(argv.json);
1068
+ try {
1069
+ await addLoaderCommand(output, {
1070
+ appId: argv.app,
1071
+ key: argv.key,
1072
+ argv: {
1073
+ source: argv.source,
1074
+ workspace: argv.workspace,
1075
+ projectId: argv['project-id'],
1076
+ apiKey: argv['api-key'],
1077
+ version: argv.version,
1078
+ baseUrl: argv['base-url'],
1079
+ loaderFile: argv['loader-file'],
1080
+ header: argv.header,
1081
+ lcJson: argv['lc-json'],
1082
+ autoServe: argv['auto-serve'],
1083
+ autoServePort: parseAutoServePort(argv['auto-serve-port']),
1084
+ },
1085
+ });
1086
+ }
1087
+ catch (err) {
1088
+ output.error(err.message, err.code || 'LOADERS_ADD_FAILED');
1089
+ }
1090
+ })
1091
+ .command('process', 'Process (re-load) a loader', (a) => a
1092
+ .option('app', { type: 'string', describe: 'App id' })
1093
+ .option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
1094
+ .option('app-key', { type: 'string', describe: 'Application key' })
1095
+ .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)' })
1097
+ .option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
1098
+ const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
1099
+ const output = (0, output_1.createOutput)(argv.json);
1100
+ try {
1101
+ await processLoaderCommand(output, {
1102
+ appId: argv.app,
1103
+ loader: argv.loader,
1104
+ argv: {
1105
+ appKey: argv['app-key'],
1106
+ env: argv.env,
1107
+ tag: argv.tag,
1108
+ var: argv.var,
1109
+ },
1110
+ });
1111
+ }
1112
+ catch (err) {
1113
+ output.error(err.message, err.code || 'LOADERS_PROCESS_FAILED');
1114
+ }
1115
+ })
1116
+ .command('list', 'List registered loaders', (a) => a.option('app', { type: 'string', describe: 'App id' }), async (argv) => {
1117
+ const { listLoadersCommand } = await import('./functions/app/commands/loaders/list.js');
1118
+ const output = (0, output_1.createOutput)(argv.json);
1119
+ try {
1120
+ await listLoadersCommand(output, { appId: argv.app });
1121
+ }
1122
+ catch (err) {
1123
+ output.error(err.message, err.code || 'LOADERS_LIST_FAILED');
1124
+ }
1125
+ })
1126
+ .command('get', 'Get loader detail', (a) => a
1127
+ .option('app', { type: 'string', describe: 'App id' })
1128
+ .option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' }), async (argv) => {
1129
+ const { getLoaderCommand } = await import('./functions/app/commands/loaders/get.js');
1130
+ const output = (0, output_1.createOutput)(argv.json);
1131
+ try {
1132
+ await getLoaderCommand(output, { appId: argv.app, loader: argv.loader });
1133
+ }
1134
+ catch (err) {
1135
+ output.error(err.message, err.code || 'LOADERS_GET_FAILED');
1136
+ }
1137
+ })
1138
+ .command('remove', 'Remove a loader', (a) => a
1139
+ .option('app', { type: 'string', describe: 'App id' })
1140
+ .option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' }), async (argv) => {
1141
+ const { removeLoaderCommand } = await import('./functions/app/commands/loaders/remove.js');
1142
+ const output = (0, output_1.createOutput)(argv.json);
1143
+ try {
1144
+ await removeLoaderCommand(output, { appId: argv.app, loader: argv.loader });
1145
+ }
1146
+ catch (err) {
1147
+ output.error(err.message, err.code || 'LOADERS_REMOVE_FAILED');
1148
+ }
1149
+ })
1150
+ .demandCommand(1))
1151
+ .demandCommand(1);
1152
+ }, () => { })
1153
+ .command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
1154
+ (0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
1155
+ })
1156
+ .command(['welcome', 'hey', 'rocks', '🚀'], 'You are awesome!', () => { }, async (_argv) => {
1157
+ const { welcomeFn } = await import('./functions/welcome.js');
1158
+ welcomeFn();
1159
+ })
1160
+ .command('test', '[experimental] Run generic tests', (args) => {
1161
+ return args
1162
+ .option('base-url', {
1163
+ describe: 'Base URL of the running dcupl instance to test against',
1164
+ default: 'http://localhost:8083',
1165
+ })
1166
+ .option('loader-file-name', {
1167
+ describe: 'Loader configuration file name (dcupl.lc.json)',
1168
+ default: 'dcupl.lc.json',
1169
+ })
1170
+ .option('application-key', {
1171
+ describe: 'The App key you want to test',
1172
+ default: 'default',
1173
+ })
1174
+ .option('environment-key', {
1175
+ describe: 'Environment key to run the tests in (empty for the default environment)',
1176
+ default: '',
1177
+ });
1178
+ }, (_argv) => {
1179
+ })
1180
+ .command('files:push', 'Upload files — deprecated, use `dcupl files push`', (args) => {
1181
+ return args.option('name', {
1182
+ describe: 'The name of your version. Default is the current Date as ISO-string',
1183
+ default: '',
1184
+ });
1185
+ }, async (argv) => {
1186
+ const output = (0, output_1.createOutput)(argv.json);
1187
+ if (!output.isJson()) {
1188
+ 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`);
1191
+ }
1192
+ const { pushFiles } = await import('./functions/files/files-push.js');
1193
+ pushFiles(argv, output);
1194
+ })
1195
+ .command('files:pull', 'Download files — deprecated, use `dcupl files pull`', (args) => {
1196
+ return args.option('name', {
1197
+ describe: 'The name of your version. Default is the current Date as ISO-string',
1198
+ default: '',
1199
+ });
1200
+ }, async (argv) => {
1201
+ const output = (0, output_1.createOutput)(argv.json);
1202
+ if (!output.isJson()) {
1203
+ 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`);
1207
+ }
1208
+ const { pullFiles } = await import('./functions/files/files-pull.js');
1209
+ pullFiles(argv, output);
1210
+ })
1211
+ .command('files:copy', 'Copy files between versions — deprecated, use `dcupl files versions copy`', (args) => {
1212
+ return args
1213
+ .option('from', { describe: 'Origin version id', default: '' })
1214
+ .option('to', { describe: 'Target version id', default: '' });
1215
+ }, async (argv) => {
1216
+ const output = (0, output_1.createOutput)(!!argv.json);
1217
+ if (!output.isJson()) {
1218
+ process.stderr.write(`⚠️ Deprecation: 'dcupl files:copy' is deprecated and will be removed in a future release.\n` +
1219
+ ` Use 'dcupl files versions copy --from <v> --to <v>' instead.\n`);
1220
+ }
1221
+ try {
1222
+ const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
1223
+ const client = (0, api_client_1.createApiClient)();
1224
+ await copyVersionCommand(client, output, { from: argv.from, to: argv.to, yes: true, dryRun: false });
1225
+ }
1226
+ catch (err) {
1227
+ output.error(err.error || err.message, err.code || 'UNKNOWN');
1228
+ }
1229
+ })
1230
+ .command('files:versions', 'List uploaded versions — deprecated, use `dcupl files versions list`', () => { }, async (argv) => {
1231
+ const output = (0, output_1.createOutput)(!!argv.json);
1232
+ if (!output.isJson()) {
1233
+ process.stderr.write(`⚠️ Deprecation: 'dcupl files:versions' is deprecated and will be removed in a future release.\n` +
1234
+ ` Use 'dcupl files versions list' instead.\n`);
1235
+ }
1236
+ try {
1237
+ const { listVersionsCommand } = await import('./functions/files/commands/versions/list.js');
1238
+ const client = (0, api_client_1.createApiClient)();
1239
+ await listVersionsCommand(client, output);
1240
+ }
1241
+ catch (err) {
1242
+ output.error(err.error || err.message, err.code || 'UNKNOWN');
1243
+ }
1244
+ })
1245
+ .demandCommand(1);
1246
+ }
1247
+ //# sourceMappingURL=cli.js.map