ce-storefront 0.12.5 → 0.13.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 (305) hide show
  1. package/docs/sdks/auth/README.md +20 -13
  2. package/docs/sdks/carts/README.md +8 -3
  3. package/docs/sdks/catalog/README.md +6 -3
  4. package/docs/sdks/common/README.md +6 -3
  5. package/docs/sdks/customers/README.md +12 -6
  6. package/docs/sdks/orders/README.md +6 -3
  7. package/docs/sdks/shipping/README.md +15 -6
  8. package/esm/funcs/authGenerateOtp.d.ts +2 -1
  9. package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
  10. package/esm/funcs/authGenerateOtp.js +8 -2
  11. package/esm/funcs/authGenerateOtp.js.map +1 -1
  12. package/esm/funcs/authGetAnonymousToken.js +2 -0
  13. package/esm/funcs/authGetAnonymousToken.js.map +1 -1
  14. package/esm/funcs/authGetUserDetail.js +2 -0
  15. package/esm/funcs/authGetUserDetail.js.map +1 -1
  16. package/esm/funcs/authLoginWithEmail.js +2 -0
  17. package/esm/funcs/authLoginWithEmail.js.map +1 -1
  18. package/esm/funcs/authLoginWithPhone.js +2 -0
  19. package/esm/funcs/authLoginWithPhone.js.map +1 -1
  20. package/esm/funcs/authLoginWithWhatsapp.d.ts +2 -1
  21. package/esm/funcs/authLoginWithWhatsapp.d.ts.map +1 -1
  22. package/esm/funcs/authLoginWithWhatsapp.js +8 -2
  23. package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
  24. package/esm/funcs/authLogout.d.ts +2 -1
  25. package/esm/funcs/authLogout.d.ts.map +1 -1
  26. package/esm/funcs/authLogout.js +8 -2
  27. package/esm/funcs/authLogout.js.map +1 -1
  28. package/esm/funcs/authRefreshToken.js +2 -0
  29. package/esm/funcs/authRefreshToken.js.map +1 -1
  30. package/esm/funcs/authUpdateUser.js +2 -0
  31. package/esm/funcs/authUpdateUser.js.map +1 -1
  32. package/esm/funcs/authVerifyOtp.js +2 -0
  33. package/esm/funcs/authVerifyOtp.js.map +1 -1
  34. package/esm/funcs/cartsAddShippingMethod.js +2 -0
  35. package/esm/funcs/cartsAddShippingMethod.js.map +1 -1
  36. package/esm/funcs/cartsApplyCoupon.js +2 -0
  37. package/esm/funcs/cartsApplyCoupon.js.map +1 -1
  38. package/esm/funcs/cartsCreateCart.d.ts +2 -1
  39. package/esm/funcs/cartsCreateCart.d.ts.map +1 -1
  40. package/esm/funcs/cartsCreateCart.js +8 -2
  41. package/esm/funcs/cartsCreateCart.js.map +1 -1
  42. package/esm/funcs/cartsCreateCartAddress.js +2 -0
  43. package/esm/funcs/cartsCreateCartAddress.js.map +1 -1
  44. package/esm/funcs/cartsDeleteCart.js +2 -0
  45. package/esm/funcs/cartsDeleteCart.js.map +1 -1
  46. package/esm/funcs/cartsGetCart.js +2 -0
  47. package/esm/funcs/cartsGetCart.js.map +1 -1
  48. package/esm/funcs/cartsGetUserCart.js +2 -0
  49. package/esm/funcs/cartsGetUserCart.js.map +1 -1
  50. package/esm/funcs/cartsRedeemLoyaltyPoints.js +2 -0
  51. package/esm/funcs/cartsRedeemLoyaltyPoints.js.map +1 -1
  52. package/esm/funcs/cartsRemoveCoupon.js +2 -0
  53. package/esm/funcs/cartsRemoveCoupon.js.map +1 -1
  54. package/esm/funcs/cartsRemoveLoyaltyPoints.js +2 -0
  55. package/esm/funcs/cartsRemoveLoyaltyPoints.js.map +1 -1
  56. package/esm/funcs/cartsRemoveUserCart.js +2 -0
  57. package/esm/funcs/cartsRemoveUserCart.js.map +1 -1
  58. package/esm/funcs/cartsUpdateCart.js +2 -0
  59. package/esm/funcs/cartsUpdateCart.js.map +1 -1
  60. package/esm/funcs/catalogGetProductDetail.js +2 -0
  61. package/esm/funcs/catalogGetProductDetail.js.map +1 -1
  62. package/esm/funcs/catalogGetVariantDetail.js +2 -0
  63. package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
  64. package/esm/funcs/catalogListCategories.d.ts +2 -1
  65. package/esm/funcs/catalogListCategories.d.ts.map +1 -1
  66. package/esm/funcs/catalogListCategories.js +8 -2
  67. package/esm/funcs/catalogListCategories.js.map +1 -1
  68. package/esm/funcs/catalogListCrosssellProducts.js +2 -0
  69. package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
  70. package/esm/funcs/catalogListProductReviews.js +2 -0
  71. package/esm/funcs/catalogListProductReviews.js.map +1 -1
  72. package/esm/funcs/catalogListProductVariants.js +2 -0
  73. package/esm/funcs/catalogListProductVariants.js.map +1 -1
  74. package/esm/funcs/catalogListProducts.js +2 -0
  75. package/esm/funcs/catalogListProducts.js.map +1 -1
  76. package/esm/funcs/catalogListSimilarProducts.js +2 -0
  77. package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
  78. package/esm/funcs/catalogListSkus.js +2 -0
  79. package/esm/funcs/catalogListSkus.js.map +1 -1
  80. package/esm/funcs/catalogListUpsellProducts.js +2 -0
  81. package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
  82. package/esm/funcs/catalogSearchProducts.js +2 -0
  83. package/esm/funcs/catalogSearchProducts.js.map +1 -1
  84. package/esm/funcs/commonListCountryPincodes.d.ts +2 -1
  85. package/esm/funcs/commonListCountryPincodes.d.ts.map +1 -1
  86. package/esm/funcs/commonListCountryPincodes.js +8 -2
  87. package/esm/funcs/commonListCountryPincodes.js.map +1 -1
  88. package/esm/funcs/customersCreateAddress.js +2 -0
  89. package/esm/funcs/customersCreateAddress.js.map +1 -1
  90. package/esm/funcs/customersDeleteAddress.js +2 -0
  91. package/esm/funcs/customersDeleteAddress.js.map +1 -1
  92. package/esm/funcs/customersGetAddressDetail.js +2 -0
  93. package/esm/funcs/customersGetAddressDetail.js.map +1 -1
  94. package/esm/funcs/customersGetLoyaltyDetails.js +2 -0
  95. package/esm/funcs/customersGetLoyaltyDetails.js.map +1 -1
  96. package/esm/funcs/customersListAddresses.d.ts +2 -1
  97. package/esm/funcs/customersListAddresses.d.ts.map +1 -1
  98. package/esm/funcs/customersListAddresses.js +8 -2
  99. package/esm/funcs/customersListAddresses.js.map +1 -1
  100. package/esm/funcs/customersListUserReviews.d.ts +2 -1
  101. package/esm/funcs/customersListUserReviews.d.ts.map +1 -1
  102. package/esm/funcs/customersListUserReviews.js +8 -2
  103. package/esm/funcs/customersListUserReviews.js.map +1 -1
  104. package/esm/funcs/customersUpdateAddressDetail.js +2 -0
  105. package/esm/funcs/customersUpdateAddressDetail.js.map +1 -1
  106. package/esm/funcs/ordersCancelOrder.js +2 -0
  107. package/esm/funcs/ordersCancelOrder.js.map +1 -1
  108. package/esm/funcs/ordersCreateOrder.js +2 -0
  109. package/esm/funcs/ordersCreateOrder.js.map +1 -1
  110. package/esm/funcs/ordersGetOrderDetail.js +2 -0
  111. package/esm/funcs/ordersGetOrderDetail.js.map +1 -1
  112. package/esm/funcs/ordersGetPaymentStatus.d.ts +2 -1
  113. package/esm/funcs/ordersGetPaymentStatus.d.ts.map +1 -1
  114. package/esm/funcs/ordersGetPaymentStatus.js +8 -2
  115. package/esm/funcs/ordersGetPaymentStatus.js.map +1 -1
  116. package/esm/funcs/ordersListOrderShipments.js +2 -0
  117. package/esm/funcs/ordersListOrderShipments.js.map +1 -1
  118. package/esm/funcs/ordersListOrders.js +2 -0
  119. package/esm/funcs/ordersListOrders.js.map +1 -1
  120. package/esm/funcs/ordersRetryOrderPayment.js +2 -0
  121. package/esm/funcs/ordersRetryOrderPayment.js.map +1 -1
  122. package/esm/funcs/shippingShippingMethods.d.ts +3 -1
  123. package/esm/funcs/shippingShippingMethods.d.ts.map +1 -1
  124. package/esm/funcs/shippingShippingMethods.js +11 -6
  125. package/esm/funcs/shippingShippingMethods.js.map +1 -1
  126. package/esm/hooks/types.d.ts +2 -0
  127. package/esm/hooks/types.d.ts.map +1 -1
  128. package/esm/lib/config.d.ts +7 -3
  129. package/esm/lib/config.d.ts.map +1 -1
  130. package/esm/lib/config.js +3 -3
  131. package/esm/lib/config.js.map +1 -1
  132. package/esm/lib/sdks.d.ts +1 -0
  133. package/esm/lib/sdks.d.ts.map +1 -1
  134. package/esm/lib/sdks.js +3 -3
  135. package/esm/lib/sdks.js.map +1 -1
  136. package/esm/models/components/appliedcoupon.d.ts +85 -0
  137. package/esm/models/components/appliedcoupon.d.ts.map +1 -0
  138. package/esm/models/components/appliedcoupon.js +87 -0
  139. package/esm/models/components/appliedcoupon.js.map +1 -0
  140. package/esm/models/components/appliedpromotion.d.ts +83 -0
  141. package/esm/models/components/appliedpromotion.d.ts.map +1 -0
  142. package/esm/models/components/appliedpromotion.js +90 -0
  143. package/esm/models/components/appliedpromotion.js.map +1 -0
  144. package/esm/models/components/cart.d.ts +6 -153
  145. package/esm/models/components/cart.d.ts.map +1 -1
  146. package/esm/models/components/cart.js +6 -161
  147. package/esm/models/components/cart.js.map +1 -1
  148. package/esm/models/components/discountbasedpromotion.d.ts +31 -0
  149. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  150. package/esm/models/components/discountbasedpromotion.js +21 -0
  151. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  152. package/esm/models/components/fixedpricepromotion.d.ts +34 -2
  153. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  154. package/esm/models/components/fixedpricepromotion.js +23 -2
  155. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  156. package/esm/models/components/freegoodspromotion.d.ts +32 -0
  157. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  158. package/esm/models/components/freegoodspromotion.js +21 -0
  159. package/esm/models/components/freegoodspromotion.js.map +1 -1
  160. package/esm/models/components/generateotpwithemail.d.ts +65 -0
  161. package/esm/models/components/generateotpwithemail.d.ts.map +1 -0
  162. package/esm/models/components/generateotpwithemail.js +65 -0
  163. package/esm/models/components/generateotpwithemail.js.map +1 -0
  164. package/esm/models/components/generateotpwithphone.d.ts +98 -0
  165. package/esm/models/components/generateotpwithphone.d.ts.map +1 -0
  166. package/esm/models/components/generateotpwithphone.js +90 -0
  167. package/esm/models/components/generateotpwithphone.js.map +1 -0
  168. package/esm/models/components/index.d.ts +4 -0
  169. package/esm/models/components/index.d.ts.map +1 -1
  170. package/esm/models/components/index.js +4 -0
  171. package/esm/models/components/index.js.map +1 -1
  172. package/esm/models/components/item.d.ts +8 -0
  173. package/esm/models/components/item.d.ts.map +1 -1
  174. package/esm/models/components/item.js +5 -0
  175. package/esm/models/components/item.js.map +1 -1
  176. package/esm/models/components/order.d.ts +6 -181
  177. package/esm/models/components/order.d.ts.map +1 -1
  178. package/esm/models/components/order.js +6 -185
  179. package/esm/models/components/order.js.map +1 -1
  180. package/esm/models/components/orderdetail.d.ts +6 -181
  181. package/esm/models/components/orderdetail.d.ts.map +1 -1
  182. package/esm/models/components/orderdetail.js +6 -185
  183. package/esm/models/components/orderdetail.js.map +1 -1
  184. package/esm/models/components/product.d.ts +5 -0
  185. package/esm/models/components/product.d.ts.map +1 -1
  186. package/esm/models/components/product.js +2 -0
  187. package/esm/models/components/product.js.map +1 -1
  188. package/esm/models/components/productbundleitem.d.ts +8 -0
  189. package/esm/models/components/productbundleitem.d.ts.map +1 -1
  190. package/esm/models/components/productbundleitem.js +5 -0
  191. package/esm/models/components/productbundleitem.js.map +1 -1
  192. package/esm/models/components/productdetail.d.ts +5 -0
  193. package/esm/models/components/productdetail.d.ts.map +1 -1
  194. package/esm/models/components/productdetail.js +2 -0
  195. package/esm/models/components/productdetail.js.map +1 -1
  196. package/esm/models/components/productpromotion.d.ts +2 -14
  197. package/esm/models/components/productpromotion.d.ts.map +1 -1
  198. package/esm/models/components/productshipping.d.ts +8 -16
  199. package/esm/models/components/productshipping.d.ts.map +1 -1
  200. package/esm/models/components/productshipping.js +12 -28
  201. package/esm/models/components/productshipping.js.map +1 -1
  202. package/esm/models/components/variant.d.ts +5 -0
  203. package/esm/models/components/variant.d.ts.map +1 -1
  204. package/esm/models/components/variant.js +2 -0
  205. package/esm/models/components/variant.js.map +1 -1
  206. package/esm/models/components/variantdetail.d.ts +5 -0
  207. package/esm/models/components/variantdetail.d.ts.map +1 -1
  208. package/esm/models/components/variantdetail.js +2 -0
  209. package/esm/models/components/variantdetail.js.map +1 -1
  210. package/esm/models/components/volumebasedpromotion.d.ts +34 -2
  211. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  212. package/esm/models/components/volumebasedpromotion.js +23 -2
  213. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  214. package/esm/models/operations/generateotp.d.ts +3 -104
  215. package/esm/models/operations/generateotp.d.ts.map +1 -1
  216. package/esm/models/operations/generateotp.js +9 -72
  217. package/esm/models/operations/generateotp.js.map +1 -1
  218. package/esm/models/operations/getshippingmethods.d.ts +0 -21
  219. package/esm/models/operations/getshippingmethods.d.ts.map +1 -1
  220. package/esm/models/operations/getshippingmethods.js +0 -21
  221. package/esm/models/operations/getshippingmethods.js.map +1 -1
  222. package/esm/models/operations/updateshippingmethod.d.ts +9 -33
  223. package/esm/models/operations/updateshippingmethod.d.ts.map +1 -1
  224. package/esm/models/operations/updateshippingmethod.js +6 -27
  225. package/esm/models/operations/updateshippingmethod.js.map +1 -1
  226. package/esm/sdk/shipping.d.ts +2 -1
  227. package/esm/sdk/shipping.d.ts.map +1 -1
  228. package/esm/sdk/shipping.js.map +1 -1
  229. package/jsr.json +1 -1
  230. package/package.json +1 -1
  231. package/src/funcs/authGenerateOtp.ts +17 -2
  232. package/src/funcs/authGetAnonymousToken.ts +2 -0
  233. package/src/funcs/authGetUserDetail.ts +2 -0
  234. package/src/funcs/authLoginWithEmail.ts +2 -0
  235. package/src/funcs/authLoginWithPhone.ts +2 -0
  236. package/src/funcs/authLoginWithWhatsapp.ts +17 -2
  237. package/src/funcs/authLogout.ts +21 -2
  238. package/src/funcs/authRefreshToken.ts +2 -0
  239. package/src/funcs/authUpdateUser.ts +2 -0
  240. package/src/funcs/authVerifyOtp.ts +2 -0
  241. package/src/funcs/cartsAddShippingMethod.ts +2 -0
  242. package/src/funcs/cartsApplyCoupon.ts +2 -0
  243. package/src/funcs/cartsCreateCart.ts +21 -2
  244. package/src/funcs/cartsCreateCartAddress.ts +2 -0
  245. package/src/funcs/cartsDeleteCart.ts +2 -0
  246. package/src/funcs/cartsGetCart.ts +2 -0
  247. package/src/funcs/cartsGetUserCart.ts +2 -0
  248. package/src/funcs/cartsRedeemLoyaltyPoints.ts +2 -0
  249. package/src/funcs/cartsRemoveCoupon.ts +2 -0
  250. package/src/funcs/cartsRemoveLoyaltyPoints.ts +2 -0
  251. package/src/funcs/cartsRemoveUserCart.ts +2 -0
  252. package/src/funcs/cartsUpdateCart.ts +2 -0
  253. package/src/funcs/catalogGetProductDetail.ts +2 -0
  254. package/src/funcs/catalogGetVariantDetail.ts +2 -0
  255. package/src/funcs/catalogListCategories.ts +21 -2
  256. package/src/funcs/catalogListCrosssellProducts.ts +2 -0
  257. package/src/funcs/catalogListProductReviews.ts +2 -0
  258. package/src/funcs/catalogListProductVariants.ts +2 -0
  259. package/src/funcs/catalogListProducts.ts +2 -0
  260. package/src/funcs/catalogListSimilarProducts.ts +2 -0
  261. package/src/funcs/catalogListSkus.ts +2 -0
  262. package/src/funcs/catalogListUpsellProducts.ts +2 -0
  263. package/src/funcs/catalogSearchProducts.ts +2 -0
  264. package/src/funcs/commonListCountryPincodes.ts +21 -2
  265. package/src/funcs/customersCreateAddress.ts +2 -0
  266. package/src/funcs/customersDeleteAddress.ts +2 -0
  267. package/src/funcs/customersGetAddressDetail.ts +2 -0
  268. package/src/funcs/customersGetLoyaltyDetails.ts +2 -0
  269. package/src/funcs/customersListAddresses.ts +21 -2
  270. package/src/funcs/customersListUserReviews.ts +21 -2
  271. package/src/funcs/customersUpdateAddressDetail.ts +2 -0
  272. package/src/funcs/ordersCancelOrder.ts +2 -0
  273. package/src/funcs/ordersCreateOrder.ts +2 -0
  274. package/src/funcs/ordersGetOrderDetail.ts +2 -0
  275. package/src/funcs/ordersGetPaymentStatus.ts +21 -2
  276. package/src/funcs/ordersListOrderShipments.ts +2 -0
  277. package/src/funcs/ordersListOrders.ts +2 -0
  278. package/src/funcs/ordersRetryOrderPayment.ts +2 -0
  279. package/src/funcs/shippingShippingMethods.ts +26 -10
  280. package/src/hooks/types.ts +2 -0
  281. package/src/lib/config.ts +7 -3
  282. package/src/lib/sdks.ts +10 -4
  283. package/src/models/components/appliedcoupon.ts +139 -0
  284. package/src/models/components/appliedpromotion.ts +155 -0
  285. package/src/models/components/cart.ts +20 -265
  286. package/src/models/components/discountbasedpromotion.ts +30 -1
  287. package/src/models/components/fixedpricepromotion.ts +36 -4
  288. package/src/models/components/freegoodspromotion.ts +33 -1
  289. package/src/models/components/generateotpwithemail.ts +115 -0
  290. package/src/models/components/generateotpwithphone.ts +148 -0
  291. package/src/models/components/index.ts +4 -0
  292. package/src/models/components/item.ts +17 -0
  293. package/src/models/components/order.ts +20 -310
  294. package/src/models/components/orderdetail.ts +20 -319
  295. package/src/models/components/product.ts +7 -0
  296. package/src/models/components/productbundleitem.ts +17 -0
  297. package/src/models/components/productdetail.ts +7 -0
  298. package/src/models/components/productshipping.ts +20 -44
  299. package/src/models/components/variant.ts +7 -0
  300. package/src/models/components/variantdetail.ts +7 -0
  301. package/src/models/components/volumebasedpromotion.ts +37 -4
  302. package/src/models/operations/generateotp.ts +15 -118
  303. package/src/models/operations/getshippingmethods.ts +0 -54
  304. package/src/models/operations/updateshippingmethod.ts +15 -69
  305. package/src/sdk/shipping.ts +2 -1
@@ -18,6 +18,7 @@ import {
18
18
  RequestTimeoutError,
19
19
  UnexpectedClientError,
20
20
  } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
21
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
23
  import * as operations from "../models/operations/index.js";
23
24
  import { APICall, APIPromise } from "../types/async.js";
@@ -36,6 +37,9 @@ export function cartsCreateCart(
36
37
  ): APIPromise<
37
38
  Result<
38
39
  operations.CreateCartResponseBody,
40
+ | errors.BadRequest
41
+ | errors.Unauthorized
42
+ | errors.NotFound
39
43
  | CeError
40
44
  | SDKValidationError
41
45
  | UnexpectedClientError
@@ -60,6 +64,9 @@ async function $do(
60
64
  [
61
65
  Result<
62
66
  operations.CreateCartResponseBody,
67
+ | errors.BadRequest
68
+ | errors.Unauthorized
69
+ | errors.NotFound
63
70
  | CeError
64
71
  | SDKValidationError
65
72
  | UnexpectedClientError
@@ -94,6 +101,7 @@ async function $do(
94
101
  const requestSecurity = resolveGlobalSecurity(securityInput);
95
102
 
96
103
  const context = {
104
+ options: client._options,
97
105
  baseURL: options?.serverURL ?? client._baseURL ?? "",
98
106
  operationID: "create-cart",
99
107
  oAuth2Scopes: [],
@@ -114,6 +122,7 @@ async function $do(
114
122
  path: path,
115
123
  headers: headers,
116
124
  body: body,
125
+ userAgent: client._options.userAgent,
117
126
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
118
127
  }, options);
119
128
  if (!requestRes.ok) {
@@ -123,7 +132,7 @@ async function $do(
123
132
 
124
133
  const doResult = await client._do(req, {
125
134
  context,
126
- errorCodes: ["4XX", "5XX"],
135
+ errorCodes: ["400", "401", "404", "4XX", "5XX"],
127
136
  retryConfig: context.retryConfig,
128
137
  retryCodes: context.retryCodes,
129
138
  });
@@ -132,8 +141,15 @@ async function $do(
132
141
  }
133
142
  const response = doResult.value;
134
143
 
144
+ const responseFields = {
145
+ HttpMeta: { Response: response, Request: req },
146
+ };
147
+
135
148
  const [result] = await M.match<
136
149
  operations.CreateCartResponseBody,
150
+ | errors.BadRequest
151
+ | errors.Unauthorized
152
+ | errors.NotFound
137
153
  | CeError
138
154
  | SDKValidationError
139
155
  | UnexpectedClientError
@@ -143,9 +159,12 @@ async function $do(
143
159
  | ConnectionError
144
160
  >(
145
161
  M.json(200, operations.CreateCartResponseBody$inboundSchema),
162
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
163
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
164
+ M.jsonErr(404, errors.NotFound$inboundSchema),
146
165
  M.fail("4XX"),
147
166
  M.fail("5XX"),
148
- )(response);
167
+ )(response, { extraFields: responseFields });
149
168
  if (!result.ok) {
150
169
  return [result, { status: "complete", request: req, response }];
151
170
  }
@@ -108,6 +108,7 @@ async function $do(
108
108
  const requestSecurity = resolveGlobalSecurity(securityInput);
109
109
 
110
110
  const context = {
111
+ options: client._options,
111
112
  baseURL: options?.serverURL ?? client._baseURL ?? "",
112
113
  operationID: "create-cart-address",
113
114
  oAuth2Scopes: [],
@@ -128,6 +129,7 @@ async function $do(
128
129
  path: path,
129
130
  headers: headers,
130
131
  body: body,
132
+ userAgent: client._options.userAgent,
131
133
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
132
134
  }, options);
133
135
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "delete-cart",
110
111
  oAuth2Scopes: [],
@@ -125,6 +126,7 @@ async function $do(
125
126
  path: path,
126
127
  headers: headers,
127
128
  body: body,
129
+ userAgent: client._options.userAgent,
128
130
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
131
  }, options);
130
132
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "get-cart",
110
111
  oAuth2Scopes: [],
@@ -125,6 +126,7 @@ async function $do(
125
126
  path: path,
126
127
  headers: headers,
127
128
  body: body,
129
+ userAgent: client._options.userAgent,
128
130
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
131
  }, options);
130
132
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "get-user-cart",
110
111
  oAuth2Scopes: [],
@@ -125,6 +126,7 @@ async function $do(
125
126
  path: path,
126
127
  headers: headers,
127
128
  body: body,
129
+ userAgent: client._options.userAgent,
128
130
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
131
  }, options);
130
132
  if (!requestRes.ok) {
@@ -107,6 +107,7 @@ async function $do(
107
107
  const requestSecurity = resolveGlobalSecurity(securityInput);
108
108
 
109
109
  const context = {
110
+ options: client._options,
110
111
  baseURL: options?.serverURL ?? client._baseURL ?? "",
111
112
  operationID: "redeem-loyalty-points",
112
113
  oAuth2Scopes: [],
@@ -127,6 +128,7 @@ async function $do(
127
128
  path: path,
128
129
  headers: headers,
129
130
  body: body,
131
+ userAgent: client._options.userAgent,
130
132
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
131
133
  }, options);
132
134
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "remove-coupon",
110
111
  oAuth2Scopes: [],
@@ -125,6 +126,7 @@ async function $do(
125
126
  path: path,
126
127
  headers: headers,
127
128
  body: body,
129
+ userAgent: client._options.userAgent,
128
130
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
131
  }, options);
130
132
  if (!requestRes.ok) {
@@ -106,6 +106,7 @@ async function $do(
106
106
  const requestSecurity = resolveGlobalSecurity(securityInput);
107
107
 
108
108
  const context = {
109
+ options: client._options,
109
110
  baseURL: options?.serverURL ?? client._baseURL ?? "",
110
111
  operationID: "remove-loyalty-points",
111
112
  oAuth2Scopes: [],
@@ -126,6 +127,7 @@ async function $do(
126
127
  path: path,
127
128
  headers: headers,
128
129
  body: body,
130
+ userAgent: client._options.userAgent,
129
131
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
130
132
  }, options);
131
133
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "delete-user-cart",
110
111
  oAuth2Scopes: [],
@@ -125,6 +126,7 @@ async function $do(
125
126
  path: path,
126
127
  headers: headers,
127
128
  body: body,
129
+ userAgent: client._options.userAgent,
128
130
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
131
  }, options);
130
132
  if (!requestRes.ok) {
@@ -108,6 +108,7 @@ async function $do(
108
108
  const requestSecurity = resolveGlobalSecurity(securityInput);
109
109
 
110
110
  const context = {
111
+ options: client._options,
111
112
  baseURL: options?.serverURL ?? client._baseURL ?? "",
112
113
  operationID: "update-cart",
113
114
  oAuth2Scopes: [],
@@ -128,6 +129,7 @@ async function $do(
128
129
  path: path,
129
130
  headers: headers,
130
131
  body: body,
132
+ userAgent: client._options.userAgent,
131
133
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
132
134
  }, options);
133
135
  if (!requestRes.ok) {
@@ -109,6 +109,7 @@ async function $do(
109
109
  const requestSecurity = resolveGlobalSecurity(securityInput);
110
110
 
111
111
  const context = {
112
+ options: client._options,
112
113
  baseURL: options?.serverURL ?? client._baseURL ?? "",
113
114
  operationID: "get-product-detail",
114
115
  oAuth2Scopes: [],
@@ -130,6 +131,7 @@ async function $do(
130
131
  headers: headers,
131
132
  query: query,
132
133
  body: body,
134
+ userAgent: client._options.userAgent,
133
135
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
134
136
  }, options);
135
137
  if (!requestRes.ok) {
@@ -115,6 +115,7 @@ async function $do(
115
115
  const requestSecurity = resolveGlobalSecurity(securityInput);
116
116
 
117
117
  const context = {
118
+ options: client._options,
118
119
  baseURL: options?.serverURL ?? client._baseURL ?? "",
119
120
  operationID: "get-variant-detail",
120
121
  oAuth2Scopes: [],
@@ -136,6 +137,7 @@ async function $do(
136
137
  headers: headers,
137
138
  query: query,
138
139
  body: body,
140
+ userAgent: client._options.userAgent,
139
141
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
142
  }, options);
141
143
  if (!requestRes.ok) {
@@ -18,6 +18,7 @@ import {
18
18
  RequestTimeoutError,
19
19
  UnexpectedClientError,
20
20
  } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
21
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
23
  import * as operations from "../models/operations/index.js";
23
24
  import { APICall, APIPromise } from "../types/async.js";
@@ -36,6 +37,9 @@ export function catalogListCategories(
36
37
  ): APIPromise<
37
38
  Result<
38
39
  operations.ListCategoriesResponseBody,
40
+ | errors.BadRequest
41
+ | errors.Unauthorized
42
+ | errors.NotFound
39
43
  | CeError
40
44
  | SDKValidationError
41
45
  | UnexpectedClientError
@@ -60,6 +64,9 @@ async function $do(
60
64
  [
61
65
  Result<
62
66
  operations.ListCategoriesResponseBody,
67
+ | errors.BadRequest
68
+ | errors.Unauthorized
69
+ | errors.NotFound
63
70
  | CeError
64
71
  | SDKValidationError
65
72
  | UnexpectedClientError
@@ -100,6 +107,7 @@ async function $do(
100
107
  const requestSecurity = resolveGlobalSecurity(securityInput);
101
108
 
102
109
  const context = {
110
+ options: client._options,
103
111
  baseURL: options?.serverURL ?? client._baseURL ?? "",
104
112
  operationID: "list-categories",
105
113
  oAuth2Scopes: [],
@@ -121,6 +129,7 @@ async function $do(
121
129
  headers: headers,
122
130
  query: query,
123
131
  body: body,
132
+ userAgent: client._options.userAgent,
124
133
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
125
134
  }, options);
126
135
  if (!requestRes.ok) {
@@ -130,7 +139,7 @@ async function $do(
130
139
 
131
140
  const doResult = await client._do(req, {
132
141
  context,
133
- errorCodes: ["4XX", "5XX"],
142
+ errorCodes: ["400", "401", "404", "4XX", "5XX"],
134
143
  retryConfig: context.retryConfig,
135
144
  retryCodes: context.retryCodes,
136
145
  });
@@ -139,8 +148,15 @@ async function $do(
139
148
  }
140
149
  const response = doResult.value;
141
150
 
151
+ const responseFields = {
152
+ HttpMeta: { Response: response, Request: req },
153
+ };
154
+
142
155
  const [result] = await M.match<
143
156
  operations.ListCategoriesResponseBody,
157
+ | errors.BadRequest
158
+ | errors.Unauthorized
159
+ | errors.NotFound
144
160
  | CeError
145
161
  | SDKValidationError
146
162
  | UnexpectedClientError
@@ -150,9 +166,12 @@ async function $do(
150
166
  | ConnectionError
151
167
  >(
152
168
  M.json(200, operations.ListCategoriesResponseBody$inboundSchema),
169
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
170
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
171
+ M.jsonErr(404, errors.NotFound$inboundSchema),
153
172
  M.fail("4XX"),
154
173
  M.fail("5XX"),
155
- )(response);
174
+ )(response, { extraFields: responseFields });
156
175
  if (!result.ok) {
157
176
  return [result, { status: "complete", request: req, response }];
158
177
  }
@@ -106,6 +106,7 @@ async function $do(
106
106
  const requestSecurity = resolveGlobalSecurity(securityInput);
107
107
 
108
108
  const context = {
109
+ options: client._options,
109
110
  baseURL: options?.serverURL ?? client._baseURL ?? "",
110
111
  operationID: "list-crosssell-products",
111
112
  oAuth2Scopes: [],
@@ -127,6 +128,7 @@ async function $do(
127
128
  headers: headers,
128
129
  query: query,
129
130
  body: body,
131
+ userAgent: client._options.userAgent,
130
132
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
131
133
  }, options);
132
134
  if (!requestRes.ok) {
@@ -113,6 +113,7 @@ async function $do(
113
113
  const requestSecurity = resolveGlobalSecurity(securityInput);
114
114
 
115
115
  const context = {
116
+ options: client._options,
116
117
  baseURL: options?.serverURL ?? client._baseURL ?? "",
117
118
  operationID: "list-product-reviews",
118
119
  oAuth2Scopes: [],
@@ -134,6 +135,7 @@ async function $do(
134
135
  headers: headers,
135
136
  query: query,
136
137
  body: body,
138
+ userAgent: client._options.userAgent,
137
139
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
140
  }, options);
139
141
  if (!requestRes.ok) {
@@ -112,6 +112,7 @@ async function $do(
112
112
  const requestSecurity = resolveGlobalSecurity(securityInput);
113
113
 
114
114
  const context = {
115
+ options: client._options,
115
116
  baseURL: options?.serverURL ?? client._baseURL ?? "",
116
117
  operationID: "list-product-variants",
117
118
  oAuth2Scopes: [],
@@ -133,6 +134,7 @@ async function $do(
133
134
  headers: headers,
134
135
  query: query,
135
136
  body: body,
137
+ userAgent: client._options.userAgent,
136
138
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
137
139
  }, options);
138
140
  if (!requestRes.ok) {
@@ -106,6 +106,7 @@ async function $do(
106
106
  const requestSecurity = resolveGlobalSecurity(securityInput);
107
107
 
108
108
  const context = {
109
+ options: client._options,
109
110
  baseURL: options?.serverURL ?? client._baseURL ?? "",
110
111
  operationID: "list-products",
111
112
  oAuth2Scopes: [],
@@ -127,6 +128,7 @@ async function $do(
127
128
  headers: headers,
128
129
  query: query,
129
130
  body: body,
131
+ userAgent: client._options.userAgent,
130
132
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
131
133
  }, options);
132
134
  if (!requestRes.ok) {
@@ -106,6 +106,7 @@ async function $do(
106
106
  const requestSecurity = resolveGlobalSecurity(securityInput);
107
107
 
108
108
  const context = {
109
+ options: client._options,
109
110
  baseURL: options?.serverURL ?? client._baseURL ?? "",
110
111
  operationID: "list-similar-products",
111
112
  oAuth2Scopes: [],
@@ -127,6 +128,7 @@ async function $do(
127
128
  headers: headers,
128
129
  query: query,
129
130
  body: body,
131
+ userAgent: client._options.userAgent,
130
132
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
131
133
  }, options);
132
134
  if (!requestRes.ok) {
@@ -107,6 +107,7 @@ async function $do(
107
107
  const requestSecurity = resolveGlobalSecurity(securityInput);
108
108
 
109
109
  const context = {
110
+ options: client._options,
110
111
  baseURL: options?.serverURL ?? client._baseURL ?? "",
111
112
  operationID: "list-skus",
112
113
  oAuth2Scopes: [],
@@ -128,6 +129,7 @@ async function $do(
128
129
  headers: headers,
129
130
  query: query,
130
131
  body: body,
132
+ userAgent: client._options.userAgent,
131
133
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
132
134
  }, options);
133
135
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "list-upsell-products",
110
111
  oAuth2Scopes: [],
@@ -126,6 +127,7 @@ async function $do(
126
127
  headers: headers,
127
128
  query: query,
128
129
  body: body,
130
+ userAgent: client._options.userAgent,
129
131
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
130
132
  }, options);
131
133
  if (!requestRes.ok) {
@@ -98,6 +98,7 @@ async function $do(
98
98
  const requestSecurity = resolveGlobalSecurity(securityInput);
99
99
 
100
100
  const context = {
101
+ options: client._options,
101
102
  baseURL: options?.serverURL ?? client._baseURL ?? "",
102
103
  operationID: "search-products",
103
104
  oAuth2Scopes: [],
@@ -118,6 +119,7 @@ async function $do(
118
119
  path: path,
119
120
  headers: headers,
120
121
  body: body,
122
+ userAgent: client._options.userAgent,
121
123
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
122
124
  }, options);
123
125
  if (!requestRes.ok) {
@@ -18,6 +18,7 @@ import {
18
18
  RequestTimeoutError,
19
19
  UnexpectedClientError,
20
20
  } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
21
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
23
  import * as operations from "../models/operations/index.js";
23
24
  import { APICall, APIPromise } from "../types/async.js";
@@ -36,6 +37,9 @@ export function commonListCountryPincodes(
36
37
  ): APIPromise<
37
38
  Result<
38
39
  operations.ListCountryPincodesResponseBody,
40
+ | errors.BadRequest
41
+ | errors.Unauthorized
42
+ | errors.NotFound
39
43
  | CeError
40
44
  | SDKValidationError
41
45
  | UnexpectedClientError
@@ -60,6 +64,9 @@ async function $do(
60
64
  [
61
65
  Result<
62
66
  operations.ListCountryPincodesResponseBody,
67
+ | errors.BadRequest
68
+ | errors.Unauthorized
69
+ | errors.NotFound
63
70
  | CeError
64
71
  | SDKValidationError
65
72
  | UnexpectedClientError
@@ -110,6 +117,7 @@ async function $do(
110
117
  const requestSecurity = resolveGlobalSecurity(securityInput);
111
118
 
112
119
  const context = {
120
+ options: client._options,
113
121
  baseURL: options?.serverURL ?? client._baseURL ?? "",
114
122
  operationID: "list-country-pincodes",
115
123
  oAuth2Scopes: [],
@@ -131,6 +139,7 @@ async function $do(
131
139
  headers: headers,
132
140
  query: query,
133
141
  body: body,
142
+ userAgent: client._options.userAgent,
134
143
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
135
144
  }, options);
136
145
  if (!requestRes.ok) {
@@ -140,7 +149,7 @@ async function $do(
140
149
 
141
150
  const doResult = await client._do(req, {
142
151
  context,
143
- errorCodes: ["4XX", "5XX"],
152
+ errorCodes: ["400", "401", "404", "4XX", "5XX"],
144
153
  retryConfig: context.retryConfig,
145
154
  retryCodes: context.retryCodes,
146
155
  });
@@ -149,8 +158,15 @@ async function $do(
149
158
  }
150
159
  const response = doResult.value;
151
160
 
161
+ const responseFields = {
162
+ HttpMeta: { Response: response, Request: req },
163
+ };
164
+
152
165
  const [result] = await M.match<
153
166
  operations.ListCountryPincodesResponseBody,
167
+ | errors.BadRequest
168
+ | errors.Unauthorized
169
+ | errors.NotFound
154
170
  | CeError
155
171
  | SDKValidationError
156
172
  | UnexpectedClientError
@@ -160,9 +176,12 @@ async function $do(
160
176
  | ConnectionError
161
177
  >(
162
178
  M.json(200, operations.ListCountryPincodesResponseBody$inboundSchema),
179
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
180
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
181
+ M.jsonErr(404, errors.NotFound$inboundSchema),
163
182
  M.fail("4XX"),
164
183
  M.fail("5XX"),
165
- )(response);
184
+ )(response, { extraFields: responseFields });
166
185
  if (!result.ok) {
167
186
  return [result, { status: "complete", request: req, response }];
168
187
  }
@@ -106,6 +106,7 @@ async function $do(
106
106
  const requestSecurity = resolveGlobalSecurity(securityInput);
107
107
 
108
108
  const context = {
109
+ options: client._options,
109
110
  baseURL: options?.serverURL ?? client._baseURL ?? "",
110
111
  operationID: "create-address",
111
112
  oAuth2Scopes: [],
@@ -126,6 +127,7 @@ async function $do(
126
127
  path: path,
127
128
  headers: headers,
128
129
  body: body,
130
+ userAgent: client._options.userAgent,
129
131
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
130
132
  }, options);
131
133
  if (!requestRes.ok) {
@@ -111,6 +111,7 @@ async function $do(
111
111
  const requestSecurity = resolveGlobalSecurity(securityInput);
112
112
 
113
113
  const context = {
114
+ options: client._options,
114
115
  baseURL: options?.serverURL ?? client._baseURL ?? "",
115
116
  operationID: "delete-address",
116
117
  oAuth2Scopes: [],
@@ -131,6 +132,7 @@ async function $do(
131
132
  path: path,
132
133
  headers: headers,
133
134
  body: body,
135
+ userAgent: client._options.userAgent,
134
136
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
135
137
  }, options);
136
138
  if (!requestRes.ok) {
@@ -111,6 +111,7 @@ async function $do(
111
111
  const requestSecurity = resolveGlobalSecurity(securityInput);
112
112
 
113
113
  const context = {
114
+ options: client._options,
114
115
  baseURL: options?.serverURL ?? client._baseURL ?? "",
115
116
  operationID: "get-address-detail",
116
117
  oAuth2Scopes: [],
@@ -131,6 +132,7 @@ async function $do(
131
132
  path: path,
132
133
  headers: headers,
133
134
  body: body,
135
+ userAgent: client._options.userAgent,
134
136
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
135
137
  }, options);
136
138
  if (!requestRes.ok) {
@@ -105,6 +105,7 @@ async function $do(
105
105
  const requestSecurity = resolveGlobalSecurity(securityInput);
106
106
 
107
107
  const context = {
108
+ options: client._options,
108
109
  baseURL: options?.serverURL ?? client._baseURL ?? "",
109
110
  operationID: "get-loyalty-details",
110
111
  oAuth2Scopes: [],
@@ -125,6 +126,7 @@ async function $do(
125
126
  path: path,
126
127
  headers: headers,
127
128
  body: body,
129
+ userAgent: client._options.userAgent,
128
130
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
131
  }, options);
130
132
  if (!requestRes.ok) {