lemmy-js-client 1.0.0-instance-user-blocking.7 → 1.0.0-invite.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -4
- package/dist/http.d.ts +265 -220
- package/dist/http.js +451 -336
- package/dist/index.d.ts +59 -109
- package/dist/index.js +4 -0
- package/dist/map_request_state.d.ts +2 -0
- package/dist/map_request_state.js +12 -0
- package/dist/map_request_state.main.d.ts +2 -0
- package/dist/map_request_state.main.js +12 -0
- package/dist/map_request_state.tsoa.d.ts +1 -0
- package/dist/map_request_state.tsoa.js +7 -0
- package/dist/other_types.d.ts +10 -7
- package/dist/request_state.d.ts +26 -0
- package/dist/request_state.js +5 -0
- package/dist/types/AdminAllowInstanceParams.d.ts +1 -1
- package/dist/types/AdminBlockInstanceParams.d.ts +7 -2
- package/dist/types/AdminListUsers.d.ts +2 -1
- package/dist/types/{OAuthProvider.d.ts → AdminOAuthProvider.d.ts} +1 -1
- package/dist/types/AllLemmyErrors.d.ts +1 -0
- package/dist/types/AllLemmyErrors.js +117 -0
- package/dist/types/AuthenticateWithOauth.d.ts +4 -0
- package/dist/types/BanFromCommunity.d.ts +1 -1
- package/dist/types/BanPerson.d.ts +1 -1
- package/dist/types/ChangePassword.d.ts +4 -0
- package/dist/types/{PasswordChangeAfterReset.d.ts → ChangePasswordAfterReset.d.ts} +1 -1
- package/dist/types/Comment.d.ts +4 -0
- package/dist/types/CommentActions.d.ts +6 -6
- package/dist/types/CommentReport.d.ts +1 -0
- package/dist/types/CommentReportView.d.ts +4 -0
- package/dist/types/CommentSlimView.d.ts +0 -3
- package/dist/types/CommentSortType.d.ts +1 -1
- package/dist/types/CommentView.d.ts +4 -5
- package/dist/types/Community.d.ts +4 -3
- package/dist/types/CommunityActions.d.ts +4 -4
- package/dist/types/CommunityFollowerState.d.ts +1 -1
- package/dist/types/CommunityNotificationsMode.d.ts +1 -1
- package/dist/types/CommunityReport.d.ts +3 -2
- package/dist/types/CommunityReportView.d.ts +2 -0
- package/dist/types/CommunitySortType.d.ts +1 -1
- package/dist/types/{Tag.d.ts → CommunityTag.d.ts} +6 -4
- package/dist/types/CommunityTagId.d.ts +4 -0
- package/dist/types/CommunityTagsView.d.ts +5 -0
- package/dist/types/CommunityView.d.ts +2 -4
- package/dist/types/CommunityVisibility.d.ts +1 -1
- package/dist/types/CreateCommentLike.d.ts +2 -2
- package/dist/types/CreateCommentReport.d.ts +4 -0
- package/dist/types/CreateCommentWarning.d.ts +8 -0
- package/dist/types/CreateCommunity.d.ts +3 -11
- package/dist/types/CreateCommunityTag.d.ts +3 -1
- package/dist/types/CreateCustomEmoji.d.ts +2 -1
- package/dist/types/CreateCustomEmoji.js +0 -1
- package/dist/types/CreateInvitation.d.ts +4 -0
- package/dist/types/CreateInvitationResponse.d.ts +4 -0
- package/dist/types/CreateMultiCommunity.d.ts +2 -1
- package/dist/types/CreatePost.d.ts +2 -2
- package/dist/types/CreatePostLike.d.ts +2 -2
- package/dist/types/CreatePostReport.d.ts +4 -0
- package/dist/types/CreatePostWarning.d.ts +8 -0
- package/dist/types/CreateSite.d.ts +19 -8
- package/dist/types/DeleteCommunityTag.d.ts +3 -2
- package/dist/types/DeleteUserForm.d.ts +8 -0
- package/dist/types/EditCommunity.d.ts +2 -2
- package/dist/types/{UpdateCommunityNotifications.d.ts → EditCommunityNotifications.d.ts} +1 -1
- package/dist/types/EditCommunityTag.d.ts +11 -0
- package/dist/types/EditCustomEmoji.d.ts +7 -5
- package/dist/types/{UpdateMultiCommunity.d.ts → EditMultiCommunity.d.ts} +3 -2
- package/dist/types/EditPost.d.ts +2 -2
- package/dist/types/{UpdatePostNotifications.d.ts → EditPostNotifications.d.ts} +1 -1
- package/dist/types/EditSite.d.ts +36 -18
- package/dist/types/{UpdateTagline.d.ts → EditTagline.d.ts} +1 -1
- package/dist/types/{UpdateTotp.d.ts → EditTotp.d.ts} +1 -1
- package/dist/types/EditTotpResponse.d.ts +3 -0
- package/dist/types/FederatedInstanceView.d.ts +12 -0
- package/dist/types/FederationAllowList.d.ts +4 -0
- package/dist/types/FederationBlockList.d.ts +0 -2
- package/dist/types/FederationBlockList.js +1 -0
- package/dist/types/FederationMode.d.ts +1 -1
- package/dist/types/{ReadableFederationState.d.ts → FederationQueueState.d.ts} +1 -5
- package/dist/types/GetComments.d.ts +4 -1
- package/dist/types/GetFederatedInstances.d.ts +8 -0
- package/dist/types/GetFederatedInstancesKind.d.ts +1 -0
- package/dist/types/GetModlog.d.ts +11 -3
- package/dist/types/GetMultiCommunity.d.ts +2 -1
- package/dist/types/GetPersonDetailsResponse.d.ts +2 -0
- package/dist/types/GetPostResponse.d.ts +2 -0
- package/dist/types/GetPosts.d.ts +13 -2
- package/dist/types/GetSiteResponse.d.ts +9 -3
- package/dist/types/HideCommunity.d.ts +1 -1
- package/dist/types/ImageMode.d.ts +4 -0
- package/dist/types/InvitationId.d.ts +4 -0
- package/dist/types/LemmyErrorType.d.ts +29 -146
- package/dist/types/LemmyErrorType.js +1 -0
- package/dist/types/LikeType.d.ts +1 -1
- package/dist/types/LinkMetadata.d.ts +4 -0
- package/dist/types/ListCommentLikes.d.ts +0 -1
- package/dist/types/ListCommunities.d.ts +4 -1
- package/dist/types/ListCommunityPendingFollows.d.ts +1 -2
- package/dist/types/ListInvitations.d.ts +5 -0
- package/dist/types/ListMedia.d.ts +0 -1
- package/dist/types/ListMultiCommunities.d.ts +14 -1
- package/dist/types/ListNotifications.d.ts +4 -3
- package/dist/types/ListPersonContent.d.ts +3 -1
- package/dist/types/ListPersonHidden.d.ts +0 -1
- package/dist/types/ListPersonLiked.d.ts +0 -1
- package/dist/types/ListPersonRead.d.ts +0 -1
- package/dist/types/ListPersonSaved.d.ts +1 -1
- package/dist/types/ListPersons.d.ts +11 -0
- package/dist/types/ListPostLikes.d.ts +0 -1
- package/dist/types/ListRegistrationApplications.d.ts +0 -1
- package/dist/types/ListReports.d.ts +6 -1
- package/dist/types/ListTaglines.d.ts +0 -1
- package/dist/types/ListingType.d.ts +1 -1
- package/dist/types/LocalSite.d.ts +37 -18
- package/dist/types/LocalUser.d.ts +18 -16
- package/dist/types/LocalUserInvite.d.ts +11 -0
- package/dist/types/LocalUserSortType.d.ts +4 -0
- package/dist/types/LocalUserView.d.ts +1 -0
- package/dist/types/LockComment.d.ts +9 -0
- package/dist/types/LockPost.d.ts +1 -1
- package/dist/types/Login.d.ts +4 -0
- package/dist/types/MarkManyPostsAsRead.d.ts +1 -0
- package/dist/types/ModEditPost.d.ts +2 -2
- package/dist/types/Modlog.d.ts +12 -0
- package/dist/types/ModlogId.d.ts +1 -0
- package/dist/types/ModlogKind.d.ts +4 -0
- package/dist/types/ModlogKindFilter.d.ts +5 -0
- package/dist/types/ModlogView.d.ts +15 -0
- package/dist/types/MultiCommunity.d.ts +12 -1
- package/dist/types/MultiCommunityEntry.d.ts +6 -0
- package/dist/types/MultiCommunityListingType.d.ts +4 -0
- package/dist/types/MultiCommunityResponse.d.ts +4 -0
- package/dist/types/MultiCommunitySortType.d.ts +1 -0
- package/dist/types/MultiCommunityView.d.ts +2 -0
- package/dist/types/MyUserInfo.d.ts +2 -0
- package/dist/types/NodeInfo.d.ts +20 -0
- package/dist/types/NodeInfoServices.d.ts +4 -0
- package/dist/types/NodeInfoSoftware.d.ts +6 -0
- package/dist/types/NodeInfoUsage.d.ts +6 -0
- package/dist/types/NodeInfoUsers.d.ts +5 -0
- package/dist/types/Notification.d.ts +5 -2
- package/dist/types/NotificationData.d.ts +7 -4
- package/dist/types/NotificationType.d.ts +4 -0
- package/dist/types/NotificationTypeFilter.d.ts +5 -0
- package/dist/types/OpenGraphData.d.ts +4 -0
- package/dist/types/PagedResponse.d.ts +11 -0
- package/dist/types/PaginationCursor.d.ts +5 -1
- package/dist/types/PendingFollowerView.d.ts +9 -0
- package/dist/types/Person.d.ts +1 -0
- package/dist/types/PersonContentType.d.ts +1 -1
- package/dist/types/PersonListingType.d.ts +4 -0
- package/dist/types/PersonResponse.d.ts +7 -0
- package/dist/types/PersonSortType.d.ts +4 -0
- package/dist/types/PersonView.d.ts +2 -1
- package/dist/types/PluginMetadata.d.ts +2 -2
- package/dist/types/Post.d.ts +6 -4
- package/dist/types/PostActions.d.ts +11 -11
- package/dist/types/{PersonSavedCombinedView.d.ts → PostCommentCombinedView.d.ts} +3 -3
- package/dist/types/PostFeatureType.d.ts +1 -1
- package/dist/types/PostListingMode.d.ts +1 -1
- package/dist/types/PostNotificationsMode.d.ts +1 -1
- package/dist/types/PostOrCommentOrPrivateMessage.d.ts +7 -7
- package/dist/types/PostReport.d.ts +1 -0
- package/dist/types/PostReportView.d.ts +4 -0
- package/dist/types/PostSortType.d.ts +1 -1
- package/dist/types/PostView.d.ts +4 -5
- package/dist/types/PrivateMessage.d.ts +1 -0
- package/dist/types/PrivateMessageReport.d.ts +1 -0
- package/dist/types/PrivateMessageReportView.d.ts +1 -0
- package/dist/types/PublicOAuthProvider.d.ts +27 -2
- package/dist/types/PurgeComment.d.ts +1 -1
- package/dist/types/PurgeCommunity.d.ts +1 -1
- package/dist/types/PurgePerson.d.ts +1 -1
- package/dist/types/PurgePost.d.ts +1 -1
- package/dist/types/Register.d.ts +8 -0
- package/dist/types/RegistrationApplication.d.ts +1 -0
- package/dist/types/RegistrationMode.d.ts +1 -1
- package/dist/types/RemoveComment.d.ts +6 -1
- package/dist/types/RemoveCommunity.d.ts +1 -1
- package/dist/types/RemovePost.d.ts +6 -1
- package/dist/types/ReportCombinedView.d.ts +4 -4
- package/dist/types/ReportSortType.d.ts +4 -0
- package/dist/types/ReportType.d.ts +1 -1
- package/dist/types/{PasswordReset.d.ts → ResetPassword.d.ts} +1 -1
- package/dist/types/ResolveCommentReport.d.ts +1 -0
- package/dist/types/ResolveCommunityReport.d.ts +1 -0
- package/dist/types/{SearchCombinedView.d.ts → ResolveObjectView.d.ts} +7 -7
- package/dist/types/ResolvePostReport.d.ts +1 -0
- package/dist/types/ResolvePrivateMessageReport.d.ts +1 -0
- package/dist/types/RevokeInvitation.d.ts +3 -0
- package/dist/types/SaveUserSettings.d.ts +13 -9
- package/dist/types/Search.d.ts +6 -6
- package/dist/types/SearchResponse.d.ts +16 -4
- package/dist/types/SearchType.d.ts +1 -1
- package/dist/types/Site.d.ts +2 -3
- package/dist/types/TagColor.d.ts +4 -0
- package/dist/types/UnreadCountsResponse.d.ts +11 -0
- package/dist/types/UserSettingsBackup.d.ts +2 -4
- package/dist/types/VoteShow.d.ts +1 -1
- package/dist/types/VoteView.d.ts +4 -1
- package/package.json +13 -12
- package/dist/types/AdminAllowInstance.d.ts +0 -11
- package/dist/types/AdminAllowInstanceId.d.ts +0 -1
- package/dist/types/AdminAllowInstanceView.d.ts +0 -11
- package/dist/types/AdminBlockInstance.d.ts +0 -12
- package/dist/types/AdminBlockInstanceId.d.ts +0 -1
- package/dist/types/AdminBlockInstanceView.d.ts +0 -11
- package/dist/types/AdminListUsersResponse.d.ts +0 -10
- package/dist/types/AdminPurgeComment.d.ts +0 -13
- package/dist/types/AdminPurgeCommentId.d.ts +0 -1
- package/dist/types/AdminPurgeCommentView.d.ts +0 -11
- package/dist/types/AdminPurgeCommunity.d.ts +0 -11
- package/dist/types/AdminPurgeCommunityId.d.ts +0 -1
- package/dist/types/AdminPurgeCommunityView.d.ts +0 -9
- package/dist/types/AdminPurgePerson.d.ts +0 -11
- package/dist/types/AdminPurgePersonId.d.ts +0 -1
- package/dist/types/AdminPurgePersonView.d.ts +0 -9
- package/dist/types/AdminPurgePost.d.ts +0 -13
- package/dist/types/AdminPurgePostId.d.ts +0 -1
- package/dist/types/AdminPurgePostView.d.ts +0 -11
- package/dist/types/BanFromCommunityResponse.d.ts +0 -8
- package/dist/types/BanPersonResponse.d.ts +0 -8
- package/dist/types/BlockCommunityResponse.d.ts +0 -8
- package/dist/types/BlockPersonResponse.d.ts +0 -8
- package/dist/types/FederatedInstances.d.ts +0 -9
- package/dist/types/FederationError.d.ts +0 -12
- package/dist/types/GetCommentsResponse.d.ts +0 -10
- package/dist/types/GetCommentsSlimResponse.d.ts +0 -10
- package/dist/types/GetCommunityPendingFollowsCount.d.ts +0 -4
- package/dist/types/GetCommunityPendingFollowsCountResponse.d.ts +0 -3
- package/dist/types/GetFederatedInstancesResponse.d.ts +0 -10
- package/dist/types/GetModlogResponse.d.ts +0 -13
- package/dist/types/GetPostsResponse.d.ts +0 -13
- package/dist/types/GetReportCount.d.ts +0 -7
- package/dist/types/GetReportCountResponse.d.ts +0 -6
- package/dist/types/GetUnreadCountResponse.d.ts +0 -6
- package/dist/types/GetUnreadRegistrationApplicationCountResponse.d.ts +0 -6
- package/dist/types/InstanceWithFederationState.d.ts +0 -24
- package/dist/types/ListCommentLikesResponse.d.ts +0 -13
- package/dist/types/ListCommunitiesResponse.d.ts +0 -13
- package/dist/types/ListCommunityPendingFollowsResponse.d.ts +0 -10
- package/dist/types/ListMediaResponse.d.ts +0 -10
- package/dist/types/ListMultiCommunitiesResponse.d.ts +0 -4
- package/dist/types/ListNotificationsResponse.d.ts +0 -13
- package/dist/types/ListPersonContentResponse.d.ts +0 -13
- package/dist/types/ListPersonHiddenResponse.d.ts +0 -13
- package/dist/types/ListPersonLikedResponse.d.ts +0 -13
- package/dist/types/ListPersonLikedResponse.js +0 -2
- package/dist/types/ListPersonReadResponse.d.ts +0 -13
- package/dist/types/ListPersonReadResponse.js +0 -2
- package/dist/types/ListPersonSavedResponse.d.ts +0 -13
- package/dist/types/ListPersonSavedResponse.js +0 -2
- package/dist/types/ListPostLikesResponse.d.ts +0 -13
- package/dist/types/ListPostLikesResponse.js +0 -2
- package/dist/types/ListRegistrationApplicationsResponse.d.ts +0 -13
- package/dist/types/ListRegistrationApplicationsResponse.js +0 -2
- package/dist/types/ListReportsResponse.d.ts +0 -13
- package/dist/types/ListReportsResponse.js +0 -2
- package/dist/types/ListTaglinesResponse.d.ts +0 -13
- package/dist/types/ListTaglinesResponse.js +0 -2
- package/dist/types/MarkPrivateMessageAsRead.d.ts +0 -8
- package/dist/types/MarkPrivateMessageAsRead.js +0 -2
- package/dist/types/ModAdd.d.ts +0 -12
- package/dist/types/ModAdd.js +0 -2
- package/dist/types/ModAddCommunity.d.ts +0 -14
- package/dist/types/ModAddCommunity.js +0 -2
- package/dist/types/ModAddCommunityId.d.ts +0 -1
- package/dist/types/ModAddCommunityView.d.ts +0 -12
- package/dist/types/ModAddCommunityView.js +0 -2
- package/dist/types/ModAddId.d.ts +0 -1
- package/dist/types/ModAddView.d.ts +0 -10
- package/dist/types/ModAddView.js +0 -2
- package/dist/types/ModBan.d.ts +0 -16
- package/dist/types/ModBan.js +0 -2
- package/dist/types/ModBanFromCommunity.d.ts +0 -16
- package/dist/types/ModBanFromCommunity.js +0 -2
- package/dist/types/ModBanFromCommunityId.d.ts +0 -1
- package/dist/types/ModBanFromCommunityView.d.ts +0 -12
- package/dist/types/ModBanFromCommunityView.js +0 -2
- package/dist/types/ModBanId.d.ts +0 -1
- package/dist/types/ModBanView.d.ts +0 -10
- package/dist/types/ModBanView.js +0 -2
- package/dist/types/ModChangeCommunityVisibility.d.ts +0 -11
- package/dist/types/ModChangeCommunityVisibility.js +0 -2
- package/dist/types/ModChangeCommunityVisibilityId.d.ts +0 -1
- package/dist/types/ModChangeCommunityVisibilityView.d.ts +0 -11
- package/dist/types/ModChangeCommunityVisibilityView.js +0 -2
- package/dist/types/ModFeaturePost.d.ts +0 -14
- package/dist/types/ModFeaturePost.js +0 -2
- package/dist/types/ModFeaturePostId.d.ts +0 -1
- package/dist/types/ModFeaturePostView.d.ts +0 -14
- package/dist/types/ModFeaturePostView.js +0 -2
- package/dist/types/ModLockPost.d.ts +0 -14
- package/dist/types/ModLockPost.js +0 -2
- package/dist/types/ModLockPostId.d.ts +0 -1
- package/dist/types/ModLockPostView.d.ts +0 -14
- package/dist/types/ModLockPostView.js +0 -2
- package/dist/types/ModRemoveComment.d.ts +0 -14
- package/dist/types/ModRemoveComment.js +0 -2
- package/dist/types/ModRemoveCommentId.d.ts +0 -1
- package/dist/types/ModRemoveCommentView.d.ts +0 -16
- package/dist/types/ModRemoveCommentView.js +0 -2
- package/dist/types/ModRemoveCommunity.d.ts +0 -14
- package/dist/types/ModRemoveCommunity.js +0 -2
- package/dist/types/ModRemoveCommunityId.d.ts +0 -1
- package/dist/types/ModRemoveCommunityView.d.ts +0 -11
- package/dist/types/ModRemoveCommunityView.js +0 -2
- package/dist/types/ModRemovePost.d.ts +0 -14
- package/dist/types/ModRemovePost.js +0 -2
- package/dist/types/ModRemovePostId.d.ts +0 -1
- package/dist/types/ModRemovePostView.d.ts +0 -14
- package/dist/types/ModRemovePostView.js +0 -2
- package/dist/types/ModTransferCommunity.d.ts +0 -13
- package/dist/types/ModTransferCommunity.js +0 -2
- package/dist/types/ModTransferCommunityId.d.ts +0 -1
- package/dist/types/ModTransferCommunityView.d.ts +0 -12
- package/dist/types/ModTransferCommunityView.js +0 -2
- package/dist/types/ModlogActionType.d.ts +0 -4
- package/dist/types/ModlogCombinedView.d.ts +0 -52
- package/dist/types/ModlogCombinedView.js +0 -2
- package/dist/types/NotificationDataType.d.ts +0 -4
- package/dist/types/NotificationDataType.js +0 -3
- package/dist/types/NotificationTypes.d.ts +0 -4
- package/dist/types/NotificationTypes.js +0 -3
- package/dist/types/OAuthProvider.js +0 -2
- package/dist/types/PasswordChangeAfterReset.js +0 -2
- package/dist/types/PasswordReset.js +0 -2
- package/dist/types/PersonContentCombinedView.d.ts +0 -7
- package/dist/types/PersonContentCombinedView.js +0 -2
- package/dist/types/PersonLikedCombinedView.d.ts +0 -7
- package/dist/types/PersonLikedCombinedView.js +0 -2
- package/dist/types/PersonSavedCombinedView.js +0 -2
- package/dist/types/ReadableFederationState.js +0 -2
- package/dist/types/SearchCombinedView.js +0 -2
- package/dist/types/SearchSortType.d.ts +0 -4
- package/dist/types/SearchSortType.js +0 -3
- package/dist/types/Tag.js +0 -2
- package/dist/types/TagId.d.ts +0 -4
- package/dist/types/TagId.js +0 -3
- package/dist/types/TagsView.d.ts +0 -5
- package/dist/types/TagsView.js +0 -2
- package/dist/types/UpdateCommunityNotifications.js +0 -2
- package/dist/types/UpdateCommunityTag.d.ts +0 -9
- package/dist/types/UpdateCommunityTag.js +0 -2
- package/dist/types/UpdateMultiCommunity.js +0 -2
- package/dist/types/UpdatePostNotifications.js +0 -2
- package/dist/types/UpdateTagline.js +0 -2
- package/dist/types/UpdateTotp.js +0 -3
- package/dist/types/UpdateTotpResponse.d.ts +0 -3
- package/dist/types/UpdateTotpResponse.js +0 -3
- /package/dist/types/{AdminAllowInstance.js → AdminOAuthProvider.js} +0 -0
- /package/dist/types/{AdminAllowInstanceView.js → ChangePasswordAfterReset.js} +0 -0
- /package/dist/types/{AdminBlockInstance.js → CommunityTag.js} +0 -0
- /package/dist/types/{AdminAllowInstanceId.js → CommunityTagId.js} +0 -0
- /package/dist/types/{AdminBlockInstanceView.js → CommunityTagsView.js} +0 -0
- /package/dist/types/{AdminListUsersResponse.js → CreateCommentWarning.js} +0 -0
- /package/dist/types/{AdminBlockInstanceId.js → CreateInvitation.js} +0 -0
- /package/dist/types/{AdminPurgeComment.js → CreateInvitationResponse.js} +0 -0
- /package/dist/types/{AdminPurgeCommentView.js → CreatePostWarning.js} +0 -0
- /package/dist/types/{AdminPurgeCommunity.js → DeleteUserForm.js} +0 -0
- /package/dist/types/{AdminPurgeCommunityView.js → EditCommunityNotifications.js} +0 -0
- /package/dist/types/{AdminPurgePerson.js → EditCommunityTag.js} +0 -0
- /package/dist/types/{AdminPurgePersonView.js → EditMultiCommunity.js} +0 -0
- /package/dist/types/{AdminPurgePost.js → EditPostNotifications.js} +0 -0
- /package/dist/types/{AdminPurgePostView.js → EditTagline.js} +0 -0
- /package/dist/types/{AdminPurgeCommentId.js → EditTotp.js} +0 -0
- /package/dist/types/{AdminPurgeCommunityId.js → EditTotpResponse.js} +0 -0
- /package/dist/types/{BanFromCommunityResponse.js → FederatedInstanceView.js} +0 -0
- /package/dist/types/{AdminPurgePersonId.js → FederationAllowList.js} +0 -0
- /package/dist/types/{BanPersonResponse.js → FederationQueueState.js} +0 -0
- /package/dist/types/{BlockCommunityResponse.js → GetFederatedInstances.js} +0 -0
- /package/dist/types/{AdminPurgePostId.js → GetFederatedInstancesKind.js} +0 -0
- /package/dist/types/{FederationError.js → ImageMode.js} +0 -0
- /package/dist/types/{GetCommunityPendingFollowsCountResponse.js → InvitationId.js} +0 -0
- /package/dist/types/{BlockPersonResponse.js → ListInvitations.js} +0 -0
- /package/dist/types/{FederatedInstances.js → ListPersons.js} +0 -0
- /package/dist/types/{GetCommentsResponse.js → LocalUserInvite.js} +0 -0
- /package/dist/types/{GetReportCountResponse.js → LocalUserSortType.js} +0 -0
- /package/dist/types/{GetCommentsSlimResponse.js → LockComment.js} +0 -0
- /package/dist/types/{GetCommunityPendingFollowsCount.js → Modlog.js} +0 -0
- /package/dist/types/{GetUnreadCountResponse.js → ModlogId.js} +0 -0
- /package/dist/types/{GetUnreadRegistrationApplicationCountResponse.js → ModlogKind.js} +0 -0
- /package/dist/types/{GetFederatedInstancesResponse.js → ModlogKindFilter.js} +0 -0
- /package/dist/types/{GetModlogResponse.js → ModlogView.js} +0 -0
- /package/dist/types/{GetPostsResponse.js → MultiCommunityEntry.js} +0 -0
- /package/dist/types/{ModAddCommunityId.js → MultiCommunityListingType.js} +0 -0
- /package/dist/types/{GetReportCount.js → MultiCommunityResponse.js} +0 -0
- /package/dist/types/{ModAddId.js → MultiCommunitySortType.js} +0 -0
- /package/dist/types/{InstanceWithFederationState.js → NodeInfo.js} +0 -0
- /package/dist/types/{ModBanFromCommunityId.js → NodeInfoServices.js} +0 -0
- /package/dist/types/{ModBanId.js → NodeInfoSoftware.js} +0 -0
- /package/dist/types/{ListCommentLikesResponse.js → NodeInfoUsage.js} +0 -0
- /package/dist/types/{ModChangeCommunityVisibilityId.js → NodeInfoUsers.js} +0 -0
- /package/dist/types/{ModFeaturePostId.js → NotificationType.js} +0 -0
- /package/dist/types/{ListCommunitiesResponse.js → NotificationTypeFilter.js} +0 -0
- /package/dist/types/{ListCommunityPendingFollowsResponse.js → PagedResponse.js} +0 -0
- /package/dist/types/{ListMediaResponse.js → PendingFollowerView.js} +0 -0
- /package/dist/types/{ModLockPostId.js → PersonListingType.js} +0 -0
- /package/dist/types/{ListMultiCommunitiesResponse.js → PersonResponse.js} +0 -0
- /package/dist/types/{ModRemoveCommentId.js → PersonSortType.js} +0 -0
- /package/dist/types/{ListNotificationsResponse.js → PostCommentCombinedView.js} +0 -0
- /package/dist/types/{ModRemoveCommunityId.js → ReportSortType.js} +0 -0
- /package/dist/types/{ListPersonContentResponse.js → ResetPassword.js} +0 -0
- /package/dist/types/{ListPersonHiddenResponse.js → ResolveObjectView.js} +0 -0
- /package/dist/types/{ModRemovePostId.js → RevokeInvitation.js} +0 -0
- /package/dist/types/{ModTransferCommunityId.js → TagColor.js} +0 -0
- /package/dist/types/{ModlogActionType.js → UnreadCountsResponse.js} +0 -0
package/dist/http.js
CHANGED
|
@@ -19,11 +19,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
19
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
20
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var _LemmyController_instances, _LemmyController_apiUrl, _LemmyController_headers, _LemmyController_fetchFunction, _LemmyController_buildFullUrl;
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.LemmyError = exports.LemmyHttp = void 0;
|
|
24
|
+
exports.LemmyError = exports.NodeInfoHttp = exports.LemmyHttp = void 0;
|
|
25
25
|
const runtime_1 = require("@tsoa/runtime");
|
|
26
26
|
const other_types_1 = require("./other_types");
|
|
27
|
+
const map_request_state_1 = require("./map_request_state");
|
|
27
28
|
var HttpType;
|
|
28
29
|
(function (HttpType) {
|
|
29
30
|
HttpType["Get"] = "GET";
|
|
@@ -31,10 +32,7 @@ var HttpType;
|
|
|
31
32
|
HttpType["Put"] = "PUT";
|
|
32
33
|
HttpType["Delete"] = "DELETE";
|
|
33
34
|
})(HttpType || (HttpType = {}));
|
|
34
|
-
|
|
35
|
-
* Helps build lemmy HTTP requests.
|
|
36
|
-
*/
|
|
37
|
-
let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
35
|
+
class LemmyController extends runtime_1.Controller {
|
|
38
36
|
/**
|
|
39
37
|
* Generates a new instance of LemmyHttp.
|
|
40
38
|
* @param baseUrl the base url, without the vX version: https://lemmy.ml -> goes to https://lemmy.ml/api/vX
|
|
@@ -42,56 +40,148 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
42
40
|
*/
|
|
43
41
|
constructor(baseUrl, options) {
|
|
44
42
|
super();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
__classPrivateFieldSet(this,
|
|
43
|
+
_LemmyController_instances.add(this);
|
|
44
|
+
_LemmyController_apiUrl.set(this, void 0);
|
|
45
|
+
_LemmyController_headers.set(this, {});
|
|
46
|
+
_LemmyController_fetchFunction.set(this, fetch.bind(globalThis));
|
|
47
|
+
__classPrivateFieldSet(this, _LemmyController_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${other_types_1.VERSION}`, "f");
|
|
50
48
|
if (options?.headers) {
|
|
51
|
-
__classPrivateFieldSet(this,
|
|
49
|
+
__classPrivateFieldSet(this, _LemmyController_headers, options.headers, "f");
|
|
52
50
|
}
|
|
53
51
|
if (options?.fetchFunction) {
|
|
54
|
-
__classPrivateFieldSet(this,
|
|
52
|
+
__classPrivateFieldSet(this, _LemmyController_fetchFunction, options.fetchFunction, "f");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async upload(path, { image }, options) {
|
|
56
|
+
let error;
|
|
57
|
+
let result;
|
|
58
|
+
try {
|
|
59
|
+
const formData = createFormData(image);
|
|
60
|
+
const response = await __classPrivateFieldGet(this, _LemmyController_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyController_instances, "m", _LemmyController_buildFullUrl).call(this, path), {
|
|
61
|
+
...options,
|
|
62
|
+
method: HttpType.Post,
|
|
63
|
+
body: formData,
|
|
64
|
+
headers: __classPrivateFieldGet(this, _LemmyController_headers, "f"),
|
|
65
|
+
});
|
|
66
|
+
if (!response.ok) {
|
|
67
|
+
console.error(`Request error while uploading to ${path}`);
|
|
68
|
+
const json2 = (await response.json());
|
|
69
|
+
const err = new LemmyError(json2.error ?? response.statusText, response.status, json2.message ?? "");
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
result = (await response.json());
|
|
74
|
+
}
|
|
55
75
|
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
78
|
+
error = err instanceof Error ? err : new Error("" + err);
|
|
79
|
+
}
|
|
80
|
+
return (0, map_request_state_1.mapToRequestState)(result, error);
|
|
81
|
+
}
|
|
82
|
+
async uploadWithQuery(path, query, { image }, options) {
|
|
83
|
+
return this.upload(`${path}?${encodeGetParams(query)}`, { image }, options);
|
|
84
|
+
}
|
|
85
|
+
async wrapper(type_, endpoint, form, options, noPrefix = false) {
|
|
86
|
+
let error;
|
|
87
|
+
let result;
|
|
88
|
+
try {
|
|
89
|
+
const url = noPrefix ? endpoint : __classPrivateFieldGet(this, _LemmyController_instances, "m", _LemmyController_buildFullUrl).call(this, endpoint);
|
|
90
|
+
let response;
|
|
91
|
+
if (type_ === HttpType.Get) {
|
|
92
|
+
const getUrl = `${url}?${encodeGetParams(form)}`;
|
|
93
|
+
response = await __classPrivateFieldGet(this, _LemmyController_fetchFunction, "f").call(this, getUrl, {
|
|
94
|
+
...options,
|
|
95
|
+
method: HttpType.Get,
|
|
96
|
+
headers: __classPrivateFieldGet(this, _LemmyController_headers, "f"),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
response = await __classPrivateFieldGet(this, _LemmyController_fetchFunction, "f").call(this, url, {
|
|
101
|
+
...options,
|
|
102
|
+
method: type_,
|
|
103
|
+
headers: {
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
...__classPrivateFieldGet(this, _LemmyController_headers, "f"),
|
|
106
|
+
},
|
|
107
|
+
body: JSON.stringify(form),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
let json;
|
|
111
|
+
try {
|
|
112
|
+
json = await response.json();
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
throw new LemmyError(response.statusText, response.status);
|
|
116
|
+
}
|
|
117
|
+
if (!response.ok) {
|
|
118
|
+
console.error(`Request error while calling ${type_} ${endpoint} with ${JSON.stringify(form)}`);
|
|
119
|
+
const json2 = json;
|
|
120
|
+
const err = new LemmyError(json2.error ?? response.statusText, response.status, json2.message ?? "");
|
|
121
|
+
throw err;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
result = json;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
129
|
+
error = err instanceof Error ? err : new Error("" + err);
|
|
130
|
+
}
|
|
131
|
+
return (0, map_request_state_1.mapToRequestState)(result, error);
|
|
56
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Set the headers (can be used to set the auth header)
|
|
135
|
+
*/
|
|
136
|
+
setHeaders(headers) {
|
|
137
|
+
__classPrivateFieldSet(this, _LemmyController_headers, headers, "f");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
_LemmyController_apiUrl = new WeakMap(), _LemmyController_headers = new WeakMap(), _LemmyController_fetchFunction = new WeakMap(), _LemmyController_instances = new WeakSet(), _LemmyController_buildFullUrl = function _LemmyController_buildFullUrl(endpoint) {
|
|
141
|
+
return `${__classPrivateFieldGet(this, _LemmyController_apiUrl, "f")}${endpoint}`;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Helps build lemmy HTTP requests.
|
|
145
|
+
*/
|
|
146
|
+
let LemmyHttp = class LemmyHttp extends LemmyController {
|
|
57
147
|
/**
|
|
58
148
|
* @summary Gets the site, and your user data.
|
|
59
149
|
*/
|
|
60
150
|
async getSite(options) {
|
|
61
|
-
return
|
|
151
|
+
return this.wrapper(HttpType.Get, "/site", {}, options);
|
|
62
152
|
}
|
|
63
153
|
/**
|
|
64
154
|
* @summary Create your site.
|
|
65
155
|
*/
|
|
66
156
|
async createSite(form, options) {
|
|
67
|
-
return
|
|
157
|
+
return this.wrapper(HttpType.Post, "/site", form, options);
|
|
68
158
|
}
|
|
69
159
|
/**
|
|
70
160
|
* @summary Edit your site.
|
|
71
161
|
*/
|
|
72
162
|
async editSite(form, options) {
|
|
73
|
-
return
|
|
163
|
+
return this.wrapper(HttpType.Put, "/site", form, options);
|
|
74
164
|
}
|
|
75
165
|
/**
|
|
76
166
|
* @summary Leave the Site admins.
|
|
77
167
|
*/
|
|
78
168
|
async leaveAdmin(options) {
|
|
79
|
-
return
|
|
169
|
+
return this.wrapper(HttpType.Post, "/admin/leave", {}, options);
|
|
80
170
|
}
|
|
81
171
|
/**
|
|
82
172
|
* @summary Generate a TOTP / two-factor secret.
|
|
83
173
|
*
|
|
84
174
|
* Generate a TOTP / two-factor secret.
|
|
85
|
-
* Afterwards you need to call `/account/auth/totp/
|
|
175
|
+
* Afterwards you need to call `/account/auth/totp/edit` with a valid token to enable it.
|
|
86
176
|
*/
|
|
87
177
|
async generateTotpSecret(options) {
|
|
88
|
-
return
|
|
178
|
+
return this.wrapper(HttpType.Post, "/account/auth/totp/generate", {}, options);
|
|
89
179
|
}
|
|
90
180
|
/**
|
|
91
181
|
* @summary Get data of current user.
|
|
92
182
|
*/
|
|
93
183
|
async getMyUser(options) {
|
|
94
|
-
return
|
|
184
|
+
return this.wrapper(HttpType.Get, "/account", {}, options);
|
|
95
185
|
}
|
|
96
186
|
/**
|
|
97
187
|
* @summary Export a backup of your user settings.
|
|
@@ -99,50 +189,50 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
99
189
|
* Export a backup of your user settings, including your saved content,
|
|
100
190
|
* followed communities, and blocks.
|
|
101
191
|
*/
|
|
102
|
-
async
|
|
103
|
-
return
|
|
192
|
+
async exportUserSettings(options) {
|
|
193
|
+
return this.wrapper(HttpType.Get, "/account/settings/export", {}, options);
|
|
104
194
|
}
|
|
105
195
|
/**
|
|
106
196
|
* @summary Import a backup of your user settings.
|
|
107
197
|
*/
|
|
108
|
-
async
|
|
109
|
-
return
|
|
198
|
+
async importUserSettings(form, options) {
|
|
199
|
+
return this.wrapper(HttpType.Post, "/account/settings/import", form, options);
|
|
110
200
|
}
|
|
111
201
|
/**
|
|
112
202
|
* @summary List login tokens for your user
|
|
113
203
|
*/
|
|
114
204
|
async listLogins(options) {
|
|
115
|
-
return
|
|
205
|
+
return this.wrapper(HttpType.Get, "/account/login/list", {}, options);
|
|
116
206
|
}
|
|
117
207
|
/**
|
|
118
208
|
* @summary Returns an error message if your auth token is invalid
|
|
119
209
|
*/
|
|
120
210
|
async validateAuth(options) {
|
|
121
|
-
return
|
|
211
|
+
return this.wrapper(HttpType.Get, "/account/validate_auth", {}, options);
|
|
122
212
|
}
|
|
123
213
|
/**
|
|
124
214
|
* @summary List all the media for your account.
|
|
125
215
|
*/
|
|
126
216
|
async listMedia(form = {}, options) {
|
|
127
|
-
return
|
|
217
|
+
return this.wrapper(HttpType.Get, "/account/media/list", form, options);
|
|
128
218
|
}
|
|
129
219
|
/**
|
|
130
220
|
* @summary Delete media for your account.
|
|
131
221
|
*/
|
|
132
222
|
async deleteMedia(form, options) {
|
|
133
|
-
return
|
|
223
|
+
return this.wrapper(HttpType.Delete, "/account/media", form, options);
|
|
134
224
|
}
|
|
135
225
|
/**
|
|
136
226
|
* @summary Delete any media. (Admin only)
|
|
137
227
|
*/
|
|
138
|
-
async
|
|
139
|
-
return
|
|
228
|
+
async adminDeleteMedia(form, options) {
|
|
229
|
+
return this.wrapper(HttpType.Delete, "/image", form, options);
|
|
140
230
|
}
|
|
141
231
|
/**
|
|
142
232
|
* @summary List all the media known to your instance.
|
|
143
233
|
*/
|
|
144
|
-
async
|
|
145
|
-
return
|
|
234
|
+
async adminListMedia(form = {}, options) {
|
|
235
|
+
return this.wrapper(HttpType.Get, "/image/list", form, options);
|
|
146
236
|
}
|
|
147
237
|
/**
|
|
148
238
|
* @summary Enable / Disable TOTP / two-factor authentication.
|
|
@@ -151,868 +241,837 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
|
|
|
151
241
|
*
|
|
152
242
|
* Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token.
|
|
153
243
|
*/
|
|
154
|
-
async
|
|
155
|
-
return
|
|
244
|
+
async editTotp(form, options) {
|
|
245
|
+
return this.wrapper(HttpType.Post, "/account/auth/totp/edit", form, options);
|
|
156
246
|
}
|
|
157
247
|
/**
|
|
158
248
|
* @summary Get the modlog.
|
|
159
249
|
*/
|
|
160
250
|
async getModlog(form = {}, options) {
|
|
161
|
-
return
|
|
251
|
+
return this.wrapper(HttpType.Get, "/modlog", form, options);
|
|
162
252
|
}
|
|
163
253
|
/**
|
|
164
254
|
* @summary Search lemmy. If `search_term` is a url it also attempts to fetch it, just like `resolve_object`.
|
|
165
255
|
*/
|
|
166
256
|
async search(form, options) {
|
|
167
|
-
return
|
|
257
|
+
return this.wrapper(HttpType.Get, "/search", form, options);
|
|
168
258
|
}
|
|
169
259
|
/**
|
|
170
260
|
* @summary Fetch a non-local / federated object.
|
|
171
261
|
*/
|
|
172
262
|
async resolveObject(form, options) {
|
|
173
|
-
return
|
|
263
|
+
return this.wrapper(HttpType.Get, "/resolve_object", form, options);
|
|
174
264
|
}
|
|
175
265
|
/**
|
|
176
266
|
* @summary Create a new community.
|
|
177
267
|
*/
|
|
178
268
|
async createCommunity(form, options) {
|
|
179
|
-
return
|
|
269
|
+
return this.wrapper(HttpType.Post, "/community", form, options);
|
|
180
270
|
}
|
|
181
271
|
/**
|
|
182
272
|
* @summary Get / fetch a community.
|
|
183
273
|
*/
|
|
184
274
|
async getCommunity(form = {}, options) {
|
|
185
|
-
return
|
|
275
|
+
return this.wrapper(HttpType.Get, "/community", form, options);
|
|
186
276
|
}
|
|
187
277
|
/**
|
|
188
278
|
* @summary Edit a community.
|
|
189
279
|
*/
|
|
190
280
|
async editCommunity(form, options) {
|
|
191
|
-
return
|
|
281
|
+
return this.wrapper(HttpType.Put, "/community", form, options);
|
|
192
282
|
}
|
|
193
283
|
/**
|
|
194
284
|
* @summary List communities, with various filters.
|
|
195
285
|
*/
|
|
196
286
|
async listCommunities(form = {}, options) {
|
|
197
|
-
return
|
|
287
|
+
return this.wrapper(HttpType.Get, "/community/list", form, options);
|
|
198
288
|
}
|
|
199
289
|
/**
|
|
200
290
|
* @summary Follow / subscribe to a community.
|
|
201
291
|
*/
|
|
202
292
|
async followCommunity(form, options) {
|
|
203
|
-
return
|
|
293
|
+
return this.wrapper(HttpType.Post, "/community/follow", form, options);
|
|
204
294
|
}
|
|
205
295
|
/**
|
|
206
|
-
* @summary
|
|
296
|
+
* @summary Returns the amount of unread items of various types. For normal users this means * the number of unread notifications, mods and admins get additional unread counts for
|
|
297
|
+
* reports, registration applications and pending follows to private communities.
|
|
207
298
|
*/
|
|
208
|
-
async
|
|
209
|
-
return
|
|
299
|
+
async getUnreadCounts(options) {
|
|
300
|
+
return this.wrapper(HttpType.Get, "/account/unread_counts", {}, options);
|
|
210
301
|
}
|
|
211
302
|
/**
|
|
212
303
|
* @summary Get a community's pending followers.
|
|
213
304
|
*/
|
|
214
305
|
async listCommunityPendingFollows(form, options) {
|
|
215
|
-
return
|
|
306
|
+
return this.wrapper(HttpType.Get, "/community/pending_follows/list", form, options);
|
|
216
307
|
}
|
|
217
308
|
/**
|
|
218
309
|
* @summary Approve a community pending follow request.
|
|
219
310
|
*/
|
|
220
311
|
async approveCommunityPendingFollow(form, options) {
|
|
221
|
-
return
|
|
312
|
+
return this.wrapper(HttpType.Post, "/community/pending_follows/approve", form, options);
|
|
222
313
|
}
|
|
223
314
|
/**
|
|
224
315
|
* @summary Block a community.
|
|
225
316
|
*/
|
|
226
317
|
async blockCommunity(form, options) {
|
|
227
|
-
return
|
|
318
|
+
return this.wrapper(HttpType.Post, "/account/block/community", form, options);
|
|
228
319
|
}
|
|
229
320
|
/**
|
|
230
321
|
* @summary Delete a community.
|
|
231
322
|
*/
|
|
232
323
|
async deleteCommunity(form, options) {
|
|
233
|
-
return
|
|
324
|
+
return this.wrapper(HttpType.Delete, "/community", form, options);
|
|
234
325
|
}
|
|
235
326
|
/**
|
|
236
327
|
* @summary Hide a community from public / "All" view. Admins only.
|
|
237
328
|
*/
|
|
238
329
|
async hideCommunity(form, options) {
|
|
239
|
-
return
|
|
330
|
+
return this.wrapper(HttpType.Put, "/community/hide", form, options);
|
|
240
331
|
}
|
|
241
332
|
/**
|
|
242
333
|
* @summary A moderator remove for a community.
|
|
243
334
|
*/
|
|
244
335
|
async removeCommunity(form, options) {
|
|
245
|
-
return
|
|
336
|
+
return this.wrapper(HttpType.Post, "/community/remove", form, options);
|
|
246
337
|
}
|
|
247
338
|
/**
|
|
248
339
|
* @summary Transfer your community to an existing moderator.
|
|
249
340
|
*/
|
|
250
341
|
async transferCommunity(form, options) {
|
|
251
|
-
return
|
|
342
|
+
return this.wrapper(HttpType.Post, "/community/transfer", form, options);
|
|
252
343
|
}
|
|
253
344
|
/**
|
|
254
345
|
* @summary Ban a user from a community.
|
|
255
346
|
*/
|
|
256
347
|
async banFromCommunity(form, options) {
|
|
257
|
-
return
|
|
348
|
+
return this.wrapper(HttpType.Post, "/community/ban_user", form, options);
|
|
258
349
|
}
|
|
259
350
|
/**
|
|
260
351
|
* @summary Add a moderator to your community.
|
|
261
352
|
*/
|
|
262
353
|
async addModToCommunity(form, options) {
|
|
263
|
-
return
|
|
354
|
+
return this.wrapper(HttpType.Post, "/community/mod", form, options);
|
|
264
355
|
}
|
|
265
356
|
/**
|
|
266
357
|
* @summary Get a random community.
|
|
267
358
|
*/
|
|
268
359
|
async getRandomCommunity(form, options) {
|
|
269
|
-
return
|
|
360
|
+
return this.wrapper(HttpType.Get, "/community/random", form, options);
|
|
270
361
|
}
|
|
271
362
|
/**
|
|
272
363
|
* @summary Create a report for a community.
|
|
273
364
|
*/
|
|
274
365
|
async createCommunityReport(form, options) {
|
|
275
|
-
return
|
|
366
|
+
return this.wrapper(HttpType.Post, "/community/report", form, options);
|
|
276
367
|
}
|
|
277
368
|
/**
|
|
278
369
|
* @summary Resolve a report for a private message.
|
|
279
370
|
*/
|
|
280
371
|
async resolveCommunityReport(form, options) {
|
|
281
|
-
return
|
|
372
|
+
return this.wrapper(HttpType.Put, "/community/report/resolve", form, options);
|
|
282
373
|
}
|
|
283
374
|
/**
|
|
284
375
|
* @summary Create a post.
|
|
285
376
|
*/
|
|
286
377
|
async createPost(form, options) {
|
|
287
|
-
return
|
|
378
|
+
return this.wrapper(HttpType.Post, "/post", form, options);
|
|
288
379
|
}
|
|
289
380
|
/**
|
|
290
381
|
* @summary Get / fetch a post.
|
|
291
382
|
*/
|
|
292
383
|
async getPost(form = {}, options) {
|
|
293
|
-
return
|
|
384
|
+
return this.wrapper(HttpType.Get, "/post", form, options);
|
|
294
385
|
}
|
|
295
386
|
/**
|
|
296
387
|
* @summary Edit a post.
|
|
297
388
|
*/
|
|
298
389
|
async editPost(form, options) {
|
|
299
|
-
return
|
|
390
|
+
return this.wrapper(HttpType.Put, "/post", form, options);
|
|
300
391
|
}
|
|
301
392
|
/**
|
|
302
393
|
* @summary Mods can change nsfw flag and tags for a post
|
|
303
394
|
*/
|
|
304
395
|
async modEditPost(form, options) {
|
|
305
|
-
return
|
|
396
|
+
return this.wrapper(HttpType.Put, "/post/mod_edit", form, options);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* @summary Creates a warning against a post and notifies the user.
|
|
400
|
+
*/
|
|
401
|
+
async warnPost(form, options) {
|
|
402
|
+
return this.wrapper(HttpType.Post, "/post/warn", form, options);
|
|
306
403
|
}
|
|
307
404
|
/**
|
|
308
405
|
* @summary Delete a post.
|
|
309
406
|
*/
|
|
310
407
|
async deletePost(form, options) {
|
|
311
|
-
return
|
|
408
|
+
return this.wrapper(HttpType.Delete, "/post", form, options);
|
|
312
409
|
}
|
|
313
410
|
/**
|
|
314
411
|
* @summary A moderator remove for a post.
|
|
315
412
|
*/
|
|
316
413
|
async removePost(form, options) {
|
|
317
|
-
return
|
|
414
|
+
return this.wrapper(HttpType.Post, "/post/remove", form, options);
|
|
318
415
|
}
|
|
319
416
|
/**
|
|
320
417
|
* @summary Mark a post as read.
|
|
321
418
|
*/
|
|
322
419
|
async markPostAsRead(form, options) {
|
|
323
|
-
return
|
|
420
|
+
return this.wrapper(HttpType.Post, "/post/mark_as_read", form, options);
|
|
324
421
|
}
|
|
325
422
|
/**
|
|
326
423
|
* @summary Mark multiple posts as read.
|
|
327
424
|
*/
|
|
328
|
-
async
|
|
329
|
-
return
|
|
425
|
+
async markManyPostsAsRead(form, options) {
|
|
426
|
+
return this.wrapper(HttpType.Post, "/post/mark_as_read/many", form, options);
|
|
330
427
|
}
|
|
331
428
|
/**
|
|
332
429
|
* @summary Hide a post from list views.
|
|
333
430
|
*/
|
|
334
431
|
async hidePost(form, options) {
|
|
335
|
-
return
|
|
432
|
+
return this.wrapper(HttpType.Post, "/post/hide", form, options);
|
|
336
433
|
}
|
|
337
434
|
/**
|
|
338
435
|
* @summary A moderator can lock a post ( IE disable new comments ).
|
|
339
436
|
*/
|
|
340
437
|
async lockPost(form, options) {
|
|
341
|
-
return
|
|
438
|
+
return this.wrapper(HttpType.Post, "/post/lock", form, options);
|
|
342
439
|
}
|
|
343
440
|
/**
|
|
344
441
|
* @summary A moderator can feature a community post ( IE stick it to the top of a community ).
|
|
345
442
|
*/
|
|
346
443
|
async featurePost(form, options) {
|
|
347
|
-
return
|
|
444
|
+
return this.wrapper(HttpType.Post, "/post/feature", form, options);
|
|
348
445
|
}
|
|
349
446
|
/**
|
|
350
447
|
* @summary Get / fetch posts, with various filters.
|
|
351
448
|
*/
|
|
352
449
|
async getPosts(form = {}, options) {
|
|
353
|
-
return
|
|
450
|
+
return this.wrapper(HttpType.Get, "/post/list", form, options);
|
|
354
451
|
}
|
|
355
452
|
/**
|
|
356
453
|
* @summary Like / vote on a post.
|
|
357
454
|
*/
|
|
358
455
|
async likePost(form, options) {
|
|
359
|
-
return
|
|
456
|
+
return this.wrapper(HttpType.Post, "/post/like", form, options);
|
|
360
457
|
}
|
|
361
458
|
/**
|
|
362
459
|
* @summary List a post's likes. Admin-only.
|
|
363
460
|
*/
|
|
364
461
|
async listPostLikes(form, options) {
|
|
365
|
-
return
|
|
462
|
+
return this.wrapper(HttpType.Get, "/post/like/list", form, options);
|
|
366
463
|
}
|
|
367
464
|
/**
|
|
368
465
|
* @summary Save a post.
|
|
369
466
|
*/
|
|
370
467
|
async savePost(form, options) {
|
|
371
|
-
return
|
|
468
|
+
return this.wrapper(HttpType.Put, "/post/save", form, options);
|
|
372
469
|
}
|
|
373
470
|
/**
|
|
374
471
|
* @summary Report a post.
|
|
375
472
|
*/
|
|
376
473
|
async createPostReport(form, options) {
|
|
377
|
-
return
|
|
474
|
+
return this.wrapper(HttpType.Post, "/post/report", form, options);
|
|
378
475
|
}
|
|
379
476
|
/**
|
|
380
477
|
* @summary Resolve a post report. Only a mod can do this.
|
|
381
478
|
*/
|
|
382
479
|
async resolvePostReport(form, options) {
|
|
383
|
-
return
|
|
480
|
+
return this.wrapper(HttpType.Put, "/post/report/resolve", form, options);
|
|
384
481
|
}
|
|
385
482
|
/**
|
|
386
483
|
* @summary Fetch metadata for any given site.
|
|
387
484
|
*/
|
|
388
485
|
async getSiteMetadata(form, options) {
|
|
389
|
-
return
|
|
486
|
+
return this.wrapper(HttpType.Get, "/post/site_metadata", form, options);
|
|
390
487
|
}
|
|
391
488
|
/**
|
|
392
489
|
* @summary Create a comment.
|
|
393
490
|
*/
|
|
394
491
|
async createComment(form, options) {
|
|
395
|
-
return
|
|
492
|
+
return this.wrapper(HttpType.Post, "/comment", form, options);
|
|
396
493
|
}
|
|
397
494
|
/**
|
|
398
495
|
* @summary Edit a comment.
|
|
399
496
|
*/
|
|
400
497
|
async editComment(form, options) {
|
|
401
|
-
return
|
|
498
|
+
return this.wrapper(HttpType.Put, "/comment", form, options);
|
|
402
499
|
}
|
|
403
500
|
/**
|
|
404
501
|
* @summary Delete a comment.
|
|
405
502
|
*/
|
|
406
503
|
async deleteComment(form, options) {
|
|
407
|
-
return
|
|
504
|
+
return this.wrapper(HttpType.Delete, "/comment", form, options);
|
|
408
505
|
}
|
|
409
506
|
/**
|
|
410
507
|
* @summary A moderator remove for a comment.
|
|
411
508
|
*/
|
|
412
509
|
async removeComment(form, options) {
|
|
413
|
-
return
|
|
510
|
+
return this.wrapper(HttpType.Post, "/comment/remove", form, options);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* @summary A moderator can lock a comment (IE disable replies).
|
|
514
|
+
*/
|
|
515
|
+
async lockComment(form, options) {
|
|
516
|
+
return this.wrapper(HttpType.Post, "/comment/lock", form, options);
|
|
414
517
|
}
|
|
415
518
|
/**
|
|
416
|
-
* @
|
|
519
|
+
* @Summary Like / vote on a comment.
|
|
417
520
|
*/
|
|
418
521
|
async likeComment(form, options) {
|
|
419
|
-
return
|
|
522
|
+
return this.wrapper(HttpType.Post, "/comment/like", form, options);
|
|
420
523
|
}
|
|
421
524
|
/**
|
|
422
525
|
* @summary List a comment's likes. Admin-only.
|
|
423
526
|
*/
|
|
424
527
|
async listCommentLikes(form, options) {
|
|
425
|
-
return
|
|
528
|
+
return this.wrapper(HttpType.Get, "/comment/like/list", form, options);
|
|
426
529
|
}
|
|
427
530
|
/**
|
|
428
531
|
* @summary Save a comment.
|
|
429
532
|
*/
|
|
430
533
|
async saveComment(form, options) {
|
|
431
|
-
return
|
|
534
|
+
return this.wrapper(HttpType.Put, "/comment/save", form, options);
|
|
432
535
|
}
|
|
433
536
|
/**
|
|
434
537
|
* @summary Distinguishes a comment (speak as moderator)
|
|
435
538
|
*/
|
|
436
539
|
async distinguishComment(form, options) {
|
|
437
|
-
return
|
|
540
|
+
return this.wrapper(HttpType.Post, "/comment/distinguish", form, options);
|
|
438
541
|
}
|
|
439
542
|
/**
|
|
440
543
|
* @summary Get / fetch comments.
|
|
441
544
|
*/
|
|
442
545
|
async getComments(form = {}, options) {
|
|
443
|
-
return
|
|
546
|
+
return this.wrapper(HttpType.Get, "/comment/list", form, options);
|
|
444
547
|
}
|
|
445
548
|
/**
|
|
446
549
|
* @summary Get / fetch comments, but without the post or community.
|
|
447
550
|
*/
|
|
448
551
|
async getCommentsSlim(form = {}, options) {
|
|
449
|
-
return
|
|
552
|
+
return this.wrapper(HttpType.Get, "/comment/list/slim", form, options);
|
|
450
553
|
}
|
|
451
554
|
/**
|
|
452
555
|
* @summary Get / fetch comment.
|
|
453
556
|
*/
|
|
454
557
|
async getComment(form, options) {
|
|
455
|
-
return
|
|
558
|
+
return this.wrapper(HttpType.Get, "/comment", form, options);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* @summary Creates a warning against a comment and notifies the user.
|
|
562
|
+
*/
|
|
563
|
+
async warnComment(form, options) {
|
|
564
|
+
return this.wrapper(HttpType.Post, "/comment/warn", form, options);
|
|
456
565
|
}
|
|
457
566
|
/**
|
|
458
567
|
* @summary Report a comment.
|
|
459
568
|
*/
|
|
460
569
|
async createCommentReport(form, options) {
|
|
461
|
-
return
|
|
570
|
+
return this.wrapper(HttpType.Post, "/comment/report", form, options);
|
|
462
571
|
}
|
|
463
572
|
/**
|
|
464
573
|
* @summary Resolve a comment report. Only a mod can do this.
|
|
465
574
|
*/
|
|
466
575
|
async resolveCommentReport(form, options) {
|
|
467
|
-
return
|
|
576
|
+
return this.wrapper(HttpType.Put, "/comment/report/resolve", form, options);
|
|
468
577
|
}
|
|
469
578
|
/**
|
|
470
579
|
* @summary Create a private message.
|
|
471
580
|
*/
|
|
472
581
|
async createPrivateMessage(form, options) {
|
|
473
|
-
return
|
|
582
|
+
return this.wrapper(HttpType.Post, "/private_message", form, options);
|
|
474
583
|
}
|
|
475
584
|
/**
|
|
476
585
|
* @summary Edit a private message.
|
|
477
586
|
*/
|
|
478
587
|
async editPrivateMessage(form, options) {
|
|
479
|
-
return
|
|
588
|
+
return this.wrapper(HttpType.Put, "/private_message", form, options);
|
|
480
589
|
}
|
|
481
590
|
/**
|
|
482
591
|
* @summary Delete a private message.
|
|
483
592
|
*/
|
|
484
593
|
async deletePrivateMessage(form, options) {
|
|
485
|
-
return
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* @summary Mark a private message as read.
|
|
489
|
-
*/
|
|
490
|
-
async markPrivateMessageAsRead(form, options) {
|
|
491
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form, options);
|
|
594
|
+
return this.wrapper(HttpType.Delete, "/private_message", form, options);
|
|
492
595
|
}
|
|
493
596
|
/**
|
|
494
597
|
* @summary Create a report for a private message.
|
|
495
598
|
*/
|
|
496
599
|
async createPrivateMessageReport(form, options) {
|
|
497
|
-
return
|
|
600
|
+
return this.wrapper(HttpType.Post, "/private_message/report", form, options);
|
|
498
601
|
}
|
|
499
602
|
/**
|
|
500
603
|
* @summary Resolve a report for a private message.
|
|
501
604
|
*/
|
|
502
605
|
async resolvePrivateMessageReport(form, options) {
|
|
503
|
-
return
|
|
606
|
+
return this.wrapper(HttpType.Put, "/private_message/report/resolve", form, options);
|
|
504
607
|
}
|
|
505
608
|
/**
|
|
506
609
|
* @summary Register a new user.
|
|
507
610
|
*/
|
|
508
611
|
async register(form, options) {
|
|
509
|
-
return
|
|
612
|
+
return this.wrapper(HttpType.Post, "/account/auth/register", form, options);
|
|
510
613
|
}
|
|
511
614
|
/**
|
|
512
615
|
* @summary Log into lemmy.
|
|
513
616
|
*/
|
|
514
617
|
async login(form, options) {
|
|
515
|
-
return
|
|
618
|
+
return this.wrapper(HttpType.Post, "/account/auth/login", form, options);
|
|
516
619
|
}
|
|
517
620
|
/**
|
|
518
621
|
* @summary Invalidate the currently used auth token.
|
|
519
622
|
*/
|
|
520
623
|
async logout(options) {
|
|
521
|
-
return
|
|
624
|
+
return this.wrapper(HttpType.Post, "/account/auth/logout", {}, options);
|
|
522
625
|
}
|
|
523
626
|
/**
|
|
524
627
|
* @summary Get the details for a person.
|
|
525
628
|
*/
|
|
526
629
|
async getPersonDetails(form = {}, options) {
|
|
527
|
-
return
|
|
630
|
+
return this.wrapper(HttpType.Get, "/person", form, options);
|
|
528
631
|
}
|
|
529
632
|
/**
|
|
530
633
|
* @summary List the content for a person.
|
|
531
634
|
*/
|
|
532
635
|
async listPersonContent(form = {}, options) {
|
|
533
|
-
return
|
|
636
|
+
return this.wrapper(HttpType.Get, "/person/content", form, options);
|
|
534
637
|
}
|
|
535
638
|
/**
|
|
536
639
|
* @summary Make a note for a person.
|
|
537
640
|
*/
|
|
538
641
|
async notePerson(form, options) {
|
|
539
|
-
return
|
|
642
|
+
return this.wrapper(HttpType.Post, "/person/note", form, options);
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* @summary List persons.
|
|
646
|
+
*/
|
|
647
|
+
async listPersons(form = {}, options) {
|
|
648
|
+
return this.wrapper(HttpType.Get, "/person/list", form, options);
|
|
540
649
|
}
|
|
541
650
|
/**
|
|
542
651
|
* @summary Ban a person from your site.
|
|
543
652
|
*/
|
|
544
653
|
async banPerson(form, options) {
|
|
545
|
-
return
|
|
654
|
+
return this.wrapper(HttpType.Post, "/admin/ban", form, options);
|
|
546
655
|
}
|
|
547
656
|
/**
|
|
548
657
|
* @summary Get a list of users.
|
|
549
658
|
*/
|
|
550
|
-
async
|
|
551
|
-
return
|
|
659
|
+
async adminListUsers(form = {}, options) {
|
|
660
|
+
return this.wrapper(HttpType.Get, "/admin/users", form, options);
|
|
552
661
|
}
|
|
553
662
|
/**
|
|
554
663
|
* @summary Block a person.
|
|
555
664
|
*/
|
|
556
665
|
async blockPerson(form, options) {
|
|
557
|
-
return
|
|
666
|
+
return this.wrapper(HttpType.Post, "/account/block/person", form, options);
|
|
558
667
|
}
|
|
559
668
|
/**
|
|
560
669
|
* @summary Fetch a Captcha.
|
|
561
670
|
*/
|
|
562
671
|
async getCaptcha(options) {
|
|
563
|
-
return
|
|
672
|
+
return this.wrapper(HttpType.Get, "/account/auth/get_captcha", {}, options);
|
|
564
673
|
}
|
|
565
674
|
/**
|
|
566
675
|
* @summary Delete your account.
|
|
567
676
|
*/
|
|
568
677
|
async deleteAccount(form, options) {
|
|
569
|
-
return
|
|
678
|
+
return this.wrapper(HttpType.Delete, "/account", form, options);
|
|
570
679
|
}
|
|
571
680
|
/**
|
|
572
681
|
* @summary Reset your password.
|
|
573
682
|
*/
|
|
574
|
-
async
|
|
575
|
-
return
|
|
683
|
+
async resetPassword(form, options) {
|
|
684
|
+
return this.wrapper(HttpType.Post, "/account/auth/password_reset", form, options);
|
|
576
685
|
}
|
|
577
686
|
/**
|
|
578
687
|
* @summary Change your password from an email / token based reset.
|
|
579
688
|
*/
|
|
580
|
-
async
|
|
581
|
-
return
|
|
689
|
+
async changePasswordAfterReset(form, options) {
|
|
690
|
+
return this.wrapper(HttpType.Post, "/account/auth/password_change", form, options);
|
|
582
691
|
}
|
|
583
692
|
/**
|
|
584
|
-
* @summary Mark all
|
|
693
|
+
* @summary Mark all notifications as read.
|
|
585
694
|
*/
|
|
586
695
|
async markAllNotificationsAsRead(options) {
|
|
587
|
-
return
|
|
696
|
+
return this.wrapper(HttpType.Post, "/account/notification/mark_as_read/all", {}, options);
|
|
588
697
|
}
|
|
589
698
|
/**
|
|
590
|
-
* @summary Mark a
|
|
699
|
+
* @summary Mark a notification as read.
|
|
591
700
|
*/
|
|
592
701
|
async markNotificationAsRead(form, options) {
|
|
593
|
-
return
|
|
702
|
+
return this.wrapper(HttpType.Post, "/account/notification/mark_as_read", form, options);
|
|
594
703
|
}
|
|
595
704
|
/**
|
|
596
705
|
* @summary Save your user settings.
|
|
597
706
|
*/
|
|
598
707
|
async saveUserSettings(form, options) {
|
|
599
|
-
return
|
|
708
|
+
return this.wrapper(HttpType.Put, "/account/settings/save", form, options);
|
|
600
709
|
}
|
|
601
710
|
/**
|
|
602
711
|
* @summary Change your user password.
|
|
603
712
|
*/
|
|
604
713
|
async changePassword(form, options) {
|
|
605
|
-
return
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
* @summary Get counts for your reports.
|
|
609
|
-
*/
|
|
610
|
-
async getReportCount(form, options) {
|
|
611
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/report_count", form, options);
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* @summary Get your unread counts.
|
|
615
|
-
*/
|
|
616
|
-
async getUnreadCount(options) {
|
|
617
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/unread_count", {}, options);
|
|
714
|
+
return this.wrapper(HttpType.Put, "/account/auth/change_password", form, options);
|
|
618
715
|
}
|
|
619
716
|
/**
|
|
620
717
|
* @summary Get your inbox (replies, comment mentions, post mentions, and messages)
|
|
621
718
|
*/
|
|
622
719
|
async listNotifications(form, options) {
|
|
623
|
-
return
|
|
720
|
+
return this.wrapper(HttpType.Get, "/account/notification/list", form, options);
|
|
624
721
|
}
|
|
625
722
|
/**
|
|
626
723
|
* @summary Verify your email
|
|
627
724
|
*/
|
|
628
725
|
async verifyEmail(form, options) {
|
|
629
|
-
return
|
|
726
|
+
return this.wrapper(HttpType.Post, "/account/auth/verify_email", form, options);
|
|
630
727
|
}
|
|
631
728
|
/**
|
|
632
729
|
* @summary Resend a verification email.
|
|
633
730
|
*/
|
|
634
731
|
async resendVerificationEmail(form, options) {
|
|
635
|
-
return
|
|
732
|
+
return this.wrapper(HttpType.Post, "/account/auth/resend_verification_email", form, options);
|
|
636
733
|
}
|
|
637
734
|
/**
|
|
638
735
|
* @summary List your saved content.
|
|
639
736
|
*/
|
|
640
737
|
async listPersonSaved(form, options) {
|
|
641
|
-
return
|
|
738
|
+
return this.wrapper(HttpType.Get, "/account/saved", form, options);
|
|
642
739
|
}
|
|
643
740
|
/**
|
|
644
741
|
* @summary List your read content.
|
|
645
742
|
*/
|
|
646
743
|
async listPersonRead(form, options) {
|
|
647
|
-
return
|
|
744
|
+
return this.wrapper(HttpType.Get, "/account/read", form, options);
|
|
648
745
|
}
|
|
649
746
|
/**
|
|
650
747
|
* @summary List your hidden content.
|
|
651
748
|
*/
|
|
652
749
|
async listPersonHidden(form, options) {
|
|
653
|
-
return
|
|
750
|
+
return this.wrapper(HttpType.Get, "/account/hidden", form, options);
|
|
654
751
|
}
|
|
655
752
|
/**
|
|
656
753
|
* @summary List your liked content.
|
|
657
754
|
*/
|
|
658
755
|
async listPersonLiked(form, options) {
|
|
659
|
-
return
|
|
756
|
+
return this.wrapper(HttpType.Get, "/account/liked", form, options);
|
|
660
757
|
}
|
|
661
758
|
/**
|
|
662
759
|
* @summary Add an admin to your site.
|
|
663
760
|
*/
|
|
664
761
|
async addAdmin(form, options) {
|
|
665
|
-
return
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* @summary Get the unread registration applications count.
|
|
669
|
-
*/
|
|
670
|
-
async getUnreadRegistrationApplicationCount(options) {
|
|
671
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/count", {}, options);
|
|
762
|
+
return this.wrapper(HttpType.Post, "/admin/add", form, options);
|
|
672
763
|
}
|
|
673
764
|
/**
|
|
674
765
|
* @summary List the registration applications.
|
|
675
766
|
*/
|
|
676
767
|
async listRegistrationApplications(form, options) {
|
|
677
|
-
return
|
|
768
|
+
return this.wrapper(HttpType.Get, "/admin/registration_application/list", form, options);
|
|
678
769
|
}
|
|
679
770
|
/**
|
|
680
771
|
* @summary Approve a registration application
|
|
681
772
|
*/
|
|
682
773
|
async approveRegistrationApplication(form, options) {
|
|
683
|
-
return
|
|
774
|
+
return this.wrapper(HttpType.Put, "/admin/registration_application/approve", form, options);
|
|
684
775
|
}
|
|
685
776
|
/**
|
|
686
777
|
* @summary Get the application a user submitted when they first registered their account
|
|
687
778
|
*/
|
|
688
779
|
async getRegistrationApplication(form, options) {
|
|
689
|
-
return
|
|
780
|
+
return this.wrapper(HttpType.Get, "/admin/registration_application", form, options);
|
|
690
781
|
}
|
|
691
782
|
/**
|
|
692
783
|
* @summary Purge / Delete a person from the database.
|
|
693
784
|
*/
|
|
694
785
|
async purgePerson(form, options) {
|
|
695
|
-
return
|
|
786
|
+
return this.wrapper(HttpType.Post, "/admin/purge/person", form, options);
|
|
696
787
|
}
|
|
697
788
|
/**
|
|
698
789
|
* @summary Purge / Delete a community from the database.
|
|
699
790
|
*/
|
|
700
791
|
async purgeCommunity(form, options) {
|
|
701
|
-
return
|
|
792
|
+
return this.wrapper(HttpType.Post, "/admin/purge/community", form, options);
|
|
702
793
|
}
|
|
703
794
|
/**
|
|
704
795
|
* @summary Purge / Delete a post from the database.
|
|
705
796
|
*/
|
|
706
797
|
async purgePost(form, options) {
|
|
707
|
-
return
|
|
798
|
+
return this.wrapper(HttpType.Post, "/admin/purge/post", form, options);
|
|
708
799
|
}
|
|
709
800
|
/**
|
|
710
801
|
* @summary Purge / Delete a comment from the database.
|
|
711
802
|
*/
|
|
712
803
|
async purgeComment(form, options) {
|
|
713
|
-
return
|
|
804
|
+
return this.wrapper(HttpType.Post, "/admin/purge/comment", form, options);
|
|
714
805
|
}
|
|
715
806
|
/**
|
|
716
807
|
* @summary Create a new custom emoji.
|
|
717
808
|
*/
|
|
718
809
|
async createCustomEmoji(form, options) {
|
|
719
|
-
return
|
|
810
|
+
return this.wrapper(HttpType.Post, "/custom_emoji", form, options);
|
|
720
811
|
}
|
|
721
812
|
/**
|
|
722
813
|
* @summary Edit an existing custom emoji.
|
|
723
814
|
*/
|
|
724
815
|
async editCustomEmoji(form, options) {
|
|
725
|
-
return
|
|
816
|
+
return this.wrapper(HttpType.Put, "/custom_emoji", form, options);
|
|
726
817
|
}
|
|
727
818
|
/**
|
|
728
819
|
* @summary Delete a custom emoji.
|
|
729
820
|
*/
|
|
730
821
|
async deleteCustomEmoji(form, options) {
|
|
731
|
-
return
|
|
822
|
+
return this.wrapper(HttpType.Post, "/custom_emoji/delete", form, options);
|
|
732
823
|
}
|
|
733
824
|
/**
|
|
734
825
|
* @summary List custom emojis
|
|
735
826
|
*/
|
|
736
827
|
async listCustomEmojis(form, options) {
|
|
737
|
-
return
|
|
828
|
+
return this.wrapper(HttpType.Get, "/custom_emoji/list", form, options);
|
|
738
829
|
}
|
|
739
830
|
/**
|
|
740
831
|
* @summary Create a new tagline
|
|
741
832
|
*/
|
|
742
833
|
async createTagline(form, options) {
|
|
743
|
-
return
|
|
834
|
+
return this.wrapper(HttpType.Post, "/admin/tagline", form, options);
|
|
744
835
|
}
|
|
745
836
|
/**
|
|
746
837
|
* @summary Edit an existing tagline
|
|
747
838
|
*/
|
|
748
839
|
async editTagline(form, options) {
|
|
749
|
-
return
|
|
840
|
+
return this.wrapper(HttpType.Put, "/admin/tagline", form, options);
|
|
750
841
|
}
|
|
751
842
|
/**
|
|
752
843
|
* @summary Delete a tagline
|
|
753
844
|
*/
|
|
754
845
|
async deleteTagline(form, options) {
|
|
755
|
-
return
|
|
846
|
+
return this.wrapper(HttpType.Delete, "/admin/tagline", form, options);
|
|
756
847
|
}
|
|
757
848
|
/**
|
|
758
849
|
* @summary List taglines.
|
|
759
850
|
*/
|
|
760
851
|
async listTaglines(form, options) {
|
|
761
|
-
return
|
|
852
|
+
return this.wrapper(HttpType.Get, "/admin/tagline/list", form, options);
|
|
762
853
|
}
|
|
763
854
|
/**
|
|
764
855
|
* @summary Create a community post tag.
|
|
765
856
|
*/
|
|
766
|
-
createCommunityTag(form, options) {
|
|
767
|
-
return
|
|
857
|
+
async createCommunityTag(form, options) {
|
|
858
|
+
return this.wrapper(HttpType.Post, "/community/tag", form, options);
|
|
768
859
|
}
|
|
769
860
|
/**
|
|
770
861
|
* @summary Edit a community post tag.
|
|
771
862
|
*/
|
|
772
|
-
|
|
773
|
-
return
|
|
863
|
+
async editCommunityTag(form, options) {
|
|
864
|
+
return this.wrapper(HttpType.Put, "/community/tag", form, options);
|
|
774
865
|
}
|
|
775
866
|
/**
|
|
776
867
|
* @summary Delete a post tag in a community.
|
|
777
868
|
*/
|
|
778
|
-
deleteCommunityTag(form, options) {
|
|
779
|
-
return
|
|
869
|
+
async deleteCommunityTag(form, options) {
|
|
870
|
+
return this.wrapper(HttpType.Delete, "/community/tag", form, options);
|
|
780
871
|
}
|
|
781
872
|
/**
|
|
782
873
|
* @summary Create a new oauth provider method
|
|
783
874
|
*/
|
|
784
875
|
async createOAuthProvider(form, options) {
|
|
785
|
-
return
|
|
876
|
+
return this.wrapper(HttpType.Post, "/oauth_provider", form, options);
|
|
786
877
|
}
|
|
787
878
|
/**
|
|
788
879
|
* @summary Edit an existing oauth provider method
|
|
789
880
|
*/
|
|
790
881
|
async editOAuthProvider(form, options) {
|
|
791
|
-
return
|
|
882
|
+
return this.wrapper(HttpType.Put, "/oauth_provider", form, options);
|
|
792
883
|
}
|
|
793
884
|
/**
|
|
794
885
|
* @summary Delete an oauth provider method
|
|
795
886
|
*/
|
|
796
887
|
async deleteOAuthProvider(form, options) {
|
|
797
|
-
return
|
|
888
|
+
return this.wrapper(HttpType.Delete, "/oauth_provider", form, options);
|
|
798
889
|
}
|
|
799
890
|
/**
|
|
800
891
|
* @summary Authenticate with OAuth
|
|
801
892
|
*/
|
|
802
893
|
async authenticateWithOAuth(form, options) {
|
|
803
|
-
return
|
|
894
|
+
return this.wrapper(HttpType.Post, "/oauth/authenticate", form, options);
|
|
804
895
|
}
|
|
805
896
|
/**
|
|
806
897
|
* @summary Fetch federated instances.
|
|
807
898
|
*/
|
|
808
|
-
async getFederatedInstances(options) {
|
|
809
|
-
return
|
|
899
|
+
async getFederatedInstances(form, options) {
|
|
900
|
+
return this.wrapper(HttpType.Get, "/federated_instances", form, options);
|
|
810
901
|
}
|
|
811
902
|
/**
|
|
812
903
|
* @summary List user reports.
|
|
813
904
|
*/
|
|
814
905
|
async listReports(form, options) {
|
|
815
|
-
return
|
|
906
|
+
return this.wrapper(HttpType.Get, "/report/list", form, options);
|
|
816
907
|
}
|
|
817
908
|
/**
|
|
818
909
|
* @summary Block an instance's communities as a user.
|
|
819
910
|
*/
|
|
820
911
|
async userBlockInstanceCommunities(form, options) {
|
|
821
|
-
return
|
|
912
|
+
return this.wrapper(HttpType.Post, "/account/block/instance/communities", form, options);
|
|
822
913
|
}
|
|
823
914
|
/**
|
|
824
915
|
* @summary Block an instance's persons as a user.
|
|
825
916
|
*/
|
|
826
917
|
async userBlockInstancePersons(form, options) {
|
|
827
|
-
return
|
|
918
|
+
return this.wrapper(HttpType.Post, "/account/block/instance/persons", form, options);
|
|
828
919
|
}
|
|
829
920
|
/**
|
|
830
921
|
* @summary Globally block an instance as admin.
|
|
831
922
|
*/
|
|
832
923
|
async adminBlockInstance(form, options) {
|
|
833
|
-
return
|
|
924
|
+
return this.wrapper(HttpType.Post, "/admin/instance/block", form, options);
|
|
834
925
|
}
|
|
835
926
|
/**
|
|
836
927
|
* @summary Globally allow an instance as admin.
|
|
837
928
|
*/
|
|
838
929
|
async adminAllowInstance(form, options) {
|
|
839
|
-
return
|
|
930
|
+
return this.wrapper(HttpType.Post, "/admin/instance/allow", form, options);
|
|
840
931
|
}
|
|
841
932
|
/**
|
|
842
933
|
* @summary Upload new user avatar.
|
|
843
934
|
*/
|
|
844
935
|
async uploadUserAvatar(image, options) {
|
|
845
|
-
return
|
|
936
|
+
return this.upload("/account/avatar", image, options);
|
|
846
937
|
}
|
|
847
938
|
/**
|
|
848
939
|
* @summary Delete the user avatar.
|
|
849
940
|
*/
|
|
850
941
|
async deleteUserAvatar(options) {
|
|
851
|
-
return
|
|
942
|
+
return this.wrapper(HttpType.Delete, "/account/avatar", {}, options);
|
|
852
943
|
}
|
|
853
944
|
/**
|
|
854
945
|
* @summary Upload new user banner.
|
|
855
946
|
*/
|
|
856
947
|
async uploadUserBanner(image, options) {
|
|
857
|
-
return
|
|
948
|
+
return this.upload("/account/banner", image, options);
|
|
858
949
|
}
|
|
859
950
|
/**
|
|
860
951
|
* @summary Delete the user banner.
|
|
861
952
|
*/
|
|
862
953
|
async deleteUserBanner(options) {
|
|
863
|
-
return
|
|
954
|
+
return this.wrapper(HttpType.Delete, "/account/banner", {}, options);
|
|
864
955
|
}
|
|
865
956
|
/**
|
|
866
957
|
* @summary Upload new community icon.
|
|
867
958
|
*/
|
|
868
959
|
async uploadCommunityIcon(query, image, options) {
|
|
869
|
-
return
|
|
960
|
+
return this.uploadWithQuery("/community/icon", query, image, options);
|
|
870
961
|
}
|
|
871
962
|
/**
|
|
872
963
|
* @summary Delete the community icon.
|
|
873
964
|
*/
|
|
874
965
|
async deleteCommunityIcon(form, options) {
|
|
875
|
-
return
|
|
966
|
+
return this.wrapper(HttpType.Delete, "/community/icon", form, options);
|
|
876
967
|
}
|
|
877
968
|
/**
|
|
878
969
|
* @summary Upload new community banner.
|
|
879
970
|
*/
|
|
880
971
|
async uploadCommunityBanner(query, image, options) {
|
|
881
|
-
return
|
|
972
|
+
return this.uploadWithQuery("/community/banner", query, image, options);
|
|
882
973
|
}
|
|
883
974
|
/**
|
|
884
975
|
* @summary Delete the community banner.
|
|
885
976
|
*/
|
|
886
977
|
async deleteCommunityBanner(form, options) {
|
|
887
|
-
return
|
|
978
|
+
return this.wrapper(HttpType.Delete, "/community/banner", form, options);
|
|
888
979
|
}
|
|
889
980
|
/**
|
|
890
981
|
* @summary Upload new site icon.
|
|
891
982
|
*/
|
|
892
983
|
async uploadSiteIcon(image, options) {
|
|
893
|
-
return
|
|
984
|
+
return this.upload("/site/icon", image, options);
|
|
894
985
|
}
|
|
895
986
|
/**
|
|
896
987
|
* @summary Delete the site icon.
|
|
897
988
|
*/
|
|
898
989
|
async deleteSiteIcon(options) {
|
|
899
|
-
return
|
|
990
|
+
return this.wrapper(HttpType.Delete, "/site/icon", {}, options);
|
|
900
991
|
}
|
|
901
992
|
/**
|
|
902
993
|
* @summary Upload new site banner.
|
|
903
994
|
*/
|
|
904
995
|
async uploadSiteBanner(image, options) {
|
|
905
|
-
return
|
|
996
|
+
return this.upload("/site/banner", image, options);
|
|
906
997
|
}
|
|
907
998
|
/**
|
|
908
999
|
* @summary Delete the site banner.
|
|
909
1000
|
*/
|
|
910
1001
|
async deleteSiteBanner(options) {
|
|
911
|
-
return
|
|
1002
|
+
return this.wrapper(HttpType.Delete, "/site/banner", {}, options);
|
|
912
1003
|
}
|
|
913
1004
|
/**
|
|
914
1005
|
* @summary Upload an image to the server.
|
|
915
1006
|
*/
|
|
916
1007
|
async uploadImage(image, options) {
|
|
917
|
-
return
|
|
1008
|
+
return this.upload("/image", image, options);
|
|
918
1009
|
}
|
|
919
1010
|
/**
|
|
920
1011
|
* @summary Health check for image functionality
|
|
921
1012
|
*/
|
|
922
1013
|
async imageHealth(options) {
|
|
923
|
-
return
|
|
1014
|
+
return this.wrapper(HttpType.Get, "/image/health", {}, options);
|
|
924
1015
|
}
|
|
925
1016
|
/**
|
|
926
|
-
* Mark donation dialog as shown, so it isn't displayed anymore.
|
|
1017
|
+
* Mark the donation dialog as shown, so it isn't displayed anymore.
|
|
927
1018
|
*/
|
|
928
|
-
|
|
929
|
-
return
|
|
1019
|
+
async markDonationDialogShown(options) {
|
|
1020
|
+
return this.wrapper(HttpType.Post, "/account/donation_dialog_shown", {}, options);
|
|
930
1021
|
}
|
|
931
|
-
createMultiCommunity(form, options) {
|
|
932
|
-
return
|
|
1022
|
+
async createMultiCommunity(form, options) {
|
|
1023
|
+
return this.wrapper(HttpType.Post, "/multi_community", form, options);
|
|
933
1024
|
}
|
|
934
|
-
|
|
935
|
-
return
|
|
1025
|
+
async editMultiCommunity(form, options) {
|
|
1026
|
+
return this.wrapper(HttpType.Put, "/multi_community", form, options);
|
|
936
1027
|
}
|
|
937
|
-
getMultiCommunity(form, options) {
|
|
938
|
-
return
|
|
1028
|
+
async getMultiCommunity(form, options) {
|
|
1029
|
+
return this.wrapper(HttpType.Get, "/multi_community", form, options);
|
|
939
1030
|
}
|
|
940
|
-
createMultiCommunityEntry(form, options) {
|
|
941
|
-
return
|
|
1031
|
+
async createMultiCommunityEntry(form, options) {
|
|
1032
|
+
return this.wrapper(HttpType.Post, "/multi_community/entry", form, options);
|
|
942
1033
|
}
|
|
943
|
-
deleteMultiCommunityEntry(form, options) {
|
|
944
|
-
return
|
|
1034
|
+
async deleteMultiCommunityEntry(form, options) {
|
|
1035
|
+
return this.wrapper(HttpType.Delete, "/multi_community/entry", form, options);
|
|
945
1036
|
}
|
|
946
|
-
listMultiCommunities(form, options) {
|
|
947
|
-
return
|
|
1037
|
+
async listMultiCommunities(form, options) {
|
|
1038
|
+
return this.wrapper(HttpType.Get, "/multi_community/list", form, options);
|
|
948
1039
|
}
|
|
949
|
-
followMultiCommunity(form, options) {
|
|
950
|
-
return
|
|
1040
|
+
async followMultiCommunity(form, options) {
|
|
1041
|
+
return this.wrapper(HttpType.Post, "/multi_community/follow", form, options);
|
|
951
1042
|
}
|
|
952
1043
|
/**
|
|
953
|
-
*
|
|
1044
|
+
* @summary Change notification settings for a community
|
|
954
1045
|
*/
|
|
955
|
-
|
|
956
|
-
|
|
1046
|
+
async editCommunityNotifications(form, options) {
|
|
1047
|
+
return this.wrapper(HttpType.Put, "/community/notifications", form, options);
|
|
957
1048
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
_LemmyHttp_instances = new WeakSet();
|
|
964
|
-
_LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
|
|
965
|
-
return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
|
|
966
|
-
};
|
|
967
|
-
_LemmyHttp_upload = async function _LemmyHttp_upload(path, { image }, options) {
|
|
968
|
-
const formData = createFormData(image);
|
|
969
|
-
const response = await __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, path), {
|
|
970
|
-
...options,
|
|
971
|
-
method: HttpType.Post,
|
|
972
|
-
body: formData,
|
|
973
|
-
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
|
974
|
-
});
|
|
975
|
-
return response.json();
|
|
976
|
-
};
|
|
977
|
-
_LemmyHttp_uploadWithQuery = async function _LemmyHttp_uploadWithQuery(path, query, { image }, options) {
|
|
978
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, `${path}?${encodeGetParams(query)}`, { image }, options);
|
|
979
|
-
};
|
|
980
|
-
_LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
|
981
|
-
let response;
|
|
982
|
-
if (type_ === HttpType.Get) {
|
|
983
|
-
const getUrl = `${__classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint)}?${encodeGetParams(form)}`;
|
|
984
|
-
response = await __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, getUrl, {
|
|
985
|
-
...options,
|
|
986
|
-
method: HttpType.Get,
|
|
987
|
-
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
|
988
|
-
});
|
|
1049
|
+
/**
|
|
1050
|
+
* @summary Change notification settings for a post
|
|
1051
|
+
*/
|
|
1052
|
+
async editPostNotifications(form, options) {
|
|
1053
|
+
return this.wrapper(HttpType.Put, "/post/notifications", form, options);
|
|
989
1054
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
"Content-Type": "application/json",
|
|
996
|
-
...__classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
|
997
|
-
},
|
|
998
|
-
body: JSON.stringify(form),
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
let json = undefined;
|
|
1002
|
-
try {
|
|
1003
|
-
json = await response.json();
|
|
1004
|
-
}
|
|
1005
|
-
catch {
|
|
1006
|
-
throw new LemmyError(response.statusText);
|
|
1007
|
-
}
|
|
1008
|
-
if (!response.ok) {
|
|
1009
|
-
let err = new LemmyError(json.error ?? response.statusText, json.message);
|
|
1010
|
-
throw err;
|
|
1055
|
+
/**
|
|
1056
|
+
* @summary Create a new registration invitation
|
|
1057
|
+
*/
|
|
1058
|
+
async createRegistrationInvitation(form, options) {
|
|
1059
|
+
return this.wrapper(HttpType.Post, "/account/invite", form, options);
|
|
1011
1060
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1061
|
+
/**
|
|
1062
|
+
* @summary Revoke a previously created registration invitation
|
|
1063
|
+
*/
|
|
1064
|
+
async revokeRegistrationInvitation(form, options) {
|
|
1065
|
+
return this.wrapper(HttpType.Delete, "/account/invite", form, options);
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* @summary Revoke a previously created registration invitation
|
|
1069
|
+
*/
|
|
1070
|
+
async listRegistrationInvitations(form, options) {
|
|
1071
|
+
return this.wrapper(HttpType.Get, "/account/invite/list", form, options);
|
|
1014
1072
|
}
|
|
1015
1073
|
};
|
|
1074
|
+
exports.LemmyHttp = LemmyHttp;
|
|
1016
1075
|
__decorate([
|
|
1017
1076
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1018
1077
|
(0, runtime_1.Security)({}),
|
|
@@ -1057,17 +1116,17 @@ __decorate([
|
|
|
1057
1116
|
(0, runtime_1.Get)("/account/settings/export"),
|
|
1058
1117
|
(0, runtime_1.Tags)("Account"),
|
|
1059
1118
|
__param(0, (0, runtime_1.Inject)())
|
|
1060
|
-
], LemmyHttp.prototype, "
|
|
1119
|
+
], LemmyHttp.prototype, "exportUserSettings", null);
|
|
1061
1120
|
__decorate([
|
|
1062
1121
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1063
1122
|
(0, runtime_1.Post)("/account/settings/import"),
|
|
1064
1123
|
(0, runtime_1.Tags)("Account"),
|
|
1065
1124
|
__param(0, (0, runtime_1.Body)()),
|
|
1066
1125
|
__param(1, (0, runtime_1.Inject)())
|
|
1067
|
-
], LemmyHttp.prototype, "
|
|
1126
|
+
], LemmyHttp.prototype, "importUserSettings", null);
|
|
1068
1127
|
__decorate([
|
|
1069
1128
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1070
|
-
(0, runtime_1.Get)("/account/
|
|
1129
|
+
(0, runtime_1.Get)("/account/login/list"),
|
|
1071
1130
|
(0, runtime_1.Tags)("Account"),
|
|
1072
1131
|
__param(0, (0, runtime_1.Inject)())
|
|
1073
1132
|
], LemmyHttp.prototype, "listLogins", null);
|
|
@@ -1088,30 +1147,30 @@ __decorate([
|
|
|
1088
1147
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1089
1148
|
(0, runtime_1.Delete)("/account/media"),
|
|
1090
1149
|
(0, runtime_1.Tags)("Account", "Media"),
|
|
1091
|
-
__param(0, (0, runtime_1.
|
|
1150
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1092
1151
|
__param(1, (0, runtime_1.Inject)())
|
|
1093
1152
|
], LemmyHttp.prototype, "deleteMedia", null);
|
|
1094
1153
|
__decorate([
|
|
1095
1154
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1096
1155
|
(0, runtime_1.Delete)("/image"),
|
|
1097
1156
|
(0, runtime_1.Tags)("Admin", "Media"),
|
|
1098
|
-
__param(0, (0, runtime_1.
|
|
1157
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1099
1158
|
__param(1, (0, runtime_1.Inject)())
|
|
1100
|
-
], LemmyHttp.prototype, "
|
|
1159
|
+
], LemmyHttp.prototype, "adminDeleteMedia", null);
|
|
1101
1160
|
__decorate([
|
|
1102
1161
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1103
1162
|
(0, runtime_1.Get)("/image/list"),
|
|
1104
1163
|
(0, runtime_1.Tags)("Admin", "Media"),
|
|
1105
1164
|
__param(0, (0, runtime_1.Queries)()),
|
|
1106
1165
|
__param(1, (0, runtime_1.Inject)())
|
|
1107
|
-
], LemmyHttp.prototype, "
|
|
1166
|
+
], LemmyHttp.prototype, "adminListMedia", null);
|
|
1108
1167
|
__decorate([
|
|
1109
1168
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1110
|
-
(0, runtime_1.Post)("/account/auth/totp/
|
|
1169
|
+
(0, runtime_1.Post)("/account/auth/totp/edit"),
|
|
1111
1170
|
(0, runtime_1.Tags)("Account"),
|
|
1112
1171
|
__param(0, (0, runtime_1.Body)()),
|
|
1113
1172
|
__param(1, (0, runtime_1.Inject)())
|
|
1114
|
-
], LemmyHttp.prototype, "
|
|
1173
|
+
], LemmyHttp.prototype, "editTotp", null);
|
|
1115
1174
|
__decorate([
|
|
1116
1175
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1117
1176
|
(0, runtime_1.Security)({}),
|
|
@@ -1176,11 +1235,10 @@ __decorate([
|
|
|
1176
1235
|
], LemmyHttp.prototype, "followCommunity", null);
|
|
1177
1236
|
__decorate([
|
|
1178
1237
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1179
|
-
(0, runtime_1.Get)("/
|
|
1180
|
-
(0, runtime_1.Tags)("
|
|
1181
|
-
__param(0, (0, runtime_1.
|
|
1182
|
-
|
|
1183
|
-
], LemmyHttp.prototype, "getCommunityPendingFollowsCount", null);
|
|
1238
|
+
(0, runtime_1.Get)("/account/unread_counts"),
|
|
1239
|
+
(0, runtime_1.Tags)("Account"),
|
|
1240
|
+
__param(0, (0, runtime_1.Inject)())
|
|
1241
|
+
], LemmyHttp.prototype, "getUnreadCounts", null);
|
|
1184
1242
|
__decorate([
|
|
1185
1243
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1186
1244
|
(0, runtime_1.Get)("/community/pending_follows/list"),
|
|
@@ -1204,7 +1262,7 @@ __decorate([
|
|
|
1204
1262
|
], LemmyHttp.prototype, "blockCommunity", null);
|
|
1205
1263
|
__decorate([
|
|
1206
1264
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1207
|
-
(0, runtime_1.
|
|
1265
|
+
(0, runtime_1.Delete)("/community"),
|
|
1208
1266
|
(0, runtime_1.Tags)("Community"),
|
|
1209
1267
|
__param(0, (0, runtime_1.Body)()),
|
|
1210
1268
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1290,14 +1348,21 @@ __decorate([
|
|
|
1290
1348
|
], LemmyHttp.prototype, "editPost", null);
|
|
1291
1349
|
__decorate([
|
|
1292
1350
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1293
|
-
(0, runtime_1.Put)("/post/
|
|
1351
|
+
(0, runtime_1.Put)("/post/mod_edit"),
|
|
1294
1352
|
(0, runtime_1.Tags)("Post"),
|
|
1295
1353
|
__param(0, (0, runtime_1.Body)()),
|
|
1296
1354
|
__param(1, (0, runtime_1.Inject)())
|
|
1297
1355
|
], LemmyHttp.prototype, "modEditPost", null);
|
|
1298
1356
|
__decorate([
|
|
1299
1357
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1300
|
-
(0, runtime_1.Post)("/post/
|
|
1358
|
+
(0, runtime_1.Post)("/post/warn"),
|
|
1359
|
+
(0, runtime_1.Tags)("Post"),
|
|
1360
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1361
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1362
|
+
], LemmyHttp.prototype, "warnPost", null);
|
|
1363
|
+
__decorate([
|
|
1364
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1365
|
+
(0, runtime_1.Delete)("/post"),
|
|
1301
1366
|
(0, runtime_1.Tags)("Post"),
|
|
1302
1367
|
__param(0, (0, runtime_1.Body)()),
|
|
1303
1368
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1322,7 +1387,7 @@ __decorate([
|
|
|
1322
1387
|
(0, runtime_1.Tags)("Post"),
|
|
1323
1388
|
__param(0, (0, runtime_1.Body)()),
|
|
1324
1389
|
__param(1, (0, runtime_1.Inject)())
|
|
1325
|
-
], LemmyHttp.prototype, "
|
|
1390
|
+
], LemmyHttp.prototype, "markManyPostsAsRead", null);
|
|
1326
1391
|
__decorate([
|
|
1327
1392
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1328
1393
|
(0, runtime_1.Post)("/post/hide"),
|
|
@@ -1410,7 +1475,7 @@ __decorate([
|
|
|
1410
1475
|
], LemmyHttp.prototype, "editComment", null);
|
|
1411
1476
|
__decorate([
|
|
1412
1477
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1413
|
-
(0, runtime_1.
|
|
1478
|
+
(0, runtime_1.Delete)("/comment"),
|
|
1414
1479
|
(0, runtime_1.Tags)("Comment"),
|
|
1415
1480
|
__param(0, (0, runtime_1.Body)()),
|
|
1416
1481
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1422,6 +1487,13 @@ __decorate([
|
|
|
1422
1487
|
__param(0, (0, runtime_1.Body)()),
|
|
1423
1488
|
__param(1, (0, runtime_1.Inject)())
|
|
1424
1489
|
], LemmyHttp.prototype, "removeComment", null);
|
|
1490
|
+
__decorate([
|
|
1491
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1492
|
+
(0, runtime_1.Post)("/comment/lock"),
|
|
1493
|
+
(0, runtime_1.Tags)("Comment", "Moderator"),
|
|
1494
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1495
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1496
|
+
], LemmyHttp.prototype, "lockComment", null);
|
|
1425
1497
|
__decorate([
|
|
1426
1498
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1427
1499
|
(0, runtime_1.Post)("/comment/like"),
|
|
@@ -1474,6 +1546,13 @@ __decorate([
|
|
|
1474
1546
|
__param(0, (0, runtime_1.Queries)()),
|
|
1475
1547
|
__param(1, (0, runtime_1.Inject)())
|
|
1476
1548
|
], LemmyHttp.prototype, "getComment", null);
|
|
1549
|
+
__decorate([
|
|
1550
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1551
|
+
(0, runtime_1.Post)("/comment/warn"),
|
|
1552
|
+
(0, runtime_1.Tags)("Comment"),
|
|
1553
|
+
__param(0, (0, runtime_1.Body)()),
|
|
1554
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1555
|
+
], LemmyHttp.prototype, "warnComment", null);
|
|
1477
1556
|
__decorate([
|
|
1478
1557
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1479
1558
|
(0, runtime_1.Post)("/comment/report"),
|
|
@@ -1504,18 +1583,11 @@ __decorate([
|
|
|
1504
1583
|
], LemmyHttp.prototype, "editPrivateMessage", null);
|
|
1505
1584
|
__decorate([
|
|
1506
1585
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1507
|
-
(0, runtime_1.
|
|
1586
|
+
(0, runtime_1.Delete)("/private_message"),
|
|
1508
1587
|
(0, runtime_1.Tags)("PrivateMessage"),
|
|
1509
1588
|
__param(0, (0, runtime_1.Body)()),
|
|
1510
1589
|
__param(1, (0, runtime_1.Inject)())
|
|
1511
1590
|
], LemmyHttp.prototype, "deletePrivateMessage", null);
|
|
1512
|
-
__decorate([
|
|
1513
|
-
(0, runtime_1.Security)("bearerAuth"),
|
|
1514
|
-
(0, runtime_1.Post)("/private_message/mark_as_read"),
|
|
1515
|
-
(0, runtime_1.Tags)("PrivateMessage"),
|
|
1516
|
-
__param(0, (0, runtime_1.Body)()),
|
|
1517
|
-
__param(1, (0, runtime_1.Inject)())
|
|
1518
|
-
], LemmyHttp.prototype, "markPrivateMessageAsRead", null);
|
|
1519
1591
|
__decorate([
|
|
1520
1592
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1521
1593
|
(0, runtime_1.Post)("/private_message/report"),
|
|
@@ -1571,6 +1643,14 @@ __decorate([
|
|
|
1571
1643
|
__param(0, (0, runtime_1.Body)()),
|
|
1572
1644
|
__param(1, (0, runtime_1.Inject)())
|
|
1573
1645
|
], LemmyHttp.prototype, "notePerson", null);
|
|
1646
|
+
__decorate([
|
|
1647
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
1648
|
+
(0, runtime_1.Security)({}),
|
|
1649
|
+
(0, runtime_1.Get)("/person/list"),
|
|
1650
|
+
(0, runtime_1.Tags)("Person"),
|
|
1651
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1652
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1653
|
+
], LemmyHttp.prototype, "listPersons", null);
|
|
1574
1654
|
__decorate([
|
|
1575
1655
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1576
1656
|
(0, runtime_1.Post)("/admin/ban"),
|
|
@@ -1584,7 +1664,7 @@ __decorate([
|
|
|
1584
1664
|
(0, runtime_1.Tags)("Admin", "Miscellaneous"),
|
|
1585
1665
|
__param(0, (0, runtime_1.Queries)()),
|
|
1586
1666
|
__param(1, (0, runtime_1.Inject)())
|
|
1587
|
-
], LemmyHttp.prototype, "
|
|
1667
|
+
], LemmyHttp.prototype, "adminListUsers", null);
|
|
1588
1668
|
__decorate([
|
|
1589
1669
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1590
1670
|
(0, runtime_1.Post)("/account/block/person"),
|
|
@@ -1599,7 +1679,7 @@ __decorate([
|
|
|
1599
1679
|
], LemmyHttp.prototype, "getCaptcha", null);
|
|
1600
1680
|
__decorate([
|
|
1601
1681
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1602
|
-
(0, runtime_1.
|
|
1682
|
+
(0, runtime_1.Delete)("/account"),
|
|
1603
1683
|
(0, runtime_1.Tags)("Account"),
|
|
1604
1684
|
__param(0, (0, runtime_1.Body)()),
|
|
1605
1685
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1610,23 +1690,23 @@ __decorate([
|
|
|
1610
1690
|
(0, runtime_1.Tags)("Account"),
|
|
1611
1691
|
__param(0, (0, runtime_1.Body)()),
|
|
1612
1692
|
__param(1, (0, runtime_1.Inject)())
|
|
1613
|
-
], LemmyHttp.prototype, "
|
|
1693
|
+
], LemmyHttp.prototype, "resetPassword", null);
|
|
1614
1694
|
__decorate([
|
|
1615
1695
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1616
1696
|
(0, runtime_1.Post)("/account/auth/password_change"),
|
|
1617
1697
|
(0, runtime_1.Tags)("Account"),
|
|
1618
1698
|
__param(0, (0, runtime_1.Body)()),
|
|
1619
1699
|
__param(1, (0, runtime_1.Inject)())
|
|
1620
|
-
], LemmyHttp.prototype, "
|
|
1700
|
+
], LemmyHttp.prototype, "changePasswordAfterReset", null);
|
|
1621
1701
|
__decorate([
|
|
1622
1702
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1623
|
-
(0, runtime_1.Post)("/account/mark_as_read/all"),
|
|
1703
|
+
(0, runtime_1.Post)("/account/notification/mark_as_read/all"),
|
|
1624
1704
|
(0, runtime_1.Tags)("Account"),
|
|
1625
1705
|
__param(0, (0, runtime_1.Inject)())
|
|
1626
1706
|
], LemmyHttp.prototype, "markAllNotificationsAsRead", null);
|
|
1627
1707
|
__decorate([
|
|
1628
1708
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1629
|
-
(0, runtime_1.Post)("/account/mark_as_read"),
|
|
1709
|
+
(0, runtime_1.Post)("/account/notification/mark_as_read"),
|
|
1630
1710
|
(0, runtime_1.Tags)("Account"),
|
|
1631
1711
|
__param(0, (0, runtime_1.Body)()),
|
|
1632
1712
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1647,20 +1727,7 @@ __decorate([
|
|
|
1647
1727
|
], LemmyHttp.prototype, "changePassword", null);
|
|
1648
1728
|
__decorate([
|
|
1649
1729
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1650
|
-
(0, runtime_1.Get)("/account/
|
|
1651
|
-
(0, runtime_1.Tags)("Account"),
|
|
1652
|
-
__param(0, (0, runtime_1.Queries)()),
|
|
1653
|
-
__param(1, (0, runtime_1.Inject)())
|
|
1654
|
-
], LemmyHttp.prototype, "getReportCount", null);
|
|
1655
|
-
__decorate([
|
|
1656
|
-
(0, runtime_1.Security)("bearerAuth"),
|
|
1657
|
-
(0, runtime_1.Get)("/account/unread_count"),
|
|
1658
|
-
(0, runtime_1.Tags)("Account"),
|
|
1659
|
-
__param(0, (0, runtime_1.Inject)())
|
|
1660
|
-
], LemmyHttp.prototype, "getUnreadCount", null);
|
|
1661
|
-
__decorate([
|
|
1662
|
-
(0, runtime_1.Security)("bearerAuth"),
|
|
1663
|
-
(0, runtime_1.Get)("/account/notifications"),
|
|
1730
|
+
(0, runtime_1.Get)("/account/notification/list"),
|
|
1664
1731
|
(0, runtime_1.Tags)("Account"),
|
|
1665
1732
|
__param(0, (0, runtime_1.Queries)()),
|
|
1666
1733
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1712,12 +1779,6 @@ __decorate([
|
|
|
1712
1779
|
__param(0, (0, runtime_1.Body)()),
|
|
1713
1780
|
__param(1, (0, runtime_1.Inject)())
|
|
1714
1781
|
], LemmyHttp.prototype, "addAdmin", null);
|
|
1715
|
-
__decorate([
|
|
1716
|
-
(0, runtime_1.Security)("bearerAuth"),
|
|
1717
|
-
(0, runtime_1.Get)("/admin/registration_application/count"),
|
|
1718
|
-
(0, runtime_1.Tags)("Admin"),
|
|
1719
|
-
__param(0, (0, runtime_1.Inject)())
|
|
1720
|
-
], LemmyHttp.prototype, "getUnreadRegistrationApplicationCount", null);
|
|
1721
1782
|
__decorate([
|
|
1722
1783
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1723
1784
|
(0, runtime_1.Get)("/admin/registration_application/list"),
|
|
@@ -1812,7 +1873,7 @@ __decorate([
|
|
|
1812
1873
|
], LemmyHttp.prototype, "editTagline", null);
|
|
1813
1874
|
__decorate([
|
|
1814
1875
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1815
|
-
(0, runtime_1.
|
|
1876
|
+
(0, runtime_1.Delete)("/admin/tagline"),
|
|
1816
1877
|
(0, runtime_1.Tags)("Admin", "Tagline"),
|
|
1817
1878
|
__param(0, (0, runtime_1.Body)()),
|
|
1818
1879
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1838,7 +1899,7 @@ __decorate([
|
|
|
1838
1899
|
(0, runtime_1.Tags)("Community"),
|
|
1839
1900
|
__param(0, (0, runtime_1.Body)()),
|
|
1840
1901
|
__param(1, (0, runtime_1.Inject)())
|
|
1841
|
-
], LemmyHttp.prototype, "
|
|
1902
|
+
], LemmyHttp.prototype, "editCommunityTag", null);
|
|
1842
1903
|
__decorate([
|
|
1843
1904
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1844
1905
|
(0, runtime_1.Delete)("/community/tag"),
|
|
@@ -1862,7 +1923,7 @@ __decorate([
|
|
|
1862
1923
|
], LemmyHttp.prototype, "editOAuthProvider", null);
|
|
1863
1924
|
__decorate([
|
|
1864
1925
|
(0, runtime_1.Security)("bearerAuth"),
|
|
1865
|
-
(0, runtime_1.
|
|
1926
|
+
(0, runtime_1.Delete)("/oauth_provider"),
|
|
1866
1927
|
(0, runtime_1.Tags)("Miscellaneous", "OAuth"),
|
|
1867
1928
|
__param(0, (0, runtime_1.Body)()),
|
|
1868
1929
|
__param(1, (0, runtime_1.Inject)())
|
|
@@ -1877,7 +1938,8 @@ __decorate([
|
|
|
1877
1938
|
__decorate([
|
|
1878
1939
|
(0, runtime_1.Get)("/federated_instances"),
|
|
1879
1940
|
(0, runtime_1.Tags)("Miscellaneous"),
|
|
1880
|
-
__param(0, (0, runtime_1.
|
|
1941
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
1942
|
+
__param(1, (0, runtime_1.Inject)())
|
|
1881
1943
|
], LemmyHttp.prototype, "getFederatedInstances", null);
|
|
1882
1944
|
__decorate([
|
|
1883
1945
|
(0, runtime_1.Security)("bearerAuth"),
|
|
@@ -2010,10 +2072,10 @@ __decorate([
|
|
|
2010
2072
|
], LemmyHttp.prototype, "imageHealth", null);
|
|
2011
2073
|
__decorate([
|
|
2012
2074
|
(0, runtime_1.Security)("bearerAuth"),
|
|
2013
|
-
(0, runtime_1.Post)("/
|
|
2014
|
-
(0, runtime_1.Tags)("
|
|
2075
|
+
(0, runtime_1.Post)("/account/donation_dialog_shown"),
|
|
2076
|
+
(0, runtime_1.Tags)("Account"),
|
|
2015
2077
|
__param(0, (0, runtime_1.Inject)())
|
|
2016
|
-
], LemmyHttp.prototype, "
|
|
2078
|
+
], LemmyHttp.prototype, "markDonationDialogShown", null);
|
|
2017
2079
|
__decorate([
|
|
2018
2080
|
(0, runtime_1.Security)("bearerAuth"),
|
|
2019
2081
|
(0, runtime_1.Post)("/multi_community"),
|
|
@@ -2027,7 +2089,7 @@ __decorate([
|
|
|
2027
2089
|
(0, runtime_1.Tags)("Multicommunity"),
|
|
2028
2090
|
__param(0, (0, runtime_1.Body)()),
|
|
2029
2091
|
__param(1, (0, runtime_1.Inject)())
|
|
2030
|
-
], LemmyHttp.prototype, "
|
|
2092
|
+
], LemmyHttp.prototype, "editMultiCommunity", null);
|
|
2031
2093
|
__decorate([
|
|
2032
2094
|
(0, runtime_1.Get)("/multi_community"),
|
|
2033
2095
|
(0, runtime_1.Tags)("Multicommunity"),
|
|
@@ -2060,9 +2122,61 @@ __decorate([
|
|
|
2060
2122
|
__param(0, (0, runtime_1.Body)()),
|
|
2061
2123
|
__param(1, (0, runtime_1.Inject)())
|
|
2062
2124
|
], LemmyHttp.prototype, "followMultiCommunity", null);
|
|
2125
|
+
__decorate([
|
|
2126
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2127
|
+
(0, runtime_1.Put)("/community/notifications"),
|
|
2128
|
+
(0, runtime_1.Tags)("Community"),
|
|
2129
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2130
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2131
|
+
], LemmyHttp.prototype, "editCommunityNotifications", null);
|
|
2132
|
+
__decorate([
|
|
2133
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2134
|
+
(0, runtime_1.Put)("/post/notifications"),
|
|
2135
|
+
(0, runtime_1.Tags)("Post"),
|
|
2136
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2137
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2138
|
+
], LemmyHttp.prototype, "editPostNotifications", null);
|
|
2139
|
+
__decorate([
|
|
2140
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2141
|
+
(0, runtime_1.Post)("/account/invite"),
|
|
2142
|
+
(0, runtime_1.Tags)("Account"),
|
|
2143
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2144
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2145
|
+
], LemmyHttp.prototype, "createRegistrationInvitation", null);
|
|
2146
|
+
__decorate([
|
|
2147
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2148
|
+
(0, runtime_1.Delete)("/account/invite"),
|
|
2149
|
+
(0, runtime_1.Tags)("Account"),
|
|
2150
|
+
__param(0, (0, runtime_1.Body)()),
|
|
2151
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2152
|
+
], LemmyHttp.prototype, "revokeRegistrationInvitation", null);
|
|
2153
|
+
__decorate([
|
|
2154
|
+
(0, runtime_1.Security)("bearerAuth"),
|
|
2155
|
+
(0, runtime_1.Get)("/account/invite/list"),
|
|
2156
|
+
(0, runtime_1.Tags)("Account"),
|
|
2157
|
+
__param(0, (0, runtime_1.Queries)()),
|
|
2158
|
+
__param(1, (0, runtime_1.Inject)())
|
|
2159
|
+
], LemmyHttp.prototype, "listRegistrationInvitations", null);
|
|
2063
2160
|
exports.LemmyHttp = LemmyHttp = __decorate([
|
|
2064
2161
|
(0, runtime_1.Route)("api/v4")
|
|
2065
2162
|
], LemmyHttp);
|
|
2163
|
+
let NodeInfoHttp = class NodeInfoHttp extends LemmyController {
|
|
2164
|
+
/**
|
|
2165
|
+
* @summary Metadata for the instance
|
|
2166
|
+
*/
|
|
2167
|
+
async nodeinfo(options) {
|
|
2168
|
+
return this.wrapper(HttpType.Get, "/nodeinfo/2.1", {}, options, true);
|
|
2169
|
+
}
|
|
2170
|
+
};
|
|
2171
|
+
exports.NodeInfoHttp = NodeInfoHttp;
|
|
2172
|
+
__decorate([
|
|
2173
|
+
(0, runtime_1.Get)("/nodeinfo/2.1"),
|
|
2174
|
+
(0, runtime_1.Tags)("Site"),
|
|
2175
|
+
__param(0, (0, runtime_1.Inject)())
|
|
2176
|
+
], NodeInfoHttp.prototype, "nodeinfo", null);
|
|
2177
|
+
exports.NodeInfoHttp = NodeInfoHttp = __decorate([
|
|
2178
|
+
(0, runtime_1.Route)("")
|
|
2179
|
+
], NodeInfoHttp);
|
|
2066
2180
|
function encodeGetParams(p) {
|
|
2067
2181
|
return Object.entries(p)
|
|
2068
2182
|
.filter(kv => kv[1] !== undefined && kv[1] !== null)
|
|
@@ -2070,7 +2184,7 @@ function encodeGetParams(p) {
|
|
|
2070
2184
|
.join("&");
|
|
2071
2185
|
}
|
|
2072
2186
|
function createFormData(image) {
|
|
2073
|
-
|
|
2187
|
+
const formData = new FormData();
|
|
2074
2188
|
if (image instanceof File) {
|
|
2075
2189
|
formData.append("images[]", image);
|
|
2076
2190
|
}
|
|
@@ -2084,14 +2198,15 @@ function createFormData(image) {
|
|
|
2084
2198
|
* A Lemmy error type.
|
|
2085
2199
|
*
|
|
2086
2200
|
* The name is the i18n translatable error code.
|
|
2087
|
-
* The
|
|
2201
|
+
* The message is either an empty string, or extra non-translatable info.
|
|
2088
2202
|
*/
|
|
2089
2203
|
class LemmyError extends Error {
|
|
2090
|
-
constructor(name,
|
|
2091
|
-
super(
|
|
2204
|
+
constructor(name, status, message = "", cause) {
|
|
2205
|
+
super();
|
|
2092
2206
|
this.name = name;
|
|
2093
|
-
|
|
2094
|
-
|
|
2207
|
+
this.message = message;
|
|
2208
|
+
this.status = status;
|
|
2209
|
+
this.cause = cause;
|
|
2095
2210
|
}
|
|
2096
2211
|
}
|
|
2097
2212
|
exports.LemmyError = LemmyError;
|