@daffodil/cart 0.88.1 → 0.89.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/driver/in-memory/index.d.ts +382 -1
- package/driver/index.d.ts +364 -1
- package/driver/magento/index.d.ts +995 -1
- package/driver/magento/testing/index.d.ts +188 -1
- package/driver/testing/index.d.ts +163 -1
- package/fesm2022/daffodil-cart-driver-in-memory.mjs +73 -73
- package/fesm2022/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-cart-driver-magento-testing.mjs +30 -30
- package/fesm2022/daffodil-cart-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-driver-magento.mjs +76 -76
- package/fesm2022/daffodil-cart-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-cart-driver-testing.mjs +37 -37
- package/fesm2022/daffodil-cart-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-driver.mjs +3 -3
- package/fesm2022/daffodil-cart-driver.mjs.map +1 -1
- package/fesm2022/daffodil-cart-routing.mjs +37 -37
- package/fesm2022/daffodil-cart-routing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-state-testing.mjs +16 -16
- package/fesm2022/daffodil-cart-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-state.mjs +46 -46
- package/fesm2022/daffodil-cart-state.mjs.map +1 -1
- package/fesm2022/daffodil-cart-testing.mjs +27 -28
- package/fesm2022/daffodil-cart-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart.mjs +3 -3
- package/fesm2022/daffodil-cart.mjs.map +1 -1
- package/index.d.ts +459 -1
- package/package.json +1 -1
- package/routing/index.d.ts +240 -1
- package/state/index.d.ts +1704 -1
- package/state/testing/index.d.ts +130 -1
- package/testing/index.d.ts +169 -1
- package/driver/errors/cart-not-found.d.ts +0 -9
- package/driver/errors/codes.enum.d.ts +0 -12
- package/driver/errors/expired-payment-token.d.ts +0 -11
- package/driver/errors/invalid-api-response.d.ts +0 -10
- package/driver/errors/invalid-country.d.ts +0 -9
- package/driver/errors/invalid-coupon-code.d.ts +0 -11
- package/driver/errors/invalid-email.d.ts +0 -8
- package/driver/errors/invalid-region.d.ts +0 -9
- package/driver/errors/item-exceeds-max-qty.d.ts +0 -9
- package/driver/errors/map.d.ts +0 -25
- package/driver/errors/product-out-of-stock.d.ts +0 -9
- package/driver/errors/public_api.d.ts +0 -12
- package/driver/errors/unauthorized-for-cart.d.ts +0 -8
- package/driver/in-memory/backend/cart/cart.service.d.ts +0 -28
- package/driver/in-memory/backend/cart-address/cart-address.service.d.ts +0 -17
- package/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.d.ts +0 -19
- package/driver/in-memory/backend/cart-coupon/cart-coupon.service.d.ts +0 -26
- package/driver/in-memory/backend/cart-items/cart-items.service.d.ts +0 -33
- package/driver/in-memory/backend/cart-order/cart-order.service.d.ts +0 -13
- package/driver/in-memory/backend/cart-payment/cart-payment.service.d.ts +0 -21
- package/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.d.ts +0 -14
- package/driver/in-memory/backend/cart-root.service.d.ts +0 -35
- package/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.d.ts +0 -19
- package/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.d.ts +0 -23
- package/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.d.ts +0 -17
- package/driver/in-memory/backend/public_api.d.ts +0 -12
- package/driver/in-memory/collection-names.d.ts +0 -11
- package/driver/in-memory/drivers/cart/cart.service.d.ts +0 -24
- package/driver/in-memory/drivers/cart-address/cart-address.service.d.ts +0 -17
- package/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.d.ts +0 -18
- package/driver/in-memory/drivers/cart-coupon/cart-coupon.service.d.ts +0 -20
- package/driver/in-memory/drivers/cart-driver.module.d.ts +0 -9
- package/driver/in-memory/drivers/cart-item/cart-item.service.d.ts +0 -21
- package/driver/in-memory/drivers/cart-order/cart-order.service.d.ts +0 -17
- package/driver/in-memory/drivers/cart-payment/cart-payment.service.d.ts +0 -20
- package/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +0 -17
- package/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +0 -18
- package/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +0 -19
- package/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +0 -17
- package/driver/in-memory/drivers/public_api.d.ts +0 -11
- package/driver/in-memory/helpers/compute-cart-item-prices.d.ts +0 -3
- package/driver/in-memory/helpers/compute-cart-totals.d.ts +0 -3
- package/driver/in-memory/injection-tokens/extra-attributes-hook.token.d.ts +0 -4
- package/driver/in-memory/injection-tokens/public_api.d.ts +0 -1
- package/driver/in-memory/public_api.d.ts +0 -4
- package/driver/injection-tokens/free-payment-method.d.ts +0 -2
- package/driver/injection-tokens/public_api.d.ts +0 -1
- package/driver/interfaces/cart-address-service.interface.d.ts +0 -12
- package/driver/interfaces/cart-billing-address-service.interface.d.ts +0 -16
- package/driver/interfaces/cart-coupon-service.interface.d.ts +0 -24
- package/driver/interfaces/cart-item-service.interface.d.ts +0 -28
- package/driver/interfaces/cart-order-service.interface.d.ts +0 -12
- package/driver/interfaces/cart-payment-methods-service.interface.d.ts +0 -12
- package/driver/interfaces/cart-payment-service.interface.d.ts +0 -22
- package/driver/interfaces/cart-service.interface.d.ts +0 -29
- package/driver/interfaces/cart-shipping-address-service.interface.d.ts +0 -16
- package/driver/interfaces/cart-shipping-information-service.interface.d.ts +0 -21
- package/driver/interfaces/cart-shipping-methods-service.interface.d.ts +0 -12
- package/driver/interfaces/public_api.d.ts +0 -11
- package/driver/magento/cart-address.service.d.ts +0 -26
- package/driver/magento/cart-billing-address.service.d.ts +0 -30
- package/driver/magento/cart-coupon.service.d.ts +0 -24
- package/driver/magento/cart-driver.module.d.ts +0 -9
- package/driver/magento/cart-item.service.d.ts +0 -35
- package/driver/magento/cart-order.service.d.ts +0 -17
- package/driver/magento/cart-payment-methods.service.d.ts +0 -21
- package/driver/magento/cart-payment.service.d.ts +0 -34
- package/driver/magento/cart-shipping-address.service.d.ts +0 -30
- package/driver/magento/cart-shipping-information.service.d.ts +0 -29
- package/driver/magento/cart-shipping-methods.service.d.ts +0 -21
- package/driver/magento/cart.service.d.ts +0 -32
- package/driver/magento/errors/codes.d.ts +0 -5
- package/driver/magento/errors/map.d.ts +0 -11
- package/driver/magento/errors/transform.d.ts +0 -15
- package/driver/magento/injection-tokens/cart-mutation-queue.token.d.ts +0 -2
- package/driver/magento/injection-tokens/fragments/cart.d.ts +0 -2
- package/driver/magento/injection-tokens/public_api.d.ts +0 -3
- package/driver/magento/injection-tokens/transforms/cart/token.d.ts +0 -2
- package/driver/magento/injection-tokens/transforms/cart-item/token.d.ts +0 -2
- package/driver/magento/interfaces/cart-item-transform.type.d.ts +0 -3
- package/driver/magento/interfaces/cart-transform.type.d.ts +0 -6
- package/driver/magento/interfaces/public_api.d.ts +0 -2
- package/driver/magento/models/public_api.d.ts +0 -2
- package/driver/magento/models/requests/billing-address.d.ts +0 -5
- package/driver/magento/models/requests/cart-address-base.d.ts +0 -5
- package/driver/magento/models/requests/cart-address.d.ts +0 -12
- package/driver/magento/models/requests/cart-item-update.d.ts +0 -4
- package/driver/magento/models/requests/cart-item.d.ts +0 -11
- package/driver/magento/models/requests/payment-method.d.ts +0 -4
- package/driver/magento/models/requests/public_api.d.ts +0 -8
- package/driver/magento/models/requests/shipping-address.d.ts +0 -4
- package/driver/magento/models/requests/shipping-method.d.ts +0 -4
- package/driver/magento/models/responses/cart-address.d.ts +0 -19
- package/driver/magento/models/responses/cart-coupon.d.ts +0 -3
- package/driver/magento/models/responses/cart-item.d.ts +0 -60
- package/driver/magento/models/responses/cart-payment-method.d.ts +0 -6
- package/driver/magento/models/responses/cart-shipping-method.d.ts +0 -8
- package/driver/magento/models/responses/cart.d.ts +0 -33
- package/driver/magento/models/responses/public_api.d.ts +0 -9
- package/driver/magento/models/responses/shipping-address.d.ts +0 -6
- package/driver/magento/models/responses/user-error.enum.d.ts +0 -6
- package/driver/magento/models/responses/user-error.type.d.ts +0 -5
- package/driver/magento/public_api.d.ts +0 -16
- package/driver/magento/queries/add-item/public_api.d.ts +0 -3
- package/driver/magento/queries/add-item/query.d.ts +0 -4
- package/driver/magento/queries/add-item/response.type.d.ts +0 -9
- package/driver/magento/queries/add-item/variables.type.d.ts +0 -5
- package/driver/magento/queries/apply-coupon/public_api.d.ts +0 -3
- package/driver/magento/queries/apply-coupon/query.d.ts +0 -4
- package/driver/magento/queries/apply-coupon/response.type.d.ts +0 -6
- package/driver/magento/queries/apply-coupon/variables.type.d.ts +0 -4
- package/driver/magento/queries/create-cart/public_api.d.ts +0 -3
- package/driver/magento/queries/create-cart/query.d.ts +0 -1
- package/driver/magento/queries/create-cart/response.type.d.ts +0 -4
- package/driver/magento/queries/create-cart/variables.type.d.ts +0 -2
- package/driver/magento/queries/fragments/available-payment-method.d.ts +0 -1
- package/driver/magento/queries/fragments/available-shipping-method.d.ts +0 -1
- package/driver/magento/queries/fragments/cart-address.d.ts +0 -1
- package/driver/magento/queries/fragments/cart-coupon.d.ts +0 -1
- package/driver/magento/queries/fragments/cart-item.d.ts +0 -2
- package/driver/magento/queries/fragments/cart.d.ts +0 -1
- package/driver/magento/queries/fragments/prices.d.ts +0 -1
- package/driver/magento/queries/fragments/public_api.d.ts +0 -10
- package/driver/magento/queries/fragments/selected-payment-method.d.ts +0 -1
- package/driver/magento/queries/fragments/selected-shipping-method.d.ts +0 -1
- package/driver/magento/queries/fragments/user-error.d.ts +0 -1
- package/driver/magento/queries/get-billing-address/public_api.d.ts +0 -3
- package/driver/magento/queries/get-billing-address/query.d.ts +0 -4
- package/driver/magento/queries/get-billing-address/response.type.d.ts +0 -8
- package/driver/magento/queries/get-billing-address/variables.type.d.ts +0 -3
- package/driver/magento/queries/get-cart/public_api.d.ts +0 -3
- package/driver/magento/queries/get-cart/query.d.ts +0 -4
- package/driver/magento/queries/get-cart/response.type.d.ts +0 -5
- package/driver/magento/queries/get-cart/variables.type.d.ts +0 -3
- package/driver/magento/queries/get-selected-payment-method/public_api.d.ts +0 -3
- package/driver/magento/queries/get-selected-payment-method/query.d.ts +0 -4
- package/driver/magento/queries/get-selected-payment-method/response.type.d.ts +0 -7
- package/driver/magento/queries/get-selected-payment-method/variables.type.d.ts +0 -3
- package/driver/magento/queries/get-selected-shipping-method/public_api.d.ts +0 -3
- package/driver/magento/queries/get-selected-shipping-method/query.d.ts +0 -4
- package/driver/magento/queries/get-selected-shipping-method/response.type.d.ts +0 -10
- package/driver/magento/queries/get-selected-shipping-method/variables.type.d.ts +0 -3
- package/driver/magento/queries/get-shipping-address/public_api.d.ts +0 -3
- package/driver/magento/queries/get-shipping-address/query.d.ts +0 -4
- package/driver/magento/queries/get-shipping-address/response.type.d.ts +0 -8
- package/driver/magento/queries/get-shipping-address/variables.type.d.ts +0 -3
- package/driver/magento/queries/list-coupons/public_api.d.ts +0 -3
- package/driver/magento/queries/list-coupons/query.d.ts +0 -4
- package/driver/magento/queries/list-coupons/response.type.d.ts +0 -6
- package/driver/magento/queries/list-coupons/variables.type.d.ts +0 -3
- package/driver/magento/queries/list-items/public_api.d.ts +0 -3
- package/driver/magento/queries/list-items/query.d.ts +0 -4
- package/driver/magento/queries/list-items/response.type.d.ts +0 -7
- package/driver/magento/queries/list-items/variables.type.d.ts +0 -3
- package/driver/magento/queries/list-payment-methods/public_api.d.ts +0 -3
- package/driver/magento/queries/list-payment-methods/query.d.ts +0 -4
- package/driver/magento/queries/list-payment-methods/response.type.d.ts +0 -7
- package/driver/magento/queries/list-payment-methods/variables.type.d.ts +0 -3
- package/driver/magento/queries/list-shipping-methods/public_api.d.ts +0 -3
- package/driver/magento/queries/list-shipping-methods/query.d.ts +0 -3
- package/driver/magento/queries/list-shipping-methods/response.type.d.ts +0 -7
- package/driver/magento/queries/list-shipping-methods/variables.type.d.ts +0 -3
- package/driver/magento/queries/merge-carts/public_api.d.ts +0 -3
- package/driver/magento/queries/merge-carts/query.d.ts +0 -4
- package/driver/magento/queries/merge-carts/response.type.d.ts +0 -4
- package/driver/magento/queries/merge-carts/variables.type.d.ts +0 -4
- package/driver/magento/queries/place-order/public_api.d.ts +0 -3
- package/driver/magento/queries/place-order/query.d.ts +0 -2
- package/driver/magento/queries/place-order/response.type.d.ts +0 -12
- package/driver/magento/queries/place-order/variables.type.d.ts +0 -3
- package/driver/magento/queries/public_api.d.ts +0 -28
- package/driver/magento/queries/remove-all-coupons/public_api.d.ts +0 -3
- package/driver/magento/queries/remove-all-coupons/query.d.ts +0 -4
- package/driver/magento/queries/remove-all-coupons/response.type.d.ts +0 -6
- package/driver/magento/queries/remove-all-coupons/variables.type.d.ts +0 -3
- package/driver/magento/queries/remove-item/public_api.d.ts +0 -3
- package/driver/magento/queries/remove-item/query.d.ts +0 -4
- package/driver/magento/queries/remove-item/response.type.d.ts +0 -4
- package/driver/magento/queries/remove-item/variables.type.d.ts +0 -4
- package/driver/magento/queries/set-selected-payment-method/public_api.d.ts +0 -3
- package/driver/magento/queries/set-selected-payment-method/query.d.ts +0 -4
- package/driver/magento/queries/set-selected-payment-method/response.type.d.ts +0 -4
- package/driver/magento/queries/set-selected-payment-method/variables.type.d.ts +0 -5
- package/driver/magento/queries/set-selected-payment-method-with-billing/public_api.d.ts +0 -3
- package/driver/magento/queries/set-selected-payment-method-with-billing/query.d.ts +0 -4
- package/driver/magento/queries/set-selected-payment-method-with-billing/response.type.d.ts +0 -10
- package/driver/magento/queries/set-selected-payment-method-with-billing/variables.type.d.ts +0 -6
- package/driver/magento/queries/set-selected-payment-method-with-billing-and-email/public_api.d.ts +0 -3
- package/driver/magento/queries/set-selected-payment-method-with-billing-and-email/query.d.ts +0 -4
- package/driver/magento/queries/set-selected-payment-method-with-billing-and-email/response.type.d.ts +0 -16
- package/driver/magento/queries/set-selected-payment-method-with-billing-and-email/variables.type.d.ts +0 -7
- package/driver/magento/queries/set-selected-shipping-method/public_api.d.ts +0 -3
- package/driver/magento/queries/set-selected-shipping-method/query.d.ts +0 -4
- package/driver/magento/queries/set-selected-shipping-method/response.type.d.ts +0 -4
- package/driver/magento/queries/set-selected-shipping-method/variables.type.d.ts +0 -5
- package/driver/magento/queries/update-address/public_api.d.ts +0 -3
- package/driver/magento/queries/update-address/query.d.ts +0 -11
- package/driver/magento/queries/update-address/response.type.d.ts +0 -11
- package/driver/magento/queries/update-address/variables.type.d.ts +0 -6
- package/driver/magento/queries/update-address-with-email/public_api.d.ts +0 -3
- package/driver/magento/queries/update-address-with-email/query.d.ts +0 -11
- package/driver/magento/queries/update-address-with-email/response.type.d.ts +0 -18
- package/driver/magento/queries/update-address-with-email/variables.type.d.ts +0 -7
- package/driver/magento/queries/update-billing-address/public_api.d.ts +0 -3
- package/driver/magento/queries/update-billing-address/query.d.ts +0 -4
- package/driver/magento/queries/update-billing-address/response.type.d.ts +0 -4
- package/driver/magento/queries/update-billing-address/variables.type.d.ts +0 -5
- package/driver/magento/queries/update-billing-address-with-email/public_api.d.ts +0 -3
- package/driver/magento/queries/update-billing-address-with-email/query.d.ts +0 -4
- package/driver/magento/queries/update-billing-address-with-email/response.type.d.ts +0 -11
- package/driver/magento/queries/update-billing-address-with-email/variables.type.d.ts +0 -6
- package/driver/magento/queries/update-item/public_api.d.ts +0 -3
- package/driver/magento/queries/update-item/query.d.ts +0 -4
- package/driver/magento/queries/update-item/response.type.d.ts +0 -4
- package/driver/magento/queries/update-item/variables.type.d.ts +0 -5
- package/driver/magento/queries/update-shipping-address/public_api.d.ts +0 -3
- package/driver/magento/queries/update-shipping-address/query.d.ts +0 -4
- package/driver/magento/queries/update-shipping-address/response.type.d.ts +0 -4
- package/driver/magento/queries/update-shipping-address/variables.type.d.ts +0 -5
- package/driver/magento/queries/update-shipping-address-with-email/public_api.d.ts +0 -3
- package/driver/magento/queries/update-shipping-address-with-email/query.d.ts +0 -4
- package/driver/magento/queries/update-shipping-address-with-email/response.type.d.ts +0 -11
- package/driver/magento/queries/update-shipping-address-with-email/variables.type.d.ts +0 -6
- package/driver/magento/testing/factories/cart-address-input.factory.d.ts +0 -20
- package/driver/magento/testing/factories/cart-address.factory.d.ts +0 -30
- package/driver/magento/testing/factories/cart-coupon.factory.d.ts +0 -11
- package/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.d.ts +0 -25
- package/driver/magento/testing/factories/cart-item/cart-item.factory.d.ts +0 -24
- package/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.d.ts +0 -16
- package/driver/magento/testing/factories/cart-payment-method.factory.d.ts +0 -13
- package/driver/magento/testing/factories/cart-shipping-method.factory.d.ts +0 -17
- package/driver/magento/testing/factories/cart.factory.d.ts +0 -38
- package/driver/magento/testing/factories/public_api.d.ts +0 -10
- package/driver/magento/testing/factories/shipping-address.factory.d.ts +0 -14
- package/driver/magento/testing/public_api.d.ts +0 -1
- package/driver/magento/transforms/inputs/billing-address.service.d.ts +0 -11
- package/driver/magento/transforms/inputs/cart-address.service.d.ts +0 -8
- package/driver/magento/transforms/inputs/cart-item-input-transformers.d.ts +0 -5
- package/driver/magento/transforms/inputs/cart-item-update.service.d.ts +0 -8
- package/driver/magento/transforms/inputs/payment-method.service.d.ts +0 -8
- package/driver/magento/transforms/inputs/shipping-address.service.d.ts +0 -11
- package/driver/magento/transforms/inputs/shipping-method.service.d.ts +0 -8
- package/driver/magento/transforms/outputs/billing-address.service.d.ts +0 -19
- package/driver/magento/transforms/outputs/cart-address.service.d.ts +0 -16
- package/driver/magento/transforms/outputs/cart-coupon-response.service.d.ts +0 -21
- package/driver/magento/transforms/outputs/cart-coupon.d.ts +0 -3
- package/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.d.ts +0 -8
- package/driver/magento/transforms/outputs/cart-item/cart-item-transformer.d.ts +0 -11
- package/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.d.ts +0 -8
- package/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.d.ts +0 -8
- package/driver/magento/transforms/outputs/cart-payment.service.d.ts +0 -16
- package/driver/magento/transforms/outputs/cart-shipping-rate.service.d.ts +0 -16
- package/driver/magento/transforms/outputs/cart-totals-transformer.d.ts +0 -5
- package/driver/magento/transforms/outputs/cart.service.d.ts +0 -36
- package/driver/magento/transforms/outputs/shipping-address.service.d.ts +0 -19
- package/driver/magento/transforms/public_api.d.ts +0 -12
- package/driver/operators/handle-cart-not-found.d.ts +0 -8
- package/driver/operators/public_api.d.ts +0 -1
- package/driver/public_api.d.ts +0 -5
- package/driver/services/public_api.d.ts +0 -1
- package/driver/services/resolve.service.d.ts +0 -25
- package/driver/testing/drivers/cart/cart.service.d.ts +0 -22
- package/driver/testing/drivers/cart-address/cart-address.service.d.ts +0 -16
- package/driver/testing/drivers/cart-billing-address/cart-billing-address.service.d.ts +0 -17
- package/driver/testing/drivers/cart-coupon/cart-coupon.service.d.ts +0 -19
- package/driver/testing/drivers/cart-driver.module.d.ts +0 -9
- package/driver/testing/drivers/cart-item/cart-item.service.d.ts +0 -20
- package/driver/testing/drivers/cart-order/cart-order.service.d.ts +0 -12
- package/driver/testing/drivers/cart-payment/cart-payment.service.d.ts +0 -19
- package/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +0 -15
- package/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +0 -17
- package/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +0 -18
- package/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +0 -15
- package/driver/testing/drivers/public_api.d.ts +0 -12
- package/driver/testing/public_api.d.ts +0 -1
- package/errors/codes.enum.d.ts +0 -10
- package/errors/map.d.ts +0 -10
- package/errors/public_api.d.ts +0 -3
- package/errors/resolution/cart-not-found-or-created-resolution.d.ts +0 -11
- package/errors/resolution/cart-resolution.d.ts +0 -10
- package/errors/resolution/cart-server-side-resolution.d.ts +0 -12
- package/errors/resolution/cart-storage-resolution.d.ts +0 -11
- package/errors/resolution/public_api.d.ts +0 -4
- package/helpers/get-affected-item.d.ts +0 -5
- package/helpers/get-item-total-discount.d.ts +0 -5
- package/helpers/input-to-item-transform.d.ts +0 -5
- package/helpers/public_api.d.ts +0 -3
- package/injection-tokens/payment-method-map.d.ts +0 -7
- package/injection-tokens/public_api.d.ts +0 -1
- package/models/cart-address.d.ts +0 -11
- package/models/cart-coupon.d.ts +0 -15
- package/models/cart-item-input.d.ts +0 -70
- package/models/cart-item.d.ts +0 -63
- package/models/cart-order-result.d.ts +0 -15
- package/models/cart-payment.d.ts +0 -15
- package/models/cart-shipping-rate.d.ts +0 -30
- package/models/cart-total.d.ts +0 -37
- package/models/cart.d.ts +0 -55
- package/models/composite-cart-item.d.ts +0 -24
- package/models/configurable-cart-item.d.ts +0 -23
- package/models/public_api.d.ts +0 -11
- package/public_api.d.ts +0 -5
- package/routing/cart-routing.module.d.ts +0 -9
- package/routing/config/config.d.ts +0 -16
- package/routing/config/resolution/config.d.ts +0 -15
- package/routing/guards/billing-address/billing-address-guard-redirect.token.d.ts +0 -1
- package/routing/guards/billing-address/billing-address.guard.d.ts +0 -19
- package/routing/guards/cart-items/cart-items-guard-redirect.token.d.ts +0 -1
- package/routing/guards/cart-items/cart-items.guard.d.ts +0 -20
- package/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.d.ts +0 -1
- package/routing/guards/in-stock-items/in-stock-items.guard.d.ts +0 -21
- package/routing/guards/order-result/order-result-guard-redirect.token.d.ts +0 -1
- package/routing/guards/order-result/order-result.guard.d.ts +0 -17
- package/routing/guards/payment-method/payment-method-guard-redirect.token.d.ts +0 -1
- package/routing/guards/payment-method/payment-method.guard.d.ts +0 -19
- package/routing/guards/public_api.d.ts +0 -17
- package/routing/guards/resolve-cart/redirect.token.d.ts +0 -1
- package/routing/guards/resolve-cart/resolve-cart.guard.d.ts +0 -22
- package/routing/guards/resolved-cart/resolved-cart.guard.d.ts +0 -21
- package/routing/guards/shipping-address/shipping-address-guard-redirect.token.d.ts +0 -1
- package/routing/guards/shipping-address/shipping-address.guard.d.ts +0 -19
- package/routing/guards/shipping-method/shipping-method-guard-redirect.token.d.ts +0 -1
- package/routing/guards/shipping-method/shipping-method.guard.d.ts +0 -19
- package/routing/public_api.d.ts +0 -5
- package/routing/resolvers/cart-resolver.service.d.ts +0 -20
- package/routing/resolvers/empty-cart-resolver.service.d.ts +0 -20
- package/routing/resolvers/public_api.d.ts +0 -4
- package/routing/resolvers/tokens/cart-resolver-redirect.token.d.ts +0 -1
- package/routing/resolvers/tokens/empty-cart-resolver-redirect.token.d.ts +0 -1
- package/state/actions/cart-address.actions.d.ts +0 -40
- package/state/actions/cart-billing-address.actions.d.ts +0 -65
- package/state/actions/cart-coupon.actions.d.ts +0 -124
- package/state/actions/cart-item.actions.d.ts +0 -188
- package/state/actions/cart-order.actions.d.ts +0 -51
- package/state/actions/cart-payment-methods.actions.d.ts +0 -38
- package/state/actions/cart-payment.actions.d.ts +0 -135
- package/state/actions/cart-retrieval.d.ts +0 -5
- package/state/actions/cart-shipping-address.actions.d.ts +0 -65
- package/state/actions/cart-shipping-information.actions.d.ts +0 -86
- package/state/actions/cart-shipping-methods.actions.d.ts +0 -32
- package/state/actions/cart.actions.d.ts +0 -184
- package/state/actions/public_api.d.ts +0 -12
- package/state/cart-retrieval/get-response.d.ts +0 -8
- package/state/cart-retrieval/public_api.d.ts +0 -3
- package/state/cart-retrieval/token.d.ts +0 -2
- package/state/cart-retrieval/type.d.ts +0 -40
- package/state/cart-state.module.d.ts +0 -8
- package/state/effects/cart-address.effects.d.ts +0 -16
- package/state/effects/cart-billing-address.effects.d.ts +0 -17
- package/state/effects/cart-coupon.effects.d.ts +0 -19
- package/state/effects/cart-item.effects.d.ts +0 -26
- package/state/effects/cart-order.effects.d.ts +0 -18
- package/state/effects/cart-payment-methods.effects.d.ts +0 -16
- package/state/effects/cart-payment-processor.effects.d.ts +0 -40
- package/state/effects/cart-payment.effects.d.ts +0 -19
- package/state/effects/cart-resolver.effects.d.ts +0 -27
- package/state/effects/cart-shipping-address.effects.d.ts +0 -17
- package/state/effects/cart-shipping-information.effects.d.ts +0 -18
- package/state/effects/cart-shipping-methods.effects.d.ts +0 -16
- package/state/effects/cart.effects.d.ts +0 -19
- package/state/effects/public_api.d.ts +0 -1
- package/state/facades/cart/cart-facade.interface.d.ts +0 -212
- package/state/facades/cart/cart.facade.d.ts +0 -90
- package/state/helpers/cart-items-entity-transform.d.ts +0 -12
- package/state/helpers/public_api.d.ts +0 -1
- package/state/injection-tokens/cart-item-state-debounce-time.d.ts +0 -1
- package/state/injection-tokens/error-matcher.token.d.ts +0 -2
- package/state/injection-tokens/public_api.d.ts +0 -2
- package/state/models/public_api.d.ts +0 -1
- package/state/models/stateful-cart.d.ts +0 -8
- package/state/public_api.d.ts +0 -10
- package/state/reducers/action-types.type.d.ts +0 -3
- package/state/reducers/cart/cart.reducer.d.ts +0 -4
- package/state/reducers/cart/retrieval-actions.reducer.d.ts +0 -9
- package/state/reducers/cart-billing-address/cart-billing-address.reducer.d.ts +0 -4
- package/state/reducers/cart-coupon/cart-coupon.reducer.d.ts +0 -4
- package/state/reducers/cart-initial-state.d.ts +0 -2
- package/state/reducers/cart-item/cart-item.reducer.d.ts +0 -4
- package/state/reducers/cart-item-entities/adapter.d.ts +0 -6
- package/state/reducers/cart-item-entities/cart-item-entities.reducer.d.ts +0 -11
- package/state/reducers/cart-item-entities/retrieval-actions.reducer.d.ts +0 -9
- package/state/reducers/cart-item-entities/set-state-meta-reducer.d.ts +0 -10
- package/state/reducers/cart-operation-type.enum.d.ts +0 -15
- package/state/reducers/cart-order/cart-order-initial-state.d.ts +0 -2
- package/state/reducers/cart-order/cart-order-state.interface.d.ts +0 -7
- package/state/reducers/cart-order/cart-order.reducer.d.ts +0 -4
- package/state/reducers/cart-payment/cart-payment.reducer.d.ts +0 -4
- package/state/reducers/cart-payment/payment.reducer.d.ts +0 -3
- package/state/reducers/cart-payment-methods/cart-payment-methods.reducer.d.ts +0 -4
- package/state/reducers/cart-reducers-state.interface.d.ts +0 -13
- package/state/reducers/cart-reducers.d.ts +0 -3
- package/state/reducers/cart-resolve/cart-resolve-state.enum.d.ts +0 -7
- package/state/reducers/cart-resolve/cart-resolve.reducer.d.ts +0 -4
- package/state/reducers/cart-shipping-address/cart-shipping-address.reducer.d.ts +0 -4
- package/state/reducers/cart-shipping-information/cart-shipping-information.reducer.d.ts +0 -4
- package/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.d.ts +0 -4
- package/state/reducers/cart-state.interface.d.ts +0 -10
- package/state/reducers/cart-store-feature-key.d.ts +0 -1
- package/state/reducers/cart.reducer.d.ts +0 -8
- package/state/reducers/errors/cart-errors.type.d.ts +0 -5
- package/state/reducers/errors/error-state-helpers.d.ts +0 -29
- package/state/reducers/loading/cart-loading.type.d.ts +0 -27
- package/state/reducers/public_api.d.ts +0 -17
- package/state/reducers/token/config.token.d.ts +0 -8
- package/state/reducers/token/extra.token.d.ts +0 -3
- package/state/reducers/token/meta.token.d.ts +0 -3
- package/state/reducers/token/public_api.d.ts +0 -2
- package/state/reducers/token/reducers.token.d.ts +0 -3
- package/state/selectors/cart/cart.selector.d.ts +0 -178
- package/state/selectors/cart-feature.selector.d.ts +0 -7
- package/state/selectors/cart-item-entities/cart-item-entities.selectors.d.ts +0 -26
- package/state/selectors/cart-order/cart-order.selector.d.ts +0 -20
- package/state/selectors/cart.selector.d.ts +0 -8
- package/state/selectors/public_api.d.ts +0 -1
- package/state/testing/cart-testing.module.d.ts +0 -6
- package/state/testing/factories/stateful-cart-item.factory.d.ts +0 -18
- package/state/testing/factories/stateful-composite-cart-item.factory.d.ts +0 -18
- package/state/testing/factories/stateful-configurable-cart-item.factory.d.ts +0 -18
- package/state/testing/mock-cart-facade.d.ts +0 -77
- package/state/testing/public_api.d.ts +0 -5
- package/storage/cart-storage.service.d.ts +0 -23
- package/testing/factories/cart-address.factory.d.ts +0 -26
- package/testing/factories/cart-coupon.factory.d.ts +0 -13
- package/testing/factories/cart-item/cart-item.factory.d.ts +0 -30
- package/testing/factories/cart-item/composite-cart-item.factory.d.ts +0 -20
- package/testing/factories/cart-item/configurable-cart-item.factory.d.ts +0 -19
- package/testing/factories/cart-payment.factory.d.ts +0 -11
- package/testing/factories/cart-shipping-rate.factory.d.ts +0 -17
- package/testing/factories/cart-total.factory.d.ts +0 -23
- package/testing/factories/cart.factory.d.ts +0 -26
- package/testing/factories/public_api.d.ts +0 -9
- package/testing/public_api.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1 +1,459 @@
|
|
|
1
|
-
|
|
1
|
+
import { DaffInheritableError, DaffError, DaffIdentifiable, ID, DaffLocatable, DaffPersistenceService } from '@daffodil/core';
|
|
2
|
+
import { DaffPersonalAddress } from '@daffodil/geography';
|
|
3
|
+
import { DaffProduct, DaffProductImage } from '@daffodil/product';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An enum for the cart error codes.
|
|
8
|
+
* Each error code is unique to an error class.
|
|
9
|
+
*/
|
|
10
|
+
declare enum DaffCartErrorCodes {
|
|
11
|
+
CART_RESOLUTION = "DAFF_CART_RESOLUTION",
|
|
12
|
+
CART_STORAGE_RESOLUTION = "DAFF_CART_STORAGE_RESOLUTION",
|
|
13
|
+
CART_SERVER_SIDE_RESOLUTION = "DAFF_CART_SERVER_SIDE_RESOLUTION",
|
|
14
|
+
CART_NOT_FOUND_OR_CREATED_RESOLUTION = "DAFF_CART_NOT_FOUND_OR_CREATED_RESOLUTION"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An error thrown when the cart fails to resolve.
|
|
19
|
+
*
|
|
20
|
+
* @inheritdoc
|
|
21
|
+
*/
|
|
22
|
+
declare class DaffCartResolutionError extends DaffInheritableError implements DaffError {
|
|
23
|
+
readonly code: string;
|
|
24
|
+
constructor(message?: string);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An error thrown when the cart fails to resolve.
|
|
29
|
+
* This happens when the cart cannot be found and a new cart cannot be created.
|
|
30
|
+
*
|
|
31
|
+
* @inheritdoc
|
|
32
|
+
*/
|
|
33
|
+
declare class DaffCartNotFoundOrCreatedResolutionError extends DaffInheritableError implements DaffError {
|
|
34
|
+
readonly code: string;
|
|
35
|
+
constructor(message?: string);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An error thrown when the cart fails to resolve.
|
|
40
|
+
* This happens when the app is running in a server environment.
|
|
41
|
+
* This is normal and expected in SSR.
|
|
42
|
+
*
|
|
43
|
+
* @inheritdoc
|
|
44
|
+
*/
|
|
45
|
+
declare class DaffCartServerSideResolutionError extends DaffInheritableError implements DaffError {
|
|
46
|
+
readonly code: string;
|
|
47
|
+
constructor(message?: string);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* An error thrown when the cart fails to resolve.
|
|
52
|
+
* This happens when loading the cart ID from storage throws an exception.
|
|
53
|
+
*
|
|
54
|
+
* @inheritdoc
|
|
55
|
+
*/
|
|
56
|
+
declare class DaffCartStorageResolutionError extends DaffInheritableError implements DaffError {
|
|
57
|
+
readonly code: string;
|
|
58
|
+
constructor(message?: string);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A mapping from error codes to error class constructors.
|
|
63
|
+
*/
|
|
64
|
+
declare const DaffCartErrorMap: {
|
|
65
|
+
DAFF_CART_RESOLUTION: typeof DaffCartResolutionError;
|
|
66
|
+
DAFF_CART_STORAGE_RESOLUTION: typeof DaffCartStorageResolutionError;
|
|
67
|
+
DAFF_CART_SERVER_SIDE_RESOLUTION: typeof DaffCartServerSideResolutionError;
|
|
68
|
+
DAFF_CART_NOT_FOUND_OR_CREATED_RESOLUTION: typeof DaffCartNotFoundOrCreatedResolutionError;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* An address that is saved in the cart for checkout purposes.
|
|
73
|
+
*/
|
|
74
|
+
interface DaffCartAddress extends DaffPersonalAddress, DaffIdentifiable {
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Deprecated in version 0.89.0. Will be removed in version 0.92.0.
|
|
77
|
+
* The type of the address: billing or shipping.
|
|
78
|
+
*/
|
|
79
|
+
address_type: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A coupon applied to the cart.
|
|
84
|
+
* Also known as a promo code.
|
|
85
|
+
*/
|
|
86
|
+
interface DaffCartCoupon extends DaffIdentifiable {
|
|
87
|
+
/**
|
|
88
|
+
* The coupon code.
|
|
89
|
+
*/
|
|
90
|
+
code: string;
|
|
91
|
+
/**
|
|
92
|
+
* An optional coupon description.
|
|
93
|
+
*/
|
|
94
|
+
description?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* An enum for the type of the cart item.
|
|
99
|
+
*/
|
|
100
|
+
declare enum DaffCartItemInputType {
|
|
101
|
+
Simple = "simple",
|
|
102
|
+
Composite = "composite",
|
|
103
|
+
Configurable = "configurable"
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* A set of fields specifying how to add a product to the cart.
|
|
107
|
+
*/
|
|
108
|
+
interface DaffCartItemInput {
|
|
109
|
+
/**
|
|
110
|
+
* The type of cart item that corresponds to the product being added to the cart.
|
|
111
|
+
*/
|
|
112
|
+
type: DaffCartItemInputType;
|
|
113
|
+
/**
|
|
114
|
+
* The ID of the product to add to the cart.
|
|
115
|
+
*/
|
|
116
|
+
productId: DaffProduct['id'];
|
|
117
|
+
/**
|
|
118
|
+
* How many of the product should be added to the cart.
|
|
119
|
+
*/
|
|
120
|
+
qty: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A more constrained cart item input for simple products.
|
|
124
|
+
*/
|
|
125
|
+
interface DaffSimpleCartItemInput extends DaffCartItemInput {
|
|
126
|
+
type: DaffCartItemInputType.Simple;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A cart item input for composite products.
|
|
130
|
+
*/
|
|
131
|
+
interface DaffCompositeCartItemInput extends DaffCartItemInput {
|
|
132
|
+
type: DaffCartItemInputType.Composite;
|
|
133
|
+
/**
|
|
134
|
+
* The selected options for the composite product to be added to the cart.
|
|
135
|
+
*/
|
|
136
|
+
options: DaffCompositeCartItemInputOption[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Designates a particular option for the composite product to add to the cart.
|
|
140
|
+
*/
|
|
141
|
+
interface DaffCompositeCartItemInputOption {
|
|
142
|
+
/**
|
|
143
|
+
* An identifier of the option for which a value has been chosen.
|
|
144
|
+
*/
|
|
145
|
+
code: string | number;
|
|
146
|
+
/**
|
|
147
|
+
* How many of the specified option should be added to the cart.
|
|
148
|
+
*/
|
|
149
|
+
quantity: number;
|
|
150
|
+
/**
|
|
151
|
+
* The value identifying the chosen composite product option.
|
|
152
|
+
*/
|
|
153
|
+
value: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Designates a particular configurable product variant to add to the cart.
|
|
157
|
+
*/
|
|
158
|
+
interface DaffConfigurableCartItemInput extends DaffCartItemInput {
|
|
159
|
+
type: DaffCartItemInputType.Configurable;
|
|
160
|
+
/**
|
|
161
|
+
* The value identifying the particular configurable product variant.
|
|
162
|
+
*/
|
|
163
|
+
variantId: ID;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* A discount applied to a specific cart item.
|
|
168
|
+
*/
|
|
169
|
+
interface DaffCartItemDiscount {
|
|
170
|
+
/**
|
|
171
|
+
* The amount of the discount.
|
|
172
|
+
*/
|
|
173
|
+
amount: number;
|
|
174
|
+
/**
|
|
175
|
+
* A human-readable label describing the discount.
|
|
176
|
+
*/
|
|
177
|
+
label: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* A cart item.
|
|
181
|
+
* Cart item types correspond to product types.
|
|
182
|
+
* They hold information about the product to which they correspond and how many of said product is in the cart.
|
|
183
|
+
*/
|
|
184
|
+
interface DaffCartItem extends DaffLocatable, DaffIdentifiable {
|
|
185
|
+
/**
|
|
186
|
+
* The type of cart item.
|
|
187
|
+
*/
|
|
188
|
+
type: DaffCartItemInputType;
|
|
189
|
+
/**
|
|
190
|
+
* The image or thumbnail of the corresponding product.
|
|
191
|
+
*/
|
|
192
|
+
image?: DaffProductImage;
|
|
193
|
+
/**
|
|
194
|
+
* The ID of the corresponding product.
|
|
195
|
+
*/
|
|
196
|
+
product_id: DaffProduct['id'];
|
|
197
|
+
parent_item_id: ID;
|
|
198
|
+
sku: string;
|
|
199
|
+
/**
|
|
200
|
+
* A human-readable label.
|
|
201
|
+
*/
|
|
202
|
+
name: string;
|
|
203
|
+
/**
|
|
204
|
+
* How many of the corresponding product is in the cart.
|
|
205
|
+
*/
|
|
206
|
+
qty: number;
|
|
207
|
+
/**
|
|
208
|
+
* The price per item, excluding cart discounts.
|
|
209
|
+
* This includes any discounts and sales that apply to the product or category.
|
|
210
|
+
*/
|
|
211
|
+
price: number;
|
|
212
|
+
/**
|
|
213
|
+
* The total for the entire row, not including cart discounts.
|
|
214
|
+
* This includes any discounts and sales that apply to the product or category.
|
|
215
|
+
*/
|
|
216
|
+
row_total: number;
|
|
217
|
+
/**
|
|
218
|
+
* Whether or not the specified quantity of the corresponding product is in stock.
|
|
219
|
+
*/
|
|
220
|
+
in_stock: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* A list of discounts applied to the cart item row.
|
|
223
|
+
*/
|
|
224
|
+
discounts: DaffCartItemDiscount[];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The kind of payment used for the cart.
|
|
229
|
+
*/
|
|
230
|
+
interface DaffCartPaymentMethod {
|
|
231
|
+
/**
|
|
232
|
+
* Identifies the kind of payment used.
|
|
233
|
+
* e.g. "credit-card"
|
|
234
|
+
*/
|
|
235
|
+
method: string;
|
|
236
|
+
/**
|
|
237
|
+
* A very generic collection of payment info.
|
|
238
|
+
* Payment and processor specific.
|
|
239
|
+
*/
|
|
240
|
+
payment_info?: any;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Contains information about a particular shipping option.
|
|
245
|
+
*/
|
|
246
|
+
interface DaffCartShippingRate extends DaffIdentifiable {
|
|
247
|
+
/**
|
|
248
|
+
* Identifies the shipping carrier.
|
|
249
|
+
*/
|
|
250
|
+
carrier: string;
|
|
251
|
+
/**
|
|
252
|
+
* A human-readable label of the shipping carrier.
|
|
253
|
+
*/
|
|
254
|
+
carrier_title: string;
|
|
255
|
+
/**
|
|
256
|
+
* Identifies the shipping method.
|
|
257
|
+
*/
|
|
258
|
+
method_code: string;
|
|
259
|
+
/**
|
|
260
|
+
* A human-readable label of the shipping method.
|
|
261
|
+
*/
|
|
262
|
+
method_title: string;
|
|
263
|
+
/**
|
|
264
|
+
* A human-readable description of the shipping method.
|
|
265
|
+
*/
|
|
266
|
+
method_description: string;
|
|
267
|
+
/**
|
|
268
|
+
* The price of the shipping option.
|
|
269
|
+
*/
|
|
270
|
+
price: number;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* An enum for the types of totals that can appear in a cart.
|
|
275
|
+
*/
|
|
276
|
+
declare enum DaffCartTotalTypeEnum {
|
|
277
|
+
grandTotal = "grand_total",
|
|
278
|
+
subtotalExcludingTax = "subtotal_excluding_tax",
|
|
279
|
+
subtotalIncludingTax = "subtotal_including_tax",
|
|
280
|
+
subtotalWithDiscountExcludingTax = "subtotal_with_discount_excluding_tax",
|
|
281
|
+
subtotalWithDiscountIncludingTax = "subtotal_with_discount_including_tax",
|
|
282
|
+
discount = "discount",
|
|
283
|
+
tax = "tax",
|
|
284
|
+
shipping = "shipping"
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Since some cart totals might not have a value defined at all times, like shipping, the values of these totals
|
|
288
|
+
* can be null. Allowing their values to be null differentiates a non-existent value from a zero value. In the case of
|
|
289
|
+
* shipping, this would mean the difference between a cart with no selected shipping method and a cart with a selected shipping
|
|
290
|
+
* method that costs zero.
|
|
291
|
+
*/
|
|
292
|
+
interface DaffCartTotal {
|
|
293
|
+
/**
|
|
294
|
+
* The amount of the total.
|
|
295
|
+
*/
|
|
296
|
+
value: number;
|
|
297
|
+
/**
|
|
298
|
+
* A human-readable label of the total.
|
|
299
|
+
*/
|
|
300
|
+
label: string;
|
|
301
|
+
/**
|
|
302
|
+
* The type of the total.
|
|
303
|
+
*/
|
|
304
|
+
name: DaffCartTotalTypeEnum | string;
|
|
305
|
+
/**
|
|
306
|
+
* The position in the totals list in which this total should be displayed.
|
|
307
|
+
*/
|
|
308
|
+
order: number;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* A cart.
|
|
313
|
+
* Contains products in the form of cart items.
|
|
314
|
+
* Contains payment and shipping info used for checkout.
|
|
315
|
+
*/
|
|
316
|
+
interface DaffCart extends DaffIdentifiable {
|
|
317
|
+
/**
|
|
318
|
+
* A list of coupons applied to the cart.
|
|
319
|
+
*/
|
|
320
|
+
coupons: DaffCartCoupon[];
|
|
321
|
+
/**
|
|
322
|
+
* A list of cart items.
|
|
323
|
+
*/
|
|
324
|
+
items?: DaffCartItem[];
|
|
325
|
+
/**
|
|
326
|
+
* The billing address of the cart.
|
|
327
|
+
*/
|
|
328
|
+
billing_address: DaffCartAddress | null;
|
|
329
|
+
/**
|
|
330
|
+
* The shipping address of the cart.
|
|
331
|
+
*/
|
|
332
|
+
shipping_address: DaffCartAddress | null;
|
|
333
|
+
/**
|
|
334
|
+
* The selected payment method of the cart.
|
|
335
|
+
*/
|
|
336
|
+
payment?: DaffCartPaymentMethod;
|
|
337
|
+
/**
|
|
338
|
+
* A list of totals for the cart.
|
|
339
|
+
*/
|
|
340
|
+
totals: Record<DaffCartTotal['name'], DaffCartTotal>;
|
|
341
|
+
/**
|
|
342
|
+
* The selected shipping method.
|
|
343
|
+
*/
|
|
344
|
+
shipping_information: DaffCartShippingRate | null;
|
|
345
|
+
/**
|
|
346
|
+
* A list of available shipping methods.
|
|
347
|
+
*/
|
|
348
|
+
available_shipping_methods: DaffCartShippingRate[];
|
|
349
|
+
/**
|
|
350
|
+
* A list of available payment methods.
|
|
351
|
+
*/
|
|
352
|
+
available_payment_methods: DaffCartPaymentMethod[];
|
|
353
|
+
/**
|
|
354
|
+
* The field is set to the platform cart object returned by the most recent driver call.
|
|
355
|
+
* No fields are guaranteed here. Use this with care.
|
|
356
|
+
*/
|
|
357
|
+
extra_attributes?: any;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* A cart item for a composite product.
|
|
362
|
+
*/
|
|
363
|
+
interface DaffCompositeCartItem extends DaffCartItem {
|
|
364
|
+
/**
|
|
365
|
+
* A list of composite cart item options.
|
|
366
|
+
*/
|
|
367
|
+
options: DaffCompositeCartItemOption[];
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* A composite product option in a cart item.
|
|
371
|
+
*/
|
|
372
|
+
interface DaffCompositeCartItemOption extends DaffIdentifiable {
|
|
373
|
+
/**
|
|
374
|
+
* A human-readable label for the option.
|
|
375
|
+
*/
|
|
376
|
+
option_label: string;
|
|
377
|
+
/**
|
|
378
|
+
* A human-readable label for the particular value chosen for the option.
|
|
379
|
+
*/
|
|
380
|
+
value_label: string;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* A cart item for a configurable product.
|
|
385
|
+
*/
|
|
386
|
+
interface DaffConfigurableCartItem extends DaffCartItem {
|
|
387
|
+
/**
|
|
388
|
+
* A list of the chosen configurable attributes.
|
|
389
|
+
*/
|
|
390
|
+
attributes: DaffConfigurableCartItemAttribute[];
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Defines a selected attribute for a configurable cart item.
|
|
394
|
+
*/
|
|
395
|
+
interface DaffConfigurableCartItemAttribute {
|
|
396
|
+
/**
|
|
397
|
+
* A human-readable label for the attribute.
|
|
398
|
+
*/
|
|
399
|
+
attribute_label: string;
|
|
400
|
+
/**
|
|
401
|
+
* A human-readable label for the particular value chosen for the attribute.
|
|
402
|
+
*/
|
|
403
|
+
value_label: string;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* The result of placing an order for a cart.
|
|
408
|
+
* Stores a reference to a cart and order object.
|
|
409
|
+
*/
|
|
410
|
+
interface DaffCartOrderResult {
|
|
411
|
+
/**
|
|
412
|
+
* The ID of the cart for which this order was placed.
|
|
413
|
+
*/
|
|
414
|
+
cartId: ID;
|
|
415
|
+
/**
|
|
416
|
+
* The ID of the order placed.
|
|
417
|
+
*/
|
|
418
|
+
orderId: ID;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare const DaffCartPaymentMethodIdMap: _angular_core.InjectionToken<{
|
|
422
|
+
[key: string]: string;
|
|
423
|
+
}>;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Finds the IDs of any affected cart items between two carts.
|
|
427
|
+
*/
|
|
428
|
+
declare function daffCartGetAffectedItems<T extends DaffCartItem = DaffCartItem>(oldItems: Array<T>, newItems: Array<T>): Array<T['id']>;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Creates a stub cart item from the cart item input.
|
|
432
|
+
*/
|
|
433
|
+
declare const daffCartItemInputToItemTransform: (input: DaffCartItemInput) => DaffCartItem;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Sums the discount amounts of the cart item.
|
|
437
|
+
*/
|
|
438
|
+
declare function daffCartGetItemTotalDiscount(item: DaffCartItem): number;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* The DaffCartStorageService is responsible for storing the cart id of a customer
|
|
442
|
+
* in storage when necessary. For some ecommerce platforms, where cart information
|
|
443
|
+
* is stored in a cookie instead of storage accessible via javsacript, this service
|
|
444
|
+
* isn't explicitly necessary, so be sure to use this service only in the driver
|
|
445
|
+
* layer for platforms that require it.
|
|
446
|
+
*/
|
|
447
|
+
declare class DaffCartStorageService {
|
|
448
|
+
private storageService;
|
|
449
|
+
private readonly CART_STORAGE_ID;
|
|
450
|
+
constructor(storageService: DaffPersistenceService);
|
|
451
|
+
getCartId(): string;
|
|
452
|
+
setCartId(value: string): void;
|
|
453
|
+
removeCartId(): void;
|
|
454
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffCartStorageService, never>;
|
|
455
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffCartStorageService>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export { DaffCartErrorCodes, DaffCartErrorMap, DaffCartItemInputType, DaffCartNotFoundOrCreatedResolutionError, DaffCartPaymentMethodIdMap, DaffCartResolutionError, DaffCartServerSideResolutionError, DaffCartStorageResolutionError, DaffCartStorageService, DaffCartTotalTypeEnum, daffCartGetAffectedItems, daffCartGetItemTotalDiscount, daffCartItemInputToItemTransform };
|
|
459
|
+
export type { DaffCart, DaffCartAddress, DaffCartCoupon, DaffCartItem, DaffCartItemDiscount, DaffCartItemInput, DaffCartOrderResult, DaffCartPaymentMethod, DaffCartShippingRate, DaffCartTotal, DaffCompositeCartItem, DaffCompositeCartItemInput, DaffCompositeCartItemInputOption, DaffCompositeCartItemOption, DaffConfigurableCartItem, DaffConfigurableCartItemAttribute, DaffConfigurableCartItemInput, DaffSimpleCartItemInput };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/cart","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/cart"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/cart","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/cart"]}}},"version":"0.89.0","description":"Interfaces built for daffodil/state","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^20.0.0","@angular/core":"^20.0.0","@daffodil/core":"0.89.0","@daffodil/product":"0.89.0","@daffodil/geography":"0.89.0","@daffodil/payment":"0.89.0","@ngrx/effects":"^20.0.0","@ngrx/entity":"^20.0.0","@ngrx/store":"^20.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@faker-js/faker":"^9.8.0","angular-in-memory-web-api":"^0.20.0","apollo-angular":"^11.0.0","@apollo/client":"^3.12.6","@daffodil/driver":"0.89.0"},"module":"fesm2022/daffodil-cart.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-cart.mjs"},"./driver":{"types":"./driver/index.d.ts","default":"./fesm2022/daffodil-cart-driver.mjs"},"./routing":{"types":"./routing/index.d.ts","default":"./fesm2022/daffodil-cart-routing.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-cart-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-cart-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-cart-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","default":"./fesm2022/daffodil-cart-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-cart-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-cart-state-testing.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","default":"./fesm2022/daffodil-cart-driver-magento-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
|