stage2: add piefed client
This commit is contained in:
137 files changed
+6698
-530
No files matched your search
@@ -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",
|
||||
|
||||
+18
-8
@@ -5,19 +5,21 @@ import {
|
||||
isAdmin,
|
||||
} from '$lib/components/lemmy/moderation/moderation.js'
|
||||
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||
import { client, getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import {
|
||||
client,
|
||||
getClient,
|
||||
site,
|
||||
type ClientType,
|
||||
DEFAULT_CLIENT_TYPE,
|
||||
} 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 { errorMessage } from './lemmy/error'
|
||||
import { publishedToDate } from './components/util/date'
|
||||
import type { Community, GetSiteResponse, MyUserInfo } from './client/types'
|
||||
|
||||
function getFromStorage<T>(key: string): T | undefined {
|
||||
if (typeof localStorage == 'undefined') return undefined
|
||||
@@ -41,6 +43,7 @@ export interface ProfileInfo {
|
||||
avatar?: string
|
||||
favorites?: Community[]
|
||||
color?: string
|
||||
client: ClientType
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,6 +80,7 @@ class Profile {
|
||||
instance: DEFAULT_INSTANCE_URL,
|
||||
username: 'Guest',
|
||||
color: '#505050',
|
||||
client: DEFAULT_CLIENT_TYPE,
|
||||
},
|
||||
],
|
||||
profile: 1,
|
||||
@@ -91,6 +95,7 @@ class Profile {
|
||||
return {
|
||||
id: -1,
|
||||
instance: DEFAULT_INSTANCE_URL,
|
||||
client: DEFAULT_CLIENT_TYPE,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +109,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({
|
||||
@@ -220,7 +229,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 => {
|
||||
@@ -241,6 +250,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
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { ClientType } from './lemmy.svelte'
|
||||
import * as types from './types'
|
||||
|
||||
export abstract class BaseClient {
|
||||
static type: 'lemmy' | 'piefed'
|
||||
static type: ClientType
|
||||
|
||||
abstract getSite(): Promise<types.GetSiteResponse>
|
||||
abstract generateTotpSecret(): Promise<types.GenerateTotpSecretResponse>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { instanceToURL } from '$lib/util.svelte'
|
||||
import { error } from '@sveltejs/kit'
|
||||
import { type GetSiteResponse } from 'lemmy-js-client'
|
||||
import { LemmyClient } from './lemmy/lemmy'
|
||||
import { PiefedClient } from './piefed/piefed'
|
||||
|
||||
class SiteData {
|
||||
#data = $state<GetSiteResponse>()
|
||||
@@ -53,6 +54,7 @@ export function client({
|
||||
instanceURL,
|
||||
func,
|
||||
auth,
|
||||
clientType,
|
||||
}: {
|
||||
instanceURL?: string
|
||||
func?: (
|
||||
@@ -60,18 +62,26 @@ export function client({
|
||||
init?: RequestInit | undefined,
|
||||
) => Promise<Response>
|
||||
auth?: string
|
||||
clientType?: ClientType
|
||||
} = {}) {
|
||||
if (!instanceURL)
|
||||
instanceURL = profile.current.instance || DEFAULT_INSTANCE_URL
|
||||
|
||||
if (!clientType) {
|
||||
clientType = profile.current.client
|
||||
}
|
||||
|
||||
const jwt = auth ? auth : profile.current?.jwt
|
||||
|
||||
const headers = jwt ? { authorization: `Bearer ${jwt}` } : {}
|
||||
|
||||
return new LemmyClient(instanceToURL(instanceURL), {
|
||||
fetchFunction: (input, init) => customFetch(func, input, init, jwt),
|
||||
headers: headers,
|
||||
})
|
||||
return new (clientType.name == 'piefed' ? PiefedClient : LemmyClient)(
|
||||
instanceToURL(instanceURL),
|
||||
{
|
||||
fetchFunction: (input, init) => customFetch(func, input, init, jwt),
|
||||
headers: headers,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export function getClient(
|
||||
@@ -127,3 +137,12 @@ export function mayBeIncompatible(
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
export type ClientType =
|
||||
| { name: 'lemmy'; baseUrl: '/api/v3' }
|
||||
| { name: 'piefed'; baseUrl: '/api/alpha' }
|
||||
|
||||
export const DEFAULT_CLIENT_TYPE: ClientType = {
|
||||
name: 'lemmy',
|
||||
baseUrl: '/api/v3',
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
import { LemmyHttp } from 'lemmy-js-client'
|
||||
import type { BaseClient } from '../base'
|
||||
import { fromGetPosts, toListingType } from './rewrite'
|
||||
|
||||
export class LemmyClient implements BaseClient {
|
||||
static type = 'lemmy'
|
||||
static type = { name: 'lemmy', baseUrl: '/api/v3' }
|
||||
|
||||
#client: LemmyHttp
|
||||
|
||||
@@ -47,9 +48,12 @@ export class LemmyClient implements BaseClient {
|
||||
return await this.#client.getModlog(...params)
|
||||
}
|
||||
async search(
|
||||
...params: Parameters<BaseClient['search']>
|
||||
params: Parameters<BaseClient['search']>[0],
|
||||
): ReturnType<BaseClient['search']> {
|
||||
return await this.#client.search(...params)
|
||||
return await this.#client.search({
|
||||
...params,
|
||||
listing_type: toListingType(params.listing_type),
|
||||
})
|
||||
}
|
||||
async resolveObject(
|
||||
...params: Parameters<BaseClient['resolveObject']>
|
||||
@@ -72,9 +76,12 @@ export class LemmyClient implements BaseClient {
|
||||
return await this.#client.editCommunity(...params)
|
||||
}
|
||||
async listCommunities(
|
||||
...params: Parameters<BaseClient['listCommunities']>
|
||||
params: Parameters<BaseClient['listCommunities']>[0],
|
||||
): ReturnType<BaseClient['listCommunities']> {
|
||||
return await this.#client.listCommunities(...params)
|
||||
return await this.#client.listCommunities({
|
||||
...params,
|
||||
type_: toListingType(params.type_),
|
||||
})
|
||||
}
|
||||
async followCommunity(
|
||||
...params: Parameters<BaseClient['followCommunity']>
|
||||
@@ -157,9 +164,9 @@ export class LemmyClient implements BaseClient {
|
||||
return await this.#client.featurePost(...params)
|
||||
}
|
||||
async getPosts(
|
||||
...params: Parameters<BaseClient['getPosts']>
|
||||
params: Parameters<BaseClient['getPosts']>[0],
|
||||
): ReturnType<BaseClient['getPosts']> {
|
||||
return await this.#client.getPosts(...params)
|
||||
return await this.#client.getPosts(fromGetPosts(params))
|
||||
}
|
||||
async likePost(
|
||||
...params: Parameters<BaseClient['likePost']>
|
||||
@@ -242,9 +249,12 @@ export class LemmyClient implements BaseClient {
|
||||
return await this.#client.distinguishComment(...params)
|
||||
}
|
||||
async getComments(
|
||||
...params: Parameters<BaseClient['getComments']>
|
||||
params: Parameters<BaseClient['getComments']>[0],
|
||||
): ReturnType<BaseClient['getComments']> {
|
||||
return await this.#client.getComments(...params)
|
||||
return await this.#client.getComments({
|
||||
...params,
|
||||
type_: toListingType(params.type_),
|
||||
})
|
||||
}
|
||||
async getComment(
|
||||
...params: Parameters<BaseClient['getComment']>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import * as lemmy from 'lemmy-js-client'
|
||||
import type { GetPosts, ListingType } from '../types'
|
||||
|
||||
export function fromGetPosts(getPosts: GetPosts): lemmy.GetPosts {
|
||||
return {
|
||||
...getPosts,
|
||||
type_: getPosts.type_ == 'Popular' ? 'All' : getPosts.type_,
|
||||
}
|
||||
}
|
||||
|
||||
export function toListingType(
|
||||
listingType?: ListingType,
|
||||
): lemmy.ListingType | undefined {
|
||||
if (listingType == 'Popular') listingType = 'All'
|
||||
return listingType
|
||||
}
|
||||
@@ -0,0 +1,520 @@
|
||||
import createClient from 'openapi-fetch'
|
||||
import type { BaseClient } from '../base'
|
||||
import {
|
||||
fromGetPosts,
|
||||
toLocalSite,
|
||||
toMyUser,
|
||||
toPersonView,
|
||||
toPostView,
|
||||
} from './rewrite'
|
||||
import type { paths } from './schema'
|
||||
|
||||
export class PiefedClient implements BaseClient {
|
||||
static type = { name: 'piefed', baseUrl: '/api/alpha' }
|
||||
|
||||
#client: ReturnType<typeof createClient<paths>>
|
||||
|
||||
constructor(
|
||||
baseUrl: string,
|
||||
args: {
|
||||
fetchFunction: (input: any, init: any) => Promise<any>
|
||||
headers: any
|
||||
},
|
||||
) {
|
||||
this.#client = createClient({
|
||||
baseUrl: `${baseUrl}/api/alpha`,
|
||||
// @ts-expect-error i dont feel like fixing this right now
|
||||
fetch: args.fetchFunction,
|
||||
headers: args.headers,
|
||||
})
|
||||
}
|
||||
|
||||
async getSite(): ReturnType<BaseClient['getSite']> {
|
||||
// throw new Error('Unimplemented')
|
||||
|
||||
const response = (await this.#client.GET('/site')).data!
|
||||
|
||||
return {
|
||||
admins: response.admins.map(toPersonView),
|
||||
site_view: {
|
||||
counts: {
|
||||
comments: -1,
|
||||
communities: -1,
|
||||
posts: -1,
|
||||
site_id: -1,
|
||||
users: response.site.user_count ?? -1,
|
||||
users_active_day: -1,
|
||||
users_active_half_year: -1,
|
||||
users_active_month: -1,
|
||||
users_active_week: -1,
|
||||
},
|
||||
local_site: toLocalSite(response.site),
|
||||
site: response.site,
|
||||
},
|
||||
all_languages:
|
||||
(response.site.all_languages as {
|
||||
code: string
|
||||
id: number
|
||||
name: string
|
||||
}[]) ?? [],
|
||||
blocked_urls: [],
|
||||
custom_emojis: [],
|
||||
discussion_languages: [],
|
||||
taglines: [],
|
||||
version: response.version,
|
||||
my_user: response.my_user ? toMyUser(response.my_user) : undefined,
|
||||
}
|
||||
}
|
||||
|
||||
async createPost(
|
||||
...params: Parameters<BaseClient['createPost']>
|
||||
): ReturnType<BaseClient['createPost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getPost(
|
||||
...params: Parameters<BaseClient['getPost']>
|
||||
): ReturnType<BaseClient['getPost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async editPost(
|
||||
...params: Parameters<BaseClient['editPost']>
|
||||
): ReturnType<BaseClient['editPost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async deletePost(
|
||||
...params: Parameters<BaseClient['deletePost']>
|
||||
): ReturnType<BaseClient['deletePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async removePost(
|
||||
...params: Parameters<BaseClient['removePost']>
|
||||
): ReturnType<BaseClient['removePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
|
||||
async getPosts(
|
||||
params: Parameters<BaseClient['getPosts']>[0],
|
||||
): ReturnType<BaseClient['getPosts']> {
|
||||
const response = (
|
||||
await this.#client.GET('/post/list', {
|
||||
params: fromGetPosts(params),
|
||||
})
|
||||
).data!
|
||||
|
||||
return {
|
||||
posts: response.posts.map(toPostView),
|
||||
next_page: (Number(params.page_cursor ?? 1) + 1).toString(),
|
||||
}
|
||||
}
|
||||
async likePost(
|
||||
...params: Parameters<BaseClient['likePost']>
|
||||
): ReturnType<BaseClient['likePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
|
||||
async generateTotpSecret(
|
||||
...params: Parameters<BaseClient['generateTotpSecret']>
|
||||
): ReturnType<BaseClient['generateTotpSecret']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listLogins(
|
||||
...params: Parameters<BaseClient['listLogins']>
|
||||
): ReturnType<BaseClient['listLogins']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listAllMedia(
|
||||
...params: Parameters<BaseClient['listAllMedia']>
|
||||
): ReturnType<BaseClient['listAllMedia']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async updateTotp(
|
||||
...params: Parameters<BaseClient['updateTotp']>
|
||||
): ReturnType<BaseClient['updateTotp']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getModlog(
|
||||
...params: Parameters<BaseClient['getModlog']>
|
||||
): ReturnType<BaseClient['getModlog']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async search(
|
||||
...params: Parameters<BaseClient['search']>
|
||||
): ReturnType<BaseClient['search']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async resolveObject(
|
||||
...params: Parameters<BaseClient['resolveObject']>
|
||||
): ReturnType<BaseClient['resolveObject']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async createCommunity(
|
||||
...params: Parameters<BaseClient['createCommunity']>
|
||||
): ReturnType<BaseClient['createCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getCommunity(
|
||||
...params: Parameters<BaseClient['getCommunity']>
|
||||
): ReturnType<BaseClient['getCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async editCommunity(
|
||||
...params: Parameters<BaseClient['editCommunity']>
|
||||
): ReturnType<BaseClient['editCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listCommunities(
|
||||
...params: Parameters<BaseClient['listCommunities']>
|
||||
): ReturnType<BaseClient['listCommunities']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async followCommunity(
|
||||
...params: Parameters<BaseClient['followCommunity']>
|
||||
): ReturnType<BaseClient['followCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async blockCommunity(
|
||||
...params: Parameters<BaseClient['blockCommunity']>
|
||||
): ReturnType<BaseClient['blockCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async deleteCommunity(
|
||||
...params: Parameters<BaseClient['deleteCommunity']>
|
||||
): ReturnType<BaseClient['deleteCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async hideCommunity(
|
||||
...params: Parameters<BaseClient['hideCommunity']>
|
||||
): ReturnType<BaseClient['hideCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async removeCommunity(
|
||||
...params: Parameters<BaseClient['removeCommunity']>
|
||||
): ReturnType<BaseClient['removeCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async banFromCommunity(
|
||||
...params: Parameters<BaseClient['banFromCommunity']>
|
||||
): ReturnType<BaseClient['banFromCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async addModToCommunity(
|
||||
...params: Parameters<BaseClient['addModToCommunity']>
|
||||
): ReturnType<BaseClient['addModToCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async markPostAsRead(
|
||||
...params: Parameters<BaseClient['markPostAsRead']>
|
||||
): ReturnType<BaseClient['markPostAsRead']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async hidePost(
|
||||
...params: Parameters<BaseClient['hidePost']>
|
||||
): ReturnType<BaseClient['hidePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async lockPost(
|
||||
...params: Parameters<BaseClient['lockPost']>
|
||||
): ReturnType<BaseClient['lockPost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async featurePost(
|
||||
...params: Parameters<BaseClient['featurePost']>
|
||||
): ReturnType<BaseClient['featurePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listPostLikes(
|
||||
...params: Parameters<BaseClient['listPostLikes']>
|
||||
): ReturnType<BaseClient['listPostLikes']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async savePost(
|
||||
...params: Parameters<BaseClient['savePost']>
|
||||
): ReturnType<BaseClient['savePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async createPostReport(
|
||||
...params: Parameters<BaseClient['createPostReport']>
|
||||
): ReturnType<BaseClient['createPostReport']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async resolvePostReport(
|
||||
...params: Parameters<BaseClient['resolvePostReport']>
|
||||
): ReturnType<BaseClient['resolvePostReport']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listPostReports(
|
||||
...params: Parameters<BaseClient['listPostReports']>
|
||||
): ReturnType<BaseClient['listPostReports']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getSiteMetadata(
|
||||
...params: Parameters<BaseClient['getSiteMetadata']>
|
||||
): ReturnType<BaseClient['getSiteMetadata']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async createComment(
|
||||
...params: Parameters<BaseClient['createComment']>
|
||||
): ReturnType<BaseClient['createComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async editComment(
|
||||
...params: Parameters<BaseClient['editComment']>
|
||||
): ReturnType<BaseClient['editComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async deleteComment(
|
||||
...params: Parameters<BaseClient['deleteComment']>
|
||||
): ReturnType<BaseClient['deleteComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async removeComment(
|
||||
...params: Parameters<BaseClient['removeComment']>
|
||||
): ReturnType<BaseClient['removeComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async markCommentReplyAsRead(
|
||||
...params: Parameters<BaseClient['markCommentReplyAsRead']>
|
||||
): ReturnType<BaseClient['markCommentReplyAsRead']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async likeComment(
|
||||
...params: Parameters<BaseClient['likeComment']>
|
||||
): ReturnType<BaseClient['likeComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listCommentLikes(
|
||||
...params: Parameters<BaseClient['listCommentLikes']>
|
||||
): ReturnType<BaseClient['listCommentLikes']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async saveComment(
|
||||
...params: Parameters<BaseClient['saveComment']>
|
||||
): ReturnType<BaseClient['saveComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async distinguishComment(
|
||||
...params: Parameters<BaseClient['distinguishComment']>
|
||||
): ReturnType<BaseClient['distinguishComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getComments(
|
||||
...params: Parameters<BaseClient['getComments']>
|
||||
): ReturnType<BaseClient['getComments']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getComment(
|
||||
...params: Parameters<BaseClient['getComment']>
|
||||
): ReturnType<BaseClient['getComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async createCommentReport(
|
||||
...params: Parameters<BaseClient['createCommentReport']>
|
||||
): ReturnType<BaseClient['createCommentReport']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async resolveCommentReport(
|
||||
...params: Parameters<BaseClient['resolveCommentReport']>
|
||||
): ReturnType<BaseClient['resolveCommentReport']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listCommentReports(
|
||||
...params: Parameters<BaseClient['listCommentReports']>
|
||||
): ReturnType<BaseClient['listCommentReports']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getPrivateMessages(
|
||||
...params: Parameters<BaseClient['getPrivateMessages']>
|
||||
): ReturnType<BaseClient['getPrivateMessages']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async createPrivateMessage(
|
||||
...params: Parameters<BaseClient['createPrivateMessage']>
|
||||
): ReturnType<BaseClient['createPrivateMessage']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async editPrivateMessage(
|
||||
...params: Parameters<BaseClient['editPrivateMessage']>
|
||||
): ReturnType<BaseClient['editPrivateMessage']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async deletePrivateMessage(
|
||||
...params: Parameters<BaseClient['deletePrivateMessage']>
|
||||
): ReturnType<BaseClient['deletePrivateMessage']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async markPrivateMessageAsRead(
|
||||
...params: Parameters<BaseClient['markPrivateMessageAsRead']>
|
||||
): ReturnType<BaseClient['markPrivateMessageAsRead']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async createPrivateMessageReport(
|
||||
...params: Parameters<BaseClient['createPrivateMessageReport']>
|
||||
): ReturnType<BaseClient['createPrivateMessageReport']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async resolvePrivateMessageReport(
|
||||
...params: Parameters<BaseClient['resolvePrivateMessageReport']>
|
||||
): ReturnType<BaseClient['resolvePrivateMessageReport']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listPrivateMessageReports(
|
||||
...params: Parameters<BaseClient['listPrivateMessageReports']>
|
||||
): ReturnType<BaseClient['listPrivateMessageReports']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async register(
|
||||
...params: Parameters<BaseClient['register']>
|
||||
): ReturnType<BaseClient['register']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async login(
|
||||
...params: Parameters<BaseClient['login']>
|
||||
): ReturnType<BaseClient['login']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async logout(
|
||||
...params: Parameters<BaseClient['logout']>
|
||||
): ReturnType<BaseClient['logout']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getPersonDetails(
|
||||
...params: Parameters<BaseClient['getPersonDetails']>
|
||||
): ReturnType<BaseClient['getPersonDetails']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getPersonMentions(
|
||||
...params: Parameters<BaseClient['getPersonMentions']>
|
||||
): ReturnType<BaseClient['getPersonMentions']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async markPersonMentionAsRead(
|
||||
...params: Parameters<BaseClient['markPersonMentionAsRead']>
|
||||
): ReturnType<BaseClient['markPersonMentionAsRead']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getReplies(
|
||||
...params: Parameters<BaseClient['getReplies']>
|
||||
): ReturnType<BaseClient['getReplies']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async banPerson(
|
||||
...params: Parameters<BaseClient['banPerson']>
|
||||
): ReturnType<BaseClient['banPerson']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getBannedPersons(
|
||||
...params: Parameters<BaseClient['getBannedPersons']>
|
||||
): ReturnType<BaseClient['getBannedPersons']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async blockPerson(
|
||||
...params: Parameters<BaseClient['blockPerson']>
|
||||
): ReturnType<BaseClient['blockPerson']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getCaptcha(
|
||||
...params: Parameters<BaseClient['getCaptcha']>
|
||||
): ReturnType<BaseClient['getCaptcha']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async deleteAccount(
|
||||
...params: Parameters<BaseClient['deleteAccount']>
|
||||
): ReturnType<BaseClient['deleteAccount']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async passwordReset(
|
||||
...params: Parameters<BaseClient['passwordReset']>
|
||||
): ReturnType<BaseClient['passwordReset']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async passwordChangeAfterReset(
|
||||
...params: Parameters<BaseClient['passwordChangeAfterReset']>
|
||||
): ReturnType<BaseClient['passwordChangeAfterReset']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async markAllAsRead(
|
||||
...params: Parameters<BaseClient['markAllAsRead']>
|
||||
): ReturnType<BaseClient['markAllAsRead']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async saveUserSettings(
|
||||
...params: Parameters<BaseClient['saveUserSettings']>
|
||||
): ReturnType<BaseClient['saveUserSettings']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async changePassword(
|
||||
...params: Parameters<BaseClient['changePassword']>
|
||||
): ReturnType<BaseClient['changePassword']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getReportCount(
|
||||
...params: Parameters<BaseClient['getReportCount']>
|
||||
): ReturnType<BaseClient['getReportCount']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getUnreadCount(
|
||||
...params: Parameters<BaseClient['getUnreadCount']>
|
||||
): ReturnType<BaseClient['getUnreadCount']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async verifyEmail(
|
||||
...params: Parameters<BaseClient['verifyEmail']>
|
||||
): ReturnType<BaseClient['verifyEmail']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async addAdmin(
|
||||
...params: Parameters<BaseClient['addAdmin']>
|
||||
): ReturnType<BaseClient['addAdmin']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getUnreadRegistrationApplicationCount(
|
||||
...params: Parameters<BaseClient['getUnreadRegistrationApplicationCount']>
|
||||
): ReturnType<BaseClient['getUnreadRegistrationApplicationCount']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async listRegistrationApplications(
|
||||
...params: Parameters<BaseClient['listRegistrationApplications']>
|
||||
): ReturnType<BaseClient['listRegistrationApplications']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async approveRegistrationApplication(
|
||||
...params: Parameters<BaseClient['approveRegistrationApplication']>
|
||||
): ReturnType<BaseClient['approveRegistrationApplication']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getRegistrationApplication(
|
||||
...params: Parameters<BaseClient['getRegistrationApplication']>
|
||||
): ReturnType<BaseClient['getRegistrationApplication']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async purgePerson(
|
||||
...params: Parameters<BaseClient['purgePerson']>
|
||||
): ReturnType<BaseClient['purgePerson']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async purgeCommunity(
|
||||
...params: Parameters<BaseClient['purgeCommunity']>
|
||||
): ReturnType<BaseClient['purgeCommunity']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async purgePost(
|
||||
...params: Parameters<BaseClient['purgePost']>
|
||||
): ReturnType<BaseClient['purgePost']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async purgeComment(
|
||||
...params: Parameters<BaseClient['purgeComment']>
|
||||
): ReturnType<BaseClient['purgeComment']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async getFederatedInstances(
|
||||
...params: Parameters<BaseClient['getFederatedInstances']>
|
||||
): ReturnType<BaseClient['getFederatedInstances']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
async blockInstance(
|
||||
...params: Parameters<BaseClient['blockInstance']>
|
||||
): ReturnType<BaseClient['blockInstance']> {
|
||||
throw new Error('Unimplemented')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
import type {
|
||||
Community,
|
||||
GetPosts,
|
||||
LocalSite,
|
||||
MyUserInfo,
|
||||
Person,
|
||||
PersonView,
|
||||
Post,
|
||||
PostView,
|
||||
SortType,
|
||||
} from '../types'
|
||||
import type { components, paths } from './schema'
|
||||
|
||||
export function toPersonView(
|
||||
personView: components['schemas']['PersonView'],
|
||||
): PersonView {
|
||||
return {
|
||||
counts: personView.counts,
|
||||
is_admin: personView.is_admin,
|
||||
person: toPerson(personView.person),
|
||||
}
|
||||
}
|
||||
|
||||
export function toPerson(person: components['schemas']['Person']): Person {
|
||||
return {
|
||||
...person,
|
||||
id: person.id,
|
||||
name: person.user_name,
|
||||
bot_account: person.bot,
|
||||
}
|
||||
}
|
||||
|
||||
export function toLocalSite(site: components['schemas']['Site']): LocalSite {
|
||||
if (site) return {}
|
||||
return {}
|
||||
}
|
||||
|
||||
export function toCommunity(
|
||||
community: components['schemas']['Community'],
|
||||
): Community {
|
||||
return {
|
||||
...community,
|
||||
posting_restricted_to_mods: false,
|
||||
visibility: 'Public',
|
||||
}
|
||||
}
|
||||
|
||||
export function toMyUser(
|
||||
myUser: components['schemas']['MyUserInfo'],
|
||||
): MyUserInfo {
|
||||
return {
|
||||
...myUser,
|
||||
community_blocks: myUser.community_blocks.map(i => ({
|
||||
community: toCommunity(i.community),
|
||||
person: toPerson(i.person),
|
||||
})),
|
||||
local_user_view: {
|
||||
...myUser.local_user_view,
|
||||
local_user: {
|
||||
...myUser.local_user_view.local_user,
|
||||
id: myUser.local_user_view.person.id,
|
||||
person_id: myUser.local_user_view.person.id,
|
||||
totp_2fa_enabled: false,
|
||||
default_listing_type: 'All',
|
||||
},
|
||||
person: toPerson(myUser.local_user_view.person),
|
||||
},
|
||||
follows: myUser.follows.map(i => ({
|
||||
follower: toPerson(i.follower),
|
||||
community: toCommunity(i.community),
|
||||
})),
|
||||
moderates: myUser.moderates.map(i => ({
|
||||
community: toCommunity(i.community),
|
||||
moderator: toPerson(i.moderator),
|
||||
})),
|
||||
instance_blocks: myUser.instance_blocks.map(i => ({
|
||||
instance: i.instance,
|
||||
person: toPerson(i.person),
|
||||
})),
|
||||
person_blocks: myUser.person_blocks.map(i => ({
|
||||
person: toPerson(i.person),
|
||||
target: toPerson(i.target),
|
||||
})),
|
||||
discussion_languages: myUser.discussion_languages.map(i => i.id!),
|
||||
}
|
||||
}
|
||||
|
||||
export function toPostView(
|
||||
postView: components['schemas']['PostView'],
|
||||
): PostView {
|
||||
return {
|
||||
...postView,
|
||||
creator: toPerson(postView.creator),
|
||||
creator_blocked: false,
|
||||
post: toPost(postView.post),
|
||||
community: toCommunity(postView.community),
|
||||
}
|
||||
}
|
||||
|
||||
export function toPost(post: components['schemas']['Post']): Post {
|
||||
return {
|
||||
...post,
|
||||
creator_id: -1,
|
||||
name: post.title,
|
||||
featured_community: post.sticky,
|
||||
featured_local: false,
|
||||
}
|
||||
}
|
||||
|
||||
// Query calls
|
||||
export function fromGetPosts(
|
||||
getPosts: GetPosts,
|
||||
): paths['/post/list']['get']['parameters'] {
|
||||
return {
|
||||
query: {
|
||||
GetPosts: {
|
||||
...getPosts,
|
||||
sort: toSortType(getPosts.sort),
|
||||
page_cursor: Number(getPosts.page_cursor),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Misc
|
||||
export function toSortType(
|
||||
sortType?: SortType,
|
||||
): components['schemas']['SortType'] | undefined {
|
||||
if (
|
||||
sortType == 'Old' ||
|
||||
sortType == 'MostComments' ||
|
||||
sortType == 'Controversial' ||
|
||||
sortType == 'NewComments'
|
||||
)
|
||||
sortType = 'New'
|
||||
return sortType
|
||||
}
|
||||
Vendored
+5460
File diff suppressed because it is too large.
Load diff
@@ -1,3 +1,65 @@
|
||||
export * from './payload'
|
||||
export * from './response'
|
||||
export * from './schemas'
|
||||
export * from './schemas/AddAdminResponse'
|
||||
export * from './schemas/AddModToCommunityResponse'
|
||||
export * from './schemas/BanFromCommunityResponse'
|
||||
export * from './schemas/BanPersonResponse'
|
||||
export * from './schemas/BannedPersonsResponse'
|
||||
export * from './schemas/BlockCommunityResponse'
|
||||
export * from './schemas/BlockInstanceResponse'
|
||||
export * from './schemas/BlockPersonResponse'
|
||||
export * from './schemas/CaptchaResponse'
|
||||
export * from './schemas/CommentReplyResponse'
|
||||
export * from './schemas/CommentReportResponse'
|
||||
export * from './schemas/CommentResponse'
|
||||
export * from './schemas/CommunityResponse'
|
||||
export * from './schemas/CustomEmojiResponse'
|
||||
export * from './schemas/GenerateTotpSecretResponse'
|
||||
export * from './schemas/GetCaptchaResponse'
|
||||
export * from './schemas/GetComment'
|
||||
export * from './schemas/GetComments'
|
||||
export * from './schemas/GetCommentsResponse'
|
||||
export * from './schemas/GetCommunity'
|
||||
export * from './schemas/GetCommunityResponse'
|
||||
export * from './schemas/GetFederatedInstancesResponse'
|
||||
export * from './schemas/GetModlog'
|
||||
export * from './schemas/GetModlogResponse'
|
||||
export * from './schemas/GetPersonDetails'
|
||||
export * from './schemas/GetPersonDetailsResponse'
|
||||
export * from './schemas/GetPersonMentions'
|
||||
export * from './schemas/GetPersonMentionsResponse'
|
||||
export * from './schemas/GetPost'
|
||||
export * from './schemas/GetPostResponse'
|
||||
export * from './schemas/GetPosts'
|
||||
export * from './schemas/GetPostsResponse'
|
||||
export * from './schemas/GetPrivateMessages'
|
||||
export * from './schemas/GetRegistrationApplication'
|
||||
export * from './schemas/GetReplies'
|
||||
export * from './schemas/GetRepliesResponse'
|
||||
export * from './schemas/GetReportCount'
|
||||
export * from './schemas/GetReportCountResponse'
|
||||
export * from './schemas/GetSiteMetadata'
|
||||
export * from './schemas/GetSiteMetadataResponse'
|
||||
export * from './schemas/GetSiteResponse'
|
||||
export * from './schemas/GetUnreadCountResponse'
|
||||
export * from './schemas/GetUnreadRegistrationApplicationCountResponse'
|
||||
export * from './schemas/ListCommentLikesResponse'
|
||||
export * from './schemas/ListCommentReportsResponse'
|
||||
export * from './schemas/ListCommunitiesResponse'
|
||||
export * from './schemas/ListMediaResponse'
|
||||
export * from './schemas/ListPostLikesResponse'
|
||||
export * from './schemas/ListPostReportsResponse'
|
||||
export * from './schemas/ListPrivateMessageReportsResponse'
|
||||
export * from './schemas/ListRegistrationApplicationsResponse'
|
||||
export * from './schemas/LoginResponse'
|
||||
export * from './schemas/PersonMentionResponse'
|
||||
export * from './schemas/PostReportResponse'
|
||||
export * from './schemas/PostResponse'
|
||||
export * from './schemas/PrivateMessageReportResponse'
|
||||
export * from './schemas/PrivateMessageResponse'
|
||||
export * from './schemas/PrivateMessagesResponse'
|
||||
export * from './schemas/RegistrationApplicationResponse'
|
||||
export * from './schemas/ResolveObjectResponse'
|
||||
export * from './schemas/SearchResponse'
|
||||
export * from './schemas/SiteResponse'
|
||||
export * from './schemas/SuccessResponse'
|
||||
export * from './schemas/UpdateTotpResponse'
|
||||
export * from './schemas/schemas'
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommentId } from "./CommentId";
|
||||
export interface GetComment {
|
||||
id: CommentId;
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
import type { CommentId } from "./CommentId";
|
||||
import type { CommentSortType } from "./CommentSortType";
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
import type { ListingType } from "./ListingType";
|
||||
import type { PostId } from "./PostId";
|
||||
export interface GetComments {
|
||||
type_?: ListingType;
|
||||
sort?: CommentSortType;
|
||||
max_depth?: number;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
community_id?: CommunityId;
|
||||
community_name?: string;
|
||||
post_id?: PostId;
|
||||
parent_id?: CommentId;
|
||||
saved_only?: boolean;
|
||||
liked_only?: boolean;
|
||||
disliked_only?: boolean;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
export interface GetCommunity {
|
||||
id?: CommunityId;
|
||||
name?: string;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
import type { CommentId } from "./CommentId";
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
import type { ModlogActionType } from "./ModlogActionType";
|
||||
import type { PersonId } from "./PersonId";
|
||||
import type { PostId } from "./PostId";
|
||||
export interface GetModlog {
|
||||
mod_person_id?: PersonId;
|
||||
community_id?: CommunityId;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
type_?: ModlogActionType;
|
||||
other_person_id?: PersonId;
|
||||
post_id?: PostId;
|
||||
comment_id?: CommentId;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
import type { PersonId } from "./PersonId";
|
||||
import type { SortType } from "./SortType";
|
||||
export interface GetPersonDetails {
|
||||
person_id?: PersonId;
|
||||
username?: string;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
community_id?: CommunityId;
|
||||
saved_only?: boolean;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { CommentSortType } from "./CommentSortType";
|
||||
export interface GetPersonMentions {
|
||||
sort?: CommentSortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
unread_only?: boolean;
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
import type { CommentId } from "./CommentId";
|
||||
import type { PostId } from "./PostId";
|
||||
export interface GetPost {
|
||||
id?: PostId;
|
||||
comment_id?: CommentId;
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
import type { ListingType } from "./ListingType";
|
||||
import type { PaginationCursor } from "./PaginationCursor";
|
||||
import type { SortType } from "./SortType";
|
||||
export interface GetPosts {
|
||||
type_?: ListingType;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
community_id?: CommunityId;
|
||||
community_name?: string;
|
||||
saved_only?: boolean;
|
||||
liked_only?: boolean;
|
||||
disliked_only?: boolean;
|
||||
show_hidden?: boolean;
|
||||
show_read?: boolean;
|
||||
show_nsfw?: boolean;
|
||||
page_cursor?: PaginationCursor;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { PersonId } from "./PersonId";
|
||||
export interface GetPrivateMessages {
|
||||
unread_only?: boolean;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
creator_id?: PersonId;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PersonId } from "./PersonId";
|
||||
export interface GetRegistrationApplication {
|
||||
person_id: PersonId;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { CommentSortType } from "./CommentSortType";
|
||||
export interface GetReplies {
|
||||
sort?: CommentSortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
unread_only?: boolean;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
export interface GetReportCount {
|
||||
community_id?: CommunityId;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
export * from './GetComment.d';
|
||||
export * from './GetComments.d';
|
||||
export * from './GetCommunity.d';
|
||||
export * from './GetModlog.d';
|
||||
export * from './GetPersonDetails.d';
|
||||
export * from './GetPersonMentions.d';
|
||||
export * from './GetPost.d';
|
||||
export * from './GetPosts.d';
|
||||
export * from './GetPrivateMessages.d';
|
||||
export * from './GetRegistrationApplication.d';
|
||||
export * from './GetReplies.d';
|
||||
export * from './GetReportCount.d';
|
||||
export * from './GetSiteMetadata.d';
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PersonView } from "./PersonView";
|
||||
export interface AddAdminResponse {
|
||||
admins: Array<PersonView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
||||
export interface AddModToCommunityResponse {
|
||||
moderators: Array<CommunityModeratorView>;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { PersonView } from "./PersonView";
|
||||
export interface BanFromCommunityResponse {
|
||||
person_view: PersonView;
|
||||
banned: boolean;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { PersonView } from "./PersonView";
|
||||
export interface BanPersonResponse {
|
||||
person_view: PersonView;
|
||||
banned: boolean;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PersonView } from "./PersonView";
|
||||
export interface BannedPersonsResponse {
|
||||
banned: Array<PersonView>;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
export interface BlockCommunityResponse {
|
||||
community_view: CommunityView;
|
||||
blocked: boolean;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { PersonView } from "./PersonView";
|
||||
export interface BlockPersonResponse {
|
||||
person_view: PersonView;
|
||||
blocked: boolean;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommentReplyView } from "./CommentReplyView";
|
||||
export interface CommentReplyResponse {
|
||||
comment_reply_view: CommentReplyView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommentReportView } from "./CommentReportView";
|
||||
export interface CommentReportResponse {
|
||||
comment_report_view: CommentReportView;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { CommentView } from "./CommentView";
|
||||
import type { LocalUserId } from "./LocalUserId";
|
||||
export interface CommentResponse {
|
||||
comment_view: CommentView;
|
||||
recipient_ids: Array<LocalUserId>;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
import type { LanguageId } from "./LanguageId";
|
||||
export interface CommunityResponse {
|
||||
community_view: CommunityView;
|
||||
discussion_languages: Array<LanguageId>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CustomEmojiView } from "./CustomEmojiView";
|
||||
export interface CustomEmojiResponse {
|
||||
custom_emoji: CustomEmojiView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CaptchaResponse } from "./CaptchaResponse";
|
||||
export interface GetCaptchaResponse {
|
||||
ok?: CaptchaResponse;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommentView } from "./CommentView";
|
||||
export interface GetCommentsResponse {
|
||||
comments: Array<CommentView>;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
import type { LanguageId } from "./LanguageId";
|
||||
import type { Site } from "./Site";
|
||||
export interface GetCommunityResponse {
|
||||
community_view: CommunityView;
|
||||
site?: Site;
|
||||
moderators: Array<CommunityModeratorView>;
|
||||
discussion_languages: Array<LanguageId>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { FederatedInstances } from "./FederatedInstances";
|
||||
export interface GetFederatedInstancesResponse {
|
||||
federated_instances?: FederatedInstances;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import type { AdminPurgeCommentView } from "./AdminPurgeCommentView";
|
||||
import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView";
|
||||
import type { AdminPurgePersonView } from "./AdminPurgePersonView";
|
||||
import type { AdminPurgePostView } from "./AdminPurgePostView";
|
||||
import type { ModAddCommunityView } from "./ModAddCommunityView";
|
||||
import type { ModAddView } from "./ModAddView";
|
||||
import type { ModBanFromCommunityView } from "./ModBanFromCommunityView";
|
||||
import type { ModBanView } from "./ModBanView";
|
||||
import type { ModFeaturePostView } from "./ModFeaturePostView";
|
||||
import type { ModHideCommunityView } from "./ModHideCommunityView";
|
||||
import type { ModLockPostView } from "./ModLockPostView";
|
||||
import type { ModRemoveCommentView } from "./ModRemoveCommentView";
|
||||
import type { ModRemoveCommunityView } from "./ModRemoveCommunityView";
|
||||
import type { ModRemovePostView } from "./ModRemovePostView";
|
||||
import type { ModTransferCommunityView } from "./ModTransferCommunityView";
|
||||
export interface GetModlogResponse {
|
||||
removed_posts: Array<ModRemovePostView>;
|
||||
locked_posts: Array<ModLockPostView>;
|
||||
featured_posts: Array<ModFeaturePostView>;
|
||||
removed_comments: Array<ModRemoveCommentView>;
|
||||
removed_communities: Array<ModRemoveCommunityView>;
|
||||
banned_from_community: Array<ModBanFromCommunityView>;
|
||||
banned: Array<ModBanView>;
|
||||
added_to_community: Array<ModAddCommunityView>;
|
||||
transferred_to_community: Array<ModTransferCommunityView>;
|
||||
added: Array<ModAddView>;
|
||||
admin_purged_persons: Array<AdminPurgePersonView>;
|
||||
admin_purged_communities: Array<AdminPurgeCommunityView>;
|
||||
admin_purged_posts: Array<AdminPurgePostView>;
|
||||
admin_purged_comments: Array<AdminPurgeCommentView>;
|
||||
hidden_communities: Array<ModHideCommunityView>;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import type { CommentView } from "./CommentView";
|
||||
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
||||
import type { PersonView } from "./PersonView";
|
||||
import type { PostView } from "./PostView";
|
||||
import type { Site } from "./Site";
|
||||
export interface GetPersonDetailsResponse {
|
||||
person_view: PersonView;
|
||||
site?: Site;
|
||||
comments: Array<CommentView>;
|
||||
posts: Array<PostView>;
|
||||
moderates: Array<CommunityModeratorView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PersonMentionView } from "./PersonMentionView";
|
||||
export interface GetPersonMentionsResponse {
|
||||
mentions: Array<PersonMentionView>;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
import type { PostView } from "./PostView";
|
||||
export interface GetPostResponse {
|
||||
post_view: PostView;
|
||||
community_view: CommunityView;
|
||||
moderators: Array<CommunityModeratorView>;
|
||||
cross_posts: Array<PostView>;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { PaginationCursor } from "./PaginationCursor";
|
||||
import type { PostView } from "./PostView";
|
||||
export interface GetPostsResponse {
|
||||
posts: Array<PostView>;
|
||||
next_page?: PaginationCursor;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommentReplyView } from "./CommentReplyView";
|
||||
export interface GetRepliesResponse {
|
||||
replies: Array<CommentReplyView>;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
export interface GetReportCountResponse {
|
||||
community_id?: CommunityId;
|
||||
comment_reports: number;
|
||||
post_reports: number;
|
||||
private_message_reports?: number;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { LinkMetadata } from "./LinkMetadata";
|
||||
export interface GetSiteMetadataResponse {
|
||||
metadata: LinkMetadata;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import type { CustomEmojiView } from "./CustomEmojiView";
|
||||
import type { Language } from "./Language";
|
||||
import type { LanguageId } from "./LanguageId";
|
||||
import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist";
|
||||
import type { MyUserInfo } from "./MyUserInfo";
|
||||
import type { PersonView } from "./PersonView";
|
||||
import type { SiteView } from "./SiteView";
|
||||
import type { Tagline } from "./Tagline";
|
||||
export interface GetSiteResponse {
|
||||
site_view: SiteView;
|
||||
admins: Array<PersonView>;
|
||||
version: string;
|
||||
my_user?: MyUserInfo;
|
||||
all_languages: Array<Language>;
|
||||
discussion_languages: Array<LanguageId>;
|
||||
taglines: Array<Tagline>;
|
||||
custom_emojis: Array<CustomEmojiView>;
|
||||
blocked_urls: Array<LocalSiteUrlBlocklist>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { VoteView } from "./VoteView";
|
||||
export interface ListCommentLikesResponse {
|
||||
comment_likes: Array<VoteView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommentReportView } from "./CommentReportView";
|
||||
export interface ListCommentReportsResponse {
|
||||
comment_reports: Array<CommentReportView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
export interface ListCommunitiesResponse {
|
||||
communities: Array<CommunityView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { LocalImageView } from "./LocalImageView";
|
||||
export interface ListMediaResponse {
|
||||
images: Array<LocalImageView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { VoteView } from "./VoteView";
|
||||
export interface ListPostLikesResponse {
|
||||
post_likes: Array<VoteView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PostReportView } from "./PostReportView";
|
||||
export interface ListPostReportsResponse {
|
||||
post_reports: Array<PostReportView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PrivateMessageReportView } from "./PrivateMessageReportView";
|
||||
export interface ListPrivateMessageReportsResponse {
|
||||
private_message_reports: Array<PrivateMessageReportView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { RegistrationApplicationView } from "./RegistrationApplicationView";
|
||||
export interface ListRegistrationApplicationsResponse {
|
||||
registration_applications: Array<RegistrationApplicationView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PersonMentionView } from "./PersonMentionView";
|
||||
export interface PersonMentionResponse {
|
||||
person_mention_view: PersonMentionView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PostReportView } from "./PostReportView";
|
||||
export interface PostReportResponse {
|
||||
post_report_view: PostReportView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PostView } from "./PostView";
|
||||
export interface PostResponse {
|
||||
post_view: PostView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PrivateMessageReportView } from "./PrivateMessageReportView";
|
||||
export interface PrivateMessageReportResponse {
|
||||
private_message_report_view: PrivateMessageReportView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PrivateMessageView } from "./PrivateMessageView";
|
||||
export interface PrivateMessageResponse {
|
||||
private_message_view: PrivateMessageView;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { PrivateMessageView } from "./PrivateMessageView";
|
||||
export interface PrivateMessagesResponse {
|
||||
private_messages: Array<PrivateMessageView>;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { RegistrationApplicationView } from "./RegistrationApplicationView";
|
||||
export interface RegistrationApplicationResponse {
|
||||
registration_application: RegistrationApplicationView;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { CommentView } from "./CommentView";
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
import type { PersonView } from "./PersonView";
|
||||
import type { PostView } from "./PostView";
|
||||
export interface ResolveObjectResponse {
|
||||
comment?: CommentView;
|
||||
post?: PostView;
|
||||
community?: CommunityView;
|
||||
person?: PersonView;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import type { CommentView } from "./CommentView";
|
||||
import type { CommunityView } from "./CommunityView";
|
||||
import type { PersonView } from "./PersonView";
|
||||
import type { PostView } from "./PostView";
|
||||
import type { SearchType } from "./SearchType";
|
||||
export interface SearchResponse {
|
||||
type_: SearchType;
|
||||
comments: Array<CommentView>;
|
||||
posts: Array<PostView>;
|
||||
communities: Array<CommunityView>;
|
||||
users: Array<PersonView>;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { SiteView } from "./SiteView";
|
||||
import type { Tagline } from "./Tagline";
|
||||
export interface SiteResponse {
|
||||
site_view: SiteView;
|
||||
taglines: Array<Tagline>;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
export * from './AddAdminResponse.d';
|
||||
export * from './AddModToCommunityResponse.d';
|
||||
export * from './BanFromCommunityResponse.d';
|
||||
export * from './BanPersonResponse.d';
|
||||
export * from './BannedPersonsResponse.d';
|
||||
export * from './BlockCommunityResponse.d';
|
||||
export * from './BlockInstanceResponse.d';
|
||||
export * from './BlockPersonResponse.d';
|
||||
export * from './CaptchaResponse.d';
|
||||
export * from './CommentReplyResponse.d';
|
||||
export * from './CommentReportResponse.d';
|
||||
export * from './CommentResponse.d';
|
||||
export * from './CommunityResponse.d';
|
||||
export * from './CustomEmojiResponse.d';
|
||||
export * from './GenerateTotpSecretResponse.d';
|
||||
export * from './GetCaptchaResponse.d';
|
||||
export * from './GetCommentsResponse.d';
|
||||
export * from './GetCommunityResponse.d';
|
||||
export * from './GetFederatedInstancesResponse.d';
|
||||
export * from './GetModlogResponse.d';
|
||||
export * from './GetPersonDetailsResponse.d';
|
||||
export * from './GetPersonMentionsResponse.d';
|
||||
export * from './GetPostResponse.d';
|
||||
export * from './GetPostsResponse.d';
|
||||
export * from './GetRepliesResponse.d';
|
||||
export * from './GetReportCountResponse.d';
|
||||
export * from './GetSiteMetadataResponse.d';
|
||||
export * from './GetSiteResponse.d';
|
||||
export * from './GetUnreadCountResponse.d';
|
||||
export * from './GetUnreadRegistrationApplicationCountResponse.d';
|
||||
export * from './ListCommentLikesResponse.d';
|
||||
export * from './ListCommentReportsResponse.d';
|
||||
export * from './ListCommunitiesResponse.d';
|
||||
export * from './ListMediaResponse.d';
|
||||
export * from './ListPostLikesResponse.d';
|
||||
export * from './ListPostReportsResponse.d';
|
||||
export * from './ListPrivateMessageReportsResponse.d';
|
||||
export * from './ListRegistrationApplicationsResponse.d';
|
||||
export * from './LoginResponse.d';
|
||||
export * from './PersonMentionResponse.d';
|
||||
export * from './PostReportResponse.d';
|
||||
export * from './PostResponse.d';
|
||||
export * from './PrivateMessageReportResponse.d';
|
||||
export * from './PrivateMessageResponse.d';
|
||||
export * from './PrivateMessagesResponse.d';
|
||||
export * from './RegistrationApplicationResponse.d';
|
||||
export * from './ResolveObjectResponse.d';
|
||||
export * from './SearchResponse.d';
|
||||
export * from './SiteResponse.d';
|
||||
export * from './SuccessResponse.d';
|
||||
export * from './UpdateTotpResponse.d';
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { PersonView } from './schemas'
|
||||
export interface AddAdminResponse {
|
||||
admins: Array<PersonView>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { CommunityModeratorView } from './schemas'
|
||||
export interface AddModToCommunityResponse {
|
||||
moderators: Array<CommunityModeratorView>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { PersonView } from './schemas'
|
||||
export interface BanFromCommunityResponse {
|
||||
person_view: PersonView
|
||||
banned: boolean
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { PersonView } from './schemas'
|
||||
export interface BanPersonResponse {
|
||||
person_view: PersonView
|
||||
banned: boolean
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { PersonView } from './schemas'
|
||||
export interface BannedPersonsResponse {
|
||||
banned: Array<PersonView>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { CommunityView } from './schemas'
|
||||
export interface BlockCommunityResponse {
|
||||
community_view: CommunityView
|
||||
blocked: boolean
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,5 @@
|
||||
import type { PersonView } from './schemas'
|
||||
export interface BlockPersonResponse {
|
||||
person_view: PersonView
|
||||
blocked: boolean
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,4 @@
|
||||
import type { CommentReplyView } from './schemas'
|
||||
export interface CommentReplyResponse {
|
||||
comment_reply_view: CommentReplyView
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { CommentReportView } from './schemas'
|
||||
export interface CommentReportResponse {
|
||||
comment_report_view: CommentReportView
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { CommentView } from './schemas'
|
||||
import type { LocalUserId } from './schemas'
|
||||
export interface CommentResponse {
|
||||
comment_view: CommentView
|
||||
recipient_ids: Array<LocalUserId>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { CommunityView } from './schemas'
|
||||
import type { LanguageId } from './schemas'
|
||||
export interface CommunityResponse {
|
||||
community_view: CommunityView
|
||||
discussion_languages: Array<LanguageId>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { CustomEmojiView } from './schemas'
|
||||
export interface CustomEmojiResponse {
|
||||
custom_emoji: CustomEmojiView
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,4 @@
|
||||
import type { CaptchaResponse } from './schemas'
|
||||
export interface GetCaptchaResponse {
|
||||
ok?: CaptchaResponse
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { CommentId } from './schemas'
|
||||
export interface GetComment {
|
||||
id: CommentId
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { CommentId } from './schemas'
|
||||
import type { CommentSortType } from './schemas'
|
||||
import type { CommunityId } from './schemas'
|
||||
import type { ListingType } from './schemas'
|
||||
import type { PostId } from './schemas'
|
||||
export interface GetComments {
|
||||
type_?: ListingType
|
||||
sort?: CommentSortType
|
||||
max_depth?: number
|
||||
page?: number
|
||||
limit?: number
|
||||
community_id?: CommunityId
|
||||
community_name?: string
|
||||
post_id?: PostId
|
||||
parent_id?: CommentId
|
||||
saved_only?: boolean
|
||||
liked_only?: boolean
|
||||
disliked_only?: boolean
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { CommentView } from './schemas'
|
||||
export interface GetCommentsResponse {
|
||||
comments: Array<CommentView>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { CommunityId } from './schemas'
|
||||
export interface GetCommunity {
|
||||
id?: CommunityId
|
||||
name?: string
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { CommunityModeratorView } from './schemas'
|
||||
import type { CommunityView } from './schemas'
|
||||
import type { LanguageId } from './schemas'
|
||||
import type { Site } from './schemas'
|
||||
export interface GetCommunityResponse {
|
||||
community_view: CommunityView
|
||||
site?: Site
|
||||
moderators: Array<CommunityModeratorView>
|
||||
discussion_languages: Array<LanguageId>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { FederatedInstances } from './schemas'
|
||||
export interface GetFederatedInstancesResponse {
|
||||
federated_instances?: FederatedInstances
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { CommentId } from './schemas'
|
||||
import type { CommunityId } from './schemas'
|
||||
import type { ModlogActionType } from './schemas'
|
||||
import type { PersonId } from './schemas'
|
||||
import type { PostId } from './schemas'
|
||||
export interface GetModlog {
|
||||
mod_person_id?: PersonId
|
||||
community_id?: CommunityId
|
||||
page?: number
|
||||
limit?: number
|
||||
type_?: ModlogActionType
|
||||
other_person_id?: PersonId
|
||||
post_id?: PostId
|
||||
comment_id?: CommentId
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { AdminPurgeCommentView } from './schemas'
|
||||
import type { AdminPurgeCommunityView } from './schemas'
|
||||
import type { AdminPurgePersonView } from './schemas'
|
||||
import type { AdminPurgePostView } from './schemas'
|
||||
import type { ModAddCommunityView } from './schemas'
|
||||
import type { ModAddView } from './schemas'
|
||||
import type { ModBanFromCommunityView } from './schemas'
|
||||
import type { ModBanView } from './schemas'
|
||||
import type { ModFeaturePostView } from './schemas'
|
||||
import type { ModHideCommunityView } from './schemas'
|
||||
import type { ModLockPostView } from './schemas'
|
||||
import type { ModRemoveCommentView } from './schemas'
|
||||
import type { ModRemoveCommunityView } from './schemas'
|
||||
import type { ModRemovePostView } from './schemas'
|
||||
import type { ModTransferCommunityView } from './schemas'
|
||||
export interface GetModlogResponse {
|
||||
removed_posts: Array<ModRemovePostView>
|
||||
locked_posts: Array<ModLockPostView>
|
||||
featured_posts: Array<ModFeaturePostView>
|
||||
removed_comments: Array<ModRemoveCommentView>
|
||||
removed_communities: Array<ModRemoveCommunityView>
|
||||
banned_from_community: Array<ModBanFromCommunityView>
|
||||
banned: Array<ModBanView>
|
||||
added_to_community: Array<ModAddCommunityView>
|
||||
transferred_to_community: Array<ModTransferCommunityView>
|
||||
added: Array<ModAddView>
|
||||
admin_purged_persons: Array<AdminPurgePersonView>
|
||||
admin_purged_communities: Array<AdminPurgeCommunityView>
|
||||
admin_purged_posts: Array<AdminPurgePostView>
|
||||
admin_purged_comments: Array<AdminPurgeCommentView>
|
||||
hidden_communities: Array<ModHideCommunityView>
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { CommunityId } from './schemas'
|
||||
import type { PersonId } from './schemas'
|
||||
import type { SortType } from './schemas'
|
||||
export interface GetPersonDetails {
|
||||
person_id?: PersonId
|
||||
username?: string
|
||||
sort?: SortType
|
||||
page?: number
|
||||
limit?: number
|
||||
community_id?: CommunityId
|
||||
saved_only?: boolean
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { CommentView } from './schemas'
|
||||
import type { CommunityModeratorView } from './schemas'
|
||||
import type { PersonView } from './schemas'
|
||||
import type { PostView } from './schemas'
|
||||
import type { Site } from './schemas'
|
||||
export interface GetPersonDetailsResponse {
|
||||
person_view: PersonView
|
||||
site?: Site
|
||||
comments: Array<CommentView>
|
||||
posts: Array<PostView>
|
||||
moderates: Array<CommunityModeratorView>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { CommentSortType } from './schemas'
|
||||
export interface GetPersonMentions {
|
||||
sort?: CommentSortType
|
||||
page?: number
|
||||
limit?: number
|
||||
unread_only?: boolean
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { PersonMentionView } from './schemas'
|
||||
export interface GetPersonMentionsResponse {
|
||||
mentions: Array<PersonMentionView>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { CommentId } from './schemas'
|
||||
import type { PostId } from './schemas'
|
||||
export interface GetPost {
|
||||
id?: PostId
|
||||
comment_id?: CommentId
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { CommunityModeratorView } from './schemas'
|
||||
import type { CommunityView } from './schemas'
|
||||
import type { PostView } from './schemas'
|
||||
export interface GetPostResponse {
|
||||
post_view: PostView
|
||||
community_view: CommunityView
|
||||
moderators: Array<CommunityModeratorView>
|
||||
cross_posts: Array<PostView>
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { CommunityId } from './schemas'
|
||||
import type { ListingType } from './schemas'
|
||||
import type { PaginationCursor } from './schemas'
|
||||
import type { SortType } from './schemas'
|
||||
export interface GetPosts {
|
||||
type_?: ListingType
|
||||
sort?: SortType
|
||||
page?: number
|
||||
limit?: number
|
||||
community_id?: CommunityId
|
||||
community_name?: string
|
||||
saved_only?: boolean
|
||||
liked_only?: boolean
|
||||
disliked_only?: boolean
|
||||
show_hidden?: boolean
|
||||
show_read?: boolean
|
||||
show_nsfw?: boolean
|
||||
page_cursor?: PaginationCursor
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { PaginationCursor } from './schemas'
|
||||
import type { PostView } from './schemas'
|
||||
export interface GetPostsResponse {
|
||||
posts: Array<PostView>
|
||||
next_page?: PaginationCursor
|
||||
}
|
||||
Loaded 100 of 137 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user