@wix/auto_sdk_ecom_cart-v-2 1.0.22 → 1.0.24

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.
Files changed (35) hide show
  1. package/build/cjs/index.d.ts +34 -19
  2. package/build/cjs/index.js +2 -68
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.js +2 -68
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.d.ts +22 -19
  7. package/build/cjs/meta.js +0 -68
  8. package/build/cjs/meta.js.map +1 -1
  9. package/build/es/index.d.mts +34 -19
  10. package/build/es/index.mjs +2 -68
  11. package/build/es/index.mjs.map +1 -1
  12. package/build/es/index.typings.mjs +2 -68
  13. package/build/es/index.typings.mjs.map +1 -1
  14. package/build/es/meta.d.mts +22 -19
  15. package/build/es/meta.mjs +0 -68
  16. package/build/es/meta.mjs.map +1 -1
  17. package/build/internal/cjs/index.d.ts +1 -3
  18. package/build/internal/cjs/index.js +2 -68
  19. package/build/internal/cjs/index.js.map +1 -1
  20. package/build/internal/cjs/index.typings.d.ts +35 -22
  21. package/build/internal/cjs/index.typings.js +2 -68
  22. package/build/internal/cjs/index.typings.js.map +1 -1
  23. package/build/internal/cjs/meta.d.ts +22 -19
  24. package/build/internal/cjs/meta.js +0 -68
  25. package/build/internal/cjs/meta.js.map +1 -1
  26. package/build/internal/es/index.d.mts +1 -3
  27. package/build/internal/es/index.mjs +2 -68
  28. package/build/internal/es/index.mjs.map +1 -1
  29. package/build/internal/es/index.typings.d.mts +35 -22
  30. package/build/internal/es/index.typings.mjs +2 -68
  31. package/build/internal/es/index.typings.mjs.map +1 -1
  32. package/build/internal/es/meta.d.mts +22 -19
  33. package/build/internal/es/meta.mjs +0 -68
  34. package/build/internal/es/meta.mjs.map +1 -1
  35. package/package.json +2 -2
@@ -22,13 +22,15 @@ interface Cart {
22
22
  revision?: string | null;
23
23
  /**
24
24
  * Line items added to the Cart by the customer.
25
- * This list may include both valid items (in stock) and invalid ones (e.g., out of stock).
26
- * When submitting an order, only valid items will be included in the order.
25
+ * This list may include items in stock and invalid out out stock.
27
26
  * @maxSize 300
28
27
  * @readonly
29
28
  */
30
29
  lineItems?: V2LineItem[];
31
- /** The sum of all line item final prices. */
30
+ /**
31
+ * The sum of all line item final prices.
32
+ * @readonly
33
+ */
32
34
  subtotal?: ConvertedMoney;
33
35
  /**
34
36
  * Optional message left by the customer.
@@ -40,6 +42,7 @@ interface Cart {
40
42
  * List of coupons added to the Cart.
41
43
  * Currently, only one coupon code is supported.
42
44
  * @maxSize 1
45
+ * @readonly
43
46
  */
44
47
  coupons?: Coupon[];
45
48
  /** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
@@ -224,6 +227,7 @@ interface ConvertedMoney {
224
227
  * Default: `amount`.
225
228
  * @format DECIMAL_VALUE
226
229
  * @decimalValue options { gte:0, lte:999999999, maxScale:3 }
230
+ * @readonly
227
231
  */
228
232
  convertedAmount?: string;
229
233
  }
@@ -1986,7 +1990,6 @@ interface CreateCurrentCartRequest {
1986
1990
  /**
1987
1991
  * Coupons to apply.
1988
1992
  * Currently only one is supported.
1989
- * If the coupon code is invalid, the cart will be created without it.
1990
1993
  * @maxSize 1
1991
1994
  * @minLength 1
1992
1995
  * @maxLength 50
@@ -1995,7 +1998,6 @@ interface CreateCurrentCartRequest {
1995
1998
  /**
1996
1999
  * Gift cards to add.
1997
2000
  * Currently only one is support.
1998
- * If the gift card code is invalid, the cart will be created without it.
1999
2001
  * @maxSize 1
2000
2002
  * @minLength 8
2001
2003
  * @maxLength 20
@@ -2070,18 +2072,14 @@ interface CustomItemPricingInfo {
2070
2072
  /**
2071
2073
  * Sale price of a single item, without modifiers.
2072
2074
  * Includes tax if `tax_info.prices_include_tax` is true.
2073
- * @format DECIMAL_VALUE
2074
- * @decimalValue options { gte:0, lte:1000000000000000, maxScale:3 }
2075
2075
  */
2076
- price?: string;
2076
+ price?: ConvertedMoney;
2077
2077
  /**
2078
2078
  * Full price of a single item before any discounts, without modifiers.
2079
2079
  * Defaults to `price` when not provided.
2080
2080
  * Includes tax if `tax_info.prices_include_tax` is true.
2081
- * @format DECIMAL_VALUE
2082
- * @decimalValue options { gte:0, lte:1000000000000000, maxScale:3 }
2083
2081
  */
2084
- fullPrice?: string | null;
2082
+ fullPrice?: ConvertedMoney;
2085
2083
  /**
2086
2084
  * Additional description for the price.
2087
2085
  * For example, when price is 0 but additional details about the actual price are needed - "Starts at $67".
@@ -2197,6 +2195,12 @@ interface RefreshCurrentCartResponse {
2197
2195
  cart?: Cart;
2198
2196
  }
2199
2197
  interface CalculateCurrentCartRequest {
2198
+ /**
2199
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
2200
+ *
2201
+ * Default: `false`
2202
+ */
2203
+ refreshCart?: boolean;
2200
2204
  /**
2201
2205
  * Specifies the level of **business validation** to perform during cart calculation,
2202
2206
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
@@ -2519,7 +2523,6 @@ interface CreateCartRequest {
2519
2523
  /**
2520
2524
  * Coupons to apply.
2521
2525
  * Currently only one is supported.
2522
- * If the coupon code is invalid, the cart will be created without it.
2523
2526
  * @maxSize 1
2524
2527
  * @minLength 1
2525
2528
  * @maxLength 50
@@ -2528,7 +2531,6 @@ interface CreateCartRequest {
2528
2531
  /**
2529
2532
  * Gift cards to add.
2530
2533
  * Currently only one is support.
2531
- * If the gift card code is invalid, the cart will be created without it.
2532
2534
  * @maxSize 1
2533
2535
  * @minLength 8
2534
2536
  * @maxLength 20
@@ -2584,6 +2586,12 @@ interface CalculateCartRequest {
2584
2586
  * @format GUID
2585
2587
  */
2586
2588
  cartId: string;
2589
+ /**
2590
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
2591
+ *
2592
+ * Default: `false`
2593
+ */
2594
+ refreshCart?: boolean;
2587
2595
  /**
2588
2596
  * Specifies the level of **business validation** to perform during cart calculation,
2589
2597
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
@@ -2687,7 +2695,7 @@ interface PlaceOrderResponse {
2687
2695
  */
2688
2696
  paymentGatewayOrderId?: string | null;
2689
2697
  /** Whether an order was successfully created from this cart and the payment transaction was completed. */
2690
- cartCompleted?: boolean;
2698
+ completed?: boolean;
2691
2699
  }
2692
2700
  interface AddLineItemsRequest {
2693
2701
  /**
@@ -2868,7 +2876,6 @@ interface CreateCartOptions {
2868
2876
  /**
2869
2877
  * Coupons to apply.
2870
2878
  * Currently only one is supported.
2871
- * If the coupon code is invalid, the cart will be created without it.
2872
2879
  * @maxSize 1
2873
2880
  * @minLength 1
2874
2881
  * @maxLength 50
@@ -2877,7 +2884,6 @@ interface CreateCartOptions {
2877
2884
  /**
2878
2885
  * Gift cards to add.
2879
2886
  * Currently only one is support.
2880
- * If the gift card code is invalid, the cart will be created without it.
2881
2887
  * @maxSize 1
2882
2888
  * @minLength 8
2883
2889
  * @maxLength 20
@@ -2908,13 +2914,15 @@ interface UpdateCart {
2908
2914
  revision?: string | null;
2909
2915
  /**
2910
2916
  * Line items added to the Cart by the customer.
2911
- * This list may include both valid items (in stock) and invalid ones (e.g., out of stock).
2912
- * When submitting an order, only valid items will be included in the order.
2917
+ * This list may include items in stock and invalid out out stock.
2913
2918
  * @maxSize 300
2914
2919
  * @readonly
2915
2920
  */
2916
2921
  lineItems?: V2LineItem[];
2917
- /** The sum of all line item final prices. */
2922
+ /**
2923
+ * The sum of all line item final prices.
2924
+ * @readonly
2925
+ */
2918
2926
  subtotal?: ConvertedMoney;
2919
2927
  /**
2920
2928
  * Optional message left by the customer.
@@ -2926,6 +2934,7 @@ interface UpdateCart {
2926
2934
  * List of coupons added to the Cart.
2927
2935
  * Currently, only one coupon code is supported.
2928
2936
  * @maxSize 1
2937
+ * @readonly
2929
2938
  */
2930
2939
  coupons?: Coupon[];
2931
2940
  /** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
@@ -2983,6 +2992,12 @@ interface UpdateCart {
2983
2992
  extendedFields?: ExtendedFields;
2984
2993
  }
2985
2994
  interface CalculateCartOptions {
2995
+ /**
2996
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
2997
+ *
2998
+ * Default: `false`
2999
+ */
3000
+ refreshCart?: boolean;
2986
3001
  /**
2987
3002
  * Specifies the level of **business validation** to perform during cart calculation,
2988
3003
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
@@ -113,18 +113,10 @@ function createCart(payload) {
113
113
  paths: [
114
114
  { path: "cart.createdDate" },
115
115
  { path: "cart.updatedDate" },
116
- {
117
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
118
- },
119
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
120
116
  {
121
117
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
122
118
  },
123
119
  { path: "cart.lineItems.attributes.serviceProperties.scheduledDate" },
124
- {
125
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
126
- },
127
- { path: "customItems.attributes.image.urlExpirationDate" },
128
120
  {
129
121
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
130
122
  },
@@ -169,10 +161,6 @@ function createCart(payload) {
169
161
  paths: [
170
162
  { path: "cart.createdDate" },
171
163
  { path: "cart.updatedDate" },
172
- {
173
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
174
- },
175
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
176
164
  {
177
165
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
178
166
  },
@@ -222,10 +210,6 @@ function getCart(payload) {
222
210
  paths: [
223
211
  { path: "cart.createdDate" },
224
212
  { path: "cart.updatedDate" },
225
- {
226
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
227
- },
228
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
229
213
  {
230
214
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
231
215
  },
@@ -265,10 +249,6 @@ function updateCart(payload) {
265
249
  paths: [
266
250
  { path: "cart.createdDate" },
267
251
  { path: "cart.updatedDate" },
268
- {
269
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
270
- },
271
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
272
252
  {
273
253
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
274
254
  },
@@ -309,10 +289,6 @@ function updateCart(payload) {
309
289
  paths: [
310
290
  { path: "cart.createdDate" },
311
291
  { path: "cart.updatedDate" },
312
- {
313
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
314
- },
315
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
316
292
  {
317
293
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
318
294
  },
@@ -383,10 +359,6 @@ function refreshCart(payload) {
383
359
  paths: [
384
360
  { path: "cart.createdDate" },
385
361
  { path: "cart.updatedDate" },
386
- {
387
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
388
- },
389
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
390
362
  {
391
363
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
392
364
  },
@@ -436,10 +408,6 @@ function calculateCart(payload) {
436
408
  paths: [
437
409
  { path: "cart.createdDate" },
438
410
  { path: "cart.updatedDate" },
439
- {
440
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
441
- },
442
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
443
411
  {
444
412
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
445
413
  },
@@ -527,10 +495,6 @@ function addLineItems(payload) {
527
495
  {
528
496
  transformFn: transformSDKTimestampToRESTTimestamp,
529
497
  paths: [
530
- {
531
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
532
- },
533
- { path: "customItems.attributes.image.urlExpirationDate" },
534
498
  {
535
499
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
536
500
  },
@@ -558,10 +522,6 @@ function addLineItems(payload) {
558
522
  paths: [
559
523
  { path: "cart.createdDate" },
560
524
  { path: "cart.updatedDate" },
561
- {
562
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
563
- },
564
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
565
525
  {
566
526
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
567
527
  },
@@ -611,10 +571,6 @@ function removeLineItems(payload) {
611
571
  paths: [
612
572
  { path: "cart.createdDate" },
613
573
  { path: "cart.updatedDate" },
614
- {
615
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
616
- },
617
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
618
574
  {
619
575
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
620
576
  },
@@ -664,10 +620,6 @@ function updateLineItems(payload) {
664
620
  paths: [
665
621
  { path: "cart.createdDate" },
666
622
  { path: "cart.updatedDate" },
667
- {
668
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
669
- },
670
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
671
623
  {
672
624
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
673
625
  },
@@ -717,10 +669,6 @@ function addCoupon(payload) {
717
669
  paths: [
718
670
  { path: "cart.createdDate" },
719
671
  { path: "cart.updatedDate" },
720
- {
721
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
722
- },
723
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
724
672
  {
725
673
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
726
674
  },
@@ -770,10 +718,6 @@ function removeCoupon(payload) {
770
718
  paths: [
771
719
  { path: "cart.createdDate" },
772
720
  { path: "cart.updatedDate" },
773
- {
774
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
775
- },
776
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
777
721
  {
778
722
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
779
723
  },
@@ -823,10 +767,6 @@ function addGiftCard(payload) {
823
767
  paths: [
824
768
  { path: "cart.createdDate" },
825
769
  { path: "cart.updatedDate" },
826
- {
827
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
828
- },
829
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
830
770
  {
831
771
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
832
772
  },
@@ -876,10 +816,6 @@ function removeGiftCard(payload) {
876
816
  paths: [
877
817
  { path: "cart.createdDate" },
878
818
  { path: "cart.updatedDate" },
879
- {
880
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
881
- },
882
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
883
819
  {
884
820
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
885
821
  },
@@ -929,10 +865,6 @@ function markCartAsCompleted(payload) {
929
865
  paths: [
930
866
  { path: "cart.createdDate" },
931
867
  { path: "cart.updatedDate" },
932
- {
933
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
934
- },
935
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
936
868
  {
937
869
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
938
870
  },
@@ -1416,6 +1348,7 @@ async function calculateCart2(cartId, options) {
1416
1348
  const { httpClient, sideEffects } = arguments[2];
1417
1349
  const payload = renameKeysFromSDKRequestToRESTRequest({
1418
1350
  cartId,
1351
+ refreshCart: options?.refreshCart,
1419
1352
  validationsConfig: options?.validationsConfig,
1420
1353
  customCalculationConfig: options?.customCalculationConfig
1421
1354
  });
@@ -1453,6 +1386,7 @@ async function calculateCart2(cartId, options) {
1453
1386
  spreadPathsToArguments: {},
1454
1387
  explicitPathsToArguments: {
1455
1388
  cartId: "$[0]",
1389
+ refreshCart: "$[1].refreshCart",
1456
1390
  validationsConfig: "$[1].validationsConfig",
1457
1391
  customCalculationConfig: "$[1].customCalculationConfig"
1458
1392
  },