@wix/auto_sdk_ecom_current-cart-v-2 1.0.66 → 1.0.68
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.js +4 -8
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +61 -66
- package/build/cjs/index.typings.js +4 -8
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +56 -56
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +4 -8
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +61 -66
- package/build/es/index.typings.mjs +4 -8
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +56 -56
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.js +4 -8
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +61 -66
- package/build/internal/cjs/index.typings.js +4 -8
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +56 -56
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.mjs +4 -8
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +61 -66
- package/build/internal/es/index.typings.mjs +4 -8
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +56 -56
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -2076,9 +2076,15 @@ interface LineItemAdded {
|
|
|
2076
2076
|
* @minLength 1
|
|
2077
2077
|
* @maxLength 36
|
|
2078
2078
|
*/
|
|
2079
|
-
|
|
2079
|
+
catalogAppId?: string | null;
|
|
2080
2080
|
/** Whether the line item is a custom line item. */
|
|
2081
2081
|
customLineItem?: boolean;
|
|
2082
|
+
/**
|
|
2083
|
+
* ID of the app that added the line item to the cart (from the identity context).
|
|
2084
|
+
* @minLength 1
|
|
2085
|
+
* @maxLength 36
|
|
2086
|
+
*/
|
|
2087
|
+
appDefId?: string | null;
|
|
2082
2088
|
}
|
|
2083
2089
|
interface CouponAdded {
|
|
2084
2090
|
/**
|
|
@@ -2568,50 +2574,6 @@ interface CalculateCurrentCartRequest {
|
|
|
2568
2574
|
* Default: `false`
|
|
2569
2575
|
*/
|
|
2570
2576
|
refreshCart?: boolean;
|
|
2571
|
-
/**
|
|
2572
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2573
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2574
|
-
*/
|
|
2575
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
2576
|
-
/**
|
|
2577
|
-
* Optional custom configuration for the calculation.
|
|
2578
|
-
* If not provided, all price components are calculated by default.
|
|
2579
|
-
*/
|
|
2580
|
-
customCalculationConfig?: CalculationConfig;
|
|
2581
|
-
}
|
|
2582
|
-
declare enum ValidationsConfig {
|
|
2583
|
-
UNKNOWN_VALIDATIONS_CONFIG = "UNKNOWN_VALIDATIONS_CONFIG",
|
|
2584
|
-
/** No business validations are performed. */
|
|
2585
|
-
SKIP_VALIDATIONS = "SKIP_VALIDATIONS",
|
|
2586
|
-
/** Perform cart-level business validations as defined by the service plugin implementer. */
|
|
2587
|
-
PRE_CHECKOUT_VALIDATIONS = "PRE_CHECKOUT_VALIDATIONS",
|
|
2588
|
-
/** Perform checkout-specific business validations as defined by the service plugin implementer. */
|
|
2589
|
-
CHECKOUT_VALIDATIONS = "CHECKOUT_VALIDATIONS"
|
|
2590
|
-
}
|
|
2591
|
-
/** @enumType */
|
|
2592
|
-
type ValidationsConfigWithLiterals = ValidationsConfig | 'UNKNOWN_VALIDATIONS_CONFIG' | 'SKIP_VALIDATIONS' | 'PRE_CHECKOUT_VALIDATIONS' | 'CHECKOUT_VALIDATIONS';
|
|
2593
|
-
interface CalculationConfig {
|
|
2594
|
-
/**
|
|
2595
|
-
* Whether to calculate delivery costs.
|
|
2596
|
-
* Default: false
|
|
2597
|
-
*/
|
|
2598
|
-
calculateDelivery?: boolean;
|
|
2599
|
-
/**
|
|
2600
|
-
* Whether to calculate any additional fees.
|
|
2601
|
-
* Default: false
|
|
2602
|
-
*/
|
|
2603
|
-
calculateAdditionalFees?: boolean;
|
|
2604
|
-
/**
|
|
2605
|
-
* Whether to include tax calculation.
|
|
2606
|
-
* Default: false
|
|
2607
|
-
*/
|
|
2608
|
-
calculateTax?: boolean;
|
|
2609
|
-
/**
|
|
2610
|
-
* Whether to calculate the effect of gift card balances on the cart total.
|
|
2611
|
-
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
2612
|
-
* Default: false
|
|
2613
|
-
*/
|
|
2614
|
-
calculateGiftCards?: boolean;
|
|
2615
2577
|
}
|
|
2616
2578
|
interface CalculateCurrentCartResponse {
|
|
2617
2579
|
/** The Cart that was calculated. */
|
|
@@ -2631,6 +2593,11 @@ interface EstimateCurrentCartRequest {
|
|
|
2631
2593
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2632
2594
|
*/
|
|
2633
2595
|
validationConfig?: ValidationsConfigWithLiterals;
|
|
2596
|
+
/**
|
|
2597
|
+
* Whether to calculate order-level discounts.
|
|
2598
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
2599
|
+
*/
|
|
2600
|
+
calculateOrderDiscounts?: boolean;
|
|
2634
2601
|
/**
|
|
2635
2602
|
* Whether to calculate delivery costs.
|
|
2636
2603
|
* Default: false
|
|
@@ -2653,6 +2620,17 @@ interface EstimateCurrentCartRequest {
|
|
|
2653
2620
|
*/
|
|
2654
2621
|
calculateGiftCards?: boolean;
|
|
2655
2622
|
}
|
|
2623
|
+
declare enum ValidationsConfig {
|
|
2624
|
+
UNKNOWN_VALIDATIONS_CONFIG = "UNKNOWN_VALIDATIONS_CONFIG",
|
|
2625
|
+
/** No business validations are performed. */
|
|
2626
|
+
SKIP_VALIDATIONS = "SKIP_VALIDATIONS",
|
|
2627
|
+
/** Perform cart-level business validations as defined by the service plugin implementer. */
|
|
2628
|
+
PRE_CHECKOUT_VALIDATIONS = "PRE_CHECKOUT_VALIDATIONS",
|
|
2629
|
+
/** Perform checkout-specific business validations as defined by the service plugin implementer. */
|
|
2630
|
+
CHECKOUT_VALIDATIONS = "CHECKOUT_VALIDATIONS"
|
|
2631
|
+
}
|
|
2632
|
+
/** @enumType */
|
|
2633
|
+
type ValidationsConfigWithLiterals = ValidationsConfig | 'UNKNOWN_VALIDATIONS_CONFIG' | 'SKIP_VALIDATIONS' | 'PRE_CHECKOUT_VALIDATIONS' | 'CHECKOUT_VALIDATIONS';
|
|
2656
2634
|
interface EstimateCurrentCartResponse {
|
|
2657
2635
|
/** The Cart that was calculated. */
|
|
2658
2636
|
cart?: Cart;
|
|
@@ -3074,7 +3052,6 @@ interface EstimateCartRequest {
|
|
|
3074
3052
|
cartId?: string;
|
|
3075
3053
|
/**
|
|
3076
3054
|
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
3077
|
-
*
|
|
3078
3055
|
* Default: `false`
|
|
3079
3056
|
*/
|
|
3080
3057
|
refreshCart?: boolean;
|
|
@@ -3083,6 +3060,11 @@ interface EstimateCartRequest {
|
|
|
3083
3060
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3084
3061
|
*/
|
|
3085
3062
|
validationConfig?: ValidationsConfigWithLiterals;
|
|
3063
|
+
/**
|
|
3064
|
+
* Whether to calculate order-level discounts.
|
|
3065
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
3066
|
+
*/
|
|
3067
|
+
calculateOrderDiscounts?: boolean;
|
|
3086
3068
|
/**
|
|
3087
3069
|
* Whether to calculate delivery costs.
|
|
3088
3070
|
* Default: false
|
|
@@ -3123,16 +3105,6 @@ interface CalculateCartRequest {
|
|
|
3123
3105
|
* Default: `false`
|
|
3124
3106
|
*/
|
|
3125
3107
|
refreshCart?: boolean;
|
|
3126
|
-
/**
|
|
3127
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
3128
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3129
|
-
*/
|
|
3130
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
3131
|
-
/**
|
|
3132
|
-
* Optional custom configuration for the calculation.
|
|
3133
|
-
* If not provided, all price components are calculated by default.
|
|
3134
|
-
*/
|
|
3135
|
-
customCalculationConfig?: CalculationConfig;
|
|
3136
3108
|
}
|
|
3137
3109
|
interface CalculateCartResponse {
|
|
3138
3110
|
/** The Cart that was calculated. */
|
|
@@ -3164,6 +3136,34 @@ interface CalculateCartForV1Request {
|
|
|
3164
3136
|
/** Calculations overrides for backward compatibility with V1. */
|
|
3165
3137
|
calculationOverrides?: CalculationOverrides;
|
|
3166
3138
|
}
|
|
3139
|
+
interface CalculationConfig {
|
|
3140
|
+
/**
|
|
3141
|
+
* Whether to calculate delivery costs.
|
|
3142
|
+
* Default: false
|
|
3143
|
+
*/
|
|
3144
|
+
calculateDelivery?: boolean;
|
|
3145
|
+
/**
|
|
3146
|
+
* Whether to calculate any additional fees.
|
|
3147
|
+
* Default: false
|
|
3148
|
+
*/
|
|
3149
|
+
calculateAdditionalFees?: boolean;
|
|
3150
|
+
/**
|
|
3151
|
+
* Whether to include tax calculation.
|
|
3152
|
+
* Default: false
|
|
3153
|
+
*/
|
|
3154
|
+
calculateTax?: boolean;
|
|
3155
|
+
/**
|
|
3156
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
3157
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
3158
|
+
* Default: false
|
|
3159
|
+
*/
|
|
3160
|
+
calculateGiftCards?: boolean;
|
|
3161
|
+
/**
|
|
3162
|
+
* Whether to calculate order-level discounts.
|
|
3163
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
3164
|
+
*/
|
|
3165
|
+
calculateOrderDiscounts?: boolean;
|
|
3166
|
+
}
|
|
3167
3167
|
interface Stage extends StageStagesOneOf {
|
|
3168
3168
|
/** Supported values: */
|
|
3169
3169
|
checkoutStage?: CheckoutStageWithLiterals;
|
|
@@ -5077,16 +5077,6 @@ interface CalculateCurrentCartOptions {
|
|
|
5077
5077
|
* Default: `false`
|
|
5078
5078
|
*/
|
|
5079
5079
|
refreshCart?: boolean;
|
|
5080
|
-
/**
|
|
5081
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
5082
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5083
|
-
*/
|
|
5084
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
5085
|
-
/**
|
|
5086
|
-
* Optional custom configuration for the calculation.
|
|
5087
|
-
* If not provided, all price components are calculated by default.
|
|
5088
|
-
*/
|
|
5089
|
-
customCalculationConfig?: CalculationConfig;
|
|
5090
5080
|
}
|
|
5091
5081
|
/**
|
|
5092
5082
|
* Estimates the cart totals based on its current state and the selected
|
|
@@ -5123,6 +5113,11 @@ interface EstimateCurrentCartOptions {
|
|
|
5123
5113
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5124
5114
|
*/
|
|
5125
5115
|
validationConfig?: ValidationsConfigWithLiterals;
|
|
5116
|
+
/**
|
|
5117
|
+
* Whether to calculate order-level discounts.
|
|
5118
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
5119
|
+
*/
|
|
5120
|
+
calculateOrderDiscounts?: boolean;
|
|
5126
5121
|
/**
|
|
5127
5122
|
* Whether to calculate delivery costs.
|
|
5128
5123
|
* Default: false
|
|
@@ -1573,9 +1573,7 @@ async function refreshCurrentCart2() {
|
|
|
1573
1573
|
async function calculateCurrentCart2(options) {
|
|
1574
1574
|
const { httpClient, sideEffects } = arguments[1];
|
|
1575
1575
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1576
|
-
refreshCart: options?.refreshCart
|
|
1577
|
-
validationsConfig: options?.validationsConfig,
|
|
1578
|
-
customCalculationConfig: options?.customCalculationConfig
|
|
1576
|
+
refreshCart: options?.refreshCart
|
|
1579
1577
|
});
|
|
1580
1578
|
const reqOpts = calculateCurrentCart(payload);
|
|
1581
1579
|
sideEffects?.onSiteCall?.();
|
|
@@ -1609,11 +1607,7 @@ async function calculateCurrentCart2(options) {
|
|
|
1609
1607
|
err,
|
|
1610
1608
|
{
|
|
1611
1609
|
spreadPathsToArguments: {},
|
|
1612
|
-
explicitPathsToArguments: {
|
|
1613
|
-
refreshCart: "$[0].refreshCart",
|
|
1614
|
-
validationsConfig: "$[0].validationsConfig",
|
|
1615
|
-
customCalculationConfig: "$[0].customCalculationConfig"
|
|
1616
|
-
},
|
|
1610
|
+
explicitPathsToArguments: { refreshCart: "$[0].refreshCart" },
|
|
1617
1611
|
singleArgumentUnchanged: false
|
|
1618
1612
|
},
|
|
1619
1613
|
["options"]
|
|
@@ -1627,6 +1621,7 @@ async function estimateCurrentCart2(options) {
|
|
|
1627
1621
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1628
1622
|
refreshCart: options?.refreshCart,
|
|
1629
1623
|
validationConfig: options?.validationConfig,
|
|
1624
|
+
calculateOrderDiscounts: options?.calculateOrderDiscounts,
|
|
1630
1625
|
calculateDelivery: options?.calculateDelivery,
|
|
1631
1626
|
calculateAdditionalFees: options?.calculateAdditionalFees,
|
|
1632
1627
|
calculateTax: options?.calculateTax,
|
|
@@ -1667,6 +1662,7 @@ async function estimateCurrentCart2(options) {
|
|
|
1667
1662
|
explicitPathsToArguments: {
|
|
1668
1663
|
refreshCart: "$[0].refreshCart",
|
|
1669
1664
|
validationConfig: "$[0].validationConfig",
|
|
1665
|
+
calculateOrderDiscounts: "$[0].calculateOrderDiscounts",
|
|
1670
1666
|
calculateDelivery: "$[0].calculateDelivery",
|
|
1671
1667
|
calculateAdditionalFees: "$[0].calculateAdditionalFees",
|
|
1672
1668
|
calculateTax: "$[0].calculateTax",
|