@zuplo/cli 7.11.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 (303) hide show
  1. package/node_modules/@hono/node-server/README.md +2 -0
  2. package/node_modules/@hono/node-server/dist/index.cjs +1 -1
  3. package/node_modules/@hono/node-server/dist/index.mjs +1 -1
  4. package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
  5. package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
  6. package/node_modules/@hono/node-server/package.json +1 -1
  7. package/node_modules/@posthog/core/dist/metrics/index.d.ts +9 -0
  8. package/node_modules/@posthog/core/dist/metrics/index.d.ts.map +1 -1
  9. package/node_modules/@posthog/core/dist/metrics/index.js +38 -3
  10. package/node_modules/@posthog/core/dist/metrics/index.mjs +38 -3
  11. package/node_modules/@posthog/core/dist/metrics/types.d.ts +7 -2
  12. package/node_modules/@posthog/core/dist/metrics/types.d.ts.map +1 -1
  13. package/node_modules/@posthog/core/dist/traces/ids.d.ts.map +1 -1
  14. package/node_modules/@posthog/core/dist/traces/ids.js +2 -2
  15. package/node_modules/@posthog/core/dist/traces/ids.mjs +2 -2
  16. package/node_modules/@posthog/core/package.json +2 -2
  17. package/node_modules/@posthog/core/src/metrics/index.spec.ts +75 -0
  18. package/node_modules/@posthog/core/src/metrics/index.ts +60 -0
  19. package/node_modules/@posthog/core/src/metrics/types.ts +7 -1
  20. package/node_modules/@posthog/core/src/traces/ids.ts +4 -2
  21. package/node_modules/@posthog/types/dist/capture-metric.d.ts +10 -0
  22. package/node_modules/@posthog/types/dist/capture-metric.d.ts.map +1 -1
  23. package/node_modules/@posthog/types/dist/index.d.ts +1 -1
  24. package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
  25. package/node_modules/@posthog/types/package.json +1 -1
  26. package/node_modules/@posthog/types/src/capture-metric.ts +11 -0
  27. package/node_modules/@posthog/types/src/index.ts +1 -0
  28. package/node_modules/@zuplo/core/customer.cli.minified.js +2 -2
  29. package/node_modules/@zuplo/core/index.minified.js +2 -2
  30. package/node_modules/@zuplo/core/package.json +1 -1
  31. package/node_modules/@zuplo/graphql/package.json +1 -1
  32. package/node_modules/@zuplo/openapi-tools/package.json +5 -2
  33. package/node_modules/@zuplo/otel/package.json +1 -1
  34. package/node_modules/@zuplo/runtime/out/esm/{chunk-YJ2BHVUH.js → chunk-CDEAY3VY.js} +2 -2
  35. package/node_modules/@zuplo/runtime/out/esm/chunk-LVSZ3WTO.js +37 -0
  36. package/node_modules/@zuplo/runtime/out/esm/chunk-LVSZ3WTO.js.map +1 -0
  37. package/node_modules/@zuplo/runtime/out/esm/{chunk-VTO3F6DK.js → chunk-NUVXDVLJ.js} +2 -2
  38. package/node_modules/@zuplo/runtime/out/esm/{chunk-6YPRGG62.js → chunk-RHU3Z7DA.js} +108 -108
  39. package/node_modules/@zuplo/runtime/out/esm/chunk-RHU3Z7DA.js.map +1 -0
  40. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  41. package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
  42. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  43. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  44. package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
  45. package/node_modules/@zuplo/runtime/out/types/index.d.ts +15 -24
  46. package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +14 -0
  47. package/node_modules/@zuplo/runtime/package.json +1 -1
  48. package/package.json +15 -12
  49. package/dist/__tests__/archive-utils.test.d.ts +0 -2
  50. package/dist/__tests__/archive-utils.test.d.ts.map +0 -1
  51. package/dist/__tests__/archive-utils.test.js +0 -50
  52. package/dist/__tests__/archive-utils.test.js.map +0 -1
  53. package/dist/__tests__/import-openapi.test.d.ts +0 -2
  54. package/dist/__tests__/import-openapi.test.d.ts.map +0 -1
  55. package/dist/__tests__/import-openapi.test.js +0 -251
  56. package/dist/__tests__/import-openapi.test.js.map +0 -1
  57. package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts +0 -2
  58. package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts.map +0 -1
  59. package/dist/__tests__/integration/confirm-linked-config.integration.test.js +0 -202
  60. package/dist/__tests__/integration/confirm-linked-config.integration.test.js.map +0 -1
  61. package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts +0 -2
  62. package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts.map +0 -1
  63. package/dist/__tests__/integration/confirm-production-deploy.integration.test.js +0 -184
  64. package/dist/__tests__/integration/confirm-production-deploy.integration.test.js.map +0 -1
  65. package/dist/__tests__/integration/custom-domain.integration.test.d.ts +0 -2
  66. package/dist/__tests__/integration/custom-domain.integration.test.d.ts.map +0 -1
  67. package/dist/__tests__/integration/custom-domain.integration.test.js +0 -563
  68. package/dist/__tests__/integration/custom-domain.integration.test.js.map +0 -1
  69. package/dist/__tests__/integration/delete.integration.test.d.ts +0 -2
  70. package/dist/__tests__/integration/delete.integration.test.d.ts.map +0 -1
  71. package/dist/__tests__/integration/delete.integration.test.js +0 -262
  72. package/dist/__tests__/integration/delete.integration.test.js.map +0 -1
  73. package/dist/__tests__/integration/deploy.integration.test.d.ts +0 -2
  74. package/dist/__tests__/integration/deploy.integration.test.d.ts.map +0 -1
  75. package/dist/__tests__/integration/deploy.integration.test.js +0 -519
  76. package/dist/__tests__/integration/deploy.integration.test.js.map +0 -1
  77. package/dist/__tests__/integration/get-project-param.integration.test.d.ts +0 -2
  78. package/dist/__tests__/integration/get-project-param.integration.test.d.ts.map +0 -1
  79. package/dist/__tests__/integration/get-project-param.integration.test.js +0 -305
  80. package/dist/__tests__/integration/get-project-param.integration.test.js.map +0 -1
  81. package/dist/__tests__/integration/info.integration.test.d.ts +0 -2
  82. package/dist/__tests__/integration/info.integration.test.d.ts.map +0 -1
  83. package/dist/__tests__/integration/info.integration.test.js +0 -293
  84. package/dist/__tests__/integration/info.integration.test.js.map +0 -1
  85. package/dist/__tests__/integration/jest-mocks-setup.d.ts +0 -2
  86. package/dist/__tests__/integration/jest-mocks-setup.d.ts.map +0 -1
  87. package/dist/__tests__/integration/jest-mocks-setup.js +0 -104
  88. package/dist/__tests__/integration/jest-mocks-setup.js.map +0 -1
  89. package/dist/__tests__/integration/jest-setup.d.ts +0 -2
  90. package/dist/__tests__/integration/jest-setup.d.ts.map +0 -1
  91. package/dist/__tests__/integration/jest-setup.js +0 -12
  92. package/dist/__tests__/integration/jest-setup.js.map +0 -1
  93. package/dist/__tests__/integration/link.integration.test.d.ts +0 -2
  94. package/dist/__tests__/integration/link.integration.test.d.ts.map +0 -1
  95. package/dist/__tests__/integration/link.integration.test.js +0 -395
  96. package/dist/__tests__/integration/link.integration.test.js.map +0 -1
  97. package/dist/__tests__/integration/linked-config-cascade.integration.test.d.ts +0 -2
  98. package/dist/__tests__/integration/linked-config-cascade.integration.test.d.ts.map +0 -1
  99. package/dist/__tests__/integration/linked-config-cascade.integration.test.js +0 -179
  100. package/dist/__tests__/integration/linked-config-cascade.integration.test.js.map +0 -1
  101. package/dist/__tests__/integration/list.integration.test.d.ts +0 -2
  102. package/dist/__tests__/integration/list.integration.test.d.ts.map +0 -1
  103. package/dist/__tests__/integration/list.integration.test.js +0 -300
  104. package/dist/__tests__/integration/list.integration.test.js.map +0 -1
  105. package/dist/__tests__/integration/source-upgrade.integration.test.d.ts +0 -2
  106. package/dist/__tests__/integration/source-upgrade.integration.test.d.ts.map +0 -1
  107. package/dist/__tests__/integration/source-upgrade.integration.test.js +0 -100
  108. package/dist/__tests__/integration/source-upgrade.integration.test.js.map +0 -1
  109. package/dist/__tests__/integration/test-utils.d.ts +0 -30
  110. package/dist/__tests__/integration/test-utils.d.ts.map +0 -1
  111. package/dist/__tests__/integration/test-utils.js +0 -82
  112. package/dist/__tests__/integration/test-utils.js.map +0 -1
  113. package/dist/__tests__/integration/tunnel.integration.test.d.ts +0 -2
  114. package/dist/__tests__/integration/tunnel.integration.test.d.ts.map +0 -1
  115. package/dist/__tests__/integration/tunnel.integration.test.js +0 -486
  116. package/dist/__tests__/integration/tunnel.integration.test.js.map +0 -1
  117. package/dist/__tests__/integration/variable.integration.test.d.ts +0 -2
  118. package/dist/__tests__/integration/variable.integration.test.d.ts.map +0 -1
  119. package/dist/__tests__/integration/variable.integration.test.js +0 -258
  120. package/dist/__tests__/integration/variable.integration.test.js.map +0 -1
  121. package/dist/__tests__/integration/whoami.integration.test.d.ts +0 -2
  122. package/dist/__tests__/integration/whoami.integration.test.d.ts.map +0 -1
  123. package/dist/__tests__/integration/whoami.integration.test.js +0 -116
  124. package/dist/__tests__/integration/whoami.integration.test.js.map +0 -1
  125. package/dist/__tests__/outdated.test.d.ts +0 -2
  126. package/dist/__tests__/outdated.test.d.ts.map +0 -1
  127. package/dist/__tests__/outdated.test.js +0 -67
  128. package/dist/__tests__/outdated.test.js.map +0 -1
  129. package/dist/__tests__/populate.test.d.ts +0 -2
  130. package/dist/__tests__/populate.test.d.ts.map +0 -1
  131. package/dist/__tests__/populate.test.js +0 -445
  132. package/dist/__tests__/populate.test.js.map +0 -1
  133. package/dist/__tests__/tsconfig-upgrader.test.d.ts +0 -2
  134. package/dist/__tests__/tsconfig-upgrader.test.d.ts.map +0 -1
  135. package/dist/__tests__/tsconfig-upgrader.test.js +0 -31
  136. package/dist/__tests__/tsconfig-upgrader.test.js.map +0 -1
  137. package/dist/ca-certificate/validation.test.d.ts +0 -2
  138. package/dist/ca-certificate/validation.test.d.ts.map +0 -1
  139. package/dist/ca-certificate/validation.test.js +0 -131
  140. package/dist/ca-certificate/validation.test.js.map +0 -1
  141. package/dist/common/analytics/cli-invocation.test.d.ts +0 -2
  142. package/dist/common/analytics/cli-invocation.test.d.ts.map +0 -1
  143. package/dist/common/analytics/cli-invocation.test.js +0 -51
  144. package/dist/common/analytics/cli-invocation.test.js.map +0 -1
  145. package/dist/common/analytics/package-manager.test.d.ts +0 -2
  146. package/dist/common/analytics/package-manager.test.d.ts.map +0 -1
  147. package/dist/common/analytics/package-manager.test.js +0 -163
  148. package/dist/common/analytics/package-manager.test.js.map +0 -1
  149. package/dist/common/cli-dispatcher.test.d.ts +0 -2
  150. package/dist/common/cli-dispatcher.test.d.ts.map +0 -1
  151. package/dist/common/cli-dispatcher.test.js +0 -80
  152. package/dist/common/cli-dispatcher.test.js.map +0 -1
  153. package/dist/common/middleware/check-pnpm-lifecycle.test.d.ts +0 -2
  154. package/dist/common/middleware/check-pnpm-lifecycle.test.d.ts.map +0 -1
  155. package/dist/common/middleware/check-pnpm-lifecycle.test.js +0 -125
  156. package/dist/common/middleware/check-pnpm-lifecycle.test.js.map +0 -1
  157. package/dist/common/middleware/get-environment-param.test.d.ts +0 -2
  158. package/dist/common/middleware/get-environment-param.test.d.ts.map +0 -1
  159. package/dist/common/middleware/get-environment-param.test.js +0 -57
  160. package/dist/common/middleware/get-environment-param.test.js.map +0 -1
  161. package/dist/common/read-linked-config.test.d.ts +0 -2
  162. package/dist/common/read-linked-config.test.d.ts.map +0 -1
  163. package/dist/common/read-linked-config.test.js +0 -363
  164. package/dist/common/read-linked-config.test.js.map +0 -1
  165. package/dist/common/terminal.test.d.ts +0 -2
  166. package/dist/common/terminal.test.d.ts.map +0 -1
  167. package/dist/common/terminal.test.js +0 -101
  168. package/dist/common/terminal.test.js.map +0 -1
  169. package/dist/common/utils/build-environment-prompt-choices.test.d.ts +0 -2
  170. package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +0 -1
  171. package/dist/common/utils/build-environment-prompt-choices.test.js +0 -97
  172. package/dist/common/utils/build-environment-prompt-choices.test.js.map +0 -1
  173. package/dist/common/utils/format-environment-type.test.d.ts +0 -2
  174. package/dist/common/utils/format-environment-type.test.d.ts.map +0 -1
  175. package/dist/common/utils/format-environment-type.test.js +0 -32
  176. package/dist/common/utils/format-environment-type.test.js.map +0 -1
  177. package/dist/common/utils/pnpm-lifecycle.test.d.ts +0 -2
  178. package/dist/common/utils/pnpm-lifecycle.test.d.ts.map +0 -1
  179. package/dist/common/utils/pnpm-lifecycle.test.js +0 -196
  180. package/dist/common/utils/pnpm-lifecycle.test.js.map +0 -1
  181. package/dist/common/utils/pretty-print-environment-prompt.test.d.ts +0 -2
  182. package/dist/common/utils/pretty-print-environment-prompt.test.d.ts.map +0 -1
  183. package/dist/common/utils/pretty-print-environment-prompt.test.js +0 -42
  184. package/dist/common/utils/pretty-print-environment-prompt.test.js.map +0 -1
  185. package/dist/common/utils/sort-environments-for-prompt.test.d.ts +0 -2
  186. package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +0 -1
  187. package/dist/common/utils/sort-environments-for-prompt.test.js +0 -82
  188. package/dist/common/utils/sort-environments-for-prompt.test.js.map +0 -1
  189. package/dist/common/utils/stringify-config.test.d.ts +0 -2
  190. package/dist/common/utils/stringify-config.test.d.ts.map +0 -1
  191. package/dist/common/utils/stringify-config.test.js +0 -80
  192. package/dist/common/utils/stringify-config.test.js.map +0 -1
  193. package/dist/common/validators/argument-validators.spec.d.ts +0 -2
  194. package/dist/common/validators/argument-validators.spec.d.ts.map +0 -1
  195. package/dist/common/validators/argument-validators.spec.js +0 -181
  196. package/dist/common/validators/argument-validators.spec.js.map +0 -1
  197. package/dist/common/worker-output.test.d.ts +0 -2
  198. package/dist/common/worker-output.test.d.ts.map +0 -1
  199. package/dist/common/worker-output.test.js +0 -32
  200. package/dist/common/worker-output.test.js.map +0 -1
  201. package/dist/deploy/archive.local-registry.test.d.ts +0 -2
  202. package/dist/deploy/archive.local-registry.test.d.ts.map +0 -1
  203. package/dist/deploy/archive.local-registry.test.js +0 -100
  204. package/dist/deploy/archive.local-registry.test.js.map +0 -1
  205. package/dist/deploy/archive.test.d.ts +0 -2
  206. package/dist/deploy/archive.test.d.ts.map +0 -1
  207. package/dist/deploy/archive.test.js +0 -248
  208. package/dist/deploy/archive.test.js.map +0 -1
  209. package/dist/deploy/classify-build-probe.test.d.ts +0 -2
  210. package/dist/deploy/classify-build-probe.test.d.ts.map +0 -1
  211. package/dist/deploy/classify-build-probe.test.js +0 -51
  212. package/dist/deploy/classify-build-probe.test.js.map +0 -1
  213. package/dist/deploy/poll-deployment.test.d.ts +0 -2
  214. package/dist/deploy/poll-deployment.test.d.ts.map +0 -1
  215. package/dist/deploy/poll-deployment.test.js +0 -158
  216. package/dist/deploy/poll-deployment.test.js.map +0 -1
  217. package/dist/dev/zuplo-local-gitignore.test.d.ts +0 -2
  218. package/dist/dev/zuplo-local-gitignore.test.d.ts.map +0 -1
  219. package/dist/dev/zuplo-local-gitignore.test.js +0 -58
  220. package/dist/dev/zuplo-local-gitignore.test.js.map +0 -1
  221. package/dist/editor/e2e/editor.spec.d.ts +0 -2
  222. package/dist/editor/e2e/editor.spec.d.ts.map +0 -1
  223. package/dist/editor/e2e/editor.spec.js +0 -44
  224. package/dist/editor/e2e/editor.spec.js.map +0 -1
  225. package/dist/link/project-type.test.d.ts +0 -2
  226. package/dist/link/project-type.test.d.ts.map +0 -1
  227. package/dist/link/project-type.test.js +0 -225
  228. package/dist/link/project-type.test.js.map +0 -1
  229. package/dist/lint/resolve-binary.test.d.ts +0 -2
  230. package/dist/lint/resolve-binary.test.d.ts.map +0 -1
  231. package/dist/lint/resolve-binary.test.js +0 -155
  232. package/dist/lint/resolve-binary.test.js.map +0 -1
  233. package/dist/open-api/convert/handler.spec.d.ts +0 -2
  234. package/dist/open-api/convert/handler.spec.d.ts.map +0 -1
  235. package/dist/open-api/convert/handler.spec.js +0 -301
  236. package/dist/open-api/convert/handler.spec.js.map +0 -1
  237. package/dist/open-api/merge/handler.spec.d.ts +0 -2
  238. package/dist/open-api/merge/handler.spec.d.ts.map +0 -1
  239. package/dist/open-api/merge/handler.spec.js +0 -673
  240. package/dist/open-api/merge/handler.spec.js.map +0 -1
  241. package/dist/open-api/overlay/handler.spec.d.ts +0 -2
  242. package/dist/open-api/overlay/handler.spec.d.ts.map +0 -1
  243. package/dist/open-api/overlay/handler.spec.js +0 -346
  244. package/dist/open-api/overlay/handler.spec.js.map +0 -1
  245. package/dist/source/ai-gateway/files.test.d.ts +0 -2
  246. package/dist/source/ai-gateway/files.test.d.ts.map +0 -1
  247. package/dist/source/ai-gateway/files.test.js +0 -135
  248. package/dist/source/ai-gateway/files.test.js.map +0 -1
  249. package/dist/source/ai-gateway/handler.test.d.ts +0 -2
  250. package/dist/source/ai-gateway/handler.test.d.ts.map +0 -1
  251. package/dist/source/ai-gateway/handler.test.js +0 -113
  252. package/dist/source/ai-gateway/handler.test.js.map +0 -1
  253. package/dist/source/ai-gateway/package.test.d.ts +0 -2
  254. package/dist/source/ai-gateway/package.test.d.ts.map +0 -1
  255. package/dist/source/ai-gateway/package.test.js +0 -30
  256. package/dist/source/ai-gateway/package.test.js.map +0 -1
  257. package/dist/source/ai-gateway/planner.test.d.ts +0 -2
  258. package/dist/source/ai-gateway/planner.test.d.ts.map +0 -1
  259. package/dist/source/ai-gateway/planner.test.js +0 -330
  260. package/dist/source/ai-gateway/planner.test.js.map +0 -1
  261. package/dist/source/ai-gateway/release.test.d.ts +0 -2
  262. package/dist/source/ai-gateway/release.test.d.ts.map +0 -1
  263. package/dist/source/ai-gateway/release.test.js +0 -62
  264. package/dist/source/ai-gateway/release.test.js.map +0 -1
  265. package/dist/test/invoke-test.test.d.ts +0 -2
  266. package/dist/test/invoke-test.test.d.ts.map +0 -1
  267. package/dist/test/invoke-test.test.js +0 -150
  268. package/dist/test/invoke-test.test.js.map +0 -1
  269. package/dist/test/test-files.test.d.ts +0 -2
  270. package/dist/test/test-files.test.d.ts.map +0 -1
  271. package/dist/test/test-files.test.js +0 -57
  272. package/dist/test/test-files.test.js.map +0 -1
  273. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.d.ts +0 -2
  274. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.d.ts.map +0 -1
  275. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.js +0 -289
  276. package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.js.map +0 -1
  277. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.d.ts +0 -2
  278. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.d.ts.map +0 -1
  279. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.js +0 -181
  280. package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.js.map +0 -1
  281. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.d.ts +0 -2
  282. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.d.ts.map +0 -1
  283. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.js +0 -399
  284. package/node_modules/@zuplo/openapi-tools/dist/merge.spec.js.map +0 -1
  285. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.d.ts +0 -2
  286. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.d.ts.map +0 -1
  287. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js +0 -779
  288. package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js.map +0 -1
  289. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.d.ts +0 -2
  290. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.d.ts.map +0 -1
  291. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.js +0 -269
  292. package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.js.map +0 -1
  293. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.d.ts +0 -2
  294. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.d.ts.map +0 -1
  295. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.js +0 -93
  296. package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.js.map +0 -1
  297. package/node_modules/@zuplo/runtime/out/esm/chunk-6YPRGG62.js.map +0 -1
  298. package/node_modules/@zuplo/runtime/out/esm/chunk-PBDT4FDO.js +0 -37
  299. package/node_modules/@zuplo/runtime/out/esm/chunk-PBDT4FDO.js.map +0 -1
  300. /package/node_modules/@zuplo/runtime/out/esm/{chunk-YJ2BHVUH.js.map → chunk-CDEAY3VY.js.map} +0 -0
  301. /package/node_modules/@zuplo/runtime/out/esm/{chunk-PBDT4FDO.js.LEGAL.txt → chunk-LVSZ3WTO.js.LEGAL.txt} +0 -0
  302. /package/node_modules/@zuplo/runtime/out/esm/{chunk-VTO3F6DK.js.map → chunk-NUVXDVLJ.js.map} +0 -0
  303. /package/node_modules/@zuplo/runtime/out/esm/{chunk-6YPRGG62.js.LEGAL.txt → chunk-RHU3Z7DA.js.LEGAL.txt} +0 -0
@@ -1,673 +0,0 @@
1
- import assert from "node:assert";
2
- import fs from "node:fs/promises";
3
- import path from "node:path";
4
- import { afterEach, beforeEach, describe, it } from "node:test";
5
- import { fileURLToPath } from "node:url";
6
- import { importOpenApi } from "./handler.js";
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
- const testTmpPath = path.join(__dirname, "..", "..", "__tests__", "test-tmp", "merge-handler");
10
- describe("Merge Handler", () => {
11
- beforeEach(async () => {
12
- await fs.mkdir(testTmpPath, { recursive: true });
13
- });
14
- afterEach(async () => {
15
- try {
16
- await fs.rm(testTmpPath, { recursive: true, force: true });
17
- }
18
- catch {
19
- }
20
- });
21
- describe("importOpenApi", () => {
22
- it("should merge source into new destination file", async () => {
23
- const sourcePath = path.join(testTmpPath, "source.oas.json");
24
- const destPath = path.join(testTmpPath, "dest.oas.json");
25
- const sourceDoc = {
26
- openapi: "3.1.0",
27
- info: {
28
- title: "Source API",
29
- version: "1.0.0",
30
- },
31
- paths: {
32
- "/users": {
33
- get: {
34
- summary: "Get users",
35
- operationId: "getUsers",
36
- responses: {
37
- "200": {
38
- description: "Success",
39
- },
40
- },
41
- },
42
- },
43
- },
44
- };
45
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
46
- await importOpenApi({
47
- source: sourcePath,
48
- destination: destPath,
49
- prompt: false,
50
- });
51
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
52
- assert.strictEqual(result.openapi, "3.1.0");
53
- assert.strictEqual(result.paths["/users"].get.summary, "Get users");
54
- assert.strictEqual(result.paths["/users"].get.operationId, "getUsers");
55
- });
56
- it("should merge source into existing destination file", async () => {
57
- const sourcePath = path.join(testTmpPath, "source.oas.json");
58
- const destPath = path.join(testTmpPath, "dest.oas.json");
59
- const existingDoc = {
60
- openapi: "3.1.0",
61
- info: {
62
- title: "Existing API",
63
- version: "1.0.0",
64
- },
65
- paths: {
66
- "/products": {
67
- get: {
68
- summary: "Get products",
69
- operationId: "getProducts",
70
- responses: {
71
- "200": {
72
- description: "Success",
73
- },
74
- },
75
- },
76
- },
77
- },
78
- };
79
- const sourceDoc = {
80
- openapi: "3.1.0",
81
- info: {
82
- title: "Source API",
83
- version: "1.0.0",
84
- },
85
- paths: {
86
- "/users": {
87
- get: {
88
- summary: "Get users",
89
- operationId: "getUsers",
90
- responses: {
91
- "200": {
92
- description: "Success",
93
- },
94
- },
95
- },
96
- },
97
- },
98
- };
99
- await fs.writeFile(destPath, JSON.stringify(existingDoc, null, 2));
100
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
101
- await importOpenApi({
102
- source: sourcePath,
103
- destination: destPath,
104
- prompt: false,
105
- });
106
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
107
- assert.strictEqual(result.paths["/products"].get.summary, "Get products");
108
- assert.strictEqual(result.paths["/users"].get.summary, "Get users");
109
- });
110
- it("should support YAML source files", async () => {
111
- const sourcePath = path.join(testTmpPath, "source.oas.yaml");
112
- const destPath = path.join(testTmpPath, "dest.oas.json");
113
- const sourceDoc = `openapi: 3.1.0
114
- info:
115
- title: Source API
116
- version: 1.0.0
117
- paths:
118
- /users:
119
- get:
120
- summary: Get users
121
- operationId: getUsers
122
- responses:
123
- '200':
124
- description: Success`;
125
- await fs.writeFile(sourcePath, sourceDoc);
126
- await importOpenApi({
127
- source: sourcePath,
128
- destination: destPath,
129
- prompt: false,
130
- });
131
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
132
- assert.strictEqual(result.paths["/users"].get.summary, "Get users");
133
- });
134
- it("should use path-method merge mode by default", async () => {
135
- const sourcePath = path.join(testTmpPath, "source.oas.json");
136
- const destPath = path.join(testTmpPath, "dest.oas.json");
137
- const existingDoc = {
138
- openapi: "3.1.0",
139
- info: {
140
- title: "Existing API",
141
- version: "1.0.0",
142
- },
143
- paths: {
144
- "/users": {
145
- get: {
146
- summary: "Original summary",
147
- operationId: "getUsers",
148
- responses: {
149
- "200": {
150
- description: "Success",
151
- },
152
- },
153
- },
154
- },
155
- },
156
- };
157
- const sourceDoc = {
158
- openapi: "3.1.0",
159
- info: {
160
- title: "Source API",
161
- version: "1.0.0",
162
- },
163
- paths: {
164
- "/users": {
165
- get: {
166
- summary: "Updated summary",
167
- operationId: "getUsersUpdated",
168
- responses: {
169
- "200": {
170
- description: "Updated Success",
171
- },
172
- },
173
- },
174
- },
175
- },
176
- };
177
- await fs.writeFile(destPath, JSON.stringify(existingDoc, null, 2));
178
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
179
- await importOpenApi({
180
- source: sourcePath,
181
- destination: destPath,
182
- prompt: false,
183
- });
184
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
185
- assert.strictEqual(result.paths["/users"].get.summary, "Updated summary");
186
- });
187
- it("should support operation-id merge mode", async () => {
188
- const sourcePath = path.join(testTmpPath, "source.oas.json");
189
- const destPath = path.join(testTmpPath, "dest.oas.json");
190
- const existingDoc = {
191
- openapi: "3.1.0",
192
- info: {
193
- title: "Existing API",
194
- version: "1.0.0",
195
- },
196
- paths: {
197
- "/users": {
198
- get: {
199
- summary: "Original summary",
200
- operationId: "getUsers",
201
- responses: {
202
- "200": {
203
- description: "Success",
204
- },
205
- },
206
- },
207
- },
208
- },
209
- };
210
- const sourceDoc = {
211
- openapi: "3.1.0",
212
- info: {
213
- title: "Source API",
214
- version: "1.0.0",
215
- },
216
- paths: {
217
- "/v2/users": {
218
- get: {
219
- summary: "Updated summary",
220
- operationId: "getUsers",
221
- responses: {
222
- "200": {
223
- description: "Updated Success",
224
- },
225
- },
226
- },
227
- },
228
- },
229
- };
230
- await fs.writeFile(destPath, JSON.stringify(existingDoc, null, 2));
231
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
232
- await importOpenApi({
233
- source: sourcePath,
234
- destination: destPath,
235
- prompt: false,
236
- "merge-mode": "operation-id",
237
- });
238
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
239
- assert.strictEqual(result.paths["/users"], undefined);
240
- assert.strictEqual(result.paths["/v2/users"].get.summary, "Updated summary");
241
- });
242
- it("should create output directory if it doesn't exist", async () => {
243
- const sourcePath = path.join(testTmpPath, "source.oas.json");
244
- const destPath = path.join(testTmpPath, "nested", "dir", "dest.oas.json");
245
- const sourceDoc = {
246
- openapi: "3.1.0",
247
- info: {
248
- title: "Source API",
249
- version: "1.0.0",
250
- },
251
- paths: {
252
- "/users": {
253
- get: {
254
- summary: "Get users",
255
- operationId: "getUsers",
256
- responses: {
257
- "200": {
258
- description: "Success",
259
- },
260
- },
261
- },
262
- },
263
- },
264
- };
265
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
266
- await importOpenApi({
267
- source: sourcePath,
268
- destination: destPath,
269
- prompt: false,
270
- });
271
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
272
- assert.strictEqual(result.paths["/users"].get.summary, "Get users");
273
- });
274
- it("should add operation IDs if missing", async () => {
275
- const sourcePath = path.join(testTmpPath, "source.oas.json");
276
- const destPath = path.join(testTmpPath, "dest.oas.json");
277
- const sourceDoc = {
278
- openapi: "3.1.0",
279
- info: {
280
- title: "Source API",
281
- version: "1.0.0",
282
- },
283
- paths: {
284
- "/users": {
285
- get: {
286
- summary: "Get users",
287
- responses: {
288
- "200": {
289
- description: "Success",
290
- },
291
- },
292
- },
293
- },
294
- },
295
- };
296
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
297
- await importOpenApi({
298
- source: sourcePath,
299
- destination: destPath,
300
- prompt: false,
301
- });
302
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
303
- assert.strictEqual(typeof result.paths["/users"].get.operationId, "string");
304
- assert.strictEqual(result.paths["/users"].get.operationId.length > 0, true);
305
- });
306
- it("should throw error when source file does not exist", async () => {
307
- const sourcePath = path.join(testTmpPath, "nonexistent.oas.json");
308
- const destPath = path.join(testTmpPath, "dest.oas.json");
309
- await assert.rejects(() => importOpenApi({
310
- source: sourcePath,
311
- destination: destPath,
312
- prompt: false,
313
- }), /does not exist/);
314
- });
315
- it("should throw error when destination doesn't end with .oas.json", async () => {
316
- const sourcePath = path.join(testTmpPath, "source.oas.json");
317
- const destPath = path.join(testTmpPath, "dest.json");
318
- const sourceDoc = {
319
- openapi: "3.1.0",
320
- info: {
321
- title: "Source API",
322
- version: "1.0.0",
323
- },
324
- paths: {},
325
- };
326
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
327
- await assert.rejects(() => importOpenApi({
328
- source: sourcePath,
329
- destination: destPath,
330
- prompt: false,
331
- }), /must end with '.oas.json'/);
332
- });
333
- });
334
- describe("server-paths flag", () => {
335
- it("should apply server-paths transformation by default", async () => {
336
- const sourcePath = path.join(testTmpPath, "source.oas.json");
337
- const destPath = path.join(testTmpPath, "dest.oas.json");
338
- const sourceDoc = {
339
- openapi: "3.1.0",
340
- info: {
341
- title: "Source API",
342
- version: "1.0.0",
343
- },
344
- servers: [
345
- {
346
- url: "https://api.example.com/v2",
347
- description: "Production server",
348
- },
349
- ],
350
- paths: {
351
- "/products": {
352
- get: {
353
- summary: "Get products",
354
- operationId: "getProducts",
355
- responses: {
356
- "200": {
357
- description: "Success",
358
- },
359
- },
360
- },
361
- },
362
- },
363
- };
364
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
365
- await importOpenApi({
366
- source: sourcePath,
367
- destination: destPath,
368
- prompt: false,
369
- });
370
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
371
- assert.strictEqual(result.paths["/v2/products"].get.summary, "Get products");
372
- assert.strictEqual(result.paths["/products"], undefined);
373
- });
374
- it("should apply server-paths transformation when explicitly enabled", async () => {
375
- const sourcePath = path.join(testTmpPath, "source.oas.json");
376
- const destPath = path.join(testTmpPath, "dest.oas.json");
377
- const sourceDoc = {
378
- openapi: "3.1.0",
379
- info: {
380
- title: "Source API",
381
- version: "1.0.0",
382
- },
383
- servers: [
384
- {
385
- url: "https://api.example.com/v1",
386
- description: "Production server",
387
- },
388
- ],
389
- paths: {
390
- "/accounts": {
391
- get: {
392
- summary: "Get accounts",
393
- operationId: "getAccounts",
394
- responses: {
395
- "200": {
396
- description: "Success",
397
- },
398
- },
399
- },
400
- },
401
- },
402
- };
403
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
404
- await importOpenApi({
405
- source: sourcePath,
406
- destination: destPath,
407
- prompt: false,
408
- "server-paths": true,
409
- });
410
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
411
- assert.strictEqual(result.paths["/v1/accounts"].get.summary, "Get accounts");
412
- assert.strictEqual(result.paths["/accounts"], undefined);
413
- });
414
- it("should not transform paths when server-paths is disabled", async () => {
415
- const sourcePath = path.join(testTmpPath, "source.oas.json");
416
- const destPath = path.join(testTmpPath, "dest.oas.json");
417
- const sourceDoc = {
418
- openapi: "3.1.0",
419
- info: {
420
- title: "Source API",
421
- version: "1.0.0",
422
- },
423
- servers: [
424
- {
425
- url: "https://api.example.com/v1",
426
- description: "Production server",
427
- },
428
- ],
429
- paths: {
430
- "/accounts": {
431
- get: {
432
- summary: "Get accounts",
433
- operationId: "getAccounts",
434
- responses: {
435
- "200": {
436
- description: "Success",
437
- },
438
- },
439
- },
440
- },
441
- },
442
- };
443
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
444
- await importOpenApi({
445
- source: sourcePath,
446
- destination: destPath,
447
- prompt: false,
448
- "server-paths": false,
449
- });
450
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
451
- assert.strictEqual(result.paths["/accounts"].get.summary, "Get accounts");
452
- assert.strictEqual(result.paths["/v1/accounts"], undefined);
453
- });
454
- it("should handle servers with no pathname gracefully", async () => {
455
- const sourcePath = path.join(testTmpPath, "source.oas.json");
456
- const destPath = path.join(testTmpPath, "dest.oas.json");
457
- const sourceDoc = {
458
- openapi: "3.1.0",
459
- info: {
460
- title: "Source API",
461
- version: "1.0.0",
462
- },
463
- servers: [
464
- {
465
- url: "https://api.example.com",
466
- description: "Production server",
467
- },
468
- ],
469
- paths: {
470
- "/accounts": {
471
- get: {
472
- summary: "Get accounts",
473
- operationId: "getAccounts",
474
- responses: {
475
- "200": {
476
- description: "Success",
477
- },
478
- },
479
- },
480
- },
481
- },
482
- };
483
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
484
- await importOpenApi({
485
- source: sourcePath,
486
- destination: destPath,
487
- prompt: false,
488
- "server-paths": true,
489
- });
490
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
491
- assert.strictEqual(result.paths["/accounts"].get.summary, "Get accounts");
492
- });
493
- it("should handle missing servers gracefully", async () => {
494
- const sourcePath = path.join(testTmpPath, "source.oas.json");
495
- const destPath = path.join(testTmpPath, "dest.oas.json");
496
- const sourceDoc = {
497
- openapi: "3.1.0",
498
- info: {
499
- title: "Source API",
500
- version: "1.0.0",
501
- },
502
- paths: {
503
- "/accounts": {
504
- get: {
505
- summary: "Get accounts",
506
- operationId: "getAccounts",
507
- responses: {
508
- "200": {
509
- description: "Success",
510
- },
511
- },
512
- },
513
- },
514
- },
515
- };
516
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
517
- await importOpenApi({
518
- source: sourcePath,
519
- destination: destPath,
520
- prompt: false,
521
- "server-paths": true,
522
- });
523
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
524
- assert.strictEqual(result.paths["/accounts"].get.summary, "Get accounts");
525
- });
526
- });
527
- describe("prepend-path flag", () => {
528
- it("should apply prepend-path transformation", async () => {
529
- const sourcePath = path.join(testTmpPath, "source.oas.json");
530
- const destPath = path.join(testTmpPath, "dest.oas.json");
531
- const sourceDoc = {
532
- openapi: "3.1.0",
533
- info: {
534
- title: "Source API",
535
- version: "1.0.0",
536
- },
537
- paths: {
538
- "/accounts": {
539
- get: {
540
- summary: "Get accounts",
541
- operationId: "getAccounts",
542
- responses: {
543
- "200": {
544
- description: "Success",
545
- },
546
- },
547
- },
548
- },
549
- "/users": {
550
- get: {
551
- summary: "Get users",
552
- operationId: "getUsers",
553
- responses: {
554
- "200": {
555
- description: "Success",
556
- },
557
- },
558
- },
559
- },
560
- },
561
- };
562
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
563
- await importOpenApi({
564
- source: sourcePath,
565
- destination: destPath,
566
- prompt: false,
567
- "prepend-path": "/api/v2",
568
- });
569
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
570
- assert.strictEqual(result.paths["/api/v2/accounts"].get.summary, "Get accounts");
571
- assert.strictEqual(result.paths["/api/v2/users"].get.summary, "Get users");
572
- assert.strictEqual(result.paths["/accounts"], undefined);
573
- assert.strictEqual(result.paths["/users"], undefined);
574
- });
575
- it("should handle prepend-path with various formats", async () => {
576
- const sourcePath = path.join(testTmpPath, "source.oas.json");
577
- const destPath = path.join(testTmpPath, "dest.oas.json");
578
- const sourceDoc = {
579
- openapi: "3.1.0",
580
- info: {
581
- title: "Source API",
582
- version: "1.0.0",
583
- },
584
- paths: {
585
- "/test": {
586
- get: {
587
- summary: "Test endpoint",
588
- operationId: "test",
589
- responses: {
590
- "200": {
591
- description: "Success",
592
- },
593
- },
594
- },
595
- },
596
- },
597
- };
598
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
599
- await importOpenApi({
600
- source: sourcePath,
601
- destination: destPath,
602
- prompt: false,
603
- "prepend-path": "/v1/",
604
- });
605
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
606
- assert.strictEqual(result.paths["/v1/test"].get.summary, "Test endpoint");
607
- });
608
- it("should prioritize prepend-path over server-paths", async () => {
609
- const sourcePath = path.join(testTmpPath, "source.oas.json");
610
- const destPath = path.join(testTmpPath, "dest.oas.json");
611
- const sourceDoc = {
612
- openapi: "3.1.0",
613
- info: {
614
- title: "Source API",
615
- version: "1.0.0",
616
- },
617
- servers: [
618
- {
619
- url: "https://api.example.com/v1",
620
- description: "Has a pathname that should be ignored",
621
- },
622
- ],
623
- paths: {
624
- "/orders": {
625
- get: {
626
- summary: "Get orders",
627
- operationId: "getOrders",
628
- responses: {
629
- "200": {
630
- description: "Success",
631
- },
632
- },
633
- },
634
- },
635
- },
636
- };
637
- await fs.writeFile(sourcePath, JSON.stringify(sourceDoc, null, 2));
638
- await importOpenApi({
639
- source: sourcePath,
640
- destination: destPath,
641
- prompt: false,
642
- "server-paths": true,
643
- "prepend-path": "/custom/path",
644
- });
645
- const result = JSON.parse(await fs.readFile(destPath, "utf-8"));
646
- assert.strictEqual(result.paths["/custom/path/orders"].get.summary, "Get orders");
647
- assert.strictEqual(result.paths["/v1/orders"], undefined);
648
- assert.strictEqual(result.paths["/orders"], undefined);
649
- });
650
- });
651
- describe("watch flag", () => {
652
- it("should reject watch mode with URL sources", async () => {
653
- const destPath = path.join(testTmpPath, "dest.oas.json");
654
- await assert.rejects(() => importOpenApi({
655
- source: "https://example.com/api.json",
656
- destination: destPath,
657
- prompt: false,
658
- watch: true,
659
- }), /Watch mode is not supported for URL sources/);
660
- });
661
- it("should reject watch mode with non-existent files", async () => {
662
- const sourcePath = path.join(testTmpPath, "nonexistent.oas.json");
663
- const destPath = path.join(testTmpPath, "dest.oas.json");
664
- await assert.rejects(() => importOpenApi({
665
- source: sourcePath,
666
- destination: destPath,
667
- prompt: false,
668
- watch: true,
669
- }), /does not exist/);
670
- });
671
- });
672
- });
673
- //# sourceMappingURL=handler.spec.js.map