@mercurjs/core 2.2.0-canary.5 → 2.2.0-canary.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.d.ts +13 -0
- package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.js +59 -0
- package/.medusa/server/src/api/admin/claims/[id]/request/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/claims/[id]/request/route.js +74 -0
- package/.medusa/server/src/api/admin/collections/[id]/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/collections/[id]/route.js +48 -0
- package/.medusa/server/src/api/admin/collections/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/collections/middlewares.js +49 -0
- package/.medusa/server/src/api/admin/collections/query-config.d.ts +12 -0
- package/.medusa/server/src/api/admin/collections/query-config.js +29 -0
- package/.medusa/server/src/api/admin/collections/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/collections/route.js +36 -0
- package/.medusa/server/src/api/admin/collections/validators.d.ts +262 -0
- package/.medusa/server/src/api/admin/collections/validators.js +42 -0
- package/.medusa/server/src/api/admin/commission-rates/query-config.js +6 -4
- package/.medusa/server/src/api/admin/commission-rates/route.js +4 -1
- package/.medusa/server/src/api/admin/commission-rates/validators.d.ts +89 -58
- package/.medusa/server/src/api/admin/commission-rates/validators.js +16 -9
- package/.medusa/server/src/api/admin/customer-groups/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/customer-groups/middlewares.js +43 -0
- package/.medusa/server/src/api/admin/customer-groups/validators.d.ts +257 -0
- package/.medusa/server/src/api/admin/customer-groups/validators.js +12 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.d.ts +14 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.js +60 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/request/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/request/route.js +75 -0
- package/.medusa/server/src/api/admin/members/validators.d.ts +14 -15
- package/.medusa/server/src/api/admin/middlewares.js +31 -36
- package/.medusa/server/src/api/admin/offers/batch/route.js +3 -3
- package/.medusa/server/src/api/admin/offers/middlewares.js +3 -1
- package/.medusa/server/src/api/admin/offers/query-config.js +3 -1
- package/.medusa/server/src/api/admin/offers/validators.d.ts +79 -57
- package/.medusa/server/src/api/admin/offers/validators.js +10 -2
- package/.medusa/server/src/api/admin/order-edits/[id]/confirm/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/order-edits/[id]/confirm/route.js +18 -0
- package/.medusa/server/src/api/admin/order-edits/[id]/items/route.d.ts +15 -0
- package/.medusa/server/src/api/admin/order-edits/[id]/items/route.js +46 -0
- package/.medusa/server/src/api/admin/order-groups/helpers.d.ts +2 -0
- package/.medusa/server/src/api/admin/order-groups/helpers.js +53 -0
- package/.medusa/server/src/api/admin/order-groups/middlewares.js +3 -1
- package/.medusa/server/src/api/admin/order-groups/route.js +4 -2
- package/.medusa/server/src/api/admin/order-groups/validators.d.ts +20 -21
- package/.medusa/server/src/api/admin/orders/[id]/commission-lines/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/orders/[id]/commission-lines/route.js +17 -0
- package/.medusa/server/src/api/admin/orders/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/orders/middlewares.js +42 -0
- package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.d.ts +2 -0
- package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.js +15 -0
- package/.medusa/server/src/api/admin/orders/validators.d.ts +1 -287
- package/.medusa/server/src/api/admin/orders/validators.js +9 -29
- package/.medusa/server/src/api/admin/payouts/validators.d.ts +18 -19
- package/.medusa/server/src/api/admin/product-attributes/[id]/route.js +2 -2
- package/.medusa/server/src/api/admin/product-attributes/[id]/values/[value_id]/route.js +2 -2
- package/.medusa/server/src/api/admin/product-attributes/middlewares.js +1 -3
- package/.medusa/server/src/api/admin/product-attributes/query-config.js +4 -1
- package/.medusa/server/src/api/admin/product-attributes/route.d.ts +2 -2
- package/.medusa/server/src/api/admin/product-attributes/route.js +2 -5
- package/.medusa/server/src/api/admin/product-attributes/validators.d.ts +129 -140
- package/.medusa/server/src/api/admin/product-attributes/validators.js +1 -3
- package/.medusa/server/src/api/admin/product-categories/[id]/products/route.js +3 -3
- package/.medusa/server/src/api/admin/product-categories/[id]/route.js +8 -11
- package/.medusa/server/src/api/admin/product-categories/query-config.js +7 -1
- package/.medusa/server/src/api/admin/product-categories/route.js +5 -8
- package/.medusa/server/src/api/admin/product-categories/validators.d.ts +153 -93
- package/.medusa/server/src/api/admin/product-categories/validators.js +11 -1
- package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.d.ts +0 -7
- package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.js +2 -8
- package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.d.ts +0 -7
- package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.js +2 -8
- package/.medusa/server/src/api/admin/product-changes/validators.d.ts +8 -4
- package/.medusa/server/src/api/admin/product-changes/validators.js +6 -3
- package/.medusa/server/src/api/admin/products/[id]/attributes/batch/route.js +6 -9
- package/.medusa/server/src/api/admin/products/[id]/confirm/route.d.ts +0 -12
- package/.medusa/server/src/api/admin/products/[id]/confirm/route.js +2 -13
- package/.medusa/server/src/api/admin/products/[id]/preview/route.d.ts +0 -7
- package/.medusa/server/src/api/admin/products/[id]/preview/route.js +1 -8
- package/.medusa/server/src/api/admin/products/[id]/reject/route.d.ts +0 -8
- package/.medusa/server/src/api/admin/products/[id]/reject/route.js +2 -9
- package/.medusa/server/src/api/admin/products/[id]/request-changes/route.d.ts +0 -9
- package/.medusa/server/src/api/admin/products/[id]/request-changes/route.js +2 -10
- package/.medusa/server/src/api/admin/products/[id]/route.js +9 -3
- package/.medusa/server/src/api/admin/products/[id]/sellers/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/products/[id]/sellers/route.js +13 -0
- package/.medusa/server/src/api/admin/products/middlewares.js +6 -42
- package/.medusa/server/src/api/admin/products/query-config.js +41 -16
- package/.medusa/server/src/api/admin/products/route.js +9 -1
- package/.medusa/server/src/api/admin/products/validators.d.ts +570 -1314
- package/.medusa/server/src/api/admin/products/validators.js +66 -90
- package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.js +29 -0
- package/.medusa/server/src/api/admin/sellers/[id]/address/route.js +4 -2
- package/.medusa/server/src/api/admin/sellers/[id]/approve/route.d.ts +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/approve/route.js +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/payment-details/route.js +4 -2
- package/.medusa/server/src/api/admin/sellers/[id]/professional-details/route.js +4 -2
- package/.medusa/server/src/api/admin/sellers/[id]/route.js +4 -2
- package/.medusa/server/src/api/admin/sellers/[id]/suspend/route.js +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/terminate/route.js +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/unsuspend/route.d.ts +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/unsuspend/route.js +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/unterminate/route.d.ts +2 -1
- package/.medusa/server/src/api/admin/sellers/[id]/unterminate/route.js +2 -1
- package/.medusa/server/src/api/admin/sellers/middlewares.js +4 -20
- package/.medusa/server/src/api/admin/sellers/route.js +4 -2
- package/.medusa/server/src/api/admin/sellers/validators.d.ts +89 -100
- package/.medusa/server/src/api/admin/sellers/validators.js +12 -7
- package/.medusa/server/src/api/admin/shipping-options/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/shipping-options/middlewares.js +46 -0
- package/.medusa/server/src/api/admin/shipping-profiles/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/shipping-profiles/middlewares.js +46 -0
- package/.medusa/server/src/api/admin/stock-locations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/stock-locations/middlewares.js +46 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/route.js +1 -5
- package/.medusa/server/src/api/store/carts/[id]/complete/validators.d.ts +1 -1
- package/.medusa/server/src/api/store/carts/[id]/line-items/route.js +13 -1
- package/.medusa/server/src/api/store/carts/[id]/line-items/validators.d.ts +0 -3
- package/.medusa/server/src/api/store/carts/[id]/line-items/validators.js +1 -2
- package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.js +6 -2
- package/.medusa/server/src/api/store/middlewares.js +15 -11
- package/.medusa/server/src/api/store/offers/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/store/offers/[id]/route.js +28 -0
- package/.medusa/server/src/api/store/offers/helpers.d.ts +43 -0
- package/.medusa/server/src/api/store/offers/helpers.js +191 -0
- package/.medusa/server/src/api/store/offers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/offers/middlewares.js +64 -0
- package/.medusa/server/src/api/store/offers/query-config.d.ts +12 -0
- package/.medusa/server/src/api/store/offers/query-config.js +50 -0
- package/.medusa/server/src/api/store/offers/route.d.ts +3 -0
- package/.medusa/server/src/api/store/offers/route.js +30 -0
- package/.medusa/server/src/api/store/offers/validators.d.ts +158 -0
- package/.medusa/server/src/api/store/offers/validators.js +29 -0
- package/.medusa/server/src/api/store/order-groups/validators.d.ts +16 -17
- package/.medusa/server/src/api/store/product-attributes/validators.d.ts +50 -46
- package/.medusa/server/src/api/store/product-categories/validators.d.ts +59 -53
- package/.medusa/server/src/api/store/products/[id]/route.js +9 -5
- package/.medusa/server/src/api/store/products/helpers.d.ts +10 -0
- package/.medusa/server/src/api/store/products/helpers.js +20 -0
- package/.medusa/server/src/api/store/products/middlewares.js +37 -24
- package/.medusa/server/src/api/store/products/query-config.js +23 -7
- package/.medusa/server/src/api/store/products/route.js +9 -1
- package/.medusa/server/src/api/store/products/validators.d.ts +69 -65
- package/.medusa/server/src/api/store/search/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/search/middlewares.js +73 -0
- package/.medusa/server/src/api/store/search/route.d.ts +8 -0
- package/.medusa/server/src/api/store/search/route.js +25 -0
- package/.medusa/server/src/api/store/search/validators.d.ts +27 -0
- package/.medusa/server/src/api/store/search/validators.js +17 -0
- package/.medusa/server/src/api/store/sellers/validators.d.ts +35 -34
- package/.medusa/server/src/api/utils/filter-attributes-by-category-link.d.ts +0 -15
- package/.medusa/server/src/api/utils/filter-attributes-by-category-link.js +22 -26
- package/.medusa/server/src/api/utils/format-product-attributes.d.ts +5 -50
- package/.medusa/server/src/api/utils/format-product-attributes.js +90 -164
- package/.medusa/server/src/api/utils/index.d.ts +2 -0
- package/.medusa/server/src/api/utils/index.js +3 -1
- package/.medusa/server/src/api/utils/offers.d.ts +50 -0
- package/.medusa/server/src/api/utils/offers.js +286 -0
- package/.medusa/server/src/api/utils/order-commission-lines.d.ts +11 -0
- package/.medusa/server/src/api/utils/order-commission-lines.js +71 -0
- package/.medusa/server/src/api/utils/product-attribute-fields.d.ts +5 -0
- package/.medusa/server/src/api/utils/product-attribute-fields.js +35 -0
- package/.medusa/server/src/api/utils/sellers.d.ts +2 -0
- package/.medusa/server/src/api/utils/sellers.js +23 -0
- package/.medusa/server/src/api/vendor/campaigns/validators.d.ts +14 -15
- package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.js +17 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.js +15 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.js +46 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.js +26 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.js +39 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.js +26 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.js +41 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.js +15 -0
- package/.medusa/server/src/api/vendor/claims/[id]/request/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/request/route.js +31 -0
- package/.medusa/server/src/api/vendor/claims/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/claims/[id]/route.js +19 -0
- package/.medusa/server/src/api/vendor/claims/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/claims/helpers.js +19 -0
- package/.medusa/server/src/api/vendor/claims/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/claims/middlewares.js +184 -0
- package/.medusa/server/src/api/vendor/claims/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/claims/query-config.js +31 -0
- package/.medusa/server/src/api/vendor/claims/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/claims/route.js +35 -0
- package/.medusa/server/src/api/vendor/claims/validators.d.ts +377 -0
- package/.medusa/server/src/api/vendor/claims/validators.js +89 -0
- package/.medusa/server/src/api/vendor/collections/query-config.js +7 -1
- package/.medusa/server/src/api/vendor/collections/validators.d.ts +22 -23
- package/.medusa/server/src/api/vendor/currencies/validators.d.ts +14 -15
- package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.js +20 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/route.js +43 -0
- package/.medusa/server/src/api/vendor/customer-groups/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/customer-groups/helpers.js +38 -0
- package/.medusa/server/src/api/vendor/customer-groups/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/customer-groups/middlewares.js +62 -0
- package/.medusa/server/src/api/vendor/customer-groups/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/customer-groups/query-config.js +22 -0
- package/.medusa/server/src/api/vendor/customer-groups/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/customer-groups/route.js +35 -0
- package/.medusa/server/src/api/vendor/customer-groups/validators.d.ts +156 -0
- package/.medusa/server/src/api/vendor/customer-groups/validators.js +35 -0
- package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.js +27 -0
- package/.medusa/server/src/api/vendor/customers/[id]/route.js +13 -1
- package/.medusa/server/src/api/vendor/customers/middlewares.js +9 -1
- package/.medusa/server/src/api/vendor/customers/validators.d.ts +47 -32
- package/.medusa/server/src/api/vendor/customers/validators.js +9 -2
- package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.js +17 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.js +46 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.js +26 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.js +45 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.js +26 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.js +41 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.js +15 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.js +31 -0
- package/.medusa/server/src/api/vendor/exchanges/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/exchanges/helpers.js +19 -0
- package/.medusa/server/src/api/vendor/exchanges/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/exchanges/middlewares.js +155 -0
- package/.medusa/server/src/api/vendor/exchanges/query-config.d.ts +7 -0
- package/.medusa/server/src/api/vendor/exchanges/query-config.js +23 -0
- package/.medusa/server/src/api/vendor/exchanges/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/exchanges/route.js +35 -0
- package/.medusa/server/src/api/vendor/exchanges/validators.d.ts +312 -0
- package/.medusa/server/src/api/vendor/exchanges/validators.js +71 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/validators.d.ts +24 -23
- package/.medusa/server/src/api/vendor/fulfillment-sets/validators.d.ts +18 -18
- package/.medusa/server/src/api/vendor/inventory-items/validators.d.ts +104 -110
- package/.medusa/server/src/api/vendor/members/me/route.js +3 -2
- package/.medusa/server/src/api/vendor/members/validators.d.ts +4 -2
- package/.medusa/server/src/api/vendor/members/validators.js +5 -3
- package/.medusa/server/src/api/vendor/middlewares.js +77 -67
- package/.medusa/server/src/api/vendor/offers/[id]/route.js +4 -2
- package/.medusa/server/src/api/vendor/offers/batch/route.js +3 -2
- package/.medusa/server/src/api/vendor/offers/query-config.js +2 -1
- package/.medusa/server/src/api/vendor/offers/route.js +4 -2
- package/.medusa/server/src/api/vendor/offers/validators.d.ts +68 -67
- package/.medusa/server/src/api/vendor/offers/validators.js +12 -12
- package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.js +18 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.js +24 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.js +33 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.js +18 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/route.js +19 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.js +15 -0
- package/.medusa/server/src/api/vendor/order-edits/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/order-edits/middlewares.js +94 -0
- package/.medusa/server/src/api/vendor/order-edits/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/order-edits/route.js +15 -0
- package/.medusa/server/src/api/vendor/order-edits/validators.d.ts +160 -0
- package/.medusa/server/src/api/vendor/order-edits/validators.js +50 -0
- package/.medusa/server/src/api/vendor/orders/[id]/commission-lines/route.d.ts +7 -0
- package/.medusa/server/src/api/vendor/orders/[id]/commission-lines/route.js +18 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.d.ts +2 -1
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.js +4 -1
- package/.medusa/server/src/api/vendor/orders/middlewares.js +2 -1
- package/.medusa/server/src/api/vendor/orders/query-config.js +34 -11
- package/.medusa/server/src/api/vendor/orders/resolve-offer-items.d.ts +23 -0
- package/.medusa/server/src/api/vendor/orders/resolve-offer-items.js +75 -0
- package/.medusa/server/src/api/vendor/orders/validators.d.ts +37 -26
- package/.medusa/server/src/api/vendor/orders/validators.js +10 -3
- package/.medusa/server/src/api/vendor/payments/helpers.js +14 -8
- package/.medusa/server/src/api/vendor/payments/validators.d.ts +38 -38
- package/.medusa/server/src/api/vendor/payout-accounts/validators.d.ts +11 -12
- package/.medusa/server/src/api/vendor/payouts/validators.d.ts +18 -19
- package/.medusa/server/src/api/vendor/price-lists/validators.d.ts +38 -40
- package/.medusa/server/src/api/vendor/price-preferences/validators.d.ts +14 -15
- package/.medusa/server/src/api/vendor/product-attributes/query-config.js +4 -2
- package/.medusa/server/src/api/vendor/product-attributes/route.js +1 -3
- package/.medusa/server/src/api/vendor/product-attributes/validators.d.ts +92 -104
- package/.medusa/server/src/api/vendor/product-attributes/validators.js +1 -1
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +36 -0
- package/.medusa/server/src/api/vendor/product-categories/middlewares.js +9 -1
- package/.medusa/server/src/api/vendor/product-categories/query-config.js +7 -1
- package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +102 -79
- package/.medusa/server/src/api/vendor/product-categories/validators.js +7 -2
- package/.medusa/server/src/api/vendor/product-tags/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/product-types/validators.d.ts +14 -15
- package/.medusa/server/src/api/vendor/product-variants/middlewares.js +11 -19
- package/.medusa/server/src/api/vendor/product-variants/query-config.js +1 -3
- package/.medusa/server/src/api/vendor/product-variants/validators.d.ts +103 -97
- package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.js +22 -0
- package/.medusa/server/src/api/vendor/products/[id]/cancel/route.d.ts +2 -7
- package/.medusa/server/src/api/vendor/products/[id]/cancel/route.js +2 -9
- package/.medusa/server/src/api/vendor/products/[id]/preview/route.d.ts +0 -9
- package/.medusa/server/src/api/vendor/products/[id]/preview/route.js +1 -10
- package/.medusa/server/src/api/vendor/products/[id]/route.d.ts +0 -14
- package/.medusa/server/src/api/vendor/products/[id]/route.js +12 -21
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.d.ts +0 -8
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +3 -14
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.d.ts +0 -7
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +2 -11
- package/.medusa/server/src/api/vendor/products/helpers.d.ts +6 -5
- package/.medusa/server/src/api/vendor/products/helpers.js +54 -10
- package/.medusa/server/src/api/vendor/products/middlewares.js +16 -48
- package/.medusa/server/src/api/vendor/products/query-config.js +52 -15
- package/.medusa/server/src/api/vendor/products/route.d.ts +0 -9
- package/.medusa/server/src/api/vendor/products/route.js +14 -17
- package/.medusa/server/src/api/vendor/products/validators.d.ts +458 -770
- package/.medusa/server/src/api/vendor/products/validators.js +90 -78
- package/.medusa/server/src/api/vendor/promotions/validators.d.ts +47 -49
- package/.medusa/server/src/api/vendor/refund-reasons/validators.d.ts +18 -19
- package/.medusa/server/src/api/vendor/regions/validators.d.ts +20 -21
- package/.medusa/server/src/api/vendor/reservations/[id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/reservations/[id]/route.js +39 -0
- package/.medusa/server/src/api/vendor/reservations/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/reservations/helpers.js +18 -0
- package/.medusa/server/src/api/vendor/reservations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/reservations/middlewares.js +44 -0
- package/.medusa/server/src/api/vendor/reservations/query-config.d.ts +19 -0
- package/.medusa/server/src/api/vendor/reservations/query-config.js +45 -0
- package/.medusa/server/src/api/vendor/reservations/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/reservations/route.js +35 -0
- package/.medusa/server/src/api/vendor/reservations/validators.d.ts +295 -0
- package/.medusa/server/src/api/vendor/reservations/validators.js +40 -0
- package/.medusa/server/src/api/vendor/return-reasons/validators.d.ts +18 -19
- package/.medusa/server/src/api/vendor/returns/validators.d.ts +25 -26
- package/.medusa/server/src/api/vendor/sales-channels/[id]/products/route.js +2 -1
- package/.medusa/server/src/api/vendor/sales-channels/helpers.d.ts +1 -0
- package/.medusa/server/src/api/vendor/sales-channels/helpers.js +25 -2
- package/.medusa/server/src/api/vendor/sales-channels/validators.d.ts +25 -24
- package/.medusa/server/src/api/vendor/sellers/[id]/address/route.js +4 -2
- package/.medusa/server/src/api/vendor/sellers/[id]/payment-details/route.js +4 -2
- package/.medusa/server/src/api/vendor/sellers/[id]/professional-details/route.js +4 -2
- package/.medusa/server/src/api/vendor/sellers/[id]/route.js +4 -2
- package/.medusa/server/src/api/vendor/sellers/me/route.js +10 -1
- package/.medusa/server/src/api/vendor/sellers/middlewares.js +1 -18
- package/.medusa/server/src/api/vendor/sellers/route.js +8 -3
- package/.medusa/server/src/api/vendor/sellers/validators.d.ts +25 -46
- package/.medusa/server/src/api/vendor/sellers/validators.js +2 -2
- package/.medusa/server/src/api/vendor/shipping-option-types/validators.d.ts +18 -19
- package/.medusa/server/src/api/vendor/shipping-options/middlewares.js +13 -1
- package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +100 -98
- package/.medusa/server/src/api/vendor/shipping-options/validators.js +2 -1
- package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +20 -21
- package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +18 -19
- package/.medusa/server/src/api/vendor/stores/validators.d.ts +14 -15
- package/.medusa/server/src/links/cart-line-item-offer-link.js +9 -2
- package/.medusa/server/src/links/media-product-category-link.d.ts +20 -0
- package/.medusa/server/src/links/media-product-category-link.js +34 -0
- package/.medusa/server/src/links/media-product-collection-link.d.ts +18 -0
- package/.medusa/server/src/links/media-product-collection-link.js +32 -0
- package/.medusa/server/src/links/offer-product-link.js +15 -0
- package/.medusa/server/src/links/order-line-item-offer-link.js +10 -2
- package/.medusa/server/src/links/product-attribute-category-link.d.ts +0 -14
- package/.medusa/server/src/links/product-attribute-category-link.js +4 -21
- package/.medusa/server/src/links/product-attribute-option-mirror-link.d.ts +6 -0
- package/.medusa/server/src/links/product-attribute-option-mirror-link.js +24 -0
- package/.medusa/server/src/links/product-attribute-product-link.d.ts +0 -5
- package/.medusa/server/src/links/product-attribute-product-link.js +2 -7
- package/.medusa/server/src/links/product-attribute-value-option-value-mirror-link.d.ts +6 -0
- package/.medusa/server/src/links/product-attribute-value-option-value-mirror-link.js +24 -0
- package/.medusa/server/src/links/{product-variant-attribute-value-link.d.ts → product-attribute-value-pivot-link.d.ts} +3 -0
- package/.medusa/server/src/links/product-attribute-value-pivot-link.js +23 -0
- package/.medusa/server/src/links/seller-customer-group-link.js +15 -0
- package/.medusa/server/src/migration-scripts/drop-fulfillment-global-unique-indexes.js +6 -1
- package/.medusa/server/src/migration-scripts/rename-default-store.d.ts +2 -0
- package/.medusa/server/src/migration-scripts/rename-default-store.js +12 -0
- package/.medusa/server/src/modules/commission/index.d.ts +14 -0
- package/.medusa/server/src/modules/commission/index.js +3 -1
- package/.medusa/server/src/modules/commission/loaders/seed-default-commission-rate.d.ts +11 -0
- package/.medusa/server/src/modules/commission/loaders/seed-default-commission-rate.js +35 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20260615120000.d.ts +5 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20260615120000.js +46 -0
- package/.medusa/server/src/modules/commission/models/commission-line.d.ts +2 -1
- package/.medusa/server/src/modules/commission/models/commission-line.js +3 -2
- package/.medusa/server/src/modules/commission/models/commission-rate-value.d.ts +25 -0
- package/.medusa/server/src/modules/commission/models/commission-rate-value.js +17 -0
- package/.medusa/server/src/modules/commission/models/commission-rate.d.ts +9 -4
- package/.medusa/server/src/modules/commission/models/commission-rate.js +9 -6
- package/.medusa/server/src/modules/commission/models/commission-rule.d.ts +8 -3
- package/.medusa/server/src/modules/commission/models/index.d.ts +1 -0
- package/.medusa/server/src/modules/commission/models/index.js +4 -2
- package/.medusa/server/src/modules/commission/service.d.ts +170 -10
- package/.medusa/server/src/modules/commission/service.js +270 -114
- package/.medusa/server/src/modules/media/index.d.ts +21 -0
- package/.medusa/server/src/modules/media/index.js +12 -0
- package/.medusa/server/src/modules/media/migrations/Migration20260616000000.d.ts +5 -0
- package/.medusa/server/src/modules/media/migrations/Migration20260616000000.js +16 -0
- package/.medusa/server/src/modules/media/models/index.d.ts +1 -0
- package/.medusa/server/src/modules/media/models/index.js +9 -0
- package/.medusa/server/src/modules/media/models/media-image.d.ts +32 -0
- package/.medusa/server/src/modules/media/models/media-image.js +41 -0
- package/.medusa/server/src/modules/media/service.d.ts +17 -0
- package/.medusa/server/src/modules/media/service.js +10 -0
- package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.d.ts +5 -0
- package/.medusa/server/src/modules/offer/migrations/Migration20260622000000.js +16 -0
- package/.medusa/server/src/modules/offer/models/offer.d.ts +2 -0
- package/.medusa/server/src/modules/offer/models/offer.js +8 -1
- package/.medusa/server/src/modules/offer/service.d.ts +10 -0
- package/.medusa/server/src/modules/offer/service.js +100 -1
- package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000002.d.ts +14 -0
- package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000002.js +31 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.d.ts +2 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.js +2 -1
- package/.medusa/server/src/modules/product-attribute/models/product-attribute.d.ts +2 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute.js +2 -1
- package/.medusa/server/src/modules/product-attribute/service.d.ts +18 -3
- package/.medusa/server/src/modules/product-attribute/service.js +213 -1
- package/.medusa/server/src/modules/search/abstract-search-provider.d.ts +9 -0
- package/.medusa/server/src/modules/search/abstract-search-provider.js +20 -0
- package/.medusa/server/src/modules/search/index.d.ts +10 -0
- package/.medusa/server/src/modules/search/index.js +31 -0
- package/.medusa/server/src/modules/search/lib/build-docs.d.ts +84 -0
- package/.medusa/server/src/modules/search/lib/build-docs.js +207 -0
- package/.medusa/server/src/modules/search/lib/reindex.d.ts +7 -0
- package/.medusa/server/src/modules/search/lib/reindex.js +61 -0
- package/.medusa/server/src/modules/search/lib/sync.d.ts +9 -0
- package/.medusa/server/src/modules/search/lib/sync.js +73 -0
- package/.medusa/server/src/modules/search/loaders/providers.d.ts +5 -0
- package/.medusa/server/src/modules/search/loaders/providers.js +26 -0
- package/.medusa/server/src/modules/search/providers/index.d.ts +1 -0
- package/.medusa/server/src/modules/search/providers/index.js +6 -0
- package/.medusa/server/src/modules/search/providers/orama/index.d.ts +4 -0
- package/.medusa/server/src/modules/search/providers/orama/index.js +12 -0
- package/.medusa/server/src/modules/search/providers/orama/service.d.ts +19 -0
- package/.medusa/server/src/modules/search/providers/orama/service.js +148 -0
- package/.medusa/server/src/modules/search/providers/orama/types.d.ts +10 -0
- package/.medusa/server/src/modules/search/providers/orama/types.js +3 -0
- package/.medusa/server/src/modules/search/services/index.d.ts +2 -0
- package/.medusa/server/src/modules/search/services/index.js +24 -0
- package/.medusa/server/src/modules/search/services/search-module-service.d.ts +25 -0
- package/.medusa/server/src/modules/search/services/search-module-service.js +60 -0
- package/.medusa/server/src/modules/search/services/search-provider-service.d.ts +15 -0
- package/.medusa/server/src/modules/search/services/search-provider-service.js +30 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260616120000.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260616120000.js +16 -0
- package/.medusa/server/src/modules/seller/models/address.d.ts +2 -2
- package/.medusa/server/src/modules/seller/models/member-invite.d.ts +2 -2
- package/.medusa/server/src/modules/seller/models/member.d.ts +2 -2
- package/.medusa/server/src/modules/seller/models/payment-details.d.ts +2 -2
- package/.medusa/server/src/modules/seller/models/payment-details.js +3 -3
- package/.medusa/server/src/modules/seller/models/professional-details.d.ts +2 -2
- package/.medusa/server/src/modules/seller/models/seller-member.d.ts +4 -4
- package/.medusa/server/src/modules/seller/models/seller.d.ts +2 -2
- package/.medusa/server/src/modules/seller/repositories/order-group.js +1 -11
- package/.medusa/server/src/modules/seller/service.d.ts +16 -16
- package/.medusa/server/src/modules/seller/service.js +1 -2
- package/.medusa/server/src/subscribers/link-order-line-items-to-offers.d.ts +6 -0
- package/.medusa/server/src/subscribers/link-order-line-items-to-offers.js +94 -0
- package/.medusa/server/src/subscribers/order-edit-confirmed.d.ts +12 -0
- package/.medusa/server/src/subscribers/order-edit-confirmed.js +34 -0
- package/.medusa/server/src/subscribers/search-offer-changed.d.ts +6 -0
- package/.medusa/server/src/subscribers/search-offer-changed.js +34 -0
- package/.medusa/server/src/subscribers/search-product-changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/search-product-changed.js +29 -0
- package/.medusa/server/src/subscribers/search-product-deleted.d.ts +5 -0
- package/.medusa/server/src/subscribers/search-product-deleted.js +23 -0
- package/.medusa/server/src/subscribers/search-reindex.d.ts +3 -0
- package/.medusa/server/src/subscribers/search-reindex.js +23 -0
- package/.medusa/server/src/subscribers/search-seller-changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/search-seller-changed.js +44 -0
- package/.medusa/server/src/utils/dashboard/dashboard-base.js +6 -2
- package/.medusa/server/src/utils/disable-medusa-middlewares.js +7 -1
- package/.medusa/server/src/workflows/cart/hooks/validate.js +1 -12
- package/.medusa/server/src/workflows/cart/steps/prepare-adjustments-from-promotion-actions.js +3 -5
- package/.medusa/server/src/workflows/cart/utils/fields.js +25 -9
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.js +1 -3
- package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.js +1 -2
- package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.js +19 -16
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.d.ts +2 -2
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.js +1 -2
- package/.medusa/server/src/workflows/commission/steps/create-commission-rates.d.ts +1 -28
- package/.medusa/server/src/workflows/commission/steps/create-commission-rules.d.ts +13 -4
- package/.medusa/server/src/workflows/commission/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/commission/steps/index.js +2 -1
- package/.medusa/server/src/workflows/commission/steps/update-commission-rates.d.ts +13 -4
- package/.medusa/server/src/workflows/commission/steps/update-commission-rules.d.ts +13 -4
- package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.d.ts +2 -2
- package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.js +1 -1
- package/.medusa/server/src/workflows/commission/steps/validate-commission-rates-deletable.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/steps/validate-commission-rates-deletable.js +19 -0
- package/.medusa/server/src/workflows/commission/workflows/create-commission-rates.d.ts +1 -28
- package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.d.ts +1 -2
- package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.js +3 -1
- package/.medusa/server/src/workflows/commission/workflows/refresh-order-commission-lines.js +2 -1
- package/.medusa/server/src/workflows/commission/workflows/update-commission-rates.d.ts +13 -4
- package/.medusa/server/src/workflows/customer-group/index.d.ts +2 -0
- package/.medusa/server/src/workflows/customer-group/index.js +19 -0
- package/.medusa/server/src/workflows/customer-group/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/customer-group/steps/index.js +18 -0
- package/.medusa/server/src/workflows/customer-group/steps/link-seller-customer-group.d.ts +6 -0
- package/.medusa/server/src/workflows/customer-group/steps/link-seller-customer-group.js +38 -0
- package/.medusa/server/src/workflows/customer-group/workflows/create-seller-customer-groups.d.ts +7 -0
- package/.medusa/server/src/workflows/customer-group/workflows/create-seller-customer-groups.js +20 -0
- package/.medusa/server/src/workflows/customer-group/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/customer-group/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/index.d.ts +2 -0
- package/.medusa/server/src/workflows/index.js +3 -1
- package/.medusa/server/src/workflows/media/index.d.ts +2 -0
- package/.medusa/server/src/workflows/media/index.js +19 -0
- package/.medusa/server/src/workflows/media/steps/create-images.d.ts +20 -0
- package/.medusa/server/src/workflows/media/steps/create-images.js +21 -0
- package/.medusa/server/src/workflows/media/steps/delete-images.d.ts +3 -0
- package/.medusa/server/src/workflows/media/steps/delete-images.js +21 -0
- package/.medusa/server/src/workflows/media/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/media/steps/index.js +19 -0
- package/.medusa/server/src/workflows/media/workflows/create-product-category-with-images.d.ts +8 -0
- package/.medusa/server/src/workflows/media/workflows/create-product-category-with-images.js +23 -0
- package/.medusa/server/src/workflows/media/workflows/create-product-collection-with-images.d.ts +8 -0
- package/.medusa/server/src/workflows/media/workflows/create-product-collection-with-images.js +23 -0
- package/.medusa/server/src/workflows/media/workflows/delete-product-category-with-images.d.ts +5 -0
- package/.medusa/server/src/workflows/media/workflows/delete-product-category-with-images.js +21 -0
- package/.medusa/server/src/workflows/media/workflows/delete-product-collection-with-images.d.ts +5 -0
- package/.medusa/server/src/workflows/media/workflows/delete-product-collection-with-images.js +21 -0
- package/.medusa/server/src/workflows/media/workflows/index.d.ts +8 -0
- package/.medusa/server/src/workflows/media/workflows/index.js +25 -0
- package/.medusa/server/src/workflows/media/workflows/set-category-images.d.ts +13 -0
- package/.medusa/server/src/workflows/media/workflows/set-category-images.js +71 -0
- package/.medusa/server/src/workflows/media/workflows/set-collection-images.d.ts +13 -0
- package/.medusa/server/src/workflows/media/workflows/set-collection-images.js +71 -0
- package/.medusa/server/src/workflows/media/workflows/update-product-category-with-images.d.ts +9 -0
- package/.medusa/server/src/workflows/media/workflows/update-product-category-with-images.js +22 -0
- package/.medusa/server/src/workflows/media/workflows/update-product-collection-with-images.d.ts +9 -0
- package/.medusa/server/src/workflows/media/workflows/update-product-collection-with-images.js +22 -0
- package/.medusa/server/src/workflows/offer/steps/add-offer-prices.d.ts +0 -12
- package/.medusa/server/src/workflows/offer/steps/add-offer-prices.js +1 -16
- package/.medusa/server/src/workflows/offer/steps/create-offers.d.ts +2 -0
- package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.d.ts +0 -9
- package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.js +1 -10
- package/.medusa/server/src/workflows/offer/steps/update-offers.d.ts +2 -5
- package/.medusa/server/src/workflows/offer/steps/update-offers.js +1 -1
- package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.d.ts +0 -11
- package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.js +1 -12
- package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.d.ts +0 -10
- package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.js +1 -19
- package/.medusa/server/src/workflows/offer/workflows/create-offers.js +4 -16
- package/.medusa/server/src/workflows/offer/workflows/delete-offers.js +7 -2
- package/.medusa/server/src/workflows/offer/workflows/update-offers.d.ts +0 -11
- package/.medusa/server/src/workflows/offer/workflows/update-offers.js +2 -23
- package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.d.ts +1 -2
- package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.js +1 -2
- package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.d.ts +7 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.js +149 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.d.ts +7 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.js +152 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-order-edit-request.d.ts +7 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-order-edit-request.js +165 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-return-receive.js +1 -9
- package/.medusa/server/src/workflows/order/workflows/create-order-fulfillment.js +2 -3
- package/.medusa/server/src/workflows/order/workflows/index.d.ts +3 -0
- package/.medusa/server/src/workflows/order/workflows/index.js +4 -1
- package/.medusa/server/src/workflows/order-group/utils/aggregate-status.js +1 -7
- package/.medusa/server/src/workflows/order-group/workflows/get-order-groups-list.d.ts +1 -0
- package/.medusa/server/src/workflows/order-group/workflows/get-order-groups-list.js +11 -2
- package/.medusa/server/src/workflows/payout/workflows/create-payout.js +34 -21
- package/.medusa/server/src/workflows/product/events.d.ts +0 -6
- package/.medusa/server/src/workflows/product/events.js +1 -7
- package/.medusa/server/src/workflows/product/steps/index.d.ts +0 -2
- package/.medusa/server/src/workflows/product/steps/index.js +1 -3
- package/.medusa/server/src/workflows/product/steps/validate-products-status.d.ts +0 -8
- package/.medusa/server/src/workflows/product/steps/validate-products-status.js +1 -9
- package/.medusa/server/src/workflows/product/steps/validate-seller-product-permissions.js +1 -3
- package/.medusa/server/src/workflows/product/workflows/assign-products-to-category.d.ts +12 -0
- package/.medusa/server/src/workflows/product/workflows/assign-products-to-category.js +23 -0
- package/.medusa/server/src/workflows/product/workflows/confirm-products.d.ts +4 -20
- package/.medusa/server/src/workflows/product/workflows/confirm-products.js +2 -13
- package/.medusa/server/src/workflows/product/workflows/create-products.d.ts +4 -52
- package/.medusa/server/src/workflows/product/workflows/create-products.js +69 -142
- package/.medusa/server/src/workflows/product/workflows/index.d.ts +1 -1
- package/.medusa/server/src/workflows/product/workflows/index.js +2 -2
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.d.ts +0 -7
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.js +1 -1
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.d.ts +0 -7
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.js +1 -1
- package/.medusa/server/src/workflows/product/workflows/reject-product.d.ts +4 -11
- package/.medusa/server/src/workflows/product/workflows/reject-product.js +2 -8
- package/.medusa/server/src/workflows/product/workflows/request-product-change.d.ts +4 -18
- package/.medusa/server/src/workflows/product/workflows/request-product-change.js +2 -15
- package/.medusa/server/src/workflows/product-attribute/events.d.ts +0 -9
- package/.medusa/server/src/workflows/product-attribute/events.js +1 -10
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attribute-values.d.ts +1 -31
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.d.ts +1 -41
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.js +1 -1
- package/.medusa/server/src/workflows/product-attribute/steps/detach-product-option-values-from-product.d.ts +14 -0
- package/.medusa/server/src/workflows/product-attribute/steps/detach-product-option-values-from-product.js +40 -0
- package/.medusa/server/src/workflows/product-attribute/steps/index.d.ts +3 -4
- package/.medusa/server/src/workflows/product-attribute/steps/index.js +4 -5
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.d.ts +6 -3
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.js +17 -2
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attributes.d.ts +1 -31
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-linked.d.ts +2 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-linked.js +28 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-required.d.ts +7 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attributes-not-required.js +16 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attributes-to-product.d.ts +9 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attributes-to-product.js +242 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-product-attributes.d.ts +15 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-product-attributes.js +28 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attribute-values.js +44 -3
- package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attributes.js +41 -17
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attribute-values.js +36 -15
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.d.ts +0 -7
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.js +11 -8
- package/.medusa/server/src/workflows/product-attribute/workflows/index.d.ts +4 -5
- package/.medusa/server/src/workflows/product-attribute/workflows/index.js +5 -6
- package/.medusa/server/src/workflows/product-attribute/workflows/remove-product-attributes-from-product.d.ts +10 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/remove-product-attributes-from-product.js +83 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute-values.js +34 -1
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes-on-product.d.ts +11 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes-on-product.js +285 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes.js +15 -1
- package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.d.ts +4 -11
- package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.js +19 -19
- package/.medusa/server/src/workflows/product-edit/events.d.ts +0 -7
- package/.medusa/server/src/workflows/product-edit/events.js +1 -8
- package/.medusa/server/src/workflows/product-edit/steps/apply-variant-image-links.d.ts +16 -0
- package/.medusa/server/src/workflows/product-edit/steps/apply-variant-image-links.js +35 -0
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.d.ts +0 -4
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.js +1 -5
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.d.ts +0 -6
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.js +1 -7
- package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.d.ts +0 -5
- package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.js +1 -6
- package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.d.ts +0 -6
- package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.js +1 -1
- package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.d.ts +0 -5
- package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.js +1 -6
- package/.medusa/server/src/workflows/product-edit/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/product-edit/steps/index.js +2 -1
- package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.d.ts +0 -5
- package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.js +1 -6
- package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.d.ts +0 -6
- package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.js +2 -8
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.d.ts +5 -19
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.js +11 -128
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.d.ts +0 -31
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.js +43 -50
- package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.d.ts +1 -9
- package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.js +3 -11
- package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.d.ts +0 -11
- package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.js +1 -12
- package/.medusa/server/src/workflows/product-edit/workflows/index.d.ts +1 -1
- package/.medusa/server/src/workflows/product-edit/workflows/index.js +2 -2
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.d.ts +0 -7
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.js +10 -9
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.d.ts +4 -46
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.js +11 -162
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-product.d.ts +16 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-product.js +139 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.d.ts +0 -10
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.js +71 -17
- package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.d.ts +0 -24
- package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.js +1 -15
- package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.d.ts +1 -25
- package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.js +2 -15
- package/.medusa/server/src/workflows/promotion/steps/register-usage.d.ts +0 -3
- package/.medusa/server/src/workflows/promotion/steps/register-usage.js +1 -4
- package/.medusa/server/src/workflows/seller/steps/create-seller-member.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/steps/update-member.d.ts +2 -2
- package/.medusa/server/src/workflows/seller/steps/update-seller-member.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/accept-member-invite.js +1 -2
- package/.medusa/server/src/workflows/seller/workflows/add-seller-member.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/approve-seller.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/approve-seller.js +2 -1
- package/.medusa/server/src/workflows/seller/workflows/create-sellers.js +1 -2
- package/.medusa/server/src/workflows/seller/workflows/suspend-seller.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/suspend-seller.js +2 -1
- package/.medusa/server/src/workflows/seller/workflows/terminate-seller.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/terminate-seller.js +2 -1
- package/.medusa/server/src/workflows/seller/workflows/unsuspend-seller.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/unsuspend-seller.js +2 -1
- package/.medusa/server/src/workflows/seller/workflows/unterminate-seller.d.ts +4 -4
- package/.medusa/server/src/workflows/seller/workflows/unterminate-seller.js +2 -1
- package/.medusa/server/src/workflows/seller/workflows/update-member.d.ts +12 -101
- package/.medusa/server/src/workflows/seller/workflows/update-member.js +6 -2
- package/package.json +22 -21
- package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.d.ts +0 -4
- package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.js +0 -65
- package/.medusa/server/src/api/admin/products/[id]/attributes/route.d.ts +0 -5
- package/.medusa/server/src/api/admin/products/[id]/attributes/route.js +0 -63
- package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.d.ts +0 -10
- package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.js +0 -62
- package/.medusa/server/src/api/vendor/products/[id]/attributes/route.d.ts +0 -15
- package/.medusa/server/src/api/vendor/products/[id]/attributes/route.js +0 -82
- package/.medusa/server/src/links/line-item-commission-line-link.js +0 -21
- package/.medusa/server/src/links/product-attribute-value-link.d.ts +0 -22
- package/.medusa/server/src/links/product-attribute-value-link.js +0 -46
- package/.medusa/server/src/links/product-variant-attribute-link.js +0 -21
- package/.medusa/server/src/links/product-variant-attribute-value-link.js +0 -21
- package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.d.ts +0 -28
- package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.js +0 -72
- package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.d.ts +0 -90
- package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.js +0 -185
- package/.medusa/server/src/workflows/product/workflows/update-products.d.ts +0 -39
- package/.medusa/server/src/workflows/product/workflows/update-products.js +0 -161
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.d.ts +0 -43
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.js +0 -51
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.d.ts +0 -7
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.js +0 -59
- package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.d.ts +0 -6
- package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.js +0 -20
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.d.ts +0 -7
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.js +0 -20
- package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.d.ts +0 -52
- package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.js +0 -120
- package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.d.ts +0 -23
- package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.js +0 -252
- package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.d.ts +0 -17
- package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.js +0 -62
- package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.d.ts +0 -135
- package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.js +0 -43
- package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.d.ts +0 -24
- package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.js +0 -27
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.d.ts +0 -25
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.js +0 -148
- /package/.medusa/server/src/links/{line-item-commission-line-link.d.ts → offer-product-link.d.ts} +0 -0
- /package/.medusa/server/src/links/{product-variant-attribute-link.d.ts → seller-customer-group-link.d.ts} +0 -0
package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.d.ts
CHANGED
|
@@ -3,36 +3,5 @@ export type ApplyProductChangeActionsWorkflowInput = {
|
|
|
3
3
|
change_ids: string[];
|
|
4
4
|
};
|
|
5
5
|
export declare const applyProductChangeActionsWorkflowId = "apply-product-change-actions";
|
|
6
|
-
/**
|
|
7
|
-
* Cross-module dispatcher for a confirmed `ProductChange`'s pending
|
|
8
|
-
* actions. Replaces the legacy `ProductModuleService.applyProductChangeActions_`
|
|
9
|
-
* by composing stock Medusa product workflows (update/create/delete
|
|
10
|
-
* variants, update/delete products) with the attribute apply workflow
|
|
11
|
-
* (`applyProductAttributeChangeActionsWorkflow`).
|
|
12
|
-
*
|
|
13
|
-
* Pattern-match `medusa/.../order/workflows/apply-order-change.ts`:
|
|
14
|
-
* load pending rows, bucket by action type, dispatch in dependency
|
|
15
|
-
* order, then mark `applied = true`.
|
|
16
|
-
*
|
|
17
|
-
* Ordering mirrors the legacy implementation:
|
|
18
|
-
* 1. Top-level field updates (STATUS_CHANGE / UPDATE) — collapsed by
|
|
19
|
-
* product so each product hits `updateProductsWorkflow` once.
|
|
20
|
-
* 2. Variant deletes — frees up SKU / title uniqueness before adds.
|
|
21
|
-
* 3. Variant creates.
|
|
22
|
-
* 4. Variant updates — see a stable variant set.
|
|
23
|
-
* 5. Attribute add/remove + option sync — delegated to
|
|
24
|
-
* `applyProductAttributeChangeActionsWorkflow`. Removes run
|
|
25
|
-
* before adds inside that workflow so a single change can re-link
|
|
26
|
-
* the same attribute with a different value set.
|
|
27
|
-
* 6. Product deletes — last so any audit-trail updates above write
|
|
28
|
-
* through before the row is soft-deleted.
|
|
29
|
-
* 7. Mark action rows applied.
|
|
30
|
-
*
|
|
31
|
-
* `ATTRIBUTE_ADD` actions are expected to carry pre-resolved
|
|
32
|
-
* `attribute_value_ids` in their `details` JSON. The find-or-create
|
|
33
|
-
* branch lives upstream — workflows that stage an `ATTRIBUTE_ADD` call
|
|
34
|
-
* `upsertProductAttributeValuesWorkflow` first to resolve names into
|
|
35
|
-
* IDs before persisting the action.
|
|
36
|
-
*/
|
|
37
6
|
export declare const applyProductChangeActionsWorkflow: ReturnWorkflow<ApplyProductChangeActionsWorkflowInput, void, [
|
|
38
7
|
]>;
|
|
@@ -7,37 +7,6 @@ const types_1 = require("@mercurjs/types");
|
|
|
7
7
|
const steps_1 = require("../steps");
|
|
8
8
|
const apply_product_attribute_change_actions_1 = require("./apply-product-attribute-change-actions");
|
|
9
9
|
exports.applyProductChangeActionsWorkflowId = "apply-product-change-actions";
|
|
10
|
-
/**
|
|
11
|
-
* Cross-module dispatcher for a confirmed `ProductChange`'s pending
|
|
12
|
-
* actions. Replaces the legacy `ProductModuleService.applyProductChangeActions_`
|
|
13
|
-
* by composing stock Medusa product workflows (update/create/delete
|
|
14
|
-
* variants, update/delete products) with the attribute apply workflow
|
|
15
|
-
* (`applyProductAttributeChangeActionsWorkflow`).
|
|
16
|
-
*
|
|
17
|
-
* Pattern-match `medusa/.../order/workflows/apply-order-change.ts`:
|
|
18
|
-
* load pending rows, bucket by action type, dispatch in dependency
|
|
19
|
-
* order, then mark `applied = true`.
|
|
20
|
-
*
|
|
21
|
-
* Ordering mirrors the legacy implementation:
|
|
22
|
-
* 1. Top-level field updates (STATUS_CHANGE / UPDATE) — collapsed by
|
|
23
|
-
* product so each product hits `updateProductsWorkflow` once.
|
|
24
|
-
* 2. Variant deletes — frees up SKU / title uniqueness before adds.
|
|
25
|
-
* 3. Variant creates.
|
|
26
|
-
* 4. Variant updates — see a stable variant set.
|
|
27
|
-
* 5. Attribute add/remove + option sync — delegated to
|
|
28
|
-
* `applyProductAttributeChangeActionsWorkflow`. Removes run
|
|
29
|
-
* before adds inside that workflow so a single change can re-link
|
|
30
|
-
* the same attribute with a different value set.
|
|
31
|
-
* 6. Product deletes — last so any audit-trail updates above write
|
|
32
|
-
* through before the row is soft-deleted.
|
|
33
|
-
* 7. Mark action rows applied.
|
|
34
|
-
*
|
|
35
|
-
* `ATTRIBUTE_ADD` actions are expected to carry pre-resolved
|
|
36
|
-
* `attribute_value_ids` in their `details` JSON. The find-or-create
|
|
37
|
-
* branch lives upstream — workflows that stage an `ATTRIBUTE_ADD` call
|
|
38
|
-
* `upsertProductAttributeValuesWorkflow` first to resolve names into
|
|
39
|
-
* IDs before persisting the action.
|
|
40
|
-
*/
|
|
41
10
|
exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.applyProductChangeActionsWorkflowId, function (input) {
|
|
42
11
|
const { data: actions } = (0, core_flows_1.useQueryGraphStep)({
|
|
43
12
|
entity: "product_change_action",
|
|
@@ -51,9 +20,18 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
51
20
|
const productUpdatesById = new Map();
|
|
52
21
|
const variantCreates = [];
|
|
53
22
|
const variantUpdates = [];
|
|
23
|
+
const variantImageLinks = [];
|
|
54
24
|
const variantDeletes = [];
|
|
55
|
-
|
|
56
|
-
const
|
|
25
|
+
let attributeBatch = null;
|
|
26
|
+
const ensureAttributeBatch = (productId) => {
|
|
27
|
+
attributeBatch ??= {
|
|
28
|
+
product_id: productId,
|
|
29
|
+
add: [],
|
|
30
|
+
remove: [],
|
|
31
|
+
update: [],
|
|
32
|
+
};
|
|
33
|
+
return attributeBatch;
|
|
34
|
+
};
|
|
57
35
|
const productsToDelete = new Set();
|
|
58
36
|
const pendingActionIds = [];
|
|
59
37
|
for (const action of actions ?? []) {
|
|
@@ -94,7 +72,15 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
94
72
|
!fields ||
|
|
95
73
|
!Object.keys(fields).length)
|
|
96
74
|
break;
|
|
97
|
-
|
|
75
|
+
const { images, ...scalarFields } = fields;
|
|
76
|
+
const add = images?.add ?? [];
|
|
77
|
+
const remove = images?.remove ?? [];
|
|
78
|
+
if (add.length || remove.length) {
|
|
79
|
+
variantImageLinks.push({ variant_id, add, remove });
|
|
80
|
+
}
|
|
81
|
+
if (Object.keys(scalarFields).length) {
|
|
82
|
+
variantUpdates.push({ id: variant_id, ...scalarFields });
|
|
83
|
+
}
|
|
98
84
|
break;
|
|
99
85
|
}
|
|
100
86
|
case types_1.ProductChangeActionType.VARIANT_REMOVE: {
|
|
@@ -104,14 +90,10 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
104
90
|
break;
|
|
105
91
|
}
|
|
106
92
|
case types_1.ProductChangeActionType.ATTRIBUTE_ADD: {
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
93
|
+
const attribute = details.attribute;
|
|
94
|
+
if (!attribute)
|
|
109
95
|
break;
|
|
110
|
-
|
|
111
|
-
product_id: productId,
|
|
112
|
-
attribute_id,
|
|
113
|
-
attribute_value_ids,
|
|
114
|
-
});
|
|
96
|
+
ensureAttributeBatch(productId).add.push(attribute);
|
|
115
97
|
break;
|
|
116
98
|
}
|
|
117
99
|
case types_1.ProductChangeActionType.ATTRIBUTE_REMOVE: {
|
|
@@ -119,10 +101,14 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
119
101
|
.attribute_id;
|
|
120
102
|
if (!attributeId)
|
|
121
103
|
break;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
104
|
+
ensureAttributeBatch(productId).remove.push(attributeId);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case types_1.ProductChangeActionType.ATTRIBUTE_UPDATE: {
|
|
108
|
+
const update = details.update;
|
|
109
|
+
if (!update)
|
|
110
|
+
break;
|
|
111
|
+
ensureAttributeBatch(productId).update.push(update);
|
|
126
112
|
break;
|
|
127
113
|
}
|
|
128
114
|
case types_1.ProductChangeActionType.PRODUCT_DELETE: {
|
|
@@ -135,9 +121,9 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
135
121
|
productUpdates: Array.from(productUpdatesById.values()).filter((u) => Object.keys(u).length > 1),
|
|
136
122
|
variantCreates,
|
|
137
123
|
variantUpdates,
|
|
124
|
+
variantImageLinks,
|
|
138
125
|
variantDeletes,
|
|
139
|
-
|
|
140
|
-
attributeRemoves,
|
|
126
|
+
attributeBatch,
|
|
141
127
|
productsToDelete: Array.from(productsToDelete),
|
|
142
128
|
pendingActionIds,
|
|
143
129
|
};
|
|
@@ -170,10 +156,17 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
170
156
|
})),
|
|
171
157
|
});
|
|
172
158
|
});
|
|
159
|
+
(0, workflows_sdk_1.when)({ buckets }, ({ buckets }) => buckets.variantImageLinks.length > 0).then(() => {
|
|
160
|
+
(0, steps_1.applyVariantImageLinksStep)({
|
|
161
|
+
updates: (0, workflows_sdk_1.transform)({ buckets }, ({ buckets }) => buckets.variantImageLinks),
|
|
162
|
+
});
|
|
163
|
+
});
|
|
173
164
|
apply_product_attribute_change_actions_1.applyProductAttributeChangeActionsWorkflow.runAsStep({
|
|
174
165
|
input: (0, workflows_sdk_1.transform)({ buckets }, ({ buckets }) => ({
|
|
175
|
-
|
|
176
|
-
|
|
166
|
+
product_id: buckets.attributeBatch?.product_id ?? "",
|
|
167
|
+
add: buckets.attributeBatch?.add ?? [],
|
|
168
|
+
remove: buckets.attributeBatch?.remove ?? [],
|
|
169
|
+
update: buckets.attributeBatch?.update ?? [],
|
|
177
170
|
})),
|
|
178
171
|
});
|
|
179
172
|
(0, workflows_sdk_1.when)({ buckets }, ({ buckets }) => buckets.productsToDelete.length > 0).then(() => {
|
|
@@ -188,4 +181,4 @@ exports.applyProductChangeActionsWorkflow = (0, workflows_sdk_1.createWorkflow)(
|
|
|
188
181
|
});
|
|
189
182
|
return new workflows_sdk_1.WorkflowResponse(void 0);
|
|
190
183
|
});
|
|
191
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
184
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbHktcHJvZHVjdC1jaGFuZ2UtYWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3MvcHJvZHVjdC1lZGl0L3dvcmtmbG93cy9hcHBseS1wcm9kdWN0LWNoYW5nZS1hY3Rpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFFQU0wQztBQUMxQyw0REFPb0M7QUFDcEMsMkNBSXdCO0FBRXhCLG9DQUlpQjtBQUNqQixxR0FBcUc7QUFzQnhGLFFBQUEsbUNBQW1DLEdBQzlDLDhCQUE4QixDQUFBO0FBRW5CLFFBQUEsaUNBQWlDLEdBSTFDLElBQUEsOEJBQWMsRUFDaEIsMkNBQW1DLEVBQ25DLFVBQVUsS0FBNkM7SUFDckQsTUFBTSxFQUFFLElBQUksRUFBRSxPQUFPLEVBQUUsR0FBRyxJQUFBLDhCQUFpQixFQUFDO1FBQzFDLE1BQU0sRUFBRSx1QkFBdUI7UUFDL0IsTUFBTSxFQUFFLENBQUMsSUFBSSxFQUFFLFlBQVksRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFFLFNBQVMsQ0FBQztRQUM1RCxPQUFPLEVBQUU7WUFDUCxpQkFBaUIsRUFBRSxLQUFLLENBQUMsVUFBVTtZQUNuQyxPQUFPLEVBQUUsS0FB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dBQUcsRUFBRTtRQUNWLElBQUEsc0NBQThCLEVBQzVCLElBQUEseUJBQVMsRUFBQyxFQUFFLE9BQU8sRUFBRSxFQUFFLENBQUMsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLENBQ3JDLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLEVBQUUsT0FBTyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUMsQ0FDOUQsQ0FDRixDQUFBO0lBQ0gsQ0FBQyxDQUFDLENBQUE7SUFFRixPQUFPLElBQUksZ0NBQWdCLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQTtBQUNyQyxDQUFDLENBQ0YsQ0FBQSJ9
|
package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.d.ts
CHANGED
|
@@ -2,16 +2,8 @@ import { type ReturnWorkflow } from "@medusajs/framework/workflows-sdk";
|
|
|
2
2
|
export type AutoConfirmProductChangeWorkflowInput = {
|
|
3
3
|
change_id: string;
|
|
4
4
|
confirmed_by?: string;
|
|
5
|
+
force?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const autoConfirmProductChangeWorkflowId = "auto-confirm-product-change";
|
|
7
|
-
/**
|
|
8
|
-
* Runs `confirmProductChangeWorkflow` inline when the
|
|
9
|
-
* `PRODUCT_REQUEST` feature flag is disabled. Lets the seller's edit
|
|
10
|
-
* staging workflows always create a `ProductChange`; the change is
|
|
11
|
-
* either left pending for admin approval (flag on) or auto-applied
|
|
12
|
-
* (flag off). Marketplaces that don't need an approval queue toggle
|
|
13
|
-
* `MEDUSA_FF_PRODUCT_REQUEST=false` and get direct-mutation UX without
|
|
14
|
-
* the routes diverging.
|
|
15
|
-
*/
|
|
16
8
|
export declare const autoConfirmProductChangeWorkflow: ReturnWorkflow<AutoConfirmProductChangeWorkflowInput, void, [
|
|
17
9
|
]>;
|
|
@@ -6,17 +6,9 @@ const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
|
6
6
|
const types_1 = require("@mercurjs/types");
|
|
7
7
|
const confirm_product_change_1 = require("./confirm-product-change");
|
|
8
8
|
exports.autoConfirmProductChangeWorkflowId = "auto-confirm-product-change";
|
|
9
|
-
/**
|
|
10
|
-
* Runs `confirmProductChangeWorkflow` inline when the
|
|
11
|
-
* `PRODUCT_REQUEST` feature flag is disabled. Lets the seller's edit
|
|
12
|
-
* staging workflows always create a `ProductChange`; the change is
|
|
13
|
-
* either left pending for admin approval (flag on) or auto-applied
|
|
14
|
-
* (flag off). Marketplaces that don't need an approval queue toggle
|
|
15
|
-
* `MEDUSA_FF_PRODUCT_REQUEST=false` and get direct-mutation UX without
|
|
16
|
-
* the routes diverging.
|
|
17
|
-
*/
|
|
18
9
|
exports.autoConfirmProductChangeWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.autoConfirmProductChangeWorkflowId, function (input) {
|
|
19
|
-
(0, workflows_sdk_1.when)({ input }, () =>
|
|
10
|
+
(0, workflows_sdk_1.when)({ input }, ({ input }) => Boolean(input.force) ||
|
|
11
|
+
!utils_1.FeatureFlag.isFeatureEnabled(types_1.MercurFeatureFlags.PRODUCT_REQUEST)).then(() => {
|
|
20
12
|
confirm_product_change_1.confirmProductChangeWorkflow.runAsStep({
|
|
21
13
|
input: (0, workflows_sdk_1.transform)({ input }, ({ input }) => ({
|
|
22
14
|
ids: [input.change_id],
|
|
@@ -26,4 +18,4 @@ exports.autoConfirmProductChangeWorkflow = (0, workflows_sdk_1.createWorkflow)(e
|
|
|
26
18
|
});
|
|
27
19
|
return new workflows_sdk_1.WorkflowResponse(void 0);
|
|
28
20
|
});
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0by1jb25maXJtLXByb2R1Y3QtY2hhbmdlLmpzIiwic291cmNlUm9vdCI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Q==
|
|
@@ -16,15 +16,4 @@ export type ConfirmProductChangeWorkflowHooks = [
|
|
|
16
16
|
}, unknown>
|
|
17
17
|
];
|
|
18
18
|
export declare const confirmProductChangeWorkflowId = "confirm-product-change";
|
|
19
|
-
/**
|
|
20
|
-
* Mirrors `confirm-order-edit-request.ts`:
|
|
21
|
-
* 1. `useQueryGraphStep` (load change),
|
|
22
|
-
* 2. `confirmProductChangeValidationStep` (status guard),
|
|
23
|
-
* 3. `confirmProductChangesStep` (mutation),
|
|
24
|
-
* 4. `applyProductChangeActionsWorkflow.runAsStep` — dispatches the
|
|
25
|
-
* confirmed change's pending actions into stock product workflows
|
|
26
|
-
* and Module-Link writes (replaces the legacy
|
|
27
|
-
* `ProductModuleService.applyProductChangeActions_`).
|
|
28
|
-
* 5. `emitEventStep` → `createHook("productChangeConfirmed", …)`.
|
|
29
|
-
*/
|
|
30
19
|
export declare const confirmProductChangeWorkflow: ReturnWorkflow<ConfirmProductChangeWorkflowInput, void, ConfirmProductChangeWorkflowHooks>;
|
|
@@ -7,17 +7,6 @@ const events_1 = require("../events");
|
|
|
7
7
|
const steps_1 = require("../steps");
|
|
8
8
|
const apply_product_change_actions_1 = require("./apply-product-change-actions");
|
|
9
9
|
exports.confirmProductChangeWorkflowId = "confirm-product-change";
|
|
10
|
-
/**
|
|
11
|
-
* Mirrors `confirm-order-edit-request.ts`:
|
|
12
|
-
* 1. `useQueryGraphStep` (load change),
|
|
13
|
-
* 2. `confirmProductChangeValidationStep` (status guard),
|
|
14
|
-
* 3. `confirmProductChangesStep` (mutation),
|
|
15
|
-
* 4. `applyProductChangeActionsWorkflow.runAsStep` — dispatches the
|
|
16
|
-
* confirmed change's pending actions into stock product workflows
|
|
17
|
-
* and Module-Link writes (replaces the legacy
|
|
18
|
-
* `ProductModuleService.applyProductChangeActions_`).
|
|
19
|
-
* 5. `emitEventStep` → `createHook("productChangeConfirmed", …)`.
|
|
20
|
-
*/
|
|
21
10
|
exports.confirmProductChangeWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.confirmProductChangeWorkflowId, function (input) {
|
|
22
11
|
const validate = (0, workflows_sdk_1.createHook)("validate", { input });
|
|
23
12
|
const { data: changes } = (0, core_flows_1.useQueryGraphStep)({
|
|
@@ -52,4 +41,4 @@ exports.confirmProductChangeWorkflow = (0, workflows_sdk_1.createWorkflow)(expor
|
|
|
52
41
|
hooks: [validate, productChangeConfirmed],
|
|
53
42
|
});
|
|
54
43
|
});
|
|
55
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS1wcm9kdWN0LWNoYW5nZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3MvcHJvZHVjdC1lZGl0L3dvcmtmbG93cy9jb25maXJtLXByb2R1Y3QtY2hhbmdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLHFFQU8wQztBQUMxQyw0REFHb0M7QUFFcEMsc0NBQXVEO0FBQ3ZELG9DQUdpQjtBQUNqQixpRkFBa0Y7QUFxQnJFLFFBQUEsOEJBQThCLEdBQUcsd0JBQXdCLENBQUE7QUFFekQsUUFBQSw0QkFBNEIsR0FJckMsSUFBQSw4QkFBYyxFQUNoQixzQ0FBOEIsRUFDOUIsVUFBVSxLQUF3QztJQUNoRCxNQUFNLFFBQVEsR0FBRyxJQUFBLDBCQUFVLEVBQUMsVUFBVSxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQTtJQUVsRCxNQUFNLEVBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRSxHQUFHLElBQUEsOEJBQWlCLEVBQUM7UUFDMUMsTUFBTSxFQUFFLGdCQUFnQjtRQUN4QixNQUFNLEVBQUUsQ0FBQyxJQUFJLEVBQUUsUUFBUSxDQUFDO1FBQ3hCLE9BQU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DdkMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQ2hDO0tBQ0YsQ0FBQyxDQUFBO0lBRUYsTUFBTSxzQkFBc0IsR0FBRyxJQUFBLDBCQUFVLEVBQUMsd0JBQXdCLEVBQUU7UUFDbEUsR0FBRyxFQUFFLEtBQUssQ0FBQyxHQUFHO1FBQ2QsZUFBZSxFQUFFLEtBQUssQ0FBQyxlQUFlO0tBQ3ZDLENBQUMsQ0FBQTtJQUVGLE9BQU8sSUFBSSxnQ0FBZ0IsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUNsQyxLQUFLLEVBQUUsQ0FBQyxRQUFRLEVBQUUsc0JBQXNCLENBQUM7S0FDMUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUNGLENBQUEifQ==
|
|
@@ -7,7 +7,7 @@ export * from "./apply-product-attribute-change-actions";
|
|
|
7
7
|
export * from "./auto-confirm-product-change";
|
|
8
8
|
export * from "./record-product-audit-change";
|
|
9
9
|
export * from "./stage-product-change";
|
|
10
|
-
export * from "./product-edit-update-
|
|
10
|
+
export * from "./product-edit-update-product";
|
|
11
11
|
export * from "./product-edit-delete-product";
|
|
12
12
|
export * from "./product-edit-update-variants";
|
|
13
13
|
export * from "./product-edit-update-attributes";
|
|
@@ -23,8 +23,8 @@ __exportStar(require("./apply-product-attribute-change-actions"), exports);
|
|
|
23
23
|
__exportStar(require("./auto-confirm-product-change"), exports);
|
|
24
24
|
__exportStar(require("./record-product-audit-change"), exports);
|
|
25
25
|
__exportStar(require("./stage-product-change"), exports);
|
|
26
|
-
__exportStar(require("./product-edit-update-
|
|
26
|
+
__exportStar(require("./product-edit-update-product"), exports);
|
|
27
27
|
__exportStar(require("./product-edit-delete-product"), exports);
|
|
28
28
|
__exportStar(require("./product-edit-update-variants"), exports);
|
|
29
29
|
__exportStar(require("./product-edit-update-attributes"), exports);
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL3Byb2R1Y3QtZWRpdC93b3JrZmxvd3MvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDBEQUF1QztBQUN2QywyREFBd0M7QUFDeEMsMERBQXVDO0FBQ3ZDLDBEQUF1QztBQUN2QyxpRUFBOEM7QUFDOUMsMkVBQXdEO0FBQ3hELGdFQUE2QztBQUM3QyxnRUFBNkM7QUFDN0MseURBQXNDO0FBQ3RDLGdFQUE2QztBQUM3QyxnRUFBNkM7QUFDN0MsaUVBQThDO0FBQzlDLG1FQUFnRCJ9
|
package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.d.ts
CHANGED
|
@@ -6,12 +6,5 @@ export type ProductEditDeleteProductWorkflowInput = {
|
|
|
6
6
|
created_by?: string;
|
|
7
7
|
} & AdditionalData;
|
|
8
8
|
export declare const productEditDeleteProductWorkflowId = "product-edit-delete-product";
|
|
9
|
-
/**
|
|
10
|
-
* Vendor "delete product" orchestrator. Stages a `PRODUCT_DELETE`
|
|
11
|
-
* action on a fresh `ProductChange` via `stageProductChangeWorkflow`,
|
|
12
|
-
* which dispatches through `autoConfirmProductChangeWorkflow` —
|
|
13
|
-
* either leaves it pending for admin approval (flag on) or applies it
|
|
14
|
-
* inline (flag off).
|
|
15
|
-
*/
|
|
16
9
|
export declare const productEditDeleteProductWorkflow: ReturnWorkflow<ProductEditDeleteProductWorkflowInput, ProductChangeDTO, [
|
|
17
10
|
]>;
|
|
@@ -2,25 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.productEditDeleteProductWorkflow = exports.productEditDeleteProductWorkflowId = void 0;
|
|
4
4
|
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
5
6
|
const types_1 = require("@mercurjs/types");
|
|
6
7
|
const steps_1 = require("../steps");
|
|
7
8
|
const stage_product_change_1 = require("./stage-product-change");
|
|
8
9
|
exports.productEditDeleteProductWorkflowId = "product-edit-delete-product";
|
|
9
|
-
/**
|
|
10
|
-
* Vendor "delete product" orchestrator. Stages a `PRODUCT_DELETE`
|
|
11
|
-
* action on a fresh `ProductChange` via `stageProductChangeWorkflow`,
|
|
12
|
-
* which dispatches through `autoConfirmProductChangeWorkflow` —
|
|
13
|
-
* either leaves it pending for admin approval (flag on) or applies it
|
|
14
|
-
* inline (flag off).
|
|
15
|
-
*/
|
|
16
10
|
exports.productEditDeleteProductWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.productEditDeleteProductWorkflowId, function (input) {
|
|
17
11
|
(0, steps_1.validateNoPendingProductChangeStep)((0, workflows_sdk_1.transform)({ input }, ({ input }) => ({
|
|
18
12
|
product_ids: [input.product_id],
|
|
19
13
|
})));
|
|
14
|
+
const { data: products } = (0, core_flows_1.useQueryGraphStep)({
|
|
15
|
+
entity: "product",
|
|
16
|
+
fields: ["id", "status"],
|
|
17
|
+
filters: { id: input.product_id },
|
|
18
|
+
options: { throwIfKeyNotFound: true },
|
|
19
|
+
}).config({ name: "delete-load-product" });
|
|
20
20
|
const change = stage_product_change_1.stageProductChangeWorkflow.runAsStep({
|
|
21
|
-
input: (0, workflows_sdk_1.transform)({ input }, ({ input }) => ({
|
|
21
|
+
input: (0, workflows_sdk_1.transform)({ input, products }, ({ input, products }) => ({
|
|
22
22
|
product_id: input.product_id,
|
|
23
23
|
created_by: input.created_by,
|
|
24
|
+
auto_confirm: products[0]?.status === types_1.ProductStatus.DRAFT,
|
|
24
25
|
actions: [
|
|
25
26
|
{
|
|
26
27
|
product_id: input.product_id,
|
|
@@ -32,4 +33,4 @@ exports.productEditDeleteProductWorkflow = (0, workflows_sdk_1.createWorkflow)(e
|
|
|
32
33
|
});
|
|
33
34
|
return new workflows_sdk_1.WorkflowResponse(change);
|
|
34
35
|
});
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC1lZGl0LWRlbGV0ZS1wcm9kdWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3dvcmtmbG93cy9wcm9kdWN0LWVkaXQvd29ya2Zsb3dzL3Byb2R1Y3QtZWRpdC1kZWxldGUtcHJvZHVjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxxRUFLMEM7QUFDMUMsNERBQStEO0FBQy9ELDJDQUl3QjtBQUV4QixvQ0FBNkQ7QUFDN0QsaUVBQW1FO0FBT3RELFFBQUEsa0NBQWtDLEdBQzdDLDZCQUE2QixDQUFBO0FBRWxCLFFBQUEsZ0NBQWdDLEdBSXpDLElBQUEsOEJBQWMsRUFDaEIsMENBQWtDLEVBQ2xDLFVBQVUsS0FBNEM7SUFDcEQsSUFBQSwwQ0FBa0MsRUFDaEMsSUFBQSx5QkFBUyxFQUFDLEVBQUUsS0FBSyxFQUFFLEVBQUUsQ0FBQyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBQ25DLFdBQVcsRUFBRSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUM7S0FDaEMsQ0FBQyxDQUFDLENBQ0osQ0FBQTtJQUVELE1BQU0sRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLEdBQUcsSUFBQSw4QkFBaUIsRUFBQztRQUMzQyxNQUFNLEVBQUUsU0FBUztRQUNqQixNQUFNLEVBQUUsQ0FBQyxJQUFJLEVBQUUsUUFBUSxDQUFDO1FBQ3hCLE9BQU8sRUFBRSxFQUFFLEVBQUUsRUFBRSxLQUFLLENBQUMsVUFBVSxFQUFFO1FBQ2pDLE9BQU8sRUFBRSxFQUFFLGtCQUFrQixFQUFFLElBQUksRUFBRTtLQUN0QyxDQUFDLENBQUMsTUFBTSxDQUFDLEVBQUUsSUFBSSxFQUFFLHFCQUFxQixFQUFFLENBQUMsQ0FBQTtJQUUxQyxNQUFNLE1BQU0sR0FBRyxpREFBMEIsQ0FBQyxTQUFTLENBQUM7UUFDbEQsS0FBSyxFQUFFLElBQUEseUJBQVMsRUFBQyxFQUFFLEtBQUssRUFBRSxRQUFRLEVBQUUsRUFBRSxDQUFDLEVBQUUsS0FBSyxFQUFFLFFBQVEsRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1lBQzlELFVBQVUsRUFBRSxLQUFLLENBQUMsVUFBVTtZQUM1QixVQUFVLEVBQUUsS0FBSyxDQUFDLFVBQVU7WUFDNUIsWUFBWSxFQUFFLFFBQVEsQ0FBQyxDQUFDLENBQUMsRUFBRSxNQUFNLEtBQUsscUJBQWEsQ0FBQyxLQUFLO1lBQ3pELE9BQU8sRUFBRTtnQkFDUDtvQkFDRSxVQUFVLEVBQUUsS0FBSyxDQUFDLFVBQVU7b0JBQzVCLE1BQU0sRUFBRSwrQkFBdUIsQ0FBQyxjQUFjO29CQUM5QyxPQUFPLEVBQUUsRUFBRTtpQkFDWjthQUNGO1NBQ0YsQ0FBQyxDQUFDO0tBQ0osQ0FBQyxDQUFBO0lBRUYsT0FBTyxJQUFJLGdDQUFnQixDQUFDLE1BQU0sQ0FBQyxDQUFBO0FBQ3JDLENBQUMsQ0FDRixDQUFBIn0=
|
package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.d.ts
CHANGED
|
@@ -1,55 +1,13 @@
|
|
|
1
1
|
import { AdditionalData } from "@medusajs/framework/types";
|
|
2
2
|
import { type ReturnWorkflow } from "@medusajs/framework/workflows-sdk";
|
|
3
|
-
import {
|
|
4
|
-
/**
|
|
5
|
-
* Existing-attribute reference passed by the vendor. `value_ids` are
|
|
6
|
-
* already `ProductAttributeValue` ids; if the caller passed value
|
|
7
|
-
* `values` (names) instead, the route resolves them via
|
|
8
|
-
* `upsertProductAttributeValuesWorkflow` before invoking this flow.
|
|
9
|
-
*/
|
|
10
|
-
export type ProductEditAttributeAddExistingOperation = {
|
|
11
|
-
type: "add";
|
|
12
|
-
attribute_id: string;
|
|
13
|
-
value_ids?: string[];
|
|
14
|
-
values?: string[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Inline-create reference — the vendor is creating a product-scoped
|
|
18
|
-
* attribute and its values in the same submission. The attribute and
|
|
19
|
-
* its values are created up-front; the `ProductChangeAction` only
|
|
20
|
-
* stages the *link* between product and value.
|
|
21
|
-
*/
|
|
22
|
-
export type ProductEditAttributeAddInlineOperation = {
|
|
23
|
-
type: "add";
|
|
24
|
-
attribute_id?: undefined;
|
|
25
|
-
name: string;
|
|
26
|
-
attribute_type: AttributeType;
|
|
27
|
-
values: string[];
|
|
28
|
-
is_variant_axis?: boolean;
|
|
29
|
-
is_filterable?: boolean;
|
|
30
|
-
is_required?: boolean;
|
|
31
|
-
description?: string | null;
|
|
32
|
-
metadata?: Record<string, unknown> | null;
|
|
33
|
-
};
|
|
34
|
-
export type ProductEditAttributeRemoveOperation = {
|
|
35
|
-
type: "remove";
|
|
36
|
-
attribute_id: string;
|
|
37
|
-
};
|
|
38
|
-
export type ProductEditAttributeOperation = ProductEditAttributeAddExistingOperation | ProductEditAttributeAddInlineOperation | ProductEditAttributeRemoveOperation;
|
|
3
|
+
import { ProductAttributeBatchAdd, ProductAttributeBatchUpdate, ProductChangeDTO } from "@mercurjs/types";
|
|
39
4
|
export type ProductEditUpdateAttributesWorkflowInput = {
|
|
40
5
|
product_id: string;
|
|
41
6
|
created_by?: string;
|
|
42
|
-
|
|
7
|
+
add?: ProductAttributeBatchAdd[];
|
|
8
|
+
remove?: string[];
|
|
9
|
+
update?: ProductAttributeBatchUpdate[];
|
|
43
10
|
} & AdditionalData;
|
|
44
11
|
export declare const productEditUpdateAttributesWorkflowId = "product-edit-update-attributes";
|
|
45
|
-
/**
|
|
46
|
-
* Vendor "edit product attributes" orchestrator. Supports
|
|
47
|
-
* attach-existing and inline-create on the add path, plus detach on
|
|
48
|
-
* the remove path. Inline-create writes a real product-scoped
|
|
49
|
-
* `ProductAttribute` + values up-front so the staged action can carry
|
|
50
|
-
* pre-resolved `attribute_value_ids` — the dispatcher contract
|
|
51
|
-
* documented in `apply-product-change-actions.ts`. The link between
|
|
52
|
-
* product and value is what gets staged, not the attribute schema.
|
|
53
|
-
*/
|
|
54
12
|
export declare const productEditUpdateAttributesWorkflow: ReturnWorkflow<ProductEditUpdateAttributesWorkflowInput, ProductChangeDTO, [
|
|
55
13
|
]>;
|