@polar-sh/sdk 0.17.3 → 0.18.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 (316) hide show
  1. package/FUNCTIONS.md +106 -0
  2. package/README.md +181 -30
  3. package/RUNTIMES.md +22 -0
  4. package/docs/sdks/checkouts/README.md +1 -1
  5. package/docs/sdks/files/README.md +5 -1
  6. package/funcs/filesCreate.js +1 -1
  7. package/funcs/filesDelete.d.ts +1 -1
  8. package/funcs/filesDelete.d.ts.map +1 -1
  9. package/funcs/filesDelete.js +1 -1
  10. package/funcs/filesDelete.js.map +1 -1
  11. package/funcs/filesUpdate.d.ts +1 -1
  12. package/funcs/filesUpdate.d.ts.map +1 -1
  13. package/funcs/filesUpdate.js +2 -2
  14. package/funcs/filesUpdate.js.map +1 -1
  15. package/funcs/filesUploaded.d.ts +1 -1
  16. package/funcs/filesUploaded.d.ts.map +1 -1
  17. package/funcs/filesUploaded.js +2 -2
  18. package/funcs/filesUploaded.js.map +1 -1
  19. package/hooks/hooks.d.ts.map +1 -1
  20. package/hooks/hooks.js +18 -0
  21. package/hooks/hooks.js.map +1 -1
  22. package/hooks/types.d.ts +3 -0
  23. package/hooks/types.d.ts.map +1 -1
  24. package/lib/config.d.ts +3 -3
  25. package/lib/config.js +3 -3
  26. package/lib/config.js.map +1 -1
  27. package/models/components/benefit.d.ts +2 -3
  28. package/models/components/benefit.d.ts.map +1 -1
  29. package/models/components/benefit.js +0 -3
  30. package/models/components/benefit.js.map +1 -1
  31. package/models/components/benefitadssubscriber.d.ts +7 -7
  32. package/models/components/benefitadssubscriber.d.ts.map +1 -1
  33. package/models/components/benefitadssubscriber.js +11 -11
  34. package/models/components/benefitadssubscriber.js.map +1 -1
  35. package/models/components/benefitgrant.d.ts +4 -5
  36. package/models/components/benefitgrant.d.ts.map +1 -1
  37. package/models/components/benefitgrant.js +0 -5
  38. package/models/components/benefitgrant.js.map +1 -1
  39. package/models/components/benefitgrantwebhook.d.ts +8 -9
  40. package/models/components/benefitgrantwebhook.d.ts.map +1 -1
  41. package/models/components/benefitgrantwebhook.js +0 -9
  42. package/models/components/benefitgrantwebhook.js.map +1 -1
  43. package/models/components/benefittype.d.ts +0 -3
  44. package/models/components/benefittype.d.ts.map +1 -1
  45. package/models/components/benefittype.js +0 -1
  46. package/models/components/benefittype.js.map +1 -1
  47. package/models/components/checkoutlinkproduct.d.ts +2 -24
  48. package/models/components/checkoutlinkproduct.d.ts.map +1 -1
  49. package/models/components/checkoutlinkproduct.js +3 -27
  50. package/models/components/checkoutlinkproduct.js.map +1 -1
  51. package/models/components/checkoutproduct.d.ts +2 -24
  52. package/models/components/checkoutproduct.d.ts.map +1 -1
  53. package/models/components/checkoutproduct.js +3 -27
  54. package/models/components/checkoutproduct.js.map +1 -1
  55. package/models/components/index.d.ts +0 -15
  56. package/models/components/index.d.ts.map +1 -1
  57. package/models/components/index.js +0 -15
  58. package/models/components/index.js.map +1 -1
  59. package/models/components/listresourceuserbenefit.d.ts +0 -9
  60. package/models/components/listresourceuserbenefit.d.ts.map +1 -1
  61. package/models/components/listresourceuserbenefit.js +0 -13
  62. package/models/components/listresourceuserbenefit.js.map +1 -1
  63. package/models/components/oauth2client.js +2 -2
  64. package/models/components/oauth2client.js.map +1 -1
  65. package/models/components/oauth2clientconfiguration.js +2 -2
  66. package/models/components/oauth2clientconfiguration.js.map +1 -1
  67. package/models/components/oauth2clientconfigurationupdate.js +2 -2
  68. package/models/components/oauth2clientconfigurationupdate.js.map +1 -1
  69. package/models/components/organizationfeaturesettings.d.ts +0 -5
  70. package/models/components/organizationfeaturesettings.d.ts.map +1 -1
  71. package/models/components/organizationfeaturesettings.js +0 -4
  72. package/models/components/organizationfeaturesettings.js.map +1 -1
  73. package/models/components/scope.d.ts +0 -6
  74. package/models/components/scope.d.ts.map +1 -1
  75. package/models/components/scope.js +0 -2
  76. package/models/components/scope.js.map +1 -1
  77. package/models/components/userorderproduct.d.ts +2 -24
  78. package/models/components/userorderproduct.d.ts.map +1 -1
  79. package/models/components/userorderproduct.js +3 -27
  80. package/models/components/userorderproduct.js.map +1 -1
  81. package/models/components/usersubscriptionproduct.d.ts +2 -24
  82. package/models/components/usersubscriptionproduct.d.ts.map +1 -1
  83. package/models/components/usersubscriptionproduct.js +3 -27
  84. package/models/components/usersubscriptionproduct.js.map +1 -1
  85. package/models/errors/index.d.ts +0 -1
  86. package/models/errors/index.d.ts.map +1 -1
  87. package/models/errors/index.js +0 -1
  88. package/models/errors/index.js.map +1 -1
  89. package/models/operations/benefitsupdate.d.ts +4 -4
  90. package/models/operations/benefitsupdate.d.ts.map +1 -1
  91. package/models/operations/benefitsupdate.js +0 -4
  92. package/models/operations/benefitsupdate.js.map +1 -1
  93. package/models/operations/filesupdate.d.ts +1 -1
  94. package/models/operations/filesuploaded.d.ts +1 -1
  95. package/models/operations/index.d.ts +0 -8
  96. package/models/operations/index.d.ts.map +1 -1
  97. package/models/operations/index.js +0 -8
  98. package/models/operations/index.js.map +1 -1
  99. package/models/operations/usersbenefitsget.d.ts +2 -6
  100. package/models/operations/usersbenefitsget.d.ts.map +1 -1
  101. package/models/operations/usersbenefitsget.js +0 -6
  102. package/models/operations/usersbenefitsget.js.map +1 -1
  103. package/package.json +1 -3
  104. package/sdk/sdk.d.ts +0 -3
  105. package/sdk/sdk.d.ts.map +1 -1
  106. package/sdk/sdk.js +0 -5
  107. package/sdk/sdk.js.map +1 -1
  108. package/src/funcs/filesCreate.ts +1 -1
  109. package/src/funcs/filesDelete.ts +3 -3
  110. package/src/funcs/filesUpdate.ts +7 -1
  111. package/src/funcs/filesUploaded.ts +7 -1
  112. package/src/hooks/hooks.ts +20 -0
  113. package/src/hooks/types.ts +9 -0
  114. package/src/lib/config.ts +3 -3
  115. package/src/models/components/benefit.ts +0 -10
  116. package/src/models/components/benefitadssubscriber.ts +12 -15
  117. package/src/models/components/benefitgrant.ts +0 -14
  118. package/src/models/components/benefitgrantwebhook.ts +0 -22
  119. package/src/models/components/benefittype.ts +0 -1
  120. package/src/models/components/checkoutlinkproduct.ts +4 -68
  121. package/src/models/components/checkoutproduct.ts +4 -66
  122. package/src/models/components/index.ts +0 -15
  123. package/src/models/components/listresourceuserbenefit.ts +0 -30
  124. package/src/models/components/oauth2client.ts +2 -2
  125. package/src/models/components/oauth2clientconfiguration.ts +2 -2
  126. package/src/models/components/oauth2clientconfigurationupdate.ts +2 -2
  127. package/src/models/components/organizationfeaturesettings.ts +0 -9
  128. package/src/models/components/scope.ts +0 -2
  129. package/src/models/components/userorderproduct.ts +4 -60
  130. package/src/models/components/usersubscriptionproduct.ts +4 -68
  131. package/src/models/errors/index.ts +0 -1
  132. package/src/models/operations/benefitsupdate.ts +0 -8
  133. package/src/models/operations/filesupdate.ts +1 -1
  134. package/src/models/operations/filesuploaded.ts +1 -1
  135. package/src/models/operations/index.ts +0 -8
  136. package/src/models/operations/usersbenefitsget.ts +0 -12
  137. package/src/sdk/sdk.ts +0 -6
  138. package/src/types/index.ts +1 -0
  139. package/src/types/webhooks.ts +7 -0
  140. package/types/index.d.ts +1 -0
  141. package/types/index.d.ts.map +1 -1
  142. package/types/webhooks.d.ts +4 -0
  143. package/types/webhooks.d.ts.map +1 -0
  144. package/types/webhooks.js +6 -0
  145. package/types/webhooks.js.map +1 -0
  146. package/docs/sdks/articles/README.md +0 -724
  147. package/funcs/articlesCreate.d.ts +0 -16
  148. package/funcs/articlesCreate.d.ts.map +0 -1
  149. package/funcs/articlesCreate.js +0 -99
  150. package/funcs/articlesCreate.js.map +0 -1
  151. package/funcs/articlesDelete.d.ts +0 -16
  152. package/funcs/articlesDelete.d.ts.map +0 -1
  153. package/funcs/articlesDelete.js +0 -105
  154. package/funcs/articlesDelete.js.map +0 -1
  155. package/funcs/articlesExport.d.ts +0 -16
  156. package/funcs/articlesExport.d.ts.map +0 -1
  157. package/funcs/articlesExport.js +0 -103
  158. package/funcs/articlesExport.js.map +0 -1
  159. package/funcs/articlesGet.d.ts +0 -17
  160. package/funcs/articlesGet.d.ts.map +0 -1
  161. package/funcs/articlesGet.js +0 -105
  162. package/funcs/articlesGet.js.map +0 -1
  163. package/funcs/articlesList.d.ts +0 -19
  164. package/funcs/articlesList.d.ts.map +0 -1
  165. package/funcs/articlesList.js +0 -138
  166. package/funcs/articlesList.js.map +0 -1
  167. package/funcs/articlesPreview.d.ts +0 -16
  168. package/funcs/articlesPreview.d.ts.map +0 -1
  169. package/funcs/articlesPreview.js +0 -106
  170. package/funcs/articlesPreview.js.map +0 -1
  171. package/funcs/articlesReceivers.d.ts +0 -17
  172. package/funcs/articlesReceivers.d.ts.map +0 -1
  173. package/funcs/articlesReceivers.js +0 -105
  174. package/funcs/articlesReceivers.js.map +0 -1
  175. package/funcs/articlesSend.d.ts +0 -16
  176. package/funcs/articlesSend.d.ts.map +0 -1
  177. package/funcs/articlesSend.js +0 -105
  178. package/funcs/articlesSend.js.map +0 -1
  179. package/funcs/articlesUpdate.d.ts +0 -17
  180. package/funcs/articlesUpdate.d.ts.map +0 -1
  181. package/funcs/articlesUpdate.js +0 -106
  182. package/funcs/articlesUpdate.js.map +0 -1
  183. package/models/components/article.d.ts +0 -68
  184. package/models/components/article.d.ts.map +0 -1
  185. package/models/components/article.js +0 -129
  186. package/models/components/article.js.map +0 -1
  187. package/models/components/articlebyline.d.ts +0 -28
  188. package/models/components/articlebyline.d.ts.map +0 -1
  189. package/models/components/articlebyline.js +0 -50
  190. package/models/components/articlebyline.js.map +0 -1
  191. package/models/components/articlecreate.d.ts +0 -93
  192. package/models/components/articlecreate.d.ts.map +0 -1
  193. package/models/components/articlecreate.js +0 -112
  194. package/models/components/articlecreate.js.map +0 -1
  195. package/models/components/articlepreview.d.ts +0 -32
  196. package/models/components/articlepreview.d.ts.map +0 -1
  197. package/models/components/articlepreview.js +0 -59
  198. package/models/components/articlepreview.js.map +0 -1
  199. package/models/components/articlereceivers.d.ts +0 -33
  200. package/models/components/articlereceivers.d.ts.map +0 -1
  201. package/models/components/articlereceivers.js +0 -76
  202. package/models/components/articlereceivers.js.map +0 -1
  203. package/models/components/articleupdate.d.ts +0 -85
  204. package/models/components/articleupdate.d.ts.map +0 -1
  205. package/models/components/articleupdate.js +0 -108
  206. package/models/components/articleupdate.js.map +0 -1
  207. package/models/components/articlevisibility.d.ts +0 -31
  208. package/models/components/articlevisibility.d.ts.map +0 -1
  209. package/models/components/articlevisibility.js +0 -51
  210. package/models/components/articlevisibility.js.map +0 -1
  211. package/models/components/benefitarticles.d.ts +0 -100
  212. package/models/components/benefitarticles.d.ts.map +0 -1
  213. package/models/components/benefitarticles.js +0 -107
  214. package/models/components/benefitarticles.js.map +0 -1
  215. package/models/components/benefitarticlesproperties.d.ts +0 -35
  216. package/models/components/benefitarticlesproperties.d.ts.map +0 -1
  217. package/models/components/benefitarticlesproperties.js +0 -68
  218. package/models/components/benefitarticlesproperties.js.map +0 -1
  219. package/models/components/benefitarticlessubscriber.d.ts +0 -99
  220. package/models/components/benefitarticlessubscriber.d.ts.map +0 -1
  221. package/models/components/benefitarticlessubscriber.js +0 -113
  222. package/models/components/benefitarticlessubscriber.js.map +0 -1
  223. package/models/components/benefitarticlessubscriberproperties.d.ts +0 -35
  224. package/models/components/benefitarticlessubscriberproperties.d.ts.map +0 -1
  225. package/models/components/benefitarticlessubscriberproperties.js +0 -68
  226. package/models/components/benefitarticlessubscriberproperties.js.map +0 -1
  227. package/models/components/benefitarticlesupdate.d.ts +0 -57
  228. package/models/components/benefitarticlesupdate.d.ts.map +0 -1
  229. package/models/components/benefitarticlesupdate.js +0 -79
  230. package/models/components/benefitarticlesupdate.js.map +0 -1
  231. package/models/components/benefitgrantarticlesproperties.d.ts +0 -25
  232. package/models/components/benefitgrantarticlesproperties.d.ts.map +0 -1
  233. package/models/components/benefitgrantarticlesproperties.js +0 -55
  234. package/models/components/benefitgrantarticlesproperties.js.map +0 -1
  235. package/models/components/bylineprofile.d.ts +0 -31
  236. package/models/components/bylineprofile.d.ts.map +0 -1
  237. package/models/components/bylineprofile.js +0 -70
  238. package/models/components/bylineprofile.js.map +0 -1
  239. package/models/components/listresourcearticle.d.ts +0 -33
  240. package/models/components/listresourcearticle.d.ts.map +0 -1
  241. package/models/components/listresourcearticle.js +0 -63
  242. package/models/components/listresourcearticle.js.map +0 -1
  243. package/models/errors/filenotfound.d.ts +0 -57
  244. package/models/errors/filenotfound.d.ts.map +0 -1
  245. package/models/errors/filenotfound.js +0 -88
  246. package/models/errors/filenotfound.js.map +0 -1
  247. package/models/operations/articlesdelete.d.ts +0 -29
  248. package/models/operations/articlesdelete.d.ts.map +0 -1
  249. package/models/operations/articlesdelete.js +0 -59
  250. package/models/operations/articlesdelete.js.map +0 -1
  251. package/models/operations/articlesexport.d.ts +0 -29
  252. package/models/operations/articlesexport.d.ts.map +0 -1
  253. package/models/operations/articlesexport.js +0 -68
  254. package/models/operations/articlesexport.js.map +0 -1
  255. package/models/operations/articlesget.d.ts +0 -29
  256. package/models/operations/articlesget.d.ts.map +0 -1
  257. package/models/operations/articlesget.js +0 -59
  258. package/models/operations/articlesget.js.map +0 -1
  259. package/models/operations/articleslist.d.ts +0 -141
  260. package/models/operations/articleslist.d.ts.map +0 -1
  261. package/models/operations/articleslist.js +0 -184
  262. package/models/operations/articleslist.js.map +0 -1
  263. package/models/operations/articlespreview.d.ts +0 -32
  264. package/models/operations/articlespreview.d.ts.map +0 -1
  265. package/models/operations/articlespreview.js +0 -71
  266. package/models/operations/articlespreview.js.map +0 -1
  267. package/models/operations/articlesreceivers.d.ts +0 -29
  268. package/models/operations/articlesreceivers.d.ts.map +0 -1
  269. package/models/operations/articlesreceivers.js +0 -59
  270. package/models/operations/articlesreceivers.js.map +0 -1
  271. package/models/operations/articlessend.d.ts +0 -29
  272. package/models/operations/articlessend.d.ts.map +0 -1
  273. package/models/operations/articlessend.js +0 -59
  274. package/models/operations/articlessend.js.map +0 -1
  275. package/models/operations/articlesupdate.d.ts +0 -32
  276. package/models/operations/articlesupdate.d.ts.map +0 -1
  277. package/models/operations/articlesupdate.js +0 -71
  278. package/models/operations/articlesupdate.js.map +0 -1
  279. package/sdk/articles.d.ts +0 -72
  280. package/sdk/articles.d.ts.map +0 -1
  281. package/sdk/articles.js +0 -103
  282. package/sdk/articles.js.map +0 -1
  283. package/src/funcs/articlesCreate.ts +0 -131
  284. package/src/funcs/articlesDelete.ts +0 -144
  285. package/src/funcs/articlesExport.ts +0 -136
  286. package/src/funcs/articlesGet.ts +0 -141
  287. package/src/funcs/articlesList.ts +0 -205
  288. package/src/funcs/articlesPreview.ts +0 -145
  289. package/src/funcs/articlesReceivers.ts +0 -138
  290. package/src/funcs/articlesSend.ts +0 -144
  291. package/src/funcs/articlesUpdate.ts +0 -145
  292. package/src/models/components/article.ts +0 -187
  293. package/src/models/components/articlebyline.ts +0 -33
  294. package/src/models/components/articlecreate.ts +0 -191
  295. package/src/models/components/articlepreview.ts +0 -65
  296. package/src/models/components/articlereceivers.ts +0 -87
  297. package/src/models/components/articleupdate.ts +0 -179
  298. package/src/models/components/articlevisibility.ts +0 -34
  299. package/src/models/components/benefitarticles.ts +0 -175
  300. package/src/models/components/benefitarticlesproperties.ts +0 -81
  301. package/src/models/components/benefitarticlessubscriber.ts +0 -189
  302. package/src/models/components/benefitarticlessubscriberproperties.ts +0 -86
  303. package/src/models/components/benefitarticlesupdate.ts +0 -102
  304. package/src/models/components/benefitgrantarticlesproperties.ts +0 -60
  305. package/src/models/components/bylineprofile.ts +0 -75
  306. package/src/models/components/listresourcearticle.ts +0 -82
  307. package/src/models/errors/filenotfound.ts +0 -102
  308. package/src/models/operations/articlesdelete.ts +0 -66
  309. package/src/models/operations/articlesexport.ts +0 -75
  310. package/src/models/operations/articlesget.ts +0 -66
  311. package/src/models/operations/articleslist.ts +0 -342
  312. package/src/models/operations/articlespreview.ts +0 -80
  313. package/src/models/operations/articlesreceivers.ts +0 -66
  314. package/src/models/operations/articlessend.ts +0 -66
  315. package/src/models/operations/articlesupdate.ts +0 -80
  316. package/src/sdk/articles.ts +0 -173
@@ -1,66 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
-
10
- export type ArticlesDeleteRequest = {
11
- id: string;
12
- };
13
-
14
- /** @internal */
15
- export const ArticlesDeleteRequest$inboundSchema: z.ZodType<
16
- ArticlesDeleteRequest,
17
- z.ZodTypeDef,
18
- unknown
19
- > = z.object({
20
- id: z.string(),
21
- });
22
-
23
- /** @internal */
24
- export type ArticlesDeleteRequest$Outbound = {
25
- id: string;
26
- };
27
-
28
- /** @internal */
29
- export const ArticlesDeleteRequest$outboundSchema: z.ZodType<
30
- ArticlesDeleteRequest$Outbound,
31
- z.ZodTypeDef,
32
- ArticlesDeleteRequest
33
- > = z.object({
34
- id: z.string(),
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 ArticlesDeleteRequest$ {
42
- /** @deprecated use `ArticlesDeleteRequest$inboundSchema` instead. */
43
- export const inboundSchema = ArticlesDeleteRequest$inboundSchema;
44
- /** @deprecated use `ArticlesDeleteRequest$outboundSchema` instead. */
45
- export const outboundSchema = ArticlesDeleteRequest$outboundSchema;
46
- /** @deprecated use `ArticlesDeleteRequest$Outbound` instead. */
47
- export type Outbound = ArticlesDeleteRequest$Outbound;
48
- }
49
-
50
- export function articlesDeleteRequestToJSON(
51
- articlesDeleteRequest: ArticlesDeleteRequest,
52
- ): string {
53
- return JSON.stringify(
54
- ArticlesDeleteRequest$outboundSchema.parse(articlesDeleteRequest),
55
- );
56
- }
57
-
58
- export function articlesDeleteRequestFromJSON(
59
- jsonString: string,
60
- ): SafeParseResult<ArticlesDeleteRequest, SDKValidationError> {
61
- return safeParse(
62
- jsonString,
63
- (x) => ArticlesDeleteRequest$inboundSchema.parse(JSON.parse(x)),
64
- `Failed to parse 'ArticlesDeleteRequest' from JSON`,
65
- );
66
- }
@@ -1,75 +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 { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- export type ArticlesExportRequest = {
12
- organizationId: string;
13
- };
14
-
15
- /** @internal */
16
- export const ArticlesExportRequest$inboundSchema: z.ZodType<
17
- ArticlesExportRequest,
18
- z.ZodTypeDef,
19
- unknown
20
- > = z.object({
21
- organization_id: z.string(),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- "organization_id": "organizationId",
25
- });
26
- });
27
-
28
- /** @internal */
29
- export type ArticlesExportRequest$Outbound = {
30
- organization_id: string;
31
- };
32
-
33
- /** @internal */
34
- export const ArticlesExportRequest$outboundSchema: z.ZodType<
35
- ArticlesExportRequest$Outbound,
36
- z.ZodTypeDef,
37
- ArticlesExportRequest
38
- > = z.object({
39
- organizationId: z.string(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- organizationId: "organization_id",
43
- });
44
- });
45
-
46
- /**
47
- * @internal
48
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
49
- */
50
- export namespace ArticlesExportRequest$ {
51
- /** @deprecated use `ArticlesExportRequest$inboundSchema` instead. */
52
- export const inboundSchema = ArticlesExportRequest$inboundSchema;
53
- /** @deprecated use `ArticlesExportRequest$outboundSchema` instead. */
54
- export const outboundSchema = ArticlesExportRequest$outboundSchema;
55
- /** @deprecated use `ArticlesExportRequest$Outbound` instead. */
56
- export type Outbound = ArticlesExportRequest$Outbound;
57
- }
58
-
59
- export function articlesExportRequestToJSON(
60
- articlesExportRequest: ArticlesExportRequest,
61
- ): string {
62
- return JSON.stringify(
63
- ArticlesExportRequest$outboundSchema.parse(articlesExportRequest),
64
- );
65
- }
66
-
67
- export function articlesExportRequestFromJSON(
68
- jsonString: string,
69
- ): SafeParseResult<ArticlesExportRequest, SDKValidationError> {
70
- return safeParse(
71
- jsonString,
72
- (x) => ArticlesExportRequest$inboundSchema.parse(JSON.parse(x)),
73
- `Failed to parse 'ArticlesExportRequest' from JSON`,
74
- );
75
- }
@@ -1,66 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
-
10
- export type ArticlesGetRequest = {
11
- id: string;
12
- };
13
-
14
- /** @internal */
15
- export const ArticlesGetRequest$inboundSchema: z.ZodType<
16
- ArticlesGetRequest,
17
- z.ZodTypeDef,
18
- unknown
19
- > = z.object({
20
- id: z.string(),
21
- });
22
-
23
- /** @internal */
24
- export type ArticlesGetRequest$Outbound = {
25
- id: string;
26
- };
27
-
28
- /** @internal */
29
- export const ArticlesGetRequest$outboundSchema: z.ZodType<
30
- ArticlesGetRequest$Outbound,
31
- z.ZodTypeDef,
32
- ArticlesGetRequest
33
- > = z.object({
34
- id: z.string(),
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 ArticlesGetRequest$ {
42
- /** @deprecated use `ArticlesGetRequest$inboundSchema` instead. */
43
- export const inboundSchema = ArticlesGetRequest$inboundSchema;
44
- /** @deprecated use `ArticlesGetRequest$outboundSchema` instead. */
45
- export const outboundSchema = ArticlesGetRequest$outboundSchema;
46
- /** @deprecated use `ArticlesGetRequest$Outbound` instead. */
47
- export type Outbound = ArticlesGetRequest$Outbound;
48
- }
49
-
50
- export function articlesGetRequestToJSON(
51
- articlesGetRequest: ArticlesGetRequest,
52
- ): string {
53
- return JSON.stringify(
54
- ArticlesGetRequest$outboundSchema.parse(articlesGetRequest),
55
- );
56
- }
57
-
58
- export function articlesGetRequestFromJSON(
59
- jsonString: string,
60
- ): SafeParseResult<ArticlesGetRequest, SDKValidationError> {
61
- return safeParse(
62
- jsonString,
63
- (x) => ArticlesGetRequest$inboundSchema.parse(JSON.parse(x)),
64
- `Failed to parse 'ArticlesGetRequest' from JSON`,
65
- );
66
- }
@@ -1,342 +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 { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import * as components from "../components/index.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- /**
13
- * Filter by organization ID.
14
- */
15
- export type ArticlesListQueryParamOrganizationIDFilter = string | Array<string>;
16
-
17
- /**
18
- * Filter by visibility.
19
- */
20
- export type ArticleVisibilityFilter =
21
- | components.ArticleVisibility
22
- | Array<components.ArticleVisibility>;
23
-
24
- export type ArticlesListRequest = {
25
- /**
26
- * Filter by organization ID.
27
- */
28
- organizationId?: string | Array<string> | null | undefined;
29
- /**
30
- * Filter by slug.
31
- */
32
- slug?: string | null | undefined;
33
- /**
34
- * Filter by visibility.
35
- */
36
- visibility?:
37
- | components.ArticleVisibility
38
- | Array<components.ArticleVisibility>
39
- | null
40
- | undefined;
41
- /**
42
- * Filter by subscription status.
43
- */
44
- isSubscribed?: boolean | null | undefined;
45
- /**
46
- * Filter by published status.
47
- */
48
- isPublished?: boolean | null | undefined;
49
- /**
50
- * Filter by pinned status.
51
- */
52
- isPinned?: boolean | null | undefined;
53
- /**
54
- * Page number, defaults to 1.
55
- */
56
- page?: number | undefined;
57
- /**
58
- * Size of a page, defaults to 10. Maximum is 100.
59
- */
60
- limit?: number | undefined;
61
- };
62
-
63
- export type ArticlesListResponse = {
64
- result: components.ListResourceArticle;
65
- };
66
-
67
- /** @internal */
68
- export const ArticlesListQueryParamOrganizationIDFilter$inboundSchema:
69
- z.ZodType<ArticlesListQueryParamOrganizationIDFilter, z.ZodTypeDef, unknown> =
70
- z.union([z.string(), z.array(z.string())]);
71
-
72
- /** @internal */
73
- export type ArticlesListQueryParamOrganizationIDFilter$Outbound =
74
- | string
75
- | Array<string>;
76
-
77
- /** @internal */
78
- export const ArticlesListQueryParamOrganizationIDFilter$outboundSchema:
79
- z.ZodType<
80
- ArticlesListQueryParamOrganizationIDFilter$Outbound,
81
- z.ZodTypeDef,
82
- ArticlesListQueryParamOrganizationIDFilter
83
- > = z.union([z.string(), z.array(z.string())]);
84
-
85
- /**
86
- * @internal
87
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
88
- */
89
- export namespace ArticlesListQueryParamOrganizationIDFilter$ {
90
- /** @deprecated use `ArticlesListQueryParamOrganizationIDFilter$inboundSchema` instead. */
91
- export const inboundSchema =
92
- ArticlesListQueryParamOrganizationIDFilter$inboundSchema;
93
- /** @deprecated use `ArticlesListQueryParamOrganizationIDFilter$outboundSchema` instead. */
94
- export const outboundSchema =
95
- ArticlesListQueryParamOrganizationIDFilter$outboundSchema;
96
- /** @deprecated use `ArticlesListQueryParamOrganizationIDFilter$Outbound` instead. */
97
- export type Outbound = ArticlesListQueryParamOrganizationIDFilter$Outbound;
98
- }
99
-
100
- export function articlesListQueryParamOrganizationIDFilterToJSON(
101
- articlesListQueryParamOrganizationIDFilter:
102
- ArticlesListQueryParamOrganizationIDFilter,
103
- ): string {
104
- return JSON.stringify(
105
- ArticlesListQueryParamOrganizationIDFilter$outboundSchema.parse(
106
- articlesListQueryParamOrganizationIDFilter,
107
- ),
108
- );
109
- }
110
-
111
- export function articlesListQueryParamOrganizationIDFilterFromJSON(
112
- jsonString: string,
113
- ): SafeParseResult<
114
- ArticlesListQueryParamOrganizationIDFilter,
115
- SDKValidationError
116
- > {
117
- return safeParse(
118
- jsonString,
119
- (x) =>
120
- ArticlesListQueryParamOrganizationIDFilter$inboundSchema.parse(
121
- JSON.parse(x),
122
- ),
123
- `Failed to parse 'ArticlesListQueryParamOrganizationIDFilter' from JSON`,
124
- );
125
- }
126
-
127
- /** @internal */
128
- export const ArticleVisibilityFilter$inboundSchema: z.ZodType<
129
- ArticleVisibilityFilter,
130
- z.ZodTypeDef,
131
- unknown
132
- > = z.union([
133
- components.ArticleVisibility$inboundSchema,
134
- z.array(components.ArticleVisibility$inboundSchema),
135
- ]);
136
-
137
- /** @internal */
138
- export type ArticleVisibilityFilter$Outbound = string | Array<string>;
139
-
140
- /** @internal */
141
- export const ArticleVisibilityFilter$outboundSchema: z.ZodType<
142
- ArticleVisibilityFilter$Outbound,
143
- z.ZodTypeDef,
144
- ArticleVisibilityFilter
145
- > = z.union([
146
- components.ArticleVisibility$outboundSchema,
147
- z.array(components.ArticleVisibility$outboundSchema),
148
- ]);
149
-
150
- /**
151
- * @internal
152
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
153
- */
154
- export namespace ArticleVisibilityFilter$ {
155
- /** @deprecated use `ArticleVisibilityFilter$inboundSchema` instead. */
156
- export const inboundSchema = ArticleVisibilityFilter$inboundSchema;
157
- /** @deprecated use `ArticleVisibilityFilter$outboundSchema` instead. */
158
- export const outboundSchema = ArticleVisibilityFilter$outboundSchema;
159
- /** @deprecated use `ArticleVisibilityFilter$Outbound` instead. */
160
- export type Outbound = ArticleVisibilityFilter$Outbound;
161
- }
162
-
163
- export function articleVisibilityFilterToJSON(
164
- articleVisibilityFilter: ArticleVisibilityFilter,
165
- ): string {
166
- return JSON.stringify(
167
- ArticleVisibilityFilter$outboundSchema.parse(articleVisibilityFilter),
168
- );
169
- }
170
-
171
- export function articleVisibilityFilterFromJSON(
172
- jsonString: string,
173
- ): SafeParseResult<ArticleVisibilityFilter, SDKValidationError> {
174
- return safeParse(
175
- jsonString,
176
- (x) => ArticleVisibilityFilter$inboundSchema.parse(JSON.parse(x)),
177
- `Failed to parse 'ArticleVisibilityFilter' from JSON`,
178
- );
179
- }
180
-
181
- /** @internal */
182
- export const ArticlesListRequest$inboundSchema: z.ZodType<
183
- ArticlesListRequest,
184
- z.ZodTypeDef,
185
- unknown
186
- > = z.object({
187
- organization_id: z.nullable(z.union([z.string(), z.array(z.string())]))
188
- .optional(),
189
- slug: z.nullable(z.string()).optional(),
190
- visibility: z.nullable(
191
- z.union([
192
- components.ArticleVisibility$inboundSchema,
193
- z.array(components.ArticleVisibility$inboundSchema),
194
- ]),
195
- ).optional(),
196
- is_subscribed: z.nullable(z.boolean()).optional(),
197
- is_published: z.nullable(z.boolean()).optional(),
198
- is_pinned: z.nullable(z.boolean()).optional(),
199
- page: z.number().int().default(1),
200
- limit: z.number().int().default(10),
201
- }).transform((v) => {
202
- return remap$(v, {
203
- "organization_id": "organizationId",
204
- "is_subscribed": "isSubscribed",
205
- "is_published": "isPublished",
206
- "is_pinned": "isPinned",
207
- });
208
- });
209
-
210
- /** @internal */
211
- export type ArticlesListRequest$Outbound = {
212
- organization_id?: string | Array<string> | null | undefined;
213
- slug?: string | null | undefined;
214
- visibility?: string | Array<string> | null | undefined;
215
- is_subscribed?: boolean | null | undefined;
216
- is_published?: boolean | null | undefined;
217
- is_pinned?: boolean | null | undefined;
218
- page: number;
219
- limit: number;
220
- };
221
-
222
- /** @internal */
223
- export const ArticlesListRequest$outboundSchema: z.ZodType<
224
- ArticlesListRequest$Outbound,
225
- z.ZodTypeDef,
226
- ArticlesListRequest
227
- > = z.object({
228
- organizationId: z.nullable(z.union([z.string(), z.array(z.string())]))
229
- .optional(),
230
- slug: z.nullable(z.string()).optional(),
231
- visibility: z.nullable(
232
- z.union([
233
- components.ArticleVisibility$outboundSchema,
234
- z.array(components.ArticleVisibility$outboundSchema),
235
- ]),
236
- ).optional(),
237
- isSubscribed: z.nullable(z.boolean()).optional(),
238
- isPublished: z.nullable(z.boolean()).optional(),
239
- isPinned: z.nullable(z.boolean()).optional(),
240
- page: z.number().int().default(1),
241
- limit: z.number().int().default(10),
242
- }).transform((v) => {
243
- return remap$(v, {
244
- organizationId: "organization_id",
245
- isSubscribed: "is_subscribed",
246
- isPublished: "is_published",
247
- isPinned: "is_pinned",
248
- });
249
- });
250
-
251
- /**
252
- * @internal
253
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
254
- */
255
- export namespace ArticlesListRequest$ {
256
- /** @deprecated use `ArticlesListRequest$inboundSchema` instead. */
257
- export const inboundSchema = ArticlesListRequest$inboundSchema;
258
- /** @deprecated use `ArticlesListRequest$outboundSchema` instead. */
259
- export const outboundSchema = ArticlesListRequest$outboundSchema;
260
- /** @deprecated use `ArticlesListRequest$Outbound` instead. */
261
- export type Outbound = ArticlesListRequest$Outbound;
262
- }
263
-
264
- export function articlesListRequestToJSON(
265
- articlesListRequest: ArticlesListRequest,
266
- ): string {
267
- return JSON.stringify(
268
- ArticlesListRequest$outboundSchema.parse(articlesListRequest),
269
- );
270
- }
271
-
272
- export function articlesListRequestFromJSON(
273
- jsonString: string,
274
- ): SafeParseResult<ArticlesListRequest, SDKValidationError> {
275
- return safeParse(
276
- jsonString,
277
- (x) => ArticlesListRequest$inboundSchema.parse(JSON.parse(x)),
278
- `Failed to parse 'ArticlesListRequest' from JSON`,
279
- );
280
- }
281
-
282
- /** @internal */
283
- export const ArticlesListResponse$inboundSchema: z.ZodType<
284
- ArticlesListResponse,
285
- z.ZodTypeDef,
286
- unknown
287
- > = z.object({
288
- Result: components.ListResourceArticle$inboundSchema,
289
- }).transform((v) => {
290
- return remap$(v, {
291
- "Result": "result",
292
- });
293
- });
294
-
295
- /** @internal */
296
- export type ArticlesListResponse$Outbound = {
297
- Result: components.ListResourceArticle$Outbound;
298
- };
299
-
300
- /** @internal */
301
- export const ArticlesListResponse$outboundSchema: z.ZodType<
302
- ArticlesListResponse$Outbound,
303
- z.ZodTypeDef,
304
- ArticlesListResponse
305
- > = z.object({
306
- result: components.ListResourceArticle$outboundSchema,
307
- }).transform((v) => {
308
- return remap$(v, {
309
- result: "Result",
310
- });
311
- });
312
-
313
- /**
314
- * @internal
315
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
316
- */
317
- export namespace ArticlesListResponse$ {
318
- /** @deprecated use `ArticlesListResponse$inboundSchema` instead. */
319
- export const inboundSchema = ArticlesListResponse$inboundSchema;
320
- /** @deprecated use `ArticlesListResponse$outboundSchema` instead. */
321
- export const outboundSchema = ArticlesListResponse$outboundSchema;
322
- /** @deprecated use `ArticlesListResponse$Outbound` instead. */
323
- export type Outbound = ArticlesListResponse$Outbound;
324
- }
325
-
326
- export function articlesListResponseToJSON(
327
- articlesListResponse: ArticlesListResponse,
328
- ): string {
329
- return JSON.stringify(
330
- ArticlesListResponse$outboundSchema.parse(articlesListResponse),
331
- );
332
- }
333
-
334
- export function articlesListResponseFromJSON(
335
- jsonString: string,
336
- ): SafeParseResult<ArticlesListResponse, SDKValidationError> {
337
- return safeParse(
338
- jsonString,
339
- (x) => ArticlesListResponse$inboundSchema.parse(JSON.parse(x)),
340
- `Failed to parse 'ArticlesListResponse' from JSON`,
341
- );
342
- }
@@ -1,80 +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 { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import * as components from "../components/index.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- export type ArticlesPreviewRequest = {
13
- id: string;
14
- articlePreview: components.ArticlePreview;
15
- };
16
-
17
- /** @internal */
18
- export const ArticlesPreviewRequest$inboundSchema: z.ZodType<
19
- ArticlesPreviewRequest,
20
- z.ZodTypeDef,
21
- unknown
22
- > = z.object({
23
- id: z.string(),
24
- ArticlePreview: components.ArticlePreview$inboundSchema,
25
- }).transform((v) => {
26
- return remap$(v, {
27
- "ArticlePreview": "articlePreview",
28
- });
29
- });
30
-
31
- /** @internal */
32
- export type ArticlesPreviewRequest$Outbound = {
33
- id: string;
34
- ArticlePreview: components.ArticlePreview$Outbound;
35
- };
36
-
37
- /** @internal */
38
- export const ArticlesPreviewRequest$outboundSchema: z.ZodType<
39
- ArticlesPreviewRequest$Outbound,
40
- z.ZodTypeDef,
41
- ArticlesPreviewRequest
42
- > = z.object({
43
- id: z.string(),
44
- articlePreview: components.ArticlePreview$outboundSchema,
45
- }).transform((v) => {
46
- return remap$(v, {
47
- articlePreview: "ArticlePreview",
48
- });
49
- });
50
-
51
- /**
52
- * @internal
53
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
54
- */
55
- export namespace ArticlesPreviewRequest$ {
56
- /** @deprecated use `ArticlesPreviewRequest$inboundSchema` instead. */
57
- export const inboundSchema = ArticlesPreviewRequest$inboundSchema;
58
- /** @deprecated use `ArticlesPreviewRequest$outboundSchema` instead. */
59
- export const outboundSchema = ArticlesPreviewRequest$outboundSchema;
60
- /** @deprecated use `ArticlesPreviewRequest$Outbound` instead. */
61
- export type Outbound = ArticlesPreviewRequest$Outbound;
62
- }
63
-
64
- export function articlesPreviewRequestToJSON(
65
- articlesPreviewRequest: ArticlesPreviewRequest,
66
- ): string {
67
- return JSON.stringify(
68
- ArticlesPreviewRequest$outboundSchema.parse(articlesPreviewRequest),
69
- );
70
- }
71
-
72
- export function articlesPreviewRequestFromJSON(
73
- jsonString: string,
74
- ): SafeParseResult<ArticlesPreviewRequest, SDKValidationError> {
75
- return safeParse(
76
- jsonString,
77
- (x) => ArticlesPreviewRequest$inboundSchema.parse(JSON.parse(x)),
78
- `Failed to parse 'ArticlesPreviewRequest' from JSON`,
79
- );
80
- }
@@ -1,66 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
-
10
- export type ArticlesReceiversRequest = {
11
- id: string;
12
- };
13
-
14
- /** @internal */
15
- export const ArticlesReceiversRequest$inboundSchema: z.ZodType<
16
- ArticlesReceiversRequest,
17
- z.ZodTypeDef,
18
- unknown
19
- > = z.object({
20
- id: z.string(),
21
- });
22
-
23
- /** @internal */
24
- export type ArticlesReceiversRequest$Outbound = {
25
- id: string;
26
- };
27
-
28
- /** @internal */
29
- export const ArticlesReceiversRequest$outboundSchema: z.ZodType<
30
- ArticlesReceiversRequest$Outbound,
31
- z.ZodTypeDef,
32
- ArticlesReceiversRequest
33
- > = z.object({
34
- id: z.string(),
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 ArticlesReceiversRequest$ {
42
- /** @deprecated use `ArticlesReceiversRequest$inboundSchema` instead. */
43
- export const inboundSchema = ArticlesReceiversRequest$inboundSchema;
44
- /** @deprecated use `ArticlesReceiversRequest$outboundSchema` instead. */
45
- export const outboundSchema = ArticlesReceiversRequest$outboundSchema;
46
- /** @deprecated use `ArticlesReceiversRequest$Outbound` instead. */
47
- export type Outbound = ArticlesReceiversRequest$Outbound;
48
- }
49
-
50
- export function articlesReceiversRequestToJSON(
51
- articlesReceiversRequest: ArticlesReceiversRequest,
52
- ): string {
53
- return JSON.stringify(
54
- ArticlesReceiversRequest$outboundSchema.parse(articlesReceiversRequest),
55
- );
56
- }
57
-
58
- export function articlesReceiversRequestFromJSON(
59
- jsonString: string,
60
- ): SafeParseResult<ArticlesReceiversRequest, SDKValidationError> {
61
- return safeParse(
62
- jsonString,
63
- (x) => ArticlesReceiversRequest$inboundSchema.parse(JSON.parse(x)),
64
- `Failed to parse 'ArticlesReceiversRequest' from JSON`,
65
- );
66
- }