Adding endpoint comments. Fixes #50 (#56)

This commit is contained in:
Dessalines 2022-05-22 15:45:53 -04:00 committed by GitHub
parent 57de18c17e
commit 07919905c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,6 +154,7 @@ export class LemmyHttp {
/** /**
* Gets the site, and your user data. * Gets the site, and your user data.
* `HTTP.GET /site`
*/ */
async getSite(form: GetSite): Promise<GetSiteResponse> { async getSite(form: GetSite): Promise<GetSiteResponse> {
return this.wrapper(HttpType.Get, "/site", form); return this.wrapper(HttpType.Get, "/site", form);
@ -161,6 +162,7 @@ export class LemmyHttp {
/** /**
* Create your site. * Create your site.
* `HTTP.POST /site`
*/ */
async createSite(form: CreateSite): Promise<SiteResponse> { async createSite(form: CreateSite): Promise<SiteResponse> {
return this.wrapper(HttpType.Post, "/site", form); return this.wrapper(HttpType.Post, "/site", form);
@ -168,6 +170,7 @@ export class LemmyHttp {
/** /**
* Edit your site. * Edit your site.
* `HTTP.PUT /site`
*/ */
async editSite(form: EditSite): Promise<SiteResponse> { async editSite(form: EditSite): Promise<SiteResponse> {
return this.wrapper(HttpType.Put, "/site", form); return this.wrapper(HttpType.Put, "/site", form);
@ -175,6 +178,7 @@ export class LemmyHttp {
/** /**
* Leave the Site admins. * Leave the Site admins.
* `HTTP.POST /user/leave_admin`
*/ */
async leaveAdmin(form: LeaveAdmin): Promise<GetSiteResponse> { async leaveAdmin(form: LeaveAdmin): Promise<GetSiteResponse> {
return this.wrapper(HttpType.Post, "/user/leave_admin", form); return this.wrapper(HttpType.Post, "/user/leave_admin", form);
@ -182,6 +186,7 @@ export class LemmyHttp {
/** /**
* Get your site configuration. * Get your site configuration.
* `HTTP.GET /site/config`
*/ */
async getSiteConfig(form: GetSiteConfig): Promise<GetSiteConfigResponse> { async getSiteConfig(form: GetSiteConfig): Promise<GetSiteConfigResponse> {
return this.wrapper(HttpType.Get, "/site/config", form); return this.wrapper(HttpType.Get, "/site/config", form);
@ -189,6 +194,7 @@ export class LemmyHttp {
/** /**
* Save your site config. * Save your site config.
* `HTTP.PUT /site/config`
*/ */
async saveSiteConfig(form: SaveSiteConfig): Promise<GetSiteConfigResponse> { async saveSiteConfig(form: SaveSiteConfig): Promise<GetSiteConfigResponse> {
return this.wrapper(HttpType.Put, "/site/config", form); return this.wrapper(HttpType.Put, "/site/config", form);
@ -196,6 +202,7 @@ export class LemmyHttp {
/** /**
* Get the modlog. * Get the modlog.
* `HTTP.GET /modlog`
*/ */
async getModlog(form: GetModlog): Promise<GetModlogResponse> { async getModlog(form: GetModlog): Promise<GetModlogResponse> {
return this.wrapper(HttpType.Get, "/modlog", form); return this.wrapper(HttpType.Get, "/modlog", form);
@ -203,6 +210,7 @@ export class LemmyHttp {
/** /**
* Search lemmy. * Search lemmy.
* `HTTP.GET /search`
*/ */
async search(form: Search): Promise<SearchResponse> { async search(form: Search): Promise<SearchResponse> {
return this.wrapper(HttpType.Get, "/search", form); return this.wrapper(HttpType.Get, "/search", form);
@ -210,6 +218,7 @@ export class LemmyHttp {
/** /**
* Fetch a non-local / federated object. * Fetch a non-local / federated object.
* `HTTP.GET /resolve_object`
*/ */
async resolveObject(form: ResolveObject): Promise<ResolveObjectResponse> { async resolveObject(form: ResolveObject): Promise<ResolveObjectResponse> {
return this.wrapper(HttpType.Get, "/resolve_object", form); return this.wrapper(HttpType.Get, "/resolve_object", form);
@ -217,6 +226,7 @@ export class LemmyHttp {
/** /**
* Create a new community. * Create a new community.
* `HTTP.POST /community`
*/ */
async createCommunity(form: CreateCommunity): Promise<CommunityResponse> { async createCommunity(form: CreateCommunity): Promise<CommunityResponse> {
return this.wrapper(HttpType.Post, "/community", form); return this.wrapper(HttpType.Post, "/community", form);
@ -224,6 +234,7 @@ export class LemmyHttp {
/** /**
* Get / fetch a community. * Get / fetch a community.
* `HTTP.GET /community`
*/ */
async getCommunity(form: GetCommunity): Promise<GetCommunityResponse> { async getCommunity(form: GetCommunity): Promise<GetCommunityResponse> {
return this.wrapper(HttpType.Get, "/community", form); return this.wrapper(HttpType.Get, "/community", form);
@ -231,6 +242,7 @@ export class LemmyHttp {
/** /**
* Edit a community. * Edit a community.
* `HTTP.PUT /community`
*/ */
async editCommunity(form: EditCommunity): Promise<CommunityResponse> { async editCommunity(form: EditCommunity): Promise<CommunityResponse> {
return this.wrapper(HttpType.Put, "/community", form); return this.wrapper(HttpType.Put, "/community", form);
@ -238,6 +250,7 @@ export class LemmyHttp {
/** /**
* List communities, with various filters. * List communities, with various filters.
* `HTTP.GET /community/list`
*/ */
async listCommunities( async listCommunities(
form: ListCommunities form: ListCommunities
@ -247,6 +260,7 @@ export class LemmyHttp {
/** /**
* Follow / subscribe to a community. * Follow / subscribe to a community.
* `HTTP.POST /community/follow`
*/ */
async followCommunity( async followCommunity(
form: FollowCommunity form: FollowCommunity
@ -256,6 +270,7 @@ export class LemmyHttp {
/** /**
* Block a community. * Block a community.
* `HTTP.POST /community/block`
*/ */
async blockCommunity(form: BlockCommunity): Promise<BlockCommunityResponse> { async blockCommunity(form: BlockCommunity): Promise<BlockCommunityResponse> {
return this.wrapper(HttpType.Post, "/community/block", form); return this.wrapper(HttpType.Post, "/community/block", form);
@ -263,6 +278,7 @@ export class LemmyHttp {
/** /**
* Delete a community. * Delete a community.
* `HTTP.POST /community/delete`
*/ */
async deleteCommunity(form: DeleteCommunity): Promise<CommunityResponse> { async deleteCommunity(form: DeleteCommunity): Promise<CommunityResponse> {
return this.wrapper(HttpType.Post, "/community/delete", form); return this.wrapper(HttpType.Post, "/community/delete", form);
@ -270,6 +286,7 @@ export class LemmyHttp {
/** /**
* A moderator remove for a community. * A moderator remove for a community.
* `HTTP.POST /community/remove`
*/ */
async removeCommunity(form: RemoveCommunity): Promise<CommunityResponse> { async removeCommunity(form: RemoveCommunity): Promise<CommunityResponse> {
return this.wrapper(HttpType.Post, "/community/remove", form); return this.wrapper(HttpType.Post, "/community/remove", form);
@ -277,6 +294,7 @@ export class LemmyHttp {
/** /**
* Transfer your community to an existing moderator. * Transfer your community to an existing moderator.
* `HTTP.POST /community/transfer`
*/ */
async transferCommunity( async transferCommunity(
form: TransferCommunity form: TransferCommunity
@ -286,6 +304,7 @@ export class LemmyHttp {
/** /**
* Ban a user from a community. * Ban a user from a community.
* `HTTP.POST /community/ban_user`
*/ */
async banFromCommunity( async banFromCommunity(
form: BanFromCommunity form: BanFromCommunity
@ -295,6 +314,7 @@ export class LemmyHttp {
/** /**
* Add a moderator to your community. * Add a moderator to your community.
* `HTTP.POST /community/mod`
*/ */
async addModToCommunity( async addModToCommunity(
form: AddModToCommunity form: AddModToCommunity
@ -304,6 +324,7 @@ export class LemmyHttp {
/** /**
* Create a post. * Create a post.
* `HTTP.POST /post`
*/ */
async createPost(form: CreatePost): Promise<PostResponse> { async createPost(form: CreatePost): Promise<PostResponse> {
return this.wrapper(HttpType.Post, "/post", form); return this.wrapper(HttpType.Post, "/post", form);
@ -311,6 +332,7 @@ export class LemmyHttp {
/** /**
* Get / fetch a post. * Get / fetch a post.
* `HTTP.GET /post`
*/ */
async getPost(form: GetPost): Promise<GetPostResponse> { async getPost(form: GetPost): Promise<GetPostResponse> {
return this.wrapper(HttpType.Get, "/post", form); return this.wrapper(HttpType.Get, "/post", form);
@ -318,6 +340,7 @@ export class LemmyHttp {
/** /**
* Edit a post. * Edit a post.
* `HTTP.PUT /post`
*/ */
async editPost(form: EditPost): Promise<PostResponse> { async editPost(form: EditPost): Promise<PostResponse> {
return this.wrapper(HttpType.Put, "/post", form); return this.wrapper(HttpType.Put, "/post", form);
@ -325,6 +348,7 @@ export class LemmyHttp {
/** /**
* Delete a post. * Delete a post.
* `HTTP.POST /post/delete`
*/ */
async deletePost(form: DeletePost): Promise<PostResponse> { async deletePost(form: DeletePost): Promise<PostResponse> {
return this.wrapper(HttpType.Post, "/post/delete", form); return this.wrapper(HttpType.Post, "/post/delete", form);
@ -332,6 +356,7 @@ export class LemmyHttp {
/** /**
* A moderator remove for a post. * A moderator remove for a post.
* `HTTP.POST /post/remove`
*/ */
async removePost(form: RemovePost): Promise<PostResponse> { async removePost(form: RemovePost): Promise<PostResponse> {
return this.wrapper(HttpType.Post, "/post/remove", form); return this.wrapper(HttpType.Post, "/post/remove", form);
@ -339,6 +364,7 @@ export class LemmyHttp {
/** /**
* A moderator can lock a post ( IE disable new comments ). * A moderator can lock a post ( IE disable new comments ).
* `HTTP.POST /post/lock`
*/ */
async lockPost(form: LockPost): Promise<PostResponse> { async lockPost(form: LockPost): Promise<PostResponse> {
return this.wrapper(HttpType.Post, "/post/lock", form); return this.wrapper(HttpType.Post, "/post/lock", form);
@ -346,6 +372,7 @@ export class LemmyHttp {
/** /**
* A moderator can sticky a post ( IE stick it to the top of a community ). * A moderator can sticky a post ( IE stick it to the top of a community ).
* `HTTP.POST /post/sticky`
*/ */
async stickyPost(form: StickyPost): Promise<PostResponse> { async stickyPost(form: StickyPost): Promise<PostResponse> {
return this.wrapper(HttpType.Post, "/post/sticky", form); return this.wrapper(HttpType.Post, "/post/sticky", form);
@ -353,6 +380,7 @@ export class LemmyHttp {
/** /**
* Get / fetch posts, with various filters. * Get / fetch posts, with various filters.
* `HTTP.GET /post/list`
*/ */
async getPosts(form: GetPosts): Promise<GetPostsResponse> { async getPosts(form: GetPosts): Promise<GetPostsResponse> {
return this.wrapper(HttpType.Get, "/post/list", form); return this.wrapper(HttpType.Get, "/post/list", form);
@ -360,6 +388,7 @@ export class LemmyHttp {
/** /**
* Like / vote on a post. * Like / vote on a post.
* `HTTP.POST /post/like`
*/ */
async likePost(form: CreatePostLike): Promise<PostResponse> { async likePost(form: CreatePostLike): Promise<PostResponse> {
return this.wrapper(HttpType.Post, "/post/like", form); return this.wrapper(HttpType.Post, "/post/like", form);
@ -367,6 +396,7 @@ export class LemmyHttp {
/** /**
* Save a post. * Save a post.
* `HTTP.PUT /post/save`
*/ */
async savePost(form: SavePost): Promise<PostResponse> { async savePost(form: SavePost): Promise<PostResponse> {
return this.wrapper(HttpType.Put, "/post/save", form); return this.wrapper(HttpType.Put, "/post/save", form);
@ -374,6 +404,7 @@ export class LemmyHttp {
/** /**
* Report a post. * Report a post.
* `HTTP.POST /post/report`
*/ */
async createPostReport(form: CreatePostReport): Promise<PostReportResponse> { async createPostReport(form: CreatePostReport): Promise<PostReportResponse> {
return this.wrapper(HttpType.Post, "/post/report", form); return this.wrapper(HttpType.Post, "/post/report", form);
@ -381,6 +412,7 @@ export class LemmyHttp {
/** /**
* Resolve a post report. Only a mod can do this. * Resolve a post report. Only a mod can do this.
* `HTTP.PUT /post/report/resolve`
*/ */
async resolvePostReport( async resolvePostReport(
form: ResolvePostReport form: ResolvePostReport
@ -390,6 +422,7 @@ export class LemmyHttp {
/** /**
* List post reports. * List post reports.
* `HTTP.GET /post/report/list`
*/ */
async listPostReports( async listPostReports(
form: ListPostReports form: ListPostReports
@ -399,6 +432,7 @@ export class LemmyHttp {
/** /**
* Fetch metadata for any given site. * Fetch metadata for any given site.
* `HTTP.GET /post/site_metadata`
*/ */
async getSiteMetadata( async getSiteMetadata(
form: GetSiteMetadata form: GetSiteMetadata
@ -408,6 +442,7 @@ export class LemmyHttp {
/** /**
* Create a comment. * Create a comment.
* `HTTP.POST /comment`
*/ */
async createComment(form: CreateComment): Promise<CommentResponse> { async createComment(form: CreateComment): Promise<CommentResponse> {
return this.wrapper(HttpType.Post, "/comment", form); return this.wrapper(HttpType.Post, "/comment", form);
@ -415,6 +450,7 @@ export class LemmyHttp {
/** /**
* Edit a comment. * Edit a comment.
* `HTTP.PUT /comment`
*/ */
async editComment(form: EditComment): Promise<CommentResponse> { async editComment(form: EditComment): Promise<CommentResponse> {
return this.wrapper(HttpType.Put, "/comment", form); return this.wrapper(HttpType.Put, "/comment", form);
@ -422,6 +458,7 @@ export class LemmyHttp {
/** /**
* Delete a comment. * Delete a comment.
* `HTTP.POST /comment/delete`
*/ */
async deleteComment(form: DeleteComment): Promise<CommentResponse> { async deleteComment(form: DeleteComment): Promise<CommentResponse> {
return this.wrapper(HttpType.Post, "/comment/delete", form); return this.wrapper(HttpType.Post, "/comment/delete", form);
@ -429,6 +466,7 @@ export class LemmyHttp {
/** /**
* A moderator remove for a comment. * A moderator remove for a comment.
* `HTTP.POST /comment/remove`
*/ */
async removeComment(form: RemoveComment): Promise<CommentResponse> { async removeComment(form: RemoveComment): Promise<CommentResponse> {
return this.wrapper(HttpType.Post, "/comment/remove", form); return this.wrapper(HttpType.Post, "/comment/remove", form);
@ -436,6 +474,7 @@ export class LemmyHttp {
/** /**
* Mark a comment as read. * Mark a comment as read.
* `HTTP.POST /comment/mark_as_read`
*/ */
async markCommentAsRead(form: MarkCommentAsRead): Promise<CommentResponse> { async markCommentAsRead(form: MarkCommentAsRead): Promise<CommentResponse> {
return this.wrapper(HttpType.Post, "/comment/mark_as_read", form); return this.wrapper(HttpType.Post, "/comment/mark_as_read", form);
@ -443,6 +482,7 @@ export class LemmyHttp {
/** /**
* Like / vote on a comment. * Like / vote on a comment.
* `HTTP.POST /comment/like`
*/ */
async likeComment(form: CreateCommentLike): Promise<CommentResponse> { async likeComment(form: CreateCommentLike): Promise<CommentResponse> {
return this.wrapper(HttpType.Post, "/comment/like", form); return this.wrapper(HttpType.Post, "/comment/like", form);
@ -450,6 +490,7 @@ export class LemmyHttp {
/** /**
* Save a comment. * Save a comment.
* `HTTP.PUT /comment/save`
*/ */
async saveComment(form: SaveComment): Promise<CommentResponse> { async saveComment(form: SaveComment): Promise<CommentResponse> {
return this.wrapper(HttpType.Put, "/comment/save", form); return this.wrapper(HttpType.Put, "/comment/save", form);
@ -457,6 +498,7 @@ export class LemmyHttp {
/** /**
* Get / fetch comments. * Get / fetch comments.
* `HTTP.GET /comment/list`
*/ */
async getComments(form: GetComments): Promise<GetCommentsResponse> { async getComments(form: GetComments): Promise<GetCommentsResponse> {
return this.wrapper(HttpType.Get, "/comment/list", form); return this.wrapper(HttpType.Get, "/comment/list", form);
@ -464,6 +506,7 @@ export class LemmyHttp {
/** /**
* Report a comment. * Report a comment.
* `HTTP.POST /comment/report`
*/ */
async createCommentReport( async createCommentReport(
form: CreateCommentReport form: CreateCommentReport
@ -473,6 +516,7 @@ export class LemmyHttp {
/** /**
* Resolve a comment report. Only a mod can do this. * Resolve a comment report. Only a mod can do this.
* `HTTP.PUT /comment/report/resolve`
*/ */
async resolveCommentReport( async resolveCommentReport(
form: ResolveCommentReport form: ResolveCommentReport
@ -482,6 +526,7 @@ export class LemmyHttp {
/** /**
* List comment reports. * List comment reports.
* `HTTP.GET /comment/report/list`
*/ */
async listCommentReports( async listCommentReports(
form: ListCommentReports form: ListCommentReports
@ -491,6 +536,7 @@ export class LemmyHttp {
/** /**
* Get / fetch private messages. * Get / fetch private messages.
* `HTTP.GET /private_message/list`
*/ */
async getPrivateMessages( async getPrivateMessages(
form: GetPrivateMessages form: GetPrivateMessages
@ -500,6 +546,7 @@ export class LemmyHttp {
/** /**
* Create a private message. * Create a private message.
* `HTTP.POST /private_message`
*/ */
async createPrivateMessage( async createPrivateMessage(
form: CreatePrivateMessage form: CreatePrivateMessage
@ -509,6 +556,7 @@ export class LemmyHttp {
/** /**
* Edit a private message. * Edit a private message.
* `HTTP.PUT /private_message`
*/ */
async editPrivateMessage( async editPrivateMessage(
form: EditPrivateMessage form: EditPrivateMessage
@ -518,6 +566,7 @@ export class LemmyHttp {
/** /**
* Delete a private message. * Delete a private message.
* `HTTP.POST /private_message/delete`
*/ */
async deletePrivateMessage( async deletePrivateMessage(
form: DeletePrivateMessage form: DeletePrivateMessage
@ -527,6 +576,7 @@ export class LemmyHttp {
/** /**
* Mark a private message as read. * Mark a private message as read.
* `HTTP.POST /private_message/mark_as_read`
*/ */
async markPrivateMessageAsRead( async markPrivateMessageAsRead(
form: MarkPrivateMessageAsRead form: MarkPrivateMessageAsRead
@ -536,6 +586,7 @@ export class LemmyHttp {
/** /**
* Register a new user. * Register a new user.
* `HTTP.POST /user/register`
*/ */
async register(form: Register): Promise<LoginResponse> { async register(form: Register): Promise<LoginResponse> {
return this.wrapper(HttpType.Post, "/user/register", form); return this.wrapper(HttpType.Post, "/user/register", form);
@ -543,6 +594,7 @@ export class LemmyHttp {
/** /**
* Log into lemmy. * Log into lemmy.
* `HTTP.POST /user/login`
*/ */
async login(form: Login): Promise<LoginResponse> { async login(form: Login): Promise<LoginResponse> {
return this.wrapper(HttpType.Post, "/user/login", form); return this.wrapper(HttpType.Post, "/user/login", form);
@ -550,6 +602,7 @@ export class LemmyHttp {
/** /**
* Get the details for a person. * Get the details for a person.
* `HTTP.GET /user`
*/ */
async getPersonDetails( async getPersonDetails(
form: GetPersonDetails form: GetPersonDetails
@ -559,6 +612,7 @@ export class LemmyHttp {
/** /**
* Get mentions for your user. * Get mentions for your user.
* `HTTP.GET /user/mention`
*/ */
async getPersonMentions( async getPersonMentions(
form: GetPersonMentions form: GetPersonMentions
@ -568,6 +622,7 @@ export class LemmyHttp {
/** /**
* Mark a person mention as read. * Mark a person mention as read.
* `HTTP.POST /user/mention/mark_as_read`
*/ */
async markPersonMentionAsRead( async markPersonMentionAsRead(
form: MarkPersonMentionAsRead form: MarkPersonMentionAsRead
@ -577,6 +632,7 @@ export class LemmyHttp {
/** /**
* Get comment replies. * Get comment replies.
* `HTTP.GET /user/replies`
*/ */
async getReplies(form: GetReplies): Promise<GetRepliesResponse> { async getReplies(form: GetReplies): Promise<GetRepliesResponse> {
return this.wrapper(HttpType.Get, "/user/replies", form); return this.wrapper(HttpType.Get, "/user/replies", form);
@ -584,6 +640,7 @@ export class LemmyHttp {
/** /**
* Ban a person from your site. * Ban a person from your site.
* `HTTP.POST /user/ban`
*/ */
async banPerson(form: BanPerson): Promise<BanPersonResponse> { async banPerson(form: BanPerson): Promise<BanPersonResponse> {
return this.wrapper(HttpType.Post, "/user/ban", form); return this.wrapper(HttpType.Post, "/user/ban", form);
@ -591,6 +648,7 @@ export class LemmyHttp {
/** /**
* Get a list of banned users * Get a list of banned users
* `HTTP.GET /user/banned`
*/ */
async getBannedPersons( async getBannedPersons(
form: GetBannedPersons form: GetBannedPersons
@ -600,6 +658,7 @@ export class LemmyHttp {
/** /**
* Block a person. * Block a person.
* `HTTP.POST /user/block`
*/ */
async blockPerson(form: BlockPerson): Promise<BlockPersonResponse> { async blockPerson(form: BlockPerson): Promise<BlockPersonResponse> {
return this.wrapper(HttpType.Post, "/user/block", form); return this.wrapper(HttpType.Post, "/user/block", form);
@ -607,6 +666,7 @@ export class LemmyHttp {
/** /**
* Fetch a Captcha. * Fetch a Captcha.
* `HTTP.GET /user/get_captcha`
*/ */
async getCaptcha(): Promise<GetCaptchaResponse> { async getCaptcha(): Promise<GetCaptchaResponse> {
return this.wrapper(HttpType.Get, "/user/get_captcha", {}); return this.wrapper(HttpType.Get, "/user/get_captcha", {});
@ -614,6 +674,7 @@ export class LemmyHttp {
/** /**
* Delete your account. * Delete your account.
* `HTTP.POST /user/delete_account`
*/ */
async deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse> { async deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse> {
return this.wrapper(HttpType.Post, "/user/delete_account", form); return this.wrapper(HttpType.Post, "/user/delete_account", form);
@ -621,6 +682,7 @@ export class LemmyHttp {
/** /**
* Reset your password. * Reset your password.
* `HTTP.POST /user/password_reset`
*/ */
async passwordReset(form: PasswordReset): Promise<PasswordResetResponse> { async passwordReset(form: PasswordReset): Promise<PasswordResetResponse> {
return this.wrapper(HttpType.Post, "/user/password_reset", form); return this.wrapper(HttpType.Post, "/user/password_reset", form);
@ -628,6 +690,7 @@ export class LemmyHttp {
/** /**
* Change your password from an email / token based reset. * Change your password from an email / token based reset.
* `HTTP.POST /user/password_change`
*/ */
async passwordChange(form: PasswordChange): Promise<LoginResponse> { async passwordChange(form: PasswordChange): Promise<LoginResponse> {
return this.wrapper(HttpType.Post, "/user/password_change", form); return this.wrapper(HttpType.Post, "/user/password_change", form);
@ -635,6 +698,7 @@ export class LemmyHttp {
/** /**
* Mark all replies as read. * Mark all replies as read.
* `HTTP.POST /user/mark_all_as_read`
*/ */
async markAllAsRead(form: MarkAllAsRead): Promise<GetRepliesResponse> { async markAllAsRead(form: MarkAllAsRead): Promise<GetRepliesResponse> {
return this.wrapper(HttpType.Post, "/user/mark_all_as_read", form); return this.wrapper(HttpType.Post, "/user/mark_all_as_read", form);
@ -642,6 +706,7 @@ export class LemmyHttp {
/** /**
* Save your user settings. * Save your user settings.
* `HTTP.PUT /user/save_user_settings`
*/ */
async saveUserSettings(form: SaveUserSettings): Promise<LoginResponse> { async saveUserSettings(form: SaveUserSettings): Promise<LoginResponse> {
return this.wrapper(HttpType.Put, "/user/save_user_settings", form); return this.wrapper(HttpType.Put, "/user/save_user_settings", form);
@ -649,6 +714,7 @@ export class LemmyHttp {
/** /**
* Change your user password. * Change your user password.
* `HTTP.PUT /user/change_password`
*/ */
async changePassword(form: ChangePassword): Promise<LoginResponse> { async changePassword(form: ChangePassword): Promise<LoginResponse> {
return this.wrapper(HttpType.Put, "/user/change_password", form); return this.wrapper(HttpType.Put, "/user/change_password", form);
@ -656,6 +722,7 @@ export class LemmyHttp {
/** /**
* Get counts for your reports * Get counts for your reports
* `HTTP.GET /user/report_count`
*/ */
async getReportCount(form: GetReportCount): Promise<GetReportCountResponse> { async getReportCount(form: GetReportCount): Promise<GetReportCountResponse> {
return this.wrapper(HttpType.Get, "/user/report_count", form); return this.wrapper(HttpType.Get, "/user/report_count", form);
@ -663,6 +730,7 @@ export class LemmyHttp {
/** /**
* Get your unread counts * Get your unread counts
* `HTTP.GET /user/unread_count`
*/ */
async getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse> { async getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse> {
return this.wrapper(HttpType.Get, "/user/unread_count", form); return this.wrapper(HttpType.Get, "/user/unread_count", form);
@ -670,6 +738,7 @@ export class LemmyHttp {
/** /**
* Verify your email * Verify your email
* `HTTP.POST /user/verify_email`
*/ */
async verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse> { async verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse> {
return this.wrapper(HttpType.Post, "/user/verify_email", form); return this.wrapper(HttpType.Post, "/user/verify_email", form);
@ -677,6 +746,7 @@ export class LemmyHttp {
/** /**
* Add an admin to your site. * Add an admin to your site.
* `HTTP.POST /admin/add`
*/ */
async addAdmin(form: AddAdmin): Promise<AddAdminResponse> { async addAdmin(form: AddAdmin): Promise<AddAdminResponse> {
return this.wrapper(HttpType.Post, "/admin/add", form); return this.wrapper(HttpType.Post, "/admin/add", form);
@ -684,6 +754,7 @@ export class LemmyHttp {
/** /**
* Get the unread registration applications count. * Get the unread registration applications count.
* `HTTP.GET /admin/registration_application/count`
*/ */
async getUnreadRegistrationApplicationCount( async getUnreadRegistrationApplicationCount(
form: GetUnreadRegistrationApplicationCount form: GetUnreadRegistrationApplicationCount
@ -696,7 +767,8 @@ export class LemmyHttp {
} }
/** /**
* List the unread registration applications. * List the registration applications.
* `HTTP.GET /admin/registration_application/list`
*/ */
async listRegistrationApplications( async listRegistrationApplications(
form: ListRegistrationApplications form: ListRegistrationApplications
@ -710,6 +782,7 @@ export class LemmyHttp {
/** /**
* Approve a registration application * Approve a registration application
* `HTTP.PUT /admin/registration_application/approve`
*/ */
async approveRegistrationApplication( async approveRegistrationApplication(
form: ApproveRegistrationApplication form: ApproveRegistrationApplication