create-auto-app 0.2.1 → 0.2.3

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 (289) hide show
  1. package/dist/index.js +7 -7
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/shopping-app/auto.config.ts +134 -9
  5. package/templates/shopping-app/client/auto-configure.ts +1 -1
  6. package/templates/shopping-app/client/package.json +1 -1
  7. package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-build.log +4 -0
  8. package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-format.log +12 -0
  9. package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-lint.log +4 -0
  10. package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-test.log +12 -0
  11. package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-type-check.log +5 -0
  12. package/templates/shopping-app/example-integrations/ai-chat-completion/CHANGELOG.md +134 -0
  13. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts +23 -0
  14. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts.map +1 -0
  15. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js +41 -0
  16. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js.map +1 -0
  17. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts +2 -0
  18. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts.map +1 -0
  19. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js +2 -0
  20. package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js.map +1 -0
  21. package/templates/shopping-app/example-integrations/ai-chat-completion/eslint.config.ts +12 -0
  22. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/eslint +21 -0
  23. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/jiti +21 -0
  24. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/msw +21 -0
  25. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsc +21 -0
  26. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsserver +21 -0
  27. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vite +21 -0
  28. package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vitest +21 -0
  29. package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +29 -0
  30. package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts +76 -0
  31. package/templates/shopping-app/example-integrations/ai-chat-completion/src/index.ts +1 -0
  32. package/templates/shopping-app/example-integrations/ai-chat-completion/tsconfig.json +10 -0
  33. package/templates/shopping-app/example-integrations/ai-chat-completion/tsconfig.test.json +7 -0
  34. package/templates/shopping-app/example-integrations/cart/.turbo/turbo-build.log +4 -0
  35. package/templates/shopping-app/example-integrations/cart/.turbo/turbo-format.log +12 -0
  36. package/templates/shopping-app/example-integrations/cart/.turbo/turbo-lint.log +5 -0
  37. package/templates/shopping-app/example-integrations/cart/.turbo/turbo-test.log +12 -0
  38. package/templates/shopping-app/example-integrations/cart/.turbo/turbo-type-check.log +5 -0
  39. package/templates/shopping-app/example-integrations/cart/CHANGELOG.md +124 -0
  40. package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts +30 -0
  41. package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts.map +1 -0
  42. package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js +134 -0
  43. package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js.map +1 -0
  44. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts +3 -0
  45. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts.map +1 -0
  46. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js +149 -0
  47. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js.map +1 -0
  48. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts +8 -0
  49. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts.map +1 -0
  50. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js +6 -0
  51. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js.map +1 -0
  52. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts +123 -0
  53. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts.map +1 -0
  54. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js +3 -0
  55. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js.map +1 -0
  56. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts +46 -0
  57. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts.map +1 -0
  58. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js +285 -0
  59. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js.map +1 -0
  60. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts +13 -0
  61. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts.map +1 -0
  62. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js +6 -0
  63. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js.map +1 -0
  64. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts +19 -0
  65. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts.map +1 -0
  66. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js +15 -0
  67. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js.map +1 -0
  68. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts +18 -0
  69. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts.map +1 -0
  70. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js +58 -0
  71. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js.map +1 -0
  72. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts +34 -0
  73. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts.map +1 -0
  74. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js +89 -0
  75. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js.map +1 -0
  76. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts +34 -0
  77. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts.map +1 -0
  78. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js +115 -0
  79. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js.map +1 -0
  80. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts +79 -0
  81. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts.map +1 -0
  82. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js +3 -0
  83. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js.map +1 -0
  84. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts +2 -0
  85. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts.map +1 -0
  86. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js +3 -0
  87. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js.map +1 -0
  88. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts +158 -0
  89. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts.map +1 -0
  90. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js +3 -0
  91. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js.map +1 -0
  92. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts +382 -0
  93. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts.map +1 -0
  94. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js +68 -0
  95. package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js.map +1 -0
  96. package/templates/shopping-app/example-integrations/cart/dist/index.d.ts +2 -0
  97. package/templates/shopping-app/example-integrations/cart/dist/index.d.ts.map +1 -0
  98. package/templates/shopping-app/example-integrations/cart/dist/index.js +2 -0
  99. package/templates/shopping-app/example-integrations/cart/dist/index.js.map +1 -0
  100. package/templates/shopping-app/example-integrations/cart/eslint.config.ts +12 -0
  101. package/templates/shopping-app/example-integrations/cart/node_modules/.bin/eslint +21 -0
  102. package/templates/shopping-app/example-integrations/cart/node_modules/.bin/jiti +21 -0
  103. package/templates/shopping-app/example-integrations/cart/node_modules/.bin/msw +21 -0
  104. package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsc +21 -0
  105. package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsserver +21 -0
  106. package/templates/shopping-app/example-integrations/cart/node_modules/.bin/vitest +21 -0
  107. package/templates/shopping-app/example-integrations/cart/package.json +31 -0
  108. package/templates/shopping-app/example-integrations/cart/src/cart-integration.ts +198 -0
  109. package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/client.gen.ts +199 -0
  110. package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/index.ts +25 -0
  111. package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/types.gen.ts +232 -0
  112. package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/utils.gen.ts +419 -0
  113. package/templates/shopping-app/example-integrations/cart/src/generated/cart/client.gen.ts +18 -0
  114. package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/auth.gen.ts +42 -0
  115. package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/bodySerializer.gen.ts +92 -0
  116. package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/params.gen.ts +153 -0
  117. package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/pathSerializer.gen.ts +181 -0
  118. package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/types.gen.ts +120 -0
  119. package/templates/shopping-app/example-integrations/cart/src/generated/cart/index.ts +2 -0
  120. package/templates/shopping-app/example-integrations/cart/src/generated/cart/types.gen.ts +175 -0
  121. package/templates/shopping-app/example-integrations/cart/src/generated/cart/zod.gen.ts +78 -0
  122. package/templates/shopping-app/example-integrations/cart/src/index.ts +1 -0
  123. package/templates/shopping-app/example-integrations/cart/tsconfig.json +10 -0
  124. package/templates/shopping-app/example-integrations/cart/tsconfig.test.json +7 -0
  125. package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-build.log +4 -0
  126. package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-format.log +10 -0
  127. package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-lint.log +4 -0
  128. package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-test.log +12 -0
  129. package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-type-check.log +4 -0
  130. package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts +18 -0
  131. package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts.map +1 -0
  132. package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js +28 -0
  133. package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js.map +1 -0
  134. package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts +4 -0
  135. package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts.map +1 -0
  136. package/templates/shopping-app/example-integrations/cart-api/dist/index.js +49 -0
  137. package/templates/shopping-app/example-integrations/cart-api/dist/index.js.map +1 -0
  138. package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts +4 -0
  139. package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts.map +1 -0
  140. package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js +261 -0
  141. package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js.map +1 -0
  142. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/nodemon +21 -0
  143. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/swagger-jsdoc +21 -0
  144. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node +21 -0
  145. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-cwd +21 -0
  146. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-esm +21 -0
  147. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-script +21 -0
  148. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-transpile-only +21 -0
  149. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-script +21 -0
  150. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsc +21 -0
  151. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsserver +21 -0
  152. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsx +21 -0
  153. package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/vitest +21 -0
  154. package/templates/shopping-app/example-integrations/cart-api/package.json +49 -0
  155. package/templates/shopping-app/example-integrations/cart-api/src/data/cart.ts +45 -0
  156. package/templates/shopping-app/example-integrations/cart-api/src/index.ts +59 -0
  157. package/templates/shopping-app/example-integrations/cart-api/src/routes/cart.ts +289 -0
  158. package/templates/shopping-app/example-integrations/cart-api/tsconfig.json +9 -0
  159. package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-build.log +4 -0
  160. package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-format.log +12 -0
  161. package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-lint.log +5 -0
  162. package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-test.log +12 -0
  163. package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-type-check.log +5 -0
  164. package/templates/shopping-app/example-integrations/product-catalogue/CHANGELOG.md +124 -0
  165. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts +3 -0
  166. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts.map +1 -0
  167. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js +149 -0
  168. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js.map +1 -0
  169. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts +8 -0
  170. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts.map +1 -0
  171. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js +6 -0
  172. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js.map +1 -0
  173. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts +123 -0
  174. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts.map +1 -0
  175. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js +3 -0
  176. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js.map +1 -0
  177. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts +46 -0
  178. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts.map +1 -0
  179. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js +285 -0
  180. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js.map +1 -0
  181. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts +13 -0
  182. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts.map +1 -0
  183. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js +6 -0
  184. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js.map +1 -0
  185. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts +19 -0
  186. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts.map +1 -0
  187. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js +15 -0
  188. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js.map +1 -0
  189. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts +18 -0
  190. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts.map +1 -0
  191. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js +58 -0
  192. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js.map +1 -0
  193. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts +34 -0
  194. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts.map +1 -0
  195. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js +89 -0
  196. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js.map +1 -0
  197. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts +34 -0
  198. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts.map +1 -0
  199. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js +115 -0
  200. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js.map +1 -0
  201. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts +79 -0
  202. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts.map +1 -0
  203. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js +3 -0
  204. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js.map +1 -0
  205. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts +2 -0
  206. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts.map +1 -0
  207. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js +3 -0
  208. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js.map +1 -0
  209. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts +115 -0
  210. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts.map +1 -0
  211. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js +3 -0
  212. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js.map +1 -0
  213. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts +206 -0
  214. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts.map +1 -0
  215. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js +53 -0
  216. package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js.map +1 -0
  217. package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts +2 -0
  218. package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts.map +1 -0
  219. package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js +2 -0
  220. package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js.map +1 -0
  221. package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts +32 -0
  222. package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts.map +1 -0
  223. package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js +163 -0
  224. package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js.map +1 -0
  225. package/templates/shopping-app/example-integrations/product-catalogue/eslint.config.ts +12 -0
  226. package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/eslint +21 -0
  227. package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/jiti +21 -0
  228. package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/msw +21 -0
  229. package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsc +21 -0
  230. package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsserver +21 -0
  231. package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/vitest +21 -0
  232. package/templates/shopping-app/example-integrations/product-catalogue/package.json +31 -0
  233. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/client.gen.ts +199 -0
  234. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/index.ts +25 -0
  235. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/types.gen.ts +232 -0
  236. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/utils.gen.ts +419 -0
  237. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client.gen.ts +18 -0
  238. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/auth.gen.ts +42 -0
  239. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/bodySerializer.gen.ts +92 -0
  240. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/params.gen.ts +153 -0
  241. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/pathSerializer.gen.ts +181 -0
  242. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/types.gen.ts +120 -0
  243. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/index.ts +2 -0
  244. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/types.gen.ts +133 -0
  245. package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/zod.gen.ts +62 -0
  246. package/templates/shopping-app/example-integrations/product-catalogue/src/index.ts +1 -0
  247. package/templates/shopping-app/example-integrations/product-catalogue/src/product-catalogue-integration.ts +225 -0
  248. package/templates/shopping-app/example-integrations/product-catalogue/tsconfig.json +10 -0
  249. package/templates/shopping-app/example-integrations/product-catalogue/tsconfig.test.json +7 -0
  250. package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-build.log +4 -0
  251. package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-format.log +10 -0
  252. package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-lint.log +5 -0
  253. package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-test.log +13 -0
  254. package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-type-check.log +5 -0
  255. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts +10 -0
  256. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts.map +1 -0
  257. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js +75 -0
  258. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js.map +1 -0
  259. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts +4 -0
  260. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts.map +1 -0
  261. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js +49 -0
  262. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js.map +1 -0
  263. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts +4 -0
  264. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts.map +1 -0
  265. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js +170 -0
  266. package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js.map +1 -0
  267. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/nodemon +21 -0
  268. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/swagger-jsdoc +21 -0
  269. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node +21 -0
  270. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-cwd +21 -0
  271. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-esm +21 -0
  272. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-script +21 -0
  273. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-transpile-only +21 -0
  274. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-script +21 -0
  275. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsc +21 -0
  276. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsserver +21 -0
  277. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsx +21 -0
  278. package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/vitest +21 -0
  279. package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +51 -0
  280. package/templates/shopping-app/example-integrations/product-catalogue-api/src/data/products.ts +90 -0
  281. package/templates/shopping-app/example-integrations/product-catalogue-api/src/index.ts +59 -0
  282. package/templates/shopping-app/example-integrations/product-catalogue-api/src/routes/products.ts +181 -0
  283. package/templates/shopping-app/example-integrations/product-catalogue-api/tsconfig.json +9 -0
  284. package/templates/shopping-app/flows/shopping-assistant.flow.ts +1 -1
  285. package/templates/shopping-app/package.json +10 -6
  286. package/templates/shopping-app/server/package.json +1 -1
  287. package/templates/shopping-app/server/src/integrations/ai-integration.ts +1 -1
  288. package/templates/shopping-app/server/src/integrations/cart-integration.ts +1 -1
  289. package/templates/shopping-app/server/src/integrations/product-catalogue-integration.ts +1 -1
@@ -0,0 +1,32 @@
1
+ import type { State, Integration } from '@auto-engineer/flow';
2
+ import type { ProductCatalogItem } from './generated/product-catalog';
3
+ export type Product = ProductCatalogItem;
4
+ export type Products = State<'Products', {
5
+ products: Product[];
6
+ }>;
7
+ export type ProductsByCategory = State<'ProductsByCategory', {
8
+ category: string;
9
+ products: Product[];
10
+ }>;
11
+ export type ProductSearchResults = State<'ProductSearchResults', {
12
+ query: string;
13
+ products: Product[];
14
+ }>;
15
+ export type ProductDetails = State<'ProductDetails', {
16
+ product: Product | null;
17
+ }>;
18
+ type ProductCatalogQueries = {
19
+ Products: () => Promise<Products>;
20
+ ProductsByCategory: (params: {
21
+ category: string;
22
+ }) => Promise<ProductsByCategory>;
23
+ ProductSearchResults: (params: {
24
+ query: string;
25
+ }) => Promise<ProductSearchResults>;
26
+ ProductDetails: (params: {
27
+ id: string;
28
+ }) => Promise<ProductDetails>;
29
+ };
30
+ export declare const ProductCatalog: Integration<'product-catalog', ProductCatalogQueries>;
31
+ export {};
32
+ //# sourceMappingURL=product-catalogue-integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-catalogue-integration.d.ts","sourceRoot":"","sources":["../src/product-catalogue-integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAI9D,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,6BAA6B,CAAC;AAQrC,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAEzC,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,EAAE;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CAAC;AACxG,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,sBAAsB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CAAC;AACzG,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,EAAE;IAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC;AAQlF,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,kBAAkB,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAClF,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnF,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CACrE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,iBAAiB,EAAE,qBAAqB,CAsEhF,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { registerTool, z } from '@auto-engineer/ai-gateway';
2
+ import { createClient } from './generated/product-catalog/client';
3
+ import { zGetApiProductsResponse, zGetApiProductsSearchResponse, zGetApiProductsCategoryByCategoryResponse, zGetApiProductsByIdResponse, } from './generated/product-catalog/zod.gen';
4
+ // ---------- Generated client instance ----------
5
+ const productClient = createClient({
6
+ baseUrl: 'http://localhost:3001',
7
+ });
8
+ export const ProductCatalog = {
9
+ __brand: 'Integration',
10
+ type: 'product-catalog',
11
+ name: 'product-catalog',
12
+ Queries: {
13
+ // GET /api/products
14
+ Products: async () => {
15
+ try {
16
+ const res = await productClient.get({
17
+ url: '/api/products',
18
+ });
19
+ if (res.error !== undefined)
20
+ console.error('Failed to fetch products:', res.error);
21
+ return { type: 'Products', data: { products: res.data ?? [] } };
22
+ }
23
+ catch (err) {
24
+ console.error('Failed to fetch products:', err);
25
+ return { type: 'Products', data: { products: [] } };
26
+ }
27
+ },
28
+ // GET /api/products/category/{category}
29
+ ProductsByCategory: async ({ category }) => {
30
+ try {
31
+ const res = await productClient.get({
32
+ url: '/api/products/category/{category}',
33
+ path: { category },
34
+ });
35
+ if (res.error !== undefined)
36
+ console.error(`Category "${category}" error:`, res.error);
37
+ return { type: 'ProductsByCategory', data: { category, products: res.data ?? [] } };
38
+ }
39
+ catch (err) {
40
+ console.error(`Failed to fetch products for category ${category}:`, err);
41
+ return { type: 'ProductsByCategory', data: { category, products: [] } };
42
+ }
43
+ },
44
+ // GET /api/products/search?q=...
45
+ ProductSearchResults: async ({ query }) => {
46
+ try {
47
+ const res = await productClient.get({
48
+ url: '/api/products/search',
49
+ query: { q: query },
50
+ });
51
+ if (res.error !== undefined)
52
+ console.error(`Search "${query}" error:`, res.error);
53
+ return { type: 'ProductSearchResults', data: { query, products: res.data ?? [] } };
54
+ }
55
+ catch (err) {
56
+ console.error(`Failed to search products with query "${query}":`, err);
57
+ return { type: 'ProductSearchResults', data: { query, products: [] } };
58
+ }
59
+ },
60
+ // GET /api/products/{id}
61
+ ProductDetails: async ({ id }) => {
62
+ try {
63
+ const res = await productClient.get({
64
+ url: '/api/products/{id}',
65
+ path: { id },
66
+ });
67
+ if (res.response.status === 404 || res.error !== undefined) {
68
+ if (res.response.status !== 404) {
69
+ console.error(`Error fetching product "${id}":`, res.error);
70
+ }
71
+ return { type: 'ProductDetails', data: { product: null } };
72
+ }
73
+ return { type: 'ProductDetails', data: { product: res.data ?? null } };
74
+ }
75
+ catch (err) {
76
+ console.error(`Failed to fetch product details for ID ${id}:`, err);
77
+ return { type: 'ProductDetails', data: { product: null } };
78
+ }
79
+ },
80
+ },
81
+ };
82
+ // ---------- MCP tools ----------
83
+ // All products
84
+ registerTool('PRODUCT_CATALOGUE_PRODUCTS', {
85
+ title: 'Get All Products',
86
+ description: 'Fetches all products from the product catalog',
87
+ inputSchema: {},
88
+ schema: zGetApiProductsResponse,
89
+ schemaName: 'GetApiProductsResponse',
90
+ schemaDescription: 'Array of ProductCatalogItem',
91
+ }, async () => {
92
+ const queries = ProductCatalog.Queries;
93
+ if (queries?.Products == null) {
94
+ return {
95
+ content: [{ type: 'text', text: 'ProductCatalog.Queries.Products is not available' }],
96
+ isError: true,
97
+ };
98
+ }
99
+ const productsQuery = queries.Products;
100
+ const result = await productsQuery();
101
+ return { content: [{ type: 'text', text: JSON.stringify(result.data.products, null, 2) }] };
102
+ });
103
+ registerTool('PRODUCT_CATALOGUE_PRODUCTS_BY_CATEGORY', {
104
+ title: 'Get Products by Category',
105
+ description: 'Fetches products from a specific category',
106
+ inputSchema: { category: z.string().min(1, 'Category is required') },
107
+ schema: zGetApiProductsCategoryByCategoryResponse,
108
+ schemaName: 'GetApiProductsCategoryByCategoryResponse',
109
+ schemaDescription: 'Array of ProductCatalogItem',
110
+ }, async ({ category }) => {
111
+ const queries = ProductCatalog.Queries;
112
+ if (queries?.ProductsByCategory == null) {
113
+ return {
114
+ content: [{ type: 'text', text: 'ProductCatalog.Queries.ProductsByCategory is not available' }],
115
+ isError: true,
116
+ };
117
+ }
118
+ const categoryQuery = queries.ProductsByCategory;
119
+ const result = await categoryQuery({ category });
120
+ return { content: [{ type: 'text', text: JSON.stringify(result.data.products, null, 2) }] };
121
+ });
122
+ registerTool('PRODUCT_CATALOGUE_SEARCH', {
123
+ title: 'Search Products',
124
+ description: 'Search for products using a query string',
125
+ inputSchema: { query: z.string().min(1, 'Search query is required') },
126
+ schema: zGetApiProductsSearchResponse,
127
+ schemaName: 'GetApiProductsSearchResponse',
128
+ schemaDescription: 'Array of ProductCatalogItem',
129
+ }, async ({ query }) => {
130
+ const queries = ProductCatalog.Queries;
131
+ if (queries?.ProductSearchResults == null) {
132
+ return {
133
+ content: [{ type: 'text', text: 'ProductCatalog.Queries.ProductSearchResults is not available' }],
134
+ isError: true,
135
+ };
136
+ }
137
+ const searchQuery = queries.ProductSearchResults;
138
+ const result = await searchQuery({ query });
139
+ return { content: [{ type: 'text', text: JSON.stringify(result.data.products, null, 2) }] };
140
+ });
141
+ registerTool('PRODUCT_CATALOGUE_PRODUCT_DETAILS', {
142
+ title: 'Get Product Details',
143
+ description: 'Fetches detailed information about a specific product',
144
+ inputSchema: { id: z.string().min(1, 'Product ID is required') },
145
+ schema: zGetApiProductsByIdResponse,
146
+ schemaName: 'GetApiProductsByIdResponse',
147
+ schemaDescription: 'Single ProductCatalogItem',
148
+ }, async ({ id }) => {
149
+ const queries = ProductCatalog.Queries;
150
+ if (queries?.ProductDetails == null) {
151
+ return {
152
+ content: [{ type: 'text', text: 'ProductCatalog.Queries.ProductDetails is not available' }],
153
+ isError: true,
154
+ };
155
+ }
156
+ const detailsQuery = queries.ProductDetails;
157
+ const result = await detailsQuery({ id });
158
+ if (result.data.product === null) {
159
+ return { content: [{ type: 'text', text: `Product with ID "${id}" not found` }], isError: true };
160
+ }
161
+ return { content: [{ type: 'text', text: JSON.stringify(result.data.product, null, 2) }] };
162
+ });
163
+ //# sourceMappingURL=product-catalogue-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-catalogue-integration.js","sourceRoot":"","sources":["../src/product-catalogue-integration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAUlE,OAAO,E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AAE,qBAAqB;IAC5B,WAAW,EAAE,uDAAuD;IACpE,WAAW,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC,EAAE;IAChE,MAAM,EAAE,2BAA2B;IACnC,UAAU,EAAE,4BAA4B;IACxC,iBAAiB,EAAE,2BAA2B;CAC/C,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IACf,MAAM,OAAO,GAAG,cAAc,CAAC,OAAgC,CAAC;IAChE,IAAI,OAAO,EAAE,cAAc,IAAI,IAAI,EAAE,CAAC;QACpC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,wDAAwD,EAAE,CAAC;YACpG,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,oBAAoB,EAAE,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC5G,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACtG,CAAC,CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import rootConfig from '../../../../../../eslint.config.ts';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ export default tseslint.config(...rootConfig, {
5
+ ignores: ['eslint.config.ts', 'src/generated/**/*'],
6
+ languageOptions: {
7
+ parserOptions: {
8
+ project: ['./tsconfig.json', './tsconfig.test.json'],
9
+ tsconfigRootDir: import.meta.dirname,
10
+ },
11
+ },
12
+ });
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules/eslint/bin/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules/eslint/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules/eslint/bin/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules/eslint/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules/eslint/bin/eslint.js" "$@"
19
+ else
20
+ exec node "$basedir/../../../../node_modules/.pnpm/eslint@9.34.0_jiti@2.5.1/node_modules/eslint/bin/eslint.js" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/jiti@2.5.1/node_modules/jiti/lib/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/jiti@2.5.1/node_modules/jiti/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/jiti@2.5.1/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/jiti@2.5.1/node_modules/jiti/lib/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/jiti@2.5.1/node_modules/jiti/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/jiti@2.5.1/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/jiti@2.5.1/node_modules/jiti/lib/jiti-cli.mjs" "$@"
19
+ else
20
+ exec node "$basedir/../../../../node_modules/.pnpm/jiti@2.5.1/node_modules/jiti/lib/jiti-cli.mjs" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules/msw/cli/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules/msw/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules/msw/cli/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules/msw/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules/msw/cli/index.js" "$@"
19
+ else
20
+ exec node "$basedir/../../../../node_modules/.pnpm/msw@2.10.4_@types+node@24.3.0_typescript@5.8.3/node_modules/msw/cli/index.js" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" "$@"
19
+ else
20
+ exec node "$basedir/../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/typescript@5.8.3/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
19
+ else
20
+ exec node "$basedir/../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.18.0_jsdom@26.1.0/node_modules/vitest/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.18.0_jsdom@26.1.0/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.18.0_jsdom@26.1.0/node_modules/vitest/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.18.0_jsdom@26.1.0/node_modules:/Users/sam/WebstormProjects/top/auto-engineer/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
19
+ else
20
+ exec node "$basedir/../vitest/vitest.mjs" "$@"
21
+ fi
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@auto-engineer/product-catalogue-integration",
3
+ "version": "0.6.1",
4
+ "main": "./dist/index.js",
5
+ "type": "module",
6
+ "types": "./dist/index.d.ts",
7
+ "dependencies": {
8
+ "@auto-engineer/flow": "^0.1.1",
9
+ "@auto-engineer/ai-gateway": "^0.6.1",
10
+ "axios": "^1.6.0",
11
+ "zod": "^3.22.4"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "dev": "tsc --watch",
16
+ "test": "vitest run",
17
+ "lint": "eslint 'src/**/*.ts' --ignore-pattern 'src/generated/**/*' --max-warnings 0 --config ./eslint.config.ts",
18
+ "type-check": "tsc --noEmit",
19
+ "format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
20
+ "lint:fix": "eslint 'src/**/*.ts' --ignore-pattern 'src/generated/**/*' --fix --config ./eslint.config.ts",
21
+ "format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "devDependencies": {
27
+ "@eslint/js": "^8.57.0",
28
+ "typescript-eslint": "^7.0.0",
29
+ "vitest": "^3.2.4"
30
+ }
31
+ }
@@ -0,0 +1,199 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Client, Config, ResolvedRequestOptions } from './types.gen';
4
+ import {
5
+ buildUrl,
6
+ createConfig,
7
+ createInterceptors,
8
+ getParseAs,
9
+ mergeConfigs,
10
+ mergeHeaders,
11
+ setAuthParams,
12
+ } from './utils.gen';
13
+
14
+ type ReqInit = Omit<RequestInit, 'body' | 'headers'> & {
15
+ body?: any;
16
+ headers: ReturnType<typeof mergeHeaders>;
17
+ };
18
+
19
+ export const createClient = (config: Config = {}): Client => {
20
+ let _config = mergeConfigs(createConfig(), config);
21
+
22
+ const getConfig = (): Config => ({ ..._config });
23
+
24
+ const setConfig = (config: Config): Config => {
25
+ _config = mergeConfigs(_config, config);
26
+ return getConfig();
27
+ };
28
+
29
+ const interceptors = createInterceptors<
30
+ Request,
31
+ Response,
32
+ unknown,
33
+ ResolvedRequestOptions
34
+ >();
35
+
36
+ const request: Client['request'] = async (options) => {
37
+ const opts = {
38
+ ..._config,
39
+ ...options,
40
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
41
+ headers: mergeHeaders(_config.headers, options.headers),
42
+ serializedBody: undefined,
43
+ };
44
+
45
+ if (opts.security) {
46
+ await setAuthParams({
47
+ ...opts,
48
+ security: opts.security,
49
+ });
50
+ }
51
+
52
+ if (opts.requestValidator) {
53
+ await opts.requestValidator(opts);
54
+ }
55
+
56
+ if (opts.body && opts.bodySerializer) {
57
+ opts.serializedBody = opts.bodySerializer(opts.body);
58
+ }
59
+
60
+ // remove Content-Type header if body is empty to avoid sending invalid requests
61
+ if (opts.serializedBody === undefined || opts.serializedBody === '') {
62
+ opts.headers.delete('Content-Type');
63
+ }
64
+
65
+ const url = buildUrl(opts);
66
+ const requestInit: ReqInit = {
67
+ redirect: 'follow',
68
+ ...opts,
69
+ body: opts.serializedBody,
70
+ };
71
+
72
+ let request = new Request(url, requestInit);
73
+
74
+ for (const fn of interceptors.request._fns) {
75
+ if (fn) {
76
+ request = await fn(request, opts);
77
+ }
78
+ }
79
+
80
+ // fetch must be assigned here, otherwise it would throw the error:
81
+ // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
82
+ const _fetch = opts.fetch!;
83
+ let response = await _fetch(request);
84
+
85
+ for (const fn of interceptors.response._fns) {
86
+ if (fn) {
87
+ response = await fn(response, request, opts);
88
+ }
89
+ }
90
+
91
+ const result = {
92
+ request,
93
+ response,
94
+ };
95
+
96
+ if (response.ok) {
97
+ if (
98
+ response.status === 204 ||
99
+ response.headers.get('Content-Length') === '0'
100
+ ) {
101
+ return opts.responseStyle === 'data'
102
+ ? {}
103
+ : {
104
+ data: {},
105
+ ...result,
106
+ };
107
+ }
108
+
109
+ const parseAs =
110
+ (opts.parseAs === 'auto'
111
+ ? getParseAs(response.headers.get('Content-Type'))
112
+ : opts.parseAs) ?? 'json';
113
+
114
+ let data: any;
115
+ switch (parseAs) {
116
+ case 'arrayBuffer':
117
+ case 'blob':
118
+ case 'formData':
119
+ case 'json':
120
+ case 'text':
121
+ data = await response[parseAs]();
122
+ break;
123
+ case 'stream':
124
+ return opts.responseStyle === 'data'
125
+ ? response.body
126
+ : {
127
+ data: response.body,
128
+ ...result,
129
+ };
130
+ }
131
+
132
+ if (parseAs === 'json') {
133
+ if (opts.responseValidator) {
134
+ await opts.responseValidator(data);
135
+ }
136
+
137
+ if (opts.responseTransformer) {
138
+ data = await opts.responseTransformer(data);
139
+ }
140
+ }
141
+
142
+ return opts.responseStyle === 'data'
143
+ ? data
144
+ : {
145
+ data,
146
+ ...result,
147
+ };
148
+ }
149
+
150
+ const textError = await response.text();
151
+ let jsonError: unknown;
152
+
153
+ try {
154
+ jsonError = JSON.parse(textError);
155
+ } catch {
156
+ // noop
157
+ }
158
+
159
+ const error = jsonError ?? textError;
160
+ let finalError = error;
161
+
162
+ for (const fn of interceptors.error._fns) {
163
+ if (fn) {
164
+ finalError = (await fn(error, response, request, opts)) as string;
165
+ }
166
+ }
167
+
168
+ finalError = finalError || ({} as string);
169
+
170
+ if (opts.throwOnError) {
171
+ throw finalError;
172
+ }
173
+
174
+ // TODO: we probably want to return error and improve types
175
+ return opts.responseStyle === 'data'
176
+ ? undefined
177
+ : {
178
+ error: finalError,
179
+ ...result,
180
+ };
181
+ };
182
+
183
+ return {
184
+ buildUrl,
185
+ connect: (options) => request({ ...options, method: 'CONNECT' }),
186
+ delete: (options) => request({ ...options, method: 'DELETE' }),
187
+ get: (options) => request({ ...options, method: 'GET' }),
188
+ getConfig,
189
+ head: (options) => request({ ...options, method: 'HEAD' }),
190
+ interceptors,
191
+ options: (options) => request({ ...options, method: 'OPTIONS' }),
192
+ patch: (options) => request({ ...options, method: 'PATCH' }),
193
+ post: (options) => request({ ...options, method: 'POST' }),
194
+ put: (options) => request({ ...options, method: 'PUT' }),
195
+ request,
196
+ setConfig,
197
+ trace: (options) => request({ ...options, method: 'TRACE' }),
198
+ };
199
+ };
@@ -0,0 +1,25 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export type { Auth } from '../core/auth.gen';
4
+ export type { QuerySerializerOptions } from '../core/bodySerializer.gen';
5
+ export {
6
+ formDataBodySerializer,
7
+ jsonBodySerializer,
8
+ urlSearchParamsBodySerializer,
9
+ } from '../core/bodySerializer.gen';
10
+ export { buildClientParams } from '../core/params.gen';
11
+ export { createClient } from './client.gen';
12
+ export type {
13
+ Client,
14
+ ClientOptions,
15
+ Config,
16
+ CreateClientConfig,
17
+ Options,
18
+ OptionsLegacyParser,
19
+ RequestOptions,
20
+ RequestResult,
21
+ ResolvedRequestOptions,
22
+ ResponseStyle,
23
+ TDataShape,
24
+ } from './types.gen';
25
+ export { createConfig, mergeHeaders } from './utils.gen';