@medusajs/core-flows 2.18.0 → 2.19.0-preview-20260811102316
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/dist/api-key/workflows/create-api-keys.d.ts +1 -1
- package/dist/api-key/workflows/create-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/create-api-keys.js +1 -1
- package/dist/api-key/workflows/delete-api-keys.d.ts +1 -1
- package/dist/api-key/workflows/delete-api-keys.js +1 -1
- package/dist/api-key/workflows/link-sales-channels-to-publishable-key.d.ts +1 -1
- package/dist/api-key/workflows/link-sales-channels-to-publishable-key.js +1 -1
- package/dist/api-key/workflows/revoke-api-keys.d.ts +1 -1
- package/dist/api-key/workflows/revoke-api-keys.js +1 -1
- package/dist/api-key/workflows/update-api-keys.d.ts +1 -1
- package/dist/api-key/workflows/update-api-keys.js +1 -1
- package/dist/auth/workflows/generate-reset-password-token.d.ts +2 -2
- package/dist/auth/workflows/generate-reset-password-token.js +2 -2
- package/dist/cart/steps/get-line-item-actions.d.ts.map +1 -1
- package/dist/cart/steps/get-line-item-actions.js +3 -14
- package/dist/cart/steps/get-line-item-actions.js.map +1 -1
- package/dist/cart/steps/get-line-item-pricing-quantities.d.ts +40 -0
- package/dist/cart/steps/get-line-item-pricing-quantities.d.ts.map +1 -0
- package/dist/cart/steps/get-line-item-pricing-quantities.js +69 -0
- package/dist/cart/steps/get-line-item-pricing-quantities.js.map +1 -0
- package/dist/cart/steps/index.d.ts +1 -0
- package/dist/cart/steps/index.d.ts.map +1 -1
- package/dist/cart/steps/index.js +1 -0
- package/dist/cart/steps/index.js.map +1 -1
- package/dist/cart/utils/fields.d.ts.map +1 -1
- package/dist/cart/utils/fields.js +2 -0
- package/dist/cart/utils/fields.js.map +1 -1
- package/dist/cart/utils/find-matching-line-item.d.ts +24 -0
- package/dist/cart/utils/find-matching-line-item.d.ts.map +1 -0
- package/dist/cart/utils/find-matching-line-item.js +32 -0
- package/dist/cart/utils/find-matching-line-item.js.map +1 -0
- package/dist/cart/utils/prepare-confirm-inventory-input.d.ts +10 -0
- package/dist/cart/utils/prepare-confirm-inventory-input.d.ts.map +1 -1
- package/dist/cart/utils/prepare-confirm-inventory-input.js +19 -2
- package/dist/cart/utils/prepare-confirm-inventory-input.js.map +1 -1
- package/dist/cart/workflows/add-shipping-method-to-cart.d.ts +1 -1
- package/dist/cart/workflows/add-shipping-method-to-cart.js +1 -1
- package/dist/cart/workflows/add-to-cart.d.ts +1 -1
- package/dist/cart/workflows/add-to-cart.d.ts.map +1 -1
- package/dist/cart/workflows/add-to-cart.js +27 -5
- package/dist/cart/workflows/add-to-cart.js.map +1 -1
- package/dist/cart/workflows/complete-cart.d.ts +1 -1
- package/dist/cart/workflows/complete-cart.js +1 -1
- package/dist/cart/workflows/create-carts.d.ts +1 -1
- package/dist/cart/workflows/create-carts.js +1 -1
- package/dist/cart/workflows/create-payment-collection-for-cart.d.ts +1 -1
- package/dist/cart/workflows/create-payment-collection-for-cart.js +1 -1
- package/dist/cart/workflows/get-variants-and-items-with-prices.d.ts +19 -0
- package/dist/cart/workflows/get-variants-and-items-with-prices.d.ts.map +1 -1
- package/dist/cart/workflows/get-variants-and-items-with-prices.js +31 -2
- package/dist/cart/workflows/get-variants-and-items-with-prices.js.map +1 -1
- package/dist/cart/workflows/list-shipping-options-for-cart-with-pricing.d.ts.map +1 -1
- package/dist/cart/workflows/list-shipping-options-for-cart-with-pricing.js +0 -2
- package/dist/cart/workflows/list-shipping-options-for-cart-with-pricing.js.map +1 -1
- package/dist/cart/workflows/list-shipping-options-for-cart.d.ts +1 -1
- package/dist/cart/workflows/list-shipping-options-for-cart.js +1 -1
- package/dist/cart/workflows/transfer-cart-customer.d.ts +1 -1
- package/dist/cart/workflows/transfer-cart-customer.js +1 -1
- package/dist/cart/workflows/update-cart-promotions.d.ts +1 -1
- package/dist/cart/workflows/update-cart-promotions.js +1 -1
- package/dist/cart/workflows/update-cart.d.ts +1 -1
- package/dist/cart/workflows/update-cart.js +1 -1
- package/dist/cart/workflows/update-line-item-in-cart.d.ts +5 -33
- package/dist/cart/workflows/update-line-item-in-cart.d.ts.map +1 -1
- package/dist/cart/workflows/update-line-item-in-cart.js +16 -3
- package/dist/cart/workflows/update-line-item-in-cart.js.map +1 -1
- package/dist/cart/workflows/update-tax-lines.d.ts +1 -1
- package/dist/cart/workflows/update-tax-lines.js +1 -1
- package/dist/cart/workflows/upsert-tax-lines.d.ts +1 -1
- package/dist/cart/workflows/upsert-tax-lines.js +1 -1
- package/dist/customer/workflows/create-addresses.d.ts +2 -2
- package/dist/customer/workflows/create-addresses.d.ts.map +1 -1
- package/dist/customer/workflows/create-addresses.js +2 -2
- package/dist/customer/workflows/create-customer-account.d.ts +2 -2
- package/dist/customer/workflows/create-customer-account.js +2 -2
- package/dist/customer/workflows/create-customers.d.ts +1 -1
- package/dist/customer/workflows/create-customers.d.ts.map +1 -1
- package/dist/customer/workflows/create-customers.js +1 -1
- package/dist/customer/workflows/delete-addresses.d.ts +2 -2
- package/dist/customer/workflows/delete-addresses.js +2 -2
- package/dist/customer/workflows/remove-customer-account.d.ts +1 -1
- package/dist/customer/workflows/remove-customer-account.js +1 -1
- package/dist/customer/workflows/update-addresses.d.ts +2 -2
- package/dist/customer/workflows/update-addresses.d.ts.map +1 -1
- package/dist/customer/workflows/update-addresses.js +2 -2
- package/dist/customer/workflows/update-customers.d.ts +2 -2
- package/dist/customer/workflows/update-customers.d.ts.map +1 -1
- package/dist/customer/workflows/update-customers.js +2 -2
- package/dist/customer-group/workflows/create-customer-groups.d.ts +1 -1
- package/dist/customer-group/workflows/create-customer-groups.js +1 -1
- package/dist/customer-group/workflows/delete-customer-groups.d.ts +1 -1
- package/dist/customer-group/workflows/delete-customer-groups.js +1 -1
- package/dist/customer-group/workflows/link-customer-groups-customer.d.ts +1 -1
- package/dist/customer-group/workflows/link-customer-groups-customer.js +1 -1
- package/dist/customer-group/workflows/link-customers-customer-group.d.ts +1 -1
- package/dist/customer-group/workflows/link-customers-customer-group.js +1 -1
- package/dist/customer-group/workflows/update-customer-groups.d.ts +1 -1
- package/dist/customer-group/workflows/update-customer-groups.js +1 -1
- package/dist/draft-order/workflows/add-draft-order-items.d.ts +1 -1
- package/dist/draft-order/workflows/add-draft-order-items.js +1 -1
- package/dist/draft-order/workflows/add-draft-order-promotions.d.ts +1 -1
- package/dist/draft-order/workflows/add-draft-order-promotions.js +1 -1
- package/dist/draft-order/workflows/add-draft-order-shipping-methods.d.ts +1 -1
- package/dist/draft-order/workflows/add-draft-order-shipping-methods.js +1 -1
- package/dist/draft-order/workflows/begin-draft-order-edit.d.ts +1 -1
- package/dist/draft-order/workflows/begin-draft-order-edit.js +1 -1
- package/dist/draft-order/workflows/cancel-draft-order-edit.d.ts +1 -1
- package/dist/draft-order/workflows/cancel-draft-order-edit.js +1 -1
- package/dist/draft-order/workflows/confirm-draft-order-edit.d.ts +1 -1
- package/dist/draft-order/workflows/confirm-draft-order-edit.js +1 -1
- package/dist/draft-order/workflows/convert-draft-order.d.ts +1 -1
- package/dist/draft-order/workflows/convert-draft-order.d.ts.map +1 -1
- package/dist/draft-order/workflows/convert-draft-order.js +10 -1
- package/dist/draft-order/workflows/convert-draft-order.js.map +1 -1
- package/dist/draft-order/workflows/delete-draft-order.d.ts +1 -1
- package/dist/draft-order/workflows/delete-draft-order.js +1 -1
- package/dist/draft-order/workflows/remove-draft-order-action-item.d.ts +1 -1
- package/dist/draft-order/workflows/remove-draft-order-action-item.js +1 -1
- package/dist/draft-order/workflows/remove-draft-order-action-shipping-method.d.ts +1 -1
- package/dist/draft-order/workflows/remove-draft-order-action-shipping-method.js +1 -1
- package/dist/draft-order/workflows/remove-draft-order-promotions.d.ts +1 -1
- package/dist/draft-order/workflows/remove-draft-order-promotions.js +1 -1
- package/dist/draft-order/workflows/remove-draft-order-shipping-method.d.ts +1 -1
- package/dist/draft-order/workflows/remove-draft-order-shipping-method.js +1 -1
- package/dist/draft-order/workflows/request-draft-order-edit.d.ts +1 -1
- package/dist/draft-order/workflows/request-draft-order-edit.js +1 -1
- package/dist/draft-order/workflows/update-draft-order-action-item.d.ts +1 -1
- package/dist/draft-order/workflows/update-draft-order-action-item.js +1 -1
- package/dist/draft-order/workflows/update-draft-order-action-shipping-method.d.ts +1 -1
- package/dist/draft-order/workflows/update-draft-order-action-shipping-method.js +1 -1
- package/dist/draft-order/workflows/update-draft-order-item.d.ts +1 -1
- package/dist/draft-order/workflows/update-draft-order-item.js +1 -1
- package/dist/draft-order/workflows/update-draft-order-shipping-method.d.ts +1 -1
- package/dist/draft-order/workflows/update-draft-order-shipping-method.js +1 -1
- package/dist/draft-order/workflows/update-draft-order.d.ts +1 -1
- package/dist/draft-order/workflows/update-draft-order.d.ts.map +1 -1
- package/dist/draft-order/workflows/update-draft-order.js +13 -1
- package/dist/draft-order/workflows/update-draft-order.js.map +1 -1
- package/dist/file/workflows/delete-files.d.ts +1 -1
- package/dist/file/workflows/delete-files.js +1 -1
- package/dist/file/workflows/upload-files.d.ts +1 -1
- package/dist/file/workflows/upload-files.js +1 -1
- package/dist/fulfillment/workflows/batch-shipping-option-rules.d.ts +1 -1
- package/dist/fulfillment/workflows/batch-shipping-option-rules.js +1 -1
- package/dist/fulfillment/workflows/calculate-shipping-options-prices.d.ts +1 -1
- package/dist/fulfillment/workflows/calculate-shipping-options-prices.js +1 -1
- package/dist/fulfillment/workflows/cancel-fulfillment.d.ts +1 -1
- package/dist/fulfillment/workflows/cancel-fulfillment.js +1 -1
- package/dist/fulfillment/workflows/create-fulfillment.d.ts +1 -1
- package/dist/fulfillment/workflows/create-fulfillment.d.ts.map +1 -1
- package/dist/fulfillment/workflows/create-fulfillment.js +5 -9
- package/dist/fulfillment/workflows/create-fulfillment.js.map +1 -1
- package/dist/fulfillment/workflows/create-service-zones.d.ts +1 -1
- package/dist/fulfillment/workflows/create-service-zones.js +1 -1
- package/dist/fulfillment/workflows/create-shipment.d.ts +1 -1
- package/dist/fulfillment/workflows/create-shipment.js +1 -1
- package/dist/fulfillment/workflows/create-shipping-options.d.ts +1 -1
- package/dist/fulfillment/workflows/create-shipping-options.js +1 -1
- package/dist/fulfillment/workflows/create-shipping-profiles.d.ts +1 -1
- package/dist/fulfillment/workflows/create-shipping-profiles.js +1 -1
- package/dist/fulfillment/workflows/delete-fulfillment-sets.d.ts +1 -1
- package/dist/fulfillment/workflows/delete-fulfillment-sets.js +1 -1
- package/dist/fulfillment/workflows/delete-service-zones.d.ts +1 -1
- package/dist/fulfillment/workflows/delete-service-zones.js +1 -1
- package/dist/fulfillment/workflows/delete-shipping-options.d.ts +1 -1
- package/dist/fulfillment/workflows/delete-shipping-options.js +1 -1
- package/dist/fulfillment/workflows/update-service-zones.d.ts +1 -1
- package/dist/fulfillment/workflows/update-service-zones.js +1 -1
- package/dist/fulfillment/workflows/update-shipping-options.d.ts +1 -1
- package/dist/fulfillment/workflows/update-shipping-options.js +1 -1
- package/dist/fulfillment/workflows/update-shipping-profiles.d.ts +1 -1
- package/dist/fulfillment/workflows/update-shipping-profiles.js +1 -1
- package/dist/inventory/helpers/normalize-for-export.d.ts +28 -0
- package/dist/inventory/helpers/normalize-for-export.d.ts.map +1 -0
- package/dist/inventory/helpers/normalize-for-export.js +68 -0
- package/dist/inventory/helpers/normalize-for-export.js.map +1 -0
- package/dist/inventory/steps/export-inventory-items.d.ts +37 -0
- package/dist/inventory/steps/export-inventory-items.d.ts.map +1 -0
- package/dist/inventory/steps/export-inventory-items.js +113 -0
- package/dist/inventory/steps/export-inventory-items.js.map +1 -0
- package/dist/inventory/steps/index.d.ts +1 -0
- package/dist/inventory/steps/index.d.ts.map +1 -1
- package/dist/inventory/steps/index.js +1 -0
- package/dist/inventory/steps/index.js.map +1 -1
- package/dist/inventory/workflows/create-inventory-items.d.ts +1 -1
- package/dist/inventory/workflows/create-inventory-items.js +1 -1
- package/dist/inventory/workflows/create-inventory-levels.d.ts +1 -1
- package/dist/inventory/workflows/create-inventory-levels.js +1 -1
- package/dist/inventory/workflows/delete-inventory-items.d.ts +1 -1
- package/dist/inventory/workflows/delete-inventory-items.js +1 -1
- package/dist/inventory/workflows/delete-inventory-levels.d.ts +1 -1
- package/dist/inventory/workflows/delete-inventory-levels.js +1 -1
- package/dist/inventory/workflows/export-inventory-items.d.ts +46 -0
- package/dist/inventory/workflows/export-inventory-items.d.ts.map +1 -0
- package/dist/inventory/workflows/export-inventory-items.js +98 -0
- package/dist/inventory/workflows/export-inventory-items.js.map +1 -0
- package/dist/inventory/workflows/index.d.ts +1 -0
- package/dist/inventory/workflows/index.d.ts.map +1 -1
- package/dist/inventory/workflows/index.js +1 -0
- package/dist/inventory/workflows/index.js.map +1 -1
- package/dist/inventory/workflows/update-inventory-items.d.ts +1 -1
- package/dist/inventory/workflows/update-inventory-items.js +1 -1
- package/dist/inventory/workflows/update-inventory-levels.d.ts +1 -1
- package/dist/inventory/workflows/update-inventory-levels.js +1 -1
- package/dist/invite/workflows/accept-invite.d.ts +2 -2
- package/dist/invite/workflows/accept-invite.js +2 -2
- package/dist/invite/workflows/create-invites.d.ts +1 -1
- package/dist/invite/workflows/create-invites.js +1 -1
- package/dist/invite/workflows/delete-invites.d.ts +1 -1
- package/dist/invite/workflows/delete-invites.js +1 -1
- package/dist/invite/workflows/refresh-invite-tokens.d.ts +1 -1
- package/dist/invite/workflows/refresh-invite-tokens.js +1 -1
- package/dist/line-item/workflows/delete-line-items.d.ts +1 -1
- package/dist/line-item/workflows/delete-line-items.js +1 -1
- package/dist/order/steps/set-tax-lines-for-items.d.ts +7 -0
- package/dist/order/steps/set-tax-lines-for-items.d.ts.map +1 -1
- package/dist/order/steps/set-tax-lines-for-items.js +106 -32
- package/dist/order/steps/set-tax-lines-for-items.js.map +1 -1
- package/dist/order/workflows/archive-orders.d.ts +1 -1
- package/dist/order/workflows/archive-orders.js +1 -1
- package/dist/order/workflows/cancel-order-fulfillment.d.ts +1 -1
- package/dist/order/workflows/cancel-order-fulfillment.js +1 -1
- package/dist/order/workflows/cancel-order.d.ts +1 -1
- package/dist/order/workflows/cancel-order.js +1 -1
- package/dist/order/workflows/claim/begin-order-claim.d.ts +1 -1
- package/dist/order/workflows/claim/begin-order-claim.js +1 -1
- package/dist/order/workflows/claim/cancel-begin-order-claim.d.ts +1 -1
- package/dist/order/workflows/claim/cancel-begin-order-claim.js +1 -1
- package/dist/order/workflows/claim/cancel-claim.d.ts +1 -1
- package/dist/order/workflows/claim/cancel-claim.js +1 -1
- package/dist/order/workflows/claim/claim-add-new-item.d.ts +1 -1
- package/dist/order/workflows/claim/claim-add-new-item.js +1 -1
- package/dist/order/workflows/claim/claim-item.d.ts +1 -1
- package/dist/order/workflows/claim/claim-item.js +1 -1
- package/dist/order/workflows/claim/claim-request-item-return.d.ts +1 -1
- package/dist/order/workflows/claim/claim-request-item-return.js +1 -1
- package/dist/order/workflows/claim/confirm-claim-request.d.ts +1 -1
- package/dist/order/workflows/claim/confirm-claim-request.js +1 -1
- package/dist/order/workflows/claim/create-claim-shipping-method.d.ts +2 -2
- package/dist/order/workflows/claim/create-claim-shipping-method.js +2 -2
- package/dist/order/workflows/claim/remove-claim-add-item-action.d.ts +1 -1
- package/dist/order/workflows/claim/remove-claim-add-item-action.js +1 -1
- package/dist/order/workflows/claim/remove-claim-item-action.d.ts +1 -1
- package/dist/order/workflows/claim/remove-claim-item-action.js +1 -1
- package/dist/order/workflows/claim/remove-claim-shipping-method.d.ts +2 -2
- package/dist/order/workflows/claim/remove-claim-shipping-method.js +2 -2
- package/dist/order/workflows/claim/update-claim-add-item.d.ts +1 -1
- package/dist/order/workflows/claim/update-claim-add-item.js +1 -1
- package/dist/order/workflows/claim/update-claim-item.d.ts +1 -1
- package/dist/order/workflows/claim/update-claim-item.js +1 -1
- package/dist/order/workflows/claim/update-claim-shipping-method.d.ts +2 -2
- package/dist/order/workflows/claim/update-claim-shipping-method.js +2 -2
- package/dist/order/workflows/complete-orders.d.ts +1 -1
- package/dist/order/workflows/complete-orders.d.ts.map +1 -1
- package/dist/order/workflows/complete-orders.js +1 -1
- package/dist/order/workflows/create-fulfillment.d.ts +1 -1
- package/dist/order/workflows/create-fulfillment.d.ts.map +1 -1
- package/dist/order/workflows/create-fulfillment.js +10 -2
- package/dist/order/workflows/create-fulfillment.js.map +1 -1
- package/dist/order/workflows/create-order-payment-collection.d.ts +1 -1
- package/dist/order/workflows/create-order-payment-collection.js +1 -1
- package/dist/order/workflows/create-order.d.ts +1 -1
- package/dist/order/workflows/create-order.js +1 -1
- package/dist/order/workflows/create-shipment.d.ts +1 -1
- package/dist/order/workflows/create-shipment.js +1 -1
- package/dist/order/workflows/delete-order-payment-collection.d.ts +1 -1
- package/dist/order/workflows/delete-order-payment-collection.js +1 -1
- package/dist/order/workflows/exchange/begin-order-exchange.d.ts +1 -1
- package/dist/order/workflows/exchange/begin-order-exchange.js +1 -1
- package/dist/order/workflows/exchange/cancel-begin-order-exchange.d.ts +1 -1
- package/dist/order/workflows/exchange/cancel-begin-order-exchange.js +1 -1
- package/dist/order/workflows/exchange/cancel-exchange.d.ts +1 -1
- package/dist/order/workflows/exchange/cancel-exchange.js +1 -1
- package/dist/order/workflows/exchange/confirm-exchange-request.d.ts +1 -1
- package/dist/order/workflows/exchange/confirm-exchange-request.js +1 -1
- package/dist/order/workflows/exchange/create-exchange-shipping-method.d.ts +2 -2
- package/dist/order/workflows/exchange/create-exchange-shipping-method.js +2 -2
- package/dist/order/workflows/exchange/exchange-add-new-item.d.ts +1 -1
- package/dist/order/workflows/exchange/exchange-add-new-item.js +1 -1
- package/dist/order/workflows/exchange/exchange-request-item-return.d.ts +1 -1
- package/dist/order/workflows/exchange/exchange-request-item-return.js +1 -1
- package/dist/order/workflows/exchange/remove-exchange-item-action.d.ts +1 -1
- package/dist/order/workflows/exchange/remove-exchange-item-action.js +1 -1
- package/dist/order/workflows/exchange/remove-exchange-shipping-method.d.ts +2 -2
- package/dist/order/workflows/exchange/remove-exchange-shipping-method.js +2 -2
- package/dist/order/workflows/exchange/update-exchange-add-item.d.ts +1 -1
- package/dist/order/workflows/exchange/update-exchange-add-item.js +1 -1
- package/dist/order/workflows/exchange/update-exchange-shipping-method.d.ts +2 -2
- package/dist/order/workflows/exchange/update-exchange-shipping-method.js +2 -2
- package/dist/order/workflows/get-order-detail.d.ts +2 -2
- package/dist/order/workflows/get-order-detail.js +2 -2
- package/dist/order/workflows/get-orders-list.d.ts +2 -2
- package/dist/order/workflows/get-orders-list.js +2 -2
- package/dist/order/workflows/list-shipping-options-for-order.d.ts +1 -1
- package/dist/order/workflows/list-shipping-options-for-order.js +1 -1
- package/dist/order/workflows/mark-order-fulfillment-as-delivered.d.ts +1 -1
- package/dist/order/workflows/mark-order-fulfillment-as-delivered.js +1 -1
- package/dist/order/workflows/mark-payment-collection-as-paid.d.ts +1 -1
- package/dist/order/workflows/mark-payment-collection-as-paid.js +1 -1
- package/dist/order/workflows/order-edit/begin-order-edit.d.ts +1 -1
- package/dist/order/workflows/order-edit/begin-order-edit.js +1 -1
- package/dist/order/workflows/order-edit/cancel-begin-order-edit.d.ts +1 -1
- package/dist/order/workflows/order-edit/cancel-begin-order-edit.js +1 -1
- package/dist/order/workflows/order-edit/confirm-order-edit-request.d.ts +1 -1
- package/dist/order/workflows/order-edit/confirm-order-edit-request.d.ts.map +1 -1
- package/dist/order/workflows/order-edit/confirm-order-edit-request.js +3 -1
- package/dist/order/workflows/order-edit/confirm-order-edit-request.js.map +1 -1
- package/dist/order/workflows/order-edit/create-order-edit-shipping-method.d.ts +1 -1
- package/dist/order/workflows/order-edit/create-order-edit-shipping-method.js +1 -1
- package/dist/order/workflows/order-edit/order-edit-add-new-item.d.ts +1 -1
- package/dist/order/workflows/order-edit/order-edit-add-new-item.js +1 -1
- package/dist/order/workflows/order-edit/order-edit-update-item-quantity.d.ts +1 -1
- package/dist/order/workflows/order-edit/order-edit-update-item-quantity.js +1 -1
- package/dist/order/workflows/order-edit/remove-order-edit-item-action.d.ts +1 -1
- package/dist/order/workflows/order-edit/remove-order-edit-item-action.js +1 -1
- package/dist/order/workflows/order-edit/remove-order-edit-shipping-method.d.ts +1 -1
- package/dist/order/workflows/order-edit/remove-order-edit-shipping-method.js +1 -1
- package/dist/order/workflows/order-edit/request-order-edit.d.ts +10 -1
- package/dist/order/workflows/order-edit/request-order-edit.d.ts.map +1 -1
- package/dist/order/workflows/order-edit/request-order-edit.js +4 -2
- package/dist/order/workflows/order-edit/request-order-edit.js.map +1 -1
- package/dist/order/workflows/order-edit/update-order-edit-add-item.d.ts +1 -1
- package/dist/order/workflows/order-edit/update-order-edit-add-item.js +1 -1
- package/dist/order/workflows/order-edit/update-order-edit-shipping-method.d.ts +1 -1
- package/dist/order/workflows/order-edit/update-order-edit-shipping-method.js +1 -1
- package/dist/order/workflows/return/begin-receive-return.d.ts +1 -1
- package/dist/order/workflows/return/begin-receive-return.js +1 -1
- package/dist/order/workflows/return/begin-return.d.ts +1 -1
- package/dist/order/workflows/return/begin-return.js +1 -1
- package/dist/order/workflows/return/cancel-receive-return.d.ts +1 -1
- package/dist/order/workflows/return/cancel-receive-return.js +1 -1
- package/dist/order/workflows/return/cancel-request-return.d.ts +1 -1
- package/dist/order/workflows/return/cancel-request-return.js +1 -1
- package/dist/order/workflows/return/cancel-return.d.ts +1 -1
- package/dist/order/workflows/return/cancel-return.js +1 -1
- package/dist/order/workflows/return/confirm-receive-return-request.d.ts +1 -1
- package/dist/order/workflows/return/confirm-receive-return-request.js +1 -1
- package/dist/order/workflows/return/confirm-return-request.d.ts +1 -1
- package/dist/order/workflows/return/confirm-return-request.js +1 -1
- package/dist/order/workflows/return/create-complete-return.d.ts +1 -1
- package/dist/order/workflows/return/create-complete-return.js +1 -1
- package/dist/order/workflows/return/create-return-shipping-method.d.ts +1 -1
- package/dist/order/workflows/return/create-return-shipping-method.js +1 -1
- package/dist/order/workflows/return/dismiss-item-return-request.d.ts +1 -1
- package/dist/order/workflows/return/dismiss-item-return-request.js +1 -1
- package/dist/order/workflows/return/receive-item-return-request.d.ts +1 -1
- package/dist/order/workflows/return/receive-item-return-request.js +1 -1
- package/dist/order/workflows/return/remove-item-receive-return-action.d.ts +1 -1
- package/dist/order/workflows/return/remove-item-receive-return-action.js +1 -1
- package/dist/order/workflows/return/remove-item-return-action.d.ts +1 -1
- package/dist/order/workflows/return/remove-item-return-action.js +1 -1
- package/dist/order/workflows/return/remove-return-shipping-method.d.ts +1 -1
- package/dist/order/workflows/return/remove-return-shipping-method.js +1 -1
- package/dist/order/workflows/return/request-item-return.d.ts +1 -1
- package/dist/order/workflows/return/request-item-return.js +1 -1
- package/dist/order/workflows/return/update-receive-item-return-request.d.ts +1 -1
- package/dist/order/workflows/return/update-receive-item-return-request.js +1 -1
- package/dist/order/workflows/return/update-request-item-return.d.ts +1 -1
- package/dist/order/workflows/return/update-request-item-return.js +1 -1
- package/dist/order/workflows/return/update-return-shipping-method.d.ts +1 -1
- package/dist/order/workflows/return/update-return-shipping-method.js +1 -1
- package/dist/order/workflows/return/update-return.d.ts +1 -1
- package/dist/order/workflows/return/update-return.js +1 -1
- package/dist/order/workflows/transfer/accept-order-transfer.d.ts +1 -1
- package/dist/order/workflows/transfer/accept-order-transfer.js +1 -1
- package/dist/order/workflows/transfer/cancel-order-transfer.d.ts +2 -2
- package/dist/order/workflows/transfer/cancel-order-transfer.js +2 -2
- package/dist/order/workflows/transfer/decline-order-transfer.d.ts +1 -1
- package/dist/order/workflows/transfer/decline-order-transfer.js +1 -1
- package/dist/order/workflows/transfer/request-order-transfer.d.ts +2 -2
- package/dist/order/workflows/transfer/request-order-transfer.js +2 -2
- package/dist/order/workflows/transfer/transfer-order-to-guest.d.ts +1 -1
- package/dist/order/workflows/transfer/transfer-order-to-guest.js +1 -1
- package/dist/order/workflows/update-order.d.ts +7 -1
- package/dist/order/workflows/update-order.d.ts.map +1 -1
- package/dist/order/workflows/update-order.js +7 -1
- package/dist/order/workflows/update-order.js.map +1 -1
- package/dist/order/workflows/update-tax-lines.d.ts.map +1 -1
- package/dist/order/workflows/update-tax-lines.js +1 -0
- package/dist/order/workflows/update-tax-lines.js.map +1 -1
- package/dist/payment/workflows/capture-payment.d.ts +1 -1
- package/dist/payment/workflows/capture-payment.js +1 -1
- package/dist/payment/workflows/refund-payment.d.ts +1 -1
- package/dist/payment/workflows/refund-payment.js +1 -1
- package/dist/payment-collection/workflows/create-payment-session.d.ts +1 -1
- package/dist/payment-collection/workflows/create-payment-session.js +1 -1
- package/dist/payment-collection/workflows/create-refund-reasons.d.ts +1 -1
- package/dist/payment-collection/workflows/create-refund-reasons.js +1 -1
- package/dist/payment-collection/workflows/delete-refund-reasons.d.ts +1 -1
- package/dist/payment-collection/workflows/delete-refund-reasons.js +1 -1
- package/dist/payment-collection/workflows/update-refund-reasons.d.ts +1 -1
- package/dist/payment-collection/workflows/update-refund-reasons.js +1 -1
- package/dist/price-list/workflows/batch-price-list-prices.d.ts +1 -1
- package/dist/price-list/workflows/batch-price-list-prices.js +1 -1
- package/dist/price-list/workflows/create-price-lists.d.ts +1 -1
- package/dist/price-list/workflows/create-price-lists.js +1 -1
- package/dist/price-list/workflows/delete-price-lists.d.ts +1 -1
- package/dist/price-list/workflows/delete-price-lists.js +1 -1
- package/dist/price-list/workflows/update-price-lists.d.ts +1 -1
- package/dist/price-list/workflows/update-price-lists.js +1 -1
- package/dist/pricing/workflows/create-price-preferences.d.ts +1 -1
- package/dist/pricing/workflows/create-price-preferences.js +1 -1
- package/dist/pricing/workflows/delete-price-preferences.d.ts +1 -1
- package/dist/pricing/workflows/delete-price-preferences.js +1 -1
- package/dist/pricing/workflows/update-price-preferences.d.ts +1 -1
- package/dist/pricing/workflows/update-price-preferences.js +1 -1
- package/dist/product/steps/process-product-options-for-import.d.ts +1 -1
- package/dist/product/workflows/batch-image-variants.d.ts +1 -1
- package/dist/product/workflows/batch-image-variants.js +1 -1
- package/dist/product/workflows/batch-link-products-collection.d.ts +1 -1
- package/dist/product/workflows/batch-link-products-collection.js +1 -1
- package/dist/product/workflows/batch-product-variants.d.ts +1 -1
- package/dist/product/workflows/batch-product-variants.js +1 -1
- package/dist/product/workflows/batch-products-in-category.d.ts +1 -1
- package/dist/product/workflows/batch-products-in-category.js +1 -1
- package/dist/product/workflows/batch-products.d.ts +1 -1
- package/dist/product/workflows/batch-products.js +1 -1
- package/dist/product/workflows/batch-variant-images.d.ts +1 -1
- package/dist/product/workflows/batch-variant-images.js +1 -1
- package/dist/product/workflows/create-and-link-product-options-to-product.d.ts +1 -1
- package/dist/product/workflows/create-and-link-product-options-to-product.js +1 -1
- package/dist/product/workflows/create-collections.d.ts +1 -1
- package/dist/product/workflows/create-collections.d.ts.map +1 -1
- package/dist/product/workflows/create-collections.js +1 -1
- package/dist/product/workflows/create-product-options.d.ts +1 -1
- package/dist/product/workflows/create-product-options.d.ts.map +1 -1
- package/dist/product/workflows/create-product-options.js +1 -1
- package/dist/product/workflows/create-product-tags.d.ts +1 -1
- package/dist/product/workflows/create-product-tags.d.ts.map +1 -1
- package/dist/product/workflows/create-product-tags.js +1 -1
- package/dist/product/workflows/create-product-types.d.ts +1 -1
- package/dist/product/workflows/create-product-types.d.ts.map +1 -1
- package/dist/product/workflows/create-product-types.js +1 -1
- package/dist/product/workflows/create-product-variants.d.ts +1 -1
- package/dist/product/workflows/create-product-variants.js +1 -1
- package/dist/product/workflows/create-products.d.ts +1 -1
- package/dist/product/workflows/create-products.js +1 -1
- package/dist/product/workflows/delete-collections.d.ts +1 -1
- package/dist/product/workflows/delete-collections.js +1 -1
- package/dist/product/workflows/delete-product-options.d.ts +1 -1
- package/dist/product/workflows/delete-product-options.js +1 -1
- package/dist/product/workflows/delete-product-tags.d.ts +1 -1
- package/dist/product/workflows/delete-product-tags.js +1 -1
- package/dist/product/workflows/delete-product-types.d.ts +1 -1
- package/dist/product/workflows/delete-product-types.js +1 -1
- package/dist/product/workflows/delete-product-variants.d.ts +1 -1
- package/dist/product/workflows/delete-product-variants.js +1 -1
- package/dist/product/workflows/delete-products.d.ts +1 -1
- package/dist/product/workflows/delete-products.js +1 -1
- package/dist/product/workflows/export-products.d.ts +2 -2
- package/dist/product/workflows/export-products.js +2 -2
- package/dist/product/workflows/import-products-as-chunks.d.ts +2 -2
- package/dist/product/workflows/import-products-as-chunks.js +2 -2
- package/dist/product/workflows/import-products.d.ts +2 -2
- package/dist/product/workflows/import-products.js +2 -2
- package/dist/product/workflows/update-collections.d.ts +1 -1
- package/dist/product/workflows/update-collections.d.ts.map +1 -1
- package/dist/product/workflows/update-collections.js +1 -1
- package/dist/product/workflows/update-product-options.d.ts +1 -1
- package/dist/product/workflows/update-product-options.d.ts.map +1 -1
- package/dist/product/workflows/update-product-options.js +1 -1
- package/dist/product/workflows/update-product-tags.d.ts +1 -1
- package/dist/product/workflows/update-product-tags.d.ts.map +1 -1
- package/dist/product/workflows/update-product-tags.js +1 -1
- package/dist/product/workflows/update-product-types.d.ts +1 -1
- package/dist/product/workflows/update-product-types.d.ts.map +1 -1
- package/dist/product/workflows/update-product-types.js +1 -1
- package/dist/product/workflows/update-product-variants.d.ts +1 -1
- package/dist/product/workflows/update-product-variants.js +1 -1
- package/dist/product/workflows/update-products.d.ts +1 -1
- package/dist/product/workflows/update-products.js +1 -1
- package/dist/product-category/steps/delete-product-categories.d.ts +7 -0
- package/dist/product-category/steps/delete-product-categories.d.ts.map +1 -1
- package/dist/product-category/steps/delete-product-categories.js +7 -0
- package/dist/product-category/steps/delete-product-categories.js.map +1 -1
- package/dist/product-category/workflows/create-product-categories.d.ts +1 -1
- package/dist/product-category/workflows/create-product-categories.d.ts.map +1 -1
- package/dist/product-category/workflows/create-product-categories.js +1 -1
- package/dist/product-category/workflows/delete-product-categories.d.ts +21 -1
- package/dist/product-category/workflows/delete-product-categories.d.ts.map +1 -1
- package/dist/product-category/workflows/delete-product-categories.js +21 -1
- package/dist/product-category/workflows/delete-product-categories.js.map +1 -1
- package/dist/product-category/workflows/update-product-categories.d.ts +1 -1
- package/dist/product-category/workflows/update-product-categories.d.ts.map +1 -1
- package/dist/product-category/workflows/update-product-categories.js +1 -1
- package/dist/promotion/workflows/add-or-remove-campaign-promotions.d.ts +1 -1
- package/dist/promotion/workflows/add-or-remove-campaign-promotions.js +1 -1
- package/dist/promotion/workflows/batch-promotion-rules.d.ts +3 -3
- package/dist/promotion/workflows/batch-promotion-rules.js +3 -3
- package/dist/promotion/workflows/create-campaigns.d.ts +1 -1
- package/dist/promotion/workflows/create-campaigns.d.ts.map +1 -1
- package/dist/promotion/workflows/create-campaigns.js +1 -1
- package/dist/promotion/workflows/create-promotions.d.ts +1 -1
- package/dist/promotion/workflows/create-promotions.d.ts.map +1 -1
- package/dist/promotion/workflows/create-promotions.js +1 -1
- package/dist/promotion/workflows/delete-campaigns.d.ts +1 -1
- package/dist/promotion/workflows/delete-campaigns.js +1 -1
- package/dist/promotion/workflows/delete-promotions.d.ts +1 -1
- package/dist/promotion/workflows/delete-promotions.js +1 -1
- package/dist/promotion/workflows/update-campaigns.d.ts +1 -1
- package/dist/promotion/workflows/update-campaigns.d.ts.map +1 -1
- package/dist/promotion/workflows/update-campaigns.js +1 -1
- package/dist/promotion/workflows/update-promotions.d.ts +1 -1
- package/dist/promotion/workflows/update-promotions.d.ts.map +1 -1
- package/dist/promotion/workflows/update-promotions.js +1 -1
- package/dist/region/workflows/create-regions.d.ts +1 -1
- package/dist/region/workflows/create-regions.js +1 -1
- package/dist/region/workflows/delete-regions.d.ts +1 -1
- package/dist/region/workflows/delete-regions.js +1 -1
- package/dist/region/workflows/update-regions.d.ts +1 -1
- package/dist/region/workflows/update-regions.js +1 -1
- package/dist/reservation/workflows/create-reservations.d.ts +1 -1
- package/dist/reservation/workflows/create-reservations.js +1 -1
- package/dist/reservation/workflows/delete-reservations.d.ts +1 -1
- package/dist/reservation/workflows/delete-reservations.js +1 -1
- package/dist/reservation/workflows/update-reservations.d.ts +1 -1
- package/dist/reservation/workflows/update-reservations.js +1 -1
- package/dist/return-reason/workflows/create-return-reasons.d.ts +1 -1
- package/dist/return-reason/workflows/create-return-reasons.js +1 -1
- package/dist/return-reason/workflows/delete-return-reasons.d.ts +1 -1
- package/dist/return-reason/workflows/delete-return-reasons.js +1 -1
- package/dist/return-reason/workflows/update-return-reasons.d.ts +1 -1
- package/dist/return-reason/workflows/update-return-reasons.js +1 -1
- package/dist/sales-channel/workflows/create-sales-channels.d.ts +1 -1
- package/dist/sales-channel/workflows/create-sales-channels.js +1 -1
- package/dist/sales-channel/workflows/delete-sales-channels.d.ts +1 -1
- package/dist/sales-channel/workflows/delete-sales-channels.js +1 -1
- package/dist/sales-channel/workflows/link-products-to-sales-channel.d.ts +1 -1
- package/dist/sales-channel/workflows/link-products-to-sales-channel.js +1 -1
- package/dist/sales-channel/workflows/update-sales-channels.d.ts +1 -1
- package/dist/sales-channel/workflows/update-sales-channels.js +1 -1
- package/dist/settings/steps/create-view-configuration.d.ts +15 -0
- package/dist/settings/steps/create-view-configuration.d.ts.map +1 -1
- package/dist/settings/steps/create-view-configuration.js +12 -0
- package/dist/settings/steps/create-view-configuration.js.map +1 -1
- package/dist/settings/steps/set-active-view-configuration.d.ts +23 -0
- package/dist/settings/steps/set-active-view-configuration.d.ts.map +1 -1
- package/dist/settings/steps/set-active-view-configuration.js +11 -0
- package/dist/settings/steps/set-active-view-configuration.js.map +1 -1
- package/dist/settings/steps/update-view-configuration.d.ts +20 -0
- package/dist/settings/steps/update-view-configuration.d.ts.map +1 -1
- package/dist/settings/steps/update-view-configuration.js +11 -0
- package/dist/settings/steps/update-view-configuration.js.map +1 -1
- package/dist/settings/workflows/clear-layout-configuration.d.ts +1 -1
- package/dist/settings/workflows/clear-layout-configuration.js +1 -1
- package/dist/settings/workflows/create-view-configuration.d.ts +38 -0
- package/dist/settings/workflows/create-view-configuration.d.ts.map +1 -1
- package/dist/settings/workflows/create-view-configuration.js +30 -0
- package/dist/settings/workflows/create-view-configuration.js.map +1 -1
- package/dist/settings/workflows/set-layout-configuration.d.ts +1 -1
- package/dist/settings/workflows/set-layout-configuration.js +1 -1
- package/dist/settings/workflows/update-view-configuration.d.ts +37 -0
- package/dist/settings/workflows/update-view-configuration.d.ts.map +1 -1
- package/dist/settings/workflows/update-view-configuration.js +26 -0
- package/dist/settings/workflows/update-view-configuration.js.map +1 -1
- package/dist/shipping-options/workflows/create-shipping-option-types.d.ts +1 -1
- package/dist/shipping-options/workflows/create-shipping-option-types.d.ts.map +1 -1
- package/dist/shipping-options/workflows/create-shipping-option-types.js +1 -1
- package/dist/shipping-options/workflows/delete-shipping-option-types.d.ts +1 -1
- package/dist/shipping-options/workflows/delete-shipping-option-types.js +1 -1
- package/dist/shipping-options/workflows/update-shipping-option-types.d.ts +1 -1
- package/dist/shipping-options/workflows/update-shipping-option-types.d.ts.map +1 -1
- package/dist/shipping-options/workflows/update-shipping-option-types.js +1 -1
- package/dist/shipping-profile/workflows/delete-shipping-profile.d.ts +1 -1
- package/dist/shipping-profile/workflows/delete-shipping-profile.js +1 -1
- package/dist/stock-location/workflows/create-location-fulfillment-set.d.ts +1 -1
- package/dist/stock-location/workflows/create-location-fulfillment-set.js +1 -1
- package/dist/stock-location/workflows/create-stock-locations.d.ts +1 -1
- package/dist/stock-location/workflows/create-stock-locations.d.ts.map +1 -1
- package/dist/stock-location/workflows/create-stock-locations.js +1 -1
- package/dist/stock-location/workflows/delete-stock-locations.d.ts +1 -1
- package/dist/stock-location/workflows/delete-stock-locations.js +1 -1
- package/dist/stock-location/workflows/link-sales-channels-to-stock-location.d.ts +1 -1
- package/dist/stock-location/workflows/link-sales-channels-to-stock-location.js +1 -1
- package/dist/stock-location/workflows/update-stock-locations.d.ts +1 -1
- package/dist/stock-location/workflows/update-stock-locations.js +1 -1
- package/dist/store/workflows/update-stores.d.ts +1 -1
- package/dist/store/workflows/update-stores.js +1 -1
- package/dist/tax/workflows/create-tax-rate-rules.d.ts +1 -1
- package/dist/tax/workflows/create-tax-rate-rules.js +1 -1
- package/dist/tax/workflows/create-tax-rates.d.ts +1 -1
- package/dist/tax/workflows/create-tax-rates.js +1 -1
- package/dist/tax/workflows/create-tax-regions.d.ts +1 -1
- package/dist/tax/workflows/create-tax-regions.js +1 -1
- package/dist/tax/workflows/delete-tax-rate-rules.d.ts +1 -1
- package/dist/tax/workflows/delete-tax-rate-rules.js +1 -1
- package/dist/tax/workflows/delete-tax-rates.d.ts +1 -1
- package/dist/tax/workflows/delete-tax-rates.js +1 -1
- package/dist/tax/workflows/delete-tax-regions.d.ts +1 -1
- package/dist/tax/workflows/delete-tax-regions.js +1 -1
- package/dist/tax/workflows/update-tax-rates.d.ts +1 -1
- package/dist/tax/workflows/update-tax-rates.js +1 -1
- package/dist/tax/workflows/update-tax-regions.d.ts +1 -1
- package/dist/tax/workflows/update-tax-regions.js +1 -1
- package/dist/translation/workflows/batch-translation-settings.d.ts +1 -1
- package/dist/translation/workflows/batch-translation-settings.d.ts.map +1 -1
- package/dist/translation/workflows/batch-translation-settings.js +1 -1
- package/dist/translation/workflows/batch-translations.d.ts +1 -1
- package/dist/translation/workflows/batch-translations.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/user/workflows/create-user-account.d.ts +1 -1
- package/dist/user/workflows/create-user-account.js +1 -1
- package/dist/user/workflows/remove-user-account.d.ts +1 -1
- package/dist/user/workflows/remove-user-account.js +1 -1
- package/dist/user/workflows/update-users.d.ts +1 -1
- package/dist/user/workflows/update-users.js +1 -1
- package/package.json +3 -3
|
@@ -24,7 +24,7 @@ const variantFields = (0, utils_1.deduplicate)([
|
|
|
24
24
|
exports.addToCartWorkflowId = "add-to-cart";
|
|
25
25
|
/**
|
|
26
26
|
* This workflow adds a product variant to a cart as a line item. It's executed by the
|
|
27
|
-
* [Add Line Item Store API Route](https://docs.medusajs.com/api/store
|
|
27
|
+
* [Add Line Item Store API Route](https://docs.medusajs.com/api/store/carts/add-line-item).
|
|
28
28
|
*
|
|
29
29
|
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding an item to the cart.
|
|
30
30
|
* For example, you can use this workflow to add a line item to the cart with a custom price.
|
|
@@ -125,10 +125,25 @@ exports.addToCartWorkflow = (0, workflows_sdk_1.createWorkflow)({
|
|
|
125
125
|
const { variants: variantsData, lineItems: lineItemsData } = (0, workflows_sdk_1.when)("should-calculate-prices", { variantIds }, ({ variantIds }) => {
|
|
126
126
|
return !!variantIds.length;
|
|
127
127
|
}).then(() => {
|
|
128
|
+
// Items added for a variant that is already in the cart are merged into
|
|
129
|
+
// the existing line item, so their prices must be selected for the
|
|
130
|
+
// resulting total quantity.
|
|
131
|
+
const pricingQuantities = (0, steps_1.getLineItemPricingQuantitiesStep)({
|
|
132
|
+
id: input.cart_id,
|
|
133
|
+
items: input.items,
|
|
134
|
+
});
|
|
135
|
+
const itemsToPrice = (0, workflows_sdk_1.transform)({ items: input.items, pricingQuantities }, ({ items, pricingQuantities }) => {
|
|
136
|
+
return (items ?? []).map((item, index) => {
|
|
137
|
+
return {
|
|
138
|
+
...item,
|
|
139
|
+
quantity: pricingQuantities[index] ?? item.quantity,
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
});
|
|
128
143
|
const { variants: variantsData, lineItems: items } = get_variants_and_items_with_prices_1.getVariantsAndItemsWithPrices.runAsStep({
|
|
129
144
|
input: {
|
|
130
145
|
cart,
|
|
131
|
-
items:
|
|
146
|
+
items: itemsToPrice,
|
|
132
147
|
setPricingContextResult: setPricingContextResult,
|
|
133
148
|
variants: {
|
|
134
149
|
id: variantIds,
|
|
@@ -136,9 +151,16 @@ exports.addToCartWorkflow = (0, workflows_sdk_1.createWorkflow)({
|
|
|
136
151
|
},
|
|
137
152
|
},
|
|
138
153
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
154
|
+
// The quantity of the prepared items is restored to the added quantity,
|
|
155
|
+
// since it's later accumulated with the existing line item's quantity by
|
|
156
|
+
// `getLineItemActionsStep`.
|
|
157
|
+
const lineItems = (0, workflows_sdk_1.transform)({ items, originalItems: input.items }, ({ items, originalItems }) => {
|
|
158
|
+
return items.map((item, index) => {
|
|
159
|
+
const lineItem = item.data;
|
|
160
|
+
return {
|
|
161
|
+
...lineItem,
|
|
162
|
+
quantity: originalItems?.[index]?.quantity ?? lineItem.quantity,
|
|
163
|
+
};
|
|
142
164
|
});
|
|
143
165
|
});
|
|
144
166
|
return { variants: variantsData, lineItems };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-to-cart.js","sourceRoot":"","sources":["../../../src/cart/workflows/add-to-cart.ts"],"names":[],"mappings":";;;AAMA,qDAIkC;AAClC,qEAO0C;AAC1C,yCAA4E;AAC5E,8DAA6D;AAC7D,2CAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"add-to-cart.js","sourceRoot":"","sources":["../../../src/cart/workflows/add-to-cart.ts"],"names":[],"mappings":";;;AAMA,qDAIkC;AAClC,qEAO0C;AAC1C,yCAA4E;AAC5E,8DAA6D;AAC7D,2CAAgE;AAChE,oCAKiB;AACjB,0DAAyD;AACzD,kFAA+E;AAC/E,4CAGwB;AACxB,8FAAwG;AACxG,4EAIwC;AACxC,8CAAuD;AACvD,2EAA6E;AAC7E,6FAAoF;AACpF,6DAA+D;AAE/D,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,MAAM,CAClD,oCAA2B,CAC5B,CAAA;AAED,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC;IAChC,GAAG,8BAAqB;IACxB,GAAG,+EAA6C;CACjD,CAAC,CAAA;AAEW,QAAA,mBAAmB,GAAG,aAAa,CAAA;AAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACU,QAAA,iBAAiB,GAAG,IAAA,8BAAc,EAC7C;IACE,IAAI,EAAE,2BAAmB;IACzB,UAAU,EAAE,KAAK;CAClB,EACD,CAAC,KAAiD,EAAE,EAAE;IACpD,IAAA,yBAAe,EAAC;QACd,GAAG,EAAE,KAAK,CAAC,OAAO;QAClB,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,EAAE;KACR,CAAC,CAAA;IA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utput = {
|
|
|
17
17
|
export declare const completeCartWorkflowId = "complete-cart";
|
|
18
18
|
/**
|
|
19
19
|
* This workflow completes a cart and places an order for the customer. It's executed by the
|
|
20
|
-
* [Complete Cart Store API Route](https://docs.medusajs.com/api/store
|
|
20
|
+
* [Complete Cart Store API Route](https://docs.medusajs.com/api/store/carts/complete-cart).
|
|
21
21
|
*
|
|
22
22
|
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around completing a cart.
|
|
23
23
|
* For example, in the [Subscriptions recipe](https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard#create-workflow),
|
|
@@ -22,7 +22,7 @@ const TWO_MINUTES = 60 * 2;
|
|
|
22
22
|
exports.completeCartWorkflowId = "complete-cart";
|
|
23
23
|
/**
|
|
24
24
|
* This workflow completes a cart and places an order for the customer. It's executed by the
|
|
25
|
-
* [Complete Cart Store API Route](https://docs.medusajs.com/api/store
|
|
25
|
+
* [Complete Cart Store API Route](https://docs.medusajs.com/api/store/carts/complete-cart).
|
|
26
26
|
*
|
|
27
27
|
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around completing a cart.
|
|
28
28
|
* For example, in the [Subscriptions recipe](https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard#create-workflow),
|
|
@@ -48,7 +48,7 @@ export declare const prepareCartToCreateStep: import("@medusajs/framework/workfl
|
|
|
48
48
|
export declare const createCartWorkflowId = "create-cart";
|
|
49
49
|
/**
|
|
50
50
|
* This workflow creates and returns a cart. You can set the cart's items, region, customer, and other details. This workflow is executed by the
|
|
51
|
-
* [Create Cart Store API Route](https://docs.medusajs.com/api/store
|
|
51
|
+
* [Create Cart Store API Route](https://docs.medusajs.com/api/store/carts/create-cart).
|
|
52
52
|
*
|
|
53
53
|
* This workflow has a hook that allows you to perform custom actions on the created cart. You can see an example in [this guide](https://docs.medusajs.com/resources/commerce-modules/cart/extend#step-4-consume-cartcreated-workflow-hook).
|
|
54
54
|
*
|
|
@@ -46,7 +46,7 @@ exports.prepareCartToCreateStep = (0, workflows_sdk_1.createStep)("prepare-cart-
|
|
|
46
46
|
exports.createCartWorkflowId = "create-cart";
|
|
47
47
|
/**
|
|
48
48
|
* This workflow creates and returns a cart. You can set the cart's items, region, customer, and other details. This workflow is executed by the
|
|
49
|
-
* [Create Cart Store API Route](https://docs.medusajs.com/api/store
|
|
49
|
+
* [Create Cart Store API Route](https://docs.medusajs.com/api/store/carts/create-cart).
|
|
50
50
|
*
|
|
51
51
|
* This workflow has a hook that allows you to perform custom actions on the created cart. You can see an example in [this guide](https://docs.medusajs.com/resources/commerce-modules/cart/extend#step-4-consume-cartcreated-workflow-hook).
|
|
52
52
|
*
|
|
@@ -35,7 +35,7 @@ export declare const validateExistingPaymentCollectionStep: import("@medusajs/fr
|
|
|
35
35
|
export declare const createPaymentCollectionForCartWorkflowId = "create-payment-collection-for-cart";
|
|
36
36
|
/**
|
|
37
37
|
* This workflow creates a payment collection for a cart. It's executed by the
|
|
38
|
-
* [Create Payment Collection Store API Route](https://docs.medusajs.com/api/store
|
|
38
|
+
* [Create Payment Collection Store API Route](https://docs.medusajs.com/api/store/payment-collections/create-payment-collection).
|
|
39
39
|
*
|
|
40
40
|
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding creating a payment collection for a cart.
|
|
41
41
|
*
|
|
@@ -37,7 +37,7 @@ exports.validateExistingPaymentCollectionStep = (0, workflows_sdk_1.createStep)(
|
|
|
37
37
|
exports.createPaymentCollectionForCartWorkflowId = "create-payment-collection-for-cart";
|
|
38
38
|
/**
|
|
39
39
|
* This workflow creates a payment collection for a cart. It's executed by the
|
|
40
|
-
* [Create Payment Collection Store API Route](https://docs.medusajs.com/api/store
|
|
40
|
+
* [Create Payment Collection Store API Route](https://docs.medusajs.com/api/store/payment-collections/create-payment-collection).
|
|
41
41
|
*
|
|
42
42
|
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding creating a payment collection for a cart.
|
|
43
43
|
*
|
|
@@ -40,6 +40,25 @@ interface PrepareVariantsAndItemsWithPricesStepInput {
|
|
|
40
40
|
*/
|
|
41
41
|
export declare const prepareVariantsAndItemsWithPricesStep: import("@medusajs/framework/workflows-sdk").StepFunction<PrepareVariantsAndItemsWithPricesStepInput, GetVariantsAndItemsWithPricesWorkflowOutput>;
|
|
42
42
|
export declare const getVariantsAndItemsWithPricesId = "get-variant-items-with-prices-workflow";
|
|
43
|
+
/**
|
|
44
|
+
* This workflow retrieves product variants and cart line items with their
|
|
45
|
+
* calculated prices. It's used as a sub-workflow when adding items to a cart
|
|
46
|
+
* or refreshing cart prices to attach up-to-date pricing context to each line
|
|
47
|
+
* item.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const { result } = await getVariantsAndItemsWithPrices(container)
|
|
51
|
+
* .run({
|
|
52
|
+
* input: {
|
|
53
|
+
* cart: { id: "cart_123", items: [] },
|
|
54
|
+
* setPricingContextResult: {},
|
|
55
|
+
* },
|
|
56
|
+
* })
|
|
57
|
+
*
|
|
58
|
+
* @summary
|
|
59
|
+
*
|
|
60
|
+
* Retrieve variants and line items with their calculated prices.
|
|
61
|
+
*/
|
|
43
62
|
export declare const getVariantsAndItemsWithPrices: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<GetVariantsAndItemsWithPricesWorkflowInput, GetVariantsAndItemsWithPricesWorkflowOutput, []>;
|
|
44
63
|
export {};
|
|
45
64
|
//# sourceMappingURL=get-variants-and-items-with-prices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-variants-and-items-with-prices.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/get-variants-and-items-with-prices.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,OAAO,EACP,eAAe,EACf,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EAET,6BAA6B,EAC9B,MAAM,2BAA2B,CAAA;AA2BlC,UAAU,0CAA0C;IAClD,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG;QACvB,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;QAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,KAAK,CAAC,EAAE,OAAO,CACX,2BAA2B,GAC3B,eAAe,GACf,aAAa,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAC/D,EAAE,CAAA;IACH,uBAAuB,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,EAAE;QACT,EAAE,CAAC,EAAE,MAAM,EAAE,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAClB,CAAA;CACF;AAED,KAAK,2CAA2C,GAAG;IAEjD,QAAQ,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG;QACtC,gBAAgB,EAAE;YAChB,gBAAgB,EAAE;gBAChB,eAAe,EAAE,MAAM,CAAA;aACxB,CAAA;YACD,iCAAiC,EAAE,OAAO,CAAA;YAC1C,eAAe,EAAE,cAAc,CAAA;YAC/B,iBAAiB,EAAE,cAAc,CAAA;SAClC,CAAA;KACF,CAAC,EAAE,CAAA;IACJ,SAAS,EAAE,6BAA6B,EAAE,CAAA;CAC3C,CAAA;AAED,UAAU,0CAA0C;IAClD,IAAI,EAAE,0CAA0C,CAAC,MAAM,CAAC,CAAA;IACxD,KAAK,EAAE,0CAA0C,CAAC,OAAO,CAAC,CAAA;IAC1D,YAAY,EAAE,GAAG,EAAE,CAAA;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,
|
|
1
|
+
{"version":3,"file":"get-variants-and-items-with-prices.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/get-variants-and-items-with-prices.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;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,mJAkGjD,CAAA;AAED,eAAO,MAAM,+BAA+B,2CACF,CAAA;AAC1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,yJA+FzC,CAAA"}
|
|
@@ -16,6 +16,16 @@ const prepare_line_item_data_1 = require("../utils/prepare-line-item-data");
|
|
|
16
16
|
exports.prepareVariantsAndItemsWithPricesStep = (0, workflows_sdk_1.createStep)("prepare-variants-and-items-with-prices", async ({ cart, items: inputItems, variantsData, calculatedPriceSets, }) => {
|
|
17
17
|
const priceNotFound = [];
|
|
18
18
|
const variantNotFoundOrPublished = [];
|
|
19
|
+
// Index the variants by id so the per-item lookup below is O(1) instead of a
|
|
20
|
+
// `variantsData.find` scan. A cart refresh runs this for every line item, so the
|
|
21
|
+
// scan made the step O(items x variants) on carts with many lines. First match
|
|
22
|
+
// wins, mirroring `find`.
|
|
23
|
+
const variantsById = new Map();
|
|
24
|
+
for (const variant of variantsData) {
|
|
25
|
+
if (!variantsById.has(variant.id)) {
|
|
26
|
+
variantsById.set(variant.id, variant);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
const items = (inputItems ?? cart.items ?? []).map((item) => {
|
|
20
30
|
const item_ = item;
|
|
21
31
|
const idLike = item.id ?? (0, utils_1.simpleHash)(JSON.stringify(item));
|
|
@@ -27,7 +37,7 @@ exports.prepareVariantsAndItemsWithPricesStep = (0, workflows_sdk_1.createStep)(
|
|
|
27
37
|
if (!calculatedPriceSet && item_.variant_id && !isCustomPrice) {
|
|
28
38
|
priceNotFound.push(item_.variant_id);
|
|
29
39
|
}
|
|
30
|
-
const variant =
|
|
40
|
+
const variant = variantsById.get(item.variant_id);
|
|
31
41
|
if ((item.variant_id && !variant) || // variant specified but doesn't exist
|
|
32
42
|
(variant &&
|
|
33
43
|
(!variant?.product?.status ||
|
|
@@ -47,7 +57,7 @@ exports.prepareVariantsAndItemsWithPricesStep = (0, workflows_sdk_1.createStep)(
|
|
|
47
57
|
calculatedPriceSet?.is_calculated_price_tax_inclusive,
|
|
48
58
|
isCustomPrice: isCustomPrice,
|
|
49
59
|
};
|
|
50
|
-
if (variant && !isCustomPrice) {
|
|
60
|
+
if (variant && !isCustomPrice && calculatedPriceSet) {
|
|
51
61
|
input.unitPrice = calculatedPriceSet.calculated_amount;
|
|
52
62
|
input.isTaxInclusive =
|
|
53
63
|
calculatedPriceSet.is_calculated_price_tax_inclusive;
|
|
@@ -71,6 +81,25 @@ exports.prepareVariantsAndItemsWithPricesStep = (0, workflows_sdk_1.createStep)(
|
|
|
71
81
|
return new workflows_sdk_1.StepResponse(result);
|
|
72
82
|
});
|
|
73
83
|
exports.getVariantsAndItemsWithPricesId = "get-variant-items-with-prices-workflow";
|
|
84
|
+
/**
|
|
85
|
+
* This workflow retrieves product variants and cart line items with their
|
|
86
|
+
* calculated prices. It's used as a sub-workflow when adding items to a cart
|
|
87
|
+
* or refreshing cart prices to attach up-to-date pricing context to each line
|
|
88
|
+
* item.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const { result } = await getVariantsAndItemsWithPrices(container)
|
|
92
|
+
* .run({
|
|
93
|
+
* input: {
|
|
94
|
+
* cart: { id: "cart_123", items: [] },
|
|
95
|
+
* setPricingContextResult: {},
|
|
96
|
+
* },
|
|
97
|
+
* })
|
|
98
|
+
*
|
|
99
|
+
* @summary
|
|
100
|
+
*
|
|
101
|
+
* Retrieve variants and line items with their calculated prices.
|
|
102
|
+
*/
|
|
74
103
|
exports.getVariantsAndItemsWithPrices = (0, workflows_sdk_1.createWorkflow)(exports.getVariantsAndItemsWithPricesId, (input) => {
|
|
75
104
|
const variantIds = (0, workflows_sdk_1.transform)({ input }, (data) => {
|
|
76
105
|
if (data.input.variants?.id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-variants-and-items-with-prices.js","sourceRoot":"","sources":["../../../src/cart/workflows/get-variants-and-items-with-prices.ts"],"names":[],"mappings":";;;AAYA,qDAMkC;AAClC,qEAO0C;AAC1C,yCAAgD;AAChD,oCAAkD;AAClD,4CAGwB;AACxB,4EAGwC;AA2CxC;;;;;GAKG;AACU,QAAA,qCAAqC,GAAG,IAAA,0BAAU,EAC7D,wCAAwC,EACxC,KAAK,EAAE,EACL,IAAI,EACJ,KAAK,EAAE,UAAU,EACjB,YAAY,EACZ,mBAAmB,GACwB,EAAE,EAAE;IAC/C,MAAM,aAAa,GAAa,EAAE,CAAA;IAClC,MAAM,0BAA0B,GAAa,EAAE,CAAA;IAE/C,MAAM,KAAK,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1D,MAAM,KAAK,GAAG,IAAW,CAAA;QACzB,MAAM,MAAM,GACT,IAAwB,CAAC,EAAE,IAAI,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QAClE,IAAI,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;QACpD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,UAAW,CAAC,CAAA;QAC7D,CAAC;QAED,MAAM,aAAa,GACjB,KAAK,CAAC,eAAe,IAAI,IAAA,iBAAS,EAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAEtD,IAAI,CAAC,kBAAkB,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC,aAAa,EAAE,CAAC;YAC9D,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACtC,CAAC;QAED,MAAM,OAAO,GAAG,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"get-variants-and-items-with-prices.js","sourceRoot":"","sources":["../../../src/cart/workflows/get-variants-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;oBACvB,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU;iBACnC;aACF,CAAA;QACH,CAAC,CAAC,CAAA;IACN,CAAC,CACF,CAAA;IAED,MAAM,kBAAkB,GAAG,IAAA,yBAAS,EAClC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EAC5B,CAAC,IAAI,EAAE,EAAE;QACP,OAAO,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,8BAAqB,CAAA;IACvD,CAAC,CACF,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAA,0BAAiB,EAAC;QAC/C,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE;YACP,EAAE,EAAE,UAAU;SACf;QACD,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;aACb;SACF;KACF,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAA;IAErC,MAAM,mBAAmB,GAAG,IAAA,+BAAuB,EAAC;QAClD,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAA;IAEF,MAAM,uBAAuB,GAAG,IAAA,6CAAqC,EAAC;QACpE,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,YAAY;QACZ,mBAAmB;KACpB,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,uBAAuB,CAAC,CAAA;AACtD,CAAC,CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-shipping-options-for-cart-with-pricing.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,cAAc,EAEd,kDAAkD,EAEnD,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"list-shipping-options-for-cart-with-pricing.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,cAAc,EAEd,kDAAkD,EAEnD,MAAM,2BAA2B,CAAA;AAiDlC,eAAO,MAAM,+CAA+C,gDACb,CAAA;AAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,eAAO,MAAM,6CAA6C;;;;qCAuRzD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-shipping-options-for-cart-with-pricing.js","sourceRoot":"","sources":["../../../src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts"],"names":[],"mappings":";;;AAAA,qDAIkC;AAClC,qEAO0C;AAQ1C,yCAAwE;AACxE,0EAAwE;AACxE,mDAAsE;AACtE,4CAA6E;AAC7E,gGAA4F;AAC5F,8CAA+D;AAC/D,sGAAoG;AAEpG,MAAM,qBAAqB,GAAG;IAC5B,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,iBAAiB;IACjB,iCAAiC;IACjC,mCAAmC;IACnC,iDAAiD;IACjD,qBAAqB;IACrB,aAAa;IACb,MAAM;IAEN,SAAS;IACT,YAAY;IACZ,kBAAkB;IAClB,WAAW;IAEX,aAAa;IACb,qBAAqB;IAErB,iBAAiB;IACjB,aAAa;IACb,gBAAgB;CACjB,CAAA;AAED,MAAM,cAAc,GAAG;IACrB,GAAG,qBAAqB;IACxB,oBAAoB;IACpB,UAAU;IACV,sBAAsB;CACvB,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,GAAG,oDAA2C;IAC9C,kBAAkB;IAClB,
|
|
1
|
+
{"version":3,"file":"list-shipping-options-for-cart-with-pricing.js","sourceRoot":"","sources":["../../../src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts"],"names":[],"mappings":";;;AAAA,qDAIkC;AAClC,qEAO0C;AAQ1C,yCAAwE;AACxE,0EAAwE;AACxE,mD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C,KAAK,CAAC;oBAC/B,cAAc,EACZ,yBAAyB,CACvB,cAAc,CAAC,YAAY,CAAC,kBAAkB,CAC/C;iBACJ,CAAA;YACH,CAAC,CAAC;SACH,CAAA;IACH,CAAC,CACF,CAAA;IAED,MAAM,yBAAyB,GAAG,IAAA,iEAAgC,EAAC;QACjE,eAAe,EAAE,wBAAwB;QACzC,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,yBAAkC,EAAE;QAC9D,KAAK,EAAE,CAAC,yBAAyB,CAAU;KAC5C,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { AdditionalData, ListShippingOptionsForCartWorkflowInput } from "@medusa
|
|
|
2
2
|
export declare const listShippingOptionsForCartWorkflowId = "list-shipping-options-for-cart";
|
|
3
3
|
/**
|
|
4
4
|
* This workflow lists the shipping options of a cart. It's executed by the
|
|
5
|
-
* [List Shipping Options Store API Route](https://docs.medusajs.com/api/store
|
|
5
|
+
* [List Shipping Options Store API Route](https://docs.medusajs.com/api/store/shipping-options/list-shipping-options-for-cart).
|
|
6
6
|
*
|
|
7
7
|
* :::note
|
|
8
8
|
*
|
|
@@ -19,7 +19,7 @@ const cartFields = [
|
|
|
19
19
|
exports.listShippingOptionsForCartWorkflowId = "list-shipping-options-for-cart";
|
|
20
20
|
/**
|
|
21
21
|
* This workflow lists the shipping options of a cart. It's executed by the
|
|
22
|
-
* [List Shipping Options Store API Route](https://docs.medusajs.com/api/store
|
|
22
|
+
* [List Shipping Options Store API Route](https://docs.medusajs.com/api/store/shipping-options/list-shipping-options-for-cart).
|
|
23
23
|
*
|
|
24
24
|
* :::note
|
|
25
25
|
*
|
|
@@ -17,7 +17,7 @@ export declare const transferCartCustomerWorkflowId = "transfer-cart-customer";
|
|
|
17
17
|
/**
|
|
18
18
|
* This workflow transfers a cart's customer ownership to another customer. It's useful if a customer logs in after
|
|
19
19
|
* adding the items to their cart, allowing you to transfer the cart's ownership to the logged-in customer. This workflow is used
|
|
20
|
-
* by the [Set Cart's Customer Store API Route](https://docs.medusajs.com/api/store
|
|
20
|
+
* by the [Set Cart's Customer Store API Route](https://docs.medusajs.com/api/store/carts/change-customer).
|
|
21
21
|
*
|
|
22
22
|
* You can use this workflow within your own customizations or custom workflows, allowing you to set the cart's customer within your custom flows.
|
|
23
23
|
*
|
|
@@ -11,7 +11,7 @@ exports.transferCartCustomerWorkflowId = "transfer-cart-customer";
|
|
|
11
11
|
/**
|
|
12
12
|
* This workflow transfers a cart's customer ownership to another customer. It's useful if a customer logs in after
|
|
13
13
|
* adding the items to their cart, allowing you to transfer the cart's ownership to the logged-in customer. This workflow is used
|
|
14
|
-
* by the [Set Cart's Customer Store API Route](https://docs.medusajs.com/api/store
|
|
14
|
+
* by the [Set Cart's Customer Store API Route](https://docs.medusajs.com/api/store/carts/change-customer).
|
|
15
15
|
*
|
|
16
16
|
* You can use this workflow within your own customizations or custom workflows, allowing you to set the cart's customer within your custom flows.
|
|
17
17
|
*
|
|
@@ -31,7 +31,7 @@ export declare const updateCartPromotionsWorkflowId = "update-cart-promotions";
|
|
|
31
31
|
/**
|
|
32
32
|
* This workflow updates a cart's promotions, applying or removing promotion codes from the cart. It also computes the adjustments
|
|
33
33
|
* that need to be applied to the cart's line items and shipping methods based on the promotions applied. This workflow is used by
|
|
34
|
-
* [Add Promotions Store API Route](https://docs.medusajs.com/api/store
|
|
34
|
+
* [Add Promotions Store API Route](https://docs.medusajs.com/api/store/carts/add-promotions).
|
|
35
35
|
*
|
|
36
36
|
* You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's promotions within your custom flows.
|
|
37
37
|
*
|
|
@@ -14,7 +14,7 @@ exports.updateCartPromotionsWorkflowId = "update-cart-promotions";
|
|
|
14
14
|
/**
|
|
15
15
|
* This workflow updates a cart's promotions, applying or removing promotion codes from the cart. It also computes the adjustments
|
|
16
16
|
* that need to be applied to the cart's line items and shipping methods based on the promotions applied. This workflow is used by
|
|
17
|
-
* [Add Promotions Store API Route](https://docs.medusajs.com/api/store
|
|
17
|
+
* [Add Promotions Store API Route](https://docs.medusajs.com/api/store/carts/add-promotions).
|
|
18
18
|
*
|
|
19
19
|
* You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's promotions within your custom flows.
|
|
20
20
|
*
|
|
@@ -39,7 +39,7 @@ export declare const prepareCartToUpdateStep: import("@medusajs/framework/workfl
|
|
|
39
39
|
export declare const updateCartWorkflowId = "update-cart";
|
|
40
40
|
/**
|
|
41
41
|
* This workflow updates a cart and returns it. You can update the cart's region, address, and more. This workflow is executed by the
|
|
42
|
-
* [Update Cart Store API Route](https://docs.medusajs.com/api/store
|
|
42
|
+
* [Update Cart Store API Route](https://docs.medusajs.com/api/store/carts/update-a-cart).
|
|
43
43
|
*
|
|
44
44
|
* :::note
|
|
45
45
|
*
|
|
@@ -66,7 +66,7 @@ exports.prepareCartToUpdateStep = (0, workflows_sdk_1.createStep)("prepare-cart-
|
|
|
66
66
|
exports.updateCartWorkflowId = "update-cart";
|
|
67
67
|
/**
|
|
68
68
|
* This workflow updates a cart and returns it. You can update the cart's region, address, and more. This workflow is executed by the
|
|
69
|
-
* [Update Cart Store API Route](https://docs.medusajs.com/api/store
|
|
69
|
+
* [Update Cart Store API Route](https://docs.medusajs.com/api/store/carts/update-a-cart).
|
|
70
70
|
*
|
|
71
71
|
* :::note
|
|
72
72
|
*
|
|
@@ -24,40 +24,12 @@ interface PrepareLineItemUpdateStepInput {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* This step builds the update payload for a cart line item, resolving its unit
|
|
27
|
-
* price (from the input, the variant's calculated price, or the existing item)
|
|
28
|
-
* and tax inclusivity. It throws an error if the
|
|
27
|
+
* price (from the input, the variant's calculated price, or the existing item),
|
|
28
|
+
* its compare-at unit price, and tax inclusivity. It throws an error if the
|
|
29
|
+
* resulting unit price is unset.
|
|
29
30
|
*/
|
|
30
31
|
export declare const prepareLineItemUpdateStep: import("@medusajs/framework/workflows-sdk").StepFunction<PrepareLineItemUpdateStepInput, {
|
|
31
|
-
data:
|
|
32
|
-
unit_price: string | number | import("@medusajs/framework/types").BigNumberRawValue | BigNumber | import("@medusajs/framework/types").IBigNumber;
|
|
33
|
-
is_custom_price: boolean;
|
|
34
|
-
is_tax_inclusive: any;
|
|
35
|
-
id?: string | undefined;
|
|
36
|
-
title?: string | undefined;
|
|
37
|
-
quantity?: import("@medusajs/framework/types").BigNumberInput | undefined;
|
|
38
|
-
metadata?: (Record<string, unknown> | null) | undefined;
|
|
39
|
-
tax_lines?: import("@medusajs/framework/types").UpdateTaxLineDTO[] | import("@medusajs/framework/types").CreateTaxLineDTO[] | undefined;
|
|
40
|
-
adjustments?: import("@medusajs/framework/types").UpdateAdjustmentDTO[] | import("@medusajs/framework/types").CreateAdjustmentDTO[] | undefined;
|
|
41
|
-
product_id?: string | undefined;
|
|
42
|
-
variant_id?: string | undefined;
|
|
43
|
-
thumbnail?: string | undefined;
|
|
44
|
-
requires_shipping?: boolean | undefined;
|
|
45
|
-
product_title?: string | undefined;
|
|
46
|
-
cart_id?: string | undefined;
|
|
47
|
-
subtitle?: string | undefined;
|
|
48
|
-
product_description?: string | undefined;
|
|
49
|
-
product_subtitle?: string | undefined;
|
|
50
|
-
product_type?: string | undefined;
|
|
51
|
-
product_type_id?: string | undefined;
|
|
52
|
-
product_collection?: string | undefined;
|
|
53
|
-
product_handle?: string | undefined;
|
|
54
|
-
variant_sku?: string | undefined;
|
|
55
|
-
variant_barcode?: string | undefined;
|
|
56
|
-
variant_title?: string | undefined;
|
|
57
|
-
variant_option_values?: Record<string, unknown> | undefined;
|
|
58
|
-
is_discountable?: boolean | undefined;
|
|
59
|
-
compare_at_unit_price?: import("@medusajs/framework/types").BigNumberInput | undefined;
|
|
60
|
-
};
|
|
32
|
+
data: Record<string, any>;
|
|
61
33
|
selector: {
|
|
62
34
|
id: string;
|
|
63
35
|
};
|
|
@@ -66,7 +38,7 @@ export declare const updateLineItemInCartWorkflowId = "update-line-item-in-cart"
|
|
|
66
38
|
/**
|
|
67
39
|
* This workflow updates a line item's details in a cart. You can update the line item's quantity, unit price, and more.
|
|
68
40
|
* If the quantity is set to 0, the item will be removed from the cart.
|
|
69
|
-
* This workflow is executed by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store
|
|
41
|
+
* This workflow is executed by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store/carts/update-line-item).
|
|
70
42
|
*
|
|
71
43
|
* You can use this workflow within your own customizations or custom workflows, allowing you to update a line item's details in your custom flows.
|
|
72
44
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-line-item-in-cart.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/update-line-item-in-cart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,OAAO,EACP,WAAW,EACX,SAAS,EACT,oCAAoC,EACrC,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"update-line-item-in-cart.d.ts","sourceRoot":"","sources":["../../../src/cart/workflows/update-line-item-in-cart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,OAAO,EACP,WAAW,EACX,SAAS,EACT,oCAAoC,EACrC,MAAM,2BAA2B,CAAA;AAWlC,OAAO,EAQL,YAAY,EAEb,MAAM,mCAAmC,CAAA;AAyB1C,UAAU,YAAa,SAAQ,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IACnD,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;IACpC,QAAQ,EAAE,WAAW,CAAA;IACrB,MAAM,EAAE,SAAS,CAAA;CAClB;AAED,UAAU,6BAA6B;IACrC,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,EAAE,oCAAoC,GAAG,cAAc,CAAA;CAC7D;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;EAcpC,CAAA;AAED,UAAU,8BAA8B;IACtC,KAAK,EAAE,oCAAoC,GAAG,cAAc,CAAA;IAC5D,QAAQ,EAAE,GAAG,CAAA;IACb,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;CACpC;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;EAsDrC,CAAA;AAED,eAAO,MAAM,8BAA8B,6BAA6B,CAAA;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;qCAmKxC,CAAA"}
|
|
@@ -34,8 +34,9 @@ exports.findLineItemToUpdateStep = (0, workflows_sdk_1.createStep)("find-line-it
|
|
|
34
34
|
});
|
|
35
35
|
/**
|
|
36
36
|
* This step builds the update payload for a cart line item, resolving its unit
|
|
37
|
-
* price (from the input, the variant's calculated price, or the existing item)
|
|
38
|
-
* and tax inclusivity. It throws an error if the
|
|
37
|
+
* price (from the input, the variant's calculated price, or the existing item),
|
|
38
|
+
* its compare-at unit price, and tax inclusivity. It throws an error if the
|
|
39
|
+
* resulting unit price is unset.
|
|
39
40
|
*/
|
|
40
41
|
exports.prepareLineItemUpdateStep = (0, workflows_sdk_1.createStep)("prepare-line-item-update", async ({ input, variants, item }) => {
|
|
41
42
|
const variant = variants?.[0] ?? undefined;
|
|
@@ -52,6 +53,18 @@ exports.prepareLineItemUpdateStep = (0, workflows_sdk_1.createStep)("prepare-lin
|
|
|
52
53
|
};
|
|
53
54
|
if (variant && !updateData.is_custom_price) {
|
|
54
55
|
updateData.unit_price = variant.calculated_price.calculated_amount;
|
|
56
|
+
// The compare-at price is hydrated the same way the create path does it,
|
|
57
|
+
// so that the applied sale price is visible regardless of which path
|
|
58
|
+
// produced the line item.
|
|
59
|
+
if (!(0, utils_1.isDefined)(input.update.compare_at_unit_price)) {
|
|
60
|
+
const isSalePrice = variant.calculated_price?.calculated_price?.price_list_type ===
|
|
61
|
+
utils_1.PriceListType.SALE;
|
|
62
|
+
updateData.compare_at_unit_price =
|
|
63
|
+
isSalePrice &&
|
|
64
|
+
!utils_1.MathBN.eq(variant.calculated_price?.original_amount, variant.calculated_price?.calculated_amount)
|
|
65
|
+
? variant.calculated_price.original_amount
|
|
66
|
+
: null;
|
|
67
|
+
}
|
|
55
68
|
}
|
|
56
69
|
if (!(0, utils_1.isDefined)(updateData.unit_price)) {
|
|
57
70
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Line item ${item.title} has no unit price`);
|
|
@@ -67,7 +80,7 @@ exports.updateLineItemInCartWorkflowId = "update-line-item-in-cart";
|
|
|
67
80
|
/**
|
|
68
81
|
* This workflow updates a line item's details in a cart. You can update the line item's quantity, unit price, and more.
|
|
69
82
|
* If the quantity is set to 0, the item will be removed from the cart.
|
|
70
|
-
* This workflow is executed by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store
|
|
83
|
+
* This workflow is executed by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store/carts/update-line-item).
|
|
71
84
|
*
|
|
72
85
|
* You can use this workflow within your own customizations or custom workflows, allowing you to update a line item's details in your custom flows.
|
|
73
86
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-line-item-in-cart.js","sourceRoot":"","sources":["../../../src/cart/workflows/update-line-item-in-cart.ts"],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"update-line-item-in-cart.js","sourceRoot":"","sources":["../../../src/cart/workflows/update-line-item-in-cart.ts"],"names":[],"mappings":";;;AAOA,qDASkC;AAClC,qEAU0C;AAC1C,yCAAgD;AAChD,8DAA6D;AAC7D,+CAAyD;AACzD,iDAAuE;AACvE,2CAAgE;AAChE,0DAAyD;AACzD,8EAA4E;AAC5E,4CAGwB;AACxB,8FAAwG;AACxG,8CAAuD;AACvD,2EAA6E;AAC7E,6DAA+D;AAE/D,MAAM,UAAU,GAAG,oCAA2B,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,C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QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;aACnE,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,2DAA+B,CAAC,SAAS,CAAC;YACxC,KAAK,EAAE;gBACL,gBAAgB,EAAE,cAAc,CAAC,gBAAgB;gBACjD,QAAQ;gBACR,KAAK;aACN;SACF,CAAC,CAAA;QAEF,MAAM,cAAc,GAAG,IAAA,iCAAyB,EAAC;YAC/C,KAAK;YACL,QAAQ;YACR,IAAI;SACL,CAAC,CAAA;QAEF,IAAA,uCAA+B,EAAC,cAAc,CAAC,CAAA;QAE/C,6CAAwB,CAAC,SAAS,CAAC;YACjC,KAAK,EAAE;gBACL,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,eAAe,EAAE,KAAK,CAAC,eAAe;aACvC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAA,2BAAW,EACT,IAAA,yBAAe,EAAC;QACd,GAAG,EAAE,KAAK,CAAC,OAAO;KACnB,CAAC,EACF,IAAA,0BAAa,EAAC;QACZ,SAAS,EAAE,0BAAkB,CAAC,OAAO;QACrC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;KAC5B,CAAC,CACH,CAAA;IAED,OAAO,IAAI,gCAAgB,CAAC,KAAK,CAAC,EAAE;QAClC,KAAK,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAU;KAC9C,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|
|
@@ -41,7 +41,7 @@ export type UpdateTaxLinesWorkflowInput = {
|
|
|
41
41
|
export declare const updateTaxLinesWorkflowId = "update-tax-lines";
|
|
42
42
|
/**
|
|
43
43
|
* This workflow updates a cart's tax lines that are applied on line items and shipping methods. You can update the line item's quantity, unit price, and more. This workflow is executed
|
|
44
|
-
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store
|
|
44
|
+
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store/carts/calculate-taxes).
|
|
45
45
|
*
|
|
46
46
|
* You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's tax lines in your custom flows.
|
|
47
47
|
*
|
|
@@ -63,7 +63,7 @@ const cartFields = [
|
|
|
63
63
|
exports.updateTaxLinesWorkflowId = "update-tax-lines";
|
|
64
64
|
/**
|
|
65
65
|
* This workflow updates a cart's tax lines that are applied on line items and shipping methods. You can update the line item's quantity, unit price, and more. This workflow is executed
|
|
66
|
-
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store
|
|
66
|
+
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store/carts/calculate-taxes).
|
|
67
67
|
*
|
|
68
68
|
* You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's tax lines in your custom flows.
|
|
69
69
|
*
|
|
@@ -35,7 +35,7 @@ export type UpsertTaxLinesWorkflowInput = {
|
|
|
35
35
|
export declare const upsertTaxLinesWorkflowId = "upsert-tax-lines";
|
|
36
36
|
/**
|
|
37
37
|
* This workflow upserts a cart's tax lines that are applied on line items and shipping methods. You can upsert the line item's quantity, unit price, and more. This workflow is executed
|
|
38
|
-
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store
|
|
38
|
+
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store/carts/calculate-taxes).
|
|
39
39
|
*
|
|
40
40
|
* You can use this workflow within your own customizations or custom workflows, allowing you to upsert a cart's tax lines in your custom flows.
|
|
41
41
|
*
|
|
@@ -61,7 +61,7 @@ const cartFields = [
|
|
|
61
61
|
exports.upsertTaxLinesWorkflowId = "upsert-tax-lines";
|
|
62
62
|
/**
|
|
63
63
|
* This workflow upserts a cart's tax lines that are applied on line items and shipping methods. You can upsert the line item's quantity, unit price, and more. This workflow is executed
|
|
64
|
-
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store
|
|
64
|
+
* by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store/carts/calculate-taxes).
|
|
65
65
|
*
|
|
66
66
|
* You can use this workflow within your own customizations or custom workflows, allowing you to upsert a cart's tax lines in your custom flows.
|
|
67
67
|
*
|
|
@@ -11,8 +11,8 @@ export type CreateCustomerAddressesWorkflowInput = {
|
|
|
11
11
|
} & AdditionalData;
|
|
12
12
|
export declare const createCustomerAddressesWorkflowId = "create-customer-addresses";
|
|
13
13
|
/**
|
|
14
|
-
* This workflow creates one or more addresses for customers. It's used by the [Add Customer Address Admin API Route](https://docs.medusajs.com/api/admin
|
|
15
|
-
* and the [Add Customer Address Store API Route](https://docs.medusajs.com/api/store
|
|
14
|
+
* This workflow creates one or more addresses for customers. It's used by the [Add Customer Address Admin API Route](https://docs.medusajs.com/api/admin/customers/add-address)
|
|
15
|
+
* and the [Add Customer Address Store API Route](https://docs.medusajs.com/api/store/customers/create-address).
|
|
16
16
|
*
|
|
17
17
|
* This workflow has a hook that allows you to perform custom actions on the created customer addresses. For example, you can pass under `additional_data` custom data that
|
|
18
18
|
* allows you to create custom data models linked to the addresses.
|