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
@@ -5,21 +5,53 @@
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 FixedPricePromotionPromotionType = {
13
+ Discount: "discount",
14
+ VolumeBased: "volume-based",
15
+ FixedPrice: "fixed-price",
16
+ FreeGoods: "free-goods",
17
+ } as const;
18
+ export type FixedPricePromotionPromotionType = ClosedEnum<
19
+ typeof FixedPricePromotionPromotionType
20
+ >;
21
+
11
22
  export type FixedPricePromotion = {
12
- promotionType?: "discount" | undefined;
23
+ promotionType?: "fixed-price" | undefined;
13
24
  offerPrice: number;
14
25
  };
15
26
 
27
+ /** @internal */
28
+ export const FixedPricePromotionPromotionType$inboundSchema: z.ZodNativeEnum<
29
+ typeof FixedPricePromotionPromotionType
30
+ > = z.nativeEnum(FixedPricePromotionPromotionType);
31
+
32
+ /** @internal */
33
+ export const FixedPricePromotionPromotionType$outboundSchema: z.ZodNativeEnum<
34
+ typeof FixedPricePromotionPromotionType
35
+ > = FixedPricePromotionPromotionType$inboundSchema;
36
+
37
+ /**
38
+ * @internal
39
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
+ */
41
+ export namespace FixedPricePromotionPromotionType$ {
42
+ /** @deprecated use `FixedPricePromotionPromotionType$inboundSchema` instead. */
43
+ export const inboundSchema = FixedPricePromotionPromotionType$inboundSchema;
44
+ /** @deprecated use `FixedPricePromotionPromotionType$outboundSchema` instead. */
45
+ export const outboundSchema = FixedPricePromotionPromotionType$outboundSchema;
46
+ }
47
+
16
48
  /** @internal */
17
49
  export const FixedPricePromotion$inboundSchema: z.ZodType<
18
50
  FixedPricePromotion,
19
51
  z.ZodTypeDef,
20
52
  unknown
21
53
  > = z.object({
22
- promotion_type: z.literal("discount").optional(),
54
+ promotion_type: z.literal("fixed-price").optional(),
23
55
  offer_price: z.number(),
24
56
  }).transform((v) => {
25
57
  return remap$(v, {
@@ -30,7 +62,7 @@ export const FixedPricePromotion$inboundSchema: z.ZodType<
30
62
 
31
63
  /** @internal */
32
64
  export type FixedPricePromotion$Outbound = {
33
- promotion_type: "discount";
65
+ promotion_type: "fixed-price";
34
66
  offer_price: number;
35
67
  };
36
68
 
@@ -40,7 +72,7 @@ export const FixedPricePromotion$outboundSchema: z.ZodType<
40
72
  z.ZodTypeDef,
41
73
  FixedPricePromotion
42
74
  > = z.object({
43
- promotionType: z.literal("discount").default("discount" as const),
75
+ promotionType: z.literal("fixed-price").default("fixed-price"),
44
76
  offerPrice: z.number(),
45
77
  }).transform((v) => {
46
78
  return remap$(v, {
@@ -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 FreeGoodsPromotionPromotionType = {
13
+ Discount: "discount",
14
+ VolumeBased: "volume-based",
15
+ FixedPrice: "fixed-price",
16
+ FreeGoods: "free-goods",
17
+ } as const;
18
+ export type FreeGoodsPromotionPromotionType = ClosedEnum<
19
+ typeof FreeGoodsPromotionPromotionType
20
+ >;
21
+
11
22
  export type FreeGoodsPromotion = {
12
23
  promotionType?: "free-goods" | undefined;
13
24
  /**
@@ -20,6 +31,27 @@ export type FreeGoodsPromotion = {
20
31
  getQuantity: number;
21
32
  };
22
33
 
34
+ /** @internal */
35
+ export const FreeGoodsPromotionPromotionType$inboundSchema: z.ZodNativeEnum<
36
+ typeof FreeGoodsPromotionPromotionType
37
+ > = z.nativeEnum(FreeGoodsPromotionPromotionType);
38
+
39
+ /** @internal */
40
+ export const FreeGoodsPromotionPromotionType$outboundSchema: z.ZodNativeEnum<
41
+ typeof FreeGoodsPromotionPromotionType
42
+ > = FreeGoodsPromotionPromotionType$inboundSchema;
43
+
44
+ /**
45
+ * @internal
46
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
+ */
48
+ export namespace FreeGoodsPromotionPromotionType$ {
49
+ /** @deprecated use `FreeGoodsPromotionPromotionType$inboundSchema` instead. */
50
+ export const inboundSchema = FreeGoodsPromotionPromotionType$inboundSchema;
51
+ /** @deprecated use `FreeGoodsPromotionPromotionType$outboundSchema` instead. */
52
+ export const outboundSchema = FreeGoodsPromotionPromotionType$outboundSchema;
53
+ }
54
+
23
55
  /** @internal */
24
56
  export const FreeGoodsPromotion$inboundSchema: z.ZodType<
25
57
  FreeGoodsPromotion,
@@ -50,7 +82,7 @@ export const FreeGoodsPromotion$outboundSchema: z.ZodType<
50
82
  z.ZodTypeDef,
51
83
  FreeGoodsPromotion
52
84
  > = z.object({
53
- promotionType: z.literal("free-goods").default("free-goods" as const),
85
+ promotionType: z.literal("free-goods").default("free-goods"),
54
86
  buyQuantity: z.number().int(),
55
87
  getQuantity: z.number().int(),
56
88
  }).transform((v) => {
@@ -0,0 +1,115 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const GenerateOtpWithEmailOtpAction = {
13
+ Register: "register",
14
+ ResetPassword: "reset-password",
15
+ VerifyEmail: "verify-email",
16
+ UpdateEmail: "update-email",
17
+ } as const;
18
+ export type GenerateOtpWithEmailOtpAction = ClosedEnum<
19
+ typeof GenerateOtpWithEmailOtpAction
20
+ >;
21
+
22
+ export type GenerateOtpWithEmail = {
23
+ channel?: "email" | undefined;
24
+ email: string;
25
+ otpAction: GenerateOtpWithEmailOtpAction;
26
+ };
27
+
28
+ /** @internal */
29
+ export const GenerateOtpWithEmailOtpAction$inboundSchema: z.ZodNativeEnum<
30
+ typeof GenerateOtpWithEmailOtpAction
31
+ > = z.nativeEnum(GenerateOtpWithEmailOtpAction);
32
+
33
+ /** @internal */
34
+ export const GenerateOtpWithEmailOtpAction$outboundSchema: z.ZodNativeEnum<
35
+ typeof GenerateOtpWithEmailOtpAction
36
+ > = GenerateOtpWithEmailOtpAction$inboundSchema;
37
+
38
+ /**
39
+ * @internal
40
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
41
+ */
42
+ export namespace GenerateOtpWithEmailOtpAction$ {
43
+ /** @deprecated use `GenerateOtpWithEmailOtpAction$inboundSchema` instead. */
44
+ export const inboundSchema = GenerateOtpWithEmailOtpAction$inboundSchema;
45
+ /** @deprecated use `GenerateOtpWithEmailOtpAction$outboundSchema` instead. */
46
+ export const outboundSchema = GenerateOtpWithEmailOtpAction$outboundSchema;
47
+ }
48
+
49
+ /** @internal */
50
+ export const GenerateOtpWithEmail$inboundSchema: z.ZodType<
51
+ GenerateOtpWithEmail,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.object({
55
+ channel: z.literal("email").optional(),
56
+ email: z.string(),
57
+ otp_action: GenerateOtpWithEmailOtpAction$inboundSchema,
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ "otp_action": "otpAction",
61
+ });
62
+ });
63
+
64
+ /** @internal */
65
+ export type GenerateOtpWithEmail$Outbound = {
66
+ channel: "email";
67
+ email: string;
68
+ otp_action: string;
69
+ };
70
+
71
+ /** @internal */
72
+ export const GenerateOtpWithEmail$outboundSchema: z.ZodType<
73
+ GenerateOtpWithEmail$Outbound,
74
+ z.ZodTypeDef,
75
+ GenerateOtpWithEmail
76
+ > = z.object({
77
+ channel: z.literal("email").default("email" as const),
78
+ email: z.string(),
79
+ otpAction: GenerateOtpWithEmailOtpAction$outboundSchema,
80
+ }).transform((v) => {
81
+ return remap$(v, {
82
+ otpAction: "otp_action",
83
+ });
84
+ });
85
+
86
+ /**
87
+ * @internal
88
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
89
+ */
90
+ export namespace GenerateOtpWithEmail$ {
91
+ /** @deprecated use `GenerateOtpWithEmail$inboundSchema` instead. */
92
+ export const inboundSchema = GenerateOtpWithEmail$inboundSchema;
93
+ /** @deprecated use `GenerateOtpWithEmail$outboundSchema` instead. */
94
+ export const outboundSchema = GenerateOtpWithEmail$outboundSchema;
95
+ /** @deprecated use `GenerateOtpWithEmail$Outbound` instead. */
96
+ export type Outbound = GenerateOtpWithEmail$Outbound;
97
+ }
98
+
99
+ export function generateOtpWithEmailToJSON(
100
+ generateOtpWithEmail: GenerateOtpWithEmail,
101
+ ): string {
102
+ return JSON.stringify(
103
+ GenerateOtpWithEmail$outboundSchema.parse(generateOtpWithEmail),
104
+ );
105
+ }
106
+
107
+ export function generateOtpWithEmailFromJSON(
108
+ jsonString: string,
109
+ ): SafeParseResult<GenerateOtpWithEmail, SDKValidationError> {
110
+ return safeParse(
111
+ jsonString,
112
+ (x) => GenerateOtpWithEmail$inboundSchema.parse(JSON.parse(x)),
113
+ `Failed to parse 'GenerateOtpWithEmail' from JSON`,
114
+ );
115
+ }
@@ -0,0 +1,148 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const Channel = {
13
+ Sms: "sms",
14
+ Whatsapp: "whatsapp",
15
+ } as const;
16
+ export type Channel = ClosedEnum<typeof Channel>;
17
+
18
+ export const OtpAction = {
19
+ Register: "register",
20
+ ResetPassword: "reset-password",
21
+ VerifyPhone: "verify-phone",
22
+ UpdatePhone: "update-phone",
23
+ } as const;
24
+ export type OtpAction = ClosedEnum<typeof OtpAction>;
25
+
26
+ export type GenerateOtpWithPhone = {
27
+ channel: Channel;
28
+ /**
29
+ * Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
30
+ */
31
+ countryCode?: string | null | undefined;
32
+ /**
33
+ * 10 digit phone number without country code.
34
+ */
35
+ phone: string;
36
+ otpAction: OtpAction;
37
+ };
38
+
39
+ /** @internal */
40
+ export const Channel$inboundSchema: z.ZodNativeEnum<typeof Channel> = z
41
+ .nativeEnum(Channel);
42
+
43
+ /** @internal */
44
+ export const Channel$outboundSchema: z.ZodNativeEnum<typeof Channel> =
45
+ Channel$inboundSchema;
46
+
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export namespace Channel$ {
52
+ /** @deprecated use `Channel$inboundSchema` instead. */
53
+ export const inboundSchema = Channel$inboundSchema;
54
+ /** @deprecated use `Channel$outboundSchema` instead. */
55
+ export const outboundSchema = Channel$outboundSchema;
56
+ }
57
+
58
+ /** @internal */
59
+ export const OtpAction$inboundSchema: z.ZodNativeEnum<typeof OtpAction> = z
60
+ .nativeEnum(OtpAction);
61
+
62
+ /** @internal */
63
+ export const OtpAction$outboundSchema: z.ZodNativeEnum<typeof OtpAction> =
64
+ OtpAction$inboundSchema;
65
+
66
+ /**
67
+ * @internal
68
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
69
+ */
70
+ export namespace OtpAction$ {
71
+ /** @deprecated use `OtpAction$inboundSchema` instead. */
72
+ export const inboundSchema = OtpAction$inboundSchema;
73
+ /** @deprecated use `OtpAction$outboundSchema` instead. */
74
+ export const outboundSchema = OtpAction$outboundSchema;
75
+ }
76
+
77
+ /** @internal */
78
+ export const GenerateOtpWithPhone$inboundSchema: z.ZodType<
79
+ GenerateOtpWithPhone,
80
+ z.ZodTypeDef,
81
+ unknown
82
+ > = z.object({
83
+ channel: Channel$inboundSchema,
84
+ country_code: z.nullable(z.string()).optional(),
85
+ phone: z.string(),
86
+ otp_action: OtpAction$inboundSchema,
87
+ }).transform((v) => {
88
+ return remap$(v, {
89
+ "country_code": "countryCode",
90
+ "otp_action": "otpAction",
91
+ });
92
+ });
93
+
94
+ /** @internal */
95
+ export type GenerateOtpWithPhone$Outbound = {
96
+ channel: string;
97
+ country_code?: string | null | undefined;
98
+ phone: string;
99
+ otp_action: string;
100
+ };
101
+
102
+ /** @internal */
103
+ export const GenerateOtpWithPhone$outboundSchema: z.ZodType<
104
+ GenerateOtpWithPhone$Outbound,
105
+ z.ZodTypeDef,
106
+ GenerateOtpWithPhone
107
+ > = z.object({
108
+ channel: Channel$outboundSchema,
109
+ countryCode: z.nullable(z.string()).optional(),
110
+ phone: z.string(),
111
+ otpAction: OtpAction$outboundSchema,
112
+ }).transform((v) => {
113
+ return remap$(v, {
114
+ countryCode: "country_code",
115
+ otpAction: "otp_action",
116
+ });
117
+ });
118
+
119
+ /**
120
+ * @internal
121
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
122
+ */
123
+ export namespace GenerateOtpWithPhone$ {
124
+ /** @deprecated use `GenerateOtpWithPhone$inboundSchema` instead. */
125
+ export const inboundSchema = GenerateOtpWithPhone$inboundSchema;
126
+ /** @deprecated use `GenerateOtpWithPhone$outboundSchema` instead. */
127
+ export const outboundSchema = GenerateOtpWithPhone$outboundSchema;
128
+ /** @deprecated use `GenerateOtpWithPhone$Outbound` instead. */
129
+ export type Outbound = GenerateOtpWithPhone$Outbound;
130
+ }
131
+
132
+ export function generateOtpWithPhoneToJSON(
133
+ generateOtpWithPhone: GenerateOtpWithPhone,
134
+ ): string {
135
+ return JSON.stringify(
136
+ GenerateOtpWithPhone$outboundSchema.parse(generateOtpWithPhone),
137
+ );
138
+ }
139
+
140
+ export function generateOtpWithPhoneFromJSON(
141
+ jsonString: string,
142
+ ): SafeParseResult<GenerateOtpWithPhone, SDKValidationError> {
143
+ return safeParse(
144
+ jsonString,
145
+ (x) => GenerateOtpWithPhone$inboundSchema.parse(JSON.parse(x)),
146
+ `Failed to parse 'GenerateOtpWithPhone' from JSON`,
147
+ );
148
+ }
@@ -3,6 +3,8 @@
3
3
  */
4
4
 
5
5
  export * from "./anonymoususer.js";
6
+ export * from "./appliedcoupon.js";
7
+ export * from "./appliedpromotion.js";
6
8
  export * from "./associatedoption.js";
7
9
  export * from "./banktransfer.js";
8
10
  export * from "./booleanattribute.js";
@@ -23,6 +25,8 @@ export * from "./dateattribute.js";
23
25
  export * from "./discountbasedpromotion.js";
24
26
  export * from "./fixedpricepromotion.js";
25
27
  export * from "./freegoodspromotion.js";
28
+ export * from "./generateotpwithemail.js";
29
+ export * from "./generateotpwithphone.js";
26
30
  export * from "./item.js";
27
31
  export * from "./juspaypaymentgatewayparams.js";
28
32
  export * from "./juspaypaymentinfo.js";
@@ -38,6 +38,12 @@ import {
38
38
  ProductPromotion$Outbound,
39
39
  ProductPromotion$outboundSchema,
40
40
  } from "./productpromotion.js";
41
+ import {
42
+ ProductShipping,
43
+ ProductShipping$inboundSchema,
44
+ ProductShipping$Outbound,
45
+ ProductShipping$outboundSchema,
46
+ } from "./productshipping.js";
41
47
  import {
42
48
  ProductSubscription,
43
49
  ProductSubscription$inboundSchema,
@@ -63,6 +69,10 @@ export type Item = {
63
69
  shortDescription: string | null;
64
70
  active: boolean;
65
71
  stockAvailable: boolean;
72
+ /**
73
+ * 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.
74
+ */
75
+ backorder?: boolean | undefined;
66
76
  /**
67
77
  * Indicates whether this item is associated with any active (product-specific) coupons
68
78
  */
@@ -79,6 +89,7 @@ export type Item = {
79
89
  promotion: ProductPromotion | null;
80
90
  subscription: Array<ProductSubscription>;
81
91
  associatedOptions: { [k: string]: AssociatedOption } | null;
92
+ shipping?: ProductShipping | null | undefined;
82
93
  };
83
94
 
84
95
  /** @internal */
@@ -115,6 +126,7 @@ export const Item$inboundSchema: z.ZodType<Item, z.ZodTypeDef, unknown> = z
115
126
  short_description: z.nullable(z.string()),
116
127
  active: z.boolean(),
117
128
  stock_available: z.boolean(),
129
+ backorder: z.boolean().optional(),
118
130
  on_offer: z.boolean(),
119
131
  on_subscription: z.boolean(),
120
132
  on_promotion: z.boolean(),
@@ -128,6 +140,7 @@ export const Item$inboundSchema: z.ZodType<Item, z.ZodTypeDef, unknown> = z
128
140
  promotion: z.nullable(ProductPromotion$inboundSchema),
129
141
  subscription: z.array(ProductSubscription$inboundSchema),
130
142
  associated_options: z.nullable(z.record(AssociatedOption$inboundSchema)),
143
+ shipping: z.nullable(ProductShipping$inboundSchema).optional(),
131
144
  }).transform((v) => {
132
145
  return remap$(v, {
133
146
  "product_id": "productId",
@@ -159,6 +172,7 @@ export type Item$Outbound = {
159
172
  short_description: string | null;
160
173
  active: boolean;
161
174
  stock_available: boolean;
175
+ backorder?: boolean | undefined;
162
176
  on_offer: boolean;
163
177
  on_subscription: boolean;
164
178
  on_promotion: boolean;
@@ -172,6 +186,7 @@ export type Item$Outbound = {
172
186
  promotion: ProductPromotion$Outbound | null;
173
187
  subscription: Array<ProductSubscription$Outbound>;
174
188
  associated_options: { [k: string]: AssociatedOption$Outbound } | null;
189
+ shipping?: ProductShipping$Outbound | null | undefined;
175
190
  };
176
191
 
177
192
  /** @internal */
@@ -187,6 +202,7 @@ export const Item$outboundSchema: z.ZodType<Item$Outbound, z.ZodTypeDef, Item> =
187
202
  shortDescription: z.nullable(z.string()),
188
203
  active: z.boolean(),
189
204
  stockAvailable: z.boolean(),
205
+ backorder: z.boolean().optional(),
190
206
  onOffer: z.boolean(),
191
207
  onSubscription: z.boolean(),
192
208
  onPromotion: z.boolean(),
@@ -200,6 +216,7 @@ export const Item$outboundSchema: z.ZodType<Item$Outbound, z.ZodTypeDef, Item> =
200
216
  promotion: z.nullable(ProductPromotion$outboundSchema),
201
217
  subscription: z.array(ProductSubscription$outboundSchema),
202
218
  associatedOptions: z.nullable(z.record(AssociatedOption$outboundSchema)),
219
+ shipping: z.nullable(ProductShipping$outboundSchema).optional(),
203
220
  }).transform((v) => {
204
221
  return remap$(v, {
205
222
  productId: "product_id",