@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.
- package/build/cjs/index.d.ts +134 -147
- package/build/cjs/index.js +83 -90
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +71 -78
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +110 -127
- package/build/cjs/meta.js +50 -50
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +134 -147
- package/build/es/index.mjs +82 -88
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +70 -76
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +110 -127
- package/build/es/meta.mjs +49 -49
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +34 -32
- package/build/internal/cjs/index.js +83 -90
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +171 -182
- package/build/internal/cjs/index.typings.js +71 -78
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +110 -127
- package/build/internal/cjs/meta.js +50 -50
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +34 -32
- package/build/internal/es/index.mjs +82 -88
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +171 -182
- package/build/internal/es/index.typings.mjs +70 -76
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +110 -127
- package/build/internal/es/meta.mjs +49 -49
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ActionEvent, AddDiscountRequest, AddDiscountResponse, AddDiscountToCurrentCartRequest, AddDiscountToCurrentCartResponse, AddGiftCardRequest, AddGiftCardResponse, AddGiftCardToCurrentCartRequest, AddGiftCardToCurrentCartResponse, AddLineItemsOptions, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, CalculateCartOptions, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationComponent, CalculationComponentWithLiterals, CalculationConfig, CalculationError, Cart,
|
|
1
|
+
export { ActionEvent, AddDiscountRequest, AddDiscountResponse, AddDiscountToCurrentCartRequest, AddDiscountToCurrentCartResponse, AddGiftCardRequest, AddGiftCardResponse, AddGiftCardToCurrentCartRequest, AddGiftCardToCurrentCartResponse, AddLineItemsOptions, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartOptions, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationComponent, CalculationComponentWithLiterals, CalculationConfig, CalculationError, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Color, CreateCartOptions, CreateCartRequest, CreateCartResponse, CreateCurrentCartRequest, CreateCurrentCartResponse, CreatedBy, CreatedByIdOneOf, CustomContentReference, CustomItemAttributes, CustomItemDeliveryConfig, CustomItemInput, CustomItemPaymentConfig, CustomItemPricingInfo, CustomItemQuantityInfo, CustomItemSource, CustomItemTaxConfig, CustomerInfo, CustomerInfoIdOneOf, DeleteCartRequest, DeleteCartResponse, DeleteCurrentCartRequest, DeleteCurrentCartResponse, DeliveryInfo, DeliveryMethod, DeliverySummary, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Discount, DiscountBenefit, DiscountBenefitValueOneOf, DiscountScope, DiscountScopeWithLiterals, DiscountSource, DiscountSourceType, DiscountSourceTypeWithLiterals, DiscountStatus, DiscountStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ErrorCode, ErrorCodeWithLiterals, ExtendedFields, ExternalReference, FieldViolation, FileType, FileTypeWithLiterals, FreeTrialPeriod, FullAddressContactDetails, GetCartRequest, GetCartResponse, GetCheckoutURLRequest, GetCheckoutURLResponse, GetCheckoutUrlOptions, GetCurrentCartRequest, GetCurrentCartResponse, GiftCard, GiftCardSummary, Group, HandleAsyncCheckoutCompletionRequest, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, ItemAttributes, ItemDeliveryConfig, ItemModifier, ItemPaymentConfig, ItemPriceBreakdown, ItemPricingInfo, ItemQuantityInfo, ItemSource, ItemStatus, ItemStatusWithLiterals, ItemTaxConfig, ItemType, ItemTypeItemType, ItemTypeItemTypeDataOneOf, ItemTypeItemTypeWithLiterals, LineItem, LineItemSummary, LineItemTax, LineItemUpdate, MarkCartAsCompletedOptions, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, PlaceOrderOptions, PlaceOrderRequest, PlaceOrderResponse, PlainTextValue, Policy, PriceDescription, PriceSummary, QuantityUpdate, RawHttpResponse, RedirectUrls, RefreshCartRequest, RefreshCartResponse, RefreshCurrentCartRequest, RefreshCurrentCartResponse, RemoveDiscountFromCurrentCartRequest, RemoveDiscountFromCurrentCartResponse, RemoveDiscountRequest, RemoveDiscountResponse, RemoveGiftCardFromCurrentCartRequest, RemoveGiftCardFromCurrentCartResponse, RemoveGiftCardRequest, RemoveGiftCardResponse, RemoveLineItemsFromCurrentCartRequest, RemoveLineItemsFromCurrentCartResponse, RemoveLineItemsRequest, RemoveLineItemsResponse, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedMembership, SelectedMembershipUpdate, ServiceProperties, Severity, SeverityWithLiterals, StreetAddress, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetTargetTypeOneOf, Tax, TaxDetails, TaxInfo, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UpdateCart, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsOptions, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, V2SelectedMembership, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
|
|
@@ -467,15 +467,15 @@ function getCheckoutUrl(payload) {
|
|
|
467
467
|
}
|
|
468
468
|
return __getCheckoutUrl;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
471
|
-
function
|
|
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.
|
|
475
|
+
methodFqn: "wix.ecom.cart.v2.CartService.PlaceOrder",
|
|
476
476
|
packageName: PACKAGE_NAME,
|
|
477
477
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
478
|
-
protoPath: "/v2/carts/{cartId}/
|
|
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
|
|
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
|
|
613
|
-
function
|
|
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.
|
|
617
|
+
methodFqn: "wix.ecom.cart.v2.CartService.UpdateLineItems",
|
|
618
618
|
packageName: PACKAGE_NAME,
|
|
619
619
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
620
|
-
protoPath: "/v2/carts/{cartId}/
|
|
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
|
|
660
|
+
return __updateLineItems;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
function
|
|
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.
|
|
667
|
+
methodFqn: "wix.ecom.cart.v2.CartService.AddDiscount",
|
|
668
668
|
packageName: PACKAGE_NAME,
|
|
669
669
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
670
|
-
protoPath: "/v2/carts/{cartId}/
|
|
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
|
|
710
|
+
return __addDiscount;
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
function
|
|
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.
|
|
717
|
+
methodFqn: "wix.ecom.cart.v2.CartService.RemoveDiscount",
|
|
718
718
|
packageName: PACKAGE_NAME,
|
|
719
719
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
720
|
-
protoPath: "/v2/carts/{cartId}/
|
|
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
|
|
760
|
+
return __removeDiscount;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
function
|
|
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.
|
|
767
|
+
methodFqn: "wix.ecom.cart.v2.CartService.AddGiftCard",
|
|
768
768
|
packageName: PACKAGE_NAME,
|
|
769
769
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
770
|
-
protoPath: "/v2/carts/{cartId}/
|
|
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
|
|
810
|
+
return __addGiftCard;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
function
|
|
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.
|
|
817
|
+
methodFqn: "wix.ecom.cart.v2.CartService.RemoveGiftCard",
|
|
818
818
|
packageName: PACKAGE_NAME,
|
|
819
819
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
820
|
-
protoPath: "/v2/carts/{cartId}/
|
|
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
|
|
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["
|
|
995
|
-
ItemStatus2["
|
|
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["
|
|
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
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
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
|
|
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 =
|
|
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
|
|
1612
|
+
async function updateLineItems2(cartId, options) {
|
|
1618
1613
|
const { httpClient, sideEffects } = arguments[2];
|
|
1619
1614
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1620
1615
|
cartId,
|
|
1621
|
-
|
|
1616
|
+
lineItems: options?.lineItems
|
|
1622
1617
|
});
|
|
1623
|
-
const reqOpts =
|
|
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: {
|
|
1650
|
+
explicitPathsToArguments: {
|
|
1651
|
+
cartId: "$[0]",
|
|
1652
|
+
lineItems: "$[1].lineItems"
|
|
1653
|
+
},
|
|
1656
1654
|
singleArgumentUnchanged: false
|
|
1657
1655
|
},
|
|
1658
|
-
["cartId", "
|
|
1656
|
+
["cartId", "options"]
|
|
1659
1657
|
);
|
|
1660
1658
|
sideEffects?.onError?.(err);
|
|
1661
1659
|
throw transformedError;
|
|
1662
1660
|
}
|
|
1663
1661
|
}
|
|
1664
|
-
async function
|
|
1662
|
+
async function addDiscount2(cartId, couponCode) {
|
|
1665
1663
|
const { httpClient, sideEffects } = arguments[2];
|
|
1666
1664
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1667
1665
|
cartId,
|
|
1668
|
-
|
|
1666
|
+
couponCode
|
|
1669
1667
|
});
|
|
1670
|
-
const reqOpts =
|
|
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]",
|
|
1700
|
+
explicitPathsToArguments: { cartId: "$[0]", couponCode: "$[1]" },
|
|
1703
1701
|
singleArgumentUnchanged: false
|
|
1704
1702
|
},
|
|
1705
|
-
["cartId", "
|
|
1703
|
+
["cartId", "couponCode"]
|
|
1706
1704
|
);
|
|
1707
1705
|
sideEffects?.onError?.(err);
|
|
1708
1706
|
throw transformedError;
|
|
1709
1707
|
}
|
|
1710
1708
|
}
|
|
1711
|
-
async function
|
|
1709
|
+
async function removeDiscount2(cartId, discountId) {
|
|
1712
1710
|
const { httpClient, sideEffects } = arguments[2];
|
|
1713
1711
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1714
1712
|
cartId,
|
|
1715
|
-
|
|
1713
|
+
discountId
|
|
1716
1714
|
});
|
|
1717
|
-
const reqOpts =
|
|
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]",
|
|
1747
|
+
explicitPathsToArguments: { cartId: "$[0]", discountId: "$[1]" },
|
|
1750
1748
|
singleArgumentUnchanged: false
|
|
1751
1749
|
},
|
|
1752
|
-
["cartId", "
|
|
1750
|
+
["cartId", "discountId"]
|
|
1753
1751
|
);
|
|
1754
1752
|
sideEffects?.onError?.(err);
|
|
1755
1753
|
throw transformedError;
|
|
1756
1754
|
}
|
|
1757
1755
|
}
|
|
1758
|
-
async function
|
|
1756
|
+
async function addGiftCard2(cartId, giftCardCode) {
|
|
1759
1757
|
const { httpClient, sideEffects } = arguments[2];
|
|
1760
1758
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1761
1759
|
cartId,
|
|
1762
|
-
|
|
1760
|
+
giftCardCode
|
|
1763
1761
|
});
|
|
1764
|
-
const reqOpts =
|
|
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]",
|
|
1794
|
+
explicitPathsToArguments: { cartId: "$[0]", giftCardCode: "$[1]" },
|
|
1797
1795
|
singleArgumentUnchanged: false
|
|
1798
1796
|
},
|
|
1799
|
-
["cartId", "
|
|
1797
|
+
["cartId", "giftCardCode"]
|
|
1800
1798
|
);
|
|
1801
1799
|
sideEffects?.onError?.(err);
|
|
1802
1800
|
throw transformedError;
|
|
1803
1801
|
}
|
|
1804
1802
|
}
|
|
1805
|
-
async function
|
|
1803
|
+
async function removeGiftCard2(cartId, giftCardId) {
|
|
1806
1804
|
const { httpClient, sideEffects } = arguments[2];
|
|
1807
1805
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1808
1806
|
cartId,
|
|
1809
|
-
|
|
1807
|
+
giftCardId
|
|
1810
1808
|
});
|
|
1811
|
-
const reqOpts =
|
|
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", "
|
|
1844
|
+
["cartId", "giftCardId"]
|
|
1850
1845
|
);
|
|
1851
1846
|
sideEffects?.onError?.(err);
|
|
1852
1847
|
throw transformedError;
|
|
@@ -1924,7 +1919,6 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
1924
1919
|
}
|
|
1925
1920
|
export {
|
|
1926
1921
|
CalculationComponent,
|
|
1927
|
-
CartStatus,
|
|
1928
1922
|
ChannelType,
|
|
1929
1923
|
DescriptionLineType,
|
|
1930
1924
|
DiscountScope,
|
|
@@ -1950,13 +1944,13 @@ export {
|
|
|
1950
1944
|
addGiftCard2 as addGiftCard,
|
|
1951
1945
|
addLineItems2 as addLineItems,
|
|
1952
1946
|
calculateCart2 as calculateCart,
|
|
1953
|
-
completeCheckout2 as completeCheckout,
|
|
1954
1947
|
createCart2 as createCart,
|
|
1955
1948
|
deleteCart2 as deleteCart,
|
|
1956
1949
|
getCart2 as getCart,
|
|
1957
1950
|
getCheckoutUrl2 as getCheckoutUrl,
|
|
1958
1951
|
handleAsyncCheckoutCompletion2 as handleAsyncCheckoutCompletion,
|
|
1959
1952
|
markCartAsCompleted2 as markCartAsCompleted,
|
|
1953
|
+
placeOrder2 as placeOrder,
|
|
1960
1954
|
refreshCart2 as refreshCart,
|
|
1961
1955
|
removeDiscount2 as removeDiscount,
|
|
1962
1956
|
removeGiftCard2 as removeGiftCard,
|