lemmy-js-client 0.19.3-alpha.2 → 0.19.3-alpha.5

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