lemmy-js-client 0.17.0-rc.9 → 0.17.2-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (521) hide show
  1. package/README.md +24 -5
  2. package/dist/http.d.ts +351 -21
  3. package/dist/http.js +407 -389
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +5 -2
  6. package/dist/types/AddAdmin.d.ts +6 -0
  7. package/dist/types/AddAdminResponse.d.ts +4 -0
  8. package/dist/types/AddModToCommunity.d.ts +8 -0
  9. package/dist/types/AddModToCommunityResponse.d.ts +4 -0
  10. package/dist/types/AdminPurgeComment.d.ts +9 -0
  11. package/dist/types/AdminPurgeCommentView.d.ts +8 -0
  12. package/dist/types/AdminPurgeCommunity.d.ts +7 -0
  13. package/dist/types/AdminPurgeCommunityView.d.ts +6 -0
  14. package/dist/types/AdminPurgePerson.d.ts +7 -0
  15. package/dist/types/AdminPurgePersonView.d.ts +6 -0
  16. package/dist/types/AdminPurgePersonView.js +2 -0
  17. package/dist/types/AdminPurgePost.d.ts +9 -0
  18. package/dist/types/AdminPurgePost.js +2 -0
  19. package/dist/types/AdminPurgePostView.d.ts +8 -0
  20. package/dist/types/AdminPurgePostView.js +2 -0
  21. package/dist/types/ApproveRegistrationApplication.d.ts +6 -0
  22. package/dist/types/ApproveRegistrationApplication.js +3 -0
  23. package/dist/types/BanFromCommunity.d.ts +11 -0
  24. package/dist/types/BanFromCommunity.js +2 -0
  25. package/dist/types/BanFromCommunityResponse.d.ts +5 -0
  26. package/dist/types/BanFromCommunityResponse.js +2 -0
  27. package/dist/types/BanPerson.d.ts +9 -0
  28. package/dist/types/BanPerson.js +2 -0
  29. package/dist/types/BanPersonResponse.d.ts +5 -0
  30. package/dist/types/BanPersonResponse.js +2 -0
  31. package/dist/types/BannedPersonsResponse.d.ts +4 -0
  32. package/dist/types/BannedPersonsResponse.js +2 -0
  33. package/dist/types/BlockCommunity.d.ts +6 -0
  34. package/dist/types/BlockCommunity.js +2 -0
  35. package/dist/types/BlockCommunityResponse.d.ts +5 -0
  36. package/dist/types/BlockCommunityResponse.js +2 -0
  37. package/dist/types/BlockPerson.d.ts +6 -0
  38. package/dist/types/BlockPerson.js +2 -0
  39. package/dist/types/BlockPersonResponse.d.ts +5 -0
  40. package/dist/types/BlockPersonResponse.js +2 -0
  41. package/dist/types/CaptchaResponse.d.ts +5 -0
  42. package/dist/types/CaptchaResponse.js +3 -0
  43. package/dist/types/ChangePassword.d.ts +6 -0
  44. package/dist/types/ChangePassword.js +3 -0
  45. package/dist/types/Comment.d.ts +19 -0
  46. package/dist/types/Comment.js +2 -0
  47. package/dist/types/CommentAggregates.d.ts +10 -0
  48. package/dist/types/CommentAggregates.js +2 -0
  49. package/dist/types/CommentId.d.ts +1 -0
  50. package/dist/types/CommentId.js +3 -0
  51. package/dist/types/CommentReply.d.ts +10 -0
  52. package/dist/types/CommentReply.js +2 -0
  53. package/dist/types/CommentReplyId.d.ts +1 -0
  54. package/dist/types/CommentReplyId.js +3 -0
  55. package/dist/types/CommentReplyResponse.d.ts +4 -0
  56. package/dist/types/CommentReplyResponse.js +2 -0
  57. package/dist/types/CommentReplyView.d.ts +21 -0
  58. package/dist/types/CommentReplyView.js +2 -0
  59. package/dist/types/CommentReport.d.ts +14 -0
  60. package/dist/types/CommentReport.js +2 -0
  61. package/dist/types/CommentReportId.d.ts +1 -0
  62. package/dist/types/CommentReportId.js +3 -0
  63. package/dist/types/CommentReportResponse.d.ts +4 -0
  64. package/dist/types/CommentReportResponse.js +2 -0
  65. package/dist/types/CommentReportView.d.ts +18 -0
  66. package/dist/types/CommentReportView.js +2 -0
  67. package/dist/types/CommentResponse.d.ts +7 -0
  68. package/dist/types/CommentResponse.js +2 -0
  69. package/dist/types/CommentSortType.d.ts +1 -0
  70. package/dist/types/CommentSortType.js +3 -0
  71. package/dist/types/CommentView.d.ts +18 -0
  72. package/dist/types/CommentView.js +2 -0
  73. package/dist/types/Community.d.ts +20 -0
  74. package/dist/types/Community.js +2 -0
  75. package/dist/types/CommunityAggregates.d.ts +13 -0
  76. package/dist/types/CommunityAggregates.js +2 -0
  77. package/dist/types/CommunityBlockId.d.ts +1 -0
  78. package/dist/types/CommunityBlockId.js +3 -0
  79. package/dist/types/CommunityBlockView.d.ts +6 -0
  80. package/dist/types/CommunityBlockView.js +2 -0
  81. package/dist/types/CommunityFollowerView.d.ts +6 -0
  82. package/dist/types/CommunityFollowerView.js +2 -0
  83. package/dist/types/CommunityId.d.ts +1 -0
  84. package/dist/types/CommunityId.js +3 -0
  85. package/dist/types/CommunityJoin.d.ts +4 -0
  86. package/dist/types/CommunityJoin.js +2 -0
  87. package/dist/types/CommunityJoinResponse.d.ts +3 -0
  88. package/dist/types/CommunityJoinResponse.js +3 -0
  89. package/dist/types/CommunityModeratorView.d.ts +6 -0
  90. package/dist/types/CommunityModeratorView.js +2 -0
  91. package/dist/types/CommunityResponse.d.ts +6 -0
  92. package/dist/types/CommunityResponse.js +2 -0
  93. package/dist/types/CommunityView.d.ts +9 -0
  94. package/dist/types/CommunityView.js +2 -0
  95. package/dist/types/CreateComment.d.ts +11 -0
  96. package/dist/types/CreateComment.js +2 -0
  97. package/dist/types/CreateCommentLike.d.ts +6 -0
  98. package/dist/types/CreateCommentLike.js +2 -0
  99. package/dist/types/CreateCommentReport.d.ts +6 -0
  100. package/dist/types/CreateCommentReport.js +2 -0
  101. package/dist/types/CreateCommunity.d.ts +12 -0
  102. package/dist/types/CreateCommunity.js +2 -0
  103. package/dist/types/CreateCustomEmoji.d.ts +8 -0
  104. package/dist/types/CreateCustomEmoji.js +3 -0
  105. package/dist/types/CreatePost.d.ts +12 -0
  106. package/dist/types/CreatePost.js +2 -0
  107. package/dist/types/CreatePostLike.d.ts +6 -0
  108. package/dist/types/CreatePostLike.js +2 -0
  109. package/dist/types/CreatePostReport.d.ts +6 -0
  110. package/dist/types/CreatePostReport.js +2 -0
  111. package/dist/types/CreatePrivateMessage.d.ts +6 -0
  112. package/dist/types/CreatePrivateMessage.js +2 -0
  113. package/dist/types/CreatePrivateMessageReport.d.ts +6 -0
  114. package/dist/types/CreatePrivateMessageReport.js +2 -0
  115. package/dist/types/CreateSite.d.ts +46 -0
  116. package/dist/types/CreateSite.js +2 -0
  117. package/dist/types/CustomEmoji.d.ts +12 -0
  118. package/dist/types/CustomEmoji.js +2 -0
  119. package/dist/types/CustomEmojiId.d.ts +1 -0
  120. package/dist/types/CustomEmojiId.js +3 -0
  121. package/dist/types/CustomEmojiKeyword.d.ts +6 -0
  122. package/dist/types/CustomEmojiKeyword.js +2 -0
  123. package/dist/types/CustomEmojiResponse.d.ts +4 -0
  124. package/dist/types/CustomEmojiResponse.js +2 -0
  125. package/dist/types/CustomEmojiView.d.ts +6 -0
  126. package/dist/types/CustomEmojiView.js +2 -0
  127. package/dist/types/DeleteAccount.d.ts +4 -0
  128. package/dist/types/DeleteAccount.js +3 -0
  129. package/dist/types/DeleteAccountResponse.d.ts +1 -0
  130. package/dist/types/DeleteAccountResponse.js +3 -0
  131. package/dist/types/DeleteComment.d.ts +6 -0
  132. package/dist/types/DeleteComment.js +2 -0
  133. package/dist/types/DeleteCommunity.d.ts +6 -0
  134. package/dist/types/DeleteCommunity.js +2 -0
  135. package/dist/types/DeleteCustomEmoji.d.ts +5 -0
  136. package/dist/types/DeleteCustomEmoji.js +2 -0
  137. package/dist/types/DeleteCustomEmojiResponse.d.ts +5 -0
  138. package/dist/types/DeleteCustomEmojiResponse.js +2 -0
  139. package/dist/types/DeletePost.d.ts +6 -0
  140. package/dist/types/DeletePost.js +2 -0
  141. package/dist/types/DeletePrivateMessage.d.ts +6 -0
  142. package/dist/types/DeletePrivateMessage.js +2 -0
  143. package/dist/types/DistinguishComment.d.ts +6 -0
  144. package/dist/types/DistinguishComment.js +2 -0
  145. package/dist/types/EditComment.d.ts +9 -0
  146. package/dist/types/EditComment.js +2 -0
  147. package/dist/types/EditCommunity.d.ts +13 -0
  148. package/dist/types/EditCommunity.js +2 -0
  149. package/dist/types/EditCustomEmoji.d.ts +9 -0
  150. package/dist/types/EditCustomEmoji.js +2 -0
  151. package/dist/types/EditPost.d.ts +11 -0
  152. package/dist/types/EditPost.js +2 -0
  153. package/dist/types/EditPrivateMessage.d.ts +6 -0
  154. package/dist/types/EditPrivateMessage.js +2 -0
  155. package/dist/types/EditSite.d.ts +47 -0
  156. package/dist/types/EditSite.js +2 -0
  157. package/dist/types/FeaturePost.d.ts +8 -0
  158. package/dist/types/FeaturePost.js +2 -0
  159. package/dist/types/FederatedInstances.d.ts +6 -0
  160. package/dist/types/FederatedInstances.js +2 -0
  161. package/dist/types/FollowCommunity.d.ts +6 -0
  162. package/dist/types/FollowCommunity.js +2 -0
  163. package/dist/types/GetBannedPersons.d.ts +3 -0
  164. package/dist/types/GetBannedPersons.js +3 -0
  165. package/dist/types/GetCaptcha.d.ts +1 -0
  166. package/dist/types/GetCaptcha.js +3 -0
  167. package/dist/types/GetCaptchaResponse.d.ts +4 -0
  168. package/dist/types/GetCaptchaResponse.js +2 -0
  169. package/dist/types/GetComment.d.ts +5 -0
  170. package/dist/types/GetComment.js +2 -0
  171. package/dist/types/GetComments.d.ts +18 -0
  172. package/dist/types/GetComments.js +2 -0
  173. package/dist/types/GetCommentsResponse.d.ts +4 -0
  174. package/dist/types/GetCommentsResponse.js +2 -0
  175. package/dist/types/GetCommunity.d.ts +6 -0
  176. package/dist/types/GetCommunity.js +2 -0
  177. package/dist/types/GetCommunityResponse.d.ts +12 -0
  178. package/dist/types/GetCommunityResponse.js +2 -0
  179. package/dist/types/GetFederatedInstances.d.ts +1 -0
  180. package/dist/types/GetFederatedInstances.js +3 -0
  181. package/dist/types/GetFederatedInstancesResponse.d.ts +4 -0
  182. package/dist/types/GetFederatedInstancesResponse.js +2 -0
  183. package/dist/types/GetModlog.d.ts +12 -0
  184. package/dist/types/GetModlog.js +2 -0
  185. package/dist/types/GetModlogResponse.d.ts +32 -0
  186. package/dist/types/GetModlogResponse.js +2 -0
  187. package/dist/types/GetPersonDetails.d.ts +13 -0
  188. package/dist/types/GetPersonDetails.js +2 -0
  189. package/dist/types/GetPersonDetailsResponse.d.ts +10 -0
  190. package/dist/types/GetPersonDetailsResponse.js +2 -0
  191. package/dist/types/GetPersonMentions.d.ts +8 -0
  192. package/dist/types/GetPersonMentions.js +2 -0
  193. package/dist/types/GetPersonMentionsResponse.d.ts +4 -0
  194. package/dist/types/GetPersonMentionsResponse.js +2 -0
  195. package/dist/types/GetPost.d.ts +5 -0
  196. package/dist/types/GetPost.js +2 -0
  197. package/dist/types/GetPostResponse.d.ts +10 -0
  198. package/dist/types/GetPostResponse.js +2 -0
  199. package/dist/types/GetPosts.d.ts +13 -0
  200. package/dist/types/GetPosts.js +2 -0
  201. package/dist/types/GetPostsResponse.d.ts +4 -0
  202. package/dist/types/GetPostsResponse.js +2 -0
  203. package/dist/types/GetPrivateMessages.d.ts +6 -0
  204. package/dist/types/GetPrivateMessages.js +3 -0
  205. package/dist/types/GetReplies.d.ts +8 -0
  206. package/dist/types/GetReplies.js +2 -0
  207. package/dist/types/GetRepliesResponse.d.ts +4 -0
  208. package/dist/types/GetRepliesResponse.js +2 -0
  209. package/dist/types/GetReportCount.d.ts +5 -0
  210. package/dist/types/GetReportCount.js +2 -0
  211. package/dist/types/GetReportCountResponse.d.ts +7 -0
  212. package/dist/types/GetReportCountResponse.js +2 -0
  213. package/dist/types/GetSite.d.ts +3 -0
  214. package/dist/types/GetSite.js +3 -0
  215. package/dist/types/GetSiteMetadata.d.ts +3 -0
  216. package/dist/types/GetSiteMetadata.js +3 -0
  217. package/dist/types/GetSiteMetadataResponse.d.ts +4 -0
  218. package/dist/types/GetSiteMetadataResponse.js +2 -0
  219. package/dist/types/GetSiteResponse.d.ts +18 -0
  220. package/dist/types/GetSiteResponse.js +2 -0
  221. package/dist/types/GetUnreadCount.d.ts +3 -0
  222. package/dist/types/GetUnreadCount.js +3 -0
  223. package/dist/types/GetUnreadCountResponse.d.ts +5 -0
  224. package/dist/types/GetUnreadCountResponse.js +3 -0
  225. package/dist/types/GetUnreadRegistrationApplicationCount.d.ts +3 -0
  226. package/dist/types/GetUnreadRegistrationApplicationCount.js +3 -0
  227. package/dist/types/GetUnreadRegistrationApplicationCountResponse.d.ts +3 -0
  228. package/dist/types/GetUnreadRegistrationApplicationCountResponse.js +3 -0
  229. package/dist/types/HideCommunity.d.ts +7 -0
  230. package/dist/types/HideCommunity.js +2 -0
  231. package/dist/types/Instance.d.ts +9 -0
  232. package/dist/types/Instance.js +2 -0
  233. package/dist/types/InstanceId.d.ts +1 -0
  234. package/dist/types/InstanceId.js +3 -0
  235. package/dist/types/Language.d.ts +6 -0
  236. package/dist/types/Language.js +2 -0
  237. package/dist/types/LanguageId.d.ts +1 -0
  238. package/dist/types/LanguageId.js +3 -0
  239. package/dist/types/LeaveAdmin.d.ts +3 -0
  240. package/dist/types/LeaveAdmin.js +3 -0
  241. package/dist/types/ListCommentReports.d.ts +8 -0
  242. package/dist/types/ListCommentReports.js +2 -0
  243. package/dist/types/ListCommentReportsResponse.d.ts +4 -0
  244. package/dist/types/ListCommentReportsResponse.js +2 -0
  245. package/dist/types/ListCommunities.d.ts +9 -0
  246. package/dist/types/ListCommunities.js +2 -0
  247. package/dist/types/ListCommunitiesResponse.d.ts +4 -0
  248. package/dist/types/ListCommunitiesResponse.js +2 -0
  249. package/dist/types/ListPostReports.d.ts +8 -0
  250. package/dist/types/ListPostReports.js +2 -0
  251. package/dist/types/ListPostReportsResponse.d.ts +4 -0
  252. package/dist/types/ListPostReportsResponse.js +2 -0
  253. package/dist/types/ListPrivateMessageReports.d.ts +6 -0
  254. package/dist/types/ListPrivateMessageReports.js +3 -0
  255. package/dist/types/ListPrivateMessageReportsResponse.d.ts +4 -0
  256. package/dist/types/ListPrivateMessageReportsResponse.js +2 -0
  257. package/dist/types/ListRegistrationApplications.d.ts +6 -0
  258. package/dist/types/ListRegistrationApplications.js +3 -0
  259. package/dist/types/ListRegistrationApplicationsResponse.d.ts +4 -0
  260. package/dist/types/ListRegistrationApplicationsResponse.js +2 -0
  261. package/dist/types/ListingType.d.ts +1 -0
  262. package/dist/types/ListingType.js +3 -0
  263. package/dist/types/LocalSite.d.ts +31 -0
  264. package/dist/types/LocalSite.js +2 -0
  265. package/dist/types/LocalSiteId.d.ts +1 -0
  266. package/dist/types/LocalSiteId.js +3 -0
  267. package/dist/types/LocalSiteRateLimit.d.ts +19 -0
  268. package/dist/types/LocalSiteRateLimit.js +2 -0
  269. package/dist/types/LocalUser.d.ts +24 -0
  270. package/dist/types/LocalUser.js +2 -0
  271. package/dist/types/LocalUserId.d.ts +1 -0
  272. package/dist/types/LocalUserId.js +3 -0
  273. package/dist/types/LocalUserView.d.ts +8 -0
  274. package/dist/types/LocalUserView.js +2 -0
  275. package/dist/types/LockPost.d.ts +6 -0
  276. package/dist/types/LockPost.js +2 -0
  277. package/dist/types/Login.d.ts +5 -0
  278. package/dist/types/Login.js +3 -0
  279. package/dist/types/LoginResponse.d.ts +5 -0
  280. package/dist/types/LoginResponse.js +3 -0
  281. package/dist/types/MarkAllAsRead.d.ts +3 -0
  282. package/dist/types/MarkAllAsRead.js +3 -0
  283. package/dist/types/MarkCommentReplyAsRead.d.ts +6 -0
  284. package/dist/types/MarkCommentReplyAsRead.js +2 -0
  285. package/dist/types/MarkPersonMentionAsRead.d.ts +6 -0
  286. package/dist/types/MarkPersonMentionAsRead.js +2 -0
  287. package/dist/types/MarkPostAsRead.d.ts +6 -0
  288. package/dist/types/MarkPostAsRead.js +2 -0
  289. package/dist/types/MarkPrivateMessageAsRead.d.ts +6 -0
  290. package/dist/types/MarkPrivateMessageAsRead.js +2 -0
  291. package/dist/types/ModAdd.d.ts +8 -0
  292. package/dist/types/ModAdd.js +2 -0
  293. package/dist/types/ModAddCommunity.d.ts +10 -0
  294. package/dist/types/ModAddCommunity.js +2 -0
  295. package/dist/types/ModAddCommunityView.d.ts +9 -0
  296. package/dist/types/ModAddCommunityView.js +2 -0
  297. package/dist/types/ModAddView.d.ts +7 -0
  298. package/dist/types/ModAddView.js +2 -0
  299. package/dist/types/ModBan.d.ts +10 -0
  300. package/dist/types/ModBan.js +2 -0
  301. package/dist/types/ModBanFromCommunity.d.ts +12 -0
  302. package/dist/types/ModBanFromCommunity.js +2 -0
  303. package/dist/types/ModBanFromCommunityView.d.ts +9 -0
  304. package/dist/types/ModBanFromCommunityView.js +2 -0
  305. package/dist/types/ModBanView.d.ts +7 -0
  306. package/dist/types/ModBanView.js +2 -0
  307. package/dist/types/ModFeaturePost.d.ts +10 -0
  308. package/dist/types/ModFeaturePost.js +2 -0
  309. package/dist/types/ModFeaturePostView.d.ts +10 -0
  310. package/dist/types/ModFeaturePostView.js +2 -0
  311. package/dist/types/ModHideCommunity.d.ts +10 -0
  312. package/dist/types/ModHideCommunity.js +2 -0
  313. package/dist/types/ModHideCommunityView.d.ts +8 -0
  314. package/dist/types/ModHideCommunityView.js +2 -0
  315. package/dist/types/ModJoin.d.ts +4 -0
  316. package/dist/types/ModJoin.js +2 -0
  317. package/dist/types/ModJoinResponse.d.ts +3 -0
  318. package/dist/types/ModJoinResponse.js +3 -0
  319. package/dist/types/ModLockPost.d.ts +9 -0
  320. package/dist/types/ModLockPost.js +2 -0
  321. package/dist/types/ModLockPostView.d.ts +10 -0
  322. package/dist/types/ModLockPostView.js +2 -0
  323. package/dist/types/ModRemoveComment.d.ts +10 -0
  324. package/dist/types/ModRemoveComment.js +2 -0
  325. package/dist/types/ModRemoveCommentView.d.ts +13 -0
  326. package/dist/types/ModRemoveCommentView.js +2 -0
  327. package/dist/types/ModRemoveCommunity.d.ts +11 -0
  328. package/dist/types/ModRemoveCommunity.js +2 -0
  329. package/dist/types/ModRemoveCommunityView.d.ts +8 -0
  330. package/dist/types/ModRemoveCommunityView.js +2 -0
  331. package/dist/types/ModRemovePost.d.ts +10 -0
  332. package/dist/types/ModRemovePost.js +2 -0
  333. package/dist/types/ModRemovePostView.d.ts +10 -0
  334. package/dist/types/ModRemovePostView.js +2 -0
  335. package/dist/types/ModTransferCommunity.d.ts +9 -0
  336. package/dist/types/ModTransferCommunity.js +2 -0
  337. package/dist/types/ModTransferCommunityView.d.ts +9 -0
  338. package/dist/types/ModTransferCommunityView.js +2 -0
  339. package/dist/types/ModlogActionType.d.ts +1 -0
  340. package/dist/types/ModlogActionType.js +3 -0
  341. package/dist/types/ModlogListParams.d.ts +10 -0
  342. package/dist/types/ModlogListParams.js +2 -0
  343. package/dist/types/MyUserInfo.d.ts +14 -0
  344. package/dist/types/MyUserInfo.js +2 -0
  345. package/dist/types/PasswordChangeAfterReset.d.ts +5 -0
  346. package/dist/types/PasswordChangeAfterReset.js +3 -0
  347. package/dist/types/PasswordReset.d.ts +3 -0
  348. package/dist/types/PasswordReset.js +3 -0
  349. package/dist/types/PasswordResetResponse.d.ts +1 -0
  350. package/dist/types/PasswordResetResponse.js +3 -0
  351. package/dist/types/Person.d.ts +21 -0
  352. package/dist/types/Person.js +2 -0
  353. package/dist/types/PersonAggregates.d.ts +9 -0
  354. package/dist/types/PersonAggregates.js +2 -0
  355. package/dist/types/PersonBlockId.d.ts +1 -0
  356. package/dist/types/PersonBlockId.js +3 -0
  357. package/dist/types/PersonBlockView.d.ts +5 -0
  358. package/dist/types/PersonBlockView.js +2 -0
  359. package/dist/types/PersonId.d.ts +1 -0
  360. package/dist/types/PersonId.js +3 -0
  361. package/dist/types/PersonMention.d.ts +10 -0
  362. package/dist/types/PersonMention.js +2 -0
  363. package/dist/types/PersonMentionId.d.ts +1 -0
  364. package/dist/types/PersonMentionId.js +3 -0
  365. package/dist/types/PersonMentionResponse.d.ts +4 -0
  366. package/dist/types/PersonMentionResponse.js +2 -0
  367. package/dist/types/PersonMentionView.d.ts +21 -0
  368. package/dist/types/PersonMentionView.js +2 -0
  369. package/dist/types/PersonView.d.ts +6 -0
  370. package/dist/types/PersonView.js +2 -0
  371. package/dist/types/Post.d.ts +27 -0
  372. package/dist/types/Post.js +2 -0
  373. package/dist/types/PostAggregates.d.ts +14 -0
  374. package/dist/types/PostAggregates.js +2 -0
  375. package/dist/types/PostFeatureType.d.ts +1 -0
  376. package/dist/types/PostFeatureType.js +3 -0
  377. package/dist/types/PostId.d.ts +1 -0
  378. package/dist/types/PostId.js +3 -0
  379. package/dist/types/PostJoin.d.ts +4 -0
  380. package/dist/types/PostJoin.js +2 -0
  381. package/dist/types/PostJoinResponse.d.ts +3 -0
  382. package/dist/types/PostJoinResponse.js +3 -0
  383. package/dist/types/PostOrCommentId.d.ts +7 -0
  384. package/dist/types/PostOrCommentId.js +2 -0
  385. package/dist/types/PostReport.d.ts +16 -0
  386. package/dist/types/PostReport.js +2 -0
  387. package/dist/types/PostReportId.d.ts +1 -0
  388. package/dist/types/PostReportId.js +3 -0
  389. package/dist/types/PostReportResponse.d.ts +4 -0
  390. package/dist/types/PostReportResponse.js +2 -0
  391. package/dist/types/PostReportView.d.ts +16 -0
  392. package/dist/types/PostReportView.js +2 -0
  393. package/dist/types/PostResponse.d.ts +4 -0
  394. package/dist/types/PostResponse.js +2 -0
  395. package/dist/types/PostView.d.ts +18 -0
  396. package/dist/types/PostView.js +2 -0
  397. package/dist/types/PrivateMessage.d.ts +14 -0
  398. package/dist/types/PrivateMessage.js +2 -0
  399. package/dist/types/PrivateMessageId.d.ts +1 -0
  400. package/dist/types/PrivateMessageId.js +3 -0
  401. package/dist/types/PrivateMessageReport.d.ts +14 -0
  402. package/dist/types/PrivateMessageReport.js +2 -0
  403. package/dist/types/PrivateMessageReportId.d.ts +1 -0
  404. package/dist/types/PrivateMessageReportId.js +3 -0
  405. package/dist/types/PrivateMessageReportResponse.d.ts +4 -0
  406. package/dist/types/PrivateMessageReportResponse.js +2 -0
  407. package/dist/types/PrivateMessageReportView.d.ts +10 -0
  408. package/dist/types/PrivateMessageReportView.js +2 -0
  409. package/dist/types/PrivateMessageResponse.d.ts +4 -0
  410. package/dist/types/PrivateMessageResponse.js +2 -0
  411. package/dist/types/PrivateMessageView.d.ts +7 -0
  412. package/dist/types/PrivateMessageView.js +2 -0
  413. package/dist/types/PrivateMessagesResponse.d.ts +4 -0
  414. package/dist/types/PrivateMessagesResponse.js +2 -0
  415. package/dist/types/PurgeComment.d.ts +6 -0
  416. package/dist/types/PurgeComment.js +2 -0
  417. package/dist/types/PurgeCommunity.d.ts +6 -0
  418. package/dist/types/PurgeCommunity.js +2 -0
  419. package/dist/types/PurgeItemResponse.d.ts +3 -0
  420. package/dist/types/PurgeItemResponse.js +3 -0
  421. package/dist/types/PurgePerson.d.ts +6 -0
  422. package/dist/types/PurgePerson.js +2 -0
  423. package/dist/types/PurgePost.d.ts +6 -0
  424. package/dist/types/PurgePost.js +2 -0
  425. package/dist/types/Register.d.ts +11 -0
  426. package/dist/types/Register.js +3 -0
  427. package/dist/types/RegistrationApplication.d.ts +10 -0
  428. package/dist/types/RegistrationApplication.js +2 -0
  429. package/dist/types/RegistrationApplicationResponse.d.ts +4 -0
  430. package/dist/types/RegistrationApplicationResponse.js +2 -0
  431. package/dist/types/RegistrationApplicationView.d.ts +9 -0
  432. package/dist/types/RegistrationApplicationView.js +2 -0
  433. package/dist/types/RegistrationMode.d.ts +1 -0
  434. package/dist/types/RegistrationMode.js +3 -0
  435. package/dist/types/RemoveComment.d.ts +7 -0
  436. package/dist/types/RemoveComment.js +2 -0
  437. package/dist/types/RemoveCommunity.d.ts +8 -0
  438. package/dist/types/RemoveCommunity.js +2 -0
  439. package/dist/types/RemovePost.d.ts +7 -0
  440. package/dist/types/RemovePost.js +2 -0
  441. package/dist/types/ResolveCommentReport.d.ts +6 -0
  442. package/dist/types/ResolveCommentReport.js +2 -0
  443. package/dist/types/ResolveObject.d.ts +4 -0
  444. package/dist/types/ResolveObject.js +3 -0
  445. package/dist/types/ResolveObjectResponse.d.ts +10 -0
  446. package/dist/types/ResolveObjectResponse.js +2 -0
  447. package/dist/types/ResolvePostReport.d.ts +6 -0
  448. package/dist/types/ResolvePostReport.js +2 -0
  449. package/dist/types/ResolvePrivateMessageReport.d.ts +6 -0
  450. package/dist/types/ResolvePrivateMessageReport.js +2 -0
  451. package/dist/types/SaveComment.d.ts +6 -0
  452. package/dist/types/SaveComment.js +2 -0
  453. package/dist/types/SavePost.d.ts +6 -0
  454. package/dist/types/SavePost.js +2 -0
  455. package/dist/types/SaveUserSettings.d.ts +26 -0
  456. package/dist/types/SaveUserSettings.js +2 -0
  457. package/dist/types/Search.d.ts +17 -0
  458. package/dist/types/Search.js +2 -0
  459. package/dist/types/SearchResponse.d.ts +12 -0
  460. package/dist/types/SearchResponse.js +2 -0
  461. package/dist/types/SearchType.d.ts +1 -0
  462. package/dist/types/SearchType.js +3 -0
  463. package/dist/types/Site.d.ts +18 -0
  464. package/dist/types/Site.js +2 -0
  465. package/dist/types/SiteAggregates.d.ts +13 -0
  466. package/dist/types/SiteAggregates.js +2 -0
  467. package/dist/types/SiteId.d.ts +1 -0
  468. package/dist/types/SiteId.js +3 -0
  469. package/dist/types/SiteMetadata.d.ts +6 -0
  470. package/dist/types/SiteMetadata.js +3 -0
  471. package/dist/types/SiteResponse.d.ts +4 -0
  472. package/dist/types/SiteResponse.js +2 -0
  473. package/dist/types/SiteView.d.ts +10 -0
  474. package/dist/types/SiteView.js +2 -0
  475. package/dist/types/SortType.d.ts +1 -0
  476. package/dist/types/SortType.js +3 -0
  477. package/dist/types/SubscribedType.d.ts +1 -0
  478. package/dist/types/SubscribedType.js +3 -0
  479. package/dist/types/Tagline.d.ts +8 -0
  480. package/dist/types/Tagline.js +2 -0
  481. package/dist/types/TransferCommunity.d.ts +7 -0
  482. package/dist/types/TransferCommunity.js +2 -0
  483. package/dist/types/UserJoin.d.ts +3 -0
  484. package/dist/types/UserJoin.js +3 -0
  485. package/dist/types/UserJoinResponse.d.ts +3 -0
  486. package/dist/types/UserJoinResponse.js +3 -0
  487. package/dist/types/VerifyEmail.d.ts +3 -0
  488. package/dist/types/VerifyEmail.js +3 -0
  489. package/dist/types/VerifyEmailResponse.d.ts +1 -0
  490. package/dist/types/VerifyEmailResponse.js +3 -0
  491. package/dist/types/others.d.ts +113 -0
  492. package/dist/types/others.js +96 -0
  493. package/dist/utils.d.ts +0 -0
  494. package/dist/utils.js +0 -0
  495. package/dist/websocket.d.ts +142 -17
  496. package/dist/websocket.js +93 -21
  497. package/package.json +26 -24
  498. package/dist/interfaces/aggregates.d.ts +0 -90
  499. package/dist/interfaces/api/comment.d.ts +0 -115
  500. package/dist/interfaces/api/community.d.ts +0 -120
  501. package/dist/interfaces/api/index.d.ts +0 -6
  502. package/dist/interfaces/api/index.js +0 -18
  503. package/dist/interfaces/api/person.d.ts +0 -271
  504. package/dist/interfaces/api/post.d.ts +0 -130
  505. package/dist/interfaces/api/site.d.ts +0 -168
  506. package/dist/interfaces/api/websocket.d.ts +0 -27
  507. package/dist/interfaces/index.d.ts +0 -5
  508. package/dist/interfaces/index.js +0 -17
  509. package/dist/interfaces/others.d.ts +0 -186
  510. package/dist/interfaces/others.js +0 -151
  511. package/dist/interfaces/source.d.ts +0 -250
  512. package/dist/interfaces/views.d.ts +0 -173
  513. /package/dist/{interfaces/aggregates.js → types/AddAdmin.js} +0 -0
  514. /package/dist/{interfaces/api/comment.js → types/AddAdminResponse.js} +0 -0
  515. /package/dist/{interfaces/api/community.js → types/AddModToCommunity.js} +0 -0
  516. /package/dist/{interfaces/api/person.js → types/AddModToCommunityResponse.js} +0 -0
  517. /package/dist/{interfaces/api/post.js → types/AdminPurgeComment.js} +0 -0
  518. /package/dist/{interfaces/api/site.js → types/AdminPurgeCommentView.js} +0 -0
  519. /package/dist/{interfaces/api/websocket.js → types/AdminPurgeCommunity.js} +0 -0
  520. /package/dist/{interfaces/source.js → types/AdminPurgeCommunityView.js} +0 -0
  521. /package/dist/{interfaces/views.js → types/AdminPurgePerson.js} +0 -0
package/dist/http.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -46,10 +46,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
47
  }
48
48
  };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
49
52
  Object.defineProperty(exports, "__esModule", { value: true });
50
53
  exports.LemmyHttp = void 0;
51
- var node_fetch_1 = require("node-fetch");
52
- var others_1 = require("./interfaces/others");
54
+ var cross_fetch_1 = __importDefault(require("cross-fetch"));
55
+ var form_data_1 = __importDefault(require("form-data"));
56
+ var others_1 = require("./types/others");
53
57
  var HttpType;
54
58
  (function (HttpType) {
55
59
  HttpType["Get"] = "GET";
@@ -68,737 +72,723 @@ var LemmyHttp = /** @class */ (function () {
68
72
  function LemmyHttp(baseUrl, headers) {
69
73
  this.headers = {};
70
74
  this.apiUrl = "".concat(baseUrl, "/api/").concat(others_1.VERSION);
75
+ this.pictrsUrl = "".concat(baseUrl, "/pictrs/image");
71
76
  if (headers) {
72
77
  this.headers = headers;
73
78
  }
74
79
  }
75
80
  /**
76
81
  * Gets the site, and your user data.
82
+ *
83
+ * `HTTP.GET /site`
77
84
  */
78
85
  LemmyHttp.prototype.getSite = function (form) {
79
- return __awaiter(this, void 0, void 0, function () {
80
- return __generator(this, function (_a) {
81
- return [2 /*return*/, this.wrapper(HttpType.Get, "/site", form)];
82
- });
83
- });
86
+ return this.wrapper(HttpType.Get, "/site", form);
84
87
  };
85
88
  /**
86
89
  * Create your site.
90
+ *
91
+ * `HTTP.POST /site`
87
92
  */
88
93
  LemmyHttp.prototype.createSite = function (form) {
89
- return __awaiter(this, void 0, void 0, function () {
90
- return __generator(this, function (_a) {
91
- return [2 /*return*/, this.wrapper(HttpType.Post, "/site", form)];
92
- });
93
- });
94
+ return this.wrapper(HttpType.Post, "/site", form);
94
95
  };
95
96
  /**
96
97
  * Edit your site.
98
+ *
99
+ * `HTTP.PUT /site`
97
100
  */
98
101
  LemmyHttp.prototype.editSite = function (form) {
99
- return __awaiter(this, void 0, void 0, function () {
100
- return __generator(this, function (_a) {
101
- return [2 /*return*/, this.wrapper(HttpType.Put, "/site", form)];
102
- });
103
- });
102
+ return this.wrapper(HttpType.Put, "/site", form);
104
103
  };
105
104
  /**
106
105
  * Leave the Site admins.
106
+ *
107
+ * `HTTP.POST /user/leave_admin`
107
108
  */
108
109
  LemmyHttp.prototype.leaveAdmin = function (form) {
109
- return __awaiter(this, void 0, void 0, function () {
110
- return __generator(this, function (_a) {
111
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/leave_admin", form)];
112
- });
113
- });
114
- };
115
- /**
116
- * Get your site configuration.
117
- */
118
- LemmyHttp.prototype.getSiteConfig = function (form) {
119
- return __awaiter(this, void 0, void 0, function () {
120
- return __generator(this, function (_a) {
121
- return [2 /*return*/, this.wrapper(HttpType.Get, "/site/config", form)];
122
- });
123
- });
124
- };
125
- /**
126
- * Save your site config.
127
- */
128
- LemmyHttp.prototype.saveSiteConfig = function (form) {
129
- return __awaiter(this, void 0, void 0, function () {
130
- return __generator(this, function (_a) {
131
- return [2 /*return*/, this.wrapper(HttpType.Put, "/site/config", form)];
132
- });
133
- });
110
+ return this.wrapper(HttpType.Post, "/user/leave_admin", form);
134
111
  };
135
112
  /**
136
113
  * Get the modlog.
114
+ *
115
+ * `HTTP.GET /modlog`
137
116
  */
138
117
  LemmyHttp.prototype.getModlog = function (form) {
139
- return __awaiter(this, void 0, void 0, function () {
140
- return __generator(this, function (_a) {
141
- return [2 /*return*/, this.wrapper(HttpType.Get, "/modlog", form)];
142
- });
143
- });
118
+ return this.wrapper(HttpType.Get, "/modlog", form);
144
119
  };
145
120
  /**
146
121
  * Search lemmy.
122
+ *
123
+ * `HTTP.GET /search`
147
124
  */
148
125
  LemmyHttp.prototype.search = function (form) {
149
- return __awaiter(this, void 0, void 0, function () {
150
- return __generator(this, function (_a) {
151
- return [2 /*return*/, this.wrapper(HttpType.Get, "/search", form)];
152
- });
153
- });
126
+ return this.wrapper(HttpType.Get, "/search", form);
154
127
  };
155
128
  /**
156
129
  * Fetch a non-local / federated object.
130
+ *
131
+ * `HTTP.GET /resolve_object`
157
132
  */
158
133
  LemmyHttp.prototype.resolveObject = function (form) {
159
- return __awaiter(this, void 0, void 0, function () {
160
- return __generator(this, function (_a) {
161
- return [2 /*return*/, this.wrapper(HttpType.Get, "/resolve_object", form)];
162
- });
163
- });
134
+ return this.wrapper(HttpType.Get, "/resolve_object", form);
164
135
  };
165
136
  /**
166
137
  * Create a new community.
138
+ *
139
+ * `HTTP.POST /community`
167
140
  */
168
141
  LemmyHttp.prototype.createCommunity = function (form) {
169
- return __awaiter(this, void 0, void 0, function () {
170
- return __generator(this, function (_a) {
171
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community", form)];
172
- });
173
- });
142
+ return this.wrapper(HttpType.Post, "/community", form);
174
143
  };
175
144
  /**
176
145
  * Get / fetch a community.
146
+ *
147
+ * `HTTP.GET /community`
177
148
  */
178
149
  LemmyHttp.prototype.getCommunity = function (form) {
179
- return __awaiter(this, void 0, void 0, function () {
180
- return __generator(this, function (_a) {
181
- return [2 /*return*/, this.wrapper(HttpType.Get, "/community", form)];
182
- });
183
- });
150
+ return this.wrapper(HttpType.Get, "/community", form);
184
151
  };
185
152
  /**
186
153
  * Edit a community.
154
+ *
155
+ * `HTTP.PUT /community`
187
156
  */
188
157
  LemmyHttp.prototype.editCommunity = function (form) {
189
- return __awaiter(this, void 0, void 0, function () {
190
- return __generator(this, function (_a) {
191
- return [2 /*return*/, this.wrapper(HttpType.Put, "/community", form)];
192
- });
193
- });
158
+ return this.wrapper(HttpType.Put, "/community", form);
194
159
  };
195
160
  /**
196
161
  * List communities, with various filters.
162
+ *
163
+ * `HTTP.GET /community/list`
197
164
  */
198
165
  LemmyHttp.prototype.listCommunities = function (form) {
199
- return __awaiter(this, void 0, void 0, function () {
200
- return __generator(this, function (_a) {
201
- return [2 /*return*/, this.wrapper(HttpType.Get, "/community/list", form)];
202
- });
203
- });
166
+ return this.wrapper(HttpType.Get, "/community/list", form);
204
167
  };
205
168
  /**
206
169
  * Follow / subscribe to a community.
170
+ *
171
+ * `HTTP.POST /community/follow`
207
172
  */
208
173
  LemmyHttp.prototype.followCommunity = function (form) {
209
- return __awaiter(this, void 0, void 0, function () {
210
- return __generator(this, function (_a) {
211
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/follow", form)];
212
- });
213
- });
174
+ return this.wrapper(HttpType.Post, "/community/follow", form);
214
175
  };
215
176
  /**
216
177
  * Block a community.
178
+ *
179
+ * `HTTP.POST /community/block`
217
180
  */
218
181
  LemmyHttp.prototype.blockCommunity = function (form) {
219
- return __awaiter(this, void 0, void 0, function () {
220
- return __generator(this, function (_a) {
221
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/block", form)];
222
- });
223
- });
182
+ return this.wrapper(HttpType.Post, "/community/block", form);
224
183
  };
225
184
  /**
226
185
  * Delete a community.
186
+ *
187
+ * `HTTP.POST /community/delete`
227
188
  */
228
189
  LemmyHttp.prototype.deleteCommunity = function (form) {
229
- return __awaiter(this, void 0, void 0, function () {
230
- return __generator(this, function (_a) {
231
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/delete", form)];
232
- });
233
- });
190
+ return this.wrapper(HttpType.Post, "/community/delete", form);
234
191
  };
235
192
  /**
236
193
  * A moderator remove for a community.
194
+ *
195
+ * `HTTP.POST /community/remove`
237
196
  */
238
197
  LemmyHttp.prototype.removeCommunity = function (form) {
239
- return __awaiter(this, void 0, void 0, function () {
240
- return __generator(this, function (_a) {
241
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/remove", form)];
242
- });
243
- });
198
+ return this.wrapper(HttpType.Post, "/community/remove", form);
244
199
  };
245
200
  /**
246
201
  * Transfer your community to an existing moderator.
202
+ *
203
+ * `HTTP.POST /community/transfer`
247
204
  */
248
205
  LemmyHttp.prototype.transferCommunity = function (form) {
249
- return __awaiter(this, void 0, void 0, function () {
250
- return __generator(this, function (_a) {
251
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/transfer", form)];
252
- });
253
- });
206
+ return this.wrapper(HttpType.Post, "/community/transfer", form);
254
207
  };
255
208
  /**
256
209
  * Ban a user from a community.
210
+ *
211
+ * `HTTP.POST /community/ban_user`
257
212
  */
258
213
  LemmyHttp.prototype.banFromCommunity = function (form) {
259
- return __awaiter(this, void 0, void 0, function () {
260
- return __generator(this, function (_a) {
261
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/ban_user", form)];
262
- });
263
- });
214
+ return this.wrapper(HttpType.Post, "/community/ban_user", form);
264
215
  };
265
216
  /**
266
217
  * Add a moderator to your community.
218
+ *
219
+ * `HTTP.POST /community/mod`
267
220
  */
268
221
  LemmyHttp.prototype.addModToCommunity = function (form) {
269
- return __awaiter(this, void 0, void 0, function () {
270
- return __generator(this, function (_a) {
271
- return [2 /*return*/, this.wrapper(HttpType.Post, "/community/mod", form)];
272
- });
273
- });
222
+ return this.wrapper(HttpType.Post, "/community/mod", form);
274
223
  };
275
224
  /**
276
225
  * Create a post.
226
+ *
227
+ * `HTTP.POST /post`
277
228
  */
278
229
  LemmyHttp.prototype.createPost = function (form) {
279
- return __awaiter(this, void 0, void 0, function () {
280
- return __generator(this, function (_a) {
281
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post", form)];
282
- });
283
- });
230
+ return this.wrapper(HttpType.Post, "/post", form);
284
231
  };
285
232
  /**
286
233
  * Get / fetch a post.
234
+ *
235
+ * `HTTP.GET /post`
287
236
  */
288
237
  LemmyHttp.prototype.getPost = function (form) {
289
- return __awaiter(this, void 0, void 0, function () {
290
- return __generator(this, function (_a) {
291
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post", form)];
292
- });
293
- });
238
+ return this.wrapper(HttpType.Get, "/post", form);
294
239
  };
295
240
  /**
296
241
  * Edit a post.
242
+ *
243
+ * `HTTP.PUT /post`
297
244
  */
298
245
  LemmyHttp.prototype.editPost = function (form) {
299
- return __awaiter(this, void 0, void 0, function () {
300
- return __generator(this, function (_a) {
301
- return [2 /*return*/, this.wrapper(HttpType.Put, "/post", form)];
302
- });
303
- });
246
+ return this.wrapper(HttpType.Put, "/post", form);
304
247
  };
305
248
  /**
306
249
  * Delete a post.
250
+ *
251
+ * `HTTP.POST /post/delete`
307
252
  */
308
253
  LemmyHttp.prototype.deletePost = function (form) {
309
- return __awaiter(this, void 0, void 0, function () {
310
- return __generator(this, function (_a) {
311
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/delete", form)];
312
- });
313
- });
254
+ return this.wrapper(HttpType.Post, "/post/delete", form);
314
255
  };
315
256
  /**
316
257
  * A moderator remove for a post.
258
+ *
259
+ * `HTTP.POST /post/remove`
317
260
  */
318
261
  LemmyHttp.prototype.removePost = function (form) {
319
- return __awaiter(this, void 0, void 0, function () {
320
- return __generator(this, function (_a) {
321
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/remove", form)];
322
- });
323
- });
262
+ return this.wrapper(HttpType.Post, "/post/remove", form);
263
+ };
264
+ /**
265
+ * Mark a post as read.
266
+ *
267
+ * `HTTP.POST /post/mark_as_read`
268
+ */
269
+ LemmyHttp.prototype.markPostAsRead = function (form) {
270
+ return this.wrapper(HttpType.Post, "/post/mark_as_read", form);
324
271
  };
325
272
  /**
326
273
  * A moderator can lock a post ( IE disable new comments ).
274
+ *
275
+ * `HTTP.POST /post/lock`
327
276
  */
328
277
  LemmyHttp.prototype.lockPost = function (form) {
329
- return __awaiter(this, void 0, void 0, function () {
330
- return __generator(this, function (_a) {
331
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/lock", form)];
332
- });
333
- });
278
+ return this.wrapper(HttpType.Post, "/post/lock", form);
334
279
  };
335
280
  /**
336
- * A moderator can sticky a post ( IE stick it to the top of a community ).
281
+ * A moderator can feature a community post ( IE stick it to the top of a community ).
282
+ *
283
+ * `HTTP.POST /post/feature`
337
284
  */
338
- LemmyHttp.prototype.stickyPost = function (form) {
339
- return __awaiter(this, void 0, void 0, function () {
340
- return __generator(this, function (_a) {
341
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/sticky", form)];
342
- });
343
- });
285
+ LemmyHttp.prototype.featurePost = function (form) {
286
+ return this.wrapper(HttpType.Post, "/post/feature", form);
344
287
  };
345
288
  /**
346
289
  * Get / fetch posts, with various filters.
290
+ *
291
+ * `HTTP.GET /post/list`
347
292
  */
348
293
  LemmyHttp.prototype.getPosts = function (form) {
349
- return __awaiter(this, void 0, void 0, function () {
350
- return __generator(this, function (_a) {
351
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post/list", form)];
352
- });
353
- });
294
+ return this.wrapper(HttpType.Get, "/post/list", form);
354
295
  };
355
296
  /**
356
297
  * Like / vote on a post.
298
+ *
299
+ * `HTTP.POST /post/like`
357
300
  */
358
301
  LemmyHttp.prototype.likePost = function (form) {
359
- return __awaiter(this, void 0, void 0, function () {
360
- return __generator(this, function (_a) {
361
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/like", form)];
362
- });
363
- });
302
+ return this.wrapper(HttpType.Post, "/post/like", form);
364
303
  };
365
304
  /**
366
305
  * Save a post.
306
+ *
307
+ * `HTTP.PUT /post/save`
367
308
  */
368
309
  LemmyHttp.prototype.savePost = function (form) {
369
- return __awaiter(this, void 0, void 0, function () {
370
- return __generator(this, function (_a) {
371
- return [2 /*return*/, this.wrapper(HttpType.Put, "/post/save", form)];
372
- });
373
- });
310
+ return this.wrapper(HttpType.Put, "/post/save", form);
374
311
  };
375
312
  /**
376
313
  * Report a post.
314
+ *
315
+ * `HTTP.POST /post/report`
377
316
  */
378
317
  LemmyHttp.prototype.createPostReport = function (form) {
379
- return __awaiter(this, void 0, void 0, function () {
380
- return __generator(this, function (_a) {
381
- return [2 /*return*/, this.wrapper(HttpType.Post, "/post/report", form)];
382
- });
383
- });
318
+ return this.wrapper(HttpType.Post, "/post/report", form);
384
319
  };
385
320
  /**
386
321
  * Resolve a post report. Only a mod can do this.
322
+ *
323
+ * `HTTP.PUT /post/report/resolve`
387
324
  */
388
325
  LemmyHttp.prototype.resolvePostReport = function (form) {
389
- return __awaiter(this, void 0, void 0, function () {
390
- return __generator(this, function (_a) {
391
- return [2 /*return*/, this.wrapper(HttpType.Put, "/post/report/resolve", form)];
392
- });
393
- });
326
+ return this.wrapper(HttpType.Put, "/post/report/resolve", form);
394
327
  };
395
328
  /**
396
329
  * List post reports.
330
+ *
331
+ * `HTTP.GET /post/report/list`
397
332
  */
398
333
  LemmyHttp.prototype.listPostReports = function (form) {
399
- return __awaiter(this, void 0, void 0, function () {
400
- return __generator(this, function (_a) {
401
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post/report/list", form)];
402
- });
403
- });
334
+ return this.wrapper(HttpType.Get, "/post/report/list", form);
404
335
  };
405
336
  /**
406
337
  * Fetch metadata for any given site.
338
+ *
339
+ * `HTTP.GET /post/site_metadata`
407
340
  */
408
341
  LemmyHttp.prototype.getSiteMetadata = function (form) {
409
- return __awaiter(this, void 0, void 0, function () {
410
- return __generator(this, function (_a) {
411
- return [2 /*return*/, this.wrapper(HttpType.Get, "/post/site_metadata", form)];
412
- });
413
- });
342
+ return this.wrapper(HttpType.Get, "/post/site_metadata", form);
414
343
  };
415
344
  /**
416
345
  * Create a comment.
346
+ *
347
+ * `HTTP.POST /comment`
417
348
  */
418
349
  LemmyHttp.prototype.createComment = function (form) {
419
- return __awaiter(this, void 0, void 0, function () {
420
- return __generator(this, function (_a) {
421
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment", form)];
422
- });
423
- });
350
+ return this.wrapper(HttpType.Post, "/comment", form);
424
351
  };
425
352
  /**
426
353
  * Edit a comment.
354
+ *
355
+ * `HTTP.PUT /comment`
427
356
  */
428
357
  LemmyHttp.prototype.editComment = function (form) {
429
- return __awaiter(this, void 0, void 0, function () {
430
- return __generator(this, function (_a) {
431
- return [2 /*return*/, this.wrapper(HttpType.Put, "/comment", form)];
432
- });
433
- });
358
+ return this.wrapper(HttpType.Put, "/comment", form);
434
359
  };
435
360
  /**
436
361
  * Delete a comment.
362
+ *
363
+ * `HTTP.POST /comment/delete`
437
364
  */
438
365
  LemmyHttp.prototype.deleteComment = function (form) {
439
- return __awaiter(this, void 0, void 0, function () {
440
- return __generator(this, function (_a) {
441
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/delete", form)];
442
- });
443
- });
366
+ return this.wrapper(HttpType.Post, "/comment/delete", form);
444
367
  };
445
368
  /**
446
369
  * A moderator remove for a comment.
370
+ *
371
+ * `HTTP.POST /comment/remove`
447
372
  */
448
373
  LemmyHttp.prototype.removeComment = function (form) {
449
- return __awaiter(this, void 0, void 0, function () {
450
- return __generator(this, function (_a) {
451
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/remove", form)];
452
- });
453
- });
374
+ return this.wrapper(HttpType.Post, "/comment/remove", form);
454
375
  };
455
376
  /**
456
377
  * Mark a comment as read.
378
+ *
379
+ * `HTTP.POST /comment/mark_as_read`
457
380
  */
458
- LemmyHttp.prototype.markCommentAsRead = function (form) {
459
- return __awaiter(this, void 0, void 0, function () {
460
- return __generator(this, function (_a) {
461
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/mark_as_read", form)];
462
- });
463
- });
381
+ LemmyHttp.prototype.markCommentReplyAsRead = function (form) {
382
+ return this.wrapper(HttpType.Post, "/comment/mark_as_read", form);
464
383
  };
465
384
  /**
466
385
  * Like / vote on a comment.
386
+ *
387
+ * `HTTP.POST /comment/like`
467
388
  */
468
389
  LemmyHttp.prototype.likeComment = function (form) {
469
- return __awaiter(this, void 0, void 0, function () {
470
- return __generator(this, function (_a) {
471
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/like", form)];
472
- });
473
- });
390
+ return this.wrapper(HttpType.Post, "/comment/like", form);
474
391
  };
475
392
  /**
476
393
  * Save a comment.
394
+ *
395
+ * `HTTP.PUT /comment/save`
477
396
  */
478
397
  LemmyHttp.prototype.saveComment = function (form) {
479
- return __awaiter(this, void 0, void 0, function () {
480
- return __generator(this, function (_a) {
481
- return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/save", form)];
482
- });
483
- });
398
+ return this.wrapper(HttpType.Put, "/comment/save", form);
484
399
  };
485
400
  /**
486
401
  * Get / fetch comments.
402
+ *
403
+ * `HTTP.GET /comment/list`
487
404
  */
488
405
  LemmyHttp.prototype.getComments = function (form) {
489
- return __awaiter(this, void 0, void 0, function () {
490
- return __generator(this, function (_a) {
491
- return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/list", form)];
492
- });
493
- });
406
+ return this.wrapper(HttpType.Get, "/comment/list", form);
407
+ };
408
+ /**
409
+ * Get / fetch comment.
410
+ *
411
+ * `HTTP.GET /comment`
412
+ */
413
+ LemmyHttp.prototype.getComment = function (form) {
414
+ return this.wrapper(HttpType.Get, "/comment", form);
494
415
  };
495
416
  /**
496
417
  * Report a comment.
418
+ *
419
+ * `HTTP.POST /comment/report`
497
420
  */
498
421
  LemmyHttp.prototype.createCommentReport = function (form) {
499
- return __awaiter(this, void 0, void 0, function () {
500
- return __generator(this, function (_a) {
501
- return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/report", form)];
502
- });
503
- });
422
+ return this.wrapper(HttpType.Post, "/comment/report", form);
504
423
  };
505
424
  /**
506
425
  * Resolve a comment report. Only a mod can do this.
426
+ *
427
+ * `HTTP.PUT /comment/report/resolve`
507
428
  */
508
429
  LemmyHttp.prototype.resolveCommentReport = function (form) {
509
- return __awaiter(this, void 0, void 0, function () {
510
- return __generator(this, function (_a) {
511
- return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/report/resolve", form)];
512
- });
513
- });
430
+ return this.wrapper(HttpType.Put, "/comment/report/resolve", form);
514
431
  };
515
432
  /**
516
433
  * List comment reports.
434
+ *
435
+ * `HTTP.GET /comment/report/list`
517
436
  */
518
437
  LemmyHttp.prototype.listCommentReports = function (form) {
519
- return __awaiter(this, void 0, void 0, function () {
520
- return __generator(this, function (_a) {
521
- return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/report/list", form)];
522
- });
523
- });
438
+ return this.wrapper(HttpType.Get, "/comment/report/list", form);
524
439
  };
525
440
  /**
526
441
  * Get / fetch private messages.
442
+ *
443
+ * `HTTP.GET /private_message/list`
527
444
  */
528
445
  LemmyHttp.prototype.getPrivateMessages = function (form) {
529
- return __awaiter(this, void 0, void 0, function () {
530
- return __generator(this, function (_a) {
531
- return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/list", form)];
532
- });
533
- });
446
+ return this.wrapper(HttpType.Get, "/private_message/list", form);
534
447
  };
535
448
  /**
536
449
  * Create a private message.
450
+ *
451
+ * `HTTP.POST /private_message`
537
452
  */
538
453
  LemmyHttp.prototype.createPrivateMessage = function (form) {
539
- return __awaiter(this, void 0, void 0, function () {
540
- return __generator(this, function (_a) {
541
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message", form)];
542
- });
543
- });
454
+ return this.wrapper(HttpType.Post, "/private_message", form);
544
455
  };
545
456
  /**
546
457
  * Edit a private message.
458
+ *
459
+ * `HTTP.PUT /private_message`
547
460
  */
548
461
  LemmyHttp.prototype.editPrivateMessage = function (form) {
549
- return __awaiter(this, void 0, void 0, function () {
550
- return __generator(this, function (_a) {
551
- return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message", form)];
552
- });
553
- });
462
+ return this.wrapper(HttpType.Put, "/private_message", form);
554
463
  };
555
464
  /**
556
465
  * Delete a private message.
466
+ *
467
+ * `HTTP.POST /private_message/delete`
557
468
  */
558
469
  LemmyHttp.prototype.deletePrivateMessage = function (form) {
559
- return __awaiter(this, void 0, void 0, function () {
560
- return __generator(this, function (_a) {
561
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/delete", form)];
562
- });
563
- });
470
+ return this.wrapper(HttpType.Post, "/private_message/delete", form);
564
471
  };
565
472
  /**
566
473
  * Mark a private message as read.
474
+ *
475
+ * `HTTP.POST /private_message/mark_as_read`
567
476
  */
568
477
  LemmyHttp.prototype.markPrivateMessageAsRead = function (form) {
569
- return __awaiter(this, void 0, void 0, function () {
570
- return __generator(this, function (_a) {
571
- return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/mark_as_read", form)];
572
- });
573
- });
478
+ return this.wrapper(HttpType.Post, "/private_message/mark_as_read", form);
479
+ };
480
+ /**
481
+ * Create a report for a private message.
482
+ *
483
+ * `HTTP.POST /private_message/report`
484
+ */
485
+ LemmyHttp.prototype.createPrivateMessageReport = function (form) {
486
+ return this.wrapper(HttpType.Post, "/private_message/report", form);
487
+ };
488
+ /**
489
+ * Resolve a report for a private message.
490
+ *
491
+ * `HTTP.PUT /private_message/report/resolve`
492
+ */
493
+ LemmyHttp.prototype.resolvePrivateMessageReport = function (form) {
494
+ return this.wrapper(HttpType.Put, "/private_message/report/resolve", form);
495
+ };
496
+ /**
497
+ * List private message reports.
498
+ *
499
+ * `HTTP.GET /private_message/report/list`
500
+ */
501
+ LemmyHttp.prototype.listPrivateMessageReports = function (form) {
502
+ return this.wrapper(HttpType.Get, "/private_message/report/list", form);
574
503
  };
575
504
  /**
576
505
  * Register a new user.
506
+ *
507
+ * `HTTP.POST /user/register`
577
508
  */
578
509
  LemmyHttp.prototype.register = function (form) {
579
- return __awaiter(this, void 0, void 0, function () {
580
- return __generator(this, function (_a) {
581
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/register", form)];
582
- });
583
- });
510
+ return this.wrapper(HttpType.Post, "/user/register", form);
584
511
  };
585
512
  /**
586
513
  * Log into lemmy.
514
+ *
515
+ * `HTTP.POST /user/login`
587
516
  */
588
517
  LemmyHttp.prototype.login = function (form) {
589
- return __awaiter(this, void 0, void 0, function () {
590
- return __generator(this, function (_a) {
591
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/login", form)];
592
- });
593
- });
518
+ return this.wrapper(HttpType.Post, "/user/login", form);
594
519
  };
595
520
  /**
596
521
  * Get the details for a person.
522
+ *
523
+ * `HTTP.GET /user`
597
524
  */
598
525
  LemmyHttp.prototype.getPersonDetails = function (form) {
599
- return __awaiter(this, void 0, void 0, function () {
600
- return __generator(this, function (_a) {
601
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user", form)];
602
- });
603
- });
526
+ return this.wrapper(HttpType.Get, "/user", form);
604
527
  };
605
528
  /**
606
529
  * Get mentions for your user.
530
+ *
531
+ * `HTTP.GET /user/mention`
607
532
  */
608
533
  LemmyHttp.prototype.getPersonMentions = function (form) {
609
- return __awaiter(this, void 0, void 0, function () {
610
- return __generator(this, function (_a) {
611
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/mention", form)];
612
- });
613
- });
534
+ return this.wrapper(HttpType.Get, "/user/mention", form);
614
535
  };
615
536
  /**
616
537
  * Mark a person mention as read.
538
+ *
539
+ * `HTTP.POST /user/mention/mark_as_read`
617
540
  */
618
541
  LemmyHttp.prototype.markPersonMentionAsRead = function (form) {
619
- return __awaiter(this, void 0, void 0, function () {
620
- return __generator(this, function (_a) {
621
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mention/mark_as_read", form)];
622
- });
623
- });
542
+ return this.wrapper(HttpType.Post, "/user/mention/mark_as_read", form);
624
543
  };
625
544
  /**
626
545
  * Get comment replies.
546
+ *
547
+ * `HTTP.GET /user/replies`
627
548
  */
628
549
  LemmyHttp.prototype.getReplies = function (form) {
629
- return __awaiter(this, void 0, void 0, function () {
630
- return __generator(this, function (_a) {
631
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/replies", form)];
632
- });
633
- });
550
+ return this.wrapper(HttpType.Get, "/user/replies", form);
634
551
  };
635
552
  /**
636
553
  * Ban a person from your site.
554
+ *
555
+ * `HTTP.POST /user/ban`
637
556
  */
638
557
  LemmyHttp.prototype.banPerson = function (form) {
639
- return __awaiter(this, void 0, void 0, function () {
640
- return __generator(this, function (_a) {
641
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/ban", form)];
642
- });
643
- });
558
+ return this.wrapper(HttpType.Post, "/user/ban", form);
644
559
  };
645
560
  /**
646
561
  * Get a list of banned users
562
+ *
563
+ * `HTTP.GET /user/banned`
647
564
  */
648
565
  LemmyHttp.prototype.getBannedPersons = function (form) {
649
- return __awaiter(this, void 0, void 0, function () {
650
- return __generator(this, function (_a) {
651
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/banned", form)];
652
- });
653
- });
566
+ return this.wrapper(HttpType.Get, "/user/banned", form);
654
567
  };
655
568
  /**
656
569
  * Block a person.
570
+ *
571
+ * `HTTP.POST /user/block`
657
572
  */
658
573
  LemmyHttp.prototype.blockPerson = function (form) {
659
- return __awaiter(this, void 0, void 0, function () {
660
- return __generator(this, function (_a) {
661
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/block", form)];
662
- });
663
- });
574
+ return this.wrapper(HttpType.Post, "/user/block", form);
664
575
  };
665
576
  /**
666
577
  * Fetch a Captcha.
578
+ *
579
+ * `HTTP.GET /user/get_captcha`
667
580
  */
668
581
  LemmyHttp.prototype.getCaptcha = function () {
669
- return __awaiter(this, void 0, void 0, function () {
670
- return __generator(this, function (_a) {
671
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/get_captcha", {})];
672
- });
673
- });
582
+ return this.wrapper(HttpType.Get, "/user/get_captcha", {});
674
583
  };
675
584
  /**
676
585
  * Delete your account.
586
+ *
587
+ * `HTTP.POST /user/delete_account`
677
588
  */
678
589
  LemmyHttp.prototype.deleteAccount = function (form) {
679
- return __awaiter(this, void 0, void 0, function () {
680
- return __generator(this, function (_a) {
681
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/delete_account", form)];
682
- });
683
- });
590
+ return this.wrapper(HttpType.Post, "/user/delete_account", form);
684
591
  };
685
592
  /**
686
593
  * Reset your password.
594
+ *
595
+ * `HTTP.POST /user/password_reset`
687
596
  */
688
597
  LemmyHttp.prototype.passwordReset = function (form) {
689
- return __awaiter(this, void 0, void 0, function () {
690
- return __generator(this, function (_a) {
691
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_reset", form)];
692
- });
693
- });
598
+ return this.wrapper(HttpType.Post, "/user/password_reset", form);
694
599
  };
695
600
  /**
696
601
  * Change your password from an email / token based reset.
602
+ *
603
+ * `HTTP.POST /user/password_change`
697
604
  */
698
- LemmyHttp.prototype.passwordChange = function (form) {
699
- return __awaiter(this, void 0, void 0, function () {
700
- return __generator(this, function (_a) {
701
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_change", form)];
702
- });
703
- });
605
+ LemmyHttp.prototype.passwordChangeAfterReset = function (form) {
606
+ return this.wrapper(HttpType.Post, "/user/password_change", form);
704
607
  };
705
608
  /**
706
609
  * Mark all replies as read.
610
+ *
611
+ * `HTTP.POST /user/mark_all_as_read`
707
612
  */
708
613
  LemmyHttp.prototype.markAllAsRead = function (form) {
709
- return __awaiter(this, void 0, void 0, function () {
710
- return __generator(this, function (_a) {
711
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mark_all_as_read", form)];
712
- });
713
- });
614
+ return this.wrapper(HttpType.Post, "/user/mark_all_as_read", form);
714
615
  };
715
616
  /**
716
617
  * Save your user settings.
618
+ *
619
+ * `HTTP.PUT /user/save_user_settings`
717
620
  */
718
621
  LemmyHttp.prototype.saveUserSettings = function (form) {
719
- return __awaiter(this, void 0, void 0, function () {
720
- return __generator(this, function (_a) {
721
- return [2 /*return*/, this.wrapper(HttpType.Put, "/user/save_user_settings", form)];
722
- });
723
- });
622
+ return this.wrapper(HttpType.Put, "/user/save_user_settings", form);
724
623
  };
725
624
  /**
726
625
  * Change your user password.
626
+ *
627
+ * `HTTP.PUT /user/change_password`
727
628
  */
728
629
  LemmyHttp.prototype.changePassword = function (form) {
729
- return __awaiter(this, void 0, void 0, function () {
730
- return __generator(this, function (_a) {
731
- return [2 /*return*/, this.wrapper(HttpType.Put, "/user/change_password", form)];
732
- });
733
- });
630
+ return this.wrapper(HttpType.Put, "/user/change_password", form);
734
631
  };
735
632
  /**
736
633
  * Get counts for your reports
634
+ *
635
+ * `HTTP.GET /user/report_count`
737
636
  */
738
637
  LemmyHttp.prototype.getReportCount = function (form) {
739
- return __awaiter(this, void 0, void 0, function () {
740
- return __generator(this, function (_a) {
741
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/report_count", form)];
742
- });
743
- });
638
+ return this.wrapper(HttpType.Get, "/user/report_count", form);
744
639
  };
745
640
  /**
746
641
  * Get your unread counts
642
+ *
643
+ * `HTTP.GET /user/unread_count`
747
644
  */
748
645
  LemmyHttp.prototype.getUnreadCount = function (form) {
749
- return __awaiter(this, void 0, void 0, function () {
750
- return __generator(this, function (_a) {
751
- return [2 /*return*/, this.wrapper(HttpType.Get, "/user/unread_count", form)];
752
- });
753
- });
646
+ return this.wrapper(HttpType.Get, "/user/unread_count", form);
754
647
  };
755
648
  /**
756
649
  * Verify your email
650
+ *
651
+ * `HTTP.POST /user/verify_email`
757
652
  */
758
653
  LemmyHttp.prototype.verifyEmail = function (form) {
759
- return __awaiter(this, void 0, void 0, function () {
760
- return __generator(this, function (_a) {
761
- return [2 /*return*/, this.wrapper(HttpType.Post, "/user/verify_email", form)];
762
- });
763
- });
654
+ return this.wrapper(HttpType.Post, "/user/verify_email", form);
764
655
  };
765
656
  /**
766
657
  * Add an admin to your site.
658
+ *
659
+ * `HTTP.POST /admin/add`
767
660
  */
768
661
  LemmyHttp.prototype.addAdmin = function (form) {
662
+ return this.wrapper(HttpType.Post, "/admin/add", form);
663
+ };
664
+ /**
665
+ * Get the unread registration applications count.
666
+ *
667
+ * `HTTP.GET /admin/registration_application/count`
668
+ */
669
+ LemmyHttp.prototype.getUnreadRegistrationApplicationCount = function (form) {
670
+ return this.wrapper(HttpType.Get, "/admin/registration_application/count", form);
671
+ };
672
+ /**
673
+ * List the registration applications.
674
+ *
675
+ * `HTTP.GET /admin/registration_application/list`
676
+ */
677
+ LemmyHttp.prototype.listRegistrationApplications = function (form) {
678
+ return this.wrapper(HttpType.Get, "/admin/registration_application/list", form);
679
+ };
680
+ /**
681
+ * Approve a registration application
682
+ *
683
+ * `HTTP.PUT /admin/registration_application/approve`
684
+ */
685
+ LemmyHttp.prototype.approveRegistrationApplication = function (form) {
686
+ return this.wrapper(HttpType.Put, "/admin/registration_application/approve", form);
687
+ };
688
+ /**
689
+ * Purge / Delete a person from the database.
690
+ *
691
+ * `HTTP.POST /admin/purge/person`
692
+ */
693
+ LemmyHttp.prototype.purgePerson = function (form) {
694
+ return this.wrapper(HttpType.Post, "/admin/purge/person", form);
695
+ };
696
+ /**
697
+ * Purge / Delete a community from the database.
698
+ *
699
+ * `HTTP.POST /admin/purge/community`
700
+ */
701
+ LemmyHttp.prototype.purgeCommunity = function (form) {
702
+ return this.wrapper(HttpType.Post, "/admin/purge/community", form);
703
+ };
704
+ /**
705
+ * Purge / Delete a post from the database.
706
+ *
707
+ * `HTTP.POST /admin/purge/post`
708
+ */
709
+ LemmyHttp.prototype.purgePost = function (form) {
710
+ return this.wrapper(HttpType.Post, "/admin/purge/post", form);
711
+ };
712
+ /**
713
+ * Purge / Delete a comment from the database.
714
+ *
715
+ * `HTTP.POST /admin/purge/comment`
716
+ */
717
+ LemmyHttp.prototype.purgeComment = function (form) {
718
+ return this.wrapper(HttpType.Post, "/admin/purge/comment", form);
719
+ };
720
+ /**
721
+ * Create a new custom emoji
722
+ *
723
+ * `HTTP.POST /custom_emoji`
724
+ */
725
+ LemmyHttp.prototype.createCustomEmoji = function (form) {
769
726
  return __awaiter(this, void 0, void 0, function () {
770
727
  return __generator(this, function (_a) {
771
- return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/add", form)];
728
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/custom_emoji", form)];
772
729
  });
773
730
  });
774
731
  };
775
732
  /**
776
- * Get the unread registration applications count.
733
+ * Edit an existing custom emoji
734
+ *
735
+ * `HTTP.PUT /custom_emoji`
777
736
  */
778
- LemmyHttp.prototype.getUnreadRegistrationApplicationCount = function (form) {
737
+ LemmyHttp.prototype.editCustomEmoji = function (form) {
779
738
  return __awaiter(this, void 0, void 0, function () {
780
739
  return __generator(this, function (_a) {
781
- return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/count", form)];
740
+ return [2 /*return*/, this.wrapper(HttpType.Put, "/custom_emoji", form)];
782
741
  });
783
742
  });
784
743
  };
785
744
  /**
786
- * List the unread registration applications.
745
+ * Delete a custom emoji
746
+ *
747
+ * `HTTP.Post /custom_emoji/delete`
787
748
  */
788
- LemmyHttp.prototype.listRegistrationApplications = function (form) {
749
+ LemmyHttp.prototype.deleteCustomEmoji = function (form) {
789
750
  return __awaiter(this, void 0, void 0, function () {
790
751
  return __generator(this, function (_a) {
791
- return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/list", form)];
752
+ return [2 /*return*/, this.wrapper(HttpType.Post, "/custom_emoji/delete", form)];
792
753
  });
793
754
  });
794
755
  };
795
756
  /**
796
- * Approve a registration application
757
+ * Upload an image to the server.
797
758
  */
798
- LemmyHttp.prototype.approveRegistrationApplication = function (form) {
759
+ LemmyHttp.prototype.uploadImage = function (_a) {
760
+ var _b, _c, _d, _e;
761
+ var image = _a.image, auth = _a.auth;
799
762
  return __awaiter(this, void 0, void 0, function () {
800
- return __generator(this, function (_a) {
801
- return [2 /*return*/, this.wrapper(HttpType.Put, "/admin/registration_application/approve", form)];
763
+ var formData, headers, url, delete_url, response, responseJson, _f, hash, deleteToken;
764
+ return __generator(this, function (_g) {
765
+ switch (_g.label) {
766
+ case 0:
767
+ formData = createFormData(image);
768
+ headers = {};
769
+ if (!((_c = (_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _b === void 0 ? void 0 : _b.cookie) === null || _c === void 0 ? void 0 : _c.includes("jwt=")) &&
770
+ !((_e = (_d = this.headers) === null || _d === void 0 ? void 0 : _d.Cookie) === null || _e === void 0 ? void 0 : _e.includes("jwt="))) {
771
+ headers.Cookie = "jwt=".concat(auth);
772
+ }
773
+ url = undefined;
774
+ delete_url = undefined;
775
+ return [4 /*yield*/, (0, cross_fetch_1.default)(this.pictrsUrl, {
776
+ method: HttpType.Post,
777
+ body: formData,
778
+ headers: __assign(__assign({}, this.headers), headers),
779
+ })];
780
+ case 1:
781
+ response = _g.sent();
782
+ return [4 /*yield*/, response.json()];
783
+ case 2:
784
+ responseJson = _g.sent();
785
+ if (responseJson.msg === "ok") {
786
+ _f = responseJson.files[0], hash = _f.file, deleteToken = _f.delete_token;
787
+ delete_url = "".concat(this.pictrsUrl, "/delete/").concat(deleteToken, "/").concat(hash);
788
+ url = "".concat(this.pictrsUrl, "/").concat(hash);
789
+ }
790
+ return [2 /*return*/, __assign(__assign({}, responseJson), { url: url, delete_url: delete_url })];
791
+ }
802
792
  });
803
793
  });
804
794
  };
@@ -807,23 +797,30 @@ var LemmyHttp = /** @class */ (function () {
807
797
  };
808
798
  LemmyHttp.prototype.wrapper = function (type_, endpoint, form) {
809
799
  return __awaiter(this, void 0, void 0, function () {
810
- var getUrl;
811
- return __generator(this, function (_a) {
812
- if (type_ == HttpType.Get) {
813
- getUrl = "".concat(this.buildFullUrl(endpoint), "?").concat(encodeGetParams(form));
814
- return [2 /*return*/, (0, node_fetch_1.default)(getUrl, {
815
- method: "GET",
816
- headers: this.headers,
817
- }).then(function (d) { return d.json(); })];
818
- }
819
- else {
820
- return [2 /*return*/, (0, node_fetch_1.default)(this.buildFullUrl(endpoint), {
800
+ var getUrl, response, response;
801
+ return __generator(this, function (_a) {
802
+ switch (_a.label) {
803
+ case 0:
804
+ if (!(type_ === HttpType.Get)) return [3 /*break*/, 3];
805
+ getUrl = "".concat(this.buildFullUrl(endpoint), "?").concat(encodeGetParams(form));
806
+ return [4 /*yield*/, (0, cross_fetch_1.default)(getUrl, {
807
+ method: HttpType.Get,
808
+ headers: this.headers,
809
+ })];
810
+ case 1:
811
+ response = _a.sent();
812
+ return [4 /*yield*/, response.json()];
813
+ case 2: return [2 /*return*/, _a.sent()];
814
+ case 3: return [4 /*yield*/, (0, cross_fetch_1.default)(this.buildFullUrl(endpoint), {
821
815
  method: type_,
822
816
  headers: __assign({ "Content-Type": "application/json" }, this.headers),
823
817
  body: JSON.stringify(form),
824
- }).then(function (d) { return d.json(); })];
818
+ })];
819
+ case 4:
820
+ response = _a.sent();
821
+ return [4 /*yield*/, response.json()];
822
+ case 5: return [2 /*return*/, _a.sent()];
825
823
  }
826
- return [2 /*return*/];
827
824
  });
828
825
  });
829
826
  };
@@ -831,7 +828,28 @@ var LemmyHttp = /** @class */ (function () {
831
828
  }());
832
829
  exports.LemmyHttp = LemmyHttp;
833
830
  function encodeGetParams(p) {
834
- return Object.entries(p)
835
- .map(function (kv) { return kv.map(encodeURIComponent).join("="); })
836
- .join("&");
831
+ // console.log(JSON.stringify(p));
832
+ // console.log(new URLSearchParams(JSON.stringify(p)).toString());
833
+ // return new URLSearchParams(JSON.stringify(p)).toString();
834
+ return (Object.entries(p)
835
+ .filter(function (kv) { return !!kv[1]; })
836
+ .map(function (kv) {
837
+ return kv
838
+ .map(function (e) { return JSON.stringify(e); })
839
+ .map(encodeURIComponent)
840
+ .join("=");
841
+ })
842
+ // .map(kv => (kv.0 + '=' + JSON.stringify(kv.1)))
843
+ .join("&"));
844
+ }
845
+ function createFormData(image) {
846
+ var formData = new form_data_1.default();
847
+ if (image.constructor.name === "File") {
848
+ formData.append("images[]", image);
849
+ }
850
+ else {
851
+ // The filename doesn't affect the file type or file name that ends up in pictrs
852
+ formData.append("images[]", image, { filename: "image.jpg" });
853
+ }
854
+ return formData;
837
855
  }