ce-storefront 0.13.1 → 0.13.2
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/FUNCTIONS.md +5 -22
- package/README.md +44 -58
- package/docs/sdks/auth/README.md +50 -90
- package/docs/sdks/carts/README.md +60 -108
- package/docs/sdks/catalog/README.md +55 -99
- package/docs/sdks/common/README.md +5 -9
- package/docs/sdks/customers/README.md +35 -63
- package/docs/sdks/orders/README.md +35 -63
- package/docs/sdks/shipping/README.md +5 -9
- package/esm/funcs/catalogGetProductDetail.js +2 -5
- package/esm/funcs/catalogGetProductDetail.js.map +1 -1
- package/esm/funcs/catalogGetVariantDetail.js +2 -5
- package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
- package/esm/funcs/catalogListCrosssellProducts.js +2 -1
- package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
- package/esm/funcs/catalogListProductVariants.js +2 -5
- package/esm/funcs/catalogListProductVariants.js.map +1 -1
- package/esm/funcs/catalogListProducts.js +2 -2
- package/esm/funcs/catalogListProducts.js.map +1 -1
- package/esm/funcs/catalogListSimilarProducts.js +2 -1
- package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
- package/esm/funcs/catalogListSkus.js +2 -2
- package/esm/funcs/catalogListSkus.js.map +1 -1
- package/esm/funcs/catalogListUpsellProducts.js +2 -1
- package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/errors/ceerror.d.ts +14 -2
- package/esm/models/errors/ceerror.d.ts.map +1 -1
- package/esm/models/errors/ceerror.js +1 -1
- package/esm/models/errors/ceerror.js.map +1 -1
- package/esm/models/operations/getproductdetail.d.ts +5 -5
- package/esm/models/operations/getproductdetail.d.ts.map +1 -1
- package/esm/models/operations/getproductdetail.js +4 -4
- package/esm/models/operations/getproductdetail.js.map +1 -1
- package/esm/models/operations/getvariantdetail.d.ts +5 -5
- package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
- package/esm/models/operations/getvariantdetail.js +4 -4
- package/esm/models/operations/getvariantdetail.js.map +1 -1
- package/esm/models/operations/listcrosssellproducts.d.ts +5 -0
- package/esm/models/operations/listcrosssellproducts.d.ts.map +1 -1
- package/esm/models/operations/listcrosssellproducts.js +4 -0
- package/esm/models/operations/listcrosssellproducts.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts +1 -1
- package/esm/models/operations/listproductvariants.d.ts +5 -5
- package/esm/models/operations/listproductvariants.d.ts.map +1 -1
- package/esm/models/operations/listproductvariants.js +4 -4
- package/esm/models/operations/listproductvariants.js.map +1 -1
- package/esm/models/operations/listsimilarproducts.d.ts +5 -0
- package/esm/models/operations/listsimilarproducts.d.ts.map +1 -1
- package/esm/models/operations/listsimilarproducts.js +4 -0
- package/esm/models/operations/listsimilarproducts.js.map +1 -1
- package/esm/models/operations/listskus.d.ts +5 -5
- package/esm/models/operations/listskus.d.ts.map +1 -1
- package/esm/models/operations/listskus.js +2 -2
- package/esm/models/operations/listskus.js.map +1 -1
- package/esm/models/operations/listupsellproducts.d.ts +5 -0
- package/esm/models/operations/listupsellproducts.d.ts.map +1 -1
- package/esm/models/operations/listupsellproducts.js +4 -0
- package/esm/models/operations/listupsellproducts.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/catalogGetProductDetail.ts +6 -6
- package/src/funcs/catalogGetVariantDetail.ts +6 -6
- package/src/funcs/catalogListCrosssellProducts.ts +6 -1
- package/src/funcs/catalogListProductVariants.ts +6 -6
- package/src/funcs/catalogListProducts.ts +6 -2
- package/src/funcs/catalogListSimilarProducts.ts +6 -1
- package/src/funcs/catalogListSkus.ts +6 -2
- package/src/funcs/catalogListUpsellProducts.ts +6 -1
- package/src/index.ts +2 -0
- package/src/lib/config.ts +3 -3
- package/src/models/errors/ceerror.ts +18 -3
- package/src/models/operations/getproductdetail.ts +9 -9
- package/src/models/operations/getvariantdetail.ts +9 -9
- package/src/models/operations/listcrosssellproducts.ts +9 -0
- package/src/models/operations/listproducts.ts +1 -1
- package/src/models/operations/listproductvariants.ts +9 -9
- package/src/models/operations/listsimilarproducts.ts +9 -0
- package/src/models/operations/listskus.ts +7 -7
- package/src/models/operations/listupsellproducts.ts +9 -0
|
@@ -52,7 +52,6 @@ async function run() {
|
|
|
52
52
|
],
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
// Handle the result
|
|
56
55
|
console.log(result);
|
|
57
56
|
}
|
|
58
57
|
|
|
@@ -93,15 +92,12 @@ async function run() {
|
|
|
93
92
|
},
|
|
94
93
|
],
|
|
95
94
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
if (res.ok) {
|
|
96
|
+
const { value: result } = res;
|
|
97
|
+
console.log(result);
|
|
98
|
+
} else {
|
|
99
|
+
console.log("cartsCreateCart failed:", res.error);
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
const { value: result } = res;
|
|
102
|
-
|
|
103
|
-
// Handle the result
|
|
104
|
-
console.log(result);
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
run();
|
|
@@ -147,7 +143,6 @@ async function run() {
|
|
|
147
143
|
id: "<id>",
|
|
148
144
|
});
|
|
149
145
|
|
|
150
|
-
// Handle the result
|
|
151
146
|
console.log(result);
|
|
152
147
|
}
|
|
153
148
|
|
|
@@ -172,15 +167,12 @@ async function run() {
|
|
|
172
167
|
const res = await cartsGetCart(ceStorefront, {
|
|
173
168
|
id: "<id>",
|
|
174
169
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
170
|
+
if (res.ok) {
|
|
171
|
+
const { value: result } = res;
|
|
172
|
+
console.log(result);
|
|
173
|
+
} else {
|
|
174
|
+
console.log("cartsGetCart failed:", res.error);
|
|
178
175
|
}
|
|
179
|
-
|
|
180
|
-
const { value: result } = res;
|
|
181
|
-
|
|
182
|
-
// Handle the result
|
|
183
|
-
console.log(result);
|
|
184
176
|
}
|
|
185
177
|
|
|
186
178
|
run();
|
|
@@ -225,7 +217,6 @@ async function run() {
|
|
|
225
217
|
id: "<id>",
|
|
226
218
|
});
|
|
227
219
|
|
|
228
|
-
// Handle the result
|
|
229
220
|
console.log(result);
|
|
230
221
|
}
|
|
231
222
|
|
|
@@ -250,15 +241,12 @@ async function run() {
|
|
|
250
241
|
const res = await cartsDeleteCart(ceStorefront, {
|
|
251
242
|
id: "<id>",
|
|
252
243
|
});
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
244
|
+
if (res.ok) {
|
|
245
|
+
const { value: result } = res;
|
|
246
|
+
console.log(result);
|
|
247
|
+
} else {
|
|
248
|
+
console.log("cartsDeleteCart failed:", res.error);
|
|
256
249
|
}
|
|
257
|
-
|
|
258
|
-
const { value: result } = res;
|
|
259
|
-
|
|
260
|
-
// Handle the result
|
|
261
|
-
console.log(result);
|
|
262
250
|
}
|
|
263
251
|
|
|
264
252
|
run();
|
|
@@ -303,7 +291,6 @@ async function run() {
|
|
|
303
291
|
userId: "<id>",
|
|
304
292
|
});
|
|
305
293
|
|
|
306
|
-
// Handle the result
|
|
307
294
|
console.log(result);
|
|
308
295
|
}
|
|
309
296
|
|
|
@@ -328,15 +315,12 @@ async function run() {
|
|
|
328
315
|
const res = await cartsGetUserCart(ceStorefront, {
|
|
329
316
|
userId: "<id>",
|
|
330
317
|
});
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
318
|
+
if (res.ok) {
|
|
319
|
+
const { value: result } = res;
|
|
320
|
+
console.log(result);
|
|
321
|
+
} else {
|
|
322
|
+
console.log("cartsGetUserCart failed:", res.error);
|
|
334
323
|
}
|
|
335
|
-
|
|
336
|
-
const { value: result } = res;
|
|
337
|
-
|
|
338
|
-
// Handle the result
|
|
339
|
-
console.log(result);
|
|
340
324
|
}
|
|
341
325
|
|
|
342
326
|
run();
|
|
@@ -381,7 +365,6 @@ async function run() {
|
|
|
381
365
|
userId: "<id>",
|
|
382
366
|
});
|
|
383
367
|
|
|
384
|
-
// Handle the result
|
|
385
368
|
console.log(result);
|
|
386
369
|
}
|
|
387
370
|
|
|
@@ -406,15 +389,12 @@ async function run() {
|
|
|
406
389
|
const res = await cartsRemoveUserCart(ceStorefront, {
|
|
407
390
|
userId: "<id>",
|
|
408
391
|
});
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
392
|
+
if (res.ok) {
|
|
393
|
+
const { value: result } = res;
|
|
394
|
+
console.log(result);
|
|
395
|
+
} else {
|
|
396
|
+
console.log("cartsRemoveUserCart failed:", res.error);
|
|
412
397
|
}
|
|
413
|
-
|
|
414
|
-
const { value: result } = res;
|
|
415
|
-
|
|
416
|
-
// Handle the result
|
|
417
|
-
console.log(result);
|
|
418
398
|
}
|
|
419
399
|
|
|
420
400
|
run();
|
|
@@ -464,7 +444,6 @@ async function run() {
|
|
|
464
444
|
},
|
|
465
445
|
});
|
|
466
446
|
|
|
467
|
-
// Handle the result
|
|
468
447
|
console.log(result);
|
|
469
448
|
}
|
|
470
449
|
|
|
@@ -494,15 +473,12 @@ async function run() {
|
|
|
494
473
|
quantity: 1,
|
|
495
474
|
},
|
|
496
475
|
});
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
476
|
+
if (res.ok) {
|
|
477
|
+
const { value: result } = res;
|
|
478
|
+
console.log(result);
|
|
479
|
+
} else {
|
|
480
|
+
console.log("cartsUpdateCart failed:", res.error);
|
|
500
481
|
}
|
|
501
|
-
|
|
502
|
-
const { value: result } = res;
|
|
503
|
-
|
|
504
|
-
// Handle the result
|
|
505
|
-
console.log(result);
|
|
506
482
|
}
|
|
507
483
|
|
|
508
484
|
run();
|
|
@@ -552,7 +528,6 @@ async function run() {
|
|
|
552
528
|
},
|
|
553
529
|
});
|
|
554
530
|
|
|
555
|
-
// Handle the result
|
|
556
531
|
console.log(result);
|
|
557
532
|
}
|
|
558
533
|
|
|
@@ -581,15 +556,12 @@ async function run() {
|
|
|
581
556
|
shippingAddressId: "<id>",
|
|
582
557
|
},
|
|
583
558
|
});
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
559
|
+
if (res.ok) {
|
|
560
|
+
const { value: result } = res;
|
|
561
|
+
console.log(result);
|
|
562
|
+
} else {
|
|
563
|
+
console.log("cartsCreateCartAddress failed:", res.error);
|
|
587
564
|
}
|
|
588
|
-
|
|
589
|
-
const { value: result } = res;
|
|
590
|
-
|
|
591
|
-
// Handle the result
|
|
592
|
-
console.log(result);
|
|
593
565
|
}
|
|
594
566
|
|
|
595
567
|
run();
|
|
@@ -639,7 +611,6 @@ async function run() {
|
|
|
639
611
|
},
|
|
640
612
|
});
|
|
641
613
|
|
|
642
|
-
// Handle the result
|
|
643
614
|
console.log(result);
|
|
644
615
|
}
|
|
645
616
|
|
|
@@ -668,15 +639,12 @@ async function run() {
|
|
|
668
639
|
courierCompanyId: "<id>",
|
|
669
640
|
},
|
|
670
641
|
});
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
642
|
+
if (res.ok) {
|
|
643
|
+
const { value: result } = res;
|
|
644
|
+
console.log(result);
|
|
645
|
+
} else {
|
|
646
|
+
console.log("cartsAddShippingMethod failed:", res.error);
|
|
674
647
|
}
|
|
675
|
-
|
|
676
|
-
const { value: result } = res;
|
|
677
|
-
|
|
678
|
-
// Handle the result
|
|
679
|
-
console.log(result);
|
|
680
648
|
}
|
|
681
649
|
|
|
682
650
|
run();
|
|
@@ -725,7 +693,6 @@ async function run() {
|
|
|
725
693
|
},
|
|
726
694
|
});
|
|
727
695
|
|
|
728
|
-
// Handle the result
|
|
729
696
|
console.log(result);
|
|
730
697
|
}
|
|
731
698
|
|
|
@@ -753,15 +720,12 @@ async function run() {
|
|
|
753
720
|
couponCode: "FLAT100OFF",
|
|
754
721
|
},
|
|
755
722
|
});
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
723
|
+
if (res.ok) {
|
|
724
|
+
const { value: result } = res;
|
|
725
|
+
console.log(result);
|
|
726
|
+
} else {
|
|
727
|
+
console.log("cartsApplyCoupon failed:", res.error);
|
|
759
728
|
}
|
|
760
|
-
|
|
761
|
-
const { value: result } = res;
|
|
762
|
-
|
|
763
|
-
// Handle the result
|
|
764
|
-
console.log(result);
|
|
765
729
|
}
|
|
766
730
|
|
|
767
731
|
run();
|
|
@@ -807,7 +771,6 @@ async function run() {
|
|
|
807
771
|
id: "<id>",
|
|
808
772
|
});
|
|
809
773
|
|
|
810
|
-
// Handle the result
|
|
811
774
|
console.log(result);
|
|
812
775
|
}
|
|
813
776
|
|
|
@@ -832,15 +795,12 @@ async function run() {
|
|
|
832
795
|
const res = await cartsRemoveCoupon(ceStorefront, {
|
|
833
796
|
id: "<id>",
|
|
834
797
|
});
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
798
|
+
if (res.ok) {
|
|
799
|
+
const { value: result } = res;
|
|
800
|
+
console.log(result);
|
|
801
|
+
} else {
|
|
802
|
+
console.log("cartsRemoveCoupon failed:", res.error);
|
|
838
803
|
}
|
|
839
|
-
|
|
840
|
-
const { value: result } = res;
|
|
841
|
-
|
|
842
|
-
// Handle the result
|
|
843
|
-
console.log(result);
|
|
844
804
|
}
|
|
845
805
|
|
|
846
806
|
run();
|
|
@@ -888,7 +848,6 @@ async function run() {
|
|
|
888
848
|
},
|
|
889
849
|
});
|
|
890
850
|
|
|
891
|
-
// Handle the result
|
|
892
851
|
console.log(result);
|
|
893
852
|
}
|
|
894
853
|
|
|
@@ -916,15 +875,12 @@ async function run() {
|
|
|
916
875
|
loyaltyPointRedeemed: 1000,
|
|
917
876
|
},
|
|
918
877
|
});
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
878
|
+
if (res.ok) {
|
|
879
|
+
const { value: result } = res;
|
|
880
|
+
console.log(result);
|
|
881
|
+
} else {
|
|
882
|
+
console.log("cartsRedeemLoyaltyPoints failed:", res.error);
|
|
922
883
|
}
|
|
923
|
-
|
|
924
|
-
const { value: result } = res;
|
|
925
|
-
|
|
926
|
-
// Handle the result
|
|
927
|
-
console.log(result);
|
|
928
884
|
}
|
|
929
885
|
|
|
930
886
|
run();
|
|
@@ -969,7 +925,6 @@ async function run() {
|
|
|
969
925
|
id: "<id>",
|
|
970
926
|
});
|
|
971
927
|
|
|
972
|
-
// Handle the result
|
|
973
928
|
console.log(result);
|
|
974
929
|
}
|
|
975
930
|
|
|
@@ -994,15 +949,12 @@ async function run() {
|
|
|
994
949
|
const res = await cartsRemoveLoyaltyPoints(ceStorefront, {
|
|
995
950
|
id: "<id>",
|
|
996
951
|
});
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
952
|
+
if (res.ok) {
|
|
953
|
+
const { value: result } = res;
|
|
954
|
+
console.log(result);
|
|
955
|
+
} else {
|
|
956
|
+
console.log("cartsRemoveLoyaltyPoints failed:", res.error);
|
|
1000
957
|
}
|
|
1001
|
-
|
|
1002
|
-
const { value: result } = res;
|
|
1003
|
-
|
|
1004
|
-
// Handle the result
|
|
1005
|
-
console.log(result);
|
|
1006
958
|
}
|
|
1007
959
|
|
|
1008
960
|
run();
|
|
@@ -35,7 +35,6 @@ async function run() {
|
|
|
35
35
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
// Handle the result
|
|
39
38
|
console.log(result);
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -60,15 +59,12 @@ async function run() {
|
|
|
60
59
|
const res = await catalogListProducts(ceStorefront, {
|
|
61
60
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
62
61
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
if (res.ok) {
|
|
63
|
+
const { value: result } = res;
|
|
64
|
+
console.log(result);
|
|
65
|
+
} else {
|
|
66
|
+
console.log("catalogListProducts failed:", res.error);
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
-
const { value: result } = res;
|
|
69
|
-
|
|
70
|
-
// Handle the result
|
|
71
|
-
console.log(result);
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
run();
|
|
@@ -113,7 +109,6 @@ async function run() {
|
|
|
113
109
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
114
110
|
});
|
|
115
111
|
|
|
116
|
-
// Handle the result
|
|
117
112
|
console.log(result);
|
|
118
113
|
}
|
|
119
114
|
|
|
@@ -138,15 +133,12 @@ async function run() {
|
|
|
138
133
|
const res = await catalogListSkus(ceStorefront, {
|
|
139
134
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
140
135
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
if (res.ok) {
|
|
137
|
+
const { value: result } = res;
|
|
138
|
+
console.log(result);
|
|
139
|
+
} else {
|
|
140
|
+
console.log("catalogListSkus failed:", res.error);
|
|
144
141
|
}
|
|
145
|
-
|
|
146
|
-
const { value: result } = res;
|
|
147
|
-
|
|
148
|
-
// Handle the result
|
|
149
|
-
console.log(result);
|
|
150
142
|
}
|
|
151
143
|
|
|
152
144
|
run();
|
|
@@ -191,7 +183,6 @@ async function run() {
|
|
|
191
183
|
productId: "41",
|
|
192
184
|
});
|
|
193
185
|
|
|
194
|
-
// Handle the result
|
|
195
186
|
console.log(result);
|
|
196
187
|
}
|
|
197
188
|
|
|
@@ -216,15 +207,12 @@ async function run() {
|
|
|
216
207
|
const res = await catalogGetProductDetail(ceStorefront, {
|
|
217
208
|
productId: "41",
|
|
218
209
|
});
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
210
|
+
if (res.ok) {
|
|
211
|
+
const { value: result } = res;
|
|
212
|
+
console.log(result);
|
|
213
|
+
} else {
|
|
214
|
+
console.log("catalogGetProductDetail failed:", res.error);
|
|
222
215
|
}
|
|
223
|
-
|
|
224
|
-
const { value: result } = res;
|
|
225
|
-
|
|
226
|
-
// Handle the result
|
|
227
|
-
console.log(result);
|
|
228
216
|
}
|
|
229
217
|
|
|
230
218
|
run();
|
|
@@ -269,7 +257,6 @@ async function run() {
|
|
|
269
257
|
productId: "01H7YK0C86V9PGT0HXRJVEZXJQ",
|
|
270
258
|
});
|
|
271
259
|
|
|
272
|
-
// Handle the result
|
|
273
260
|
console.log(result);
|
|
274
261
|
}
|
|
275
262
|
|
|
@@ -294,15 +281,12 @@ async function run() {
|
|
|
294
281
|
const res = await catalogListProductVariants(ceStorefront, {
|
|
295
282
|
productId: "01H7YK0C86V9PGT0HXRJVEZXJQ",
|
|
296
283
|
});
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
284
|
+
if (res.ok) {
|
|
285
|
+
const { value: result } = res;
|
|
286
|
+
console.log(result);
|
|
287
|
+
} else {
|
|
288
|
+
console.log("catalogListProductVariants failed:", res.error);
|
|
300
289
|
}
|
|
301
|
-
|
|
302
|
-
const { value: result } = res;
|
|
303
|
-
|
|
304
|
-
// Handle the result
|
|
305
|
-
console.log(result);
|
|
306
290
|
}
|
|
307
291
|
|
|
308
292
|
run();
|
|
@@ -348,7 +332,6 @@ async function run() {
|
|
|
348
332
|
variantId: "<id>",
|
|
349
333
|
});
|
|
350
334
|
|
|
351
|
-
// Handle the result
|
|
352
335
|
console.log(result);
|
|
353
336
|
}
|
|
354
337
|
|
|
@@ -374,15 +357,12 @@ async function run() {
|
|
|
374
357
|
productId: "01H7YK0C86V9PGT0HXRJVEZXJQ",
|
|
375
358
|
variantId: "<id>",
|
|
376
359
|
});
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
360
|
+
if (res.ok) {
|
|
361
|
+
const { value: result } = res;
|
|
362
|
+
console.log(result);
|
|
363
|
+
} else {
|
|
364
|
+
console.log("catalogGetVariantDetail failed:", res.error);
|
|
380
365
|
}
|
|
381
|
-
|
|
382
|
-
const { value: result } = res;
|
|
383
|
-
|
|
384
|
-
// Handle the result
|
|
385
|
-
console.log(result);
|
|
386
366
|
}
|
|
387
367
|
|
|
388
368
|
run();
|
|
@@ -428,7 +408,6 @@ async function run() {
|
|
|
428
408
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
429
409
|
});
|
|
430
410
|
|
|
431
|
-
// Handle the result
|
|
432
411
|
console.log(result);
|
|
433
412
|
}
|
|
434
413
|
|
|
@@ -454,15 +433,12 @@ async function run() {
|
|
|
454
433
|
parentCategoryId: "a847641353e947d3bed69a4eea975634",
|
|
455
434
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
456
435
|
});
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
436
|
+
if (res.ok) {
|
|
437
|
+
const { value: result } = res;
|
|
438
|
+
console.log(result);
|
|
439
|
+
} else {
|
|
440
|
+
console.log("catalogListCategories failed:", res.error);
|
|
460
441
|
}
|
|
461
|
-
|
|
462
|
-
const { value: result } = res;
|
|
463
|
-
|
|
464
|
-
// Handle the result
|
|
465
|
-
console.log(result);
|
|
466
442
|
}
|
|
467
443
|
|
|
468
444
|
run();
|
|
@@ -509,7 +485,6 @@ async function run() {
|
|
|
509
485
|
productId: "<id>",
|
|
510
486
|
});
|
|
511
487
|
|
|
512
|
-
// Handle the result
|
|
513
488
|
console.log(result);
|
|
514
489
|
}
|
|
515
490
|
|
|
@@ -535,15 +510,12 @@ async function run() {
|
|
|
535
510
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
536
511
|
productId: "<id>",
|
|
537
512
|
});
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
513
|
+
if (res.ok) {
|
|
514
|
+
const { value: result } = res;
|
|
515
|
+
console.log(result);
|
|
516
|
+
} else {
|
|
517
|
+
console.log("catalogListProductReviews failed:", res.error);
|
|
541
518
|
}
|
|
542
|
-
|
|
543
|
-
const { value: result } = res;
|
|
544
|
-
|
|
545
|
-
// Handle the result
|
|
546
|
-
console.log(result);
|
|
547
519
|
}
|
|
548
520
|
|
|
549
521
|
run();
|
|
@@ -586,7 +558,6 @@ const ceStorefront = new CeStorefront({
|
|
|
586
558
|
async function run() {
|
|
587
559
|
const result = await ceStorefront.catalog.listSimilarProducts({});
|
|
588
560
|
|
|
589
|
-
// Handle the result
|
|
590
561
|
console.log(result);
|
|
591
562
|
}
|
|
592
563
|
|
|
@@ -609,15 +580,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
609
580
|
|
|
610
581
|
async function run() {
|
|
611
582
|
const res = await catalogListSimilarProducts(ceStorefront, {});
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
583
|
+
if (res.ok) {
|
|
584
|
+
const { value: result } = res;
|
|
585
|
+
console.log(result);
|
|
586
|
+
} else {
|
|
587
|
+
console.log("catalogListSimilarProducts failed:", res.error);
|
|
615
588
|
}
|
|
616
|
-
|
|
617
|
-
const { value: result } = res;
|
|
618
|
-
|
|
619
|
-
// Handle the result
|
|
620
|
-
console.log(result);
|
|
621
589
|
}
|
|
622
590
|
|
|
623
591
|
run();
|
|
@@ -660,7 +628,6 @@ const ceStorefront = new CeStorefront({
|
|
|
660
628
|
async function run() {
|
|
661
629
|
const result = await ceStorefront.catalog.listUpsellProducts({});
|
|
662
630
|
|
|
663
|
-
// Handle the result
|
|
664
631
|
console.log(result);
|
|
665
632
|
}
|
|
666
633
|
|
|
@@ -683,15 +650,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
683
650
|
|
|
684
651
|
async function run() {
|
|
685
652
|
const res = await catalogListUpsellProducts(ceStorefront, {});
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
653
|
+
if (res.ok) {
|
|
654
|
+
const { value: result } = res;
|
|
655
|
+
console.log(result);
|
|
656
|
+
} else {
|
|
657
|
+
console.log("catalogListUpsellProducts failed:", res.error);
|
|
689
658
|
}
|
|
690
|
-
|
|
691
|
-
const { value: result } = res;
|
|
692
|
-
|
|
693
|
-
// Handle the result
|
|
694
|
-
console.log(result);
|
|
695
659
|
}
|
|
696
660
|
|
|
697
661
|
run();
|
|
@@ -734,7 +698,6 @@ const ceStorefront = new CeStorefront({
|
|
|
734
698
|
async function run() {
|
|
735
699
|
const result = await ceStorefront.catalog.listCrosssellProducts({});
|
|
736
700
|
|
|
737
|
-
// Handle the result
|
|
738
701
|
console.log(result);
|
|
739
702
|
}
|
|
740
703
|
|
|
@@ -757,15 +720,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
757
720
|
|
|
758
721
|
async function run() {
|
|
759
722
|
const res = await catalogListCrosssellProducts(ceStorefront, {});
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
723
|
+
if (res.ok) {
|
|
724
|
+
const { value: result } = res;
|
|
725
|
+
console.log(result);
|
|
726
|
+
} else {
|
|
727
|
+
console.log("catalogListCrosssellProducts failed:", res.error);
|
|
763
728
|
}
|
|
764
|
-
|
|
765
|
-
const { value: result } = res;
|
|
766
|
-
|
|
767
|
-
// Handle the result
|
|
768
|
-
console.log(result);
|
|
769
729
|
}
|
|
770
730
|
|
|
771
731
|
run();
|
|
@@ -810,7 +770,6 @@ async function run() {
|
|
|
810
770
|
query: "<value>",
|
|
811
771
|
});
|
|
812
772
|
|
|
813
|
-
// Handle the result
|
|
814
773
|
console.log(result);
|
|
815
774
|
}
|
|
816
775
|
|
|
@@ -835,15 +794,12 @@ async function run() {
|
|
|
835
794
|
const res = await catalogSearchProducts(ceStorefront, {
|
|
836
795
|
query: "<value>",
|
|
837
796
|
});
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
797
|
+
if (res.ok) {
|
|
798
|
+
const { value: result } = res;
|
|
799
|
+
console.log(result);
|
|
800
|
+
} else {
|
|
801
|
+
console.log("catalogSearchProducts failed:", res.error);
|
|
841
802
|
}
|
|
842
|
-
|
|
843
|
-
const { value: result } = res;
|
|
844
|
-
|
|
845
|
-
// Handle the result
|
|
846
|
-
console.log(result);
|
|
847
803
|
}
|
|
848
804
|
|
|
849
805
|
run();
|
|
@@ -25,7 +25,6 @@ async function run() {
|
|
|
25
25
|
countryIsoCode: "<value>",
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
// Handle the result
|
|
29
28
|
console.log(result);
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -50,15 +49,12 @@ async function run() {
|
|
|
50
49
|
const res = await commonListCountryPincodes(ceStorefront, {
|
|
51
50
|
countryIsoCode: "<value>",
|
|
52
51
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
if (res.ok) {
|
|
53
|
+
const { value: result } = res;
|
|
54
|
+
console.log(result);
|
|
55
|
+
} else {
|
|
56
|
+
console.log("commonListCountryPincodes failed:", res.error);
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
const { value: result } = res;
|
|
59
|
-
|
|
60
|
-
// Handle the result
|
|
61
|
-
console.log(result);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
run();
|