@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
|
|
@@ -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",
|