@zuplo/cli 7.10.0 → 7.11.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 (310) hide show
  1. package/dist/common/worker-output.d.ts +7 -0
  2. package/dist/common/worker-output.d.ts.map +1 -1
  3. package/dist/common/worker-output.js +39 -0
  4. package/dist/common/worker-output.js.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/node_modules/@hono/node-server/README.md +2 -0
  7. package/node_modules/@hono/node-server/dist/index.cjs +1 -1
  8. package/node_modules/@hono/node-server/dist/index.mjs +1 -1
  9. package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
  10. package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
  11. package/node_modules/@hono/node-server/package.json +1 -1
  12. package/node_modules/@posthog/core/dist/metrics/index.d.ts +9 -0
  13. package/node_modules/@posthog/core/dist/metrics/index.d.ts.map +1 -1
  14. package/node_modules/@posthog/core/dist/metrics/index.js +38 -3
  15. package/node_modules/@posthog/core/dist/metrics/index.mjs +38 -3
  16. package/node_modules/@posthog/core/dist/metrics/types.d.ts +7 -2
  17. package/node_modules/@posthog/core/dist/metrics/types.d.ts.map +1 -1
  18. package/node_modules/@posthog/core/dist/traces/ids.d.ts.map +1 -1
  19. package/node_modules/@posthog/core/dist/traces/ids.js +2 -2
  20. package/node_modules/@posthog/core/dist/traces/ids.mjs +2 -2
  21. package/node_modules/@posthog/core/dist/types.d.ts +1 -1
  22. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  23. package/node_modules/@posthog/core/package.json +4 -3
  24. package/node_modules/@posthog/core/src/metrics/index.spec.ts +75 -0
  25. package/node_modules/@posthog/core/src/metrics/index.ts +60 -0
  26. package/node_modules/@posthog/core/src/metrics/types.ts +7 -1
  27. package/node_modules/@posthog/core/src/traces/ids.ts +4 -2
  28. package/node_modules/@posthog/core/src/types.ts +1 -1
  29. package/node_modules/@posthog/types/dist/capture-metric.d.ts +10 -0
  30. package/node_modules/@posthog/types/dist/capture-metric.d.ts.map +1 -1
  31. package/node_modules/@posthog/types/dist/capture.d.ts +1 -1
  32. package/node_modules/@posthog/types/dist/capture.d.ts.map +1 -1
  33. package/node_modules/@posthog/types/dist/index.d.ts +1 -1
  34. package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
  35. package/node_modules/@posthog/types/package.json +1 -1
  36. package/node_modules/@posthog/types/src/capture-metric.ts +11 -0
  37. package/node_modules/@posthog/types/src/capture.ts +1 -1
  38. package/node_modules/@posthog/types/src/index.ts +1 -0
  39. package/node_modules/@zuplo/core/customer.cli.minified.js +272 -261
  40. package/node_modules/@zuplo/core/index.minified.js +276 -265
  41. package/node_modules/@zuplo/core/package.json +1 -1
  42. package/node_modules/@zuplo/graphql/package.json +1 -1
  43. package/node_modules/@zuplo/openapi-tools/package.json +5 -2
  44. package/node_modules/@zuplo/otel/package.json +1 -1
  45. package/node_modules/@zuplo/runtime/out/esm/{chunk-YJ2BHVUH.js → chunk-CDEAY3VY.js} +2 -2
  46. package/node_modules/@zuplo/runtime/out/esm/chunk-LVSZ3WTO.js +37 -0
  47. package/node_modules/@zuplo/runtime/out/esm/chunk-LVSZ3WTO.js.map +1 -0
  48. package/node_modules/@zuplo/runtime/out/esm/{chunk-VTO3F6DK.js → chunk-NUVXDVLJ.js} +2 -2
  49. package/node_modules/@zuplo/runtime/out/esm/{chunk-6YPRGG62.js → chunk-RHU3Z7DA.js} +108 -108
  50. package/node_modules/@zuplo/runtime/out/esm/chunk-RHU3Z7DA.js.map +1 -0
  51. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  52. package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
  53. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  54. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  55. package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
  56. package/node_modules/@zuplo/runtime/out/types/index.d.ts +15 -24
  57. package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +14 -0
  58. package/node_modules/@zuplo/runtime/package.json +1 -1
  59. package/package.json +15 -12
  60. package/dist/__tests__/archive-utils.test.d.ts +0 -2
  61. package/dist/__tests__/archive-utils.test.d.ts.map +0 -1
  62. package/dist/__tests__/archive-utils.test.js +0 -50
  63. package/dist/__tests__/archive-utils.test.js.map +0 -1
  64. package/dist/__tests__/import-openapi.test.d.ts +0 -2
  65. package/dist/__tests__/import-openapi.test.d.ts.map +0 -1
  66. package/dist/__tests__/import-openapi.test.js +0 -251
  67. package/dist/__tests__/import-openapi.test.js.map +0 -1
  68. package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts +0 -2
  69. package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts.map +0 -1
  70. package/dist/__tests__/integration/confirm-linked-config.integration.test.js +0 -202
  71. package/dist/__tests__/integration/confirm-linked-config.integration.test.js.map +0 -1
  72. package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts +0 -2
  73. package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts.map +0 -1
  74. package/dist/__tests__/integration/confirm-production-deploy.integration.test.js +0 -184
  75. package/dist/__tests__/integration/confirm-production-deploy.integration.test.js.map +0 -1
  76. package/dist/__tests__/integration/custom-domain.integration.test.d.ts +0 -2
  77. package/dist/__tests__/integration/custom-domain.integration.test.d.ts.map +0 -1
  78. package/dist/__tests__/integration/custom-domain.integration.test.js +0 -563
  79. package/dist/__tests__/integration/custom-domain.integration.test.js.map +0 -1
  80. package/dist/__tests__/integration/delete.integration.test.d.ts +0 -2
  81. package/dist/__tests__/integration/delete.integration.test.d.ts.map +0 -1
  82. package/dist/__tests__/integration/delete.integration.test.js +0 -262
  83. package/dist/__tests__/integration/delete.integration.test.js.map +0 -1
  84. package/dist/__tests__/integration/deploy.integration.test.d.ts +0 -2
  85. package/dist/__tests__/integration/deploy.integration.test.d.ts.map +0 -1
  86. package/dist/__tests__/integration/deploy.integration.test.js +0 -519
  87. package/dist/__tests__/integration/deploy.integration.test.js.map +0 -1
  88. package/dist/__tests__/integration/get-project-param.integration.test.d.ts +0 -2
  89. package/dist/__tests__/integration/get-project-param.integration.test.d.ts.map +0 -1
  90. package/dist/__tests__/integration/get-project-param.integration.test.js +0 -305
  91. package/dist/__tests__/integration/get-project-param.integration.test.js.map +0 -1
  92. package/dist/__tests__/integration/info.integration.test.d.ts +0 -2
  93. package/dist/__tests__/integration/info.integration.test.d.ts.map +0 -1
  94. package/dist/__tests__/integration/info.integration.test.js +0 -293
  95. package/dist/__tests__/integration/info.integration.test.js.map +0 -1
  96. package/dist/__tests__/integration/jest-mocks-setup.d.ts +0 -2
  97. package/dist/__tests__/integration/jest-mocks-setup.d.ts.map +0 -1
  98. package/dist/__tests__/integration/jest-mocks-setup.js +0 -104
  99. package/dist/__tests__/integration/jest-mocks-setup.js.map +0 -1
  100. package/dist/__tests__/integration/jest-setup.d.ts +0 -2
  101. package/dist/__tests__/integration/jest-setup.d.ts.map +0 -1
  102. package/dist/__tests__/integration/jest-setup.js +0 -12
  103. package/dist/__tests__/integration/jest-setup.js.map +0 -1
  104. package/dist/__tests__/integration/link.integration.test.d.ts +0 -2
  105. package/dist/__tests__/integration/link.integration.test.d.ts.map +0 -1
  106. package/dist/__tests__/integration/link.integration.test.js +0 -395
  107. package/dist/__tests__/integration/link.integration.test.js.map +0 -1
  108. package/dist/__tests__/integration/linked-config-cascade.integration.test.d.ts +0 -2
  109. package/dist/__tests__/integration/linked-config-cascade.integration.test.d.ts.map +0 -1
  110. package/dist/__tests__/integration/linked-config-cascade.integration.test.js +0 -179
  111. package/dist/__tests__/integration/linked-config-cascade.integration.test.js.map +0 -1
  112. package/dist/__tests__/integration/list.integration.test.d.ts +0 -2
  113. package/dist/__tests__/integration/list.integration.test.d.ts.map +0 -1
  114. package/dist/__tests__/integration/list.integration.test.js +0 -300
  115. package/dist/__tests__/integration/list.integration.test.js.map +0 -1
  116. package/dist/__tests__/integration/source-upgrade.integration.test.d.ts +0 -2
  117. package/dist/__tests__/integration/source-upgrade.integration.test.d.ts.map +0 -1
  118. package/dist/__tests__/integration/source-upgrade.integration.test.js +0 -100
  119. package/dist/__tests__/integration/source-upgrade.integration.test.js.map +0 -1
  120. package/dist/__tests__/integration/test-utils.d.ts +0 -30
  121. package/dist/__tests__/integration/test-utils.d.ts.map +0 -1
  122. package/dist/__tests__/integration/test-utils.js +0 -82
  123. package/dist/__tests__/integration/test-utils.js.map +0 -1
  124. package/dist/__tests__/integration/tunnel.integration.test.d.ts +0 -2
  125. package/dist/__tests__/integration/tunnel.integration.test.d.ts.map +0 -1
  126. package/dist/__tests__/integration/tunnel.integration.test.js +0 -486
  127. package/dist/__tests__/integration/tunnel.integration.test.js.map +0 -1
  128. package/dist/__tests__/integration/variable.integration.test.d.ts +0 -2
  129. package/dist/__tests__/integration/variable.integration.test.d.ts.map +0 -1
  130. package/dist/__tests__/integration/variable.integration.test.js +0 -258
  131. package/dist/__tests__/integration/variable.integration.test.js.map +0 -1
  132. package/dist/__tests__/integration/whoami.integration.test.d.ts +0 -2
  133. package/dist/__tests__/integration/whoami.integration.test.d.ts.map +0 -1
  134. package/dist/__tests__/integration/whoami.integration.test.js +0 -116
  135. package/dist/__tests__/integration/whoami.integration.test.js.map +0 -1
  136. package/dist/__tests__/outdated.test.d.ts +0 -2
  137. package/dist/__tests__/outdated.test.d.ts.map +0 -1
  138. package/dist/__tests__/outdated.test.js +0 -67
  139. package/dist/__tests__/outdated.test.js.map +0 -1
  140. package/dist/__tests__/populate.test.d.ts +0 -2
  141. package/dist/__tests__/populate.test.d.ts.map +0 -1
  142. package/dist/__tests__/populate.test.js +0 -445
  143. package/dist/__tests__/populate.test.js.map +0 -1
  144. package/dist/__tests__/tsconfig-upgrader.test.d.ts +0 -2
  145. package/dist/__tests__/tsconfig-upgrader.test.d.ts.map +0 -1
  146. package/dist/__tests__/tsconfig-upgrader.test.js +0 -31
  147. package/dist/__tests__/tsconfig-upgrader.test.js.map +0 -1
  148. package/dist/ca-certificate/validation.test.d.ts +0 -2
  149. package/dist/ca-certificate/validation.test.d.ts.map +0 -1
  150. package/dist/ca-certificate/validation.test.js +0 -131
  151. package/dist/ca-certificate/validation.test.js.map +0 -1
  152. package/dist/common/analytics/cli-invocation.test.d.ts +0 -2
  153. package/dist/common/analytics/cli-invocation.test.d.ts.map +0 -1
  154. package/dist/common/analytics/cli-invocation.test.js +0 -51
  155. package/dist/common/analytics/cli-invocation.test.js.map +0 -1
  156. package/dist/common/analytics/package-manager.test.d.ts +0 -2
  157. package/dist/common/analytics/package-manager.test.d.ts.map +0 -1
  158. package/dist/common/analytics/package-manager.test.js +0 -163
  159. package/dist/common/analytics/package-manager.test.js.map +0 -1
  160. package/dist/common/cli-dispatcher.test.d.ts +0 -2
  161. package/dist/common/cli-dispatcher.test.d.ts.map +0 -1
  162. package/dist/common/cli-dispatcher.test.js +0 -80
  163. package/dist/common/cli-dispatcher.test.js.map +0 -1
  164. package/dist/common/middleware/check-pnpm-lifecycle.test.d.ts +0 -2
  165. package/dist/common/middleware/check-pnpm-lifecycle.test.d.ts.map +0 -1
  166. package/dist/common/middleware/check-pnpm-lifecycle.test.js +0 -125
  167. package/dist/common/middleware/check-pnpm-lifecycle.test.js.map +0 -1
  168. package/dist/common/middleware/get-environment-param.test.d.ts +0 -2
  169. package/dist/common/middleware/get-environment-param.test.d.ts.map +0 -1
  170. package/dist/common/middleware/get-environment-param.test.js +0 -57
  171. package/dist/common/middleware/get-environment-param.test.js.map +0 -1
  172. package/dist/common/read-linked-config.test.d.ts +0 -2
  173. package/dist/common/read-linked-config.test.d.ts.map +0 -1
  174. package/dist/common/read-linked-config.test.js +0 -363
  175. package/dist/common/read-linked-config.test.js.map +0 -1
  176. package/dist/common/terminal.test.d.ts +0 -2
  177. package/dist/common/terminal.test.d.ts.map +0 -1
  178. package/dist/common/terminal.test.js +0 -101
  179. package/dist/common/terminal.test.js.map +0 -1
  180. package/dist/common/utils/build-environment-prompt-choices.test.d.ts +0 -2
  181. package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +0 -1
  182. package/dist/common/utils/build-environment-prompt-choices.test.js +0 -97
  183. package/dist/common/utils/build-environment-prompt-choices.test.js.map +0 -1
  184. package/dist/common/utils/format-environment-type.test.d.ts +0 -2
  185. package/dist/common/utils/format-environment-type.test.d.ts.map +0 -1
  186. package/dist/common/utils/format-environment-type.test.js +0 -32
  187. package/dist/common/utils/format-environment-type.test.js.map +0 -1
  188. package/dist/common/utils/pnpm-lifecycle.test.d.ts +0 -2
  189. package/dist/common/utils/pnpm-lifecycle.test.d.ts.map +0 -1
  190. package/dist/common/utils/pnpm-lifecycle.test.js +0 -196
  191. package/dist/common/utils/pnpm-lifecycle.test.js.map +0 -1
  192. package/dist/common/utils/pretty-print-environment-prompt.test.d.ts +0 -2
  193. package/dist/common/utils/pretty-print-environment-prompt.test.d.ts.map +0 -1
  194. package/dist/common/utils/pretty-print-environment-prompt.test.js +0 -42
  195. package/dist/common/utils/pretty-print-environment-prompt.test.js.map +0 -1
  196. package/dist/common/utils/sort-environments-for-prompt.test.d.ts +0 -2
  197. package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +0 -1
  198. package/dist/common/utils/sort-environments-for-prompt.test.js +0 -82
  199. package/dist/common/utils/sort-environments-for-prompt.test.js.map +0 -1
  200. package/dist/common/utils/stringify-config.test.d.ts +0 -2
  201. package/dist/common/utils/stringify-config.test.d.ts.map +0 -1
  202. package/dist/common/utils/stringify-config.test.js +0 -80
  203. package/dist/common/utils/stringify-config.test.js.map +0 -1
  204. package/dist/common/validators/argument-validators.spec.d.ts +0 -2
  205. package/dist/common/validators/argument-validators.spec.d.ts.map +0 -1
  206. package/dist/common/validators/argument-validators.spec.js +0 -181
  207. package/dist/common/validators/argument-validators.spec.js.map +0 -1
  208. package/dist/deploy/archive.local-registry.test.d.ts +0 -2
  209. package/dist/deploy/archive.local-registry.test.d.ts.map +0 -1
  210. package/dist/deploy/archive.local-registry.test.js +0 -100
  211. package/dist/deploy/archive.local-registry.test.js.map +0 -1
  212. package/dist/deploy/archive.test.d.ts +0 -2
  213. package/dist/deploy/archive.test.d.ts.map +0 -1
  214. package/dist/deploy/archive.test.js +0 -248
  215. package/dist/deploy/archive.test.js.map +0 -1
  216. package/dist/deploy/classify-build-probe.test.d.ts +0 -2
  217. package/dist/deploy/classify-build-probe.test.d.ts.map +0 -1
  218. package/dist/deploy/classify-build-probe.test.js +0 -51
  219. package/dist/deploy/classify-build-probe.test.js.map +0 -1
  220. package/dist/deploy/poll-deployment.test.d.ts +0 -2
  221. package/dist/deploy/poll-deployment.test.d.ts.map +0 -1
  222. package/dist/deploy/poll-deployment.test.js +0 -158
  223. package/dist/deploy/poll-deployment.test.js.map +0 -1
  224. package/dist/dev/zuplo-local-gitignore.test.d.ts +0 -2
  225. package/dist/dev/zuplo-local-gitignore.test.d.ts.map +0 -1
  226. package/dist/dev/zuplo-local-gitignore.test.js +0 -58
  227. package/dist/dev/zuplo-local-gitignore.test.js.map +0 -1
  228. package/dist/editor/e2e/editor.spec.d.ts +0 -2
  229. package/dist/editor/e2e/editor.spec.d.ts.map +0 -1
  230. package/dist/editor/e2e/editor.spec.js +0 -44
  231. package/dist/editor/e2e/editor.spec.js.map +0 -1
  232. package/dist/link/project-type.test.d.ts +0 -2
  233. package/dist/link/project-type.test.d.ts.map +0 -1
  234. package/dist/link/project-type.test.js +0 -225
  235. package/dist/link/project-type.test.js.map +0 -1
  236. package/dist/lint/resolve-binary.test.d.ts +0 -2
  237. package/dist/lint/resolve-binary.test.d.ts.map +0 -1
  238. package/dist/lint/resolve-binary.test.js +0 -155
  239. package/dist/lint/resolve-binary.test.js.map +0 -1
  240. package/dist/open-api/convert/handler.spec.d.ts +0 -2
  241. package/dist/open-api/convert/handler.spec.d.ts.map +0 -1
  242. package/dist/open-api/convert/handler.spec.js +0 -301
  243. package/dist/open-api/convert/handler.spec.js.map +0 -1
  244. package/dist/open-api/merge/handler.spec.d.ts +0 -2
  245. package/dist/open-api/merge/handler.spec.d.ts.map +0 -1
  246. package/dist/open-api/merge/handler.spec.js +0 -673
  247. package/dist/open-api/merge/handler.spec.js.map +0 -1
  248. package/dist/open-api/overlay/handler.spec.d.ts +0 -2
  249. package/dist/open-api/overlay/handler.spec.d.ts.map +0 -1
  250. package/dist/open-api/overlay/handler.spec.js +0 -346
  251. package/dist/open-api/overlay/handler.spec.js.map +0 -1
  252. package/dist/source/ai-gateway/files.test.d.ts +0 -2
  253. package/dist/source/ai-gateway/files.test.d.ts.map +0 -1
  254. package/dist/source/ai-gateway/files.test.js +0 -135
  255. package/dist/source/ai-gateway/files.test.js.map +0 -1
  256. package/dist/source/ai-gateway/handler.test.d.ts +0 -2
  257. package/dist/source/ai-gateway/handler.test.d.ts.map +0 -1
  258. package/dist/source/ai-gateway/handler.test.js +0 -113
  259. package/dist/source/ai-gateway/handler.test.js.map +0 -1
  260. package/dist/source/ai-gateway/package.test.d.ts +0 -2
  261. package/dist/source/ai-gateway/package.test.d.ts.map +0 -1
  262. package/dist/source/ai-gateway/package.test.js +0 -30
  263. package/dist/source/ai-gateway/package.test.js.map +0 -1
  264. package/dist/source/ai-gateway/planner.test.d.ts +0 -2
  265. package/dist/source/ai-gateway/planner.test.d.ts.map +0 -1
  266. package/dist/source/ai-gateway/planner.test.js +0 -330
  267. package/dist/source/ai-gateway/planner.test.js.map +0 -1
  268. package/dist/source/ai-gateway/release.test.d.ts +0 -2
  269. package/dist/source/ai-gateway/release.test.d.ts.map +0 -1
  270. package/dist/source/ai-gateway/release.test.js +0 -62
  271. package/dist/source/ai-gateway/release.test.js.map +0 -1
  272. package/dist/test/invoke-test.test.d.ts +0 -2
  273. package/dist/test/invoke-test.test.d.ts.map +0 -1
  274. package/dist/test/invoke-test.test.js +0 -150
  275. package/dist/test/invoke-test.test.js.map +0 -1
  276. package/dist/test/test-files.test.d.ts +0 -2
  277. package/dist/test/test-files.test.d.ts.map +0 -1
  278. package/dist/test/test-files.test.js +0 -57
  279. package/dist/test/test-files.test.js.map +0 -1
  280. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.d.ts +0 -2
  281. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.d.ts.map +0 -1
  282. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.js +0 -289
  283. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.js.map +0 -1
  284. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.d.ts +0 -2
  285. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.d.ts.map +0 -1
  286. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.js +0 -181
  287. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.js.map +0 -1
  288. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.d.ts +0 -2
  289. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.d.ts.map +0 -1
  290. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.js +0 -399
  291. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.js.map +0 -1
  292. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.d.ts +0 -2
  293. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.d.ts.map +0 -1
  294. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js +0 -779
  295. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js.map +0 -1
  296. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.d.ts +0 -2
  297. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.d.ts.map +0 -1
  298. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.js +0 -269
  299. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.js.map +0 -1
  300. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.d.ts +0 -2
  301. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.d.ts.map +0 -1
  302. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.js +0 -93
  303. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.js.map +0 -1
  304. package/node_modules/@zuplo/runtime/out/esm/chunk-6YPRGG62.js.map +0 -1
  305. package/node_modules/@zuplo/runtime/out/esm/chunk-PBDT4FDO.js +0 -37
  306. package/node_modules/@zuplo/runtime/out/esm/chunk-PBDT4FDO.js.map +0 -1
  307. /package/node_modules/@zuplo/runtime/out/esm/{chunk-YJ2BHVUH.js.map → chunk-CDEAY3VY.js.map} +0 -0
  308. /package/node_modules/@zuplo/runtime/out/esm/{chunk-PBDT4FDO.js.LEGAL.txt → chunk-LVSZ3WTO.js.LEGAL.txt} +0 -0
  309. /package/node_modules/@zuplo/runtime/out/esm/{chunk-VTO3F6DK.js.map → chunk-NUVXDVLJ.js.map} +0 -0
  310. /package/node_modules/@zuplo/runtime/out/esm/{chunk-6YPRGG62.js.LEGAL.txt → chunk-RHU3Z7DA.js.LEGAL.txt} +0 -0
@@ -1,202 +0,0 @@
1
- import { confirmLinkedConfig } from "../../common/middleware/confirm-linked-config.js";
2
- import { confirmLinkedValue, readLinkedConfig, USE_LINKED_DETAILS, } from "../../common/read-linked-config.js";
3
- import { isInteractiveTerminal } from "../../common/terminal.js";
4
- import { cleanupTest, setupTestEnvironment, TEST_ACCOUNT_NAME, TEST_AUTH_TOKEN, TEST_PROJECT_NAME, } from "./test-utils.js";
5
- jest.mock("../../common/read-linked-config.js", () => ({
6
- __esModule: true,
7
- confirmLinkedValue: jest.fn().mockResolvedValue(true),
8
- readLinkedConfig: jest.fn().mockResolvedValue({}),
9
- USE_LINKED_DETAILS: "useLinkedDetails",
10
- ignoreLinkedDetails: jest
11
- .fn()
12
- .mockImplementation((argv) => {
13
- argv["useLinkedDetails"] = false;
14
- }),
15
- }));
16
- jest.mock("../../common/terminal.js", () => ({
17
- __esModule: true,
18
- isInteractiveTerminal: jest.fn().mockReturnValue(true),
19
- }));
20
- describe("confirmLinkedConfig middleware", () => {
21
- beforeEach(() => {
22
- setupTestEnvironment();
23
- jest.clearAllMocks();
24
- jest.mocked(isInteractiveTerminal).mockReturnValue(true);
25
- jest.mocked(confirmLinkedValue).mockResolvedValue(true);
26
- jest.mocked(readLinkedConfig).mockResolvedValue({});
27
- });
28
- afterEach(() => {
29
- cleanupTest();
30
- });
31
- describe("when both account and project are linked and the terminal is interactive", () => {
32
- it("asks a single combined Y/n prompt and sets both values on accept", async () => {
33
- jest.mocked(readLinkedConfig).mockResolvedValue({
34
- accountName: TEST_ACCOUNT_NAME,
35
- projectName: TEST_PROJECT_NAME,
36
- });
37
- jest.mocked(confirmLinkedValue).mockResolvedValue(true);
38
- const argv = { authToken: TEST_AUTH_TOKEN };
39
- await confirmLinkedConfig(argv);
40
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
41
- expect(confirmLinkedValue).toHaveBeenCalledWith(`Use linked project '${TEST_PROJECT_NAME}' in account '${TEST_ACCOUNT_NAME}'?`);
42
- expect(argv.account).toBe(TEST_ACCOUNT_NAME);
43
- expect(argv.project).toBe(TEST_PROJECT_NAME);
44
- expect(argv[USE_LINKED_DETAILS]).not.toBe(false);
45
- });
46
- it("sets useLinkedDetails=false on decline so downstream pickers run", async () => {
47
- jest.mocked(readLinkedConfig).mockResolvedValue({
48
- accountName: TEST_ACCOUNT_NAME,
49
- projectName: TEST_PROJECT_NAME,
50
- });
51
- jest.mocked(confirmLinkedValue).mockResolvedValue(false);
52
- const argv = { authToken: TEST_AUTH_TOKEN };
53
- await confirmLinkedConfig(argv);
54
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
55
- expect(argv[USE_LINKED_DETAILS]).toBe(false);
56
- expect(argv.account).toBeUndefined();
57
- expect(argv.project).toBeUndefined();
58
- });
59
- });
60
- describe("when the terminal is non-interactive (CI/CD)", () => {
61
- it("silently uses both linked values without prompting", async () => {
62
- jest.mocked(readLinkedConfig).mockResolvedValue({
63
- accountName: TEST_ACCOUNT_NAME,
64
- projectName: TEST_PROJECT_NAME,
65
- });
66
- jest.mocked(isInteractiveTerminal).mockReturnValue(false);
67
- const argv = { authToken: TEST_AUTH_TOKEN };
68
- await confirmLinkedConfig(argv);
69
- expect(confirmLinkedValue).not.toHaveBeenCalled();
70
- expect(argv.account).toBe(TEST_ACCOUNT_NAME);
71
- expect(argv.project).toBe(TEST_PROJECT_NAME);
72
- });
73
- });
74
- describe("when one of --account or --project is already supplied", () => {
75
- it("skips entirely when --account is supplied (defers to fetchProject)", async () => {
76
- jest.mocked(readLinkedConfig).mockResolvedValue({
77
- accountName: TEST_ACCOUNT_NAME,
78
- projectName: TEST_PROJECT_NAME,
79
- });
80
- const argv = {
81
- authToken: TEST_AUTH_TOKEN,
82
- account: "explicit-account",
83
- };
84
- await confirmLinkedConfig(argv);
85
- expect(confirmLinkedValue).not.toHaveBeenCalled();
86
- expect(readLinkedConfig).not.toHaveBeenCalled();
87
- expect(argv.account).toBe("explicit-account");
88
- expect(argv.project).toBeUndefined();
89
- });
90
- it("skips entirely when --project is supplied (defers to fetchAccount)", async () => {
91
- jest.mocked(readLinkedConfig).mockResolvedValue({
92
- accountName: TEST_ACCOUNT_NAME,
93
- projectName: TEST_PROJECT_NAME,
94
- });
95
- const argv = {
96
- authToken: TEST_AUTH_TOKEN,
97
- project: "explicit-project",
98
- };
99
- await confirmLinkedConfig(argv);
100
- expect(confirmLinkedValue).not.toHaveBeenCalled();
101
- expect(readLinkedConfig).not.toHaveBeenCalled();
102
- expect(argv.project).toBe("explicit-project");
103
- expect(argv.account).toBeUndefined();
104
- });
105
- it("skips entirely when both flags are supplied", async () => {
106
- const argv = {
107
- authToken: TEST_AUTH_TOKEN,
108
- account: "explicit-account",
109
- project: "explicit-project",
110
- };
111
- await confirmLinkedConfig(argv);
112
- expect(confirmLinkedValue).not.toHaveBeenCalled();
113
- expect(readLinkedConfig).not.toHaveBeenCalled();
114
- });
115
- it("skips entirely when --account is supplied as an array (repeated flag)", async () => {
116
- jest.mocked(readLinkedConfig).mockResolvedValue({
117
- accountName: TEST_ACCOUNT_NAME,
118
- projectName: TEST_PROJECT_NAME,
119
- });
120
- const argv = {
121
- authToken: TEST_AUTH_TOKEN,
122
- account: ["a", "b"],
123
- };
124
- await confirmLinkedConfig(argv);
125
- expect(confirmLinkedValue).not.toHaveBeenCalled();
126
- expect(readLinkedConfig).not.toHaveBeenCalled();
127
- expect(argv.account).toEqual(["a", "b"]);
128
- });
129
- });
130
- describe("when --no-prompt is set (argv.prompt === false)", () => {
131
- it("auto-accepts both linked values without prompting", async () => {
132
- jest.mocked(readLinkedConfig).mockResolvedValue({
133
- accountName: TEST_ACCOUNT_NAME,
134
- projectName: TEST_PROJECT_NAME,
135
- });
136
- const argv = {
137
- authToken: TEST_AUTH_TOKEN,
138
- prompt: false,
139
- };
140
- await confirmLinkedConfig(argv);
141
- expect(confirmLinkedValue).not.toHaveBeenCalled();
142
- expect(argv.account).toBe(TEST_ACCOUNT_NAME);
143
- expect(argv.project).toBe(TEST_PROJECT_NAME);
144
- });
145
- });
146
- describe("when the linked config is partial", () => {
147
- it("skips when only the account is linked (defers to fetchAccount's single prompt)", async () => {
148
- jest.mocked(readLinkedConfig).mockResolvedValue({
149
- accountName: TEST_ACCOUNT_NAME,
150
- });
151
- const argv = { authToken: TEST_AUTH_TOKEN };
152
- await confirmLinkedConfig(argv);
153
- expect(confirmLinkedValue).not.toHaveBeenCalled();
154
- expect(argv.account).toBeUndefined();
155
- expect(argv.project).toBeUndefined();
156
- });
157
- it("skips when only the project is linked", async () => {
158
- jest.mocked(readLinkedConfig).mockResolvedValue({
159
- projectName: TEST_PROJECT_NAME,
160
- });
161
- const argv = { authToken: TEST_AUTH_TOKEN };
162
- await confirmLinkedConfig(argv);
163
- expect(confirmLinkedValue).not.toHaveBeenCalled();
164
- expect(argv.account).toBeUndefined();
165
- expect(argv.project).toBeUndefined();
166
- });
167
- it("skips when no linked config exists", async () => {
168
- jest.mocked(readLinkedConfig).mockResolvedValue({});
169
- const argv = { authToken: TEST_AUTH_TOKEN };
170
- await confirmLinkedConfig(argv);
171
- expect(confirmLinkedValue).not.toHaveBeenCalled();
172
- });
173
- });
174
- describe("when useLinkedDetails is already false (link command path)", () => {
175
- it("skips entirely without reading linked config", async () => {
176
- const argv = {
177
- authToken: TEST_AUTH_TOKEN,
178
- [USE_LINKED_DETAILS]: false,
179
- };
180
- await confirmLinkedConfig(argv);
181
- expect(readLinkedConfig).not.toHaveBeenCalled();
182
- expect(confirmLinkedValue).not.toHaveBeenCalled();
183
- expect(argv[USE_LINKED_DETAILS]).toBe(false);
184
- });
185
- });
186
- describe("when an api-key is supplied", () => {
187
- it("skips entirely (account is resolved via the api-key)", async () => {
188
- jest.mocked(readLinkedConfig).mockResolvedValue({
189
- accountName: TEST_ACCOUNT_NAME,
190
- projectName: TEST_PROJECT_NAME,
191
- });
192
- const argv = {
193
- authToken: TEST_AUTH_TOKEN,
194
- "api-key": "zpka_some_key",
195
- };
196
- await confirmLinkedConfig(argv);
197
- expect(confirmLinkedValue).not.toHaveBeenCalled();
198
- expect(readLinkedConfig).not.toHaveBeenCalled();
199
- });
200
- });
201
- });
202
- //# sourceMappingURL=confirm-linked-config.integration.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-linked-config.integration.test.js","sourceRoot":"","sources":["../../../src/__tests__/integration/confirm-linked-config.integration.test.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,IAAI,CAAC,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE,CAAC,CAAC;IACrD,UAAU,EAAE,IAAI;IAChB,kBAAkB,EAAE,IAAI,CAAC,EA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,IAAI,CAAC,CAAC;YAEhC,MAAM,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;YAClD,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Integration tests for the confirmLinkedConfig middleware.\n *\n * The middleware merges the two legacy \"Use linked account?\" / \"Use linked\n * project?\" prompts into a single combined Y/n. CI/CD safety is delegated to\n * the existing isInteractiveTerminal() check used elsewhere in the CLI — these\n * tests verify both the interactive UX and that non-interactive runs skip the\n * prompt entirely.\n */\n/// <reference types=\"jest\" />\nimport { confirmLinkedConfig } from \"../../common/middleware/confirm-linked-config.js\";\nimport {\n confirmLinkedValue,\n readLinkedConfig,\n USE_LINKED_DETAILS,\n} from \"../../common/read-linked-config.js\";\nimport { isInteractiveTerminal } from \"../../common/terminal.js\";\nimport {\n cleanupTest,\n setupTestEnvironment,\n TEST_ACCOUNT_NAME,\n TEST_AUTH_TOKEN,\n TEST_PROJECT_NAME,\n} from \"./test-utils.js\";\n\njest.mock(\"../../common/read-linked-config.js\", () => ({\n __esModule: true,\n confirmLinkedValue: jest.fn().mockResolvedValue(true),\n readLinkedConfig: jest.fn().mockResolvedValue({}),\n USE_LINKED_DETAILS: \"useLinkedDetails\",\n ignoreLinkedDetails: jest\n .fn()\n .mockImplementation((argv: Record<string, unknown>) => {\n argv[\"useLinkedDetails\"] = false;\n }),\n}));\n\njest.mock(\"../../common/terminal.js\", () => ({\n __esModule: true,\n isInteractiveTerminal: jest.fn().mockReturnValue(true),\n}));\n\ndescribe(\"confirmLinkedConfig middleware\", () => {\n beforeEach(() => {\n setupTestEnvironment();\n jest.clearAllMocks();\n jest.mocked(isInteractiveTerminal).mockReturnValue(true);\n jest.mocked(confirmLinkedValue).mockResolvedValue(true);\n jest.mocked(readLinkedConfig).mockResolvedValue({});\n });\n\n afterEach(() => {\n cleanupTest();\n });\n\n describe(\"when both account and project are linked and the terminal is interactive\", () => {\n it(\"asks a single combined Y/n prompt and sets both values on accept\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n jest.mocked(confirmLinkedValue).mockResolvedValue(true);\n\n const argv: Record<string, unknown> = { authToken: TEST_AUTH_TOKEN };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n expect(confirmLinkedValue).toHaveBeenCalledWith(\n `Use linked project '${TEST_PROJECT_NAME}' in account '${TEST_ACCOUNT_NAME}'?`\n );\n expect(argv.account).toBe(TEST_ACCOUNT_NAME);\n expect(argv.project).toBe(TEST_PROJECT_NAME);\n expect(argv[USE_LINKED_DETAILS]).not.toBe(false);\n });\n\n it(\"sets useLinkedDetails=false on decline so downstream pickers run\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n jest.mocked(confirmLinkedValue).mockResolvedValue(false);\n\n const argv: Record<string, unknown> = { authToken: TEST_AUTH_TOKEN };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n expect(argv[USE_LINKED_DETAILS]).toBe(false);\n expect(argv.account).toBeUndefined();\n expect(argv.project).toBeUndefined();\n });\n });\n\n describe(\"when the terminal is non-interactive (CI/CD)\", () => {\n it(\"silently uses both linked values without prompting\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n jest.mocked(isInteractiveTerminal).mockReturnValue(false);\n\n const argv: Record<string, unknown> = { authToken: TEST_AUTH_TOKEN };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(argv.account).toBe(TEST_ACCOUNT_NAME);\n expect(argv.project).toBe(TEST_PROJECT_NAME);\n });\n });\n\n describe(\"when one of --account or --project is already supplied\", () => {\n it(\"skips entirely when --account is supplied (defers to fetchProject)\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n account: \"explicit-account\",\n };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(readLinkedConfig).not.toHaveBeenCalled();\n expect(argv.account).toBe(\"explicit-account\");\n expect(argv.project).toBeUndefined();\n });\n\n it(\"skips entirely when --project is supplied (defers to fetchAccount)\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n project: \"explicit-project\",\n };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(readLinkedConfig).not.toHaveBeenCalled();\n expect(argv.project).toBe(\"explicit-project\");\n expect(argv.account).toBeUndefined();\n });\n\n it(\"skips entirely when both flags are supplied\", async () => {\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n account: \"explicit-account\",\n project: \"explicit-project\",\n };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(readLinkedConfig).not.toHaveBeenCalled();\n });\n\n it(\"skips entirely when --account is supplied as an array (repeated flag)\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n account: [\"a\", \"b\"],\n };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(readLinkedConfig).not.toHaveBeenCalled();\n expect(argv.account).toEqual([\"a\", \"b\"]);\n });\n });\n\n describe(\"when --no-prompt is set (argv.prompt === false)\", () => {\n it(\"auto-accepts both linked values without prompting\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n prompt: false,\n };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(argv.account).toBe(TEST_ACCOUNT_NAME);\n expect(argv.project).toBe(TEST_PROJECT_NAME);\n });\n });\n\n describe(\"when the linked config is partial\", () => {\n it(\"skips when only the account is linked (defers to fetchAccount's single prompt)\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n });\n\n const argv: Record<string, unknown> = { authToken: TEST_AUTH_TOKEN };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(argv.account).toBeUndefined();\n expect(argv.project).toBeUndefined();\n });\n\n it(\"skips when only the project is linked\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n projectName: TEST_PROJECT_NAME,\n });\n\n const argv: Record<string, unknown> = { authToken: TEST_AUTH_TOKEN };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(argv.account).toBeUndefined();\n expect(argv.project).toBeUndefined();\n });\n\n it(\"skips when no linked config exists\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({});\n\n const argv: Record<string, unknown> = { authToken: TEST_AUTH_TOKEN };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n });\n\n describe(\"when useLinkedDetails is already false (link command path)\", () => {\n it(\"skips entirely without reading linked config\", async () => {\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n [USE_LINKED_DETAILS]: false,\n };\n await confirmLinkedConfig(argv);\n\n expect(readLinkedConfig).not.toHaveBeenCalled();\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(argv[USE_LINKED_DETAILS]).toBe(false);\n });\n });\n\n describe(\"when an api-key is supplied\", () => {\n it(\"skips entirely (account is resolved via the api-key)\", async () => {\n jest.mocked(readLinkedConfig).mockResolvedValue({\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n });\n\n const argv: Record<string, unknown> = {\n authToken: TEST_AUTH_TOKEN,\n \"api-key\": \"zpka_some_key\",\n };\n await confirmLinkedConfig(argv);\n\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n expect(readLinkedConfig).not.toHaveBeenCalled();\n });\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-production-deploy.integration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-production-deploy.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/confirm-production-deploy.integration.test.ts"],"names":[],"mappings":""}
@@ -1,184 +0,0 @@
1
- import { confirmProductionDeploy } from "../../common/middleware/confirm-production-deploy.js";
2
- import { ENVIRONMENT_EXPLICIT_KEY, FETCHED_ENVIRONMENTS_KEY, } from "../../common/middleware/get-environment-param.js";
3
- import { printCancellationToConsoleAndExitGracefully } from "../../common/output.js";
4
- import { confirmLinkedValue } from "../../common/read-linked-config.js";
5
- import { isInteractiveTerminal } from "../../common/terminal.js";
6
- import { cleanupTest, setupTestEnvironment, TEST_ACCOUNT_NAME, TEST_AUTH_TOKEN, TEST_PROJECT_NAME, } from "./test-utils.js";
7
- jest.mock("../../common/read-linked-config.js", () => ({
8
- __esModule: true,
9
- confirmLinkedValue: jest.fn().mockResolvedValue(true),
10
- }));
11
- jest.mock("../../common/terminal.js", () => ({
12
- __esModule: true,
13
- isInteractiveTerminal: jest.fn().mockReturnValue(true),
14
- }));
15
- jest.mock("../../common/output.js", () => ({
16
- __esModule: true,
17
- printCancellationToConsoleAndExitGracefully: jest
18
- .fn()
19
- .mockImplementation(() => {
20
- throw new Error("cancelled");
21
- }),
22
- }));
23
- function baseArgv(overrides = {}) {
24
- return {
25
- authToken: TEST_AUTH_TOKEN,
26
- account: TEST_ACCOUNT_NAME,
27
- project: TEST_PROJECT_NAME,
28
- ...overrides,
29
- };
30
- }
31
- describe("confirmProductionDeploy middleware", () => {
32
- beforeEach(() => {
33
- setupTestEnvironment();
34
- jest.clearAllMocks();
35
- jest.mocked(isInteractiveTerminal).mockReturnValue(true);
36
- jest.mocked(confirmLinkedValue).mockResolvedValue(true);
37
- jest
38
- .mocked(printCancellationToConsoleAndExitGracefully)
39
- .mockImplementation((() => {
40
- throw new Error("cancelled");
41
- }));
42
- });
43
- afterEach(() => {
44
- cleanupTest();
45
- });
46
- describe("when the env was inferred from a production branch and the terminal is interactive", () => {
47
- it("prompts with default No for branch 'main' and proceeds on accept", async () => {
48
- jest.mocked(confirmLinkedValue).mockResolvedValue(true);
49
- const argv = baseArgv({
50
- environment: "main",
51
- [ENVIRONMENT_EXPLICIT_KEY]: false,
52
- });
53
- await confirmProductionDeploy(argv);
54
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
55
- const [message, options] = jest.mocked(confirmLinkedValue).mock.calls[0];
56
- expect(message).toContain("'main' production environment");
57
- expect(message).toContain(`'${TEST_PROJECT_NAME}'`);
58
- expect(message).toContain(`'${TEST_ACCOUNT_NAME}'`);
59
- expect(options).toEqual({ defaultYes: false });
60
- expect(printCancellationToConsoleAndExitGracefully).not.toHaveBeenCalled();
61
- });
62
- it("cancels via the graceful exit helper when the user declines", async () => {
63
- jest.mocked(confirmLinkedValue).mockResolvedValue(false);
64
- const argv = baseArgv({
65
- environment: "main",
66
- [ENVIRONMENT_EXPLICIT_KEY]: false,
67
- });
68
- await expect(confirmProductionDeploy(argv)).rejects.toThrow("cancelled");
69
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
70
- expect(printCancellationToConsoleAndExitGracefully).toHaveBeenCalledWith("Deployment cancelled.");
71
- });
72
- it("prompts for branch 'master'", async () => {
73
- const argv = baseArgv({
74
- environment: "master",
75
- [ENVIRONMENT_EXPLICIT_KEY]: false,
76
- });
77
- await confirmProductionDeploy(argv);
78
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
79
- });
80
- it("prompts for branch 'production' without duplicating the word in the message", async () => {
81
- const argv = baseArgv({
82
- environment: "production",
83
- [ENVIRONMENT_EXPLICIT_KEY]: false,
84
- });
85
- await confirmProductionDeploy(argv);
86
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
87
- const [message] = jest.mocked(confirmLinkedValue).mock.calls[0];
88
- expect(message).toContain("the production environment");
89
- expect(message).not.toContain("'production' production environment");
90
- });
91
- it("prompts when the environment list reports environmentType=production for a non-standard name", async () => {
92
- const argv = baseArgv({
93
- environment: "live",
94
- [ENVIRONMENT_EXPLICIT_KEY]: false,
95
- [FETCHED_ENVIRONMENTS_KEY]: [
96
- {
97
- name: "live",
98
- accountName: TEST_ACCOUNT_NAME,
99
- projectName: TEST_PROJECT_NAME,
100
- createdOn: null,
101
- branchName: "live",
102
- environmentType: "production",
103
- },
104
- ],
105
- });
106
- await confirmProductionDeploy(argv);
107
- expect(confirmLinkedValue).toHaveBeenCalledTimes(1);
108
- });
109
- });
110
- describe("when the env is not production", () => {
111
- it("does not prompt for a feature branch", async () => {
112
- const argv = baseArgv({
113
- environment: "feature/login",
114
- [ENVIRONMENT_EXPLICIT_KEY]: false,
115
- });
116
- await confirmProductionDeploy(argv);
117
- expect(confirmLinkedValue).not.toHaveBeenCalled();
118
- });
119
- it("does not prompt when cached environmentType is not production", async () => {
120
- const argv = baseArgv({
121
- environment: "preview-1",
122
- [ENVIRONMENT_EXPLICIT_KEY]: false,
123
- [FETCHED_ENVIRONMENTS_KEY]: [
124
- {
125
- name: "preview-1",
126
- accountName: TEST_ACCOUNT_NAME,
127
- projectName: TEST_PROJECT_NAME,
128
- createdOn: null,
129
- branchName: "preview-1",
130
- environmentType: "preview",
131
- },
132
- ],
133
- });
134
- await confirmProductionDeploy(argv);
135
- expect(confirmLinkedValue).not.toHaveBeenCalled();
136
- });
137
- });
138
- describe("when the user opts out of the prompt", () => {
139
- it("does not prompt when --environment was passed explicitly", async () => {
140
- const argv = baseArgv({
141
- environment: "main",
142
- [ENVIRONMENT_EXPLICIT_KEY]: true,
143
- });
144
- await confirmProductionDeploy(argv);
145
- expect(confirmLinkedValue).not.toHaveBeenCalled();
146
- });
147
- it("does not prompt when --no-prompt is set (argv.prompt === false)", async () => {
148
- const argv = baseArgv({
149
- environment: "main",
150
- [ENVIRONMENT_EXPLICIT_KEY]: false,
151
- prompt: false,
152
- });
153
- await confirmProductionDeploy(argv);
154
- expect(confirmLinkedValue).not.toHaveBeenCalled();
155
- });
156
- });
157
- describe("when the terminal is non-interactive (CI/CD)", () => {
158
- it("does not prompt", async () => {
159
- jest.mocked(isInteractiveTerminal).mockReturnValue(false);
160
- const argv = baseArgv({
161
- environment: "main",
162
- [ENVIRONMENT_EXPLICIT_KEY]: false,
163
- });
164
- await confirmProductionDeploy(argv);
165
- expect(confirmLinkedValue).not.toHaveBeenCalled();
166
- });
167
- });
168
- describe("when argv.environment is missing or empty", () => {
169
- it("returns without prompting if environment is undefined", async () => {
170
- const argv = baseArgv({ [ENVIRONMENT_EXPLICIT_KEY]: false });
171
- await confirmProductionDeploy(argv);
172
- expect(confirmLinkedValue).not.toHaveBeenCalled();
173
- });
174
- it("returns without prompting if environment is empty string", async () => {
175
- const argv = baseArgv({
176
- environment: "",
177
- [ENVIRONMENT_EXPLICIT_KEY]: false,
178
- });
179
- await confirmProductionDeploy(argv);
180
- expect(confirmLinkedValue).not.toHaveBeenCalled();
181
- });
182
- });
183
- });
184
- //# sourceMappingURL=confirm-production-deploy.integration.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-production-deploy.integration.test.js","sourceRoot":"","sources":["../../../src/__tests__/integration/confirm-production-deploy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AC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Integration tests for the confirmProductionDeploy middleware.\n *\n * The middleware adds a Y/n (default No) prompt before deploying to a\n * production environment. It fires only when the terminal is interactive,\n * `--no-prompt` was not set, `--environment` was not passed, and the\n * resolved environment is \"production\" by branch-name heuristic\n * (main/master/production) or by server-reported environmentType when the\n * environments list is already cached. CI/CD is detected automatically via\n * isInteractiveTerminal.\n */\n/// <reference types=\"jest\" />\nimport { confirmProductionDeploy } from \"../../common/middleware/confirm-production-deploy.js\";\nimport {\n ENVIRONMENT_EXPLICIT_KEY,\n FETCHED_ENVIRONMENTS_KEY,\n} from \"../../common/middleware/get-environment-param.js\";\nimport { printCancellationToConsoleAndExitGracefully } from \"../../common/output.js\";\nimport { confirmLinkedValue } from \"../../common/read-linked-config.js\";\nimport { isInteractiveTerminal } from \"../../common/terminal.js\";\nimport {\n cleanupTest,\n setupTestEnvironment,\n TEST_ACCOUNT_NAME,\n TEST_AUTH_TOKEN,\n TEST_PROJECT_NAME,\n} from \"./test-utils.js\";\n\njest.mock(\"../../common/read-linked-config.js\", () => ({\n __esModule: true,\n confirmLinkedValue: jest.fn().mockResolvedValue(true),\n}));\n\njest.mock(\"../../common/terminal.js\", () => ({\n __esModule: true,\n isInteractiveTerminal: jest.fn().mockReturnValue(true),\n}));\n\n// Mock output module — the real one calls process.exit and pulls in the\n// analytics client, which we don't want in this ESM test context. The\n// middleware only needs the cancel helper here, substituted with a thrower so\n// we can assert the cancel path without actually exiting the process.\njest.mock(\"../../common/output.js\", () => ({\n __esModule: true,\n printCancellationToConsoleAndExitGracefully: jest\n .fn()\n .mockImplementation(() => {\n throw new Error(\"cancelled\");\n }),\n}));\n\nfunction baseArgv(overrides: Record<string, unknown> = {}) {\n return {\n authToken: TEST_AUTH_TOKEN,\n account: TEST_ACCOUNT_NAME,\n project: TEST_PROJECT_NAME,\n ...overrides,\n };\n}\n\ndescribe(\"confirmProductionDeploy middleware\", () => {\n beforeEach(() => {\n setupTestEnvironment();\n jest.clearAllMocks();\n jest.mocked(isInteractiveTerminal).mockReturnValue(true);\n jest.mocked(confirmLinkedValue).mockResolvedValue(true);\n jest\n .mocked(printCancellationToConsoleAndExitGracefully)\n .mockImplementation((() => {\n throw new Error(\"cancelled\");\n }) as never);\n });\n\n afterEach(() => {\n cleanupTest();\n });\n\n describe(\"when the env was inferred from a production branch and the terminal is interactive\", () => {\n it(\"prompts with default No for branch 'main' and proceeds on accept\", async () => {\n jest.mocked(confirmLinkedValue).mockResolvedValue(true);\n\n const argv = baseArgv({\n environment: \"main\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n await confirmProductionDeploy(argv);\n\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n const [message, options] = jest.mocked(confirmLinkedValue).mock.calls[0];\n expect(message).toContain(\"'main' production environment\");\n expect(message).toContain(`'${TEST_PROJECT_NAME}'`);\n expect(message).toContain(`'${TEST_ACCOUNT_NAME}'`);\n expect(options).toEqual({ defaultYes: false });\n expect(\n printCancellationToConsoleAndExitGracefully\n ).not.toHaveBeenCalled();\n });\n\n it(\"cancels via the graceful exit helper when the user declines\", async () => {\n jest.mocked(confirmLinkedValue).mockResolvedValue(false);\n\n const argv = baseArgv({\n environment: \"main\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n await expect(confirmProductionDeploy(argv)).rejects.toThrow(\"cancelled\");\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n expect(printCancellationToConsoleAndExitGracefully).toHaveBeenCalledWith(\n \"Deployment cancelled.\"\n );\n });\n\n it(\"prompts for branch 'master'\", async () => {\n const argv = baseArgv({\n environment: \"master\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n });\n\n it(\"prompts for branch 'production' without duplicating the word in the message\", async () => {\n const argv = baseArgv({\n environment: \"production\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n const [message] = jest.mocked(confirmLinkedValue).mock.calls[0];\n expect(message).toContain(\"the production environment\");\n expect(message).not.toContain(\"'production' production environment\");\n });\n\n it(\"prompts when the environment list reports environmentType=production for a non-standard name\", async () => {\n const argv = baseArgv({\n environment: \"live\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n [FETCHED_ENVIRONMENTS_KEY]: [\n {\n name: \"live\",\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n createdOn: null,\n branchName: \"live\",\n environmentType: \"production\",\n },\n ],\n });\n\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).toHaveBeenCalledTimes(1);\n });\n });\n\n describe(\"when the env is not production\", () => {\n it(\"does not prompt for a feature branch\", async () => {\n const argv = baseArgv({\n environment: \"feature/login\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n\n it(\"does not prompt when cached environmentType is not production\", async () => {\n const argv = baseArgv({\n environment: \"preview-1\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n [FETCHED_ENVIRONMENTS_KEY]: [\n {\n name: \"preview-1\",\n accountName: TEST_ACCOUNT_NAME,\n projectName: TEST_PROJECT_NAME,\n createdOn: null,\n branchName: \"preview-1\",\n environmentType: \"preview\",\n },\n ],\n });\n\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n });\n\n describe(\"when the user opts out of the prompt\", () => {\n it(\"does not prompt when --environment was passed explicitly\", async () => {\n const argv = baseArgv({\n environment: \"main\",\n [ENVIRONMENT_EXPLICIT_KEY]: true,\n });\n\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n\n it(\"does not prompt when --no-prompt is set (argv.prompt === false)\", async () => {\n const argv = baseArgv({\n environment: \"main\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n prompt: false,\n });\n\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n });\n\n describe(\"when the terminal is non-interactive (CI/CD)\", () => {\n it(\"does not prompt\", async () => {\n jest.mocked(isInteractiveTerminal).mockReturnValue(false);\n const argv = baseArgv({\n environment: \"main\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n });\n\n describe(\"when argv.environment is missing or empty\", () => {\n it(\"returns without prompting if environment is undefined\", async () => {\n const argv = baseArgv({ [ENVIRONMENT_EXPLICIT_KEY]: false });\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n\n it(\"returns without prompting if environment is empty string\", async () => {\n const argv = baseArgv({\n environment: \"\",\n [ENVIRONMENT_EXPLICIT_KEY]: false,\n });\n await confirmProductionDeploy(argv);\n expect(confirmLinkedValue).not.toHaveBeenCalled();\n });\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=custom-domain.integration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-domain.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/custom-domain.integration.test.ts"],"names":[],"mappings":""}