@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
package/build/cjs/index.d.ts
CHANGED
|
@@ -1168,7 +1168,10 @@ type VatTypeWithLiterals = VatType | 'UNSPECIFIED' | 'CPF' | 'CNPJ';
|
|
|
1168
1168
|
interface DeliveryInfo {
|
|
1169
1169
|
/** The delivery address. */
|
|
1170
1170
|
address?: Address;
|
|
1171
|
-
/**
|
|
1171
|
+
/**
|
|
1172
|
+
* The selected delivery method by the customer.
|
|
1173
|
+
* @readonly
|
|
1174
|
+
*/
|
|
1172
1175
|
method?: DeliveryMethod;
|
|
1173
1176
|
/**
|
|
1174
1177
|
* The unit of weight measurement when shipping items (e.g., KG, LB).
|
|
@@ -1239,7 +1242,7 @@ interface DeliveryMethod {
|
|
|
1239
1242
|
/**
|
|
1240
1243
|
* Unique code that acts as an ID for a shipping rate.
|
|
1241
1244
|
* For example, `"usps_std_overnight"`.
|
|
1242
|
-
* @maxLength
|
|
1245
|
+
* @maxLength 100
|
|
1243
1246
|
*/
|
|
1244
1247
|
code?: string;
|
|
1245
1248
|
/**
|
|
@@ -1250,13 +1253,9 @@ interface DeliveryMethod {
|
|
|
1250
1253
|
/**
|
|
1251
1254
|
* Delivery rate title.
|
|
1252
1255
|
* For example, `"USPS Standard Overnight Delivery"`, `"Standard"`, or `"First-Class Package International"`.
|
|
1253
|
-
* @readonly
|
|
1254
1256
|
*/
|
|
1255
1257
|
title?: TranslatableString;
|
|
1256
|
-
/**
|
|
1257
|
-
* Whether the delivery method is a pickup option.
|
|
1258
|
-
* @readonly
|
|
1259
|
-
*/
|
|
1258
|
+
/** Whether the delivery method is a pickup option. */
|
|
1260
1259
|
pickup?: boolean;
|
|
1261
1260
|
}
|
|
1262
1261
|
declare enum WeightUnit {
|
|
@@ -1275,6 +1274,11 @@ interface TaxInfo {
|
|
|
1275
1274
|
* @readonly
|
|
1276
1275
|
*/
|
|
1277
1276
|
pricesIncludeTax?: boolean;
|
|
1277
|
+
/**
|
|
1278
|
+
* Tax exempt group ID to use for tax exemptions.
|
|
1279
|
+
* @format GUID
|
|
1280
|
+
*/
|
|
1281
|
+
taxExemptGroupId?: string | null;
|
|
1278
1282
|
}
|
|
1279
1283
|
interface PaymentInfo {
|
|
1280
1284
|
/**
|
|
@@ -1468,6 +1472,11 @@ interface CartSummary {
|
|
|
1468
1472
|
* @format GUID
|
|
1469
1473
|
*/
|
|
1470
1474
|
cartId?: string;
|
|
1475
|
+
/**
|
|
1476
|
+
* A unique identifier for this specific cart calculation.
|
|
1477
|
+
* @format GUID
|
|
1478
|
+
*/
|
|
1479
|
+
calculationId?: string;
|
|
1471
1480
|
/**
|
|
1472
1481
|
* Summarized details for each line item in the cart.
|
|
1473
1482
|
* @maxSize 300
|
|
@@ -2000,6 +2009,8 @@ interface CreateCurrentCartRequest {
|
|
|
2000
2009
|
* @maxLength 50
|
|
2001
2010
|
*/
|
|
2002
2011
|
couponCodes?: string[];
|
|
2012
|
+
/** Delivery method to set. */
|
|
2013
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2003
2014
|
/**
|
|
2004
2015
|
* Gift cards to add.
|
|
2005
2016
|
* Currently only one is support.
|
|
@@ -2171,6 +2182,18 @@ interface CustomItemPaymentConfig {
|
|
|
2171
2182
|
*/
|
|
2172
2183
|
paymentOption?: PaymentOptionTypeWithLiterals;
|
|
2173
2184
|
}
|
|
2185
|
+
interface DeliveryMethodInput {
|
|
2186
|
+
/**
|
|
2187
|
+
* Delivery method code.
|
|
2188
|
+
* @maxLength 100
|
|
2189
|
+
*/
|
|
2190
|
+
code?: string;
|
|
2191
|
+
/**
|
|
2192
|
+
* Carrier app id.
|
|
2193
|
+
* @format GUID
|
|
2194
|
+
*/
|
|
2195
|
+
appId?: string | null;
|
|
2196
|
+
}
|
|
2174
2197
|
interface CreateCurrentCartResponse {
|
|
2175
2198
|
/** The created Cart. */
|
|
2176
2199
|
cart?: Cart;
|
|
@@ -2350,6 +2373,14 @@ interface RemoveCouponFromCurrentCartResponse {
|
|
|
2350
2373
|
/** Updated Cart. */
|
|
2351
2374
|
cart?: Cart;
|
|
2352
2375
|
}
|
|
2376
|
+
interface SetDeliveryMethodForCurrentCartRequest {
|
|
2377
|
+
/** Delivery method. */
|
|
2378
|
+
deliveryMethod: DeliveryMethodInput;
|
|
2379
|
+
}
|
|
2380
|
+
interface SetDeliveryMethodForCurrentCartResponse {
|
|
2381
|
+
/** Updated Cart. */
|
|
2382
|
+
cart?: Cart;
|
|
2383
|
+
}
|
|
2353
2384
|
interface AddGiftCardToCurrentCartRequest {
|
|
2354
2385
|
/**
|
|
2355
2386
|
* Gift card code.
|
|
@@ -2374,6 +2405,12 @@ interface RemoveGiftCardFromCurrentCartResponse {
|
|
|
2374
2405
|
/** Updated Cart. */
|
|
2375
2406
|
cart?: Cart;
|
|
2376
2407
|
}
|
|
2408
|
+
interface UnmarkAsCurrentCartRequest {
|
|
2409
|
+
}
|
|
2410
|
+
interface UnmarkAsCurrentCartResponse {
|
|
2411
|
+
/** Cart that was unmarked as current cart, if such existed. */
|
|
2412
|
+
cart?: Cart;
|
|
2413
|
+
}
|
|
2377
2414
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
2378
2415
|
createdEvent?: EntityCreatedEvent;
|
|
2379
2416
|
updatedEvent?: EntityUpdatedEvent;
|
|
@@ -2533,6 +2570,8 @@ interface CreateCartRequest {
|
|
|
2533
2570
|
* @maxLength 50
|
|
2534
2571
|
*/
|
|
2535
2572
|
couponCodes?: string[];
|
|
2573
|
+
/** Delivery method to set. */
|
|
2574
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2536
2575
|
/**
|
|
2537
2576
|
* Gift cards to add.
|
|
2538
2577
|
* Currently only one is support.
|
|
@@ -2793,6 +2832,19 @@ interface RemoveCouponResponse {
|
|
|
2793
2832
|
/** Updated Cart. */
|
|
2794
2833
|
cart?: Cart;
|
|
2795
2834
|
}
|
|
2835
|
+
interface SetDeliveryMethodRequest {
|
|
2836
|
+
/**
|
|
2837
|
+
* Cart ID.
|
|
2838
|
+
* @format GUID
|
|
2839
|
+
*/
|
|
2840
|
+
cartId?: string;
|
|
2841
|
+
/** Delivery method. */
|
|
2842
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2843
|
+
}
|
|
2844
|
+
interface SetDeliveryMethodResponse {
|
|
2845
|
+
/** Updated Cart. */
|
|
2846
|
+
cart?: Cart;
|
|
2847
|
+
}
|
|
2796
2848
|
interface AddGiftCardRequest {
|
|
2797
2849
|
/**
|
|
2798
2850
|
* Cart ID.
|
|
@@ -2885,6 +2937,8 @@ interface CreateCurrentCartOptions {
|
|
|
2885
2937
|
* @maxLength 50
|
|
2886
2938
|
*/
|
|
2887
2939
|
couponCodes?: string[];
|
|
2940
|
+
/** Delivery method to set. */
|
|
2941
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2888
2942
|
/**
|
|
2889
2943
|
* Gift cards to add.
|
|
2890
2944
|
* Currently only one is support.
|
|
@@ -2933,4 +2987,4 @@ interface UpdateLineItemsInCurrentCartOptions {
|
|
|
2933
2987
|
lineItems?: LineItemUpdate[];
|
|
2934
2988
|
}
|
|
2935
2989
|
|
|
2936
|
-
export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartOptions, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartOptions, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CarrierError, type CarrierErrors, type Cart, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, type Color, type ConvertedMoney, type Coupon, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartOptions, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryInfo, type DeliveryMethod, type DeliverySummary, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type ExternalReference, type FieldViolation, FileType, type FileTypeWithLiterals, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type ItemAttributes, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ItemTypeItemTypeWithLiterals, type LegacyFields, type LineItem, type LineItemSummary, type LineItemTax, type LineItemUpdate, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type Membership, type MessageEnvelope, type ModifierGroup, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedMembership, type SelectedMembershipUpdate, type ServiceProperties, Severity, type SeverityWithLiterals, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxDetails, type TaxInfo, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartOptions, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V2AdditionalFee, type V2LineItem, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals };
|
|
2990
|
+
export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartOptions, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartOptions, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CarrierError, type CarrierErrors, type Cart, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, type Color, type ConvertedMoney, type Coupon, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartOptions, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryInfo, type DeliveryMethod, type DeliveryMethodInput, type DeliverySummary, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type ExternalReference, type FieldViolation, FileType, type FileTypeWithLiterals, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type ItemAttributes, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ItemTypeItemTypeWithLiterals, type LegacyFields, type LineItem, type LineItemSummary, type LineItemTax, type LineItemUpdate, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type Membership, type MessageEnvelope, type ModifierGroup, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedMembership, type SelectedMembershipUpdate, type ServiceProperties, type SetDeliveryMethodForCurrentCartRequest, type SetDeliveryMethodForCurrentCartResponse, type SetDeliveryMethodRequest, type SetDeliveryMethodResponse, Severity, type SeverityWithLiterals, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxDetails, type TaxInfo, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UnmarkAsCurrentCartRequest, type UnmarkAsCurrentCartResponse, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartOptions, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V2AdditionalFee, type V2LineItem, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals };
|
package/build/cjs/index.js
CHANGED
|
@@ -50,6 +50,7 @@ __export(index_exports, {
|
|
|
50
50
|
removeCouponFromCurrentCart: () => removeCouponFromCurrentCart4,
|
|
51
51
|
removeGiftCardFromCurrentCart: () => removeGiftCardFromCurrentCart4,
|
|
52
52
|
removeLineItemsFromCurrentCart: () => removeLineItemsFromCurrentCart4,
|
|
53
|
+
setDeliveryMethodForCurrentCart: () => setDeliveryMethodForCurrentCart4,
|
|
53
54
|
updateCurrentCart: () => updateCurrentCart4,
|
|
54
55
|
updateLineItemsInCurrentCart: () => updateLineItemsInCurrentCart4
|
|
55
56
|
});
|
|
@@ -756,6 +757,55 @@ function removeCouponFromCurrentCart(payload) {
|
|
|
756
757
|
}
|
|
757
758
|
return __removeCouponFromCurrentCart;
|
|
758
759
|
}
|
|
760
|
+
function setDeliveryMethodForCurrentCart(payload) {
|
|
761
|
+
function __setDeliveryMethodForCurrentCart({ host }) {
|
|
762
|
+
const metadata = {
|
|
763
|
+
entityFqdn: "wix.ecom.v2.cart",
|
|
764
|
+
method: "POST",
|
|
765
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.SetDeliveryMethodForCurrentCart",
|
|
766
|
+
packageName: PACKAGE_NAME,
|
|
767
|
+
migrationOptions: {
|
|
768
|
+
optInTransformResponse: true
|
|
769
|
+
},
|
|
770
|
+
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
771
|
+
protoPath: "/v2/carts/current/set-delivery-method",
|
|
772
|
+
data: payload,
|
|
773
|
+
host
|
|
774
|
+
}),
|
|
775
|
+
data: payload,
|
|
776
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
777
|
+
{
|
|
778
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
779
|
+
paths: [
|
|
780
|
+
{ path: "cart.createdDate" },
|
|
781
|
+
{ path: "cart.updatedDate" },
|
|
782
|
+
{
|
|
783
|
+
path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
|
|
787
|
+
}
|
|
788
|
+
]
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
792
|
+
paths: [
|
|
793
|
+
{
|
|
794
|
+
path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
|
|
795
|
+
},
|
|
796
|
+
{ path: "cart.lineItems.attributes.physicalProperties.weight" },
|
|
797
|
+
{ path: "cart.deliveryInfo.address.geocode.latitude" },
|
|
798
|
+
{ path: "cart.deliveryInfo.address.geocode.longitude" },
|
|
799
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.latitude" },
|
|
800
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.longitude" }
|
|
801
|
+
]
|
|
802
|
+
}
|
|
803
|
+
])
|
|
804
|
+
};
|
|
805
|
+
return metadata;
|
|
806
|
+
}
|
|
807
|
+
return __setDeliveryMethodForCurrentCart;
|
|
808
|
+
}
|
|
759
809
|
function addGiftCardToCurrentCart(payload) {
|
|
760
810
|
function __addGiftCardToCurrentCart({ host }) {
|
|
761
811
|
const metadata = {
|
|
@@ -1028,6 +1078,7 @@ async function createCurrentCart2(cart, options) {
|
|
|
1028
1078
|
catalogItems: options?.catalogItems,
|
|
1029
1079
|
customItems: options?.customItems,
|
|
1030
1080
|
couponCodes: options?.couponCodes,
|
|
1081
|
+
deliveryMethod: options?.deliveryMethod,
|
|
1031
1082
|
giftCardCodes: options?.giftCardCodes
|
|
1032
1083
|
}),
|
|
1033
1084
|
[
|
|
@@ -1093,6 +1144,7 @@ async function createCurrentCart2(cart, options) {
|
|
|
1093
1144
|
catalogItems: "$[1].catalogItems",
|
|
1094
1145
|
customItems: "$[1].customItems",
|
|
1095
1146
|
couponCodes: "$[1].couponCodes",
|
|
1147
|
+
deliveryMethod: "$[1].deliveryMethod",
|
|
1096
1148
|
giftCardCodes: "$[1].giftCardCodes"
|
|
1097
1149
|
},
|
|
1098
1150
|
singleArgumentUnchanged: false
|
|
@@ -1578,6 +1630,52 @@ async function removeCouponFromCurrentCart2(couponId) {
|
|
|
1578
1630
|
throw transformedError;
|
|
1579
1631
|
}
|
|
1580
1632
|
}
|
|
1633
|
+
async function setDeliveryMethodForCurrentCart2(deliveryMethod) {
|
|
1634
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1635
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1636
|
+
deliveryMethod
|
|
1637
|
+
});
|
|
1638
|
+
const reqOpts = setDeliveryMethodForCurrentCart(payload);
|
|
1639
|
+
sideEffects?.onSiteCall?.();
|
|
1640
|
+
try {
|
|
1641
|
+
const result = await httpClient.request(reqOpts);
|
|
1642
|
+
sideEffects?.onSuccess?.(result);
|
|
1643
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
1644
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
1645
|
+
{
|
|
1646
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
1647
|
+
paths: [
|
|
1648
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
1649
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
1650
|
+
]
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1654
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
transformFn: import_address2.transformRESTAddressToSDKAddress,
|
|
1658
|
+
paths: [
|
|
1659
|
+
{ path: "cart.deliveryInfo.address" },
|
|
1660
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
1661
|
+
]
|
|
1662
|
+
}
|
|
1663
|
+
])
|
|
1664
|
+
);
|
|
1665
|
+
} catch (err) {
|
|
1666
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1667
|
+
err,
|
|
1668
|
+
{
|
|
1669
|
+
spreadPathsToArguments: {},
|
|
1670
|
+
explicitPathsToArguments: { deliveryMethod: "$[0]" },
|
|
1671
|
+
singleArgumentUnchanged: false
|
|
1672
|
+
},
|
|
1673
|
+
["deliveryMethod"]
|
|
1674
|
+
);
|
|
1675
|
+
sideEffects?.onError?.(err);
|
|
1676
|
+
throw transformedError;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1581
1679
|
async function addGiftCardToCurrentCart2(giftCardCode) {
|
|
1582
1680
|
const { httpClient, sideEffects } = arguments[1];
|
|
1583
1681
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -1747,6 +1845,13 @@ function removeCouponFromCurrentCart3(httpClient) {
|
|
|
1747
1845
|
{ httpClient }
|
|
1748
1846
|
);
|
|
1749
1847
|
}
|
|
1848
|
+
function setDeliveryMethodForCurrentCart3(httpClient) {
|
|
1849
|
+
return (deliveryMethod) => setDeliveryMethodForCurrentCart2(
|
|
1850
|
+
deliveryMethod,
|
|
1851
|
+
// @ts-ignore
|
|
1852
|
+
{ httpClient }
|
|
1853
|
+
);
|
|
1854
|
+
}
|
|
1750
1855
|
function addGiftCardToCurrentCart3(httpClient) {
|
|
1751
1856
|
return (giftCardCode) => addGiftCardToCurrentCart2(
|
|
1752
1857
|
giftCardCode,
|
|
@@ -1775,6 +1880,7 @@ var removeLineItemsFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.c
|
|
|
1775
1880
|
var updateLineItemsInCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateLineItemsInCurrentCart3);
|
|
1776
1881
|
var addCouponToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addCouponToCurrentCart3);
|
|
1777
1882
|
var removeCouponFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeCouponFromCurrentCart3);
|
|
1883
|
+
var setDeliveryMethodForCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setDeliveryMethodForCurrentCart3);
|
|
1778
1884
|
var addGiftCardToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addGiftCardToCurrentCart3);
|
|
1779
1885
|
var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeGiftCardFromCurrentCart3);
|
|
1780
1886
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1809,6 +1915,7 @@ var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
1809
1915
|
removeCouponFromCurrentCart,
|
|
1810
1916
|
removeGiftCardFromCurrentCart,
|
|
1811
1917
|
removeLineItemsFromCurrentCart,
|
|
1918
|
+
setDeliveryMethodForCurrentCart,
|
|
1812
1919
|
updateCurrentCart,
|
|
1813
1920
|
updateLineItemsInCurrentCart
|
|
1814
1921
|
});
|