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
@@ -103,6 +103,10 @@ export type VariantDetail = {
103
103
  shortDescription: string | null;
104
104
  active: boolean;
105
105
  stockAvailable: boolean;
106
+ /**
107
+ * Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
108
+ */
109
+ backorder?: boolean | undefined;
106
110
  /**
107
111
  * Indicates whether this item is associated with any active (product-specific) coupons
108
112
  */
@@ -173,6 +177,7 @@ export const VariantDetail$inboundSchema: z.ZodType<
173
177
  short_description: z.nullable(z.string()),
174
178
  active: z.boolean(),
175
179
  stock_available: z.boolean(),
180
+ backorder: z.boolean().optional(),
176
181
  on_offer: z.boolean(),
177
182
  on_promotion: z.boolean(),
178
183
  on_subscription: z.boolean(),
@@ -229,6 +234,7 @@ export type VariantDetail$Outbound = {
229
234
  short_description: string | null;
230
235
  active: boolean;
231
236
  stock_available: boolean;
237
+ backorder?: boolean | undefined;
232
238
  on_offer: boolean;
233
239
  on_promotion: boolean;
234
240
  on_subscription: boolean;
@@ -269,6 +275,7 @@ export const VariantDetail$outboundSchema: z.ZodType<
269
275
  shortDescription: z.nullable(z.string()),
270
276
  active: z.boolean(),
271
277
  stockAvailable: z.boolean(),
278
+ backorder: z.boolean().optional(),
272
279
  onOffer: z.boolean(),
273
280
  onPromotion: z.boolean(),
274
281
  onSubscription: z.boolean(),
@@ -5,9 +5,20 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../../types/fp.js";
9
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
11
 
12
+ export const VolumeBasedPromotionPromotionType = {
13
+ Discount: "discount",
14
+ VolumeBased: "volume-based",
15
+ FixedPrice: "fixed-price",
16
+ FreeGoods: "free-goods",
17
+ } as const;
18
+ export type VolumeBasedPromotionPromotionType = ClosedEnum<
19
+ typeof VolumeBasedPromotionPromotionType
20
+ >;
21
+
11
22
  export type Slabs = {
12
23
  /**
13
24
  * The minimum quantity required to qualify for the discount.
@@ -20,10 +31,32 @@ export type Slabs = {
20
31
  };
21
32
 
22
33
  export type VolumeBasedPromotion = {
23
- promotionType?: "discount" | undefined;
34
+ promotionType?: "volume-based" | undefined;
24
35
  slabs: Array<Slabs>;
25
36
  };
26
37
 
38
+ /** @internal */
39
+ export const VolumeBasedPromotionPromotionType$inboundSchema: z.ZodNativeEnum<
40
+ typeof VolumeBasedPromotionPromotionType
41
+ > = z.nativeEnum(VolumeBasedPromotionPromotionType);
42
+
43
+ /** @internal */
44
+ export const VolumeBasedPromotionPromotionType$outboundSchema: z.ZodNativeEnum<
45
+ typeof VolumeBasedPromotionPromotionType
46
+ > = VolumeBasedPromotionPromotionType$inboundSchema;
47
+
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export namespace VolumeBasedPromotionPromotionType$ {
53
+ /** @deprecated use `VolumeBasedPromotionPromotionType$inboundSchema` instead. */
54
+ export const inboundSchema = VolumeBasedPromotionPromotionType$inboundSchema;
55
+ /** @deprecated use `VolumeBasedPromotionPromotionType$outboundSchema` instead. */
56
+ export const outboundSchema =
57
+ VolumeBasedPromotionPromotionType$outboundSchema;
58
+ }
59
+
27
60
  /** @internal */
28
61
  export const Slabs$inboundSchema: z.ZodType<Slabs, z.ZodTypeDef, unknown> = z
29
62
  .object({
@@ -90,7 +123,7 @@ export const VolumeBasedPromotion$inboundSchema: z.ZodType<
90
123
  z.ZodTypeDef,
91
124
  unknown
92
125
  > = z.object({
93
- promotion_type: z.literal("discount").optional(),
126
+ promotion_type: z.literal("volume-based").optional(),
94
127
  slabs: z.array(z.lazy(() => Slabs$inboundSchema)),
95
128
  }).transform((v) => {
96
129
  return remap$(v, {
@@ -100,7 +133,7 @@ export const VolumeBasedPromotion$inboundSchema: z.ZodType<
100
133
 
101
134
  /** @internal */
102
135
  export type VolumeBasedPromotion$Outbound = {
103
- promotion_type: "discount";
136
+ promotion_type: "volume-based";
104
137
  slabs: Array<Slabs$Outbound>;
105
138
  };
106
139
 
@@ -110,7 +143,7 @@ export const VolumeBasedPromotion$outboundSchema: z.ZodType<
110
143
  z.ZodTypeDef,
111
144
  VolumeBasedPromotion
112
145
  > = z.object({
113
- promotionType: z.literal("discount").default("discount" as const),
146
+ promotionType: z.literal("volume-based").default("volume-based"),
114
147
  slabs: z.array(z.lazy(() => Slabs$outboundSchema)),
115
148
  }).transform((v) => {
116
149
  return remap$(v, {
@@ -5,56 +5,13 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
- /**
13
- * The communication channel for sending the OTP.
14
- */
15
- export const Channel = {
16
- Sms: "sms",
17
- Email: "email",
18
- Whatsapp: "whatsapp",
19
- } as const;
20
- /**
21
- * The communication channel for sending the OTP.
22
- */
23
- export type Channel = ClosedEnum<typeof Channel>;
24
-
25
- export const GenerateOtpOtpAction = {
26
- Login: "login",
27
- Register: "register",
28
- ResetPassword: "reset-password",
29
- VerifyPhone: "verify-phone",
30
- VerifyEmail: "verify-email",
31
- UpdatePhone: "update-phone",
32
- UpdateEmail: "update-email",
33
- } as const;
34
- export type GenerateOtpOtpAction = ClosedEnum<typeof GenerateOtpOtpAction>;
35
-
36
- export type GenerateOtpRequestBody = {
37
- /**
38
- * The communication channel for sending the OTP.
39
- */
40
- channel: Channel;
41
- /**
42
- * Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
43
- *
44
- * @remarks
45
- * Use this key along with phone. Not necessary for email.
46
- */
47
- countryCode?: string | undefined;
48
- /**
49
- * 10 digit phone number without country code.
50
- */
51
- phone?: string | undefined;
52
- /**
53
- * A string representing the email address.
54
- */
55
- email?: string | undefined;
56
- otpAction: GenerateOtpOtpAction;
57
- };
12
+ export type GenerateOtpRequestBody =
13
+ | components.GenerateOtpWithEmail
14
+ | components.GenerateOtpWithPhone;
58
15
 
59
16
  /**
60
17
  * An object containing the response content.
@@ -88,90 +45,30 @@ export type GenerateOtpResponseBody = {
88
45
  content: GenerateOtpContent;
89
46
  };
90
47
 
91
- /** @internal */
92
- export const Channel$inboundSchema: z.ZodNativeEnum<typeof Channel> = z
93
- .nativeEnum(Channel);
94
-
95
- /** @internal */
96
- export const Channel$outboundSchema: z.ZodNativeEnum<typeof Channel> =
97
- Channel$inboundSchema;
98
-
99
- /**
100
- * @internal
101
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
102
- */
103
- export namespace Channel$ {
104
- /** @deprecated use `Channel$inboundSchema` instead. */
105
- export const inboundSchema = Channel$inboundSchema;
106
- /** @deprecated use `Channel$outboundSchema` instead. */
107
- export const outboundSchema = Channel$outboundSchema;
108
- }
109
-
110
- /** @internal */
111
- export const GenerateOtpOtpAction$inboundSchema: z.ZodNativeEnum<
112
- typeof GenerateOtpOtpAction
113
- > = z.nativeEnum(GenerateOtpOtpAction);
114
-
115
- /** @internal */
116
- export const GenerateOtpOtpAction$outboundSchema: z.ZodNativeEnum<
117
- typeof GenerateOtpOtpAction
118
- > = GenerateOtpOtpAction$inboundSchema;
119
-
120
- /**
121
- * @internal
122
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
123
- */
124
- export namespace GenerateOtpOtpAction$ {
125
- /** @deprecated use `GenerateOtpOtpAction$inboundSchema` instead. */
126
- export const inboundSchema = GenerateOtpOtpAction$inboundSchema;
127
- /** @deprecated use `GenerateOtpOtpAction$outboundSchema` instead. */
128
- export const outboundSchema = GenerateOtpOtpAction$outboundSchema;
129
- }
130
-
131
48
  /** @internal */
132
49
  export const GenerateOtpRequestBody$inboundSchema: z.ZodType<
133
50
  GenerateOtpRequestBody,
134
51
  z.ZodTypeDef,
135
52
  unknown
136
- > = z.object({
137
- channel: Channel$inboundSchema,
138
- country_code: z.string().optional(),
139
- phone: z.string().optional(),
140
- email: z.string().optional(),
141
- otp_action: GenerateOtpOtpAction$inboundSchema,
142
- }).transform((v) => {
143
- return remap$(v, {
144
- "country_code": "countryCode",
145
- "otp_action": "otpAction",
146
- });
147
- });
53
+ > = z.union([
54
+ components.GenerateOtpWithEmail$inboundSchema,
55
+ components.GenerateOtpWithPhone$inboundSchema,
56
+ ]);
148
57
 
149
58
  /** @internal */
150
- export type GenerateOtpRequestBody$Outbound = {
151
- channel: string;
152
- country_code?: string | undefined;
153
- phone?: string | undefined;
154
- email?: string | undefined;
155
- otp_action: string;
156
- };
59
+ export type GenerateOtpRequestBody$Outbound =
60
+ | components.GenerateOtpWithEmail$Outbound
61
+ | components.GenerateOtpWithPhone$Outbound;
157
62
 
158
63
  /** @internal */
159
64
  export const GenerateOtpRequestBody$outboundSchema: z.ZodType<
160
65
  GenerateOtpRequestBody$Outbound,
161
66
  z.ZodTypeDef,
162
67
  GenerateOtpRequestBody
163
- > = z.object({
164
- channel: Channel$outboundSchema,
165
- countryCode: z.string().optional(),
166
- phone: z.string().optional(),
167
- email: z.string().optional(),
168
- otpAction: GenerateOtpOtpAction$outboundSchema,
169
- }).transform((v) => {
170
- return remap$(v, {
171
- countryCode: "country_code",
172
- otpAction: "otp_action",
173
- });
174
- });
68
+ > = z.union([
69
+ components.GenerateOtpWithEmail$outboundSchema,
70
+ components.GenerateOtpWithPhone$outboundSchema,
71
+ ]);
175
72
 
176
73
  /**
177
74
  * @internal
@@ -8,9 +8,6 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import * as components from "../components/index.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
- export type GetShippingMethodsRequestBody =
12
- components.CartBasedServiceabilityCheck;
13
-
14
11
  /**
15
12
  * OK
16
13
  */
@@ -20,57 +17,6 @@ export type GetShippingMethodsResponseBody = {
20
17
  content: components.PincodeServiceability;
21
18
  };
22
19
 
23
- /** @internal */
24
- export const GetShippingMethodsRequestBody$inboundSchema: z.ZodType<
25
- GetShippingMethodsRequestBody,
26
- z.ZodTypeDef,
27
- unknown
28
- > = components.CartBasedServiceabilityCheck$inboundSchema;
29
-
30
- /** @internal */
31
- export type GetShippingMethodsRequestBody$Outbound =
32
- components.CartBasedServiceabilityCheck$Outbound;
33
-
34
- /** @internal */
35
- export const GetShippingMethodsRequestBody$outboundSchema: z.ZodType<
36
- GetShippingMethodsRequestBody$Outbound,
37
- z.ZodTypeDef,
38
- GetShippingMethodsRequestBody
39
- > = components.CartBasedServiceabilityCheck$outboundSchema;
40
-
41
- /**
42
- * @internal
43
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
44
- */
45
- export namespace GetShippingMethodsRequestBody$ {
46
- /** @deprecated use `GetShippingMethodsRequestBody$inboundSchema` instead. */
47
- export const inboundSchema = GetShippingMethodsRequestBody$inboundSchema;
48
- /** @deprecated use `GetShippingMethodsRequestBody$outboundSchema` instead. */
49
- export const outboundSchema = GetShippingMethodsRequestBody$outboundSchema;
50
- /** @deprecated use `GetShippingMethodsRequestBody$Outbound` instead. */
51
- export type Outbound = GetShippingMethodsRequestBody$Outbound;
52
- }
53
-
54
- export function getShippingMethodsRequestBodyToJSON(
55
- getShippingMethodsRequestBody: GetShippingMethodsRequestBody,
56
- ): string {
57
- return JSON.stringify(
58
- GetShippingMethodsRequestBody$outboundSchema.parse(
59
- getShippingMethodsRequestBody,
60
- ),
61
- );
62
- }
63
-
64
- export function getShippingMethodsRequestBodyFromJSON(
65
- jsonString: string,
66
- ): SafeParseResult<GetShippingMethodsRequestBody, SDKValidationError> {
67
- return safeParse(
68
- jsonString,
69
- (x) => GetShippingMethodsRequestBody$inboundSchema.parse(JSON.parse(x)),
70
- `Failed to parse 'GetShippingMethodsRequestBody' from JSON`,
71
- );
72
- }
73
-
74
20
  /** @internal */
75
21
  export const GetShippingMethodsResponseBody$inboundSchema: z.ZodType<
76
22
  GetShippingMethodsResponseBody,
@@ -9,22 +9,17 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import * as components from "../components/index.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
- /**
13
- * For registered users where address is previously added
14
- */
15
- export type RequestBodyRegisteredUser = {
12
+ export type UpdateShippingMethodRequestBody = {
16
13
  shippingProviderId: string;
17
- courierCompanyId?: string | null | undefined;
14
+ courierCompanyId: string | null;
18
15
  };
19
16
 
20
- export type UpdateShippingMethodRequestBody = RequestBodyRegisteredUser;
21
-
22
17
  export type UpdateShippingMethodRequest = {
23
18
  /**
24
19
  * Cart ID
25
20
  */
26
21
  id: string;
27
- requestBody: RequestBodyRegisteredUser;
22
+ requestBody: UpdateShippingMethodRequestBody;
28
23
  };
29
24
 
30
25
  export type UpdateShippingMethodContent = {
@@ -44,13 +39,13 @@ export type UpdateShippingMethodResponseBody = {
44
39
  };
45
40
 
46
41
  /** @internal */
47
- export const RequestBodyRegisteredUser$inboundSchema: z.ZodType<
48
- RequestBodyRegisteredUser,
42
+ export const UpdateShippingMethodRequestBody$inboundSchema: z.ZodType<
43
+ UpdateShippingMethodRequestBody,
49
44
  z.ZodTypeDef,
50
45
  unknown
51
46
  > = z.object({
52
47
  shipping_provider_id: z.string(),
53
- courier_company_id: z.nullable(z.string()).optional(),
48
+ courier_company_id: z.nullable(z.string()),
54
49
  }).transform((v) => {
55
50
  return remap$(v, {
56
51
  "shipping_provider_id": "shippingProviderId",
@@ -59,19 +54,19 @@ export const RequestBodyRegisteredUser$inboundSchema: z.ZodType<
59
54
  });
60
55
 
61
56
  /** @internal */
62
- export type RequestBodyRegisteredUser$Outbound = {
57
+ export type UpdateShippingMethodRequestBody$Outbound = {
63
58
  shipping_provider_id: string;
64
- courier_company_id?: string | null | undefined;
59
+ courier_company_id: string | null;
65
60
  };
66
61
 
67
62
  /** @internal */
68
- export const RequestBodyRegisteredUser$outboundSchema: z.ZodType<
69
- RequestBodyRegisteredUser$Outbound,
63
+ export const UpdateShippingMethodRequestBody$outboundSchema: z.ZodType<
64
+ UpdateShippingMethodRequestBody$Outbound,
70
65
  z.ZodTypeDef,
71
- RequestBodyRegisteredUser
66
+ UpdateShippingMethodRequestBody
72
67
  > = z.object({
73
68
  shippingProviderId: z.string(),
74
- courierCompanyId: z.nullable(z.string()).optional(),
69
+ courierCompanyId: z.nullable(z.string()),
75
70
  }).transform((v) => {
76
71
  return remap$(v, {
77
72
  shippingProviderId: "shipping_provider_id",
@@ -79,55 +74,6 @@ export const RequestBodyRegisteredUser$outboundSchema: z.ZodType<
79
74
  });
80
75
  });
81
76
 
82
- /**
83
- * @internal
84
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
85
- */
86
- export namespace RequestBodyRegisteredUser$ {
87
- /** @deprecated use `RequestBodyRegisteredUser$inboundSchema` instead. */
88
- export const inboundSchema = RequestBodyRegisteredUser$inboundSchema;
89
- /** @deprecated use `RequestBodyRegisteredUser$outboundSchema` instead. */
90
- export const outboundSchema = RequestBodyRegisteredUser$outboundSchema;
91
- /** @deprecated use `RequestBodyRegisteredUser$Outbound` instead. */
92
- export type Outbound = RequestBodyRegisteredUser$Outbound;
93
- }
94
-
95
- export function requestBodyRegisteredUserToJSON(
96
- requestBodyRegisteredUser: RequestBodyRegisteredUser,
97
- ): string {
98
- return JSON.stringify(
99
- RequestBodyRegisteredUser$outboundSchema.parse(requestBodyRegisteredUser),
100
- );
101
- }
102
-
103
- export function requestBodyRegisteredUserFromJSON(
104
- jsonString: string,
105
- ): SafeParseResult<RequestBodyRegisteredUser, SDKValidationError> {
106
- return safeParse(
107
- jsonString,
108
- (x) => RequestBodyRegisteredUser$inboundSchema.parse(JSON.parse(x)),
109
- `Failed to parse 'RequestBodyRegisteredUser' from JSON`,
110
- );
111
- }
112
-
113
- /** @internal */
114
- export const UpdateShippingMethodRequestBody$inboundSchema: z.ZodType<
115
- UpdateShippingMethodRequestBody,
116
- z.ZodTypeDef,
117
- unknown
118
- > = z.lazy(() => RequestBodyRegisteredUser$inboundSchema);
119
-
120
- /** @internal */
121
- export type UpdateShippingMethodRequestBody$Outbound =
122
- RequestBodyRegisteredUser$Outbound;
123
-
124
- /** @internal */
125
- export const UpdateShippingMethodRequestBody$outboundSchema: z.ZodType<
126
- UpdateShippingMethodRequestBody$Outbound,
127
- z.ZodTypeDef,
128
- UpdateShippingMethodRequestBody
129
- > = z.lazy(() => RequestBodyRegisteredUser$outboundSchema);
130
-
131
77
  /**
132
78
  * @internal
133
79
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
@@ -168,7 +114,7 @@ export const UpdateShippingMethodRequest$inboundSchema: z.ZodType<
168
114
  unknown
169
115
  > = z.object({
170
116
  id: z.string(),
171
- RequestBody: z.lazy(() => RequestBodyRegisteredUser$inboundSchema),
117
+ RequestBody: z.lazy(() => UpdateShippingMethodRequestBody$inboundSchema),
172
118
  }).transform((v) => {
173
119
  return remap$(v, {
174
120
  "RequestBody": "requestBody",
@@ -178,7 +124,7 @@ export const UpdateShippingMethodRequest$inboundSchema: z.ZodType<
178
124
  /** @internal */
179
125
  export type UpdateShippingMethodRequest$Outbound = {
180
126
  id: string;
181
- RequestBody: RequestBodyRegisteredUser$Outbound;
127
+ RequestBody: UpdateShippingMethodRequestBody$Outbound;
182
128
  };
183
129
 
184
130
  /** @internal */
@@ -188,7 +134,7 @@ export const UpdateShippingMethodRequest$outboundSchema: z.ZodType<
188
134
  UpdateShippingMethodRequest
189
135
  > = z.object({
190
136
  id: z.string(),
191
- requestBody: z.lazy(() => RequestBodyRegisteredUser$outboundSchema),
137
+ requestBody: z.lazy(() => UpdateShippingMethodRequestBody$outboundSchema),
192
138
  }).transform((v) => {
193
139
  return remap$(v, {
194
140
  requestBody: "RequestBody",
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { shippingShippingMethods } from "../funcs/shippingShippingMethods.js";
6
6
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as components from "../models/components/index.js";
7
8
  import * as operations from "../models/operations/index.js";
8
9
  import { unwrapAsync } from "../types/fp.js";
9
10
 
@@ -15,7 +16,7 @@ export class Shipping extends ClientSDK {
15
16
  * Checks whether a given pincode is serviceable and returns all available shipping methods based on delivery address
16
17
  */
17
18
  async shippingMethods(
18
- request?: operations.GetShippingMethodsRequestBody | undefined,
19
+ request: components.CartBasedServiceabilityCheck,
19
20
  options?: RequestOptions,
20
21
  ): Promise<operations.GetShippingMethodsResponseBody> {
21
22
  return unwrapAsync(shippingShippingMethods(