@wix/auto_sdk_ecom_current-cart-v-2 1.0.7 → 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 +116 -99
- 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 +102 -97
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +116 -99
- 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 +102 -97
- 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 +134 -121
- 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 +102 -97
- 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 +134 -121
- 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 +102 -97
- package/build/internal/es/meta.mjs +18 -18
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -625,15 +625,15 @@ function updateLineItemsInCurrentCart(payload) {
|
|
|
625
625
|
}
|
|
626
626
|
return __updateLineItemsInCurrentCart;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
function
|
|
628
|
+
function addCouponToCurrentCart(payload) {
|
|
629
|
+
function __addCouponToCurrentCart({ host }) {
|
|
630
630
|
const metadata = {
|
|
631
631
|
entityFqdn: "wix.ecom.v2.cart",
|
|
632
632
|
method: "POST",
|
|
633
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
633
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.AddCouponToCurrentCart",
|
|
634
634
|
packageName: PACKAGE_NAME,
|
|
635
635
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
636
|
-
protoPath: "/v2/carts/current/add-
|
|
636
|
+
protoPath: "/v2/carts/current/add-coupon",
|
|
637
637
|
data: payload,
|
|
638
638
|
host
|
|
639
639
|
}),
|
|
@@ -673,17 +673,17 @@ function addDiscountToCurrentCart(payload) {
|
|
|
673
673
|
};
|
|
674
674
|
return metadata;
|
|
675
675
|
}
|
|
676
|
-
return
|
|
676
|
+
return __addCouponToCurrentCart;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
function
|
|
678
|
+
function removeCouponFromCurrentCart(payload) {
|
|
679
|
+
function __removeCouponFromCurrentCart({ host }) {
|
|
680
680
|
const metadata = {
|
|
681
681
|
entityFqdn: "wix.ecom.v2.cart",
|
|
682
682
|
method: "POST",
|
|
683
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
683
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.RemoveCouponFromCurrentCart",
|
|
684
684
|
packageName: PACKAGE_NAME,
|
|
685
685
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
686
|
-
protoPath: "/v2/carts/current/remove-
|
|
686
|
+
protoPath: "/v2/carts/current/remove-coupon",
|
|
687
687
|
data: payload,
|
|
688
688
|
host
|
|
689
689
|
}),
|
|
@@ -723,7 +723,7 @@ function removeDiscountFromCurrentCart(payload) {
|
|
|
723
723
|
};
|
|
724
724
|
return metadata;
|
|
725
725
|
}
|
|
726
|
-
return
|
|
726
|
+
return __removeCouponFromCurrentCart;
|
|
727
727
|
}
|
|
728
728
|
function addGiftCardToCurrentCart(payload) {
|
|
729
729
|
function __addGiftCardToCurrentCart({ host }) {
|
|
@@ -889,27 +889,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
|
889
889
|
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
890
890
|
return ItemStatus2;
|
|
891
891
|
})(ItemStatus || {});
|
|
892
|
-
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
893
|
-
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
894
|
-
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
895
|
-
DiscountSourceType2["COUPON"] = "COUPON";
|
|
896
|
-
return DiscountSourceType2;
|
|
897
|
-
})(DiscountSourceType || {});
|
|
898
|
-
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
899
|
-
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
900
|
-
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
901
|
-
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
902
|
-
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
903
|
-
return DiscountScope2;
|
|
904
|
-
})(DiscountScope || {});
|
|
905
|
-
var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
|
|
906
|
-
DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
|
|
907
|
-
DiscountStatus2["ACTIVE"] = "ACTIVE";
|
|
908
|
-
DiscountStatus2["EXPIRED"] = "EXPIRED";
|
|
909
|
-
DiscountStatus2["DELETED"] = "DELETED";
|
|
910
|
-
DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
|
|
911
|
-
return DiscountStatus2;
|
|
912
|
-
})(DiscountStatus || {});
|
|
913
892
|
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
914
893
|
ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
915
894
|
ChannelType2["WEB"] = "WEB";
|
|
@@ -942,6 +921,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
942
921
|
WeightUnit2["LB"] = "LB";
|
|
943
922
|
return WeightUnit2;
|
|
944
923
|
})(WeightUnit || {});
|
|
924
|
+
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
925
|
+
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
926
|
+
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
927
|
+
DiscountSourceType2["COUPON"] = "COUPON";
|
|
928
|
+
return DiscountSourceType2;
|
|
929
|
+
})(DiscountSourceType || {});
|
|
930
|
+
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
931
|
+
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
932
|
+
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
933
|
+
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
934
|
+
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
935
|
+
return DiscountScope2;
|
|
936
|
+
})(DiscountScope || {});
|
|
945
937
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
946
938
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
947
939
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1478,12 +1470,12 @@ async function updateLineItemsInCurrentCart2(options) {
|
|
|
1478
1470
|
throw transformedError;
|
|
1479
1471
|
}
|
|
1480
1472
|
}
|
|
1481
|
-
async function
|
|
1473
|
+
async function addCouponToCurrentCart2(couponCode) {
|
|
1482
1474
|
const { httpClient, sideEffects } = arguments[1];
|
|
1483
1475
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1484
1476
|
couponCode
|
|
1485
1477
|
});
|
|
1486
|
-
const reqOpts =
|
|
1478
|
+
const reqOpts = addCouponToCurrentCart(payload);
|
|
1487
1479
|
sideEffects?.onSiteCall?.();
|
|
1488
1480
|
try {
|
|
1489
1481
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1524,12 +1516,10 @@ async function addDiscountToCurrentCart2(couponCode) {
|
|
|
1524
1516
|
throw transformedError;
|
|
1525
1517
|
}
|
|
1526
1518
|
}
|
|
1527
|
-
async function
|
|
1519
|
+
async function removeCouponFromCurrentCart2(couponId) {
|
|
1528
1520
|
const { httpClient, sideEffects } = arguments[1];
|
|
1529
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1530
|
-
|
|
1531
|
-
});
|
|
1532
|
-
const reqOpts = removeDiscountFromCurrentCart(payload);
|
|
1521
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ couponId });
|
|
1522
|
+
const reqOpts = removeCouponFromCurrentCart(payload);
|
|
1533
1523
|
sideEffects?.onSiteCall?.();
|
|
1534
1524
|
try {
|
|
1535
1525
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1561,10 +1551,10 @@ async function removeDiscountFromCurrentCart2(discountId) {
|
|
|
1561
1551
|
err,
|
|
1562
1552
|
{
|
|
1563
1553
|
spreadPathsToArguments: {},
|
|
1564
|
-
explicitPathsToArguments: {
|
|
1554
|
+
explicitPathsToArguments: { couponId: "$[0]" },
|
|
1565
1555
|
singleArgumentUnchanged: false
|
|
1566
1556
|
},
|
|
1567
|
-
["
|
|
1557
|
+
["couponId"]
|
|
1568
1558
|
);
|
|
1569
1559
|
sideEffects?.onError?.(err);
|
|
1570
1560
|
throw transformedError;
|
|
@@ -1668,7 +1658,6 @@ export {
|
|
|
1668
1658
|
DescriptionLineType,
|
|
1669
1659
|
DiscountScope,
|
|
1670
1660
|
DiscountSourceType,
|
|
1671
|
-
DiscountStatus,
|
|
1672
1661
|
ErrorCode,
|
|
1673
1662
|
FileType,
|
|
1674
1663
|
ItemStatus,
|
|
@@ -1685,7 +1674,7 @@ export {
|
|
|
1685
1674
|
VatType,
|
|
1686
1675
|
WebhookIdentityType,
|
|
1687
1676
|
WeightUnit,
|
|
1688
|
-
|
|
1677
|
+
addCouponToCurrentCart2 as addCouponToCurrentCart,
|
|
1689
1678
|
addGiftCardToCurrentCart2 as addGiftCardToCurrentCart,
|
|
1690
1679
|
addLineItemsToCurrentCart2 as addLineItemsToCurrentCart,
|
|
1691
1680
|
calculateCurrentCart2 as calculateCurrentCart,
|
|
@@ -1693,7 +1682,7 @@ export {
|
|
|
1693
1682
|
deleteCurrentCart2 as deleteCurrentCart,
|
|
1694
1683
|
getCurrentCart2 as getCurrentCart,
|
|
1695
1684
|
refreshCurrentCart2 as refreshCurrentCart,
|
|
1696
|
-
|
|
1685
|
+
removeCouponFromCurrentCart2 as removeCouponFromCurrentCart,
|
|
1697
1686
|
removeGiftCardFromCurrentCart2 as removeGiftCardFromCurrentCart,
|
|
1698
1687
|
removeLineItemsFromCurrentCart2 as removeLineItemsFromCurrentCart,
|
|
1699
1688
|
updateCurrentCart2 as updateCurrentCart,
|