@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
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.
|
|
@@ -2887,6 +2939,8 @@ interface CreateCartOptions {
|
|
|
2887
2939
|
* @maxLength 50
|
|
2888
2940
|
*/
|
|
2889
2941
|
couponCodes?: string[];
|
|
2942
|
+
/** Delivery method to set. */
|
|
2943
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2890
2944
|
/**
|
|
2891
2945
|
* Gift cards to add.
|
|
2892
2946
|
* Currently only one is support.
|
|
@@ -3069,4 +3123,4 @@ interface MarkCartAsCompletedOptions {
|
|
|
3069
3123
|
orderId?: string | null;
|
|
3070
3124
|
}
|
|
3071
3125
|
|
|
3072
|
-
export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, 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 CreateCartOptions, type CreateCartRequest, type CreateCartResponse, 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 GetCheckoutUrlOptions, 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 MarkCartAsCompletedOptions, 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 PlaceOrderOptions, 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 UpdateCart, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, 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 };
|
|
3126
|
+
export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, 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 CreateCartOptions, type CreateCartRequest, type CreateCartResponse, 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 GetCheckoutUrlOptions, 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 MarkCartAsCompletedOptions, 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 PlaceOrderOptions, 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 UpdateCart, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, 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
|
@@ -54,6 +54,7 @@ __export(index_exports, {
|
|
|
54
54
|
removeCoupon: () => removeCoupon4,
|
|
55
55
|
removeGiftCard: () => removeGiftCard4,
|
|
56
56
|
removeLineItems: () => removeLineItems4,
|
|
57
|
+
setDeliveryMethod: () => setDeliveryMethod4,
|
|
57
58
|
updateCart: () => updateCart4,
|
|
58
59
|
updateLineItems: () => updateLineItems4
|
|
59
60
|
});
|
|
@@ -803,6 +804,55 @@ function removeCoupon(payload) {
|
|
|
803
804
|
}
|
|
804
805
|
return __removeCoupon;
|
|
805
806
|
}
|
|
807
|
+
function setDeliveryMethod(payload) {
|
|
808
|
+
function __setDeliveryMethod({ host }) {
|
|
809
|
+
const metadata = {
|
|
810
|
+
entityFqdn: "wix.ecom.v2.cart",
|
|
811
|
+
method: "POST",
|
|
812
|
+
methodFqn: "wix.ecom.cart.v2.CartService.SetDeliveryMethod",
|
|
813
|
+
packageName: PACKAGE_NAME,
|
|
814
|
+
migrationOptions: {
|
|
815
|
+
optInTransformResponse: true
|
|
816
|
+
},
|
|
817
|
+
url: resolveWixEcomCartV2CartServiceUrl({
|
|
818
|
+
protoPath: "/v2/carts/{cartId}/set-delivery-method",
|
|
819
|
+
data: payload,
|
|
820
|
+
host
|
|
821
|
+
}),
|
|
822
|
+
data: payload,
|
|
823
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
824
|
+
{
|
|
825
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
826
|
+
paths: [
|
|
827
|
+
{ path: "cart.createdDate" },
|
|
828
|
+
{ path: "cart.updatedDate" },
|
|
829
|
+
{
|
|
830
|
+
path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
|
|
834
|
+
}
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
839
|
+
paths: [
|
|
840
|
+
{
|
|
841
|
+
path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
|
|
842
|
+
},
|
|
843
|
+
{ path: "cart.lineItems.attributes.physicalProperties.weight" },
|
|
844
|
+
{ path: "cart.deliveryInfo.address.geocode.latitude" },
|
|
845
|
+
{ path: "cart.deliveryInfo.address.geocode.longitude" },
|
|
846
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.latitude" },
|
|
847
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.longitude" }
|
|
848
|
+
]
|
|
849
|
+
}
|
|
850
|
+
])
|
|
851
|
+
};
|
|
852
|
+
return metadata;
|
|
853
|
+
}
|
|
854
|
+
return __setDeliveryMethod;
|
|
855
|
+
}
|
|
806
856
|
function addGiftCard(payload) {
|
|
807
857
|
function __addGiftCard({ host }) {
|
|
808
858
|
const metadata = {
|
|
@@ -1151,6 +1201,7 @@ async function createCart2(options) {
|
|
|
1151
1201
|
catalogItems: options?.catalogItems,
|
|
1152
1202
|
customItems: options?.customItems,
|
|
1153
1203
|
couponCodes: options?.couponCodes,
|
|
1204
|
+
deliveryMethod: options?.deliveryMethod,
|
|
1154
1205
|
giftCardCodes: options?.giftCardCodes
|
|
1155
1206
|
}),
|
|
1156
1207
|
[
|
|
@@ -1216,6 +1267,7 @@ async function createCart2(options) {
|
|
|
1216
1267
|
catalogItems: "$[0].catalogItems",
|
|
1217
1268
|
customItems: "$[0].customItems",
|
|
1218
1269
|
couponCodes: "$[0].couponCodes",
|
|
1270
|
+
deliveryMethod: "$[0].deliveryMethod",
|
|
1219
1271
|
giftCardCodes: "$[0].giftCardCodes"
|
|
1220
1272
|
},
|
|
1221
1273
|
singleArgumentUnchanged: false
|
|
@@ -1780,6 +1832,53 @@ async function removeCoupon2(cartId, couponId) {
|
|
|
1780
1832
|
throw transformedError;
|
|
1781
1833
|
}
|
|
1782
1834
|
}
|
|
1835
|
+
async function setDeliveryMethod2(cartId, deliveryMethod) {
|
|
1836
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1837
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1838
|
+
cartId,
|
|
1839
|
+
deliveryMethod
|
|
1840
|
+
});
|
|
1841
|
+
const reqOpts = setDeliveryMethod(payload);
|
|
1842
|
+
sideEffects?.onSiteCall?.();
|
|
1843
|
+
try {
|
|
1844
|
+
const result = await httpClient.request(reqOpts);
|
|
1845
|
+
sideEffects?.onSuccess?.(result);
|
|
1846
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
1847
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
1848
|
+
{
|
|
1849
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
1850
|
+
paths: [
|
|
1851
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
1852
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
1853
|
+
]
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1857
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
transformFn: import_address2.transformRESTAddressToSDKAddress,
|
|
1861
|
+
paths: [
|
|
1862
|
+
{ path: "cart.deliveryInfo.address" },
|
|
1863
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
1864
|
+
]
|
|
1865
|
+
}
|
|
1866
|
+
])
|
|
1867
|
+
);
|
|
1868
|
+
} catch (err) {
|
|
1869
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1870
|
+
err,
|
|
1871
|
+
{
|
|
1872
|
+
spreadPathsToArguments: {},
|
|
1873
|
+
explicitPathsToArguments: { cartId: "$[0]", deliveryMethod: "$[1]" },
|
|
1874
|
+
singleArgumentUnchanged: false
|
|
1875
|
+
},
|
|
1876
|
+
["cartId", "deliveryMethod"]
|
|
1877
|
+
);
|
|
1878
|
+
sideEffects?.onError?.(err);
|
|
1879
|
+
throw transformedError;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1783
1882
|
async function addGiftCard2(cartId, giftCardCode) {
|
|
1784
1883
|
const { httpClient, sideEffects } = arguments[2];
|
|
1785
1884
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -2046,6 +2145,14 @@ function removeCoupon3(httpClient) {
|
|
|
2046
2145
|
{ httpClient }
|
|
2047
2146
|
);
|
|
2048
2147
|
}
|
|
2148
|
+
function setDeliveryMethod3(httpClient) {
|
|
2149
|
+
return (cartId, deliveryMethod) => setDeliveryMethod2(
|
|
2150
|
+
cartId,
|
|
2151
|
+
deliveryMethod,
|
|
2152
|
+
// @ts-ignore
|
|
2153
|
+
{ httpClient }
|
|
2154
|
+
);
|
|
2155
|
+
}
|
|
2049
2156
|
function addGiftCard3(httpClient) {
|
|
2050
2157
|
return (cartId, giftCardCode) => addGiftCard2(
|
|
2051
2158
|
cartId,
|
|
@@ -2093,6 +2200,7 @@ var removeLineItems4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule
|
|
|
2093
2200
|
var updateLineItems4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateLineItems3);
|
|
2094
2201
|
var addCoupon4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addCoupon3);
|
|
2095
2202
|
var removeCoupon4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeCoupon3);
|
|
2203
|
+
var setDeliveryMethod4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setDeliveryMethod3);
|
|
2096
2204
|
var addGiftCard4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addGiftCard3);
|
|
2097
2205
|
var removeGiftCard4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeGiftCard3);
|
|
2098
2206
|
var markCartAsCompleted4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(markCartAsCompleted3);
|
|
@@ -2133,6 +2241,7 @@ var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
2133
2241
|
removeCoupon,
|
|
2134
2242
|
removeGiftCard,
|
|
2135
2243
|
removeLineItems,
|
|
2244
|
+
setDeliveryMethod,
|
|
2136
2245
|
updateCart,
|
|
2137
2246
|
updateLineItems
|
|
2138
2247
|
});
|