ce-storefront 0.13.0 → 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.
Files changed (147) hide show
  1. package/FUNCTIONS.md +5 -22
  2. package/README.md +44 -58
  3. package/docs/sdks/auth/README.md +50 -90
  4. package/docs/sdks/carts/README.md +60 -108
  5. package/docs/sdks/catalog/README.md +55 -99
  6. package/docs/sdks/common/README.md +5 -9
  7. package/docs/sdks/customers/README.md +35 -63
  8. package/docs/sdks/orders/README.md +35 -63
  9. package/docs/sdks/shipping/README.md +5 -9
  10. package/esm/funcs/catalogGetProductDetail.js +2 -5
  11. package/esm/funcs/catalogGetProductDetail.js.map +1 -1
  12. package/esm/funcs/catalogGetVariantDetail.js +2 -5
  13. package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
  14. package/esm/funcs/catalogListCrosssellProducts.js +2 -1
  15. package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
  16. package/esm/funcs/catalogListProductVariants.js +2 -5
  17. package/esm/funcs/catalogListProductVariants.js.map +1 -1
  18. package/esm/funcs/catalogListProducts.js +2 -2
  19. package/esm/funcs/catalogListProducts.js.map +1 -1
  20. package/esm/funcs/catalogListSimilarProducts.js +2 -1
  21. package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
  22. package/esm/funcs/catalogListSkus.js +2 -2
  23. package/esm/funcs/catalogListSkus.js.map +1 -1
  24. package/esm/funcs/catalogListUpsellProducts.js +2 -1
  25. package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
  26. package/esm/index.d.ts +2 -0
  27. package/esm/index.d.ts.map +1 -1
  28. package/esm/index.js +1 -0
  29. package/esm/index.js.map +1 -1
  30. package/esm/lib/config.d.ts +3 -3
  31. package/esm/lib/config.js +3 -3
  32. package/esm/models/components/appliedpromotion.d.ts +8 -8
  33. package/esm/models/components/appliedpromotion.d.ts.map +1 -1
  34. package/esm/models/components/appliedpromotion.js +12 -12
  35. package/esm/models/components/appliedpromotion.js.map +1 -1
  36. package/esm/models/components/discountbasedpromotion.d.ts +31 -0
  37. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  38. package/esm/models/components/discountbasedpromotion.js +21 -0
  39. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  40. package/esm/models/components/fixedpricepromotion.d.ts +34 -2
  41. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  42. package/esm/models/components/fixedpricepromotion.js +23 -2
  43. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  44. package/esm/models/components/freegoodspromotion.d.ts +32 -0
  45. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  46. package/esm/models/components/freegoodspromotion.js +21 -0
  47. package/esm/models/components/freegoodspromotion.js.map +1 -1
  48. package/esm/models/components/item.d.ts +8 -0
  49. package/esm/models/components/item.d.ts.map +1 -1
  50. package/esm/models/components/item.js +5 -0
  51. package/esm/models/components/item.js.map +1 -1
  52. package/esm/models/components/product.d.ts +5 -0
  53. package/esm/models/components/product.d.ts.map +1 -1
  54. package/esm/models/components/product.js +2 -0
  55. package/esm/models/components/product.js.map +1 -1
  56. package/esm/models/components/productbundleitem.d.ts +8 -0
  57. package/esm/models/components/productbundleitem.d.ts.map +1 -1
  58. package/esm/models/components/productbundleitem.js +5 -0
  59. package/esm/models/components/productbundleitem.js.map +1 -1
  60. package/esm/models/components/productdetail.d.ts +5 -0
  61. package/esm/models/components/productdetail.d.ts.map +1 -1
  62. package/esm/models/components/productdetail.js +2 -0
  63. package/esm/models/components/productdetail.js.map +1 -1
  64. package/esm/models/components/productpromotion.d.ts +2 -14
  65. package/esm/models/components/productpromotion.d.ts.map +1 -1
  66. package/esm/models/components/productshipping.d.ts +8 -16
  67. package/esm/models/components/productshipping.d.ts.map +1 -1
  68. package/esm/models/components/productshipping.js +12 -28
  69. package/esm/models/components/productshipping.js.map +1 -1
  70. package/esm/models/components/variant.d.ts +5 -0
  71. package/esm/models/components/variant.d.ts.map +1 -1
  72. package/esm/models/components/variant.js +2 -0
  73. package/esm/models/components/variant.js.map +1 -1
  74. package/esm/models/components/variantdetail.d.ts +5 -0
  75. package/esm/models/components/variantdetail.d.ts.map +1 -1
  76. package/esm/models/components/variantdetail.js +2 -0
  77. package/esm/models/components/variantdetail.js.map +1 -1
  78. package/esm/models/components/volumebasedpromotion.d.ts +34 -2
  79. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  80. package/esm/models/components/volumebasedpromotion.js +23 -2
  81. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  82. package/esm/models/errors/ceerror.d.ts +14 -2
  83. package/esm/models/errors/ceerror.d.ts.map +1 -1
  84. package/esm/models/errors/ceerror.js +1 -1
  85. package/esm/models/errors/ceerror.js.map +1 -1
  86. package/esm/models/operations/getproductdetail.d.ts +5 -5
  87. package/esm/models/operations/getproductdetail.d.ts.map +1 -1
  88. package/esm/models/operations/getproductdetail.js +4 -4
  89. package/esm/models/operations/getproductdetail.js.map +1 -1
  90. package/esm/models/operations/getvariantdetail.d.ts +5 -5
  91. package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
  92. package/esm/models/operations/getvariantdetail.js +4 -4
  93. package/esm/models/operations/getvariantdetail.js.map +1 -1
  94. package/esm/models/operations/listcrosssellproducts.d.ts +5 -0
  95. package/esm/models/operations/listcrosssellproducts.d.ts.map +1 -1
  96. package/esm/models/operations/listcrosssellproducts.js +4 -0
  97. package/esm/models/operations/listcrosssellproducts.js.map +1 -1
  98. package/esm/models/operations/listproducts.d.ts +1 -1
  99. package/esm/models/operations/listproductvariants.d.ts +5 -5
  100. package/esm/models/operations/listproductvariants.d.ts.map +1 -1
  101. package/esm/models/operations/listproductvariants.js +4 -4
  102. package/esm/models/operations/listproductvariants.js.map +1 -1
  103. package/esm/models/operations/listsimilarproducts.d.ts +5 -0
  104. package/esm/models/operations/listsimilarproducts.d.ts.map +1 -1
  105. package/esm/models/operations/listsimilarproducts.js +4 -0
  106. package/esm/models/operations/listsimilarproducts.js.map +1 -1
  107. package/esm/models/operations/listskus.d.ts +5 -5
  108. package/esm/models/operations/listskus.d.ts.map +1 -1
  109. package/esm/models/operations/listskus.js +2 -2
  110. package/esm/models/operations/listskus.js.map +1 -1
  111. package/esm/models/operations/listupsellproducts.d.ts +5 -0
  112. package/esm/models/operations/listupsellproducts.d.ts.map +1 -1
  113. package/esm/models/operations/listupsellproducts.js +4 -0
  114. package/esm/models/operations/listupsellproducts.js.map +1 -1
  115. package/jsr.json +1 -1
  116. package/package.json +1 -1
  117. package/src/funcs/catalogGetProductDetail.ts +6 -6
  118. package/src/funcs/catalogGetVariantDetail.ts +6 -6
  119. package/src/funcs/catalogListCrosssellProducts.ts +6 -1
  120. package/src/funcs/catalogListProductVariants.ts +6 -6
  121. package/src/funcs/catalogListProducts.ts +6 -2
  122. package/src/funcs/catalogListSimilarProducts.ts +6 -1
  123. package/src/funcs/catalogListSkus.ts +6 -2
  124. package/src/funcs/catalogListUpsellProducts.ts +6 -1
  125. package/src/index.ts +2 -0
  126. package/src/lib/config.ts +3 -3
  127. package/src/models/components/appliedpromotion.ts +18 -16
  128. package/src/models/components/discountbasedpromotion.ts +30 -1
  129. package/src/models/components/fixedpricepromotion.ts +36 -4
  130. package/src/models/components/freegoodspromotion.ts +33 -1
  131. package/src/models/components/item.ts +17 -0
  132. package/src/models/components/product.ts +7 -0
  133. package/src/models/components/productbundleitem.ts +17 -0
  134. package/src/models/components/productdetail.ts +7 -0
  135. package/src/models/components/productshipping.ts +20 -44
  136. package/src/models/components/variant.ts +7 -0
  137. package/src/models/components/variantdetail.ts +7 -0
  138. package/src/models/components/volumebasedpromotion.ts +37 -4
  139. package/src/models/errors/ceerror.ts +18 -3
  140. package/src/models/operations/getproductdetail.ts +9 -9
  141. package/src/models/operations/getvariantdetail.ts +9 -9
  142. package/src/models/operations/listcrosssellproducts.ts +9 -0
  143. package/src/models/operations/listproducts.ts +1 -1
  144. package/src/models/operations/listproductvariants.ts +9 -9
  145. package/src/models/operations/listsimilarproducts.ts +9 -0
  146. package/src/models/operations/listskus.ts +7 -7
  147. 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
- if (!res.ok) {
98
- throw res.error;
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
- if (!res.ok) {
177
- throw res.error;
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
- if (!res.ok) {
255
- throw res.error;
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
- if (!res.ok) {
333
- throw res.error;
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
- if (!res.ok) {
411
- throw res.error;
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
- if (!res.ok) {
499
- throw res.error;
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
- if (!res.ok) {
586
- throw res.error;
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
- if (!res.ok) {
673
- throw res.error;
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
- if (!res.ok) {
758
- throw res.error;
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
- if (!res.ok) {
837
- throw res.error;
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
- if (!res.ok) {
921
- throw res.error;
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
- if (!res.ok) {
999
- throw res.error;
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
- if (!res.ok) {
65
- throw res.error;
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
- if (!res.ok) {
143
- throw res.error;
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
- if (!res.ok) {
221
- throw res.error;
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
- if (!res.ok) {
299
- throw res.error;
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
- if (!res.ok) {
379
- throw res.error;
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
- if (!res.ok) {
459
- throw res.error;
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
- if (!res.ok) {
540
- throw res.error;
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
- if (!res.ok) {
614
- throw res.error;
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
- if (!res.ok) {
688
- throw res.error;
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
- if (!res.ok) {
762
- throw res.error;
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
- if (!res.ok) {
840
- throw res.error;
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
- if (!res.ok) {
55
- throw res.error;
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();