@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.
@@ -2076,9 +2076,15 @@ interface LineItemAdded {
2076
2076
  * @minLength 1
2077
2077
  * @maxLength 36
2078
2078
  */
2079
- appId?: string | null;
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;
@@ -5304,7 +5304,6 @@ declare function estimateCart(cartId: string, options?: EstimateCartOptions): Pr
5304
5304
  interface EstimateCartOptions {
5305
5305
  /**
5306
5306
  * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
5307
- *
5308
5307
  * Default: `false`
5309
5308
  */
5310
5309
  refreshCart?: boolean;
@@ -5313,6 +5312,11 @@ interface EstimateCartOptions {
5313
5312
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
5314
5313
  */
5315
5314
  validationConfig?: ValidationsConfigWithLiterals;
5315
+ /**
5316
+ * Whether to calculate order-level discounts.
5317
+ * TODO: Currently i's ignored and always treated as true.
5318
+ */
5319
+ calculateOrderDiscounts?: boolean;
5316
5320
  /**
5317
5321
  * Whether to calculate delivery costs.
5318
5322
  * Default: false
@@ -5357,16 +5361,6 @@ interface CalculateCartOptions {
5357
5361
  * Default: `false`
5358
5362
  */
5359
5363
  refreshCart?: boolean;
5360
- /**
5361
- * Specifies the level of **business validation** to perform during cart calculation,
5362
- * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
5363
- */
5364
- validationsConfig?: ValidationsConfigWithLiterals;
5365
- /**
5366
- * Optional custom configuration for the calculation.
5367
- * If not provided, all price components are calculated by default.
5368
- */
5369
- customCalculationConfig?: CalculationConfig;
5370
5364
  }
5371
5365
  /**
5372
5366
  * 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
  },