ce-storefront 0.20.1 → 0.21.1

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 (332) hide show
  1. package/README.md +35 -10
  2. package/esm/funcs/marketplaceGetProductDetail.d.ts +20 -0
  3. package/esm/funcs/marketplaceGetProductDetail.d.ts.map +1 -0
  4. package/esm/funcs/marketplaceGetProductDetail.js +91 -0
  5. package/esm/funcs/marketplaceGetProductDetail.js.map +1 -0
  6. package/esm/funcs/marketplaceGetVariantDetail.d.ts +20 -0
  7. package/esm/funcs/marketplaceGetVariantDetail.d.ts.map +1 -0
  8. package/esm/funcs/marketplaceGetVariantDetail.js +98 -0
  9. package/esm/funcs/marketplaceGetVariantDetail.js.map +1 -0
  10. package/esm/funcs/marketplaceListCategories.d.ts +20 -0
  11. package/esm/funcs/marketplaceListCategories.d.ts.map +1 -0
  12. package/esm/funcs/marketplaceListCategories.js +91 -0
  13. package/esm/funcs/marketplaceListCategories.js.map +1 -0
  14. package/esm/funcs/marketplaceListCrosssellProducts.d.ts +20 -0
  15. package/esm/funcs/marketplaceListCrosssellProducts.d.ts.map +1 -0
  16. package/esm/funcs/marketplaceListCrosssellProducts.js +91 -0
  17. package/esm/funcs/marketplaceListCrosssellProducts.js.map +1 -0
  18. package/esm/funcs/marketplaceListProductReviews.d.ts +20 -0
  19. package/esm/funcs/marketplaceListProductReviews.d.ts.map +1 -0
  20. package/esm/funcs/marketplaceListProductReviews.js +97 -0
  21. package/esm/funcs/marketplaceListProductReviews.js.map +1 -0
  22. package/esm/funcs/marketplaceListProductVariants.d.ts +20 -0
  23. package/esm/funcs/marketplaceListProductVariants.d.ts.map +1 -0
  24. package/esm/funcs/marketplaceListProductVariants.js +94 -0
  25. package/esm/funcs/marketplaceListProductVariants.js.map +1 -0
  26. package/esm/funcs/marketplaceListProducts.d.ts +20 -0
  27. package/esm/funcs/marketplaceListProducts.d.ts.map +1 -0
  28. package/esm/funcs/marketplaceListProducts.js +93 -0
  29. package/esm/funcs/marketplaceListProducts.js.map +1 -0
  30. package/esm/funcs/marketplaceListSimilarProducts.d.ts +20 -0
  31. package/esm/funcs/marketplaceListSimilarProducts.d.ts.map +1 -0
  32. package/esm/funcs/marketplaceListSimilarProducts.js +91 -0
  33. package/esm/funcs/marketplaceListSimilarProducts.js.map +1 -0
  34. package/esm/funcs/marketplaceListSkus.d.ts +20 -0
  35. package/esm/funcs/marketplaceListSkus.d.ts.map +1 -0
  36. package/esm/funcs/marketplaceListSkus.js +93 -0
  37. package/esm/funcs/marketplaceListSkus.js.map +1 -0
  38. package/esm/funcs/marketplaceListUpsellProducts.d.ts +20 -0
  39. package/esm/funcs/marketplaceListUpsellProducts.d.ts.map +1 -0
  40. package/esm/funcs/marketplaceListUpsellProducts.js +91 -0
  41. package/esm/funcs/marketplaceListUpsellProducts.js.map +1 -0
  42. package/esm/funcs/marketplaceSearchProducts.d.ts +20 -0
  43. package/esm/funcs/marketplaceSearchProducts.d.ts.map +1 -0
  44. package/esm/funcs/marketplaceSearchProducts.js +85 -0
  45. package/esm/funcs/marketplaceSearchProducts.js.map +1 -0
  46. package/esm/lib/config.d.ts +3 -3
  47. package/esm/lib/config.js +3 -3
  48. package/esm/lib/encodings.d.ts +1 -0
  49. package/esm/lib/encodings.d.ts.map +1 -1
  50. package/esm/lib/encodings.js +12 -1
  51. package/esm/lib/encodings.js.map +1 -1
  52. package/esm/models/components/booleanattribute.d.ts +1 -1
  53. package/esm/models/components/booleanattribute.d.ts.map +1 -1
  54. package/esm/models/components/booleanattribute.js +1 -1
  55. package/esm/models/components/booleanattribute.js.map +1 -1
  56. package/esm/models/components/collectinstorefulfillment.d.ts +1 -1
  57. package/esm/models/components/collectinstorefulfillment.d.ts.map +1 -1
  58. package/esm/models/components/collectinstorefulfillment.js +1 -2
  59. package/esm/models/components/collectinstorefulfillment.js.map +1 -1
  60. package/esm/models/components/collectinstorefulfillmentinput.d.ts +1 -1
  61. package/esm/models/components/collectinstorefulfillmentinput.d.ts.map +1 -1
  62. package/esm/models/components/colorattribute.d.ts +1 -1
  63. package/esm/models/components/colorattribute.d.ts.map +1 -1
  64. package/esm/models/components/colorattribute.js +1 -1
  65. package/esm/models/components/colorattribute.js.map +1 -1
  66. package/esm/models/components/coloroption.d.ts +1 -1
  67. package/esm/models/components/coloroption.d.ts.map +1 -1
  68. package/esm/models/components/coloroption.js +1 -1
  69. package/esm/models/components/coloroption.js.map +1 -1
  70. package/esm/models/components/customeraddress.d.ts +1 -1
  71. package/esm/models/components/customeraddress.d.ts.map +1 -1
  72. package/esm/models/components/customeraddress.js +1 -1
  73. package/esm/models/components/customeraddress.js.map +1 -1
  74. package/esm/models/components/customeraddressinput.d.ts +1 -1
  75. package/esm/models/components/customeraddressinput.d.ts.map +1 -1
  76. package/esm/models/components/dateattribute.d.ts +1 -1
  77. package/esm/models/components/dateattribute.js +1 -1
  78. package/esm/models/components/dateattribute.js.map +1 -1
  79. package/esm/models/components/deliveryfulfillment.d.ts +1 -1
  80. package/esm/models/components/deliveryfulfillment.d.ts.map +1 -1
  81. package/esm/models/components/deliveryfulfillment.js +1 -1
  82. package/esm/models/components/deliveryfulfillment.js.map +1 -1
  83. package/esm/models/components/deliveryfulfillmentinput.d.ts +1 -1
  84. package/esm/models/components/deliveryfulfillmentinput.d.ts.map +1 -1
  85. package/esm/models/components/discountbasedpromotion.d.ts +1 -10
  86. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  87. package/esm/models/components/discountbasedpromotion.js +1 -9
  88. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  89. package/esm/models/components/fixedpricepromotion.d.ts +1 -11
  90. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  91. package/esm/models/components/fixedpricepromotion.js +1 -9
  92. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  93. package/esm/models/components/freegoodspromotion.d.ts +1 -11
  94. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  95. package/esm/models/components/freegoodspromotion.js +1 -9
  96. package/esm/models/components/freegoodspromotion.js.map +1 -1
  97. package/esm/models/components/fulfillmentpreference.d.ts +1 -7
  98. package/esm/models/components/fulfillmentpreference.d.ts.map +1 -1
  99. package/esm/models/components/fulfillmentpreference.js +3 -6
  100. package/esm/models/components/fulfillmentpreference.js.map +1 -1
  101. package/esm/models/components/fulfillmentpreferenceinput.d.ts +2 -14
  102. package/esm/models/components/fulfillmentpreferenceinput.d.ts.map +1 -1
  103. package/esm/models/components/fulfillmentpreferenceinput.js +3 -6
  104. package/esm/models/components/fulfillmentpreferenceinput.js.map +1 -1
  105. package/esm/models/components/generateotpwithemail.d.ts +1 -1
  106. package/esm/models/components/generateotpwithemail.d.ts.map +1 -1
  107. package/esm/models/components/juspayhypercheckout.d.ts +1 -1
  108. package/esm/models/components/juspayhypercheckout.d.ts.map +1 -1
  109. package/esm/models/components/juspayhypercheckoutresponse.d.ts.map +1 -1
  110. package/esm/models/components/juspayhypercheckoutresponse.js +2 -3
  111. package/esm/models/components/juspayhypercheckoutresponse.js.map +1 -1
  112. package/esm/models/components/juspaynetbanking.d.ts +2 -2
  113. package/esm/models/components/juspaynetbanking.d.ts.map +1 -1
  114. package/esm/models/components/juspaynewcard.d.ts +3 -3
  115. package/esm/models/components/juspaynewcard.d.ts.map +1 -1
  116. package/esm/models/components/juspaysavedcardtoken.d.ts +3 -3
  117. package/esm/models/components/juspaysavedcardtoken.d.ts.map +1 -1
  118. package/esm/models/components/juspayupicollect.d.ts +3 -3
  119. package/esm/models/components/juspayupicollect.d.ts.map +1 -1
  120. package/esm/models/components/juspayupiintent.d.ts +3 -3
  121. package/esm/models/components/juspayupiintent.d.ts.map +1 -1
  122. package/esm/models/components/multiselectattribute.d.ts +1 -1
  123. package/esm/models/components/multiselectattribute.d.ts.map +1 -1
  124. package/esm/models/components/multiselectattribute.js +1 -1
  125. package/esm/models/components/multiselectattribute.js.map +1 -1
  126. package/esm/models/components/numberattribute.d.ts +1 -1
  127. package/esm/models/components/numberattribute.d.ts.map +1 -1
  128. package/esm/models/components/numberattribute.js +1 -1
  129. package/esm/models/components/numberattribute.js.map +1 -1
  130. package/esm/models/components/partialcollectanddelivery.d.ts +1 -1
  131. package/esm/models/components/partialcollectanddelivery.d.ts.map +1 -1
  132. package/esm/models/components/partialcollectanddelivery.js +1 -1
  133. package/esm/models/components/partialcollectanddelivery.js.map +1 -1
  134. package/esm/models/components/partialcollectanddeliveryinput.d.ts +1 -1
  135. package/esm/models/components/partialcollectanddeliveryinput.d.ts.map +1 -1
  136. package/esm/models/components/payupaymentinfo.js +3 -3
  137. package/esm/models/components/payupaymentinfo.js.map +1 -1
  138. package/esm/models/components/productattribute.d.ts +1 -15
  139. package/esm/models/components/productattribute.d.ts.map +1 -1
  140. package/esm/models/components/productattribute.js +7 -15
  141. package/esm/models/components/productattribute.js.map +1 -1
  142. package/esm/models/components/productpromotion.d.ts +2 -18
  143. package/esm/models/components/productpromotion.d.ts.map +1 -1
  144. package/esm/models/components/productpromotion.js +8 -20
  145. package/esm/models/components/productpromotion.js.map +1 -1
  146. package/esm/models/components/savedpaymentmethod.d.ts +21 -21
  147. package/esm/models/components/savedpaymentmethod.d.ts.map +1 -1
  148. package/esm/models/components/savedpaymentmethod.js +21 -21
  149. package/esm/models/components/savedpaymentmethod.js.map +1 -1
  150. package/esm/models/components/singleselectattribute.d.ts +1 -1
  151. package/esm/models/components/singleselectattribute.d.ts.map +1 -1
  152. package/esm/models/components/singleselectattribute.js +1 -1
  153. package/esm/models/components/singleselectattribute.js.map +1 -1
  154. package/esm/models/components/singleselectoption.d.ts +1 -1
  155. package/esm/models/components/singleselectoption.d.ts.map +1 -1
  156. package/esm/models/components/singleselectoption.js +1 -1
  157. package/esm/models/components/singleselectoption.js.map +1 -1
  158. package/esm/models/components/textattribute.d.ts +1 -1
  159. package/esm/models/components/textattribute.js +1 -1
  160. package/esm/models/components/textattribute.js.map +1 -1
  161. package/esm/models/components/volumebasedpromotion.d.ts +1 -11
  162. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  163. package/esm/models/components/volumebasedpromotion.js +1 -9
  164. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  165. package/esm/models/operations/createaddress.d.ts +1 -1
  166. package/esm/models/operations/createaddress.d.ts.map +1 -1
  167. package/esm/models/operations/generateotp.d.ts +20 -4
  168. package/esm/models/operations/generateotp.d.ts.map +1 -1
  169. package/esm/models/operations/generateotp.js +4 -2
  170. package/esm/models/operations/generateotp.js.map +1 -1
  171. package/esm/models/operations/getaddressdetail.d.ts +1 -1
  172. package/esm/models/operations/getaddressdetail.d.ts.map +1 -1
  173. package/esm/models/operations/getaddressdetail.js +1 -1
  174. package/esm/models/operations/getaddressdetail.js.map +1 -1
  175. package/esm/models/operations/getmarketplaceproductdetail.d.ts +45 -0
  176. package/esm/models/operations/getmarketplaceproductdetail.d.ts.map +1 -0
  177. package/esm/models/operations/getmarketplaceproductdetail.js +38 -0
  178. package/esm/models/operations/getmarketplaceproductdetail.js.map +1 -0
  179. package/esm/models/operations/getmarketplacevariantdetail.d.ts +50 -0
  180. package/esm/models/operations/getmarketplacevariantdetail.d.ts.map +1 -0
  181. package/esm/models/operations/getmarketplacevariantdetail.js +40 -0
  182. package/esm/models/operations/getmarketplacevariantdetail.js.map +1 -0
  183. package/esm/models/operations/index.d.ts +11 -0
  184. package/esm/models/operations/index.d.ts.map +1 -1
  185. package/esm/models/operations/index.js +11 -0
  186. package/esm/models/operations/index.js.map +1 -1
  187. package/esm/models/operations/listaddresses.d.ts +1 -1
  188. package/esm/models/operations/listaddresses.d.ts.map +1 -1
  189. package/esm/models/operations/listaddresses.js +1 -1
  190. package/esm/models/operations/listaddresses.js.map +1 -1
  191. package/esm/models/operations/listmarketplacecategories.d.ts +59 -0
  192. package/esm/models/operations/listmarketplacecategories.d.ts.map +1 -0
  193. package/esm/models/operations/listmarketplacecategories.js +43 -0
  194. package/esm/models/operations/listmarketplacecategories.js.map +1 -0
  195. package/esm/models/operations/listmarketplacecrosssellproducts.d.ts +59 -0
  196. package/esm/models/operations/listmarketplacecrosssellproducts.d.ts.map +1 -0
  197. package/esm/models/operations/listmarketplacecrosssellproducts.js +42 -0
  198. package/esm/models/operations/listmarketplacecrosssellproducts.js.map +1 -0
  199. package/esm/models/operations/listmarketplaceproductreviews.d.ts +65 -0
  200. package/esm/models/operations/listmarketplaceproductreviews.d.ts.map +1 -0
  201. package/esm/models/operations/listmarketplaceproductreviews.js +48 -0
  202. package/esm/models/operations/listmarketplaceproductreviews.js.map +1 -0
  203. package/esm/models/operations/listmarketplaceproducts.d.ts +69 -0
  204. package/esm/models/operations/listmarketplaceproducts.d.ts.map +1 -0
  205. package/esm/models/operations/listmarketplaceproducts.js +45 -0
  206. package/esm/models/operations/listmarketplaceproducts.js.map +1 -0
  207. package/esm/models/operations/listmarketplaceproductvariants.d.ts +45 -0
  208. package/esm/models/operations/listmarketplaceproductvariants.d.ts.map +1 -0
  209. package/esm/models/operations/listmarketplaceproductvariants.js +38 -0
  210. package/esm/models/operations/listmarketplaceproductvariants.js.map +1 -0
  211. package/esm/models/operations/listmarketplacesimilarproducts.d.ts +59 -0
  212. package/esm/models/operations/listmarketplacesimilarproducts.d.ts.map +1 -0
  213. package/esm/models/operations/listmarketplacesimilarproducts.js +42 -0
  214. package/esm/models/operations/listmarketplacesimilarproducts.js.map +1 -0
  215. package/esm/models/operations/listmarketplaceskus.d.ts +69 -0
  216. package/esm/models/operations/listmarketplaceskus.d.ts.map +1 -0
  217. package/esm/models/operations/listmarketplaceskus.js +44 -0
  218. package/esm/models/operations/listmarketplaceskus.js.map +1 -0
  219. package/esm/models/operations/listmarketplaceupsellproducts.d.ts +62 -0
  220. package/esm/models/operations/listmarketplaceupsellproducts.d.ts.map +1 -0
  221. package/esm/models/operations/listmarketplaceupsellproducts.js +42 -0
  222. package/esm/models/operations/listmarketplaceupsellproducts.js.map +1 -0
  223. package/esm/models/operations/loginwithwhatsapp.d.ts +1 -1
  224. package/esm/models/operations/loginwithwhatsapp.d.ts.map +1 -1
  225. package/esm/models/operations/loginwithwhatsapp.js +1 -1
  226. package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
  227. package/esm/models/operations/searchmarketplaceproducts.d.ts +56 -0
  228. package/esm/models/operations/searchmarketplaceproducts.d.ts.map +1 -0
  229. package/esm/models/operations/searchmarketplaceproducts.js +53 -0
  230. package/esm/models/operations/searchmarketplaceproducts.js.map +1 -0
  231. package/esm/models/operations/searchproducts.d.ts +4 -4
  232. package/esm/models/operations/searchproducts.d.ts.map +1 -1
  233. package/esm/models/operations/searchproducts.js +4 -4
  234. package/esm/models/operations/searchproducts.js.map +1 -1
  235. package/esm/models/operations/updateaddressdetail.d.ts +1 -1
  236. package/esm/models/operations/updateaddressdetail.d.ts.map +1 -1
  237. package/esm/sdk/marketplace.d.ts +104 -0
  238. package/esm/sdk/marketplace.d.ts.map +1 -0
  239. package/esm/sdk/marketplace.js +140 -0
  240. package/esm/sdk/marketplace.js.map +1 -0
  241. package/esm/sdk/sdk.d.ts +3 -0
  242. package/esm/sdk/sdk.d.ts.map +1 -1
  243. package/esm/sdk/sdk.js +4 -0
  244. package/esm/sdk/sdk.js.map +1 -1
  245. package/esm/types/enums.d.ts +8 -11
  246. package/esm/types/enums.d.ts.map +1 -1
  247. package/esm/types/enums.js +22 -2
  248. package/esm/types/enums.js.map +1 -1
  249. package/esm/types/index.d.ts +2 -2
  250. package/esm/types/index.d.ts.map +1 -1
  251. package/esm/types/index.js +1 -1
  252. package/esm/types/index.js.map +1 -1
  253. package/esm/types/unrecognized.d.ts +16 -0
  254. package/esm/types/unrecognized.d.ts.map +1 -0
  255. package/esm/types/unrecognized.js +31 -0
  256. package/esm/types/unrecognized.js.map +1 -0
  257. package/examples/package-lock.json +1 -1
  258. package/jsr.json +1 -1
  259. package/package.json +1 -1
  260. package/src/funcs/marketplaceGetProductDetail.ts +198 -0
  261. package/src/funcs/marketplaceGetVariantDetail.ts +201 -0
  262. package/src/funcs/marketplaceListCategories.ts +188 -0
  263. package/src/funcs/marketplaceListCrosssellProducts.ts +193 -0
  264. package/src/funcs/marketplaceListProductReviews.ts +198 -0
  265. package/src/funcs/marketplaceListProductVariants.ts +199 -0
  266. package/src/funcs/marketplaceListProducts.ts +190 -0
  267. package/src/funcs/marketplaceListSimilarProducts.ts +193 -0
  268. package/src/funcs/marketplaceListSkus.ts +190 -0
  269. package/src/funcs/marketplaceListUpsellProducts.ts +193 -0
  270. package/src/funcs/marketplaceSearchProducts.ts +177 -0
  271. package/src/lib/config.ts +3 -3
  272. package/src/lib/encodings.ts +17 -3
  273. package/src/models/components/booleanattribute.ts +2 -2
  274. package/src/models/components/collectinstorefulfillment.ts +2 -3
  275. package/src/models/components/collectinstorefulfillmentinput.ts +1 -1
  276. package/src/models/components/colorattribute.ts +2 -2
  277. package/src/models/components/coloroption.ts +2 -2
  278. package/src/models/components/customeraddress.ts +2 -2
  279. package/src/models/components/customeraddressinput.ts +1 -1
  280. package/src/models/components/dateattribute.ts +2 -2
  281. package/src/models/components/deliveryfulfillment.ts +2 -2
  282. package/src/models/components/deliveryfulfillmentinput.ts +1 -1
  283. package/src/models/components/discountbasedpromotion.ts +2 -17
  284. package/src/models/components/fixedpricepromotion.ts +2 -18
  285. package/src/models/components/freegoodspromotion.ts +2 -18
  286. package/src/models/components/fulfillmentpreference.ts +6 -19
  287. package/src/models/components/fulfillmentpreferenceinput.ts +9 -26
  288. package/src/models/components/generateotpwithemail.ts +1 -1
  289. package/src/models/components/juspayhypercheckout.ts +1 -1
  290. package/src/models/components/juspayhypercheckoutresponse.ts +2 -3
  291. package/src/models/components/juspaynetbanking.ts +2 -2
  292. package/src/models/components/juspaynewcard.ts +3 -3
  293. package/src/models/components/juspaysavedcardtoken.ts +3 -3
  294. package/src/models/components/juspayupicollect.ts +3 -3
  295. package/src/models/components/juspayupiintent.ts +3 -3
  296. package/src/models/components/multiselectattribute.ts +2 -2
  297. package/src/models/components/numberattribute.ts +2 -2
  298. package/src/models/components/partialcollectanddelivery.ts +2 -4
  299. package/src/models/components/partialcollectanddeliveryinput.ts +1 -1
  300. package/src/models/components/payupaymentinfo.ts +3 -3
  301. package/src/models/components/productattribute.ts +14 -36
  302. package/src/models/components/productpromotion.ts +16 -48
  303. package/src/models/components/savedpaymentmethod.ts +42 -42
  304. package/src/models/components/singleselectattribute.ts +2 -2
  305. package/src/models/components/singleselectoption.ts +2 -2
  306. package/src/models/components/textattribute.ts +2 -2
  307. package/src/models/components/volumebasedpromotion.ts +2 -18
  308. package/src/models/operations/createaddress.ts +1 -1
  309. package/src/models/operations/generateotp.ts +20 -6
  310. package/src/models/operations/getaddressdetail.ts +2 -2
  311. package/src/models/operations/getmarketplaceproductdetail.ts +118 -0
  312. package/src/models/operations/getmarketplacevariantdetail.ts +125 -0
  313. package/src/models/operations/index.ts +11 -0
  314. package/src/models/operations/listaddresses.ts +2 -2
  315. package/src/models/operations/listmarketplacecategories.ts +131 -0
  316. package/src/models/operations/listmarketplacecrosssellproducts.ts +145 -0
  317. package/src/models/operations/listmarketplaceproductreviews.ts +148 -0
  318. package/src/models/operations/listmarketplaceproducts.ts +143 -0
  319. package/src/models/operations/listmarketplaceproductvariants.ts +118 -0
  320. package/src/models/operations/listmarketplacesimilarproducts.ts +136 -0
  321. package/src/models/operations/listmarketplaceskus.ts +139 -0
  322. package/src/models/operations/listmarketplaceupsellproducts.ts +139 -0
  323. package/src/models/operations/loginwithwhatsapp.ts +2 -2
  324. package/src/models/operations/searchmarketplaceproducts.ts +142 -0
  325. package/src/models/operations/searchproducts.ts +9 -9
  326. package/src/models/operations/updateaddressdetail.ts +1 -1
  327. package/src/sdk/marketplace.ts +229 -0
  328. package/src/sdk/sdk.ts +6 -0
  329. package/src/types/enums.ts +38 -9
  330. package/src/types/index.ts +2 -2
  331. package/src/types/unrecognized.ts +35 -0
  332. package/tsconfig.json +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  export { blobLikeSchema, isBlobLike } from "./blobs.js";
5
- export { catchUnrecognizedEnum } from "./enums.js";
6
5
  export { createPageIterator } from "./operations.js";
7
6
  export { RFCDate } from "./rfcdate.js";
7
+ export * from "./unrecognized.js";
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,16 @@
1
+ declare const __brand: unique symbol;
2
+ export type Unrecognized<T> = T & {
3
+ [__brand]: "unrecognized";
4
+ };
5
+ declare function unrecognized<T>(value: T): Unrecognized<T>;
6
+ export declare function startCountingUnrecognized(): {
7
+ /**
8
+ * Ends counting and returns the delta.
9
+ * @param delta - If provided, only this amount is added to the parent counter
10
+ * (used for nested unions where we only want to record the winning option's count).
11
+ * If not provided, records all counts since start().
12
+ */
13
+ end: (delta?: number) => number;
14
+ };
15
+ export { unrecognized };
16
+ //# sourceMappingURL=unrecognized.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unrecognized.d.ts","sourceRoot":"","sources":["../../src/types/unrecognized.ts"],"names":[],"mappings":"AAIA,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,CAAC;AACrC,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,CAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAEhE,iBAAS,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAGlD;AAID,wBAAgB,yBAAyB;IAIrC;;;;;OAKG;kBACW,MAAM;EAQvB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ function unrecognized(value) {
5
+ globalCount++;
6
+ return value;
7
+ }
8
+ let globalCount = 0;
9
+ let refCount = 0;
10
+ export function startCountingUnrecognized() {
11
+ refCount++;
12
+ const start = globalCount;
13
+ return {
14
+ /**
15
+ * Ends counting and returns the delta.
16
+ * @param delta - If provided, only this amount is added to the parent counter
17
+ * (used for nested unions where we only want to record the winning option's count).
18
+ * If not provided, records all counts since start().
19
+ */
20
+ end: (delta) => {
21
+ const count = globalCount - start;
22
+ // Reset globalCount back to start, then add only the specified delta
23
+ globalCount = start + (delta ?? count);
24
+ if (--refCount === 0)
25
+ globalCount = 0;
26
+ return count;
27
+ },
28
+ };
29
+ }
30
+ export { unrecognized };
31
+ //# sourceMappingURL=unrecognized.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unrecognized.js","sourceRoot":"","sources":["../../src/types/unrecognized.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,SAAS,YAAY,CAAI,KAAQ;IAC/B,WAAW,EAAE,CAAC;IACd,OAAO,KAAwB,CAAC;AAClC,CAAC;AAED,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,MAAM,UAAU,yBAAyB;IACvC,QAAQ,EAAE,CAAC;IACX,MAAM,KAAK,GAAG,WAAW,CAAC;IAC1B,OAAO;QACL;;;;;WAKG;QACH,GAAG,EAAE,CAAC,KAAc,EAAE,EAAE;YACtB,MAAM,KAAK,GAAG,WAAW,GAAG,KAAK,CAAC;YAClC,qEAAqE;YACrE,WAAW,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;YACvC,IAAI,EAAE,QAAQ,KAAK,CAAC;gBAAE,WAAW,GAAG,CAAC,CAAC;YACtC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "..": {
20
20
  "name": "ce-storefront",
21
- "version": "0.20.1",
21
+ "version": "0.21.1",
22
22
  "dependencies": {
23
23
  "zod": "^3.25.0 || ^4.0.0"
24
24
  },
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "ce-storefront",
5
- "version": "0.20.1",
5
+ "version": "0.21.1",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ce-storefront",
3
- "version": "0.20.1",
3
+ "version": "0.21.1",
4
4
  "author": "TarkAI",
5
5
  "type": "module",
6
6
  "main": "./esm/index.js",
@@ -0,0 +1,198 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CeStorefrontCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Retrieve a product detail
30
+ *
31
+ * @remarks
32
+ * 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.
33
+ *
34
+ * @see {@link https://llm-docs.commercengine.io/storefront/operations/get-marketplace-product-detail} - API reference for the get-marketplace-product-detail operation
35
+ */
36
+ export function marketplaceGetProductDetail(
37
+ client: CeStorefrontCore,
38
+ request: operations.GetMarketplaceProductDetailRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ operations.GetMarketplaceProductDetailResponseBody,
43
+ | errors.Unauthorized
44
+ | errors.NotFound
45
+ | CeStorefrontError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ request,
58
+ options,
59
+ ));
60
+ }
61
+
62
+ async function $do(
63
+ client: CeStorefrontCore,
64
+ request: operations.GetMarketplaceProductDetailRequest,
65
+ options?: RequestOptions,
66
+ ): Promise<
67
+ [
68
+ Result<
69
+ operations.GetMarketplaceProductDetailResponseBody,
70
+ | errors.Unauthorized
71
+ | errors.NotFound
72
+ | CeStorefrontError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const parsed = safeParse(
85
+ request,
86
+ (value) =>
87
+ operations.GetMarketplaceProductDetailRequest$outboundSchema.parse(value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const pathParams = {
97
+ product_id_or_slug: encodeSimple(
98
+ "product_id_or_slug",
99
+ payload.product_id_or_slug,
100
+ { explode: false, charEncoding: "percent" },
101
+ ),
102
+ };
103
+
104
+ const path = pathToFunc("/catalog/marketplace/products/{product_id_or_slug}")(
105
+ pathParams,
106
+ );
107
+
108
+ const query = encodeFormQuery({
109
+ "inventory": payload.inventory,
110
+ });
111
+
112
+ const headers = new Headers(compactMap({
113
+ Accept: "application/json",
114
+ "x-customer-group-id": encodeSimple(
115
+ "x-customer-group-id",
116
+ payload["x-customer-group-id"],
117
+ { explode: false, charEncoding: "none" },
118
+ ),
119
+ }));
120
+
121
+ const secConfig = await extractSecurity(client._options.authorization);
122
+ const securityInput = secConfig == null ? {} : { authorization: secConfig };
123
+ const requestSecurity = resolveGlobalSecurity(securityInput);
124
+
125
+ const context = {
126
+ options: client._options,
127
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
128
+ operationID: "get-marketplace-product-detail",
129
+ oAuth2Scopes: null,
130
+
131
+ resolvedSecurity: requestSecurity,
132
+
133
+ securitySource: client._options.authorization,
134
+ retryConfig: options?.retries
135
+ || client._options.retryConfig
136
+ || { strategy: "none" },
137
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
138
+ };
139
+
140
+ const requestRes = client._createRequest(context, {
141
+ security: requestSecurity,
142
+ method: "GET",
143
+ baseURL: options?.serverURL,
144
+ path: path,
145
+ headers: headers,
146
+ query: query,
147
+ body: body,
148
+ userAgent: client._options.userAgent,
149
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
150
+ }, options);
151
+ if (!requestRes.ok) {
152
+ return [requestRes, { status: "invalid" }];
153
+ }
154
+ const req = requestRes.value;
155
+
156
+ const doResult = await client._do(req, {
157
+ context,
158
+ errorCodes: ["401", "404", "4XX", "5XX"],
159
+ retryConfig: context.retryConfig,
160
+ retryCodes: context.retryCodes,
161
+ });
162
+ if (!doResult.ok) {
163
+ return [doResult, { status: "request-error", request: req }];
164
+ }
165
+ const response = doResult.value;
166
+
167
+ const responseFields = {
168
+ HttpMeta: { Response: response, Request: req },
169
+ };
170
+
171
+ const [result] = await M.match<
172
+ operations.GetMarketplaceProductDetailResponseBody,
173
+ | errors.Unauthorized
174
+ | errors.NotFound
175
+ | CeStorefrontError
176
+ | ResponseValidationError
177
+ | ConnectionError
178
+ | RequestAbortedError
179
+ | RequestTimeoutError
180
+ | InvalidRequestError
181
+ | UnexpectedClientError
182
+ | SDKValidationError
183
+ >(
184
+ M.json(
185
+ 200,
186
+ operations.GetMarketplaceProductDetailResponseBody$inboundSchema,
187
+ ),
188
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
189
+ M.jsonErr(404, errors.NotFound$inboundSchema),
190
+ M.fail("4XX"),
191
+ M.fail("5XX"),
192
+ )(response, req, { extraFields: responseFields });
193
+ if (!result.ok) {
194
+ return [result, { status: "complete", request: req, response }];
195
+ }
196
+
197
+ return [result, { status: "complete", request: req, response }];
198
+ }
@@ -0,0 +1,201 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CeStorefrontCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Retrieve variant detail
30
+ *
31
+ * @remarks
32
+ * Retrieves the details of a particular variant. Supply the unique product ID, and variant ID.
33
+ *
34
+ * @see {@link https://llm-docs.commercengine.io/storefront/operations/get-marketplace-variant-detail} - API reference for the get-marketplace-variant-detail operation
35
+ */
36
+ export function marketplaceGetVariantDetail(
37
+ client: CeStorefrontCore,
38
+ request: operations.GetMarketplaceVariantDetailRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ operations.GetMarketplaceVariantDetailResponseBody,
43
+ | errors.Unauthorized
44
+ | errors.NotFound
45
+ | CeStorefrontError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ request,
58
+ options,
59
+ ));
60
+ }
61
+
62
+ async function $do(
63
+ client: CeStorefrontCore,
64
+ request: operations.GetMarketplaceVariantDetailRequest,
65
+ options?: RequestOptions,
66
+ ): Promise<
67
+ [
68
+ Result<
69
+ operations.GetMarketplaceVariantDetailResponseBody,
70
+ | errors.Unauthorized
71
+ | errors.NotFound
72
+ | CeStorefrontError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const parsed = safeParse(
85
+ request,
86
+ (value) =>
87
+ operations.GetMarketplaceVariantDetailRequest$outboundSchema.parse(value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const pathParams = {
97
+ product_id: encodeSimple("product_id", payload.product_id, {
98
+ explode: false,
99
+ charEncoding: "percent",
100
+ }),
101
+ variant_id: encodeSimple("variant_id", payload.variant_id, {
102
+ explode: false,
103
+ charEncoding: "percent",
104
+ }),
105
+ };
106
+
107
+ const path = pathToFunc(
108
+ "/catalog/marketplace/products/{product_id}/variants/{variant_id}",
109
+ )(pathParams);
110
+
111
+ const query = encodeFormQuery({
112
+ "inventory": payload.inventory,
113
+ });
114
+
115
+ const headers = new Headers(compactMap({
116
+ Accept: "application/json",
117
+ "x-customer-group-id": encodeSimple(
118
+ "x-customer-group-id",
119
+ payload["x-customer-group-id"],
120
+ { explode: false, charEncoding: "none" },
121
+ ),
122
+ }));
123
+
124
+ const secConfig = await extractSecurity(client._options.authorization);
125
+ const securityInput = secConfig == null ? {} : { authorization: secConfig };
126
+ const requestSecurity = resolveGlobalSecurity(securityInput);
127
+
128
+ const context = {
129
+ options: client._options,
130
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
131
+ operationID: "get-marketplace-variant-detail",
132
+ oAuth2Scopes: null,
133
+
134
+ resolvedSecurity: requestSecurity,
135
+
136
+ securitySource: client._options.authorization,
137
+ retryConfig: options?.retries
138
+ || client._options.retryConfig
139
+ || { strategy: "none" },
140
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
141
+ };
142
+
143
+ const requestRes = client._createRequest(context, {
144
+ security: requestSecurity,
145
+ method: "GET",
146
+ baseURL: options?.serverURL,
147
+ path: path,
148
+ headers: headers,
149
+ query: query,
150
+ body: body,
151
+ userAgent: client._options.userAgent,
152
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
153
+ }, options);
154
+ if (!requestRes.ok) {
155
+ return [requestRes, { status: "invalid" }];
156
+ }
157
+ const req = requestRes.value;
158
+
159
+ const doResult = await client._do(req, {
160
+ context,
161
+ errorCodes: ["401", "404", "4XX", "5XX"],
162
+ retryConfig: context.retryConfig,
163
+ retryCodes: context.retryCodes,
164
+ });
165
+ if (!doResult.ok) {
166
+ return [doResult, { status: "request-error", request: req }];
167
+ }
168
+ const response = doResult.value;
169
+
170
+ const responseFields = {
171
+ HttpMeta: { Response: response, Request: req },
172
+ };
173
+
174
+ const [result] = await M.match<
175
+ operations.GetMarketplaceVariantDetailResponseBody,
176
+ | errors.Unauthorized
177
+ | errors.NotFound
178
+ | CeStorefrontError
179
+ | ResponseValidationError
180
+ | ConnectionError
181
+ | RequestAbortedError
182
+ | RequestTimeoutError
183
+ | InvalidRequestError
184
+ | UnexpectedClientError
185
+ | SDKValidationError
186
+ >(
187
+ M.json(
188
+ 200,
189
+ operations.GetMarketplaceVariantDetailResponseBody$inboundSchema,
190
+ ),
191
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
192
+ M.jsonErr(404, errors.NotFound$inboundSchema),
193
+ M.fail("4XX"),
194
+ M.fail("5XX"),
195
+ )(response, req, { extraFields: responseFields });
196
+ if (!result.ok) {
197
+ return [result, { status: "complete", request: req, response }];
198
+ }
199
+
200
+ return [result, { status: "complete", request: req, response }];
201
+ }
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CeStorefrontCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * List all categories
30
+ *
31
+ * @remarks
32
+ * Returns a list of your product categories. The categories are returned sorted by creation date, with the most recently created categories appearing first.
33
+ *
34
+ * @see {@link https://llm-docs.commercengine.io/storefront/operations/list-marketplace-categories} - API reference for the list-marketplace-categories operation
35
+ */
36
+ export function marketplaceListCategories(
37
+ client: CeStorefrontCore,
38
+ request: operations.ListMarketplaceCategoriesRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ operations.ListMarketplaceCategoriesResponseBody,
43
+ | errors.BadRequest
44
+ | errors.Unauthorized
45
+ | errors.NotFound
46
+ | CeStorefrontError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: CeStorefrontCore,
65
+ request: operations.ListMarketplaceCategoriesRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ operations.ListMarketplaceCategoriesResponseBody,
71
+ | errors.BadRequest
72
+ | errors.Unauthorized
73
+ | errors.NotFound
74
+ | CeStorefrontError
75
+ | ResponseValidationError
76
+ | ConnectionError
77
+ | RequestAbortedError
78
+ | RequestTimeoutError
79
+ | InvalidRequestError
80
+ | UnexpectedClientError
81
+ | SDKValidationError
82
+ >,
83
+ APICall,
84
+ ]
85
+ > {
86
+ const parsed = safeParse(
87
+ request,
88
+ (value) =>
89
+ operations.ListMarketplaceCategoriesRequest$outboundSchema.parse(value),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed.ok) {
93
+ return [parsed, { status: "invalid" }];
94
+ }
95
+ const payload = parsed.value;
96
+ const body = null;
97
+
98
+ const path = pathToFunc("/catalog/marketplace/categories")();
99
+
100
+ const query = encodeFormQuery({
101
+ "nested_level": payload.nested_level,
102
+ "parent_category_id": payload.parent_category_id,
103
+ "parent_category_slug": payload.parent_category_slug,
104
+ "search": payload.search,
105
+ "sort_by": payload.sort_by,
106
+ });
107
+
108
+ const headers = new Headers(compactMap({
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const secConfig = await extractSecurity(client._options.authorization);
113
+ const securityInput = secConfig == null ? {} : { authorization: secConfig };
114
+ const requestSecurity = resolveGlobalSecurity(securityInput);
115
+
116
+ const context = {
117
+ options: client._options,
118
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
119
+ operationID: "list-marketplace-categories",
120
+ oAuth2Scopes: null,
121
+
122
+ resolvedSecurity: requestSecurity,
123
+
124
+ securitySource: client._options.authorization,
125
+ retryConfig: options?.retries
126
+ || client._options.retryConfig
127
+ || { strategy: "none" },
128
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
+ };
130
+
131
+ const requestRes = client._createRequest(context, {
132
+ security: requestSecurity,
133
+ method: "GET",
134
+ baseURL: options?.serverURL,
135
+ path: path,
136
+ headers: headers,
137
+ query: query,
138
+ body: body,
139
+ userAgent: client._options.userAgent,
140
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
141
+ }, options);
142
+ if (!requestRes.ok) {
143
+ return [requestRes, { status: "invalid" }];
144
+ }
145
+ const req = requestRes.value;
146
+
147
+ const doResult = await client._do(req, {
148
+ context,
149
+ errorCodes: ["400", "401", "404", "4XX", "5XX"],
150
+ retryConfig: context.retryConfig,
151
+ retryCodes: context.retryCodes,
152
+ });
153
+ if (!doResult.ok) {
154
+ return [doResult, { status: "request-error", request: req }];
155
+ }
156
+ const response = doResult.value;
157
+
158
+ const responseFields = {
159
+ HttpMeta: { Response: response, Request: req },
160
+ };
161
+
162
+ const [result] = await M.match<
163
+ operations.ListMarketplaceCategoriesResponseBody,
164
+ | errors.BadRequest
165
+ | errors.Unauthorized
166
+ | errors.NotFound
167
+ | CeStorefrontError
168
+ | ResponseValidationError
169
+ | ConnectionError
170
+ | RequestAbortedError
171
+ | RequestTimeoutError
172
+ | InvalidRequestError
173
+ | UnexpectedClientError
174
+ | SDKValidationError
175
+ >(
176
+ M.json(200, operations.ListMarketplaceCategoriesResponseBody$inboundSchema),
177
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
178
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
179
+ M.jsonErr(404, errors.NotFound$inboundSchema),
180
+ M.fail("4XX"),
181
+ M.fail("5XX"),
182
+ )(response, req, { extraFields: responseFields });
183
+ if (!result.ok) {
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
186
+
187
+ return [result, { status: "complete", request: req, response }];
188
+ }