@wix/auto_sdk_ecom_current-cart-v-2 1.0.22 → 1.0.23

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.
@@ -28,7 +28,10 @@ interface Cart {
28
28
  * @readonly
29
29
  */
30
30
  lineItems?: V2LineItem[];
31
- /** The sum of all line item final prices. */
31
+ /**
32
+ * The sum of all line item final prices.
33
+ * @readonly
34
+ */
32
35
  subtotal?: ConvertedMoney;
33
36
  /**
34
37
  * Optional message left by the customer.
@@ -40,6 +43,7 @@ interface Cart {
40
43
  * List of coupons added to the Cart.
41
44
  * Currently, only one coupon code is supported.
42
45
  * @maxSize 1
46
+ * @readonly
43
47
  */
44
48
  coupons?: Coupon[];
45
49
  /** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
@@ -2159,8 +2163,10 @@ interface CustomItemPaymentConfig {
2159
2163
  /**
2160
2164
  * Partial payment to be paid upfront during the checkout.
2161
2165
  * Eligible for catalog items with `lineItem.paymentOption` type `DEPOSIT_ONLINE` only.
2166
+ * @format DECIMAL_VALUE
2167
+ * @decimalValue options { gte:0, lte:1000000000000000, maxScale:3 }
2162
2168
  */
2163
- depositAmount?: ConvertedMoney;
2169
+ depositAmount?: string | null;
2164
2170
  /**
2165
2171
  * Type of selected payment option for current item.
2166
2172
  *
@@ -2197,6 +2203,12 @@ interface RefreshCurrentCartResponse {
2197
2203
  cart?: Cart;
2198
2204
  }
2199
2205
  interface CalculateCurrentCartRequest {
2206
+ /**
2207
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
2208
+ *
2209
+ * Default: `false`
2210
+ */
2211
+ refreshCart?: boolean;
2200
2212
  /**
2201
2213
  * Specifies the level of **business validation** to perform during cart calculation,
2202
2214
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
@@ -2584,6 +2596,12 @@ interface CalculateCartRequest {
2584
2596
  * @format GUID
2585
2597
  */
2586
2598
  cartId?: string;
2599
+ /**
2600
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
2601
+ *
2602
+ * Default: `false`
2603
+ */
2604
+ refreshCart?: boolean;
2587
2605
  /**
2588
2606
  * Specifies the level of **business validation** to perform during cart calculation,
2589
2607
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
@@ -2883,6 +2901,12 @@ interface CreateCurrentCartOptions {
2883
2901
  giftCardCodes?: string[];
2884
2902
  }
2885
2903
  interface CalculateCurrentCartOptions {
2904
+ /**
2905
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
2906
+ *
2907
+ * Default: `false`
2908
+ */
2909
+ refreshCart?: boolean;
2886
2910
  /**
2887
2911
  * Specifies the level of **business validation** to perform during cart calculation,
2888
2912
  * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
@@ -112,18 +112,10 @@ function createCurrentCart(payload) {
112
112
  paths: [
113
113
  { path: "cart.createdDate" },
114
114
  { path: "cart.updatedDate" },
115
- {
116
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
117
- },
118
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
119
115
  {
120
116
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
121
117
  },
122
118
  { path: "cart.lineItems.attributes.serviceProperties.scheduledDate" },
123
- {
124
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
125
- },
126
- { path: "customItems.attributes.image.urlExpirationDate" },
127
119
  {
128
120
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
129
121
  },
@@ -168,10 +160,6 @@ function createCurrentCart(payload) {
168
160
  paths: [
169
161
  { path: "cart.createdDate" },
170
162
  { path: "cart.updatedDate" },
171
- {
172
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
173
- },
174
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
175
163
  {
176
164
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
177
165
  },
@@ -221,10 +209,6 @@ function getCurrentCart(payload) {
221
209
  paths: [
222
210
  { path: "cart.createdDate" },
223
211
  { path: "cart.updatedDate" },
224
- {
225
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
226
- },
227
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
228
212
  {
229
213
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
230
214
  },
@@ -264,10 +248,6 @@ function updateCurrentCart(payload) {
264
248
  paths: [
265
249
  { path: "cart.createdDate" },
266
250
  { path: "cart.updatedDate" },
267
- {
268
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
269
- },
270
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
271
251
  {
272
252
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
273
253
  },
@@ -308,10 +288,6 @@ function updateCurrentCart(payload) {
308
288
  paths: [
309
289
  { path: "cart.createdDate" },
310
290
  { path: "cart.updatedDate" },
311
- {
312
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
313
- },
314
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
315
291
  {
316
292
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
317
293
  },
@@ -382,10 +358,6 @@ function refreshCurrentCart(payload) {
382
358
  paths: [
383
359
  { path: "cart.createdDate" },
384
360
  { path: "cart.updatedDate" },
385
- {
386
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
387
- },
388
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
389
361
  {
390
362
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
391
363
  },
@@ -435,10 +407,6 @@ function calculateCurrentCart(payload) {
435
407
  paths: [
436
408
  { path: "cart.createdDate" },
437
409
  { path: "cart.updatedDate" },
438
- {
439
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
440
- },
441
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
442
410
  {
443
411
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
444
412
  },
@@ -484,10 +452,6 @@ function addLineItemsToCurrentCart(payload) {
484
452
  {
485
453
  transformFn: transformSDKTimestampToRESTTimestamp,
486
454
  paths: [
487
- {
488
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
489
- },
490
- { path: "customItems.attributes.image.urlExpirationDate" },
491
455
  {
492
456
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
493
457
  },
@@ -515,10 +479,6 @@ function addLineItemsToCurrentCart(payload) {
515
479
  paths: [
516
480
  { path: "cart.createdDate" },
517
481
  { path: "cart.updatedDate" },
518
- {
519
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
520
- },
521
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
522
482
  {
523
483
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
524
484
  },
@@ -568,10 +528,6 @@ function removeLineItemsFromCurrentCart(payload) {
568
528
  paths: [
569
529
  { path: "cart.createdDate" },
570
530
  { path: "cart.updatedDate" },
571
- {
572
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
573
- },
574
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
575
531
  {
576
532
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
577
533
  },
@@ -621,10 +577,6 @@ function updateLineItemsInCurrentCart(payload) {
621
577
  paths: [
622
578
  { path: "cart.createdDate" },
623
579
  { path: "cart.updatedDate" },
624
- {
625
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
626
- },
627
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
628
580
  {
629
581
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
630
582
  },
@@ -674,10 +626,6 @@ function addCouponToCurrentCart(payload) {
674
626
  paths: [
675
627
  { path: "cart.createdDate" },
676
628
  { path: "cart.updatedDate" },
677
- {
678
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
679
- },
680
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
681
629
  {
682
630
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
683
631
  },
@@ -727,10 +675,6 @@ function removeCouponFromCurrentCart(payload) {
727
675
  paths: [
728
676
  { path: "cart.createdDate" },
729
677
  { path: "cart.updatedDate" },
730
- {
731
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
732
- },
733
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
734
678
  {
735
679
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
736
680
  },
@@ -780,10 +724,6 @@ function addGiftCardToCurrentCart(payload) {
780
724
  paths: [
781
725
  { path: "cart.createdDate" },
782
726
  { path: "cart.updatedDate" },
783
- {
784
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
785
- },
786
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
787
727
  {
788
728
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
789
729
  },
@@ -833,10 +773,6 @@ function removeGiftCardFromCurrentCart(payload) {
833
773
  paths: [
834
774
  { path: "cart.createdDate" },
835
775
  { path: "cart.updatedDate" },
836
- {
837
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
838
- },
839
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
840
776
  {
841
777
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
842
778
  },
@@ -1292,6 +1228,7 @@ async function refreshCurrentCart2() {
1292
1228
  async function calculateCurrentCart2(options) {
1293
1229
  const { httpClient, sideEffects } = arguments[1];
1294
1230
  const payload = renameKeysFromSDKRequestToRESTRequest({
1231
+ refreshCart: options?.refreshCart,
1295
1232
  validationsConfig: options?.validationsConfig,
1296
1233
  customCalculationConfig: options?.customCalculationConfig
1297
1234
  });
@@ -1328,6 +1265,7 @@ async function calculateCurrentCart2(options) {
1328
1265
  {
1329
1266
  spreadPathsToArguments: {},
1330
1267
  explicitPathsToArguments: {
1268
+ refreshCart: "$[0].refreshCart",
1331
1269
  validationsConfig: "$[0].validationsConfig",
1332
1270
  customCalculationConfig: "$[0].customCalculationConfig"
1333
1271
  },