@polar-sh/sdk 0.17.4 → 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 (284) 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/hooks/hooks.d.ts.map +1 -1
  6. package/hooks/hooks.js +18 -0
  7. package/hooks/hooks.js.map +1 -1
  8. package/hooks/types.d.ts +3 -0
  9. package/hooks/types.d.ts.map +1 -1
  10. package/lib/config.d.ts +3 -3
  11. package/lib/config.js +3 -3
  12. package/lib/config.js.map +1 -1
  13. package/models/components/benefit.d.ts +2 -3
  14. package/models/components/benefit.d.ts.map +1 -1
  15. package/models/components/benefit.js +0 -3
  16. package/models/components/benefit.js.map +1 -1
  17. package/models/components/benefitadssubscriber.d.ts +7 -7
  18. package/models/components/benefitadssubscriber.d.ts.map +1 -1
  19. package/models/components/benefitadssubscriber.js +11 -11
  20. package/models/components/benefitadssubscriber.js.map +1 -1
  21. package/models/components/benefitgrant.d.ts +4 -5
  22. package/models/components/benefitgrant.d.ts.map +1 -1
  23. package/models/components/benefitgrant.js +0 -5
  24. package/models/components/benefitgrant.js.map +1 -1
  25. package/models/components/benefitgrantwebhook.d.ts +8 -9
  26. package/models/components/benefitgrantwebhook.d.ts.map +1 -1
  27. package/models/components/benefitgrantwebhook.js +0 -9
  28. package/models/components/benefitgrantwebhook.js.map +1 -1
  29. package/models/components/benefittype.d.ts +0 -3
  30. package/models/components/benefittype.d.ts.map +1 -1
  31. package/models/components/benefittype.js +0 -1
  32. package/models/components/benefittype.js.map +1 -1
  33. package/models/components/checkoutlinkproduct.d.ts +2 -24
  34. package/models/components/checkoutlinkproduct.d.ts.map +1 -1
  35. package/models/components/checkoutlinkproduct.js +3 -27
  36. package/models/components/checkoutlinkproduct.js.map +1 -1
  37. package/models/components/checkoutproduct.d.ts +2 -24
  38. package/models/components/checkoutproduct.d.ts.map +1 -1
  39. package/models/components/checkoutproduct.js +3 -27
  40. package/models/components/checkoutproduct.js.map +1 -1
  41. package/models/components/index.d.ts +0 -15
  42. package/models/components/index.d.ts.map +1 -1
  43. package/models/components/index.js +0 -15
  44. package/models/components/index.js.map +1 -1
  45. package/models/components/listresourceuserbenefit.d.ts +0 -9
  46. package/models/components/listresourceuserbenefit.d.ts.map +1 -1
  47. package/models/components/listresourceuserbenefit.js +0 -13
  48. package/models/components/listresourceuserbenefit.js.map +1 -1
  49. package/models/components/oauth2client.js +2 -2
  50. package/models/components/oauth2client.js.map +1 -1
  51. package/models/components/oauth2clientconfiguration.js +2 -2
  52. package/models/components/oauth2clientconfiguration.js.map +1 -1
  53. package/models/components/oauth2clientconfigurationupdate.js +2 -2
  54. package/models/components/oauth2clientconfigurationupdate.js.map +1 -1
  55. package/models/components/organizationfeaturesettings.d.ts +0 -5
  56. package/models/components/organizationfeaturesettings.d.ts.map +1 -1
  57. package/models/components/organizationfeaturesettings.js +0 -4
  58. package/models/components/organizationfeaturesettings.js.map +1 -1
  59. package/models/components/scope.d.ts +0 -6
  60. package/models/components/scope.d.ts.map +1 -1
  61. package/models/components/scope.js +0 -2
  62. package/models/components/scope.js.map +1 -1
  63. package/models/components/userorderproduct.d.ts +2 -24
  64. package/models/components/userorderproduct.d.ts.map +1 -1
  65. package/models/components/userorderproduct.js +3 -27
  66. package/models/components/userorderproduct.js.map +1 -1
  67. package/models/components/usersubscriptionproduct.d.ts +2 -24
  68. package/models/components/usersubscriptionproduct.d.ts.map +1 -1
  69. package/models/components/usersubscriptionproduct.js +3 -27
  70. package/models/components/usersubscriptionproduct.js.map +1 -1
  71. package/models/operations/benefitsupdate.d.ts +4 -4
  72. package/models/operations/benefitsupdate.d.ts.map +1 -1
  73. package/models/operations/benefitsupdate.js +0 -4
  74. package/models/operations/benefitsupdate.js.map +1 -1
  75. package/models/operations/index.d.ts +0 -8
  76. package/models/operations/index.d.ts.map +1 -1
  77. package/models/operations/index.js +0 -8
  78. package/models/operations/index.js.map +1 -1
  79. package/models/operations/usersbenefitsget.d.ts +2 -6
  80. package/models/operations/usersbenefitsget.d.ts.map +1 -1
  81. package/models/operations/usersbenefitsget.js +0 -6
  82. package/models/operations/usersbenefitsget.js.map +1 -1
  83. package/package.json +1 -3
  84. package/sdk/sdk.d.ts +0 -3
  85. package/sdk/sdk.d.ts.map +1 -1
  86. package/sdk/sdk.js +0 -5
  87. package/sdk/sdk.js.map +1 -1
  88. package/src/hooks/hooks.ts +20 -0
  89. package/src/hooks/types.ts +9 -0
  90. package/src/lib/config.ts +3 -3
  91. package/src/models/components/benefit.ts +0 -10
  92. package/src/models/components/benefitadssubscriber.ts +12 -15
  93. package/src/models/components/benefitgrant.ts +0 -14
  94. package/src/models/components/benefitgrantwebhook.ts +0 -22
  95. package/src/models/components/benefittype.ts +0 -1
  96. package/src/models/components/checkoutlinkproduct.ts +4 -68
  97. package/src/models/components/checkoutproduct.ts +4 -66
  98. package/src/models/components/index.ts +0 -15
  99. package/src/models/components/listresourceuserbenefit.ts +0 -30
  100. package/src/models/components/oauth2client.ts +2 -2
  101. package/src/models/components/oauth2clientconfiguration.ts +2 -2
  102. package/src/models/components/oauth2clientconfigurationupdate.ts +2 -2
  103. package/src/models/components/organizationfeaturesettings.ts +0 -9
  104. package/src/models/components/scope.ts +0 -2
  105. package/src/models/components/userorderproduct.ts +4 -60
  106. package/src/models/components/usersubscriptionproduct.ts +4 -68
  107. package/src/models/operations/benefitsupdate.ts +0 -8
  108. package/src/models/operations/index.ts +0 -8
  109. package/src/models/operations/usersbenefitsget.ts +0 -12
  110. package/src/sdk/sdk.ts +0 -6
  111. package/src/types/index.ts +1 -0
  112. package/src/types/webhooks.ts +7 -0
  113. package/types/index.d.ts +1 -0
  114. package/types/index.d.ts.map +1 -1
  115. package/types/webhooks.d.ts +4 -0
  116. package/types/webhooks.d.ts.map +1 -0
  117. package/types/webhooks.js +6 -0
  118. package/types/webhooks.js.map +1 -0
  119. package/docs/sdks/articles/README.md +0 -724
  120. package/funcs/articlesCreate.d.ts +0 -16
  121. package/funcs/articlesCreate.d.ts.map +0 -1
  122. package/funcs/articlesCreate.js +0 -99
  123. package/funcs/articlesCreate.js.map +0 -1
  124. package/funcs/articlesDelete.d.ts +0 -16
  125. package/funcs/articlesDelete.d.ts.map +0 -1
  126. package/funcs/articlesDelete.js +0 -105
  127. package/funcs/articlesDelete.js.map +0 -1
  128. package/funcs/articlesExport.d.ts +0 -16
  129. package/funcs/articlesExport.d.ts.map +0 -1
  130. package/funcs/articlesExport.js +0 -103
  131. package/funcs/articlesExport.js.map +0 -1
  132. package/funcs/articlesGet.d.ts +0 -17
  133. package/funcs/articlesGet.d.ts.map +0 -1
  134. package/funcs/articlesGet.js +0 -105
  135. package/funcs/articlesGet.js.map +0 -1
  136. package/funcs/articlesList.d.ts +0 -19
  137. package/funcs/articlesList.d.ts.map +0 -1
  138. package/funcs/articlesList.js +0 -138
  139. package/funcs/articlesList.js.map +0 -1
  140. package/funcs/articlesPreview.d.ts +0 -16
  141. package/funcs/articlesPreview.d.ts.map +0 -1
  142. package/funcs/articlesPreview.js +0 -106
  143. package/funcs/articlesPreview.js.map +0 -1
  144. package/funcs/articlesReceivers.d.ts +0 -17
  145. package/funcs/articlesReceivers.d.ts.map +0 -1
  146. package/funcs/articlesReceivers.js +0 -105
  147. package/funcs/articlesReceivers.js.map +0 -1
  148. package/funcs/articlesSend.d.ts +0 -16
  149. package/funcs/articlesSend.d.ts.map +0 -1
  150. package/funcs/articlesSend.js +0 -105
  151. package/funcs/articlesSend.js.map +0 -1
  152. package/funcs/articlesUpdate.d.ts +0 -17
  153. package/funcs/articlesUpdate.d.ts.map +0 -1
  154. package/funcs/articlesUpdate.js +0 -106
  155. package/funcs/articlesUpdate.js.map +0 -1
  156. package/models/components/article.d.ts +0 -68
  157. package/models/components/article.d.ts.map +0 -1
  158. package/models/components/article.js +0 -129
  159. package/models/components/article.js.map +0 -1
  160. package/models/components/articlebyline.d.ts +0 -28
  161. package/models/components/articlebyline.d.ts.map +0 -1
  162. package/models/components/articlebyline.js +0 -50
  163. package/models/components/articlebyline.js.map +0 -1
  164. package/models/components/articlecreate.d.ts +0 -93
  165. package/models/components/articlecreate.d.ts.map +0 -1
  166. package/models/components/articlecreate.js +0 -112
  167. package/models/components/articlecreate.js.map +0 -1
  168. package/models/components/articlepreview.d.ts +0 -32
  169. package/models/components/articlepreview.d.ts.map +0 -1
  170. package/models/components/articlepreview.js +0 -59
  171. package/models/components/articlepreview.js.map +0 -1
  172. package/models/components/articlereceivers.d.ts +0 -33
  173. package/models/components/articlereceivers.d.ts.map +0 -1
  174. package/models/components/articlereceivers.js +0 -76
  175. package/models/components/articlereceivers.js.map +0 -1
  176. package/models/components/articleupdate.d.ts +0 -85
  177. package/models/components/articleupdate.d.ts.map +0 -1
  178. package/models/components/articleupdate.js +0 -108
  179. package/models/components/articleupdate.js.map +0 -1
  180. package/models/components/articlevisibility.d.ts +0 -31
  181. package/models/components/articlevisibility.d.ts.map +0 -1
  182. package/models/components/articlevisibility.js +0 -51
  183. package/models/components/articlevisibility.js.map +0 -1
  184. package/models/components/benefitarticles.d.ts +0 -100
  185. package/models/components/benefitarticles.d.ts.map +0 -1
  186. package/models/components/benefitarticles.js +0 -107
  187. package/models/components/benefitarticles.js.map +0 -1
  188. package/models/components/benefitarticlesproperties.d.ts +0 -35
  189. package/models/components/benefitarticlesproperties.d.ts.map +0 -1
  190. package/models/components/benefitarticlesproperties.js +0 -68
  191. package/models/components/benefitarticlesproperties.js.map +0 -1
  192. package/models/components/benefitarticlessubscriber.d.ts +0 -99
  193. package/models/components/benefitarticlessubscriber.d.ts.map +0 -1
  194. package/models/components/benefitarticlessubscriber.js +0 -113
  195. package/models/components/benefitarticlessubscriber.js.map +0 -1
  196. package/models/components/benefitarticlessubscriberproperties.d.ts +0 -35
  197. package/models/components/benefitarticlessubscriberproperties.d.ts.map +0 -1
  198. package/models/components/benefitarticlessubscriberproperties.js +0 -68
  199. package/models/components/benefitarticlessubscriberproperties.js.map +0 -1
  200. package/models/components/benefitarticlesupdate.d.ts +0 -57
  201. package/models/components/benefitarticlesupdate.d.ts.map +0 -1
  202. package/models/components/benefitarticlesupdate.js +0 -79
  203. package/models/components/benefitarticlesupdate.js.map +0 -1
  204. package/models/components/benefitgrantarticlesproperties.d.ts +0 -25
  205. package/models/components/benefitgrantarticlesproperties.d.ts.map +0 -1
  206. package/models/components/benefitgrantarticlesproperties.js +0 -55
  207. package/models/components/benefitgrantarticlesproperties.js.map +0 -1
  208. package/models/components/bylineprofile.d.ts +0 -31
  209. package/models/components/bylineprofile.d.ts.map +0 -1
  210. package/models/components/bylineprofile.js +0 -70
  211. package/models/components/bylineprofile.js.map +0 -1
  212. package/models/components/listresourcearticle.d.ts +0 -33
  213. package/models/components/listresourcearticle.d.ts.map +0 -1
  214. package/models/components/listresourcearticle.js +0 -63
  215. package/models/components/listresourcearticle.js.map +0 -1
  216. package/models/operations/articlesdelete.d.ts +0 -29
  217. package/models/operations/articlesdelete.d.ts.map +0 -1
  218. package/models/operations/articlesdelete.js +0 -59
  219. package/models/operations/articlesdelete.js.map +0 -1
  220. package/models/operations/articlesexport.d.ts +0 -29
  221. package/models/operations/articlesexport.d.ts.map +0 -1
  222. package/models/operations/articlesexport.js +0 -68
  223. package/models/operations/articlesexport.js.map +0 -1
  224. package/models/operations/articlesget.d.ts +0 -29
  225. package/models/operations/articlesget.d.ts.map +0 -1
  226. package/models/operations/articlesget.js +0 -59
  227. package/models/operations/articlesget.js.map +0 -1
  228. package/models/operations/articleslist.d.ts +0 -141
  229. package/models/operations/articleslist.d.ts.map +0 -1
  230. package/models/operations/articleslist.js +0 -184
  231. package/models/operations/articleslist.js.map +0 -1
  232. package/models/operations/articlespreview.d.ts +0 -32
  233. package/models/operations/articlespreview.d.ts.map +0 -1
  234. package/models/operations/articlespreview.js +0 -71
  235. package/models/operations/articlespreview.js.map +0 -1
  236. package/models/operations/articlesreceivers.d.ts +0 -29
  237. package/models/operations/articlesreceivers.d.ts.map +0 -1
  238. package/models/operations/articlesreceivers.js +0 -59
  239. package/models/operations/articlesreceivers.js.map +0 -1
  240. package/models/operations/articlessend.d.ts +0 -29
  241. package/models/operations/articlessend.d.ts.map +0 -1
  242. package/models/operations/articlessend.js +0 -59
  243. package/models/operations/articlessend.js.map +0 -1
  244. package/models/operations/articlesupdate.d.ts +0 -32
  245. package/models/operations/articlesupdate.d.ts.map +0 -1
  246. package/models/operations/articlesupdate.js +0 -71
  247. package/models/operations/articlesupdate.js.map +0 -1
  248. package/sdk/articles.d.ts +0 -72
  249. package/sdk/articles.d.ts.map +0 -1
  250. package/sdk/articles.js +0 -103
  251. package/sdk/articles.js.map +0 -1
  252. package/src/funcs/articlesCreate.ts +0 -131
  253. package/src/funcs/articlesDelete.ts +0 -144
  254. package/src/funcs/articlesExport.ts +0 -136
  255. package/src/funcs/articlesGet.ts +0 -141
  256. package/src/funcs/articlesList.ts +0 -205
  257. package/src/funcs/articlesPreview.ts +0 -145
  258. package/src/funcs/articlesReceivers.ts +0 -138
  259. package/src/funcs/articlesSend.ts +0 -144
  260. package/src/funcs/articlesUpdate.ts +0 -145
  261. package/src/models/components/article.ts +0 -187
  262. package/src/models/components/articlebyline.ts +0 -33
  263. package/src/models/components/articlecreate.ts +0 -191
  264. package/src/models/components/articlepreview.ts +0 -65
  265. package/src/models/components/articlereceivers.ts +0 -87
  266. package/src/models/components/articleupdate.ts +0 -179
  267. package/src/models/components/articlevisibility.ts +0 -34
  268. package/src/models/components/benefitarticles.ts +0 -175
  269. package/src/models/components/benefitarticlesproperties.ts +0 -81
  270. package/src/models/components/benefitarticlessubscriber.ts +0 -189
  271. package/src/models/components/benefitarticlessubscriberproperties.ts +0 -86
  272. package/src/models/components/benefitarticlesupdate.ts +0 -102
  273. package/src/models/components/benefitgrantarticlesproperties.ts +0 -60
  274. package/src/models/components/bylineprofile.ts +0 -75
  275. package/src/models/components/listresourcearticle.ts +0 -82
  276. package/src/models/operations/articlesdelete.ts +0 -66
  277. package/src/models/operations/articlesexport.ts +0 -75
  278. package/src/models/operations/articlesget.ts +0 -66
  279. package/src/models/operations/articleslist.ts +0 -342
  280. package/src/models/operations/articlespreview.ts +0 -80
  281. package/src/models/operations/articlesreceivers.ts +0 -66
  282. package/src/models/operations/articlessend.ts +0 -66
  283. package/src/models/operations/articlesupdate.ts +0 -80
  284. package/src/sdk/articles.ts +0 -173
@@ -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 BylineProfile = {
12
- name: string;
13
- avatarUrl: string | null;
14
- };
15
-
16
- /** @internal */
17
- export const BylineProfile$inboundSchema: z.ZodType<
18
- BylineProfile,
19
- z.ZodTypeDef,
20
- unknown
21
- > = z.object({
22
- name: z.string(),
23
- avatar_url: z.nullable(z.string()),
24
- }).transform((v) => {
25
- return remap$(v, {
26
- "avatar_url": "avatarUrl",
27
- });
28
- });
29
-
30
- /** @internal */
31
- export type BylineProfile$Outbound = {
32
- name: string;
33
- avatar_url: string | null;
34
- };
35
-
36
- /** @internal */
37
- export const BylineProfile$outboundSchema: z.ZodType<
38
- BylineProfile$Outbound,
39
- z.ZodTypeDef,
40
- BylineProfile
41
- > = z.object({
42
- name: z.string(),
43
- avatarUrl: z.nullable(z.string()),
44
- }).transform((v) => {
45
- return remap$(v, {
46
- avatarUrl: "avatar_url",
47
- });
48
- });
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 BylineProfile$ {
55
- /** @deprecated use `BylineProfile$inboundSchema` instead. */
56
- export const inboundSchema = BylineProfile$inboundSchema;
57
- /** @deprecated use `BylineProfile$outboundSchema` instead. */
58
- export const outboundSchema = BylineProfile$outboundSchema;
59
- /** @deprecated use `BylineProfile$Outbound` instead. */
60
- export type Outbound = BylineProfile$Outbound;
61
- }
62
-
63
- export function bylineProfileToJSON(bylineProfile: BylineProfile): string {
64
- return JSON.stringify(BylineProfile$outboundSchema.parse(bylineProfile));
65
- }
66
-
67
- export function bylineProfileFromJSON(
68
- jsonString: string,
69
- ): SafeParseResult<BylineProfile, SDKValidationError> {
70
- return safeParse(
71
- jsonString,
72
- (x) => BylineProfile$inboundSchema.parse(JSON.parse(x)),
73
- `Failed to parse 'BylineProfile' from JSON`,
74
- );
75
- }
@@ -1,82 +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
- import {
10
- Article,
11
- Article$inboundSchema,
12
- Article$Outbound,
13
- Article$outboundSchema,
14
- } from "./article.js";
15
- import {
16
- Pagination,
17
- Pagination$inboundSchema,
18
- Pagination$Outbound,
19
- Pagination$outboundSchema,
20
- } from "./pagination.js";
21
-
22
- export type ListResourceArticle = {
23
- items: Array<Article>;
24
- pagination: Pagination;
25
- };
26
-
27
- /** @internal */
28
- export const ListResourceArticle$inboundSchema: z.ZodType<
29
- ListResourceArticle,
30
- z.ZodTypeDef,
31
- unknown
32
- > = z.object({
33
- items: z.array(Article$inboundSchema),
34
- pagination: Pagination$inboundSchema,
35
- });
36
-
37
- /** @internal */
38
- export type ListResourceArticle$Outbound = {
39
- items: Array<Article$Outbound>;
40
- pagination: Pagination$Outbound;
41
- };
42
-
43
- /** @internal */
44
- export const ListResourceArticle$outboundSchema: z.ZodType<
45
- ListResourceArticle$Outbound,
46
- z.ZodTypeDef,
47
- ListResourceArticle
48
- > = z.object({
49
- items: z.array(Article$outboundSchema),
50
- pagination: Pagination$outboundSchema,
51
- });
52
-
53
- /**
54
- * @internal
55
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
- */
57
- export namespace ListResourceArticle$ {
58
- /** @deprecated use `ListResourceArticle$inboundSchema` instead. */
59
- export const inboundSchema = ListResourceArticle$inboundSchema;
60
- /** @deprecated use `ListResourceArticle$outboundSchema` instead. */
61
- export const outboundSchema = ListResourceArticle$outboundSchema;
62
- /** @deprecated use `ListResourceArticle$Outbound` instead. */
63
- export type Outbound = ListResourceArticle$Outbound;
64
- }
65
-
66
- export function listResourceArticleToJSON(
67
- listResourceArticle: ListResourceArticle,
68
- ): string {
69
- return JSON.stringify(
70
- ListResourceArticle$outboundSchema.parse(listResourceArticle),
71
- );
72
- }
73
-
74
- export function listResourceArticleFromJSON(
75
- jsonString: string,
76
- ): SafeParseResult<ListResourceArticle, SDKValidationError> {
77
- return safeParse(
78
- jsonString,
79
- (x) => ListResourceArticle$inboundSchema.parse(JSON.parse(x)),
80
- `Failed to parse 'ListResourceArticle' from JSON`,
81
- );
82
- }
@@ -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
- }