@polar-sh/sdk 0.46.2 → 0.46.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 (314) hide show
  1. package/README.md +2 -1
  2. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.d.ts +2 -1
  3. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.js +3 -2
  5. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.js.map +1 -1
  6. package/dist/commonjs/funcs/subscriptionsUpdate.d.ts +2 -1
  7. package/dist/commonjs/funcs/subscriptionsUpdate.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/subscriptionsUpdate.js +3 -2
  9. package/dist/commonjs/funcs/subscriptionsUpdate.js.map +1 -1
  10. package/dist/commonjs/lib/config.d.ts +3 -3
  11. package/dist/commonjs/lib/config.js +3 -3
  12. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.d.ts +15 -0
  13. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.js +2 -0
  15. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.js.map +1 -1
  16. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.d.ts +15 -0
  17. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.js +2 -0
  19. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.js.map +1 -1
  20. package/dist/commonjs/models/components/customercreate.d.ts +2 -9
  21. package/dist/commonjs/models/components/customercreate.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/customercreate.js +2 -9
  23. package/dist/commonjs/models/components/customercreate.js.map +1 -1
  24. package/dist/commonjs/models/components/customersubscription.d.ts +5 -0
  25. package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/customersubscription.js +3 -0
  27. package/dist/commonjs/models/components/customersubscription.js.map +1 -1
  28. package/dist/commonjs/models/components/customerupdate.d.ts +2 -9
  29. package/dist/commonjs/models/components/customerupdate.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/customerupdate.js +2 -9
  31. package/dist/commonjs/models/components/customerupdate.js.map +1 -1
  32. package/dist/commonjs/models/components/customerupdateexternalid.d.ts +2 -9
  33. package/dist/commonjs/models/components/customerupdateexternalid.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/customerupdateexternalid.js +2 -9
  35. package/dist/commonjs/models/components/customerupdateexternalid.js.map +1 -1
  36. package/dist/commonjs/models/components/discountcreate.d.ts +2 -2
  37. package/dist/commonjs/models/components/discountcreate.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/discountcreate.js +2 -2
  39. package/dist/commonjs/models/components/discountcreate.js.map +1 -1
  40. package/dist/commonjs/models/components/discountfixedonceforeverduration.d.ts +12 -0
  41. package/dist/commonjs/models/components/discountfixedonceforeverduration.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/discountfixedonceforeverduration.js +1 -0
  43. package/dist/commonjs/models/components/discountfixedonceforeverduration.js.map +1 -1
  44. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.d.ts +15 -0
  45. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.js +2 -0
  47. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.js.map +1 -1
  48. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.d.ts +14 -5
  49. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.js +3 -2
  51. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.js.map +1 -1
  52. package/dist/commonjs/models/components/discountfixedrepeatduration.d.ts +12 -0
  53. package/dist/commonjs/models/components/discountfixedrepeatduration.d.ts.map +1 -1
  54. package/dist/commonjs/models/components/discountfixedrepeatduration.js +1 -0
  55. package/dist/commonjs/models/components/discountfixedrepeatduration.js.map +1 -1
  56. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.d.ts +15 -0
  57. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.d.ts.map +1 -1
  58. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.js +2 -0
  59. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.js.map +1 -1
  60. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.d.ts +14 -5
  61. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.d.ts.map +1 -1
  62. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.js +3 -2
  63. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.js.map +1 -1
  64. package/dist/commonjs/models/components/discountsortproperty.d.ts +2 -0
  65. package/dist/commonjs/models/components/discountsortproperty.d.ts.map +1 -1
  66. package/dist/commonjs/models/components/discountsortproperty.js +2 -0
  67. package/dist/commonjs/models/components/discountsortproperty.js.map +1 -1
  68. package/dist/commonjs/models/components/discountupdate.d.ts +12 -0
  69. package/dist/commonjs/models/components/discountupdate.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/discountupdate.js +1 -0
  71. package/dist/commonjs/models/components/discountupdate.js.map +1 -1
  72. package/dist/commonjs/models/components/metricperiod.d.ts +5 -5
  73. package/dist/commonjs/models/components/metricperiod.d.ts.map +1 -1
  74. package/dist/commonjs/models/components/metricperiod.js +9 -9
  75. package/dist/commonjs/models/components/metricperiod.js.map +1 -1
  76. package/dist/commonjs/models/components/metrics.d.ts +1 -1
  77. package/dist/commonjs/models/components/metrics.d.ts.map +1 -1
  78. package/dist/commonjs/models/components/metrics.js +2 -2
  79. package/dist/commonjs/models/components/metrics.js.map +1 -1
  80. package/dist/commonjs/models/components/metricstotals.d.ts +5 -5
  81. package/dist/commonjs/models/components/metricstotals.d.ts.map +1 -1
  82. package/dist/commonjs/models/components/metricstotals.js +9 -9
  83. package/dist/commonjs/models/components/metricstotals.js.map +1 -1
  84. package/dist/commonjs/models/components/organizationcustomeremailsettings.d.ts +4 -0
  85. package/dist/commonjs/models/components/organizationcustomeremailsettings.d.ts.map +1 -1
  86. package/dist/commonjs/models/components/organizationcustomeremailsettings.js +8 -0
  87. package/dist/commonjs/models/components/organizationcustomeremailsettings.js.map +1 -1
  88. package/dist/commonjs/models/components/pendingsubscriptionupdate.d.ts +48 -0
  89. package/dist/commonjs/models/components/pendingsubscriptionupdate.d.ts.map +1 -0
  90. package/dist/commonjs/models/components/pendingsubscriptionupdate.js +83 -0
  91. package/dist/commonjs/models/components/pendingsubscriptionupdate.js.map +1 -0
  92. package/dist/commonjs/models/components/subscription.d.ts +6 -0
  93. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  94. package/dist/commonjs/models/components/subscription.js +5 -0
  95. package/dist/commonjs/models/components/subscription.js.map +1 -1
  96. package/dist/commonjs/models/components/subscriptionprorationbehavior.d.ts +1 -0
  97. package/dist/commonjs/models/components/subscriptionprorationbehavior.d.ts.map +1 -1
  98. package/dist/commonjs/models/components/subscriptionprorationbehavior.js +1 -0
  99. package/dist/commonjs/models/components/subscriptionprorationbehavior.js.map +1 -1
  100. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.d.ts +11 -0
  101. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.d.ts.map +1 -0
  102. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.js +57 -0
  103. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.js.map +1 -0
  104. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.d.ts +11 -0
  105. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.d.ts.map +1 -0
  106. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.js +57 -0
  107. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.js.map +1 -0
  108. package/dist/commonjs/models/components/subscriptionupdatedevent.d.ts +75 -0
  109. package/dist/commonjs/models/components/subscriptionupdatedevent.d.ts.map +1 -0
  110. package/dist/commonjs/models/components/subscriptionupdatedevent.js +99 -0
  111. package/dist/commonjs/models/components/subscriptionupdatedevent.js.map +1 -0
  112. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.d.ts +13 -0
  113. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.d.ts.map +1 -0
  114. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.js +60 -0
  115. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.js.map +1 -0
  116. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.d.ts +13 -0
  117. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.d.ts.map +1 -0
  118. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.js +59 -0
  119. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.js.map +1 -0
  120. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.d.ts +11 -0
  121. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.d.ts.map +1 -0
  122. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.js +57 -0
  123. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.js.map +1 -0
  124. package/dist/commonjs/models/components/systemevent.d.ts +2 -1
  125. package/dist/commonjs/models/components/systemevent.d.ts.map +1 -1
  126. package/dist/commonjs/models/components/systemevent.js +2 -0
  127. package/dist/commonjs/models/components/systemevent.js.map +1 -1
  128. package/dist/commonjs/models/components/tokenresponse.d.ts +2 -2
  129. package/dist/commonjs/models/components/tokenresponse.d.ts.map +1 -1
  130. package/dist/commonjs/models/components/tokenresponse.js +2 -2
  131. package/dist/commonjs/models/components/tokenresponse.js.map +1 -1
  132. package/dist/commonjs/models/errors/paymentfailed.d.ts +20 -0
  133. package/dist/commonjs/models/errors/paymentfailed.d.ts.map +1 -0
  134. package/dist/commonjs/models/errors/paymentfailed.js +69 -0
  135. package/dist/commonjs/models/errors/paymentfailed.js.map +1 -0
  136. package/dist/commonjs/webhooks.d.ts +1 -1
  137. package/dist/commonjs/webhooks.d.ts.map +1 -1
  138. package/dist/commonjs/webhooks.js +15 -0
  139. package/dist/commonjs/webhooks.js.map +1 -1
  140. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.d.ts +2 -1
  141. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.d.ts.map +1 -1
  142. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.js +3 -2
  143. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.js.map +1 -1
  144. package/dist/esm/funcs/subscriptionsUpdate.d.ts +2 -1
  145. package/dist/esm/funcs/subscriptionsUpdate.d.ts.map +1 -1
  146. package/dist/esm/funcs/subscriptionsUpdate.js +3 -2
  147. package/dist/esm/funcs/subscriptionsUpdate.js.map +1 -1
  148. package/dist/esm/lib/config.d.ts +3 -3
  149. package/dist/esm/lib/config.js +3 -3
  150. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.d.ts +15 -0
  151. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.d.ts.map +1 -1
  152. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.js +2 -0
  153. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.js.map +1 -1
  154. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.d.ts +15 -0
  155. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.d.ts.map +1 -1
  156. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.js +2 -0
  157. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.js.map +1 -1
  158. package/dist/esm/models/components/customercreate.d.ts +2 -9
  159. package/dist/esm/models/components/customercreate.d.ts.map +1 -1
  160. package/dist/esm/models/components/customercreate.js +1 -7
  161. package/dist/esm/models/components/customercreate.js.map +1 -1
  162. package/dist/esm/models/components/customersubscription.d.ts +5 -0
  163. package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
  164. package/dist/esm/models/components/customersubscription.js +3 -0
  165. package/dist/esm/models/components/customersubscription.js.map +1 -1
  166. package/dist/esm/models/components/customerupdate.d.ts +2 -9
  167. package/dist/esm/models/components/customerupdate.d.ts.map +1 -1
  168. package/dist/esm/models/components/customerupdate.js +1 -7
  169. package/dist/esm/models/components/customerupdate.js.map +1 -1
  170. package/dist/esm/models/components/customerupdateexternalid.d.ts +2 -9
  171. package/dist/esm/models/components/customerupdateexternalid.d.ts.map +1 -1
  172. package/dist/esm/models/components/customerupdateexternalid.js +1 -7
  173. package/dist/esm/models/components/customerupdateexternalid.js.map +1 -1
  174. package/dist/esm/models/components/discountcreate.d.ts +2 -2
  175. package/dist/esm/models/components/discountcreate.d.ts.map +1 -1
  176. package/dist/esm/models/components/discountcreate.js +2 -2
  177. package/dist/esm/models/components/discountcreate.js.map +1 -1
  178. package/dist/esm/models/components/discountfixedonceforeverduration.d.ts +12 -0
  179. package/dist/esm/models/components/discountfixedonceforeverduration.d.ts.map +1 -1
  180. package/dist/esm/models/components/discountfixedonceforeverduration.js +1 -0
  181. package/dist/esm/models/components/discountfixedonceforeverduration.js.map +1 -1
  182. package/dist/esm/models/components/discountfixedonceforeverdurationbase.d.ts +15 -0
  183. package/dist/esm/models/components/discountfixedonceforeverdurationbase.d.ts.map +1 -1
  184. package/dist/esm/models/components/discountfixedonceforeverdurationbase.js +2 -0
  185. package/dist/esm/models/components/discountfixedonceforeverdurationbase.js.map +1 -1
  186. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.d.ts +14 -5
  187. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.d.ts.map +1 -1
  188. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.js +3 -2
  189. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.js.map +1 -1
  190. package/dist/esm/models/components/discountfixedrepeatduration.d.ts +12 -0
  191. package/dist/esm/models/components/discountfixedrepeatduration.d.ts.map +1 -1
  192. package/dist/esm/models/components/discountfixedrepeatduration.js +1 -0
  193. package/dist/esm/models/components/discountfixedrepeatduration.js.map +1 -1
  194. package/dist/esm/models/components/discountfixedrepeatdurationbase.d.ts +15 -0
  195. package/dist/esm/models/components/discountfixedrepeatdurationbase.d.ts.map +1 -1
  196. package/dist/esm/models/components/discountfixedrepeatdurationbase.js +2 -0
  197. package/dist/esm/models/components/discountfixedrepeatdurationbase.js.map +1 -1
  198. package/dist/esm/models/components/discountfixedrepeatdurationcreate.d.ts +14 -5
  199. package/dist/esm/models/components/discountfixedrepeatdurationcreate.d.ts.map +1 -1
  200. package/dist/esm/models/components/discountfixedrepeatdurationcreate.js +3 -2
  201. package/dist/esm/models/components/discountfixedrepeatdurationcreate.js.map +1 -1
  202. package/dist/esm/models/components/discountsortproperty.d.ts +2 -0
  203. package/dist/esm/models/components/discountsortproperty.d.ts.map +1 -1
  204. package/dist/esm/models/components/discountsortproperty.js +2 -0
  205. package/dist/esm/models/components/discountsortproperty.js.map +1 -1
  206. package/dist/esm/models/components/discountupdate.d.ts +12 -0
  207. package/dist/esm/models/components/discountupdate.d.ts.map +1 -1
  208. package/dist/esm/models/components/discountupdate.js +1 -0
  209. package/dist/esm/models/components/discountupdate.js.map +1 -1
  210. package/dist/esm/models/components/metricperiod.d.ts +5 -5
  211. package/dist/esm/models/components/metricperiod.d.ts.map +1 -1
  212. package/dist/esm/models/components/metricperiod.js +7 -7
  213. package/dist/esm/models/components/metricperiod.js.map +1 -1
  214. package/dist/esm/models/components/metrics.d.ts +1 -1
  215. package/dist/esm/models/components/metrics.d.ts.map +1 -1
  216. package/dist/esm/models/components/metrics.js +2 -2
  217. package/dist/esm/models/components/metrics.js.map +1 -1
  218. package/dist/esm/models/components/metricstotals.d.ts +5 -5
  219. package/dist/esm/models/components/metricstotals.d.ts.map +1 -1
  220. package/dist/esm/models/components/metricstotals.js +7 -7
  221. package/dist/esm/models/components/metricstotals.js.map +1 -1
  222. package/dist/esm/models/components/organizationcustomeremailsettings.d.ts +4 -0
  223. package/dist/esm/models/components/organizationcustomeremailsettings.d.ts.map +1 -1
  224. package/dist/esm/models/components/organizationcustomeremailsettings.js +8 -0
  225. package/dist/esm/models/components/organizationcustomeremailsettings.js.map +1 -1
  226. package/dist/esm/models/components/pendingsubscriptionupdate.d.ts +48 -0
  227. package/dist/esm/models/components/pendingsubscriptionupdate.d.ts.map +1 -0
  228. package/dist/esm/models/components/pendingsubscriptionupdate.js +45 -0
  229. package/dist/esm/models/components/pendingsubscriptionupdate.js.map +1 -0
  230. package/dist/esm/models/components/subscription.d.ts +6 -0
  231. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  232. package/dist/esm/models/components/subscription.js +5 -0
  233. package/dist/esm/models/components/subscription.js.map +1 -1
  234. package/dist/esm/models/components/subscriptionprorationbehavior.d.ts +1 -0
  235. package/dist/esm/models/components/subscriptionprorationbehavior.d.ts.map +1 -1
  236. package/dist/esm/models/components/subscriptionprorationbehavior.js +1 -0
  237. package/dist/esm/models/components/subscriptionprorationbehavior.js.map +1 -1
  238. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.d.ts +11 -0
  239. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.d.ts.map +1 -0
  240. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.js +20 -0
  241. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.js.map +1 -0
  242. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.d.ts +11 -0
  243. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.d.ts.map +1 -0
  244. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.js +20 -0
  245. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.js.map +1 -0
  246. package/dist/esm/models/components/subscriptionupdatedevent.d.ts +75 -0
  247. package/dist/esm/models/components/subscriptionupdatedevent.d.ts.map +1 -0
  248. package/dist/esm/models/components/subscriptionupdatedevent.js +61 -0
  249. package/dist/esm/models/components/subscriptionupdatedevent.js.map +1 -0
  250. package/dist/esm/models/components/subscriptionupdatedproductmetadata.d.ts +13 -0
  251. package/dist/esm/models/components/subscriptionupdatedproductmetadata.d.ts.map +1 -0
  252. package/dist/esm/models/components/subscriptionupdatedproductmetadata.js +23 -0
  253. package/dist/esm/models/components/subscriptionupdatedproductmetadata.js.map +1 -0
  254. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.d.ts +13 -0
  255. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.d.ts.map +1 -0
  256. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.js +22 -0
  257. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.js.map +1 -0
  258. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.d.ts +11 -0
  259. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.d.ts.map +1 -0
  260. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.js +20 -0
  261. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.js.map +1 -0
  262. package/dist/esm/models/components/systemevent.d.ts +2 -1
  263. package/dist/esm/models/components/systemevent.d.ts.map +1 -1
  264. package/dist/esm/models/components/systemevent.js +2 -0
  265. package/dist/esm/models/components/systemevent.js.map +1 -1
  266. package/dist/esm/models/components/tokenresponse.d.ts +2 -2
  267. package/dist/esm/models/components/tokenresponse.d.ts.map +1 -1
  268. package/dist/esm/models/components/tokenresponse.js +2 -2
  269. package/dist/esm/models/components/tokenresponse.js.map +1 -1
  270. package/dist/esm/models/errors/paymentfailed.d.ts +20 -0
  271. package/dist/esm/models/errors/paymentfailed.d.ts.map +1 -0
  272. package/dist/esm/models/errors/paymentfailed.js +32 -0
  273. package/dist/esm/models/errors/paymentfailed.js.map +1 -0
  274. package/dist/esm/webhooks.d.ts +1 -1
  275. package/dist/esm/webhooks.d.ts.map +1 -1
  276. package/dist/esm/webhooks.js +15 -0
  277. package/dist/esm/webhooks.js.map +1 -1
  278. package/jsr.json +1 -1
  279. package/package.json +1 -1
  280. package/src/funcs/customerPortalSubscriptionsUpdate.ts +9 -1
  281. package/src/funcs/subscriptionsUpdate.ts +9 -1
  282. package/src/lib/config.ts +3 -3
  283. package/src/models/components/checkoutdiscountfixedonceforeverduration.ts +13 -0
  284. package/src/models/components/checkoutdiscountfixedrepeatduration.ts +13 -0
  285. package/src/models/components/customercreate.ts +3 -29
  286. package/src/models/components/customersubscription.ts +10 -0
  287. package/src/models/components/customerupdate.ts +3 -29
  288. package/src/models/components/customerupdateexternalid.ts +3 -31
  289. package/src/models/components/discountcreate.ts +8 -8
  290. package/src/models/components/discountfixedonceforeverduration.ts +11 -0
  291. package/src/models/components/discountfixedonceforeverdurationbase.ts +13 -0
  292. package/src/models/components/discountfixedonceforeverdurationcreate.ts +13 -7
  293. package/src/models/components/discountfixedrepeatduration.ts +11 -0
  294. package/src/models/components/discountfixedrepeatdurationbase.ts +13 -0
  295. package/src/models/components/discountfixedrepeatdurationcreate.ts +13 -7
  296. package/src/models/components/discountsortproperty.ts +2 -0
  297. package/src/models/components/discountupdate.ts +9 -0
  298. package/src/models/components/metricperiod.ts +23 -23
  299. package/src/models/components/metrics.ts +3 -3
  300. package/src/models/components/metricstotals.ts +23 -23
  301. package/src/models/components/organizationcustomeremailsettings.ts +14 -0
  302. package/src/models/components/pendingsubscriptionupdate.ts +119 -0
  303. package/src/models/components/subscription.ts +15 -0
  304. package/src/models/components/subscriptionprorationbehavior.ts +1 -0
  305. package/src/models/components/subscriptionupdatedbillingperiodmetadata.ts +45 -0
  306. package/src/models/components/subscriptionupdateddiscountmetadata.ts +42 -0
  307. package/src/models/components/subscriptionupdatedevent.ts +177 -0
  308. package/src/models/components/subscriptionupdatedproductmetadata.ts +49 -0
  309. package/src/models/components/subscriptionupdatedseatsmetadata.ts +47 -0
  310. package/src/models/components/subscriptionupdatedtrialmetadata.ts +41 -0
  311. package/src/models/components/systemevent.ts +7 -1
  312. package/src/models/components/tokenresponse.ts +4 -4
  313. package/src/models/errors/paymentfailed.ts +55 -0
  314. package/src/webhooks.ts +15 -0
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
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
+ SubscriptionProrationBehavior,
12
+ SubscriptionProrationBehavior$inboundSchema,
13
+ } from "./subscriptionprorationbehavior.js";
14
+
15
+ export type SubscriptionUpdatedSeatsMetadata = {
16
+ subscriptionId: string;
17
+ seats: number;
18
+ prorationBehavior: SubscriptionProrationBehavior;
19
+ };
20
+
21
+ /** @internal */
22
+ export const SubscriptionUpdatedSeatsMetadata$inboundSchema: z.ZodMiniType<
23
+ SubscriptionUpdatedSeatsMetadata,
24
+ unknown
25
+ > = z.pipe(
26
+ z.object({
27
+ subscription_id: z.string(),
28
+ seats: z.int(),
29
+ proration_behavior: SubscriptionProrationBehavior$inboundSchema,
30
+ }),
31
+ z.transform((v) => {
32
+ return remap$(v, {
33
+ "subscription_id": "subscriptionId",
34
+ "proration_behavior": "prorationBehavior",
35
+ });
36
+ }),
37
+ );
38
+
39
+ export function subscriptionUpdatedSeatsMetadataFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<SubscriptionUpdatedSeatsMetadata, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => SubscriptionUpdatedSeatsMetadata$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'SubscriptionUpdatedSeatsMetadata' from JSON`,
46
+ );
47
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
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 SubscriptionUpdatedTrialMetadata = {
12
+ subscriptionId: string;
13
+ trialEnd: string;
14
+ };
15
+
16
+ /** @internal */
17
+ export const SubscriptionUpdatedTrialMetadata$inboundSchema: z.ZodMiniType<
18
+ SubscriptionUpdatedTrialMetadata,
19
+ unknown
20
+ > = z.pipe(
21
+ z.object({
22
+ subscription_id: z.string(),
23
+ trial_end: z.string(),
24
+ }),
25
+ z.transform((v) => {
26
+ return remap$(v, {
27
+ "subscription_id": "subscriptionId",
28
+ "trial_end": "trialEnd",
29
+ });
30
+ }),
31
+ );
32
+
33
+ export function subscriptionUpdatedTrialMetadataFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<SubscriptionUpdatedTrialMetadata, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) => SubscriptionUpdatedTrialMetadata$inboundSchema.parse(JSON.parse(x)),
39
+ `Failed to parse 'SubscriptionUpdatedTrialMetadata' from JSON`,
40
+ );
41
+ }
@@ -110,6 +110,10 @@ import {
110
110
  SubscriptionUncanceledEvent,
111
111
  SubscriptionUncanceledEvent$inboundSchema,
112
112
  } from "./subscriptionuncanceledevent.js";
113
+ import {
114
+ SubscriptionUpdatedEvent,
115
+ SubscriptionUpdatedEvent$inboundSchema,
116
+ } from "./subscriptionupdatedevent.js";
113
117
 
114
118
  export type SystemEvent =
115
119
  | BalanceCreditOrderEvent
@@ -137,7 +141,8 @@ export type SystemEvent =
137
141
  | SubscriptionProductUpdatedEvent
138
142
  | SubscriptionRevokedEvent
139
143
  | SubscriptionSeatsUpdatedEvent
140
- | SubscriptionUncanceledEvent;
144
+ | SubscriptionUncanceledEvent
145
+ | SubscriptionUpdatedEvent;
141
146
 
142
147
  /** @internal */
143
148
  export const SystemEvent$inboundSchema: z.ZodMiniType<SystemEvent, unknown> = z
@@ -168,6 +173,7 @@ export const SystemEvent$inboundSchema: z.ZodMiniType<SystemEvent, unknown> = z
168
173
  SubscriptionRevokedEvent$inboundSchema,
169
174
  SubscriptionSeatsUpdatedEvent$inboundSchema,
170
175
  SubscriptionUncanceledEvent$inboundSchema,
176
+ SubscriptionUpdatedEvent$inboundSchema,
171
177
  ]);
172
178
 
173
179
  export function systemEventFromJSON(
@@ -12,9 +12,9 @@ export type TokenResponse = {
12
12
  accessToken: string;
13
13
  tokenType: "Bearer";
14
14
  expiresIn: number;
15
- refreshToken: string | null;
15
+ refreshToken?: string | null | undefined;
16
16
  scope: string;
17
- idToken: string;
17
+ idToken?: string | null | undefined;
18
18
  };
19
19
 
20
20
  /** @internal */
@@ -26,9 +26,9 @@ export const TokenResponse$inboundSchema: z.ZodMiniType<
26
26
  access_token: z.string(),
27
27
  token_type: z.literal("Bearer"),
28
28
  expires_in: z.int(),
29
- refresh_token: z.nullable(z.string()),
29
+ refresh_token: z.optional(z.nullable(z.string())),
30
30
  scope: z.string(),
31
- id_token: z.string(),
31
+ id_token: z.optional(z.nullable(z.string())),
32
32
  }),
33
33
  z.transform((v) => {
34
34
  return remap$(v, {
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { PolarError } from "./polarerror.js";
7
+
8
+ export type PaymentFailedData = {
9
+ error: "PaymentFailed";
10
+ detail: string;
11
+ };
12
+
13
+ export class PaymentFailed extends PolarError {
14
+ error: "PaymentFailed";
15
+ detail: string;
16
+
17
+ /** The original data that was passed to this error instance. */
18
+ data$: PaymentFailedData;
19
+
20
+ constructor(
21
+ err: PaymentFailedData,
22
+ httpMeta: { response: Response; request: Request; body: string },
23
+ ) {
24
+ const message = "message" in err && typeof err.message === "string"
25
+ ? err.message
26
+ : `API error occurred: ${JSON.stringify(err)}`;
27
+ super(message, httpMeta);
28
+ this.data$ = err;
29
+ this.error = err.error;
30
+ this.detail = err.detail;
31
+
32
+ this.name = "PaymentFailed";
33
+ }
34
+ }
35
+
36
+ /** @internal */
37
+ export const PaymentFailed$inboundSchema: z.ZodMiniType<
38
+ PaymentFailed,
39
+ unknown
40
+ > = z.pipe(
41
+ z.object({
42
+ error: z.literal("PaymentFailed"),
43
+ detail: z.string(),
44
+ request$: z.custom<Request>(x => x instanceof Request),
45
+ response$: z.custom<Response>(x => x instanceof Response),
46
+ body$: z.string(),
47
+ }),
48
+ z.transform((v) => {
49
+ return new PaymentFailed(v, {
50
+ request: v.request$,
51
+ response: v.response$,
52
+ body: v.body$,
53
+ });
54
+ }),
55
+ );
package/src/webhooks.ts CHANGED
@@ -33,6 +33,11 @@ import { WebhookCustomerStateChangedPayload$inboundSchema } from "./models/compo
33
33
  import { WebhookCustomerSeatAssignedPayload$inboundSchema } from "./models/components/webhookcustomerseatassignedpayload.js";
34
34
  import { WebhookCustomerSeatClaimedPayload$inboundSchema } from "./models/components/webhookcustomerseatclaimedpayload.js";
35
35
  import { WebhookCustomerSeatRevokedPayload$inboundSchema } from "./models/components/webhookcustomerseatrevokedpayload.js";
36
+ import { WebhookMemberCreatedPayload$inboundSchema } from "./models/components/webhookmembercreatedpayload.js";
37
+ import { WebhookMemberUpdatedPayload$inboundSchema } from "./models/components/webhookmemberupdatedpayload.js";
38
+ import { WebhookMemberDeletedPayload$inboundSchema } from "./models/components/webhookmemberdeletedpayload.js";
39
+ import { WebhookCheckoutExpiredPayload$inboundSchema } from "./models/components/webhookcheckoutexpiredpayload.js";
40
+ import { WebhookSubscriptionPastDuePayload$inboundSchema } from "./models/components/webhooksubscriptionpastduepayload.js";
36
41
  import { SDKValidationError } from "./models/errors/sdkvalidationerror.js";
37
42
 
38
43
  class WebhookVerificationError extends Error {
@@ -59,6 +64,12 @@ const parseEvent = (parsed: any) => {
59
64
  return WebhookCustomerSeatClaimedPayload$inboundSchema.parse(parsed);
60
65
  case "customer_seat.revoked":
61
66
  return WebhookCustomerSeatRevokedPayload$inboundSchema.parse(parsed);
67
+ case "member.created":
68
+ return WebhookMemberCreatedPayload$inboundSchema.parse(parsed);
69
+ case "member.updated":
70
+ return WebhookMemberUpdatedPayload$inboundSchema.parse(parsed);
71
+ case "member.deleted":
72
+ return WebhookMemberDeletedPayload$inboundSchema.parse(parsed);
62
73
  case "benefit.created":
63
74
  return WebhookBenefitCreatedPayload$inboundSchema.parse(parsed);
64
75
  case "benefit_grant.created":
@@ -75,6 +86,8 @@ const parseEvent = (parsed: any) => {
75
86
  return WebhookCheckoutCreatedPayload$inboundSchema.parse(parsed);
76
87
  case "checkout.updated":
77
88
  return WebhookCheckoutUpdatedPayload$inboundSchema.parse(parsed);
89
+ case "checkout.expired":
90
+ return WebhookCheckoutExpiredPayload$inboundSchema.parse(parsed);
78
91
  case "order.created":
79
92
  return WebhookOrderCreatedPayload$inboundSchema.parse(parsed);
80
93
  case "order.paid":
@@ -105,6 +118,8 @@ const parseEvent = (parsed: any) => {
105
118
  return WebhookSubscriptionUncanceledPayload$inboundSchema.parse(parsed);
106
119
  case "subscription.updated":
107
120
  return WebhookSubscriptionUpdatedPayload$inboundSchema.parse(parsed);
121
+ case "subscription.past_due":
122
+ return WebhookSubscriptionPastDuePayload$inboundSchema.parse(parsed);
108
123
  default:
109
124
  throw new SDKValidationError(
110
125
  `Unknown event type: ${parsed.type}`,