@wix/auto_sdk_ecom_current-cart-v-2 1.0.39 → 1.0.41

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.
@@ -1212,9 +1212,9 @@ async function createCurrentCart2(options) {
1212
1212
  cart: options?.cart,
1213
1213
  catalogItems: options?.catalogItems,
1214
1214
  customItems: options?.customItems,
1215
- couponCodes: options?.couponCodes,
1215
+ coupons: options?.coupons,
1216
1216
  deliveryMethod: options?.deliveryMethod,
1217
- giftCardCodes: options?.giftCardCodes
1217
+ giftCards: options?.giftCards
1218
1218
  }),
1219
1219
  [
1220
1220
  {
@@ -1278,9 +1278,9 @@ async function createCurrentCart2(options) {
1278
1278
  cart: "$[0].cart",
1279
1279
  catalogItems: "$[0].catalogItems",
1280
1280
  customItems: "$[0].customItems",
1281
- couponCodes: "$[0].couponCodes",
1281
+ coupons: "$[0].coupons",
1282
1282
  deliveryMethod: "$[0].deliveryMethod",
1283
- giftCardCodes: "$[0].giftCardCodes"
1283
+ giftCards: "$[0].giftCards"
1284
1284
  },
1285
1285
  singleArgumentUnchanged: false
1286
1286
  },
@@ -1675,11 +1675,9 @@ async function updateLineItemsInCurrentCart2(options) {
1675
1675
  throw transformedError;
1676
1676
  }
1677
1677
  }
1678
- async function addCouponToCurrentCart2(couponCode) {
1678
+ async function addCouponToCurrentCart2(coupon) {
1679
1679
  const { httpClient, sideEffects } = arguments[1];
1680
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1681
- couponCode
1682
- });
1680
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ coupon });
1683
1681
  const reqOpts = addCouponToCurrentCart(payload);
1684
1682
  sideEffects?.onSiteCall?.();
1685
1683
  try {
@@ -1712,10 +1710,10 @@ async function addCouponToCurrentCart2(couponCode) {
1712
1710
  err,
1713
1711
  {
1714
1712
  spreadPathsToArguments: {},
1715
- explicitPathsToArguments: { couponCode: "$[0]" },
1713
+ explicitPathsToArguments: { coupon: "$[0]" },
1716
1714
  singleArgumentUnchanged: false
1717
1715
  },
1718
- ["couponCode"]
1716
+ ["coupon"]
1719
1717
  );
1720
1718
  sideEffects?.onError?.(err);
1721
1719
  throw transformedError;
@@ -1811,11 +1809,9 @@ async function setDeliveryMethodForCurrentCart2(deliveryMethod) {
1811
1809
  throw transformedError;
1812
1810
  }
1813
1811
  }
1814
- async function addGiftCardToCurrentCart2(giftCardCode) {
1812
+ async function addGiftCardToCurrentCart2(giftCard) {
1815
1813
  const { httpClient, sideEffects } = arguments[1];
1816
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1817
- giftCardCode
1818
- });
1814
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ giftCard });
1819
1815
  const reqOpts = addGiftCardToCurrentCart(payload);
1820
1816
  sideEffects?.onSiteCall?.();
1821
1817
  try {
@@ -1848,10 +1844,10 @@ async function addGiftCardToCurrentCart2(giftCardCode) {
1848
1844
  err,
1849
1845
  {
1850
1846
  spreadPathsToArguments: {},
1851
- explicitPathsToArguments: { giftCardCode: "$[0]" },
1847
+ explicitPathsToArguments: { giftCard: "$[0]" },
1852
1848
  singleArgumentUnchanged: false
1853
1849
  },
1854
- ["giftCardCode"]
1850
+ ["giftCard"]
1855
1851
  );
1856
1852
  sideEffects?.onError?.(err);
1857
1853
  throw transformedError;
@@ -1966,8 +1962,8 @@ function updateLineItemsInCurrentCart3(httpClient) {
1966
1962
  );
1967
1963
  }
1968
1964
  function addCouponToCurrentCart3(httpClient) {
1969
- return (couponCode) => addCouponToCurrentCart2(
1970
- couponCode,
1965
+ return (coupon) => addCouponToCurrentCart2(
1966
+ coupon,
1971
1967
  // @ts-ignore
1972
1968
  { httpClient }
1973
1969
  );
@@ -1987,8 +1983,8 @@ function setDeliveryMethodForCurrentCart3(httpClient) {
1987
1983
  );
1988
1984
  }
1989
1985
  function addGiftCardToCurrentCart3(httpClient) {
1990
- return (giftCardCode) => addGiftCardToCurrentCart2(
1991
- giftCardCode,
1986
+ return (giftCard) => addGiftCardToCurrentCart2(
1987
+ giftCard,
1992
1988
  // @ts-ignore
1993
1989
  { httpClient }
1994
1990
  );