@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
|
@@ -2037,9 +2037,15 @@ interface LineItemAdded {
|
|
|
2037
2037
|
* @minLength 1
|
|
2038
2038
|
* @maxLength 36
|
|
2039
2039
|
*/
|
|
2040
|
-
|
|
2040
|
+
catalogAppId?: string | null;
|
|
2041
2041
|
/** Whether the line item is a custom line item. */
|
|
2042
2042
|
customLineItem?: boolean;
|
|
2043
|
+
/**
|
|
2044
|
+
* ID of the app that added the line item to the cart (from the identity context).
|
|
2045
|
+
* @minLength 1
|
|
2046
|
+
* @maxLength 36
|
|
2047
|
+
*/
|
|
2048
|
+
appDefId?: string | null;
|
|
2043
2049
|
}
|
|
2044
2050
|
interface CouponAdded {
|
|
2045
2051
|
/**
|
|
@@ -2529,50 +2535,6 @@ interface CalculateCurrentCartRequest {
|
|
|
2529
2535
|
* Default: `false`
|
|
2530
2536
|
*/
|
|
2531
2537
|
refreshCart?: boolean;
|
|
2532
|
-
/**
|
|
2533
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2534
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2535
|
-
*/
|
|
2536
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
2537
|
-
/**
|
|
2538
|
-
* Optional custom configuration for the calculation.
|
|
2539
|
-
* If not provided, all price components are calculated by default.
|
|
2540
|
-
*/
|
|
2541
|
-
customCalculationConfig?: CalculationConfig;
|
|
2542
|
-
}
|
|
2543
|
-
declare enum ValidationsConfig {
|
|
2544
|
-
UNKNOWN_VALIDATIONS_CONFIG = "UNKNOWN_VALIDATIONS_CONFIG",
|
|
2545
|
-
/** No business validations are performed. */
|
|
2546
|
-
SKIP_VALIDATIONS = "SKIP_VALIDATIONS",
|
|
2547
|
-
/** Perform cart-level business validations as defined by the service plugin implementer. */
|
|
2548
|
-
PRE_CHECKOUT_VALIDATIONS = "PRE_CHECKOUT_VALIDATIONS",
|
|
2549
|
-
/** Perform checkout-specific business validations as defined by the service plugin implementer. */
|
|
2550
|
-
CHECKOUT_VALIDATIONS = "CHECKOUT_VALIDATIONS"
|
|
2551
|
-
}
|
|
2552
|
-
/** @enumType */
|
|
2553
|
-
type ValidationsConfigWithLiterals = ValidationsConfig | 'UNKNOWN_VALIDATIONS_CONFIG' | 'SKIP_VALIDATIONS' | 'PRE_CHECKOUT_VALIDATIONS' | 'CHECKOUT_VALIDATIONS';
|
|
2554
|
-
interface CalculationConfig {
|
|
2555
|
-
/**
|
|
2556
|
-
* Whether to calculate delivery costs.
|
|
2557
|
-
* Default: false
|
|
2558
|
-
*/
|
|
2559
|
-
calculateDelivery?: boolean;
|
|
2560
|
-
/**
|
|
2561
|
-
* Whether to calculate any additional fees.
|
|
2562
|
-
* Default: false
|
|
2563
|
-
*/
|
|
2564
|
-
calculateAdditionalFees?: boolean;
|
|
2565
|
-
/**
|
|
2566
|
-
* Whether to include tax calculation.
|
|
2567
|
-
* Default: false
|
|
2568
|
-
*/
|
|
2569
|
-
calculateTax?: boolean;
|
|
2570
|
-
/**
|
|
2571
|
-
* Whether to calculate the effect of gift card balances on the cart total.
|
|
2572
|
-
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
2573
|
-
* Default: false
|
|
2574
|
-
*/
|
|
2575
|
-
calculateGiftCards?: boolean;
|
|
2576
2538
|
}
|
|
2577
2539
|
interface CalculateCurrentCartResponse {
|
|
2578
2540
|
/** The Cart that was calculated. */
|
|
@@ -2592,6 +2554,11 @@ interface EstimateCurrentCartRequest {
|
|
|
2592
2554
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2593
2555
|
*/
|
|
2594
2556
|
validationConfig?: ValidationsConfigWithLiterals;
|
|
2557
|
+
/**
|
|
2558
|
+
* Whether to calculate order-level discounts.
|
|
2559
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
2560
|
+
*/
|
|
2561
|
+
calculateOrderDiscounts?: boolean;
|
|
2595
2562
|
/**
|
|
2596
2563
|
* Whether to calculate delivery costs.
|
|
2597
2564
|
* Default: false
|
|
@@ -2614,6 +2581,17 @@ interface EstimateCurrentCartRequest {
|
|
|
2614
2581
|
*/
|
|
2615
2582
|
calculateGiftCards?: boolean;
|
|
2616
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';
|
|
2617
2595
|
interface EstimateCurrentCartResponse {
|
|
2618
2596
|
/** The Cart that was calculated. */
|
|
2619
2597
|
cart?: Cart;
|
|
@@ -3035,7 +3013,6 @@ interface EstimateCartRequest {
|
|
|
3035
3013
|
cartId?: string;
|
|
3036
3014
|
/**
|
|
3037
3015
|
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
3038
|
-
*
|
|
3039
3016
|
* Default: `false`
|
|
3040
3017
|
*/
|
|
3041
3018
|
refreshCart?: boolean;
|
|
@@ -3044,6 +3021,11 @@ interface EstimateCartRequest {
|
|
|
3044
3021
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3045
3022
|
*/
|
|
3046
3023
|
validationConfig?: ValidationsConfigWithLiterals;
|
|
3024
|
+
/**
|
|
3025
|
+
* Whether to calculate order-level discounts.
|
|
3026
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
3027
|
+
*/
|
|
3028
|
+
calculateOrderDiscounts?: boolean;
|
|
3047
3029
|
/**
|
|
3048
3030
|
* Whether to calculate delivery costs.
|
|
3049
3031
|
* Default: false
|
|
@@ -3084,16 +3066,6 @@ interface CalculateCartRequest {
|
|
|
3084
3066
|
* Default: `false`
|
|
3085
3067
|
*/
|
|
3086
3068
|
refreshCart?: boolean;
|
|
3087
|
-
/**
|
|
3088
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
3089
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3090
|
-
*/
|
|
3091
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
3092
|
-
/**
|
|
3093
|
-
* Optional custom configuration for the calculation.
|
|
3094
|
-
* If not provided, all price components are calculated by default.
|
|
3095
|
-
*/
|
|
3096
|
-
customCalculationConfig?: CalculationConfig;
|
|
3097
3069
|
}
|
|
3098
3070
|
interface CalculateCartResponse {
|
|
3099
3071
|
/** The Cart that was calculated. */
|
|
@@ -3125,6 +3097,34 @@ interface CalculateCartForV1Request {
|
|
|
3125
3097
|
/** Calculations overrides for backward compatibility with V1. */
|
|
3126
3098
|
calculationOverrides?: CalculationOverrides;
|
|
3127
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
|
+
}
|
|
3128
3128
|
interface Stage extends StageStagesOneOf {
|
|
3129
3129
|
/** Supported values: */
|
|
3130
3130
|
checkoutStage?: CheckoutStageWithLiterals;
|
|
@@ -4953,16 +4953,6 @@ interface CalculateCurrentCartOptions {
|
|
|
4953
4953
|
* Default: `false`
|
|
4954
4954
|
*/
|
|
4955
4955
|
refreshCart?: boolean;
|
|
4956
|
-
/**
|
|
4957
|
-
* Specifies the level of **business validation** to perform during cart calculation,
|
|
4958
|
-
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
4959
|
-
*/
|
|
4960
|
-
validationsConfig?: ValidationsConfigWithLiterals;
|
|
4961
|
-
/**
|
|
4962
|
-
* Optional custom configuration for the calculation.
|
|
4963
|
-
* If not provided, all price components are calculated by default.
|
|
4964
|
-
*/
|
|
4965
|
-
customCalculationConfig?: CalculationConfig;
|
|
4966
4956
|
}
|
|
4967
4957
|
/**
|
|
4968
4958
|
* Estimates the cart totals based on its current state and the selected
|
|
@@ -4999,6 +4989,11 @@ interface EstimateCurrentCartOptions {
|
|
|
4999
4989
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5000
4990
|
*/
|
|
5001
4991
|
validationConfig?: ValidationsConfigWithLiterals;
|
|
4992
|
+
/**
|
|
4993
|
+
* Whether to calculate order-level discounts.
|
|
4994
|
+
* TODO: Currently i's ignored and always treated as true.
|
|
4995
|
+
*/
|
|
4996
|
+
calculateOrderDiscounts?: boolean;
|
|
5002
4997
|
/**
|
|
5003
4998
|
* Whether to calculate delivery costs.
|
|
5004
4999
|
* Default: false
|
|
@@ -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"]
|
|
@@ -1698,6 +1692,7 @@ async function estimateCurrentCart2(options) {
|
|
|
1698
1692
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1699
1693
|
refreshCart: options?.refreshCart,
|
|
1700
1694
|
validationConfig: options?.validationConfig,
|
|
1695
|
+
calculateOrderDiscounts: options?.calculateOrderDiscounts,
|
|
1701
1696
|
calculateDelivery: options?.calculateDelivery,
|
|
1702
1697
|
calculateAdditionalFees: options?.calculateAdditionalFees,
|
|
1703
1698
|
calculateTax: options?.calculateTax,
|
|
@@ -1738,6 +1733,7 @@ async function estimateCurrentCart2(options) {
|
|
|
1738
1733
|
explicitPathsToArguments: {
|
|
1739
1734
|
refreshCart: "$[0].refreshCart",
|
|
1740
1735
|
validationConfig: "$[0].validationConfig",
|
|
1736
|
+
calculateOrderDiscounts: "$[0].calculateOrderDiscounts",
|
|
1741
1737
|
calculateDelivery: "$[0].calculateDelivery",
|
|
1742
1738
|
calculateAdditionalFees: "$[0].calculateAdditionalFees",
|
|
1743
1739
|
calculateTax: "$[0].calculateTax",
|