@wix/auto_sdk_ecom_cart-v-2 1.0.63 → 1.0.64
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 +27 -4
- package/build/cjs/index.js +128 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +152 -2
- package/build/cjs/index.typings.js +119 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +96 -2
- package/build/cjs/meta.js +77 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +27 -4
- package/build/es/index.mjs +127 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +152 -2
- package/build/es/index.typings.mjs +118 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +96 -2
- package/build/es/meta.mjs +76 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +27 -4
- package/build/internal/cjs/index.js +128 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +152 -2
- package/build/internal/cjs/index.typings.js +119 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +96 -2
- package/build/internal/cjs/meta.js +77 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +27 -4
- package/build/internal/es/index.mjs +127 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +152 -2
- package/build/internal/es/index.typings.mjs +118 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +96 -2
- package/build/internal/es/meta.mjs +76 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -2604,6 +2604,46 @@ interface CalculateCurrentCartResponse {
|
|
|
2604
2604
|
/** The calculation summary. */
|
|
2605
2605
|
summary?: CartSummary;
|
|
2606
2606
|
}
|
|
2607
|
+
interface EstimateCurrentCartRequest {
|
|
2608
|
+
/**
|
|
2609
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
2610
|
+
*
|
|
2611
|
+
* Default: `false`
|
|
2612
|
+
*/
|
|
2613
|
+
refreshCart?: boolean;
|
|
2614
|
+
/**
|
|
2615
|
+
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2616
|
+
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2617
|
+
*/
|
|
2618
|
+
validationConfig?: ValidationsConfigWithLiterals;
|
|
2619
|
+
/**
|
|
2620
|
+
* Whether to calculate delivery costs.
|
|
2621
|
+
* Default: false
|
|
2622
|
+
*/
|
|
2623
|
+
calculateDelivery?: boolean;
|
|
2624
|
+
/**
|
|
2625
|
+
* Whether to calculate any additional fees.
|
|
2626
|
+
* Default: false
|
|
2627
|
+
*/
|
|
2628
|
+
calculateAdditionalFees?: boolean;
|
|
2629
|
+
/**
|
|
2630
|
+
* Whether to include tax calculation.
|
|
2631
|
+
* Default: false
|
|
2632
|
+
*/
|
|
2633
|
+
calculateTax?: boolean;
|
|
2634
|
+
/**
|
|
2635
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
2636
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
2637
|
+
* Default: false
|
|
2638
|
+
*/
|
|
2639
|
+
calculateGiftCards?: boolean;
|
|
2640
|
+
}
|
|
2641
|
+
interface EstimateCurrentCartResponse {
|
|
2642
|
+
/** The Cart that was calculated. */
|
|
2643
|
+
cart?: Cart;
|
|
2644
|
+
/** The calculation summary. */
|
|
2645
|
+
summary?: CartSummary;
|
|
2646
|
+
}
|
|
2607
2647
|
interface AddLineItemsToCurrentCartRequest {
|
|
2608
2648
|
/**
|
|
2609
2649
|
* A list of catalog items to add to the cart.
|
|
@@ -3011,6 +3051,51 @@ interface RefreshCartResponse {
|
|
|
3011
3051
|
/** Synchronized Cart. */
|
|
3012
3052
|
cart?: Cart;
|
|
3013
3053
|
}
|
|
3054
|
+
interface EstimateCartRequest {
|
|
3055
|
+
/**
|
|
3056
|
+
* ID of the Cart to calculate.
|
|
3057
|
+
* @format GUID
|
|
3058
|
+
*/
|
|
3059
|
+
cartId: string;
|
|
3060
|
+
/**
|
|
3061
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
3062
|
+
*
|
|
3063
|
+
* Default: `false`
|
|
3064
|
+
*/
|
|
3065
|
+
refreshCart?: boolean;
|
|
3066
|
+
/**
|
|
3067
|
+
* Specifies the level of **business validation** to perform during cart calculation,
|
|
3068
|
+
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3069
|
+
*/
|
|
3070
|
+
validationConfig?: ValidationsConfigWithLiterals;
|
|
3071
|
+
/**
|
|
3072
|
+
* Whether to calculate delivery costs.
|
|
3073
|
+
* Default: false
|
|
3074
|
+
*/
|
|
3075
|
+
calculateDelivery?: boolean;
|
|
3076
|
+
/**
|
|
3077
|
+
* Whether to calculate any additional fees.
|
|
3078
|
+
* Default: false
|
|
3079
|
+
*/
|
|
3080
|
+
calculateAdditionalFees?: boolean;
|
|
3081
|
+
/**
|
|
3082
|
+
* Whether to include tax calculation.
|
|
3083
|
+
* Default: false
|
|
3084
|
+
*/
|
|
3085
|
+
calculateTax?: boolean;
|
|
3086
|
+
/**
|
|
3087
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
3088
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
3089
|
+
* Default: false
|
|
3090
|
+
*/
|
|
3091
|
+
calculateGiftCards?: boolean;
|
|
3092
|
+
}
|
|
3093
|
+
interface EstimateCartResponse {
|
|
3094
|
+
/** The Cart that was calculated. */
|
|
3095
|
+
cart?: Cart;
|
|
3096
|
+
/** The calculation summary. */
|
|
3097
|
+
summary?: CartSummary;
|
|
3098
|
+
}
|
|
3014
3099
|
interface CalculateCartRequest {
|
|
3015
3100
|
/**
|
|
3016
3101
|
* ID of the Cart to calculate.
|
|
@@ -4640,6 +4725,12 @@ type RefreshCartApplicationErrors = {
|
|
|
4640
4725
|
data?: CartAlreadyOrderedErrorData;
|
|
4641
4726
|
};
|
|
4642
4727
|
/** @docsIgnore */
|
|
4728
|
+
type EstimateCartApplicationErrors = {
|
|
4729
|
+
code?: 'CART_ALREADY_ORDERED';
|
|
4730
|
+
description?: string;
|
|
4731
|
+
data?: CartAlreadyOrderedErrorData;
|
|
4732
|
+
};
|
|
4733
|
+
/** @docsIgnore */
|
|
4643
4734
|
type CalculateCartApplicationErrors = {
|
|
4644
4735
|
code?: 'CART_ALREADY_ORDERED';
|
|
4645
4736
|
description?: string;
|
|
@@ -5170,10 +5261,69 @@ declare function deleteCart(cartId: string): Promise<void>;
|
|
|
5170
5261
|
declare function refreshCart(cartId: string): Promise<NonNullablePaths<RefreshCartResponse, `cart._id` | `cart.revision` | `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.currentCart`, 7> & {
|
|
5171
5262
|
__applicationErrorsType?: RefreshCartApplicationErrors;
|
|
5172
5263
|
}>;
|
|
5264
|
+
/**
|
|
5265
|
+
* Estimates the cart totals based on its current state and the selected
|
|
5266
|
+
* calculation components.
|
|
5267
|
+
*
|
|
5268
|
+
* This API provides a partial, component-based estimation of the cart and is
|
|
5269
|
+
* intended for preview purposes (e.g. showing partial estimated totals).
|
|
5270
|
+
*
|
|
5271
|
+
* The estimation is controlled by boolean flags that indicate which components
|
|
5272
|
+
* should be included (delivery costs, additional fees, taxes, gift cards).
|
|
5273
|
+
* Components that are not explicitly enabled are excluded from the calculation.
|
|
5274
|
+
*
|
|
5275
|
+
* This is NOT a full cart calculation.
|
|
5276
|
+
*
|
|
5277
|
+
* Note that line items discounts are already pre-computed and applied to the Cart.
|
|
5278
|
+
* @param cartId - ID of the Cart to calculate.
|
|
5279
|
+
* @public
|
|
5280
|
+
* @documentationMaturity preview
|
|
5281
|
+
* @requiredField cartId
|
|
5282
|
+
* @permissionId ecom:v2:cart:estimate_cart
|
|
5283
|
+
* @applicableIdentity APP
|
|
5284
|
+
* @fqn wix.ecom.cart.v2.CartService.EstimateCart
|
|
5285
|
+
*/
|
|
5286
|
+
declare function estimateCart(cartId: string, options?: EstimateCartOptions): Promise<NonNullablePaths<EstimateCartResponse, `cart._id` | `cart.revision` | `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.currentCart` | `summary.cartId` | `summary.cartRevision` | `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> & {
|
|
5287
|
+
__applicationErrorsType?: EstimateCartApplicationErrors;
|
|
5288
|
+
}>;
|
|
5289
|
+
interface EstimateCartOptions {
|
|
5290
|
+
/**
|
|
5291
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
5292
|
+
*
|
|
5293
|
+
* Default: `false`
|
|
5294
|
+
*/
|
|
5295
|
+
refreshCart?: boolean;
|
|
5296
|
+
/**
|
|
5297
|
+
* Specifies the level of **business validation** to perform during cart calculation,
|
|
5298
|
+
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5299
|
+
*/
|
|
5300
|
+
validationConfig?: ValidationsConfigWithLiterals;
|
|
5301
|
+
/**
|
|
5302
|
+
* Whether to calculate delivery costs.
|
|
5303
|
+
* Default: false
|
|
5304
|
+
*/
|
|
5305
|
+
calculateDelivery?: boolean;
|
|
5306
|
+
/**
|
|
5307
|
+
* Whether to calculate any additional fees.
|
|
5308
|
+
* Default: false
|
|
5309
|
+
*/
|
|
5310
|
+
calculateAdditionalFees?: boolean;
|
|
5311
|
+
/**
|
|
5312
|
+
* Whether to include tax calculation.
|
|
5313
|
+
* Default: false
|
|
5314
|
+
*/
|
|
5315
|
+
calculateTax?: boolean;
|
|
5316
|
+
/**
|
|
5317
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
5318
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
5319
|
+
* Default: false
|
|
5320
|
+
*/
|
|
5321
|
+
calculateGiftCards?: boolean;
|
|
5322
|
+
}
|
|
5173
5323
|
/**
|
|
5174
5324
|
* Calculates the cart based on its current state (line items, discounts, delivery method, etc.)
|
|
5175
5325
|
* and returns a detailed summary including subtotal, delivery costs, taxes, fees and the total price.
|
|
5176
|
-
* Note that discounts are already pre-computed and applied to the Cart.
|
|
5326
|
+
* Note that line items discounts are already pre-computed and applied to the Cart.
|
|
5177
5327
|
* @param cartId - ID of the Cart to calculate.
|
|
5178
5328
|
* @public
|
|
5179
5329
|
* @documentationMaturity preview
|
|
@@ -5471,4 +5621,4 @@ interface UpdateFormSubmissionsOptions {
|
|
|
5471
5621
|
formSubmissions?: FormSubmission[];
|
|
5472
5622
|
}
|
|
5473
5623
|
|
|
5474
|
-
export { type ActionEvent, type AddCouponApplicationErrors, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardApplicationErrors, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsApplicationErrors, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, AdditionalFeeSource, type AdditionalFeeSourceWithLiterals, type AdditionalFeeTax, type Address, type AddressLocation, type AggregatedTaxBreakdown, type AllLineItemsOutOfStockErrorData, type ApplicableLineItems, type ApplicationError, type AppliedDiscount, type AppliedDiscountDiscountSourceOneOf, type AutoTaxFallbackCalculationDetails, BalanceType, type BalanceTypeWithLiterals, type BusinessInfo, type CalculateCartApplicationErrors, type CalculateCartForV1Request, type CalculateCartForV1Response, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, type CalculateTotalsResponse, type CalculatedItemModifier, type CalculatedLineItem, type CalculatedPlatformFee, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CalculationOverrides, type Carrier, type CarrierError, type CarrierErrors, type CarrierServiceOption, type Cart, type CartAlreadyOrderedErrorData, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, ChargeType, type ChargeTypeWithLiterals, CheckoutStage, type CheckoutStageWithLiterals, type Color, type ConvertedMoney, type Coupon, type CouponAdded, type CouponAlreadyExistsErrorData, type CouponInput, type CouponNotFoundInCartErrorData, type CouponRemoved, type CreateCartApplicationErrors, type CreateCartOptions, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryAllocation, type DeliveryInfo, type DeliveryLogistics, type DeliveryMethod, type DeliveryMethodInput, type DeliveryMethodNotFoundErrorData, type DeliverySummary, type DeliveryTimeSlot, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, type DiscountRule, type DiscountRuleName, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, DiscountType, type DiscountTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type DuplicateItemModifierIdsErrorData, type DuplicateLineItemUpdatesErrorData, type DuplicateModifierGroupIdsErrorData, type Empty, type EmptyLineItemUpdatesErrorData, type EmptyPaymentTokenErrorData, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type ExternalReference, FallbackReason, type FallbackReasonWithLiterals, type FieldViolation, FileType, type FileTypeWithLiterals, type FixedQuantityItemErrorData, type FormIdentifier, type FormInfo, type FormSubmission, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCheckoutUrlApplicationErrors, type GetCheckoutUrlOptions, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardAdded, type GiftCardAlreadyExistsErrorData, type GiftCardInput, type GiftCardNotFoundInCartErrorData, type GiftCardRedeemErrorData, type GiftCardRemoved, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type InsufficientInventoryEntry, type InsufficientInventoryErrorData, type InvalidCouponCodeErrorData, InvalidCouponReason, type InvalidCouponReasonWithLiterals, type InvalidCouponStatusErrorData, type InvalidCouponStatusErrorDataDetailsOneOf, type InvalidGiftCardCodeErrorData, InvalidGiftCardReason, type InvalidGiftCardReasonWithLiterals, type InvalidGiftCardStatusErrorData, type InvalidMembership, type InvalidMembershipEntry, type InvalidMembershipErrorData, type InvalidMembershipPaymentOptionErrorData, type InvalidPaymentStatusErrorData, type InvalidPriceVerificationTokenErrorData, type InvalidThirdPartyCheckoutTokenErrorData, type ItemAttributes, type ItemCombination, type ItemCombinationLineItem, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemNotFoundInCatalogErrorData, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemTaxFullDetails, type ItemType, type ItemTypeItemTypeDataOneOf, ItemTypePreset, type ItemTypePresetWithLiterals, JurisdictionType, type JurisdictionTypeWithLiterals, type LegacyFields, type LineItem, type LineItemAdded, type LineItemDiscount, type LineItemIdentifier, type LineItemIdentifierIdOneOf, type LineItemNotFoundInCartErrorData, type LineItemPriceConflictErrorData, type LineItemPricesData, type LineItemSummary, type LineItemTax, type LineItemUpdate, ManualCalculationReason, type ManualCalculationReasonWithLiterals, type MarkCartAsCompletedOptions, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type MaxItemModifiersExceededErrorData, type MaxLineItemsExceededErrorData, type MembersOnlyItemErrorData, type Membership, type MembershipName, type MembershipOptions, type MembershipPaymentCredits, type MerchantDiscount, type MessageEnvelope, type MinLineItemQuantityNotReachedDetails, type MinSubtotalNotReachedDetails, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type OtherCharge, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PickupDetails, PickupMethod, type PickupMethodWithLiterals, type PlaceOrderApplicationErrors, type PlaceOrderOptions, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, PlatformFeeChargeType, type PlatformFeeChargeTypeWithLiterals, type PlatformFeeSummary, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, RateType, type RateTypeWithLiterals, type RawHttpResponse, type RedirectUrls, type RefreshCartApplicationErrors, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type Region, type RemoveCouponApplicationErrors, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardApplicationErrors, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsApplicationErrors, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedCarrierServiceOption, type SelectedCarrierServiceOptionOtherCharge, type SelectedCarrierServiceOptionPrices, type SelectedMembership, type SelectedMembershipUpdate, type SelectedMemberships, type ServiceProperties, type SetDeliveryMethodApplicationErrors, type SetDeliveryMethodForCurrentCartRequest, type SetDeliveryMethodForCurrentCartResponse, type SetDeliveryMethodRequest, type SetDeliveryMethodResponse, Severity, type SeverityWithLiterals, type ShippingInformation, type ShippingOption, type ShippingPrice, type ShippingRegion, type SomeLineItemsOutOfStockErrorData, type Stage, type StageStagesOneOf, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxBreakdown, type TaxCalculationDetails, type TaxCalculationDetailsCalculationDetailsOneOf, type TaxDetails, type TaxInfo, type TaxRateBreakdown, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UnmarkAsCurrentCartRequest, type UnmarkAsCurrentCartResponse, type UpdateCart, type UpdateCartApplicationErrors, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateFormSubmissionsInCurrentCartRequest, type UpdateFormSubmissionsInCurrentCartResponse, type UpdateFormSubmissionsOptions, type UpdateFormSubmissionsRequest, type UpdateFormSubmissionsResponse, type UpdateLineItemsApplicationErrors, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V1AdditionalFee, type V2AdditionalFee, type V2CalculationErrors, type V2CalculationErrorsShippingCalculationErrorOneOf, type V2CarrierError, type V2CarrierErrors, type V2Coupon, type V2GiftCard, type V2LineItem, type V2Membership, type V2PriceSummary, type V2SelectedMembership, type V2TaxSummary, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, type ViolationWithErrorSeverityErrorData, type ViolationsList, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals, addCoupon, addGiftCard, addLineItems, calculateCart, createCart, deleteCart, getCart, getCheckoutUrl, handleAsyncCheckoutCompletion, markCartAsCompleted, placeOrder, refreshCart, removeCoupon, removeGiftCard, removeLineItems, setDeliveryMethod, updateCart, updateFormSubmissions, updateLineItems };
|
|
5624
|
+
export { type ActionEvent, type AddCouponApplicationErrors, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardApplicationErrors, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsApplicationErrors, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, AdditionalFeeSource, type AdditionalFeeSourceWithLiterals, type AdditionalFeeTax, type Address, type AddressLocation, type AggregatedTaxBreakdown, type AllLineItemsOutOfStockErrorData, type ApplicableLineItems, type ApplicationError, type AppliedDiscount, type AppliedDiscountDiscountSourceOneOf, type AutoTaxFallbackCalculationDetails, BalanceType, type BalanceTypeWithLiterals, type BusinessInfo, type CalculateCartApplicationErrors, type CalculateCartForV1Request, type CalculateCartForV1Response, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, type CalculateTotalsResponse, type CalculatedItemModifier, type CalculatedLineItem, type CalculatedPlatformFee, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CalculationOverrides, type Carrier, type CarrierError, type CarrierErrors, type CarrierServiceOption, type Cart, type CartAlreadyOrderedErrorData, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, ChargeType, type ChargeTypeWithLiterals, CheckoutStage, type CheckoutStageWithLiterals, type Color, type ConvertedMoney, type Coupon, type CouponAdded, type CouponAlreadyExistsErrorData, type CouponInput, type CouponNotFoundInCartErrorData, type CouponRemoved, type CreateCartApplicationErrors, type CreateCartOptions, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryAllocation, type DeliveryInfo, type DeliveryLogistics, type DeliveryMethod, type DeliveryMethodInput, type DeliveryMethodNotFoundErrorData, type DeliverySummary, type DeliveryTimeSlot, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, type DiscountRule, type DiscountRuleName, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, DiscountType, type DiscountTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type DuplicateItemModifierIdsErrorData, type DuplicateLineItemUpdatesErrorData, type DuplicateModifierGroupIdsErrorData, type Empty, type EmptyLineItemUpdatesErrorData, type EmptyPaymentTokenErrorData, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EstimateCartApplicationErrors, type EstimateCartOptions, type EstimateCartRequest, type EstimateCartResponse, type EstimateCurrentCartRequest, type EstimateCurrentCartResponse, type ExtendedFields, type ExternalReference, FallbackReason, type FallbackReasonWithLiterals, type FieldViolation, FileType, type FileTypeWithLiterals, type FixedQuantityItemErrorData, type FormIdentifier, type FormInfo, type FormSubmission, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCheckoutUrlApplicationErrors, type GetCheckoutUrlOptions, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardAdded, type GiftCardAlreadyExistsErrorData, type GiftCardInput, type GiftCardNotFoundInCartErrorData, type GiftCardRedeemErrorData, type GiftCardRemoved, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type InsufficientInventoryEntry, type InsufficientInventoryErrorData, type InvalidCouponCodeErrorData, InvalidCouponReason, type InvalidCouponReasonWithLiterals, type InvalidCouponStatusErrorData, type InvalidCouponStatusErrorDataDetailsOneOf, type InvalidGiftCardCodeErrorData, InvalidGiftCardReason, type InvalidGiftCardReasonWithLiterals, type InvalidGiftCardStatusErrorData, type InvalidMembership, type InvalidMembershipEntry, type InvalidMembershipErrorData, type InvalidMembershipPaymentOptionErrorData, type InvalidPaymentStatusErrorData, type InvalidPriceVerificationTokenErrorData, type InvalidThirdPartyCheckoutTokenErrorData, type ItemAttributes, type ItemCombination, type ItemCombinationLineItem, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemNotFoundInCatalogErrorData, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemTaxFullDetails, type ItemType, type ItemTypeItemTypeDataOneOf, ItemTypePreset, type ItemTypePresetWithLiterals, JurisdictionType, type JurisdictionTypeWithLiterals, type LegacyFields, type LineItem, type LineItemAdded, type LineItemDiscount, type LineItemIdentifier, type LineItemIdentifierIdOneOf, type LineItemNotFoundInCartErrorData, type LineItemPriceConflictErrorData, type LineItemPricesData, type LineItemSummary, type LineItemTax, type LineItemUpdate, ManualCalculationReason, type ManualCalculationReasonWithLiterals, type MarkCartAsCompletedOptions, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type MaxItemModifiersExceededErrorData, type MaxLineItemsExceededErrorData, type MembersOnlyItemErrorData, type Membership, type MembershipName, type MembershipOptions, type MembershipPaymentCredits, type MerchantDiscount, type MessageEnvelope, type MinLineItemQuantityNotReachedDetails, type MinSubtotalNotReachedDetails, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type OtherCharge, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PickupDetails, PickupMethod, type PickupMethodWithLiterals, type PlaceOrderApplicationErrors, type PlaceOrderOptions, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, PlatformFeeChargeType, type PlatformFeeChargeTypeWithLiterals, type PlatformFeeSummary, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, RateType, type RateTypeWithLiterals, type RawHttpResponse, type RedirectUrls, type RefreshCartApplicationErrors, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type Region, type RemoveCouponApplicationErrors, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardApplicationErrors, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsApplicationErrors, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedCarrierServiceOption, type SelectedCarrierServiceOptionOtherCharge, type SelectedCarrierServiceOptionPrices, type SelectedMembership, type SelectedMembershipUpdate, type SelectedMemberships, type ServiceProperties, type SetDeliveryMethodApplicationErrors, type SetDeliveryMethodForCurrentCartRequest, type SetDeliveryMethodForCurrentCartResponse, type SetDeliveryMethodRequest, type SetDeliveryMethodResponse, Severity, type SeverityWithLiterals, type ShippingInformation, type ShippingOption, type ShippingPrice, type ShippingRegion, type SomeLineItemsOutOfStockErrorData, type Stage, type StageStagesOneOf, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxBreakdown, type TaxCalculationDetails, type TaxCalculationDetailsCalculationDetailsOneOf, type TaxDetails, type TaxInfo, type TaxRateBreakdown, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UnmarkAsCurrentCartRequest, type UnmarkAsCurrentCartResponse, type UpdateCart, type UpdateCartApplicationErrors, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateFormSubmissionsInCurrentCartRequest, type UpdateFormSubmissionsInCurrentCartResponse, type UpdateFormSubmissionsOptions, type UpdateFormSubmissionsRequest, type UpdateFormSubmissionsResponse, type UpdateLineItemsApplicationErrors, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V1AdditionalFee, type V2AdditionalFee, type V2CalculationErrors, type V2CalculationErrorsShippingCalculationErrorOneOf, type V2CarrierError, type V2CarrierErrors, type V2Coupon, type V2GiftCard, type V2LineItem, type V2Membership, type V2PriceSummary, type V2SelectedMembership, type V2TaxSummary, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, type ViolationWithErrorSeverityErrorData, type ViolationsList, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals, addCoupon, addGiftCard, addLineItems, calculateCart, createCart, deleteCart, estimateCart, getCart, getCheckoutUrl, handleAsyncCheckoutCompletion, markCartAsCompleted, placeOrder, refreshCart, removeCoupon, removeGiftCard, removeLineItems, setDeliveryMethod, updateCart, updateFormSubmissions, updateLineItems };
|
|
@@ -58,6 +58,7 @@ __export(index_typings_exports, {
|
|
|
58
58
|
calculateCart: () => calculateCart2,
|
|
59
59
|
createCart: () => createCart2,
|
|
60
60
|
deleteCart: () => deleteCart2,
|
|
61
|
+
estimateCart: () => estimateCart2,
|
|
61
62
|
getCart: () => getCart2,
|
|
62
63
|
getCheckoutUrl: () => getCheckoutUrl2,
|
|
63
64
|
handleAsyncCheckoutCompletion: () => handleAsyncCheckoutCompletion2,
|
|
@@ -494,6 +495,63 @@ function refreshCart(payload) {
|
|
|
494
495
|
}
|
|
495
496
|
return __refreshCart;
|
|
496
497
|
}
|
|
498
|
+
function estimateCart(payload) {
|
|
499
|
+
function __estimateCart({ host }) {
|
|
500
|
+
const metadata = {
|
|
501
|
+
entityFqdn: "wix.ecom.v2.cart",
|
|
502
|
+
method: "POST",
|
|
503
|
+
methodFqn: "wix.ecom.cart.v2.CartService.EstimateCart",
|
|
504
|
+
packageName: PACKAGE_NAME,
|
|
505
|
+
migrationOptions: {
|
|
506
|
+
optInTransformResponse: true
|
|
507
|
+
},
|
|
508
|
+
url: resolveWixEcomCartV2CartServiceUrl({
|
|
509
|
+
protoPath: "/v2/carts/{cartId}/estimate",
|
|
510
|
+
data: payload,
|
|
511
|
+
host
|
|
512
|
+
}),
|
|
513
|
+
data: payload,
|
|
514
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
515
|
+
{
|
|
516
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
517
|
+
paths: [
|
|
518
|
+
{ path: "cart.createdDate" },
|
|
519
|
+
{ path: "cart.updatedDate" },
|
|
520
|
+
{
|
|
521
|
+
path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
|
|
522
|
+
},
|
|
523
|
+
{ path: "cart.lineItems.attributes.image.urlExpirationDate" },
|
|
524
|
+
{
|
|
525
|
+
path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
|
|
529
|
+
},
|
|
530
|
+
{ path: "cart.lineItems.attributes.serviceProperties.endDate" },
|
|
531
|
+
{
|
|
532
|
+
path: "summary.paymentSummary.subscriptionCharges.charges.cycleBillingDate"
|
|
533
|
+
}
|
|
534
|
+
]
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
538
|
+
paths: [
|
|
539
|
+
{
|
|
540
|
+
path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
|
|
541
|
+
},
|
|
542
|
+
{ path: "cart.lineItems.attributes.physicalProperties.weight" },
|
|
543
|
+
{ path: "cart.deliveryInfo.address.geocode.latitude" },
|
|
544
|
+
{ path: "cart.deliveryInfo.address.geocode.longitude" },
|
|
545
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.latitude" },
|
|
546
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.longitude" }
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
])
|
|
550
|
+
};
|
|
551
|
+
return metadata;
|
|
552
|
+
}
|
|
553
|
+
return __estimateCart;
|
|
554
|
+
}
|
|
497
555
|
function calculateCart(payload) {
|
|
498
556
|
function __calculateCart({ host }) {
|
|
499
557
|
const metadata = {
|
|
@@ -1702,6 +1760,66 @@ async function refreshCart2(cartId) {
|
|
|
1702
1760
|
throw transformedError;
|
|
1703
1761
|
}
|
|
1704
1762
|
}
|
|
1763
|
+
async function estimateCart2(cartId, options) {
|
|
1764
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1765
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1766
|
+
cartId,
|
|
1767
|
+
refreshCart: options?.refreshCart,
|
|
1768
|
+
validationConfig: options?.validationConfig,
|
|
1769
|
+
calculateDelivery: options?.calculateDelivery,
|
|
1770
|
+
calculateAdditionalFees: options?.calculateAdditionalFees,
|
|
1771
|
+
calculateTax: options?.calculateTax,
|
|
1772
|
+
calculateGiftCards: options?.calculateGiftCards
|
|
1773
|
+
});
|
|
1774
|
+
const reqOpts = estimateCart(payload);
|
|
1775
|
+
sideEffects?.onSiteCall?.();
|
|
1776
|
+
try {
|
|
1777
|
+
const result = await httpClient.request(reqOpts);
|
|
1778
|
+
sideEffects?.onSuccess?.(result);
|
|
1779
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
1780
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
1781
|
+
{
|
|
1782
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
1783
|
+
paths: [
|
|
1784
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
1785
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
1786
|
+
]
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1790
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
transformFn: import_address2.transformRESTAddressToSDKAddress,
|
|
1794
|
+
paths: [
|
|
1795
|
+
{ path: "cart.deliveryInfo.address" },
|
|
1796
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
1797
|
+
]
|
|
1798
|
+
}
|
|
1799
|
+
])
|
|
1800
|
+
);
|
|
1801
|
+
} catch (err) {
|
|
1802
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1803
|
+
err,
|
|
1804
|
+
{
|
|
1805
|
+
spreadPathsToArguments: {},
|
|
1806
|
+
explicitPathsToArguments: {
|
|
1807
|
+
cartId: "$[0]",
|
|
1808
|
+
refreshCart: "$[1].refreshCart",
|
|
1809
|
+
validationConfig: "$[1].validationConfig",
|
|
1810
|
+
calculateDelivery: "$[1].calculateDelivery",
|
|
1811
|
+
calculateAdditionalFees: "$[1].calculateAdditionalFees",
|
|
1812
|
+
calculateTax: "$[1].calculateTax",
|
|
1813
|
+
calculateGiftCards: "$[1].calculateGiftCards"
|
|
1814
|
+
},
|
|
1815
|
+
singleArgumentUnchanged: false
|
|
1816
|
+
},
|
|
1817
|
+
["cartId", "options"]
|
|
1818
|
+
);
|
|
1819
|
+
sideEffects?.onError?.(err);
|
|
1820
|
+
throw transformedError;
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1705
1823
|
async function calculateCart2(cartId, options) {
|
|
1706
1824
|
const { httpClient, sideEffects } = arguments[2];
|
|
1707
1825
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -2381,6 +2499,7 @@ async function updateFormSubmissions2(cartId, options) {
|
|
|
2381
2499
|
calculateCart,
|
|
2382
2500
|
createCart,
|
|
2383
2501
|
deleteCart,
|
|
2502
|
+
estimateCart,
|
|
2384
2503
|
getCart,
|
|
2385
2504
|
getCheckoutUrl,
|
|
2386
2505
|
handleAsyncCheckoutCompletion,
|