@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
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{E as p,J as c,M as u}from"../chunk-6YPRGG62.js";import"../chunk-VTO3F6DK.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-YJ2BHVUH.js";import{aa as i}from"../chunk-PBDT4FDO.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
25
+ import{E as p,J as c,M as u}from"../chunk-RHU3Z7DA.js";import"../chunk-NUVXDVLJ.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-CDEAY3VY.js";import{aa as i}from"../chunk-LVSZ3WTO.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
26
26
  //# sourceMappingURL=index.js.map
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-YJ2BHVUH.js";import"../../chunk-PBDT4FDO.js";import{a as i}from"../../chunk-TYV53J3B.js";async function g(r,e){let t=typeof e.credentials=="function"?await e.credentials():e.credentials,n=r.method,d=n!=="GET"&&n!=="HEAD"&&r.body!=null?await r.arrayBuffer():null,s=await new o({method:n,url:r.url,headers:r.headers,body:d,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,service:e.service,region:e.region,signQuery:e.signQuery}).sign();return new Request(s.url.toString(),{method:s.method,headers:s.headers,body:s.body})}i(g,"signRequest");export{c as AwsClient,o as AwsV4Signer,p as fromTemporaryCredentials,y as fromWebToken,m as fromZuploIdentity,l as getAwsCredentialProvider,a as setAwsCredentialProvider,g as signRequest};
25
+ import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-CDEAY3VY.js";import"../../chunk-LVSZ3WTO.js";import{a as i}from"../../chunk-TYV53J3B.js";async function g(r,e){let t=typeof e.credentials=="function"?await e.credentials():e.credentials,n=r.method,d=n!=="GET"&&n!=="HEAD"&&r.body!=null?await r.arrayBuffer():null,s=await new o({method:n,url:r.url,headers:r.headers,body:d,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,service:e.service,region:e.region,signQuery:e.signQuery}).sign();return new Request(s.url.toString(),{method:s.method,headers:s.headers,body:s.body})}i(g,"signRequest");export{c as AwsClient,o as AwsV4Signer,p as fromTemporaryCredentials,y as fromWebToken,m as fromZuploIdentity,l as getAwsCredentialProvider,a as setAwsCredentialProvider,g as signRequest};
26
26
  //# sourceMappingURL=index.js.map
@@ -1310,15 +1310,6 @@ export declare interface AIGatewaySmartRouterResult {
1310
1310
  profile: AIGatewaySmartRouterProfile;
1311
1311
  usage: AIGatewaySmartRouterTokenUsage;
1312
1312
  classifierModel: string;
1313
- /**
1314
- * Classifier cost in USD, separate from the routed model's cost. An unpriced
1315
- * zero means unknown, not free. Optional for results written by older code.
1316
- */
1317
- cost?: {
1318
- costUsd: number;
1319
- source: "provider" | "catalog" | "unpriced";
1320
- accuracy: "exact" | "estimated" | "unpriced";
1321
- };
1322
1313
  routing: AIGatewaySmartRouterRoutingDecision;
1323
1314
  durationMs: number;
1324
1315
  promptSource: AIGatewaySmartRouterPromptSource;
@@ -1343,9 +1334,7 @@ export declare interface AIGatewaySmartRouterRoutingDecision {
1343
1334
  }
1344
1335
 
1345
1336
  /**
1346
- * Classifier token usage from gateway accounting for app classifiers. Missing
1347
- * accounting headers produce zero counts, without a provider-body fallback.
1348
- * Deprecated direct classifiers retain the provider-reported counts; for Jev,
1337
+ * Classifier token usage reported in the classifier response body. For Jev,
1349
1338
  * input and output tokens map directly to these fields.
1350
1339
  *
1351
1340
  * @public
@@ -1354,18 +1343,6 @@ export declare interface AIGatewaySmartRouterTokenUsage {
1354
1343
  inputTokens: number;
1355
1344
  outputTokens: number;
1356
1345
  totalTokens: number;
1357
- /** Disjoint accounting categories already included in the totals above. */
1358
- breakdown?: {
1359
- uncachedInputTokens: number;
1360
- cacheReadInputTokens?: number;
1361
- /** Cache writes grouped by TTL when accounting reports that detail. */
1362
- cacheWriteInput?: Array<{
1363
- tokens: number;
1364
- cacheTtl?: "5m" | "1h";
1365
- }>;
1366
- visibleOutputTokens: number;
1367
- reasoningOutputTokens?: number;
1368
- };
1369
1346
  }
1370
1347
 
1371
1348
  /**
@@ -4195,6 +4172,20 @@ declare interface CompatibilityFlags {
4195
4172
  * discover tools with `tools/list`, as the MCP spec defines.
4196
4173
  */
4197
4174
  removeMcpToolsCapabilityExtension: boolean;
4175
+ /**
4176
+ * Whether the MCP server handler reports a `tools/call` whose arguments fail
4177
+ * the tool's `inputSchema` as a tool result with `isError: true`, as
4178
+ * MCP 2025-11-25 specifies for input validation errors.
4179
+ *
4180
+ * Before this flag: Invalid arguments return a JSON-RPC `-32602` error.
4181
+ *
4182
+ * After this flag: When the request's `MCP-Protocol-Version` header is
4183
+ * `2025-11-25` or later, invalid arguments return a result with
4184
+ * `isError: true` and the validation message as text content, and the tool
4185
+ * is not called. Earlier or missing protocol versions still return
4186
+ * `-32602`. Unknown tools and malformed requests return `-32602` either way.
4187
+ */
4188
+ returnMcpToolInputErrorsAsToolResults: boolean;
4198
4189
  /**
4199
4190
  * Whether OpenAPI schema combinators (`allOf`, `oneOf`, `anyOf`, `not`) are
4200
4191
  * applied with JSON Schema semantics when an operation's schemas are turned
@@ -154,6 +154,20 @@ declare interface CompatibilityFlags {
154
154
  * discover tools with `tools/list`, as the MCP spec defines.
155
155
  */
156
156
  removeMcpToolsCapabilityExtension: boolean;
157
+ /**
158
+ * Whether the MCP server handler reports a `tools/call` whose arguments fail
159
+ * the tool's `inputSchema` as a tool result with `isError: true`, as
160
+ * MCP 2025-11-25 specifies for input validation errors.
161
+ *
162
+ * Before this flag: Invalid arguments return a JSON-RPC `-32602` error.
163
+ *
164
+ * After this flag: When the request's `MCP-Protocol-Version` header is
165
+ * `2025-11-25` or later, invalid arguments return a result with
166
+ * `isError: true` and the validation message as text content, and the tool
167
+ * is not called. Earlier or missing protocol versions still return
168
+ * `-32602`. Unknown tools and malformed requests return `-32602` either way.
169
+ */
170
+ returnMcpToolInputErrorsAsToolResults: boolean;
157
171
  /**
158
172
  * Whether OpenAPI schema combinators (`allOf`, `oneOf`, `anyOf`, `not`) are
159
173
  * applied with JSON Schema semantics when an operation's schemas are turned
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.10.0",
4
+ "version": "7.11.1",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "7.10.0",
3
+ "version": "7.11.1",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -18,7 +18,10 @@
18
18
  "LICENSE.txt",
19
19
  "dist/**",
20
20
  "*.js",
21
- "*.d.ts"
21
+ "*.d.ts",
22
+ "!dist/**/*.test.*",
23
+ "!dist/**/*.spec.*",
24
+ "!dist/**/__tests__/**"
22
25
  ],
23
26
  "bin": {
24
27
  "zup": "zup.js"
@@ -28,10 +31,10 @@
28
31
  "@opentelemetry/api": "1.9.0",
29
32
  "@opentelemetry/api-logs": "0.220.0",
30
33
  "@swc/core": "1.10.18",
31
- "@zuplo/core": "7.10.0",
34
+ "@zuplo/core": "7.11.1",
32
35
  "@zuplo/editor": "1.0.33162667821",
33
- "@zuplo/openapi-tools": "7.10.0",
34
- "@zuplo/runtime": "7.10.0",
36
+ "@zuplo/openapi-tools": "7.11.1",
37
+ "@zuplo/runtime": "7.11.1",
35
38
  "chalk": "5.4.1",
36
39
  "chokidar": "3.5.3",
37
40
  "cookie": "1.0.2",
@@ -62,15 +65,15 @@
62
65
  "workerd": "1.20261002.1",
63
66
  "yargs": "17.7.2",
64
67
  "zod": "4.4.3",
65
- "@zuplo/graphql": "7.10.0",
66
- "@zuplo/otel": "7.10.0"
68
+ "@zuplo/graphql": "7.11.1",
69
+ "@zuplo/otel": "7.11.1"
67
70
  },
68
71
  "optionalDependencies": {
69
- "@zuplo/lint-darwin-arm64": "7.10.0",
70
- "@zuplo/lint-darwin-x64": "7.10.0",
71
- "@zuplo/lint-linux-x64": "7.10.0",
72
- "@zuplo/lint-linux-arm64": "7.10.0",
73
- "@zuplo/lint-win32-x64": "7.10.0"
72
+ "@zuplo/lint-darwin-arm64": "7.11.1",
73
+ "@zuplo/lint-darwin-x64": "7.11.1",
74
+ "@zuplo/lint-linux-x64": "7.11.1",
75
+ "@zuplo/lint-linux-arm64": "7.11.1",
76
+ "@zuplo/lint-win32-x64": "7.11.1"
74
77
  },
75
78
  "bundleDependencies": [
76
79
  "@inquirer/prompts",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=archive-utils.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"archive-utils.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/archive-utils.test.ts"],"names":[],"mappings":""}
@@ -1,50 +0,0 @@
1
- import path from "node:path";
2
- import { describe, it } from "node:test";
3
- import { fileURLToPath } from "node:url";
4
- import { expect } from "chai";
5
- import ignore from "ignore";
6
- import { createIgnoreFunction, generateMetadata } from "../deploy/archive.js";
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
- const basicTestsPath = path.join(__dirname, "..", "..", "..", "..", "test-fixtures", "basic");
10
- describe("Archive utils", async function () {
11
- it("should not ignore .zuplo using gitignore", function () {
12
- const ignores = createIgnoreFunction(basicTestsPath);
13
- const expectedRules = ignore().add(".git/");
14
- expectedRules.add(".cache/");
15
- expectedRules.add("dist/");
16
- expectedRules.add("node_modules/");
17
- expectedRules.add(".env");
18
- expectedRules.add(".DS_Store");
19
- expect(ignores._rules).to.deep.equal(expectedRules._rules);
20
- });
21
- it("should return default metadata values", async function () {
22
- const results = await generateMetadata({
23
- account: "zuplo-test",
24
- project: "basic",
25
- dir: basicTestsPath,
26
- environment: "basic-1234",
27
- authToken: "",
28
- });
29
- expect(results).to.not.be.empty;
30
- expect(results.branch).to.equal("basic-1234");
31
- expect(results.repoUrl).to.not.be.null;
32
- expect(results.sha).to.not.be.null;
33
- });
34
- it("should allow metadata value override on repo url", async function () {
35
- const results = await generateMetadata({
36
- account: "zuplo-test",
37
- project: "basic",
38
- dir: basicTestsPath,
39
- environment: "basic-1234",
40
- authToken: "",
41
- "override-repo-url": "https://github.com/zuplo/test-override",
42
- });
43
- expect(results).to.not.be.empty;
44
- expect(results.branch).to.equal("basic-1234");
45
- expect(results.repoUrl).to.not.be.null;
46
- expect(results.repoUrl).to.equal("https://github.com/zuplo/test-override");
47
- expect(results.sha).to.not.be.null;
48
- });
49
- });
50
- //# sourceMappingURL=archive-utils.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"archive-utils.test.js","sourceRoot":"","sources":["../../src/__tests__/archive-utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAC9B,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,eAAe,EACf,OAAO,CACR,CAAC;AAEF,QAAQ,CAAC,eAAe,EAAE,KAAK;IAC7B,EAAE,CAAC,0CAA0C,EAAE;QAC7C,MAAM,OAAO,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC;QACrD,MAAM,aAAa,GAAI,MAAc,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrD,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7B,aAAa,CAAC,GAAG,CAAC,OAAO,CAA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,KAAK,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC9C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;QACvC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC3E,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import path from \"node:path\";\nimport { describe, it } from \"node:test\";\nimport { fileURLToPath } from \"node:url\";\nimport { expect } from \"chai\";\nimport ignore from \"ignore\";\nimport { createIgnoreFunction, generateMetadata } from \"../deploy/archive.js\";\n\nconst __filename = fileURLToPath(import.meta.url); // get the resolved path to the file\nconst __dirname = path.dirname(__filename); // get the name of the directory\n\nconst basicTestsPath = path.join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"test-fixtures\",\n \"basic\"\n);\n\ndescribe(\"Archive utils\", async function () {\n it(\"should not ignore .zuplo using gitignore\", function () {\n const ignores = createIgnoreFunction(basicTestsPath);\n const expectedRules = (ignore as any)().add(\".git/\");\n expectedRules.add(\".cache/\");\n expectedRules.add(\"dist/\");\n expectedRules.add(\"node_modules/\");\n expectedRules.add(\".env\");\n expectedRules.add(\".DS_Store\");\n\n expect(ignores._rules).to.deep.equal(expectedRules._rules);\n });\n\n it(\"should return default metadata values\", async function () {\n const results = await generateMetadata({\n account: \"zuplo-test\",\n project: \"basic\",\n dir: basicTestsPath,\n environment: \"basic-1234\",\n authToken: \"\",\n });\n\n expect(results).to.not.be.empty;\n expect(results.branch).to.equal(\"basic-1234\");\n expect(results.repoUrl).to.not.be.null;\n expect(results.sha).to.not.be.null;\n });\n\n it(\"should allow metadata value override on repo url\", async function () {\n const results = await generateMetadata({\n account: \"zuplo-test\",\n project: \"basic\",\n dir: basicTestsPath,\n environment: \"basic-1234\",\n authToken: \"\",\n \"override-repo-url\": \"https://github.com/zuplo/test-override\",\n });\n\n expect(results).to.not.be.empty;\n expect(results.branch).to.equal(\"basic-1234\");\n expect(results.repoUrl).to.not.be.null;\n expect(results.repoUrl).to.equal(\"https://github.com/zuplo/test-override\");\n expect(results.sha).to.not.be.null;\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=import-openapi.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-openapi.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/import-openapi.test.ts"],"names":[],"mappings":""}
@@ -1,251 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- import { afterEach, beforeEach, describe, it } from "node:test";
4
- import { fileURLToPath } from "node:url";
5
- import { expect } from "chai";
6
- import { createSandbox } from "sinon";
7
- import { importOpenApi } from "../open-api/merge/handler.js";
8
- const baseRoutesFileOnImportTests = {
9
- info: {
10
- version: "v2",
11
- title: "Zuplo test API V2",
12
- description: "Test api v2",
13
- contact: {
14
- name: "Zuplo test",
15
- url: "www.zuplo.com",
16
- },
17
- },
18
- openapi: "3.1.0",
19
- components: {
20
- parameters: {
21
- userUid: {
22
- name: "userUid",
23
- in: "path",
24
- description: "Unique UUID of the user.",
25
- required: true,
26
- schema: {
27
- type: "string",
28
- format: "uuid",
29
- },
30
- },
31
- },
32
- securitySchemes: {
33
- authorization: {
34
- type: "http",
35
- description: "Firebase JWT auth token",
36
- scheme: "bearer",
37
- },
38
- },
39
- },
40
- servers: [
41
- {
42
- url: "https://api.stage.example.com",
43
- description: "Stage",
44
- },
45
- {
46
- url: "https://api.example.com",
47
- description: "Prod",
48
- },
49
- ],
50
- security: [{}],
51
- tags: [],
52
- paths: {
53
- "/v1/second/{userUid}/nature": {
54
- post: {
55
- summary: "Test route",
56
- operationId: "12345",
57
- parameters: [
58
- {
59
- $ref: "#/components/parameters/userUid",
60
- },
61
- ],
62
- responses: {
63
- "200": {
64
- description: "",
65
- },
66
- },
67
- security: [{}],
68
- servers: [
69
- {
70
- url: "https://api.stage.example.com",
71
- description: "stage",
72
- },
73
- {
74
- url: "https://api.example.com",
75
- description: "production",
76
- },
77
- ],
78
- },
79
- },
80
- "/v2/second/{userUid}/nature": {
81
- post: {
82
- operationId: "67920",
83
- summary: "Test route v2",
84
- parameters: [
85
- {
86
- $ref: "#/components/parameters/userUid",
87
- },
88
- ],
89
- responses: {
90
- "200": {
91
- description: "",
92
- },
93
- },
94
- },
95
- },
96
- },
97
- };
98
- const __filename = fileURLToPath(import.meta.url);
99
- const __dirname = path.dirname(__filename);
100
- const testAssetsPath = path.join(__dirname, "..", "..", "src", "__tests__", "test-assets");
101
- const testTmpPath = path.join(__dirname, "..", "..", "src", "__tests__", "test-tmp");
102
- async function createOASFile(content, destinationPath) {
103
- try {
104
- const dir = path.dirname(destinationPath);
105
- await fs.mkdir(dir, { recursive: true });
106
- await fs.writeFile(destinationPath, content, "utf8");
107
- console.log(`File created successfully at ${destinationPath}`);
108
- }
109
- catch (error) {
110
- console.error(`Error creating file at ${destinationPath}:`, error);
111
- }
112
- }
113
- let sandbox;
114
- describe("Import open api file", async function () {
115
- let printExit;
116
- beforeEach(async function () {
117
- sandbox = createSandbox();
118
- printExit = sandbox.stub(process, "exit");
119
- });
120
- afterEach(() => {
121
- sandbox.restore();
122
- });
123
- it("should merge two existing files correctly", async function () {
124
- const destinationPath = path.join(testTmpPath, "config", "routes-test-one.oas.json");
125
- await createOASFile(JSON.stringify(baseRoutesFileOnImportTests), destinationPath);
126
- await importOpenApi({
127
- prompt: false,
128
- source: path.join(testAssetsPath, "toimport.oas.json"),
129
- destination: destinationPath,
130
- });
131
- const mergedContent = await fs.readFile(destinationPath, "utf-8");
132
- const jsonContent = JSON.parse(mergedContent);
133
- expect(jsonContent.paths).to.deep.equals({
134
- "/v1/second/{userUid}/nature": {
135
- post: {
136
- summary: "Test route",
137
- operationId: "12345",
138
- parameters: [
139
- {
140
- $ref: "#/components/parameters/userUid",
141
- },
142
- ],
143
- responses: {
144
- "200": {
145
- description: "",
146
- },
147
- },
148
- security: [{}],
149
- servers: [
150
- {
151
- url: "https://api.stage.example.com",
152
- description: "stage",
153
- },
154
- {
155
- url: "https://api.example.com",
156
- description: "production",
157
- },
158
- ],
159
- },
160
- },
161
- "/v2/second/{userUid}/nature": {
162
- post: {
163
- operationId: "67920",
164
- summary: "Test route v2",
165
- parameters: [
166
- {
167
- $ref: "#/components/parameters/userUid",
168
- },
169
- ],
170
- responses: {
171
- "200": {
172
- description: "",
173
- },
174
- },
175
- },
176
- },
177
- });
178
- });
179
- it("should import a file into a fs destination that does not yet exist", async function () {
180
- const destinationPath = path.join(testTmpPath, "routes-test-two.oas.json");
181
- await importOpenApi({
182
- prompt: false,
183
- source: path.join(testAssetsPath, "toimport.oas.json"),
184
- destination: destinationPath,
185
- });
186
- const mergedContent = await fs.readFile(destinationPath, "utf-8");
187
- const jsonContent = JSON.parse(mergedContent);
188
- expect(jsonContent.info).to.deep.equals({
189
- version: "v2",
190
- title: "Zuplo test API V2",
191
- description: "Test api v2",
192
- contact: {
193
- name: "Zuplo test",
194
- url: "www.zuplo.com",
195
- },
196
- });
197
- expect(jsonContent.openapi).to.equal("3.1.0");
198
- expect(jsonContent.components).to.deep.equals({
199
- parameters: {
200
- userUid: {
201
- name: "userUid",
202
- in: "path",
203
- description: "Unique UUID of the user.",
204
- required: true,
205
- schema: {
206
- type: "string",
207
- format: "uuid",
208
- },
209
- },
210
- },
211
- securitySchemes: {
212
- authorization: {
213
- type: "http",
214
- description: "Firebase JWT auth token",
215
- scheme: "bearer",
216
- },
217
- },
218
- });
219
- expect(jsonContent.servers).to.deep.equals([
220
- {
221
- url: "https://api.stage.example.com",
222
- description: "Stage",
223
- },
224
- {
225
- url: "https://api.example.com",
226
- description: "Prod",
227
- },
228
- ]);
229
- expect(jsonContent.security).to.deep.equals([{}]);
230
- expect(jsonContent.tags).to.deep.equals([]);
231
- expect(jsonContent.paths).to.deep.equals({
232
- "/v2/second/{userUid}/nature": {
233
- post: {
234
- summary: "Test route v2",
235
- operationId: "67920",
236
- parameters: [
237
- {
238
- $ref: "#/components/parameters/userUid",
239
- },
240
- ],
241
- responses: {
242
- "200": {
243
- description: "",
244
- },
245
- },
246
- },
247
- },
248
- });
249
- });
250
- });
251
- //# sourceMappingURL=import-openapi.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-openapi.test.js","sourceRoot":"","sources":["../../src/__tests__/import-openapi.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,aAAa,EAA2B,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,2BAA2B,GAAG;IAClC,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE;YACP,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,eAAe;SACrB;KACF;IACD,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE;QACV,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,EAAE,EAAE,MAAM;gBACV,WAAW,EAAE,0BAA0B;gBACvC,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,MAAM;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GAAG,EAAE,+BAA+B;gBACpC,WAAW,EAAE,OAAO;aACrB;YACD;gBACE,GAAG,EAAE,yBAAyB;gBAC9B,WAAW,EAAE,MAAM;aACpB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAElD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAE5C,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;YACvC,6BAA6B,EAAE;gBAC7B,IAAI,EAAE;oBACJ,OAAO,EAAE,eAAe;oBACxB,WAAW,EAAE,OAAO;oBACpB,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,iCAAiC;yBACxC;qBACF;oBACD,SAAS,EAAE;wBACT,KAAK,EAAE;4BACL,WAAW,EAAE,EAAE;yBAChB;qBACF;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { afterEach, beforeEach, describe, it } from \"node:test\";\nimport { fileURLToPath } from \"node:url\";\nimport { expect } from \"chai\";\nimport { createSandbox, SinonSandbox, SinonStub } from \"sinon\";\nimport { importOpenApi } from \"../open-api/merge/handler.js\";\n\nconst baseRoutesFileOnImportTests = {\n info: {\n version: \"v2\",\n title: \"Zuplo test API V2\",\n description: \"Test api v2\",\n contact: {\n name: \"Zuplo test\",\n url: \"www.zuplo.com\",\n },\n },\n openapi: \"3.1.0\",\n components: {\n parameters: {\n userUid: {\n name: \"userUid\",\n in: \"path\",\n description: \"Unique UUID of the user.\",\n required: true,\n schema: {\n type: \"string\",\n format: \"uuid\",\n },\n },\n },\n securitySchemes: {\n authorization: {\n type: \"http\",\n description: \"Firebase JWT auth token\",\n scheme: \"bearer\",\n },\n },\n },\n servers: [\n {\n url: \"https://api.stage.example.com\",\n description: \"Stage\",\n },\n {\n url: \"https://api.example.com\",\n description: \"Prod\",\n },\n ],\n security: [{}],\n tags: [],\n paths: {\n \"/v1/second/{userUid}/nature\": {\n post: {\n summary: \"Test route\",\n operationId: \"12345\",\n parameters: [\n {\n $ref: \"#/components/parameters/userUid\",\n },\n ],\n responses: {\n \"200\": {\n description: \"\",\n },\n },\n security: [{}],\n servers: [\n {\n url: \"https://api.stage.example.com\",\n description: \"stage\",\n },\n {\n url: \"https://api.example.com\",\n description: \"production\",\n },\n ],\n },\n },\n \"/v2/second/{userUid}/nature\": {\n post: {\n operationId: \"67920\",\n summary: \"Test route v2\",\n parameters: [\n {\n $ref: \"#/components/parameters/userUid\",\n },\n ],\n responses: {\n \"200\": {\n description: \"\",\n },\n },\n },\n },\n },\n};\n\nconst __filename = fileURLToPath(import.meta.url); // get the resolved path to the file\nconst __dirname = path.dirname(__filename); // get the name of the directory\n\nconst testAssetsPath = path.join(\n __dirname,\n \"..\",\n \"..\",\n \"src\",\n \"__tests__\",\n \"test-assets\"\n);\n\nconst testTmpPath = path.join(\n __dirname,\n \"..\",\n \"..\",\n \"src\",\n \"__tests__\",\n \"test-tmp\"\n);\n\nasync function createOASFile(content: string, destinationPath: string) {\n try {\n // Get the directory path of the file\n const dir = path.dirname(destinationPath);\n\n // Ensure that the directory exists (creates parent directories if necessary)\n await fs.mkdir(dir, { recursive: true });\n\n // Write the content to the file (creates the file if it doesn't exist)\n await fs.writeFile(destinationPath, content, \"utf8\");\n\n console.log(`File created successfully at ${destinationPath}`);\n } catch (error) {\n console.error(`Error creating file at ${destinationPath}:`, error);\n }\n}\n\nlet sandbox: SinonSandbox;\ndescribe(\"Import open api file\", async function () {\n let printExit: SinonStub;\n beforeEach(async function () {\n sandbox = createSandbox();\n // @NOTE - need to wrap this or else the cli code kills test run\n printExit = sandbox.stub(process, \"exit\");\n });\n\n afterEach(() => {\n sandbox.restore();\n });\n\n it(\"should merge two existing files correctly\", async function () {\n const destinationPath = path.join(\n testTmpPath,\n \"config\",\n \"routes-test-one.oas.json\"\n );\n // setup by creating the destination file first\n await createOASFile(\n JSON.stringify(baseRoutesFileOnImportTests),\n destinationPath\n );\n\n await importOpenApi({\n prompt: false,\n source: path.join(testAssetsPath, \"toimport.oas.json\"),\n destination: destinationPath,\n });\n\n const mergedContent = await fs.readFile(destinationPath, \"utf-8\");\n\n const jsonContent = JSON.parse(mergedContent);\n\n expect(jsonContent.paths).to.deep.equals({\n \"/v1/second/{userUid}/nature\": {\n post: {\n summary: \"Test route\",\n operationId: \"12345\",\n parameters: [\n {\n $ref: \"#/components/parameters/userUid\",\n },\n ],\n responses: {\n \"200\": {\n description: \"\",\n },\n },\n security: [{}],\n servers: [\n {\n url: \"https://api.stage.example.com\",\n description: \"stage\",\n },\n {\n url: \"https://api.example.com\",\n description: \"production\",\n },\n ],\n },\n },\n \"/v2/second/{userUid}/nature\": {\n post: {\n operationId: \"67920\",\n summary: \"Test route v2\",\n parameters: [\n {\n $ref: \"#/components/parameters/userUid\",\n },\n ],\n responses: {\n \"200\": {\n description: \"\",\n },\n },\n },\n },\n });\n });\n\n it(\"should import a file into a fs destination that does not yet exist\", async function () {\n const destinationPath = path.join(testTmpPath, \"routes-test-two.oas.json\");\n\n await importOpenApi({\n prompt: false,\n source: path.join(testAssetsPath, \"toimport.oas.json\"),\n destination: destinationPath,\n });\n\n const mergedContent = await fs.readFile(destinationPath, \"utf-8\");\n\n const jsonContent = JSON.parse(mergedContent);\n\n expect(jsonContent.info).to.deep.equals({\n version: \"v2\",\n title: \"Zuplo test API V2\",\n description: \"Test api v2\",\n contact: {\n name: \"Zuplo test\",\n url: \"www.zuplo.com\",\n },\n });\n\n expect(jsonContent.openapi).to.equal(\"3.1.0\");\n\n expect(jsonContent.components).to.deep.equals({\n parameters: {\n userUid: {\n name: \"userUid\",\n in: \"path\",\n description: \"Unique UUID of the user.\",\n required: true,\n schema: {\n type: \"string\",\n format: \"uuid\",\n },\n },\n },\n securitySchemes: {\n authorization: {\n type: \"http\",\n description: \"Firebase JWT auth token\",\n scheme: \"bearer\",\n },\n },\n });\n\n expect(jsonContent.servers).to.deep.equals([\n {\n url: \"https://api.stage.example.com\",\n description: \"Stage\",\n },\n {\n url: \"https://api.example.com\",\n description: \"Prod\",\n },\n ]);\n\n expect(jsonContent.security).to.deep.equals([{}]);\n\n expect(jsonContent.tags).to.deep.equals([]);\n\n expect(jsonContent.paths).to.deep.equals({\n \"/v2/second/{userUid}/nature\": {\n post: {\n summary: \"Test route v2\",\n operationId: \"67920\",\n parameters: [\n {\n $ref: \"#/components/parameters/userUid\",\n },\n ],\n responses: {\n \"200\": {\n description: \"\",\n },\n },\n },\n },\n });\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-linked-config.integration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-linked-config.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/confirm-linked-config.integration.test.ts"],"names":[],"mappings":""}