@foru-ms/sdk 2.1.0 → 2.1.1

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 (272) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +4 -1
  3. package/dist/cjs/Client.js +16 -11
  4. package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/auth/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/index.d.ts +3 -0
  7. package/dist/cjs/api/resources/index.js +4 -1
  8. package/dist/cjs/api/resources/integrations/client/Client.d.ts +1 -1
  9. package/dist/cjs/api/resources/integrations/client/Client.js +6 -9
  10. package/dist/cjs/api/resources/integrations/client/requests/CreateIntegrationsRequest.d.ts +2 -0
  11. package/dist/cjs/api/resources/integrations/client/requests/ListIntegrationsRequest.d.ts +2 -2
  12. package/dist/cjs/api/resources/integrations/client/requests/UpdateIntegrationsRequest.d.ts +2 -0
  13. package/dist/cjs/api/resources/integrations/types/UpdateIntegrationsResponse.d.ts +2 -0
  14. package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -1
  15. package/dist/cjs/api/resources/notifications/client/Client.js +7 -14
  16. package/dist/cjs/api/resources/notifications/client/requests/index.d.ts +2 -2
  17. package/dist/cjs/api/resources/notifications/client/requests/index.js +5 -0
  18. package/dist/cjs/api/resources/posts/client/Client.d.ts +1 -1
  19. package/dist/cjs/api/resources/posts/client/Client.js +22 -49
  20. package/dist/cjs/api/resources/posts/client/requests/index.d.ts +1 -1
  21. package/dist/cjs/api/resources/posts/client/requests/index.js +3 -0
  22. package/dist/cjs/api/resources/privateMessages/client/Client.d.ts +21 -1
  23. package/dist/cjs/api/resources/privateMessages/client/Client.js +79 -18
  24. package/dist/cjs/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.d.ts +16 -0
  25. package/dist/cjs/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.js +3 -0
  26. package/dist/cjs/api/resources/privateMessages/client/requests/index.d.ts +1 -0
  27. package/dist/cjs/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.d.ts +26 -0
  28. package/dist/cjs/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.js +3 -0
  29. package/dist/cjs/api/resources/privateMessages/types/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/privateMessages/types/index.js +1 -0
  31. package/dist/cjs/api/resources/reports/client/Client.d.ts +21 -1
  32. package/dist/cjs/api/resources/reports/client/Client.js +88 -17
  33. package/dist/cjs/api/resources/reports/client/requests/UpdateReportsRequest.d.ts +16 -0
  34. package/dist/cjs/api/resources/reports/client/requests/UpdateReportsRequest.js +3 -0
  35. package/dist/cjs/api/resources/reports/client/requests/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/reports/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/reports/index.js +1 -0
  38. package/dist/cjs/api/resources/reports/types/UpdateReportsResponse.d.ts +28 -0
  39. package/dist/cjs/api/resources/reports/types/UpdateReportsResponse.js +3 -0
  40. package/dist/cjs/api/resources/reports/types/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/reports/types/index.js +17 -0
  42. package/dist/cjs/api/resources/roles/client/Client.d.ts +1 -1
  43. package/dist/cjs/api/resources/roles/client/Client.js +8 -9
  44. package/dist/cjs/api/resources/roles/client/requests/ListRolesRequest.d.ts +7 -2
  45. package/dist/cjs/api/resources/roles/types/ListRolesRequestSort.d.ts +6 -0
  46. package/dist/cjs/api/resources/roles/types/ListRolesRequestSort.js +9 -0
  47. package/dist/cjs/api/resources/roles/types/index.d.ts +1 -0
  48. package/dist/cjs/api/resources/roles/types/index.js +1 -0
  49. package/dist/cjs/api/resources/search/client/Client.d.ts +29 -0
  50. package/dist/cjs/api/resources/search/client/Client.js +115 -0
  51. package/dist/cjs/api/resources/search/client/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/search/client/index.js +2 -0
  53. package/dist/cjs/api/resources/search/index.d.ts +2 -0
  54. package/dist/cjs/api/resources/search/index.js +18 -0
  55. package/dist/cjs/api/resources/search/types/SearchSearchResponse.d.ts +33 -0
  56. package/dist/cjs/api/resources/search/types/SearchSearchResponse.js +22 -0
  57. package/dist/cjs/api/resources/search/types/index.d.ts +1 -0
  58. package/dist/cjs/api/resources/search/types/index.js +17 -0
  59. package/dist/cjs/api/resources/ssOs/client/Client.d.ts +1 -1
  60. package/dist/cjs/api/resources/ssOs/client/Client.js +6 -9
  61. package/dist/cjs/api/resources/ssOs/client/requests/CreateSsOsRequest.d.ts +2 -0
  62. package/dist/cjs/api/resources/ssOs/client/requests/ListSsOsRequest.d.ts +2 -2
  63. package/dist/cjs/api/resources/ssOs/client/requests/UpdateSsOsRequest.d.ts +2 -0
  64. package/dist/cjs/api/resources/ssOs/types/UpdateSsOsResponse.d.ts +2 -0
  65. package/dist/cjs/api/resources/tags/client/Client.d.ts +1 -1
  66. package/dist/cjs/api/resources/tags/client/Client.js +10 -18
  67. package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
  68. package/dist/cjs/api/resources/threads/client/Client.js +26 -56
  69. package/dist/cjs/api/resources/threads/client/requests/CreateThreadsRequest.d.ts +6 -0
  70. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -1
  71. package/dist/cjs/api/resources/threads/client/requests/index.js +3 -0
  72. package/dist/cjs/api/resources/threads/types/UpdateThreadsResponse.d.ts +5 -5
  73. package/dist/cjs/api/resources/users/client/Client.d.ts +20 -1
  74. package/dist/cjs/api/resources/users/client/Client.js +80 -28
  75. package/dist/cjs/api/resources/users/client/requests/CreateUsersRequest.d.ts +26 -0
  76. package/dist/cjs/api/resources/users/client/requests/CreateUsersRequest.js +3 -0
  77. package/dist/cjs/api/resources/users/client/requests/index.d.ts +1 -0
  78. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +23 -1
  79. package/dist/cjs/api/resources/webhooks/client/Client.js +91 -15
  80. package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.ts +4 -0
  81. package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.ts +22 -0
  82. package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.js +3 -0
  83. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +1 -0
  84. package/dist/cjs/api/resources/webhooks/types/UpdateWebhooksResponse.d.ts +26 -0
  85. package/dist/cjs/api/resources/webhooks/types/UpdateWebhooksResponse.js +3 -0
  86. package/dist/cjs/api/resources/webhooks/types/index.d.ts +1 -0
  87. package/dist/cjs/api/resources/webhooks/types/index.js +1 -0
  88. package/dist/cjs/api/types/Integration.d.ts +2 -0
  89. package/dist/cjs/api/types/IntegrationCreate.d.ts +2 -0
  90. package/dist/cjs/api/types/IntegrationList.d.ts +6 -0
  91. package/dist/cjs/api/types/IntegrationList.js +3 -0
  92. package/dist/cjs/api/types/IntegrationListResponse.d.ts +2 -0
  93. package/dist/cjs/api/types/IntegrationResponse.d.ts +2 -0
  94. package/dist/cjs/api/types/IntegrationUpdate.d.ts +2 -0
  95. package/dist/cjs/api/types/MeResponse.d.ts +22 -0
  96. package/dist/cjs/api/types/PrivateMessageUpdate.d.ts +8 -0
  97. package/dist/cjs/api/types/PrivateMessageUpdate.js +3 -0
  98. package/dist/cjs/api/types/ReportUpdate.d.ts +8 -0
  99. package/dist/cjs/api/types/ReportUpdate.js +3 -0
  100. package/dist/cjs/api/types/RoleList.d.ts +19 -0
  101. package/dist/cjs/api/types/RoleList.js +13 -0
  102. package/dist/cjs/api/types/Search.d.ts +1 -0
  103. package/dist/cjs/api/types/Search.js +3 -0
  104. package/dist/cjs/api/types/SearchListResponse.d.ts +18 -0
  105. package/dist/cjs/api/types/SearchListResponse.js +3 -0
  106. package/dist/cjs/api/types/SearchResponse.d.ts +6 -0
  107. package/dist/cjs/api/types/SearchResponse.js +3 -0
  108. package/dist/cjs/api/types/Sso.d.ts +2 -0
  109. package/dist/cjs/api/types/SsoCreate.d.ts +2 -0
  110. package/dist/cjs/api/types/SsoList.d.ts +6 -0
  111. package/dist/cjs/api/types/SsoList.js +3 -0
  112. package/dist/cjs/api/types/SsoListResponse.d.ts +2 -0
  113. package/dist/cjs/api/types/SsoResponse.d.ts +2 -0
  114. package/dist/cjs/api/types/SsoUpdate.d.ts +2 -0
  115. package/dist/cjs/api/types/Thread.d.ts +5 -5
  116. package/dist/cjs/api/types/ThreadCreate.d.ts +6 -0
  117. package/dist/cjs/api/types/ThreadListResponse.d.ts +5 -5
  118. package/dist/cjs/api/types/ThreadResponse.d.ts +5 -5
  119. package/dist/cjs/api/types/UserCreate.d.ts +20 -0
  120. package/dist/cjs/api/types/UserCreate.js +3 -0
  121. package/dist/cjs/api/types/Webhook.d.ts +2 -0
  122. package/dist/cjs/api/types/WebhookCreate.d.ts +4 -0
  123. package/dist/cjs/api/types/WebhookListResponse.d.ts +2 -0
  124. package/dist/cjs/api/types/WebhookResponse.d.ts +2 -0
  125. package/dist/cjs/api/types/WebhookUpdate.d.ts +14 -0
  126. package/dist/cjs/api/types/WebhookUpdate.js +3 -0
  127. package/dist/cjs/api/types/index.d.ts +10 -0
  128. package/dist/cjs/api/types/index.js +10 -0
  129. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -10
  130. package/dist/cjs/auth/HeaderAuthProvider.js +18 -9
  131. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  132. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
  133. package/dist/cjs/core/headers.d.ts +2 -2
  134. package/dist/cjs/version.d.ts +1 -1
  135. package/dist/cjs/version.js +1 -1
  136. package/dist/esm/BaseClient.mjs +2 -2
  137. package/dist/esm/Client.d.mts +4 -1
  138. package/dist/esm/Client.mjs +6 -1
  139. package/dist/esm/api/resources/auth/client/Client.d.mts +1 -1
  140. package/dist/esm/api/resources/auth/client/Client.mjs +1 -1
  141. package/dist/esm/api/resources/index.d.mts +3 -0
  142. package/dist/esm/api/resources/index.mjs +3 -0
  143. package/dist/esm/api/resources/integrations/client/Client.d.mts +1 -1
  144. package/dist/esm/api/resources/integrations/client/Client.mjs +6 -9
  145. package/dist/esm/api/resources/integrations/client/requests/CreateIntegrationsRequest.d.mts +2 -0
  146. package/dist/esm/api/resources/integrations/client/requests/ListIntegrationsRequest.d.mts +2 -2
  147. package/dist/esm/api/resources/integrations/client/requests/UpdateIntegrationsRequest.d.mts +2 -0
  148. package/dist/esm/api/resources/integrations/types/UpdateIntegrationsResponse.d.mts +2 -0
  149. package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -1
  150. package/dist/esm/api/resources/notifications/client/Client.mjs +7 -14
  151. package/dist/esm/api/resources/notifications/client/requests/index.d.mts +2 -2
  152. package/dist/esm/api/resources/notifications/client/requests/index.mjs +2 -1
  153. package/dist/esm/api/resources/posts/client/Client.d.mts +1 -1
  154. package/dist/esm/api/resources/posts/client/Client.mjs +22 -49
  155. package/dist/esm/api/resources/posts/client/requests/index.d.mts +1 -1
  156. package/dist/esm/api/resources/posts/client/requests/index.mjs +1 -1
  157. package/dist/esm/api/resources/privateMessages/client/Client.d.mts +21 -1
  158. package/dist/esm/api/resources/privateMessages/client/Client.mjs +79 -18
  159. package/dist/esm/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.d.mts +16 -0
  160. package/dist/esm/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.mjs +2 -0
  161. package/dist/esm/api/resources/privateMessages/client/requests/index.d.mts +1 -0
  162. package/dist/esm/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.d.mts +26 -0
  163. package/dist/esm/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.mjs +2 -0
  164. package/dist/esm/api/resources/privateMessages/types/index.d.mts +1 -0
  165. package/dist/esm/api/resources/privateMessages/types/index.mjs +1 -0
  166. package/dist/esm/api/resources/reports/client/Client.d.mts +21 -1
  167. package/dist/esm/api/resources/reports/client/Client.mjs +88 -17
  168. package/dist/esm/api/resources/reports/client/requests/UpdateReportsRequest.d.mts +16 -0
  169. package/dist/esm/api/resources/reports/client/requests/UpdateReportsRequest.mjs +2 -0
  170. package/dist/esm/api/resources/reports/client/requests/index.d.mts +1 -0
  171. package/dist/esm/api/resources/reports/index.d.mts +1 -0
  172. package/dist/esm/api/resources/reports/index.mjs +1 -0
  173. package/dist/esm/api/resources/reports/types/UpdateReportsResponse.d.mts +28 -0
  174. package/dist/esm/api/resources/reports/types/UpdateReportsResponse.mjs +2 -0
  175. package/dist/esm/api/resources/reports/types/index.d.mts +1 -0
  176. package/dist/esm/api/resources/reports/types/index.mjs +1 -0
  177. package/dist/esm/api/resources/roles/client/Client.d.mts +1 -1
  178. package/dist/esm/api/resources/roles/client/Client.mjs +8 -9
  179. package/dist/esm/api/resources/roles/client/requests/ListRolesRequest.d.mts +7 -2
  180. package/dist/esm/api/resources/roles/types/ListRolesRequestSort.d.mts +6 -0
  181. package/dist/esm/api/resources/roles/types/ListRolesRequestSort.mjs +6 -0
  182. package/dist/esm/api/resources/roles/types/index.d.mts +1 -0
  183. package/dist/esm/api/resources/roles/types/index.mjs +1 -0
  184. package/dist/esm/api/resources/search/client/Client.d.mts +29 -0
  185. package/dist/esm/api/resources/search/client/Client.mjs +78 -0
  186. package/dist/esm/api/resources/search/client/index.d.mts +1 -0
  187. package/dist/esm/api/resources/search/client/index.mjs +1 -0
  188. package/dist/esm/api/resources/search/index.d.mts +2 -0
  189. package/dist/esm/api/resources/search/index.mjs +2 -0
  190. package/dist/esm/api/resources/search/types/SearchSearchResponse.d.mts +33 -0
  191. package/dist/esm/api/resources/search/types/SearchSearchResponse.mjs +19 -0
  192. package/dist/esm/api/resources/search/types/index.d.mts +1 -0
  193. package/dist/esm/api/resources/search/types/index.mjs +1 -0
  194. package/dist/esm/api/resources/ssOs/client/Client.d.mts +1 -1
  195. package/dist/esm/api/resources/ssOs/client/Client.mjs +6 -9
  196. package/dist/esm/api/resources/ssOs/client/requests/CreateSsOsRequest.d.mts +2 -0
  197. package/dist/esm/api/resources/ssOs/client/requests/ListSsOsRequest.d.mts +2 -2
  198. package/dist/esm/api/resources/ssOs/client/requests/UpdateSsOsRequest.d.mts +2 -0
  199. package/dist/esm/api/resources/ssOs/types/UpdateSsOsResponse.d.mts +2 -0
  200. package/dist/esm/api/resources/tags/client/Client.d.mts +1 -1
  201. package/dist/esm/api/resources/tags/client/Client.mjs +10 -18
  202. package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
  203. package/dist/esm/api/resources/threads/client/Client.mjs +26 -56
  204. package/dist/esm/api/resources/threads/client/requests/CreateThreadsRequest.d.mts +6 -0
  205. package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -1
  206. package/dist/esm/api/resources/threads/client/requests/index.mjs +1 -1
  207. package/dist/esm/api/resources/threads/types/UpdateThreadsResponse.d.mts +5 -5
  208. package/dist/esm/api/resources/users/client/Client.d.mts +20 -1
  209. package/dist/esm/api/resources/users/client/Client.mjs +80 -28
  210. package/dist/esm/api/resources/users/client/requests/CreateUsersRequest.d.mts +26 -0
  211. package/dist/esm/api/resources/users/client/requests/CreateUsersRequest.mjs +2 -0
  212. package/dist/esm/api/resources/users/client/requests/index.d.mts +1 -0
  213. package/dist/esm/api/resources/webhooks/client/Client.d.mts +23 -1
  214. package/dist/esm/api/resources/webhooks/client/Client.mjs +91 -15
  215. package/dist/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.mts +4 -0
  216. package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.mts +22 -0
  217. package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.mjs +2 -0
  218. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +1 -0
  219. package/dist/esm/api/resources/webhooks/types/UpdateWebhooksResponse.d.mts +26 -0
  220. package/dist/esm/api/resources/webhooks/types/UpdateWebhooksResponse.mjs +2 -0
  221. package/dist/esm/api/resources/webhooks/types/index.d.mts +1 -0
  222. package/dist/esm/api/resources/webhooks/types/index.mjs +1 -0
  223. package/dist/esm/api/types/Integration.d.mts +2 -0
  224. package/dist/esm/api/types/IntegrationCreate.d.mts +2 -0
  225. package/dist/esm/api/types/IntegrationList.d.mts +6 -0
  226. package/dist/esm/api/types/IntegrationList.mjs +2 -0
  227. package/dist/esm/api/types/IntegrationListResponse.d.mts +2 -0
  228. package/dist/esm/api/types/IntegrationResponse.d.mts +2 -0
  229. package/dist/esm/api/types/IntegrationUpdate.d.mts +2 -0
  230. package/dist/esm/api/types/MeResponse.d.mts +22 -0
  231. package/dist/esm/api/types/PrivateMessageUpdate.d.mts +8 -0
  232. package/dist/esm/api/types/PrivateMessageUpdate.mjs +2 -0
  233. package/dist/esm/api/types/ReportUpdate.d.mts +8 -0
  234. package/dist/esm/api/types/ReportUpdate.mjs +2 -0
  235. package/dist/esm/api/types/RoleList.d.mts +19 -0
  236. package/dist/esm/api/types/RoleList.mjs +10 -0
  237. package/dist/esm/api/types/Search.d.mts +1 -0
  238. package/dist/esm/api/types/Search.mjs +2 -0
  239. package/dist/esm/api/types/SearchListResponse.d.mts +18 -0
  240. package/dist/esm/api/types/SearchListResponse.mjs +2 -0
  241. package/dist/esm/api/types/SearchResponse.d.mts +6 -0
  242. package/dist/esm/api/types/SearchResponse.mjs +2 -0
  243. package/dist/esm/api/types/Sso.d.mts +2 -0
  244. package/dist/esm/api/types/SsoCreate.d.mts +2 -0
  245. package/dist/esm/api/types/SsoList.d.mts +6 -0
  246. package/dist/esm/api/types/SsoList.mjs +2 -0
  247. package/dist/esm/api/types/SsoListResponse.d.mts +2 -0
  248. package/dist/esm/api/types/SsoResponse.d.mts +2 -0
  249. package/dist/esm/api/types/SsoUpdate.d.mts +2 -0
  250. package/dist/esm/api/types/Thread.d.mts +5 -5
  251. package/dist/esm/api/types/ThreadCreate.d.mts +6 -0
  252. package/dist/esm/api/types/ThreadListResponse.d.mts +5 -5
  253. package/dist/esm/api/types/ThreadResponse.d.mts +5 -5
  254. package/dist/esm/api/types/UserCreate.d.mts +20 -0
  255. package/dist/esm/api/types/UserCreate.mjs +2 -0
  256. package/dist/esm/api/types/Webhook.d.mts +2 -0
  257. package/dist/esm/api/types/WebhookCreate.d.mts +4 -0
  258. package/dist/esm/api/types/WebhookListResponse.d.mts +2 -0
  259. package/dist/esm/api/types/WebhookResponse.d.mts +2 -0
  260. package/dist/esm/api/types/WebhookUpdate.d.mts +14 -0
  261. package/dist/esm/api/types/WebhookUpdate.mjs +2 -0
  262. package/dist/esm/api/types/index.d.mts +10 -0
  263. package/dist/esm/api/types/index.mjs +10 -0
  264. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -10
  265. package/dist/esm/auth/HeaderAuthProvider.mjs +18 -9
  266. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  267. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
  268. package/dist/esm/core/headers.d.mts +2 -2
  269. package/dist/esm/version.d.mts +1 -1
  270. package/dist/esm/version.mjs +1 -1
  271. package/package.json +2 -2
  272. package/reference.md +304 -0
@@ -0,0 +1,78 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as Forum from "../../../index.mjs";
18
+ /**
19
+ * Operations for search
20
+ */
21
+ export class SearchClient {
22
+ constructor(options = {}) {
23
+ this._options = normalizeClientOptions(options);
24
+ }
25
+ /**
26
+ * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Forum.BadRequestError}
29
+ * @throws {@link Forum.PaymentRequiredError}
30
+ * @throws {@link Forum.TooManyRequestsError}
31
+ * @throws {@link Forum.InternalServerError}
32
+ *
33
+ * @example
34
+ * await client.search.search()
35
+ */
36
+ search(requestOptions) {
37
+ return core.HttpResponsePromise.fromPromise(this.__search(requestOptions));
38
+ }
39
+ __search(requestOptions) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
42
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
43
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
44
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "search/"),
45
+ method: "GET",
46
+ headers: _headers,
47
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
48
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
49
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
50
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
51
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
52
+ logging: this._options.logging,
53
+ });
54
+ if (_response.ok) {
55
+ return { data: _response.body, rawResponse: _response.rawResponse };
56
+ }
57
+ if (_response.error.reason === "status-code") {
58
+ switch (_response.error.statusCode) {
59
+ case 400:
60
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
61
+ case 402:
62
+ throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
63
+ case 429:
64
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
65
+ case 500:
66
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
67
+ default:
68
+ throw new errors.ForumError({
69
+ statusCode: _response.error.statusCode,
70
+ body: _response.error.body,
71
+ rawResponse: _response.rawResponse,
72
+ });
73
+ }
74
+ }
75
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/search/");
76
+ });
77
+ }
78
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,33 @@
1
+ export interface SearchSearchResponse {
2
+ data?: SearchSearchResponse.Data;
3
+ }
4
+ export declare namespace SearchSearchResponse {
5
+ interface Data {
6
+ items: Data.Items.Item[];
7
+ nextCursor: string | null;
8
+ hasMore: boolean;
9
+ }
10
+ namespace Data {
11
+ type Items = Items.Item[];
12
+ namespace Items {
13
+ interface Item {
14
+ type: Item.Type;
15
+ id: string;
16
+ title?: string;
17
+ body?: string;
18
+ username?: string;
19
+ name?: string;
20
+ createdAt?: string;
21
+ }
22
+ namespace Item {
23
+ const Type: {
24
+ readonly Thread: "thread";
25
+ readonly Post: "post";
26
+ readonly User: "user";
27
+ readonly Tag: "tag";
28
+ };
29
+ type Type = (typeof Type)[keyof typeof Type];
30
+ }
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,19 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var SearchSearchResponse;
3
+ (function (SearchSearchResponse) {
4
+ let Data;
5
+ (function (Data) {
6
+ let Items;
7
+ (function (Items) {
8
+ let Item;
9
+ (function (Item) {
10
+ Item.Type = {
11
+ Thread: "thread",
12
+ Post: "post",
13
+ User: "user",
14
+ Tag: "tag",
15
+ };
16
+ })(Item = Items.Item || (Items.Item = {}));
17
+ })(Items = Data.Items || (Data.Items = {}));
18
+ })(Data = SearchSearchResponse.Data || (SearchSearchResponse.Data = {}));
19
+ })(SearchSearchResponse || (SearchSearchResponse = {}));
@@ -0,0 +1 @@
1
+ export * from "./SearchSearchResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./SearchSearchResponse.mjs";
@@ -12,7 +12,7 @@ export declare namespace SsOsClient {
12
12
  */
13
13
  export declare class SsOsClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<SsOsClient.Options>;
15
- constructor(options: SsOsClient.Options);
15
+ constructor(options?: SsOsClient.Options);
16
16
  /**
17
17
  * Retrieve a paginated list of ssos. Use cursor for pagination.
18
18
  *
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
30
30
  * Operations for sso
31
31
  */
32
32
  export class SsOsClient {
33
- constructor(options) {
33
+ constructor(options = {}) {
34
34
  this._options = normalizeClientOptionsWithAuth(options);
35
35
  }
36
36
  /**
@@ -55,14 +55,11 @@ export class SsOsClient {
55
55
  __list() {
56
56
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
57
57
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
58
- const { cursor, limit } = request;
59
- const _queryParams = {};
60
- if (cursor != null) {
61
- _queryParams.cursor = cursor;
62
- }
63
- if (limit != null) {
64
- _queryParams.limit = limit.toString();
65
- }
58
+ const { limit, cursor } = request;
59
+ const _queryParams = {
60
+ limit,
61
+ cursor,
62
+ };
66
63
  const _authRequest = yield this._options.authProvider.getAuthRequest();
67
64
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
68
65
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -19,4 +19,6 @@ export interface CreateSsOsRequest {
19
19
  authorizationEndpoint: string;
20
20
  tokenEndpoint: string;
21
21
  userInfoEndpoint: string;
22
+ /** Custom extended data */
23
+ extendedData?: Record<string, unknown>;
22
24
  }
@@ -3,8 +3,8 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListSsOsRequest {
6
- /** Pagination cursor */
7
- cursor?: string;
8
6
  /** Items per page (max 75) */
9
7
  limit?: number;
8
+ /** Cursor for pagination */
9
+ cursor?: string;
10
10
  }
@@ -19,4 +19,6 @@ export interface UpdateSsOsRequest {
19
19
  userInfoEndpoint?: string;
20
20
  /** Enable/disable provider */
21
21
  active?: boolean;
22
+ /** Custom extended data */
23
+ extendedData?: Record<string, unknown>;
22
24
  }
@@ -10,6 +10,8 @@ export declare namespace UpdateSsOsResponse {
10
10
  domain: string;
11
11
  /** Whether SSO is active */
12
12
  active: boolean;
13
+ /** Custom extended data */
14
+ extendedData: Record<string, unknown> | null;
13
15
  /** SSO configuration creation timestamp */
14
16
  createdAt: string;
15
17
  /** SSO configuration last update timestamp */
@@ -12,7 +12,7 @@ export declare namespace TagsClient {
12
12
  */
13
13
  export declare class TagsClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<TagsClient.Options>;
15
- constructor(options: TagsClient.Options);
15
+ constructor(options?: TagsClient.Options);
16
16
  /**
17
17
  * Retrieve a paginated list of tags. Use cursor for pagination.
18
18
  *
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
30
30
  * Operations for tags
31
31
  */
32
32
  export class TagsClient {
33
- constructor(options) {
33
+ constructor(options = {}) {
34
34
  this._options = normalizeClientOptionsWithAuth(options);
35
35
  }
36
36
  /**
@@ -54,16 +54,11 @@ export class TagsClient {
54
54
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
55
55
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
56
56
  const { limit, cursor, search } = request;
57
- const _queryParams = {};
58
- if (limit != null) {
59
- _queryParams.limit = limit.toString();
60
- }
61
- if (cursor != null) {
62
- _queryParams.cursor = cursor;
63
- }
64
- if (search != null) {
65
- _queryParams.search = search;
66
- }
57
+ const _queryParams = {
58
+ limit,
59
+ cursor,
60
+ search,
61
+ };
67
62
  const _authRequest = yield this._options.authProvider.getAuthRequest();
68
63
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
69
64
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -384,13 +379,10 @@ export class TagsClient {
384
379
  return __awaiter(this, void 0, void 0, function* () {
385
380
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
386
381
  const { id, limit, cursor } = request;
387
- const _queryParams = {};
388
- if (limit != null) {
389
- _queryParams.limit = limit.toString();
390
- }
391
- if (cursor != null) {
392
- _queryParams.cursor = cursor;
393
- }
382
+ const _queryParams = {
383
+ limit,
384
+ cursor,
385
+ };
394
386
  const _authRequest = yield this._options.authProvider.getAuthRequest();
395
387
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
396
388
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -12,7 +12,7 @@ export declare namespace ThreadsClient {
12
12
  */
13
13
  export declare class ThreadsClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
15
- constructor(options: ThreadsClient.Options);
15
+ constructor(options?: ThreadsClient.Options);
16
16
  /**
17
17
  * Retrieve a paginated list of threads. Use cursor for pagination.
18
18
  *
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
30
30
  * Operations for threads
31
31
  */
32
32
  export class ThreadsClient {
33
- constructor(options) {
33
+ constructor(options = {}) {
34
34
  this._options = normalizeClientOptionsWithAuth(options);
35
35
  }
36
36
  /**
@@ -54,25 +54,14 @@ export class ThreadsClient {
54
54
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
55
55
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
56
56
  const { limit, cursor, search, tagId, userId, sort } = request;
57
- const _queryParams = {};
58
- if (limit != null) {
59
- _queryParams.limit = limit.toString();
60
- }
61
- if (cursor != null) {
62
- _queryParams.cursor = cursor;
63
- }
64
- if (search != null) {
65
- _queryParams.search = search;
66
- }
67
- if (tagId != null) {
68
- _queryParams.tagId = tagId;
69
- }
70
- if (userId != null) {
71
- _queryParams.userId = userId;
72
- }
73
- if (sort != null) {
74
- _queryParams.sort = sort;
75
- }
57
+ const _queryParams = {
58
+ limit,
59
+ cursor,
60
+ search,
61
+ tagId,
62
+ userId,
63
+ sort: sort != null ? sort : undefined,
64
+ };
76
65
  const _authRequest = yield this._options.authProvider.getAuthRequest();
77
66
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
78
67
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -394,25 +383,14 @@ export class ThreadsClient {
394
383
  return __awaiter(this, void 0, void 0, function* () {
395
384
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
396
385
  const { id, limit, cursor, userId, sort, search, type: type_ } = request;
397
- const _queryParams = {};
398
- if (limit != null) {
399
- _queryParams.limit = limit.toString();
400
- }
401
- if (cursor != null) {
402
- _queryParams.cursor = cursor;
403
- }
404
- if (userId != null) {
405
- _queryParams.userId = userId;
406
- }
407
- if (sort != null) {
408
- _queryParams.sort = sort;
409
- }
410
- if (search != null) {
411
- _queryParams.search = search;
412
- }
413
- if (type_ != null) {
414
- _queryParams.type = type_;
415
- }
386
+ const _queryParams = {
387
+ limit,
388
+ cursor,
389
+ userId,
390
+ sort: sort != null ? sort : undefined,
391
+ search,
392
+ type: type_ != null ? type_ : undefined,
393
+ };
416
394
  const _authRequest = yield this._options.authProvider.getAuthRequest();
417
395
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
418
396
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -591,16 +569,11 @@ export class ThreadsClient {
591
569
  return __awaiter(this, void 0, void 0, function* () {
592
570
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
593
571
  const { id, limit, cursor, type: type_ } = request;
594
- const _queryParams = {};
595
- if (limit != null) {
596
- _queryParams.limit = limit.toString();
597
- }
598
- if (cursor != null) {
599
- _queryParams.cursor = cursor;
600
- }
601
- if (type_ != null) {
602
- _queryParams.type = type_;
603
- }
572
+ const _queryParams = {
573
+ limit,
574
+ cursor,
575
+ type: type_ != null ? type_ : undefined,
576
+ };
604
577
  const _authRequest = yield this._options.authProvider.getAuthRequest();
605
578
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
606
579
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -849,13 +822,10 @@ export class ThreadsClient {
849
822
  return __awaiter(this, void 0, void 0, function* () {
850
823
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
851
824
  const { id, limit, cursor } = request;
852
- const _queryParams = {};
853
- if (limit != null) {
854
- _queryParams.limit = limit.toString();
855
- }
856
- if (cursor != null) {
857
- _queryParams.cursor = cursor;
858
- }
825
+ const _queryParams = {
826
+ limit,
827
+ cursor,
828
+ };
859
829
  const _authRequest = yield this._options.authProvider.getAuthRequest();
860
830
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
861
831
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -16,6 +16,12 @@ export interface CreateThreadsRequest {
16
16
  tags?: string[];
17
17
  /** Poll data */
18
18
  poll?: CreateThreadsRequest.Poll;
19
+ /** Lock thread on creation */
20
+ locked?: boolean;
21
+ /** Pin thread on creation */
22
+ pinned?: boolean;
23
+ /** Custom extended data */
24
+ extendedData?: Record<string, unknown>;
19
25
  }
20
26
  export declare namespace CreateThreadsRequest {
21
27
  /**
@@ -1,5 +1,5 @@
1
1
  export type { CreatePollThreadsRequest } from "./CreatePollThreadsRequest.mjs";
2
- export type { CreateReactionThreadsRequest } from "./CreateReactionThreadsRequest.mjs";
2
+ export { CreateReactionThreadsRequest } from "./CreateReactionThreadsRequest.mjs";
3
3
  export type { CreateThreadsRequest } from "./CreateThreadsRequest.mjs";
4
4
  export type { DeletePostThreadsRequest } from "./DeletePostThreadsRequest.mjs";
5
5
  export type { DeleteReactionThreadsRequest } from "./DeleteReactionThreadsRequest.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export { CreateReactionThreadsRequest } from "./CreateReactionThreadsRequest.mjs";
@@ -13,21 +13,21 @@ export declare namespace UpdateThreadsResponse {
13
13
  tags?: string[];
14
14
  /** Poll data */
15
15
  poll?: Data.Poll;
16
- id: string;
17
- /** URL-friendly identifier */
18
- slug: string | null;
19
16
  /** Whether thread is locked */
20
17
  locked: boolean | null;
21
18
  /** Whether thread is pinned */
22
19
  pinned: boolean | null;
20
+ /** Custom metadata */
21
+ extendedData: Record<string, unknown> | null;
22
+ id: string;
23
+ /** URL-friendly identifier */
24
+ slug: string | null;
23
25
  /** View count */
24
26
  views: number;
25
27
  /** Number of posts/replies */
26
28
  postsCount: number;
27
29
  /** Timestamp of the last post */
28
30
  lastPostAt: string | null;
29
- /** Custom metadata */
30
- extendedData: Record<string, unknown> | null;
31
31
  createdAt: string;
32
32
  updatedAt: string;
33
33
  }
@@ -12,7 +12,7 @@ export declare namespace UsersClient {
12
12
  */
13
13
  export declare class UsersClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
15
- constructor(options: UsersClient.Options);
15
+ constructor(options?: UsersClient.Options);
16
16
  /**
17
17
  * Retrieve a paginated list of users. Use cursor for pagination.
18
18
  *
@@ -29,6 +29,25 @@ export declare class UsersClient {
29
29
  */
30
30
  list(request?: Forum.ListUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserListResponse>;
31
31
  private __list;
32
+ /**
33
+ * Create a new user.
34
+ *
35
+ * @param {Forum.CreateUsersRequest} request
36
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link Forum.BadRequestError}
39
+ * @throws {@link Forum.UnauthorizedError}
40
+ * @throws {@link Forum.PaymentRequiredError}
41
+ * @throws {@link Forum.TooManyRequestsError}
42
+ * @throws {@link Forum.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.users.create({
46
+ * username: "username"
47
+ * })
48
+ */
49
+ create(request: Forum.CreateUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserResponse>;
50
+ private __create;
32
51
  /**
33
52
  * Retrieve a user by ID or slug (if supported).
34
53
  *
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
30
30
  * Operations for users
31
31
  */
32
32
  export class UsersClient {
33
- constructor(options) {
33
+ constructor(options = {}) {
34
34
  this._options = normalizeClientOptionsWithAuth(options);
35
35
  }
36
36
  /**
@@ -54,19 +54,12 @@ export class UsersClient {
54
54
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
55
55
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
56
56
  const { limit, cursor, search, sort } = request;
57
- const _queryParams = {};
58
- if (limit != null) {
59
- _queryParams.limit = limit.toString();
60
- }
61
- if (cursor != null) {
62
- _queryParams.cursor = cursor;
63
- }
64
- if (search != null) {
65
- _queryParams.search = search;
66
- }
67
- if (sort != null) {
68
- _queryParams.sort = sort;
69
- }
57
+ const _queryParams = {
58
+ limit,
59
+ cursor,
60
+ search,
61
+ sort: sort != null ? sort : undefined,
62
+ };
70
63
  const _authRequest = yield this._options.authProvider.getAuthRequest();
71
64
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
72
65
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -104,6 +97,71 @@ export class UsersClient {
104
97
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/users");
105
98
  });
106
99
  }
100
+ /**
101
+ * Create a new user.
102
+ *
103
+ * @param {Forum.CreateUsersRequest} request
104
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
105
+ *
106
+ * @throws {@link Forum.BadRequestError}
107
+ * @throws {@link Forum.UnauthorizedError}
108
+ * @throws {@link Forum.PaymentRequiredError}
109
+ * @throws {@link Forum.TooManyRequestsError}
110
+ * @throws {@link Forum.InternalServerError}
111
+ *
112
+ * @example
113
+ * await client.users.create({
114
+ * username: "username"
115
+ * })
116
+ */
117
+ create(request, requestOptions) {
118
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
119
+ }
120
+ __create(request, requestOptions) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
123
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
124
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
125
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
126
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "users"),
127
+ method: "POST",
128
+ headers: _headers,
129
+ contentType: "application/json",
130
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
131
+ requestType: "json",
132
+ body: request,
133
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
134
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
135
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
136
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
137
+ logging: this._options.logging,
138
+ });
139
+ if (_response.ok) {
140
+ return { data: _response.body, rawResponse: _response.rawResponse };
141
+ }
142
+ if (_response.error.reason === "status-code") {
143
+ switch (_response.error.statusCode) {
144
+ case 400:
145
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
146
+ case 401:
147
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
148
+ case 402:
149
+ throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
150
+ case 429:
151
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
152
+ case 500:
153
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
154
+ default:
155
+ throw new errors.ForumError({
156
+ statusCode: _response.error.statusCode,
157
+ body: _response.error.body,
158
+ rawResponse: _response.rawResponse,
159
+ });
160
+ }
161
+ }
162
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/users");
163
+ });
164
+ }
107
165
  /**
108
166
  * Retrieve a user by ID or slug (if supported).
109
167
  *
@@ -322,13 +380,10 @@ export class UsersClient {
322
380
  return __awaiter(this, void 0, void 0, function* () {
323
381
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
324
382
  const { id, limit, cursor } = request;
325
- const _queryParams = {};
326
- if (limit != null) {
327
- _queryParams.limit = limit.toString();
328
- }
329
- if (cursor != null) {
330
- _queryParams.cursor = cursor;
331
- }
383
+ const _queryParams = {
384
+ limit,
385
+ cursor,
386
+ };
332
387
  const _authRequest = yield this._options.authProvider.getAuthRequest();
333
388
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
334
389
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -507,13 +562,10 @@ export class UsersClient {
507
562
  return __awaiter(this, void 0, void 0, function* () {
508
563
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
509
564
  const { id, limit, cursor } = request;
510
- const _queryParams = {};
511
- if (limit != null) {
512
- _queryParams.limit = limit.toString();
513
- }
514
- if (cursor != null) {
515
- _queryParams.cursor = cursor;
516
- }
565
+ const _queryParams = {
566
+ limit,
567
+ cursor,
568
+ };
517
569
  const _authRequest = yield this._options.authProvider.getAuthRequest();
518
570
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
519
571
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({