@polar-sh/sdk 0.35.2 → 0.35.4

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 (342) hide show
  1. package/README.md +25 -23
  2. package/bin/mcp-server.js +1078 -811
  3. package/bin/mcp-server.js.map +20 -14
  4. package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.d.ts +2 -2
  5. package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.js +2 -2
  7. package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.js.map +1 -1
  8. package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts +23 -0
  9. package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.js +126 -0
  11. package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.js.map +1 -0
  12. package/dist/commonjs/funcs/customersGetBalance.d.ts +22 -0
  13. package/dist/commonjs/funcs/customersGetBalance.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/customersGetBalance.js +127 -0
  15. package/dist/commonjs/funcs/customersGetBalance.js.map +1 -0
  16. package/dist/commonjs/funcs/metersQuantities.js +1 -0
  17. package/dist/commonjs/funcs/metersQuantities.js.map +1 -1
  18. package/dist/commonjs/lib/config.d.ts +3 -3
  19. package/dist/commonjs/lib/config.js +3 -3
  20. package/dist/commonjs/lib/config.js.map +1 -1
  21. package/dist/commonjs/lib/url.js +1 -1
  22. package/dist/commonjs/lib/url.js.map +1 -1
  23. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  24. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  25. package/dist/commonjs/mcp-server/server.js +3 -1
  26. package/dist/commonjs/mcp-server/server.js.map +1 -1
  27. package/dist/commonjs/mcp-server/tools/customersGetBalance.d.ts +7 -0
  28. package/dist/commonjs/mcp-server/tools/customersGetBalance.d.ts.map +1 -0
  29. package/dist/commonjs/mcp-server/tools/customersGetBalance.js +34 -0
  30. package/dist/commonjs/mcp-server/tools/customersGetBalance.js.map +1 -0
  31. package/dist/commonjs/models/components/address.d.ts +669 -669
  32. package/dist/commonjs/models/components/address.js +223 -223
  33. package/dist/commonjs/models/components/addressinput.d.ts +652 -652
  34. package/dist/commonjs/models/components/addressinput.js +218 -218
  35. package/dist/commonjs/models/components/aggregationfunction.d.ts +40 -0
  36. package/dist/commonjs/models/components/aggregationfunction.d.ts.map +1 -0
  37. package/dist/commonjs/models/components/aggregationfunction.js +64 -0
  38. package/dist/commonjs/models/components/aggregationfunction.js.map +1 -0
  39. package/dist/commonjs/models/components/checkout.d.ts +5 -0
  40. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  41. package/dist/commonjs/models/components/checkout.js +2 -0
  42. package/dist/commonjs/models/components/checkout.js.map +1 -1
  43. package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts +5 -0
  44. package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts.map +1 -1
  45. package/dist/commonjs/models/components/checkoutconfirmstripe.js +2 -0
  46. package/dist/commonjs/models/components/checkoutconfirmstripe.js.map +1 -1
  47. package/dist/commonjs/models/components/checkoutcreate.d.ts +5 -0
  48. package/dist/commonjs/models/components/checkoutcreate.d.ts.map +1 -1
  49. package/dist/commonjs/models/components/checkoutcreate.js +2 -0
  50. package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
  51. package/dist/commonjs/models/components/checkoutpublic.d.ts +5 -0
  52. package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/checkoutpublic.js +2 -0
  54. package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
  55. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +5 -0
  56. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/checkoutpublicconfirmed.js +2 -0
  58. package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
  59. package/dist/commonjs/models/components/checkoutupdate.d.ts +5 -0
  60. package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
  61. package/dist/commonjs/models/components/checkoutupdate.js +2 -0
  62. package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
  63. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts +5 -0
  64. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts.map +1 -1
  65. package/dist/commonjs/models/components/checkoutupdatepublic.js +2 -0
  66. package/dist/commonjs/models/components/checkoutupdatepublic.js.map +1 -1
  67. package/dist/commonjs/models/components/customerbalance.d.ts +40 -0
  68. package/dist/commonjs/models/components/customerbalance.d.ts.map +1 -0
  69. package/dist/commonjs/models/components/customerbalance.js +71 -0
  70. package/dist/commonjs/models/components/customerbalance.js.map +1 -0
  71. package/dist/commonjs/models/components/customerorder.d.ts +5 -0
  72. package/dist/commonjs/models/components/customerorder.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/customerorder.js +4 -0
  74. package/dist/commonjs/models/components/customerorder.js.map +1 -1
  75. package/dist/commonjs/models/components/customerpaymentmethodconfirm.d.ts +31 -0
  76. package/dist/commonjs/models/components/customerpaymentmethodconfirm.d.ts.map +1 -0
  77. package/dist/commonjs/models/components/customerpaymentmethodconfirm.js +82 -0
  78. package/dist/commonjs/models/components/customerpaymentmethodconfirm.js.map +1 -0
  79. package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts +31 -0
  80. package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts.map +1 -0
  81. package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.js +80 -0
  82. package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.js.map +1 -0
  83. package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.d.ts +35 -0
  84. package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.d.ts.map +1 -0
  85. package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.js +81 -0
  86. package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.js.map +1 -0
  87. package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.d.ts +32 -0
  88. package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.d.ts.map +1 -0
  89. package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.js +81 -0
  90. package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.js.map +1 -0
  91. package/dist/commonjs/models/components/customersubscription.d.ts +5 -0
  92. package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
  93. package/dist/commonjs/models/components/customersubscription.js +4 -0
  94. package/dist/commonjs/models/components/customersubscription.js.map +1 -1
  95. package/dist/commonjs/models/components/order.d.ts +5 -0
  96. package/dist/commonjs/models/components/order.d.ts.map +1 -1
  97. package/dist/commonjs/models/components/order.js +4 -0
  98. package/dist/commonjs/models/components/order.js.map +1 -1
  99. package/dist/commonjs/models/components/organizationfeaturesettings.d.ts +5 -0
  100. package/dist/commonjs/models/components/organizationfeaturesettings.d.ts.map +1 -1
  101. package/dist/commonjs/models/components/organizationfeaturesettings.js +4 -0
  102. package/dist/commonjs/models/components/organizationfeaturesettings.js.map +1 -1
  103. package/dist/commonjs/models/components/productcreateonetime.d.ts +5 -4
  104. package/dist/commonjs/models/components/productcreateonetime.d.ts.map +1 -1
  105. package/dist/commonjs/models/components/productcreateonetime.js +5 -0
  106. package/dist/commonjs/models/components/productcreateonetime.js.map +1 -1
  107. package/dist/commonjs/models/components/productcreaterecurring.d.ts +5 -4
  108. package/dist/commonjs/models/components/productcreaterecurring.d.ts.map +1 -1
  109. package/dist/commonjs/models/components/productcreaterecurring.js +5 -0
  110. package/dist/commonjs/models/components/productcreaterecurring.js.map +1 -1
  111. package/dist/commonjs/models/components/productprice.d.ts +5 -0
  112. package/dist/commonjs/models/components/productprice.d.ts.map +1 -1
  113. package/dist/commonjs/models/components/productprice.js +7 -0
  114. package/dist/commonjs/models/components/productprice.js.map +1 -1
  115. package/dist/commonjs/models/components/productpriceseatbased.d.ts +76 -0
  116. package/dist/commonjs/models/components/productpriceseatbased.d.ts.map +1 -0
  117. package/dist/commonjs/models/components/productpriceseatbased.js +112 -0
  118. package/dist/commonjs/models/components/productpriceseatbased.js.map +1 -0
  119. package/dist/commonjs/models/components/productpriceseatbasedcreate.d.ts +42 -0
  120. package/dist/commonjs/models/components/productpriceseatbasedcreate.d.ts.map +1 -0
  121. package/dist/commonjs/models/components/productpriceseatbasedcreate.js +86 -0
  122. package/dist/commonjs/models/components/productpriceseatbasedcreate.js.map +1 -0
  123. package/dist/commonjs/models/components/productupdate.d.ts +5 -4
  124. package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
  125. package/dist/commonjs/models/components/productupdate.js +5 -0
  126. package/dist/commonjs/models/components/productupdate.js.map +1 -1
  127. package/dist/commonjs/models/errors/customernotready.d.ts +39 -0
  128. package/dist/commonjs/models/errors/customernotready.d.ts.map +1 -0
  129. package/dist/commonjs/models/errors/customernotready.js +88 -0
  130. package/dist/commonjs/models/errors/customernotready.js.map +1 -0
  131. package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts +29 -0
  132. package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts.map +1 -0
  133. package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.js +78 -0
  134. package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.js.map +1 -0
  135. package/dist/commonjs/models/operations/customersgetbalance.d.ts +32 -0
  136. package/dist/commonjs/models/operations/customersgetbalance.d.ts.map +1 -0
  137. package/dist/commonjs/models/operations/customersgetbalance.js +69 -0
  138. package/dist/commonjs/models/operations/customersgetbalance.js.map +1 -0
  139. package/dist/commonjs/models/operations/metersquantities.d.ts +6 -0
  140. package/dist/commonjs/models/operations/metersquantities.d.ts.map +1 -1
  141. package/dist/commonjs/models/operations/metersquantities.js +7 -0
  142. package/dist/commonjs/models/operations/metersquantities.js.map +1 -1
  143. package/dist/commonjs/sdk/customers.d.ts +11 -0
  144. package/dist/commonjs/sdk/customers.d.ts.map +1 -1
  145. package/dist/commonjs/sdk/customers.js +12 -0
  146. package/dist/commonjs/sdk/customers.js.map +1 -1
  147. package/dist/commonjs/sdk/polarcustomers.d.ts +13 -2
  148. package/dist/commonjs/sdk/polarcustomers.d.ts.map +1 -1
  149. package/dist/commonjs/sdk/polarcustomers.js +12 -0
  150. package/dist/commonjs/sdk/polarcustomers.js.map +1 -1
  151. package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.d.ts +2 -2
  152. package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.d.ts.map +1 -1
  153. package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.js +2 -2
  154. package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.js.map +1 -1
  155. package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts +23 -0
  156. package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts.map +1 -0
  157. package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.js +90 -0
  158. package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.js.map +1 -0
  159. package/dist/esm/funcs/customersGetBalance.d.ts +22 -0
  160. package/dist/esm/funcs/customersGetBalance.d.ts.map +1 -0
  161. package/dist/esm/funcs/customersGetBalance.js +91 -0
  162. package/dist/esm/funcs/customersGetBalance.js.map +1 -0
  163. package/dist/esm/funcs/metersQuantities.js +1 -0
  164. package/dist/esm/funcs/metersQuantities.js.map +1 -1
  165. package/dist/esm/lib/config.d.ts +3 -3
  166. package/dist/esm/lib/config.js +3 -3
  167. package/dist/esm/lib/config.js.map +1 -1
  168. package/dist/esm/lib/url.js +1 -1
  169. package/dist/esm/lib/url.js.map +1 -1
  170. package/dist/esm/mcp-server/mcp-server.js +1 -1
  171. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  172. package/dist/esm/mcp-server/server.js +3 -1
  173. package/dist/esm/mcp-server/server.js.map +1 -1
  174. package/dist/esm/mcp-server/tools/customersGetBalance.d.ts +7 -0
  175. package/dist/esm/mcp-server/tools/customersGetBalance.d.ts.map +1 -0
  176. package/dist/esm/mcp-server/tools/customersGetBalance.js +31 -0
  177. package/dist/esm/mcp-server/tools/customersGetBalance.js.map +1 -0
  178. package/dist/esm/models/components/address.d.ts +669 -669
  179. package/dist/esm/models/components/address.js +223 -223
  180. package/dist/esm/models/components/addressinput.d.ts +652 -652
  181. package/dist/esm/models/components/addressinput.js +218 -218
  182. package/dist/esm/models/components/aggregationfunction.d.ts +40 -0
  183. package/dist/esm/models/components/aggregationfunction.d.ts.map +1 -0
  184. package/dist/esm/models/components/aggregationfunction.js +28 -0
  185. package/dist/esm/models/components/aggregationfunction.js.map +1 -0
  186. package/dist/esm/models/components/checkout.d.ts +5 -0
  187. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  188. package/dist/esm/models/components/checkout.js +2 -0
  189. package/dist/esm/models/components/checkout.js.map +1 -1
  190. package/dist/esm/models/components/checkoutconfirmstripe.d.ts +5 -0
  191. package/dist/esm/models/components/checkoutconfirmstripe.d.ts.map +1 -1
  192. package/dist/esm/models/components/checkoutconfirmstripe.js +2 -0
  193. package/dist/esm/models/components/checkoutconfirmstripe.js.map +1 -1
  194. package/dist/esm/models/components/checkoutcreate.d.ts +5 -0
  195. package/dist/esm/models/components/checkoutcreate.d.ts.map +1 -1
  196. package/dist/esm/models/components/checkoutcreate.js +2 -0
  197. package/dist/esm/models/components/checkoutcreate.js.map +1 -1
  198. package/dist/esm/models/components/checkoutpublic.d.ts +5 -0
  199. package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
  200. package/dist/esm/models/components/checkoutpublic.js +2 -0
  201. package/dist/esm/models/components/checkoutpublic.js.map +1 -1
  202. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +5 -0
  203. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  204. package/dist/esm/models/components/checkoutpublicconfirmed.js +2 -0
  205. package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
  206. package/dist/esm/models/components/checkoutupdate.d.ts +5 -0
  207. package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
  208. package/dist/esm/models/components/checkoutupdate.js +2 -0
  209. package/dist/esm/models/components/checkoutupdate.js.map +1 -1
  210. package/dist/esm/models/components/checkoutupdatepublic.d.ts +5 -0
  211. package/dist/esm/models/components/checkoutupdatepublic.d.ts.map +1 -1
  212. package/dist/esm/models/components/checkoutupdatepublic.js +2 -0
  213. package/dist/esm/models/components/checkoutupdatepublic.js.map +1 -1
  214. package/dist/esm/models/components/customerbalance.d.ts +40 -0
  215. package/dist/esm/models/components/customerbalance.d.ts.map +1 -0
  216. package/dist/esm/models/components/customerbalance.js +33 -0
  217. package/dist/esm/models/components/customerbalance.js.map +1 -0
  218. package/dist/esm/models/components/customerorder.d.ts +5 -0
  219. package/dist/esm/models/components/customerorder.d.ts.map +1 -1
  220. package/dist/esm/models/components/customerorder.js +4 -0
  221. package/dist/esm/models/components/customerorder.js.map +1 -1
  222. package/dist/esm/models/components/customerpaymentmethodconfirm.d.ts +31 -0
  223. package/dist/esm/models/components/customerpaymentmethodconfirm.d.ts.map +1 -0
  224. package/dist/esm/models/components/customerpaymentmethodconfirm.js +44 -0
  225. package/dist/esm/models/components/customerpaymentmethodconfirm.js.map +1 -0
  226. package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts +31 -0
  227. package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts.map +1 -0
  228. package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.js +42 -0
  229. package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.js.map +1 -0
  230. package/dist/esm/models/components/customerpaymentmethodcreateresponse.d.ts +35 -0
  231. package/dist/esm/models/components/customerpaymentmethodcreateresponse.d.ts.map +1 -0
  232. package/dist/esm/models/components/customerpaymentmethodcreateresponse.js +43 -0
  233. package/dist/esm/models/components/customerpaymentmethodcreateresponse.js.map +1 -0
  234. package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.d.ts +32 -0
  235. package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.d.ts.map +1 -0
  236. package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.js +43 -0
  237. package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.js.map +1 -0
  238. package/dist/esm/models/components/customersubscription.d.ts +5 -0
  239. package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
  240. package/dist/esm/models/components/customersubscription.js +4 -0
  241. package/dist/esm/models/components/customersubscription.js.map +1 -1
  242. package/dist/esm/models/components/order.d.ts +5 -0
  243. package/dist/esm/models/components/order.d.ts.map +1 -1
  244. package/dist/esm/models/components/order.js +4 -0
  245. package/dist/esm/models/components/order.js.map +1 -1
  246. package/dist/esm/models/components/organizationfeaturesettings.d.ts +5 -0
  247. package/dist/esm/models/components/organizationfeaturesettings.d.ts.map +1 -1
  248. package/dist/esm/models/components/organizationfeaturesettings.js +4 -0
  249. package/dist/esm/models/components/organizationfeaturesettings.js.map +1 -1
  250. package/dist/esm/models/components/productcreateonetime.d.ts +5 -4
  251. package/dist/esm/models/components/productcreateonetime.d.ts.map +1 -1
  252. package/dist/esm/models/components/productcreateonetime.js +5 -0
  253. package/dist/esm/models/components/productcreateonetime.js.map +1 -1
  254. package/dist/esm/models/components/productcreaterecurring.d.ts +5 -4
  255. package/dist/esm/models/components/productcreaterecurring.d.ts.map +1 -1
  256. package/dist/esm/models/components/productcreaterecurring.js +5 -0
  257. package/dist/esm/models/components/productcreaterecurring.js.map +1 -1
  258. package/dist/esm/models/components/productprice.d.ts +5 -0
  259. package/dist/esm/models/components/productprice.d.ts.map +1 -1
  260. package/dist/esm/models/components/productprice.js +7 -0
  261. package/dist/esm/models/components/productprice.js.map +1 -1
  262. package/dist/esm/models/components/productpriceseatbased.d.ts +76 -0
  263. package/dist/esm/models/components/productpriceseatbased.d.ts.map +1 -0
  264. package/dist/esm/models/components/productpriceseatbased.js +74 -0
  265. package/dist/esm/models/components/productpriceseatbased.js.map +1 -0
  266. package/dist/esm/models/components/productpriceseatbasedcreate.d.ts +42 -0
  267. package/dist/esm/models/components/productpriceseatbasedcreate.d.ts.map +1 -0
  268. package/dist/esm/models/components/productpriceseatbasedcreate.js +48 -0
  269. package/dist/esm/models/components/productpriceseatbasedcreate.js.map +1 -0
  270. package/dist/esm/models/components/productupdate.d.ts +5 -4
  271. package/dist/esm/models/components/productupdate.d.ts.map +1 -1
  272. package/dist/esm/models/components/productupdate.js +5 -0
  273. package/dist/esm/models/components/productupdate.js.map +1 -1
  274. package/dist/esm/models/errors/customernotready.d.ts +39 -0
  275. package/dist/esm/models/errors/customernotready.d.ts.map +1 -0
  276. package/dist/esm/models/errors/customernotready.js +51 -0
  277. package/dist/esm/models/errors/customernotready.js.map +1 -0
  278. package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts +29 -0
  279. package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts.map +1 -0
  280. package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.js +40 -0
  281. package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.js.map +1 -0
  282. package/dist/esm/models/operations/customersgetbalance.d.ts +32 -0
  283. package/dist/esm/models/operations/customersgetbalance.d.ts.map +1 -0
  284. package/dist/esm/models/operations/customersgetbalance.js +31 -0
  285. package/dist/esm/models/operations/customersgetbalance.js.map +1 -0
  286. package/dist/esm/models/operations/metersquantities.d.ts +6 -0
  287. package/dist/esm/models/operations/metersquantities.d.ts.map +1 -1
  288. package/dist/esm/models/operations/metersquantities.js +7 -0
  289. package/dist/esm/models/operations/metersquantities.js.map +1 -1
  290. package/dist/esm/sdk/customers.d.ts +11 -0
  291. package/dist/esm/sdk/customers.d.ts.map +1 -1
  292. package/dist/esm/sdk/customers.js +12 -0
  293. package/dist/esm/sdk/customers.js.map +1 -1
  294. package/dist/esm/sdk/polarcustomers.d.ts +13 -2
  295. package/dist/esm/sdk/polarcustomers.d.ts.map +1 -1
  296. package/dist/esm/sdk/polarcustomers.js +12 -0
  297. package/dist/esm/sdk/polarcustomers.js.map +1 -1
  298. package/docs/sdks/customers/README.md +78 -0
  299. package/docs/sdks/polarcustomers/README.md +82 -1
  300. package/examples/package-lock.json +1 -1
  301. package/jsr.json +1 -1
  302. package/package.json +1 -1
  303. package/src/funcs/customerPortalCustomersAddPaymentMethod.ts +8 -8
  304. package/src/funcs/customerPortalCustomersConfirmPaymentMethod.ts +201 -0
  305. package/src/funcs/customersGetBalance.ts +195 -0
  306. package/src/funcs/metersQuantities.ts +1 -0
  307. package/src/lib/config.ts +3 -3
  308. package/src/lib/url.ts +1 -1
  309. package/src/mcp-server/mcp-server.ts +1 -1
  310. package/src/mcp-server/server.ts +3 -1
  311. package/src/mcp-server/tools/customersGetBalance.ts +40 -0
  312. package/src/models/components/address.ts +223 -223
  313. package/src/models/components/addressinput.ts +218 -218
  314. package/src/models/components/aggregationfunction.ts +37 -0
  315. package/src/models/components/checkout.ts +7 -0
  316. package/src/models/components/checkoutconfirmstripe.ts +7 -0
  317. package/src/models/components/checkoutcreate.ts +7 -0
  318. package/src/models/components/checkoutpublic.ts +7 -0
  319. package/src/models/components/checkoutpublicconfirmed.ts +7 -0
  320. package/src/models/components/checkoutupdate.ts +7 -0
  321. package/src/models/components/checkoutupdatepublic.ts +7 -0
  322. package/src/models/components/customerbalance.ts +77 -0
  323. package/src/models/components/customerorder.ts +9 -0
  324. package/src/models/components/customerpaymentmethodconfirm.ts +83 -0
  325. package/src/models/components/customerpaymentmethodcreaterequiresactionresponse.ts +93 -0
  326. package/src/models/components/customerpaymentmethodcreateresponse.ts +107 -0
  327. package/src/models/components/customerpaymentmethodcreatesucceededresponse.ts +98 -0
  328. package/src/models/components/customersubscription.ts +9 -0
  329. package/src/models/components/order.ts +9 -0
  330. package/src/models/components/organizationfeaturesettings.ts +9 -0
  331. package/src/models/components/productcreateonetime.ts +14 -0
  332. package/src/models/components/productcreaterecurring.ts +14 -0
  333. package/src/models/components/productprice.ts +18 -0
  334. package/src/models/components/productpriceseatbased.ts +164 -0
  335. package/src/models/components/productpriceseatbasedcreate.ts +98 -0
  336. package/src/models/components/productupdate.ts +14 -0
  337. package/src/models/errors/customernotready.ts +85 -0
  338. package/src/models/operations/customerportalcustomersconfirmpaymentmethod.ts +89 -0
  339. package/src/models/operations/customersgetbalance.ts +69 -0
  340. package/src/models/operations/metersquantities.ts +16 -0
  341. package/src/sdk/customers.ts +22 -0
  342. package/src/sdk/polarcustomers.ts +26 -2
@@ -46,6 +46,10 @@ export type CheckoutUpdate = {
46
46
  */
47
47
  productPriceId?: string | null | undefined;
48
48
  amount?: number | null | undefined;
49
+ /**
50
+ * Number of seats for seat-based pricing.
51
+ */
52
+ seats?: number | null | undefined;
49
53
  isBusinessCustomer?: boolean | null | undefined;
50
54
  customerName?: string | null | undefined;
51
55
  customerEmail?: string | null | undefined;
@@ -307,6 +311,7 @@ export const CheckoutUpdate$inboundSchema: z.ZodType<
307
311
  product_id: z.nullable(z.string()).optional(),
308
312
  product_price_id: z.nullable(z.string()).optional(),
309
313
  amount: z.nullable(z.number().int()).optional(),
314
+ seats: z.nullable(z.number().int()).optional(),
310
315
  is_business_customer: z.nullable(z.boolean()).optional(),
311
316
  customer_name: z.nullable(z.string()).optional(),
312
317
  customer_email: z.nullable(z.string()).optional(),
@@ -358,6 +363,7 @@ export type CheckoutUpdate$Outbound = {
358
363
  product_id?: string | null | undefined;
359
364
  product_price_id?: string | null | undefined;
360
365
  amount?: number | null | undefined;
366
+ seats?: number | null | undefined;
361
367
  is_business_customer?: boolean | null | undefined;
362
368
  customer_name?: string | null | undefined;
363
369
  customer_email?: string | null | undefined;
@@ -398,6 +404,7 @@ export const CheckoutUpdate$outboundSchema: z.ZodType<
398
404
  productId: z.nullable(z.string()).optional(),
399
405
  productPriceId: z.nullable(z.string()).optional(),
400
406
  amount: z.nullable(z.number().int()).optional(),
407
+ seats: z.nullable(z.number().int()).optional(),
401
408
  isBusinessCustomer: z.nullable(z.boolean()).optional(),
402
409
  customerName: z.nullable(z.string()).optional(),
403
410
  customerEmail: z.nullable(z.string()).optional(),
@@ -41,6 +41,10 @@ export type CheckoutUpdatePublic = {
41
41
  */
42
42
  productPriceId?: string | null | undefined;
43
43
  amount?: number | null | undefined;
44
+ /**
45
+ * Number of seats for seat-based pricing.
46
+ */
47
+ seats?: number | null | undefined;
44
48
  isBusinessCustomer?: boolean | null | undefined;
45
49
  customerName?: string | null | undefined;
46
50
  customerEmail?: string | null | undefined;
@@ -139,6 +143,7 @@ export const CheckoutUpdatePublic$inboundSchema: z.ZodType<
139
143
  product_id: z.nullable(z.string()).optional(),
140
144
  product_price_id: z.nullable(z.string()).optional(),
141
145
  amount: z.nullable(z.number().int()).optional(),
146
+ seats: z.nullable(z.number().int()).optional(),
142
147
  is_business_customer: z.nullable(z.boolean()).optional(),
143
148
  customer_name: z.nullable(z.string()).optional(),
144
149
  customer_email: z.nullable(z.string()).optional(),
@@ -169,6 +174,7 @@ export type CheckoutUpdatePublic$Outbound = {
169
174
  product_id?: string | null | undefined;
170
175
  product_price_id?: string | null | undefined;
171
176
  amount?: number | null | undefined;
177
+ seats?: number | null | undefined;
172
178
  is_business_customer?: boolean | null | undefined;
173
179
  customer_name?: string | null | undefined;
174
180
  customer_email?: string | null | undefined;
@@ -197,6 +203,7 @@ export const CheckoutUpdatePublic$outboundSchema: z.ZodType<
197
203
  productId: z.nullable(z.string()).optional(),
198
204
  productPriceId: z.nullable(z.string()).optional(),
199
205
  amount: z.nullable(z.number().int()).optional(),
206
+ seats: z.nullable(z.number().int()).optional(),
200
207
  isBusinessCustomer: z.nullable(z.boolean()).optional(),
201
208
  customerName: z.nullable(z.string()).optional(),
202
209
  customerEmail: z.nullable(z.string()).optional(),
@@ -0,0 +1,77 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * Customer balance information.
12
+ */
13
+ export type CustomerBalance = {
14
+ /**
15
+ * Customer balance in cents. Positive values represent credit (customer is owed money), negative values represent debit (customer owes money).
16
+ */
17
+ balance: number;
18
+ /**
19
+ * The currency code (ISO 4217) for the balance amount.
20
+ */
21
+ currency: string;
22
+ };
23
+
24
+ /** @internal */
25
+ export const CustomerBalance$inboundSchema: z.ZodType<
26
+ CustomerBalance,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ balance: z.number().int(),
31
+ currency: z.string(),
32
+ });
33
+
34
+ /** @internal */
35
+ export type CustomerBalance$Outbound = {
36
+ balance: number;
37
+ currency: string;
38
+ };
39
+
40
+ /** @internal */
41
+ export const CustomerBalance$outboundSchema: z.ZodType<
42
+ CustomerBalance$Outbound,
43
+ z.ZodTypeDef,
44
+ CustomerBalance
45
+ > = z.object({
46
+ balance: z.number().int(),
47
+ currency: z.string(),
48
+ });
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace CustomerBalance$ {
55
+ /** @deprecated use `CustomerBalance$inboundSchema` instead. */
56
+ export const inboundSchema = CustomerBalance$inboundSchema;
57
+ /** @deprecated use `CustomerBalance$outboundSchema` instead. */
58
+ export const outboundSchema = CustomerBalance$outboundSchema;
59
+ /** @deprecated use `CustomerBalance$Outbound` instead. */
60
+ export type Outbound = CustomerBalance$Outbound;
61
+ }
62
+
63
+ export function customerBalanceToJSON(
64
+ customerBalance: CustomerBalance,
65
+ ): string {
66
+ return JSON.stringify(CustomerBalance$outboundSchema.parse(customerBalance));
67
+ }
68
+
69
+ export function customerBalanceFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<CustomerBalance, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => CustomerBalance$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'CustomerBalance' from JSON`,
76
+ );
77
+ }
@@ -99,6 +99,10 @@ export type CustomerOrder = {
99
99
  */
100
100
  billingName: string | null;
101
101
  billingAddress: Address | null;
102
+ /**
103
+ * The invoice number associated with this order.
104
+ */
105
+ invoiceNumber: string;
102
106
  /**
103
107
  * Whether an invoice has been generated for this order.
104
108
  */
@@ -149,6 +153,7 @@ export const CustomerOrder$inboundSchema: z.ZodType<
149
153
  billing_reason: OrderBillingReason$inboundSchema,
150
154
  billing_name: z.nullable(z.string()),
151
155
  billing_address: z.nullable(Address$inboundSchema),
156
+ invoice_number: z.string(),
152
157
  is_invoice_generated: z.boolean(),
153
158
  customer_id: z.string(),
154
159
  product_id: z.string(),
@@ -177,6 +182,7 @@ export const CustomerOrder$inboundSchema: z.ZodType<
177
182
  "billing_reason": "billingReason",
178
183
  "billing_name": "billingName",
179
184
  "billing_address": "billingAddress",
185
+ "invoice_number": "invoiceNumber",
180
186
  "is_invoice_generated": "isInvoiceGenerated",
181
187
  "customer_id": "customerId",
182
188
  "product_id": "productId",
@@ -207,6 +213,7 @@ export type CustomerOrder$Outbound = {
207
213
  billing_reason: string;
208
214
  billing_name: string | null;
209
215
  billing_address: Address$Outbound | null;
216
+ invoice_number: string;
210
217
  is_invoice_generated: boolean;
211
218
  customer_id: string;
212
219
  product_id: string;
@@ -243,6 +250,7 @@ export const CustomerOrder$outboundSchema: z.ZodType<
243
250
  billingReason: OrderBillingReason$outboundSchema,
244
251
  billingName: z.nullable(z.string()),
245
252
  billingAddress: z.nullable(Address$outboundSchema),
253
+ invoiceNumber: z.string(),
246
254
  isInvoiceGenerated: z.boolean(),
247
255
  customerId: z.string(),
248
256
  productId: z.string(),
@@ -270,6 +278,7 @@ export const CustomerOrder$outboundSchema: z.ZodType<
270
278
  billingReason: "billing_reason",
271
279
  billingName: "billing_name",
272
280
  billingAddress: "billing_address",
281
+ invoiceNumber: "invoice_number",
273
282
  isInvoiceGenerated: "is_invoice_generated",
274
283
  customerId: "customer_id",
275
284
  productId: "product_id",
@@ -0,0 +1,83 @@
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
+
11
+ export type CustomerPaymentMethodConfirm = {
12
+ setupIntentId: string;
13
+ setDefault: boolean;
14
+ };
15
+
16
+ /** @internal */
17
+ export const CustomerPaymentMethodConfirm$inboundSchema: z.ZodType<
18
+ CustomerPaymentMethodConfirm,
19
+ z.ZodTypeDef,
20
+ unknown
21
+ > = z.object({
22
+ setup_intent_id: z.string(),
23
+ set_default: z.boolean(),
24
+ }).transform((v) => {
25
+ return remap$(v, {
26
+ "setup_intent_id": "setupIntentId",
27
+ "set_default": "setDefault",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type CustomerPaymentMethodConfirm$Outbound = {
33
+ setup_intent_id: string;
34
+ set_default: boolean;
35
+ };
36
+
37
+ /** @internal */
38
+ export const CustomerPaymentMethodConfirm$outboundSchema: z.ZodType<
39
+ CustomerPaymentMethodConfirm$Outbound,
40
+ z.ZodTypeDef,
41
+ CustomerPaymentMethodConfirm
42
+ > = z.object({
43
+ setupIntentId: z.string(),
44
+ setDefault: z.boolean(),
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ setupIntentId: "setup_intent_id",
48
+ setDefault: "set_default",
49
+ });
50
+ });
51
+
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export namespace CustomerPaymentMethodConfirm$ {
57
+ /** @deprecated use `CustomerPaymentMethodConfirm$inboundSchema` instead. */
58
+ export const inboundSchema = CustomerPaymentMethodConfirm$inboundSchema;
59
+ /** @deprecated use `CustomerPaymentMethodConfirm$outboundSchema` instead. */
60
+ export const outboundSchema = CustomerPaymentMethodConfirm$outboundSchema;
61
+ /** @deprecated use `CustomerPaymentMethodConfirm$Outbound` instead. */
62
+ export type Outbound = CustomerPaymentMethodConfirm$Outbound;
63
+ }
64
+
65
+ export function customerPaymentMethodConfirmToJSON(
66
+ customerPaymentMethodConfirm: CustomerPaymentMethodConfirm,
67
+ ): string {
68
+ return JSON.stringify(
69
+ CustomerPaymentMethodConfirm$outboundSchema.parse(
70
+ customerPaymentMethodConfirm,
71
+ ),
72
+ );
73
+ }
74
+
75
+ export function customerPaymentMethodConfirmFromJSON(
76
+ jsonString: string,
77
+ ): SafeParseResult<CustomerPaymentMethodConfirm, SDKValidationError> {
78
+ return safeParse(
79
+ jsonString,
80
+ (x) => CustomerPaymentMethodConfirm$inboundSchema.parse(JSON.parse(x)),
81
+ `Failed to parse 'CustomerPaymentMethodConfirm' from JSON`,
82
+ );
83
+ }
@@ -0,0 +1,93 @@
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
+
11
+ export type CustomerPaymentMethodCreateRequiresActionResponse = {
12
+ status: "requires_action";
13
+ clientSecret: string;
14
+ };
15
+
16
+ /** @internal */
17
+ export const CustomerPaymentMethodCreateRequiresActionResponse$inboundSchema:
18
+ z.ZodType<
19
+ CustomerPaymentMethodCreateRequiresActionResponse,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ status: z.literal("requires_action"),
24
+ client_secret: z.string(),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "client_secret": "clientSecret",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type CustomerPaymentMethodCreateRequiresActionResponse$Outbound = {
33
+ status: "requires_action";
34
+ client_secret: string;
35
+ };
36
+
37
+ /** @internal */
38
+ export const CustomerPaymentMethodCreateRequiresActionResponse$outboundSchema:
39
+ z.ZodType<
40
+ CustomerPaymentMethodCreateRequiresActionResponse$Outbound,
41
+ z.ZodTypeDef,
42
+ CustomerPaymentMethodCreateRequiresActionResponse
43
+ > = z.object({
44
+ status: z.literal("requires_action"),
45
+ clientSecret: z.string(),
46
+ }).transform((v) => {
47
+ return remap$(v, {
48
+ clientSecret: "client_secret",
49
+ });
50
+ });
51
+
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export namespace CustomerPaymentMethodCreateRequiresActionResponse$ {
57
+ /** @deprecated use `CustomerPaymentMethodCreateRequiresActionResponse$inboundSchema` instead. */
58
+ export const inboundSchema =
59
+ CustomerPaymentMethodCreateRequiresActionResponse$inboundSchema;
60
+ /** @deprecated use `CustomerPaymentMethodCreateRequiresActionResponse$outboundSchema` instead. */
61
+ export const outboundSchema =
62
+ CustomerPaymentMethodCreateRequiresActionResponse$outboundSchema;
63
+ /** @deprecated use `CustomerPaymentMethodCreateRequiresActionResponse$Outbound` instead. */
64
+ export type Outbound =
65
+ CustomerPaymentMethodCreateRequiresActionResponse$Outbound;
66
+ }
67
+
68
+ export function customerPaymentMethodCreateRequiresActionResponseToJSON(
69
+ customerPaymentMethodCreateRequiresActionResponse:
70
+ CustomerPaymentMethodCreateRequiresActionResponse,
71
+ ): string {
72
+ return JSON.stringify(
73
+ CustomerPaymentMethodCreateRequiresActionResponse$outboundSchema.parse(
74
+ customerPaymentMethodCreateRequiresActionResponse,
75
+ ),
76
+ );
77
+ }
78
+
79
+ export function customerPaymentMethodCreateRequiresActionResponseFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<
82
+ CustomerPaymentMethodCreateRequiresActionResponse,
83
+ SDKValidationError
84
+ > {
85
+ return safeParse(
86
+ jsonString,
87
+ (x) =>
88
+ CustomerPaymentMethodCreateRequiresActionResponse$inboundSchema.parse(
89
+ JSON.parse(x),
90
+ ),
91
+ `Failed to parse 'CustomerPaymentMethodCreateRequiresActionResponse' from JSON`,
92
+ );
93
+ }
@@ -0,0 +1,107 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ CustomerPaymentMethodCreateRequiresActionResponse,
11
+ CustomerPaymentMethodCreateRequiresActionResponse$inboundSchema,
12
+ CustomerPaymentMethodCreateRequiresActionResponse$Outbound,
13
+ CustomerPaymentMethodCreateRequiresActionResponse$outboundSchema,
14
+ } from "./customerpaymentmethodcreaterequiresactionresponse.js";
15
+ import {
16
+ CustomerPaymentMethodCreateSucceededResponse,
17
+ CustomerPaymentMethodCreateSucceededResponse$inboundSchema,
18
+ CustomerPaymentMethodCreateSucceededResponse$Outbound,
19
+ CustomerPaymentMethodCreateSucceededResponse$outboundSchema,
20
+ } from "./customerpaymentmethodcreatesucceededresponse.js";
21
+
22
+ export type CustomerPaymentMethodCreateResponse =
23
+ | (CustomerPaymentMethodCreateRequiresActionResponse & {
24
+ status: "requires_action";
25
+ })
26
+ | (CustomerPaymentMethodCreateSucceededResponse & { status: "succeeded" });
27
+
28
+ /** @internal */
29
+ export const CustomerPaymentMethodCreateResponse$inboundSchema: z.ZodType<
30
+ CustomerPaymentMethodCreateResponse,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.union([
34
+ CustomerPaymentMethodCreateRequiresActionResponse$inboundSchema.and(
35
+ z.object({ status: z.literal("requires_action") }).transform((v) => ({
36
+ status: v.status,
37
+ })),
38
+ ),
39
+ CustomerPaymentMethodCreateSucceededResponse$inboundSchema.and(
40
+ z.object({ status: z.literal("succeeded") }).transform((v) => ({
41
+ status: v.status,
42
+ })),
43
+ ),
44
+ ]);
45
+
46
+ /** @internal */
47
+ export type CustomerPaymentMethodCreateResponse$Outbound =
48
+ | (CustomerPaymentMethodCreateRequiresActionResponse$Outbound & {
49
+ status: "requires_action";
50
+ })
51
+ | (CustomerPaymentMethodCreateSucceededResponse$Outbound & {
52
+ status: "succeeded";
53
+ });
54
+
55
+ /** @internal */
56
+ export const CustomerPaymentMethodCreateResponse$outboundSchema: z.ZodType<
57
+ CustomerPaymentMethodCreateResponse$Outbound,
58
+ z.ZodTypeDef,
59
+ CustomerPaymentMethodCreateResponse
60
+ > = z.union([
61
+ CustomerPaymentMethodCreateRequiresActionResponse$outboundSchema.and(
62
+ z.object({ status: z.literal("requires_action") }).transform((v) => ({
63
+ status: v.status,
64
+ })),
65
+ ),
66
+ CustomerPaymentMethodCreateSucceededResponse$outboundSchema.and(
67
+ z.object({ status: z.literal("succeeded") }).transform((v) => ({
68
+ status: v.status,
69
+ })),
70
+ ),
71
+ ]);
72
+
73
+ /**
74
+ * @internal
75
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
76
+ */
77
+ export namespace CustomerPaymentMethodCreateResponse$ {
78
+ /** @deprecated use `CustomerPaymentMethodCreateResponse$inboundSchema` instead. */
79
+ export const inboundSchema =
80
+ CustomerPaymentMethodCreateResponse$inboundSchema;
81
+ /** @deprecated use `CustomerPaymentMethodCreateResponse$outboundSchema` instead. */
82
+ export const outboundSchema =
83
+ CustomerPaymentMethodCreateResponse$outboundSchema;
84
+ /** @deprecated use `CustomerPaymentMethodCreateResponse$Outbound` instead. */
85
+ export type Outbound = CustomerPaymentMethodCreateResponse$Outbound;
86
+ }
87
+
88
+ export function customerPaymentMethodCreateResponseToJSON(
89
+ customerPaymentMethodCreateResponse: CustomerPaymentMethodCreateResponse,
90
+ ): string {
91
+ return JSON.stringify(
92
+ CustomerPaymentMethodCreateResponse$outboundSchema.parse(
93
+ customerPaymentMethodCreateResponse,
94
+ ),
95
+ );
96
+ }
97
+
98
+ export function customerPaymentMethodCreateResponseFromJSON(
99
+ jsonString: string,
100
+ ): SafeParseResult<CustomerPaymentMethodCreateResponse, SDKValidationError> {
101
+ return safeParse(
102
+ jsonString,
103
+ (x) =>
104
+ CustomerPaymentMethodCreateResponse$inboundSchema.parse(JSON.parse(x)),
105
+ `Failed to parse 'CustomerPaymentMethodCreateResponse' from JSON`,
106
+ );
107
+ }
@@ -0,0 +1,98 @@
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
+ CustomerPaymentMethod,
12
+ CustomerPaymentMethod$inboundSchema,
13
+ CustomerPaymentMethod$Outbound,
14
+ CustomerPaymentMethod$outboundSchema,
15
+ } from "./customerpaymentmethod.js";
16
+
17
+ export type CustomerPaymentMethodCreateSucceededResponse = {
18
+ status: "succeeded";
19
+ paymentMethod: CustomerPaymentMethod;
20
+ };
21
+
22
+ /** @internal */
23
+ export const CustomerPaymentMethodCreateSucceededResponse$inboundSchema:
24
+ z.ZodType<
25
+ CustomerPaymentMethodCreateSucceededResponse,
26
+ z.ZodTypeDef,
27
+ unknown
28
+ > = z.object({
29
+ status: z.literal("succeeded"),
30
+ payment_method: CustomerPaymentMethod$inboundSchema,
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "payment_method": "paymentMethod",
34
+ });
35
+ });
36
+
37
+ /** @internal */
38
+ export type CustomerPaymentMethodCreateSucceededResponse$Outbound = {
39
+ status: "succeeded";
40
+ payment_method: CustomerPaymentMethod$Outbound;
41
+ };
42
+
43
+ /** @internal */
44
+ export const CustomerPaymentMethodCreateSucceededResponse$outboundSchema:
45
+ z.ZodType<
46
+ CustomerPaymentMethodCreateSucceededResponse$Outbound,
47
+ z.ZodTypeDef,
48
+ CustomerPaymentMethodCreateSucceededResponse
49
+ > = z.object({
50
+ status: z.literal("succeeded"),
51
+ paymentMethod: CustomerPaymentMethod$outboundSchema,
52
+ }).transform((v) => {
53
+ return remap$(v, {
54
+ paymentMethod: "payment_method",
55
+ });
56
+ });
57
+
58
+ /**
59
+ * @internal
60
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
61
+ */
62
+ export namespace CustomerPaymentMethodCreateSucceededResponse$ {
63
+ /** @deprecated use `CustomerPaymentMethodCreateSucceededResponse$inboundSchema` instead. */
64
+ export const inboundSchema =
65
+ CustomerPaymentMethodCreateSucceededResponse$inboundSchema;
66
+ /** @deprecated use `CustomerPaymentMethodCreateSucceededResponse$outboundSchema` instead. */
67
+ export const outboundSchema =
68
+ CustomerPaymentMethodCreateSucceededResponse$outboundSchema;
69
+ /** @deprecated use `CustomerPaymentMethodCreateSucceededResponse$Outbound` instead. */
70
+ export type Outbound = CustomerPaymentMethodCreateSucceededResponse$Outbound;
71
+ }
72
+
73
+ export function customerPaymentMethodCreateSucceededResponseToJSON(
74
+ customerPaymentMethodCreateSucceededResponse:
75
+ CustomerPaymentMethodCreateSucceededResponse,
76
+ ): string {
77
+ return JSON.stringify(
78
+ CustomerPaymentMethodCreateSucceededResponse$outboundSchema.parse(
79
+ customerPaymentMethodCreateSucceededResponse,
80
+ ),
81
+ );
82
+ }
83
+
84
+ export function customerPaymentMethodCreateSucceededResponseFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<
87
+ CustomerPaymentMethodCreateSucceededResponse,
88
+ SDKValidationError
89
+ > {
90
+ return safeParse(
91
+ jsonString,
92
+ (x) =>
93
+ CustomerPaymentMethodCreateSucceededResponse$inboundSchema.parse(
94
+ JSON.parse(x),
95
+ ),
96
+ `Failed to parse 'CustomerPaymentMethodCreateSucceededResponse' from JSON`,
97
+ );
98
+ }
@@ -134,6 +134,10 @@ export type CustomerSubscription = {
134
134
  * List of meters associated with the subscription.
135
135
  */
136
136
  meters: Array<CustomerSubscriptionMeter>;
137
+ /**
138
+ * Whether the subscription is managed by Polar.
139
+ */
140
+ isPolarManaged: boolean;
137
141
  };
138
142
 
139
143
  /** @internal */
@@ -248,6 +252,7 @@ export const CustomerSubscription$inboundSchema: z.ZodType<
248
252
  ]),
249
253
  ),
250
254
  meters: z.array(CustomerSubscriptionMeter$inboundSchema),
255
+ is_polar_managed: z.boolean(),
251
256
  }).transform((v) => {
252
257
  return remap$(v, {
253
258
  "created_at": "createdAt",
@@ -268,6 +273,7 @@ export const CustomerSubscription$inboundSchema: z.ZodType<
268
273
  "checkout_id": "checkoutId",
269
274
  "customer_cancellation_reason": "customerCancellationReason",
270
275
  "customer_cancellation_comment": "customerCancellationComment",
276
+ "is_polar_managed": "isPolarManaged",
271
277
  });
272
278
  });
273
279
 
@@ -298,6 +304,7 @@ export type CustomerSubscription$Outbound = {
298
304
  product: CustomerSubscriptionProduct$Outbound;
299
305
  prices: Array<LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound>;
300
306
  meters: Array<CustomerSubscriptionMeter$Outbound>;
307
+ is_polar_managed: boolean;
301
308
  };
302
309
 
303
310
  /** @internal */
@@ -338,6 +345,7 @@ export const CustomerSubscription$outboundSchema: z.ZodType<
338
345
  ]),
339
346
  ),
340
347
  meters: z.array(CustomerSubscriptionMeter$outboundSchema),
348
+ isPolarManaged: z.boolean(),
341
349
  }).transform((v) => {
342
350
  return remap$(v, {
343
351
  createdAt: "created_at",
@@ -358,6 +366,7 @@ export const CustomerSubscription$outboundSchema: z.ZodType<
358
366
  checkoutId: "checkout_id",
359
367
  customerCancellationReason: "customer_cancellation_reason",
360
368
  customerCancellationComment: "customer_cancellation_comment",
369
+ isPolarManaged: "is_polar_managed",
361
370
  });
362
371
  });
363
372
 
@@ -139,6 +139,10 @@ export type Order = {
139
139
  */
140
140
  billingName: string | null;
141
141
  billingAddress: Address | null;
142
+ /**
143
+ * The invoice number associated with this order.
144
+ */
145
+ invoiceNumber: string;
142
146
  /**
143
147
  * Whether an invoice has been generated for this order.
144
148
  */
@@ -358,6 +362,7 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
358
362
  billing_reason: OrderBillingReason$inboundSchema,
359
363
  billing_name: z.nullable(z.string()),
360
364
  billing_address: z.nullable(Address$inboundSchema),
365
+ invoice_number: z.string(),
361
366
  is_invoice_generated: z.boolean(),
362
367
  customer_id: z.string(),
363
368
  product_id: z.string(),
@@ -405,6 +410,7 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
405
410
  "billing_reason": "billingReason",
406
411
  "billing_name": "billingName",
407
412
  "billing_address": "billingAddress",
413
+ "invoice_number": "invoiceNumber",
408
414
  "is_invoice_generated": "isInvoiceGenerated",
409
415
  "customer_id": "customerId",
410
416
  "product_id": "productId",
@@ -435,6 +441,7 @@ export type Order$Outbound = {
435
441
  billing_reason: string;
436
442
  billing_name: string | null;
437
443
  billing_address: Address$Outbound | null;
444
+ invoice_number: string;
438
445
  is_invoice_generated: boolean;
439
446
  customer_id: string;
440
447
  product_id: string;
@@ -481,6 +488,7 @@ export const Order$outboundSchema: z.ZodType<
481
488
  billingReason: OrderBillingReason$outboundSchema,
482
489
  billingName: z.nullable(z.string()),
483
490
  billingAddress: z.nullable(Address$outboundSchema),
491
+ invoiceNumber: z.string(),
484
492
  isInvoiceGenerated: z.boolean(),
485
493
  customerId: z.string(),
486
494
  productId: z.string(),
@@ -528,6 +536,7 @@ export const Order$outboundSchema: z.ZodType<
528
536
  billingReason: "billing_reason",
529
537
  billingName: "billing_name",
530
538
  billingAddress: "billing_address",
539
+ invoiceNumber: "invoice_number",
531
540
  isInvoiceGenerated: "is_invoice_generated",
532
541
  customerId: "customer_id",
533
542
  productId: "product_id",