@wix/auto_sdk_ecom_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 -6
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +39 -69
- package/build/cjs/index.typings.js +2 -6
- 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 -6
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +39 -69
- package/build/es/index.typings.mjs +2 -6
- 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 -6
- 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 -6
- 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 -6
- 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 -6
- 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
|
@@ -2535,55 +2535,6 @@ interface CalculateCurrentCartRequest {
|
|
|
2535
2535
|
* Default: `false`
|
|
2536
2536
|
*/
|
|
2537
2537
|
refreshCart?: boolean;
|
|
2538
|
-
/**
|
|
2539
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2540
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2541
|
-
*/
|
|
2542
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
2543
|
-
/**
|
|
2544
|
-
* Optional custom configuration for the calculation.
|
|
2545
|
-
* If not provided, all price components are calculated by default.
|
|
2546
|
-
*/
|
|
2547
|
-
customCalculationConfig?: CalculationConfig;
|
|
2548
|
-
}
|
|
2549
|
-
declare enum ValidationsConfig {
|
|
2550
|
-
UNKNOWN_VALIDATIONS_CONFIG = "UNKNOWN_VALIDATIONS_CONFIG",
|
|
2551
|
-
/** No business validations are performed. */
|
|
2552
|
-
SKIP_VALIDATIONS = "SKIP_VALIDATIONS",
|
|
2553
|
-
/** Perform cart-level business validations as defined by the service plugin implementer. */
|
|
2554
|
-
PRE_CHECKOUT_VALIDATIONS = "PRE_CHECKOUT_VALIDATIONS",
|
|
2555
|
-
/** Perform checkout-specific business validations as defined by the service plugin implementer. */
|
|
2556
|
-
CHECKOUT_VALIDATIONS = "CHECKOUT_VALIDATIONS"
|
|
2557
|
-
}
|
|
2558
|
-
/** @enumType */
|
|
2559
|
-
type ValidationsConfigWithLiterals = ValidationsConfig | 'UNKNOWN_VALIDATIONS_CONFIG' | 'SKIP_VALIDATIONS' | 'PRE_CHECKOUT_VALIDATIONS' | 'CHECKOUT_VALIDATIONS';
|
|
2560
|
-
interface CalculationConfig {
|
|
2561
|
-
/**
|
|
2562
|
-
* Whether to calculate delivery costs.
|
|
2563
|
-
* Default: false
|
|
2564
|
-
*/
|
|
2565
|
-
calculateDelivery?: boolean;
|
|
2566
|
-
/**
|
|
2567
|
-
* Whether to calculate any additional fees.
|
|
2568
|
-
* Default: false
|
|
2569
|
-
*/
|
|
2570
|
-
calculateAdditionalFees?: boolean;
|
|
2571
|
-
/**
|
|
2572
|
-
* Whether to include tax calculation.
|
|
2573
|
-
* Default: false
|
|
2574
|
-
*/
|
|
2575
|
-
calculateTax?: boolean;
|
|
2576
|
-
/**
|
|
2577
|
-
* Whether to calculate the effect of gift card balances on the cart total.
|
|
2578
|
-
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
2579
|
-
* Default: false
|
|
2580
|
-
*/
|
|
2581
|
-
calculateGiftCards?: boolean;
|
|
2582
|
-
/**
|
|
2583
|
-
* Whether to calculate order-level discounts.
|
|
2584
|
-
* TODO: Currently i's ignored and always treated as true.
|
|
2585
|
-
*/
|
|
2586
|
-
calculateOrderDiscounts?: boolean;
|
|
2587
2538
|
}
|
|
2588
2539
|
interface CalculateCurrentCartResponse {
|
|
2589
2540
|
/** The Cart that was calculated. */
|
|
@@ -2630,6 +2581,17 @@ interface EstimateCurrentCartRequest {
|
|
|
2630
2581
|
*/
|
|
2631
2582
|
calculateGiftCards?: boolean;
|
|
2632
2583
|
}
|
|
2584
|
+
declare enum ValidationsConfig {
|
|
2585
|
+
UNKNOWN_VALIDATIONS_CONFIG = "UNKNOWN_VALIDATIONS_CONFIG",
|
|
2586
|
+
/** No business validations are performed. */
|
|
2587
|
+
SKIP_VALIDATIONS = "SKIP_VALIDATIONS",
|
|
2588
|
+
/** Perform cart-level business validations as defined by the service plugin implementer. */
|
|
2589
|
+
PRE_CHECKOUT_VALIDATIONS = "PRE_CHECKOUT_VALIDATIONS",
|
|
2590
|
+
/** Perform checkout-specific business validations as defined by the service plugin implementer. */
|
|
2591
|
+
CHECKOUT_VALIDATIONS = "CHECKOUT_VALIDATIONS"
|
|
2592
|
+
}
|
|
2593
|
+
/** @enumType */
|
|
2594
|
+
type ValidationsConfigWithLiterals = ValidationsConfig | 'UNKNOWN_VALIDATIONS_CONFIG' | 'SKIP_VALIDATIONS' | 'PRE_CHECKOUT_VALIDATIONS' | 'CHECKOUT_VALIDATIONS';
|
|
2633
2595
|
interface EstimateCurrentCartResponse {
|
|
2634
2596
|
/** The Cart that was calculated. */
|
|
2635
2597
|
cart?: Cart;
|
|
@@ -3104,16 +3066,6 @@ interface CalculateCartRequest {
|
|
|
3104
3066
|
* Default: `false`
|
|
3105
3067
|
*/
|
|
3106
3068
|
refreshCart?: boolean;
|
|
3107
|
-
/**
|
|
3108
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
3109
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3110
|
-
*/
|
|
3111
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
3112
|
-
/**
|
|
3113
|
-
* Optional custom configuration for the calculation.
|
|
3114
|
-
* If not provided, all price components are calculated by default.
|
|
3115
|
-
*/
|
|
3116
|
-
customCalculationConfig?: CalculationConfig;
|
|
3117
3069
|
}
|
|
3118
3070
|
interface CalculateCartResponse {
|
|
3119
3071
|
/** The Cart that was calculated. */
|
|
@@ -3145,6 +3097,34 @@ interface CalculateCartForV1Request {
|
|
|
3145
3097
|
/** Calculations overrides for backward compatibility with V1. */
|
|
3146
3098
|
calculationOverrides?: CalculationOverrides;
|
|
3147
3099
|
}
|
|
3100
|
+
interface CalculationConfig {
|
|
3101
|
+
/**
|
|
3102
|
+
* Whether to calculate delivery costs.
|
|
3103
|
+
* Default: false
|
|
3104
|
+
*/
|
|
3105
|
+
calculateDelivery?: boolean;
|
|
3106
|
+
/**
|
|
3107
|
+
* Whether to calculate any additional fees.
|
|
3108
|
+
* Default: false
|
|
3109
|
+
*/
|
|
3110
|
+
calculateAdditionalFees?: boolean;
|
|
3111
|
+
/**
|
|
3112
|
+
* Whether to include tax calculation.
|
|
3113
|
+
* Default: false
|
|
3114
|
+
*/
|
|
3115
|
+
calculateTax?: boolean;
|
|
3116
|
+
/**
|
|
3117
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
3118
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
3119
|
+
* Default: false
|
|
3120
|
+
*/
|
|
3121
|
+
calculateGiftCards?: boolean;
|
|
3122
|
+
/**
|
|
3123
|
+
* Whether to calculate order-level discounts.
|
|
3124
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
3125
|
+
*/
|
|
3126
|
+
calculateOrderDiscounts?: boolean;
|
|
3127
|
+
}
|
|
3148
3128
|
interface Stage extends StageStagesOneOf {
|
|
3149
3129
|
/** Supported values: */
|
|
3150
3130
|
checkoutStage?: CheckoutStageWithLiterals;
|
|
@@ -5250,16 +5230,6 @@ interface CalculateCartOptions {
|
|
|
5250
5230
|
* Default: `false`
|
|
5251
5231
|
*/
|
|
5252
5232
|
refreshCart?: boolean;
|
|
5253
|
-
/**
|
|
5254
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
5255
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5256
|
-
*/
|
|
5257
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
5258
|
-
/**
|
|
5259
|
-
* Optional custom configuration for the calculation.
|
|
5260
|
-
* If not provided, all price components are calculated by default.
|
|
5261
|
-
*/
|
|
5262
|
-
customCalculationConfig?: CalculationConfig;
|
|
5263
5233
|
}
|
|
5264
5234
|
/**
|
|
5265
5235
|
* Retrieves the checkout URL for the Cart.
|
|
@@ -1760,9 +1760,7 @@ async function calculateCart2(cartId, options) {
|
|
|
1760
1760
|
const { httpClient, sideEffects } = arguments[2];
|
|
1761
1761
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1762
1762
|
cartId,
|
|
1763
|
-
refreshCart: options?.refreshCart
|
|
1764
|
-
validationsConfig: options?.validationsConfig,
|
|
1765
|
-
customCalculationConfig: options?.customCalculationConfig
|
|
1763
|
+
refreshCart: options?.refreshCart
|
|
1766
1764
|
});
|
|
1767
1765
|
const reqOpts = calculateCart(payload);
|
|
1768
1766
|
sideEffects?.onSiteCall?.();
|
|
@@ -1798,9 +1796,7 @@ async function calculateCart2(cartId, options) {
|
|
|
1798
1796
|
spreadPathsToArguments: {},
|
|
1799
1797
|
explicitPathsToArguments: {
|
|
1800
1798
|
cartId: "$[0]",
|
|
1801
|
-
refreshCart: "$[1].refreshCart"
|
|
1802
|
-
validationsConfig: "$[1].validationsConfig",
|
|
1803
|
-
customCalculationConfig: "$[1].customCalculationConfig"
|
|
1799
|
+
refreshCart: "$[1].refreshCart"
|
|
1804
1800
|
},
|
|
1805
1801
|
singleArgumentUnchanged: false
|
|
1806
1802
|
},
|