@polar-sh/sdk 0.46.3 → 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 (269) 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/customersubscription.d.ts +5 -0
  21. package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/customersubscription.js +3 -0
  23. package/dist/commonjs/models/components/customersubscription.js.map +1 -1
  24. package/dist/commonjs/models/components/discountcreate.d.ts +2 -2
  25. package/dist/commonjs/models/components/discountcreate.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/discountcreate.js +2 -2
  27. package/dist/commonjs/models/components/discountcreate.js.map +1 -1
  28. package/dist/commonjs/models/components/discountfixedonceforeverduration.d.ts +12 -0
  29. package/dist/commonjs/models/components/discountfixedonceforeverduration.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/discountfixedonceforeverduration.js +1 -0
  31. package/dist/commonjs/models/components/discountfixedonceforeverduration.js.map +1 -1
  32. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.d.ts +15 -0
  33. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.js +2 -0
  35. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.js.map +1 -1
  36. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.d.ts +14 -5
  37. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.js +3 -2
  39. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.js.map +1 -1
  40. package/dist/commonjs/models/components/discountfixedrepeatduration.d.ts +12 -0
  41. package/dist/commonjs/models/components/discountfixedrepeatduration.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/discountfixedrepeatduration.js +1 -0
  43. package/dist/commonjs/models/components/discountfixedrepeatduration.js.map +1 -1
  44. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.d.ts +15 -0
  45. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.js +2 -0
  47. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.js.map +1 -1
  48. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.d.ts +14 -5
  49. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.js +3 -2
  51. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.js.map +1 -1
  52. package/dist/commonjs/models/components/discountupdate.d.ts +12 -0
  53. package/dist/commonjs/models/components/discountupdate.d.ts.map +1 -1
  54. package/dist/commonjs/models/components/discountupdate.js +1 -0
  55. package/dist/commonjs/models/components/discountupdate.js.map +1 -1
  56. package/dist/commonjs/models/components/metricperiod.d.ts +5 -5
  57. package/dist/commonjs/models/components/metricperiod.d.ts.map +1 -1
  58. package/dist/commonjs/models/components/metricperiod.js +9 -9
  59. package/dist/commonjs/models/components/metricperiod.js.map +1 -1
  60. package/dist/commonjs/models/components/metrics.d.ts +1 -1
  61. package/dist/commonjs/models/components/metrics.d.ts.map +1 -1
  62. package/dist/commonjs/models/components/metrics.js +2 -2
  63. package/dist/commonjs/models/components/metrics.js.map +1 -1
  64. package/dist/commonjs/models/components/metricstotals.d.ts +5 -5
  65. package/dist/commonjs/models/components/metricstotals.d.ts.map +1 -1
  66. package/dist/commonjs/models/components/metricstotals.js +9 -9
  67. package/dist/commonjs/models/components/metricstotals.js.map +1 -1
  68. package/dist/commonjs/models/components/organizationcustomeremailsettings.d.ts +4 -0
  69. package/dist/commonjs/models/components/organizationcustomeremailsettings.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/organizationcustomeremailsettings.js +8 -0
  71. package/dist/commonjs/models/components/organizationcustomeremailsettings.js.map +1 -1
  72. package/dist/commonjs/models/components/pendingsubscriptionupdate.d.ts +48 -0
  73. package/dist/commonjs/models/components/pendingsubscriptionupdate.d.ts.map +1 -0
  74. package/dist/commonjs/models/components/pendingsubscriptionupdate.js +83 -0
  75. package/dist/commonjs/models/components/pendingsubscriptionupdate.js.map +1 -0
  76. package/dist/commonjs/models/components/subscription.d.ts +6 -0
  77. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  78. package/dist/commonjs/models/components/subscription.js +5 -0
  79. package/dist/commonjs/models/components/subscription.js.map +1 -1
  80. package/dist/commonjs/models/components/subscriptionprorationbehavior.d.ts +1 -0
  81. package/dist/commonjs/models/components/subscriptionprorationbehavior.d.ts.map +1 -1
  82. package/dist/commonjs/models/components/subscriptionprorationbehavior.js +1 -0
  83. package/dist/commonjs/models/components/subscriptionprorationbehavior.js.map +1 -1
  84. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.d.ts +11 -0
  85. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.d.ts.map +1 -0
  86. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.js +57 -0
  87. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.js.map +1 -0
  88. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.d.ts +11 -0
  89. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.d.ts.map +1 -0
  90. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.js +57 -0
  91. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.js.map +1 -0
  92. package/dist/commonjs/models/components/subscriptionupdatedevent.d.ts +75 -0
  93. package/dist/commonjs/models/components/subscriptionupdatedevent.d.ts.map +1 -0
  94. package/dist/commonjs/models/components/subscriptionupdatedevent.js +99 -0
  95. package/dist/commonjs/models/components/subscriptionupdatedevent.js.map +1 -0
  96. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.d.ts +13 -0
  97. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.d.ts.map +1 -0
  98. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.js +60 -0
  99. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.js.map +1 -0
  100. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.d.ts +13 -0
  101. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.d.ts.map +1 -0
  102. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.js +59 -0
  103. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.js.map +1 -0
  104. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.d.ts +11 -0
  105. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.d.ts.map +1 -0
  106. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.js +57 -0
  107. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.js.map +1 -0
  108. package/dist/commonjs/models/components/systemevent.d.ts +2 -1
  109. package/dist/commonjs/models/components/systemevent.d.ts.map +1 -1
  110. package/dist/commonjs/models/components/systemevent.js +2 -0
  111. package/dist/commonjs/models/components/systemevent.js.map +1 -1
  112. package/dist/commonjs/models/errors/paymentfailed.d.ts +20 -0
  113. package/dist/commonjs/models/errors/paymentfailed.d.ts.map +1 -0
  114. package/dist/commonjs/models/errors/paymentfailed.js +69 -0
  115. package/dist/commonjs/models/errors/paymentfailed.js.map +1 -0
  116. package/dist/commonjs/webhooks.d.ts +1 -1
  117. package/dist/commonjs/webhooks.d.ts.map +1 -1
  118. package/dist/commonjs/webhooks.js +15 -0
  119. package/dist/commonjs/webhooks.js.map +1 -1
  120. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.d.ts +2 -1
  121. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.d.ts.map +1 -1
  122. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.js +3 -2
  123. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.js.map +1 -1
  124. package/dist/esm/funcs/subscriptionsUpdate.d.ts +2 -1
  125. package/dist/esm/funcs/subscriptionsUpdate.d.ts.map +1 -1
  126. package/dist/esm/funcs/subscriptionsUpdate.js +3 -2
  127. package/dist/esm/funcs/subscriptionsUpdate.js.map +1 -1
  128. package/dist/esm/lib/config.d.ts +3 -3
  129. package/dist/esm/lib/config.js +3 -3
  130. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.d.ts +15 -0
  131. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.d.ts.map +1 -1
  132. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.js +2 -0
  133. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.js.map +1 -1
  134. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.d.ts +15 -0
  135. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.d.ts.map +1 -1
  136. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.js +2 -0
  137. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.js.map +1 -1
  138. package/dist/esm/models/components/customersubscription.d.ts +5 -0
  139. package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
  140. package/dist/esm/models/components/customersubscription.js +3 -0
  141. package/dist/esm/models/components/customersubscription.js.map +1 -1
  142. package/dist/esm/models/components/discountcreate.d.ts +2 -2
  143. package/dist/esm/models/components/discountcreate.d.ts.map +1 -1
  144. package/dist/esm/models/components/discountcreate.js +2 -2
  145. package/dist/esm/models/components/discountcreate.js.map +1 -1
  146. package/dist/esm/models/components/discountfixedonceforeverduration.d.ts +12 -0
  147. package/dist/esm/models/components/discountfixedonceforeverduration.d.ts.map +1 -1
  148. package/dist/esm/models/components/discountfixedonceforeverduration.js +1 -0
  149. package/dist/esm/models/components/discountfixedonceforeverduration.js.map +1 -1
  150. package/dist/esm/models/components/discountfixedonceforeverdurationbase.d.ts +15 -0
  151. package/dist/esm/models/components/discountfixedonceforeverdurationbase.d.ts.map +1 -1
  152. package/dist/esm/models/components/discountfixedonceforeverdurationbase.js +2 -0
  153. package/dist/esm/models/components/discountfixedonceforeverdurationbase.js.map +1 -1
  154. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.d.ts +14 -5
  155. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.d.ts.map +1 -1
  156. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.js +3 -2
  157. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.js.map +1 -1
  158. package/dist/esm/models/components/discountfixedrepeatduration.d.ts +12 -0
  159. package/dist/esm/models/components/discountfixedrepeatduration.d.ts.map +1 -1
  160. package/dist/esm/models/components/discountfixedrepeatduration.js +1 -0
  161. package/dist/esm/models/components/discountfixedrepeatduration.js.map +1 -1
  162. package/dist/esm/models/components/discountfixedrepeatdurationbase.d.ts +15 -0
  163. package/dist/esm/models/components/discountfixedrepeatdurationbase.d.ts.map +1 -1
  164. package/dist/esm/models/components/discountfixedrepeatdurationbase.js +2 -0
  165. package/dist/esm/models/components/discountfixedrepeatdurationbase.js.map +1 -1
  166. package/dist/esm/models/components/discountfixedrepeatdurationcreate.d.ts +14 -5
  167. package/dist/esm/models/components/discountfixedrepeatdurationcreate.d.ts.map +1 -1
  168. package/dist/esm/models/components/discountfixedrepeatdurationcreate.js +3 -2
  169. package/dist/esm/models/components/discountfixedrepeatdurationcreate.js.map +1 -1
  170. package/dist/esm/models/components/discountupdate.d.ts +12 -0
  171. package/dist/esm/models/components/discountupdate.d.ts.map +1 -1
  172. package/dist/esm/models/components/discountupdate.js +1 -0
  173. package/dist/esm/models/components/discountupdate.js.map +1 -1
  174. package/dist/esm/models/components/metricperiod.d.ts +5 -5
  175. package/dist/esm/models/components/metricperiod.d.ts.map +1 -1
  176. package/dist/esm/models/components/metricperiod.js +7 -7
  177. package/dist/esm/models/components/metricperiod.js.map +1 -1
  178. package/dist/esm/models/components/metrics.d.ts +1 -1
  179. package/dist/esm/models/components/metrics.d.ts.map +1 -1
  180. package/dist/esm/models/components/metrics.js +2 -2
  181. package/dist/esm/models/components/metrics.js.map +1 -1
  182. package/dist/esm/models/components/metricstotals.d.ts +5 -5
  183. package/dist/esm/models/components/metricstotals.d.ts.map +1 -1
  184. package/dist/esm/models/components/metricstotals.js +7 -7
  185. package/dist/esm/models/components/metricstotals.js.map +1 -1
  186. package/dist/esm/models/components/organizationcustomeremailsettings.d.ts +4 -0
  187. package/dist/esm/models/components/organizationcustomeremailsettings.d.ts.map +1 -1
  188. package/dist/esm/models/components/organizationcustomeremailsettings.js +8 -0
  189. package/dist/esm/models/components/organizationcustomeremailsettings.js.map +1 -1
  190. package/dist/esm/models/components/pendingsubscriptionupdate.d.ts +48 -0
  191. package/dist/esm/models/components/pendingsubscriptionupdate.d.ts.map +1 -0
  192. package/dist/esm/models/components/pendingsubscriptionupdate.js +45 -0
  193. package/dist/esm/models/components/pendingsubscriptionupdate.js.map +1 -0
  194. package/dist/esm/models/components/subscription.d.ts +6 -0
  195. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  196. package/dist/esm/models/components/subscription.js +5 -0
  197. package/dist/esm/models/components/subscription.js.map +1 -1
  198. package/dist/esm/models/components/subscriptionprorationbehavior.d.ts +1 -0
  199. package/dist/esm/models/components/subscriptionprorationbehavior.d.ts.map +1 -1
  200. package/dist/esm/models/components/subscriptionprorationbehavior.js +1 -0
  201. package/dist/esm/models/components/subscriptionprorationbehavior.js.map +1 -1
  202. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.d.ts +11 -0
  203. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.d.ts.map +1 -0
  204. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.js +20 -0
  205. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.js.map +1 -0
  206. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.d.ts +11 -0
  207. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.d.ts.map +1 -0
  208. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.js +20 -0
  209. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.js.map +1 -0
  210. package/dist/esm/models/components/subscriptionupdatedevent.d.ts +75 -0
  211. package/dist/esm/models/components/subscriptionupdatedevent.d.ts.map +1 -0
  212. package/dist/esm/models/components/subscriptionupdatedevent.js +61 -0
  213. package/dist/esm/models/components/subscriptionupdatedevent.js.map +1 -0
  214. package/dist/esm/models/components/subscriptionupdatedproductmetadata.d.ts +13 -0
  215. package/dist/esm/models/components/subscriptionupdatedproductmetadata.d.ts.map +1 -0
  216. package/dist/esm/models/components/subscriptionupdatedproductmetadata.js +23 -0
  217. package/dist/esm/models/components/subscriptionupdatedproductmetadata.js.map +1 -0
  218. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.d.ts +13 -0
  219. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.d.ts.map +1 -0
  220. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.js +22 -0
  221. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.js.map +1 -0
  222. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.d.ts +11 -0
  223. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.d.ts.map +1 -0
  224. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.js +20 -0
  225. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.js.map +1 -0
  226. package/dist/esm/models/components/systemevent.d.ts +2 -1
  227. package/dist/esm/models/components/systemevent.d.ts.map +1 -1
  228. package/dist/esm/models/components/systemevent.js +2 -0
  229. package/dist/esm/models/components/systemevent.js.map +1 -1
  230. package/dist/esm/models/errors/paymentfailed.d.ts +20 -0
  231. package/dist/esm/models/errors/paymentfailed.d.ts.map +1 -0
  232. package/dist/esm/models/errors/paymentfailed.js +32 -0
  233. package/dist/esm/models/errors/paymentfailed.js.map +1 -0
  234. package/dist/esm/webhooks.d.ts +1 -1
  235. package/dist/esm/webhooks.d.ts.map +1 -1
  236. package/dist/esm/webhooks.js +15 -0
  237. package/dist/esm/webhooks.js.map +1 -1
  238. package/jsr.json +1 -1
  239. package/package.json +1 -1
  240. package/src/funcs/customerPortalSubscriptionsUpdate.ts +9 -1
  241. package/src/funcs/subscriptionsUpdate.ts +9 -1
  242. package/src/lib/config.ts +3 -3
  243. package/src/models/components/checkoutdiscountfixedonceforeverduration.ts +13 -0
  244. package/src/models/components/checkoutdiscountfixedrepeatduration.ts +13 -0
  245. package/src/models/components/customersubscription.ts +10 -0
  246. package/src/models/components/discountcreate.ts +8 -8
  247. package/src/models/components/discountfixedonceforeverduration.ts +11 -0
  248. package/src/models/components/discountfixedonceforeverdurationbase.ts +13 -0
  249. package/src/models/components/discountfixedonceforeverdurationcreate.ts +13 -7
  250. package/src/models/components/discountfixedrepeatduration.ts +11 -0
  251. package/src/models/components/discountfixedrepeatdurationbase.ts +13 -0
  252. package/src/models/components/discountfixedrepeatdurationcreate.ts +13 -7
  253. package/src/models/components/discountupdate.ts +9 -0
  254. package/src/models/components/metricperiod.ts +23 -23
  255. package/src/models/components/metrics.ts +3 -3
  256. package/src/models/components/metricstotals.ts +23 -23
  257. package/src/models/components/organizationcustomeremailsettings.ts +14 -0
  258. package/src/models/components/pendingsubscriptionupdate.ts +119 -0
  259. package/src/models/components/subscription.ts +15 -0
  260. package/src/models/components/subscriptionprorationbehavior.ts +1 -0
  261. package/src/models/components/subscriptionupdatedbillingperiodmetadata.ts +45 -0
  262. package/src/models/components/subscriptionupdateddiscountmetadata.ts +42 -0
  263. package/src/models/components/subscriptionupdatedevent.ts +177 -0
  264. package/src/models/components/subscriptionupdatedproductmetadata.ts +49 -0
  265. package/src/models/components/subscriptionupdatedseatsmetadata.ts +47 -0
  266. package/src/models/components/subscriptionupdatedtrialmetadata.ts +41 -0
  267. package/src/models/components/systemevent.ts +7 -1
  268. package/src/models/errors/paymentfailed.ts +55 -0
  269. package/src/webhooks.ts +15 -0
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { PolarError } from "./polarerror.js";
6
+ export class PaymentFailed extends PolarError {
7
+ constructor(err, httpMeta) {
8
+ const message = "message" in err && typeof err.message === "string"
9
+ ? err.message
10
+ : `API error occurred: ${JSON.stringify(err)}`;
11
+ super(message, httpMeta);
12
+ this.data$ = err;
13
+ this.error = err.error;
14
+ this.detail = err.detail;
15
+ this.name = "PaymentFailed";
16
+ }
17
+ }
18
+ /** @internal */
19
+ export const PaymentFailed$inboundSchema = z.pipe(z.object({
20
+ error: z.literal("PaymentFailed"),
21
+ detail: z.string(),
22
+ request$: z.custom(x => x instanceof Request),
23
+ response$: z.custom(x => x instanceof Response),
24
+ body$: z.string(),
25
+ }), z.transform((v) => {
26
+ return new PaymentFailed(v, {
27
+ request: v.request$,
28
+ response: v.response$,
29
+ body: v.body$,
30
+ });
31
+ }));
32
+ //# sourceMappingURL=paymentfailed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentfailed.js","sourceRoot":"","sources":["../../../../src/models/errors/paymentfailed.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,MAAM,OAAO,aAAc,SAAQ,UAAU;IAO3C,YACE,GAAsB,EACtB,QAAgE;QAEhE,MAAM,OAAO,GAAG,SAAS,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;YACjE,CAAC,CAAC,GAAG,CAAC,OAAO;YACb,CAAC,CAAC,uBAAuB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAEzB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAGpC,CAAC,CAAC,IAAI,CACR,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAU,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,OAAO,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,MAAM,CAAW,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,QAAQ,CAAC;IACzD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,EACF,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IAChB,OAAO,IAAI,aAAa,CAAC,CAAC,EAAE;QAC1B,OAAO,EAAE,CAAC,CAAC,QAAQ;QACnB,QAAQ,EAAE,CAAC,CAAC,SAAS;QACrB,IAAI,EAAE,CAAC,CAAC,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  declare class WebhookVerificationError extends Error {
2
2
  constructor(message: string);
3
3
  }
4
- declare const validateEvent: (body: string | Buffer, headers: Record<string, string>, secret: string) => import("./models/components/webhookbenefitcreatedpayload.js").WebhookBenefitCreatedPayload | import("./models/components/webhookbenefitgrantcreatedpayload.js").WebhookBenefitGrantCreatedPayload | import("./models/components/webhookbenefitgrantcycledpayload.js").WebhookBenefitGrantCycledPayload | import("./models/components/webhookbenefitgrantrevokedpayload.js").WebhookBenefitGrantRevokedPayload | import("./models/components/webhookbenefitgrantupdatedpayload.js").WebhookBenefitGrantUpdatedPayload | import("./models/components/webhookbenefitupdatedpayload.js").WebhookBenefitUpdatedPayload | import("./models/components/webhookcheckoutcreatedpayload.js").WebhookCheckoutCreatedPayload | import("./models/components/webhookcheckoutupdatedpayload.js").WebhookCheckoutUpdatedPayload | import("./models/components/webhookcustomercreatedpayload.js").WebhookCustomerCreatedPayload | import("./models/components/webhookcustomerdeletedpayload.js").WebhookCustomerDeletedPayload | import("./models/components/webhookcustomerseatassignedpayload.js").WebhookCustomerSeatAssignedPayload | import("./models/components/webhookcustomerseatclaimedpayload.js").WebhookCustomerSeatClaimedPayload | import("./models/components/webhookcustomerseatrevokedpayload.js").WebhookCustomerSeatRevokedPayload | import("./models/components/webhookcustomerstatechangedpayload.js").WebhookCustomerStateChangedPayload | import("./models/components/webhookcustomerupdatedpayload.js").WebhookCustomerUpdatedPayload | import("./models/components/webhookordercreatedpayload.js").WebhookOrderCreatedPayload | import("./models/components/webhookorderpaidpayload.js").WebhookOrderPaidPayload | import("./models/components/webhookorderrefundedpayload.js").WebhookOrderRefundedPayload | import("./models/components/webhookorderupdatedpayload.js").WebhookOrderUpdatedPayload | import("./models/components/webhookorganizationupdatedpayload.js").WebhookOrganizationUpdatedPayload | import("./models/components/webhookproductcreatedpayload.js").WebhookProductCreatedPayload | import("./models/components/webhookproductupdatedpayload.js").WebhookProductUpdatedPayload | import("./models/components/webhookrefundcreatedpayload.js").WebhookRefundCreatedPayload | import("./models/components/webhookrefundupdatedpayload.js").WebhookRefundUpdatedPayload | import("./models/components/webhooksubscriptionactivepayload.js").WebhookSubscriptionActivePayload | import("./models/components/webhooksubscriptioncanceledpayload.js").WebhookSubscriptionCanceledPayload | import("./models/components/webhooksubscriptioncreatedpayload.js").WebhookSubscriptionCreatedPayload | import("./models/components/webhooksubscriptionrevokedpayload.js").WebhookSubscriptionRevokedPayload | import("./models/components/webhooksubscriptionuncanceledpayload.js").WebhookSubscriptionUncanceledPayload | import("./models/components/webhooksubscriptionupdatedpayload.js").WebhookSubscriptionUpdatedPayload;
4
+ declare const validateEvent: (body: string | Buffer, headers: Record<string, string>, secret: string) => import("./models/components/webhookbenefitcreatedpayload.js").WebhookBenefitCreatedPayload | import("./models/components/webhookbenefitgrantcreatedpayload.js").WebhookBenefitGrantCreatedPayload | import("./models/components/webhookbenefitgrantcycledpayload.js").WebhookBenefitGrantCycledPayload | import("./models/components/webhookbenefitgrantrevokedpayload.js").WebhookBenefitGrantRevokedPayload | import("./models/components/webhookbenefitgrantupdatedpayload.js").WebhookBenefitGrantUpdatedPayload | import("./models/components/webhookbenefitupdatedpayload.js").WebhookBenefitUpdatedPayload | import("./models/components/webhookcheckoutcreatedpayload.js").WebhookCheckoutCreatedPayload | import("./models/components/webhookcheckoutexpiredpayload.js").WebhookCheckoutExpiredPayload | import("./models/components/webhookcheckoutupdatedpayload.js").WebhookCheckoutUpdatedPayload | import("./models/components/webhookcustomercreatedpayload.js").WebhookCustomerCreatedPayload | import("./models/components/webhookcustomerdeletedpayload.js").WebhookCustomerDeletedPayload | import("./models/components/webhookcustomerseatassignedpayload.js").WebhookCustomerSeatAssignedPayload | import("./models/components/webhookcustomerseatclaimedpayload.js").WebhookCustomerSeatClaimedPayload | import("./models/components/webhookcustomerseatrevokedpayload.js").WebhookCustomerSeatRevokedPayload | import("./models/components/webhookcustomerstatechangedpayload.js").WebhookCustomerStateChangedPayload | import("./models/components/webhookcustomerupdatedpayload.js").WebhookCustomerUpdatedPayload | import("./models/components/webhookmembercreatedpayload.js").WebhookMemberCreatedPayload | import("./models/components/webhookmemberdeletedpayload.js").WebhookMemberDeletedPayload | import("./models/components/webhookmemberupdatedpayload.js").WebhookMemberUpdatedPayload | import("./models/components/webhookordercreatedpayload.js").WebhookOrderCreatedPayload | import("./models/components/webhookorderpaidpayload.js").WebhookOrderPaidPayload | import("./models/components/webhookorderrefundedpayload.js").WebhookOrderRefundedPayload | import("./models/components/webhookorderupdatedpayload.js").WebhookOrderUpdatedPayload | import("./models/components/webhookorganizationupdatedpayload.js").WebhookOrganizationUpdatedPayload | import("./models/components/webhookproductcreatedpayload.js").WebhookProductCreatedPayload | import("./models/components/webhookproductupdatedpayload.js").WebhookProductUpdatedPayload | import("./models/components/webhookrefundcreatedpayload.js").WebhookRefundCreatedPayload | import("./models/components/webhookrefundupdatedpayload.js").WebhookRefundUpdatedPayload | import("./models/components/webhooksubscriptionactivepayload.js").WebhookSubscriptionActivePayload | import("./models/components/webhooksubscriptioncanceledpayload.js").WebhookSubscriptionCanceledPayload | import("./models/components/webhooksubscriptioncreatedpayload.js").WebhookSubscriptionCreatedPayload | import("./models/components/webhooksubscriptionpastduepayload.js").WebhookSubscriptionPastDuePayload | import("./models/components/webhooksubscriptionrevokedpayload.js").WebhookSubscriptionRevokedPayload | import("./models/components/webhooksubscriptionuncanceledpayload.js").WebhookSubscriptionUncanceledPayload | import("./models/components/webhooksubscriptionupdatedpayload.js").WebhookSubscriptionUpdatedPayload;
5
5
  export { validateEvent, WebhookVerificationError };
6
6
  //# sourceMappingURL=webhooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/webhooks.ts"],"names":[],"mappings":"AAqCA,cAAM,wBAAyB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AA6ED,QAAA,MAAM,aAAa,GACjB,MAAM,MAAM,GAAG,MAAM,EACrB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,MAAM,w3FAaf,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/webhooks.ts"],"names":[],"mappings":"AA0CA,cAAM,wBAAyB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAuFD,QAAA,MAAM,aAAa,GACjB,MAAM,MAAM,GAAG,MAAM,EACrB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,MAAM,+0GAaf,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,CAAC"}
@@ -29,6 +29,11 @@ import { WebhookCustomerStateChangedPayload$inboundSchema } from "./models/compo
29
29
  import { WebhookCustomerSeatAssignedPayload$inboundSchema } from "./models/components/webhookcustomerseatassignedpayload.js";
30
30
  import { WebhookCustomerSeatClaimedPayload$inboundSchema } from "./models/components/webhookcustomerseatclaimedpayload.js";
31
31
  import { WebhookCustomerSeatRevokedPayload$inboundSchema } from "./models/components/webhookcustomerseatrevokedpayload.js";
32
+ import { WebhookMemberCreatedPayload$inboundSchema } from "./models/components/webhookmembercreatedpayload.js";
33
+ import { WebhookMemberUpdatedPayload$inboundSchema } from "./models/components/webhookmemberupdatedpayload.js";
34
+ import { WebhookMemberDeletedPayload$inboundSchema } from "./models/components/webhookmemberdeletedpayload.js";
35
+ import { WebhookCheckoutExpiredPayload$inboundSchema } from "./models/components/webhookcheckoutexpiredpayload.js";
36
+ import { WebhookSubscriptionPastDuePayload$inboundSchema } from "./models/components/webhooksubscriptionpastduepayload.js";
32
37
  import { SDKValidationError } from "./models/errors/sdkvalidationerror.js";
33
38
  class WebhookVerificationError extends Error {
34
39
  constructor(message) {
@@ -53,6 +58,12 @@ const parseEvent = (parsed) => {
53
58
  return WebhookCustomerSeatClaimedPayload$inboundSchema.parse(parsed);
54
59
  case "customer_seat.revoked":
55
60
  return WebhookCustomerSeatRevokedPayload$inboundSchema.parse(parsed);
61
+ case "member.created":
62
+ return WebhookMemberCreatedPayload$inboundSchema.parse(parsed);
63
+ case "member.updated":
64
+ return WebhookMemberUpdatedPayload$inboundSchema.parse(parsed);
65
+ case "member.deleted":
66
+ return WebhookMemberDeletedPayload$inboundSchema.parse(parsed);
56
67
  case "benefit.created":
57
68
  return WebhookBenefitCreatedPayload$inboundSchema.parse(parsed);
58
69
  case "benefit_grant.created":
@@ -69,6 +80,8 @@ const parseEvent = (parsed) => {
69
80
  return WebhookCheckoutCreatedPayload$inboundSchema.parse(parsed);
70
81
  case "checkout.updated":
71
82
  return WebhookCheckoutUpdatedPayload$inboundSchema.parse(parsed);
83
+ case "checkout.expired":
84
+ return WebhookCheckoutExpiredPayload$inboundSchema.parse(parsed);
72
85
  case "order.created":
73
86
  return WebhookOrderCreatedPayload$inboundSchema.parse(parsed);
74
87
  case "order.paid":
@@ -99,6 +112,8 @@ const parseEvent = (parsed) => {
99
112
  return WebhookSubscriptionUncanceledPayload$inboundSchema.parse(parsed);
100
113
  case "subscription.updated":
101
114
  return WebhookSubscriptionUpdatedPayload$inboundSchema.parse(parsed);
115
+ case "subscription.past_due":
116
+ return WebhookSubscriptionPastDuePayload$inboundSchema.parse(parsed);
102
117
  default:
103
118
  throw new SDKValidationError(`Unknown event type: ${parsed.type}`, parsed.type, parsed);
104
119
  }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;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAAC;YAC/C,MAAM,IAAI,wBAAwB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,CAAC"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@polar-sh/sdk",
5
- "version": "0.46.3",
5
+ "version": "0.46.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.46.3",
3
+ "version": "0.46.4",
4
4
  "author": "Speakeasy",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -30,6 +30,10 @@ import {
30
30
  HTTPValidationError,
31
31
  HTTPValidationError$inboundSchema,
32
32
  } from "../models/errors/httpvalidationerror.js";
33
+ import {
34
+ PaymentFailed,
35
+ PaymentFailed$inboundSchema,
36
+ } from "../models/errors/paymentfailed.js";
33
37
  import { PolarError } from "../models/errors/polarerror.js";
34
38
  import {
35
39
  ResourceNotFound,
@@ -59,6 +63,7 @@ export function customerPortalSubscriptionsUpdate(
59
63
  ): APIPromise<
60
64
  Result<
61
65
  CustomerSubscription,
66
+ | PaymentFailed
62
67
  | AlreadyCanceledSubscription
63
68
  | ResourceNotFound
64
69
  | HTTPValidationError
@@ -89,6 +94,7 @@ async function $do(
89
94
  [
90
95
  Result<
91
96
  CustomerSubscription,
97
+ | PaymentFailed
92
98
  | AlreadyCanceledSubscription
93
99
  | ResourceNotFound
94
100
  | HTTPValidationError
@@ -181,7 +187,7 @@ async function $do(
181
187
 
182
188
  const doResult = await client._do(req, {
183
189
  context,
184
- errorCodes: ["403", "404", "422", "4XX", "5XX"],
190
+ errorCodes: ["402", "403", "404", "422", "4XX", "5XX"],
185
191
  retryConfig: context.retryConfig,
186
192
  retryCodes: context.retryCodes,
187
193
  });
@@ -196,6 +202,7 @@ async function $do(
196
202
 
197
203
  const [result] = await M.match<
198
204
  CustomerSubscription,
205
+ | PaymentFailed
199
206
  | AlreadyCanceledSubscription
200
207
  | ResourceNotFound
201
208
  | HTTPValidationError
@@ -209,6 +216,7 @@ async function $do(
209
216
  | SDKValidationError
210
217
  >(
211
218
  M.json(200, CustomerSubscription$inboundSchema),
219
+ M.jsonErr(402, PaymentFailed$inboundSchema),
212
220
  M.jsonErr(403, AlreadyCanceledSubscription$inboundSchema),
213
221
  M.jsonErr(404, ResourceNotFound$inboundSchema),
214
222
  M.jsonErr(422, HTTPValidationError$inboundSchema),
@@ -30,6 +30,10 @@ import {
30
30
  HTTPValidationError,
31
31
  HTTPValidationError$inboundSchema,
32
32
  } from "../models/errors/httpvalidationerror.js";
33
+ import {
34
+ PaymentFailed,
35
+ PaymentFailed$inboundSchema,
36
+ } from "../models/errors/paymentfailed.js";
33
37
  import { PolarError } from "../models/errors/polarerror.js";
34
38
  import {
35
39
  ResourceNotFound,
@@ -63,6 +67,7 @@ export function subscriptionsUpdate(
63
67
  ): APIPromise<
64
68
  Result<
65
69
  Subscription,
70
+ | PaymentFailed
66
71
  | AlreadyCanceledSubscription
67
72
  | ResourceNotFound
68
73
  | SubscriptionLocked
@@ -92,6 +97,7 @@ async function $do(
92
97
  [
93
98
  Result<
94
99
  Subscription,
100
+ | PaymentFailed
95
101
  | AlreadyCanceledSubscription
96
102
  | ResourceNotFound
97
103
  | SubscriptionLocked
@@ -171,7 +177,7 @@ async function $do(
171
177
 
172
178
  const doResult = await client._do(req, {
173
179
  context,
174
- errorCodes: ["403", "404", "409", "422", "4XX", "5XX"],
180
+ errorCodes: ["402", "403", "404", "409", "422", "4XX", "5XX"],
175
181
  retryConfig: context.retryConfig,
176
182
  retryCodes: context.retryCodes,
177
183
  });
@@ -186,6 +192,7 @@ async function $do(
186
192
 
187
193
  const [result] = await M.match<
188
194
  Subscription,
195
+ | PaymentFailed
189
196
  | AlreadyCanceledSubscription
190
197
  | ResourceNotFound
191
198
  | SubscriptionLocked
@@ -200,6 +207,7 @@ async function $do(
200
207
  | SDKValidationError
201
208
  >(
202
209
  M.json(200, Subscription$inboundSchema),
210
+ M.jsonErr(402, PaymentFailed$inboundSchema),
203
211
  M.jsonErr(403, AlreadyCanceledSubscription$inboundSchema),
204
212
  M.jsonErr(404, ResourceNotFound$inboundSchema),
205
213
  M.jsonErr(409, SubscriptionLocked$inboundSchema),
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.46.3",
68
- genVersion: "2.852.1",
69
- userAgent: "speakeasy-sdk/typescript 0.46.3 2.852.1 0.1.0 @polar-sh/sdk",
67
+ sdkVersion: "0.46.4",
68
+ genVersion: "2.862.0",
69
+ userAgent: "speakeasy-sdk/typescript 0.46.4 2.862.0 0.1.0 @polar-sh/sdk",
70
70
  } as const;
@@ -23,8 +23,18 @@ import {
23
23
  export type CheckoutDiscountFixedOnceForeverDuration = {
24
24
  duration: DiscountDuration;
25
25
  type: DiscountType;
26
+ /**
27
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
28
+ */
26
29
  amount: number;
30
+ /**
31
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
32
+ */
27
33
  currency: string;
34
+ /**
35
+ * Map of currency to fixed amount to discount from the total.
36
+ */
37
+ amounts: { [k: string]: number };
28
38
  /**
29
39
  * The ID of the object.
30
40
  */
@@ -40,6 +50,7 @@ export const CheckoutDiscountFixedOnceForeverDuration$inboundSchema:
40
50
  type: DiscountType$inboundSchema,
41
51
  amount: z.int(),
42
52
  currency: z.string(),
53
+ amounts: z.record(z.string(), z.int()),
43
54
  id: z.string(),
44
55
  name: z.string(),
45
56
  code: z.nullable(z.string()),
@@ -50,6 +61,7 @@ export type CheckoutDiscountFixedOnceForeverDuration$Outbound = {
50
61
  type: string;
51
62
  amount: number;
52
63
  currency: string;
64
+ amounts: { [k: string]: number };
53
65
  id: string;
54
66
  name: string;
55
67
  code: string | null;
@@ -65,6 +77,7 @@ export const CheckoutDiscountFixedOnceForeverDuration$outboundSchema:
65
77
  type: DiscountType$outboundSchema,
66
78
  amount: z.int(),
67
79
  currency: z.string(),
80
+ amounts: z.record(z.string(), z.int()),
68
81
  id: z.string(),
69
82
  name: z.string(),
70
83
  code: z.nullable(z.string()),
@@ -28,8 +28,18 @@ export type CheckoutDiscountFixedRepeatDuration = {
28
28
  duration: DiscountDuration;
29
29
  durationInMonths: number;
30
30
  type: DiscountType;
31
+ /**
32
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
33
+ */
31
34
  amount: number;
35
+ /**
36
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
37
+ */
32
38
  currency: string;
39
+ /**
40
+ * Map of currency to fixed amount to discount from the total.
41
+ */
42
+ amounts: { [k: string]: number };
33
43
  /**
34
44
  * The ID of the object.
35
45
  */
@@ -49,6 +59,7 @@ export const CheckoutDiscountFixedRepeatDuration$inboundSchema: z.ZodMiniType<
49
59
  type: DiscountType$inboundSchema,
50
60
  amount: z.int(),
51
61
  currency: z.string(),
62
+ amounts: z.record(z.string(), z.int()),
52
63
  id: z.string(),
53
64
  name: z.string(),
54
65
  code: z.nullable(z.string()),
@@ -66,6 +77,7 @@ export type CheckoutDiscountFixedRepeatDuration$Outbound = {
66
77
  type: string;
67
78
  amount: number;
68
79
  currency: string;
80
+ amounts: { [k: string]: number };
69
81
  id: string;
70
82
  name: string;
71
83
  code: string | null;
@@ -82,6 +94,7 @@ export const CheckoutDiscountFixedRepeatDuration$outboundSchema: z.ZodMiniType<
82
94
  type: DiscountType$outboundSchema,
83
95
  amount: z.int(),
84
96
  currency: z.string(),
97
+ amounts: z.record(z.string(), z.int()),
85
98
  id: z.string(),
86
99
  name: z.string(),
87
100
  code: z.nullable(z.string()),
@@ -24,6 +24,10 @@ import {
24
24
  LegacyRecurringProductPrice,
25
25
  LegacyRecurringProductPrice$inboundSchema,
26
26
  } from "./legacyrecurringproductprice.js";
27
+ import {
28
+ PendingSubscriptionUpdate,
29
+ PendingSubscriptionUpdate$inboundSchema,
30
+ } from "./pendingsubscriptionupdate.js";
27
31
  import { ProductPrice, ProductPrice$inboundSchema } from "./productprice.js";
28
32
  import {
29
33
  SubscriptionRecurringInterval,
@@ -129,6 +133,10 @@ export type CustomerSubscription = {
129
133
  * List of meters associated with the subscription.
130
134
  */
131
135
  meters: Array<CustomerSubscriptionMeter>;
136
+ /**
137
+ * Pending subscription update that will be applied at the beginning of the next period. If `null`, there is no pending update.
138
+ */
139
+ pendingUpdate: PendingSubscriptionUpdate | null;
132
140
  };
133
141
 
134
142
  /** @internal */
@@ -213,6 +221,7 @@ export const CustomerSubscription$inboundSchema: z.ZodMiniType<
213
221
  ]),
214
222
  ),
215
223
  meters: z.array(CustomerSubscriptionMeter$inboundSchema),
224
+ pending_update: z.nullable(PendingSubscriptionUpdate$inboundSchema),
216
225
  }),
217
226
  z.transform((v) => {
218
227
  return remap$(v, {
@@ -235,6 +244,7 @@ export const CustomerSubscription$inboundSchema: z.ZodMiniType<
235
244
  "checkout_id": "checkoutId",
236
245
  "customer_cancellation_reason": "customerCancellationReason",
237
246
  "customer_cancellation_comment": "customerCancellationComment",
247
+ "pending_update": "pendingUpdate",
238
248
  });
239
249
  }),
240
250
  );
@@ -26,27 +26,27 @@ import {
26
26
  } from "./discountpercentagerepeatdurationcreate.js";
27
27
 
28
28
  export type DiscountCreate =
29
- | DiscountFixedRepeatDurationCreate
30
29
  | DiscountPercentageRepeatDurationCreate
31
- | DiscountFixedOnceForeverDurationCreate
32
- | DiscountPercentageOnceForeverDurationCreate;
30
+ | DiscountFixedRepeatDurationCreate
31
+ | DiscountPercentageOnceForeverDurationCreate
32
+ | DiscountFixedOnceForeverDurationCreate;
33
33
 
34
34
  /** @internal */
35
35
  export type DiscountCreate$Outbound =
36
- | DiscountFixedRepeatDurationCreate$Outbound
37
36
  | DiscountPercentageRepeatDurationCreate$Outbound
38
- | DiscountFixedOnceForeverDurationCreate$Outbound
39
- | DiscountPercentageOnceForeverDurationCreate$Outbound;
37
+ | DiscountFixedRepeatDurationCreate$Outbound
38
+ | DiscountPercentageOnceForeverDurationCreate$Outbound
39
+ | DiscountFixedOnceForeverDurationCreate$Outbound;
40
40
 
41
41
  /** @internal */
42
42
  export const DiscountCreate$outboundSchema: z.ZodMiniType<
43
43
  DiscountCreate$Outbound,
44
44
  DiscountCreate
45
45
  > = smartUnion([
46
- DiscountFixedRepeatDurationCreate$outboundSchema,
47
46
  DiscountPercentageRepeatDurationCreate$outboundSchema,
48
- DiscountFixedOnceForeverDurationCreate$outboundSchema,
47
+ DiscountFixedRepeatDurationCreate$outboundSchema,
49
48
  DiscountPercentageOnceForeverDurationCreate$outboundSchema,
49
+ DiscountFixedOnceForeverDurationCreate$outboundSchema,
50
50
  ]);
51
51
 
52
52
  export function discountCreateToJSON(discountCreate: DiscountCreate): string {
@@ -27,8 +27,18 @@ import {
27
27
  export type DiscountFixedOnceForeverDuration = {
28
28
  duration: DiscountDuration;
29
29
  type: DiscountType;
30
+ /**
31
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
32
+ */
30
33
  amount: number;
34
+ /**
35
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
36
+ */
31
37
  currency: string;
38
+ /**
39
+ * Map of currency to fixed amount to discount from the total.
40
+ */
41
+ amounts: { [k: string]: number };
32
42
  /**
33
43
  * Creation timestamp of the object.
34
44
  */
@@ -83,6 +93,7 @@ export const DiscountFixedOnceForeverDuration$inboundSchema: z.ZodMiniType<
83
93
  type: DiscountType$inboundSchema,
84
94
  amount: z.int(),
85
95
  currency: z.string(),
96
+ amounts: z.record(z.string(), z.int()),
86
97
  created_at: z.pipe(
87
98
  z.iso.datetime({ offset: true }),
88
99
  z.transform(v => new Date(v)),
@@ -27,8 +27,18 @@ import {
27
27
  export type DiscountFixedOnceForeverDurationBase = {
28
28
  duration: DiscountDuration;
29
29
  type: DiscountType;
30
+ /**
31
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
32
+ */
30
33
  amount: number;
34
+ /**
35
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
36
+ */
31
37
  currency: string;
38
+ /**
39
+ * Map of currency to fixed amount to discount from the total.
40
+ */
41
+ amounts: { [k: string]: number };
32
42
  /**
33
43
  * Creation timestamp of the object.
34
44
  */
@@ -82,6 +92,7 @@ export const DiscountFixedOnceForeverDurationBase$inboundSchema: z.ZodMiniType<
82
92
  type: DiscountType$inboundSchema,
83
93
  amount: z.int(),
84
94
  currency: z.string(),
95
+ amounts: z.record(z.string(), z.int()),
85
96
  created_at: z.pipe(
86
97
  z.iso.datetime({ offset: true }),
87
98
  z.transform(v => new Date(v)),
@@ -121,6 +132,7 @@ export type DiscountFixedOnceForeverDurationBase$Outbound = {
121
132
  type: string;
122
133
  amount: number;
123
134
  currency: string;
135
+ amounts: { [k: string]: number };
124
136
  created_at: string;
125
137
  modified_at: string | null;
126
138
  id: string;
@@ -144,6 +156,7 @@ export const DiscountFixedOnceForeverDurationBase$outboundSchema: z.ZodMiniType<
144
156
  type: DiscountType$outboundSchema,
145
157
  amount: z.int(),
146
158
  currency: z.string(),
159
+ amounts: z.record(z.string(), z.int()),
147
160
  createdAt: z.pipe(z.date(), z.transform(v => v.toISOString())),
148
161
  modifiedAt: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
149
162
  id: z.string(),
@@ -28,10 +28,14 @@ export type DiscountFixedOnceForeverDurationCreate = {
28
28
  duration: DiscountDuration;
29
29
  type: DiscountType;
30
30
  /**
31
- * Fixed amount to discount from the invoice total.
31
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
32
32
  */
33
- amount: number;
34
- currency?: PresentmentCurrency | undefined;
33
+ amount?: number | null | undefined;
34
+ /**
35
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
36
+ */
37
+ currency?: PresentmentCurrency | null | undefined;
38
+ amounts?: { [k: string]: number } | null | undefined;
35
39
  /**
36
40
  * Key-value object allowing you to store additional information.
37
41
  *
@@ -104,8 +108,9 @@ export function discountFixedOnceForeverDurationCreateMetadataToJSON(
104
108
  export type DiscountFixedOnceForeverDurationCreate$Outbound = {
105
109
  duration: string;
106
110
  type: string;
107
- amount: number;
108
- currency?: string | undefined;
111
+ amount?: number | null | undefined;
112
+ currency?: string | null | undefined;
113
+ amounts?: { [k: string]: number } | null | undefined;
109
114
  metadata?: { [k: string]: string | number | number | boolean } | undefined;
110
115
  name: string;
111
116
  code?: string | null | undefined;
@@ -125,8 +130,9 @@ export const DiscountFixedOnceForeverDurationCreate$outboundSchema:
125
130
  z.object({
126
131
  duration: DiscountDuration$outboundSchema,
127
132
  type: DiscountType$outboundSchema,
128
- amount: z.int(),
129
- currency: z.optional(PresentmentCurrency$outboundSchema),
133
+ amount: z.optional(z.nullable(z.int())),
134
+ currency: z.optional(z.nullable(PresentmentCurrency$outboundSchema)),
135
+ amounts: z.optional(z.nullable(z.record(z.string(), z.int()))),
130
136
  metadata: z.optional(
131
137
  z.record(
132
138
  z.string(),
@@ -31,8 +31,18 @@ export type DiscountFixedRepeatDuration = {
31
31
  duration: DiscountDuration;
32
32
  durationInMonths: number;
33
33
  type: DiscountType;
34
+ /**
35
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
36
+ */
34
37
  amount: number;
38
+ /**
39
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
40
+ */
35
41
  currency: string;
42
+ /**
43
+ * Map of currency to fixed amount to discount from the total.
44
+ */
45
+ amounts: { [k: string]: number };
36
46
  /**
37
47
  * Creation timestamp of the object.
38
48
  */
@@ -88,6 +98,7 @@ export const DiscountFixedRepeatDuration$inboundSchema: z.ZodMiniType<
88
98
  type: DiscountType$inboundSchema,
89
99
  amount: z.int(),
90
100
  currency: z.string(),
101
+ amounts: z.record(z.string(), z.int()),
91
102
  created_at: z.pipe(
92
103
  z.iso.datetime({ offset: true }),
93
104
  z.transform(v => new Date(v)),
@@ -28,8 +28,18 @@ export type DiscountFixedRepeatDurationBase = {
28
28
  duration: DiscountDuration;
29
29
  durationInMonths: number;
30
30
  type: DiscountType;
31
+ /**
32
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
33
+ */
31
34
  amount: number;
35
+ /**
36
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
37
+ */
32
38
  currency: string;
39
+ /**
40
+ * Map of currency to fixed amount to discount from the total.
41
+ */
42
+ amounts: { [k: string]: number };
33
43
  /**
34
44
  * Creation timestamp of the object.
35
45
  */
@@ -84,6 +94,7 @@ export const DiscountFixedRepeatDurationBase$inboundSchema: z.ZodMiniType<
84
94
  type: DiscountType$inboundSchema,
85
95
  amount: z.int(),
86
96
  currency: z.string(),
97
+ amounts: z.record(z.string(), z.int()),
87
98
  created_at: z.pipe(
88
99
  z.iso.datetime({ offset: true }),
89
100
  z.transform(v => new Date(v)),
@@ -125,6 +136,7 @@ export type DiscountFixedRepeatDurationBase$Outbound = {
125
136
  type: string;
126
137
  amount: number;
127
138
  currency: string;
139
+ amounts: { [k: string]: number };
128
140
  created_at: string;
129
141
  modified_at: string | null;
130
142
  id: string;
@@ -149,6 +161,7 @@ export const DiscountFixedRepeatDurationBase$outboundSchema: z.ZodMiniType<
149
161
  type: DiscountType$outboundSchema,
150
162
  amount: z.int(),
151
163
  currency: z.string(),
164
+ amounts: z.record(z.string(), z.int()),
152
165
  createdAt: z.pipe(z.date(), z.transform(v => v.toISOString())),
153
166
  modifiedAt: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
154
167
  id: z.string(),
@@ -40,10 +40,14 @@ export type DiscountFixedRepeatDurationCreate = {
40
40
  durationInMonths: number;
41
41
  type: DiscountType;
42
42
  /**
43
- * Fixed amount to discount from the invoice total.
43
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
44
44
  */
45
- amount: number;
46
- currency?: PresentmentCurrency | undefined;
45
+ amount?: number | null | undefined;
46
+ /**
47
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
48
+ */
49
+ currency?: PresentmentCurrency | null | undefined;
50
+ amounts?: { [k: string]: number } | null | undefined;
47
51
  /**
48
52
  * Key-value object allowing you to store additional information.
49
53
  *
@@ -117,8 +121,9 @@ export type DiscountFixedRepeatDurationCreate$Outbound = {
117
121
  duration: string;
118
122
  duration_in_months: number;
119
123
  type: string;
120
- amount: number;
121
- currency?: string | undefined;
124
+ amount?: number | null | undefined;
125
+ currency?: string | null | undefined;
126
+ amounts?: { [k: string]: number } | null | undefined;
122
127
  metadata?: { [k: string]: string | number | number | boolean } | undefined;
123
128
  name: string;
124
129
  code?: string | null | undefined;
@@ -138,8 +143,9 @@ export const DiscountFixedRepeatDurationCreate$outboundSchema: z.ZodMiniType<
138
143
  duration: DiscountDuration$outboundSchema,
139
144
  durationInMonths: z.int(),
140
145
  type: DiscountType$outboundSchema,
141
- amount: z.int(),
142
- currency: z.optional(PresentmentCurrency$outboundSchema),
146
+ amount: z.optional(z.nullable(z.int())),
147
+ currency: z.optional(z.nullable(PresentmentCurrency$outboundSchema)),
148
+ amounts: z.optional(z.nullable(z.record(z.string(), z.int()))),
143
149
  metadata: z.optional(
144
150
  z.record(
145
151
  z.string(),