@aifabrix/builder 2.43.0 → 2.44.1

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 (371) hide show
  1. package/.cursor/rules/anchor-docs.mdc +15 -0
  2. package/.cursor/rules/cli-layout.mdc +75 -0
  3. package/.cursor/rules/project-rules.mdc +8 -0
  4. package/.npmrc.token +1 -0
  5. package/.nyc_output/55e9d034-ddab-4579-a706-e02a91d75c91.json +1 -0
  6. package/.nyc_output/processinfo/55e9d034-ddab-4579-a706-e02a91d75c91.json +1 -0
  7. package/.nyc_output/processinfo/index.json +1 -0
  8. package/README.md +1 -1
  9. package/anchor-docs/README.md +10 -0
  10. package/anchor-docs/_TEMPLATE +24 -0
  11. package/bin/aifabrix.js +13 -4
  12. package/integration/hubspot-test/README.md +31 -0
  13. package/integration/hubspot-test/create-hubspot.js +5 -5
  14. package/integration/hubspot-test/hubspot-test-datasource-company.json +58 -462
  15. package/integration/hubspot-test/hubspot-test-datasource-contact.json +61 -555
  16. package/integration/hubspot-test/hubspot-test-datasource-deal.json +63 -506
  17. package/integration/hubspot-test/hubspot-test-datasource-users.json +42 -83
  18. package/integration/hubspot-test/hubspot-test-deploy.json +3 -3
  19. package/integration/hubspot-test/test-dataplane-down-tests.js +1 -7
  20. package/integration/hubspot-test/test-dataplane-down.js +3 -3
  21. package/integration/hubspot-test/test.js +35 -43
  22. package/integration/hubspot-test/wizard-hubspot-test-headless.yaml +23 -0
  23. package/integration/roundtrip-test-local/README.md +144 -0
  24. package/integration/roundtrip-test-local/application.yaml +13 -0
  25. package/integration/roundtrip-test-local/env.template +15 -0
  26. package/integration/roundtrip-test-local/roundtrip-test-local-datasource-roundtrip-test-company.yaml +14 -0
  27. package/integration/roundtrip-test-local/roundtrip-test-local-deploy.json +61 -0
  28. package/integration/roundtrip-test-local/roundtrip-test-local-system.yaml +25 -0
  29. package/integration/roundtrip-test-local2/README.md +144 -0
  30. package/integration/roundtrip-test-local2/application.yaml +13 -0
  31. package/integration/roundtrip-test-local2/env.template +15 -0
  32. package/integration/roundtrip-test-local2/roundtrip-test-local2-datasource-company.yaml +31 -0
  33. package/integration/roundtrip-test-local2/roundtrip-test-local2-deploy.json +86 -0
  34. package/integration/roundtrip-test-local2/roundtrip-test-local2-system.yaml +25 -0
  35. package/integration/test/wizard.yaml +8 -0
  36. package/jest.config.default.js +10 -0
  37. package/jest.config.integration.fixtures.js +22 -0
  38. package/jest.config.integration.js +21 -18
  39. package/jest.config.isolated.js +10 -0
  40. package/jest.projects.js +301 -0
  41. package/lib/api/certificates.api.js +62 -0
  42. package/lib/api/datasources-core.api.js +3 -3
  43. package/lib/api/dev-mtls-request.js +110 -0
  44. package/lib/api/dev-server-https.js +145 -0
  45. package/lib/api/dev.api.js +133 -144
  46. package/lib/api/index.js +11 -3
  47. package/lib/api/pipeline.api.js +67 -20
  48. package/lib/api/types/certificates.types.js +48 -0
  49. package/lib/api/types/dev.types.js +4 -3
  50. package/lib/api/types/pipeline.types.js +8 -5
  51. package/lib/api/types/validation-run.types.js +56 -0
  52. package/lib/api/validation-run.api.js +111 -0
  53. package/lib/api/validation-runner.js +109 -0
  54. package/lib/app/certification-show-enrich.js +129 -0
  55. package/lib/app/certification-verify-rows.js +60 -0
  56. package/lib/app/config.js +1 -1
  57. package/lib/app/deploy-status-display.js +2 -2
  58. package/lib/app/deploy.js +7 -6
  59. package/lib/app/display.js +2 -1
  60. package/lib/app/dockerfile.js +3 -2
  61. package/lib/app/down.js +2 -1
  62. package/lib/app/helpers.js +6 -5
  63. package/lib/app/index.js +27 -8
  64. package/lib/app/list.js +7 -6
  65. package/lib/app/push.js +4 -3
  66. package/lib/app/register.js +16 -7
  67. package/lib/app/rotate-secret.js +14 -13
  68. package/lib/app/run-container-start.js +184 -0
  69. package/lib/app/run-docker-fallback.js +108 -0
  70. package/lib/app/run-env-compose.js +30 -42
  71. package/lib/app/run-helpers.js +49 -126
  72. package/lib/app/run-infra-requirements.js +30 -0
  73. package/lib/app/run-resolve-image.js +21 -0
  74. package/lib/app/run.js +74 -21
  75. package/lib/app/show-display.js +44 -1
  76. package/lib/app/show.js +93 -9
  77. package/lib/build/index.js +13 -10
  78. package/lib/certification/cli-cert-sync-skip.js +21 -0
  79. package/lib/certification/merge-certification-from-artifact.js +185 -0
  80. package/lib/certification/post-unified-cert-sync.js +33 -0
  81. package/lib/certification/sync-after-external-command.js +52 -0
  82. package/lib/certification/sync-system-certification.js +197 -0
  83. package/lib/cli/index.js +2 -0
  84. package/lib/cli/setup-app.help.js +67 -0
  85. package/lib/cli/setup-app.js +61 -121
  86. package/lib/cli/setup-app.test-commands.js +195 -0
  87. package/lib/cli/setup-auth.js +19 -5
  88. package/lib/cli/setup-credential-deployment.js +22 -8
  89. package/lib/cli/setup-dev-path-commands.js +124 -0
  90. package/lib/cli/setup-dev.js +170 -113
  91. package/lib/cli/setup-environment.js +7 -1
  92. package/lib/cli/setup-external-system.js +84 -23
  93. package/lib/cli/setup-infra.js +126 -47
  94. package/lib/cli/setup-parameters.js +32 -0
  95. package/lib/cli/setup-secrets.js +137 -18
  96. package/lib/cli/setup-service-user.js +1 -1
  97. package/lib/cli/setup-utility.js +54 -22
  98. package/lib/commands/app-down.js +5 -7
  99. package/lib/commands/app-install.js +14 -7
  100. package/lib/commands/app-logs.js +13 -10
  101. package/lib/commands/app-shell.js +4 -1
  102. package/lib/commands/app-test.js +25 -19
  103. package/lib/commands/app.js +32 -11
  104. package/lib/commands/auth-config.js +6 -6
  105. package/lib/commands/auth-status.js +4 -3
  106. package/lib/commands/credential-env.js +4 -3
  107. package/lib/commands/credential-list.js +5 -4
  108. package/lib/commands/credential-push.js +4 -3
  109. package/lib/commands/datasource-unified-test-cli.js +428 -0
  110. package/lib/commands/datasource-unified-test-cli.options.js +191 -0
  111. package/lib/commands/datasource-unified-test-e2e-cli-helpers.js +106 -0
  112. package/lib/commands/datasource-validation-cli.js +143 -0
  113. package/lib/commands/datasource.js +125 -95
  114. package/lib/commands/deployment-list.js +6 -5
  115. package/lib/commands/dev-cli-handlers.js +122 -18
  116. package/lib/commands/dev-down.js +4 -3
  117. package/lib/commands/dev-init.js +231 -116
  118. package/lib/commands/dev-show-display.js +473 -0
  119. package/lib/commands/login-credentials.js +3 -2
  120. package/lib/commands/login-device.js +4 -3
  121. package/lib/commands/login.js +5 -4
  122. package/lib/commands/logout.js +8 -7
  123. package/lib/commands/parameters-validate.js +54 -0
  124. package/lib/commands/repair-datasource.js +314 -68
  125. package/lib/commands/repair-env-template.js +2 -2
  126. package/lib/commands/repair.js +21 -3
  127. package/lib/commands/secrets-list.js +23 -12
  128. package/lib/commands/secrets-remove-all.js +220 -0
  129. package/lib/commands/secrets-remove.js +21 -12
  130. package/lib/commands/secrets-set.js +21 -12
  131. package/lib/commands/secrets-validate.js +4 -4
  132. package/lib/commands/secure.js +10 -9
  133. package/lib/commands/service-user.js +26 -25
  134. package/lib/commands/test-e2e-external.js +27 -1
  135. package/lib/commands/up-common.js +3 -2
  136. package/lib/commands/up-dataplane.js +29 -16
  137. package/lib/commands/up-miso.js +19 -29
  138. package/lib/commands/upload.js +149 -39
  139. package/lib/commands/wizard-core-helpers.js +1 -1
  140. package/lib/commands/wizard-dataplane.js +4 -3
  141. package/lib/commands/wizard-helpers.js +3 -3
  142. package/lib/commands/wizard.js +2 -2
  143. package/lib/core/admin-secrets.js +14 -5
  144. package/lib/core/audit-logger.js +12 -4
  145. package/lib/core/config-attach-extensions.js +46 -0
  146. package/lib/core/config-runtime-paths.js +29 -0
  147. package/lib/core/config.js +55 -56
  148. package/lib/core/diff.js +3 -2
  149. package/lib/core/ensure-encryption-key.js +1 -1
  150. package/lib/core/secrets-ensure-infra.js +77 -0
  151. package/lib/core/secrets-ensure.js +120 -64
  152. package/lib/core/secrets-env-write.js +35 -7
  153. package/lib/core/secrets-infra-placeholder-sync.js +61 -0
  154. package/lib/core/secrets.js +200 -37
  155. package/lib/core/templates-env.js +4 -3
  156. package/lib/datasource/abac-validator.js +1 -10
  157. package/lib/datasource/deploy.js +75 -53
  158. package/lib/datasource/field-reference-validator.js +9 -6
  159. package/lib/datasource/integration-context.js +63 -0
  160. package/lib/datasource/list.js +8 -7
  161. package/lib/datasource/log-viewer.js +189 -67
  162. package/lib/datasource/resolve-app.js +4 -4
  163. package/lib/datasource/test-e2e.js +113 -146
  164. package/lib/datasource/test-integration.js +114 -122
  165. package/lib/datasource/unified-validation-run-body.js +68 -0
  166. package/lib/datasource/unified-validation-run-post.js +23 -0
  167. package/lib/datasource/unified-validation-run-resolve.js +43 -0
  168. package/lib/datasource/unified-validation-run.js +93 -0
  169. package/lib/datasource/validate.js +157 -13
  170. package/lib/deployment/deployer.js +4 -3
  171. package/lib/deployment/environment.js +7 -6
  172. package/lib/deployment/push.js +17 -8
  173. package/lib/external-system/delete.js +4 -3
  174. package/lib/external-system/deploy.js +166 -53
  175. package/lib/external-system/download-helpers.js +1 -1
  176. package/lib/external-system/download.js +7 -6
  177. package/lib/external-system/generator.js +92 -6
  178. package/lib/external-system/integration-test-dispatch.js +26 -0
  179. package/lib/external-system/test-execution.js +5 -1
  180. package/lib/external-system/test-helpers.js +0 -4
  181. package/lib/external-system/test-system-level-helpers.js +110 -0
  182. package/lib/external-system/test-system-level.js +83 -44
  183. package/lib/external-system/test.js +59 -8
  184. package/lib/generator/builders.js +23 -11
  185. package/lib/generator/deploy-manifest-azure-kv.js +81 -0
  186. package/lib/generator/external.js +16 -4
  187. package/lib/generator/helpers.js +58 -3
  188. package/lib/generator/index.js +4 -0
  189. package/lib/generator/split-readme.js +12 -7
  190. package/lib/generator/split-variables.js +2 -1
  191. package/lib/generator/split.js +1 -1
  192. package/lib/generator/wizard-readme.js +3 -3
  193. package/lib/generator/wizard.js +8 -8
  194. package/lib/infrastructure/compose.js +70 -7
  195. package/lib/infrastructure/helpers-docker-check.js +67 -0
  196. package/lib/infrastructure/helpers.js +203 -42
  197. package/lib/infrastructure/index.js +31 -18
  198. package/lib/infrastructure/services.js +21 -67
  199. package/lib/internal/fs-real-sync.js +104 -0
  200. package/lib/internal/node-fs.js +98 -0
  201. package/lib/parameters/database-secret-values.js +173 -0
  202. package/lib/parameters/infra-kv-discovery.js +121 -0
  203. package/lib/parameters/infra-parameter-catalog.js +458 -0
  204. package/lib/parameters/infra-parameter-validate.js +64 -0
  205. package/lib/schema/application-schema.json +37 -17
  206. package/lib/schema/datasource-test-run.schema.json +493 -0
  207. package/lib/schema/deployment-rules.yaml +102 -63
  208. package/lib/schema/external-datasource.schema.json +1200 -442
  209. package/lib/schema/external-system.schema.json +203 -5
  210. package/lib/schema/flag-map-validation-run.json +31 -0
  211. package/lib/schema/infra-parameter.schema.json +106 -0
  212. package/lib/schema/infra.parameter.yaml +421 -0
  213. package/lib/schema/type/credential-auth-templates.json +40 -0
  214. package/lib/schema/type/document-storage.json +226 -0
  215. package/lib/schema/type/message-service.json +123 -0
  216. package/lib/schema/type/vector-store.json +88 -0
  217. package/lib/utils/aifabrix-runtime-config-dir.js +132 -0
  218. package/lib/utils/api-error-handler.js +2 -2
  219. package/lib/utils/api.js +77 -17
  220. package/lib/utils/app-register-api.js +3 -2
  221. package/lib/utils/app-register-auth.js +1 -1
  222. package/lib/utils/app-register-config.js +4 -4
  223. package/lib/utils/app-register-display.js +3 -2
  224. package/lib/utils/app-register-validator.js +3 -2
  225. package/lib/utils/app-run-containers.js +26 -22
  226. package/lib/utils/app-scoped-config.js +31 -0
  227. package/lib/utils/app-service-env-from-builder.js +164 -0
  228. package/lib/utils/build-copy.js +1 -1
  229. package/lib/utils/build-helpers.js +20 -20
  230. package/lib/utils/build-resolve-image.js +165 -0
  231. package/lib/utils/cli-layout-chalk.js +8 -0
  232. package/lib/utils/cli-test-layout-chalk.js +267 -0
  233. package/lib/utils/cli-utils.js +88 -11
  234. package/lib/utils/compose-db-passwords.js +138 -0
  235. package/lib/utils/compose-generate-docker-compose.js +216 -0
  236. package/lib/utils/compose-generator.js +197 -291
  237. package/lib/utils/compose-miso-env.js +18 -0
  238. package/lib/utils/compose-traefik-ingress-base.js +158 -0
  239. package/lib/utils/config-paths.js +166 -7
  240. package/lib/utils/config-scoped-resources-preference.js +41 -0
  241. package/lib/utils/configuration-env-resolver.js +11 -8
  242. package/lib/utils/controller-deployment-outcome.js +68 -0
  243. package/lib/utils/credential-display.js +2 -2
  244. package/lib/utils/credential-secrets-env.js +5 -5
  245. package/lib/utils/dataplane-pipeline-warning.js +4 -3
  246. package/lib/utils/datasource-test-run-capability-scope.js +43 -0
  247. package/lib/utils/datasource-test-run-certificate-tty.js +82 -0
  248. package/lib/utils/datasource-test-run-debug-display.js +137 -0
  249. package/lib/utils/datasource-test-run-debug-slice.js +93 -0
  250. package/lib/utils/datasource-test-run-display.js +459 -0
  251. package/lib/utils/datasource-test-run-exit.js +83 -0
  252. package/lib/utils/datasource-test-run-legacy-adapter.js +93 -0
  253. package/lib/utils/datasource-test-run-report-version.js +51 -0
  254. package/lib/utils/datasource-test-run-schema-sync.js +59 -0
  255. package/lib/utils/datasource-test-run-tty-log.js +81 -0
  256. package/lib/utils/datasource-validation-watch.js +266 -0
  257. package/lib/utils/declarative-url-ports.js +47 -0
  258. package/lib/utils/derive-env-key-from-client-id.js +41 -0
  259. package/lib/utils/dev-ca-install.js +185 -23
  260. package/lib/utils/dev-cert-helper.js +266 -17
  261. package/lib/utils/dev-hosts-helper.js +307 -0
  262. package/lib/utils/dev-init-cert-hints.js +37 -0
  263. package/lib/utils/dev-init-health-messages.js +52 -0
  264. package/lib/utils/dev-init-resolve.js +86 -0
  265. package/lib/utils/dev-init-ssh-merge.js +65 -0
  266. package/lib/utils/dev-ssh-config-helper.js +196 -0
  267. package/lib/utils/dev-user-groups.js +93 -0
  268. package/lib/utils/docker-build.js +42 -17
  269. package/lib/utils/docker-exec.js +28 -0
  270. package/lib/utils/docker-manifest-public-port.js +116 -0
  271. package/lib/utils/docker-not-running-hint.js +52 -0
  272. package/lib/utils/docker.js +98 -11
  273. package/lib/utils/ensure-dev-certs-for-remote-docker.js +192 -0
  274. package/lib/utils/env-config-loader.js +10 -91
  275. package/lib/utils/env-copy.js +19 -10
  276. package/lib/utils/env-map.js +35 -8
  277. package/lib/utils/env-template.js +2 -2
  278. package/lib/utils/environment-scoped-resources.js +144 -0
  279. package/lib/utils/error-formatter.js +92 -13
  280. package/lib/utils/error-formatters/http-status-errors.js +6 -5
  281. package/lib/utils/error-formatters/network-errors.js +2 -1
  282. package/lib/utils/error-formatters/permission-errors.js +2 -1
  283. package/lib/utils/error-formatters/validation-errors.js +2 -1
  284. package/lib/utils/external-readme.js +8 -1
  285. package/lib/utils/external-system-display.js +242 -136
  286. package/lib/utils/external-system-local-test-tty.js +389 -0
  287. package/lib/utils/external-system-readiness-core.js +377 -0
  288. package/lib/utils/external-system-readiness-deploy-display.js +270 -0
  289. package/lib/utils/external-system-readiness-display-internals.js +150 -0
  290. package/lib/utils/external-system-readiness-display.js +186 -0
  291. package/lib/utils/external-system-system-test-tty-overview.js +120 -0
  292. package/lib/utils/external-system-system-test-tty.js +417 -0
  293. package/lib/utils/external-system-test-helpers.js +24 -6
  294. package/lib/utils/external-system-validators.js +30 -12
  295. package/lib/utils/health-check-url.js +119 -0
  296. package/lib/utils/health-check.js +59 -25
  297. package/lib/utils/help-builder.js +11 -8
  298. package/lib/utils/image-version.js +4 -8
  299. package/lib/utils/infra-containers.js +4 -7
  300. package/lib/utils/infra-env-defaults.js +162 -0
  301. package/lib/utils/infra-status-display.js +167 -0
  302. package/lib/utils/infra-status.js +16 -8
  303. package/lib/utils/local-secrets.js +3 -4
  304. package/lib/utils/paths.js +148 -47
  305. package/lib/utils/port-resolver.js +10 -23
  306. package/lib/utils/redis-env-scope.js +62 -0
  307. package/lib/utils/register-aifabrix-shell-env.js +204 -0
  308. package/lib/utils/remote-builder-validation.js +99 -0
  309. package/lib/utils/remote-dev-auth.js +117 -21
  310. package/lib/utils/remote-docker-env.js +67 -15
  311. package/lib/utils/remote-secrets-loader.js +13 -4
  312. package/lib/utils/resolve-docker-image-ref.js +124 -0
  313. package/lib/utils/schema-loader.js +22 -9
  314. package/lib/utils/secrets-bash-kv.js +25 -0
  315. package/lib/utils/secrets-generator.js +169 -49
  316. package/lib/utils/secrets-helpers.js +70 -59
  317. package/lib/utils/secrets-kv-scope.js +60 -0
  318. package/lib/utils/secrets-utils.js +32 -38
  319. package/lib/utils/secrets-validation.js +3 -1
  320. package/lib/utils/secrets-yaml-preserve.js +109 -0
  321. package/lib/utils/ssh-key-helper.js +4 -2
  322. package/lib/utils/template-helpers.js +2 -2
  323. package/lib/utils/test-log-writer.js +3 -3
  324. package/lib/utils/token-manager.js +1 -2
  325. package/lib/utils/url-declarative-public-base.js +188 -0
  326. package/lib/utils/url-declarative-resolve-build.js +493 -0
  327. package/lib/utils/url-declarative-resolve-load-doc.js +51 -0
  328. package/lib/utils/url-declarative-resolve.js +220 -0
  329. package/lib/utils/url-declarative-token-parse.js +74 -0
  330. package/lib/utils/url-declarative-url-flags.js +50 -0
  331. package/lib/utils/url-declarative-vdir-inactive-env.js +99 -0
  332. package/lib/utils/url-public-path-prefix.js +34 -0
  333. package/lib/utils/urls-local-registry.js +220 -0
  334. package/lib/utils/validation-report-tty-kit.js +77 -0
  335. package/lib/utils/validation-run-poll.js +112 -0
  336. package/lib/utils/validation-run-post-retry.js +85 -0
  337. package/lib/utils/validation-run-request.js +116 -0
  338. package/lib/utils/variable-transformer.js +21 -4
  339. package/lib/utils/yaml-preserve.js +33 -14
  340. package/lib/validation/datasource-warnings.js +56 -0
  341. package/lib/validation/env-template-auth.js +1 -1
  342. package/lib/validation/external-manifest-validator.js +27 -7
  343. package/lib/validation/validate-display.js +37 -31
  344. package/lib/validation/validate-external-cert-sync.js +23 -0
  345. package/lib/validation/validate.js +8 -14
  346. package/lib/validation/validator-unresolved-placeholders.js +98 -0
  347. package/lib/validation/validator.js +22 -65
  348. package/lib/validation/wizard-config-validator.js +2 -1
  349. package/package.json +9 -4
  350. package/scripts/check-datasource-test-run-schema-sync.js +34 -0
  351. package/scripts/diagnose-cli.js +150 -0
  352. package/scripts/install-local.js +307 -55
  353. package/scripts/pnpm-global-remove.js +48 -0
  354. package/templates/README.md +15 -2
  355. package/templates/applications/dataplane/application.yaml +52 -2
  356. package/templates/applications/dataplane/env.template +79 -17
  357. package/templates/applications/dataplane/rbac.yaml +8 -0
  358. package/templates/applications/keycloak/application.yaml +9 -1
  359. package/templates/applications/keycloak/env.template +15 -6
  360. package/templates/applications/miso-controller/application.yaml +10 -2
  361. package/templates/applications/miso-controller/env.template +42 -12
  362. package/templates/applications/miso-controller/rbac.yaml +5 -0
  363. package/templates/external-system/README.md.hbs +20 -7
  364. package/templates/external-system/deploy.js.hbs +5 -5
  365. package/templates/external-system/external-datasource.yaml.hbs +197 -118
  366. package/templates/infra/compose.yaml.hbs +33 -16
  367. package/templates/infra/servers.json.hbs +3 -1
  368. package/templates/python/docker-compose.hbs +16 -0
  369. package/templates/typescript/docker-compose.hbs +16 -0
  370. package/lib/api/external-test.api.js +0 -111
  371. package/lib/schema/env-config.yaml +0 -60
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @fileoverview JSDoc typedefs for dataplane Trust / integration certificate APIs (camelCase).
3
+ * @author AI Fabrix Team
4
+ * @version 2.0.0
5
+ */
6
+
7
+ /**
8
+ * Integration certificate artifact (dataplane OpenAPI **CertificateArtifactResponse**).
9
+ *
10
+ * @typedef {Object} CertificateArtifactResponse
11
+ * @property {string|{id?: string}} [certificateId]
12
+ * @property {string} [systemKey]
13
+ * @property {string} [datasourceKey]
14
+ * @property {string} [version]
15
+ * @property {string|null} [certificateVersion]
16
+ * @property {string|null} [systemVersion]
17
+ * @property {string} [certificationLevel]
18
+ * @property {Object} [metrics]
19
+ * @property {string|null} [contractHash]
20
+ * @property {string|null} [integrationHash]
21
+ * @property {string} [issuedAt]
22
+ * @property {string} [issuedBy]
23
+ * @property {string} [licenseLevelIssuer]
24
+ * @property {string} [dataplaneVersion]
25
+ * @property {('RS256'|'HS256')} [algorithm] RS256 production; HS256 local dev HMAC signer only
26
+ * @property {string|null} [publicKey]
27
+ * @property {string|null} [publicKeyFingerprint]
28
+ * @property {Object} [metadata]
29
+ */
30
+
31
+ /**
32
+ * @typedef {Object} CertificateVerificationResponse
33
+ * @property {boolean} validSignature
34
+ * @property {boolean} validHash
35
+ * @property {boolean} overallValid
36
+ * @property {string[]} [reasons]
37
+ */
38
+
39
+ /**
40
+ * @typedef {Object} CertificateVerifyRequest
41
+ * @property {string|null} [certificateId]
42
+ * @property {Object|null} [certificate]
43
+ * @property {boolean} [verifyHash]
44
+ * @property {string|null} [systemIdOrKey]
45
+ * @property {string|null} [datasourceKey]
46
+ */
47
+
48
+ module.exports = {};
@@ -27,10 +27,11 @@
27
27
  * @typedef {Object} SettingsResponseDto
28
28
  * @property {string} user-mutagen-folder - Server path to workspace root (no app segment)
29
29
  * @property {string} secrets-encryption - Encryption key (hex)
30
- * @property {string} aifabrix-secrets - Path or URL for secrets
30
+ * @property {string} aifabrix-secrets - Local filesystem path or https URL for shared secrets (file vs remote API)
31
31
  * @property {string} aifabrix-env-config - Env config path
32
32
  * @property {string} remote-server - Builder-server base URL
33
33
  * @property {string} docker-endpoint - Docker API endpoint
34
+ * @property {boolean} [docker-tls-skip-verify] - When true and ca.pem is absent, Docker uses DOCKER_TLS_VERIFY=0; if ca.pem exists, daemon is always verified
34
35
  * @property {string} sync-ssh-user - SSH user for Mutagen
35
36
  * @property {string} sync-ssh-host - SSH host for Mutagen
36
37
  */
@@ -44,7 +45,7 @@
44
45
  * @property {string} createdAt - ISO 8601
45
46
  * @property {boolean} certificateIssued - Whether cert was issued
46
47
  * @property {string} [certificateValidNotAfter] - Cert validity end (optional)
47
- * @property {string[]} groups - Access groups (admin, secret-manager, developer)
48
+ * @property {string[]} groups - Access groups (admin, secret-manager, developer, docker)
48
49
  */
49
50
 
50
51
  /**
@@ -53,7 +54,7 @@
53
54
  * @property {string} developerId - Unique developer ID (numeric string)
54
55
  * @property {string} name - Display name
55
56
  * @property {string} email - Email
56
- * @property {string[]} [groups] - Default [developer]
57
+ * @property {string[]} [groups] - Default [developer]; tokens: admin, secret-manager, developer, docker
57
58
  */
58
59
 
59
60
  /**
@@ -131,13 +131,16 @@
131
131
  */
132
132
 
133
133
  /**
134
- * Dataplane pipeline upload response (publication result; no uploadId).
134
+ * Dataplane pipeline upload API envelope (makeApiCall / ApiClient).
135
+ * Body in `data` matches dataplane PublicationResult (uploadId, uploadStatus, system, datasources, generateMcpContract, …).
135
136
  * @typedef {Object} PipelineUploadResponse
136
137
  * @property {boolean} success - Request success flag
137
- * @property {Object} [data] - Publication result (system, datasources, warnings)
138
- * @property {string} [data.systemKey] - Published system key
139
- * @property {string[]} [data.datasourceKeys] - Published datasource keys
140
- * @property {string[]} [data.warnings] - Warnings if any
138
+ * @property {Object} [data] - PublicationResult from dataplane (not a generic wrapper with datasourceKeys/warnings)
139
+ * @property {string} [data.uploadId] - Upload / publication id
140
+ * @property {string} [data.uploadStatus] - e.g. published
141
+ * @property {Object} [data.system] - Published external system
142
+ * @property {Object[]} [data.datasources] - Published datasources
143
+ * @property {boolean} [data.generateMcpContract] - MCP generation flag
141
144
  * @property {string} [formattedError] - Formatted error message on failure
142
145
  */
143
146
 
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @fileoverview JSDoc types for unified validation run (POST /api/v1/validation/run).
3
+ * @author AI Fabrix Team
4
+ * @version 2.0.0
5
+ */
6
+
7
+ /**
8
+ * @typedef {'externalSystem'|'externalDataSource'} ValidationScope
9
+ */
10
+
11
+ /**
12
+ * @typedef {'test'|'integration'|'e2e'} ValidationRunKind
13
+ */
14
+
15
+ /**
16
+ * Request body for POST /api/v1/validation/run (camelCase; see Dataplane OpenAPI).
17
+ * @typedef {Object} ValidationRunRequestBody
18
+ * @property {string} [systemIdOrKey]
19
+ * @property {string} [systemKey]
20
+ * @property {string[]} [datasourceKeys]
21
+ * @property {string} [datasourceKey]
22
+ * @property {boolean} [explain]
23
+ * @property {boolean} [includeLiveChecks]
24
+ * @property {boolean} [includeLiveDebug]
25
+ * @property {boolean} [showCapabilities]
26
+ * @property {boolean} [explainMetrics]
27
+ * @property {boolean} [explainCertification]
28
+ * @property {boolean} [includeMetrics]
29
+ * @property {boolean} [includeCertification]
30
+ * @property {Object} [systemConfig]
31
+ * @property {Object[]} [datasourceConfigs]
32
+ * @property {ValidationScope} [validationScope]
33
+ * @property {ValidationRunKind} [runType]
34
+ * @property {Object} [payloadTemplate]
35
+ * @property {boolean} [asyncRun]
36
+ * @property {Object} [e2eOptions]
37
+ * @property {boolean} [includeDebug]
38
+ */
39
+
40
+ /**
41
+ * Minimal DatasourceTestRun shape for CLI exit / display (full schema in lib/schema).
42
+ * @typedef {Object} DatasourceTestRunLike
43
+ * @property {string} [reportVersion]
44
+ * @property {string} datasourceKey
45
+ * @property {string} systemKey
46
+ * @property {ValidationRunKind} runType
47
+ * @property {'ok'|'warn'|'fail'|'skipped'} status
48
+ * @property {'minimal'|'partial'|'full'} [reportCompleteness]
49
+ * @property {string} [runId]
50
+ * @property {string} [testRunId]
51
+ * @property {Object} [certificate]
52
+ * @property {string} [certificate.status]
53
+ * @property {Object} [developer]
54
+ */
55
+
56
+ module.exports = {};
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @fileoverview Unified dataplane validation API — POST /api/v1/validation/run and poll GET.
3
+ * @author AI Fabrix Team
4
+ * @version 2.0.0
5
+ */
6
+
7
+ const { ApiClient } = require('./index');
8
+
9
+ const POST_PATH = '/api/v1/validation/run';
10
+
11
+ function buildClientCredentialHeaders(authConfig) {
12
+ if (!authConfig || typeof authConfig !== 'object') return null;
13
+ if (authConfig.type !== 'client-credentials') return null;
14
+ if (!authConfig.clientId || !authConfig.clientSecret) return null;
15
+ return {
16
+ 'x-client-id': String(authConfig.clientId),
17
+ 'x-client-secret': String(authConfig.clientSecret)
18
+ };
19
+ }
20
+
21
+ /**
22
+ * Normalize auth for dataplane: Bearer user token, x-client-token app token, or API key as Bearer.
23
+ * @param {Object} authConfig - Auth configuration
24
+ * @returns {Object} Auth for ApiClient
25
+ */
26
+ function normalizeDataplaneAuth(authConfig) {
27
+ if (!authConfig || typeof authConfig !== 'object') {
28
+ throw new Error('authConfig is required');
29
+ }
30
+ if (authConfig.token) {
31
+ return authConfig;
32
+ }
33
+ if (authConfig.apiKey) {
34
+ return { ...authConfig, token: authConfig.apiKey, type: authConfig.type || 'bearer' };
35
+ }
36
+ throw new Error(
37
+ 'Validation run requires Bearer token or API key. Run \'aifabrix login\' or configure API key.'
38
+ );
39
+ }
40
+
41
+ /**
42
+ * @requiresPermission {Dataplane} external-system:read
43
+ * @async
44
+ * @function postValidationRun
45
+ * @param {string} dataplaneUrl - Dataplane base URL
46
+ * @param {Object} authConfig - Authentication (token or apiKey)
47
+ * @param {import('./types/validation-run.types').ValidationRunRequestBody} body - Request JSON body
48
+ * @param {Object} [transportOpts]
49
+ * @param {number} [transportOpts.timeoutMs] - Per-request HTTP timeout (validation E2E POST can exceed 30s)
50
+ * @returns {Promise<Object>} ApiClient result: { success, data, status, ... }
51
+ */
52
+ async function postValidationRun(dataplaneUrl, authConfig, body, transportOpts = {}) {
53
+ const hdrs = buildClientCredentialHeaders(authConfig);
54
+ const clientAuth = hdrs ? {} : normalizeDataplaneAuth(authConfig);
55
+ const client = new ApiClient(dataplaneUrl, clientAuth);
56
+ const postOpts = { body, headers: hdrs || undefined };
57
+ if (Number.isFinite(transportOpts.timeoutMs) && transportOpts.timeoutMs > 0) {
58
+ postOpts.timeoutMs = transportOpts.timeoutMs;
59
+ }
60
+ return client.post(POST_PATH, postOpts);
61
+ }
62
+
63
+ /**
64
+ * @requiresPermission {Dataplane} external-system:read
65
+ * @async
66
+ * @function getValidationRun
67
+ * @param {string} dataplaneUrl - Dataplane base URL
68
+ * @param {Object} authConfig - Authentication
69
+ * @param {string} testRunId - Poll id from 202 / envelope
70
+ * @param {Object} [transportOpts]
71
+ * @param {number} [transportOpts.timeoutMs] - Per-request HTTP timeout (align with aggregate validation budget)
72
+ * @returns {Promise<Object>} ApiClient result
73
+ */
74
+ async function getValidationRun(dataplaneUrl, authConfig, testRunId, transportOpts = {}) {
75
+ if (!testRunId || typeof testRunId !== 'string') {
76
+ throw new Error('testRunId is required for validation run poll');
77
+ }
78
+ const hdrs = buildClientCredentialHeaders(authConfig);
79
+ const clientAuth = hdrs ? {} : normalizeDataplaneAuth(authConfig);
80
+ const client = new ApiClient(dataplaneUrl, clientAuth);
81
+ const path = `${POST_PATH}/${encodeURIComponent(testRunId)}`;
82
+ const getOpts = { headers: hdrs || undefined };
83
+ if (Number.isFinite(transportOpts.timeoutMs) && transportOpts.timeoutMs > 0) {
84
+ getOpts.timeoutMs = transportOpts.timeoutMs;
85
+ }
86
+ return client.get(path, getOpts);
87
+ }
88
+
89
+ /**
90
+ * Extract async poll id from POST 202 body or partial DatasourceTestRun.
91
+ * @param {Object} data - Parsed JSON body
92
+ * @returns {string|null}
93
+ */
94
+ function extractTestRunId(data) {
95
+ if (!data || typeof data !== 'object') return null;
96
+ if (typeof data.testRunId === 'string' && data.testRunId.trim()) return data.testRunId.trim();
97
+ if (data.testRunId && typeof data.testRunId === 'object') {
98
+ const id = data.testRunId.id || data.testRunId.key;
99
+ if (typeof id === 'string' && id.trim()) return id.trim();
100
+ }
101
+ return null;
102
+ }
103
+
104
+ module.exports = {
105
+ postValidationRun,
106
+ getValidationRun,
107
+ extractTestRunId,
108
+ normalizeDataplaneAuth,
109
+ buildClientCredentialHeaders,
110
+ POST_PATH
111
+ };
@@ -0,0 +1,109 @@
1
+ /**
2
+ * @fileoverview Single reusable module for unified validation POST + optional poll.
3
+ *
4
+ * Used by datasource- and system-scoped CLI flows to enforce plan §9 behavior consistently.
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ const { extractTestRunId } = require('./validation-run.api');
10
+ const { postValidationRunWithTransportRetry } = require('../utils/validation-run-post-retry');
11
+ const { pollValidationRunUntilComplete } = require('../utils/validation-run-poll');
12
+
13
+ /**
14
+ * POST /api/v1/validation/run and (when async) poll GET until reportCompleteness is full.
15
+ *
16
+ * @param {Object} opts
17
+ * @param {string} opts.dataplaneUrl
18
+ * @param {Object} opts.authConfig
19
+ * @param {Object} opts.body
20
+ * @param {number} opts.timeoutMs
21
+ * @param {boolean} opts.useAsync
22
+ * @param {boolean} opts.noAsync
23
+ * @returns {Promise<{ envelope: Object|null, apiError: Object|null, pollTimedOut: boolean, incompleteNoAsync: boolean }>}
24
+ */
25
+ /* eslint-disable max-lines-per-function, max-statements, complexity -- POST + poll orchestration */
26
+ async function postValidationRunAndOptionalPoll(opts) {
27
+ const { dataplaneUrl, authConfig, body, timeoutMs, useAsync, noAsync, verbosePoll } = opts;
28
+ const started = Date.now();
29
+ const transportOpts =
30
+ Number.isFinite(timeoutMs) && timeoutMs > 0 ? { timeoutMs } : {};
31
+ const postRes = await postValidationRunWithTransportRetry(
32
+ dataplaneUrl,
33
+ authConfig,
34
+ body,
35
+ transportOpts
36
+ );
37
+ if (!postRes.success) {
38
+ return {
39
+ envelope: null,
40
+ apiError: postRes,
41
+ pollTimedOut: false,
42
+ incompleteNoAsync: false
43
+ };
44
+ }
45
+
46
+ let envelope = postRes.data;
47
+ const httpStatus = postRes.status;
48
+ const testRunId = extractTestRunId(envelope);
49
+ const completeness = envelope && envelope.reportCompleteness;
50
+ const needsPoll =
51
+ httpStatus === 202 ||
52
+ (testRunId && completeness && completeness !== 'full' && useAsync);
53
+
54
+ if (needsPoll && testRunId) {
55
+ const elapsed = Date.now() - started;
56
+ const remaining = Math.max(0, timeoutMs - elapsed);
57
+ const pollResult = await pollValidationRunUntilComplete({
58
+ dataplaneUrl,
59
+ authConfig,
60
+ testRunId,
61
+ budgetMs: remaining,
62
+ verbosePoll: verbosePoll === true,
63
+ pollRequestTimeoutMs:
64
+ Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : undefined
65
+ });
66
+ if (!pollResult.lastApiResult || !pollResult.lastApiResult.success) {
67
+ return {
68
+ envelope: pollResult.envelope,
69
+ apiError: pollResult.lastApiResult,
70
+ pollTimedOut: pollResult.timedOut,
71
+ incompleteNoAsync: false
72
+ };
73
+ }
74
+ envelope = pollResult.envelope;
75
+ if (pollResult.timedOut) {
76
+ return {
77
+ envelope,
78
+ apiError: null,
79
+ pollTimedOut: true,
80
+ incompleteNoAsync: false
81
+ };
82
+ }
83
+ }
84
+
85
+ if (
86
+ noAsync &&
87
+ envelope &&
88
+ envelope.reportCompleteness &&
89
+ envelope.reportCompleteness !== 'full'
90
+ ) {
91
+ return {
92
+ envelope,
93
+ apiError: null,
94
+ pollTimedOut: false,
95
+ incompleteNoAsync: true
96
+ };
97
+ }
98
+
99
+ return {
100
+ envelope,
101
+ apiError: null,
102
+ pollTimedOut: false,
103
+ incompleteNoAsync: false
104
+ };
105
+ }
106
+ /* eslint-enable max-lines-per-function, max-statements, complexity */
107
+
108
+ module.exports = { postValidationRunAndOptionalPoll };
109
+
@@ -0,0 +1,129 @@
1
+ /**
2
+ * @fileoverview Load local `certification` and optional dataplane verify for `aifabrix show` (external).
3
+ * @author AI Fabrix Team
4
+ * @version 2.0.0
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ const { resolvePrimarySystemFilePath } = require('../certification/sync-system-certification');
10
+ const { loadConfigFile } = require('../utils/config-format');
11
+ const { generateControllerManifest } = require('../generator/external-controller-manifest');
12
+ const { verifyRowForDatasource } = require('./certification-verify-rows');
13
+
14
+ const MAX_VERIFY_DATASOURCES = 12;
15
+
16
+ /**
17
+ * @param {string} pem
18
+ * @param {number} maxLen
19
+ * @returns {string}
20
+ */
21
+ function truncatePublicKeyPreview(pem, maxLen = 52) {
22
+ if (!pem || typeof pem !== 'string') return '—';
23
+ const s = pem.trim();
24
+ if (s.length <= maxLen) return s;
25
+ return `${s.slice(0, maxLen)}… (${s.length} chars)`;
26
+ }
27
+
28
+ /**
29
+ * @param {Object|null|undefined} cert
30
+ * @returns {Object|null}
31
+ */
32
+ function sanitizeCertificationForJson(cert) {
33
+ if (!cert || typeof cert !== 'object') return null;
34
+ const pk = cert.publicKey;
35
+ return {
36
+ enabled: cert.enabled,
37
+ algorithm: cert.algorithm,
38
+ issuer: cert.issuer,
39
+ version: cert.version,
40
+ publicKeyPreview: truncatePublicKeyPreview(pk, 96)
41
+ };
42
+ }
43
+
44
+ /**
45
+ * @param {string} appKey
46
+ * @returns {Object|null}
47
+ */
48
+ function loadLocalCertificationFromSystemFile(appKey) {
49
+ const r = resolvePrimarySystemFilePath(appKey);
50
+ if (!r || !r.systemFilePath) return null;
51
+ try {
52
+ const sys = loadConfigFile(r.systemFilePath);
53
+ const c = sys && sys.certification;
54
+ if (!c || typeof c !== 'object') return null;
55
+ return c;
56
+ } catch {
57
+ return null;
58
+ }
59
+ }
60
+
61
+ /**
62
+ * @param {Object} summary - show summary (mutated)
63
+ * @param {string} appKey
64
+ */
65
+ function attachLocalCertification(summary, appKey) {
66
+ if (!summary || !summary.isExternal) return;
67
+ const cert = loadLocalCertificationFromSystemFile(appKey);
68
+ if (cert) summary.localCertification = cert;
69
+ }
70
+
71
+ /**
72
+ * Resolve dataplane URL + datasource keys for verify, or set summary errors.
73
+ * @returns {Promise<{ dataplaneUrl: string, authConfig: Object, systemKey: string, keys: string[] }|null>}
74
+ */
75
+ async function resolveCertificationVerifyTargets(summary, appKey, authBundle) {
76
+ if (!authBundle || !authBundle.token || !authBundle.controllerUrl) {
77
+ summary.certificationVerifySkipped = true;
78
+ return null;
79
+ }
80
+ const { resolveEnvironment } = require('../core/config');
81
+ const { resolveDataplaneUrl } = require('../utils/dataplane-resolver');
82
+ const authConfig = { type: 'bearer', token: authBundle.token };
83
+ const environment = await resolveEnvironment();
84
+ let dataplaneUrl;
85
+ try {
86
+ dataplaneUrl = await resolveDataplaneUrl(authBundle.controllerUrl, environment, authConfig);
87
+ } catch (e) {
88
+ summary.certificationVerifyError = e.message || 'dataplane_unavailable';
89
+ return null;
90
+ }
91
+ let manifest;
92
+ try {
93
+ manifest = await generateControllerManifest(appKey, { type: 'external' });
94
+ } catch {
95
+ summary.certificationVerifyError = 'manifest_unavailable';
96
+ return null;
97
+ }
98
+ const systemKey = manifest.key || appKey;
99
+ const keys = (manifest.dataSources || []).map((ds) => ds && ds.key).filter(Boolean).slice(0, MAX_VERIFY_DATASOURCES);
100
+ return { dataplaneUrl, authConfig, systemKey, keys };
101
+ }
102
+
103
+ /**
104
+ * Populate **certificationVerifyRows** on summary (mutates).
105
+ *
106
+ * @async
107
+ * @param {Object} summary
108
+ * @param {string} appKey
109
+ * @param {{ token: string, controllerUrl: string }} authBundle
110
+ * @returns {Promise<void>}
111
+ */
112
+ async function attachCertificationVerifyFromDataplane(summary, appKey, authBundle) {
113
+ if (!summary || !summary.isExternal) return;
114
+ const ctx = await resolveCertificationVerifyTargets(summary, appKey, authBundle);
115
+ if (!ctx) return;
116
+ const rows = [];
117
+ for (const dk of ctx.keys) {
118
+ rows.push(await verifyRowForDatasource(ctx.dataplaneUrl, ctx.authConfig, ctx.systemKey, dk));
119
+ }
120
+ summary.certificationVerifyRows = rows;
121
+ }
122
+
123
+ module.exports = {
124
+ attachLocalCertification,
125
+ attachCertificationVerifyFromDataplane,
126
+ sanitizeCertificationForJson,
127
+ truncatePublicKeyPreview,
128
+ loadLocalCertificationFromSystemFile
129
+ };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @fileoverview Build per-datasource certificate verify rows for show / enrich (small helpers for lint limits).
3
+ * @author AI Fabrix Team
4
+ * @version 2.0.0
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ const { unwrapApiData } = require('../utils/external-system-readiness-core');
10
+ const { getActiveIntegrationCertificate, verifyIntegrationCertificate } = require('../api/certificates.api');
11
+
12
+ /**
13
+ * @param {*} id
14
+ * @returns {string|null}
15
+ */
16
+ function certificateIdString(id) {
17
+ if (id === undefined || id === null) return null;
18
+ if (typeof id === 'string') return id.trim() || null;
19
+ if (typeof id === 'object' && id !== null && typeof id.id === 'string') return id.id.trim() || null;
20
+ return null;
21
+ }
22
+
23
+ /**
24
+ * @param {string} dataplaneUrl
25
+ * @param {Object} authConfig
26
+ * @param {string} systemKey
27
+ * @param {string} dk
28
+ * @returns {Promise<Object>}
29
+ */
30
+ async function verifyRowForDatasource(dataplaneUrl, authConfig, systemKey, dk) {
31
+ const activeRes = await getActiveIntegrationCertificate(dataplaneUrl, authConfig, systemKey, dk);
32
+ if (!activeRes || activeRes.success === false) {
33
+ return { datasourceKey: dk, error: 'active_unavailable' };
34
+ }
35
+ const art = unwrapApiData(activeRes);
36
+ const cid = certificateIdString(art && art.certificateId);
37
+ if (!cid) {
38
+ return { datasourceKey: dk, error: 'no_certificate_id' };
39
+ }
40
+ const verRes = await verifyIntegrationCertificate(dataplaneUrl, authConfig, {
41
+ certificateId: cid,
42
+ verifyHash: true,
43
+ systemIdOrKey: systemKey,
44
+ datasourceKey: dk
45
+ });
46
+ if (!verRes || verRes.success === false) {
47
+ return { datasourceKey: dk, certificateId: cid, error: 'verify_request_failed' };
48
+ }
49
+ const v = unwrapApiData(verRes);
50
+ return {
51
+ datasourceKey: dk,
52
+ certificateId: cid,
53
+ overallValid: !!(v && v.overallValid),
54
+ validSignature: !!(v && v.validSignature),
55
+ validHash: !!(v && v.validHash),
56
+ reasons: Array.isArray(v && v.reasons) ? v.reasons : []
57
+ };
58
+ }
59
+
60
+ module.exports = { verifyRowForDatasource, certificateIdString };
package/lib/app/config.js CHANGED
@@ -135,7 +135,7 @@ async function generateEnvTemplateFile(appPath, appName, config, existingEnv) {
135
135
  envTemplate = envResult.template;
136
136
 
137
137
  if (envResult.warnings.length > 0) {
138
- logger.log(chalk.yellow('\n⚠️ Environment conversion warnings:'));
138
+ logger.log(chalk.yellow('\n Environment conversion warnings:'));
139
139
  envResult.warnings.forEach(warning => logger.log(chalk.yellow(` - ${warning}`)));
140
140
  }
141
141
  } else {
@@ -69,9 +69,9 @@ async function displayAppUrlFromController(controllerUrl, envKey, appKey, authCo
69
69
  url = buildAppUrlFromControllerAndPort(controllerUrl, port);
70
70
  }
71
71
  if (url) {
72
- logger.log(chalk.green(` App running at ${url}`));
72
+ logger.log(chalk.green(` App running at ${url}`));
73
73
  } else {
74
- logger.log(chalk.blue(' App deployed. Get URL from controller dashboard.'));
74
+ logger.log(chalk.blue(' App deployed. Get URL from controller dashboard.'));
75
75
  }
76
76
  }
77
77
 
package/lib/app/deploy.js CHANGED
@@ -1,3 +1,4 @@
1
+ const { formatSuccessLine, formatSuccessParagraph } = require('../utils/cli-test-layout-chalk');
1
2
  /**
2
3
  * AI Fabrix Builder Application Deployment Module
3
4
  *
@@ -79,7 +80,7 @@ async function validatePushPrerequisites(appName, registry) {
79
80
  */
80
81
  async function executePush(appName, registry, tags) {
81
82
  if (await pushUtils.checkACRAuthentication(registry)) {
82
- logger.log(chalk.green(`✓ Already authenticated with ${registry}`));
83
+ logger.log(formatSuccessLine(`Already authenticated with ${registry}`));
83
84
  } else {
84
85
  await pushUtils.authenticateACR(registry);
85
86
  }
@@ -98,7 +99,7 @@ async function executePush(appName, registry, tags) {
98
99
  * @param {string} appName - Application name
99
100
  */
100
101
  function verifyPushResult(tags, registry, appName) {
101
- logger.log(chalk.green(`\n✓ Successfully pushed ${tags.length} tag(s) to ${registry}`));
102
+ logger.log(formatSuccessParagraph(`Successfully pushed ${tags.length} tag(s) to ${registry}`));
102
103
  logger.log(chalk.gray(`Image: ${registry}/${appName}:*`));
103
104
  logger.log(chalk.gray(`Tags: ${tags.join(', ')}`));
104
105
  }
@@ -173,7 +174,7 @@ async function generateAndValidateManifest(appName, options = {}) {
173
174
  * @param {string} manifestPath - Path to manifest file
174
175
  */
175
176
  function displayDeploymentInfo(manifest, manifestPath) {
176
- logger.log(chalk.green(`✓ Manifest generated: ${manifestPath}`));
177
+ logger.log(formatSuccessLine(`Manifest generated: ${manifestPath}`));
177
178
  logger.log(chalk.blue(` Key: ${manifest.key}`));
178
179
  logger.log(chalk.blue(` Display Name: ${manifest.displayName}`));
179
180
  logger.log(chalk.blue(` Image: ${manifest.image}`));
@@ -216,8 +217,8 @@ function displayDeploymentResults(result) {
216
217
  logger.log(chalk.blue(` Deployment ID: ${result.deploymentId}`));
217
218
  }
218
219
  if (result.status) {
219
- const statusIcon = result.status.status === 'completed' ? '' :
220
- result.status.status === 'failed' ? '' : '⏳';
220
+ const statusIcon = result.status.status === 'completed' ? '' :
221
+ result.status.status === 'failed' ? '' : '⏳';
221
222
  logger.log(chalk.blue(` Status: ${statusIcon} ${result.status.status}`));
222
223
  }
223
224
  }
@@ -368,7 +369,7 @@ async function executeStandardDeployment(appName, options) {
368
369
  }
369
370
 
370
371
  /**
371
- * Tries external deploy when builder/<app> does not exist but integration/<app> does.
372
+ * Tries external deploy when builder/<appKey> does not exist but integration/<systemKey> does.
372
373
  * @async
373
374
  * @param {string} appName - Application name
374
375
  * @param {Object} options - Deployment options
@@ -1,3 +1,4 @@
1
+ const { formatSuccessParagraph } = require('../utils/cli-test-layout-chalk');
1
2
  /**
2
3
  * Application Display Utilities
3
4
  *
@@ -64,7 +65,7 @@ function displayWebappSuccess(appName, config, envConversionMessage) {
64
65
  * @param {string} appPath - Application path
65
66
  */
66
67
  function displaySuccessMessage(appName, config, envConversionMessage, hasAppFiles = false, appPath = null) {
67
- logger.log(chalk.green('\n✓ Application created successfully!'));
68
+ logger.log(formatSuccessParagraph('Application created successfully!'));
68
69
  logger.log(chalk.blue(`\nApplication: ${appName}`));
69
70
 
70
71
  // Determine location based on app type
@@ -1,3 +1,4 @@
1
+ const { formatSuccessLine } = require('../utils/cli-test-layout-chalk');
1
2
  /**
2
3
  * Application Dockerfile Generation
3
4
  *
@@ -74,7 +75,7 @@ async function generateAndCopyDockerfile(appPath, dockerfilePath, config) {
74
75
  const buildConfig = config.build || {};
75
76
  const generatedPath = await build.generateDockerfile(appPath, config.language, config, buildConfig);
76
77
  await fs.copyFile(generatedPath, dockerfilePath);
77
- logger.log(chalk.green('Generated Dockerfile from template'));
78
+ logger.log(formatSuccessLine('Generated Dockerfile from template'));
78
79
  return dockerfilePath;
79
80
  }
80
81
 
@@ -90,7 +91,7 @@ async function generateDockerfileForApp(appName, options = {}) {
90
91
  try {
91
92
  const { isExternal } = await detectAppType(appName);
92
93
  if (isExternal) {
93
- logger.log(chalk.yellow('⚠️ External systems don\'t require Dockerfiles. Skipping...'));
94
+ logger.log(chalk.yellow(' External systems don\'t require Dockerfiles. Skipping...'));
94
95
  return null;
95
96
  }
96
97
  } catch (error) {