@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/es/index.d.mts
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/es/index.mjs
CHANGED
|
@@ -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
|
},
|