@vendure/mcp-plugin 3.8.0-minor-bootstrap.0
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/lib/api/api-extensions.d.ts +2 -0
- package/lib/api/api-extensions.js +239 -0
- package/lib/api/api-extensions.js.map +1 -0
- package/lib/api/mcp-actor.service.d.ts +19 -0
- package/lib/api/mcp-actor.service.js +52 -0
- package/lib/api/mcp-actor.service.js.map +1 -0
- package/lib/api/mcp-admin.resolver.d.ts +105 -0
- package/lib/api/mcp-admin.resolver.js +463 -0
- package/lib/api/mcp-admin.resolver.js.map +1 -0
- package/lib/api/mcp-shop.resolver.d.ts +25 -0
- package/lib/api/mcp-shop.resolver.js +74 -0
- package/lib/api/mcp-shop.resolver.js.map +1 -0
- package/lib/check-options.d.ts +7 -0
- package/lib/check-options.js +130 -0
- package/lib/check-options.js.map +1 -0
- package/lib/constants.d.ts +48 -0
- package/lib/constants.js +72 -0
- package/lib/constants.js.map +1 -0
- package/lib/delete-in-batches.d.ts +5 -0
- package/lib/delete-in-batches.js +28 -0
- package/lib/delete-in-batches.js.map +1 -0
- package/lib/entities/index.d.ts +5 -0
- package/lib/entities/index.js +22 -0
- package/lib/entities/index.js.map +1 -0
- package/lib/entities/mcp-authorization-code.entity.d.ts +33 -0
- package/lib/entities/mcp-authorization-code.entity.js +77 -0
- package/lib/entities/mcp-authorization-code.entity.js.map +1 -0
- package/lib/entities/mcp-authorization-request.entity.d.ts +31 -0
- package/lib/entities/mcp-authorization-request.entity.js +73 -0
- package/lib/entities/mcp-authorization-request.entity.js.map +1 -0
- package/lib/entities/mcp-oauth-client.entity.d.ts +56 -0
- package/lib/entities/mcp-oauth-client.entity.js +70 -0
- package/lib/entities/mcp-oauth-client.entity.js.map +1 -0
- package/lib/entities/mcp-oauth-grant.entity.d.ts +77 -0
- package/lib/entities/mcp-oauth-grant.entity.js +121 -0
- package/lib/entities/mcp-oauth-grant.entity.js.map +1 -0
- package/lib/entities/mcp-tool-call-log.entity.d.ts +50 -0
- package/lib/entities/mcp-tool-call-log.entity.js +101 -0
- package/lib/entities/mcp-tool-call-log.entity.js.map +1 -0
- package/lib/events/mcp-tool-call.event.d.ts +17 -0
- package/lib/events/mcp-tool-call.event.js +23 -0
- package/lib/events/mcp-tool-call.event.js.map +1 -0
- package/lib/get-client-ip.d.ts +2 -0
- package/lib/get-client-ip.js +10 -0
- package/lib/get-client-ip.js.map +1 -0
- package/lib/get-language-code.d.ts +3 -0
- package/lib/get-language-code.js +12 -0
- package/lib/get-language-code.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +26 -0
- package/lib/index.js.map +1 -0
- package/lib/internal-types.d.ts +27 -0
- package/lib/internal-types.js +3 -0
- package/lib/internal-types.js.map +1 -0
- package/lib/logging/mcp-tool-call-log-retention.service.d.ts +8 -0
- package/lib/logging/mcp-tool-call-log-retention.service.js +54 -0
- package/lib/logging/mcp-tool-call-log-retention.service.js.map +1 -0
- package/lib/logging/mcp-tool-call-log.service.d.ts +24 -0
- package/lib/logging/mcp-tool-call-log.service.js +128 -0
- package/lib/logging/mcp-tool-call-log.service.js.map +1 -0
- package/lib/oauth/cimd/cimd-client-resolver.service.d.ts +18 -0
- package/lib/oauth/cimd/cimd-client-resolver.service.js +109 -0
- package/lib/oauth/cimd/cimd-client-resolver.service.js.map +1 -0
- package/lib/oauth/cimd/cimd-document.d.ts +11 -0
- package/lib/oauth/cimd/cimd-document.js +66 -0
- package/lib/oauth/cimd/cimd-document.js.map +1 -0
- package/lib/oauth/cimd/cimd-fetch.d.ts +14 -0
- package/lib/oauth/cimd/cimd-fetch.js +192 -0
- package/lib/oauth/cimd/cimd-fetch.js.map +1 -0
- package/lib/oauth/cimd/cimd-url.d.ts +5 -0
- package/lib/oauth/cimd/cimd-url.js +94 -0
- package/lib/oauth/cimd/cimd-url.js.map +1 -0
- package/lib/oauth/grant-session.service.d.ts +19 -0
- package/lib/oauth/grant-session.service.js +141 -0
- package/lib/oauth/grant-session.service.js.map +1 -0
- package/lib/oauth/oauth-error.d.ts +18 -0
- package/lib/oauth/oauth-error.js +60 -0
- package/lib/oauth/oauth-error.js.map +1 -0
- package/lib/oauth/oauth-metadata.service.d.ts +34 -0
- package/lib/oauth/oauth-metadata.service.js +107 -0
- package/lib/oauth/oauth-metadata.service.js.map +1 -0
- package/lib/oauth/oauth-retention.service.d.ts +23 -0
- package/lib/oauth/oauth-retention.service.js +103 -0
- package/lib/oauth/oauth-retention.service.js.map +1 -0
- package/lib/oauth/oauth-types.d.ts +61 -0
- package/lib/oauth/oauth-types.js +32 -0
- package/lib/oauth/oauth-types.js.map +1 -0
- package/lib/oauth/oauth-utils.d.ts +20 -0
- package/lib/oauth/oauth-utils.js +111 -0
- package/lib/oauth/oauth-utils.js.map +1 -0
- package/lib/oauth/oauth.controller.d.ts +31 -0
- package/lib/oauth/oauth.controller.js +132 -0
- package/lib/oauth/oauth.controller.js.map +1 -0
- package/lib/oauth/oauth.service.d.ts +69 -0
- package/lib/oauth/oauth.service.js +650 -0
- package/lib/oauth/oauth.service.js.map +1 -0
- package/lib/oauth/token-hash.d.ts +6 -0
- package/lib/oauth/token-hash.js +21 -0
- package/lib/oauth/token-hash.js.map +1 -0
- package/lib/plugin.d.ts +54 -0
- package/lib/plugin.js +171 -0
- package/lib/plugin.js.map +1 -0
- package/lib/rate-limit/ip-bucket-key.d.ts +1 -0
- package/lib/rate-limit/ip-bucket-key.js +35 -0
- package/lib/rate-limit/ip-bucket-key.js.map +1 -0
- package/lib/rate-limit/mcp-oauth-rate-limit.guard.d.ts +20 -0
- package/lib/rate-limit/mcp-oauth-rate-limit.guard.js +63 -0
- package/lib/rate-limit/mcp-oauth-rate-limit.guard.js.map +1 -0
- package/lib/rate-limit/mcp-rate-limiter.service.d.ts +47 -0
- package/lib/rate-limit/mcp-rate-limiter.service.js +248 -0
- package/lib/rate-limit/mcp-rate-limiter.service.js.map +1 -0
- package/lib/registry/bm25.d.ts +12 -0
- package/lib/registry/bm25.js +60 -0
- package/lib/registry/bm25.js.map +1 -0
- package/lib/registry/mcp-tool-execution.service.d.ts +45 -0
- package/lib/registry/mcp-tool-execution.service.js +72 -0
- package/lib/registry/mcp-tool-execution.service.js.map +1 -0
- package/lib/registry/mcp-tool-registry.service.d.ts +89 -0
- package/lib/registry/mcp-tool-registry.service.js +668 -0
- package/lib/registry/mcp-tool-registry.service.js.map +1 -0
- package/lib/registry/mcp-tool-schema.service.d.ts +42 -0
- package/lib/registry/mcp-tool-schema.service.js +229 -0
- package/lib/registry/mcp-tool-schema.service.js.map +1 -0
- package/lib/registry/registry-types.d.ts +32 -0
- package/lib/registry/registry-types.js +3 -0
- package/lib/registry/registry-types.js.map +1 -0
- package/lib/resolve-options.d.ts +7 -0
- package/lib/resolve-options.js +85 -0
- package/lib/resolve-options.js.map +1 -0
- package/lib/shared/endpoint-paths.d.ts +8 -0
- package/lib/shared/endpoint-paths.js +12 -0
- package/lib/shared/endpoint-paths.js.map +1 -0
- package/lib/shared/loopback.d.ts +2 -0
- package/lib/shared/loopback.js +9 -0
- package/lib/shared/loopback.js.map +1 -0
- package/lib/shop-session/mcp-shop-session.service.d.ts +47 -0
- package/lib/shop-session/mcp-shop-session.service.js +132 -0
- package/lib/shop-session/mcp-shop-session.service.js.map +1 -0
- package/lib/tasks/mcp-oauth-retention.task.d.ts +9 -0
- package/lib/tasks/mcp-oauth-retention.task.js +21 -0
- package/lib/tasks/mcp-oauth-retention.task.js.map +1 -0
- package/lib/tasks/mcp-tool-call-log-retention.task.d.ts +7 -0
- package/lib/tasks/mcp-tool-call-log-retention.task.js +22 -0
- package/lib/tasks/mcp-tool-call-log-retention.task.js.map +1 -0
- package/lib/tools/built-in/active-order.service.d.ts +26 -0
- package/lib/tools/built-in/active-order.service.js +125 -0
- package/lib/tools/built-in/active-order.service.js.map +1 -0
- package/lib/tools/built-in/admin/add-customer-to-group.tool.d.ts +23 -0
- package/lib/tools/built-in/admin/add-customer-to-group.tool.js +68 -0
- package/lib/tools/built-in/admin/add-customer-to-group.tool.js.map +1 -0
- package/lib/tools/built-in/admin/add-note-to-order.tool.d.ts +104 -0
- package/lib/tools/built-in/admin/add-note-to-order.tool.js +66 -0
- package/lib/tools/built-in/admin/add-note-to-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/adjust-stock.tool.d.ts +26 -0
- package/lib/tools/built-in/admin/adjust-stock.tool.js +88 -0
- package/lib/tools/built-in/admin/adjust-stock.tool.js.map +1 -0
- package/lib/tools/built-in/admin/cancel-order.tool.d.ts +17 -0
- package/lib/tools/built-in/admin/cancel-order.tool.js +60 -0
- package/lib/tools/built-in/admin/cancel-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/channel-access.d.ts +2 -0
- package/lib/tools/built-in/admin/channel-access.js +9 -0
- package/lib/tools/built-in/admin/channel-access.js.map +1 -0
- package/lib/tools/built-in/admin/create-customer.tool.d.ts +41 -0
- package/lib/tools/built-in/admin/create-customer.tool.js +57 -0
- package/lib/tools/built-in/admin/create-customer.tool.js.map +1 -0
- package/lib/tools/built-in/admin/create-fulfillment.tool.d.ts +118 -0
- package/lib/tools/built-in/admin/create-fulfillment.tool.js +156 -0
- package/lib/tools/built-in/admin/create-fulfillment.tool.js.map +1 -0
- package/lib/tools/built-in/admin/create-product.tool.d.ts +52 -0
- package/lib/tools/built-in/admin/create-product.tool.js +61 -0
- package/lib/tools/built-in/admin/create-product.tool.js.map +1 -0
- package/lib/tools/built-in/admin/create-variant.tool.d.ts +48 -0
- package/lib/tools/built-in/admin/create-variant.tool.js +79 -0
- package/lib/tools/built-in/admin/create-variant.tool.js.map +1 -0
- package/lib/tools/built-in/admin/entity-field-schemas.d.ts +36 -0
- package/lib/tools/built-in/admin/entity-field-schemas.js +63 -0
- package/lib/tools/built-in/admin/entity-field-schemas.js.map +1 -0
- package/lib/tools/built-in/admin/get-customer.tool.d.ts +28 -0
- package/lib/tools/built-in/admin/get-customer.tool.js +55 -0
- package/lib/tools/built-in/admin/get-customer.tool.js.map +1 -0
- package/lib/tools/built-in/admin/get-order.tool.d.ts +100 -0
- package/lib/tools/built-in/admin/get-order.tool.js +68 -0
- package/lib/tools/built-in/admin/get-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/get-product.tool.d.ts +69 -0
- package/lib/tools/built-in/admin/get-product.tool.js +77 -0
- package/lib/tools/built-in/admin/get-product.tool.js.map +1 -0
- package/lib/tools/built-in/admin/get-stock-levels.tool.d.ts +23 -0
- package/lib/tools/built-in/admin/get-stock-levels.tool.js +61 -0
- package/lib/tools/built-in/admin/get-stock-levels.tool.js.map +1 -0
- package/lib/tools/built-in/admin/index.d.ts +25 -0
- package/lib/tools/built-in/admin/index.js +54 -0
- package/lib/tools/built-in/admin/index.js.map +1 -0
- package/lib/tools/built-in/admin/list-channels.tool.d.ts +24 -0
- package/lib/tools/built-in/admin/list-channels.tool.js +56 -0
- package/lib/tools/built-in/admin/list-channels.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-customer-groups.tool.d.ts +23 -0
- package/lib/tools/built-in/admin/list-customer-groups.tool.js +52 -0
- package/lib/tools/built-in/admin/list-customer-groups.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-customers.tool.d.ts +62 -0
- package/lib/tools/built-in/admin/list-customers.tool.js +66 -0
- package/lib/tools/built-in/admin/list-customers.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-orders.tool.d.ts +142 -0
- package/lib/tools/built-in/admin/list-orders.tool.js +87 -0
- package/lib/tools/built-in/admin/list-orders.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-products.tool.d.ts +63 -0
- package/lib/tools/built-in/admin/list-products.tool.js +71 -0
- package/lib/tools/built-in/admin/list-products.tool.js.map +1 -0
- package/lib/tools/built-in/admin/refund-order.tool.d.ts +38 -0
- package/lib/tools/built-in/admin/refund-order.tool.js +115 -0
- package/lib/tools/built-in/admin/refund-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/set-active-channel.tool.d.ts +22 -0
- package/lib/tools/built-in/admin/set-active-channel.tool.js +84 -0
- package/lib/tools/built-in/admin/set-active-channel.tool.js.map +1 -0
- package/lib/tools/built-in/admin/translation-schemas.d.ts +12 -0
- package/lib/tools/built-in/admin/translation-schemas.js +17 -0
- package/lib/tools/built-in/admin/translation-schemas.js.map +1 -0
- package/lib/tools/built-in/admin/update-customer.tool.d.ts +42 -0
- package/lib/tools/built-in/admin/update-customer.tool.js +59 -0
- package/lib/tools/built-in/admin/update-customer.tool.js.map +1 -0
- package/lib/tools/built-in/admin/update-order-state.tool.d.ts +16 -0
- package/lib/tools/built-in/admin/update-order-state.tool.js +58 -0
- package/lib/tools/built-in/admin/update-order-state.tool.js.map +1 -0
- package/lib/tools/built-in/admin/update-product.tool.d.ts +53 -0
- package/lib/tools/built-in/admin/update-product.tool.js +68 -0
- package/lib/tools/built-in/admin/update-product.tool.js.map +1 -0
- package/lib/tools/built-in/admin/update-variant.tool.d.ts +46 -0
- package/lib/tools/built-in/admin/update-variant.tool.js +77 -0
- package/lib/tools/built-in/admin/update-variant.tool.js.map +1 -0
- package/lib/tools/built-in/admin/upload-asset.tool.d.ts +32 -0
- package/lib/tools/built-in/admin/upload-asset.tool.js +56 -0
- package/lib/tools/built-in/admin/upload-asset.tool.js.map +1 -0
- package/lib/tools/built-in/catalog-query.service.d.ts +21 -0
- package/lib/tools/built-in/catalog-query.service.js +128 -0
- package/lib/tools/built-in/catalog-query.service.js.map +1 -0
- package/lib/tools/built-in/custom-field-input.service.d.ts +10 -0
- package/lib/tools/built-in/custom-field-input.service.js +64 -0
- package/lib/tools/built-in/custom-field-input.service.js.map +1 -0
- package/lib/tools/built-in/email-schema.d.ts +2 -0
- package/lib/tools/built-in/email-schema.js +12 -0
- package/lib/tools/built-in/email-schema.js.map +1 -0
- package/lib/tools/built-in/id-schema.d.ts +3 -0
- package/lib/tools/built-in/id-schema.js +11 -0
- package/lib/tools/built-in/id-schema.js.map +1 -0
- package/lib/tools/built-in/int32-schema.d.ts +4 -0
- package/lib/tools/built-in/int32-schema.js +8 -0
- package/lib/tools/built-in/int32-schema.js.map +1 -0
- package/lib/tools/built-in/list-helpers.d.ts +48 -0
- package/lib/tools/built-in/list-helpers.js +76 -0
- package/lib/tools/built-in/list-helpers.js.map +1 -0
- package/lib/tools/built-in/order-list-helpers.d.ts +20 -0
- package/lib/tools/built-in/order-list-helpers.js +48 -0
- package/lib/tools/built-in/order-list-helpers.js.map +1 -0
- package/lib/tools/built-in/providers.d.ts +2 -0
- package/lib/tools/built-in/providers.js +7 -0
- package/lib/tools/built-in/providers.js.map +1 -0
- package/lib/tools/built-in/remote-asset.d.ts +4 -0
- package/lib/tools/built-in/remote-asset.js +54 -0
- package/lib/tools/built-in/remote-asset.js.map +1 -0
- package/lib/tools/built-in/serializer.service.d.ts +327 -0
- package/lib/tools/built-in/serializer.service.js +413 -0
- package/lib/tools/built-in/serializer.service.js.map +1 -0
- package/lib/tools/built-in/shop/add-to-cart.tool.d.ts +21 -0
- package/lib/tools/built-in/shop/add-to-cart.tool.js +100 -0
- package/lib/tools/built-in/shop/add-to-cart.tool.js.map +1 -0
- package/lib/tools/built-in/shop/address-schema.d.ts +15 -0
- package/lib/tools/built-in/shop/address-schema.js +20 -0
- package/lib/tools/built-in/shop/address-schema.js.map +1 -0
- package/lib/tools/built-in/shop/apply-coupon-code.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/apply-coupon-code.tool.js +62 -0
- package/lib/tools/built-in/shop/apply-coupon-code.tool.js.map +1 -0
- package/lib/tools/built-in/shop/collection-lookup.d.ts +15 -0
- package/lib/tools/built-in/shop/collection-lookup.js +35 -0
- package/lib/tools/built-in/shop/collection-lookup.js.map +1 -0
- package/lib/tools/built-in/shop/get-cart.tool.d.ts +94 -0
- package/lib/tools/built-in/shop/get-cart.tool.js +55 -0
- package/lib/tools/built-in/shop/get-cart.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-collection.tool.d.ts +42 -0
- package/lib/tools/built-in/shop/get-collection.tool.js +64 -0
- package/lib/tools/built-in/shop/get-collection.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.d.ts +26 -0
- package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js +58 -0
- package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.d.ts +30 -0
- package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js +59 -0
- package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-my-account.tool.d.ts +22 -0
- package/lib/tools/built-in/shop/get-my-account.tool.js +57 -0
- package/lib/tools/built-in/shop/get-my-account.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-order.tool.d.ts +100 -0
- package/lib/tools/built-in/shop/get-order.tool.js +67 -0
- package/lib/tools/built-in/shop/get-order.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-product.tool.d.ts +57 -0
- package/lib/tools/built-in/shop/get-product.tool.js +81 -0
- package/lib/tools/built-in/shop/get-product.tool.js.map +1 -0
- package/lib/tools/built-in/shop/index.d.ts +19 -0
- package/lib/tools/built-in/shop/index.js +42 -0
- package/lib/tools/built-in/shop/index.js.map +1 -0
- package/lib/tools/built-in/shop/list-collections.tool.d.ts +42 -0
- package/lib/tools/built-in/shop/list-collections.tool.js +75 -0
- package/lib/tools/built-in/shop/list-collections.tool.js.map +1 -0
- package/lib/tools/built-in/shop/list-my-orders.tool.d.ts +100 -0
- package/lib/tools/built-in/shop/list-my-orders.tool.js +63 -0
- package/lib/tools/built-in/shop/list-my-orders.tool.js.map +1 -0
- package/lib/tools/built-in/shop/place-order.tool.d.ts +188 -0
- package/lib/tools/built-in/shop/place-order.tool.js +152 -0
- package/lib/tools/built-in/shop/place-order.tool.js.map +1 -0
- package/lib/tools/built-in/shop/product-search-query.d.ts +4 -0
- package/lib/tools/built-in/shop/product-search-query.js +34 -0
- package/lib/tools/built-in/shop/product-search-query.js.map +1 -0
- package/lib/tools/built-in/shop/remove-coupon-code.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/remove-coupon-code.tool.js +63 -0
- package/lib/tools/built-in/shop/remove-coupon-code.tool.js.map +1 -0
- package/lib/tools/built-in/shop/remove-from-cart.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/remove-from-cart.tool.js +58 -0
- package/lib/tools/built-in/shop/remove-from-cart.tool.js.map +1 -0
- package/lib/tools/built-in/shop/search-products.tool.d.ts +48 -0
- package/lib/tools/built-in/shop/search-products.tool.js +95 -0
- package/lib/tools/built-in/shop/search-products.tool.js.map +1 -0
- package/lib/tools/built-in/shop/set-checkout-details.tool.d.ts +56 -0
- package/lib/tools/built-in/shop/set-checkout-details.tool.js +187 -0
- package/lib/tools/built-in/shop/set-checkout-details.tool.js.map +1 -0
- package/lib/tools/built-in/shop/set-shipping-method.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/set-shipping-method.tool.js +58 -0
- package/lib/tools/built-in/shop/set-shipping-method.tool.js.map +1 -0
- package/lib/tools/built-in/shop/update-cart-line.tool.d.ts +18 -0
- package/lib/tools/built-in/shop/update-cart-line.tool.js +60 -0
- package/lib/tools/built-in/shop/update-cart-line.tool.js.map +1 -0
- package/lib/tools/built-in/string-schemas.d.ts +4 -0
- package/lib/tools/built-in/string-schemas.js +13 -0
- package/lib/tools/built-in/string-schemas.js.map +1 -0
- package/lib/transport/mcp-server.factory.d.ts +13 -0
- package/lib/transport/mcp-server.factory.js +32 -0
- package/lib/transport/mcp-server.factory.js.map +1 -0
- package/lib/transport/mcp-transport.controller.d.ts +77 -0
- package/lib/transport/mcp-transport.controller.js +442 -0
- package/lib/transport/mcp-transport.controller.js.map +1 -0
- package/lib/types.d.ts +432 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/package.json +42 -0
- package/src/dashboard/components/activity-block.tsx +72 -0
- package/src/dashboard/components/actor-cell.tsx +31 -0
- package/src/dashboard/components/connection-dialog.tsx +106 -0
- package/src/dashboard/components/empty-cell.tsx +7 -0
- package/src/dashboard/components/grants-block.tsx +218 -0
- package/src/dashboard/components/stats-block.tsx +275 -0
- package/src/dashboard/components/tools-block.tsx +274 -0
- package/src/dashboard/components/tooltip-button.tsx +28 -0
- package/src/dashboard/components/use-mcp-table-state.ts +47 -0
- package/src/dashboard/i18n/ar.po +311 -0
- package/src/dashboard/i18n/bg.po +311 -0
- package/src/dashboard/i18n/cs.po +311 -0
- package/src/dashboard/i18n/de.po +311 -0
- package/src/dashboard/i18n/en.po +311 -0
- package/src/dashboard/i18n/es.po +311 -0
- package/src/dashboard/i18n/fa.po +311 -0
- package/src/dashboard/i18n/fr.po +311 -0
- package/src/dashboard/i18n/he.po +311 -0
- package/src/dashboard/i18n/hr.po +311 -0
- package/src/dashboard/i18n/hu.po +311 -0
- package/src/dashboard/i18n/it.po +311 -0
- package/src/dashboard/i18n/ja.po +311 -0
- package/src/dashboard/i18n/ko.po +311 -0
- package/src/dashboard/i18n/nb.po +311 -0
- package/src/dashboard/i18n/ne.po +311 -0
- package/src/dashboard/i18n/nl.po +311 -0
- package/src/dashboard/i18n/pl.po +311 -0
- package/src/dashboard/i18n/pt_BR.po +311 -0
- package/src/dashboard/i18n/pt_PT.po +311 -0
- package/src/dashboard/i18n/ro.po +311 -0
- package/src/dashboard/i18n/ru.po +311 -0
- package/src/dashboard/i18n/sv.po +311 -0
- package/src/dashboard/i18n/tr.po +311 -0
- package/src/dashboard/i18n/uk.po +311 -0
- package/src/dashboard/i18n/uz.po +311 -0
- package/src/dashboard/i18n/zh_Hans.po +311 -0
- package/src/dashboard/i18n/zh_Hant.po +311 -0
- package/src/dashboard/index.tsx +30 -0
- package/src/dashboard/mcp-activity-route.tsx +38 -0
- package/src/dashboard/mcp-authorize-route.tsx +369 -0
- package/src/dashboard/mcp-grants-route.tsx +38 -0
- package/src/dashboard/mcp-overview-route.tsx +46 -0
- package/src/dashboard/mcp-server-redirect-route.tsx +15 -0
- package/src/dashboard/mcp-tools-route.tsx +38 -0
- package/src/dashboard/mcp.graphql.ts +127 -0
- package/src/dashboard/published-files.spec.ts +54 -0
- package/src/dashboard/tsconfig.json +9 -0
- package/src/shared/endpoint-paths.ts +8 -0
- package/src/shared/loopback.ts +6 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ApplyCouponCodeTool = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
const mcp_sdk_1 = require("@vendure/mcp-sdk");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const active_order_service_1 = require("../active-order.service");
|
|
18
|
+
const serializer_service_1 = require("../serializer.service");
|
|
19
|
+
const string_schemas_1 = require("../string-schemas");
|
|
20
|
+
const applyCouponCodeInput = zod_1.z.strictObject({
|
|
21
|
+
code: string_schemas_1.shortText.describe('Coupon code.'),
|
|
22
|
+
});
|
|
23
|
+
let ApplyCouponCodeTool = class ApplyCouponCodeTool {
|
|
24
|
+
constructor(activeOrder, orderService, serializer) {
|
|
25
|
+
this.activeOrder = activeOrder;
|
|
26
|
+
this.orderService = orderService;
|
|
27
|
+
this.serializer = serializer;
|
|
28
|
+
}
|
|
29
|
+
async execute(ctx, input) {
|
|
30
|
+
const order = await this.activeOrder.findEditable(ctx);
|
|
31
|
+
if ((0, core_1.isGraphQlErrorResult)(order)) {
|
|
32
|
+
return this.serializer.orderOrError(order);
|
|
33
|
+
}
|
|
34
|
+
return this.serializer.orderOrError(await this.orderService.applyCouponCode(order.ctx, order.id, input.code));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.ApplyCouponCodeTool = ApplyCouponCodeTool;
|
|
38
|
+
exports.ApplyCouponCodeTool = ApplyCouponCodeTool = __decorate([
|
|
39
|
+
(0, mcp_sdk_1.McpTool)({
|
|
40
|
+
name: 'apply_coupon_code',
|
|
41
|
+
toolset: 'shop',
|
|
42
|
+
description: 'Apply a coupon code to the active cart. A valid code can appear in couponCodes without reducing ' +
|
|
43
|
+
'the total. Compare the returned total and discounts with the previous cart before reporting a discount.',
|
|
44
|
+
keywords: [
|
|
45
|
+
'use a promo code',
|
|
46
|
+
'redeem a discount',
|
|
47
|
+
'enter my voucher',
|
|
48
|
+
'apply a discount code',
|
|
49
|
+
'I have a coupon',
|
|
50
|
+
'use my promotional code',
|
|
51
|
+
],
|
|
52
|
+
permissions: [core_1.Permission.Public],
|
|
53
|
+
behavior: 'mutating',
|
|
54
|
+
usesActiveOrder: true,
|
|
55
|
+
inputSchema: applyCouponCodeInput,
|
|
56
|
+
}),
|
|
57
|
+
(0, common_1.Injectable)(),
|
|
58
|
+
__metadata("design:paramtypes", [active_order_service_1.McpActiveOrderService,
|
|
59
|
+
core_1.OrderService,
|
|
60
|
+
serializer_service_1.McpToolSerializerService])
|
|
61
|
+
], ApplyCouponCodeTool);
|
|
62
|
+
//# sourceMappingURL=apply-coupon-code.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-coupon-code.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/apply-coupon-code.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAA+F;AAC/F,8CAA2D;AAC3D,6BAAwB;AAExB,kEAAgE;AAChE,8DAAiE;AACjE,sDAA8C;AAE9C,MAAM,oBAAoB,GAAG,OAAC,CAAC,YAAY,CAAC;IACxC,IAAI,EAAE,0BAAS,CAAC,QAAQ,CAAC,cAAc,CAAC;CAC3C,CAAC,CAAC;AAwBI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC5B,YACqB,WAAkC,EAClC,YAA0B,EAC1B,UAAoC;QAFpC,gBAAW,GAAX,WAAW,CAAuB;QAClC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB,EAAE,KAA2B;QAC1D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,IAAA,2BAAoB,EAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAC/B,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAC3E,CAAC;IACN,CAAC;CACJ,CAAA;AAhBY,kDAAmB;8BAAnB,mBAAmB;IApB/B,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,MAAM;QACf,WAAW,EACP,kGAAkG;YAClG,yGAAyG;QAC7G,QAAQ,EAAE;YACN,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,uBAAuB;YACvB,iBAAiB;YACjB,yBAAyB;SAC5B;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,oBAAoB;KACpC,CAAC;IACD,IAAA,mBAAU,GAAE;qCAGyB,4CAAqB;QACpB,mBAAY;QACd,6CAAwB;GAJhD,mBAAmB,CAgB/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Collection, CollectionService, ID, ListQueryOptions, RelationPaths, RequestContext } from '@vendure/core';
|
|
2
|
+
import { type ListInput } from '../list-helpers';
|
|
3
|
+
type CollectionLookup = {
|
|
4
|
+
kind: 'id';
|
|
5
|
+
value: ID;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'slug';
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function collectionLookup(id: ID | undefined, slug: string | undefined): CollectionLookup | undefined;
|
|
11
|
+
export declare function findPublicCollection(collectionService: CollectionService, ctx: RequestContext, lookup: CollectionLookup, relations?: RelationPaths<Collection>): Promise<Collection | undefined>;
|
|
12
|
+
/** The one wording every shop tool uses when the lookup found no public collection. */
|
|
13
|
+
export declare function noCollectionMessage(lookup: CollectionLookup): string;
|
|
14
|
+
export declare function publicCollectionListOptions(input: ListInput): ListQueryOptions<Collection>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectionLookup = collectionLookup;
|
|
4
|
+
exports.findPublicCollection = findPublicCollection;
|
|
5
|
+
exports.noCollectionMessage = noCollectionMessage;
|
|
6
|
+
exports.publicCollectionListOptions = publicCollectionListOptions;
|
|
7
|
+
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
8
|
+
const list_helpers_1 = require("../list-helpers");
|
|
9
|
+
function collectionLookup(id, slug) {
|
|
10
|
+
if (id != null) {
|
|
11
|
+
return { kind: 'id', value: id };
|
|
12
|
+
}
|
|
13
|
+
if (slug != null) {
|
|
14
|
+
return { kind: 'slug', value: slug };
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
// A private collection is hidden from shoppers, so it counts as unknown here too.
|
|
19
|
+
async function findPublicCollection(collectionService, ctx, lookup, relations = []) {
|
|
20
|
+
const collection = lookup.kind === 'id'
|
|
21
|
+
? await collectionService.findOne(ctx, lookup.value, relations)
|
|
22
|
+
: await collectionService.findOneBySlug(ctx, lookup.value, relations);
|
|
23
|
+
return collection && !collection.isPrivate ? collection : undefined;
|
|
24
|
+
}
|
|
25
|
+
/** The one wording every shop tool uses when the lookup found no public collection. */
|
|
26
|
+
function noCollectionMessage(lookup) {
|
|
27
|
+
return `No collection with ${lookup.kind} ${String(lookup.value)}.`;
|
|
28
|
+
}
|
|
29
|
+
function publicCollectionListOptions(input) {
|
|
30
|
+
const options = (0, list_helpers_1.listOptions)({ limit: input.limit, offset: input.offset });
|
|
31
|
+
return Object.assign(Object.assign({}, options), { sort: { position: generated_types_1.SortOrder.ASC, id: generated_types_1.SortOrder.ASC }, filter: {
|
|
32
|
+
isPrivate: { eq: false },
|
|
33
|
+
} });
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=collection-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-lookup.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/collection-lookup.ts"],"names":[],"mappings":";;AAcA,4CAQC;AAGD,oDAWC;AAGD,kDAEC;AAED,kEASC;AApDD,yEAAgE;AAUhE,kDAA8D;AAI9D,SAAgB,gBAAgB,CAAC,EAAkB,EAAE,IAAwB;IACzE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACrC,CAAC;IACD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,kFAAkF;AAC3E,KAAK,UAAU,oBAAoB,CACtC,iBAAoC,EACpC,GAAmB,EACnB,MAAwB,EACxB,YAAuC,EAAE;IAEzC,MAAM,UAAU,GACZ,MAAM,CAAC,IAAI,KAAK,IAAI;QAChB,CAAC,CAAC,MAAM,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC;QAC/D,CAAC,CAAC,MAAM,iBAAiB,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC9E,OAAO,UAAU,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC;AAED,uFAAuF;AACvF,SAAgB,mBAAmB,CAAC,MAAwB;IACxD,OAAO,sBAAsB,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AACxE,CAAC;AAED,SAAgB,2BAA2B,CAAC,KAAgB;IACxD,MAAM,OAAO,GAAG,IAAA,0BAAW,EAAa,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACtF,uCACO,OAAO,KACV,IAAI,EAAE,EAAE,QAAQ,EAAE,2BAAS,CAAC,GAAG,EAAE,EAAE,EAAE,2BAAS,CAAC,GAAG,EAAE,EACpD,MAAM,EAAE;YACJ,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE;SAC3B,IACH;AACN,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { McpActiveOrderService } from '../active-order.service';
|
|
4
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
5
|
+
export declare class GetCartTool implements McpToolHandler<Record<string, never>> {
|
|
6
|
+
private readonly activeOrder;
|
|
7
|
+
private readonly serializer;
|
|
8
|
+
constructor(activeOrder: McpActiveOrderService, serializer: McpToolSerializerService);
|
|
9
|
+
execute(ctx: RequestContext): Promise<{
|
|
10
|
+
order: null;
|
|
11
|
+
message: string;
|
|
12
|
+
} | {
|
|
13
|
+
order: {
|
|
14
|
+
id: import("@vendure/core").ID;
|
|
15
|
+
code: string;
|
|
16
|
+
state: import("@vendure/core").OrderState;
|
|
17
|
+
active: boolean;
|
|
18
|
+
total: number;
|
|
19
|
+
totalDecimal: string;
|
|
20
|
+
totalWithTax: number;
|
|
21
|
+
totalWithTaxDecimal: string;
|
|
22
|
+
currencyCode: import("@vendure/core").CurrencyCode;
|
|
23
|
+
totalQuantity: number;
|
|
24
|
+
createdAt: string | null;
|
|
25
|
+
updatedAt: string | null;
|
|
26
|
+
orderPlacedAt: string | null;
|
|
27
|
+
couponCodes: string[];
|
|
28
|
+
discounts: {
|
|
29
|
+
adjustmentSource: string;
|
|
30
|
+
type: import("@vendure/core").AdjustmentType;
|
|
31
|
+
description: string;
|
|
32
|
+
amount: number;
|
|
33
|
+
amountDecimal: string;
|
|
34
|
+
amountWithTax: number;
|
|
35
|
+
amountWithTaxDecimal: string;
|
|
36
|
+
}[];
|
|
37
|
+
lines: {
|
|
38
|
+
id: import("@vendure/core").ID;
|
|
39
|
+
quantity: number;
|
|
40
|
+
linePriceWithTax: number;
|
|
41
|
+
linePriceWithTaxDecimal: string;
|
|
42
|
+
productVariant: {
|
|
43
|
+
id: import("@vendure/core").ID;
|
|
44
|
+
name: import("@vendure/core").LocaleString;
|
|
45
|
+
sku: string;
|
|
46
|
+
} | null;
|
|
47
|
+
}[];
|
|
48
|
+
payments: {
|
|
49
|
+
id: import("@vendure/core").ID;
|
|
50
|
+
method: string;
|
|
51
|
+
amount: number;
|
|
52
|
+
amountDecimal: string;
|
|
53
|
+
state: import("@vendure/core").PaymentState;
|
|
54
|
+
transactionId: string;
|
|
55
|
+
errorMessage: string | undefined;
|
|
56
|
+
publicMetadata: any;
|
|
57
|
+
refunds: {
|
|
58
|
+
id: import("@vendure/core").ID;
|
|
59
|
+
state: import("@vendure/core").RefundState;
|
|
60
|
+
total: number;
|
|
61
|
+
totalDecimal: string;
|
|
62
|
+
reason: string;
|
|
63
|
+
}[];
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
fulfillments: {
|
|
66
|
+
id: import("@vendure/core").ID;
|
|
67
|
+
state: import("@vendure/core").FulfillmentState;
|
|
68
|
+
method: string;
|
|
69
|
+
trackingCode: string;
|
|
70
|
+
lines: {
|
|
71
|
+
orderLineId: import("@vendure/core").ID;
|
|
72
|
+
quantity: number;
|
|
73
|
+
}[];
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
customer: {
|
|
76
|
+
id: import("@vendure/core").ID;
|
|
77
|
+
emailAddress: string;
|
|
78
|
+
firstName: string;
|
|
79
|
+
lastName: string;
|
|
80
|
+
} | null | undefined;
|
|
81
|
+
shippingAddress: Record<string, string> | null;
|
|
82
|
+
billingAddress: Record<string, string> | null;
|
|
83
|
+
shippingWithTax: number;
|
|
84
|
+
shippingWithTaxDecimal: string;
|
|
85
|
+
shippingLines: {
|
|
86
|
+
id: import("@vendure/core").ID;
|
|
87
|
+
shippingMethodId: import("@vendure/core").ID | null;
|
|
88
|
+
priceWithTax: number;
|
|
89
|
+
priceWithTaxDecimal: string;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
} | null;
|
|
92
|
+
message?: undefined;
|
|
93
|
+
}>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetCartTool = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
const mcp_sdk_1 = require("@vendure/mcp-sdk");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const active_order_service_1 = require("../active-order.service");
|
|
18
|
+
const serializer_service_1 = require("../serializer.service");
|
|
19
|
+
const getCartInput = zod_1.z.strictObject({});
|
|
20
|
+
let GetCartTool = class GetCartTool {
|
|
21
|
+
constructor(activeOrder, serializer) {
|
|
22
|
+
this.activeOrder = activeOrder;
|
|
23
|
+
this.serializer = serializer;
|
|
24
|
+
}
|
|
25
|
+
async execute(ctx) {
|
|
26
|
+
const order = await this.activeOrder.findOrderWithLines(ctx);
|
|
27
|
+
if (!order)
|
|
28
|
+
return { order: null, message: active_order_service_1.NO_CART_MESSAGE };
|
|
29
|
+
return { order: this.serializer.order(order) };
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.GetCartTool = GetCartTool;
|
|
33
|
+
exports.GetCartTool = GetCartTool = __decorate([
|
|
34
|
+
(0, mcp_sdk_1.McpTool)({
|
|
35
|
+
name: 'get_cart',
|
|
36
|
+
toolset: 'shop',
|
|
37
|
+
description: 'Get the active cart. Pass the sessionToken from earlier cart responses to see that cart.',
|
|
38
|
+
keywords: [
|
|
39
|
+
"what's in my basket",
|
|
40
|
+
'show my shopping bag',
|
|
41
|
+
"view what I'm buying",
|
|
42
|
+
'my current order so far',
|
|
43
|
+
'see my cart contents',
|
|
44
|
+
'how much is in my basket',
|
|
45
|
+
],
|
|
46
|
+
permissions: [core_1.Permission.Public],
|
|
47
|
+
behavior: 'readonly',
|
|
48
|
+
usesActiveOrder: true,
|
|
49
|
+
inputSchema: getCartInput,
|
|
50
|
+
}),
|
|
51
|
+
(0, common_1.Injectable)(),
|
|
52
|
+
__metadata("design:paramtypes", [active_order_service_1.McpActiveOrderService,
|
|
53
|
+
serializer_service_1.McpToolSerializerService])
|
|
54
|
+
], GetCartTool);
|
|
55
|
+
//# sourceMappingURL=get-cart.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-cart.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-cart.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAA2D;AAC3D,8CAA2D;AAC3D,6BAAwB;AAExB,kEAAiF;AACjF,8DAAiE;AAEjE,MAAM,YAAY,GAAG,OAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAoBjC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACpB,YACqB,WAAkC,EAClC,UAAoC;QADpC,gBAAW,GAAX,WAAW,CAAuB;QAClC,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB;QAC7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,sCAAe,EAAE,CAAC;QAC7D,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;IACnD,CAAC;CACJ,CAAA;AAXY,kCAAW;sBAAX,WAAW;IAlBvB,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,0FAA0F;QACvG,QAAQ,EAAE;YACN,qBAAqB;YACrB,sBAAsB;YACtB,sBAAsB;YACtB,yBAAyB;YACzB,sBAAsB;YACtB,0BAA0B;SAC7B;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,YAAY;KAC5B,CAAC;IACD,IAAA,mBAAU,GAAE;qCAGyB,4CAAqB;QACtB,6CAAwB;GAHhD,WAAW,CAWvB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CollectionService, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
5
|
+
declare const getCollectionInput: z.ZodObject<{
|
|
6
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
7
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
type GetCollectionInput = z.infer<typeof getCollectionInput>;
|
|
10
|
+
export declare class ShopGetCollectionTool implements McpToolHandler<GetCollectionInput> {
|
|
11
|
+
private readonly collectionService;
|
|
12
|
+
private readonly serializer;
|
|
13
|
+
constructor(collectionService: CollectionService, serializer: McpToolSerializerService);
|
|
14
|
+
execute(ctx: RequestContext, input: GetCollectionInput): Promise<{
|
|
15
|
+
collection: null;
|
|
16
|
+
message: string;
|
|
17
|
+
} | {
|
|
18
|
+
collection: {
|
|
19
|
+
id: import("@vendure/core").ID;
|
|
20
|
+
name: import("@vendure/core").LocaleString;
|
|
21
|
+
slug: import("@vendure/core").LocaleString;
|
|
22
|
+
description: import("@vendure/core").LocaleString;
|
|
23
|
+
featuredAsset: {
|
|
24
|
+
id: import("@vendure/core").ID;
|
|
25
|
+
name: import("@vendure/core").LocaleString;
|
|
26
|
+
type: import("@vendure/core").AssetType;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
fileSize: number;
|
|
31
|
+
source: string;
|
|
32
|
+
preview: string;
|
|
33
|
+
focalPoint: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
} | undefined;
|
|
37
|
+
} | null;
|
|
38
|
+
} | null;
|
|
39
|
+
message?: undefined;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ShopGetCollectionTool = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
const mcp_sdk_1 = require("@vendure/mcp-sdk");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const id_schema_1 = require("../id-schema");
|
|
18
|
+
const serializer_service_1 = require("../serializer.service");
|
|
19
|
+
const string_schemas_1 = require("../string-schemas");
|
|
20
|
+
const collection_lookup_1 = require("./collection-lookup");
|
|
21
|
+
const getCollectionInput = zod_1.z.strictObject({
|
|
22
|
+
id: id_schema_1.idSchema.describe('Collection ID.').optional(),
|
|
23
|
+
slug: string_schemas_1.shortText.describe('Collection slug, used when ID is omitted.').optional(),
|
|
24
|
+
});
|
|
25
|
+
let ShopGetCollectionTool = class ShopGetCollectionTool {
|
|
26
|
+
constructor(collectionService, serializer) {
|
|
27
|
+
this.collectionService = collectionService;
|
|
28
|
+
this.serializer = serializer;
|
|
29
|
+
}
|
|
30
|
+
async execute(ctx, input) {
|
|
31
|
+
const lookup = (0, collection_lookup_1.collectionLookup)(input.id, input.slug);
|
|
32
|
+
if (!lookup) {
|
|
33
|
+
return { collection: null, message: 'Pass id or slug.' };
|
|
34
|
+
}
|
|
35
|
+
const collection = await (0, collection_lookup_1.findPublicCollection)(this.collectionService, ctx, lookup, ['featuredAsset']);
|
|
36
|
+
if (!collection) {
|
|
37
|
+
return { collection: null, message: (0, collection_lookup_1.noCollectionMessage)(lookup) };
|
|
38
|
+
}
|
|
39
|
+
return { collection: this.serializer.collection(collection) };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.ShopGetCollectionTool = ShopGetCollectionTool;
|
|
43
|
+
exports.ShopGetCollectionTool = ShopGetCollectionTool = __decorate([
|
|
44
|
+
(0, mcp_sdk_1.McpTool)({
|
|
45
|
+
name: 'get_collection',
|
|
46
|
+
toolset: 'shop',
|
|
47
|
+
description: 'Get a public collection by ID or slug.',
|
|
48
|
+
keywords: [
|
|
49
|
+
'show me this category',
|
|
50
|
+
'open a product group',
|
|
51
|
+
'browse this department',
|
|
52
|
+
'view a category page',
|
|
53
|
+
'details of a collection',
|
|
54
|
+
"what's in this category",
|
|
55
|
+
],
|
|
56
|
+
permissions: [core_1.Permission.Public],
|
|
57
|
+
behavior: 'readonly',
|
|
58
|
+
inputSchema: getCollectionInput,
|
|
59
|
+
}),
|
|
60
|
+
(0, common_1.Injectable)(),
|
|
61
|
+
__metadata("design:paramtypes", [core_1.CollectionService,
|
|
62
|
+
serializer_service_1.McpToolSerializerService])
|
|
63
|
+
], ShopGetCollectionTool);
|
|
64
|
+
//# sourceMappingURL=get-collection.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-collection.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-collection.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAA8E;AAC9E,8CAA2D;AAC3D,6BAAwB;AAExB,4CAAwC;AACxC,8DAAiE;AACjE,sDAA8C;AAE9C,2DAAkG;AAElG,MAAM,kBAAkB,GAAG,OAAC,CAAC,YAAY,CAAC;IACtC,EAAE,EAAE,oBAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IAClD,IAAI,EAAE,0BAAS,CAAC,QAAQ,CAAC,2CAA2C,CAAC,CAAC,QAAQ,EAAE;CACnF,CAAC,CAAC;AAqBI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAC9B,YACqB,iBAAoC,EACpC,UAAoC;QADpC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB,EAAE,KAAyB;QACxD,MAAM,MAAM,GAAG,IAAA,oCAAgB,EAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAC7D,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,IAAA,wCAAoB,EAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;QACtG,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAA,uCAAmB,EAAC,MAAM,CAAC,EAAE,CAAC;QACtE,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;IAClE,CAAC;CACJ,CAAA;AAjBY,sDAAqB;gCAArB,qBAAqB;IAjBjC,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE;YACN,uBAAuB;YACvB,sBAAsB;YACtB,wBAAwB;YACxB,sBAAsB;YACtB,yBAAyB;YACzB,yBAAyB;SAC5B;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,kBAAkB;KAClC,CAAC;IACD,IAAA,mBAAU,GAAE;qCAG+B,wBAAiB;QACxB,6CAAwB;GAHhD,qBAAqB,CAiBjC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OrderService, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { McpActiveOrderService } from '../active-order.service';
|
|
4
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
5
|
+
export declare class GetEligiblePaymentMethodsTool implements McpToolHandler<Record<string, never>> {
|
|
6
|
+
private readonly activeOrder;
|
|
7
|
+
private readonly orderService;
|
|
8
|
+
private readonly serializer;
|
|
9
|
+
constructor(activeOrder: McpActiveOrderService, orderService: OrderService, serializer: McpToolSerializerService);
|
|
10
|
+
execute(ctx: RequestContext): Promise<{
|
|
11
|
+
methods: never[];
|
|
12
|
+
message: string;
|
|
13
|
+
} | {
|
|
14
|
+
methods: {
|
|
15
|
+
customFields: Record<string, unknown> | null | undefined;
|
|
16
|
+
__typename?: "PaymentMethodQuote";
|
|
17
|
+
code: import("@vendure/common/lib/generated-types").Scalars["String"]["output"];
|
|
18
|
+
description: import("@vendure/common/lib/generated-types").Scalars["String"]["output"];
|
|
19
|
+
eligibilityMessage?: import("@vendure/common/lib/generated-types").Maybe<import("@vendure/common/lib/generated-types").Scalars["String"]["output"]>;
|
|
20
|
+
id: import("@vendure/common/lib/generated-types").Scalars["ID"]["output"];
|
|
21
|
+
isEligible: import("@vendure/common/lib/generated-types").Scalars["Boolean"]["output"];
|
|
22
|
+
name: import("@vendure/common/lib/generated-types").Scalars["String"]["output"];
|
|
23
|
+
}[];
|
|
24
|
+
message?: undefined;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetEligiblePaymentMethodsTool = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
const mcp_sdk_1 = require("@vendure/mcp-sdk");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const active_order_service_1 = require("../active-order.service");
|
|
18
|
+
const serializer_service_1 = require("../serializer.service");
|
|
19
|
+
const getEligiblePaymentMethodsInput = zod_1.z.strictObject({});
|
|
20
|
+
let GetEligiblePaymentMethodsTool = class GetEligiblePaymentMethodsTool {
|
|
21
|
+
constructor(activeOrder, orderService, serializer) {
|
|
22
|
+
this.activeOrder = activeOrder;
|
|
23
|
+
this.orderService = orderService;
|
|
24
|
+
this.serializer = serializer;
|
|
25
|
+
}
|
|
26
|
+
async execute(ctx) {
|
|
27
|
+
const order = await this.activeOrder.find(ctx);
|
|
28
|
+
if (!order)
|
|
29
|
+
return { methods: [], message: active_order_service_1.NO_CART_MESSAGE };
|
|
30
|
+
const quotes = await this.orderService.getEligiblePaymentMethods(order.ctx, order.id);
|
|
31
|
+
return { methods: quotes.map(quote => this.serializer.paymentQuote(quote)) };
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.GetEligiblePaymentMethodsTool = GetEligiblePaymentMethodsTool;
|
|
35
|
+
exports.GetEligiblePaymentMethodsTool = GetEligiblePaymentMethodsTool = __decorate([
|
|
36
|
+
(0, mcp_sdk_1.McpTool)({
|
|
37
|
+
name: 'get_eligible_payment_methods',
|
|
38
|
+
toolset: 'shop',
|
|
39
|
+
description: 'List payment methods eligible for the active cart.',
|
|
40
|
+
keywords: [
|
|
41
|
+
'how can I pay',
|
|
42
|
+
'what payment options do you take',
|
|
43
|
+
'ways to pay for my order',
|
|
44
|
+
'do you accept card or paypal',
|
|
45
|
+
'available payment choices',
|
|
46
|
+
'which payment types are allowed',
|
|
47
|
+
],
|
|
48
|
+
permissions: [core_1.Permission.Public],
|
|
49
|
+
behavior: 'readonly',
|
|
50
|
+
usesActiveOrder: true,
|
|
51
|
+
inputSchema: getEligiblePaymentMethodsInput,
|
|
52
|
+
}),
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__metadata("design:paramtypes", [active_order_service_1.McpActiveOrderService,
|
|
55
|
+
core_1.OrderService,
|
|
56
|
+
serializer_service_1.McpToolSerializerService])
|
|
57
|
+
], GetEligiblePaymentMethodsTool);
|
|
58
|
+
//# sourceMappingURL=get-eligible-payment-methods.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-eligible-payment-methods.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-eligible-payment-methods.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAAyE;AACzE,8CAA2D;AAC3D,6BAAwB;AAExB,kEAAiF;AACjF,8DAAiE;AAEjE,MAAM,8BAA8B,GAAG,OAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAoBnD,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACtC,YACqB,WAAkC,EAClC,YAA0B,EAC1B,UAAoC;QAFpC,gBAAW,GAAX,WAAW,CAAuB;QAClC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB;QAC7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,sCAAe,EAAE,CAAC;QAC7D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QACtF,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IACjF,CAAC;CACJ,CAAA;AAbY,sEAA6B;wCAA7B,6BAA6B;IAlBzC,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,oDAAoD;QACjE,QAAQ,EAAE;YACN,eAAe;YACf,kCAAkC;YAClC,0BAA0B;YAC1B,8BAA8B;YAC9B,2BAA2B;YAC3B,iCAAiC;SACpC;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,8BAA8B;KAC9C,CAAC;IACD,IAAA,mBAAU,GAAE;qCAGyB,4CAAqB;QACpB,mBAAY;QACd,6CAAwB;GAJhD,6BAA6B,CAazC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { OrderService, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { McpActiveOrderService } from '../active-order.service';
|
|
4
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
5
|
+
export declare class GetEligibleShippingMethodsTool implements McpToolHandler<Record<string, never>> {
|
|
6
|
+
private readonly activeOrder;
|
|
7
|
+
private readonly orderService;
|
|
8
|
+
private readonly serializer;
|
|
9
|
+
constructor(activeOrder: McpActiveOrderService, orderService: OrderService, serializer: McpToolSerializerService);
|
|
10
|
+
execute(ctx: RequestContext): Promise<{
|
|
11
|
+
methods: never[];
|
|
12
|
+
message: string;
|
|
13
|
+
} | {
|
|
14
|
+
methods: {
|
|
15
|
+
customFields: Record<string, unknown> | null | undefined;
|
|
16
|
+
priceDecimal: string;
|
|
17
|
+
priceWithTaxDecimal: string;
|
|
18
|
+
currencyCode: import("@vendure/core").CurrencyCode;
|
|
19
|
+
__typename?: "ShippingMethodQuote";
|
|
20
|
+
code: import("@vendure/common/lib/generated-types").Scalars["String"]["output"];
|
|
21
|
+
description: import("@vendure/common/lib/generated-types").Scalars["String"]["output"];
|
|
22
|
+
id: import("@vendure/common/lib/generated-types").Scalars["ID"]["output"];
|
|
23
|
+
metadata?: import("@vendure/common/lib/generated-types").Maybe<import("@vendure/common/lib/generated-types").Scalars["JSON"]["output"]>;
|
|
24
|
+
name: import("@vendure/common/lib/generated-types").Scalars["String"]["output"];
|
|
25
|
+
price: import("@vendure/common/lib/generated-types").Scalars["Money"]["output"];
|
|
26
|
+
priceWithTax: import("@vendure/common/lib/generated-types").Scalars["Money"]["output"];
|
|
27
|
+
}[];
|
|
28
|
+
message?: undefined;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetEligibleShippingMethodsTool = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
const mcp_sdk_1 = require("@vendure/mcp-sdk");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const active_order_service_1 = require("../active-order.service");
|
|
18
|
+
const serializer_service_1 = require("../serializer.service");
|
|
19
|
+
const getEligibleShippingMethodsInput = zod_1.z.strictObject({});
|
|
20
|
+
let GetEligibleShippingMethodsTool = class GetEligibleShippingMethodsTool {
|
|
21
|
+
constructor(activeOrder, orderService, serializer) {
|
|
22
|
+
this.activeOrder = activeOrder;
|
|
23
|
+
this.orderService = orderService;
|
|
24
|
+
this.serializer = serializer;
|
|
25
|
+
}
|
|
26
|
+
async execute(ctx) {
|
|
27
|
+
const order = await this.activeOrder.find(ctx);
|
|
28
|
+
if (!order)
|
|
29
|
+
return { methods: [], message: active_order_service_1.NO_CART_MESSAGE };
|
|
30
|
+
const quotes = await this.orderService.getEligibleShippingMethods(order.ctx, order.id);
|
|
31
|
+
// The currency comes from the order because a quote does not carry one.
|
|
32
|
+
return { methods: quotes.map(quote => this.serializer.shippingQuote(quote, order.currencyCode)) };
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.GetEligibleShippingMethodsTool = GetEligibleShippingMethodsTool;
|
|
36
|
+
exports.GetEligibleShippingMethodsTool = GetEligibleShippingMethodsTool = __decorate([
|
|
37
|
+
(0, mcp_sdk_1.McpTool)({
|
|
38
|
+
name: 'get_eligible_shipping_methods',
|
|
39
|
+
toolset: 'shop',
|
|
40
|
+
description: 'List shipping methods eligible for the active cart.',
|
|
41
|
+
keywords: [
|
|
42
|
+
'delivery options',
|
|
43
|
+
'how will my order ship',
|
|
44
|
+
'available shipping choices',
|
|
45
|
+
'postage options for my basket',
|
|
46
|
+
'ways to get my order delivered',
|
|
47
|
+
'which couriers can I use',
|
|
48
|
+
],
|
|
49
|
+
permissions: [core_1.Permission.Public],
|
|
50
|
+
behavior: 'readonly',
|
|
51
|
+
usesActiveOrder: true,
|
|
52
|
+
inputSchema: getEligibleShippingMethodsInput,
|
|
53
|
+
}),
|
|
54
|
+
(0, common_1.Injectable)(),
|
|
55
|
+
__metadata("design:paramtypes", [active_order_service_1.McpActiveOrderService,
|
|
56
|
+
core_1.OrderService,
|
|
57
|
+
serializer_service_1.McpToolSerializerService])
|
|
58
|
+
], GetEligibleShippingMethodsTool);
|
|
59
|
+
//# sourceMappingURL=get-eligible-shipping-methods.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-eligible-shipping-methods.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-eligible-shipping-methods.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAAyE;AACzE,8CAA2D;AAC3D,6BAAwB;AAExB,kEAAiF;AACjF,8DAAiE;AAEjE,MAAM,+BAA+B,GAAG,OAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAoBpD,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACvC,YACqB,WAAkC,EAClC,YAA0B,EAC1B,UAAoC;QAFpC,gBAAW,GAAX,WAAW,CAAuB;QAClC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB;QAC7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,sCAAe,EAAE,CAAC;QAC7D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QACvF,wEAAwE;QACxE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;IACtG,CAAC;CACJ,CAAA;AAdY,wEAA8B;yCAA9B,8BAA8B;IAlB1C,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,qDAAqD;QAClE,QAAQ,EAAE;YACN,kBAAkB;YAClB,wBAAwB;YACxB,4BAA4B;YAC5B,+BAA+B;YAC/B,gCAAgC;YAChC,0BAA0B;SAC7B;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,+BAA+B;KAC/C,CAAC;IACD,IAAA,mBAAU,GAAE;qCAGyB,4CAAqB;QACpB,mBAAY;QACd,6CAAwB;GAJhD,8BAA8B,CAc1C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CustomerService, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
4
|
+
export declare class GetMyAccountTool implements McpToolHandler<Record<string, never>> {
|
|
5
|
+
private readonly customerService;
|
|
6
|
+
private readonly serializer;
|
|
7
|
+
constructor(customerService: CustomerService, serializer: McpToolSerializerService);
|
|
8
|
+
execute(ctx: RequestContext): Promise<{
|
|
9
|
+
customer: {
|
|
10
|
+
id: import("@vendure/core").ID;
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
emailAddress: string;
|
|
14
|
+
phoneNumber: string;
|
|
15
|
+
addresses: {
|
|
16
|
+
defaultShippingAddress: boolean;
|
|
17
|
+
defaultBillingAddress: boolean;
|
|
18
|
+
id: import("@vendure/core").ID;
|
|
19
|
+
}[] | undefined;
|
|
20
|
+
} | null;
|
|
21
|
+
}>;
|
|
22
|
+
}
|