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