@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 };
@@ -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
  });