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