@wix/auto_sdk_ecom_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 +109 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +100 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +64 -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 +108 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +99 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +64 -9
- package/build/es/meta.mjs +68 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +16 -4
- package/build/internal/cjs/index.js +109 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +76 -9
- package/build/internal/cjs/index.typings.js +100 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +64 -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 +16 -4
- package/build/internal/es/index.mjs +108 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +76 -9
- package/build/internal/es/index.typings.mjs +99 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +64 -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, AddLineItemsOptions, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartOptions, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationConfig, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, CarrierError, CarrierErrors, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, ConvertedMoney, Coupon, CreateCartOptions, CreateCartRequest, CreateCartResponse, 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, GetCheckoutUrlOptions, 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, MarkCartAsCompletedOptions, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, 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, 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, UpdateCart, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsOptions, 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, AddLineItemsOptions, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartOptions, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationConfig, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, CarrierError, CarrierErrors, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, ConvertedMoney, Coupon, CreateCartOptions, CreateCartRequest, CreateCartResponse, 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, GetCheckoutUrlOptions, 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, MarkCartAsCompletedOptions, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, 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, 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, UpdateCart, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsOptions, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
|
|
@@ -745,6 +745,55 @@ function removeCoupon(payload) {
|
|
|
745
745
|
}
|
|
746
746
|
return __removeCoupon;
|
|
747
747
|
}
|
|
748
|
+
function setDeliveryMethod(payload) {
|
|
749
|
+
function __setDeliveryMethod({ host }) {
|
|
750
|
+
const metadata = {
|
|
751
|
+
entityFqdn: "wix.ecom.v2.cart",
|
|
752
|
+
method: "POST",
|
|
753
|
+
methodFqn: "wix.ecom.cart.v2.CartService.SetDeliveryMethod",
|
|
754
|
+
packageName: PACKAGE_NAME,
|
|
755
|
+
migrationOptions: {
|
|
756
|
+
optInTransformResponse: true
|
|
757
|
+
},
|
|
758
|
+
url: resolveWixEcomCartV2CartServiceUrl({
|
|
759
|
+
protoPath: "/v2/carts/{cartId}/set-delivery-method",
|
|
760
|
+
data: payload,
|
|
761
|
+
host
|
|
762
|
+
}),
|
|
763
|
+
data: payload,
|
|
764
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
765
|
+
{
|
|
766
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
767
|
+
paths: [
|
|
768
|
+
{ path: "cart.createdDate" },
|
|
769
|
+
{ path: "cart.updatedDate" },
|
|
770
|
+
{
|
|
771
|
+
path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
|
|
775
|
+
}
|
|
776
|
+
]
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
780
|
+
paths: [
|
|
781
|
+
{
|
|
782
|
+
path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
|
|
783
|
+
},
|
|
784
|
+
{ path: "cart.lineItems.attributes.physicalProperties.weight" },
|
|
785
|
+
{ path: "cart.deliveryInfo.address.geocode.latitude" },
|
|
786
|
+
{ path: "cart.deliveryInfo.address.geocode.longitude" },
|
|
787
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.latitude" },
|
|
788
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.longitude" }
|
|
789
|
+
]
|
|
790
|
+
}
|
|
791
|
+
])
|
|
792
|
+
};
|
|
793
|
+
return metadata;
|
|
794
|
+
}
|
|
795
|
+
return __setDeliveryMethod;
|
|
796
|
+
}
|
|
748
797
|
function addGiftCard(payload) {
|
|
749
798
|
function __addGiftCard({ host }) {
|
|
750
799
|
const metadata = {
|
|
@@ -1093,6 +1142,7 @@ async function createCart2(options) {
|
|
|
1093
1142
|
catalogItems: options?.catalogItems,
|
|
1094
1143
|
customItems: options?.customItems,
|
|
1095
1144
|
couponCodes: options?.couponCodes,
|
|
1145
|
+
deliveryMethod: options?.deliveryMethod,
|
|
1096
1146
|
giftCardCodes: options?.giftCardCodes
|
|
1097
1147
|
}),
|
|
1098
1148
|
[
|
|
@@ -1158,6 +1208,7 @@ async function createCart2(options) {
|
|
|
1158
1208
|
catalogItems: "$[0].catalogItems",
|
|
1159
1209
|
customItems: "$[0].customItems",
|
|
1160
1210
|
couponCodes: "$[0].couponCodes",
|
|
1211
|
+
deliveryMethod: "$[0].deliveryMethod",
|
|
1161
1212
|
giftCardCodes: "$[0].giftCardCodes"
|
|
1162
1213
|
},
|
|
1163
1214
|
singleArgumentUnchanged: false
|
|
@@ -1722,6 +1773,53 @@ async function removeCoupon2(cartId, couponId) {
|
|
|
1722
1773
|
throw transformedError;
|
|
1723
1774
|
}
|
|
1724
1775
|
}
|
|
1776
|
+
async function setDeliveryMethod2(cartId, deliveryMethod) {
|
|
1777
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1778
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1779
|
+
cartId,
|
|
1780
|
+
deliveryMethod
|
|
1781
|
+
});
|
|
1782
|
+
const reqOpts = setDeliveryMethod(payload);
|
|
1783
|
+
sideEffects?.onSiteCall?.();
|
|
1784
|
+
try {
|
|
1785
|
+
const result = await httpClient.request(reqOpts);
|
|
1786
|
+
sideEffects?.onSuccess?.(result);
|
|
1787
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1788
|
+
transformPaths2(result.data, [
|
|
1789
|
+
{
|
|
1790
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1791
|
+
paths: [
|
|
1792
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
1793
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
1794
|
+
]
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1798
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
transformFn: transformRESTAddressToSDKAddress,
|
|
1802
|
+
paths: [
|
|
1803
|
+
{ path: "cart.deliveryInfo.address" },
|
|
1804
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
1805
|
+
]
|
|
1806
|
+
}
|
|
1807
|
+
])
|
|
1808
|
+
);
|
|
1809
|
+
} catch (err) {
|
|
1810
|
+
const transformedError = sdkTransformError(
|
|
1811
|
+
err,
|
|
1812
|
+
{
|
|
1813
|
+
spreadPathsToArguments: {},
|
|
1814
|
+
explicitPathsToArguments: { cartId: "$[0]", deliveryMethod: "$[1]" },
|
|
1815
|
+
singleArgumentUnchanged: false
|
|
1816
|
+
},
|
|
1817
|
+
["cartId", "deliveryMethod"]
|
|
1818
|
+
);
|
|
1819
|
+
sideEffects?.onError?.(err);
|
|
1820
|
+
throw transformedError;
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1725
1823
|
async function addGiftCard2(cartId, giftCardCode) {
|
|
1726
1824
|
const { httpClient, sideEffects } = arguments[2];
|
|
1727
1825
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -1921,6 +2019,7 @@ export {
|
|
|
1921
2019
|
removeCoupon2 as removeCoupon,
|
|
1922
2020
|
removeGiftCard2 as removeGiftCard,
|
|
1923
2021
|
removeLineItems2 as removeLineItems,
|
|
2022
|
+
setDeliveryMethod2 as setDeliveryMethod,
|
|
1924
2023
|
updateCart2 as updateCart,
|
|
1925
2024
|
updateLineItems2 as updateLineItems
|
|
1926
2025
|
};
|