@wix/auto_sdk_ecom_current-cart-v-2 1.0.25 → 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 +64 -9
- 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 +64 -10
- package/build/cjs/meta.js +69 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +64 -9
- 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 +64 -10
- 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 +76 -10
- 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 +64 -10
- 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 +76 -10
- 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 +64 -10
- package/build/internal/es/meta.mjs +68 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1191,7 +1191,10 @@ type VatTypeWithLiterals = VatType | 'UNSPECIFIED' | 'CPF' | 'CNPJ';
|
|
|
1191
1191
|
interface DeliveryInfo {
|
|
1192
1192
|
/** The delivery address. */
|
|
1193
1193
|
address?: Address;
|
|
1194
|
-
/**
|
|
1194
|
+
/**
|
|
1195
|
+
* The selected delivery method by the customer.
|
|
1196
|
+
* @readonly
|
|
1197
|
+
*/
|
|
1195
1198
|
method?: DeliveryMethod;
|
|
1196
1199
|
/**
|
|
1197
1200
|
* The unit of weight measurement when shipping items (e.g., KG, LB).
|
|
@@ -1262,7 +1265,7 @@ interface DeliveryMethod {
|
|
|
1262
1265
|
/**
|
|
1263
1266
|
* Unique code that acts as an ID for a shipping rate.
|
|
1264
1267
|
* For example, `"usps_std_overnight"`.
|
|
1265
|
-
* @maxLength
|
|
1268
|
+
* @maxLength 100
|
|
1266
1269
|
*/
|
|
1267
1270
|
code?: string;
|
|
1268
1271
|
/**
|
|
@@ -1273,13 +1276,9 @@ interface DeliveryMethod {
|
|
|
1273
1276
|
/**
|
|
1274
1277
|
* Delivery rate title.
|
|
1275
1278
|
* For example, `"USPS Standard Overnight Delivery"`, `"Standard"`, or `"First-Class Package International"`.
|
|
1276
|
-
* @readonly
|
|
1277
1279
|
*/
|
|
1278
1280
|
title?: TranslatableString;
|
|
1279
|
-
/**
|
|
1280
|
-
* Whether the delivery method is a pickup option.
|
|
1281
|
-
* @readonly
|
|
1282
|
-
*/
|
|
1281
|
+
/** Whether the delivery method is a pickup option. */
|
|
1283
1282
|
pickup?: boolean;
|
|
1284
1283
|
}
|
|
1285
1284
|
declare enum WeightUnit {
|
|
@@ -1298,6 +1297,11 @@ interface TaxInfo {
|
|
|
1298
1297
|
* @readonly
|
|
1299
1298
|
*/
|
|
1300
1299
|
pricesIncludeTax?: boolean;
|
|
1300
|
+
/**
|
|
1301
|
+
* Tax exempt group ID to use for tax exemptions.
|
|
1302
|
+
* @format GUID
|
|
1303
|
+
*/
|
|
1304
|
+
taxExemptGroupId?: string | null;
|
|
1301
1305
|
}
|
|
1302
1306
|
interface PaymentInfo {
|
|
1303
1307
|
/**
|
|
@@ -1491,6 +1495,11 @@ interface CartSummary {
|
|
|
1491
1495
|
* @format GUID
|
|
1492
1496
|
*/
|
|
1493
1497
|
cartId?: string;
|
|
1498
|
+
/**
|
|
1499
|
+
* A unique identifier for this specific cart calculation.
|
|
1500
|
+
* @format GUID
|
|
1501
|
+
*/
|
|
1502
|
+
calculationId?: string;
|
|
1494
1503
|
/**
|
|
1495
1504
|
* Summarized details for each line item in the cart.
|
|
1496
1505
|
* @maxSize 300
|
|
@@ -2028,6 +2037,8 @@ interface CreateCurrentCartRequest {
|
|
|
2028
2037
|
* @maxLength 50
|
|
2029
2038
|
*/
|
|
2030
2039
|
couponCodes?: string[];
|
|
2040
|
+
/** Delivery method to set. */
|
|
2041
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2031
2042
|
/**
|
|
2032
2043
|
* Gift cards to add.
|
|
2033
2044
|
* Currently only one is support.
|
|
@@ -2199,6 +2210,18 @@ interface CustomItemPaymentConfig {
|
|
|
2199
2210
|
*/
|
|
2200
2211
|
paymentOption?: PaymentOptionTypeWithLiterals;
|
|
2201
2212
|
}
|
|
2213
|
+
interface DeliveryMethodInput {
|
|
2214
|
+
/**
|
|
2215
|
+
* Delivery method code.
|
|
2216
|
+
* @maxLength 100
|
|
2217
|
+
*/
|
|
2218
|
+
code?: string;
|
|
2219
|
+
/**
|
|
2220
|
+
* Carrier app id.
|
|
2221
|
+
* @format GUID
|
|
2222
|
+
*/
|
|
2223
|
+
appId?: string | null;
|
|
2224
|
+
}
|
|
2202
2225
|
interface CreateCurrentCartResponse {
|
|
2203
2226
|
/** The created Cart. */
|
|
2204
2227
|
cart?: Cart;
|
|
@@ -2378,6 +2401,14 @@ interface RemoveCouponFromCurrentCartResponse {
|
|
|
2378
2401
|
/** Updated Cart. */
|
|
2379
2402
|
cart?: Cart;
|
|
2380
2403
|
}
|
|
2404
|
+
interface SetDeliveryMethodForCurrentCartRequest {
|
|
2405
|
+
/** Delivery method. */
|
|
2406
|
+
deliveryMethod: DeliveryMethodInput;
|
|
2407
|
+
}
|
|
2408
|
+
interface SetDeliveryMethodForCurrentCartResponse {
|
|
2409
|
+
/** Updated Cart. */
|
|
2410
|
+
cart?: Cart;
|
|
2411
|
+
}
|
|
2381
2412
|
interface AddGiftCardToCurrentCartRequest {
|
|
2382
2413
|
/**
|
|
2383
2414
|
* Gift card code.
|
|
@@ -2402,6 +2433,12 @@ interface RemoveGiftCardFromCurrentCartResponse {
|
|
|
2402
2433
|
/** Updated Cart. */
|
|
2403
2434
|
cart?: Cart;
|
|
2404
2435
|
}
|
|
2436
|
+
interface UnmarkAsCurrentCartRequest {
|
|
2437
|
+
}
|
|
2438
|
+
interface UnmarkAsCurrentCartResponse {
|
|
2439
|
+
/** Cart that was unmarked as current cart, if such existed. */
|
|
2440
|
+
cart?: Cart;
|
|
2441
|
+
}
|
|
2405
2442
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
2406
2443
|
createdEvent?: EntityCreatedEvent;
|
|
2407
2444
|
updatedEvent?: EntityUpdatedEvent;
|
|
@@ -2561,6 +2598,8 @@ interface CreateCartRequest {
|
|
|
2561
2598
|
* @maxLength 50
|
|
2562
2599
|
*/
|
|
2563
2600
|
couponCodes?: string[];
|
|
2601
|
+
/** Delivery method to set. */
|
|
2602
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2564
2603
|
/**
|
|
2565
2604
|
* Gift cards to add.
|
|
2566
2605
|
* Currently only one is support.
|
|
@@ -2821,6 +2860,19 @@ interface RemoveCouponResponse {
|
|
|
2821
2860
|
/** Updated Cart. */
|
|
2822
2861
|
cart?: Cart;
|
|
2823
2862
|
}
|
|
2863
|
+
interface SetDeliveryMethodRequest {
|
|
2864
|
+
/**
|
|
2865
|
+
* Cart ID.
|
|
2866
|
+
* @format GUID
|
|
2867
|
+
*/
|
|
2868
|
+
cartId?: string;
|
|
2869
|
+
/** Delivery method. */
|
|
2870
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2871
|
+
}
|
|
2872
|
+
interface SetDeliveryMethodResponse {
|
|
2873
|
+
/** Updated Cart. */
|
|
2874
|
+
cart?: Cart;
|
|
2875
|
+
}
|
|
2824
2876
|
interface AddGiftCardRequest {
|
|
2825
2877
|
/**
|
|
2826
2878
|
* Cart ID.
|
|
@@ -2831,7 +2883,8 @@ interface AddGiftCardRequest {
|
|
|
2831
2883
|
* Gift card code.
|
|
2832
2884
|
*
|
|
2833
2885
|
* Currently only one is supported.
|
|
2834
|
-
* @
|
|
2886
|
+
* @minLength 8
|
|
2887
|
+
* @maxLength 20
|
|
2835
2888
|
*/
|
|
2836
2889
|
giftCardCode?: string;
|
|
2837
2890
|
}
|
|
@@ -2932,6 +2985,8 @@ interface CreateCurrentCartOptions {
|
|
|
2932
2985
|
* @maxLength 50
|
|
2933
2986
|
*/
|
|
2934
2987
|
couponCodes?: string[];
|
|
2988
|
+
/** Delivery method to set. */
|
|
2989
|
+
deliveryMethod?: DeliveryMethodInput;
|
|
2935
2990
|
/**
|
|
2936
2991
|
* Gift cards to add.
|
|
2937
2992
|
* Currently only one is support.
|
|
@@ -2988,7 +3043,7 @@ declare function refreshCurrentCart(): Promise<NonNullablePaths<RefreshCurrentCa
|
|
|
2988
3043
|
* @permissionId ecom:v2:cart:calculate_cart
|
|
2989
3044
|
* @fqn wix.ecom.cart.v2.CurrentCartService.CalculateCurrentCart
|
|
2990
3045
|
*/
|
|
2991
|
-
declare function calculateCurrentCart(options?: CalculateCurrentCartOptions): Promise<NonNullablePaths<CalculateCurrentCartResponse, `cart._id` | `cart.lineItems` | `cart.lineItems.${number}._id` | `cart.lineItems.${number}.name.original` | `cart.lineItems.${number}.quantityInfo.confirmedQuantity` | `cart.lineItems.${number}.quantityInfo.requestedQuantity` | `cart.lineItems.${number}.quantityInfo.fixedQuantity` | `cart.lineItems.${number}.pricing.unitPrice.amount` | `cart.lineItems.${number}.pricing.unitPrice.convertedAmount` | `cart.lineItems.${number}.pricing.priceDescription.original` | `cart.lineItems.${number}.pricing.priceUndetermined` | `cart.lineItems.${number}.source.catalogReference.catalogItemId` | `cart.lineItems.${number}.source.catalogReference.appId` | `cart.lineItems.${number}.attributes.itemType.preset` | `cart.lineItems.${number}.attributes.itemType.custom` | `cart.lineItems.${number}.attributes.physicalProperties.shippable` | `cart.lineItems.${number}.attributes.membersOnly` | `cart.lineItems.${number}.taxConfig.taxableAddress.addressType` | `cart.lineItems.${number}.paymentConfig.savePaymentMethod` | `cart.lineItems.${number}.paymentConfig.selectedMembership._id` | `cart.lineItems.${number}.paymentConfig.selectedMembership.appId` | `cart.lineItems.${number}.paymentConfig.paymentOption` | `cart.lineItems.${number}.status` | `cart.lineItems.${number}.customLineItem` | `cart.coupons` | `cart.coupons.${number}._id` | `cart.coupons.${number}.code` | `cart.source.channelType` | `cart.source.externalReferences` | `cart.source.externalReferences.${number}.appId` | `cart.source.createdBy.visitorId` | `cart.source.createdBy.memberId` | `cart.source.createdBy.userId` | `cart.source.createdBy.appId` | `cart.source.customContentReference.appId` | `cart.source.customContentReference.componentId` | `cart.businessInfo.languageCode` | `cart.businessInfo.currencyCode` | `cart.customerInfo.visitorId` | `cart.customerInfo.memberId` | `cart.customerInfo.userId` | `cart.customerInfo.vatId._id` | `cart.customerInfo.vatId.type` | `cart.customerInfo.languageCode` | `cart.customerInfo.currencyCode` | `cart.deliveryInfo.address.streetAddress.number` | `cart.deliveryInfo.address.streetAddress.name` | `cart.deliveryInfo.method.code` | `cart.deliveryInfo.method.pickup` | `cart.deliveryInfo.weightUnit` | `cart.taxInfo.pricesIncludeTax` | `cart.paymentInfo.giftCards` | `cart.paymentInfo.giftCards.${number}._id` | `cart.paymentInfo.giftCards.${number}.obfuscatedCode` | `cart.paymentInfo.giftCards.${number}.appId` | `cart.paymentInfo.currencyCode` | `cart.orderPlaced` | `cart.settings.lockGiftCard` | `cart.settings.lockCouponCode` | `cart.settings.policyAgreementCheckboxDisabled` | `cart.settings.manualPaymentDisabled` | `summary.cartId` | `summary.lineItems` | `summary.lineItems.${number}.lineItemId` | `summary.lineItems.${number}.quantity` | `summary.lineItems.${number}.unitPrice.amount` | `summary.lineItems.${number}.unitPrice.convertedAmount` | `summary.discounts` | `summary.discounts.${number}.name.original` | `summary.discounts.${number}.source.sourceType` | `summary.discounts.${number}.scope` | `summary.deliverySummary.method.code` | `summary.deliverySummary.method.pickup` | `summary.additionalFees` | `summary.taxSummary.taxes` | `summary.taxSummary.pricesIncludeTax` | `summary.taxSummary.lineItemTaxes` | `summary.taxSummary.lineItemTaxes.${number}.lineItemId` | `summary.taxSummary.additionalFeeTaxes` | `summary.taxSummary.additionalFeeTaxes.${number}.additionalFeeCode` | `summary.paymentSummary.giftCards` | `summary.paymentSummary.giftCards.${number}.giftCardId` | `summary.paymentSummary.memberships` | `summary.paymentSummary.memberships.${number}._id` | `summary.paymentSummary.memberships.${number}.appId` | `summary.paymentSummary.subscriptionCharges` | `summary.paymentSummary.requiresPaymentAfterGiftCard` | `summary.calculationErrors.generalShippingCalculationError.applicationError.code` | `summary.calculationErrors.generalShippingCalculationError.applicationError.description` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `summary.calculationErrors.carrierErrors.errors` | `summary.calculationErrors.carrierErrors.errors.${number}.carrierId` | `summary.calculationErrors.orderValidationErrors` | `summary.spiViolations` | `summary.spiViolations.${number}.severity` | `summary.spiViolations.${number}.target.other.name` | `summary.spiViolations.${number}.target.lineItem.name`, 8>>;
|
|
3046
|
+
declare function calculateCurrentCart(options?: CalculateCurrentCartOptions): Promise<NonNullablePaths<CalculateCurrentCartResponse, `cart._id` | `cart.lineItems` | `cart.lineItems.${number}._id` | `cart.lineItems.${number}.name.original` | `cart.lineItems.${number}.quantityInfo.confirmedQuantity` | `cart.lineItems.${number}.quantityInfo.requestedQuantity` | `cart.lineItems.${number}.quantityInfo.fixedQuantity` | `cart.lineItems.${number}.pricing.unitPrice.amount` | `cart.lineItems.${number}.pricing.unitPrice.convertedAmount` | `cart.lineItems.${number}.pricing.priceDescription.original` | `cart.lineItems.${number}.pricing.priceUndetermined` | `cart.lineItems.${number}.source.catalogReference.catalogItemId` | `cart.lineItems.${number}.source.catalogReference.appId` | `cart.lineItems.${number}.attributes.itemType.preset` | `cart.lineItems.${number}.attributes.itemType.custom` | `cart.lineItems.${number}.attributes.physicalProperties.shippable` | `cart.lineItems.${number}.attributes.membersOnly` | `cart.lineItems.${number}.taxConfig.taxableAddress.addressType` | `cart.lineItems.${number}.paymentConfig.savePaymentMethod` | `cart.lineItems.${number}.paymentConfig.selectedMembership._id` | `cart.lineItems.${number}.paymentConfig.selectedMembership.appId` | `cart.lineItems.${number}.paymentConfig.paymentOption` | `cart.lineItems.${number}.status` | `cart.lineItems.${number}.customLineItem` | `cart.coupons` | `cart.coupons.${number}._id` | `cart.coupons.${number}.code` | `cart.source.channelType` | `cart.source.externalReferences` | `cart.source.externalReferences.${number}.appId` | `cart.source.createdBy.visitorId` | `cart.source.createdBy.memberId` | `cart.source.createdBy.userId` | `cart.source.createdBy.appId` | `cart.source.customContentReference.appId` | `cart.source.customContentReference.componentId` | `cart.businessInfo.languageCode` | `cart.businessInfo.currencyCode` | `cart.customerInfo.visitorId` | `cart.customerInfo.memberId` | `cart.customerInfo.userId` | `cart.customerInfo.vatId._id` | `cart.customerInfo.vatId.type` | `cart.customerInfo.languageCode` | `cart.customerInfo.currencyCode` | `cart.deliveryInfo.address.streetAddress.number` | `cart.deliveryInfo.address.streetAddress.name` | `cart.deliveryInfo.method.code` | `cart.deliveryInfo.method.pickup` | `cart.deliveryInfo.weightUnit` | `cart.taxInfo.pricesIncludeTax` | `cart.paymentInfo.giftCards` | `cart.paymentInfo.giftCards.${number}._id` | `cart.paymentInfo.giftCards.${number}.obfuscatedCode` | `cart.paymentInfo.giftCards.${number}.appId` | `cart.paymentInfo.currencyCode` | `cart.orderPlaced` | `cart.settings.lockGiftCard` | `cart.settings.lockCouponCode` | `cart.settings.policyAgreementCheckboxDisabled` | `cart.settings.manualPaymentDisabled` | `summary.cartId` | `summary.calculationId` | `summary.lineItems` | `summary.lineItems.${number}.lineItemId` | `summary.lineItems.${number}.quantity` | `summary.lineItems.${number}.unitPrice.amount` | `summary.lineItems.${number}.unitPrice.convertedAmount` | `summary.discounts` | `summary.discounts.${number}.name.original` | `summary.discounts.${number}.source.sourceType` | `summary.discounts.${number}.scope` | `summary.deliverySummary.method.code` | `summary.deliverySummary.method.pickup` | `summary.additionalFees` | `summary.taxSummary.taxes` | `summary.taxSummary.pricesIncludeTax` | `summary.taxSummary.lineItemTaxes` | `summary.taxSummary.lineItemTaxes.${number}.lineItemId` | `summary.taxSummary.additionalFeeTaxes` | `summary.taxSummary.additionalFeeTaxes.${number}.additionalFeeCode` | `summary.paymentSummary.giftCards` | `summary.paymentSummary.giftCards.${number}.giftCardId` | `summary.paymentSummary.memberships` | `summary.paymentSummary.memberships.${number}._id` | `summary.paymentSummary.memberships.${number}.appId` | `summary.paymentSummary.subscriptionCharges` | `summary.paymentSummary.requiresPaymentAfterGiftCard` | `summary.calculationErrors.generalShippingCalculationError.applicationError.code` | `summary.calculationErrors.generalShippingCalculationError.applicationError.description` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `summary.calculationErrors.carrierErrors.errors` | `summary.calculationErrors.carrierErrors.errors.${number}.carrierId` | `summary.calculationErrors.orderValidationErrors` | `summary.spiViolations` | `summary.spiViolations.${number}.severity` | `summary.spiViolations.${number}.target.other.name` | `summary.spiViolations.${number}.target.lineItem.name`, 8>>;
|
|
2992
3047
|
interface CalculateCurrentCartOptions {
|
|
2993
3048
|
/**
|
|
2994
3049
|
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
|
|
@@ -3089,6 +3144,17 @@ declare function addCouponToCurrentCart(couponCode: string): Promise<NonNullable
|
|
|
3089
3144
|
* @fqn wix.ecom.cart.v2.CurrentCartService.RemoveCouponFromCurrentCart
|
|
3090
3145
|
*/
|
|
3091
3146
|
declare function removeCouponFromCurrentCart(couponId: string): Promise<NonNullablePaths<RemoveCouponFromCurrentCartResponse, `cart._id` | `cart.lineItems` | `cart.lineItems.${number}._id` | `cart.lineItems.${number}.name.original` | `cart.lineItems.${number}.quantityInfo.confirmedQuantity` | `cart.lineItems.${number}.quantityInfo.requestedQuantity` | `cart.lineItems.${number}.quantityInfo.fixedQuantity` | `cart.lineItems.${number}.pricing.unitPrice.amount` | `cart.lineItems.${number}.pricing.unitPrice.convertedAmount` | `cart.lineItems.${number}.pricing.priceDescription.original` | `cart.lineItems.${number}.pricing.priceUndetermined` | `cart.lineItems.${number}.source.catalogReference.catalogItemId` | `cart.lineItems.${number}.source.catalogReference.appId` | `cart.lineItems.${number}.attributes.itemType.preset` | `cart.lineItems.${number}.attributes.itemType.custom` | `cart.lineItems.${number}.attributes.physicalProperties.shippable` | `cart.lineItems.${number}.attributes.membersOnly` | `cart.lineItems.${number}.taxConfig.taxableAddress.addressType` | `cart.lineItems.${number}.paymentConfig.savePaymentMethod` | `cart.lineItems.${number}.paymentConfig.selectedMembership._id` | `cart.lineItems.${number}.paymentConfig.selectedMembership.appId` | `cart.lineItems.${number}.paymentConfig.paymentOption` | `cart.lineItems.${number}.status` | `cart.lineItems.${number}.customLineItem` | `cart.coupons` | `cart.coupons.${number}._id` | `cart.coupons.${number}.code` | `cart.source.channelType` | `cart.source.externalReferences` | `cart.source.externalReferences.${number}.appId` | `cart.source.createdBy.visitorId` | `cart.source.createdBy.memberId` | `cart.source.createdBy.userId` | `cart.source.createdBy.appId` | `cart.source.customContentReference.appId` | `cart.source.customContentReference.componentId` | `cart.businessInfo.languageCode` | `cart.businessInfo.currencyCode` | `cart.customerInfo.visitorId` | `cart.customerInfo.memberId` | `cart.customerInfo.userId` | `cart.customerInfo.vatId._id` | `cart.customerInfo.vatId.type` | `cart.customerInfo.languageCode` | `cart.customerInfo.currencyCode` | `cart.deliveryInfo.address.streetAddress.number` | `cart.deliveryInfo.address.streetAddress.name` | `cart.deliveryInfo.method.code` | `cart.deliveryInfo.method.pickup` | `cart.deliveryInfo.weightUnit` | `cart.taxInfo.pricesIncludeTax` | `cart.paymentInfo.giftCards` | `cart.paymentInfo.giftCards.${number}._id` | `cart.paymentInfo.giftCards.${number}.obfuscatedCode` | `cart.paymentInfo.giftCards.${number}.appId` | `cart.paymentInfo.currencyCode` | `cart.orderPlaced` | `cart.settings.lockGiftCard` | `cart.settings.lockCouponCode` | `cart.settings.policyAgreementCheckboxDisabled` | `cart.settings.manualPaymentDisabled`, 7>>;
|
|
3147
|
+
/**
|
|
3148
|
+
* Sets the delivery method for the Current Cart.
|
|
3149
|
+
* @param deliveryMethod - Delivery method.
|
|
3150
|
+
* @internal
|
|
3151
|
+
* @documentationMaturity preview
|
|
3152
|
+
* @requiredField deliveryMethod
|
|
3153
|
+
* @requiredField deliveryMethod.code
|
|
3154
|
+
* @permissionId ecom:v2:cart:update_cart
|
|
3155
|
+
* @fqn wix.ecom.cart.v2.CurrentCartService.SetDeliveryMethodForCurrentCart
|
|
3156
|
+
*/
|
|
3157
|
+
declare function setDeliveryMethodForCurrentCart(deliveryMethod: NonNullablePaths<DeliveryMethodInput, `code`, 2>): Promise<NonNullablePaths<SetDeliveryMethodForCurrentCartResponse, `cart._id` | `cart.lineItems` | `cart.lineItems.${number}._id` | `cart.lineItems.${number}.name.original` | `cart.lineItems.${number}.quantityInfo.confirmedQuantity` | `cart.lineItems.${number}.quantityInfo.requestedQuantity` | `cart.lineItems.${number}.quantityInfo.fixedQuantity` | `cart.lineItems.${number}.pricing.unitPrice.amount` | `cart.lineItems.${number}.pricing.unitPrice.convertedAmount` | `cart.lineItems.${number}.pricing.priceDescription.original` | `cart.lineItems.${number}.pricing.priceUndetermined` | `cart.lineItems.${number}.source.catalogReference.catalogItemId` | `cart.lineItems.${number}.source.catalogReference.appId` | `cart.lineItems.${number}.attributes.itemType.preset` | `cart.lineItems.${number}.attributes.itemType.custom` | `cart.lineItems.${number}.attributes.physicalProperties.shippable` | `cart.lineItems.${number}.attributes.membersOnly` | `cart.lineItems.${number}.taxConfig.taxableAddress.addressType` | `cart.lineItems.${number}.paymentConfig.savePaymentMethod` | `cart.lineItems.${number}.paymentConfig.selectedMembership._id` | `cart.lineItems.${number}.paymentConfig.selectedMembership.appId` | `cart.lineItems.${number}.paymentConfig.paymentOption` | `cart.lineItems.${number}.status` | `cart.lineItems.${number}.customLineItem` | `cart.coupons` | `cart.coupons.${number}._id` | `cart.coupons.${number}.code` | `cart.source.channelType` | `cart.source.externalReferences` | `cart.source.externalReferences.${number}.appId` | `cart.source.createdBy.visitorId` | `cart.source.createdBy.memberId` | `cart.source.createdBy.userId` | `cart.source.createdBy.appId` | `cart.source.customContentReference.appId` | `cart.source.customContentReference.componentId` | `cart.businessInfo.languageCode` | `cart.businessInfo.currencyCode` | `cart.customerInfo.visitorId` | `cart.customerInfo.memberId` | `cart.customerInfo.userId` | `cart.customerInfo.vatId._id` | `cart.customerInfo.vatId.type` | `cart.customerInfo.languageCode` | `cart.customerInfo.currencyCode` | `cart.deliveryInfo.address.streetAddress.number` | `cart.deliveryInfo.address.streetAddress.name` | `cart.deliveryInfo.method.code` | `cart.deliveryInfo.method.pickup` | `cart.deliveryInfo.weightUnit` | `cart.taxInfo.pricesIncludeTax` | `cart.paymentInfo.giftCards` | `cart.paymentInfo.giftCards.${number}._id` | `cart.paymentInfo.giftCards.${number}.obfuscatedCode` | `cart.paymentInfo.giftCards.${number}.appId` | `cart.paymentInfo.currencyCode` | `cart.orderPlaced` | `cart.settings.lockGiftCard` | `cart.settings.lockCouponCode` | `cart.settings.policyAgreementCheckboxDisabled` | `cart.settings.manualPaymentDisabled`, 7>>;
|
|
3092
3158
|
/**
|
|
3093
3159
|
* Adds a gift card to the Current Cart.
|
|
3094
3160
|
* Once added, the gift card’s balance will be used as a payment method during checkout, either partially or fully covering the cart total.
|
|
@@ -3113,4 +3179,4 @@ declare function addGiftCardToCurrentCart(giftCardCode: string): Promise<NonNull
|
|
|
3113
3179
|
*/
|
|
3114
3180
|
declare function removeGiftCardFromCurrentCart(giftCardId: string): Promise<NonNullablePaths<RemoveGiftCardFromCurrentCartResponse, `cart._id` | `cart.lineItems` | `cart.lineItems.${number}._id` | `cart.lineItems.${number}.name.original` | `cart.lineItems.${number}.quantityInfo.confirmedQuantity` | `cart.lineItems.${number}.quantityInfo.requestedQuantity` | `cart.lineItems.${number}.quantityInfo.fixedQuantity` | `cart.lineItems.${number}.pricing.unitPrice.amount` | `cart.lineItems.${number}.pricing.unitPrice.convertedAmount` | `cart.lineItems.${number}.pricing.priceDescription.original` | `cart.lineItems.${number}.pricing.priceUndetermined` | `cart.lineItems.${number}.source.catalogReference.catalogItemId` | `cart.lineItems.${number}.source.catalogReference.appId` | `cart.lineItems.${number}.attributes.itemType.preset` | `cart.lineItems.${number}.attributes.itemType.custom` | `cart.lineItems.${number}.attributes.physicalProperties.shippable` | `cart.lineItems.${number}.attributes.membersOnly` | `cart.lineItems.${number}.taxConfig.taxableAddress.addressType` | `cart.lineItems.${number}.paymentConfig.savePaymentMethod` | `cart.lineItems.${number}.paymentConfig.selectedMembership._id` | `cart.lineItems.${number}.paymentConfig.selectedMembership.appId` | `cart.lineItems.${number}.paymentConfig.paymentOption` | `cart.lineItems.${number}.status` | `cart.lineItems.${number}.customLineItem` | `cart.coupons` | `cart.coupons.${number}._id` | `cart.coupons.${number}.code` | `cart.source.channelType` | `cart.source.externalReferences` | `cart.source.externalReferences.${number}.appId` | `cart.source.createdBy.visitorId` | `cart.source.createdBy.memberId` | `cart.source.createdBy.userId` | `cart.source.createdBy.appId` | `cart.source.customContentReference.appId` | `cart.source.customContentReference.componentId` | `cart.businessInfo.languageCode` | `cart.businessInfo.currencyCode` | `cart.customerInfo.visitorId` | `cart.customerInfo.memberId` | `cart.customerInfo.userId` | `cart.customerInfo.vatId._id` | `cart.customerInfo.vatId.type` | `cart.customerInfo.languageCode` | `cart.customerInfo.currencyCode` | `cart.deliveryInfo.address.streetAddress.number` | `cart.deliveryInfo.address.streetAddress.name` | `cart.deliveryInfo.method.code` | `cart.deliveryInfo.method.pickup` | `cart.deliveryInfo.weightUnit` | `cart.taxInfo.pricesIncludeTax` | `cart.paymentInfo.giftCards` | `cart.paymentInfo.giftCards.${number}._id` | `cart.paymentInfo.giftCards.${number}.obfuscatedCode` | `cart.paymentInfo.giftCards.${number}.appId` | `cart.paymentInfo.currencyCode` | `cart.orderPlaced` | `cart.settings.lockGiftCard` | `cart.settings.lockCouponCode` | `cart.settings.policyAgreementCheckboxDisabled` | `cart.settings.manualPaymentDisabled`, 7>>;
|
|
3115
3181
|
|
|
3116
|
-
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, addCouponToCurrentCart, addGiftCardToCurrentCart, addLineItemsToCurrentCart, calculateCurrentCart, createCurrentCart, deleteCurrentCart, getCurrentCart, refreshCurrentCart, removeCouponFromCurrentCart, removeGiftCardFromCurrentCart, removeLineItemsFromCurrentCart, updateCurrentCart, updateLineItemsInCurrentCart };
|
|
3182
|
+
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, addCouponToCurrentCart, addGiftCardToCurrentCart, addLineItemsToCurrentCart, calculateCurrentCart, createCurrentCart, deleteCurrentCart, getCurrentCart, refreshCurrentCart, removeCouponFromCurrentCart, removeGiftCardFromCurrentCart, removeLineItemsFromCurrentCart, setDeliveryMethodForCurrentCart, updateCurrentCart, updateLineItemsInCurrentCart };
|
|
@@ -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({
|
|
@@ -1647,6 +1744,7 @@ export {
|
|
|
1647
1744
|
removeCouponFromCurrentCart2 as removeCouponFromCurrentCart,
|
|
1648
1745
|
removeGiftCardFromCurrentCart2 as removeGiftCardFromCurrentCart,
|
|
1649
1746
|
removeLineItemsFromCurrentCart2 as removeLineItemsFromCurrentCart,
|
|
1747
|
+
setDeliveryMethodForCurrentCart2 as setDeliveryMethodForCurrentCart,
|
|
1650
1748
|
updateCurrentCart2 as updateCurrentCart,
|
|
1651
1749
|
updateLineItemsInCurrentCart2 as updateLineItemsInCurrentCart
|
|
1652
1750
|
};
|