stage1: use custom client for api calls

This commit is contained in:
James Xylight committed 2025-09-03 17:15:59 -07:00
1 parent 51d52e9fdc
commit 64026143ff
4 files changed
+673 -107

No files matched your search

+1 -2
View File
@@ -5,7 +5,7 @@ import {
isAdmin, isAdmin,
} from '$lib/components/lemmy/moderation/moderation.js' } from '$lib/components/lemmy/moderation/moderation.js'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js' import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
import { client, getClient } from '$lib/client/lemmy.svelte' import { client, getClient, site } from '$lib/client/lemmy.svelte'
import { instanceToURL, moveItem } from '$lib/util.svelte' import { instanceToURL, moveItem } from '$lib/util.svelte'
import { MINIMUM_VERSION, versionIsSupported } from '$lib/version.js' import { MINIMUM_VERSION, versionIsSupported } from '$lib/version.js'
import { import {
@@ -16,7 +16,6 @@ import {
import { toast } from 'mono-svelte' import { toast } from 'mono-svelte'
import { writable } from 'svelte/store' import { writable } from 'svelte/store'
import { t } from './i18n/translations' import { t } from './i18n/translations'
import { site } from './lemmy.svelte'
import { errorMessage } from './lemmy/error' import { errorMessage } from './lemmy/error'
import { publishedToDate } from './components/util/date' import { publishedToDate } from './components/util/date'
+204 -101
View File
@@ -1,102 +1,205 @@
abstract class BaseClient { import * as types from './types'
abstract getSite()
abstract createSite(form) export abstract class BaseClient {
abstract editSite(form) static type: 'lemmy' | 'piefed'
abstract leaveAdmin()
abstract generateTotpSecret() abstract getSite(): Promise<types.GetSiteResponse>
abstract exportSettings() abstract generateTotpSecret(): Promise<types.GenerateTotpSecretResponse>
abstract importSettings(form) abstract listLogins(): Promise<types.LoginToken[]>
abstract listLogins() abstract listAllMedia(form: types.ListMedia): Promise<types.ListMediaResponse>
abstract validateAuth() abstract updateTotp(form: types.UpdateTotp): Promise<types.UpdateTotpResponse>
abstract listMedia(form) abstract getModlog(form: types.GetModlog): Promise<types.GetModlogResponse>
abstract listAllMedia(form) abstract search(form: types.Search): Promise<types.SearchResponse>
abstract updateTotp(form) abstract resolveObject(
abstract getModlog(form) form: types.ResolveObject,
abstract search(form) ): Promise<types.ResolveObjectResponse>
abstract resolveObject(form) abstract createCommunity(
abstract createCommunity(form) form: types.CreateCommunity,
abstract getCommunity(form) ): Promise<types.CommunityResponse>
abstract editCommunity(form) abstract getCommunity(
abstract listCommunities(form) form: types.GetCommunity,
abstract followCommunity(form) ): Promise<types.GetCommunityResponse>
abstract blockCommunity(form) abstract editCommunity(
abstract deleteCommunity(form) form: types.EditCommunity,
abstract hideCommunity(form) ): Promise<types.CommunityResponse>
abstract removeCommunity(form) abstract listCommunities(
abstract transferCommunity(form) form: types.ListCommunities,
abstract banFromCommunity(form) ): Promise<types.ListCommunitiesResponse>
abstract addModToCommunity(form) abstract followCommunity(
abstract createPost(form) form: types.FollowCommunity,
abstract getPost(form) ): Promise<types.CommunityResponse>
abstract editPost(form) abstract blockCommunity(
abstract deletePost(form) form: types.BlockCommunity,
abstract removePost(form) ): Promise<types.BlockCommunityResponse>
abstract markPostAsRead(form) abstract deleteCommunity(
abstract hidePost(form) form: types.DeleteCommunity,
abstract lockPost(form) ): Promise<types.CommunityResponse>
abstract featurePost(form) abstract hideCommunity(
abstract getPosts(form) form: types.HideCommunity,
abstract likePost(form) ): Promise<types.SuccessResponse>
abstract listPostLikes(form) abstract removeCommunity(
abstract savePost(form) form: types.RemoveCommunity,
abstract createPostReport(form) ): Promise<types.CommunityResponse>
abstract resolvePostReport(form) abstract banFromCommunity(
abstract listPostReports(form) form: types.BanFromCommunity,
abstract getSiteMetadata(form) ): Promise<types.BanFromCommunityResponse>
abstract createComment(form) abstract addModToCommunity(
abstract editComment(form) form: types.AddModToCommunity,
abstract deleteComment(form) ): Promise<types.AddModToCommunityResponse>
abstract removeComment(form) abstract createPost(form: types.CreatePost): Promise<types.PostResponse>
abstract markCommentReplyAsRead(form) abstract getPost(form: types.GetPost): Promise<types.GetPostResponse>
abstract likeComment(form) abstract editPost(form: types.EditPost): Promise<types.PostResponse>
abstract listCommentLikes(form) abstract deletePost(form: types.DeletePost): Promise<types.PostResponse>
abstract saveComment(form) abstract removePost(form: types.RemovePost): Promise<types.PostResponse>
abstract distinguishComment(form) abstract markPostAsRead(
abstract getComments(form) form: types.MarkPostAsRead,
abstract getComment(form) ): Promise<types.SuccessResponse>
abstract createCommentReport(form) abstract hidePost(form: types.HidePost): Promise<types.SuccessResponse>
abstract resolveCommentReport(form) abstract lockPost(form: types.LockPost): Promise<types.PostResponse>
abstract listCommentReports(form) abstract featurePost(form: types.FeaturePost): Promise<types.PostResponse>
abstract getPrivateMessages(form) abstract getPosts(form: types.GetPosts): Promise<types.GetPostsResponse>
abstract createPrivateMessage(form) abstract likePost(form: types.CreatePostLike): Promise<types.PostResponse>
abstract editPrivateMessage(form) abstract listPostLikes(
abstract deletePrivateMessage(form) form: types.ListPostLikes,
abstract markPrivateMessageAsRead(form) ): Promise<types.ListPostLikesResponse>
abstract createPrivateMessageReport(form) abstract savePost(form: types.SavePost): Promise<types.PostResponse>
abstract resolvePrivateMessageReport(form) // TODO should unify these reports probably
abstract listPrivateMessageReports(form) abstract createPostReport(
abstract register(form) form: types.CreatePostReport,
abstract login(form) ): Promise<types.PostReportResponse>
abstract logout() abstract resolvePostReport(
abstract getPersonDetails(form) form: types.ResolvePostReport,
abstract getPersonMentions(form) ): Promise<types.PostReportResponse>
abstract markPersonMentionAsRead(form) abstract listPostReports(
abstract getReplies(form) form: types.ListPostReports,
abstract banPerson(form) ): Promise<types.ListPostReportsResponse>
abstract getBannedPersons() abstract getSiteMetadata(
abstract blockPerson(form) form: types.GetSiteMetadata,
abstract getCaptcha() ): Promise<types.GetSiteMetadataResponse>
abstract deleteAccount(form) abstract createComment(
abstract passwordReset(form) form: types.CreateComment,
abstract passwordChangeAfterReset(form) ): Promise<types.CommentResponse>
abstract markAllAsRead() abstract editComment(form: types.EditComment): Promise<types.CommentResponse>
abstract saveUserSettings(form) abstract deleteComment(
abstract changePassword(form) form: types.DeleteComment,
abstract getReportCount(form) ): Promise<types.CommentResponse>
abstract getUnreadCount() abstract removeComment(
abstract verifyEmail(form) form: types.RemoveComment,
abstract addAdmin(form) ): Promise<types.CommentResponse>
abstract getUnreadRegistrationApplicationCount() abstract markCommentReplyAsRead(
abstract listRegistrationApplications(form) form: types.MarkCommentReplyAsRead,
abstract approveRegistrationApplication(form) ): Promise<types.CommentReplyResponse>
abstract getRegistrationApplication(form) abstract likeComment(
abstract purgePerson(form) form: types.CreateCommentLike,
abstract purgeCommunity(form) ): Promise<types.CommentResponse>
abstract purgePost(form) abstract listCommentLikes(
abstract purgeComment(form) form: types.ListCommentLikes,
abstract createCustomEmoji(form) ): Promise<types.ListCommentLikesResponse>
abstract editCustomEmoji(form) // TODO unify saving with posts too
abstract deleteCustomEmoji(form) // i have options for unifying these since I'm making the API client myself now
abstract getFederatedInstances() abstract saveComment(form: types.SaveComment): Promise<types.CommentResponse>
abstract blockInstance(form) abstract distinguishComment(
form: types.DistinguishComment,
): Promise<types.CommentResponse>
abstract getComments(
form: types.GetComments,
): Promise<types.GetCommentsResponse>
abstract getComment(form: types.GetComment): Promise<types.CommentResponse>
abstract createCommentReport(
form: types.CreateCommentReport,
): Promise<types.CommentReportResponse>
abstract resolveCommentReport(
form: types.ResolveCommentReport,
): Promise<types.CommentReportResponse>
abstract listCommentReports(
form: types.ListCommentReports,
): Promise<types.ListCommentReportsResponse>
abstract getPrivateMessages(
form: types.GetPrivateMessages,
): Promise<types.PrivateMessagesResponse>
abstract createPrivateMessage(
form: types.CreatePrivateMessage,
): Promise<types.PrivateMessageResponse>
abstract editPrivateMessage(
form: types.EditPrivateMessage,
): Promise<types.PrivateMessageResponse>
abstract deletePrivateMessage(
form: types.DeletePrivateMessage,
): Promise<types.PrivateMessageResponse>
abstract markPrivateMessageAsRead(
form: types.MarkPrivateMessageAsRead,
): Promise<types.PrivateMessageResponse>
abstract createPrivateMessageReport(
form: types.CreatePrivateMessageReport,
): Promise<types.PrivateMessageReportResponse>
abstract resolvePrivateMessageReport(
form: types.ResolvePrivateMessageReport,
): Promise<types.PrivateMessageReportResponse>
abstract listPrivateMessageReports(
form: types.ListPrivateMessageReports,
): Promise<types.ListPrivateMessageReportsResponse>
abstract register(form: types.Register): Promise<types.LoginResponse>
abstract login(form: types.Login): Promise<types.LoginResponse>
abstract logout(): Promise<types.SuccessResponse>
abstract getPersonDetails(
form: types.GetPersonDetails,
): Promise<types.GetPersonDetailsResponse>
// TODO unify these inbox things too
abstract getPersonMentions(
form: types.GetPersonMentions,
): Promise<types.GetPersonMentionsResponse>
abstract markPersonMentionAsRead(
form: types.MarkPersonMentionAsRead,
): Promise<types.PersonMentionResponse>
abstract getReplies(form: types.GetReplies): Promise<types.GetRepliesResponse>
abstract banPerson(form: types.BanPerson): Promise<types.BanPersonResponse>
abstract getBannedPersons(): Promise<types.BannedPersonsResponse>
abstract blockPerson(
form: types.BlockPerson,
): Promise<types.BlockPersonResponse>
abstract getCaptcha(): Promise<types.GetCaptchaResponse>
abstract deleteAccount(
form: types.DeleteAccount,
): Promise<types.SuccessResponse>
abstract passwordReset(
form: types.PasswordReset,
): Promise<types.SuccessResponse>
abstract passwordChangeAfterReset(
form: types.PasswordChangeAfterReset,
): Promise<types.SuccessResponse>
abstract markAllAsRead(): Promise<types.GetRepliesResponse>
abstract saveUserSettings(
form: types.SaveUserSettings,
): Promise<types.SuccessResponse>
abstract changePassword(
form: types.ChangePassword,
): Promise<types.LoginResponse>
abstract getReportCount(
form: types.GetReportCount,
): Promise<types.GetReportCountResponse>
abstract getUnreadCount(): Promise<types.GetUnreadCountResponse>
abstract verifyEmail(form: types.VerifyEmail): Promise<types.SuccessResponse>
abstract addAdmin(form: types.AddAdmin): Promise<types.AddAdminResponse>
abstract getUnreadRegistrationApplicationCount(): Promise<types.GetUnreadRegistrationApplicationCountResponse>
abstract listRegistrationApplications(
form: types.ListRegistrationApplications,
): Promise<types.ListRegistrationApplicationsResponse>
abstract approveRegistrationApplication(
form: types.ApproveRegistrationApplication,
): Promise<types.RegistrationApplicationResponse>
abstract getRegistrationApplication(
form: types.GetRegistrationApplication,
): Promise<types.RegistrationApplicationResponse>
abstract purgePerson(form: types.PurgePerson): Promise<types.SuccessResponse>
abstract purgeCommunity(
form: types.PurgeCommunity,
): Promise<types.SuccessResponse>
abstract purgePost(form: types.PurgePost): Promise<types.SuccessResponse>
abstract purgeComment(
form: types.PurgeComment,
): Promise<types.SuccessResponse>
abstract getFederatedInstances(): Promise<types.GetFederatedInstancesResponse>
abstract blockInstance(
form: types.BlockInstance,
): Promise<types.BlockInstanceResponse>
} }
+4 -4
View File
@@ -2,7 +2,8 @@ import { profile } from '$lib/auth.svelte'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js' import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
import { instanceToURL } from '$lib/util.svelte' import { instanceToURL } from '$lib/util.svelte'
import { error } from '@sveltejs/kit' import { error } from '@sveltejs/kit'
import { LemmyHttp, type GetSiteResponse } from 'lemmy-js-client' import { type GetSiteResponse } from 'lemmy-js-client'
import { LemmyClient } from './lemmy/lemmy'
class SiteData { class SiteData {
#data = $state<GetSiteResponse>() #data = $state<GetSiteResponse>()
@@ -67,9 +68,8 @@ export function client({
const headers = jwt ? { authorization: `Bearer ${jwt}` } : {} const headers = jwt ? { authorization: `Bearer ${jwt}` } : {}
return new LemmyHttp(instanceToURL(instanceURL), { return new LemmyClient(instanceToURL(instanceURL), {
fetchFunction: (input, init) => customFetch(func, input, init, jwt), fetchFunction: (input, init) => customFetch(func, input, init, jwt),
// @ts-expect-error headers thing
headers: headers, headers: headers,
}) })
} }
@@ -81,7 +81,7 @@ export function getClient(
init?: RequestInit | undefined, init?: RequestInit | undefined,
) => Promise<Response>, ) => Promise<Response>,
auth?: string, auth?: string,
): LemmyHttp { ) {
return client({ instanceURL, func, auth }) return client({ instanceURL, func, auth })
} }
+464
View File
@@ -0,0 +1,464 @@
import { LemmyHttp } from 'lemmy-js-client'
import type { BaseClient } from '../base'
export class LemmyClient implements BaseClient {
static type = 'lemmy'
#client: LemmyHttp
constructor(
baseUrl: string,
args: {
fetchFunction: (input: any, init: any) => Promise<any>
headers: any
},
) {
this.#client = new LemmyHttp(baseUrl, args)
}
async getSite(
...params: Parameters<BaseClient['getSite']>
): ReturnType<BaseClient['getSite']> {
return await this.#client.getSite(...params)
}
async generateTotpSecret(
...params: Parameters<BaseClient['generateTotpSecret']>
): ReturnType<BaseClient['generateTotpSecret']> {
return await this.#client.generateTotpSecret(...params)
}
async listLogins(
...params: Parameters<BaseClient['listLogins']>
): ReturnType<BaseClient['listLogins']> {
return await this.#client.listLogins(...params)
}
async listAllMedia(
...params: Parameters<BaseClient['listAllMedia']>
): ReturnType<BaseClient['listAllMedia']> {
return await this.#client.listAllMedia(...params)
}
async updateTotp(
...params: Parameters<BaseClient['updateTotp']>
): ReturnType<BaseClient['updateTotp']> {
return await this.#client.updateTotp(...params)
}
async getModlog(
...params: Parameters<BaseClient['getModlog']>
): ReturnType<BaseClient['getModlog']> {
return await this.#client.getModlog(...params)
}
async search(
...params: Parameters<BaseClient['search']>
): ReturnType<BaseClient['search']> {
return await this.#client.search(...params)
}
async resolveObject(
...params: Parameters<BaseClient['resolveObject']>
): ReturnType<BaseClient['resolveObject']> {
return await this.#client.resolveObject(...params)
}
async createCommunity(
...params: Parameters<BaseClient['createCommunity']>
): ReturnType<BaseClient['createCommunity']> {
return await this.#client.createCommunity(...params)
}
async getCommunity(
...params: Parameters<BaseClient['getCommunity']>
): ReturnType<BaseClient['getCommunity']> {
return await this.#client.getCommunity(...params)
}
async editCommunity(
...params: Parameters<BaseClient['editCommunity']>
): ReturnType<BaseClient['editCommunity']> {
return await this.#client.editCommunity(...params)
}
async listCommunities(
...params: Parameters<BaseClient['listCommunities']>
): ReturnType<BaseClient['listCommunities']> {
return await this.#client.listCommunities(...params)
}
async followCommunity(
...params: Parameters<BaseClient['followCommunity']>
): ReturnType<BaseClient['followCommunity']> {
return await this.#client.followCommunity(...params)
}
async blockCommunity(
...params: Parameters<BaseClient['blockCommunity']>
): ReturnType<BaseClient['blockCommunity']> {
return await this.#client.blockCommunity(...params)
}
async deleteCommunity(
...params: Parameters<BaseClient['deleteCommunity']>
): ReturnType<BaseClient['deleteCommunity']> {
return await this.#client.deleteCommunity(...params)
}
async hideCommunity(
...params: Parameters<BaseClient['hideCommunity']>
): ReturnType<BaseClient['hideCommunity']> {
return await this.#client.hideCommunity(...params)
}
async removeCommunity(
...params: Parameters<BaseClient['removeCommunity']>
): ReturnType<BaseClient['removeCommunity']> {
return await this.#client.removeCommunity(...params)
}
async banFromCommunity(
...params: Parameters<BaseClient['banFromCommunity']>
): ReturnType<BaseClient['banFromCommunity']> {
return await this.#client.banFromCommunity(...params)
}
async addModToCommunity(
...params: Parameters<BaseClient['addModToCommunity']>
): ReturnType<BaseClient['addModToCommunity']> {
return await this.#client.addModToCommunity(...params)
}
async createPost(
...params: Parameters<BaseClient['createPost']>
): ReturnType<BaseClient['createPost']> {
return await this.#client.createPost(...params)
}
async getPost(
...params: Parameters<BaseClient['getPost']>
): ReturnType<BaseClient['getPost']> {
return await this.#client.getPost(...params)
}
async editPost(
...params: Parameters<BaseClient['editPost']>
): ReturnType<BaseClient['editPost']> {
return await this.#client.editPost(...params)
}
async deletePost(
...params: Parameters<BaseClient['deletePost']>
): ReturnType<BaseClient['deletePost']> {
return await this.#client.deletePost(...params)
}
async removePost(
...params: Parameters<BaseClient['removePost']>
): ReturnType<BaseClient['removePost']> {
return await this.#client.removePost(...params)
}
async markPostAsRead(
...params: Parameters<BaseClient['markPostAsRead']>
): ReturnType<BaseClient['markPostAsRead']> {
return await this.#client.markPostAsRead(...params)
}
async hidePost(
...params: Parameters<BaseClient['hidePost']>
): ReturnType<BaseClient['hidePost']> {
return await this.#client.hidePost(...params)
}
async lockPost(
...params: Parameters<BaseClient['lockPost']>
): ReturnType<BaseClient['lockPost']> {
return await this.#client.lockPost(...params)
}
async featurePost(
...params: Parameters<BaseClient['featurePost']>
): ReturnType<BaseClient['featurePost']> {
return await this.#client.featurePost(...params)
}
async getPosts(
...params: Parameters<BaseClient['getPosts']>
): ReturnType<BaseClient['getPosts']> {
return await this.#client.getPosts(...params)
}
async likePost(
...params: Parameters<BaseClient['likePost']>
): ReturnType<BaseClient['likePost']> {
return await this.#client.likePost(...params)
}
async listPostLikes(
...params: Parameters<BaseClient['listPostLikes']>
): ReturnType<BaseClient['listPostLikes']> {
return await this.#client.listPostLikes(...params)
}
async savePost(
...params: Parameters<BaseClient['savePost']>
): ReturnType<BaseClient['savePost']> {
return await this.#client.savePost(...params)
}
async createPostReport(
...params: Parameters<BaseClient['createPostReport']>
): ReturnType<BaseClient['createPostReport']> {
return await this.#client.createPostReport(...params)
}
async resolvePostReport(
...params: Parameters<BaseClient['resolvePostReport']>
): ReturnType<BaseClient['resolvePostReport']> {
return await this.#client.resolvePostReport(...params)
}
async listPostReports(
...params: Parameters<BaseClient['listPostReports']>
): ReturnType<BaseClient['listPostReports']> {
return await this.#client.listPostReports(...params)
}
async getSiteMetadata(
...params: Parameters<BaseClient['getSiteMetadata']>
): ReturnType<BaseClient['getSiteMetadata']> {
return await this.#client.getSiteMetadata(...params)
}
async createComment(
...params: Parameters<BaseClient['createComment']>
): ReturnType<BaseClient['createComment']> {
return await this.#client.createComment(...params)
}
async editComment(
...params: Parameters<BaseClient['editComment']>
): ReturnType<BaseClient['editComment']> {
return await this.#client.editComment(...params)
}
async deleteComment(
...params: Parameters<BaseClient['deleteComment']>
): ReturnType<BaseClient['deleteComment']> {
return await this.#client.deleteComment(...params)
}
async removeComment(
...params: Parameters<BaseClient['removeComment']>
): ReturnType<BaseClient['removeComment']> {
return await this.#client.removeComment(...params)
}
async markCommentReplyAsRead(
...params: Parameters<BaseClient['markCommentReplyAsRead']>
): ReturnType<BaseClient['markCommentReplyAsRead']> {
return await this.#client.markCommentReplyAsRead(...params)
}
async likeComment(
...params: Parameters<BaseClient['likeComment']>
): ReturnType<BaseClient['likeComment']> {
return await this.#client.likeComment(...params)
}
async listCommentLikes(
...params: Parameters<BaseClient['listCommentLikes']>
): ReturnType<BaseClient['listCommentLikes']> {
return await this.#client.listCommentLikes(...params)
}
async saveComment(
...params: Parameters<BaseClient['saveComment']>
): ReturnType<BaseClient['saveComment']> {
return await this.#client.saveComment(...params)
}
async distinguishComment(
...params: Parameters<BaseClient['distinguishComment']>
): ReturnType<BaseClient['distinguishComment']> {
return await this.#client.distinguishComment(...params)
}
async getComments(
...params: Parameters<BaseClient['getComments']>
): ReturnType<BaseClient['getComments']> {
return await this.#client.getComments(...params)
}
async getComment(
...params: Parameters<BaseClient['getComment']>
): ReturnType<BaseClient['getComment']> {
return await this.#client.getComment(...params)
}
async createCommentReport(
...params: Parameters<BaseClient['createCommentReport']>
): ReturnType<BaseClient['createCommentReport']> {
return await this.#client.createCommentReport(...params)
}
async resolveCommentReport(
...params: Parameters<BaseClient['resolveCommentReport']>
): ReturnType<BaseClient['resolveCommentReport']> {
return await this.#client.resolveCommentReport(...params)
}
async listCommentReports(
...params: Parameters<BaseClient['listCommentReports']>
): ReturnType<BaseClient['listCommentReports']> {
return await this.#client.listCommentReports(...params)
}
async getPrivateMessages(
...params: Parameters<BaseClient['getPrivateMessages']>
): ReturnType<BaseClient['getPrivateMessages']> {
return await this.#client.getPrivateMessages(...params)
}
async createPrivateMessage(
...params: Parameters<BaseClient['createPrivateMessage']>
): ReturnType<BaseClient['createPrivateMessage']> {
return await this.#client.createPrivateMessage(...params)
}
async editPrivateMessage(
...params: Parameters<BaseClient['editPrivateMessage']>
): ReturnType<BaseClient['editPrivateMessage']> {
return await this.#client.editPrivateMessage(...params)
}
async deletePrivateMessage(
...params: Parameters<BaseClient['deletePrivateMessage']>
): ReturnType<BaseClient['deletePrivateMessage']> {
return await this.#client.deletePrivateMessage(...params)
}
async markPrivateMessageAsRead(
...params: Parameters<BaseClient['markPrivateMessageAsRead']>
): ReturnType<BaseClient['markPrivateMessageAsRead']> {
return await this.#client.markPrivateMessageAsRead(...params)
}
async createPrivateMessageReport(
...params: Parameters<BaseClient['createPrivateMessageReport']>
): ReturnType<BaseClient['createPrivateMessageReport']> {
return await this.#client.createPrivateMessageReport(...params)
}
async resolvePrivateMessageReport(
...params: Parameters<BaseClient['resolvePrivateMessageReport']>
): ReturnType<BaseClient['resolvePrivateMessageReport']> {
return await this.#client.resolvePrivateMessageReport(...params)
}
async listPrivateMessageReports(
...params: Parameters<BaseClient['listPrivateMessageReports']>
): ReturnType<BaseClient['listPrivateMessageReports']> {
return await this.#client.listPrivateMessageReports(...params)
}
async register(
...params: Parameters<BaseClient['register']>
): ReturnType<BaseClient['register']> {
return await this.#client.register(...params)
}
async login(
...params: Parameters<BaseClient['login']>
): ReturnType<BaseClient['login']> {
return await this.#client.login(...params)
}
async logout(
...params: Parameters<BaseClient['logout']>
): ReturnType<BaseClient['logout']> {
return await this.#client.logout(...params)
}
async getPersonDetails(
...params: Parameters<BaseClient['getPersonDetails']>
): ReturnType<BaseClient['getPersonDetails']> {
return await this.#client.getPersonDetails(...params)
}
async getPersonMentions(
...params: Parameters<BaseClient['getPersonMentions']>
): ReturnType<BaseClient['getPersonMentions']> {
return await this.#client.getPersonMentions(...params)
}
async markPersonMentionAsRead(
...params: Parameters<BaseClient['markPersonMentionAsRead']>
): ReturnType<BaseClient['markPersonMentionAsRead']> {
return await this.#client.markPersonMentionAsRead(...params)
}
async getReplies(
...params: Parameters<BaseClient['getReplies']>
): ReturnType<BaseClient['getReplies']> {
return await this.#client.getReplies(...params)
}
async banPerson(
...params: Parameters<BaseClient['banPerson']>
): ReturnType<BaseClient['banPerson']> {
return await this.#client.banPerson(...params)
}
async getBannedPersons(
...params: Parameters<BaseClient['getBannedPersons']>
): ReturnType<BaseClient['getBannedPersons']> {
return await this.#client.getBannedPersons(...params)
}
async blockPerson(
...params: Parameters<BaseClient['blockPerson']>
): ReturnType<BaseClient['blockPerson']> {
return await this.#client.blockPerson(...params)
}
async getCaptcha(
...params: Parameters<BaseClient['getCaptcha']>
): ReturnType<BaseClient['getCaptcha']> {
return await this.#client.getCaptcha(...params)
}
async deleteAccount(
...params: Parameters<BaseClient['deleteAccount']>
): ReturnType<BaseClient['deleteAccount']> {
return await this.#client.deleteAccount(...params)
}
async passwordReset(
...params: Parameters<BaseClient['passwordReset']>
): ReturnType<BaseClient['passwordReset']> {
return await this.#client.passwordReset(...params)
}
async passwordChangeAfterReset(
...params: Parameters<BaseClient['passwordChangeAfterReset']>
): ReturnType<BaseClient['passwordChangeAfterReset']> {
return await this.#client.passwordChangeAfterReset(...params)
}
async markAllAsRead(
...params: Parameters<BaseClient['markAllAsRead']>
): ReturnType<BaseClient['markAllAsRead']> {
return await this.#client.markAllAsRead(...params)
}
async saveUserSettings(
...params: Parameters<BaseClient['saveUserSettings']>
): ReturnType<BaseClient['saveUserSettings']> {
return await this.#client.saveUserSettings(...params)
}
async changePassword(
...params: Parameters<BaseClient['changePassword']>
): ReturnType<BaseClient['changePassword']> {
return await this.#client.changePassword(...params)
}
async getReportCount(
...params: Parameters<BaseClient['getReportCount']>
): ReturnType<BaseClient['getReportCount']> {
return await this.#client.getReportCount(...params)
}
async getUnreadCount(
...params: Parameters<BaseClient['getUnreadCount']>
): ReturnType<BaseClient['getUnreadCount']> {
return await this.#client.getUnreadCount(...params)
}
async verifyEmail(
...params: Parameters<BaseClient['verifyEmail']>
): ReturnType<BaseClient['verifyEmail']> {
return await this.#client.verifyEmail(...params)
}
async addAdmin(
...params: Parameters<BaseClient['addAdmin']>
): ReturnType<BaseClient['addAdmin']> {
return await this.#client.addAdmin(...params)
}
async getUnreadRegistrationApplicationCount(
...params: Parameters<BaseClient['getUnreadRegistrationApplicationCount']>
): ReturnType<BaseClient['getUnreadRegistrationApplicationCount']> {
return await this.#client.getUnreadRegistrationApplicationCount(...params)
}
async listRegistrationApplications(
...params: Parameters<BaseClient['listRegistrationApplications']>
): ReturnType<BaseClient['listRegistrationApplications']> {
return await this.#client.listRegistrationApplications(...params)
}
async approveRegistrationApplication(
...params: Parameters<BaseClient['approveRegistrationApplication']>
): ReturnType<BaseClient['approveRegistrationApplication']> {
return await this.#client.approveRegistrationApplication(...params)
}
async getRegistrationApplication(
...params: Parameters<BaseClient['getRegistrationApplication']>
): ReturnType<BaseClient['getRegistrationApplication']> {
return await this.#client.getRegistrationApplication(...params)
}
async purgePerson(
...params: Parameters<BaseClient['purgePerson']>
): ReturnType<BaseClient['purgePerson']> {
return await this.#client.purgePerson(...params)
}
async purgeCommunity(
...params: Parameters<BaseClient['purgeCommunity']>
): ReturnType<BaseClient['purgeCommunity']> {
return await this.#client.purgeCommunity(...params)
}
async purgePost(
...params: Parameters<BaseClient['purgePost']>
): ReturnType<BaseClient['purgePost']> {
return await this.#client.purgePost(...params)
}
async purgeComment(
...params: Parameters<BaseClient['purgeComment']>
): ReturnType<BaseClient['purgeComment']> {
return await this.#client.purgeComment(...params)
}
async getFederatedInstances(
...params: Parameters<BaseClient['getFederatedInstances']>
): ReturnType<BaseClient['getFederatedInstances']> {
return await this.#client.getFederatedInstances(...params)
}
async blockInstance(
...params: Parameters<BaseClient['blockInstance']>
): ReturnType<BaseClient['blockInstance']> {
return await this.#client.blockInstance(...params)
}
}