@daffodil/cart 0.39.12 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/daffodil-cart.d.ts +1 -1
- package/driver/daffodil-cart-driver.d.ts +1 -0
- package/driver/errors/map.d.ts +0 -1
- package/driver/in-memory/backend/cart/cart.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-address/cart-address.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-coupon/cart-coupon.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-items/cart-items.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-order/cart-order.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-payment/cart-payment.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-root.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.d.ts +3 -0
- package/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -0
- package/driver/in-memory/daffodil-cart-driver-in-memory.d.ts +1 -1
- package/driver/in-memory/drivers/cart/cart.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-address/cart-address.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-coupon/cart-coupon.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-driver.module.d.ts +5 -0
- package/driver/in-memory/drivers/cart-item/cart-item.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-order/cart-order.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-payment/cart-payment.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +3 -0
- package/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -0
- package/driver/in-memory/package.json +5 -6
- package/driver/magento/cart-address.service.d.ts +3 -0
- package/driver/magento/cart-billing-address.service.d.ts +3 -0
- package/driver/magento/cart-coupon.service.d.ts +3 -0
- package/driver/magento/cart-driver.module.d.ts +5 -0
- package/driver/magento/cart-item.service.d.ts +3 -0
- package/driver/magento/cart-order.service.d.ts +3 -0
- package/driver/magento/cart-payment-methods.service.d.ts +3 -0
- package/driver/magento/cart-payment.service.d.ts +3 -0
- package/driver/magento/cart-shipping-address.service.d.ts +3 -0
- package/driver/magento/cart-shipping-information.service.d.ts +3 -0
- package/driver/magento/cart-shipping-methods.service.d.ts +3 -0
- package/driver/magento/cart.service.d.ts +3 -0
- package/driver/magento/daffodil-cart-driver-magento.d.ts +1 -5
- package/driver/magento/errors/map.d.ts +0 -1
- package/driver/magento/injection-tokens/transforms/cart-item/token.d.ts +1 -1
- package/driver/magento/package.json +5 -6
- package/driver/magento/queries/add-cart-item.d.ts +1 -1
- package/driver/magento/queries/apply-coupon.d.ts +1 -1
- package/driver/magento/queries/create-cart.d.ts +1 -1
- package/driver/magento/queries/fragments/available-payment-method.d.ts +1 -1
- package/driver/magento/queries/fragments/available-shipping-method.d.ts +1 -1
- package/driver/magento/queries/fragments/cart-address.d.ts +1 -1
- package/driver/magento/queries/fragments/cart-coupon.d.ts +1 -1
- package/driver/magento/queries/fragments/cart-item.d.ts +2 -2
- package/driver/magento/queries/fragments/cart-totals.d.ts +1 -1
- package/driver/magento/queries/fragments/cart.d.ts +1 -1
- package/driver/magento/queries/fragments/money.d.ts +1 -1
- package/driver/magento/queries/fragments/prices.d.ts +1 -1
- package/driver/magento/queries/fragments/selected-payment-method.d.ts +1 -1
- package/driver/magento/queries/fragments/selected-shipping-method.d.ts +1 -1
- package/driver/magento/queries/get-billing-address.d.ts +1 -1
- package/driver/magento/queries/get-cart.d.ts +1 -1
- package/driver/magento/queries/get-selected-payment-method.d.ts +1 -1
- package/driver/magento/queries/get-selected-shipping-method.d.ts +1 -1
- package/driver/magento/queries/get-shipping-address.d.ts +1 -1
- package/driver/magento/queries/list-cart-coupons.d.ts +1 -1
- package/driver/magento/queries/list-cart-items.d.ts +1 -1
- package/driver/magento/queries/list-payment-methods.d.ts +1 -1
- package/driver/magento/queries/list-shipping-methods.d.ts +1 -1
- package/driver/magento/queries/place-order.d.ts +1 -1
- package/driver/magento/queries/remove-all-coupons.d.ts +1 -1
- package/driver/magento/queries/remove-cart-item.d.ts +1 -1
- package/driver/magento/queries/set-selected-payment-method-with-billing-and-email.d.ts +1 -1
- package/driver/magento/queries/set-selected-payment-method-with-billing.d.ts +1 -1
- package/driver/magento/queries/set-selected-payment-method.d.ts +1 -1
- package/driver/magento/queries/set-selected-shipping-method.d.ts +1 -1
- package/driver/magento/queries/update-address-with-email.d.ts +1 -1
- package/driver/magento/queries/update-address.d.ts +1 -1
- package/driver/magento/queries/update-billing-address-with-email.d.ts +1 -1
- package/driver/magento/queries/update-billing-address.d.ts +1 -1
- package/driver/magento/queries/update-cart-item.d.ts +1 -1
- package/driver/magento/queries/update-shipping-address-with-email.d.ts +1 -1
- package/driver/magento/queries/update-shipping-address.d.ts +1 -1
- package/driver/magento/testing/daffodil-cart-driver-magento-testing.d.ts +1 -0
- package/driver/magento/testing/factories/cart-address-input.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-address.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-coupon.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-item/cart-item.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-payment-method.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart-shipping-method.factory.d.ts +3 -0
- package/driver/magento/testing/factories/cart.factory.d.ts +3 -0
- package/driver/magento/testing/factories/shipping-address.factory.d.ts +3 -0
- package/driver/magento/testing/package.json +5 -6
- package/driver/magento/transforms/inputs/billing-address.service.d.ts +3 -0
- package/driver/magento/transforms/inputs/cart-address.service.d.ts +3 -0
- package/driver/magento/transforms/inputs/cart-item-update.service.d.ts +3 -0
- package/driver/magento/transforms/inputs/payment-method.service.d.ts +3 -0
- package/driver/magento/transforms/inputs/shipping-address.service.d.ts +3 -0
- package/driver/magento/transforms/inputs/shipping-method.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/billing-address.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/cart-address.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/cart-coupon-response.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/cart-payment.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/cart-shipping-information.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/cart-shipping-rate.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/cart.service.d.ts +3 -0
- package/driver/magento/transforms/outputs/shipping-address.service.d.ts +3 -0
- package/driver/package.json +5 -6
- package/driver/testing/daffodil-cart-driver-testing.d.ts +1 -0
- package/driver/testing/drivers/cart/cart.service.d.ts +3 -0
- package/driver/testing/drivers/cart-address/cart-address.service.d.ts +3 -0
- package/driver/testing/drivers/cart-billing-address/cart-billing-address.service.d.ts +3 -0
- package/driver/testing/drivers/cart-coupon/cart-coupon.service.d.ts +3 -0
- package/driver/testing/drivers/cart-driver.module.d.ts +5 -0
- package/driver/testing/drivers/cart-item/cart-item.service.d.ts +3 -0
- package/driver/testing/drivers/cart-order/cart-order.service.d.ts +3 -0
- package/driver/testing/drivers/cart-payment/cart-payment.service.d.ts +3 -0
- package/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +3 -0
- package/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +3 -0
- package/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +3 -0
- package/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -0
- package/driver/testing/package.json +5 -6
- package/errors/map.d.ts +0 -1
- package/esm2020/daffodil-cart.mjs +5 -0
- package/{esm2015/driver/daffodil-cart-driver.js → esm2020/driver/daffodil-cart-driver.mjs} +0 -0
- package/{esm2015/driver/errors/cart-not-found.js → esm2020/driver/errors/cart-not-found.mjs} +0 -0
- package/{esm2015/driver/errors/codes.enum.js → esm2020/driver/errors/codes.enum.mjs} +0 -0
- package/{esm2015/driver/errors/expired-payment-token.js → esm2020/driver/errors/expired-payment-token.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-api-response.js → esm2020/driver/errors/invalid-api-response.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-country.js → esm2020/driver/errors/invalid-country.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-coupon-code.js → esm2020/driver/errors/invalid-coupon-code.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-email.js → esm2020/driver/errors/invalid-email.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-region.js → esm2020/driver/errors/invalid-region.mjs} +0 -0
- package/{esm2015/driver/errors/item-exceeds-max-qty.js → esm2020/driver/errors/item-exceeds-max-qty.mjs} +0 -0
- package/{esm2015/driver/errors/map.js → esm2020/driver/errors/map.mjs} +0 -0
- package/{esm2015/driver/errors/product-not-found.js → esm2020/driver/errors/product-not-found.mjs} +0 -0
- package/{esm2015/driver/errors/product-out-of-stock.js → esm2020/driver/errors/product-out-of-stock.mjs} +0 -0
- package/{esm2015/driver/errors/public_api.js → esm2020/driver/errors/public_api.mjs} +0 -0
- package/esm2020/driver/in-memory/backend/cart/cart.service.mjs +81 -0
- package/esm2020/driver/in-memory/backend/cart-address/cart-address.service.mjs +43 -0
- package/esm2020/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.mjs +51 -0
- package/esm2020/driver/in-memory/backend/cart-coupon/cart-coupon.service.mjs +89 -0
- package/{esm2015/driver/in-memory/backend/cart-items/cart-items.service.js → esm2020/driver/in-memory/backend/cart-items/cart-items.service.mjs} +45 -20
- package/esm2020/driver/in-memory/backend/cart-order/cart-order.service.mjs +30 -0
- package/esm2020/driver/in-memory/backend/cart-payment/cart-payment.service.mjs +68 -0
- package/esm2020/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.mjs +29 -0
- package/{esm2015/driver/in-memory/backend/cart-root.service.js → esm2020/driver/in-memory/backend/cart-root.service.mjs} +9 -21
- package/esm2020/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.mjs +51 -0
- package/esm2020/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.mjs +65 -0
- package/esm2020/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.mjs +43 -0
- package/{esm2015/driver/in-memory/backend/public_api.js → esm2020/driver/in-memory/backend/public_api.mjs} +0 -0
- package/esm2020/driver/in-memory/daffodil-cart-driver-in-memory.mjs +5 -0
- package/esm2020/driver/in-memory/drivers/cart/cart.service.mjs +43 -0
- package/esm2020/driver/in-memory/drivers/cart-address/cart-address.service.mjs +28 -0
- package/esm2020/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.mjs +31 -0
- package/esm2020/driver/in-memory/drivers/cart-coupon/cart-coupon.service.mjs +37 -0
- package/esm2020/driver/in-memory/drivers/cart-driver.module.mjs +82 -0
- package/esm2020/driver/in-memory/drivers/cart-item/cart-item.service.mjs +40 -0
- package/esm2020/driver/in-memory/drivers/cart-order/cart-order.service.mjs +28 -0
- package/esm2020/driver/in-memory/drivers/cart-payment/cart-payment.service.mjs +37 -0
- package/esm2020/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.mjs +28 -0
- package/esm2020/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.mjs +31 -0
- package/esm2020/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.mjs +34 -0
- package/esm2020/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +28 -0
- package/{esm2015/driver/in-memory/drivers/public_api.js → esm2020/driver/in-memory/drivers/public_api.mjs} +0 -0
- package/{esm2015/driver/in-memory/index.js → esm2020/driver/in-memory/index.mjs} +0 -0
- package/{esm2015/driver/in-memory/injection-tokens/extra-attributes-hook.token.js → esm2020/driver/in-memory/injection-tokens/extra-attributes-hook.token.mjs} +0 -0
- package/{esm2015/driver/in-memory/injection-tokens/public_api.js → esm2020/driver/in-memory/injection-tokens/public_api.mjs} +0 -0
- package/{esm2015/driver/in-memory/public_api.js → esm2020/driver/in-memory/public_api.mjs} +0 -0
- package/{esm2015/driver/index.js → esm2020/driver/index.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-address-service.interface.js → esm2020/driver/interfaces/cart-address-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-billing-address-service.interface.js → esm2020/driver/interfaces/cart-billing-address-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-coupon-service.interface.js → esm2020/driver/interfaces/cart-coupon-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-item-service.interface.js → esm2020/driver/interfaces/cart-item-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-order-service.interface.js → esm2020/driver/interfaces/cart-order-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-payment-methods-service.interface.js → esm2020/driver/interfaces/cart-payment-methods-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-payment-service.interface.js → esm2020/driver/interfaces/cart-payment-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-service.interface.js → esm2020/driver/interfaces/cart-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-shipping-address-service.interface.js → esm2020/driver/interfaces/cart-shipping-address-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-shipping-information-service.interface.js → esm2020/driver/interfaces/cart-shipping-information-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/cart-shipping-methods-service.interface.js → esm2020/driver/interfaces/cart-shipping-methods-service.interface.mjs} +0 -0
- package/{esm2015/driver/interfaces/public_api.js → esm2020/driver/interfaces/public_api.mjs} +0 -0
- package/esm2020/driver/magento/cart-address.service.mjs +64 -0
- package/esm2020/driver/magento/cart-billing-address.service.mjs +84 -0
- package/esm2020/driver/magento/cart-coupon.service.mjs +68 -0
- package/esm2020/driver/magento/cart-driver.module.mjs +112 -0
- package/esm2020/driver/magento/cart-item.service.mjs +111 -0
- package/esm2020/driver/magento/cart-order.service.mjs +43 -0
- package/esm2020/driver/magento/cart-payment-methods.service.mjs +39 -0
- package/esm2020/driver/magento/cart-payment.service.mjs +101 -0
- package/esm2020/driver/magento/cart-shipping-address.service.mjs +84 -0
- package/esm2020/driver/magento/cart-shipping-information.service.mjs +86 -0
- package/esm2020/driver/magento/cart-shipping-methods.service.mjs +39 -0
- package/esm2020/driver/magento/cart.service.mjs +75 -0
- package/esm2020/driver/magento/daffodil-cart-driver-magento.mjs +5 -0
- package/{esm2015/driver/magento/errors/codes.js → esm2020/driver/magento/errors/codes.mjs} +0 -0
- package/{esm2015/driver/magento/errors/map.js → esm2020/driver/magento/errors/map.mjs} +0 -0
- package/esm2020/driver/magento/errors/transform.mjs +37 -0
- package/{esm2015/driver/magento/index.js → esm2020/driver/magento/index.mjs} +0 -0
- package/{esm2015/driver/magento/injection-tokens/cart-mutation-queue.token.js → esm2020/driver/magento/injection-tokens/cart-mutation-queue.token.mjs} +0 -0
- package/{esm2015/driver/magento/injection-tokens/fragments/cart.js → esm2020/driver/magento/injection-tokens/fragments/cart.mjs} +0 -0
- package/{esm2015/driver/magento/injection-tokens/public_api.js → esm2020/driver/magento/injection-tokens/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/injection-tokens/transforms/cart-item/token.js → esm2020/driver/magento/injection-tokens/transforms/cart-item/token.mjs} +0 -0
- package/{esm2015/driver/magento/interfaces/cart-item-transform.type.js → esm2020/driver/magento/interfaces/cart-item-transform.type.mjs} +0 -0
- package/{esm2015/driver/magento/interfaces/public_api.js → esm2020/driver/magento/interfaces/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/models/public_api.js → esm2020/driver/magento/models/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/billing-address.js → esm2020/driver/magento/models/requests/billing-address.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/cart-address.js → esm2020/driver/magento/models/requests/cart-address.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/cart-item-update.js → esm2020/driver/magento/models/requests/cart-item-update.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/cart-item.js → esm2020/driver/magento/models/requests/cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/payment-method.js → esm2020/driver/magento/models/requests/payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/public_api.js → esm2020/driver/magento/models/requests/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/shipping-address.js → esm2020/driver/magento/models/requests/shipping-address.mjs} +0 -0
- package/{esm2015/driver/magento/models/requests/shipping-method.js → esm2020/driver/magento/models/requests/shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/cart-address.js → esm2020/driver/magento/models/responses/cart-address.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/cart-coupon.js → esm2020/driver/magento/models/responses/cart-coupon.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/cart-item.js → esm2020/driver/magento/models/responses/cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/cart-payment-method.js → esm2020/driver/magento/models/responses/cart-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/cart-shipping-method.js → esm2020/driver/magento/models/responses/cart-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/cart.js → esm2020/driver/magento/models/responses/cart.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/public_api.js → esm2020/driver/magento/models/responses/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/shipping-address.js → esm2020/driver/magento/models/responses/shipping-address.mjs} +0 -0
- package/{esm2015/driver/magento/public_api.js → esm2020/driver/magento/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/queries/add-cart-item.js → esm2020/driver/magento/queries/add-cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/apply-coupon.js → esm2020/driver/magento/queries/apply-coupon.mjs} +0 -0
- package/{esm2015/driver/magento/queries/create-cart.js → esm2020/driver/magento/queries/create-cart.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/available-payment-method.js → esm2020/driver/magento/queries/fragments/available-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/available-shipping-method.js → esm2020/driver/magento/queries/fragments/available-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/cart-address.js → esm2020/driver/magento/queries/fragments/cart-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/cart-coupon.js → esm2020/driver/magento/queries/fragments/cart-coupon.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/cart-item.js → esm2020/driver/magento/queries/fragments/cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/cart-totals.js → esm2020/driver/magento/queries/fragments/cart-totals.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/cart.js → esm2020/driver/magento/queries/fragments/cart.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/money.js → esm2020/driver/magento/queries/fragments/money.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/prices.js → esm2020/driver/magento/queries/fragments/prices.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/public_api.js → esm2020/driver/magento/queries/fragments/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/selected-payment-method.js → esm2020/driver/magento/queries/fragments/selected-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/selected-shipping-method.js → esm2020/driver/magento/queries/fragments/selected-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/get-billing-address.js → esm2020/driver/magento/queries/get-billing-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/get-cart.js → esm2020/driver/magento/queries/get-cart.mjs} +0 -0
- package/{esm2015/driver/magento/queries/get-selected-payment-method.js → esm2020/driver/magento/queries/get-selected-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/get-selected-shipping-method.js → esm2020/driver/magento/queries/get-selected-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/get-shipping-address.js → esm2020/driver/magento/queries/get-shipping-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/list-cart-coupons.js → esm2020/driver/magento/queries/list-cart-coupons.mjs} +0 -0
- package/{esm2015/driver/magento/queries/list-cart-items.js → esm2020/driver/magento/queries/list-cart-items.mjs} +0 -0
- package/{esm2015/driver/magento/queries/list-payment-methods.js → esm2020/driver/magento/queries/list-payment-methods.mjs} +0 -0
- package/{esm2015/driver/magento/queries/list-shipping-methods.js → esm2020/driver/magento/queries/list-shipping-methods.mjs} +0 -0
- package/{esm2015/driver/magento/queries/place-order.js → esm2020/driver/magento/queries/place-order.mjs} +0 -0
- package/{esm2015/driver/magento/queries/public_api.js → esm2020/driver/magento/queries/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/queries/remove-all-coupons.js → esm2020/driver/magento/queries/remove-all-coupons.mjs} +0 -0
- package/{esm2015/driver/magento/queries/remove-cart-item.js → esm2020/driver/magento/queries/remove-cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/add-cart-item.js → esm2020/driver/magento/queries/responses/add-cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/apply-coupon.js → esm2020/driver/magento/queries/responses/apply-coupon.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/create-cart.js → esm2020/driver/magento/queries/responses/create-cart.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-billing-address.js → esm2020/driver/magento/queries/responses/get-billing-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-cart.js → esm2020/driver/magento/queries/responses/get-cart.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-selected-payment-method.js → esm2020/driver/magento/queries/responses/get-selected-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-selected-shipping-method.js → esm2020/driver/magento/queries/responses/get-selected-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-shipping-address.js → esm2020/driver/magento/queries/responses/get-shipping-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/list-cart-coupons.js → esm2020/driver/magento/queries/responses/list-cart-coupons.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/list-cart-items.js → esm2020/driver/magento/queries/responses/list-cart-items.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/list-payment-methods.js → esm2020/driver/magento/queries/responses/list-payment-methods.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/list-shipping-methods.js → esm2020/driver/magento/queries/responses/list-shipping-methods.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/place-order.js → esm2020/driver/magento/queries/responses/place-order.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/public_api.js → esm2020/driver/magento/queries/responses/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/remove-all-coupons.js → esm2020/driver/magento/queries/responses/remove-all-coupons.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/remove-cart-item.js → esm2020/driver/magento/queries/responses/remove-cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/set-guest-email.js → esm2020/driver/magento/queries/responses/set-guest-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing-and-email.js → esm2020/driver/magento/queries/responses/set-selected-payment-method-with-billing-and-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing.js → esm2020/driver/magento/queries/responses/set-selected-payment-method-with-billing.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/set-selected-payment-method.js → esm2020/driver/magento/queries/responses/set-selected-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/set-selected-shipping-method.js → esm2020/driver/magento/queries/responses/set-selected-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-address-with-email.js → esm2020/driver/magento/queries/responses/update-address-with-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-address.js → esm2020/driver/magento/queries/responses/update-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-billing-address-with-email.js → esm2020/driver/magento/queries/responses/update-billing-address-with-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-billing-address.js → esm2020/driver/magento/queries/responses/update-billing-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-cart-item.js → esm2020/driver/magento/queries/responses/update-cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-shipping-address-with-email.js → esm2020/driver/magento/queries/responses/update-shipping-address-with-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/update-shipping-address.js → esm2020/driver/magento/queries/responses/update-shipping-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/set-selected-payment-method-with-billing-and-email.js → esm2020/driver/magento/queries/set-selected-payment-method-with-billing-and-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/set-selected-payment-method-with-billing.js → esm2020/driver/magento/queries/set-selected-payment-method-with-billing.mjs} +0 -0
- package/{esm2015/driver/magento/queries/set-selected-payment-method.js → esm2020/driver/magento/queries/set-selected-payment-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/set-selected-shipping-method.js → esm2020/driver/magento/queries/set-selected-shipping-method.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-address-with-email.js → esm2020/driver/magento/queries/update-address-with-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-address.js → esm2020/driver/magento/queries/update-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-billing-address-with-email.js → esm2020/driver/magento/queries/update-billing-address-with-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-billing-address.js → esm2020/driver/magento/queries/update-billing-address.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-cart-item.js → esm2020/driver/magento/queries/update-cart-item.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-shipping-address-with-email.js → esm2020/driver/magento/queries/update-shipping-address-with-email.mjs} +0 -0
- package/{esm2015/driver/magento/queries/update-shipping-address.js → esm2020/driver/magento/queries/update-shipping-address.mjs} +0 -0
- package/{esm2015/driver/magento/testing/daffodil-cart-driver-magento-testing.js → esm2020/driver/magento/testing/daffodil-cart-driver-magento-testing.mjs} +0 -0
- package/{esm2015/driver/magento/testing/factories/cart-address-input.factory.js → esm2020/driver/magento/testing/factories/cart-address-input.factory.mjs} +9 -9
- package/{esm2015/driver/magento/testing/factories/cart-address.factory.js → esm2020/driver/magento/testing/factories/cart-address.factory.mjs} +9 -9
- package/esm2020/driver/magento/testing/factories/cart-coupon.factory.mjs +24 -0
- package/{esm2015/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.js → esm2020/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.mjs} +9 -9
- package/{esm2015/driver/magento/testing/factories/cart-item/cart-item.factory.js → esm2020/driver/magento/testing/factories/cart-item/cart-item.factory.mjs} +9 -9
- package/esm2020/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.mjs +35 -0
- package/esm2020/driver/magento/testing/factories/cart-payment-method.factory.mjs +25 -0
- package/esm2020/driver/magento/testing/factories/cart-shipping-method.factory.mjs +31 -0
- package/{esm2015/driver/magento/testing/factories/cart.factory.js → esm2020/driver/magento/testing/factories/cart.factory.mjs} +9 -9
- package/{esm2015/driver/magento/testing/factories/public_api.js → esm2020/driver/magento/testing/factories/public_api.mjs} +0 -0
- package/esm2020/driver/magento/testing/factories/shipping-address.factory.mjs +26 -0
- package/{esm2015/driver/magento/testing/index.js → esm2020/driver/magento/testing/index.mjs} +0 -0
- package/{esm2015/driver/magento/testing/public_api.js → esm2020/driver/magento/testing/public_api.mjs} +0 -0
- package/esm2020/driver/magento/transforms/inputs/billing-address.service.mjs +29 -0
- package/esm2020/driver/magento/transforms/inputs/cart-address.service.mjs +26 -0
- package/esm2020/driver/magento/transforms/inputs/cart-item-input-transformers.mjs +20 -0
- package/esm2020/driver/magento/transforms/inputs/cart-item-update.service.mjs +19 -0
- package/esm2020/driver/magento/transforms/inputs/payment-method.service.mjs +18 -0
- package/esm2020/driver/magento/transforms/inputs/shipping-address.service.mjs +29 -0
- package/esm2020/driver/magento/transforms/inputs/shipping-method.service.mjs +19 -0
- package/esm2020/driver/magento/transforms/outputs/billing-address.service.mjs +32 -0
- package/esm2020/driver/magento/transforms/outputs/cart-address.service.mjs +43 -0
- package/esm2020/driver/magento/transforms/outputs/cart-coupon-response.service.mjs +59 -0
- package/{esm2015/driver/magento/transforms/outputs/cart-coupon.js → esm2020/driver/magento/transforms/outputs/cart-coupon.mjs} +0 -0
- package/esm2020/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.mjs +23 -0
- package/{esm2015/driver/magento/transforms/outputs/cart-item/cart-item-transformer.js → esm2020/driver/magento/transforms/outputs/cart-item/cart-item-transformer.mjs} +0 -0
- package/esm2020/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.mjs +21 -0
- package/esm2020/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.mjs +35 -0
- package/esm2020/driver/magento/transforms/outputs/cart-payment.service.mjs +26 -0
- package/esm2020/driver/magento/transforms/outputs/cart-shipping-information.service.mjs +33 -0
- package/esm2020/driver/magento/transforms/outputs/cart-shipping-rate.service.mjs +33 -0
- package/{esm2015/driver/magento/transforms/outputs/cart-totals-transformer.js → esm2020/driver/magento/transforms/outputs/cart-totals-transformer.mjs} +2 -3
- package/esm2020/driver/magento/transforms/outputs/cart.service.mjs +125 -0
- package/esm2020/driver/magento/transforms/outputs/shipping-address.service.mjs +32 -0
- package/{esm2015/driver/magento/transforms/public_api.js → esm2020/driver/magento/transforms/public_api.mjs} +0 -0
- package/{esm2015/driver/public_api.js → esm2020/driver/public_api.mjs} +0 -0
- package/{esm2015/driver/testing/daffodil-cart-driver-testing.js → esm2020/driver/testing/daffodil-cart-driver-testing.mjs} +0 -0
- package/esm2020/driver/testing/drivers/cart/cart.service.mjs +39 -0
- package/esm2020/driver/testing/drivers/cart-address/cart-address.service.mjs +26 -0
- package/esm2020/driver/testing/drivers/cart-billing-address/cart-billing-address.service.mjs +29 -0
- package/esm2020/driver/testing/drivers/cart-coupon/cart-coupon.service.mjs +35 -0
- package/esm2020/driver/testing/drivers/cart-driver.module.mjs +82 -0
- package/esm2020/driver/testing/drivers/cart-item/cart-item.service.mjs +38 -0
- package/esm2020/driver/testing/drivers/cart-order/cart-order.service.mjs +25 -0
- package/esm2020/driver/testing/drivers/cart-payment/cart-payment.service.mjs +35 -0
- package/esm2020/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.mjs +25 -0
- package/esm2020/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.mjs +29 -0
- package/esm2020/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.mjs +32 -0
- package/esm2020/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +25 -0
- package/{esm2015/driver/testing/drivers/public_api.js → esm2020/driver/testing/drivers/public_api.mjs} +0 -0
- package/{esm2015/driver/testing/index.js → esm2020/driver/testing/index.mjs} +0 -0
- package/{esm2015/driver/testing/public_api.js → esm2020/driver/testing/public_api.mjs} +0 -0
- package/{esm2015/errors/codes.enum.js → esm2020/errors/codes.enum.mjs} +0 -0
- package/{esm2015/errors/map.js → esm2020/errors/map.mjs} +0 -0
- package/{esm2015/errors/public_api.js → esm2020/errors/public_api.mjs} +0 -0
- package/{esm2015/errors/resolution/cart-not-found-or-created-resolution.js → esm2020/errors/resolution/cart-not-found-or-created-resolution.mjs} +0 -0
- package/{esm2015/errors/resolution/cart-resolution.js → esm2020/errors/resolution/cart-resolution.mjs} +0 -0
- package/{esm2015/errors/resolution/cart-server-side-resolution.js → esm2020/errors/resolution/cart-server-side-resolution.mjs} +0 -0
- package/{esm2015/errors/resolution/cart-storage-resolution.js → esm2020/errors/resolution/cart-storage-resolution.mjs} +0 -0
- package/{esm2015/errors/resolution/public_api.js → esm2020/errors/resolution/public_api.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/injection-tokens/error-matcher.token.js → esm2020/injection-tokens/error-matcher.token.mjs} +0 -0
- package/{esm2015/injection-tokens/payment-method-map.js → esm2020/injection-tokens/payment-method-map.mjs} +0 -0
- package/{esm2015/injection-tokens/public_api.js → esm2020/injection-tokens/public_api.mjs} +0 -0
- package/{esm2015/models/cart-address.js → esm2020/models/cart-address.mjs} +0 -0
- package/{esm2015/models/cart-coupon.js → esm2020/models/cart-coupon.mjs} +0 -0
- package/{esm2015/models/cart-item-input.js → esm2020/models/cart-item-input.mjs} +0 -0
- package/{esm2015/models/cart-item.js → esm2020/models/cart-item.mjs} +0 -0
- package/{esm2015/models/cart-order-result.js → esm2020/models/cart-order-result.mjs} +0 -0
- package/{esm2015/models/cart-payment.js → esm2020/models/cart-payment.mjs} +0 -0
- package/{esm2015/models/cart-shipping-info.js → esm2020/models/cart-shipping-info.mjs} +0 -0
- package/{esm2015/models/cart-shipping-rate.js → esm2020/models/cart-shipping-rate.mjs} +0 -0
- package/{esm2015/models/cart-total.js → esm2020/models/cart-total.mjs} +0 -0
- package/{esm2015/models/cart.js → esm2020/models/cart.mjs} +0 -0
- package/{esm2015/models/composite-cart-item.js → esm2020/models/composite-cart-item.mjs} +0 -0
- package/{esm2015/models/configurable-cart-item.js → esm2020/models/configurable-cart-item.mjs} +0 -0
- package/{esm2015/models/public_api.js → esm2020/models/public_api.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/routing/cart-routing.module.mjs +49 -0
- package/esm2020/routing/config/config.mjs +19 -0
- package/{esm2015/routing/config/resolution/config.js → esm2020/routing/config/resolution/config.mjs} +0 -0
- package/{esm2015/routing/daffodil-cart-routing.js → esm2020/routing/daffodil-cart-routing.mjs} +0 -0
- package/{esm2015/routing/guards/billing-address/billing-address-guard-redirect.token.js → esm2020/routing/guards/billing-address/billing-address-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/billing-address/billing-address.guard.mjs +40 -0
- package/{esm2015/routing/guards/cart-items/cart-items-guard-redirect.token.js → esm2020/routing/guards/cart-items/cart-items-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/cart-items/cart-items.guard.mjs +41 -0
- package/{esm2015/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.js → esm2020/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/in-stock-items/in-stock-items.guard.mjs +41 -0
- package/{esm2015/routing/guards/order-result/order-result-guard-redirect.token.js → esm2020/routing/guards/order-result/order-result-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/order-result/order-result.guard.mjs +38 -0
- package/{esm2015/routing/guards/payment-method/payment-method-guard-redirect.token.js → esm2020/routing/guards/payment-method/payment-method-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/payment-method/payment-method.guard.mjs +40 -0
- package/{esm2015/routing/guards/public_api.js → esm2020/routing/guards/public_api.mjs} +0 -0
- package/esm2020/routing/guards/resolved-cart/resolved-cart.guard.mjs +42 -0
- package/{esm2015/routing/guards/shipping-address/shipping-address-guard-redirect.token.js → esm2020/routing/guards/shipping-address/shipping-address-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/shipping-address/shipping-address.guard.mjs +40 -0
- package/{esm2015/routing/guards/shipping-method/shipping-method-guard-redirect.token.js → esm2020/routing/guards/shipping-method/shipping-method-guard-redirect.token.mjs} +0 -0
- package/esm2020/routing/guards/shipping-method/shipping-method.guard.mjs +40 -0
- package/{esm2015/routing/index.js → esm2020/routing/index.mjs} +0 -0
- package/{esm2015/routing/public_api.js → esm2020/routing/public_api.mjs} +0 -0
- package/esm2020/routing/resolvers/cart-resolver.service.mjs +45 -0
- package/esm2020/routing/resolvers/empty-cart-resolver.service.mjs +42 -0
- package/{esm2015/routing/resolvers/public_api.js → esm2020/routing/resolvers/public_api.mjs} +0 -0
- package/{esm2015/routing/resolvers/tokens/cart-resolver-redirect.token.js → esm2020/routing/resolvers/tokens/cart-resolver-redirect.token.mjs} +0 -0
- package/{esm2015/routing/resolvers/tokens/empty-cart-resolver-redirect.token.js → esm2020/routing/resolvers/tokens/empty-cart-resolver-redirect.token.mjs} +0 -0
- package/{esm2015/state/actions/cart-address.actions.js → esm2020/state/actions/cart-address.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-billing-address.actions.js → esm2020/state/actions/cart-billing-address.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-coupon.actions.js → esm2020/state/actions/cart-coupon.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-item.actions.js → esm2020/state/actions/cart-item.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-order.actions.js → esm2020/state/actions/cart-order.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-payment-methods.actions.js → esm2020/state/actions/cart-payment-methods.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-payment.actions.js → esm2020/state/actions/cart-payment.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-shipping-address.actions.js → esm2020/state/actions/cart-shipping-address.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-shipping-information.actions.js → esm2020/state/actions/cart-shipping-information.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart-shipping-methods.actions.js → esm2020/state/actions/cart-shipping-methods.actions.mjs} +0 -0
- package/{esm2015/state/actions/cart.actions.js → esm2020/state/actions/cart.actions.mjs} +0 -0
- package/{esm2015/state/actions/public_api.js → esm2020/state/actions/public_api.mjs} +0 -0
- package/esm2020/state/cart-state.module.mjs +70 -0
- package/esm2020/state/daffodil-cart-state.mjs +5 -0
- package/esm2020/state/effects/cart-address.effects.mjs +34 -0
- package/esm2020/state/effects/cart-billing-address.effects.mjs +32 -0
- package/esm2020/state/effects/cart-coupon.effects.mjs +43 -0
- package/esm2020/state/effects/cart-item.effects.mjs +52 -0
- package/esm2020/state/effects/cart-order.effects.mjs +35 -0
- package/esm2020/state/effects/cart-payment-methods.effects.mjs +31 -0
- package/esm2020/state/effects/cart-payment.effects.mjs +34 -0
- package/esm2020/state/effects/cart-resolver.effects.mjs +69 -0
- package/esm2020/state/effects/cart-shipping-address.effects.mjs +32 -0
- package/esm2020/state/effects/cart-shipping-information.effects.mjs +33 -0
- package/esm2020/state/effects/cart-shipping-methods.effects.mjs +31 -0
- package/esm2020/state/effects/cart.effects.mjs +51 -0
- package/{esm2015/state/facades/cart/cart-facade.interface.js → esm2020/state/facades/cart/cart-facade.interface.mjs} +0 -0
- package/{esm2015/state/facades/cart/cart.facade.js → esm2020/state/facades/cart/cart.facade.mjs} +12 -13
- package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
- package/{esm2015/state/injection-tokens/cart-item-state-debounce-time.js → esm2020/state/injection-tokens/cart-item-state-debounce-time.mjs} +0 -0
- package/{esm2015/state/injection-tokens/public_api.js → esm2020/state/injection-tokens/public_api.mjs} +0 -0
- package/{esm2015/state/models/public_api.js → esm2020/state/models/public_api.mjs} +0 -0
- package/{esm2015/state/models/stateful-cart-item.js → esm2020/state/models/stateful-cart-item.mjs} +0 -0
- package/{esm2015/state/models/stateful-composite-cart-item.js → esm2020/state/models/stateful-composite-cart-item.mjs} +0 -0
- package/{esm2015/state/models/stateful-configurable-cart-item.js → esm2020/state/models/stateful-configurable-cart-item.mjs} +0 -0
- package/{esm2015/state/public_api.js → esm2020/state/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/action-types.type.js → esm2020/state/reducers/action-types.type.mjs} +0 -0
- package/esm2020/state/reducers/cart/cart.reducer.mjs +78 -0
- package/esm2020/state/reducers/cart-billing-address/cart-billing-address.reducer.mjs +55 -0
- package/esm2020/state/reducers/cart-coupon/cart-coupon.reducer.mjs +63 -0
- package/{esm2015/state/reducers/cart-initial-state.js → esm2020/state/reducers/cart-initial-state.mjs} +0 -0
- package/esm2020/state/reducers/cart-item/cart-item.reducer.mjs +94 -0
- package/esm2020/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.mjs +9 -0
- package/esm2020/state/reducers/cart-item-entities/cart-item-entities.reducer.mjs +87 -0
- package/{esm2015/state/reducers/cart-operation-type.enum.js → esm2020/state/reducers/cart-operation-type.enum.mjs} +0 -0
- package/{esm2015/state/reducers/cart-order/cart-order-initial-state.js → esm2020/state/reducers/cart-order/cart-order-initial-state.mjs} +0 -0
- package/{esm2015/state/reducers/cart-order/cart-order-state.interface.js → esm2020/state/reducers/cart-order/cart-order-state.interface.mjs} +0 -0
- package/esm2020/state/reducers/cart-order/cart-order.reducer.mjs +30 -0
- package/esm2020/state/reducers/cart-payment/cart-payment.reducer.mjs +83 -0
- package/esm2020/state/reducers/cart-payment-methods/cart-payment-methods.reducer.mjs +36 -0
- package/{esm2015/state/reducers/cart-reducers-state.interface.js → esm2020/state/reducers/cart-reducers-state.interface.mjs} +0 -0
- package/{esm2015/state/reducers/cart-reducers.js → esm2020/state/reducers/cart-reducers.mjs} +0 -0
- package/{esm2015/state/reducers/cart-resolve/cart-resolve-state.enum.js → esm2020/state/reducers/cart-resolve/cart-resolve-state.enum.mjs} +0 -0
- package/esm2020/state/reducers/cart-resolve/cart-resolve.reducer.mjs +30 -0
- package/esm2020/state/reducers/cart-shipping-address/cart-shipping-address.reducer.mjs +55 -0
- package/esm2020/state/reducers/cart-shipping-information/cart-shipping-information.reducer.mjs +58 -0
- package/esm2020/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.mjs +36 -0
- package/{esm2015/state/reducers/cart-state.interface.js → esm2020/state/reducers/cart-state.interface.mjs} +0 -0
- package/{esm2015/state/reducers/cart-store-feature-key.js → esm2020/state/reducers/cart-store-feature-key.mjs} +0 -0
- package/{esm2015/state/reducers/cart.reducer.js → esm2020/state/reducers/cart.reducer.mjs} +0 -0
- package/{esm2015/state/reducers/errors/cart-errors.type.js → esm2020/state/reducers/errors/cart-errors.type.mjs} +0 -0
- package/esm2020/state/reducers/errors/error-state-helpers.mjs +13 -0
- package/esm2020/state/reducers/loading/cart-loading.type.mjs +8 -0
- package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/token/extra.token.js → esm2020/state/reducers/token/extra.token.mjs} +0 -0
- package/{esm2015/state/reducers/token/public_api.js → esm2020/state/reducers/token/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/token/reducers.token.js → esm2020/state/reducers/token/reducers.token.mjs} +0 -0
- package/esm2020/state/selectors/cart/cart.selector.mjs +219 -0
- package/{esm2015/state/selectors/cart-feature.selector.js → esm2020/state/selectors/cart-feature.selector.mjs} +3 -5
- package/esm2020/state/selectors/cart-item-entities/cart-item-entities.selectors.mjs +95 -0
- package/esm2020/state/selectors/cart-order/cart-order.selector.mjs +30 -0
- package/esm2020/state/selectors/cart.selector.mjs +17 -0
- package/{esm2015/state/selectors/public_api.js → esm2020/state/selectors/public_api.mjs} +0 -0
- package/esm2020/state/testing/cart-testing.module.mjs +20 -0
- package/{esm2015/state/testing/daffodil-cart-state-testing.js → esm2020/state/testing/daffodil-cart-state-testing.mjs} +0 -0
- package/esm2020/state/testing/factories/stateful-cart-item.factory.mjs +26 -0
- package/esm2020/state/testing/factories/stateful-composite-cart-item.factory.mjs +24 -0
- package/esm2020/state/testing/factories/stateful-configurable-cart-item.factory.mjs +24 -0
- package/{esm2015/state/testing/index.js → esm2020/state/testing/index.mjs} +0 -0
- package/{esm2015/state/testing/mock-cart-facade.js → esm2020/state/testing/mock-cart-facade.mjs} +7 -5
- package/{esm2015/state/testing/public_api.js → esm2020/state/testing/public_api.mjs} +0 -0
- package/esm2020/storage/cart-storage.service.mjs +49 -0
- package/{esm2015/testing/daffodil-cart-testing.js → esm2020/testing/daffodil-cart-testing.mjs} +0 -0
- package/{esm2015/testing/factories/cart-address.factory.js → esm2020/testing/factories/cart-address.factory.mjs} +9 -9
- package/esm2020/testing/factories/cart-coupon.factory.mjs +27 -0
- package/{esm2015/testing/factories/cart-item/cart-item.factory.js → esm2020/testing/factories/cart-item/cart-item.factory.mjs} +9 -9
- package/{esm2015/testing/factories/cart-item/composite-cart-item.factory.js → esm2020/testing/factories/cart-item/composite-cart-item.factory.mjs} +9 -9
- package/esm2020/testing/factories/cart-item/configurable-cart-item.factory.mjs +35 -0
- package/esm2020/testing/factories/cart-payment.factory.mjs +22 -0
- package/esm2020/testing/factories/cart-shipping-rate.factory.mjs +29 -0
- package/{esm2015/testing/factories/cart.factory.js → esm2020/testing/factories/cart.factory.mjs} +9 -9
- package/{esm2015/testing/factories/public_api.js → esm2020/testing/factories/public_api.mjs} +0 -0
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
- package/fesm2015/{daffodil-cart-driver-in-memory.js → daffodil-cart-driver-in-memory.mjs} +419 -422
- package/fesm2015/daffodil-cart-driver-in-memory.mjs.map +1 -0
- package/fesm2015/daffodil-cart-driver-magento-testing.mjs +331 -0
- package/fesm2015/daffodil-cart-driver-magento-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-cart-driver-magento.js → daffodil-cart-driver-magento.mjs} +436 -399
- package/fesm2015/daffodil-cart-driver-magento.mjs.map +1 -0
- package/fesm2015/daffodil-cart-driver-testing.mjs +365 -0
- package/fesm2015/daffodil-cart-driver-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-cart-driver.js → daffodil-cart-driver.mjs} +1 -1
- package/fesm2015/daffodil-cart-driver.mjs.map +1 -0
- package/fesm2015/daffodil-cart-routing.mjs +449 -0
- package/fesm2015/daffodil-cart-routing.mjs.map +1 -0
- package/fesm2015/{daffodil-cart-state-testing.js → daffodil-cart-state-testing.mjs} +46 -37
- package/fesm2015/daffodil-cart-state-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-cart-state.js → daffodil-cart-state.mjs} +382 -461
- package/fesm2015/daffodil-cart-state.mjs.map +1 -0
- package/fesm2015/daffodil-cart-testing.mjs +292 -0
- package/fesm2015/daffodil-cart-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-cart.js → daffodil-cart.mjs} +18 -19
- package/fesm2015/daffodil-cart.mjs.map +1 -0
- package/fesm2020/daffodil-cart-driver-in-memory.mjs +1168 -0
- package/fesm2020/daffodil-cart-driver-in-memory.mjs.map +1 -0
- package/fesm2020/daffodil-cart-driver-magento-testing.mjs +331 -0
- package/fesm2020/daffodil-cart-driver-magento-testing.mjs.map +1 -0
- package/fesm2020/daffodil-cart-driver-magento.mjs +2219 -0
- package/fesm2020/daffodil-cart-driver-magento.mjs.map +1 -0
- package/fesm2020/daffodil-cart-driver-testing.mjs +365 -0
- package/fesm2020/daffodil-cart-driver-testing.mjs.map +1 -0
- package/fesm2020/daffodil-cart-driver.mjs +176 -0
- package/fesm2020/daffodil-cart-driver.mjs.map +1 -0
- package/fesm2020/daffodil-cart-routing.mjs +434 -0
- package/fesm2020/daffodil-cart-routing.mjs.map +1 -0
- package/fesm2020/daffodil-cart-state-testing.mjs +218 -0
- package/fesm2020/daffodil-cart-state-testing.mjs.map +1 -0
- package/fesm2020/daffodil-cart-state.mjs +2803 -0
- package/fesm2020/daffodil-cart-state.mjs.map +1 -0
- package/fesm2020/daffodil-cart-testing.mjs +292 -0
- package/fesm2020/daffodil-cart-testing.mjs.map +1 -0
- package/fesm2020/daffodil-cart.mjs +174 -0
- package/fesm2020/daffodil-cart.mjs.map +1 -0
- package/package.json +104 -20
- package/routing/cart-routing.module.d.ts +4 -0
- package/routing/daffodil-cart-routing.d.ts +1 -0
- package/routing/guards/billing-address/billing-address.guard.d.ts +3 -0
- package/routing/guards/cart-items/cart-items.guard.d.ts +3 -0
- package/routing/guards/in-stock-items/in-stock-items.guard.d.ts +3 -0
- package/routing/guards/order-result/order-result.guard.d.ts +3 -0
- package/routing/guards/payment-method/payment-method.guard.d.ts +3 -0
- package/routing/guards/resolved-cart/resolved-cart.guard.d.ts +3 -0
- package/routing/guards/shipping-address/shipping-address.guard.d.ts +3 -0
- package/routing/guards/shipping-method/shipping-method.guard.d.ts +3 -0
- package/routing/package.json +5 -6
- package/routing/resolvers/cart-resolver.service.d.ts +3 -0
- package/routing/resolvers/empty-cart-resolver.service.d.ts +3 -0
- package/state/cart-state.module.d.ts +6 -0
- package/state/daffodil-cart-state.d.ts +1 -24
- package/state/effects/cart-address.effects.d.ts +11 -8
- package/state/effects/cart-billing-address.effects.d.ts +12 -9
- package/state/effects/cart-coupon.effects.d.ts +7 -4
- package/state/effects/cart-item.effects.d.ts +37 -34
- package/state/effects/cart-order.effects.d.ts +5 -2
- package/state/effects/cart-payment-methods.effects.d.ts +4 -1
- package/state/effects/cart-payment.effects.d.ts +12 -9
- package/state/effects/cart-resolver.effects.d.ts +4 -1
- package/state/effects/cart-shipping-address.effects.d.ts +12 -9
- package/state/effects/cart-shipping-information.effects.d.ts +22 -19
- package/state/effects/cart-shipping-methods.effects.d.ts +4 -1
- package/state/effects/cart.effects.d.ts +17 -14
- package/state/facades/cart/cart.facade.d.ts +3 -0
- package/state/package.json +5 -6
- package/state/reducers/token/reducers.token.d.ts +1 -1
- package/state/testing/cart-testing.module.d.ts +4 -0
- package/state/testing/daffodil-cart-state-testing.d.ts +1 -0
- package/state/testing/factories/stateful-cart-item.factory.d.ts +3 -0
- package/state/testing/factories/stateful-composite-cart-item.factory.d.ts +3 -0
- package/state/testing/factories/stateful-configurable-cart-item.factory.d.ts +3 -0
- package/state/testing/mock-cart-facade.d.ts +3 -0
- package/state/testing/package.json +5 -6
- package/storage/cart-storage.service.d.ts +3 -0
- package/testing/daffodil-cart-testing.d.ts +1 -0
- package/testing/factories/cart-address.factory.d.ts +3 -0
- package/testing/factories/cart-coupon.factory.d.ts +3 -0
- package/testing/factories/cart-item/cart-item.factory.d.ts +3 -0
- package/testing/factories/cart-item/composite-cart-item.factory.d.ts +3 -0
- package/testing/factories/cart-item/configurable-cart-item.factory.d.ts +3 -0
- package/testing/factories/cart-payment.factory.d.ts +3 -0
- package/testing/factories/cart-shipping-rate.factory.d.ts +3 -0
- package/testing/factories/cart.factory.d.ts +3 -0
- package/testing/package.json +5 -6
- package/bundles/daffodil-cart-driver-in-memory.umd.js +0 -1530
- package/bundles/daffodil-cart-driver-in-memory.umd.js.map +0 -1
- package/bundles/daffodil-cart-driver-in-memory.umd.min.js +0 -2
- package/bundles/daffodil-cart-driver-in-memory.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-driver-magento-testing.umd.js +0 -707
- package/bundles/daffodil-cart-driver-magento-testing.umd.js.map +0 -1
- package/bundles/daffodil-cart-driver-magento-testing.umd.min.js +0 -16
- package/bundles/daffodil-cart-driver-magento-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-driver-magento.umd.js +0 -2079
- package/bundles/daffodil-cart-driver-magento.umd.js.map +0 -1
- package/bundles/daffodil-cart-driver-magento.umd.min.js +0 -2
- package/bundles/daffodil-cart-driver-magento.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-driver-testing.umd.js +0 -413
- package/bundles/daffodil-cart-driver-testing.umd.js.map +0 -1
- package/bundles/daffodil-cart-driver-testing.umd.min.js +0 -2
- package/bundles/daffodil-cart-driver-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-driver.umd.js +0 -552
- package/bundles/daffodil-cart-driver.umd.js.map +0 -1
- package/bundles/daffodil-cart-driver.umd.min.js +0 -17
- package/bundles/daffodil-cart-driver.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-routing.umd.js +0 -473
- package/bundles/daffodil-cart-routing.umd.js.map +0 -1
- package/bundles/daffodil-cart-routing.umd.min.js +0 -2
- package/bundles/daffodil-cart-routing.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-state-testing.umd.js +0 -557
- package/bundles/daffodil-cart-state-testing.umd.js.map +0 -1
- package/bundles/daffodil-cart-state-testing.umd.min.js +0 -17
- package/bundles/daffodil-cart-state-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-state.umd.js +0 -3191
- package/bundles/daffodil-cart-state.umd.js.map +0 -1
- package/bundles/daffodil-cart-state.umd.min.js +0 -2
- package/bundles/daffodil-cart-state.umd.min.js.map +0 -1
- package/bundles/daffodil-cart-testing.umd.js +0 -653
- package/bundles/daffodil-cart-testing.umd.js.map +0 -1
- package/bundles/daffodil-cart-testing.umd.min.js +0 -16
- package/bundles/daffodil-cart-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-cart.umd.js +0 -516
- package/bundles/daffodil-cart.umd.js.map +0 -1
- package/bundles/daffodil-cart.umd.min.js +0 -17
- package/bundles/daffodil-cart.umd.min.js.map +0 -1
- package/daffodil-cart.metadata.json +0 -1
- package/driver/daffodil-cart-driver.metadata.json +0 -1
- package/driver/in-memory/daffodil-cart-driver-in-memory.metadata.json +0 -1
- package/driver/magento/daffodil-cart-driver-magento.metadata.json +0 -1
- package/driver/magento/testing/daffodil-cart-driver-magento-testing.metadata.json +0 -1
- package/driver/testing/daffodil-cart-driver-testing.metadata.json +0 -1
- package/esm2015/daffodil-cart.js +0 -6
- package/esm2015/driver/in-memory/backend/cart/cart.service.js +0 -76
- package/esm2015/driver/in-memory/backend/cart-address/cart-address.service.js +0 -40
- package/esm2015/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.js +0 -48
- package/esm2015/driver/in-memory/backend/cart-coupon/cart-coupon.service.js +0 -80
- package/esm2015/driver/in-memory/backend/cart-order/cart-order.service.js +0 -28
- package/esm2015/driver/in-memory/backend/cart-payment/cart-payment.service.js +0 -62
- package/esm2015/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.js +0 -27
- package/esm2015/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.js +0 -48
- package/esm2015/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.js +0 -59
- package/esm2015/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.js +0 -46
- package/esm2015/driver/in-memory/daffodil-cart-driver-in-memory.js +0 -6
- package/esm2015/driver/in-memory/drivers/cart/cart.service.js +0 -45
- package/esm2015/driver/in-memory/drivers/cart-address/cart-address.service.js +0 -30
- package/esm2015/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.js +0 -33
- package/esm2015/driver/in-memory/drivers/cart-coupon/cart-coupon.service.js +0 -39
- package/esm2015/driver/in-memory/drivers/cart-driver.module.js +0 -75
- package/esm2015/driver/in-memory/drivers/cart-item/cart-item.service.js +0 -42
- package/esm2015/driver/in-memory/drivers/cart-order/cart-order.service.js +0 -30
- package/esm2015/driver/in-memory/drivers/cart-payment/cart-payment.service.js +0 -39
- package/esm2015/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.js +0 -30
- package/esm2015/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.js +0 -33
- package/esm2015/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.js +0 -36
- package/esm2015/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.js +0 -30
- package/esm2015/driver/magento/cart-address.service.js +0 -64
- package/esm2015/driver/magento/cart-billing-address.service.js +0 -80
- package/esm2015/driver/magento/cart-coupon.service.js +0 -67
- package/esm2015/driver/magento/cart-driver.module.js +0 -105
- package/esm2015/driver/magento/cart-item.service.js +0 -108
- package/esm2015/driver/magento/cart-order.service.js +0 -42
- package/esm2015/driver/magento/cart-payment-methods.service.js +0 -41
- package/esm2015/driver/magento/cart-payment.service.js +0 -104
- package/esm2015/driver/magento/cart-shipping-address.service.js +0 -80
- package/esm2015/driver/magento/cart-shipping-information.service.js +0 -85
- package/esm2015/driver/magento/cart-shipping-methods.service.js +0 -41
- package/esm2015/driver/magento/cart.service.js +0 -74
- package/esm2015/driver/magento/daffodil-cart-driver-magento.js +0 -10
- package/esm2015/driver/magento/errors/transform.js +0 -39
- package/esm2015/driver/magento/testing/factories/cart-coupon.factory.js +0 -24
- package/esm2015/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.js +0 -35
- package/esm2015/driver/magento/testing/factories/cart-payment-method.factory.js +0 -25
- package/esm2015/driver/magento/testing/factories/cart-shipping-method.factory.js +0 -31
- package/esm2015/driver/magento/testing/factories/shipping-address.factory.js +0 -26
- package/esm2015/driver/magento/transforms/inputs/billing-address.service.js +0 -31
- package/esm2015/driver/magento/transforms/inputs/cart-address.service.js +0 -24
- package/esm2015/driver/magento/transforms/inputs/cart-item-input-transformers.js +0 -18
- package/esm2015/driver/magento/transforms/inputs/cart-item-update.service.js +0 -17
- package/esm2015/driver/magento/transforms/inputs/payment-method.service.js +0 -14
- package/esm2015/driver/magento/transforms/inputs/shipping-address.service.js +0 -31
- package/esm2015/driver/magento/transforms/inputs/shipping-method.service.js +0 -17
- package/esm2015/driver/magento/transforms/outputs/billing-address.service.js +0 -31
- package/esm2015/driver/magento/transforms/outputs/cart-address.service.js +0 -41
- package/esm2015/driver/magento/transforms/outputs/cart-coupon-response.service.js +0 -53
- package/esm2015/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.js +0 -19
- package/esm2015/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.js +0 -17
- package/esm2015/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.js +0 -39
- package/esm2015/driver/magento/transforms/outputs/cart-payment.service.js +0 -24
- package/esm2015/driver/magento/transforms/outputs/cart-shipping-information.service.js +0 -33
- package/esm2015/driver/magento/transforms/outputs/cart-shipping-rate.service.js +0 -31
- package/esm2015/driver/magento/transforms/outputs/cart.service.js +0 -111
- package/esm2015/driver/magento/transforms/outputs/shipping-address.service.js +0 -31
- package/esm2015/driver/testing/drivers/cart/cart.service.js +0 -41
- package/esm2015/driver/testing/drivers/cart-address/cart-address.service.js +0 -29
- package/esm2015/driver/testing/drivers/cart-billing-address/cart-billing-address.service.js +0 -32
- package/esm2015/driver/testing/drivers/cart-coupon/cart-coupon.service.js +0 -38
- package/esm2015/driver/testing/drivers/cart-driver.module.js +0 -75
- package/esm2015/driver/testing/drivers/cart-item/cart-item.service.js +0 -41
- package/esm2015/driver/testing/drivers/cart-order/cart-order.service.js +0 -23
- package/esm2015/driver/testing/drivers/cart-payment/cart-payment.service.js +0 -38
- package/esm2015/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.js +0 -27
- package/esm2015/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.js +0 -32
- package/esm2015/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.js +0 -35
- package/esm2015/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.js +0 -27
- package/esm2015/routing/cart-routing.module.js +0 -32
- package/esm2015/routing/config/config.js +0 -17
- package/esm2015/routing/guards/billing-address/billing-address.guard.js +0 -42
- package/esm2015/routing/guards/cart-items/cart-items.guard.js +0 -43
- package/esm2015/routing/guards/in-stock-items/in-stock-items.guard.js +0 -43
- package/esm2015/routing/guards/order-result/order-result.guard.js +0 -40
- package/esm2015/routing/guards/payment-method/payment-method.guard.js +0 -42
- package/esm2015/routing/guards/resolved-cart/resolved-cart.guard.js +0 -44
- package/esm2015/routing/guards/shipping-address/shipping-address.guard.js +0 -42
- package/esm2015/routing/guards/shipping-method/shipping-method.guard.js +0 -42
- package/esm2015/routing/resolvers/cart-resolver.service.js +0 -48
- package/esm2015/routing/resolvers/empty-cart-resolver.service.js +0 -44
- package/esm2015/state/cart-state.module.js +0 -45
- package/esm2015/state/daffodil-cart-state.js +0 -29
- package/esm2015/state/effects/cart-address.effects.js +0 -35
- package/esm2015/state/effects/cart-billing-address.effects.js +0 -37
- package/esm2015/state/effects/cart-coupon.effects.js +0 -56
- package/esm2015/state/effects/cart-item.effects.js +0 -75
- package/esm2015/state/effects/cart-order.effects.js +0 -40
- package/esm2015/state/effects/cart-payment-methods.effects.js +0 -32
- package/esm2015/state/effects/cart-payment.effects.js +0 -47
- package/esm2015/state/effects/cart-resolver.effects.js +0 -70
- package/esm2015/state/effects/cart-shipping-address.effects.js +0 -37
- package/esm2015/state/effects/cart-shipping-information.effects.js +0 -42
- package/esm2015/state/effects/cart-shipping-methods.effects.js +0 -32
- package/esm2015/state/effects/cart.effects.js +0 -68
- package/esm2015/state/reducers/cart/cart.reducer.js +0 -41
- package/esm2015/state/reducers/cart-billing-address/cart-billing-address.reducer.js +0 -29
- package/esm2015/state/reducers/cart-coupon/cart-coupon.reducer.js +0 -34
- package/esm2015/state/reducers/cart-item/cart-item.reducer.js +0 -46
- package/esm2015/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.js +0 -11
- package/esm2015/state/reducers/cart-item-entities/cart-item-entities.reducer.js +0 -65
- package/esm2015/state/reducers/cart-order/cart-order.reducer.js +0 -18
- package/esm2015/state/reducers/cart-payment/cart-payment.reducer.js +0 -41
- package/esm2015/state/reducers/cart-payment-methods/cart-payment-methods.reducer.js +0 -21
- package/esm2015/state/reducers/cart-resolve/cart-resolve.reducer.js +0 -18
- package/esm2015/state/reducers/cart-shipping-address/cart-shipping-address.reducer.js +0 -29
- package/esm2015/state/reducers/cart-shipping-information/cart-shipping-information.reducer.js +0 -33
- package/esm2015/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.js +0 -21
- package/esm2015/state/reducers/errors/error-state-helpers.js +0 -7
- package/esm2015/state/reducers/loading/cart-loading.type.js +0 -5
- package/esm2015/state/selectors/cart/cart.selector.js +0 -222
- package/esm2015/state/selectors/cart-item-entities/cart-item-entities.selectors.js +0 -98
- package/esm2015/state/selectors/cart-order/cart-order.selector.js +0 -33
- package/esm2015/state/selectors/cart.selector.js +0 -15
- package/esm2015/state/testing/cart-testing.module.js +0 -13
- package/esm2015/state/testing/factories/stateful-cart-item.factory.js +0 -26
- package/esm2015/state/testing/factories/stateful-composite-cart-item.factory.js +0 -24
- package/esm2015/state/testing/factories/stateful-configurable-cart-item.factory.js +0 -24
- package/esm2015/storage/cart-storage.service.js +0 -52
- package/esm2015/testing/factories/cart-coupon.factory.js +0 -27
- package/esm2015/testing/factories/cart-item/configurable-cart-item.factory.js +0 -35
- package/esm2015/testing/factories/cart-payment.factory.js +0 -22
- package/esm2015/testing/factories/cart-shipping-rate.factory.js +0 -29
- package/fesm2015/daffodil-cart-driver-in-memory.js.map +0 -1
- package/fesm2015/daffodil-cart-driver-magento-testing.js +0 -330
- package/fesm2015/daffodil-cart-driver-magento-testing.js.map +0 -1
- package/fesm2015/daffodil-cart-driver-magento.js.map +0 -1
- package/fesm2015/daffodil-cart-driver-testing.js +0 -383
- package/fesm2015/daffodil-cart-driver-testing.js.map +0 -1
- package/fesm2015/daffodil-cart-driver.js.map +0 -1
- package/fesm2015/daffodil-cart-routing.js +0 -425
- package/fesm2015/daffodil-cart-routing.js.map +0 -1
- package/fesm2015/daffodil-cart-state-testing.js.map +0 -1
- package/fesm2015/daffodil-cart-state.js.map +0 -1
- package/fesm2015/daffodil-cart-testing.js +0 -291
- package/fesm2015/daffodil-cart-testing.js.map +0 -1
- package/fesm2015/daffodil-cart.js.map +0 -1
- package/routing/daffodil-cart-routing.metadata.json +0 -1
- package/state/daffodil-cart-state.metadata.json +0 -1
- package/state/testing/daffodil-cart-state-testing.metadata.json +0 -1
- package/testing/daffodil-cart-testing.metadata.json +0 -1
|
@@ -1,1530 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@daffodil/cart/driver'), require('@angular/common'), require('angular-in-memory-web-api'), require('@daffodil/cart/testing')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@daffodil/cart/driver/in-memory', ['exports', '@angular/common/http', '@angular/core', 'rxjs', 'rxjs/operators', '@daffodil/cart/driver', '@angular/common', 'angular-in-memory-web-api', '@daffodil/cart/testing'], factory) :
|
|
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['in-memory'] = {}), global.ng.common.http, global.ng.core, global.rxjs, global.rxjs.operators, global.daffodil.cart.driver, global.ng.common, global.angularInMemoryWebApi, global.daffodil.cart.testing));
|
|
5
|
-
}(this, (function (exports, i1, i0, rxjs, operators, driver, common, angularInMemoryWebApi, i1$1) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @inheritdoc
|
|
9
|
-
*/
|
|
10
|
-
var DaffInMemoryCartService = /** @class */ (function () {
|
|
11
|
-
function DaffInMemoryCartService(http) {
|
|
12
|
-
this.http = http;
|
|
13
|
-
/**
|
|
14
|
-
* The URL with which the driver makes calls to the backend.
|
|
15
|
-
*/
|
|
16
|
-
this.url = '/api/cart';
|
|
17
|
-
}
|
|
18
|
-
DaffInMemoryCartService.prototype.get = function (cartId) {
|
|
19
|
-
return this.http.get(this.url + "/" + cartId).pipe(operators.catchError(function (error) { return rxjs.throwError(new driver.DaffCartNotFoundError(error.message)); }), operators.map(function (result) { return ({
|
|
20
|
-
response: result,
|
|
21
|
-
errors: [],
|
|
22
|
-
}); }));
|
|
23
|
-
};
|
|
24
|
-
DaffInMemoryCartService.prototype.addToCart = function (productId, qty) {
|
|
25
|
-
return this.http.post(this.url + '/addToCart', { productId: productId, qty: qty });
|
|
26
|
-
};
|
|
27
|
-
DaffInMemoryCartService.prototype.clear = function (cartId) {
|
|
28
|
-
return this.http.post(this.url + "/" + cartId + "/clear", {});
|
|
29
|
-
};
|
|
30
|
-
DaffInMemoryCartService.prototype.create = function () {
|
|
31
|
-
return this.http.post(this.url, {});
|
|
32
|
-
};
|
|
33
|
-
return DaffInMemoryCartService;
|
|
34
|
-
}());
|
|
35
|
-
/** @nocollapse */ DaffInMemoryCartService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartService_Factory() { return new DaffInMemoryCartService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartService, providedIn: "root" });
|
|
36
|
-
DaffInMemoryCartService.decorators = [
|
|
37
|
-
{ type: i0.Injectable, args: [{
|
|
38
|
-
providedIn: 'root',
|
|
39
|
-
},] }
|
|
40
|
-
];
|
|
41
|
-
/** @nocollapse */
|
|
42
|
-
DaffInMemoryCartService.ctorParameters = function () { return [
|
|
43
|
-
{ type: i1.HttpClient }
|
|
44
|
-
]; };
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @inheritdoc
|
|
48
|
-
*/
|
|
49
|
-
var DaffInMemoryCartItemService = /** @class */ (function () {
|
|
50
|
-
function DaffInMemoryCartItemService(http) {
|
|
51
|
-
this.http = http;
|
|
52
|
-
/**
|
|
53
|
-
* The URL with which the driver makes calls to the backend.
|
|
54
|
-
*/
|
|
55
|
-
this.url = '/api/cart-items';
|
|
56
|
-
}
|
|
57
|
-
DaffInMemoryCartItemService.prototype.list = function (cartId) {
|
|
58
|
-
return this.http.get(this.url + "/" + cartId + "/");
|
|
59
|
-
};
|
|
60
|
-
DaffInMemoryCartItemService.prototype.get = function (cartId, itemId) {
|
|
61
|
-
return this.http.get(this.url + "/" + cartId + "/" + itemId);
|
|
62
|
-
};
|
|
63
|
-
DaffInMemoryCartItemService.prototype.add = function (cartId, input) {
|
|
64
|
-
return this.http.post(this.url + "/" + cartId + "/", input);
|
|
65
|
-
};
|
|
66
|
-
DaffInMemoryCartItemService.prototype.update = function (cartId, itemId, item) {
|
|
67
|
-
return this.http.put(this.url + "/" + cartId + "/" + itemId, item);
|
|
68
|
-
};
|
|
69
|
-
DaffInMemoryCartItemService.prototype.delete = function (cartId, itemId) {
|
|
70
|
-
return this.http.delete(this.url + "/" + cartId + "/" + itemId);
|
|
71
|
-
};
|
|
72
|
-
return DaffInMemoryCartItemService;
|
|
73
|
-
}());
|
|
74
|
-
/** @nocollapse */ DaffInMemoryCartItemService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartItemService_Factory() { return new DaffInMemoryCartItemService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartItemService, providedIn: "root" });
|
|
75
|
-
DaffInMemoryCartItemService.decorators = [
|
|
76
|
-
{ type: i0.Injectable, args: [{
|
|
77
|
-
providedIn: 'root',
|
|
78
|
-
},] }
|
|
79
|
-
];
|
|
80
|
-
/** @nocollapse */
|
|
81
|
-
DaffInMemoryCartItemService.ctorParameters = function () { return [
|
|
82
|
-
{ type: i1.HttpClient }
|
|
83
|
-
]; };
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @inheritdoc
|
|
87
|
-
*/
|
|
88
|
-
var DaffInMemoryCartBillingAddressService = /** @class */ (function () {
|
|
89
|
-
function DaffInMemoryCartBillingAddressService(http) {
|
|
90
|
-
this.http = http;
|
|
91
|
-
/**
|
|
92
|
-
* The URL with which the driver makes calls to the backend.
|
|
93
|
-
*/
|
|
94
|
-
this.url = '/api/cart-billing-address';
|
|
95
|
-
}
|
|
96
|
-
DaffInMemoryCartBillingAddressService.prototype.get = function (cartId) {
|
|
97
|
-
return this.http.get(this.url + "/" + cartId);
|
|
98
|
-
};
|
|
99
|
-
DaffInMemoryCartBillingAddressService.prototype.update = function (cartId, address) {
|
|
100
|
-
return this.http.put(this.url + "/" + cartId, address);
|
|
101
|
-
};
|
|
102
|
-
return DaffInMemoryCartBillingAddressService;
|
|
103
|
-
}());
|
|
104
|
-
/** @nocollapse */ DaffInMemoryCartBillingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartBillingAddressService_Factory() { return new DaffInMemoryCartBillingAddressService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartBillingAddressService, providedIn: "root" });
|
|
105
|
-
DaffInMemoryCartBillingAddressService.decorators = [
|
|
106
|
-
{ type: i0.Injectable, args: [{
|
|
107
|
-
providedIn: 'root',
|
|
108
|
-
},] }
|
|
109
|
-
];
|
|
110
|
-
/** @nocollapse */
|
|
111
|
-
DaffInMemoryCartBillingAddressService.ctorParameters = function () { return [
|
|
112
|
-
{ type: i1.HttpClient }
|
|
113
|
-
]; };
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @inheritdoc
|
|
117
|
-
*/
|
|
118
|
-
var DaffInMemoryCartPaymentService = /** @class */ (function () {
|
|
119
|
-
function DaffInMemoryCartPaymentService(http) {
|
|
120
|
-
this.http = http;
|
|
121
|
-
/**
|
|
122
|
-
* The URL with which the driver makes calls to the backend.
|
|
123
|
-
*/
|
|
124
|
-
this.url = '/api/cart-payment';
|
|
125
|
-
}
|
|
126
|
-
DaffInMemoryCartPaymentService.prototype.get = function (cartId) {
|
|
127
|
-
return this.http.get(this.url + "/" + cartId);
|
|
128
|
-
};
|
|
129
|
-
DaffInMemoryCartPaymentService.prototype.update = function (cartId, payment) {
|
|
130
|
-
return this.http.put(this.url + "/" + cartId, { payment: payment });
|
|
131
|
-
};
|
|
132
|
-
DaffInMemoryCartPaymentService.prototype.updateWithBilling = function (cartId, payment, address) {
|
|
133
|
-
return this.http.put(this.url + "/" + cartId, { payment: payment, address: address });
|
|
134
|
-
};
|
|
135
|
-
DaffInMemoryCartPaymentService.prototype.remove = function (cartId) {
|
|
136
|
-
return this.http.delete(this.url + "/" + cartId);
|
|
137
|
-
};
|
|
138
|
-
return DaffInMemoryCartPaymentService;
|
|
139
|
-
}());
|
|
140
|
-
/** @nocollapse */ DaffInMemoryCartPaymentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartPaymentService_Factory() { return new DaffInMemoryCartPaymentService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartPaymentService, providedIn: "root" });
|
|
141
|
-
DaffInMemoryCartPaymentService.decorators = [
|
|
142
|
-
{ type: i0.Injectable, args: [{
|
|
143
|
-
providedIn: 'root',
|
|
144
|
-
},] }
|
|
145
|
-
];
|
|
146
|
-
/** @nocollapse */
|
|
147
|
-
DaffInMemoryCartPaymentService.ctorParameters = function () { return [
|
|
148
|
-
{ type: i1.HttpClient }
|
|
149
|
-
]; };
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* @inheritdoc
|
|
153
|
-
*/
|
|
154
|
-
var DaffInMemoryCartPaymentMethodsService = /** @class */ (function () {
|
|
155
|
-
function DaffInMemoryCartPaymentMethodsService(http) {
|
|
156
|
-
this.http = http;
|
|
157
|
-
/**
|
|
158
|
-
* The URL with which the driver makes calls to the backend.
|
|
159
|
-
*/
|
|
160
|
-
this.url = '/api/cart-payment-methods';
|
|
161
|
-
}
|
|
162
|
-
DaffInMemoryCartPaymentMethodsService.prototype.list = function (cartId) {
|
|
163
|
-
return this.http.get(this.url + "/" + cartId);
|
|
164
|
-
};
|
|
165
|
-
return DaffInMemoryCartPaymentMethodsService;
|
|
166
|
-
}());
|
|
167
|
-
/** @nocollapse */ DaffInMemoryCartPaymentMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartPaymentMethodsService_Factory() { return new DaffInMemoryCartPaymentMethodsService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartPaymentMethodsService, providedIn: "root" });
|
|
168
|
-
DaffInMemoryCartPaymentMethodsService.decorators = [
|
|
169
|
-
{ type: i0.Injectable, args: [{
|
|
170
|
-
providedIn: 'root',
|
|
171
|
-
},] }
|
|
172
|
-
];
|
|
173
|
-
/** @nocollapse */
|
|
174
|
-
DaffInMemoryCartPaymentMethodsService.ctorParameters = function () { return [
|
|
175
|
-
{ type: i1.HttpClient }
|
|
176
|
-
]; };
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @inheritdoc
|
|
180
|
-
*/
|
|
181
|
-
var DaffInMemoryCartShippingAddressService = /** @class */ (function () {
|
|
182
|
-
function DaffInMemoryCartShippingAddressService(http) {
|
|
183
|
-
this.http = http;
|
|
184
|
-
/**
|
|
185
|
-
* The URL with which the driver makes calls to the backend.
|
|
186
|
-
*/
|
|
187
|
-
this.url = '/api/cart-shipping-address';
|
|
188
|
-
}
|
|
189
|
-
DaffInMemoryCartShippingAddressService.prototype.get = function (cartId) {
|
|
190
|
-
return this.http.get(this.url + "/" + cartId);
|
|
191
|
-
};
|
|
192
|
-
DaffInMemoryCartShippingAddressService.prototype.update = function (cartId, address) {
|
|
193
|
-
return this.http.put(this.url + "/" + cartId, address);
|
|
194
|
-
};
|
|
195
|
-
return DaffInMemoryCartShippingAddressService;
|
|
196
|
-
}());
|
|
197
|
-
/** @nocollapse */ DaffInMemoryCartShippingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartShippingAddressService_Factory() { return new DaffInMemoryCartShippingAddressService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartShippingAddressService, providedIn: "root" });
|
|
198
|
-
DaffInMemoryCartShippingAddressService.decorators = [
|
|
199
|
-
{ type: i0.Injectable, args: [{
|
|
200
|
-
providedIn: 'root',
|
|
201
|
-
},] }
|
|
202
|
-
];
|
|
203
|
-
/** @nocollapse */
|
|
204
|
-
DaffInMemoryCartShippingAddressService.ctorParameters = function () { return [
|
|
205
|
-
{ type: i1.HttpClient }
|
|
206
|
-
]; };
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* @inheritdoc
|
|
210
|
-
*/
|
|
211
|
-
var DaffInMemoryCartShippingInformationService = /** @class */ (function () {
|
|
212
|
-
function DaffInMemoryCartShippingInformationService(http) {
|
|
213
|
-
this.http = http;
|
|
214
|
-
/**
|
|
215
|
-
* The URL with which the driver makes calls to the backend.
|
|
216
|
-
*/
|
|
217
|
-
this.url = '/api/cart-shipping-information';
|
|
218
|
-
}
|
|
219
|
-
DaffInMemoryCartShippingInformationService.prototype.get = function (cartId) {
|
|
220
|
-
return this.http.get(this.url + "/" + cartId);
|
|
221
|
-
};
|
|
222
|
-
DaffInMemoryCartShippingInformationService.prototype.update = function (cartId, info) {
|
|
223
|
-
return this.http.put(this.url + "/" + cartId, info);
|
|
224
|
-
};
|
|
225
|
-
DaffInMemoryCartShippingInformationService.prototype.delete = function (cartId) {
|
|
226
|
-
return this.http.delete(this.url + "/" + cartId);
|
|
227
|
-
};
|
|
228
|
-
return DaffInMemoryCartShippingInformationService;
|
|
229
|
-
}());
|
|
230
|
-
/** @nocollapse */ DaffInMemoryCartShippingInformationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartShippingInformationService_Factory() { return new DaffInMemoryCartShippingInformationService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartShippingInformationService, providedIn: "root" });
|
|
231
|
-
DaffInMemoryCartShippingInformationService.decorators = [
|
|
232
|
-
{ type: i0.Injectable, args: [{
|
|
233
|
-
providedIn: 'root',
|
|
234
|
-
},] }
|
|
235
|
-
];
|
|
236
|
-
/** @nocollapse */
|
|
237
|
-
DaffInMemoryCartShippingInformationService.ctorParameters = function () { return [
|
|
238
|
-
{ type: i1.HttpClient }
|
|
239
|
-
]; };
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* @inheritdoc
|
|
243
|
-
*/
|
|
244
|
-
var DaffInMemoryCartShippingMethodsService = /** @class */ (function () {
|
|
245
|
-
function DaffInMemoryCartShippingMethodsService(http) {
|
|
246
|
-
this.http = http;
|
|
247
|
-
/**
|
|
248
|
-
* The URL with which the driver makes calls to the backend.
|
|
249
|
-
*/
|
|
250
|
-
this.url = '/api/cart-shipping-methods';
|
|
251
|
-
}
|
|
252
|
-
DaffInMemoryCartShippingMethodsService.prototype.list = function (cartId) {
|
|
253
|
-
return this.http.get(this.url + "/" + cartId);
|
|
254
|
-
};
|
|
255
|
-
return DaffInMemoryCartShippingMethodsService;
|
|
256
|
-
}());
|
|
257
|
-
/** @nocollapse */ DaffInMemoryCartShippingMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartShippingMethodsService_Factory() { return new DaffInMemoryCartShippingMethodsService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartShippingMethodsService, providedIn: "root" });
|
|
258
|
-
DaffInMemoryCartShippingMethodsService.decorators = [
|
|
259
|
-
{ type: i0.Injectable, args: [{
|
|
260
|
-
providedIn: 'root',
|
|
261
|
-
},] }
|
|
262
|
-
];
|
|
263
|
-
/** @nocollapse */
|
|
264
|
-
DaffInMemoryCartShippingMethodsService.ctorParameters = function () { return [
|
|
265
|
-
{ type: i1.HttpClient }
|
|
266
|
-
]; };
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @inheritdoc
|
|
270
|
-
*/
|
|
271
|
-
var DaffInMemoryCartOrderService = /** @class */ (function () {
|
|
272
|
-
function DaffInMemoryCartOrderService(http) {
|
|
273
|
-
this.http = http;
|
|
274
|
-
/**
|
|
275
|
-
* The URL with which the driver makes calls to the backend.
|
|
276
|
-
*/
|
|
277
|
-
this.url = '/api/cart-order';
|
|
278
|
-
}
|
|
279
|
-
DaffInMemoryCartOrderService.prototype.placeOrder = function (cartId, payment) {
|
|
280
|
-
return this.http.post(this.url + "/" + cartId + "/", { payment: payment });
|
|
281
|
-
};
|
|
282
|
-
return DaffInMemoryCartOrderService;
|
|
283
|
-
}());
|
|
284
|
-
/** @nocollapse */ DaffInMemoryCartOrderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartOrderService_Factory() { return new DaffInMemoryCartOrderService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartOrderService, providedIn: "root" });
|
|
285
|
-
DaffInMemoryCartOrderService.decorators = [
|
|
286
|
-
{ type: i0.Injectable, args: [{
|
|
287
|
-
providedIn: 'root',
|
|
288
|
-
},] }
|
|
289
|
-
];
|
|
290
|
-
/** @nocollapse */
|
|
291
|
-
DaffInMemoryCartOrderService.ctorParameters = function () { return [
|
|
292
|
-
{ type: i1.HttpClient }
|
|
293
|
-
]; };
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* @inheritdoc
|
|
297
|
-
*/
|
|
298
|
-
var DaffInMemoryCartCouponService = /** @class */ (function () {
|
|
299
|
-
function DaffInMemoryCartCouponService(http) {
|
|
300
|
-
this.http = http;
|
|
301
|
-
/**
|
|
302
|
-
* The URL with which the driver makes calls to the backend.
|
|
303
|
-
*/
|
|
304
|
-
this.url = '/api/cart-coupon';
|
|
305
|
-
}
|
|
306
|
-
DaffInMemoryCartCouponService.prototype.list = function (cartId) {
|
|
307
|
-
return this.http.get(this.url + "/" + cartId + "/");
|
|
308
|
-
};
|
|
309
|
-
DaffInMemoryCartCouponService.prototype.apply = function (cartId, coupon) {
|
|
310
|
-
return this.http.post(this.url + "/" + cartId + "/", coupon);
|
|
311
|
-
};
|
|
312
|
-
DaffInMemoryCartCouponService.prototype.remove = function (cartId, coupon) {
|
|
313
|
-
return this.http.delete(this.url + "/" + cartId + "/" + coupon.code);
|
|
314
|
-
};
|
|
315
|
-
DaffInMemoryCartCouponService.prototype.removeAll = function (cartId) {
|
|
316
|
-
return this.http.delete(this.url + "/" + cartId + "/");
|
|
317
|
-
};
|
|
318
|
-
return DaffInMemoryCartCouponService;
|
|
319
|
-
}());
|
|
320
|
-
/** @nocollapse */ DaffInMemoryCartCouponService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartCouponService_Factory() { return new DaffInMemoryCartCouponService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartCouponService, providedIn: "root" });
|
|
321
|
-
DaffInMemoryCartCouponService.decorators = [
|
|
322
|
-
{ type: i0.Injectable, args: [{
|
|
323
|
-
providedIn: 'root',
|
|
324
|
-
},] }
|
|
325
|
-
];
|
|
326
|
-
/** @nocollapse */
|
|
327
|
-
DaffInMemoryCartCouponService.ctorParameters = function () { return [
|
|
328
|
-
{ type: i1.HttpClient }
|
|
329
|
-
]; };
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* @inheritdoc
|
|
333
|
-
*/
|
|
334
|
-
var DaffInMemoryCartAddressService = /** @class */ (function () {
|
|
335
|
-
function DaffInMemoryCartAddressService(http) {
|
|
336
|
-
this.http = http;
|
|
337
|
-
/**
|
|
338
|
-
* The URL with which the driver makes calls to the backend.
|
|
339
|
-
*/
|
|
340
|
-
this.url = '/api/cart-address';
|
|
341
|
-
}
|
|
342
|
-
DaffInMemoryCartAddressService.prototype.update = function (cartId, address) {
|
|
343
|
-
return this.http.put(this.url + "/" + cartId, address);
|
|
344
|
-
};
|
|
345
|
-
return DaffInMemoryCartAddressService;
|
|
346
|
-
}());
|
|
347
|
-
/** @nocollapse */ DaffInMemoryCartAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartAddressService_Factory() { return new DaffInMemoryCartAddressService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartAddressService, providedIn: "root" });
|
|
348
|
-
DaffInMemoryCartAddressService.decorators = [
|
|
349
|
-
{ type: i0.Injectable, args: [{
|
|
350
|
-
providedIn: 'root',
|
|
351
|
-
},] }
|
|
352
|
-
];
|
|
353
|
-
/** @nocollapse */
|
|
354
|
-
DaffInMemoryCartAddressService.ctorParameters = function () { return [
|
|
355
|
-
{ type: i1.HttpClient }
|
|
356
|
-
]; };
|
|
357
|
-
|
|
358
|
-
var DaffCartInMemoryDriverModule = /** @class */ (function () {
|
|
359
|
-
function DaffCartInMemoryDriverModule() {
|
|
360
|
-
}
|
|
361
|
-
DaffCartInMemoryDriverModule.forRoot = function () {
|
|
362
|
-
return {
|
|
363
|
-
ngModule: DaffCartInMemoryDriverModule,
|
|
364
|
-
providers: [
|
|
365
|
-
{
|
|
366
|
-
provide: driver.DaffCartDriver,
|
|
367
|
-
useExisting: DaffInMemoryCartService,
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
provide: driver.DaffCartAddressDriver,
|
|
371
|
-
useExisting: DaffInMemoryCartAddressService,
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
provide: driver.DaffCartBillingAddressDriver,
|
|
375
|
-
useExisting: DaffInMemoryCartBillingAddressService,
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
provide: driver.DaffCartItemDriver,
|
|
379
|
-
useExisting: DaffInMemoryCartItemService,
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
provide: driver.DaffCartPaymentDriver,
|
|
383
|
-
useExisting: DaffInMemoryCartPaymentService,
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
provide: driver.DaffCartPaymentMethodsDriver,
|
|
387
|
-
useExisting: DaffInMemoryCartPaymentMethodsService,
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
provide: driver.DaffCartShippingAddressDriver,
|
|
391
|
-
useExisting: DaffInMemoryCartShippingAddressService,
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
provide: driver.DaffCartShippingInformationDriver,
|
|
395
|
-
useExisting: DaffInMemoryCartShippingInformationService,
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
provide: driver.DaffCartShippingMethodsDriver,
|
|
399
|
-
useExisting: DaffInMemoryCartShippingMethodsService,
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
provide: driver.DaffCartOrderDriver,
|
|
403
|
-
useExisting: DaffInMemoryCartOrderService,
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
provide: driver.DaffCartCouponDriver,
|
|
407
|
-
useExisting: DaffInMemoryCartCouponService,
|
|
408
|
-
},
|
|
409
|
-
],
|
|
410
|
-
};
|
|
411
|
-
};
|
|
412
|
-
return DaffCartInMemoryDriverModule;
|
|
413
|
-
}());
|
|
414
|
-
DaffCartInMemoryDriverModule.decorators = [
|
|
415
|
-
{ type: i0.NgModule, args: [{
|
|
416
|
-
imports: [
|
|
417
|
-
common.CommonModule,
|
|
418
|
-
],
|
|
419
|
-
},] }
|
|
420
|
-
];
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Allows an app dev to generate extra fields in the in-memory backend.
|
|
424
|
-
* This enables the in-memory drivers to return responses similar to what the
|
|
425
|
-
* frontend would expect from the production platform.
|
|
426
|
-
*
|
|
427
|
-
* The value returned by the hook function will be set to the returned cart's `extra_attributes` field
|
|
428
|
-
* for driver calls that return a cart.
|
|
429
|
-
*
|
|
430
|
-
* The following example demonstrates adding the `numberOfCartItems` field to `extra_attributes`:
|
|
431
|
-
* ```ts
|
|
432
|
-
* (reqInfo: RequestInfo, cart: DaffCart) => ({
|
|
433
|
-
* numberOfCartItems: cart.items.length
|
|
434
|
-
* })
|
|
435
|
-
* ```
|
|
436
|
-
*
|
|
437
|
-
* Note that this and any `extra_attributes` features are for advanced users
|
|
438
|
-
* and should be used with care.
|
|
439
|
-
*/
|
|
440
|
-
var DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK = new i0.InjectionToken('DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK', {
|
|
441
|
-
factory: function () { return function (reqInfo, cart) { return ({}); }; },
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* @inheritdoc
|
|
446
|
-
*/
|
|
447
|
-
var DaffInMemoryBackendCartAddressService = /** @class */ (function () {
|
|
448
|
-
function DaffInMemoryBackendCartAddressService(extraFieldsHook) {
|
|
449
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
450
|
-
}
|
|
451
|
-
DaffInMemoryBackendCartAddressService.prototype.put = function (reqInfo) {
|
|
452
|
-
var _this = this;
|
|
453
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
454
|
-
body: _this.updateAddress(reqInfo),
|
|
455
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
456
|
-
}); });
|
|
457
|
-
};
|
|
458
|
-
DaffInMemoryBackendCartAddressService.prototype.getCart = function (reqInfo) {
|
|
459
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
460
|
-
};
|
|
461
|
-
DaffInMemoryBackendCartAddressService.prototype.updateAddress = function (reqInfo) {
|
|
462
|
-
var cart = this.getCart(reqInfo);
|
|
463
|
-
var address = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
464
|
-
cart.billing_address = address;
|
|
465
|
-
cart.shipping_address = address;
|
|
466
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
467
|
-
};
|
|
468
|
-
return DaffInMemoryBackendCartAddressService;
|
|
469
|
-
}());
|
|
470
|
-
/** @nocollapse */ DaffInMemoryBackendCartAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartAddressService_Factory() { return new DaffInMemoryBackendCartAddressService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartAddressService, providedIn: "root" });
|
|
471
|
-
DaffInMemoryBackendCartAddressService.decorators = [
|
|
472
|
-
{ type: i0.Injectable, args: [{
|
|
473
|
-
providedIn: 'root',
|
|
474
|
-
},] }
|
|
475
|
-
];
|
|
476
|
-
/** @nocollapse */
|
|
477
|
-
DaffInMemoryBackendCartAddressService.ctorParameters = function () { return [
|
|
478
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
479
|
-
]; };
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* @inheritdoc
|
|
483
|
-
*/
|
|
484
|
-
var DaffInMemoryBackendCartBillingAddressService = /** @class */ (function () {
|
|
485
|
-
function DaffInMemoryBackendCartBillingAddressService(extraFieldsHook) {
|
|
486
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
487
|
-
}
|
|
488
|
-
DaffInMemoryBackendCartBillingAddressService.prototype.get = function (reqInfo) {
|
|
489
|
-
var _this = this;
|
|
490
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
491
|
-
body: _this.getBillingAddress(reqInfo),
|
|
492
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
493
|
-
}); });
|
|
494
|
-
};
|
|
495
|
-
DaffInMemoryBackendCartBillingAddressService.prototype.put = function (reqInfo) {
|
|
496
|
-
var _this = this;
|
|
497
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
498
|
-
body: _this.updateBillingAddress(reqInfo),
|
|
499
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
500
|
-
}); });
|
|
501
|
-
};
|
|
502
|
-
DaffInMemoryBackendCartBillingAddressService.prototype.getCart = function (reqInfo) {
|
|
503
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
504
|
-
};
|
|
505
|
-
DaffInMemoryBackendCartBillingAddressService.prototype.getBillingAddress = function (reqInfo) {
|
|
506
|
-
return this.getCart(reqInfo).billing_address;
|
|
507
|
-
};
|
|
508
|
-
DaffInMemoryBackendCartBillingAddressService.prototype.updateBillingAddress = function (reqInfo) {
|
|
509
|
-
var cart = this.getCart(reqInfo);
|
|
510
|
-
var address = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
511
|
-
cart.billing_address = address;
|
|
512
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
513
|
-
};
|
|
514
|
-
return DaffInMemoryBackendCartBillingAddressService;
|
|
515
|
-
}());
|
|
516
|
-
/** @nocollapse */ DaffInMemoryBackendCartBillingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartBillingAddressService_Factory() { return new DaffInMemoryBackendCartBillingAddressService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartBillingAddressService, providedIn: "root" });
|
|
517
|
-
DaffInMemoryBackendCartBillingAddressService.decorators = [
|
|
518
|
-
{ type: i0.Injectable, args: [{
|
|
519
|
-
providedIn: 'root',
|
|
520
|
-
},] }
|
|
521
|
-
];
|
|
522
|
-
/** @nocollapse */
|
|
523
|
-
DaffInMemoryBackendCartBillingAddressService.ctorParameters = function () { return [
|
|
524
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
525
|
-
]; };
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
* @inheritdoc
|
|
529
|
-
*/
|
|
530
|
-
var DaffInMemoryBackendCartCouponService = /** @class */ (function () {
|
|
531
|
-
function DaffInMemoryBackendCartCouponService(extraFieldsHook) {
|
|
532
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
533
|
-
}
|
|
534
|
-
DaffInMemoryBackendCartCouponService.prototype.get = function (reqInfo) {
|
|
535
|
-
var _this = this;
|
|
536
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
537
|
-
body: _this.listCoupons(reqInfo),
|
|
538
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
539
|
-
}); });
|
|
540
|
-
};
|
|
541
|
-
DaffInMemoryBackendCartCouponService.prototype.post = function (reqInfo) {
|
|
542
|
-
var _this = this;
|
|
543
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
544
|
-
body: _this.applyCoupon(reqInfo),
|
|
545
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
546
|
-
}); });
|
|
547
|
-
};
|
|
548
|
-
DaffInMemoryBackendCartCouponService.prototype.delete = function (reqInfo) {
|
|
549
|
-
var _this = this;
|
|
550
|
-
return reqInfo.utils.createResponse$(function () {
|
|
551
|
-
var body;
|
|
552
|
-
var action = _this.getAction(reqInfo);
|
|
553
|
-
if (action) {
|
|
554
|
-
body = _this.removeCoupon(reqInfo, action);
|
|
555
|
-
}
|
|
556
|
-
else {
|
|
557
|
-
body = _this.removeAllCoupons(reqInfo);
|
|
558
|
-
}
|
|
559
|
-
return {
|
|
560
|
-
body: body,
|
|
561
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
562
|
-
};
|
|
563
|
-
});
|
|
564
|
-
};
|
|
565
|
-
/**
|
|
566
|
-
* Gets whatever follows the cart ID section of the request URL.
|
|
567
|
-
*/
|
|
568
|
-
DaffInMemoryBackendCartCouponService.prototype.getAction = function (reqInfo) {
|
|
569
|
-
return reqInfo.url.replace("/" + reqInfo.resourceUrl + reqInfo.id + "/", '');
|
|
570
|
-
};
|
|
571
|
-
DaffInMemoryBackendCartCouponService.prototype.getCart = function (reqInfo) {
|
|
572
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
573
|
-
};
|
|
574
|
-
DaffInMemoryBackendCartCouponService.prototype.listCoupons = function (reqInfo) {
|
|
575
|
-
return this.getCart(reqInfo).coupons;
|
|
576
|
-
};
|
|
577
|
-
DaffInMemoryBackendCartCouponService.prototype.applyCoupon = function (reqInfo) {
|
|
578
|
-
var cart = this.getCart(reqInfo);
|
|
579
|
-
var coupon = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
580
|
-
cart.coupons.push(coupon);
|
|
581
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
582
|
-
};
|
|
583
|
-
DaffInMemoryBackendCartCouponService.prototype.removeCoupon = function (reqInfo, couponCode) {
|
|
584
|
-
var cart = this.getCart(reqInfo);
|
|
585
|
-
cart.coupons = cart.coupons.filter(function (_a) {
|
|
586
|
-
var code = _a.code;
|
|
587
|
-
return code !== couponCode;
|
|
588
|
-
});
|
|
589
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
590
|
-
};
|
|
591
|
-
DaffInMemoryBackendCartCouponService.prototype.removeAllCoupons = function (reqInfo) {
|
|
592
|
-
var cart = this.getCart(reqInfo);
|
|
593
|
-
cart.coupons = [];
|
|
594
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
595
|
-
};
|
|
596
|
-
return DaffInMemoryBackendCartCouponService;
|
|
597
|
-
}());
|
|
598
|
-
/** @nocollapse */ DaffInMemoryBackendCartCouponService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartCouponService_Factory() { return new DaffInMemoryBackendCartCouponService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartCouponService, providedIn: "root" });
|
|
599
|
-
DaffInMemoryBackendCartCouponService.decorators = [
|
|
600
|
-
{ type: i0.Injectable, args: [{
|
|
601
|
-
providedIn: 'root',
|
|
602
|
-
},] }
|
|
603
|
-
];
|
|
604
|
-
/** @nocollapse */
|
|
605
|
-
DaffInMemoryBackendCartCouponService.ctorParameters = function () { return [
|
|
606
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
607
|
-
]; };
|
|
608
|
-
|
|
609
|
-
/*! *****************************************************************************
|
|
610
|
-
Copyright (c) Microsoft Corporation.
|
|
611
|
-
|
|
612
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
613
|
-
purpose with or without fee is hereby granted.
|
|
614
|
-
|
|
615
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
616
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
617
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
618
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
619
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
620
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
621
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
622
|
-
***************************************************************************** */
|
|
623
|
-
/* global Reflect, Promise */
|
|
624
|
-
var extendStatics = function (d, b) {
|
|
625
|
-
extendStatics = Object.setPrototypeOf ||
|
|
626
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
627
|
-
function (d, b) { for (var p in b)
|
|
628
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
629
|
-
d[p] = b[p]; };
|
|
630
|
-
return extendStatics(d, b);
|
|
631
|
-
};
|
|
632
|
-
function __extends(d, b) {
|
|
633
|
-
if (typeof b !== "function" && b !== null)
|
|
634
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
635
|
-
extendStatics(d, b);
|
|
636
|
-
function __() { this.constructor = d; }
|
|
637
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
638
|
-
}
|
|
639
|
-
var __assign = function () {
|
|
640
|
-
__assign = Object.assign || function __assign(t) {
|
|
641
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
642
|
-
s = arguments[i];
|
|
643
|
-
for (var p in s)
|
|
644
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
645
|
-
t[p] = s[p];
|
|
646
|
-
}
|
|
647
|
-
return t;
|
|
648
|
-
};
|
|
649
|
-
return __assign.apply(this, arguments);
|
|
650
|
-
};
|
|
651
|
-
function __rest(s, e) {
|
|
652
|
-
var t = {};
|
|
653
|
-
for (var p in s)
|
|
654
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
655
|
-
t[p] = s[p];
|
|
656
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
657
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
658
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
659
|
-
t[p[i]] = s[p[i]];
|
|
660
|
-
}
|
|
661
|
-
return t;
|
|
662
|
-
}
|
|
663
|
-
function __decorate(decorators, target, key, desc) {
|
|
664
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
665
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
666
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
667
|
-
else
|
|
668
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
669
|
-
if (d = decorators[i])
|
|
670
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
671
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
672
|
-
}
|
|
673
|
-
function __param(paramIndex, decorator) {
|
|
674
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
675
|
-
}
|
|
676
|
-
function __metadata(metadataKey, metadataValue) {
|
|
677
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
678
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
679
|
-
}
|
|
680
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
681
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
682
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
683
|
-
function fulfilled(value) { try {
|
|
684
|
-
step(generator.next(value));
|
|
685
|
-
}
|
|
686
|
-
catch (e) {
|
|
687
|
-
reject(e);
|
|
688
|
-
} }
|
|
689
|
-
function rejected(value) { try {
|
|
690
|
-
step(generator["throw"](value));
|
|
691
|
-
}
|
|
692
|
-
catch (e) {
|
|
693
|
-
reject(e);
|
|
694
|
-
} }
|
|
695
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
696
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
function __generator(thisArg, body) {
|
|
700
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
701
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
702
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
703
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
704
|
-
function step(op) {
|
|
705
|
-
if (f)
|
|
706
|
-
throw new TypeError("Generator is already executing.");
|
|
707
|
-
while (_)
|
|
708
|
-
try {
|
|
709
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
710
|
-
return t;
|
|
711
|
-
if (y = 0, t)
|
|
712
|
-
op = [op[0] & 2, t.value];
|
|
713
|
-
switch (op[0]) {
|
|
714
|
-
case 0:
|
|
715
|
-
case 1:
|
|
716
|
-
t = op;
|
|
717
|
-
break;
|
|
718
|
-
case 4:
|
|
719
|
-
_.label++;
|
|
720
|
-
return { value: op[1], done: false };
|
|
721
|
-
case 5:
|
|
722
|
-
_.label++;
|
|
723
|
-
y = op[1];
|
|
724
|
-
op = [0];
|
|
725
|
-
continue;
|
|
726
|
-
case 7:
|
|
727
|
-
op = _.ops.pop();
|
|
728
|
-
_.trys.pop();
|
|
729
|
-
continue;
|
|
730
|
-
default:
|
|
731
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
732
|
-
_ = 0;
|
|
733
|
-
continue;
|
|
734
|
-
}
|
|
735
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
736
|
-
_.label = op[1];
|
|
737
|
-
break;
|
|
738
|
-
}
|
|
739
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
740
|
-
_.label = t[1];
|
|
741
|
-
t = op;
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
if (t && _.label < t[2]) {
|
|
745
|
-
_.label = t[2];
|
|
746
|
-
_.ops.push(op);
|
|
747
|
-
break;
|
|
748
|
-
}
|
|
749
|
-
if (t[2])
|
|
750
|
-
_.ops.pop();
|
|
751
|
-
_.trys.pop();
|
|
752
|
-
continue;
|
|
753
|
-
}
|
|
754
|
-
op = body.call(thisArg, _);
|
|
755
|
-
}
|
|
756
|
-
catch (e) {
|
|
757
|
-
op = [6, e];
|
|
758
|
-
y = 0;
|
|
759
|
-
}
|
|
760
|
-
finally {
|
|
761
|
-
f = t = 0;
|
|
762
|
-
}
|
|
763
|
-
if (op[0] & 5)
|
|
764
|
-
throw op[1];
|
|
765
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
769
|
-
if (k2 === undefined)
|
|
770
|
-
k2 = k;
|
|
771
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
772
|
-
}) : (function (o, m, k, k2) {
|
|
773
|
-
if (k2 === undefined)
|
|
774
|
-
k2 = k;
|
|
775
|
-
o[k2] = m[k];
|
|
776
|
-
});
|
|
777
|
-
function __exportStar(m, o) {
|
|
778
|
-
for (var p in m)
|
|
779
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
780
|
-
__createBinding(o, m, p);
|
|
781
|
-
}
|
|
782
|
-
function __values(o) {
|
|
783
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
784
|
-
if (m)
|
|
785
|
-
return m.call(o);
|
|
786
|
-
if (o && typeof o.length === "number")
|
|
787
|
-
return {
|
|
788
|
-
next: function () {
|
|
789
|
-
if (o && i >= o.length)
|
|
790
|
-
o = void 0;
|
|
791
|
-
return { value: o && o[i++], done: !o };
|
|
792
|
-
}
|
|
793
|
-
};
|
|
794
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
795
|
-
}
|
|
796
|
-
function __read(o, n) {
|
|
797
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
798
|
-
if (!m)
|
|
799
|
-
return o;
|
|
800
|
-
var i = m.call(o), r, ar = [], e;
|
|
801
|
-
try {
|
|
802
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
803
|
-
ar.push(r.value);
|
|
804
|
-
}
|
|
805
|
-
catch (error) {
|
|
806
|
-
e = { error: error };
|
|
807
|
-
}
|
|
808
|
-
finally {
|
|
809
|
-
try {
|
|
810
|
-
if (r && !r.done && (m = i["return"]))
|
|
811
|
-
m.call(i);
|
|
812
|
-
}
|
|
813
|
-
finally {
|
|
814
|
-
if (e)
|
|
815
|
-
throw e.error;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
return ar;
|
|
819
|
-
}
|
|
820
|
-
/** @deprecated */
|
|
821
|
-
function __spread() {
|
|
822
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
823
|
-
ar = ar.concat(__read(arguments[i]));
|
|
824
|
-
return ar;
|
|
825
|
-
}
|
|
826
|
-
/** @deprecated */
|
|
827
|
-
function __spreadArrays() {
|
|
828
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
829
|
-
s += arguments[i].length;
|
|
830
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
831
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
832
|
-
r[k] = a[j];
|
|
833
|
-
return r;
|
|
834
|
-
}
|
|
835
|
-
function __spreadArray(to, from, pack) {
|
|
836
|
-
if (pack || arguments.length === 2)
|
|
837
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
838
|
-
if (ar || !(i in from)) {
|
|
839
|
-
if (!ar)
|
|
840
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
841
|
-
ar[i] = from[i];
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
845
|
-
}
|
|
846
|
-
function __await(v) {
|
|
847
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
848
|
-
}
|
|
849
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
850
|
-
if (!Symbol.asyncIterator)
|
|
851
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
852
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
853
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
854
|
-
function verb(n) { if (g[n])
|
|
855
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
856
|
-
function resume(n, v) { try {
|
|
857
|
-
step(g[n](v));
|
|
858
|
-
}
|
|
859
|
-
catch (e) {
|
|
860
|
-
settle(q[0][3], e);
|
|
861
|
-
} }
|
|
862
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
863
|
-
function fulfill(value) { resume("next", value); }
|
|
864
|
-
function reject(value) { resume("throw", value); }
|
|
865
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
866
|
-
resume(q[0][0], q[0][1]); }
|
|
867
|
-
}
|
|
868
|
-
function __asyncDelegator(o) {
|
|
869
|
-
var i, p;
|
|
870
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
871
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
872
|
-
}
|
|
873
|
-
function __asyncValues(o) {
|
|
874
|
-
if (!Symbol.asyncIterator)
|
|
875
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
876
|
-
var m = o[Symbol.asyncIterator], i;
|
|
877
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
878
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
879
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
880
|
-
}
|
|
881
|
-
function __makeTemplateObject(cooked, raw) {
|
|
882
|
-
if (Object.defineProperty) {
|
|
883
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
|
-
cooked.raw = raw;
|
|
887
|
-
}
|
|
888
|
-
return cooked;
|
|
889
|
-
}
|
|
890
|
-
;
|
|
891
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
892
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
893
|
-
}) : function (o, v) {
|
|
894
|
-
o["default"] = v;
|
|
895
|
-
};
|
|
896
|
-
function __importStar(mod) {
|
|
897
|
-
if (mod && mod.__esModule)
|
|
898
|
-
return mod;
|
|
899
|
-
var result = {};
|
|
900
|
-
if (mod != null)
|
|
901
|
-
for (var k in mod)
|
|
902
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
903
|
-
__createBinding(result, mod, k);
|
|
904
|
-
__setModuleDefault(result, mod);
|
|
905
|
-
return result;
|
|
906
|
-
}
|
|
907
|
-
function __importDefault(mod) {
|
|
908
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
909
|
-
}
|
|
910
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
911
|
-
if (kind === "a" && !f)
|
|
912
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
913
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
914
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
915
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
916
|
-
}
|
|
917
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
918
|
-
if (kind === "m")
|
|
919
|
-
throw new TypeError("Private method is not writable");
|
|
920
|
-
if (kind === "a" && !f)
|
|
921
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
922
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
923
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
924
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
/**
|
|
928
|
-
* @inheritdoc
|
|
929
|
-
*/
|
|
930
|
-
var DaffInMemoryBackendCartItemsService = /** @class */ (function () {
|
|
931
|
-
function DaffInMemoryBackendCartItemsService(cartItemFactory, extraFieldsHook) {
|
|
932
|
-
this.cartItemFactory = cartItemFactory;
|
|
933
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
934
|
-
}
|
|
935
|
-
DaffInMemoryBackendCartItemsService.prototype.get = function (reqInfo) {
|
|
936
|
-
var _this = this;
|
|
937
|
-
return reqInfo.utils.createResponse$(function () {
|
|
938
|
-
var body;
|
|
939
|
-
var action = _this.getAction(reqInfo);
|
|
940
|
-
if (action) {
|
|
941
|
-
body = _this.getItem(reqInfo, action);
|
|
942
|
-
}
|
|
943
|
-
else {
|
|
944
|
-
body = _this.listItems(reqInfo);
|
|
945
|
-
}
|
|
946
|
-
return {
|
|
947
|
-
body: body,
|
|
948
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
949
|
-
};
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
DaffInMemoryBackendCartItemsService.prototype.put = function (reqInfo) {
|
|
953
|
-
var _this = this;
|
|
954
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
955
|
-
body: _this.updateItem(reqInfo, _this.getAction(reqInfo)),
|
|
956
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
957
|
-
}); });
|
|
958
|
-
};
|
|
959
|
-
DaffInMemoryBackendCartItemsService.prototype.post = function (reqInfo) {
|
|
960
|
-
var _this = this;
|
|
961
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
962
|
-
body: _this.addItem(reqInfo),
|
|
963
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
964
|
-
}); });
|
|
965
|
-
};
|
|
966
|
-
DaffInMemoryBackendCartItemsService.prototype.delete = function (reqInfo) {
|
|
967
|
-
var _this = this;
|
|
968
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
969
|
-
body: _this.deleteItem(reqInfo, _this.getAction(reqInfo)),
|
|
970
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
971
|
-
}); });
|
|
972
|
-
};
|
|
973
|
-
/**
|
|
974
|
-
* Gets whatever follows the cart ID section of the request URL.
|
|
975
|
-
*/
|
|
976
|
-
DaffInMemoryBackendCartItemsService.prototype.getAction = function (reqInfo) {
|
|
977
|
-
return reqInfo.url.replace("/" + reqInfo.resourceUrl + reqInfo.id + "/", '');
|
|
978
|
-
};
|
|
979
|
-
DaffInMemoryBackendCartItemsService.prototype.getCart = function (reqInfo) {
|
|
980
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
981
|
-
};
|
|
982
|
-
DaffInMemoryBackendCartItemsService.prototype.transformItemInput = function (itemInput) {
|
|
983
|
-
return Object.assign(Object.assign(Object.assign({}, this.cartItemFactory.create()), itemInput), { product_id: itemInput.productId });
|
|
984
|
-
};
|
|
985
|
-
DaffInMemoryBackendCartItemsService.prototype.listItems = function (reqInfo) {
|
|
986
|
-
return this.getCart(reqInfo).items;
|
|
987
|
-
};
|
|
988
|
-
DaffInMemoryBackendCartItemsService.prototype.getItem = function (reqInfo, itemId) {
|
|
989
|
-
var cart = this.getCart(reqInfo);
|
|
990
|
-
return cart.items.find(function (_a) {
|
|
991
|
-
var id = _a.id;
|
|
992
|
-
return itemId === id;
|
|
993
|
-
});
|
|
994
|
-
};
|
|
995
|
-
DaffInMemoryBackendCartItemsService.prototype.updateItem = function (reqInfo, itemId) {
|
|
996
|
-
var cart = this.getCart(reqInfo);
|
|
997
|
-
var cartIndex = reqInfo.collection.findIndex(function (c) { return c.id === reqInfo.id; });
|
|
998
|
-
var itemChanges = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
999
|
-
var itemIndex = cart.items.findIndex(function (item) { return itemId === item.id; });
|
|
1000
|
-
reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: cart.items.map(function (item, index) { return index === itemIndex ? Object.assign(Object.assign({}, cart.items[itemIndex]), itemChanges) : item; }), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1001
|
-
return reqInfo.collection[cartIndex];
|
|
1002
|
-
};
|
|
1003
|
-
DaffInMemoryBackendCartItemsService.prototype.addItem = function (reqInfo) {
|
|
1004
|
-
var cart = this.getCart(reqInfo);
|
|
1005
|
-
var cartIndex = reqInfo.collection.findIndex(function (c) { return c.id === reqInfo.id; });
|
|
1006
|
-
var itemInput = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
1007
|
-
var existingCartItemIndex = cart.items.findIndex(function (item) { return item.product_id === itemInput.productId; });
|
|
1008
|
-
if (existingCartItemIndex > -1) {
|
|
1009
|
-
var updatedCartItem_1 = Object.assign(Object.assign({}, cart.items[existingCartItemIndex]), { qty: cart.items[existingCartItemIndex].qty + itemInput.qty });
|
|
1010
|
-
reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: cart.items.map(function (item, index) { return index === existingCartItemIndex ? updatedCartItem_1 : item; }), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1011
|
-
}
|
|
1012
|
-
else {
|
|
1013
|
-
reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: __spread(cart.items, [
|
|
1014
|
-
this.transformItemInput(itemInput),
|
|
1015
|
-
]), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1016
|
-
}
|
|
1017
|
-
return reqInfo.collection[cartIndex];
|
|
1018
|
-
};
|
|
1019
|
-
DaffInMemoryBackendCartItemsService.prototype.deleteItem = function (reqInfo, itemId) {
|
|
1020
|
-
var cart = this.getCart(reqInfo);
|
|
1021
|
-
var itemIndex = cart.items.findIndex(function (_a) {
|
|
1022
|
-
var id = _a.id;
|
|
1023
|
-
return itemId === id;
|
|
1024
|
-
});
|
|
1025
|
-
var cartIndex = reqInfo.collection.findIndex(function (c) { return c.id === reqInfo.id; });
|
|
1026
|
-
reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: cart.items.filter(function (item, index) { return index !== itemIndex; }), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1027
|
-
return reqInfo.collection[cartIndex];
|
|
1028
|
-
};
|
|
1029
|
-
return DaffInMemoryBackendCartItemsService;
|
|
1030
|
-
}());
|
|
1031
|
-
/** @nocollapse */ DaffInMemoryBackendCartItemsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartItemsService_Factory() { return new DaffInMemoryBackendCartItemsService(i0.ɵɵinject(i1$1.DaffCartItemFactory), i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartItemsService, providedIn: "root" });
|
|
1032
|
-
DaffInMemoryBackendCartItemsService.decorators = [
|
|
1033
|
-
{ type: i0.Injectable, args: [{
|
|
1034
|
-
providedIn: 'root',
|
|
1035
|
-
},] }
|
|
1036
|
-
];
|
|
1037
|
-
/** @nocollapse */
|
|
1038
|
-
DaffInMemoryBackendCartItemsService.ctorParameters = function () { return [
|
|
1039
|
-
{ type: i1$1.DaffCartItemFactory },
|
|
1040
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
1041
|
-
]; };
|
|
1042
|
-
|
|
1043
|
-
/**
|
|
1044
|
-
* @inheritdoc
|
|
1045
|
-
*/
|
|
1046
|
-
var DaffInMemoryBackendCartOrderService = /** @class */ (function () {
|
|
1047
|
-
function DaffInMemoryBackendCartOrderService() {
|
|
1048
|
-
}
|
|
1049
|
-
DaffInMemoryBackendCartOrderService.prototype.post = function (reqInfo) {
|
|
1050
|
-
var _this = this;
|
|
1051
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1052
|
-
body: _this.placeOrder(reqInfo),
|
|
1053
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1054
|
-
}); });
|
|
1055
|
-
};
|
|
1056
|
-
DaffInMemoryBackendCartOrderService.prototype.placeOrder = function (reqInfo) {
|
|
1057
|
-
return {
|
|
1058
|
-
id: '8235422034',
|
|
1059
|
-
cartId: '89fdsa8sadf',
|
|
1060
|
-
orderId: '8235422034',
|
|
1061
|
-
};
|
|
1062
|
-
};
|
|
1063
|
-
return DaffInMemoryBackendCartOrderService;
|
|
1064
|
-
}());
|
|
1065
|
-
/** @nocollapse */ DaffInMemoryBackendCartOrderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartOrderService_Factory() { return new DaffInMemoryBackendCartOrderService(); }, token: DaffInMemoryBackendCartOrderService, providedIn: "root" });
|
|
1066
|
-
DaffInMemoryBackendCartOrderService.decorators = [
|
|
1067
|
-
{ type: i0.Injectable, args: [{
|
|
1068
|
-
providedIn: 'root',
|
|
1069
|
-
},] }
|
|
1070
|
-
];
|
|
1071
|
-
|
|
1072
|
-
/**
|
|
1073
|
-
* @inheritdoc
|
|
1074
|
-
*/
|
|
1075
|
-
var DaffInMemoryBackendCartPaymentMethodsService = /** @class */ (function () {
|
|
1076
|
-
function DaffInMemoryBackendCartPaymentMethodsService() {
|
|
1077
|
-
}
|
|
1078
|
-
DaffInMemoryBackendCartPaymentMethodsService.prototype.get = function (reqInfo) {
|
|
1079
|
-
var _this = this;
|
|
1080
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1081
|
-
body: _this.listPaymentMethods(reqInfo),
|
|
1082
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1083
|
-
}); });
|
|
1084
|
-
};
|
|
1085
|
-
DaffInMemoryBackendCartPaymentMethodsService.prototype.getCart = function (reqInfo) {
|
|
1086
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1087
|
-
};
|
|
1088
|
-
DaffInMemoryBackendCartPaymentMethodsService.prototype.listPaymentMethods = function (reqInfo) {
|
|
1089
|
-
return this.getCart(reqInfo).available_payment_methods;
|
|
1090
|
-
};
|
|
1091
|
-
return DaffInMemoryBackendCartPaymentMethodsService;
|
|
1092
|
-
}());
|
|
1093
|
-
/** @nocollapse */ DaffInMemoryBackendCartPaymentMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartPaymentMethodsService_Factory() { return new DaffInMemoryBackendCartPaymentMethodsService(); }, token: DaffInMemoryBackendCartPaymentMethodsService, providedIn: "root" });
|
|
1094
|
-
DaffInMemoryBackendCartPaymentMethodsService.decorators = [
|
|
1095
|
-
{ type: i0.Injectable, args: [{
|
|
1096
|
-
providedIn: 'root',
|
|
1097
|
-
},] }
|
|
1098
|
-
];
|
|
1099
|
-
|
|
1100
|
-
/**
|
|
1101
|
-
* @inheritdoc
|
|
1102
|
-
*/
|
|
1103
|
-
var DaffInMemoryBackendCartPaymentService = /** @class */ (function () {
|
|
1104
|
-
function DaffInMemoryBackendCartPaymentService(extraFieldsHook) {
|
|
1105
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
1106
|
-
}
|
|
1107
|
-
DaffInMemoryBackendCartPaymentService.prototype.get = function (reqInfo) {
|
|
1108
|
-
var _this = this;
|
|
1109
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1110
|
-
body: _this.getPayment(reqInfo),
|
|
1111
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1112
|
-
}); });
|
|
1113
|
-
};
|
|
1114
|
-
DaffInMemoryBackendCartPaymentService.prototype.put = function (reqInfo) {
|
|
1115
|
-
var _this = this;
|
|
1116
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1117
|
-
body: _this.updatePayment(reqInfo),
|
|
1118
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1119
|
-
}); });
|
|
1120
|
-
};
|
|
1121
|
-
DaffInMemoryBackendCartPaymentService.prototype.delete = function (reqInfo) {
|
|
1122
|
-
var _this = this;
|
|
1123
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1124
|
-
body: _this.removePayment(reqInfo),
|
|
1125
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1126
|
-
}); });
|
|
1127
|
-
};
|
|
1128
|
-
DaffInMemoryBackendCartPaymentService.prototype.getCart = function (reqInfo) {
|
|
1129
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1130
|
-
};
|
|
1131
|
-
DaffInMemoryBackendCartPaymentService.prototype.getPayment = function (reqInfo) {
|
|
1132
|
-
return this.getCart(reqInfo).payment;
|
|
1133
|
-
};
|
|
1134
|
-
DaffInMemoryBackendCartPaymentService.prototype.updatePayment = function (reqInfo) {
|
|
1135
|
-
var cart = this.getCart(reqInfo);
|
|
1136
|
-
var _a = reqInfo.utils.getJsonBody(reqInfo.req), payment = _a.payment, address = _a.address;
|
|
1137
|
-
cart.payment = payment;
|
|
1138
|
-
if (address) {
|
|
1139
|
-
cart.billing_address = address;
|
|
1140
|
-
}
|
|
1141
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1142
|
-
};
|
|
1143
|
-
DaffInMemoryBackendCartPaymentService.prototype.removePayment = function (reqInfo) {
|
|
1144
|
-
var cart = this.getCart(reqInfo);
|
|
1145
|
-
cart.payment = null;
|
|
1146
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1147
|
-
};
|
|
1148
|
-
return DaffInMemoryBackendCartPaymentService;
|
|
1149
|
-
}());
|
|
1150
|
-
/** @nocollapse */ DaffInMemoryBackendCartPaymentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartPaymentService_Factory() { return new DaffInMemoryBackendCartPaymentService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartPaymentService, providedIn: "root" });
|
|
1151
|
-
DaffInMemoryBackendCartPaymentService.decorators = [
|
|
1152
|
-
{ type: i0.Injectable, args: [{
|
|
1153
|
-
providedIn: 'root',
|
|
1154
|
-
},] }
|
|
1155
|
-
];
|
|
1156
|
-
/** @nocollapse */
|
|
1157
|
-
DaffInMemoryBackendCartPaymentService.ctorParameters = function () { return [
|
|
1158
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
1159
|
-
]; };
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* @inheritdoc
|
|
1163
|
-
*/
|
|
1164
|
-
var DaffInMemoryBackendCartShippingAddressService = /** @class */ (function () {
|
|
1165
|
-
function DaffInMemoryBackendCartShippingAddressService(extraFieldsHook) {
|
|
1166
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
1167
|
-
}
|
|
1168
|
-
DaffInMemoryBackendCartShippingAddressService.prototype.get = function (reqInfo) {
|
|
1169
|
-
var _this = this;
|
|
1170
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1171
|
-
body: _this.getShippingAddress(reqInfo),
|
|
1172
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1173
|
-
}); });
|
|
1174
|
-
};
|
|
1175
|
-
DaffInMemoryBackendCartShippingAddressService.prototype.put = function (reqInfo) {
|
|
1176
|
-
var _this = this;
|
|
1177
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1178
|
-
body: _this.updateShippingAddress(reqInfo),
|
|
1179
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1180
|
-
}); });
|
|
1181
|
-
};
|
|
1182
|
-
DaffInMemoryBackendCartShippingAddressService.prototype.getCart = function (reqInfo) {
|
|
1183
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1184
|
-
};
|
|
1185
|
-
DaffInMemoryBackendCartShippingAddressService.prototype.getShippingAddress = function (reqInfo) {
|
|
1186
|
-
return this.getCart(reqInfo).shipping_address;
|
|
1187
|
-
};
|
|
1188
|
-
DaffInMemoryBackendCartShippingAddressService.prototype.updateShippingAddress = function (reqInfo) {
|
|
1189
|
-
var cart = this.getCart(reqInfo);
|
|
1190
|
-
var address = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
1191
|
-
cart.shipping_address = address;
|
|
1192
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1193
|
-
};
|
|
1194
|
-
return DaffInMemoryBackendCartShippingAddressService;
|
|
1195
|
-
}());
|
|
1196
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartShippingAddressService_Factory() { return new DaffInMemoryBackendCartShippingAddressService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartShippingAddressService, providedIn: "root" });
|
|
1197
|
-
DaffInMemoryBackendCartShippingAddressService.decorators = [
|
|
1198
|
-
{ type: i0.Injectable, args: [{
|
|
1199
|
-
providedIn: 'root',
|
|
1200
|
-
},] }
|
|
1201
|
-
];
|
|
1202
|
-
/** @nocollapse */
|
|
1203
|
-
DaffInMemoryBackendCartShippingAddressService.ctorParameters = function () { return [
|
|
1204
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
1205
|
-
]; };
|
|
1206
|
-
|
|
1207
|
-
/**
|
|
1208
|
-
* @inheritdoc
|
|
1209
|
-
*/
|
|
1210
|
-
var DaffInMemoryBackendCartShippingInformationService = /** @class */ (function () {
|
|
1211
|
-
function DaffInMemoryBackendCartShippingInformationService(extraFieldsHook) {
|
|
1212
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
1213
|
-
}
|
|
1214
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.get = function (reqInfo) {
|
|
1215
|
-
var _this = this;
|
|
1216
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1217
|
-
body: _this.getShippingInformation(reqInfo),
|
|
1218
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1219
|
-
}); });
|
|
1220
|
-
};
|
|
1221
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.put = function (reqInfo) {
|
|
1222
|
-
var _this = this;
|
|
1223
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1224
|
-
body: _this.updateShippingInformation(reqInfo),
|
|
1225
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1226
|
-
}); });
|
|
1227
|
-
};
|
|
1228
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.delete = function (reqInfo) {
|
|
1229
|
-
var _this = this;
|
|
1230
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1231
|
-
body: _this.removeShippingInformation(reqInfo),
|
|
1232
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1233
|
-
}); });
|
|
1234
|
-
};
|
|
1235
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.getCart = function (reqInfo) {
|
|
1236
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1237
|
-
};
|
|
1238
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.getShippingInformation = function (reqInfo) {
|
|
1239
|
-
return this.getCart(reqInfo).shipping_information;
|
|
1240
|
-
};
|
|
1241
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.updateShippingInformation = function (reqInfo) {
|
|
1242
|
-
var cart = this.getCart(reqInfo);
|
|
1243
|
-
var shippingInformation = reqInfo.utils.getJsonBody(reqInfo.req);
|
|
1244
|
-
cart.shipping_information = shippingInformation;
|
|
1245
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1246
|
-
};
|
|
1247
|
-
DaffInMemoryBackendCartShippingInformationService.prototype.removeShippingInformation = function (reqInfo) {
|
|
1248
|
-
var cart = this.getCart(reqInfo);
|
|
1249
|
-
cart.shipping_information = null;
|
|
1250
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1251
|
-
};
|
|
1252
|
-
return DaffInMemoryBackendCartShippingInformationService;
|
|
1253
|
-
}());
|
|
1254
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingInformationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartShippingInformationService_Factory() { return new DaffInMemoryBackendCartShippingInformationService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartShippingInformationService, providedIn: "root" });
|
|
1255
|
-
DaffInMemoryBackendCartShippingInformationService.decorators = [
|
|
1256
|
-
{ type: i0.Injectable, args: [{
|
|
1257
|
-
providedIn: 'root',
|
|
1258
|
-
},] }
|
|
1259
|
-
];
|
|
1260
|
-
/** @nocollapse */
|
|
1261
|
-
DaffInMemoryBackendCartShippingInformationService.ctorParameters = function () { return [
|
|
1262
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
1263
|
-
]; };
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* @inheritdoc
|
|
1267
|
-
*/
|
|
1268
|
-
var DaffInMemoryBackendCartShippingMethodsService = /** @class */ (function () {
|
|
1269
|
-
function DaffInMemoryBackendCartShippingMethodsService(shippingMethodFactory) {
|
|
1270
|
-
this.shippingMethodFactory = shippingMethodFactory;
|
|
1271
|
-
}
|
|
1272
|
-
DaffInMemoryBackendCartShippingMethodsService.prototype.get = function (reqInfo) {
|
|
1273
|
-
var _this = this;
|
|
1274
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1275
|
-
body: _this.listShippingMethods(reqInfo),
|
|
1276
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1277
|
-
}); });
|
|
1278
|
-
};
|
|
1279
|
-
DaffInMemoryBackendCartShippingMethodsService.prototype.getCart = function (reqInfo) {
|
|
1280
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1281
|
-
};
|
|
1282
|
-
DaffInMemoryBackendCartShippingMethodsService.prototype.listShippingMethods = function (reqInfo) {
|
|
1283
|
-
var _a;
|
|
1284
|
-
var cart = this.getCart(reqInfo);
|
|
1285
|
-
if (cart.shipping_address) {
|
|
1286
|
-
if (((_a = cart.available_shipping_methods) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
1287
|
-
cart.available_shipping_methods = this.shippingMethodFactory.createMany(3);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
else {
|
|
1291
|
-
cart.available_shipping_methods = [];
|
|
1292
|
-
}
|
|
1293
|
-
return cart.available_shipping_methods;
|
|
1294
|
-
};
|
|
1295
|
-
return DaffInMemoryBackendCartShippingMethodsService;
|
|
1296
|
-
}());
|
|
1297
|
-
/** @nocollapse */ DaffInMemoryBackendCartShippingMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartShippingMethodsService_Factory() { return new DaffInMemoryBackendCartShippingMethodsService(i0.ɵɵinject(i1$1.DaffCartShippingRateFactory)); }, token: DaffInMemoryBackendCartShippingMethodsService, providedIn: "root" });
|
|
1298
|
-
DaffInMemoryBackendCartShippingMethodsService.decorators = [
|
|
1299
|
-
{ type: i0.Injectable, args: [{
|
|
1300
|
-
providedIn: 'root',
|
|
1301
|
-
},] }
|
|
1302
|
-
];
|
|
1303
|
-
/** @nocollapse */
|
|
1304
|
-
DaffInMemoryBackendCartShippingMethodsService.ctorParameters = function () { return [
|
|
1305
|
-
{ type: i1$1.DaffCartShippingRateFactory }
|
|
1306
|
-
]; };
|
|
1307
|
-
|
|
1308
|
-
/**
|
|
1309
|
-
* @inheritdoc
|
|
1310
|
-
*/
|
|
1311
|
-
var DaffInMemoryBackendCartService = /** @class */ (function () {
|
|
1312
|
-
function DaffInMemoryBackendCartService(cartFactory, extraFieldsHook) {
|
|
1313
|
-
this.cartFactory = cartFactory;
|
|
1314
|
-
this.extraFieldsHook = extraFieldsHook;
|
|
1315
|
-
}
|
|
1316
|
-
DaffInMemoryBackendCartService.prototype.get = function (reqInfo) {
|
|
1317
|
-
var _this = this;
|
|
1318
|
-
var cart = this.getCart(reqInfo);
|
|
1319
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1320
|
-
body: cart ? Object.assign(Object.assign({}, cart), { extra_attributes: _this.extraFieldsHook(reqInfo, cart) }) : cart,
|
|
1321
|
-
status: cart ? angularInMemoryWebApi.STATUS.OK : angularInMemoryWebApi.STATUS.NOT_FOUND,
|
|
1322
|
-
}); });
|
|
1323
|
-
};
|
|
1324
|
-
DaffInMemoryBackendCartService.prototype.post = function (reqInfo) {
|
|
1325
|
-
var _this = this;
|
|
1326
|
-
return reqInfo.utils.createResponse$(function () {
|
|
1327
|
-
var body;
|
|
1328
|
-
var action = _this.getAction(reqInfo);
|
|
1329
|
-
if (reqInfo.id === 'addToCart') {
|
|
1330
|
-
// deprecated
|
|
1331
|
-
body = {};
|
|
1332
|
-
}
|
|
1333
|
-
else if (action === 'clear') {
|
|
1334
|
-
body = _this.clear(reqInfo);
|
|
1335
|
-
}
|
|
1336
|
-
else {
|
|
1337
|
-
body = _this.create(reqInfo);
|
|
1338
|
-
}
|
|
1339
|
-
return {
|
|
1340
|
-
body: body,
|
|
1341
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1342
|
-
};
|
|
1343
|
-
});
|
|
1344
|
-
};
|
|
1345
|
-
/**
|
|
1346
|
-
* Gets whatever follows the cart ID section of the request URL.
|
|
1347
|
-
*/
|
|
1348
|
-
DaffInMemoryBackendCartService.prototype.getAction = function (reqInfo) {
|
|
1349
|
-
return reqInfo.url.replace("/" + reqInfo.resourceUrl + reqInfo.id + "/", '');
|
|
1350
|
-
};
|
|
1351
|
-
DaffInMemoryBackendCartService.prototype.clear = function (reqInfo) {
|
|
1352
|
-
var cart = this.getCart(reqInfo);
|
|
1353
|
-
cart.items = [];
|
|
1354
|
-
return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
|
|
1355
|
-
};
|
|
1356
|
-
DaffInMemoryBackendCartService.prototype.create = function (reqInfo) {
|
|
1357
|
-
var cart = this.cartFactory.create();
|
|
1358
|
-
reqInfo.collection.push(cart);
|
|
1359
|
-
return {
|
|
1360
|
-
id: cart.id,
|
|
1361
|
-
};
|
|
1362
|
-
};
|
|
1363
|
-
DaffInMemoryBackendCartService.prototype.getCart = function (reqInfo) {
|
|
1364
|
-
return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
|
|
1365
|
-
};
|
|
1366
|
-
return DaffInMemoryBackendCartService;
|
|
1367
|
-
}());
|
|
1368
|
-
/** @nocollapse */ DaffInMemoryBackendCartService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartService_Factory() { return new DaffInMemoryBackendCartService(i0.ɵɵinject(i1$1.DaffCartFactory), i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartService, providedIn: "root" });
|
|
1369
|
-
DaffInMemoryBackendCartService.decorators = [
|
|
1370
|
-
{ type: i0.Injectable, args: [{
|
|
1371
|
-
providedIn: 'root',
|
|
1372
|
-
},] }
|
|
1373
|
-
];
|
|
1374
|
-
/** @nocollapse */
|
|
1375
|
-
DaffInMemoryBackendCartService.ctorParameters = function () { return [
|
|
1376
|
-
{ type: i1$1.DaffCartFactory },
|
|
1377
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
|
|
1378
|
-
]; };
|
|
1379
|
-
|
|
1380
|
-
/**
|
|
1381
|
-
* The root cart in-memory backend.
|
|
1382
|
-
* Creates the database and delegates requests to child backends.
|
|
1383
|
-
*/
|
|
1384
|
-
var DaffInMemoryBackendCartRootService = /** @class */ (function () {
|
|
1385
|
-
function DaffInMemoryBackendCartRootService(cartService, cartItemsService, cartOrderService, cartCouponService, cartAddressService, cartShippingAddressService, cartBillingAddressService, cartPaymentMethodsService, cartShippingMethodsService, cartPaymentService, cartShippingInformationService) {
|
|
1386
|
-
this.cartService = cartService;
|
|
1387
|
-
this.cartItemsService = cartItemsService;
|
|
1388
|
-
this.cartOrderService = cartOrderService;
|
|
1389
|
-
this.cartCouponService = cartCouponService;
|
|
1390
|
-
this.cartAddressService = cartAddressService;
|
|
1391
|
-
this.cartShippingAddressService = cartShippingAddressService;
|
|
1392
|
-
this.cartBillingAddressService = cartBillingAddressService;
|
|
1393
|
-
this.cartPaymentMethodsService = cartPaymentMethodsService;
|
|
1394
|
-
this.cartShippingMethodsService = cartShippingMethodsService;
|
|
1395
|
-
this.cartPaymentService = cartPaymentService;
|
|
1396
|
-
this.cartShippingInformationService = cartShippingInformationService;
|
|
1397
|
-
/**
|
|
1398
|
-
* The collection of carts in the backend.
|
|
1399
|
-
*/
|
|
1400
|
-
this.carts = [];
|
|
1401
|
-
}
|
|
1402
|
-
DaffInMemoryBackendCartRootService.prototype.createDb = function (reqInfo) {
|
|
1403
|
-
if (reqInfo) {
|
|
1404
|
-
var seedData = reqInfo.utils.getJsonBody(reqInfo.req).carts;
|
|
1405
|
-
if (seedData) {
|
|
1406
|
-
this.carts = seedData;
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
return {
|
|
1410
|
-
cart: this.carts,
|
|
1411
|
-
};
|
|
1412
|
-
};
|
|
1413
|
-
DaffInMemoryBackendCartRootService.prototype.get = function (reqInfo) {
|
|
1414
|
-
return this.delegateRequest(reqInfo);
|
|
1415
|
-
};
|
|
1416
|
-
DaffInMemoryBackendCartRootService.prototype.post = function (reqInfo) {
|
|
1417
|
-
return this.delegateRequest(reqInfo);
|
|
1418
|
-
};
|
|
1419
|
-
DaffInMemoryBackendCartRootService.prototype.put = function (reqInfo) {
|
|
1420
|
-
return this.delegateRequest(reqInfo);
|
|
1421
|
-
};
|
|
1422
|
-
DaffInMemoryBackendCartRootService.prototype.delete = function (reqInfo) {
|
|
1423
|
-
return this.delegateRequest(reqInfo);
|
|
1424
|
-
};
|
|
1425
|
-
DaffInMemoryBackendCartRootService.prototype.delegateRequest = function (reqInfo) {
|
|
1426
|
-
reqInfo.collection = this.carts;
|
|
1427
|
-
switch (reqInfo.collectionName) {
|
|
1428
|
-
case 'cart':
|
|
1429
|
-
return this.cartService[reqInfo.method](reqInfo);
|
|
1430
|
-
case 'cart-items':
|
|
1431
|
-
return this.cartItemsService[reqInfo.method](reqInfo);
|
|
1432
|
-
case 'cart-order':
|
|
1433
|
-
return this.cartOrderService[reqInfo.method](reqInfo);
|
|
1434
|
-
case 'cart-coupon':
|
|
1435
|
-
return this.cartCouponService[reqInfo.method](reqInfo);
|
|
1436
|
-
case 'cart-address':
|
|
1437
|
-
return this.cartAddressService[reqInfo.method](reqInfo);
|
|
1438
|
-
case 'cart-shipping-address':
|
|
1439
|
-
return this.cartShippingAddressService[reqInfo.method](reqInfo);
|
|
1440
|
-
case 'cart-billing-address':
|
|
1441
|
-
return this.cartBillingAddressService[reqInfo.method](reqInfo);
|
|
1442
|
-
case 'cart-payment-methods':
|
|
1443
|
-
return this.cartPaymentMethodsService[reqInfo.method](reqInfo);
|
|
1444
|
-
case 'cart-shipping-methods':
|
|
1445
|
-
return this.cartShippingMethodsService[reqInfo.method](reqInfo);
|
|
1446
|
-
case 'cart-payment':
|
|
1447
|
-
return this.cartPaymentService[reqInfo.method](reqInfo);
|
|
1448
|
-
case 'cart-shipping-information':
|
|
1449
|
-
return this.cartShippingInformationService[reqInfo.method](reqInfo);
|
|
1450
|
-
default:
|
|
1451
|
-
return reqInfo.utils.createResponse$(function () { return ({
|
|
1452
|
-
body: {},
|
|
1453
|
-
status: angularInMemoryWebApi.STATUS.OK,
|
|
1454
|
-
}); });
|
|
1455
|
-
}
|
|
1456
|
-
};
|
|
1457
|
-
return DaffInMemoryBackendCartRootService;
|
|
1458
|
-
}());
|
|
1459
|
-
/**
|
|
1460
|
-
* The collections that the root service manages.
|
|
1461
|
-
* Useful for a higher-level backend that delegates to this one based on collection name.
|
|
1462
|
-
*/
|
|
1463
|
-
DaffInMemoryBackendCartRootService.COLLECTION_NAMES = [
|
|
1464
|
-
'cart',
|
|
1465
|
-
'cart-items',
|
|
1466
|
-
'cart-order',
|
|
1467
|
-
'cart-coupon',
|
|
1468
|
-
'cart-address',
|
|
1469
|
-
'cart-shipping-address',
|
|
1470
|
-
'cart-billing-address',
|
|
1471
|
-
'cart-payment-methods',
|
|
1472
|
-
'cart-shipping-methods',
|
|
1473
|
-
'cart-payment',
|
|
1474
|
-
'cart-shipping-information',
|
|
1475
|
-
];
|
|
1476
|
-
/** @nocollapse */ DaffInMemoryBackendCartRootService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartRootService_Factory() { return new DaffInMemoryBackendCartRootService(i0.ɵɵinject(DaffInMemoryBackendCartService), i0.ɵɵinject(DaffInMemoryBackendCartItemsService), i0.ɵɵinject(DaffInMemoryBackendCartOrderService), i0.ɵɵinject(DaffInMemoryBackendCartCouponService), i0.ɵɵinject(DaffInMemoryBackendCartAddressService), i0.ɵɵinject(DaffInMemoryBackendCartShippingAddressService), i0.ɵɵinject(DaffInMemoryBackendCartBillingAddressService), i0.ɵɵinject(DaffInMemoryBackendCartPaymentMethodsService), i0.ɵɵinject(DaffInMemoryBackendCartShippingMethodsService), i0.ɵɵinject(DaffInMemoryBackendCartPaymentService), i0.ɵɵinject(DaffInMemoryBackendCartShippingInformationService)); }, token: DaffInMemoryBackendCartRootService, providedIn: "root" });
|
|
1477
|
-
DaffInMemoryBackendCartRootService.decorators = [
|
|
1478
|
-
{ type: i0.Injectable, args: [{
|
|
1479
|
-
providedIn: 'root',
|
|
1480
|
-
},] }
|
|
1481
|
-
];
|
|
1482
|
-
/** @nocollapse */
|
|
1483
|
-
DaffInMemoryBackendCartRootService.ctorParameters = function () { return [
|
|
1484
|
-
{ type: DaffInMemoryBackendCartService },
|
|
1485
|
-
{ type: DaffInMemoryBackendCartItemsService },
|
|
1486
|
-
{ type: DaffInMemoryBackendCartOrderService },
|
|
1487
|
-
{ type: DaffInMemoryBackendCartCouponService },
|
|
1488
|
-
{ type: DaffInMemoryBackendCartAddressService },
|
|
1489
|
-
{ type: DaffInMemoryBackendCartShippingAddressService },
|
|
1490
|
-
{ type: DaffInMemoryBackendCartBillingAddressService },
|
|
1491
|
-
{ type: DaffInMemoryBackendCartPaymentMethodsService },
|
|
1492
|
-
{ type: DaffInMemoryBackendCartShippingMethodsService },
|
|
1493
|
-
{ type: DaffInMemoryBackendCartPaymentService },
|
|
1494
|
-
{ type: DaffInMemoryBackendCartShippingInformationService }
|
|
1495
|
-
]; };
|
|
1496
|
-
|
|
1497
|
-
/**
|
|
1498
|
-
* Generated bundle index. Do not edit.
|
|
1499
|
-
*/
|
|
1500
|
-
|
|
1501
|
-
exports.DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK = DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK;
|
|
1502
|
-
exports.DaffCartInMemoryDriverModule = DaffCartInMemoryDriverModule;
|
|
1503
|
-
exports.DaffInMemoryBackendCartAddressService = DaffInMemoryBackendCartAddressService;
|
|
1504
|
-
exports.DaffInMemoryBackendCartBillingAddressService = DaffInMemoryBackendCartBillingAddressService;
|
|
1505
|
-
exports.DaffInMemoryBackendCartCouponService = DaffInMemoryBackendCartCouponService;
|
|
1506
|
-
exports.DaffInMemoryBackendCartItemsService = DaffInMemoryBackendCartItemsService;
|
|
1507
|
-
exports.DaffInMemoryBackendCartOrderService = DaffInMemoryBackendCartOrderService;
|
|
1508
|
-
exports.DaffInMemoryBackendCartPaymentMethodsService = DaffInMemoryBackendCartPaymentMethodsService;
|
|
1509
|
-
exports.DaffInMemoryBackendCartPaymentService = DaffInMemoryBackendCartPaymentService;
|
|
1510
|
-
exports.DaffInMemoryBackendCartRootService = DaffInMemoryBackendCartRootService;
|
|
1511
|
-
exports.DaffInMemoryBackendCartService = DaffInMemoryBackendCartService;
|
|
1512
|
-
exports.DaffInMemoryBackendCartShippingAddressService = DaffInMemoryBackendCartShippingAddressService;
|
|
1513
|
-
exports.DaffInMemoryBackendCartShippingInformationService = DaffInMemoryBackendCartShippingInformationService;
|
|
1514
|
-
exports.DaffInMemoryBackendCartShippingMethodsService = DaffInMemoryBackendCartShippingMethodsService;
|
|
1515
|
-
exports.DaffInMemoryCartBillingAddressService = DaffInMemoryCartBillingAddressService;
|
|
1516
|
-
exports.DaffInMemoryCartCouponService = DaffInMemoryCartCouponService;
|
|
1517
|
-
exports.DaffInMemoryCartItemService = DaffInMemoryCartItemService;
|
|
1518
|
-
exports.DaffInMemoryCartOrderService = DaffInMemoryCartOrderService;
|
|
1519
|
-
exports.DaffInMemoryCartPaymentMethodsService = DaffInMemoryCartPaymentMethodsService;
|
|
1520
|
-
exports.DaffInMemoryCartPaymentService = DaffInMemoryCartPaymentService;
|
|
1521
|
-
exports.DaffInMemoryCartService = DaffInMemoryCartService;
|
|
1522
|
-
exports.DaffInMemoryCartShippingAddressService = DaffInMemoryCartShippingAddressService;
|
|
1523
|
-
exports.DaffInMemoryCartShippingInformationService = DaffInMemoryCartShippingInformationService;
|
|
1524
|
-
exports.DaffInMemoryCartShippingMethodsService = DaffInMemoryCartShippingMethodsService;
|
|
1525
|
-
exports.ɵa = DaffInMemoryCartAddressService;
|
|
1526
|
-
|
|
1527
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1528
|
-
|
|
1529
|
-
})));
|
|
1530
|
-
//# sourceMappingURL=daffodil-cart-driver-in-memory.umd.js.map
|