@mercurjs/core-plugin 2.0.0-canary.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/api/admin/commission-rates/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/commission-rates/[id]/route.js +43 -0
- package/.medusa/server/src/api/admin/commission-rates/[id]/rules/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/commission-rates/[id]/rules/route.js +21 -0
- package/.medusa/server/src/api/admin/commission-rates/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/commission-rates/middlewares.js +51 -0
- package/.medusa/server/src/api/admin/commission-rates/query-config.d.ts +11 -0
- package/.medusa/server/src/api/admin/commission-rates/query-config.js +32 -0
- package/.medusa/server/src/api/admin/commission-rates/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/commission-rates/route.js +35 -0
- package/.medusa/server/src/api/admin/commission-rates/validators.d.ts +271 -0
- package/.medusa/server/src/api/admin/commission-rates/validators.js +61 -0
- package/.medusa/server/src/api/admin/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/middlewares.js +14 -0
- package/.medusa/server/src/api/admin/order-groups/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/order-groups/[id]/route.js +20 -0
- package/.medusa/server/src/api/admin/order-groups/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/order-groups/middlewares.js +23 -0
- package/.medusa/server/src/api/admin/order-groups/query-config.d.ts +11 -0
- package/.medusa/server/src/api/admin/order-groups/query-config.js +22 -0
- package/.medusa/server/src/api/admin/order-groups/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/order-groups/route.js +21 -0
- package/.medusa/server/src/api/admin/order-groups/validators.d.ts +133 -0
- package/.medusa/server/src/api/admin/order-groups/validators.js +20 -0
- package/.medusa/server/src/api/admin/payouts/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/payouts/[id]/route.js +18 -0
- package/.medusa/server/src/api/admin/payouts/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/payouts/middlewares.js +23 -0
- package/.medusa/server/src/api/admin/payouts/query-config.d.ts +11 -0
- package/.medusa/server/src/api/admin/payouts/query-config.js +29 -0
- package/.medusa/server/src/api/admin/payouts/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/payouts/route.js +21 -0
- package/.medusa/server/src/api/admin/payouts/validators.d.ts +124 -0
- package/.medusa/server/src/api/admin/payouts/validators.js +17 -0
- package/.medusa/server/src/api/admin/sellers/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/sellers/[id]/route.js +18 -0
- package/.medusa/server/src/api/admin/sellers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/sellers/middlewares.js +23 -0
- package/.medusa/server/src/api/admin/sellers/query-config.d.ts +11 -0
- package/.medusa/server/src/api/admin/sellers/query-config.js +38 -0
- package/.medusa/server/src/api/admin/sellers/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/sellers/route.js +21 -0
- package/.medusa/server/src/api/admin/sellers/validators.d.ts +133 -0
- package/.medusa/server/src/api/admin/sellers/validators.js +20 -0
- package/.medusa/server/src/api/hooks/payout/route.d.ts +2 -0
- package/.medusa/server/src/api/hooks/payout/route.js +26 -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/store/carts/[id]/complete/query-config.d.ts +5 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/query-config.js +17 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/route.d.ts +4 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/route.js +50 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/validators.d.ts +9 -0
- package/.medusa/server/src/api/store/carts/[id]/complete/validators.js +6 -0
- package/.medusa/server/src/api/store/carts/[id]/promotions/route.d.ts +3 -0
- package/.medusa/server/src/api/store/carts/[id]/promotions/route.js +23 -0
- package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.d.ts +3 -0
- package/.medusa/server/src/api/store/carts/[id]/shipping-methods/route.js +19 -0
- package/.medusa/server/src/api/store/carts/helpers.d.ts +3 -0
- package/.medusa/server/src/api/store/carts/helpers.js +147 -0
- package/.medusa/server/src/api/store/carts/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/carts/middlewares.js +16 -0
- package/.medusa/server/src/api/store/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/middlewares.js +12 -0
- package/.medusa/server/src/api/store/order-groups/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/store/order-groups/[id]/route.js +22 -0
- package/.medusa/server/src/api/store/order-groups/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/order-groups/middlewares.js +25 -0
- package/.medusa/server/src/api/store/order-groups/query-config.d.ts +13 -0
- package/.medusa/server/src/api/store/order-groups/query-config.js +32 -0
- package/.medusa/server/src/api/store/order-groups/route.d.ts +3 -0
- package/.medusa/server/src/api/store/order-groups/route.js +25 -0
- package/.medusa/server/src/api/store/order-groups/validators.d.ts +118 -0
- package/.medusa/server/src/api/store/order-groups/validators.js +15 -0
- package/.medusa/server/src/api/store/sellers/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/store/sellers/[id]/route.js +22 -0
- package/.medusa/server/src/api/store/sellers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/sellers/middlewares.js +23 -0
- package/.medusa/server/src/api/store/sellers/query-config.d.ts +13 -0
- package/.medusa/server/src/api/store/sellers/query-config.js +31 -0
- package/.medusa/server/src/api/store/sellers/route.d.ts +3 -0
- package/.medusa/server/src/api/store/sellers/route.js +25 -0
- package/.medusa/server/src/api/store/sellers/validators.d.ts +127 -0
- package/.medusa/server/src/api/store/sellers/validators.js +18 -0
- package/.medusa/server/src/api/store/shipping-options/route.d.ts +4 -0
- package/.medusa/server/src/api/store/shipping-options/route.js +17 -0
- package/.medusa/server/src/api/utils/index.d.ts +1 -0
- package/.medusa/server/src/api/utils/index.js +18 -0
- package/.medusa/server/src/api/utils/unless-base-url.d.ts +10 -0
- package/.medusa/server/src/api/utils/unless-base-url.js +20 -0
- package/.medusa/server/src/api/vendor/campaigns/[id]/promotions/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/campaigns/[id]/promotions/route.js +21 -0
- package/.medusa/server/src/api/vendor/campaigns/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/campaigns/[id]/route.js +42 -0
- package/.medusa/server/src/api/vendor/campaigns/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/campaigns/helpers.js +30 -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 +5 -0
- package/.medusa/server/src/api/vendor/campaigns/route.js +35 -0
- package/.medusa/server/src/api/vendor/campaigns/validators.d.ts +191 -0
- package/.medusa/server/src/api/vendor/campaigns/validators.js +70 -0
- package/.medusa/server/src/api/vendor/collections/[id]/products/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/collections/[id]/products/route.js +23 -0
- package/.medusa/server/src/api/vendor/collections/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/collections/[id]/route.js +25 -0
- package/.medusa/server/src/api/vendor/collections/helpers.d.ts +4 -0
- package/.medusa/server/src/api/vendor/collections/helpers.js +29 -0
- package/.medusa/server/src/api/vendor/collections/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/collections/middlewares.js +32 -0
- package/.medusa/server/src/api/vendor/collections/query-config.d.ts +9 -0
- package/.medusa/server/src/api/vendor/collections/query-config.js +20 -0
- package/.medusa/server/src/api/vendor/collections/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/collections/route.js +26 -0
- package/.medusa/server/src/api/vendor/collections/validators.d.ts +169 -0
- package/.medusa/server/src/api/vendor/collections/validators.js +19 -0
- package/.medusa/server/src/api/vendor/currencies/[code]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/currencies/[code]/route.js +19 -0
- package/.medusa/server/src/api/vendor/currencies/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/currencies/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/currencies/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/currencies/query-config.js +23 -0
- package/.medusa/server/src/api/vendor/currencies/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/currencies/route.js +21 -0
- package/.medusa/server/src/api/vendor/currencies/validators.d.ts +46 -0
- package/.medusa/server/src/api/vendor/currencies/validators.js +15 -0
- package/.medusa/server/src/api/vendor/customers/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/customers/[id]/route.js +21 -0
- package/.medusa/server/src/api/vendor/customers/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/customers/helpers.js +20 -0
- package/.medusa/server/src/api/vendor/customers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/customers/middlewares.js +33 -0
- package/.medusa/server/src/api/vendor/customers/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/customers/query-config.js +28 -0
- package/.medusa/server/src/api/vendor/customers/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/customers/route.js +21 -0
- package/.medusa/server/src/api/vendor/customers/validators.d.ts +127 -0
- package/.medusa/server/src/api/vendor/customers/validators.js +18 -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 +7 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/query-config.js +11 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/route.js +21 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/validators.d.ts +35 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/validators.js +17 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/route.js +20 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/[zone_id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/[zone_id]/route.js +61 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/[id]/service-zones/route.js +25 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/helpers.js +40 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/middlewares.js +44 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/query-config.d.ts +13 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/query-config.js +34 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/validators.d.ts +365 -0
- package/.medusa/server/src/api/vendor/fulfillment-sets/validators.js +56 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/[location_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/[location_id]/route.js +48 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/batch/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/batch/route.js +30 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/location-levels/route.js +42 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/inventory-items/[id]/route.js +42 -0
- package/.medusa/server/src/api/vendor/inventory-items/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/inventory-items/helpers.js +30 -0
- package/.medusa/server/src/api/vendor/inventory-items/location-levels/batch/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/inventory-items/location-levels/batch/route.js +22 -0
- package/.medusa/server/src/api/vendor/inventory-items/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/inventory-items/middlewares.js +100 -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 +58 -0
- package/.medusa/server/src/api/vendor/inventory-items/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/inventory-items/route.js +35 -0
- package/.medusa/server/src/api/vendor/inventory-items/validators.d.ts +773 -0
- package/.medusa/server/src/api/vendor/inventory-items/validators.js +117 -0
- package/.medusa/server/src/api/vendor/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/middlewares.js +105 -0
- package/.medusa/server/src/api/vendor/orders/[id]/cancel/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/cancel/route.js +26 -0
- package/.medusa/server/src/api/vendor/orders/[id]/changes/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/changes/route.js +21 -0
- package/.medusa/server/src/api/vendor/orders/[id]/complete/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/complete/route.js +25 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.js +27 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/mark-as-delivered/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/mark-as-delivered/route.js +26 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/shipments/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/shipments/route.js +28 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/route.js +20 -0
- package/.medusa/server/src/api/vendor/orders/[id]/preview/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/preview/route.js +15 -0
- package/.medusa/server/src/api/vendor/orders/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/[id]/route.js +19 -0
- package/.medusa/server/src/api/vendor/orders/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/orders/helpers.js +23 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.js +88 -0
- package/.medusa/server/src/api/vendor/orders/query-config.d.ts +18 -0
- package/.medusa/server/src/api/vendor/orders/query-config.js +58 -0
- package/.medusa/server/src/api/vendor/orders/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/orders/route.js +29 -0
- package/.medusa/server/src/api/vendor/orders/validators.d.ts +225 -0
- package/.medusa/server/src/api/vendor/orders/validators.js +45 -0
- package/.medusa/server/src/api/vendor/payments/[id]/capture/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/payments/[id]/capture/route.js +21 -0
- package/.medusa/server/src/api/vendor/payments/[id]/refund/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/payments/[id]/refund/route.js +21 -0
- package/.medusa/server/src/api/vendor/payments/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payments/[id]/route.js +12 -0
- package/.medusa/server/src/api/vendor/payments/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payments/helpers.js +30 -0
- package/.medusa/server/src/api/vendor/payments/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payments/middlewares.js +56 -0
- package/.medusa/server/src/api/vendor/payments/payment-providers/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payments/payment-providers/route.js +21 -0
- package/.medusa/server/src/api/vendor/payments/query-config.d.ts +18 -0
- package/.medusa/server/src/api/vendor/payments/query-config.js +37 -0
- package/.medusa/server/src/api/vendor/payments/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payments/route.js +21 -0
- package/.medusa/server/src/api/vendor/payments/validators.d.ts +174 -0
- package/.medusa/server/src/api/vendor/payments/validators.js +37 -0
- package/.medusa/server/src/api/vendor/payout-accounts/[id]/onboarding/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/payout-accounts/[id]/onboarding/route.js +26 -0
- package/.medusa/server/src/api/vendor/payout-accounts/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payout-accounts/[id]/route.js +18 -0
- package/.medusa/server/src/api/vendor/payout-accounts/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payout-accounts/helpers.js +20 -0
- package/.medusa/server/src/api/vendor/payout-accounts/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payout-accounts/middlewares.js +49 -0
- package/.medusa/server/src/api/vendor/payout-accounts/query-config.d.ts +18 -0
- package/.medusa/server/src/api/vendor/payout-accounts/query-config.js +40 -0
- package/.medusa/server/src/api/vendor/payout-accounts/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/payout-accounts/route.js +40 -0
- package/.medusa/server/src/api/vendor/payout-accounts/validators.d.ts +52 -0
- package/.medusa/server/src/api/vendor/payout-accounts/validators.js +23 -0
- package/.medusa/server/src/api/vendor/payouts/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payouts/[id]/route.js +21 -0
- package/.medusa/server/src/api/vendor/payouts/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payouts/helpers.js +20 -0
- package/.medusa/server/src/api/vendor/payouts/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payouts/middlewares.js +33 -0
- package/.medusa/server/src/api/vendor/payouts/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/payouts/query-config.js +24 -0
- package/.medusa/server/src/api/vendor/payouts/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payouts/route.js +21 -0
- package/.medusa/server/src/api/vendor/payouts/validators.d.ts +118 -0
- package/.medusa/server/src/api/vendor/payouts/validators.js +15 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/batch/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/batch/route.js +48 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/prices/route.js +27 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/products/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/products/route.js +31 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/price-lists/[id]/route.js +40 -0
- package/.medusa/server/src/api/vendor/price-lists/helpers.d.ts +5 -0
- package/.medusa/server/src/api/vendor/price-lists/helpers.js +71 -0
- package/.medusa/server/src/api/vendor/price-lists/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/price-lists/middlewares.js +111 -0
- package/.medusa/server/src/api/vendor/price-lists/query-config.d.ts +14 -0
- package/.medusa/server/src/api/vendor/price-lists/query-config.js +44 -0
- package/.medusa/server/src/api/vendor/price-lists/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/price-lists/route.js +40 -0
- package/.medusa/server/src/api/vendor/price-lists/validators.d.ts +285 -0
- package/.medusa/server/src/api/vendor/price-lists/validators.js +58 -0
- package/.medusa/server/src/api/vendor/price-preferences/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/price-preferences/[id]/route.js +20 -0
- package/.medusa/server/src/api/vendor/price-preferences/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/price-preferences/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/price-preferences/query-config.d.ts +10 -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 +3 -0
- package/.medusa/server/src/api/vendor/price-preferences/route.js +21 -0
- package/.medusa/server/src/api/vendor/price-preferences/validators.d.ts +43 -0
- package/.medusa/server/src/api/vendor/price-preferences/validators.js +16 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +27 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/route.js +20 -0
- package/.medusa/server/src/api/vendor/product-categories/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-categories/helpers.js +24 -0
- package/.medusa/server/src/api/vendor/product-categories/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-categories/middlewares.js +65 -0
- package/.medusa/server/src/api/vendor/product-categories/query-config.d.ts +9 -0
- package/.medusa/server/src/api/vendor/product-categories/query-config.js +27 -0
- package/.medusa/server/src/api/vendor/product-categories/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/product-categories/route.js +21 -0
- package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +58 -0
- package/.medusa/server/src/api/vendor/product-categories/validators.js +22 -0
- package/.medusa/server/src/api/vendor/product-tags/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/product-tags/[id]/route.js +20 -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 +3 -0
- package/.medusa/server/src/api/vendor/product-tags/route.js +21 -0
- package/.medusa/server/src/api/vendor/product-tags/validators.d.ts +60 -0
- package/.medusa/server/src/api/vendor/product-tags/validators.js +19 -0
- package/.medusa/server/src/api/vendor/product-types/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/product-types/[id]/route.js +20 -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 +3 -0
- package/.medusa/server/src/api/vendor/product-types/route.js +21 -0
- package/.medusa/server/src/api/vendor/product-types/validators.d.ts +40 -0
- package/.medusa/server/src/api/vendor/product-types/validators.js +15 -0
- package/.medusa/server/src/api/vendor/product-variants/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-variants/middlewares.js +26 -0
- package/.medusa/server/src/api/vendor/product-variants/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/product-variants/query-config.js +41 -0
- package/.medusa/server/src/api/vendor/product-variants/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/product-variants/route.js +21 -0
- package/.medusa/server/src/api/vendor/product-variants/validators.d.ts +128 -0
- package/.medusa/server/src/api/vendor/product-variants/validators.js +20 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/[option_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/[option_id]/route.js +43 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/products/[id]/options/route.js +34 -0
- package/.medusa/server/src/api/vendor/products/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/products/[id]/route.js +58 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +57 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +55 -0
- package/.medusa/server/src/api/vendor/products/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/products/helpers.js +20 -0
- package/.medusa/server/src/api/vendor/products/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/products/middlewares.js +112 -0
- package/.medusa/server/src/api/vendor/products/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/products/query-config.js +61 -0
- package/.medusa/server/src/api/vendor/products/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/products/route.js +43 -0
- package/.medusa/server/src/api/vendor/products/validators.d.ts +2192 -0
- package/.medusa/server/src/api/vendor/products/validators.js +168 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/[rule_type]/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/[rule_type]/route.js +103 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/buy-rules/batch/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/buy-rules/batch/route.js +23 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/route.js +42 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/rules/batch/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/rules/batch/route.js +23 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/target-rules/batch/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/promotions/[id]/target-rules/batch/route.js +23 -0
- package/.medusa/server/src/api/vendor/promotions/helpers.d.ts +13 -0
- package/.medusa/server/src/api/vendor/promotions/helpers.js +70 -0
- package/.medusa/server/src/api/vendor/promotions/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/promotions/middlewares.js +100 -0
- package/.medusa/server/src/api/vendor/promotions/query-config.d.ts +29 -0
- package/.medusa/server/src/api/vendor/promotions/query-config.js +60 -0
- package/.medusa/server/src/api/vendor/promotions/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/promotions/route.js +35 -0
- package/.medusa/server/src/api/vendor/promotions/rule-attribute-options/[rule_type]/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/promotions/rule-attribute-options/[rule_type]/route.js +18 -0
- package/.medusa/server/src/api/vendor/promotions/rule-value-options/[rule_type]/[rule_attribute_id]/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/promotions/rule-value-options/[rule_type]/[rule_attribute_id]/route.js +54 -0
- package/.medusa/server/src/api/vendor/promotions/utils/index.d.ts +5 -0
- package/.medusa/server/src/api/vendor/promotions/utils/index.js +22 -0
- package/.medusa/server/src/api/vendor/promotions/utils/operators-map.d.ts +18 -0
- package/.medusa/server/src/api/vendor/promotions/utils/operators-map.js +22 -0
- package/.medusa/server/src/api/vendor/promotions/utils/rule-attributes-map.d.ts +11 -0
- package/.medusa/server/src/api/vendor/promotions/utils/rule-attributes-map.js +155 -0
- package/.medusa/server/src/api/vendor/promotions/utils/rule-query-configuration.d.ts +5 -0
- package/.medusa/server/src/api/vendor/promotions/utils/rule-query-configuration.js +61 -0
- package/.medusa/server/src/api/vendor/promotions/utils/validate-rule-attribute.d.ts +8 -0
- package/.medusa/server/src/api/vendor/promotions/utils/validate-rule-attribute.js +18 -0
- package/.medusa/server/src/api/vendor/promotions/utils/validate-rule-type.d.ts +1 -0
- package/.medusa/server/src/api/vendor/promotions/utils/validate-rule-type.js +12 -0
- package/.medusa/server/src/api/vendor/promotions/validators.d.ts +1082 -0
- package/.medusa/server/src/api/vendor/promotions/validators.js +134 -0
- package/.medusa/server/src/api/vendor/refund-reasons/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/refund-reasons/[id]/route.js +20 -0
- package/.medusa/server/src/api/vendor/refund-reasons/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/refund-reasons/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/refund-reasons/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/refund-reasons/query-config.js +22 -0
- package/.medusa/server/src/api/vendor/refund-reasons/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/refund-reasons/route.js +21 -0
- package/.medusa/server/src/api/vendor/refund-reasons/validators.d.ts +121 -0
- package/.medusa/server/src/api/vendor/refund-reasons/validators.js +16 -0
- package/.medusa/server/src/api/vendor/regions/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/regions/[id]/route.js +18 -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 +24 -0
- package/.medusa/server/src/api/vendor/regions/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/regions/route.js +21 -0
- package/.medusa/server/src/api/vendor/regions/validators.d.ts +127 -0
- package/.medusa/server/src/api/vendor/regions/validators.js +18 -0
- package/.medusa/server/src/api/vendor/return-reasons/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/return-reasons/[id]/route.js +20 -0
- package/.medusa/server/src/api/vendor/return-reasons/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/return-reasons/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/return-reasons/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/return-reasons/query-config.js +28 -0
- package/.medusa/server/src/api/vendor/return-reasons/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/return-reasons/route.js +21 -0
- package/.medusa/server/src/api/vendor/return-reasons/validators.d.ts +133 -0
- package/.medusa/server/src/api/vendor/return-reasons/validators.js +22 -0
- package/.medusa/server/src/api/vendor/returns/[id]/cancel/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/returns/[id]/cancel/route.js +19 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/[action_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/[action_id]/route.js +56 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/returns/[id]/dismiss-items/route.js +28 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/confirm/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/confirm/route.js +31 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive/route.js +51 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/[action_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/[action_id]/route.js +56 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/returns/[id]/receive-items/route.js +28 -0
- package/.medusa/server/src/api/vendor/returns/[id]/request/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/request/route.js +46 -0
- package/.medusa/server/src/api/vendor/returns/[id]/request-items/[action_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/request-items/[action_id]/route.js +56 -0
- package/.medusa/server/src/api/vendor/returns/[id]/request-items/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/returns/[id]/request-items/route.js +28 -0
- package/.medusa/server/src/api/vendor/returns/[id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/route.js +45 -0
- package/.medusa/server/src/api/vendor/returns/[id]/shipping-method/[action_id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/[id]/shipping-method/[action_id]/route.js +56 -0
- package/.medusa/server/src/api/vendor/returns/[id]/shipping-method/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/returns/[id]/shipping-method/route.js +28 -0
- package/.medusa/server/src/api/vendor/returns/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/returns/helpers.js +21 -0
- package/.medusa/server/src/api/vendor/returns/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/returns/middlewares.js +189 -0
- package/.medusa/server/src/api/vendor/returns/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/returns/query-config.js +38 -0
- package/.medusa/server/src/api/vendor/returns/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/returns/route.js +52 -0
- package/.medusa/server/src/api/vendor/returns/validators.d.ts +439 -0
- package/.medusa/server/src/api/vendor/returns/validators.js +91 -0
- package/.medusa/server/src/api/vendor/sales-channels/[id]/products/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/sales-channels/[id]/products/route.js +24 -0
- package/.medusa/server/src/api/vendor/sales-channels/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/sales-channels/[id]/route.js +20 -0
- package/.medusa/server/src/api/vendor/sales-channels/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/sales-channels/helpers.js +14 -0
- package/.medusa/server/src/api/vendor/sales-channels/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/sales-channels/middlewares.js +32 -0
- package/.medusa/server/src/api/vendor/sales-channels/query-config.d.ts +10 -0
- package/.medusa/server/src/api/vendor/sales-channels/query-config.js +22 -0
- package/.medusa/server/src/api/vendor/sales-channels/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/sales-channels/route.js +21 -0
- package/.medusa/server/src/api/vendor/sales-channels/validators.d.ts +43 -0
- package/.medusa/server/src/api/vendor/sales-channels/validators.js +16 -0
- package/.medusa/server/src/api/vendor/sellers/me/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/sellers/me/route.js +32 -0
- package/.medusa/server/src/api/vendor/sellers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/sellers/middlewares.js +32 -0
- package/.medusa/server/src/api/vendor/sellers/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/sellers/query-config.js +32 -0
- package/.medusa/server/src/api/vendor/sellers/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/sellers/route.js +22 -0
- package/.medusa/server/src/api/vendor/sellers/validators.d.ts +112 -0
- package/.medusa/server/src/api/vendor/sellers/validators.js +43 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/[id]/route.js +14 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/helpers.js +15 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/middlewares.js +23 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/query-config.js +23 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/route.js +21 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/validators.d.ts +130 -0
- package/.medusa/server/src/api/vendor/shipping-option-types/validators.js +19 -0
- package/.medusa/server/src/api/vendor/shipping-options/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/shipping-options/[id]/route.js +46 -0
- package/.medusa/server/src/api/vendor/shipping-options/[id]/rules/batch/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/shipping-options/[id]/rules/batch/route.js +26 -0
- package/.medusa/server/src/api/vendor/shipping-options/helpers.d.ts +12 -0
- package/.medusa/server/src/api/vendor/shipping-options/helpers.js +64 -0
- package/.medusa/server/src/api/vendor/shipping-options/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/shipping-options/middlewares.js +63 -0
- package/.medusa/server/src/api/vendor/shipping-options/query-config.d.ts +22 -0
- package/.medusa/server/src/api/vendor/shipping-options/query-config.js +47 -0
- package/.medusa/server/src/api/vendor/shipping-options/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/shipping-options/route.js +35 -0
- package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +860 -0
- package/.medusa/server/src/api/vendor/shipping-options/validators.js +130 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/[id]/route.js +38 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/helpers.js +30 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/middlewares.js +54 -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 +5 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/route.js +35 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +155 -0
- package/.medusa/server/src/api/vendor/shipping-profiles/validators.js +32 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-providers/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-providers/route.js +30 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-sets/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/fulfillment-sets/route.js +23 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/route.js +43 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/sales-channels/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/stock-locations/[id]/sales-channels/route.js +22 -0
- package/.medusa/server/src/api/vendor/stock-locations/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/stock-locations/helpers.js +30 -0
- package/.medusa/server/src/api/vendor/stock-locations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/stock-locations/middlewares.js +79 -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 +5 -0
- package/.medusa/server/src/api/vendor/stock-locations/route.js +35 -0
- package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +287 -0
- package/.medusa/server/src/api/vendor/stock-locations/validators.js +47 -0
- package/.medusa/server/src/api/vendor/stores/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/stores/middlewares.js +16 -0
- package/.medusa/server/src/api/vendor/stores/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/stores/query-config.js +26 -0
- package/.medusa/server/src/api/vendor/stores/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/stores/route.js +21 -0
- package/.medusa/server/src/api/vendor/stores/validators.d.ts +40 -0
- package/.medusa/server/src/api/vendor/stores/validators.js +15 -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/links/campaign-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/campaign-seller-link.js +10 -0
- package/.medusa/server/src/links/inventory-item-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/inventory-item-seller-link.js +10 -0
- package/.medusa/server/src/links/line-item-commission-line-link.d.ts +2 -0
- package/.medusa/server/src/links/line-item-commission-line-link.js +21 -0
- package/.medusa/server/src/links/order-group-cart-link.d.ts +2 -0
- package/.medusa/server/src/links/order-group-cart-link.js +15 -0
- package/.medusa/server/src/links/order-group-order-link.d.ts +2 -0
- package/.medusa/server/src/links/order-group-order-link.js +14 -0
- package/.medusa/server/src/links/order-payout-link.d.ts +2 -0
- package/.medusa/server/src/links/order-payout-link.js +13 -0
- package/.medusa/server/src/links/order-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/order-seller-link.js +10 -0
- package/.medusa/server/src/links/payout-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/payout-seller-link.js +13 -0
- package/.medusa/server/src/links/price-list-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/price-list-seller-link.js +10 -0
- package/.medusa/server/src/links/product-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/product-seller-link.js +10 -0
- package/.medusa/server/src/links/promotion-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/promotion-seller-link.js +10 -0
- package/.medusa/server/src/links/seller-customer-link.d.ts +2 -0
- package/.medusa/server/src/links/seller-customer-link.js +10 -0
- package/.medusa/server/src/links/seller-payout-account-link.d.ts +2 -0
- package/.medusa/server/src/links/seller-payout-account-link.js +10 -0
- package/.medusa/server/src/links/shipping-option-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/shipping-option-seller-link.js +10 -0
- package/.medusa/server/src/links/shipping-profile-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/shipping-profile-seller-link.js +10 -0
- package/.medusa/server/src/links/stock-location-seller-link.d.ts +2 -0
- package/.medusa/server/src/links/stock-location-seller-link.js +10 -0
- package/.medusa/server/src/modules/commission/index.d.ts +49 -0
- package/.medusa/server/src/modules/commission/index.js +12 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20260130132817.d.ts +5 -0
- package/.medusa/server/src/modules/commission/migrations/Migration20260130132817.js +26 -0
- package/.medusa/server/src/modules/commission/models/commission-line.d.ts +10 -0
- package/.medusa/server/src/modules/commission/models/commission-line.js +14 -0
- package/.medusa/server/src/modules/commission/models/commission-rate.d.ts +21 -0
- package/.medusa/server/src/modules/commission/models/commission-rate.js +26 -0
- package/.medusa/server/src/modules/commission/models/commission-rule.d.ts +20 -0
- package/.medusa/server/src/modules/commission/models/commission-rule.js +17 -0
- package/.medusa/server/src/modules/commission/models/index.d.ts +3 -0
- package/.medusa/server/src/modules/commission/models/index.js +13 -0
- package/.medusa/server/src/modules/commission/service.d.ts +63 -0
- package/.medusa/server/src/modules/commission/service.js +184 -0
- package/.medusa/server/src/modules/payout/index.d.ts +77 -0
- package/.medusa/server/src/modules/payout/index.js +14 -0
- package/.medusa/server/src/modules/payout/loaders/provider.d.ts +5 -0
- package/.medusa/server/src/modules/payout/loaders/provider.js +28 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20260130132816.d.ts +5 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20260130132816.js +42 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20260216152209.d.ts +5 -0
- package/.medusa/server/src/modules/payout/migrations/Migration20260216152209.js +14 -0
- package/.medusa/server/src/modules/payout/models/balance.d.ts +53 -0
- package/.medusa/server/src/modules/payout/models/balance.js +35 -0
- package/.medusa/server/src/modules/payout/models/index.d.ts +5 -0
- package/.medusa/server/src/modules/payout/models/index.js +14 -0
- package/.medusa/server/src/modules/payout/models/onboarding.d.ts +35 -0
- package/.medusa/server/src/modules/payout/models/onboarding.js +14 -0
- package/.medusa/server/src/modules/payout/models/payout-account.d.ts +41 -0
- package/.medusa/server/src/modules/payout/models/payout-account.js +28 -0
- package/.medusa/server/src/modules/payout/models/payout.d.ts +41 -0
- package/.medusa/server/src/modules/payout/models/payout.js +18 -0
- package/.medusa/server/src/modules/payout/models/transaction.d.ts +40 -0
- package/.medusa/server/src/modules/payout/models/transaction.js +26 -0
- package/.medusa/server/src/modules/payout/providers/index.d.ts +1 -0
- package/.medusa/server/src/modules/payout/providers/index.js +6 -0
- package/.medusa/server/src/modules/payout/providers/system.d.ts +8 -0
- package/.medusa/server/src/modules/payout/providers/system.js +32 -0
- package/.medusa/server/src/modules/payout/services/index.d.ts +2 -0
- package/.medusa/server/src/modules/payout/services/index.js +24 -0
- package/.medusa/server/src/modules/payout/services/payout-module-service.d.ts +220 -0
- package/.medusa/server/src/modules/payout/services/payout-module-service.js +278 -0
- package/.medusa/server/src/modules/payout/services/provider-service.d.ts +17 -0
- package/.medusa/server/src/modules/payout/services/provider-service.js +32 -0
- package/.medusa/server/src/modules/payout/utils/calculate-payout-transactions.d.ts +10 -0
- package/.medusa/server/src/modules/payout/utils/calculate-payout-transactions.js +17 -0
- package/.medusa/server/src/modules/payout/utils/index.d.ts +1 -0
- package/.medusa/server/src/modules/payout/utils/index.js +18 -0
- package/.medusa/server/src/modules/seller/index.d.ts +35 -0
- package/.medusa/server/src/modules/seller/index.js +12 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260123112516.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260123112516.js +20 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260126130937.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260126130937.js +18 -0
- package/.medusa/server/src/modules/seller/models/index.d.ts +2 -0
- package/.medusa/server/src/modules/seller/models/index.js +11 -0
- package/.medusa/server/src/modules/seller/models/order-group.d.ts +8 -0
- package/.medusa/server/src/modules/seller/models/order-group.js +12 -0
- package/.medusa/server/src/modules/seller/models/seller.d.ts +18 -0
- package/.medusa/server/src/modules/seller/models/seller.js +22 -0
- package/.medusa/server/src/modules/seller/repositories/index.d.ts +1 -0
- package/.medusa/server/src/modules/seller/repositories/index.js +6 -0
- package/.medusa/server/src/modules/seller/repositories/order-group.d.ts +17 -0
- package/.medusa/server/src/modules/seller/repositories/order-group.js +179 -0
- package/.medusa/server/src/modules/seller/service.d.ts +80 -0
- package/.medusa/server/src/modules/seller/service.js +129 -0
- package/.medusa/server/src/subscribers/payout-webhook.d.ts +4 -0
- package/.medusa/server/src/subscribers/payout-webhook.js +27 -0
- package/.medusa/server/src/workflows/campaign/index.d.ts +2 -0
- package/.medusa/server/src/workflows/campaign/index.js +19 -0
- package/.medusa/server/src/workflows/campaign/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/campaign/steps/index.js +18 -0
- package/.medusa/server/src/workflows/campaign/steps/link-seller-campaign.d.ts +6 -0
- package/.medusa/server/src/workflows/campaign/steps/link-seller-campaign.js +36 -0
- package/.medusa/server/src/workflows/campaign/workflows/create-seller-campaigns.d.ts +7 -0
- package/.medusa/server/src/workflows/campaign/workflows/create-seller-campaigns.js +20 -0
- package/.medusa/server/src/workflows/campaign/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/campaign/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/index.d.ts +2 -0
- package/.medusa/server/src/workflows/cart/steps/index.js +19 -0
- package/.medusa/server/src/workflows/cart/steps/prepare-adjustments-from-promotion-actions.d.ts +6 -0
- package/.medusa/server/src/workflows/cart/steps/prepare-adjustments-from-promotion-actions.js +106 -0
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-items.d.ts +15 -0
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-items.js +17 -0
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-shipping.d.ts +18 -0
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-shipping.js +18 -0
- package/.medusa/server/src/workflows/cart/utils/fields.d.ts +3 -0
- package/.medusa/server/src/workflows/cart/utils/fields.js +154 -0
- package/.medusa/server/src/workflows/cart/utils/index.d.ts +4 -0
- package/.medusa/server/src/workflows/cart/utils/index.js +21 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-confirm-inventory-input.d.ts +28 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-confirm-inventory-input.js +165 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.d.ts +71 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.js +90 -0
- package/.medusa/server/src/workflows/cart/utils/schemas.d.ts +3 -0
- package/.medusa/server/src/workflows/cart/utils/schemas.js +7 -0
- package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.d.ts +7 -0
- package/.medusa/server/src/workflows/cart/workflows/add-seller-shipping-method-to-cart.js +130 -0
- package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.d.ts +13 -0
- package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.js +379 -0
- package/.medusa/server/src/workflows/cart/workflows/index.d.ts +4 -0
- package/.medusa/server/src/workflows/cart/workflows/index.js +21 -0
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.d.ts +21 -0
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.js +217 -0
- package/.medusa/server/src/workflows/cart/workflows/update-cart-seller-promotions.d.ts +5 -0
- package/.medusa/server/src/workflows/cart/workflows/update-cart-seller-promotions.js +74 -0
- package/.medusa/server/src/workflows/commission/index.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/index.js +19 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-rates.d.ts +30 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-rates.js +17 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-rules.d.ts +34 -0
- package/.medusa/server/src/workflows/commission/steps/create-commission-rules.js +21 -0
- package/.medusa/server/src/workflows/commission/steps/delete-commission-rates.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/steps/delete-commission-rates.js +17 -0
- package/.medusa/server/src/workflows/commission/steps/delete-commission-rules.d.ts +2 -0
- package/.medusa/server/src/workflows/commission/steps/delete-commission-rules.js +24 -0
- package/.medusa/server/src/workflows/commission/steps/get-commission-lines.d.ts +3 -0
- package/.medusa/server/src/workflows/commission/steps/get-commission-lines.js +15 -0
- package/.medusa/server/src/workflows/commission/steps/index.d.ts +8 -0
- package/.medusa/server/src/workflows/commission/steps/index.js +25 -0
- package/.medusa/server/src/workflows/commission/steps/update-commission-rates.d.ts +30 -0
- package/.medusa/server/src/workflows/commission/steps/update-commission-rates.js +17 -0
- package/.medusa/server/src/workflows/commission/steps/update-commission-rules.d.ts +30 -0
- package/.medusa/server/src/workflows/commission/steps/update-commission-rules.js +24 -0
- package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.d.ts +7 -0
- package/.medusa/server/src/workflows/commission/steps/upsert-commission-lines.js +12 -0
- package/.medusa/server/src/workflows/commission/workflows/batch-commission-rules.d.ts +9 -0
- package/.medusa/server/src/workflows/commission/workflows/batch-commission-rules.js +19 -0
- package/.medusa/server/src/workflows/commission/workflows/create-commission-rates.d.ts +30 -0
- package/.medusa/server/src/workflows/commission/workflows/create-commission-rates.js +11 -0
- package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.d.ts +8 -0
- package/.medusa/server/src/workflows/commission/workflows/delete-commission-rates.js +16 -0
- package/.medusa/server/src/workflows/commission/workflows/index.d.ts +5 -0
- package/.medusa/server/src/workflows/commission/workflows/index.js +22 -0
- package/.medusa/server/src/workflows/commission/workflows/refresh-order-commission-lines.d.ts +6 -0
- package/.medusa/server/src/workflows/commission/workflows/refresh-order-commission-lines.js +79 -0
- package/.medusa/server/src/workflows/commission/workflows/update-commission-rates.d.ts +30 -0
- package/.medusa/server/src/workflows/commission/workflows/update-commission-rates.js +11 -0
- package/.medusa/server/src/workflows/events.d.ts +17 -0
- package/.medusa/server/src/workflows/events.js +21 -0
- package/.medusa/server/src/workflows/hooks/product-created.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-created.js +68 -0
- package/.medusa/server/src/workflows/hooks/product-variant-created.d.ts +1 -0
- package/.medusa/server/src/workflows/hooks/product-variant-created.js +50 -0
- package/.medusa/server/src/workflows/index.d.ts +13 -0
- package/.medusa/server/src/workflows/index.js +30 -0
- package/.medusa/server/src/workflows/inventory-item/index.d.ts +2 -0
- package/.medusa/server/src/workflows/inventory-item/index.js +19 -0
- package/.medusa/server/src/workflows/inventory-item/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/inventory-item/steps/index.js +18 -0
- package/.medusa/server/src/workflows/inventory-item/steps/link-seller-inventory-item.d.ts +6 -0
- package/.medusa/server/src/workflows/inventory-item/steps/link-seller-inventory-item.js +36 -0
- package/.medusa/server/src/workflows/inventory-item/workflows/create-seller-inventory-items.d.ts +7 -0
- package/.medusa/server/src/workflows/inventory-item/workflows/create-seller-inventory-items.js +20 -0
- package/.medusa/server/src/workflows/inventory-item/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/inventory-item/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/order-group/index.d.ts +1 -0
- package/.medusa/server/src/workflows/order-group/index.js +18 -0
- package/.medusa/server/src/workflows/order-group/steps/create-order-group.d.ts +11 -0
- package/.medusa/server/src/workflows/order-group/steps/create-order-group.js +17 -0
- package/.medusa/server/src/workflows/order-group/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/order-group/steps/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/add-payout-transactions.d.ts +11 -0
- package/.medusa/server/src/workflows/payout/steps/add-payout-transactions.js +24 -0
- package/.medusa/server/src/workflows/payout/steps/create-onboarding.d.ts +2 -0
- package/.medusa/server/src/workflows/payout/steps/create-onboarding.js +11 -0
- package/.medusa/server/src/workflows/payout/steps/create-payout-account.d.ts +2 -0
- package/.medusa/server/src/workflows/payout/steps/create-payout-account.js +11 -0
- package/.medusa/server/src/workflows/payout/steps/create-payout.d.ts +3 -0
- package/.medusa/server/src/workflows/payout/steps/create-payout.js +12 -0
- package/.medusa/server/src/workflows/payout/steps/index.d.ts +6 -0
- package/.medusa/server/src/workflows/payout/steps/index.js +23 -0
- package/.medusa/server/src/workflows/payout/steps/update-payout-account.d.ts +58 -0
- package/.medusa/server/src/workflows/payout/steps/update-payout-account.js +27 -0
- package/.medusa/server/src/workflows/payout/steps/update-payout.d.ts +58 -0
- package/.medusa/server/src/workflows/payout/steps/update-payout.js +27 -0
- package/.medusa/server/src/workflows/payout/workflows/create-onboarding.d.ts +2 -0
- package/.medusa/server/src/workflows/payout/workflows/create-onboarding.js +10 -0
- package/.medusa/server/src/workflows/payout/workflows/create-payout-account.d.ts +6 -0
- package/.medusa/server/src/workflows/payout/workflows/create-payout-account.js +25 -0
- package/.medusa/server/src/workflows/payout/workflows/create-payout.d.ts +3 -0
- package/.medusa/server/src/workflows/payout/workflows/create-payout.js +50 -0
- package/.medusa/server/src/workflows/payout/workflows/credit-order-to-payout-account.d.ts +9 -0
- package/.medusa/server/src/workflows/payout/workflows/credit-order-to-payout-account.js +45 -0
- package/.medusa/server/src/workflows/payout/workflows/index.d.ts +5 -0
- package/.medusa/server/src/workflows/payout/workflows/index.js +22 -0
- package/.medusa/server/src/workflows/payout/workflows/process-payout.d.ts +5 -0
- package/.medusa/server/src/workflows/payout/workflows/process-payout.js +67 -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/link-seller-price-list.d.ts +6 -0
- package/.medusa/server/src/workflows/price-list/steps/link-seller-price-list.js +36 -0
- package/.medusa/server/src/workflows/price-list/workflows/create-seller-price-lists.d.ts +7 -0
- package/.medusa/server/src/workflows/price-list/workflows/create-seller-price-lists.js +20 -0
- package/.medusa/server/src/workflows/price-list/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/price-list/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/promotion/index.d.ts +2 -0
- package/.medusa/server/src/workflows/promotion/index.js +19 -0
- package/.medusa/server/src/workflows/promotion/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/promotion/steps/index.js +19 -0
- package/.medusa/server/src/workflows/promotion/steps/link-seller-promotion.d.ts +6 -0
- package/.medusa/server/src/workflows/promotion/steps/link-seller-promotion.js +36 -0
- package/.medusa/server/src/workflows/promotion/steps/register-usage.d.ts +11 -0
- package/.medusa/server/src/workflows/promotion/steps/register-usage.js +27 -0
- package/.medusa/server/src/workflows/promotion/workflows/create-seller-promotions.d.ts +7 -0
- package/.medusa/server/src/workflows/promotion/workflows/create-seller-promotions.js +20 -0
- package/.medusa/server/src/workflows/promotion/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/promotion/workflows/index.js +18 -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-seller.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/create-seller.js +17 -0
- package/.medusa/server/src/workflows/seller/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/index.js +19 -0
- package/.medusa/server/src/workflows/seller/steps/update-seller.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/steps/update-seller.js +20 -0
- package/.medusa/server/src/workflows/seller/workflows/create-seller.d.ts +7 -0
- package/.medusa/server/src/workflows/seller/workflows/create-seller.js +16 -0
- package/.medusa/server/src/workflows/seller/workflows/index.d.ts +2 -0
- package/.medusa/server/src/workflows/seller/workflows/index.js +19 -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/shipping-option/index.d.ts +2 -0
- package/.medusa/server/src/workflows/shipping-option/index.js +19 -0
- package/.medusa/server/src/workflows/shipping-option/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/shipping-option/steps/index.js +18 -0
- package/.medusa/server/src/workflows/shipping-option/steps/link-seller-shipping-option.d.ts +6 -0
- package/.medusa/server/src/workflows/shipping-option/steps/link-seller-shipping-option.js +36 -0
- package/.medusa/server/src/workflows/shipping-option/workflows/create-seller-shipping-options.d.ts +7 -0
- package/.medusa/server/src/workflows/shipping-option/workflows/create-seller-shipping-options.js +18 -0
- package/.medusa/server/src/workflows/shipping-option/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/shipping-option/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/shipping-profile/index.d.ts +2 -0
- package/.medusa/server/src/workflows/shipping-profile/index.js +19 -0
- package/.medusa/server/src/workflows/shipping-profile/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/shipping-profile/steps/index.js +18 -0
- package/.medusa/server/src/workflows/shipping-profile/steps/link-seller-shipping-profile.d.ts +6 -0
- package/.medusa/server/src/workflows/shipping-profile/steps/link-seller-shipping-profile.js +36 -0
- package/.medusa/server/src/workflows/shipping-profile/workflows/create-seller-shipping-profiles.d.ts +7 -0
- package/.medusa/server/src/workflows/shipping-profile/workflows/create-seller-shipping-profiles.js +20 -0
- package/.medusa/server/src/workflows/shipping-profile/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/shipping-profile/workflows/index.js +18 -0
- package/.medusa/server/src/workflows/stock-location/index.d.ts +2 -0
- package/.medusa/server/src/workflows/stock-location/index.js +19 -0
- package/.medusa/server/src/workflows/stock-location/steps/index.d.ts +1 -0
- package/.medusa/server/src/workflows/stock-location/steps/index.js +18 -0
- package/.medusa/server/src/workflows/stock-location/steps/link-seller-stock-location.d.ts +6 -0
- package/.medusa/server/src/workflows/stock-location/steps/link-seller-stock-location.js +36 -0
- package/.medusa/server/src/workflows/stock-location/workflows/create-seller-stock-locations.d.ts +7 -0
- package/.medusa/server/src/workflows/stock-location/workflows/create-seller-stock-locations.js +20 -0
- package/.medusa/server/src/workflows/stock-location/workflows/index.d.ts +1 -0
- package/.medusa/server/src/workflows/stock-location/workflows/index.js +18 -0
- package/package.json +78 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UpdateCommissionRuleDTO } from "@mercurjs/types";
|
|
2
|
+
export declare const updateCommissionRulesStepId = "update-commission-rules-step";
|
|
3
|
+
export declare const updateCommissionRulesStep: import("@medusajs/framework/workflows-sdk").StepFunction<UpdateCommissionRuleDTO[], {
|
|
4
|
+
id: string;
|
|
5
|
+
reference: string;
|
|
6
|
+
reference_id: string;
|
|
7
|
+
commission_rate: {
|
|
8
|
+
id: string;
|
|
9
|
+
is_enabled: boolean;
|
|
10
|
+
priority: number;
|
|
11
|
+
currency_code: string | null;
|
|
12
|
+
name: string;
|
|
13
|
+
code: string;
|
|
14
|
+
type: import("@mercurjs/types").CommissionRateType;
|
|
15
|
+
target: import("@mercurjs/types").CommissionRateTarget;
|
|
16
|
+
value: number;
|
|
17
|
+
min_amount: number | null;
|
|
18
|
+
include_tax: boolean;
|
|
19
|
+
rules: /*elided*/ any[];
|
|
20
|
+
raw_value: Record<string, unknown>;
|
|
21
|
+
raw_min_amount: Record<string, unknown> | null;
|
|
22
|
+
created_at: Date;
|
|
23
|
+
updated_at: Date;
|
|
24
|
+
deleted_at: Date | null;
|
|
25
|
+
};
|
|
26
|
+
created_at: Date;
|
|
27
|
+
updated_at: Date;
|
|
28
|
+
deleted_at: Date | null;
|
|
29
|
+
commission_rate_id: string;
|
|
30
|
+
}[]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateCommissionRulesStep = exports.updateCommissionRulesStepId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const types_1 = require("@mercurjs/types");
|
|
6
|
+
exports.updateCommissionRulesStepId = "update-commission-rules-step";
|
|
7
|
+
exports.updateCommissionRulesStep = (0, workflows_sdk_1.createStep)(exports.updateCommissionRulesStepId, async (input, { container }) => {
|
|
8
|
+
const commissionService = container.resolve(types_1.MercurModules.COMMISSION);
|
|
9
|
+
const previousRules = await commissionService.listCommissionRules({
|
|
10
|
+
id: input.map((rule) => rule.id),
|
|
11
|
+
});
|
|
12
|
+
const commissionRules = await commissionService.updateCommissionRules(input);
|
|
13
|
+
return new workflows_sdk_1.StepResponse(commissionRules, previousRules);
|
|
14
|
+
}, async (previousRules, { container }) => {
|
|
15
|
+
if (!previousRules?.length)
|
|
16
|
+
return;
|
|
17
|
+
const commissionService = container.resolve(types_1.MercurModules.COMMISSION);
|
|
18
|
+
await commissionService.updateCommissionRules(previousRules.map((rule) => ({
|
|
19
|
+
id: rule.id,
|
|
20
|
+
reference: rule.reference,
|
|
21
|
+
reference_id: rule.reference_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JLENBQUMsYUFBYSxFQUFFLE1BQU07UUFBRSxPQUFNO0lBRWxDLE1BQU0saUJBQWlCLEdBQUcsU0FBUyxDQUFDLE9BQU8sQ0FDekMscUJBQWEsQ0FBQyxVQUFVLENBQ3pCLENBQUE7SUFFRCxNQUFNLGlCQUFpQixDQUFDLHFCQUFxQixDQUMzQyxhQUFhLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBQzNCLEVBQUUsRUFBRSxJQUFJLENBQUMsRUFBRTtRQUNYLFNBQVMsRUFBRSxJQUFJLENBQUMsU0FBUztRQUN6QixZQUFZLEVBQUUsSUFBSSxDQUFDLFlBQVk7S0FDaEMsQ0FBQyxDQUFDLENBQ0osQ0FBQTtBQUNILENBQUMsQ0FDRixDQUFBIn0=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommissionLineDTO, CreateCommissionLineDTO, UpdateCommissionLineDTO } from "@mercurjs/types";
|
|
2
|
+
type UpsertCommissionLinesStepInput = {
|
|
3
|
+
commission_lines: (CreateCommissionLineDTO | UpdateCommissionLineDTO)[];
|
|
4
|
+
};
|
|
5
|
+
export declare const upsertCommissionLinesStepId = "upsert-commission-lines";
|
|
6
|
+
export declare const upsertCommissionLinesStep: import("@medusajs/framework/workflows-sdk").StepFunction<UpsertCommissionLinesStepInput, CommissionLineDTO[]>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertCommissionLinesStep = exports.upsertCommissionLinesStepId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const types_1 = require("@mercurjs/types");
|
|
6
|
+
exports.upsertCommissionLinesStepId = "upsert-commission-lines";
|
|
7
|
+
exports.upsertCommissionLinesStep = (0, workflows_sdk_1.createStep)(exports.upsertCommissionLinesStepId, async (input, { container }) => {
|
|
8
|
+
const service = container.resolve(types_1.MercurModules.COMMISSION);
|
|
9
|
+
const commissionLines = await service.upsertCommissionLines(input.commission_lines);
|
|
10
|
+
return new workflows_sdk_1.StepResponse(commissionLines);
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBzZXJ0LWNvbW1pc3Npb24tbGluZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2NvbW1pc3Npb24vc3RlcHMvdXBzZXJ0LWNvbW1pc3Npb24tbGluZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscUVBQTRFO0FBQzVFLDJDQUt3QjtBQVFYLFFBQUEsMkJBQTJCLEdBQUcseUJBQXlCLENBQUE7QUFFdkQsUUFBQSx5QkFBeUIsR0FBRyxJQUFBLDBCQUFVLEVBQ2pELG1DQUEyQixFQUMzQixLQUFLLEVBQ0gsS0FBcUMsRUFDckMsRUFBRSxTQUFTLEVBQUUsRUFDK0IsRUFBRTtJQUM5QyxNQUFNLE9BQU8sR0FDWCxTQUFTLENBQUMsT0FBTyxDQUEwQixxQkFBYSxDQUFDLFVBQVUsQ0FBQyxDQUFBO0lBRXRFLE1BQU0sZUFBZSxHQUFHLE1BQU0sT0FBTyxDQUFDLHFCQUFxQixDQUN6RCxLQUFLLENBQUMsZ0JBQWdCLENBQ3ZCLENBQUE7SUFFRCxPQUFPLElBQUksNEJBQVksQ0FBQyxlQUFlLENBQUMsQ0FBQTtBQUMxQyxDQUFDLENBQ0YsQ0FBQSJ9
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BatchWorkflowInput, BatchWorkflowOutput } from "@medusajs/framework/types";
|
|
2
|
+
import { CreateCommissionRuleDTO, UpdateCommissionRuleDTO, CommissionRuleDTO } from "@mercurjs/types";
|
|
3
|
+
export interface BatchCommissionRulesWorkflowInput extends BatchWorkflowInput<CreateCommissionRuleDTO, UpdateCommissionRuleDTO> {
|
|
4
|
+
commission_rate_id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BatchCommissionRulesWorkflowOutput extends BatchWorkflowOutput<CommissionRuleDTO> {
|
|
7
|
+
}
|
|
8
|
+
export declare const batchCommissionRulesWorkflowId = "batch-commission-rules";
|
|
9
|
+
export declare const batchCommissionRulesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<BatchCommissionRulesWorkflowInput, BatchCommissionRulesWorkflowOutput, []>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.batchCommissionRulesWorkflow = exports.batchCommissionRulesWorkflowId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const create_commission_rules_1 = require("../steps/create-commission-rules");
|
|
6
|
+
const update_commission_rules_1 = require("../steps/update-commission-rules");
|
|
7
|
+
const delete_commission_rules_1 = require("../steps/delete-commission-rules");
|
|
8
|
+
exports.batchCommissionRulesWorkflowId = "batch-commission-rules";
|
|
9
|
+
exports.batchCommissionRulesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.batchCommissionRulesWorkflowId, (input) => {
|
|
10
|
+
const createInput = (0, workflows_sdk_1.transform)({ input }, (data) => ({
|
|
11
|
+
commission_rate_id: data.input.commission_rate_id,
|
|
12
|
+
rules: data.input.create ?? [],
|
|
13
|
+
}));
|
|
14
|
+
const updateInput = (0, workflows_sdk_1.transform)({ input }, (data) => data.input.update ?? []);
|
|
15
|
+
const deleteInput = (0, workflows_sdk_1.transform)({ input }, (data) => data.input.delete ?? []);
|
|
16
|
+
const [created, updated, deleted] = (0, workflows_sdk_1.parallelize)((0, create_commission_rules_1.createCommissionRulesStep)(createInput), (0, update_commission_rules_1.updateCommissionRulesStep)(updateInput), (0, delete_commission_rules_1.deleteCommissionRulesStep)(deleteInput));
|
|
17
|
+
return new workflows_sdk_1.WorkflowResponse((0, workflows_sdk_1.transform)({ created, updated, deleted }, (data) => data));
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmF0Y2gtY29tbWlzc2lvbi1ydWxlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy93b3JrZmxvd3MvY29tbWlzc2lvbi93b3JrZmxvd3MvYmF0Y2gtY29tbWlzc2lvbi1ydWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxxRUFNMEM7QUFPMUMsOEVBQTRFO0FBQzVFLDhFQUE0RTtBQUM1RSw4RUFBNEU7QUFVL0QsUUFBQSw4QkFBOEIsR0FBRyx3QkFBd0IsQ0FBQTtBQUV6RCxRQUFBLDRCQUE0QixHQUFHLElBQUEsOEJBQWMsRUFDeEQsc0NBQThCLEVBQzlCLENBQ0UsS0FBc0QsRUFDQSxFQUFFO0lBQ3hELE1BQU0sV0FBVyxHQUFHLElBQUEseUJBQVMsRUFBQyxFQUFFLEtBQUssRUFBRSxFQUFFLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBQ2xELGtCQUFrQixFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsa0JBQWtCO1FBQ2pELEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sSUFBSSxFQUFFO0tBQy9CLENBQUMsQ0FBQyxDQUFBO0lBRUgsTUFBTSxXQUFXLEdBQUcsSUFBQSx5QkFBUyxFQUFDLEVBQUUsS0FBSyxFQUFFLEVBQUUsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxJQUFJLEVBQUUsQ0FBQyxDQUFBO0lBRTNFLE1BQU0sV0FBVyxHQUFHLElBQUEseUJBQVMsRUFBQyxFQUFFLEtBQUssRUFBRSxFQUFFLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sSUFBSSxFQUFFLENBQUMsQ0FBQTtJQUUzRSxNQUFNLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLENBQUMsR0FBRyxJQUFBLDJCQUFXLEVBQzdDLElBQUEsbURBQXlCLEVBQUMsV0FBVyxDQUFDLEVBQ3RDLElBQUEsbURBQXlCLEVBQUMsV0FBVyxDQUFDLEVBQ3RDLElBQUEsbURBQXlCLEVBQUMsV0FBVyxDQUFDLENBQ3ZDLENBQUE7SUFFRCxPQUFPLElBQUksZ0NBQWdCLENBQ3pCLElBQUEseUJBQVMsRUFBQyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLEVBQUUsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUN6RCxDQUFBO0FBQ0gsQ0FBQyxDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CreateCommissionRateDTO } from "@mercurjs/types";
|
|
2
|
+
export declare const createCommissionRatesWorkflowId = "create-commission-rates";
|
|
3
|
+
export declare const createCommissionRatesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<CreateCommissionRateDTO[], {
|
|
4
|
+
id: string;
|
|
5
|
+
is_enabled: boolean;
|
|
6
|
+
priority: number;
|
|
7
|
+
currency_code: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
code: string;
|
|
10
|
+
type: import("@mercurjs/types").CommissionRateType;
|
|
11
|
+
target: import("@mercurjs/types").CommissionRateTarget;
|
|
12
|
+
value: number;
|
|
13
|
+
min_amount: number | null;
|
|
14
|
+
include_tax: boolean;
|
|
15
|
+
rules: {
|
|
16
|
+
id: string;
|
|
17
|
+
reference: string;
|
|
18
|
+
reference_id: string;
|
|
19
|
+
commission_rate: /*elided*/ any;
|
|
20
|
+
created_at: Date;
|
|
21
|
+
updated_at: Date;
|
|
22
|
+
deleted_at: Date | null;
|
|
23
|
+
commission_rate_id: string;
|
|
24
|
+
}[];
|
|
25
|
+
raw_value: Record<string, unknown>;
|
|
26
|
+
raw_min_amount: Record<string, unknown> | null;
|
|
27
|
+
created_at: Date;
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
deleted_at: Date | null;
|
|
30
|
+
}[], []>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCommissionRatesWorkflow = exports.createCommissionRatesWorkflowId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const create_commission_rates_1 = require("../steps/create-commission-rates");
|
|
6
|
+
exports.createCommissionRatesWorkflowId = "create-commission-rates";
|
|
7
|
+
exports.createCommissionRatesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createCommissionRatesWorkflowId, function (input) {
|
|
8
|
+
const commissionRates = (0, create_commission_rates_1.createCommissionRatesStep)(input);
|
|
9
|
+
return new workflows_sdk_1.WorkflowResponse(commissionRates);
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWNvbW1pc3Npb24tcmF0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2NvbW1pc3Npb24vd29ya2Zsb3dzL2NyZWF0ZS1jb21taXNzaW9uLXJhdGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFFQUFvRjtBQUdwRiw4RUFBNEU7QUFFL0QsUUFBQSwrQkFBK0IsR0FBRyx5QkFBeUIsQ0FBQTtBQUUzRCxRQUFBLDZCQUE2QixHQUFHLElBQUEsOEJBQWMsRUFDekQsdUNBQStCLEVBQy9CLFVBQVUsS0FBZ0M7SUFDeEMsTUFBTSxlQUFlLEdBQUcsSUFBQSxtREFBeUIsRUFBQyxLQUFLLENBQUMsQ0FBQTtJQUV4RCxPQUFPLElBQUksZ0NBQWdCLENBQUMsZUFBZSxDQUFDLENBQUE7QUFDOUMsQ0FBQyxDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WorkflowData } from "@medusajs/framework/workflows-sdk";
|
|
2
|
+
export type DeleteCommissionRatesWorkflowInput = {
|
|
3
|
+
ids: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const deleteCommissionRatesWorkflowId = "delete-commission-rates";
|
|
6
|
+
export declare const deleteCommissionRatesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<DeleteCommissionRatesWorkflowInput, never, [import("@medusajs/framework/workflows-sdk").Hook<"commissionRatesDeleted", {
|
|
7
|
+
ids: (string[] | WorkflowData<string[]>) & string[];
|
|
8
|
+
}, unknown>]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteCommissionRatesWorkflow = exports.deleteCommissionRatesWorkflowId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const delete_commission_rates_1 = require("../steps/delete-commission-rates");
|
|
6
|
+
exports.deleteCommissionRatesWorkflowId = "delete-commission-rates";
|
|
7
|
+
exports.deleteCommissionRatesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.deleteCommissionRatesWorkflowId, (input) => {
|
|
8
|
+
const deletedCommissionRates = (0, delete_commission_rates_1.deleteCommissionRatesStep)(input.ids);
|
|
9
|
+
const commissionRatesDeleted = (0, workflows_sdk_1.createHook)("commissionRatesDeleted", {
|
|
10
|
+
ids: input.ids,
|
|
11
|
+
});
|
|
12
|
+
return new workflows_sdk_1.WorkflowResponse(deletedCommissionRates, {
|
|
13
|
+
hooks: [commissionRatesDeleted],
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsZXRlLWNvbW1pc3Npb24tcmF0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2NvbW1pc3Npb24vd29ya2Zsb3dzL2RlbGV0ZS1jb21taXNzaW9uLXJhdGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFFQUswQztBQUUxQyw4RUFBNEU7QUFNL0QsUUFBQSwrQkFBK0IsR0FBRyx5QkFBeUIsQ0FBQTtBQUUzRCxRQUFBLDZCQUE2QixHQUFHLElBQUEsOEJBQWMsRUFDekQsdUNBQStCLEVBQy9CLENBQUMsS0FBdUQsRUFBRSxFQUFFO0lBQzFELE1BQU0sc0JBQXNCLEdBQUcsSUFBQSxtREFBeUIsRUFBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUE7SUFFbkUsTUFBTSxzQkFBc0IsR0FBRyxJQUFBLDBCQUFVLEVBQUMsd0JBQXdCLEVBQUU7UUFDbEUsR0FBRyxFQUFFLEtBQUssQ0FBQyxHQUFHO0tBQ2YsQ0FBQyxDQUFBO0lBRUYsT0FBTyxJQUFJLGdDQUFnQixDQUFDLHNCQUFzQixFQUFFO1FBQ2xELEtBQUssRUFBRSxDQUFDLHNCQUFzQixDQUFDO0tBQ2hDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FDRixDQUFBIn0=
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./refresh-order-commission-lines"), exports);
|
|
18
|
+
__exportStar(require("./create-commission-rates"), exports);
|
|
19
|
+
__exportStar(require("./update-commission-rates"), exports);
|
|
20
|
+
__exportStar(require("./batch-commission-rules"), exports);
|
|
21
|
+
__exportStar(require("./delete-commission-rates"), exports);
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2NvbW1pc3Npb24vd29ya2Zsb3dzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxtRUFBZ0Q7QUFDaEQsNERBQXlDO0FBQ3pDLDREQUF5QztBQUN6QywyREFBd0M7QUFDeEMsNERBQXlDIn0=
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommissionLineDTO } from "@mercurjs/types";
|
|
2
|
+
export type RefreshOrderCommissionLinesWorkflowInput = {
|
|
3
|
+
order_ids: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const refreshOrderCommissionLinesWorkflowId = "refresh-order-commission-lines";
|
|
6
|
+
export declare const refreshOrderCommissionLinesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<RefreshOrderCommissionLinesWorkflowInput, CommissionLineDTO[], []>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refreshOrderCommissionLinesWorkflow = exports.refreshOrderCommissionLinesWorkflowId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
6
|
+
const steps_1 = require("../steps");
|
|
7
|
+
const orderFields = [
|
|
8
|
+
"id",
|
|
9
|
+
"status",
|
|
10
|
+
"version",
|
|
11
|
+
"currency_code",
|
|
12
|
+
"email",
|
|
13
|
+
"canceled_at",
|
|
14
|
+
"sales_channel_id",
|
|
15
|
+
"region_id",
|
|
16
|
+
"customer_id",
|
|
17
|
+
"customer.*",
|
|
18
|
+
"customer.groups.*",
|
|
19
|
+
"promotions.*",
|
|
20
|
+
"subtotal",
|
|
21
|
+
"items.*",
|
|
22
|
+
"items.subtotal",
|
|
23
|
+
"items.product.id",
|
|
24
|
+
"items.product.collection_id",
|
|
25
|
+
"items.product.categories.id",
|
|
26
|
+
"items.product.tags.id",
|
|
27
|
+
"items.product.type_id",
|
|
28
|
+
"items.product.seller.id",
|
|
29
|
+
"items.adjustments.*",
|
|
30
|
+
"shipping_methods.*",
|
|
31
|
+
"shipping_methods.total",
|
|
32
|
+
"shipping_methods.subtotal",
|
|
33
|
+
"shipping_methods.tax_total",
|
|
34
|
+
"shipping_methods.adjustments.*",
|
|
35
|
+
"shipping_methods.shipping_option_id",
|
|
36
|
+
"shipping_address.*",
|
|
37
|
+
];
|
|
38
|
+
exports.refreshOrderCommissionLinesWorkflowId = "refresh-order-commission-lines";
|
|
39
|
+
exports.refreshOrderCommissionLinesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.refreshOrderCommissionLinesWorkflowId, function (input) {
|
|
40
|
+
const { data: orders } = (0, core_flows_1.useQueryGraphStep)({
|
|
41
|
+
entity: "order",
|
|
42
|
+
fields: orderFields,
|
|
43
|
+
filters: { id: input.order_ids },
|
|
44
|
+
options: {
|
|
45
|
+
throwIfKeyNotFound: true,
|
|
46
|
+
},
|
|
47
|
+
}).config({ name: "fetch-orders" });
|
|
48
|
+
const commissionContexts = (0, workflows_sdk_1.transform)({ orders }, ({ orders }) => {
|
|
49
|
+
return orders.map((order) => ({
|
|
50
|
+
currency_code: order.currency_code,
|
|
51
|
+
items: (order.items ?? []).map((item) => ({
|
|
52
|
+
id: item.id,
|
|
53
|
+
subtotal: item.subtotal,
|
|
54
|
+
tax_total: item.tax_total,
|
|
55
|
+
product: item.product
|
|
56
|
+
? {
|
|
57
|
+
id: item.product.id,
|
|
58
|
+
collection_id: item.product.collection_id,
|
|
59
|
+
categories: item.product.categories,
|
|
60
|
+
tags: item.product.tags,
|
|
61
|
+
type_id: item.product.type_id,
|
|
62
|
+
seller: item.product.seller,
|
|
63
|
+
}
|
|
64
|
+
: undefined,
|
|
65
|
+
})),
|
|
66
|
+
shipping_methods: (order.shipping_methods ?? []).map((method) => ({
|
|
67
|
+
id: method.id,
|
|
68
|
+
subtotal: method.subtotal,
|
|
69
|
+
tax_total: method.tax_total,
|
|
70
|
+
})),
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
73
|
+
const commissionLines = (0, steps_1.getCommissionLinesStep)(commissionContexts);
|
|
74
|
+
const upsertedCommissionLines = (0, steps_1.upsertCommissionLinesStep)({
|
|
75
|
+
commission_lines: commissionLines,
|
|
76
|
+
});
|
|
77
|
+
return new workflows_sdk_1.WorkflowResponse(upsertedCommissionLines);
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVmcmVzaC1vcmRlci1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QkFDN0IsTUFBTSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTTtxQkFDNUI7b0JBQ0QsQ0FBQyxDQUFDLFNBQVM7YUFDZCxDQUFDLENBQUM7WUFDSCxnQkFBZ0IsRUFBRSxDQUFDLEtBQUssQ0FBQyxnQkFBZ0IsSUFBSSxFQUFFLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxNQUFXLEVBQUUsRUFBRSxDQUFDLENBQUM7Z0JBQ3JFLEVBQUUsRUFBRSxNQUFNLENBQUMsRUFBRTtnQkFDYixRQUFRLEVBQUUsTUFBTSxDQUFDLFFBQVE7Z0JBQ3pCLFNBQVMsRUFBRSxNQUFNLENBQUMsU0FBUzthQUM1QixDQUFDLENBQUM7U0FDSixDQUFDLENBQUMsQ0FBQTtJQUNMLENBQUMsQ0FBQyxDQUFBO0lBRUYsTUFBTSxlQUFlLEdBQUcsSUFBQSw4QkFBc0IsRUFBQyxrQkFBa0IsQ0FBQyxDQUFBO0lBRWxFLE1BQU0sdUJBQXVCLEdBQUcsSUFBQSxpQ0FBeUIsRUFBQztRQUN4RCxnQkFBZ0IsRUFBRSxlQUFlO0tBQ2xDLENBQUMsQ0FBQTtJQUVGLE9BQU8sSUFBSSxnQ0FBZ0IsQ0FBQyx1QkFBdUIsQ0FBQyxDQUFBO0FBQ3RELENBQUMsQ0FDRixDQUFBIn0=
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UpdateCommissionRateDTO } from "@mercurjs/types";
|
|
2
|
+
export declare const updateCommissionRatesWorkflowId = "update-commission-rates";
|
|
3
|
+
export declare const updateCommissionRatesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<UpdateCommissionRateDTO[], {
|
|
4
|
+
id: string;
|
|
5
|
+
is_enabled: boolean;
|
|
6
|
+
priority: number;
|
|
7
|
+
currency_code: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
code: string;
|
|
10
|
+
type: import("@mercurjs/types").CommissionRateType;
|
|
11
|
+
target: import("@mercurjs/types").CommissionRateTarget;
|
|
12
|
+
value: number;
|
|
13
|
+
min_amount: number | null;
|
|
14
|
+
include_tax: boolean;
|
|
15
|
+
rules: {
|
|
16
|
+
id: string;
|
|
17
|
+
reference: string;
|
|
18
|
+
reference_id: string;
|
|
19
|
+
commission_rate: /*elided*/ any;
|
|
20
|
+
created_at: Date;
|
|
21
|
+
updated_at: Date;
|
|
22
|
+
deleted_at: Date | null;
|
|
23
|
+
commission_rate_id: string;
|
|
24
|
+
}[];
|
|
25
|
+
raw_value: Record<string, unknown>;
|
|
26
|
+
raw_min_amount: Record<string, unknown> | null;
|
|
27
|
+
created_at: Date;
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
deleted_at: Date | null;
|
|
30
|
+
}[], []>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateCommissionRatesWorkflow = exports.updateCommissionRatesWorkflowId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const update_commission_rates_1 = require("../steps/update-commission-rates");
|
|
6
|
+
exports.updateCommissionRatesWorkflowId = "update-commission-rates";
|
|
7
|
+
exports.updateCommissionRatesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.updateCommissionRatesWorkflowId, function (input) {
|
|
8
|
+
const commissionRates = (0, update_commission_rates_1.updateCommissionRatesStep)(input);
|
|
9
|
+
return new workflows_sdk_1.WorkflowResponse(commissionRates);
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBkYXRlLWNvbW1pc3Npb24tcmF0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2NvbW1pc3Npb24vd29ya2Zsb3dzL3VwZGF0ZS1jb21taXNzaW9uLXJhdGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFFQUFvRjtBQUdwRiw4RUFBNEU7QUFFL0QsUUFBQSwrQkFBK0IsR0FBRyx5QkFBeUIsQ0FBQTtBQUUzRCxRQUFBLDZCQUE2QixHQUFHLElBQUEsOEJBQWMsRUFDekQsdUNBQStCLEVBQy9CLFVBQVUsS0FBZ0M7SUFDeEMsTUFBTSxlQUFlLEdBQUcsSUFBQSxtREFBeUIsRUFBQyxLQUFLLENBQUMsQ0FBQTtJQUV4RCxPQUFPLElBQUksZ0NBQWdCLENBQUMsZUFBZSxDQUFDLENBQUE7QUFDOUMsQ0FBQyxDQUNGLENBQUEifQ==
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Order
|
|
3
|
+
* @customNamespace Order
|
|
4
|
+
*/
|
|
5
|
+
export declare const OrderGroupWorkflowEvents: {
|
|
6
|
+
/**
|
|
7
|
+
* Emitted when an order group is created.
|
|
8
|
+
*
|
|
9
|
+
* @eventPayload
|
|
10
|
+
* ```ts
|
|
11
|
+
* {
|
|
12
|
+
* id, // The ID of the order group
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
CREATED: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderGroupWorkflowEvents = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @category Order
|
|
6
|
+
* @customNamespace Order
|
|
7
|
+
*/
|
|
8
|
+
exports.OrderGroupWorkflowEvents = {
|
|
9
|
+
/**
|
|
10
|
+
* Emitted when an order group is created.
|
|
11
|
+
*
|
|
12
|
+
* @eventPayload
|
|
13
|
+
* ```ts
|
|
14
|
+
* {
|
|
15
|
+
* id, // The ID of the order group
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
CREATED: "order_group.created",
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3dvcmtmbG93cy9ldmVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUE7OztHQUdHO0FBQ1UsUUFBQSx3QkFBd0IsR0FBRztJQUNwQzs7Ozs7Ozs7O09BU0c7SUFDSCxPQUFPLEVBQUUscUJBQXFCO0NBQ2pDLENBQUEifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
6
|
+
const types_1 = require("@mercurjs/types");
|
|
7
|
+
core_flows_1.createProductsWorkflow.hooks.productsCreated(async ({ products, additional_data }, { container }) => {
|
|
8
|
+
if (!additional_data?.seller_id) {
|
|
9
|
+
return new workflows_sdk_1.StepResponse({ productLinks: [], inventoryLinks: [] }, { productLinks: [], inventoryLinks: [] });
|
|
10
|
+
}
|
|
11
|
+
const link = container.resolve(utils_1.ContainerRegistrationKeys.LINK);
|
|
12
|
+
const query = container.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
13
|
+
const links = [];
|
|
14
|
+
const inventoryLinks = [];
|
|
15
|
+
const variantIds = [];
|
|
16
|
+
for (const product of products) {
|
|
17
|
+
links.push({
|
|
18
|
+
[utils_1.Modules.PRODUCT]: {
|
|
19
|
+
product_id: product.id,
|
|
20
|
+
},
|
|
21
|
+
[types_1.MercurModules.SELLER]: {
|
|
22
|
+
seller_id: additional_data.seller_id,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
for (const variant of product.variants || []) {
|
|
26
|
+
if (variant.manage_inventory) {
|
|
27
|
+
variantIds.push(variant.id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (variantIds.length) {
|
|
32
|
+
const { data: variants } = await query.graph({
|
|
33
|
+
entity: "variant",
|
|
34
|
+
fields: ["inventory_items.inventory_item_id"],
|
|
35
|
+
filters: { id: variantIds },
|
|
36
|
+
});
|
|
37
|
+
for (const variant of variants) {
|
|
38
|
+
for (const inventoryItem of variant.inventory_items || []) {
|
|
39
|
+
inventoryLinks.push({
|
|
40
|
+
[utils_1.Modules.INVENTORY]: {
|
|
41
|
+
inventory_item_id: inventoryItem.inventory_item_id,
|
|
42
|
+
},
|
|
43
|
+
[types_1.MercurModules.SELLER]: {
|
|
44
|
+
seller_id: additional_data.seller_id,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
await link.create(links);
|
|
51
|
+
if (inventoryLinks.length) {
|
|
52
|
+
await link.create(inventoryLinks);
|
|
53
|
+
}
|
|
54
|
+
return new workflows_sdk_1.StepResponse({ productLinks: links, inventoryLinks }, { productLinks: links, inventoryLinks });
|
|
55
|
+
}, async (data, { container }) => {
|
|
56
|
+
if (!data) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const { productLinks, inventoryLinks } = data;
|
|
60
|
+
const link = container.resolve(utils_1.ContainerRegistrationKeys.LINK);
|
|
61
|
+
if (productLinks?.length) {
|
|
62
|
+
await link.dismiss(productLinks);
|
|
63
|
+
}
|
|
64
|
+
if (inventoryLinks?.length) {
|
|
65
|
+
await link.dismiss(inventoryLinks);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_flows_1 = require("@medusajs/medusa/core-flows");
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
6
|
+
const types_1 = require("@mercurjs/types");
|
|
7
|
+
core_flows_1.createProductVariantsWorkflow.hooks.productVariantsCreated(async ({ product_variants, additional_data }, { container }) => {
|
|
8
|
+
if (!additional_data?.seller_id) {
|
|
9
|
+
return new workflows_sdk_1.StepResponse({ inventoryLinks: [] }, { inventoryLinks: [] });
|
|
10
|
+
}
|
|
11
|
+
const link = container.resolve(utils_1.ContainerRegistrationKeys.LINK);
|
|
12
|
+
const query = container.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
13
|
+
const inventoryLinks = [];
|
|
14
|
+
const variantIds = product_variants
|
|
15
|
+
.filter((v) => v.manage_inventory)
|
|
16
|
+
.map((v) => v.id);
|
|
17
|
+
if (variantIds.length) {
|
|
18
|
+
const { data: variants } = await query.graph({
|
|
19
|
+
entity: "variant",
|
|
20
|
+
fields: ["inventory_items.inventory_item_id"],
|
|
21
|
+
filters: { id: variantIds },
|
|
22
|
+
});
|
|
23
|
+
for (const variant of variants) {
|
|
24
|
+
for (const inventoryItem of variant.inventory_items || []) {
|
|
25
|
+
inventoryLinks.push({
|
|
26
|
+
[utils_1.Modules.INVENTORY]: {
|
|
27
|
+
inventory_item_id: inventoryItem.inventory_item_id,
|
|
28
|
+
},
|
|
29
|
+
[types_1.MercurModules.SELLER]: {
|
|
30
|
+
seller_id: additional_data.seller_id,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (inventoryLinks.length) {
|
|
37
|
+
await link.create(inventoryLinks);
|
|
38
|
+
}
|
|
39
|
+
return new workflows_sdk_1.StepResponse({ inventoryLinks }, { inventoryLinks });
|
|
40
|
+
}, async (data, { container }) => {
|
|
41
|
+
if (!data) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const { inventoryLinks } = data;
|
|
45
|
+
const link = container.resolve(utils_1.ContainerRegistrationKeys.LINK);
|
|
46
|
+
if (inventoryLinks?.length) {
|
|
47
|
+
await link.dismiss(inventoryLinks);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC12YXJpYW50LWNyZWF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2hvb2tzL3Byb2R1Y3QtdmFyaWFudC1jcmVhdGVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNERBQTJFO0FBQzNFLHFFQUFnRTtBQUNoRSxxREFBOEU7QUFFOUUsMkNBQStDO0FBRS9DLDBDQUE2QixDQUFDLEtBQUssQ0FBQyxzQkFBc0IsQ0FDeEQsS0FBSyxFQUFFLEVBQUUsZ0JBQWdCLEVBQUUsZUFBZSxFQUFFLEVBQUUsRUFBRSxTQUFTLEVBQUUsRUFBRSxFQUFFO0lBQzdELElBQUksQ0FBQyxlQUFlLEVBQUUsU0FBUyxFQUFFLENBQUM7UUFDaEMsT0FBTyxJQUFJLDRCQUFZLENBQ3JCLEVBQUUsY0FBYyxFQUFFLEVBQXNCLEVBQUUsRUFDMUMsRUFBRSxjQUFjLEVBQUUsRUFBc0IsRUFBRSxDQUMzQyxDQUFBO0lBQ0gsQ0FBQztJQUVELE1BQU0sSUFBSSxHQUFHLFNBQVMsQ0FBQyxPQUFPLENBQUMsaUNBQXlCLENBQUMsSUFBSSxDQUFDLENBQUE7SUFDOUQsTUFBTSxLQUFLLEdBQUcsU0FBUyxDQUFDLE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QUVELElBQUksY0FBYyxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQzFCLE1BQU0sSUFBSSxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsQ0FBQTtJQUNuQyxDQUFDO0lBRUQsT0FBTyxJQUFJLDRCQUFZLENBQ3JCLEVBQUUsY0FBYyxFQUFFLEVBQ2xCLEVBQUUsY0FBYyxFQUFFLENBQ25CLENBQUE7QUFDSCxDQUFDLEVBQ0QsS0FBSyxFQUFFLElBQUksRUFBRSxFQUFFLFNBQVMsRUFBRSxFQUFFLEVBQUU7SUFDNUIsSUFBSSxDQUFDLElBQUksRUFBRSxDQUFDO1FBQ1YsT0FBTTtJQUNSLENBQUM7SUFFRCxNQUFNLEVBQUUsY0FBYyxFQUFFLEdBQUcsSUFBSSxDQUFBO0lBRS9CLE1BQU0sSUFBSSxHQUFHLFNBQVMsQ0FBQyxPQUFPLENBQUMsaUNBQXlCLENBQUMsSUFBSSxDQUFDLENBQUE7SUFFOUQsSUFBSSxjQUFjLEVBQUUsTUFBTSxFQUFFLENBQUM7UUFDM0IsTUFBTSxJQUFJLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxDQUFBO0lBQ3BDLENBQUM7QUFDSCxDQUFDLENBQ0YsQ0FBQSJ9
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./campaign";
|
|
2
|
+
export * from "./commission";
|
|
3
|
+
export * from "./payout";
|
|
4
|
+
export * from "./inventory-item";
|
|
5
|
+
export * from "./order-group";
|
|
6
|
+
export * from "./price-list";
|
|
7
|
+
export * from "./promotion";
|
|
8
|
+
export * from "./seller";
|
|
9
|
+
export * from "./shipping-option";
|
|
10
|
+
export * from "./shipping-profile";
|
|
11
|
+
export * from "./stock-location";
|
|
12
|
+
export * from './cart';
|
|
13
|
+
export * from './events';
|
|
@@ -0,0 +1,30 @@
|
|
|
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("./campaign"), exports);
|
|
18
|
+
__exportStar(require("./commission"), exports);
|
|
19
|
+
__exportStar(require("./payout"), exports);
|
|
20
|
+
__exportStar(require("./inventory-item"), exports);
|
|
21
|
+
__exportStar(require("./order-group"), exports);
|
|
22
|
+
__exportStar(require("./price-list"), exports);
|
|
23
|
+
__exportStar(require("./promotion"), exports);
|
|
24
|
+
__exportStar(require("./seller"), exports);
|
|
25
|
+
__exportStar(require("./shipping-option"), exports);
|
|
26
|
+
__exportStar(require("./shipping-profile"), exports);
|
|
27
|
+
__exportStar(require("./stock-location"), exports);
|
|
28
|
+
__exportStar(require("./cart"), exports);
|
|
29
|
+
__exportStar(require("./events"), exports);
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSw2Q0FBMEI7QUFDMUIsK0NBQTRCO0FBQzVCLDJDQUF3QjtBQUN4QixtREFBZ0M7QUFDaEMsZ0RBQTZCO0FBQzdCLCtDQUE0QjtBQUM1Qiw4Q0FBMkI7QUFDM0IsMkNBQXdCO0FBQ3hCLG9EQUFpQztBQUNqQyxxREFBa0M7QUFDbEMsbURBQWdDO0FBQ2hDLHlDQUFzQjtBQUN0QiwyQ0FBd0IifQ==
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./steps"), exports);
|
|
18
|
+
__exportStar(require("./workflows"), exports);
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2ludmVudG9yeS1pdGVtL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwwQ0FBdUI7QUFDdkIsOENBQTJCIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./link-seller-inventory-item";
|
|
@@ -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("./link-seller-inventory-item"), exports);
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2ludmVudG9yeS1pdGVtL3N0ZXBzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwrREFBNEMifQ==
|