ce-storefront 0.13.1 → 0.13.3
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 +62 -104
- 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.d.ts +1 -1
- package/esm/funcs/catalogGetProductDetail.js +5 -11
- 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/catalogListCategories.js +1 -0
- package/esm/funcs/catalogListCategories.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 +3 -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/components/productreview.d.ts +1 -10
- package/esm/models/components/productreview.d.ts.map +1 -1
- package/esm/models/components/productreview.js +2 -5
- package/esm/models/components/productreview.js.map +1 -1
- 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/listcategories.d.ts +6 -1
- package/esm/models/operations/listcategories.d.ts.map +1 -1
- package/esm/models/operations/listcategories.js +4 -0
- package/esm/models/operations/listcategories.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 +7 -2
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +4 -0
- package/esm/models/operations/listproducts.js.map +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/esm/sdk/catalog.d.ts +1 -1
- package/esm/sdk/catalog.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/catalogGetProductDetail.ts +13 -12
- package/src/funcs/catalogGetVariantDetail.ts +6 -6
- package/src/funcs/catalogListCategories.ts +1 -0
- package/src/funcs/catalogListCrosssellProducts.ts +6 -1
- package/src/funcs/catalogListProductVariants.ts +6 -6
- package/src/funcs/catalogListProducts.ts +7 -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/components/productreview.ts +3 -6
- 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/listcategories.ts +10 -1
- package/src/models/operations/listcrosssellproducts.ts +9 -0
- package/src/models/operations/listproducts.ts +11 -2
- 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
- package/src/sdk/catalog.ts +1 -1
|
@@ -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();
|
|
@@ -175,7 +167,7 @@ run();
|
|
|
175
167
|
|
|
176
168
|
## getProductDetail
|
|
177
169
|
|
|
178
|
-
Retrieves the details of an existing product. Supply the unique product ID
|
|
170
|
+
Retrieves the details of an existing product. Supply either the unique product ID or the unique slug, and Commerce Engine will return the corresponding product information.
|
|
179
171
|
|
|
180
172
|
### Example Usage
|
|
181
173
|
|
|
@@ -188,10 +180,9 @@ const ceStorefront = new CeStorefront({
|
|
|
188
180
|
|
|
189
181
|
async function run() {
|
|
190
182
|
const result = await ceStorefront.catalog.getProductDetail({
|
|
191
|
-
|
|
183
|
+
productIdOrSlug: "01XGCYCT8CRHXW4BG91JXCMDCW",
|
|
192
184
|
});
|
|
193
185
|
|
|
194
|
-
// Handle the result
|
|
195
186
|
console.log(result);
|
|
196
187
|
}
|
|
197
188
|
|
|
@@ -214,17 +205,14 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
214
205
|
|
|
215
206
|
async function run() {
|
|
216
207
|
const res = await catalogGetProductDetail(ceStorefront, {
|
|
217
|
-
|
|
208
|
+
productIdOrSlug: "01XGCYCT8CRHXW4BG91JXCMDCW",
|
|
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();
|
|
@@ -424,11 +404,11 @@ const ceStorefront = new CeStorefront({
|
|
|
424
404
|
|
|
425
405
|
async function run() {
|
|
426
406
|
const result = await ceStorefront.catalog.listCategories({
|
|
427
|
-
parentCategoryId: "
|
|
407
|
+
parentCategoryId: "01JWZW41Y3FBKTZSP399SKANY7",
|
|
428
408
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
409
|
+
parentCategorySlug: "vitals",
|
|
429
410
|
});
|
|
430
411
|
|
|
431
|
-
// Handle the result
|
|
432
412
|
console.log(result);
|
|
433
413
|
}
|
|
434
414
|
|
|
@@ -451,18 +431,16 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
451
431
|
|
|
452
432
|
async function run() {
|
|
453
433
|
const res = await catalogListCategories(ceStorefront, {
|
|
454
|
-
parentCategoryId: "
|
|
434
|
+
parentCategoryId: "01JWZW41Y3FBKTZSP399SKANY7",
|
|
455
435
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
436
|
+
parentCategorySlug: "vitals",
|
|
456
437
|
});
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
438
|
+
if (res.ok) {
|
|
439
|
+
const { value: result } = res;
|
|
440
|
+
console.log(result);
|
|
441
|
+
} else {
|
|
442
|
+
console.log("catalogListCategories failed:", res.error);
|
|
460
443
|
}
|
|
461
|
-
|
|
462
|
-
const { value: result } = res;
|
|
463
|
-
|
|
464
|
-
// Handle the result
|
|
465
|
-
console.log(result);
|
|
466
444
|
}
|
|
467
445
|
|
|
468
446
|
run();
|
|
@@ -509,7 +487,6 @@ async function run() {
|
|
|
509
487
|
productId: "<id>",
|
|
510
488
|
});
|
|
511
489
|
|
|
512
|
-
// Handle the result
|
|
513
490
|
console.log(result);
|
|
514
491
|
}
|
|
515
492
|
|
|
@@ -535,15 +512,12 @@ async function run() {
|
|
|
535
512
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
536
513
|
productId: "<id>",
|
|
537
514
|
});
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
515
|
+
if (res.ok) {
|
|
516
|
+
const { value: result } = res;
|
|
517
|
+
console.log(result);
|
|
518
|
+
} else {
|
|
519
|
+
console.log("catalogListProductReviews failed:", res.error);
|
|
541
520
|
}
|
|
542
|
-
|
|
543
|
-
const { value: result } = res;
|
|
544
|
-
|
|
545
|
-
// Handle the result
|
|
546
|
-
console.log(result);
|
|
547
521
|
}
|
|
548
522
|
|
|
549
523
|
run();
|
|
@@ -586,7 +560,6 @@ const ceStorefront = new CeStorefront({
|
|
|
586
560
|
async function run() {
|
|
587
561
|
const result = await ceStorefront.catalog.listSimilarProducts({});
|
|
588
562
|
|
|
589
|
-
// Handle the result
|
|
590
563
|
console.log(result);
|
|
591
564
|
}
|
|
592
565
|
|
|
@@ -609,15 +582,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
609
582
|
|
|
610
583
|
async function run() {
|
|
611
584
|
const res = await catalogListSimilarProducts(ceStorefront, {});
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
585
|
+
if (res.ok) {
|
|
586
|
+
const { value: result } = res;
|
|
587
|
+
console.log(result);
|
|
588
|
+
} else {
|
|
589
|
+
console.log("catalogListSimilarProducts failed:", res.error);
|
|
615
590
|
}
|
|
616
|
-
|
|
617
|
-
const { value: result } = res;
|
|
618
|
-
|
|
619
|
-
// Handle the result
|
|
620
|
-
console.log(result);
|
|
621
591
|
}
|
|
622
592
|
|
|
623
593
|
run();
|
|
@@ -660,7 +630,6 @@ const ceStorefront = new CeStorefront({
|
|
|
660
630
|
async function run() {
|
|
661
631
|
const result = await ceStorefront.catalog.listUpsellProducts({});
|
|
662
632
|
|
|
663
|
-
// Handle the result
|
|
664
633
|
console.log(result);
|
|
665
634
|
}
|
|
666
635
|
|
|
@@ -683,15 +652,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
683
652
|
|
|
684
653
|
async function run() {
|
|
685
654
|
const res = await catalogListUpsellProducts(ceStorefront, {});
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
655
|
+
if (res.ok) {
|
|
656
|
+
const { value: result } = res;
|
|
657
|
+
console.log(result);
|
|
658
|
+
} else {
|
|
659
|
+
console.log("catalogListUpsellProducts failed:", res.error);
|
|
689
660
|
}
|
|
690
|
-
|
|
691
|
-
const { value: result } = res;
|
|
692
|
-
|
|
693
|
-
// Handle the result
|
|
694
|
-
console.log(result);
|
|
695
661
|
}
|
|
696
662
|
|
|
697
663
|
run();
|
|
@@ -734,7 +700,6 @@ const ceStorefront = new CeStorefront({
|
|
|
734
700
|
async function run() {
|
|
735
701
|
const result = await ceStorefront.catalog.listCrosssellProducts({});
|
|
736
702
|
|
|
737
|
-
// Handle the result
|
|
738
703
|
console.log(result);
|
|
739
704
|
}
|
|
740
705
|
|
|
@@ -757,15 +722,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
757
722
|
|
|
758
723
|
async function run() {
|
|
759
724
|
const res = await catalogListCrosssellProducts(ceStorefront, {});
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
725
|
+
if (res.ok) {
|
|
726
|
+
const { value: result } = res;
|
|
727
|
+
console.log(result);
|
|
728
|
+
} else {
|
|
729
|
+
console.log("catalogListCrosssellProducts failed:", res.error);
|
|
763
730
|
}
|
|
764
|
-
|
|
765
|
-
const { value: result } = res;
|
|
766
|
-
|
|
767
|
-
// Handle the result
|
|
768
|
-
console.log(result);
|
|
769
731
|
}
|
|
770
732
|
|
|
771
733
|
run();
|
|
@@ -810,7 +772,6 @@ async function run() {
|
|
|
810
772
|
query: "<value>",
|
|
811
773
|
});
|
|
812
774
|
|
|
813
|
-
// Handle the result
|
|
814
775
|
console.log(result);
|
|
815
776
|
}
|
|
816
777
|
|
|
@@ -835,15 +796,12 @@ async function run() {
|
|
|
835
796
|
const res = await catalogSearchProducts(ceStorefront, {
|
|
836
797
|
query: "<value>",
|
|
837
798
|
});
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
799
|
+
if (res.ok) {
|
|
800
|
+
const { value: result } = res;
|
|
801
|
+
console.log(result);
|
|
802
|
+
} else {
|
|
803
|
+
console.log("catalogSearchProducts failed:", res.error);
|
|
841
804
|
}
|
|
842
|
-
|
|
843
|
-
const { value: result } = res;
|
|
844
|
-
|
|
845
|
-
// Handle the result
|
|
846
|
-
console.log(result);
|
|
847
805
|
}
|
|
848
806
|
|
|
849
807
|
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();
|