@wix/auto_sdk_ecom_cart-v-2 1.0.8 → 1.0.9
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.
- package/build/cjs/index.d.ts +118 -105
- package/build/cjs/index.js +41 -51
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +34 -44
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +101 -98
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +118 -105
- package/build/es/index.mjs +39 -48
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +32 -41
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +101 -98
- package/build/es/meta.mjs +18 -18
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +24 -28
- package/build/internal/cjs/index.js +41 -51
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +137 -128
- package/build/internal/cjs/index.typings.js +34 -44
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +101 -98
- package/build/internal/cjs/meta.js +20 -20
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +24 -28
- package/build/internal/es/index.mjs +39 -48
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +137 -128
- package/build/internal/es/index.typings.mjs +32 -41
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +101 -98
- package/build/internal/es/meta.mjs +18 -18
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -25,7 +25,6 @@ __export(index_typings_exports, {
|
|
|
25
25
|
DescriptionLineType: () => DescriptionLineType,
|
|
26
26
|
DiscountScope: () => DiscountScope,
|
|
27
27
|
DiscountSourceType: () => DiscountSourceType,
|
|
28
|
-
DiscountStatus: () => DiscountStatus,
|
|
29
28
|
ErrorCode: () => ErrorCode,
|
|
30
29
|
FileType: () => FileType,
|
|
31
30
|
ItemStatus: () => ItemStatus,
|
|
@@ -42,7 +41,7 @@ __export(index_typings_exports, {
|
|
|
42
41
|
VatType: () => VatType,
|
|
43
42
|
WebhookIdentityType: () => WebhookIdentityType,
|
|
44
43
|
WeightUnit: () => WeightUnit,
|
|
45
|
-
|
|
44
|
+
addCoupon: () => addCoupon2,
|
|
46
45
|
addGiftCard: () => addGiftCard2,
|
|
47
46
|
addLineItems: () => addLineItems2,
|
|
48
47
|
calculateCart: () => calculateCart2,
|
|
@@ -54,7 +53,7 @@ __export(index_typings_exports, {
|
|
|
54
53
|
markCartAsCompleted: () => markCartAsCompleted2,
|
|
55
54
|
placeOrder: () => placeOrder2,
|
|
56
55
|
refreshCart: () => refreshCart2,
|
|
57
|
-
|
|
56
|
+
removeCoupon: () => removeCoupon2,
|
|
58
57
|
removeGiftCard: () => removeGiftCard2,
|
|
59
58
|
removeLineItems: () => removeLineItems2,
|
|
60
59
|
updateCart: () => updateCart2,
|
|
@@ -723,15 +722,15 @@ function updateLineItems(payload) {
|
|
|
723
722
|
}
|
|
724
723
|
return __updateLineItems;
|
|
725
724
|
}
|
|
726
|
-
function
|
|
727
|
-
function
|
|
725
|
+
function addCoupon(payload) {
|
|
726
|
+
function __addCoupon({ host }) {
|
|
728
727
|
const metadata = {
|
|
729
728
|
entityFqdn: "wix.ecom.v2.cart",
|
|
730
729
|
method: "POST",
|
|
731
|
-
methodFqn: "wix.ecom.cart.v2.CartService.
|
|
730
|
+
methodFqn: "wix.ecom.cart.v2.CartService.AddCoupon",
|
|
732
731
|
packageName: PACKAGE_NAME,
|
|
733
732
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
734
|
-
protoPath: "/v2/carts/{cartId}/add-
|
|
733
|
+
protoPath: "/v2/carts/{cartId}/add-coupon",
|
|
735
734
|
data: payload,
|
|
736
735
|
host
|
|
737
736
|
}),
|
|
@@ -771,17 +770,17 @@ function addDiscount(payload) {
|
|
|
771
770
|
};
|
|
772
771
|
return metadata;
|
|
773
772
|
}
|
|
774
|
-
return
|
|
773
|
+
return __addCoupon;
|
|
775
774
|
}
|
|
776
|
-
function
|
|
777
|
-
function
|
|
775
|
+
function removeCoupon(payload) {
|
|
776
|
+
function __removeCoupon({ host }) {
|
|
778
777
|
const metadata = {
|
|
779
778
|
entityFqdn: "wix.ecom.v2.cart",
|
|
780
779
|
method: "POST",
|
|
781
|
-
methodFqn: "wix.ecom.cart.v2.CartService.
|
|
780
|
+
methodFqn: "wix.ecom.cart.v2.CartService.RemoveCoupon",
|
|
782
781
|
packageName: PACKAGE_NAME,
|
|
783
782
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
784
|
-
protoPath: "/v2/carts/{cartId}/remove-
|
|
783
|
+
protoPath: "/v2/carts/{cartId}/remove-coupon",
|
|
785
784
|
data: payload,
|
|
786
785
|
host
|
|
787
786
|
}),
|
|
@@ -821,7 +820,7 @@ function removeDiscount(payload) {
|
|
|
821
820
|
};
|
|
822
821
|
return metadata;
|
|
823
822
|
}
|
|
824
|
-
return
|
|
823
|
+
return __removeCoupon;
|
|
825
824
|
}
|
|
826
825
|
function addGiftCard(payload) {
|
|
827
826
|
function __addGiftCard({ host }) {
|
|
@@ -1061,27 +1060,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
|
1061
1060
|
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
1062
1061
|
return ItemStatus2;
|
|
1063
1062
|
})(ItemStatus || {});
|
|
1064
|
-
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
1065
|
-
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
1066
|
-
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
1067
|
-
DiscountSourceType2["COUPON"] = "COUPON";
|
|
1068
|
-
return DiscountSourceType2;
|
|
1069
|
-
})(DiscountSourceType || {});
|
|
1070
|
-
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
1071
|
-
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
1072
|
-
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
1073
|
-
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
1074
|
-
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
1075
|
-
return DiscountScope2;
|
|
1076
|
-
})(DiscountScope || {});
|
|
1077
|
-
var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
|
|
1078
|
-
DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
|
|
1079
|
-
DiscountStatus2["ACTIVE"] = "ACTIVE";
|
|
1080
|
-
DiscountStatus2["EXPIRED"] = "EXPIRED";
|
|
1081
|
-
DiscountStatus2["DELETED"] = "DELETED";
|
|
1082
|
-
DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
|
|
1083
|
-
return DiscountStatus2;
|
|
1084
|
-
})(DiscountStatus || {});
|
|
1085
1063
|
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
1086
1064
|
ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1087
1065
|
ChannelType2["WEB"] = "WEB";
|
|
@@ -1114,6 +1092,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
1114
1092
|
WeightUnit2["LB"] = "LB";
|
|
1115
1093
|
return WeightUnit2;
|
|
1116
1094
|
})(WeightUnit || {});
|
|
1095
|
+
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
1096
|
+
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
1097
|
+
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
1098
|
+
DiscountSourceType2["COUPON"] = "COUPON";
|
|
1099
|
+
return DiscountSourceType2;
|
|
1100
|
+
})(DiscountSourceType || {});
|
|
1101
|
+
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
1102
|
+
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
1103
|
+
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
1104
|
+
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
1105
|
+
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
1106
|
+
return DiscountScope2;
|
|
1107
|
+
})(DiscountScope || {});
|
|
1117
1108
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
1118
1109
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
1119
1110
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1723,13 +1714,13 @@ async function updateLineItems2(cartId, options) {
|
|
|
1723
1714
|
throw transformedError;
|
|
1724
1715
|
}
|
|
1725
1716
|
}
|
|
1726
|
-
async function
|
|
1717
|
+
async function addCoupon2(cartId, couponCode) {
|
|
1727
1718
|
const { httpClient, sideEffects } = arguments[2];
|
|
1728
1719
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1729
1720
|
cartId,
|
|
1730
1721
|
couponCode
|
|
1731
1722
|
});
|
|
1732
|
-
const reqOpts =
|
|
1723
|
+
const reqOpts = addCoupon(payload);
|
|
1733
1724
|
sideEffects?.onSiteCall?.();
|
|
1734
1725
|
try {
|
|
1735
1726
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1770,13 +1761,13 @@ async function addDiscount2(cartId, couponCode) {
|
|
|
1770
1761
|
throw transformedError;
|
|
1771
1762
|
}
|
|
1772
1763
|
}
|
|
1773
|
-
async function
|
|
1764
|
+
async function removeCoupon2(cartId, couponId) {
|
|
1774
1765
|
const { httpClient, sideEffects } = arguments[2];
|
|
1775
1766
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1776
1767
|
cartId,
|
|
1777
|
-
|
|
1768
|
+
couponId
|
|
1778
1769
|
});
|
|
1779
|
-
const reqOpts =
|
|
1770
|
+
const reqOpts = removeCoupon(payload);
|
|
1780
1771
|
sideEffects?.onSiteCall?.();
|
|
1781
1772
|
try {
|
|
1782
1773
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1808,10 +1799,10 @@ async function removeDiscount2(cartId, discountId) {
|
|
|
1808
1799
|
err,
|
|
1809
1800
|
{
|
|
1810
1801
|
spreadPathsToArguments: {},
|
|
1811
|
-
explicitPathsToArguments: { cartId: "$[0]",
|
|
1802
|
+
explicitPathsToArguments: { cartId: "$[0]", couponId: "$[1]" },
|
|
1812
1803
|
singleArgumentUnchanged: false
|
|
1813
1804
|
},
|
|
1814
|
-
["cartId", "
|
|
1805
|
+
["cartId", "couponId"]
|
|
1815
1806
|
);
|
|
1816
1807
|
sideEffects?.onError?.(err);
|
|
1817
1808
|
throw transformedError;
|
|
@@ -1988,7 +1979,6 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
1988
1979
|
DescriptionLineType,
|
|
1989
1980
|
DiscountScope,
|
|
1990
1981
|
DiscountSourceType,
|
|
1991
|
-
DiscountStatus,
|
|
1992
1982
|
ErrorCode,
|
|
1993
1983
|
FileType,
|
|
1994
1984
|
ItemStatus,
|
|
@@ -2005,7 +1995,7 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
2005
1995
|
VatType,
|
|
2006
1996
|
WebhookIdentityType,
|
|
2007
1997
|
WeightUnit,
|
|
2008
|
-
|
|
1998
|
+
addCoupon,
|
|
2009
1999
|
addGiftCard,
|
|
2010
2000
|
addLineItems,
|
|
2011
2001
|
calculateCart,
|
|
@@ -2017,7 +2007,7 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
2017
2007
|
markCartAsCompleted,
|
|
2018
2008
|
placeOrder,
|
|
2019
2009
|
refreshCart,
|
|
2020
|
-
|
|
2010
|
+
removeCoupon,
|
|
2021
2011
|
removeGiftCard,
|
|
2022
2012
|
removeLineItems,
|
|
2023
2013
|
updateCart,
|