@wix/auto_sdk_ecom_cart-v-2 1.0.0 → 1.0.1

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 (37) hide show
  1. package/build/cjs/index.d.ts +134 -147
  2. package/build/cjs/index.js +83 -90
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js +71 -78
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +110 -127
  8. package/build/cjs/meta.js +50 -50
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +134 -147
  11. package/build/es/index.mjs +82 -88
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +1 -1
  14. package/build/es/index.typings.mjs +70 -76
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +110 -127
  17. package/build/es/meta.mjs +49 -49
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +34 -32
  20. package/build/internal/cjs/index.js +83 -90
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +171 -182
  23. package/build/internal/cjs/index.typings.js +71 -78
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +110 -127
  26. package/build/internal/cjs/meta.js +50 -50
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +34 -32
  29. package/build/internal/es/index.mjs +82 -88
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +171 -182
  32. package/build/internal/es/index.typings.mjs +70 -76
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +110 -127
  35. package/build/internal/es/meta.mjs +49 -49
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -467,15 +467,15 @@ function getCheckoutUrl(payload) {
467
467
  }
468
468
  return __getCheckoutUrl;
469
469
  }
470
- function completeCheckout(payload) {
471
- function __completeCheckout({ host }) {
470
+ function placeOrder(payload) {
471
+ function __placeOrder({ host }) {
472
472
  const metadata = {
473
473
  entityFqdn: "wix.ecom.v2.cart",
474
474
  method: "POST",
475
- methodFqn: "wix.ecom.cart.v2.CartService.CompleteCheckout",
475
+ methodFqn: "wix.ecom.cart.v2.CartService.PlaceOrder",
476
476
  packageName: PACKAGE_NAME,
477
477
  url: resolveWixEcomCartV2CartServiceUrl({
478
- protoPath: "/v2/carts/{cartId}/complete-checkout",
478
+ protoPath: "/v2/carts/{cartId}/place-order",
479
479
  data: payload,
480
480
  host
481
481
  }),
@@ -483,7 +483,7 @@ function completeCheckout(payload) {
483
483
  };
484
484
  return metadata;
485
485
  }
486
- return __completeCheckout;
486
+ return __placeOrder;
487
487
  }
488
488
  function addLineItems(payload) {
489
489
  function __addLineItems({ host }) {
@@ -609,15 +609,15 @@ function removeLineItems(payload) {
609
609
  }
610
610
  return __removeLineItems;
611
611
  }
612
- function addDiscount(payload) {
613
- function __addDiscount({ host }) {
612
+ function updateLineItems(payload) {
613
+ function __updateLineItems({ host }) {
614
614
  const metadata = {
615
615
  entityFqdn: "wix.ecom.v2.cart",
616
616
  method: "POST",
617
- methodFqn: "wix.ecom.cart.v2.CartService.AddDiscount",
617
+ methodFqn: "wix.ecom.cart.v2.CartService.UpdateLineItems",
618
618
  packageName: PACKAGE_NAME,
619
619
  url: resolveWixEcomCartV2CartServiceUrl({
620
- protoPath: "/v2/carts/{cartId}/add-discount",
620
+ protoPath: "/v2/carts/{cartId}/update-line-items",
621
621
  data: payload,
622
622
  host
623
623
  }),
@@ -657,17 +657,17 @@ function addDiscount(payload) {
657
657
  };
658
658
  return metadata;
659
659
  }
660
- return __addDiscount;
660
+ return __updateLineItems;
661
661
  }
662
- function removeDiscount(payload) {
663
- function __removeDiscount({ host }) {
662
+ function addDiscount(payload) {
663
+ function __addDiscount({ host }) {
664
664
  const metadata = {
665
665
  entityFqdn: "wix.ecom.v2.cart",
666
666
  method: "POST",
667
- methodFqn: "wix.ecom.cart.v2.CartService.RemoveDiscount",
667
+ methodFqn: "wix.ecom.cart.v2.CartService.AddDiscount",
668
668
  packageName: PACKAGE_NAME,
669
669
  url: resolveWixEcomCartV2CartServiceUrl({
670
- protoPath: "/v2/carts/{cartId}/remove-discount",
670
+ protoPath: "/v2/carts/{cartId}/add-discount",
671
671
  data: payload,
672
672
  host
673
673
  }),
@@ -707,17 +707,17 @@ function removeDiscount(payload) {
707
707
  };
708
708
  return metadata;
709
709
  }
710
- return __removeDiscount;
710
+ return __addDiscount;
711
711
  }
712
- function addGiftCard(payload) {
713
- function __addGiftCard({ host }) {
712
+ function removeDiscount(payload) {
713
+ function __removeDiscount({ host }) {
714
714
  const metadata = {
715
715
  entityFqdn: "wix.ecom.v2.cart",
716
716
  method: "POST",
717
- methodFqn: "wix.ecom.cart.v2.CartService.AddGiftCard",
717
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveDiscount",
718
718
  packageName: PACKAGE_NAME,
719
719
  url: resolveWixEcomCartV2CartServiceUrl({
720
- protoPath: "/v2/carts/{cartId}/add-gift-card",
720
+ protoPath: "/v2/carts/{cartId}/remove-discount",
721
721
  data: payload,
722
722
  host
723
723
  }),
@@ -757,17 +757,17 @@ function addGiftCard(payload) {
757
757
  };
758
758
  return metadata;
759
759
  }
760
- return __addGiftCard;
760
+ return __removeDiscount;
761
761
  }
762
- function removeGiftCard(payload) {
763
- function __removeGiftCard({ host }) {
762
+ function addGiftCard(payload) {
763
+ function __addGiftCard({ host }) {
764
764
  const metadata = {
765
765
  entityFqdn: "wix.ecom.v2.cart",
766
766
  method: "POST",
767
- methodFqn: "wix.ecom.cart.v2.CartService.RemoveGiftCard",
767
+ methodFqn: "wix.ecom.cart.v2.CartService.AddGiftCard",
768
768
  packageName: PACKAGE_NAME,
769
769
  url: resolveWixEcomCartV2CartServiceUrl({
770
- protoPath: "/v2/carts/{cartId}/remove-gift-card",
770
+ protoPath: "/v2/carts/{cartId}/add-gift-card",
771
771
  data: payload,
772
772
  host
773
773
  }),
@@ -807,17 +807,17 @@ function removeGiftCard(payload) {
807
807
  };
808
808
  return metadata;
809
809
  }
810
- return __removeGiftCard;
810
+ return __addGiftCard;
811
811
  }
812
- function updateLineItems(payload) {
813
- function __updateLineItems({ host }) {
812
+ function removeGiftCard(payload) {
813
+ function __removeGiftCard({ host }) {
814
814
  const metadata = {
815
815
  entityFqdn: "wix.ecom.v2.cart",
816
816
  method: "POST",
817
- methodFqn: "wix.ecom.cart.v2.CartService.UpdateLineItems",
817
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveGiftCard",
818
818
  packageName: PACKAGE_NAME,
819
819
  url: resolveWixEcomCartV2CartServiceUrl({
820
- protoPath: "/v2/carts/{cartId}/update-line-items",
820
+ protoPath: "/v2/carts/{cartId}/remove-gift-card",
821
821
  data: payload,
822
822
  host
823
823
  }),
@@ -857,7 +857,7 @@ function updateLineItems(payload) {
857
857
  };
858
858
  return metadata;
859
859
  }
860
- return __updateLineItems;
860
+ return __removeGiftCard;
861
861
  }
862
862
  function markCartAsCompleted(payload) {
863
863
  function __markCartAsCompleted({ host }) {
@@ -991,10 +991,10 @@ var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
991
991
  })(TaxableAddressType || {});
992
992
  var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
993
993
  ItemStatus2["UNKNOWN_ITEM_STATUS"] = "UNKNOWN_ITEM_STATUS";
994
- ItemStatus2["AVAILABLE"] = "AVAILABLE";
995
- ItemStatus2["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
994
+ ItemStatus2["IN_STOCK"] = "IN_STOCK";
995
+ ItemStatus2["PARTIALLY_IN_STOCK"] = "PARTIALLY_IN_STOCK";
996
996
  ItemStatus2["OUT_OF_STOCK"] = "OUT_OF_STOCK";
997
- ItemStatus2["NOT_EXISTS"] = "NOT_EXISTS";
997
+ ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
998
998
  return ItemStatus2;
999
999
  })(ItemStatus || {});
1000
1000
  var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
@@ -1038,23 +1038,18 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
1038
1038
  ChannelType2["PAYPAL_AGENTIC_CHECKOUT"] = "PAYPAL_AGENTIC_CHECKOUT";
1039
1039
  return ChannelType2;
1040
1040
  })(ChannelType || {});
1041
- var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
1042
- WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
1043
- WeightUnit2["KG"] = "KG";
1044
- WeightUnit2["LB"] = "LB";
1045
- return WeightUnit2;
1046
- })(WeightUnit || {});
1047
1041
  var VatType = /* @__PURE__ */ ((VatType2) => {
1048
1042
  VatType2["UNSPECIFIED"] = "UNSPECIFIED";
1049
1043
  VatType2["CPF"] = "CPF";
1050
1044
  VatType2["CNPJ"] = "CNPJ";
1051
1045
  return VatType2;
1052
1046
  })(VatType || {});
1053
- var CartStatus = /* @__PURE__ */ ((CartStatus2) => {
1054
- CartStatus2["CREATED"] = "CREATED";
1055
- CartStatus2["CHECKOUT_COMPLETED"] = "CHECKOUT_COMPLETED";
1056
- return CartStatus2;
1057
- })(CartStatus || {});
1047
+ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
1048
+ WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
1049
+ WeightUnit2["KG"] = "KG";
1050
+ WeightUnit2["LB"] = "LB";
1051
+ return WeightUnit2;
1052
+ })(WeightUnit || {});
1058
1053
  var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
1059
1054
  CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
1060
1055
  CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
@@ -1465,7 +1460,7 @@ async function getCheckoutUrl2(cartId, options) {
1465
1460
  throw transformedError;
1466
1461
  }
1467
1462
  }
1468
- async function completeCheckout2(cartId, options) {
1463
+ async function placeOrder2(cartId, options) {
1469
1464
  const { httpClient, sideEffects } = arguments[2];
1470
1465
  const payload = renameKeysFromSDKRequestToRESTRequest({
1471
1466
  cartId,
@@ -1474,7 +1469,7 @@ async function completeCheckout2(cartId, options) {
1474
1469
  savePaymentMethod: options?.savePaymentMethod,
1475
1470
  delayCapture: options?.delayCapture
1476
1471
  });
1477
- const reqOpts = completeCheckout(payload);
1472
+ const reqOpts = placeOrder(payload);
1478
1473
  sideEffects?.onSiteCall?.();
1479
1474
  try {
1480
1475
  const result = await httpClient.request(reqOpts);
@@ -1614,13 +1609,13 @@ async function removeLineItems2(cartId, lineItemIds) {
1614
1609
  throw transformedError;
1615
1610
  }
1616
1611
  }
1617
- async function addDiscount2(cartId, couponCode) {
1612
+ async function updateLineItems2(cartId, options) {
1618
1613
  const { httpClient, sideEffects } = arguments[2];
1619
1614
  const payload = renameKeysFromSDKRequestToRESTRequest({
1620
1615
  cartId,
1621
- couponCode
1616
+ lineItems: options?.lineItems
1622
1617
  });
1623
- const reqOpts = addDiscount(payload);
1618
+ const reqOpts = updateLineItems(payload);
1624
1619
  sideEffects?.onSiteCall?.();
1625
1620
  try {
1626
1621
  const result = await httpClient.request(reqOpts);
@@ -1652,22 +1647,25 @@ async function addDiscount2(cartId, couponCode) {
1652
1647
  err,
1653
1648
  {
1654
1649
  spreadPathsToArguments: {},
1655
- explicitPathsToArguments: { cartId: "$[0]", couponCode: "$[1]" },
1650
+ explicitPathsToArguments: {
1651
+ cartId: "$[0]",
1652
+ lineItems: "$[1].lineItems"
1653
+ },
1656
1654
  singleArgumentUnchanged: false
1657
1655
  },
1658
- ["cartId", "couponCode"]
1656
+ ["cartId", "options"]
1659
1657
  );
1660
1658
  sideEffects?.onError?.(err);
1661
1659
  throw transformedError;
1662
1660
  }
1663
1661
  }
1664
- async function removeDiscount2(cartId, discountId) {
1662
+ async function addDiscount2(cartId, couponCode) {
1665
1663
  const { httpClient, sideEffects } = arguments[2];
1666
1664
  const payload = renameKeysFromSDKRequestToRESTRequest({
1667
1665
  cartId,
1668
- discountId
1666
+ couponCode
1669
1667
  });
1670
- const reqOpts = removeDiscount(payload);
1668
+ const reqOpts = addDiscount(payload);
1671
1669
  sideEffects?.onSiteCall?.();
1672
1670
  try {
1673
1671
  const result = await httpClient.request(reqOpts);
@@ -1699,22 +1697,22 @@ async function removeDiscount2(cartId, discountId) {
1699
1697
  err,
1700
1698
  {
1701
1699
  spreadPathsToArguments: {},
1702
- explicitPathsToArguments: { cartId: "$[0]", discountId: "$[1]" },
1700
+ explicitPathsToArguments: { cartId: "$[0]", couponCode: "$[1]" },
1703
1701
  singleArgumentUnchanged: false
1704
1702
  },
1705
- ["cartId", "discountId"]
1703
+ ["cartId", "couponCode"]
1706
1704
  );
1707
1705
  sideEffects?.onError?.(err);
1708
1706
  throw transformedError;
1709
1707
  }
1710
1708
  }
1711
- async function addGiftCard2(cartId, giftCardCode) {
1709
+ async function removeDiscount2(cartId, discountId) {
1712
1710
  const { httpClient, sideEffects } = arguments[2];
1713
1711
  const payload = renameKeysFromSDKRequestToRESTRequest({
1714
1712
  cartId,
1715
- giftCardCode
1713
+ discountId
1716
1714
  });
1717
- const reqOpts = addGiftCard(payload);
1715
+ const reqOpts = removeDiscount(payload);
1718
1716
  sideEffects?.onSiteCall?.();
1719
1717
  try {
1720
1718
  const result = await httpClient.request(reqOpts);
@@ -1746,22 +1744,22 @@ async function addGiftCard2(cartId, giftCardCode) {
1746
1744
  err,
1747
1745
  {
1748
1746
  spreadPathsToArguments: {},
1749
- explicitPathsToArguments: { cartId: "$[0]", giftCardCode: "$[1]" },
1747
+ explicitPathsToArguments: { cartId: "$[0]", discountId: "$[1]" },
1750
1748
  singleArgumentUnchanged: false
1751
1749
  },
1752
- ["cartId", "giftCardCode"]
1750
+ ["cartId", "discountId"]
1753
1751
  );
1754
1752
  sideEffects?.onError?.(err);
1755
1753
  throw transformedError;
1756
1754
  }
1757
1755
  }
1758
- async function removeGiftCard2(cartId, giftCardId) {
1756
+ async function addGiftCard2(cartId, giftCardCode) {
1759
1757
  const { httpClient, sideEffects } = arguments[2];
1760
1758
  const payload = renameKeysFromSDKRequestToRESTRequest({
1761
1759
  cartId,
1762
- giftCardId
1760
+ giftCardCode
1763
1761
  });
1764
- const reqOpts = removeGiftCard(payload);
1762
+ const reqOpts = addGiftCard(payload);
1765
1763
  sideEffects?.onSiteCall?.();
1766
1764
  try {
1767
1765
  const result = await httpClient.request(reqOpts);
@@ -1793,22 +1791,22 @@ async function removeGiftCard2(cartId, giftCardId) {
1793
1791
  err,
1794
1792
  {
1795
1793
  spreadPathsToArguments: {},
1796
- explicitPathsToArguments: { cartId: "$[0]", giftCardId: "$[1]" },
1794
+ explicitPathsToArguments: { cartId: "$[0]", giftCardCode: "$[1]" },
1797
1795
  singleArgumentUnchanged: false
1798
1796
  },
1799
- ["cartId", "giftCardId"]
1797
+ ["cartId", "giftCardCode"]
1800
1798
  );
1801
1799
  sideEffects?.onError?.(err);
1802
1800
  throw transformedError;
1803
1801
  }
1804
1802
  }
1805
- async function updateLineItems2(cartId, options) {
1803
+ async function removeGiftCard2(cartId, giftCardId) {
1806
1804
  const { httpClient, sideEffects } = arguments[2];
1807
1805
  const payload = renameKeysFromSDKRequestToRESTRequest({
1808
1806
  cartId,
1809
- lineItemUpdates: options?.lineItemUpdates
1807
+ giftCardId
1810
1808
  });
1811
- const reqOpts = updateLineItems(payload);
1809
+ const reqOpts = removeGiftCard(payload);
1812
1810
  sideEffects?.onSiteCall?.();
1813
1811
  try {
1814
1812
  const result = await httpClient.request(reqOpts);
@@ -1840,13 +1838,10 @@ async function updateLineItems2(cartId, options) {
1840
1838
  err,
1841
1839
  {
1842
1840
  spreadPathsToArguments: {},
1843
- explicitPathsToArguments: {
1844
- cartId: "$[0]",
1845
- lineItemUpdates: "$[1].lineItemUpdates"
1846
- },
1841
+ explicitPathsToArguments: { cartId: "$[0]", giftCardId: "$[1]" },
1847
1842
  singleArgumentUnchanged: false
1848
1843
  },
1849
- ["cartId", "options"]
1844
+ ["cartId", "giftCardId"]
1850
1845
  );
1851
1846
  sideEffects?.onError?.(err);
1852
1847
  throw transformedError;
@@ -1976,8 +1971,8 @@ function getCheckoutUrl3(httpClient) {
1976
1971
  { httpClient }
1977
1972
  );
1978
1973
  }
1979
- function completeCheckout3(httpClient) {
1980
- return (cartId, options) => completeCheckout2(
1974
+ function placeOrder3(httpClient) {
1975
+ return (cartId, options) => placeOrder2(
1981
1976
  cartId,
1982
1977
  options,
1983
1978
  // @ts-ignore
@@ -2000,6 +1995,14 @@ function removeLineItems3(httpClient) {
2000
1995
  { httpClient }
2001
1996
  );
2002
1997
  }
1998
+ function updateLineItems3(httpClient) {
1999
+ return (cartId, options) => updateLineItems2(
2000
+ cartId,
2001
+ options,
2002
+ // @ts-ignore
2003
+ { httpClient }
2004
+ );
2005
+ }
2003
2006
  function addDiscount3(httpClient) {
2004
2007
  return (cartId, couponCode) => addDiscount2(
2005
2008
  cartId,
@@ -2032,14 +2035,6 @@ function removeGiftCard3(httpClient) {
2032
2035
  { httpClient }
2033
2036
  );
2034
2037
  }
2035
- function updateLineItems3(httpClient) {
2036
- return (cartId, options) => updateLineItems2(
2037
- cartId,
2038
- options,
2039
- // @ts-ignore
2040
- { httpClient }
2041
- );
2042
- }
2043
2038
  function markCartAsCompleted3(httpClient) {
2044
2039
  return (cartId, options) => markCartAsCompleted2(
2045
2040
  cartId,
@@ -2065,19 +2060,18 @@ var deleteCart4 = /* @__PURE__ */ createRESTModule(deleteCart3);
2065
2060
  var refreshCart4 = /* @__PURE__ */ createRESTModule(refreshCart3);
2066
2061
  var calculateCart4 = /* @__PURE__ */ createRESTModule(calculateCart3);
2067
2062
  var getCheckoutUrl4 = /* @__PURE__ */ createRESTModule(getCheckoutUrl3);
2068
- var completeCheckout4 = /* @__PURE__ */ createRESTModule(completeCheckout3);
2063
+ var placeOrder4 = /* @__PURE__ */ createRESTModule(placeOrder3);
2069
2064
  var addLineItems4 = /* @__PURE__ */ createRESTModule(addLineItems3);
2070
2065
  var removeLineItems4 = /* @__PURE__ */ createRESTModule(removeLineItems3);
2066
+ var updateLineItems4 = /* @__PURE__ */ createRESTModule(updateLineItems3);
2071
2067
  var addDiscount4 = /* @__PURE__ */ createRESTModule(addDiscount3);
2072
2068
  var removeDiscount4 = /* @__PURE__ */ createRESTModule(removeDiscount3);
2073
2069
  var addGiftCard4 = /* @__PURE__ */ createRESTModule(addGiftCard3);
2074
2070
  var removeGiftCard4 = /* @__PURE__ */ createRESTModule(removeGiftCard3);
2075
- var updateLineItems4 = /* @__PURE__ */ createRESTModule(updateLineItems3);
2076
2071
  var markCartAsCompleted4 = /* @__PURE__ */ createRESTModule(markCartAsCompleted3);
2077
2072
  var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ createRESTModule(handleAsyncCheckoutCompletion3);
2078
2073
  export {
2079
2074
  CalculationComponent,
2080
- CartStatus,
2081
2075
  ChannelType,
2082
2076
  DescriptionLineType,
2083
2077
  DiscountScope,
@@ -2103,13 +2097,13 @@ export {
2103
2097
  addGiftCard4 as addGiftCard,
2104
2098
  addLineItems4 as addLineItems,
2105
2099
  calculateCart4 as calculateCart,
2106
- completeCheckout4 as completeCheckout,
2107
2100
  createCart4 as createCart,
2108
2101
  deleteCart4 as deleteCart,
2109
2102
  getCart4 as getCart,
2110
2103
  getCheckoutUrl4 as getCheckoutUrl,
2111
2104
  handleAsyncCheckoutCompletion4 as handleAsyncCheckoutCompletion,
2112
2105
  markCartAsCompleted4 as markCartAsCompleted,
2106
+ placeOrder4 as placeOrder,
2113
2107
  refreshCart4 as refreshCart,
2114
2108
  removeDiscount4 as removeDiscount,
2115
2109
  removeGiftCard4 as removeGiftCard,