@wix/auto_sdk_ecom_current-cart-v-2 1.0.8 → 1.0.10
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 +119 -101
- package/build/cjs/index.js +41 -53
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +34 -46
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +105 -99
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +119 -101
- package/build/es/index.mjs +39 -50
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +32 -43
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +105 -99
- 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 -53
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +137 -123
- package/build/internal/cjs/index.typings.js +34 -46
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +105 -99
- 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 -50
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +137 -123
- package/build/internal/es/index.typings.mjs +32 -43
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +105 -99
- 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
|
+
addCouponToCurrentCart: () => addCouponToCurrentCart2,
|
|
46
45
|
addGiftCardToCurrentCart: () => addGiftCardToCurrentCart2,
|
|
47
46
|
addLineItemsToCurrentCart: () => addLineItemsToCurrentCart2,
|
|
48
47
|
calculateCurrentCart: () => calculateCurrentCart2,
|
|
@@ -50,7 +49,7 @@ __export(index_typings_exports, {
|
|
|
50
49
|
deleteCurrentCart: () => deleteCurrentCart2,
|
|
51
50
|
getCurrentCart: () => getCurrentCart2,
|
|
52
51
|
refreshCurrentCart: () => refreshCurrentCart2,
|
|
53
|
-
|
|
52
|
+
removeCouponFromCurrentCart: () => removeCouponFromCurrentCart2,
|
|
54
53
|
removeGiftCardFromCurrentCart: () => removeGiftCardFromCurrentCart2,
|
|
55
54
|
removeLineItemsFromCurrentCart: () => removeLineItemsFromCurrentCart2,
|
|
56
55
|
updateCurrentCart: () => updateCurrentCart2,
|
|
@@ -682,15 +681,15 @@ function updateLineItemsInCurrentCart(payload) {
|
|
|
682
681
|
}
|
|
683
682
|
return __updateLineItemsInCurrentCart;
|
|
684
683
|
}
|
|
685
|
-
function
|
|
686
|
-
function
|
|
684
|
+
function addCouponToCurrentCart(payload) {
|
|
685
|
+
function __addCouponToCurrentCart({ host }) {
|
|
687
686
|
const metadata = {
|
|
688
687
|
entityFqdn: "wix.ecom.v2.cart",
|
|
689
688
|
method: "POST",
|
|
690
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
689
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.AddCouponToCurrentCart",
|
|
691
690
|
packageName: PACKAGE_NAME,
|
|
692
691
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
693
|
-
protoPath: "/v2/carts/current/add-
|
|
692
|
+
protoPath: "/v2/carts/current/add-coupon",
|
|
694
693
|
data: payload,
|
|
695
694
|
host
|
|
696
695
|
}),
|
|
@@ -730,17 +729,17 @@ function addDiscountToCurrentCart(payload) {
|
|
|
730
729
|
};
|
|
731
730
|
return metadata;
|
|
732
731
|
}
|
|
733
|
-
return
|
|
732
|
+
return __addCouponToCurrentCart;
|
|
734
733
|
}
|
|
735
|
-
function
|
|
736
|
-
function
|
|
734
|
+
function removeCouponFromCurrentCart(payload) {
|
|
735
|
+
function __removeCouponFromCurrentCart({ host }) {
|
|
737
736
|
const metadata = {
|
|
738
737
|
entityFqdn: "wix.ecom.v2.cart",
|
|
739
738
|
method: "POST",
|
|
740
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
739
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.RemoveCouponFromCurrentCart",
|
|
741
740
|
packageName: PACKAGE_NAME,
|
|
742
741
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
743
|
-
protoPath: "/v2/carts/current/remove-
|
|
742
|
+
protoPath: "/v2/carts/current/remove-coupon",
|
|
744
743
|
data: payload,
|
|
745
744
|
host
|
|
746
745
|
}),
|
|
@@ -780,7 +779,7 @@ function removeDiscountFromCurrentCart(payload) {
|
|
|
780
779
|
};
|
|
781
780
|
return metadata;
|
|
782
781
|
}
|
|
783
|
-
return
|
|
782
|
+
return __removeCouponFromCurrentCart;
|
|
784
783
|
}
|
|
785
784
|
function addGiftCardToCurrentCart(payload) {
|
|
786
785
|
function __addGiftCardToCurrentCart({ host }) {
|
|
@@ -946,27 +945,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
|
946
945
|
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
947
946
|
return ItemStatus2;
|
|
948
947
|
})(ItemStatus || {});
|
|
949
|
-
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
950
|
-
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
951
|
-
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
952
|
-
DiscountSourceType2["COUPON"] = "COUPON";
|
|
953
|
-
return DiscountSourceType2;
|
|
954
|
-
})(DiscountSourceType || {});
|
|
955
|
-
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
956
|
-
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
957
|
-
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
958
|
-
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
959
|
-
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
960
|
-
return DiscountScope2;
|
|
961
|
-
})(DiscountScope || {});
|
|
962
|
-
var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
|
|
963
|
-
DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
|
|
964
|
-
DiscountStatus2["ACTIVE"] = "ACTIVE";
|
|
965
|
-
DiscountStatus2["EXPIRED"] = "EXPIRED";
|
|
966
|
-
DiscountStatus2["DELETED"] = "DELETED";
|
|
967
|
-
DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
|
|
968
|
-
return DiscountStatus2;
|
|
969
|
-
})(DiscountStatus || {});
|
|
970
948
|
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
971
949
|
ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
972
950
|
ChannelType2["WEB"] = "WEB";
|
|
@@ -999,6 +977,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
999
977
|
WeightUnit2["LB"] = "LB";
|
|
1000
978
|
return WeightUnit2;
|
|
1001
979
|
})(WeightUnit || {});
|
|
980
|
+
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
981
|
+
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
982
|
+
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
983
|
+
DiscountSourceType2["COUPON"] = "COUPON";
|
|
984
|
+
return DiscountSourceType2;
|
|
985
|
+
})(DiscountSourceType || {});
|
|
986
|
+
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
987
|
+
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
988
|
+
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
989
|
+
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
990
|
+
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
991
|
+
return DiscountScope2;
|
|
992
|
+
})(DiscountScope || {});
|
|
1002
993
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
1003
994
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
1004
995
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1535,12 +1526,12 @@ async function updateLineItemsInCurrentCart2(options) {
|
|
|
1535
1526
|
throw transformedError;
|
|
1536
1527
|
}
|
|
1537
1528
|
}
|
|
1538
|
-
async function
|
|
1529
|
+
async function addCouponToCurrentCart2(couponCode) {
|
|
1539
1530
|
const { httpClient, sideEffects } = arguments[1];
|
|
1540
1531
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1541
1532
|
couponCode
|
|
1542
1533
|
});
|
|
1543
|
-
const reqOpts =
|
|
1534
|
+
const reqOpts = addCouponToCurrentCart(payload);
|
|
1544
1535
|
sideEffects?.onSiteCall?.();
|
|
1545
1536
|
try {
|
|
1546
1537
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1581,12 +1572,10 @@ async function addDiscountToCurrentCart2(couponCode) {
|
|
|
1581
1572
|
throw transformedError;
|
|
1582
1573
|
}
|
|
1583
1574
|
}
|
|
1584
|
-
async function
|
|
1575
|
+
async function removeCouponFromCurrentCart2(couponId) {
|
|
1585
1576
|
const { httpClient, sideEffects } = arguments[1];
|
|
1586
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1587
|
-
|
|
1588
|
-
});
|
|
1589
|
-
const reqOpts = removeDiscountFromCurrentCart(payload);
|
|
1577
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ couponId });
|
|
1578
|
+
const reqOpts = removeCouponFromCurrentCart(payload);
|
|
1590
1579
|
sideEffects?.onSiteCall?.();
|
|
1591
1580
|
try {
|
|
1592
1581
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1618,10 +1607,10 @@ async function removeDiscountFromCurrentCart2(discountId) {
|
|
|
1618
1607
|
err,
|
|
1619
1608
|
{
|
|
1620
1609
|
spreadPathsToArguments: {},
|
|
1621
|
-
explicitPathsToArguments: {
|
|
1610
|
+
explicitPathsToArguments: { couponId: "$[0]" },
|
|
1622
1611
|
singleArgumentUnchanged: false
|
|
1623
1612
|
},
|
|
1624
|
-
["
|
|
1613
|
+
["couponId"]
|
|
1625
1614
|
);
|
|
1626
1615
|
sideEffects?.onError?.(err);
|
|
1627
1616
|
throw transformedError;
|
|
@@ -1726,7 +1715,6 @@ async function removeGiftCardFromCurrentCart2(giftCardId) {
|
|
|
1726
1715
|
DescriptionLineType,
|
|
1727
1716
|
DiscountScope,
|
|
1728
1717
|
DiscountSourceType,
|
|
1729
|
-
DiscountStatus,
|
|
1730
1718
|
ErrorCode,
|
|
1731
1719
|
FileType,
|
|
1732
1720
|
ItemStatus,
|
|
@@ -1743,7 +1731,7 @@ async function removeGiftCardFromCurrentCart2(giftCardId) {
|
|
|
1743
1731
|
VatType,
|
|
1744
1732
|
WebhookIdentityType,
|
|
1745
1733
|
WeightUnit,
|
|
1746
|
-
|
|
1734
|
+
addCouponToCurrentCart,
|
|
1747
1735
|
addGiftCardToCurrentCart,
|
|
1748
1736
|
addLineItemsToCurrentCart,
|
|
1749
1737
|
calculateCurrentCart,
|
|
@@ -1751,7 +1739,7 @@ async function removeGiftCardFromCurrentCart2(giftCardId) {
|
|
|
1751
1739
|
deleteCurrentCart,
|
|
1752
1740
|
getCurrentCart,
|
|
1753
1741
|
refreshCurrentCart,
|
|
1754
|
-
|
|
1742
|
+
removeCouponFromCurrentCart,
|
|
1755
1743
|
removeGiftCardFromCurrentCart,
|
|
1756
1744
|
removeLineItemsFromCurrentCart,
|
|
1757
1745
|
updateCurrentCart,
|