lemmy-js-client 0.17.2 → 0.18.0-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -20
- package/dist/http.d.ts +184 -17
- package/dist/http.js +395 -625
- package/dist/index.d.ts +248 -2
- package/dist/index.js +0 -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/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 +11 -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 +14 -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 +10 -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 +9 -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 +17 -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 +30 -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 +16 -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 +6 -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 +22 -0
- package/dist/types/others.js +4 -0
- 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 -303
- 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 -357
- package/dist/interfaces/source.js +0 -9
- package/dist/interfaces/views.d.ts +0 -221
- package/dist/websocket.d.ts +0 -358
- package/dist/websocket.js +0 -535
- /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
@@ -1,15 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
3
|
-
__assign = Object.assign || function(t) {
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
-
s = arguments[i];
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
-
t[p] = s[p];
|
8
|
-
}
|
9
|
-
return t;
|
10
|
-
};
|
11
|
-
return __assign.apply(this, arguments);
|
12
|
-
};
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -19,37 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
19
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
20
9
|
});
|
21
10
|
};
|
22
|
-
var
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
case 0: case 1: t = op; break;
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
36
|
-
default:
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
41
|
-
if (t[2]) _.ops.pop();
|
42
|
-
_.trys.pop(); continue;
|
43
|
-
}
|
44
|
-
op = body.call(thisArg, _);
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
47
|
-
}
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
16
|
+
};
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
48
21
|
};
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
24
|
+
};
|
25
|
+
var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_pictrsUrl, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_wrapper;
|
49
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
50
27
|
exports.LemmyHttp = void 0;
|
51
|
-
|
52
|
-
|
28
|
+
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
29
|
+
const form_data_1 = __importDefault(require("form-data"));
|
30
|
+
const others_1 = require("./types/others");
|
53
31
|
var HttpType;
|
54
32
|
(function (HttpType) {
|
55
33
|
HttpType["Get"] = "GET";
|
@@ -59,17 +37,25 @@ var HttpType;
|
|
59
37
|
/**
|
60
38
|
* Helps build lemmy HTTP requests.
|
61
39
|
*/
|
62
|
-
|
40
|
+
class LemmyHttp {
|
63
41
|
/**
|
64
42
|
* Generates a new instance of LemmyHttp.
|
65
43
|
* @param baseUrl the base url, without the vX version: https://lemmy.ml -> goes to https://lemmy.ml/api/vX
|
66
44
|
* @param headers optional headers. Should contain `x-real-ip` and `x-forwarded-for` .
|
67
45
|
*/
|
68
|
-
|
69
|
-
this
|
70
|
-
|
71
|
-
|
72
|
-
|
46
|
+
constructor(baseUrl, options) {
|
47
|
+
_LemmyHttp_instances.add(this);
|
48
|
+
_LemmyHttp_apiUrl.set(this, void 0);
|
49
|
+
_LemmyHttp_headers.set(this, {});
|
50
|
+
_LemmyHttp_pictrsUrl.set(this, void 0);
|
51
|
+
_LemmyHttp_fetchFunction.set(this, cross_fetch_1.default);
|
52
|
+
__classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${others_1.VERSION}`, "f");
|
53
|
+
__classPrivateFieldSet(this, _LemmyHttp_pictrsUrl, `${baseUrl}/pictrs/image`, "f");
|
54
|
+
if (options === null || options === void 0 ? void 0 : options.headers) {
|
55
|
+
__classPrivateFieldSet(this, _LemmyHttp_headers, options.headers, "f");
|
56
|
+
}
|
57
|
+
if (options === null || options === void 0 ? void 0 : options.fetchFunction) {
|
58
|
+
__classPrivateFieldSet(this, _LemmyHttp_fetchFunction, options.fetchFunction, "f");
|
73
59
|
}
|
74
60
|
}
|
75
61
|
/**
|
@@ -77,980 +63,764 @@ var LemmyHttp = /** @class */ (function () {
|
|
77
63
|
*
|
78
64
|
* `HTTP.GET /site`
|
79
65
|
*/
|
80
|
-
|
81
|
-
return
|
82
|
-
|
83
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/site", form)];
|
84
|
-
});
|
85
|
-
});
|
86
|
-
};
|
66
|
+
getSite(form) {
|
67
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/site", form);
|
68
|
+
}
|
87
69
|
/**
|
88
70
|
* Create your site.
|
89
71
|
*
|
90
72
|
* `HTTP.POST /site`
|
91
73
|
*/
|
92
|
-
|
93
|
-
return
|
94
|
-
|
95
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/site", form)];
|
96
|
-
});
|
97
|
-
});
|
98
|
-
};
|
74
|
+
createSite(form) {
|
75
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site", form);
|
76
|
+
}
|
99
77
|
/**
|
100
78
|
* Edit your site.
|
101
79
|
*
|
102
80
|
* `HTTP.PUT /site`
|
103
81
|
*/
|
104
|
-
|
105
|
-
return
|
106
|
-
|
107
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/site", form)];
|
108
|
-
});
|
109
|
-
});
|
110
|
-
};
|
82
|
+
editSite(form) {
|
83
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/site", form);
|
84
|
+
}
|
111
85
|
/**
|
112
86
|
* Leave the Site admins.
|
113
87
|
*
|
114
88
|
* `HTTP.POST /user/leave_admin`
|
115
89
|
*/
|
116
|
-
|
117
|
-
return
|
118
|
-
|
119
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/leave_admin", form)];
|
120
|
-
});
|
121
|
-
});
|
122
|
-
};
|
90
|
+
leaveAdmin(form) {
|
91
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", form);
|
92
|
+
}
|
123
93
|
/**
|
124
94
|
* Get the modlog.
|
125
95
|
*
|
126
96
|
* `HTTP.GET /modlog`
|
127
97
|
*/
|
128
|
-
|
129
|
-
return
|
130
|
-
|
131
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/modlog", form)];
|
132
|
-
});
|
133
|
-
});
|
134
|
-
};
|
98
|
+
getModlog(form) {
|
99
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/modlog", form);
|
100
|
+
}
|
135
101
|
/**
|
136
102
|
* Search lemmy.
|
137
103
|
*
|
138
104
|
* `HTTP.GET /search`
|
139
105
|
*/
|
140
|
-
|
141
|
-
return
|
142
|
-
|
143
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/search", form)];
|
144
|
-
});
|
145
|
-
});
|
146
|
-
};
|
106
|
+
search(form) {
|
107
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/search", form);
|
108
|
+
}
|
147
109
|
/**
|
148
110
|
* Fetch a non-local / federated object.
|
149
111
|
*
|
150
112
|
* `HTTP.GET /resolve_object`
|
151
113
|
*/
|
152
|
-
|
153
|
-
return
|
154
|
-
|
155
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/resolve_object", form)];
|
156
|
-
});
|
157
|
-
});
|
158
|
-
};
|
114
|
+
resolveObject(form) {
|
115
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/resolve_object", form);
|
116
|
+
}
|
159
117
|
/**
|
160
118
|
* Create a new community.
|
161
119
|
*
|
162
120
|
* `HTTP.POST /community`
|
163
121
|
*/
|
164
|
-
|
165
|
-
return
|
166
|
-
|
167
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community", form)];
|
168
|
-
});
|
169
|
-
});
|
170
|
-
};
|
122
|
+
createCommunity(form) {
|
123
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community", form);
|
124
|
+
}
|
171
125
|
/**
|
172
126
|
* Get / fetch a community.
|
173
127
|
*
|
174
128
|
* `HTTP.GET /community`
|
175
129
|
*/
|
176
|
-
|
177
|
-
return
|
178
|
-
|
179
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/community", form)];
|
180
|
-
});
|
181
|
-
});
|
182
|
-
};
|
130
|
+
getCommunity(form) {
|
131
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community", form);
|
132
|
+
}
|
183
133
|
/**
|
184
134
|
* Edit a community.
|
185
135
|
*
|
186
136
|
* `HTTP.PUT /community`
|
187
137
|
*/
|
188
|
-
|
189
|
-
return
|
190
|
-
|
191
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/community", form)];
|
192
|
-
});
|
193
|
-
});
|
194
|
-
};
|
138
|
+
editCommunity(form) {
|
139
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community", form);
|
140
|
+
}
|
195
141
|
/**
|
196
142
|
* List communities, with various filters.
|
197
143
|
*
|
198
144
|
* `HTTP.GET /community/list`
|
199
145
|
*/
|
200
|
-
|
201
|
-
return
|
202
|
-
|
203
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/community/list", form)];
|
204
|
-
});
|
205
|
-
});
|
206
|
-
};
|
146
|
+
listCommunities(form) {
|
147
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/list", form);
|
148
|
+
}
|
207
149
|
/**
|
208
150
|
* Follow / subscribe to a community.
|
209
151
|
*
|
210
152
|
* `HTTP.POST /community/follow`
|
211
153
|
*/
|
212
|
-
|
213
|
-
return
|
214
|
-
|
215
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/follow", form)];
|
216
|
-
});
|
217
|
-
});
|
218
|
-
};
|
154
|
+
followCommunity(form) {
|
155
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/follow", form);
|
156
|
+
}
|
219
157
|
/**
|
220
158
|
* Block a community.
|
221
159
|
*
|
222
160
|
* `HTTP.POST /community/block`
|
223
161
|
*/
|
224
|
-
|
225
|
-
return
|
226
|
-
|
227
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/block", form)];
|
228
|
-
});
|
229
|
-
});
|
230
|
-
};
|
162
|
+
blockCommunity(form) {
|
163
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/block", form);
|
164
|
+
}
|
231
165
|
/**
|
232
166
|
* Delete a community.
|
233
167
|
*
|
234
168
|
* `HTTP.POST /community/delete`
|
235
169
|
*/
|
236
|
-
|
237
|
-
return
|
238
|
-
|
239
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/delete", form)];
|
240
|
-
});
|
241
|
-
});
|
242
|
-
};
|
170
|
+
deleteCommunity(form) {
|
171
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/delete", form);
|
172
|
+
}
|
243
173
|
/**
|
244
174
|
* A moderator remove for a community.
|
245
175
|
*
|
246
176
|
* `HTTP.POST /community/remove`
|
247
177
|
*/
|
248
|
-
|
249
|
-
return
|
250
|
-
|
251
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/remove", form)];
|
252
|
-
});
|
253
|
-
});
|
254
|
-
};
|
178
|
+
removeCommunity(form) {
|
179
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/remove", form);
|
180
|
+
}
|
255
181
|
/**
|
256
182
|
* Transfer your community to an existing moderator.
|
257
183
|
*
|
258
184
|
* `HTTP.POST /community/transfer`
|
259
185
|
*/
|
260
|
-
|
261
|
-
return
|
262
|
-
|
263
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/transfer", form)];
|
264
|
-
});
|
265
|
-
});
|
266
|
-
};
|
186
|
+
transferCommunity(form) {
|
187
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/transfer", form);
|
188
|
+
}
|
267
189
|
/**
|
268
190
|
* Ban a user from a community.
|
269
191
|
*
|
270
192
|
* `HTTP.POST /community/ban_user`
|
271
193
|
*/
|
272
|
-
|
273
|
-
return
|
274
|
-
|
275
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/ban_user", form)];
|
276
|
-
});
|
277
|
-
});
|
278
|
-
};
|
194
|
+
banFromCommunity(form) {
|
195
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/ban_user", form);
|
196
|
+
}
|
279
197
|
/**
|
280
198
|
* Add a moderator to your community.
|
281
199
|
*
|
282
200
|
* `HTTP.POST /community/mod`
|
283
201
|
*/
|
284
|
-
|
285
|
-
return
|
286
|
-
|
287
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/community/mod", form)];
|
288
|
-
});
|
289
|
-
});
|
290
|
-
};
|
202
|
+
addModToCommunity(form) {
|
203
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/mod", form);
|
204
|
+
}
|
291
205
|
/**
|
292
206
|
* Create a post.
|
293
207
|
*
|
294
208
|
* `HTTP.POST /post`
|
295
209
|
*/
|
296
|
-
|
297
|
-
return
|
298
|
-
|
299
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post", form)];
|
300
|
-
});
|
301
|
-
});
|
302
|
-
};
|
210
|
+
createPost(form) {
|
211
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post", form);
|
212
|
+
}
|
303
213
|
/**
|
304
214
|
* Get / fetch a post.
|
305
215
|
*
|
306
216
|
* `HTTP.GET /post`
|
307
217
|
*/
|
308
|
-
|
309
|
-
return
|
310
|
-
|
311
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/post", form)];
|
312
|
-
});
|
313
|
-
});
|
314
|
-
};
|
218
|
+
getPost(form) {
|
219
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post", form);
|
220
|
+
}
|
315
221
|
/**
|
316
222
|
* Edit a post.
|
317
223
|
*
|
318
224
|
* `HTTP.PUT /post`
|
319
225
|
*/
|
320
|
-
|
321
|
-
return
|
322
|
-
|
323
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/post", form)];
|
324
|
-
});
|
325
|
-
});
|
326
|
-
};
|
226
|
+
editPost(form) {
|
227
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post", form);
|
228
|
+
}
|
327
229
|
/**
|
328
230
|
* Delete a post.
|
329
231
|
*
|
330
232
|
* `HTTP.POST /post/delete`
|
331
233
|
*/
|
332
|
-
|
333
|
-
return
|
334
|
-
|
335
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/delete", form)];
|
336
|
-
});
|
337
|
-
});
|
338
|
-
};
|
234
|
+
deletePost(form) {
|
235
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/delete", form);
|
236
|
+
}
|
339
237
|
/**
|
340
238
|
* A moderator remove for a post.
|
341
239
|
*
|
342
240
|
* `HTTP.POST /post/remove`
|
343
241
|
*/
|
344
|
-
|
345
|
-
return
|
346
|
-
|
347
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/remove", form)];
|
348
|
-
});
|
349
|
-
});
|
350
|
-
};
|
242
|
+
removePost(form) {
|
243
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/remove", form);
|
244
|
+
}
|
351
245
|
/**
|
352
246
|
* Mark a post as read.
|
353
247
|
*
|
354
248
|
* `HTTP.POST /post/mark_as_read`
|
355
249
|
*/
|
356
|
-
|
357
|
-
return
|
358
|
-
|
359
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/mark_as_read", form)];
|
360
|
-
});
|
361
|
-
});
|
362
|
-
};
|
250
|
+
markPostAsRead(form) {
|
251
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/mark_as_read", form);
|
252
|
+
}
|
363
253
|
/**
|
364
254
|
* A moderator can lock a post ( IE disable new comments ).
|
365
255
|
*
|
366
256
|
* `HTTP.POST /post/lock`
|
367
257
|
*/
|
368
|
-
|
369
|
-
return
|
370
|
-
|
371
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/lock", form)];
|
372
|
-
});
|
373
|
-
});
|
374
|
-
};
|
258
|
+
lockPost(form) {
|
259
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/lock", form);
|
260
|
+
}
|
375
261
|
/**
|
376
262
|
* A moderator can feature a community post ( IE stick it to the top of a community ).
|
377
263
|
*
|
378
264
|
* `HTTP.POST /post/feature`
|
379
265
|
*/
|
380
|
-
|
381
|
-
return
|
382
|
-
|
383
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/feature", form)];
|
384
|
-
});
|
385
|
-
});
|
386
|
-
};
|
266
|
+
featurePost(form) {
|
267
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/feature", form);
|
268
|
+
}
|
387
269
|
/**
|
388
270
|
* Get / fetch posts, with various filters.
|
389
271
|
*
|
390
272
|
* `HTTP.GET /post/list`
|
391
273
|
*/
|
392
|
-
|
393
|
-
return
|
394
|
-
|
395
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/post/list", form)];
|
396
|
-
});
|
397
|
-
});
|
398
|
-
};
|
274
|
+
getPosts(form) {
|
275
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/list", form);
|
276
|
+
}
|
399
277
|
/**
|
400
278
|
* Like / vote on a post.
|
401
279
|
*
|
402
280
|
* `HTTP.POST /post/like`
|
403
281
|
*/
|
404
|
-
|
405
|
-
return
|
406
|
-
|
407
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/like", form)];
|
408
|
-
});
|
409
|
-
});
|
410
|
-
};
|
282
|
+
likePost(form) {
|
283
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/like", form);
|
284
|
+
}
|
411
285
|
/**
|
412
286
|
* Save a post.
|
413
287
|
*
|
414
288
|
* `HTTP.PUT /post/save`
|
415
289
|
*/
|
416
|
-
|
417
|
-
return
|
418
|
-
|
419
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/post/save", form)];
|
420
|
-
});
|
421
|
-
});
|
422
|
-
};
|
290
|
+
savePost(form) {
|
291
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/save", form);
|
292
|
+
}
|
423
293
|
/**
|
424
294
|
* Report a post.
|
425
295
|
*
|
426
296
|
* `HTTP.POST /post/report`
|
427
297
|
*/
|
428
|
-
|
429
|
-
return
|
430
|
-
|
431
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/post/report", form)];
|
432
|
-
});
|
433
|
-
});
|
434
|
-
};
|
298
|
+
createPostReport(form) {
|
299
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/report", form);
|
300
|
+
}
|
435
301
|
/**
|
436
302
|
* Resolve a post report. Only a mod can do this.
|
437
303
|
*
|
438
304
|
* `HTTP.PUT /post/report/resolve`
|
439
305
|
*/
|
440
|
-
|
441
|
-
return
|
442
|
-
|
443
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/post/report/resolve", form)];
|
444
|
-
});
|
445
|
-
});
|
446
|
-
};
|
306
|
+
resolvePostReport(form) {
|
307
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/report/resolve", form);
|
308
|
+
}
|
447
309
|
/**
|
448
310
|
* List post reports.
|
449
311
|
*
|
450
312
|
* `HTTP.GET /post/report/list`
|
451
313
|
*/
|
452
|
-
|
453
|
-
return
|
454
|
-
|
455
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/post/report/list", form)];
|
456
|
-
});
|
457
|
-
});
|
458
|
-
};
|
314
|
+
listPostReports(form) {
|
315
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/report/list", form);
|
316
|
+
}
|
459
317
|
/**
|
460
318
|
* Fetch metadata for any given site.
|
461
319
|
*
|
462
320
|
* `HTTP.GET /post/site_metadata`
|
463
321
|
*/
|
464
|
-
|
465
|
-
return
|
466
|
-
|
467
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/post/site_metadata", form)];
|
468
|
-
});
|
469
|
-
});
|
470
|
-
};
|
322
|
+
getSiteMetadata(form) {
|
323
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/site_metadata", form);
|
324
|
+
}
|
471
325
|
/**
|
472
326
|
* Create a comment.
|
473
327
|
*
|
474
328
|
* `HTTP.POST /comment`
|
475
329
|
*/
|
476
|
-
|
477
|
-
return
|
478
|
-
|
479
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment", form)];
|
480
|
-
});
|
481
|
-
});
|
482
|
-
};
|
330
|
+
createComment(form) {
|
331
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment", form);
|
332
|
+
}
|
483
333
|
/**
|
484
334
|
* Edit a comment.
|
485
335
|
*
|
486
336
|
* `HTTP.PUT /comment`
|
487
337
|
*/
|
488
|
-
|
489
|
-
return
|
490
|
-
|
491
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/comment", form)];
|
492
|
-
});
|
493
|
-
});
|
494
|
-
};
|
338
|
+
editComment(form) {
|
339
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment", form);
|
340
|
+
}
|
495
341
|
/**
|
496
342
|
* Delete a comment.
|
497
343
|
*
|
498
344
|
* `HTTP.POST /comment/delete`
|
499
345
|
*/
|
500
|
-
|
501
|
-
return
|
502
|
-
|
503
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/delete", form)];
|
504
|
-
});
|
505
|
-
});
|
506
|
-
};
|
346
|
+
deleteComment(form) {
|
347
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/delete", form);
|
348
|
+
}
|
507
349
|
/**
|
508
350
|
* A moderator remove for a comment.
|
509
351
|
*
|
510
352
|
* `HTTP.POST /comment/remove`
|
511
353
|
*/
|
512
|
-
|
513
|
-
return
|
514
|
-
|
515
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/remove", form)];
|
516
|
-
});
|
517
|
-
});
|
518
|
-
};
|
354
|
+
removeComment(form) {
|
355
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/remove", form);
|
356
|
+
}
|
519
357
|
/**
|
520
358
|
* Mark a comment as read.
|
521
359
|
*
|
522
360
|
* `HTTP.POST /comment/mark_as_read`
|
523
361
|
*/
|
524
|
-
|
525
|
-
return
|
526
|
-
|
527
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/mark_as_read", form)];
|
528
|
-
});
|
529
|
-
});
|
530
|
-
};
|
362
|
+
markCommentReplyAsRead(form) {
|
363
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/mark_as_read", form);
|
364
|
+
}
|
531
365
|
/**
|
532
366
|
* Like / vote on a comment.
|
533
367
|
*
|
534
368
|
* `HTTP.POST /comment/like`
|
535
369
|
*/
|
536
|
-
|
537
|
-
return
|
538
|
-
|
539
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/like", form)];
|
540
|
-
});
|
541
|
-
});
|
542
|
-
};
|
370
|
+
likeComment(form) {
|
371
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/like", form);
|
372
|
+
}
|
543
373
|
/**
|
544
374
|
* Save a comment.
|
545
375
|
*
|
546
376
|
* `HTTP.PUT /comment/save`
|
547
377
|
*/
|
548
|
-
|
549
|
-
return
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
378
|
+
saveComment(form) {
|
379
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/save", form);
|
380
|
+
}
|
381
|
+
/**
|
382
|
+
* Distinguishes a comment (speak as moderator)
|
383
|
+
*
|
384
|
+
* `HTTP.POST /comment/distinguish`
|
385
|
+
*/
|
386
|
+
distinguishComment(form) {
|
387
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/distinguish", form);
|
388
|
+
}
|
555
389
|
/**
|
556
390
|
* Get / fetch comments.
|
557
391
|
*
|
558
392
|
* `HTTP.GET /comment/list`
|
559
393
|
*/
|
560
|
-
|
561
|
-
return
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
394
|
+
getComments(form) {
|
395
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/list", form);
|
396
|
+
}
|
397
|
+
/**
|
398
|
+
* Get / fetch comment.
|
399
|
+
*
|
400
|
+
* `HTTP.GET /comment`
|
401
|
+
*/
|
402
|
+
getComment(form) {
|
403
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment", form);
|
404
|
+
}
|
567
405
|
/**
|
568
406
|
* Report a comment.
|
569
407
|
*
|
570
408
|
* `HTTP.POST /comment/report`
|
571
409
|
*/
|
572
|
-
|
573
|
-
return
|
574
|
-
|
575
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/comment/report", form)];
|
576
|
-
});
|
577
|
-
});
|
578
|
-
};
|
410
|
+
createCommentReport(form) {
|
411
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/report", form);
|
412
|
+
}
|
579
413
|
/**
|
580
414
|
* Resolve a comment report. Only a mod can do this.
|
581
415
|
*
|
582
416
|
* `HTTP.PUT /comment/report/resolve`
|
583
417
|
*/
|
584
|
-
|
585
|
-
return
|
586
|
-
|
587
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/comment/report/resolve", form)];
|
588
|
-
});
|
589
|
-
});
|
590
|
-
};
|
418
|
+
resolveCommentReport(form) {
|
419
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/report/resolve", form);
|
420
|
+
}
|
591
421
|
/**
|
592
422
|
* List comment reports.
|
593
423
|
*
|
594
424
|
* `HTTP.GET /comment/report/list`
|
595
425
|
*/
|
596
|
-
|
597
|
-
return
|
598
|
-
|
599
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/comment/report/list", form)];
|
600
|
-
});
|
601
|
-
});
|
602
|
-
};
|
426
|
+
listCommentReports(form) {
|
427
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/report/list", form);
|
428
|
+
}
|
603
429
|
/**
|
604
430
|
* Get / fetch private messages.
|
605
431
|
*
|
606
432
|
* `HTTP.GET /private_message/list`
|
607
433
|
*/
|
608
|
-
|
609
|
-
return
|
610
|
-
|
611
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/list", form)];
|
612
|
-
});
|
613
|
-
});
|
614
|
-
};
|
434
|
+
getPrivateMessages(form) {
|
435
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/list", form);
|
436
|
+
}
|
615
437
|
/**
|
616
438
|
* Create a private message.
|
617
439
|
*
|
618
440
|
* `HTTP.POST /private_message`
|
619
441
|
*/
|
620
|
-
|
621
|
-
return
|
622
|
-
|
623
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message", form)];
|
624
|
-
});
|
625
|
-
});
|
626
|
-
};
|
442
|
+
createPrivateMessage(form) {
|
443
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message", form);
|
444
|
+
}
|
627
445
|
/**
|
628
446
|
* Edit a private message.
|
629
447
|
*
|
630
448
|
* `HTTP.PUT /private_message`
|
631
449
|
*/
|
632
|
-
|
633
|
-
return
|
634
|
-
|
635
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message", form)];
|
636
|
-
});
|
637
|
-
});
|
638
|
-
};
|
450
|
+
editPrivateMessage(form) {
|
451
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message", form);
|
452
|
+
}
|
639
453
|
/**
|
640
454
|
* Delete a private message.
|
641
455
|
*
|
642
456
|
* `HTTP.POST /private_message/delete`
|
643
457
|
*/
|
644
|
-
|
645
|
-
return
|
646
|
-
|
647
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/delete", form)];
|
648
|
-
});
|
649
|
-
});
|
650
|
-
};
|
458
|
+
deletePrivateMessage(form) {
|
459
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form);
|
460
|
+
}
|
651
461
|
/**
|
652
462
|
* Mark a private message as read.
|
653
463
|
*
|
654
464
|
* `HTTP.POST /private_message/mark_as_read`
|
655
465
|
*/
|
656
|
-
|
657
|
-
return
|
658
|
-
|
659
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/mark_as_read", form)];
|
660
|
-
});
|
661
|
-
});
|
662
|
-
};
|
466
|
+
markPrivateMessageAsRead(form) {
|
467
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form);
|
468
|
+
}
|
663
469
|
/**
|
664
470
|
* Create a report for a private message.
|
665
471
|
*
|
666
472
|
* `HTTP.POST /private_message/report`
|
667
473
|
*/
|
668
|
-
|
669
|
-
return
|
670
|
-
|
671
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/private_message/report", form)];
|
672
|
-
});
|
673
|
-
});
|
674
|
-
};
|
474
|
+
createPrivateMessageReport(form) {
|
475
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/report", form);
|
476
|
+
}
|
675
477
|
/**
|
676
478
|
* Resolve a report for a private message.
|
677
479
|
*
|
678
480
|
* `HTTP.PUT /private_message/report/resolve`
|
679
481
|
*/
|
680
|
-
|
681
|
-
return
|
682
|
-
|
683
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/private_message/report/resolve", form)];
|
684
|
-
});
|
685
|
-
});
|
686
|
-
};
|
482
|
+
resolvePrivateMessageReport(form) {
|
483
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message/report/resolve", form);
|
484
|
+
}
|
687
485
|
/**
|
688
486
|
* List private message reports.
|
689
487
|
*
|
690
488
|
* `HTTP.GET /private_message/report/list`
|
691
489
|
*/
|
692
|
-
|
693
|
-
return
|
694
|
-
|
695
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/private_message/report/list", form)];
|
696
|
-
});
|
697
|
-
});
|
698
|
-
};
|
490
|
+
listPrivateMessageReports(form) {
|
491
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/report/list", form);
|
492
|
+
}
|
699
493
|
/**
|
700
494
|
* Register a new user.
|
701
495
|
*
|
702
496
|
* `HTTP.POST /user/register`
|
703
497
|
*/
|
704
|
-
|
705
|
-
return
|
706
|
-
|
707
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/register", form)];
|
708
|
-
});
|
709
|
-
});
|
710
|
-
};
|
498
|
+
register(form) {
|
499
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/register", form);
|
500
|
+
}
|
711
501
|
/**
|
712
502
|
* Log into lemmy.
|
713
503
|
*
|
714
504
|
* `HTTP.POST /user/login`
|
715
505
|
*/
|
716
|
-
|
717
|
-
return
|
718
|
-
|
719
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/login", form)];
|
720
|
-
});
|
721
|
-
});
|
722
|
-
};
|
506
|
+
login(form) {
|
507
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form);
|
508
|
+
}
|
723
509
|
/**
|
724
510
|
* Get the details for a person.
|
725
511
|
*
|
726
512
|
* `HTTP.GET /user`
|
727
513
|
*/
|
728
|
-
|
729
|
-
return
|
730
|
-
|
731
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user", form)];
|
732
|
-
});
|
733
|
-
});
|
734
|
-
};
|
514
|
+
getPersonDetails(form) {
|
515
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user", form);
|
516
|
+
}
|
735
517
|
/**
|
736
518
|
* Get mentions for your user.
|
737
519
|
*
|
738
520
|
* `HTTP.GET /user/mention`
|
739
521
|
*/
|
740
|
-
|
741
|
-
return
|
742
|
-
|
743
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/mention", form)];
|
744
|
-
});
|
745
|
-
});
|
746
|
-
};
|
522
|
+
getPersonMentions(form) {
|
523
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/mention", form);
|
524
|
+
}
|
747
525
|
/**
|
748
526
|
* Mark a person mention as read.
|
749
527
|
*
|
750
528
|
* `HTTP.POST /user/mention/mark_as_read`
|
751
529
|
*/
|
752
|
-
|
753
|
-
return
|
754
|
-
|
755
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mention/mark_as_read", form)];
|
756
|
-
});
|
757
|
-
});
|
758
|
-
};
|
530
|
+
markPersonMentionAsRead(form) {
|
531
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mention/mark_as_read", form);
|
532
|
+
}
|
759
533
|
/**
|
760
534
|
* Get comment replies.
|
761
535
|
*
|
762
536
|
* `HTTP.GET /user/replies`
|
763
537
|
*/
|
764
|
-
|
765
|
-
return
|
766
|
-
|
767
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/replies", form)];
|
768
|
-
});
|
769
|
-
});
|
770
|
-
};
|
538
|
+
getReplies(form) {
|
539
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/replies", form);
|
540
|
+
}
|
771
541
|
/**
|
772
542
|
* Ban a person from your site.
|
773
543
|
*
|
774
544
|
* `HTTP.POST /user/ban`
|
775
545
|
*/
|
776
|
-
|
777
|
-
return
|
778
|
-
|
779
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/ban", form)];
|
780
|
-
});
|
781
|
-
});
|
782
|
-
};
|
546
|
+
banPerson(form) {
|
547
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/ban", form);
|
548
|
+
}
|
783
549
|
/**
|
784
550
|
* Get a list of banned users
|
785
551
|
*
|
786
552
|
* `HTTP.GET /user/banned`
|
787
553
|
*/
|
788
|
-
|
789
|
-
return
|
790
|
-
|
791
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/banned", form)];
|
792
|
-
});
|
793
|
-
});
|
794
|
-
};
|
554
|
+
getBannedPersons(form) {
|
555
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/banned", form);
|
556
|
+
}
|
795
557
|
/**
|
796
558
|
* Block a person.
|
797
559
|
*
|
798
560
|
* `HTTP.POST /user/block`
|
799
561
|
*/
|
800
|
-
|
801
|
-
return
|
802
|
-
|
803
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/block", form)];
|
804
|
-
});
|
805
|
-
});
|
806
|
-
};
|
562
|
+
blockPerson(form) {
|
563
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/block", form);
|
564
|
+
}
|
807
565
|
/**
|
808
566
|
* Fetch a Captcha.
|
809
567
|
*
|
810
568
|
* `HTTP.GET /user/get_captcha`
|
811
569
|
*/
|
812
|
-
|
813
|
-
return
|
814
|
-
|
815
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/get_captcha", {})];
|
816
|
-
});
|
817
|
-
});
|
818
|
-
};
|
570
|
+
getCaptcha(form) {
|
571
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/get_captcha", form);
|
572
|
+
}
|
819
573
|
/**
|
820
574
|
* Delete your account.
|
821
575
|
*
|
822
576
|
* `HTTP.POST /user/delete_account`
|
823
577
|
*/
|
824
|
-
|
825
|
-
return
|
826
|
-
|
827
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/delete_account", form)];
|
828
|
-
});
|
829
|
-
});
|
830
|
-
};
|
578
|
+
deleteAccount(form) {
|
579
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/delete_account", form);
|
580
|
+
}
|
831
581
|
/**
|
832
582
|
* Reset your password.
|
833
583
|
*
|
834
584
|
* `HTTP.POST /user/password_reset`
|
835
585
|
*/
|
836
|
-
|
837
|
-
return
|
838
|
-
|
839
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_reset", form)];
|
840
|
-
});
|
841
|
-
});
|
842
|
-
};
|
586
|
+
passwordReset(form) {
|
587
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/password_reset", form);
|
588
|
+
}
|
843
589
|
/**
|
844
590
|
* Change your password from an email / token based reset.
|
845
591
|
*
|
846
592
|
* `HTTP.POST /user/password_change`
|
847
593
|
*/
|
848
|
-
|
849
|
-
return
|
850
|
-
|
851
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/password_change", form)];
|
852
|
-
});
|
853
|
-
});
|
854
|
-
};
|
594
|
+
passwordChangeAfterReset(form) {
|
595
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/password_change", form);
|
596
|
+
}
|
855
597
|
/**
|
856
598
|
* Mark all replies as read.
|
857
599
|
*
|
858
600
|
* `HTTP.POST /user/mark_all_as_read`
|
859
601
|
*/
|
860
|
-
|
861
|
-
return
|
862
|
-
|
863
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/mark_all_as_read", form)];
|
864
|
-
});
|
865
|
-
});
|
866
|
-
};
|
602
|
+
markAllAsRead(form) {
|
603
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mark_all_as_read", form);
|
604
|
+
}
|
867
605
|
/**
|
868
606
|
* Save your user settings.
|
869
607
|
*
|
870
608
|
* `HTTP.PUT /user/save_user_settings`
|
871
609
|
*/
|
872
|
-
|
873
|
-
return
|
874
|
-
|
875
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/user/save_user_settings", form)];
|
876
|
-
});
|
877
|
-
});
|
878
|
-
};
|
610
|
+
saveUserSettings(form) {
|
611
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/user/save_user_settings", form);
|
612
|
+
}
|
879
613
|
/**
|
880
614
|
* Change your user password.
|
881
615
|
*
|
882
616
|
* `HTTP.PUT /user/change_password`
|
883
617
|
*/
|
884
|
-
|
885
|
-
return
|
886
|
-
|
887
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/user/change_password", form)];
|
888
|
-
});
|
889
|
-
});
|
890
|
-
};
|
618
|
+
changePassword(form) {
|
619
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/user/change_password", form);
|
620
|
+
}
|
891
621
|
/**
|
892
622
|
* Get counts for your reports
|
893
623
|
*
|
894
624
|
* `HTTP.GET /user/report_count`
|
895
625
|
*/
|
896
|
-
|
897
|
-
return
|
898
|
-
|
899
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/report_count", form)];
|
900
|
-
});
|
901
|
-
});
|
902
|
-
};
|
626
|
+
getReportCount(form) {
|
627
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/report_count", form);
|
628
|
+
}
|
903
629
|
/**
|
904
630
|
* Get your unread counts
|
905
631
|
*
|
906
632
|
* `HTTP.GET /user/unread_count`
|
907
633
|
*/
|
908
|
-
|
909
|
-
return
|
910
|
-
|
911
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/user/unread_count", form)];
|
912
|
-
});
|
913
|
-
});
|
914
|
-
};
|
634
|
+
getUnreadCount(form) {
|
635
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/unread_count", form);
|
636
|
+
}
|
915
637
|
/**
|
916
638
|
* Verify your email
|
917
639
|
*
|
918
640
|
* `HTTP.POST /user/verify_email`
|
919
641
|
*/
|
920
|
-
|
921
|
-
return
|
922
|
-
|
923
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/user/verify_email", form)];
|
924
|
-
});
|
925
|
-
});
|
926
|
-
};
|
642
|
+
verifyEmail(form) {
|
643
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/verify_email", form);
|
644
|
+
}
|
927
645
|
/**
|
928
646
|
* Add an admin to your site.
|
929
647
|
*
|
930
648
|
* `HTTP.POST /admin/add`
|
931
649
|
*/
|
932
|
-
|
933
|
-
return
|
934
|
-
|
935
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/add", form)];
|
936
|
-
});
|
937
|
-
});
|
938
|
-
};
|
650
|
+
addAdmin(form) {
|
651
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/add", form);
|
652
|
+
}
|
939
653
|
/**
|
940
654
|
* Get the unread registration applications count.
|
941
655
|
*
|
942
656
|
* `HTTP.GET /admin/registration_application/count`
|
943
657
|
*/
|
944
|
-
|
945
|
-
return
|
946
|
-
|
947
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/count", form)];
|
948
|
-
});
|
949
|
-
});
|
950
|
-
};
|
658
|
+
getUnreadRegistrationApplicationCount(form) {
|
659
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/count", form);
|
660
|
+
}
|
951
661
|
/**
|
952
662
|
* List the registration applications.
|
953
663
|
*
|
954
664
|
* `HTTP.GET /admin/registration_application/list`
|
955
665
|
*/
|
956
|
-
|
957
|
-
return
|
958
|
-
|
959
|
-
return [2 /*return*/, this.wrapper(HttpType.Get, "/admin/registration_application/list", form)];
|
960
|
-
});
|
961
|
-
});
|
962
|
-
};
|
666
|
+
listRegistrationApplications(form) {
|
667
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/list", form);
|
668
|
+
}
|
963
669
|
/**
|
964
670
|
* Approve a registration application
|
965
671
|
*
|
966
672
|
* `HTTP.PUT /admin/registration_application/approve`
|
967
673
|
*/
|
968
|
-
|
969
|
-
return
|
970
|
-
|
971
|
-
return [2 /*return*/, this.wrapper(HttpType.Put, "/admin/registration_application/approve", form)];
|
972
|
-
});
|
973
|
-
});
|
974
|
-
};
|
674
|
+
approveRegistrationApplication(form) {
|
675
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/admin/registration_application/approve", form);
|
676
|
+
}
|
975
677
|
/**
|
976
678
|
* Purge / Delete a person from the database.
|
977
679
|
*
|
978
680
|
* `HTTP.POST /admin/purge/person`
|
979
681
|
*/
|
980
|
-
|
981
|
-
return
|
982
|
-
|
983
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/person", form)];
|
984
|
-
});
|
985
|
-
});
|
986
|
-
};
|
682
|
+
purgePerson(form) {
|
683
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/person", form);
|
684
|
+
}
|
987
685
|
/**
|
988
686
|
* Purge / Delete a community from the database.
|
989
687
|
*
|
990
688
|
* `HTTP.POST /admin/purge/community`
|
991
689
|
*/
|
992
|
-
|
993
|
-
return
|
994
|
-
|
995
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/community", form)];
|
996
|
-
});
|
997
|
-
});
|
998
|
-
};
|
690
|
+
purgeCommunity(form) {
|
691
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/community", form);
|
692
|
+
}
|
999
693
|
/**
|
1000
694
|
* Purge / Delete a post from the database.
|
1001
695
|
*
|
1002
696
|
* `HTTP.POST /admin/purge/post`
|
1003
697
|
*/
|
1004
|
-
|
1005
|
-
return
|
1006
|
-
|
1007
|
-
return [2 /*return*/, this.wrapper(HttpType.Post, "/admin/purge/post", form)];
|
1008
|
-
});
|
1009
|
-
});
|
1010
|
-
};
|
698
|
+
purgePost(form) {
|
699
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/post", form);
|
700
|
+
}
|
1011
701
|
/**
|
1012
702
|
* Purge / Delete a comment from the database.
|
1013
703
|
*
|
1014
704
|
* `HTTP.POST /admin/purge/comment`
|
1015
705
|
*/
|
1016
|
-
|
1017
|
-
return
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
706
|
+
purgeComment(form) {
|
707
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/comment", form);
|
708
|
+
}
|
709
|
+
/**
|
710
|
+
* Create a new custom emoji
|
711
|
+
*
|
712
|
+
* `HTTP.POST /custom_emoji`
|
713
|
+
*/
|
714
|
+
createCustomEmoji(form) {
|
715
|
+
return __awaiter(this, void 0, void 0, function* () {
|
716
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form);
|
1021
717
|
});
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
body: JSON.stringify(form),
|
1042
|
-
}).then(function (d) { return d.json(); })];
|
1043
|
-
}
|
1044
|
-
return [2 /*return*/];
|
1045
|
-
});
|
718
|
+
}
|
719
|
+
/**
|
720
|
+
* Edit an existing custom emoji
|
721
|
+
*
|
722
|
+
* `HTTP.PUT /custom_emoji`
|
723
|
+
*/
|
724
|
+
editCustomEmoji(form) {
|
725
|
+
return __awaiter(this, void 0, void 0, function* () {
|
726
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form);
|
727
|
+
});
|
728
|
+
}
|
729
|
+
/**
|
730
|
+
* Delete a custom emoji
|
731
|
+
*
|
732
|
+
* `HTTP.Post /custom_emoji/delete`
|
733
|
+
*/
|
734
|
+
deleteCustomEmoji(form) {
|
735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
736
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
|
1046
737
|
});
|
1047
|
-
}
|
1048
|
-
|
1049
|
-
|
738
|
+
}
|
739
|
+
/**
|
740
|
+
* Fetch federated instances.
|
741
|
+
*
|
742
|
+
* `HTTP.Get /federated_instances`
|
743
|
+
*/
|
744
|
+
getFederatedInstances(form) {
|
745
|
+
return __awaiter(this, void 0, void 0, function* () {
|
746
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", form);
|
747
|
+
});
|
748
|
+
}
|
749
|
+
/**
|
750
|
+
* Upload an image to the server.
|
751
|
+
*/
|
752
|
+
uploadImage({ image, auth, }) {
|
753
|
+
var _a, _b, _c, _d;
|
754
|
+
return __awaiter(this, void 0, void 0, function* () {
|
755
|
+
const formData = createFormData(image);
|
756
|
+
// If jwt cookie not already set by browser, set it with passed in auth
|
757
|
+
const headers = {};
|
758
|
+
if (!((_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.cookie) === null || _b === void 0 ? void 0 : _b.includes("jwt=")) &&
|
759
|
+
!((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("jwt="))) {
|
760
|
+
headers.Cookie = `jwt=${auth}`;
|
761
|
+
}
|
762
|
+
let url = undefined;
|
763
|
+
let delete_url = undefined;
|
764
|
+
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f"), {
|
765
|
+
method: HttpType.Post,
|
766
|
+
body: formData,
|
767
|
+
headers: Object.assign(Object.assign({}, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")), headers),
|
768
|
+
});
|
769
|
+
const responseJson = yield response.json();
|
770
|
+
if (responseJson.msg === "ok") {
|
771
|
+
const { file: hash, delete_token: deleteToken } = responseJson.files[0];
|
772
|
+
delete_url = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${deleteToken}/${hash}`;
|
773
|
+
url = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/${hash}`;
|
774
|
+
}
|
775
|
+
return Object.assign(Object.assign({}, responseJson), { url,
|
776
|
+
delete_url });
|
777
|
+
});
|
778
|
+
}
|
779
|
+
}
|
1050
780
|
exports.LemmyHttp = LemmyHttp;
|
781
|
+
_LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHttp_pictrsUrl = new WeakMap(), _LemmyHttp_fetchFunction = new WeakMap(), _LemmyHttp_instances = new WeakSet(), _LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
|
782
|
+
return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
|
783
|
+
}, _LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form) {
|
784
|
+
var _a;
|
785
|
+
return __awaiter(this, void 0, void 0, function* () {
|
786
|
+
let response;
|
787
|
+
if (type_ === HttpType.Get) {
|
788
|
+
const getUrl = `${__classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint)}?${encodeGetParams(form)}`;
|
789
|
+
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, getUrl, {
|
790
|
+
method: HttpType.Get,
|
791
|
+
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
792
|
+
});
|
793
|
+
}
|
794
|
+
else {
|
795
|
+
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint), {
|
796
|
+
method: type_,
|
797
|
+
headers: Object.assign({ "Content-Type": "application/json" }, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")),
|
798
|
+
body: JSON.stringify(form),
|
799
|
+
});
|
800
|
+
}
|
801
|
+
const json = yield response.json();
|
802
|
+
if (!response.ok) {
|
803
|
+
throw (_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText;
|
804
|
+
}
|
805
|
+
else {
|
806
|
+
return json;
|
807
|
+
}
|
808
|
+
});
|
809
|
+
};
|
1051
810
|
function encodeGetParams(p) {
|
1052
811
|
return Object.entries(p)
|
1053
|
-
.filter(
|
1054
|
-
.map(
|
812
|
+
.filter(kv => !!kv[1])
|
813
|
+
.map(kv => kv.map(encodeURIComponent).join("="))
|
1055
814
|
.join("&");
|
1056
815
|
}
|
816
|
+
function createFormData(image) {
|
817
|
+
let formData = new form_data_1.default();
|
818
|
+
if (image.constructor.name === "File") {
|
819
|
+
formData.append("images[]", image);
|
820
|
+
}
|
821
|
+
else {
|
822
|
+
// The filename doesn't affect the file type or file name that ends up in pictrs
|
823
|
+
formData.append("images[]", image, { filename: "image.jpg" });
|
824
|
+
}
|
825
|
+
return formData;
|
826
|
+
}
|