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/package.json b/package.json index 6d915318..f3581f3a 100644 --- a/package.json +++ b/package.json @@ -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 70d018de..5d4bd699 100644 --- a/src/lib/auth.svelte.ts +++ b/src/lib/auth.svelte.ts @@ -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(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 diff --git a/src/lib/client/base.ts b/src/lib/client/base.ts index b04288de..9eb089f0 100644 --- a/src/lib/client/base.ts +++ b/src/lib/client/base.ts @@ -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 abstract generateTotpSecret(): Promise diff --git a/src/lib/client/lemmy.svelte.ts b/src/lib/client/lemmy.svelte.ts index aac37291..0a7c0c6c 100644 --- a/src/lib/client/lemmy.svelte.ts +++ b/src/lib/client/lemmy.svelte.ts @@ -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() @@ -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 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', +} diff --git a/src/lib/client/lemmy/lemmy.ts b/src/lib/client/lemmy/lemmy.ts index 4ba6bcbd..ad6ec6e5 100644 --- a/src/lib/client/lemmy/lemmy.ts +++ b/src/lib/client/lemmy/lemmy.ts @@ -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 + params: Parameters[0], ): ReturnType { - return await this.#client.search(...params) + return await this.#client.search({ + ...params, + listing_type: toListingType(params.listing_type), + }) } async resolveObject( ...params: Parameters @@ -72,9 +76,12 @@ export class LemmyClient implements BaseClient { return await this.#client.editCommunity(...params) } async listCommunities( - ...params: Parameters + params: Parameters[0], ): ReturnType { - return await this.#client.listCommunities(...params) + return await this.#client.listCommunities({ + ...params, + type_: toListingType(params.type_), + }) } async followCommunity( ...params: Parameters @@ -157,9 +164,9 @@ export class LemmyClient implements BaseClient { return await this.#client.featurePost(...params) } async getPosts( - ...params: Parameters + params: Parameters[0], ): ReturnType { - return await this.#client.getPosts(...params) + return await this.#client.getPosts(fromGetPosts(params)) } async likePost( ...params: Parameters @@ -242,9 +249,12 @@ export class LemmyClient implements BaseClient { return await this.#client.distinguishComment(...params) } async getComments( - ...params: Parameters + params: Parameters[0], ): ReturnType { - return await this.#client.getComments(...params) + return await this.#client.getComments({ + ...params, + type_: toListingType(params.type_), + }) } async getComment( ...params: Parameters diff --git a/src/lib/client/lemmy/rewrite.ts b/src/lib/client/lemmy/rewrite.ts new file mode 100644 index 00000000..5fdc5cb7 --- /dev/null +++ b/src/lib/client/lemmy/rewrite.ts @@ -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 +} diff --git a/src/lib/client/piefed/piefed.ts b/src/lib/client/piefed/piefed.ts new file mode 100644 index 00000000..c06b6017 --- /dev/null +++ b/src/lib/client/piefed/piefed.ts @@ -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> + + constructor( + baseUrl: string, + args: { + fetchFunction: (input: any, init: any) => Promise + 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 { + // 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 + ): ReturnType { + throw new Error('Unimplemented') + } + async getPost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async editPost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async deletePost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async removePost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + + async getPosts( + params: Parameters[0], + ): ReturnType { + 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 + ): ReturnType { + throw new Error('Unimplemented') + } + + async generateTotpSecret( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listLogins( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listAllMedia( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async updateTotp( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getModlog( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async search( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async resolveObject( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async createCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async editCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listCommunities( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async followCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async blockCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async deleteCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async hideCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async removeCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async banFromCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async addModToCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async markPostAsRead( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async hidePost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async lockPost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async featurePost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listPostLikes( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async savePost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async createPostReport( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async resolvePostReport( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listPostReports( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getSiteMetadata( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async createComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async editComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async deleteComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async removeComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async markCommentReplyAsRead( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async likeComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listCommentLikes( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async saveComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async distinguishComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getComments( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async createCommentReport( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async resolveCommentReport( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listCommentReports( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getPrivateMessages( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async createPrivateMessage( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async editPrivateMessage( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async deletePrivateMessage( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async markPrivateMessageAsRead( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async createPrivateMessageReport( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async resolvePrivateMessageReport( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listPrivateMessageReports( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async register( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async login( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async logout( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getPersonDetails( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getPersonMentions( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async markPersonMentionAsRead( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getReplies( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async banPerson( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getBannedPersons( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async blockPerson( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getCaptcha( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async deleteAccount( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async passwordReset( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async passwordChangeAfterReset( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async markAllAsRead( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async saveUserSettings( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async changePassword( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getReportCount( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getUnreadCount( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async verifyEmail( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async addAdmin( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getUnreadRegistrationApplicationCount( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async listRegistrationApplications( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async approveRegistrationApplication( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getRegistrationApplication( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async purgePerson( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async purgeCommunity( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async purgePost( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async purgeComment( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async getFederatedInstances( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } + async blockInstance( + ...params: Parameters + ): ReturnType { + throw new Error('Unimplemented') + } +} diff --git a/src/lib/client/piefed/rewrite.ts b/src/lib/client/piefed/rewrite.ts new file mode 100644 index 00000000..0bd2be5c --- /dev/null +++ b/src/lib/client/piefed/rewrite.ts @@ -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 +} diff --git a/src/lib/client/piefed/schema.d.ts b/src/lib/client/piefed/schema.d.ts new file mode 100644 index 00000000..1cbd604c --- /dev/null +++ b/src/lib/client/piefed/schema.d.ts @@ -0,0 +1,5460 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + '/site': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Gets the site, and your user data. */ + get: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetSiteResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/site/version': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** (instances running PieFed v1.2 or later only) Gets version of PieFed. */ + get: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK, */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetSiteVersionResponse'] + } + } + /** @description Bad Request, */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/site/block': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Block an instance. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['BlockInstance'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BlockInstanceResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/site/instance_chooser': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** (instances running PieFed v1.2 or later only) Gets the site info for use by other instances in the Instance Chooser functionality. */ + get: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetSiteInstanceChooserResponse'] + } + } + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/site/instance_chooser_search': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** (instances running PieFed v1.2 or later only) Search for other instances. */ + get: { + parameters: { + query?: { + InstanceChooserSearch?: components['schemas']['InstanceChooserSearch'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetSiteInstanceChooserSearchResponse'] + } + } + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/search': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Search PieFed. */ + get: { + parameters: { + query?: { + Search?: components['schemas']['Search'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['SearchResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/resolve_object': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Fetch a non-local / federated object. */ + get: { + parameters: { + query?: { + ResolveObject?: components['schemas']['ResolveObject'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ResolveObjectResponse'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/federated_instances': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Fetch federated instances. */ + get: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetFederatedInstancesResponse'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch a community. */ + get: { + parameters: { + query?: { + GetCommunity?: components['schemas']['GetCommunity'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetCommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + /** Edit community. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['EditCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + /** Create a new community. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreateCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + /** @description You are being rate limited */ + 429: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/delete': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Delete a community. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['DeleteCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/list': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** List communities, with various filters. */ + get: { + parameters: { + query?: { + ListCommunities?: components['schemas']['ListCommunities'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ListCommunitiesResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/follow': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Follow / subscribe to a community. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['FollowCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/block': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Block a community. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['BlockCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BlockCommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/mod': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Add or remove a moderator for your community.. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['AddModToCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['AddModToCommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/subscribe': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Subscribe to activities in a community. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SubscribeCommunity'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommunityResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/moderate/bans': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get the list of banned users for a community. */ + get: { + parameters: { + query?: { + GetCommunityModerationBansList?: components['schemas']['GetCommunityModerationBansList'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ModerationCommunityBansListResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/moderate/ban': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Ban a user from a community. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['ModerateCommunityBan'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ModerateCommunityBanResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/moderate/unban': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Unban a user from a community. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['ModerateCommunityUnBan'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ModerateCommunityUnBanResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/community/moderate/post/nsfw': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Mark or unmark a post as NSFW. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['ModerateCommunityPostNsfw'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ModerateCommunityPostNsfwResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/list': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch posts, with various filters. */ + get: { + parameters: { + query?: { + GetPosts?: components['schemas']['GetPosts'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetPostsResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch a post. */ + get: { + parameters: { + query?: { + GetPost?: components['schemas']['GetPost'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetPostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + /** Edit a post. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['EditPost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + /** Create a post. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreatePost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + /** @description You are being rate limited */ + 429: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/like': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Like / vote on a post. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreatePostLike'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/save': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Save a post. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SavePost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/subscribe': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Subscribe to a post. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SubscribePost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/delete': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Delete a post. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['DeletePost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/report': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Report a post. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreatePostReport'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostReportResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/lock': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** A moderator can lock a post ( IE disable new comments ). */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['LockPost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/feature': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** A moderator can feature a community post ( IE stick it to the top of a community ). */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['FeaturePost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/mark_as_read': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Mark a post as read. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['MarkPostAsRead'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['SuccessResponse-2'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/post/remove': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** A moderator remove for a post. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['RemovePost'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PostResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch a comment. */ + get: { + parameters: { + query?: { + GetComments?: components['schemas']['GetComment'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + /** Edit a comment. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['EditComment'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + /** Create a comment. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreateComment'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + /** @description You are being rate limited */ + 429: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/list': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch comments. */ + get: { + parameters: { + query?: { + GetComments?: components['schemas']['GetComments'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetCommentsResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/delete': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Delete a comment. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['DeleteComment'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/mark_as_read': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Mark a comment reply as read. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['MarkReplyAsRead'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentReplyResponse-2'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/remove': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** A moderator remove for a comment. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['RemoveComment'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/like': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Like / vote on a comment. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreateCommentLike'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/save': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Save a comment. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SaveComment'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/subscribe': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Subscribe to a comment. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SubscribeComment'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/comment/report': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Report a comment. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreateCommentReport'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['CommentReportResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/private_message/list': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch private messages. */ + get: { + parameters: { + query?: { + GetPrivateMessages?: components['schemas']['GetPrivateMessages'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PrivateMessagesResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/private_message/conversation': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get / fetch private messages. */ + get: { + parameters: { + query?: { + GetPrivateMessagesConversation?: components['schemas']['GetPrivateMessagesConversation'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PrivateMessagesResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/private_message': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Edit a private message. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['EditPrivateMessage'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PrivateMessageResponse'] + } + } + } + } + /** Create a private message. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['CreatePrivateMessage'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PrivateMessageResponse'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/private_message/mark_as_read': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Mark a private message as read. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['MarkPrivateMessageAsRead'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PrivateMessageResponse'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/private_message/delete': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Delete a private message. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['DeletePrivateMessage'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PrivateMessageResponse'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get the details for a person. */ + get: { + parameters: { + query?: { + GetPersonDetails?: components['schemas']['GetPersonDetails'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetPersonDetailsResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/replies': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get comment replies. */ + get: { + parameters: { + query?: { + GetReplies?: components['schemas']['GetReplies'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetRepliesResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/mentions': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get mentions of your account made in comments. */ + get: { + parameters: { + query?: { + GetReplies?: components['schemas']['GetReplies'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetRepliesResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/block': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Block a person. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['BlockPerson'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BlockPersonResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/login': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Log into PieFed. */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['Login'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['LoginResponse'] + } + } + /** @description BAD REQUEST */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['ErrorResponseLogin'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/mark_all_as_read': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Mark all replies as read. */ + post: operations['markAllAsRead'] + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/unread_count': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get your unread counts */ + get: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetUnreadCountResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/subscribe': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Subscribe to activities from another user */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SubscribePerson'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PersonResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/set_flair': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Set your flair for a community */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SetPersonFlair'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['PersonResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/save_user_settings': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Save your user settings. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['SaveUserSettings'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content?: never + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/notifications': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get your user notifications */ + get: { + parameters: { + query?: { + Status?: components['schemas']['GetNotificationStatus'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['NotificationsResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/notification_state': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Set the read status of a given notification. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['EditNotificationState'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['NotificationsReadStatusResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/notifications_count': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get user unread notifications count. */ + get: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['NotificationsCountResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/mark_all_notifications_read': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + /** Set all unread user notifications to read. */ + put: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['NotificationsMarkAllReadResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/user/verify_credentials': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** Verify username / password credentials */ + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'application/json': components['schemas']['Login'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content?: never + } + /** @description BAD REQUEST */ + 400: { + headers: { + [name: string]: unknown + } + content?: never + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/feed/list': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get list of feeds */ + get: { + parameters: { + query?: { + FeedList?: components['schemas']['FeedList'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['FeedListResponse'] + } + } + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/topic/list': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + /** Get list of topics */ + get: { + parameters: { + query?: { + TopicList?: components['schemas']['TopicList'] + } + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['TopicListResponse'] + } + } + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + put?: never + post?: never + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/upload/image': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'multipart/form-data': components['schemas']['ImageUpload'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['UploadResponse'] + } + } + /** @description The uploaded image was missing or invalid */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + /** @description You are being rate limited */ + 429: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/upload/community_image': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'multipart/form-data': components['schemas']['ImageUpload'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['UploadResponse'] + } + } + /** @description The uploaded image was missing or invalid */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + /** @description You are being rate limited */ + 429: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/upload/user_image': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + post: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: { + content: { + 'multipart/form-data': components['schemas']['ImageUpload'] + } + } + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['UploadResponse'] + } + } + /** @description The uploaded image was missing or invalid */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + /** @description You are being rate limited */ + 429: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } +} +export type webhooks = Record +export interface components { + schemas: { + /** BlockInstance */ + BlockInstance: { + /** BlockInstance.instance_id */ + instance_id: number + /** BlockInstance.block */ + block: boolean + } + /** InstanceChooserSearch */ + InstanceChooserSearch: { + /** InstanceChooserSearch.q */ + q?: string + /** + * InstanceChooserSearch.nsfw + * @example no + */ + nsfw?: string + /** + * InstanceChooserSearch.language + * @example en + */ + language?: string + /** + * InstanceChooserSearch.newbie + * @example yes + */ + newbie?: string + } + /** Search */ + Search: { + /** Search.q */ + q: string + /** Search.type_ */ + type_?: components['schemas']['SearchType'] + /** Search.sort */ + sort?: components['schemas']['SortType'] + /** Search.listing_type */ + listing_type?: components['schemas']['ListingType'] + /** Search.page */ + page?: number + /** Search.limit */ + limit?: number + } + /** ResolveObject */ + ResolveObject: { + /** ResolveObject.q */ + q: string + } + /** GetCommunity */ + GetCommunity: { + /** GetCommunity.id */ + id?: number + /** GetCommunity.name */ + name?: string + } + /** CreateCommunity */ + CreateCommunity: { + /** CreateCommunity.name */ + name: string + /** CreateCommunity.title */ + title: string + /** CreateCommunity.description */ + description?: string + /** CreateCommunity.rules */ + rules?: string + /** + * CreateCommunity.icon + * Format: url + */ + icon_url?: string + /** + * CreateCommunity.banner + * Format: url + */ + banner_url?: string + /** CreateCommunity.nsfw */ + nsfw?: boolean + /** CreateCommunity.restricted_to_mods */ + restricted_to_mods?: boolean + /** CreateCommunity.local_only */ + local_only?: boolean + /** CreateCommunity.discussion_languages */ + discussion_languages?: number[] + } + /** CreateCommunity */ + EditCommunity: { + /** CreateCommunity.id */ + id: number + /** CreateCommunity.title */ + title?: string + /** CreateCommunity.description */ + description?: string + /** CreateCommunity.rules */ + rules?: string + /** + * CreateCommunity.icon + * Format: url + */ + icon_url?: string + /** + * CreateCommunity.banner + * Format: url + */ + banner_url?: string + /** CreateCommunity.nsfw */ + nsfw?: boolean + /** CreateCommunity.restricted_to_mods */ + restricted_to_mods?: boolean + /** CreateCommunity.local_only */ + local_only?: boolean + /** CreateCommunity.discussion_languages */ + discussion_languages?: number[] + } + /** DeleteCommunity */ + DeleteCommunity: { + /** DeleteCommunity.community_id */ + community_id: number + /** DeleteCommunity.deleted */ + deleted: boolean + } + /** AddModToCommunity */ + AddModToCommunity: { + /** AddModToCommunity.community_id */ + community_id: number + /** AddModToCommunity.person_id */ + person_id: number + /** AddModToCommunity.added */ + added: boolean + } + /** ListCommunities */ + ListCommunities: { + /** ListCommunities.type_ */ + type_?: components['schemas']['ListingType'] + /** ListCommunities.sort */ + sort?: components['schemas']['CommunitySortType'] + /** ListCommunities.show_nsfw */ + show_nsfw?: boolean + /** ListCommunities.page */ + page?: number + /** ListCommunities.limit */ + limit?: number + } + /** FollowCommunity */ + FollowCommunity: { + /** FollowCommunity.community_id */ + community_id: number + /** FollowCommunity.follow */ + follow: boolean + } + /** BlockCommunity */ + BlockCommunity: { + /** BlockCommunity.community_id */ + community_id: number + /** BlockCommunity.block */ + block: boolean + } + /** SubscribeCommunity */ + SubscribeCommunity: { + /** SubscribeCommunity.community_id */ + community_id: number + /** SubscribeCommunity.subscribe */ + subscribe: boolean + } + /** GetCommunityModerationBansList */ + GetCommunityModerationBansList: { + /** + * GetCommunityModerationBansList.community_id + * @example 42 + */ + community_id?: number + /** + * GetCommunityModerationBansList.page + * @example 1 + */ + page?: number + } + /** ModerateCommunityBan */ + ModerateCommunityBan: { + /** + * PostCommunityModerateBan.community_id + * @example 42 + */ + community_id: number + /** + * PostCommunityModerateBan.user_id + * @example 1234 + */ + user_id: number + /** + * PostCommunityModerateBan.reason + * @example Violation of Rule 1. + */ + reason: string + /** + * PostCommunityModerateBan.expiredAt + * @example 2025-01-01T12:00:00 + */ + expiredAt: string + } + /** ModerateCommunityUnBan */ + ModerateCommunityUnBan: { + /** + * PutCommunityModerateUnBan.community_id + * @example 42 + */ + community_id: number + /** + * PutCommunityModerateUnBan.user_id + * @example 1234 + */ + user_id: number + } + /** ModerateCommunityPostNsfw */ + ModerateCommunityPostNsfw: { + /** + * PostCommunityModeratePostNsfw.post_id + * @example 123456 + */ + post_id: number + /** + * PostCommunityModeratePostNsfw.nsfw_status + * @example true + */ + nsfw_status: boolean + } + /** GetPosts */ + GetPosts: { + /** GetPosts.type_ */ + type_?: components['schemas']['ListingType'] + /** GetPosts.sort */ + sort?: components['schemas']['SortType'] + /** GetPosts.page_cursor */ + page_cursor?: number + /** GetPosts.limit */ + limit?: number + /** GetPosts.community_id */ + community_id?: number + /** GetPosts.person_id */ + person_id?: number + /** GetPosts.community_name */ + community_name?: string + /** GetPosts.liked_only */ + liked_only?: boolean + /** GetPosts.saved_only */ + saved_only?: boolean + } + /** GetPost */ + GetPost: { + /** GetPost.id */ + id?: number + /** GetPost.comment_id */ + comment_id?: number + } + /** EditPost */ + EditPost: { + /** EditPost.post_id */ + post_id: number + /** EditPost.title */ + title?: string + /** + * EditPost.url + * Format: url + */ + url?: string + /** EditPost.body */ + body?: string + /** EditPost.nsfw */ + nsfw?: boolean + /** EditPost.language_id */ + language_id?: number + } + /** CreatePost */ + CreatePost: { + /** CreatePost.title */ + title: string + /** CreatePost.community_id */ + community_id: number + /** + * CreatePost.url + * Format: url + */ + url?: string + /** CreatePost.body */ + body?: string + /** CreatePost.nsfw */ + nsfw?: boolean + /** CreatePost.language_id */ + language_id?: number + } + /** CreatePostLike */ + CreatePostLike: { + /** CreatePostLike.post_id */ + post_id: number + /** CreatePostLike.score */ + score: number + } + /** SavePost */ + SavePost: { + /** SavePost.post_id */ + post_id: number + /** SavePost.save */ + save: boolean + } + /** SubscribePost */ + SubscribePost: { + /** SubscribePost.post_id */ + post_id: number + /** SubscribePost.subscribe */ + subscribe: boolean + } + /** DeletePost */ + DeletePost: { + /** DeletePost.post_id */ + post_id: number + /** DeletePost.deleted */ + deleted: boolean + } + /** CreatePostReport */ + CreatePostReport: { + /** CreatePostReport.post_id */ + post_id: number + /** CreatePostReport.reason */ + reason: string + } + /** LockPost */ + LockPost: { + /** LockPost.post_id */ + post_id: number + /** LockPost.locked */ + locked: boolean + } + /** FeaturePost */ + FeaturePost: { + /** FeaturePost.post_id */ + post_id: number + /** FeaturePost.featured */ + featured: boolean + /** FeaturePost.feature_type */ + feature_type: components['schemas']['PostFeatureType'] + } + /** MarkPostAsRead */ + MarkPostAsRead: { + /** MarkPostAsRead.post_ids */ + post_ids?: number[] + /** MarkPostAsRead.post.id */ + post_id?: number + /** MarkPostAsRead.read */ + read: boolean + } + /** RemovePost */ + RemovePost: { + /** RemovePost.post_id */ + post_id: number + /** RemovePost.removed */ + removed: boolean + /** RemovePost.reason */ + reason?: string + } + /** CreateComment */ + CreateComment: { + /** CreateComment.content */ + body: string + /** CreateComment.post_id */ + post_id: number + /** CreateComment.parent_id */ + parent_id?: number + /** CreateComment.language_id */ + language_id?: number + } + /** EditComment */ + EditComment: { + /** EditComment.comment_id */ + comment_id: number + /** EditComment.content */ + body?: string + /** EditComment.language_id */ + language_id?: number + } + /** GetComment */ + GetComment: { + /** GetComment.id */ + id: number + } + /** GetComments */ + GetComments: { + /** GetComments.type_ */ + type_?: components['schemas']['ListingType'] + /** GetComments.sort */ + sort?: components['schemas']['CommentSortType'] + /** GetComments.max_depth */ + max_depth?: number + /** GetComments.page */ + page?: number + /** GetComments.limit */ + limit?: number + /** GetComments.community_id */ + community_id?: number + /** GetComments.post_id */ + post_id?: number + /** GetComments.parent_id */ + parent_id?: number + /** GetComments.person_id */ + person_id?: number + /** GetComments.liked_only */ + liked_only?: boolean + /** GetComments.saved_only */ + saved_only?: boolean + } + /** DeleteComment */ + DeleteComment: { + /** DeleteComment.comment_id */ + comment_id: number + /** DeleteComment.deleted */ + deleted: boolean + } + /** MarkReplyAsRead */ + MarkReplyAsRead: { + /** MarkReplyAsRead.comment_reply_id */ + comment_reply_id: number + read: boolean + } + /** RemoveComment */ + RemoveComment: { + /** RemoveComment.comment_id */ + comment_id: number + /** RemoveComment.removed */ + removed: boolean + /** RemoveComment.reason */ + reason?: string + } + /** CreateCommentLike */ + CreateCommentLike: { + /** CreateCommentLike.comment_id */ + comment_id: number + /** CreateCommentLike.score */ + score: number + } + /** SaveComment */ + SaveComment: { + /** SaveComment.comment_id */ + comment_id: number + /** SaveComment.save */ + save: boolean + } + /** SubscribeComment */ + SubscribeComment: { + /** SubscribeComment.comment_id */ + comment_id: number + /** SubscribeComment.subscribe */ + subscribe: boolean + } + /** CreateCommentReport */ + CreateCommentReport: { + /** CreateCommentReport.comment_id */ + comment_id: number + /** CreateCommentReport.reason */ + reason: string + } + /** GetPrivateMessages */ + GetPrivateMessages: { + /** GetPrivateMessages.unread_only */ + unread_only?: boolean + /** GetPrivateMessages.page */ + page?: number + /** GetPrivateMessages.limit */ + limit?: number + } + /** GetPrivateMessagesConversation */ + GetPrivateMessagesConversation: { + /** GetPrivateMessagesConversation.page */ + page?: number + /** GetPrivateMessagesConversation.limit */ + limit?: number + /** GetPrivateMessagesConversation.person_id */ + person_id: number + } + /** CreatePrivateMessage */ + CreatePrivateMessage: { + /** CreatePrivateMessage.content */ + content: string + /** CreatePrivateMessage.recipient_id */ + recipient_id: number + } + /** EditPrivateMessage */ + EditPrivateMessage: { + /** EditPrivateMessage.private_message_id */ + private_message_id: number + /** EditPrivateMessage.content */ + content: string + } + /** MarkPrivateMessageAsRead */ + MarkPrivateMessageAsRead: { + /** MarkPrivateMessageAsRead.private_message_id */ + private_message_id: number + /** MarkPrivateMessageAsRead.read */ + read: boolean + } + /** DeletePrivateMessage */ + DeletePrivateMessage: { + /** DeletePrivateMessage.private_message_id */ + private_message_id: number + /** DeletePrivateMessage.deleted */ + deleted: boolean + } + /** GetPersonDetails */ + GetPersonDetails: { + /** GetPersonDetails.person_id */ + person_id?: number + /** GetPersonDetails.username */ + username?: string + /** GetPersonDetails.sort */ + sort?: components['schemas']['SortType'] + /** GetPersonDetails.page */ + page?: number + /** GetPersonDetails.limit */ + limit?: number + /** GetPersonDetails.community_id */ + community_id?: number + /** GetPersonDetails.saved_only */ + saved_only?: boolean + /** GetPersonDetails.include_content */ + include_content?: boolean + } + /** GetReplies */ + GetReplies: { + /** GetReplies.sort */ + sort?: components['schemas']['CommentSortType'] + /** GetReplies.page */ + page?: number + /** GetReplies.limit */ + limit?: number + /** GetReplies.unread_only */ + unread_only?: boolean + } + /** BlockPerson */ + BlockPerson: { + /** BlockPerson.person_id */ + person_id: number + /** BlockPerson.block */ + block: boolean + } + /** Login */ + Login: { + /** Login.username */ + username: string + /** Login.password */ + password: string + } + /** GetUnreadCountResponse */ + GetUnreadCountResponse: { + /** GetUnreadCountResponse.replies */ + replies: number + /** GetUnreadCountResponse.mentions */ + mentions: number + /** GetUnreadCountResponse.private_messages */ + private_messages: number + } + /** SubscribePerson */ + SubscribePerson: { + /** SubscribePerson.person_id */ + person_id: number + /** SubscribePerson.subscribe */ + subscribe: boolean + } + /** SetPersonFlair */ + SetPersonFlair: { + /** SetPersonFlair.community_id */ + community_id: number + /** SetPersonFlair.flair_text */ + flair_text: string + } + /** SaveUserSettings */ + SaveUserSettings: { + /** SaveUserSettings.show_nsfw */ + show_nsfw?: boolean + /** SaveUserSettings.show_read_posts */ + show_read_posts?: boolean + /** SaveUserSettings.bio */ + bio?: string + } + /** GetNotificationStatus */ + GetNotificationStatus: { + /** GetNotificationStatus.status */ + status: components['schemas']['NotificationStatusType'] + /** + * GetNotificationStatus.page + * @default 1 + */ + page: number + } + /** EditNotificationState */ + EditNotificationState: { + /** GetNotificationStatus.notif_id */ + notif_id?: number + /** GetNotificationStatus.read_state */ + read_state?: boolean + } + /** FeedList */ + FeedList: { + /** + * FeedList.include_communities + * @description include list of communities in each feed with result + */ + include_communities?: boolean + /** + * FeedList.mine_only + * @description only return feeds created by the authorized user + */ + mine_only?: boolean + } + /** TopicList */ + TopicList: { + /** + * TopicList.include_communities + * @description include list of communities in each topic with result + */ + include_communities?: boolean + } + ImageUpload: { + /** Format: binary */ + file: string + } + /** SuccessResponse */ + SuccessResponse: { + success: boolean + } + BadRequest: { + /** @example An error occurred */ + error: string + } + /** GetSiteResponse */ + GetSiteResponse: { + /** GetSiteResponse.my_user */ + my_user?: components['schemas']['MyUserInfo'] + /** GetSiteResponse.site */ + site: components['schemas']['Site'] + /** GetSiteResponse.version */ + version: string + /** GetSiteResponse.admins */ + admins: components['schemas']['PersonView'][] + } + /** GetSiteVersionResponse */ + GetSiteVersionResponse: { + /** GetSiteVersionResponse.version */ + version: string + } + /** BlockInstanceResponse */ + BlockInstanceResponse: { + /** BlockInstanceResponse.blocked */ + blocked: boolean + } + GetSiteInstanceChooserResponse: { + language: components['schemas']['LanguageView'] + /** GetSiteInstanceChooserResponse.nsfw */ + nsfw: boolean + /** GetSiteInstanceChooserResponse.newbie_friendly */ + newbie_friendly: boolean + /** GetSiteInstanceChooserResponse.name */ + name: string + /** GetSiteInstanceChooserResponse.elevator_pitch */ + elevator_pitch: string + /** GetSiteInstanceChooserResponse.description */ + description: string + /** GetSiteInstanceChooserResponse.about */ + about: string + /** GetSiteInstanceChooserResponse.sidebar */ + sidebar: string + /** GetSiteInstanceChooserResponse.logo_url */ + logo_url: string + /** GetSiteInstanceChooserResponse.majority */ + maturity: string + /** GetSiteInstanceChooserResponse.tos_url */ + tos_url: string + /** GetSiteInstanceChooserResponse.mau */ + mau: number + /** GetSiteInstanceChooserResponse.can_make_communities */ + can_make_communities: boolean + /** GetSiteInstanceChooserResponse.defederation */ + defederation: string[] + /** GetSiteInstanceChooserResponse.trusts */ + trusts: string[] + /** GetSiteInstanceChooserResponse.registration_mode */ + registration_mode: string + } + GetSiteInstanceChooserSearchResponse: { + result: components['schemas']['GetSiteInstanceChooserSearchResponseItem'][] + } + /** SearchResponse */ + SearchResponse: { + /** SearchResponse.type_ */ + type_: components['schemas']['SearchType'] + /** SearchResponse.posts */ + posts: components['schemas']['PostView'][] + /** SearchResponse.communities */ + communities: components['schemas']['CommunityView'][] + /** SearchResponse.users */ + users: components['schemas']['PersonView'][] + } + /** ResolveObjectResponse */ + ResolveObjectResponse: { + /** ResolveObjectResponse.comment */ + comment?: components['schemas']['CommentView'] + /** ResolveObjectResponse.post */ + post?: components['schemas']['PostView'] + /** ResolveObjectResponse.community */ + community?: components['schemas']['CommunityView'] + /** ResolveObjectResponse.person */ + person?: components['schemas']['PersonView'] + } + /** GetFederatedInstancesResponse */ + GetFederatedInstancesResponse: { + /** GetFederatedInstancesResponse.federated_instances */ + federated_instances?: components['schemas']['FederatedInstancesView'] + } + /** GetCommunityResponse */ + GetCommunityResponse: { + /** GetCommunityResponse.community_view */ + community_view: components['schemas']['CommunityView'] + /** GetCommunityResponse.site */ + site?: components['schemas']['Site'] + /** GetCommunityResponse.moderators */ + moderators: components['schemas']['CommunityModeratorView'][] + /** GetCommunityResponse.discussion_languages */ + discussion_languages: number[] + } + /** CommunityResponse */ + CommunityResponse: { + /** CommunityResponse.community_view */ + community_view: components['schemas']['CommunityView'] + /** CommunityResponse.discussion_languages */ + discussion_languages: number[] + } + /** ListCommunitiesResponse */ + ListCommunitiesResponse: { + /** ListCommunitiesResponse.communities */ + communities: components['schemas']['CommunityView'][] + } + /** BlockCommunityResponse */ + BlockCommunityResponse: { + /** BlockCommunityResponse.community_view */ + community_view: components['schemas']['CommunityView'] + /** BlockCommunityResponse.blocked */ + blocked: boolean + } + /** AddModToCommunityResponse */ + AddModToCommunityResponse: { + /** AddModToCommunityResponse.moderators */ + moderators: components['schemas']['CommunityModeratorView'][] + } + /** ModerationCommunityBansListResponse */ + ModerationCommunityBansListResponse: { + /** GetCommunityModerationBansListResponse.items */ + items?: components['schemas']['CommunityModerationBanItem'][] + /** + * GetCommunityModerationBansListResponse.next_page + * @example 3 + */ + next_page?: string + } + /** ModerateCommunityBanResponse */ + ModerateCommunityBanResponse: components['schemas']['CommunityModerationBanItem'] + /** ModerateCommunityUnBanResponse */ + ModerateCommunityUnBanResponse: components['schemas']['CommunityModerationBanItem'] + /** ModerateCommunityPostNsfwResponse */ + ModerateCommunityPostNsfwResponse: components['schemas']['PostView'] + /** GetPostsResponse */ + GetPostsResponse: { + /** GetPostsResponse.posts */ + posts: components['schemas']['PostView'][] + } + /** GetPostResponse */ + GetPostResponse: { + /** GetPostResponse.post_view */ + post_view: components['schemas']['PostView'] + /** GetPostResponse.community_view */ + community_view: components['schemas']['CommunityView'] + /** GetPostResponse.moderators */ + moderators: components['schemas']['CommunityModeratorView'][] + /** GetPostResponse.cross_posts */ + cross_posts: components['schemas']['PostView'][] + } + /** PostResponse */ + PostResponse: { + /** PostResponse.post_view */ + post_view: components['schemas']['PostView'] + } + /** PostReportResponse */ + PostReportResponse: { + /** PostReportResponse.post_report_view */ + post_report_view: components['schemas']['PostReportView'] + } + /** CommentResponse */ + CommentResponse: { + /** CommentResponse.comment_view */ + comment_view: components['schemas']['CommentView'] + } + /** GetCommentsResponse */ + GetCommentsResponse: { + /** GetCommentsResponse.comments */ + comments: components['schemas']['CommentView'][] + } + /** CommentReportResponse */ + CommentReportResponse: { + /** CommentReportResponse.comment_report_view */ + comment_report_view: components['schemas']['CommentReportView'] + } + /** PrivateMessagesResponse */ + PrivateMessagesResponse: { + /** PrivateMessagesResponse.private_messages */ + private_messages: components['schemas']['PrivateMessageView'][] + } + /** PrivateMessageResponse */ + PrivateMessageResponse: { + /** PrivateMessageResponse.private_message_view */ + private_message_view: components['schemas']['PrivateMessageView'] + } + /** GetPersonDetailsResponse */ + GetPersonDetailsResponse: { + /** GetPersonDetailsResponse.person_view */ + person_view: components['schemas']['PersonView'] + /** GetPersonDetailsResponse.site */ + site?: components['schemas']['Site'] + /** GetPersonDetailsResponse.comments */ + comments: components['schemas']['CommentView'][] + /** GetPersonDetailsResponse.posts */ + posts: components['schemas']['PostView'][] + /** GetPersonDetailsResponse.moderates */ + moderates: components['schemas']['CommunityModeratorView'][] + } + /** GetRepliesResponse */ + GetRepliesResponse: { + /** GetRepliesResponse.replies */ + replies: components['schemas']['CommentReplyView'][] + } + /** PersonResponse */ + PersonResponse: { + /** PersonResponse.person_view */ + person_view: components['schemas']['PersonView'] + } + /** BlockPersonResponse */ + BlockPersonResponse: { + /** BlockPersonResponse.person_view */ + person_view: components['schemas']['PersonView'] + /** BlockPersonResponse.blocked */ + blocked: boolean + } + /** LoginResponse */ + LoginResponse: { + /** LoginResponse.jwt */ + jwt?: string + } + ErrorResponseLogin: { + /** @example incorrect_login */ + error?: string + } + /** NotificationsResponse */ + NotificationsResponse: { + /** NotificationsResponse.counts */ + counts: components['schemas']['NotificationsCountsView'] + /** NotificationsResponse.items */ + items: ( + | components['schemas']['NotificationsItemUserView'] + | components['schemas']['NotificationsItemCommunityView'] + | components['schemas']['NotificationsItemTopicView'] + | components['schemas']['NotificationsItemPostView'] + | components['schemas']['NotificationsItemReplyView'] + | components['schemas']['NotificationsItemFeedView'] + | components['schemas']['NotificationsItemPostMentionView'] + | components['schemas']['NotificationsItemCommentMentionView'] + )[] + /** + * NotificationsResponse.status + * @example New + */ + status: string + /** + * NotificationsResponse.user + * @example MyPieFedUserName + */ + user: string + } + /** NotificationsReadStatusResponse */ + NotificationsReadStatusResponse: + | components['schemas']['NotificationsItemUserView'] + | components['schemas']['NotificationsItemCommunityView'] + | components['schemas']['NotificationsItemTopicView'] + | components['schemas']['NotificationsItemPostView'] + | components['schemas']['NotificationsItemReplyView'] + | components['schemas']['NotificationsItemFeedView'] + | components['schemas']['NotificationsItemPostMentionView'] + | components['schemas']['NotificationsItemCommentMentionView'] + /** NotificationsCountResponse */ + NotificationsCountResponse: { + /** + * NotificationsCountResponse.count + * @example 42 + */ + count?: number + } + /** NotificationsMarkAllReadResponse */ + NotificationsMarkAllReadResponse: { + /** + * NotificationsMarkAllReadResponse.mark_all_notifications_as_read + * @example complete + */ + mark_all_notifications_as_read?: string + } + FeedListResponse: { + feeds: components['schemas']['FeedView'][] + } + TopicListResponse: { + /** TopicListResponse.topics */ + topics: components['schemas']['TopicView'][] + } + UploadResponse: { + /** + * Format: url + * @example https://preferred.social/static/media/image.png + */ + url: string + } + /** Site */ + Site: { + /** + * Site.actor_id + * Format: url + * @example https://piefed.social/ + */ + actor_id: string + /** Site.all_languages */ + all_languages?: components['schemas']['LanguageView'][] + /** Site.description */ + description?: string + /** Site.enable_downvotes */ + enable_downvotes?: boolean + /** + * Site.icon + * Format: url + */ + icon?: string + /** Site.name */ + name: string + /** Site.registration_mode */ + registration_mode?: components['schemas']['RegistrationMode'] + /** Site.sidebar */ + sidebar?: string + /** Site.user_count */ + user_count?: number + } + /** Instance */ + Instance: { + /** Instance.id */ + id: number + /** Instance.domain */ + domain: string + /** + * Instance.published + * Format: date-time + */ + published: string + /** + * Instance.updated + * Format: date-time + */ + updated?: string + /** Instance.software */ + software?: string + /** Instance.version */ + version?: string + } + /** InstanceWithoutFederationState */ + InstanceWithoutFederationState: { + /** InstanceWithoutFederationState.id */ + id: number + /** InstanceWithoutFederationState.domain */ + domain: string + /** InstanceWithoutFederationState.published */ + published: string + /** InstanceWithoutFederationState.updated */ + updated?: string + /** InstanceWithoutFederationState.software */ + software?: string + /** InstanceWithoutFederationState.version */ + version?: string + } + /** Community */ + Community: { + /** + * Community.actor_id + * Format: url + */ + actor_id: string + /** Community.ap_domain */ + ap_domain?: string + /** Community.banned */ + banned?: boolean + /** + * Community.banner + * Format: url + */ + banner?: string + /** Community.deleted */ + deleted: boolean + /** Community.description */ + description?: string + /** Community.hidden */ + hidden: boolean + /** + * Community.icon + * Format: url + */ + icon?: string + /** Community.id */ + id: number + /** Community.instance_id */ + instance_id: number + /** Community.local */ + local: boolean + /** Community.name */ + name: string + /** Community.nsfw */ + nsfw: boolean + /** Community.posting_warning */ + posting_warning?: string + /** + * Community.published + * Format: date-time + */ + published: string + /** Community.removed */ + removed: boolean + /** Community.restricted_to_mods */ + restricted_to_mods: boolean + /** Community.title */ + title: string + /** + * Community.updated + * Format: date-time + */ + updated?: string + } + /** Post */ + Post: { + /** Post.id */ + id: number + /** Post.title */ + title: string + /** + * Post.url + * Format: url + */ + url?: string + /** Post.body */ + body?: string + /** Post.user_id */ + user_id: number + /** Post.community_id */ + community_id: number + /** Post.removed */ + removed: boolean + /** Post.locked */ + locked: boolean + /** + * Post.published + * Format: date-time + */ + published: string + /** + * Post.updated + * Format: date-time + */ + updated?: string + /** Post.deleted */ + deleted: boolean + /** Post.nsfw */ + nsfw: boolean + /** + * Post.thumbnail_url + * Format: url + */ + thumbnail_url?: string + /** + * Post.small_thumbnail_url + * Format: url + */ + small_thumbnail_url?: string + /** + * Post.ap_id + * Format: url + */ + ap_id: string + /** Post.local */ + local: boolean + /** Post.language_id */ + language_id: number + /** Post.sticky */ + sticky: boolean + /** Post.alt_text */ + alt_text?: string + } + /** PostReport */ + PostReport: { + /** PostReport.id */ + id: number + /** PostReport.creator_id */ + creator_id: number + /** PostReport.post_id */ + post_id: number + /** PostReport.original_post_name */ + original_post_name: string + /** PostReport.original_post_url */ + original_post_url?: string + /** PostReport.original_post_body */ + original_post_body?: string + /** PostReport.reason */ + reason: string + /** PostReport.resolved */ + resolved: boolean + /** PostReport.resolver_id */ + resolver_id?: number + /** + * PostReport.published + * Format: date-time + */ + published: string + /** + * PostReport.updated + * Format: date-time + */ + updated?: string + } + /** Comment */ + Comment: { + /** Comment.id */ + id: number + /** Comment.user_id */ + user_id: number + /** Comment.post_id */ + post_id: number + /** Comment.body */ + body: string + /** Comment.removed */ + removed: boolean + /** + * Comment.published + * Format: date-time + */ + published: string + /** + * Comment.updated + * Format: date-time + */ + updated?: string + /** Comment.deleted */ + deleted: boolean + /** + * Comment.ap_id + * Format: url + */ + ap_id: string + /** Comment.local */ + local: boolean + /** Comment.path */ + path: string + /** Comment.distinguished */ + distinguished?: boolean + /** Comment.language_id */ + language_id: number + } + /** CommentReply */ + CommentReply: { + /** CommentReply.id */ + id: number + /** CommentReply.recipient_id */ + recipient_id: number + /** CommentReply.comment_id */ + comment_id: number + /** CommentReply.read */ + read: boolean + /** + * CommentReply.published + * Format: date-time + */ + published: string + } + /** CommentReport */ + CommentReport: { + /** CommentReport.id */ + id: number + /** CommentReport.creator_id */ + creator_id: number + /** CommentReport.comment_id */ + comment_id: number + /** CommentReport.original_comment_text */ + original_comment_text: string + /** CommentReport.reason */ + reason: string + /** CommentReport.resolved */ + resolved: boolean + /** CommentReport.resolver_id */ + resolver_id?: number + /** + * CommentReport.published + * Format: date-time + */ + published: string + /** + * CommentReport.updated + * Format: date-time + */ + updated?: string + } + /** PrivateMessage */ + PrivateMessage: { + /** PrivateMessage.id */ + id: number + /** PrivateMessage.creator_id */ + creator_id: number + /** PrivateMessage.recipient_id */ + recipient_id: number + /** PrivateMessage.content */ + content: string + /** PrivateMessage.deleted */ + deleted: boolean + /** PrivateMessage.read */ + read: boolean + /** + * PrivateMessage.published + * Format: date-time + */ + published: string + /** + * PrivateMessage.updated + * Format: date-time + */ + updated?: string + /** + * PrivateMessage.ap_id + * Format: url + */ + ap_id: string + /** PrivateMessage.local */ + local: boolean + } + /** Person */ + Person: { + /** + * Person.actor_id + * Format: url + */ + actor_id: string + /** + * Person.avatar + * Format: url + */ + avatar?: string + /** Person.banned */ + banned: boolean + /** + * Person.banner + * Format: url + */ + banner?: string + /** Person.about */ + about?: string + /** Person.bot */ + bot: boolean + /** Person.deleted */ + deleted: boolean + /** Person.flair */ + flair?: string + /** Person.id */ + id: number + /** Person.instance_id */ + instance_id: number + /** Person.local */ + local: boolean + /** + * Person.published + * Format: date-time + */ + published: string + /** Person.title */ + title?: string + /** Person.user_name */ + user_name: string + } + /** LocalUser */ + LocalUser: { + /** LocalUser.default_listing_type */ + default_listing_type: components['schemas']['ListingType'] + /** LocalUser.default_sort_type */ + default_sort_type: components['schemas']['SortType'] + /** LocalUser.show_bot_accounts */ + show_bot_accounts: boolean + /** LocalUser.show_nsfw */ + show_nsfw: boolean + /** LocalUser.show_read_posts */ + show_read_posts: boolean + /** LocalUser.show_scores */ + show_scores: boolean + } + /** MyUserInfo */ + MyUserInfo: { + /** MyUserInfo.community_blocks */ + community_blocks: components['schemas']['CommunityBlockView'][] + /** MyUserInfo.discussion_languages */ + discussion_languages: components['schemas']['LanguageView'][] + /** MyUserInfo.follows */ + follows: components['schemas']['CommunityFollowerView'][] + /** MyUserInfo.instance_blocks */ + instance_blocks: components['schemas']['InstanceBlockView'][] + /** MyUserInfo.local_user_view */ + local_user_view: components['schemas']['LocalUserView'] + /** MyUserInfo.moderates */ + moderates: components['schemas']['CommunityModeratorView'][] + /** MyUserInfo.person_blocks */ + person_blocks: components['schemas']['PersonBlockView'][] + } + GetSiteInstanceChooserSearchResponseItem: { + /** GetSiteInstanceChooserSearchResponseItem.id */ + id: number + /** GetSiteInstanceChooserSearchResponseItem.name */ + name: string + /** GetSiteInstanceChooserSearchResponseItem.domain */ + domain: string + /** GetSiteInstanceChooserSearchResponseItem.elevator_pitch */ + elevator_pitch: string + /** GetSiteInstanceChooserSearchResponseItem.description */ + description: string + /** GetSiteInstanceChooserSearchResponseItem.about */ + about: string + /** GetSiteInstanceChooserSearchResponseItem.sidebar */ + sidebar: string + /** GetSiteInstanceChooserSearchResponseItem.logo_url */ + logo_url: string + /** GetSiteInstanceChooserSearchResponseItem.maturity */ + maturity: string + /** GetSiteInstanceChooserSearchResponseItem.tos_url */ + tos_url: string + /** GetSiteInstanceChooserSearchResponseItem.uptime */ + uptime: string + /** GetSiteInstanceChooserSearchResponseItem.mau */ + mau: number + /** GetSiteInstanceChooserSearchResponseItem.can_make_communities */ + can_make_communities: boolean + /** GetSiteInstanceChooserSearchResponseItem.newbie_friendly */ + newbie_friendly: boolean + /** GetSiteInstanceChooserSearchResponseItem.defederation */ + defederation: string[] + /** GetSiteInstanceChooserSearchResponseItem.trusts */ + trusts: string[] + /** GetSiteInstanceChooserSearchResponseItem.registration_mode */ + registration_mode: string + /** GetSiteInstanceChooserSearchResponseItem.language */ + language: string + /** GetSiteInstanceChooserSearchResponseItem.monthsmonitored */ + monthsmonitored: number + } + /** FederatedInstancesView */ + FederatedInstancesView: { + /** FederatedInstances.linked */ + linked: components['schemas']['InstanceWithoutFederationState'][] + /** FederatedInstances.allowed */ + allowed: components['schemas']['InstanceWithoutFederationState'][] + /** FederatedInstances.blocked */ + blocked: components['schemas']['InstanceWithoutFederationState'][] + } + /** CommunityBlockView */ + CommunityBlockView: { + /** CommunityBlockView.community */ + community: components['schemas']['Community'] + /** CommunityBlockView.person */ + person: components['schemas']['Person'] + } + /** CommunityFollowerView */ + CommunityFollowerView: { + /** CommunityFollowerView.community */ + community: components['schemas']['Community'] + /** CommunityFollowerView.follower */ + follower: components['schemas']['Person'] + } + /** LanguageView */ + LanguageView: { + /** + * Language.code + * @example en + */ + code?: string + /** + * Language.id + * @example 2 + */ + id?: number + /** + * Language.name + * @example English + */ + name?: string + } + /** InstanceBlockView */ + InstanceBlockView: { + /** InstanceBlockView.person */ + person: components['schemas']['Person'] + /** InstanceBlockView.instance */ + instance: components['schemas']['Instance'] + /** InstanceBlockView.site */ + site?: components['schemas']['Site'] + } + /** LocalUserView */ + LocalUserView: { + /** LocalUserView.counts */ + counts: components['schemas']['PersonAggregates'] + /** LocalUserView.local_user */ + local_user: components['schemas']['LocalUser'] + /** LocalUserView.person */ + person: components['schemas']['Person'] + } + /** CommunityModeratorView */ + CommunityModeratorView: { + /** CommunityModeratorView.community */ + community: components['schemas']['Community'] + /** CommunityModeratorView.moderator */ + moderator: components['schemas']['Person'] + } + /** PersonBlockView */ + PersonBlockView: { + /** PersonBlockView.person */ + person: components['schemas']['Person'] + /** PersonBlockView.target */ + target: components['schemas']['Person'] + } + /** PersonView */ + PersonView: { + /** PersonView.person */ + person: components['schemas']['Person'] + /** PersonView.counts */ + counts: components['schemas']['PersonAggregates'] + /** PersonView.is_admin */ + is_admin: boolean + /** PersonView.activity_alert */ + activity_alert: boolean + } + /** CommentView */ + CommentView: { + /** CommentView.comment */ + comment: components['schemas']['Comment'] + /** CommentView.creator */ + creator: components['schemas']['Person'] + /** CommentView.post */ + post: components['schemas']['Post'] + /** CommentView.community */ + community: components['schemas']['Community'] + /** CommentView.counts */ + counts: components['schemas']['CommentAggregates'] + /** CommentView.creator_banned_from_community */ + creator_banned_from_community: boolean + /** CommentView.banned_from_community */ + banned_from_community: boolean + /** CommentView.creator_is_moderator */ + creator_is_moderator: boolean + /** CommentView.creator_is_admin */ + creator_is_admin: boolean + /** CommentView.subscribed */ + subscribed: components['schemas']['SubscribedType'] + /** CommentView.saved */ + saved: boolean + /** CommentView.activity_alert */ + activity_alert: boolean + /** CommentView.creator_blocked */ + creator_blocked: boolean + /** CommentView.my_vote */ + my_vote?: number + } + /** PostView */ + PostView: { + /** PostView.post */ + post: components['schemas']['Post'] + /** PostView.creator */ + creator: components['schemas']['Person'] + /** PostView.community */ + community: components['schemas']['Community'] + /** PostView.creator_banned_from_community */ + creator_banned_from_community: boolean + /** PostView.banned_from_community */ + banned_from_community: boolean + /** PostView.creator_is_moderator */ + creator_is_moderator: boolean + /** PostView.creator_is_admin */ + creator_is_admin: boolean + /** PostView.counts */ + counts: components['schemas']['PostAggregates'] + /** PostView.subscribed */ + subscribed: components['schemas']['SubscribedType'] + /** PostView.saved */ + saved: boolean + /** PostView.activity_alert */ + activity_alert?: boolean + /** PostView.read */ + read: boolean + /** PostView.hidden */ + hidden: boolean + /** PostView.my_vote */ + my_vote?: number + /** PostView.unread_comments */ + unread_comments: number + } + /** CommunityView */ + CommunityView: { + /** CommunityView.community */ + community: components['schemas']['Community'] + /** CommunityView.subscribed */ + subscribed: components['schemas']['SubscribedType'] + /** CommunityView.blocked */ + blocked: boolean + /** CommunityView.counts */ + counts: components['schemas']['CommunityAggregates'] + /** CommunityView.activity_alert */ + activity_alert: boolean + } + /** PostReportView */ + PostReportView: { + /** PostReportView.post_report */ + post_report: components['schemas']['PostReport'] + /** PostReportView.post */ + post: components['schemas']['Post'] + /** PostReportView.community */ + community: components['schemas']['Community'] + /** PostReportView.creator */ + creator: components['schemas']['Person'] + /** PostReportView.post_creator */ + post_creator: components['schemas']['Person'] + /** PostReportView.creator_banned_from_community */ + creator_banned_from_community: boolean + /** PostReportView.creator_is_moderator */ + creator_is_moderator: boolean + /** PostReportView.creator_is_admin */ + creator_is_admin: boolean + /** PostReportView.subscribed */ + subscribed: components['schemas']['SubscribedType'] + /** PostReportView.saved */ + saved: boolean + /** PostReportView.creator_blocked */ + creator_blocked: boolean + /** PostReportView.my_vote */ + my_vote?: number + /** PostReportView.counts */ + counts: components['schemas']['PostAggregates'] + /** PostReportView.resolver */ + resolver?: components['schemas']['Person'] + } + /** CommentReportView */ + CommentReportView: { + /** CommentReportView.comment_report */ + comment_report: components['schemas']['CommentReport'] + /** CommentReportView.comment */ + comment: components['schemas']['Comment'] + /** CommentReportView.post */ + post: components['schemas']['Post'] + /** CommentReportView.community */ + community: components['schemas']['Community'] + /** CommentReportView.creator */ + creator: components['schemas']['Person'] + /** CommentReportView.comment_creator */ + comment_creator: components['schemas']['Person'] + /** CommentReportView.counts */ + counts: components['schemas']['CommentAggregates'] + /** CommentReportView.creator_banned_from_community */ + creator_banned_from_community: boolean + /** CommentReportView.creator_is_moderator */ + creator_is_moderator: boolean + /** CommentReportView.creator_is_admin */ + creator_is_admin: boolean + /** CommentReportView.creator_blocked */ + creator_blocked: boolean + /** CommentReportView.subscribed */ + subscribed: components['schemas']['SubscribedType'] + /** CommentReportView.saved */ + saved: boolean + /** CommentReportView.my_vote */ + my_vote?: number + /** CommentReportView.resolver */ + resolver?: components['schemas']['Person'] + } + /** CommentReplyView */ + CommentReplyView: { + /** CommentReplyView.comment_reply */ + comment_reply: components['schemas']['CommentReply'] + /** CommentReplyView.comment */ + comment: components['schemas']['Comment'] + /** CommentReplyView.creator */ + creator: components['schemas']['Person'] + /** CommentReplyView.post */ + post: components['schemas']['Post'] + /** CommentReplyView.community */ + community: components['schemas']['Community'] + /** CommentReplyView.recipient */ + recipient: components['schemas']['Person'] + /** CommentReplyView.counts */ + counts: components['schemas']['CommentAggregates'] + /** CommentReplyView.creator_banned_from_community */ + creator_banned_from_community: boolean + /** CommentReplyView.creator_is_moderator */ + creator_is_moderator: boolean + /** CommentReplyView.creator_is_admin */ + creator_is_admin: boolean + /** CommentReplyView.subscribed */ + subscribed: components['schemas']['SubscribedType'] + /** CommentReplyView.saved */ + saved: boolean + /** CommentReplyView.creator_blocked */ + creator_blocked: boolean + /** CommentReplyView.my_vote */ + my_vote?: number + } + /** CommentReplyResponse */ + CommentReplyResponse: { + /** CommentResponse.comment_reply_view */ + comment_reply_view: components['schemas']['CommentReplyView'] + } + /** PrivateMessageView */ + PrivateMessageView: { + /** PrivateMessageView.private_message */ + private_message: components['schemas']['PrivateMessage'] + /** PrivateMessageView.creator */ + creator: components['schemas']['Person'] + /** PrivateMessageView.recipient */ + recipient: components['schemas']['Person'] + } + /** CommunityModerationBanItem */ + CommunityModerationBanItem: { + /** + * CommunityModerationBanItem.reason + * @example Violation of Rule 4 + */ + reason: string + /** + * CommunityModerationBanItem.expiredAt + * @example 2042-01-01T12:00:00 + */ + expiredAt: string + /** CommunityModerationBanItem.community */ + community: components['schemas']['Community'] + /** CommunityModerationBanItem.bannedUser */ + bannedUser: components['schemas']['Person'] + /** CommunityModerationBanItem.bannedBy */ + bannedBy: components['schemas']['Person'] + /** + * CommunityModerationBanItem.expired + * @example false + */ + expired: boolean + } + /** NotificationsCountsView */ + NotificationsCountsView: { + /** NotificationsCountsView.new_notifications */ + new_notifications: number + /** NotificationsCountsView.read_notifications */ + read_notifications: number + /** NotificationsCountsView.total_notifications */ + total_notifications?: number + } + /** NotificationsItemUserView */ + NotificationsItemUserView: { + /** + * NotificationsItemUserView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemUserView.notif_type + * @example 0 + */ + notif_type?: number + /** + * NotificationsItemUserView.notif_subtype + * @example new_post_from_followed_user + */ + notif_subtype?: string + /** NotificationsItemUserView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemUserView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemUserView.post_id + * @example 1234 + */ + post_id?: number + /** + * NotificationsItemUserView.notif_body + * @example This is the body of a post. + */ + notif_body?: string + } + /** NotificationsItemCommunityView */ + NotificationsItemCommunityView: { + /** + * NotificationsItemCommunityView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemCommunityView.notif_type + * @example 1 + */ + notif_type?: number + /** + * NotificationsItemCommunityView.notif_subtype + * @example new_post_in_followed_community + */ + notif_subtype?: string + /** NotificationsItemCommunityView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemCommunityView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemCommunityView.post_id + * @example 1234 + */ + post_id?: number + /** NotificationsItemCommunityView.community */ + community?: components['schemas']['CommunityView'] + /** + * NotificationsItemCommunityView.notif_body + * @example This is the body of a post. + */ + notif_body?: string + } + /** NotificationsItemTopicView */ + NotificationsItemTopicView: { + /** + * NotificationsItemTopicView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemTopicView.notif_type + * @example 2 + */ + notif_type?: number + /** + * NotificationsItemTopicView.notif_subtype + * @example new_post_in_followed_topic + */ + notif_subtype?: string + /** NotificationsItemTopicView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemTopicView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemTopicView.post_id + * @example 1234 + */ + post_id?: number + /** + * NotificationsItemTopicView.notif_body + * @example This is the body of a post. + */ + notif_body?: string + } + /** NotificationsItemPostView */ + NotificationsItemPostView: { + /** + * NotificationsItemPostView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemPostView.notif_type + * @example 3 + */ + notif_type?: number + /** + * NotificationsItemPostView.notif_subtype + * @example top_level_comment_on_followed_post + */ + notif_subtype?: string + /** NotificationsItemPostView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemPostView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemPostView.post_id + * @example 1234 + */ + post_id?: number + /** NotificationsItemPostView.comment */ + comment?: components['schemas']['Comment'] + /** + * NotificationsItemPostView.comment_id + * @example 1234 + */ + comment_id?: number + /** + * NotificationsItemPostView.notif_body + * @example This is the body of a comment. + */ + notif_body?: string + } + /** NotificationsItemReplyView */ + NotificationsItemReplyView: { + /** + * NotificationsItemReplyView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemReplyView.notif_type + * @example 4 + */ + notif_type?: number + /** + * NotificationsItemReplyView.notif_subtype + * @example new_reply_on_followed_comment + */ + notif_subtype?: string + /** NotificationsItemReplyView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemReplyView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemReplyView.post_id + * @example 1234 + */ + post_id?: number + /** NotificationsItemReplyView.comment */ + comment?: components['schemas']['Comment'] + /** + * NotificationsItemReplyView.comment_id + * @example 1234 + */ + comment_id?: number + /** + * NotificationsItemReplyView.notif_body + * @example This is the body of a comment. + */ + notif_body?: string + } + /** NotificationsItemFeedView */ + NotificationsItemFeedView: { + /** + * NotificationsItemFeedView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemFeedView.notif_type + * @example 5 + */ + notif_type?: number + /** + * NotificationsItemFeedView.notif_subtype + * @example new_post_in_followed_feed + */ + notif_subtype?: string + /** NotificationsItemFeedView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemFeedView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemFeedView.post_id + * @example 1234 + */ + post_id?: number + /** + * NotificationsItemFeedView.notif_body + * @example This is the body of a post. + */ + notif_body?: string + } + /** NotificationsItemPostMentionView */ + NotificationsItemPostMentionView: { + /** + * NotificationsItemPostMentionView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemPostMentionView.notif_type + * @example 6 + */ + notif_type?: number + /** + * NotificationsItemPostMentionView.notif_subtype + * @example post_mention + */ + notif_subtype?: string + /** NotificationsItemPostMentionView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemPostMentionView.post */ + post?: components['schemas']['PostView'] + /** + * NotificationsItemPostMentionView.post_id + * @example 1234 + */ + post_id?: number + /** + * NotificationsItemPostMentionView.notif_body + * @example This is the body of a post. + */ + notif_body?: string + } + /** NotificationsItemCommentMentionView */ + NotificationsItemCommentMentionView: { + /** + * NotificationsItemCommentMentionView.notif_id + * @example 1234 + */ + notif_id?: number + /** + * NotificationsItemCommentMentionView.notif_type + * @example 6 + */ + notif_type?: number + /** + * NotificationsItemCommentMentionView.notif_subtype + * @example comment_mention + */ + notif_subtype?: string + /** NotificationsItemCommentMentionView.author */ + author?: components['schemas']['Person'] + /** NotificationsItemCommentMentionView.comment */ + comment?: components['schemas']['Comment'] + /** + * NotificationsItemCommentMentionView.comment_id + * @example 1234 + */ + comment_id?: number + /** + * NotificationsItemCommentMentionView.notif_body + * @example This is the body of a comment. + */ + notif_body?: string + } + FeedView: { + /** + * FeedView.actor_id + * Format: url + */ + actor_id: string + /** FeedView.ap_domain */ + ap_domain: string + /** FeedView.children */ + children: components['schemas']['FeedView'][] + /** FeedView.communities */ + communities: components['schemas']['Community'][] + /** FeedView.communities_count */ + communities_count: number + /** FeedView.id */ + id: number + /** FeedView.is_instance_feed */ + is_instance_feed: boolean + /** FeedView.local */ + local: boolean + /** FeedView.name */ + name: string + /** FeedView.nsfl */ + nsfl: boolean + /** FeedView.nsfw */ + nsfw: boolean + /** + * FeedView.owner + * @description Is the authorized user the creator of the feed? + */ + owner: boolean + /** FeedView.public */ + public: boolean + /** + * FeedView.published + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + published: string + /** FeedView.show_posts_from_children */ + show_posts_from_children: boolean + /** FeedView.subscribed */ + subscribed: boolean + /** FeedView.subscriptions_count */ + subscriptions_count: number + /** FeedView.title */ + title: string + /** + * FeedView.updated + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + updated: string + /** + * FeedView.user_id + * @description user_id of the feed creator/owner + */ + user_id: number + /** + * FeedView.banner + * Format: url + */ + banner?: string + /** + * FeedView.description + * Format: markdown + */ + description?: string + /** + * FeedView.description_html + * Format: html + */ + description_html?: string + /** + * FeedView.icon + * Format: url + */ + icon?: string + /** FeedView.parent_feed_id */ + parent_feed_id?: number + } + TopicView: { + /** TopicView.children */ + children: components['schemas']['TopicView'][] + /** TopicView.communities */ + communities: components['schemas']['Community'][] + /** TopicView.communities_count */ + communities_count: number + /** TopicView.id */ + id: number + /** TopicView.name */ + name: string + /** TopicView.show_posts_from_children */ + show_posts_from_children: boolean + /** TopicView.title */ + title: string + /** TopicView.parent_topic_id */ + parent_topic_id?: number + } + /** + * RegistrationMode + * @enum {string} + */ + RegistrationMode: 'Closed' | 'RequireApplication' | 'Open' + /** + * SearchType + * @enum {string} + */ + SearchType: 'Communities' | 'Posts' | 'Users' | 'Url' + /** + * CommunitySortType + * @enum {string} + */ + CommunitySortType: 'Active' | 'New' + /** + * ListingType + * @enum {string} + */ + ListingType: 'All' | 'Local' | 'Subscribed' | 'Popular' | 'ModeratorView' + /** + * SortType + * @enum {string} + */ + SortType: + | 'Active' + | 'Hot' + | 'New' + | 'TopHour' + | 'TopSixHour' + | 'TopTwelveHour' + | 'TopDay' + | 'TopWeek' + | 'TopMonth' + | 'TopThreeMonths' + | 'TopSixMonths' + | 'TopNineMonths' + | 'TopYear' + | 'TopAll' + | 'Scaled' + /** + * SubscribedType + * @enum {string} + */ + SubscribedType: 'Subscribed' | 'NotSubscribed' | 'Pending' + /** + * PostFeatureType + * @enum {string} + */ + PostFeatureType: 'Local' | 'Community' + /** + * CommentSortType + * @enum {string} + */ + CommentSortType: 'Hot' | 'Top' | 'New' | 'Old' + /** + * NotificationStatusType + * @enum {string} + */ + NotificationStatusType: 'All' | 'New' | 'Read' + /** PersonAggregates */ + PersonAggregates: { + /** PersonAggregates.comment_count */ + comment_count: number + /** PersonAggregates.person_id */ + person_id: number + /** PersonAggregates.post_count */ + post_count: number + } + /** CommentAggregates */ + CommentAggregates: { + /** CommentAggregates.comment_id */ + comment_id: number + /** CommentAggregates.score */ + score: number + /** CommentAggregates.upvotes */ + upvotes: number + /** CommentAggregates.downvotes */ + downvotes: number + /** + * CommentAggregates.published + * Format: date-time + */ + published: string + /** CommentAggregates.child_count */ + child_count: number + } + /** PostAggregates */ + PostAggregates: { + /** PostAggregates.post_id */ + post_id: number + /** PostAggregates.comments */ + comments: number + /** PostAggregates.score */ + score: number + /** PostAggregates.upvotes */ + upvotes: number + /** PostAggregates.downvotes */ + downvotes: number + /** + * PostAggregates.published + * Format: date-time + */ + published: string + /** PostAggregates.newest_comment_time */ + newest_comment_time: string + } + /** CommunityAggregates */ + CommunityAggregates: { + /** CommunityAggregates.active_6monthly */ + active_6monthly: number + /** CommunityAggregates.active_daily */ + active_daily: number + /** CommunityAggregates.active_monthly */ + active_monthly: number + /** CommunityAggregates.active_weekly */ + active_weekly: number + /** CommunityAggregates.community_id */ + id: number + /** CommunityAggregates.post_count */ + post_count: number + /** CommunityAggregates.post_reply_count */ + post_reply_count: number + /** + * CommunityAggregates.published + * Format: date-time + */ + published: string + /** CommunityAggregates.subscriptions_count */ + subscriptions_count: number + /** CommunityAggregates.total_subscriptions_count */ + total_subscriptions_count: number + } + 'SuccessResponse-2': unknown + 'CommentReplyResponse-2': unknown + } + responses: never + parameters: never + requestBodies: never + headers: never + pathItems: never +} +export type $defs = Record +export interface operations { + markAllAsRead: { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + requestBody?: never + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['GetRepliesResponse'] + } + } + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['BadRequest'] + } + } + } + } +} diff --git a/src/lib/client/types/index.ts b/src/lib/client/types/index.ts index 19894d4c..455e1b73 100644 --- a/src/lib/client/types/index.ts +++ b/src/lib/client/types/index.ts @@ -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' diff --git a/src/lib/client/types/payload/GetComment.d.ts b/src/lib/client/types/payload/GetComment.d.ts deleted file mode 100644 index 1f4261bd..00000000 --- a/src/lib/client/types/payload/GetComment.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommentId } from "./CommentId"; -export interface GetComment { - id: CommentId; -} diff --git a/src/lib/client/types/payload/GetComments.d.ts b/src/lib/client/types/payload/GetComments.d.ts deleted file mode 100644 index 085304fc..00000000 --- a/src/lib/client/types/payload/GetComments.d.ts +++ /dev/null @@ -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; -} diff --git a/src/lib/client/types/payload/GetCommunity.d.ts b/src/lib/client/types/payload/GetCommunity.d.ts deleted file mode 100644 index ab38f49d..00000000 --- a/src/lib/client/types/payload/GetCommunity.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CommunityId } from "./CommunityId"; -export interface GetCommunity { - id?: CommunityId; - name?: string; -} diff --git a/src/lib/client/types/payload/GetModlog.d.ts b/src/lib/client/types/payload/GetModlog.d.ts deleted file mode 100644 index c6ac43bf..00000000 --- a/src/lib/client/types/payload/GetModlog.d.ts +++ /dev/null @@ -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; -} diff --git a/src/lib/client/types/payload/GetPersonDetails.d.ts b/src/lib/client/types/payload/GetPersonDetails.d.ts deleted file mode 100644 index a67b49ac..00000000 --- a/src/lib/client/types/payload/GetPersonDetails.d.ts +++ /dev/null @@ -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; -} diff --git a/src/lib/client/types/payload/GetPersonMentions.d.ts b/src/lib/client/types/payload/GetPersonMentions.d.ts deleted file mode 100644 index b78422ca..00000000 --- a/src/lib/client/types/payload/GetPersonMentions.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CommentSortType } from "./CommentSortType"; -export interface GetPersonMentions { - sort?: CommentSortType; - page?: number; - limit?: number; - unread_only?: boolean; -} diff --git a/src/lib/client/types/payload/GetPost.d.ts b/src/lib/client/types/payload/GetPost.d.ts deleted file mode 100644 index 8f433383..00000000 --- a/src/lib/client/types/payload/GetPost.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CommentId } from "./CommentId"; -import type { PostId } from "./PostId"; -export interface GetPost { - id?: PostId; - comment_id?: CommentId; -} diff --git a/src/lib/client/types/payload/GetPosts.d.ts b/src/lib/client/types/payload/GetPosts.d.ts deleted file mode 100644 index 50c878f7..00000000 --- a/src/lib/client/types/payload/GetPosts.d.ts +++ /dev/null @@ -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; -} diff --git a/src/lib/client/types/payload/GetPrivateMessages.d.ts b/src/lib/client/types/payload/GetPrivateMessages.d.ts deleted file mode 100644 index bfed78d6..00000000 --- a/src/lib/client/types/payload/GetPrivateMessages.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PersonId } from "./PersonId"; -export interface GetPrivateMessages { - unread_only?: boolean; - page?: number; - limit?: number; - creator_id?: PersonId; -} diff --git a/src/lib/client/types/payload/GetRegistrationApplication.d.ts b/src/lib/client/types/payload/GetRegistrationApplication.d.ts deleted file mode 100644 index 2e736d26..00000000 --- a/src/lib/client/types/payload/GetRegistrationApplication.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PersonId } from "./PersonId"; -export interface GetRegistrationApplication { - person_id: PersonId; -} diff --git a/src/lib/client/types/payload/GetReplies.d.ts b/src/lib/client/types/payload/GetReplies.d.ts deleted file mode 100644 index ff16aab6..00000000 --- a/src/lib/client/types/payload/GetReplies.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CommentSortType } from "./CommentSortType"; -export interface GetReplies { - sort?: CommentSortType; - page?: number; - limit?: number; - unread_only?: boolean; -} diff --git a/src/lib/client/types/payload/GetReportCount.d.ts b/src/lib/client/types/payload/GetReportCount.d.ts deleted file mode 100644 index 06c4163d..00000000 --- a/src/lib/client/types/payload/GetReportCount.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommunityId } from "./CommunityId"; -export interface GetReportCount { - community_id?: CommunityId; -} diff --git a/src/lib/client/types/payload/index.ts b/src/lib/client/types/payload/index.ts deleted file mode 100644 index 6b741421..00000000 --- a/src/lib/client/types/payload/index.ts +++ /dev/null @@ -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'; diff --git a/src/lib/client/types/response/AddAdminResponse.d.ts b/src/lib/client/types/response/AddAdminResponse.d.ts deleted file mode 100644 index 67f93db6..00000000 --- a/src/lib/client/types/response/AddAdminResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PersonView } from "./PersonView"; -export interface AddAdminResponse { - admins: Array; -} diff --git a/src/lib/client/types/response/AddModToCommunityResponse.d.ts b/src/lib/client/types/response/AddModToCommunityResponse.d.ts deleted file mode 100644 index c55fbd43..00000000 --- a/src/lib/client/types/response/AddModToCommunityResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommunityModeratorView } from "./CommunityModeratorView"; -export interface AddModToCommunityResponse { - moderators: Array; -} diff --git a/src/lib/client/types/response/BanFromCommunityResponse.d.ts b/src/lib/client/types/response/BanFromCommunityResponse.d.ts deleted file mode 100644 index 988112ed..00000000 --- a/src/lib/client/types/response/BanFromCommunityResponse.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PersonView } from "./PersonView"; -export interface BanFromCommunityResponse { - person_view: PersonView; - banned: boolean; -} diff --git a/src/lib/client/types/response/BanPersonResponse.d.ts b/src/lib/client/types/response/BanPersonResponse.d.ts deleted file mode 100644 index a810d530..00000000 --- a/src/lib/client/types/response/BanPersonResponse.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PersonView } from "./PersonView"; -export interface BanPersonResponse { - person_view: PersonView; - banned: boolean; -} diff --git a/src/lib/client/types/response/BannedPersonsResponse.d.ts b/src/lib/client/types/response/BannedPersonsResponse.d.ts deleted file mode 100644 index 699754ea..00000000 --- a/src/lib/client/types/response/BannedPersonsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PersonView } from "./PersonView"; -export interface BannedPersonsResponse { - banned: Array; -} diff --git a/src/lib/client/types/response/BlockCommunityResponse.d.ts b/src/lib/client/types/response/BlockCommunityResponse.d.ts deleted file mode 100644 index 2b91a977..00000000 --- a/src/lib/client/types/response/BlockCommunityResponse.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CommunityView } from "./CommunityView"; -export interface BlockCommunityResponse { - community_view: CommunityView; - blocked: boolean; -} diff --git a/src/lib/client/types/response/BlockPersonResponse.d.ts b/src/lib/client/types/response/BlockPersonResponse.d.ts deleted file mode 100644 index 4efd8a06..00000000 --- a/src/lib/client/types/response/BlockPersonResponse.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PersonView } from "./PersonView"; -export interface BlockPersonResponse { - person_view: PersonView; - blocked: boolean; -} diff --git a/src/lib/client/types/response/CommentReplyResponse.d.ts b/src/lib/client/types/response/CommentReplyResponse.d.ts deleted file mode 100644 index 78590e0f..00000000 --- a/src/lib/client/types/response/CommentReplyResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommentReplyView } from "./CommentReplyView"; -export interface CommentReplyResponse { - comment_reply_view: CommentReplyView; -} diff --git a/src/lib/client/types/response/CommentReportResponse.d.ts b/src/lib/client/types/response/CommentReportResponse.d.ts deleted file mode 100644 index a1c00045..00000000 --- a/src/lib/client/types/response/CommentReportResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommentReportView } from "./CommentReportView"; -export interface CommentReportResponse { - comment_report_view: CommentReportView; -} diff --git a/src/lib/client/types/response/CommentResponse.d.ts b/src/lib/client/types/response/CommentResponse.d.ts deleted file mode 100644 index df8db0ae..00000000 --- a/src/lib/client/types/response/CommentResponse.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CommentView } from "./CommentView"; -import type { LocalUserId } from "./LocalUserId"; -export interface CommentResponse { - comment_view: CommentView; - recipient_ids: Array; -} diff --git a/src/lib/client/types/response/CommunityResponse.d.ts b/src/lib/client/types/response/CommunityResponse.d.ts deleted file mode 100644 index 8a0240cc..00000000 --- a/src/lib/client/types/response/CommunityResponse.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CommunityView } from "./CommunityView"; -import type { LanguageId } from "./LanguageId"; -export interface CommunityResponse { - community_view: CommunityView; - discussion_languages: Array; -} diff --git a/src/lib/client/types/response/CustomEmojiResponse.d.ts b/src/lib/client/types/response/CustomEmojiResponse.d.ts deleted file mode 100644 index dc25b458..00000000 --- a/src/lib/client/types/response/CustomEmojiResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CustomEmojiView } from "./CustomEmojiView"; -export interface CustomEmojiResponse { - custom_emoji: CustomEmojiView; -} diff --git a/src/lib/client/types/response/GetCaptchaResponse.d.ts b/src/lib/client/types/response/GetCaptchaResponse.d.ts deleted file mode 100644 index 0bb6de7e..00000000 --- a/src/lib/client/types/response/GetCaptchaResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CaptchaResponse } from "./CaptchaResponse"; -export interface GetCaptchaResponse { - ok?: CaptchaResponse; -} diff --git a/src/lib/client/types/response/GetCommentsResponse.d.ts b/src/lib/client/types/response/GetCommentsResponse.d.ts deleted file mode 100644 index af24eb57..00000000 --- a/src/lib/client/types/response/GetCommentsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommentView } from "./CommentView"; -export interface GetCommentsResponse { - comments: Array; -} diff --git a/src/lib/client/types/response/GetCommunityResponse.d.ts b/src/lib/client/types/response/GetCommunityResponse.d.ts deleted file mode 100644 index 3e2b221c..00000000 --- a/src/lib/client/types/response/GetCommunityResponse.d.ts +++ /dev/null @@ -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; - discussion_languages: Array; -} diff --git a/src/lib/client/types/response/GetFederatedInstancesResponse.d.ts b/src/lib/client/types/response/GetFederatedInstancesResponse.d.ts deleted file mode 100644 index 806446b0..00000000 --- a/src/lib/client/types/response/GetFederatedInstancesResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { FederatedInstances } from "./FederatedInstances"; -export interface GetFederatedInstancesResponse { - federated_instances?: FederatedInstances; -} diff --git a/src/lib/client/types/response/GetModlogResponse.d.ts b/src/lib/client/types/response/GetModlogResponse.d.ts deleted file mode 100644 index ddba530a..00000000 --- a/src/lib/client/types/response/GetModlogResponse.d.ts +++ /dev/null @@ -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; - locked_posts: Array; - featured_posts: Array; - removed_comments: Array; - removed_communities: Array; - banned_from_community: Array; - banned: Array; - added_to_community: Array; - transferred_to_community: Array; - added: Array; - admin_purged_persons: Array; - admin_purged_communities: Array; - admin_purged_posts: Array; - admin_purged_comments: Array; - hidden_communities: Array; -} diff --git a/src/lib/client/types/response/GetPersonDetailsResponse.d.ts b/src/lib/client/types/response/GetPersonDetailsResponse.d.ts deleted file mode 100644 index 83026297..00000000 --- a/src/lib/client/types/response/GetPersonDetailsResponse.d.ts +++ /dev/null @@ -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; - posts: Array; - moderates: Array; -} diff --git a/src/lib/client/types/response/GetPersonMentionsResponse.d.ts b/src/lib/client/types/response/GetPersonMentionsResponse.d.ts deleted file mode 100644 index 40319585..00000000 --- a/src/lib/client/types/response/GetPersonMentionsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PersonMentionView } from "./PersonMentionView"; -export interface GetPersonMentionsResponse { - mentions: Array; -} diff --git a/src/lib/client/types/response/GetPostResponse.d.ts b/src/lib/client/types/response/GetPostResponse.d.ts deleted file mode 100644 index 26c73fb4..00000000 --- a/src/lib/client/types/response/GetPostResponse.d.ts +++ /dev/null @@ -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; - cross_posts: Array; -} diff --git a/src/lib/client/types/response/GetPostsResponse.d.ts b/src/lib/client/types/response/GetPostsResponse.d.ts deleted file mode 100644 index 1c40f7ce..00000000 --- a/src/lib/client/types/response/GetPostsResponse.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { PaginationCursor } from "./PaginationCursor"; -import type { PostView } from "./PostView"; -export interface GetPostsResponse { - posts: Array; - next_page?: PaginationCursor; -} diff --git a/src/lib/client/types/response/GetRepliesResponse.d.ts b/src/lib/client/types/response/GetRepliesResponse.d.ts deleted file mode 100644 index 10cf639b..00000000 --- a/src/lib/client/types/response/GetRepliesResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommentReplyView } from "./CommentReplyView"; -export interface GetRepliesResponse { - replies: Array; -} diff --git a/src/lib/client/types/response/GetReportCountResponse.d.ts b/src/lib/client/types/response/GetReportCountResponse.d.ts deleted file mode 100644 index 79c53861..00000000 --- a/src/lib/client/types/response/GetReportCountResponse.d.ts +++ /dev/null @@ -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; -} diff --git a/src/lib/client/types/response/GetSiteMetadataResponse.d.ts b/src/lib/client/types/response/GetSiteMetadataResponse.d.ts deleted file mode 100644 index 89403c14..00000000 --- a/src/lib/client/types/response/GetSiteMetadataResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { LinkMetadata } from "./LinkMetadata"; -export interface GetSiteMetadataResponse { - metadata: LinkMetadata; -} diff --git a/src/lib/client/types/response/GetSiteResponse.d.ts b/src/lib/client/types/response/GetSiteResponse.d.ts deleted file mode 100644 index a84f98ba..00000000 --- a/src/lib/client/types/response/GetSiteResponse.d.ts +++ /dev/null @@ -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; - version: string; - my_user?: MyUserInfo; - all_languages: Array; - discussion_languages: Array; - taglines: Array; - custom_emojis: Array; - blocked_urls: Array; -} diff --git a/src/lib/client/types/response/ListCommentLikesResponse.d.ts b/src/lib/client/types/response/ListCommentLikesResponse.d.ts deleted file mode 100644 index 76431d74..00000000 --- a/src/lib/client/types/response/ListCommentLikesResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { VoteView } from "./VoteView"; -export interface ListCommentLikesResponse { - comment_likes: Array; -} diff --git a/src/lib/client/types/response/ListCommentReportsResponse.d.ts b/src/lib/client/types/response/ListCommentReportsResponse.d.ts deleted file mode 100644 index 3cbc1867..00000000 --- a/src/lib/client/types/response/ListCommentReportsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommentReportView } from "./CommentReportView"; -export interface ListCommentReportsResponse { - comment_reports: Array; -} diff --git a/src/lib/client/types/response/ListCommunitiesResponse.d.ts b/src/lib/client/types/response/ListCommunitiesResponse.d.ts deleted file mode 100644 index 0894f710..00000000 --- a/src/lib/client/types/response/ListCommunitiesResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CommunityView } from "./CommunityView"; -export interface ListCommunitiesResponse { - communities: Array; -} diff --git a/src/lib/client/types/response/ListMediaResponse.d.ts b/src/lib/client/types/response/ListMediaResponse.d.ts deleted file mode 100644 index 0bf80732..00000000 --- a/src/lib/client/types/response/ListMediaResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { LocalImageView } from "./LocalImageView"; -export interface ListMediaResponse { - images: Array; -} diff --git a/src/lib/client/types/response/ListPostLikesResponse.d.ts b/src/lib/client/types/response/ListPostLikesResponse.d.ts deleted file mode 100644 index 80537ff1..00000000 --- a/src/lib/client/types/response/ListPostLikesResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { VoteView } from "./VoteView"; -export interface ListPostLikesResponse { - post_likes: Array; -} diff --git a/src/lib/client/types/response/ListPostReportsResponse.d.ts b/src/lib/client/types/response/ListPostReportsResponse.d.ts deleted file mode 100644 index 181091f7..00000000 --- a/src/lib/client/types/response/ListPostReportsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PostReportView } from "./PostReportView"; -export interface ListPostReportsResponse { - post_reports: Array; -} diff --git a/src/lib/client/types/response/ListPrivateMessageReportsResponse.d.ts b/src/lib/client/types/response/ListPrivateMessageReportsResponse.d.ts deleted file mode 100644 index efbde321..00000000 --- a/src/lib/client/types/response/ListPrivateMessageReportsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PrivateMessageReportView } from "./PrivateMessageReportView"; -export interface ListPrivateMessageReportsResponse { - private_message_reports: Array; -} diff --git a/src/lib/client/types/response/ListRegistrationApplicationsResponse.d.ts b/src/lib/client/types/response/ListRegistrationApplicationsResponse.d.ts deleted file mode 100644 index b2f7e95a..00000000 --- a/src/lib/client/types/response/ListRegistrationApplicationsResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { RegistrationApplicationView } from "./RegistrationApplicationView"; -export interface ListRegistrationApplicationsResponse { - registration_applications: Array; -} diff --git a/src/lib/client/types/response/PersonMentionResponse.d.ts b/src/lib/client/types/response/PersonMentionResponse.d.ts deleted file mode 100644 index 9c6aa1d2..00000000 --- a/src/lib/client/types/response/PersonMentionResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PersonMentionView } from "./PersonMentionView"; -export interface PersonMentionResponse { - person_mention_view: PersonMentionView; -} diff --git a/src/lib/client/types/response/PostReportResponse.d.ts b/src/lib/client/types/response/PostReportResponse.d.ts deleted file mode 100644 index bdd318a0..00000000 --- a/src/lib/client/types/response/PostReportResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PostReportView } from "./PostReportView"; -export interface PostReportResponse { - post_report_view: PostReportView; -} diff --git a/src/lib/client/types/response/PostResponse.d.ts b/src/lib/client/types/response/PostResponse.d.ts deleted file mode 100644 index 18084289..00000000 --- a/src/lib/client/types/response/PostResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PostView } from "./PostView"; -export interface PostResponse { - post_view: PostView; -} diff --git a/src/lib/client/types/response/PrivateMessageReportResponse.d.ts b/src/lib/client/types/response/PrivateMessageReportResponse.d.ts deleted file mode 100644 index 55216243..00000000 --- a/src/lib/client/types/response/PrivateMessageReportResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PrivateMessageReportView } from "./PrivateMessageReportView"; -export interface PrivateMessageReportResponse { - private_message_report_view: PrivateMessageReportView; -} diff --git a/src/lib/client/types/response/PrivateMessageResponse.d.ts b/src/lib/client/types/response/PrivateMessageResponse.d.ts deleted file mode 100644 index ca3f39e1..00000000 --- a/src/lib/client/types/response/PrivateMessageResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PrivateMessageView } from "./PrivateMessageView"; -export interface PrivateMessageResponse { - private_message_view: PrivateMessageView; -} diff --git a/src/lib/client/types/response/PrivateMessagesResponse.d.ts b/src/lib/client/types/response/PrivateMessagesResponse.d.ts deleted file mode 100644 index 9540d9ba..00000000 --- a/src/lib/client/types/response/PrivateMessagesResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PrivateMessageView } from "./PrivateMessageView"; -export interface PrivateMessagesResponse { - private_messages: Array; -} diff --git a/src/lib/client/types/response/RegistrationApplicationResponse.d.ts b/src/lib/client/types/response/RegistrationApplicationResponse.d.ts deleted file mode 100644 index e08e96e4..00000000 --- a/src/lib/client/types/response/RegistrationApplicationResponse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { RegistrationApplicationView } from "./RegistrationApplicationView"; -export interface RegistrationApplicationResponse { - registration_application: RegistrationApplicationView; -} diff --git a/src/lib/client/types/response/ResolveObjectResponse.d.ts b/src/lib/client/types/response/ResolveObjectResponse.d.ts deleted file mode 100644 index 500bf016..00000000 --- a/src/lib/client/types/response/ResolveObjectResponse.d.ts +++ /dev/null @@ -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; -} diff --git a/src/lib/client/types/response/SearchResponse.d.ts b/src/lib/client/types/response/SearchResponse.d.ts deleted file mode 100644 index e90fd05f..00000000 --- a/src/lib/client/types/response/SearchResponse.d.ts +++ /dev/null @@ -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; - posts: Array; - communities: Array; - users: Array; -} diff --git a/src/lib/client/types/response/SiteResponse.d.ts b/src/lib/client/types/response/SiteResponse.d.ts deleted file mode 100644 index b523722f..00000000 --- a/src/lib/client/types/response/SiteResponse.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SiteView } from "./SiteView"; -import type { Tagline } from "./Tagline"; -export interface SiteResponse { - site_view: SiteView; - taglines: Array; -} diff --git a/src/lib/client/types/response/index.ts b/src/lib/client/types/response/index.ts deleted file mode 100644 index 974edea4..00000000 --- a/src/lib/client/types/response/index.ts +++ /dev/null @@ -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'; diff --git a/src/lib/client/types/schemas/AddAdminResponse.ts b/src/lib/client/types/schemas/AddAdminResponse.ts new file mode 100644 index 00000000..df4c1a63 --- /dev/null +++ b/src/lib/client/types/schemas/AddAdminResponse.ts @@ -0,0 +1,4 @@ +import type { PersonView } from './schemas' +export interface AddAdminResponse { + admins: Array +} diff --git a/src/lib/client/types/schemas/AddModToCommunityResponse.ts b/src/lib/client/types/schemas/AddModToCommunityResponse.ts new file mode 100644 index 00000000..aa6e6f78 --- /dev/null +++ b/src/lib/client/types/schemas/AddModToCommunityResponse.ts @@ -0,0 +1,4 @@ +import type { CommunityModeratorView } from './schemas' +export interface AddModToCommunityResponse { + moderators: Array +} diff --git a/src/lib/client/types/schemas/BanFromCommunityResponse.ts b/src/lib/client/types/schemas/BanFromCommunityResponse.ts new file mode 100644 index 00000000..fedba8f0 --- /dev/null +++ b/src/lib/client/types/schemas/BanFromCommunityResponse.ts @@ -0,0 +1,5 @@ +import type { PersonView } from './schemas' +export interface BanFromCommunityResponse { + person_view: PersonView + banned: boolean +} diff --git a/src/lib/client/types/schemas/BanPersonResponse.ts b/src/lib/client/types/schemas/BanPersonResponse.ts new file mode 100644 index 00000000..67d826ea --- /dev/null +++ b/src/lib/client/types/schemas/BanPersonResponse.ts @@ -0,0 +1,5 @@ +import type { PersonView } from './schemas' +export interface BanPersonResponse { + person_view: PersonView + banned: boolean +} diff --git a/src/lib/client/types/schemas/BannedPersonsResponse.ts b/src/lib/client/types/schemas/BannedPersonsResponse.ts new file mode 100644 index 00000000..cbf538bd --- /dev/null +++ b/src/lib/client/types/schemas/BannedPersonsResponse.ts @@ -0,0 +1,4 @@ +import type { PersonView } from './schemas' +export interface BannedPersonsResponse { + banned: Array +} diff --git a/src/lib/client/types/schemas/BlockCommunityResponse.ts b/src/lib/client/types/schemas/BlockCommunityResponse.ts new file mode 100644 index 00000000..b63ab275 --- /dev/null +++ b/src/lib/client/types/schemas/BlockCommunityResponse.ts @@ -0,0 +1,5 @@ +import type { CommunityView } from './schemas' +export interface BlockCommunityResponse { + community_view: CommunityView + blocked: boolean +} diff --git a/src/lib/client/types/response/BlockInstanceResponse.d.ts b/src/lib/client/types/schemas/BlockInstanceResponse.ts similarity index 100% rename from src/lib/client/types/response/BlockInstanceResponse.d.ts rename to src/lib/client/types/schemas/BlockInstanceResponse.ts diff --git a/src/lib/client/types/schemas/BlockPersonResponse.ts b/src/lib/client/types/schemas/BlockPersonResponse.ts new file mode 100644 index 00000000..7336a5ef --- /dev/null +++ b/src/lib/client/types/schemas/BlockPersonResponse.ts @@ -0,0 +1,5 @@ +import type { PersonView } from './schemas' +export interface BlockPersonResponse { + person_view: PersonView + blocked: boolean +} diff --git a/src/lib/client/types/response/CaptchaResponse.d.ts b/src/lib/client/types/schemas/CaptchaResponse.ts similarity index 100% rename from src/lib/client/types/response/CaptchaResponse.d.ts rename to src/lib/client/types/schemas/CaptchaResponse.ts diff --git a/src/lib/client/types/schemas/CommentReplyResponse.ts b/src/lib/client/types/schemas/CommentReplyResponse.ts new file mode 100644 index 00000000..c6668b27 --- /dev/null +++ b/src/lib/client/types/schemas/CommentReplyResponse.ts @@ -0,0 +1,4 @@ +import type { CommentReplyView } from './schemas' +export interface CommentReplyResponse { + comment_reply_view: CommentReplyView +} diff --git a/src/lib/client/types/schemas/CommentReportResponse.ts b/src/lib/client/types/schemas/CommentReportResponse.ts new file mode 100644 index 00000000..1955378e --- /dev/null +++ b/src/lib/client/types/schemas/CommentReportResponse.ts @@ -0,0 +1,4 @@ +import type { CommentReportView } from './schemas' +export interface CommentReportResponse { + comment_report_view: CommentReportView +} diff --git a/src/lib/client/types/schemas/CommentResponse.ts b/src/lib/client/types/schemas/CommentResponse.ts new file mode 100644 index 00000000..415b3dc2 --- /dev/null +++ b/src/lib/client/types/schemas/CommentResponse.ts @@ -0,0 +1,6 @@ +import type { CommentView } from './schemas' +import type { LocalUserId } from './schemas' +export interface CommentResponse { + comment_view: CommentView + recipient_ids: Array +} diff --git a/src/lib/client/types/schemas/CommunityResponse.ts b/src/lib/client/types/schemas/CommunityResponse.ts new file mode 100644 index 00000000..d74cd18d --- /dev/null +++ b/src/lib/client/types/schemas/CommunityResponse.ts @@ -0,0 +1,6 @@ +import type { CommunityView } from './schemas' +import type { LanguageId } from './schemas' +export interface CommunityResponse { + community_view: CommunityView + discussion_languages: Array +} diff --git a/src/lib/client/types/schemas/CustomEmojiResponse.ts b/src/lib/client/types/schemas/CustomEmojiResponse.ts new file mode 100644 index 00000000..56ba1ed9 --- /dev/null +++ b/src/lib/client/types/schemas/CustomEmojiResponse.ts @@ -0,0 +1,4 @@ +import type { CustomEmojiView } from './schemas' +export interface CustomEmojiResponse { + custom_emoji: CustomEmojiView +} diff --git a/src/lib/client/types/response/GenerateTotpSecretResponse.d.ts b/src/lib/client/types/schemas/GenerateTotpSecretResponse.ts similarity index 100% rename from src/lib/client/types/response/GenerateTotpSecretResponse.d.ts rename to src/lib/client/types/schemas/GenerateTotpSecretResponse.ts diff --git a/src/lib/client/types/schemas/GetCaptchaResponse.ts b/src/lib/client/types/schemas/GetCaptchaResponse.ts new file mode 100644 index 00000000..b52c0ae9 --- /dev/null +++ b/src/lib/client/types/schemas/GetCaptchaResponse.ts @@ -0,0 +1,4 @@ +import type { CaptchaResponse } from './schemas' +export interface GetCaptchaResponse { + ok?: CaptchaResponse +} diff --git a/src/lib/client/types/schemas/GetComment.ts b/src/lib/client/types/schemas/GetComment.ts new file mode 100644 index 00000000..fc3a7568 --- /dev/null +++ b/src/lib/client/types/schemas/GetComment.ts @@ -0,0 +1,4 @@ +import type { CommentId } from './schemas' +export interface GetComment { + id: CommentId +} diff --git a/src/lib/client/types/schemas/GetComments.ts b/src/lib/client/types/schemas/GetComments.ts new file mode 100644 index 00000000..43e7cddf --- /dev/null +++ b/src/lib/client/types/schemas/GetComments.ts @@ -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 +} diff --git a/src/lib/client/types/schemas/GetCommentsResponse.ts b/src/lib/client/types/schemas/GetCommentsResponse.ts new file mode 100644 index 00000000..b614a85e --- /dev/null +++ b/src/lib/client/types/schemas/GetCommentsResponse.ts @@ -0,0 +1,4 @@ +import type { CommentView } from './schemas' +export interface GetCommentsResponse { + comments: Array +} diff --git a/src/lib/client/types/schemas/GetCommunity.ts b/src/lib/client/types/schemas/GetCommunity.ts new file mode 100644 index 00000000..1e2fcbec --- /dev/null +++ b/src/lib/client/types/schemas/GetCommunity.ts @@ -0,0 +1,5 @@ +import type { CommunityId } from './schemas' +export interface GetCommunity { + id?: CommunityId + name?: string +} diff --git a/src/lib/client/types/schemas/GetCommunityResponse.ts b/src/lib/client/types/schemas/GetCommunityResponse.ts new file mode 100644 index 00000000..24890ccf --- /dev/null +++ b/src/lib/client/types/schemas/GetCommunityResponse.ts @@ -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 + discussion_languages: Array +} diff --git a/src/lib/client/types/schemas/GetFederatedInstancesResponse.ts b/src/lib/client/types/schemas/GetFederatedInstancesResponse.ts new file mode 100644 index 00000000..72319e3c --- /dev/null +++ b/src/lib/client/types/schemas/GetFederatedInstancesResponse.ts @@ -0,0 +1,4 @@ +import type { FederatedInstances } from './schemas' +export interface GetFederatedInstancesResponse { + federated_instances?: FederatedInstances +} diff --git a/src/lib/client/types/schemas/GetModlog.ts b/src/lib/client/types/schemas/GetModlog.ts new file mode 100644 index 00000000..115caae4 --- /dev/null +++ b/src/lib/client/types/schemas/GetModlog.ts @@ -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 +} diff --git a/src/lib/client/types/schemas/GetModlogResponse.ts b/src/lib/client/types/schemas/GetModlogResponse.ts new file mode 100644 index 00000000..953c1024 --- /dev/null +++ b/src/lib/client/types/schemas/GetModlogResponse.ts @@ -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 + locked_posts: Array + featured_posts: Array + removed_comments: Array + removed_communities: Array + banned_from_community: Array + banned: Array + added_to_community: Array + transferred_to_community: Array + added: Array + admin_purged_persons: Array + admin_purged_communities: Array + admin_purged_posts: Array + admin_purged_comments: Array + hidden_communities: Array +} diff --git a/src/lib/client/types/schemas/GetPersonDetails.ts b/src/lib/client/types/schemas/GetPersonDetails.ts new file mode 100644 index 00000000..dc3cacef --- /dev/null +++ b/src/lib/client/types/schemas/GetPersonDetails.ts @@ -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 +} diff --git a/src/lib/client/types/schemas/GetPersonDetailsResponse.ts b/src/lib/client/types/schemas/GetPersonDetailsResponse.ts new file mode 100644 index 00000000..21d9dfb9 --- /dev/null +++ b/src/lib/client/types/schemas/GetPersonDetailsResponse.ts @@ -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 + posts: Array + moderates: Array +} diff --git a/src/lib/client/types/schemas/GetPersonMentions.ts b/src/lib/client/types/schemas/GetPersonMentions.ts new file mode 100644 index 00000000..20c1620b --- /dev/null +++ b/src/lib/client/types/schemas/GetPersonMentions.ts @@ -0,0 +1,7 @@ +import type { CommentSortType } from './schemas' +export interface GetPersonMentions { + sort?: CommentSortType + page?: number + limit?: number + unread_only?: boolean +} diff --git a/src/lib/client/types/schemas/GetPersonMentionsResponse.ts b/src/lib/client/types/schemas/GetPersonMentionsResponse.ts new file mode 100644 index 00000000..be644a7d --- /dev/null +++ b/src/lib/client/types/schemas/GetPersonMentionsResponse.ts @@ -0,0 +1,4 @@ +import type { PersonMentionView } from './schemas' +export interface GetPersonMentionsResponse { + mentions: Array +} diff --git a/src/lib/client/types/schemas/GetPost.ts b/src/lib/client/types/schemas/GetPost.ts new file mode 100644 index 00000000..cbf0190c --- /dev/null +++ b/src/lib/client/types/schemas/GetPost.ts @@ -0,0 +1,6 @@ +import type { CommentId } from './schemas' +import type { PostId } from './schemas' +export interface GetPost { + id?: PostId + comment_id?: CommentId +} diff --git a/src/lib/client/types/schemas/GetPostResponse.ts b/src/lib/client/types/schemas/GetPostResponse.ts new file mode 100644 index 00000000..5e7b8e97 --- /dev/null +++ b/src/lib/client/types/schemas/GetPostResponse.ts @@ -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 + cross_posts: Array +} diff --git a/src/lib/client/types/schemas/GetPosts.ts b/src/lib/client/types/schemas/GetPosts.ts new file mode 100644 index 00000000..c60808a0 --- /dev/null +++ b/src/lib/client/types/schemas/GetPosts.ts @@ -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 +} diff --git a/src/lib/client/types/schemas/GetPostsResponse.ts b/src/lib/client/types/schemas/GetPostsResponse.ts new file mode 100644 index 00000000..d055fb80 --- /dev/null +++ b/src/lib/client/types/schemas/GetPostsResponse.ts @@ -0,0 +1,6 @@ +import type { PaginationCursor } from './schemas' +import type { PostView } from './schemas' +export interface GetPostsResponse { + posts: Array + next_page?: PaginationCursor +} diff --git a/src/lib/client/types/schemas/GetPrivateMessages.ts b/src/lib/client/types/schemas/GetPrivateMessages.ts new file mode 100644 index 00000000..28af2df3 --- /dev/null +++ b/src/lib/client/types/schemas/GetPrivateMessages.ts @@ -0,0 +1,7 @@ +import type { PersonId } from './schemas' +export interface GetPrivateMessages { + unread_only?: boolean + page?: number + limit?: number + creator_id?: PersonId +} diff --git a/src/lib/client/types/schemas/GetRegistrationApplication.ts b/src/lib/client/types/schemas/GetRegistrationApplication.ts new file mode 100644 index 00000000..3584cce6 --- /dev/null +++ b/src/lib/client/types/schemas/GetRegistrationApplication.ts @@ -0,0 +1,4 @@ +import type { PersonId } from './schemas' +export interface GetRegistrationApplication { + person_id: PersonId +} diff --git a/src/lib/client/types/schemas/GetReplies.ts b/src/lib/client/types/schemas/GetReplies.ts new file mode 100644 index 00000000..b544804f --- /dev/null +++ b/src/lib/client/types/schemas/GetReplies.ts @@ -0,0 +1,7 @@ +import type { CommentSortType } from './schemas' +export interface GetReplies { + sort?: CommentSortType + page?: number + limit?: number + unread_only?: boolean +} diff --git a/src/lib/client/types/schemas/GetRepliesResponse.ts b/src/lib/client/types/schemas/GetRepliesResponse.ts new file mode 100644 index 00000000..3eb5a004 --- /dev/null +++ b/src/lib/client/types/schemas/GetRepliesResponse.ts @@ -0,0 +1,4 @@ +import type { CommentReplyView } from './schemas' +export interface GetRepliesResponse { + replies: Array +} diff --git a/src/lib/client/types/schemas/GetReportCount.ts b/src/lib/client/types/schemas/GetReportCount.ts new file mode 100644 index 00000000..e1cfa6e5 --- /dev/null +++ b/src/lib/client/types/schemas/GetReportCount.ts @@ -0,0 +1,4 @@ +import type { CommunityId } from './schemas' +export interface GetReportCount { + community_id?: CommunityId +} diff --git a/src/lib/client/types/schemas/GetReportCountResponse.ts b/src/lib/client/types/schemas/GetReportCountResponse.ts new file mode 100644 index 00000000..eaf63ba3 --- /dev/null +++ b/src/lib/client/types/schemas/GetReportCountResponse.ts @@ -0,0 +1,7 @@ +import type { CommunityId } from './schemas' +export interface GetReportCountResponse { + community_id?: CommunityId + comment_reports: number + post_reports: number + private_message_reports?: number +} diff --git a/src/lib/client/types/payload/GetSiteMetadata.d.ts b/src/lib/client/types/schemas/GetSiteMetadata.ts similarity index 100% rename from src/lib/client/types/payload/GetSiteMetadata.d.ts rename to src/lib/client/types/schemas/GetSiteMetadata.ts diff --git a/src/lib/client/types/schemas/GetSiteMetadataResponse.ts b/src/lib/client/types/schemas/GetSiteMetadataResponse.ts new file mode 100644 index 00000000..6a42850c --- /dev/null +++ b/src/lib/client/types/schemas/GetSiteMetadataResponse.ts @@ -0,0 +1,4 @@ +import type { LinkMetadata } from './schemas' +export interface GetSiteMetadataResponse { + metadata: LinkMetadata +} diff --git a/src/lib/client/types/schemas/GetSiteResponse.ts b/src/lib/client/types/schemas/GetSiteResponse.ts new file mode 100644 index 00000000..3d2fe303 --- /dev/null +++ b/src/lib/client/types/schemas/GetSiteResponse.ts @@ -0,0 +1,22 @@ +import type { + CustomEmojiView, + Language, + LanguageId, + LocalSiteUrlBlocklist, + MyUserInfo, + PersonView, + SiteView, + Tagline, +} from '..' + +export interface GetSiteResponse { + site_view: SiteView + admins: Array + version: string + my_user?: MyUserInfo + all_languages: Array + discussion_languages: Array + taglines: Array + custom_emojis: Array + blocked_urls: Array +} diff --git a/src/lib/client/types/response/GetUnreadCountResponse.d.ts b/src/lib/client/types/schemas/GetUnreadCountResponse.ts similarity index 100% rename from src/lib/client/types/response/GetUnreadCountResponse.d.ts rename to src/lib/client/types/schemas/GetUnreadCountResponse.ts diff --git a/src/lib/client/types/response/GetUnreadRegistrationApplicationCountResponse.d.ts b/src/lib/client/types/schemas/GetUnreadRegistrationApplicationCountResponse.ts similarity index 100% rename from src/lib/client/types/response/GetUnreadRegistrationApplicationCountResponse.d.ts rename to src/lib/client/types/schemas/GetUnreadRegistrationApplicationCountResponse.ts diff --git a/src/lib/client/types/schemas/ListCommentLikesResponse.ts b/src/lib/client/types/schemas/ListCommentLikesResponse.ts new file mode 100644 index 00000000..e81f383b --- /dev/null +++ b/src/lib/client/types/schemas/ListCommentLikesResponse.ts @@ -0,0 +1,4 @@ +import type { VoteView } from './schemas' +export interface ListCommentLikesResponse { + comment_likes: Array +} diff --git a/src/lib/client/types/schemas/ListCommentReportsResponse.ts b/src/lib/client/types/schemas/ListCommentReportsResponse.ts new file mode 100644 index 00000000..6fa3d306 --- /dev/null +++ b/src/lib/client/types/schemas/ListCommentReportsResponse.ts @@ -0,0 +1,4 @@ +import type { CommentReportView } from './schemas' +export interface ListCommentReportsResponse { + comment_reports: Array +} diff --git a/src/lib/client/types/schemas/ListCommunitiesResponse.ts b/src/lib/client/types/schemas/ListCommunitiesResponse.ts new file mode 100644 index 00000000..8ae06ac1 --- /dev/null +++ b/src/lib/client/types/schemas/ListCommunitiesResponse.ts @@ -0,0 +1,4 @@ +import type { CommunityView } from './schemas' +export interface ListCommunitiesResponse { + communities: Array +} diff --git a/src/lib/client/types/schemas/ListMediaResponse.ts b/src/lib/client/types/schemas/ListMediaResponse.ts new file mode 100644 index 00000000..43e5ae3f --- /dev/null +++ b/src/lib/client/types/schemas/ListMediaResponse.ts @@ -0,0 +1,4 @@ +import type { LocalImageView } from './schemas' +export interface ListMediaResponse { + images: Array +} diff --git a/src/lib/client/types/schemas/ListPostLikesResponse.ts b/src/lib/client/types/schemas/ListPostLikesResponse.ts new file mode 100644 index 00000000..9507d0fb --- /dev/null +++ b/src/lib/client/types/schemas/ListPostLikesResponse.ts @@ -0,0 +1,4 @@ +import type { VoteView } from './schemas' +export interface ListPostLikesResponse { + post_likes: Array +} diff --git a/src/lib/client/types/schemas/ListPostReportsResponse.ts b/src/lib/client/types/schemas/ListPostReportsResponse.ts new file mode 100644 index 00000000..5d988fa9 --- /dev/null +++ b/src/lib/client/types/schemas/ListPostReportsResponse.ts @@ -0,0 +1,4 @@ +import type { PostReportView } from './schemas' +export interface ListPostReportsResponse { + post_reports: Array +} diff --git a/src/lib/client/types/schemas/ListPrivateMessageReportsResponse.ts b/src/lib/client/types/schemas/ListPrivateMessageReportsResponse.ts new file mode 100644 index 00000000..9121c5e5 --- /dev/null +++ b/src/lib/client/types/schemas/ListPrivateMessageReportsResponse.ts @@ -0,0 +1,4 @@ +import type { PrivateMessageReportView } from './schemas' +export interface ListPrivateMessageReportsResponse { + private_message_reports: Array +} diff --git a/src/lib/client/types/schemas/ListRegistrationApplicationsResponse.ts b/src/lib/client/types/schemas/ListRegistrationApplicationsResponse.ts new file mode 100644 index 00000000..20b30515 --- /dev/null +++ b/src/lib/client/types/schemas/ListRegistrationApplicationsResponse.ts @@ -0,0 +1,4 @@ +import type { RegistrationApplicationView } from './schemas' +export interface ListRegistrationApplicationsResponse { + registration_applications: Array +} diff --git a/src/lib/client/types/response/LoginResponse.d.ts b/src/lib/client/types/schemas/LoginResponse.ts similarity index 100% rename from src/lib/client/types/response/LoginResponse.d.ts rename to src/lib/client/types/schemas/LoginResponse.ts diff --git a/src/lib/client/types/schemas/PersonMentionResponse.ts b/src/lib/client/types/schemas/PersonMentionResponse.ts new file mode 100644 index 00000000..8943357b --- /dev/null +++ b/src/lib/client/types/schemas/PersonMentionResponse.ts @@ -0,0 +1,4 @@ +import type { PersonMentionView } from './schemas' +export interface PersonMentionResponse { + person_mention_view: PersonMentionView +} diff --git a/src/lib/client/types/schemas/PostReportResponse.ts b/src/lib/client/types/schemas/PostReportResponse.ts new file mode 100644 index 00000000..9b6e6f0e --- /dev/null +++ b/src/lib/client/types/schemas/PostReportResponse.ts @@ -0,0 +1,4 @@ +import type { PostReportView } from './schemas' +export interface PostReportResponse { + post_report_view: PostReportView +} diff --git a/src/lib/client/types/schemas/PostResponse.ts b/src/lib/client/types/schemas/PostResponse.ts new file mode 100644 index 00000000..67536631 --- /dev/null +++ b/src/lib/client/types/schemas/PostResponse.ts @@ -0,0 +1,4 @@ +import type { PostView } from './schemas' +export interface PostResponse { + post_view: PostView +} diff --git a/src/lib/client/types/schemas/PrivateMessageReportResponse.ts b/src/lib/client/types/schemas/PrivateMessageReportResponse.ts new file mode 100644 index 00000000..0898c8ed --- /dev/null +++ b/src/lib/client/types/schemas/PrivateMessageReportResponse.ts @@ -0,0 +1,4 @@ +import type { PrivateMessageReportView } from './schemas' +export interface PrivateMessageReportResponse { + private_message_report_view: PrivateMessageReportView +} diff --git a/src/lib/client/types/schemas/PrivateMessageResponse.ts b/src/lib/client/types/schemas/PrivateMessageResponse.ts new file mode 100644 index 00000000..30051909 --- /dev/null +++ b/src/lib/client/types/schemas/PrivateMessageResponse.ts @@ -0,0 +1,4 @@ +import type { PrivateMessageView } from './schemas' +export interface PrivateMessageResponse { + private_message_view: PrivateMessageView +} diff --git a/src/lib/client/types/schemas/PrivateMessagesResponse.ts b/src/lib/client/types/schemas/PrivateMessagesResponse.ts new file mode 100644 index 00000000..3fae981a --- /dev/null +++ b/src/lib/client/types/schemas/PrivateMessagesResponse.ts @@ -0,0 +1,4 @@ +import type { PrivateMessageView } from './schemas' +export interface PrivateMessagesResponse { + private_messages: Array +} diff --git a/src/lib/client/types/schemas/RegistrationApplicationResponse.ts b/src/lib/client/types/schemas/RegistrationApplicationResponse.ts new file mode 100644 index 00000000..cbba5a1f --- /dev/null +++ b/src/lib/client/types/schemas/RegistrationApplicationResponse.ts @@ -0,0 +1,4 @@ +import type { RegistrationApplicationView } from './schemas' +export interface RegistrationApplicationResponse { + registration_application: RegistrationApplicationView +} diff --git a/src/lib/client/types/schemas/ResolveObjectResponse.ts b/src/lib/client/types/schemas/ResolveObjectResponse.ts new file mode 100644 index 00000000..8d09d4ca --- /dev/null +++ b/src/lib/client/types/schemas/ResolveObjectResponse.ts @@ -0,0 +1,6 @@ +export interface ResolveObjectResponse { + comment?: CommentView + post?: PostView + community?: CommunityView + person?: PersonView +} diff --git a/src/lib/client/types/schemas/SearchResponse.ts b/src/lib/client/types/schemas/SearchResponse.ts new file mode 100644 index 00000000..7249b2d2 --- /dev/null +++ b/src/lib/client/types/schemas/SearchResponse.ts @@ -0,0 +1,12 @@ +import type { CommentView } from './schemas' +import type { CommunityView } from './schemas' +import type { PersonView } from './schemas' +import type { PostView } from './schemas' +import type { SearchType } from './schemas' +export interface SearchResponse { + type_: SearchType + comments: Array + posts: Array + communities: Array + users: Array +} diff --git a/src/lib/client/types/schemas/SiteResponse.ts b/src/lib/client/types/schemas/SiteResponse.ts new file mode 100644 index 00000000..675c1efe --- /dev/null +++ b/src/lib/client/types/schemas/SiteResponse.ts @@ -0,0 +1,6 @@ +import type { SiteView } from './schemas' +import type { Tagline } from './schemas' +export interface SiteResponse { + site_view: SiteView + taglines: Array +} diff --git a/src/lib/client/types/response/SuccessResponse.d.ts b/src/lib/client/types/schemas/SuccessResponse.ts similarity index 100% rename from src/lib/client/types/response/SuccessResponse.d.ts rename to src/lib/client/types/schemas/SuccessResponse.ts diff --git a/src/lib/client/types/response/UpdateTotpResponse.d.ts b/src/lib/client/types/schemas/UpdateTotpResponse.ts similarity index 100% rename from src/lib/client/types/response/UpdateTotpResponse.d.ts rename to src/lib/client/types/schemas/UpdateTotpResponse.ts diff --git a/src/lib/client/types/schemas.ts b/src/lib/client/types/schemas/schemas.ts similarity index 96% rename from src/lib/client/types/schemas.ts rename to src/lib/client/types/schemas/schemas.ts index c21678bd..cd0cf68c 100644 --- a/src/lib/client/types/schemas.ts +++ b/src/lib/client/types/schemas/schemas.ts @@ -1130,7 +1130,12 @@ export interface ListCommunities { page?: number limit?: number } -export type ListingType = 'All' | 'Local' | 'Subscribed' | 'ModeratorView' +export type ListingType = + | 'All' + | 'Local' + | 'Subscribed' + | 'ModeratorView' + | 'Popular' export interface ListMedia { page?: number limit?: number @@ -1173,32 +1178,32 @@ export interface LocalImageView { } export interface LocalSite { - id: LocalSiteId - site_id: SiteId - site_setup: boolean - enable_downvotes: boolean - enable_nsfw: boolean - community_creation_admin_only: boolean - require_email_verification: boolean + id?: LocalSiteId + site_id?: SiteId + site_setup?: boolean + enable_downvotes?: boolean + enable_nsfw?: boolean + community_creation_admin_only?: boolean + require_email_verification?: boolean application_question?: string - private_instance: boolean - default_theme: string - default_post_listing_type: ListingType + private_instance?: boolean + default_theme?: string + default_post_listing_type?: ListingType legal_information?: string - hide_modlog_mod_names: boolean - application_email_admins: boolean + hide_modlog_mod_names?: boolean + application_email_admins?: boolean slur_filter_regex?: string - actor_name_max_length: number - federation_enabled: boolean - captcha_enabled: boolean - captcha_difficulty: string - published: string + actor_name_max_length?: number + federation_enabled?: boolean + captcha_enabled?: boolean + captcha_difficulty?: string + published?: string updated?: string - registration_mode: RegistrationMode - reports_email_admins: boolean - federation_signed_fetch: boolean - default_post_listing_mode: PostListingMode - default_sort_type: SortType + registration_mode?: RegistrationMode + reports_email_admins?: boolean + federation_signed_fetch?: boolean + default_post_listing_mode?: PostListingMode + default_sort_type?: SortType } export type LocalSiteId = number @@ -1231,34 +1236,23 @@ export interface LocalUser { person_id: PersonId email?: string show_nsfw: boolean - theme: string default_sort_type: SortType default_listing_type: ListingType - interface_language: string - show_avatars: boolean - send_notifications_to_email: boolean - show_scores: boolean - show_bot_accounts: boolean - show_read_posts: boolean - email_verified: boolean - accepted_application: boolean - open_links_in_new_tab: boolean - blur_nsfw: boolean - auto_expand: boolean - infinite_scroll_enabled: boolean - admin: boolean - post_listing_mode: PostListingMode + interface_language?: string + show_avatars?: boolean + show_scores?: boolean + show_bot_accounts?: boolean + show_read_posts?: boolean + email_verified?: boolean + accepted_application?: boolean totp_2fa_enabled: boolean - enable_keyboard_navigation: boolean - enable_animated_images: boolean - collapse_bot_comments: boolean - last_donation_notification: string + last_donation_notification?: string } export type LocalUserId = number export interface LocalUserView { local_user: LocalUser - local_user_vote_display_mode: LocalUserVoteDisplayMode + local_user_vote_display_mode?: LocalUserVoteDisplayMode person: Person counts: PersonAggregates } @@ -1890,19 +1884,19 @@ export type SearchType = | 'Url' export interface Site { - id: SiteId + id?: SiteId name: string sidebar?: string - published: string + published?: string updated?: string icon?: string banner?: string description?: string actor_id: string - last_refreshed_at: string - inbox_url: string - public_key: string - instance_id: InstanceId + last_refreshed_at?: string + inbox_url?: string + public_key?: string + instance_id?: InstanceId content_warning?: string } @@ -1922,7 +1916,7 @@ export type SiteId = number export interface SiteView { site: Site local_site: LocalSite - local_site_rate_limit: LocalSiteRateLimit + local_site_rate_limit?: LocalSiteRateLimit counts: SiteAggregates } export type SortType = diff --git a/src/lib/components/lemmy/moderation/moderation.ts b/src/lib/components/lemmy/moderation/moderation.ts index 9834a70a..ba7d5515 100644 --- a/src/lib/components/lemmy/moderation/moderation.ts +++ b/src/lib/components/lemmy/moderation/moderation.ts @@ -1,14 +1,13 @@ import { client } from '$lib/client/lemmy.svelte' -import type { SubmissionView } from '$lib/lemmy/contentview.js' import type { - Comment, CommentView, Community, MyUserInfo, Person, PostView, PrivateMessageView, -} from 'lemmy-js-client' +} from '$lib/client/types' +import type { SubmissionView } from '$lib/lemmy/contentview.js' import { writable } from 'svelte/store' interface Modals { @@ -112,7 +111,7 @@ export const amMod = (me: MyUserInfo, community: Community) => export const amModOfAny = (me?: MyUserInfo) => me && (me.moderates.length > 0 || isAdmin(me)) -export const isAdmin = (me: MyUserInfo) => me.local_user_view.local_user.admin +export const isAdmin = (me: MyUserInfo) => me.local_user_view.person.admin export const removalTemplate = ( input: string, diff --git a/src/lib/components/ui/LabelStat.svelte b/src/lib/components/ui/LabelStat.svelte index 99e29706..deea569e 100644 --- a/src/lib/components/ui/LabelStat.svelte +++ b/src/lib/components/ui/LabelStat.svelte @@ -20,15 +20,17 @@ }: Props = $props() -
- - {label} - - - {#if formatted} - - {:else} - {content} - {/if} - -
+{#if content != '-1'} +
+ + {label} + + + {#if formatted} + + {:else} + {content} + {/if} + +
+{/if} diff --git a/src/lib/components/ui/sidebar/ProfileSelection.svelte b/src/lib/components/ui/sidebar/ProfileSelection.svelte index d13968d6..69c56ada 100644 --- a/src/lib/components/ui/sidebar/ProfileSelection.svelte +++ b/src/lib/components/ui/sidebar/ProfileSelection.svelte @@ -12,6 +12,7 @@ import { goto } from '$app/navigation' import { page } from '$app/state' import { t } from '$lib/i18n/translations' + import { DEFAULT_CLIENT_TYPE } from '$lib/client/lemmy.svelte' let { profiles }: { profiles: ProfileInfo[] } = $props() @@ -45,7 +46,7 @@
{profile.current.username}
- {profile.current.instance} + {profile.current.client?.name ?? DEFAULT_CLIENT_TYPE.name} • {profile.current.instance}
{#snippet suffix()} @@ -70,7 +71,7 @@
{p.username}
- {p.instance} + {p.client?.name ?? DEFAULT_CLIENT_TYPE.name} • {p.instance}
diff --git a/src/routes/accounts/+page.svelte b/src/routes/accounts/+page.svelte index fdb2335a..9aa36eaa 100644 --- a/src/routes/accounts/+page.svelte +++ b/src/routes/accounts/+page.svelte @@ -1,5 +1,6 @@