@wix/auto_sdk_ecom_current-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.
- package/build/cjs/index.d.ts +28 -16
- package/build/cjs/index.js +2 -64
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +2 -64
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +22 -19
- package/build/cjs/meta.js +0 -64
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +28 -16
- package/build/es/index.mjs +2 -64
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +2 -64
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +22 -19
- package/build/es/meta.mjs +0 -64
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +0 -3
- package/build/internal/cjs/index.js +2 -64
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +28 -19
- package/build/internal/cjs/index.typings.js +2 -64
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +22 -19
- package/build/internal/cjs/meta.js +0 -64
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +0 -3
- package/build/internal/es/index.mjs +2 -64
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +28 -19
- package/build/internal/es/index.typings.mjs +2 -64
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +22 -19
- package/build/internal/es/meta.mjs +0 -64
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
/**
|
|
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?:
|
|
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?:
|
|
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
|
-
|
|
2698
|
+
completed?: boolean;
|
|
2691
2699
|
}
|
|
2692
2700
|
interface AddLineItemsRequest {
|
|
2693
2701
|
/**
|
|
@@ -2866,7 +2874,6 @@ interface CreateCurrentCartOptions {
|
|
|
2866
2874
|
/**
|
|
2867
2875
|
* Coupons to apply.
|
|
2868
2876
|
* Currently only one is supported.
|
|
2869
|
-
* If the coupon code is invalid, the cart will be created without it.
|
|
2870
2877
|
* @maxSize 1
|
|
2871
2878
|
* @minLength 1
|
|
2872
2879
|
* @maxLength 50
|
|
@@ -2875,7 +2882,6 @@ interface CreateCurrentCartOptions {
|
|
|
2875
2882
|
/**
|
|
2876
2883
|
* Gift cards to add.
|
|
2877
2884
|
* Currently only one is support.
|
|
2878
|
-
* If the gift card code is invalid, the cart will be created without it.
|
|
2879
2885
|
* @maxSize 1
|
|
2880
2886
|
* @minLength 8
|
|
2881
2887
|
* @maxLength 20
|
|
@@ -2883,6 +2889,12 @@ interface CreateCurrentCartOptions {
|
|
|
2883
2889
|
giftCardCodes?: string[];
|
|
2884
2890
|
}
|
|
2885
2891
|
interface CalculateCurrentCartOptions {
|
|
2892
|
+
/**
|
|
2893
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before calculating the cart.
|
|
2894
|
+
*
|
|
2895
|
+
* Default: `false`
|
|
2896
|
+
*/
|
|
2897
|
+
refreshCart?: boolean;
|
|
2886
2898
|
/**
|
|
2887
2899
|
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2888
2900
|
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
package/build/cjs/index.js
CHANGED
|
@@ -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
|
},
|