@polar-sh/sdk 0.13.0 → 0.13.2

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 (332) hide show
  1. package/README.md +15 -0
  2. package/docs/sdks/articles/README.md +78 -0
  3. package/docs/sdks/benefits/README.md +3 -3
  4. package/docs/sdks/checkoutlinks/README.md +400 -0
  5. package/funcs/articlesExport.d.ts +16 -0
  6. package/funcs/articlesExport.d.ts.map +1 -0
  7. package/funcs/articlesExport.js +99 -0
  8. package/funcs/articlesExport.js.map +1 -0
  9. package/funcs/benefitsCreate.d.ts +2 -1
  10. package/funcs/benefitsCreate.d.ts.map +1 -1
  11. package/funcs/benefitsCreate.js +2 -1
  12. package/funcs/benefitsCreate.js.map +1 -1
  13. package/funcs/benefitsGet.d.ts +2 -1
  14. package/funcs/benefitsGet.d.ts.map +1 -1
  15. package/funcs/benefitsGet.js +2 -1
  16. package/funcs/benefitsGet.js.map +1 -1
  17. package/funcs/benefitsUpdate.d.ts +2 -1
  18. package/funcs/benefitsUpdate.d.ts.map +1 -1
  19. package/funcs/benefitsUpdate.js +2 -1
  20. package/funcs/benefitsUpdate.js.map +1 -1
  21. package/funcs/checkoutLinksCreate.d.ts +16 -0
  22. package/funcs/checkoutLinksCreate.d.ts.map +1 -0
  23. package/funcs/checkoutLinksCreate.js +95 -0
  24. package/funcs/checkoutLinksCreate.js.map +1 -0
  25. package/funcs/checkoutLinksDelete.d.ts +16 -0
  26. package/funcs/checkoutLinksDelete.d.ts.map +1 -0
  27. package/funcs/checkoutLinksDelete.js +101 -0
  28. package/funcs/checkoutLinksDelete.js.map +1 -0
  29. package/funcs/checkoutLinksGet.d.ts +17 -0
  30. package/funcs/checkoutLinksGet.d.ts.map +1 -0
  31. package/funcs/checkoutLinksGet.js +101 -0
  32. package/funcs/checkoutLinksGet.js.map +1 -0
  33. package/funcs/checkoutLinksList.d.ts +17 -0
  34. package/funcs/checkoutLinksList.d.ts.map +1 -0
  35. package/funcs/checkoutLinksList.js +130 -0
  36. package/funcs/checkoutLinksList.js.map +1 -0
  37. package/funcs/checkoutLinksUpdate.d.ts +17 -0
  38. package/funcs/checkoutLinksUpdate.d.ts.map +1 -0
  39. package/funcs/checkoutLinksUpdate.js +104 -0
  40. package/funcs/checkoutLinksUpdate.js.map +1 -0
  41. package/lib/config.d.ts +3 -3
  42. package/lib/config.js +3 -3
  43. package/models/components/articlecreate.d.ts +6 -67
  44. package/models/components/articlecreate.d.ts.map +1 -1
  45. package/models/components/articlecreate.js +7 -47
  46. package/models/components/articlecreate.js.map +1 -1
  47. package/models/components/benefit.d.ts +28 -0
  48. package/models/components/benefit.d.ts.map +1 -0
  49. package/models/components/benefit.js +69 -0
  50. package/models/components/benefit.js.map +1 -0
  51. package/models/components/benefitbase.d.ts +0 -3
  52. package/models/components/benefitbase.d.ts.map +1 -1
  53. package/models/components/benefitbase.js.map +1 -1
  54. package/models/components/benefitgrantwebhook.d.ts +3 -28
  55. package/models/components/benefitgrantwebhook.d.ts.map +1 -1
  56. package/models/components/benefitgrantwebhook.js +4 -57
  57. package/models/components/benefitgrantwebhook.js.map +1 -1
  58. package/models/components/benefitinput.d.ts +28 -0
  59. package/models/components/benefitinput.d.ts.map +1 -0
  60. package/models/components/benefitinput.js +69 -0
  61. package/models/components/benefitinput.js.map +1 -0
  62. package/models/components/checkoutlink.d.ts +69 -0
  63. package/models/components/checkoutlink.d.ts.map +1 -0
  64. package/models/components/checkoutlink.js +90 -0
  65. package/models/components/checkoutlink.js.map +1 -0
  66. package/models/components/checkoutlinkcreate.d.ts +85 -0
  67. package/models/components/checkoutlinkcreate.d.ts.map +1 -0
  68. package/models/components/checkoutlinkcreate.js +90 -0
  69. package/models/components/checkoutlinkcreate.js.map +1 -0
  70. package/models/components/checkoutlinksortproperty.d.ts +28 -0
  71. package/models/components/checkoutlinksortproperty.d.ts.map +1 -0
  72. package/models/components/checkoutlinksortproperty.js +50 -0
  73. package/models/components/checkoutlinksortproperty.js.map +1 -0
  74. package/models/components/checkoutlinkupdate.d.ts +46 -0
  75. package/models/components/checkoutlinkupdate.d.ts.map +1 -0
  76. package/models/components/checkoutlinkupdate.js +61 -0
  77. package/models/components/checkoutlinkupdate.js.map +1 -0
  78. package/models/components/checkoutpublic.d.ts +5 -8
  79. package/models/components/checkoutpublic.d.ts.map +1 -1
  80. package/models/components/checkoutpublic.js +2 -2
  81. package/models/components/checkoutpublic.js.map +1 -1
  82. package/models/components/index.d.ts +13 -0
  83. package/models/components/index.d.ts.map +1 -1
  84. package/models/components/index.js +13 -0
  85. package/models/components/index.js.map +1 -1
  86. package/models/components/interval.d.ts +37 -0
  87. package/models/components/interval.d.ts.map +1 -0
  88. package/models/components/interval.js +54 -0
  89. package/models/components/interval.js.map +1 -0
  90. package/models/components/issue.d.ts +0 -6
  91. package/models/components/issue.d.ts.map +1 -1
  92. package/models/components/issue.js.map +1 -1
  93. package/models/components/licensekeyread.d.ts +3 -0
  94. package/models/components/licensekeyread.d.ts.map +1 -1
  95. package/models/components/licensekeyread.js +3 -0
  96. package/models/components/licensekeyread.js.map +1 -1
  97. package/models/components/licensekeyuser.d.ts +31 -0
  98. package/models/components/licensekeyuser.d.ts.map +1 -0
  99. package/models/components/licensekeyuser.js +67 -0
  100. package/models/components/licensekeyuser.js.map +1 -0
  101. package/models/components/licensekeywithactivations.d.ts +3 -0
  102. package/models/components/licensekeywithactivations.d.ts.map +1 -1
  103. package/models/components/licensekeywithactivations.js +3 -0
  104. package/models/components/licensekeywithactivations.js.map +1 -1
  105. package/models/components/listresourcebenefit.d.ts +3 -28
  106. package/models/components/listresourcebenefit.d.ts.map +1 -1
  107. package/models/components/listresourcebenefit.js +4 -57
  108. package/models/components/listresourcebenefit.js.map +1 -1
  109. package/models/components/listresourcecheckoutlink.d.ts +29 -0
  110. package/models/components/listresourcecheckoutlink.d.ts.map +1 -0
  111. package/models/components/listresourcecheckoutlink.js +54 -0
  112. package/models/components/listresourcecheckoutlink.js.map +1 -0
  113. package/models/components/metric.d.ts +0 -3
  114. package/models/components/metric.d.ts.map +1 -1
  115. package/models/components/metric.js.map +1 -1
  116. package/models/components/metricsintervalslimits.d.ts +5 -5
  117. package/models/components/metricslimits.d.ts +1 -1
  118. package/models/components/metricsresponse.d.ts +0 -3
  119. package/models/components/metricsresponse.d.ts.map +1 -1
  120. package/models/components/metricsresponse.js.map +1 -1
  121. package/models/components/oauth2client.js +2 -2
  122. package/models/components/oauth2client.js.map +1 -1
  123. package/models/components/oauth2clientconfiguration.js +2 -2
  124. package/models/components/oauth2clientconfiguration.js.map +1 -1
  125. package/models/components/oauth2clientconfigurationupdate.js +2 -2
  126. package/models/components/oauth2clientconfigurationupdate.js.map +1 -1
  127. package/models/components/order.d.ts +3 -0
  128. package/models/components/order.d.ts.map +1 -1
  129. package/models/components/order.js +5 -0
  130. package/models/components/order.js.map +1 -1
  131. package/models/components/orderbillingreason.d.ts +34 -0
  132. package/models/components/orderbillingreason.d.ts.map +1 -0
  133. package/models/components/orderbillingreason.js +52 -0
  134. package/models/components/orderbillingreason.js.map +1 -0
  135. package/models/components/pledge.d.ts +0 -9
  136. package/models/components/pledge.d.ts.map +1 -1
  137. package/models/components/pledge.js.map +1 -1
  138. package/models/components/polarcheckoutschemascheckout.d.ts +2 -121
  139. package/models/components/polarcheckoutschemascheckout.d.ts.map +1 -1
  140. package/models/components/polarcheckoutschemascheckout.js +3 -108
  141. package/models/components/polarcheckoutschemascheckout.js.map +1 -1
  142. package/models/components/productpriceonetimecustom.d.ts +5 -0
  143. package/models/components/productpriceonetimecustom.d.ts.map +1 -1
  144. package/models/components/productpriceonetimecustom.js +4 -0
  145. package/models/components/productpriceonetimecustom.js.map +1 -1
  146. package/models/components/productpriceonetimefixed.d.ts +5 -0
  147. package/models/components/productpriceonetimefixed.d.ts.map +1 -1
  148. package/models/components/productpriceonetimefixed.js +4 -0
  149. package/models/components/productpriceonetimefixed.js.map +1 -1
  150. package/models/components/productpriceonetimefree.d.ts +5 -0
  151. package/models/components/productpriceonetimefree.d.ts.map +1 -1
  152. package/models/components/productpriceonetimefree.js +4 -0
  153. package/models/components/productpriceonetimefree.js.map +1 -1
  154. package/models/components/productpricerecurringcustom.d.ts +5 -3
  155. package/models/components/productpricerecurringcustom.d.ts.map +1 -1
  156. package/models/components/productpricerecurringcustom.js +4 -0
  157. package/models/components/productpricerecurringcustom.js.map +1 -1
  158. package/models/components/productpricerecurringfixed.d.ts +5 -3
  159. package/models/components/productpricerecurringfixed.d.ts.map +1 -1
  160. package/models/components/productpricerecurringfixed.js +4 -0
  161. package/models/components/productpricerecurringfixed.js.map +1 -1
  162. package/models/components/productpricerecurringfixedcreate.d.ts +0 -3
  163. package/models/components/productpricerecurringfixedcreate.d.ts.map +1 -1
  164. package/models/components/productpricerecurringfixedcreate.js.map +1 -1
  165. package/models/components/productpricerecurringfree.d.ts +5 -3
  166. package/models/components/productpricerecurringfree.d.ts.map +1 -1
  167. package/models/components/productpricerecurringfree.js +4 -0
  168. package/models/components/productpricerecurringfree.js.map +1 -1
  169. package/models/components/productpricerecurringfreecreate.d.ts +0 -3
  170. package/models/components/productpricerecurringfreecreate.d.ts.map +1 -1
  171. package/models/components/productpricerecurringfreecreate.js.map +1 -1
  172. package/models/components/validatedlicensekey.d.ts +3 -0
  173. package/models/components/validatedlicensekey.d.ts.map +1 -1
  174. package/models/components/validatedlicensekey.js +3 -0
  175. package/models/components/validatedlicensekey.js.map +1 -1
  176. package/models/components/webhookbenefitcreatedpayload.d.ts +3 -28
  177. package/models/components/webhookbenefitcreatedpayload.d.ts.map +1 -1
  178. package/models/components/webhookbenefitcreatedpayload.js +4 -57
  179. package/models/components/webhookbenefitcreatedpayload.js.map +1 -1
  180. package/models/components/webhookbenefitupdatedpayload.d.ts +3 -28
  181. package/models/components/webhookbenefitupdatedpayload.d.ts.map +1 -1
  182. package/models/components/webhookbenefitupdatedpayload.js +4 -57
  183. package/models/components/webhookbenefitupdatedpayload.js.map +1 -1
  184. package/models/components/webhookcheckoutcreatedpayload.d.ts +3 -3
  185. package/models/components/webhookcheckoutcreatedpayload.d.ts.map +1 -1
  186. package/models/components/webhookcheckoutcreatedpayload.js +2 -2
  187. package/models/components/webhookcheckoutcreatedpayload.js.map +1 -1
  188. package/models/components/webhookcheckoutupdatedpayload.d.ts +3 -3
  189. package/models/components/webhookcheckoutupdatedpayload.d.ts.map +1 -1
  190. package/models/components/webhookcheckoutupdatedpayload.js +2 -2
  191. package/models/components/webhookcheckoutupdatedpayload.js.map +1 -1
  192. package/models/components/webhooksubscriptionactivepayload.d.ts +59 -0
  193. package/models/components/webhooksubscriptionactivepayload.d.ts.map +1 -0
  194. package/models/components/webhooksubscriptionactivepayload.js +71 -0
  195. package/models/components/webhooksubscriptionactivepayload.js.map +1 -0
  196. package/models/components/webhooksubscriptioncanceledpayload.d.ts +59 -0
  197. package/models/components/webhooksubscriptioncanceledpayload.d.ts.map +1 -0
  198. package/models/components/webhooksubscriptioncanceledpayload.js +71 -0
  199. package/models/components/webhooksubscriptioncanceledpayload.js.map +1 -0
  200. package/models/components/webhooksubscriptionrevokedpayload.d.ts +59 -0
  201. package/models/components/webhooksubscriptionrevokedpayload.d.ts.map +1 -0
  202. package/models/components/webhooksubscriptionrevokedpayload.js +71 -0
  203. package/models/components/webhooksubscriptionrevokedpayload.js.map +1 -0
  204. package/models/components/webhooksubscriptionupdatedpayload.d.ts +6 -2
  205. package/models/components/webhooksubscriptionupdatedpayload.d.ts.map +1 -1
  206. package/models/components/webhooksubscriptionupdatedpayload.js.map +1 -1
  207. package/models/operations/articlesexport.d.ts +25 -0
  208. package/models/operations/articlesexport.d.ts.map +1 -0
  209. package/models/operations/articlesexport.js +59 -0
  210. package/models/operations/articlesexport.js.map +1 -0
  211. package/models/operations/benefitscreate.d.ts +0 -22
  212. package/models/operations/benefitscreate.d.ts.map +1 -1
  213. package/models/operations/benefitscreate.js +1 -32
  214. package/models/operations/benefitscreate.js.map +1 -1
  215. package/models/operations/benefitsget.d.ts +0 -23
  216. package/models/operations/benefitsget.d.ts.map +1 -1
  217. package/models/operations/benefitsget.js +1 -33
  218. package/models/operations/benefitsget.js.map +1 -1
  219. package/models/operations/benefitsupdate.d.ts +0 -22
  220. package/models/operations/benefitsupdate.d.ts.map +1 -1
  221. package/models/operations/benefitsupdate.js +1 -32
  222. package/models/operations/benefitsupdate.js.map +1 -1
  223. package/models/operations/checkoutlinksdelete.d.ts +28 -0
  224. package/models/operations/checkoutlinksdelete.d.ts.map +1 -0
  225. package/models/operations/checkoutlinksdelete.js +50 -0
  226. package/models/operations/checkoutlinksdelete.js.map +1 -0
  227. package/models/operations/checkoutlinksget.d.ts +28 -0
  228. package/models/operations/checkoutlinksget.d.ts.map +1 -0
  229. package/models/operations/checkoutlinksget.js +50 -0
  230. package/models/operations/checkoutlinksget.js.map +1 -0
  231. package/models/operations/checkoutlinkslist.d.ts +116 -0
  232. package/models/operations/checkoutlinkslist.d.ts.map +1 -0
  233. package/models/operations/checkoutlinkslist.js +129 -0
  234. package/models/operations/checkoutlinkslist.js.map +1 -0
  235. package/models/operations/checkoutlinksupdate.d.ts +31 -0
  236. package/models/operations/checkoutlinksupdate.d.ts.map +1 -0
  237. package/models/operations/checkoutlinksupdate.js +62 -0
  238. package/models/operations/checkoutlinksupdate.js.map +1 -0
  239. package/models/operations/index.d.ts +5 -0
  240. package/models/operations/index.d.ts.map +1 -1
  241. package/models/operations/index.js +5 -0
  242. package/models/operations/index.js.map +1 -1
  243. package/models/operations/metricsget.d.ts +1 -42
  244. package/models/operations/metricsget.d.ts.map +1 -1
  245. package/models/operations/metricsget.js +3 -29
  246. package/models/operations/metricsget.js.map +1 -1
  247. package/package.json +1 -1
  248. package/sdk/articles.d.ts +7 -0
  249. package/sdk/articles.d.ts.map +1 -1
  250. package/sdk/articles.js +10 -0
  251. package/sdk/articles.js.map +1 -1
  252. package/sdk/benefits.d.ts +4 -3
  253. package/sdk/benefits.d.ts.map +1 -1
  254. package/sdk/benefits.js.map +1 -1
  255. package/sdk/checkoutlinks.d.ts +42 -0
  256. package/sdk/checkoutlinks.d.ts.map +1 -0
  257. package/sdk/checkoutlinks.js +63 -0
  258. package/sdk/checkoutlinks.js.map +1 -0
  259. package/sdk/sdk.d.ts +3 -0
  260. package/sdk/sdk.d.ts.map +1 -1
  261. package/sdk/sdk.js +5 -0
  262. package/sdk/sdk.js.map +1 -1
  263. package/src/funcs/articlesExport.ts +129 -0
  264. package/src/funcs/benefitsCreate.ts +4 -3
  265. package/src/funcs/benefitsGet.ts +4 -3
  266. package/src/funcs/benefitsUpdate.ts +4 -3
  267. package/src/funcs/checkoutLinksCreate.ts +124 -0
  268. package/src/funcs/checkoutLinksDelete.ts +135 -0
  269. package/src/funcs/checkoutLinksGet.ts +134 -0
  270. package/src/funcs/checkoutLinksList.ts +189 -0
  271. package/src/funcs/checkoutLinksUpdate.ts +138 -0
  272. package/src/lib/config.ts +3 -3
  273. package/src/models/components/articlecreate.ts +18 -77
  274. package/src/models/components/benefit.ts +106 -0
  275. package/src/models/components/benefitbase.ts +0 -3
  276. package/src/models/components/benefitgrantwebhook.ts +9 -137
  277. package/src/models/components/benefitinput.ts +109 -0
  278. package/src/models/components/checkoutlink.ts +131 -0
  279. package/src/models/components/checkoutlinkcreate.ts +127 -0
  280. package/src/models/components/checkoutlinksortproperty.ts +35 -0
  281. package/src/models/components/checkoutlinkupdate.ts +73 -0
  282. package/src/models/components/checkoutpublic.ts +7 -10
  283. package/src/models/components/index.ts +13 -0
  284. package/src/models/components/interval.ts +34 -0
  285. package/src/models/components/issue.ts +0 -6
  286. package/src/models/components/licensekeyread.ts +10 -0
  287. package/src/models/components/licensekeyuser.ts +68 -0
  288. package/src/models/components/licensekeywithactivations.ts +10 -0
  289. package/src/models/components/listresourcebenefit.ts +9 -140
  290. package/src/models/components/listresourcecheckoutlink.ts +61 -0
  291. package/src/models/components/metric.ts +0 -3
  292. package/src/models/components/metricsintervalslimits.ts +5 -5
  293. package/src/models/components/metricslimits.ts +1 -1
  294. package/src/models/components/metricsresponse.ts +0 -3
  295. package/src/models/components/oauth2client.ts +2 -2
  296. package/src/models/components/oauth2clientconfiguration.ts +2 -2
  297. package/src/models/components/oauth2clientconfigurationupdate.ts +2 -2
  298. package/src/models/components/order.ts +11 -0
  299. package/src/models/components/orderbillingreason.ts +35 -0
  300. package/src/models/components/pledge.ts +0 -9
  301. package/src/models/components/polarcheckoutschemascheckout.ts +4 -229
  302. package/src/models/components/productpriceonetimecustom.ts +9 -0
  303. package/src/models/components/productpriceonetimefixed.ts +9 -0
  304. package/src/models/components/productpriceonetimefree.ts +9 -0
  305. package/src/models/components/productpricerecurringcustom.ts +9 -3
  306. package/src/models/components/productpricerecurringfixed.ts +9 -3
  307. package/src/models/components/productpricerecurringfixedcreate.ts +0 -3
  308. package/src/models/components/productpricerecurringfree.ts +9 -3
  309. package/src/models/components/productpricerecurringfreecreate.ts +0 -3
  310. package/src/models/components/validatedlicensekey.ts +10 -0
  311. package/src/models/components/webhookbenefitcreatedpayload.ts +9 -139
  312. package/src/models/components/webhookbenefitupdatedpayload.ts +9 -139
  313. package/src/models/components/webhookcheckoutcreatedpayload.ts +8 -8
  314. package/src/models/components/webhookcheckoutupdatedpayload.ts +8 -8
  315. package/src/models/components/webhooksubscriptionactivepayload.ts +95 -0
  316. package/src/models/components/webhooksubscriptioncanceledpayload.ts +96 -0
  317. package/src/models/components/webhooksubscriptionrevokedpayload.ts +96 -0
  318. package/src/models/components/webhooksubscriptionupdatedpayload.ts +6 -2
  319. package/src/models/operations/articlesexport.ts +54 -0
  320. package/src/models/operations/benefitscreate.ts +0 -67
  321. package/src/models/operations/benefitsget.ts +0 -66
  322. package/src/models/operations/benefitsupdate.ts +0 -67
  323. package/src/models/operations/checkoutlinksdelete.ts +48 -0
  324. package/src/models/operations/checkoutlinksget.ts +48 -0
  325. package/src/models/operations/checkoutlinkslist.ts +224 -0
  326. package/src/models/operations/checkoutlinksupdate.ts +62 -0
  327. package/src/models/operations/index.ts +5 -0
  328. package/src/models/operations/metricsget.ts +3 -38
  329. package/src/sdk/articles.ts +18 -0
  330. package/src/sdk/benefits.ts +4 -3
  331. package/src/sdk/checkoutlinks.ts +101 -0
  332. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,138 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PolarCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as components from "../models/components/index.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { SDKError } from "../models/errors/sdkerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * Update Checkout Link
28
+ *
29
+ * @remarks
30
+ * Update a checkout link.
31
+ */
32
+ export async function checkoutLinksUpdate(
33
+ client: PolarCore,
34
+ request: operations.CheckoutLinksUpdateRequest,
35
+ options?: RequestOptions,
36
+ ): Promise<
37
+ Result<
38
+ components.CheckoutLink,
39
+ | errors.ResourceNotFound
40
+ | errors.HTTPValidationError
41
+ | SDKError
42
+ | SDKValidationError
43
+ | UnexpectedClientError
44
+ | InvalidRequestError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | ConnectionError
48
+ >
49
+ > {
50
+ const parsed = safeParse(
51
+ request,
52
+ (value) =>
53
+ operations.CheckoutLinksUpdateRequest$outboundSchema.parse(value),
54
+ "Input validation failed",
55
+ );
56
+ if (!parsed.ok) {
57
+ return parsed;
58
+ }
59
+ const payload = parsed.value;
60
+ const body = encodeJSON("body", payload.CheckoutLinkUpdate, {
61
+ explode: true,
62
+ });
63
+
64
+ const pathParams = {
65
+ id: encodeSimple("id", payload.id, {
66
+ explode: false,
67
+ charEncoding: "percent",
68
+ }),
69
+ };
70
+
71
+ const path = pathToFunc("/v1/checkout-links/{id}")(pathParams);
72
+
73
+ const headers = new Headers({
74
+ "Content-Type": "application/json",
75
+ Accept: "application/json",
76
+ });
77
+
78
+ const secConfig = await extractSecurity(client._options.accessToken);
79
+ const securityInput = secConfig == null ? {} : { accessToken: secConfig };
80
+ const context = {
81
+ operationID: "checkout-links:update",
82
+ oAuth2Scopes: [],
83
+ securitySource: client._options.accessToken,
84
+ };
85
+ const requestSecurity = resolveGlobalSecurity(securityInput);
86
+
87
+ const requestRes = client._createRequest(context, {
88
+ security: requestSecurity,
89
+ method: "PATCH",
90
+ path: path,
91
+ headers: headers,
92
+ body: body,
93
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
94
+ }, options);
95
+ if (!requestRes.ok) {
96
+ return requestRes;
97
+ }
98
+ const req = requestRes.value;
99
+
100
+ const doResult = await client._do(req, {
101
+ context,
102
+ errorCodes: ["404", "422", "4XX", "5XX"],
103
+ retryConfig: options?.retries
104
+ || client._options.retryConfig,
105
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
106
+ });
107
+ if (!doResult.ok) {
108
+ return doResult;
109
+ }
110
+ const response = doResult.value;
111
+
112
+ const responseFields = {
113
+ HttpMeta: { Response: response, Request: req },
114
+ };
115
+
116
+ const [result] = await M.match<
117
+ components.CheckoutLink,
118
+ | errors.ResourceNotFound
119
+ | errors.HTTPValidationError
120
+ | SDKError
121
+ | SDKValidationError
122
+ | UnexpectedClientError
123
+ | InvalidRequestError
124
+ | RequestAbortedError
125
+ | RequestTimeoutError
126
+ | ConnectionError
127
+ >(
128
+ M.json(200, components.CheckoutLink$inboundSchema),
129
+ M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
130
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
131
+ M.fail(["4XX", "5XX"]),
132
+ )(response, { extraFields: responseFields });
133
+ if (!result.ok) {
134
+ return result;
135
+ }
136
+
137
+ return result;
138
+ }
package/src/lib/config.ts CHANGED
@@ -60,7 +60,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
60
60
  export const SDK_METADATA = {
61
61
  language: "typescript",
62
62
  openapiDocVersion: "0.1.0",
63
- sdkVersion: "0.13.0",
64
- genVersion: "2.437.1",
65
- userAgent: "speakeasy-sdk/typescript 0.13.0 2.437.1 0.1.0 @polar-sh/sdk",
63
+ sdkVersion: "0.13.2",
64
+ genVersion: "2.438.3",
65
+ userAgent: "speakeasy-sdk/typescript 0.13.2 2.438.3 0.1.0 @polar-sh/sdk",
66
66
  } as const;
@@ -4,30 +4,16 @@
4
4
 
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import { ClosedEnum } from "../../types/enums.js";
8
-
9
- /**
10
- * If the user or organization should be credited in the byline.
11
- */
12
- export const ArticleCreateArticleByline = {
13
- User: "user",
14
- Organization: "organization",
15
- } as const;
16
- /**
17
- * If the user or organization should be credited in the byline.
18
- */
19
- export type ArticleCreateArticleByline = ClosedEnum<
20
- typeof ArticleCreateArticleByline
21
- >;
22
-
23
- export const ArticleCreateArticleVisibility = {
24
- Public: "public",
25
- Hidden: "hidden",
26
- Private: "private",
27
- } as const;
28
- export type ArticleCreateArticleVisibility = ClosedEnum<
29
- typeof ArticleCreateArticleVisibility
30
- >;
7
+ import {
8
+ ArticleByline,
9
+ ArticleByline$inboundSchema,
10
+ ArticleByline$outboundSchema,
11
+ } from "./articlebyline.js";
12
+ import {
13
+ ArticleVisibility,
14
+ ArticleVisibility$inboundSchema,
15
+ ArticleVisibility$outboundSchema,
16
+ } from "./articlevisibility.js";
31
17
 
32
18
  export type ArticleCreate = {
33
19
  /**
@@ -50,11 +36,8 @@ export type ArticleCreate = {
50
36
  * The ID of the organization owning the article. **Required unless you use an organization token.**
51
37
  */
52
38
  organizationId?: string | null | undefined;
53
- /**
54
- * If the user or organization should be credited in the byline.
55
- */
56
- byline?: ArticleCreateArticleByline | undefined;
57
- visibility?: ArticleCreateArticleVisibility | undefined;
39
+ byline?: ArticleByline | undefined;
40
+ visibility?: ArticleVisibility | undefined;
58
41
  /**
59
42
  * Set to true to only make this article available for subscribers to a paid subscription tier in the organization.
60
43
  */
@@ -85,48 +68,6 @@ export type ArticleCreate = {
85
68
  ogDescription?: string | null | undefined;
86
69
  };
87
70
 
88
- /** @internal */
89
- export const ArticleCreateArticleByline$inboundSchema: z.ZodNativeEnum<
90
- typeof ArticleCreateArticleByline
91
- > = z.nativeEnum(ArticleCreateArticleByline);
92
-
93
- /** @internal */
94
- export const ArticleCreateArticleByline$outboundSchema: z.ZodNativeEnum<
95
- typeof ArticleCreateArticleByline
96
- > = ArticleCreateArticleByline$inboundSchema;
97
-
98
- /**
99
- * @internal
100
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
- */
102
- export namespace ArticleCreateArticleByline$ {
103
- /** @deprecated use `ArticleCreateArticleByline$inboundSchema` instead. */
104
- export const inboundSchema = ArticleCreateArticleByline$inboundSchema;
105
- /** @deprecated use `ArticleCreateArticleByline$outboundSchema` instead. */
106
- export const outboundSchema = ArticleCreateArticleByline$outboundSchema;
107
- }
108
-
109
- /** @internal */
110
- export const ArticleCreateArticleVisibility$inboundSchema: z.ZodNativeEnum<
111
- typeof ArticleCreateArticleVisibility
112
- > = z.nativeEnum(ArticleCreateArticleVisibility);
113
-
114
- /** @internal */
115
- export const ArticleCreateArticleVisibility$outboundSchema: z.ZodNativeEnum<
116
- typeof ArticleCreateArticleVisibility
117
- > = ArticleCreateArticleVisibility$inboundSchema;
118
-
119
- /**
120
- * @internal
121
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
122
- */
123
- export namespace ArticleCreateArticleVisibility$ {
124
- /** @deprecated use `ArticleCreateArticleVisibility$inboundSchema` instead. */
125
- export const inboundSchema = ArticleCreateArticleVisibility$inboundSchema;
126
- /** @deprecated use `ArticleCreateArticleVisibility$outboundSchema` instead. */
127
- export const outboundSchema = ArticleCreateArticleVisibility$outboundSchema;
128
- }
129
-
130
71
  /** @internal */
131
72
  export const ArticleCreate$inboundSchema: z.ZodType<
132
73
  ArticleCreate,
@@ -138,8 +79,8 @@ export const ArticleCreate$inboundSchema: z.ZodType<
138
79
  body: z.nullable(z.string()).optional(),
139
80
  body_base64: z.nullable(z.string()).optional(),
140
81
  organization_id: z.nullable(z.string()).optional(),
141
- byline: ArticleCreateArticleByline$inboundSchema.default("organization"),
142
- visibility: ArticleCreateArticleVisibility$inboundSchema.default("private"),
82
+ byline: ArticleByline$inboundSchema.optional(),
83
+ visibility: ArticleVisibility$inboundSchema.optional(),
143
84
  paid_subscribers_only: z.boolean().default(false),
144
85
  paid_subscribers_only_ends_at: z.nullable(
145
86
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
@@ -172,8 +113,8 @@ export type ArticleCreate$Outbound = {
172
113
  body?: string | null | undefined;
173
114
  body_base64?: string | null | undefined;
174
115
  organization_id?: string | null | undefined;
175
- byline: string;
176
- visibility: string;
116
+ byline?: string | undefined;
117
+ visibility?: string | undefined;
177
118
  paid_subscribers_only: boolean;
178
119
  paid_subscribers_only_ends_at?: string | null | undefined;
179
120
  published_at?: string | null | undefined;
@@ -194,8 +135,8 @@ export const ArticleCreate$outboundSchema: z.ZodType<
194
135
  body: z.nullable(z.string()).optional(),
195
136
  bodyBase64: z.nullable(z.string()).optional(),
196
137
  organizationId: z.nullable(z.string()).optional(),
197
- byline: ArticleCreateArticleByline$outboundSchema.default("organization"),
198
- visibility: ArticleCreateArticleVisibility$outboundSchema.default("private"),
138
+ byline: ArticleByline$outboundSchema.optional(),
139
+ visibility: ArticleVisibility$outboundSchema.optional(),
199
140
  paidSubscribersOnly: z.boolean().default(false),
200
141
  paidSubscribersOnlyEndsAt: z.nullable(
201
142
  z.date().transform(v => v.toISOString()),
@@ -0,0 +1,106 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import {
7
+ BenefitAds,
8
+ BenefitAds$inboundSchema,
9
+ BenefitAds$Outbound,
10
+ BenefitAds$outboundSchema,
11
+ } from "./benefitads.js";
12
+ import {
13
+ BenefitArticles,
14
+ BenefitArticles$inboundSchema,
15
+ BenefitArticles$Outbound,
16
+ BenefitArticles$outboundSchema,
17
+ } from "./benefitarticles.js";
18
+ import {
19
+ BenefitCustom,
20
+ BenefitCustom$inboundSchema,
21
+ BenefitCustom$Outbound,
22
+ BenefitCustom$outboundSchema,
23
+ } from "./benefitcustom.js";
24
+ import {
25
+ BenefitDiscord,
26
+ BenefitDiscord$inboundSchema,
27
+ BenefitDiscord$Outbound,
28
+ BenefitDiscord$outboundSchema,
29
+ } from "./benefitdiscord.js";
30
+ import {
31
+ BenefitDownloadables,
32
+ BenefitDownloadables$inboundSchema,
33
+ BenefitDownloadables$Outbound,
34
+ BenefitDownloadables$outboundSchema,
35
+ } from "./benefitdownloadables.js";
36
+ import {
37
+ BenefitGitHubRepository,
38
+ BenefitGitHubRepository$inboundSchema,
39
+ BenefitGitHubRepository$Outbound,
40
+ BenefitGitHubRepository$outboundSchema,
41
+ } from "./benefitgithubrepository.js";
42
+ import {
43
+ BenefitLicenseKeys,
44
+ BenefitLicenseKeys$inboundSchema,
45
+ BenefitLicenseKeys$Outbound,
46
+ BenefitLicenseKeys$outboundSchema,
47
+ } from "./benefitlicensekeys.js";
48
+
49
+ export type Benefit =
50
+ | BenefitArticles
51
+ | BenefitAds
52
+ | BenefitDiscord
53
+ | BenefitGitHubRepository
54
+ | BenefitDownloadables
55
+ | BenefitLicenseKeys
56
+ | BenefitCustom;
57
+
58
+ /** @internal */
59
+ export const Benefit$inboundSchema: z.ZodType<Benefit, z.ZodTypeDef, unknown> =
60
+ z.union([
61
+ BenefitArticles$inboundSchema,
62
+ BenefitAds$inboundSchema,
63
+ BenefitDiscord$inboundSchema,
64
+ BenefitGitHubRepository$inboundSchema,
65
+ BenefitDownloadables$inboundSchema,
66
+ BenefitLicenseKeys$inboundSchema,
67
+ BenefitCustom$inboundSchema,
68
+ ]);
69
+
70
+ /** @internal */
71
+ export type Benefit$Outbound =
72
+ | BenefitArticles$Outbound
73
+ | BenefitAds$Outbound
74
+ | BenefitDiscord$Outbound
75
+ | BenefitGitHubRepository$Outbound
76
+ | BenefitDownloadables$Outbound
77
+ | BenefitLicenseKeys$Outbound
78
+ | BenefitCustom$Outbound;
79
+
80
+ /** @internal */
81
+ export const Benefit$outboundSchema: z.ZodType<
82
+ Benefit$Outbound,
83
+ z.ZodTypeDef,
84
+ Benefit
85
+ > = z.union([
86
+ BenefitArticles$outboundSchema,
87
+ BenefitAds$outboundSchema,
88
+ BenefitDiscord$outboundSchema,
89
+ BenefitGitHubRepository$outboundSchema,
90
+ BenefitDownloadables$outboundSchema,
91
+ BenefitLicenseKeys$outboundSchema,
92
+ BenefitCustom$outboundSchema,
93
+ ]);
94
+
95
+ /**
96
+ * @internal
97
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
98
+ */
99
+ export namespace Benefit$ {
100
+ /** @deprecated use `Benefit$inboundSchema` instead. */
101
+ export const inboundSchema = Benefit$inboundSchema;
102
+ /** @deprecated use `Benefit$outboundSchema` instead. */
103
+ export const outboundSchema = Benefit$outboundSchema;
104
+ /** @deprecated use `Benefit$Outbound` instead. */
105
+ export type Outbound = Benefit$Outbound;
106
+ }
@@ -23,9 +23,6 @@ export type BenefitBase = {
23
23
  * The ID of the benefit.
24
24
  */
25
25
  id: string;
26
- /**
27
- * The type of the benefit.
28
- */
29
26
  type: BenefitType;
30
27
  /**
31
28
  * The description of the benefit.
@@ -4,42 +4,6 @@
4
4
 
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import {
8
- BenefitAds,
9
- BenefitAds$inboundSchema,
10
- BenefitAds$Outbound,
11
- BenefitAds$outboundSchema,
12
- } from "./benefitads.js";
13
- import {
14
- BenefitArticles,
15
- BenefitArticles$inboundSchema,
16
- BenefitArticles$Outbound,
17
- BenefitArticles$outboundSchema,
18
- } from "./benefitarticles.js";
19
- import {
20
- BenefitCustom,
21
- BenefitCustom$inboundSchema,
22
- BenefitCustom$Outbound,
23
- BenefitCustom$outboundSchema,
24
- } from "./benefitcustom.js";
25
- import {
26
- BenefitDiscordInput,
27
- BenefitDiscordInput$inboundSchema,
28
- BenefitDiscordInput$Outbound,
29
- BenefitDiscordInput$outboundSchema,
30
- } from "./benefitdiscord.js";
31
- import {
32
- BenefitDownloadables,
33
- BenefitDownloadables$inboundSchema,
34
- BenefitDownloadables$Outbound,
35
- BenefitDownloadables$outboundSchema,
36
- } from "./benefitdownloadables.js";
37
- import {
38
- BenefitGitHubRepository,
39
- BenefitGitHubRepository$inboundSchema,
40
- BenefitGitHubRepository$Outbound,
41
- BenefitGitHubRepository$outboundSchema,
42
- } from "./benefitgithubrepository.js";
43
7
  import {
44
8
  BenefitGrantAdsProperties,
45
9
  BenefitGrantAdsProperties$inboundSchema,
@@ -83,11 +47,11 @@ import {
83
47
  BenefitGrantLicenseKeysProperties$outboundSchema,
84
48
  } from "./benefitgrantlicensekeysproperties.js";
85
49
  import {
86
- BenefitLicenseKeys,
87
- BenefitLicenseKeys$inboundSchema,
88
- BenefitLicenseKeys$Outbound,
89
- BenefitLicenseKeys$outboundSchema,
90
- } from "./benefitlicensekeys.js";
50
+ BenefitInput,
51
+ BenefitInput$inboundSchema,
52
+ BenefitInput$Outbound,
53
+ BenefitInput$outboundSchema,
54
+ } from "./benefitinput.js";
91
55
 
92
56
  export type BenefitGrantWebhookProperties =
93
57
  | BenefitGrantCustomProperties
@@ -98,15 +62,6 @@ export type BenefitGrantWebhookProperties =
98
62
  | BenefitGrantDiscordProperties
99
63
  | BenefitGrantGitHubRepositoryProperties;
100
64
 
101
- export type BenefitGrantWebhookBenefit =
102
- | BenefitArticles
103
- | BenefitAds
104
- | BenefitDiscordInput
105
- | BenefitGitHubRepository
106
- | BenefitDownloadables
107
- | BenefitLicenseKeys
108
- | BenefitCustom;
109
-
110
65
  export type PreviousProperties =
111
66
  | BenefitGrantCustomProperties
112
67
  | BenefitGrantArticlesProperties
@@ -169,14 +124,7 @@ export type BenefitGrantWebhook = {
169
124
  | BenefitGrantLicenseKeysProperties
170
125
  | BenefitGrantDiscordProperties
171
126
  | BenefitGrantGitHubRepositoryProperties;
172
- benefit:
173
- | BenefitArticles
174
- | BenefitAds
175
- | BenefitDiscordInput
176
- | BenefitGitHubRepository
177
- | BenefitDownloadables
178
- | BenefitLicenseKeys
179
- | BenefitCustom;
127
+ benefit: BenefitInput;
180
128
  previousProperties?:
181
129
  | BenefitGrantCustomProperties
182
130
  | BenefitGrantArticlesProperties
@@ -242,59 +190,6 @@ export namespace BenefitGrantWebhookProperties$ {
242
190
  export type Outbound = BenefitGrantWebhookProperties$Outbound;
243
191
  }
244
192
 
245
- /** @internal */
246
- export const BenefitGrantWebhookBenefit$inboundSchema: z.ZodType<
247
- BenefitGrantWebhookBenefit,
248
- z.ZodTypeDef,
249
- unknown
250
- > = z.union([
251
- BenefitArticles$inboundSchema,
252
- BenefitAds$inboundSchema,
253
- BenefitDiscordInput$inboundSchema,
254
- BenefitGitHubRepository$inboundSchema,
255
- BenefitDownloadables$inboundSchema,
256
- BenefitLicenseKeys$inboundSchema,
257
- BenefitCustom$inboundSchema,
258
- ]);
259
-
260
- /** @internal */
261
- export type BenefitGrantWebhookBenefit$Outbound =
262
- | BenefitArticles$Outbound
263
- | BenefitAds$Outbound
264
- | BenefitDiscordInput$Outbound
265
- | BenefitGitHubRepository$Outbound
266
- | BenefitDownloadables$Outbound
267
- | BenefitLicenseKeys$Outbound
268
- | BenefitCustom$Outbound;
269
-
270
- /** @internal */
271
- export const BenefitGrantWebhookBenefit$outboundSchema: z.ZodType<
272
- BenefitGrantWebhookBenefit$Outbound,
273
- z.ZodTypeDef,
274
- BenefitGrantWebhookBenefit
275
- > = z.union([
276
- BenefitArticles$outboundSchema,
277
- BenefitAds$outboundSchema,
278
- BenefitDiscordInput$outboundSchema,
279
- BenefitGitHubRepository$outboundSchema,
280
- BenefitDownloadables$outboundSchema,
281
- BenefitLicenseKeys$outboundSchema,
282
- BenefitCustom$outboundSchema,
283
- ]);
284
-
285
- /**
286
- * @internal
287
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
288
- */
289
- export namespace BenefitGrantWebhookBenefit$ {
290
- /** @deprecated use `BenefitGrantWebhookBenefit$inboundSchema` instead. */
291
- export const inboundSchema = BenefitGrantWebhookBenefit$inboundSchema;
292
- /** @deprecated use `BenefitGrantWebhookBenefit$outboundSchema` instead. */
293
- export const outboundSchema = BenefitGrantWebhookBenefit$outboundSchema;
294
- /** @deprecated use `BenefitGrantWebhookBenefit$Outbound` instead. */
295
- export type Outbound = BenefitGrantWebhookBenefit$Outbound;
296
- }
297
-
298
193
  /** @internal */
299
194
  export const PreviousProperties$inboundSchema: z.ZodType<
300
195
  PreviousProperties,
@@ -380,15 +275,7 @@ export const BenefitGrantWebhook$inboundSchema: z.ZodType<
380
275
  BenefitGrantDiscordProperties$inboundSchema,
381
276
  BenefitGrantGitHubRepositoryProperties$inboundSchema,
382
277
  ]),
383
- benefit: z.union([
384
- BenefitArticles$inboundSchema,
385
- BenefitAds$inboundSchema,
386
- BenefitDiscordInput$inboundSchema,
387
- BenefitGitHubRepository$inboundSchema,
388
- BenefitDownloadables$inboundSchema,
389
- BenefitLicenseKeys$inboundSchema,
390
- BenefitCustom$inboundSchema,
391
- ]),
278
+ benefit: BenefitInput$inboundSchema,
392
279
  previous_properties: z.nullable(
393
280
  z.union([
394
281
  BenefitGrantCustomProperties$inboundSchema,
@@ -437,14 +324,7 @@ export type BenefitGrantWebhook$Outbound = {
437
324
  | BenefitGrantLicenseKeysProperties$Outbound
438
325
  | BenefitGrantDiscordProperties$Outbound
439
326
  | BenefitGrantGitHubRepositoryProperties$Outbound;
440
- benefit:
441
- | BenefitArticles$Outbound
442
- | BenefitAds$Outbound
443
- | BenefitDiscordInput$Outbound
444
- | BenefitGitHubRepository$Outbound
445
- | BenefitDownloadables$Outbound
446
- | BenefitLicenseKeys$Outbound
447
- | BenefitCustom$Outbound;
327
+ benefit: BenefitInput$Outbound;
448
328
  previous_properties?:
449
329
  | BenefitGrantCustomProperties$Outbound
450
330
  | BenefitGrantArticlesProperties$Outbound
@@ -483,15 +363,7 @@ export const BenefitGrantWebhook$outboundSchema: z.ZodType<
483
363
  BenefitGrantDiscordProperties$outboundSchema,
484
364
  BenefitGrantGitHubRepositoryProperties$outboundSchema,
485
365
  ]),
486
- benefit: z.union([
487
- BenefitArticles$outboundSchema,
488
- BenefitAds$outboundSchema,
489
- BenefitDiscordInput$outboundSchema,
490
- BenefitGitHubRepository$outboundSchema,
491
- BenefitDownloadables$outboundSchema,
492
- BenefitLicenseKeys$outboundSchema,
493
- BenefitCustom$outboundSchema,
494
- ]),
366
+ benefit: BenefitInput$outboundSchema,
495
367
  previousProperties: z.nullable(
496
368
  z.union([
497
369
  BenefitGrantCustomProperties$outboundSchema,