@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,11 +4,6 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.cart = global.daffodil.cart || {}, global.daffodil.cart.driver = global.daffodil.cart.driver || {}, global.daffodil.cart.driver.magento = {}), global.ng.core, global.daffodil.cart, global.magento, global.core, global.i1, global.graphql, global.rxjs, global.rxjs.operators, global.daffodil.cart.driver, global.magento$1, global.driver, global.ng.common));
|
|
5
5
|
}(this, (function (exports, i0, cart, magento, core, i1, graphql, rxjs, operators, i4, magento$1, driver, common) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview added by tsickle
|
|
9
|
-
* Generated from: transforms/outputs/cart-address.service.ts
|
|
10
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
-
*/
|
|
12
7
|
/**
|
|
13
8
|
* Transforms magento addresses into an object usable by daffodil.
|
|
14
9
|
*/
|
|
@@ -18,8 +13,7 @@
|
|
|
18
13
|
/**
|
|
19
14
|
* Transforms the magento MagentoCart from the magento cart query into a DaffCartAddress.
|
|
20
15
|
*
|
|
21
|
-
* @param
|
|
22
|
-
* @return {?}
|
|
16
|
+
* @param address the address from a magento cart query.
|
|
23
17
|
*/
|
|
24
18
|
DaffMagentoCartAddressTransformer.prototype.transform = function (address) {
|
|
25
19
|
return address ? {
|
|
@@ -45,39 +39,31 @@
|
|
|
45
39
|
};
|
|
46
40
|
return DaffMagentoCartAddressTransformer;
|
|
47
41
|
}());
|
|
42
|
+
/** @nocollapse */ DaffMagentoCartAddressTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartAddressTransformer_Factory() { return new DaffMagentoCartAddressTransformer(); }, token: DaffMagentoCartAddressTransformer, providedIn: "root" });
|
|
48
43
|
DaffMagentoCartAddressTransformer.decorators = [
|
|
49
44
|
{ type: i0.Injectable, args: [{
|
|
50
45
|
providedIn: 'root',
|
|
51
46
|
},] }
|
|
52
47
|
];
|
|
53
|
-
/** @nocollapse */ DaffMagentoCartAddressTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartAddressTransformer_Factory() { return new DaffMagentoCartAddressTransformer(); }, token: DaffMagentoCartAddressTransformer, providedIn: "root" });
|
|
54
48
|
|
|
55
|
-
/**
|
|
56
|
-
* @fileoverview added by tsickle
|
|
57
|
-
* Generated from: transforms/outputs/billing-address.service.ts
|
|
58
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
59
|
-
*/
|
|
60
49
|
/**
|
|
61
50
|
* Transforms magento addresses into an object usable by daffodil.
|
|
62
51
|
*/
|
|
63
52
|
var DaffMagentoBillingAddressTransformer = /** @class */ (function () {
|
|
64
|
-
/**
|
|
65
|
-
* @param {?} addressTransformer
|
|
66
|
-
*/
|
|
67
53
|
function DaffMagentoBillingAddressTransformer(addressTransformer) {
|
|
68
54
|
this.addressTransformer = addressTransformer;
|
|
69
55
|
}
|
|
70
56
|
/**
|
|
71
57
|
* Transforms the magento MagentoCart from the magento cart query into a DaffCartAddress.
|
|
72
58
|
*
|
|
73
|
-
* @param
|
|
74
|
-
* @return {?}
|
|
59
|
+
* @param address the address from a magento cart query.
|
|
75
60
|
*/
|
|
76
61
|
DaffMagentoBillingAddressTransformer.prototype.transform = function (address) {
|
|
77
62
|
return address ? Object.assign(Object.assign({}, this.addressTransformer.transform(address)), { address_type: 'billing' }) : null;
|
|
78
63
|
};
|
|
79
64
|
return DaffMagentoBillingAddressTransformer;
|
|
80
65
|
}());
|
|
66
|
+
/** @nocollapse */ DaffMagentoBillingAddressTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoBillingAddressTransformer_Factory() { return new DaffMagentoBillingAddressTransformer(i0.ɵɵinject(DaffMagentoCartAddressTransformer)); }, token: DaffMagentoBillingAddressTransformer, providedIn: "root" });
|
|
81
67
|
DaffMagentoBillingAddressTransformer.decorators = [
|
|
82
68
|
{ type: i0.Injectable, args: [{
|
|
83
69
|
providedIn: 'root',
|
|
@@ -87,24 +73,7 @@
|
|
|
87
73
|
DaffMagentoBillingAddressTransformer.ctorParameters = function () { return [
|
|
88
74
|
{ type: DaffMagentoCartAddressTransformer }
|
|
89
75
|
]; };
|
|
90
|
-
/** @nocollapse */ DaffMagentoBillingAddressTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoBillingAddressTransformer_Factory() { return new DaffMagentoBillingAddressTransformer(i0.ɵɵinject(DaffMagentoCartAddressTransformer)); }, token: DaffMagentoBillingAddressTransformer, providedIn: "root" });
|
|
91
|
-
if (false) {
|
|
92
|
-
/**
|
|
93
|
-
* @type {?}
|
|
94
|
-
* @private
|
|
95
|
-
*/
|
|
96
|
-
DaffMagentoBillingAddressTransformer.prototype.addressTransformer;
|
|
97
|
-
}
|
|
98
76
|
|
|
99
|
-
/**
|
|
100
|
-
* @fileoverview added by tsickle
|
|
101
|
-
* Generated from: transforms/outputs/cart-coupon.ts
|
|
102
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
103
|
-
*/
|
|
104
|
-
/**
|
|
105
|
-
* @param {?} coupon
|
|
106
|
-
* @return {?}
|
|
107
|
-
*/
|
|
108
77
|
function daffMagentoCouponTransform(coupon) {
|
|
109
78
|
return {
|
|
110
79
|
id: coupon.code,
|
|
@@ -112,85 +81,16 @@
|
|
|
112
81
|
};
|
|
113
82
|
}
|
|
114
83
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
/** @enum {string} */
|
|
121
|
-
var MagentoCartItemTypeEnum = {
|
|
122
|
-
Simple: "SimpleCartItem",
|
|
123
|
-
Bundle: "BundleCartItem",
|
|
124
|
-
Configurable: "ConfigurableCartItem",
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* @record
|
|
128
|
-
*/
|
|
129
|
-
function MagentoCartItemProduct() { }
|
|
130
|
-
if (false) {
|
|
131
|
-
/** @type {?} */
|
|
132
|
-
MagentoCartItemProduct.prototype.__typename;
|
|
133
|
-
/** @type {?} */
|
|
134
|
-
MagentoCartItemProduct.prototype.id;
|
|
135
|
-
/** @type {?} */
|
|
136
|
-
MagentoCartItemProduct.prototype.name;
|
|
137
|
-
/** @type {?} */
|
|
138
|
-
MagentoCartItemProduct.prototype.sku;
|
|
139
|
-
/** @type {?} */
|
|
140
|
-
MagentoCartItemProduct.prototype.url_key;
|
|
141
|
-
/** @type {?} */
|
|
142
|
-
MagentoCartItemProduct.prototype.url_suffix;
|
|
143
|
-
/** @type {?} */
|
|
144
|
-
MagentoCartItemProduct.prototype.thumbnail;
|
|
145
|
-
/** @type {?} */
|
|
146
|
-
MagentoCartItemProduct.prototype.stock_status;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* An object for defining what the cart service requests and retrieves from a magento backend.
|
|
150
|
-
* @record
|
|
151
|
-
*/
|
|
152
|
-
function MagentoCartItem() { }
|
|
153
|
-
if (false) {
|
|
154
|
-
/** @type {?} */
|
|
155
|
-
MagentoCartItem.prototype.__typename;
|
|
156
|
-
/** @type {?} */
|
|
157
|
-
MagentoCartItem.prototype.id;
|
|
158
|
-
/** @type {?} */
|
|
159
|
-
MagentoCartItem.prototype.prices;
|
|
160
|
-
/** @type {?} */
|
|
161
|
-
MagentoCartItem.prototype.product;
|
|
162
|
-
/** @type {?} */
|
|
163
|
-
MagentoCartItem.prototype.quantity;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* An interface for magento bundled cart items.
|
|
167
|
-
* @record
|
|
168
|
-
*/
|
|
169
|
-
function MagentoBundleCartItem() { }
|
|
170
|
-
if (false) {
|
|
171
|
-
/** @type {?} */
|
|
172
|
-
MagentoBundleCartItem.prototype.bundle_options;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* An interface for magento configurable cart items.
|
|
176
|
-
* @record
|
|
177
|
-
*/
|
|
178
|
-
function MagentoConfigurableCartItem() { }
|
|
179
|
-
if (false) {
|
|
180
|
-
/** @type {?} */
|
|
181
|
-
MagentoConfigurableCartItem.prototype.configurable_options;
|
|
182
|
-
}
|
|
84
|
+
(function (MagentoCartItemTypeEnum) {
|
|
85
|
+
MagentoCartItemTypeEnum["Simple"] = "SimpleCartItem";
|
|
86
|
+
MagentoCartItemTypeEnum["Bundle"] = "BundleCartItem";
|
|
87
|
+
MagentoCartItemTypeEnum["Configurable"] = "ConfigurableCartItem";
|
|
88
|
+
})(exports.MagentoCartItemTypeEnum || (exports.MagentoCartItemTypeEnum = {}));
|
|
183
89
|
|
|
184
|
-
/**
|
|
185
|
-
* @fileoverview added by tsickle
|
|
186
|
-
* Generated from: transforms/outputs/cart-item/simple-cart-item-transformer.ts
|
|
187
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
188
|
-
*/
|
|
189
90
|
/**
|
|
190
91
|
* Transforms the magento MagentoCartItem from the magento cart query into a DaffCartItem.
|
|
191
92
|
*
|
|
192
|
-
* @param
|
|
193
|
-
* @return {?}
|
|
93
|
+
* @param response the response from a magento cart query.
|
|
194
94
|
*/
|
|
195
95
|
function transformMagentoSimpleCartItem(cartItem) {
|
|
196
96
|
var _a;
|
|
@@ -212,33 +112,18 @@
|
|
|
212
112
|
label: cartItem.product.thumbnail.label,
|
|
213
113
|
},
|
|
214
114
|
in_stock: cartItem.product.stock_status === magento.MagentoProductStockStatusEnum.InStock,
|
|
215
|
-
discounts: ((_a = cartItem.prices.discounts) === null || _a === void 0 ? void 0 : _a.map((
|
|
216
|
-
* @param {?} discount
|
|
217
|
-
* @return {?}
|
|
218
|
-
*/function (/**
|
|
219
|
-
* @param {?} discount
|
|
220
|
-
* @return {?}
|
|
221
|
-
*/ discount) {
|
|
115
|
+
discounts: ((_a = cartItem.prices.discounts) === null || _a === void 0 ? void 0 : _a.map(function (discount) {
|
|
222
116
|
var _a;
|
|
223
117
|
return ({
|
|
224
118
|
amount: (_a = discount.amount) === null || _a === void 0 ? void 0 : _a.value,
|
|
225
119
|
label: discount.label,
|
|
226
120
|
});
|
|
227
|
-
}))
|
|
121
|
+
})) || [],
|
|
228
122
|
// TODO: implement
|
|
229
123
|
parent_item_id: null,
|
|
230
124
|
} : null;
|
|
231
125
|
}
|
|
232
126
|
|
|
233
|
-
/**
|
|
234
|
-
* @fileoverview added by tsickle
|
|
235
|
-
* Generated from: transforms/outputs/cart-item/bundle-cart-item-transformer.ts
|
|
236
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
237
|
-
*/
|
|
238
|
-
/**
|
|
239
|
-
* @param {?} option
|
|
240
|
-
* @return {?}
|
|
241
|
-
*/
|
|
242
127
|
function transformBundleCartItemOption(option) {
|
|
243
128
|
return {
|
|
244
129
|
option_id: String(option.values[0].id),
|
|
@@ -250,22 +135,12 @@
|
|
|
250
135
|
/**
|
|
251
136
|
* Transforms a MagentoBundleCartItem into a DaffCartItem.
|
|
252
137
|
*
|
|
253
|
-
* @param
|
|
254
|
-
* @return {?}
|
|
138
|
+
* @param response the response from a magento cart query.
|
|
255
139
|
*/
|
|
256
140
|
function transformMagentoBundleCartItem(bundleCartItem) {
|
|
257
141
|
return bundleCartItem ? Object.assign(Object.assign({}, transformMagentoSimpleCartItem(bundleCartItem)), { type: cart.DaffCartItemInputType.Composite, options: bundleCartItem.bundle_options.map(transformBundleCartItemOption) }) : null;
|
|
258
142
|
}
|
|
259
143
|
|
|
260
|
-
/**
|
|
261
|
-
* @fileoverview added by tsickle
|
|
262
|
-
* Generated from: transforms/outputs/cart-item/configurable-cart-item-transformer.ts
|
|
263
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
264
|
-
*/
|
|
265
|
-
/**
|
|
266
|
-
* @param {?} option
|
|
267
|
-
* @return {?}
|
|
268
|
-
*/
|
|
269
144
|
function transformConfigurableCartItemAttribute(option) {
|
|
270
145
|
return {
|
|
271
146
|
attribute_label: option.option_label,
|
|
@@ -275,40 +150,28 @@
|
|
|
275
150
|
/**
|
|
276
151
|
* Transforms a MagentoConfigurableCartItem into a DaffCartItem.
|
|
277
152
|
*
|
|
278
|
-
* @param
|
|
279
|
-
* @return {?}
|
|
153
|
+
* @param response the response from a magento cart query.
|
|
280
154
|
*/
|
|
281
155
|
function transformMagentoConfigurableCartItem(configurableCartItem) {
|
|
282
156
|
return configurableCartItem ? Object.assign(Object.assign({}, transformMagentoSimpleCartItem(configurableCartItem)), { type: cart.DaffCartItemInputType.Configurable, attributes: configurableCartItem.configurable_options.map(transformConfigurableCartItemAttribute) }) : null;
|
|
283
157
|
}
|
|
284
158
|
|
|
285
|
-
/**
|
|
286
|
-
* @fileoverview added by tsickle
|
|
287
|
-
* Generated from: transforms/outputs/cart-item/cart-item-transformer.ts
|
|
288
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
289
|
-
*/
|
|
290
159
|
/**
|
|
291
160
|
* Transforms the MagentoCartItem into a DaffCartItem.
|
|
292
161
|
*
|
|
293
|
-
* @param
|
|
294
|
-
* @return {?}
|
|
162
|
+
* @param cartItem a MagentoCartItem
|
|
295
163
|
*/
|
|
296
164
|
function transformMagentoCartItem(cartItem) {
|
|
297
165
|
switch (cartItem.__typename) {
|
|
298
|
-
case MagentoCartItemTypeEnum.Bundle:
|
|
299
|
-
return transformMagentoBundleCartItem(
|
|
300
|
-
case MagentoCartItemTypeEnum.Configurable:
|
|
301
|
-
return transformMagentoConfigurableCartItem(
|
|
166
|
+
case exports.MagentoCartItemTypeEnum.Bundle:
|
|
167
|
+
return transformMagentoBundleCartItem(cartItem);
|
|
168
|
+
case exports.MagentoCartItemTypeEnum.Configurable:
|
|
169
|
+
return transformMagentoConfigurableCartItem(cartItem);
|
|
302
170
|
default:
|
|
303
171
|
return transformMagentoSimpleCartItem(cartItem);
|
|
304
172
|
}
|
|
305
173
|
}
|
|
306
174
|
|
|
307
|
-
/**
|
|
308
|
-
* @fileoverview added by tsickle
|
|
309
|
-
* Generated from: transforms/outputs/cart-payment.service.ts
|
|
310
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
311
|
-
*/
|
|
312
175
|
/**
|
|
313
176
|
* Transforms magento carts into an object usable by daffodil.
|
|
314
177
|
*/
|
|
@@ -318,8 +181,7 @@
|
|
|
318
181
|
/**
|
|
319
182
|
* Transforms the magento CartPayment from the magento cart query into a DaffCartPaymentMethod.
|
|
320
183
|
*
|
|
321
|
-
* @param
|
|
322
|
-
* @return {?}
|
|
184
|
+
* @param response the response from a magento cart query.
|
|
323
185
|
*/
|
|
324
186
|
DaffMagentoCartPaymentTransformer.prototype.transform = function (responsePayment) {
|
|
325
187
|
return responsePayment ? {
|
|
@@ -328,18 +190,13 @@
|
|
|
328
190
|
};
|
|
329
191
|
return DaffMagentoCartPaymentTransformer;
|
|
330
192
|
}());
|
|
193
|
+
/** @nocollapse */ DaffMagentoCartPaymentTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartPaymentTransformer_Factory() { return new DaffMagentoCartPaymentTransformer(); }, token: DaffMagentoCartPaymentTransformer, providedIn: "root" });
|
|
331
194
|
DaffMagentoCartPaymentTransformer.decorators = [
|
|
332
195
|
{ type: i0.Injectable, args: [{
|
|
333
196
|
providedIn: 'root',
|
|
334
197
|
},] }
|
|
335
198
|
];
|
|
336
|
-
/** @nocollapse */ DaffMagentoCartPaymentTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartPaymentTransformer_Factory() { return new DaffMagentoCartPaymentTransformer(); }, token: DaffMagentoCartPaymentTransformer, providedIn: "root" });
|
|
337
199
|
|
|
338
|
-
/**
|
|
339
|
-
* @fileoverview added by tsickle
|
|
340
|
-
* Generated from: transforms/outputs/cart-shipping-rate.service.ts
|
|
341
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
342
|
-
*/
|
|
343
200
|
/**
|
|
344
201
|
* Transforms magento cart shipping methods into an object usable by daffodil.
|
|
345
202
|
*/
|
|
@@ -349,8 +206,7 @@
|
|
|
349
206
|
/**
|
|
350
207
|
* Transforms the magento shipping method from the magento cart query into a DaffCartShippingRate.
|
|
351
208
|
*
|
|
352
|
-
* @param
|
|
353
|
-
* @return {?}
|
|
209
|
+
* @param shippingMethod the shippingMethod from a magento cart query.
|
|
354
210
|
*/
|
|
355
211
|
DaffMagentoCartShippingRateTransformer.prototype.transform = function (shippingMethod) {
|
|
356
212
|
return shippingMethod ? {
|
|
@@ -366,39 +222,34 @@
|
|
|
366
222
|
};
|
|
367
223
|
return DaffMagentoCartShippingRateTransformer;
|
|
368
224
|
}());
|
|
225
|
+
/** @nocollapse */ DaffMagentoCartShippingRateTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingRateTransformer_Factory() { return new DaffMagentoCartShippingRateTransformer(); }, token: DaffMagentoCartShippingRateTransformer, providedIn: "root" });
|
|
369
226
|
DaffMagentoCartShippingRateTransformer.decorators = [
|
|
370
227
|
{ type: i0.Injectable, args: [{
|
|
371
228
|
providedIn: 'root',
|
|
372
229
|
},] }
|
|
373
230
|
];
|
|
374
|
-
/** @nocollapse */ DaffMagentoCartShippingRateTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingRateTransformer_Factory() { return new DaffMagentoCartShippingRateTransformer(); }, token: DaffMagentoCartShippingRateTransformer, providedIn: "root" });
|
|
375
231
|
|
|
376
|
-
/**
|
|
377
|
-
* @fileoverview added by tsickle
|
|
378
|
-
* Generated from: transforms/outputs/cart-shipping-information.service.ts
|
|
379
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
380
|
-
*/
|
|
381
232
|
/**
|
|
382
233
|
* Transforms magento cart shipping methods into an object usable by daffodil.
|
|
383
234
|
*/
|
|
384
235
|
var DaffMagentoCartShippingInformationTransformer = /** @class */ (function () {
|
|
385
|
-
/**
|
|
386
|
-
* @param {?} shippingRateTransformer
|
|
387
|
-
*/
|
|
388
236
|
function DaffMagentoCartShippingInformationTransformer(shippingRateTransformer) {
|
|
389
237
|
this.shippingRateTransformer = shippingRateTransformer;
|
|
390
238
|
}
|
|
391
239
|
/**
|
|
392
240
|
* Transforms the magento shipping method from the magento cart query into a DaffCartShippingInformation.
|
|
393
241
|
*
|
|
394
|
-
* @param
|
|
395
|
-
* @return {?}
|
|
242
|
+
* @param shippingMethod the shippingMethod from a magento cart query.
|
|
396
243
|
*/
|
|
397
244
|
DaffMagentoCartShippingInformationTransformer.prototype.transform = function (shippingMethod) {
|
|
398
|
-
return shippingMethod ? Object.assign(Object.assign({}, this.shippingRateTransformer.transform(shippingMethod)), {
|
|
245
|
+
return shippingMethod ? Object.assign(Object.assign({}, this.shippingRateTransformer.transform(shippingMethod)), {
|
|
246
|
+
// TODO: implement
|
|
247
|
+
address_id: null
|
|
248
|
+
}) : null;
|
|
399
249
|
};
|
|
400
250
|
return DaffMagentoCartShippingInformationTransformer;
|
|
401
251
|
}());
|
|
252
|
+
/** @nocollapse */ DaffMagentoCartShippingInformationTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingInformationTransformer_Factory() { return new DaffMagentoCartShippingInformationTransformer(i0.ɵɵinject(DaffMagentoCartShippingRateTransformer)); }, token: DaffMagentoCartShippingInformationTransformer, providedIn: "root" });
|
|
402
253
|
DaffMagentoCartShippingInformationTransformer.decorators = [
|
|
403
254
|
{ type: i0.Injectable, args: [{
|
|
404
255
|
providedIn: 'root',
|
|
@@ -408,14 +259,6 @@
|
|
|
408
259
|
DaffMagentoCartShippingInformationTransformer.ctorParameters = function () { return [
|
|
409
260
|
{ type: DaffMagentoCartShippingRateTransformer }
|
|
410
261
|
]; };
|
|
411
|
-
/** @nocollapse */ DaffMagentoCartShippingInformationTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingInformationTransformer_Factory() { return new DaffMagentoCartShippingInformationTransformer(i0.ɵɵinject(DaffMagentoCartShippingRateTransformer)); }, token: DaffMagentoCartShippingInformationTransformer, providedIn: "root" });
|
|
412
|
-
if (false) {
|
|
413
|
-
/**
|
|
414
|
-
* @type {?}
|
|
415
|
-
* @private
|
|
416
|
-
*/
|
|
417
|
-
DaffMagentoCartShippingInformationTransformer.prototype.shippingRateTransformer;
|
|
418
|
-
}
|
|
419
262
|
|
|
420
263
|
/*! *****************************************************************************
|
|
421
264
|
Copyright (c) Microsoft Corporation.
|
|
@@ -652,7 +495,7 @@
|
|
|
652
495
|
ar[i] = from[i];
|
|
653
496
|
}
|
|
654
497
|
}
|
|
655
|
-
return to.concat(ar || from);
|
|
498
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
656
499
|
}
|
|
657
500
|
function __await(v) {
|
|
658
501
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -735,42 +578,19 @@
|
|
|
735
578
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
736
579
|
}
|
|
737
580
|
|
|
738
|
-
/**
|
|
739
|
-
* @param {?} discounts
|
|
740
|
-
* @return {?}
|
|
741
|
-
*/
|
|
742
581
|
function transformDiscounts(discounts) {
|
|
743
|
-
return discounts ? discounts.map((
|
|
744
|
-
* @param {?} discount
|
|
745
|
-
* @return {?}
|
|
746
|
-
*/function (/**
|
|
747
|
-
* @param {?} discount
|
|
748
|
-
* @return {?}
|
|
749
|
-
*/ discount) { return ({
|
|
582
|
+
return discounts ? discounts.map(function (discount) { return ({
|
|
750
583
|
name: cart.DaffCartTotalTypeEnum.discount,
|
|
751
584
|
label: discount.label,
|
|
752
585
|
value: discount.amount.value,
|
|
753
|
-
}); })
|
|
586
|
+
}); }) : [];
|
|
754
587
|
}
|
|
755
|
-
/**
|
|
756
|
-
* @param {?} cart
|
|
757
|
-
* @return {?}
|
|
758
|
-
*/
|
|
759
588
|
function validateSelectedShippingAddress(cart) {
|
|
760
589
|
var _a, _b, _c;
|
|
761
590
|
return !!((_c = (_b = (_a = cart.shipping_addresses) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.selected_shipping_method) === null || _c === void 0 ? void 0 : _c.amount);
|
|
762
591
|
}
|
|
763
|
-
/**
|
|
764
|
-
* @param {?} cart
|
|
765
|
-
* @return {?}
|
|
766
|
-
*/
|
|
767
592
|
function transformCartTotals(cart$1) {
|
|
768
|
-
|
|
769
|
-
var totalTax = cart$1.prices.applied_taxes ? cart$1.prices.applied_taxes.reduce(( /**
|
|
770
|
-
* @param {?} acc
|
|
771
|
-
* @param {?} tax
|
|
772
|
-
* @return {?}
|
|
773
|
-
*/function (acc, tax) { return (core.daffAdd(acc, tax.amount.value)); }), 0) : 0;
|
|
593
|
+
var totalTax = cart$1.prices.applied_taxes ? cart$1.prices.applied_taxes.reduce(function (acc, tax) { return (core.daffAdd(acc, tax.amount.value)); }, 0) : 0;
|
|
774
594
|
return {
|
|
775
595
|
totals: __spread([
|
|
776
596
|
{
|
|
@@ -815,32 +635,24 @@
|
|
|
815
635
|
};
|
|
816
636
|
}
|
|
817
637
|
|
|
818
|
-
/**
|
|
819
|
-
* @fileoverview added by tsickle
|
|
820
|
-
* Generated from: transforms/outputs/shipping-address.service.ts
|
|
821
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
822
|
-
*/
|
|
823
638
|
/**
|
|
824
639
|
* Transforms magento addresses into an object usable by daffodil.
|
|
825
640
|
*/
|
|
826
641
|
var DaffMagentoShippingAddressTransformer = /** @class */ (function () {
|
|
827
|
-
/**
|
|
828
|
-
* @param {?} addressTransformer
|
|
829
|
-
*/
|
|
830
642
|
function DaffMagentoShippingAddressTransformer(addressTransformer) {
|
|
831
643
|
this.addressTransformer = addressTransformer;
|
|
832
644
|
}
|
|
833
645
|
/**
|
|
834
646
|
* Transforms the magento MagentoCart from the magento cart query into a DaffCartAddress.
|
|
835
647
|
*
|
|
836
|
-
* @param
|
|
837
|
-
* @return {?}
|
|
648
|
+
* @param address the address from a magento cart query.
|
|
838
649
|
*/
|
|
839
650
|
DaffMagentoShippingAddressTransformer.prototype.transform = function (address) {
|
|
840
651
|
return address ? Object.assign(Object.assign({}, this.addressTransformer.transform(address)), { address_type: 'shipping' }) : null;
|
|
841
652
|
};
|
|
842
653
|
return DaffMagentoShippingAddressTransformer;
|
|
843
654
|
}());
|
|
655
|
+
/** @nocollapse */ DaffMagentoShippingAddressTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoShippingAddressTransformer_Factory() { return new DaffMagentoShippingAddressTransformer(i0.ɵɵinject(DaffMagentoCartAddressTransformer)); }, token: DaffMagentoShippingAddressTransformer, providedIn: "root" });
|
|
844
656
|
DaffMagentoShippingAddressTransformer.decorators = [
|
|
845
657
|
{ type: i0.Injectable, args: [{
|
|
846
658
|
providedIn: 'root',
|
|
@@ -850,31 +662,11 @@
|
|
|
850
662
|
DaffMagentoShippingAddressTransformer.ctorParameters = function () { return [
|
|
851
663
|
{ type: DaffMagentoCartAddressTransformer }
|
|
852
664
|
]; };
|
|
853
|
-
/** @nocollapse */ DaffMagentoShippingAddressTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoShippingAddressTransformer_Factory() { return new DaffMagentoShippingAddressTransformer(i0.ɵɵinject(DaffMagentoCartAddressTransformer)); }, token: DaffMagentoShippingAddressTransformer, providedIn: "root" });
|
|
854
|
-
if (false) {
|
|
855
|
-
/**
|
|
856
|
-
* @type {?}
|
|
857
|
-
* @private
|
|
858
|
-
*/
|
|
859
|
-
DaffMagentoShippingAddressTransformer.prototype.addressTransformer;
|
|
860
|
-
}
|
|
861
665
|
|
|
862
|
-
/**
|
|
863
|
-
* @fileoverview added by tsickle
|
|
864
|
-
* Generated from: transforms/outputs/cart.service.ts
|
|
865
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
866
|
-
*/
|
|
867
666
|
/**
|
|
868
667
|
* Transforms magento carts into an object usable by daffodil.
|
|
869
668
|
*/
|
|
870
669
|
var DaffMagentoCartTransformer = /** @class */ (function () {
|
|
871
|
-
/**
|
|
872
|
-
* @param {?} shippingAddressTransformer
|
|
873
|
-
* @param {?} billingAddressTransformer
|
|
874
|
-
* @param {?} paymentTransformer
|
|
875
|
-
* @param {?} shippingInformationTransformer
|
|
876
|
-
* @param {?} shippingRateTransformer
|
|
877
|
-
*/
|
|
878
670
|
function DaffMagentoCartTransformer(shippingAddressTransformer, billingAddressTransformer, paymentTransformer, shippingInformationTransformer, shippingRateTransformer) {
|
|
879
671
|
this.shippingAddressTransformer = shippingAddressTransformer;
|
|
880
672
|
this.billingAddressTransformer = billingAddressTransformer;
|
|
@@ -882,11 +674,6 @@
|
|
|
882
674
|
this.shippingInformationTransformer = shippingInformationTransformer;
|
|
883
675
|
this.shippingRateTransformer = shippingRateTransformer;
|
|
884
676
|
}
|
|
885
|
-
/**
|
|
886
|
-
* @private
|
|
887
|
-
* @param {?} cart
|
|
888
|
-
* @return {?}
|
|
889
|
-
*/
|
|
890
677
|
DaffMagentoCartTransformer.prototype.transformShippingAddress = function (cart) {
|
|
891
678
|
return {
|
|
892
679
|
shipping_address: cart.shipping_addresses[0]
|
|
@@ -894,11 +681,6 @@
|
|
|
894
681
|
: null,
|
|
895
682
|
};
|
|
896
683
|
};
|
|
897
|
-
/**
|
|
898
|
-
* @private
|
|
899
|
-
* @param {?} cart
|
|
900
|
-
* @return {?}
|
|
901
|
-
*/
|
|
902
684
|
DaffMagentoCartTransformer.prototype.transformBillingAddress = function (cart) {
|
|
903
685
|
return {
|
|
904
686
|
billing_address: cart.billing_address
|
|
@@ -906,32 +688,17 @@
|
|
|
906
688
|
: null,
|
|
907
689
|
};
|
|
908
690
|
};
|
|
909
|
-
/**
|
|
910
|
-
* @private
|
|
911
|
-
* @param {?} cart
|
|
912
|
-
* @return {?}
|
|
913
|
-
*/
|
|
914
691
|
DaffMagentoCartTransformer.prototype.transformCartItems = function (cart) {
|
|
915
692
|
return {
|
|
916
693
|
items: cart.items.map(transformMagentoCartItem),
|
|
917
694
|
};
|
|
918
695
|
};
|
|
919
|
-
/**
|
|
920
|
-
* @private
|
|
921
|
-
* @param {?} cart
|
|
922
|
-
* @return {?}
|
|
923
|
-
*/
|
|
924
696
|
DaffMagentoCartTransformer.prototype.transformTotals = function (cart) {
|
|
925
697
|
return {
|
|
926
698
|
grand_total: cart.prices.grand_total.value,
|
|
927
699
|
subtotal: cart.prices.subtotal_excluding_tax.value,
|
|
928
700
|
};
|
|
929
701
|
};
|
|
930
|
-
/**
|
|
931
|
-
* @private
|
|
932
|
-
* @param {?} cart
|
|
933
|
-
* @return {?}
|
|
934
|
-
*/
|
|
935
702
|
DaffMagentoCartTransformer.prototype.transformCoupons = function (cart) {
|
|
936
703
|
return {
|
|
937
704
|
coupons: cart.applied_coupons
|
|
@@ -939,21 +706,11 @@
|
|
|
939
706
|
: [],
|
|
940
707
|
};
|
|
941
708
|
};
|
|
942
|
-
/**
|
|
943
|
-
* @private
|
|
944
|
-
* @param {?} cart
|
|
945
|
-
* @return {?}
|
|
946
|
-
*/
|
|
947
709
|
DaffMagentoCartTransformer.prototype.transformPayment = function (cart) {
|
|
948
710
|
return {
|
|
949
711
|
payment: this.paymentTransformer.transform(cart.selected_payment_method),
|
|
950
712
|
};
|
|
951
713
|
};
|
|
952
|
-
/**
|
|
953
|
-
* @private
|
|
954
|
-
* @param {?} cart
|
|
955
|
-
* @return {?}
|
|
956
|
-
*/
|
|
957
714
|
DaffMagentoCartTransformer.prototype.transformShippingInformation = function (cart) {
|
|
958
715
|
return {
|
|
959
716
|
shipping_information: cart.shipping_addresses[0]
|
|
@@ -961,53 +718,31 @@
|
|
|
961
718
|
: null,
|
|
962
719
|
};
|
|
963
720
|
};
|
|
964
|
-
/**
|
|
965
|
-
* @private
|
|
966
|
-
* @param {?} cart
|
|
967
|
-
* @return {?}
|
|
968
|
-
*/
|
|
969
721
|
DaffMagentoCartTransformer.prototype.transformShippingMethods = function (cart) {
|
|
970
722
|
var _this = this;
|
|
971
723
|
return {
|
|
972
724
|
available_shipping_methods: cart.shipping_addresses[0] && cart.shipping_addresses[0].available_shipping_methods
|
|
973
|
-
? cart.shipping_addresses[0].available_shipping_methods.map((
|
|
974
|
-
* @param {?} method
|
|
975
|
-
* @return {?}
|
|
976
|
-
*/function (/**
|
|
977
|
-
* @param {?} method
|
|
978
|
-
* @return {?}
|
|
979
|
-
*/ method) { return _this.shippingRateTransformer.transform(method); }))
|
|
725
|
+
? cart.shipping_addresses[0].available_shipping_methods.map(function (method) { return _this.shippingRateTransformer.transform(method); })
|
|
980
726
|
: [],
|
|
981
727
|
};
|
|
982
728
|
};
|
|
983
|
-
/**
|
|
984
|
-
* @private
|
|
985
|
-
* @param {?} cart
|
|
986
|
-
* @return {?}
|
|
987
|
-
*/
|
|
988
729
|
DaffMagentoCartTransformer.prototype.transformPaymentMethods = function (cart) {
|
|
989
730
|
var _this = this;
|
|
990
731
|
return {
|
|
991
|
-
available_payment_methods: cart.available_payment_methods.map((
|
|
992
|
-
* @param {?} method
|
|
993
|
-
* @return {?}
|
|
994
|
-
*/function (/**
|
|
995
|
-
* @param {?} method
|
|
996
|
-
* @return {?}
|
|
997
|
-
*/ method) { return _this.paymentTransformer.transform(method); })),
|
|
732
|
+
available_payment_methods: cart.available_payment_methods.map(function (method) { return _this.paymentTransformer.transform(method); }),
|
|
998
733
|
};
|
|
999
734
|
};
|
|
1000
735
|
/**
|
|
1001
736
|
* Transforms the magento MagentoCart from the magento cart query into a DaffCart.
|
|
1002
737
|
*
|
|
1003
|
-
* @param
|
|
1004
|
-
* @return {?}
|
|
738
|
+
* @param cart the cart from a magento cart query.
|
|
1005
739
|
*/
|
|
1006
740
|
DaffMagentoCartTransformer.prototype.transform = function (cart) {
|
|
1007
741
|
return cart ? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ extra_attributes: cart }, this.transformCartItems(cart)), this.transformBillingAddress(cart)), this.transformShippingAddress(cart)), this.transformCoupons(cart)), this.transformPayment(cart)), this.transformTotals(cart)), transformCartTotals(cart)), this.transformShippingInformation(cart)), this.transformShippingMethods(cart)), this.transformPaymentMethods(cart)), { id: cart.id }) : null;
|
|
1008
742
|
};
|
|
1009
743
|
return DaffMagentoCartTransformer;
|
|
1010
744
|
}());
|
|
745
|
+
/** @nocollapse */ DaffMagentoCartTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartTransformer_Factory() { return new DaffMagentoCartTransformer(i0.ɵɵinject(DaffMagentoShippingAddressTransformer), i0.ɵɵinject(DaffMagentoBillingAddressTransformer), i0.ɵɵinject(DaffMagentoCartPaymentTransformer), i0.ɵɵinject(DaffMagentoCartShippingInformationTransformer), i0.ɵɵinject(DaffMagentoCartShippingRateTransformer)); }, token: DaffMagentoCartTransformer, providedIn: "root" });
|
|
1011
746
|
DaffMagentoCartTransformer.decorators = [
|
|
1012
747
|
{ type: i0.Injectable, args: [{
|
|
1013
748
|
providedIn: 'root',
|
|
@@ -1021,47 +756,10 @@
|
|
|
1021
756
|
{ type: DaffMagentoCartShippingInformationTransformer },
|
|
1022
757
|
{ type: DaffMagentoCartShippingRateTransformer }
|
|
1023
758
|
]; };
|
|
1024
|
-
/** @nocollapse */ DaffMagentoCartTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartTransformer_Factory() { return new DaffMagentoCartTransformer(i0.ɵɵinject(DaffMagentoShippingAddressTransformer), i0.ɵɵinject(DaffMagentoBillingAddressTransformer), i0.ɵɵinject(DaffMagentoCartPaymentTransformer), i0.ɵɵinject(DaffMagentoCartShippingInformationTransformer), i0.ɵɵinject(DaffMagentoCartShippingRateTransformer)); }, token: DaffMagentoCartTransformer, providedIn: "root" });
|
|
1025
|
-
if (false) {
|
|
1026
|
-
/**
|
|
1027
|
-
* @type {?}
|
|
1028
|
-
* @private
|
|
1029
|
-
*/
|
|
1030
|
-
DaffMagentoCartTransformer.prototype.shippingAddressTransformer;
|
|
1031
|
-
/**
|
|
1032
|
-
* @type {?}
|
|
1033
|
-
* @private
|
|
1034
|
-
*/
|
|
1035
|
-
DaffMagentoCartTransformer.prototype.billingAddressTransformer;
|
|
1036
|
-
/**
|
|
1037
|
-
* @type {?}
|
|
1038
|
-
* @private
|
|
1039
|
-
*/
|
|
1040
|
-
DaffMagentoCartTransformer.prototype.paymentTransformer;
|
|
1041
|
-
/**
|
|
1042
|
-
* @type {?}
|
|
1043
|
-
* @private
|
|
1044
|
-
*/
|
|
1045
|
-
DaffMagentoCartTransformer.prototype.shippingInformationTransformer;
|
|
1046
|
-
/**
|
|
1047
|
-
* @type {?}
|
|
1048
|
-
* @private
|
|
1049
|
-
*/
|
|
1050
|
-
DaffMagentoCartTransformer.prototype.shippingRateTransformer;
|
|
1051
|
-
}
|
|
1052
759
|
|
|
1053
|
-
/**
|
|
1054
|
-
* @fileoverview added by tsickle
|
|
1055
|
-
* Generated from: transforms/inputs/cart-address.service.ts
|
|
1056
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1057
|
-
*/
|
|
1058
760
|
var DaffMagentoCartAddressInputTransformer = /** @class */ (function () {
|
|
1059
761
|
function DaffMagentoCartAddressInputTransformer() {
|
|
1060
762
|
}
|
|
1061
|
-
/**
|
|
1062
|
-
* @param {?} cartAddress
|
|
1063
|
-
* @return {?}
|
|
1064
|
-
*/
|
|
1065
763
|
DaffMagentoCartAddressInputTransformer.prototype.transform = function (cartAddress) {
|
|
1066
764
|
return {
|
|
1067
765
|
city: cartAddress.city,
|
|
@@ -1077,29 +775,17 @@
|
|
|
1077
775
|
};
|
|
1078
776
|
return DaffMagentoCartAddressInputTransformer;
|
|
1079
777
|
}());
|
|
778
|
+
/** @nocollapse */ DaffMagentoCartAddressInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartAddressInputTransformer_Factory() { return new DaffMagentoCartAddressInputTransformer(); }, token: DaffMagentoCartAddressInputTransformer, providedIn: "root" });
|
|
1080
779
|
DaffMagentoCartAddressInputTransformer.decorators = [
|
|
1081
780
|
{ type: i0.Injectable, args: [{
|
|
1082
781
|
providedIn: 'root',
|
|
1083
782
|
},] }
|
|
1084
783
|
];
|
|
1085
|
-
/** @nocollapse */ DaffMagentoCartAddressInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartAddressInputTransformer_Factory() { return new DaffMagentoCartAddressInputTransformer(); }, token: DaffMagentoCartAddressInputTransformer, providedIn: "root" });
|
|
1086
784
|
|
|
1087
|
-
/**
|
|
1088
|
-
* @fileoverview added by tsickle
|
|
1089
|
-
* Generated from: transforms/inputs/shipping-address.service.ts
|
|
1090
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1091
|
-
*/
|
|
1092
785
|
var DaffMagentoShippingAddressInputTransformer = /** @class */ (function () {
|
|
1093
|
-
/**
|
|
1094
|
-
* @param {?} cartAddressTransformer
|
|
1095
|
-
*/
|
|
1096
786
|
function DaffMagentoShippingAddressInputTransformer(cartAddressTransformer) {
|
|
1097
787
|
this.cartAddressTransformer = cartAddressTransformer;
|
|
1098
788
|
}
|
|
1099
|
-
/**
|
|
1100
|
-
* @param {?} cartAddress
|
|
1101
|
-
* @return {?}
|
|
1102
|
-
*/
|
|
1103
789
|
DaffMagentoShippingAddressInputTransformer.prototype.transform = function (cartAddress) {
|
|
1104
790
|
return cartAddress.address_id
|
|
1105
791
|
? {
|
|
@@ -1113,6 +799,7 @@
|
|
|
1113
799
|
};
|
|
1114
800
|
return DaffMagentoShippingAddressInputTransformer;
|
|
1115
801
|
}());
|
|
802
|
+
/** @nocollapse */ DaffMagentoShippingAddressInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoShippingAddressInputTransformer_Factory() { return new DaffMagentoShippingAddressInputTransformer(i0.ɵɵinject(DaffMagentoCartAddressInputTransformer)); }, token: DaffMagentoShippingAddressInputTransformer, providedIn: "root" });
|
|
1116
803
|
DaffMagentoShippingAddressInputTransformer.decorators = [
|
|
1117
804
|
{ type: i0.Injectable, args: [{
|
|
1118
805
|
providedIn: 'root',
|
|
@@ -1122,31 +809,11 @@
|
|
|
1122
809
|
DaffMagentoShippingAddressInputTransformer.ctorParameters = function () { return [
|
|
1123
810
|
{ type: DaffMagentoCartAddressInputTransformer }
|
|
1124
811
|
]; };
|
|
1125
|
-
/** @nocollapse */ DaffMagentoShippingAddressInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoShippingAddressInputTransformer_Factory() { return new DaffMagentoShippingAddressInputTransformer(i0.ɵɵinject(DaffMagentoCartAddressInputTransformer)); }, token: DaffMagentoShippingAddressInputTransformer, providedIn: "root" });
|
|
1126
|
-
if (false) {
|
|
1127
|
-
/**
|
|
1128
|
-
* @type {?}
|
|
1129
|
-
* @private
|
|
1130
|
-
*/
|
|
1131
|
-
DaffMagentoShippingAddressInputTransformer.prototype.cartAddressTransformer;
|
|
1132
|
-
}
|
|
1133
812
|
|
|
1134
|
-
/**
|
|
1135
|
-
* @fileoverview added by tsickle
|
|
1136
|
-
* Generated from: transforms/inputs/billing-address.service.ts
|
|
1137
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1138
|
-
*/
|
|
1139
813
|
var DaffMagentoBillingAddressInputTransformer = /** @class */ (function () {
|
|
1140
|
-
/**
|
|
1141
|
-
* @param {?} cartAddressTransformer
|
|
1142
|
-
*/
|
|
1143
814
|
function DaffMagentoBillingAddressInputTransformer(cartAddressTransformer) {
|
|
1144
815
|
this.cartAddressTransformer = cartAddressTransformer;
|
|
1145
816
|
}
|
|
1146
|
-
/**
|
|
1147
|
-
* @param {?} cartAddress
|
|
1148
|
-
* @return {?}
|
|
1149
|
-
*/
|
|
1150
817
|
DaffMagentoBillingAddressInputTransformer.prototype.transform = function (cartAddress) {
|
|
1151
818
|
return cartAddress.address_id
|
|
1152
819
|
? {
|
|
@@ -1160,6 +827,7 @@
|
|
|
1160
827
|
};
|
|
1161
828
|
return DaffMagentoBillingAddressInputTransformer;
|
|
1162
829
|
}());
|
|
830
|
+
/** @nocollapse */ DaffMagentoBillingAddressInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoBillingAddressInputTransformer_Factory() { return new DaffMagentoBillingAddressInputTransformer(i0.ɵɵinject(DaffMagentoCartAddressInputTransformer)); }, token: DaffMagentoBillingAddressInputTransformer, providedIn: "root" });
|
|
1163
831
|
DaffMagentoBillingAddressInputTransformer.decorators = [
|
|
1164
832
|
{ type: i0.Injectable, args: [{
|
|
1165
833
|
providedIn: 'root',
|
|
@@ -1169,27 +837,10 @@
|
|
|
1169
837
|
DaffMagentoBillingAddressInputTransformer.ctorParameters = function () { return [
|
|
1170
838
|
{ type: DaffMagentoCartAddressInputTransformer }
|
|
1171
839
|
]; };
|
|
1172
|
-
/** @nocollapse */ DaffMagentoBillingAddressInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoBillingAddressInputTransformer_Factory() { return new DaffMagentoBillingAddressInputTransformer(i0.ɵɵinject(DaffMagentoCartAddressInputTransformer)); }, token: DaffMagentoBillingAddressInputTransformer, providedIn: "root" });
|
|
1173
|
-
if (false) {
|
|
1174
|
-
/**
|
|
1175
|
-
* @type {?}
|
|
1176
|
-
* @private
|
|
1177
|
-
*/
|
|
1178
|
-
DaffMagentoBillingAddressInputTransformer.prototype.cartAddressTransformer;
|
|
1179
|
-
}
|
|
1180
840
|
|
|
1181
|
-
/**
|
|
1182
|
-
* @fileoverview added by tsickle
|
|
1183
|
-
* Generated from: transforms/inputs/cart-item-update.service.ts
|
|
1184
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1185
|
-
*/
|
|
1186
841
|
var DaffMagentoCartItemUpdateInputTransformer = /** @class */ (function () {
|
|
1187
842
|
function DaffMagentoCartItemUpdateInputTransformer() {
|
|
1188
843
|
}
|
|
1189
|
-
/**
|
|
1190
|
-
* @param {?} item
|
|
1191
|
-
* @return {?}
|
|
1192
|
-
*/
|
|
1193
844
|
DaffMagentoCartItemUpdateInputTransformer.prototype.transform = function (item) {
|
|
1194
845
|
return {
|
|
1195
846
|
quantity: item.qty,
|
|
@@ -1198,49 +849,31 @@
|
|
|
1198
849
|
};
|
|
1199
850
|
return DaffMagentoCartItemUpdateInputTransformer;
|
|
1200
851
|
}());
|
|
852
|
+
/** @nocollapse */ DaffMagentoCartItemUpdateInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartItemUpdateInputTransformer_Factory() { return new DaffMagentoCartItemUpdateInputTransformer(); }, token: DaffMagentoCartItemUpdateInputTransformer, providedIn: "root" });
|
|
1201
853
|
DaffMagentoCartItemUpdateInputTransformer.decorators = [
|
|
1202
854
|
{ type: i0.Injectable, args: [{
|
|
1203
855
|
providedIn: 'root',
|
|
1204
856
|
},] }
|
|
1205
857
|
];
|
|
1206
|
-
/** @nocollapse */ DaffMagentoCartItemUpdateInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartItemUpdateInputTransformer_Factory() { return new DaffMagentoCartItemUpdateInputTransformer(); }, token: DaffMagentoCartItemUpdateInputTransformer, providedIn: "root" });
|
|
1207
858
|
|
|
1208
|
-
/**
|
|
1209
|
-
* @fileoverview added by tsickle
|
|
1210
|
-
* Generated from: transforms/inputs/payment-method.service.ts
|
|
1211
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1212
|
-
*/
|
|
1213
859
|
var DaffMagentoPaymentMethodInputTransformer = /** @class */ (function () {
|
|
1214
860
|
function DaffMagentoPaymentMethodInputTransformer() {
|
|
1215
861
|
}
|
|
1216
|
-
/**
|
|
1217
|
-
* @param {?} payment
|
|
1218
|
-
* @return {?}
|
|
1219
|
-
*/
|
|
1220
862
|
DaffMagentoPaymentMethodInputTransformer.prototype.transform = function (payment) {
|
|
1221
863
|
return Object.assign({}, payment.payment_info);
|
|
1222
864
|
};
|
|
1223
865
|
return DaffMagentoPaymentMethodInputTransformer;
|
|
1224
866
|
}());
|
|
867
|
+
/** @nocollapse */ DaffMagentoPaymentMethodInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoPaymentMethodInputTransformer_Factory() { return new DaffMagentoPaymentMethodInputTransformer(); }, token: DaffMagentoPaymentMethodInputTransformer, providedIn: "root" });
|
|
1225
868
|
DaffMagentoPaymentMethodInputTransformer.decorators = [
|
|
1226
869
|
{ type: i0.Injectable, args: [{
|
|
1227
870
|
providedIn: 'root',
|
|
1228
871
|
},] }
|
|
1229
872
|
];
|
|
1230
|
-
/** @nocollapse */ DaffMagentoPaymentMethodInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoPaymentMethodInputTransformer_Factory() { return new DaffMagentoPaymentMethodInputTransformer(); }, token: DaffMagentoPaymentMethodInputTransformer, providedIn: "root" });
|
|
1231
873
|
|
|
1232
|
-
/**
|
|
1233
|
-
* @fileoverview added by tsickle
|
|
1234
|
-
* Generated from: transforms/inputs/shipping-method.service.ts
|
|
1235
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1236
|
-
*/
|
|
1237
874
|
var DaffMagentoShippingMethodInputTransformer = /** @class */ (function () {
|
|
1238
875
|
function DaffMagentoShippingMethodInputTransformer() {
|
|
1239
876
|
}
|
|
1240
|
-
/**
|
|
1241
|
-
* @param {?} method
|
|
1242
|
-
* @return {?}
|
|
1243
|
-
*/
|
|
1244
877
|
DaffMagentoShippingMethodInputTransformer.prototype.transform = function (method) {
|
|
1245
878
|
return {
|
|
1246
879
|
carrier_code: method.carrier,
|
|
@@ -1249,30 +882,13 @@
|
|
|
1249
882
|
};
|
|
1250
883
|
return DaffMagentoShippingMethodInputTransformer;
|
|
1251
884
|
}());
|
|
885
|
+
/** @nocollapse */ DaffMagentoShippingMethodInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoShippingMethodInputTransformer_Factory() { return new DaffMagentoShippingMethodInputTransformer(); }, token: DaffMagentoShippingMethodInputTransformer, providedIn: "root" });
|
|
1252
886
|
DaffMagentoShippingMethodInputTransformer.decorators = [
|
|
1253
887
|
{ type: i0.Injectable, args: [{
|
|
1254
888
|
providedIn: 'root',
|
|
1255
889
|
},] }
|
|
1256
890
|
];
|
|
1257
|
-
/** @nocollapse */ DaffMagentoShippingMethodInputTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoShippingMethodInputTransformer_Factory() { return new DaffMagentoShippingMethodInputTransformer(); }, token: DaffMagentoShippingMethodInputTransformer, providedIn: "root" });
|
|
1258
|
-
|
|
1259
|
-
/**
|
|
1260
|
-
* @fileoverview added by tsickle
|
|
1261
|
-
* Generated from: transforms/public_api.ts
|
|
1262
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1263
|
-
*/
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* @fileoverview added by tsickle
|
|
1267
|
-
* Generated from: models/responses/public_api.ts
|
|
1268
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1269
|
-
*/
|
|
1270
891
|
|
|
1271
|
-
/**
|
|
1272
|
-
* @fileoverview added by tsickle
|
|
1273
|
-
* Generated from: injection-tokens/fragments/cart.ts
|
|
1274
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1275
|
-
*/
|
|
1276
892
|
/**
|
|
1277
893
|
* An multi-provider injection token for providing extra GraphQL fragments that will be spread into cart queries.
|
|
1278
894
|
* This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.
|
|
@@ -1284,244 +900,146 @@
|
|
|
1284
900
|
* Daffodil only guarantees that stock queries don't exceed the limit of 300.
|
|
1285
901
|
* Apps using this token should therefore increase the query complexity limit
|
|
1286
902
|
* to accommodate the extra complexity contributed by the provided fragments.
|
|
1287
|
-
* @type {?}
|
|
1288
|
-
*/
|
|
1289
|
-
var DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS = new i0.InjectionToken('DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS', { factory: ( /**
|
|
1290
|
-
* @return {?}
|
|
1291
|
-
*/function () { return []; }) });
|
|
1292
|
-
|
|
1293
|
-
/**
|
|
1294
|
-
* @fileoverview added by tsickle
|
|
1295
|
-
* Generated from: injection-tokens/public_api.ts
|
|
1296
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1297
903
|
*/
|
|
904
|
+
var DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS = new i0.InjectionToken('DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS', { factory: function () { return []; } });
|
|
1298
905
|
|
|
1299
|
-
/** @type {?} */
|
|
1300
906
|
var moneyFragment = i1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment money on Money {\n value\n currency\n }\n"], ["\n fragment money on Money {\n value\n currency\n }\n"])));
|
|
1301
907
|
var templateObject_1;
|
|
1302
908
|
|
|
1303
|
-
/** @type {?} */
|
|
1304
909
|
var cartCouponFragment = i1.gql(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n fragment cartCoupon on AppliedCoupon {\n code\n }\n"], ["\n fragment cartCoupon on AppliedCoupon {\n code\n }\n"])));
|
|
1305
910
|
var templateObject_1$1;
|
|
1306
911
|
|
|
1307
|
-
/** @type {?} */
|
|
1308
912
|
var cartAddressFragment = i1.gql(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n fragment cartAddress on CartAddressInterface {\n city\n country {\n code\n label\n }\n firstname\n lastname\n postcode\n region {\n code\n label\n }\n street\n telephone\n company\n }\n"], ["\n fragment cartAddress on CartAddressInterface {\n city\n country {\n code\n label\n }\n firstname\n lastname\n postcode\n region {\n code\n label\n }\n street\n telephone\n company\n }\n"])));
|
|
1309
913
|
var templateObject_1$2;
|
|
1310
914
|
|
|
1311
|
-
/** @type {?} */
|
|
1312
915
|
var cartItemProductFragment = i1.gql(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n fragment cartItemProduct on ProductInterface {\n id\n\t\tname\n sku\n url_key\n url_suffix\n thumbnail {\n label\n url\n }\n stock_status\n }\n"], ["\n fragment cartItemProduct on ProductInterface {\n id\n\t\tname\n sku\n url_key\n url_suffix\n thumbnail {\n label\n url\n }\n stock_status\n }\n"])));
|
|
1313
|
-
/** @type {?} */
|
|
1314
916
|
var cartItemFragment = i1.gql(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n fragment cartItem on CartItemInterface {\n\t\t__typename\n id\n product {\n ...cartItemProduct\n }\n quantity\n prices {\n price {\n ...money\n }\n row_total {\n ...money\n }\n discounts {\n amount {\n ...money\n }\n label\n }\n\t\t}\n\t\t...on ConfigurableCartItem {\n\t\t\tconfigurable_options {\n\t\t\t\toption_label\n\t\t\t\tvalue_label\n\t\t\t}\n\t\t}\n\t\t...on BundleCartItem {\n\t\t\tbundle_options {\n\t\t\t\tid\n\t\t\t\tlabel\n\t\t\t\ttype\n\t\t\t\tvalues {\n\t\t\t\t\tid\n\t\t\t\t\tlabel\n\t\t\t\t\tprice\n\t\t\t\t\tquantity\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n ", "\n ", "\n"], ["\n fragment cartItem on CartItemInterface {\n\t\t__typename\n id\n product {\n ...cartItemProduct\n }\n quantity\n prices {\n price {\n ...money\n }\n row_total {\n ...money\n }\n discounts {\n amount {\n ...money\n }\n label\n }\n\t\t}\n\t\t...on ConfigurableCartItem {\n\t\t\tconfigurable_options {\n\t\t\t\toption_label\n\t\t\t\tvalue_label\n\t\t\t}\n\t\t}\n\t\t...on BundleCartItem {\n\t\t\tbundle_options {\n\t\t\t\tid\n\t\t\t\tlabel\n\t\t\t\ttype\n\t\t\t\tvalues {\n\t\t\t\t\tid\n\t\t\t\t\tlabel\n\t\t\t\t\tprice\n\t\t\t\t\tquantity\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n ", "\n ", "\n"])), cartItemProductFragment, moneyFragment);
|
|
1315
917
|
var templateObject_1$3, templateObject_2;
|
|
1316
918
|
|
|
1317
|
-
/** @type {?} */
|
|
1318
919
|
var availablePaymentMethodFragment = i1.gql(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n fragment availablePaymentMethod on AvailablePaymentMethod {\n code\n title\n }\n"], ["\n fragment availablePaymentMethod on AvailablePaymentMethod {\n code\n title\n }\n"])));
|
|
1319
920
|
var templateObject_1$4;
|
|
1320
921
|
|
|
1321
|
-
/** @type {?} */
|
|
1322
922
|
var selectedPaymentMethodFragment = i1.gql(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n fragment selectedPaymentMethod on SelectedPaymentMethod {\n code\n title\n purchase_order_number\n }\n"], ["\n fragment selectedPaymentMethod on SelectedPaymentMethod {\n code\n title\n purchase_order_number\n }\n"])));
|
|
1323
923
|
var templateObject_1$5;
|
|
1324
924
|
|
|
1325
|
-
/** @type {?} */
|
|
1326
925
|
var availableShippingMethodFragment = i1.gql(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n fragment availableShippingMethod on AvailableShippingMethod {\n carrier_code\n method_code\n carrier_title\n method_title\n amount {\n ...money\n }\n }\n ", "\n"], ["\n fragment availableShippingMethod on AvailableShippingMethod {\n carrier_code\n method_code\n carrier_title\n method_title\n amount {\n ...money\n }\n }\n ", "\n"])), moneyFragment);
|
|
1327
926
|
var templateObject_1$6;
|
|
1328
927
|
|
|
1329
|
-
/** @type {?} */
|
|
1330
928
|
var selectedShippingMethodFragment = i1.gql(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n fragment selectedShippingMethod on SelectedShippingMethod {\n carrier_code\n method_code\n carrier_title\n method_title\n amount {\n ...money\n }\n }\n ", "\n"], ["\n fragment selectedShippingMethod on SelectedShippingMethod {\n carrier_code\n method_code\n carrier_title\n method_title\n amount {\n ...money\n }\n }\n ", "\n"])), moneyFragment);
|
|
1331
929
|
var templateObject_1$7;
|
|
1332
930
|
|
|
1333
|
-
/** @type {?} */
|
|
1334
931
|
var pricesFragment = i1.gql(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n fragment prices on CartPrices {\n\t\tgrand_total {\n\t\t\t...money\n\t\t}\n\t\tsubtotal_excluding_tax {\n\t\t\t...money\n\t\t}\n\t\tsubtotal_including_tax {\n\t\t\t...money\n\t\t}\n\t\tsubtotal_with_discount_excluding_tax {\n\t\t\t...money\n\t\t}\n\t\tapplied_taxes {\n\t\t\tamount {\n\t\t\t\t...money\n\t\t\t}\n\t\t\tlabel\n\t\t}\n\t\tdiscounts {\n\t\t\tamount {\n\t\t\t\t...money\n\t\t\t}\n\t\t\tlabel\n\t\t}\n\t}\n ", "\n"], ["\n fragment prices on CartPrices {\n\t\tgrand_total {\n\t\t\t...money\n\t\t}\n\t\tsubtotal_excluding_tax {\n\t\t\t...money\n\t\t}\n\t\tsubtotal_including_tax {\n\t\t\t...money\n\t\t}\n\t\tsubtotal_with_discount_excluding_tax {\n\t\t\t...money\n\t\t}\n\t\tapplied_taxes {\n\t\t\tamount {\n\t\t\t\t...money\n\t\t\t}\n\t\t\tlabel\n\t\t}\n\t\tdiscounts {\n\t\t\tamount {\n\t\t\t\t...money\n\t\t\t}\n\t\t\tlabel\n\t\t}\n\t}\n ", "\n"])), moneyFragment);
|
|
1335
932
|
var templateObject_1$8;
|
|
1336
933
|
|
|
1337
|
-
/** @type {?} */
|
|
1338
934
|
var cartFragment = i1.gql(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n fragment cart on Cart {\n id\n email\n billing_address {\n ...cartAddress\n }\n shipping_addresses {\n ...cartAddress\n ... on ShippingCartAddress {\n selected_shipping_method {\n ...selectedShippingMethod\n }\n }\n }\n items {\n ...cartItem\n }\n available_payment_methods {\n ...availablePaymentMethod\n }\n selected_payment_method {\n ...selectedPaymentMethod\n }\n applied_coupons {\n ...cartCoupon\n }\n prices {\n ...prices\n }\n }\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"], ["\n fragment cart on Cart {\n id\n email\n billing_address {\n ...cartAddress\n }\n shipping_addresses {\n ...cartAddress\n ... on ShippingCartAddress {\n selected_shipping_method {\n ...selectedShippingMethod\n }\n }\n }\n items {\n ...cartItem\n }\n available_payment_methods {\n ...availablePaymentMethod\n }\n selected_payment_method {\n ...selectedPaymentMethod\n }\n applied_coupons {\n ...cartCoupon\n }\n prices {\n ...prices\n }\n }\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), cartAddressFragment, availablePaymentMethodFragment, selectedPaymentMethodFragment, selectedShippingMethodFragment, cartItemFragment, pricesFragment, cartCouponFragment);
|
|
1339
935
|
var templateObject_1$9;
|
|
1340
936
|
|
|
1341
|
-
|
|
1342
|
-
* @fileoverview added by tsickle
|
|
1343
|
-
* Generated from: queries/fragments/public_api.ts
|
|
1344
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1345
|
-
*/
|
|
1346
|
-
|
|
1347
|
-
/** @type {?} */
|
|
1348
|
-
var listCartItems = ( /**
|
|
1349
|
-
* @param {?=} extraCartFragments
|
|
1350
|
-
* @return {?}
|
|
1351
|
-
*/function (extraCartFragments) {
|
|
937
|
+
var listCartItems = function (extraCartFragments) {
|
|
1352
938
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1353
939
|
return i1.gql(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n query MagentoListCartItems($cartId: String!) {\n cart(cart_id: $cartId) {\n items {\n ...cartItem\n }\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoListCartItems($cartId: String!) {\n cart(cart_id: $cartId) {\n items {\n ...cartItem\n }\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartItemFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1354
|
-
}
|
|
940
|
+
};
|
|
1355
941
|
var templateObject_1$a;
|
|
1356
942
|
|
|
1357
|
-
|
|
1358
|
-
var addCartItem = ( /**
|
|
1359
|
-
* @param {?=} extraCartFragments
|
|
1360
|
-
* @return {?}
|
|
1361
|
-
*/function (extraCartFragments) {
|
|
943
|
+
var addCartItem = function (extraCartFragments) {
|
|
1362
944
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1363
945
|
return i1.gql(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n mutation MagentoAddCartItem($cartId: String!, $input: CartItemInput!) {\n addProductsToCart(\n cartId: $cartId,\n cartItems: [$input]\n ) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoAddCartItem($cartId: String!, $input: CartItemInput!) {\n addProductsToCart(\n cartId: $cartId,\n cartItems: [$input]\n ) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1364
|
-
}
|
|
946
|
+
};
|
|
1365
947
|
var templateObject_1$b;
|
|
1366
948
|
|
|
1367
|
-
|
|
1368
|
-
var removeCartItem = ( /**
|
|
1369
|
-
* @param {?=} extraCartFragments
|
|
1370
|
-
* @return {?}
|
|
1371
|
-
*/function (extraCartFragments) {
|
|
949
|
+
var removeCartItem = function (extraCartFragments) {
|
|
1372
950
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1373
951
|
return i1.gql(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n mutation MagentoRemoveCartItem($cartId: String!, $itemId: Int!) {\n removeItemFromCart(input: {\n cart_id: $cartId,\n cart_item_id: $itemId\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoRemoveCartItem($cartId: String!, $itemId: Int!) {\n removeItemFromCart(input: {\n cart_id: $cartId,\n cart_item_id: $itemId\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1374
|
-
}
|
|
952
|
+
};
|
|
1375
953
|
var templateObject_1$c;
|
|
1376
954
|
|
|
1377
|
-
|
|
1378
|
-
var updateCartItem = ( /**
|
|
1379
|
-
* @param {?=} extraCartFragments
|
|
1380
|
-
* @return {?}
|
|
1381
|
-
*/function (extraCartFragments) {
|
|
955
|
+
var updateCartItem = function (extraCartFragments) {
|
|
1382
956
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1383
957
|
return i1.gql(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n mutation MagentoUpdateCartItem($cartId: String!, $input: CartItemUpdateInput!) {\n updateCartItems(input: {\n cart_id: $cartId\n cart_items: [$input]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateCartItem($cartId: String!, $input: CartItemUpdateInput!) {\n updateCartItems(input: {\n cart_id: $cartId\n cart_items: [$input]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1384
|
-
}
|
|
958
|
+
};
|
|
1385
959
|
var templateObject_1$d;
|
|
1386
960
|
|
|
1387
|
-
|
|
1388
|
-
var listPaymentMethods = ( /**
|
|
1389
|
-
* @param {?=} extraCartFragments
|
|
1390
|
-
* @return {?}
|
|
1391
|
-
*/function (extraCartFragments) {
|
|
961
|
+
var listPaymentMethods = function (extraCartFragments) {
|
|
1392
962
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1393
963
|
return i1.gql(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n query MagentoListPaymentMethods($cartId: String!) {\n cart(cart_id: $cartId) {\n available_payment_methods {\n ...availablePaymentMethod\n }\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoListPaymentMethods($cartId: String!) {\n cart(cart_id: $cartId) {\n available_payment_methods {\n ...availablePaymentMethod\n }\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), availablePaymentMethodFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1394
|
-
}
|
|
964
|
+
};
|
|
1395
965
|
var templateObject_1$e;
|
|
1396
966
|
|
|
1397
|
-
|
|
1398
|
-
var getSelectedPaymentMethod = ( /**
|
|
1399
|
-
* @param {?=} extraCartFragments
|
|
1400
|
-
* @return {?}
|
|
1401
|
-
*/function (extraCartFragments) {
|
|
967
|
+
var getSelectedPaymentMethod = function (extraCartFragments) {
|
|
1402
968
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1403
969
|
return i1.gql(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query MagentoGetSelectedPaymentMethod($cartId: String!) {\n cart(cart_id: $cartId) {\n selected_payment_method {\n ...selectedPaymentMethod\n }\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoGetSelectedPaymentMethod($cartId: String!) {\n cart(cart_id: $cartId) {\n selected_payment_method {\n ...selectedPaymentMethod\n }\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), selectedPaymentMethodFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1404
|
-
}
|
|
970
|
+
};
|
|
1405
971
|
var templateObject_1$f;
|
|
1406
972
|
|
|
1407
|
-
|
|
1408
|
-
var setSelectedPaymentMethod = ( /**
|
|
1409
|
-
* @param {?=} extraCartFragments
|
|
1410
|
-
* @return {?}
|
|
1411
|
-
*/function (extraCartFragments) {
|
|
973
|
+
var setSelectedPaymentMethod = function (extraCartFragments) {
|
|
1412
974
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1413
975
|
return i1.gql(templateObject_1$g || (templateObject_1$g = __makeTemplateObject(["\n mutation MagentoSetSelectedPaymentMethod($cartId: String!, $payment: PaymentMethodInput!) {\n setPaymentMethodOnCart(input: {\n cart_id: $cartId\n payment_method: $payment\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoSetSelectedPaymentMethod($cartId: String!, $payment: PaymentMethodInput!) {\n setPaymentMethodOnCart(input: {\n cart_id: $cartId\n payment_method: $payment\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1414
|
-
}
|
|
976
|
+
};
|
|
1415
977
|
var templateObject_1$g;
|
|
1416
978
|
|
|
1417
|
-
|
|
1418
|
-
var setSelectedPaymentMethodWithBilling = ( /**
|
|
1419
|
-
* @param {?=} extraCartFragments
|
|
1420
|
-
* @return {?}
|
|
1421
|
-
*/function (extraCartFragments) {
|
|
979
|
+
var setSelectedPaymentMethodWithBilling = function (extraCartFragments) {
|
|
1422
980
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1423
981
|
return i1.gql(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n mutation MagentoSetSelectedPaymentMethodWithBilling(\n $cartId: String!,\n $payment: PaymentMethodInput!,\n $address: BillingAddressInput!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n id\n }\n }\n setPaymentMethodOnCart(input: {\n cart_id: $cartId\n payment_method: $payment\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoSetSelectedPaymentMethodWithBilling(\n $cartId: String!,\n $payment: PaymentMethodInput!,\n $address: BillingAddressInput!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n id\n }\n }\n setPaymentMethodOnCart(input: {\n cart_id: $cartId\n payment_method: $payment\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1424
|
-
}
|
|
982
|
+
};
|
|
1425
983
|
var templateObject_1$h;
|
|
1426
984
|
|
|
1427
|
-
|
|
1428
|
-
var setSelectedPaymentMethodWithBillingAndEmail = ( /**
|
|
1429
|
-
* @param {?=} extraCartFragments
|
|
1430
|
-
* @return {?}
|
|
1431
|
-
*/function (extraCartFragments) {
|
|
985
|
+
var setSelectedPaymentMethodWithBillingAndEmail = function (extraCartFragments) {
|
|
1432
986
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1433
987
|
return i1.gql(templateObject_1$i || (templateObject_1$i = __makeTemplateObject(["\n mutation MagentoSetSelectedPaymentMethodWithBillingAndEmail(\n $cartId: String!,\n $payment: PaymentMethodInput!,\n $address: BillingAddressInput!,\n $email: String!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n id\n }\n }\n setPaymentMethodOnCart(input: {\n cart_id: $cartId\n payment_method: $payment\n }) {\n cart {\n id\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoSetSelectedPaymentMethodWithBillingAndEmail(\n $cartId: String!,\n $payment: PaymentMethodInput!,\n $address: BillingAddressInput!,\n $email: String!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n id\n }\n }\n setPaymentMethodOnCart(input: {\n cart_id: $cartId\n payment_method: $payment\n }) {\n cart {\n id\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1434
|
-
}
|
|
988
|
+
};
|
|
1435
989
|
var templateObject_1$i;
|
|
1436
990
|
|
|
1437
|
-
|
|
1438
|
-
var listShippingMethods = ( /**
|
|
1439
|
-
* @param {?=} extraCartFragments
|
|
1440
|
-
* @return {?}
|
|
1441
|
-
*/function (extraCartFragments) {
|
|
991
|
+
var listShippingMethods = function (extraCartFragments) {
|
|
1442
992
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1443
993
|
return i1.gql(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n query MagentoListShippingMethods($cartId: String!) {\n cart(cart_id: $cartId) {\n id\n shipping_addresses {\n available_shipping_methods {\n ...availableShippingMethod\n }\n }\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoListShippingMethods($cartId: String!) {\n cart(cart_id: $cartId) {\n id\n shipping_addresses {\n available_shipping_methods {\n ...availableShippingMethod\n }\n }\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), availableShippingMethodFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1444
|
-
}
|
|
994
|
+
};
|
|
1445
995
|
var templateObject_1$j;
|
|
1446
996
|
|
|
1447
|
-
|
|
1448
|
-
var getSelectedShippingMethod = ( /**
|
|
1449
|
-
* @param {?=} extraCartFragments
|
|
1450
|
-
* @return {?}
|
|
1451
|
-
*/function (extraCartFragments) {
|
|
997
|
+
var getSelectedShippingMethod = function (extraCartFragments) {
|
|
1452
998
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1453
999
|
return i1.gql(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n query MagentoGetSelectedShippingMethod($cartId: String!) {\n cart(cart_id: $cartId) {\n shipping_addresses {\n selected_shipping_method {\n ...selectedShippingMethod\n }\n }\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoGetSelectedShippingMethod($cartId: String!) {\n cart(cart_id: $cartId) {\n shipping_addresses {\n selected_shipping_method {\n ...selectedShippingMethod\n }\n }\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), selectedShippingMethodFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1454
|
-
}
|
|
1000
|
+
};
|
|
1455
1001
|
var templateObject_1$k;
|
|
1456
1002
|
|
|
1457
|
-
|
|
1458
|
-
var setSelectedShippingMethod = ( /**
|
|
1459
|
-
* @param {?=} extraCartFragments
|
|
1460
|
-
* @return {?}
|
|
1461
|
-
*/function (extraCartFragments) {
|
|
1003
|
+
var setSelectedShippingMethod = function (extraCartFragments) {
|
|
1462
1004
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1463
1005
|
return i1.gql(templateObject_1$l || (templateObject_1$l = __makeTemplateObject(["\n mutation MagentoSetSelectedShippingMethod($cartId: String!, $method: ShippingMethodInput!) {\n setShippingMethodsOnCart(input: {\n cart_id: $cartId\n shipping_methods: [$method]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoSetSelectedShippingMethod($cartId: String!, $method: ShippingMethodInput!) {\n setShippingMethodsOnCart(input: {\n cart_id: $cartId\n shipping_methods: [$method]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1464
|
-
}
|
|
1006
|
+
};
|
|
1465
1007
|
var templateObject_1$l;
|
|
1466
1008
|
|
|
1467
|
-
|
|
1468
|
-
var getBillingAddress = ( /**
|
|
1469
|
-
* @param {?=} extraCartFragments
|
|
1470
|
-
* @return {?}
|
|
1471
|
-
*/function (extraCartFragments) {
|
|
1009
|
+
var getBillingAddress = function (extraCartFragments) {
|
|
1472
1010
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1473
1011
|
return i1.gql(templateObject_1$m || (templateObject_1$m = __makeTemplateObject(["\n query MagentoGetBillingAddress($cartId: String!) {\n cart(cart_id: $cartId) {\n billing_address {\n ...cartAddress\n }\n email\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoGetBillingAddress($cartId: String!) {\n cart(cart_id: $cartId) {\n billing_address {\n ...cartAddress\n }\n email\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartAddressFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1474
|
-
}
|
|
1012
|
+
};
|
|
1475
1013
|
var templateObject_1$m;
|
|
1476
1014
|
|
|
1477
|
-
|
|
1478
|
-
var updateBillingAddress = ( /**
|
|
1479
|
-
* @param {?=} extraCartFragments
|
|
1480
|
-
* @return {?}
|
|
1481
|
-
*/function (extraCartFragments) {
|
|
1015
|
+
var updateBillingAddress = function (extraCartFragments) {
|
|
1482
1016
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1483
1017
|
return i1.gql(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n mutation MagentoUpdateBillingAddress(\n $cartId: String!,\n $address: BillingAddressInput!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateBillingAddress(\n $cartId: String!,\n $address: BillingAddressInput!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1484
|
-
}
|
|
1018
|
+
};
|
|
1485
1019
|
var templateObject_1$n;
|
|
1486
1020
|
|
|
1487
|
-
|
|
1488
|
-
var updateBillingAddressWithEmail = ( /**
|
|
1489
|
-
* @param {?=} extraCartFragments
|
|
1490
|
-
* @return {?}
|
|
1491
|
-
*/function (extraCartFragments) {
|
|
1021
|
+
var updateBillingAddressWithEmail = function (extraCartFragments) {
|
|
1492
1022
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1493
1023
|
return i1.gql(templateObject_1$o || (templateObject_1$o = __makeTemplateObject(["\n mutation MagentoUpdateBillingAddressWithEmail(\n $cartId: String!,\n $address: BillingAddressInput!,\n $email: String!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n ...cart\n ", "\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n email\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateBillingAddressWithEmail(\n $cartId: String!,\n $address: BillingAddressInput!,\n $email: String!\n ) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: $address\n }) {\n cart {\n ...cart\n ", "\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n email\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1494
|
-
}
|
|
1024
|
+
};
|
|
1495
1025
|
var templateObject_1$o;
|
|
1496
1026
|
|
|
1497
|
-
|
|
1498
|
-
var getShippingAddress = ( /**
|
|
1499
|
-
* @param {?=} extraCartFragments
|
|
1500
|
-
* @return {?}
|
|
1501
|
-
*/function (extraCartFragments) {
|
|
1027
|
+
var getShippingAddress = function (extraCartFragments) {
|
|
1502
1028
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1503
1029
|
return i1.gql(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n query MagentoGetShippingAddress($cartId: String!) {\n cart(cart_id: $cartId) {\n shipping_addresses {\n ...cartAddress\n }\n email\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoGetShippingAddress($cartId: String!) {\n cart(cart_id: $cartId) {\n shipping_addresses {\n ...cartAddress\n }\n email\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartAddressFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1504
|
-
}
|
|
1030
|
+
};
|
|
1505
1031
|
var templateObject_1$p;
|
|
1506
1032
|
|
|
1507
|
-
|
|
1508
|
-
var updateShippingAddress = ( /**
|
|
1509
|
-
* @param {?=} extraCartFragments
|
|
1510
|
-
* @return {?}
|
|
1511
|
-
*/function (extraCartFragments) {
|
|
1033
|
+
var updateShippingAddress = function (extraCartFragments) {
|
|
1512
1034
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1513
1035
|
return i1.gql(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n mutation MagentoUpdateShippingAddress(\n $cartId: String!,\n $address: ShippingAddressInput!\n ) {\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [$address]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateShippingAddress(\n $cartId: String!,\n $address: ShippingAddressInput!\n ) {\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [$address]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1514
|
-
}
|
|
1036
|
+
};
|
|
1515
1037
|
var templateObject_1$q;
|
|
1516
1038
|
|
|
1517
|
-
|
|
1518
|
-
var updateShippingAddressWithEmail = ( /**
|
|
1519
|
-
* @param {?=} extraCartFragments
|
|
1520
|
-
* @return {?}
|
|
1521
|
-
*/function (extraCartFragments) {
|
|
1039
|
+
var updateShippingAddressWithEmail = function (extraCartFragments) {
|
|
1522
1040
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1523
1041
|
return i1.gql(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n mutation MagentoUpdateShippingAddressWithEmail(\n $cartId: String!,\n $address: ShippingAddressInput!,\n $email: String!\n ) {\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [$address]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n email\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateShippingAddressWithEmail(\n $cartId: String!,\n $address: ShippingAddressInput!,\n $email: String!\n ) {\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [$address]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n email\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1524
|
-
}
|
|
1042
|
+
};
|
|
1525
1043
|
var templateObject_1$r;
|
|
1526
1044
|
|
|
1527
1045
|
/**
|
|
@@ -1530,15 +1048,11 @@
|
|
|
1530
1048
|
* We rely on this fact and only use the return of the last query.
|
|
1531
1049
|
* This helps us keep query complexity down and save some server CPU cycles.
|
|
1532
1050
|
* Driver behavior is not guaranteed if Magento no longer processes compound queries in the order they are defined.
|
|
1533
|
-
* @type {?}
|
|
1534
1051
|
*/
|
|
1535
|
-
var updateAddress = (
|
|
1536
|
-
* @param {?=} extraCartFragments
|
|
1537
|
-
* @return {?}
|
|
1538
|
-
*/function (extraCartFragments) {
|
|
1052
|
+
var updateAddress = function (extraCartFragments) {
|
|
1539
1053
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1540
1054
|
return i1.gql(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n mutation MagentoUpdateAddress($cartId: String!, $address: CartAddressInput!) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: {\n address: $address\n }\n }) {\n cart {\n id\n }\n }\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [{\n address: $address\n }]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateAddress($cartId: String!, $address: CartAddressInput!) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: {\n address: $address\n }\n }) {\n cart {\n id\n }\n }\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [{\n address: $address\n }]\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1541
|
-
}
|
|
1055
|
+
};
|
|
1542
1056
|
var templateObject_1$s;
|
|
1543
1057
|
|
|
1544
1058
|
/**
|
|
@@ -1547,120 +1061,72 @@
|
|
|
1547
1061
|
* We rely on this fact and only use the return of the last query.
|
|
1548
1062
|
* This helps us keep query complexity down and save some server CPU cycles.
|
|
1549
1063
|
* Driver behavior is not guaranteed if Magento no longer processes compound queries in the order they are defined.
|
|
1550
|
-
* @type {?}
|
|
1551
1064
|
*/
|
|
1552
|
-
var updateAddressWithEmail = (
|
|
1553
|
-
* @param {?=} extraCartFragments
|
|
1554
|
-
* @return {?}
|
|
1555
|
-
*/function (extraCartFragments) {
|
|
1065
|
+
var updateAddressWithEmail = function (extraCartFragments) {
|
|
1556
1066
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1557
1067
|
return i1.gql(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n mutation MagentoUpdateAddressWithEmail($cartId: String!, $address: CartAddressInput!, $email: String!) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: {\n address: $address\n }\n }) {\n cart {\n id\n }\n }\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [{\n address: $address\n }]\n }) {\n cart {\n id\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"], ["\n mutation MagentoUpdateAddressWithEmail($cartId: String!, $address: CartAddressInput!, $email: String!) {\n setBillingAddressOnCart(input: {\n cart_id: $cartId\n billing_address: {\n address: $address\n }\n }) {\n cart {\n id\n }\n }\n setShippingAddressesOnCart(input: {\n cart_id: $cartId\n shipping_addresses: [{\n address: $address\n }]\n }) {\n cart {\n id\n }\n }\n setGuestEmailOnCart(input: {\n cart_id: $cartId,\n email: $email\n }) {\n cart {\n ...cart\n ", "\n }\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1558
|
-
}
|
|
1068
|
+
};
|
|
1559
1069
|
var templateObject_1$t;
|
|
1560
1070
|
|
|
1561
|
-
|
|
1562
|
-
var getCart = ( /**
|
|
1563
|
-
* @param {?=} extraCartFragments
|
|
1564
|
-
* @return {?}
|
|
1565
|
-
*/function (extraCartFragments) {
|
|
1071
|
+
var getCart = function (extraCartFragments) {
|
|
1566
1072
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1567
1073
|
return i1.gql(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n query MagentoGetCart($cartId: String!) {\n cart(cart_id: $cartId) {\n ...cart\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoGetCart($cartId: String!) {\n cart(cart_id: $cartId) {\n ...cart\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1568
|
-
}
|
|
1074
|
+
};
|
|
1569
1075
|
var templateObject_1$u;
|
|
1570
1076
|
|
|
1571
|
-
/** @type {?} */
|
|
1572
1077
|
var createCart = i1.gql(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n mutation MagentoCreateCart {\n createEmptyCart\n }\n"], ["\n mutation MagentoCreateCart {\n createEmptyCart\n }\n"])));
|
|
1573
1078
|
var templateObject_1$v;
|
|
1574
1079
|
|
|
1575
|
-
/** @type {?} */
|
|
1576
1080
|
var placeOrder = i1.gql(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n mutation MagentoPlaceOrder($cartId: String!) {\n placeOrder(\n input: {\n cart_id: $cartId\n }\n ) {\n order {\n order_number\n }\n }\n }\n"], ["\n mutation MagentoPlaceOrder($cartId: String!) {\n placeOrder(\n input: {\n cart_id: $cartId\n }\n ) {\n order {\n order_number\n }\n }\n }\n"])));
|
|
1577
1081
|
var templateObject_1$w;
|
|
1578
1082
|
|
|
1579
|
-
/** @type {?} */
|
|
1580
1083
|
var cartTotalsFragment = i1.gql(templateObject_1$x || (templateObject_1$x = __makeTemplateObject(["\n fragment cartTotals on Cart {\n id\n shipping_addresses {\n ...cartAddress\n ... on ShippingCartAddress {\n selected_shipping_method {\n ...selectedShippingMethod\n }\n }\n }\n prices {\n ...prices\n }\n }\n ", "\n ", "\n ", "\n"], ["\n fragment cartTotals on Cart {\n id\n shipping_addresses {\n ...cartAddress\n ... on ShippingCartAddress {\n selected_shipping_method {\n ...selectedShippingMethod\n }\n }\n }\n prices {\n ...prices\n }\n }\n ", "\n ", "\n ", "\n"])), cartAddressFragment, selectedShippingMethodFragment, pricesFragment);
|
|
1581
1084
|
var templateObject_1$x;
|
|
1582
1085
|
|
|
1583
|
-
|
|
1584
|
-
var applyCoupon = ( /**
|
|
1585
|
-
* @param {?=} extraCartFragments
|
|
1586
|
-
* @return {?}
|
|
1587
|
-
*/function (extraCartFragments) {
|
|
1086
|
+
var applyCoupon = function (extraCartFragments) {
|
|
1588
1087
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1589
1088
|
return i1.gql(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n mutation MagentoApplyCoupon($cartId: String!, $couponCode: String!) {\n applyCouponToCart(\n input: {\n cart_id: $cartId,\n coupon_code: $couponCode\n }\n ) {\n cart {\n id\n items {\n ...cartItem\n }\n applied_coupons {\n ...cartCoupon\n\t\t\t\t}\n\t\t\t\t...cartTotals\n ", "\n }\n }\n }\n ", "\n\t", "\n\t", "\n ", "\n"], ["\n mutation MagentoApplyCoupon($cartId: String!, $couponCode: String!) {\n applyCouponToCart(\n input: {\n cart_id: $cartId,\n coupon_code: $couponCode\n }\n ) {\n cart {\n id\n items {\n ...cartItem\n }\n applied_coupons {\n ...cartCoupon\n\t\t\t\t}\n\t\t\t\t...cartTotals\n ", "\n }\n }\n }\n ", "\n\t", "\n\t", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartItemFragment, cartCouponFragment, cartTotalsFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1590
|
-
}
|
|
1089
|
+
};
|
|
1591
1090
|
var templateObject_1$y;
|
|
1592
1091
|
|
|
1593
|
-
|
|
1594
|
-
var listCartCoupons = ( /**
|
|
1595
|
-
* @param {?=} extraCartFragments
|
|
1596
|
-
* @return {?}
|
|
1597
|
-
*/function (extraCartFragments) {
|
|
1092
|
+
var listCartCoupons = function (extraCartFragments) {
|
|
1598
1093
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1599
1094
|
return i1.gql(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n query MagentoListCartCoupons($cartId: String!) {\n cart(cart_id: $cartId) {\n applied_coupons {\n\t\t\t\t...cartCoupon\n\t\t\t}\n ", "\n }\n }\n ", "\n ", "\n"], ["\n query MagentoListCartCoupons($cartId: String!) {\n cart(cart_id: $cartId) {\n applied_coupons {\n\t\t\t\t...cartCoupon\n\t\t\t}\n ", "\n }\n }\n ", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartCouponFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1600
|
-
}
|
|
1095
|
+
};
|
|
1601
1096
|
var templateObject_1$z;
|
|
1602
1097
|
|
|
1603
|
-
|
|
1604
|
-
var removeAllCoupons = ( /**
|
|
1605
|
-
* @param {?=} extraCartFragments
|
|
1606
|
-
* @return {?}
|
|
1607
|
-
*/function (extraCartFragments) {
|
|
1098
|
+
var removeAllCoupons = function (extraCartFragments) {
|
|
1608
1099
|
if (extraCartFragments === void 0) { extraCartFragments = []; }
|
|
1609
1100
|
return i1.gql(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n mutation MagentoRemoveAllCoupons($cartId: String!) {\n removeCouponFromCart(\n input: {\n cart_id: $cartId\n }\n ) {\n cart {\n id\n items {\n ...cartItem\n }\n applied_coupons {\n ...cartCoupon\n\t\t\t\t}\n\t\t\t\t...cartTotals\n ", "\n }\n }\n }\n ", "\n\t", "\n\t", "\n ", "\n"], ["\n mutation MagentoRemoveAllCoupons($cartId: String!) {\n removeCouponFromCart(\n input: {\n cart_id: $cartId\n }\n ) {\n cart {\n id\n items {\n ...cartItem\n }\n applied_coupons {\n ...cartCoupon\n\t\t\t\t}\n\t\t\t\t...cartTotals\n ", "\n }\n }\n }\n ", "\n\t", "\n\t", "\n ", "\n"])), graphql.daffBuildFragmentNameSpread.apply(void 0, __spread(extraCartFragments)), cartItemFragment, cartCouponFragment, cartTotalsFragment, graphql.daffBuildFragmentDefinition.apply(void 0, __spread(extraCartFragments)));
|
|
1610
|
-
}
|
|
1101
|
+
};
|
|
1611
1102
|
var templateObject_1$A;
|
|
1612
1103
|
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
/**
|
|
1620
|
-
* @fileoverview added by tsickle
|
|
1621
|
-
* Generated from: errors/codes.ts
|
|
1622
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1623
|
-
*/
|
|
1624
|
-
/** @enum {string} */
|
|
1625
|
-
var MagentoCartGraphQlErrorCode = {
|
|
1626
|
-
CART_NOT_FOUND: "graphql-no-such-entity",
|
|
1627
|
-
BAD_INPUT: "graphql-input",
|
|
1628
|
-
};
|
|
1104
|
+
var MagentoCartGraphQlErrorCode;
|
|
1105
|
+
(function (MagentoCartGraphQlErrorCode) {
|
|
1106
|
+
MagentoCartGraphQlErrorCode["CART_NOT_FOUND"] = "graphql-no-such-entity";
|
|
1107
|
+
MagentoCartGraphQlErrorCode["BAD_INPUT"] = "graphql-input";
|
|
1108
|
+
})(MagentoCartGraphQlErrorCode || (MagentoCartGraphQlErrorCode = {}));
|
|
1629
1109
|
|
|
1630
1110
|
var _a, _b;
|
|
1631
|
-
/** @type {?} */
|
|
1632
1111
|
var DaffCartMagentoErrorMap = (_a = {},
|
|
1633
1112
|
_a[MagentoCartGraphQlErrorCode.CART_NOT_FOUND] = i4.DaffCartNotFoundError,
|
|
1634
1113
|
_a[MagentoCartGraphQlErrorCode.BAD_INPUT] = driver.DaffBadInputError,
|
|
1635
1114
|
_a);
|
|
1636
|
-
/** @type {?} */
|
|
1637
1115
|
var DaffCartMagentoErrorMessageRegexMap = (_b = {},
|
|
1638
1116
|
_b[i4.DaffCartDriverErrorCodes.INVALID_COUPON_CODE] = /The coupon code isn\'t valid/,
|
|
1639
1117
|
_b[i4.DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK] = /The requested qty is not available/,
|
|
1640
1118
|
_b);
|
|
1641
1119
|
|
|
1642
|
-
/**
|
|
1643
|
-
* @fileoverview added by tsickle
|
|
1644
|
-
* Generated from: errors/transform.ts
|
|
1645
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1646
|
-
*/
|
|
1647
|
-
/**
|
|
1648
|
-
* @param {?} error
|
|
1649
|
-
* @param {?=} requestPayload
|
|
1650
|
-
* @return {?}
|
|
1651
|
-
*/
|
|
1652
1120
|
function transformMagentoCartGraphQlError(error, requestPayload) {
|
|
1653
1121
|
var _a;
|
|
1654
1122
|
// TODO: readdress this when we move to eslint
|
|
1655
1123
|
// eslint-disable-next-line
|
|
1656
1124
|
for (var code in DaffCartMagentoErrorMessageRegexMap) {
|
|
1657
|
-
/** @type {?} */
|
|
1658
1125
|
var matchIndex = error.graphQLErrors[0].message.search(DaffCartMagentoErrorMessageRegexMap[code]);
|
|
1659
1126
|
if (matchIndex > -1 && i4.DaffCartDriverErrorMap[code]) {
|
|
1660
|
-
/** @type {?} */
|
|
1661
1127
|
var errObj = new i4.DaffCartDriverErrorMap[code](error.message);
|
|
1662
1128
|
if (errObj instanceof i4.DaffInvalidCouponCodeError) {
|
|
1663
|
-
|
|
1129
|
+
errObj.coupon = (_a = requestPayload) === null || _a === void 0 ? void 0 : _a.code;
|
|
1664
1130
|
}
|
|
1665
1131
|
return errObj;
|
|
1666
1132
|
}
|
|
@@ -1668,11 +1134,6 @@
|
|
|
1668
1134
|
return magento$1.daffTransformMagentoError(error, DaffCartMagentoErrorMap);
|
|
1669
1135
|
}
|
|
1670
1136
|
;
|
|
1671
|
-
/**
|
|
1672
|
-
* @param {?} error
|
|
1673
|
-
* @param {?=} requestPayload
|
|
1674
|
-
* @return {?}
|
|
1675
|
-
*/
|
|
1676
1137
|
function transformCartMagentoError(error, requestPayload) {
|
|
1677
1138
|
var _a;
|
|
1678
1139
|
if ((_a = error.graphQLErrors) === null || _a === void 0 ? void 0 : _a.length) {
|
|
@@ -1683,32 +1144,17 @@
|
|
|
1683
1144
|
}
|
|
1684
1145
|
}
|
|
1685
1146
|
|
|
1686
|
-
/**
|
|
1687
|
-
* @fileoverview added by tsickle
|
|
1688
|
-
* Generated from: injection-tokens/cart-mutation-queue.token.ts
|
|
1689
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1690
|
-
*/
|
|
1691
|
-
/** @type {?} */
|
|
1692
1147
|
var DAFF_MAGENTO_CART_MUTATION_QUEUE = new i0.InjectionToken('DAFF_MAGENTO_CART_MUTATION_QUEUE', {
|
|
1693
1148
|
providedIn: 'root',
|
|
1694
|
-
factory: (
|
|
1695
|
-
* @return {?}
|
|
1696
|
-
*/function () { return new graphql.DaffQueuedApollo(i0.inject(i1.Apollo)); }),
|
|
1149
|
+
factory: function () { return new graphql.DaffQueuedApollo(i0.inject(i1.Apollo)); },
|
|
1697
1150
|
});
|
|
1698
1151
|
|
|
1699
1152
|
/**
|
|
1700
1153
|
* A service for making Magento GraphQL queries for carts.
|
|
1701
1154
|
*
|
|
1702
|
-
*
|
|
1155
|
+
* @inheritdoc
|
|
1703
1156
|
*/
|
|
1704
1157
|
var DaffMagentoCartService = /** @class */ (function () {
|
|
1705
|
-
/**
|
|
1706
|
-
* @param {?} apollo
|
|
1707
|
-
* @param {?} mutationQueue
|
|
1708
|
-
* @param {?} cartTransformer
|
|
1709
|
-
* @param {?} cartItemDriver
|
|
1710
|
-
* @param {?} extraCartFragments
|
|
1711
|
-
*/
|
|
1712
1158
|
function DaffMagentoCartService(apollo, mutationQueue, cartTransformer, cartItemDriver, extraCartFragments) {
|
|
1713
1159
|
this.apollo = apollo;
|
|
1714
1160
|
this.mutationQueue = mutationQueue;
|
|
@@ -1716,70 +1162,26 @@
|
|
|
1716
1162
|
this.cartItemDriver = cartItemDriver;
|
|
1717
1163
|
this.extraCartFragments = extraCartFragments;
|
|
1718
1164
|
}
|
|
1719
|
-
/**
|
|
1720
|
-
* @param {?} cartId
|
|
1721
|
-
* @return {?}
|
|
1722
|
-
*/
|
|
1723
1165
|
DaffMagentoCartService.prototype.get = function (cartId) {
|
|
1724
1166
|
var _this = this;
|
|
1725
1167
|
return this.apollo.query({
|
|
1726
1168
|
query: getCart(this.extraCartFragments),
|
|
1727
1169
|
variables: { cartId: cartId },
|
|
1728
|
-
}).pipe(operators.catchError((
|
|
1729
|
-
* @param {?} error
|
|
1730
|
-
* @return {?}
|
|
1731
|
-
*/function (error) { return rxjs.throwError(transformCartMagentoError(error)); })), operators.map(( /**
|
|
1732
|
-
* @param {?} result
|
|
1733
|
-
* @return {?}
|
|
1734
|
-
*/function (/**
|
|
1735
|
-
* @param {?} result
|
|
1736
|
-
* @return {?}
|
|
1737
|
-
*/ result) { return _this.cartTransformer.transform(result.data.cart); })));
|
|
1170
|
+
}).pipe(operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }), operators.map(function (result) { return _this.cartTransformer.transform(result.data.cart); }));
|
|
1738
1171
|
};
|
|
1739
|
-
/**
|
|
1740
|
-
* @return {?}
|
|
1741
|
-
*/
|
|
1742
1172
|
DaffMagentoCartService.prototype.create = function () {
|
|
1743
|
-
return this.mutationQueue.mutate({ mutation: createCart }).pipe(operators.map((
|
|
1744
|
-
* @param {?} result
|
|
1745
|
-
* @return {?}
|
|
1746
|
-
*/function (/**
|
|
1747
|
-
* @param {?} result
|
|
1748
|
-
* @return {?}
|
|
1749
|
-
*/ result) { return ({ id: result.data.createEmptyCart }); })));
|
|
1173
|
+
return this.mutationQueue.mutate({ mutation: createCart }).pipe(operators.map(function (result) { return ({ id: result.data.createEmptyCart }); }));
|
|
1750
1174
|
};
|
|
1751
|
-
/**
|
|
1752
|
-
* @param {?} productId
|
|
1753
|
-
* @param {?} qty
|
|
1754
|
-
* @return {?}
|
|
1755
|
-
*/
|
|
1756
1175
|
DaffMagentoCartService.prototype.addToCart = function (productId, qty) {
|
|
1757
1176
|
throw new Error('Method is deprecated. Use DaffCartItemServiceInterface#add instead.');
|
|
1758
1177
|
};
|
|
1759
|
-
/**
|
|
1760
|
-
* @param {?} cartId
|
|
1761
|
-
* @return {?}
|
|
1762
|
-
*/
|
|
1763
1178
|
DaffMagentoCartService.prototype.clear = function (cartId) {
|
|
1764
1179
|
var _this = this;
|
|
1765
|
-
return this.cartItemDriver.list(cartId).pipe(operators.switchMap((
|
|
1766
|
-
* @param {?} items
|
|
1767
|
-
* @return {?}
|
|
1768
|
-
*/function (/**
|
|
1769
|
-
* @param {?} items
|
|
1770
|
-
* @return {?}
|
|
1771
|
-
*/ items) { return rxjs.forkJoin.apply(void 0, __spread(items.map(( /**
|
|
1772
|
-
* @param {?} item
|
|
1773
|
-
* @return {?}
|
|
1774
|
-
*/function (/**
|
|
1775
|
-
* @param {?} item
|
|
1776
|
-
* @return {?}
|
|
1777
|
-
*/ item) { return _this.cartItemDriver.delete(cartId, item.id); })))); })), operators.switchMap(( /**
|
|
1778
|
-
* @return {?}
|
|
1779
|
-
*/function () { return _this.get(cartId); })));
|
|
1180
|
+
return this.cartItemDriver.list(cartId).pipe(operators.switchMap(function (items) { return rxjs.forkJoin.apply(void 0, __spread(items.map(function (item) { return _this.cartItemDriver.delete(cartId, item.id); }))); }), operators.switchMap(function () { return _this.get(cartId); }));
|
|
1780
1181
|
};
|
|
1781
1182
|
return DaffMagentoCartService;
|
|
1782
1183
|
}());
|
|
1184
|
+
/** @nocollapse */ DaffMagentoCartService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartService_Factory() { return new DaffMagentoCartService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(i4.DaffCartItemDriver), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS)); }, token: DaffMagentoCartService, providedIn: "root" });
|
|
1783
1185
|
DaffMagentoCartService.decorators = [
|
|
1784
1186
|
{ type: i0.Injectable, args: [{
|
|
1785
1187
|
providedIn: 'root',
|
|
@@ -1793,68 +1195,17 @@
|
|
|
1793
1195
|
{ type: undefined, decorators: [{ type: i0.Inject, args: [i4.DaffCartItemDriver,] }] },
|
|
1794
1196
|
{ type: Array, decorators: [{ type: i0.Inject, args: [DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS,] }] }
|
|
1795
1197
|
]; };
|
|
1796
|
-
/** @nocollapse */ DaffMagentoCartService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartService_Factory() { return new DaffMagentoCartService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(i4.DaffCartItemDriver), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS)); }, token: DaffMagentoCartService, providedIn: "root" });
|
|
1797
|
-
if (false) {
|
|
1798
|
-
/**
|
|
1799
|
-
* @type {?}
|
|
1800
|
-
* @private
|
|
1801
|
-
*/
|
|
1802
|
-
DaffMagentoCartService.prototype.apollo;
|
|
1803
|
-
/**
|
|
1804
|
-
* @type {?}
|
|
1805
|
-
* @private
|
|
1806
|
-
*/
|
|
1807
|
-
DaffMagentoCartService.prototype.mutationQueue;
|
|
1808
|
-
/**
|
|
1809
|
-
* @type {?}
|
|
1810
|
-
* @private
|
|
1811
|
-
*/
|
|
1812
|
-
DaffMagentoCartService.prototype.cartTransformer;
|
|
1813
|
-
/**
|
|
1814
|
-
* @type {?}
|
|
1815
|
-
* @private
|
|
1816
|
-
*/
|
|
1817
|
-
DaffMagentoCartService.prototype.cartItemDriver;
|
|
1818
|
-
/**
|
|
1819
|
-
* @type {?}
|
|
1820
|
-
* @private
|
|
1821
|
-
*/
|
|
1822
|
-
DaffMagentoCartService.prototype.extraCartFragments;
|
|
1823
|
-
}
|
|
1824
1198
|
|
|
1825
|
-
/**
|
|
1826
|
-
* @fileoverview added by tsickle
|
|
1827
|
-
* Generated from: transforms/inputs/cart-item-input-transformers.ts
|
|
1828
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1829
|
-
*/
|
|
1830
|
-
/**
|
|
1831
|
-
* @param {?} item
|
|
1832
|
-
* @return {?}
|
|
1833
|
-
*/
|
|
1834
1199
|
function transformSimpleCartItem(item) {
|
|
1835
1200
|
return {
|
|
1836
1201
|
quantity: item.qty,
|
|
1837
1202
|
sku: item.productId,
|
|
1838
1203
|
};
|
|
1839
1204
|
}
|
|
1840
|
-
/**
|
|
1841
|
-
* @param {?} item
|
|
1842
|
-
* @return {?}
|
|
1843
|
-
*/
|
|
1844
1205
|
function transformCompositeCartItem(item) {
|
|
1845
1206
|
var _a;
|
|
1846
|
-
return Object.assign(Object.assign({}, transformSimpleCartItem(item)), { selected_options: ((_a = item.options) === null || _a === void 0 ? void 0 : _a.map((
|
|
1847
|
-
* @param {?} option
|
|
1848
|
-
* @return {?}
|
|
1849
|
-
*/function (/**
|
|
1850
|
-
* @param {?} option
|
|
1851
|
-
* @return {?}
|
|
1852
|
-
*/ option) { return option.value; }))) || [] });
|
|
1207
|
+
return Object.assign(Object.assign({}, transformSimpleCartItem(item)), { selected_options: ((_a = item.options) === null || _a === void 0 ? void 0 : _a.map(function (option) { return option.value; })) || [] });
|
|
1853
1208
|
}
|
|
1854
|
-
/**
|
|
1855
|
-
* @param {?} item
|
|
1856
|
-
* @return {?}
|
|
1857
|
-
*/
|
|
1858
1209
|
function transformConfigurableCartItem(item) {
|
|
1859
1210
|
return {
|
|
1860
1211
|
parent_sku: item.productId,
|
|
@@ -1863,24 +1214,12 @@
|
|
|
1863
1214
|
};
|
|
1864
1215
|
}
|
|
1865
1216
|
|
|
1866
|
-
/**
|
|
1867
|
-
* @fileoverview added by tsickle
|
|
1868
|
-
* Generated from: cart-item.service.ts
|
|
1869
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1870
|
-
*/
|
|
1871
1217
|
/**
|
|
1872
1218
|
* A service for making Magento GraphQL queries for carts.
|
|
1873
1219
|
*
|
|
1874
|
-
*
|
|
1220
|
+
* @inheritdoc
|
|
1875
1221
|
*/
|
|
1876
1222
|
var DaffMagentoCartItemService = /** @class */ (function () {
|
|
1877
|
-
/**
|
|
1878
|
-
* @param {?} apollo
|
|
1879
|
-
* @param {?} mutationQueue
|
|
1880
|
-
* @param {?} extraCartFragments
|
|
1881
|
-
* @param {?} cartTransformer
|
|
1882
|
-
* @param {?} cartItemUpdateInputTransformer
|
|
1883
|
-
*/
|
|
1884
1223
|
function DaffMagentoCartItemService(apollo, mutationQueue, extraCartFragments, cartTransformer, cartItemUpdateInputTransformer) {
|
|
1885
1224
|
this.apollo = apollo;
|
|
1886
1225
|
this.mutationQueue = mutationQueue;
|
|
@@ -1888,63 +1227,25 @@
|
|
|
1888
1227
|
this.cartTransformer = cartTransformer;
|
|
1889
1228
|
this.cartItemUpdateInputTransformer = cartItemUpdateInputTransformer;
|
|
1890
1229
|
}
|
|
1891
|
-
/**
|
|
1892
|
-
* @param {?} cartId
|
|
1893
|
-
* @return {?}
|
|
1894
|
-
*/
|
|
1895
1230
|
DaffMagentoCartItemService.prototype.list = function (cartId) {
|
|
1896
1231
|
return this.apollo.query({
|
|
1897
1232
|
query: listCartItems(this.extraCartFragments),
|
|
1898
1233
|
variables: { cartId: cartId },
|
|
1899
|
-
}).pipe(operators.map((
|
|
1900
|
-
* @param {?} result
|
|
1901
|
-
* @return {?}
|
|
1902
|
-
*/function (/**
|
|
1903
|
-
* @param {?} result
|
|
1904
|
-
* @return {?}
|
|
1905
|
-
*/ result) { return result.data.cart.items.map(transformMagentoCartItem); })));
|
|
1234
|
+
}).pipe(operators.map(function (result) { return result.data.cart.items.map(transformMagentoCartItem); }));
|
|
1906
1235
|
};
|
|
1907
|
-
/**
|
|
1908
|
-
* @param {?} cartId
|
|
1909
|
-
* @param {?} itemId
|
|
1910
|
-
* @return {?}
|
|
1911
|
-
*/
|
|
1912
1236
|
DaffMagentoCartItemService.prototype.get = function (cartId, itemId) {
|
|
1913
|
-
return this.list(cartId).pipe(operators.map((
|
|
1914
|
-
* @param {?} items
|
|
1915
|
-
* @return {?}
|
|
1916
|
-
*/function (/**
|
|
1917
|
-
* @param {?} items
|
|
1918
|
-
* @return {?}
|
|
1919
|
-
*/ items) { return items.find(( /**
|
|
1920
|
-
* @param {?} item
|
|
1921
|
-
* @return {?}
|
|
1922
|
-
*/function (/**
|
|
1923
|
-
* @param {?} item
|
|
1924
|
-
* @return {?}
|
|
1925
|
-
*/ item) { return item.id === itemId; })); })));
|
|
1237
|
+
return this.list(cartId).pipe(operators.map(function (items) { return items.find(function (item) { return item.id === itemId; }); }));
|
|
1926
1238
|
};
|
|
1927
|
-
/**
|
|
1928
|
-
* @param {?} cartId
|
|
1929
|
-
* @param {?} cartItemInput
|
|
1930
|
-
* @return {?}
|
|
1931
|
-
*/
|
|
1932
1239
|
DaffMagentoCartItemService.prototype.add = function (cartId, cartItemInput) {
|
|
1933
1240
|
switch (cartItemInput.type) {
|
|
1934
1241
|
case (cart.DaffCartItemInputType.Composite):
|
|
1935
|
-
return this.addBundledProduct(cartId,
|
|
1242
|
+
return this.addBundledProduct(cartId, cartItemInput);
|
|
1936
1243
|
case (cart.DaffCartItemInputType.Configurable):
|
|
1937
|
-
return this.addConfigurableProduct(cartId,
|
|
1244
|
+
return this.addConfigurableProduct(cartId, cartItemInput);
|
|
1938
1245
|
default:
|
|
1939
1246
|
return this.addSimpleProduct(cartId, cartItemInput);
|
|
1940
1247
|
}
|
|
1941
1248
|
};
|
|
1942
|
-
/**
|
|
1943
|
-
* @param {?} cartId
|
|
1944
|
-
* @param {?} itemId
|
|
1945
|
-
* @param {?} changes
|
|
1946
|
-
* @return {?}
|
|
1947
|
-
*/
|
|
1948
1249
|
DaffMagentoCartItemService.prototype.update = function (cartId, itemId, changes) {
|
|
1949
1250
|
var _this = this;
|
|
1950
1251
|
return this.mutationQueue.mutate({
|
|
@@ -1953,25 +1254,8 @@
|
|
|
1953
1254
|
cartId: cartId,
|
|
1954
1255
|
input: this.cartItemUpdateInputTransformer.transform(Object.assign(Object.assign({}, changes), { id: itemId })),
|
|
1955
1256
|
},
|
|
1956
|
-
}).pipe(operators.map((
|
|
1957
|
-
* @param {?} result
|
|
1958
|
-
* @return {?}
|
|
1959
|
-
*/function (/**
|
|
1960
|
-
* @param {?} result
|
|
1961
|
-
* @return {?}
|
|
1962
|
-
*/ result) { return _this.cartTransformer.transform(result.data.updateCartItems.cart); })), operators.catchError(( /**
|
|
1963
|
-
* @param {?} err
|
|
1964
|
-
* @return {?}
|
|
1965
|
-
*/function (/**
|
|
1966
|
-
* @param {?} err
|
|
1967
|
-
* @return {?}
|
|
1968
|
-
*/ err) { return rxjs.throwError(transformCartMagentoError(err)); })));
|
|
1257
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.updateCartItems.cart); }), operators.catchError(function (err) { return rxjs.throwError(transformCartMagentoError(err)); }));
|
|
1969
1258
|
};
|
|
1970
|
-
/**
|
|
1971
|
-
* @param {?} cartId
|
|
1972
|
-
* @param {?} itemId
|
|
1973
|
-
* @return {?}
|
|
1974
|
-
*/
|
|
1975
1259
|
DaffMagentoCartItemService.prototype.delete = function (cartId, itemId) {
|
|
1976
1260
|
var _this = this;
|
|
1977
1261
|
return this.mutationQueue.mutate({
|
|
@@ -1980,47 +1264,17 @@
|
|
|
1980
1264
|
cartId: cartId,
|
|
1981
1265
|
itemId: itemId,
|
|
1982
1266
|
},
|
|
1983
|
-
}).pipe(operators.map((
|
|
1984
|
-
* @param {?} result
|
|
1985
|
-
* @return {?}
|
|
1986
|
-
*/function (/**
|
|
1987
|
-
* @param {?} result
|
|
1988
|
-
* @return {?}
|
|
1989
|
-
*/ result) { return _this.cartTransformer.transform(result.data.removeItemFromCart.cart); })));
|
|
1267
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.removeItemFromCart.cart); }));
|
|
1990
1268
|
};
|
|
1991
|
-
/**
|
|
1992
|
-
* @private
|
|
1993
|
-
* @param {?} cartId
|
|
1994
|
-
* @param {?} cartItemInput
|
|
1995
|
-
* @return {?}
|
|
1996
|
-
*/
|
|
1997
1269
|
DaffMagentoCartItemService.prototype.addBundledProduct = function (cartId, cartItemInput) {
|
|
1998
1270
|
return this.addCartItemRequest(cartId, transformCompositeCartItem(cartItemInput));
|
|
1999
1271
|
};
|
|
2000
|
-
/**
|
|
2001
|
-
* @private
|
|
2002
|
-
* @param {?} cartId
|
|
2003
|
-
* @param {?} cartItemInput
|
|
2004
|
-
* @return {?}
|
|
2005
|
-
*/
|
|
2006
1272
|
DaffMagentoCartItemService.prototype.addConfigurableProduct = function (cartId, cartItemInput) {
|
|
2007
1273
|
return this.addCartItemRequest(cartId, transformConfigurableCartItem(cartItemInput));
|
|
2008
1274
|
};
|
|
2009
|
-
/**
|
|
2010
|
-
* @private
|
|
2011
|
-
* @param {?} cartId
|
|
2012
|
-
* @param {?} cartItemInput
|
|
2013
|
-
* @return {?}
|
|
2014
|
-
*/
|
|
2015
1275
|
DaffMagentoCartItemService.prototype.addSimpleProduct = function (cartId, cartItemInput) {
|
|
2016
1276
|
return this.addCartItemRequest(cartId, transformSimpleCartItem(cartItemInput));
|
|
2017
1277
|
};
|
|
2018
|
-
/**
|
|
2019
|
-
* @private
|
|
2020
|
-
* @param {?} cartId
|
|
2021
|
-
* @param {?} input
|
|
2022
|
-
* @return {?}
|
|
2023
|
-
*/
|
|
2024
1278
|
DaffMagentoCartItemService.prototype.addCartItemRequest = function (cartId, input) {
|
|
2025
1279
|
var _this = this;
|
|
2026
1280
|
return this.mutationQueue.mutate({
|
|
@@ -2029,16 +1283,11 @@
|
|
|
2029
1283
|
cartId: cartId,
|
|
2030
1284
|
input: input,
|
|
2031
1285
|
},
|
|
2032
|
-
}).pipe(operators.map((
|
|
2033
|
-
* @param {?} result
|
|
2034
|
-
* @return {?}
|
|
2035
|
-
*/function (/**
|
|
2036
|
-
* @param {?} result
|
|
2037
|
-
* @return {?}
|
|
2038
|
-
*/ result) { return _this.cartTransformer.transform(result.data.addProductsToCart.cart); })));
|
|
1286
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.addProductsToCart.cart); }));
|
|
2039
1287
|
};
|
|
2040
1288
|
return DaffMagentoCartItemService;
|
|
2041
1289
|
}());
|
|
1290
|
+
/** @nocollapse */ DaffMagentoCartItemService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartItemService_Factory() { return new DaffMagentoCartItemService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartItemUpdateInputTransformer)); }, token: DaffMagentoCartItemService, providedIn: "root" });
|
|
2042
1291
|
DaffMagentoCartItemService.decorators = [
|
|
2043
1292
|
{ type: i0.Injectable, args: [{
|
|
2044
1293
|
providedIn: 'root',
|
|
@@ -2052,55 +1301,13 @@
|
|
|
2052
1301
|
{ type: DaffMagentoCartTransformer },
|
|
2053
1302
|
{ type: DaffMagentoCartItemUpdateInputTransformer }
|
|
2054
1303
|
]; };
|
|
2055
|
-
/** @nocollapse */ DaffMagentoCartItemService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartItemService_Factory() { return new DaffMagentoCartItemService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartItemUpdateInputTransformer)); }, token: DaffMagentoCartItemService, providedIn: "root" });
|
|
2056
|
-
if (false) {
|
|
2057
|
-
/**
|
|
2058
|
-
* @type {?}
|
|
2059
|
-
* @private
|
|
2060
|
-
*/
|
|
2061
|
-
DaffMagentoCartItemService.prototype.apollo;
|
|
2062
|
-
/**
|
|
2063
|
-
* @type {?}
|
|
2064
|
-
* @private
|
|
2065
|
-
*/
|
|
2066
|
-
DaffMagentoCartItemService.prototype.mutationQueue;
|
|
2067
|
-
/**
|
|
2068
|
-
* @type {?}
|
|
2069
|
-
* @private
|
|
2070
|
-
*/
|
|
2071
|
-
DaffMagentoCartItemService.prototype.extraCartFragments;
|
|
2072
|
-
/**
|
|
2073
|
-
* @type {?}
|
|
2074
|
-
* @private
|
|
2075
|
-
*/
|
|
2076
|
-
DaffMagentoCartItemService.prototype.cartTransformer;
|
|
2077
|
-
/**
|
|
2078
|
-
* @type {?}
|
|
2079
|
-
* @private
|
|
2080
|
-
*/
|
|
2081
|
-
DaffMagentoCartItemService.prototype.cartItemUpdateInputTransformer;
|
|
2082
|
-
}
|
|
2083
1304
|
|
|
2084
|
-
/**
|
|
2085
|
-
* @fileoverview added by tsickle
|
|
2086
|
-
* Generated from: cart-payment.service.ts
|
|
2087
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2088
|
-
*/
|
|
2089
1305
|
/**
|
|
2090
1306
|
* A service for making Magento GraphQL queries for carts.
|
|
2091
1307
|
*
|
|
2092
|
-
*
|
|
1308
|
+
* @inheritdoc
|
|
2093
1309
|
*/
|
|
2094
1310
|
var DaffMagentoCartPaymentService = /** @class */ (function () {
|
|
2095
|
-
/**
|
|
2096
|
-
* @param {?} apollo
|
|
2097
|
-
* @param {?} mutationQueue
|
|
2098
|
-
* @param {?} cartTransformer
|
|
2099
|
-
* @param {?} paymentTransformer
|
|
2100
|
-
* @param {?} paymentInputTransformer
|
|
2101
|
-
* @param {?} cartAddressInputTransformer
|
|
2102
|
-
* @param {?} extraCartFragments
|
|
2103
|
-
*/
|
|
2104
1311
|
function DaffMagentoCartPaymentService(apollo, mutationQueue, cartTransformer, paymentTransformer, paymentInputTransformer, cartAddressInputTransformer, extraCartFragments) {
|
|
2105
1312
|
this.apollo = apollo;
|
|
2106
1313
|
this.mutationQueue = mutationQueue;
|
|
@@ -2110,28 +1317,13 @@
|
|
|
2110
1317
|
this.cartAddressInputTransformer = cartAddressInputTransformer;
|
|
2111
1318
|
this.extraCartFragments = extraCartFragments;
|
|
2112
1319
|
}
|
|
2113
|
-
/**
|
|
2114
|
-
* @param {?} cartId
|
|
2115
|
-
* @return {?}
|
|
2116
|
-
*/
|
|
2117
1320
|
DaffMagentoCartPaymentService.prototype.get = function (cartId) {
|
|
2118
1321
|
var _this = this;
|
|
2119
1322
|
return this.apollo.query({
|
|
2120
1323
|
query: getSelectedPaymentMethod(this.extraCartFragments),
|
|
2121
1324
|
variables: { cartId: cartId },
|
|
2122
|
-
}).pipe(operators.map((
|
|
2123
|
-
* @param {?} result
|
|
2124
|
-
* @return {?}
|
|
2125
|
-
*/function (/**
|
|
2126
|
-
* @param {?} result
|
|
2127
|
-
* @return {?}
|
|
2128
|
-
*/ result) { return _this.paymentTransformer.transform(result.data.cart.selected_payment_method); })));
|
|
1325
|
+
}).pipe(operators.map(function (result) { return _this.paymentTransformer.transform(result.data.cart.selected_payment_method); }));
|
|
2129
1326
|
};
|
|
2130
|
-
/**
|
|
2131
|
-
* @param {?} cartId
|
|
2132
|
-
* @param {?} payment
|
|
2133
|
-
* @return {?}
|
|
2134
|
-
*/
|
|
2135
1327
|
DaffMagentoCartPaymentService.prototype.update = function (cartId, payment) {
|
|
2136
1328
|
var _this = this;
|
|
2137
1329
|
return this.mutationQueue.mutate({
|
|
@@ -2140,29 +1332,13 @@
|
|
|
2140
1332
|
cartId: cartId,
|
|
2141
1333
|
payment: this.paymentInputTransformer.transform(payment),
|
|
2142
1334
|
},
|
|
2143
|
-
}).pipe(operators.map((
|
|
2144
|
-
* @param {?} result
|
|
2145
|
-
* @return {?}
|
|
2146
|
-
*/function (/**
|
|
2147
|
-
* @param {?} result
|
|
2148
|
-
* @return {?}
|
|
2149
|
-
*/ result) { return _this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart); })));
|
|
1335
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart); }));
|
|
2150
1336
|
};
|
|
2151
|
-
/**
|
|
2152
|
-
* @param {?} cartId
|
|
2153
|
-
* @param {?} payment
|
|
2154
|
-
* @param {?} address
|
|
2155
|
-
* @return {?}
|
|
2156
|
-
*/
|
|
2157
1337
|
DaffMagentoCartPaymentService.prototype.updateWithBilling = function (cartId, payment, address) {
|
|
2158
1338
|
return address.email
|
|
2159
1339
|
? this.updateWithBillingAddressAndEmail(cartId, payment, address)
|
|
2160
1340
|
: this.updateWithBillingAddress(cartId, payment, address);
|
|
2161
1341
|
};
|
|
2162
|
-
/**
|
|
2163
|
-
* @param {?} cartId
|
|
2164
|
-
* @return {?}
|
|
2165
|
-
*/
|
|
2166
1342
|
DaffMagentoCartPaymentService.prototype.remove = function (cartId) {
|
|
2167
1343
|
return this.mutationQueue.mutate({
|
|
2168
1344
|
mutation: setSelectedPaymentMethod(this.extraCartFragments),
|
|
@@ -2172,13 +1348,6 @@
|
|
|
2172
1348
|
},
|
|
2173
1349
|
}).pipe(operators.mapTo(undefined));
|
|
2174
1350
|
};
|
|
2175
|
-
/**
|
|
2176
|
-
* @private
|
|
2177
|
-
* @param {?} cartId
|
|
2178
|
-
* @param {?} payment
|
|
2179
|
-
* @param {?} address
|
|
2180
|
-
* @return {?}
|
|
2181
|
-
*/
|
|
2182
1351
|
DaffMagentoCartPaymentService.prototype.updateWithBillingAddress = function (cartId, payment, address) {
|
|
2183
1352
|
var _this = this;
|
|
2184
1353
|
return this.mutationQueue.mutate({
|
|
@@ -2188,27 +1357,8 @@
|
|
|
2188
1357
|
payment: this.paymentInputTransformer.transform(payment),
|
|
2189
1358
|
address: this.cartAddressInputTransformer.transform(address),
|
|
2190
1359
|
},
|
|
2191
|
-
}).pipe(operators.map((
|
|
2192
|
-
* @param {?} resp
|
|
2193
|
-
* @return {?}
|
|
2194
|
-
*/function (/**
|
|
2195
|
-
* @param {?} resp
|
|
2196
|
-
* @return {?}
|
|
2197
|
-
*/ resp) { return _this.cartTransformer.transform(resp.data.setPaymentMethodOnCart.cart); })), operators.catchError(( /**
|
|
2198
|
-
* @param {?} error
|
|
2199
|
-
* @return {?}
|
|
2200
|
-
*/function (/**
|
|
2201
|
-
* @param {?} error
|
|
2202
|
-
* @return {?}
|
|
2203
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1360
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(resp.data.setPaymentMethodOnCart.cart); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2204
1361
|
};
|
|
2205
|
-
/**
|
|
2206
|
-
* @private
|
|
2207
|
-
* @param {?} cartId
|
|
2208
|
-
* @param {?} payment
|
|
2209
|
-
* @param {?} address
|
|
2210
|
-
* @return {?}
|
|
2211
|
-
*/
|
|
2212
1362
|
DaffMagentoCartPaymentService.prototype.updateWithBillingAddressAndEmail = function (cartId, payment, address) {
|
|
2213
1363
|
var _this = this;
|
|
2214
1364
|
return this.mutationQueue.mutate({
|
|
@@ -2219,22 +1369,11 @@
|
|
|
2219
1369
|
payment: this.paymentInputTransformer.transform(payment),
|
|
2220
1370
|
address: this.cartAddressInputTransformer.transform(address),
|
|
2221
1371
|
},
|
|
2222
|
-
}).pipe(operators.map((
|
|
2223
|
-
* @param {?} resp
|
|
2224
|
-
* @return {?}
|
|
2225
|
-
*/function (/**
|
|
2226
|
-
* @param {?} resp
|
|
2227
|
-
* @return {?}
|
|
2228
|
-
*/ resp) { return _this.cartTransformer.transform(resp.data.setGuestEmailOnCart.cart); })), operators.catchError(( /**
|
|
2229
|
-
* @param {?} error
|
|
2230
|
-
* @return {?}
|
|
2231
|
-
*/function (/**
|
|
2232
|
-
* @param {?} error
|
|
2233
|
-
* @return {?}
|
|
2234
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1372
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(resp.data.setGuestEmailOnCart.cart); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2235
1373
|
};
|
|
2236
1374
|
return DaffMagentoCartPaymentService;
|
|
2237
1375
|
}());
|
|
1376
|
+
/** @nocollapse */ DaffMagentoCartPaymentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartPaymentService_Factory() { return new DaffMagentoCartPaymentService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartPaymentTransformer), i0.ɵɵinject(DaffMagentoPaymentMethodInputTransformer), i0.ɵɵinject(DaffMagentoBillingAddressInputTransformer), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS)); }, token: DaffMagentoCartPaymentService, providedIn: "root" });
|
|
2238
1377
|
DaffMagentoCartPaymentService.decorators = [
|
|
2239
1378
|
{ type: i0.Injectable, args: [{
|
|
2240
1379
|
providedIn: 'root',
|
|
@@ -2250,91 +1389,28 @@
|
|
|
2250
1389
|
{ type: DaffMagentoBillingAddressInputTransformer },
|
|
2251
1390
|
{ type: Array, decorators: [{ type: i0.Inject, args: [DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS,] }] }
|
|
2252
1391
|
]; };
|
|
2253
|
-
/** @nocollapse */ DaffMagentoCartPaymentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartPaymentService_Factory() { return new DaffMagentoCartPaymentService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartPaymentTransformer), i0.ɵɵinject(DaffMagentoPaymentMethodInputTransformer), i0.ɵɵinject(DaffMagentoBillingAddressInputTransformer), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS)); }, token: DaffMagentoCartPaymentService, providedIn: "root" });
|
|
2254
|
-
if (false) {
|
|
2255
|
-
/**
|
|
2256
|
-
* @type {?}
|
|
2257
|
-
* @private
|
|
2258
|
-
*/
|
|
2259
|
-
DaffMagentoCartPaymentService.prototype.apollo;
|
|
2260
|
-
/**
|
|
2261
|
-
* @type {?}
|
|
2262
|
-
* @private
|
|
2263
|
-
*/
|
|
2264
|
-
DaffMagentoCartPaymentService.prototype.mutationQueue;
|
|
2265
|
-
/**
|
|
2266
|
-
* @type {?}
|
|
2267
|
-
* @private
|
|
2268
|
-
*/
|
|
2269
|
-
DaffMagentoCartPaymentService.prototype.cartTransformer;
|
|
2270
|
-
/**
|
|
2271
|
-
* @type {?}
|
|
2272
|
-
* @private
|
|
2273
|
-
*/
|
|
2274
|
-
DaffMagentoCartPaymentService.prototype.paymentTransformer;
|
|
2275
|
-
/**
|
|
2276
|
-
* @type {?}
|
|
2277
|
-
* @private
|
|
2278
|
-
*/
|
|
2279
|
-
DaffMagentoCartPaymentService.prototype.paymentInputTransformer;
|
|
2280
|
-
/**
|
|
2281
|
-
* @type {?}
|
|
2282
|
-
* @private
|
|
2283
|
-
*/
|
|
2284
|
-
DaffMagentoCartPaymentService.prototype.cartAddressInputTransformer;
|
|
2285
|
-
/**
|
|
2286
|
-
* @type {?}
|
|
2287
|
-
* @private
|
|
2288
|
-
*/
|
|
2289
|
-
DaffMagentoCartPaymentService.prototype.extraCartFragments;
|
|
2290
|
-
}
|
|
2291
1392
|
|
|
2292
|
-
/**
|
|
2293
|
-
* @fileoverview added by tsickle
|
|
2294
|
-
* Generated from: cart-payment-methods.service.ts
|
|
2295
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2296
|
-
*/
|
|
2297
1393
|
/**
|
|
2298
1394
|
* A service for making Magento GraphQL queries for carts.
|
|
2299
1395
|
*
|
|
2300
|
-
*
|
|
1396
|
+
* @inheritdoc
|
|
2301
1397
|
*/
|
|
2302
1398
|
var DaffMagentoCartPaymentMethodsService = /** @class */ (function () {
|
|
2303
|
-
/**
|
|
2304
|
-
* @param {?} apollo
|
|
2305
|
-
* @param {?} extraCartFragments
|
|
2306
|
-
* @param {?} paymentTransformer
|
|
2307
|
-
*/
|
|
2308
1399
|
function DaffMagentoCartPaymentMethodsService(apollo, extraCartFragments, paymentTransformer) {
|
|
2309
1400
|
this.apollo = apollo;
|
|
2310
1401
|
this.extraCartFragments = extraCartFragments;
|
|
2311
1402
|
this.paymentTransformer = paymentTransformer;
|
|
2312
1403
|
}
|
|
2313
|
-
/**
|
|
2314
|
-
* @param {?} cartId
|
|
2315
|
-
* @return {?}
|
|
2316
|
-
*/
|
|
2317
1404
|
DaffMagentoCartPaymentMethodsService.prototype.list = function (cartId) {
|
|
2318
1405
|
var _this = this;
|
|
2319
1406
|
return this.apollo.query({
|
|
2320
1407
|
query: listPaymentMethods(this.extraCartFragments),
|
|
2321
1408
|
variables: { cartId: cartId },
|
|
2322
|
-
}).pipe(operators.map((
|
|
2323
|
-
* @param {?} result
|
|
2324
|
-
* @return {?}
|
|
2325
|
-
*/function (/**
|
|
2326
|
-
* @param {?} result
|
|
2327
|
-
* @return {?}
|
|
2328
|
-
*/ result) { return result.data.cart.available_payment_methods.map(( /**
|
|
2329
|
-
* @param {?} item
|
|
2330
|
-
* @return {?}
|
|
2331
|
-
*/function (/**
|
|
2332
|
-
* @param {?} item
|
|
2333
|
-
* @return {?}
|
|
2334
|
-
*/ item) { return _this.paymentTransformer.transform(item); })); })));
|
|
1409
|
+
}).pipe(operators.map(function (result) { return result.data.cart.available_payment_methods.map(function (item) { return _this.paymentTransformer.transform(item); }); }));
|
|
2335
1410
|
};
|
|
2336
1411
|
return DaffMagentoCartPaymentMethodsService;
|
|
2337
1412
|
}());
|
|
1413
|
+
/** @nocollapse */ DaffMagentoCartPaymentMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartPaymentMethodsService_Factory() { return new DaffMagentoCartPaymentMethodsService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartPaymentTransformer)); }, token: DaffMagentoCartPaymentMethodsService, providedIn: "root" });
|
|
2338
1414
|
DaffMagentoCartPaymentMethodsService.decorators = [
|
|
2339
1415
|
{ type: i0.Injectable, args: [{
|
|
2340
1416
|
providedIn: 'root',
|
|
@@ -2346,44 +1422,13 @@
|
|
|
2346
1422
|
{ type: Array, decorators: [{ type: i0.Inject, args: [DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS,] }] },
|
|
2347
1423
|
{ type: DaffMagentoCartPaymentTransformer }
|
|
2348
1424
|
]; };
|
|
2349
|
-
/** @nocollapse */ DaffMagentoCartPaymentMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartPaymentMethodsService_Factory() { return new DaffMagentoCartPaymentMethodsService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartPaymentTransformer)); }, token: DaffMagentoCartPaymentMethodsService, providedIn: "root" });
|
|
2350
|
-
if (false) {
|
|
2351
|
-
/**
|
|
2352
|
-
* @type {?}
|
|
2353
|
-
* @private
|
|
2354
|
-
*/
|
|
2355
|
-
DaffMagentoCartPaymentMethodsService.prototype.apollo;
|
|
2356
|
-
/**
|
|
2357
|
-
* @type {?}
|
|
2358
|
-
* @private
|
|
2359
|
-
*/
|
|
2360
|
-
DaffMagentoCartPaymentMethodsService.prototype.extraCartFragments;
|
|
2361
|
-
/**
|
|
2362
|
-
* @type {?}
|
|
2363
|
-
* @private
|
|
2364
|
-
*/
|
|
2365
|
-
DaffMagentoCartPaymentMethodsService.prototype.paymentTransformer;
|
|
2366
|
-
}
|
|
2367
1425
|
|
|
2368
|
-
/**
|
|
2369
|
-
* @fileoverview added by tsickle
|
|
2370
|
-
* Generated from: cart-billing-address.service.ts
|
|
2371
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2372
|
-
*/
|
|
2373
1426
|
/**
|
|
2374
1427
|
* A service for making Magento GraphQL queries for carts.
|
|
2375
1428
|
*
|
|
2376
|
-
*
|
|
1429
|
+
* @inheritdoc
|
|
2377
1430
|
*/
|
|
2378
1431
|
var DaffMagentoCartBillingAddressService = /** @class */ (function () {
|
|
2379
|
-
/**
|
|
2380
|
-
* @param {?} apollo
|
|
2381
|
-
* @param {?} mutationQueue
|
|
2382
|
-
* @param {?} extraCartFragments
|
|
2383
|
-
* @param {?} cartTransformer
|
|
2384
|
-
* @param {?} billingAddressTransformer
|
|
2385
|
-
* @param {?} billingAddressInputTransformer
|
|
2386
|
-
*/
|
|
2387
1432
|
function DaffMagentoCartBillingAddressService(apollo, mutationQueue, extraCartFragments, cartTransformer, billingAddressTransformer, billingAddressInputTransformer) {
|
|
2388
1433
|
this.apollo = apollo;
|
|
2389
1434
|
this.mutationQueue = mutationQueue;
|
|
@@ -2392,39 +1437,18 @@
|
|
|
2392
1437
|
this.billingAddressTransformer = billingAddressTransformer;
|
|
2393
1438
|
this.billingAddressInputTransformer = billingAddressInputTransformer;
|
|
2394
1439
|
}
|
|
2395
|
-
/**
|
|
2396
|
-
* @param {?} cartId
|
|
2397
|
-
* @return {?}
|
|
2398
|
-
*/
|
|
2399
1440
|
DaffMagentoCartBillingAddressService.prototype.get = function (cartId) {
|
|
2400
1441
|
var _this = this;
|
|
2401
1442
|
return this.apollo.query({
|
|
2402
1443
|
query: getBillingAddress(this.extraCartFragments),
|
|
2403
1444
|
variables: { cartId: cartId },
|
|
2404
|
-
}).pipe(operators.map((
|
|
2405
|
-
* @param {?} result
|
|
2406
|
-
* @return {?}
|
|
2407
|
-
*/function (/**
|
|
2408
|
-
* @param {?} result
|
|
2409
|
-
* @return {?}
|
|
2410
|
-
*/ result) { return result.data.cart.billing_address
|
|
1445
|
+
}).pipe(operators.map(function (result) { return result.data.cart.billing_address
|
|
2411
1446
|
? _this.billingAddressTransformer.transform(Object.assign(Object.assign({}, result.data.cart.billing_address), { email: result.data.cart.email }))
|
|
2412
|
-
: null; }))
|
|
1447
|
+
: null; }));
|
|
2413
1448
|
};
|
|
2414
|
-
/**
|
|
2415
|
-
* @param {?} cartId
|
|
2416
|
-
* @param {?} address
|
|
2417
|
-
* @return {?}
|
|
2418
|
-
*/
|
|
2419
1449
|
DaffMagentoCartBillingAddressService.prototype.update = function (cartId, address) {
|
|
2420
1450
|
return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
|
|
2421
1451
|
};
|
|
2422
|
-
/**
|
|
2423
|
-
* @private
|
|
2424
|
-
* @param {?} cartId
|
|
2425
|
-
* @param {?} address
|
|
2426
|
-
* @return {?}
|
|
2427
|
-
*/
|
|
2428
1452
|
DaffMagentoCartBillingAddressService.prototype.updateAddress = function (cartId, address) {
|
|
2429
1453
|
var _this = this;
|
|
2430
1454
|
return this.mutationQueue.mutate({
|
|
@@ -2433,26 +1457,8 @@
|
|
|
2433
1457
|
cartId: cartId,
|
|
2434
1458
|
address: this.billingAddressInputTransformer.transform(address),
|
|
2435
1459
|
},
|
|
2436
|
-
}).pipe(operators.map((
|
|
2437
|
-
* @param {?} resp
|
|
2438
|
-
* @return {?}
|
|
2439
|
-
*/function (/**
|
|
2440
|
-
* @param {?} resp
|
|
2441
|
-
* @return {?}
|
|
2442
|
-
*/ resp) { return _this.cartTransformer.transform(resp.data.setBillingAddressOnCart.cart); })), operators.catchError(( /**
|
|
2443
|
-
* @param {?} error
|
|
2444
|
-
* @return {?}
|
|
2445
|
-
*/function (/**
|
|
2446
|
-
* @param {?} error
|
|
2447
|
-
* @return {?}
|
|
2448
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1460
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(resp.data.setBillingAddressOnCart.cart); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2449
1461
|
};
|
|
2450
|
-
/**
|
|
2451
|
-
* @private
|
|
2452
|
-
* @param {?} cartId
|
|
2453
|
-
* @param {?} address
|
|
2454
|
-
* @return {?}
|
|
2455
|
-
*/
|
|
2456
1462
|
DaffMagentoCartBillingAddressService.prototype.updateAddressWithEmail = function (cartId, address) {
|
|
2457
1463
|
var _this = this;
|
|
2458
1464
|
return this.mutationQueue.mutate({
|
|
@@ -2462,22 +1468,11 @@
|
|
|
2462
1468
|
email: address.email,
|
|
2463
1469
|
address: this.billingAddressInputTransformer.transform(address),
|
|
2464
1470
|
},
|
|
2465
|
-
}).pipe(operators.map((
|
|
2466
|
-
* @param {?} resp
|
|
2467
|
-
* @return {?}
|
|
2468
|
-
*/function (/**
|
|
2469
|
-
* @param {?} resp
|
|
2470
|
-
* @return {?}
|
|
2471
|
-
*/ resp) { return _this.cartTransformer.transform(Object.assign(Object.assign({}, resp.data.setBillingAddressOnCart.cart), { email: resp.data.setGuestEmailOnCart.cart.email })); })), operators.catchError(( /**
|
|
2472
|
-
* @param {?} error
|
|
2473
|
-
* @return {?}
|
|
2474
|
-
*/function (/**
|
|
2475
|
-
* @param {?} error
|
|
2476
|
-
* @return {?}
|
|
2477
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1471
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(Object.assign(Object.assign({}, resp.data.setBillingAddressOnCart.cart), { email: resp.data.setGuestEmailOnCart.cart.email })); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2478
1472
|
};
|
|
2479
1473
|
return DaffMagentoCartBillingAddressService;
|
|
2480
1474
|
}());
|
|
1475
|
+
/** @nocollapse */ DaffMagentoCartBillingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartBillingAddressService_Factory() { return new DaffMagentoCartBillingAddressService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoBillingAddressTransformer), i0.ɵɵinject(DaffMagentoBillingAddressInputTransformer)); }, token: DaffMagentoCartBillingAddressService, providedIn: "root" });
|
|
2481
1476
|
DaffMagentoCartBillingAddressService.decorators = [
|
|
2482
1477
|
{ type: i0.Injectable, args: [{
|
|
2483
1478
|
providedIn: 'root',
|
|
@@ -2492,59 +1487,13 @@
|
|
|
2492
1487
|
{ type: DaffMagentoBillingAddressTransformer },
|
|
2493
1488
|
{ type: DaffMagentoBillingAddressInputTransformer }
|
|
2494
1489
|
]; };
|
|
2495
|
-
/** @nocollapse */ DaffMagentoCartBillingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartBillingAddressService_Factory() { return new DaffMagentoCartBillingAddressService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoBillingAddressTransformer), i0.ɵɵinject(DaffMagentoBillingAddressInputTransformer)); }, token: DaffMagentoCartBillingAddressService, providedIn: "root" });
|
|
2496
|
-
if (false) {
|
|
2497
|
-
/**
|
|
2498
|
-
* @type {?}
|
|
2499
|
-
* @private
|
|
2500
|
-
*/
|
|
2501
|
-
DaffMagentoCartBillingAddressService.prototype.apollo;
|
|
2502
|
-
/**
|
|
2503
|
-
* @type {?}
|
|
2504
|
-
* @private
|
|
2505
|
-
*/
|
|
2506
|
-
DaffMagentoCartBillingAddressService.prototype.mutationQueue;
|
|
2507
|
-
/**
|
|
2508
|
-
* @type {?}
|
|
2509
|
-
* @private
|
|
2510
|
-
*/
|
|
2511
|
-
DaffMagentoCartBillingAddressService.prototype.extraCartFragments;
|
|
2512
|
-
/**
|
|
2513
|
-
* @type {?}
|
|
2514
|
-
* @private
|
|
2515
|
-
*/
|
|
2516
|
-
DaffMagentoCartBillingAddressService.prototype.cartTransformer;
|
|
2517
|
-
/**
|
|
2518
|
-
* @type {?}
|
|
2519
|
-
* @private
|
|
2520
|
-
*/
|
|
2521
|
-
DaffMagentoCartBillingAddressService.prototype.billingAddressTransformer;
|
|
2522
|
-
/**
|
|
2523
|
-
* @type {?}
|
|
2524
|
-
* @private
|
|
2525
|
-
*/
|
|
2526
|
-
DaffMagentoCartBillingAddressService.prototype.billingAddressInputTransformer;
|
|
2527
|
-
}
|
|
2528
1490
|
|
|
2529
|
-
/**
|
|
2530
|
-
* @fileoverview added by tsickle
|
|
2531
|
-
* Generated from: cart-shipping-address.service.ts
|
|
2532
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2533
|
-
*/
|
|
2534
1491
|
/**
|
|
2535
1492
|
* A service for making Magento GraphQL queries for a cart's shipping address.
|
|
2536
1493
|
*
|
|
2537
|
-
*
|
|
1494
|
+
* @inheritdoc
|
|
2538
1495
|
*/
|
|
2539
1496
|
var DaffMagentoCartShippingAddressService = /** @class */ (function () {
|
|
2540
|
-
/**
|
|
2541
|
-
* @param {?} apollo
|
|
2542
|
-
* @param {?} mutationQueue
|
|
2543
|
-
* @param {?} extraCartFragments
|
|
2544
|
-
* @param {?} cartTransformer
|
|
2545
|
-
* @param {?} shippingAddressTransformer
|
|
2546
|
-
* @param {?} shippingAddressInputTransformer
|
|
2547
|
-
*/
|
|
2548
1497
|
function DaffMagentoCartShippingAddressService(apollo, mutationQueue, extraCartFragments, cartTransformer, shippingAddressTransformer, shippingAddressInputTransformer) {
|
|
2549
1498
|
this.apollo = apollo;
|
|
2550
1499
|
this.mutationQueue = mutationQueue;
|
|
@@ -2553,39 +1502,18 @@
|
|
|
2553
1502
|
this.shippingAddressTransformer = shippingAddressTransformer;
|
|
2554
1503
|
this.shippingAddressInputTransformer = shippingAddressInputTransformer;
|
|
2555
1504
|
}
|
|
2556
|
-
/**
|
|
2557
|
-
* @param {?} cartId
|
|
2558
|
-
* @return {?}
|
|
2559
|
-
*/
|
|
2560
1505
|
DaffMagentoCartShippingAddressService.prototype.get = function (cartId) {
|
|
2561
1506
|
var _this = this;
|
|
2562
1507
|
return this.apollo.query({
|
|
2563
1508
|
query: getShippingAddress(this.extraCartFragments),
|
|
2564
1509
|
variables: { cartId: cartId },
|
|
2565
|
-
}).pipe(operators.map((
|
|
2566
|
-
* @param {?} result
|
|
2567
|
-
* @return {?}
|
|
2568
|
-
*/function (/**
|
|
2569
|
-
* @param {?} result
|
|
2570
|
-
* @return {?}
|
|
2571
|
-
*/ result) { return result.data.cart.shipping_addresses[0]
|
|
1510
|
+
}).pipe(operators.map(function (result) { return result.data.cart.shipping_addresses[0]
|
|
2572
1511
|
? _this.shippingAddressTransformer.transform(Object.assign(Object.assign({}, result.data.cart.shipping_addresses[0]), { email: result.data.cart.email }))
|
|
2573
|
-
: null; }))
|
|
1512
|
+
: null; }));
|
|
2574
1513
|
};
|
|
2575
|
-
/**
|
|
2576
|
-
* @param {?} cartId
|
|
2577
|
-
* @param {?} address
|
|
2578
|
-
* @return {?}
|
|
2579
|
-
*/
|
|
2580
1514
|
DaffMagentoCartShippingAddressService.prototype.update = function (cartId, address) {
|
|
2581
1515
|
return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
|
|
2582
1516
|
};
|
|
2583
|
-
/**
|
|
2584
|
-
* @private
|
|
2585
|
-
* @param {?} cartId
|
|
2586
|
-
* @param {?} address
|
|
2587
|
-
* @return {?}
|
|
2588
|
-
*/
|
|
2589
1517
|
DaffMagentoCartShippingAddressService.prototype.updateAddress = function (cartId, address) {
|
|
2590
1518
|
var _this = this;
|
|
2591
1519
|
return this.mutationQueue.mutate({
|
|
@@ -2594,26 +1522,8 @@
|
|
|
2594
1522
|
cartId: cartId,
|
|
2595
1523
|
address: this.shippingAddressInputTransformer.transform(address),
|
|
2596
1524
|
},
|
|
2597
|
-
}).pipe(operators.map((
|
|
2598
|
-
* @param {?} resp
|
|
2599
|
-
* @return {?}
|
|
2600
|
-
*/function (/**
|
|
2601
|
-
* @param {?} resp
|
|
2602
|
-
* @return {?}
|
|
2603
|
-
*/ resp) { return _this.cartTransformer.transform(resp.data.setShippingAddressesOnCart.cart); })), operators.catchError(( /**
|
|
2604
|
-
* @param {?} error
|
|
2605
|
-
* @return {?}
|
|
2606
|
-
*/function (/**
|
|
2607
|
-
* @param {?} error
|
|
2608
|
-
* @return {?}
|
|
2609
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1525
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(resp.data.setShippingAddressesOnCart.cart); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2610
1526
|
};
|
|
2611
|
-
/**
|
|
2612
|
-
* @private
|
|
2613
|
-
* @param {?} cartId
|
|
2614
|
-
* @param {?} address
|
|
2615
|
-
* @return {?}
|
|
2616
|
-
*/
|
|
2617
1527
|
DaffMagentoCartShippingAddressService.prototype.updateAddressWithEmail = function (cartId, address) {
|
|
2618
1528
|
var _this = this;
|
|
2619
1529
|
return this.mutationQueue.mutate({
|
|
@@ -2623,22 +1533,11 @@
|
|
|
2623
1533
|
email: address.email,
|
|
2624
1534
|
address: this.shippingAddressInputTransformer.transform(address),
|
|
2625
1535
|
},
|
|
2626
|
-
}).pipe(operators.map((
|
|
2627
|
-
* @param {?} resp
|
|
2628
|
-
* @return {?}
|
|
2629
|
-
*/function (/**
|
|
2630
|
-
* @param {?} resp
|
|
2631
|
-
* @return {?}
|
|
2632
|
-
*/ resp) { return _this.cartTransformer.transform(Object.assign(Object.assign({}, resp.data.setShippingAddressesOnCart.cart), { email: resp.data.setGuestEmailOnCart.cart.email })); })), operators.catchError(( /**
|
|
2633
|
-
* @param {?} error
|
|
2634
|
-
* @return {?}
|
|
2635
|
-
*/function (/**
|
|
2636
|
-
* @param {?} error
|
|
2637
|
-
* @return {?}
|
|
2638
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1536
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(Object.assign(Object.assign({}, resp.data.setShippingAddressesOnCart.cart), { email: resp.data.setGuestEmailOnCart.cart.email })); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2639
1537
|
};
|
|
2640
1538
|
return DaffMagentoCartShippingAddressService;
|
|
2641
1539
|
}());
|
|
1540
|
+
/** @nocollapse */ DaffMagentoCartShippingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingAddressService_Factory() { return new DaffMagentoCartShippingAddressService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoShippingAddressTransformer), i0.ɵɵinject(DaffMagentoShippingAddressInputTransformer)); }, token: DaffMagentoCartShippingAddressService, providedIn: "root" });
|
|
2642
1541
|
DaffMagentoCartShippingAddressService.decorators = [
|
|
2643
1542
|
{ type: i0.Injectable, args: [{
|
|
2644
1543
|
providedIn: 'root',
|
|
@@ -2653,86 +1552,28 @@
|
|
|
2653
1552
|
{ type: DaffMagentoShippingAddressTransformer },
|
|
2654
1553
|
{ type: DaffMagentoShippingAddressInputTransformer }
|
|
2655
1554
|
]; };
|
|
2656
|
-
/** @nocollapse */ DaffMagentoCartShippingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingAddressService_Factory() { return new DaffMagentoCartShippingAddressService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoShippingAddressTransformer), i0.ɵɵinject(DaffMagentoShippingAddressInputTransformer)); }, token: DaffMagentoCartShippingAddressService, providedIn: "root" });
|
|
2657
|
-
if (false) {
|
|
2658
|
-
/**
|
|
2659
|
-
* @type {?}
|
|
2660
|
-
* @private
|
|
2661
|
-
*/
|
|
2662
|
-
DaffMagentoCartShippingAddressService.prototype.apollo;
|
|
2663
|
-
/**
|
|
2664
|
-
* @type {?}
|
|
2665
|
-
* @private
|
|
2666
|
-
*/
|
|
2667
|
-
DaffMagentoCartShippingAddressService.prototype.mutationQueue;
|
|
2668
|
-
/**
|
|
2669
|
-
* @type {?}
|
|
2670
|
-
* @private
|
|
2671
|
-
*/
|
|
2672
|
-
DaffMagentoCartShippingAddressService.prototype.extraCartFragments;
|
|
2673
|
-
/**
|
|
2674
|
-
* @type {?}
|
|
2675
|
-
* @private
|
|
2676
|
-
*/
|
|
2677
|
-
DaffMagentoCartShippingAddressService.prototype.cartTransformer;
|
|
2678
|
-
/**
|
|
2679
|
-
* @type {?}
|
|
2680
|
-
* @private
|
|
2681
|
-
*/
|
|
2682
|
-
DaffMagentoCartShippingAddressService.prototype.shippingAddressTransformer;
|
|
2683
|
-
/**
|
|
2684
|
-
* @type {?}
|
|
2685
|
-
* @private
|
|
2686
|
-
*/
|
|
2687
|
-
DaffMagentoCartShippingAddressService.prototype.shippingAddressInputTransformer;
|
|
2688
|
-
}
|
|
2689
1555
|
|
|
2690
|
-
/**
|
|
2691
|
-
* @fileoverview added by tsickle
|
|
2692
|
-
* Generated from: cart-shipping-methods.service.ts
|
|
2693
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2694
|
-
*/
|
|
2695
1556
|
/**
|
|
2696
1557
|
* A service for making Magento GraphQL queries for carts' shipping methods.
|
|
2697
1558
|
*
|
|
2698
|
-
*
|
|
1559
|
+
* @inheritdoc
|
|
2699
1560
|
*/
|
|
2700
1561
|
var DaffMagentoCartShippingMethodsService = /** @class */ (function () {
|
|
2701
|
-
/**
|
|
2702
|
-
* @param {?} apollo
|
|
2703
|
-
* @param {?} extraCartFragments
|
|
2704
|
-
* @param {?} shippingRateTransformer
|
|
2705
|
-
*/
|
|
2706
1562
|
function DaffMagentoCartShippingMethodsService(apollo, extraCartFragments, shippingRateTransformer) {
|
|
2707
1563
|
this.apollo = apollo;
|
|
2708
1564
|
this.extraCartFragments = extraCartFragments;
|
|
2709
1565
|
this.shippingRateTransformer = shippingRateTransformer;
|
|
2710
1566
|
}
|
|
2711
|
-
/**
|
|
2712
|
-
* @param {?} cartId
|
|
2713
|
-
* @return {?}
|
|
2714
|
-
*/
|
|
2715
1567
|
DaffMagentoCartShippingMethodsService.prototype.list = function (cartId) {
|
|
2716
1568
|
var _this = this;
|
|
2717
1569
|
return this.apollo.query({
|
|
2718
1570
|
query: listShippingMethods(this.extraCartFragments),
|
|
2719
1571
|
variables: { cartId: cartId },
|
|
2720
|
-
}).pipe(operators.map((
|
|
2721
|
-
* @param {?} result
|
|
2722
|
-
* @return {?}
|
|
2723
|
-
*/function (/**
|
|
2724
|
-
* @param {?} result
|
|
2725
|
-
* @return {?}
|
|
2726
|
-
*/ result) { return result.data.cart.shipping_addresses[0].available_shipping_methods.map(( /**
|
|
2727
|
-
* @param {?} item
|
|
2728
|
-
* @return {?}
|
|
2729
|
-
*/function (/**
|
|
2730
|
-
* @param {?} item
|
|
2731
|
-
* @return {?}
|
|
2732
|
-
*/ item) { return _this.shippingRateTransformer.transform(item); })); })));
|
|
1572
|
+
}).pipe(operators.map(function (result) { return result.data.cart.shipping_addresses[0].available_shipping_methods.map(function (item) { return _this.shippingRateTransformer.transform(item); }); }));
|
|
2733
1573
|
};
|
|
2734
1574
|
return DaffMagentoCartShippingMethodsService;
|
|
2735
1575
|
}());
|
|
1576
|
+
/** @nocollapse */ DaffMagentoCartShippingMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingMethodsService_Factory() { return new DaffMagentoCartShippingMethodsService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartShippingRateTransformer)); }, token: DaffMagentoCartShippingMethodsService, providedIn: "root" });
|
|
2736
1577
|
DaffMagentoCartShippingMethodsService.decorators = [
|
|
2737
1578
|
{ type: i0.Injectable, args: [{
|
|
2738
1579
|
providedIn: 'root',
|
|
@@ -2744,44 +1585,13 @@
|
|
|
2744
1585
|
{ type: Array, decorators: [{ type: i0.Inject, args: [DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS,] }] },
|
|
2745
1586
|
{ type: DaffMagentoCartShippingRateTransformer }
|
|
2746
1587
|
]; };
|
|
2747
|
-
/** @nocollapse */ DaffMagentoCartShippingMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingMethodsService_Factory() { return new DaffMagentoCartShippingMethodsService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartShippingRateTransformer)); }, token: DaffMagentoCartShippingMethodsService, providedIn: "root" });
|
|
2748
|
-
if (false) {
|
|
2749
|
-
/**
|
|
2750
|
-
* @type {?}
|
|
2751
|
-
* @private
|
|
2752
|
-
*/
|
|
2753
|
-
DaffMagentoCartShippingMethodsService.prototype.apollo;
|
|
2754
|
-
/**
|
|
2755
|
-
* @type {?}
|
|
2756
|
-
* @private
|
|
2757
|
-
*/
|
|
2758
|
-
DaffMagentoCartShippingMethodsService.prototype.extraCartFragments;
|
|
2759
|
-
/**
|
|
2760
|
-
* @type {?}
|
|
2761
|
-
* @private
|
|
2762
|
-
*/
|
|
2763
|
-
DaffMagentoCartShippingMethodsService.prototype.shippingRateTransformer;
|
|
2764
|
-
}
|
|
2765
1588
|
|
|
2766
|
-
/**
|
|
2767
|
-
* @fileoverview added by tsickle
|
|
2768
|
-
* Generated from: cart-shipping-information.service.ts
|
|
2769
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2770
|
-
*/
|
|
2771
1589
|
/**
|
|
2772
1590
|
* A service for making Magento GraphQL queries for carts.
|
|
2773
1591
|
*
|
|
2774
|
-
*
|
|
1592
|
+
* @inheritdoc
|
|
2775
1593
|
*/
|
|
2776
1594
|
var DaffMagentoCartShippingInformationService = /** @class */ (function () {
|
|
2777
|
-
/**
|
|
2778
|
-
* @param {?} apollo
|
|
2779
|
-
* @param {?} mutationQueue
|
|
2780
|
-
* @param {?} extraCartFragments
|
|
2781
|
-
* @param {?} cartTransformer
|
|
2782
|
-
* @param {?} shippingRateTransformer
|
|
2783
|
-
* @param {?} shippingMethodInputTransformer
|
|
2784
|
-
*/
|
|
2785
1595
|
function DaffMagentoCartShippingInformationService(apollo, mutationQueue, extraCartFragments, cartTransformer, shippingRateTransformer, shippingMethodInputTransformer) {
|
|
2786
1596
|
this.apollo = apollo;
|
|
2787
1597
|
this.mutationQueue = mutationQueue;
|
|
@@ -2790,30 +1600,15 @@
|
|
|
2790
1600
|
this.shippingRateTransformer = shippingRateTransformer;
|
|
2791
1601
|
this.shippingMethodInputTransformer = shippingMethodInputTransformer;
|
|
2792
1602
|
}
|
|
2793
|
-
/**
|
|
2794
|
-
* @param {?} cartId
|
|
2795
|
-
* @return {?}
|
|
2796
|
-
*/
|
|
2797
1603
|
DaffMagentoCartShippingInformationService.prototype.get = function (cartId) {
|
|
2798
1604
|
var _this = this;
|
|
2799
1605
|
return this.apollo.query({
|
|
2800
1606
|
query: getSelectedShippingMethod(this.extraCartFragments),
|
|
2801
1607
|
variables: { cartId: cartId },
|
|
2802
|
-
}).pipe(operators.map((
|
|
2803
|
-
* @param {?} result
|
|
2804
|
-
* @return {?}
|
|
2805
|
-
*/function (/**
|
|
2806
|
-
* @param {?} result
|
|
2807
|
-
* @return {?}
|
|
2808
|
-
*/ result) { return result.data.cart.shipping_addresses[0]
|
|
1608
|
+
}).pipe(operators.map(function (result) { return result.data.cart.shipping_addresses[0]
|
|
2809
1609
|
? _this.shippingRateTransformer.transform(result.data.cart.shipping_addresses[0].selected_shipping_method)
|
|
2810
|
-
: null; }))
|
|
1610
|
+
: null; }));
|
|
2811
1611
|
};
|
|
2812
|
-
/**
|
|
2813
|
-
* @param {?} cartId
|
|
2814
|
-
* @param {?} shippingInfo
|
|
2815
|
-
* @return {?}
|
|
2816
|
-
*/
|
|
2817
1612
|
DaffMagentoCartShippingInformationService.prototype.update = function (cartId, shippingInfo) {
|
|
2818
1613
|
var _this = this;
|
|
2819
1614
|
return this.mutationQueue.mutate({
|
|
@@ -2822,13 +1617,7 @@
|
|
|
2822
1617
|
cartId: cartId,
|
|
2823
1618
|
method: this.shippingMethodInputTransformer.transform(shippingInfo),
|
|
2824
1619
|
},
|
|
2825
|
-
}).pipe(operators.switchMap((
|
|
2826
|
-
* @param {?} result
|
|
2827
|
-
* @return {?}
|
|
2828
|
-
*/function (/**
|
|
2829
|
-
* @param {?} result
|
|
2830
|
-
* @return {?}
|
|
2831
|
-
*/ result) {
|
|
1620
|
+
}).pipe(operators.switchMap(function (result) {
|
|
2832
1621
|
// because Magento only returns the selected shipping method for the mutation
|
|
2833
1622
|
// we have to manually refetch the available shipping methods
|
|
2834
1623
|
// with fetchPolicy: 'network-only' in order to skip the cache
|
|
@@ -2836,26 +1625,9 @@
|
|
|
2836
1625
|
query: listShippingMethods(_this.extraCartFragments),
|
|
2837
1626
|
variables: { cartId: cartId },
|
|
2838
1627
|
fetchPolicy: 'network-only',
|
|
2839
|
-
}).pipe(operators.map((
|
|
2840
|
-
|
|
2841
|
-
* @return {?}
|
|
2842
|
-
*/function (/**
|
|
2843
|
-
* @param {?} shippingMethods
|
|
2844
|
-
* @return {?}
|
|
2845
|
-
*/ shippingMethods) { return (Object.assign(Object.assign({}, _this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)), { available_shipping_methods: shippingMethods.data.cart.shipping_addresses[0].available_shipping_methods.map(( /**
|
|
2846
|
-
* @param {?} item
|
|
2847
|
-
* @return {?}
|
|
2848
|
-
*/function (/**
|
|
2849
|
-
* @param {?} item
|
|
2850
|
-
* @return {?}
|
|
2851
|
-
*/ item) { return _this.shippingRateTransformer.transform(item); })) })); })));
|
|
2852
|
-
})));
|
|
1628
|
+
}).pipe(operators.map(function (shippingMethods) { return (Object.assign(Object.assign({}, _this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)), { available_shipping_methods: shippingMethods.data.cart.shipping_addresses[0].available_shipping_methods.map(function (item) { return _this.shippingRateTransformer.transform(item); }) })); }));
|
|
1629
|
+
}));
|
|
2853
1630
|
};
|
|
2854
|
-
/**
|
|
2855
|
-
* @param {?} cartId
|
|
2856
|
-
* @param {?=} id
|
|
2857
|
-
* @return {?}
|
|
2858
|
-
*/
|
|
2859
1631
|
DaffMagentoCartShippingInformationService.prototype.delete = function (cartId, id) {
|
|
2860
1632
|
var _this = this;
|
|
2861
1633
|
return this.mutationQueue.mutate({
|
|
@@ -2867,16 +1639,11 @@
|
|
|
2867
1639
|
method_code: '',
|
|
2868
1640
|
},
|
|
2869
1641
|
},
|
|
2870
|
-
}).pipe(operators.map((
|
|
2871
|
-
* @param {?} result
|
|
2872
|
-
* @return {?}
|
|
2873
|
-
*/function (/**
|
|
2874
|
-
* @param {?} result
|
|
2875
|
-
* @return {?}
|
|
2876
|
-
*/ result) { return _this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart); })));
|
|
1642
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart); }));
|
|
2877
1643
|
};
|
|
2878
1644
|
return DaffMagentoCartShippingInformationService;
|
|
2879
1645
|
}());
|
|
1646
|
+
/** @nocollapse */ DaffMagentoCartShippingInformationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingInformationService_Factory() { return new DaffMagentoCartShippingInformationService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartShippingRateTransformer), i0.ɵɵinject(DaffMagentoShippingMethodInputTransformer)); }, token: DaffMagentoCartShippingInformationService, providedIn: "root" });
|
|
2880
1647
|
DaffMagentoCartShippingInformationService.decorators = [
|
|
2881
1648
|
{ type: i0.Injectable, args: [{
|
|
2882
1649
|
providedIn: 'root',
|
|
@@ -2891,77 +1658,22 @@
|
|
|
2891
1658
|
{ type: DaffMagentoCartShippingRateTransformer },
|
|
2892
1659
|
{ type: DaffMagentoShippingMethodInputTransformer }
|
|
2893
1660
|
]; };
|
|
2894
|
-
/** @nocollapse */ DaffMagentoCartShippingInformationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartShippingInformationService_Factory() { return new DaffMagentoCartShippingInformationService(i0.ɵɵinject(i1.Apollo), i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartShippingRateTransformer), i0.ɵɵinject(DaffMagentoShippingMethodInputTransformer)); }, token: DaffMagentoCartShippingInformationService, providedIn: "root" });
|
|
2895
|
-
if (false) {
|
|
2896
|
-
/**
|
|
2897
|
-
* @type {?}
|
|
2898
|
-
* @private
|
|
2899
|
-
*/
|
|
2900
|
-
DaffMagentoCartShippingInformationService.prototype.apollo;
|
|
2901
|
-
/**
|
|
2902
|
-
* @type {?}
|
|
2903
|
-
* @private
|
|
2904
|
-
*/
|
|
2905
|
-
DaffMagentoCartShippingInformationService.prototype.mutationQueue;
|
|
2906
|
-
/**
|
|
2907
|
-
* @type {?}
|
|
2908
|
-
* @private
|
|
2909
|
-
*/
|
|
2910
|
-
DaffMagentoCartShippingInformationService.prototype.extraCartFragments;
|
|
2911
|
-
/**
|
|
2912
|
-
* @type {?}
|
|
2913
|
-
* @private
|
|
2914
|
-
*/
|
|
2915
|
-
DaffMagentoCartShippingInformationService.prototype.cartTransformer;
|
|
2916
|
-
/**
|
|
2917
|
-
* @type {?}
|
|
2918
|
-
* @private
|
|
2919
|
-
*/
|
|
2920
|
-
DaffMagentoCartShippingInformationService.prototype.shippingRateTransformer;
|
|
2921
|
-
/**
|
|
2922
|
-
* @type {?}
|
|
2923
|
-
* @private
|
|
2924
|
-
*/
|
|
2925
|
-
DaffMagentoCartShippingInformationService.prototype.shippingMethodInputTransformer;
|
|
2926
|
-
}
|
|
2927
1661
|
|
|
2928
|
-
/**
|
|
2929
|
-
* @fileoverview added by tsickle
|
|
2930
|
-
* Generated from: cart-address.service.ts
|
|
2931
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2932
|
-
*/
|
|
2933
1662
|
/**
|
|
2934
1663
|
* A service for making Magento GraphQL queries for carts.
|
|
2935
1664
|
*
|
|
2936
|
-
*
|
|
1665
|
+
* @inheritdoc
|
|
2937
1666
|
*/
|
|
2938
1667
|
var DaffMagentoCartAddressService = /** @class */ (function () {
|
|
2939
|
-
/**
|
|
2940
|
-
* @param {?} mutationQueue
|
|
2941
|
-
* @param {?} extraCartFragments
|
|
2942
|
-
* @param {?} cartTransformer
|
|
2943
|
-
* @param {?} cartAddressInputTransformer
|
|
2944
|
-
*/
|
|
2945
1668
|
function DaffMagentoCartAddressService(mutationQueue, extraCartFragments, cartTransformer, cartAddressInputTransformer) {
|
|
2946
1669
|
this.mutationQueue = mutationQueue;
|
|
2947
1670
|
this.extraCartFragments = extraCartFragments;
|
|
2948
1671
|
this.cartTransformer = cartTransformer;
|
|
2949
1672
|
this.cartAddressInputTransformer = cartAddressInputTransformer;
|
|
2950
1673
|
}
|
|
2951
|
-
/**
|
|
2952
|
-
* @param {?} cartId
|
|
2953
|
-
* @param {?} address
|
|
2954
|
-
* @return {?}
|
|
2955
|
-
*/
|
|
2956
1674
|
DaffMagentoCartAddressService.prototype.update = function (cartId, address) {
|
|
2957
1675
|
return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
|
|
2958
1676
|
};
|
|
2959
|
-
/**
|
|
2960
|
-
* @private
|
|
2961
|
-
* @param {?} cartId
|
|
2962
|
-
* @param {?} address
|
|
2963
|
-
* @return {?}
|
|
2964
|
-
*/
|
|
2965
1677
|
DaffMagentoCartAddressService.prototype.updateAddress = function (cartId, address) {
|
|
2966
1678
|
var _this = this;
|
|
2967
1679
|
return this.mutationQueue.mutate({
|
|
@@ -2970,26 +1682,8 @@
|
|
|
2970
1682
|
cartId: cartId,
|
|
2971
1683
|
address: this.cartAddressInputTransformer.transform(address),
|
|
2972
1684
|
},
|
|
2973
|
-
}).pipe(operators.map((
|
|
2974
|
-
* @param {?} resp
|
|
2975
|
-
* @return {?}
|
|
2976
|
-
*/function (/**
|
|
2977
|
-
* @param {?} resp
|
|
2978
|
-
* @return {?}
|
|
2979
|
-
*/ resp) { return _this.cartTransformer.transform(resp.data.setShippingAddressesOnCart.cart); })), operators.catchError(( /**
|
|
2980
|
-
* @param {?} error
|
|
2981
|
-
* @return {?}
|
|
2982
|
-
*/function (/**
|
|
2983
|
-
* @param {?} error
|
|
2984
|
-
* @return {?}
|
|
2985
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1685
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(resp.data.setShippingAddressesOnCart.cart); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
2986
1686
|
};
|
|
2987
|
-
/**
|
|
2988
|
-
* @private
|
|
2989
|
-
* @param {?} cartId
|
|
2990
|
-
* @param {?} address
|
|
2991
|
-
* @return {?}
|
|
2992
|
-
*/
|
|
2993
1687
|
DaffMagentoCartAddressService.prototype.updateAddressWithEmail = function (cartId, address) {
|
|
2994
1688
|
var _this = this;
|
|
2995
1689
|
return this.mutationQueue.mutate({
|
|
@@ -2999,22 +1693,11 @@
|
|
|
2999
1693
|
email: address.email,
|
|
3000
1694
|
address: this.cartAddressInputTransformer.transform(address),
|
|
3001
1695
|
},
|
|
3002
|
-
}).pipe(operators.map((
|
|
3003
|
-
* @param {?} resp
|
|
3004
|
-
* @return {?}
|
|
3005
|
-
*/function (/**
|
|
3006
|
-
* @param {?} resp
|
|
3007
|
-
* @return {?}
|
|
3008
|
-
*/ resp) { return _this.cartTransformer.transform(resp.data.setGuestEmailOnCart.cart); })), operators.catchError(( /**
|
|
3009
|
-
* @param {?} error
|
|
3010
|
-
* @return {?}
|
|
3011
|
-
*/function (/**
|
|
3012
|
-
* @param {?} error
|
|
3013
|
-
* @return {?}
|
|
3014
|
-
*/ error) { return rxjs.throwError(transformCartMagentoError(error)); })));
|
|
1696
|
+
}).pipe(operators.map(function (resp) { return _this.cartTransformer.transform(resp.data.setGuestEmailOnCart.cart); }), operators.catchError(function (error) { return rxjs.throwError(transformCartMagentoError(error)); }));
|
|
3015
1697
|
};
|
|
3016
1698
|
return DaffMagentoCartAddressService;
|
|
3017
1699
|
}());
|
|
1700
|
+
/** @nocollapse */ DaffMagentoCartAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartAddressService_Factory() { return new DaffMagentoCartAddressService(i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartAddressInputTransformer)); }, token: DaffMagentoCartAddressService, providedIn: "root" });
|
|
3018
1701
|
DaffMagentoCartAddressService.decorators = [
|
|
3019
1702
|
{ type: i0.Injectable, args: [{
|
|
3020
1703
|
providedIn: 'root',
|
|
@@ -3027,67 +1710,24 @@
|
|
|
3027
1710
|
{ type: DaffMagentoCartTransformer },
|
|
3028
1711
|
{ type: DaffMagentoCartAddressInputTransformer }
|
|
3029
1712
|
]; };
|
|
3030
|
-
/** @nocollapse */ DaffMagentoCartAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartAddressService_Factory() { return new DaffMagentoCartAddressService(i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartTransformer), i0.ɵɵinject(DaffMagentoCartAddressInputTransformer)); }, token: DaffMagentoCartAddressService, providedIn: "root" });
|
|
3031
|
-
if (false) {
|
|
3032
|
-
/**
|
|
3033
|
-
* @type {?}
|
|
3034
|
-
* @private
|
|
3035
|
-
*/
|
|
3036
|
-
DaffMagentoCartAddressService.prototype.mutationQueue;
|
|
3037
|
-
/**
|
|
3038
|
-
* @type {?}
|
|
3039
|
-
* @private
|
|
3040
|
-
*/
|
|
3041
|
-
DaffMagentoCartAddressService.prototype.extraCartFragments;
|
|
3042
|
-
/**
|
|
3043
|
-
* @type {?}
|
|
3044
|
-
* @private
|
|
3045
|
-
*/
|
|
3046
|
-
DaffMagentoCartAddressService.prototype.cartTransformer;
|
|
3047
|
-
/**
|
|
3048
|
-
* @type {?}
|
|
3049
|
-
* @private
|
|
3050
|
-
*/
|
|
3051
|
-
DaffMagentoCartAddressService.prototype.cartAddressInputTransformer;
|
|
3052
|
-
}
|
|
3053
1713
|
|
|
3054
|
-
/**
|
|
3055
|
-
* @fileoverview added by tsickle
|
|
3056
|
-
* Generated from: transforms/outputs/cart-coupon-response.service.ts
|
|
3057
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3058
|
-
*/
|
|
3059
1714
|
/**
|
|
3060
1715
|
* Transforms magento carts into an object usable by daffodil.
|
|
3061
1716
|
*/
|
|
3062
1717
|
var DaffMagentoCartCouponResponseTransformer = /** @class */ (function () {
|
|
3063
1718
|
function DaffMagentoCartCouponResponseTransformer() {
|
|
3064
1719
|
}
|
|
3065
|
-
/**
|
|
3066
|
-
* @private
|
|
3067
|
-
* @param {?} cart
|
|
3068
|
-
* @return {?}
|
|
3069
|
-
*/
|
|
3070
1720
|
DaffMagentoCartCouponResponseTransformer.prototype.transformCartItems = function (cart) {
|
|
3071
1721
|
return {
|
|
3072
1722
|
items: cart.items.map(transformMagentoCartItem),
|
|
3073
1723
|
};
|
|
3074
1724
|
};
|
|
3075
|
-
/**
|
|
3076
|
-
* @private
|
|
3077
|
-
* @param {?} cart
|
|
3078
|
-
* @return {?}
|
|
3079
|
-
*/
|
|
3080
1725
|
DaffMagentoCartCouponResponseTransformer.prototype.transformTotals = function (cart) {
|
|
3081
1726
|
return {
|
|
3082
1727
|
grand_total: cart.prices.grand_total.value,
|
|
3083
1728
|
subtotal: cart.prices.subtotal_excluding_tax.value,
|
|
3084
1729
|
};
|
|
3085
1730
|
};
|
|
3086
|
-
/**
|
|
3087
|
-
* @private
|
|
3088
|
-
* @param {?} cart
|
|
3089
|
-
* @return {?}
|
|
3090
|
-
*/
|
|
3091
1731
|
DaffMagentoCartCouponResponseTransformer.prototype.transformCoupons = function (cart) {
|
|
3092
1732
|
return {
|
|
3093
1733
|
coupons: cart.applied_coupons
|
|
@@ -3098,47 +1738,31 @@
|
|
|
3098
1738
|
/**
|
|
3099
1739
|
* Transforms the MagentoCart from the cart coupon operations into a DaffCart partial.
|
|
3100
1740
|
*
|
|
3101
|
-
* @param
|
|
3102
|
-
* @return {?}
|
|
1741
|
+
* @param cart the cart from a magento cart query.
|
|
3103
1742
|
*/
|
|
3104
1743
|
DaffMagentoCartCouponResponseTransformer.prototype.transform = function (cart) {
|
|
3105
1744
|
return cart ? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.transformCartItems(cart)), this.transformCoupons(cart)), this.transformTotals(cart)), transformCartTotals(cart)), { id: cart.id }) : null;
|
|
3106
1745
|
};
|
|
3107
1746
|
return DaffMagentoCartCouponResponseTransformer;
|
|
3108
1747
|
}());
|
|
1748
|
+
/** @nocollapse */ DaffMagentoCartCouponResponseTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartCouponResponseTransformer_Factory() { return new DaffMagentoCartCouponResponseTransformer(); }, token: DaffMagentoCartCouponResponseTransformer, providedIn: "root" });
|
|
3109
1749
|
DaffMagentoCartCouponResponseTransformer.decorators = [
|
|
3110
1750
|
{ type: i0.Injectable, args: [{
|
|
3111
1751
|
providedIn: 'root',
|
|
3112
1752
|
},] }
|
|
3113
1753
|
];
|
|
3114
|
-
/** @nocollapse */ DaffMagentoCartCouponResponseTransformer.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartCouponResponseTransformer_Factory() { return new DaffMagentoCartCouponResponseTransformer(); }, token: DaffMagentoCartCouponResponseTransformer, providedIn: "root" });
|
|
3115
1754
|
|
|
3116
|
-
/**
|
|
3117
|
-
* @fileoverview added by tsickle
|
|
3118
|
-
* Generated from: cart-coupon.service.ts
|
|
3119
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3120
|
-
*/
|
|
3121
1755
|
/**
|
|
3122
1756
|
* A service for making Magento GraphQL queries for carts.
|
|
3123
1757
|
*
|
|
3124
|
-
*
|
|
1758
|
+
* @inheritdoc
|
|
3125
1759
|
*/
|
|
3126
1760
|
var DaffMagentoCartCouponService = /** @class */ (function () {
|
|
3127
|
-
/**
|
|
3128
|
-
* @param {?} mutationQueue
|
|
3129
|
-
* @param {?} extraCartFragments
|
|
3130
|
-
* @param {?} cartTransformer
|
|
3131
|
-
*/
|
|
3132
1761
|
function DaffMagentoCartCouponService(mutationQueue, extraCartFragments, cartTransformer) {
|
|
3133
1762
|
this.mutationQueue = mutationQueue;
|
|
3134
1763
|
this.extraCartFragments = extraCartFragments;
|
|
3135
1764
|
this.cartTransformer = cartTransformer;
|
|
3136
1765
|
}
|
|
3137
|
-
/**
|
|
3138
|
-
* @param {?} cartId
|
|
3139
|
-
* @param {?} coupon
|
|
3140
|
-
* @return {?}
|
|
3141
|
-
*/
|
|
3142
1766
|
DaffMagentoCartCouponService.prototype.apply = function (cartId, coupon) {
|
|
3143
1767
|
var _this = this;
|
|
3144
1768
|
return this.mutationQueue.mutate({
|
|
@@ -3147,56 +1771,19 @@
|
|
|
3147
1771
|
cartId: cartId,
|
|
3148
1772
|
couponCode: coupon.code,
|
|
3149
1773
|
},
|
|
3150
|
-
}).pipe(operators.map((
|
|
3151
|
-
* @param {?} result
|
|
3152
|
-
* @return {?}
|
|
3153
|
-
*/function (/**
|
|
3154
|
-
* @param {?} result
|
|
3155
|
-
* @return {?}
|
|
3156
|
-
*/ result) { return _this.cartTransformer.transform(result.data.applyCouponToCart.cart); })), operators.catchError(( /**
|
|
3157
|
-
* @param {?} err
|
|
3158
|
-
* @return {?}
|
|
3159
|
-
*/function (/**
|
|
3160
|
-
* @param {?} err
|
|
3161
|
-
* @return {?}
|
|
3162
|
-
*/ err) { return rxjs.throwError(transformCartMagentoError(err, coupon)); })));
|
|
1774
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.applyCouponToCart.cart); }), operators.catchError(function (err) { return rxjs.throwError(transformCartMagentoError(err, coupon)); }));
|
|
3163
1775
|
};
|
|
3164
|
-
/**
|
|
3165
|
-
* @param {?} cartId
|
|
3166
|
-
* @return {?}
|
|
3167
|
-
*/
|
|
3168
1776
|
DaffMagentoCartCouponService.prototype.list = function (cartId) {
|
|
3169
1777
|
return this.mutationQueue.mutate({
|
|
3170
1778
|
mutation: listCartCoupons(this.extraCartFragments),
|
|
3171
1779
|
variables: {
|
|
3172
1780
|
cartId: cartId,
|
|
3173
1781
|
},
|
|
3174
|
-
}).pipe(operators.map((
|
|
3175
|
-
* @param {?} result
|
|
3176
|
-
* @return {?}
|
|
3177
|
-
*/function (/**
|
|
3178
|
-
* @param {?} result
|
|
3179
|
-
* @return {?}
|
|
3180
|
-
*/ result) { return result.data.cart.applied_coupons.map(daffMagentoCouponTransform); })), operators.catchError(( /**
|
|
3181
|
-
* @param {?} err
|
|
3182
|
-
* @return {?}
|
|
3183
|
-
*/function (/**
|
|
3184
|
-
* @param {?} err
|
|
3185
|
-
* @return {?}
|
|
3186
|
-
*/ err) { return rxjs.throwError(transformCartMagentoError(err)); })));
|
|
1782
|
+
}).pipe(operators.map(function (result) { return result.data.cart.applied_coupons.map(daffMagentoCouponTransform); }), operators.catchError(function (err) { return rxjs.throwError(transformCartMagentoError(err)); }));
|
|
3187
1783
|
};
|
|
3188
|
-
/**
|
|
3189
|
-
* @param {?} cartId
|
|
3190
|
-
* @param {?} coupon
|
|
3191
|
-
* @return {?}
|
|
3192
|
-
*/
|
|
3193
1784
|
DaffMagentoCartCouponService.prototype.remove = function (cartId, coupon) {
|
|
3194
1785
|
return this.removeAll(cartId);
|
|
3195
1786
|
};
|
|
3196
|
-
/**
|
|
3197
|
-
* @param {?} cartId
|
|
3198
|
-
* @return {?}
|
|
3199
|
-
*/
|
|
3200
1787
|
DaffMagentoCartCouponService.prototype.removeAll = function (cartId) {
|
|
3201
1788
|
var _this = this;
|
|
3202
1789
|
return this.mutationQueue.mutate({
|
|
@@ -3204,22 +1791,11 @@
|
|
|
3204
1791
|
variables: {
|
|
3205
1792
|
cartId: cartId,
|
|
3206
1793
|
},
|
|
3207
|
-
}).pipe(operators.map((
|
|
3208
|
-
* @param {?} result
|
|
3209
|
-
* @return {?}
|
|
3210
|
-
*/function (/**
|
|
3211
|
-
* @param {?} result
|
|
3212
|
-
* @return {?}
|
|
3213
|
-
*/ result) { return _this.cartTransformer.transform(result.data.removeCouponFromCart.cart); })), operators.catchError(( /**
|
|
3214
|
-
* @param {?} err
|
|
3215
|
-
* @return {?}
|
|
3216
|
-
*/function (/**
|
|
3217
|
-
* @param {?} err
|
|
3218
|
-
* @return {?}
|
|
3219
|
-
*/ err) { return rxjs.throwError(transformCartMagentoError(err)); })));
|
|
1794
|
+
}).pipe(operators.map(function (result) { return _this.cartTransformer.transform(result.data.removeCouponFromCart.cart); }), operators.catchError(function (err) { return rxjs.throwError(transformCartMagentoError(err)); }));
|
|
3220
1795
|
};
|
|
3221
1796
|
return DaffMagentoCartCouponService;
|
|
3222
1797
|
}());
|
|
1798
|
+
/** @nocollapse */ DaffMagentoCartCouponService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartCouponService_Factory() { return new DaffMagentoCartCouponService(i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartCouponResponseTransformer)); }, token: DaffMagentoCartCouponService, providedIn: "root" });
|
|
3223
1799
|
DaffMagentoCartCouponService.decorators = [
|
|
3224
1800
|
{ type: i0.Injectable, args: [{
|
|
3225
1801
|
providedIn: 'root',
|
|
@@ -3231,73 +1807,31 @@
|
|
|
3231
1807
|
{ type: Array, decorators: [{ type: i0.Inject, args: [DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS,] }] },
|
|
3232
1808
|
{ type: DaffMagentoCartCouponResponseTransformer }
|
|
3233
1809
|
]; };
|
|
3234
|
-
/** @nocollapse */ DaffMagentoCartCouponService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartCouponService_Factory() { return new DaffMagentoCartCouponService(i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE), i0.ɵɵinject(DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS), i0.ɵɵinject(DaffMagentoCartCouponResponseTransformer)); }, token: DaffMagentoCartCouponService, providedIn: "root" });
|
|
3235
|
-
if (false) {
|
|
3236
|
-
/**
|
|
3237
|
-
* @type {?}
|
|
3238
|
-
* @private
|
|
3239
|
-
*/
|
|
3240
|
-
DaffMagentoCartCouponService.prototype.mutationQueue;
|
|
3241
|
-
/**
|
|
3242
|
-
* @type {?}
|
|
3243
|
-
* @private
|
|
3244
|
-
*/
|
|
3245
|
-
DaffMagentoCartCouponService.prototype.extraCartFragments;
|
|
3246
|
-
/**
|
|
3247
|
-
* @type {?}
|
|
3248
|
-
* @private
|
|
3249
|
-
*/
|
|
3250
|
-
DaffMagentoCartCouponService.prototype.cartTransformer;
|
|
3251
|
-
}
|
|
3252
1810
|
|
|
3253
|
-
/**
|
|
3254
|
-
* @fileoverview added by tsickle
|
|
3255
|
-
* Generated from: cart-order.service.ts
|
|
3256
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3257
|
-
*/
|
|
3258
1811
|
/**
|
|
3259
1812
|
* A service for making Magento GraphQL queries for carts.
|
|
3260
1813
|
*
|
|
3261
|
-
*
|
|
1814
|
+
* @inheritdoc
|
|
3262
1815
|
*/
|
|
3263
1816
|
var DaffMagentoCartOrderService = /** @class */ (function () {
|
|
3264
|
-
/**
|
|
3265
|
-
* @param {?} mutationQueue
|
|
3266
|
-
*/
|
|
3267
1817
|
function DaffMagentoCartOrderService(mutationQueue) {
|
|
3268
1818
|
this.mutationQueue = mutationQueue;
|
|
3269
1819
|
}
|
|
3270
|
-
/**
|
|
3271
|
-
* @param {?} cartId
|
|
3272
|
-
* @param {?=} payment
|
|
3273
|
-
* @return {?}
|
|
3274
|
-
*/
|
|
3275
1820
|
DaffMagentoCartOrderService.prototype.placeOrder = function (cartId, payment) {
|
|
3276
1821
|
return this.mutationQueue.mutate({
|
|
3277
1822
|
mutation: placeOrder,
|
|
3278
1823
|
variables: {
|
|
3279
1824
|
cartId: cartId,
|
|
3280
1825
|
},
|
|
3281
|
-
}).pipe(operators.map((
|
|
3282
|
-
* @param {?} result
|
|
3283
|
-
* @return {?}
|
|
3284
|
-
*/function (/**
|
|
3285
|
-
* @param {?} result
|
|
3286
|
-
* @return {?}
|
|
3287
|
-
*/ result) { return ({
|
|
1826
|
+
}).pipe(operators.map(function (result) { return ({
|
|
3288
1827
|
id: result.data.placeOrder.order.order_number,
|
|
3289
1828
|
orderId: result.data.placeOrder.order.order_number,
|
|
3290
1829
|
cartId: cartId,
|
|
3291
|
-
}); })
|
|
3292
|
-
* @param {?} err
|
|
3293
|
-
* @return {?}
|
|
3294
|
-
*/function (/**
|
|
3295
|
-
* @param {?} err
|
|
3296
|
-
* @return {?}
|
|
3297
|
-
*/ err) { return rxjs.throwError(transformCartMagentoError(err)); })));
|
|
1830
|
+
}); }), operators.catchError(function (err) { return rxjs.throwError(transformCartMagentoError(err)); }));
|
|
3298
1831
|
};
|
|
3299
1832
|
return DaffMagentoCartOrderService;
|
|
3300
1833
|
}());
|
|
1834
|
+
/** @nocollapse */ DaffMagentoCartOrderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartOrderService_Factory() { return new DaffMagentoCartOrderService(i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE)); }, token: DaffMagentoCartOrderService, providedIn: "root" });
|
|
3301
1835
|
DaffMagentoCartOrderService.decorators = [
|
|
3302
1836
|
{ type: i0.Injectable, args: [{
|
|
3303
1837
|
providedIn: 'root',
|
|
@@ -3307,26 +1841,10 @@
|
|
|
3307
1841
|
DaffMagentoCartOrderService.ctorParameters = function () { return [
|
|
3308
1842
|
{ type: graphql.DaffQueuedApollo, decorators: [{ type: i0.Inject, args: [DAFF_MAGENTO_CART_MUTATION_QUEUE,] }] }
|
|
3309
1843
|
]; };
|
|
3310
|
-
/** @nocollapse */ DaffMagentoCartOrderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffMagentoCartOrderService_Factory() { return new DaffMagentoCartOrderService(i0.ɵɵinject(DAFF_MAGENTO_CART_MUTATION_QUEUE)); }, token: DaffMagentoCartOrderService, providedIn: "root" });
|
|
3311
|
-
if (false) {
|
|
3312
|
-
/**
|
|
3313
|
-
* @type {?}
|
|
3314
|
-
* @private
|
|
3315
|
-
*/
|
|
3316
|
-
DaffMagentoCartOrderService.prototype.mutationQueue;
|
|
3317
|
-
}
|
|
3318
1844
|
|
|
3319
|
-
/**
|
|
3320
|
-
* @fileoverview added by tsickle
|
|
3321
|
-
* Generated from: cart-driver.module.ts
|
|
3322
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3323
|
-
*/
|
|
3324
1845
|
var DaffCartMagentoDriverModule = /** @class */ (function () {
|
|
3325
1846
|
function DaffCartMagentoDriverModule() {
|
|
3326
1847
|
}
|
|
3327
|
-
/**
|
|
3328
|
-
* @return {?}
|
|
3329
|
-
*/
|
|
3330
1848
|
DaffCartMagentoDriverModule.forRoot = function () {
|
|
3331
1849
|
return {
|
|
3332
1850
|
ngModule: DaffCartMagentoDriverModule,
|
|
@@ -3405,21 +1923,7 @@
|
|
|
3405
1923
|
];
|
|
3406
1924
|
|
|
3407
1925
|
/**
|
|
3408
|
-
*
|
|
3409
|
-
* Generated from: public_api.ts
|
|
3410
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3411
|
-
*/
|
|
3412
|
-
|
|
3413
|
-
/**
|
|
3414
|
-
* @fileoverview added by tsickle
|
|
3415
|
-
* Generated from: index.ts
|
|
3416
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3417
|
-
*/
|
|
3418
|
-
|
|
3419
|
-
/**
|
|
3420
|
-
* @fileoverview added by tsickle
|
|
3421
|
-
* Generated from: daffodil-cart-driver-magento.ts
|
|
3422
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1926
|
+
* Generated bundle index. Do not edit.
|
|
3423
1927
|
*/
|
|
3424
1928
|
|
|
3425
1929
|
exports.DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS = DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS;
|
|
@@ -3445,7 +1949,6 @@
|
|
|
3445
1949
|
exports.DaffMagentoShippingAddressInputTransformer = DaffMagentoShippingAddressInputTransformer;
|
|
3446
1950
|
exports.DaffMagentoShippingAddressTransformer = DaffMagentoShippingAddressTransformer;
|
|
3447
1951
|
exports.DaffMagentoShippingMethodInputTransformer = DaffMagentoShippingMethodInputTransformer;
|
|
3448
|
-
exports.MagentoCartItemTypeEnum = MagentoCartItemTypeEnum;
|
|
3449
1952
|
exports.addCartItem = addCartItem;
|
|
3450
1953
|
exports.applyCoupon = applyCoupon;
|
|
3451
1954
|
exports.availablePaymentMethodFragment = availablePaymentMethodFragment;
|