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.
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/shopping-app/auto.config.ts +134 -9
- package/templates/shopping-app/client/auto-configure.ts +1 -1
- package/templates/shopping-app/client/package.json +1 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-build.log +4 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-format.log +12 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-lint.log +4 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-test.log +12 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-type-check.log +5 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/CHANGELOG.md +134 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts +23 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js +41 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js.map +1 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts +2 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js +2 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/eslint.config.ts +12 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/eslint +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/jiti +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/msw +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsc +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsserver +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vite +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vitest +21 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +29 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts +76 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/src/index.ts +1 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/tsconfig.json +10 -0
- package/templates/shopping-app/example-integrations/ai-chat-completion/tsconfig.test.json +7 -0
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-build.log +4 -0
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-format.log +12 -0
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-lint.log +5 -0
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-test.log +12 -0
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-type-check.log +5 -0
- package/templates/shopping-app/example-integrations/cart/CHANGELOG.md +124 -0
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts +30 -0
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js +134 -0
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts +3 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js +149 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts +8 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js +6 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts +123 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js +3 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts +46 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js +285 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts +13 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js +6 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts +19 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js +15 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts +18 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js +58 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts +34 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js +89 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts +34 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js +115 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts +79 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js +3 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts +2 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js +3 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts +158 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js +3 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts +382 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js +68 -0
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/index.d.ts +2 -0
- package/templates/shopping-app/example-integrations/cart/dist/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart/dist/index.js +2 -0
- package/templates/shopping-app/example-integrations/cart/dist/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart/eslint.config.ts +12 -0
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/eslint +21 -0
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/jiti +21 -0
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/msw +21 -0
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsc +21 -0
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsserver +21 -0
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/vitest +21 -0
- package/templates/shopping-app/example-integrations/cart/package.json +31 -0
- package/templates/shopping-app/example-integrations/cart/src/cart-integration.ts +198 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/client.gen.ts +199 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/index.ts +25 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/types.gen.ts +232 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/client/utils.gen.ts +419 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/client.gen.ts +18 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/auth.gen.ts +42 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/bodySerializer.gen.ts +92 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/params.gen.ts +153 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/pathSerializer.gen.ts +181 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/core/types.gen.ts +120 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/index.ts +2 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/types.gen.ts +175 -0
- package/templates/shopping-app/example-integrations/cart/src/generated/cart/zod.gen.ts +78 -0
- package/templates/shopping-app/example-integrations/cart/src/index.ts +1 -0
- package/templates/shopping-app/example-integrations/cart/tsconfig.json +10 -0
- package/templates/shopping-app/example-integrations/cart/tsconfig.test.json +7 -0
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-build.log +4 -0
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-format.log +10 -0
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-lint.log +4 -0
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-test.log +12 -0
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-type-check.log +4 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts +18 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js +28 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts +4 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/index.js +49 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts +4 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js +261 -0
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js.map +1 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/nodemon +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/swagger-jsdoc +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-cwd +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-esm +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-script +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-transpile-only +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-script +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsc +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsserver +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsx +21 -0
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/vitest +21 -0
- package/templates/shopping-app/example-integrations/cart-api/package.json +49 -0
- package/templates/shopping-app/example-integrations/cart-api/src/data/cart.ts +45 -0
- package/templates/shopping-app/example-integrations/cart-api/src/index.ts +59 -0
- package/templates/shopping-app/example-integrations/cart-api/src/routes/cart.ts +289 -0
- package/templates/shopping-app/example-integrations/cart-api/tsconfig.json +9 -0
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-build.log +4 -0
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-format.log +12 -0
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-lint.log +5 -0
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-test.log +12 -0
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-type-check.log +5 -0
- package/templates/shopping-app/example-integrations/product-catalogue/CHANGELOG.md +124 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts +3 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js +149 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts +8 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js +6 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts +123 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js +3 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts +46 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js +285 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts +13 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js +6 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts +19 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js +15 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts +18 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js +58 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts +34 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js +89 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts +34 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js +115 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts +79 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js +3 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts +2 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js +3 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts +115 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js +3 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts +206 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js +53 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts +2 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js +2 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts +32 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js +163 -0
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/eslint.config.ts +12 -0
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/eslint +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/jiti +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/msw +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsc +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsserver +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/vitest +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue/package.json +31 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/client.gen.ts +199 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/index.ts +25 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/types.gen.ts +232 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client/utils.gen.ts +419 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/client.gen.ts +18 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/auth.gen.ts +42 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/bodySerializer.gen.ts +92 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/params.gen.ts +153 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/pathSerializer.gen.ts +181 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/core/types.gen.ts +120 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/index.ts +2 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/types.gen.ts +133 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/generated/product-catalog/zod.gen.ts +62 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/index.ts +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue/src/product-catalogue-integration.ts +225 -0
- package/templates/shopping-app/example-integrations/product-catalogue/tsconfig.json +10 -0
- package/templates/shopping-app/example-integrations/product-catalogue/tsconfig.test.json +7 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-build.log +4 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-format.log +10 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-lint.log +5 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-test.log +13 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-type-check.log +5 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts +10 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js +75 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts +4 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js +49 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts +4 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js +170 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js.map +1 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/nodemon +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/swagger-jsdoc +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-cwd +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-esm +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-script +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-transpile-only +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-script +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsc +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsserver +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsx +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/vitest +21 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +51 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/src/data/products.ts +90 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/src/index.ts +59 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/src/routes/products.ts +181 -0
- package/templates/shopping-app/example-integrations/product-catalogue-api/tsconfig.json +9 -0
- package/templates/shopping-app/flows/shopping-assistant.flow.ts +1 -1
- package/templates/shopping-app/package.json +10 -6
- package/templates/shopping-app/server/package.json +1 -1
- package/templates/shopping-app/server/src/integrations/ai-integration.ts +1 -1
- package/templates/shopping-app/server/src/integrations/cart-integration.ts +1 -1
- package/templates/shopping-app/server/src/integrations/product-catalogue-integration.ts +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ArrayStyle,
|
|
5
|
+
ObjectStyle,
|
|
6
|
+
SerializerOptions,
|
|
7
|
+
} from './pathSerializer.gen';
|
|
8
|
+
|
|
9
|
+
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
10
|
+
|
|
11
|
+
export type BodySerializer = (body: any) => any;
|
|
12
|
+
|
|
13
|
+
export interface QuerySerializerOptions {
|
|
14
|
+
allowReserved?: boolean;
|
|
15
|
+
array?: SerializerOptions<ArrayStyle>;
|
|
16
|
+
object?: SerializerOptions<ObjectStyle>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const serializeFormDataPair = (
|
|
20
|
+
data: FormData,
|
|
21
|
+
key: string,
|
|
22
|
+
value: unknown,
|
|
23
|
+
): void => {
|
|
24
|
+
if (typeof value === 'string' || value instanceof Blob) {
|
|
25
|
+
data.append(key, value);
|
|
26
|
+
} else if (value instanceof Date) {
|
|
27
|
+
data.append(key, value.toISOString());
|
|
28
|
+
} else {
|
|
29
|
+
data.append(key, JSON.stringify(value));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const serializeUrlSearchParamsPair = (
|
|
34
|
+
data: URLSearchParams,
|
|
35
|
+
key: string,
|
|
36
|
+
value: unknown,
|
|
37
|
+
): void => {
|
|
38
|
+
if (typeof value === 'string') {
|
|
39
|
+
data.append(key, value);
|
|
40
|
+
} else {
|
|
41
|
+
data.append(key, JSON.stringify(value));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const formDataBodySerializer = {
|
|
46
|
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
|
|
47
|
+
body: T,
|
|
48
|
+
): FormData => {
|
|
49
|
+
const data = new FormData();
|
|
50
|
+
|
|
51
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
52
|
+
if (value === undefined || value === null) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
value.forEach((v) => serializeFormDataPair(data, key, v));
|
|
57
|
+
} else {
|
|
58
|
+
serializeFormDataPair(data, key, value);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return data;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const jsonBodySerializer = {
|
|
67
|
+
bodySerializer: <T>(body: T): string =>
|
|
68
|
+
JSON.stringify(body, (_key, value) =>
|
|
69
|
+
typeof value === 'bigint' ? value.toString() : value,
|
|
70
|
+
),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const urlSearchParamsBodySerializer = {
|
|
74
|
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
|
|
75
|
+
body: T,
|
|
76
|
+
): string => {
|
|
77
|
+
const data = new URLSearchParams();
|
|
78
|
+
|
|
79
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
80
|
+
if (value === undefined || value === null) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (Array.isArray(value)) {
|
|
84
|
+
value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
|
|
85
|
+
} else {
|
|
86
|
+
serializeUrlSearchParamsPair(data, key, value);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
return data.toString();
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
type Slot = 'body' | 'headers' | 'path' | 'query';
|
|
4
|
+
|
|
5
|
+
export type Field =
|
|
6
|
+
| {
|
|
7
|
+
in: Exclude<Slot, 'body'>;
|
|
8
|
+
/**
|
|
9
|
+
* Field name. This is the name we want the user to see and use.
|
|
10
|
+
*/
|
|
11
|
+
key: string;
|
|
12
|
+
/**
|
|
13
|
+
* Field mapped name. This is the name we want to use in the request.
|
|
14
|
+
* If omitted, we use the same value as `key`.
|
|
15
|
+
*/
|
|
16
|
+
map?: string;
|
|
17
|
+
}
|
|
18
|
+
| {
|
|
19
|
+
in: Extract<Slot, 'body'>;
|
|
20
|
+
/**
|
|
21
|
+
* Key isn't required for bodies.
|
|
22
|
+
*/
|
|
23
|
+
key?: string;
|
|
24
|
+
map?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export interface Fields {
|
|
28
|
+
allowExtra?: Partial<Record<Slot, boolean>>;
|
|
29
|
+
args?: ReadonlyArray<Field>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type FieldsConfig = ReadonlyArray<Field | Fields>;
|
|
33
|
+
|
|
34
|
+
const extraPrefixesMap: Record<string, Slot> = {
|
|
35
|
+
$body_: 'body',
|
|
36
|
+
$headers_: 'headers',
|
|
37
|
+
$path_: 'path',
|
|
38
|
+
$query_: 'query',
|
|
39
|
+
};
|
|
40
|
+
const extraPrefixes = Object.entries(extraPrefixesMap);
|
|
41
|
+
|
|
42
|
+
type KeyMap = Map<
|
|
43
|
+
string,
|
|
44
|
+
{
|
|
45
|
+
in: Slot;
|
|
46
|
+
map?: string;
|
|
47
|
+
}
|
|
48
|
+
>;
|
|
49
|
+
|
|
50
|
+
const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
|
|
51
|
+
if (!map) {
|
|
52
|
+
map = new Map();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
for (const config of fields) {
|
|
56
|
+
if ('in' in config) {
|
|
57
|
+
if (config.key) {
|
|
58
|
+
map.set(config.key, {
|
|
59
|
+
in: config.in,
|
|
60
|
+
map: config.map,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
} else if (config.args) {
|
|
64
|
+
buildKeyMap(config.args, map);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return map;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
interface Params {
|
|
72
|
+
body: unknown;
|
|
73
|
+
headers: Record<string, unknown>;
|
|
74
|
+
path: Record<string, unknown>;
|
|
75
|
+
query: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const stripEmptySlots = (params: Params) => {
|
|
79
|
+
for (const [slot, value] of Object.entries(params)) {
|
|
80
|
+
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
81
|
+
delete params[slot as Slot];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const buildClientParams = (
|
|
87
|
+
args: ReadonlyArray<unknown>,
|
|
88
|
+
fields: FieldsConfig,
|
|
89
|
+
) => {
|
|
90
|
+
const params: Params = {
|
|
91
|
+
body: {},
|
|
92
|
+
headers: {},
|
|
93
|
+
path: {},
|
|
94
|
+
query: {},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const map = buildKeyMap(fields);
|
|
98
|
+
|
|
99
|
+
let config: FieldsConfig[number] | undefined;
|
|
100
|
+
|
|
101
|
+
for (const [index, arg] of args.entries()) {
|
|
102
|
+
if (fields[index]) {
|
|
103
|
+
config = fields[index];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!config) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if ('in' in config) {
|
|
111
|
+
if (config.key) {
|
|
112
|
+
const field = map.get(config.key)!;
|
|
113
|
+
const name = field.map || config.key;
|
|
114
|
+
(params[field.in] as Record<string, unknown>)[name] = arg;
|
|
115
|
+
} else {
|
|
116
|
+
params.body = arg;
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
for (const [key, value] of Object.entries(arg ?? {})) {
|
|
120
|
+
const field = map.get(key);
|
|
121
|
+
|
|
122
|
+
if (field) {
|
|
123
|
+
const name = field.map || key;
|
|
124
|
+
(params[field.in] as Record<string, unknown>)[name] = value;
|
|
125
|
+
} else {
|
|
126
|
+
const extra = extraPrefixes.find(([prefix]) =>
|
|
127
|
+
key.startsWith(prefix),
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (extra) {
|
|
131
|
+
const [prefix, slot] = extra;
|
|
132
|
+
(params[slot] as Record<string, unknown>)[
|
|
133
|
+
key.slice(prefix.length)
|
|
134
|
+
] = value;
|
|
135
|
+
} else {
|
|
136
|
+
for (const [slot, allowed] of Object.entries(
|
|
137
|
+
config.allowExtra ?? {},
|
|
138
|
+
)) {
|
|
139
|
+
if (allowed) {
|
|
140
|
+
(params[slot as Slot] as Record<string, unknown>)[key] = value;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
stripEmptySlots(params);
|
|
151
|
+
|
|
152
|
+
return params;
|
|
153
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
interface SerializeOptions<T>
|
|
4
|
+
extends SerializePrimitiveOptions,
|
|
5
|
+
SerializerOptions<T> {}
|
|
6
|
+
|
|
7
|
+
interface SerializePrimitiveOptions {
|
|
8
|
+
allowReserved?: boolean;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SerializerOptions<T> {
|
|
13
|
+
/**
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
explode: boolean;
|
|
17
|
+
style: T;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
21
|
+
export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
|
22
|
+
type MatrixStyle = 'label' | 'matrix' | 'simple';
|
|
23
|
+
export type ObjectStyle = 'form' | 'deepObject';
|
|
24
|
+
type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
25
|
+
|
|
26
|
+
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const separatorArrayExplode = (style: ArraySeparatorStyle) => {
|
|
31
|
+
switch (style) {
|
|
32
|
+
case 'label':
|
|
33
|
+
return '.';
|
|
34
|
+
case 'matrix':
|
|
35
|
+
return ';';
|
|
36
|
+
case 'simple':
|
|
37
|
+
return ',';
|
|
38
|
+
default:
|
|
39
|
+
return '&';
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => {
|
|
44
|
+
switch (style) {
|
|
45
|
+
case 'form':
|
|
46
|
+
return ',';
|
|
47
|
+
case 'pipeDelimited':
|
|
48
|
+
return '|';
|
|
49
|
+
case 'spaceDelimited':
|
|
50
|
+
return '%20';
|
|
51
|
+
default:
|
|
52
|
+
return ',';
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const separatorObjectExplode = (style: ObjectSeparatorStyle) => {
|
|
57
|
+
switch (style) {
|
|
58
|
+
case 'label':
|
|
59
|
+
return '.';
|
|
60
|
+
case 'matrix':
|
|
61
|
+
return ';';
|
|
62
|
+
case 'simple':
|
|
63
|
+
return ',';
|
|
64
|
+
default:
|
|
65
|
+
return '&';
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const serializeArrayParam = ({
|
|
70
|
+
allowReserved,
|
|
71
|
+
explode,
|
|
72
|
+
name,
|
|
73
|
+
style,
|
|
74
|
+
value,
|
|
75
|
+
}: SerializeOptions<ArraySeparatorStyle> & {
|
|
76
|
+
value: unknown[];
|
|
77
|
+
}) => {
|
|
78
|
+
if (!explode) {
|
|
79
|
+
const joinedValues = (
|
|
80
|
+
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
|
|
81
|
+
).join(separatorArrayNoExplode(style));
|
|
82
|
+
switch (style) {
|
|
83
|
+
case 'label':
|
|
84
|
+
return `.${joinedValues}`;
|
|
85
|
+
case 'matrix':
|
|
86
|
+
return `;${name}=${joinedValues}`;
|
|
87
|
+
case 'simple':
|
|
88
|
+
return joinedValues;
|
|
89
|
+
default:
|
|
90
|
+
return `${name}=${joinedValues}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const separator = separatorArrayExplode(style);
|
|
95
|
+
const joinedValues = value
|
|
96
|
+
.map((v) => {
|
|
97
|
+
if (style === 'label' || style === 'simple') {
|
|
98
|
+
return allowReserved ? v : encodeURIComponent(v as string);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return serializePrimitiveParam({
|
|
102
|
+
allowReserved,
|
|
103
|
+
name,
|
|
104
|
+
value: v as string,
|
|
105
|
+
});
|
|
106
|
+
})
|
|
107
|
+
.join(separator);
|
|
108
|
+
return style === 'label' || style === 'matrix'
|
|
109
|
+
? separator + joinedValues
|
|
110
|
+
: joinedValues;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const serializePrimitiveParam = ({
|
|
114
|
+
allowReserved,
|
|
115
|
+
name,
|
|
116
|
+
value,
|
|
117
|
+
}: SerializePrimitiveParam) => {
|
|
118
|
+
if (value === undefined || value === null) {
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (typeof value === 'object') {
|
|
123
|
+
throw new Error(
|
|
124
|
+
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const serializeObjectParam = ({
|
|
132
|
+
allowReserved,
|
|
133
|
+
explode,
|
|
134
|
+
name,
|
|
135
|
+
style,
|
|
136
|
+
value,
|
|
137
|
+
valueOnly,
|
|
138
|
+
}: SerializeOptions<ObjectSeparatorStyle> & {
|
|
139
|
+
value: Record<string, unknown> | Date;
|
|
140
|
+
valueOnly?: boolean;
|
|
141
|
+
}) => {
|
|
142
|
+
if (value instanceof Date) {
|
|
143
|
+
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (style !== 'deepObject' && !explode) {
|
|
147
|
+
let values: string[] = [];
|
|
148
|
+
Object.entries(value).forEach(([key, v]) => {
|
|
149
|
+
values = [
|
|
150
|
+
...values,
|
|
151
|
+
key,
|
|
152
|
+
allowReserved ? (v as string) : encodeURIComponent(v as string),
|
|
153
|
+
];
|
|
154
|
+
});
|
|
155
|
+
const joinedValues = values.join(',');
|
|
156
|
+
switch (style) {
|
|
157
|
+
case 'form':
|
|
158
|
+
return `${name}=${joinedValues}`;
|
|
159
|
+
case 'label':
|
|
160
|
+
return `.${joinedValues}`;
|
|
161
|
+
case 'matrix':
|
|
162
|
+
return `;${name}=${joinedValues}`;
|
|
163
|
+
default:
|
|
164
|
+
return joinedValues;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const separator = separatorObjectExplode(style);
|
|
169
|
+
const joinedValues = Object.entries(value)
|
|
170
|
+
.map(([key, v]) =>
|
|
171
|
+
serializePrimitiveParam({
|
|
172
|
+
allowReserved,
|
|
173
|
+
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
|
174
|
+
value: v as string,
|
|
175
|
+
}),
|
|
176
|
+
)
|
|
177
|
+
.join(separator);
|
|
178
|
+
return style === 'label' || style === 'matrix'
|
|
179
|
+
? separator + joinedValues
|
|
180
|
+
: joinedValues;
|
|
181
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type { Auth, AuthToken } from './auth.gen';
|
|
4
|
+
import type {
|
|
5
|
+
BodySerializer,
|
|
6
|
+
QuerySerializer,
|
|
7
|
+
QuerySerializerOptions,
|
|
8
|
+
} from './bodySerializer.gen';
|
|
9
|
+
|
|
10
|
+
export interface Client<
|
|
11
|
+
RequestFn = never,
|
|
12
|
+
Config = unknown,
|
|
13
|
+
MethodFn = never,
|
|
14
|
+
BuildUrlFn = never,
|
|
15
|
+
> {
|
|
16
|
+
/**
|
|
17
|
+
* Returns the final request URL.
|
|
18
|
+
*/
|
|
19
|
+
buildUrl: BuildUrlFn;
|
|
20
|
+
connect: MethodFn;
|
|
21
|
+
delete: MethodFn;
|
|
22
|
+
get: MethodFn;
|
|
23
|
+
getConfig: () => Config;
|
|
24
|
+
head: MethodFn;
|
|
25
|
+
options: MethodFn;
|
|
26
|
+
patch: MethodFn;
|
|
27
|
+
post: MethodFn;
|
|
28
|
+
put: MethodFn;
|
|
29
|
+
request: RequestFn;
|
|
30
|
+
setConfig: (config: Config) => Config;
|
|
31
|
+
trace: MethodFn;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Config {
|
|
35
|
+
/**
|
|
36
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
37
|
+
* added to the request payload as defined by its `security` array.
|
|
38
|
+
*/
|
|
39
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
40
|
+
/**
|
|
41
|
+
* A function for serializing request body parameter. By default,
|
|
42
|
+
* {@link JSON.stringify()} will be used.
|
|
43
|
+
*/
|
|
44
|
+
bodySerializer?: BodySerializer | null;
|
|
45
|
+
/**
|
|
46
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
47
|
+
* `Headers` object with.
|
|
48
|
+
*
|
|
49
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
50
|
+
*/
|
|
51
|
+
headers?:
|
|
52
|
+
| RequestInit['headers']
|
|
53
|
+
| Record<
|
|
54
|
+
string,
|
|
55
|
+
| string
|
|
56
|
+
| number
|
|
57
|
+
| boolean
|
|
58
|
+
| (string | number | boolean)[]
|
|
59
|
+
| null
|
|
60
|
+
| undefined
|
|
61
|
+
| unknown
|
|
62
|
+
>;
|
|
63
|
+
/**
|
|
64
|
+
* The request method.
|
|
65
|
+
*
|
|
66
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
67
|
+
*/
|
|
68
|
+
method?:
|
|
69
|
+
| 'CONNECT'
|
|
70
|
+
| 'DELETE'
|
|
71
|
+
| 'GET'
|
|
72
|
+
| 'HEAD'
|
|
73
|
+
| 'OPTIONS'
|
|
74
|
+
| 'PATCH'
|
|
75
|
+
| 'POST'
|
|
76
|
+
| 'PUT'
|
|
77
|
+
| 'TRACE';
|
|
78
|
+
/**
|
|
79
|
+
* A function for serializing request query parameters. By default, arrays
|
|
80
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
81
|
+
* style, and reserved characters are percent-encoded.
|
|
82
|
+
*
|
|
83
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
84
|
+
* API function is used.
|
|
85
|
+
*
|
|
86
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
87
|
+
*/
|
|
88
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
89
|
+
/**
|
|
90
|
+
* A function validating request data. This is useful if you want to ensure
|
|
91
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
92
|
+
* the server.
|
|
93
|
+
*/
|
|
94
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
95
|
+
/**
|
|
96
|
+
* A function transforming response data before it's returned. This is useful
|
|
97
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
98
|
+
*/
|
|
99
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
100
|
+
/**
|
|
101
|
+
* A function validating response data. This is useful if you want to ensure
|
|
102
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
103
|
+
* the transformers and returned to the user.
|
|
104
|
+
*/
|
|
105
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
|
|
109
|
+
? true
|
|
110
|
+
: [T] extends [never | undefined]
|
|
111
|
+
? [undefined] extends [T]
|
|
112
|
+
? false
|
|
113
|
+
: true
|
|
114
|
+
: false;
|
|
115
|
+
|
|
116
|
+
export type OmitNever<T extends Record<string, unknown>> = {
|
|
117
|
+
[K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true
|
|
118
|
+
? never
|
|
119
|
+
: K]: T[K];
|
|
120
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
export type ProductCatalogItem = {
|
|
4
|
+
/**
|
|
5
|
+
* Unique identifier for the product
|
|
6
|
+
*/
|
|
7
|
+
productId: string;
|
|
8
|
+
/**
|
|
9
|
+
* Product name
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Product category
|
|
14
|
+
*/
|
|
15
|
+
category: string;
|
|
16
|
+
/**
|
|
17
|
+
* Product price in dollars
|
|
18
|
+
*/
|
|
19
|
+
price: number;
|
|
20
|
+
/**
|
|
21
|
+
* Array of tags associated with the product
|
|
22
|
+
*/
|
|
23
|
+
tags: Array<string>;
|
|
24
|
+
/**
|
|
25
|
+
* URL of the product image
|
|
26
|
+
*/
|
|
27
|
+
imageUrl: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type GetApiProductsData = {
|
|
31
|
+
body?: never;
|
|
32
|
+
path?: never;
|
|
33
|
+
query?: never;
|
|
34
|
+
url: '/api/products';
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type GetApiProductsResponses = {
|
|
38
|
+
/**
|
|
39
|
+
* List of all products
|
|
40
|
+
*/
|
|
41
|
+
200: Array<ProductCatalogItem>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type GetApiProductsResponse = GetApiProductsResponses[keyof GetApiProductsResponses];
|
|
45
|
+
|
|
46
|
+
export type GetApiProductsSearchData = {
|
|
47
|
+
body?: never;
|
|
48
|
+
path?: never;
|
|
49
|
+
query: {
|
|
50
|
+
/**
|
|
51
|
+
* Search query for product name or tags
|
|
52
|
+
*/
|
|
53
|
+
q: string;
|
|
54
|
+
};
|
|
55
|
+
url: '/api/products/search';
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type GetApiProductsSearchErrors = {
|
|
59
|
+
/**
|
|
60
|
+
* Query parameter is missing
|
|
61
|
+
*/
|
|
62
|
+
400: {
|
|
63
|
+
error?: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type GetApiProductsSearchError = GetApiProductsSearchErrors[keyof GetApiProductsSearchErrors];
|
|
68
|
+
|
|
69
|
+
export type GetApiProductsSearchResponses = {
|
|
70
|
+
/**
|
|
71
|
+
* List of matching products
|
|
72
|
+
*/
|
|
73
|
+
200: Array<ProductCatalogItem>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type GetApiProductsSearchResponse = GetApiProductsSearchResponses[keyof GetApiProductsSearchResponses];
|
|
77
|
+
|
|
78
|
+
export type GetApiProductsCategoryByCategoryData = {
|
|
79
|
+
body?: never;
|
|
80
|
+
path: {
|
|
81
|
+
/**
|
|
82
|
+
* Category name to filter by
|
|
83
|
+
*/
|
|
84
|
+
category: string;
|
|
85
|
+
};
|
|
86
|
+
query?: never;
|
|
87
|
+
url: '/api/products/category/{category}';
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type GetApiProductsCategoryByCategoryResponses = {
|
|
91
|
+
/**
|
|
92
|
+
* List of products in the category
|
|
93
|
+
*/
|
|
94
|
+
200: Array<ProductCatalogItem>;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type GetApiProductsCategoryByCategoryResponse = GetApiProductsCategoryByCategoryResponses[keyof GetApiProductsCategoryByCategoryResponses];
|
|
98
|
+
|
|
99
|
+
export type GetApiProductsByIdData = {
|
|
100
|
+
body?: never;
|
|
101
|
+
path: {
|
|
102
|
+
/**
|
|
103
|
+
* Product ID
|
|
104
|
+
*/
|
|
105
|
+
id: string;
|
|
106
|
+
};
|
|
107
|
+
query?: never;
|
|
108
|
+
url: '/api/products/{id}';
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type GetApiProductsByIdErrors = {
|
|
112
|
+
/**
|
|
113
|
+
* Product not found
|
|
114
|
+
*/
|
|
115
|
+
404: {
|
|
116
|
+
error?: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type GetApiProductsByIdError = GetApiProductsByIdErrors[keyof GetApiProductsByIdErrors];
|
|
121
|
+
|
|
122
|
+
export type GetApiProductsByIdResponses = {
|
|
123
|
+
/**
|
|
124
|
+
* Product details
|
|
125
|
+
*/
|
|
126
|
+
200: ProductCatalogItem;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type GetApiProductsByIdResponse = GetApiProductsByIdResponses[keyof GetApiProductsByIdResponses];
|
|
130
|
+
|
|
131
|
+
export type ClientOptions = {
|
|
132
|
+
baseUrl: 'http://localhost:3001' | (string & {});
|
|
133
|
+
};
|