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