@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
@@ -9,6 +9,7 @@
9
9
  * [update](#update) - Update Customer
10
10
  * [listPaymentMethods](#listpaymentmethods) - List Customer Payment Methods
11
11
  * [addPaymentMethod](#addpaymentmethod) - Add Customer Payment Method
12
+ * [confirmPaymentMethod](#confirmpaymentmethod) - Confirm Customer Payment Method
12
13
  * [deletePaymentMethod](#deletepaymentmethod) - Delete Customer Payment Method
13
14
 
14
15
  ## get
@@ -312,7 +313,7 @@ run();
312
313
 
313
314
  ### Response
314
315
 
315
- **Promise\<[components.CustomerPaymentMethod](../../models/components/customerpaymentmethod.md)\>**
316
+ **Promise\<[components.CustomerPaymentMethodCreateResponse](../../models/components/customerpaymentmethodcreateresponse.md)\>**
316
317
 
317
318
  ### Errors
318
319
 
@@ -321,6 +322,86 @@ run();
321
322
  | errors.HTTPValidationError | 422 | application/json |
322
323
  | errors.SDKError | 4XX, 5XX | \*/\* |
323
324
 
325
+ ## confirmPaymentMethod
326
+
327
+ Confirm a payment method for the authenticated customer.
328
+
329
+ **Scopes**: `customer_portal:read` `customer_portal:write`
330
+
331
+ ### Example Usage
332
+
333
+ <!-- UsageSnippet language="typescript" operationID="customer_portal:customers:confirm_payment_method" method="post" path="/v1/customer-portal/customers/me/payment-methods/confirm" -->
334
+ ```typescript
335
+ import { Polar } from "@polar-sh/sdk";
336
+
337
+ const polar = new Polar();
338
+
339
+ async function run() {
340
+ const result = await polar.customerPortal.customers.confirmPaymentMethod({
341
+ customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
342
+ }, {
343
+ setupIntentId: "<id>",
344
+ setDefault: true,
345
+ });
346
+
347
+ console.log(result);
348
+ }
349
+
350
+ run();
351
+ ```
352
+
353
+ ### Standalone function
354
+
355
+ The standalone function version of this method:
356
+
357
+ ```typescript
358
+ import { PolarCore } from "@polar-sh/sdk/core.js";
359
+ import { customerPortalCustomersConfirmPaymentMethod } from "@polar-sh/sdk/funcs/customerPortalCustomersConfirmPaymentMethod.js";
360
+
361
+ // Use `PolarCore` for best tree-shaking performance.
362
+ // You can create one instance of it to use across an application.
363
+ const polar = new PolarCore();
364
+
365
+ async function run() {
366
+ const res = await customerPortalCustomersConfirmPaymentMethod(polar, {
367
+ customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
368
+ }, {
369
+ setupIntentId: "<id>",
370
+ setDefault: true,
371
+ });
372
+ if (res.ok) {
373
+ const { value: result } = res;
374
+ console.log(result);
375
+ } else {
376
+ console.log("customerPortalCustomersConfirmPaymentMethod failed:", res.error);
377
+ }
378
+ }
379
+
380
+ run();
381
+ ```
382
+
383
+ ### Parameters
384
+
385
+ | Parameter | Type | Required | Description |
386
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
387
+ | `request` | [components.CustomerPaymentMethodConfirm](../../models/components/customerpaymentmethodconfirm.md) | :heavy_check_mark: | The request object to use for the request. |
388
+ | `security` | [operations.CustomerPortalCustomersConfirmPaymentMethodSecurity](../../models/operations/customerportalcustomersconfirmpaymentmethodsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
389
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
390
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
391
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
392
+
393
+ ### Response
394
+
395
+ **Promise\<[components.CustomerPaymentMethodCreateResponse](../../models/components/customerpaymentmethodcreateresponse.md)\>**
396
+
397
+ ### Errors
398
+
399
+ | Error Type | Status Code | Content Type |
400
+ | -------------------------- | -------------------------- | -------------------------- |
401
+ | errors.CustomerNotReady | 400 | application/json |
402
+ | errors.HTTPValidationError | 422 | application/json |
403
+ | errors.SDKError | 4XX, 5XX | \*/\* |
404
+
324
405
  ## deletePaymentMethod
325
406
 
326
407
  Delete a payment method from the authenticated customer.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "..": {
20
20
  "name": "@polar-sh/sdk",
21
- "version": "0.35.2",
21
+ "version": "0.35.4",
22
22
  "dependencies": {
23
23
  "standardwebhooks": "^1.0.0",
24
24
  "zod": "^3.25.76"
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@polar-sh/sdk",
5
- "version": "0.35.2",
5
+ "version": "0.35.4",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polar-sh/sdk",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "author": "Speakeasy",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,14 +10,14 @@ import { safeParse } from "../lib/schemas.js";
10
10
  import { RequestOptions } from "../lib/sdks.js";
11
11
  import { resolveSecurity } from "../lib/security.js";
12
12
  import { pathToFunc } from "../lib/url.js";
13
- import {
14
- CustomerPaymentMethod,
15
- CustomerPaymentMethod$inboundSchema,
16
- } from "../models/components/customerpaymentmethod.js";
17
13
  import {
18
14
  CustomerPaymentMethodCreate,
19
15
  CustomerPaymentMethodCreate$outboundSchema,
20
16
  } from "../models/components/customerpaymentmethodcreate.js";
17
+ import {
18
+ CustomerPaymentMethodCreateResponse,
19
+ CustomerPaymentMethodCreateResponse$inboundSchema,
20
+ } from "../models/components/customerpaymentmethodcreateresponse.js";
21
21
  import {
22
22
  ConnectionError,
23
23
  InvalidRequestError,
@@ -51,7 +51,7 @@ export function customerPortalCustomersAddPaymentMethod(
51
51
  options?: RequestOptions,
52
52
  ): APIPromise<
53
53
  Result<
54
- CustomerPaymentMethod,
54
+ CustomerPaymentMethodCreateResponse,
55
55
  | HTTPValidationError
56
56
  | PolarError
57
57
  | ResponseValidationError
@@ -79,7 +79,7 @@ async function $do(
79
79
  ): Promise<
80
80
  [
81
81
  Result<
82
- CustomerPaymentMethod,
82
+ CustomerPaymentMethodCreateResponse,
83
83
  | HTTPValidationError
84
84
  | PolarError
85
85
  | ResponseValidationError
@@ -167,7 +167,7 @@ async function $do(
167
167
  };
168
168
 
169
169
  const [result] = await M.match<
170
- CustomerPaymentMethod,
170
+ CustomerPaymentMethodCreateResponse,
171
171
  | HTTPValidationError
172
172
  | PolarError
173
173
  | ResponseValidationError
@@ -178,7 +178,7 @@ async function $do(
178
178
  | UnexpectedClientError
179
179
  | SDKValidationError
180
180
  >(
181
- M.json(201, CustomerPaymentMethod$inboundSchema),
181
+ M.json(201, CustomerPaymentMethodCreateResponse$inboundSchema),
182
182
  M.jsonErr(422, HTTPValidationError$inboundSchema),
183
183
  M.fail("4XX"),
184
184
  M.fail("5XX"),
@@ -0,0 +1,201 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PolarCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { resolveSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ CustomerPaymentMethodConfirm,
15
+ CustomerPaymentMethodConfirm$outboundSchema,
16
+ } from "../models/components/customerpaymentmethodconfirm.js";
17
+ import {
18
+ CustomerPaymentMethodCreateResponse,
19
+ CustomerPaymentMethodCreateResponse$inboundSchema,
20
+ } from "../models/components/customerpaymentmethodcreateresponse.js";
21
+ import {
22
+ CustomerNotReady,
23
+ CustomerNotReady$inboundSchema,
24
+ } from "../models/errors/customernotready.js";
25
+ import {
26
+ ConnectionError,
27
+ InvalidRequestError,
28
+ RequestAbortedError,
29
+ RequestTimeoutError,
30
+ UnexpectedClientError,
31
+ } from "../models/errors/httpclienterrors.js";
32
+ import {
33
+ HTTPValidationError,
34
+ HTTPValidationError$inboundSchema,
35
+ } from "../models/errors/httpvalidationerror.js";
36
+ import { PolarError } from "../models/errors/polarerror.js";
37
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
38
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
39
+ import { CustomerPortalCustomersConfirmPaymentMethodSecurity } from "../models/operations/customerportalcustomersconfirmpaymentmethod.js";
40
+ import { APICall, APIPromise } from "../types/async.js";
41
+ import { Result } from "../types/fp.js";
42
+
43
+ /**
44
+ * Confirm Customer Payment Method
45
+ *
46
+ * @remarks
47
+ * Confirm a payment method for the authenticated customer.
48
+ *
49
+ * **Scopes**: `customer_portal:read` `customer_portal:write`
50
+ */
51
+ export function customerPortalCustomersConfirmPaymentMethod(
52
+ client: PolarCore,
53
+ security: CustomerPortalCustomersConfirmPaymentMethodSecurity,
54
+ request: CustomerPaymentMethodConfirm,
55
+ options?: RequestOptions,
56
+ ): APIPromise<
57
+ Result<
58
+ CustomerPaymentMethodCreateResponse,
59
+ | CustomerNotReady
60
+ | HTTPValidationError
61
+ | PolarError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >
70
+ > {
71
+ return new APIPromise($do(
72
+ client,
73
+ security,
74
+ request,
75
+ options,
76
+ ));
77
+ }
78
+
79
+ async function $do(
80
+ client: PolarCore,
81
+ security: CustomerPortalCustomersConfirmPaymentMethodSecurity,
82
+ request: CustomerPaymentMethodConfirm,
83
+ options?: RequestOptions,
84
+ ): Promise<
85
+ [
86
+ Result<
87
+ CustomerPaymentMethodCreateResponse,
88
+ | CustomerNotReady
89
+ | HTTPValidationError
90
+ | PolarError
91
+ | ResponseValidationError
92
+ | ConnectionError
93
+ | RequestAbortedError
94
+ | RequestTimeoutError
95
+ | InvalidRequestError
96
+ | UnexpectedClientError
97
+ | SDKValidationError
98
+ >,
99
+ APICall,
100
+ ]
101
+ > {
102
+ const parsed = safeParse(
103
+ request,
104
+ (value) => CustomerPaymentMethodConfirm$outboundSchema.parse(value),
105
+ "Input validation failed",
106
+ );
107
+ if (!parsed.ok) {
108
+ return [parsed, { status: "invalid" }];
109
+ }
110
+ const payload = parsed.value;
111
+ const body = encodeJSON("body", payload, { explode: true });
112
+
113
+ const path = pathToFunc(
114
+ "/v1/customer-portal/customers/me/payment-methods/confirm",
115
+ )();
116
+
117
+ const headers = new Headers(compactMap({
118
+ "Content-Type": "application/json",
119
+ Accept: "application/json",
120
+ }));
121
+
122
+ const requestSecurity = resolveSecurity(
123
+ [
124
+ {
125
+ fieldName: "Authorization",
126
+ type: "http:bearer",
127
+ value: security?.customerSession,
128
+ },
129
+ ],
130
+ );
131
+
132
+ const context = {
133
+ options: client._options,
134
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
135
+ operationID: "customer_portal:customers:confirm_payment_method",
136
+ oAuth2Scopes: null,
137
+
138
+ resolvedSecurity: requestSecurity,
139
+
140
+ securitySource: security,
141
+ retryConfig: options?.retries
142
+ || client._options.retryConfig
143
+ || { strategy: "none" },
144
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
145
+ };
146
+
147
+ const requestRes = client._createRequest(context, {
148
+ security: requestSecurity,
149
+ method: "POST",
150
+ baseURL: options?.serverURL,
151
+ path: path,
152
+ headers: headers,
153
+ body: body,
154
+ userAgent: client._options.userAgent,
155
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
156
+ }, options);
157
+ if (!requestRes.ok) {
158
+ return [requestRes, { status: "invalid" }];
159
+ }
160
+ const req = requestRes.value;
161
+
162
+ const doResult = await client._do(req, {
163
+ context,
164
+ errorCodes: ["400", "422", "4XX", "5XX"],
165
+ retryConfig: context.retryConfig,
166
+ retryCodes: context.retryCodes,
167
+ });
168
+ if (!doResult.ok) {
169
+ return [doResult, { status: "request-error", request: req }];
170
+ }
171
+ const response = doResult.value;
172
+
173
+ const responseFields = {
174
+ HttpMeta: { Response: response, Request: req },
175
+ };
176
+
177
+ const [result] = await M.match<
178
+ CustomerPaymentMethodCreateResponse,
179
+ | CustomerNotReady
180
+ | HTTPValidationError
181
+ | PolarError
182
+ | ResponseValidationError
183
+ | ConnectionError
184
+ | RequestAbortedError
185
+ | RequestTimeoutError
186
+ | InvalidRequestError
187
+ | UnexpectedClientError
188
+ | SDKValidationError
189
+ >(
190
+ M.json(201, CustomerPaymentMethodCreateResponse$inboundSchema),
191
+ M.jsonErr(400, CustomerNotReady$inboundSchema),
192
+ M.jsonErr(422, HTTPValidationError$inboundSchema),
193
+ M.fail("4XX"),
194
+ M.fail("5XX"),
195
+ )(response, req, { extraFields: responseFields });
196
+ if (!result.ok) {
197
+ return [result, { status: "complete", request: req, response }];
198
+ }
199
+
200
+ return [result, { status: "complete", request: req, response }];
201
+ }
@@ -0,0 +1,195 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PolarCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ CustomerBalance,
15
+ CustomerBalance$inboundSchema,
16
+ } from "../models/components/customerbalance.js";
17
+ import {
18
+ ConnectionError,
19
+ InvalidRequestError,
20
+ RequestAbortedError,
21
+ RequestTimeoutError,
22
+ UnexpectedClientError,
23
+ } from "../models/errors/httpclienterrors.js";
24
+ import {
25
+ HTTPValidationError,
26
+ HTTPValidationError$inboundSchema,
27
+ } from "../models/errors/httpvalidationerror.js";
28
+ import { PolarError } from "../models/errors/polarerror.js";
29
+ import {
30
+ ResourceNotFound,
31
+ ResourceNotFound$inboundSchema,
32
+ } from "../models/errors/resourcenotfound.js";
33
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
34
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
35
+ import {
36
+ CustomersGetBalanceRequest,
37
+ CustomersGetBalanceRequest$outboundSchema,
38
+ } from "../models/operations/customersgetbalance.js";
39
+ import { APICall, APIPromise } from "../types/async.js";
40
+ import { Result } from "../types/fp.js";
41
+
42
+ /**
43
+ * Get Customer Balance
44
+ *
45
+ * @remarks
46
+ * Get customer balance information.
47
+ *
48
+ * **Scopes**: `customers:read` `customers:write`
49
+ */
50
+ export function customersGetBalance(
51
+ client: PolarCore,
52
+ request: CustomersGetBalanceRequest,
53
+ options?: RequestOptions,
54
+ ): APIPromise<
55
+ Result<
56
+ CustomerBalance,
57
+ | ResourceNotFound
58
+ | HTTPValidationError
59
+ | PolarError
60
+ | ResponseValidationError
61
+ | ConnectionError
62
+ | RequestAbortedError
63
+ | RequestTimeoutError
64
+ | InvalidRequestError
65
+ | UnexpectedClientError
66
+ | SDKValidationError
67
+ >
68
+ > {
69
+ return new APIPromise($do(
70
+ client,
71
+ request,
72
+ options,
73
+ ));
74
+ }
75
+
76
+ async function $do(
77
+ client: PolarCore,
78
+ request: CustomersGetBalanceRequest,
79
+ options?: RequestOptions,
80
+ ): Promise<
81
+ [
82
+ Result<
83
+ CustomerBalance,
84
+ | ResourceNotFound
85
+ | HTTPValidationError
86
+ | PolarError
87
+ | ResponseValidationError
88
+ | ConnectionError
89
+ | RequestAbortedError
90
+ | RequestTimeoutError
91
+ | InvalidRequestError
92
+ | UnexpectedClientError
93
+ | SDKValidationError
94
+ >,
95
+ APICall,
96
+ ]
97
+ > {
98
+ const parsed = safeParse(
99
+ request,
100
+ (value) => CustomersGetBalanceRequest$outboundSchema.parse(value),
101
+ "Input validation failed",
102
+ );
103
+ if (!parsed.ok) {
104
+ return [parsed, { status: "invalid" }];
105
+ }
106
+ const payload = parsed.value;
107
+ const body = null;
108
+
109
+ const pathParams = {
110
+ id: encodeSimple("id", payload.id, {
111
+ explode: false,
112
+ charEncoding: "percent",
113
+ }),
114
+ };
115
+
116
+ const path = pathToFunc("/v1/customers/{id}/balance")(pathParams);
117
+
118
+ const headers = new Headers(compactMap({
119
+ Accept: "application/json",
120
+ }));
121
+
122
+ const secConfig = await extractSecurity(client._options.accessToken);
123
+ const securityInput = secConfig == null ? {} : { accessToken: secConfig };
124
+ const requestSecurity = resolveGlobalSecurity(securityInput);
125
+
126
+ const context = {
127
+ options: client._options,
128
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
129
+ operationID: "customers:get_balance",
130
+ oAuth2Scopes: [],
131
+
132
+ resolvedSecurity: requestSecurity,
133
+
134
+ securitySource: client._options.accessToken,
135
+ retryConfig: options?.retries
136
+ || client._options.retryConfig
137
+ || { strategy: "none" },
138
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
139
+ };
140
+
141
+ const requestRes = client._createRequest(context, {
142
+ security: requestSecurity,
143
+ method: "GET",
144
+ baseURL: options?.serverURL,
145
+ path: path,
146
+ headers: headers,
147
+ body: body,
148
+ userAgent: client._options.userAgent,
149
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
150
+ }, options);
151
+ if (!requestRes.ok) {
152
+ return [requestRes, { status: "invalid" }];
153
+ }
154
+ const req = requestRes.value;
155
+
156
+ const doResult = await client._do(req, {
157
+ context,
158
+ errorCodes: ["404", "422", "4XX", "5XX"],
159
+ retryConfig: context.retryConfig,
160
+ retryCodes: context.retryCodes,
161
+ });
162
+ if (!doResult.ok) {
163
+ return [doResult, { status: "request-error", request: req }];
164
+ }
165
+ const response = doResult.value;
166
+
167
+ const responseFields = {
168
+ HttpMeta: { Response: response, Request: req },
169
+ };
170
+
171
+ const [result] = await M.match<
172
+ CustomerBalance,
173
+ | ResourceNotFound
174
+ | HTTPValidationError
175
+ | PolarError
176
+ | ResponseValidationError
177
+ | ConnectionError
178
+ | RequestAbortedError
179
+ | RequestTimeoutError
180
+ | InvalidRequestError
181
+ | UnexpectedClientError
182
+ | SDKValidationError
183
+ >(
184
+ M.json(200, CustomerBalance$inboundSchema),
185
+ M.jsonErr(404, ResourceNotFound$inboundSchema),
186
+ M.jsonErr(422, HTTPValidationError$inboundSchema),
187
+ M.fail("4XX"),
188
+ M.fail("5XX"),
189
+ )(response, req, { extraFields: responseFields });
190
+ if (!result.ok) {
191
+ return [result, { status: "complete", request: req, response }];
192
+ }
193
+
194
+ return [result, { status: "complete", request: req, response }];
195
+ }
@@ -125,6 +125,7 @@ async function $do(
125
125
  "metadata": payload.metadata,
126
126
  }),
127
127
  encodeFormQuery({
128
+ "customer_aggregation_function": payload.customer_aggregation_function,
128
129
  "customer_id": payload.customer_id,
129
130
  "end_timestamp": payload.end_timestamp,
130
131
  "external_customer_id": payload.external_customer_id,
package/src/lib/config.ts CHANGED
@@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
64
64
  export const SDK_METADATA = {
65
65
  language: "typescript",
66
66
  openapiDocVersion: "0.1.0",
67
- sdkVersion: "0.35.2",
68
- genVersion: "2.709.0",
69
- userAgent: "speakeasy-sdk/typescript 0.35.2 2.709.0 0.1.0 @polar-sh/sdk",
67
+ sdkVersion: "0.35.4",
68
+ genVersion: "2.716.16",
69
+ userAgent: "speakeasy-sdk/typescript 0.35.4 2.716.16 0.1.0 @polar-sh/sdk",
70
70
  } as const;
package/src/lib/url.ts CHANGED
@@ -10,7 +10,7 @@ export function pathToFunc(
10
10
  pathPattern: string,
11
11
  options?: { charEncoding?: "percent" | "none" },
12
12
  ): (params?: Params) => string {
13
- const paramRE = /\{([a-zA-Z0-9_]+?)\}/g;
13
+ const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
14
14
 
15
15
  return function buildURLPath(params: Record<string, unknown> = {}): string {
16
16
  return pathPattern.replace(paramRE, function (_, placeholder) {
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.35.2",
22
+ currentVersion: "0.35.4",
23
23
  },
24
24
  });
25
25
 
@@ -20,6 +20,7 @@ import { tool$customersDelete } from "./tools/customersDelete.js";
20
20
  import { tool$customersDeleteExternal } from "./tools/customersDeleteExternal.js";
21
21
  import { tool$customersExport } from "./tools/customersExport.js";
22
22
  import { tool$customersGet } from "./tools/customersGet.js";
23
+ import { tool$customersGetBalance } from "./tools/customersGetBalance.js";
23
24
  import { tool$customersGetExternal } from "./tools/customersGetExternal.js";
24
25
  import { tool$customersGetState } from "./tools/customersGetState.js";
25
26
  import { tool$customersGetStateExternal } from "./tools/customersGetStateExternal.js";
@@ -56,7 +57,7 @@ export function createMCPServer(deps: {
56
57
  }) {
57
58
  const server = new McpServer({
58
59
  name: "Polar",
59
- version: "0.35.2",
60
+ version: "0.35.4",
60
61
  });
61
62
 
62
63
  const client = new PolarCore({
@@ -114,6 +115,7 @@ export function createMCPServer(deps: {
114
115
  tool(tool$customersDeleteExternal);
115
116
  tool(tool$customersGetState);
116
117
  tool(tool$customersGetStateExternal);
118
+ tool(tool$customersGetBalance);
117
119
  tool(tool$customerMetersList);
118
120
  tool(tool$customerMetersGet);
119
121
  tool(tool$paymentsList);