@mercurjs/b2c-core 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.medusa/server/src/admin/index.js +38862 -0
- package/.medusa/server/src/admin/index.mjs +38846 -0
- package/.medusa/server/src/api/admin/attributes/[id]/route.d.ts +177 -0
- package/.medusa/server/src/api/admin/attributes/[id]/route.js +240 -0
- package/.medusa/server/src/api/admin/attributes/[id]/values/[value_id]/route.d.ts +116 -0
- package/.medusa/server/src/api/admin/attributes/[id]/values/[value_id]/route.js +152 -0
- package/.medusa/server/src/api/admin/attributes/[id]/values/route.d.ts +111 -0
- package/.medusa/server/src/api/admin/attributes/[id]/values/route.js +151 -0
- package/.medusa/server/src/api/admin/attributes/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/attributes/middlewares.js +102 -0
- package/.medusa/server/src/api/admin/attributes/query-config.d.ts +20 -0
- package/.medusa/server/src/api/admin/attributes/query-config.js +41 -0
- package/.medusa/server/src/api/admin/attributes/route.d.ts +194 -0
- package/.medusa/server/src/api/admin/attributes/route.js +241 -0
- package/.medusa/server/src/api/admin/attributes/validators.d.ts +497 -0
- package/.medusa/server/src/api/admin/attributes/validators.js +80 -0
- package/.medusa/server/src/api/admin/configuration/[id]/route.d.ts +37 -0
- package/.medusa/server/src/api/admin/configuration/[id]/route.js +47 -0
- package/.medusa/server/src/api/admin/configuration/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/configuration/middlewares.js +23 -0
- package/.medusa/server/src/api/admin/configuration/route.d.ts +77 -0
- package/.medusa/server/src/api/admin/configuration/route.js +102 -0
- package/.medusa/server/src/api/admin/configuration/validators.d.ts +59 -0
- package/.medusa/server/src/api/admin/configuration/validators.js +18 -0
- package/.medusa/server/src/api/admin/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/middlewares.js +16 -0
- package/.medusa/server/src/api/admin/notifications/route.d.ts +55 -0
- package/.medusa/server/src/api/admin/notifications/route.js +67 -0
- package/.medusa/server/src/api/admin/order-sets/[id]/route.d.ts +47 -0
- package/.medusa/server/src/api/admin/order-sets/[id]/route.js +61 -0
- package/.medusa/server/src/api/admin/order-sets/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/order-sets/middlewares.js +23 -0
- package/.medusa/server/src/api/admin/order-sets/query-config.d.ts +11 -0
- package/.medusa/server/src/api/admin/order-sets/query-config.js +68 -0
- package/.medusa/server/src/api/admin/order-sets/route.d.ts +60 -0
- package/.medusa/server/src/api/admin/order-sets/route.js +97 -0
- package/.medusa/server/src/api/admin/order-sets/validators.d.ts +24 -0
- package/.medusa/server/src/api/admin/order-sets/validators.js +12 -0
- package/.medusa/server/src/api/admin/orders/[id]/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/orders/[id]/route.js +20 -0
- package/.medusa/server/src/api/admin/products/[id]/applicable-attributes/route.d.ts +50 -0
- package/.medusa/server/src/api/admin/products/[id]/applicable-attributes/route.js +58 -0
- package/.medusa/server/src/api/admin/products/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/products/middlewares.js +16 -0
- package/.medusa/server/src/api/admin/products/query-config.d.ts +10 -0
- package/.medusa/server/src/api/admin/products/query-config.js +24 -0
- package/.medusa/server/src/api/admin/products/validators.d.ts +1803 -0
- package/.medusa/server/src/api/admin/products/validators.js +236 -0
- package/.medusa/server/src/api/admin/sellers/[id]/customer-groups/route.d.ts +73 -0
- package/.medusa/server/src/api/admin/sellers/[id]/customer-groups/route.js +100 -0
- package/.medusa/server/src/api/admin/sellers/[id]/orders/route.d.ts +73 -0
- package/.medusa/server/src/api/admin/sellers/[id]/orders/route.js +113 -0
- package/.medusa/server/src/api/admin/sellers/[id]/products/route.d.ts +73 -0
- package/.medusa/server/src/api/admin/sellers/[id]/products/route.js +100 -0
- package/.medusa/server/src/api/admin/sellers/[id]/route.d.ts +134 -0
- package/.medusa/server/src/api/admin/sellers/[id]/route.js +167 -0
- package/.medusa/server/src/api/admin/sellers/invite/route.d.ts +52 -0
- package/.medusa/server/src/api/admin/sellers/invite/route.js +61 -0
- package/.medusa/server/src/api/admin/sellers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/sellers/middlewares.js +58 -0
- package/.medusa/server/src/api/admin/sellers/query-config.d.ts +31 -0
- package/.medusa/server/src/api/admin/sellers/query-config.js +43 -0
- package/.medusa/server/src/api/admin/sellers/route.d.ts +54 -0
- package/.medusa/server/src/api/admin/sellers/route.js +71 -0
- package/.medusa/server/src/api/admin/sellers/validators.d.ts +134 -0
- package/.medusa/server/src/api/admin/sellers/validators.js +45 -0
- package/.medusa/server/src/api/admin/stock-locations/route.d.ts +2 -0
- package/.medusa/server/src/api/admin/stock-locations/route.js +21 -0
- package/.medusa/server/src/api/admin/talk-js/route.d.ts +2 -0
- package/.medusa/server/src/api/admin/talk-js/route.js +9 -0
- package/.medusa/server/src/api/hooks/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/hooks/middlewares.js +11 -0
- package/.medusa/server/src/api/hooks/payouts/route.d.ts +2 -0
- package/.medusa/server/src/api/hooks/payouts/route.js +22 -0
- package/.medusa/server/src/api/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/middlewares.js +10 -0
- package/.medusa/server/src/api/openapi/admin/attribute.d.ts +106 -0
- package/.medusa/server/src/api/openapi/admin/attribute.js +108 -0
- package/.medusa/server/src/api/openapi/admin/commission.d.ts +177 -0
- package/.medusa/server/src/api/openapi/admin/commission.js +179 -0
- package/.medusa/server/src/api/openapi/admin/configuration.d.ts +16 -0
- package/.medusa/server/src/api/openapi/admin/configuration.js +18 -0
- package/.medusa/server/src/api/openapi/admin/notification.d.ts +33 -0
- package/.medusa/server/src/api/openapi/admin/notification.js +35 -0
- package/.medusa/server/src/api/openapi/admin/order-set.d.ts +78 -0
- package/.medusa/server/src/api/openapi/admin/order-set.js +80 -0
- package/.medusa/server/src/api/openapi/admin/request.d.ts +45 -0
- package/.medusa/server/src/api/openapi/admin/request.js +47 -0
- package/.medusa/server/src/api/openapi/admin/return-request.d.ts +86 -0
- package/.medusa/server/src/api/openapi/admin/return-request.js +88 -0
- package/.medusa/server/src/api/openapi/admin/seller.d.ts +97 -0
- package/.medusa/server/src/api/openapi/admin/seller.js +99 -0
- package/.medusa/server/src/api/openapi/store/order-set.d.ts +78 -0
- package/.medusa/server/src/api/openapi/store/order-set.js +80 -0
- package/.medusa/server/src/api/openapi/store/return.d.ts +111 -0
- package/.medusa/server/src/api/openapi/store/return.js +113 -0
- package/.medusa/server/src/api/openapi/store/seller.d.ts +64 -0
- package/.medusa/server/src/api/openapi/store/seller.js +66 -0
- package/.medusa/server/src/api/openapi/store/wishlist.d.ts +146 -0
- package/.medusa/server/src/api/openapi/store/wishlist.js +148 -0
- package/.medusa/server/src/api/openapi/vendor/attribute.d.ts +73 -0
- package/.medusa/server/src/api/openapi/vendor/attribute.js +75 -0
- package/.medusa/server/src/api/openapi/vendor/auth.d.ts +129 -0
- package/.medusa/server/src/api/openapi/vendor/auth.js +131 -0
- package/.medusa/server/src/api/openapi/vendor/campaign.d.ts +87 -0
- package/.medusa/server/src/api/openapi/vendor/campaign.js +89 -0
- package/.medusa/server/src/api/openapi/vendor/commission.d.ts +177 -0
- package/.medusa/server/src/api/openapi/vendor/commission.js +179 -0
- package/.medusa/server/src/api/openapi/vendor/customer.d.ts +48 -0
- package/.medusa/server/src/api/openapi/vendor/customer.js +50 -0
- package/.medusa/server/src/api/openapi/vendor/fulfillment.d.ts +463 -0
- package/.medusa/server/src/api/openapi/vendor/fulfillment.js +465 -0
- package/.medusa/server/src/api/openapi/vendor/marketplace.d.ts +26 -0
- package/.medusa/server/src/api/openapi/vendor/marketplace.js +28 -0
- package/.medusa/server/src/api/openapi/vendor/notification.d.ts +33 -0
- package/.medusa/server/src/api/openapi/vendor/notification.js +35 -0
- package/.medusa/server/src/api/openapi/vendor/onboarding.d.ts +39 -0
- package/.medusa/server/src/api/openapi/vendor/onboarding.js +41 -0
- package/.medusa/server/src/api/openapi/vendor/order.d.ts +1521 -0
- package/.medusa/server/src/api/openapi/vendor/order.js +1523 -0
- package/.medusa/server/src/api/openapi/vendor/payout.d.ts +110 -0
- package/.medusa/server/src/api/openapi/vendor/payout.js +112 -0
- package/.medusa/server/src/api/openapi/vendor/price-list.d.ts +124 -0
- package/.medusa/server/src/api/openapi/vendor/price-list.js +126 -0
- package/.medusa/server/src/api/openapi/vendor/price-preference.d.ts +47 -0
- package/.medusa/server/src/api/openapi/vendor/price-preference.js +49 -0
- package/.medusa/server/src/api/openapi/vendor/product.d.ts +467 -0
- package/.medusa/server/src/api/openapi/vendor/product.js +469 -0
- package/.medusa/server/src/api/openapi/vendor/promotion.d.ts +165 -0
- package/.medusa/server/src/api/openapi/vendor/promotion.js +167 -0
- package/.medusa/server/src/api/openapi/vendor/region.d.ts +58 -0
- package/.medusa/server/src/api/openapi/vendor/region.js +60 -0
- package/.medusa/server/src/api/openapi/vendor/request.d.ts +38 -0
- package/.medusa/server/src/api/openapi/vendor/request.js +40 -0
- package/.medusa/server/src/api/openapi/vendor/reservation.d.ts +54 -0
- package/.medusa/server/src/api/openapi/vendor/reservation.js +56 -0
- package/.medusa/server/src/api/openapi/vendor/return-request.d.ts +72 -0
- package/.medusa/server/src/api/openapi/vendor/return-request.js +74 -0
- package/.medusa/server/src/api/openapi/vendor/return.d.ts +111 -0
- package/.medusa/server/src/api/openapi/vendor/return.js +113 -0
- package/.medusa/server/src/api/openapi/vendor/review.d.ts +28 -0
- package/.medusa/server/src/api/openapi/vendor/review.js +30 -0
- package/.medusa/server/src/api/openapi/vendor/sales-channels.d.ts +44 -0
- package/.medusa/server/src/api/openapi/vendor/sales-channels.js +46 -0
- package/.medusa/server/src/api/openapi/vendor/seller.d.ts +170 -0
- package/.medusa/server/src/api/openapi/vendor/seller.js +172 -0
- package/.medusa/server/src/api/openapi/vendor/store.d.ts +54 -0
- package/.medusa/server/src/api/openapi/vendor/store.js +56 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/route.d.ts +2 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/route.js +20 -0
- package/.medusa/server/src/api/store/carts/[id]/line-items/[line_id]/route.d.ts +3 -0
- package/.medusa/server/src/api/store/carts/[id]/line-items/[line_id]/route.js +17 -0
- package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.d.ts +5 -0
- package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.js +43 -0
- package/.medusa/server/src/api/store/carts/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/carts/middlewares.js +60 -0
- package/.medusa/server/src/api/store/carts/validators.d.ts +9 -0
- package/.medusa/server/src/api/store/carts/validators.js +8 -0
- package/.medusa/server/src/api/store/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/middlewares.js +27 -0
- package/.medusa/server/src/api/store/order-set/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/store/order-set/[id]/route.js +15 -0
- package/.medusa/server/src/api/store/order-set/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/order-set/middlewares.js +23 -0
- package/.medusa/server/src/api/store/order-set/query-config.d.ts +11 -0
- package/.medusa/server/src/api/store/order-set/query-config.js +50 -0
- package/.medusa/server/src/api/store/order-set/route.d.ts +76 -0
- package/.medusa/server/src/api/store/order-set/route.js +104 -0
- package/.medusa/server/src/api/store/order-set/validators.d.ts +19 -0
- package/.medusa/server/src/api/store/order-set/validators.js +9 -0
- package/.medusa/server/src/api/store/returns/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/store/returns/[id]/route.js +22 -0
- package/.medusa/server/src/api/store/returns/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/returns/middlewares.js +23 -0
- package/.medusa/server/src/api/store/returns/query-config.d.ts +11 -0
- package/.medusa/server/src/api/store/returns/query-config.js +29 -0
- package/.medusa/server/src/api/store/returns/route.d.ts +76 -0
- package/.medusa/server/src/api/store/returns/route.js +102 -0
- package/.medusa/server/src/api/store/returns/validators.d.ts +19 -0
- package/.medusa/server/src/api/store/returns/validators.js +9 -0
- package/.medusa/server/src/api/store/seller/[handle]/route.d.ts +36 -0
- package/.medusa/server/src/api/store/seller/[handle]/route.js +53 -0
- package/.medusa/server/src/api/store/seller/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/seller/middlewares.js +23 -0
- package/.medusa/server/src/api/store/seller/query-config.d.ts +11 -0
- package/.medusa/server/src/api/store/seller/query-config.js +27 -0
- package/.medusa/server/src/api/store/seller/route.d.ts +53 -0
- package/.medusa/server/src/api/store/seller/route.js +71 -0
- package/.medusa/server/src/api/store/seller/validators.d.ts +21 -0
- package/.medusa/server/src/api/store/seller/validators.js +9 -0
- package/.medusa/server/src/api/store/shipping-options/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/shipping-options/middlewares.js +24 -0
- package/.medusa/server/src/api/store/shipping-options/query-config.d.ts +10 -0
- package/.medusa/server/src/api/store/shipping-options/query-config.js +14 -0
- package/.medusa/server/src/api/store/shipping-options/return/route.d.ts +50 -0
- package/.medusa/server/src/api/store/shipping-options/return/route.js +65 -0
- package/.medusa/server/src/api/store/shipping-options/route.d.ts +2 -0
- package/.medusa/server/src/api/store/shipping-options/route.js +14 -0
- package/.medusa/server/src/api/store/shipping-options/validators.d.ts +77 -0
- package/.medusa/server/src/api/store/shipping-options/validators.js +28 -0
- package/.medusa/server/src/api/store/wishlist/[id]/product/[reference_id]/route.d.ts +46 -0
- package/.medusa/server/src/api/store/wishlist/[id]/product/[reference_id]/route.js +61 -0
- package/.medusa/server/src/api/store/wishlist/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/wishlist/middlewares.js +39 -0
- package/.medusa/server/src/api/store/wishlist/query-config.d.ts +11 -0
- package/.medusa/server/src/api/store/wishlist/query-config.js +43 -0
- package/.medusa/server/src/api/store/wishlist/route.d.ts +103 -0
- package/.medusa/server/src/api/store/wishlist/route.js +152 -0
- package/.medusa/server/src/api/store/wishlist/validators.d.ts +63 -0
- package/.medusa/server/src/api/store/wishlist/validators.js +45 -0
- package/.medusa/server/src/api/vendor/attributes/[id]/route.d.ts +48 -0
- package/.medusa/server/src/api/vendor/attributes/[id]/route.js +65 -0
- package/.medusa/server/src/api/vendor/attributes/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/attributes/middlewares.js +56 -0
- package/.medusa/server/src/api/vendor/attributes/query-config.d.ts +20 -0
- package/.medusa/server/src/api/vendor/attributes/query-config.js +40 -0
- package/.medusa/server/src/api/vendor/attributes/route.d.ts +80 -0
- package/.medusa/server/src/api/vendor/attributes/route.js +99 -0
- package/.medusa/server/src/api/vendor/attributes/validators.d.ts +34 -0
- package/.medusa/server/src/api/vendor/attributes/validators.js +16 -0
- package/.medusa/server/src/api/vendor/campaigns/[id]/route.d.ts +116 -0
- package/.medusa/server/src/api/vendor/campaigns/[id]/route.js +161 -0
- package/.medusa/server/src/api/vendor/campaigns/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/campaigns/middlewares.js +63 -0
- package/.medusa/server/src/api/vendor/campaigns/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/campaigns/query-config.js +27 -0
- package/.medusa/server/src/api/vendor/campaigns/route.d.ts +90 -0
- package/.medusa/server/src/api/vendor/campaigns/route.js +138 -0
- package/.medusa/server/src/api/vendor/campaigns/validators.d.ts +206 -0
- package/.medusa/server/src/api/vendor/campaigns/validators.js +63 -0
- package/.medusa/server/src/api/vendor/configuration/route.d.ts +26 -0
- package/.medusa/server/src/api/vendor/configuration/route.js +48 -0
- package/.medusa/server/src/api/vendor/cors.d.ts +2 -0
- package/.medusa/server/src/api/vendor/cors.js +18 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/customers/route.js +62 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/route.d.ts +109 -0
- package/.medusa/server/src/api/vendor/customer-groups/[id]/route.js +159 -0
- package/.medusa/server/src/api/vendor/customer-groups/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/customer-groups/middlewares.js +75 -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 +25 -0
- package/.medusa/server/src/api/vendor/customer-groups/route.d.ts +80 -0
- package/.medusa/server/src/api/vendor/customer-groups/route.js +123 -0
- package/.medusa/server/src/api/vendor/customer-groups/validators.d.ts +65 -0
- package/.medusa/server/src/api/vendor/customer-groups/validators.js +21 -0
- package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/customers/[id]/customer-groups/route.js +65 -0
- package/.medusa/server/src/api/vendor/customers/[id]/orders/route.d.ts +60 -0
- package/.medusa/server/src/api/vendor/customers/[id]/orders/route.js +90 -0
- package/.medusa/server/src/api/vendor/customers/[id]/route.d.ts +31 -0
- package/.medusa/server/src/api/vendor/customers/[id]/route.js +48 -0
- package/.medusa/server/src/api/vendor/customers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/customers/middlewares.js +38 -0
- package/.medusa/server/src/api/vendor/customers/query-config.d.ts +23 -0
- package/.medusa/server/src/api/vendor/customers/query-config.js +70 -0
- package/.medusa/server/src/api/vendor/customers/route.d.ts +51 -0
- package/.medusa/server/src/api/vendor/customers/route.js +69 -0
- package/.medusa/server/src/api/vendor/customers/utils.d.ts +2 -0
- package/.medusa/server/src/api/vendor/customers/utils.js +27 -0
- package/.medusa/server/src/api/vendor/customers/validators.d.ts +68 -0
- package/.medusa/server/src/api/vendor/customers/validators.js +18 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/[id]/options/route.d.ts +38 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/[id]/options/route.js +49 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/query-config.js +15 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/route.js +71 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/validators.d.ts +21 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/validators.js +9 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/route.d.ts +40 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/route.js +63 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/[zone_id]/route.d.ts +88 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/[zone_id]/route.js +132 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/route.js +60 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/helpers.d.ts +5 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/helpers.js +10 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/middlewares.js +71 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/query-config.js +24 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/validators.d.ts +433 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/validators.js +205 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/[location_id]/route.d.ts +65 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/[location_id]/route.js +115 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/batch/route.d.ts +30 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/batch/route.js +70 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/route.js +98 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/route.js +95 -0
- package/.medusa/server/src/api/vendor/inventory-items/location-levels/batch/route.d.ts +23 -0
- package/.medusa/server/src/api/vendor/inventory-items/location-levels/batch/route.js +52 -0
- package/.medusa/server/src/api/vendor/inventory-items/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/inventory-items/middlewares.js +114 -0
- package/.medusa/server/src/api/vendor/inventory-items/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/inventory-items/query-config.js +52 -0
- package/.medusa/server/src/api/vendor/inventory-items/route.d.ts +18 -0
- package/.medusa/server/src/api/vendor/inventory-items/route.js +45 -0
- package/.medusa/server/src/api/vendor/inventory-items/utils.d.ts +15 -0
- package/.medusa/server/src/api/vendor/inventory-items/utils.js +74 -0
- package/.medusa/server/src/api/vendor/inventory-items/validators.d.ts +381 -0
- package/.medusa/server/src/api/vendor/inventory-items/validators.js +86 -0
- package/.medusa/server/src/api/vendor/invites/accept/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/invites/accept/route.js +56 -0
- package/.medusa/server/src/api/vendor/invites/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/invites/middlewares.js +34 -0
- package/.medusa/server/src/api/vendor/invites/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/invites/query-config.js +21 -0
- package/.medusa/server/src/api/vendor/invites/route.d.ts +85 -0
- package/.medusa/server/src/api/vendor/invites/route.js +140 -0
- package/.medusa/server/src/api/vendor/invites/validators.d.ts +74 -0
- package/.medusa/server/src/api/vendor/invites/validators.js +23 -0
- package/.medusa/server/src/api/vendor/me/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/me/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/me/route.d.ts +25 -0
- package/.medusa/server/src/api/vendor/me/route.js +37 -0
- package/.medusa/server/src/api/vendor/members/[id]/route.d.ts +104 -0
- package/.medusa/server/src/api/vendor/members/[id]/route.js +145 -0
- package/.medusa/server/src/api/vendor/members/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/members/middlewares.js +48 -0
- package/.medusa/server/src/api/vendor/members/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/members/query-config.js +24 -0
- package/.medusa/server/src/api/vendor/members/route.d.ts +62 -0
- package/.medusa/server/src/api/vendor/members/route.js +82 -0
- package/.medusa/server/src/api/vendor/members/validators.d.ts +58 -0
- package/.medusa/server/src/api/vendor/members/validators.js +18 -0
- package/.medusa/server/src/api/vendor/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/middlewares.js +115 -0
- package/.medusa/server/src/api/vendor/notifications/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/notifications/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/notifications/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/notifications/query-config.js +23 -0
- package/.medusa/server/src/api/vendor/notifications/route.d.ts +83 -0
- package/.medusa/server/src/api/vendor/notifications/route.js +107 -0
- package/.medusa/server/src/api/vendor/notifications/validators.d.ts +21 -0
- package/.medusa/server/src/api/vendor/notifications/validators.js +10 -0
- package/.medusa/server/src/api/vendor/orders/[id]/cancel/route.d.ts +31 -0
- package/.medusa/server/src/api/vendor/orders/[id]/cancel/route.js +56 -0
- package/.medusa/server/src/api/vendor/orders/[id]/changes/route.d.ts +39 -0
- package/.medusa/server/src/api/vendor/orders/[id]/changes/route.js +54 -0
- package/.medusa/server/src/api/vendor/orders/[id]/complete/route.d.ts +31 -0
- package/.medusa/server/src/api/vendor/orders/[id]/complete/route.js +55 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.js +61 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/mark-as-delivered/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/mark-as-delivered/route.js +57 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/shipments/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/shipments/route.js +67 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/route.js +52 -0
- package/.medusa/server/src/api/vendor/orders/[id]/route.d.ts +31 -0
- package/.medusa/server/src/api/vendor/orders/[id]/route.js +50 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.js +135 -0
- package/.medusa/server/src/api/vendor/orders/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/orders/query-config.js +97 -0
- package/.medusa/server/src/api/vendor/orders/route.d.ts +96 -0
- package/.medusa/server/src/api/vendor/orders/route.js +138 -0
- package/.medusa/server/src/api/vendor/orders/validators.d.ts +250 -0
- package/.medusa/server/src/api/vendor/orders/validators.js +75 -0
- package/.medusa/server/src/api/vendor/payout-account/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payout-account/middlewares.js +35 -0
- package/.medusa/server/src/api/vendor/payout-account/onboarding/route.d.ts +30 -0
- package/.medusa/server/src/api/vendor/payout-account/onboarding/route.js +56 -0
- package/.medusa/server/src/api/vendor/payout-account/query-config.d.ts +7 -0
- package/.medusa/server/src/api/vendor/payout-account/query-config.js +18 -0
- package/.medusa/server/src/api/vendor/payout-account/route.d.ts +59 -0
- package/.medusa/server/src/api/vendor/payout-account/route.js +100 -0
- package/.medusa/server/src/api/vendor/payout-account/sync/route.d.ts +54 -0
- package/.medusa/server/src/api/vendor/payout-account/sync/route.js +77 -0
- package/.medusa/server/src/api/vendor/payout-account/utils.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payout-account/utils.js +19 -0
- package/.medusa/server/src/api/vendor/payout-account/validators.d.ts +43 -0
- package/.medusa/server/src/api/vendor/payout-account/validators.js +35 -0
- package/.medusa/server/src/api/vendor/payouts/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payouts/middlewares.js +18 -0
- package/.medusa/server/src/api/vendor/payouts/query-config.d.ts +7 -0
- package/.medusa/server/src/api/vendor/payouts/query-config.js +11 -0
- package/.medusa/server/src/api/vendor/payouts/route.d.ts +86 -0
- package/.medusa/server/src/api/vendor/payouts/route.js +119 -0
- package/.medusa/server/src/api/vendor/payouts/validators.d.ts +21 -0
- package/.medusa/server/src/api/vendor/payouts/validators.js +9 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/[price_id]/route.d.ts +44 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/[price_id]/route.js +75 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/route.js +69 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/products/route.d.ts +102 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/products/route.js +164 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/route.d.ts +111 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/route.js +154 -0
- package/.medusa/server/src/api/vendor/price-lists/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/price-lists/middlewares.js +109 -0
- package/.medusa/server/src/api/vendor/price-lists/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/price-lists/query-config.js +52 -0
- package/.medusa/server/src/api/vendor/price-lists/route.d.ts +87 -0
- package/.medusa/server/src/api/vendor/price-lists/route.js +124 -0
- package/.medusa/server/src/api/vendor/price-lists/validators.d.ts +412 -0
- package/.medusa/server/src/api/vendor/price-lists/validators.js +85 -0
- package/.medusa/server/src/api/vendor/price-preferences/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/price-preferences/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/price-preferences/query-config.d.ts +9 -0
- package/.medusa/server/src/api/vendor/price-preferences/query-config.js +21 -0
- package/.medusa/server/src/api/vendor/price-preferences/route.d.ts +92 -0
- package/.medusa/server/src/api/vendor/price-preferences/route.js +111 -0
- package/.medusa/server/src/api/vendor/price-preferences/validators.d.ts +52 -0
- package/.medusa/server/src/api/vendor/price-preferences/validators.js +19 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +24 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/route.d.ts +36 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/route.js +51 -0
- package/.medusa/server/src/api/vendor/product-categories/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-categories/middlewares.js +32 -0
- package/.medusa/server/src/api/vendor/product-categories/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/product-categories/query-config.js +47 -0
- package/.medusa/server/src/api/vendor/product-categories/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/product-categories/route.js +72 -0
- package/.medusa/server/src/api/vendor/product-categories/utils.d.ts +5 -0
- package/.medusa/server/src/api/vendor/product-categories/utils.js +30 -0
- package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +57 -0
- package/.medusa/server/src/api/vendor/product-categories/validators.js +11 -0
- package/.medusa/server/src/api/vendor/product-collections/[id]/products/route.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-collections/[id]/products/route.js +24 -0
- package/.medusa/server/src/api/vendor/product-collections/[id]/route.d.ts +36 -0
- package/.medusa/server/src/api/vendor/product-collections/[id]/route.js +51 -0
- package/.medusa/server/src/api/vendor/product-collections/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-collections/middlewares.js +32 -0
- package/.medusa/server/src/api/vendor/product-collections/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/product-collections/query-config.js +42 -0
- package/.medusa/server/src/api/vendor/product-collections/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/product-collections/route.js +72 -0
- package/.medusa/server/src/api/vendor/product-collections/utils.d.ts +5 -0
- package/.medusa/server/src/api/vendor/product-collections/utils.js +29 -0
- package/.medusa/server/src/api/vendor/product-collections/validators.d.ts +42 -0
- package/.medusa/server/src/api/vendor/product-collections/validators.js +13 -0
- package/.medusa/server/src/api/vendor/product-tags/[id]/route.d.ts +36 -0
- package/.medusa/server/src/api/vendor/product-tags/[id]/route.js +51 -0
- package/.medusa/server/src/api/vendor/product-tags/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-tags/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/product-tags/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/product-tags/query-config.js +21 -0
- package/.medusa/server/src/api/vendor/product-tags/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/product-tags/route.js +66 -0
- package/.medusa/server/src/api/vendor/product-tags/validators.d.ts +82 -0
- package/.medusa/server/src/api/vendor/product-tags/validators.js +25 -0
- package/.medusa/server/src/api/vendor/product-types/[id]/route.d.ts +36 -0
- package/.medusa/server/src/api/vendor/product-types/[id]/route.js +51 -0
- package/.medusa/server/src/api/vendor/product-types/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-types/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/product-types/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/product-types/query-config.js +21 -0
- package/.medusa/server/src/api/vendor/product-types/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/product-types/route.js +71 -0
- package/.medusa/server/src/api/vendor/product-types/validators.d.ts +21 -0
- package/.medusa/server/src/api/vendor/product-types/validators.js +9 -0
- package/.medusa/server/src/api/vendor/products/[id]/applicable-attributes/route.d.ts +69 -0
- package/.medusa/server/src/api/vendor/products/[id]/applicable-attributes/route.js +115 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/[option_id]/route.d.ts +92 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/[option_id]/route.js +157 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/route.js +86 -0
- package/.medusa/server/src/api/vendor/products/[id]/route.d.ts +116 -0
- package/.medusa/server/src/api/vendor/products/[id]/route.js +175 -0
- package/.medusa/server/src/api/vendor/products/[id]/status/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/products/[id]/status/route.js +69 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.d.ts +92 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +161 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +89 -0
- package/.medusa/server/src/api/vendor/products/export/route.d.ts +2 -0
- package/.medusa/server/src/api/vendor/products/export/route.js +17 -0
- package/.medusa/server/src/api/vendor/products/import/route.d.ts +2 -0
- package/.medusa/server/src/api/vendor/products/import/route.js +24 -0
- package/.medusa/server/src/api/vendor/products/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/products/middlewares.js +174 -0
- package/.medusa/server/src/api/vendor/products/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/products/query-config.js +50 -0
- package/.medusa/server/src/api/vendor/products/route.d.ts +89 -0
- package/.medusa/server/src/api/vendor/products/route.js +153 -0
- package/.medusa/server/src/api/vendor/products/utils.d.ts +5 -0
- package/.medusa/server/src/api/vendor/products/utils.js +33 -0
- package/.medusa/server/src/api/vendor/products/validators.d.ts +1642 -0
- package/.medusa/server/src/api/vendor/products/validators.js +231 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/[rule_type]/route.d.ts +56 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/[rule_type]/route.js +160 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/buy-rules/batch/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/buy-rules/batch/route.js +66 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/route.d.ts +110 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/route.js +157 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/rules/batch/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/rules/batch/route.js +66 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/target-rules/batch/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/target-rules/batch/route.js +66 -0
- package/.medusa/server/src/api/vendor/promotions/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/promotions/middlewares.js +124 -0
- package/.medusa/server/src/api/vendor/promotions/query-config.d.ts +27 -0
- package/.medusa/server/src/api/vendor/promotions/query-config.js +54 -0
- package/.medusa/server/src/api/vendor/promotions/route.d.ts +83 -0
- package/.medusa/server/src/api/vendor/promotions/route.js +128 -0
- package/.medusa/server/src/api/vendor/promotions/rule-attribute-options/[rule_type]/route.d.ts +64 -0
- package/.medusa/server/src/api/vendor/promotions/rule-attribute-options/[rule_type]/route.js +80 -0
- package/.medusa/server/src/api/vendor/promotions/rule-value-options/[rule_type]/[rule_attribute_id]/route.d.ts +64 -0
- package/.medusa/server/src/api/vendor/promotions/rule-value-options/[rule_type]/[rule_attribute_id]/route.js +133 -0
- package/.medusa/server/src/api/vendor/promotions/utils.d.ts +72 -0
- package/.medusa/server/src/api/vendor/promotions/utils.js +123 -0
- package/.medusa/server/src/api/vendor/promotions/validators.d.ts +625 -0
- package/.medusa/server/src/api/vendor/promotions/validators.js +140 -0
- package/.medusa/server/src/api/vendor/regions/[id]/route.d.ts +36 -0
- package/.medusa/server/src/api/vendor/regions/[id]/route.js +51 -0
- package/.medusa/server/src/api/vendor/regions/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/regions/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/regions/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/regions/query-config.js +25 -0
- package/.medusa/server/src/api/vendor/regions/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/regions/route.js +72 -0
- package/.medusa/server/src/api/vendor/regions/validators.d.ts +21 -0
- package/.medusa/server/src/api/vendor/regions/validators.js +9 -0
- package/.medusa/server/src/api/vendor/reservations/[id]/route.d.ts +116 -0
- package/.medusa/server/src/api/vendor/reservations/[id]/route.js +180 -0
- package/.medusa/server/src/api/vendor/reservations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/reservations/middlewares.js +121 -0
- package/.medusa/server/src/api/vendor/reservations/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/reservations/query-config.js +26 -0
- package/.medusa/server/src/api/vendor/reservations/route.d.ts +90 -0
- package/.medusa/server/src/api/vendor/reservations/route.js +135 -0
- package/.medusa/server/src/api/vendor/reservations/validators.d.ts +89 -0
- package/.medusa/server/src/api/vendor/reservations/validators.js +26 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/[action_id]/route.d.ts +91 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/[action_id]/route.js +138 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/route.js +65 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/confirm/route.d.ts +39 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/confirm/route.js +65 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/route.d.ts +45 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/route.js +70 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/[action_id]/route.d.ts +91 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/[action_id]/route.js +138 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/route.d.ts +43 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/route.js +65 -0
- package/.medusa/server/src/api/vendor/returns/[id]/route.d.ts +37 -0
- package/.medusa/server/src/api/vendor/returns/[id]/route.js +54 -0
- package/.medusa/server/src/api/vendor/returns/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/returns/middlewares.js +126 -0
- package/.medusa/server/src/api/vendor/returns/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/returns/query-config.js +35 -0
- package/.medusa/server/src/api/vendor/returns/route.d.ts +54 -0
- package/.medusa/server/src/api/vendor/returns/route.js +82 -0
- package/.medusa/server/src/api/vendor/returns/validators.d.ts +152 -0
- package/.medusa/server/src/api/vendor/returns/validators.js +30 -0
- package/.medusa/server/src/api/vendor/sales-channels/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/sales-channels/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/sales-channels/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/sales-channels/query-config.js +24 -0
- package/.medusa/server/src/api/vendor/sales-channels/route.d.ts +35 -0
- package/.medusa/server/src/api/vendor/sales-channels/route.js +54 -0
- package/.medusa/server/src/api/vendor/sales-channels/validators.d.ts +9 -0
- package/.medusa/server/src/api/vendor/sales-channels/validators.js +6 -0
- package/.medusa/server/src/api/vendor/sellers/me/onboarding/route.d.ts +47 -0
- package/.medusa/server/src/api/vendor/sellers/me/onboarding/route.js +81 -0
- package/.medusa/server/src/api/vendor/sellers/me/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/sellers/me/route.js +78 -0
- package/.medusa/server/src/api/vendor/sellers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/sellers/middlewares.js +39 -0
- package/.medusa/server/src/api/vendor/sellers/query-config.d.ts +18 -0
- package/.medusa/server/src/api/vendor/sellers/query-config.js +43 -0
- package/.medusa/server/src/api/vendor/sellers/route.d.ts +30 -0
- package/.medusa/server/src/api/vendor/sellers/route.js +74 -0
- package/.medusa/server/src/api/vendor/sellers/validators.d.ts +251 -0
- package/.medusa/server/src/api/vendor/sellers/validators.js +47 -0
- package/.medusa/server/src/api/vendor/shipping-options/[id]/route.d.ts +106 -0
- package/.medusa/server/src/api/vendor/shipping-options/[id]/route.js +151 -0
- package/.medusa/server/src/api/vendor/shipping-options/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/shipping-options/middlewares.js +69 -0
- package/.medusa/server/src/api/vendor/shipping-options/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/shipping-options/query-config.js +29 -0
- package/.medusa/server/src/api/vendor/shipping-options/route.d.ts +64 -0
- package/.medusa/server/src/api/vendor/shipping-options/route.js +128 -0
- package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +301 -0
- package/.medusa/server/src/api/vendor/shipping-options/validators.js +127 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/[id]/route.d.ts +114 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/[id]/route.js +157 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/middlewares.js +63 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/query-config.js +22 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/route.d.ts +67 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/route.js +129 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +82 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/validators.js +24 -0
- package/.medusa/server/src/api/vendor/statistics/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/statistics/middlewares.js +13 -0
- package/.medusa/server/src/api/vendor/statistics/route.d.ts +39 -0
- package/.medusa/server/src/api/vendor/statistics/route.js +56 -0
- package/.medusa/server/src/api/vendor/statistics/validators.d.ts +24 -0
- package/.medusa/server/src/api/vendor/statistics/validators.js +17 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-providers/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-providers/route.js +84 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-sets/route.d.ts +42 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-sets/route.js +75 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/route.d.ts +115 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/route.js +175 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/sales-channels/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/sales-channels/route.js +78 -0
- package/.medusa/server/src/api/vendor/stock-locations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/stock-locations/middlewares.js +92 -0
- package/.medusa/server/src/api/vendor/stock-locations/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/stock-locations/query-config.js +30 -0
- package/.medusa/server/src/api/vendor/stock-locations/route.d.ts +67 -0
- package/.medusa/server/src/api/vendor/stock-locations/route.js +129 -0
- package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +297 -0
- package/.medusa/server/src/api/vendor/stock-locations/validators.js +136 -0
- package/.medusa/server/src/api/vendor/stores/[id]/route.d.ts +36 -0
- package/.medusa/server/src/api/vendor/stores/[id]/route.js +53 -0
- package/.medusa/server/src/api/vendor/stores/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/stores/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/stores/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/stores/query-config.js +27 -0
- package/.medusa/server/src/api/vendor/stores/route.d.ts +53 -0
- package/.medusa/server/src/api/vendor/stores/route.js +72 -0
- package/.medusa/server/src/api/vendor/stores/validators.d.ts +9 -0
- package/.medusa/server/src/api/vendor/stores/validators.js +6 -0
- package/.medusa/server/src/api/vendor/talkjs/route.d.ts +2 -0
- package/.medusa/server/src/api/vendor/talkjs/route.js +28 -0
- package/.medusa/server/src/api/vendor/uploads/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/uploads/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/uploads/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/uploads/route.js +24 -0
- package/.medusa/server/src/jobs/daily-payouts-summary.d.ts +6 -0
- package/.medusa/server/src/jobs/daily-payouts-summary.js +56 -0
- package/.medusa/server/src/jobs/daily-payouts.d.ts +6 -0
- package/.medusa/server/src/jobs/daily-payouts.js +51 -0
- package/.medusa/server/src/links/category-attribute.d.ts +2 -0
- package/.medusa/server/src/links/category-attribute.js +16 -0
- package/.medusa/server/src/links/category-taxcode.d.ts +2 -0
- package/.medusa/server/src/links/category-taxcode.js +13 -0
- package/.medusa/server/src/links/customer-wishlist.d.ts +2 -0
- package/.medusa/server/src/links/customer-wishlist.js +14 -0
- package/.medusa/server/src/links/order-payout.d.ts +2 -0
- package/.medusa/server/src/links/order-payout.js +13 -0
- package/.medusa/server/src/links/order-set-order.d.ts +2 -0
- package/.medusa/server/src/links/order-set-order.js +13 -0
- package/.medusa/server/src/links/order-set-readonly-links.d.ts +1 -0
- package/.medusa/server/src/links/order-set-readonly-links.js +52 -0
- package/.medusa/server/src/links/order-split-order-payment.d.ts +2 -0
- package/.medusa/server/src/links/order-split-order-payment.js +10 -0
- package/.medusa/server/src/links/product-attribute-value.d.ts +2 -0
- package/.medusa/server/src/links/product-attribute-value.js +16 -0
- package/.medusa/server/src/links/seller-campaign.d.ts +2 -0
- package/.medusa/server/src/links/seller-campaign.js +13 -0
- package/.medusa/server/src/links/seller-customer-group.d.ts +2 -0
- package/.medusa/server/src/links/seller-customer-group.js +13 -0
- package/.medusa/server/src/links/seller-fulfillment-set.d.ts +2 -0
- package/.medusa/server/src/links/seller-fulfillment-set.js +13 -0
- package/.medusa/server/src/links/seller-inventory-item.d.ts +2 -0
- package/.medusa/server/src/links/seller-inventory-item.js +13 -0
- package/.medusa/server/src/links/seller-order.d.ts +2 -0
- package/.medusa/server/src/links/seller-order.js +13 -0
- package/.medusa/server/src/links/seller-payout-account.d.ts +2 -0
- package/.medusa/server/src/links/seller-payout-account.js +10 -0
- package/.medusa/server/src/links/seller-price-list.d.ts +2 -0
- package/.medusa/server/src/links/seller-price-list.js +13 -0
- package/.medusa/server/src/links/seller-product.d.ts +2 -0
- package/.medusa/server/src/links/seller-product.js +13 -0
- package/.medusa/server/src/links/seller-promotion.d.ts +2 -0
- package/.medusa/server/src/links/seller-promotion.js +13 -0
- package/.medusa/server/src/links/seller-return.d.ts +2 -0
- package/.medusa/server/src/links/seller-return.js +13 -0
- package/.medusa/server/src/links/seller-service-zone.d.ts +2 -0
- package/.medusa/server/src/links/seller-service-zone.js +13 -0
- package/.medusa/server/src/links/seller-shipping-option.d.ts +2 -0
- package/.medusa/server/src/links/seller-shipping-option.js +13 -0
- package/.medusa/server/src/links/seller-shipping-profile.d.ts +2 -0
- package/.medusa/server/src/links/seller-shipping-profile.js +13 -0
- package/.medusa/server/src/links/seller-stock-location.d.ts +2 -0
- package/.medusa/server/src/links/seller-stock-location.js +13 -0
- package/.medusa/server/src/links/wishlist-product.d.ts +2 -0
- package/.medusa/server/src/links/wishlist-product.js +14 -0
- package/.medusa/server/src/modules/attribute/index.d.ts +50 -0
- package/.medusa/server/src/modules/attribute/index.js +14 -0
- package/.medusa/server/src/modules/attribute/migrations/Migration20250617080244.d.ts +5 -0
- package/.medusa/server/src/modules/attribute/migrations/Migration20250617080244.js +30 -0
- package/.medusa/server/src/modules/attribute/migrations/Migration20250620110849.d.ts +5 -0
- package/.medusa/server/src/modules/attribute/migrations/Migration20250620110849.js +14 -0
- package/.medusa/server/src/modules/attribute/migrations/Migration20250828065431.d.ts +5 -0
- package/.medusa/server/src/modules/attribute/migrations/Migration20250828065431.js +14 -0
- package/.medusa/server/src/modules/attribute/models/attribute-possible-value.d.ts +25 -0
- package/.medusa/server/src/modules/attribute/models/attribute-possible-value.js +26 -0
- package/.medusa/server/src/modules/attribute/models/attribute-value.d.ts +25 -0
- package/.medusa/server/src/modules/attribute/models/attribute-value.js +18 -0
- package/.medusa/server/src/modules/attribute/models/attribute.d.ts +26 -0
- package/.medusa/server/src/modules/attribute/models/attribute.js +29 -0
- package/.medusa/server/src/modules/attribute/service.d.ts +111 -0
- package/.medusa/server/src/modules/attribute/service.js +77 -0
- package/.medusa/server/src/modules/configuration/index.d.ts +23 -0
- package/.medusa/server/src/modules/configuration/index.js +16 -0
- package/.medusa/server/src/modules/configuration/migrations/Migration20250114063624.d.ts +5 -0
- package/.medusa/server/src/modules/configuration/migrations/Migration20250114063624.js +16 -0
- package/.medusa/server/src/modules/configuration/migrations/Migration20250324131111.d.ts +5 -0
- package/.medusa/server/src/modules/configuration/migrations/Migration20250324131111.js +16 -0
- package/.medusa/server/src/modules/configuration/models/configuration-rule.d.ts +5 -0
- package/.medusa/server/src/modules/configuration/models/configuration-rule.js +17 -0
- package/.medusa/server/src/modules/configuration/models/index.d.ts +1 -0
- package/.medusa/server/src/modules/configuration/models/index.js +18 -0
- package/.medusa/server/src/modules/configuration/service.d.ts +12 -0
- package/.medusa/server/src/modules/configuration/service.js +17 -0
- package/.medusa/server/src/modules/marketplace/index.d.ts +22 -0
- package/.medusa/server/src/modules/marketplace/index.js +14 -0
- package/.medusa/server/src/modules/marketplace/migrations/Migration20241207151814.d.ts +5 -0
- package/.medusa/server/src/modules/marketplace/migrations/Migration20241207151814.js +15 -0
- package/.medusa/server/src/modules/marketplace/models/index.d.ts +1 -0
- package/.medusa/server/src/modules/marketplace/models/index.js +18 -0
- package/.medusa/server/src/modules/marketplace/models/order-set.d.ts +8 -0
- package/.medusa/server/src/modules/marketplace/models/order-set.js +13 -0
- package/.medusa/server/src/modules/marketplace/service.d.ts +13 -0
- package/.medusa/server/src/modules/marketplace/service.js +10 -0
- package/.medusa/server/src/modules/payout/index.d.ts +64 -0
- package/.medusa/server/src/modules/payout/index.js +14 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20250317090626.d.ts +5 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20250317090626.js +28 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20250612144913.d.ts +5 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20250612144913.js +18 -0
- package/.medusa/server/src/modules/payout/models/index.d.ts +4 -0
- package/.medusa/server/src/modules/payout/models/index.js +21 -0
- package/.medusa/server/src/modules/payout/models/onboarding.d.ts +27 -0
- package/.medusa/server/src/modules/payout/models/onboarding.js +14 -0
- package/.medusa/server/src/modules/payout/models/payout-account.d.ts +33 -0
- package/.medusa/server/src/modules/payout/models/payout-account.js +17 -0
- package/.medusa/server/src/modules/payout/models/payout-reversal.d.ts +32 -0
- package/.medusa/server/src/modules/payout/models/payout-reversal.js +15 -0
- package/.medusa/server/src/modules/payout/models/payout.d.ts +32 -0
- package/.medusa/server/src/modules/payout/models/payout.js +17 -0
- package/.medusa/server/src/modules/payout/service.d.ts +443 -0
- package/.medusa/server/src/modules/payout/service.js +164 -0
- package/.medusa/server/src/modules/payout/services/index.d.ts +1 -0
- package/.medusa/server/src/modules/payout/services/index.js +18 -0
- package/.medusa/server/src/modules/payout/services/provider.d.ts +29 -0
- package/.medusa/server/src/modules/payout/services/provider.js +137 -0
- package/.medusa/server/src/modules/seller/index.d.ts +65 -0
- package/.medusa/server/src/modules/seller/index.js +27 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20241206125415.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20241206125415.js +28 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250212131627.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250212131627.js +20 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250225083755.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250225083755.js +26 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250225094708.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250225094708.js +18 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250307091819.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250307091819.js +16 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250313065552.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250313065552.js +19 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250530111528.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20250530111528.js +14 -0
- package/.medusa/server/src/modules/seller/models/index.d.ts +4 -0
- package/.medusa/server/src/modules/seller/models/index.js +21 -0
- package/.medusa/server/src/modules/seller/models/invite.d.ts +51 -0
- package/.medusa/server/src/modules/seller/models/invite.js +16 -0
- package/.medusa/server/src/modules/seller/models/member.d.ts +51 -0
- package/.medusa/server/src/modules/seller/models/member.js +17 -0
- package/.medusa/server/src/modules/seller/models/onboarding.d.ts +43 -0
- package/.medusa/server/src/modules/seller/models/onboarding.js +14 -0
- package/.medusa/server/src/modules/seller/models/seller.d.ts +51 -0
- package/.medusa/server/src/modules/seller/models/seller.js +28 -0
- package/.medusa/server/src/modules/seller/service.d.ts +268 -0
- package/.medusa/server/src/modules/seller/service.js +110 -0
- package/.medusa/server/src/modules/seller/utils.d.ts +23 -0
- package/.medusa/server/src/modules/seller/utils.js +78 -0
- package/.medusa/server/src/modules/split-order-payment/index.d.ts +22 -0
- package/.medusa/server/src/modules/split-order-payment/index.js +14 -0
- package/.medusa/server/src/modules/split-order-payment/migrations/Migration20250516075429.d.ts +5 -0
- package/.medusa/server/src/modules/split-order-payment/migrations/Migration20250516075429.js +15 -0
- package/.medusa/server/src/modules/split-order-payment/models/split-order-payment.d.ts +9 -0
- package/.medusa/server/src/modules/split-order-payment/models/split-order-payment.js +14 -0
- package/.medusa/server/src/modules/split-order-payment/service.d.ts +14 -0
- package/.medusa/server/src/modules/split-order-payment/service.js +10 -0
- package/.medusa/server/src/modules/taxcode/index.d.ts +22 -0
- package/.medusa/server/src/modules/taxcode/index.js +14 -0
- package/.medusa/server/src/modules/taxcode/migrations/Migration20250116135408.d.ts +5 -0
- package/.medusa/server/src/modules/taxcode/migrations/Migration20250116135408.js +16 -0
- package/.medusa/server/src/modules/taxcode/models/taxcode.d.ts +7 -0
- package/.medusa/server/src/modules/taxcode/models/taxcode.js +11 -0
- package/.medusa/server/src/modules/taxcode/service.d.ts +18 -0
- package/.medusa/server/src/modules/taxcode/service.js +30 -0
- package/.medusa/server/src/modules/wishlist/index.d.ts +23 -0
- package/.medusa/server/src/modules/wishlist/index.js +29 -0
- package/.medusa/server/src/modules/wishlist/migrations/Migration20250424110903.d.ts +5 -0
- package/.medusa/server/src/modules/wishlist/migrations/Migration20250424110903.js +15 -0
- package/.medusa/server/src/modules/wishlist/models/wishlist.d.ts +4 -0
- package/.medusa/server/src/modules/wishlist/models/wishlist.js +9 -0
- package/.medusa/server/src/modules/wishlist/service.d.ts +9 -0
- package/.medusa/server/src/modules/wishlist/service.js +10 -0
- package/.medusa/server/src/modules/wishlist/utils.d.ts +42 -0
- package/.medusa/server/src/modules/wishlist/utils.js +48 -0
- package/.medusa/server/src/shared/infra/http/middlewares/apply-reference-filter.d.ts +6 -0
- package/.medusa/server/src/shared/infra/http/middlewares/apply-reference-filter.js +15 -0
- package/.medusa/server/src/shared/infra/http/middlewares/apply-request-status-filter.d.ts +6 -0
- package/.medusa/server/src/shared/infra/http/middlewares/apply-request-status-filter.js +15 -0
- package/.medusa/server/src/shared/infra/http/middlewares/apply-request-type-filter.d.ts +6 -0
- package/.medusa/server/src/shared/infra/http/middlewares/apply-request-type-filter.js +15 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-configuration-rule.d.ts +5 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-configuration-rule.js +23 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-customer-ownership.d.ts +9 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-customer-ownership.js +34 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-ownership.d.ts +34 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-ownership.js +66 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-seller-approved.d.ts +3 -0
- package/.medusa/server/src/shared/infra/http/middlewares/check-seller-approved.js +23 -0
- package/.medusa/server/src/shared/infra/http/middlewares/filter-by-seller-id.d.ts +6 -0
- package/.medusa/server/src/shared/infra/http/middlewares/filter-by-seller-id.js +15 -0
- package/.medusa/server/src/shared/infra/http/middlewares/index.d.ts +9 -0
- package/.medusa/server/src/shared/infra/http/middlewares/index.js +26 -0
- package/.medusa/server/src/shared/infra/http/middlewares/store-active-guard.d.ts +9 -0
- package/.medusa/server/src/shared/infra/http/middlewares/store-active-guard.js +24 -0
- package/.medusa/server/src/shared/infra/http/utils/admin.d.ts +2 -0
- package/.medusa/server/src/shared/infra/http/utils/admin.js +14 -0
- package/.medusa/server/src/shared/infra/http/utils/hosts.d.ts +23 -0
- package/.medusa/server/src/shared/infra/http/utils/hosts.js +43 -0
- package/.medusa/server/src/shared/infra/http/utils/index.d.ts +5 -0
- package/.medusa/server/src/shared/infra/http/utils/index.js +22 -0
- package/.medusa/server/src/shared/infra/http/utils/products.d.ts +5 -0
- package/.medusa/server/src/shared/infra/http/utils/products.js +52 -0
- package/.medusa/server/src/shared/infra/http/utils/seller.d.ts +3 -0
- package/.medusa/server/src/shared/infra/http/utils/seller.js +19 -0
- package/.medusa/server/src/shared/infra/http/utils/unless-base-url.d.ts +10 -0
- package/.medusa/server/src/shared/infra/http/utils/unless-base-url.js +20 -0
- package/.medusa/server/src/shared/infra/http/utils/zod.d.ts +8 -0
- package/.medusa/server/src/shared/infra/http/utils/zod.js +8 -0
- package/.medusa/server/src/shared/utils/index.d.ts +1 -0
- package/.medusa/server/src/shared/utils/index.js +18 -0
- package/.medusa/server/src/shared/utils/money.d.ts +16 -0
- package/.medusa/server/src/shared/utils/money.js +68 -0
- package/.medusa/server/src/subscribers/algolia-fulfillment-set-changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/algolia-fulfillment-set-changed.js +45 -0
- package/.medusa/server/src/subscribers/algolia-inventory-item.changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/algolia-inventory-item.changed.js +31 -0
- package/.medusa/server/src/subscribers/algolia-service-zone-changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/algolia-service-zone-changed.js +45 -0
- package/.medusa/server/src/subscribers/algolia-shipping-option-changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/algolia-shipping-option-changed.js +45 -0
- package/.medusa/server/src/subscribers/algolia-stock-location-changed.d.ts +5 -0
- package/.medusa/server/src/subscribers/algolia-stock-location-changed.js +45 -0
- package/.medusa/server/src/subscribers/notification-admin-new-order-set.d.ts +5 -0
- package/.medusa/server/src/subscribers/notification-admin-new-order-set.js +41 -0
- package/.medusa/server/src/subscribers/notification-seller-new-order.d.ts +5 -0
- package/.medusa/server/src/subscribers/notification-seller-new-order.js +53 -0
- package/.medusa/server/src/subscribers/order-set-placed-payment-capture.d.ts +6 -0
- package/.medusa/server/src/subscribers/order-set-placed-payment-capture.js +49 -0
- package/.medusa/server/src/subscribers/payout-order.d.ts +5 -0
- package/.medusa/server/src/subscribers/payout-order.js +23 -0
- package/.medusa/server/src/subscribers/payout-webhook.d.ts +4 -0
- package/.medusa/server/src/subscribers/payout-webhook.js +31 -0
- package/.medusa/server/src/subscribers/seller-creation-request-accepted.d.ts +4 -0
- package/.medusa/server/src/subscribers/seller-creation-request-accepted.js +27 -0
- package/.medusa/server/src/subscribers/seller-status-changed.d.ts +7 -0
- package/.medusa/server/src/subscribers/seller-status-changed.js +38 -0
- package/.medusa/server/src/subscribers/split-payment-payment-captured.d.ts +5 -0
- package/.medusa/server/src/subscribers/split-payment-payment-captured.js +24 -0
- package/.medusa/server/src/workflows/attribute/index.d.ts +2 -0
- package/.medusa/server/src/workflows/attribute/index.js +19 -0
- package/.medusa/server/src/workflows/attribute/steps/create-attribute-possible-values.d.ts +38 -0
- package/.medusa/server/src/workflows/attribute/steps/create-attribute-possible-values.js +18 -0
- package/.medusa/server/src/workflows/attribute/steps/create-attribute-value.d.ts +37 -0
- package/.medusa/server/src/workflows/attribute/steps/create-attribute-value.js +21 -0
- package/.medusa/server/src/workflows/attribute/steps/create-attributes.d.ts +5 -0
- package/.medusa/server/src/workflows/attribute/steps/create-attributes.js +32 -0
- package/.medusa/server/src/workflows/attribute/steps/delete-attribute-value.d.ts +2 -0
- package/.medusa/server/src/workflows/attribute/steps/delete-attribute-value.js +18 -0
- package/.medusa/server/src/workflows/attribute/steps/delete-attribute.d.ts +6 -0
- package/.medusa/server/src/workflows/attribute/steps/delete-attribute.js +31 -0
- package/.medusa/server/src/workflows/attribute/steps/index.d.ts +8 -0
- package/.medusa/server/src/workflows/attribute/steps/index.js +25 -0
- package/.medusa/server/src/workflows/attribute/steps/update-attribute-possible-value.d.ts +37 -0
- package/.medusa/server/src/workflows/attribute/steps/update-attribute-possible-value.js +18 -0
- package/.medusa/server/src/workflows/attribute/steps/update-attributes.d.ts +20 -0
- package/.medusa/server/src/workflows/attribute/steps/update-attributes.js +37 -0
- package/.medusa/server/src/workflows/attribute/steps/validate-attribute-value.d.ts +3 -0
- package/.medusa/server/src/workflows/attribute/steps/validate-attribute-value.js +53 -0
- package/.medusa/server/src/workflows/attribute/utils/index.d.ts +3 -0
- package/.medusa/server/src/workflows/attribute/utils/index.js +20 -0
- package/.medusa/server/src/workflows/attribute/utils/products-created-handler.d.ts +6 -0
- package/.medusa/server/src/workflows/attribute/utils/products-created-handler.js +35 -0
- package/.medusa/server/src/workflows/attribute/utils/products-updated-handler.d.ts +7 -0
- package/.medusa/server/src/workflows/attribute/utils/products-updated-handler.js +64 -0
- package/.medusa/server/src/workflows/attribute/utils/validate-attribute-values-to-link.d.ts +7 -0
- package/.medusa/server/src/workflows/attribute/utils/validate-attribute-values-to-link.js +43 -0
- package/.medusa/server/src/workflows/attribute/workflows/create-attribute-possible-values.d.ts +37 -0
- package/.medusa/server/src/workflows/attribute/workflows/create-attribute-possible-values.js +11 -0
- package/.medusa/server/src/workflows/attribute/workflows/create-attribute-value.d.ts +37 -0
- package/.medusa/server/src/workflows/attribute/workflows/create-attribute-value.js +32 -0
- package/.medusa/server/src/workflows/attribute/workflows/create-attributes.d.ts +7 -0
- package/.medusa/server/src/workflows/attribute/workflows/create-attributes.js +40 -0
- package/.medusa/server/src/workflows/attribute/workflows/delete-attribute-value.d.ts +3 -0
- package/.medusa/server/src/workflows/attribute/workflows/delete-attribute-value.js +38 -0
- package/.medusa/server/src/workflows/attribute/workflows/delete-attribute.d.ts +6 -0
- package/.medusa/server/src/workflows/attribute/workflows/delete-attribute.js +10 -0
- package/.medusa/server/src/workflows/attribute/workflows/index.d.ts +7 -0
- package/.medusa/server/src/workflows/attribute/workflows/index.js +24 -0
- package/.medusa/server/src/workflows/attribute/workflows/update-attribute-possible-value.d.ts +37 -0
- package/.medusa/server/src/workflows/attribute/workflows/update-attribute-possible-value.js +11 -0
- package/.medusa/server/src/workflows/attribute/workflows/update-attributes.d.ts +23 -0
- package/.medusa/server/src/workflows/attribute/workflows/update-attributes.js +68 -0
- package/.medusa/server/src/workflows/campaigns/index.d.ts +1 -0
- package/.medusa/server/src/workflows/campaigns/index.js +18 -0
- package/.medusa/server/src/workflows/campaigns/workflows/create-vendor-campaign.d.ts +5 -0
- package/.medusa/server/src/workflows/campaigns/workflows/create-vendor-campaign.js +27 -0
- package/.medusa/server/src/workflows/campaigns/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/campaigns/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/cart/index.d.ts +2 -0
- package/.medusa/server/src/workflows/cart/index.js +19 -0
- package/.medusa/server/src/workflows/cart/steps/create-order-set.d.ts +13 -0
- package/.medusa/server/src/workflows/cart/steps/create-order-set.js +14 -0
- package/.medusa/server/src/workflows/cart/steps/filter-seller-shipping-options.d.ts +26 -0
- package/.medusa/server/src/workflows/cart/steps/filter-seller-shipping-options.js +56 -0
- package/.medusa/server/src/workflows/cart/steps/index.d.ts +4 -0
- package/.medusa/server/src/workflows/cart/steps/index.js +21 -0
- package/.medusa/server/src/workflows/cart/steps/validate-cart-sellers.d.ts +6 -0
- package/.medusa/server/src/workflows/cart/steps/validate-cart-sellers.js +29 -0
- package/.medusa/server/src/workflows/cart/steps/validate-cart-shipping-options.d.ts +9 -0
- package/.medusa/server/src/workflows/cart/steps/validate-cart-shipping-options.js +48 -0
- package/.medusa/server/src/workflows/cart/utils/complete-cart-fields.d.ts +1 -0
- package/.medusa/server/src/workflows/cart/utils/complete-cart-fields.js +76 -0
- package/.medusa/server/src/workflows/cart/utils/index.d.ts +3 -0
- package/.medusa/server/src/workflows/cart/utils/index.js +20 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-confirm-inventory-input.d.ts +15 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-confirm-inventory-input.js +92 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.d.ts +40 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.js +82 -0
- package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.d.ts +9 -0
- package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.js +78 -0
- package/.medusa/server/src/workflows/cart/workflows/delete-seller-line-item.d.ts +6 -0
- package/.medusa/server/src/workflows/cart/workflows/delete-seller-line-item.js +50 -0
- package/.medusa/server/src/workflows/cart/workflows/index.d.ts +6 -0
- package/.medusa/server/src/workflows/cart/workflows/index.js +23 -0
- package/.medusa/server/src/workflows/cart/workflows/list-seller-return-shipping-options-for-order.d.ts +3 -0
- package/.medusa/server/src/workflows/cart/workflows/list-seller-return-shipping-options-for-order.js +27 -0
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.d.ts +25 -0
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.js +17 -0
- package/.medusa/server/src/workflows/cart/workflows/remove-cart-shipping-method.d.ts +5 -0
- package/.medusa/server/src/workflows/cart/workflows/remove-cart-shipping-method.js +9 -0
- package/.medusa/server/src/workflows/cart/workflows/split-and-complete-cart.d.ts +9 -0
- package/.medusa/server/src/workflows/cart/workflows/split-and-complete-cart.js +246 -0
- package/.medusa/server/src/workflows/common/index.d.ts +1 -0
- package/.medusa/server/src/workflows/common/index.js +18 -0
- package/.medusa/server/src/workflows/common/steps/emit-multiple-events-step.d.ts +6 -0
- package/.medusa/server/src/workflows/common/steps/emit-multiple-events-step.js +12 -0
- package/.medusa/server/src/workflows/common/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/common/steps/index.js +18 -0
- package/.medusa/server/src/workflows/configuration/index.d.ts +2 -0
- package/.medusa/server/src/workflows/configuration/index.js +19 -0
- package/.medusa/server/src/workflows/configuration/steps/create-configuration-rule.d.ts +9 -0
- package/.medusa/server/src/workflows/configuration/steps/create-configuration-rule.js +14 -0
- package/.medusa/server/src/workflows/configuration/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/configuration/steps/index.js +19 -0
- package/.medusa/server/src/workflows/configuration/steps/update-configuration-rule.d.ts +9 -0
- package/.medusa/server/src/workflows/configuration/steps/update-configuration-rule.js +11 -0
- package/.medusa/server/src/workflows/configuration/workflows/create-configuration-rule.d.ts +9 -0
- package/.medusa/server/src/workflows/configuration/workflows/create-configuration-rule.js +9 -0
- package/.medusa/server/src/workflows/configuration/workflows/index.d.ts +2 -0
- package/.medusa/server/src/workflows/configuration/workflows/index.js +19 -0
- package/.medusa/server/src/workflows/configuration/workflows/update-configuration-rule.d.ts +9 -0
- package/.medusa/server/src/workflows/configuration/workflows/update-configuration-rule.js +9 -0
- package/.medusa/server/src/workflows/customer-groups/index.d.ts +1 -0
- package/.medusa/server/src/workflows/customer-groups/index.js +18 -0
- package/.medusa/server/src/workflows/customer-groups/workflows/create-seller-customer-group.d.ts +7 -0
- package/.medusa/server/src/workflows/customer-groups/workflows/create-seller-customer-group.js +29 -0
- package/.medusa/server/src/workflows/customer-groups/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/customer-groups/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/fulfillment-set/create-location-fulfillment-set-and-associate-with-seller.d.ts +10 -0
- package/.medusa/server/src/workflows/fulfillment-set/create-location-fulfillment-set-and-associate-with-seller.js +36 -0
- package/.medusa/server/src/workflows/fulfillment-set/create-vendor-service-zone.d.ts +7 -0
- package/.medusa/server/src/workflows/fulfillment-set/create-vendor-service-zone.js +30 -0
- package/.medusa/server/src/workflows/fulfillment-set/delete-vendor-service-zone.d.ts +6 -0
- package/.medusa/server/src/workflows/fulfillment-set/delete-vendor-service-zone.js +34 -0
- package/.medusa/server/src/workflows/fulfillment-set/index.d.ts +3 -0
- package/.medusa/server/src/workflows/fulfillment-set/index.js +20 -0
- package/.medusa/server/src/workflows/hooks/order-shipment-created.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/order-shipment-created.js +31 -0
- package/.medusa/server/src/workflows/hooks/product-collections-updated.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-collections-updated.js +19 -0
- package/.medusa/server/src/workflows/hooks/product-created.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-created.js +111 -0
- package/.medusa/server/src/workflows/hooks/product-deleted.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-deleted.js +12 -0
- package/.medusa/server/src/workflows/hooks/product-options-updated.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-options-updated.js +16 -0
- package/.medusa/server/src/workflows/hooks/product-tags-updated.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-tags-updated.js +19 -0
- package/.medusa/server/src/workflows/hooks/product-updated.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-updated.js +18 -0
- package/.medusa/server/src/workflows/hooks/product-variant-created.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-variant-created.js +42 -0
- package/.medusa/server/src/workflows/hooks/product-variants-updated.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-variants-updated.js +16 -0
- package/.medusa/server/src/workflows/index.d.ts +14 -0
- package/.medusa/server/src/workflows/index.js +31 -0
- package/.medusa/server/src/workflows/order/index.d.ts +2 -0
- package/.medusa/server/src/workflows/order/index.js +19 -0
- package/.medusa/server/src/workflows/order/steps/calculate-payout-for-order.d.ts +3 -0
- package/.medusa/server/src/workflows/order/steps/calculate-payout-for-order.js +34 -0
- package/.medusa/server/src/workflows/order/steps/calculate-total-commission.d.ts +6 -0
- package/.medusa/server/src/workflows/order/steps/calculate-total-commission.js +28 -0
- package/.medusa/server/src/workflows/order/steps/create-payout.d.ts +5 -0
- package/.medusa/server/src/workflows/order/steps/create-payout.js +21 -0
- package/.medusa/server/src/workflows/order/steps/index.d.ts +4 -0
- package/.medusa/server/src/workflows/order/steps/index.js +21 -0
- package/.medusa/server/src/workflows/order/steps/validate-no-existing-payout-for-order.d.ts +1 -0
- package/.medusa/server/src/workflows/order/steps/validate-no-existing-payout-for-order.js +23 -0
- package/.medusa/server/src/workflows/order/steps/validate-seller-payout-account.d.ts +2 -0
- package/.medusa/server/src/workflows/order/steps/validate-seller-payout-account.js +15 -0
- package/.medusa/server/src/workflows/order/utils/aggregate-status.d.ts +2 -0
- package/.medusa/server/src/workflows/order/utils/aggregate-status.js +69 -0
- package/.medusa/server/src/workflows/order/workflows/cancel-order.d.ts +4 -0
- package/.medusa/server/src/workflows/order/workflows/cancel-order.js +56 -0
- package/.medusa/server/src/workflows/order/workflows/get-vendor-order-list.d.ts +3 -0
- package/.medusa/server/src/workflows/order/workflows/get-vendor-order-list.js +41 -0
- package/.medusa/server/src/workflows/order/workflows/index.d.ts +3 -0
- package/.medusa/server/src/workflows/order/workflows/index.js +20 -0
- package/.medusa/server/src/workflows/order/workflows/process-payout-for-order.d.ts +5 -0
- package/.medusa/server/src/workflows/order/workflows/process-payout-for-order.js +82 -0
- package/.medusa/server/src/workflows/order-set/index.d.ts +1 -0
- package/.medusa/server/src/workflows/order-set/index.js +18 -0
- package/.medusa/server/src/workflows/order-set/utils/format-order-sets.d.ts +4 -0
- package/.medusa/server/src/workflows/order-set/utils/format-order-sets.js +75 -0
- package/.medusa/server/src/workflows/order-set/utils/index.d.ts +1 -0
- package/.medusa/server/src/workflows/order-set/utils/index.js +18 -0
- package/.medusa/server/src/workflows/order-set/workflows/get-formatted-order-set-list.d.ts +12 -0
- package/.medusa/server/src/workflows/order-set/workflows/get-formatted-order-set-list.js +62 -0
- package/.medusa/server/src/workflows/order-set/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/order-set/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/payout/index.d.ts +2 -0
- package/.medusa/server/src/workflows/payout/index.js +19 -0
- package/.medusa/server/src/workflows/payout/steps/create-payout-reversal.d.ts +8 -0
- package/.medusa/server/src/workflows/payout/steps/create-payout-reversal.js +25 -0
- package/.medusa/server/src/workflows/payout/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/payout/steps/index.js +19 -0
- package/.medusa/server/src/workflows/payout/steps/update-payout-account.d.ts +2 -0
- package/.medusa/server/src/workflows/payout/steps/update-payout-account.js +15 -0
- package/.medusa/server/src/workflows/payout/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/payout/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/payout/workflows/process-payout-webhook-action.d.ts +7 -0
- package/.medusa/server/src/workflows/payout/workflows/process-payout-webhook-action.js +20 -0
- package/.medusa/server/src/workflows/price-list/index.d.ts +2 -0
- package/.medusa/server/src/workflows/price-list/index.js +19 -0
- package/.medusa/server/src/workflows/price-list/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/price-list/steps/index.js +18 -0
- package/.medusa/server/src/workflows/price-list/steps/validate-vendor-price-list-prices.d.ts +7 -0
- package/.medusa/server/src/workflows/price-list/steps/validate-vendor-price-list-prices.js +60 -0
- package/.medusa/server/src/workflows/price-list/workflows/batch-vendor-price-list-prices.d.ts +10 -0
- package/.medusa/server/src/workflows/price-list/workflows/batch-vendor-price-list-prices.js +26 -0
- package/.medusa/server/src/workflows/price-list/workflows/create-vendor-price-list-prices.d.ts +6 -0
- package/.medusa/server/src/workflows/price-list/workflows/create-vendor-price-list-prices.js +21 -0
- package/.medusa/server/src/workflows/price-list/workflows/create-vendor-price-list.d.ts +5 -0
- package/.medusa/server/src/workflows/price-list/workflows/create-vendor-price-list.js +34 -0
- package/.medusa/server/src/workflows/price-list/workflows/index.d.ts +3 -0
- package/.medusa/server/src/workflows/price-list/workflows/index.js +20 -0
- package/.medusa/server/src/workflows/product/index.d.ts +2 -0
- package/.medusa/server/src/workflows/product/index.js +19 -0
- package/.medusa/server/src/workflows/product/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/product/steps/index.js +18 -0
- package/.medusa/server/src/workflows/product/steps/update-product-status.d.ts +5 -0
- package/.medusa/server/src/workflows/product/steps/update-product-status.js +13 -0
- package/.medusa/server/src/workflows/product/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/product/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/product/workflows/update-product-status.d.ts +5 -0
- package/.medusa/server/src/workflows/product/workflows/update-product-status.js +9 -0
- package/.medusa/server/src/workflows/promotions/index.d.ts +2 -0
- package/.medusa/server/src/workflows/promotions/index.js +19 -0
- package/.medusa/server/src/workflows/promotions/steps/index.d.ts +4 -0
- package/.medusa/server/src/workflows/promotions/steps/index.js +21 -0
- package/.medusa/server/src/workflows/promotions/steps/register-usage-step.d.ts +3 -0
- package/.medusa/server/src/workflows/promotions/steps/register-usage-step.js +21 -0
- package/.medusa/server/src/workflows/promotions/steps/verify-vendor-campaign.d.ts +6 -0
- package/.medusa/server/src/workflows/promotions/steps/verify-vendor-campaign.js +27 -0
- package/.medusa/server/src/workflows/promotions/steps/verify-vendor-promotion.d.ts +5 -0
- package/.medusa/server/src/workflows/promotions/steps/verify-vendor-promotion.js +12 -0
- package/.medusa/server/src/workflows/promotions/steps/verify-vendor-target-promotion-rules.d.ts +5 -0
- package/.medusa/server/src/workflows/promotions/steps/verify-vendor-target-promotion-rules.js +31 -0
- package/.medusa/server/src/workflows/promotions/workflows/batch-vendor-promotion-rules.d.ts +5 -0
- package/.medusa/server/src/workflows/promotions/workflows/batch-vendor-promotion-rules.js +18 -0
- package/.medusa/server/src/workflows/promotions/workflows/create-vendor-promotion.d.ts +5 -0
- package/.medusa/server/src/workflows/promotions/workflows/create-vendor-promotion.js +48 -0
- package/.medusa/server/src/workflows/promotions/workflows/index.d.ts +3 -0
- package/.medusa/server/src/workflows/promotions/workflows/index.js +20 -0
- package/.medusa/server/src/workflows/promotions/workflows/update-vendor-promotion.d.ts +5 -0
- package/.medusa/server/src/workflows/promotions/workflows/update-vendor-promotion.js +16 -0
- package/.medusa/server/src/workflows/seller/index.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/index.js +19 -0
- package/.medusa/server/src/workflows/seller/steps/create-member-invites.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/create-member-invites.js +14 -0
- package/.medusa/server/src/workflows/seller/steps/create-member.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/create-member.js +14 -0
- package/.medusa/server/src/workflows/seller/steps/create-payment-account.d.ts +45 -0
- package/.medusa/server/src/workflows/seller/steps/create-payment-account.js +17 -0
- package/.medusa/server/src/workflows/seller/steps/create-payout-onboarding.d.ts +45 -0
- package/.medusa/server/src/workflows/seller/steps/create-payout-onboarding.js +11 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller-onboarding.d.ts +59 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller-onboarding.js +13 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller-shipping-profile.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller-shipping-profile.js +30 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller.js +21 -0
- package/.medusa/server/src/workflows/seller/steps/delete-member-invite.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/steps/delete-member-invite.js +14 -0
- package/.medusa/server/src/workflows/seller/steps/delete-member.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/steps/delete-member.js +20 -0
- package/.medusa/server/src/workflows/seller/steps/delete-seller.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/steps/delete-seller.js +14 -0
- package/.medusa/server/src/workflows/seller/steps/get-seller-products.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/get-seller-products.js +55 -0
- package/.medusa/server/src/workflows/seller/steps/index.d.ts +21 -0
- package/.medusa/server/src/workflows/seller/steps/index.js +38 -0
- package/.medusa/server/src/workflows/seller/steps/recalculate-onboarding.d.ts +58 -0
- package/.medusa/server/src/workflows/seller/steps/recalculate-onboarding.js +84 -0
- package/.medusa/server/src/workflows/seller/steps/send-invitation-email.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/send-invitation-email.js +31 -0
- package/.medusa/server/src/workflows/seller/steps/sync-stripe-account.d.ts +44 -0
- package/.medusa/server/src/workflows/seller/steps/sync-stripe-account.js +11 -0
- package/.medusa/server/src/workflows/seller/steps/update-member-invite.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/update-member-invite.js +18 -0
- package/.medusa/server/src/workflows/seller/steps/update-member.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/update-member.js +15 -0
- package/.medusa/server/src/workflows/seller/steps/update-seller.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/update-seller.js +34 -0
- package/.medusa/server/src/workflows/seller/steps/validate-member-invites.d.ts +59 -0
- package/.medusa/server/src/workflows/seller/steps/validate-member-invites.js +11 -0
- package/.medusa/server/src/workflows/seller/steps/validate-no-existing-payout-account-for-seller.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/steps/validate-no-existing-payout-account-for-seller.js +21 -0
- package/.medusa/server/src/workflows/seller/steps/validate-payout-account-exists-for-seller.d.ts +3 -0
- package/.medusa/server/src/workflows/seller/steps/validate-payout-account-exists-for-seller.js +24 -0
- package/.medusa/server/src/workflows/seller/steps/validate-products-to-import.d.ts +70 -0
- package/.medusa/server/src/workflows/seller/steps/validate-products-to-import.js +16 -0
- package/.medusa/server/src/workflows/seller/workflows/accept-member-invite.d.ts +64 -0
- package/.medusa/server/src/workflows/seller/workflows/accept-member-invite.js +27 -0
- package/.medusa/server/src/workflows/seller/workflows/create-onboarding-for-seller.d.ts +50 -0
- package/.medusa/server/src/workflows/seller/workflows/create-onboarding-for-seller.js +14 -0
- package/.medusa/server/src/workflows/seller/workflows/create-payout-account-for-seller.d.ts +50 -0
- package/.medusa/server/src/workflows/seller/workflows/create-payout-account-for-seller.js +27 -0
- package/.medusa/server/src/workflows/seller/workflows/create-seller.d.ts +10 -0
- package/.medusa/server/src/workflows/seller/workflows/create-seller.js +27 -0
- package/.medusa/server/src/workflows/seller/workflows/delete-member-invite.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/workflows/delete-member-invite.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/delete-member.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/workflows/delete-member.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/delete-seller.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/workflows/delete-seller.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/export-seller-products.d.ts +1 -0
- package/.medusa/server/src/workflows/seller/workflows/export-seller-products.js +18 -0
- package/.medusa/server/src/workflows/seller/workflows/import-seller-products.d.ts +5 -0
- package/.medusa/server/src/workflows/seller/workflows/import-seller-products.js +39 -0
- package/.medusa/server/src/workflows/seller/workflows/index.d.ts +15 -0
- package/.medusa/server/src/workflows/seller/workflows/index.js +32 -0
- package/.medusa/server/src/workflows/seller/workflows/invite-member.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/workflows/invite-member.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/invite-seller.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/workflows/invite-seller.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/recalculate-onboarding.d.ts +58 -0
- package/.medusa/server/src/workflows/seller/workflows/recalculate-onboarding.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/sync-stripe-account.d.ts +44 -0
- package/.medusa/server/src/workflows/seller/workflows/sync-stripe-account.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/update-member.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/workflows/update-member.js +9 -0
- package/.medusa/server/src/workflows/seller/workflows/update-seller.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/workflows/update-seller.js +9 -0
- package/.medusa/server/src/workflows/split-order-payment/index.d.ts +2 -0
- package/.medusa/server/src/workflows/split-order-payment/index.js +19 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/create-split-order-payments.d.ts +2 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/create-split-order-payments.js +35 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/index.d.ts +3 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/index.js +20 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/update-split-order-payment.d.ts +16 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/update-split-order-payment.js +17 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/validate-refund-split-order-payment.d.ts +6 -0
- package/.medusa/server/src/workflows/split-order-payment/steps/validate-refund-split-order-payment.js +27 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/index.d.ts +3 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/index.js +20 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/mark-split-order-payments-as-captured.d.ts +15 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/mark-split-order-payments-as-captured.js +28 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/partial-payment-refund.d.ts +8 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/partial-payment-refund.js +77 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/refund-split-order-payment.d.ts +16 -0
- package/.medusa/server/src/workflows/split-order-payment/workflows/refund-split-order-payment.js +16 -0
- package/.medusa/server/src/workflows/wishlist/index.d.ts +2 -0
- package/.medusa/server/src/workflows/wishlist/index.js +19 -0
- package/.medusa/server/src/workflows/wishlist/steps/create-wishlist.d.ts +2 -0
- package/.medusa/server/src/workflows/wishlist/steps/create-wishlist.js +37 -0
- package/.medusa/server/src/workflows/wishlist/steps/delete-wishlist.d.ts +5 -0
- package/.medusa/server/src/workflows/wishlist/steps/delete-wishlist.js +22 -0
- package/.medusa/server/src/workflows/wishlist/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/wishlist/steps/index.js +19 -0
- package/.medusa/server/src/workflows/wishlist/workflows/create-wishlist.d.ts +2 -0
- package/.medusa/server/src/workflows/wishlist/workflows/create-wishlist.js +11 -0
- package/.medusa/server/src/workflows/wishlist/workflows/delete-wishlist.d.ts +5 -0
- package/.medusa/server/src/workflows/wishlist/workflows/delete-wishlist.js +11 -0
- package/.medusa/server/src/workflows/wishlist/workflows/index.d.ts +2 -0
- package/.medusa/server/src/workflows/wishlist/workflows/index.js +19 -0
- package/README.md +22 -0
- package/package.json +86 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateTotalCommissionStep = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
6
|
+
exports.calculateTotalCommissionStep = (0, workflows_sdk_1.createStep)('calculate-total-commission', async (input, { container }) => {
|
|
7
|
+
const query = container.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
8
|
+
const { data: [order] } = await query.graph({
|
|
9
|
+
entity: 'order',
|
|
10
|
+
fields: ['items.id'],
|
|
11
|
+
filters: {
|
|
12
|
+
id: input.order_id
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const order_line_items = order.items.map((i) => i.id);
|
|
16
|
+
const { data: commission_lines } = await query.graph({
|
|
17
|
+
entity: 'commission_line',
|
|
18
|
+
fields: ['*'],
|
|
19
|
+
filters: {
|
|
20
|
+
item_line_id: order_line_items
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const total_commission = commission_lines.reduce((acc, current) => {
|
|
24
|
+
return utils_1.MathBN.add(acc, current.value);
|
|
25
|
+
}, utils_1.MathBN.convert(0));
|
|
26
|
+
return new workflows_sdk_1.StepResponse({ total_commission });
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsY3VsYXRlLXRvdGFsLWNvbW1pc3Npb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL29yZGVyL3N0ZXBzL2NhbGN1bGF0ZS10b3RhbC1jb21taXNzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUlrQztBQUNsQyxxRUFBNEU7QUFFL0QsUUFBQSw0QkFBNEIsR0FBRyxJQUFBLDBCQUFVLEVBQ3BELDRCQUE0QixFQUM1QixLQUFLLEVBQ0gsS0FFQyxFQUNELEVBQUUsU0FBUyxFQUFFLEVBQ2IsRUFBRTtJQUNGLE1BQU0sS0FBSyxHQUFHLFNBQVMsQ0FBQyxPQUFPLENBQUMsaUNBQXlCLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFaEUsTUFBTSxFQUNKLElBQUksRUFBRSxDQUFDLEtBQUssQ0FBQyxFQUNkLEdBQUcsTUFBTSxLQUFLLENBQUMsS0FBSyxDQUFDO1FBQ3BCLE1BQU0sRUFBRSxPQUFPO1FBQ2YsTUFBTSxFQUFFLENBQUMsVUFBVSxDQUFDO1FBQ3BCLE9BQU8sRUFBRTtZQUNQLEVBQUUsRUFBRSxLQUFLLENBQUMsUUFBUTtTQUNuQjtLQUNGLENBQUMsQ0FBQTtJQUVGLE1BQU0sZ0JBQWdCLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQTtJQUVyRCxNQUFNLEVBQUUsSUFBSSxFQUFFLGdCQUFnQixFQUFFLEdBQUcsTUFBTSxLQUFLLENBQUMsS0FBSyxDQUFDO1FBQ25ELE1BQU0sRUFBRSxpQkFBaUI7UUFDekIsTUFBTSxFQUFFLENBQUMsR0FBRyxDQUFDO1FBQ2IsT0FBTyxFQUFFO1lBQ1AsWUFBWSxFQUFFLGdCQUFnQjtTQUMvQjtLQUNGLENBQUMsQ0FBQTtJQUVGLE1BQU0sZ0JBQWdCLEdBQWMsZ0JBQWdCLENBQUMsTUFBTSxDQUN6RCxDQUFDLEdBQUcsRUFBRSxPQUFPLEVBQUUsRUFBRTtRQUNmLE9BQU8sY0FBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFBO0lBQ3ZDLENBQUMsRUFDRCxjQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUNsQixDQUFBO0lBRUQsT0FBTyxJQUFJLDRCQUFZLENBQUMsRUFBRSxnQkFBZ0IsRUFBRSxDQUFDLENBQUE7QUFDL0MsQ0FBQyxDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPayoutStep = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const payout_1 = require("../../../modules/payout");
|
|
6
|
+
exports.createPayoutStep = (0, workflows_sdk_1.createStep)("create-payout", async (input, { container }) => {
|
|
7
|
+
const service = container.resolve(payout_1.PAYOUT_MODULE);
|
|
8
|
+
let payout = null;
|
|
9
|
+
let err = false;
|
|
10
|
+
try {
|
|
11
|
+
payout = await service.createPayout(input);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
err = true;
|
|
15
|
+
}
|
|
16
|
+
return new workflows_sdk_1.StepResponse({
|
|
17
|
+
payout,
|
|
18
|
+
err,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLXBheW91dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3Mvb3JkZXIvc3RlcHMvY3JlYXRlLXBheW91dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxRUFBNkU7QUFHN0Usb0RBQXdEO0FBRzNDLFFBQUEsZ0JBQWdCLEdBQUcsSUFBQSwwQkFBVSxFQUN4QyxlQUFlLEVBQ2YsS0FBSyxFQUFFLEtBQXNCLEVBQUUsRUFBRSxTQUFTLEVBQUUsRUFBRSxFQUFFO0lBQzlDLE1BQU0sT0FBTyxHQUFHLFNBQVMsQ0FBQyxPQUFPLENBQXNCLHNCQUFhLENBQUMsQ0FBQztJQUV0RSxJQUFJLE1BQU0sR0FBcUIsSUFBSSxDQUFDO0lBQ3BDLElBQUksR0FBRyxHQUFHLEtBQUssQ0FBQztJQUVoQixJQUFJLENBQUM7UUFDSCxNQUFNLEdBQUcsTUFBTSxPQUFPLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQzdDLENBQUM7SUFBQyxNQUFNLENBQUM7UUFDUCxHQUFHLEdBQUcsSUFBSSxDQUFDO0lBQ2IsQ0FBQztJQUVELE9BQU8sSUFBSSw0QkFBWSxDQUFDO1FBQ3RCLE1BQU07UUFDTixHQUFHO0tBQ0osQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUNGLENBQUMifQ==
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-payout"), exports);
|
|
18
|
+
__exportStar(require("./validate-no-existing-payout-for-order"), exports);
|
|
19
|
+
__exportStar(require("./validate-seller-payout-account"), exports);
|
|
20
|
+
__exportStar(require("./calculate-payout-for-order"), exports);
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL29yZGVyL3N0ZXBzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxrREFBK0I7QUFDL0IsMEVBQXVEO0FBQ3ZELG1FQUFnRDtBQUNoRCwrREFBNEMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateNoExistingPayoutForOrderStep: import("@medusajs/framework/workflows-sdk").StepFunction<string, unknown>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validateNoExistingPayoutForOrderStep = void 0;
|
|
7
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
8
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
9
|
+
const order_payout_1 = __importDefault(require("../../../links/order-payout"));
|
|
10
|
+
exports.validateNoExistingPayoutForOrderStep = (0, workflows_sdk_1.createStep)('validate-no-existing-payout-for-order', async (id, { container }) => {
|
|
11
|
+
const query = container.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
12
|
+
const { data: [orderRelation] } = await query.graph({
|
|
13
|
+
entity: order_payout_1.default.entryPoint,
|
|
14
|
+
fields: ['order_id'],
|
|
15
|
+
filters: {
|
|
16
|
+
order_id: id
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if (orderRelation) {
|
|
20
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.DUPLICATE_ERROR, `Payout already exists for order: ${id}`);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGUtbm8tZXhpc3RpbmctcGF5b3V0LWZvci1vcmRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3Mvb3JkZXIvc3RlcHMvdmFsaWRhdGUtbm8tZXhpc3RpbmctcGF5b3V0LWZvci1vcmRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxxREFHa0M7QUFDbEMscUVBQThEO0FBRTlELCtFQUF5RDtBQUU1QyxRQUFBLG9DQUFvQyxHQUFHLElBQUEsMEJBQVUsRUFDNUQsdUNBQXVDLEVBQ3ZDLEtBQUssRUFBRSxFQUFVLEVBQUUsRUFBRSxTQUFTLEVBQUUsRUFBRSxFQUFFO0lBQ2xDLE1BQU0sS0FBSyxHQUFHLFNBQVMsQ0FBQyxPQUFPLENBQUMsaUNBQXlCLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFaEUsTUFBTSxFQUNKLElBQUksRUFBRSxDQUFDLGFBQWEsQ0FBQyxFQUN0QixHQUFHLE1BQU0sS0FBSyxDQUFDLEtBQUssQ0FBQztRQUNwQixNQUFNLEVBQUUsc0JBQWUsQ0FBQyxVQUFVO1FBQ2xDLE1BQU0sRUFBRSxDQUFDLFVBQVUsQ0FBQztRQUNwQixPQUFPLEVBQUU7WUFDUCxRQUFRLEVBQUUsRUFBRTtTQUNiO0tBQ0YsQ0FBQyxDQUFBO0lBRUYsSUFBSSxhQUFhLEVBQUUsQ0FBQztRQUNsQixNQUFNLElBQUksbUJBQVcsQ0FDbkIsbUJBQVcsQ0FBQyxLQUFLLENBQUMsZUFBZSxFQUNqQyxvQ0FBb0MsRUFBRSxFQUFFLENBQ3pDLENBQUE7SUFDSCxDQUFDO0FBQ0gsQ0FBQyxDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSellerPayoutAccountStep = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const utils_1 = require("@medusajs/utils");
|
|
6
|
+
const framework_1 = require("@mercurjs/framework");
|
|
7
|
+
exports.validateSellerPayoutAccountStep = (0, workflows_sdk_1.createStep)("validate-seller-payout-account", async (seller) => {
|
|
8
|
+
if (!seller.payout_account) {
|
|
9
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Seller has no payout account");
|
|
10
|
+
}
|
|
11
|
+
if (seller.payout_account.status !== framework_1.PayoutAccountStatus.ACTIVE) {
|
|
12
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, "Seller payout account is not active");
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGUtc2VsbGVyLXBheW91dC1hY2NvdW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3dvcmtmbG93cy9vcmRlci9zdGVwcy92YWxpZGF0ZS1zZWxsZXItcGF5b3V0LWFjY291bnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscUVBQStEO0FBQy9ELDJDQUE4QztBQUc5QyxtREFBMEQ7QUFFN0MsUUFBQSwrQkFBK0IsR0FBRyxJQUFBLDBCQUFVLEVBQ3ZELGdDQUFnQyxFQUNoQyxLQUFLLEVBQUUsTUFBa0MsRUFBRSxFQUFFO0lBQzNDLElBQUksQ0FBQyxNQUFNLENBQUMsY0FBYyxFQUFFLENBQUM7UUFDM0IsTUFBTSxJQUFJLG1CQUFXLENBQ25CLG1CQUFXLENBQUMsS0FBSyxDQUFDLFlBQVksRUFDOUIsOEJBQThCLENBQy9CLENBQUM7SUFDSixDQUFDO0lBRUQsSUFBSSxNQUFNLENBQUMsY0FBYyxDQUFDLE1BQU0sS0FBSywrQkFBbUIsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNoRSxNQUFNLElBQUksbUJBQVcsQ0FDbkIsbUJBQVcsQ0FBQyxLQUFLLENBQUMsWUFBWSxFQUM5QixxQ0FBcUMsQ0FDdEMsQ0FBQztJQUNKLENBQUM7QUFDSCxDQUFDLENBQ0YsQ0FBQyJ9
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLastFulfillmentStatus = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const getLastFulfillmentStatus = (order) => {
|
|
6
|
+
const FulfillmentStatus = {
|
|
7
|
+
NOT_FULFILLED: 'not_fulfilled',
|
|
8
|
+
PARTIALLY_FULFILLED: 'partially_fulfilled',
|
|
9
|
+
FULFILLED: 'fulfilled',
|
|
10
|
+
PARTIALLY_SHIPPED: 'partially_shipped',
|
|
11
|
+
SHIPPED: 'shipped',
|
|
12
|
+
DELIVERED: 'delivered',
|
|
13
|
+
PARTIALLY_DELIVERED: 'partially_delivered',
|
|
14
|
+
CANCELED: 'canceled'
|
|
15
|
+
};
|
|
16
|
+
const fulfillmentStatus = {};
|
|
17
|
+
for (const status in FulfillmentStatus) {
|
|
18
|
+
fulfillmentStatus[FulfillmentStatus[status]] = 0;
|
|
19
|
+
}
|
|
20
|
+
const statusMap = {
|
|
21
|
+
canceled_at: FulfillmentStatus.CANCELED,
|
|
22
|
+
delivered_at: FulfillmentStatus.DELIVERED,
|
|
23
|
+
shipped_at: FulfillmentStatus.SHIPPED,
|
|
24
|
+
packed_at: FulfillmentStatus.FULFILLED
|
|
25
|
+
};
|
|
26
|
+
for (const fulfillmentCollection of order.fulfillments) {
|
|
27
|
+
for (const key in statusMap) {
|
|
28
|
+
if (fulfillmentCollection[key]) {
|
|
29
|
+
fulfillmentStatus[statusMap[key]] += 1;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const totalFulfillments = order.fulfillments.length;
|
|
35
|
+
const totalFulfillmentsExceptCanceled = totalFulfillments - fulfillmentStatus[FulfillmentStatus.CANCELED];
|
|
36
|
+
const hasUnfulfilledItems = (order.items || [])?.filter((i) => (0, utils_1.isDefined)(i?.detail?.raw_fulfilled_quantity) &&
|
|
37
|
+
utils_1.MathBN.lt(i.detail.raw_fulfilled_quantity, i.raw_quantity)).length > 0;
|
|
38
|
+
if (fulfillmentStatus[FulfillmentStatus.DELIVERED] > 0) {
|
|
39
|
+
if (fulfillmentStatus[FulfillmentStatus.DELIVERED] ===
|
|
40
|
+
totalFulfillmentsExceptCanceled &&
|
|
41
|
+
!hasUnfulfilledItems) {
|
|
42
|
+
return FulfillmentStatus.DELIVERED;
|
|
43
|
+
}
|
|
44
|
+
return FulfillmentStatus.PARTIALLY_DELIVERED;
|
|
45
|
+
}
|
|
46
|
+
if (fulfillmentStatus[FulfillmentStatus.SHIPPED] > 0) {
|
|
47
|
+
if (fulfillmentStatus[FulfillmentStatus.SHIPPED] ===
|
|
48
|
+
totalFulfillmentsExceptCanceled &&
|
|
49
|
+
!hasUnfulfilledItems) {
|
|
50
|
+
return FulfillmentStatus.SHIPPED;
|
|
51
|
+
}
|
|
52
|
+
return FulfillmentStatus.PARTIALLY_SHIPPED;
|
|
53
|
+
}
|
|
54
|
+
if (fulfillmentStatus[FulfillmentStatus.FULFILLED] > 0) {
|
|
55
|
+
if (fulfillmentStatus[FulfillmentStatus.FULFILLED] ===
|
|
56
|
+
totalFulfillmentsExceptCanceled &&
|
|
57
|
+
!hasUnfulfilledItems) {
|
|
58
|
+
return FulfillmentStatus.FULFILLED;
|
|
59
|
+
}
|
|
60
|
+
return FulfillmentStatus.PARTIALLY_FULFILLED;
|
|
61
|
+
}
|
|
62
|
+
if (fulfillmentStatus[FulfillmentStatus.CANCELED] > 0 &&
|
|
63
|
+
fulfillmentStatus[FulfillmentStatus.CANCELED] === totalFulfillments) {
|
|
64
|
+
return FulfillmentStatus.CANCELED;
|
|
65
|
+
}
|
|
66
|
+
return FulfillmentStatus.NOT_FULFILLED;
|
|
67
|
+
};
|
|
68
|
+
exports.getLastFulfillmentStatus = getLastFulfillmentStatus;
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdncmVnYXRlLXN0YXR1cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3Mvb3JkZXIvdXRpbHMvYWdnc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UIsQ0FBQyxpQkFBaUIsQ0FBQyxPQUFPLENBQUM7WUFDMUMsK0JBQStCO1lBQ2pDLENBQUMsbUJBQW1CLEVBQ3BCLENBQUM7WUFDRCxPQUFPLGlCQUFpQixDQUFDLE9BQU8sQ0FBQTtRQUNsQyxDQUFDO1FBRUQsT0FBTyxpQkFBaUIsQ0FBQyxpQkFBaUIsQ0FBQTtJQUM1QyxDQUFDO0lBRUQsSUFBSSxpQkFBaUIsQ0FBQyxpQkFBaUIsQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQztRQUN2RCxJQUNFLGlCQUFpQixDQUFDLGlCQUFpQixDQUFDLFNBQVMsQ0FBQztZQUM1QywrQkFBK0I7WUFDakMsQ0FBQyxtQkFBbUIsRUFDcEIsQ0FBQztZQUNELE9BQU8saUJBQWlCLENBQUMsU0FBUyxDQUFBO1FBQ3BDLENBQUM7UUFFRCxPQUFPLGlCQUFpQixDQUFDLG1CQUFtQixDQUFBO0lBQzlDLENBQUM7SUFFRCxJQUNFLGlCQUFpQixDQUFDLGlCQUFpQixDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUM7UUFDakQsaUJBQWlCLENBQUMsaUJBQWlCLENBQUMsUUFBUSxDQUFDLEtBQUssaUJBQWlCLEVBQ25FLENBQUM7UUFDRCxPQUFPLGlCQUFpQixDQUFDLFFBQVEsQ0FBQTtJQUNuQyxDQUFDO0lBRUQsT0FBTyxpQkFBaUIsQ0FBQyxhQUFhLENBQUE7QUFDeEMsQ0FBQyxDQUFBO0FBekZZLFFBQUEsd0JBQXdCLDRCQXlGcEMifQ==
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { OrderWorkflow } from '@medusajs/framework/types';
|
|
2
|
+
import { CancelValidateOrderStepInput } from '@medusajs/medusa/core-flows';
|
|
3
|
+
export declare const cancelValidateOrder: import("@medusajs/framework/workflows-sdk").StepFunction<CancelValidateOrderStepInput, unknown>;
|
|
4
|
+
export declare const cancelOrderWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<OrderWorkflow.CancelOrderWorkflowInput, any, []>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelOrderWorkflow = exports.cancelValidateOrder = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
6
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
7
|
+
const steps_1 = require("../../payout/steps");
|
|
8
|
+
const workflows_1 = require("../../split-order-payment/workflows");
|
|
9
|
+
exports.cancelValidateOrder = (0, workflows_sdk_1.createStep)('cancel-validate-order', async ({ order }) => {
|
|
10
|
+
const order_ = order;
|
|
11
|
+
if (order_.status === utils_1.OrderStatus.CANCELED) {
|
|
12
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Order with id ${order.id} has been canceled.`);
|
|
13
|
+
}
|
|
14
|
+
if (order_.fulfillments.some((o) => !o.canceled_at)) {
|
|
15
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_ALLOWED, `All fulfillments must be canceled before canceling an order`);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.cancelOrderWorkflow = (0, workflows_sdk_1.createWorkflow)('cancel-single-order', (input) => {
|
|
19
|
+
const orderQuery = (0, core_flows_1.useQueryGraphStep)({
|
|
20
|
+
entity: 'orders',
|
|
21
|
+
fields: [
|
|
22
|
+
'id',
|
|
23
|
+
'status',
|
|
24
|
+
'currency_code',
|
|
25
|
+
'items.id',
|
|
26
|
+
'fulfillments.canceled_at',
|
|
27
|
+
'split_order_payment.*',
|
|
28
|
+
'payouts.*'
|
|
29
|
+
],
|
|
30
|
+
filters: { id: input.order_id },
|
|
31
|
+
options: { throwIfKeyNotFound: true }
|
|
32
|
+
}).config({ name: 'get-cart' });
|
|
33
|
+
const order = (0, workflows_sdk_1.transform)({ orderQuery }, ({ orderQuery }) => orderQuery.data[0]);
|
|
34
|
+
(0, exports.cancelValidateOrder)({ order, input });
|
|
35
|
+
const lineItemIds = (0, workflows_sdk_1.transform)({ order }, ({ order }) => {
|
|
36
|
+
return order.items?.map((i) => i.id);
|
|
37
|
+
});
|
|
38
|
+
const payoutId = (0, workflows_sdk_1.transform)({ order }, ({ order }) => {
|
|
39
|
+
return order.payouts && order.payouts[0] ? order.payouts[0].id : null;
|
|
40
|
+
});
|
|
41
|
+
(0, workflows_sdk_1.parallelize)((0, core_flows_1.deleteReservationsByLineItemsStep)(lineItemIds), (0, core_flows_1.cancelOrdersStep)({ orderIds: [order.id] }), workflows_1.refundSplitOrderPaymentWorkflow.runAsStep({
|
|
42
|
+
input: {
|
|
43
|
+
id: order.split_order_payment.id,
|
|
44
|
+
amount: order.split_order_payment.captured_amount
|
|
45
|
+
}
|
|
46
|
+
}), (0, steps_1.createPayoutReversalStep)({
|
|
47
|
+
payout_id: payoutId,
|
|
48
|
+
amount: order.split_order_payment.captured_amount,
|
|
49
|
+
currency_code: order.currency_code
|
|
50
|
+
}), (0, core_flows_1.emitEventStep)({
|
|
51
|
+
eventName: utils_1.OrderWorkflowEvents.CANCELED,
|
|
52
|
+
data: { id: order.id }
|
|
53
|
+
}));
|
|
54
|
+
return new workflows_sdk_1.WorkflowResponse(order.id);
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FuY2VsLW9yZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3dvcmtmbG93cy9vcmRlci93b3JrZmxvd3MvY2FuY2VsLW9yZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQU1BLHFEQUlrQztBQUNsQyxxRUFPMEM7QUFDMUMsNERBTW9DO0FBRX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VBQ1QsSUFBQSw4Q0FBaUMsRUFBQyxXQUFXLENBQUMsRUFDOUMsSUFBQSw2QkFBZ0IsRUFBQyxFQUFFLFFBQVEsRUFBRSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQzFDLDJDQUErQixDQUFDLFNBQVMsQ0FBQztRQUN4QyxLQUFLLEVBQUU7WUFDTCxFQUFFLEVBQUUsS0FBSyxDQUFDLG1CQUFtQixDQUFDLEVBQUU7WUFDaEMsTUFBTSxFQUFFLEtBQUssQ0FBQyxtQkFBbUIsQ0FBQyxlQUFlO1NBQ2xEO0tBQ0YsQ0FBQyxFQUNGLElBQUEsZ0NBQXdCLEVBQUM7UUFDdkIsU0FBUyxFQUFFLFFBQVE7UUFDbkIsTUFBTSxFQUFFLEtBQUssQ0FBQyxtQkFBbUIsQ0FBQyxlQUFlO1FBQ2pELGFBQWEsRUFBRSxLQUFLLENBQUMsYUFBYTtLQUNuQyxDQUFDLEVBQ0YsSUFBQSwwQkFBYSxFQUFDO1FBQ1osU0FBUyxFQUFFLDJCQUFtQixDQUFDLFFBQVE7UUFDdkMsSUFBSSxFQUFFLEVBQUUsRUFBRSxFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUU7S0FDdkIsQ0FBQyxDQUNILENBQUE7SUFFRCxPQUFPLElBQUksZ0NBQWdCLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxDQUFBO0FBQ3ZDLENBQUMsQ0FDRixDQUFBIn0=
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { OrderDTO } from '@medusajs/framework/types';
|
|
2
|
+
import { GetOrdersListWorkflowInput } from '@medusajs/medusa/core-flows';
|
|
3
|
+
export declare const getVendorOrdersListWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<GetOrdersListWorkflowInput, OrderDTO[], []>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVendorOrdersListWorkflow = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
6
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
7
|
+
const aggregate_status_1 = require("../utils/aggregate-status");
|
|
8
|
+
exports.getVendorOrdersListWorkflow = (0, workflows_sdk_1.createWorkflow)('get-vendor-orders-list', (input) => {
|
|
9
|
+
const fields = (0, workflows_sdk_1.transform)(input, ({ fields }) => {
|
|
10
|
+
return (0, utils_1.deduplicate)([
|
|
11
|
+
...fields,
|
|
12
|
+
'id',
|
|
13
|
+
'status',
|
|
14
|
+
'version',
|
|
15
|
+
'items.*',
|
|
16
|
+
'fulfillments.packed_at',
|
|
17
|
+
'fulfillments.shipped_at',
|
|
18
|
+
'fulfillments.delivered_at',
|
|
19
|
+
'fulfillments.canceled_at',
|
|
20
|
+
'split_order_payment.*'
|
|
21
|
+
]);
|
|
22
|
+
});
|
|
23
|
+
const orders = (0, core_flows_1.useRemoteQueryStep)({
|
|
24
|
+
entry_point: 'orders',
|
|
25
|
+
fields,
|
|
26
|
+
variables: input.variables,
|
|
27
|
+
list: true
|
|
28
|
+
});
|
|
29
|
+
const aggregatedOrders = (0, workflows_sdk_1.transform)({ orders }, ({ orders }) => {
|
|
30
|
+
const orders_ = orders;
|
|
31
|
+
const data = orders_.rows ? orders_.rows : orders_;
|
|
32
|
+
for (const order of data) {
|
|
33
|
+
delete order.summary;
|
|
34
|
+
order.payment_status = order.split_order_payment?.status;
|
|
35
|
+
order.fulfillment_status = (0, aggregate_status_1.getLastFulfillmentStatus)(order);
|
|
36
|
+
}
|
|
37
|
+
return orders;
|
|
38
|
+
});
|
|
39
|
+
return new workflows_sdk_1.WorkflowResponse(aggregatedOrders);
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ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QTtRQUM3QixNQUFNLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUE7UUFFbEQsS0FBSyxNQUFNLEtBQUssSUFBSSxJQUFJLEVBQUUsQ0FBQztZQUN6QixPQUFPLEtBQUssQ0FBQyxPQUFPLENBQUE7WUFFcEIsS0FBSyxDQUFDLGNBQWMsR0FBRyxLQUFLLENBQUMsbUJBQW1CLEVBQUUsTUFBTSxDQUFBO1lBQ3hELEtBQUssQ0FBQyxrQkFBa0IsR0FBRyxJQUFBLDJDQUF3QixFQUNqRCxLQUFLLENBQ2tDLENBQUE7UUFDM0MsQ0FBQztRQUVELE9BQU8sTUFBTSxDQUFBO0lBQ2YsQ0FBQyxDQUFDLENBQUE7SUFFRixPQUFPLElBQUksZ0NBQWdCLENBQUMsZ0JBQWdCLENBQUMsQ0FBQTtBQUMvQyxDQUFDLENBQ0YsQ0FBQSJ9
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./process-payout-for-order"), exports);
|
|
18
|
+
__exportStar(require("./cancel-order"), exports);
|
|
19
|
+
__exportStar(require("./get-vendor-order-list"), exports);
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL29yZGVyL3dvcmtmbG93cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsNkRBQTBDO0FBQzFDLGlEQUE4QjtBQUM5QiwwREFBdUMifQ==
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processPayoutForOrderWorkflow = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
6
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
7
|
+
const workflows_sdk_2 = require("@medusajs/workflows-sdk");
|
|
8
|
+
const framework_1 = require("@mercurjs/framework");
|
|
9
|
+
const payout_1 = require("../../../modules/payout");
|
|
10
|
+
const steps_1 = require("../steps");
|
|
11
|
+
exports.processPayoutForOrderWorkflow = (0, workflows_sdk_2.createWorkflow)({ name: "process-payout-for-order" }, function (input) {
|
|
12
|
+
(0, steps_1.validateNoExistingPayoutForOrderStep)(input.order_id);
|
|
13
|
+
const { data: orders } = (0, core_flows_1.useQueryGraphStep)({
|
|
14
|
+
entity: "order",
|
|
15
|
+
fields: [
|
|
16
|
+
"seller.id",
|
|
17
|
+
"total",
|
|
18
|
+
"currency_code",
|
|
19
|
+
"payment_collections.payment_sessions.*",
|
|
20
|
+
],
|
|
21
|
+
filters: {
|
|
22
|
+
id: input.order_id,
|
|
23
|
+
},
|
|
24
|
+
options: { throwIfKeyNotFound: true },
|
|
25
|
+
}).config({ name: "query-order" });
|
|
26
|
+
const order = (0, workflows_sdk_1.transform)(orders, (orders) => {
|
|
27
|
+
const transformed = orders[0];
|
|
28
|
+
return {
|
|
29
|
+
seller_id: transformed.seller.id,
|
|
30
|
+
id: transformed.id,
|
|
31
|
+
total: transformed.total,
|
|
32
|
+
currency_code: transformed.currency_code,
|
|
33
|
+
source_transaction: transformed.payment_collections[0].payment_sessions[0].data
|
|
34
|
+
.latest_charge,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const { data: sellers } = (0, core_flows_1.useQueryGraphStep)({
|
|
38
|
+
entity: "seller",
|
|
39
|
+
fields: ["*", "payout_account.*"],
|
|
40
|
+
filters: {
|
|
41
|
+
id: order.seller_id,
|
|
42
|
+
},
|
|
43
|
+
}).config({ name: "query-seller" });
|
|
44
|
+
const seller = (0, workflows_sdk_1.transform)(sellers, (sellers) => sellers[0]);
|
|
45
|
+
(0, steps_1.validateSellerPayoutAccountStep)(seller);
|
|
46
|
+
const payout_total = (0, steps_1.calculatePayoutForOrderStep)(input);
|
|
47
|
+
const { payout, err: createPayoutErr } = (0, steps_1.createPayoutStep)({
|
|
48
|
+
transaction_id: order.id,
|
|
49
|
+
amount: payout_total,
|
|
50
|
+
currency_code: order.currency_code,
|
|
51
|
+
account_id: seller.payout_account.id,
|
|
52
|
+
source_transaction: order.source_transaction,
|
|
53
|
+
});
|
|
54
|
+
(0, workflows_sdk_1.when)({ createPayoutErr }, ({ createPayoutErr }) => !createPayoutErr).then(() => {
|
|
55
|
+
(0, core_flows_1.createRemoteLinkStep)([
|
|
56
|
+
{
|
|
57
|
+
[utils_1.Modules.ORDER]: {
|
|
58
|
+
order_id: order.id,
|
|
59
|
+
},
|
|
60
|
+
[payout_1.PAYOUT_MODULE]: {
|
|
61
|
+
payout_id: payout.id,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
]);
|
|
65
|
+
(0, core_flows_1.emitEventStep)({
|
|
66
|
+
eventName: framework_1.PayoutWorkflowEvents.SUCCEEDED,
|
|
67
|
+
data: {
|
|
68
|
+
id: payout.id,
|
|
69
|
+
order_id: order.id,
|
|
70
|
+
},
|
|
71
|
+
}).config({ name: "emit-payout-succeeded" });
|
|
72
|
+
});
|
|
73
|
+
(0, workflows_sdk_1.when)({ createPayoutErr }, ({ createPayoutErr }) => createPayoutErr).then(() => {
|
|
74
|
+
(0, core_flows_1.emitEventStep)({
|
|
75
|
+
eventName: framework_1.PayoutWorkflowEvents.FAILED,
|
|
76
|
+
data: {
|
|
77
|
+
order_id: order.id,
|
|
78
|
+
},
|
|
79
|
+
}).config({ name: "emit-payout-failed" });
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvY2Vzcy1wYXlvdXQtZm9yLW9yZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL3dvcmtmbG93cy9vcmRlci93b3JrZmxvd3MvcHJvY2Vzcy1wYXlvdXQtZm9yLW9yZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUFvRDtBQUNwRCxxRUFBb0U7QUFDcEUsNERBSXFDO0FBQ3JDLDJEQUF5RDtBQUV6RCxtREFBMkQ7QUFDM0Qsb0RBQXdEO0FBRXhELG9DQUtrQjtBQU1MLFFBQUEsNkJBQTZCLEdBQUcsSUFBQSw4QkFBYyxFQUN6RCxFQUFFLElBQUksRUFBRSwwQkFBMEIsRUFBRSxFQUNwQyxVQUFVLEtBQXlDO0lBQ2pELElBQUEsNENBQW9DLEVBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBRXJELE1BQU0sRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLEd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sQ0FBQyxFQUFFO29CQUNmLFNBQVMsRUFBRSxNQUFPLENBQUMsRUFBRTtpQkFDdEI7YUFDRjtTQUNGLENBQUMsQ0FBQztRQUVILElBQUEsMEJBQWEsRUFBQztZQUNaLFNBQVMsRUFBRSxnQ0FBb0IsQ0FBQyxTQUFTO1lBQ3pDLElBQUksRUFBRTtnQkFDSixFQUFFLEVBQUUsTUFBTyxDQUFDLEVBQUU7Z0JBQ2QsUUFBUSxFQUFFLEtBQUssQ0FBQyxFQUFFO2FBQ25CO1NBQ0YsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxFQUFFLElBQUksRUFBRSx1QkFBdUIsRUFBRSxDQUFDLENBQUM7SUFDL0MsQ0FBQyxDQUNGLENBQUM7SUFFRixJQUFBLG9CQUFJLEVBQUMsRUFBRSxlQUFlLEVBQUUsRUFBRSxDQUFDLEVBQUUsZUFBZSxFQUFFLEVBQUUsRUFBRSxDQUFDLGVBQWUsQ0FBQyxDQUFDLElBQUksQ0FDdEUsR0FBRyxFQUFFO1FBQ0gsSUFBQSwwQkFBYSxFQUFDO1lBQ1osU0FBUyxFQUFFLGdDQUFvQixDQUFDLE1BQU07WUFDdEMsSUFBSSxFQUFFO2dCQUNKLFFBQVEsRUFBRSxLQUFLLENBQUMsRUFBRTthQUNuQjtTQUNGLENBQUMsQ0FBQyxNQUFNLENBQUMsRUFBRSxJQUFJLEVBQUUsb0JBQW9CLEVBQUUsQ0FBQyxDQUFDO0lBQzVDLENBQUMsQ0FDRixDQUFDO0FBQ0osQ0FBQyxDQUNGLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./workflows";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./workflows"), exports);
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL29yZGVyLXNldC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsOENBQTRCIn0=
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { OrderDetailDTO } from '@medusajs/framework/types';
|
|
2
|
+
import { FormattedOrderSetDTO, OrderSetWithOrdersDTO } from '@mercurjs/framework';
|
|
3
|
+
export declare const formatOrderSets: (orderSetsWithOrders: OrderSetWithOrdersDTO[]) => FormattedOrderSetDTO[];
|
|
4
|
+
export declare const getFulfillmentStatus: (orders: OrderDetailDTO[]) => "not_fulfilled" | "partially_fulfilled" | "fulfilled" | "partially_shipped" | "shipped" | "delivered" | "partially_delivered" | "canceled";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFulfillmentStatus = exports.formatOrderSets = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const aggregate_status_1 = require("../../order/utils/aggregate-status");
|
|
6
|
+
const formatOrderSets = (orderSetsWithOrders) => {
|
|
7
|
+
return orderSetsWithOrders.map((orderSet) => {
|
|
8
|
+
const taxTotal = orderSet.orders.reduce((acc, item) => utils_1.MathBN.add(acc, item.tax_total), utils_1.MathBN.convert(0));
|
|
9
|
+
const shippingTaxTotal = orderSet.orders.reduce((acc, order) => utils_1.MathBN.add(acc, order.shipping_tax_total), utils_1.MathBN.convert(0));
|
|
10
|
+
const shippingTotal = orderSet.orders.reduce((acc, order) => utils_1.MathBN.add(acc, order.shipping_total), utils_1.MathBN.convert(0));
|
|
11
|
+
const total = orderSet.orders.reduce((acc, order) => utils_1.MathBN.add(acc, order.total), utils_1.MathBN.convert(0));
|
|
12
|
+
const subtotal = utils_1.MathBN.sub(total, taxTotal);
|
|
13
|
+
const payment_status = getPaymentStatus(orderSet);
|
|
14
|
+
return {
|
|
15
|
+
...orderSet,
|
|
16
|
+
orders: orderSet.orders.map((order) => ({
|
|
17
|
+
...order,
|
|
18
|
+
fulfillment_status: (0, aggregate_status_1.getLastFulfillmentStatus)(order),
|
|
19
|
+
payment_status
|
|
20
|
+
})),
|
|
21
|
+
status: getStatus(orderSet.orders),
|
|
22
|
+
payment_status,
|
|
23
|
+
fulfillment_status: (0, exports.getFulfillmentStatus)(orderSet.orders),
|
|
24
|
+
tax_total: new utils_1.BigNumber(taxTotal),
|
|
25
|
+
shipping_tax_total: new utils_1.BigNumber(shippingTaxTotal),
|
|
26
|
+
shipping_total: new utils_1.BigNumber(shippingTotal),
|
|
27
|
+
total: new utils_1.BigNumber(total),
|
|
28
|
+
subtotal: new utils_1.BigNumber(subtotal)
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.formatOrderSets = formatOrderSets;
|
|
33
|
+
const getStatus = (orders) => {
|
|
34
|
+
const statuses = orders.map((order) => order.status);
|
|
35
|
+
if (statuses.every((status) => status === 'completed')) {
|
|
36
|
+
return 'completed';
|
|
37
|
+
}
|
|
38
|
+
if (statuses.every((status) => status === 'canceled')) {
|
|
39
|
+
return 'canceled';
|
|
40
|
+
}
|
|
41
|
+
if (statuses.some((status) => status === 'requires_action')) {
|
|
42
|
+
return 'requires_action';
|
|
43
|
+
}
|
|
44
|
+
return 'pending';
|
|
45
|
+
};
|
|
46
|
+
const getPaymentStatus = (orderSet) => {
|
|
47
|
+
return orderSet.payment_collection.status;
|
|
48
|
+
};
|
|
49
|
+
const getFulfillmentStatus = (orders) => {
|
|
50
|
+
const statuses = orders.map((order) => order.fulfillment_status);
|
|
51
|
+
if (statuses.every((status) => status === 'canceled')) {
|
|
52
|
+
return 'canceled';
|
|
53
|
+
}
|
|
54
|
+
if (statuses.every((status) => status === 'delivered')) {
|
|
55
|
+
return 'delivered';
|
|
56
|
+
}
|
|
57
|
+
if (statuses.every((status) => status === 'fulfilled')) {
|
|
58
|
+
return 'fulfilled';
|
|
59
|
+
}
|
|
60
|
+
if (statuses.every((status) => status === 'shipped')) {
|
|
61
|
+
return 'shipped';
|
|
62
|
+
}
|
|
63
|
+
if (statuses.some((status) => status === 'partially_delivered' || status === 'delivered')) {
|
|
64
|
+
return 'partially_delivered';
|
|
65
|
+
}
|
|
66
|
+
if (statuses.some((status) => status === 'partially_shipped' || status === 'shipped')) {
|
|
67
|
+
return 'partially_shipped';
|
|
68
|
+
}
|
|
69
|
+
if (statuses.some((status) => status === 'partially_fulfilled' || status === 'fulfilled')) {
|
|
70
|
+
return 'partially_fulfilled';
|
|
71
|
+
}
|
|
72
|
+
return 'not_fulfilled';
|
|
73
|
+
};
|
|
74
|
+
exports.getFulfillmentStatus = getFulfillmentStatus;
|
|
75
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0LW9yZGVyLXNldHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9z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QU8sbUJBQW1CLENBQUE7SUFDNUIsQ0FBQztJQUVELElBQ0UsUUFBUSxDQUFDLElBQUksQ0FDWCxDQUFDLE1BQU0sRUFBRSxFQUFFLENBQUMsTUFBTSxLQUFLLHFCQUFxQixJQUFJLE1BQU0sS0FBSyxXQUFXLENBQ3ZFLEVBQ0QsQ0FBQztRQUNELE9BQU8scUJBQXFCLENBQUE7SUFDOUIsQ0FBQztJQUVELE9BQU8sZUFBZSxDQUFBO0FBQ3hCLENBQUMsQ0FBQTtBQTVDWSxRQUFBLG9CQUFvQix3QkE0Q2hDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './format-order-sets';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./format-order-sets"), exports);
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL29yZGVyLXNldC91dGlscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsc0RBQW1DIn0=
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const getFormattedOrderSetListWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<{
|
|
2
|
+
fields?: string[];
|
|
3
|
+
filters?: Record<string, any>;
|
|
4
|
+
pagination?: {
|
|
5
|
+
skip: number;
|
|
6
|
+
take?: number;
|
|
7
|
+
order?: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
data: import("@medusajs/framework/workflows-sdk").WorkflowData<import("@mercurjs/framework").FormattedOrderSetDTO[]>;
|
|
11
|
+
metadata: ((import("@medusajs/types").RemoteQueryFunctionReturnPagination | import("@medusajs/framework/workflows-sdk").WorkflowData<import("@medusajs/types").RemoteQueryFunctionReturnPagination | undefined>) & import("@medusajs/types").RemoteQueryFunctionReturnPagination) | undefined;
|
|
12
|
+
}, []>;
|