create-auto-app 0.2.3 → 0.8.4
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/README.md +197 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/templates/.gitkeep +0 -0
- package/templates/shopping-app/.context/schema.json +389 -218
- package/templates/shopping-app/.context/server/.context/auto-ia-scheme.json +79 -0
- package/templates/shopping-app/.context/server/server/package.json +26 -0
- package/templates/shopping-app/.context/server/server/scripts/generate-schema.ts +34 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.specs.ts +46 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.ts +33 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/events.ts +10 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/handle.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.specs.ts +51 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/register.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.specs.ts +51 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/register.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.specs.ts +38 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.ts +33 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/events.ts +10 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/handle.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.specs.ts +101 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.ts +42 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/events.ts +9 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/handle.ts +52 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.specs.ts +101 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/events.ts +9 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/handle.ts +52 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.specs.ts +56 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/query.resolver.ts +56 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/state.ts +4 -0
- package/templates/shopping-app/.context/server/server/src/domain/shared/ReadModel.ts +26 -0
- package/templates/shopping-app/{server/src/domain/shared/index.d.ts → .context/server/server/src/domain/shared/index.ts} +0 -1
- package/templates/shopping-app/{server/src/domain/shared/reactorSpecification.js → .context/server/server/src/domain/shared/reactorSpecification.ts} +116 -22
- package/templates/shopping-app/.context/server/server/src/domain/shared/sendCommand.ts +21 -0
- package/templates/shopping-app/{server/src/domain/shared/types.d.ts → .context/server/server/src/domain/shared/types.ts} +17 -5
- package/templates/shopping-app/.context/server/server/src/server.ts +43 -0
- package/templates/shopping-app/{server/src/utils/index.d.ts → .context/server/server/src/utils/index.ts} +0 -1
- package/templates/shopping-app/{server/src/utils/loadProjections.js → .context/server/server/src/utils/loadProjections.ts} +11 -6
- package/templates/shopping-app/.context/server/server/src/utils/loadRegisterFiles.ts +41 -0
- package/templates/shopping-app/{server/src/utils/loadResolvers.js → .context/server/server/src/utils/loadResolvers.ts} +16 -7
- package/templates/shopping-app/.context/server/server/tsconfig.json +13 -0
- package/templates/shopping-app/.context/server/server/vitest.config.ts +7 -0
- package/templates/shopping-app/auto.config.ts +78 -45
- package/templates/shopping-app/client/package.json +4 -4
- package/templates/shopping-app/client/src/App.tsx +13 -13
- package/templates/shopping-app/client/src/components/molecules/QuantitySelector.tsx +4 -4
- package/templates/shopping-app/client/src/components/molecules/ShoppingCriteriaForm.tsx +4 -4
- package/templates/shopping-app/client/src/components/molecules/SuggestedItemCard.tsx +6 -6
- package/templates/shopping-app/client/src/components/organisms/AssistantChatInterface.tsx +3 -3
- package/templates/shopping-app/client/src/components/organisms/PageHeader.tsx +2 -3
- package/templates/shopping-app/client/src/components/organisms/SuggestedItemsList.tsx +3 -3
- package/templates/shopping-app/client/src/index.css +10 -14
- package/templates/shopping-app/client/src/pages/AssistantChatPage.tsx +4 -4
- package/templates/shopping-app/client/src/pages/SuggestedItemsPage.tsx +4 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +5 -6
- package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts +2 -2
- package/templates/shopping-app/example-integrations/cart/package.json +5 -6
- package/templates/shopping-app/example-integrations/cart-api/package.json +3 -3
- package/templates/shopping-app/example-integrations/product-catalogue/package.json +5 -5
- package/templates/shopping-app/example-integrations/product-catalogue/src/product-catalogue-integration.ts +3 -128
- package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +3 -3
- package/templates/shopping-app/flows/shopping-assistant.flow.ts +195 -196
- package/templates/shopping-app/package.json +16 -11
- package/templates/shopping-app/server/package.json +4 -4
- package/templates/shopping-app/server/src/integrations/ai-integration.ts +2 -2
- package/templates/shopping-app/tsconfig.json +2 -2
- package/templates/shopping-app/.env +0 -8
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-format.log +0 -12
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-lint.log +0 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts +0 -23
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js +0 -41
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js +0 -2
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/eslint +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/jiti +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/msw +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vite +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-format.log +0 -12
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-lint.log +0 -5
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts +0 -30
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js +0 -134
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js +0 -149
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts +0 -8
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js +0 -6
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts +0 -123
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts +0 -46
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js +0 -285
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts +0 -13
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js +0 -6
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts +0 -19
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js +0 -15
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts +0 -18
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js +0 -58
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js +0 -89
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js +0 -115
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts +0 -79
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts +0 -158
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts +0 -382
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js +0 -68
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/cart/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/index.js +0 -2
- package/templates/shopping-app/example-integrations/cart/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/eslint +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/jiti +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/msw +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-format.log +0 -10
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-lint.log +0 -4
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-type-check.log +0 -4
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts +0 -18
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js +0 -28
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts +0 -4
- package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/index.js +0 -49
- package/templates/shopping-app/example-integrations/cart-api/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts +0 -4
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js +0 -261
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/nodemon +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/swagger-jsdoc +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-cwd +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-esm +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-script +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-transpile-only +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-script +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsx +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-format.log +0 -12
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-lint.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js +0 -149
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts +0 -8
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js +0 -6
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts +0 -123
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts +0 -46
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js +0 -285
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts +0 -13
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js +0 -6
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts +0 -19
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js +0 -15
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts +0 -18
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js +0 -58
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js +0 -89
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js +0 -115
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts +0 -79
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts +0 -115
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts +0 -206
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js +0 -53
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js +0 -2
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts +0 -32
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js +0 -163
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/eslint +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/jiti +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/msw +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-format.log +0 -10
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-lint.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-test.log +0 -13
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts +0 -10
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js +0 -75
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js +0 -49
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js +0 -170
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/nodemon +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/swagger-jsdoc +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-cwd +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-esm +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-script +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-transpile-only +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-script +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsx +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/pnpm-workspace.yaml +0 -2
- package/templates/shopping-app/server/src/domain/shared/ReadModel.d.ts +0 -10
- package/templates/shopping-app/server/src/domain/shared/ReadModel.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/ReadModel.js +0 -19
- package/templates/shopping-app/server/src/domain/shared/ReadModel.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/index.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/index.js +0 -5
- package/templates/shopping-app/server/src/domain/shared/index.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.d.ts +0 -56
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/sendCommand.d.ts +0 -7
- package/templates/shopping-app/server/src/domain/shared/sendCommand.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/sendCommand.js +0 -16
- package/templates/shopping-app/server/src/domain/shared/sendCommand.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/types.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/types.js +0 -40
- package/templates/shopping-app/server/src/domain/shared/types.js.map +0 -1
- package/templates/shopping-app/server/src/utils/index.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/index.js +0 -4
- package/templates/shopping-app/server/src/utils/index.js.map +0 -1
- package/templates/shopping-app/server/src/utils/loadProjections.d.ts +0 -3
- package/templates/shopping-app/server/src/utils/loadProjections.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/loadProjections.js.map +0 -1
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.d.ts +0 -6
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.js +0 -26
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.js.map +0 -1
- package/templates/shopping-app/server/src/utils/loadResolvers.d.ts +0 -5
- package/templates/shopping-app/server/src/utils/loadResolvers.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/loadResolvers.js.map +0 -1
|
@@ -5,20 +5,19 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@auto-engineer/flow": "
|
|
9
|
-
"@auto-engineer/ai-gateway": "
|
|
8
|
+
"@auto-engineer/flow": "workspace:*",
|
|
9
|
+
"@auto-engineer/ai-gateway": "workspace:*",
|
|
10
10
|
"axios": "^1.6.0",
|
|
11
11
|
"zod": "^3.22.4"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc",
|
|
15
|
-
"
|
|
16
|
-
"test": "vitest run",
|
|
15
|
+
"test": "vitest run --reporter=dot",
|
|
17
16
|
"lint": "eslint 'src/**/*.ts' --ignore-pattern 'src/generated/**/*' --max-warnings 0 --config ./eslint.config.ts",
|
|
18
17
|
"type-check": "tsc --noEmit",
|
|
19
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
18
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
20
19
|
"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"
|
|
20
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
|
|
22
21
|
},
|
|
23
22
|
"publishConfig": {
|
|
24
23
|
"access": "public"
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"clean": "rm -rf dist",
|
|
11
11
|
"dev": "tsx watch src/index.ts",
|
|
12
12
|
"start": "tsx src/index.ts",
|
|
13
|
-
"test": "vitest run",
|
|
13
|
+
"test": "vitest run --reporter=dot",
|
|
14
14
|
"test:watch": "vitest",
|
|
15
15
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts",
|
|
16
16
|
"type-check": "tsc --noEmit",
|
|
17
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
17
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
18
18
|
"lint:fix": "eslint 'src/**/*.ts' --fix --config ../../eslint.config.ts",
|
|
19
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore"
|
|
19
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"cors": "^2.8.5",
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@auto-engineer/flow": "
|
|
9
|
-
"@auto-engineer/ai-gateway": "
|
|
8
|
+
"@auto-engineer/flow": "workspace:*",
|
|
9
|
+
"@auto-engineer/ai-gateway": "workspace:*",
|
|
10
10
|
"axios": "^1.6.0",
|
|
11
11
|
"zod": "^3.22.4"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc",
|
|
15
15
|
"dev": "tsc --watch",
|
|
16
|
-
"test": "vitest run",
|
|
16
|
+
"test": "vitest run --reporter=dot",
|
|
17
17
|
"lint": "eslint 'src/**/*.ts' --ignore-pattern 'src/generated/**/*' --max-warnings 0 --config ./eslint.config.ts",
|
|
18
18
|
"type-check": "tsc --noEmit",
|
|
19
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
19
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
20
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"
|
|
21
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { State, Integration } from '@auto-engineer/flow';
|
|
2
|
-
import { registerTool, z } from '@auto-engineer/ai-gateway';
|
|
3
2
|
|
|
4
3
|
import { createClient } from './generated/product-catalog/client';
|
|
5
4
|
import type {
|
|
@@ -11,12 +10,6 @@ import type {
|
|
|
11
10
|
GetApiProductsByIdResponses,
|
|
12
11
|
GetApiProductsByIdErrors,
|
|
13
12
|
} from './generated/product-catalog';
|
|
14
|
-
import {
|
|
15
|
-
zGetApiProductsResponse,
|
|
16
|
-
zGetApiProductsSearchResponse,
|
|
17
|
-
zGetApiProductsCategoryByCategoryResponse,
|
|
18
|
-
zGetApiProductsByIdResponse,
|
|
19
|
-
} from './generated/product-catalog/zod.gen';
|
|
20
13
|
|
|
21
14
|
export type Product = ProductCatalogItem;
|
|
22
15
|
|
|
@@ -38,7 +31,7 @@ type ProductCatalogQueries = {
|
|
|
38
31
|
ProductDetails: (params: { id: string }) => Promise<ProductDetails>;
|
|
39
32
|
};
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
const _ProductCatalog: Integration<'product-catalog', ProductCatalogQueries> = {
|
|
42
35
|
__brand: 'Integration' as const,
|
|
43
36
|
type: 'product-catalog' as const,
|
|
44
37
|
name: 'product-catalog',
|
|
@@ -47,9 +40,7 @@ export const ProductCatalog: Integration<'product-catalog', ProductCatalogQuerie
|
|
|
47
40
|
// GET /api/products
|
|
48
41
|
Products: async (): Promise<Products> => {
|
|
49
42
|
try {
|
|
50
|
-
const res = await productClient.get<GetApiProductsResponses, unknown, false>({
|
|
51
|
-
url: '/api/products',
|
|
52
|
-
});
|
|
43
|
+
const res = await productClient.get<GetApiProductsResponses, unknown, false>({ url: '/api/products' });
|
|
53
44
|
if (res.error !== undefined) console.error('Failed to fetch products:', res.error);
|
|
54
45
|
return { type: 'Products', data: { products: (res.data as Product[]) ?? [] } };
|
|
55
46
|
} catch (err) {
|
|
@@ -96,9 +87,7 @@ export const ProductCatalog: Integration<'product-catalog', ProductCatalogQuerie
|
|
|
96
87
|
path: { id },
|
|
97
88
|
});
|
|
98
89
|
if (res.response.status === 404 || res.error !== undefined) {
|
|
99
|
-
if (res.response.status !== 404) {
|
|
100
|
-
console.error(`Error fetching product "${id}":`, res.error);
|
|
101
|
-
}
|
|
90
|
+
if (res.response.status !== 404) console.error(`Error fetching product "${id}":`, res.error);
|
|
102
91
|
return { type: 'ProductDetails', data: { product: null } };
|
|
103
92
|
}
|
|
104
93
|
return { type: 'ProductDetails', data: { product: res.data ?? null } };
|
|
@@ -109,117 +98,3 @@ export const ProductCatalog: Integration<'product-catalog', ProductCatalogQuerie
|
|
|
109
98
|
},
|
|
110
99
|
},
|
|
111
100
|
};
|
|
112
|
-
|
|
113
|
-
// ---------- MCP tools ----------
|
|
114
|
-
|
|
115
|
-
// All products
|
|
116
|
-
registerTool<Record<string, unknown>>(
|
|
117
|
-
'PRODUCT_CATALOGUE_PRODUCTS',
|
|
118
|
-
{
|
|
119
|
-
title: 'Get All Products',
|
|
120
|
-
description: 'Fetches all products from the product catalog',
|
|
121
|
-
inputSchema: {},
|
|
122
|
-
schema: zGetApiProductsResponse,
|
|
123
|
-
schemaName: 'GetApiProductsResponse',
|
|
124
|
-
schemaDescription: 'Array of ProductCatalogItem',
|
|
125
|
-
},
|
|
126
|
-
async () => {
|
|
127
|
-
const queries = ProductCatalog.Queries as ProductCatalogQueries;
|
|
128
|
-
if (queries?.Products == null) {
|
|
129
|
-
return {
|
|
130
|
-
content: [{ type: 'text' as const, text: 'ProductCatalog.Queries.Products is not available' }],
|
|
131
|
-
isError: true,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
const productsQuery = queries.Products;
|
|
135
|
-
const result = await productsQuery();
|
|
136
|
-
return { content: [{ type: 'text' as const, text: JSON.stringify(result.data.products, null, 2) }] };
|
|
137
|
-
},
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
// By category
|
|
141
|
-
interface ProductsByCategoryParams extends Record<string, unknown> {
|
|
142
|
-
category: string;
|
|
143
|
-
}
|
|
144
|
-
registerTool<ProductsByCategoryParams>(
|
|
145
|
-
'PRODUCT_CATALOGUE_PRODUCTS_BY_CATEGORY',
|
|
146
|
-
{
|
|
147
|
-
title: 'Get Products by Category',
|
|
148
|
-
description: 'Fetches products from a specific category',
|
|
149
|
-
inputSchema: { category: z.string().min(1, 'Category is required') },
|
|
150
|
-
schema: zGetApiProductsCategoryByCategoryResponse,
|
|
151
|
-
schemaName: 'GetApiProductsCategoryByCategoryResponse',
|
|
152
|
-
schemaDescription: 'Array of ProductCatalogItem',
|
|
153
|
-
},
|
|
154
|
-
async ({ category }) => {
|
|
155
|
-
const queries = ProductCatalog.Queries as ProductCatalogQueries;
|
|
156
|
-
if (queries?.ProductsByCategory == null) {
|
|
157
|
-
return {
|
|
158
|
-
content: [{ type: 'text' as const, text: 'ProductCatalog.Queries.ProductsByCategory is not available' }],
|
|
159
|
-
isError: true,
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
const categoryQuery = queries.ProductsByCategory;
|
|
163
|
-
const result = await categoryQuery({ category });
|
|
164
|
-
return { content: [{ type: 'text' as const, text: JSON.stringify(result.data.products, null, 2) }] };
|
|
165
|
-
},
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
// Search
|
|
169
|
-
interface ProductSearchParams extends Record<string, unknown> {
|
|
170
|
-
query: string;
|
|
171
|
-
}
|
|
172
|
-
registerTool<ProductSearchParams>(
|
|
173
|
-
'PRODUCT_CATALOGUE_SEARCH',
|
|
174
|
-
{
|
|
175
|
-
title: 'Search Products',
|
|
176
|
-
description: 'Search for products using a query string',
|
|
177
|
-
inputSchema: { query: z.string().min(1, 'Search query is required') },
|
|
178
|
-
schema: zGetApiProductsSearchResponse,
|
|
179
|
-
schemaName: 'GetApiProductsSearchResponse',
|
|
180
|
-
schemaDescription: 'Array of ProductCatalogItem',
|
|
181
|
-
},
|
|
182
|
-
async ({ query }) => {
|
|
183
|
-
const queries = ProductCatalog.Queries as ProductCatalogQueries;
|
|
184
|
-
if (queries?.ProductSearchResults == null) {
|
|
185
|
-
return {
|
|
186
|
-
content: [{ type: 'text' as const, text: 'ProductCatalog.Queries.ProductSearchResults is not available' }],
|
|
187
|
-
isError: true,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
const searchQuery = queries.ProductSearchResults;
|
|
191
|
-
const result = await searchQuery({ query });
|
|
192
|
-
return { content: [{ type: 'text' as const, text: JSON.stringify(result.data.products, null, 2) }] };
|
|
193
|
-
},
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
// Details
|
|
197
|
-
interface ProductDetailsParams extends Record<string, unknown> {
|
|
198
|
-
id: string;
|
|
199
|
-
}
|
|
200
|
-
registerTool<ProductDetailsParams>(
|
|
201
|
-
'PRODUCT_CATALOGUE_PRODUCT_DETAILS',
|
|
202
|
-
{
|
|
203
|
-
title: 'Get Product Details',
|
|
204
|
-
description: 'Fetches detailed information about a specific product',
|
|
205
|
-
inputSchema: { id: z.string().min(1, 'Product ID is required') },
|
|
206
|
-
schema: zGetApiProductsByIdResponse,
|
|
207
|
-
schemaName: 'GetApiProductsByIdResponse',
|
|
208
|
-
schemaDescription: 'Single ProductCatalogItem',
|
|
209
|
-
},
|
|
210
|
-
async ({ id }) => {
|
|
211
|
-
const queries = ProductCatalog.Queries as ProductCatalogQueries;
|
|
212
|
-
if (queries?.ProductDetails == null) {
|
|
213
|
-
return {
|
|
214
|
-
content: [{ type: 'text' as const, text: 'ProductCatalog.Queries.ProductDetails is not available' }],
|
|
215
|
-
isError: true,
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
const detailsQuery = queries.ProductDetails;
|
|
219
|
-
const result = await detailsQuery({ id });
|
|
220
|
-
if (result.data.product === null) {
|
|
221
|
-
return { content: [{ type: 'text' as const, text: `Product with ID "${id}" not found` }], isError: true };
|
|
222
|
-
}
|
|
223
|
-
return { content: [{ type: 'text' as const, text: JSON.stringify(result.data.product, null, 2) }] };
|
|
224
|
-
},
|
|
225
|
-
);
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"clean": "rm -rf dist",
|
|
11
11
|
"dev": "tsx watch src/index.ts",
|
|
12
12
|
"start": "tsx src/index.ts",
|
|
13
|
-
"test": "vitest run",
|
|
13
|
+
"test": "vitest run --reporter=dot",
|
|
14
14
|
"test:watch": "vitest",
|
|
15
15
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts",
|
|
16
16
|
"type-check": "tsc --noEmit",
|
|
17
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
17
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
18
18
|
"lint:fix": "eslint 'src/**/*.ts' --fix --config ../../eslint.config.ts",
|
|
19
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore"
|
|
19
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"cors": "^2.8.5",
|