@daffodil/cart 0.59.1 → 0.60.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.
@@ -1589,7 +1589,7 @@ class DaffMagentoCartItemService {
1589
1589
  query: listCartItems(this.extraCartFragments),
1590
1590
  variables: { cartId },
1591
1591
  fetchPolicy: 'network-only',
1592
- }).pipe(map(result => result.data.cart.items.filter(item => !!item)), map(items => items.map(item => transformMagentoCartItem(daffTransformMagentoCartItem(item), item, this.cartItemTransforms))));
1592
+ }).pipe(map(result => result.data.cart.items.filter(item => !!item)), map(items => items.map(item => transformMagentoCartItem(daffTransformMagentoCartItem(item), item, this.cartItemTransforms))), catchError(error => throwError(() => transformCartMagentoError(error))));
1593
1593
  }
1594
1594
  get(cartId, itemId) {
1595
1595
  return this.list(cartId).pipe(map(items => items.find(item => item.id === itemId)));
@@ -1625,7 +1625,7 @@ class DaffMagentoCartItemService {
1625
1625
  itemId,
1626
1626
  },
1627
1627
  fetchPolicy: 'network-only',
1628
- }).pipe(map(result => this.cartTransformer.transform(result.data.removeItemFromCart.cart)));
1628
+ }).pipe(map(result => this.cartTransformer.transform(result.data.removeItemFromCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1629
1629
  }
1630
1630
  addBundledProduct(cartId, cartItemInput) {
1631
1631
  return this.addCartItemRequest(cartId, transformCompositeCartItem(cartItemInput));
@@ -1687,7 +1687,7 @@ class DaffMagentoCartPaymentService {
1687
1687
  query: getSelectedPaymentMethod(this.extraCartFragments),
1688
1688
  variables: { cartId },
1689
1689
  fetchPolicy: 'network-only',
1690
- }).pipe(map(result => this.paymentTransformer.transform(result.data.cart.selected_payment_method)));
1690
+ }).pipe(map(result => this.paymentTransformer.transform(result.data.cart.selected_payment_method)), catchError(error => throwError(() => transformCartMagentoError(error))));
1691
1691
  }
1692
1692
  update(cartId, payment, billingAddress) {
1693
1693
  return billingAddress
@@ -1699,7 +1699,7 @@ class DaffMagentoCartPaymentService {
1699
1699
  payment: this.paymentInputTransformer.transform(payment),
1700
1700
  },
1701
1701
  fetchPolicy: 'network-only',
1702
- }).pipe(map(result => this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart)));
1702
+ }).pipe(map(result => this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1703
1703
  }
1704
1704
  updateWithBilling(cartId, payment, address) {
1705
1705
  return address.email
@@ -1714,7 +1714,7 @@ class DaffMagentoCartPaymentService {
1714
1714
  payment: { code: '' },
1715
1715
  },
1716
1716
  fetchPolicy: 'network-only',
1717
- }).pipe(map(() => undefined));
1717
+ }).pipe(map(() => undefined), catchError(error => throwError(() => transformCartMagentoError(error))));
1718
1718
  }
1719
1719
  updateWithBillingAddress(cartId, payment, address) {
1720
1720
  return this.mutationQueue.mutate({
@@ -1771,7 +1771,7 @@ class DaffMagentoCartPaymentMethodsService {
1771
1771
  query: listPaymentMethods(this.extraCartFragments),
1772
1772
  variables: { cartId },
1773
1773
  fetchPolicy: 'network-only',
1774
- }).pipe(map(result => result.data.cart.available_payment_methods.map(item => this.paymentTransformer.transform(item))));
1774
+ }).pipe(map(result => result.data.cart.available_payment_methods.map(item => this.paymentTransformer.transform(item))), catchError(error => throwError(() => transformCartMagentoError(error))));
1775
1775
  }
1776
1776
  }
1777
1777
  /** @nocollapse */ DaffMagentoCartPaymentMethodsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMagentoCartPaymentMethodsService, deps: [{ token: i1.Apollo }, { token: DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS }, { token: DaffMagentoCartPaymentTransformer }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1862,7 +1862,7 @@ class DaffMagentoCartBillingAddressService {
1862
1862
  ...result.data.cart.billing_address,
1863
1863
  email: result.data.cart.email,
1864
1864
  })
1865
- : null));
1865
+ : null), catchError(error => throwError(() => transformCartMagentoError(error))));
1866
1866
  }
1867
1867
  update(cartId, address) {
1868
1868
  return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
@@ -1931,7 +1931,7 @@ class DaffMagentoCartShippingAddressService {
1931
1931
  ...result.data.cart.shipping_addresses[0],
1932
1932
  email: result.data.cart.email,
1933
1933
  })
1934
- : null));
1934
+ : null), catchError(error => throwError(() => transformCartMagentoError(error))));
1935
1935
  }
1936
1936
  update(cartId, address) {
1937
1937
  return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
@@ -1992,7 +1992,7 @@ class DaffMagentoCartShippingMethodsService {
1992
1992
  query: listShippingMethods(this.extraCartFragments),
1993
1993
  variables: { cartId },
1994
1994
  fetchPolicy: 'network-only',
1995
- }).pipe(map(result => result.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item))));
1995
+ }).pipe(map(result => result.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item))), catchError(error => throwError(() => transformCartMagentoError(error))));
1996
1996
  }
1997
1997
  }
1998
1998
  /** @nocollapse */ DaffMagentoCartShippingMethodsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMagentoCartShippingMethodsService, deps: [{ token: i1.Apollo }, { token: DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS }, { token: DaffMagentoCartShippingRateTransformer }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -2028,7 +2028,7 @@ class DaffMagentoCartShippingInformationService {
2028
2028
  fetchPolicy: 'network-only',
2029
2029
  }).pipe(map(result => result.data.cart.shipping_addresses[0]
2030
2030
  ? this.shippingRateTransformer.transform(result.data.cart.shipping_addresses[0].selected_shipping_method)
2031
- : null));
2031
+ : null), catchError(error => throwError(() => transformCartMagentoError(error))));
2032
2032
  }
2033
2033
  update(cartId, shippingInfo) {
2034
2034
  return this.mutationQueue.mutate({
@@ -2049,7 +2049,7 @@ class DaffMagentoCartShippingInformationService {
2049
2049
  }).pipe(map(shippingMethods => ({
2050
2050
  ...this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart),
2051
2051
  available_shipping_methods: shippingMethods.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item)),
2052
- })))));
2052
+ })))), catchError(error => throwError(() => transformCartMagentoError(error))));
2053
2053
  }
2054
2054
  delete(cartId, id) {
2055
2055
  return this.mutationQueue.mutate({
@@ -2061,7 +2061,7 @@ class DaffMagentoCartShippingInformationService {
2061
2061
  method_code: '',
2062
2062
  },
2063
2063
  },
2064
- }).pipe(map(result => this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)));
2064
+ }).pipe(map(result => this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
2065
2065
  }
2066
2066
  }
2067
2067
  /** @nocollapse */ DaffMagentoCartShippingInformationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMagentoCartShippingInformationService, deps: [{ token: i1.Apollo }, { token: DAFF_MAGENTO_CART_MUTATION_QUEUE }, { token: DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS }, { token: DaffMagentoCartTransformer }, { token: DaffMagentoCartShippingRateTransformer }, { token: DaffMagentoShippingMethodInputTransformer }], target: i0.ɵɵFactoryTarget.Injectable });