@polar-sh/sdk 0.9.0 → 0.10.0

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 (644) hide show
  1. package/README.md +0 -44
  2. package/docs/sdks/benefits/README.md +4 -13
  3. package/docs/sdks/clients/README.md +4 -4
  4. package/docs/sdks/files/README.md +9 -9
  5. package/docs/sdks/oauth2/README.md +2 -2
  6. package/docs/sdks/polarsubscriptions/README.md +5 -89
  7. package/docs/sdks/products/README.md +2 -5
  8. package/docs/sdks/subscriptions/README.md +0 -164
  9. package/funcs/advertisementsGet.d.ts +1 -1
  10. package/funcs/advertisementsGet.d.ts.map +1 -1
  11. package/funcs/advertisementsGet.js +32 -32
  12. package/funcs/advertisementsGet.js.map +1 -1
  13. package/funcs/advertisementsList.d.ts +1 -1
  14. package/funcs/advertisementsList.d.ts.map +1 -1
  15. package/funcs/advertisementsList.js +42 -42
  16. package/funcs/advertisementsList.js.map +1 -1
  17. package/funcs/articlesCreate.d.ts +1 -1
  18. package/funcs/articlesCreate.d.ts.map +1 -1
  19. package/funcs/articlesCreate.js +30 -30
  20. package/funcs/articlesCreate.js.map +1 -1
  21. package/funcs/articlesDelete.d.ts +1 -1
  22. package/funcs/articlesDelete.d.ts.map +1 -1
  23. package/funcs/articlesDelete.js +32 -32
  24. package/funcs/articlesDelete.js.map +1 -1
  25. package/funcs/articlesGet.d.ts +1 -1
  26. package/funcs/articlesGet.d.ts.map +1 -1
  27. package/funcs/articlesGet.js +32 -32
  28. package/funcs/articlesGet.js.map +1 -1
  29. package/funcs/articlesList.d.ts +1 -1
  30. package/funcs/articlesList.d.ts.map +1 -1
  31. package/funcs/articlesList.js +46 -46
  32. package/funcs/articlesList.js.map +1 -1
  33. package/funcs/articlesPreview.d.ts +1 -1
  34. package/funcs/articlesPreview.d.ts.map +1 -1
  35. package/funcs/articlesPreview.js +32 -32
  36. package/funcs/articlesPreview.js.map +1 -1
  37. package/funcs/articlesReceivers.d.ts +1 -1
  38. package/funcs/articlesReceivers.d.ts.map +1 -1
  39. package/funcs/articlesReceivers.js +32 -32
  40. package/funcs/articlesReceivers.js.map +1 -1
  41. package/funcs/articlesSend.d.ts +1 -1
  42. package/funcs/articlesSend.d.ts.map +1 -1
  43. package/funcs/articlesSend.js +32 -32
  44. package/funcs/articlesSend.js.map +1 -1
  45. package/funcs/articlesUpdate.d.ts +1 -1
  46. package/funcs/articlesUpdate.d.ts.map +1 -1
  47. package/funcs/articlesUpdate.js +32 -32
  48. package/funcs/articlesUpdate.js.map +1 -1
  49. package/funcs/benefitsCreate.d.ts +1 -1
  50. package/funcs/benefitsCreate.d.ts.map +1 -1
  51. package/funcs/benefitsCreate.js +30 -30
  52. package/funcs/benefitsCreate.js.map +1 -1
  53. package/funcs/benefitsDelete.d.ts +1 -1
  54. package/funcs/benefitsDelete.d.ts.map +1 -1
  55. package/funcs/benefitsDelete.js +32 -32
  56. package/funcs/benefitsDelete.js.map +1 -1
  57. package/funcs/benefitsGet.d.ts +1 -1
  58. package/funcs/benefitsGet.d.ts.map +1 -1
  59. package/funcs/benefitsGet.js +32 -32
  60. package/funcs/benefitsGet.js.map +1 -1
  61. package/funcs/benefitsGrants.d.ts +1 -1
  62. package/funcs/benefitsGrants.d.ts.map +1 -1
  63. package/funcs/benefitsGrants.js +45 -45
  64. package/funcs/benefitsGrants.js.map +1 -1
  65. package/funcs/benefitsList.d.ts +1 -1
  66. package/funcs/benefitsList.d.ts.map +1 -1
  67. package/funcs/benefitsList.js +42 -42
  68. package/funcs/benefitsList.js.map +1 -1
  69. package/funcs/benefitsUpdate.d.ts +1 -1
  70. package/funcs/benefitsUpdate.d.ts.map +1 -1
  71. package/funcs/benefitsUpdate.js +32 -32
  72. package/funcs/benefitsUpdate.js.map +1 -1
  73. package/funcs/checkoutsCreate.d.ts +1 -1
  74. package/funcs/checkoutsCreate.d.ts.map +1 -1
  75. package/funcs/checkoutsCreate.js +30 -30
  76. package/funcs/checkoutsCreate.js.map +1 -1
  77. package/funcs/checkoutsGet.d.ts +1 -1
  78. package/funcs/checkoutsGet.d.ts.map +1 -1
  79. package/funcs/checkoutsGet.js +32 -32
  80. package/funcs/checkoutsGet.js.map +1 -1
  81. package/funcs/externalOrganizationsList.d.ts +1 -1
  82. package/funcs/externalOrganizationsList.d.ts.map +1 -1
  83. package/funcs/externalOrganizationsList.js +44 -44
  84. package/funcs/externalOrganizationsList.js.map +1 -1
  85. package/funcs/filesCreate.d.ts +1 -1
  86. package/funcs/filesCreate.d.ts.map +1 -1
  87. package/funcs/filesCreate.js +30 -30
  88. package/funcs/filesCreate.js.map +1 -1
  89. package/funcs/filesDelete.d.ts +1 -1
  90. package/funcs/filesDelete.d.ts.map +1 -1
  91. package/funcs/filesDelete.js +32 -32
  92. package/funcs/filesDelete.js.map +1 -1
  93. package/funcs/filesList.d.ts +1 -1
  94. package/funcs/filesList.d.ts.map +1 -1
  95. package/funcs/filesList.js +41 -41
  96. package/funcs/filesList.js.map +1 -1
  97. package/funcs/filesUpdate.d.ts +1 -1
  98. package/funcs/filesUpdate.d.ts.map +1 -1
  99. package/funcs/filesUpdate.js +32 -32
  100. package/funcs/filesUpdate.js.map +1 -1
  101. package/funcs/filesUploaded.d.ts +1 -1
  102. package/funcs/filesUploaded.d.ts.map +1 -1
  103. package/funcs/filesUploaded.js +32 -32
  104. package/funcs/filesUploaded.js.map +1 -1
  105. package/funcs/licenseKeysGet.d.ts +1 -1
  106. package/funcs/licenseKeysGet.d.ts.map +1 -1
  107. package/funcs/licenseKeysGet.js +32 -32
  108. package/funcs/licenseKeysGet.js.map +1 -1
  109. package/funcs/licenseKeysGetActivation.d.ts +1 -1
  110. package/funcs/licenseKeysGetActivation.d.ts.map +1 -1
  111. package/funcs/licenseKeysGetActivation.js +33 -33
  112. package/funcs/licenseKeysGetActivation.js.map +1 -1
  113. package/funcs/licenseKeysList.d.ts +1 -1
  114. package/funcs/licenseKeysList.d.ts.map +1 -1
  115. package/funcs/licenseKeysList.js +41 -41
  116. package/funcs/licenseKeysList.js.map +1 -1
  117. package/funcs/licenseKeysUpdate.d.ts +1 -1
  118. package/funcs/licenseKeysUpdate.d.ts.map +1 -1
  119. package/funcs/licenseKeysUpdate.js +32 -34
  120. package/funcs/licenseKeysUpdate.js.map +1 -1
  121. package/funcs/metricsGet.d.ts +1 -1
  122. package/funcs/metricsGet.d.ts.map +1 -1
  123. package/funcs/metricsGet.js +38 -38
  124. package/funcs/metricsGet.js.map +1 -1
  125. package/funcs/metricsLimits.d.ts +1 -1
  126. package/funcs/metricsLimits.d.ts.map +1 -1
  127. package/funcs/metricsLimits.js +20 -20
  128. package/funcs/metricsLimits.js.map +1 -1
  129. package/funcs/oauth2ClientsCreate.d.ts +1 -1
  130. package/funcs/oauth2ClientsCreate.d.ts.map +1 -1
  131. package/funcs/oauth2ClientsCreate.js +30 -30
  132. package/funcs/oauth2ClientsCreate.js.map +1 -1
  133. package/funcs/oauth2ClientsDelete.d.ts +1 -1
  134. package/funcs/oauth2ClientsDelete.d.ts.map +1 -1
  135. package/funcs/oauth2ClientsDelete.js +32 -32
  136. package/funcs/oauth2ClientsDelete.js.map +1 -1
  137. package/funcs/oauth2ClientsGet.d.ts +1 -1
  138. package/funcs/oauth2ClientsGet.d.ts.map +1 -1
  139. package/funcs/oauth2ClientsGet.js +32 -32
  140. package/funcs/oauth2ClientsGet.js.map +1 -1
  141. package/funcs/oauth2ClientsList.d.ts +1 -1
  142. package/funcs/oauth2ClientsList.d.ts.map +1 -1
  143. package/funcs/oauth2ClientsList.js +40 -40
  144. package/funcs/oauth2ClientsList.js.map +1 -1
  145. package/funcs/oauth2ClientsUpdate.d.ts +1 -1
  146. package/funcs/oauth2ClientsUpdate.d.ts.map +1 -1
  147. package/funcs/oauth2ClientsUpdate.js +32 -32
  148. package/funcs/oauth2ClientsUpdate.js.map +1 -1
  149. package/funcs/oauth2Introspect.d.ts +1 -1
  150. package/funcs/oauth2Introspect.d.ts.map +1 -1
  151. package/funcs/oauth2Introspect.js +29 -29
  152. package/funcs/oauth2Introspect.js.map +1 -1
  153. package/funcs/oauth2Revoke.d.ts +1 -1
  154. package/funcs/oauth2Revoke.d.ts.map +1 -1
  155. package/funcs/oauth2Revoke.js +28 -28
  156. package/funcs/oauth2Revoke.js.map +1 -1
  157. package/funcs/oauth2Token.d.ts +1 -1
  158. package/funcs/oauth2Token.d.ts.map +1 -1
  159. package/funcs/oauth2Token.js +28 -28
  160. package/funcs/oauth2Token.js.map +1 -1
  161. package/funcs/oauth2Userinfo.d.ts +1 -1
  162. package/funcs/oauth2Userinfo.d.ts.map +1 -1
  163. package/funcs/oauth2Userinfo.js +20 -20
  164. package/funcs/oauth2Userinfo.js.map +1 -1
  165. package/funcs/ordersGet.d.ts +1 -1
  166. package/funcs/ordersGet.d.ts.map +1 -1
  167. package/funcs/ordersGet.js +32 -32
  168. package/funcs/ordersGet.js.map +1 -1
  169. package/funcs/ordersInvoice.d.ts +1 -1
  170. package/funcs/ordersInvoice.d.ts.map +1 -1
  171. package/funcs/ordersInvoice.js +32 -32
  172. package/funcs/ordersInvoice.js.map +1 -1
  173. package/funcs/ordersList.d.ts +1 -1
  174. package/funcs/ordersList.d.ts.map +1 -1
  175. package/funcs/ordersList.js +44 -46
  176. package/funcs/ordersList.js.map +1 -1
  177. package/funcs/organizationsCreate.d.ts +1 -1
  178. package/funcs/organizationsCreate.d.ts.map +1 -1
  179. package/funcs/organizationsCreate.js +30 -30
  180. package/funcs/organizationsCreate.js.map +1 -1
  181. package/funcs/organizationsGet.d.ts +1 -1
  182. package/funcs/organizationsGet.d.ts.map +1 -1
  183. package/funcs/organizationsGet.js +32 -32
  184. package/funcs/organizationsGet.js.map +1 -1
  185. package/funcs/organizationsList.d.ts +1 -1
  186. package/funcs/organizationsList.d.ts.map +1 -1
  187. package/funcs/organizationsList.js +43 -43
  188. package/funcs/organizationsList.js.map +1 -1
  189. package/funcs/organizationsUpdate.d.ts +1 -1
  190. package/funcs/organizationsUpdate.d.ts.map +1 -1
  191. package/funcs/organizationsUpdate.js +32 -32
  192. package/funcs/organizationsUpdate.js.map +1 -1
  193. package/funcs/productsCreate.d.ts +1 -1
  194. package/funcs/productsCreate.d.ts.map +1 -1
  195. package/funcs/productsCreate.js +30 -30
  196. package/funcs/productsCreate.js.map +1 -1
  197. package/funcs/productsGet.d.ts +1 -1
  198. package/funcs/productsGet.d.ts.map +1 -1
  199. package/funcs/productsGet.js +32 -32
  200. package/funcs/productsGet.js.map +1 -1
  201. package/funcs/productsList.d.ts +1 -1
  202. package/funcs/productsList.d.ts.map +1 -1
  203. package/funcs/productsList.js +44 -45
  204. package/funcs/productsList.js.map +1 -1
  205. package/funcs/productsUpdate.d.ts +1 -1
  206. package/funcs/productsUpdate.d.ts.map +1 -1
  207. package/funcs/productsUpdate.js +32 -32
  208. package/funcs/productsUpdate.js.map +1 -1
  209. package/funcs/productsUpdateBenefits.d.ts +1 -1
  210. package/funcs/productsUpdateBenefits.d.ts.map +1 -1
  211. package/funcs/productsUpdateBenefits.js +32 -32
  212. package/funcs/productsUpdateBenefits.js.map +1 -1
  213. package/funcs/repositoriesGet.d.ts +1 -1
  214. package/funcs/repositoriesGet.d.ts.map +1 -1
  215. package/funcs/repositoriesGet.js +32 -32
  216. package/funcs/repositoriesGet.js.map +1 -1
  217. package/funcs/repositoriesList.d.ts +1 -1
  218. package/funcs/repositoriesList.d.ts.map +1 -1
  219. package/funcs/repositoriesList.js +46 -46
  220. package/funcs/repositoriesList.js.map +1 -1
  221. package/funcs/repositoriesUpdate.d.ts +1 -1
  222. package/funcs/repositoriesUpdate.d.ts.map +1 -1
  223. package/funcs/repositoriesUpdate.js +32 -34
  224. package/funcs/repositoriesUpdate.js.map +1 -1
  225. package/funcs/subscriptionsExport.d.ts +1 -1
  226. package/funcs/subscriptionsExport.d.ts.map +1 -1
  227. package/funcs/subscriptionsExport.js +33 -33
  228. package/funcs/subscriptionsExport.js.map +1 -1
  229. package/funcs/subscriptionsList.d.ts +1 -1
  230. package/funcs/subscriptionsList.d.ts.map +1 -1
  231. package/funcs/subscriptionsList.js +44 -45
  232. package/funcs/subscriptionsList.js.map +1 -1
  233. package/funcs/usersAdvertisementsCreate.d.ts +1 -1
  234. package/funcs/usersAdvertisementsCreate.d.ts.map +1 -1
  235. package/funcs/usersAdvertisementsCreate.js +30 -30
  236. package/funcs/usersAdvertisementsCreate.js.map +1 -1
  237. package/funcs/usersAdvertisementsDelete.d.ts +1 -1
  238. package/funcs/usersAdvertisementsDelete.d.ts.map +1 -1
  239. package/funcs/usersAdvertisementsDelete.js +32 -32
  240. package/funcs/usersAdvertisementsDelete.js.map +1 -1
  241. package/funcs/usersAdvertisementsEnable.d.ts +1 -1
  242. package/funcs/usersAdvertisementsEnable.d.ts.map +1 -1
  243. package/funcs/usersAdvertisementsEnable.js +32 -32
  244. package/funcs/usersAdvertisementsEnable.js.map +1 -1
  245. package/funcs/usersAdvertisementsGet.d.ts +1 -1
  246. package/funcs/usersAdvertisementsGet.d.ts.map +1 -1
  247. package/funcs/usersAdvertisementsGet.js +32 -32
  248. package/funcs/usersAdvertisementsGet.js.map +1 -1
  249. package/funcs/usersAdvertisementsList.d.ts +1 -1
  250. package/funcs/usersAdvertisementsList.d.ts.map +1 -1
  251. package/funcs/usersAdvertisementsList.js +41 -41
  252. package/funcs/usersAdvertisementsList.js.map +1 -1
  253. package/funcs/usersAdvertisementsUpdate.d.ts +1 -1
  254. package/funcs/usersAdvertisementsUpdate.d.ts.map +1 -1
  255. package/funcs/usersAdvertisementsUpdate.js +32 -32
  256. package/funcs/usersAdvertisementsUpdate.js.map +1 -1
  257. package/funcs/usersBenefitsGet.d.ts +1 -1
  258. package/funcs/usersBenefitsGet.d.ts.map +1 -1
  259. package/funcs/usersBenefitsGet.js +32 -32
  260. package/funcs/usersBenefitsGet.js.map +1 -1
  261. package/funcs/usersBenefitsList.d.ts +1 -1
  262. package/funcs/usersBenefitsList.d.ts.map +1 -1
  263. package/funcs/usersBenefitsList.js +45 -45
  264. package/funcs/usersBenefitsList.js.map +1 -1
  265. package/funcs/usersDownloadablesGet.d.ts +1 -1
  266. package/funcs/usersDownloadablesGet.d.ts.map +1 -1
  267. package/funcs/usersDownloadablesGet.js +32 -32
  268. package/funcs/usersDownloadablesGet.js.map +1 -1
  269. package/funcs/usersDownloadablesList.d.ts +1 -1
  270. package/funcs/usersDownloadablesList.d.ts.map +1 -1
  271. package/funcs/usersDownloadablesList.js +42 -42
  272. package/funcs/usersDownloadablesList.js.map +1 -1
  273. package/funcs/usersLicenseKeysActivate.d.ts +1 -1
  274. package/funcs/usersLicenseKeysActivate.d.ts.map +1 -1
  275. package/funcs/usersLicenseKeysActivate.js +30 -30
  276. package/funcs/usersLicenseKeysActivate.js.map +1 -1
  277. package/funcs/usersLicenseKeysDeactivate.d.ts +1 -1
  278. package/funcs/usersLicenseKeysDeactivate.d.ts.map +1 -1
  279. package/funcs/usersLicenseKeysDeactivate.js +30 -30
  280. package/funcs/usersLicenseKeysDeactivate.js.map +1 -1
  281. package/funcs/usersLicenseKeysGet.d.ts +1 -1
  282. package/funcs/usersLicenseKeysGet.d.ts.map +1 -1
  283. package/funcs/usersLicenseKeysGet.js +32 -32
  284. package/funcs/usersLicenseKeysGet.js.map +1 -1
  285. package/funcs/usersLicenseKeysList.d.ts +1 -1
  286. package/funcs/usersLicenseKeysList.d.ts.map +1 -1
  287. package/funcs/usersLicenseKeysList.js +42 -42
  288. package/funcs/usersLicenseKeysList.js.map +1 -1
  289. package/funcs/usersLicenseKeysValidate.d.ts +1 -1
  290. package/funcs/usersLicenseKeysValidate.d.ts.map +1 -1
  291. package/funcs/usersLicenseKeysValidate.js +30 -30
  292. package/funcs/usersLicenseKeysValidate.js.map +1 -1
  293. package/funcs/usersOrdersGet.d.ts +1 -1
  294. package/funcs/usersOrdersGet.d.ts.map +1 -1
  295. package/funcs/usersOrdersGet.js +32 -32
  296. package/funcs/usersOrdersGet.js.map +1 -1
  297. package/funcs/usersOrdersInvoice.d.ts +1 -1
  298. package/funcs/usersOrdersInvoice.d.ts.map +1 -1
  299. package/funcs/usersOrdersInvoice.js +32 -32
  300. package/funcs/usersOrdersInvoice.js.map +1 -1
  301. package/funcs/usersOrdersList.d.ts +1 -1
  302. package/funcs/usersOrdersList.d.ts.map +1 -1
  303. package/funcs/usersOrdersList.js +46 -46
  304. package/funcs/usersOrdersList.js.map +1 -1
  305. package/funcs/usersSubscriptionsCancel.d.ts +1 -1
  306. package/funcs/usersSubscriptionsCancel.d.ts.map +1 -1
  307. package/funcs/usersSubscriptionsCancel.js +32 -32
  308. package/funcs/usersSubscriptionsCancel.js.map +1 -1
  309. package/funcs/usersSubscriptionsGet.d.ts +1 -1
  310. package/funcs/usersSubscriptionsGet.d.ts.map +1 -1
  311. package/funcs/usersSubscriptionsGet.js +32 -32
  312. package/funcs/usersSubscriptionsGet.js.map +1 -1
  313. package/funcs/usersSubscriptionsList.d.ts +1 -1
  314. package/funcs/usersSubscriptionsList.d.ts.map +1 -1
  315. package/funcs/usersSubscriptionsList.js +45 -45
  316. package/funcs/usersSubscriptionsList.js.map +1 -1
  317. package/funcs/usersSubscriptionsUpdate.d.ts +1 -1
  318. package/funcs/usersSubscriptionsUpdate.d.ts.map +1 -1
  319. package/funcs/usersSubscriptionsUpdate.js +33 -33
  320. package/funcs/usersSubscriptionsUpdate.js.map +1 -1
  321. package/lib/config.d.ts +3 -3
  322. package/lib/config.js +3 -3
  323. package/lib/config.js.map +1 -1
  324. package/lib/sdks.d.ts +5 -8
  325. package/lib/sdks.d.ts.map +1 -1
  326. package/lib/sdks.js +36 -20
  327. package/lib/sdks.js.map +1 -1
  328. package/models/components/index.d.ts +5 -6
  329. package/models/components/index.d.ts.map +1 -1
  330. package/models/components/index.js +5 -6
  331. package/models/components/index.js.map +1 -1
  332. package/models/components/orderproduct.d.ts +0 -11
  333. package/models/components/orderproduct.d.ts.map +1 -1
  334. package/models/components/orderproduct.js +0 -7
  335. package/models/components/orderproduct.js.map +1 -1
  336. package/models/components/ordersubscription.d.ts +2 -2
  337. package/models/components/ordersubscription.d.ts.map +1 -1
  338. package/models/components/ordersubscription.js +2 -2
  339. package/models/components/ordersubscription.js.map +1 -1
  340. package/models/components/productinput.d.ts +0 -11
  341. package/models/components/productinput.d.ts.map +1 -1
  342. package/models/components/productinput.js +0 -7
  343. package/models/components/productinput.js.map +1 -1
  344. package/models/components/productonetimecreate.d.ts +5 -4
  345. package/models/components/productonetimecreate.d.ts.map +1 -1
  346. package/models/components/productonetimecreate.js +5 -0
  347. package/models/components/productonetimecreate.js.map +1 -1
  348. package/models/components/productoutput.d.ts +0 -11
  349. package/models/components/productoutput.d.ts.map +1 -1
  350. package/models/components/productoutput.js +0 -7
  351. package/models/components/productoutput.js.map +1 -1
  352. package/models/components/productpriceonetime.d.ts +3 -2
  353. package/models/components/productpriceonetime.d.ts.map +1 -1
  354. package/models/components/productpriceonetime.js +3 -0
  355. package/models/components/productpriceonetime.js.map +1 -1
  356. package/models/components/productpriceonetimecustom.d.ts +5 -5
  357. package/models/components/productpriceonetimecustom.d.ts.map +1 -1
  358. package/models/components/productpriceonetimecustom.js +4 -4
  359. package/models/components/productpriceonetimecustom.js.map +1 -1
  360. package/models/components/productpriceonetimecustomcreate.d.ts +24 -0
  361. package/models/components/productpriceonetimecustomcreate.d.ts.map +1 -1
  362. package/models/components/productpriceonetimecustomcreate.js +24 -1
  363. package/models/components/productpriceonetimecustomcreate.js.map +1 -1
  364. package/models/components/productpriceonetimefixed.d.ts +5 -5
  365. package/models/components/productpriceonetimefixed.d.ts.map +1 -1
  366. package/models/components/productpriceonetimefixed.js +4 -4
  367. package/models/components/productpriceonetimefixed.js.map +1 -1
  368. package/models/components/productpriceonetimefixedcreate.d.ts +29 -5
  369. package/models/components/productpriceonetimefixedcreate.d.ts.map +1 -1
  370. package/models/components/productpriceonetimefixedcreate.js +28 -5
  371. package/models/components/productpriceonetimefixedcreate.js.map +1 -1
  372. package/models/components/productpriceonetimefree.d.ts +104 -0
  373. package/models/components/productpriceonetimefree.d.ts.map +1 -0
  374. package/models/components/productpriceonetimefree.js +114 -0
  375. package/models/components/productpriceonetimefree.js.map +1 -0
  376. package/models/components/productpriceonetimefreecreate.d.ts +75 -0
  377. package/models/components/productpriceonetimefreecreate.d.ts.map +1 -0
  378. package/models/components/productpriceonetimefreecreate.js +98 -0
  379. package/models/components/productpriceonetimefreecreate.js.map +1 -0
  380. package/models/components/productpricerecurringcustom.d.ts +5 -5
  381. package/models/components/productpricerecurringcustom.d.ts.map +1 -1
  382. package/models/components/productpricerecurringcustom.js +4 -4
  383. package/models/components/productpricerecurringcustom.js.map +1 -1
  384. package/models/components/productpricerecurringfixed.d.ts +5 -5
  385. package/models/components/productpricerecurringfixed.d.ts.map +1 -1
  386. package/models/components/productpricerecurringfixed.js +4 -4
  387. package/models/components/productpricerecurringfixed.js.map +1 -1
  388. package/models/components/productpricerecurringfixedcreate.d.ts +91 -0
  389. package/models/components/productpricerecurringfixedcreate.d.ts.map +1 -0
  390. package/models/components/productpricerecurringfixedcreate.js +111 -0
  391. package/models/components/productpricerecurringfixedcreate.js.map +1 -0
  392. package/models/components/productpricerecurringfree.d.ts +110 -0
  393. package/models/components/productpricerecurringfree.d.ts.map +1 -0
  394. package/models/components/productpricerecurringfree.js +119 -0
  395. package/models/components/productpricerecurringfree.js.map +1 -0
  396. package/models/components/productpricerecurringfreecreate.d.ts +81 -0
  397. package/models/components/productpricerecurringfreecreate.d.ts.map +1 -0
  398. package/models/components/productpricerecurringfreecreate.js +103 -0
  399. package/models/components/productpricerecurringfreecreate.js.map +1 -0
  400. package/models/components/productpricerecurringinput.d.ts +7 -2
  401. package/models/components/productpricerecurringinput.d.ts.map +1 -1
  402. package/models/components/productpricerecurringinput.js +7 -0
  403. package/models/components/productpricerecurringinput.js.map +1 -1
  404. package/models/components/productpricerecurringoutput.d.ts +7 -2
  405. package/models/components/productpricerecurringoutput.d.ts.map +1 -1
  406. package/models/components/productpricerecurringoutput.js +7 -0
  407. package/models/components/productpricerecurringoutput.js.map +1 -1
  408. package/models/components/productrecurringcreate.d.ts +17 -36
  409. package/models/components/productrecurringcreate.d.ts.map +1 -1
  410. package/models/components/productrecurringcreate.js +26 -26
  411. package/models/components/productrecurringcreate.js.map +1 -1
  412. package/models/components/productupdate.d.ts +7 -10
  413. package/models/components/productupdate.d.ts.map +1 -1
  414. package/models/components/productupdate.js +15 -9
  415. package/models/components/productupdate.js.map +1 -1
  416. package/models/components/subscriptioninput.d.ts +4 -4
  417. package/models/components/subscriptioninput.d.ts.map +1 -1
  418. package/models/components/subscriptioninput.js +4 -4
  419. package/models/components/subscriptioninput.js.map +1 -1
  420. package/models/components/subscriptionoutput.d.ts +4 -4
  421. package/models/components/subscriptionoutput.d.ts.map +1 -1
  422. package/models/components/subscriptionoutput.js +4 -4
  423. package/models/components/subscriptionoutput.js.map +1 -1
  424. package/models/components/subscriptionsortproperty.d.ts +0 -6
  425. package/models/components/subscriptionsortproperty.d.ts.map +1 -1
  426. package/models/components/subscriptionsortproperty.js +0 -2
  427. package/models/components/subscriptionsortproperty.js.map +1 -1
  428. package/models/components/userorderproduct.d.ts +0 -11
  429. package/models/components/userorderproduct.d.ts.map +1 -1
  430. package/models/components/userorderproduct.js +0 -7
  431. package/models/components/userorderproduct.js.map +1 -1
  432. package/models/components/userordersubscription.d.ts +2 -2
  433. package/models/components/userordersubscription.d.ts.map +1 -1
  434. package/models/components/userordersubscription.js +2 -2
  435. package/models/components/userordersubscription.js.map +1 -1
  436. package/models/components/usersubscription.d.ts +4 -4
  437. package/models/components/usersubscription.d.ts.map +1 -1
  438. package/models/components/usersubscription.js +4 -4
  439. package/models/components/usersubscription.js.map +1 -1
  440. package/models/components/usersubscriptionproduct.d.ts +0 -11
  441. package/models/components/usersubscriptionproduct.d.ts.map +1 -1
  442. package/models/components/usersubscriptionproduct.js +0 -7
  443. package/models/components/usersubscriptionproduct.js.map +1 -1
  444. package/models/errors/index.d.ts +0 -2
  445. package/models/errors/index.d.ts.map +1 -1
  446. package/models/errors/index.js +0 -2
  447. package/models/errors/index.js.map +1 -1
  448. package/models/operations/productscreate.d.ts +2 -2
  449. package/models/operations/productscreate.d.ts.map +1 -1
  450. package/models/operations/productscreate.js +2 -2
  451. package/models/operations/productscreate.js.map +1 -1
  452. package/models/operations/productslist.d.ts +0 -27
  453. package/models/operations/productslist.d.ts.map +1 -1
  454. package/models/operations/productslist.js +1 -32
  455. package/models/operations/productslist.js.map +1 -1
  456. package/models/operations/subscriptionslist.d.ts +0 -29
  457. package/models/operations/subscriptionslist.d.ts.map +1 -1
  458. package/models/operations/subscriptionslist.js +1 -32
  459. package/models/operations/subscriptionslist.js.map +1 -1
  460. package/package.json +1 -1
  461. package/sdk/oauth2.js +1 -1
  462. package/sdk/polarsubscriptions.d.ts +0 -9
  463. package/sdk/polarsubscriptions.d.ts.map +1 -1
  464. package/sdk/polarsubscriptions.js +0 -12
  465. package/sdk/polarsubscriptions.js.map +1 -1
  466. package/sdk/sdk.js +15 -15
  467. package/sdk/subscriptions.d.ts +0 -15
  468. package/sdk/subscriptions.d.ts.map +1 -1
  469. package/sdk/subscriptions.js +0 -20
  470. package/sdk/subscriptions.js.map +1 -1
  471. package/sdk/users.js +6 -6
  472. package/src/funcs/advertisementsGet.ts +40 -41
  473. package/src/funcs/advertisementsList.ts +48 -49
  474. package/src/funcs/articlesCreate.ts +37 -37
  475. package/src/funcs/articlesDelete.ts +41 -41
  476. package/src/funcs/articlesGet.ts +40 -40
  477. package/src/funcs/articlesList.ts +52 -52
  478. package/src/funcs/articlesPreview.ts +41 -44
  479. package/src/funcs/articlesReceivers.ts +39 -40
  480. package/src/funcs/articlesSend.ts +41 -41
  481. package/src/funcs/articlesUpdate.ts +41 -44
  482. package/src/funcs/benefitsCreate.ts +38 -38
  483. package/src/funcs/benefitsDelete.ts +41 -41
  484. package/src/funcs/benefitsGet.ts +40 -40
  485. package/src/funcs/benefitsGrants.ts +52 -55
  486. package/src/funcs/benefitsList.ts +48 -48
  487. package/src/funcs/benefitsUpdate.ts +41 -44
  488. package/src/funcs/checkoutsCreate.ts +37 -37
  489. package/src/funcs/checkoutsGet.ts +39 -39
  490. package/src/funcs/externalOrganizationsList.ts +51 -51
  491. package/src/funcs/filesCreate.ts +37 -37
  492. package/src/funcs/filesDelete.ts +41 -41
  493. package/src/funcs/filesList.ts +48 -48
  494. package/src/funcs/filesUpdate.ts +39 -42
  495. package/src/funcs/filesUploaded.ts +39 -42
  496. package/src/funcs/licenseKeysGet.ts +41 -41
  497. package/src/funcs/licenseKeysGetActivation.ts +44 -44
  498. package/src/funcs/licenseKeysList.ts +49 -49
  499. package/src/funcs/licenseKeysUpdate.ts +41 -47
  500. package/src/funcs/metricsGet.ts +45 -45
  501. package/src/funcs/metricsLimits.ts +22 -22
  502. package/src/funcs/oauth2ClientsCreate.ts +37 -38
  503. package/src/funcs/oauth2ClientsDelete.ts +40 -40
  504. package/src/funcs/oauth2ClientsGet.ts +40 -40
  505. package/src/funcs/oauth2ClientsList.ts +46 -47
  506. package/src/funcs/oauth2ClientsUpdate.ts +40 -43
  507. package/src/funcs/oauth2Introspect.ts +35 -35
  508. package/src/funcs/oauth2Revoke.ts +35 -35
  509. package/src/funcs/oauth2Token.ts +35 -35
  510. package/src/funcs/oauth2Userinfo.ts +22 -22
  511. package/src/funcs/ordersGet.ts +40 -40
  512. package/src/funcs/ordersInvoice.ts +40 -40
  513. package/src/funcs/ordersList.ts +51 -53
  514. package/src/funcs/organizationsCreate.ts +37 -37
  515. package/src/funcs/organizationsGet.ts +40 -40
  516. package/src/funcs/organizationsList.ts +49 -50
  517. package/src/funcs/organizationsUpdate.ts +42 -45
  518. package/src/funcs/productsCreate.ts +38 -38
  519. package/src/funcs/productsGet.ts +40 -40
  520. package/src/funcs/productsList.ts +50 -51
  521. package/src/funcs/productsUpdate.ts +41 -44
  522. package/src/funcs/productsUpdateBenefits.ts +42 -45
  523. package/src/funcs/repositoriesGet.ts +40 -40
  524. package/src/funcs/repositoriesList.ts +52 -52
  525. package/src/funcs/repositoriesUpdate.ts +41 -47
  526. package/src/funcs/subscriptionsExport.ts +41 -41
  527. package/src/funcs/subscriptionsList.ts +50 -52
  528. package/src/funcs/usersAdvertisementsCreate.ts +38 -38
  529. package/src/funcs/usersAdvertisementsDelete.ts +42 -42
  530. package/src/funcs/usersAdvertisementsEnable.ts +41 -44
  531. package/src/funcs/usersAdvertisementsGet.ts +41 -41
  532. package/src/funcs/usersAdvertisementsList.ts +48 -48
  533. package/src/funcs/usersAdvertisementsUpdate.ts +41 -44
  534. package/src/funcs/usersBenefitsGet.ts +40 -40
  535. package/src/funcs/usersBenefitsList.ts +51 -52
  536. package/src/funcs/usersDownloadablesGet.ts +41 -41
  537. package/src/funcs/usersDownloadablesList.ts +49 -49
  538. package/src/funcs/usersLicenseKeysActivate.ts +39 -39
  539. package/src/funcs/usersLicenseKeysDeactivate.ts +38 -38
  540. package/src/funcs/usersLicenseKeysGet.ts +42 -42
  541. package/src/funcs/usersLicenseKeysList.ts +51 -51
  542. package/src/funcs/usersLicenseKeysValidate.ts +38 -38
  543. package/src/funcs/usersOrdersGet.ts +40 -40
  544. package/src/funcs/usersOrdersInvoice.ts +40 -41
  545. package/src/funcs/usersOrdersList.ts +52 -52
  546. package/src/funcs/usersSubscriptionsCancel.ts +42 -42
  547. package/src/funcs/usersSubscriptionsGet.ts +41 -41
  548. package/src/funcs/usersSubscriptionsList.ts +52 -52
  549. package/src/funcs/usersSubscriptionsUpdate.ts +42 -48
  550. package/src/lib/config.ts +3 -3
  551. package/src/lib/sdks.ts +26 -26
  552. package/src/models/components/index.ts +5 -6
  553. package/src/models/components/orderproduct.ts +0 -21
  554. package/src/models/components/ordersubscription.ts +4 -4
  555. package/src/models/components/productinput.ts +0 -21
  556. package/src/models/components/productonetimecreate.ts +16 -1
  557. package/src/models/components/productoutput.ts +0 -21
  558. package/src/models/components/productpriceonetime.ts +10 -0
  559. package/src/models/components/productpriceonetimecustom.ts +9 -9
  560. package/src/models/components/productpriceonetimecustomcreate.ts +36 -0
  561. package/src/models/components/productpriceonetimefixed.ts +9 -9
  562. package/src/models/components/productpriceonetimefixedcreate.ts +45 -9
  563. package/src/models/components/productpriceonetimefree.ts +164 -0
  564. package/src/models/components/productpriceonetimefreecreate.ts +121 -0
  565. package/src/models/components/productpricerecurringcustom.ts +9 -9
  566. package/src/models/components/productpricerecurringfixed.ts +9 -9
  567. package/src/models/components/productpricerecurringfixedcreate.ts +155 -0
  568. package/src/models/components/productpricerecurringfree.ts +179 -0
  569. package/src/models/components/productpricerecurringfreecreate.ts +136 -0
  570. package/src/models/components/productpricerecurringinput.ts +18 -0
  571. package/src/models/components/productpricerecurringoutput.ts +18 -0
  572. package/src/models/components/productrecurringcreate.ts +57 -48
  573. package/src/models/components/productupdate.ts +41 -22
  574. package/src/models/components/subscriptioninput.ts +8 -8
  575. package/src/models/components/subscriptionoutput.ts +8 -8
  576. package/src/models/components/subscriptionsortproperty.ts +0 -2
  577. package/src/models/components/userorderproduct.ts +0 -21
  578. package/src/models/components/userordersubscription.ts +4 -4
  579. package/src/models/components/usersubscription.ts +8 -8
  580. package/src/models/components/usersubscriptionproduct.ts +0 -21
  581. package/src/models/errors/index.ts +0 -2
  582. package/src/models/operations/productscreate.ts +6 -6
  583. package/src/models/operations/productslist.ts +0 -70
  584. package/src/models/operations/subscriptionslist.ts +0 -68
  585. package/src/sdk/oauth2.ts +1 -1
  586. package/src/sdk/polarsubscriptions.ts +0 -20
  587. package/src/sdk/sdk.ts +15 -15
  588. package/src/sdk/subscriptions.ts +0 -37
  589. package/src/sdk/users.ts +6 -6
  590. package/funcs/subscriptionsCreate.d.ts +0 -16
  591. package/funcs/subscriptionsCreate.d.ts.map +0 -1
  592. package/funcs/subscriptionsCreate.js +0 -96
  593. package/funcs/subscriptionsCreate.js.map +0 -1
  594. package/funcs/subscriptionsImportSubscriptions.d.ts +0 -16
  595. package/funcs/subscriptionsImportSubscriptions.d.ts.map +0 -1
  596. package/funcs/subscriptionsImportSubscriptions.js +0 -109
  597. package/funcs/subscriptionsImportSubscriptions.js.map +0 -1
  598. package/funcs/usersSubscriptionsCreate.d.ts +0 -18
  599. package/funcs/usersSubscriptionsCreate.d.ts.map +0 -1
  600. package/funcs/usersSubscriptionsCreate.js +0 -98
  601. package/funcs/usersSubscriptionsCreate.js.map +0 -1
  602. package/models/components/bodysubscriptionsimport.d.ts +0 -58
  603. package/models/components/bodysubscriptionsimport.d.ts.map +0 -1
  604. package/models/components/bodysubscriptionsimport.js +0 -94
  605. package/models/components/bodysubscriptionsimport.js.map +0 -1
  606. package/models/components/productpricerecurringcreate.d.ts +0 -67
  607. package/models/components/productpricerecurringcreate.d.ts.map +0 -1
  608. package/models/components/productpricerecurringcreate.js +0 -88
  609. package/models/components/productpricerecurringcreate.js.map +0 -1
  610. package/models/components/subscriptioncreateemail.d.ts +0 -36
  611. package/models/components/subscriptioncreateemail.d.ts.map +0 -1
  612. package/models/components/subscriptioncreateemail.js +0 -61
  613. package/models/components/subscriptioncreateemail.js.map +0 -1
  614. package/models/components/subscriptionsimported.d.ts +0 -28
  615. package/models/components/subscriptionsimported.d.ts.map +0 -1
  616. package/models/components/subscriptionsimported.js +0 -50
  617. package/models/components/subscriptionsimported.js.map +0 -1
  618. package/models/components/subscriptiontiertype.d.ts +0 -31
  619. package/models/components/subscriptiontiertype.d.ts.map +0 -1
  620. package/models/components/subscriptiontiertype.js +0 -51
  621. package/models/components/subscriptiontiertype.js.map +0 -1
  622. package/models/components/userfreesubscriptioncreate.d.ts +0 -33
  623. package/models/components/userfreesubscriptioncreate.d.ts.map +0 -1
  624. package/models/components/userfreesubscriptioncreate.js +0 -63
  625. package/models/components/userfreesubscriptioncreate.js.map +0 -1
  626. package/models/errors/alreadysubscribed.d.ts +0 -57
  627. package/models/errors/alreadysubscribed.d.ts.map +0 -1
  628. package/models/errors/alreadysubscribed.js +0 -88
  629. package/models/errors/alreadysubscribed.js.map +0 -1
  630. package/models/errors/freesubscriptionupgrade.d.ts +0 -57
  631. package/models/errors/freesubscriptionupgrade.d.ts.map +0 -1
  632. package/models/errors/freesubscriptionupgrade.js +0 -88
  633. package/models/errors/freesubscriptionupgrade.js.map +0 -1
  634. package/src/funcs/subscriptionsCreate.ts +0 -126
  635. package/src/funcs/subscriptionsImportSubscriptions.ts +0 -142
  636. package/src/funcs/usersSubscriptionsCreate.ts +0 -135
  637. package/src/models/components/bodysubscriptionsimport.ts +0 -116
  638. package/src/models/components/productpricerecurringcreate.ts +0 -116
  639. package/src/models/components/subscriptioncreateemail.ts +0 -67
  640. package/src/models/components/subscriptionsimported.ts +0 -48
  641. package/src/models/components/subscriptiontiertype.ts +0 -34
  642. package/src/models/components/userfreesubscriptioncreate.ts +0 -66
  643. package/src/models/errors/alreadysubscribed.ts +0 -102
  644. package/src/models/errors/freesubscriptionupgrade.ts +0 -106
@@ -1,142 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { PolarCore } from "../core.js";
6
- import { readableStreamToArrayBuffer } from "../lib/files.js";
7
- import * as m$ from "../lib/matchers.js";
8
- import * as schemas$ 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 { isBlobLike } from "../types/blobs.js";
24
- import { Result } from "../types/fp.js";
25
- import { isReadableStream } from "../types/streams.js";
26
-
27
- /**
28
- * Import Subscriptions
29
- *
30
- * @remarks
31
- * Import subscriptions from a CSV file.
32
- */
33
- export async function subscriptionsImportSubscriptions(
34
- client$: PolarCore,
35
- request: components.BodySubscriptionsImport,
36
- options?: RequestOptions,
37
- ): Promise<
38
- Result<
39
- components.SubscriptionsImported,
40
- | errors.HTTPValidationError
41
- | SDKError
42
- | SDKValidationError
43
- | UnexpectedClientError
44
- | InvalidRequestError
45
- | RequestAbortedError
46
- | RequestTimeoutError
47
- | ConnectionError
48
- >
49
- > {
50
- const input$ = request;
51
-
52
- const parsed$ = schemas$.safeParse(
53
- input$,
54
- (value$) => components.BodySubscriptionsImport$outboundSchema.parse(value$),
55
- "Input validation failed",
56
- );
57
- if (!parsed$.ok) {
58
- return parsed$;
59
- }
60
- const payload$ = parsed$.value;
61
- const body$ = new FormData();
62
-
63
- if (isBlobLike(payload$.file)) {
64
- body$.append("file", payload$.file);
65
- } else if (isReadableStream(payload$.file.content)) {
66
- const buffer = await readableStreamToArrayBuffer(payload$.file.content);
67
- const blob = new Blob([buffer], { type: "application/octet-stream" });
68
- body$.append("file", blob);
69
- } else {
70
- body$.append(
71
- "file",
72
- new Blob([payload$.file.content], { type: "application/octet-stream" }),
73
- payload$.file.fileName,
74
- );
75
- }
76
- body$.append("organization_id", payload$.organization_id);
77
-
78
- const path$ = pathToFunc("/v1/subscriptions/import")();
79
-
80
- const headers$ = new Headers({
81
- Accept: "application/json",
82
- });
83
-
84
- const accessToken$ = await extractSecurity(client$.options$.accessToken);
85
- const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ };
86
- const context = {
87
- operationID: "subscriptions:import",
88
- oAuth2Scopes: [],
89
- securitySource: client$.options$.accessToken,
90
- };
91
- const securitySettings$ = resolveGlobalSecurity(security$);
92
-
93
- const requestRes = client$.createRequest$(context, {
94
- security: securitySettings$,
95
- method: "POST",
96
- path: path$,
97
- headers: headers$,
98
- body: body$,
99
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
100
- }, options);
101
- if (!requestRes.ok) {
102
- return requestRes;
103
- }
104
- const request$ = requestRes.value;
105
-
106
- const doResult = await client$.do$(request$, {
107
- context,
108
- errorCodes: ["422", "4XX", "5XX"],
109
- retryConfig: options?.retries
110
- || client$.options$.retryConfig,
111
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
112
- });
113
- if (!doResult.ok) {
114
- return doResult;
115
- }
116
- const response = doResult.value;
117
-
118
- const responseFields$ = {
119
- HttpMeta: { Response: response, Request: request$ },
120
- };
121
-
122
- const [result$] = await m$.match<
123
- components.SubscriptionsImported,
124
- | errors.HTTPValidationError
125
- | SDKError
126
- | SDKValidationError
127
- | UnexpectedClientError
128
- | InvalidRequestError
129
- | RequestAbortedError
130
- | RequestTimeoutError
131
- | ConnectionError
132
- >(
133
- m$.json(200, components.SubscriptionsImported$inboundSchema),
134
- m$.jsonErr(422, errors.HTTPValidationError$inboundSchema),
135
- m$.fail(["4XX", "5XX"]),
136
- )(response, { extraFields: responseFields$ });
137
- if (!result$.ok) {
138
- return result$;
139
- }
140
-
141
- return result$;
142
- }
@@ -1,135 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { PolarCore } from "../core.js";
6
- import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
7
- import * as m$ from "../lib/matchers.js";
8
- import * as schemas$ 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 { Result } from "../types/fp.js";
24
-
25
- /**
26
- * Create Free Subscription
27
- *
28
- * @remarks
29
- * Create a subscription on a **free** tier.
30
- *
31
- * If you want to subscribe to a paid tier, you need to create a checkout session.
32
- */
33
- export async function usersSubscriptionsCreate(
34
- client$: PolarCore,
35
- request: components.UserFreeSubscriptionCreate,
36
- options?: RequestOptions,
37
- ): Promise<
38
- Result<
39
- components.UserSubscription,
40
- | errors.AlreadySubscribed
41
- | errors.ResourceNotFound
42
- | errors.HTTPValidationError
43
- | SDKError
44
- | SDKValidationError
45
- | UnexpectedClientError
46
- | InvalidRequestError
47
- | RequestAbortedError
48
- | RequestTimeoutError
49
- | ConnectionError
50
- >
51
- > {
52
- const input$ = request;
53
-
54
- const parsed$ = schemas$.safeParse(
55
- input$,
56
- (value$) =>
57
- components.UserFreeSubscriptionCreate$outboundSchema.parse(value$),
58
- "Input validation failed",
59
- );
60
- if (!parsed$.ok) {
61
- return parsed$;
62
- }
63
- const payload$ = parsed$.value;
64
- const body$ = encodeJSON$("body", payload$, { explode: true });
65
-
66
- const path$ = pathToFunc("/v1/users/subscriptions/")();
67
-
68
- const headers$ = new Headers({
69
- "Content-Type": "application/json",
70
- Accept: "application/json",
71
- });
72
-
73
- const accessToken$ = await extractSecurity(client$.options$.accessToken);
74
- const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ };
75
- const context = {
76
- operationID: "users:subscriptions:create",
77
- oAuth2Scopes: [],
78
- securitySource: client$.options$.accessToken,
79
- };
80
- const securitySettings$ = resolveGlobalSecurity(security$);
81
-
82
- const requestRes = client$.createRequest$(context, {
83
- security: securitySettings$,
84
- method: "POST",
85
- path: path$,
86
- headers: headers$,
87
- body: body$,
88
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
89
- }, options);
90
- if (!requestRes.ok) {
91
- return requestRes;
92
- }
93
- const request$ = requestRes.value;
94
-
95
- const doResult = await client$.do$(request$, {
96
- context,
97
- errorCodes: ["400", "404", "422", "4XX", "5XX"],
98
- retryConfig: options?.retries
99
- || client$.options$.retryConfig,
100
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
101
- });
102
- if (!doResult.ok) {
103
- return doResult;
104
- }
105
- const response = doResult.value;
106
-
107
- const responseFields$ = {
108
- HttpMeta: { Response: response, Request: request$ },
109
- };
110
-
111
- const [result$] = await m$.match<
112
- components.UserSubscription,
113
- | errors.AlreadySubscribed
114
- | errors.ResourceNotFound
115
- | errors.HTTPValidationError
116
- | SDKError
117
- | SDKValidationError
118
- | UnexpectedClientError
119
- | InvalidRequestError
120
- | RequestAbortedError
121
- | RequestTimeoutError
122
- | ConnectionError
123
- >(
124
- m$.json(201, components.UserSubscription$inboundSchema),
125
- m$.jsonErr(400, errors.AlreadySubscribed$inboundSchema),
126
- m$.jsonErr(404, errors.ResourceNotFound$inboundSchema),
127
- m$.jsonErr(422, errors.HTTPValidationError$inboundSchema),
128
- m$.fail(["4XX", "5XX"]),
129
- )(response, { extraFields: responseFields$ });
130
- if (!result$.ok) {
131
- return result$;
132
- }
133
-
134
- return result$;
135
- }
@@ -1,116 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { blobLikeSchema } from "../../types/blobs.js";
8
-
9
- export type FileT = {
10
- fileName: string;
11
- content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
12
- };
13
-
14
- export type BodySubscriptionsImport = {
15
- /**
16
- * CSV file with emails.
17
- */
18
- file: FileT | Blob;
19
- /**
20
- * The organization ID on which to import the subscriptions.
21
- */
22
- organizationId: string;
23
- };
24
-
25
- /** @internal */
26
- export const FileT$inboundSchema: z.ZodType<FileT, z.ZodTypeDef, unknown> = z
27
- .object({
28
- fileName: z.string(),
29
- content: z.union([
30
- z.instanceof(ReadableStream<Uint8Array>),
31
- z.instanceof(Blob),
32
- z.instanceof(ArrayBuffer),
33
- z.instanceof(Uint8Array),
34
- ]),
35
- });
36
-
37
- /** @internal */
38
- export type FileT$Outbound = {
39
- fileName: string;
40
- content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
41
- };
42
-
43
- /** @internal */
44
- export const FileT$outboundSchema: z.ZodType<
45
- FileT$Outbound,
46
- z.ZodTypeDef,
47
- FileT
48
- > = z.object({
49
- fileName: z.string(),
50
- content: z.union([
51
- z.instanceof(ReadableStream<Uint8Array>),
52
- z.instanceof(Blob),
53
- z.instanceof(ArrayBuffer),
54
- z.instanceof(Uint8Array),
55
- ]),
56
- });
57
-
58
- /**
59
- * @internal
60
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
61
- */
62
- export namespace FileT$ {
63
- /** @deprecated use `FileT$inboundSchema` instead. */
64
- export const inboundSchema = FileT$inboundSchema;
65
- /** @deprecated use `FileT$outboundSchema` instead. */
66
- export const outboundSchema = FileT$outboundSchema;
67
- /** @deprecated use `FileT$Outbound` instead. */
68
- export type Outbound = FileT$Outbound;
69
- }
70
-
71
- /** @internal */
72
- export const BodySubscriptionsImport$inboundSchema: z.ZodType<
73
- BodySubscriptionsImport,
74
- z.ZodTypeDef,
75
- unknown
76
- > = z.object({
77
- file: z.lazy(() => FileT$inboundSchema),
78
- organization_id: z.string(),
79
- }).transform((v) => {
80
- return remap$(v, {
81
- "organization_id": "organizationId",
82
- });
83
- });
84
-
85
- /** @internal */
86
- export type BodySubscriptionsImport$Outbound = {
87
- file: FileT$Outbound | Blob;
88
- organization_id: string;
89
- };
90
-
91
- /** @internal */
92
- export const BodySubscriptionsImport$outboundSchema: z.ZodType<
93
- BodySubscriptionsImport$Outbound,
94
- z.ZodTypeDef,
95
- BodySubscriptionsImport
96
- > = z.object({
97
- file: z.lazy(() => FileT$outboundSchema).or(blobLikeSchema),
98
- organizationId: z.string(),
99
- }).transform((v) => {
100
- return remap$(v, {
101
- organizationId: "organization_id",
102
- });
103
- });
104
-
105
- /**
106
- * @internal
107
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
108
- */
109
- export namespace BodySubscriptionsImport$ {
110
- /** @deprecated use `BodySubscriptionsImport$inboundSchema` instead. */
111
- export const inboundSchema = BodySubscriptionsImport$inboundSchema;
112
- /** @deprecated use `BodySubscriptionsImport$outboundSchema` instead. */
113
- export const outboundSchema = BodySubscriptionsImport$outboundSchema;
114
- /** @deprecated use `BodySubscriptionsImport$Outbound` instead. */
115
- export type Outbound = BodySubscriptionsImport$Outbound;
116
- }
@@ -1,116 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { ClosedEnum } from "../../types/enums.js";
8
- import {
9
- SubscriptionRecurringInterval,
10
- SubscriptionRecurringInterval$inboundSchema,
11
- SubscriptionRecurringInterval$outboundSchema,
12
- } from "./subscriptionrecurringinterval.js";
13
-
14
- export const ProductPriceRecurringCreateType = {
15
- Recurring: "recurring",
16
- } as const;
17
- export type ProductPriceRecurringCreateType = ClosedEnum<
18
- typeof ProductPriceRecurringCreateType
19
- >;
20
-
21
- /**
22
- * Schema to create a recurring product price, i.e. a subscription.
23
- */
24
- export type ProductPriceRecurringCreate = {
25
- type?: "recurring" | undefined;
26
- /**
27
- * The currency. Currently, only `usd` is supported.
28
- */
29
- priceCurrency?: string | undefined;
30
- /**
31
- * The price in cents.
32
- */
33
- priceAmount: number;
34
- /**
35
- * The recurring interval of the price.
36
- */
37
- recurringInterval: SubscriptionRecurringInterval;
38
- };
39
-
40
- /** @internal */
41
- export const ProductPriceRecurringCreateType$inboundSchema: z.ZodNativeEnum<
42
- typeof ProductPriceRecurringCreateType
43
- > = z.nativeEnum(ProductPriceRecurringCreateType);
44
-
45
- /** @internal */
46
- export const ProductPriceRecurringCreateType$outboundSchema: z.ZodNativeEnum<
47
- typeof ProductPriceRecurringCreateType
48
- > = ProductPriceRecurringCreateType$inboundSchema;
49
-
50
- /**
51
- * @internal
52
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
- */
54
- export namespace ProductPriceRecurringCreateType$ {
55
- /** @deprecated use `ProductPriceRecurringCreateType$inboundSchema` instead. */
56
- export const inboundSchema = ProductPriceRecurringCreateType$inboundSchema;
57
- /** @deprecated use `ProductPriceRecurringCreateType$outboundSchema` instead. */
58
- export const outboundSchema = ProductPriceRecurringCreateType$outboundSchema;
59
- }
60
-
61
- /** @internal */
62
- export const ProductPriceRecurringCreate$inboundSchema: z.ZodType<
63
- ProductPriceRecurringCreate,
64
- z.ZodTypeDef,
65
- unknown
66
- > = z.object({
67
- type: z.literal("recurring").optional(),
68
- price_currency: z.string().default("usd"),
69
- price_amount: z.number().int(),
70
- recurring_interval: SubscriptionRecurringInterval$inboundSchema,
71
- }).transform((v) => {
72
- return remap$(v, {
73
- "price_currency": "priceCurrency",
74
- "price_amount": "priceAmount",
75
- "recurring_interval": "recurringInterval",
76
- });
77
- });
78
-
79
- /** @internal */
80
- export type ProductPriceRecurringCreate$Outbound = {
81
- type: "recurring";
82
- price_currency: string;
83
- price_amount: number;
84
- recurring_interval: string;
85
- };
86
-
87
- /** @internal */
88
- export const ProductPriceRecurringCreate$outboundSchema: z.ZodType<
89
- ProductPriceRecurringCreate$Outbound,
90
- z.ZodTypeDef,
91
- ProductPriceRecurringCreate
92
- > = z.object({
93
- type: z.literal("recurring").default("recurring"),
94
- priceCurrency: z.string().default("usd"),
95
- priceAmount: z.number().int(),
96
- recurringInterval: SubscriptionRecurringInterval$outboundSchema,
97
- }).transform((v) => {
98
- return remap$(v, {
99
- priceCurrency: "price_currency",
100
- priceAmount: "price_amount",
101
- recurringInterval: "recurring_interval",
102
- });
103
- });
104
-
105
- /**
106
- * @internal
107
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
108
- */
109
- export namespace ProductPriceRecurringCreate$ {
110
- /** @deprecated use `ProductPriceRecurringCreate$inboundSchema` instead. */
111
- export const inboundSchema = ProductPriceRecurringCreate$inboundSchema;
112
- /** @deprecated use `ProductPriceRecurringCreate$outboundSchema` instead. */
113
- export const outboundSchema = ProductPriceRecurringCreate$outboundSchema;
114
- /** @deprecated use `ProductPriceRecurringCreate$Outbound` instead. */
115
- export type Outbound = ProductPriceRecurringCreate$Outbound;
116
- }
@@ -1,67 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
-
8
- /**
9
- * Request schema for creating a subscription by email.
10
- */
11
- export type SubscriptionCreateEmail = {
12
- /**
13
- * The email address of the user.
14
- */
15
- email: string;
16
- /**
17
- * The ID of the product. **Must be the free subscription tier**.
18
- */
19
- productId: string;
20
- };
21
-
22
- /** @internal */
23
- export const SubscriptionCreateEmail$inboundSchema: z.ZodType<
24
- SubscriptionCreateEmail,
25
- z.ZodTypeDef,
26
- unknown
27
- > = z.object({
28
- email: z.string(),
29
- product_id: z.string(),
30
- }).transform((v) => {
31
- return remap$(v, {
32
- "product_id": "productId",
33
- });
34
- });
35
-
36
- /** @internal */
37
- export type SubscriptionCreateEmail$Outbound = {
38
- email: string;
39
- product_id: string;
40
- };
41
-
42
- /** @internal */
43
- export const SubscriptionCreateEmail$outboundSchema: z.ZodType<
44
- SubscriptionCreateEmail$Outbound,
45
- z.ZodTypeDef,
46
- SubscriptionCreateEmail
47
- > = z.object({
48
- email: z.string(),
49
- productId: z.string(),
50
- }).transform((v) => {
51
- return remap$(v, {
52
- productId: "product_id",
53
- });
54
- });
55
-
56
- /**
57
- * @internal
58
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
59
- */
60
- export namespace SubscriptionCreateEmail$ {
61
- /** @deprecated use `SubscriptionCreateEmail$inboundSchema` instead. */
62
- export const inboundSchema = SubscriptionCreateEmail$inboundSchema;
63
- /** @deprecated use `SubscriptionCreateEmail$outboundSchema` instead. */
64
- export const outboundSchema = SubscriptionCreateEmail$outboundSchema;
65
- /** @deprecated use `SubscriptionCreateEmail$Outbound` instead. */
66
- export type Outbound = SubscriptionCreateEmail$Outbound;
67
- }
@@ -1,48 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
-
7
- /**
8
- * Result of a subscription import operation.
9
- */
10
- export type SubscriptionsImported = {
11
- count: number;
12
- };
13
-
14
- /** @internal */
15
- export const SubscriptionsImported$inboundSchema: z.ZodType<
16
- SubscriptionsImported,
17
- z.ZodTypeDef,
18
- unknown
19
- > = z.object({
20
- count: z.number().int(),
21
- });
22
-
23
- /** @internal */
24
- export type SubscriptionsImported$Outbound = {
25
- count: number;
26
- };
27
-
28
- /** @internal */
29
- export const SubscriptionsImported$outboundSchema: z.ZodType<
30
- SubscriptionsImported$Outbound,
31
- z.ZodTypeDef,
32
- SubscriptionsImported
33
- > = z.object({
34
- count: z.number().int(),
35
- });
36
-
37
- /**
38
- * @internal
39
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
- */
41
- export namespace SubscriptionsImported$ {
42
- /** @deprecated use `SubscriptionsImported$inboundSchema` instead. */
43
- export const inboundSchema = SubscriptionsImported$inboundSchema;
44
- /** @deprecated use `SubscriptionsImported$outboundSchema` instead. */
45
- export const outboundSchema = SubscriptionsImported$outboundSchema;
46
- /** @deprecated use `SubscriptionsImported$Outbound` instead. */
47
- export type Outbound = SubscriptionsImported$Outbound;
48
- }
@@ -1,34 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- export const SubscriptionTierType = {
9
- Free: "free",
10
- Individual: "individual",
11
- Business: "business",
12
- } as const;
13
- export type SubscriptionTierType = ClosedEnum<typeof SubscriptionTierType>;
14
-
15
- /** @internal */
16
- export const SubscriptionTierType$inboundSchema: z.ZodNativeEnum<
17
- typeof SubscriptionTierType
18
- > = z.nativeEnum(SubscriptionTierType);
19
-
20
- /** @internal */
21
- export const SubscriptionTierType$outboundSchema: z.ZodNativeEnum<
22
- typeof SubscriptionTierType
23
- > = SubscriptionTierType$inboundSchema;
24
-
25
- /**
26
- * @internal
27
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
28
- */
29
- export namespace SubscriptionTierType$ {
30
- /** @deprecated use `SubscriptionTierType$inboundSchema` instead. */
31
- export const inboundSchema = SubscriptionTierType$inboundSchema;
32
- /** @deprecated use `SubscriptionTierType$outboundSchema` instead. */
33
- export const outboundSchema = SubscriptionTierType$outboundSchema;
34
- }