@daffodil/cart 0.39.9 → 0.39.10

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.
Files changed (102) hide show
  1. package/bundles/daffodil-cart-driver-magento-testing.umd.js +2 -2
  2. package/bundles/daffodil-cart-driver-magento-testing.umd.js.map +1 -1
  3. package/bundles/daffodil-cart-driver-magento-testing.umd.min.js +2 -2
  4. package/bundles/daffodil-cart-driver-magento-testing.umd.min.js.map +1 -1
  5. package/bundles/daffodil-cart-driver-magento.umd.js +86 -34
  6. package/bundles/daffodil-cart-driver-magento.umd.js.map +1 -1
  7. package/bundles/daffodil-cart-driver-magento.umd.min.js +1 -1
  8. package/bundles/daffodil-cart-driver-magento.umd.min.js.map +1 -1
  9. package/bundles/daffodil-cart-driver-testing.umd.js +2 -2
  10. package/bundles/daffodil-cart-driver-testing.umd.js.map +1 -1
  11. package/bundles/daffodil-cart-driver-testing.umd.min.js +1 -1
  12. package/bundles/daffodil-cart-driver-testing.umd.min.js.map +1 -1
  13. package/bundles/daffodil-cart-routing.umd.js +43 -0
  14. package/bundles/daffodil-cart-routing.umd.js.map +1 -1
  15. package/bundles/daffodil-cart-routing.umd.min.js +1 -1
  16. package/bundles/daffodil-cart-routing.umd.min.js.map +1 -1
  17. package/bundles/daffodil-cart-state-testing.umd.js +2 -0
  18. package/bundles/daffodil-cart-state-testing.umd.js.map +1 -1
  19. package/bundles/daffodil-cart-state-testing.umd.min.js +1 -1
  20. package/bundles/daffodil-cart-state-testing.umd.min.js.map +1 -1
  21. package/bundles/daffodil-cart-state.umd.js +7 -1
  22. package/bundles/daffodil-cart-state.umd.js.map +1 -1
  23. package/bundles/daffodil-cart-state.umd.min.js +1 -1
  24. package/bundles/daffodil-cart-state.umd.min.js.map +1 -1
  25. package/bundles/daffodil-cart-testing.umd.js +3 -3
  26. package/bundles/daffodil-cart-testing.umd.js.map +1 -1
  27. package/bundles/daffodil-cart-testing.umd.min.js +2 -2
  28. package/bundles/daffodil-cart-testing.umd.min.js.map +1 -1
  29. package/driver/magento/cart-item.service.d.ts +3 -1
  30. package/driver/magento/daffodil-cart-driver-magento.metadata.json +1 -1
  31. package/driver/magento/injection-tokens/public_api.d.ts +1 -0
  32. package/driver/magento/injection-tokens/transforms/cart-item/token.d.ts +22 -0
  33. package/driver/magento/interfaces/cart-item-transform.type.d.ts +3 -0
  34. package/driver/magento/interfaces/public_api.d.ts +1 -0
  35. package/driver/magento/public_api.d.ts +1 -0
  36. package/driver/magento/transforms/outputs/cart-coupon-response.service.d.ts +3 -0
  37. package/driver/magento/transforms/outputs/cart-item/cart-item-transformer.d.ts +7 -4
  38. package/driver/magento/transforms/outputs/cart.service.d.ts +3 -1
  39. package/esm2015/driver/magento/cart-item.service.js +11 -8
  40. package/esm2015/driver/magento/errors/map.js +2 -2
  41. package/esm2015/driver/magento/injection-tokens/public_api.js +2 -1
  42. package/esm2015/driver/magento/injection-tokens/transforms/cart-item/token.js +27 -0
  43. package/esm2015/driver/magento/interfaces/cart-item-transform.type.js +2 -0
  44. package/esm2015/driver/magento/interfaces/public_api.js +2 -0
  45. package/esm2015/driver/magento/public_api.js +2 -1
  46. package/esm2015/driver/magento/testing/factories/cart-address-input.factory.js +2 -2
  47. package/esm2015/driver/magento/testing/factories/cart-address.factory.js +2 -2
  48. package/esm2015/driver/magento/testing/factories/cart-coupon.factory.js +2 -2
  49. package/esm2015/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.js +2 -2
  50. package/esm2015/driver/magento/testing/factories/cart-item/cart-item.factory.js +2 -2
  51. package/esm2015/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.js +1 -1
  52. package/esm2015/driver/magento/testing/factories/cart-payment-method.factory.js +2 -2
  53. package/esm2015/driver/magento/testing/factories/cart-shipping-method.factory.js +2 -2
  54. package/esm2015/driver/magento/testing/factories/cart.factory.js +2 -2
  55. package/esm2015/driver/magento/transforms/outputs/cart-coupon-response.service.js +15 -5
  56. package/esm2015/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.js +2 -2
  57. package/esm2015/driver/magento/transforms/outputs/cart-item/cart-item-transformer.js +9 -6
  58. package/esm2015/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.js +2 -2
  59. package/esm2015/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.js +3 -3
  60. package/esm2015/driver/magento/transforms/outputs/cart.service.js +12 -7
  61. package/esm2015/driver/testing/drivers/cart-order/cart-order.service.js +2 -2
  62. package/esm2015/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.js +6 -0
  63. package/esm2015/routing/guards/in-stock-items/in-stock-items.guard.js +43 -0
  64. package/esm2015/routing/guards/public_api.js +3 -1
  65. package/esm2015/state/facades/cart/cart-facade.interface.js +1 -1
  66. package/esm2015/state/facades/cart/cart.facade.js +4 -2
  67. package/esm2015/state/selectors/cart-item-entities/cart-item-entities.selectors.js +5 -1
  68. package/esm2015/state/testing/factories/stateful-cart-item.factory.js +1 -1
  69. package/esm2015/state/testing/factories/stateful-composite-cart-item.factory.js +1 -1
  70. package/esm2015/state/testing/factories/stateful-configurable-cart-item.factory.js +1 -1
  71. package/esm2015/state/testing/mock-cart-facade.js +3 -1
  72. package/esm2015/testing/factories/cart-address.factory.js +2 -2
  73. package/esm2015/testing/factories/cart-coupon.factory.js +2 -2
  74. package/esm2015/testing/factories/cart-item/cart-item.factory.js +3 -3
  75. package/esm2015/testing/factories/cart-item/composite-cart-item.factory.js +2 -2
  76. package/esm2015/testing/factories/cart-item/configurable-cart-item.factory.js +1 -1
  77. package/esm2015/testing/factories/cart-shipping-rate.factory.js +2 -2
  78. package/esm2015/testing/factories/cart.factory.js +2 -2
  79. package/fesm2015/daffodil-cart-driver-magento-testing.js +1 -1
  80. package/fesm2015/daffodil-cart-driver-magento-testing.js.map +1 -1
  81. package/fesm2015/daffodil-cart-driver-magento.js +77 -35
  82. package/fesm2015/daffodil-cart-driver-magento.js.map +1 -1
  83. package/fesm2015/daffodil-cart-driver-testing.js +1 -1
  84. package/fesm2015/daffodil-cart-driver-testing.js.map +1 -1
  85. package/fesm2015/daffodil-cart-routing.js +40 -1
  86. package/fesm2015/daffodil-cart-routing.js.map +1 -1
  87. package/fesm2015/daffodil-cart-state-testing.js +2 -0
  88. package/fesm2015/daffodil-cart-state-testing.js.map +1 -1
  89. package/fesm2015/daffodil-cart-state.js +7 -1
  90. package/fesm2015/daffodil-cart-state.js.map +1 -1
  91. package/fesm2015/daffodil-cart-testing.js +2 -2
  92. package/fesm2015/daffodil-cart-testing.js.map +1 -1
  93. package/package.json +6 -6
  94. package/routing/daffodil-cart-routing.metadata.json +1 -1
  95. package/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.d.ts +5 -0
  96. package/routing/guards/in-stock-items/in-stock-items.guard.d.ts +17 -0
  97. package/routing/guards/public_api.d.ts +2 -0
  98. package/state/daffodil-cart-state.metadata.json +1 -1
  99. package/state/facades/cart/cart-facade.interface.d.ts +8 -0
  100. package/state/facades/cart/cart.facade.d.ts +2 -0
  101. package/state/selectors/cart-item-entities/cart-item-entities.selectors.d.ts +8 -0
  102. package/state/testing/mock-cart-facade.d.ts +2 -0
@@ -1955,6 +1955,8 @@
1955
1955
  return cartItem.options;
1956
1956
  }); }).memoized;
1957
1957
  var selectIsCartItemOutOfStock = i1.defaultMemoize(function (itemId) { return i1.createSelector(selectCartItem(itemId), function (cartItem) { return cartItem ? !cartItem.in_stock : null; }); }).memoized;
1958
+ var selectOutOfStockCartItems = i1.createSelector(selectAllCartItems, function (items) { return items.filter(function (item) { return !item.in_stock; }); });
1959
+ var selectInStockCartItems = i1.createSelector(selectAllCartItems, function (items) { return items.filter(function (item) { return item.in_stock; }); });
1958
1960
  var selectCartItemMutating = i1.createSelector(selectAllCartItems, function (cartItems) { return cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (acc, item) { return acc || item.daffState === exports.DaffCartItemStateEnum.Mutating; }, false); });
1959
1961
  var selectCartItemState = i1.defaultMemoize(function (itemId) { return i1.createSelector(selectCartItem(itemId), function (cartItem) { return (cartItem === null || cartItem === void 0 ? void 0 : cartItem.daffState) || null; }); }).memoized;
1960
1962
  var selectCartItemQuantity = i1.defaultMemoize(function (itemId) { return i1.createSelector(selectCartItem(itemId), function (cartItem) { return (cartItem === null || cartItem === void 0 ? void 0 : cartItem.qty) || 0; }); }).memoized;
@@ -1977,6 +1979,8 @@
1977
1979
  selectCartItemConfiguredAttributes: selectCartItemConfiguredAttributes,
1978
1980
  selectCartItemCompositeOptions: selectCartItemCompositeOptions,
1979
1981
  selectIsCartItemOutOfStock: selectIsCartItemOutOfStock,
1982
+ selectInStockCartItems: selectInStockCartItems,
1983
+ selectOutOfStockCartItems: selectOutOfStockCartItems,
1980
1984
  selectCartItemMutating: selectCartItemMutating,
1981
1985
  selectCartItemState: selectCartItemState,
1982
1986
  selectCartItemPrice: selectCartItemPrice,
@@ -2779,7 +2783,7 @@
2779
2783
  var _this = this;
2780
2784
  this.store = store;
2781
2785
  this.paymentMethodMap = paymentMethodMap;
2782
- var _a = getDaffCartSelectors(), selectCartValue = _a.selectCartValue, selectCartResolved = _a.selectCartResolved, selectCartLoadingObject = _a.selectCartLoadingObject, selectCartFeatureLoading = _a.selectCartFeatureLoading, selectCartFeatureResolving = _a.selectCartFeatureResolving, selectCartFeatureMutating = _a.selectCartFeatureMutating, selectCartLoading = _a.selectCartLoading, selectCartResolving = _a.selectCartResolving, selectCartMutating = _a.selectCartMutating, selectBillingAddressLoading = _a.selectBillingAddressLoading, selectBillingAddressResolving = _a.selectBillingAddressResolving, selectBillingAddressMutating = _a.selectBillingAddressMutating, selectShippingAddressLoading = _a.selectShippingAddressLoading, selectShippingAddressResolving = _a.selectShippingAddressResolving, selectShippingAddressMutating = _a.selectShippingAddressMutating, selectShippingInformationLoading = _a.selectShippingInformationLoading, selectShippingInformationResolving = _a.selectShippingInformationResolving, selectShippingInformationMutating = _a.selectShippingInformationMutating, selectShippingMethodsLoading = _a.selectShippingMethodsLoading, selectShippingMethodsResolving = _a.selectShippingMethodsResolving, selectPaymentLoading = _a.selectPaymentLoading, selectPaymentResolving = _a.selectPaymentResolving, selectPaymentMutating = _a.selectPaymentMutating, selectPaymentMethodsLoading = _a.selectPaymentMethodsLoading, selectPaymentMethodsResolving = _a.selectPaymentMethodsResolving, selectCouponLoading = _a.selectCouponLoading, selectCouponResolving = _a.selectCouponResolving, selectCouponMutating = _a.selectCouponMutating, selectItemLoading = _a.selectItemLoading, selectItemAdding = _a.selectItemAdding, selectItemResolving = _a.selectItemResolving, selectCartItemMutating = _a.selectCartItemMutating, selectCartErrorsObject = _a.selectCartErrorsObject, selectCartErrors = _a.selectCartErrors, selectItemErrors = _a.selectItemErrors, selectBillingAddressErrors = _a.selectBillingAddressErrors, selectShippingAddressErrors = _a.selectShippingAddressErrors, selectShippingInformationErrors = _a.selectShippingInformationErrors, selectShippingMethodsErrors = _a.selectShippingMethodsErrors, selectPaymentErrors = _a.selectPaymentErrors, selectPaymentMethodsErrors = _a.selectPaymentMethodsErrors, selectCouponErrors = _a.selectCouponErrors, selectCartId = _a.selectCartId, selectCartSubtotal = _a.selectCartSubtotal, selectCartGrandTotal = _a.selectCartGrandTotal, selectCartSubtotalExcludingTax = _a.selectCartSubtotalExcludingTax, selectCartSubtotalIncludingTax = _a.selectCartSubtotalIncludingTax, selectCartSubtotalWithDiscountExcludingTax = _a.selectCartSubtotalWithDiscountExcludingTax, selectCartSubtotalWithDiscountIncludingTax = _a.selectCartSubtotalWithDiscountIncludingTax, selectCartDiscountTotals = _a.selectCartDiscountTotals, selectCartTotalTax = _a.selectCartTotalTax, selectCartShippingTotal = _a.selectCartShippingTotal, selectCartCoupons = _a.selectCartCoupons, selectCartItems = _a.selectCartItems, selectCartHasOutOfStockItems = _a.selectCartHasOutOfStockItems, selectCartItemEntities = _a.selectCartItemEntities, selectTotalNumberOfCartItems = _a.selectTotalNumberOfCartItems, selectCartItemConfiguredAttributes = _a.selectCartItemConfiguredAttributes, selectCartItemCompositeOptions = _a.selectCartItemCompositeOptions, selectCartBillingAddress = _a.selectCartBillingAddress, selectCartShippingAddress = _a.selectCartShippingAddress, selectCartPayment = _a.selectCartPayment, selectCartTotals = _a.selectCartTotals, selectCartShippingInformation = _a.selectCartShippingInformation, selectCartAvailableShippingMethods = _a.selectCartAvailableShippingMethods, selectCartAvailablePaymentMethods = _a.selectCartAvailablePaymentMethods, selectIsCartEmpty = _a.selectIsCartEmpty, selectIsBillingSameAsShipping = _a.selectIsBillingSameAsShipping, selectCartOrderLoading = _a.selectCartOrderLoading, selectCartOrderErrors = _a.selectCartOrderErrors, selectCartOrderValue = _a.selectCartOrderValue, selectCartOrderId = _a.selectCartOrderId, selectCartOrderCartId = _a.selectCartOrderCartId, selectHasOrderResult = _a.selectHasOrderResult, selectIsCartItemOutOfStock = _a.selectIsCartItemOutOfStock, selectCartItemState = _a.selectCartItemState, selectHasBillingAddress = _a.selectHasBillingAddress, selectHasShippingAddress = _a.selectHasShippingAddress, selectHasShippingMethod = _a.selectHasShippingMethod, selectHasPaymentMethod = _a.selectHasPaymentMethod, selectCanPlaceOrder = _a.selectCanPlaceOrder, selectCartItemPrice = _a.selectCartItemPrice, selectCartItemRowTotal = _a.selectCartItemRowTotal, selectCartItemQuantity = _a.selectCartItemQuantity, selectCartItemDiscounts = _a.selectCartItemDiscounts, selectCartItemTotalDiscount = _a.selectCartItemTotalDiscount, selectCartItemErrors = _a.selectCartItemErrors;
2786
+ var _a = getDaffCartSelectors(), selectCartValue = _a.selectCartValue, selectCartResolved = _a.selectCartResolved, selectCartLoadingObject = _a.selectCartLoadingObject, selectCartFeatureLoading = _a.selectCartFeatureLoading, selectCartFeatureResolving = _a.selectCartFeatureResolving, selectCartFeatureMutating = _a.selectCartFeatureMutating, selectCartLoading = _a.selectCartLoading, selectCartResolving = _a.selectCartResolving, selectCartMutating = _a.selectCartMutating, selectBillingAddressLoading = _a.selectBillingAddressLoading, selectBillingAddressResolving = _a.selectBillingAddressResolving, selectBillingAddressMutating = _a.selectBillingAddressMutating, selectShippingAddressLoading = _a.selectShippingAddressLoading, selectShippingAddressResolving = _a.selectShippingAddressResolving, selectShippingAddressMutating = _a.selectShippingAddressMutating, selectShippingInformationLoading = _a.selectShippingInformationLoading, selectShippingInformationResolving = _a.selectShippingInformationResolving, selectShippingInformationMutating = _a.selectShippingInformationMutating, selectShippingMethodsLoading = _a.selectShippingMethodsLoading, selectShippingMethodsResolving = _a.selectShippingMethodsResolving, selectPaymentLoading = _a.selectPaymentLoading, selectPaymentResolving = _a.selectPaymentResolving, selectPaymentMutating = _a.selectPaymentMutating, selectPaymentMethodsLoading = _a.selectPaymentMethodsLoading, selectPaymentMethodsResolving = _a.selectPaymentMethodsResolving, selectCouponLoading = _a.selectCouponLoading, selectCouponResolving = _a.selectCouponResolving, selectCouponMutating = _a.selectCouponMutating, selectItemLoading = _a.selectItemLoading, selectItemAdding = _a.selectItemAdding, selectItemResolving = _a.selectItemResolving, selectCartItemMutating = _a.selectCartItemMutating, selectCartErrorsObject = _a.selectCartErrorsObject, selectCartErrors = _a.selectCartErrors, selectItemErrors = _a.selectItemErrors, selectBillingAddressErrors = _a.selectBillingAddressErrors, selectShippingAddressErrors = _a.selectShippingAddressErrors, selectShippingInformationErrors = _a.selectShippingInformationErrors, selectShippingMethodsErrors = _a.selectShippingMethodsErrors, selectPaymentErrors = _a.selectPaymentErrors, selectPaymentMethodsErrors = _a.selectPaymentMethodsErrors, selectCouponErrors = _a.selectCouponErrors, selectCartId = _a.selectCartId, selectCartSubtotal = _a.selectCartSubtotal, selectCartGrandTotal = _a.selectCartGrandTotal, selectCartSubtotalExcludingTax = _a.selectCartSubtotalExcludingTax, selectCartSubtotalIncludingTax = _a.selectCartSubtotalIncludingTax, selectCartSubtotalWithDiscountExcludingTax = _a.selectCartSubtotalWithDiscountExcludingTax, selectCartSubtotalWithDiscountIncludingTax = _a.selectCartSubtotalWithDiscountIncludingTax, selectCartDiscountTotals = _a.selectCartDiscountTotals, selectCartTotalTax = _a.selectCartTotalTax, selectCartShippingTotal = _a.selectCartShippingTotal, selectCartCoupons = _a.selectCartCoupons, selectCartItems = _a.selectCartItems, selectCartHasOutOfStockItems = _a.selectCartHasOutOfStockItems, selectOutOfStockCartItems = _a.selectOutOfStockCartItems, selectInStockCartItems = _a.selectInStockCartItems, selectCartItemEntities = _a.selectCartItemEntities, selectTotalNumberOfCartItems = _a.selectTotalNumberOfCartItems, selectCartItemConfiguredAttributes = _a.selectCartItemConfiguredAttributes, selectCartItemCompositeOptions = _a.selectCartItemCompositeOptions, selectCartBillingAddress = _a.selectCartBillingAddress, selectCartShippingAddress = _a.selectCartShippingAddress, selectCartPayment = _a.selectCartPayment, selectCartTotals = _a.selectCartTotals, selectCartShippingInformation = _a.selectCartShippingInformation, selectCartAvailableShippingMethods = _a.selectCartAvailableShippingMethods, selectCartAvailablePaymentMethods = _a.selectCartAvailablePaymentMethods, selectIsCartEmpty = _a.selectIsCartEmpty, selectIsBillingSameAsShipping = _a.selectIsBillingSameAsShipping, selectCartOrderLoading = _a.selectCartOrderLoading, selectCartOrderErrors = _a.selectCartOrderErrors, selectCartOrderValue = _a.selectCartOrderValue, selectCartOrderId = _a.selectCartOrderId, selectCartOrderCartId = _a.selectCartOrderCartId, selectHasOrderResult = _a.selectHasOrderResult, selectIsCartItemOutOfStock = _a.selectIsCartItemOutOfStock, selectCartItemState = _a.selectCartItemState, selectHasBillingAddress = _a.selectHasBillingAddress, selectHasShippingAddress = _a.selectHasShippingAddress, selectHasShippingMethod = _a.selectHasShippingMethod, selectHasPaymentMethod = _a.selectHasPaymentMethod, selectCanPlaceOrder = _a.selectCanPlaceOrder, selectCartItemPrice = _a.selectCartItemPrice, selectCartItemRowTotal = _a.selectCartItemRowTotal, selectCartItemQuantity = _a.selectCartItemQuantity, selectCartItemDiscounts = _a.selectCartItemDiscounts, selectCartItemTotalDiscount = _a.selectCartItemTotalDiscount, selectCartItemErrors = _a.selectCartItemErrors;
2783
2787
  this._selectCartItemConfiguredAttributes = selectCartItemConfiguredAttributes;
2784
2788
  this._selectCartItemCompositeOptions = selectCartItemCompositeOptions;
2785
2789
  this._selectIsCartItemOutOfStock = selectIsCartItemOutOfStock;
@@ -2846,6 +2850,8 @@
2846
2850
  this.items$ = this.store.pipe(i1.select(selectCartItems));
2847
2851
  this.totalItems$ = this.store.pipe(i1.select(selectTotalNumberOfCartItems));
2848
2852
  this.hasOutOfStockItems$ = this.store.pipe(i1.select(selectCartHasOutOfStockItems));
2853
+ this.outOfStockItems$ = this.store.pipe(i1.select(selectOutOfStockCartItems));
2854
+ this.inStockItems$ = this.store.pipe(i1.select(selectInStockCartItems));
2849
2855
  this.itemDictionary$ = this.store.pipe(i1.select(selectCartItemEntities));
2850
2856
  this.billingAddress$ = this.store.pipe(i1.select(selectCartBillingAddress));
2851
2857
  this.shippingAddress$ = this.store.pipe(i1.select(selectCartShippingAddress));