@wix/auto_sdk_ecom_current-cart-v-2 1.0.67 → 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 +2 -8
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +39 -69
- package/build/cjs/index.typings.js +2 -8
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +39 -59
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +2 -8
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +39 -69
- package/build/es/index.typings.mjs +2 -8
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +39 -59
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.js +2 -8
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +39 -69
- package/build/internal/cjs/index.typings.js +2 -8
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +39 -59
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.mjs +2 -8
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +39 -69
- package/build/internal/es/index.typings.mjs +2 -8
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +39 -59
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -2574,55 +2574,6 @@ interface CalculateCurrentCartRequest {
|
|
|
2574
2574
|
* Default: `false`
|
|
2575
2575
|
*/
|
|
2576
2576
|
refreshCart?: boolean;
|
|
2577
|
-
/**
|
|
2578
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2579
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2580
|
-
*/
|
|
2581
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
2582
|
-
/**
|
|
2583
|
-
* Optional custom configuration for the calculation.
|
|
2584
|
-
* If not provided, all price components are calculated by default.
|
|
2585
|
-
*/
|
|
2586
|
-
customCalculationConfig?: CalculationConfig;
|
|
2587
|
-
}
|
|
2588
|
-
declare enum ValidationsConfig {
|
|
2589
|
-
UNKNOWN_VALIDATIONS_CONFIG = "UNKNOWN_VALIDATIONS_CONFIG",
|
|
2590
|
-
/** No business validations are performed. */
|
|
2591
|
-
SKIP_VALIDATIONS = "SKIP_VALIDATIONS",
|
|
2592
|
-
/** Perform cart-level business validations as defined by the service plugin implementer. */
|
|
2593
|
-
PRE_CHECKOUT_VALIDATIONS = "PRE_CHECKOUT_VALIDATIONS",
|
|
2594
|
-
/** Perform checkout-specific business validations as defined by the service plugin implementer. */
|
|
2595
|
-
CHECKOUT_VALIDATIONS = "CHECKOUT_VALIDATIONS"
|
|
2596
|
-
}
|
|
2597
|
-
/** @enumType */
|
|
2598
|
-
type ValidationsConfigWithLiterals = ValidationsConfig | 'UNKNOWN_VALIDATIONS_CONFIG' | 'SKIP_VALIDATIONS' | 'PRE_CHECKOUT_VALIDATIONS' | 'CHECKOUT_VALIDATIONS';
|
|
2599
|
-
interface CalculationConfig {
|
|
2600
|
-
/**
|
|
2601
|
-
* Whether to calculate delivery costs.
|
|
2602
|
-
* Default: false
|
|
2603
|
-
*/
|
|
2604
|
-
calculateDelivery?: boolean;
|
|
2605
|
-
/**
|
|
2606
|
-
* Whether to calculate any additional fees.
|
|
2607
|
-
* Default: false
|
|
2608
|
-
*/
|
|
2609
|
-
calculateAdditionalFees?: boolean;
|
|
2610
|
-
/**
|
|
2611
|
-
* Whether to include tax calculation.
|
|
2612
|
-
* Default: false
|
|
2613
|
-
*/
|
|
2614
|
-
calculateTax?: boolean;
|
|
2615
|
-
/**
|
|
2616
|
-
* Whether to calculate the effect of gift card balances on the cart total.
|
|
2617
|
-
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
2618
|
-
* Default: false
|
|
2619
|
-
*/
|
|
2620
|
-
calculateGiftCards?: boolean;
|
|
2621
|
-
/**
|
|
2622
|
-
* Whether to calculate order-level discounts.
|
|
2623
|
-
* TODO: Currently i's ignored and always treated as true.
|
|
2624
|
-
*/
|
|
2625
|
-
calculateOrderDiscounts?: boolean;
|
|
2626
2577
|
}
|
|
2627
2578
|
interface CalculateCurrentCartResponse {
|
|
2628
2579
|
/** The Cart that was calculated. */
|
|
@@ -2669,6 +2620,17 @@ interface EstimateCurrentCartRequest {
|
|
|
2669
2620
|
*/
|
|
2670
2621
|
calculateGiftCards?: boolean;
|
|
2671
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';
|
|
2672
2634
|
interface EstimateCurrentCartResponse {
|
|
2673
2635
|
/** The Cart that was calculated. */
|
|
2674
2636
|
cart?: Cart;
|
|
@@ -3143,16 +3105,6 @@ interface CalculateCartRequest {
|
|
|
3143
3105
|
* Default: `false`
|
|
3144
3106
|
*/
|
|
3145
3107
|
refreshCart?: boolean;
|
|
3146
|
-
/**
|
|
3147
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
3148
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3149
|
-
*/
|
|
3150
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
3151
|
-
/**
|
|
3152
|
-
* Optional custom configuration for the calculation.
|
|
3153
|
-
* If not provided, all price components are calculated by default.
|
|
3154
|
-
*/
|
|
3155
|
-
customCalculationConfig?: CalculationConfig;
|
|
3156
3108
|
}
|
|
3157
3109
|
interface CalculateCartResponse {
|
|
3158
3110
|
/** The Cart that was calculated. */
|
|
@@ -3184,6 +3136,34 @@ interface CalculateCartForV1Request {
|
|
|
3184
3136
|
/** Calculations overrides for backward compatibility with V1. */
|
|
3185
3137
|
calculationOverrides?: CalculationOverrides;
|
|
3186
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
|
+
}
|
|
3187
3167
|
interface Stage extends StageStagesOneOf {
|
|
3188
3168
|
/** Supported values: */
|
|
3189
3169
|
checkoutStage?: CheckoutStageWithLiterals;
|
|
@@ -5097,16 +5077,6 @@ interface CalculateCurrentCartOptions {
|
|
|
5097
5077
|
* Default: `false`
|
|
5098
5078
|
*/
|
|
5099
5079
|
refreshCart?: boolean;
|
|
5100
|
-
/**
|
|
5101
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
5102
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5103
|
-
*/
|
|
5104
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
5105
|
-
/**
|
|
5106
|
-
* Optional custom configuration for the calculation.
|
|
5107
|
-
* If not provided, all price components are calculated by default.
|
|
5108
|
-
*/
|
|
5109
|
-
customCalculationConfig?: CalculationConfig;
|
|
5110
5080
|
}
|
|
5111
5081
|
/**
|
|
5112
5082
|
* Estimates the cart totals based on its current state and the selected
|
|
@@ -1644,9 +1644,7 @@ async function refreshCurrentCart2() {
|
|
|
1644
1644
|
async function calculateCurrentCart2(options) {
|
|
1645
1645
|
const { httpClient, sideEffects } = arguments[1];
|
|
1646
1646
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1647
|
-
refreshCart: options?.refreshCart
|
|
1648
|
-
validationsConfig: options?.validationsConfig,
|
|
1649
|
-
customCalculationConfig: options?.customCalculationConfig
|
|
1647
|
+
refreshCart: options?.refreshCart
|
|
1650
1648
|
});
|
|
1651
1649
|
const reqOpts = calculateCurrentCart(payload);
|
|
1652
1650
|
sideEffects?.onSiteCall?.();
|
|
@@ -1680,11 +1678,7 @@ async function calculateCurrentCart2(options) {
|
|
|
1680
1678
|
err,
|
|
1681
1679
|
{
|
|
1682
1680
|
spreadPathsToArguments: {},
|
|
1683
|
-
explicitPathsToArguments: {
|
|
1684
|
-
refreshCart: "$[0].refreshCart",
|
|
1685
|
-
validationsConfig: "$[0].validationsConfig",
|
|
1686
|
-
customCalculationConfig: "$[0].customCalculationConfig"
|
|
1687
|
-
},
|
|
1681
|
+
explicitPathsToArguments: { refreshCart: "$[0].refreshCart" },
|
|
1688
1682
|
singleArgumentUnchanged: false
|
|
1689
1683
|
},
|
|
1690
1684
|
["options"]
|