@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).
@@ -171,18 +171,10 @@ function createCart(payload) {
171
171
  paths: [
172
172
  { path: "cart.createdDate" },
173
173
  { path: "cart.updatedDate" },
174
- {
175
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
176
- },
177
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
178
174
  {
179
175
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
180
176
  },
181
177
  { path: "cart.lineItems.attributes.serviceProperties.scheduledDate" },
182
- {
183
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
184
- },
185
- { path: "customItems.attributes.image.urlExpirationDate" },
186
178
  {
187
179
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
188
180
  },
@@ -227,10 +219,6 @@ function createCart(payload) {
227
219
  paths: [
228
220
  { path: "cart.createdDate" },
229
221
  { path: "cart.updatedDate" },
230
- {
231
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
232
- },
233
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
234
222
  {
235
223
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
236
224
  },
@@ -280,10 +268,6 @@ function getCart(payload) {
280
268
  paths: [
281
269
  { path: "cart.createdDate" },
282
270
  { path: "cart.updatedDate" },
283
- {
284
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
285
- },
286
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
287
271
  {
288
272
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
289
273
  },
@@ -323,10 +307,6 @@ function updateCart(payload) {
323
307
  paths: [
324
308
  { path: "cart.createdDate" },
325
309
  { path: "cart.updatedDate" },
326
- {
327
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
328
- },
329
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
330
310
  {
331
311
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
332
312
  },
@@ -367,10 +347,6 @@ function updateCart(payload) {
367
347
  paths: [
368
348
  { path: "cart.createdDate" },
369
349
  { path: "cart.updatedDate" },
370
- {
371
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
372
- },
373
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
374
350
  {
375
351
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
376
352
  },
@@ -441,10 +417,6 @@ function refreshCart(payload) {
441
417
  paths: [
442
418
  { path: "cart.createdDate" },
443
419
  { path: "cart.updatedDate" },
444
- {
445
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
446
- },
447
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
448
420
  {
449
421
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
450
422
  },
@@ -494,10 +466,6 @@ function calculateCart(payload) {
494
466
  paths: [
495
467
  { path: "cart.createdDate" },
496
468
  { path: "cart.updatedDate" },
497
- {
498
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
499
- },
500
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
501
469
  {
502
470
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
503
471
  },
@@ -585,10 +553,6 @@ function addLineItems(payload) {
585
553
  {
586
554
  transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
587
555
  paths: [
588
- {
589
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
590
- },
591
- { path: "customItems.attributes.image.urlExpirationDate" },
592
556
  {
593
557
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
594
558
  },
@@ -616,10 +580,6 @@ function addLineItems(payload) {
616
580
  paths: [
617
581
  { path: "cart.createdDate" },
618
582
  { path: "cart.updatedDate" },
619
- {
620
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
621
- },
622
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
623
583
  {
624
584
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
625
585
  },
@@ -669,10 +629,6 @@ function removeLineItems(payload) {
669
629
  paths: [
670
630
  { path: "cart.createdDate" },
671
631
  { path: "cart.updatedDate" },
672
- {
673
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
674
- },
675
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
676
632
  {
677
633
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
678
634
  },
@@ -722,10 +678,6 @@ function updateLineItems(payload) {
722
678
  paths: [
723
679
  { path: "cart.createdDate" },
724
680
  { path: "cart.updatedDate" },
725
- {
726
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
727
- },
728
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
729
681
  {
730
682
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
731
683
  },
@@ -775,10 +727,6 @@ function addCoupon(payload) {
775
727
  paths: [
776
728
  { path: "cart.createdDate" },
777
729
  { path: "cart.updatedDate" },
778
- {
779
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
780
- },
781
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
782
730
  {
783
731
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
784
732
  },
@@ -828,10 +776,6 @@ function removeCoupon(payload) {
828
776
  paths: [
829
777
  { path: "cart.createdDate" },
830
778
  { path: "cart.updatedDate" },
831
- {
832
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
833
- },
834
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
835
779
  {
836
780
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
837
781
  },
@@ -881,10 +825,6 @@ function addGiftCard(payload) {
881
825
  paths: [
882
826
  { path: "cart.createdDate" },
883
827
  { path: "cart.updatedDate" },
884
- {
885
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
886
- },
887
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
888
828
  {
889
829
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
890
830
  },
@@ -934,10 +874,6 @@ function removeGiftCard(payload) {
934
874
  paths: [
935
875
  { path: "cart.createdDate" },
936
876
  { path: "cart.updatedDate" },
937
- {
938
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
939
- },
940
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
941
877
  {
942
878
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
943
879
  },
@@ -987,10 +923,6 @@ function markCartAsCompleted(payload) {
987
923
  paths: [
988
924
  { path: "cart.createdDate" },
989
925
  { path: "cart.updatedDate" },
990
- {
991
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
992
- },
993
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
994
926
  {
995
927
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
996
928
  },
@@ -1474,6 +1406,7 @@ async function calculateCart2(cartId, options) {
1474
1406
  const { httpClient, sideEffects } = arguments[2];
1475
1407
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1476
1408
  cartId,
1409
+ refreshCart: options?.refreshCart,
1477
1410
  validationsConfig: options?.validationsConfig,
1478
1411
  customCalculationConfig: options?.customCalculationConfig
1479
1412
  });
@@ -1511,6 +1444,7 @@ async function calculateCart2(cartId, options) {
1511
1444
  spreadPathsToArguments: {},
1512
1445
  explicitPathsToArguments: {
1513
1446
  cartId: "$[0]",
1447
+ refreshCart: "$[1].refreshCart",
1514
1448
  validationsConfig: "$[1].validationsConfig",
1515
1449
  customCalculationConfig: "$[1].customCalculationConfig"
1516
1450
  },