diff --git a/.prettierrc b/.prettierrc
index 188b944a..32a99389 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -4,7 +4,6 @@
"semi": false,
"singleQuote": true,
"htmlWhitespaceSensitivity": "ignore",
-
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
diff --git a/README.md b/README.md
index a2cfa023..36318420 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,6 @@ Jump to:
-
## Self-hosting
You selfhost a Photon frontend server for your Lemmy instance, or independently for any instance.
@@ -39,6 +38,7 @@ To run an unconfigured Photon instance on port `8080`:
```sh
docker run -p 8080:3000 ghcr.io/xyphyn/photon:latest
```
+
### Running natively
Clone the repo:
@@ -80,8 +80,11 @@ Photon lets you configure the default client settings and more.
If you're hosting Photon for a Lemmy instance, you' ll almost definitely want to set these:
- `PUBLIC_INSTANCE_URL` `string`: The domain which **the browser** will send API requests to.
+
- Example: `PUBLIC_INSTANCE_URL=fedi.phtn.app`
+- `PUBLIC_INSTANCE_TYPE` `lemmyv3 | piefedalpha` (default: `lemmyv3`): If your instance is running Piefed, you must set this option to `piefedalpha`. Otherwise, you don't need to do anything.
+
- `PUBLIC_SSR_ENABLED` `boolean`: When enabled, will **make page requests be rendered server side first**, which allows search engine indexing, and basic non-js usage.
- `PUBLIC_INTERNAL_INSTANCE` `string`: Only relevant if `PUBLIC_SSR_ENABLED=true`. This is the domain that the **server will make API requests to.**
diff --git a/TODO.md b/TODO.md
deleted file mode 100644
index 865ae160..00000000
--- a/TODO.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Todo
-
-- [ ] Add blocking instances and stuff
diff --git a/bun.lockb b/bun.lockb
index 868bcd47..76cd9658 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/eslint.config.js b/eslint.config.js
index 4fd4d3a8..1a06e844 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -29,6 +29,7 @@ export default ts.config(
'svelte/prefer-writable-derived': 'off',
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
+ 'svelte/no-navigation-without-resolve': 'off',
},
},
{
diff --git a/package.json b/package.json
index 6d915318..8f2d18c9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "photon-lemmy",
- "version": "2.0.2",
+ "version": "2.0.3",
"license": "AGPL-3.0-only",
"devDependencies": {
"@dicebear/core": "^8.0.1",
@@ -26,6 +26,7 @@
"marked": "7.0.5",
"marked-linkify-it": "^3.1.13",
"nprogress": "^0.2.0",
+ "openapi-fetch": "^0.14.0",
"postcss": "^8.4.30",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
diff --git a/src/lib/auth.svelte.ts b/src/lib/auth.svelte.ts
index 43f1ea97..73ebb0c1 100644
--- a/src/lib/auth.svelte.ts
+++ b/src/lib/auth.svelte.ts
@@ -5,20 +5,16 @@ import {
isAdmin,
} from '$lib/components/lemmy/moderation/moderation.js'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
-import { client, getClient } from '$lib/lemmy.svelte.js'
+import { client, getClient, site } from '$lib/client/lemmy.svelte'
import { instanceToURL, moveItem } from '$lib/util.svelte'
import { MINIMUM_VERSION, versionIsSupported } from '$lib/version.js'
-import {
- type Community,
- type GetSiteResponse,
- type MyUserInfo,
-} from 'lemmy-js-client'
import { toast } from 'mono-svelte'
import { writable } from 'svelte/store'
import { t } from './i18n/translations'
-import { site } from './lemmy.svelte'
import { errorMessage } from './lemmy/error'
import { publishedToDate } from './components/util/date'
+import type { Community, GetSiteResponse, MyUserInfo } from './client/types'
+import { DEFAULT_CLIENT_TYPE, type ClientType } from './client/base'
function getFromStorage(key: string): T | undefined {
if (typeof localStorage == 'undefined') return undefined
@@ -42,6 +38,7 @@ export interface ProfileInfo {
avatar?: string
favorites?: Community[]
color?: string
+ client: ClientType
}
/**
@@ -78,6 +75,7 @@ class Profile {
instance: DEFAULT_INSTANCE_URL,
username: 'Guest',
color: '#505050',
+ client: DEFAULT_CLIENT_TYPE,
},
],
profile: 1,
@@ -92,6 +90,7 @@ class Profile {
return {
id: -1,
instance: DEFAULT_INSTANCE_URL,
+ client: DEFAULT_CLIENT_TYPE,
}
}
@@ -105,7 +104,11 @@ class Profile {
const jwt = getCookie('jwt')
if (jwt) {
;(async () => {
- const result = await this.add(jwt, env.PUBLIC_INSTANCE_URL ?? '')
+ const result = await this.add(
+ jwt,
+ env.PUBLIC_INSTANCE_URL ?? '',
+ DEFAULT_CLIENT_TYPE,
+ )
if (result)
toast({
@@ -221,7 +224,7 @@ class Profile {
}
}
- async add(jwt: string, instance: string) {
+ async add(jwt: string, instance: string, type: ClientType) {
const user = await userFromJwt(jwt, instance)
.then(u => u)
.catch(err => {
@@ -242,6 +245,7 @@ class Profile {
jwt: jwt,
username: user?.user?.local_user_view.person.name,
avatar: user?.user?.local_user_view.person.avatar,
+ client: type,
})
return user
diff --git a/src/lib/client/base.ts b/src/lib/client/base.ts
new file mode 100644
index 00000000..2a943c70
--- /dev/null
+++ b/src/lib/client/base.ts
@@ -0,0 +1,238 @@
+import { env } from '$env/dynamic/public'
+import * as types from './types'
+
+export type ClientType =
+ | { name: 'lemmy'; baseUrl: '/api/v3' }
+ | { name: 'piefed'; baseUrl: '/api/alpha' }
+
+export const DEFAULT_CLIENT_TYPE: ClientType =
+ env.PUBLIC_INSTANCE_TYPE == 'piefedalpha'
+ ? {
+ name: 'piefed',
+ baseUrl: '/api/alpha',
+ }
+ : {
+ name: 'lemmy',
+ baseUrl: '/api/v3',
+ }
+
+export abstract class BaseClient {
+ abstract type: ClientType
+
+ abstract getSite(): Promise
+ abstract generateTotpSecret(): Promise
+ abstract listLogins(): Promise
+ abstract listAllMedia(form: types.ListMedia): Promise
+ abstract updateTotp(form: types.UpdateTotp): Promise
+ abstract getModlog(form: types.GetModlog): Promise
+ abstract search(form: types.Search): Promise
+ abstract resolveObject(
+ form: types.ResolveObject,
+ ): Promise
+ abstract createCommunity(
+ form: types.CreateCommunity,
+ ): Promise
+ abstract getCommunity(
+ form: types.GetCommunity,
+ ): Promise
+ abstract editCommunity(
+ form: types.EditCommunity,
+ ): Promise
+ abstract listCommunities(
+ form: types.ListCommunities,
+ ): Promise
+ abstract followCommunity(
+ form: types.FollowCommunity,
+ ): Promise
+ abstract blockCommunity(
+ form: types.BlockCommunity,
+ ): Promise
+ abstract deleteCommunity(
+ form: types.DeleteCommunity,
+ ): Promise
+ abstract hideCommunity(
+ form: types.HideCommunity,
+ ): Promise
+ abstract removeCommunity(
+ form: types.RemoveCommunity,
+ ): Promise
+ abstract banFromCommunity(
+ form: types.BanFromCommunity,
+ ): Promise
+ abstract addModToCommunity(
+ form: types.AddModToCommunity,
+ ): Promise
+ abstract createPost(form: types.CreatePost): Promise
+ abstract getPost(form: types.GetPost): Promise
+ abstract editPost(form: types.EditPost): Promise
+ abstract deletePost(form: types.DeletePost): Promise
+ abstract removePost(form: types.RemovePost): Promise
+ abstract markPostAsRead(
+ form: types.MarkPostAsRead,
+ ): Promise
+ abstract hidePost(form: types.HidePost): Promise
+ abstract lockPost(form: types.LockPost): Promise
+ abstract featurePost(form: types.FeaturePost): Promise
+ abstract getPosts(form: types.GetPosts): Promise
+ abstract likePost(form: types.CreatePostLike): Promise
+ abstract listPostLikes(
+ form: types.ListPostLikes,
+ ): Promise
+ abstract savePost(form: types.SavePost): Promise
+ // TODO should unify these reports probably
+ abstract createPostReport(
+ form: types.CreatePostReport,
+ ): Promise
+ abstract resolvePostReport(
+ form: types.ResolvePostReport,
+ ): Promise
+ abstract listPostReports(
+ form: types.ListPostReports,
+ ): Promise
+ abstract getSiteMetadata(
+ form: types.GetSiteMetadata,
+ ): Promise
+ abstract createComment(
+ form: types.CreateComment,
+ ): Promise
+ abstract editComment(form: types.EditComment): Promise
+ abstract deleteComment(
+ form: types.DeleteComment,
+ ): Promise
+ abstract removeComment(
+ form: types.RemoveComment,
+ ): Promise
+ abstract markCommentReplyAsRead(
+ form: types.MarkCommentReplyAsRead,
+ ): Promise
+ abstract likeComment(
+ form: types.CreateCommentLike,
+ ): Promise
+ abstract listCommentLikes(
+ form: types.ListCommentLikes,
+ ): Promise
+ // TODO unify saving with posts too
+ // i have options for unifying these since I'm making the API client myself now
+ abstract saveComment(form: types.SaveComment): Promise
+ abstract distinguishComment(
+ form: types.DistinguishComment,
+ ): Promise
+ abstract getComments(
+ form: types.GetComments,
+ ): Promise
+ abstract getComment(form: types.GetComment): Promise
+ abstract createCommentReport(
+ form: types.CreateCommentReport,
+ ): Promise
+ abstract resolveCommentReport(
+ form: types.ResolveCommentReport,
+ ): Promise
+ abstract listCommentReports(
+ form: types.ListCommentReports,
+ ): Promise
+ abstract getPrivateMessages(
+ form: types.GetPrivateMessages,
+ ): Promise
+ abstract createPrivateMessage(
+ form: types.CreatePrivateMessage,
+ ): Promise
+ abstract editPrivateMessage(
+ form: types.EditPrivateMessage,
+ ): Promise
+ abstract deletePrivateMessage(
+ form: types.DeletePrivateMessage,
+ ): Promise
+ abstract markPrivateMessageAsRead(
+ form: types.MarkPrivateMessageAsRead,
+ ): Promise
+ abstract createPrivateMessageReport(
+ form: types.CreatePrivateMessageReport,
+ ): Promise
+ abstract resolvePrivateMessageReport(
+ form: types.ResolvePrivateMessageReport,
+ ): Promise
+ abstract listPrivateMessageReports(
+ form: types.ListPrivateMessageReports,
+ ): Promise
+ abstract register(form: types.Register): Promise
+ abstract login(form: types.Login): Promise
+ abstract logout(): Promise
+ abstract getPersonDetails(
+ form: types.GetPersonDetails,
+ ): Promise
+ // TODO unify these inbox things too
+ abstract getPersonMentions(
+ form: types.GetPersonMentions,
+ ): Promise
+ abstract markPersonMentionAsRead(
+ form: types.MarkPersonMentionAsRead,
+ ): Promise
+ abstract getReplies(form: types.GetReplies): Promise
+ abstract banPerson(form: types.BanPerson): Promise
+ abstract getBannedPersons(): Promise
+ abstract blockPerson(
+ form: types.BlockPerson,
+ ): Promise
+ abstract getCaptcha(): Promise
+ abstract deleteAccount(
+ form: types.DeleteAccount,
+ ): Promise
+ abstract passwordReset(
+ form: types.PasswordReset,
+ ): Promise
+ abstract passwordChangeAfterReset(
+ form: types.PasswordChangeAfterReset,
+ ): Promise
+ abstract markAllAsRead(): Promise
+ abstract saveUserSettings(
+ form: types.SaveUserSettings,
+ ): Promise
+ abstract changePassword(
+ form: types.ChangePassword,
+ ): Promise
+ abstract getReportCount(
+ form: types.GetReportCount,
+ ): Promise
+ abstract getUnreadCount(): Promise
+ abstract verifyEmail(form: types.VerifyEmail): Promise
+ abstract addAdmin(form: types.AddAdmin): Promise
+ abstract getUnreadRegistrationApplicationCount(): Promise
+ abstract listRegistrationApplications(
+ form: types.ListRegistrationApplications,
+ ): Promise
+ abstract approveRegistrationApplication(
+ form: types.ApproveRegistrationApplication,
+ ): Promise
+ abstract getRegistrationApplication(
+ form: types.GetRegistrationApplication,
+ ): Promise
+ abstract purgePerson(form: types.PurgePerson): Promise
+ abstract purgeCommunity(
+ form: types.PurgeCommunity,
+ ): Promise
+ abstract purgePost(form: types.PurgePost): Promise
+ abstract purgeComment(
+ form: types.PurgeComment,
+ ): Promise
+ abstract getFederatedInstances(): Promise
+ abstract blockInstance(
+ form: types.BlockInstance,
+ ): Promise
+ abstract uploadImage(
+ form: types.UploadImage,
+ ): Promise
+
+ abstract setFlair?(form: types.SetPersonFlair): Promise
+}
+
+export type NullableFnArg = T extends (
+ ...args: infer A
+) => any
+ ? A
+ : Fallback
+
+export type NullableFnReturn = T extends (
+ ...args: any[]
+) => infer A
+ ? A
+ : Fallback
diff --git a/src/lib/lemmy.svelte.ts b/src/lib/client/lemmy.svelte.ts
similarity index 59%
rename from src/lib/lemmy.svelte.ts
rename to src/lib/client/lemmy.svelte.ts
index a4eef268..17f83b5c 100644
--- a/src/lib/lemmy.svelte.ts
+++ b/src/lib/client/lemmy.svelte.ts
@@ -2,7 +2,10 @@ import { profile } from '$lib/auth.svelte'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
import { instanceToURL } from '$lib/util.svelte'
import { error } from '@sveltejs/kit'
-import { LemmyHttp, type GetSiteResponse } from 'lemmy-js-client'
+import { type GetSiteResponse } from '$lib/client/types'
+import { LemmyClient } from './lemmy/lemmy'
+import { PiefedClient } from './piefed/piefed'
+import { DEFAULT_CLIENT_TYPE, type ClientType, BaseClient } from './base'
class SiteData {
#data = $state()
@@ -52,6 +55,7 @@ export function client({
instanceURL,
func,
auth,
+ clientType,
}: {
instanceURL?: string
func?: (
@@ -59,22 +63,30 @@ export function client({
init?: RequestInit | undefined,
) => Promise
auth?: string
-} = {}) {
+ clientType?: ClientType
+} = {}): BaseClient {
if (!instanceURL)
instanceURL = profile.current.instance || DEFAULT_INSTANCE_URL
+ if (!clientType) {
+ clientType = profile.current.client ?? DEFAULT_CLIENT_TYPE
+ }
+
// we use nullish coealsiaihsa something so that
// we can set auth = '' to remove it
+
const jwt = auth ?? profile.current?.jwt
// but not here, so that if jwt == '', it doesnt put a bearer
const headers = jwt ? { authorization: `Bearer ${jwt}` } : {}
- return new LemmyHttp(instanceToURL(instanceURL), {
- fetchFunction: (input, init) => customFetch(func, input, init, jwt),
- // @ts-expect-error headers thing
- headers: headers,
- })
+ return new (clientType.name == 'piefed' ? PiefedClient : LemmyClient)(
+ instanceToURL(instanceURL),
+ {
+ fetchFunction: (input, init) => customFetch(func, input, init, jwt),
+ headers: headers,
+ },
+ )
}
// here for parts where i forgor to switch
@@ -85,49 +97,25 @@ export function getClient(
init?: RequestInit | undefined,
) => Promise,
auth?: string,
-): LemmyHttp {
+) {
return client({ instanceURL, func, auth })
}
-export async function validateInstance(instance: string): Promise {
+export async function validateInstance(
+ instance: string,
+ type: ClientType,
+): Promise {
if (instance == '') return false
try {
- await client({ instanceURL: instance, auth: '' }).getSite()
+ await client({
+ instanceURL: instance,
+ clientType: type,
+ auth: '',
+ }).getSite()
return true
} catch {
return false
}
}
-
-export function mayBeIncompatible(
- minVersion: string,
- availableVersion: string,
-) {
- if (minVersion.valueOf() === availableVersion.valueOf()) return false
-
- const versionFormatter = /[\d.]/
- if (
- !minVersion.match(versionFormatter) ||
- !availableVersion.match(availableVersion)
- ) {
- return true
- }
-
- const splitMinVersion = minVersion.split('.')
- const splitAvailableVersion = availableVersion.split('.')
-
- if (splitMinVersion.length !== splitAvailableVersion.length) return true
-
- for (let i = 0; i < splitMinVersion.length; ++i) {
- const minVersionDigit = parseInt(splitMinVersion[i])
- const availableVersionDigit = parseInt(splitAvailableVersion[i])
-
- if (availableVersionDigit === undefined) return true
- if (minVersionDigit < availableVersionDigit) return false
- if (availableVersionDigit < minVersionDigit) return true
- }
-
- return false
-}
diff --git a/src/lib/client/lemmy/lemmy.ts b/src/lib/client/lemmy/lemmy.ts
new file mode 100644
index 00000000..0be24707
--- /dev/null
+++ b/src/lib/client/lemmy/lemmy.ts
@@ -0,0 +1,479 @@
+import { LemmyHttp } from 'lemmy-js-client'
+import type { BaseClient, ClientType } from '../base'
+import { fromGetPosts, toListingType } from './rewrite'
+
+export class LemmyClient implements BaseClient {
+ type: ClientType = { name: 'lemmy', baseUrl: '/api/v3' }
+
+ #client: LemmyHttp
+
+ constructor(
+ baseUrl: string,
+ args: {
+ fetchFunction: (input: any, init: any) => Promise
+ headers: any
+ },
+ ) {
+ this.#client = new LemmyHttp(baseUrl, args)
+ }
+
+ async getSite(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getSite(...params)
+ }
+ async generateTotpSecret(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.generateTotpSecret(...params)
+ }
+ async listLogins(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listLogins(...params)
+ }
+ async listAllMedia(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listAllMedia(...params)
+ }
+ async updateTotp(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.updateTotp(...params)
+ }
+ async getModlog(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getModlog(...params)
+ }
+ async search(
+ params: Parameters[0],
+ ): ReturnType {
+ return await this.#client.search({
+ ...params,
+ listing_type: toListingType(params.listing_type),
+ })
+ }
+ async resolveObject(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.resolveObject(...params)
+ }
+ async createCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createCommunity(...params)
+ }
+ async getCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getCommunity(...params)
+ }
+ async editCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.editCommunity(...params)
+ }
+ async listCommunities(
+ params: Parameters[0],
+ ): ReturnType {
+ return await this.#client.listCommunities({
+ ...params,
+ type_: toListingType(params.type_),
+ })
+ }
+ async followCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.followCommunity(...params)
+ }
+ async blockCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.blockCommunity(...params)
+ }
+ async deleteCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.deleteCommunity(...params)
+ }
+ async hideCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.hideCommunity(...params)
+ }
+ async removeCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.removeCommunity(...params)
+ }
+ async banFromCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.banFromCommunity(...params)
+ }
+ async addModToCommunity(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.addModToCommunity(...params)
+ }
+ async createPost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createPost(...params)
+ }
+ async getPost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getPost(...params)
+ }
+ async editPost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.editPost(...params)
+ }
+ async deletePost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.deletePost(...params)
+ }
+ async removePost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.removePost(...params)
+ }
+ async markPostAsRead(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.markPostAsRead(...params)
+ }
+ async hidePost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.hidePost(...params)
+ }
+ async lockPost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.lockPost(...params)
+ }
+ async featurePost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.featurePost(...params)
+ }
+ async getPosts(
+ params: Parameters[0],
+ ): ReturnType {
+ return await this.#client.getPosts(fromGetPosts(params))
+ }
+ async likePost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.likePost(...params)
+ }
+ async listPostLikes(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listPostLikes(...params)
+ }
+ async savePost(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.savePost(...params)
+ }
+ async createPostReport(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createPostReport(...params)
+ }
+ async resolvePostReport(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.resolvePostReport(...params)
+ }
+ async listPostReports(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listPostReports(...params)
+ }
+ async getSiteMetadata(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getSiteMetadata(...params)
+ }
+ async createComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createComment(...params)
+ }
+ async editComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.editComment(...params)
+ }
+ async deleteComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.deleteComment(...params)
+ }
+ async removeComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.removeComment(...params)
+ }
+ async markCommentReplyAsRead(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.markCommentReplyAsRead(...params)
+ }
+ async likeComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.likeComment(...params)
+ }
+ async listCommentLikes(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listCommentLikes(...params)
+ }
+ async saveComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.saveComment(...params)
+ }
+ async distinguishComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.distinguishComment(...params)
+ }
+ async getComments(
+ params: Parameters[0],
+ ): ReturnType {
+ return await this.#client.getComments({
+ ...params,
+ type_: toListingType(params.type_),
+ })
+ }
+ async getComment(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getComment(...params)
+ }
+ async createCommentReport(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createCommentReport(...params)
+ }
+ async resolveCommentReport(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.resolveCommentReport(...params)
+ }
+ async listCommentReports(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listCommentReports(...params)
+ }
+ async getPrivateMessages(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getPrivateMessages(...params)
+ }
+ async createPrivateMessage(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createPrivateMessage(...params)
+ }
+ async editPrivateMessage(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.editPrivateMessage(...params)
+ }
+ async deletePrivateMessage(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.deletePrivateMessage(...params)
+ }
+ async markPrivateMessageAsRead(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.markPrivateMessageAsRead(...params)
+ }
+ async createPrivateMessageReport(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.createPrivateMessageReport(...params)
+ }
+ async resolvePrivateMessageReport(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.resolvePrivateMessageReport(...params)
+ }
+ async listPrivateMessageReports(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.listPrivateMessageReports(...params)
+ }
+ async register(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.register(...params)
+ }
+ async login(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.login(...params)
+ }
+ async logout(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.logout(...params)
+ }
+ async getPersonDetails(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getPersonDetails(...params)
+ }
+ async getPersonMentions(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getPersonMentions(...params)
+ }
+ async markPersonMentionAsRead(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.markPersonMentionAsRead(...params)
+ }
+ async getReplies(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getReplies(...params)
+ }
+ async banPerson(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.banPerson(...params)
+ }
+ async getBannedPersons(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getBannedPersons(...params)
+ }
+ async blockPerson(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.blockPerson(...params)
+ }
+ async getCaptcha(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getCaptcha(...params)
+ }
+ async deleteAccount(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.deleteAccount(...params)
+ }
+ async passwordReset(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.passwordReset(...params)
+ }
+ async passwordChangeAfterReset(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.passwordChangeAfterReset(...params)
+ }
+ async markAllAsRead(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.markAllAsRead(...params)
+ }
+ async saveUserSettings(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.saveUserSettings(...params)
+ }
+ async changePassword(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.changePassword(...params)
+ }
+ async getReportCount(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getReportCount(...params)
+ }
+ async getUnreadCount(
+ ...params: Parameters
+ ): ReturnType {
+ return await this.#client.getUnreadCount(...params)
+ }
+ async verifyEmail(
+ ...params: Parameters