@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,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkMcpPluginOptions = checkMcpPluginOptions;
|
|
4
|
+
const core_1 = require("@vendure/core");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const loopback_1 = require("./shared/loopback");
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Checks the resolved plugin options at startup: warns about settings that only matter on a real
|
|
10
|
+
* deployment, and throws when an OAuth option is shaped in a way nothing can work with.
|
|
11
|
+
*/
|
|
12
|
+
function checkMcpPluginOptions(options) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const logging = options.logging;
|
|
15
|
+
if (logging.capture === 'full' && !logging.redact) {
|
|
16
|
+
core_1.Logger.warn('Full MCP logging is enabled without redaction. ' +
|
|
17
|
+
'This may store sensitive data. Add logging.redact to sanitize logs, ' +
|
|
18
|
+
'or switch to metadata-only logging.', constants_1.loggerCtx);
|
|
19
|
+
}
|
|
20
|
+
// Without an allowlist the endpoints answer any Host and Origin, which is what lets a
|
|
21
|
+
// page in a browser reach a server it should not.
|
|
22
|
+
const dnsRebinding = options.dnsRebinding;
|
|
23
|
+
if (process.env.NODE_ENV === 'production' &&
|
|
24
|
+
!((_a = dnsRebinding === null || dnsRebinding === void 0 ? void 0 : dnsRebinding.allowedHosts) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
25
|
+
!((_b = dnsRebinding === null || dnsRebinding === void 0 ? void 0 : dnsRebinding.allowedOrigins) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
26
|
+
core_1.Logger.warn('dnsRebinding is not set, so the MCP endpoints accept any Host and Origin header. ' +
|
|
27
|
+
'Set dnsRebinding.allowedHosts and dnsRebinding.allowedOrigins for a server that ' +
|
|
28
|
+
'browsers can reach.', constants_1.loggerCtx);
|
|
29
|
+
}
|
|
30
|
+
const oauth = options.oauth;
|
|
31
|
+
if (!oauth) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
assertOauthShape(oauth);
|
|
35
|
+
// The same three tiers core uses for its superadmin credential check: production refuses to
|
|
36
|
+
// start, tests stay silent, and every other environment gets a warning.
|
|
37
|
+
const problems = collectProductionSafetyProblems(oauth);
|
|
38
|
+
if (process.env.NODE_ENV === 'production') {
|
|
39
|
+
if (problems.length) {
|
|
40
|
+
throw new Error(`McpPlugin: ${problems[0]}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (process.env.NODE_ENV !== 'test') {
|
|
44
|
+
for (const problem of problems) {
|
|
45
|
+
core_1.Logger.warn(`Unsafe for production: ${problem}`, constants_1.loggerCtx);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** The OAuth options that cannot work in any environment, so they are refused everywhere. */
|
|
50
|
+
function assertOauthShape(oauth) {
|
|
51
|
+
var _a;
|
|
52
|
+
if (!oauth.tokenSecret) {
|
|
53
|
+
throw new Error('McpPlugin: oauth.tokenSecret must be set to a non-empty secret string, because issued OAuth tokens are hashed with it.');
|
|
54
|
+
}
|
|
55
|
+
const issuer = (_a = oauth.issuer) !== null && _a !== void 0 ? _a : '';
|
|
56
|
+
let issuerUrl;
|
|
57
|
+
try {
|
|
58
|
+
issuerUrl = new URL(issuer);
|
|
59
|
+
}
|
|
60
|
+
catch (_b) {
|
|
61
|
+
throw issuerError(issuer);
|
|
62
|
+
}
|
|
63
|
+
if (issuerUrl.pathname !== '/' || issuerUrl.search || issuerUrl.hash) {
|
|
64
|
+
throw issuerError(issuer);
|
|
65
|
+
}
|
|
66
|
+
if (!staysOnIssuer(oauth.adminConsentPath, issuerUrl)) {
|
|
67
|
+
throw new Error(`McpPlugin: oauth.adminConsentPath "${oauth.adminConsentPath}" must be a path on ` +
|
|
68
|
+
`oauth.issuer, such as "/dashboard/mcp/authorize".`);
|
|
69
|
+
}
|
|
70
|
+
if (oauth.storefrontConsentUrl) {
|
|
71
|
+
try {
|
|
72
|
+
new URL(oauth.storefrontConsentUrl);
|
|
73
|
+
}
|
|
74
|
+
catch (_c) {
|
|
75
|
+
throw new Error(`McpPlugin: oauth.storefrontConsentUrl must be a full URL with a scheme, such as ` +
|
|
76
|
+
`"https://shop.example.com/mcp/authorize", got "${oauth.storefrontConsentUrl}".`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function issuerError(issuer) {
|
|
81
|
+
return new Error(`McpPlugin: oauth.issuer must be a URL with a scheme and no path, such as ` +
|
|
82
|
+
`"https://example.com", got "${issuer}".`);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The admin consent page is served by the Vendure server itself. Forms such as "//host/x" and
|
|
86
|
+
* "/\\host/x" resolve to another host, which is why the origin is compared rather than the text.
|
|
87
|
+
*/
|
|
88
|
+
function staysOnIssuer(path, issuerUrl) {
|
|
89
|
+
try {
|
|
90
|
+
return new URL(path, issuerUrl).origin === issuerUrl.origin;
|
|
91
|
+
}
|
|
92
|
+
catch (_a) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** The OAuth settings that a production server must not run with, as messages. */
|
|
97
|
+
function collectProductionSafetyProblems(oauth) {
|
|
98
|
+
var _a;
|
|
99
|
+
const problems = [];
|
|
100
|
+
if (oauth.allowLoopbackCimdDocuments) {
|
|
101
|
+
problems.push(`oauth.allowLoopbackCimdDocuments must be false in production; it lets any authorize ` +
|
|
102
|
+
`caller reach every port on this machine.`);
|
|
103
|
+
}
|
|
104
|
+
const issuerProblem = publicHttpsProblem('oauth.issuer', (_a = oauth.issuer) !== null && _a !== void 0 ? _a : '');
|
|
105
|
+
if (issuerProblem) {
|
|
106
|
+
problems.push(issuerProblem);
|
|
107
|
+
}
|
|
108
|
+
if (oauth.storefrontConsentUrl) {
|
|
109
|
+
const consentProblem = publicHttpsProblem('oauth.storefrontConsentUrl', oauth.storefrontConsentUrl);
|
|
110
|
+
if (consentProblem) {
|
|
111
|
+
problems.push(consentProblem);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return problems;
|
|
115
|
+
}
|
|
116
|
+
/** Names a URL option that clients on the public internet could not reach, or use safely. */
|
|
117
|
+
function publicHttpsProblem(name, url) {
|
|
118
|
+
let parsed;
|
|
119
|
+
try {
|
|
120
|
+
parsed = new URL(url);
|
|
121
|
+
}
|
|
122
|
+
catch (_a) {
|
|
123
|
+
// Not a URL at all, so not a public address either.
|
|
124
|
+
}
|
|
125
|
+
if ((parsed === null || parsed === void 0 ? void 0 : parsed.protocol) !== 'https:' || (0, loopback_1.isLoopbackHostname)(parsed.hostname)) {
|
|
126
|
+
return `${name} must be a public https URL in production, got "${url}".`;
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=check-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-options.js","sourceRoot":"","sources":["../src/check-options.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CrudPermissionDefinition } from '@vendure/core';
|
|
2
|
+
import { McpLogCapture, McpRateLimitOptions } from './types';
|
|
3
|
+
export declare const MCP_PLUGIN_OPTIONS: unique symbol;
|
|
4
|
+
export declare const loggerCtx = "McpPlugin";
|
|
5
|
+
export declare const DEFAULT_TOOL_EXPOSURE: "direct";
|
|
6
|
+
export declare const DEFAULT_SHOP_ACCESS: "anonymous";
|
|
7
|
+
export declare const MCP_SETTINGS_NAMESPACE = "mcp";
|
|
8
|
+
/** Field name registered in `settingsStoreFields` under {@link MCP_SETTINGS_NAMESPACE}. */
|
|
9
|
+
export declare const MCP_TOOL_TOGGLES_FIELD_NAME = "tool-toggles";
|
|
10
|
+
/** Namespaced lookup key used with `SettingsStoreService.get/set`. */
|
|
11
|
+
export declare const MCP_TOOL_TOGGLES_STORE_KEY = "mcp.tool-toggles";
|
|
12
|
+
/**
|
|
13
|
+
* JSON-RPC error code for a rate-limit refusal (handshake pre-check only).
|
|
14
|
+
*/
|
|
15
|
+
export declare const RATE_LIMIT_ERROR_CODE = -31029;
|
|
16
|
+
export declare const RATE_LIMIT_WINDOW_MS = 60000;
|
|
17
|
+
export declare const RATE_LIMIT_CACHE_PREFIX = "mcp:rate-limit";
|
|
18
|
+
export declare const mcpServerPermission: CrudPermissionDefinition;
|
|
19
|
+
/** Throttles how often a bearer-token call bumps `McpOauthGrant.lastActivityAt`. */
|
|
20
|
+
export declare const MCP_GRANT_ACTIVITY_UPDATE_INTERVAL_MS = 60000;
|
|
21
|
+
/** Turns the day-valued retention options into a cutoff date. */
|
|
22
|
+
export declare const MS_PER_DAY = 86400000;
|
|
23
|
+
export declare const MCP_UNUSED_OAUTH_CLIENT_RETENTION_MS = 86400000;
|
|
24
|
+
/** Rows deleted per statement by a retention sweep — small enough not to lock a large table. */
|
|
25
|
+
export declare const RETENTION_DELETE_BATCH_SIZE = 500;
|
|
26
|
+
export declare const DEFAULT_LOG_TTL_DAYS = 30;
|
|
27
|
+
export declare const DEFAULT_LOG_MAX_BODY_BYTES = 64000;
|
|
28
|
+
export declare const DEFAULT_LOG_CAPTURE: McpLogCapture;
|
|
29
|
+
export declare const DEFAULT_OAUTH_OPTIONS: {
|
|
30
|
+
readonly accessTokenTtlSeconds: number;
|
|
31
|
+
readonly refreshTokenTtlSeconds: number;
|
|
32
|
+
readonly authorizationCodeTtlSeconds: 60;
|
|
33
|
+
readonly authorizationRequestTtlSeconds: number;
|
|
34
|
+
readonly adminConsentPath: "/dashboard/mcp/authorize";
|
|
35
|
+
readonly allowLoopbackCimdDocuments: false;
|
|
36
|
+
readonly grantRetentionDays: 30;
|
|
37
|
+
};
|
|
38
|
+
/** The only grant types this server supports: advertised in the metadata, enforced at registration. */
|
|
39
|
+
export declare const SUPPORTED_OAUTH_GRANT_TYPES: string[];
|
|
40
|
+
export declare const CIMD_FETCH_TIMEOUT_MS = 5000;
|
|
41
|
+
export declare const CIMD_MAX_DOCUMENT_BYTES: number;
|
|
42
|
+
export declare const CIMD_MAX_CLIENT_ID_LENGTH = 512;
|
|
43
|
+
export declare const MAX_CLIENT_METADATA_FIELD_LENGTH = 255;
|
|
44
|
+
export declare const MAX_OAUTH_STATE_LENGTH = 255;
|
|
45
|
+
export declare const CIMD_CACHE_TTL_SECONDS: number;
|
|
46
|
+
/** Hard cap on simultaneous outbound CIMD fetches, regardless of how many distinct client_id URLs ask for one. */
|
|
47
|
+
export declare const MAX_CONCURRENT_CIMD_FETCHES = 8;
|
|
48
|
+
export declare const DEFAULT_RATE_LIMIT_OPTIONS: Required<McpRateLimitOptions>;
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_RATE_LIMIT_OPTIONS = exports.MAX_CONCURRENT_CIMD_FETCHES = exports.CIMD_CACHE_TTL_SECONDS = exports.MAX_OAUTH_STATE_LENGTH = exports.MAX_CLIENT_METADATA_FIELD_LENGTH = exports.CIMD_MAX_CLIENT_ID_LENGTH = exports.CIMD_MAX_DOCUMENT_BYTES = exports.CIMD_FETCH_TIMEOUT_MS = exports.SUPPORTED_OAUTH_GRANT_TYPES = exports.DEFAULT_OAUTH_OPTIONS = exports.DEFAULT_LOG_CAPTURE = exports.DEFAULT_LOG_MAX_BODY_BYTES = exports.DEFAULT_LOG_TTL_DAYS = exports.RETENTION_DELETE_BATCH_SIZE = exports.MCP_UNUSED_OAUTH_CLIENT_RETENTION_MS = exports.MS_PER_DAY = exports.MCP_GRANT_ACTIVITY_UPDATE_INTERVAL_MS = exports.mcpServerPermission = exports.RATE_LIMIT_CACHE_PREFIX = exports.RATE_LIMIT_WINDOW_MS = exports.RATE_LIMIT_ERROR_CODE = exports.MCP_TOOL_TOGGLES_STORE_KEY = exports.MCP_TOOL_TOGGLES_FIELD_NAME = exports.MCP_SETTINGS_NAMESPACE = exports.DEFAULT_SHOP_ACCESS = exports.DEFAULT_TOOL_EXPOSURE = exports.loggerCtx = exports.MCP_PLUGIN_OPTIONS = void 0;
|
|
4
|
+
const core_1 = require("@vendure/core");
|
|
5
|
+
exports.MCP_PLUGIN_OPTIONS = Symbol('MCP_PLUGIN_OPTIONS');
|
|
6
|
+
exports.loggerCtx = 'McpPlugin';
|
|
7
|
+
exports.DEFAULT_TOOL_EXPOSURE = 'direct';
|
|
8
|
+
exports.DEFAULT_SHOP_ACCESS = 'anonymous';
|
|
9
|
+
exports.MCP_SETTINGS_NAMESPACE = 'mcp';
|
|
10
|
+
/** Field name registered in `settingsStoreFields` under {@link MCP_SETTINGS_NAMESPACE}. */
|
|
11
|
+
exports.MCP_TOOL_TOGGLES_FIELD_NAME = 'tool-toggles';
|
|
12
|
+
/** Namespaced lookup key used with `SettingsStoreService.get/set`. */
|
|
13
|
+
exports.MCP_TOOL_TOGGLES_STORE_KEY = `${exports.MCP_SETTINGS_NAMESPACE}.${exports.MCP_TOOL_TOGGLES_FIELD_NAME}`;
|
|
14
|
+
/**
|
|
15
|
+
* JSON-RPC error code for a rate-limit refusal (handshake pre-check only).
|
|
16
|
+
*/
|
|
17
|
+
exports.RATE_LIMIT_ERROR_CODE = -31029;
|
|
18
|
+
exports.RATE_LIMIT_WINDOW_MS = 60000;
|
|
19
|
+
exports.RATE_LIMIT_CACHE_PREFIX = 'mcp:rate-limit';
|
|
20
|
+
exports.mcpServerPermission = new core_1.CrudPermissionDefinition('McpServer');
|
|
21
|
+
/** Throttles how often a bearer-token call bumps `McpOauthGrant.lastActivityAt`. */
|
|
22
|
+
exports.MCP_GRANT_ACTIVITY_UPDATE_INTERVAL_MS = 60000;
|
|
23
|
+
/** Turns the day-valued retention options into a cutoff date. */
|
|
24
|
+
exports.MS_PER_DAY = 86400000;
|
|
25
|
+
exports.MCP_UNUSED_OAUTH_CLIENT_RETENTION_MS = exports.MS_PER_DAY;
|
|
26
|
+
/** Rows deleted per statement by a retention sweep — small enough not to lock a large table. */
|
|
27
|
+
exports.RETENTION_DELETE_BATCH_SIZE = 500;
|
|
28
|
+
exports.DEFAULT_LOG_TTL_DAYS = 30;
|
|
29
|
+
// MySQL's TEXT columns cap out at 65,535 bytes, so this keeps a body under that limit.
|
|
30
|
+
exports.DEFAULT_LOG_MAX_BODY_BYTES = 64000;
|
|
31
|
+
exports.DEFAULT_LOG_CAPTURE = 'metadata';
|
|
32
|
+
exports.DEFAULT_OAUTH_OPTIONS = {
|
|
33
|
+
accessTokenTtlSeconds: 15 * 60,
|
|
34
|
+
refreshTokenTtlSeconds: 30 * 24 * 60 * 60,
|
|
35
|
+
authorizationCodeTtlSeconds: 60,
|
|
36
|
+
authorizationRequestTtlSeconds: 10 * 60,
|
|
37
|
+
adminConsentPath: '/dashboard/mcp/authorize',
|
|
38
|
+
allowLoopbackCimdDocuments: false,
|
|
39
|
+
grantRetentionDays: 30,
|
|
40
|
+
};
|
|
41
|
+
/** The only grant types this server supports: advertised in the metadata, enforced at registration. */
|
|
42
|
+
exports.SUPPORTED_OAUTH_GRANT_TYPES = ['authorization_code', 'refresh_token'];
|
|
43
|
+
// CIMD (client_id metadata document) fetch budget, per the ~5 KB cap the spec recommends (§8.7).
|
|
44
|
+
exports.CIMD_FETCH_TIMEOUT_MS = 5000;
|
|
45
|
+
exports.CIMD_MAX_DOCUMENT_BYTES = 5 * 1024;
|
|
46
|
+
// Keeps an over-long value a validation error (HTTP 400) rather than a database error at insert time.
|
|
47
|
+
exports.CIMD_MAX_CLIENT_ID_LENGTH = 512;
|
|
48
|
+
// Applies to client_name, client_uri, logo_uri and redirect_uri.
|
|
49
|
+
exports.MAX_CLIENT_METADATA_FIELD_LENGTH = 255;
|
|
50
|
+
// Declared separately from the client-metadata cap above so changing one doesn't change the other.
|
|
51
|
+
exports.MAX_OAUTH_STATE_LENGTH = 255;
|
|
52
|
+
// A fixed lifetime rather than the document's own Cache-Control header, so a hostile document
|
|
53
|
+
// can't force one outbound fetch per authorization request.
|
|
54
|
+
exports.CIMD_CACHE_TTL_SECONDS = 60 * 60;
|
|
55
|
+
/** Hard cap on simultaneous outbound CIMD fetches, regardless of how many distinct client_id URLs ask for one. */
|
|
56
|
+
exports.MAX_CONCURRENT_CIMD_FETCHES = 8;
|
|
57
|
+
// The anonymous-IP and OAuth-IP limits are on by default as the backstop for those unauthenticated
|
|
58
|
+
// surfaces. The per-tool defaults cap only the tools that create rows or refund money.
|
|
59
|
+
exports.DEFAULT_RATE_LIMIT_OPTIONS = {
|
|
60
|
+
perSession: { rpm: 60 },
|
|
61
|
+
perUser: { rpm: 120 },
|
|
62
|
+
perClient: { rpm: 3000 },
|
|
63
|
+
perTool: {
|
|
64
|
+
place_order: { rpm: 5 },
|
|
65
|
+
create_product: { rpm: 10 },
|
|
66
|
+
refund_order: { rpm: 5 },
|
|
67
|
+
cancel_order: { rpm: 5 },
|
|
68
|
+
},
|
|
69
|
+
anonymousIp: { rpm: 60 },
|
|
70
|
+
oauthIp: { rpm: 60 },
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,wCAAyD;AAI5C,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAElD,QAAA,SAAS,GAAG,WAAW,CAAC;AAExB,QAAA,qBAAqB,GAAG,QAAiB,CAAC;AAE1C,QAAA,mBAAmB,GAAG,WAAoB,CAAC;AAE3C,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC5C,2FAA2F;AAC9E,QAAA,2BAA2B,GAAG,cAAc,CAAC;AAC1D,sEAAsE;AACzD,QAAA,0BAA0B,GAAG,GAAG,8BAAsB,IAAI,mCAA2B,EAAE,CAAC;AAErG;;GAEG;AACU,QAAA,qBAAqB,GAAG,CAAC,KAAK,CAAC;AAC/B,QAAA,oBAAoB,GAAG,KAAM,CAAC;AAC9B,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAE3C,QAAA,mBAAmB,GAAG,IAAI,+BAAwB,CAAC,WAAW,CAAC,CAAC;AAE7E,oFAAoF;AACvE,QAAA,qCAAqC,GAAG,KAAM,CAAC;AAE5D,iEAAiE;AACpD,QAAA,UAAU,GAAG,QAAU,CAAC;AAExB,QAAA,oCAAoC,GAAG,kBAAU,CAAC;AAC/D,gGAAgG;AACnF,QAAA,2BAA2B,GAAG,GAAG,CAAC;AAClC,QAAA,oBAAoB,GAAG,EAAE,CAAC;AACvC,uFAAuF;AAC1E,QAAA,0BAA0B,GAAG,KAAM,CAAC;AACpC,QAAA,mBAAmB,GAAkB,UAAU,CAAC;AAEhD,QAAA,qBAAqB,GAAG;IACjC,qBAAqB,EAAE,EAAE,GAAG,EAAE;IAC9B,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IACzC,2BAA2B,EAAE,EAAE;IAC/B,8BAA8B,EAAE,EAAE,GAAG,EAAE;IACvC,gBAAgB,EAAE,0BAA0B;IAC5C,0BAA0B,EAAE,KAAK;IACjC,kBAAkB,EAAE,EAAE;CAChB,CAAC;AAEX,uGAAuG;AAC1F,QAAA,2BAA2B,GAAG,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;AAEnF,iGAAiG;AACpF,QAAA,qBAAqB,GAAG,IAAK,CAAC;AAC9B,QAAA,uBAAuB,GAAG,CAAC,GAAG,IAAI,CAAC;AAChD,sGAAsG;AACzF,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAC7C,iEAAiE;AACpD,QAAA,gCAAgC,GAAG,GAAG,CAAC;AACpD,mGAAmG;AACtF,QAAA,sBAAsB,GAAG,GAAG,CAAC;AAC1C,8FAA8F;AAC9F,4DAA4D;AAC/C,QAAA,sBAAsB,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9C,kHAAkH;AACrG,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAE7C,mGAAmG;AACnG,uFAAuF;AAC1E,QAAA,0BAA0B,GAAkC;IACrE,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACvB,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;IACrB,SAAS,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;IACxB,OAAO,EAAE;QACL,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;QACvB,cAAc,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QAC3B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;QACxB,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;KAC3B;IACD,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACxB,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;CACvB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ID, RequestContext, TransactionalConnection } from '@vendure/core';
|
|
2
|
+
import { ObjectLiteral, ObjectType } from 'typeorm';
|
|
3
|
+
export declare function deleteInBatches<R extends {
|
|
4
|
+
id: ID;
|
|
5
|
+
}>(connection: TransactionalConnection, ctx: RequestContext, entity: ObjectType<ObjectLiteral>, selectBatch: () => Promise<R[]>, afterDelete?: (rows: R[]) => Promise<void>): Promise<number>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteInBatches = deleteInBatches;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
// Deletes in batches so a large retention sweep doesn't lock the table with one big statement.
|
|
6
|
+
async function deleteInBatches(connection, ctx, entity, selectBatch, afterDelete) {
|
|
7
|
+
var _a;
|
|
8
|
+
const repository = connection.getRepository(ctx, entity);
|
|
9
|
+
let totalDeleted = 0;
|
|
10
|
+
for (;;) {
|
|
11
|
+
const rows = await selectBatch();
|
|
12
|
+
if (rows.length === 0) {
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
const result = await repository
|
|
16
|
+
.createQueryBuilder()
|
|
17
|
+
.delete()
|
|
18
|
+
.where('id IN (:...ids)', { ids: rows.map(row => row.id) })
|
|
19
|
+
.execute();
|
|
20
|
+
await (afterDelete === null || afterDelete === void 0 ? void 0 : afterDelete(rows));
|
|
21
|
+
totalDeleted += (_a = result.affected) !== null && _a !== void 0 ? _a : rows.length;
|
|
22
|
+
if (rows.length < constants_1.RETENTION_DELETE_BATCH_SIZE) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return totalDeleted;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=delete-in-batches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-in-batches.js","sourceRoot":"","sources":["../src/delete-in-batches.ts"],"names":[],"mappings":";;AAMA,0CA0BC;AA7BD,2CAA0D;AAE1D,+FAA+F;AACxF,KAAK,UAAU,eAAe,CACjC,UAAmC,EACnC,GAAmB,EACnB,MAAiC,EACjC,WAA+B,EAC/B,WAA0C;;IAE1C,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,SAAS,CAAC;QACN,MAAM,IAAI,GAAG,MAAM,WAAW,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM;QACV,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,UAAU;aAC1B,kBAAkB,EAAE;aACpB,MAAM,EAAE;aACR,KAAK,CAAC,iBAAiB,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;aAC1D,OAAO,EAAE,CAAC;QACf,MAAM,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,IAAI,CAAC,CAAA,CAAC;QAC1B,YAAY,IAAI,MAAA,MAAM,CAAC,QAAQ,mCAAI,IAAI,CAAC,MAAM,CAAC;QAC/C,IAAI,IAAI,CAAC,MAAM,GAAG,uCAA2B,EAAE,CAAC;YAC5C,MAAM;QACV,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./mcp-authorization-code.entity"), exports);
|
|
18
|
+
__exportStar(require("./mcp-authorization-request.entity"), exports);
|
|
19
|
+
__exportStar(require("./mcp-oauth-client.entity"), exports);
|
|
20
|
+
__exportStar(require("./mcp-oauth-grant.entity"), exports);
|
|
21
|
+
__exportStar(require("./mcp-tool-call-log.entity"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,qEAAmD;AACnD,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DeepPartial, ID, VendureEntity } from '@vendure/core';
|
|
2
|
+
import { McpGrantUserType } from '../types';
|
|
3
|
+
import { McpOauthClient } from './mcp-oauth-client.entity';
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* Short-lived OAuth authorization code exchanged for tokens.
|
|
7
|
+
* The code is stored as a hash. Actor info is kept to recreate the session on exchange.
|
|
8
|
+
*
|
|
9
|
+
* @docsCategory core plugins/McpPlugin
|
|
10
|
+
* @since 3.8.0
|
|
11
|
+
*/
|
|
12
|
+
export declare class McpAuthorizationCode extends VendureEntity {
|
|
13
|
+
constructor(input?: DeepPartial<McpAuthorizationCode>);
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* Hash of the authorization code. The raw code is never stored and is deleted after use.
|
|
17
|
+
*/
|
|
18
|
+
code: string;
|
|
19
|
+
oauthClient: McpOauthClient;
|
|
20
|
+
oauthClientId: ID;
|
|
21
|
+
actorId: ID;
|
|
22
|
+
actorType: McpGrantUserType;
|
|
23
|
+
redirectUri: string;
|
|
24
|
+
/**
|
|
25
|
+
* @description
|
|
26
|
+
* Target endpoint (issuer + `/mcp/admin` or `/mcp/shop`).
|
|
27
|
+
* Must match during token exchange.
|
|
28
|
+
*/
|
|
29
|
+
resource: string;
|
|
30
|
+
channelId: ID | null;
|
|
31
|
+
codeChallenge: string;
|
|
32
|
+
expiresAt: Date;
|
|
33
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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.McpAuthorizationCode = void 0;
|
|
13
|
+
const core_1 = require("@vendure/core");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const mcp_oauth_client_entity_1 = require("./mcp-oauth-client.entity");
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* Short-lived OAuth authorization code exchanged for tokens.
|
|
19
|
+
* The code is stored as a hash. Actor info is kept to recreate the session on exchange.
|
|
20
|
+
*
|
|
21
|
+
* @docsCategory core plugins/McpPlugin
|
|
22
|
+
* @since 3.8.0
|
|
23
|
+
*/
|
|
24
|
+
let McpAuthorizationCode = class McpAuthorizationCode extends core_1.VendureEntity {
|
|
25
|
+
constructor(input) {
|
|
26
|
+
super(input);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.McpAuthorizationCode = McpAuthorizationCode;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
32
|
+
(0, typeorm_1.Column)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], McpAuthorizationCode.prototype, "code", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Index)(),
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => mcp_oauth_client_entity_1.McpOauthClient, { onDelete: 'CASCADE' }),
|
|
38
|
+
__metadata("design:type", mcp_oauth_client_entity_1.McpOauthClient)
|
|
39
|
+
], McpAuthorizationCode.prototype, "oauthClient", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.EntityId)(),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], McpAuthorizationCode.prototype, "oauthClientId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, core_1.EntityId)(),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], McpAuthorizationCode.prototype, "actorId", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], McpAuthorizationCode.prototype, "actorType", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], McpAuthorizationCode.prototype, "redirectUri", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], McpAuthorizationCode.prototype, "resource", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, core_1.EntityId)({ nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], McpAuthorizationCode.prototype, "channelId", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], McpAuthorizationCode.prototype, "codeChallenge", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Index)(),
|
|
70
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], McpAuthorizationCode.prototype, "expiresAt", void 0);
|
|
73
|
+
exports.McpAuthorizationCode = McpAuthorizationCode = __decorate([
|
|
74
|
+
(0, typeorm_1.Entity)(),
|
|
75
|
+
__metadata("design:paramtypes", [Object])
|
|
76
|
+
], McpAuthorizationCode);
|
|
77
|
+
//# sourceMappingURL=mcp-authorization-code.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-authorization-code.entity.js","sourceRoot":"","sources":["../../src/entities/mcp-authorization-code.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAyE;AACzE,qCAA2D;AAI3D,uEAA2D;AAE3D;;;;;;;GAOG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,oBAAa;IACnD,YAAY,KAAyC;QACjD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CA2CJ,CAAA;AA9CY,oDAAoB;AAW7B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;kDACI;AAIb;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wCAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BAC5C,wCAAc;yDAAC;AAG5B;IADC,IAAA,eAAQ,GAAE;;2DACO;AAGlB;IADC,IAAA,eAAQ,GAAE;;qDACC;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;uDACA;AAG5B;IADC,IAAA,gBAAM,GAAE;;yDACW;AAQpB;IADC,IAAA,gBAAM,GAAE;;sDACQ;AAGjB;IADC,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;AAGrB;IADC,IAAA,gBAAM,GAAE;;2DACa;AAItB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;uDAAC;+BA7CP,oBAAoB;IADhC,IAAA,gBAAM,GAAE;;GACI,oBAAoB,CA8ChC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DeepPartial, ID, VendureEntity } from '@vendure/core';
|
|
2
|
+
import { McpToolset } from '@vendure/mcp-sdk';
|
|
3
|
+
import { McpOauthClient } from './mcp-oauth-client.entity';
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* Pending OAuth authorization request before user consent.
|
|
7
|
+
* Stores redirect info, PKCE challenge, and a hashed request token.
|
|
8
|
+
*
|
|
9
|
+
* @docsCategory core plugins/McpPlugin
|
|
10
|
+
* @since 3.8.0
|
|
11
|
+
*/
|
|
12
|
+
export declare class McpAuthorizationRequest extends VendureEntity {
|
|
13
|
+
constructor(input?: DeepPartial<McpAuthorizationRequest>);
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* Hash of the request token used by the consent page.
|
|
17
|
+
*/
|
|
18
|
+
requestToken: string;
|
|
19
|
+
oauthClient: McpOauthClient;
|
|
20
|
+
oauthClientId: ID;
|
|
21
|
+
redirectUri: string;
|
|
22
|
+
state: string | null;
|
|
23
|
+
codeChallenge: string;
|
|
24
|
+
toolset: McpToolset;
|
|
25
|
+
/**
|
|
26
|
+
* @description
|
|
27
|
+
* Target endpoint (issuer + `/mcp/admin` or `/mcp/shop`).
|
|
28
|
+
*/
|
|
29
|
+
resource: string;
|
|
30
|
+
expiresAt: Date;
|
|
31
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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.McpAuthorizationRequest = void 0;
|
|
13
|
+
const core_1 = require("@vendure/core");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const mcp_oauth_client_entity_1 = require("./mcp-oauth-client.entity");
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* Pending OAuth authorization request before user consent.
|
|
19
|
+
* Stores redirect info, PKCE challenge, and a hashed request token.
|
|
20
|
+
*
|
|
21
|
+
* @docsCategory core plugins/McpPlugin
|
|
22
|
+
* @since 3.8.0
|
|
23
|
+
*/
|
|
24
|
+
let McpAuthorizationRequest = class McpAuthorizationRequest extends core_1.VendureEntity {
|
|
25
|
+
constructor(input) {
|
|
26
|
+
super(input);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.McpAuthorizationRequest = McpAuthorizationRequest;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
32
|
+
(0, typeorm_1.Column)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], McpAuthorizationRequest.prototype, "requestToken", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Index)(),
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => mcp_oauth_client_entity_1.McpOauthClient, { onDelete: 'CASCADE' }),
|
|
38
|
+
__metadata("design:type", mcp_oauth_client_entity_1.McpOauthClient)
|
|
39
|
+
], McpAuthorizationRequest.prototype, "oauthClient", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.EntityId)(),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], McpAuthorizationRequest.prototype, "oauthClientId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], McpAuthorizationRequest.prototype, "redirectUri", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], McpAuthorizationRequest.prototype, "state", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], McpAuthorizationRequest.prototype, "codeChallenge", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], McpAuthorizationRequest.prototype, "toolset", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)(),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], McpAuthorizationRequest.prototype, "resource", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Index)(),
|
|
66
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], McpAuthorizationRequest.prototype, "expiresAt", void 0);
|
|
69
|
+
exports.McpAuthorizationRequest = McpAuthorizationRequest = __decorate([
|
|
70
|
+
(0, typeorm_1.Entity)(),
|
|
71
|
+
__metadata("design:paramtypes", [Object])
|
|
72
|
+
], McpAuthorizationRequest);
|
|
73
|
+
//# sourceMappingURL=mcp-authorization-request.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-authorization-request.entity.js","sourceRoot":"","sources":["../../src/entities/mcp-authorization-request.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAyE;AAEzE,qCAA2D;AAE3D,uEAA2D;AAE3D;;;;;;;GAOG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,oBAAa;IACtD,YAAY,KAA4C;QACpD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAuCJ,CAAA;AA1CY,0DAAuB;AAWhC;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;6DACY;AAIrB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wCAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BAC5C,wCAAc;4DAAC;AAG5B;IADC,IAAA,eAAQ,GAAE;;8DACO;AAGlB;IADC,IAAA,gBAAM,GAAE;;4DACW;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACvB;AAGrB;IADC,IAAA,gBAAM,GAAE;;8DACa;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wDACR;AAOpB;IADC,IAAA,gBAAM,GAAE;;yDACQ;AAIjB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;0DAAC;kCAzCP,uBAAuB;IADnC,IAAA,gBAAM,GAAE;;GACI,uBAAuB,CA0CnC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DeepPartial, VendureEntity } from '@vendure/core';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Metadata for an MCP client registered via OAuth Dynamic Client Registration, or resolved
|
|
5
|
+
* from a Client ID Metadata Document (CIMD) URL.
|
|
6
|
+
*
|
|
7
|
+
* @docsCategory core plugins/McpPlugin
|
|
8
|
+
* @since 3.8.0
|
|
9
|
+
*/
|
|
10
|
+
export declare class McpOauthClient extends VendureEntity {
|
|
11
|
+
constructor(input?: DeepPartial<McpOauthClient>);
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Unique client identifier (generated or metadata URL).
|
|
15
|
+
*/
|
|
16
|
+
clientId: string;
|
|
17
|
+
/**
|
|
18
|
+
* @description
|
|
19
|
+
* The name the client picked for itself, shown to whoever is asked to approve it. Nothing
|
|
20
|
+
* verifies it, so treat it as untrusted.
|
|
21
|
+
*/
|
|
22
|
+
clientName: string;
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Homepage shown on the consent page. Null if the client sent none, or sent something that
|
|
26
|
+
* was not a valid `https` URL.
|
|
27
|
+
*/
|
|
28
|
+
clientUri: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* @description
|
|
31
|
+
* Client logo URL (HTTPS only).
|
|
32
|
+
*/
|
|
33
|
+
logoUri: string | null;
|
|
34
|
+
redirectUris: string[];
|
|
35
|
+
/**
|
|
36
|
+
* @description
|
|
37
|
+
* Only `authorization_code` and `refresh_token` are accepted. Anything else a client asks
|
|
38
|
+
* for is dropped.
|
|
39
|
+
*/
|
|
40
|
+
grantTypes: string[];
|
|
41
|
+
/**
|
|
42
|
+
* @description
|
|
43
|
+
* Always `none`. This server issues no client secrets, and refuses any other value at
|
|
44
|
+
* registration.
|
|
45
|
+
*
|
|
46
|
+
* @default 'none'
|
|
47
|
+
*/
|
|
48
|
+
tokenEndpointAuthMethod: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description
|
|
51
|
+
* When the cached copy of the client's metadata document goes stale and must be fetched
|
|
52
|
+
* again. Null for a client that registered itself and has no document.
|
|
53
|
+
*/
|
|
54
|
+
cimdDocumentExpiresAt: Date | null;
|
|
55
|
+
lastUsedAt: Date | null;
|
|
56
|
+
}
|