@wix/auto_sdk_ecom_current-cart-v-2 1.0.26 → 1.0.28

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +82 -28
  2. package/build/cjs/index.js +107 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js +99 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +82 -29
  8. package/build/cjs/meta.js +69 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +82 -28
  11. package/build/es/index.mjs +106 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +1 -1
  14. package/build/es/index.typings.mjs +98 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +82 -29
  17. package/build/es/meta.mjs +68 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +26 -15
  20. package/build/internal/cjs/index.js +107 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +105 -40
  23. package/build/internal/cjs/index.typings.js +99 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +82 -29
  26. package/build/internal/cjs/meta.js +69 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +26 -15
  29. package/build/internal/es/index.mjs +106 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +105 -40
  32. package/build/internal/es/index.typings.mjs +98 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +82 -29
  35. package/build/internal/es/meta.mjs +68 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -98,6 +98,12 @@ interface Cart {
98
98
  * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
99
99
  */
100
100
  extendedFields?: ExtendedFields;
101
+ /**
102
+ * Indicates whether this is the current cart of the customer.
103
+ * The current cart can be accessed using the identity context (e.g., visitor ID from session cookies), without requiring an explicit cart ID.
104
+ * @readonly
105
+ */
106
+ currentCart?: boolean;
101
107
  }
102
108
  interface V2LineItem {
103
109
  /**
@@ -1168,7 +1174,10 @@ type VatTypeWithLiterals = VatType | 'UNSPECIFIED' | 'CPF' | 'CNPJ';
1168
1174
  interface DeliveryInfo {
1169
1175
  /** The delivery address. */
1170
1176
  address?: Address;
1171
- /** The selected delivery method by the customer. */
1177
+ /**
1178
+ * The selected delivery method by the customer.
1179
+ * @readonly
1180
+ */
1172
1181
  method?: DeliveryMethod;
1173
1182
  /**
1174
1183
  * The unit of weight measurement when shipping items (e.g., KG, LB).
@@ -1239,7 +1248,7 @@ interface DeliveryMethod {
1239
1248
  /**
1240
1249
  * Unique code that acts as an ID for a shipping rate.
1241
1250
  * For example, `"usps_std_overnight"`.
1242
- * @maxLength 250
1251
+ * @maxLength 100
1243
1252
  */
1244
1253
  code?: string;
1245
1254
  /**
@@ -1250,13 +1259,9 @@ interface DeliveryMethod {
1250
1259
  /**
1251
1260
  * Delivery rate title.
1252
1261
  * For example, `"USPS Standard Overnight Delivery"`, `"Standard"`, or `"First-Class Package International"`.
1253
- * @readonly
1254
1262
  */
1255
1263
  title?: TranslatableString;
1256
- /**
1257
- * Whether the delivery method is a pickup option.
1258
- * @readonly
1259
- */
1264
+ /** Whether the delivery method is a pickup option. */
1260
1265
  pickup?: boolean;
1261
1266
  }
1262
1267
  declare enum WeightUnit {
@@ -1275,6 +1280,11 @@ interface TaxInfo {
1275
1280
  * @readonly
1276
1281
  */
1277
1282
  pricesIncludeTax?: boolean;
1283
+ /**
1284
+ * Tax exempt group ID to use for tax exemptions.
1285
+ * @format GUID
1286
+ */
1287
+ taxExemptGroupId?: string | null;
1278
1288
  }
1279
1289
  interface PaymentInfo {
1280
1290
  /**
@@ -1347,26 +1357,14 @@ interface FullAddressContactDetails {
1347
1357
  vatId?: VatId;
1348
1358
  }
1349
1359
  interface CartSettings {
1350
- /**
1351
- * Whether to restrict the option to add or remove a gift card on the checkout page.
1352
- * Default: `false`
1353
- */
1354
- lockGiftCard?: boolean;
1355
- /**
1356
- * Whether to restrict the option to add or remove a coupon code on the checkout page.
1357
- * Default: `false`
1358
- */
1359
- lockCouponCode?: boolean;
1360
- /**
1361
- * Whether to disable policy agreement checkout in the checkout page.
1362
- * Default: `false`
1363
- */
1364
- policyAgreementCheckboxDisabled?: boolean;
1365
- /**
1366
- * Whether to disable manual payment option for this checkout.
1367
- * Default: `false`
1368
- */
1369
- manualPaymentDisabled?: boolean;
1360
+ /** Whether to restrict the option to add or remove a gift card on the checkout page. */
1361
+ lockGiftCard?: boolean | null;
1362
+ /** Whether to restrict the option to add or remove a coupon code on the checkout page. */
1363
+ lockCouponCode?: boolean | null;
1364
+ /** Whether to disable policy agreement checkout in the checkout page. */
1365
+ policyAgreementCheckboxDisabled?: boolean | null;
1366
+ /** Whether to disable manual payment option for this checkout. */
1367
+ manualPaymentDisabled?: boolean | null;
1370
1368
  }
1371
1369
  interface CustomField {
1372
1370
  /** Custom field value. */
@@ -1395,6 +1393,12 @@ interface LegacyFields {
1395
1393
  couponDiscount?: ConvertedMoney;
1396
1394
  /** The sum of all line items after applying all discounts. */
1397
1395
  subtotalAfterCouponDiscount?: ConvertedMoney;
1396
+ /**
1397
+ * Indicates that this cart was created by the Buy Now flow.
1398
+ * Used by the Cart API proxy to determine whether to produce legacy V1 domain events.
1399
+ * @immutable
1400
+ */
1401
+ buyNow?: boolean;
1398
1402
  }
1399
1403
  interface Discount {
1400
1404
  /** The display name of the discount. */
@@ -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 };
@@ -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({
@@ -1693,6 +1790,13 @@ function removeCouponFromCurrentCart3(httpClient) {
1693
1790
  { httpClient }
1694
1791
  );
1695
1792
  }
1793
+ function setDeliveryMethodForCurrentCart3(httpClient) {
1794
+ return (deliveryMethod) => setDeliveryMethodForCurrentCart2(
1795
+ deliveryMethod,
1796
+ // @ts-ignore
1797
+ { httpClient }
1798
+ );
1799
+ }
1696
1800
  function addGiftCardToCurrentCart3(httpClient) {
1697
1801
  return (giftCardCode) => addGiftCardToCurrentCart2(
1698
1802
  giftCardCode,
@@ -1721,6 +1825,7 @@ var removeLineItemsFromCurrentCart4 = /* @__PURE__ */ createRESTModule(removeLin
1721
1825
  var updateLineItemsInCurrentCart4 = /* @__PURE__ */ createRESTModule(updateLineItemsInCurrentCart3);
1722
1826
  var addCouponToCurrentCart4 = /* @__PURE__ */ createRESTModule(addCouponToCurrentCart3);
1723
1827
  var removeCouponFromCurrentCart4 = /* @__PURE__ */ createRESTModule(removeCouponFromCurrentCart3);
1828
+ var setDeliveryMethodForCurrentCart4 = /* @__PURE__ */ createRESTModule(setDeliveryMethodForCurrentCart3);
1724
1829
  var addGiftCardToCurrentCart4 = /* @__PURE__ */ createRESTModule(addGiftCardToCurrentCart3);
1725
1830
  var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ createRESTModule(removeGiftCardFromCurrentCart3);
1726
1831
  export {
@@ -1754,6 +1859,7 @@ export {
1754
1859
  removeCouponFromCurrentCart4 as removeCouponFromCurrentCart,
1755
1860
  removeGiftCardFromCurrentCart4 as removeGiftCardFromCurrentCart,
1756
1861
  removeLineItemsFromCurrentCart4 as removeLineItemsFromCurrentCart,
1862
+ setDeliveryMethodForCurrentCart4 as setDeliveryMethodForCurrentCart,
1757
1863
  updateCurrentCart4 as updateCurrentCart,
1758
1864
  updateLineItemsInCurrentCart4 as updateLineItemsInCurrentCart
1759
1865
  };