@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,57 @@
|
|
|
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.GetMyAccountTool = 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 serializer_service_1 = require("../serializer.service");
|
|
18
|
+
const getMyAccountInput = zod_1.z.strictObject({});
|
|
19
|
+
let GetMyAccountTool = class GetMyAccountTool {
|
|
20
|
+
constructor(customerService, serializer) {
|
|
21
|
+
this.customerService = customerService;
|
|
22
|
+
this.serializer = serializer;
|
|
23
|
+
}
|
|
24
|
+
async execute(ctx) {
|
|
25
|
+
const customer = ctx.activeUserId
|
|
26
|
+
? await this.customerService.findOneByUserId(ctx, ctx.activeUserId)
|
|
27
|
+
: undefined;
|
|
28
|
+
if (!customer) {
|
|
29
|
+
return { customer: null };
|
|
30
|
+
}
|
|
31
|
+
const addresses = await this.customerService.findAddressesByCustomerId(ctx, customer.id);
|
|
32
|
+
return { customer: this.serializer.customer(customer, addresses) };
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.GetMyAccountTool = GetMyAccountTool;
|
|
36
|
+
exports.GetMyAccountTool = GetMyAccountTool = __decorate([
|
|
37
|
+
(0, mcp_sdk_1.McpTool)({
|
|
38
|
+
name: 'get_my_account',
|
|
39
|
+
toolset: 'shop',
|
|
40
|
+
description: 'Get the authenticated customer account.',
|
|
41
|
+
keywords: [
|
|
42
|
+
'my profile',
|
|
43
|
+
'my account details',
|
|
44
|
+
'who am I logged in as',
|
|
45
|
+
'view my customer info',
|
|
46
|
+
'my personal details',
|
|
47
|
+
'show my account',
|
|
48
|
+
],
|
|
49
|
+
permissions: [core_1.Permission.Authenticated],
|
|
50
|
+
behavior: 'readonly',
|
|
51
|
+
inputSchema: getMyAccountInput,
|
|
52
|
+
}),
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__metadata("design:paramtypes", [core_1.CustomerService,
|
|
55
|
+
serializer_service_1.McpToolSerializerService])
|
|
56
|
+
], GetMyAccountTool);
|
|
57
|
+
//# sourceMappingURL=get-my-account.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-my-account.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-my-account.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAA4E;AAC5E,8CAA2D;AAC3D,6BAAwB;AAExB,8DAAiE;AAEjE,MAAM,iBAAiB,GAAG,OAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAmBtC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACzB,YACqB,eAAgC,EAChC,UAAoC;QADpC,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB;QAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,YAAY;YAC7B,CAAC,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC;YACnE,CAAC,CAAC,SAAS,CAAC;QAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9B,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,yBAAyB,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzF,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;IACvE,CAAC;CACJ,CAAA;AAjBY,4CAAgB;2BAAhB,gBAAgB;IAjB5B,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,yCAAyC;QACtD,QAAQ,EAAE;YACN,YAAY;YACZ,oBAAoB;YACpB,uBAAuB;YACvB,uBAAuB;YACvB,qBAAqB;YACrB,iBAAiB;SACpB;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,aAAa,CAAC;QACvC,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,iBAAiB;KACjC,CAAC;IACD,IAAA,mBAAU,GAAE;qCAG6B,sBAAe;QACpB,6CAAwB;GAHhD,gBAAgB,CAiB5B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ConfigService, OrderService, 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 getOrderInput: z.ZodObject<{
|
|
6
|
+
code: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
type GetOrderInput = z.infer<typeof getOrderInput>;
|
|
9
|
+
export declare class ShopGetOrderTool implements McpToolHandler<GetOrderInput> {
|
|
10
|
+
private readonly configService;
|
|
11
|
+
private readonly orderService;
|
|
12
|
+
private readonly serializer;
|
|
13
|
+
constructor(configService: ConfigService, orderService: OrderService, serializer: McpToolSerializerService);
|
|
14
|
+
execute(ctx: RequestContext, input: GetOrderInput): Promise<{
|
|
15
|
+
order: {
|
|
16
|
+
id: import("@vendure/core").ID;
|
|
17
|
+
code: string;
|
|
18
|
+
state: import("@vendure/core").OrderState;
|
|
19
|
+
active: boolean;
|
|
20
|
+
total: number;
|
|
21
|
+
totalDecimal: string;
|
|
22
|
+
totalWithTax: number;
|
|
23
|
+
totalWithTaxDecimal: string;
|
|
24
|
+
currencyCode: import("@vendure/core").CurrencyCode;
|
|
25
|
+
totalQuantity: number;
|
|
26
|
+
createdAt: string | null;
|
|
27
|
+
updatedAt: string | null;
|
|
28
|
+
orderPlacedAt: string | null;
|
|
29
|
+
couponCodes: string[];
|
|
30
|
+
discounts: {
|
|
31
|
+
adjustmentSource: string;
|
|
32
|
+
type: import("@vendure/core").AdjustmentType;
|
|
33
|
+
description: string;
|
|
34
|
+
amount: number;
|
|
35
|
+
amountDecimal: string;
|
|
36
|
+
amountWithTax: number;
|
|
37
|
+
amountWithTaxDecimal: string;
|
|
38
|
+
}[];
|
|
39
|
+
lines: {
|
|
40
|
+
id: import("@vendure/core").ID;
|
|
41
|
+
quantity: number;
|
|
42
|
+
linePriceWithTax: number;
|
|
43
|
+
linePriceWithTaxDecimal: string;
|
|
44
|
+
productVariant: {
|
|
45
|
+
id: import("@vendure/core").ID;
|
|
46
|
+
name: import("@vendure/core").LocaleString;
|
|
47
|
+
sku: string;
|
|
48
|
+
} | null;
|
|
49
|
+
}[];
|
|
50
|
+
payments: {
|
|
51
|
+
id: import("@vendure/core").ID;
|
|
52
|
+
method: string;
|
|
53
|
+
amount: number;
|
|
54
|
+
amountDecimal: string;
|
|
55
|
+
state: import("@vendure/core").PaymentState;
|
|
56
|
+
transactionId: string;
|
|
57
|
+
errorMessage: string | undefined;
|
|
58
|
+
publicMetadata: any;
|
|
59
|
+
refunds: {
|
|
60
|
+
id: import("@vendure/core").ID;
|
|
61
|
+
state: import("@vendure/core").RefundState;
|
|
62
|
+
total: number;
|
|
63
|
+
totalDecimal: string;
|
|
64
|
+
reason: string;
|
|
65
|
+
}[];
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
fulfillments: {
|
|
68
|
+
id: import("@vendure/core").ID;
|
|
69
|
+
state: import("@vendure/core").FulfillmentState;
|
|
70
|
+
method: string;
|
|
71
|
+
trackingCode: string;
|
|
72
|
+
lines: {
|
|
73
|
+
orderLineId: import("@vendure/core").ID;
|
|
74
|
+
quantity: number;
|
|
75
|
+
}[];
|
|
76
|
+
}[] | undefined;
|
|
77
|
+
customer: {
|
|
78
|
+
id: import("@vendure/core").ID;
|
|
79
|
+
emailAddress: string;
|
|
80
|
+
firstName: string;
|
|
81
|
+
lastName: string;
|
|
82
|
+
} | null | undefined;
|
|
83
|
+
shippingAddress: Record<string, string> | null;
|
|
84
|
+
billingAddress: Record<string, string> | null;
|
|
85
|
+
shippingWithTax: number;
|
|
86
|
+
shippingWithTaxDecimal: string;
|
|
87
|
+
shippingLines: {
|
|
88
|
+
id: import("@vendure/core").ID;
|
|
89
|
+
shippingMethodId: import("@vendure/core").ID | null;
|
|
90
|
+
priceWithTax: number;
|
|
91
|
+
priceWithTaxDecimal: string;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
} | null;
|
|
94
|
+
message?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
order: null;
|
|
97
|
+
message: string;
|
|
98
|
+
}>;
|
|
99
|
+
}
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
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.ShopGetOrderTool = 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 order_list_helpers_1 = require("../order-list-helpers");
|
|
18
|
+
const serializer_service_1 = require("../serializer.service");
|
|
19
|
+
const string_schemas_1 = require("../string-schemas");
|
|
20
|
+
const getOrderInput = zod_1.z.strictObject({
|
|
21
|
+
code: string_schemas_1.shortText.describe('Order code.'),
|
|
22
|
+
});
|
|
23
|
+
let ShopGetOrderTool = class ShopGetOrderTool {
|
|
24
|
+
constructor(configService, orderService, serializer) {
|
|
25
|
+
this.configService = configService;
|
|
26
|
+
this.orderService = orderService;
|
|
27
|
+
this.serializer = serializer;
|
|
28
|
+
}
|
|
29
|
+
async execute(ctx, input) {
|
|
30
|
+
const order = await this.orderService.findOneByCode(ctx, input.code, order_list_helpers_1.ORDER_DETAIL_RELATIONS);
|
|
31
|
+
const access = this.configService.orderOptions.orderByCodeAccessStrategy;
|
|
32
|
+
if (order && (await access.canAccessOrder(ctx, order))) {
|
|
33
|
+
return { order: this.serializer.order(order) };
|
|
34
|
+
}
|
|
35
|
+
// One message for "no such code" and "someone else's order": telling them apart would let an
|
|
36
|
+
// anonymous caller find out which codes exist.
|
|
37
|
+
return {
|
|
38
|
+
order: null,
|
|
39
|
+
message: `No order with code ${input.code} is visible to this caller. ` +
|
|
40
|
+
'Sign in as the customer who placed it to see it.',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.ShopGetOrderTool = ShopGetOrderTool;
|
|
45
|
+
exports.ShopGetOrderTool = ShopGetOrderTool = __decorate([
|
|
46
|
+
(0, mcp_sdk_1.McpTool)({
|
|
47
|
+
name: 'get_order',
|
|
48
|
+
toolset: 'shop',
|
|
49
|
+
description: 'Get an accessible order by code.',
|
|
50
|
+
keywords: [
|
|
51
|
+
'track my order',
|
|
52
|
+
'where is my package',
|
|
53
|
+
'check my order status',
|
|
54
|
+
'look up my purchase by number',
|
|
55
|
+
'find my order with the reference',
|
|
56
|
+
'how is my delivery going',
|
|
57
|
+
],
|
|
58
|
+
permissions: [core_1.Permission.Public],
|
|
59
|
+
behavior: 'readonly',
|
|
60
|
+
inputSchema: getOrderInput,
|
|
61
|
+
}),
|
|
62
|
+
(0, common_1.Injectable)(),
|
|
63
|
+
__metadata("design:paramtypes", [core_1.ConfigService,
|
|
64
|
+
core_1.OrderService,
|
|
65
|
+
serializer_service_1.McpToolSerializerService])
|
|
66
|
+
], ShopGetOrderTool);
|
|
67
|
+
//# sourceMappingURL=get-order.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-order.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-order.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAAwF;AACxF,8CAA2D;AAC3D,6BAAwB;AAExB,8DAA+D;AAC/D,8DAAiE;AACjE,sDAA8C;AAE9C,MAAM,aAAa,GAAG,OAAC,CAAC,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QACpB,WAAW,EAAE,aAAa;KAC7B,CAAC;IACD,IAAA,mBAAU,GAAE;qCAG2B,oBAAa;QACd,mBAAY;QACd,6CAAwB;GAJhD,gBAAgB,CAsB5B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ProductService, ProductVariantService, 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 getProductInput: z.ZodObject<{
|
|
6
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
7
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
8
|
+
variantOffset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
type GetProductInput = z.infer<typeof getProductInput>;
|
|
11
|
+
export declare class ShopGetProductTool implements McpToolHandler<GetProductInput> {
|
|
12
|
+
private readonly productService;
|
|
13
|
+
private readonly productVariantService;
|
|
14
|
+
private readonly serializer;
|
|
15
|
+
constructor(productService: ProductService, productVariantService: ProductVariantService, serializer: McpToolSerializerService);
|
|
16
|
+
execute(ctx: RequestContext, input: GetProductInput): Promise<{
|
|
17
|
+
product: null;
|
|
18
|
+
} | {
|
|
19
|
+
product: {
|
|
20
|
+
variantTotal: number;
|
|
21
|
+
hasMoreVariants: boolean;
|
|
22
|
+
variants: ({
|
|
23
|
+
id: import("@vendure/core").ID;
|
|
24
|
+
name: import("@vendure/core").LocaleString;
|
|
25
|
+
sku: string;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
price: number;
|
|
28
|
+
priceDecimal: string;
|
|
29
|
+
priceWithTax: number;
|
|
30
|
+
priceWithTaxDecimal: string;
|
|
31
|
+
currencyCode: import("@vendure/core").CurrencyCode;
|
|
32
|
+
} | null)[];
|
|
33
|
+
id?: import("@vendure/core").ID | undefined;
|
|
34
|
+
name?: import("@vendure/core").LocaleString | undefined;
|
|
35
|
+
slug?: import("@vendure/core").LocaleString | undefined;
|
|
36
|
+
description?: import("@vendure/core").LocaleString | undefined;
|
|
37
|
+
enabled?: boolean | undefined;
|
|
38
|
+
featuredAsset?: {
|
|
39
|
+
id: import("@vendure/core").ID;
|
|
40
|
+
name: import("@vendure/core").LocaleString;
|
|
41
|
+
type: import("@vendure/core").AssetType;
|
|
42
|
+
mimeType: string;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
fileSize: number;
|
|
46
|
+
source: string;
|
|
47
|
+
preview: string;
|
|
48
|
+
focalPoint: {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
} | undefined;
|
|
52
|
+
} | null | undefined;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
private findProduct;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
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.ShopGetProductTool = 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 list_helpers_1 = require("../list-helpers");
|
|
19
|
+
const serializer_service_1 = require("../serializer.service");
|
|
20
|
+
const string_schemas_1 = require("../string-schemas");
|
|
21
|
+
const getProductInput = zod_1.z.strictObject({
|
|
22
|
+
id: id_schema_1.idSchema.describe('Product ID.').optional(),
|
|
23
|
+
slug: string_schemas_1.shortText.describe('Product slug, used when ID is omitted.').optional(),
|
|
24
|
+
variantOffset: list_helpers_1.variantOffset,
|
|
25
|
+
});
|
|
26
|
+
let ShopGetProductTool = class ShopGetProductTool {
|
|
27
|
+
constructor(productService, productVariantService, serializer) {
|
|
28
|
+
this.productService = productService;
|
|
29
|
+
this.productVariantService = productVariantService;
|
|
30
|
+
this.serializer = serializer;
|
|
31
|
+
}
|
|
32
|
+
async execute(ctx, input) {
|
|
33
|
+
var _a;
|
|
34
|
+
const product = await this.findProduct(ctx, input);
|
|
35
|
+
if ((product === null || product === void 0 ? void 0 : product.enabled) !== true) {
|
|
36
|
+
return { product: null };
|
|
37
|
+
}
|
|
38
|
+
// Loading variants through ProductService instead would silently return them with no price,
|
|
39
|
+
// since only ProductVariantService works prices out per channel.
|
|
40
|
+
const offset = (_a = input.variantOffset) !== null && _a !== void 0 ? _a : 0;
|
|
41
|
+
const variants = await this.productVariantService.getVariantsByProductId(ctx, product.id, { skip: offset }, []);
|
|
42
|
+
return {
|
|
43
|
+
product: Object.assign(Object.assign(Object.assign({}, this.serializer.product(product)), { variants: variants.items.map(variant => this.serializer.variant(variant)) }), (0, list_helpers_1.variantPaging)(offset, variants)),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async findProduct(ctx, input) {
|
|
47
|
+
if (input.id != null) {
|
|
48
|
+
return this.productService.findOne(ctx, input.id, ['featuredAsset', 'assets']);
|
|
49
|
+
}
|
|
50
|
+
if (input.slug != null) {
|
|
51
|
+
return this.productService.findOneBySlug(ctx, input.slug, ['featuredAsset', 'assets']);
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.ShopGetProductTool = ShopGetProductTool;
|
|
57
|
+
exports.ShopGetProductTool = ShopGetProductTool = __decorate([
|
|
58
|
+
(0, mcp_sdk_1.McpTool)({
|
|
59
|
+
name: 'get_product',
|
|
60
|
+
toolset: 'shop',
|
|
61
|
+
description: 'Get an enabled product by ID or slug, including its purchasable variants. Each variant ' +
|
|
62
|
+
'carries the ID that add_to_cart needs. When hasMoreVariants is true, call again with ' +
|
|
63
|
+
'variantOffset to get the next batch.',
|
|
64
|
+
keywords: [
|
|
65
|
+
'tell me about this item',
|
|
66
|
+
'show me this product',
|
|
67
|
+
'product details for shoppers',
|
|
68
|
+
'view an item page',
|
|
69
|
+
'info on a specific product',
|
|
70
|
+
'see this thing you sell',
|
|
71
|
+
],
|
|
72
|
+
permissions: [core_1.Permission.Public],
|
|
73
|
+
behavior: 'readonly',
|
|
74
|
+
inputSchema: getProductInput,
|
|
75
|
+
}),
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__metadata("design:paramtypes", [core_1.ProductService,
|
|
78
|
+
core_1.ProductVariantService,
|
|
79
|
+
serializer_service_1.McpToolSerializerService])
|
|
80
|
+
], ShopGetProductTool);
|
|
81
|
+
//# sourceMappingURL=get-product.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-product.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/get-product.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAAkG;AAClG,8CAA2D;AAC3D,6BAAwB;AAExB,4CAAwC;AACxC,kDAA+D;AAC/D,8DAAiE;AACjE,sDAA8C;AAE9C,MAAM,eAAe,GAAG,OAAC,CAAC,YAAY,CAAC;IACnC,EAAE,EAAE,oBAAQ,CAAC,Q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AAC,GAAmB,EAAE,KAAsB;QACjE,IAAI,KAAK,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC3F,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAA;AAvCY,gDAAkB;6BAAlB,kBAAkB;IApB9B,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,MAAM;QACf,WAAW,EACP,yFAAyF;YACzF,uFAAuF;YACvF,sCAAsC;QAC1C,QAAQ,EAAE;YACN,yBAAyB;YACzB,sBAAsB;YACtB,8BAA8B;YAC9B,mBAAmB;YACnB,4BAA4B;YAC5B,yBAAyB;SAC5B;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,eAAe;KAC/B,CAAC;IACD,IAAA,mBAAU,GAAE;qCAG4B,qBAAc;QACP,4BAAqB;QAChC,6CAAwB;GAJhD,kBAAkB,CAuC9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AddToCartTool } from './add-to-cart.tool';
|
|
2
|
+
import { ApplyCouponCodeTool } from './apply-coupon-code.tool';
|
|
3
|
+
import { GetCartTool } from './get-cart.tool';
|
|
4
|
+
import { ShopGetCollectionTool } from './get-collection.tool';
|
|
5
|
+
import { GetEligiblePaymentMethodsTool } from './get-eligible-payment-methods.tool';
|
|
6
|
+
import { GetEligibleShippingMethodsTool } from './get-eligible-shipping-methods.tool';
|
|
7
|
+
import { GetMyAccountTool } from './get-my-account.tool';
|
|
8
|
+
import { ShopGetOrderTool } from './get-order.tool';
|
|
9
|
+
import { ShopGetProductTool } from './get-product.tool';
|
|
10
|
+
import { ShopListCollectionsTool } from './list-collections.tool';
|
|
11
|
+
import { ListMyOrdersTool } from './list-my-orders.tool';
|
|
12
|
+
import { PlaceOrderTool } from './place-order.tool';
|
|
13
|
+
import { RemoveCouponCodeTool } from './remove-coupon-code.tool';
|
|
14
|
+
import { RemoveFromCartTool } from './remove-from-cart.tool';
|
|
15
|
+
import { SearchProductsTool } from './search-products.tool';
|
|
16
|
+
import { SetCheckoutDetailsTool } from './set-checkout-details.tool';
|
|
17
|
+
import { SetShippingMethodTool } from './set-shipping-method.tool';
|
|
18
|
+
import { UpdateCartLineTool } from './update-cart-line.tool';
|
|
19
|
+
export declare const shopToolProviders: (typeof AddToCartTool | typeof ApplyCouponCodeTool | typeof GetCartTool | typeof ShopGetCollectionTool | typeof GetEligiblePaymentMethodsTool | typeof GetEligibleShippingMethodsTool | typeof GetMyAccountTool | typeof ShopGetOrderTool | typeof ShopGetProductTool | typeof ShopListCollectionsTool | typeof ListMyOrdersTool | typeof PlaceOrderTool | typeof RemoveCouponCodeTool | typeof RemoveFromCartTool | typeof SearchProductsTool | typeof SetCheckoutDetailsTool | typeof SetShippingMethodTool | typeof UpdateCartLineTool)[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shopToolProviders = void 0;
|
|
4
|
+
const add_to_cart_tool_1 = require("./add-to-cart.tool");
|
|
5
|
+
const apply_coupon_code_tool_1 = require("./apply-coupon-code.tool");
|
|
6
|
+
const get_cart_tool_1 = require("./get-cart.tool");
|
|
7
|
+
const get_collection_tool_1 = require("./get-collection.tool");
|
|
8
|
+
const get_eligible_payment_methods_tool_1 = require("./get-eligible-payment-methods.tool");
|
|
9
|
+
const get_eligible_shipping_methods_tool_1 = require("./get-eligible-shipping-methods.tool");
|
|
10
|
+
const get_my_account_tool_1 = require("./get-my-account.tool");
|
|
11
|
+
const get_order_tool_1 = require("./get-order.tool");
|
|
12
|
+
const get_product_tool_1 = require("./get-product.tool");
|
|
13
|
+
const list_collections_tool_1 = require("./list-collections.tool");
|
|
14
|
+
const list_my_orders_tool_1 = require("./list-my-orders.tool");
|
|
15
|
+
const place_order_tool_1 = require("./place-order.tool");
|
|
16
|
+
const remove_coupon_code_tool_1 = require("./remove-coupon-code.tool");
|
|
17
|
+
const remove_from_cart_tool_1 = require("./remove-from-cart.tool");
|
|
18
|
+
const search_products_tool_1 = require("./search-products.tool");
|
|
19
|
+
const set_checkout_details_tool_1 = require("./set-checkout-details.tool");
|
|
20
|
+
const set_shipping_method_tool_1 = require("./set-shipping-method.tool");
|
|
21
|
+
const update_cart_line_tool_1 = require("./update-cart-line.tool");
|
|
22
|
+
exports.shopToolProviders = [
|
|
23
|
+
search_products_tool_1.SearchProductsTool,
|
|
24
|
+
list_collections_tool_1.ShopListCollectionsTool,
|
|
25
|
+
get_collection_tool_1.ShopGetCollectionTool,
|
|
26
|
+
get_product_tool_1.ShopGetProductTool,
|
|
27
|
+
get_cart_tool_1.GetCartTool,
|
|
28
|
+
get_eligible_payment_methods_tool_1.GetEligiblePaymentMethodsTool,
|
|
29
|
+
get_eligible_shipping_methods_tool_1.GetEligibleShippingMethodsTool,
|
|
30
|
+
add_to_cart_tool_1.AddToCartTool,
|
|
31
|
+
update_cart_line_tool_1.UpdateCartLineTool,
|
|
32
|
+
remove_from_cart_tool_1.RemoveFromCartTool,
|
|
33
|
+
apply_coupon_code_tool_1.ApplyCouponCodeTool,
|
|
34
|
+
remove_coupon_code_tool_1.RemoveCouponCodeTool,
|
|
35
|
+
set_checkout_details_tool_1.SetCheckoutDetailsTool,
|
|
36
|
+
set_shipping_method_tool_1.SetShippingMethodTool,
|
|
37
|
+
place_order_tool_1.PlaceOrderTool,
|
|
38
|
+
get_order_tool_1.ShopGetOrderTool,
|
|
39
|
+
get_my_account_tool_1.GetMyAccountTool,
|
|
40
|
+
list_my_orders_tool_1.ListMyOrdersTool,
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/index.ts"],"names":[],"mappings":";;;AAAA,yDAAmD;AACnD,qEAA+D;AAC/D,mDAA8C;AAC9C,+DAA8D;AAC9D,2FAAoF;AACpF,6FAAsF;AACtF,+DAAyD;AACzD,qDAAoD;AACpD,yDAAwD;AACxD,mEAAkE;AAClE,+DAAyD;AACzD,yDAAoD;AACpD,uEAAiE;AACjE,mEAA6D;AAC7D,iEAA4D;AAC5D,2EAAqE;AACrE,yEAAmE;AACnE,mEAA6D;AAEhD,QAAA,iBAAiB,GAAG;IAC7B,yCAAkB;IAClB,+CAAuB;IACvB,2CAAqB;IACrB,qCAAkB;IAClB,2BAAW;IACX,iEAA6B;IAC7B,mEAA8B;IAC9B,gCAAa;IACb,0CAAkB;IAClB,0CAAkB;IAClB,4CAAmB;IACnB,8CAAoB;IACpB,kDAAsB;IACtB,gDAAqB;IACrB,iCAAc;IACd,iCAAgB;IAChB,sCAAgB;IAChB,sCAAgB;CACnB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CollectionService, ID, 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 listCollectionsInput: z.ZodObject<{
|
|
6
|
+
parentId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
7
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
type ListCollectionsInput = z.infer<typeof listCollectionsInput>;
|
|
11
|
+
export declare class ShopListCollectionsTool implements McpToolHandler<ListCollectionsInput> {
|
|
12
|
+
private readonly collectionService;
|
|
13
|
+
private readonly serializer;
|
|
14
|
+
constructor(collectionService: CollectionService, serializer: McpToolSerializerService);
|
|
15
|
+
execute(ctx: RequestContext, input: ListCollectionsInput): Promise<{
|
|
16
|
+
items: ({
|
|
17
|
+
id: ID;
|
|
18
|
+
name: import("@vendure/core").LocaleString;
|
|
19
|
+
slug: import("@vendure/core").LocaleString;
|
|
20
|
+
description: import("@vendure/core").LocaleString;
|
|
21
|
+
featuredAsset: {
|
|
22
|
+
id: ID;
|
|
23
|
+
name: import("@vendure/core").LocaleString;
|
|
24
|
+
type: import("@vendure/core").AssetType;
|
|
25
|
+
mimeType: string;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
fileSize: number;
|
|
29
|
+
source: string;
|
|
30
|
+
preview: string;
|
|
31
|
+
focalPoint: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
} | undefined;
|
|
35
|
+
} | null;
|
|
36
|
+
} | null)[];
|
|
37
|
+
total: number;
|
|
38
|
+
hasMore: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
private childCollections;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
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.ShopListCollectionsTool = 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 list_helpers_1 = require("../list-helpers");
|
|
19
|
+
const serializer_service_1 = require("../serializer.service");
|
|
20
|
+
const collection_lookup_1 = require("./collection-lookup");
|
|
21
|
+
const listCollectionsInput = zod_1.z.strictObject(Object.assign(Object.assign({}, (0, list_helpers_1.paginationFields)('collections')), { parentId: id_schema_1.idSchema.describe('Return the children of this collection.').optional() }));
|
|
22
|
+
let ShopListCollectionsTool = class ShopListCollectionsTool {
|
|
23
|
+
constructor(collectionService, serializer) {
|
|
24
|
+
this.collectionService = collectionService;
|
|
25
|
+
this.serializer = serializer;
|
|
26
|
+
}
|
|
27
|
+
async execute(ctx, input) {
|
|
28
|
+
if (input.parentId != null) {
|
|
29
|
+
return this.childCollections(ctx, input.parentId, input);
|
|
30
|
+
}
|
|
31
|
+
const result = await this.collectionService.findAll(ctx, (0, collection_lookup_1.publicCollectionListOptions)(input), [
|
|
32
|
+
'featuredAsset',
|
|
33
|
+
]);
|
|
34
|
+
return (0, list_helpers_1.page)(result.items.map(collection => this.serializer.collection(collection)), result.totalItems, input);
|
|
35
|
+
}
|
|
36
|
+
// getChildren isn't channel-scoped, so the results are reloaded by id to get the right translations.
|
|
37
|
+
async childCollections(ctx, parentId, input) {
|
|
38
|
+
const parent = await this.collectionService.findOne(ctx, parentId);
|
|
39
|
+
if (!parent || parent.isPrivate) {
|
|
40
|
+
return (0, list_helpers_1.page)([], 0, input);
|
|
41
|
+
}
|
|
42
|
+
const children = await this.collectionService.getChildren(ctx, parentId);
|
|
43
|
+
const publicChildren = children.filter(collection => !collection.isPrivate);
|
|
44
|
+
const channelChildren = await this.collectionService.findByIds(ctx, publicChildren.map(collection => collection.id));
|
|
45
|
+
const byId = new Map(channelChildren.map(collection => [String(collection.id), collection]));
|
|
46
|
+
const visibleChildren = publicChildren
|
|
47
|
+
.map(collection => byId.get(String(collection.id)))
|
|
48
|
+
.filter(collection => collection != null);
|
|
49
|
+
const items = (0, list_helpers_1.slicePage)(visibleChildren, input).map(collection => this.serializer.collection(collection));
|
|
50
|
+
return (0, list_helpers_1.page)(items, visibleChildren.length, input);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.ShopListCollectionsTool = ShopListCollectionsTool;
|
|
54
|
+
exports.ShopListCollectionsTool = ShopListCollectionsTool = __decorate([
|
|
55
|
+
(0, mcp_sdk_1.McpTool)({
|
|
56
|
+
name: 'list_collections',
|
|
57
|
+
toolset: 'shop',
|
|
58
|
+
description: 'List public collections with pagination.',
|
|
59
|
+
keywords: [
|
|
60
|
+
'browse all categories',
|
|
61
|
+
'what departments do you have',
|
|
62
|
+
'show me your product groups',
|
|
63
|
+
'list of shop categories',
|
|
64
|
+
'see every collection',
|
|
65
|
+
'how is the store organized',
|
|
66
|
+
],
|
|
67
|
+
permissions: [core_1.Permission.Public],
|
|
68
|
+
behavior: 'readonly',
|
|
69
|
+
inputSchema: listCollectionsInput,
|
|
70
|
+
}),
|
|
71
|
+
(0, common_1.Injectable)(),
|
|
72
|
+
__metadata("design:paramtypes", [core_1.CollectionService,
|
|
73
|
+
serializer_service_1.McpToolSerializerService])
|
|
74
|
+
], ShopListCollectionsTool);
|
|
75
|
+
//# sourceMappingURL=list-collections.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-collections.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/list-collections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