@mercurjs/core 2.1.6 → 2.2.0-canary.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.d.ts +20 -0
- package/.medusa/server/src/api/admin/claims/[id]/outbound/items/route.js +66 -0
- package/.medusa/server/src/api/admin/claims/[id]/request/route.d.ts +10 -0
- package/.medusa/server/src/api/admin/claims/[id]/request/route.js +80 -0
- package/.medusa/server/src/api/admin/commission-rates/validators.d.ts +12 -12
- package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.d.ts +22 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/outbound/items/route.js +68 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/request/route.d.ts +10 -0
- package/.medusa/server/src/api/admin/exchanges/[id]/request/route.js +81 -0
- package/.medusa/server/src/api/admin/members/validators.d.ts +2 -2
- package/.medusa/server/src/api/admin/middlewares.js +27 -50
- package/.medusa/server/src/api/admin/offers/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/offers/[id]/route.js +37 -0
- package/.medusa/server/src/api/admin/offers/batch/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/offers/batch/route.js +37 -0
- package/.medusa/server/src/api/admin/offers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/offers/middlewares.js +31 -0
- package/.medusa/server/src/api/admin/offers/query-config.d.ts +11 -0
- package/.medusa/server/src/api/admin/offers/query-config.js +47 -0
- package/.medusa/server/src/api/admin/offers/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/offers/route.js +21 -0
- package/.medusa/server/src/api/admin/offers/validators.d.ts +299 -0
- package/.medusa/server/src/api/admin/offers/validators.js +65 -0
- package/.medusa/server/src/api/admin/order-edits/[id]/items/route.d.ts +26 -0
- package/.medusa/server/src/api/admin/order-edits/[id]/items/route.js +57 -0
- package/.medusa/server/src/api/admin/order-groups/apply-request-filter.d.ts +2 -0
- package/.medusa/server/src/api/admin/order-groups/apply-request-filter.js +140 -0
- package/.medusa/server/src/api/admin/order-groups/middlewares.js +3 -1
- package/.medusa/server/src/api/admin/order-groups/validators.d.ts +7 -4
- package/.medusa/server/src/api/admin/order-groups/validators.js +7 -1
- package/.medusa/server/src/api/admin/orders/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/orders/middlewares.js +42 -0
- package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.d.ts +11 -0
- package/.medusa/server/src/api/admin/orders/resolve-order-seller-id.js +24 -0
- package/.medusa/server/src/api/admin/orders/validators.d.ts +73 -27
- package/.medusa/server/src/api/admin/orders/validators.js +9 -29
- package/.medusa/server/src/api/admin/payouts/validators.d.ts +2 -2
- package/.medusa/server/src/api/admin/product-attributes/[id]/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/product-attributes/[id]/route.js +51 -0
- package/.medusa/server/src/api/admin/product-attributes/[id]/values/[value_id]/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/product-attributes/[id]/values/[value_id]/route.js +37 -0
- package/.medusa/server/src/api/admin/product-attributes/[id]/values/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/product-attributes/[id]/values/route.js +22 -0
- package/.medusa/server/src/api/admin/product-attributes/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/product-attributes/middlewares.js +89 -0
- package/.medusa/server/src/api/admin/product-attributes/query-config.d.ts +12 -0
- package/.medusa/server/src/api/admin/product-attributes/query-config.js +33 -0
- package/.medusa/server/src/api/admin/product-attributes/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/product-attributes/route.js +41 -0
- package/.medusa/server/src/api/admin/product-attributes/validators.d.ts +544 -0
- package/.medusa/server/src/api/admin/product-attributes/validators.js +115 -0
- package/.medusa/server/src/api/admin/product-categories/[id]/products/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/product-categories/[id]/products/route.js +20 -0
- package/.medusa/server/src/api/admin/product-categories/[id]/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/product-categories/[id]/route.js +51 -0
- package/.medusa/server/src/api/admin/product-categories/[id]/sellers/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/product-categories/[id]/sellers/route.js +20 -0
- package/.medusa/server/src/api/admin/product-categories/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/product-categories/middlewares.js +54 -0
- package/.medusa/server/src/api/admin/product-categories/query-config.d.ts +12 -0
- package/.medusa/server/src/api/admin/product-categories/query-config.js +31 -0
- package/.medusa/server/src/api/admin/product-categories/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/product-categories/route.js +39 -0
- package/.medusa/server/src/api/admin/product-categories/validators.d.ts +446 -0
- package/.medusa/server/src/api/admin/product-categories/validators.js +65 -0
- package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.d.ts +10 -0
- package/.medusa/server/src/api/admin/product-changes/[id]/cancel/route.js +32 -0
- package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.d.ts +10 -0
- package/.medusa/server/src/api/admin/product-changes/[id]/confirm/route.js +27 -0
- package/.medusa/server/src/api/admin/product-changes/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/product-changes/middlewares.js +18 -0
- package/.medusa/server/src/api/admin/product-changes/validators.d.ts +17 -0
- package/.medusa/server/src/api/admin/product-changes/validators.js +15 -0
- package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.d.ts +13 -0
- package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.js +90 -0
- package/.medusa/server/src/api/admin/{subscription-plans/[id]/overrides → products/[id]/attributes/batch}/route.d.ts +2 -2
- package/.medusa/server/src/api/admin/products/[id]/attributes/batch/route.js +25 -0
- package/.medusa/server/src/api/admin/products/[id]/attributes/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/products/[id]/attributes/route.js +63 -0
- package/.medusa/server/src/api/admin/products/[id]/confirm/route.d.ts +16 -0
- package/.medusa/server/src/api/admin/products/[id]/confirm/route.js +36 -0
- package/.medusa/server/src/api/admin/products/[id]/preview/route.d.ts +12 -0
- package/.medusa/server/src/api/admin/products/[id]/preview/route.js +27 -0
- package/.medusa/server/src/api/admin/products/[id]/reject/route.d.ts +12 -0
- package/.medusa/server/src/api/admin/products/[id]/reject/route.js +32 -0
- package/.medusa/server/src/api/admin/products/[id]/request-changes/route.d.ts +13 -0
- package/.medusa/server/src/api/admin/products/[id]/request-changes/route.js +33 -0
- package/.medusa/server/src/api/admin/products/[id]/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/products/[id]/route.js +55 -0
- package/.medusa/server/src/api/admin/products/[id]/variants/[variant_id]/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/products/[id]/variants/[variant_id]/route.js +60 -0
- package/.medusa/server/src/api/admin/products/[id]/variants/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/products/[id]/variants/route.js +59 -0
- package/.medusa/server/src/api/admin/products/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/products/middlewares.js +165 -0
- package/.medusa/server/src/api/admin/products/query-config.d.ts +25 -0
- package/.medusa/server/src/api/admin/products/query-config.js +95 -0
- package/.medusa/server/src/api/admin/products/route.d.ts +4 -2
- package/.medusa/server/src/api/admin/products/route.js +43 -1
- package/.medusa/server/src/api/admin/products/validators.d.ts +2923 -802
- package/.medusa/server/src/api/admin/products/validators.js +352 -4
- package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.d.ts +9 -0
- package/.medusa/server/src/api/admin/returns/[id]/receive/confirm/route.js +35 -0
- package/.medusa/server/src/api/admin/sellers/validators.d.ts +16 -16
- package/.medusa/server/src/api/admin/shipping-options/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/shipping-options/middlewares.js +46 -0
- package/.medusa/server/src/api/admin/shipping-profiles/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/shipping-profiles/middlewares.js +46 -0
- package/.medusa/server/src/api/admin/stock-locations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/admin/stock-locations/middlewares.js +46 -0
- package/.medusa/server/src/api/store/carts/[id]/line-items/route.d.ts +3 -0
- package/.medusa/server/src/api/store/carts/[id]/line-items/route.js +38 -0
- package/.medusa/server/src/api/store/carts/[id]/line-items/validators.d.ts +24 -0
- package/.medusa/server/src/api/store/carts/[id]/line-items/validators.js +15 -0
- package/.medusa/server/src/api/store/carts/middlewares.js +26 -1
- package/.medusa/server/src/api/store/middlewares.js +9 -5
- package/.medusa/server/src/api/store/order-groups/validators.d.ts +2 -2
- package/.medusa/server/src/api/store/product-attributes/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/store/product-attributes/[id]/route.js +18 -0
- package/.medusa/server/src/api/store/product-attributes/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/product-attributes/middlewares.js +31 -0
- package/.medusa/server/src/api/store/product-attributes/query-config.d.ts +12 -0
- package/.medusa/server/src/api/store/product-attributes/query-config.js +31 -0
- package/.medusa/server/src/api/store/product-attributes/route.d.ts +2 -0
- package/.medusa/server/src/api/store/product-attributes/route.js +21 -0
- package/.medusa/server/src/api/store/product-attributes/validators.d.ts +234 -0
- package/.medusa/server/src/api/store/product-attributes/validators.js +26 -0
- package/.medusa/server/src/api/store/product-categories/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/store/product-categories/[id]/route.js +18 -0
- package/.medusa/server/src/api/store/product-categories/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/store/product-categories/middlewares.js +31 -0
- package/.medusa/server/src/api/store/product-categories/query-config.d.ts +12 -0
- package/.medusa/server/src/api/store/product-categories/query-config.js +28 -0
- package/.medusa/server/src/api/store/product-categories/route.d.ts +2 -0
- package/.medusa/server/src/api/store/product-categories/route.js +21 -0
- package/.medusa/server/src/api/store/product-categories/validators.d.ts +240 -0
- package/.medusa/server/src/api/store/product-categories/validators.js +27 -0
- package/.medusa/server/src/api/store/products/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/store/products/[id]/route.js +32 -0
- package/.medusa/server/src/api/store/products/middlewares.d.ts +1 -1
- package/.medusa/server/src/api/store/products/middlewares.js +23 -5
- package/.medusa/server/src/api/store/products/query-config.d.ts +12 -0
- package/.medusa/server/src/api/store/products/query-config.js +55 -0
- package/.medusa/server/src/api/store/products/route.d.ts +2 -0
- package/.medusa/server/src/api/store/products/route.js +28 -0
- package/.medusa/server/src/api/store/products/validators.d.ts +270 -0
- package/.medusa/server/src/api/store/products/validators.js +32 -0
- package/.medusa/server/src/api/store/sellers/validators.d.ts +2 -2
- package/.medusa/server/src/api/utils/filter-attributes-by-category-link.d.ts +17 -0
- package/.medusa/server/src/api/utils/filter-attributes-by-category-link.js +58 -0
- package/.medusa/server/src/api/utils/format-product-attributes.d.ts +54 -0
- package/.medusa/server/src/api/utils/format-product-attributes.js +189 -0
- package/.medusa/server/src/api/utils/index.d.ts +2 -0
- package/.medusa/server/src/api/utils/index.js +3 -1
- package/.medusa/server/src/api/vendor/campaigns/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.js +17 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.js +15 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.js +46 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.js +26 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.js +39 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.js +26 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.d.ts +12 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.js +47 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.js +15 -0
- package/.medusa/server/src/api/vendor/claims/[id]/request/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/claims/[id]/request/route.js +34 -0
- package/.medusa/server/src/api/vendor/claims/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/claims/[id]/route.js +19 -0
- package/.medusa/server/src/api/vendor/claims/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/claims/helpers.js +19 -0
- package/.medusa/server/src/api/vendor/claims/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/claims/middlewares.js +184 -0
- package/.medusa/server/src/api/vendor/claims/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/claims/query-config.js +31 -0
- package/.medusa/server/src/api/vendor/claims/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/claims/route.js +35 -0
- package/.medusa/server/src/api/vendor/claims/validators.d.ts +378 -0
- package/.medusa/server/src/api/vendor/claims/validators.js +89 -0
- package/.medusa/server/src/api/vendor/collections/validators.d.ts +6 -6
- package/.medusa/server/src/api/vendor/currencies/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/customers/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.js +17 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.js +46 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.js +26 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.js +45 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.js +26 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.d.ts +12 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.js +47 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.js +15 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.d.ts +6 -0
- package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.js +34 -0
- package/.medusa/server/src/api/vendor/exchanges/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/exchanges/helpers.js +19 -0
- package/.medusa/server/src/api/vendor/exchanges/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/exchanges/middlewares.js +155 -0
- package/.medusa/server/src/api/vendor/exchanges/query-config.d.ts +7 -0
- package/.medusa/server/src/api/vendor/exchanges/query-config.js +23 -0
- package/.medusa/server/src/api/vendor/exchanges/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/exchanges/route.js +35 -0
- package/.medusa/server/src/api/vendor/exchanges/validators.d.ts +313 -0
- package/.medusa/server/src/api/vendor/exchanges/validators.js +71 -0
- package/.medusa/server/src/api/vendor/fulfillment-providers/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/fulfillment-sets/validators.d.ts +16 -16
- package/.medusa/server/src/api/vendor/inventory-items/route.js +1 -1
- package/.medusa/server/src/api/vendor/inventory-items/validators.d.ts +60 -60
- package/.medusa/server/src/api/vendor/middlewares.js +77 -67
- package/.medusa/server/src/api/vendor/offers/[id]/inventory-items/batch/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/offers/[id]/inventory-items/batch/route.js +24 -0
- package/.medusa/server/src/api/vendor/offers/[id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/offers/[id]/route.js +38 -0
- package/.medusa/server/src/api/vendor/{products/[id]/variants/[variant_id]/media → offers/batch}/route.d.ts +2 -2
- package/.medusa/server/src/api/vendor/offers/batch/route.js +34 -0
- package/.medusa/server/src/api/vendor/offers/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/offers/helpers.js +27 -0
- package/.medusa/server/src/api/vendor/offers/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/offers/middlewares.js +65 -0
- package/.medusa/server/src/api/vendor/offers/query-config.d.ts +11 -0
- package/.medusa/server/src/api/vendor/offers/query-config.js +47 -0
- package/.medusa/server/src/api/vendor/offers/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/offers/route.js +41 -0
- package/.medusa/server/src/api/vendor/offers/validators.d.ts +607 -0
- package/.medusa/server/src/api/vendor/offers/validators.js +119 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.js +24 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.d.ts +14 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.js +41 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.d.ts +10 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.js +30 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.d.ts +16 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.js +45 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.d.ts +10 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.js +25 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/route.d.ts +10 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/route.js +26 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.d.ts +14 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.js +41 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.d.ts +9 -0
- package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.js +20 -0
- package/.medusa/server/src/api/vendor/order-edits/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/order-edits/middlewares.js +106 -0
- package/.medusa/server/src/api/vendor/order-edits/route.d.ts +10 -0
- package/.medusa/server/src/api/vendor/order-edits/route.js +21 -0
- package/.medusa/server/src/api/vendor/order-edits/validators.d.ts +166 -0
- package/.medusa/server/src/api/vendor/order-edits/validators.js +50 -0
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/[fulfillment_id]/cancel/route.js +3 -3
- package/.medusa/server/src/api/vendor/orders/[id]/fulfillments/route.js +3 -3
- package/.medusa/server/src/api/vendor/orders/apply-request-filter.d.ts +2 -0
- package/.medusa/server/src/api/vendor/orders/apply-request-filter.js +99 -0
- package/.medusa/server/src/api/vendor/orders/middlewares.js +3 -1
- package/.medusa/server/src/api/vendor/orders/query-config.js +34 -11
- package/.medusa/server/src/api/vendor/orders/resolve-offer-items.d.ts +40 -0
- package/.medusa/server/src/api/vendor/orders/resolve-offer-items.js +66 -0
- package/.medusa/server/src/api/vendor/orders/validators.d.ts +7 -4
- package/.medusa/server/src/api/vendor/orders/validators.js +7 -1
- package/.medusa/server/src/api/vendor/payment-collections/[id]/mark-as-paid/route.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payment-collections/[id]/mark-as-paid/route.js +25 -0
- package/.medusa/server/src/api/vendor/payment-collections/helpers.d.ts +3 -0
- package/.medusa/server/src/api/vendor/payment-collections/helpers.js +30 -0
- package/.medusa/server/src/api/vendor/payment-collections/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/payment-collections/middlewares.js +17 -0
- package/.medusa/server/src/api/vendor/payment-collections/query-config.d.ts +7 -0
- package/.medusa/server/src/api/vendor/payment-collections/query-config.js +26 -0
- package/.medusa/server/src/api/vendor/payment-collections/validators.d.ts +17 -0
- package/.medusa/server/src/api/vendor/payment-collections/validators.js +12 -0
- package/.medusa/server/src/api/vendor/payments/helpers.d.ts +9 -0
- package/.medusa/server/src/api/vendor/payments/helpers.js +23 -8
- package/.medusa/server/src/api/vendor/payments/validators.d.ts +4 -4
- package/.medusa/server/src/api/vendor/payouts/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/price-lists/validators.d.ts +26 -26
- package/.medusa/server/src/api/vendor/price-preferences/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/{subscription → product-attributes/[id]}/route.d.ts +2 -2
- package/.medusa/server/src/api/vendor/product-attributes/[id]/route.js +18 -0
- package/.medusa/server/src/api/vendor/product-attributes/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/product-attributes/middlewares.js +37 -0
- package/.medusa/server/src/api/vendor/product-attributes/query-config.d.ts +12 -0
- package/.medusa/server/src/api/vendor/product-attributes/query-config.js +34 -0
- package/.medusa/server/src/api/vendor/{attributes → product-attributes}/route.d.ts +2 -1
- package/.medusa/server/src/api/vendor/product-attributes/route.js +26 -0
- package/.medusa/server/src/api/vendor/product-attributes/validators.d.ts +390 -0
- package/.medusa/server/src/api/vendor/product-attributes/validators.js +72 -0
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.d.ts +3 -2
- package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +24 -15
- package/.medusa/server/src/api/vendor/product-categories/[id]/route.js +2 -4
- package/.medusa/server/src/api/vendor/product-categories/middlewares.js +7 -41
- package/.medusa/server/src/api/vendor/product-categories/query-config.d.ts +11 -8
- package/.medusa/server/src/api/vendor/product-categories/query-config.js +16 -12
- package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +345 -44
- package/.medusa/server/src/api/vendor/product-categories/validators.js +24 -10
- package/.medusa/server/src/api/vendor/product-types/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/product-variants/middlewares.js +34 -11
- package/.medusa/server/src/api/vendor/product-variants/query-config.d.ts +2 -2
- package/.medusa/server/src/api/vendor/product-variants/query-config.js +16 -13
- package/.medusa/server/src/api/vendor/product-variants/route.d.ts +2 -1
- package/.medusa/server/src/api/vendor/product-variants/route.js +1 -1
- package/.medusa/server/src/api/vendor/product-variants/validators.d.ts +377 -21
- package/.medusa/server/src/api/vendor/product-variants/validators.js +14 -8
- package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.d.ts +20 -2
- package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.js +77 -129
- package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.d.ts +12 -0
- package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.js +46 -0
- package/.medusa/server/src/api/vendor/products/[id]/attributes/route.d.ts +13 -1
- package/.medusa/server/src/api/vendor/products/[id]/attributes/route.js +70 -101
- package/.medusa/server/src/api/vendor/products/[id]/cancel/route.d.ts +11 -0
- package/.medusa/server/src/api/vendor/products/[id]/cancel/route.js +43 -0
- package/.medusa/server/src/api/vendor/products/[id]/preview/route.d.ts +14 -0
- package/.medusa/server/src/api/vendor/products/[id]/preview/route.js +31 -0
- package/.medusa/server/src/api/vendor/products/[id]/route.d.ts +22 -3
- package/.medusa/server/src/api/vendor/products/[id]/route.js +41 -31
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.d.ts +16 -4
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +50 -33
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.d.ts +12 -3
- package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +28 -25
- package/.medusa/server/src/api/vendor/products/helpers.d.ts +8 -2
- package/.medusa/server/src/api/vendor/products/helpers.js +14 -8
- package/.medusa/server/src/api/vendor/products/middlewares.js +61 -34
- package/.medusa/server/src/api/vendor/products/query-config.d.ts +4 -1
- package/.medusa/server/src/api/vendor/products/query-config.js +42 -14
- package/.medusa/server/src/api/vendor/products/route.d.ts +11 -1
- package/.medusa/server/src/api/vendor/products/route.js +26 -10
- package/.medusa/server/src/api/vendor/products/validators.d.ts +1151 -1766
- package/.medusa/server/src/api/vendor/products/validators.js +278 -112
- package/.medusa/server/src/api/vendor/promotions/validators.d.ts +20 -20
- package/.medusa/server/src/api/vendor/refund-reasons/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/regions/validators.d.ts +4 -4
- package/.medusa/server/src/api/vendor/reservations/[id]/route.d.ts +5 -0
- package/.medusa/server/src/api/vendor/reservations/[id]/route.js +39 -0
- package/.medusa/server/src/api/vendor/reservations/helpers.d.ts +2 -0
- package/.medusa/server/src/api/vendor/reservations/helpers.js +21 -0
- package/.medusa/server/src/api/vendor/reservations/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/vendor/reservations/middlewares.js +61 -0
- package/.medusa/server/src/api/vendor/reservations/query-config.d.ts +19 -0
- package/.medusa/server/src/api/vendor/reservations/query-config.js +48 -0
- package/.medusa/server/src/api/vendor/reservations/route.d.ts +4 -0
- package/.medusa/server/src/api/vendor/reservations/route.js +35 -0
- package/.medusa/server/src/api/vendor/reservations/validators.d.ts +296 -0
- package/.medusa/server/src/api/vendor/reservations/validators.js +40 -0
- package/.medusa/server/src/api/vendor/return-reasons/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/returns/[id]/receive/confirm/route.js +3 -3
- package/.medusa/server/src/api/vendor/returns/validators.d.ts +22 -22
- package/.medusa/server/src/api/vendor/sales-channels/[id]/products/route.js +1 -5
- package/.medusa/server/src/api/vendor/sales-channels/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/sellers/validators.d.ts +10 -10
- package/.medusa/server/src/api/vendor/shipping-option-types/validators.d.ts +2 -2
- package/.medusa/server/src/api/vendor/shipping-options/middlewares.js +13 -1
- package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +51 -48
- package/.medusa/server/src/api/vendor/shipping-options/validators.js +2 -1
- package/.medusa/server/src/api/vendor/shipping-profiles/validators.d.ts +4 -4
- package/.medusa/server/src/api/vendor/stock-locations/validators.d.ts +5 -5
- package/.medusa/server/src/api/vendor/stores/validators.d.ts +2 -2
- package/.medusa/server/src/feature-flags/product-request.d.ts +3 -0
- package/.medusa/server/src/feature-flags/product-request.js +10 -0
- package/.medusa/server/src/links/cart-line-item-offer-link.js +17 -0
- package/.medusa/server/src/links/category-seller-link.js +16 -0
- package/.medusa/server/src/links/offer-inventory-item-link.js +26 -0
- package/.medusa/server/src/links/offer-price-link.js +13 -0
- package/.medusa/server/src/links/offer-seller-link.js +15 -0
- package/.medusa/server/src/links/offer-shipping-profile-link.d.ts +2 -0
- package/.medusa/server/src/links/offer-shipping-profile-link.js +15 -0
- package/.medusa/server/src/links/offer-variant-link.d.ts +2 -0
- package/.medusa/server/src/links/offer-variant-link.js +15 -0
- package/.medusa/server/src/links/order-line-item-offer-link.d.ts +2 -0
- package/.medusa/server/src/links/order-line-item-offer-link.js +18 -0
- package/.medusa/server/src/links/product-attribute-category-link.d.ts +16 -0
- package/.medusa/server/src/links/product-attribute-category-link.js +40 -0
- package/.medusa/server/src/links/product-attribute-product-link.d.ts +10 -0
- package/.medusa/server/src/links/product-attribute-product-link.js +29 -0
- package/.medusa/server/src/links/product-attribute-value-link.d.ts +20 -0
- package/.medusa/server/src/links/product-attribute-value-link.js +34 -4
- package/.medusa/server/src/links/product-change-link.d.ts +8 -0
- package/.medusa/server/src/links/product-change-link.js +27 -0
- package/.medusa/server/src/links/product-seller-link.js +12 -2
- package/.medusa/server/src/links/product-variant-attribute-link.d.ts +2 -0
- package/.medusa/server/src/links/product-variant-attribute-link.js +21 -0
- package/.medusa/server/src/links/product-variant-attribute-value-link.d.ts +2 -0
- package/.medusa/server/src/links/product-variant-attribute-value-link.js +21 -0
- package/.medusa/server/src/modules/offer/index.d.ts +21 -0
- package/.medusa/server/src/modules/{subscription → offer}/index.js +2 -2
- package/.medusa/server/src/modules/{attribute/migrations/Migration20260325000000.d.ts → offer/migrations/Migration20260520104835.d.ts} +1 -1
- package/.medusa/server/src/modules/offer/migrations/Migration20260520104835.js +22 -0
- package/.medusa/server/src/modules/{subscription/migrations/Migration20260324135903.d.ts → offer/migrations/Migration20260526000000.d.ts} +1 -1
- package/.medusa/server/src/modules/offer/migrations/Migration20260526000000.js +16 -0
- package/.medusa/server/src/modules/offer/models/index.d.ts +1 -0
- package/.medusa/server/src/modules/offer/models/index.js +9 -0
- package/.medusa/server/src/modules/offer/models/offer.d.ts +12 -0
- package/.medusa/server/src/modules/offer/models/offer.js +50 -0
- package/.medusa/server/src/modules/offer/service.d.ts +16 -0
- package/.medusa/server/src/modules/offer/service.js +10 -0
- package/.medusa/server/src/modules/product-attribute/index.d.ts +36 -0
- package/.medusa/server/src/modules/product-attribute/index.js +14 -0
- package/.medusa/server/src/modules/product-attribute/joiner-config.d.ts +1 -0
- package/.medusa/server/src/modules/product-attribute/joiner-config.js +17 -0
- package/.medusa/server/src/modules/{vendor-product-attribute/migrations/Migration20260325000000.d.ts → product-attribute/migrations/Migration20260601000000.d.ts} +1 -1
- package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000000.js +62 -0
- package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000001.d.ts +11 -0
- package/.medusa/server/src/modules/product-attribute/migrations/Migration20260601000001.js +29 -0
- package/.medusa/server/src/modules/product-attribute/models/index.d.ts +2 -0
- package/.medusa/server/src/modules/product-attribute/models/index.js +11 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.d.ts +25 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute-value.js +29 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute.d.ts +26 -0
- package/.medusa/server/src/modules/product-attribute/models/product-attribute.js +53 -0
- package/.medusa/server/src/modules/product-attribute/service.d.ts +55 -0
- package/.medusa/server/src/modules/product-attribute/service.js +15 -0
- package/.medusa/server/src/modules/product-edit/index.d.ts +36 -0
- package/.medusa/server/src/modules/product-edit/index.js +14 -0
- package/.medusa/server/src/modules/product-edit/joiner-config.d.ts +1 -0
- package/.medusa/server/src/modules/product-edit/joiner-config.js +17 -0
- package/.medusa/server/src/modules/product-edit/migrations/Migration20260601130000.d.ts +5 -0
- package/.medusa/server/src/modules/product-edit/migrations/Migration20260601130000.js +78 -0
- package/.medusa/server/src/modules/product-edit/models/index.d.ts +2 -0
- package/.medusa/server/src/modules/product-edit/models/index.js +11 -0
- package/.medusa/server/src/modules/product-edit/models/product-change-action.d.ts +49 -0
- package/.medusa/server/src/modules/product-edit/models/product-change-action.js +42 -0
- package/.medusa/server/src/modules/product-edit/models/product-change.d.ts +31 -0
- package/.medusa/server/src/modules/product-edit/models/product-change.js +52 -0
- package/.medusa/server/src/modules/product-edit/service.d.ts +84 -0
- package/.medusa/server/src/modules/product-edit/service.js +15 -0
- package/.medusa/server/src/modules/seller/loaders/register-feature-flags.js +7 -1
- package/.medusa/server/src/modules/seller/migrations/Migration20260414123048.d.ts +5 -0
- package/.medusa/server/src/modules/seller/migrations/Migration20260414123048.js +16 -0
- package/.medusa/server/src/subscribers/link-order-line-items-to-offers.d.ts +6 -0
- package/.medusa/server/src/subscribers/link-order-line-items-to-offers.js +94 -0
- package/.medusa/server/src/subscribers/order-edit-confirmed.d.ts +5 -0
- package/.medusa/server/src/subscribers/order-edit-confirmed.js +22 -0
- package/.medusa/server/src/types/cart-line-item.d.ts +6 -0
- package/.medusa/server/src/types/cart-line-item.js +3 -0
- package/.medusa/server/src/utils/disable-medusa-middlewares.d.ts +2 -0
- package/.medusa/server/src/utils/disable-medusa-middlewares.js +94 -0
- package/.medusa/server/src/with-mercur.js +4 -2
- package/.medusa/server/src/workflows/cart/hooks/before-refreshing-payment-collection.js +36 -0
- package/.medusa/server/src/workflows/cart/hooks/index.d.ts +3 -0
- package/.medusa/server/src/workflows/cart/hooks/index.js +6 -0
- package/.medusa/server/src/workflows/cart/hooks/set-pricing-context.js +94 -0
- package/.medusa/server/src/workflows/cart/hooks/validate.d.ts +1 -0
- package/.medusa/server/src/workflows/cart/hooks/validate.js +107 -0
- package/.medusa/server/src/workflows/cart/index.d.ts +1 -0
- package/.medusa/server/src/workflows/cart/index.js +2 -1
- package/.medusa/server/src/workflows/cart/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/cart/steps/index.js +3 -1
- package/.medusa/server/src/workflows/cart/steps/link-line-item-to-offer.d.ts +13 -0
- package/.medusa/server/src/workflows/cart/steps/link-line-item-to-offer.js +31 -0
- package/.medusa/server/src/workflows/cart/steps/mirror-line-item-offer-links-to-order.d.ts +16 -0
- package/.medusa/server/src/workflows/cart/steps/mirror-line-item-offer-links-to-order.js +32 -0
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-items.d.ts +5 -7
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-items.js +6 -4
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-shipping.d.ts +5 -6
- package/.medusa/server/src/workflows/cart/steps/validate-seller-cart-shipping.js +5 -4
- package/.medusa/server/src/workflows/cart/utils/fields.js +38 -20
- package/.medusa/server/src/workflows/cart/utils/index.d.ts +0 -1
- package/.medusa/server/src/workflows/cart/utils/index.js +1 -2
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.d.ts +1 -0
- package/.medusa/server/src/workflows/cart/utils/prepare-line-item-data.js +2 -2
- package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.js +104 -26
- package/.medusa/server/src/workflows/cart/workflows/list-seller-shipping-options-for-cart.js +18 -15
- package/.medusa/server/src/workflows/commission/workflows/refresh-order-commission-lines.js +5 -3
- package/.medusa/server/src/workflows/events.d.ts +5 -0
- package/.medusa/server/src/workflows/events.js +7 -2
- package/.medusa/server/src/workflows/index.d.ts +5 -1
- package/.medusa/server/src/workflows/index.js +6 -2
- package/.medusa/server/src/workflows/{attribute → offer}/index.d.ts +2 -1
- package/.medusa/server/src/workflows/{attribute/workflows → offer}/index.js +4 -6
- package/.medusa/server/src/workflows/offer/steps/add-offer-prices.d.ts +22 -0
- package/.medusa/server/src/workflows/offer/steps/add-offer-prices.js +64 -0
- package/.medusa/server/src/workflows/offer/steps/create-offers.d.ts +16 -0
- package/.medusa/server/src/workflows/offer/steps/create-offers.js +17 -0
- package/.medusa/server/src/workflows/offer/steps/delete-offers.d.ts +6 -0
- package/.medusa/server/src/workflows/offer/steps/delete-offers.js +21 -0
- package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.d.ts +15 -0
- package/.medusa/server/src/workflows/offer/steps/ensure-variant-price-sets.js +61 -0
- package/.medusa/server/src/workflows/offer/steps/index.d.ts +6 -0
- package/.medusa/server/src/workflows/offer/steps/index.js +23 -0
- package/.medusa/server/src/workflows/offer/steps/remove-offer-prices.d.ts +3 -0
- package/.medusa/server/src/workflows/offer/steps/remove-offer-prices.js +15 -0
- package/.medusa/server/src/workflows/offer/steps/update-offers.d.ts +25 -0
- package/.medusa/server/src/workflows/offer/steps/update-offers.js +35 -0
- package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.d.ts +17 -0
- package/.medusa/server/src/workflows/offer/utils/assert-offer-price-ownership.js +27 -0
- package/.medusa/server/src/workflows/offer/utils/index.d.ts +2 -0
- package/.medusa/server/src/workflows/{subscription/steps → offer/utils}/index.js +3 -7
- package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.d.ts +59 -0
- package/.medusa/server/src/workflows/offer/utils/prepare-offer-inventory-input.js +128 -0
- package/.medusa/server/src/workflows/offer/workflows/batch-offer-inventory-items.d.ts +21 -0
- package/.medusa/server/src/workflows/offer/workflows/batch-offer-inventory-items.js +118 -0
- package/.medusa/server/src/workflows/offer/workflows/create-offers.d.ts +17 -0
- package/.medusa/server/src/workflows/offer/workflows/create-offers.js +170 -0
- package/.medusa/server/src/workflows/offer/workflows/delete-offers.d.ts +11 -0
- package/.medusa/server/src/workflows/offer/workflows/delete-offers.js +22 -0
- package/.medusa/server/src/workflows/offer/workflows/index.d.ts +4 -0
- package/.medusa/server/src/workflows/{attribute/steps → offer/workflows}/index.js +5 -8
- package/.medusa/server/src/workflows/offer/workflows/update-offers.d.ts +28 -0
- package/.medusa/server/src/workflows/offer/workflows/update-offers.js +182 -0
- package/.medusa/server/src/workflows/order/index.d.ts +1 -0
- package/.medusa/server/src/workflows/{attribute → order}/index.js +1 -2
- package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.d.ts +15 -0
- package/.medusa/server/src/workflows/order/workflows/cancel-order-fulfillment.js +186 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.d.ts +7 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.js +151 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.d.ts +7 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.js +159 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-return-receive.d.ts +7 -0
- package/.medusa/server/src/workflows/order/workflows/confirm-return-receive.js +220 -0
- package/.medusa/server/src/workflows/order/workflows/create-order-fulfillment.d.ts +16 -0
- package/.medusa/server/src/workflows/order/workflows/create-order-fulfillment.js +366 -0
- package/.medusa/server/src/workflows/order/workflows/index.d.ts +5 -0
- package/.medusa/server/src/workflows/order/workflows/index.js +22 -0
- package/.medusa/server/src/workflows/product/events.d.ts +12 -0
- package/.medusa/server/src/workflows/product/events.js +16 -0
- package/.medusa/server/src/workflows/product/index.d.ts +3 -0
- package/.medusa/server/src/workflows/product/index.js +20 -0
- package/.medusa/server/src/workflows/product/steps/associate-sellers-with-product-category.d.ts +8 -0
- package/.medusa/server/src/workflows/product/steps/associate-sellers-with-product-category.js +26 -0
- package/.medusa/server/src/workflows/product/steps/associate-sellers-with-product.d.ts +8 -0
- package/.medusa/server/src/workflows/product/steps/associate-sellers-with-product.js +26 -0
- package/.medusa/server/src/workflows/product/steps/detach-sellers-from-product-category.d.ts +8 -0
- package/.medusa/server/src/workflows/product/steps/detach-sellers-from-product-category.js +26 -0
- package/.medusa/server/src/workflows/product/steps/detach-sellers-from-product.d.ts +8 -0
- package/.medusa/server/src/workflows/product/steps/detach-sellers-from-product.js +26 -0
- package/.medusa/server/src/workflows/product/steps/index.d.ts +8 -0
- package/.medusa/server/src/workflows/product/steps/index.js +25 -0
- package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.d.ts +28 -0
- package/.medusa/server/src/workflows/product/steps/replace-product-attribute-value-links.js +72 -0
- package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.d.ts +90 -0
- package/.medusa/server/src/workflows/product/steps/resolve-attribute-refs.js +185 -0
- package/.medusa/server/src/workflows/product/steps/validate-products-status.d.ts +19 -0
- package/.medusa/server/src/workflows/product/steps/validate-products-status.js +28 -0
- package/.medusa/server/src/workflows/product/steps/validate-seller-product-permissions.d.ts +6 -0
- package/.medusa/server/src/workflows/product/steps/validate-seller-product-permissions.js +26 -0
- package/.medusa/server/src/workflows/product/workflows/confirm-products.d.ts +27 -0
- package/.medusa/server/src/workflows/product/workflows/confirm-products.js +68 -0
- package/.medusa/server/src/workflows/product/workflows/create-products.d.ts +59 -0
- package/.medusa/server/src/workflows/product/workflows/create-products.js +221 -0
- package/.medusa/server/src/workflows/product/workflows/index.d.ts +7 -0
- package/.medusa/server/src/workflows/product/workflows/index.js +24 -0
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.d.ts +14 -0
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product-category.js +20 -0
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.d.ts +14 -0
- package/.medusa/server/src/workflows/product/workflows/link-sellers-to-product.js +20 -0
- package/.medusa/server/src/workflows/product/workflows/reject-product.d.ts +18 -0
- package/.medusa/server/src/workflows/product/workflows/reject-product.js +65 -0
- package/.medusa/server/src/workflows/product/workflows/request-product-change.d.ts +25 -0
- package/.medusa/server/src/workflows/product/workflows/request-product-change.js +69 -0
- package/.medusa/server/src/workflows/product/workflows/update-products.d.ts +39 -0
- package/.medusa/server/src/workflows/product/workflows/update-products.js +161 -0
- package/.medusa/server/src/workflows/product-attribute/events.d.ts +19 -0
- package/.medusa/server/src/workflows/product-attribute/events.js +23 -0
- package/.medusa/server/src/workflows/{subscription → product-attribute}/index.d.ts +1 -0
- package/.medusa/server/src/workflows/product-attribute/index.js +20 -0
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attribute-values.d.ts +37 -0
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attribute-values.js +18 -0
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.d.ts +44 -0
- package/.medusa/server/src/workflows/product-attribute/steps/create-product-attributes.js +18 -0
- package/.medusa/server/src/workflows/product-attribute/steps/delete-product-attribute-values.d.ts +2 -0
- package/.medusa/server/src/workflows/product-attribute/steps/delete-product-attribute-values.js +18 -0
- package/.medusa/server/src/workflows/product-attribute/steps/delete-product-attributes.d.ts +2 -0
- package/.medusa/server/src/workflows/product-attribute/steps/delete-product-attributes.js +18 -0
- package/.medusa/server/src/workflows/product-attribute/steps/index.d.ts +10 -7
- package/.medusa/server/src/workflows/product-attribute/steps/index.js +11 -8
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.d.ts +38 -0
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attribute-values.js +23 -0
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attributes.d.ts +38 -0
- package/.medusa/server/src/workflows/product-attribute/steps/update-product-attributes.js +23 -0
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.d.ts +43 -0
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-attribute-values.js +51 -0
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.d.ts +7 -0
- package/.medusa/server/src/workflows/product-attribute/steps/upsert-product-options-for-axis.js +59 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.d.ts +6 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-accepts-values.js +20 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.d.ts +7 -0
- package/.medusa/server/src/workflows/product-attribute/steps/validate-product-attribute-input.js +20 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.d.ts +52 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/add-product-attribute.js +120 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.d.ts +23 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/batch-product-attribute-values.js +252 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attribute-values.d.ts +18 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attribute-values.js +26 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attributes.d.ts +19 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/create-product-attributes.js +64 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attribute-values.d.ts +16 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attribute-values.js +40 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.d.ts +23 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-product-attributes.js +31 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.d.ts +17 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/detach-product-attribute.js +62 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/index.d.ts +13 -8
- package/.medusa/server/src/workflows/product-attribute/workflows/index.js +14 -9
- package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.d.ts +135 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/materialize-product-attributes.js +43 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.d.ts +24 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-options.js +27 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute-values.d.ts +18 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute-values.js +27 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute.d.ts +23 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute.js +67 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes.d.ts +18 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attributes.js +27 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.d.ts +18 -0
- package/.medusa/server/src/workflows/product-attribute/workflows/upsert-product-attribute-values.js +26 -0
- package/.medusa/server/src/workflows/product-edit/events.d.ts +13 -0
- package/.medusa/server/src/workflows/product-edit/events.js +17 -0
- package/.medusa/server/src/workflows/product-edit/index.d.ts +3 -0
- package/.medusa/server/src/workflows/{subscription → product-edit}/index.js +2 -1
- package/.medusa/server/src/workflows/product-edit/steps/add-product-change-action.d.ts +38 -0
- package/.medusa/server/src/workflows/product-edit/steps/add-product-change-action.js +18 -0
- package/.medusa/server/src/workflows/product-edit/steps/cancel-product-change.d.ts +43 -0
- package/.medusa/server/src/workflows/product-edit/steps/cancel-product-change.js +32 -0
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.d.ts +15 -0
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-change-validation.js +25 -0
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.d.ts +51 -0
- package/.medusa/server/src/workflows/product-edit/steps/confirm-product-changes.js +48 -0
- package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.d.ts +43 -0
- package/.medusa/server/src/workflows/product-edit/steps/create-product-change-actions.js +26 -0
- package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.d.ts +47 -0
- package/.medusa/server/src/workflows/product-edit/steps/create-product-changes.js +18 -0
- package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.d.ts +49 -0
- package/.medusa/server/src/workflows/product-edit/steps/decline-product-change.js +41 -0
- package/.medusa/server/src/workflows/product-edit/steps/index.d.ts +10 -0
- package/.medusa/server/src/workflows/product-edit/steps/index.js +27 -0
- package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.d.ts +49 -0
- package/.medusa/server/src/workflows/product-edit/steps/update-product-change-actions.js +34 -0
- package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.d.ts +12 -0
- package/.medusa/server/src/workflows/product-edit/steps/validate-no-pending-product-change.js +37 -0
- package/.medusa/server/src/workflows/product-edit/steps/validate-product-change-is-pending.d.ts +10 -0
- package/.medusa/server/src/workflows/product-edit/steps/validate-product-change-is-pending.js +14 -0
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.d.ts +23 -0
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-attribute-change-actions.js +139 -0
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.d.ts +38 -0
- package/.medusa/server/src/workflows/product-edit/workflows/apply-product-change-actions.js +191 -0
- package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.d.ts +17 -0
- package/.medusa/server/src/workflows/product-edit/workflows/auto-confirm-product-change.js +29 -0
- package/.medusa/server/src/workflows/product-edit/workflows/cancel-product-change.d.ts +17 -0
- package/.medusa/server/src/workflows/product-edit/workflows/cancel-product-change.js +35 -0
- package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.d.ts +30 -0
- package/.medusa/server/src/workflows/product-edit/workflows/confirm-product-change.js +55 -0
- package/.medusa/server/src/workflows/product-edit/workflows/create-product-change.d.ts +17 -0
- package/.medusa/server/src/workflows/product-edit/workflows/create-product-change.js +26 -0
- package/.medusa/server/src/workflows/product-edit/workflows/index.d.ts +13 -0
- package/.medusa/server/src/workflows/product-edit/workflows/index.js +30 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.d.ts +17 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-delete-product.js +35 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.d.ts +55 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-attributes.js +198 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.d.ts +25 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-fields.js +148 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.d.ts +35 -0
- package/.medusa/server/src/workflows/product-edit/workflows/product-edit-update-variants.js +108 -0
- package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.d.ts +36 -0
- package/.medusa/server/src/workflows/product-edit/workflows/record-product-audit-change.js +53 -0
- package/.medusa/server/src/workflows/product-edit/workflows/reject-product-change.d.ts +18 -0
- package/.medusa/server/src/workflows/product-edit/workflows/reject-product-change.js +36 -0
- package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.d.ts +35 -0
- package/.medusa/server/src/workflows/product-edit/workflows/stage-product-change.js +57 -0
- package/.medusa/server/src/workflows/seller/workflows/create-sellers.d.ts +20 -2
- package/.medusa/server/src/workflows/seller/workflows/create-sellers.js +5 -2
- package/.medusa/server/src/workflows/seller/workflows/update-seller-address.d.ts +14 -2
- package/.medusa/server/src/workflows/seller/workflows/update-seller-address.js +1 -1
- package/.medusa/server/src/workflows/seller/workflows/update-seller-payment-details.d.ts +14 -2
- package/.medusa/server/src/workflows/seller/workflows/update-seller-payment-details.js +1 -1
- package/.medusa/server/src/workflows/seller/workflows/update-seller-professional-details.d.ts +14 -2
- package/.medusa/server/src/workflows/seller/workflows/update-seller-professional-details.js +1 -1
- package/.medusa/server/src/workflows/seller/workflows/update-seller.d.ts +14 -2
- package/.medusa/server/src/workflows/seller/workflows/update-seller.js +1 -1
- package/package.json +8 -4
- package/.medusa/server/src/api/admin/attributes/[id]/route.d.ts +0 -5
- package/.medusa/server/src/api/admin/attributes/[id]/route.js +0 -68
- package/.medusa/server/src/api/admin/attributes/[id]/values/[value_id]/route.d.ts +0 -4
- package/.medusa/server/src/api/admin/attributes/[id]/values/[value_id]/route.js +0 -40
- package/.medusa/server/src/api/admin/attributes/[id]/values/route.d.ts +0 -4
- package/.medusa/server/src/api/admin/attributes/[id]/values/route.js +0 -44
- package/.medusa/server/src/api/admin/attributes/middlewares.d.ts +0 -2
- package/.medusa/server/src/api/admin/attributes/middlewares.js +0 -102
- package/.medusa/server/src/api/admin/attributes/query-config.d.ts +0 -20
- package/.medusa/server/src/api/admin/attributes/query-config.js +0 -41
- package/.medusa/server/src/api/admin/attributes/route.d.ts +0 -4
- package/.medusa/server/src/api/admin/attributes/route.js +0 -51
- package/.medusa/server/src/api/admin/attributes/validators.d.ts +0 -793
- package/.medusa/server/src/api/admin/attributes/validators.js +0 -92
- package/.medusa/server/src/api/admin/subscription-plans/[id]/overrides/[override_id]/route.d.ts +0 -6
- package/.medusa/server/src/api/admin/subscription-plans/[id]/overrides/[override_id]/route.js +0 -43
- package/.medusa/server/src/api/admin/subscription-plans/[id]/overrides/route.js +0 -24
- package/.medusa/server/src/api/admin/subscription-plans/[id]/route.d.ts +0 -6
- package/.medusa/server/src/api/admin/subscription-plans/[id]/route.js +0 -43
- package/.medusa/server/src/api/admin/subscription-plans/middlewares.d.ts +0 -2
- package/.medusa/server/src/api/admin/subscription-plans/middlewares.js +0 -81
- package/.medusa/server/src/api/admin/subscription-plans/query-config.d.ts +0 -17
- package/.medusa/server/src/api/admin/subscription-plans/query-config.js +0 -43
- package/.medusa/server/src/api/admin/subscription-plans/route.d.ts +0 -5
- package/.medusa/server/src/api/admin/subscription-plans/route.js +0 -35
- package/.medusa/server/src/api/admin/subscription-plans/validators.d.ts +0 -117
- package/.medusa/server/src/api/admin/subscription-plans/validators.js +0 -42
- package/.medusa/server/src/api/vendor/attributes/middlewares.d.ts +0 -2
- package/.medusa/server/src/api/vendor/attributes/middlewares.js +0 -32
- package/.medusa/server/src/api/vendor/attributes/route.js +0 -20
- package/.medusa/server/src/api/vendor/product-categories/helpers.d.ts +0 -2
- package/.medusa/server/src/api/vendor/product-categories/helpers.js +0 -24
- package/.medusa/server/src/api/vendor/products/[id]/attributes/utils.d.ts +0 -7
- package/.medusa/server/src/api/vendor/products/[id]/attributes/utils.js +0 -16
- package/.medusa/server/src/api/vendor/products/[id]/options/[option_id]/route.d.ts +0 -5
- package/.medusa/server/src/api/vendor/products/[id]/options/[option_id]/route.js +0 -74
- package/.medusa/server/src/api/vendor/products/[id]/options/route.d.ts +0 -4
- package/.medusa/server/src/api/vendor/products/[id]/options/route.js +0 -34
- package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/media/route.js +0 -20
- package/.medusa/server/src/api/vendor/products/utils/transform-product-attributes.d.ts +0 -34
- package/.medusa/server/src/api/vendor/products/utils/transform-product-attributes.js +0 -71
- package/.medusa/server/src/api/vendor/subscription/middlewares.d.ts +0 -2
- package/.medusa/server/src/api/vendor/subscription/middlewares.js +0 -28
- package/.medusa/server/src/api/vendor/subscription/route.js +0 -31
- package/.medusa/server/src/links/category-attribute-link.js +0 -16
- package/.medusa/server/src/links/product-vendor-product-attribute-link.js +0 -16
- package/.medusa/server/src/links/seller-attribute-link.js +0 -13
- package/.medusa/server/src/links/seller-attribute-value-link.js +0 -13
- package/.medusa/server/src/links/seller-vendor-product-attribute-link.js +0 -13
- package/.medusa/server/src/modules/attribute/index.d.ts +0 -51
- package/.medusa/server/src/modules/attribute/index.js +0 -15
- package/.medusa/server/src/modules/attribute/migrations/Migration20260325000000.js +0 -32
- package/.medusa/server/src/modules/attribute/models/attribute-possible-value.d.ts +0 -27
- package/.medusa/server/src/modules/attribute/models/attribute-possible-value.js +0 -26
- package/.medusa/server/src/modules/attribute/models/attribute-value.d.ts +0 -27
- package/.medusa/server/src/modules/attribute/models/attribute-value.js +0 -26
- package/.medusa/server/src/modules/attribute/models/attribute.d.ts +0 -28
- package/.medusa/server/src/modules/attribute/models/attribute.js +0 -36
- package/.medusa/server/src/modules/attribute/models/index.d.ts +0 -3
- package/.medusa/server/src/modules/attribute/models/index.js +0 -13
- package/.medusa/server/src/modules/attribute/service.d.ts +0 -105
- package/.medusa/server/src/modules/attribute/service.js +0 -74
- package/.medusa/server/src/modules/subscription/index.d.ts +0 -35
- package/.medusa/server/src/modules/subscription/migrations/Migration20260324135903.js +0 -24
- package/.medusa/server/src/modules/subscription/models/index.d.ts +0 -2
- package/.medusa/server/src/modules/subscription/models/index.js +0 -11
- package/.medusa/server/src/modules/subscription/models/subscription-override.d.ts +0 -20
- package/.medusa/server/src/modules/subscription/models/subscription-override.js +0 -36
- package/.medusa/server/src/modules/subscription/models/subscription-plan.d.ts +0 -20
- package/.medusa/server/src/modules/subscription/models/subscription-plan.js +0 -32
- package/.medusa/server/src/modules/subscription/service.d.ts +0 -49
- package/.medusa/server/src/modules/subscription/service.js +0 -17
- package/.medusa/server/src/modules/vendor-product-attribute/index.d.ts +0 -23
- package/.medusa/server/src/modules/vendor-product-attribute/index.js +0 -15
- package/.medusa/server/src/modules/vendor-product-attribute/migrations/Migration20260325000000.js +0 -16
- package/.medusa/server/src/modules/vendor-product-attribute/models/vendor-product-attribute.d.ts +0 -11
- package/.medusa/server/src/modules/vendor-product-attribute/models/vendor-product-attribute.js +0 -24
- package/.medusa/server/src/modules/vendor-product-attribute/service.d.ts +0 -14
- package/.medusa/server/src/modules/vendor-product-attribute/service.js +0 -13
- package/.medusa/server/src/workflows/attribute/steps/create-attribute-possible-values.d.ts +0 -40
- package/.medusa/server/src/workflows/attribute/steps/create-attribute-possible-values.js +0 -18
- package/.medusa/server/src/workflows/attribute/steps/create-attributes.d.ts +0 -5
- package/.medusa/server/src/workflows/attribute/steps/create-attributes.js +0 -32
- package/.medusa/server/src/workflows/attribute/steps/delete-attribute.d.ts +0 -6
- package/.medusa/server/src/workflows/attribute/steps/delete-attribute.js +0 -31
- package/.medusa/server/src/workflows/attribute/steps/index.d.ts +0 -7
- package/.medusa/server/src/workflows/attribute/steps/update-attribute-possible-value.d.ts +0 -39
- package/.medusa/server/src/workflows/attribute/steps/update-attribute-possible-value.js +0 -18
- package/.medusa/server/src/workflows/attribute/steps/update-attributes.d.ts +0 -21
- package/.medusa/server/src/workflows/attribute/steps/update-attributes.js +0 -37
- package/.medusa/server/src/workflows/attribute/steps/validate-attribute-delete.d.ts +0 -6
- package/.medusa/server/src/workflows/attribute/steps/validate-attribute-delete.js +0 -50
- package/.medusa/server/src/workflows/attribute/steps/validate-possible-values-removal.d.ts +0 -7
- package/.medusa/server/src/workflows/attribute/steps/validate-possible-values-removal.js +0 -70
- package/.medusa/server/src/workflows/attribute/workflows/create-attribute-possible-values.d.ts +0 -39
- package/.medusa/server/src/workflows/attribute/workflows/create-attribute-possible-values.js +0 -11
- package/.medusa/server/src/workflows/attribute/workflows/create-attributes.d.ts +0 -7
- package/.medusa/server/src/workflows/attribute/workflows/create-attributes.js +0 -40
- package/.medusa/server/src/workflows/attribute/workflows/delete-attribute.d.ts +0 -6
- package/.medusa/server/src/workflows/attribute/workflows/delete-attribute.js +0 -11
- package/.medusa/server/src/workflows/attribute/workflows/index.d.ts +0 -5
- package/.medusa/server/src/workflows/attribute/workflows/update-attribute-possible-value.d.ts +0 -39
- package/.medusa/server/src/workflows/attribute/workflows/update-attribute-possible-value.js +0 -11
- package/.medusa/server/src/workflows/attribute/workflows/update-attributes.d.ts +0 -24
- package/.medusa/server/src/workflows/attribute/workflows/update-attributes.js +0 -69
- package/.medusa/server/src/workflows/cart/utils/prepare-confirm-inventory-input.d.ts +0 -28
- package/.medusa/server/src/workflows/cart/utils/prepare-confirm-inventory-input.js +0 -165
- package/.medusa/server/src/workflows/hooks/product-created.js +0 -75
- package/.medusa/server/src/workflows/hooks/product-variant-created.js +0 -50
- package/.medusa/server/src/workflows/product-attribute/steps/create-attribute-value.d.ts +0 -39
- package/.medusa/server/src/workflows/product-attribute/steps/create-attribute-value.js +0 -21
- package/.medusa/server/src/workflows/product-attribute/steps/create-attribute-values.d.ts +0 -12
- package/.medusa/server/src/workflows/product-attribute/steps/create-attribute-values.js +0 -24
- package/.medusa/server/src/workflows/product-attribute/steps/create-vendor-product-attribute.d.ts +0 -14
- package/.medusa/server/src/workflows/product-attribute/steps/create-vendor-product-attribute.js +0 -18
- package/.medusa/server/src/workflows/product-attribute/steps/delete-attribute-value.d.ts +0 -2
- package/.medusa/server/src/workflows/product-attribute/steps/delete-attribute-value.js +0 -18
- package/.medusa/server/src/workflows/product-attribute/steps/restore-variant-image-associations.d.ts +0 -10
- package/.medusa/server/src/workflows/product-attribute/steps/restore-variant-image-associations.js +0 -49
- package/.medusa/server/src/workflows/product-attribute/steps/save-variant-image-associations.d.ts +0 -8
- package/.medusa/server/src/workflows/product-attribute/steps/save-variant-image-associations.js +0 -29
- package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-value.d.ts +0 -3
- package/.medusa/server/src/workflows/product-attribute/steps/validate-attribute-value.js +0 -59
- package/.medusa/server/src/workflows/product-attribute/utils/find-or-create-vendor-attribute.d.ts +0 -13
- package/.medusa/server/src/workflows/product-attribute/utils/find-or-create-vendor-attribute.js +0 -56
- package/.medusa/server/src/workflows/product-attribute/utils/get-applicable-attributes.d.ts +0 -2
- package/.medusa/server/src/workflows/product-attribute/utils/get-applicable-attributes.js +0 -58
- package/.medusa/server/src/workflows/product-attribute/utils/products-created-handler.d.ts +0 -8
- package/.medusa/server/src/workflows/product-attribute/utils/products-created-handler.js +0 -100
- package/.medusa/server/src/workflows/product-attribute/workflows/convert-attribute-to-option.d.ts +0 -3
- package/.medusa/server/src/workflows/product-attribute/workflows/convert-attribute-to-option.js +0 -46
- package/.medusa/server/src/workflows/product-attribute/workflows/convert-option-to-attribute.d.ts +0 -3
- package/.medusa/server/src/workflows/product-attribute/workflows/convert-option-to-attribute.js +0 -29
- package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-attribute-values.d.ts +0 -16
- package/.medusa/server/src/workflows/product-attribute/workflows/create-and-link-attribute-values.js +0 -72
- package/.medusa/server/src/workflows/product-attribute/workflows/create-attribute-value.d.ts +0 -39
- package/.medusa/server/src/workflows/product-attribute/workflows/create-attribute-value.js +0 -35
- package/.medusa/server/src/workflows/product-attribute/workflows/create-vendor-product-attribute.d.ts +0 -24
- package/.medusa/server/src/workflows/product-attribute/workflows/create-vendor-product-attribute.js +0 -42
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-attribute-value.d.ts +0 -3
- package/.medusa/server/src/workflows/product-attribute/workflows/delete-attribute-value.js +0 -59
- package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-values.d.ts +0 -20
- package/.medusa/server/src/workflows/product-attribute/workflows/sync-product-attribute-values.js +0 -67
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-with-variant-images.d.ts +0 -11
- package/.medusa/server/src/workflows/product-attribute/workflows/update-product-with-variant-images.js +0 -34
- package/.medusa/server/src/workflows/subscription/steps/create-subscription-overrides.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/steps/create-subscription-overrides.js +0 -17
- package/.medusa/server/src/workflows/subscription/steps/create-subscription-plans.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/steps/create-subscription-plans.js +0 -17
- package/.medusa/server/src/workflows/subscription/steps/delete-subscription-overrides.d.ts +0 -2
- package/.medusa/server/src/workflows/subscription/steps/delete-subscription-overrides.js +0 -17
- package/.medusa/server/src/workflows/subscription/steps/delete-subscription-plans.d.ts +0 -2
- package/.medusa/server/src/workflows/subscription/steps/delete-subscription-plans.js +0 -17
- package/.medusa/server/src/workflows/subscription/steps/index.d.ts +0 -6
- package/.medusa/server/src/workflows/subscription/steps/update-subscription-overrides.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/steps/update-subscription-overrides.js +0 -17
- package/.medusa/server/src/workflows/subscription/steps/update-subscription-plans.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/steps/update-subscription-plans.js +0 -17
- package/.medusa/server/src/workflows/subscription/workflows/create-subscription-overrides.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/workflows/create-subscription-overrides.js +0 -11
- package/.medusa/server/src/workflows/subscription/workflows/create-subscription-plans.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/workflows/create-subscription-plans.js +0 -11
- package/.medusa/server/src/workflows/subscription/workflows/delete-subscription-overrides.d.ts +0 -5
- package/.medusa/server/src/workflows/subscription/workflows/delete-subscription-overrides.js +0 -11
- package/.medusa/server/src/workflows/subscription/workflows/delete-subscription-plans.d.ts +0 -5
- package/.medusa/server/src/workflows/subscription/workflows/delete-subscription-plans.js +0 -11
- package/.medusa/server/src/workflows/subscription/workflows/index.d.ts +0 -6
- package/.medusa/server/src/workflows/subscription/workflows/index.js +0 -23
- package/.medusa/server/src/workflows/subscription/workflows/update-subscription-overrides.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/workflows/update-subscription-overrides.js +0 -11
- package/.medusa/server/src/workflows/subscription/workflows/update-subscription-plans.d.ts +0 -31
- package/.medusa/server/src/workflows/subscription/workflows/update-subscription-plans.js +0 -11
- /package/.medusa/server/src/links/{category-attribute-link.d.ts → cart-line-item-offer-link.d.ts} +0 -0
- /package/.medusa/server/src/links/{product-vendor-product-attribute-link.d.ts → category-seller-link.d.ts} +0 -0
- /package/.medusa/server/src/links/{seller-attribute-link.d.ts → offer-inventory-item-link.d.ts} +0 -0
- /package/.medusa/server/src/links/{seller-attribute-value-link.d.ts → offer-price-link.d.ts} +0 -0
- /package/.medusa/server/src/links/{seller-vendor-product-attribute-link.d.ts → offer-seller-link.d.ts} +0 -0
- /package/.medusa/server/src/workflows/{hooks/product-created.d.ts → cart/hooks/before-refreshing-payment-collection.d.ts} +0 -0
- /package/.medusa/server/src/workflows/{hooks/product-variant-created.d.ts → cart/hooks/set-pricing-context.d.ts} +0 -0
|
@@ -462,13 +462,13 @@ export declare const VendorGetPromotionsParams: z.ZodObject<{
|
|
|
462
462
|
}, "strip", z.ZodTypeAny, {
|
|
463
463
|
offset: number;
|
|
464
464
|
limit: number;
|
|
465
|
+
order?: string | undefined;
|
|
465
466
|
id?: any;
|
|
466
467
|
created_at?: any;
|
|
467
468
|
updated_at?: any;
|
|
468
469
|
code?: any;
|
|
469
470
|
q?: string | undefined;
|
|
470
471
|
fields?: string | undefined;
|
|
471
|
-
order?: string | undefined;
|
|
472
472
|
with_deleted?: boolean | undefined;
|
|
473
473
|
deleted_at?: any;
|
|
474
474
|
campaign_id?: string | string[] | undefined;
|
|
@@ -476,6 +476,7 @@ export declare const VendorGetPromotionsParams: z.ZodObject<{
|
|
|
476
476
|
currency_code?: string | string[] | undefined;
|
|
477
477
|
} | undefined;
|
|
478
478
|
}, {
|
|
479
|
+
order?: string | undefined;
|
|
479
480
|
id?: any;
|
|
480
481
|
created_at?: any;
|
|
481
482
|
updated_at?: any;
|
|
@@ -484,7 +485,6 @@ export declare const VendorGetPromotionsParams: z.ZodObject<{
|
|
|
484
485
|
limit?: unknown;
|
|
485
486
|
q?: string | undefined;
|
|
486
487
|
fields?: string | undefined;
|
|
487
|
-
order?: string | undefined;
|
|
488
488
|
with_deleted?: unknown;
|
|
489
489
|
deleted_at?: any;
|
|
490
490
|
campaign_id?: string | string[] | undefined;
|
|
@@ -539,19 +539,19 @@ export declare const VendorGetPromotionsRuleValueParams: z.ZodObject<{
|
|
|
539
539
|
}, "strip", z.ZodTypeAny, {
|
|
540
540
|
offset: number;
|
|
541
541
|
limit: number;
|
|
542
|
+
order?: string | undefined;
|
|
542
543
|
value?: string | string[] | undefined;
|
|
543
544
|
q?: string | undefined;
|
|
544
545
|
fields?: string | undefined;
|
|
545
|
-
order?: string | undefined;
|
|
546
546
|
with_deleted?: boolean | undefined;
|
|
547
547
|
application_method_target_type?: string | undefined;
|
|
548
548
|
}, {
|
|
549
|
+
order?: string | undefined;
|
|
549
550
|
value?: string | string[] | undefined;
|
|
550
551
|
offset?: unknown;
|
|
551
552
|
limit?: unknown;
|
|
552
553
|
q?: string | undefined;
|
|
553
554
|
fields?: string | undefined;
|
|
554
|
-
order?: string | undefined;
|
|
555
555
|
with_deleted?: unknown;
|
|
556
556
|
application_method_target_type?: string | undefined;
|
|
557
557
|
}>;
|
|
@@ -640,8 +640,8 @@ export declare const VendorCreateApplicationMethod: z.ZodObject<{
|
|
|
640
640
|
type: ApplicationMethodType;
|
|
641
641
|
target_type: ApplicationMethodTargetType;
|
|
642
642
|
currency_code?: string | undefined;
|
|
643
|
-
description?: string | null | undefined;
|
|
644
643
|
max_quantity?: number | null | undefined;
|
|
644
|
+
description?: string | null | undefined;
|
|
645
645
|
allocation?: "each" | "across" | undefined;
|
|
646
646
|
target_rules?: {
|
|
647
647
|
values: string | string[];
|
|
@@ -662,8 +662,8 @@ export declare const VendorCreateApplicationMethod: z.ZodObject<{
|
|
|
662
662
|
type: ApplicationMethodType;
|
|
663
663
|
target_type: ApplicationMethodTargetType;
|
|
664
664
|
currency_code?: string | undefined;
|
|
665
|
-
description?: string | null | undefined;
|
|
666
665
|
max_quantity?: number | null | undefined;
|
|
666
|
+
description?: string | null | undefined;
|
|
667
667
|
allocation?: "each" | "across" | undefined;
|
|
668
668
|
target_rules?: {
|
|
669
669
|
values: string | string[];
|
|
@@ -695,8 +695,8 @@ export declare const VendorUpdateApplicationMethod: z.ZodObject<{
|
|
|
695
695
|
value?: number | undefined;
|
|
696
696
|
type?: ApplicationMethodType | undefined;
|
|
697
697
|
currency_code?: string | undefined;
|
|
698
|
-
description?: string | null | undefined;
|
|
699
698
|
max_quantity?: number | null | undefined;
|
|
699
|
+
description?: string | null | undefined;
|
|
700
700
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
701
701
|
allocation?: "each" | "across" | undefined;
|
|
702
702
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -705,8 +705,8 @@ export declare const VendorUpdateApplicationMethod: z.ZodObject<{
|
|
|
705
705
|
value?: number | undefined;
|
|
706
706
|
type?: ApplicationMethodType | undefined;
|
|
707
707
|
currency_code?: string | undefined;
|
|
708
|
-
description?: string | null | undefined;
|
|
709
708
|
max_quantity?: number | null | undefined;
|
|
709
|
+
description?: string | null | undefined;
|
|
710
710
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
711
711
|
allocation?: "each" | "across" | undefined;
|
|
712
712
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -767,8 +767,8 @@ export declare const VendorCreatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
767
767
|
type: ApplicationMethodType;
|
|
768
768
|
target_type: ApplicationMethodTargetType;
|
|
769
769
|
currency_code?: string | undefined;
|
|
770
|
-
description?: string | null | undefined;
|
|
771
770
|
max_quantity?: number | null | undefined;
|
|
771
|
+
description?: string | null | undefined;
|
|
772
772
|
allocation?: "each" | "across" | undefined;
|
|
773
773
|
target_rules?: {
|
|
774
774
|
values: string | string[];
|
|
@@ -789,8 +789,8 @@ export declare const VendorCreatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
789
789
|
type: ApplicationMethodType;
|
|
790
790
|
target_type: ApplicationMethodTargetType;
|
|
791
791
|
currency_code?: string | undefined;
|
|
792
|
-
description?: string | null | undefined;
|
|
793
792
|
max_quantity?: number | null | undefined;
|
|
793
|
+
description?: string | null | undefined;
|
|
794
794
|
allocation?: "each" | "across" | undefined;
|
|
795
795
|
target_rules?: {
|
|
796
796
|
values: string | string[];
|
|
@@ -832,8 +832,8 @@ export declare const VendorCreatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
832
832
|
type: ApplicationMethodType;
|
|
833
833
|
target_type: ApplicationMethodTargetType;
|
|
834
834
|
currency_code?: string | undefined;
|
|
835
|
-
description?: string | null | undefined;
|
|
836
835
|
max_quantity?: number | null | undefined;
|
|
836
|
+
description?: string | null | undefined;
|
|
837
837
|
allocation?: "each" | "across" | undefined;
|
|
838
838
|
target_rules?: {
|
|
839
839
|
values: string | string[];
|
|
@@ -867,8 +867,8 @@ export declare const VendorCreatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
867
867
|
type: ApplicationMethodType;
|
|
868
868
|
target_type: ApplicationMethodTargetType;
|
|
869
869
|
currency_code?: string | undefined;
|
|
870
|
-
description?: string | null | undefined;
|
|
871
870
|
max_quantity?: number | null | undefined;
|
|
871
|
+
description?: string | null | undefined;
|
|
872
872
|
allocation?: "each" | "across" | undefined;
|
|
873
873
|
target_rules?: {
|
|
874
874
|
values: string | string[];
|
|
@@ -904,8 +904,8 @@ export declare const VendorCreatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
904
904
|
type: ApplicationMethodType;
|
|
905
905
|
target_type: ApplicationMethodTargetType;
|
|
906
906
|
currency_code?: string | undefined;
|
|
907
|
-
description?: string | null | undefined;
|
|
908
907
|
max_quantity?: number | null | undefined;
|
|
908
|
+
description?: string | null | undefined;
|
|
909
909
|
allocation?: "each" | "across" | undefined;
|
|
910
910
|
target_rules?: {
|
|
911
911
|
values: string | string[];
|
|
@@ -939,8 +939,8 @@ export declare const VendorCreatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
939
939
|
type: ApplicationMethodType;
|
|
940
940
|
target_type: ApplicationMethodTargetType;
|
|
941
941
|
currency_code?: string | undefined;
|
|
942
|
-
description?: string | null | undefined;
|
|
943
942
|
max_quantity?: number | null | undefined;
|
|
943
|
+
description?: string | null | undefined;
|
|
944
944
|
allocation?: "each" | "across" | undefined;
|
|
945
945
|
target_rules?: {
|
|
946
946
|
values: string | string[];
|
|
@@ -990,8 +990,8 @@ export declare const VendorUpdatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
990
990
|
value?: number | undefined;
|
|
991
991
|
type?: ApplicationMethodType | undefined;
|
|
992
992
|
currency_code?: string | undefined;
|
|
993
|
-
description?: string | null | undefined;
|
|
994
993
|
max_quantity?: number | null | undefined;
|
|
994
|
+
description?: string | null | undefined;
|
|
995
995
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
996
996
|
allocation?: "each" | "across" | undefined;
|
|
997
997
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -1000,8 +1000,8 @@ export declare const VendorUpdatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
1000
1000
|
value?: number | undefined;
|
|
1001
1001
|
type?: ApplicationMethodType | undefined;
|
|
1002
1002
|
currency_code?: string | undefined;
|
|
1003
|
-
description?: string | null | undefined;
|
|
1004
1003
|
max_quantity?: number | null | undefined;
|
|
1004
|
+
description?: string | null | undefined;
|
|
1005
1005
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
1006
1006
|
allocation?: "each" | "across" | undefined;
|
|
1007
1007
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -1018,8 +1018,8 @@ export declare const VendorUpdatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
1018
1018
|
value?: number | undefined;
|
|
1019
1019
|
type?: ApplicationMethodType | undefined;
|
|
1020
1020
|
currency_code?: string | undefined;
|
|
1021
|
-
description?: string | null | undefined;
|
|
1022
1021
|
max_quantity?: number | null | undefined;
|
|
1022
|
+
description?: string | null | undefined;
|
|
1023
1023
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
1024
1024
|
allocation?: "each" | "across" | undefined;
|
|
1025
1025
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -1036,8 +1036,8 @@ export declare const VendorUpdatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
1036
1036
|
value?: number | undefined;
|
|
1037
1037
|
type?: ApplicationMethodType | undefined;
|
|
1038
1038
|
currency_code?: string | undefined;
|
|
1039
|
-
description?: string | null | undefined;
|
|
1040
1039
|
max_quantity?: number | null | undefined;
|
|
1040
|
+
description?: string | null | undefined;
|
|
1041
1041
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
1042
1042
|
allocation?: "each" | "across" | undefined;
|
|
1043
1043
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -1054,8 +1054,8 @@ export declare const VendorUpdatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
1054
1054
|
value?: number | undefined;
|
|
1055
1055
|
type?: ApplicationMethodType | undefined;
|
|
1056
1056
|
currency_code?: string | undefined;
|
|
1057
|
-
description?: string | null | undefined;
|
|
1058
1057
|
max_quantity?: number | null | undefined;
|
|
1058
|
+
description?: string | null | undefined;
|
|
1059
1059
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
1060
1060
|
allocation?: "each" | "across" | undefined;
|
|
1061
1061
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -1072,8 +1072,8 @@ export declare const VendorUpdatePromotion: z.ZodEffects<z.ZodObject<{
|
|
|
1072
1072
|
value?: number | undefined;
|
|
1073
1073
|
type?: ApplicationMethodType | undefined;
|
|
1074
1074
|
currency_code?: string | undefined;
|
|
1075
|
-
description?: string | null | undefined;
|
|
1076
1075
|
max_quantity?: number | null | undefined;
|
|
1076
|
+
description?: string | null | undefined;
|
|
1077
1077
|
target_type?: ApplicationMethodTargetType | undefined;
|
|
1078
1078
|
allocation?: "each" | "across" | undefined;
|
|
1079
1079
|
apply_to_quantity?: number | null | undefined;
|
|
@@ -101,14 +101,15 @@ export declare const VendorGetRefundReasonsParams: z.ZodObject<{
|
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
102
102
|
offset: number;
|
|
103
103
|
limit: number;
|
|
104
|
+
order?: string | undefined;
|
|
104
105
|
id?: string | string[] | undefined;
|
|
105
106
|
created_at?: any;
|
|
106
107
|
updated_at?: any;
|
|
107
108
|
q?: string | undefined;
|
|
108
109
|
fields?: string | undefined;
|
|
109
|
-
order?: string | undefined;
|
|
110
110
|
with_deleted?: boolean | undefined;
|
|
111
111
|
}, {
|
|
112
|
+
order?: string | undefined;
|
|
112
113
|
id?: string | string[] | undefined;
|
|
113
114
|
created_at?: any;
|
|
114
115
|
updated_at?: any;
|
|
@@ -116,6 +117,5 @@ export declare const VendorGetRefundReasonsParams: z.ZodObject<{
|
|
|
116
117
|
limit?: unknown;
|
|
117
118
|
q?: string | undefined;
|
|
118
119
|
fields?: string | undefined;
|
|
119
|
-
order?: string | undefined;
|
|
120
120
|
with_deleted?: unknown;
|
|
121
121
|
}>;
|
|
@@ -103,16 +103,17 @@ export declare const VendorGetRegionsParams: z.ZodObject<{
|
|
|
103
103
|
}, "strip", z.ZodTypeAny, {
|
|
104
104
|
offset: number;
|
|
105
105
|
limit: number;
|
|
106
|
+
order?: string | undefined;
|
|
106
107
|
id?: string | string[] | undefined;
|
|
107
108
|
created_at?: any;
|
|
108
109
|
updated_at?: any;
|
|
109
110
|
q?: string | undefined;
|
|
110
111
|
fields?: string | undefined;
|
|
111
|
-
order?: string | undefined;
|
|
112
112
|
with_deleted?: boolean | undefined;
|
|
113
|
-
currency_code?: string | string[] | undefined;
|
|
114
113
|
name?: string | string[] | undefined;
|
|
114
|
+
currency_code?: string | string[] | undefined;
|
|
115
115
|
}, {
|
|
116
|
+
order?: string | undefined;
|
|
116
117
|
id?: string | string[] | undefined;
|
|
117
118
|
created_at?: any;
|
|
118
119
|
updated_at?: any;
|
|
@@ -120,8 +121,7 @@ export declare const VendorGetRegionsParams: z.ZodObject<{
|
|
|
120
121
|
limit?: unknown;
|
|
121
122
|
q?: string | undefined;
|
|
122
123
|
fields?: string | undefined;
|
|
123
|
-
order?: string | undefined;
|
|
124
124
|
with_deleted?: unknown;
|
|
125
|
-
currency_code?: string | string[] | undefined;
|
|
126
125
|
name?: string | string[] | undefined;
|
|
126
|
+
currency_code?: string | string[] | undefined;
|
|
127
127
|
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework/http";
|
|
2
|
+
import { HttpTypes } from "@medusajs/framework/types";
|
|
3
|
+
export declare const GET: (req: AuthenticatedMedusaRequest<HttpTypes.AdminReservationParams>, res: MedusaResponse<HttpTypes.AdminReservationResponse>) => Promise<void>;
|
|
4
|
+
export declare const POST: (req: AuthenticatedMedusaRequest<HttpTypes.AdminUpdateReservation, HttpTypes.AdminReservationParams>, res: MedusaResponse<HttpTypes.AdminReservationResponse>) => Promise<void>;
|
|
5
|
+
export declare const DELETE: (req: AuthenticatedMedusaRequest, res: MedusaResponse<HttpTypes.AdminReservationDeleteResponse>) => Promise<void>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DELETE = exports.POST = exports.GET = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const core_flows_1 = require("@medusajs/core-flows");
|
|
6
|
+
const helpers_1 = require("../helpers");
|
|
7
|
+
const GET = async (req, res) => {
|
|
8
|
+
const { id } = req.params;
|
|
9
|
+
const reservation = await (0, helpers_1.refetchReservation)(id, req.scope, req.queryConfig.fields);
|
|
10
|
+
if (!reservation) {
|
|
11
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `Reservation with id: ${id} was not found`);
|
|
12
|
+
}
|
|
13
|
+
res.status(200).json({ reservation });
|
|
14
|
+
};
|
|
15
|
+
exports.GET = GET;
|
|
16
|
+
const POST = async (req, res) => {
|
|
17
|
+
const { id } = req.params;
|
|
18
|
+
await (0, core_flows_1.updateReservationsWorkflow)(req.scope).run({
|
|
19
|
+
input: {
|
|
20
|
+
updates: [{ ...req.validatedBody, id }],
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const reservation = await (0, helpers_1.refetchReservation)(id, req.scope, req.queryConfig.fields);
|
|
24
|
+
res.status(200).json({ reservation });
|
|
25
|
+
};
|
|
26
|
+
exports.POST = POST;
|
|
27
|
+
const DELETE = async (req, res) => {
|
|
28
|
+
const id = req.params.id;
|
|
29
|
+
await (0, core_flows_1.deleteReservationsWorkflow)(req.scope).run({
|
|
30
|
+
input: { ids: [id] },
|
|
31
|
+
});
|
|
32
|
+
res.status(200).json({
|
|
33
|
+
id,
|
|
34
|
+
object: "reservation",
|
|
35
|
+
deleted: true,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.DELETE = DELETE;
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9yZXNlcnZhdGlvbnMvW2lkXS9yb3V0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFLQSxxREFBdUQ7QUFDdkQscURBRzZCO0FBRzdCLHdDQUErQztBQUV4QyxNQUFNLEdBQUcsR0FBRyxLQUFLLEVBQ3RCLEdBQWlFLEVBQ2pFLEdBQXVELEVBQ3ZELEVBQUU7SUFDRixNQUFNLEVBQUUsRUFBRSxFQUFFLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQTtJQUV6QixNQUFNLFdBQVcsR0FBRyxNQUFNLElBQUEsNEJBQWtCLEVBQzFDLEVBQUUsRUFDRixHQUFHLENBQUMsS0FBSyxFQUNULEdBQUcsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUN2QixDQUFBO0lBRUQsSUFBSSxDQUFDLFdBQVcsRUFBRSxDQUFDO1FBQ2pCLE1BQU0sSUFBSSxtQkFBVyxDQUNuQixtQkFBVyxDQUFDLEtBQUssQ0FBQyxTQUFTLEVBQzNCLHdCQUF3QixFQUFFLGdCQUFnQixDQUMzQyxDQUFBO0lBQ0gsQ0FBQztJQUVELEdBQUcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsV0FBVyxFQUFFLENBQUMsQ0FBQTtBQUN2QyxDQUFDLENBQUE7QUFwQlksUUFBQSxHQUFHLE9Bb0JmO0FBRU0sTUFBTSxJQUFJLEdBQUcsS0FBSyxFQUN2QixHQUdDLEVBQ0QsR0FBdUQsRUFDdkQsRUFBRTtJQUNGLE1BQU0sRUFBRSxFQUFFLEVBQUUsR0FBRyxHQUFHLENBQUMsTUFBTSxDQUFBO0lBQ3pCLE1BQU0sSUFBQSx1Q0FBMEIsRUFBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUMsR0FBRyxDQUFDO1FBQzlDLEtBQUssRUFBRTtZQUNMLE9BQU8sRUFBRSxDQUFDLEVBQUUsR0FBRyxHQUFHLENBQUMsYUFBYSxFQUFFLEVBQUUsRUFBRSxDQUFDO1NBQ3hDO0tBQ0YsQ0FBQyxDQUFBO0lBRUYsTUFBTSxXQUFXLEdBQUcsTUFBTSxJQUFBLDRCQUFrQixFQUMxQyxFQUFFLEVBQ0YsR0FBRyxDQUFDLEtBQUssRUFDVCxHQUFHLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FDdkIsQ0FBQTtJQUNELEdBQUcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsV0FBVyxFQUFFLENBQUMsQ0FBQTtBQUN2QyxDQUFDLENBQUE7QUFwQlksUUFBQSxJQUFJLFFBb0JoQjtBQUVNLE1BQU0sTUFBTSxHQUFHLEtBQUssRUFDekIsR0FBK0IsRUFDL0IsR0FBNkQsRUFDN0QsRUFBRTtJQUNGLE1BQU0sRUFBRSxHQUFHLEdBQUcsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFBO0lBRXhCLE1BQU0sSUFBQSx1Q0FBMEIsRUFBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUMsR0FBRyxDQUFDO1FBQzlDLEtBQUssRUFBRSxFQUFFLEdBQUcsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFO0tBQ3JCLENBQUMsQ0FBQTtJQUVGLEdBQUcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDO1FBQ25CLEVBQUU7UUFDRixNQUFNLEVBQUUsYUFBYTtRQUNyQixPQUFPLEVBQUUsSUFBSTtLQUNkLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQWZZLFFBQUEsTUFBTSxVQWVsQiJ9
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refetchReservation = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
// Mirrors admin's `refetchReservation` — re-queries the just-created /
|
|
6
|
+
// just-updated reservation by id so the response shape matches what the
|
|
7
|
+
// caller asked for via `fields=`.
|
|
8
|
+
const refetchReservation = async (reservationId, scope, fields) => {
|
|
9
|
+
const remoteQuery = scope.resolve(utils_1.ContainerRegistrationKeys.REMOTE_QUERY);
|
|
10
|
+
const queryObject = (0, utils_1.remoteQueryObjectFromString)({
|
|
11
|
+
entryPoint: "reservation",
|
|
12
|
+
variables: {
|
|
13
|
+
filters: { id: reservationId },
|
|
14
|
+
},
|
|
15
|
+
fields: fields,
|
|
16
|
+
});
|
|
17
|
+
const reservations = await remoteQuery(queryObject);
|
|
18
|
+
return reservations[0];
|
|
19
|
+
};
|
|
20
|
+
exports.refetchReservation = refetchReservation;
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvdmVuZG9yL3Jlc2VydmF0aW9ucy9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLHFEQUdrQztBQUVsQyx1RUFBdUU7QUFDdkUsd0VBQXdFO0FBQ3hFLGtDQUFrQztBQUMzQixNQUFNLGtCQUFrQixHQUFHLEtBQUssRUFDckMsYUFBcUIsRUFDckIsS0FBc0IsRUFDdEIsTUFBZ0IsRUFDaEIsRUFBRTtJQUNGLE1BQU0sV0FBVyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsaUNBQXlCLENBQUMsWUFBWSxDQUFDLENBQUE7SUFDekUsTUFBTSxXQUFXLEdBQUcsSUFBQSxtQ0FBMkIsRUFBQztRQUM5QyxVQUFVLEVBQUUsYUFBYTtRQUN6QixTQUFTLEVBQUU7WUFDVCxPQUFPLEVBQUUsRUFBRSxFQUFFLEVBQUUsYUFBYSxFQUFFO1NBQy9CO1FBQ0QsTUFBTSxFQUFFLE1BQU07S0FDZixDQUFDLENBQUE7SUFFRixNQUFNLFlBQVksR0FBRyxNQUFNLFdBQVcsQ0FBQyxXQUFXLENBQUMsQ0FBQTtJQUNuRCxPQUFPLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUN4QixDQUFDLENBQUE7QUFoQlksUUFBQSxrQkFBa0Isc0JBZ0I5QiJ9
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vendorReservationsMiddlewares = void 0;
|
|
4
|
+
const http_1 = require("@medusajs/framework/http");
|
|
5
|
+
const framework_1 = require("@medusajs/framework");
|
|
6
|
+
const query_config_1 = require("./query-config");
|
|
7
|
+
const validators_1 = require("./validators");
|
|
8
|
+
// Mirror of `applySellerInventoryItemLinkFilter` in
|
|
9
|
+
// `vendor/inventory-items/middlewares.ts`. A reservation belongs to a
|
|
10
|
+
// seller iff its `inventory_item_id` belongs to the seller via the
|
|
11
|
+
// `inventory_item_seller` link. We push the seller_id onto
|
|
12
|
+
// `filterableFields` and then have `maybeApplyLinkFilter` join through
|
|
13
|
+
// the link table so the remote query only returns reservations on the
|
|
14
|
+
// seller's own inventory.
|
|
15
|
+
const applySellerReservationLinkFilter = (req, res, next) => {
|
|
16
|
+
req.filterableFields.seller_id = req.seller_context.seller_id;
|
|
17
|
+
return (0, http_1.maybeApplyLinkFilter)({
|
|
18
|
+
entryPoint: "inventory_item_seller",
|
|
19
|
+
resourceId: "inventory_item_id",
|
|
20
|
+
filterableField: "seller_id",
|
|
21
|
+
})(req, res, next);
|
|
22
|
+
};
|
|
23
|
+
exports.vendorReservationsMiddlewares = [
|
|
24
|
+
{
|
|
25
|
+
method: ["GET"],
|
|
26
|
+
matcher: "/vendor/reservations",
|
|
27
|
+
middlewares: [
|
|
28
|
+
(0, framework_1.validateAndTransformQuery)(validators_1.VendorGetReservationsParams, query_config_1.vendorReservationQueryConfig.list),
|
|
29
|
+
applySellerReservationLinkFilter,
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
method: ["GET"],
|
|
34
|
+
matcher: "/vendor/reservations/:id",
|
|
35
|
+
middlewares: [
|
|
36
|
+
(0, framework_1.validateAndTransformQuery)(validators_1.VendorGetReservationParams, query_config_1.vendorReservationQueryConfig.retrieve),
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
method: ["POST"],
|
|
41
|
+
matcher: "/vendor/reservations",
|
|
42
|
+
middlewares: [
|
|
43
|
+
(0, framework_1.validateAndTransformBody)(validators_1.VendorCreateReservation),
|
|
44
|
+
(0, framework_1.validateAndTransformQuery)(validators_1.VendorGetReservationParams, query_config_1.vendorReservationQueryConfig.retrieve),
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
method: ["POST"],
|
|
49
|
+
matcher: "/vendor/reservations/:id",
|
|
50
|
+
middlewares: [
|
|
51
|
+
(0, framework_1.validateAndTransformBody)(validators_1.VendorUpdateReservation),
|
|
52
|
+
(0, framework_1.validateAndTransformQuery)(validators_1.VendorGetReservationParams, query_config_1.vendorReservationQueryConfig.retrieve),
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
method: ["DELETE"],
|
|
57
|
+
matcher: "/vendor/reservations/:id",
|
|
58
|
+
middlewares: [],
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9yZXNlcnZhdGlvbnMvbWlkZGxld2FyZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbURBTWlDO0FBQ2pDLG1EQUc0QjtBQUU1QixpREFFdUI7QUFDdkIsNkNBS3FCO0FBRXJCLG9EQUFvRDtBQUNwRCxzRUFBc0U7QUFDdEUsbUVBQW1FO0FBQ25FLDJEQUEyRDtBQUMzRCx1RUFBdUU7QUFDdkUsc0VBQXNFO0FBQ3RFLDBCQUEwQjtBQUMxQixNQUFNLGdDQUFnQyxHQUFHLENBQ3ZDLEdBQStCLEVBQy9CLEdBQW1CLEVBQ25CLElBQXdCLEVBQ3hCLEVBQUU7SUFDRixHQUFHLENBQUMsZ0JBQWdCLENBQUMsU0FBUyxHQUFHLEdBQUcsQ0FBQyxjQUFlLENBQUMsU0FBUyxDQUFBO0lBRTlELE9BQU8sSUFBQSwyQkFBb0IsRUFBQztRQUMxQixVQUFVLEVBQUUsdUJBQXVCO1FBQ25DLFVBQVUsRUFBRSxtQkFBbUI7UUFDL0IsZUFBZSxFQUFFLFdBQVc7S0FDN0IsQ0FBQyxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUE7QUFDcEIsQ0FBQyxDQUFBO0FBRVksUUFBQSw2QkFBNkIsR0FBc0I7SUFDOUQ7UUFDRSxNQUFNLEVBQUUsQ0FBQyxLQUFLLENBQUM7UUFDZixPQUFPLEVBQUUsc0JBQXNCO1FBQy9CLFdBQVcsRUFBRTtZQUNYLElBQUEscUNBQXlCLEVBQ3ZCLHdDQUEyQixFQUMzQiwyQ0FBNEIsQ0FBQyxJQUFJLENBQ2xDO1lBQ0QsZ0NBQWdDO1NBQ2pDO0tBQ0Y7SUFDRDtRQUNFLE1BQU0sRUFBRSxDQUFDLEtBQUssQ0FBQztRQUNmLE9BQU8sRUFBRSwwQkFBMEI7UUFDbkMsV0FBVyxFQUFFO1lBQ1gsSUFBQSxxQ0FBeUIsRUFDdkIsdUNBQTBCLEVBQzFCLDJDQUE0QixDQUFDLFFBQVEsQ0FDdEM7U0FDRjtLQUNGO0lBQ0Q7UUFDRSxNQUFNLEVBQUUsQ0FBQyxNQUFNLENBQUM7UUFDaEIsT0FBTyxFQUFFLHNCQUFzQjtRQUMvQixXQUFXLEVBQUU7WUFDWCxJQUFBLG9DQUF3QixFQUFDLG9DQUF1QixDQUFDO1lBQ2pELElBQUEscUNBQXlCLEVBQ3ZCLHVDQUEwQixFQUMxQiwyQ0FBNEIsQ0FBQyxRQUFRLENBQ3RDO1NBQ0Y7S0FDRjtJQUNEO1FBQ0UsTUFBTSxFQUFFLENBQUMsTUFBTSxDQUFDO1FBQ2hCLE9BQU8sRUFBRSwwQkFBMEI7UUFDbkMsV0FBVyxFQUFFO1lBQ1gsSUFBQSxvQ0FBd0IsRUFBQyxvQ0FBdUIsQ0FBQztZQUNqRCxJQUFBLHFDQUF5QixFQUN2Qix1Q0FBMEIsRUFDMUIsMkNBQTRCLENBQUMsUUFBUSxDQUN0QztTQUNGO0tBQ0Y7SUFDRDtRQUNFLE1BQU0sRUFBRSxDQUFDLFFBQVEsQ0FBQztRQUNsQixPQUFPLEVBQUUsMEJBQTBCO1FBQ25DLFdBQVcsRUFBRSxFQUFFO0tBQ2hCO0NBQ0YsQ0FBQSJ9
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const defaultVendorReservationFields: string[];
|
|
2
|
+
export declare const retrieveTransformQueryConfig: {
|
|
3
|
+
defaults: string[];
|
|
4
|
+
isList: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const listTransformQueryConfig: {
|
|
7
|
+
isList: boolean;
|
|
8
|
+
defaults: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const vendorReservationQueryConfig: {
|
|
11
|
+
list: {
|
|
12
|
+
isList: boolean;
|
|
13
|
+
defaults: string[];
|
|
14
|
+
};
|
|
15
|
+
retrieve: {
|
|
16
|
+
defaults: string[];
|
|
17
|
+
isList: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vendorReservationQueryConfig = exports.listTransformQueryConfig = exports.retrieveTransformQueryConfig = exports.defaultVendorReservationFields = void 0;
|
|
4
|
+
// Mirrors admin's `query-config.ts` — same default field set so the
|
|
5
|
+
// generated SDK route map (which types vendor.reservations against
|
|
6
|
+
// admin's route module) sees the same shape coming back.
|
|
7
|
+
const defaultVendorInventoryItemFields = [
|
|
8
|
+
"id",
|
|
9
|
+
"sku",
|
|
10
|
+
"origin_country",
|
|
11
|
+
"hs_code",
|
|
12
|
+
"requires_shipping",
|
|
13
|
+
"mid_code",
|
|
14
|
+
"material",
|
|
15
|
+
"weight",
|
|
16
|
+
"length",
|
|
17
|
+
"height",
|
|
18
|
+
"width",
|
|
19
|
+
"title",
|
|
20
|
+
"description",
|
|
21
|
+
"thumbnail",
|
|
22
|
+
"metadata",
|
|
23
|
+
];
|
|
24
|
+
exports.defaultVendorReservationFields = [
|
|
25
|
+
"id",
|
|
26
|
+
"location_id",
|
|
27
|
+
"inventory_item_id",
|
|
28
|
+
"quantity",
|
|
29
|
+
"line_item_id",
|
|
30
|
+
"description",
|
|
31
|
+
"metadata",
|
|
32
|
+
"created_at",
|
|
33
|
+
"updated_at",
|
|
34
|
+
...defaultVendorInventoryItemFields.map((f) => `inventory_item.${f}`),
|
|
35
|
+
];
|
|
36
|
+
exports.retrieveTransformQueryConfig = {
|
|
37
|
+
defaults: exports.defaultVendorReservationFields,
|
|
38
|
+
isList: false,
|
|
39
|
+
};
|
|
40
|
+
exports.listTransformQueryConfig = {
|
|
41
|
+
...exports.retrieveTransformQueryConfig,
|
|
42
|
+
isList: true,
|
|
43
|
+
};
|
|
44
|
+
exports.vendorReservationQueryConfig = {
|
|
45
|
+
list: exports.listTransformQueryConfig,
|
|
46
|
+
retrieve: exports.retrieveTransformQueryConfig,
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnktY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2FwaS92ZW5kb3IvcmVzZXJ2YXRpb25zL3F1ZXJ5LWNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxvRUFBb0U7QUFDcEUsbUVBQW1FO0FBQ25FLHlEQUF5RDtBQUN6RCxNQUFNLGdDQUFnQyxHQUFHO0lBQ3ZDLElBQUk7SUFDSixLQUFLO0lBQ0wsZ0JBQWdCO0lBQ2hCLFNBQVM7SUFDVCxtQkFBbUI7SUFDbkIsVUFBVTtJQUNWLFVBQVU7SUFDVixRQUFRO0lBQ1IsUUFBUTtJQUNSLFFBQVE7SUFDUixPQUFPO0lBQ1AsT0FBTztJQUNQLGFBQWE7SUFDYixXQUFXO0lBQ1gsVUFBVTtDQUNYLENBQUE7QUFFWSxRQUFBLDhCQUE4QixHQUFHO0lBQzVDLElBQUk7SUFDSixhQUFhO0lBQ2IsbUJBQW1CO0lBQ25CLFVBQVU7SUFDVixjQUFjO0lBQ2QsYUFBYTtJQUNiLFVBQVU7SUFDVixZQUFZO0lBQ1osWUFBWTtJQUNaLEdBQUcsZ0NBQWdDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxrQkFBa0IsQ0FBQyxFQUFFLENBQUM7Q0FDdEUsQ0FBQTtBQUVZLFFBQUEsNEJBQTRCLEdBQUc7SUFDMUMsUUFBUSxFQUFFLHNDQUE4QjtJQUN4QyxNQUFNLEVBQUUsS0FBSztDQUNkLENBQUE7QUFFWSxRQUFBLHdCQUF3QixHQUFHO0lBQ3RDLEdBQUcsb0NBQTRCO0lBQy9CLE1BQU0sRUFBRSxJQUFJO0NBQ2IsQ0FBQTtBQUVZLFFBQUEsNEJBQTRCLEdBQUc7SUFDMUMsSUFBSSxFQUFFLGdDQUF3QjtJQUM5QixRQUFRLEVBQUUsb0NBQTRCO0NBQ3ZDLENBQUEifQ==
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework/http";
|
|
2
|
+
import { HttpTypes } from "@medusajs/framework/types";
|
|
3
|
+
export declare const GET: (req: AuthenticatedMedusaRequest<HttpTypes.AdminGetReservationsParams>, res: MedusaResponse<HttpTypes.AdminReservationListResponse>) => Promise<void>;
|
|
4
|
+
export declare const POST: (req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateReservation, HttpTypes.AdminReservationParams>, res: MedusaResponse<HttpTypes.AdminReservationResponse>) => Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POST = exports.GET = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const core_flows_1 = require("@medusajs/core-flows");
|
|
6
|
+
const helpers_1 = require("./helpers");
|
|
7
|
+
const GET = async (req, res) => {
|
|
8
|
+
const remoteQuery = req.scope.resolve(utils_1.ContainerRegistrationKeys.REMOTE_QUERY);
|
|
9
|
+
const queryObject = (0, utils_1.remoteQueryObjectFromString)({
|
|
10
|
+
entryPoint: "reservation",
|
|
11
|
+
variables: {
|
|
12
|
+
filters: req.filterableFields,
|
|
13
|
+
...req.queryConfig.pagination,
|
|
14
|
+
},
|
|
15
|
+
fields: req.queryConfig.fields,
|
|
16
|
+
});
|
|
17
|
+
const { rows: reservations, metadata } = await remoteQuery(queryObject);
|
|
18
|
+
res.json({
|
|
19
|
+
reservations,
|
|
20
|
+
count: metadata.count,
|
|
21
|
+
offset: metadata.skip,
|
|
22
|
+
limit: metadata.take,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
exports.GET = GET;
|
|
26
|
+
const POST = async (req, res) => {
|
|
27
|
+
const input = [req.validatedBody];
|
|
28
|
+
const { result } = await (0, core_flows_1.createReservationsWorkflow)(req.scope).run({
|
|
29
|
+
input: { reservations: input },
|
|
30
|
+
});
|
|
31
|
+
const reservation = await (0, helpers_1.refetchReservation)(result[0].id, req.scope, req.queryConfig.fields);
|
|
32
|
+
res.status(200).json({ reservation });
|
|
33
|
+
};
|
|
34
|
+
exports.POST = POST;
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9yZXNlcnZhdGlvbnMvcm91dGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBUUEscURBR2tDO0FBRWxDLHFEQUFpRTtBQUdqRSx1Q0FBOEM7QUFFdkMsTUFBTSxHQUFHLEdBQUcsS0FBSyxFQUN0QixHQUFxRSxFQUNyRSxHQUEyRCxFQUMzRCxFQUFFO0lBQ0YsTUFBTSxXQUFXLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsaUNBQXlCLENBQUMsWUFBWSxDQUFDLENBQUE7SUFFN0UsTUFBTSxXQUFXLEdBQUcsSUFBQSxtQ0FBMkIsRUFBQztRQUM5QyxVQUFVLEVBQUUsYUFBYTtRQUN6QixTQUFTLEVBQUU7WUFDVCxPQUFPLEVBQUUsR0FBRyxDQUFDLGdCQUFnQjtZQUM3QixHQUFHLEdBQUcsQ0FBQyxXQUFXLENBQUMsVUFBVTtTQUM5QjtRQUNELE1BQU0sRUFBRSxHQUFHLENBQUMsV0FBVyxDQUFDLE1BQU07S0FDL0IsQ0FBQyxDQUFBO0lBRUYsTUFBTSxFQUFFLElBQUksRUFBRSxZQUFZLEVBQUUsUUFBUSxFQUFFLEdBQUcsTUFBTSxXQUFXLENBQUMsV0FBVyxDQUFDLENBQUE7SUFFdkUsR0FBRyxDQUFDLElBQUksQ0FBQztRQUNQLFlBQVk7UUFDWixLQUFLLEVBQUUsUUFBUSxDQUFDLEtBQUs7UUFDckIsTUFBTSxFQUFFLFFBQVEsQ0FBQyxJQUFJO1FBQ3JCLEtBQUssRUFBRSxRQUFRLENBQUMsSUFBSTtLQUNyQixDQUFDLENBQUE7QUFDSixDQUFDLENBQUE7QUF2QlksUUFBQSxHQUFHLE9BdUJmO0FBRU0sTUFBTSxJQUFJLEdBQUcsS0FBSyxFQUN2QixHQUdDLEVBQ0QsR0FBdUQsRUFDdkQsRUFBRTtJQUNGLE1BQU0sS0FBSyxHQUFHLENBQUMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxDQUFBO0lBRWpDLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxNQUFNLElBQUEsdUNBQTBCLEVBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsQ0FBQztRQUNqRSxLQUFLLEVBQUUsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFO0tBQy9CLENBQUMsQ0FBQTtJQUVGLE1BQU0sV0FBVyxHQUFHLE1BQU0sSUFBQSw0QkFBa0IsRUFDMUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFDWixHQUFHLENBQUMsS0FBSyxFQUNULEdBQUcsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUN2QixDQUFBO0lBQ0QsR0FBRyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsRUFBRSxXQUFXLEVBQUUsQ0FBQyxDQUFBO0FBQ3ZDLENBQUMsQ0FBQTtBQW5CWSxRQUFBLElBQUksUUFtQmhCIn0=
|