@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.
Files changed (389) hide show
  1. package/lib/api/api-extensions.d.ts +2 -0
  2. package/lib/api/api-extensions.js +239 -0
  3. package/lib/api/api-extensions.js.map +1 -0
  4. package/lib/api/mcp-actor.service.d.ts +19 -0
  5. package/lib/api/mcp-actor.service.js +52 -0
  6. package/lib/api/mcp-actor.service.js.map +1 -0
  7. package/lib/api/mcp-admin.resolver.d.ts +105 -0
  8. package/lib/api/mcp-admin.resolver.js +463 -0
  9. package/lib/api/mcp-admin.resolver.js.map +1 -0
  10. package/lib/api/mcp-shop.resolver.d.ts +25 -0
  11. package/lib/api/mcp-shop.resolver.js +74 -0
  12. package/lib/api/mcp-shop.resolver.js.map +1 -0
  13. package/lib/check-options.d.ts +7 -0
  14. package/lib/check-options.js +130 -0
  15. package/lib/check-options.js.map +1 -0
  16. package/lib/constants.d.ts +48 -0
  17. package/lib/constants.js +72 -0
  18. package/lib/constants.js.map +1 -0
  19. package/lib/delete-in-batches.d.ts +5 -0
  20. package/lib/delete-in-batches.js +28 -0
  21. package/lib/delete-in-batches.js.map +1 -0
  22. package/lib/entities/index.d.ts +5 -0
  23. package/lib/entities/index.js +22 -0
  24. package/lib/entities/index.js.map +1 -0
  25. package/lib/entities/mcp-authorization-code.entity.d.ts +33 -0
  26. package/lib/entities/mcp-authorization-code.entity.js +77 -0
  27. package/lib/entities/mcp-authorization-code.entity.js.map +1 -0
  28. package/lib/entities/mcp-authorization-request.entity.d.ts +31 -0
  29. package/lib/entities/mcp-authorization-request.entity.js +73 -0
  30. package/lib/entities/mcp-authorization-request.entity.js.map +1 -0
  31. package/lib/entities/mcp-oauth-client.entity.d.ts +56 -0
  32. package/lib/entities/mcp-oauth-client.entity.js +70 -0
  33. package/lib/entities/mcp-oauth-client.entity.js.map +1 -0
  34. package/lib/entities/mcp-oauth-grant.entity.d.ts +77 -0
  35. package/lib/entities/mcp-oauth-grant.entity.js +121 -0
  36. package/lib/entities/mcp-oauth-grant.entity.js.map +1 -0
  37. package/lib/entities/mcp-tool-call-log.entity.d.ts +50 -0
  38. package/lib/entities/mcp-tool-call-log.entity.js +101 -0
  39. package/lib/entities/mcp-tool-call-log.entity.js.map +1 -0
  40. package/lib/events/mcp-tool-call.event.d.ts +17 -0
  41. package/lib/events/mcp-tool-call.event.js +23 -0
  42. package/lib/events/mcp-tool-call.event.js.map +1 -0
  43. package/lib/get-client-ip.d.ts +2 -0
  44. package/lib/get-client-ip.js +10 -0
  45. package/lib/get-client-ip.js.map +1 -0
  46. package/lib/get-language-code.d.ts +3 -0
  47. package/lib/get-language-code.js +12 -0
  48. package/lib/get-language-code.js.map +1 -0
  49. package/lib/index.d.ts +6 -0
  50. package/lib/index.js +26 -0
  51. package/lib/index.js.map +1 -0
  52. package/lib/internal-types.d.ts +27 -0
  53. package/lib/internal-types.js +3 -0
  54. package/lib/internal-types.js.map +1 -0
  55. package/lib/logging/mcp-tool-call-log-retention.service.d.ts +8 -0
  56. package/lib/logging/mcp-tool-call-log-retention.service.js +54 -0
  57. package/lib/logging/mcp-tool-call-log-retention.service.js.map +1 -0
  58. package/lib/logging/mcp-tool-call-log.service.d.ts +24 -0
  59. package/lib/logging/mcp-tool-call-log.service.js +128 -0
  60. package/lib/logging/mcp-tool-call-log.service.js.map +1 -0
  61. package/lib/oauth/cimd/cimd-client-resolver.service.d.ts +18 -0
  62. package/lib/oauth/cimd/cimd-client-resolver.service.js +109 -0
  63. package/lib/oauth/cimd/cimd-client-resolver.service.js.map +1 -0
  64. package/lib/oauth/cimd/cimd-document.d.ts +11 -0
  65. package/lib/oauth/cimd/cimd-document.js +66 -0
  66. package/lib/oauth/cimd/cimd-document.js.map +1 -0
  67. package/lib/oauth/cimd/cimd-fetch.d.ts +14 -0
  68. package/lib/oauth/cimd/cimd-fetch.js +192 -0
  69. package/lib/oauth/cimd/cimd-fetch.js.map +1 -0
  70. package/lib/oauth/cimd/cimd-url.d.ts +5 -0
  71. package/lib/oauth/cimd/cimd-url.js +94 -0
  72. package/lib/oauth/cimd/cimd-url.js.map +1 -0
  73. package/lib/oauth/grant-session.service.d.ts +19 -0
  74. package/lib/oauth/grant-session.service.js +141 -0
  75. package/lib/oauth/grant-session.service.js.map +1 -0
  76. package/lib/oauth/oauth-error.d.ts +18 -0
  77. package/lib/oauth/oauth-error.js +60 -0
  78. package/lib/oauth/oauth-error.js.map +1 -0
  79. package/lib/oauth/oauth-metadata.service.d.ts +34 -0
  80. package/lib/oauth/oauth-metadata.service.js +107 -0
  81. package/lib/oauth/oauth-metadata.service.js.map +1 -0
  82. package/lib/oauth/oauth-retention.service.d.ts +23 -0
  83. package/lib/oauth/oauth-retention.service.js +103 -0
  84. package/lib/oauth/oauth-retention.service.js.map +1 -0
  85. package/lib/oauth/oauth-types.d.ts +61 -0
  86. package/lib/oauth/oauth-types.js +32 -0
  87. package/lib/oauth/oauth-types.js.map +1 -0
  88. package/lib/oauth/oauth-utils.d.ts +20 -0
  89. package/lib/oauth/oauth-utils.js +111 -0
  90. package/lib/oauth/oauth-utils.js.map +1 -0
  91. package/lib/oauth/oauth.controller.d.ts +31 -0
  92. package/lib/oauth/oauth.controller.js +132 -0
  93. package/lib/oauth/oauth.controller.js.map +1 -0
  94. package/lib/oauth/oauth.service.d.ts +69 -0
  95. package/lib/oauth/oauth.service.js +650 -0
  96. package/lib/oauth/oauth.service.js.map +1 -0
  97. package/lib/oauth/token-hash.d.ts +6 -0
  98. package/lib/oauth/token-hash.js +21 -0
  99. package/lib/oauth/token-hash.js.map +1 -0
  100. package/lib/plugin.d.ts +54 -0
  101. package/lib/plugin.js +171 -0
  102. package/lib/plugin.js.map +1 -0
  103. package/lib/rate-limit/ip-bucket-key.d.ts +1 -0
  104. package/lib/rate-limit/ip-bucket-key.js +35 -0
  105. package/lib/rate-limit/ip-bucket-key.js.map +1 -0
  106. package/lib/rate-limit/mcp-oauth-rate-limit.guard.d.ts +20 -0
  107. package/lib/rate-limit/mcp-oauth-rate-limit.guard.js +63 -0
  108. package/lib/rate-limit/mcp-oauth-rate-limit.guard.js.map +1 -0
  109. package/lib/rate-limit/mcp-rate-limiter.service.d.ts +47 -0
  110. package/lib/rate-limit/mcp-rate-limiter.service.js +248 -0
  111. package/lib/rate-limit/mcp-rate-limiter.service.js.map +1 -0
  112. package/lib/registry/bm25.d.ts +12 -0
  113. package/lib/registry/bm25.js +60 -0
  114. package/lib/registry/bm25.js.map +1 -0
  115. package/lib/registry/mcp-tool-execution.service.d.ts +45 -0
  116. package/lib/registry/mcp-tool-execution.service.js +72 -0
  117. package/lib/registry/mcp-tool-execution.service.js.map +1 -0
  118. package/lib/registry/mcp-tool-registry.service.d.ts +89 -0
  119. package/lib/registry/mcp-tool-registry.service.js +668 -0
  120. package/lib/registry/mcp-tool-registry.service.js.map +1 -0
  121. package/lib/registry/mcp-tool-schema.service.d.ts +42 -0
  122. package/lib/registry/mcp-tool-schema.service.js +229 -0
  123. package/lib/registry/mcp-tool-schema.service.js.map +1 -0
  124. package/lib/registry/registry-types.d.ts +32 -0
  125. package/lib/registry/registry-types.js +3 -0
  126. package/lib/registry/registry-types.js.map +1 -0
  127. package/lib/resolve-options.d.ts +7 -0
  128. package/lib/resolve-options.js +85 -0
  129. package/lib/resolve-options.js.map +1 -0
  130. package/lib/shared/endpoint-paths.d.ts +8 -0
  131. package/lib/shared/endpoint-paths.js +12 -0
  132. package/lib/shared/endpoint-paths.js.map +1 -0
  133. package/lib/shared/loopback.d.ts +2 -0
  134. package/lib/shared/loopback.js +9 -0
  135. package/lib/shared/loopback.js.map +1 -0
  136. package/lib/shop-session/mcp-shop-session.service.d.ts +47 -0
  137. package/lib/shop-session/mcp-shop-session.service.js +132 -0
  138. package/lib/shop-session/mcp-shop-session.service.js.map +1 -0
  139. package/lib/tasks/mcp-oauth-retention.task.d.ts +9 -0
  140. package/lib/tasks/mcp-oauth-retention.task.js +21 -0
  141. package/lib/tasks/mcp-oauth-retention.task.js.map +1 -0
  142. package/lib/tasks/mcp-tool-call-log-retention.task.d.ts +7 -0
  143. package/lib/tasks/mcp-tool-call-log-retention.task.js +22 -0
  144. package/lib/tasks/mcp-tool-call-log-retention.task.js.map +1 -0
  145. package/lib/tools/built-in/active-order.service.d.ts +26 -0
  146. package/lib/tools/built-in/active-order.service.js +125 -0
  147. package/lib/tools/built-in/active-order.service.js.map +1 -0
  148. package/lib/tools/built-in/admin/add-customer-to-group.tool.d.ts +23 -0
  149. package/lib/tools/built-in/admin/add-customer-to-group.tool.js +68 -0
  150. package/lib/tools/built-in/admin/add-customer-to-group.tool.js.map +1 -0
  151. package/lib/tools/built-in/admin/add-note-to-order.tool.d.ts +104 -0
  152. package/lib/tools/built-in/admin/add-note-to-order.tool.js +66 -0
  153. package/lib/tools/built-in/admin/add-note-to-order.tool.js.map +1 -0
  154. package/lib/tools/built-in/admin/adjust-stock.tool.d.ts +26 -0
  155. package/lib/tools/built-in/admin/adjust-stock.tool.js +88 -0
  156. package/lib/tools/built-in/admin/adjust-stock.tool.js.map +1 -0
  157. package/lib/tools/built-in/admin/cancel-order.tool.d.ts +17 -0
  158. package/lib/tools/built-in/admin/cancel-order.tool.js +60 -0
  159. package/lib/tools/built-in/admin/cancel-order.tool.js.map +1 -0
  160. package/lib/tools/built-in/admin/channel-access.d.ts +2 -0
  161. package/lib/tools/built-in/admin/channel-access.js +9 -0
  162. package/lib/tools/built-in/admin/channel-access.js.map +1 -0
  163. package/lib/tools/built-in/admin/create-customer.tool.d.ts +41 -0
  164. package/lib/tools/built-in/admin/create-customer.tool.js +57 -0
  165. package/lib/tools/built-in/admin/create-customer.tool.js.map +1 -0
  166. package/lib/tools/built-in/admin/create-fulfillment.tool.d.ts +118 -0
  167. package/lib/tools/built-in/admin/create-fulfillment.tool.js +156 -0
  168. package/lib/tools/built-in/admin/create-fulfillment.tool.js.map +1 -0
  169. package/lib/tools/built-in/admin/create-product.tool.d.ts +52 -0
  170. package/lib/tools/built-in/admin/create-product.tool.js +61 -0
  171. package/lib/tools/built-in/admin/create-product.tool.js.map +1 -0
  172. package/lib/tools/built-in/admin/create-variant.tool.d.ts +48 -0
  173. package/lib/tools/built-in/admin/create-variant.tool.js +79 -0
  174. package/lib/tools/built-in/admin/create-variant.tool.js.map +1 -0
  175. package/lib/tools/built-in/admin/entity-field-schemas.d.ts +36 -0
  176. package/lib/tools/built-in/admin/entity-field-schemas.js +63 -0
  177. package/lib/tools/built-in/admin/entity-field-schemas.js.map +1 -0
  178. package/lib/tools/built-in/admin/get-customer.tool.d.ts +28 -0
  179. package/lib/tools/built-in/admin/get-customer.tool.js +55 -0
  180. package/lib/tools/built-in/admin/get-customer.tool.js.map +1 -0
  181. package/lib/tools/built-in/admin/get-order.tool.d.ts +100 -0
  182. package/lib/tools/built-in/admin/get-order.tool.js +68 -0
  183. package/lib/tools/built-in/admin/get-order.tool.js.map +1 -0
  184. package/lib/tools/built-in/admin/get-product.tool.d.ts +69 -0
  185. package/lib/tools/built-in/admin/get-product.tool.js +77 -0
  186. package/lib/tools/built-in/admin/get-product.tool.js.map +1 -0
  187. package/lib/tools/built-in/admin/get-stock-levels.tool.d.ts +23 -0
  188. package/lib/tools/built-in/admin/get-stock-levels.tool.js +61 -0
  189. package/lib/tools/built-in/admin/get-stock-levels.tool.js.map +1 -0
  190. package/lib/tools/built-in/admin/index.d.ts +25 -0
  191. package/lib/tools/built-in/admin/index.js +54 -0
  192. package/lib/tools/built-in/admin/index.js.map +1 -0
  193. package/lib/tools/built-in/admin/list-channels.tool.d.ts +24 -0
  194. package/lib/tools/built-in/admin/list-channels.tool.js +56 -0
  195. package/lib/tools/built-in/admin/list-channels.tool.js.map +1 -0
  196. package/lib/tools/built-in/admin/list-customer-groups.tool.d.ts +23 -0
  197. package/lib/tools/built-in/admin/list-customer-groups.tool.js +52 -0
  198. package/lib/tools/built-in/admin/list-customer-groups.tool.js.map +1 -0
  199. package/lib/tools/built-in/admin/list-customers.tool.d.ts +62 -0
  200. package/lib/tools/built-in/admin/list-customers.tool.js +66 -0
  201. package/lib/tools/built-in/admin/list-customers.tool.js.map +1 -0
  202. package/lib/tools/built-in/admin/list-orders.tool.d.ts +142 -0
  203. package/lib/tools/built-in/admin/list-orders.tool.js +87 -0
  204. package/lib/tools/built-in/admin/list-orders.tool.js.map +1 -0
  205. package/lib/tools/built-in/admin/list-products.tool.d.ts +63 -0
  206. package/lib/tools/built-in/admin/list-products.tool.js +71 -0
  207. package/lib/tools/built-in/admin/list-products.tool.js.map +1 -0
  208. package/lib/tools/built-in/admin/refund-order.tool.d.ts +38 -0
  209. package/lib/tools/built-in/admin/refund-order.tool.js +115 -0
  210. package/lib/tools/built-in/admin/refund-order.tool.js.map +1 -0
  211. package/lib/tools/built-in/admin/set-active-channel.tool.d.ts +22 -0
  212. package/lib/tools/built-in/admin/set-active-channel.tool.js +84 -0
  213. package/lib/tools/built-in/admin/set-active-channel.tool.js.map +1 -0
  214. package/lib/tools/built-in/admin/translation-schemas.d.ts +12 -0
  215. package/lib/tools/built-in/admin/translation-schemas.js +17 -0
  216. package/lib/tools/built-in/admin/translation-schemas.js.map +1 -0
  217. package/lib/tools/built-in/admin/update-customer.tool.d.ts +42 -0
  218. package/lib/tools/built-in/admin/update-customer.tool.js +59 -0
  219. package/lib/tools/built-in/admin/update-customer.tool.js.map +1 -0
  220. package/lib/tools/built-in/admin/update-order-state.tool.d.ts +16 -0
  221. package/lib/tools/built-in/admin/update-order-state.tool.js +58 -0
  222. package/lib/tools/built-in/admin/update-order-state.tool.js.map +1 -0
  223. package/lib/tools/built-in/admin/update-product.tool.d.ts +53 -0
  224. package/lib/tools/built-in/admin/update-product.tool.js +68 -0
  225. package/lib/tools/built-in/admin/update-product.tool.js.map +1 -0
  226. package/lib/tools/built-in/admin/update-variant.tool.d.ts +46 -0
  227. package/lib/tools/built-in/admin/update-variant.tool.js +77 -0
  228. package/lib/tools/built-in/admin/update-variant.tool.js.map +1 -0
  229. package/lib/tools/built-in/admin/upload-asset.tool.d.ts +32 -0
  230. package/lib/tools/built-in/admin/upload-asset.tool.js +56 -0
  231. package/lib/tools/built-in/admin/upload-asset.tool.js.map +1 -0
  232. package/lib/tools/built-in/catalog-query.service.d.ts +21 -0
  233. package/lib/tools/built-in/catalog-query.service.js +128 -0
  234. package/lib/tools/built-in/catalog-query.service.js.map +1 -0
  235. package/lib/tools/built-in/custom-field-input.service.d.ts +10 -0
  236. package/lib/tools/built-in/custom-field-input.service.js +64 -0
  237. package/lib/tools/built-in/custom-field-input.service.js.map +1 -0
  238. package/lib/tools/built-in/email-schema.d.ts +2 -0
  239. package/lib/tools/built-in/email-schema.js +12 -0
  240. package/lib/tools/built-in/email-schema.js.map +1 -0
  241. package/lib/tools/built-in/id-schema.d.ts +3 -0
  242. package/lib/tools/built-in/id-schema.js +11 -0
  243. package/lib/tools/built-in/id-schema.js.map +1 -0
  244. package/lib/tools/built-in/int32-schema.d.ts +4 -0
  245. package/lib/tools/built-in/int32-schema.js +8 -0
  246. package/lib/tools/built-in/int32-schema.js.map +1 -0
  247. package/lib/tools/built-in/list-helpers.d.ts +48 -0
  248. package/lib/tools/built-in/list-helpers.js +76 -0
  249. package/lib/tools/built-in/list-helpers.js.map +1 -0
  250. package/lib/tools/built-in/order-list-helpers.d.ts +20 -0
  251. package/lib/tools/built-in/order-list-helpers.js +48 -0
  252. package/lib/tools/built-in/order-list-helpers.js.map +1 -0
  253. package/lib/tools/built-in/providers.d.ts +2 -0
  254. package/lib/tools/built-in/providers.js +7 -0
  255. package/lib/tools/built-in/providers.js.map +1 -0
  256. package/lib/tools/built-in/remote-asset.d.ts +4 -0
  257. package/lib/tools/built-in/remote-asset.js +54 -0
  258. package/lib/tools/built-in/remote-asset.js.map +1 -0
  259. package/lib/tools/built-in/serializer.service.d.ts +327 -0
  260. package/lib/tools/built-in/serializer.service.js +413 -0
  261. package/lib/tools/built-in/serializer.service.js.map +1 -0
  262. package/lib/tools/built-in/shop/add-to-cart.tool.d.ts +21 -0
  263. package/lib/tools/built-in/shop/add-to-cart.tool.js +100 -0
  264. package/lib/tools/built-in/shop/add-to-cart.tool.js.map +1 -0
  265. package/lib/tools/built-in/shop/address-schema.d.ts +15 -0
  266. package/lib/tools/built-in/shop/address-schema.js +20 -0
  267. package/lib/tools/built-in/shop/address-schema.js.map +1 -0
  268. package/lib/tools/built-in/shop/apply-coupon-code.tool.d.ts +17 -0
  269. package/lib/tools/built-in/shop/apply-coupon-code.tool.js +62 -0
  270. package/lib/tools/built-in/shop/apply-coupon-code.tool.js.map +1 -0
  271. package/lib/tools/built-in/shop/collection-lookup.d.ts +15 -0
  272. package/lib/tools/built-in/shop/collection-lookup.js +35 -0
  273. package/lib/tools/built-in/shop/collection-lookup.js.map +1 -0
  274. package/lib/tools/built-in/shop/get-cart.tool.d.ts +94 -0
  275. package/lib/tools/built-in/shop/get-cart.tool.js +55 -0
  276. package/lib/tools/built-in/shop/get-cart.tool.js.map +1 -0
  277. package/lib/tools/built-in/shop/get-collection.tool.d.ts +42 -0
  278. package/lib/tools/built-in/shop/get-collection.tool.js +64 -0
  279. package/lib/tools/built-in/shop/get-collection.tool.js.map +1 -0
  280. package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.d.ts +26 -0
  281. package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js +58 -0
  282. package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js.map +1 -0
  283. package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.d.ts +30 -0
  284. package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js +59 -0
  285. package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js.map +1 -0
  286. package/lib/tools/built-in/shop/get-my-account.tool.d.ts +22 -0
  287. package/lib/tools/built-in/shop/get-my-account.tool.js +57 -0
  288. package/lib/tools/built-in/shop/get-my-account.tool.js.map +1 -0
  289. package/lib/tools/built-in/shop/get-order.tool.d.ts +100 -0
  290. package/lib/tools/built-in/shop/get-order.tool.js +67 -0
  291. package/lib/tools/built-in/shop/get-order.tool.js.map +1 -0
  292. package/lib/tools/built-in/shop/get-product.tool.d.ts +57 -0
  293. package/lib/tools/built-in/shop/get-product.tool.js +81 -0
  294. package/lib/tools/built-in/shop/get-product.tool.js.map +1 -0
  295. package/lib/tools/built-in/shop/index.d.ts +19 -0
  296. package/lib/tools/built-in/shop/index.js +42 -0
  297. package/lib/tools/built-in/shop/index.js.map +1 -0
  298. package/lib/tools/built-in/shop/list-collections.tool.d.ts +42 -0
  299. package/lib/tools/built-in/shop/list-collections.tool.js +75 -0
  300. package/lib/tools/built-in/shop/list-collections.tool.js.map +1 -0
  301. package/lib/tools/built-in/shop/list-my-orders.tool.d.ts +100 -0
  302. package/lib/tools/built-in/shop/list-my-orders.tool.js +63 -0
  303. package/lib/tools/built-in/shop/list-my-orders.tool.js.map +1 -0
  304. package/lib/tools/built-in/shop/place-order.tool.d.ts +188 -0
  305. package/lib/tools/built-in/shop/place-order.tool.js +152 -0
  306. package/lib/tools/built-in/shop/place-order.tool.js.map +1 -0
  307. package/lib/tools/built-in/shop/product-search-query.d.ts +4 -0
  308. package/lib/tools/built-in/shop/product-search-query.js +34 -0
  309. package/lib/tools/built-in/shop/product-search-query.js.map +1 -0
  310. package/lib/tools/built-in/shop/remove-coupon-code.tool.d.ts +17 -0
  311. package/lib/tools/built-in/shop/remove-coupon-code.tool.js +63 -0
  312. package/lib/tools/built-in/shop/remove-coupon-code.tool.js.map +1 -0
  313. package/lib/tools/built-in/shop/remove-from-cart.tool.d.ts +17 -0
  314. package/lib/tools/built-in/shop/remove-from-cart.tool.js +58 -0
  315. package/lib/tools/built-in/shop/remove-from-cart.tool.js.map +1 -0
  316. package/lib/tools/built-in/shop/search-products.tool.d.ts +48 -0
  317. package/lib/tools/built-in/shop/search-products.tool.js +95 -0
  318. package/lib/tools/built-in/shop/search-products.tool.js.map +1 -0
  319. package/lib/tools/built-in/shop/set-checkout-details.tool.d.ts +56 -0
  320. package/lib/tools/built-in/shop/set-checkout-details.tool.js +187 -0
  321. package/lib/tools/built-in/shop/set-checkout-details.tool.js.map +1 -0
  322. package/lib/tools/built-in/shop/set-shipping-method.tool.d.ts +17 -0
  323. package/lib/tools/built-in/shop/set-shipping-method.tool.js +58 -0
  324. package/lib/tools/built-in/shop/set-shipping-method.tool.js.map +1 -0
  325. package/lib/tools/built-in/shop/update-cart-line.tool.d.ts +18 -0
  326. package/lib/tools/built-in/shop/update-cart-line.tool.js +60 -0
  327. package/lib/tools/built-in/shop/update-cart-line.tool.js.map +1 -0
  328. package/lib/tools/built-in/string-schemas.d.ts +4 -0
  329. package/lib/tools/built-in/string-schemas.js +13 -0
  330. package/lib/tools/built-in/string-schemas.js.map +1 -0
  331. package/lib/transport/mcp-server.factory.d.ts +13 -0
  332. package/lib/transport/mcp-server.factory.js +32 -0
  333. package/lib/transport/mcp-server.factory.js.map +1 -0
  334. package/lib/transport/mcp-transport.controller.d.ts +77 -0
  335. package/lib/transport/mcp-transport.controller.js +442 -0
  336. package/lib/transport/mcp-transport.controller.js.map +1 -0
  337. package/lib/types.d.ts +432 -0
  338. package/lib/types.js +3 -0
  339. package/lib/types.js.map +1 -0
  340. package/package.json +42 -0
  341. package/src/dashboard/components/activity-block.tsx +72 -0
  342. package/src/dashboard/components/actor-cell.tsx +31 -0
  343. package/src/dashboard/components/connection-dialog.tsx +106 -0
  344. package/src/dashboard/components/empty-cell.tsx +7 -0
  345. package/src/dashboard/components/grants-block.tsx +218 -0
  346. package/src/dashboard/components/stats-block.tsx +275 -0
  347. package/src/dashboard/components/tools-block.tsx +274 -0
  348. package/src/dashboard/components/tooltip-button.tsx +28 -0
  349. package/src/dashboard/components/use-mcp-table-state.ts +47 -0
  350. package/src/dashboard/i18n/ar.po +311 -0
  351. package/src/dashboard/i18n/bg.po +311 -0
  352. package/src/dashboard/i18n/cs.po +311 -0
  353. package/src/dashboard/i18n/de.po +311 -0
  354. package/src/dashboard/i18n/en.po +311 -0
  355. package/src/dashboard/i18n/es.po +311 -0
  356. package/src/dashboard/i18n/fa.po +311 -0
  357. package/src/dashboard/i18n/fr.po +311 -0
  358. package/src/dashboard/i18n/he.po +311 -0
  359. package/src/dashboard/i18n/hr.po +311 -0
  360. package/src/dashboard/i18n/hu.po +311 -0
  361. package/src/dashboard/i18n/it.po +311 -0
  362. package/src/dashboard/i18n/ja.po +311 -0
  363. package/src/dashboard/i18n/ko.po +311 -0
  364. package/src/dashboard/i18n/nb.po +311 -0
  365. package/src/dashboard/i18n/ne.po +311 -0
  366. package/src/dashboard/i18n/nl.po +311 -0
  367. package/src/dashboard/i18n/pl.po +311 -0
  368. package/src/dashboard/i18n/pt_BR.po +311 -0
  369. package/src/dashboard/i18n/pt_PT.po +311 -0
  370. package/src/dashboard/i18n/ro.po +311 -0
  371. package/src/dashboard/i18n/ru.po +311 -0
  372. package/src/dashboard/i18n/sv.po +311 -0
  373. package/src/dashboard/i18n/tr.po +311 -0
  374. package/src/dashboard/i18n/uk.po +311 -0
  375. package/src/dashboard/i18n/uz.po +311 -0
  376. package/src/dashboard/i18n/zh_Hans.po +311 -0
  377. package/src/dashboard/i18n/zh_Hant.po +311 -0
  378. package/src/dashboard/index.tsx +30 -0
  379. package/src/dashboard/mcp-activity-route.tsx +38 -0
  380. package/src/dashboard/mcp-authorize-route.tsx +369 -0
  381. package/src/dashboard/mcp-grants-route.tsx +38 -0
  382. package/src/dashboard/mcp-overview-route.tsx +46 -0
  383. package/src/dashboard/mcp-server-redirect-route.tsx +15 -0
  384. package/src/dashboard/mcp-tools-route.tsx +38 -0
  385. package/src/dashboard/mcp.graphql.ts +127 -0
  386. package/src/dashboard/published-files.spec.ts +54 -0
  387. package/src/dashboard/tsconfig.json +9 -0
  388. package/src/shared/endpoint-paths.ts +8 -0
  389. package/src/shared/loopback.ts +6 -0
@@ -0,0 +1,70 @@
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.McpOauthClient = void 0;
13
+ const core_1 = require("@vendure/core");
14
+ const typeorm_1 = require("typeorm");
15
+ /**
16
+ * @description
17
+ * Metadata for an MCP client registered via OAuth Dynamic Client Registration, or resolved
18
+ * from a Client ID Metadata Document (CIMD) URL.
19
+ *
20
+ * @docsCategory core plugins/McpPlugin
21
+ * @since 3.8.0
22
+ */
23
+ let McpOauthClient = class McpOauthClient extends core_1.VendureEntity {
24
+ constructor(input) {
25
+ super(input);
26
+ }
27
+ };
28
+ exports.McpOauthClient = McpOauthClient;
29
+ __decorate([
30
+ (0, typeorm_1.Index)({ unique: true }),
31
+ (0, typeorm_1.Column)({ length: 512 }),
32
+ __metadata("design:type", String)
33
+ ], McpOauthClient.prototype, "clientId", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)(),
36
+ __metadata("design:type", String)
37
+ ], McpOauthClient.prototype, "clientName", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], McpOauthClient.prototype, "clientUri", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
44
+ __metadata("design:type", Object)
45
+ ], McpOauthClient.prototype, "logoUri", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'simple-json' }),
48
+ __metadata("design:type", Array)
49
+ ], McpOauthClient.prototype, "redirectUris", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: 'simple-json' }),
52
+ __metadata("design:type", Array)
53
+ ], McpOauthClient.prototype, "grantTypes", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ default: 'none' }),
56
+ __metadata("design:type", String)
57
+ ], McpOauthClient.prototype, "tokenEndpointAuthMethod", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: Date, nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], McpOauthClient.prototype, "cimdDocumentExpiresAt", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({ type: Date, nullable: true }),
64
+ __metadata("design:type", Object)
65
+ ], McpOauthClient.prototype, "lastUsedAt", void 0);
66
+ exports.McpOauthClient = McpOauthClient = __decorate([
67
+ (0, typeorm_1.Entity)(),
68
+ __metadata("design:paramtypes", [Object])
69
+ ], McpOauthClient);
70
+ //# sourceMappingURL=mcp-oauth-client.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-oauth-client.entity.js","sourceRoot":"","sources":["../../src/entities/mcp-oauth-client.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAA2D;AAC3D,qCAAgD;AAEhD;;;;;;;GAOG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,oBAAa;IAC7C,YAAY,KAAmC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAgEJ,CAAA;AAnEY,wCAAc;AAWvB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;gDACP;AAQjB;IADC,IAAA,gBAAM,GAAE;;kDACU;AAQnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACnB;AAOzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACrB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;oDACT;AAQvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;kDACX;AAUrB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;+DACI;AAQhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACJ;AAGnC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACf;yBAlEf,cAAc;IAD1B,IAAA,gBAAM,GAAE;;GACI,cAAc,CAmE1B"}
@@ -0,0 +1,77 @@
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
+ * The three states a grant can be in. Their alphabetical order is also their
7
+ * lifecycle order, so sorting by status ascending runs active, expired, revoked.
8
+ *
9
+ * @docsCategory core plugins/McpPlugin
10
+ * @since 3.8.0
11
+ */
12
+ export type McpOauthGrantStatus = 'active' | 'expired' | 'revoked';
13
+ /**
14
+ * @description
15
+ * Represents one MCP OAuth grant: the hashed access + refresh token pair issued to a
16
+ * client, the granting user, and the dedicated Vendure session created for the grant.
17
+ *
18
+ * @docsCategory core plugins/McpPlugin
19
+ * @since 3.8.0
20
+ */
21
+ export declare class McpOauthGrant extends VendureEntity {
22
+ constructor(input?: DeepPartial<McpOauthGrant>);
23
+ /**
24
+ * @description
25
+ * A hash of the access token, which is how a request finds its grant. The token itself is
26
+ * never stored, and every refresh replaces this hash.
27
+ */
28
+ accessTokenHash: string;
29
+ /**
30
+ * @description
31
+ * A hash of the refresh token. The token itself is never stored, and every refresh replaces
32
+ * this hash.
33
+ */
34
+ refreshTokenHash: string;
35
+ /**
36
+ * @description
37
+ * A hash of the refresh token the last refresh replaced. Null until the first refresh. If a
38
+ * client presents this old token, the server assumes it was stolen and revokes the grant.
39
+ */
40
+ previousRefreshTokenHash: string | null;
41
+ oauthClient: McpOauthClient;
42
+ oauthClientId: ID;
43
+ /**
44
+ * @description
45
+ * The user who approved this grant. Tool calls made with it run as that user.
46
+ */
47
+ actorId: ID;
48
+ /**
49
+ * @description
50
+ * Whether an administrator or a customer approved this grant. It also decides which MCP
51
+ * endpoint the grant's tokens may call.
52
+ */
53
+ actorType: McpGrantUserType;
54
+ /**
55
+ * @description
56
+ * The one endpoint these tokens work against: the issuer URL plus `/mcp/admin` or
57
+ * `/mcp/shop`. Presenting a token anywhere else is refused.
58
+ */
59
+ resource: string;
60
+ accessTokenExpiresAt: Date;
61
+ expiresAt: Date;
62
+ revokedAt: Date | null;
63
+ /**
64
+ * @description
65
+ * The Vendure session this grant's tool calls run in. Revoking the grant deletes that
66
+ * session, and so does the cleanup job once the grant has expired.
67
+ */
68
+ vendureSessionId: ID;
69
+ channelId: ID | null;
70
+ lastActivityAt: Date;
71
+ /**
72
+ * @description
73
+ * Worked out on read rather than stored, so it is always current without anything having to
74
+ * update it.
75
+ */
76
+ get status(): McpOauthGrantStatus;
77
+ }
@@ -0,0 +1,121 @@
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.McpOauthGrant = void 0;
13
+ const core_1 = require("@vendure/core");
14
+ const typeorm_1 = require("typeorm");
15
+ const DateUtils_1 = require("typeorm/util/DateUtils");
16
+ const mcp_oauth_client_entity_1 = require("./mcp-oauth-client.entity");
17
+ /**
18
+ * @description
19
+ * Represents one MCP OAuth grant: the hashed access + refresh token pair issued to a
20
+ * client, the granting user, and the dedicated Vendure session created for the grant.
21
+ *
22
+ * @docsCategory core plugins/McpPlugin
23
+ * @since 3.8.0
24
+ */
25
+ let McpOauthGrant = class McpOauthGrant extends core_1.VendureEntity {
26
+ constructor(input) {
27
+ super(input);
28
+ }
29
+ /**
30
+ * @description
31
+ * Worked out on read rather than stored, so it is always current without anything having to
32
+ * update it.
33
+ */
34
+ get status() {
35
+ if (this.revokedAt != null) {
36
+ return 'revoked';
37
+ }
38
+ return this.expiresAt.getTime() <= Date.now() ? 'expired' : 'active';
39
+ }
40
+ };
41
+ exports.McpOauthGrant = McpOauthGrant;
42
+ __decorate([
43
+ (0, typeorm_1.Index)({ unique: true }),
44
+ (0, typeorm_1.Column)(),
45
+ __metadata("design:type", String)
46
+ ], McpOauthGrant.prototype, "accessTokenHash", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Index)({ unique: true }),
49
+ (0, typeorm_1.Column)(),
50
+ __metadata("design:type", String)
51
+ ], McpOauthGrant.prototype, "refreshTokenHash", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Index)(),
54
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], McpOauthGrant.prototype, "previousRefreshTokenHash", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Index)(),
59
+ (0, typeorm_1.ManyToOne)(() => mcp_oauth_client_entity_1.McpOauthClient, { onDelete: 'CASCADE' }),
60
+ __metadata("design:type", mcp_oauth_client_entity_1.McpOauthClient)
61
+ ], McpOauthGrant.prototype, "oauthClient", void 0);
62
+ __decorate([
63
+ (0, core_1.EntityId)(),
64
+ __metadata("design:type", Object)
65
+ ], McpOauthGrant.prototype, "oauthClientId", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.Index)(),
68
+ (0, core_1.EntityId)(),
69
+ __metadata("design:type", Object)
70
+ ], McpOauthGrant.prototype, "actorId", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)({ type: 'varchar' }),
73
+ __metadata("design:type", String)
74
+ ], McpOauthGrant.prototype, "actorType", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Column)(),
77
+ __metadata("design:type", String)
78
+ ], McpOauthGrant.prototype, "resource", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.Index)(),
81
+ (0, typeorm_1.Column)({ type: Date }),
82
+ __metadata("design:type", Date)
83
+ ], McpOauthGrant.prototype, "accessTokenExpiresAt", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Index)(),
86
+ (0, typeorm_1.Column)({ type: Date }),
87
+ __metadata("design:type", Date)
88
+ ], McpOauthGrant.prototype, "expiresAt", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.Index)(),
91
+ (0, typeorm_1.Column)({ type: Date, nullable: true }),
92
+ __metadata("design:type", Object)
93
+ ], McpOauthGrant.prototype, "revokedAt", void 0);
94
+ __decorate([
95
+ (0, typeorm_1.Index)(),
96
+ (0, core_1.EntityId)(),
97
+ __metadata("design:type", Object)
98
+ ], McpOauthGrant.prototype, "vendureSessionId", void 0);
99
+ __decorate([
100
+ (0, typeorm_1.Index)(),
101
+ (0, core_1.EntityId)({ nullable: true }),
102
+ __metadata("design:type", Object)
103
+ ], McpOauthGrant.prototype, "channelId", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.Index)(),
106
+ (0, typeorm_1.Column)({ type: Date }),
107
+ __metadata("design:type", Date)
108
+ ], McpOauthGrant.prototype, "lastActivityAt", void 0);
109
+ __decorate([
110
+ (0, core_1.Calculated)({
111
+ query: qb => qb.setParameter('grant_status_now', DateUtils_1.DateUtils.mixedDateToUtcDatetimeString(new Date())),
112
+ expression: `CASE WHEN mcpoauthgrant.revokedAt IS NOT NULL THEN 'revoked' WHEN mcpoauthgrant.expiresAt <= :grant_status_now THEN 'expired' ELSE 'active' END`,
113
+ }),
114
+ __metadata("design:type", String),
115
+ __metadata("design:paramtypes", [])
116
+ ], McpOauthGrant.prototype, "status", null);
117
+ exports.McpOauthGrant = McpOauthGrant = __decorate([
118
+ (0, typeorm_1.Entity)(),
119
+ __metadata("design:paramtypes", [Object])
120
+ ], McpOauthGrant);
121
+ //# sourceMappingURL=mcp-oauth-grant.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-oauth-grant.entity.js","sourceRoot":"","sources":["../../src/entities/mcp-oauth-grant.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAqF;AACrF,qCAA2D;AAC3D,sDAAmD;AAInD,uEAA2D;AAY3D;;;;;;;GAOG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,oBAAa;IAC5C,YAAY,KAAkC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAyFD;;;;OAIG;IACH,IAII,MAAM;QACN,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YACzB,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACzE,CAAC;CACJ,CAAA;AA3GY,sCAAa;AAYtB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;sDACe;AASxB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;uDACgB;AASzB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DACJ;AAIxC;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wCAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BAC5C,wCAAc;kDAAC;AAG5B;IADC,IAAA,eAAQ,GAAE;;oDACO;AAQlB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,eAAQ,GAAE;;8CACC;AAQZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;gDACA;AAQ5B;IADC,IAAA,gBAAM,GAAE;;+CACQ;AAIjB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACD,IAAI;2DAAC;AAI3B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;gDAAC;AAIhB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChB;AASvB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,eAAQ,GAAE;;uDACU;AAIrB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACR;AAIrB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACP,IAAI;qDAAC;AAOrB;IAAC,IAAA,iBAAU,EAAC;QACR,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE,qBAAS,CAAC,4BAA4B,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACpG,UAAU,EAAE,iJAAiJ;KAChK,CAAC;;;2CAMD;wBA1GQ,aAAa;IADzB,IAAA,gBAAM,GAAE;;GACI,aAAa,CA2GzB"}
@@ -0,0 +1,50 @@
1
+ import { DeepPartial, ID, VendureEntity } from '@vendure/core';
2
+ import { McpActorType, McpToolCallStatus } from '../types';
3
+ import { McpOauthClient } from './mcp-oauth-client.entity';
4
+ import { McpOauthGrant } from './mcp-oauth-grant.entity';
5
+ /**
6
+ * @description
7
+ * Audit record of a single MCP tool call.
8
+ *
9
+ * A row exists only for a call that actually ran the tool. Calls turned away first, by a rate
10
+ * limit, a permission check, an unknown or switched-off tool, bad arguments, or a confirmation
11
+ * request, leave no trace here.
12
+ *
13
+ * @docsCategory core plugins/McpPlugin
14
+ * @since 3.8.0
15
+ */
16
+ export declare class McpToolCallLog extends VendureEntity {
17
+ constructor(input?: DeepPartial<McpToolCallLog>);
18
+ /**
19
+ * @description
20
+ * Null when the call did not arrive over OAuth, and set back to null if the cleanup job
21
+ * later deletes the grant.
22
+ */
23
+ grant: McpOauthGrant | null;
24
+ grantId: ID | null;
25
+ /**
26
+ * @description
27
+ * Id of the user the call ran as. Null when nobody was signed in.
28
+ */
29
+ actor: string | null;
30
+ actorType: McpActorType;
31
+ /**
32
+ * @description
33
+ * Null unless `logging.captureClientIp` is on, and null for calls that never came over HTTP.
34
+ * The Admin API also hides it from anyone without the `ReadCustomer` permission.
35
+ */
36
+ clientIp: string | null;
37
+ channelId: ID | null;
38
+ toolName: string;
39
+ /**
40
+ * @description
41
+ * The plugin that registered the tool, or `unknown` if it could not be traced back to one.
42
+ */
43
+ pluginSource: string | null;
44
+ input: unknown;
45
+ output: unknown;
46
+ durationMs: number | null;
47
+ status: McpToolCallStatus;
48
+ oauthClient: McpOauthClient | null;
49
+ oauthClientId: ID | null;
50
+ }
@@ -0,0 +1,101 @@
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.McpToolCallLog = 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
+ const mcp_oauth_grant_entity_1 = require("./mcp-oauth-grant.entity");
17
+ /**
18
+ * @description
19
+ * Audit record of a single MCP tool call.
20
+ *
21
+ * A row exists only for a call that actually ran the tool. Calls turned away first, by a rate
22
+ * limit, a permission check, an unknown or switched-off tool, bad arguments, or a confirmation
23
+ * request, leave no trace here.
24
+ *
25
+ * @docsCategory core plugins/McpPlugin
26
+ * @since 3.8.0
27
+ */
28
+ let McpToolCallLog = class McpToolCallLog extends core_1.VendureEntity {
29
+ constructor(input) {
30
+ super(input);
31
+ }
32
+ };
33
+ exports.McpToolCallLog = McpToolCallLog;
34
+ __decorate([
35
+ (0, typeorm_1.Index)(),
36
+ (0, typeorm_1.ManyToOne)(() => mcp_oauth_grant_entity_1.McpOauthGrant, { nullable: true, onDelete: 'SET NULL' }),
37
+ __metadata("design:type", Object)
38
+ ], McpToolCallLog.prototype, "grant", void 0);
39
+ __decorate([
40
+ (0, core_1.EntityId)({ nullable: true }),
41
+ __metadata("design:type", Object)
42
+ ], McpToolCallLog.prototype, "grantId", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
45
+ __metadata("design:type", Object)
46
+ ], McpToolCallLog.prototype, "actor", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'varchar' }),
49
+ __metadata("design:type", String)
50
+ ], McpToolCallLog.prototype, "actorType", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
53
+ __metadata("design:type", Object)
54
+ ], McpToolCallLog.prototype, "clientIp", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Index)(),
57
+ (0, core_1.EntityId)({ nullable: true }),
58
+ __metadata("design:type", Object)
59
+ ], McpToolCallLog.prototype, "channelId", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Index)(),
62
+ (0, typeorm_1.Column)(),
63
+ __metadata("design:type", String)
64
+ ], McpToolCallLog.prototype, "toolName", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
67
+ __metadata("design:type", Object)
68
+ ], McpToolCallLog.prototype, "pluginSource", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
71
+ __metadata("design:type", Object)
72
+ ], McpToolCallLog.prototype, "input", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
75
+ __metadata("design:type", Object)
76
+ ], McpToolCallLog.prototype, "output", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Index)(),
79
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
80
+ __metadata("design:type", Object)
81
+ ], McpToolCallLog.prototype, "durationMs", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.Index)(),
84
+ (0, typeorm_1.Column)({ type: 'varchar' }),
85
+ __metadata("design:type", String)
86
+ ], McpToolCallLog.prototype, "status", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.Index)(),
89
+ (0, typeorm_1.ManyToOne)(() => mcp_oauth_client_entity_1.McpOauthClient, { nullable: true, onDelete: 'SET NULL' }),
90
+ __metadata("design:type", Object)
91
+ ], McpToolCallLog.prototype, "oauthClient", void 0);
92
+ __decorate([
93
+ (0, core_1.EntityId)({ nullable: true }),
94
+ __metadata("design:type", Object)
95
+ ], McpToolCallLog.prototype, "oauthClientId", void 0);
96
+ exports.McpToolCallLog = McpToolCallLog = __decorate([
97
+ (0, typeorm_1.Index)(['createdAt']),
98
+ (0, typeorm_1.Entity)(),
99
+ __metadata("design:paramtypes", [Object])
100
+ ], McpToolCallLog);
101
+ //# sourceMappingURL=mcp-tool-call-log.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool-call-log.entity.js","sourceRoot":"","sources":["../../src/entities/mcp-tool-call-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAyE;AACzE,qCAA2D;AAI3D,uEAA2D;AAC3D,qEAAyD;AAEzD;;;;;;;;;;GAUG;AAGI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,oBAAa;IAC7C,YAAY,KAAmC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAmEJ,CAAA;AAtEY,wCAAc;AAYvB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sCAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;;6CAC7C;AAG5B;IADC,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAOnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACvB;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;iDACJ;AAQxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACpB;AAIxB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACR;AAIrB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,GAAE;;gDACQ;AAOjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAChB;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACjC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAChC;AAIhB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACd;AAI1B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;8CACF;AAI1B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wCAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;;mDACvC;AAGnC;IADC,IAAA,eAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACJ;yBArEhB,cAAc;IAF1B,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;IACpB,IAAA,gBAAM,GAAE;;GACI,cAAc,CAsE1B"}
@@ -0,0 +1,17 @@
1
+ import { RequestContext, VendureEvent } from '@vendure/core';
2
+ import { McpToolCallLog } from '../entities/mcp-tool-call-log.entity';
3
+ /**
4
+ * @description
5
+ * Fired after a tool call is executed and its log entry is saved.
6
+ *
7
+ * Carries the request context and the persisted log entry.
8
+ * Only emitted for calls that actually ran.
9
+ *
10
+ * @docsCategory core plugins/McpPlugin
11
+ * @since 3.8.0
12
+ */
13
+ export declare class McpToolCallEvent extends VendureEvent {
14
+ ctx: RequestContext;
15
+ entry: McpToolCallLog;
16
+ constructor(ctx: RequestContext, entry: McpToolCallLog);
17
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.McpToolCallEvent = void 0;
4
+ const core_1 = require("@vendure/core");
5
+ /**
6
+ * @description
7
+ * Fired after a tool call is executed and its log entry is saved.
8
+ *
9
+ * Carries the request context and the persisted log entry.
10
+ * Only emitted for calls that actually ran.
11
+ *
12
+ * @docsCategory core plugins/McpPlugin
13
+ * @since 3.8.0
14
+ */
15
+ class McpToolCallEvent extends core_1.VendureEvent {
16
+ constructor(ctx, entry) {
17
+ super();
18
+ this.ctx = ctx;
19
+ this.entry = entry;
20
+ }
21
+ }
22
+ exports.McpToolCallEvent = McpToolCallEvent;
23
+ //# sourceMappingURL=mcp-tool-call.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tool-call.event.js","sourceRoot":"","sources":["../../src/events/mcp-tool-call.event.ts"],"names":[],"mappings":";;;AAAA,wCAA6D;AAI7D;;;;;;;;;GASG;AACH,MAAa,gBAAiB,SAAQ,mBAAY;IAC9C,YACW,GAAmB,EACnB,KAAqB;QAE5B,KAAK,EAAE,CAAC;QAHD,QAAG,GAAH,GAAG,CAAgB;QACnB,UAAK,GAAL,KAAK,CAAgB;IAGhC,CAAC;CACJ;AAPD,4CAOC"}
@@ -0,0 +1,2 @@
1
+ import type { Request } from 'express';
2
+ export declare function getClientIp(req: Request): string | undefined;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getClientIp = getClientIp;
4
+ const node_net_1 = require("node:net");
5
+ function getClientIp(req) {
6
+ var _a, _b;
7
+ const value = (_a = req.ip) !== null && _a !== void 0 ? _a : (_b = req.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress;
8
+ return value != null && (0, node_net_1.isIP)(value) !== 0 ? value : undefined;
9
+ }
10
+ //# sourceMappingURL=get-client-ip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-client-ip.js","sourceRoot":"","sources":["../src/get-client-ip.ts"],"names":[],"mappings":";;AAGA,kCAGC;AALD,uCAAgC;AAEhC,SAAgB,WAAW,CAAC,GAAY;;IACpC,MAAM,KAAK,GAAG,MAAA,GAAG,CAAC,EAAE,mCAAI,MAAA,GAAG,CAAC,MAAM,0CAAE,aAAa,CAAC;IAClD,OAAO,KAAK,IAAI,IAAI,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { LanguageCode } from '@vendure/core';
2
+ import type { Request } from 'express';
3
+ export declare function getLanguageCodeFromQuery(req: Request | undefined): LanguageCode | undefined;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLanguageCodeFromQuery = getLanguageCodeFromQuery;
4
+ // Matches how core's RequestContextService reads languageCode for the GraphQL APIs: a format
5
+ // check, not an enum check, so custom language codes pass and anything else falls back to the
6
+ // channel default.
7
+ function getLanguageCodeFromQuery(req) {
8
+ var _a;
9
+ const value = (_a = req === null || req === void 0 ? void 0 : req.query) === null || _a === void 0 ? void 0 : _a.languageCode;
10
+ return typeof value === 'string' && /^[a-zA-Z0-9_-]+$/.test(value) ? value : undefined;
11
+ }
12
+ //# sourceMappingURL=get-language-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-language-code.js","sourceRoot":"","sources":["../src/get-language-code.ts"],"names":[],"mappings":";;AAMA,4DAGC;AAND,6FAA6F;AAC7F,8FAA8F;AAC9F,mBAAmB;AACnB,SAAgB,wBAAwB,CAAC,GAAwB;;IAC7D,MAAM,KAAK,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,0CAAE,YAAY,CAAC;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAsB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7G,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { McpToolCallLog } from './entities/mcp-tool-call-log.entity';
2
+ export * from './events/mcp-tool-call.event';
3
+ export * from './plugin';
4
+ export { McpToolExecutionService } from './registry/mcp-tool-execution.service';
5
+ export { McpToolRegistryService } from './registry/mcp-tool-registry.service';
6
+ export type { McpActorType, McpDnsRebindingOptions, McpGrantUserType, McpLogCapture, McpLogRedactFn, McpLoggingOptions, McpOauthOptions, McpPluginOptions, McpRateLimitOptions, McpRetentionSchedule, McpToolCallStatus, McpToolExposureMode, McpToolSummary, } from './types';
package/lib/index.js ADDED
@@ -0,0 +1,26 @@
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
+ exports.McpToolRegistryService = exports.McpToolExecutionService = exports.McpToolCallLog = void 0;
18
+ var mcp_tool_call_log_entity_1 = require("./entities/mcp-tool-call-log.entity");
19
+ Object.defineProperty(exports, "McpToolCallLog", { enumerable: true, get: function () { return mcp_tool_call_log_entity_1.McpToolCallLog; } });
20
+ __exportStar(require("./events/mcp-tool-call.event"), exports);
21
+ __exportStar(require("./plugin"), exports);
22
+ var mcp_tool_execution_service_1 = require("./registry/mcp-tool-execution.service");
23
+ Object.defineProperty(exports, "McpToolExecutionService", { enumerable: true, get: function () { return mcp_tool_execution_service_1.McpToolExecutionService; } });
24
+ var mcp_tool_registry_service_1 = require("./registry/mcp-tool-registry.service");
25
+ Object.defineProperty(exports, "McpToolRegistryService", { enumerable: true, get: function () { return mcp_tool_registry_service_1.McpToolRegistryService; } });
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gFAAqE;AAA5D,0HAAA,cAAc,OAAA;AACvB,+DAA6C;AAC7C,2CAAyB;AACzB,oFAAgF;AAAvE,qIAAA,uBAAuB,OAAA;AAChC,kFAA8E;AAArE,mIAAA,sBAAsB,OAAA"}
@@ -0,0 +1,27 @@
1
+ import type { RequestContext } from '@vendure/core';
2
+ import type { DEFAULT_OAUTH_OPTIONS } from './constants';
3
+ import type { McpOauthGrant } from './entities/mcp-oauth-grant.entity';
4
+ import type { McpLoggingOptions, McpOauthOptions, McpPluginOptions, McpRateLimitOptions } from './types';
5
+ export interface McpExecutionContext {
6
+ ctx: RequestContext;
7
+ grant?: McpOauthGrant;
8
+ clientIp?: string;
9
+ }
10
+ export type McpAuthenticatedContext = Required<Pick<McpExecutionContext, 'ctx' | 'grant'>>;
11
+ export type McpOauthOptionsWithDefaults = McpOauthOptions & Required<Pick<McpOauthOptions, keyof typeof DEFAULT_OAUTH_OPTIONS>>;
12
+ /**
13
+ * Plugin options after `resolveMcpPluginOptions` has applied every documented default.
14
+ * Services receive this via `MCP_PLUGIN_OPTIONS` and must not re-apply defaults.
15
+ */
16
+ export interface ResolvedMcpPluginOptions extends McpPluginOptions {
17
+ toolExposure: NonNullable<McpPluginOptions['toolExposure']>;
18
+ shopAccess: NonNullable<McpPluginOptions['shopAccess']>;
19
+ oauth?: McpOauthOptionsWithDefaults;
20
+ rateLimits: Required<McpRateLimitOptions>;
21
+ logging: McpLoggingOptions & {
22
+ ttlDays: number;
23
+ capture: NonNullable<McpLoggingOptions['capture']>;
24
+ maxBodyBytes: number;
25
+ captureClientIp: boolean;
26
+ };
27
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=internal-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-types.js","sourceRoot":"","sources":["../src/internal-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { ID, RequestContext, TransactionalConnection } from '@vendure/core';
2
+ import { ResolvedMcpPluginOptions } from '../internal-types';
3
+ export declare class McpToolCallLogRetentionService {
4
+ private readonly connection;
5
+ private readonly options;
6
+ constructor(connection: TransactionalConnection, options: ResolvedMcpPluginOptions);
7
+ deleteExpiredToolCallLogs(ctx: RequestContext, channelId?: ID | null): Promise<number>;
8
+ }