@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
@@ -0,0 +1,89 @@
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 CustomerPortalCustomersConfirmPaymentMethodSecurity = {
12
+ customerSession: string;
13
+ };
14
+
15
+ /** @internal */
16
+ export const CustomerPortalCustomersConfirmPaymentMethodSecurity$inboundSchema:
17
+ z.ZodType<
18
+ CustomerPortalCustomersConfirmPaymentMethodSecurity,
19
+ z.ZodTypeDef,
20
+ unknown
21
+ > = z.object({
22
+ customer_session: z.string(),
23
+ }).transform((v) => {
24
+ return remap$(v, {
25
+ "customer_session": "customerSession",
26
+ });
27
+ });
28
+
29
+ /** @internal */
30
+ export type CustomerPortalCustomersConfirmPaymentMethodSecurity$Outbound = {
31
+ customer_session: string;
32
+ };
33
+
34
+ /** @internal */
35
+ export const CustomerPortalCustomersConfirmPaymentMethodSecurity$outboundSchema:
36
+ z.ZodType<
37
+ CustomerPortalCustomersConfirmPaymentMethodSecurity$Outbound,
38
+ z.ZodTypeDef,
39
+ CustomerPortalCustomersConfirmPaymentMethodSecurity
40
+ > = z.object({
41
+ customerSession: z.string(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ customerSession: "customer_session",
45
+ });
46
+ });
47
+
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export namespace CustomerPortalCustomersConfirmPaymentMethodSecurity$ {
53
+ /** @deprecated use `CustomerPortalCustomersConfirmPaymentMethodSecurity$inboundSchema` instead. */
54
+ export const inboundSchema =
55
+ CustomerPortalCustomersConfirmPaymentMethodSecurity$inboundSchema;
56
+ /** @deprecated use `CustomerPortalCustomersConfirmPaymentMethodSecurity$outboundSchema` instead. */
57
+ export const outboundSchema =
58
+ CustomerPortalCustomersConfirmPaymentMethodSecurity$outboundSchema;
59
+ /** @deprecated use `CustomerPortalCustomersConfirmPaymentMethodSecurity$Outbound` instead. */
60
+ export type Outbound =
61
+ CustomerPortalCustomersConfirmPaymentMethodSecurity$Outbound;
62
+ }
63
+
64
+ export function customerPortalCustomersConfirmPaymentMethodSecurityToJSON(
65
+ customerPortalCustomersConfirmPaymentMethodSecurity:
66
+ CustomerPortalCustomersConfirmPaymentMethodSecurity,
67
+ ): string {
68
+ return JSON.stringify(
69
+ CustomerPortalCustomersConfirmPaymentMethodSecurity$outboundSchema.parse(
70
+ customerPortalCustomersConfirmPaymentMethodSecurity,
71
+ ),
72
+ );
73
+ }
74
+
75
+ export function customerPortalCustomersConfirmPaymentMethodSecurityFromJSON(
76
+ jsonString: string,
77
+ ): SafeParseResult<
78
+ CustomerPortalCustomersConfirmPaymentMethodSecurity,
79
+ SDKValidationError
80
+ > {
81
+ return safeParse(
82
+ jsonString,
83
+ (x) =>
84
+ CustomerPortalCustomersConfirmPaymentMethodSecurity$inboundSchema.parse(
85
+ JSON.parse(x),
86
+ ),
87
+ `Failed to parse 'CustomerPortalCustomersConfirmPaymentMethodSecurity' from JSON`,
88
+ );
89
+ }
@@ -0,0 +1,69 @@
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
+ export type CustomersGetBalanceRequest = {
11
+ /**
12
+ * The customer ID.
13
+ */
14
+ id: string;
15
+ };
16
+
17
+ /** @internal */
18
+ export const CustomersGetBalanceRequest$inboundSchema: z.ZodType<
19
+ CustomersGetBalanceRequest,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ id: z.string(),
24
+ });
25
+
26
+ /** @internal */
27
+ export type CustomersGetBalanceRequest$Outbound = {
28
+ id: string;
29
+ };
30
+
31
+ /** @internal */
32
+ export const CustomersGetBalanceRequest$outboundSchema: z.ZodType<
33
+ CustomersGetBalanceRequest$Outbound,
34
+ z.ZodTypeDef,
35
+ CustomersGetBalanceRequest
36
+ > = z.object({
37
+ id: z.string(),
38
+ });
39
+
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export namespace CustomersGetBalanceRequest$ {
45
+ /** @deprecated use `CustomersGetBalanceRequest$inboundSchema` instead. */
46
+ export const inboundSchema = CustomersGetBalanceRequest$inboundSchema;
47
+ /** @deprecated use `CustomersGetBalanceRequest$outboundSchema` instead. */
48
+ export const outboundSchema = CustomersGetBalanceRequest$outboundSchema;
49
+ /** @deprecated use `CustomersGetBalanceRequest$Outbound` instead. */
50
+ export type Outbound = CustomersGetBalanceRequest$Outbound;
51
+ }
52
+
53
+ export function customersGetBalanceRequestToJSON(
54
+ customersGetBalanceRequest: CustomersGetBalanceRequest,
55
+ ): string {
56
+ return JSON.stringify(
57
+ CustomersGetBalanceRequest$outboundSchema.parse(customersGetBalanceRequest),
58
+ );
59
+ }
60
+
61
+ export function customersGetBalanceRequestFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<CustomersGetBalanceRequest, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => CustomersGetBalanceRequest$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'CustomersGetBalanceRequest' from JSON`,
68
+ );
69
+ }
@@ -6,6 +6,11 @@ import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import {
10
+ AggregationFunction,
11
+ AggregationFunction$inboundSchema,
12
+ AggregationFunction$outboundSchema,
13
+ } from "../components/aggregationfunction.js";
9
14
  import {
10
15
  MetadataQuery,
11
16
  MetadataQuery$inboundSchema,
@@ -56,6 +61,10 @@ export type MetersQuantitiesRequest = {
56
61
  * Filter by external customer ID.
57
62
  */
58
63
  externalCustomerId?: string | Array<string> | null | undefined;
64
+ /**
65
+ * If set, will first compute the quantities per customer before aggregating them using the given function. If not set, the quantities will be aggregated across all events.
66
+ */
67
+ customerAggregationFunction?: AggregationFunction | null | undefined;
59
68
  /**
60
69
  * Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`.
61
70
  */
@@ -204,6 +213,8 @@ export const MetersQuantitiesRequest$inboundSchema: z.ZodType<
204
213
  .optional(),
205
214
  external_customer_id: z.nullable(z.union([z.string(), z.array(z.string())]))
206
215
  .optional(),
216
+ customer_aggregation_function: z.nullable(AggregationFunction$inboundSchema)
217
+ .optional(),
207
218
  metadata: z.nullable(z.record(MetadataQuery$inboundSchema)).optional(),
208
219
  }).transform((v) => {
209
220
  return remap$(v, {
@@ -211,6 +222,7 @@ export const MetersQuantitiesRequest$inboundSchema: z.ZodType<
211
222
  "end_timestamp": "endTimestamp",
212
223
  "customer_id": "customerId",
213
224
  "external_customer_id": "externalCustomerId",
225
+ "customer_aggregation_function": "customerAggregationFunction",
214
226
  });
215
227
  });
216
228
 
@@ -222,6 +234,7 @@ export type MetersQuantitiesRequest$Outbound = {
222
234
  interval: string;
223
235
  customer_id?: string | Array<string> | null | undefined;
224
236
  external_customer_id?: string | Array<string> | null | undefined;
237
+ customer_aggregation_function?: string | null | undefined;
225
238
  metadata?: { [k: string]: MetadataQuery$Outbound } | null | undefined;
226
239
  };
227
240
 
@@ -238,6 +251,8 @@ export const MetersQuantitiesRequest$outboundSchema: z.ZodType<
238
251
  customerId: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
239
252
  externalCustomerId: z.nullable(z.union([z.string(), z.array(z.string())]))
240
253
  .optional(),
254
+ customerAggregationFunction: z.nullable(AggregationFunction$outboundSchema)
255
+ .optional(),
241
256
  metadata: z.nullable(z.record(MetadataQuery$outboundSchema)).optional(),
242
257
  }).transform((v) => {
243
258
  return remap$(v, {
@@ -245,6 +260,7 @@ export const MetersQuantitiesRequest$outboundSchema: z.ZodType<
245
260
  endTimestamp: "end_timestamp",
246
261
  customerId: "customer_id",
247
262
  externalCustomerId: "external_customer_id",
263
+ customerAggregationFunction: "customer_aggregation_function",
248
264
  });
249
265
  });
250
266
 
@@ -7,6 +7,7 @@ import { customersDelete } from "../funcs/customersDelete.js";
7
7
  import { customersDeleteExternal } from "../funcs/customersDeleteExternal.js";
8
8
  import { customersExport } from "../funcs/customersExport.js";
9
9
  import { customersGet } from "../funcs/customersGet.js";
10
+ import { customersGetBalance } from "../funcs/customersGetBalance.js";
10
11
  import { customersGetExternal } from "../funcs/customersGetExternal.js";
11
12
  import { customersGetState } from "../funcs/customersGetState.js";
12
13
  import { customersGetStateExternal } from "../funcs/customersGetStateExternal.js";
@@ -15,12 +16,14 @@ import { customersUpdate } from "../funcs/customersUpdate.js";
15
16
  import { customersUpdateExternal } from "../funcs/customersUpdateExternal.js";
16
17
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
17
18
  import { Customer } from "../models/components/customer.js";
19
+ import { CustomerBalance } from "../models/components/customerbalance.js";
18
20
  import { CustomerCreate } from "../models/components/customercreate.js";
19
21
  import { CustomerState } from "../models/components/customerstate.js";
20
22
  import { CustomersDeleteRequest } from "../models/operations/customersdelete.js";
21
23
  import { CustomersDeleteExternalRequest } from "../models/operations/customersdeleteexternal.js";
22
24
  import { CustomersExportRequest } from "../models/operations/customersexport.js";
23
25
  import { CustomersGetRequest } from "../models/operations/customersget.js";
26
+ import { CustomersGetBalanceRequest } from "../models/operations/customersgetbalance.js";
24
27
  import { CustomersGetExternalRequest } from "../models/operations/customersgetexternal.js";
25
28
  import { CustomersGetStateRequest } from "../models/operations/customersgetstate.js";
26
29
  import { CustomersGetStateExternalRequest } from "../models/operations/customersgetstateexternal.js";
@@ -268,4 +271,23 @@ export class Customers extends ClientSDK {
268
271
  options,
269
272
  ));
270
273
  }
274
+
275
+ /**
276
+ * Get Customer Balance
277
+ *
278
+ * @remarks
279
+ * Get customer balance information.
280
+ *
281
+ * **Scopes**: `customers:read` `customers:write`
282
+ */
283
+ async getBalance(
284
+ request: CustomersGetBalanceRequest,
285
+ options?: RequestOptions,
286
+ ): Promise<CustomerBalance> {
287
+ return unwrapAsync(customersGetBalance(
288
+ this,
289
+ request,
290
+ options,
291
+ ));
292
+ }
271
293
  }
@@ -3,16 +3,19 @@
3
3
  */
4
4
 
5
5
  import { customerPortalCustomersAddPaymentMethod } from "../funcs/customerPortalCustomersAddPaymentMethod.js";
6
+ import { customerPortalCustomersConfirmPaymentMethod } from "../funcs/customerPortalCustomersConfirmPaymentMethod.js";
6
7
  import { customerPortalCustomersDeletePaymentMethod } from "../funcs/customerPortalCustomersDeletePaymentMethod.js";
7
8
  import { customerPortalCustomersGet } from "../funcs/customerPortalCustomersGet.js";
8
9
  import { customerPortalCustomersListPaymentMethods } from "../funcs/customerPortalCustomersListPaymentMethods.js";
9
10
  import { customerPortalCustomersUpdate } from "../funcs/customerPortalCustomersUpdate.js";
10
11
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
- import { CustomerPaymentMethod } from "../models/components/customerpaymentmethod.js";
12
+ import { CustomerPaymentMethodConfirm } from "../models/components/customerpaymentmethodconfirm.js";
12
13
  import { CustomerPaymentMethodCreate } from "../models/components/customerpaymentmethodcreate.js";
14
+ import { CustomerPaymentMethodCreateResponse } from "../models/components/customerpaymentmethodcreateresponse.js";
13
15
  import { CustomerPortalCustomer } from "../models/components/customerportalcustomer.js";
14
16
  import { CustomerPortalCustomerUpdate } from "../models/components/customerportalcustomerupdate.js";
15
17
  import { CustomerPortalCustomersAddPaymentMethodSecurity } from "../models/operations/customerportalcustomersaddpaymentmethod.js";
18
+ import { CustomerPortalCustomersConfirmPaymentMethodSecurity } from "../models/operations/customerportalcustomersconfirmpaymentmethod.js";
16
19
  import {
17
20
  CustomerPortalCustomersDeletePaymentMethodRequest,
18
21
  CustomerPortalCustomersDeletePaymentMethodSecurity,
@@ -106,7 +109,7 @@ export class PolarCustomers extends ClientSDK {
106
109
  security: CustomerPortalCustomersAddPaymentMethodSecurity,
107
110
  request: CustomerPaymentMethodCreate,
108
111
  options?: RequestOptions,
109
- ): Promise<CustomerPaymentMethod> {
112
+ ): Promise<CustomerPaymentMethodCreateResponse> {
110
113
  return unwrapAsync(customerPortalCustomersAddPaymentMethod(
111
114
  this,
112
115
  security,
@@ -115,6 +118,27 @@ export class PolarCustomers extends ClientSDK {
115
118
  ));
116
119
  }
117
120
 
121
+ /**
122
+ * Confirm Customer Payment Method
123
+ *
124
+ * @remarks
125
+ * Confirm a payment method for the authenticated customer.
126
+ *
127
+ * **Scopes**: `customer_portal:read` `customer_portal:write`
128
+ */
129
+ async confirmPaymentMethod(
130
+ security: CustomerPortalCustomersConfirmPaymentMethodSecurity,
131
+ request: CustomerPaymentMethodConfirm,
132
+ options?: RequestOptions,
133
+ ): Promise<CustomerPaymentMethodCreateResponse> {
134
+ return unwrapAsync(customerPortalCustomersConfirmPaymentMethod(
135
+ this,
136
+ security,
137
+ request,
138
+ options,
139
+ ));
140
+ }
141
+
118
142
  /**
119
143
  * Delete Customer Payment Method
120
144
  *