@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,54 +1,32 @@
|
|
|
1
|
-
import { InjectionToken,
|
|
1
|
+
import { InjectionToken, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, NgModule } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import { take, tap, filter, map } from 'rxjs/operators';
|
|
4
4
|
import { DaffCartFacade, DaffCartResolveState, DaffResolveCart, DaffCartActionTypes } from '@daffodil/cart/state';
|
|
5
5
|
import { Store, ActionsSubject } from '@ngrx/store';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview added by tsickle
|
|
9
|
-
* Generated from: guards/billing-address/billing-address-guard-redirect.token.ts
|
|
10
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
-
*/
|
|
12
|
-
/** @type {?} */
|
|
13
7
|
const DaffCartBillingAddressGuardRedirectUrl = new InjectionToken('DaffCartBillingAddressGuardRedirectUrl');
|
|
14
8
|
|
|
15
|
-
/**
|
|
16
|
-
* @fileoverview added by tsickle
|
|
17
|
-
* Generated from: guards/billing-address/billing-address.guard.ts
|
|
18
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
19
|
-
*/
|
|
20
9
|
/**
|
|
21
10
|
* A routing guard that will redirect to a given url if the billing address on the cart is not defined.
|
|
22
11
|
* The url is `/` by default, but can be overridden with the DaffCartBillingAddressGuardRedirectUrl injection token.
|
|
23
12
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
24
|
-
* Ensure that the cart is resolved prior to running this guard with the {
|
|
13
|
+
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
25
14
|
*/
|
|
26
15
|
class DaffBillingAddressGuard {
|
|
27
|
-
/**
|
|
28
|
-
* @param {?} facade
|
|
29
|
-
* @param {?} router
|
|
30
|
-
* @param {?} redirectUrl
|
|
31
|
-
*/
|
|
32
16
|
constructor(facade, router, redirectUrl) {
|
|
33
17
|
this.facade = facade;
|
|
34
18
|
this.router = router;
|
|
35
19
|
this.redirectUrl = redirectUrl;
|
|
36
20
|
}
|
|
37
|
-
/**
|
|
38
|
-
* @return {?}
|
|
39
|
-
*/
|
|
40
21
|
canActivate() {
|
|
41
|
-
return this.facade.hasBillingAddress$.pipe(take(1), tap(
|
|
42
|
-
* @param {?} hasBillingAddress
|
|
43
|
-
* @return {?}
|
|
44
|
-
*/
|
|
45
|
-
hasBillingAddress => {
|
|
22
|
+
return this.facade.hasBillingAddress$.pipe(take(1), tap(hasBillingAddress => {
|
|
46
23
|
if (!hasBillingAddress) {
|
|
47
24
|
this.router.navigateByUrl(this.redirectUrl);
|
|
48
25
|
}
|
|
49
|
-
}))
|
|
26
|
+
}));
|
|
50
27
|
}
|
|
51
28
|
}
|
|
29
|
+
/** @nocollapse */ DaffBillingAddressGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffBillingAddressGuard_Factory() { return new DaffBillingAddressGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartBillingAddressGuardRedirectUrl)); }, token: DaffBillingAddressGuard, providedIn: "root" });
|
|
52
30
|
DaffBillingAddressGuard.decorators = [
|
|
53
31
|
{ type: Injectable, args: [{
|
|
54
32
|
providedIn: 'root',
|
|
@@ -60,134 +38,53 @@ DaffBillingAddressGuard.ctorParameters = () => [
|
|
|
60
38
|
{ type: Router },
|
|
61
39
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartBillingAddressGuardRedirectUrl,] }] }
|
|
62
40
|
];
|
|
63
|
-
/** @nocollapse */ DaffBillingAddressGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffBillingAddressGuard_Factory() { return new DaffBillingAddressGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartBillingAddressGuardRedirectUrl)); }, token: DaffBillingAddressGuard, providedIn: "root" });
|
|
64
|
-
if (false) {
|
|
65
|
-
/**
|
|
66
|
-
* @type {?}
|
|
67
|
-
* @private
|
|
68
|
-
*/
|
|
69
|
-
DaffBillingAddressGuard.prototype.facade;
|
|
70
|
-
/**
|
|
71
|
-
* @type {?}
|
|
72
|
-
* @private
|
|
73
|
-
*/
|
|
74
|
-
DaffBillingAddressGuard.prototype.router;
|
|
75
|
-
/**
|
|
76
|
-
* @type {?}
|
|
77
|
-
* @private
|
|
78
|
-
*/
|
|
79
|
-
DaffBillingAddressGuard.prototype.redirectUrl;
|
|
80
|
-
}
|
|
81
41
|
|
|
82
|
-
/**
|
|
83
|
-
* @fileoverview added by tsickle
|
|
84
|
-
* Generated from: config/resolution/config.ts
|
|
85
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
86
|
-
*/
|
|
87
|
-
/**
|
|
88
|
-
* An object that describes the resolution configuration of the cart state package.
|
|
89
|
-
* @record
|
|
90
|
-
*/
|
|
91
|
-
function DaffCartRoutingResolutionConfiguration() { }
|
|
92
|
-
if (false) {
|
|
93
|
-
/**
|
|
94
|
-
* When Daffodil fails to resolve a cart, you should navigate your users to
|
|
95
|
-
* a page that is outside the scope of resolution. The `failedResolutionPath` allows you
|
|
96
|
-
* to control where to navigate your users to when resolution fails.
|
|
97
|
-
* @type {?}
|
|
98
|
-
*/
|
|
99
|
-
DaffCartRoutingResolutionConfiguration.prototype.failedResolutionPath;
|
|
100
|
-
}
|
|
101
42
|
;
|
|
102
43
|
/**
|
|
103
44
|
* The default values of the resolution slice of the cart state configuration.
|
|
104
|
-
* @type {?}
|
|
105
45
|
*/
|
|
106
46
|
const daffCartRoutingResolutionConfigurationDefault = {
|
|
107
47
|
failedResolutionPath: null,
|
|
108
48
|
};
|
|
109
49
|
|
|
110
50
|
/**
|
|
111
|
-
*
|
|
112
|
-
* Generated from: config/config.ts
|
|
113
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
114
|
-
*/
|
|
115
|
-
/**
|
|
116
|
-
* An object that describes the configuration of the`\@daffodil/cart/state` package.
|
|
117
|
-
* @record
|
|
118
|
-
*/
|
|
119
|
-
function DaffCartRoutingConfiguration() { }
|
|
120
|
-
if (false) {
|
|
121
|
-
/** @type {?} */
|
|
122
|
-
DaffCartRoutingConfiguration.prototype.resolution;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* The default values of the `\@daffodil/cart/state` state configuration.
|
|
126
|
-
* @type {?}
|
|
51
|
+
* The default values of the `@daffodil/cart/state` state configuration.
|
|
127
52
|
*/
|
|
128
53
|
const daffCartRoutingConfigurationDefault = {
|
|
129
54
|
resolution: Object.assign({}, daffCartRoutingResolutionConfigurationDefault),
|
|
130
55
|
};
|
|
131
56
|
/**
|
|
132
57
|
* The token holding the runtime configuration for the behavior of the
|
|
133
|
-
*
|
|
134
|
-
* @type {?}
|
|
58
|
+
* `@daffodil/cart/state` package.
|
|
135
59
|
*/
|
|
136
60
|
const DAFF_CART_ROUTING_CONFIG = new InjectionToken('DAFF_CART_ROUTING_CONFIG', {
|
|
137
61
|
providedIn: 'root',
|
|
138
|
-
factory: (
|
|
139
|
-
* @return {?}
|
|
140
|
-
*/
|
|
141
|
-
() => daffCartRoutingConfigurationDefault),
|
|
62
|
+
factory: () => daffCartRoutingConfigurationDefault,
|
|
142
63
|
});
|
|
143
64
|
|
|
144
|
-
/**
|
|
145
|
-
* @fileoverview added by tsickle
|
|
146
|
-
* Generated from: guards/resolved-cart/resolved-cart.guard.ts
|
|
147
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
148
|
-
*/
|
|
149
65
|
/**
|
|
150
66
|
* A routing guard that will optionally redirect to a given url if the cart is not properly resolved.
|
|
151
67
|
* It will initiate cart resolution.
|
|
152
68
|
* The url has no default and the guard will not redirect if no value is specified.
|
|
153
|
-
* Specify a redirect path with the {
|
|
69
|
+
* Specify a redirect path with the {@link DaffResolvedCartGuardRedirectUrl} injection token.
|
|
154
70
|
* The guard will wait until the cart has been resolved before performing the check and emitting.
|
|
155
71
|
*/
|
|
156
72
|
class DaffResolvedCartGuard {
|
|
157
|
-
/**
|
|
158
|
-
* @param {?} facade
|
|
159
|
-
* @param {?} router
|
|
160
|
-
* @param {?} config
|
|
161
|
-
*/
|
|
162
73
|
constructor(facade, router, config) {
|
|
163
74
|
this.facade = facade;
|
|
164
75
|
this.router = router;
|
|
165
76
|
this.config = config;
|
|
166
77
|
}
|
|
167
|
-
/**
|
|
168
|
-
* @return {?}
|
|
169
|
-
*/
|
|
170
78
|
canActivate() {
|
|
171
|
-
return this.facade.resolved$.pipe(filter(
|
|
172
|
-
* @param {?} resolvedState
|
|
173
|
-
* @return {?}
|
|
174
|
-
*/
|
|
175
|
-
resolvedState => resolvedState === DaffCartResolveState.Succeeded ||
|
|
79
|
+
return this.facade.resolved$.pipe(filter(resolvedState => resolvedState === DaffCartResolveState.Succeeded ||
|
|
176
80
|
resolvedState === DaffCartResolveState.ServerSide ||
|
|
177
|
-
resolvedState === DaffCartResolveState.Failed)
|
|
178
|
-
|
|
179
|
-
* @return {?}
|
|
180
|
-
*/
|
|
181
|
-
resolvedState => resolvedState === DaffCartResolveState.Succeeded ||
|
|
182
|
-
resolvedState === DaffCartResolveState.ServerSide)), take(1), map((/**
|
|
183
|
-
* @param {?} success
|
|
184
|
-
* @return {?}
|
|
185
|
-
*/
|
|
186
|
-
success => !success && this.config.resolution.failedResolutionPath
|
|
81
|
+
resolvedState === DaffCartResolveState.Failed), map(resolvedState => resolvedState === DaffCartResolveState.Succeeded ||
|
|
82
|
+
resolvedState === DaffCartResolveState.ServerSide), take(1), map(success => !success && this.config.resolution.failedResolutionPath
|
|
187
83
|
? this.router.parseUrl(this.config.resolution.failedResolutionPath)
|
|
188
|
-
: success))
|
|
84
|
+
: success));
|
|
189
85
|
}
|
|
190
86
|
}
|
|
87
|
+
/** @nocollapse */ DaffResolvedCartGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffResolvedCartGuard_Factory() { return new DaffResolvedCartGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DAFF_CART_ROUTING_CONFIG)); }, token: DaffResolvedCartGuard, providedIn: "root" });
|
|
191
88
|
DaffResolvedCartGuard.decorators = [
|
|
192
89
|
{ type: Injectable, args: [{
|
|
193
90
|
providedIn: 'root',
|
|
@@ -199,78 +96,34 @@ DaffResolvedCartGuard.ctorParameters = () => [
|
|
|
199
96
|
{ type: Router },
|
|
200
97
|
{ type: undefined, decorators: [{ type: Inject, args: [DAFF_CART_ROUTING_CONFIG,] }] }
|
|
201
98
|
];
|
|
202
|
-
/** @nocollapse */ DaffResolvedCartGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffResolvedCartGuard_Factory() { return new DaffResolvedCartGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DAFF_CART_ROUTING_CONFIG)); }, token: DaffResolvedCartGuard, providedIn: "root" });
|
|
203
|
-
if (false) {
|
|
204
|
-
/**
|
|
205
|
-
* @type {?}
|
|
206
|
-
* @private
|
|
207
|
-
*/
|
|
208
|
-
DaffResolvedCartGuard.prototype.facade;
|
|
209
|
-
/**
|
|
210
|
-
* @type {?}
|
|
211
|
-
* @private
|
|
212
|
-
*/
|
|
213
|
-
DaffResolvedCartGuard.prototype.router;
|
|
214
|
-
/**
|
|
215
|
-
* @type {?}
|
|
216
|
-
* @private
|
|
217
|
-
*/
|
|
218
|
-
DaffResolvedCartGuard.prototype.config;
|
|
219
|
-
}
|
|
220
99
|
|
|
221
100
|
/**
|
|
222
|
-
* @
|
|
223
|
-
* Generated from: guards/cart-items/cart-items-guard-redirect.token.ts
|
|
224
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
225
|
-
*/
|
|
226
|
-
/**
|
|
227
|
-
* The path to which the user should be redirected if the cart has no items when {\@link DaffCartItemsGuard} is invoked.
|
|
228
|
-
* @type {?}
|
|
101
|
+
* The path to which the user should be redirected if the cart has no items when {@link DaffCartItemsGuard} is invoked.
|
|
229
102
|
*/
|
|
230
103
|
const DaffCartItemsGuardRedirectUrl = new InjectionToken('DaffCartItemsGuardRedirectUrl');
|
|
231
104
|
|
|
232
|
-
/**
|
|
233
|
-
* @fileoverview added by tsickle
|
|
234
|
-
* Generated from: guards/cart-items/cart-items.guard.ts
|
|
235
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
236
|
-
*/
|
|
237
105
|
/**
|
|
238
106
|
* A routing guard that will ensure that the cart is not empty before allowing activation of a route.
|
|
239
107
|
* If the cart has items in it, then `canActivate` will emit true. If not, it will emit false and redirect to a specific path.
|
|
240
|
-
* The url is `/` by default but can be overridden with the {
|
|
108
|
+
* The url is `/` by default but can be overridden with the {@link DaffCartItemsGuardRedirectUrl} injection token.
|
|
241
109
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
242
|
-
* Ensure that the cart is resolved prior to running this guard with the {
|
|
110
|
+
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
243
111
|
*/
|
|
244
112
|
class DaffCartItemsGuard {
|
|
245
|
-
/**
|
|
246
|
-
* @param {?} facade
|
|
247
|
-
* @param {?} router
|
|
248
|
-
* @param {?} redirectUrl
|
|
249
|
-
*/
|
|
250
113
|
constructor(facade, router, redirectUrl) {
|
|
251
114
|
this.facade = facade;
|
|
252
115
|
this.router = router;
|
|
253
116
|
this.redirectUrl = redirectUrl;
|
|
254
117
|
}
|
|
255
|
-
/**
|
|
256
|
-
* @return {?}
|
|
257
|
-
*/
|
|
258
118
|
canActivate() {
|
|
259
|
-
return this.facade.isCartEmpty$.pipe(map((
|
|
260
|
-
* @param {?} isCartEmpty
|
|
261
|
-
* @return {?}
|
|
262
|
-
*/
|
|
263
|
-
isCartEmpty => !isCartEmpty)), take(1), tap((/**
|
|
264
|
-
* @param {?} hasNonEmptyCart
|
|
265
|
-
* @return {?}
|
|
266
|
-
*/
|
|
267
|
-
hasNonEmptyCart => {
|
|
119
|
+
return this.facade.isCartEmpty$.pipe(map(isCartEmpty => !isCartEmpty), take(1), tap(hasNonEmptyCart => {
|
|
268
120
|
if (!hasNonEmptyCart) {
|
|
269
121
|
this.router.navigateByUrl(this.redirectUrl);
|
|
270
122
|
}
|
|
271
|
-
}))
|
|
123
|
+
}));
|
|
272
124
|
}
|
|
273
125
|
}
|
|
126
|
+
/** @nocollapse */ DaffCartItemsGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffCartItemsGuard_Factory() { return new DaffCartItemsGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartItemsGuardRedirectUrl)); }, token: DaffCartItemsGuard, providedIn: "root" });
|
|
274
127
|
DaffCartItemsGuard.decorators = [
|
|
275
128
|
{ type: Injectable, args: [{
|
|
276
129
|
providedIn: 'root',
|
|
@@ -282,70 +135,30 @@ DaffCartItemsGuard.ctorParameters = () => [
|
|
|
282
135
|
{ type: Router },
|
|
283
136
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartItemsGuardRedirectUrl,] }] }
|
|
284
137
|
];
|
|
285
|
-
/** @nocollapse */ DaffCartItemsGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffCartItemsGuard_Factory() { return new DaffCartItemsGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartItemsGuardRedirectUrl)); }, token: DaffCartItemsGuard, providedIn: "root" });
|
|
286
|
-
if (false) {
|
|
287
|
-
/**
|
|
288
|
-
* @type {?}
|
|
289
|
-
* @private
|
|
290
|
-
*/
|
|
291
|
-
DaffCartItemsGuard.prototype.facade;
|
|
292
|
-
/**
|
|
293
|
-
* @type {?}
|
|
294
|
-
* @private
|
|
295
|
-
*/
|
|
296
|
-
DaffCartItemsGuard.prototype.router;
|
|
297
|
-
/**
|
|
298
|
-
* @type {?}
|
|
299
|
-
* @private
|
|
300
|
-
*/
|
|
301
|
-
DaffCartItemsGuard.prototype.redirectUrl;
|
|
302
|
-
}
|
|
303
138
|
|
|
304
|
-
/**
|
|
305
|
-
* @fileoverview added by tsickle
|
|
306
|
-
* Generated from: guards/payment-method/payment-method-guard-redirect.token.ts
|
|
307
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
308
|
-
*/
|
|
309
|
-
/** @type {?} */
|
|
310
139
|
const DaffCartPaymentMethodGuardRedirectUrl = new InjectionToken('DaffCartPaymentMethodGuardRedirectUrl');
|
|
311
140
|
|
|
312
|
-
/**
|
|
313
|
-
* @fileoverview added by tsickle
|
|
314
|
-
* Generated from: guards/payment-method/payment-method.guard.ts
|
|
315
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
316
|
-
*/
|
|
317
141
|
/**
|
|
318
142
|
* A routing guard that will redirect to a given url if the payment method on the cart is not defined.
|
|
319
143
|
* The url is `/` by default, but can be overridden with the DaffCartPaymentMethodGuardRedirectUrl injection token.
|
|
320
144
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
321
|
-
* Ensure that the cart is resolved prior to running this guard with the {
|
|
145
|
+
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
322
146
|
*/
|
|
323
147
|
class DaffPaymentMethodGuard {
|
|
324
|
-
/**
|
|
325
|
-
* @param {?} facade
|
|
326
|
-
* @param {?} router
|
|
327
|
-
* @param {?} redirectUrl
|
|
328
|
-
*/
|
|
329
148
|
constructor(facade, router, redirectUrl) {
|
|
330
149
|
this.facade = facade;
|
|
331
150
|
this.router = router;
|
|
332
151
|
this.redirectUrl = redirectUrl;
|
|
333
152
|
}
|
|
334
|
-
/**
|
|
335
|
-
* @return {?}
|
|
336
|
-
*/
|
|
337
153
|
canActivate() {
|
|
338
|
-
return this.facade.hasPaymentMethod$.pipe(take(1), tap(
|
|
339
|
-
* @param {?} hasPaymentMethod
|
|
340
|
-
* @return {?}
|
|
341
|
-
*/
|
|
342
|
-
hasPaymentMethod => {
|
|
154
|
+
return this.facade.hasPaymentMethod$.pipe(take(1), tap(hasPaymentMethod => {
|
|
343
155
|
if (!hasPaymentMethod) {
|
|
344
156
|
this.router.navigateByUrl(this.redirectUrl);
|
|
345
157
|
}
|
|
346
|
-
}))
|
|
158
|
+
}));
|
|
347
159
|
}
|
|
348
160
|
}
|
|
161
|
+
/** @nocollapse */ DaffPaymentMethodGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffPaymentMethodGuard_Factory() { return new DaffPaymentMethodGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartPaymentMethodGuardRedirectUrl)); }, token: DaffPaymentMethodGuard, providedIn: "root" });
|
|
349
162
|
DaffPaymentMethodGuard.decorators = [
|
|
350
163
|
{ type: Injectable, args: [{
|
|
351
164
|
providedIn: 'root',
|
|
@@ -357,70 +170,30 @@ DaffPaymentMethodGuard.ctorParameters = () => [
|
|
|
357
170
|
{ type: Router },
|
|
358
171
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartPaymentMethodGuardRedirectUrl,] }] }
|
|
359
172
|
];
|
|
360
|
-
/** @nocollapse */ DaffPaymentMethodGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffPaymentMethodGuard_Factory() { return new DaffPaymentMethodGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartPaymentMethodGuardRedirectUrl)); }, token: DaffPaymentMethodGuard, providedIn: "root" });
|
|
361
|
-
if (false) {
|
|
362
|
-
/**
|
|
363
|
-
* @type {?}
|
|
364
|
-
* @private
|
|
365
|
-
*/
|
|
366
|
-
DaffPaymentMethodGuard.prototype.facade;
|
|
367
|
-
/**
|
|
368
|
-
* @type {?}
|
|
369
|
-
* @private
|
|
370
|
-
*/
|
|
371
|
-
DaffPaymentMethodGuard.prototype.router;
|
|
372
|
-
/**
|
|
373
|
-
* @type {?}
|
|
374
|
-
* @private
|
|
375
|
-
*/
|
|
376
|
-
DaffPaymentMethodGuard.prototype.redirectUrl;
|
|
377
|
-
}
|
|
378
173
|
|
|
379
|
-
/**
|
|
380
|
-
* @fileoverview added by tsickle
|
|
381
|
-
* Generated from: guards/shipping-address/shipping-address-guard-redirect.token.ts
|
|
382
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
383
|
-
*/
|
|
384
|
-
/** @type {?} */
|
|
385
174
|
const DaffCartShippingAddressGuardRedirectUrl = new InjectionToken('DaffCartShippingAddressGuardRedirectUrl');
|
|
386
175
|
|
|
387
|
-
/**
|
|
388
|
-
* @fileoverview added by tsickle
|
|
389
|
-
* Generated from: guards/shipping-address/shipping-address.guard.ts
|
|
390
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
391
|
-
*/
|
|
392
176
|
/**
|
|
393
177
|
* A routing guard that will redirect to a given url if the shipping address on the cart is not defined.
|
|
394
178
|
* The url is `/` by default, but can be overridden with the DaffCartShippingAddressGuardRedirectUrl injection token.
|
|
395
179
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
396
|
-
* Ensure that the cart is resolved prior to running this guard with the {
|
|
180
|
+
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
397
181
|
*/
|
|
398
182
|
class DaffShippingAddressGuard {
|
|
399
|
-
/**
|
|
400
|
-
* @param {?} facade
|
|
401
|
-
* @param {?} router
|
|
402
|
-
* @param {?} redirectUrl
|
|
403
|
-
*/
|
|
404
183
|
constructor(facade, router, redirectUrl) {
|
|
405
184
|
this.facade = facade;
|
|
406
185
|
this.router = router;
|
|
407
186
|
this.redirectUrl = redirectUrl;
|
|
408
187
|
}
|
|
409
|
-
/**
|
|
410
|
-
* @return {?}
|
|
411
|
-
*/
|
|
412
188
|
canActivate() {
|
|
413
|
-
return this.facade.hasShippingAddress$.pipe(take(1), tap(
|
|
414
|
-
* @param {?} hasShippingAddress
|
|
415
|
-
* @return {?}
|
|
416
|
-
*/
|
|
417
|
-
hasShippingAddress => {
|
|
189
|
+
return this.facade.hasShippingAddress$.pipe(take(1), tap(hasShippingAddress => {
|
|
418
190
|
if (!hasShippingAddress) {
|
|
419
191
|
this.router.navigateByUrl(this.redirectUrl);
|
|
420
192
|
}
|
|
421
|
-
}))
|
|
193
|
+
}));
|
|
422
194
|
}
|
|
423
195
|
}
|
|
196
|
+
/** @nocollapse */ DaffShippingAddressGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffShippingAddressGuard_Factory() { return new DaffShippingAddressGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartShippingAddressGuardRedirectUrl)); }, token: DaffShippingAddressGuard, providedIn: "root" });
|
|
424
197
|
DaffShippingAddressGuard.decorators = [
|
|
425
198
|
{ type: Injectable, args: [{
|
|
426
199
|
providedIn: 'root',
|
|
@@ -432,70 +205,30 @@ DaffShippingAddressGuard.ctorParameters = () => [
|
|
|
432
205
|
{ type: Router },
|
|
433
206
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartShippingAddressGuardRedirectUrl,] }] }
|
|
434
207
|
];
|
|
435
|
-
/** @nocollapse */ DaffShippingAddressGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffShippingAddressGuard_Factory() { return new DaffShippingAddressGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartShippingAddressGuardRedirectUrl)); }, token: DaffShippingAddressGuard, providedIn: "root" });
|
|
436
|
-
if (false) {
|
|
437
|
-
/**
|
|
438
|
-
* @type {?}
|
|
439
|
-
* @private
|
|
440
|
-
*/
|
|
441
|
-
DaffShippingAddressGuard.prototype.facade;
|
|
442
|
-
/**
|
|
443
|
-
* @type {?}
|
|
444
|
-
* @private
|
|
445
|
-
*/
|
|
446
|
-
DaffShippingAddressGuard.prototype.router;
|
|
447
|
-
/**
|
|
448
|
-
* @type {?}
|
|
449
|
-
* @private
|
|
450
|
-
*/
|
|
451
|
-
DaffShippingAddressGuard.prototype.redirectUrl;
|
|
452
|
-
}
|
|
453
208
|
|
|
454
|
-
/**
|
|
455
|
-
* @fileoverview added by tsickle
|
|
456
|
-
* Generated from: guards/shipping-method/shipping-method-guard-redirect.token.ts
|
|
457
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
458
|
-
*/
|
|
459
|
-
/** @type {?} */
|
|
460
209
|
const DaffCartShippingMethodGuardRedirectUrl = new InjectionToken('DaffCartShippingMethodGuardRedirectUrl');
|
|
461
210
|
|
|
462
|
-
/**
|
|
463
|
-
* @fileoverview added by tsickle
|
|
464
|
-
* Generated from: guards/shipping-method/shipping-method.guard.ts
|
|
465
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
466
|
-
*/
|
|
467
211
|
/**
|
|
468
212
|
* A routing guard that will redirect to a given url if the shipping method on the cart is not defined.
|
|
469
213
|
* The url is `/` by default, but can be overridden with the DaffCartShippingMethodGuardRedirectUrl injection token.
|
|
470
214
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
471
|
-
* Ensure that the cart is resolved prior to running this guard with the {
|
|
215
|
+
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
472
216
|
*/
|
|
473
217
|
class DaffShippingMethodGuard {
|
|
474
|
-
/**
|
|
475
|
-
* @param {?} facade
|
|
476
|
-
* @param {?} router
|
|
477
|
-
* @param {?} redirectUrl
|
|
478
|
-
*/
|
|
479
218
|
constructor(facade, router, redirectUrl) {
|
|
480
219
|
this.facade = facade;
|
|
481
220
|
this.router = router;
|
|
482
221
|
this.redirectUrl = redirectUrl;
|
|
483
222
|
}
|
|
484
|
-
/**
|
|
485
|
-
* @return {?}
|
|
486
|
-
*/
|
|
487
223
|
canActivate() {
|
|
488
|
-
return this.facade.hasShippingMethod$.pipe(take(1), tap(
|
|
489
|
-
* @param {?} hasShippingMethod
|
|
490
|
-
* @return {?}
|
|
491
|
-
*/
|
|
492
|
-
hasShippingMethod => {
|
|
224
|
+
return this.facade.hasShippingMethod$.pipe(take(1), tap(hasShippingMethod => {
|
|
493
225
|
if (!hasShippingMethod) {
|
|
494
226
|
this.router.navigateByUrl(this.redirectUrl);
|
|
495
227
|
}
|
|
496
|
-
}))
|
|
228
|
+
}));
|
|
497
229
|
}
|
|
498
230
|
}
|
|
231
|
+
/** @nocollapse */ DaffShippingMethodGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffShippingMethodGuard_Factory() { return new DaffShippingMethodGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartShippingMethodGuardRedirectUrl)); }, token: DaffShippingMethodGuard, providedIn: "root" });
|
|
499
232
|
DaffShippingMethodGuard.decorators = [
|
|
500
233
|
{ type: Injectable, args: [{
|
|
501
234
|
providedIn: 'root',
|
|
@@ -507,68 +240,28 @@ DaffShippingMethodGuard.ctorParameters = () => [
|
|
|
507
240
|
{ type: Router },
|
|
508
241
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartShippingMethodGuardRedirectUrl,] }] }
|
|
509
242
|
];
|
|
510
|
-
/** @nocollapse */ DaffShippingMethodGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffShippingMethodGuard_Factory() { return new DaffShippingMethodGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartShippingMethodGuardRedirectUrl)); }, token: DaffShippingMethodGuard, providedIn: "root" });
|
|
511
|
-
if (false) {
|
|
512
|
-
/**
|
|
513
|
-
* @type {?}
|
|
514
|
-
* @private
|
|
515
|
-
*/
|
|
516
|
-
DaffShippingMethodGuard.prototype.facade;
|
|
517
|
-
/**
|
|
518
|
-
* @type {?}
|
|
519
|
-
* @private
|
|
520
|
-
*/
|
|
521
|
-
DaffShippingMethodGuard.prototype.router;
|
|
522
|
-
/**
|
|
523
|
-
* @type {?}
|
|
524
|
-
* @private
|
|
525
|
-
*/
|
|
526
|
-
DaffShippingMethodGuard.prototype.redirectUrl;
|
|
527
|
-
}
|
|
528
243
|
|
|
529
|
-
/**
|
|
530
|
-
* @fileoverview added by tsickle
|
|
531
|
-
* Generated from: guards/order-result/order-result-guard-redirect.token.ts
|
|
532
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
533
|
-
*/
|
|
534
|
-
/** @type {?} */
|
|
535
244
|
const DaffCartOrderResultGuardRedirectUrl = new InjectionToken('DaffCartOrderResultGuardRedirectUrl');
|
|
536
245
|
|
|
537
|
-
/**
|
|
538
|
-
* @fileoverview added by tsickle
|
|
539
|
-
* Generated from: guards/order-result/order-result.guard.ts
|
|
540
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
541
|
-
*/
|
|
542
246
|
/**
|
|
543
247
|
* A routing guard that will redirect to a given url if the cart order result is not defined.
|
|
544
248
|
* The url is `/` by default, but can be overridden with the DaffCartOrderResultGuardRedirectUrl injection token.
|
|
545
249
|
*/
|
|
546
250
|
class DaffOrderResultGuard {
|
|
547
|
-
/**
|
|
548
|
-
* @param {?} facade
|
|
549
|
-
* @param {?} router
|
|
550
|
-
* @param {?} redirectUrl
|
|
551
|
-
*/
|
|
552
251
|
constructor(facade, router, redirectUrl) {
|
|
553
252
|
this.facade = facade;
|
|
554
253
|
this.router = router;
|
|
555
254
|
this.redirectUrl = redirectUrl;
|
|
556
255
|
}
|
|
557
|
-
/**
|
|
558
|
-
* @return {?}
|
|
559
|
-
*/
|
|
560
256
|
canActivate() {
|
|
561
|
-
return this.facade.hasOrderResult$.pipe(tap(
|
|
562
|
-
* @param {?} hasOrderResult
|
|
563
|
-
* @return {?}
|
|
564
|
-
*/
|
|
565
|
-
hasOrderResult => {
|
|
257
|
+
return this.facade.hasOrderResult$.pipe(tap(hasOrderResult => {
|
|
566
258
|
if (!hasOrderResult) {
|
|
567
259
|
this.router.navigateByUrl(this.redirectUrl);
|
|
568
260
|
}
|
|
569
|
-
}))
|
|
261
|
+
}));
|
|
570
262
|
}
|
|
571
263
|
}
|
|
264
|
+
/** @nocollapse */ DaffOrderResultGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffOrderResultGuard_Factory() { return new DaffOrderResultGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartOrderResultGuardRedirectUrl)); }, token: DaffOrderResultGuard, providedIn: "root" });
|
|
572
265
|
DaffOrderResultGuard.decorators = [
|
|
573
266
|
{ type: Injectable, args: [{
|
|
574
267
|
providedIn: 'root',
|
|
@@ -580,85 +273,34 @@ DaffOrderResultGuard.ctorParameters = () => [
|
|
|
580
273
|
{ type: Router },
|
|
581
274
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartOrderResultGuardRedirectUrl,] }] }
|
|
582
275
|
];
|
|
583
|
-
/** @nocollapse */ DaffOrderResultGuard.ɵprov = ɵɵdefineInjectable({ factory: function DaffOrderResultGuard_Factory() { return new DaffOrderResultGuard(ɵɵinject(DaffCartFacade), ɵɵinject(Router), ɵɵinject(DaffCartOrderResultGuardRedirectUrl)); }, token: DaffOrderResultGuard, providedIn: "root" });
|
|
584
|
-
if (false) {
|
|
585
|
-
/**
|
|
586
|
-
* @type {?}
|
|
587
|
-
* @private
|
|
588
|
-
*/
|
|
589
|
-
DaffOrderResultGuard.prototype.facade;
|
|
590
|
-
/**
|
|
591
|
-
* @type {?}
|
|
592
|
-
* @private
|
|
593
|
-
*/
|
|
594
|
-
DaffOrderResultGuard.prototype.router;
|
|
595
|
-
/**
|
|
596
|
-
* @type {?}
|
|
597
|
-
* @private
|
|
598
|
-
*/
|
|
599
|
-
DaffOrderResultGuard.prototype.redirectUrl;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* @fileoverview added by tsickle
|
|
604
|
-
* Generated from: guards/public_api.ts
|
|
605
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
606
|
-
*/
|
|
607
276
|
|
|
608
|
-
/**
|
|
609
|
-
* @fileoverview added by tsickle
|
|
610
|
-
* Generated from: resolvers/tokens/cart-resolver-redirect.token.ts
|
|
611
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
612
|
-
*/
|
|
613
|
-
/** @type {?} */
|
|
614
277
|
const DaffCartResolverRedirectUrl = new InjectionToken('DaffCartResolverRedirectUrl');
|
|
615
278
|
|
|
616
|
-
/**
|
|
617
|
-
* @fileoverview added by tsickle
|
|
618
|
-
* Generated from: resolvers/cart-resolver.service.ts
|
|
619
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
620
|
-
*/
|
|
621
279
|
/**
|
|
622
280
|
* Resolves the cart before navigation. Redirects to a given url when a failure occurs during Cart Load.
|
|
623
281
|
* This url is `/` by default but can be overridden with the DaffCartResolverRedirectUrl injection token.
|
|
624
282
|
*/
|
|
625
283
|
class DaffCartResolver {
|
|
626
|
-
/**
|
|
627
|
-
* @param {?} store
|
|
628
|
-
* @param {?} dispatcher
|
|
629
|
-
* @param {?} router
|
|
630
|
-
* @param {?} redirectUrl
|
|
631
|
-
*/
|
|
632
284
|
constructor(store, dispatcher, router, redirectUrl) {
|
|
633
285
|
this.store = store;
|
|
634
286
|
this.dispatcher = dispatcher;
|
|
635
287
|
this.router = router;
|
|
636
288
|
this.redirectUrl = redirectUrl;
|
|
637
289
|
}
|
|
638
|
-
/**
|
|
639
|
-
* @return {?}
|
|
640
|
-
*/
|
|
641
290
|
resolve() {
|
|
642
291
|
this.store.dispatch(new DaffResolveCart());
|
|
643
|
-
return this.dispatcher.pipe(filter(
|
|
644
|
-
* @param {?} action
|
|
645
|
-
* @return {?}
|
|
646
|
-
*/
|
|
647
|
-
action => action.type === DaffCartActionTypes.CartLoadSuccessAction
|
|
292
|
+
return this.dispatcher.pipe(filter(action => action.type === DaffCartActionTypes.CartLoadSuccessAction
|
|
648
293
|
|| action.type === DaffCartActionTypes.CartLoadFailureAction
|
|
649
294
|
|| action.type === DaffCartActionTypes.CartCreateFailureAction
|
|
650
|
-
|| action.type === DaffCartActionTypes.CartStorageFailureAction)
|
|
651
|
-
* @param {?} action
|
|
652
|
-
* @return {?}
|
|
653
|
-
*/
|
|
654
|
-
(action) => {
|
|
295
|
+
|| action.type === DaffCartActionTypes.CartStorageFailureAction), map((action) => {
|
|
655
296
|
if (action.type !== DaffCartActionTypes.CartLoadSuccessAction) {
|
|
656
297
|
this.router.navigateByUrl(this.redirectUrl);
|
|
657
298
|
}
|
|
658
299
|
return action;
|
|
659
|
-
})
|
|
300
|
+
}), take(1));
|
|
660
301
|
}
|
|
661
302
|
}
|
|
303
|
+
/** @nocollapse */ DaffCartResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffCartResolver_Factory() { return new DaffCartResolver(ɵɵinject(Store), ɵɵinject(ActionsSubject), ɵɵinject(Router), ɵɵinject(DaffCartResolverRedirectUrl)); }, token: DaffCartResolver, providedIn: "root" });
|
|
662
304
|
DaffCartResolver.decorators = [
|
|
663
305
|
{ type: Injectable, args: [{
|
|
664
306
|
providedIn: 'root',
|
|
@@ -671,43 +313,9 @@ DaffCartResolver.ctorParameters = () => [
|
|
|
671
313
|
{ type: Router },
|
|
672
314
|
{ type: String, decorators: [{ type: Inject, args: [DaffCartResolverRedirectUrl,] }] }
|
|
673
315
|
];
|
|
674
|
-
/** @nocollapse */ DaffCartResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffCartResolver_Factory() { return new DaffCartResolver(ɵɵinject(Store), ɵɵinject(ActionsSubject), ɵɵinject(Router), ɵɵinject(DaffCartResolverRedirectUrl)); }, token: DaffCartResolver, providedIn: "root" });
|
|
675
|
-
if (false) {
|
|
676
|
-
/**
|
|
677
|
-
* @type {?}
|
|
678
|
-
* @private
|
|
679
|
-
*/
|
|
680
|
-
DaffCartResolver.prototype.store;
|
|
681
|
-
/**
|
|
682
|
-
* @type {?}
|
|
683
|
-
* @private
|
|
684
|
-
*/
|
|
685
|
-
DaffCartResolver.prototype.dispatcher;
|
|
686
|
-
/**
|
|
687
|
-
* @type {?}
|
|
688
|
-
* @private
|
|
689
|
-
*/
|
|
690
|
-
DaffCartResolver.prototype.router;
|
|
691
|
-
/**
|
|
692
|
-
* @type {?}
|
|
693
|
-
* @private
|
|
694
|
-
*/
|
|
695
|
-
DaffCartResolver.prototype.redirectUrl;
|
|
696
|
-
}
|
|
697
316
|
|
|
698
|
-
/**
|
|
699
|
-
* @fileoverview added by tsickle
|
|
700
|
-
* Generated from: resolvers/tokens/empty-cart-resolver-redirect.token.ts
|
|
701
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
702
|
-
*/
|
|
703
|
-
/** @type {?} */
|
|
704
317
|
const DaffEmptyCartResolverRedirectUrl = new InjectionToken('DaffEmptyCartResolverRedirectUrl');
|
|
705
318
|
|
|
706
|
-
/**
|
|
707
|
-
* @fileoverview added by tsickle
|
|
708
|
-
* Generated from: resolvers/empty-cart-resolver.service.ts
|
|
709
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
710
|
-
*/
|
|
711
319
|
/**
|
|
712
320
|
* Resolves the cart before navigation. Redirects to a given url when a failure occurs during Cart Load.
|
|
713
321
|
* This url is `/` by default but can be overridden with the DaffCartResolverRedirectUrl injection token.
|
|
@@ -715,36 +323,21 @@ const DaffEmptyCartResolverRedirectUrl = new InjectionToken('DaffEmptyCartResolv
|
|
|
715
323
|
* This url is also `/` by default, but can be overridden with the DaffEmptyCartResolverRedirectUrl
|
|
716
324
|
*/
|
|
717
325
|
class DaffEmptyCartResolver {
|
|
718
|
-
/**
|
|
719
|
-
* @param {?} cartResolver
|
|
720
|
-
* @param {?} router
|
|
721
|
-
* @param {?} redirectUrl
|
|
722
|
-
*/
|
|
723
326
|
constructor(cartResolver, router, redirectUrl) {
|
|
724
327
|
this.cartResolver = cartResolver;
|
|
725
328
|
this.router = router;
|
|
726
329
|
this.redirectUrl = redirectUrl;
|
|
727
330
|
}
|
|
728
|
-
/**
|
|
729
|
-
* @return {?}
|
|
730
|
-
*/
|
|
731
331
|
resolve() {
|
|
732
|
-
return this.cartResolver.resolve().pipe(filter((
|
|
733
|
-
* @param {?} action
|
|
734
|
-
* @return {?}
|
|
735
|
-
*/
|
|
736
|
-
action => action.type === DaffCartActionTypes.CartLoadSuccessAction)), map((/**
|
|
737
|
-
* @param {?} action
|
|
738
|
-
* @return {?}
|
|
739
|
-
*/
|
|
740
|
-
(action) => {
|
|
332
|
+
return this.cartResolver.resolve().pipe(filter(action => action.type === DaffCartActionTypes.CartLoadSuccessAction), map((action) => {
|
|
741
333
|
if (!action.payload || action.payload.items.length === 0) {
|
|
742
334
|
this.router.navigateByUrl(this.redirectUrl);
|
|
743
335
|
}
|
|
744
336
|
return action;
|
|
745
|
-
}))
|
|
337
|
+
}));
|
|
746
338
|
}
|
|
747
339
|
}
|
|
340
|
+
/** @nocollapse */ DaffEmptyCartResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffEmptyCartResolver_Factory() { return new DaffEmptyCartResolver(ɵɵinject(DaffCartResolver), ɵɵinject(Router), ɵɵinject(DaffEmptyCartResolverRedirectUrl)); }, token: DaffEmptyCartResolver, providedIn: "root" });
|
|
748
341
|
DaffEmptyCartResolver.decorators = [
|
|
749
342
|
{ type: Injectable, args: [{
|
|
750
343
|
providedIn: 'root',
|
|
@@ -756,42 +349,9 @@ DaffEmptyCartResolver.ctorParameters = () => [
|
|
|
756
349
|
{ type: Router },
|
|
757
350
|
{ type: String, decorators: [{ type: Inject, args: [DaffEmptyCartResolverRedirectUrl,] }] }
|
|
758
351
|
];
|
|
759
|
-
/** @nocollapse */ DaffEmptyCartResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffEmptyCartResolver_Factory() { return new DaffEmptyCartResolver(ɵɵinject(DaffCartResolver), ɵɵinject(Router), ɵɵinject(DaffEmptyCartResolverRedirectUrl)); }, token: DaffEmptyCartResolver, providedIn: "root" });
|
|
760
|
-
if (false) {
|
|
761
|
-
/**
|
|
762
|
-
* @type {?}
|
|
763
|
-
* @private
|
|
764
|
-
*/
|
|
765
|
-
DaffEmptyCartResolver.prototype.cartResolver;
|
|
766
|
-
/**
|
|
767
|
-
* @type {?}
|
|
768
|
-
* @private
|
|
769
|
-
*/
|
|
770
|
-
DaffEmptyCartResolver.prototype.router;
|
|
771
|
-
/**
|
|
772
|
-
* @type {?}
|
|
773
|
-
* @private
|
|
774
|
-
*/
|
|
775
|
-
DaffEmptyCartResolver.prototype.redirectUrl;
|
|
776
|
-
}
|
|
777
352
|
|
|
778
|
-
/**
|
|
779
|
-
* @fileoverview added by tsickle
|
|
780
|
-
* Generated from: resolvers/public_api.ts
|
|
781
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
782
|
-
*/
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
* @fileoverview added by tsickle
|
|
786
|
-
* Generated from: cart-routing.module.ts
|
|
787
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
788
|
-
*/
|
|
789
353
|
class DaffCartRoutingModule {
|
|
790
|
-
|
|
791
|
-
* @param {?=} config
|
|
792
|
-
* @return {?}
|
|
793
|
-
*/
|
|
794
|
-
static forRoot(config = (/** @type {?} */ ({}))) {
|
|
354
|
+
static forRoot(config = {}) {
|
|
795
355
|
return {
|
|
796
356
|
ngModule: DaffCartRoutingModule,
|
|
797
357
|
providers: [
|
|
@@ -819,21 +379,7 @@ DaffCartRoutingModule.decorators = [
|
|
|
819
379
|
];
|
|
820
380
|
|
|
821
381
|
/**
|
|
822
|
-
*
|
|
823
|
-
* Generated from: public_api.ts
|
|
824
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
825
|
-
*/
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* @fileoverview added by tsickle
|
|
829
|
-
* Generated from: index.ts
|
|
830
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
831
|
-
*/
|
|
832
|
-
|
|
833
|
-
/**
|
|
834
|
-
* @fileoverview added by tsickle
|
|
835
|
-
* Generated from: daffodil-cart-routing.ts
|
|
836
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
382
|
+
* Generated bundle index. Do not edit.
|
|
837
383
|
*/
|
|
838
384
|
|
|
839
385
|
export { DAFF_CART_ROUTING_CONFIG, DaffBillingAddressGuard, DaffCartBillingAddressGuardRedirectUrl, DaffCartItemsGuard, DaffCartItemsGuardRedirectUrl, DaffCartOrderResultGuardRedirectUrl, DaffCartPaymentMethodGuardRedirectUrl, DaffCartResolver, DaffCartResolverRedirectUrl, DaffCartRoutingModule, DaffCartShippingAddressGuardRedirectUrl, DaffCartShippingMethodGuardRedirectUrl, DaffEmptyCartResolver, DaffEmptyCartResolverRedirectUrl, DaffOrderResultGuard, DaffPaymentMethodGuard, DaffResolvedCartGuard, DaffShippingAddressGuard, DaffShippingMethodGuard };
|