@daffodil/cart 0.66.1 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/in-memory/injection-tokens/extra-attributes-hook.token.d.ts +1 -1
- package/driver/magento/injection-tokens/transforms/cart/token.d.ts +1 -2
- package/driver/magento/injection-tokens/transforms/cart-item/token.d.ts +1 -2
- package/driver/magento/interfaces/cart-item-transform.type.d.ts +1 -1
- package/driver/magento/interfaces/cart-transform.type.d.ts +1 -1
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart/cart.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-address/cart-address.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-coupon/cart-coupon.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-items/cart-items.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-order/cart-order.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-payment/cart-payment.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.mjs +4 -4
- package/esm2022/driver/in-memory/backend/cart-root.service.mjs +129 -0
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart/cart.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-address/cart-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-coupon/cart-coupon.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-item/cart-item.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-order/cart-order.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-payment/cart-payment.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/cart-address.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-billing-address.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-coupon.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/cart-item.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-order.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-payment-methods.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-payment.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-shipping-address.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-shipping-information.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart-shipping-methods.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/cart.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-address-input.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-address.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-coupon.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-item/cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-payment-method.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart-shipping-method.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/cart.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/testing/factories/shipping-address.factory.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/transforms/inputs/billing-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/transforms/inputs/cart-address.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/inputs/cart-item-update.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/inputs/payment-method.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/inputs/shipping-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/transforms/inputs/shipping-method.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/billing-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-address.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-coupon-response.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-payment.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-shipping-information.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-shipping-rate.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/magento/transforms/outputs/shipping-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/services/resolve.service.mjs +6 -6
- package/{esm2020 → esm2022}/driver/testing/drivers/cart/cart.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-address/cart-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-billing-address/cart-billing-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-coupon/cart-coupon.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-driver.module.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-item/cart-item.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-order/cart-order.service.mjs +4 -4
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-payment/cart-payment.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.mjs +5 -5
- package/{esm2020 → esm2022}/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +5 -5
- package/{esm2020 → esm2022}/routing/cart-routing.module.mjs +15 -15
- package/esm2022/routing/guards/billing-address/billing-address.guard.mjs +40 -0
- package/esm2022/routing/guards/cart-items/cart-items.guard.mjs +41 -0
- package/{esm2020 → esm2022}/routing/guards/in-stock-items/in-stock-items.guard.mjs +6 -6
- package/{esm2020 → esm2022}/routing/guards/order-result/order-result.guard.mjs +7 -7
- package/esm2022/routing/guards/payment-method/payment-method.guard.mjs +40 -0
- package/{esm2020 → esm2022}/routing/guards/resolve-cart/resolve-cart.guard.mjs +6 -6
- package/{esm2020 → esm2022}/routing/guards/resolved-cart/resolved-cart.guard.mjs +6 -6
- package/{esm2020 → esm2022}/routing/guards/shipping-address/shipping-address.guard.mjs +7 -7
- package/esm2022/routing/guards/shipping-method/shipping-method.guard.mjs +40 -0
- package/{esm2020 → esm2022}/routing/resolvers/cart-resolver.service.mjs +7 -7
- package/esm2022/routing/resolvers/empty-cart-resolver.service.mjs +41 -0
- package/esm2022/state/cart-state.module.mjs +84 -0
- package/{esm2020 → esm2022}/state/effects/cart-address.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-billing-address.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-coupon.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-item.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-order.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-payment-methods.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-payment-processor.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-payment.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-resolver.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-shipping-address.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-shipping-information.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart-shipping-methods.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/effects/cart.effects.mjs +6 -6
- package/{esm2020 → esm2022}/state/facades/cart/cart.facade.mjs +6 -6
- package/esm2022/state/reducers/cart-item-entities/set-state.meta-reducer.mjs +56 -0
- package/{esm2020 → esm2022}/state/testing/cart-testing.module.mjs +7 -7
- package/{esm2020 → esm2022}/state/testing/factories/stateful-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/state/testing/factories/stateful-composite-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/state/testing/factories/stateful-configurable-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/state/testing/mock-cart-facade.mjs +4 -4
- package/{esm2020 → esm2022}/storage/cart-storage.service.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-address.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-coupon.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-item/cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-item/composite-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-item/configurable-cart-item.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-payment.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-shipping-information.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-shipping-rate.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart-total.factory.mjs +5 -5
- package/{esm2020 → esm2022}/testing/factories/cart.factory.mjs +5 -5
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-in-memory.mjs +119 -119
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-magento-testing.mjs +40 -40
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-magento-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-magento.mjs +110 -110
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-magento.mjs.map +1 -1
- package/{fesm2015 → fesm2022}/daffodil-cart-driver-testing.mjs +47 -47
- package/{fesm2020 → fesm2022}/daffodil-cart-driver-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-cart-driver.mjs +5 -5
- package/{fesm2020 → fesm2022}/daffodil-cart-driver.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-cart-routing.mjs +69 -69
- package/fesm2022/daffodil-cart-routing.mjs.map +1 -0
- package/{fesm2015 → fesm2022}/daffodil-cart-state-testing.mjs +21 -21
- package/{fesm2020 → fesm2022}/daffodil-cart-state-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-cart-state.mjs +118 -108
- package/{fesm2020 → fesm2022}/daffodil-cart-state.mjs.map +1 -1
- package/{fesm2015 → fesm2022}/daffodil-cart-testing.mjs +77 -77
- package/{fesm2020 → fesm2022}/daffodil-cart-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-cart.mjs +4 -4
- package/{fesm2020 → fesm2022}/daffodil-cart.mjs.map +1 -1
- package/package.json +1 -1
- package/routing/guards/billing-address/billing-address.guard.d.ts +2 -2
- package/routing/guards/cart-items/cart-items.guard.d.ts +2 -2
- package/routing/guards/in-stock-items/in-stock-items.guard.d.ts +2 -2
- package/routing/guards/order-result/order-result.guard.d.ts +2 -2
- package/routing/guards/payment-method/payment-method.guard.d.ts +2 -2
- package/routing/guards/resolve-cart/resolve-cart.guard.d.ts +2 -2
- package/routing/guards/resolved-cart/resolved-cart.guard.d.ts +2 -2
- package/routing/guards/shipping-address/shipping-address.guard.d.ts +2 -2
- package/routing/guards/shipping-method/shipping-method.guard.d.ts +2 -2
- package/routing/resolvers/cart-resolver.service.d.ts +2 -2
- package/routing/resolvers/empty-cart-resolver.service.d.ts +2 -2
- package/state/actions/cart-address.actions.d.ts +1 -1
- package/state/actions/cart-billing-address.actions.d.ts +1 -1
- package/state/actions/cart-coupon.actions.d.ts +1 -1
- package/state/actions/cart-item.actions.d.ts +1 -1
- package/state/actions/cart-order.actions.d.ts +1 -1
- package/state/actions/cart-payment-methods.actions.d.ts +1 -1
- package/state/actions/cart-payment.actions.d.ts +1 -1
- package/state/actions/cart-shipping-address.actions.d.ts +1 -1
- package/state/actions/cart-shipping-information.actions.d.ts +1 -1
- package/state/actions/cart-shipping-methods.actions.d.ts +1 -1
- package/state/actions/cart.actions.d.ts +1 -1
- package/state/cart-retrieval/type.d.ts +1 -1
- package/state/reducers/action-types.type.d.ts +1 -1
- package/state/reducers/cart-item-entities/set-state.meta-reducer.d.ts +1 -1
- package/state/reducers/errors/cart-errors.type.d.ts +1 -1
- package/state/reducers/loading/cart-loading.type.d.ts +1 -1
- package/state/reducers/token/meta.token.d.ts +1 -1
- package/esm2020/driver/in-memory/backend/cart-root.service.mjs +0 -129
- package/esm2020/routing/guards/billing-address/billing-address.guard.mjs +0 -40
- package/esm2020/routing/guards/cart-items/cart-items.guard.mjs +0 -41
- package/esm2020/routing/guards/payment-method/payment-method.guard.mjs +0 -40
- package/esm2020/routing/guards/shipping-method/shipping-method.guard.mjs +0 -40
- package/esm2020/routing/resolvers/empty-cart-resolver.service.mjs +0 -41
- package/esm2020/state/cart-state.module.mjs +0 -84
- package/esm2020/state/reducers/cart-item-entities/set-state.meta-reducer.mjs +0 -46
- package/fesm2015/daffodil-cart-driver-in-memory.mjs +0 -1190
- package/fesm2015/daffodil-cart-driver-in-memory.mjs.map +0 -1
- package/fesm2015/daffodil-cart-driver-magento-testing.mjs +0 -332
- package/fesm2015/daffodil-cart-driver-magento-testing.mjs.map +0 -1
- package/fesm2015/daffodil-cart-driver-magento.mjs +0 -2306
- package/fesm2015/daffodil-cart-driver-magento.mjs.map +0 -1
- package/fesm2015/daffodil-cart-driver-testing.mjs.map +0 -1
- package/fesm2015/daffodil-cart-driver.mjs +0 -266
- package/fesm2015/daffodil-cart-driver.mjs.map +0 -1
- package/fesm2015/daffodil-cart-routing.mjs +0 -526
- package/fesm2015/daffodil-cart-routing.mjs.map +0 -1
- package/fesm2015/daffodil-cart-state-testing.mjs.map +0 -1
- package/fesm2015/daffodil-cart-state.mjs +0 -2777
- package/fesm2015/daffodil-cart-state.mjs.map +0 -1
- package/fesm2015/daffodil-cart-testing.mjs.map +0 -1
- package/fesm2015/daffodil-cart.mjs +0 -167
- package/fesm2015/daffodil-cart.mjs.map +0 -1
- package/fesm2020/daffodil-cart-driver-testing.mjs +0 -369
- package/fesm2020/daffodil-cart-routing.mjs.map +0 -1
- package/fesm2020/daffodil-cart-state-testing.mjs +0 -218
- package/fesm2020/daffodil-cart-testing.mjs +0 -365
- /package/{esm2020 → esm2022}/daffodil-cart.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/daffodil-cart-driver.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/cart-not-found.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/codes.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/expired-payment-token.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-api-response.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-country.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-coupon-code.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-email.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/invalid-region.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/item-exceeds-max-qty.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/map.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/product-not-found.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/product-out-of-stock.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/errors/unauthorized-for-cart.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/backend/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/daffodil-cart-driver-in-memory.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/drivers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/helpers/compute-cart-item-prices.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/helpers/compute-cart-totals.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/injection-tokens/extra-attributes-hook.token.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/in-memory/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/injection-tokens/free-payment-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-address-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-billing-address-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-coupon-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-item-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-order-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-payment-methods-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-payment-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-shipping-address-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-shipping-information-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/cart-shipping-methods-service.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/interfaces/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/daffodil-cart-driver-magento.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/errors/codes.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/errors/map.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/errors/transform.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/injection-tokens/cart-mutation-queue.token.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/injection-tokens/fragments/cart.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/injection-tokens/transforms/cart/token.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/injection-tokens/transforms/cart-item/token.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/interfaces/cart-item-transform.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/interfaces/cart-transform.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/interfaces/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/billing-address.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/cart-address-base.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/cart-address.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/cart-item-update.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/payment-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/shipping-address.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/requests/shipping-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/cart-address.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/cart-coupon.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/cart-payment-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/cart-shipping-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/cart.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/shipping-address.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/user-error.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/models/responses/user-error.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/add-item/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/add-item/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/add-item/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/add-item/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/apply-coupon/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/apply-coupon/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/apply-coupon/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/apply-coupon/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/create-cart/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/create-cart/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/create-cart/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/create-cart/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/available-payment-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/available-shipping-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/cart-address.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/cart-coupon.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/cart.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/prices.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/selected-payment-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/selected-shipping-method.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/fragments/user-error.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-billing-address/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-billing-address/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-billing-address/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-billing-address/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-cart/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-cart/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-cart/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-cart/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-payment-method/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-payment-method/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-payment-method/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-payment-method/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-shipping-method/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-shipping-method/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-shipping-method/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-selected-shipping-method/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-shipping-address/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-shipping-address/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-shipping-address/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/get-shipping-address/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-coupons/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-coupons/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-coupons/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-coupons/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-items/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-items/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-items/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-items/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-payment-methods/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-payment-methods/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-payment-methods/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-payment-methods/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-shipping-methods/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-shipping-methods/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-shipping-methods/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/list-shipping-methods/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/merge-carts/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/merge-carts/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/merge-carts/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/merge-carts/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/place-order/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/place-order/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/place-order/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/place-order/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-all-coupons/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-all-coupons/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-all-coupons/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-all-coupons/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-item/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-item/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-item/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/remove-item/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing-and-email/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing-and-email/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing-and-email/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-payment-method-with-billing-and-email/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-shipping-method/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-shipping-method/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-shipping-method/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/set-selected-shipping-method/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address-with-email/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address-with-email/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address-with-email/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-address-with-email/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address-with-email/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address-with-email/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address-with-email/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-billing-address-with-email/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-item/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-item/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-item/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-item/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address-with-email/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address-with-email/query.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address-with-email/response.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/queries/update-shipping-address-with-email/variables.type.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/daffodil-cart-driver-magento-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/factories/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/inputs/cart-item-input-transformers.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-coupon.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-item/cart-item-transformer.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/outputs/cart-totals-transformer.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/magento/transforms/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/operators/handle-cart-not-found.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/operators/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/services/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/daffodil-cart-driver-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/drivers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/driver/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/codes.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/map.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/resolution/cart-not-found-or-created-resolution.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/resolution/cart-resolution.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/resolution/cart-server-side-resolution.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/resolution/cart-storage-resolution.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/resolution/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/injection-tokens/payment-method-map.mjs +0 -0
- /package/{esm2020 → esm2022}/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-address.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-coupon.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-item-input.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-order-result.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-payment.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-shipping-info.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-shipping-rate.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart-total.mjs +0 -0
- /package/{esm2020 → esm2022}/models/cart.mjs +0 -0
- /package/{esm2020 → esm2022}/models/composite-cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/models/configurable-cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/config/config.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/config/resolution/config.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/daffodil-cart-routing.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/billing-address/billing-address-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/cart-items/cart-items-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/order-result/order-result-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/payment-method/payment-method-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/resolve-cart/redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/shipping-address/shipping-address-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/guards/shipping-method/shipping-method-guard-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/resolvers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/resolvers/tokens/cart-resolver-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/routing/resolvers/tokens/empty-cart-resolver-redirect.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-address.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-billing-address.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-coupon.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-item.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-order.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-payment-methods.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-payment.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-retrieval.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-shipping-address.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-shipping-information.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart-shipping-methods.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/cart.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/state/actions/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/cart-retrieval/get-response.mjs +0 -0
- /package/{esm2020 → esm2022}/state/cart-retrieval/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/cart-retrieval/token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/cart-retrieval/type.mjs +0 -0
- /package/{esm2020 → esm2022}/state/daffodil-cart-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/facades/cart/cart-facade.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/index.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/cart-item-state-debounce-time.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/error-matcher.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/injection-tokens/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/models/stateful-cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/state/models/stateful-cart.mjs +0 -0
- /package/{esm2020 → esm2022}/state/models/stateful-composite-cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/state/models/stateful-configurable-cart-item.mjs +0 -0
- /package/{esm2020 → esm2022}/state/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/action-types.type.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart/cart.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart/retrieval-actions.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-billing-address/cart-billing-address.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-coupon/cart-coupon.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-initial-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-item/cart-item.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-item-entities/cart-item-entities.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-item-entities/retrieval-actions.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-operation-type.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-order/cart-order-initial-state.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-order/cart-order-state.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-order/cart-order.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-payment/cart-payment.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-payment/payment.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-payment-methods/cart-payment-methods.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-reducers-state.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-reducers.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-resolve/cart-resolve-state.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-resolve/cart-resolve.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-shipping-address/cart-shipping-address.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-shipping-information/cart-shipping-information.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-state.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart-store-feature-key.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/cart.reducer.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/errors/cart-errors.type.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/errors/error-state-helpers.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/loading/cart-loading.type.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/config.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/extra.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/meta.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/reducers/token/reducers.token.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/cart/cart.selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/cart-feature.selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/cart-item-entities/cart-item-entities.selectors.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/cart-order/cart-order.selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/cart.selector.mjs +0 -0
- /package/{esm2020 → esm2022}/state/selectors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/daffodil-cart-state-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/state/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/daffodil-cart-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/factories/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public_api.mjs +0 -0
|
@@ -1,1190 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule, InjectionToken, Inject } from '@angular/core';
|
|
3
|
-
import { throwError } from 'rxjs';
|
|
4
|
-
import { catchError, map } from 'rxjs/operators';
|
|
5
|
-
import { DaffCartNotFoundError, DaffCartDriver, DaffCartAddressDriver, DaffCartBillingAddressDriver, DaffCartItemDriver, DaffCartPaymentDriver, DaffCartPaymentMethodsDriver, DaffCartShippingAddressDriver, DaffCartShippingInformationDriver, DaffCartShippingMethodsDriver, DaffCartOrderDriver, DaffCartCouponDriver } from '@daffodil/cart/driver';
|
|
6
|
-
import * as i1 from '@angular/common/http';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import { STATUS } from 'angular-in-memory-web-api';
|
|
9
|
-
import { faker } from '@faker-js/faker/locale/en_US';
|
|
10
|
-
import { DaffCartTotalTypeEnum } from '@daffodil/cart';
|
|
11
|
-
import * as i1$1 from '@daffodil/cart/testing';
|
|
12
|
-
import * as i2 from '@daffodil/product/driver/in-memory';
|
|
13
|
-
import { daffMultiply } from '@daffodil/core';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @inheritdoc
|
|
17
|
-
*/
|
|
18
|
-
class DaffInMemoryCartService {
|
|
19
|
-
constructor(http) {
|
|
20
|
-
this.http = http;
|
|
21
|
-
/**
|
|
22
|
-
* The URL with which the driver makes calls to the backend.
|
|
23
|
-
*/
|
|
24
|
-
this.url = '/api/cart';
|
|
25
|
-
}
|
|
26
|
-
get(cartId) {
|
|
27
|
-
return this.http.get(`${this.url}/${cartId}`).pipe(catchError((error) => throwError(() => new DaffCartNotFoundError(error.message))), map(result => ({
|
|
28
|
-
response: result,
|
|
29
|
-
errors: [],
|
|
30
|
-
})));
|
|
31
|
-
}
|
|
32
|
-
addToCart(productId, qty) {
|
|
33
|
-
return this.http.post(this.url + '/addToCart', { productId, qty });
|
|
34
|
-
}
|
|
35
|
-
clear(cartId) {
|
|
36
|
-
return this.http.post(`${this.url}/${cartId}/clear`, {});
|
|
37
|
-
}
|
|
38
|
-
create() {
|
|
39
|
-
return this.http.post(this.url, {});
|
|
40
|
-
}
|
|
41
|
-
merge(guestCart, customerCart) {
|
|
42
|
-
return this.http.post(`${this.url}/${guestCart}/merge`, {
|
|
43
|
-
source: guestCart,
|
|
44
|
-
destination: customerCart,
|
|
45
|
-
}).pipe(catchError((error) => throwError(() => new DaffCartNotFoundError(error.message))), map(result => ({
|
|
46
|
-
response: result,
|
|
47
|
-
errors: [],
|
|
48
|
-
})));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/** @nocollapse */ DaffInMemoryCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
-
/** @nocollapse */ DaffInMemoryCartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartService, providedIn: 'root' });
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartService, decorators: [{
|
|
54
|
-
type: Injectable,
|
|
55
|
-
args: [{
|
|
56
|
-
providedIn: 'root',
|
|
57
|
-
}]
|
|
58
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @inheritdoc
|
|
62
|
-
*/
|
|
63
|
-
class DaffInMemoryCartItemService {
|
|
64
|
-
constructor(http) {
|
|
65
|
-
this.http = http;
|
|
66
|
-
/**
|
|
67
|
-
* The URL with which the driver makes calls to the backend.
|
|
68
|
-
*/
|
|
69
|
-
this.url = '/api/cart-items';
|
|
70
|
-
}
|
|
71
|
-
list(cartId) {
|
|
72
|
-
return this.http.get(`${this.url}/${cartId}/`);
|
|
73
|
-
}
|
|
74
|
-
get(cartId, itemId) {
|
|
75
|
-
return this.http.get(`${this.url}/${cartId}/${itemId}`);
|
|
76
|
-
}
|
|
77
|
-
add(cartId, input) {
|
|
78
|
-
return this.http.post(`${this.url}/${cartId}/`, input);
|
|
79
|
-
}
|
|
80
|
-
update(cartId, itemId, item) {
|
|
81
|
-
return this.http.put(`${this.url}/${cartId}/${itemId}`, item);
|
|
82
|
-
}
|
|
83
|
-
delete(cartId, itemId) {
|
|
84
|
-
return this.http.delete(`${this.url}/${cartId}/${itemId}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/** @nocollapse */ DaffInMemoryCartItemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartItemService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
-
/** @nocollapse */ DaffInMemoryCartItemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartItemService, providedIn: 'root' });
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartItemService, decorators: [{
|
|
90
|
-
type: Injectable,
|
|
91
|
-
args: [{
|
|
92
|
-
providedIn: 'root',
|
|
93
|
-
}]
|
|
94
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @inheritdoc
|
|
98
|
-
*/
|
|
99
|
-
class DaffInMemoryCartBillingAddressService {
|
|
100
|
-
constructor(http) {
|
|
101
|
-
this.http = http;
|
|
102
|
-
/**
|
|
103
|
-
* The URL with which the driver makes calls to the backend.
|
|
104
|
-
*/
|
|
105
|
-
this.url = '/api/cart-billing-address';
|
|
106
|
-
}
|
|
107
|
-
get(cartId) {
|
|
108
|
-
return this.http.get(`${this.url}/${cartId}`);
|
|
109
|
-
}
|
|
110
|
-
update(cartId, address) {
|
|
111
|
-
return this.http.put(`${this.url}/${cartId}`, address);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/** @nocollapse */ DaffInMemoryCartBillingAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartBillingAddressService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
115
|
-
/** @nocollapse */ DaffInMemoryCartBillingAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartBillingAddressService, providedIn: 'root' });
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartBillingAddressService, decorators: [{
|
|
117
|
-
type: Injectable,
|
|
118
|
-
args: [{
|
|
119
|
-
providedIn: 'root',
|
|
120
|
-
}]
|
|
121
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @inheritdoc
|
|
125
|
-
*/
|
|
126
|
-
class DaffInMemoryCartPaymentService {
|
|
127
|
-
constructor(http) {
|
|
128
|
-
this.http = http;
|
|
129
|
-
/**
|
|
130
|
-
* The URL with which the driver makes calls to the backend.
|
|
131
|
-
*/
|
|
132
|
-
this.url = '/api/cart-payment';
|
|
133
|
-
}
|
|
134
|
-
get(cartId) {
|
|
135
|
-
return this.http.get(`${this.url}/${cartId}`);
|
|
136
|
-
}
|
|
137
|
-
update(cartId, payment) {
|
|
138
|
-
return this.http.put(`${this.url}/${cartId}`, { payment });
|
|
139
|
-
}
|
|
140
|
-
updateWithBilling(cartId, payment, address) {
|
|
141
|
-
return this.http.put(`${this.url}/${cartId}`, { payment, address });
|
|
142
|
-
}
|
|
143
|
-
remove(cartId) {
|
|
144
|
-
return this.http.delete(`${this.url}/${cartId}`);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/** @nocollapse */ DaffInMemoryCartPaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartPaymentService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
148
|
-
/** @nocollapse */ DaffInMemoryCartPaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartPaymentService, providedIn: 'root' });
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartPaymentService, decorators: [{
|
|
150
|
-
type: Injectable,
|
|
151
|
-
args: [{
|
|
152
|
-
providedIn: 'root',
|
|
153
|
-
}]
|
|
154
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @inheritdoc
|
|
158
|
-
*/
|
|
159
|
-
class DaffInMemoryCartPaymentMethodsService {
|
|
160
|
-
constructor(http) {
|
|
161
|
-
this.http = http;
|
|
162
|
-
/**
|
|
163
|
-
* The URL with which the driver makes calls to the backend.
|
|
164
|
-
*/
|
|
165
|
-
this.url = '/api/cart-payment-methods';
|
|
166
|
-
}
|
|
167
|
-
list(cartId) {
|
|
168
|
-
return this.http.get(`${this.url}/${cartId}`);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/** @nocollapse */ DaffInMemoryCartPaymentMethodsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartPaymentMethodsService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
172
|
-
/** @nocollapse */ DaffInMemoryCartPaymentMethodsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartPaymentMethodsService, providedIn: 'root' });
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartPaymentMethodsService, decorators: [{
|
|
174
|
-
type: Injectable,
|
|
175
|
-
args: [{
|
|
176
|
-
providedIn: 'root',
|
|
177
|
-
}]
|
|
178
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @inheritdoc
|
|
182
|
-
*/
|
|
183
|
-
class DaffInMemoryCartShippingAddressService {
|
|
184
|
-
constructor(http) {
|
|
185
|
-
this.http = http;
|
|
186
|
-
/**
|
|
187
|
-
* The URL with which the driver makes calls to the backend.
|
|
188
|
-
*/
|
|
189
|
-
this.url = '/api/cart-shipping-address';
|
|
190
|
-
}
|
|
191
|
-
get(cartId) {
|
|
192
|
-
return this.http.get(`${this.url}/${cartId}`);
|
|
193
|
-
}
|
|
194
|
-
update(cartId, address) {
|
|
195
|
-
return this.http.put(`${this.url}/${cartId}`, address);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
/** @nocollapse */ DaffInMemoryCartShippingAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingAddressService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
199
|
-
/** @nocollapse */ DaffInMemoryCartShippingAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingAddressService, providedIn: 'root' });
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingAddressService, decorators: [{
|
|
201
|
-
type: Injectable,
|
|
202
|
-
args: [{
|
|
203
|
-
providedIn: 'root',
|
|
204
|
-
}]
|
|
205
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* @inheritdoc
|
|
209
|
-
*/
|
|
210
|
-
class DaffInMemoryCartShippingInformationService {
|
|
211
|
-
constructor(http) {
|
|
212
|
-
this.http = http;
|
|
213
|
-
/**
|
|
214
|
-
* The URL with which the driver makes calls to the backend.
|
|
215
|
-
*/
|
|
216
|
-
this.url = '/api/cart-shipping-information';
|
|
217
|
-
}
|
|
218
|
-
get(cartId) {
|
|
219
|
-
return this.http.get(`${this.url}/${cartId}`);
|
|
220
|
-
}
|
|
221
|
-
update(cartId, info) {
|
|
222
|
-
return this.http.put(`${this.url}/${cartId}`, info);
|
|
223
|
-
}
|
|
224
|
-
delete(cartId) {
|
|
225
|
-
return this.http.delete(`${this.url}/${cartId}`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
/** @nocollapse */ DaffInMemoryCartShippingInformationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingInformationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
229
|
-
/** @nocollapse */ DaffInMemoryCartShippingInformationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingInformationService, providedIn: 'root' });
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingInformationService, decorators: [{
|
|
231
|
-
type: Injectable,
|
|
232
|
-
args: [{
|
|
233
|
-
providedIn: 'root',
|
|
234
|
-
}]
|
|
235
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* @inheritdoc
|
|
239
|
-
*/
|
|
240
|
-
class DaffInMemoryCartShippingMethodsService {
|
|
241
|
-
constructor(http) {
|
|
242
|
-
this.http = http;
|
|
243
|
-
/**
|
|
244
|
-
* The URL with which the driver makes calls to the backend.
|
|
245
|
-
*/
|
|
246
|
-
this.url = '/api/cart-shipping-methods';
|
|
247
|
-
}
|
|
248
|
-
list(cartId) {
|
|
249
|
-
return this.http.get(`${this.url}/${cartId}`);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/** @nocollapse */ DaffInMemoryCartShippingMethodsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingMethodsService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
253
|
-
/** @nocollapse */ DaffInMemoryCartShippingMethodsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingMethodsService, providedIn: 'root' });
|
|
254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartShippingMethodsService, decorators: [{
|
|
255
|
-
type: Injectable,
|
|
256
|
-
args: [{
|
|
257
|
-
providedIn: 'root',
|
|
258
|
-
}]
|
|
259
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @inheritdoc
|
|
263
|
-
*/
|
|
264
|
-
class DaffInMemoryCartOrderService {
|
|
265
|
-
constructor(http) {
|
|
266
|
-
this.http = http;
|
|
267
|
-
/**
|
|
268
|
-
* The URL with which the driver makes calls to the backend.
|
|
269
|
-
*/
|
|
270
|
-
this.url = '/api/cart-order';
|
|
271
|
-
}
|
|
272
|
-
placeOrder(cartId, payment) {
|
|
273
|
-
return this.http.post(`${this.url}/${cartId}/`, { payment });
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
/** @nocollapse */ DaffInMemoryCartOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartOrderService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
277
|
-
/** @nocollapse */ DaffInMemoryCartOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartOrderService, providedIn: 'root' });
|
|
278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartOrderService, decorators: [{
|
|
279
|
-
type: Injectable,
|
|
280
|
-
args: [{
|
|
281
|
-
providedIn: 'root',
|
|
282
|
-
}]
|
|
283
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* @inheritdoc
|
|
287
|
-
*/
|
|
288
|
-
class DaffInMemoryCartCouponService {
|
|
289
|
-
constructor(http) {
|
|
290
|
-
this.http = http;
|
|
291
|
-
/**
|
|
292
|
-
* The URL with which the driver makes calls to the backend.
|
|
293
|
-
*/
|
|
294
|
-
this.url = '/api/cart-coupon';
|
|
295
|
-
}
|
|
296
|
-
list(cartId) {
|
|
297
|
-
return this.http.get(`${this.url}/${cartId}/`);
|
|
298
|
-
}
|
|
299
|
-
apply(cartId, coupon) {
|
|
300
|
-
return this.http.post(`${this.url}/${cartId}/`, coupon);
|
|
301
|
-
}
|
|
302
|
-
remove(cartId, coupon) {
|
|
303
|
-
return this.http.delete(`${this.url}/${cartId}/${coupon.code}`);
|
|
304
|
-
}
|
|
305
|
-
removeAll(cartId) {
|
|
306
|
-
return this.http.delete(`${this.url}/${cartId}/`);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
/** @nocollapse */ DaffInMemoryCartCouponService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartCouponService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
310
|
-
/** @nocollapse */ DaffInMemoryCartCouponService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartCouponService, providedIn: 'root' });
|
|
311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartCouponService, decorators: [{
|
|
312
|
-
type: Injectable,
|
|
313
|
-
args: [{
|
|
314
|
-
providedIn: 'root',
|
|
315
|
-
}]
|
|
316
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* @inheritdoc
|
|
320
|
-
*/
|
|
321
|
-
class DaffInMemoryCartAddressService {
|
|
322
|
-
constructor(http) {
|
|
323
|
-
this.http = http;
|
|
324
|
-
/**
|
|
325
|
-
* The URL with which the driver makes calls to the backend.
|
|
326
|
-
*/
|
|
327
|
-
this.url = '/api/cart-address';
|
|
328
|
-
}
|
|
329
|
-
update(cartId, address) {
|
|
330
|
-
return this.http.put(`${this.url}/${cartId}`, address);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
/** @nocollapse */ DaffInMemoryCartAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartAddressService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
334
|
-
/** @nocollapse */ DaffInMemoryCartAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartAddressService, providedIn: 'root' });
|
|
335
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryCartAddressService, decorators: [{
|
|
336
|
-
type: Injectable,
|
|
337
|
-
args: [{
|
|
338
|
-
providedIn: 'root',
|
|
339
|
-
}]
|
|
340
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
341
|
-
|
|
342
|
-
class DaffCartInMemoryDriverModule {
|
|
343
|
-
static forRoot() {
|
|
344
|
-
return {
|
|
345
|
-
ngModule: DaffCartInMemoryDriverModule,
|
|
346
|
-
providers: [
|
|
347
|
-
{
|
|
348
|
-
provide: DaffCartDriver,
|
|
349
|
-
useExisting: DaffInMemoryCartService,
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
provide: DaffCartAddressDriver,
|
|
353
|
-
useExisting: DaffInMemoryCartAddressService,
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
provide: DaffCartBillingAddressDriver,
|
|
357
|
-
useExisting: DaffInMemoryCartBillingAddressService,
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
provide: DaffCartItemDriver,
|
|
361
|
-
useExisting: DaffInMemoryCartItemService,
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
provide: DaffCartPaymentDriver,
|
|
365
|
-
useExisting: DaffInMemoryCartPaymentService,
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
provide: DaffCartPaymentMethodsDriver,
|
|
369
|
-
useExisting: DaffInMemoryCartPaymentMethodsService,
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
provide: DaffCartShippingAddressDriver,
|
|
373
|
-
useExisting: DaffInMemoryCartShippingAddressService,
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
provide: DaffCartShippingInformationDriver,
|
|
377
|
-
useExisting: DaffInMemoryCartShippingInformationService,
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
provide: DaffCartShippingMethodsDriver,
|
|
381
|
-
useExisting: DaffInMemoryCartShippingMethodsService,
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
provide: DaffCartOrderDriver,
|
|
385
|
-
useExisting: DaffInMemoryCartOrderService,
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
provide: DaffCartCouponDriver,
|
|
389
|
-
useExisting: DaffInMemoryCartCouponService,
|
|
390
|
-
},
|
|
391
|
-
],
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
/** @nocollapse */ DaffCartInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
396
|
-
/** @nocollapse */ DaffCartInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffCartInMemoryDriverModule, imports: [CommonModule] });
|
|
397
|
-
/** @nocollapse */ DaffCartInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartInMemoryDriverModule, imports: [CommonModule] });
|
|
398
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffCartInMemoryDriverModule, decorators: [{
|
|
399
|
-
type: NgModule,
|
|
400
|
-
args: [{
|
|
401
|
-
imports: [
|
|
402
|
-
CommonModule,
|
|
403
|
-
],
|
|
404
|
-
}]
|
|
405
|
-
}] });
|
|
406
|
-
|
|
407
|
-
function daffCartInMemoryComputeCartTotals(cart, products) {
|
|
408
|
-
var _a;
|
|
409
|
-
const shipping = cart.shipping_information ? faker.datatype.number({ min: 0, max: 99 }) : 0;
|
|
410
|
-
const subtotalExcludingTax = ((_a = cart.items) === null || _a === void 0 ? void 0 : _a.reduce((acc, { product_id }) => { var _a; return acc + (((_a = products.find(({ id }) => id === product_id)) === null || _a === void 0 ? void 0 : _a.price) || 0); }, 0)) || 0;
|
|
411
|
-
const discount = faker.datatype.number({ min: 0, max: subtotalExcludingTax });
|
|
412
|
-
const subtotalIncludingTax = subtotalExcludingTax + cart.totals[DaffCartTotalTypeEnum.tax].value;
|
|
413
|
-
const subtotalWithDiscountExcludingTax = subtotalExcludingTax - discount;
|
|
414
|
-
const subtotalWithDiscountIncludingTax = subtotalIncludingTax - discount;
|
|
415
|
-
const grandTotal = subtotalWithDiscountIncludingTax + shipping;
|
|
416
|
-
return Object.assign(Object.assign({}, cart), { totals: Object.assign(Object.assign({}, cart.totals), { [DaffCartTotalTypeEnum.shipping]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.shipping]), { value: shipping }), [DaffCartTotalTypeEnum.subtotalExcludingTax]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.subtotalExcludingTax]), { value: subtotalExcludingTax }), [DaffCartTotalTypeEnum.discount]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.discount]), { value: discount }), [DaffCartTotalTypeEnum.subtotalIncludingTax]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.subtotalIncludingTax]), { value: subtotalIncludingTax }), [DaffCartTotalTypeEnum.subtotalWithDiscountExcludingTax]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.subtotalWithDiscountExcludingTax]), { value: subtotalWithDiscountExcludingTax }), [DaffCartTotalTypeEnum.subtotalWithDiscountIncludingTax]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.subtotalWithDiscountIncludingTax]), { value: subtotalWithDiscountIncludingTax }), [DaffCartTotalTypeEnum.grandTotal]: Object.assign(Object.assign({}, cart.totals[DaffCartTotalTypeEnum.grandTotal]), { value: grandTotal }) }) });
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Allows an app dev to generate extra fields in the in-memory backend.
|
|
421
|
-
* This enables the in-memory drivers to return responses similar to what the
|
|
422
|
-
* frontend would expect from the production platform.
|
|
423
|
-
*
|
|
424
|
-
* The value returned by the hook function will be set to the returned cart's `extra_attributes` field
|
|
425
|
-
* for driver calls that return a cart.
|
|
426
|
-
*
|
|
427
|
-
* The following example demonstrates adding the `numberOfCartItems` field to `extra_attributes`:
|
|
428
|
-
* ```ts
|
|
429
|
-
* (reqInfo: RequestInfo, cart: DaffCart) => ({
|
|
430
|
-
* numberOfCartItems: cart.items.length
|
|
431
|
-
* })
|
|
432
|
-
* ```
|
|
433
|
-
*
|
|
434
|
-
* Note that this and any `extra_attributes` features are for advanced users
|
|
435
|
-
* and should be used with care.
|
|
436
|
-
*/
|
|
437
|
-
const DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK = new InjectionToken('DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK', {
|
|
438
|
-
factory: () => (reqInfo, cart) => ({}),
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* @inheritdoc
|
|
443
|
-
*/
|
|
444
|
-
class DaffInMemoryBackendCartService {
|
|
445
|
-
constructor(cartFactory, extraFieldsHook, productBackend) {
|
|
446
|
-
this.cartFactory = cartFactory;
|
|
447
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
448
|
-
this.productBackend = productBackend;
|
|
449
|
-
}
|
|
450
|
-
get(reqInfo) {
|
|
451
|
-
return reqInfo.utils.createResponse$(() => this.getCart(reqInfo));
|
|
452
|
-
}
|
|
453
|
-
post(reqInfo) {
|
|
454
|
-
return reqInfo.utils.createResponse$(() => {
|
|
455
|
-
let ret;
|
|
456
|
-
const action = this.getAction(reqInfo);
|
|
457
|
-
if (reqInfo.id === 'addToCart') {
|
|
458
|
-
// deprecated
|
|
459
|
-
ret = {
|
|
460
|
-
body: {},
|
|
461
|
-
status: STATUS.OK,
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
else if (action === 'clear') {
|
|
465
|
-
ret = this.clear(reqInfo);
|
|
466
|
-
}
|
|
467
|
-
else if (action === 'merge') {
|
|
468
|
-
ret = this.merge(reqInfo);
|
|
469
|
-
}
|
|
470
|
-
else {
|
|
471
|
-
ret = this.create(reqInfo);
|
|
472
|
-
}
|
|
473
|
-
return ret;
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Gets whatever follows the cart ID section of the request URL.
|
|
478
|
-
*/
|
|
479
|
-
getAction(reqInfo) {
|
|
480
|
-
return reqInfo.url.replace(`/${reqInfo.resourceUrl}${reqInfo.id}/`, '');
|
|
481
|
-
}
|
|
482
|
-
clear(reqInfo) {
|
|
483
|
-
const cart = this.getCart(reqInfo).body;
|
|
484
|
-
cart.items = [];
|
|
485
|
-
return {
|
|
486
|
-
body: Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) }),
|
|
487
|
-
status: STATUS.OK,
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
create(reqInfo) {
|
|
491
|
-
const cart = this.cartFactory.create();
|
|
492
|
-
reqInfo.collection.push(cart);
|
|
493
|
-
return {
|
|
494
|
-
body: {
|
|
495
|
-
id: cart.id,
|
|
496
|
-
},
|
|
497
|
-
status: STATUS.OK,
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
merge(reqInfo) {
|
|
501
|
-
const { source, destination, } = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
502
|
-
const sourceCart = reqInfo.utils.findById(reqInfo.collection, source);
|
|
503
|
-
if (!sourceCart) {
|
|
504
|
-
return {
|
|
505
|
-
status: STATUS.NOT_FOUND,
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
const destinationCart = reqInfo.utils.findById(reqInfo.collection, destination ? destination : this.create(reqInfo).body.id);
|
|
509
|
-
if (!destinationCart) {
|
|
510
|
-
return {
|
|
511
|
-
status: STATUS.NOT_FOUND,
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
destinationCart.items.push(...sourceCart.items);
|
|
515
|
-
reqInfo.collection.push(destinationCart);
|
|
516
|
-
return {
|
|
517
|
-
body: Object.assign(Object.assign({}, destinationCart), { extra_attributes: this.extraFieldsHook(reqInfo, destinationCart) }),
|
|
518
|
-
status: STATUS.OK,
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
getCart(reqInfo) {
|
|
522
|
-
const cart = reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
523
|
-
return cart
|
|
524
|
-
? {
|
|
525
|
-
body: Object.assign(Object.assign({}, daffCartInMemoryComputeCartTotals(cart, this.productBackend.products)), { extra_attributes: this.extraFieldsHook(reqInfo, cart) }),
|
|
526
|
-
status: STATUS.OK,
|
|
527
|
-
}
|
|
528
|
-
: {
|
|
529
|
-
status: STATUS.NOT_FOUND,
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
/** @nocollapse */ DaffInMemoryBackendCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartService, deps: [{ token: i1$1.DaffCartFactory }, { token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }, { token: i2.DaffInMemoryBackendProductService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
534
|
-
/** @nocollapse */ DaffInMemoryBackendCartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartService, providedIn: 'root' });
|
|
535
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartService, decorators: [{
|
|
536
|
-
type: Injectable,
|
|
537
|
-
args: [{
|
|
538
|
-
providedIn: 'root',
|
|
539
|
-
}]
|
|
540
|
-
}], ctorParameters: function () {
|
|
541
|
-
return [{ type: i1$1.DaffCartFactory }, { type: undefined, decorators: [{
|
|
542
|
-
type: Inject,
|
|
543
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
544
|
-
}] }, { type: i2.DaffInMemoryBackendProductService }];
|
|
545
|
-
} });
|
|
546
|
-
|
|
547
|
-
function daffCartInMemoryComputeCartItemPrices(cartItem, products) {
|
|
548
|
-
var _a;
|
|
549
|
-
cartItem.price = ((_a = products.find(({ id }) => id === cartItem.product_id)) === null || _a === void 0 ? void 0 : _a.price) || 0;
|
|
550
|
-
cartItem.row_total = daffMultiply(cartItem.price, cartItem.qty);
|
|
551
|
-
return cartItem;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* @inheritdoc
|
|
556
|
-
*/
|
|
557
|
-
class DaffInMemoryBackendCartItemsService {
|
|
558
|
-
constructor(cartItemFactory, extraFieldsHook, productBackend) {
|
|
559
|
-
this.cartItemFactory = cartItemFactory;
|
|
560
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
561
|
-
this.productBackend = productBackend;
|
|
562
|
-
}
|
|
563
|
-
get(reqInfo) {
|
|
564
|
-
return reqInfo.utils.createResponse$(() => {
|
|
565
|
-
let body;
|
|
566
|
-
const action = this.getAction(reqInfo);
|
|
567
|
-
if (action) {
|
|
568
|
-
body = this.getItem(reqInfo, action);
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
body = this.listItems(reqInfo);
|
|
572
|
-
}
|
|
573
|
-
return {
|
|
574
|
-
body,
|
|
575
|
-
status: STATUS.OK,
|
|
576
|
-
};
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
put(reqInfo) {
|
|
580
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
581
|
-
body: this.updateItem(reqInfo, this.getAction(reqInfo)),
|
|
582
|
-
status: STATUS.OK,
|
|
583
|
-
}));
|
|
584
|
-
}
|
|
585
|
-
post(reqInfo) {
|
|
586
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
587
|
-
body: this.addItem(reqInfo),
|
|
588
|
-
status: STATUS.OK,
|
|
589
|
-
}));
|
|
590
|
-
}
|
|
591
|
-
delete(reqInfo) {
|
|
592
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
593
|
-
body: this.deleteItem(reqInfo, this.getAction(reqInfo)),
|
|
594
|
-
status: STATUS.OK,
|
|
595
|
-
}));
|
|
596
|
-
}
|
|
597
|
-
/**
|
|
598
|
-
* Gets whatever follows the cart ID section of the request URL.
|
|
599
|
-
*/
|
|
600
|
-
getAction(reqInfo) {
|
|
601
|
-
return reqInfo.url.replace(`/${reqInfo.resourceUrl}${reqInfo.id}/`, '');
|
|
602
|
-
}
|
|
603
|
-
getCart(reqInfo) {
|
|
604
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
605
|
-
}
|
|
606
|
-
transformItemInput(itemInput) {
|
|
607
|
-
return Object.assign(Object.assign(Object.assign({}, this.cartItemFactory.create()), itemInput), { product_id: itemInput.productId });
|
|
608
|
-
}
|
|
609
|
-
listItems(reqInfo) {
|
|
610
|
-
return this.getCart(reqInfo).items;
|
|
611
|
-
}
|
|
612
|
-
getItem(reqInfo, itemId) {
|
|
613
|
-
const cart = this.getCart(reqInfo);
|
|
614
|
-
return cart.items.find(({ id }) => itemId === id);
|
|
615
|
-
}
|
|
616
|
-
updateItem(reqInfo, itemId) {
|
|
617
|
-
const cart = this.getCart(reqInfo);
|
|
618
|
-
const cartIndex = reqInfo.collection.findIndex(c => c.id === reqInfo.id);
|
|
619
|
-
const itemChanges = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
620
|
-
const itemIndex = cart.items.findIndex((item) => itemId === item.id);
|
|
621
|
-
reqInfo.collection[cartIndex] = daffCartInMemoryComputeCartTotals(Object.assign(Object.assign({}, cart), { items: cart.items.map((item, index) => index === itemIndex ? daffCartInMemoryComputeCartItemPrices(Object.assign(Object.assign({}, cart.items[itemIndex]), itemChanges), this.productBackend.products) : item), extra_attributes: this.extraFieldsHook(reqInfo, cart) }), this.productBackend.products);
|
|
622
|
-
return reqInfo.collection[cartIndex];
|
|
623
|
-
}
|
|
624
|
-
addItem(reqInfo) {
|
|
625
|
-
const cart = this.getCart(reqInfo);
|
|
626
|
-
const cartIndex = reqInfo.collection.findIndex(c => c.id === reqInfo.id);
|
|
627
|
-
const itemInput = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
628
|
-
const existingCartItemIndex = cart.items.findIndex(item => item.product_id === itemInput.productId);
|
|
629
|
-
if (existingCartItemIndex > -1) {
|
|
630
|
-
const updatedCartItem = Object.assign(Object.assign({}, cart.items[existingCartItemIndex]), { qty: cart.items[existingCartItemIndex].qty + itemInput.qty });
|
|
631
|
-
reqInfo.collection[cartIndex] = daffCartInMemoryComputeCartTotals(Object.assign(Object.assign({}, cart), { items: cart.items.map((item, index) => index === existingCartItemIndex ? daffCartInMemoryComputeCartItemPrices(updatedCartItem, this.productBackend.products) : item), extra_attributes: this.extraFieldsHook(reqInfo, cart) }), this.productBackend.products);
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
reqInfo.collection[cartIndex] = daffCartInMemoryComputeCartTotals(Object.assign(Object.assign({}, cart), { items: [
|
|
635
|
-
...cart.items,
|
|
636
|
-
daffCartInMemoryComputeCartItemPrices(this.transformItemInput(itemInput), this.productBackend.products),
|
|
637
|
-
], extra_attributes: this.extraFieldsHook(reqInfo, cart) }), this.productBackend.products);
|
|
638
|
-
}
|
|
639
|
-
return reqInfo.collection[cartIndex];
|
|
640
|
-
}
|
|
641
|
-
deleteItem(reqInfo, itemId) {
|
|
642
|
-
const cart = this.getCart(reqInfo);
|
|
643
|
-
const itemIndex = cart.items.findIndex(({ id }) => itemId === id);
|
|
644
|
-
const cartIndex = reqInfo.collection.findIndex(c => c.id === reqInfo.id);
|
|
645
|
-
reqInfo.collection[cartIndex] = daffCartInMemoryComputeCartTotals(Object.assign(Object.assign({}, cart), { items: cart.items.filter((item, index) => index !== itemIndex), extra_attributes: this.extraFieldsHook(reqInfo, cart) }), this.productBackend.products);
|
|
646
|
-
return reqInfo.collection[cartIndex];
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
/** @nocollapse */ DaffInMemoryBackendCartItemsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartItemsService, deps: [{ token: i1$1.DaffCartItemFactory }, { token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }, { token: i2.DaffInMemoryBackendProductService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
650
|
-
/** @nocollapse */ DaffInMemoryBackendCartItemsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartItemsService, providedIn: 'root' });
|
|
651
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartItemsService, decorators: [{
|
|
652
|
-
type: Injectable,
|
|
653
|
-
args: [{
|
|
654
|
-
providedIn: 'root',
|
|
655
|
-
}]
|
|
656
|
-
}], ctorParameters: function () {
|
|
657
|
-
return [{ type: i1$1.DaffCartItemFactory }, { type: undefined, decorators: [{
|
|
658
|
-
type: Inject,
|
|
659
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
660
|
-
}] }, { type: i2.DaffInMemoryBackendProductService }];
|
|
661
|
-
} });
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* @inheritdoc
|
|
665
|
-
*/
|
|
666
|
-
class DaffInMemoryBackendCartOrderService {
|
|
667
|
-
post(reqInfo) {
|
|
668
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
669
|
-
body: this.placeOrder(reqInfo),
|
|
670
|
-
status: STATUS.OK,
|
|
671
|
-
}));
|
|
672
|
-
}
|
|
673
|
-
placeOrder(reqInfo) {
|
|
674
|
-
return {
|
|
675
|
-
id: '8235422034',
|
|
676
|
-
cartId: '89fdsa8sadf',
|
|
677
|
-
orderId: '8235422034',
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
/** @nocollapse */ DaffInMemoryBackendCartOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartOrderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
682
|
-
/** @nocollapse */ DaffInMemoryBackendCartOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartOrderService, providedIn: 'root' });
|
|
683
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartOrderService, decorators: [{
|
|
684
|
-
type: Injectable,
|
|
685
|
-
args: [{
|
|
686
|
-
providedIn: 'root',
|
|
687
|
-
}]
|
|
688
|
-
}] });
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* @inheritdoc
|
|
692
|
-
*/
|
|
693
|
-
class DaffInMemoryBackendCartCouponService {
|
|
694
|
-
constructor(extraFieldsHook) {
|
|
695
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
696
|
-
}
|
|
697
|
-
get(reqInfo) {
|
|
698
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
699
|
-
body: this.listCoupons(reqInfo),
|
|
700
|
-
status: STATUS.OK,
|
|
701
|
-
}));
|
|
702
|
-
}
|
|
703
|
-
post(reqInfo) {
|
|
704
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
705
|
-
body: this.applyCoupon(reqInfo),
|
|
706
|
-
status: STATUS.OK,
|
|
707
|
-
}));
|
|
708
|
-
}
|
|
709
|
-
delete(reqInfo) {
|
|
710
|
-
return reqInfo.utils.createResponse$(() => {
|
|
711
|
-
let body;
|
|
712
|
-
const action = this.getAction(reqInfo);
|
|
713
|
-
if (action) {
|
|
714
|
-
body = this.removeCoupon(reqInfo, action);
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
717
|
-
body = this.removeAllCoupons(reqInfo);
|
|
718
|
-
}
|
|
719
|
-
return {
|
|
720
|
-
body,
|
|
721
|
-
status: STATUS.OK,
|
|
722
|
-
};
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
/**
|
|
726
|
-
* Gets whatever follows the cart ID section of the request URL.
|
|
727
|
-
*/
|
|
728
|
-
getAction(reqInfo) {
|
|
729
|
-
return reqInfo.url.replace(`/${reqInfo.resourceUrl}${reqInfo.id}/`, '');
|
|
730
|
-
}
|
|
731
|
-
getCart(reqInfo) {
|
|
732
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
733
|
-
}
|
|
734
|
-
listCoupons(reqInfo) {
|
|
735
|
-
return this.getCart(reqInfo).coupons;
|
|
736
|
-
}
|
|
737
|
-
applyCoupon(reqInfo) {
|
|
738
|
-
const cart = this.getCart(reqInfo);
|
|
739
|
-
const coupon = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
740
|
-
cart.coupons.push(coupon);
|
|
741
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
742
|
-
}
|
|
743
|
-
removeCoupon(reqInfo, couponCode) {
|
|
744
|
-
const cart = this.getCart(reqInfo);
|
|
745
|
-
cart.coupons = cart.coupons.filter(({ code }) => code !== couponCode);
|
|
746
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
747
|
-
}
|
|
748
|
-
removeAllCoupons(reqInfo) {
|
|
749
|
-
const cart = this.getCart(reqInfo);
|
|
750
|
-
cart.coupons = [];
|
|
751
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
/** @nocollapse */ DaffInMemoryBackendCartCouponService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartCouponService, deps: [{ token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
755
|
-
/** @nocollapse */ DaffInMemoryBackendCartCouponService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartCouponService, providedIn: 'root' });
|
|
756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartCouponService, decorators: [{
|
|
757
|
-
type: Injectable,
|
|
758
|
-
args: [{
|
|
759
|
-
providedIn: 'root',
|
|
760
|
-
}]
|
|
761
|
-
}], ctorParameters: function () {
|
|
762
|
-
return [{ type: undefined, decorators: [{
|
|
763
|
-
type: Inject,
|
|
764
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
765
|
-
}] }];
|
|
766
|
-
} });
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* @inheritdoc
|
|
770
|
-
*/
|
|
771
|
-
class DaffInMemoryBackendCartAddressService {
|
|
772
|
-
constructor(extraFieldsHook) {
|
|
773
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
774
|
-
}
|
|
775
|
-
put(reqInfo) {
|
|
776
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
777
|
-
body: this.updateAddress(reqInfo),
|
|
778
|
-
status: STATUS.OK,
|
|
779
|
-
}));
|
|
780
|
-
}
|
|
781
|
-
getCart(reqInfo) {
|
|
782
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
783
|
-
}
|
|
784
|
-
updateAddress(reqInfo) {
|
|
785
|
-
const cart = this.getCart(reqInfo);
|
|
786
|
-
const address = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
787
|
-
cart.billing_address = address;
|
|
788
|
-
cart.shipping_address = address;
|
|
789
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
/** @nocollapse */ DaffInMemoryBackendCartAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartAddressService, deps: [{ token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
793
|
-
/** @nocollapse */ DaffInMemoryBackendCartAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartAddressService, providedIn: 'root' });
|
|
794
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartAddressService, decorators: [{
|
|
795
|
-
type: Injectable,
|
|
796
|
-
args: [{
|
|
797
|
-
providedIn: 'root',
|
|
798
|
-
}]
|
|
799
|
-
}], ctorParameters: function () {
|
|
800
|
-
return [{ type: undefined, decorators: [{
|
|
801
|
-
type: Inject,
|
|
802
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
803
|
-
}] }];
|
|
804
|
-
} });
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* @inheritdoc
|
|
808
|
-
*/
|
|
809
|
-
class DaffInMemoryBackendCartShippingAddressService {
|
|
810
|
-
constructor(extraFieldsHook) {
|
|
811
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
812
|
-
}
|
|
813
|
-
get(reqInfo) {
|
|
814
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
815
|
-
body: this.getShippingAddress(reqInfo),
|
|
816
|
-
status: STATUS.OK,
|
|
817
|
-
}));
|
|
818
|
-
}
|
|
819
|
-
put(reqInfo) {
|
|
820
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
821
|
-
body: this.updateShippingAddress(reqInfo),
|
|
822
|
-
status: STATUS.OK,
|
|
823
|
-
}));
|
|
824
|
-
}
|
|
825
|
-
getCart(reqInfo) {
|
|
826
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
827
|
-
}
|
|
828
|
-
getShippingAddress(reqInfo) {
|
|
829
|
-
return this.getCart(reqInfo).shipping_address;
|
|
830
|
-
}
|
|
831
|
-
updateShippingAddress(reqInfo) {
|
|
832
|
-
const cart = this.getCart(reqInfo);
|
|
833
|
-
const address = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
834
|
-
cart.shipping_address = address;
|
|
835
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingAddressService, deps: [{ token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
839
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingAddressService, providedIn: 'root' });
|
|
840
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingAddressService, decorators: [{
|
|
841
|
-
type: Injectable,
|
|
842
|
-
args: [{
|
|
843
|
-
providedIn: 'root',
|
|
844
|
-
}]
|
|
845
|
-
}], ctorParameters: function () {
|
|
846
|
-
return [{ type: undefined, decorators: [{
|
|
847
|
-
type: Inject,
|
|
848
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
849
|
-
}] }];
|
|
850
|
-
} });
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* @inheritdoc
|
|
854
|
-
*/
|
|
855
|
-
class DaffInMemoryBackendCartBillingAddressService {
|
|
856
|
-
constructor(extraFieldsHook) {
|
|
857
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
858
|
-
}
|
|
859
|
-
get(reqInfo) {
|
|
860
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
861
|
-
body: this.getBillingAddress(reqInfo),
|
|
862
|
-
status: STATUS.OK,
|
|
863
|
-
}));
|
|
864
|
-
}
|
|
865
|
-
put(reqInfo) {
|
|
866
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
867
|
-
body: this.updateBillingAddress(reqInfo),
|
|
868
|
-
status: STATUS.OK,
|
|
869
|
-
}));
|
|
870
|
-
}
|
|
871
|
-
getCart(reqInfo) {
|
|
872
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
873
|
-
}
|
|
874
|
-
getBillingAddress(reqInfo) {
|
|
875
|
-
return this.getCart(reqInfo).billing_address;
|
|
876
|
-
}
|
|
877
|
-
updateBillingAddress(reqInfo) {
|
|
878
|
-
const cart = this.getCart(reqInfo);
|
|
879
|
-
const address = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
880
|
-
cart.billing_address = address;
|
|
881
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
/** @nocollapse */ DaffInMemoryBackendCartBillingAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartBillingAddressService, deps: [{ token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
885
|
-
/** @nocollapse */ DaffInMemoryBackendCartBillingAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartBillingAddressService, providedIn: 'root' });
|
|
886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartBillingAddressService, decorators: [{
|
|
887
|
-
type: Injectable,
|
|
888
|
-
args: [{
|
|
889
|
-
providedIn: 'root',
|
|
890
|
-
}]
|
|
891
|
-
}], ctorParameters: function () {
|
|
892
|
-
return [{ type: undefined, decorators: [{
|
|
893
|
-
type: Inject,
|
|
894
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
895
|
-
}] }];
|
|
896
|
-
} });
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* @inheritdoc
|
|
900
|
-
*/
|
|
901
|
-
class DaffInMemoryBackendCartPaymentMethodsService {
|
|
902
|
-
get(reqInfo) {
|
|
903
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
904
|
-
body: this.listPaymentMethods(reqInfo),
|
|
905
|
-
status: STATUS.OK,
|
|
906
|
-
}));
|
|
907
|
-
}
|
|
908
|
-
getCart(reqInfo) {
|
|
909
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
910
|
-
}
|
|
911
|
-
listPaymentMethods(reqInfo) {
|
|
912
|
-
return this.getCart(reqInfo).available_payment_methods;
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
/** @nocollapse */ DaffInMemoryBackendCartPaymentMethodsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartPaymentMethodsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
916
|
-
/** @nocollapse */ DaffInMemoryBackendCartPaymentMethodsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartPaymentMethodsService, providedIn: 'root' });
|
|
917
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartPaymentMethodsService, decorators: [{
|
|
918
|
-
type: Injectable,
|
|
919
|
-
args: [{
|
|
920
|
-
providedIn: 'root',
|
|
921
|
-
}]
|
|
922
|
-
}] });
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* @inheritdoc
|
|
926
|
-
*/
|
|
927
|
-
class DaffInMemoryBackendCartShippingMethodsService {
|
|
928
|
-
constructor(shippingMethodFactory) {
|
|
929
|
-
this.shippingMethodFactory = shippingMethodFactory;
|
|
930
|
-
}
|
|
931
|
-
get(reqInfo) {
|
|
932
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
933
|
-
body: this.listShippingMethods(reqInfo),
|
|
934
|
-
status: STATUS.OK,
|
|
935
|
-
}));
|
|
936
|
-
}
|
|
937
|
-
getCart(reqInfo) {
|
|
938
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
939
|
-
}
|
|
940
|
-
listShippingMethods(reqInfo) {
|
|
941
|
-
var _a;
|
|
942
|
-
const cart = this.getCart(reqInfo);
|
|
943
|
-
if (cart.shipping_address) {
|
|
944
|
-
if (((_a = cart.available_shipping_methods) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
945
|
-
cart.available_shipping_methods = this.shippingMethodFactory.createMany(3);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
else {
|
|
949
|
-
cart.available_shipping_methods = [];
|
|
950
|
-
}
|
|
951
|
-
return cart.available_shipping_methods;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingMethodsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingMethodsService, deps: [{ token: i1$1.DaffCartShippingRateFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
955
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingMethodsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingMethodsService, providedIn: 'root' });
|
|
956
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingMethodsService, decorators: [{
|
|
957
|
-
type: Injectable,
|
|
958
|
-
args: [{
|
|
959
|
-
providedIn: 'root',
|
|
960
|
-
}]
|
|
961
|
-
}], ctorParameters: function () { return [{ type: i1$1.DaffCartShippingRateFactory }]; } });
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* @inheritdoc
|
|
965
|
-
*/
|
|
966
|
-
class DaffInMemoryBackendCartPaymentService {
|
|
967
|
-
constructor(extraFieldsHook) {
|
|
968
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
969
|
-
}
|
|
970
|
-
get(reqInfo) {
|
|
971
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
972
|
-
body: this.getPayment(reqInfo),
|
|
973
|
-
status: STATUS.OK,
|
|
974
|
-
}));
|
|
975
|
-
}
|
|
976
|
-
put(reqInfo) {
|
|
977
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
978
|
-
body: this.updatePayment(reqInfo),
|
|
979
|
-
status: STATUS.OK,
|
|
980
|
-
}));
|
|
981
|
-
}
|
|
982
|
-
delete(reqInfo) {
|
|
983
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
984
|
-
body: this.removePayment(reqInfo),
|
|
985
|
-
status: STATUS.OK,
|
|
986
|
-
}));
|
|
987
|
-
}
|
|
988
|
-
getCart(reqInfo) {
|
|
989
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
990
|
-
}
|
|
991
|
-
getPayment(reqInfo) {
|
|
992
|
-
return this.getCart(reqInfo).payment;
|
|
993
|
-
}
|
|
994
|
-
updatePayment(reqInfo) {
|
|
995
|
-
const cart = this.getCart(reqInfo);
|
|
996
|
-
const { payment, address } = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
997
|
-
cart.payment = payment;
|
|
998
|
-
if (address) {
|
|
999
|
-
cart.billing_address = address;
|
|
1000
|
-
}
|
|
1001
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1002
|
-
}
|
|
1003
|
-
removePayment(reqInfo) {
|
|
1004
|
-
const cart = this.getCart(reqInfo);
|
|
1005
|
-
cart.payment = null;
|
|
1006
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
/** @nocollapse */ DaffInMemoryBackendCartPaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartPaymentService, deps: [{ token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1010
|
-
/** @nocollapse */ DaffInMemoryBackendCartPaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartPaymentService, providedIn: 'root' });
|
|
1011
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartPaymentService, decorators: [{
|
|
1012
|
-
type: Injectable,
|
|
1013
|
-
args: [{
|
|
1014
|
-
providedIn: 'root',
|
|
1015
|
-
}]
|
|
1016
|
-
}], ctorParameters: function () {
|
|
1017
|
-
return [{ type: undefined, decorators: [{
|
|
1018
|
-
type: Inject,
|
|
1019
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
1020
|
-
}] }];
|
|
1021
|
-
} });
|
|
1022
|
-
|
|
1023
|
-
/**
|
|
1024
|
-
* @inheritdoc
|
|
1025
|
-
*/
|
|
1026
|
-
class DaffInMemoryBackendCartShippingInformationService {
|
|
1027
|
-
constructor(extraFieldsHook, productBackend) {
|
|
1028
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
1029
|
-
this.productBackend = productBackend;
|
|
1030
|
-
}
|
|
1031
|
-
get(reqInfo) {
|
|
1032
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
1033
|
-
body: this.getShippingInformation(reqInfo),
|
|
1034
|
-
status: STATUS.OK,
|
|
1035
|
-
}));
|
|
1036
|
-
}
|
|
1037
|
-
put(reqInfo) {
|
|
1038
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
1039
|
-
body: this.updateShippingInformation(reqInfo),
|
|
1040
|
-
status: STATUS.OK,
|
|
1041
|
-
}));
|
|
1042
|
-
}
|
|
1043
|
-
delete(reqInfo) {
|
|
1044
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
1045
|
-
body: this.removeShippingInformation(reqInfo),
|
|
1046
|
-
status: STATUS.OK,
|
|
1047
|
-
}));
|
|
1048
|
-
}
|
|
1049
|
-
getCart(reqInfo) {
|
|
1050
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1051
|
-
}
|
|
1052
|
-
getShippingInformation(reqInfo) {
|
|
1053
|
-
return this.getCart(reqInfo).shipping_information;
|
|
1054
|
-
}
|
|
1055
|
-
updateShippingInformation(reqInfo) {
|
|
1056
|
-
const cart = this.getCart(reqInfo);
|
|
1057
|
-
const shippingInformation = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
1058
|
-
cart.shipping_information = shippingInformation;
|
|
1059
|
-
return Object.assign(Object.assign({}, daffCartInMemoryComputeCartTotals(cart, this.productBackend.products)), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1060
|
-
}
|
|
1061
|
-
removeShippingInformation(reqInfo) {
|
|
1062
|
-
const cart = this.getCart(reqInfo);
|
|
1063
|
-
cart.shipping_information = null;
|
|
1064
|
-
return Object.assign(Object.assign({}, daffCartInMemoryComputeCartTotals(cart, this.productBackend.products)), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingInformationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingInformationService, deps: [{ token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK }, { token: i2.DaffInMemoryBackendProductService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1068
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingInformationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingInformationService, providedIn: 'root' });
|
|
1069
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartShippingInformationService, decorators: [{
|
|
1070
|
-
type: Injectable,
|
|
1071
|
-
args: [{
|
|
1072
|
-
providedIn: 'root',
|
|
1073
|
-
}]
|
|
1074
|
-
}], ctorParameters: function () {
|
|
1075
|
-
return [{ type: undefined, decorators: [{
|
|
1076
|
-
type: Inject,
|
|
1077
|
-
args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK]
|
|
1078
|
-
}] }, { type: i2.DaffInMemoryBackendProductService }];
|
|
1079
|
-
} });
|
|
1080
|
-
|
|
1081
|
-
/**
|
|
1082
|
-
* The root cart in-memory backend.
|
|
1083
|
-
* Creates the database and delegates requests to child backends.
|
|
1084
|
-
*/
|
|
1085
|
-
class DaffInMemoryBackendCartRootService {
|
|
1086
|
-
constructor(cartService, cartItemsService, cartOrderService, cartCouponService, cartAddressService, cartShippingAddressService, cartBillingAddressService, cartPaymentMethodsService, cartShippingMethodsService, cartPaymentService, cartShippingInformationService) {
|
|
1087
|
-
this.cartService = cartService;
|
|
1088
|
-
this.cartItemsService = cartItemsService;
|
|
1089
|
-
this.cartOrderService = cartOrderService;
|
|
1090
|
-
this.cartCouponService = cartCouponService;
|
|
1091
|
-
this.cartAddressService = cartAddressService;
|
|
1092
|
-
this.cartShippingAddressService = cartShippingAddressService;
|
|
1093
|
-
this.cartBillingAddressService = cartBillingAddressService;
|
|
1094
|
-
this.cartPaymentMethodsService = cartPaymentMethodsService;
|
|
1095
|
-
this.cartShippingMethodsService = cartShippingMethodsService;
|
|
1096
|
-
this.cartPaymentService = cartPaymentService;
|
|
1097
|
-
this.cartShippingInformationService = cartShippingInformationService;
|
|
1098
|
-
/**
|
|
1099
|
-
* The collection of carts in the backend.
|
|
1100
|
-
*/
|
|
1101
|
-
this.carts = [];
|
|
1102
|
-
}
|
|
1103
|
-
createDb(reqInfo) {
|
|
1104
|
-
if (reqInfo) {
|
|
1105
|
-
const seedData = reqInfo.utils.getJsonBody(reqInfo.req).carts;
|
|
1106
|
-
if (seedData) {
|
|
1107
|
-
this.carts = seedData;
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
return {
|
|
1111
|
-
cart: this.carts,
|
|
1112
|
-
};
|
|
1113
|
-
}
|
|
1114
|
-
get(reqInfo) {
|
|
1115
|
-
return this.delegateRequest(reqInfo);
|
|
1116
|
-
}
|
|
1117
|
-
post(reqInfo) {
|
|
1118
|
-
return this.delegateRequest(reqInfo);
|
|
1119
|
-
}
|
|
1120
|
-
put(reqInfo) {
|
|
1121
|
-
return this.delegateRequest(reqInfo);
|
|
1122
|
-
}
|
|
1123
|
-
delete(reqInfo) {
|
|
1124
|
-
return this.delegateRequest(reqInfo);
|
|
1125
|
-
}
|
|
1126
|
-
delegateRequest(reqInfo) {
|
|
1127
|
-
reqInfo.collection = this.carts;
|
|
1128
|
-
switch (reqInfo.collectionName) {
|
|
1129
|
-
case 'cart':
|
|
1130
|
-
return this.cartService[reqInfo.method](reqInfo);
|
|
1131
|
-
case 'cart-items':
|
|
1132
|
-
return this.cartItemsService[reqInfo.method](reqInfo);
|
|
1133
|
-
case 'cart-order':
|
|
1134
|
-
return this.cartOrderService[reqInfo.method](reqInfo);
|
|
1135
|
-
case 'cart-coupon':
|
|
1136
|
-
return this.cartCouponService[reqInfo.method](reqInfo);
|
|
1137
|
-
case 'cart-address':
|
|
1138
|
-
return this.cartAddressService[reqInfo.method](reqInfo);
|
|
1139
|
-
case 'cart-shipping-address':
|
|
1140
|
-
return this.cartShippingAddressService[reqInfo.method](reqInfo);
|
|
1141
|
-
case 'cart-billing-address':
|
|
1142
|
-
return this.cartBillingAddressService[reqInfo.method](reqInfo);
|
|
1143
|
-
case 'cart-payment-methods':
|
|
1144
|
-
return this.cartPaymentMethodsService[reqInfo.method](reqInfo);
|
|
1145
|
-
case 'cart-shipping-methods':
|
|
1146
|
-
return this.cartShippingMethodsService[reqInfo.method](reqInfo);
|
|
1147
|
-
case 'cart-payment':
|
|
1148
|
-
return this.cartPaymentService[reqInfo.method](reqInfo);
|
|
1149
|
-
case 'cart-shipping-information':
|
|
1150
|
-
return this.cartShippingInformationService[reqInfo.method](reqInfo);
|
|
1151
|
-
default:
|
|
1152
|
-
return reqInfo.utils.createResponse$(() => ({
|
|
1153
|
-
body: {},
|
|
1154
|
-
status: STATUS.OK,
|
|
1155
|
-
}));
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
/**
|
|
1160
|
-
* The collections that the root service manages.
|
|
1161
|
-
* Useful for a higher-level backend that delegates to this one based on collection name.
|
|
1162
|
-
*/
|
|
1163
|
-
DaffInMemoryBackendCartRootService.COLLECTION_NAMES = [
|
|
1164
|
-
'cart',
|
|
1165
|
-
'cart-items',
|
|
1166
|
-
'cart-order',
|
|
1167
|
-
'cart-coupon',
|
|
1168
|
-
'cart-address',
|
|
1169
|
-
'cart-shipping-address',
|
|
1170
|
-
'cart-billing-address',
|
|
1171
|
-
'cart-payment-methods',
|
|
1172
|
-
'cart-shipping-methods',
|
|
1173
|
-
'cart-payment',
|
|
1174
|
-
'cart-shipping-information',
|
|
1175
|
-
];
|
|
1176
|
-
/** @nocollapse */ DaffInMemoryBackendCartRootService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartRootService, deps: [{ token: DaffInMemoryBackendCartService }, { token: DaffInMemoryBackendCartItemsService }, { token: DaffInMemoryBackendCartOrderService }, { token: DaffInMemoryBackendCartCouponService }, { token: DaffInMemoryBackendCartAddressService }, { token: DaffInMemoryBackendCartShippingAddressService }, { token: DaffInMemoryBackendCartBillingAddressService }, { token: DaffInMemoryBackendCartPaymentMethodsService }, { token: DaffInMemoryBackendCartShippingMethodsService }, { token: DaffInMemoryBackendCartPaymentService }, { token: DaffInMemoryBackendCartShippingInformationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1177
|
-
/** @nocollapse */ DaffInMemoryBackendCartRootService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartRootService, providedIn: 'root' });
|
|
1178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffInMemoryBackendCartRootService, decorators: [{
|
|
1179
|
-
type: Injectable,
|
|
1180
|
-
args: [{
|
|
1181
|
-
providedIn: 'root',
|
|
1182
|
-
}]
|
|
1183
|
-
}], ctorParameters: function () { return [{ type: DaffInMemoryBackendCartService }, { type: DaffInMemoryBackendCartItemsService }, { type: DaffInMemoryBackendCartOrderService }, { type: DaffInMemoryBackendCartCouponService }, { type: DaffInMemoryBackendCartAddressService }, { type: DaffInMemoryBackendCartShippingAddressService }, { type: DaffInMemoryBackendCartBillingAddressService }, { type: DaffInMemoryBackendCartPaymentMethodsService }, { type: DaffInMemoryBackendCartShippingMethodsService }, { type: DaffInMemoryBackendCartPaymentService }, { type: DaffInMemoryBackendCartShippingInformationService }]; } });
|
|
1184
|
-
|
|
1185
|
-
/**
|
|
1186
|
-
* Generated bundle index. Do not edit.
|
|
1187
|
-
*/
|
|
1188
|
-
|
|
1189
|
-
export { DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK, DaffCartInMemoryDriverModule, DaffInMemoryBackendCartAddressService, DaffInMemoryBackendCartBillingAddressService, DaffInMemoryBackendCartCouponService, DaffInMemoryBackendCartItemsService, DaffInMemoryBackendCartOrderService, DaffInMemoryBackendCartPaymentMethodsService, DaffInMemoryBackendCartPaymentService, DaffInMemoryBackendCartRootService, DaffInMemoryBackendCartService, DaffInMemoryBackendCartShippingAddressService, DaffInMemoryBackendCartShippingInformationService, DaffInMemoryBackendCartShippingMethodsService, DaffInMemoryCartBillingAddressService, DaffInMemoryCartCouponService, DaffInMemoryCartItemService, DaffInMemoryCartOrderService, DaffInMemoryCartPaymentMethodsService, DaffInMemoryCartPaymentService, DaffInMemoryCartService, DaffInMemoryCartShippingAddressService, DaffInMemoryCartShippingInformationService, DaffInMemoryCartShippingMethodsService };
|
|
1190
|
-
//# sourceMappingURL=daffodil-cart-driver-in-memory.mjs.map
|