@daffodil/cart 0.38.9 → 0.39.3
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/bundles/daffodil-cart-driver-in-memory.umd.js +111 -1202
- package/bundles/daffodil-cart-driver-in-memory.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-in-memory.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-in-memory.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver-magento-testing.umd.js +12 -177
- package/bundles/daffodil-cart-driver-magento-testing.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-magento-testing.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-magento-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver-magento.umd.js +164 -1661
- package/bundles/daffodil-cart-driver-magento.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-magento.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-magento.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver-testing.umd.js +23 -375
- package/bundles/daffodil-cart-driver-testing.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-testing.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver.umd.js +29 -466
- package/bundles/daffodil-cart-driver.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver.umd.min.js +16 -1
- package/bundles/daffodil-cart-driver.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-routing.umd.js +43 -518
- package/bundles/daffodil-cart-routing.umd.js.map +1 -1
- package/bundles/daffodil-cart-routing.umd.min.js +1 -1
- package/bundles/daffodil-cart-routing.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-state-testing.umd.js +6 -241
- package/bundles/daffodil-cart-state-testing.umd.js.map +1 -1
- package/bundles/daffodil-cart-state-testing.umd.min.js +2 -2
- package/bundles/daffodil-cart-state-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-state.umd.js +656 -4198
- package/bundles/daffodil-cart-state.umd.js.map +1 -1
- package/bundles/daffodil-cart-state.umd.min.js +1 -1
- package/bundles/daffodil-cart-state.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-testing.umd.js +13 -187
- package/bundles/daffodil-cart-testing.umd.js.map +1 -1
- package/bundles/daffodil-cart-testing.umd.min.js +1 -1
- package/bundles/daffodil-cart-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-cart.umd.js +43 -271
- package/bundles/daffodil-cart.umd.js.map +1 -1
- package/bundles/daffodil-cart.umd.min.js +3 -2
- package/bundles/daffodil-cart.umd.min.js.map +1 -1
- package/driver/in-memory/package.json +1 -1
- package/driver/magento/package.json +1 -1
- package/driver/magento/testing/package.json +1 -1
- package/driver/package.json +1 -1
- package/driver/testing/package.json +1 -1
- package/esm2015/daffodil-cart.js +2 -7
- package/esm2015/driver/daffodil-cart-driver.js +2 -7
- package/esm2015/driver/errors/cart-not-found.js +1 -13
- package/esm2015/driver/errors/codes.enum.js +12 -18
- package/esm2015/driver/errors/expired-payment-token.js +1 -15
- package/esm2015/driver/errors/invalid-api-response.js +1 -15
- package/esm2015/driver/errors/invalid-country.js +1 -13
- package/esm2015/driver/errors/invalid-coupon-code.js +1 -16
- package/esm2015/driver/errors/invalid-region.js +1 -13
- package/esm2015/driver/errors/map.js +1 -7
- package/esm2015/driver/errors/product-not-found.js +1 -13
- package/esm2015/driver/errors/product-out-of-stock.js +1 -13
- package/esm2015/driver/errors/public_api.js +1 -6
- package/esm2015/driver/in-memory/backend/cart/cart.service.js +7 -65
- package/esm2015/driver/in-memory/backend/cart-address/cart-address.service.js +5 -39
- package/esm2015/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.js +7 -53
- package/esm2015/driver/in-memory/backend/cart-coupon/cart-coupon.service.js +10 -85
- package/esm2015/driver/in-memory/backend/cart-items/cart-items.service.js +21 -169
- package/esm2015/driver/in-memory/backend/cart-order/cart-order.service.js +5 -22
- package/esm2015/driver/in-memory/backend/cart-payment/cart-payment.service.js +9 -67
- package/esm2015/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.js +5 -27
- package/esm2015/driver/in-memory/backend/cart-root.service.js +4 -119
- package/esm2015/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.js +7 -53
- package/esm2015/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.js +9 -68
- package/esm2015/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.js +5 -38
- package/esm2015/driver/in-memory/backend/public_api.js +1 -6
- package/esm2015/driver/in-memory/daffodil-cart-driver-in-memory.js +2 -7
- package/esm2015/driver/in-memory/drivers/cart/cart.service.js +4 -48
- package/esm2015/driver/in-memory/drivers/cart-address/cart-address.service.js +3 -28
- package/esm2015/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.js +3 -32
- package/esm2015/driver/in-memory/drivers/cart-coupon/cart-coupon.service.js +3 -41
- package/esm2015/driver/in-memory/drivers/cart-driver.module.js +1 -9
- package/esm2015/driver/in-memory/drivers/cart-item/cart-item.service.js +3 -48
- package/esm2015/driver/in-memory/drivers/cart-order/cart-order.service.js +3 -28
- package/esm2015/driver/in-memory/drivers/cart-payment/cart-payment.service.js +3 -42
- package/esm2015/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.js +3 -27
- package/esm2015/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.js +3 -32
- package/esm2015/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.js +3 -36
- package/esm2015/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.js +3 -27
- package/esm2015/driver/in-memory/drivers/public_api.js +1 -6
- package/esm2015/driver/in-memory/index.js +2 -7
- package/esm2015/driver/in-memory/injection-tokens/extra-attributes-hook.token.js +2 -16
- package/esm2015/driver/in-memory/injection-tokens/public_api.js +1 -6
- package/esm2015/driver/in-memory/public_api.js +4 -9
- package/esm2015/driver/index.js +2 -7
- package/esm2015/driver/interfaces/cart-address-service.interface.js +1 -22
- package/esm2015/driver/interfaces/cart-billing-address-service.interface.js +1 -28
- package/esm2015/driver/interfaces/cart-coupon-service.interface.js +1 -41
- package/esm2015/driver/interfaces/cart-item-service.interface.js +1 -50
- package/esm2015/driver/interfaces/cart-order-service.interface.js +1 -22
- package/esm2015/driver/interfaces/cart-payment-methods-service.interface.js +1 -21
- package/esm2015/driver/interfaces/cart-payment-service.interface.js +1 -42
- package/esm2015/driver/interfaces/cart-service.interface.js +1 -42
- package/esm2015/driver/interfaces/cart-shipping-address-service.interface.js +1 -28
- package/esm2015/driver/interfaces/cart-shipping-information-service.interface.js +1 -36
- package/esm2015/driver/interfaces/cart-shipping-methods-service.interface.js +1 -21
- package/esm2015/driver/interfaces/public_api.js +1 -6
- package/esm2015/driver/magento/cart-address.service.js +5 -71
- package/esm2015/driver/magento/cart-billing-address.service.js +7 -93
- package/esm2015/driver/magento/cart-coupon.service.js +6 -75
- package/esm2015/driver/magento/cart-driver.module.js +1 -9
- package/esm2015/driver/magento/cart-item.service.js +10 -126
- package/esm2015/driver/magento/cart-order.service.js +5 -33
- package/esm2015/driver/magento/cart-payment-methods.service.js +4 -43
- package/esm2015/driver/magento/cart-payment.service.js +7 -115
- package/esm2015/driver/magento/cart-shipping-address.service.js +7 -93
- package/esm2015/driver/magento/cart-shipping-information.service.js +8 -87
- package/esm2015/driver/magento/cart-shipping-methods.service.js +4 -43
- package/esm2015/driver/magento/cart.service.js +6 -84
- package/esm2015/driver/magento/daffodil-cart-driver-magento.js +2 -7
- package/esm2015/driver/magento/errors/codes.js +6 -12
- package/esm2015/driver/magento/errors/map.js +1 -8
- package/esm2015/driver/magento/errors/transform.js +2 -19
- package/esm2015/driver/magento/index.js +2 -7
- package/esm2015/driver/magento/injection-tokens/cart-mutation-queue.token.js +2 -11
- package/esm2015/driver/magento/injection-tokens/fragments/cart.js +2 -11
- package/esm2015/driver/magento/injection-tokens/public_api.js +1 -6
- package/esm2015/driver/magento/models/public_api.js +3 -8
- package/esm2015/driver/magento/models/requests/billing-address.js +2 -20
- package/esm2015/driver/magento/models/requests/cart-address.js +2 -32
- package/esm2015/driver/magento/models/requests/cart-item-update.js +2 -16
- package/esm2015/driver/magento/models/requests/cart-item.js +2 -32
- package/esm2015/driver/magento/models/requests/payment-method.js +2 -16
- package/esm2015/driver/magento/models/requests/public_api.js +2 -7
- package/esm2015/driver/magento/models/requests/shipping-address.js +2 -18
- package/esm2015/driver/magento/models/requests/shipping-method.js +2 -16
- package/esm2015/driver/magento/models/responses/cart-address.js +2 -32
- package/esm2015/driver/magento/models/responses/cart-coupon.js +2 -14
- package/esm2015/driver/magento/models/responses/cart-item.js +7 -70
- package/esm2015/driver/magento/models/responses/cart-payment-method.js +2 -20
- package/esm2015/driver/magento/models/responses/cart-shipping-method.js +2 -22
- package/esm2015/driver/magento/models/responses/cart.js +2 -31
- package/esm2015/driver/magento/models/responses/public_api.js +2 -7
- package/esm2015/driver/magento/models/responses/shipping-address.js +2 -16
- package/esm2015/driver/magento/public_api.js +5 -10
- package/esm2015/driver/magento/queries/add-cart-item.js +3 -13
- package/esm2015/driver/magento/queries/apply-coupon.js +3 -13
- package/esm2015/driver/magento/queries/create-cart.js +1 -7
- package/esm2015/driver/magento/queries/fragments/available-payment-method.js +1 -7
- package/esm2015/driver/magento/queries/fragments/available-shipping-method.js +1 -7
- package/esm2015/driver/magento/queries/fragments/cart-address.js +1 -7
- package/esm2015/driver/magento/queries/fragments/cart-coupon.js +1 -7
- package/esm2015/driver/magento/queries/fragments/cart-item.js +1 -8
- package/esm2015/driver/magento/queries/fragments/cart-totals.js +1 -7
- package/esm2015/driver/magento/queries/fragments/cart.js +1 -7
- package/esm2015/driver/magento/queries/fragments/money.js +1 -7
- package/esm2015/driver/magento/queries/fragments/prices.js +1 -7
- package/esm2015/driver/magento/queries/fragments/public_api.js +1 -6
- package/esm2015/driver/magento/queries/fragments/selected-payment-method.js +1 -7
- package/esm2015/driver/magento/queries/fragments/selected-shipping-method.js +1 -7
- package/esm2015/driver/magento/queries/get-billing-address.js +3 -13
- package/esm2015/driver/magento/queries/get-cart.js +3 -13
- package/esm2015/driver/magento/queries/get-selected-payment-method.js +3 -13
- package/esm2015/driver/magento/queries/get-selected-shipping-method.js +3 -13
- package/esm2015/driver/magento/queries/get-shipping-address.js +3 -13
- package/esm2015/driver/magento/queries/list-cart-coupons.js +3 -13
- package/esm2015/driver/magento/queries/list-cart-items.js +3 -13
- package/esm2015/driver/magento/queries/list-payment-methods.js +3 -13
- package/esm2015/driver/magento/queries/list-shipping-methods.js +3 -13
- package/esm2015/driver/magento/queries/place-order.js +1 -7
- package/esm2015/driver/magento/queries/public_api.js +3 -8
- package/esm2015/driver/magento/queries/remove-all-coupons.js +3 -13
- package/esm2015/driver/magento/queries/remove-cart-item.js +3 -13
- package/esm2015/driver/magento/queries/responses/add-cart-item.js +2 -14
- package/esm2015/driver/magento/queries/responses/apply-coupon.js +2 -14
- package/esm2015/driver/magento/queries/responses/create-cart.js +2 -14
- package/esm2015/driver/magento/queries/responses/get-billing-address.js +2 -14
- package/esm2015/driver/magento/queries/responses/get-cart.js +2 -16
- package/esm2015/driver/magento/queries/responses/get-selected-payment-method.js +2 -14
- package/esm2015/driver/magento/queries/responses/get-selected-shipping-method.js +2 -14
- package/esm2015/driver/magento/queries/responses/get-shipping-address.js +2 -14
- package/esm2015/driver/magento/queries/responses/list-cart-coupons.js +2 -14
- package/esm2015/driver/magento/queries/responses/list-cart-items.js +2 -14
- package/esm2015/driver/magento/queries/responses/list-payment-methods.js +2 -14
- package/esm2015/driver/magento/queries/responses/list-shipping-methods.js +2 -14
- package/esm2015/driver/magento/queries/responses/place-order.js +2 -14
- package/esm2015/driver/magento/queries/responses/public_api.js +2 -7
- package/esm2015/driver/magento/queries/responses/remove-all-coupons.js +2 -14
- package/esm2015/driver/magento/queries/responses/remove-cart-item.js +2 -14
- package/esm2015/driver/magento/queries/responses/set-guest-email.js +2 -14
- package/esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing-and-email.js +2 -18
- package/esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing.js +2 -16
- package/esm2015/driver/magento/queries/responses/set-selected-payment-method.js +2 -14
- package/esm2015/driver/magento/queries/responses/set-selected-shipping-method.js +2 -14
- package/esm2015/driver/magento/queries/responses/update-address-with-email.js +2 -18
- package/esm2015/driver/magento/queries/responses/update-address.js +2 -16
- package/esm2015/driver/magento/queries/responses/update-billing-address-with-email.js +2 -16
- package/esm2015/driver/magento/queries/responses/update-billing-address.js +2 -14
- package/esm2015/driver/magento/queries/responses/update-cart-item.js +2 -14
- package/esm2015/driver/magento/queries/responses/update-shipping-address-with-email.js +2 -16
- package/esm2015/driver/magento/queries/responses/update-shipping-address.js +2 -14
- package/esm2015/driver/magento/queries/set-selected-payment-method-with-billing-and-email.js +3 -13
- package/esm2015/driver/magento/queries/set-selected-payment-method-with-billing.js +3 -13
- package/esm2015/driver/magento/queries/set-selected-payment-method.js +3 -13
- package/esm2015/driver/magento/queries/set-selected-shipping-method.js +3 -13
- package/esm2015/driver/magento/queries/update-address-with-email.js +3 -13
- package/esm2015/driver/magento/queries/update-address.js +3 -13
- package/esm2015/driver/magento/queries/update-billing-address-with-email.js +3 -13
- package/esm2015/driver/magento/queries/update-billing-address.js +3 -13
- package/esm2015/driver/magento/queries/update-cart-item.js +3 -13
- package/esm2015/driver/magento/queries/update-shipping-address-with-email.js +3 -13
- package/esm2015/driver/magento/queries/update-shipping-address.js +3 -13
- package/esm2015/driver/magento/testing/daffodil-cart-driver-magento-testing.js +2 -7
- package/esm2015/driver/magento/testing/factories/cart-address-input.factory.js +2 -29
- package/esm2015/driver/magento/testing/factories/cart-address.factory.js +2 -31
- package/esm2015/driver/magento/testing/factories/cart-coupon.factory.js +2 -11
- package/esm2015/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.js +2 -13
- package/esm2015/driver/magento/testing/factories/cart-item/cart-item.factory.js +2 -32
- package/esm2015/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.js +2 -13
- package/esm2015/driver/magento/testing/factories/cart-payment-method.factory.js +2 -15
- package/esm2015/driver/magento/testing/factories/cart-shipping-method.factory.js +2 -23
- package/esm2015/driver/magento/testing/factories/cart.factory.js +2 -33
- package/esm2015/driver/magento/testing/factories/public_api.js +1 -6
- package/esm2015/driver/magento/testing/factories/shipping-address.factory.js +2 -15
- package/esm2015/driver/magento/testing/index.js +2 -7
- package/esm2015/driver/magento/testing/public_api.js +2 -7
- package/esm2015/driver/magento/transforms/inputs/billing-address.service.js +2 -21
- package/esm2015/driver/magento/transforms/inputs/cart-address.service.js +2 -11
- package/esm2015/driver/magento/transforms/inputs/cart-item-input-transformers.js +2 -23
- package/esm2015/driver/magento/transforms/inputs/cart-item-update.service.js +2 -11
- package/esm2015/driver/magento/transforms/inputs/payment-method.service.js +2 -11
- package/esm2015/driver/magento/transforms/inputs/shipping-address.service.js +2 -21
- package/esm2015/driver/magento/transforms/inputs/shipping-method.service.js +2 -11
- package/esm2015/driver/magento/transforms/outputs/billing-address.service.js +3 -19
- package/esm2015/driver/magento/transforms/outputs/cart-address.service.js +3 -9
- package/esm2015/driver/magento/transforms/outputs/cart-coupon-response.service.js +3 -24
- package/esm2015/driver/magento/transforms/outputs/cart-coupon.js +1 -10
- package/esm2015/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.js +2 -12
- package/esm2015/driver/magento/transforms/outputs/cart-item/cart-item-transformer.js +4 -10
- package/esm2015/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.js +2 -12
- package/esm2015/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.js +4 -14
- package/esm2015/driver/magento/transforms/outputs/cart-payment.service.js +3 -9
- package/esm2015/driver/magento/transforms/outputs/cart-shipping-information.service.js +6 -20
- package/esm2015/driver/magento/transforms/outputs/cart-shipping-rate.service.js +3 -9
- package/esm2015/driver/magento/transforms/outputs/cart-totals-transformer.js +4 -31
- package/esm2015/driver/magento/transforms/outputs/cart.service.js +5 -98
- package/esm2015/driver/magento/transforms/outputs/shipping-address.service.js +3 -19
- package/esm2015/driver/magento/transforms/public_api.js +1 -6
- package/esm2015/driver/public_api.js +3 -8
- package/esm2015/driver/testing/daffodil-cart-driver-testing.js +2 -7
- package/esm2015/driver/testing/drivers/cart/cart.service.js +3 -34
- package/esm2015/driver/testing/drivers/cart-address/cart-address.service.js +3 -29
- package/esm2015/driver/testing/drivers/cart-billing-address/cart-billing-address.service.js +3 -33
- package/esm2015/driver/testing/drivers/cart-coupon/cart-coupon.service.js +3 -42
- package/esm2015/driver/testing/drivers/cart-driver.module.js +1 -9
- package/esm2015/driver/testing/drivers/cart-item/cart-item.service.js +3 -49
- package/esm2015/driver/testing/drivers/cart-order/cart-order.service.js +3 -13
- package/esm2015/driver/testing/drivers/cart-payment/cart-payment.service.js +3 -43
- package/esm2015/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.js +3 -22
- package/esm2015/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.js +3 -33
- package/esm2015/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.js +3 -37
- package/esm2015/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.js +3 -22
- package/esm2015/driver/testing/drivers/public_api.js +1 -6
- package/esm2015/driver/testing/index.js +2 -7
- package/esm2015/driver/testing/public_api.js +2 -7
- package/esm2015/errors/codes.enum.js +10 -12
- package/esm2015/errors/map.js +1 -7
- package/esm2015/errors/public_api.js +2 -7
- package/esm2015/errors/resolution/cart-not-found-or-created-resolution.js +2 -14
- package/esm2015/errors/resolution/cart-resolution.js +2 -14
- package/esm2015/errors/resolution/cart-server-side-resolution.js +2 -14
- package/esm2015/errors/resolution/cart-storage-resolution.js +2 -14
- package/esm2015/errors/resolution/public_api.js +1 -6
- package/esm2015/index.js +2 -7
- package/esm2015/injection-tokens/error-matcher.token.js +2 -11
- package/esm2015/injection-tokens/payment-method-map.js +3 -12
- package/esm2015/injection-tokens/public_api.js +1 -6
- package/esm2015/models/cart-address.js +2 -23
- package/esm2015/models/cart-coupon.js +2 -31
- package/esm2015/models/cart-item-input.js +10 -93
- package/esm2015/models/cart-item.js +2 -88
- package/esm2015/models/cart-order-result.js +2 -29
- package/esm2015/models/cart-payment.js +2 -25
- package/esm2015/models/cart-shipping-info.js +2 -14
- package/esm2015/models/cart-shipping-rate.js +2 -43
- package/esm2015/models/cart-total.js +13 -41
- package/esm2015/models/cart.js +2 -76
- package/esm2015/models/composite-cart-item.js +2 -40
- package/esm2015/models/configurable-cart-item.js +2 -35
- package/esm2015/models/public_api.js +7 -12
- package/esm2015/public_api.js +4 -9
- package/esm2015/routing/cart-routing.module.js +2 -11
- package/esm2015/routing/config/config.js +4 -23
- package/esm2015/routing/config/resolution/config.js +1 -21
- package/esm2015/routing/daffodil-cart-routing.js +2 -7
- package/esm2015/routing/guards/billing-address/billing-address-guard-redirect.token.js +1 -7
- package/esm2015/routing/guards/billing-address/billing-address.guard.js +5 -39
- package/esm2015/routing/guards/cart-items/cart-items-guard-redirect.token.js +2 -8
- package/esm2015/routing/guards/cart-items/cart-items.guard.js +6 -44
- package/esm2015/routing/guards/order-result/order-result-guard-redirect.token.js +1 -7
- package/esm2015/routing/guards/order-result/order-result.guard.js +4 -38
- package/esm2015/routing/guards/payment-method/payment-method-guard-redirect.token.js +1 -7
- package/esm2015/routing/guards/payment-method/payment-method.guard.js +5 -39
- package/esm2015/routing/guards/public_api.js +1 -6
- package/esm2015/routing/guards/resolved-cart/resolved-cart.guard.js +7 -49
- package/esm2015/routing/guards/shipping-address/shipping-address-guard-redirect.token.js +1 -7
- package/esm2015/routing/guards/shipping-address/shipping-address.guard.js +5 -39
- package/esm2015/routing/guards/shipping-method/shipping-method-guard-redirect.token.js +1 -7
- package/esm2015/routing/guards/shipping-method/shipping-method.guard.js +5 -39
- package/esm2015/routing/index.js +2 -7
- package/esm2015/routing/public_api.js +3 -8
- package/esm2015/routing/resolvers/cart-resolver.service.js +5 -49
- package/esm2015/routing/resolvers/empty-cart-resolver.service.js +4 -42
- package/esm2015/routing/resolvers/public_api.js +1 -6
- package/esm2015/routing/resolvers/tokens/cart-resolver-redirect.token.js +1 -7
- package/esm2015/routing/resolvers/tokens/empty-cart-resolver-redirect.token.js +1 -7
- package/esm2015/state/actions/cart-address.actions.js +8 -40
- package/esm2015/state/actions/cart-billing-address.actions.js +11 -66
- package/esm2015/state/actions/cart-coupon.actions.js +17 -124
- package/esm2015/state/actions/cart-item.actions.js +22 -186
- package/esm2015/state/actions/cart-order.actions.js +8 -40
- package/esm2015/state/actions/cart-payment-methods.actions.js +8 -34
- package/esm2015/state/actions/cart-payment.actions.js +19 -133
- package/esm2015/state/actions/cart-shipping-address.actions.js +11 -66
- package/esm2015/state/actions/cart-shipping-information.actions.js +14 -100
- package/esm2015/state/actions/cart-shipping-methods.actions.js +8 -36
- package/esm2015/state/actions/cart.actions.js +22 -162
- package/esm2015/state/actions/public_api.js +12 -17
- package/esm2015/state/cart-state.module.js +1 -6
- package/esm2015/state/daffodil-cart-state.js +2 -7
- package/esm2015/state/effects/cart-address.effects.js +3 -60
- package/esm2015/state/effects/cart-billing-address.effects.js +3 -67
- package/esm2015/state/effects/cart-coupon.effects.js +9 -129
- package/esm2015/state/effects/cart-item.effects.js +6 -120
- package/esm2015/state/effects/cart-order.effects.js +3 -62
- package/esm2015/state/effects/cart-payment-methods.effects.js +2 -52
- package/esm2015/state/effects/cart-payment.effects.js +5 -93
- package/esm2015/state/effects/cart-resolver.effects.js +4 -80
- package/esm2015/state/effects/cart-shipping-address.effects.js +3 -67
- package/esm2015/state/effects/cart-shipping-information.effects.js +4 -82
- package/esm2015/state/effects/cart-shipping-methods.effects.js +2 -52
- package/esm2015/state/effects/cart.effects.js +9 -128
- package/esm2015/state/facades/cart/cart-facade.interface.js +2 -355
- package/esm2015/state/facades/cart/cart.facade.js +10 -275
- package/esm2015/state/index.js +2 -7
- package/esm2015/state/injection-tokens/cart-item-state-debounce-time.js +1 -7
- package/esm2015/state/injection-tokens/public_api.js +1 -6
- package/esm2015/state/models/public_api.js +4 -9
- package/esm2015/state/models/stateful-cart-item.js +9 -27
- package/esm2015/state/models/stateful-composite-cart-item.js +2 -10
- package/esm2015/state/models/stateful-configurable-cart-item.js +2 -10
- package/esm2015/state/public_api.js +6 -11
- package/esm2015/state/reducers/action-types.type.js +2 -6
- package/esm2015/state/reducers/cart/cart.reducer.js +1 -15
- package/esm2015/state/reducers/cart-billing-address/cart-billing-address.reducer.js +1 -15
- package/esm2015/state/reducers/cart-coupon/cart-coupon.reducer.js +1 -15
- package/esm2015/state/reducers/cart-initial-state.js +1 -7
- package/esm2015/state/reducers/cart-item/cart-item.reducer.js +3 -21
- package/esm2015/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.js +4 -22
- package/esm2015/state/reducers/cart-item-entities/cart-item-entities.reducer.js +12 -58
- package/esm2015/state/reducers/cart-operation-type.enum.js +16 -17
- package/esm2015/state/reducers/cart-order/cart-order-initial-state.js +1 -7
- package/esm2015/state/reducers/cart-order/cart-order-state.interface.js +2 -19
- package/esm2015/state/reducers/cart-order/cart-order.reducer.js +1 -12
- package/esm2015/state/reducers/cart-payment/cart-payment.reducer.js +1 -15
- package/esm2015/state/reducers/cart-payment-methods/cart-payment-methods.reducer.js +1 -15
- package/esm2015/state/reducers/cart-reducers-state.interface.js +1 -28
- package/esm2015/state/reducers/cart-reducers.js +1 -7
- package/esm2015/state/reducers/cart-resolve/cart-resolve-state.enum.js +9 -15
- package/esm2015/state/reducers/cart-resolve/cart-resolve.reducer.js +1 -12
- package/esm2015/state/reducers/cart-shipping-address/cart-shipping-address.reducer.js +1 -15
- package/esm2015/state/reducers/cart-shipping-information/cart-shipping-information.reducer.js +7 -17
- package/esm2015/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.js +1 -15
- package/esm2015/state/reducers/cart-state.interface.js +2 -21
- package/esm2015/state/reducers/cart-store-feature-key.js +1 -7
- package/esm2015/state/reducers/cart.reducer.js +1 -11
- package/esm2015/state/reducers/errors/cart-errors.type.js +2 -6
- package/esm2015/state/reducers/errors/error-state-helpers.js +5 -29
- package/esm2015/state/reducers/loading/cart-loading.type.js +3 -42
- package/esm2015/state/reducers/public_api.js +3 -8
- package/esm2015/state/reducers/token/extra.token.js +5 -21
- package/esm2015/state/reducers/token/public_api.js +1 -6
- package/esm2015/state/reducers/token/reducers.token.js +4 -13
- package/esm2015/state/selectors/cart/cart.selector.js +98 -811
- package/esm2015/state/selectors/cart-feature.selector.js +5 -28
- package/esm2015/state/selectors/cart-item-entities/cart-item-entities.selectors.js +29 -229
- package/esm2015/state/selectors/cart-order/cart-order.selector.js +15 -104
- package/esm2015/state/selectors/cart.selector.js +6 -30
- package/esm2015/state/selectors/public_api.js +2 -7
- package/esm2015/state/testing/cart-testing.module.js +1 -6
- package/esm2015/state/testing/daffodil-cart-state-testing.js +2 -7
- package/esm2015/state/testing/factories/stateful-cart-item.factory.js +2 -11
- package/esm2015/state/testing/factories/stateful-composite-cart-item.factory.js +2 -11
- package/esm2015/state/testing/factories/stateful-configurable-cart-item.factory.js +2 -11
- package/esm2015/state/testing/index.js +2 -7
- package/esm2015/state/testing/mock-cart-facade.js +2 -206
- package/esm2015/state/testing/public_api.js +4 -9
- package/esm2015/storage/cart-storage.service.js +2 -36
- package/esm2015/testing/daffodil-cart-testing.js +2 -7
- package/esm2015/testing/factories/cart-address.factory.js +2 -41
- package/esm2015/testing/factories/cart-coupon.factory.js +2 -17
- package/esm2015/testing/factories/cart-item/cart-item.factory.js +5 -51
- package/esm2015/testing/factories/cart-item/composite-cart-item.factory.js +2 -23
- package/esm2015/testing/factories/cart-item/configurable-cart-item.factory.js +2 -13
- package/esm2015/testing/factories/cart-payment.factory.js +2 -11
- package/esm2015/testing/factories/cart-shipping-rate.factory.js +2 -23
- package/esm2015/testing/factories/cart.factory.js +2 -35
- package/esm2015/testing/factories/public_api.js +4 -9
- package/esm2015/testing/index.js +2 -7
- package/esm2015/testing/public_api.js +2 -7
- package/fesm2015/daffodil-cart-driver-in-memory.js +108 -1228
- package/fesm2015/daffodil-cart-driver-in-memory.js.map +1 -1
- package/fesm2015/daffodil-cart-driver-magento-testing.js +12 -227
- package/fesm2015/daffodil-cart-driver-magento-testing.js.map +1 -1
- package/fesm2015/daffodil-cart-driver-magento.js +161 -1844
- package/fesm2015/daffodil-cart-driver-magento.js.map +1 -1
- package/fesm2015/daffodil-cart-driver-testing.js +24 -376
- package/fesm2015/daffodil-cart-driver-testing.js.map +1 -1
- package/fesm2015/daffodil-cart-driver.js +13 -493
- package/fesm2015/daffodil-cart-driver.js.map +1 -1
- package/fesm2015/daffodil-cart-routing.js +44 -498
- package/fesm2015/daffodil-cart-routing.js.map +1 -1
- package/fesm2015/daffodil-cart-state-testing.js +6 -256
- package/fesm2015/daffodil-cart-state-testing.js.map +1 -1
- package/fesm2015/daffodil-cart-state.js +403 -3921
- package/fesm2015/daffodil-cart-state.js.map +1 -1
- package/fesm2015/daffodil-cart-testing.js +13 -228
- package/fesm2015/daffodil-cart-testing.js.map +1 -1
- package/fesm2015/daffodil-cart.js +39 -532
- package/fesm2015/daffodil-cart.js.map +1 -1
- package/package.json +5 -5
- package/routing/package.json +1 -1
- package/state/package.json +1 -1
- package/state/testing/package.json +1 -1
- package/testing/package.json +1 -1
|
@@ -1,135 +1,74 @@
|
|
|
1
1
|
import { DaffInheritableError, DaffPersistenceServiceToken, DaffServerErrorStorageService } from '@daffodil/core';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, ɵɵdefineInjectable, ɵɵinject, PLATFORM_ID, Injectable } from '@angular/core';
|
|
3
3
|
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
4
4
|
import { isPlatformBrowser } from '@angular/common';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7
|
+
* An enum for the cart error codes.
|
|
8
|
+
* Each error code is unique to an error class.
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
CART_RESOLUTION
|
|
14
|
-
CART_STORAGE_RESOLUTION
|
|
15
|
-
CART_SERVER_SIDE_RESOLUTION
|
|
16
|
-
CART_NOT_FOUND_OR_CREATED_RESOLUTION
|
|
17
|
-
};
|
|
10
|
+
var DaffCartErrorCodes;
|
|
11
|
+
(function (DaffCartErrorCodes) {
|
|
12
|
+
DaffCartErrorCodes["CART_RESOLUTION"] = "DAFF_CART_RESOLUTION";
|
|
13
|
+
DaffCartErrorCodes["CART_STORAGE_RESOLUTION"] = "DAFF_CART_STORAGE_RESOLUTION";
|
|
14
|
+
DaffCartErrorCodes["CART_SERVER_SIDE_RESOLUTION"] = "DAFF_CART_SERVER_SIDE_RESOLUTION";
|
|
15
|
+
DaffCartErrorCodes["CART_NOT_FOUND_OR_CREATED_RESOLUTION"] = "DAFF_CART_NOT_FOUND_OR_CREATED_RESOLUTION";
|
|
16
|
+
})(DaffCartErrorCodes || (DaffCartErrorCodes = {}));
|
|
18
17
|
|
|
19
|
-
/**
|
|
20
|
-
* @fileoverview added by tsickle
|
|
21
|
-
* Generated from: errors/resolution/cart-resolution.ts
|
|
22
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
23
|
-
*/
|
|
24
18
|
/**
|
|
25
19
|
* An error thrown when the cart fails to resolve.
|
|
26
20
|
*
|
|
27
|
-
*
|
|
21
|
+
* @inheritdoc
|
|
28
22
|
*/
|
|
29
23
|
class DaffCartResolutionError extends DaffInheritableError {
|
|
30
|
-
/**
|
|
31
|
-
* @param {?=} message
|
|
32
|
-
*/
|
|
33
24
|
constructor(message) {
|
|
34
25
|
super(message);
|
|
35
26
|
this.code = DaffCartErrorCodes.CART_RESOLUTION;
|
|
36
27
|
}
|
|
37
28
|
}
|
|
38
|
-
if (false) {
|
|
39
|
-
/** @type {?} */
|
|
40
|
-
DaffCartResolutionError.prototype.code;
|
|
41
|
-
}
|
|
42
29
|
|
|
43
|
-
/**
|
|
44
|
-
* @fileoverview added by tsickle
|
|
45
|
-
* Generated from: errors/resolution/cart-not-found-or-created-resolution.ts
|
|
46
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
47
|
-
*/
|
|
48
30
|
/**
|
|
49
31
|
* An error thrown when the cart fails to resolve.
|
|
50
32
|
* This happens when the cart cannot be found and a new cart cannot be created.
|
|
51
33
|
*
|
|
52
|
-
*
|
|
34
|
+
* @inheritdoc
|
|
53
35
|
*/
|
|
54
36
|
class DaffCartNotFoundOrCreatedResolutionError extends DaffInheritableError {
|
|
55
|
-
/**
|
|
56
|
-
* @param {?=} message
|
|
57
|
-
*/
|
|
58
37
|
constructor(message) {
|
|
59
38
|
super(message);
|
|
60
39
|
this.code = DaffCartErrorCodes.CART_NOT_FOUND_OR_CREATED_RESOLUTION;
|
|
61
40
|
}
|
|
62
41
|
}
|
|
63
|
-
if (false) {
|
|
64
|
-
/** @type {?} */
|
|
65
|
-
DaffCartNotFoundOrCreatedResolutionError.prototype.code;
|
|
66
|
-
}
|
|
67
42
|
|
|
68
|
-
/**
|
|
69
|
-
* @fileoverview added by tsickle
|
|
70
|
-
* Generated from: errors/resolution/cart-server-side-resolution.ts
|
|
71
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
72
|
-
*/
|
|
73
43
|
/**
|
|
74
44
|
* An error thrown when the cart fails to resolve.
|
|
75
45
|
* This happens when the app is running in a server environment.
|
|
76
46
|
* This is normal and expected in SSR.
|
|
77
47
|
*
|
|
78
|
-
*
|
|
48
|
+
* @inheritdoc
|
|
79
49
|
*/
|
|
80
50
|
class DaffCartServerSideResolutionError extends DaffInheritableError {
|
|
81
|
-
/**
|
|
82
|
-
* @param {?=} message
|
|
83
|
-
*/
|
|
84
51
|
constructor(message) {
|
|
85
52
|
super(message);
|
|
86
53
|
this.code = DaffCartErrorCodes.CART_SERVER_SIDE_RESOLUTION;
|
|
87
54
|
}
|
|
88
55
|
}
|
|
89
|
-
if (false) {
|
|
90
|
-
/** @type {?} */
|
|
91
|
-
DaffCartServerSideResolutionError.prototype.code;
|
|
92
|
-
}
|
|
93
56
|
|
|
94
|
-
/**
|
|
95
|
-
* @fileoverview added by tsickle
|
|
96
|
-
* Generated from: errors/resolution/cart-storage-resolution.ts
|
|
97
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
98
|
-
*/
|
|
99
57
|
/**
|
|
100
58
|
* An error thrown when the cart fails to resolve.
|
|
101
59
|
* This happens when loading the cart ID from storage throws an exception.
|
|
102
60
|
*
|
|
103
|
-
*
|
|
61
|
+
* @inheritdoc
|
|
104
62
|
*/
|
|
105
63
|
class DaffCartStorageResolutionError extends DaffInheritableError {
|
|
106
|
-
/**
|
|
107
|
-
* @param {?=} message
|
|
108
|
-
*/
|
|
109
64
|
constructor(message) {
|
|
110
65
|
super(message);
|
|
111
66
|
this.code = DaffCartErrorCodes.CART_STORAGE_RESOLUTION;
|
|
112
67
|
}
|
|
113
68
|
}
|
|
114
|
-
if (false) {
|
|
115
|
-
/** @type {?} */
|
|
116
|
-
DaffCartStorageResolutionError.prototype.code;
|
|
117
|
-
}
|
|
118
69
|
|
|
119
|
-
/**
|
|
120
|
-
* @fileoverview added by tsickle
|
|
121
|
-
* Generated from: errors/resolution/public_api.ts
|
|
122
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @fileoverview added by tsickle
|
|
127
|
-
* Generated from: errors/map.ts
|
|
128
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
129
|
-
*/
|
|
130
70
|
/**
|
|
131
71
|
* A mapping from error codes to error class constructors.
|
|
132
|
-
* @type {?}
|
|
133
72
|
*/
|
|
134
73
|
const DaffCartErrorMap = {
|
|
135
74
|
[DaffCartErrorCodes.CART_RESOLUTION]: DaffCartResolutionError,
|
|
@@ -139,437 +78,48 @@ const DaffCartErrorMap = {
|
|
|
139
78
|
};
|
|
140
79
|
|
|
141
80
|
/**
|
|
142
|
-
*
|
|
143
|
-
* Generated from: errors/public_api.ts
|
|
144
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
81
|
+
* An enum for the type of the cart item.
|
|
145
82
|
*/
|
|
83
|
+
// TODO: remove "input" designation
|
|
84
|
+
var DaffCartItemInputType;
|
|
85
|
+
(function (DaffCartItemInputType) {
|
|
86
|
+
DaffCartItemInputType["Simple"] = "simple";
|
|
87
|
+
DaffCartItemInputType["Composite"] = "composite";
|
|
88
|
+
DaffCartItemInputType["Configurable"] = "configurable";
|
|
89
|
+
})(DaffCartItemInputType || (DaffCartItemInputType = {}));
|
|
146
90
|
|
|
147
91
|
/**
|
|
148
|
-
*
|
|
149
|
-
* Generated from: models/cart.ts
|
|
150
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
151
|
-
*/
|
|
152
|
-
/**
|
|
153
|
-
* A cart.
|
|
154
|
-
* Contains products in the form of cart items.
|
|
155
|
-
* Contains payment and shipping info used for checkout.
|
|
156
|
-
* @record
|
|
92
|
+
* An enum for the types of totals that can appear in a cart.
|
|
157
93
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
DaffCart.prototype.grand_total;
|
|
170
|
-
/**
|
|
171
|
-
* A list of coupons applied to the cart.
|
|
172
|
-
* @type {?}
|
|
173
|
-
*/
|
|
174
|
-
DaffCart.prototype.coupons;
|
|
175
|
-
/**
|
|
176
|
-
* A list of cart items.
|
|
177
|
-
* @type {?|undefined}
|
|
178
|
-
*/
|
|
179
|
-
DaffCart.prototype.items;
|
|
180
|
-
/**
|
|
181
|
-
* The billing address of the cart.
|
|
182
|
-
* @type {?}
|
|
183
|
-
*/
|
|
184
|
-
DaffCart.prototype.billing_address;
|
|
185
|
-
/**
|
|
186
|
-
* The shipping address of the cart.
|
|
187
|
-
* @type {?}
|
|
188
|
-
*/
|
|
189
|
-
DaffCart.prototype.shipping_address;
|
|
190
|
-
/**
|
|
191
|
-
* The selected payment method of the cart.
|
|
192
|
-
* @type {?|undefined}
|
|
193
|
-
*/
|
|
194
|
-
DaffCart.prototype.payment;
|
|
195
|
-
/**
|
|
196
|
-
* A list of totals for the cart.
|
|
197
|
-
* @type {?}
|
|
198
|
-
*/
|
|
199
|
-
DaffCart.prototype.totals;
|
|
200
|
-
/**
|
|
201
|
-
* The selected shipping method.
|
|
202
|
-
* @type {?}
|
|
203
|
-
*/
|
|
204
|
-
DaffCart.prototype.shipping_information;
|
|
205
|
-
/**
|
|
206
|
-
* A list of available shipping methods.
|
|
207
|
-
* @type {?}
|
|
208
|
-
*/
|
|
209
|
-
DaffCart.prototype.available_shipping_methods;
|
|
210
|
-
/**
|
|
211
|
-
* A list of available payment methods.
|
|
212
|
-
* @type {?}
|
|
213
|
-
*/
|
|
214
|
-
DaffCart.prototype.available_payment_methods;
|
|
215
|
-
/**
|
|
216
|
-
* The field is set to the platform cart object returned by the most recent driver call.
|
|
217
|
-
* No fields are guaranteed here. Use this with care.
|
|
218
|
-
* @type {?|undefined}
|
|
219
|
-
*/
|
|
220
|
-
DaffCart.prototype.extra_attributes;
|
|
221
|
-
}
|
|
94
|
+
var DaffCartTotalTypeEnum;
|
|
95
|
+
(function (DaffCartTotalTypeEnum) {
|
|
96
|
+
DaffCartTotalTypeEnum["grandTotal"] = "grand_total";
|
|
97
|
+
DaffCartTotalTypeEnum["subtotalExcludingTax"] = "subtotal_excluding_tax";
|
|
98
|
+
DaffCartTotalTypeEnum["subtotalIncludingTax"] = "subtotal_including_tax";
|
|
99
|
+
DaffCartTotalTypeEnum["subtotalWithDiscountExcludingTax"] = "subtotal_with_discount_excluding_tax";
|
|
100
|
+
DaffCartTotalTypeEnum["subtotalWithDiscountIncludingTax"] = "subtotal_with_discount_including_tax";
|
|
101
|
+
DaffCartTotalTypeEnum["discount"] = "discount";
|
|
102
|
+
DaffCartTotalTypeEnum["tax"] = "tax";
|
|
103
|
+
DaffCartTotalTypeEnum["shipping"] = "shipping";
|
|
104
|
+
})(DaffCartTotalTypeEnum || (DaffCartTotalTypeEnum = {}));
|
|
222
105
|
|
|
223
|
-
/**
|
|
224
|
-
* @fileoverview added by tsickle
|
|
225
|
-
* Generated from: models/cart-item.ts
|
|
226
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
227
|
-
*/
|
|
228
|
-
/**
|
|
229
|
-
* A discount applied to a specific cart item.
|
|
230
|
-
* @record
|
|
231
|
-
*/
|
|
232
|
-
function DaffCartItemDiscount() { }
|
|
233
|
-
if (false) {
|
|
234
|
-
/**
|
|
235
|
-
* The amount of the discount.
|
|
236
|
-
* @type {?}
|
|
237
|
-
*/
|
|
238
|
-
DaffCartItemDiscount.prototype.amount;
|
|
239
|
-
/**
|
|
240
|
-
* A human-readable label describing the discount.
|
|
241
|
-
* @type {?}
|
|
242
|
-
*/
|
|
243
|
-
DaffCartItemDiscount.prototype.label;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* A cart item.
|
|
247
|
-
* Cart item types correspond to product types.
|
|
248
|
-
* They hold information about the product to which they correspond and how many of said product is in the cart.
|
|
249
|
-
* @record
|
|
250
|
-
*/
|
|
251
|
-
function DaffCartItem() { }
|
|
252
|
-
if (false) {
|
|
253
|
-
/**
|
|
254
|
-
* @deprecated use id instead.
|
|
255
|
-
* @type {?}
|
|
256
|
-
*/
|
|
257
|
-
DaffCartItem.prototype.item_id;
|
|
258
|
-
/**
|
|
259
|
-
* The type of cart item.
|
|
260
|
-
* @type {?}
|
|
261
|
-
*/
|
|
262
|
-
DaffCartItem.prototype.type;
|
|
263
|
-
/**
|
|
264
|
-
* The image or thumbnail of the corresponding product.
|
|
265
|
-
* @type {?|undefined}
|
|
266
|
-
*/
|
|
267
|
-
DaffCartItem.prototype.image;
|
|
268
|
-
/**
|
|
269
|
-
* The ID of the corresponding product.
|
|
270
|
-
* @type {?}
|
|
271
|
-
*/
|
|
272
|
-
DaffCartItem.prototype.product_id;
|
|
273
|
-
/** @type {?} */
|
|
274
|
-
DaffCartItem.prototype.parent_item_id;
|
|
275
|
-
/** @type {?} */
|
|
276
|
-
DaffCartItem.prototype.sku;
|
|
277
|
-
/**
|
|
278
|
-
* A human-readable label.
|
|
279
|
-
* @type {?}
|
|
280
|
-
*/
|
|
281
|
-
DaffCartItem.prototype.name;
|
|
282
|
-
/**
|
|
283
|
-
* How many of the corresponding product is in the cart.
|
|
284
|
-
* @type {?}
|
|
285
|
-
*/
|
|
286
|
-
DaffCartItem.prototype.qty;
|
|
287
|
-
/**
|
|
288
|
-
* The price per item, excluding cart discounts.
|
|
289
|
-
* This includes any discounts and sales that apply to the product or category.
|
|
290
|
-
* @type {?}
|
|
291
|
-
*/
|
|
292
|
-
DaffCartItem.prototype.price;
|
|
293
|
-
/**
|
|
294
|
-
* The total for the entire row, not including cart discounts.
|
|
295
|
-
* This includes any discounts and sales that apply to the product or category.
|
|
296
|
-
* @type {?}
|
|
297
|
-
*/
|
|
298
|
-
DaffCartItem.prototype.row_total;
|
|
299
|
-
/**
|
|
300
|
-
* Whether or not the specified quantity of the corresponding product is in stock.
|
|
301
|
-
* @type {?}
|
|
302
|
-
*/
|
|
303
|
-
DaffCartItem.prototype.in_stock;
|
|
304
|
-
/**
|
|
305
|
-
* A list of discounts applied to the cart item row.
|
|
306
|
-
* @type {?}
|
|
307
|
-
*/
|
|
308
|
-
DaffCartItem.prototype.discounts;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* @fileoverview added by tsickle
|
|
313
|
-
* Generated from: models/composite-cart-item.ts
|
|
314
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
315
|
-
*/
|
|
316
|
-
/**
|
|
317
|
-
* A cart item for a composite product.
|
|
318
|
-
* @record
|
|
319
|
-
*/
|
|
320
|
-
function DaffCompositeCartItem() { }
|
|
321
|
-
if (false) {
|
|
322
|
-
/**
|
|
323
|
-
* A list of composite cart item options.
|
|
324
|
-
* @type {?}
|
|
325
|
-
*/
|
|
326
|
-
DaffCompositeCartItem.prototype.options;
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* A composite product option in a cart item.
|
|
330
|
-
* @record
|
|
331
|
-
*/
|
|
332
|
-
function DaffCompositeCartItemOption() { }
|
|
333
|
-
if (false) {
|
|
334
|
-
/**
|
|
335
|
-
* @deprecated use id instead.
|
|
336
|
-
* @type {?}
|
|
337
|
-
*/
|
|
338
|
-
DaffCompositeCartItemOption.prototype.option_id;
|
|
339
|
-
/**
|
|
340
|
-
* A human-readable label for the option.
|
|
341
|
-
* @type {?}
|
|
342
|
-
*/
|
|
343
|
-
DaffCompositeCartItemOption.prototype.option_label;
|
|
344
|
-
/**
|
|
345
|
-
* A human-readable label for the particular value chosen for the option.
|
|
346
|
-
* @type {?}
|
|
347
|
-
*/
|
|
348
|
-
DaffCompositeCartItemOption.prototype.value_label;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* @fileoverview added by tsickle
|
|
353
|
-
* Generated from: models/configurable-cart-item.ts
|
|
354
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
355
|
-
*/
|
|
356
|
-
/**
|
|
357
|
-
* A cart item for a configurable product.
|
|
358
|
-
* @record
|
|
359
|
-
*/
|
|
360
|
-
function DaffConfigurableCartItem() { }
|
|
361
|
-
if (false) {
|
|
362
|
-
/**
|
|
363
|
-
* A list of the chosen configurable attributes.
|
|
364
|
-
* @type {?}
|
|
365
|
-
*/
|
|
366
|
-
DaffConfigurableCartItem.prototype.attributes;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Defines a selected attribute for a configurable cart item.
|
|
370
|
-
* @record
|
|
371
|
-
*/
|
|
372
|
-
function DaffConfigurableCartItemAttribute() { }
|
|
373
|
-
if (false) {
|
|
374
|
-
/**
|
|
375
|
-
* A human-readable label for the attribute.
|
|
376
|
-
* @type {?}
|
|
377
|
-
*/
|
|
378
|
-
DaffConfigurableCartItemAttribute.prototype.attribute_label;
|
|
379
|
-
/**
|
|
380
|
-
* A human-readable label for the particular value chosen for the attribute.
|
|
381
|
-
* @type {?}
|
|
382
|
-
*/
|
|
383
|
-
DaffConfigurableCartItemAttribute.prototype.value_label;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* @fileoverview added by tsickle
|
|
388
|
-
* Generated from: models/cart-item-input.ts
|
|
389
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
390
|
-
*/
|
|
391
|
-
/** @enum {string} */
|
|
392
|
-
const DaffCartItemInputType = {
|
|
393
|
-
Simple: "simple",
|
|
394
|
-
Composite: "composite",
|
|
395
|
-
Configurable: "configurable",
|
|
396
|
-
};
|
|
397
|
-
/**
|
|
398
|
-
* A set of fields specifying how to add a product to the cart.
|
|
399
|
-
* @record
|
|
400
|
-
*/
|
|
401
|
-
function DaffCartItemInput() { }
|
|
402
|
-
if (false) {
|
|
403
|
-
/**
|
|
404
|
-
* The type of cart item that corresponds to the product being added to the cart.
|
|
405
|
-
* @type {?}
|
|
406
|
-
*/
|
|
407
|
-
DaffCartItemInput.prototype.type;
|
|
408
|
-
/**
|
|
409
|
-
* The ID of the product to add to the cart.
|
|
410
|
-
* @type {?}
|
|
411
|
-
*/
|
|
412
|
-
DaffCartItemInput.prototype.productId;
|
|
413
|
-
/**
|
|
414
|
-
* How many of the product should be added to the cart.
|
|
415
|
-
* @type {?}
|
|
416
|
-
*/
|
|
417
|
-
DaffCartItemInput.prototype.qty;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* A more constrained cart item input for simple products.
|
|
421
|
-
* @record
|
|
422
|
-
*/
|
|
423
|
-
function DaffSimpleCartItemInput() { }
|
|
424
|
-
if (false) {
|
|
425
|
-
/** @type {?} */
|
|
426
|
-
DaffSimpleCartItemInput.prototype.type;
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* A cart item input for composite products.
|
|
430
|
-
* @record
|
|
431
|
-
*/
|
|
432
|
-
function DaffCompositeCartItemInput() { }
|
|
433
|
-
if (false) {
|
|
434
|
-
/** @type {?} */
|
|
435
|
-
DaffCompositeCartItemInput.prototype.type;
|
|
436
|
-
/**
|
|
437
|
-
* The selected options for the composite product to be added to the cart.
|
|
438
|
-
* @type {?}
|
|
439
|
-
*/
|
|
440
|
-
DaffCompositeCartItemInput.prototype.options;
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* Designates a particular option for the composite product to add to the cart.
|
|
444
|
-
* @record
|
|
445
|
-
*/
|
|
446
|
-
function DaffCompositeCartItemInputOption() { }
|
|
447
|
-
if (false) {
|
|
448
|
-
/**
|
|
449
|
-
* An identifier of the option for which a value has been chosen.
|
|
450
|
-
* @type {?}
|
|
451
|
-
*/
|
|
452
|
-
DaffCompositeCartItemInputOption.prototype.code;
|
|
453
|
-
/**
|
|
454
|
-
* How many of the specified option should be added to the cart.
|
|
455
|
-
* @type {?}
|
|
456
|
-
*/
|
|
457
|
-
DaffCompositeCartItemInputOption.prototype.quantity;
|
|
458
|
-
/**
|
|
459
|
-
* The value identifying the chosen composite product option.
|
|
460
|
-
* @type {?}
|
|
461
|
-
*/
|
|
462
|
-
DaffCompositeCartItemInputOption.prototype.value;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Designates a particular configurable product variant to add to the cart.
|
|
466
|
-
* @record
|
|
467
|
-
*/
|
|
468
|
-
function DaffConfigurableCartItemInput() { }
|
|
469
|
-
if (false) {
|
|
470
|
-
/** @type {?} */
|
|
471
|
-
DaffConfigurableCartItemInput.prototype.type;
|
|
472
|
-
/**
|
|
473
|
-
* The value identifying the particular configurable product variant.
|
|
474
|
-
* @type {?}
|
|
475
|
-
*/
|
|
476
|
-
DaffConfigurableCartItemInput.prototype.variantId;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* @fileoverview added by tsickle
|
|
481
|
-
* Generated from: models/cart-total.ts
|
|
482
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
483
|
-
*/
|
|
484
|
-
/** @enum {string} */
|
|
485
|
-
const DaffCartTotalTypeEnum = {
|
|
486
|
-
grandTotal: "grand_total",
|
|
487
|
-
subtotalExcludingTax: "subtotal_excluding_tax",
|
|
488
|
-
subtotalIncludingTax: "subtotal_including_tax",
|
|
489
|
-
subtotalWithDiscountExcludingTax: "subtotal_with_discount_excluding_tax",
|
|
490
|
-
subtotalWithDiscountIncludingTax: "subtotal_with_discount_including_tax",
|
|
491
|
-
discount: "discount",
|
|
492
|
-
tax: "tax",
|
|
493
|
-
shipping: "shipping",
|
|
494
|
-
};
|
|
495
|
-
/**
|
|
496
|
-
* Since some cart totals might not have a value defined at all times, like shipping, the values of these totals
|
|
497
|
-
* can be null. Allowing their values to be null differentiates a non-existent value from a zero value. In the case of
|
|
498
|
-
* shipping, this would mean the difference between a cart with no selected shipping method and a cart with a selected shipping
|
|
499
|
-
* method that costs zero.
|
|
500
|
-
* @record
|
|
501
|
-
*/
|
|
502
|
-
function DaffCartTotal() { }
|
|
503
|
-
if (false) {
|
|
504
|
-
/**
|
|
505
|
-
* The amount of the total.
|
|
506
|
-
* @type {?}
|
|
507
|
-
*/
|
|
508
|
-
DaffCartTotal.prototype.value;
|
|
509
|
-
/**
|
|
510
|
-
* A human-readable label of the total.
|
|
511
|
-
* @type {?}
|
|
512
|
-
*/
|
|
513
|
-
DaffCartTotal.prototype.label;
|
|
514
|
-
/**
|
|
515
|
-
* The type of the total.
|
|
516
|
-
* @type {?}
|
|
517
|
-
*/
|
|
518
|
-
DaffCartTotal.prototype.name;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* @fileoverview added by tsickle
|
|
523
|
-
* Generated from: models/public_api.ts
|
|
524
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
525
|
-
*/
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
* @fileoverview added by tsickle
|
|
529
|
-
* Generated from: injection-tokens/payment-method-map.ts
|
|
530
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
531
|
-
*/
|
|
532
|
-
// TODO: refactor to upper snake case
|
|
533
106
|
/**
|
|
534
107
|
* An injection token for a mapping from the platform-specific cart payment method
|
|
535
108
|
* to a user-defined platform-agnostic payment ID.
|
|
536
109
|
* It should be an object whose keys are the cart payment's method and whose values are strings.
|
|
537
110
|
* Defaults to an empty object.
|
|
538
|
-
* @type {?}
|
|
539
111
|
*/
|
|
112
|
+
// TODO: refactor to upper snake case
|
|
540
113
|
const DaffCartPaymentMethodIdMap = new InjectionToken('DaffCartPaymentMethodIdMap', {
|
|
541
|
-
factory: (
|
|
542
|
-
* @return {?}
|
|
543
|
-
*/
|
|
544
|
-
() => ({})),
|
|
114
|
+
factory: () => ({}),
|
|
545
115
|
});
|
|
546
116
|
|
|
547
|
-
/**
|
|
548
|
-
* @fileoverview added by tsickle
|
|
549
|
-
* Generated from: injection-tokens/error-matcher.token.ts
|
|
550
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
551
|
-
*/
|
|
552
117
|
/**
|
|
553
118
|
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
554
119
|
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
555
|
-
* @type {?}
|
|
556
|
-
*/
|
|
557
|
-
const DAFF_CART_ERROR_MATCHER = new InjectionToken('DAFF_CART_ERROR_MATCHER', { factory: (/**
|
|
558
|
-
* @return {?}
|
|
559
|
-
*/
|
|
560
|
-
() => daffTransformErrorToStateError) });
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* @fileoverview added by tsickle
|
|
564
|
-
* Generated from: injection-tokens/public_api.ts
|
|
565
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
566
120
|
*/
|
|
121
|
+
const DAFF_CART_ERROR_MATCHER = new InjectionToken('DAFF_CART_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
567
122
|
|
|
568
|
-
/**
|
|
569
|
-
* @fileoverview added by tsickle
|
|
570
|
-
* Generated from: storage/cart-storage.service.ts
|
|
571
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
572
|
-
*/
|
|
573
123
|
/**
|
|
574
124
|
* The DaffCartStorageService is responsible for storing the cart id of a customer
|
|
575
125
|
* in storage when necessary. For some ecommerce platforms, where cart information
|
|
@@ -578,33 +128,21 @@ const DAFF_CART_ERROR_MATCHER = new InjectionToken('DAFF_CART_ERROR_MATCHER', {
|
|
|
578
128
|
* layer for platforms that require it.
|
|
579
129
|
*/
|
|
580
130
|
class DaffCartStorageService {
|
|
581
|
-
/**
|
|
582
|
-
* @param {?} storageService
|
|
583
|
-
*/
|
|
584
131
|
constructor(storageService) {
|
|
585
132
|
this.storageService = storageService;
|
|
586
133
|
this.CART_STORAGE_ID = 'DAFF_CART_ID';
|
|
587
134
|
}
|
|
588
|
-
/**
|
|
589
|
-
* @return {?}
|
|
590
|
-
*/
|
|
591
135
|
getCartId() {
|
|
592
136
|
return this.storageService.getItem(this.CART_STORAGE_ID);
|
|
593
137
|
}
|
|
594
|
-
/**
|
|
595
|
-
* @param {?} value
|
|
596
|
-
* @return {?}
|
|
597
|
-
*/
|
|
598
138
|
setCartId(value) {
|
|
599
139
|
this.storageService.setItem(this.CART_STORAGE_ID, value);
|
|
600
140
|
}
|
|
601
|
-
/**
|
|
602
|
-
* @return {?}
|
|
603
|
-
*/
|
|
604
141
|
removeCartId() {
|
|
605
142
|
this.storageService.removeItem(this.CART_STORAGE_ID);
|
|
606
143
|
}
|
|
607
144
|
}
|
|
145
|
+
/** @nocollapse */ DaffCartStorageService.ɵprov = ɵɵdefineInjectable({ factory: function DaffCartStorageService_Factory() { return daffCartStorageServiceFactory(ɵɵinject(PLATFORM_ID), ɵɵinject(DaffPersistenceServiceToken), ɵɵinject(DaffServerErrorStorageService)); }, token: DaffCartStorageService, providedIn: "root" });
|
|
608
146
|
DaffCartStorageService.decorators = [
|
|
609
147
|
{ type: Injectable, args: [{
|
|
610
148
|
providedIn: 'root',
|
|
@@ -620,25 +158,8 @@ DaffCartStorageService.decorators = [
|
|
|
620
158
|
DaffCartStorageService.ctorParameters = () => [
|
|
621
159
|
{ type: undefined }
|
|
622
160
|
];
|
|
623
|
-
/** @nocollapse */ DaffCartStorageService.ɵprov = ɵɵdefineInjectable({ factory: function DaffCartStorageService_Factory() { return daffCartStorageServiceFactory(ɵɵinject(PLATFORM_ID), ɵɵinject(DaffPersistenceServiceToken), ɵɵinject(DaffServerErrorStorageService)); }, token: DaffCartStorageService, providedIn: "root" });
|
|
624
|
-
if (false) {
|
|
625
|
-
/**
|
|
626
|
-
* @type {?}
|
|
627
|
-
* @private
|
|
628
|
-
*/
|
|
629
|
-
DaffCartStorageService.prototype.CART_STORAGE_ID;
|
|
630
|
-
/**
|
|
631
|
-
* @type {?}
|
|
632
|
-
* @private
|
|
633
|
-
*/
|
|
634
|
-
DaffCartStorageService.prototype.storageService;
|
|
635
|
-
}
|
|
636
161
|
/**
|
|
637
162
|
* The factory that describe construction of a DaffCartStorageService
|
|
638
|
-
* @param {?} platformId
|
|
639
|
-
* @param {?} persistenceService
|
|
640
|
-
* @param {?} serverStorage
|
|
641
|
-
* @return {?}
|
|
642
163
|
*/
|
|
643
164
|
function daffCartStorageServiceFactory(platformId, persistenceService, serverStorage) {
|
|
644
165
|
return isPlatformBrowser(platformId)
|
|
@@ -647,21 +168,7 @@ function daffCartStorageServiceFactory(platformId, persistenceService, serverSto
|
|
|
647
168
|
}
|
|
648
169
|
|
|
649
170
|
/**
|
|
650
|
-
*
|
|
651
|
-
* Generated from: public_api.ts
|
|
652
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
653
|
-
*/
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* @fileoverview added by tsickle
|
|
657
|
-
* Generated from: index.ts
|
|
658
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
659
|
-
*/
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* @fileoverview added by tsickle
|
|
663
|
-
* Generated from: daffodil-cart.ts
|
|
664
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
171
|
+
* Generated bundle index. Do not edit.
|
|
665
172
|
*/
|
|
666
173
|
|
|
667
174
|
export { DAFF_CART_ERROR_MATCHER, DaffCartErrorCodes, DaffCartErrorMap, DaffCartItemInputType, DaffCartNotFoundOrCreatedResolutionError, DaffCartPaymentMethodIdMap, DaffCartResolutionError, DaffCartServerSideResolutionError, DaffCartStorageResolutionError, DaffCartStorageService, DaffCartTotalTypeEnum, daffCartStorageServiceFactory as ɵa };
|