@wix/auto_sdk_ecom_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.
@@ -2037,9 +2037,15 @@ interface LineItemAdded {
2037
2037
  * @minLength 1
2038
2038
  * @maxLength 36
2039
2039
  */
2040
- appId?: string | null;
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;
@@ -5173,7 +5173,6 @@ declare function estimateCart(cartId: string, options?: EstimateCartOptions): Pr
5173
5173
  interface EstimateCartOptions {
5174
5174
  /**
5175
5175
  * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
5176
- *
5177
5176
  * Default: `false`
5178
5177
  */
5179
5178
  refreshCart?: boolean;
@@ -5182,6 +5181,11 @@ interface EstimateCartOptions {
5182
5181
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
5183
5182
  */
5184
5183
  validationConfig?: ValidationsConfigWithLiterals;
5184
+ /**
5185
+ * Whether to calculate order-level discounts.
5186
+ * TODO: Currently i's ignored and always treated as true.
5187
+ */
5188
+ calculateOrderDiscounts?: boolean;
5185
5189
  /**
5186
5190
  * Whether to calculate delivery costs.
5187
5191
  * Default: false
@@ -5226,16 +5230,6 @@ interface CalculateCartOptions {
5226
5230
  * Default: `false`
5227
5231
  */
5228
5232
  refreshCart?: boolean;
5229
- /**
5230
- * Specifies the level of **business validation** to perform during cart calculation,
5231
- * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
5232
- */
5233
- validationsConfig?: ValidationsConfigWithLiterals;
5234
- /**
5235
- * Optional custom configuration for the calculation.
5236
- * If not provided, all price components are calculated by default.
5237
- */
5238
- customCalculationConfig?: CalculationConfig;
5239
5233
  }
5240
5234
  /**
5241
5235
  * Retrieves the checkout URL for the Cart.
@@ -1700,6 +1700,7 @@ async function estimateCart2(cartId, options) {
1700
1700
  cartId,
1701
1701
  refreshCart: options?.refreshCart,
1702
1702
  validationConfig: options?.validationConfig,
1703
+ calculateOrderDiscounts: options?.calculateOrderDiscounts,
1703
1704
  calculateDelivery: options?.calculateDelivery,
1704
1705
  calculateAdditionalFees: options?.calculateAdditionalFees,
1705
1706
  calculateTax: options?.calculateTax,
@@ -1741,6 +1742,7 @@ async function estimateCart2(cartId, options) {
1741
1742
  cartId: "$[0]",
1742
1743
  refreshCart: "$[1].refreshCart",
1743
1744
  validationConfig: "$[1].validationConfig",
1745
+ calculateOrderDiscounts: "$[1].calculateOrderDiscounts",
1744
1746
  calculateDelivery: "$[1].calculateDelivery",
1745
1747
  calculateAdditionalFees: "$[1].calculateAdditionalFees",
1746
1748
  calculateTax: "$[1].calculateTax",
@@ -1758,9 +1760,7 @@ async function calculateCart2(cartId, options) {
1758
1760
  const { httpClient, sideEffects } = arguments[2];
1759
1761
  const payload = renameKeysFromSDKRequestToRESTRequest({
1760
1762
  cartId,
1761
- refreshCart: options?.refreshCart,
1762
- validationsConfig: options?.validationsConfig,
1763
- customCalculationConfig: options?.customCalculationConfig
1763
+ refreshCart: options?.refreshCart
1764
1764
  });
1765
1765
  const reqOpts = calculateCart(payload);
1766
1766
  sideEffects?.onSiteCall?.();
@@ -1796,9 +1796,7 @@ async function calculateCart2(cartId, options) {
1796
1796
  spreadPathsToArguments: {},
1797
1797
  explicitPathsToArguments: {
1798
1798
  cartId: "$[0]",
1799
- refreshCart: "$[1].refreshCart",
1800
- validationsConfig: "$[1].validationsConfig",
1801
- customCalculationConfig: "$[1].customCalculationConfig"
1799
+ refreshCart: "$[1].refreshCart"
1802
1800
  },
1803
1801
  singleArgumentUnchanged: false
1804
1802
  },