@mercurjs/core 2.2.0-canary.5 → 2.2.0-canary.50

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 (746) hide show
  1. package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.d.ts +13 -0
  2. package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.js +59 -0
  3. package/.medusa/server/src/api/admin/claims/[id]/request/route.d.ts +4 -0
  4. package/.medusa/server/src/api/admin/claims/[id]/request/route.js +74 -0
  5. package/.medusa/server/src/api/admin/collections/[id]/route.d.ts +7 -0
  6. package/.medusa/server/src/api/admin/collections/[id]/route.js +48 -0
  7. package/.medusa/server/src/api/admin/collections/middlewares.d.ts +2 -0
  8. package/.medusa/server/src/api/admin/collections/middlewares.js +49 -0
  9. package/.medusa/server/src/api/admin/collections/query-config.d.ts +12 -0
  10. package/.medusa/server/src/api/admin/collections/query-config.js +29 -0
  11. package/.medusa/server/src/api/admin/collections/route.d.ts +6 -0
  12. package/.medusa/server/src/api/admin/collections/route.js +36 -0
  13. package/.medusa/server/src/api/admin/collections/validators.d.ts +262 -0
  14. package/.medusa/server/src/api/admin/collections/validators.js +42 -0
  15. package/.medusa/server/src/api/admin/commission-rates/query-config.js +6 -4
  16. package/.medusa/server/src/api/admin/commission-rates/route.js +4 -1
  17. package/.medusa/server/src/api/admin/commission-rates/validators.d.ts +89 -58
  18. package/.medusa/server/src/api/admin/commission-rates/validators.js +16 -9
  19. package/.medusa/server/src/api/admin/customer-groups/middlewares.d.ts +2 -0
  20. package/.medusa/server/src/api/admin/customer-groups/middlewares.js +43 -0
  21. package/.medusa/server/src/api/admin/customer-groups/validators.d.ts +257 -0
  22. package/.medusa/server/src/api/admin/customer-groups/validators.js +12 -0
  23. package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.d.ts +14 -0
  24. package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.js +60 -0
  25. package/.medusa/server/src/api/admin/exchanges/[id]/request/route.d.ts +4 -0
  26. package/.medusa/server/src/api/admin/exchanges/[id]/request/route.js +75 -0
  27. package/.medusa/server/src/api/admin/members/validators.d.ts +14 -15
  28. package/.medusa/server/src/api/admin/middlewares.js +31 -36
  29. package/.medusa/server/src/api/admin/offers/batch/route.js +3 -3
  30. package/.medusa/server/src/api/admin/offers/middlewares.js +3 -1
  31. package/.medusa/server/src/api/admin/offers/query-config.js +3 -1
  32. package/.medusa/server/src/api/admin/offers/validators.d.ts +79 -57
  33. package/.medusa/server/src/api/admin/offers/validators.js +10 -2
  34. package/.medusa/server/src/api/admin/order-edits/[id]/confirm/route.d.ts +3 -0
  35. package/.medusa/server/src/api/admin/order-edits/[id]/confirm/route.js +18 -0
  36. package/.medusa/server/src/api/admin/order-edits/[id]/items/route.d.ts +15 -0
  37. package/.medusa/server/src/api/admin/order-edits/[id]/items/route.js +46 -0
  38. package/.medusa/server/src/api/admin/order-groups/helpers.d.ts +2 -0
  39. package/.medusa/server/src/api/admin/order-groups/helpers.js +53 -0
  40. package/.medusa/server/src/api/admin/order-groups/middlewares.js +3 -1
  41. package/.medusa/server/src/api/admin/order-groups/route.js +4 -2
  42. package/.medusa/server/src/api/admin/order-groups/validators.d.ts +20 -21
  43. package/.medusa/server/src/api/admin/orders/[id]/commission-lines/route.d.ts +7 -0
  44. package/.medusa/server/src/api/admin/orders/[id]/commission-lines/route.js +17 -0
  45. package/.medusa/server/src/api/admin/orders/middlewares.d.ts +2 -0
  46. package/.medusa/server/src/api/admin/orders/middlewares.js +42 -0
  47. package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.d.ts +2 -0
  48. package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.js +15 -0
  49. package/.medusa/server/src/api/admin/orders/validators.d.ts +1 -287
  50. package/.medusa/server/src/api/admin/orders/validators.js +9 -29
  51. package/.medusa/server/src/api/admin/payouts/validators.d.ts +18 -19
  52. package/.medusa/server/src/api/admin/product-attributes/[id]/route.js +2 -2
  53. package/.medusa/server/src/api/admin/product-attributes/[id]/values/[value_id]/route.js +2 -2
  54. package/.medusa/server/src/api/admin/product-attributes/middlewares.js +1 -3
  55. package/.medusa/server/src/api/admin/product-attributes/query-config.js +4 -1
  56. package/.medusa/server/src/api/admin/product-attributes/route.d.ts +2 -2
  57. package/.medusa/server/src/api/admin/product-attributes/route.js +2 -5
  58. package/.medusa/server/src/api/admin/product-attributes/validators.d.ts +129 -140
  59. package/.medusa/server/src/api/admin/product-attributes/validators.js +1 -3
  60. package/.medusa/server/src/api/admin/product-categories/[id]/products/route.js +3 -3
  61. package/.medusa/server/src/api/admin/product-categories/[id]/route.js +8 -11
  62. package/.medusa/server/src/api/admin/product-categories/query-config.js +7 -1
  63. package/.medusa/server/src/api/admin/product-categories/route.js +5 -8
  64. package/.medusa/server/src/api/admin/product-categories/validators.d.ts +153 -93
  65. package/.medusa/server/src/api/admin/product-categories/validators.js +11 -1
  66. package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.d.ts +0 -7
  67. package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.js +2 -8
  68. package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.d.ts +0 -7
  69. package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.js +2 -8
  70. package/.medusa/server/src/api/admin/product-changes/validators.d.ts +8 -4
  71. package/.medusa/server/src/api/admin/product-changes/validators.js +6 -3
  72. package/.medusa/server/src/api/admin/products/[id]/attributes/batch/route.js +6 -9
  73. package/.medusa/server/src/api/admin/products/[id]/confirm/route.d.ts +0 -12
  74. package/.medusa/server/src/api/admin/products/[id]/confirm/route.js +2 -13
  75. package/.medusa/server/src/api/admin/products/[id]/preview/route.d.ts +0 -7
  76. package/.medusa/server/src/api/admin/products/[id]/preview/route.js +1 -8
  77. package/.medusa/server/src/api/admin/products/[id]/reject/route.d.ts +0 -8
  78. package/.medusa/server/src/api/admin/products/[id]/reject/route.js +2 -9
  79. package/.medusa/server/src/api/admin/products/[id]/request-changes/route.d.ts +0 -9
  80. package/.medusa/server/src/api/admin/products/[id]/request-changes/route.js +2 -10
  81. package/.medusa/server/src/api/admin/products/[id]/route.js +9 -3
  82. package/.medusa/server/src/api/admin/products/[id]/sellers/route.d.ts +3 -0
  83. package/.medusa/server/src/api/admin/products/[id]/sellers/route.js +13 -0
  84. package/.medusa/server/src/api/admin/products/middlewares.js +6 -42
  85. package/.medusa/server/src/api/admin/products/query-config.js +41 -16
  86. package/.medusa/server/src/api/admin/products/route.js +9 -1
  87. package/.medusa/server/src/api/admin/products/validators.d.ts +570 -1314
  88. package/.medusa/server/src/api/admin/products/validators.js +66 -90
  89. package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.d.ts +3 -0
  90. package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.js +29 -0
  91. package/.medusa/server/src/api/admin/sellers/[id]/address/route.js +4 -2
  92. package/.medusa/server/src/api/admin/sellers/[id]/approve/route.d.ts +2 -1
  93. package/.medusa/server/src/api/admin/sellers/[id]/approve/route.js +2 -1
  94. package/.medusa/server/src/api/admin/sellers/[id]/payment-details/route.js +4 -2
  95. package/.medusa/server/src/api/admin/sellers/[id]/professional-details/route.js +4 -2
  96. package/.medusa/server/src/api/admin/sellers/[id]/route.js +4 -2
  97. package/.medusa/server/src/api/admin/sellers/[id]/suspend/route.js +2 -1
  98. package/.medusa/server/src/api/admin/sellers/[id]/terminate/route.js +2 -1
  99. package/.medusa/server/src/api/admin/sellers/[id]/unsuspend/route.d.ts +2 -1
  100. package/.medusa/server/src/api/admin/sellers/[id]/unsuspend/route.js +2 -1
  101. package/.medusa/server/src/api/admin/sellers/[id]/unterminate/route.d.ts +2 -1
  102. package/.medusa/server/src/api/admin/sellers/[id]/unterminate/route.js +2 -1
  103. package/.medusa/server/src/api/admin/sellers/middlewares.js +4 -20
  104. package/.medusa/server/src/api/admin/sellers/route.js +4 -2
  105. package/.medusa/server/src/api/admin/sellers/validators.d.ts +89 -100
  106. package/.medusa/server/src/api/admin/sellers/validators.js +12 -7
  107. package/.medusa/server/src/api/admin/shipping-options/middlewares.d.ts +2 -0
  108. package/.medusa/server/src/api/admin/shipping-options/middlewares.js +46 -0
  109. package/.medusa/server/src/api/admin/shipping-profiles/middlewares.d.ts +2 -0
  110. package/.medusa/server/src/api/admin/shipping-profiles/middlewares.js +46 -0
  111. package/.medusa/server/src/api/admin/stock-locations/middlewares.d.ts +2 -0
  112. package/.medusa/server/src/api/admin/stock-locations/middlewares.js +46 -0
  113. package/.medusa/server/src/api/store/carts/[id]/complete/route.js +1 -5
  114. package/.medusa/server/src/api/store/carts/[id]/complete/validators.d.ts +1 -1
  115. package/.medusa/server/src/api/store/carts/[id]/line-items/route.js +13 -1
  116. package/.medusa/server/src/api/store/carts/[id]/line-items/validators.d.ts +0 -3
  117. package/.medusa/server/src/api/store/carts/[id]/line-items/validators.js +1 -2
  118. package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.js +6 -2
  119. package/.medusa/server/src/api/store/middlewares.js +15 -11
  120. package/.medusa/server/src/api/store/offers/[id]/route.d.ts +3 -0
  121. package/.medusa/server/src/api/store/offers/[id]/route.js +28 -0
  122. package/.medusa/server/src/api/store/offers/helpers.d.ts +43 -0
  123. package/.medusa/server/src/api/store/offers/helpers.js +191 -0
  124. package/.medusa/server/src/api/store/offers/middlewares.d.ts +2 -0
  125. package/.medusa/server/src/api/store/offers/middlewares.js +64 -0
  126. package/.medusa/server/src/api/store/offers/query-config.d.ts +12 -0
  127. package/.medusa/server/src/api/store/offers/query-config.js +50 -0
  128. package/.medusa/server/src/api/store/offers/route.d.ts +3 -0
  129. package/.medusa/server/src/api/store/offers/route.js +30 -0
  130. package/.medusa/server/src/api/store/offers/validators.d.ts +158 -0
  131. package/.medusa/server/src/api/store/offers/validators.js +29 -0
  132. package/.medusa/server/src/api/store/order-groups/validators.d.ts +16 -17
  133. package/.medusa/server/src/api/store/product-attributes/validators.d.ts +50 -46
  134. package/.medusa/server/src/api/store/product-categories/validators.d.ts +59 -53
  135. package/.medusa/server/src/api/store/products/[id]/route.js +9 -5
  136. package/.medusa/server/src/api/store/products/helpers.d.ts +10 -0
  137. package/.medusa/server/src/api/store/products/helpers.js +20 -0
  138. package/.medusa/server/src/api/store/products/middlewares.js +37 -24
  139. package/.medusa/server/src/api/store/products/query-config.js +23 -7
  140. package/.medusa/server/src/api/store/products/route.js +9 -1
  141. package/.medusa/server/src/api/store/products/validators.d.ts +69 -65
  142. package/.medusa/server/src/api/store/search/middlewares.d.ts +2 -0
  143. package/.medusa/server/src/api/store/search/middlewares.js +73 -0
  144. package/.medusa/server/src/api/store/search/route.d.ts +8 -0
  145. package/.medusa/server/src/api/store/search/route.js +25 -0
  146. package/.medusa/server/src/api/store/search/validators.d.ts +27 -0
  147. package/.medusa/server/src/api/store/search/validators.js +17 -0
  148. package/.medusa/server/src/api/store/sellers/validators.d.ts +35 -34
  149. package/.medusa/server/src/api/utils/filter-attributes-by-category-link.d.ts +0 -15
  150. package/.medusa/server/src/api/utils/filter-attributes-by-category-link.js +22 -26
  151. package/.medusa/server/src/api/utils/format-product-attributes.d.ts +5 -50
  152. package/.medusa/server/src/api/utils/format-product-attributes.js +90 -164
  153. package/.medusa/server/src/api/utils/index.d.ts +2 -0
  154. package/.medusa/server/src/api/utils/index.js +3 -1
  155. package/.medusa/server/src/api/utils/offers.d.ts +50 -0
  156. package/.medusa/server/src/api/utils/offers.js +286 -0
  157. package/.medusa/server/src/api/utils/order-commission-lines.d.ts +11 -0
  158. package/.medusa/server/src/api/utils/order-commission-lines.js +71 -0
  159. package/.medusa/server/src/api/utils/product-attribute-fields.d.ts +5 -0
  160. package/.medusa/server/src/api/utils/product-attribute-fields.js +35 -0
  161. package/.medusa/server/src/api/utils/sellers.d.ts +2 -0
  162. package/.medusa/server/src/api/utils/sellers.js +23 -0
  163. package/.medusa/server/src/api/vendor/campaigns/validators.d.ts +14 -15
  164. package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.d.ts +4 -0
  165. package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.js +17 -0
  166. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.d.ts +9 -0
  167. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.js +32 -0
  168. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.d.ts +6 -0
  169. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.js +15 -0
  170. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.d.ts +9 -0
  171. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.js +46 -0
  172. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.d.ts +6 -0
  173. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.js +26 -0
  174. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
  175. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.js +39 -0
  176. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.d.ts +6 -0
  177. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.js +26 -0
  178. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.d.ts +9 -0
  179. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.js +32 -0
  180. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.d.ts +6 -0
  181. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.js +41 -0
  182. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
  183. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
  184. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.d.ts +6 -0
  185. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.js +15 -0
  186. package/.medusa/server/src/api/vendor/claims/[id]/request/route.d.ts +6 -0
  187. package/.medusa/server/src/api/vendor/claims/[id]/request/route.js +31 -0
  188. package/.medusa/server/src/api/vendor/claims/[id]/route.d.ts +3 -0
  189. package/.medusa/server/src/api/vendor/claims/[id]/route.js +19 -0
  190. package/.medusa/server/src/api/vendor/claims/helpers.d.ts +2 -0
  191. package/.medusa/server/src/api/vendor/claims/helpers.js +19 -0
  192. package/.medusa/server/src/api/vendor/claims/middlewares.d.ts +2 -0
  193. package/.medusa/server/src/api/vendor/claims/middlewares.js +184 -0
  194. package/.medusa/server/src/api/vendor/claims/query-config.d.ts +12 -0
  195. package/.medusa/server/src/api/vendor/claims/query-config.js +31 -0
  196. package/.medusa/server/src/api/vendor/claims/route.d.ts +5 -0
  197. package/.medusa/server/src/api/vendor/claims/route.js +35 -0
  198. package/.medusa/server/src/api/vendor/claims/validators.d.ts +377 -0
  199. package/.medusa/server/src/api/vendor/claims/validators.js +89 -0
  200. package/.medusa/server/src/api/vendor/collections/query-config.js +7 -1
  201. package/.medusa/server/src/api/vendor/collections/validators.d.ts +22 -23
  202. package/.medusa/server/src/api/vendor/currencies/validators.d.ts +14 -15
  203. package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.d.ts +4 -0
  204. package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.js +20 -0
  205. package/.medusa/server/src/api/vendor/customer-groups/[id]/route.d.ts +6 -0
  206. package/.medusa/server/src/api/vendor/customer-groups/[id]/route.js +43 -0
  207. package/.medusa/server/src/api/vendor/customer-groups/helpers.d.ts +3 -0
  208. package/.medusa/server/src/api/vendor/customer-groups/helpers.js +38 -0
  209. package/.medusa/server/src/api/vendor/customer-groups/middlewares.d.ts +2 -0
  210. package/.medusa/server/src/api/vendor/customer-groups/middlewares.js +62 -0
  211. package/.medusa/server/src/api/vendor/customer-groups/query-config.d.ts +11 -0
  212. package/.medusa/server/src/api/vendor/customer-groups/query-config.js +22 -0
  213. package/.medusa/server/src/api/vendor/customer-groups/route.d.ts +5 -0
  214. package/.medusa/server/src/api/vendor/customer-groups/route.js +35 -0
  215. package/.medusa/server/src/api/vendor/customer-groups/validators.d.ts +156 -0
  216. package/.medusa/server/src/api/vendor/customer-groups/validators.js +35 -0
  217. package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.d.ts +4 -0
  218. package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.js +27 -0
  219. package/.medusa/server/src/api/vendor/customers/[id]/route.js +13 -1
  220. package/.medusa/server/src/api/vendor/customers/middlewares.js +9 -1
  221. package/.medusa/server/src/api/vendor/customers/validators.d.ts +47 -32
  222. package/.medusa/server/src/api/vendor/customers/validators.js +9 -2
  223. package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.d.ts +4 -0
  224. package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.js +17 -0
  225. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.d.ts +9 -0
  226. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.js +46 -0
  227. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.d.ts +6 -0
  228. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.js +26 -0
  229. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
  230. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.js +45 -0
  231. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.d.ts +6 -0
  232. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.js +26 -0
  233. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.d.ts +9 -0
  234. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.js +32 -0
  235. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.d.ts +6 -0
  236. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.js +41 -0
  237. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
  238. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
  239. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.d.ts +6 -0
  240. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.js +15 -0
  241. package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.d.ts +6 -0
  242. package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.js +31 -0
  243. package/.medusa/server/src/api/vendor/exchanges/helpers.d.ts +2 -0
  244. package/.medusa/server/src/api/vendor/exchanges/helpers.js +19 -0
  245. package/.medusa/server/src/api/vendor/exchanges/middlewares.d.ts +2 -0
  246. package/.medusa/server/src/api/vendor/exchanges/middlewares.js +155 -0
  247. package/.medusa/server/src/api/vendor/exchanges/query-config.d.ts +7 -0
  248. package/.medusa/server/src/api/vendor/exchanges/query-config.js +23 -0
  249. package/.medusa/server/src/api/vendor/exchanges/route.d.ts +5 -0
  250. package/.medusa/server/src/api/vendor/exchanges/route.js +35 -0
  251. package/.medusa/server/src/api/vendor/exchanges/validators.d.ts +312 -0
  252. package/.medusa/server/src/api/vendor/exchanges/validators.js +71 -0
  253. package/.medusa/server/src/api/vendor/fulfillment-providers/validators.d.ts +24 -23
  254. package/.medusa/server/src/api/vendor/fulfillment-sets/validators.d.ts +18 -18
  255. package/.medusa/server/src/api/vendor/inventory-items/validators.d.ts +104 -110
  256. package/.medusa/server/src/api/vendor/members/me/route.js +3 -2
  257. package/.medusa/server/src/api/vendor/members/validators.d.ts +4 -2
  258. package/.medusa/server/src/api/vendor/members/validators.js +5 -3
  259. package/.medusa/server/src/api/vendor/middlewares.js +77 -67
  260. package/.medusa/server/src/api/vendor/offers/[id]/route.js +4 -2
  261. package/.medusa/server/src/api/vendor/offers/batch/route.js +3 -2
  262. package/.medusa/server/src/api/vendor/offers/query-config.js +2 -1
  263. package/.medusa/server/src/api/vendor/offers/route.js +4 -2
  264. package/.medusa/server/src/api/vendor/offers/validators.d.ts +68 -67
  265. package/.medusa/server/src/api/vendor/offers/validators.js +12 -12
  266. package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.d.ts +3 -0
  267. package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.js +18 -0
  268. package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.d.ts +5 -0
  269. package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.js +32 -0
  270. package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.d.ts +4 -0
  271. package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.js +24 -0
  272. package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.d.ts +4 -0
  273. package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.js +33 -0
  274. package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.d.ts +3 -0
  275. package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.js +18 -0
  276. package/.medusa/server/src/api/vendor/order-edits/[id]/route.d.ts +3 -0
  277. package/.medusa/server/src/api/vendor/order-edits/[id]/route.js +19 -0
  278. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.d.ts +5 -0
  279. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.js +32 -0
  280. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.d.ts +4 -0
  281. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.js +15 -0
  282. package/.medusa/server/src/api/vendor/order-edits/middlewares.d.ts +2 -0
  283. package/.medusa/server/src/api/vendor/order-edits/middlewares.js +94 -0
  284. package/.medusa/server/src/api/vendor/order-edits/route.d.ts +4 -0
  285. package/.medusa/server/src/api/vendor/order-edits/route.js +15 -0
  286. package/.medusa/server/src/api/vendor/order-edits/validators.d.ts +160 -0
  287. package/.medusa/server/src/api/vendor/order-edits/validators.js +50 -0
  288. package/.medusa/server/src/api/vendor/orders/[id]/commission-lines/route.d.ts +7 -0
  289. package/.medusa/server/src/api/vendor/orders/[id]/commission-lines/route.js +18 -0
  290. package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.d.ts +2 -1
  291. package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.js +4 -1
  292. package/.medusa/server/src/api/vendor/orders/middlewares.js +2 -1
  293. package/.medusa/server/src/api/vendor/orders/query-config.js +34 -11
  294. package/.medusa/server/src/api/vendor/orders/resolve-offer-items.d.ts +23 -0
  295. package/.medusa/server/src/api/vendor/orders/resolve-offer-items.js +75 -0
  296. package/.medusa/server/src/api/vendor/orders/validators.d.ts +37 -26
  297. package/.medusa/server/src/api/vendor/orders/validators.js +10 -3
  298. package/.medusa/server/src/api/vendor/payments/helpers.js +14 -8
  299. package/.medusa/server/src/api/vendor/payments/validators.d.ts +38 -38
  300. package/.medusa/server/src/api/vendor/payout-accounts/validators.d.ts +11 -12
  301. package/.medusa/server/src/api/vendor/payouts/validators.d.ts +18 -19
  302. package/.medusa/server/src/api/vendor/price-lists/validators.d.ts +38 -40
  303. package/.medusa/server/src/api/vendor/price-preferences/validators.d.ts +14 -15
  304. package/.medusa/server/src/api/vendor/product-attributes/query-config.js +4 -2
  305. package/.medusa/server/src/api/vendor/product-attributes/route.js +1 -3
  306. package/.medusa/server/src/api/vendor/product-attributes/validators.d.ts +92 -104
  307. package/.medusa/server/src/api/vendor/product-attributes/validators.js +1 -1
  308. package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.d.ts +4 -0
  309. package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +36 -0
  310. package/.medusa/server/src/api/vendor/product-categories/middlewares.js +9 -1
  311. package/.medusa/server/src/api/vendor/product-categories/query-config.js +7 -1
  312. package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +102 -79
  313. package/.medusa/server/src/api/vendor/product-categories/validators.js +7 -2
  314. package/.medusa/server/src/api/vendor/product-tags/validators.d.ts +2 -2
  315. package/.medusa/server/src/api/vendor/product-types/validators.d.ts +14 -15
  316. package/.medusa/server/src/api/vendor/product-variants/middlewares.js +11 -19
  317. package/.medusa/server/src/api/vendor/product-variants/query-config.js +1 -3
  318. package/.medusa/server/src/api/vendor/product-variants/validators.d.ts +103 -97
  319. package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.d.ts +5 -0
  320. package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.js +22 -0
  321. package/.medusa/server/src/api/vendor/products/[id]/cancel/route.d.ts +2 -7
  322. package/.medusa/server/src/api/vendor/products/[id]/cancel/route.js +2 -9
  323. package/.medusa/server/src/api/vendor/products/[id]/preview/route.d.ts +0 -9
  324. package/.medusa/server/src/api/vendor/products/[id]/preview/route.js +1 -10
  325. package/.medusa/server/src/api/vendor/products/[id]/route.d.ts +0 -14
  326. package/.medusa/server/src/api/vendor/products/[id]/route.js +12 -21
  327. package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.d.ts +0 -8
  328. package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +3 -14
  329. package/.medusa/server/src/api/vendor/products/[id]/variants/route.d.ts +0 -7
  330. package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +2 -11
  331. package/.medusa/server/src/api/vendor/products/helpers.d.ts +6 -5
  332. package/.medusa/server/src/api/vendor/products/helpers.js +54 -10
  333. package/.medusa/server/src/api/vendor/products/middlewares.js +16 -48
  334. package/.medusa/server/src/api/vendor/products/query-config.js +52 -15
  335. package/.medusa/server/src/api/vendor/products/route.d.ts +0 -9
  336. package/.medusa/server/src/api/vendor/products/route.js +14 -17
  337. package/.medusa/server/src/api/vendor/products/validators.d.ts +458 -770
  338. package/.medusa/server/src/api/vendor/products/validators.js +90 -78
  339. package/.medusa/server/src/api/vendor/promotions/validators.d.ts +47 -49
  340. package/.medusa/server/src/api/vendor/refund-reasons/validators.d.ts +18 -19
  341. package/.medusa/server/src/api/vendor/regions/validators.d.ts +20 -21
  342. package/.medusa/server/src/api/vendor/reservations/[id]/route.d.ts +5 -0
  343. package/.medusa/server/src/api/vendor/reservations/[id]/route.js +39 -0
  344. package/.medusa/server/src/api/vendor/reservations/helpers.d.ts +2 -0
  345. package/.medusa/server/src/api/vendor/reservations/helpers.js +18 -0
  346. package/.medusa/server/src/api/vendor/reservations/middlewares.d.ts +2 -0
  347. package/.medusa/server/src/api/vendor/reservations/middlewares.js +44 -0
  348. package/.medusa/server/src/api/vendor/reservations/query-config.d.ts +19 -0
  349. package/.medusa/server/src/api/vendor/reservations/query-config.js +45 -0
  350. package/.medusa/server/src/api/vendor/reservations/route.d.ts +4 -0
  351. package/.medusa/server/src/api/vendor/reservations/route.js +35 -0
  352. package/.medusa/server/src/api/vendor/reservations/validators.d.ts +295 -0
  353. package/.medusa/server/src/api/vendor/reservations/validators.js +40 -0
  354. package/.medusa/server/src/api/vendor/return-reasons/validators.d.ts +18 -19
  355. package/.medusa/server/src/api/vendor/returns/validators.d.ts +25 -26
  356. package/.medusa/server/src/api/vendor/sales-channels/[id]/products/route.js +2 -1
  357. package/.medusa/server/src/api/vendor/sales-channels/helpers.d.ts +1 -0
  358. package/.medusa/server/src/api/vendor/sales-channels/helpers.js +25 -2
  359. package/.medusa/server/src/api/vendor/sales-channels/validators.d.ts +25 -24
  360. package/.medusa/server/src/api/vendor/sellers/[id]/address/route.js +4 -2
  361. package/.medusa/server/src/api/vendor/sellers/[id]/payment-details/route.js +4 -2
  362. package/.medusa/server/src/api/vendor/sellers/[id]/professional-details/route.js +4 -2
  363. package/.medusa/server/src/api/vendor/sellers/[id]/route.js +4 -2
  364. package/.medusa/server/src/api/vendor/sellers/me/route.js +10 -1
  365. package/.medusa/server/src/api/vendor/sellers/middlewares.js +1 -18
  366. package/.medusa/server/src/api/vendor/sellers/route.js +8 -3
  367. package/.medusa/server/src/api/vendor/sellers/validators.d.ts +25 -46
  368. package/.medusa/server/src/api/vendor/sellers/validators.js +2 -2
  369. package/.medusa/server/src/api/vendor/shipping-option-types/validators.d.ts +18 -19
  370. package/.medusa/server/src/api/vendor/shipping-options/middlewares.js +13 -1
  371. package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +100 -98
  372. package/.medusa/server/src/api/vendor/shipping-options/validators.js +2 -1
  373. package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +20 -21
  374. package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +18 -19
  375. package/.medusa/server/src/api/vendor/stores/validators.d.ts +14 -15
  376. package/.medusa/server/src/links/cart-line-item-offer-link.js +9 -2
  377. package/.medusa/server/src/links/media-product-category-link.d.ts +20 -0
  378. package/.medusa/server/src/links/media-product-category-link.js +34 -0
  379. package/.medusa/server/src/links/media-product-collection-link.d.ts +18 -0
  380. package/.medusa/server/src/links/media-product-collection-link.js +32 -0
  381. package/.medusa/server/src/links/offer-product-link.js +15 -0
  382. package/.medusa/server/src/links/order-line-item-offer-link.js +10 -2
  383. package/.medusa/server/src/links/product-attribute-category-link.d.ts +0 -14
  384. package/.medusa/server/src/links/product-attribute-category-link.js +4 -21
  385. package/.medusa/server/src/links/product-attribute-option-mirror-link.d.ts +6 -0
  386. package/.medusa/server/src/links/product-attribute-option-mirror-link.js +24 -0
  387. package/.medusa/server/src/links/product-attribute-product-link.d.ts +0 -5
  388. package/.medusa/server/src/links/product-attribute-product-link.js +2 -7
  389. package/.medusa/server/src/links/product-attribute-value-option-value-mirror-link.d.ts +6 -0
  390. package/.medusa/server/src/links/product-attribute-value-option-value-mirror-link.js +24 -0
  391. package/.medusa/server/src/links/{product-variant-attribute-value-link.d.ts → product-attribute-value-pivot-link.d.ts} +3 -0
  392. package/.medusa/server/src/links/product-attribute-value-pivot-link.js +23 -0
  393. package/.medusa/server/src/links/seller-customer-group-link.js +15 -0
  394. package/.medusa/server/src/migration-scripts/drop-fulfillment-global-unique-indexes.js +6 -1
  395. package/.medusa/server/src/migration-scripts/rename-default-store.d.ts +2 -0
  396. package/.medusa/server/src/migration-scripts/rename-default-store.js +12 -0
  397. package/.medusa/server/src/modules/commission/index.d.ts +14 -0
  398. package/.medusa/server/src/modules/commission/index.js +3 -1
  399. package/.medusa/server/src/modules/commission/loaders/seed-default-commission-rate.d.ts +11 -0
  400. package/.medusa/server/src/modules/commission/loaders/seed-default-commission-rate.js +35 -0
  401. package/.medusa/server/src/modules/commission/migrations/Migration20260615120000.d.ts +5 -0
  402. package/.medusa/server/src/modules/commission/migrations/Migration20260615120000.js +46 -0
  403. package/.medusa/server/src/modules/commission/models/commission-line.d.ts +2 -1
  404. package/.medusa/server/src/modules/commission/models/commission-line.js +3 -2
  405. package/.medusa/server/src/modules/commission/models/commission-rate-value.d.ts +25 -0
  406. package/.medusa/server/src/modules/commission/models/commission-rate-value.js +17 -0
  407. package/.medusa/server/src/modules/commission/models/commission-rate.d.ts +9 -4
  408. package/.medusa/server/src/modules/commission/models/commission-rate.js +9 -6
  409. package/.medusa/server/src/modules/commission/models/commission-rule.d.ts +8 -3
  410. package/.medusa/server/src/modules/commission/models/index.d.ts +1 -0
  411. package/.medusa/server/src/modules/commission/models/index.js +4 -2
  412. package/.medusa/server/src/modules/commission/service.d.ts +170 -10
  413. package/.medusa/server/src/modules/commission/service.js +270 -114
  414. package/.medusa/server/src/modules/media/index.d.ts +21 -0
  415. package/.medusa/server/src/modules/media/index.js +12 -0
  416. package/.medusa/server/src/modules/media/migrations/Migration20260616000000.d.ts +5 -0
  417. package/.medusa/server/src/modules/media/migrations/Migration20260616000000.js +16 -0
  418. package/.medusa/server/src/modules/media/models/index.d.ts +1 -0
  419. package/.medusa/server/src/modules/media/models/index.js +9 -0
  420. package/.medusa/server/src/modules/media/models/media-image.d.ts +32 -0
  421. package/.medusa/server/src/modules/media/models/media-image.js +41 -0
  422. package/.medusa/server/src/modules/media/service.d.ts +17 -0
  423. package/.medusa/server/src/modules/media/service.js +10 -0
  424. package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.d.ts +5 -0
  425. package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.js +16 -0
  426. package/.medusa/server/src/modules/offer/models/offer.d.ts +2 -0
  427. package/.medusa/server/src/modules/offer/models/offer.js +8 -1
  428. package/.medusa/server/src/modules/offer/service.d.ts +10 -0
  429. package/.medusa/server/src/modules/offer/service.js +100 -1
  430. package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000002.d.ts +14 -0
  431. package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000002.js +31 -0
  432. package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.d.ts +2 -0
  433. package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.js +2 -1
  434. package/.medusa/server/src/modules/product-attribute/models/product-attribute.d.ts +2 -0
  435. package/.medusa/server/src/modules/product-attribute/models/product-attribute.js +2 -1
  436. package/.medusa/server/src/modules/product-attribute/service.d.ts +18 -3
  437. package/.medusa/server/src/modules/product-attribute/service.js +213 -1
  438. package/.medusa/server/src/modules/search/abstract-search-provider.d.ts +9 -0
  439. package/.medusa/server/src/modules/search/abstract-search-provider.js +20 -0
  440. package/.medusa/server/src/modules/search/index.d.ts +10 -0
  441. package/.medusa/server/src/modules/search/index.js +31 -0
  442. package/.medusa/server/src/modules/search/lib/build-docs.d.ts +84 -0
  443. package/.medusa/server/src/modules/search/lib/build-docs.js +207 -0
  444. package/.medusa/server/src/modules/search/lib/reindex.d.ts +7 -0
  445. package/.medusa/server/src/modules/search/lib/reindex.js +61 -0
  446. package/.medusa/server/src/modules/search/lib/sync.d.ts +9 -0
  447. package/.medusa/server/src/modules/search/lib/sync.js +73 -0
  448. package/.medusa/server/src/modules/search/loaders/providers.d.ts +5 -0
  449. package/.medusa/server/src/modules/search/loaders/providers.js +26 -0
  450. package/.medusa/server/src/modules/search/providers/index.d.ts +1 -0
  451. package/.medusa/server/src/modules/search/providers/index.js +6 -0
  452. package/.medusa/server/src/modules/search/providers/orama/index.d.ts +4 -0
  453. package/.medusa/server/src/modules/search/providers/orama/index.js +12 -0
  454. package/.medusa/server/src/modules/search/providers/orama/service.d.ts +19 -0
  455. package/.medusa/server/src/modules/search/providers/orama/service.js +148 -0
  456. package/.medusa/server/src/modules/search/providers/orama/types.d.ts +10 -0
  457. package/.medusa/server/src/modules/search/providers/orama/types.js +3 -0
  458. package/.medusa/server/src/modules/search/services/index.d.ts +2 -0
  459. package/.medusa/server/src/modules/search/services/index.js +24 -0
  460. package/.medusa/server/src/modules/search/services/search-module-service.d.ts +25 -0
  461. package/.medusa/server/src/modules/search/services/search-module-service.js +60 -0
  462. package/.medusa/server/src/modules/search/services/search-provider-service.d.ts +15 -0
  463. package/.medusa/server/src/modules/search/services/search-provider-service.js +30 -0
  464. package/.medusa/server/src/modules/seller/migrations/Migration20260616120000.d.ts +5 -0
  465. package/.medusa/server/src/modules/seller/migrations/Migration20260616120000.js +16 -0
  466. package/.medusa/server/src/modules/seller/models/address.d.ts +2 -2
  467. package/.medusa/server/src/modules/seller/models/member-invite.d.ts +2 -2
  468. package/.medusa/server/src/modules/seller/models/member.d.ts +2 -2
  469. package/.medusa/server/src/modules/seller/models/payment-details.d.ts +2 -2
  470. package/.medusa/server/src/modules/seller/models/payment-details.js +3 -3
  471. package/.medusa/server/src/modules/seller/models/professional-details.d.ts +2 -2
  472. package/.medusa/server/src/modules/seller/models/seller-member.d.ts +4 -4
  473. package/.medusa/server/src/modules/seller/models/seller.d.ts +2 -2
  474. package/.medusa/server/src/modules/seller/repositories/order-group.js +1 -11
  475. package/.medusa/server/src/modules/seller/service.d.ts +16 -16
  476. package/.medusa/server/src/modules/seller/service.js +1 -2
  477. package/.medusa/server/src/subscribers/link-order-line-items-to-offers.d.ts +6 -0
  478. package/.medusa/server/src/subscribers/link-order-line-items-to-offers.js +94 -0
  479. package/.medusa/server/src/subscribers/order-edit-confirmed.d.ts +12 -0
  480. package/.medusa/server/src/subscribers/order-edit-confirmed.js +34 -0
  481. package/.medusa/server/src/subscribers/search-offer-changed.d.ts +6 -0
  482. package/.medusa/server/src/subscribers/search-offer-changed.js +34 -0
  483. package/.medusa/server/src/subscribers/search-product-changed.d.ts +5 -0
  484. package/.medusa/server/src/subscribers/search-product-changed.js +29 -0
  485. package/.medusa/server/src/subscribers/search-product-deleted.d.ts +5 -0
  486. package/.medusa/server/src/subscribers/search-product-deleted.js +23 -0
  487. package/.medusa/server/src/subscribers/search-reindex.d.ts +3 -0
  488. package/.medusa/server/src/subscribers/search-reindex.js +23 -0
  489. package/.medusa/server/src/subscribers/search-seller-changed.d.ts +5 -0
  490. package/.medusa/server/src/subscribers/search-seller-changed.js +44 -0
  491. package/.medusa/server/src/utils/dashboard/dashboard-base.js +6 -2
  492. package/.medusa/server/src/utils/disable-medusa-middlewares.js +7 -1
  493. package/.medusa/server/src/workflows/cart/hooks/validate.js +1 -12
  494. package/.medusa/server/src/workflows/cart/steps/prepare-adjustments-from-promotion-actions.js +3 -5
  495. package/.medusa/server/src/workflows/cart/utils/fields.js +25 -9
  496. package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.js +1 -3
  497. package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.js +1 -2
  498. package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.js +19 -16
  499. package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.d.ts +2 -2
  500. package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.js +1 -2
  501. package/.medusa/server/src/workflows/commission/steps/create-commission-rates.d.ts +1 -28
  502. package/.medusa/server/src/workflows/commission/steps/create-commission-rules.d.ts +13 -4
  503. package/.medusa/server/src/workflows/commission/steps/index.d.ts +1 -0
  504. package/.medusa/server/src/workflows/commission/steps/index.js +2 -1
  505. package/.medusa/server/src/workflows/commission/steps/update-commission-rates.d.ts +13 -4
  506. package/.medusa/server/src/workflows/commission/steps/update-commission-rules.d.ts +13 -4
  507. package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.d.ts +2 -2
  508. package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.js +1 -1
  509. package/.medusa/server/src/workflows/commission/steps/validate-commission-rates-deletable.d.ts +2 -0
  510. package/.medusa/server/src/workflows/commission/steps/validate-commission-rates-deletable.js +19 -0
  511. package/.medusa/server/src/workflows/commission/workflows/create-commission-rates.d.ts +1 -28
  512. package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.d.ts +1 -2
  513. package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.js +3 -1
  514. package/.medusa/server/src/workflows/commission/workflows/refresh-order-commission-lines.js +2 -1
  515. package/.medusa/server/src/workflows/commission/workflows/update-commission-rates.d.ts +13 -4
  516. package/.medusa/server/src/workflows/customer-group/index.d.ts +2 -0
  517. package/.medusa/server/src/workflows/customer-group/index.js +19 -0
  518. package/.medusa/server/src/workflows/customer-group/steps/index.d.ts +1 -0
  519. package/.medusa/server/src/workflows/customer-group/steps/index.js +18 -0
  520. package/.medusa/server/src/workflows/customer-group/steps/link-seller-customer-group.d.ts +6 -0
  521. package/.medusa/server/src/workflows/customer-group/steps/link-seller-customer-group.js +38 -0
  522. package/.medusa/server/src/workflows/customer-group/workflows/create-seller-customer-groups.d.ts +7 -0
  523. package/.medusa/server/src/workflows/customer-group/workflows/create-seller-customer-groups.js +20 -0
  524. package/.medusa/server/src/workflows/customer-group/workflows/index.d.ts +1 -0
  525. package/.medusa/server/src/workflows/customer-group/workflows/index.js +18 -0
  526. package/.medusa/server/src/workflows/index.d.ts +2 -0
  527. package/.medusa/server/src/workflows/index.js +3 -1
  528. package/.medusa/server/src/workflows/media/index.d.ts +2 -0
  529. package/.medusa/server/src/workflows/media/index.js +19 -0
  530. package/.medusa/server/src/workflows/media/steps/create-images.d.ts +20 -0
  531. package/.medusa/server/src/workflows/media/steps/create-images.js +21 -0
  532. package/.medusa/server/src/workflows/media/steps/delete-images.d.ts +3 -0
  533. package/.medusa/server/src/workflows/media/steps/delete-images.js +21 -0
  534. package/.medusa/server/src/workflows/media/steps/index.d.ts +2 -0
  535. package/.medusa/server/src/workflows/media/steps/index.js +19 -0
  536. package/.medusa/server/src/workflows/media/workflows/create-product-category-with-images.d.ts +8 -0
  537. package/.medusa/server/src/workflows/media/workflows/create-product-category-with-images.js +23 -0
  538. package/.medusa/server/src/workflows/media/workflows/create-product-collection-with-images.d.ts +8 -0
  539. package/.medusa/server/src/workflows/media/workflows/create-product-collection-with-images.js +23 -0
  540. package/.medusa/server/src/workflows/media/workflows/delete-product-category-with-images.d.ts +5 -0
  541. package/.medusa/server/src/workflows/media/workflows/delete-product-category-with-images.js +21 -0
  542. package/.medusa/server/src/workflows/media/workflows/delete-product-collection-with-images.d.ts +5 -0
  543. package/.medusa/server/src/workflows/media/workflows/delete-product-collection-with-images.js +21 -0
  544. package/.medusa/server/src/workflows/media/workflows/index.d.ts +8 -0
  545. package/.medusa/server/src/workflows/media/workflows/index.js +25 -0
  546. package/.medusa/server/src/workflows/media/workflows/set-category-images.d.ts +13 -0
  547. package/.medusa/server/src/workflows/media/workflows/set-category-images.js +71 -0
  548. package/.medusa/server/src/workflows/media/workflows/set-collection-images.d.ts +13 -0
  549. package/.medusa/server/src/workflows/media/workflows/set-collection-images.js +71 -0
  550. package/.medusa/server/src/workflows/media/workflows/update-product-category-with-images.d.ts +9 -0
  551. package/.medusa/server/src/workflows/media/workflows/update-product-category-with-images.js +22 -0
  552. package/.medusa/server/src/workflows/media/workflows/update-product-collection-with-images.d.ts +9 -0
  553. package/.medusa/server/src/workflows/media/workflows/update-product-collection-with-images.js +22 -0
  554. package/.medusa/server/src/workflows/offer/steps/add-offer-prices.d.ts +0 -12
  555. package/.medusa/server/src/workflows/offer/steps/add-offer-prices.js +1 -16
  556. package/.medusa/server/src/workflows/offer/steps/create-offers.d.ts +2 -0
  557. package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.d.ts +0 -9
  558. package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.js +1 -10
  559. package/.medusa/server/src/workflows/offer/steps/update-offers.d.ts +2 -5
  560. package/.medusa/server/src/workflows/offer/steps/update-offers.js +1 -1
  561. package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.d.ts +0 -11
  562. package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.js +1 -12
  563. package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.d.ts +0 -10
  564. package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.js +1 -19
  565. package/.medusa/server/src/workflows/offer/workflows/create-offers.js +4 -16
  566. package/.medusa/server/src/workflows/offer/workflows/delete-offers.js +7 -2
  567. package/.medusa/server/src/workflows/offer/workflows/update-offers.d.ts +0 -11
  568. package/.medusa/server/src/workflows/offer/workflows/update-offers.js +2 -23
  569. package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.d.ts +1 -2
  570. package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.js +1 -2
  571. package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.d.ts +7 -0
  572. package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.js +149 -0
  573. package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.d.ts +7 -0
  574. package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.js +152 -0
  575. package/.medusa/server/src/workflows/order/workflows/confirm-order-edit-request.d.ts +7 -0
  576. package/.medusa/server/src/workflows/order/workflows/confirm-order-edit-request.js +165 -0
  577. package/.medusa/server/src/workflows/order/workflows/confirm-return-receive.js +1 -9
  578. package/.medusa/server/src/workflows/order/workflows/create-order-fulfillment.js +2 -3
  579. package/.medusa/server/src/workflows/order/workflows/index.d.ts +3 -0
  580. package/.medusa/server/src/workflows/order/workflows/index.js +4 -1
  581. package/.medusa/server/src/workflows/order-group/utils/aggregate-status.js +1 -7
  582. package/.medusa/server/src/workflows/order-group/workflows/get-order-groups-list.d.ts +1 -0
  583. package/.medusa/server/src/workflows/order-group/workflows/get-order-groups-list.js +11 -2
  584. package/.medusa/server/src/workflows/payout/workflows/create-payout.js +34 -21
  585. package/.medusa/server/src/workflows/product/events.d.ts +0 -6
  586. package/.medusa/server/src/workflows/product/events.js +1 -7
  587. package/.medusa/server/src/workflows/product/steps/index.d.ts +0 -2
  588. package/.medusa/server/src/workflows/product/steps/index.js +1 -3
  589. package/.medusa/server/src/workflows/product/steps/validate-products-status.d.ts +0 -8
  590. package/.medusa/server/src/workflows/product/steps/validate-products-status.js +1 -9
  591. package/.medusa/server/src/workflows/product/steps/validate-seller-product-permissions.js +1 -3
  592. package/.medusa/server/src/workflows/product/workflows/assign-products-to-category.d.ts +12 -0
  593. package/.medusa/server/src/workflows/product/workflows/assign-products-to-category.js +23 -0
  594. package/.medusa/server/src/workflows/product/workflows/confirm-products.d.ts +4 -20
  595. package/.medusa/server/src/workflows/product/workflows/confirm-products.js +2 -13
  596. package/.medusa/server/src/workflows/product/workflows/create-products.d.ts +4 -52
  597. package/.medusa/server/src/workflows/product/workflows/create-products.js +69 -142
  598. package/.medusa/server/src/workflows/product/workflows/index.d.ts +1 -1
  599. package/.medusa/server/src/workflows/product/workflows/index.js +2 -2
  600. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.d.ts +0 -7
  601. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.js +1 -1
  602. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.d.ts +0 -7
  603. package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.js +1 -1
  604. package/.medusa/server/src/workflows/product/workflows/reject-product.d.ts +4 -11
  605. package/.medusa/server/src/workflows/product/workflows/reject-product.js +2 -8
  606. package/.medusa/server/src/workflows/product/workflows/request-product-change.d.ts +4 -18
  607. package/.medusa/server/src/workflows/product/workflows/request-product-change.js +2 -15
  608. package/.medusa/server/src/workflows/product-attribute/events.d.ts +0 -9
  609. package/.medusa/server/src/workflows/product-attribute/events.js +1 -10
  610. package/.medusa/server/src/workflows/product-attribute/steps/create-product-attribute-values.d.ts +1 -31
  611. package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.d.ts +1 -41
  612. package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.js +1 -1
  613. package/.medusa/server/src/workflows/product-attribute/steps/detach-product-option-values-from-product.d.ts +14 -0
  614. package/.medusa/server/src/workflows/product-attribute/steps/detach-product-option-values-from-product.js +40 -0
  615. package/.medusa/server/src/workflows/product-attribute/steps/index.d.ts +3 -4
  616. package/.medusa/server/src/workflows/product-attribute/steps/index.js +4 -5
  617. package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.d.ts +6 -3
  618. package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.js +17 -2
  619. package/.medusa/server/src/workflows/product-attribute/steps/update-product-attributes.d.ts +1 -31
  620. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-linked.d.ts +2 -0
  621. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-linked.js +28 -0
  622. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-required.d.ts +7 -0
  623. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-required.js +16 -0
  624. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attributes-to-product.d.ts +9 -0
  625. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attributes-to-product.js +242 -0
  626. package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-product-attributes.d.ts +15 -0
  627. package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-product-attributes.js +28 -0
  628. package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attribute-values.js +44 -3
  629. package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attributes.js +41 -17
  630. package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attribute-values.js +36 -15
  631. package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.d.ts +0 -7
  632. package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.js +11 -8
  633. package/.medusa/server/src/workflows/product-attribute/workflows/index.d.ts +4 -5
  634. package/.medusa/server/src/workflows/product-attribute/workflows/index.js +5 -6
  635. package/.medusa/server/src/workflows/product-attribute/workflows/remove-product-attributes-from-product.d.ts +10 -0
  636. package/.medusa/server/src/workflows/product-attribute/workflows/remove-product-attributes-from-product.js +83 -0
  637. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute-values.js +34 -1
  638. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes-on-product.d.ts +11 -0
  639. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes-on-product.js +285 -0
  640. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes.js +15 -1
  641. package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.d.ts +4 -11
  642. package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.js +19 -19
  643. package/.medusa/server/src/workflows/product-edit/events.d.ts +0 -7
  644. package/.medusa/server/src/workflows/product-edit/events.js +1 -8
  645. package/.medusa/server/src/workflows/product-edit/steps/apply-variant-image-links.d.ts +16 -0
  646. package/.medusa/server/src/workflows/product-edit/steps/apply-variant-image-links.js +35 -0
  647. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.d.ts +0 -4
  648. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.js +1 -5
  649. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.d.ts +0 -6
  650. package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.js +1 -7
  651. package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.d.ts +0 -5
  652. package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.js +1 -6
  653. package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.d.ts +0 -6
  654. package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.js +1 -1
  655. package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.d.ts +0 -5
  656. package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.js +1 -6
  657. package/.medusa/server/src/workflows/product-edit/steps/index.d.ts +1 -0
  658. package/.medusa/server/src/workflows/product-edit/steps/index.js +2 -1
  659. package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.d.ts +0 -5
  660. package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.js +1 -6
  661. package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.d.ts +0 -6
  662. package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.js +2 -8
  663. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.d.ts +5 -19
  664. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.js +11 -128
  665. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.d.ts +0 -31
  666. package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.js +43 -50
  667. package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.d.ts +1 -9
  668. package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.js +3 -11
  669. package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.d.ts +0 -11
  670. package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.js +1 -12
  671. package/.medusa/server/src/workflows/product-edit/workflows/index.d.ts +1 -1
  672. package/.medusa/server/src/workflows/product-edit/workflows/index.js +2 -2
  673. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.d.ts +0 -7
  674. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.js +10 -9
  675. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.d.ts +4 -46
  676. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.js +11 -162
  677. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-product.d.ts +16 -0
  678. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-product.js +139 -0
  679. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.d.ts +0 -10
  680. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.js +71 -17
  681. package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.d.ts +0 -24
  682. package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.js +1 -15
  683. package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.d.ts +1 -25
  684. package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.js +2 -15
  685. package/.medusa/server/src/workflows/promotion/steps/register-usage.d.ts +0 -3
  686. package/.medusa/server/src/workflows/promotion/steps/register-usage.js +1 -4
  687. package/.medusa/server/src/workflows/seller/steps/create-seller-member.d.ts +4 -4
  688. package/.medusa/server/src/workflows/seller/steps/update-member.d.ts +2 -2
  689. package/.medusa/server/src/workflows/seller/steps/update-seller-member.d.ts +4 -4
  690. package/.medusa/server/src/workflows/seller/workflows/accept-member-invite.js +1 -2
  691. package/.medusa/server/src/workflows/seller/workflows/add-seller-member.d.ts +4 -4
  692. package/.medusa/server/src/workflows/seller/workflows/approve-seller.d.ts +4 -4
  693. package/.medusa/server/src/workflows/seller/workflows/approve-seller.js +2 -1
  694. package/.medusa/server/src/workflows/seller/workflows/create-sellers.js +1 -2
  695. package/.medusa/server/src/workflows/seller/workflows/suspend-seller.d.ts +4 -4
  696. package/.medusa/server/src/workflows/seller/workflows/suspend-seller.js +2 -1
  697. package/.medusa/server/src/workflows/seller/workflows/terminate-seller.d.ts +4 -4
  698. package/.medusa/server/src/workflows/seller/workflows/terminate-seller.js +2 -1
  699. package/.medusa/server/src/workflows/seller/workflows/unsuspend-seller.d.ts +4 -4
  700. package/.medusa/server/src/workflows/seller/workflows/unsuspend-seller.js +2 -1
  701. package/.medusa/server/src/workflows/seller/workflows/unterminate-seller.d.ts +4 -4
  702. package/.medusa/server/src/workflows/seller/workflows/unterminate-seller.js +2 -1
  703. package/.medusa/server/src/workflows/seller/workflows/update-member.d.ts +12 -101
  704. package/.medusa/server/src/workflows/seller/workflows/update-member.js +6 -2
  705. package/package.json +22 -21
  706. package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.d.ts +0 -4
  707. package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.js +0 -65
  708. package/.medusa/server/src/api/admin/products/[id]/attributes/route.d.ts +0 -5
  709. package/.medusa/server/src/api/admin/products/[id]/attributes/route.js +0 -63
  710. package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.d.ts +0 -10
  711. package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.js +0 -62
  712. package/.medusa/server/src/api/vendor/products/[id]/attributes/route.d.ts +0 -15
  713. package/.medusa/server/src/api/vendor/products/[id]/attributes/route.js +0 -82
  714. package/.medusa/server/src/links/line-item-commission-line-link.js +0 -21
  715. package/.medusa/server/src/links/product-attribute-value-link.d.ts +0 -22
  716. package/.medusa/server/src/links/product-attribute-value-link.js +0 -46
  717. package/.medusa/server/src/links/product-variant-attribute-link.js +0 -21
  718. package/.medusa/server/src/links/product-variant-attribute-value-link.js +0 -21
  719. package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.d.ts +0 -28
  720. package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.js +0 -72
  721. package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.d.ts +0 -90
  722. package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.js +0 -185
  723. package/.medusa/server/src/workflows/product/workflows/update-products.d.ts +0 -39
  724. package/.medusa/server/src/workflows/product/workflows/update-products.js +0 -161
  725. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.d.ts +0 -43
  726. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.js +0 -51
  727. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.d.ts +0 -7
  728. package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.js +0 -59
  729. package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.d.ts +0 -6
  730. package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.js +0 -20
  731. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.d.ts +0 -7
  732. package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.js +0 -20
  733. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.d.ts +0 -52
  734. package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.js +0 -120
  735. package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.d.ts +0 -23
  736. package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.js +0 -252
  737. package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.d.ts +0 -17
  738. package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.js +0 -62
  739. package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.d.ts +0 -135
  740. package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.js +0 -43
  741. package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.d.ts +0 -24
  742. package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.js +0 -27
  743. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.d.ts +0 -25
  744. package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.js +0 -148
  745. /package/.medusa/server/src/links/{line-item-commission-line-link.d.ts → offer-product-link.d.ts} +0 -0
  746. /package/.medusa/server/src/links/{product-variant-attribute-link.d.ts → seller-customer-group-link.d.ts} +0 -0
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminUpdateCollection = exports.AdminCreateCollection = exports.AdminCollectionsParams = exports.AdminCollectionParams = void 0;
4
+ const zod_1 = require("zod");
5
+ const validators_1 = require("@medusajs/medusa/api/utils/validators");
6
+ exports.AdminCollectionParams = (0, validators_1.createSelectParams)();
7
+ const AdminCollectionsParamsFields = zod_1.z.object({
8
+ q: zod_1.z.string().optional(),
9
+ id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
10
+ title: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
11
+ handle: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
12
+ created_at: (0, validators_1.createOperatorMap)().optional(),
13
+ updated_at: (0, validators_1.createOperatorMap)().optional(),
14
+ deleted_at: (0, validators_1.createOperatorMap)().optional(),
15
+ });
16
+ exports.AdminCollectionsParams = (0, validators_1.createFindParams)({
17
+ offset: 0,
18
+ limit: 20,
19
+ }).merge(AdminCollectionsParamsFields);
20
+ const CollectionMedia = zod_1.z.object({
21
+ url: zod_1.z.string(),
22
+ is_thumbnail: zod_1.z.boolean().optional(),
23
+ is_banner: zod_1.z.boolean().optional(),
24
+ rank: zod_1.z.number().optional(),
25
+ });
26
+ const CreateCollection = zod_1.z.object({
27
+ title: zod_1.z.string(),
28
+ handle: zod_1.z.string().optional(),
29
+ metadata: zod_1.z.record(zod_1.z.unknown()).nullish(),
30
+ media: zod_1.z.array(CollectionMedia).optional(),
31
+ icon: zod_1.z.string().nullish(),
32
+ });
33
+ exports.AdminCreateCollection = (0, validators_1.WithAdditionalData)(CreateCollection);
34
+ const UpdateCollection = zod_1.z.object({
35
+ title: zod_1.z.string().optional(),
36
+ handle: zod_1.z.string().optional(),
37
+ metadata: zod_1.z.record(zod_1.z.unknown()).nullish(),
38
+ media: zod_1.z.array(CollectionMedia).optional(),
39
+ icon: zod_1.z.string().nullish(),
40
+ });
41
+ exports.AdminUpdateCollection = (0, validators_1.WithAdditionalData)(UpdateCollection);
42
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvYWRtaW4vY29sbGVjdGlvbnMvdmFsaWRhdG9ycy50cyJdLCJ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QUMsTUFBTSxDQUFDO0lBQ2hDLEtBQUssRUFBRSxPQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQzVCLE1BQU0sRUFBRSxPQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQzdCLFFBQVEsRUFBRSxPQUFDLENBQUMsTUFBTSxDQUFDLE9BQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDLE9BQU8sRUFBRTtJQUN6QyxLQUFLLEVBQUUsT0FBQyxDQUFDLEtBQUssQ0FBQyxlQUFlLENBQUMsQ0FBQyxRQUFRLEVBQUU7SUFDMUMsSUFBSSxFQUFFLE9BQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxPQUFPLEVBQUU7Q0FDM0IsQ0FBQyxDQUFBO0FBQ1csUUFBQSxxQkFBcUIsR0FBRyxJQUFBLCtCQUFrQixFQUFDLGdCQUFnQixDQUFDLENBQUEifQ==
@@ -6,18 +6,20 @@ exports.adminCommissionRateFields = [
6
6
  "name",
7
7
  "code",
8
8
  "type",
9
- "target",
10
9
  "value",
11
10
  "currency_code",
12
- "min_amount",
13
11
  "include_tax",
12
+ "include_shipping",
14
13
  "is_enabled",
15
- "priority",
14
+ "is_default",
16
15
  "created_at",
17
16
  "updated_at",
18
17
  "rules.id",
19
18
  "rules.reference",
20
19
  "rules.reference_id",
20
+ "values.id",
21
+ "values.currency_code",
22
+ "values.amount",
21
23
  ];
22
24
  exports.adminCommissionRateQueryConfig = {
23
25
  list: {
@@ -29,4 +31,4 @@ exports.adminCommissionRateQueryConfig = {
29
31
  isList: false,
30
32
  },
31
33
  };
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnktY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2FwaS9hZG1pbi9jb21taXNzaW9uLXJhdGVzL3F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c0I7SUFDdEIsZUFBZTtDQUNoQixDQUFBO0FBRVksUUFBQSw4QkFBOEIsR0FBRztJQUM1QyxJQUFJLEVBQUU7UUFDSixRQUFRLEVBQUUsaUNBQXlCO1FBQ25DLE1BQU0sRUFBRSxJQUFJO0tBQ2I7SUFDRCxRQUFRLEVBQUU7UUFDUixRQUFRLEVBQUUsaUNBQXlCO1FBQ25DLE1BQU0sRUFBRSxLQUFLO0tBQ2Q7Q0FDRixDQUFBIn0=
@@ -5,6 +5,9 @@ const utils_1 = require("@medusajs/framework/utils");
5
5
  const commission_1 = require("../../../workflows/commission");
6
6
  const GET = async (req, res) => {
7
7
  const query = req.scope.resolve(utils_1.ContainerRegistrationKeys.QUERY);
8
+ // The virtual `scope_type` filter (derived from each rate's rules) is
9
+ // resolved DB-side in CommissionModuleService.listAndCountCommissionRates,
10
+ // which query.graph delegates to — the route just forwards the filters.
8
11
  const { data: commission_rates, metadata } = await query.graph({
9
12
  entity: "commission_rate",
10
13
  fields: req.queryConfig.fields,
@@ -32,4 +35,4 @@ const POST = async (req, res) => {
32
35
  res.status(201).json({ commission_rate });
33
36
  };
34
37
  exports.POST = POST;
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL2FkbWluL2NvbW1pc3Npb24tcmF0ZXMvcm91dGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBSUEscURBQXFFO0FBSXJFLDhEQUE2RTtBQUV0RSxNQUFNLEdBQUcsR0FBRyxLQUFLLEVBQ3RCLEdBQStCLEVBQy9CLEdBQThELEVBQzlELEVBQUU7SUFDRixNQUFNLEtBQUssR0FBRyxHQUFHLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxpQ0FBeUIsQ0FBQyxLQUFLLENBQUMsQ0FBQTtJQUVoRSxNQU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UsRUFBRTtLQUM5QixDQUFDLENBQUE7SUFFRixHQUFHLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUFFLGVBQWUsRUFBRSxDQUFDLENBQUE7QUFDM0MsQ0FBQyxDQUFBO0FBbkJZLFFBQUEsSUFBSSxRQW1CaEIifQ==
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
2
- import { CommissionRateTarget, CommissionRateType } from "@mercurjs/types";
2
+ import { CommissionRateType } from "@mercurjs/types";
3
3
  export type AdminGetCommissionRateParamsType = z.infer<typeof AdminGetCommissionRateParams>;
4
4
  export declare const AdminGetCommissionRateParams: z.ZodObject<{
5
5
  fields: z.ZodOptional<z.ZodString>;
6
- }, "strip", z.ZodTypeAny, {
6
+ }, z.core.$strip, z.ZodTypeAny, {
7
7
  fields?: string | undefined;
8
8
  }, {
9
9
  fields?: string | undefined;
@@ -11,19 +11,19 @@ export declare const AdminGetCommissionRateParams: z.ZodObject<{
11
11
  export type AdminGetCommissionRatesParamsType = z.infer<typeof AdminGetCommissionRatesParams>;
12
12
  export declare const AdminGetCommissionRatesParams: z.ZodObject<{
13
13
  fields: z.ZodOptional<z.ZodString>;
14
- } & {
15
- offset: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
16
- limit: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
14
+ offset: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
15
+ limit: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
17
16
  order: z.ZodOptional<z.ZodString> | z.ZodDefault<z.ZodOptional<z.ZodString>>;
18
- with_deleted: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
17
+ with_deleted: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodBoolean>>;
19
18
  } & {
20
19
  q: z.ZodOptional<z.ZodString>;
21
20
  id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
22
21
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
23
22
  type: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
24
- target: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
25
- is_enabled: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBoolean, z.ZodString]>, string | boolean, string | boolean>, boolean, string | boolean>>;
26
- created_at: z.ZodOptional<z.ZodUnion<[any, z.ZodObject<{
23
+ scope_type: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
24
+ is_enabled: any;
25
+ is_default: any;
26
+ created_at: z.ZodOptional<z.ZodUnion<readonly [any, z.ZodObject<{
27
27
  $eq: any;
28
28
  $ne: any;
29
29
  $in: any;
@@ -36,7 +36,7 @@ export declare const AdminGetCommissionRatesParams: z.ZodObject<{
36
36
  $gte: any;
37
37
  $lt: any;
38
38
  $lte: any;
39
- }, "strip", z.ZodTypeAny, {
39
+ }, z.core.$strip, z.ZodTypeAny, {
40
40
  $eq?: any;
41
41
  $ne?: any;
42
42
  $in?: any;
@@ -63,7 +63,7 @@ export declare const AdminGetCommissionRatesParams: z.ZodObject<{
63
63
  $lt?: any;
64
64
  $lte?: any;
65
65
  }>]>>;
66
- updated_at: z.ZodOptional<z.ZodUnion<[any, z.ZodObject<{
66
+ updated_at: z.ZodOptional<z.ZodUnion<readonly [any, z.ZodObject<{
67
67
  $eq: any;
68
68
  $ne: any;
69
69
  $in: any;
@@ -76,7 +76,7 @@ export declare const AdminGetCommissionRatesParams: z.ZodObject<{
76
76
  $gte: any;
77
77
  $lt: any;
78
78
  $lte: any;
79
- }, "strip", z.ZodTypeAny, {
79
+ }, z.core.$strip, z.ZodTypeAny, {
80
80
  $eq?: any;
81
81
  $ne?: any;
82
82
  $in?: any;
@@ -104,46 +104,49 @@ export declare const AdminGetCommissionRatesParams: z.ZodObject<{
104
104
  $lte?: any;
105
105
  }>]>>;
106
106
  }, "strip", z.ZodTypeAny, {
107
- offset: number;
108
- limit: number;
109
- id?: string | string[] | undefined;
110
- created_at?: any;
111
- updated_at?: any;
112
- code?: string | string[] | undefined;
113
- type?: string | string[] | undefined;
114
- q?: string | undefined;
115
- fields?: string | undefined;
116
- order?: string | undefined;
117
- with_deleted?: boolean | undefined;
118
- target?: string | string[] | undefined;
119
- is_enabled?: boolean | undefined;
107
+ [x: string]: any;
108
+ fields?: unknown;
109
+ offset?: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
110
+ limit?: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
111
+ order?: unknown;
112
+ with_deleted?: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodBoolean>>;
113
+ q?: unknown;
114
+ id?: unknown;
115
+ code?: unknown;
116
+ type?: unknown;
117
+ scope_type?: unknown;
118
+ is_enabled?: unknown;
119
+ is_default?: unknown;
120
+ created_at?: unknown;
121
+ updated_at?: unknown;
120
122
  }, {
121
- id?: string | string[] | undefined;
122
- created_at?: any;
123
- updated_at?: any;
124
- code?: string | string[] | undefined;
125
- type?: string | string[] | undefined;
126
- offset?: unknown;
127
- limit?: unknown;
128
- q?: string | undefined;
129
- fields?: string | undefined;
130
- order?: string | undefined;
131
- with_deleted?: unknown;
132
- target?: string | string[] | undefined;
133
- is_enabled?: string | boolean | undefined;
123
+ [x: string]: any;
124
+ fields?: unknown;
125
+ offset?: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
126
+ limit?: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
127
+ order?: unknown;
128
+ with_deleted?: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodBoolean>>;
129
+ q?: unknown;
130
+ id?: unknown;
131
+ code?: unknown;
132
+ type?: unknown;
133
+ scope_type?: unknown;
134
+ is_enabled?: unknown;
135
+ is_default?: unknown;
136
+ created_at?: unknown;
137
+ updated_at?: unknown;
134
138
  }>;
135
139
  export type AdminCreateCommissionRateType = z.infer<typeof AdminCreateCommissionRate>;
136
140
  export declare const AdminCreateCommissionRate: z.ZodObject<{
137
141
  name: z.ZodString;
138
142
  code: z.ZodString;
139
143
  type: z.ZodNativeEnum<typeof CommissionRateType>;
140
- target: z.ZodOptional<z.ZodNativeEnum<typeof CommissionRateTarget>>;
141
144
  value: z.ZodNumber;
142
145
  currency_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
- min_amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
144
146
  include_tax: z.ZodOptional<z.ZodBoolean>;
147
+ include_shipping: z.ZodOptional<z.ZodBoolean>;
145
148
  is_enabled: z.ZodOptional<z.ZodBoolean>;
146
- priority: z.ZodOptional<z.ZodNumber>;
149
+ is_default: z.ZodOptional<z.ZodBoolean>;
147
150
  rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
148
151
  reference: z.ZodString;
149
152
  reference_id: z.ZodString;
@@ -154,71 +157,99 @@ export declare const AdminCreateCommissionRate: z.ZodObject<{
154
157
  reference: string;
155
158
  reference_id: string;
156
159
  }>, "many">>;
160
+ values: z.ZodOptional<z.ZodArray<z.ZodObject<{
161
+ currency_code: z.ZodString;
162
+ amount: z.ZodNumber;
163
+ }, "strip", z.ZodTypeAny, {
164
+ currency_code: string;
165
+ amount: number;
166
+ }, {
167
+ currency_code: string;
168
+ amount: number;
169
+ }>, "many">>;
157
170
  }, "strip", z.ZodTypeAny, {
158
171
  value: number;
159
172
  code: string;
160
173
  type: CommissionRateType;
161
174
  name: string;
175
+ values?: {
176
+ currency_code: string;
177
+ amount: number;
178
+ }[] | undefined;
162
179
  currency_code?: string | null | undefined;
163
180
  rules?: {
164
181
  reference: string;
165
182
  reference_id: string;
166
183
  }[] | undefined;
167
- target?: CommissionRateTarget | undefined;
168
- min_amount?: number | null | undefined;
169
184
  include_tax?: boolean | undefined;
185
+ include_shipping?: boolean | undefined;
170
186
  is_enabled?: boolean | undefined;
171
- priority?: number | undefined;
187
+ is_default?: boolean | undefined;
172
188
  }, {
173
189
  value: number;
174
190
  code: string;
175
191
  type: CommissionRateType;
176
192
  name: string;
193
+ values?: {
194
+ currency_code: string;
195
+ amount: number;
196
+ }[] | undefined;
177
197
  currency_code?: string | null | undefined;
178
198
  rules?: {
179
199
  reference: string;
180
200
  reference_id: string;
181
201
  }[] | undefined;
182
- target?: CommissionRateTarget | undefined;
183
- min_amount?: number | null | undefined;
184
202
  include_tax?: boolean | undefined;
203
+ include_shipping?: boolean | undefined;
185
204
  is_enabled?: boolean | undefined;
186
- priority?: number | undefined;
205
+ is_default?: boolean | undefined;
187
206
  }>;
188
207
  export type AdminUpdateCommissionRateType = z.infer<typeof AdminUpdateCommissionRate>;
189
208
  export declare const AdminUpdateCommissionRate: z.ZodObject<{
190
209
  name: z.ZodOptional<z.ZodString>;
191
210
  code: z.ZodOptional<z.ZodString>;
192
211
  type: z.ZodOptional<z.ZodNativeEnum<typeof CommissionRateType>>;
193
- target: z.ZodOptional<z.ZodNativeEnum<typeof CommissionRateTarget>>;
194
212
  value: z.ZodOptional<z.ZodNumber>;
195
213
  currency_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
- min_amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
197
214
  include_tax: z.ZodOptional<z.ZodBoolean>;
215
+ include_shipping: z.ZodOptional<z.ZodBoolean>;
198
216
  is_enabled: z.ZodOptional<z.ZodBoolean>;
199
- priority: z.ZodOptional<z.ZodNumber>;
217
+ values: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
+ currency_code: z.ZodString;
219
+ amount: z.ZodNumber;
220
+ }, "strip", z.ZodTypeAny, {
221
+ currency_code: string;
222
+ amount: number;
223
+ }, {
224
+ currency_code: string;
225
+ amount: number;
226
+ }>, "many">>;
200
227
  }, "strip", z.ZodTypeAny, {
228
+ values?: {
229
+ currency_code: string;
230
+ amount: number;
231
+ }[] | undefined;
201
232
  value?: number | undefined;
202
233
  code?: string | undefined;
203
234
  type?: CommissionRateType | undefined;
204
- currency_code?: string | null | undefined;
205
235
  name?: string | undefined;
206
- target?: CommissionRateTarget | undefined;
207
- min_amount?: number | null | undefined;
236
+ currency_code?: string | null | undefined;
208
237
  include_tax?: boolean | undefined;
238
+ include_shipping?: boolean | undefined;
209
239
  is_enabled?: boolean | undefined;
210
- priority?: number | undefined;
211
240
  }, {
241
+ values?: {
242
+ currency_code: string;
243
+ amount: number;
244
+ }[] | undefined;
212
245
  value?: number | undefined;
213
246
  code?: string | undefined;
214
247
  type?: CommissionRateType | undefined;
215
- currency_code?: string | null | undefined;
216
248
  name?: string | undefined;
217
- target?: CommissionRateTarget | undefined;
218
- min_amount?: number | null | undefined;
249
+ currency_code?: string | null | undefined;
219
250
  include_tax?: boolean | undefined;
251
+ include_shipping?: boolean | undefined;
220
252
  is_enabled?: boolean | undefined;
221
- priority?: number | undefined;
222
253
  }>;
223
254
  export type AdminBatchCommissionRulesType = z.infer<typeof AdminBatchCommissionRules>;
224
255
  export declare const AdminBatchCommissionRules: z.ZodObject<{
@@ -14,8 +14,12 @@ exports.AdminGetCommissionRatesParams = (0, validators_1.createFindParams)({
14
14
  id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
15
15
  code: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
16
16
  type: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
17
- target: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
17
+ // Virtual filter: the rule scope ("store", "product_type", "category",
18
+ // "store_product_type", "store_category"). Derived from each rate's
19
+ // linked rules in the route, not a stored column.
20
+ scope_type: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
18
21
  is_enabled: (0, common_1.booleanString)().optional(),
22
+ is_default: (0, common_1.booleanString)().optional(),
19
23
  created_at: (0, validators_1.createOperatorMap)().optional(),
20
24
  updated_at: (0, validators_1.createOperatorMap)().optional(),
21
25
  }));
@@ -23,30 +27,33 @@ const CommissionRuleSchema = zod_1.z.object({
23
27
  reference: zod_1.z.string(),
24
28
  reference_id: zod_1.z.string(),
25
29
  });
30
+ const CommissionRateValueSchema = zod_1.z.object({
31
+ currency_code: zod_1.z.string(),
32
+ amount: zod_1.z.number(),
33
+ });
26
34
  exports.AdminCreateCommissionRate = zod_1.z.object({
27
35
  name: zod_1.z.string(),
28
- code: zod_1.z.string(),
36
+ code: zod_1.z.string().min(1),
29
37
  type: zod_1.z.nativeEnum(types_1.CommissionRateType),
30
- target: zod_1.z.nativeEnum(types_1.CommissionRateTarget).optional(),
31
38
  value: zod_1.z.number(),
32
39
  currency_code: zod_1.z.string().nullish(),
33
- min_amount: zod_1.z.number().nullish(),
34
40
  include_tax: zod_1.z.boolean().optional(),
41
+ include_shipping: zod_1.z.boolean().optional(),
35
42
  is_enabled: zod_1.z.boolean().optional(),
36
- priority: zod_1.z.number().optional(),
43
+ is_default: zod_1.z.boolean().optional(),
37
44
  rules: zod_1.z.array(CommissionRuleSchema).optional(),
45
+ values: zod_1.z.array(CommissionRateValueSchema).optional(),
38
46
  });
39
47
  exports.AdminUpdateCommissionRate = zod_1.z.object({
40
48
  name: zod_1.z.string().optional(),
41
49
  code: zod_1.z.string().optional(),
42
50
  type: zod_1.z.nativeEnum(types_1.CommissionRateType).optional(),
43
- target: zod_1.z.nativeEnum(types_1.CommissionRateTarget).optional(),
44
51
  value: zod_1.z.number().optional(),
45
52
  currency_code: zod_1.z.string().nullish(),
46
- min_amount: zod_1.z.number().nullish(),
47
53
  include_tax: zod_1.z.boolean().optional(),
54
+ include_shipping: zod_1.z.boolean().optional(),
48
55
  is_enabled: zod_1.z.boolean().optional(),
49
- priority: zod_1.z.number().optional(),
56
+ values: zod_1.z.array(CommissionRateValueSchema).optional(),
50
57
  });
51
58
  const UpdateCommissionRuleSchema = zod_1.z.object({
52
59
  id: zod_1.z.string(),
@@ -58,4 +65,4 @@ exports.AdminBatchCommissionRules = zod_1.z.object({
58
65
  update: zod_1.z.array(UpdateCommissionRuleSchema).optional(),
59
66
  delete: zod_1.z.array(zod_1.z.string()).optional(),
60
67
  });
61
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvYWRtaW4vY29tbWlzc2lvbi1yYXRlcy92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDZCQUF1QjtBQUN2QixzRUFJOEM7QUFDOUMsZ0ZBQW1GO0FBQ25GLDJDQUEwRTtBQUs3RCxRQUFBLDRCQUE0QixHQUFHLElBQUEsK0JBQWtCLEdBQUUsQ0FBQTtBQUtuRCxRQUFBLDZCQUE2QixHQUFHLElBQUEsNkJBQWdCLEVBQUM7SUFDNUQsTUFBTSxFQUFFLENBQUM7SUFDVCxLQUFLLEVBQUUsRUFBRTtDQUNWLENBQUMsQ0FBQyxLQUFLLENBQ04sT0FBQyxDQUFDLE1BQU0sQ0FBQztJQUNQLENBQUMsRUFBRSxPQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3hCLEVBQUUsRUFBRSxPQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsT0FBQyxDQUFDLE1BQU0sRUFBRSxFQUFFLE9BQUMsQ0FBQyxLQUFLLENBQUMsT0FBQyxDQ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yxLQUFLLENBQUMsMEJBQTBCLENBQUMsQ0FBQyxRQUFRLEVBQUU7SUFDdEQsTUFBTSxFQUFFLE9BQUMsQ0FBQyxLQUFLLENBQUMsT0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsUUFBUSxFQUFFO0NBQ3ZDLENBQUMsQ0FBQSJ9
@@ -0,0 +1,2 @@
1
+ import { MiddlewareRoute } from "@medusajs/framework/http";
2
+ export declare const adminCustomerGroupsMiddlewares: MiddlewareRoute[];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adminCustomerGroupsMiddlewares = void 0;
4
+ const http_1 = require("@medusajs/framework/http");
5
+ const framework_1 = require("@medusajs/framework");
6
+ const query_config_1 = require("@medusajs/medusa/api/admin/customer-groups/query-config");
7
+ const disable_medusa_middlewares_1 = require("../../../utils/disable-medusa-middlewares");
8
+ const validators_1 = require("./validators");
9
+ const LIST_MATCHER = "/admin/customer-groups";
10
+ const capturedBase = (disable_medusa_middlewares_1.ORIGINAL_MIDDLEWARES["dist/api/admin/customer-groups/middlewares.js"] ?? []);
11
+ const baseWithoutListGet = capturedBase.filter((route) => {
12
+ if (route.matcher !== LIST_MATCHER) {
13
+ return true;
14
+ }
15
+ const methods = Array.isArray(route.method)
16
+ ? route.method
17
+ : route.method
18
+ ? [route.method]
19
+ : [];
20
+ return !methods.includes("GET");
21
+ });
22
+ const maybeApplyCustomerGroupSellerFilter = (req, res, next) => {
23
+ if (!req.filterableFields.seller_id) {
24
+ return next();
25
+ }
26
+ return (0, http_1.maybeApplyLinkFilter)({
27
+ entryPoint: "customer_group_seller",
28
+ resourceId: "customer_group_id",
29
+ filterableField: "seller_id",
30
+ })(req, res, next);
31
+ };
32
+ exports.adminCustomerGroupsMiddlewares = [
33
+ ...baseWithoutListGet,
34
+ {
35
+ method: ["GET"],
36
+ matcher: LIST_MATCHER,
37
+ middlewares: [
38
+ (0, framework_1.validateAndTransformQuery)(validators_1.AdminGetCustomerGroupsParams, query_config_1.listTransformQueryConfig),
39
+ maybeApplyCustomerGroupSellerFilter,
40
+ ],
41
+ },
42
+ ];
43
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL2FkbWluL2N1c3RvbWVyLWdyb3Vwcy9taWRkbGV3YXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtREFNaUM7QUFDakMsbURBQStEO0FBQy9ELDBGQUFrRztBQUVsRywwRkFBZ0Y7QUFDaEYsNkNBQTJEO0FBRTNELE1BQU0sWUFBWSxHQUFHLHdCQUF3QixDQUFBO0FBRTdDLE1BQU0sWUFBWSxHQUFHLENBQUMsaURBQW9CLENBQ3hDLCtDQUErQyxDQUNoRCxJQUFJLEVBQUUsQ0FBc0IsQ0FBQTtBQUU3QixNQUFNLGtCQUFrQixHQUFHLFlBQVksQ0FBQyxNQUFNLENBQUMsQ0FBQyxLQUFLLEVBQUUsRUFBRTtJQUN2RCxJQUFJLEtBQUssQ0FBQyxPQUFPLEtBQUssWUFBWSxFQUFFLENBQUM7UUFDbkMsT0FBTyxJQUFJLENBQUE7SUFDYixDQUFDO0lBQ0QsTUFBTSxPQUFPLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDO1FBQ3pDLENBQUMsQ0FBQyxLQUFLLENBQUMsTUFBTTtRQUNkLENBQUMsQ0FBQyxLQUFLLENBQUMsTUFBTTtZQUNkLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUM7WUFDaEIsQ0FBQyxDQUFDLEVBQUUsQ0FBQTtJQUNOLE9BQU8sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFBO0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