@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
|
@@ -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;
|
|
@@ -5381,16 +5361,6 @@ interface CalculateCartOptions {
|
|
|
5381
5361
|
* Default: `false`
|
|
5382
5362
|
*/
|
|
5383
5363
|
refreshCart?: boolean;
|
|
5384
|
-
/**
|
|
5385
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
5386
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5387
|
-
*/
|
|
5388
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
5389
|
-
/**
|
|
5390
|
-
* Optional custom configuration for the calculation.
|
|
5391
|
-
* If not provided, all price components are calculated by default.
|
|
5392
|
-
*/
|
|
5393
|
-
customCalculationConfig?: CalculationConfig;
|
|
5394
5364
|
}
|
|
5395
5365
|
/**
|
|
5396
5366
|
* Retrieves the checkout URL for the Cart.
|
|
@@ -1835,9 +1835,7 @@ async function calculateCart2(cartId, options) {
|
|
|
1835
1835
|
const { httpClient, sideEffects } = arguments[2];
|
|
1836
1836
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1837
1837
|
cartId,
|
|
1838
|
-
refreshCart: options?.refreshCart
|
|
1839
|
-
validationsConfig: options?.validationsConfig,
|
|
1840
|
-
customCalculationConfig: options?.customCalculationConfig
|
|
1838
|
+
refreshCart: options?.refreshCart
|
|
1841
1839
|
});
|
|
1842
1840
|
const reqOpts = calculateCart(payload);
|
|
1843
1841
|
sideEffects?.onSiteCall?.();
|
|
@@ -1873,9 +1871,7 @@ async function calculateCart2(cartId, options) {
|
|
|
1873
1871
|
spreadPathsToArguments: {},
|
|
1874
1872
|
explicitPathsToArguments: {
|
|
1875
1873
|
cartId: "$[0]",
|
|
1876
|
-
refreshCart: "$[1].refreshCart"
|
|
1877
|
-
validationsConfig: "$[1].validationsConfig",
|
|
1878
|
-
customCalculationConfig: "$[1].customCalculationConfig"
|
|
1874
|
+
refreshCart: "$[1].refreshCart"
|
|
1879
1875
|
},
|
|
1880
1876
|
singleArgumentUnchanged: false
|
|
1881
1877
|
},
|