ce-storefront 0.13.2 → 0.14.0

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 (330) hide show
  1. package/README.md +35 -28
  2. package/docs/sdks/catalog/README.md +7 -5
  3. package/esm/funcs/authGenerateOtp.d.ts +3 -2
  4. package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
  5. package/esm/funcs/authGenerateOtp.js +1 -1
  6. package/esm/funcs/authGenerateOtp.js.map +1 -1
  7. package/esm/funcs/authGetAnonymousToken.d.ts +3 -2
  8. package/esm/funcs/authGetAnonymousToken.d.ts.map +1 -1
  9. package/esm/funcs/authGetAnonymousToken.js +1 -1
  10. package/esm/funcs/authGetAnonymousToken.js.map +1 -1
  11. package/esm/funcs/authGetUserDetail.d.ts +3 -2
  12. package/esm/funcs/authGetUserDetail.d.ts.map +1 -1
  13. package/esm/funcs/authGetUserDetail.js +1 -1
  14. package/esm/funcs/authGetUserDetail.js.map +1 -1
  15. package/esm/funcs/authLoginWithEmail.d.ts +3 -2
  16. package/esm/funcs/authLoginWithEmail.d.ts.map +1 -1
  17. package/esm/funcs/authLoginWithEmail.js +1 -1
  18. package/esm/funcs/authLoginWithEmail.js.map +1 -1
  19. package/esm/funcs/authLoginWithPhone.d.ts +3 -2
  20. package/esm/funcs/authLoginWithPhone.d.ts.map +1 -1
  21. package/esm/funcs/authLoginWithPhone.js +1 -1
  22. package/esm/funcs/authLoginWithPhone.js.map +1 -1
  23. package/esm/funcs/authLoginWithWhatsapp.d.ts +3 -2
  24. package/esm/funcs/authLoginWithWhatsapp.d.ts.map +1 -1
  25. package/esm/funcs/authLoginWithWhatsapp.js +1 -1
  26. package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
  27. package/esm/funcs/authLogout.d.ts +3 -2
  28. package/esm/funcs/authLogout.d.ts.map +1 -1
  29. package/esm/funcs/authLogout.js +1 -1
  30. package/esm/funcs/authLogout.js.map +1 -1
  31. package/esm/funcs/authRefreshToken.d.ts +3 -2
  32. package/esm/funcs/authRefreshToken.d.ts.map +1 -1
  33. package/esm/funcs/authRefreshToken.js +1 -1
  34. package/esm/funcs/authRefreshToken.js.map +1 -1
  35. package/esm/funcs/authUpdateUser.d.ts +3 -2
  36. package/esm/funcs/authUpdateUser.d.ts.map +1 -1
  37. package/esm/funcs/authUpdateUser.js +1 -1
  38. package/esm/funcs/authUpdateUser.js.map +1 -1
  39. package/esm/funcs/authVerifyOtp.d.ts +3 -2
  40. package/esm/funcs/authVerifyOtp.d.ts.map +1 -1
  41. package/esm/funcs/authVerifyOtp.js +1 -1
  42. package/esm/funcs/authVerifyOtp.js.map +1 -1
  43. package/esm/funcs/cartsAddShippingMethod.d.ts +3 -2
  44. package/esm/funcs/cartsAddShippingMethod.d.ts.map +1 -1
  45. package/esm/funcs/cartsAddShippingMethod.js +1 -1
  46. package/esm/funcs/cartsAddShippingMethod.js.map +1 -1
  47. package/esm/funcs/cartsApplyCoupon.d.ts +3 -2
  48. package/esm/funcs/cartsApplyCoupon.d.ts.map +1 -1
  49. package/esm/funcs/cartsApplyCoupon.js +1 -1
  50. package/esm/funcs/cartsApplyCoupon.js.map +1 -1
  51. package/esm/funcs/cartsCreateCart.d.ts +3 -2
  52. package/esm/funcs/cartsCreateCart.d.ts.map +1 -1
  53. package/esm/funcs/cartsCreateCart.js +1 -1
  54. package/esm/funcs/cartsCreateCart.js.map +1 -1
  55. package/esm/funcs/cartsCreateCartAddress.d.ts +3 -2
  56. package/esm/funcs/cartsCreateCartAddress.d.ts.map +1 -1
  57. package/esm/funcs/cartsCreateCartAddress.js +1 -1
  58. package/esm/funcs/cartsCreateCartAddress.js.map +1 -1
  59. package/esm/funcs/cartsDeleteCart.d.ts +3 -2
  60. package/esm/funcs/cartsDeleteCart.d.ts.map +1 -1
  61. package/esm/funcs/cartsDeleteCart.js +1 -1
  62. package/esm/funcs/cartsDeleteCart.js.map +1 -1
  63. package/esm/funcs/cartsGetCart.d.ts +3 -2
  64. package/esm/funcs/cartsGetCart.d.ts.map +1 -1
  65. package/esm/funcs/cartsGetCart.js +1 -1
  66. package/esm/funcs/cartsGetCart.js.map +1 -1
  67. package/esm/funcs/cartsGetUserCart.d.ts +3 -2
  68. package/esm/funcs/cartsGetUserCart.d.ts.map +1 -1
  69. package/esm/funcs/cartsGetUserCart.js +1 -1
  70. package/esm/funcs/cartsGetUserCart.js.map +1 -1
  71. package/esm/funcs/cartsRedeemLoyaltyPoints.d.ts +3 -2
  72. package/esm/funcs/cartsRedeemLoyaltyPoints.d.ts.map +1 -1
  73. package/esm/funcs/cartsRedeemLoyaltyPoints.js +1 -1
  74. package/esm/funcs/cartsRedeemLoyaltyPoints.js.map +1 -1
  75. package/esm/funcs/cartsRemoveCoupon.d.ts +3 -2
  76. package/esm/funcs/cartsRemoveCoupon.d.ts.map +1 -1
  77. package/esm/funcs/cartsRemoveCoupon.js +1 -1
  78. package/esm/funcs/cartsRemoveCoupon.js.map +1 -1
  79. package/esm/funcs/cartsRemoveLoyaltyPoints.d.ts +3 -2
  80. package/esm/funcs/cartsRemoveLoyaltyPoints.d.ts.map +1 -1
  81. package/esm/funcs/cartsRemoveLoyaltyPoints.js +1 -1
  82. package/esm/funcs/cartsRemoveLoyaltyPoints.js.map +1 -1
  83. package/esm/funcs/cartsRemoveUserCart.d.ts +3 -2
  84. package/esm/funcs/cartsRemoveUserCart.d.ts.map +1 -1
  85. package/esm/funcs/cartsRemoveUserCart.js +1 -1
  86. package/esm/funcs/cartsRemoveUserCart.js.map +1 -1
  87. package/esm/funcs/cartsUpdateCart.d.ts +3 -2
  88. package/esm/funcs/cartsUpdateCart.d.ts.map +1 -1
  89. package/esm/funcs/cartsUpdateCart.js +1 -1
  90. package/esm/funcs/cartsUpdateCart.js.map +1 -1
  91. package/esm/funcs/catalogGetProductDetail.d.ts +4 -3
  92. package/esm/funcs/catalogGetProductDetail.d.ts.map +1 -1
  93. package/esm/funcs/catalogGetProductDetail.js +4 -7
  94. package/esm/funcs/catalogGetProductDetail.js.map +1 -1
  95. package/esm/funcs/catalogGetVariantDetail.d.ts +3 -2
  96. package/esm/funcs/catalogGetVariantDetail.d.ts.map +1 -1
  97. package/esm/funcs/catalogGetVariantDetail.js +1 -1
  98. package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
  99. package/esm/funcs/catalogListCategories.d.ts +3 -2
  100. package/esm/funcs/catalogListCategories.d.ts.map +1 -1
  101. package/esm/funcs/catalogListCategories.js +2 -1
  102. package/esm/funcs/catalogListCategories.js.map +1 -1
  103. package/esm/funcs/catalogListCrosssellProducts.d.ts +3 -2
  104. package/esm/funcs/catalogListCrosssellProducts.d.ts.map +1 -1
  105. package/esm/funcs/catalogListCrosssellProducts.js +1 -1
  106. package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
  107. package/esm/funcs/catalogListProductReviews.d.ts +3 -2
  108. package/esm/funcs/catalogListProductReviews.d.ts.map +1 -1
  109. package/esm/funcs/catalogListProductReviews.js +1 -1
  110. package/esm/funcs/catalogListProductReviews.js.map +1 -1
  111. package/esm/funcs/catalogListProductVariants.d.ts +3 -2
  112. package/esm/funcs/catalogListProductVariants.d.ts.map +1 -1
  113. package/esm/funcs/catalogListProductVariants.js +1 -1
  114. package/esm/funcs/catalogListProductVariants.js.map +1 -1
  115. package/esm/funcs/catalogListProducts.d.ts +3 -2
  116. package/esm/funcs/catalogListProducts.d.ts.map +1 -1
  117. package/esm/funcs/catalogListProducts.js +2 -1
  118. package/esm/funcs/catalogListProducts.js.map +1 -1
  119. package/esm/funcs/catalogListSimilarProducts.d.ts +3 -2
  120. package/esm/funcs/catalogListSimilarProducts.d.ts.map +1 -1
  121. package/esm/funcs/catalogListSimilarProducts.js +1 -1
  122. package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
  123. package/esm/funcs/catalogListSkus.d.ts +3 -2
  124. package/esm/funcs/catalogListSkus.d.ts.map +1 -1
  125. package/esm/funcs/catalogListSkus.js +1 -1
  126. package/esm/funcs/catalogListSkus.js.map +1 -1
  127. package/esm/funcs/catalogListUpsellProducts.d.ts +3 -2
  128. package/esm/funcs/catalogListUpsellProducts.d.ts.map +1 -1
  129. package/esm/funcs/catalogListUpsellProducts.js +1 -1
  130. package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
  131. package/esm/funcs/catalogSearchProducts.d.ts +3 -2
  132. package/esm/funcs/catalogSearchProducts.d.ts.map +1 -1
  133. package/esm/funcs/catalogSearchProducts.js +1 -1
  134. package/esm/funcs/catalogSearchProducts.js.map +1 -1
  135. package/esm/funcs/commonListCountryPincodes.d.ts +3 -2
  136. package/esm/funcs/commonListCountryPincodes.d.ts.map +1 -1
  137. package/esm/funcs/commonListCountryPincodes.js +1 -1
  138. package/esm/funcs/commonListCountryPincodes.js.map +1 -1
  139. package/esm/funcs/customersCreateAddress.d.ts +3 -2
  140. package/esm/funcs/customersCreateAddress.d.ts.map +1 -1
  141. package/esm/funcs/customersCreateAddress.js +1 -1
  142. package/esm/funcs/customersCreateAddress.js.map +1 -1
  143. package/esm/funcs/customersDeleteAddress.d.ts +3 -2
  144. package/esm/funcs/customersDeleteAddress.d.ts.map +1 -1
  145. package/esm/funcs/customersDeleteAddress.js +1 -1
  146. package/esm/funcs/customersDeleteAddress.js.map +1 -1
  147. package/esm/funcs/customersGetAddressDetail.d.ts +3 -2
  148. package/esm/funcs/customersGetAddressDetail.d.ts.map +1 -1
  149. package/esm/funcs/customersGetAddressDetail.js +1 -1
  150. package/esm/funcs/customersGetAddressDetail.js.map +1 -1
  151. package/esm/funcs/customersGetLoyaltyDetails.d.ts +3 -2
  152. package/esm/funcs/customersGetLoyaltyDetails.d.ts.map +1 -1
  153. package/esm/funcs/customersGetLoyaltyDetails.js +1 -1
  154. package/esm/funcs/customersGetLoyaltyDetails.js.map +1 -1
  155. package/esm/funcs/customersListAddresses.d.ts +3 -2
  156. package/esm/funcs/customersListAddresses.d.ts.map +1 -1
  157. package/esm/funcs/customersListAddresses.js +1 -1
  158. package/esm/funcs/customersListAddresses.js.map +1 -1
  159. package/esm/funcs/customersListUserReviews.d.ts +3 -2
  160. package/esm/funcs/customersListUserReviews.d.ts.map +1 -1
  161. package/esm/funcs/customersListUserReviews.js +1 -1
  162. package/esm/funcs/customersListUserReviews.js.map +1 -1
  163. package/esm/funcs/customersUpdateAddressDetail.d.ts +3 -2
  164. package/esm/funcs/customersUpdateAddressDetail.d.ts.map +1 -1
  165. package/esm/funcs/customersUpdateAddressDetail.js +1 -1
  166. package/esm/funcs/customersUpdateAddressDetail.js.map +1 -1
  167. package/esm/funcs/ordersCancelOrder.d.ts +3 -2
  168. package/esm/funcs/ordersCancelOrder.d.ts.map +1 -1
  169. package/esm/funcs/ordersCancelOrder.js +1 -1
  170. package/esm/funcs/ordersCancelOrder.js.map +1 -1
  171. package/esm/funcs/ordersCreateOrder.d.ts +3 -2
  172. package/esm/funcs/ordersCreateOrder.d.ts.map +1 -1
  173. package/esm/funcs/ordersCreateOrder.js +1 -1
  174. package/esm/funcs/ordersCreateOrder.js.map +1 -1
  175. package/esm/funcs/ordersGetOrderDetail.d.ts +3 -2
  176. package/esm/funcs/ordersGetOrderDetail.d.ts.map +1 -1
  177. package/esm/funcs/ordersGetOrderDetail.js +1 -1
  178. package/esm/funcs/ordersGetOrderDetail.js.map +1 -1
  179. package/esm/funcs/ordersGetPaymentStatus.d.ts +3 -2
  180. package/esm/funcs/ordersGetPaymentStatus.d.ts.map +1 -1
  181. package/esm/funcs/ordersGetPaymentStatus.js +1 -1
  182. package/esm/funcs/ordersGetPaymentStatus.js.map +1 -1
  183. package/esm/funcs/ordersListOrderShipments.d.ts +3 -2
  184. package/esm/funcs/ordersListOrderShipments.d.ts.map +1 -1
  185. package/esm/funcs/ordersListOrderShipments.js +1 -1
  186. package/esm/funcs/ordersListOrderShipments.js.map +1 -1
  187. package/esm/funcs/ordersListOrders.d.ts +3 -2
  188. package/esm/funcs/ordersListOrders.d.ts.map +1 -1
  189. package/esm/funcs/ordersListOrders.js +1 -1
  190. package/esm/funcs/ordersListOrders.js.map +1 -1
  191. package/esm/funcs/ordersRetryOrderPayment.d.ts +3 -2
  192. package/esm/funcs/ordersRetryOrderPayment.d.ts.map +1 -1
  193. package/esm/funcs/ordersRetryOrderPayment.js +1 -1
  194. package/esm/funcs/ordersRetryOrderPayment.js.map +1 -1
  195. package/esm/funcs/shippingShippingMethods.d.ts +3 -2
  196. package/esm/funcs/shippingShippingMethods.d.ts.map +1 -1
  197. package/esm/funcs/shippingShippingMethods.js +1 -1
  198. package/esm/funcs/shippingShippingMethods.js.map +1 -1
  199. package/esm/lib/config.d.ts +3 -3
  200. package/esm/lib/config.js +3 -3
  201. package/esm/lib/matchers.d.ts +3 -10
  202. package/esm/lib/matchers.d.ts.map +1 -1
  203. package/esm/lib/matchers.js +33 -30
  204. package/esm/lib/matchers.js.map +1 -1
  205. package/esm/models/components/product.d.ts +3 -0
  206. package/esm/models/components/product.d.ts.map +1 -1
  207. package/esm/models/components/product.js +3 -0
  208. package/esm/models/components/product.js.map +1 -1
  209. package/esm/models/components/productdetail.d.ts +3 -0
  210. package/esm/models/components/productdetail.d.ts.map +1 -1
  211. package/esm/models/components/productdetail.js +3 -0
  212. package/esm/models/components/productdetail.js.map +1 -1
  213. package/esm/models/components/productreview.d.ts +1 -10
  214. package/esm/models/components/productreview.d.ts.map +1 -1
  215. package/esm/models/components/productreview.js +2 -5
  216. package/esm/models/components/productreview.js.map +1 -1
  217. package/esm/models/errors/badrequest.d.ts +7 -2
  218. package/esm/models/errors/badrequest.d.ts.map +1 -1
  219. package/esm/models/errors/badrequest.js +12 -4
  220. package/esm/models/errors/badrequest.js.map +1 -1
  221. package/esm/models/errors/ceerror.d.ts +8 -18
  222. package/esm/models/errors/ceerror.d.ts.map +1 -1
  223. package/esm/models/errors/ceerror.js +17 -10
  224. package/esm/models/errors/ceerror.js.map +1 -1
  225. package/esm/models/errors/cestorefronterror.d.ts +19 -0
  226. package/esm/models/errors/cestorefronterror.d.ts.map +1 -0
  227. package/esm/models/errors/cestorefronterror.js +16 -0
  228. package/esm/models/errors/cestorefronterror.js.map +1 -0
  229. package/esm/models/errors/index.d.ts +1 -0
  230. package/esm/models/errors/index.d.ts.map +1 -1
  231. package/esm/models/errors/index.js +1 -0
  232. package/esm/models/errors/index.js.map +1 -1
  233. package/esm/models/errors/notfound.d.ts +7 -2
  234. package/esm/models/errors/notfound.d.ts.map +1 -1
  235. package/esm/models/errors/notfound.js +12 -4
  236. package/esm/models/errors/notfound.js.map +1 -1
  237. package/esm/models/errors/responsevalidationerror.d.ts +26 -0
  238. package/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
  239. package/esm/models/errors/responsevalidationerror.js +29 -0
  240. package/esm/models/errors/responsevalidationerror.js.map +1 -0
  241. package/esm/models/errors/sdkvalidationerror.d.ts +1 -0
  242. package/esm/models/errors/sdkvalidationerror.d.ts.map +1 -1
  243. package/esm/models/errors/sdkvalidationerror.js +14 -0
  244. package/esm/models/errors/sdkvalidationerror.js.map +1 -1
  245. package/esm/models/errors/unauthorized.d.ts +7 -2
  246. package/esm/models/errors/unauthorized.d.ts.map +1 -1
  247. package/esm/models/errors/unauthorized.js +12 -4
  248. package/esm/models/errors/unauthorized.js.map +1 -1
  249. package/esm/models/operations/getproductdetail.d.ts +3 -3
  250. package/esm/models/operations/getproductdetail.d.ts.map +1 -1
  251. package/esm/models/operations/getproductdetail.js +4 -4
  252. package/esm/models/operations/getproductdetail.js.map +1 -1
  253. package/esm/models/operations/listcategories.d.ts +6 -1
  254. package/esm/models/operations/listcategories.d.ts.map +1 -1
  255. package/esm/models/operations/listcategories.js +4 -0
  256. package/esm/models/operations/listcategories.js.map +1 -1
  257. package/esm/models/operations/listproducts.d.ts +6 -1
  258. package/esm/models/operations/listproducts.d.ts.map +1 -1
  259. package/esm/models/operations/listproducts.js +4 -0
  260. package/esm/models/operations/listproducts.js.map +1 -1
  261. package/esm/sdk/catalog.d.ts +1 -1
  262. package/esm/sdk/catalog.js +1 -1
  263. package/jsr.json +1 -1
  264. package/package.json +1 -1
  265. package/src/funcs/authGenerateOtp.ts +21 -17
  266. package/src/funcs/authGetAnonymousToken.ts +21 -17
  267. package/src/funcs/authGetUserDetail.ts +21 -17
  268. package/src/funcs/authLoginWithEmail.ts +21 -17
  269. package/src/funcs/authLoginWithPhone.ts +21 -17
  270. package/src/funcs/authLoginWithWhatsapp.ts +21 -17
  271. package/src/funcs/authLogout.ts +21 -17
  272. package/src/funcs/authRefreshToken.ts +21 -17
  273. package/src/funcs/authUpdateUser.ts +21 -17
  274. package/src/funcs/authVerifyOtp.ts +21 -17
  275. package/src/funcs/cartsAddShippingMethod.ts +21 -17
  276. package/src/funcs/cartsApplyCoupon.ts +21 -17
  277. package/src/funcs/cartsCreateCart.ts +21 -17
  278. package/src/funcs/cartsCreateCartAddress.ts +21 -17
  279. package/src/funcs/cartsDeleteCart.ts +21 -17
  280. package/src/funcs/cartsGetCart.ts +21 -17
  281. package/src/funcs/cartsGetUserCart.ts +21 -17
  282. package/src/funcs/cartsRedeemLoyaltyPoints.ts +21 -17
  283. package/src/funcs/cartsRemoveCoupon.ts +21 -17
  284. package/src/funcs/cartsRemoveLoyaltyPoints.ts +21 -17
  285. package/src/funcs/cartsRemoveUserCart.ts +21 -17
  286. package/src/funcs/cartsUpdateCart.ts +21 -17
  287. package/src/funcs/catalogGetProductDetail.ts +28 -23
  288. package/src/funcs/catalogGetVariantDetail.ts +21 -17
  289. package/src/funcs/catalogListCategories.ts +22 -17
  290. package/src/funcs/catalogListCrosssellProducts.ts +21 -17
  291. package/src/funcs/catalogListProductReviews.ts +21 -17
  292. package/src/funcs/catalogListProductVariants.ts +21 -17
  293. package/src/funcs/catalogListProducts.ts +22 -17
  294. package/src/funcs/catalogListSimilarProducts.ts +21 -17
  295. package/src/funcs/catalogListSkus.ts +21 -17
  296. package/src/funcs/catalogListUpsellProducts.ts +21 -17
  297. package/src/funcs/catalogSearchProducts.ts +21 -17
  298. package/src/funcs/commonListCountryPincodes.ts +21 -17
  299. package/src/funcs/customersCreateAddress.ts +21 -17
  300. package/src/funcs/customersDeleteAddress.ts +21 -17
  301. package/src/funcs/customersGetAddressDetail.ts +21 -17
  302. package/src/funcs/customersGetLoyaltyDetails.ts +21 -17
  303. package/src/funcs/customersListAddresses.ts +21 -17
  304. package/src/funcs/customersListUserReviews.ts +21 -17
  305. package/src/funcs/customersUpdateAddressDetail.ts +21 -17
  306. package/src/funcs/ordersCancelOrder.ts +21 -17
  307. package/src/funcs/ordersCreateOrder.ts +21 -17
  308. package/src/funcs/ordersGetOrderDetail.ts +21 -17
  309. package/src/funcs/ordersGetPaymentStatus.ts +21 -17
  310. package/src/funcs/ordersListOrderShipments.ts +21 -17
  311. package/src/funcs/ordersListOrders.ts +21 -17
  312. package/src/funcs/ordersRetryOrderPayment.ts +21 -17
  313. package/src/funcs/shippingShippingMethods.ts +21 -17
  314. package/src/lib/config.ts +3 -3
  315. package/src/lib/matchers.ts +44 -41
  316. package/src/models/components/product.ts +10 -0
  317. package/src/models/components/productdetail.ts +10 -0
  318. package/src/models/components/productreview.ts +3 -6
  319. package/src/models/errors/badrequest.ts +15 -5
  320. package/src/models/errors/ceerror.ts +23 -31
  321. package/src/models/errors/cestorefronterror.ts +35 -0
  322. package/src/models/errors/index.ts +1 -0
  323. package/src/models/errors/notfound.ts +15 -5
  324. package/src/models/errors/responsevalidationerror.ts +50 -0
  325. package/src/models/errors/sdkvalidationerror.ts +12 -0
  326. package/src/models/errors/unauthorized.ts +15 -5
  327. package/src/models/operations/getproductdetail.ts +7 -7
  328. package/src/models/operations/listcategories.ts +10 -1
  329. package/src/models/operations/listproducts.ts +10 -1
  330. package/src/sdk/catalog.ts +1 -1
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { CeStorefrontError } from "./cestorefronterror.js";
6
7
 
7
8
  /**
8
9
  * Requested resource not found
@@ -16,18 +17,20 @@ export type NotFoundData = {
16
17
  /**
17
18
  * Requested resource not found
18
19
  */
19
- export class NotFound extends Error {
20
+ export class NotFound extends CeStorefrontError {
20
21
  success: boolean;
21
22
  code: string;
22
23
 
23
24
  /** The original data that was passed to this error instance. */
24
25
  data$: NotFoundData;
25
26
 
26
- constructor(err: NotFoundData) {
27
+ constructor(
28
+ err: NotFoundData,
29
+ httpMeta: { response: Response; request: Request; body: string },
30
+ ) {
27
31
  const message = err.message || "API error occurred";
28
- super(message);
32
+ super(message, httpMeta);
29
33
  this.data$ = err;
30
-
31
34
  this.success = err.success;
32
35
  this.code = err.code;
33
36
 
@@ -44,9 +47,16 @@ export const NotFound$inboundSchema: z.ZodType<
44
47
  message: z.string(),
45
48
  success: z.boolean(),
46
49
  code: z.string(),
50
+ request$: z.instanceof(Request),
51
+ response$: z.instanceof(Response),
52
+ body$: z.string(),
47
53
  })
48
54
  .transform((v) => {
49
- return new NotFound(v);
55
+ return new NotFound(v, {
56
+ request: v.request$,
57
+ response: v.response$,
58
+ body: v.body$,
59
+ });
50
60
  });
51
61
 
52
62
  /** @internal */
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { CeStorefrontError } from "./cestorefronterror.js";
7
+ import { formatZodError } from "./sdkvalidationerror.js";
8
+
9
+ export class ResponseValidationError extends CeStorefrontError {
10
+ /**
11
+ * The raw value that failed validation.
12
+ */
13
+ public readonly rawValue: unknown;
14
+
15
+ /**
16
+ * The raw message that failed validation.
17
+ */
18
+ public readonly rawMessage: unknown;
19
+
20
+ constructor(
21
+ message: string,
22
+ extra: {
23
+ response: Response;
24
+ request: Request;
25
+ body: string;
26
+ cause: unknown;
27
+ rawValue: unknown;
28
+ rawMessage: unknown;
29
+ },
30
+ ) {
31
+ super(message, extra);
32
+ this.name = "ResponseValidationError";
33
+ this.cause = extra.cause;
34
+ this.rawValue = extra.rawValue;
35
+ this.rawMessage = extra.rawMessage;
36
+ }
37
+
38
+ /**
39
+ * Return a pretty-formatted error message if the underlying validation error
40
+ * is a ZodError or some other recognized error type, otherwise return the
41
+ * default error message.
42
+ */
43
+ public pretty(): string {
44
+ if (this.cause instanceof z.ZodError) {
45
+ return `${this.rawMessage}\n${formatZodError(this.cause)}`;
46
+ } else {
47
+ return this.toString();
48
+ }
49
+ }
50
+ }
@@ -15,6 +15,18 @@ export class SDKValidationError extends Error {
15
15
  */
16
16
  public readonly rawMessage: unknown;
17
17
 
18
+ // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
19
+ static override [Symbol.hasInstance](
20
+ instance: unknown,
21
+ ): instance is SDKValidationError {
22
+ if (!(instance instanceof Error)) return false;
23
+ if (!("rawValue" in instance)) return false;
24
+ if (!("rawMessage" in instance)) return false;
25
+ if (!("pretty" in instance)) return false;
26
+ if (typeof instance.pretty !== "function") return false;
27
+ return true;
28
+ }
29
+
18
30
  constructor(message: string, cause: unknown, rawValue: unknown) {
19
31
  super(`${message}: ${cause}`);
20
32
  this.name = "SDKValidationError";
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { CeStorefrontError } from "./cestorefronterror.js";
6
7
 
7
8
  /**
8
9
  * Not authorized for given operation on the Resource
@@ -16,18 +17,20 @@ export type UnauthorizedData = {
16
17
  /**
17
18
  * Not authorized for given operation on the Resource
18
19
  */
19
- export class Unauthorized extends Error {
20
+ export class Unauthorized extends CeStorefrontError {
20
21
  success?: boolean;
21
22
  code: string;
22
23
 
23
24
  /** The original data that was passed to this error instance. */
24
25
  data$: UnauthorizedData;
25
26
 
26
- constructor(err: UnauthorizedData) {
27
+ constructor(
28
+ err: UnauthorizedData,
29
+ httpMeta: { response: Response; request: Request; body: string },
30
+ ) {
27
31
  const message = err.message || "API error occurred";
28
- super(message);
32
+ super(message, httpMeta);
29
33
  this.data$ = err;
30
-
31
34
  if (err.success != null) this.success = err.success;
32
35
  this.code = err.code;
33
36
 
@@ -44,9 +47,16 @@ export const Unauthorized$inboundSchema: z.ZodType<
44
47
  message: z.string(),
45
48
  success: z.boolean().default(false),
46
49
  code: z.string(),
50
+ request$: z.instanceof(Request),
51
+ response$: z.instanceof(Response),
52
+ body$: z.string(),
47
53
  })
48
54
  .transform((v) => {
49
- return new Unauthorized(v);
55
+ return new Unauthorized(v, {
56
+ request: v.request$,
57
+ response: v.response$,
58
+ body: v.body$,
59
+ });
50
60
  });
51
61
 
52
62
  /** @internal */
@@ -11,9 +11,9 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
12
  export type GetProductDetailRequest = {
13
13
  /**
14
- * id of a particular product
14
+ * The unique identifier of the product. Can be either the product ID or the slug.
15
15
  */
16
- productId?: string | undefined;
16
+ productIdOrSlug: string;
17
17
  /**
18
18
  * The customer_group_id is used to determine product pricing, promotions, and subscription rates. If a valid customer_group_id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer_group_id, the system will fall back to the default customer_group_id. If no data is found for the default group either, the highest applicable price will be returned.
19
19
  */
@@ -39,18 +39,18 @@ export const GetProductDetailRequest$inboundSchema: z.ZodType<
39
39
  z.ZodTypeDef,
40
40
  unknown
41
41
  > = z.object({
42
- product_id: z.string().default("1"),
42
+ product_id_or_slug: z.string(),
43
43
  customer_group_id: z.string().optional(),
44
44
  }).transform((v) => {
45
45
  return remap$(v, {
46
- "product_id": "productId",
46
+ "product_id_or_slug": "productIdOrSlug",
47
47
  "customer_group_id": "customerGroupId",
48
48
  });
49
49
  });
50
50
 
51
51
  /** @internal */
52
52
  export type GetProductDetailRequest$Outbound = {
53
- product_id: string;
53
+ product_id_or_slug: string;
54
54
  customer_group_id?: string | undefined;
55
55
  };
56
56
 
@@ -60,11 +60,11 @@ export const GetProductDetailRequest$outboundSchema: z.ZodType<
60
60
  z.ZodTypeDef,
61
61
  GetProductDetailRequest
62
62
  > = z.object({
63
- productId: z.string().default("1"),
63
+ productIdOrSlug: z.string(),
64
64
  customerGroupId: z.string().optional(),
65
65
  }).transform((v) => {
66
66
  return remap$(v, {
67
- productId: "product_id",
67
+ productIdOrSlug: "product_id_or_slug",
68
68
  customerGroupId: "customer_group_id",
69
69
  });
70
70
  });
@@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
12
  export type ListCategoriesRequest = {
13
13
  /**
14
- * To return child categories
14
+ * To return child categories using category id.
15
15
  */
16
16
  parentCategoryId?: string | undefined;
17
17
  /**
@@ -26,6 +26,10 @@ export type ListCategoriesRequest = {
26
26
  * JSON string format: {"field1":"asc", "field2":"desc"}
27
27
  */
28
28
  sortBy?: string | undefined;
29
+ /**
30
+ * To return child categories using category slug
31
+ */
32
+ parentCategorySlug?: string | undefined;
29
33
  };
30
34
 
31
35
  export type ListCategoriesContent = {
@@ -55,11 +59,13 @@ export const ListCategoriesRequest$inboundSchema: z.ZodType<
55
59
  nested_level: z.number().int().default(0),
56
60
  search: z.string().optional(),
57
61
  sort_by: z.string().optional(),
62
+ parent_category_slug: z.string().optional(),
58
63
  }).transform((v) => {
59
64
  return remap$(v, {
60
65
  "parent_category_id": "parentCategoryId",
61
66
  "nested_level": "nestedLevel",
62
67
  "sort_by": "sortBy",
68
+ "parent_category_slug": "parentCategorySlug",
63
69
  });
64
70
  });
65
71
 
@@ -69,6 +75,7 @@ export type ListCategoriesRequest$Outbound = {
69
75
  nested_level: number;
70
76
  search?: string | undefined;
71
77
  sort_by?: string | undefined;
78
+ parent_category_slug?: string | undefined;
72
79
  };
73
80
 
74
81
  /** @internal */
@@ -81,11 +88,13 @@ export const ListCategoriesRequest$outboundSchema: z.ZodType<
81
88
  nestedLevel: z.number().int().default(0),
82
89
  search: z.string().optional(),
83
90
  sortBy: z.string().optional(),
91
+ parentCategorySlug: z.string().optional(),
84
92
  }).transform((v) => {
85
93
  return remap$(v, {
86
94
  parentCategoryId: "parent_category_id",
87
95
  nestedLevel: "nested_level",
88
96
  sortBy: "sort_by",
97
+ parentCategorySlug: "parent_category_slug",
89
98
  });
90
99
  });
91
100
 
@@ -23,13 +23,17 @@ export type ListProductsRequest = {
23
23
  */
24
24
  sortBy?: string | undefined;
25
25
  /**
26
- * filter products by categories
26
+ * filter products by categories ids
27
27
  */
28
28
  categoryId?: Array<string> | undefined;
29
29
  /**
30
30
  * The customer_group_id is used to determine product pricing, promotions, and subscription rates. If a valid customer_group_id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer_group_id, the system will fall back to the default customer_group_id. If no data is found for the default group either, the highest applicable price will be returned.
31
31
  */
32
32
  customerGroupId?: string | undefined;
33
+ /**
34
+ * filter products by categories slugs
35
+ */
36
+ categorySlug?: Array<string> | undefined;
33
37
  };
34
38
 
35
39
  export type Content = {
@@ -60,11 +64,13 @@ export const ListProductsRequest$inboundSchema: z.ZodType<
60
64
  sort_by: z.string().optional(),
61
65
  category_id: z.array(z.string()).optional(),
62
66
  customer_group_id: z.string().optional(),
67
+ category_slug: z.array(z.string()).optional(),
63
68
  }).transform((v) => {
64
69
  return remap$(v, {
65
70
  "sort_by": "sortBy",
66
71
  "category_id": "categoryId",
67
72
  "customer_group_id": "customerGroupId",
73
+ "category_slug": "categorySlug",
68
74
  });
69
75
  });
70
76
 
@@ -75,6 +81,7 @@ export type ListProductsRequest$Outbound = {
75
81
  sort_by?: string | undefined;
76
82
  category_id?: Array<string> | undefined;
77
83
  customer_group_id?: string | undefined;
84
+ category_slug?: Array<string> | undefined;
78
85
  };
79
86
 
80
87
  /** @internal */
@@ -88,11 +95,13 @@ export const ListProductsRequest$outboundSchema: z.ZodType<
88
95
  sortBy: z.string().optional(),
89
96
  categoryId: z.array(z.string()).optional(),
90
97
  customerGroupId: z.string().optional(),
98
+ categorySlug: z.array(z.string()).optional(),
91
99
  }).transform((v) => {
92
100
  return remap$(v, {
93
101
  sortBy: "sort_by",
94
102
  categoryId: "category_id",
95
103
  customerGroupId: "customer_group_id",
104
+ categorySlug: "category_slug",
96
105
  });
97
106
  });
98
107
 
@@ -57,7 +57,7 @@ export class Catalog extends ClientSDK {
57
57
  * Retrieve a product detail
58
58
  *
59
59
  * @remarks
60
- * Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Commerce Engine will return the corresponding product information.
60
+ * 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.
61
61
  */
62
62
  async getProductDetail(
63
63
  request: operations.GetProductDetailRequest,