@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.
@@ -1560,7 +1560,7 @@ class DaffMagentoCartItemService {
1560
1560
  query: listCartItems(this.extraCartFragments),
1561
1561
  variables: { cartId },
1562
1562
  fetchPolicy: 'network-only',
1563
- }).pipe(map(result => result.data.cart.items.filter(item => !!item)), map(items => items.map(item => transformMagentoCartItem(daffTransformMagentoCartItem(item), item, this.cartItemTransforms))));
1563
+ }).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))));
1564
1564
  }
1565
1565
  get(cartId, itemId) {
1566
1566
  return this.list(cartId).pipe(map(items => items.find(item => item.id === itemId)));
@@ -1593,7 +1593,7 @@ class DaffMagentoCartItemService {
1593
1593
  itemId,
1594
1594
  },
1595
1595
  fetchPolicy: 'network-only',
1596
- }).pipe(map(result => this.cartTransformer.transform(result.data.removeItemFromCart.cart)));
1596
+ }).pipe(map(result => this.cartTransformer.transform(result.data.removeItemFromCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1597
1597
  }
1598
1598
  addBundledProduct(cartId, cartItemInput) {
1599
1599
  return this.addCartItemRequest(cartId, transformCompositeCartItem(cartItemInput));
@@ -1657,7 +1657,7 @@ class DaffMagentoCartPaymentService {
1657
1657
  query: getSelectedPaymentMethod(this.extraCartFragments),
1658
1658
  variables: { cartId },
1659
1659
  fetchPolicy: 'network-only',
1660
- }).pipe(map(result => this.paymentTransformer.transform(result.data.cart.selected_payment_method)));
1660
+ }).pipe(map(result => this.paymentTransformer.transform(result.data.cart.selected_payment_method)), catchError(error => throwError(() => transformCartMagentoError(error))));
1661
1661
  }
1662
1662
  update(cartId, payment, billingAddress) {
1663
1663
  return billingAddress
@@ -1669,7 +1669,7 @@ class DaffMagentoCartPaymentService {
1669
1669
  payment: this.paymentInputTransformer.transform(payment),
1670
1670
  },
1671
1671
  fetchPolicy: 'network-only',
1672
- }).pipe(map(result => this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart)));
1672
+ }).pipe(map(result => this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1673
1673
  }
1674
1674
  updateWithBilling(cartId, payment, address) {
1675
1675
  return address.email
@@ -1684,7 +1684,7 @@ class DaffMagentoCartPaymentService {
1684
1684
  payment: { code: '' },
1685
1685
  },
1686
1686
  fetchPolicy: 'network-only',
1687
- }).pipe(map(() => undefined));
1687
+ }).pipe(map(() => undefined), catchError(error => throwError(() => transformCartMagentoError(error))));
1688
1688
  }
1689
1689
  updateWithBillingAddress(cartId, payment, address) {
1690
1690
  return this.mutationQueue.mutate({
@@ -1743,7 +1743,7 @@ class DaffMagentoCartPaymentMethodsService {
1743
1743
  query: listPaymentMethods(this.extraCartFragments),
1744
1744
  variables: { cartId },
1745
1745
  fetchPolicy: 'network-only',
1746
- }).pipe(map(result => result.data.cart.available_payment_methods.map(item => this.paymentTransformer.transform(item))));
1746
+ }).pipe(map(result => result.data.cart.available_payment_methods.map(item => this.paymentTransformer.transform(item))), catchError(error => throwError(() => transformCartMagentoError(error))));
1747
1747
  }
1748
1748
  }
1749
1749
  /** @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 });
@@ -1835,7 +1835,7 @@ class DaffMagentoCartBillingAddressService {
1835
1835
  fetchPolicy: 'network-only',
1836
1836
  }).pipe(map(result => result.data.cart.billing_address
1837
1837
  ? this.billingAddressTransformer.transform(Object.assign(Object.assign({}, result.data.cart.billing_address), { email: result.data.cart.email }))
1838
- : null));
1838
+ : null), catchError(error => throwError(() => transformCartMagentoError(error))));
1839
1839
  }
1840
1840
  update(cartId, address) {
1841
1841
  return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
@@ -1900,7 +1900,7 @@ class DaffMagentoCartShippingAddressService {
1900
1900
  fetchPolicy: 'network-only',
1901
1901
  }).pipe(map(result => result.data.cart.shipping_addresses[0]
1902
1902
  ? this.shippingAddressTransformer.transform(Object.assign(Object.assign({}, result.data.cart.shipping_addresses[0]), { email: result.data.cart.email }))
1903
- : null));
1903
+ : null), catchError(error => throwError(() => transformCartMagentoError(error))));
1904
1904
  }
1905
1905
  update(cartId, address) {
1906
1906
  return address.email ? this.updateAddressWithEmail(cartId, address) : this.updateAddress(cartId, address);
@@ -1960,7 +1960,7 @@ class DaffMagentoCartShippingMethodsService {
1960
1960
  query: listShippingMethods(this.extraCartFragments),
1961
1961
  variables: { cartId },
1962
1962
  fetchPolicy: 'network-only',
1963
- }).pipe(map(result => result.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item))));
1963
+ }).pipe(map(result => result.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item))), catchError(error => throwError(() => transformCartMagentoError(error))));
1964
1964
  }
1965
1965
  }
1966
1966
  /** @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 });
@@ -1998,7 +1998,7 @@ class DaffMagentoCartShippingInformationService {
1998
1998
  fetchPolicy: 'network-only',
1999
1999
  }).pipe(map(result => result.data.cart.shipping_addresses[0]
2000
2000
  ? this.shippingRateTransformer.transform(result.data.cart.shipping_addresses[0].selected_shipping_method)
2001
- : null));
2001
+ : null), catchError(error => throwError(() => transformCartMagentoError(error))));
2002
2002
  }
2003
2003
  update(cartId, shippingInfo) {
2004
2004
  return this.mutationQueue.mutate({
@@ -2016,7 +2016,7 @@ class DaffMagentoCartShippingInformationService {
2016
2016
  query: listShippingMethods(this.extraCartFragments),
2017
2017
  variables: { cartId },
2018
2018
  fetchPolicy: 'network-only',
2019
- }).pipe(map(shippingMethods => (Object.assign(Object.assign({}, this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)), { available_shipping_methods: shippingMethods.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item)) }))))));
2019
+ }).pipe(map(shippingMethods => (Object.assign(Object.assign({}, this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)), { available_shipping_methods: shippingMethods.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item)) }))))), catchError(error => throwError(() => transformCartMagentoError(error))));
2020
2020
  }
2021
2021
  delete(cartId, id) {
2022
2022
  return this.mutationQueue.mutate({
@@ -2028,7 +2028,7 @@ class DaffMagentoCartShippingInformationService {
2028
2028
  method_code: '',
2029
2029
  },
2030
2030
  },
2031
- }).pipe(map(result => this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)));
2031
+ }).pipe(map(result => this.cartTransformer.transform(result.data.setShippingMethodsOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
2032
2032
  }
2033
2033
  }
2034
2034
  /** @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 });