@wix/auto_sdk_ecom_current-cart-v-2 1.0.26 → 1.0.27
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 +62 -8
- package/build/cjs/index.js +107 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +99 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +62 -9
- package/build/cjs/meta.js +69 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +62 -8
- package/build/es/index.mjs +106 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +98 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +62 -9
- package/build/es/meta.mjs +68 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +15 -4
- package/build/internal/cjs/index.js +107 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +74 -9
- package/build/internal/cjs/index.typings.js +99 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +62 -9
- package/build/internal/cjs/meta.js +69 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +15 -4
- package/build/internal/es/index.mjs +106 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +74 -9
- package/build/internal/es/index.typings.mjs +98 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +62 -9
- package/build/internal/es/meta.mjs +68 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ActionEvent, AddCouponRequest, AddCouponResponse, AddCouponToCurrentCartRequest, AddCouponToCurrentCartResponse, AddGiftCardRequest, AddGiftCardResponse, AddGiftCardToCurrentCartRequest, AddGiftCardToCurrentCartResponse, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartOptions, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartOptions, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationConfig, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, CarrierError, CarrierErrors, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, ConvertedMoney, Coupon, CreateCartRequest, CreateCartResponse, CreateCurrentCartOptions, CreateCurrentCartRequest, CreateCurrentCartResponse, CreatedBy, CreatedByIdOneOf, CustomContentReference, CustomField, 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, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, ExternalReference, FieldViolation, FileType, FileTypeWithLiterals, FreeTrialPeriod, FullAddressContactDetails, GetCartRequest, GetCartResponse, GetCheckoutURLRequest, GetCheckoutURLResponse, GetCurrentCartRequest, GetCurrentCartResponse, GiftCard, GiftCardSummary, Group, HandleAsyncCheckoutCompletionRequest, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, ItemAttributes, ItemDeliveryConfig, ItemDiscount, ItemModifier, ItemPaymentConfig, ItemPriceBreakdown, ItemPricingInfo, ItemQuantityInfo, ItemSource, ItemStatus, ItemStatusWithLiterals, ItemTaxConfig, ItemType, ItemTypeItemType, ItemTypeItemTypeDataOneOf, ItemTypeItemTypeWithLiterals, LegacyFields, LineItem, LineItemSummary, LineItemTax, LineItemUpdate, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, PlaceOrderRequest, PlaceOrderResponse, PlainTextValue, Policy, PriceDescription, PriceSummary, QuantityUpdate, RawHttpResponse, RedirectUrls, RefreshCartRequest, RefreshCartResponse, RefreshCurrentCartRequest, RefreshCurrentCartResponse, RemoveCouponFromCurrentCartRequest, RemoveCouponFromCurrentCartResponse, RemoveCouponRequest, RemoveCouponResponse, RemoveGiftCardFromCurrentCartRequest, RemoveGiftCardFromCurrentCartResponse, RemoveGiftCardRequest, RemoveGiftCardResponse, RemoveLineItemsFromCurrentCartRequest, RemoveLineItemsFromCurrentCartResponse, RemoveLineItemsRequest, RemoveLineItemsResponse, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedMembership, SelectedMembershipUpdate, ServiceProperties, Severity, SeverityWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetTargetTypeOneOf, Tax, TaxDetails, TaxInfo, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartOptions, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
|
|
1
|
+
export { ActionEvent, AddCouponRequest, AddCouponResponse, AddCouponToCurrentCartRequest, AddCouponToCurrentCartResponse, AddGiftCardRequest, AddGiftCardResponse, AddGiftCardToCurrentCartRequest, AddGiftCardToCurrentCartResponse, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartOptions, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartOptions, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationConfig, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, CarrierError, CarrierErrors, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, ConvertedMoney, Coupon, CreateCartRequest, CreateCartResponse, CreateCurrentCartOptions, CreateCurrentCartRequest, CreateCurrentCartResponse, CreatedBy, CreatedByIdOneOf, CustomContentReference, CustomField, CustomItemAttributes, CustomItemDeliveryConfig, CustomItemInput, CustomItemPaymentConfig, CustomItemPricingInfo, CustomItemQuantityInfo, CustomItemSource, CustomItemTaxConfig, CustomerInfo, CustomerInfoIdOneOf, DeleteCartRequest, DeleteCartResponse, DeleteCurrentCartRequest, DeleteCurrentCartResponse, DeliveryInfo, DeliveryMethod, DeliveryMethodInput, DeliverySummary, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Discount, DiscountBenefit, DiscountBenefitValueOneOf, DiscountScope, DiscountScopeWithLiterals, DiscountSource, DiscountSourceType, DiscountSourceTypeWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, ExternalReference, FieldViolation, FileType, FileTypeWithLiterals, FreeTrialPeriod, FullAddressContactDetails, GetCartRequest, GetCartResponse, GetCheckoutURLRequest, GetCheckoutURLResponse, GetCurrentCartRequest, GetCurrentCartResponse, GiftCard, GiftCardSummary, Group, HandleAsyncCheckoutCompletionRequest, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, ItemAttributes, ItemDeliveryConfig, ItemDiscount, ItemModifier, ItemPaymentConfig, ItemPriceBreakdown, ItemPricingInfo, ItemQuantityInfo, ItemSource, ItemStatus, ItemStatusWithLiterals, ItemTaxConfig, ItemType, ItemTypeItemType, ItemTypeItemTypeDataOneOf, ItemTypeItemTypeWithLiterals, LegacyFields, LineItem, LineItemSummary, LineItemTax, LineItemUpdate, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, PlaceOrderRequest, PlaceOrderResponse, PlainTextValue, Policy, PriceDescription, PriceSummary, QuantityUpdate, RawHttpResponse, RedirectUrls, RefreshCartRequest, RefreshCartResponse, RefreshCurrentCartRequest, RefreshCurrentCartResponse, RemoveCouponFromCurrentCartRequest, RemoveCouponFromCurrentCartResponse, RemoveCouponRequest, RemoveCouponResponse, RemoveGiftCardFromCurrentCartRequest, RemoveGiftCardFromCurrentCartResponse, RemoveGiftCardRequest, RemoveGiftCardResponse, RemoveLineItemsFromCurrentCartRequest, RemoveLineItemsFromCurrentCartResponse, RemoveLineItemsRequest, RemoveLineItemsResponse, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedMembership, SelectedMembershipUpdate, ServiceProperties, SetDeliveryMethodForCurrentCartRequest, SetDeliveryMethodForCurrentCartResponse, SetDeliveryMethodRequest, SetDeliveryMethodResponse, Severity, SeverityWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetTargetTypeOneOf, Tax, TaxDetails, TaxInfo, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UnmarkAsCurrentCartRequest, UnmarkAsCurrentCartResponse, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartOptions, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
|
|
@@ -702,6 +702,55 @@ function removeCouponFromCurrentCart(payload) {
|
|
|
702
702
|
}
|
|
703
703
|
return __removeCouponFromCurrentCart;
|
|
704
704
|
}
|
|
705
|
+
function setDeliveryMethodForCurrentCart(payload) {
|
|
706
|
+
function __setDeliveryMethodForCurrentCart({ host }) {
|
|
707
|
+
const metadata = {
|
|
708
|
+
entityFqdn: "wix.ecom.v2.cart",
|
|
709
|
+
method: "POST",
|
|
710
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.SetDeliveryMethodForCurrentCart",
|
|
711
|
+
packageName: PACKAGE_NAME,
|
|
712
|
+
migrationOptions: {
|
|
713
|
+
optInTransformResponse: true
|
|
714
|
+
},
|
|
715
|
+
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
716
|
+
protoPath: "/v2/carts/current/set-delivery-method",
|
|
717
|
+
data: payload,
|
|
718
|
+
host
|
|
719
|
+
}),
|
|
720
|
+
data: payload,
|
|
721
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
722
|
+
{
|
|
723
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
724
|
+
paths: [
|
|
725
|
+
{ path: "cart.createdDate" },
|
|
726
|
+
{ path: "cart.updatedDate" },
|
|
727
|
+
{
|
|
728
|
+
path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
|
|
732
|
+
}
|
|
733
|
+
]
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
737
|
+
paths: [
|
|
738
|
+
{
|
|
739
|
+
path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
|
|
740
|
+
},
|
|
741
|
+
{ path: "cart.lineItems.attributes.physicalProperties.weight" },
|
|
742
|
+
{ path: "cart.deliveryInfo.address.geocode.latitude" },
|
|
743
|
+
{ path: "cart.deliveryInfo.address.geocode.longitude" },
|
|
744
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.latitude" },
|
|
745
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.longitude" }
|
|
746
|
+
]
|
|
747
|
+
}
|
|
748
|
+
])
|
|
749
|
+
};
|
|
750
|
+
return metadata;
|
|
751
|
+
}
|
|
752
|
+
return __setDeliveryMethodForCurrentCart;
|
|
753
|
+
}
|
|
705
754
|
function addGiftCardToCurrentCart(payload) {
|
|
706
755
|
function __addGiftCardToCurrentCart({ host }) {
|
|
707
756
|
const metadata = {
|
|
@@ -974,6 +1023,7 @@ async function createCurrentCart2(cart, options) {
|
|
|
974
1023
|
catalogItems: options?.catalogItems,
|
|
975
1024
|
customItems: options?.customItems,
|
|
976
1025
|
couponCodes: options?.couponCodes,
|
|
1026
|
+
deliveryMethod: options?.deliveryMethod,
|
|
977
1027
|
giftCardCodes: options?.giftCardCodes
|
|
978
1028
|
}),
|
|
979
1029
|
[
|
|
@@ -1039,6 +1089,7 @@ async function createCurrentCart2(cart, options) {
|
|
|
1039
1089
|
catalogItems: "$[1].catalogItems",
|
|
1040
1090
|
customItems: "$[1].customItems",
|
|
1041
1091
|
couponCodes: "$[1].couponCodes",
|
|
1092
|
+
deliveryMethod: "$[1].deliveryMethod",
|
|
1042
1093
|
giftCardCodes: "$[1].giftCardCodes"
|
|
1043
1094
|
},
|
|
1044
1095
|
singleArgumentUnchanged: false
|
|
@@ -1524,6 +1575,52 @@ async function removeCouponFromCurrentCart2(couponId) {
|
|
|
1524
1575
|
throw transformedError;
|
|
1525
1576
|
}
|
|
1526
1577
|
}
|
|
1578
|
+
async function setDeliveryMethodForCurrentCart2(deliveryMethod) {
|
|
1579
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1580
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1581
|
+
deliveryMethod
|
|
1582
|
+
});
|
|
1583
|
+
const reqOpts = setDeliveryMethodForCurrentCart(payload);
|
|
1584
|
+
sideEffects?.onSiteCall?.();
|
|
1585
|
+
try {
|
|
1586
|
+
const result = await httpClient.request(reqOpts);
|
|
1587
|
+
sideEffects?.onSuccess?.(result);
|
|
1588
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1589
|
+
transformPaths2(result.data, [
|
|
1590
|
+
{
|
|
1591
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1592
|
+
paths: [
|
|
1593
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
1594
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
1595
|
+
]
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1599
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
transformFn: transformRESTAddressToSDKAddress,
|
|
1603
|
+
paths: [
|
|
1604
|
+
{ path: "cart.deliveryInfo.address" },
|
|
1605
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
1606
|
+
]
|
|
1607
|
+
}
|
|
1608
|
+
])
|
|
1609
|
+
);
|
|
1610
|
+
} catch (err) {
|
|
1611
|
+
const transformedError = sdkTransformError(
|
|
1612
|
+
err,
|
|
1613
|
+
{
|
|
1614
|
+
spreadPathsToArguments: {},
|
|
1615
|
+
explicitPathsToArguments: { deliveryMethod: "$[0]" },
|
|
1616
|
+
singleArgumentUnchanged: false
|
|
1617
|
+
},
|
|
1618
|
+
["deliveryMethod"]
|
|
1619
|
+
);
|
|
1620
|
+
sideEffects?.onError?.(err);
|
|
1621
|
+
throw transformedError;
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1527
1624
|
async function addGiftCardToCurrentCart2(giftCardCode) {
|
|
1528
1625
|
const { httpClient, sideEffects } = arguments[1];
|
|
1529
1626
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -1647,6 +1744,7 @@ export {
|
|
|
1647
1744
|
removeCouponFromCurrentCart2 as removeCouponFromCurrentCart,
|
|
1648
1745
|
removeGiftCardFromCurrentCart2 as removeGiftCardFromCurrentCart,
|
|
1649
1746
|
removeLineItemsFromCurrentCart2 as removeLineItemsFromCurrentCart,
|
|
1747
|
+
setDeliveryMethodForCurrentCart2 as setDeliveryMethodForCurrentCart,
|
|
1650
1748
|
updateCurrentCart2 as updateCurrentCart,
|
|
1651
1749
|
updateLineItemsInCurrentCart2 as updateLineItemsInCurrentCart
|
|
1652
1750
|
};
|