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