lemmy-js-client 0.17.2-rc.2 → 0.17.2-rc.21

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