@polar-sh/sdk 0.35.0 → 0.35.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 (288) hide show
  1. package/bin/mcp-server.js +673 -475
  2. package/bin/mcp-server.js.map +19 -15
  3. package/dist/commonjs/lib/config.d.ts +2 -2
  4. package/dist/commonjs/lib/config.js +2 -2
  5. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  6. package/dist/commonjs/mcp-server/server.js +1 -1
  7. package/dist/commonjs/models/components/address.d.ts +687 -687
  8. package/dist/commonjs/models/components/address.js +222 -222
  9. package/dist/commonjs/models/components/addressinput.d.ts +683 -683
  10. package/dist/commonjs/models/components/addressinput.js +217 -217
  11. package/dist/commonjs/models/components/checkout.d.ts +31 -5
  12. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/checkout.js +23 -2
  14. package/dist/commonjs/models/components/checkout.js.map +1 -1
  15. package/dist/commonjs/models/components/checkoutcreate.d.ts +11 -0
  16. package/dist/commonjs/models/components/checkoutcreate.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/checkoutcreate.js +9 -0
  18. package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
  19. package/dist/commonjs/models/components/checkoutlink.d.ts +14 -3
  20. package/dist/commonjs/models/components/checkoutlink.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/checkoutlink.js +11 -2
  22. package/dist/commonjs/models/components/checkoutlink.js.map +1 -1
  23. package/dist/commonjs/models/components/checkoutlinkcreateproduct.d.ts +11 -0
  24. package/dist/commonjs/models/components/checkoutlinkcreateproduct.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/checkoutlinkcreateproduct.js +9 -0
  26. package/dist/commonjs/models/components/checkoutlinkcreateproduct.js.map +1 -1
  27. package/dist/commonjs/models/components/checkoutlinkcreateproductprice.d.ts +11 -0
  28. package/dist/commonjs/models/components/checkoutlinkcreateproductprice.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/checkoutlinkcreateproductprice.js +9 -0
  30. package/dist/commonjs/models/components/checkoutlinkcreateproductprice.js.map +1 -1
  31. package/dist/commonjs/models/components/checkoutlinkcreateproducts.d.ts +11 -0
  32. package/dist/commonjs/models/components/checkoutlinkcreateproducts.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/checkoutlinkcreateproducts.js +9 -0
  34. package/dist/commonjs/models/components/checkoutlinkcreateproducts.js.map +1 -1
  35. package/dist/commonjs/models/components/checkoutlinkproduct.d.ts +14 -3
  36. package/dist/commonjs/models/components/checkoutlinkproduct.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/checkoutlinkproduct.js +11 -2
  38. package/dist/commonjs/models/components/checkoutlinkproduct.js.map +1 -1
  39. package/dist/commonjs/models/components/checkoutlinkupdate.d.ts +11 -0
  40. package/dist/commonjs/models/components/checkoutlinkupdate.d.ts.map +1 -1
  41. package/dist/commonjs/models/components/checkoutlinkupdate.js +9 -0
  42. package/dist/commonjs/models/components/checkoutlinkupdate.js.map +1 -1
  43. package/dist/commonjs/models/components/checkoutproduct.d.ts +14 -3
  44. package/dist/commonjs/models/components/checkoutproduct.d.ts.map +1 -1
  45. package/dist/commonjs/models/components/checkoutproduct.js +11 -2
  46. package/dist/commonjs/models/components/checkoutproduct.js.map +1 -1
  47. package/dist/commonjs/models/components/checkoutpublic.d.ts +21 -5
  48. package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
  49. package/dist/commonjs/models/components/checkoutpublic.js +15 -2
  50. package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
  51. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +21 -5
  52. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/checkoutpublicconfirmed.js +15 -2
  54. package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
  55. package/dist/commonjs/models/components/checkoutupdate.d.ts +11 -0
  56. package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/checkoutupdate.js +9 -0
  58. package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
  59. package/dist/commonjs/models/components/customerorderproduct.d.ts +14 -3
  60. package/dist/commonjs/models/components/customerorderproduct.d.ts.map +1 -1
  61. package/dist/commonjs/models/components/customerorderproduct.js +11 -2
  62. package/dist/commonjs/models/components/customerorderproduct.js.map +1 -1
  63. package/dist/commonjs/models/components/customerordersubscription.d.ts +10 -0
  64. package/dist/commonjs/models/components/customerordersubscription.d.ts.map +1 -1
  65. package/dist/commonjs/models/components/customerordersubscription.js +8 -0
  66. package/dist/commonjs/models/components/customerordersubscription.js.map +1 -1
  67. package/dist/commonjs/models/components/customerproduct.d.ts +14 -3
  68. package/dist/commonjs/models/components/customerproduct.d.ts.map +1 -1
  69. package/dist/commonjs/models/components/customerproduct.js +11 -2
  70. package/dist/commonjs/models/components/customerproduct.js.map +1 -1
  71. package/dist/commonjs/models/components/customersubscription.d.ts +10 -0
  72. package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/customersubscription.js +8 -0
  74. package/dist/commonjs/models/components/customersubscription.js.map +1 -1
  75. package/dist/commonjs/models/components/customersubscriptionproduct.d.ts +14 -3
  76. package/dist/commonjs/models/components/customersubscriptionproduct.d.ts.map +1 -1
  77. package/dist/commonjs/models/components/customersubscriptionproduct.js +11 -2
  78. package/dist/commonjs/models/components/customersubscriptionproduct.js.map +1 -1
  79. package/dist/commonjs/models/components/discountproduct.d.ts +14 -3
  80. package/dist/commonjs/models/components/discountproduct.d.ts.map +1 -1
  81. package/dist/commonjs/models/components/discountproduct.js +11 -2
  82. package/dist/commonjs/models/components/discountproduct.js.map +1 -1
  83. package/dist/commonjs/models/components/orderproduct.d.ts +14 -3
  84. package/dist/commonjs/models/components/orderproduct.d.ts.map +1 -1
  85. package/dist/commonjs/models/components/orderproduct.js +11 -2
  86. package/dist/commonjs/models/components/orderproduct.js.map +1 -1
  87. package/dist/commonjs/models/components/ordersubscription.d.ts +10 -0
  88. package/dist/commonjs/models/components/ordersubscription.d.ts.map +1 -1
  89. package/dist/commonjs/models/components/ordersubscription.js +8 -0
  90. package/dist/commonjs/models/components/ordersubscription.js.map +1 -1
  91. package/dist/commonjs/models/components/product.d.ts +14 -3
  92. package/dist/commonjs/models/components/product.d.ts.map +1 -1
  93. package/dist/commonjs/models/components/product.js +11 -2
  94. package/dist/commonjs/models/components/product.js.map +1 -1
  95. package/dist/commonjs/models/components/productcreate.d.ts +4 -111
  96. package/dist/commonjs/models/components/productcreate.d.ts.map +1 -1
  97. package/dist/commonjs/models/components/productcreate.js +9 -106
  98. package/dist/commonjs/models/components/productcreate.js.map +1 -1
  99. package/dist/commonjs/models/components/productcreateonetime.d.ts +130 -0
  100. package/dist/commonjs/models/components/productcreateonetime.d.ts.map +1 -0
  101. package/dist/commonjs/models/components/productcreateonetime.js +169 -0
  102. package/dist/commonjs/models/components/productcreateonetime.js.map +1 -0
  103. package/dist/commonjs/models/components/productcreaterecurring.d.ts +139 -0
  104. package/dist/commonjs/models/components/productcreaterecurring.d.ts.map +1 -0
  105. package/dist/commonjs/models/components/productcreaterecurring.js +179 -0
  106. package/dist/commonjs/models/components/productcreaterecurring.js.map +1 -0
  107. package/dist/commonjs/models/components/productupdate.d.ts +11 -0
  108. package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
  109. package/dist/commonjs/models/components/productupdate.js +9 -0
  110. package/dist/commonjs/models/components/productupdate.js.map +1 -1
  111. package/dist/commonjs/models/components/subscription.d.ts +10 -0
  112. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  113. package/dist/commonjs/models/components/subscription.js +8 -0
  114. package/dist/commonjs/models/components/subscription.js.map +1 -1
  115. package/dist/commonjs/models/components/subscriptionupdate.d.ts +3 -2
  116. package/dist/commonjs/models/components/subscriptionupdate.d.ts.map +1 -1
  117. package/dist/commonjs/models/components/subscriptionupdate.js +3 -0
  118. package/dist/commonjs/models/components/subscriptionupdate.js.map +1 -1
  119. package/dist/commonjs/models/components/subscriptionupdatetrial.d.ts +32 -0
  120. package/dist/commonjs/models/components/subscriptionupdatetrial.d.ts.map +1 -0
  121. package/dist/commonjs/models/components/subscriptionupdatetrial.js +78 -0
  122. package/dist/commonjs/models/components/subscriptionupdatetrial.js.map +1 -0
  123. package/dist/commonjs/models/components/trialinterval.d.ts +34 -0
  124. package/dist/commonjs/models/components/trialinterval.d.ts.map +1 -0
  125. package/dist/commonjs/models/components/trialinterval.js +62 -0
  126. package/dist/commonjs/models/components/trialinterval.js.map +1 -0
  127. package/dist/esm/lib/config.d.ts +2 -2
  128. package/dist/esm/lib/config.js +2 -2
  129. package/dist/esm/mcp-server/mcp-server.js +1 -1
  130. package/dist/esm/mcp-server/server.js +1 -1
  131. package/dist/esm/models/components/address.d.ts +687 -687
  132. package/dist/esm/models/components/address.js +222 -222
  133. package/dist/esm/models/components/addressinput.d.ts +683 -683
  134. package/dist/esm/models/components/addressinput.js +217 -217
  135. package/dist/esm/models/components/checkout.d.ts +31 -5
  136. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  137. package/dist/esm/models/components/checkout.js +23 -2
  138. package/dist/esm/models/components/checkout.js.map +1 -1
  139. package/dist/esm/models/components/checkoutcreate.d.ts +11 -0
  140. package/dist/esm/models/components/checkoutcreate.d.ts.map +1 -1
  141. package/dist/esm/models/components/checkoutcreate.js +9 -0
  142. package/dist/esm/models/components/checkoutcreate.js.map +1 -1
  143. package/dist/esm/models/components/checkoutlink.d.ts +14 -3
  144. package/dist/esm/models/components/checkoutlink.d.ts.map +1 -1
  145. package/dist/esm/models/components/checkoutlink.js +11 -2
  146. package/dist/esm/models/components/checkoutlink.js.map +1 -1
  147. package/dist/esm/models/components/checkoutlinkcreateproduct.d.ts +11 -0
  148. package/dist/esm/models/components/checkoutlinkcreateproduct.d.ts.map +1 -1
  149. package/dist/esm/models/components/checkoutlinkcreateproduct.js +9 -0
  150. package/dist/esm/models/components/checkoutlinkcreateproduct.js.map +1 -1
  151. package/dist/esm/models/components/checkoutlinkcreateproductprice.d.ts +11 -0
  152. package/dist/esm/models/components/checkoutlinkcreateproductprice.d.ts.map +1 -1
  153. package/dist/esm/models/components/checkoutlinkcreateproductprice.js +9 -0
  154. package/dist/esm/models/components/checkoutlinkcreateproductprice.js.map +1 -1
  155. package/dist/esm/models/components/checkoutlinkcreateproducts.d.ts +11 -0
  156. package/dist/esm/models/components/checkoutlinkcreateproducts.d.ts.map +1 -1
  157. package/dist/esm/models/components/checkoutlinkcreateproducts.js +9 -0
  158. package/dist/esm/models/components/checkoutlinkcreateproducts.js.map +1 -1
  159. package/dist/esm/models/components/checkoutlinkproduct.d.ts +14 -3
  160. package/dist/esm/models/components/checkoutlinkproduct.d.ts.map +1 -1
  161. package/dist/esm/models/components/checkoutlinkproduct.js +11 -2
  162. package/dist/esm/models/components/checkoutlinkproduct.js.map +1 -1
  163. package/dist/esm/models/components/checkoutlinkupdate.d.ts +11 -0
  164. package/dist/esm/models/components/checkoutlinkupdate.d.ts.map +1 -1
  165. package/dist/esm/models/components/checkoutlinkupdate.js +9 -0
  166. package/dist/esm/models/components/checkoutlinkupdate.js.map +1 -1
  167. package/dist/esm/models/components/checkoutproduct.d.ts +14 -3
  168. package/dist/esm/models/components/checkoutproduct.d.ts.map +1 -1
  169. package/dist/esm/models/components/checkoutproduct.js +11 -2
  170. package/dist/esm/models/components/checkoutproduct.js.map +1 -1
  171. package/dist/esm/models/components/checkoutpublic.d.ts +21 -5
  172. package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
  173. package/dist/esm/models/components/checkoutpublic.js +15 -2
  174. package/dist/esm/models/components/checkoutpublic.js.map +1 -1
  175. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +21 -5
  176. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  177. package/dist/esm/models/components/checkoutpublicconfirmed.js +15 -2
  178. package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
  179. package/dist/esm/models/components/checkoutupdate.d.ts +11 -0
  180. package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
  181. package/dist/esm/models/components/checkoutupdate.js +9 -0
  182. package/dist/esm/models/components/checkoutupdate.js.map +1 -1
  183. package/dist/esm/models/components/customerorderproduct.d.ts +14 -3
  184. package/dist/esm/models/components/customerorderproduct.d.ts.map +1 -1
  185. package/dist/esm/models/components/customerorderproduct.js +11 -2
  186. package/dist/esm/models/components/customerorderproduct.js.map +1 -1
  187. package/dist/esm/models/components/customerordersubscription.d.ts +10 -0
  188. package/dist/esm/models/components/customerordersubscription.d.ts.map +1 -1
  189. package/dist/esm/models/components/customerordersubscription.js +8 -0
  190. package/dist/esm/models/components/customerordersubscription.js.map +1 -1
  191. package/dist/esm/models/components/customerproduct.d.ts +14 -3
  192. package/dist/esm/models/components/customerproduct.d.ts.map +1 -1
  193. package/dist/esm/models/components/customerproduct.js +11 -2
  194. package/dist/esm/models/components/customerproduct.js.map +1 -1
  195. package/dist/esm/models/components/customersubscription.d.ts +10 -0
  196. package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
  197. package/dist/esm/models/components/customersubscription.js +8 -0
  198. package/dist/esm/models/components/customersubscription.js.map +1 -1
  199. package/dist/esm/models/components/customersubscriptionproduct.d.ts +14 -3
  200. package/dist/esm/models/components/customersubscriptionproduct.d.ts.map +1 -1
  201. package/dist/esm/models/components/customersubscriptionproduct.js +11 -2
  202. package/dist/esm/models/components/customersubscriptionproduct.js.map +1 -1
  203. package/dist/esm/models/components/discountproduct.d.ts +14 -3
  204. package/dist/esm/models/components/discountproduct.d.ts.map +1 -1
  205. package/dist/esm/models/components/discountproduct.js +11 -2
  206. package/dist/esm/models/components/discountproduct.js.map +1 -1
  207. package/dist/esm/models/components/orderproduct.d.ts +14 -3
  208. package/dist/esm/models/components/orderproduct.d.ts.map +1 -1
  209. package/dist/esm/models/components/orderproduct.js +11 -2
  210. package/dist/esm/models/components/orderproduct.js.map +1 -1
  211. package/dist/esm/models/components/ordersubscription.d.ts +10 -0
  212. package/dist/esm/models/components/ordersubscription.d.ts.map +1 -1
  213. package/dist/esm/models/components/ordersubscription.js +8 -0
  214. package/dist/esm/models/components/ordersubscription.js.map +1 -1
  215. package/dist/esm/models/components/product.d.ts +14 -3
  216. package/dist/esm/models/components/product.d.ts.map +1 -1
  217. package/dist/esm/models/components/product.js +11 -2
  218. package/dist/esm/models/components/product.js.map +1 -1
  219. package/dist/esm/models/components/productcreate.d.ts +4 -111
  220. package/dist/esm/models/components/productcreate.d.ts.map +1 -1
  221. package/dist/esm/models/components/productcreate.js +8 -101
  222. package/dist/esm/models/components/productcreate.js.map +1 -1
  223. package/dist/esm/models/components/productcreateonetime.d.ts +130 -0
  224. package/dist/esm/models/components/productcreateonetime.d.ts.map +1 -0
  225. package/dist/esm/models/components/productcreateonetime.js +127 -0
  226. package/dist/esm/models/components/productcreateonetime.js.map +1 -0
  227. package/dist/esm/models/components/productcreaterecurring.d.ts +139 -0
  228. package/dist/esm/models/components/productcreaterecurring.d.ts.map +1 -0
  229. package/dist/esm/models/components/productcreaterecurring.js +137 -0
  230. package/dist/esm/models/components/productcreaterecurring.js.map +1 -0
  231. package/dist/esm/models/components/productupdate.d.ts +11 -0
  232. package/dist/esm/models/components/productupdate.d.ts.map +1 -1
  233. package/dist/esm/models/components/productupdate.js +9 -0
  234. package/dist/esm/models/components/productupdate.js.map +1 -1
  235. package/dist/esm/models/components/subscription.d.ts +10 -0
  236. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  237. package/dist/esm/models/components/subscription.js +8 -0
  238. package/dist/esm/models/components/subscription.js.map +1 -1
  239. package/dist/esm/models/components/subscriptionupdate.d.ts +3 -2
  240. package/dist/esm/models/components/subscriptionupdate.d.ts.map +1 -1
  241. package/dist/esm/models/components/subscriptionupdate.js +3 -0
  242. package/dist/esm/models/components/subscriptionupdate.js.map +1 -1
  243. package/dist/esm/models/components/subscriptionupdatetrial.d.ts +32 -0
  244. package/dist/esm/models/components/subscriptionupdatetrial.d.ts.map +1 -0
  245. package/dist/esm/models/components/subscriptionupdatetrial.js +40 -0
  246. package/dist/esm/models/components/subscriptionupdatetrial.js.map +1 -0
  247. package/dist/esm/models/components/trialinterval.d.ts +34 -0
  248. package/dist/esm/models/components/trialinterval.d.ts.map +1 -0
  249. package/dist/esm/models/components/trialinterval.js +26 -0
  250. package/dist/esm/models/components/trialinterval.js.map +1 -0
  251. package/docs/sdks/products/README.md +2 -2
  252. package/examples/package-lock.json +1 -1
  253. package/jsr.json +1 -1
  254. package/package.json +1 -1
  255. package/src/lib/config.ts +2 -2
  256. package/src/mcp-server/mcp-server.ts +1 -1
  257. package/src/mcp-server/server.ts +1 -1
  258. package/src/models/components/address.ts +222 -222
  259. package/src/models/components/addressinput.ts +217 -217
  260. package/src/models/components/checkout.ts +59 -7
  261. package/src/models/components/checkoutcreate.ts +23 -0
  262. package/src/models/components/checkoutlink.ts +28 -5
  263. package/src/models/components/checkoutlinkcreateproduct.ts +23 -0
  264. package/src/models/components/checkoutlinkcreateproductprice.ts +23 -0
  265. package/src/models/components/checkoutlinkcreateproducts.ts +23 -0
  266. package/src/models/components/checkoutlinkproduct.ts +28 -5
  267. package/src/models/components/checkoutlinkupdate.ts +23 -0
  268. package/src/models/components/checkoutproduct.ts +28 -5
  269. package/src/models/components/checkoutpublic.ts +41 -7
  270. package/src/models/components/checkoutpublicconfirmed.ts +41 -7
  271. package/src/models/components/checkoutupdate.ts +23 -0
  272. package/src/models/components/customerorderproduct.ts +28 -5
  273. package/src/models/components/customerordersubscription.ts +22 -0
  274. package/src/models/components/customerproduct.ts +28 -5
  275. package/src/models/components/customersubscription.ts +22 -0
  276. package/src/models/components/customersubscriptionproduct.ts +28 -5
  277. package/src/models/components/discountproduct.ts +28 -5
  278. package/src/models/components/orderproduct.ts +28 -5
  279. package/src/models/components/ordersubscription.ts +22 -0
  280. package/src/models/components/product.ts +28 -5
  281. package/src/models/components/productcreate.ts +22 -275
  282. package/src/models/components/productcreateonetime.ts +329 -0
  283. package/src/models/components/productcreaterecurring.ts +356 -0
  284. package/src/models/components/productupdate.ts +23 -0
  285. package/src/models/components/subscription.ts +22 -0
  286. package/src/models/components/subscriptionupdate.ts +10 -0
  287. package/src/models/components/subscriptionupdatetrial.ts +78 -0
  288. package/src/models/components/trialinterval.ts +35 -0
@@ -3,301 +3,48 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
9
  import {
11
- AttachedCustomFieldCreate,
12
- AttachedCustomFieldCreate$inboundSchema,
13
- AttachedCustomFieldCreate$Outbound,
14
- AttachedCustomFieldCreate$outboundSchema,
15
- } from "./attachedcustomfieldcreate.js";
10
+ ProductCreateOneTime,
11
+ ProductCreateOneTime$inboundSchema,
12
+ ProductCreateOneTime$Outbound,
13
+ ProductCreateOneTime$outboundSchema,
14
+ } from "./productcreateonetime.js";
16
15
  import {
17
- ProductPriceCustomCreate,
18
- ProductPriceCustomCreate$inboundSchema,
19
- ProductPriceCustomCreate$Outbound,
20
- ProductPriceCustomCreate$outboundSchema,
21
- } from "./productpricecustomcreate.js";
22
- import {
23
- ProductPriceFixedCreate,
24
- ProductPriceFixedCreate$inboundSchema,
25
- ProductPriceFixedCreate$Outbound,
26
- ProductPriceFixedCreate$outboundSchema,
27
- } from "./productpricefixedcreate.js";
28
- import {
29
- ProductPriceFreeCreate,
30
- ProductPriceFreeCreate$inboundSchema,
31
- ProductPriceFreeCreate$Outbound,
32
- ProductPriceFreeCreate$outboundSchema,
33
- } from "./productpricefreecreate.js";
34
- import {
35
- ProductPriceMeteredUnitCreate,
36
- ProductPriceMeteredUnitCreate$inboundSchema,
37
- ProductPriceMeteredUnitCreate$Outbound,
38
- ProductPriceMeteredUnitCreate$outboundSchema,
39
- } from "./productpricemeteredunitcreate.js";
40
- import {
41
- SubscriptionRecurringInterval,
42
- SubscriptionRecurringInterval$inboundSchema,
43
- SubscriptionRecurringInterval$outboundSchema,
44
- } from "./subscriptionrecurringinterval.js";
45
-
46
- export type ProductCreateMetadata = string | number | number | boolean;
47
-
48
- export type ProductCreatePrices =
49
- | ProductPriceMeteredUnitCreate
50
- | ProductPriceFixedCreate
51
- | ProductPriceCustomCreate
52
- | ProductPriceFreeCreate;
53
-
54
- /**
55
- * Schema to create a product.
56
- */
57
- export type ProductCreate = {
58
- /**
59
- * Key-value object allowing you to store additional information.
60
- *
61
- * @remarks
62
- *
63
- * The key must be a string with a maximum length of **40 characters**.
64
- * The value must be either:
65
- *
66
- * * A string with a maximum length of **500 characters**
67
- * * An integer
68
- * * A floating-point number
69
- * * A boolean
70
- *
71
- * You can store up to **50 key-value pairs**.
72
- */
73
- metadata?: { [k: string]: string | number | number | boolean } | undefined;
74
- /**
75
- * The name of the product.
76
- */
77
- name: string;
78
- /**
79
- * The description of the product.
80
- */
81
- description?: string | null | undefined;
82
- /**
83
- * The recurring interval of the product. If `None`, the product is a one-time purchase.Note that the `day` and `week` values are for internal Polar staff use only.
84
- */
85
- recurringInterval: SubscriptionRecurringInterval | null;
86
- /**
87
- * List of available prices for this product. It should contain at most one static price (fixed, custom or free), and any number of metered prices. Metered prices are not supported on one-time purchase products.
88
- */
89
- prices: Array<
90
- | ProductPriceMeteredUnitCreate
91
- | ProductPriceFixedCreate
92
- | ProductPriceCustomCreate
93
- | ProductPriceFreeCreate
94
- >;
95
- /**
96
- * List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded.
97
- */
98
- medias?: Array<string> | null | undefined;
99
- /**
100
- * List of custom fields to attach.
101
- */
102
- attachedCustomFields?: Array<AttachedCustomFieldCreate> | undefined;
103
- /**
104
- * The ID of the organization owning the product. **Required unless you use an organization token.**
105
- */
106
- organizationId?: string | null | undefined;
107
- };
108
-
109
- /** @internal */
110
- export const ProductCreateMetadata$inboundSchema: z.ZodType<
111
- ProductCreateMetadata,
112
- z.ZodTypeDef,
113
- unknown
114
- > = z.union([z.string(), z.number().int(), z.number(), z.boolean()]);
115
-
116
- /** @internal */
117
- export type ProductCreateMetadata$Outbound = string | number | number | boolean;
118
-
119
- /** @internal */
120
- export const ProductCreateMetadata$outboundSchema: z.ZodType<
121
- ProductCreateMetadata$Outbound,
122
- z.ZodTypeDef,
123
- ProductCreateMetadata
124
- > = z.union([z.string(), z.number().int(), z.number(), z.boolean()]);
125
-
126
- /**
127
- * @internal
128
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
129
- */
130
- export namespace ProductCreateMetadata$ {
131
- /** @deprecated use `ProductCreateMetadata$inboundSchema` instead. */
132
- export const inboundSchema = ProductCreateMetadata$inboundSchema;
133
- /** @deprecated use `ProductCreateMetadata$outboundSchema` instead. */
134
- export const outboundSchema = ProductCreateMetadata$outboundSchema;
135
- /** @deprecated use `ProductCreateMetadata$Outbound` instead. */
136
- export type Outbound = ProductCreateMetadata$Outbound;
137
- }
138
-
139
- export function productCreateMetadataToJSON(
140
- productCreateMetadata: ProductCreateMetadata,
141
- ): string {
142
- return JSON.stringify(
143
- ProductCreateMetadata$outboundSchema.parse(productCreateMetadata),
144
- );
145
- }
146
-
147
- export function productCreateMetadataFromJSON(
148
- jsonString: string,
149
- ): SafeParseResult<ProductCreateMetadata, SDKValidationError> {
150
- return safeParse(
151
- jsonString,
152
- (x) => ProductCreateMetadata$inboundSchema.parse(JSON.parse(x)),
153
- `Failed to parse 'ProductCreateMetadata' from JSON`,
154
- );
155
- }
156
-
157
- /** @internal */
158
- export const ProductCreatePrices$inboundSchema: z.ZodType<
159
- ProductCreatePrices,
160
- z.ZodTypeDef,
161
- unknown
162
- > = z.union([
163
- ProductPriceMeteredUnitCreate$inboundSchema,
164
- ProductPriceFixedCreate$inboundSchema,
165
- ProductPriceCustomCreate$inboundSchema,
166
- ProductPriceFreeCreate$inboundSchema,
167
- ]);
168
-
169
- /** @internal */
170
- export type ProductCreatePrices$Outbound =
171
- | ProductPriceMeteredUnitCreate$Outbound
172
- | ProductPriceFixedCreate$Outbound
173
- | ProductPriceCustomCreate$Outbound
174
- | ProductPriceFreeCreate$Outbound;
175
-
176
- /** @internal */
177
- export const ProductCreatePrices$outboundSchema: z.ZodType<
178
- ProductCreatePrices$Outbound,
179
- z.ZodTypeDef,
180
- ProductCreatePrices
181
- > = z.union([
182
- ProductPriceMeteredUnitCreate$outboundSchema,
183
- ProductPriceFixedCreate$outboundSchema,
184
- ProductPriceCustomCreate$outboundSchema,
185
- ProductPriceFreeCreate$outboundSchema,
186
- ]);
187
-
188
- /**
189
- * @internal
190
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
191
- */
192
- export namespace ProductCreatePrices$ {
193
- /** @deprecated use `ProductCreatePrices$inboundSchema` instead. */
194
- export const inboundSchema = ProductCreatePrices$inboundSchema;
195
- /** @deprecated use `ProductCreatePrices$outboundSchema` instead. */
196
- export const outboundSchema = ProductCreatePrices$outboundSchema;
197
- /** @deprecated use `ProductCreatePrices$Outbound` instead. */
198
- export type Outbound = ProductCreatePrices$Outbound;
199
- }
16
+ ProductCreateRecurring,
17
+ ProductCreateRecurring$inboundSchema,
18
+ ProductCreateRecurring$Outbound,
19
+ ProductCreateRecurring$outboundSchema,
20
+ } from "./productcreaterecurring.js";
200
21
 
201
- export function productCreatePricesToJSON(
202
- productCreatePrices: ProductCreatePrices,
203
- ): string {
204
- return JSON.stringify(
205
- ProductCreatePrices$outboundSchema.parse(productCreatePrices),
206
- );
207
- }
208
-
209
- export function productCreatePricesFromJSON(
210
- jsonString: string,
211
- ): SafeParseResult<ProductCreatePrices, SDKValidationError> {
212
- return safeParse(
213
- jsonString,
214
- (x) => ProductCreatePrices$inboundSchema.parse(JSON.parse(x)),
215
- `Failed to parse 'ProductCreatePrices' from JSON`,
216
- );
217
- }
22
+ export type ProductCreate = ProductCreateRecurring | ProductCreateOneTime;
218
23
 
219
24
  /** @internal */
220
25
  export const ProductCreate$inboundSchema: z.ZodType<
221
26
  ProductCreate,
222
27
  z.ZodTypeDef,
223
28
  unknown
224
- > = z.object({
225
- metadata: z.record(
226
- z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
227
- ).optional(),
228
- name: z.string(),
229
- description: z.nullable(z.string()).optional(),
230
- recurring_interval: z.nullable(SubscriptionRecurringInterval$inboundSchema),
231
- prices: z.array(
232
- z.union([
233
- ProductPriceMeteredUnitCreate$inboundSchema,
234
- ProductPriceFixedCreate$inboundSchema,
235
- ProductPriceCustomCreate$inboundSchema,
236
- ProductPriceFreeCreate$inboundSchema,
237
- ]),
238
- ),
239
- medias: z.nullable(z.array(z.string())).optional(),
240
- attached_custom_fields: z.array(AttachedCustomFieldCreate$inboundSchema)
241
- .optional(),
242
- organization_id: z.nullable(z.string()).optional(),
243
- }).transform((v) => {
244
- return remap$(v, {
245
- "recurring_interval": "recurringInterval",
246
- "attached_custom_fields": "attachedCustomFields",
247
- "organization_id": "organizationId",
248
- });
249
- });
29
+ > = z.union([
30
+ ProductCreateRecurring$inboundSchema,
31
+ ProductCreateOneTime$inboundSchema,
32
+ ]);
250
33
 
251
34
  /** @internal */
252
- export type ProductCreate$Outbound = {
253
- metadata?: { [k: string]: string | number | number | boolean } | undefined;
254
- name: string;
255
- description?: string | null | undefined;
256
- recurring_interval: string | null;
257
- prices: Array<
258
- | ProductPriceMeteredUnitCreate$Outbound
259
- | ProductPriceFixedCreate$Outbound
260
- | ProductPriceCustomCreate$Outbound
261
- | ProductPriceFreeCreate$Outbound
262
- >;
263
- medias?: Array<string> | null | undefined;
264
- attached_custom_fields?:
265
- | Array<AttachedCustomFieldCreate$Outbound>
266
- | undefined;
267
- organization_id?: string | null | undefined;
268
- };
35
+ export type ProductCreate$Outbound =
36
+ | ProductCreateRecurring$Outbound
37
+ | ProductCreateOneTime$Outbound;
269
38
 
270
39
  /** @internal */
271
40
  export const ProductCreate$outboundSchema: z.ZodType<
272
41
  ProductCreate$Outbound,
273
42
  z.ZodTypeDef,
274
43
  ProductCreate
275
- > = z.object({
276
- metadata: z.record(
277
- z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
278
- ).optional(),
279
- name: z.string(),
280
- description: z.nullable(z.string()).optional(),
281
- recurringInterval: z.nullable(SubscriptionRecurringInterval$outboundSchema),
282
- prices: z.array(
283
- z.union([
284
- ProductPriceMeteredUnitCreate$outboundSchema,
285
- ProductPriceFixedCreate$outboundSchema,
286
- ProductPriceCustomCreate$outboundSchema,
287
- ProductPriceFreeCreate$outboundSchema,
288
- ]),
289
- ),
290
- medias: z.nullable(z.array(z.string())).optional(),
291
- attachedCustomFields: z.array(AttachedCustomFieldCreate$outboundSchema)
292
- .optional(),
293
- organizationId: z.nullable(z.string()).optional(),
294
- }).transform((v) => {
295
- return remap$(v, {
296
- recurringInterval: "recurring_interval",
297
- attachedCustomFields: "attached_custom_fields",
298
- organizationId: "organization_id",
299
- });
300
- });
44
+ > = z.union([
45
+ ProductCreateRecurring$outboundSchema,
46
+ ProductCreateOneTime$outboundSchema,
47
+ ]);
301
48
 
302
49
  /**
303
50
  * @internal
@@ -0,0 +1,329 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ AttachedCustomFieldCreate,
12
+ AttachedCustomFieldCreate$inboundSchema,
13
+ AttachedCustomFieldCreate$Outbound,
14
+ AttachedCustomFieldCreate$outboundSchema,
15
+ } from "./attachedcustomfieldcreate.js";
16
+ import {
17
+ ProductPriceCustomCreate,
18
+ ProductPriceCustomCreate$inboundSchema,
19
+ ProductPriceCustomCreate$Outbound,
20
+ ProductPriceCustomCreate$outboundSchema,
21
+ } from "./productpricecustomcreate.js";
22
+ import {
23
+ ProductPriceFixedCreate,
24
+ ProductPriceFixedCreate$inboundSchema,
25
+ ProductPriceFixedCreate$Outbound,
26
+ ProductPriceFixedCreate$outboundSchema,
27
+ } from "./productpricefixedcreate.js";
28
+ import {
29
+ ProductPriceFreeCreate,
30
+ ProductPriceFreeCreate$inboundSchema,
31
+ ProductPriceFreeCreate$Outbound,
32
+ ProductPriceFreeCreate$outboundSchema,
33
+ } from "./productpricefreecreate.js";
34
+ import {
35
+ ProductPriceMeteredUnitCreate,
36
+ ProductPriceMeteredUnitCreate$inboundSchema,
37
+ ProductPriceMeteredUnitCreate$Outbound,
38
+ ProductPriceMeteredUnitCreate$outboundSchema,
39
+ } from "./productpricemeteredunitcreate.js";
40
+
41
+ export type ProductCreateOneTimeMetadata = string | number | number | boolean;
42
+
43
+ export type ProductCreateOneTimePrices =
44
+ | ProductPriceMeteredUnitCreate
45
+ | ProductPriceFixedCreate
46
+ | ProductPriceCustomCreate
47
+ | ProductPriceFreeCreate;
48
+
49
+ export type ProductCreateOneTime = {
50
+ /**
51
+ * Key-value object allowing you to store additional information.
52
+ *
53
+ * @remarks
54
+ *
55
+ * The key must be a string with a maximum length of **40 characters**.
56
+ * The value must be either:
57
+ *
58
+ * * A string with a maximum length of **500 characters**
59
+ * * An integer
60
+ * * A floating-point number
61
+ * * A boolean
62
+ *
63
+ * You can store up to **50 key-value pairs**.
64
+ */
65
+ metadata?: { [k: string]: string | number | number | boolean } | undefined;
66
+ /**
67
+ * The name of the product.
68
+ */
69
+ name: string;
70
+ /**
71
+ * The description of the product.
72
+ */
73
+ description?: string | null | undefined;
74
+ /**
75
+ * List of available prices for this product. It should contain at most one static price (fixed, custom or free), and any number of metered prices. Metered prices are not supported on one-time purchase products.
76
+ */
77
+ prices: Array<
78
+ | ProductPriceMeteredUnitCreate
79
+ | ProductPriceFixedCreate
80
+ | ProductPriceCustomCreate
81
+ | ProductPriceFreeCreate
82
+ >;
83
+ /**
84
+ * List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded.
85
+ */
86
+ medias?: Array<string> | null | undefined;
87
+ /**
88
+ * List of custom fields to attach.
89
+ */
90
+ attachedCustomFields?: Array<AttachedCustomFieldCreate> | undefined;
91
+ /**
92
+ * The ID of the organization owning the product. **Required unless you use an organization token.**
93
+ */
94
+ organizationId?: string | null | undefined;
95
+ /**
96
+ * States that the product is a one-time purchase.
97
+ */
98
+ recurringInterval?: any | null | undefined;
99
+ };
100
+
101
+ /** @internal */
102
+ export const ProductCreateOneTimeMetadata$inboundSchema: z.ZodType<
103
+ ProductCreateOneTimeMetadata,
104
+ z.ZodTypeDef,
105
+ unknown
106
+ > = z.union([z.string(), z.number().int(), z.number(), z.boolean()]);
107
+
108
+ /** @internal */
109
+ export type ProductCreateOneTimeMetadata$Outbound =
110
+ | string
111
+ | number
112
+ | number
113
+ | boolean;
114
+
115
+ /** @internal */
116
+ export const ProductCreateOneTimeMetadata$outboundSchema: z.ZodType<
117
+ ProductCreateOneTimeMetadata$Outbound,
118
+ z.ZodTypeDef,
119
+ ProductCreateOneTimeMetadata
120
+ > = z.union([z.string(), z.number().int(), z.number(), z.boolean()]);
121
+
122
+ /**
123
+ * @internal
124
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
125
+ */
126
+ export namespace ProductCreateOneTimeMetadata$ {
127
+ /** @deprecated use `ProductCreateOneTimeMetadata$inboundSchema` instead. */
128
+ export const inboundSchema = ProductCreateOneTimeMetadata$inboundSchema;
129
+ /** @deprecated use `ProductCreateOneTimeMetadata$outboundSchema` instead. */
130
+ export const outboundSchema = ProductCreateOneTimeMetadata$outboundSchema;
131
+ /** @deprecated use `ProductCreateOneTimeMetadata$Outbound` instead. */
132
+ export type Outbound = ProductCreateOneTimeMetadata$Outbound;
133
+ }
134
+
135
+ export function productCreateOneTimeMetadataToJSON(
136
+ productCreateOneTimeMetadata: ProductCreateOneTimeMetadata,
137
+ ): string {
138
+ return JSON.stringify(
139
+ ProductCreateOneTimeMetadata$outboundSchema.parse(
140
+ productCreateOneTimeMetadata,
141
+ ),
142
+ );
143
+ }
144
+
145
+ export function productCreateOneTimeMetadataFromJSON(
146
+ jsonString: string,
147
+ ): SafeParseResult<ProductCreateOneTimeMetadata, SDKValidationError> {
148
+ return safeParse(
149
+ jsonString,
150
+ (x) => ProductCreateOneTimeMetadata$inboundSchema.parse(JSON.parse(x)),
151
+ `Failed to parse 'ProductCreateOneTimeMetadata' from JSON`,
152
+ );
153
+ }
154
+
155
+ /** @internal */
156
+ export const ProductCreateOneTimePrices$inboundSchema: z.ZodType<
157
+ ProductCreateOneTimePrices,
158
+ z.ZodTypeDef,
159
+ unknown
160
+ > = z.union([
161
+ ProductPriceMeteredUnitCreate$inboundSchema,
162
+ ProductPriceFixedCreate$inboundSchema,
163
+ ProductPriceCustomCreate$inboundSchema,
164
+ ProductPriceFreeCreate$inboundSchema,
165
+ ]);
166
+
167
+ /** @internal */
168
+ export type ProductCreateOneTimePrices$Outbound =
169
+ | ProductPriceMeteredUnitCreate$Outbound
170
+ | ProductPriceFixedCreate$Outbound
171
+ | ProductPriceCustomCreate$Outbound
172
+ | ProductPriceFreeCreate$Outbound;
173
+
174
+ /** @internal */
175
+ export const ProductCreateOneTimePrices$outboundSchema: z.ZodType<
176
+ ProductCreateOneTimePrices$Outbound,
177
+ z.ZodTypeDef,
178
+ ProductCreateOneTimePrices
179
+ > = z.union([
180
+ ProductPriceMeteredUnitCreate$outboundSchema,
181
+ ProductPriceFixedCreate$outboundSchema,
182
+ ProductPriceCustomCreate$outboundSchema,
183
+ ProductPriceFreeCreate$outboundSchema,
184
+ ]);
185
+
186
+ /**
187
+ * @internal
188
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
189
+ */
190
+ export namespace ProductCreateOneTimePrices$ {
191
+ /** @deprecated use `ProductCreateOneTimePrices$inboundSchema` instead. */
192
+ export const inboundSchema = ProductCreateOneTimePrices$inboundSchema;
193
+ /** @deprecated use `ProductCreateOneTimePrices$outboundSchema` instead. */
194
+ export const outboundSchema = ProductCreateOneTimePrices$outboundSchema;
195
+ /** @deprecated use `ProductCreateOneTimePrices$Outbound` instead. */
196
+ export type Outbound = ProductCreateOneTimePrices$Outbound;
197
+ }
198
+
199
+ export function productCreateOneTimePricesToJSON(
200
+ productCreateOneTimePrices: ProductCreateOneTimePrices,
201
+ ): string {
202
+ return JSON.stringify(
203
+ ProductCreateOneTimePrices$outboundSchema.parse(productCreateOneTimePrices),
204
+ );
205
+ }
206
+
207
+ export function productCreateOneTimePricesFromJSON(
208
+ jsonString: string,
209
+ ): SafeParseResult<ProductCreateOneTimePrices, SDKValidationError> {
210
+ return safeParse(
211
+ jsonString,
212
+ (x) => ProductCreateOneTimePrices$inboundSchema.parse(JSON.parse(x)),
213
+ `Failed to parse 'ProductCreateOneTimePrices' from JSON`,
214
+ );
215
+ }
216
+
217
+ /** @internal */
218
+ export const ProductCreateOneTime$inboundSchema: z.ZodType<
219
+ ProductCreateOneTime,
220
+ z.ZodTypeDef,
221
+ unknown
222
+ > = z.object({
223
+ metadata: z.record(
224
+ z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
225
+ ).optional(),
226
+ name: z.string(),
227
+ description: z.nullable(z.string()).optional(),
228
+ prices: z.array(
229
+ z.union([
230
+ ProductPriceMeteredUnitCreate$inboundSchema,
231
+ ProductPriceFixedCreate$inboundSchema,
232
+ ProductPriceCustomCreate$inboundSchema,
233
+ ProductPriceFreeCreate$inboundSchema,
234
+ ]),
235
+ ),
236
+ medias: z.nullable(z.array(z.string())).optional(),
237
+ attached_custom_fields: z.array(AttachedCustomFieldCreate$inboundSchema)
238
+ .optional(),
239
+ organization_id: z.nullable(z.string()).optional(),
240
+ recurring_interval: z.nullable(z.any()).optional(),
241
+ }).transform((v) => {
242
+ return remap$(v, {
243
+ "attached_custom_fields": "attachedCustomFields",
244
+ "organization_id": "organizationId",
245
+ "recurring_interval": "recurringInterval",
246
+ });
247
+ });
248
+
249
+ /** @internal */
250
+ export type ProductCreateOneTime$Outbound = {
251
+ metadata?: { [k: string]: string | number | number | boolean } | undefined;
252
+ name: string;
253
+ description?: string | null | undefined;
254
+ prices: Array<
255
+ | ProductPriceMeteredUnitCreate$Outbound
256
+ | ProductPriceFixedCreate$Outbound
257
+ | ProductPriceCustomCreate$Outbound
258
+ | ProductPriceFreeCreate$Outbound
259
+ >;
260
+ medias?: Array<string> | null | undefined;
261
+ attached_custom_fields?:
262
+ | Array<AttachedCustomFieldCreate$Outbound>
263
+ | undefined;
264
+ organization_id?: string | null | undefined;
265
+ recurring_interval?: any | null | undefined;
266
+ };
267
+
268
+ /** @internal */
269
+ export const ProductCreateOneTime$outboundSchema: z.ZodType<
270
+ ProductCreateOneTime$Outbound,
271
+ z.ZodTypeDef,
272
+ ProductCreateOneTime
273
+ > = z.object({
274
+ metadata: z.record(
275
+ z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
276
+ ).optional(),
277
+ name: z.string(),
278
+ description: z.nullable(z.string()).optional(),
279
+ prices: z.array(
280
+ z.union([
281
+ ProductPriceMeteredUnitCreate$outboundSchema,
282
+ ProductPriceFixedCreate$outboundSchema,
283
+ ProductPriceCustomCreate$outboundSchema,
284
+ ProductPriceFreeCreate$outboundSchema,
285
+ ]),
286
+ ),
287
+ medias: z.nullable(z.array(z.string())).optional(),
288
+ attachedCustomFields: z.array(AttachedCustomFieldCreate$outboundSchema)
289
+ .optional(),
290
+ organizationId: z.nullable(z.string()).optional(),
291
+ recurringInterval: z.nullable(z.any()).optional(),
292
+ }).transform((v) => {
293
+ return remap$(v, {
294
+ attachedCustomFields: "attached_custom_fields",
295
+ organizationId: "organization_id",
296
+ recurringInterval: "recurring_interval",
297
+ });
298
+ });
299
+
300
+ /**
301
+ * @internal
302
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
303
+ */
304
+ export namespace ProductCreateOneTime$ {
305
+ /** @deprecated use `ProductCreateOneTime$inboundSchema` instead. */
306
+ export const inboundSchema = ProductCreateOneTime$inboundSchema;
307
+ /** @deprecated use `ProductCreateOneTime$outboundSchema` instead. */
308
+ export const outboundSchema = ProductCreateOneTime$outboundSchema;
309
+ /** @deprecated use `ProductCreateOneTime$Outbound` instead. */
310
+ export type Outbound = ProductCreateOneTime$Outbound;
311
+ }
312
+
313
+ export function productCreateOneTimeToJSON(
314
+ productCreateOneTime: ProductCreateOneTime,
315
+ ): string {
316
+ return JSON.stringify(
317
+ ProductCreateOneTime$outboundSchema.parse(productCreateOneTime),
318
+ );
319
+ }
320
+
321
+ export function productCreateOneTimeFromJSON(
322
+ jsonString: string,
323
+ ): SafeParseResult<ProductCreateOneTime, SDKValidationError> {
324
+ return safeParse(
325
+ jsonString,
326
+ (x) => ProductCreateOneTime$inboundSchema.parse(JSON.parse(x)),
327
+ `Failed to parse 'ProductCreateOneTime' from JSON`,
328
+ );
329
+ }