@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).
@@ -166,18 +166,10 @@ function createCurrentCart(payload) {
166
166
  paths: [
167
167
  { path: "cart.createdDate" },
168
168
  { path: "cart.updatedDate" },
169
- {
170
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
171
- },
172
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
173
169
  {
174
170
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
175
171
  },
176
172
  { path: "cart.lineItems.attributes.serviceProperties.scheduledDate" },
177
- {
178
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
179
- },
180
- { path: "customItems.attributes.image.urlExpirationDate" },
181
173
  {
182
174
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
183
175
  },
@@ -222,10 +214,6 @@ function createCurrentCart(payload) {
222
214
  paths: [
223
215
  { path: "cart.createdDate" },
224
216
  { path: "cart.updatedDate" },
225
- {
226
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
227
- },
228
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
229
217
  {
230
218
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
231
219
  },
@@ -275,10 +263,6 @@ function getCurrentCart(payload) {
275
263
  paths: [
276
264
  { path: "cart.createdDate" },
277
265
  { path: "cart.updatedDate" },
278
- {
279
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
280
- },
281
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
282
266
  {
283
267
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
284
268
  },
@@ -318,10 +302,6 @@ function updateCurrentCart(payload) {
318
302
  paths: [
319
303
  { path: "cart.createdDate" },
320
304
  { path: "cart.updatedDate" },
321
- {
322
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
323
- },
324
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
325
305
  {
326
306
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
327
307
  },
@@ -362,10 +342,6 @@ function updateCurrentCart(payload) {
362
342
  paths: [
363
343
  { path: "cart.createdDate" },
364
344
  { path: "cart.updatedDate" },
365
- {
366
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
367
- },
368
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
369
345
  {
370
346
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
371
347
  },
@@ -436,10 +412,6 @@ function refreshCurrentCart(payload) {
436
412
  paths: [
437
413
  { path: "cart.createdDate" },
438
414
  { path: "cart.updatedDate" },
439
- {
440
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
441
- },
442
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
443
415
  {
444
416
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
445
417
  },
@@ -489,10 +461,6 @@ function calculateCurrentCart(payload) {
489
461
  paths: [
490
462
  { path: "cart.createdDate" },
491
463
  { path: "cart.updatedDate" },
492
- {
493
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
494
- },
495
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
496
464
  {
497
465
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
498
466
  },
@@ -538,10 +506,6 @@ function addLineItemsToCurrentCart(payload) {
538
506
  {
539
507
  transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
540
508
  paths: [
541
- {
542
- path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
543
- },
544
- { path: "customItems.attributes.image.urlExpirationDate" },
545
509
  {
546
510
  path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
547
511
  },
@@ -569,10 +533,6 @@ function addLineItemsToCurrentCart(payload) {
569
533
  paths: [
570
534
  { path: "cart.createdDate" },
571
535
  { path: "cart.updatedDate" },
572
- {
573
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
574
- },
575
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
576
536
  {
577
537
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
578
538
  },
@@ -622,10 +582,6 @@ function removeLineItemsFromCurrentCart(payload) {
622
582
  paths: [
623
583
  { path: "cart.createdDate" },
624
584
  { path: "cart.updatedDate" },
625
- {
626
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
627
- },
628
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
629
585
  {
630
586
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
631
587
  },
@@ -675,10 +631,6 @@ function updateLineItemsInCurrentCart(payload) {
675
631
  paths: [
676
632
  { path: "cart.createdDate" },
677
633
  { path: "cart.updatedDate" },
678
- {
679
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
680
- },
681
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
682
634
  {
683
635
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
684
636
  },
@@ -728,10 +680,6 @@ function addCouponToCurrentCart(payload) {
728
680
  paths: [
729
681
  { path: "cart.createdDate" },
730
682
  { path: "cart.updatedDate" },
731
- {
732
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
733
- },
734
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
735
683
  {
736
684
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
737
685
  },
@@ -781,10 +729,6 @@ function removeCouponFromCurrentCart(payload) {
781
729
  paths: [
782
730
  { path: "cart.createdDate" },
783
731
  { path: "cart.updatedDate" },
784
- {
785
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
786
- },
787
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
788
732
  {
789
733
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
790
734
  },
@@ -834,10 +778,6 @@ function addGiftCardToCurrentCart(payload) {
834
778
  paths: [
835
779
  { path: "cart.createdDate" },
836
780
  { path: "cart.updatedDate" },
837
- {
838
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
839
- },
840
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
841
781
  {
842
782
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
843
783
  },
@@ -887,10 +827,6 @@ function removeGiftCardFromCurrentCart(payload) {
887
827
  paths: [
888
828
  { path: "cart.createdDate" },
889
829
  { path: "cart.updatedDate" },
890
- {
891
- path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
892
- },
893
- { path: "cart.lineItems.attributes.image.urlExpirationDate" },
894
830
  {
895
831
  path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
896
832
  },
@@ -1346,6 +1282,7 @@ async function refreshCurrentCart2() {
1346
1282
  async function calculateCurrentCart2(options) {
1347
1283
  const { httpClient, sideEffects } = arguments[1];
1348
1284
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1285
+ refreshCart: options?.refreshCart,
1349
1286
  validationsConfig: options?.validationsConfig,
1350
1287
  customCalculationConfig: options?.customCalculationConfig
1351
1288
  });
@@ -1382,6 +1319,7 @@ async function calculateCurrentCart2(options) {
1382
1319
  {
1383
1320
  spreadPathsToArguments: {},
1384
1321
  explicitPathsToArguments: {
1322
+ refreshCart: "$[0].refreshCart",
1385
1323
  validationsConfig: "$[0].validationsConfig",
1386
1324
  customCalculationConfig: "$[0].customCalculationConfig"
1387
1325
  },