@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.
@@ -1775,6 +1775,7 @@ async function estimateCart2(cartId, options) {
1775
1775
  cartId,
1776
1776
  refreshCart: options?.refreshCart,
1777
1777
  validationConfig: options?.validationConfig,
1778
+ calculateOrderDiscounts: options?.calculateOrderDiscounts,
1778
1779
  calculateDelivery: options?.calculateDelivery,
1779
1780
  calculateAdditionalFees: options?.calculateAdditionalFees,
1780
1781
  calculateTax: options?.calculateTax,
@@ -1816,6 +1817,7 @@ async function estimateCart2(cartId, options) {
1816
1817
  cartId: "$[0]",
1817
1818
  refreshCart: "$[1].refreshCart",
1818
1819
  validationConfig: "$[1].validationConfig",
1820
+ calculateOrderDiscounts: "$[1].calculateOrderDiscounts",
1819
1821
  calculateDelivery: "$[1].calculateDelivery",
1820
1822
  calculateAdditionalFees: "$[1].calculateAdditionalFees",
1821
1823
  calculateTax: "$[1].calculateTax",
@@ -1833,9 +1835,7 @@ async function calculateCart2(cartId, options) {
1833
1835
  const { httpClient, sideEffects } = arguments[2];
1834
1836
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1835
1837
  cartId,
1836
- refreshCart: options?.refreshCart,
1837
- validationsConfig: options?.validationsConfig,
1838
- customCalculationConfig: options?.customCalculationConfig
1838
+ refreshCart: options?.refreshCart
1839
1839
  });
1840
1840
  const reqOpts = calculateCart(payload);
1841
1841
  sideEffects?.onSiteCall?.();
@@ -1871,9 +1871,7 @@ async function calculateCart2(cartId, options) {
1871
1871
  spreadPathsToArguments: {},
1872
1872
  explicitPathsToArguments: {
1873
1873
  cartId: "$[0]",
1874
- refreshCart: "$[1].refreshCart",
1875
- validationsConfig: "$[1].validationsConfig",
1876
- customCalculationConfig: "$[1].customCalculationConfig"
1874
+ refreshCart: "$[1].refreshCart"
1877
1875
  },
1878
1876
  singleArgumentUnchanged: false
1879
1877
  },