@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,413 @@
|
|
|
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.McpToolSerializerService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
/** How much of a product's description a list item keeps; `get_product` has the whole text. */
|
|
16
|
+
const LIST_ITEM_DESCRIPTION_LENGTH = 200;
|
|
17
|
+
// Every built-in tool that returns an entity goes through this service, so each entity's output
|
|
18
|
+
// shape has a single definition. It needs to be injectable because prices need the store's
|
|
19
|
+
// configured decimal places, which only ConfigService can provide.
|
|
20
|
+
let McpToolSerializerService = class McpToolSerializerService {
|
|
21
|
+
constructor(configService) {
|
|
22
|
+
this.configService = configService;
|
|
23
|
+
}
|
|
24
|
+
// Tool results carry the raw whole-number amount as well as this formatted string, so a
|
|
25
|
+
// language model can quote a price without doing the division itself.
|
|
26
|
+
//
|
|
27
|
+
// The digits are shifted as text rather than divided, because dividing by 100 can introduce
|
|
28
|
+
// floating-point error on real-world prices.
|
|
29
|
+
decimal(value) {
|
|
30
|
+
var _a;
|
|
31
|
+
const precision = (_a = this.configService.entityOptions.moneyStrategy.precision) !== null && _a !== void 0 ? _a : 2;
|
|
32
|
+
// Only matters if a store configures its own money strategy that can hand over a
|
|
33
|
+
// fractional amount; under the default one this is already a whole number.
|
|
34
|
+
const rounded = Math.round(value !== null && value !== void 0 ? value : 0);
|
|
35
|
+
const negative = rounded < 0;
|
|
36
|
+
const digits = String(Math.abs(rounded));
|
|
37
|
+
if (precision === 0) {
|
|
38
|
+
return `${negative ? '-' : ''}${digits}`;
|
|
39
|
+
}
|
|
40
|
+
const padded = digits.padStart(precision + 1, '0');
|
|
41
|
+
const whole = padded.slice(0, -precision);
|
|
42
|
+
const fraction = padded.slice(-precision);
|
|
43
|
+
return `${negative ? '-' : ''}${whole}.${fraction}`;
|
|
44
|
+
}
|
|
45
|
+
// UTC ISO strings so a language model can compare and quote dates without knowing the server's timezone.
|
|
46
|
+
isoDate(value) {
|
|
47
|
+
return value ? new Date(value).toISOString() : null;
|
|
48
|
+
}
|
|
49
|
+
variant(variant) {
|
|
50
|
+
if (!variant)
|
|
51
|
+
return null;
|
|
52
|
+
return {
|
|
53
|
+
id: variant.id,
|
|
54
|
+
name: variant.name,
|
|
55
|
+
sku: variant.sku,
|
|
56
|
+
enabled: variant.enabled,
|
|
57
|
+
price: variant.price,
|
|
58
|
+
priceDecimal: this.decimal(variant.price),
|
|
59
|
+
priceWithTax: variant.priceWithTax,
|
|
60
|
+
priceWithTaxDecimal: this.decimal(variant.priceWithTax),
|
|
61
|
+
currencyCode: variant.currencyCode,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
adminVariant(variant, stockOnHand) {
|
|
65
|
+
return Object.assign(Object.assign({}, this.variant(variant)), { stockOnHand });
|
|
66
|
+
}
|
|
67
|
+
product(product) {
|
|
68
|
+
if (!product)
|
|
69
|
+
return null;
|
|
70
|
+
return {
|
|
71
|
+
id: product.id,
|
|
72
|
+
name: product.name,
|
|
73
|
+
slug: product.slug,
|
|
74
|
+
description: product.description,
|
|
75
|
+
enabled: product.enabled,
|
|
76
|
+
featuredAsset: product.featuredAsset ? this.asset(product.featuredAsset) : null,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
productListItem(product, variants) {
|
|
80
|
+
var _a;
|
|
81
|
+
const description = (_a = product.description) !== null && _a !== void 0 ? _a : '';
|
|
82
|
+
return {
|
|
83
|
+
id: product.id,
|
|
84
|
+
name: product.name,
|
|
85
|
+
slug: product.slug,
|
|
86
|
+
description: description.length > LIST_ITEM_DESCRIPTION_LENGTH
|
|
87
|
+
? `${description.slice(0, LIST_ITEM_DESCRIPTION_LENGTH)}...`
|
|
88
|
+
: description,
|
|
89
|
+
enabled: product.enabled,
|
|
90
|
+
featuredAsset: product.featuredAsset
|
|
91
|
+
? { id: product.featuredAsset.id, preview: product.featuredAsset.preview }
|
|
92
|
+
: null,
|
|
93
|
+
priceRange: this.priceRange(variants),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
priceRange(variants) {
|
|
97
|
+
if (variants.length === 0)
|
|
98
|
+
return null;
|
|
99
|
+
const prices = variants.map(variant => variant.priceWithTax);
|
|
100
|
+
const min = Math.min(...prices);
|
|
101
|
+
const max = Math.max(...prices);
|
|
102
|
+
return {
|
|
103
|
+
min,
|
|
104
|
+
minDecimal: this.decimal(min),
|
|
105
|
+
max,
|
|
106
|
+
maxDecimal: this.decimal(max),
|
|
107
|
+
currencyCode: variants[0].currencyCode,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// The option IDs here are what create_variant and update_variant take.
|
|
111
|
+
optionGroup(group) {
|
|
112
|
+
var _a;
|
|
113
|
+
return {
|
|
114
|
+
id: group.id,
|
|
115
|
+
code: group.code,
|
|
116
|
+
name: group.name,
|
|
117
|
+
options: ((_a = group.options) !== null && _a !== void 0 ? _a : []).map(option => ({
|
|
118
|
+
id: option.id,
|
|
119
|
+
code: option.code,
|
|
120
|
+
name: option.name,
|
|
121
|
+
})),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// stockLocationId is what adjust_stock needs; the name lets an agent tell locations apart.
|
|
125
|
+
stockLevel(level) {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
return {
|
|
128
|
+
stockLocationId: level.stockLocationId,
|
|
129
|
+
stockLocationName: (_b = (_a = level.stockLocation) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
|
|
130
|
+
stockOnHand: level.stockOnHand,
|
|
131
|
+
stockAllocated: level.stockAllocated,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
collection(collection) {
|
|
135
|
+
if (!collection)
|
|
136
|
+
return null;
|
|
137
|
+
return {
|
|
138
|
+
id: collection.id,
|
|
139
|
+
name: collection.name,
|
|
140
|
+
slug: collection.slug,
|
|
141
|
+
description: collection.description,
|
|
142
|
+
featuredAsset: collection.featuredAsset ? this.asset(collection.featuredAsset) : null,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
channel(channel) {
|
|
146
|
+
return {
|
|
147
|
+
id: channel.id,
|
|
148
|
+
code: channel.code,
|
|
149
|
+
token: channel.token,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
customer(customer, addresses) {
|
|
153
|
+
if (!customer)
|
|
154
|
+
return null;
|
|
155
|
+
return {
|
|
156
|
+
id: customer.id,
|
|
157
|
+
firstName: customer.firstName,
|
|
158
|
+
lastName: customer.lastName,
|
|
159
|
+
emailAddress: customer.emailAddress,
|
|
160
|
+
phoneNumber: customer.phoneNumber,
|
|
161
|
+
addresses: addresses ? addresses.map(address => this.customerAddress(address)) : undefined,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
customerAddress(address) {
|
|
165
|
+
var _a;
|
|
166
|
+
return Object.assign(Object.assign({ id: address.id }, this.address({
|
|
167
|
+
fullName: address.fullName,
|
|
168
|
+
company: address.company,
|
|
169
|
+
streetLine1: address.streetLine1,
|
|
170
|
+
streetLine2: address.streetLine2,
|
|
171
|
+
city: address.city,
|
|
172
|
+
province: address.province,
|
|
173
|
+
postalCode: address.postalCode,
|
|
174
|
+
// A saved address points at a Country entity, while an order stores the code directly.
|
|
175
|
+
countryCode: (_a = address.country) === null || _a === void 0 ? void 0 : _a.code,
|
|
176
|
+
phoneNumber: address.phoneNumber,
|
|
177
|
+
})), { defaultShippingAddress: address.defaultShippingAddress, defaultBillingAddress: address.defaultBillingAddress });
|
|
178
|
+
}
|
|
179
|
+
/** A customer group, whose ID is what `add_customer_to_group` takes. */
|
|
180
|
+
customerGroup(group) {
|
|
181
|
+
return { id: group.id, name: group.name };
|
|
182
|
+
}
|
|
183
|
+
// Errors are returned directly so the registry can report them as failed tool calls.
|
|
184
|
+
customerOrError(result) {
|
|
185
|
+
if (!(0, core_1.isGraphQlErrorResult)(result)) {
|
|
186
|
+
return { customer: this.customer(result) };
|
|
187
|
+
}
|
|
188
|
+
return Object.assign({}, result);
|
|
189
|
+
}
|
|
190
|
+
// State and amount together tell a caller whether this payment finished the checkout or left a balance.
|
|
191
|
+
payment(payment) {
|
|
192
|
+
var _a, _b, _c;
|
|
193
|
+
return {
|
|
194
|
+
id: payment.id,
|
|
195
|
+
method: payment.method,
|
|
196
|
+
amount: payment.amount,
|
|
197
|
+
amountDecimal: this.decimal(payment.amount),
|
|
198
|
+
state: payment.state,
|
|
199
|
+
transactionId: payment.transactionId,
|
|
200
|
+
errorMessage: payment.errorMessage,
|
|
201
|
+
publicMetadata: (_b = (_a = payment.metadata) === null || _a === void 0 ? void 0 : _a.public) !== null && _b !== void 0 ? _b : null,
|
|
202
|
+
refunds: (_c = payment.refunds) === null || _c === void 0 ? void 0 : _c.map(refund => {
|
|
203
|
+
var _a;
|
|
204
|
+
return ({
|
|
205
|
+
id: refund.id,
|
|
206
|
+
state: refund.state,
|
|
207
|
+
total: refund.total,
|
|
208
|
+
totalDecimal: this.decimal(refund.total),
|
|
209
|
+
reason: (_a = refund.reason) !== null && _a !== void 0 ? _a : null,
|
|
210
|
+
});
|
|
211
|
+
}),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
fulfillment(fulfillment, lines) {
|
|
215
|
+
return {
|
|
216
|
+
id: fulfillment.id,
|
|
217
|
+
state: fulfillment.state,
|
|
218
|
+
method: fulfillment.method,
|
|
219
|
+
trackingCode: fulfillment.trackingCode,
|
|
220
|
+
lines: lines.map(line => ({ orderLineId: line.orderLineId, quantity: line.quantity })),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
refund(refund, currencyCode) {
|
|
224
|
+
var _a;
|
|
225
|
+
return {
|
|
226
|
+
id: refund.id,
|
|
227
|
+
state: refund.state,
|
|
228
|
+
total: refund.total,
|
|
229
|
+
totalDecimal: this.decimal(refund.total),
|
|
230
|
+
currencyCode,
|
|
231
|
+
reason: (_a = refund.reason) !== null && _a !== void 0 ? _a : null,
|
|
232
|
+
paymentId: refund.paymentId,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
orderAddress(address) {
|
|
236
|
+
if (!address || Object.keys(address).length === 0)
|
|
237
|
+
return null;
|
|
238
|
+
return this.address(address);
|
|
239
|
+
}
|
|
240
|
+
address(address) {
|
|
241
|
+
// Null fields are dropped rather than sent as null, to save tokens; an empty string is kept
|
|
242
|
+
// since that's a value someone actually typed in.
|
|
243
|
+
const present = {};
|
|
244
|
+
const fields = [
|
|
245
|
+
'fullName',
|
|
246
|
+
'company',
|
|
247
|
+
'streetLine1',
|
|
248
|
+
'streetLine2',
|
|
249
|
+
'city',
|
|
250
|
+
'province',
|
|
251
|
+
'postalCode',
|
|
252
|
+
'countryCode',
|
|
253
|
+
'phoneNumber',
|
|
254
|
+
];
|
|
255
|
+
for (const field of fields) {
|
|
256
|
+
const value = address[field];
|
|
257
|
+
if (value != null) {
|
|
258
|
+
present[field] = value;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return present;
|
|
262
|
+
}
|
|
263
|
+
orderNote(entry) {
|
|
264
|
+
return {
|
|
265
|
+
id: entry.id,
|
|
266
|
+
text: entry.data.note,
|
|
267
|
+
isPublic: entry.isPublic,
|
|
268
|
+
createdAt: this.isoDate(entry.createdAt),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
order(order) {
|
|
272
|
+
var _a, _b;
|
|
273
|
+
if (!order)
|
|
274
|
+
return null;
|
|
275
|
+
return {
|
|
276
|
+
id: order.id,
|
|
277
|
+
code: order.code,
|
|
278
|
+
state: order.state,
|
|
279
|
+
active: order.active,
|
|
280
|
+
total: order.total,
|
|
281
|
+
totalDecimal: this.decimal(order.total),
|
|
282
|
+
totalWithTax: order.totalWithTax,
|
|
283
|
+
totalWithTaxDecimal: this.decimal(order.totalWithTax),
|
|
284
|
+
currencyCode: order.currencyCode,
|
|
285
|
+
totalQuantity: order.totalQuantity,
|
|
286
|
+
createdAt: this.isoDate(order.createdAt),
|
|
287
|
+
updatedAt: this.isoDate(order.updatedAt),
|
|
288
|
+
// Null while the order is still an open cart, set when the customer checks out.
|
|
289
|
+
orderPlacedAt: this.isoDate(order.orderPlacedAt),
|
|
290
|
+
couponCodes: order.couponCodes,
|
|
291
|
+
discounts: order.discounts.map(discount => ({
|
|
292
|
+
adjustmentSource: discount.adjustmentSource,
|
|
293
|
+
type: discount.type,
|
|
294
|
+
description: discount.description,
|
|
295
|
+
amount: discount.amount,
|
|
296
|
+
amountDecimal: this.decimal(discount.amount),
|
|
297
|
+
amountWithTax: discount.amountWithTax,
|
|
298
|
+
amountWithTaxDecimal: this.decimal(discount.amountWithTax),
|
|
299
|
+
})),
|
|
300
|
+
lines: (_b = (_a = order.lines) === null || _a === void 0 ? void 0 : _a.map(line => ({
|
|
301
|
+
id: line.id,
|
|
302
|
+
quantity: line.quantity,
|
|
303
|
+
linePriceWithTax: line.linePriceWithTax,
|
|
304
|
+
linePriceWithTaxDecimal: this.decimal(line.linePriceWithTax),
|
|
305
|
+
productVariant: line.productVariant
|
|
306
|
+
? {
|
|
307
|
+
id: line.productVariant.id,
|
|
308
|
+
name: line.productVariant.name,
|
|
309
|
+
sku: line.productVariant.sku,
|
|
310
|
+
}
|
|
311
|
+
: null,
|
|
312
|
+
}))) !== null && _b !== void 0 ? _b : [],
|
|
313
|
+
payments: order.payments ? order.payments.map(payment => this.payment(payment)) : undefined,
|
|
314
|
+
// Left out by the cart tools, since an open cart has no shipments to report.
|
|
315
|
+
fulfillments: order.fulfillments
|
|
316
|
+
? order.fulfillments.map(fulfillment => { var _a; return this.fulfillment(fulfillment, (_a = fulfillment.lines) !== null && _a !== void 0 ? _a : []); })
|
|
317
|
+
: undefined,
|
|
318
|
+
customer: this.orderCustomer(order.customer),
|
|
319
|
+
shippingAddress: this.orderAddress(order.shippingAddress),
|
|
320
|
+
billingAddress: this.orderAddress(order.billingAddress),
|
|
321
|
+
shippingWithTax: order.shippingWithTax,
|
|
322
|
+
shippingWithTaxDecimal: this.decimal(order.shippingWithTax),
|
|
323
|
+
shippingLines: order.shippingLines
|
|
324
|
+
? order.shippingLines.map(line => ({
|
|
325
|
+
id: line.id,
|
|
326
|
+
shippingMethodId: line.shippingMethodId,
|
|
327
|
+
priceWithTax: line.priceWithTax,
|
|
328
|
+
priceWithTaxDecimal: this.decimal(line.priceWithTax),
|
|
329
|
+
}))
|
|
330
|
+
: undefined,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
orderCustomer(customer) {
|
|
334
|
+
if (customer === undefined)
|
|
335
|
+
return undefined;
|
|
336
|
+
if (customer === null)
|
|
337
|
+
return null;
|
|
338
|
+
return {
|
|
339
|
+
id: customer.id,
|
|
340
|
+
emailAddress: customer.emailAddress,
|
|
341
|
+
firstName: customer.firstName,
|
|
342
|
+
lastName: customer.lastName,
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
// Errors are returned directly so the registry can report them as failed tool calls.
|
|
346
|
+
orderOrError(result) {
|
|
347
|
+
if (!(0, core_1.isGraphQlErrorResult)(result)) {
|
|
348
|
+
return { order: this.order(result) };
|
|
349
|
+
}
|
|
350
|
+
const errorResult = Object.assign({}, result);
|
|
351
|
+
if (errorResult.order instanceof core_1.Order) {
|
|
352
|
+
errorResult.order = this.order(errorResult.order);
|
|
353
|
+
}
|
|
354
|
+
if (errorResult.errorCode === 'COUPON_REMOVED_DURING_CHECKOUT_ERROR' &&
|
|
355
|
+
typeof errorResult.newTotalWithTax === 'number' &&
|
|
356
|
+
typeof errorResult.previousTotalWithTax === 'number') {
|
|
357
|
+
errorResult.newTotalWithTaxDecimal = this.decimal(errorResult.newTotalWithTax);
|
|
358
|
+
errorResult.previousTotalWithTaxDecimal = this.decimal(errorResult.previousTotalWithTax);
|
|
359
|
+
}
|
|
360
|
+
return errorResult;
|
|
361
|
+
}
|
|
362
|
+
// The currency belongs to the order, not the quote, so the caller passes it in.
|
|
363
|
+
shippingQuote(quote, currencyCode) {
|
|
364
|
+
return Object.assign(Object.assign({}, quote), { customFields: this.shopVisibleCustomFields('ShippingMethod', quote.customFields), priceDecimal: this.decimal(quote.price), priceWithTaxDecimal: this.decimal(quote.priceWithTax), currencyCode });
|
|
365
|
+
}
|
|
366
|
+
/** Same as `shippingQuote`: copies the quote and cuts `customFields` to what the Shop API shows. */
|
|
367
|
+
paymentQuote(quote) {
|
|
368
|
+
return Object.assign(Object.assign({}, quote), { customFields: this.shopVisibleCustomFields('PaymentMethod', quote.customFields) });
|
|
369
|
+
}
|
|
370
|
+
// A shop caller never holds admin permissions, so anything permission-gated is hidden too.
|
|
371
|
+
shopVisibleCustomFields(entityName, customFields) {
|
|
372
|
+
var _a;
|
|
373
|
+
if (customFields == null) {
|
|
374
|
+
return customFields;
|
|
375
|
+
}
|
|
376
|
+
const configs = (_a = this.configService.customFields[entityName]) !== null && _a !== void 0 ? _a : [];
|
|
377
|
+
const visible = {};
|
|
378
|
+
for (const [key, value] of Object.entries(customFields)) {
|
|
379
|
+
const config = configs.find(candidate => candidate.name === key);
|
|
380
|
+
if (config &&
|
|
381
|
+
config.internal !== true &&
|
|
382
|
+
config.public !== false &&
|
|
383
|
+
config.requiresPermission == null) {
|
|
384
|
+
visible[key] = value;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return visible;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Called directly by `upload_asset`, and from `product()` and `collection()` for the asset
|
|
391
|
+
* fields they carry.
|
|
392
|
+
*/
|
|
393
|
+
asset(asset) {
|
|
394
|
+
return {
|
|
395
|
+
id: asset.id,
|
|
396
|
+
name: asset.name,
|
|
397
|
+
type: asset.type,
|
|
398
|
+
mimeType: asset.mimeType,
|
|
399
|
+
width: asset.width,
|
|
400
|
+
height: asset.height,
|
|
401
|
+
fileSize: asset.fileSize,
|
|
402
|
+
source: asset.source,
|
|
403
|
+
preview: asset.preview,
|
|
404
|
+
focalPoint: asset.focalPoint,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
exports.McpToolSerializerService = McpToolSerializerService;
|
|
409
|
+
exports.McpToolSerializerService = McpToolSerializerService = __decorate([
|
|
410
|
+
(0, common_1.Injectable)(),
|
|
411
|
+
__metadata("design:paramtypes", [core_1.ConfigService])
|
|
412
|
+
], McpToolSerializerService);
|
|
413
|
+
//# sourceMappingURL=serializer.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.service.js","sourceRoot":"","sources":["../../../src/tools/built-in/serializer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,wCAsBuB;AAEvB,+FAA+F;AAC/F,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEzC,gGAAgG;AAChG,2FAA2F;AAC3F,mEAAmE;AAE5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACjC,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;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AAK;gBACvB,MAAM,CAAC,kBAAkB,IAAI,IAAI,EACnC,CAAC;gBACC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACzB,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAY;QACd,OAAO;YACH,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC/B,CAAC;IACN,CAAC;CACJ,CAAA;AA3aY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAEmC,oBAAa;GADhD,wBAAwB,CA2apC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OrderService, ProductVariantService, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { McpActiveOrderService } from '../active-order.service';
|
|
5
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
6
|
+
declare const addToCartInput: z.ZodObject<{
|
|
7
|
+
variantId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
8
|
+
productId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
9
|
+
quantity: z.ZodNumber;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
type AddToCartInput = z.infer<typeof addToCartInput>;
|
|
12
|
+
export declare class AddToCartTool implements McpToolHandler<AddToCartInput> {
|
|
13
|
+
private readonly activeOrder;
|
|
14
|
+
private readonly orderService;
|
|
15
|
+
private readonly productVariantService;
|
|
16
|
+
private readonly serializer;
|
|
17
|
+
constructor(activeOrder: McpActiveOrderService, orderService: OrderService, productVariantService: ProductVariantService, serializer: McpToolSerializerService);
|
|
18
|
+
execute(ctx: RequestContext, input: AddToCartInput): Promise<Record<string, unknown>>;
|
|
19
|
+
private resolveVariantId;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
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.AddToCartTool = 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 id_schema_1 = require("../id-schema");
|
|
19
|
+
const int32_schema_1 = require("../int32-schema");
|
|
20
|
+
const serializer_service_1 = require("../serializer.service");
|
|
21
|
+
const addToCartInput = zod_1.z.strictObject({
|
|
22
|
+
variantId: id_schema_1.idSchema
|
|
23
|
+
.describe('Product variant ID, taken from the variants listed by get_product. Give this or productId, not both.')
|
|
24
|
+
.optional(),
|
|
25
|
+
productId: id_schema_1.idSchema
|
|
26
|
+
.describe('Product ID, as returned by search_products or get_product. Never pass a variant ID here. ' +
|
|
27
|
+
'Use this only when the product has a single variant; if it has several, the call is ' +
|
|
28
|
+
'refused and the variants are listed so you can pass one as variantId instead.')
|
|
29
|
+
.optional(),
|
|
30
|
+
quantity: int32_schema_1.int32Schema.min(1).describe('Quantity, a whole number of at least 1.'),
|
|
31
|
+
});
|
|
32
|
+
let AddToCartTool = class AddToCartTool {
|
|
33
|
+
constructor(activeOrder, orderService, productVariantService, serializer) {
|
|
34
|
+
this.activeOrder = activeOrder;
|
|
35
|
+
this.orderService = orderService;
|
|
36
|
+
this.productVariantService = productVariantService;
|
|
37
|
+
this.serializer = serializer;
|
|
38
|
+
}
|
|
39
|
+
async execute(ctx, input) {
|
|
40
|
+
const variantId = await this.resolveVariantId(ctx, input);
|
|
41
|
+
const order = await this.activeOrder.findOrCreate(ctx);
|
|
42
|
+
return this.serializer.orderOrError(await this.orderService.addItemToOrder(order.ctx, order.id, variantId, input.quantity));
|
|
43
|
+
}
|
|
44
|
+
// Product and variant IDs can collide, so a product ID passed as a variant ID can silently
|
|
45
|
+
// resolve to the wrong item. Requiring the caller to say which kind of ID it holds prevents that.
|
|
46
|
+
async resolveVariantId(ctx, input) {
|
|
47
|
+
const exactlyOneIdMessage = 'Pass exactly one of variantId or productId.';
|
|
48
|
+
if (input.variantId != null && input.productId != null) {
|
|
49
|
+
throw new core_1.UserInputError(exactlyOneIdMessage);
|
|
50
|
+
}
|
|
51
|
+
if (input.variantId != null) {
|
|
52
|
+
return input.variantId;
|
|
53
|
+
}
|
|
54
|
+
if (input.productId == null) {
|
|
55
|
+
throw new core_1.UserInputError(exactlyOneIdMessage);
|
|
56
|
+
}
|
|
57
|
+
const variants = await this.productVariantService.getVariantsByProductId(ctx, input.productId, {}, []);
|
|
58
|
+
if (variants.items.length === 0) {
|
|
59
|
+
throw new core_1.UserInputError(`Product ${String(input.productId)} has no variants that can be bought.`);
|
|
60
|
+
}
|
|
61
|
+
if (variants.items.length > 1) {
|
|
62
|
+
throw new core_1.UserInputError(
|
|
63
|
+
// totalItems, not items.length, so the count is right even when there are more
|
|
64
|
+
// variants than the lookup's page limit.
|
|
65
|
+
`Product ${String(input.productId)} has ${variants.totalItems} variants. ` +
|
|
66
|
+
'Nothing was added. Call add_to_cart again with one of these as variantId: ' +
|
|
67
|
+
variants.items
|
|
68
|
+
.map(variant => `${String(variant.id)} (${variant.name}, ${variant.sku})`)
|
|
69
|
+
.join('; '));
|
|
70
|
+
}
|
|
71
|
+
return variants.items[0].id;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.AddToCartTool = AddToCartTool;
|
|
75
|
+
exports.AddToCartTool = AddToCartTool = __decorate([
|
|
76
|
+
(0, mcp_sdk_1.McpTool)({
|
|
77
|
+
name: 'add_to_cart',
|
|
78
|
+
toolset: 'shop',
|
|
79
|
+
description: 'Add a product variant to the active cart. Pass exactly one of variantId or productId. ' +
|
|
80
|
+
'Product IDs and variant IDs are different things and are not interchangeable.',
|
|
81
|
+
keywords: [
|
|
82
|
+
'put in my basket',
|
|
83
|
+
'I want to buy this',
|
|
84
|
+
'add this item to my bag',
|
|
85
|
+
'grab this product',
|
|
86
|
+
'start an order with this',
|
|
87
|
+
'put this in my shopping bag',
|
|
88
|
+
],
|
|
89
|
+
permissions: [core_1.Permission.Public],
|
|
90
|
+
behavior: 'mutating',
|
|
91
|
+
usesActiveOrder: true,
|
|
92
|
+
inputSchema: addToCartInput,
|
|
93
|
+
}),
|
|
94
|
+
(0, common_1.Injectable)(),
|
|
95
|
+
__metadata("design:paramtypes", [active_order_service_1.McpActiveOrderService,
|
|
96
|
+
core_1.OrderService,
|
|
97
|
+
core_1.ProductVariantService,
|
|
98
|
+
serializer_service_1.McpToolSerializerService])
|
|
99
|
+
], AddToCartTool);
|
|
100
|
+
//# sourceMappingURL=add-to-cart.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-to-cart.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/add-to-cart.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAOuB;AACvB,8CAA2D;AAC3D,6BAAwB;AAExB,kEAAgE;AAChE,4CAAwC;AACxC,kDAA8C;AAC9C,8DAAiE;AAEjE,MAAM,cAAc,GAAG,OAAC,CAAC,YAAY,CAAC;IAClC,SAAS,EAAE,oBAAQ;SACd,QAAQ,CACL,sGAAsG,CACzG;SACA,QAAQ,EAAE;IACf,SAAS,EAAE,oBAAQ;SACd,QAAQ,CACL,2FAA2F;QACvF,sFAAsF;QACtF,+EAA+E,CACtF;SACA,QAAQ,EAAE;IACf,QAAQ,EAAE,0BAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACnF,CAAC,CAAC;AAwBI,IAAM,aAAa,GAAnB,MAAM,aAAa;IACtB,YACqB,WAAkC,EAClC,YAA0B,EAC1B,qBAA4C,EAC5C,UAAoC;QAHpC,gBAAW,GAAX,WAAW,CAAuB;QAClC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,eAAU,GAAV,UAAU,CAA0B;IACtD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,GAAmB,EAAE,KAAqB;QACpD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAC/B,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,KA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AAE,CAAC,KAAK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,GAAG,GAAG,CAAC;qBACzE,IAAI,CAAC,IAAI,CAAC,CACtB,CAAC;QACN,CAAC;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC;CACJ,CAAA;AAtDY,sCAAa;wBAAb,aAAa;IApBzB,IAAA,iBAAO,EAAC;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,MAAM;QACf,WAAW,EACP,wFAAwF;YACxF,+EAA+E;QACnF,QAAQ,EAAE;YACN,kBAAkB;YAClB,oBAAoB;YACpB,yBAAyB;YACzB,mBAAmB;YACnB,0BAA0B;YAC1B,6BAA6B;SAChC;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,cAAc;KAC9B,CAAC;IACD,IAAA,mBAAU,GAAE;qCAGyB,4CAAqB;QACpB,mBAAY;QACH,4BAAqB;QAChC,6CAAwB;GALhD,aAAa,CAsDzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const addressInputSchema: z.ZodObject<{
|
|
3
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
4
|
+
company: z.ZodOptional<z.ZodString>;
|
|
5
|
+
streetLine1: z.ZodString;
|
|
6
|
+
streetLine2: z.ZodOptional<z.ZodString>;
|
|
7
|
+
city: z.ZodOptional<z.ZodString>;
|
|
8
|
+
province: z.ZodOptional<z.ZodString>;
|
|
9
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
10
|
+
countryCode: z.ZodString;
|
|
11
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
12
|
+
defaultShippingAddress: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
defaultBillingAddress: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
customFields: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
15
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addressInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const string_schemas_1 = require("../string-schemas");
|
|
6
|
+
exports.addressInputSchema = zod_1.z.strictObject({
|
|
7
|
+
fullName: string_schemas_1.shortText.optional(),
|
|
8
|
+
company: string_schemas_1.shortText.optional(),
|
|
9
|
+
streetLine1: string_schemas_1.shortText,
|
|
10
|
+
streetLine2: string_schemas_1.shortText.optional(),
|
|
11
|
+
city: string_schemas_1.shortText.optional(),
|
|
12
|
+
province: string_schemas_1.shortText.optional(),
|
|
13
|
+
postalCode: string_schemas_1.shortText.optional(),
|
|
14
|
+
countryCode: string_schemas_1.shortText,
|
|
15
|
+
phoneNumber: string_schemas_1.shortText.optional(),
|
|
16
|
+
defaultShippingAddress: zod_1.z.boolean().optional(),
|
|
17
|
+
defaultBillingAddress: zod_1.z.boolean().optional(),
|
|
18
|
+
customFields: zod_1.z.looseObject({}).describe('Address custom fields.').optional(),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=address-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-schema.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/address-schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,sDAA8C;AAEjC,QAAA,kBAAkB,GAAG,OAAC,CAAC,YAAY,CAAC;IAC7C,QAAQ,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,0BAAS;IACtB,WAAW,EAAE,0BAAS,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAChC,WAAW,EAAE,0BAAS;IACtB,WAAW,EAAE,0BAAS,CAAC,QAAQ,EAAE;IACjC,sBAAsB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9C,qBAAqB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,OAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;CAChF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OrderService, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpToolHandler } from '@vendure/mcp-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { McpActiveOrderService } from '../active-order.service';
|
|
5
|
+
import { McpToolSerializerService } from '../serializer.service';
|
|
6
|
+
declare const applyCouponCodeInput: z.ZodObject<{
|
|
7
|
+
code: z.ZodString;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
type ApplyCouponCodeInput = z.infer<typeof applyCouponCodeInput>;
|
|
10
|
+
export declare class ApplyCouponCodeTool implements McpToolHandler<ApplyCouponCodeInput> {
|
|
11
|
+
private readonly activeOrder;
|
|
12
|
+
private readonly orderService;
|
|
13
|
+
private readonly serializer;
|
|
14
|
+
constructor(activeOrder: McpActiveOrderService, orderService: OrderService, serializer: McpToolSerializerService);
|
|
15
|
+
execute(ctx: RequestContext, input: ApplyCouponCodeInput): Promise<Record<string, unknown>>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|