@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,128 @@
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.McpCatalogQueryService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const core_1 = require("@vendure/core");
15
+ const typeorm_1 = require("typeorm");
16
+ let McpCatalogQueryService = class McpCatalogQueryService {
17
+ constructor(connection, configService, productVariantService, listQueryBuilder, translator) {
18
+ this.connection = connection;
19
+ this.configService = configService;
20
+ this.productVariantService = productVariantService;
21
+ this.listQueryBuilder = listQueryBuilder;
22
+ this.translator = translator;
23
+ }
24
+ async variantsByProductId(ctx, productIds, options) {
25
+ const grouped = new Map();
26
+ if (productIds.length === 0) {
27
+ return grouped;
28
+ }
29
+ const query = this.variantsInChannel(ctx)
30
+ .leftJoinAndSelect('variant.productVariantPrices', 'price')
31
+ .leftJoinAndSelect('variant.taxCategory', 'taxCategory')
32
+ .andWhere('variant.productId IN (:...productIds)', { productIds });
33
+ if (!options.includeDisabled) {
34
+ query.andWhere('variant.enabled = :enabled', { enabled: true });
35
+ }
36
+ const variants = await this.withChannelPrice(ctx, await query.getMany());
37
+ for (const variant of variants) {
38
+ const key = String(variant.productId);
39
+ const group = grouped.get(key);
40
+ if (group) {
41
+ group.push(variant);
42
+ }
43
+ else {
44
+ grouped.set(key, [variant]);
45
+ }
46
+ }
47
+ return grouped;
48
+ }
49
+ // One StockLevel query for the whole page, instead of one per variant.
50
+ async withAvailableStock(ctx, variants) {
51
+ if (variants.length === 0) {
52
+ return [];
53
+ }
54
+ const stockLevels = await this.connection.getRepository(ctx, core_1.StockLevel).find({
55
+ where: { productVariantId: (0, typeorm_1.In)(variants.map(variant => variant.id)) },
56
+ });
57
+ const { stockLocationStrategy } = this.configService.catalogOptions;
58
+ return Promise.all(variants.map(async (variant) => {
59
+ const { stockOnHand } = await stockLocationStrategy.getAvailableStock(ctx, variant.id, stockLevels.filter(level => (0, core_1.idsAreEqual)(level.productVariantId, variant.id)));
60
+ return { variant, stockOnHand };
61
+ }));
62
+ }
63
+ // Mirrors ProductService.findAll, which can't take a collection filter, its where clause being fixed.
64
+ async findPublicProducts(ctx, options, collectionId) {
65
+ const where = { deletedAt: (0, typeorm_1.IsNull)() };
66
+ if (collectionId != null) {
67
+ where.id = this.productIdInCollection(ctx, collectionId);
68
+ }
69
+ const [products, totalItems] = await this.listQueryBuilder
70
+ .build(core_1.Product, options, {
71
+ relations: ['featuredAsset'],
72
+ channelId: ctx.channelId,
73
+ where,
74
+ ctx,
75
+ })
76
+ .getManyAndCount();
77
+ return {
78
+ items: products.map(product => this.translator.translate(product, ctx)),
79
+ totalItems,
80
+ };
81
+ }
82
+ // A subquery keeps paging and counting in the list builder's single statement; parameter names
83
+ // are prefixed so they don't clash with the ones the list builder binds.
84
+ productIdInCollection(ctx, collectionId) {
85
+ const subQuery = this.connection
86
+ .getRepository(ctx, core_1.ProductVariant)
87
+ .createQueryBuilder('mcpVariant')
88
+ .select('mcpVariant.productId')
89
+ .innerJoin('mcpVariant.collections', 'mcpCollection', 'mcpCollection.id = :mcpCollectionId', {
90
+ mcpCollectionId: collectionId,
91
+ })
92
+ .innerJoin('mcpVariant.channels', 'mcpChannel', 'mcpChannel.id = :mcpChannelId', {
93
+ mcpChannelId: ctx.channelId,
94
+ })
95
+ .where('mcpVariant.deletedAt IS NULL')
96
+ .andWhere('mcpVariant.enabled = :mcpEnabled', { mcpEnabled: true });
97
+ return (0, typeorm_1.Raw)(alias => `${alias} IN (${subQuery.getQuery()})`, subQuery.getParameters());
98
+ }
99
+ variantsInChannel(ctx) {
100
+ return this.connection
101
+ .getRepository(ctx, core_1.ProductVariant)
102
+ .createQueryBuilder('variant')
103
+ .innerJoin('variant.channels', 'channel', 'channel.id = :channelId', { channelId: ctx.channelId })
104
+ .innerJoin('variant.product', 'product')
105
+ .where('variant.deletedAt IS NULL')
106
+ .andWhere('product.deletedAt IS NULL');
107
+ }
108
+ async withChannelPrice(ctx, variants) {
109
+ const { productVariantPriceSelectionStrategy } = this.configService.catalogOptions;
110
+ const priced = [];
111
+ for (const variant of variants) {
112
+ if (await productVariantPriceSelectionStrategy.selectPrice(ctx, variant.productVariantPrices)) {
113
+ priced.push(variant);
114
+ }
115
+ }
116
+ return Promise.all(priced.map(variant => this.productVariantService.applyChannelPriceAndTax(variant, ctx)));
117
+ }
118
+ };
119
+ exports.McpCatalogQueryService = McpCatalogQueryService;
120
+ exports.McpCatalogQueryService = McpCatalogQueryService = __decorate([
121
+ (0, common_1.Injectable)(),
122
+ __metadata("design:paramtypes", [core_1.TransactionalConnection,
123
+ core_1.ConfigService,
124
+ core_1.ProductVariantService,
125
+ core_1.ListQueryBuilder,
126
+ core_1.TranslatorService])
127
+ ], McpCatalogQueryService);
128
+ //# sourceMappingURL=catalog-query.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-query.service.js","sourceRoot":"","sources":["../../../src/tools/built-in/catalog-query.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,wCAcuB;AACvB,qCAA4D;AAGrD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,YACqB,UAAmC,EACnC,aAA4B,EAC5B,qBAA4C,EAC5C,gBAAkC,EAClC,UAA6B;QAJ7B,eAAU,GAAV,UAAU,CAAyB;QACnC,kBAAa,GAAb,aAAa,CAAe;QAC5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,eAAU,GAAV,UAAU,CAAmB;IAC/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aACjG,SAAS,CAAC,iBAAiB,EAAE,SAAS,CAAC;aACvC,KAAK,CAAC,2BAA2B,CAAC;aAClC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAC1B,GAAmB,EACnB,QAA0B;QAE1B,MAAM,EAAE,oCAAoC,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;QACnF,MAAM,MAAM,GAAqB,EAAE,CAAC;QACpC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,IAAI,MAAM,oCAAoC,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;gBAC5F,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC,GAAG,CACd,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,uBAAuB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAC1F,CAAC;IACN,CAAC;CACJ,CAAA;AAlIY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAGwB,8BAAuB;QACpB,oBAAa;QACL,4BAAqB;QAC1B,uBAAgB;QACtB,wBAAiB;GANzC,sBAAsB,CAkIlC"}
@@ -0,0 +1,10 @@
1
+ import { ModuleRef } from '@nestjs/core';
2
+ import { ConfigService, CustomFields, RequestContext } from '@vendure/core';
3
+ export declare class McpCustomFieldInputService {
4
+ private readonly configService;
5
+ private readonly moduleRef;
6
+ constructor(configService: ConfigService, moduleRef: ModuleRef);
7
+ assertWritable(ctx: RequestContext, entityName: keyof CustomFields, input: Record<string, unknown> | undefined): Promise<void>;
8
+ /** Internal fields are in no API; non-public fields are admin-only. */
9
+ private isWritableBy;
10
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.McpCustomFieldInputService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const core_1 = require("@nestjs/core");
15
+ const shared_utils_1 = require("@vendure/common/lib/shared-utils");
16
+ const core_2 = require("@vendure/core");
17
+ // Tool calls bypass the two checks the GraphQL API normally applies to custom fields, so this
18
+ // service does both of them instead.
19
+ let McpCustomFieldInputService = class McpCustomFieldInputService {
20
+ constructor(configService, moduleRef) {
21
+ this.configService = configService;
22
+ this.moduleRef = moduleRef;
23
+ }
24
+ async assertWritable(ctx, entityName, input) {
25
+ var _a;
26
+ if (input === undefined) {
27
+ return;
28
+ }
29
+ const configs = (_a = this.configService.customFields[entityName]) !== null && _a !== void 0 ? _a : [];
30
+ const notWritable = [];
31
+ const toValidate = [];
32
+ for (const [key, value] of Object.entries(input)) {
33
+ // Matched like core's interceptor: a relation field arrives as `<name>Id` or `<name>Ids`.
34
+ const config = configs.find(candidate => (0, shared_utils_1.getGraphQlInputName)(candidate) === key);
35
+ if (config && this.isWritableBy(ctx, config)) {
36
+ toValidate.push({ config, value });
37
+ }
38
+ else {
39
+ notWritable.push(key);
40
+ }
41
+ }
42
+ if (notWritable.length > 0) {
43
+ throw new core_2.UserInputError(`These custom fields cannot be set on ${entityName}: ${notWritable.join(', ')}.`);
44
+ }
45
+ const injector = new core_2.Injector(this.moduleRef);
46
+ for (const { config, value } of toValidate) {
47
+ await (0, core_2.validateCustomFieldValue)(config, value, injector, ctx);
48
+ }
49
+ }
50
+ /** Internal fields are in no API; non-public fields are admin-only. */
51
+ isWritableBy(ctx, config) {
52
+ if (config.internal === true) {
53
+ return false;
54
+ }
55
+ return !(ctx.apiType === 'shop' && config.public === false);
56
+ }
57
+ };
58
+ exports.McpCustomFieldInputService = McpCustomFieldInputService;
59
+ exports.McpCustomFieldInputService = McpCustomFieldInputService = __decorate([
60
+ (0, common_1.Injectable)(),
61
+ __metadata("design:paramtypes", [core_2.ConfigService,
62
+ core_1.ModuleRef])
63
+ ], McpCustomFieldInputService);
64
+ //# sourceMappingURL=custom-field-input.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-field-input.service.js","sourceRoot":"","sources":["../../../src/tools/built-in/custom-field-input.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAAyC;AACzC,mEAAuE;AACvE,wCAQuB;AAEvB,8FAA8F;AAC9F,qCAAqC;AAE9B,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACnC,YACqB,aAA4B,EAC5B,SAAoB;QADpB,kBAAa,GAAb,aAAa,CAAe;QAC5B,cAAS,GAAT,SAAS,CAAW;IACtC,CAAC;IAEJ,KAAK,CAAC,cAAc,CAChB,GAAmB,EACnB,UAA8B,EAC9B,KAA0C;;QAE1C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,OAAO;QACX,CAAC;QACD,MAAM,OAAO,GAAwB,MAAA,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,mCAAI,EAAE,CAAC;QACvF,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,MAAM,UAAU,GAAyD,EAAE,CAAC;QAE5E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;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@
1
+ import { z } from 'zod';
2
+ export declare const emailAddressSchema: z.ZodString;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emailAddressSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // `meta` just tells the client what the field holds; `refine` is what actually rejects a bad value.
6
+ exports.emailAddressSchema = zod_1.z
7
+ .string()
8
+ .max(255)
9
+ .describe('Customer email address.')
10
+ .meta({ format: 'email' })
11
+ .refine(value => zod_1.z.regexes.email.test(value), 'Invalid email address');
12
+ //# sourceMappingURL=email-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-schema.js","sourceRoot":"","sources":["../../../src/tools/built-in/email-schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,oGAAoG;AACvF,QAAA,kBAAkB,GAAG,OAAC;KAC9B,MAAM,EAAE;KACR,GAAG,CAAC,GAAG,CAAC;KACR,QAAQ,CAAC,yBAAyB,CAAC;KACnC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;KACzB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare const idSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
3
+ export declare const MAX_ID_LIST_LENGTH = 100;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_ID_LIST_LENGTH = exports.idSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // Vendure IDs can be a string or a number depending on the project's ID strategy, so accept both.
6
+ exports.idSchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number()], {
7
+ error: 'must be a Vendure entity id (a string or a number)',
8
+ });
9
+ // Upper bound on the IDs one input list may carry, so a runaway list cannot become a huge query.
10
+ exports.MAX_ID_LIST_LENGTH = 100;
11
+ //# sourceMappingURL=id-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-schema.js","sourceRoot":"","sources":["../../../src/tools/built-in/id-schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,kGAAkG;AACrF,QAAA,QAAQ,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,EAAE;IACtD,KAAK,EAAE,oDAAoD;CAC9D,CAAC,CAAC;AAEH,iGAAiG;AACpF,QAAA,kBAAkB,GAAG,GAAG,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const GRAPHQL_INT_MIN = -2147483648;
3
+ export declare const GRAPHQL_INT_MAX = 2147483647;
4
+ export declare const int32Schema: z.ZodNumber;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.int32Schema = exports.GRAPHQL_INT_MAX = exports.GRAPHQL_INT_MIN = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.GRAPHQL_INT_MIN = -2147483648;
6
+ exports.GRAPHQL_INT_MAX = 2147483647;
7
+ exports.int32Schema = zod_1.z.number().int().min(exports.GRAPHQL_INT_MIN).max(exports.GRAPHQL_INT_MAX);
8
+ //# sourceMappingURL=int32-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"int32-schema.js","sourceRoot":"","sources":["../../../src/tools/built-in/int32-schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,eAAe,GAAG,CAAC,UAAU,CAAC;AAC9B,QAAA,eAAe,GAAG,UAAU,CAAC;AAE7B,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,uBAAe,CAAC,CAAC,GAAG,CAAC,uBAAe,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { PaginatedList } from '@vendure/common/lib/shared-types';
2
+ import { ListQueryOptions, VendureEntity } from '@vendure/core';
3
+ import { z } from 'zod';
4
+ /** Common pagination fields shared by the list tool inputs (already validated by the tool schema). */
5
+ export interface ListInput {
6
+ limit?: number;
7
+ offset?: number;
8
+ filter?: Record<string, unknown>;
9
+ }
10
+ /** The list envelope every list tool returns; `total` deliberately renames Vendure's `totalItems`. */
11
+ export declare function page<T>(items: T[], totalItems: number, input: {
12
+ offset?: number;
13
+ }): {
14
+ items: T[];
15
+ total: number;
16
+ hasMore: boolean;
17
+ };
18
+ export declare const MAX_LIST_PAGE_SIZE = 100;
19
+ export declare function paginationFields(noun: string): {
20
+ limit: z.ZodOptional<z.ZodNumber>;
21
+ offset: z.ZodOptional<z.ZodNumber>;
22
+ };
23
+ /** The input field both get_product tools take to page through a product's variants. */
24
+ export declare const variantOffset: z.ZodOptional<z.ZodNumber>;
25
+ /** The two paging keys a get_product answer carries next to its `variants` array. */
26
+ export declare function variantPaging(offset: number, variants: PaginatedList<unknown>): {
27
+ variantTotal: number;
28
+ hasMoreVariants: boolean;
29
+ };
30
+ export declare const stringFilter: z.ZodObject<{
31
+ eq: z.ZodOptional<z.ZodString>;
32
+ contains: z.ZodOptional<z.ZodString>;
33
+ in: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
+ }, z.core.$strict>;
35
+ export declare const dateFilter: z.ZodObject<{
36
+ before: z.ZodOptional<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
37
+ after: z.ZodOptional<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
38
+ }, z.core.$strict>;
39
+ export declare const numberFilter: z.ZodObject<{
40
+ eq: z.ZodOptional<z.ZodNumber>;
41
+ gte: z.ZodOptional<z.ZodNumber>;
42
+ lte: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$strict>;
44
+ export declare const booleanFilter: z.ZodObject<{
45
+ eq: z.ZodOptional<z.ZodBoolean>;
46
+ }, z.core.$strict>;
47
+ export declare function slicePage<T>(all: T[], input: ListInput): T[];
48
+ export declare function listOptions<T extends VendureEntity>(input: ListInput): ListQueryOptions<T>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.booleanFilter = exports.numberFilter = exports.dateFilter = exports.stringFilter = exports.variantOffset = exports.MAX_LIST_PAGE_SIZE = void 0;
4
+ exports.page = page;
5
+ exports.paginationFields = paginationFields;
6
+ exports.variantPaging = variantPaging;
7
+ exports.slicePage = slicePage;
8
+ exports.listOptions = listOptions;
9
+ const generated_types_1 = require("@vendure/common/lib/generated-types");
10
+ const zod_1 = require("zod");
11
+ const int32_schema_1 = require("./int32-schema");
12
+ const string_schemas_1 = require("./string-schemas");
13
+ /** The list envelope every list tool returns; `total` deliberately renames Vendure's `totalItems`. */
14
+ function page(items, totalItems, input) {
15
+ var _a;
16
+ const offset = (_a = input.offset) !== null && _a !== void 0 ? _a : 0;
17
+ return { items, total: totalItems, hasMore: offset + items.length < totalItems };
18
+ }
19
+ const DEFAULT_LIST_PAGE_SIZE = 25;
20
+ exports.MAX_LIST_PAGE_SIZE = 100;
21
+ function paginationFields(noun) {
22
+ return {
23
+ limit: zod_1.z
24
+ .number()
25
+ .int()
26
+ .min(1)
27
+ .max(exports.MAX_LIST_PAGE_SIZE)
28
+ .describe(`Maximum number of ${noun} to return, 1 to ${exports.MAX_LIST_PAGE_SIZE}. ` +
29
+ `Defaults to ${DEFAULT_LIST_PAGE_SIZE}.`)
30
+ .optional(),
31
+ offset: int32_schema_1.int32Schema.min(0).describe(`Number of ${noun} to skip.`).optional(),
32
+ };
33
+ }
34
+ /** The input field both get_product tools take to page through a product's variants. */
35
+ exports.variantOffset = int32_schema_1.int32Schema
36
+ .min(0)
37
+ .describe('Number of variants to skip. Use with hasMoreVariants when a product has more ' +
38
+ 'variants than one answer returns.')
39
+ .optional();
40
+ /** The two paging keys a get_product answer carries next to its `variants` array. */
41
+ function variantPaging(offset, variants) {
42
+ return {
43
+ variantTotal: variants.totalItems,
44
+ hasMoreVariants: offset + variants.items.length < variants.totalItems,
45
+ };
46
+ }
47
+ const isoDate = zod_1.z.iso.datetime({ offset: true }).transform(value => new Date(value));
48
+ // Upper bound on the values one `in` filter may list, so a runaway list cannot become a huge query.
49
+ const MAX_FILTER_VALUES = 100;
50
+ exports.stringFilter = zod_1.z.strictObject({
51
+ eq: string_schemas_1.shortText.describe('Exact match.').optional(),
52
+ contains: string_schemas_1.shortText
53
+ .describe("Substring match. Case-insensitive on Postgres, otherwise follows the database's collation.")
54
+ .optional(),
55
+ in: zod_1.z.array(string_schemas_1.shortText).max(MAX_FILTER_VALUES).describe('Any of these exact values.').optional(),
56
+ });
57
+ exports.dateFilter = zod_1.z.strictObject({
58
+ before: isoDate.describe('ISO 8601 date-time, exclusive.').optional(),
59
+ after: isoDate.describe('ISO 8601 date-time, exclusive.').optional(),
60
+ });
61
+ exports.numberFilter = zod_1.z.strictObject({
62
+ eq: zod_1.z.number().optional(),
63
+ gte: zod_1.z.number().optional(),
64
+ lte: zod_1.z.number().optional(),
65
+ });
66
+ exports.booleanFilter = zod_1.z.strictObject({ eq: zod_1.z.boolean().optional() });
67
+ function slicePage(all, input) {
68
+ var _a, _b;
69
+ const offset = (_a = input.offset) !== null && _a !== void 0 ? _a : 0;
70
+ return all.slice(offset, offset + ((_b = input.limit) !== null && _b !== void 0 ? _b : DEFAULT_LIST_PAGE_SIZE));
71
+ }
72
+ function listOptions(input) {
73
+ var _a, _b;
74
+ return Object.assign(Object.assign({ take: (_a = input.limit) !== null && _a !== void 0 ? _a : DEFAULT_LIST_PAGE_SIZE, skip: (_b = input.offset) !== null && _b !== void 0 ? _b : 0 }, (input.filter ? { filter: input.filter } : {})), { sort: { createdAt: generated_types_1.SortOrder.DESC, id: generated_types_1.SortOrder.DESC } });
75
+ }
76
+ //# sourceMappingURL=list-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-helpers.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OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE5E,SAAgB,SAAS,CAAI,GAAQ,EAAE,KAAgB;;IACnD,MAAM,MAAM,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,CAAC,CAAC;IACjC,OAAO,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAA,KAAK,CAAC,KAAK,mCAAI,sBAAsB,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,WAAW,CAA0B,KAAgB;;IACjE,qCACI,IAAI,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,sBAAsB,EAC3C,IAAI,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,CAAC,IACpB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAuC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAClF,IAAI,EAAE,EAAE,SAAS,EAAE,2BAAS,CAAC,IAAI,EAAE,EAAE,EAAE,2BAAS,CAAC,IAAI,EAAiC,IACxF;AACN,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { OrderListOptions } from '@vendure/common/lib/generated-types';
2
+ import { ID, Order, OrderService, RelationPaths, RequestContext, TranslatorService } from '@vendure/core';
3
+ import { z } from 'zod';
4
+ import { type ListInput } from './list-helpers';
5
+ export declare const ORDER_SORT_FIELDS: readonly ["orderPlacedAt", "updatedAt", "createdAt", "total"];
6
+ type OrderSortField = (typeof ORDER_SORT_FIELDS)[number];
7
+ /** The two sort directions list_orders accepts; the tool adds its own description. */
8
+ export declare const sortDirection: z.ZodEnum<{
9
+ ASC: "ASC";
10
+ DESC: "DESC";
11
+ }>;
12
+ export declare function orderListOptions(input: ListInput & {
13
+ sortBy?: OrderSortField;
14
+ sortDirection?: z.infer<typeof sortDirection>;
15
+ }, defaultSort: OrderSortField): OrderListOptions;
16
+ export declare const ORDER_LIST_RELATIONS: RelationPaths<Order>;
17
+ export declare const ORDER_DETAIL_RELATIONS: RelationPaths<Order>;
18
+ export declare function findOrderOrThrow(orderService: OrderService, ctx: RequestContext, id: ID, relations: RelationPaths<Order>): Promise<Order>;
19
+ export declare function translateLineVariants(orders: Order[], translator: TranslatorService, ctx: RequestContext): void;
20
+ export {};
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ORDER_DETAIL_RELATIONS = exports.ORDER_LIST_RELATIONS = exports.sortDirection = exports.ORDER_SORT_FIELDS = void 0;
4
+ exports.orderListOptions = orderListOptions;
5
+ exports.findOrderOrThrow = findOrderOrThrow;
6
+ exports.translateLineVariants = translateLineVariants;
7
+ const generated_types_1 = require("@vendure/common/lib/generated-types");
8
+ const core_1 = require("@vendure/core");
9
+ const zod_1 = require("zod");
10
+ const list_helpers_1 = require("./list-helpers");
11
+ // Kept to the fields an operations user actually asks for, to keep the tool's input small.
12
+ exports.ORDER_SORT_FIELDS = ['orderPlacedAt', 'updatedAt', 'createdAt', 'total'];
13
+ /** The two sort directions list_orders accepts; the tool adds its own description. */
14
+ exports.sortDirection = zod_1.z.enum(['ASC', 'DESC']);
15
+ function orderListOptions(input, defaultSort) {
16
+ var _a;
17
+ const field = (_a = input.sortBy) !== null && _a !== void 0 ? _a : defaultSort;
18
+ const direction = input.sortDirection === 'ASC' ? generated_types_1.SortOrder.ASC : generated_types_1.SortOrder.DESC;
19
+ return Object.assign(Object.assign({}, (0, list_helpers_1.listOptions)(input)), { sort: { [field]: direction, id: direction } });
20
+ }
21
+ exports.ORDER_LIST_RELATIONS = [
22
+ 'lines',
23
+ 'lines.productVariant',
24
+ 'lines.productVariant.translations',
25
+ 'shippingLines',
26
+ 'payments',
27
+ 'payments.refunds',
28
+ 'fulfillments',
29
+ 'fulfillments.lines',
30
+ 'customer',
31
+ ];
32
+ exports.ORDER_DETAIL_RELATIONS = [...exports.ORDER_LIST_RELATIONS, 'customer.user'];
33
+ // Called at the top of a tool so a missing order is refused before any work starts.
34
+ async function findOrderOrThrow(orderService, ctx, id, relations) {
35
+ const order = await orderService.findOne(ctx, id, relations);
36
+ if (!order) {
37
+ throw new core_1.EntityNotFoundError('Order', id);
38
+ }
39
+ return order;
40
+ }
41
+ function translateLineVariants(orders, translator, ctx) {
42
+ for (const order of orders) {
43
+ for (const line of order.lines) {
44
+ line.productVariant = translator.translate(line.productVariant, ctx);
45
+ }
46
+ }
47
+ }
48
+ //# sourceMappingURL=order-list-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-list-helpers.js","sourceRoot":"","sources":["../../../src/tools/built-in/order-list-helpers.ts"],"names":[],"mappings":";;;AAsBA,4CAUC;AAiBD,4CAWC;AAED,sDAMC;AApED,yEAAkF;AAClF,wCAQuB;AACvB,6BAAwB;AAExB,iDAA6D;AAE7D,2FAA2F;AAC9E,QAAA,iBAAiB,GAAG,CAAC,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AAI/F,sFAAsF;AACzE,QAAA,aAAa,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAErD,SAAgB,gBAAgB,CAC5B,KAA6F,EAC7F,WAA2B;;IAE3B,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,WAAW,CAAC;IAC1C,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,2BAAS,CAAC,GAAG,CAAC,CAAC,CAAC,2BAAS,CAAC,IAAI,CAAC;IACjF,uCACQ,IAAA,0BAAW,EAAQ,KAAK,CAAsB,KAClD,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAC7C;AACN,CAAC;AAEY,QAAA,oBAAoB,GAAyB;IACtD,OAAO;IACP,sBAAsB;IACtB,mCAAmC;IACnC,eAAe;IACf,UAAU;IACV,kBAAkB;IAClB,cAAc;IACd,oBAAoB;IACpB,UAAU;CACb,CAAC;AAEW,QAAA,sBAAsB,GAAyB,CAAC,GAAG,4BAAoB,EAAE,eAAe,CAAC,CAAC;AAEvG,oFAAoF;AAC7E,KAAK,UAAU,gBAAgB,CAClC,YAA0B,EAC1B,GAAmB,EACnB,EAAM,EACN,SAA+B;IAE/B,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;IAC7D,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,IAAI,0BAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAAe,EAAE,UAA6B,EAAE,GAAmB;IACrG,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAC7B,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QACzE,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Provider } from '@nestjs/common';
2
+ export declare const mcpBuiltInToolProviders: Provider[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mcpBuiltInToolProviders = void 0;
4
+ const admin_1 = require("./admin");
5
+ const shop_1 = require("./shop");
6
+ exports.mcpBuiltInToolProviders = [...shop_1.shopToolProviders, ...admin_1.adminToolProviders];
7
+ //# sourceMappingURL=providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../src/tools/built-in/providers.ts"],"names":[],"mappings":";;;AAEA,mCAA6C;AAC7C,iCAA2C;AAE9B,QAAA,uBAAuB,GAAe,CAAC,GAAG,wBAAiB,EAAE,GAAG,0BAAkB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AssetImportStrategy, AssetService, RequestContext } from '@vendure/core';
2
+ export declare function uploadAssetFromUrl(ctx: RequestContext, url: string, assetService: AssetService, assetImportStrategy: AssetImportStrategy, options?: {
3
+ maxBytes?: number;
4
+ }): Promise<import("@vendure/core").Translated<import("@vendure/core").Asset>>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadAssetFromUrl = uploadAssetFromUrl;
4
+ const core_1 = require("@vendure/core");
5
+ const node_stream_1 = require("node:stream");
6
+ const DEFAULT_MAX_ASSET_BYTES = 20 * 1024 * 1024;
7
+ function capStreamBytes(source, maxBytes) {
8
+ let total = 0;
9
+ const limiter = new node_stream_1.Transform({
10
+ transform(chunk, _encoding, callback) {
11
+ total += Buffer.byteLength(chunk);
12
+ if (total > maxBytes) {
13
+ callback(new core_1.UserInputError(`Asset exceeds the maximum size of ${maxBytes} bytes`));
14
+ return;
15
+ }
16
+ callback(null, chunk);
17
+ },
18
+ });
19
+ (0, node_stream_1.pipeline)(source, limiter, () => undefined);
20
+ return limiter;
21
+ }
22
+ async function fetchAsset(url, assetImportStrategy) {
23
+ try {
24
+ return await assetImportStrategy.getStreamFromPath(url);
25
+ }
26
+ catch (e) {
27
+ if (e instanceof core_1.UserInputError) {
28
+ throw e;
29
+ }
30
+ if (e instanceof core_1.InternalServerError) {
31
+ // Converted so the tool funnel exposes the specific reason instead of masking it.
32
+ throw new core_1.UserInputError(e.message);
33
+ }
34
+ throw new core_1.UserInputError('The URL could not be fetched as a file. It must answer HTTP 200 with the file itself; ' +
35
+ 'redirects are not followed.');
36
+ }
37
+ }
38
+ async function uploadAssetFromUrl(ctx, url, assetService, assetImportStrategy, options = {}) {
39
+ var _a;
40
+ if (!/^https?:\/\//.test(url)) {
41
+ throw new core_1.UserInputError(`Unsupported asset URL scheme (only http and https URLs are allowed): ${url}`);
42
+ }
43
+ const source = await fetchAsset(url, assetImportStrategy);
44
+ const capped = capStreamBytes(source, (_a = options.maxBytes) !== null && _a !== void 0 ? _a : DEFAULT_MAX_ASSET_BYTES);
45
+ const created = await assetService.createFromFileStream(capped, url, ctx);
46
+ if ((0, core_1.isGraphQlErrorResult)(created)) {
47
+ // The error result's own message is just the untranslated code "MIME_TYPE_ERROR", so build
48
+ // a readable one here instead. An MCP tool call never passes through the GraphQL layer
49
+ // that would normally translate it.
50
+ throw new core_1.UserInputError(`Unsupported asset file type for "${created.fileName}": ${created.mimeType}`);
51
+ }
52
+ return created;
53
+ }
54
+ //# sourceMappingURL=remote-asset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-asset.js","sourceRoot":"","sources":["../../../src/tools/built-in/remote-asset.ts"],"names":[],"mappings":";;AA8CA,gDAwBC;AAtED,wCAOuB;AACvB,6CAA4D;AAE5D,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,SAAS,cAAc,CAAC,MAAgB,EAAE,QAAgB;IACtD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,OAAO,GAAG,IAAI,uBAAS,CAAC;QAC1B,SAAS,CAAC,KAAa,EAAE,SAAS,EAAE,QAAQ;YACxC,KAAK,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAClC,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;gBACnB,QAAQ,CAAC,IAAI,qBAAc,CAAC,qCAAqC,QAAQ,QAAQ,CAAC,CAAC,CAAC;gBACpF,OAAO;YACX,CAAC;YACD,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC1B,CAAC;KACJ,CAAC,CAAC;IACH,IAAA,sBAAQ,EAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,KAAK,UAAU,UAAU,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