Merge pull request #662 from Xyphyn/refactor/file-tree

refactor: restructure the entire file tree and manually write 3,000 import statements because uhhhhh
This commit is contained in:
xylight authored and GitHub committed 2025-09-26 03:41:44 +00:00
commit 492ac92fd6
423 files changed
+1973 -2445

No files matched your search

-2
View File
@@ -1,7 +1,5 @@
// See https://kit.svelte.dev/docs/types#app
import type { Action } from '$comp/ui/navbar/commands/actions.svelte'
// for information about these interfaces
declare global {
namespace App {
File renamed without changes.
@@ -1,11 +1,11 @@
import { profile } from '$lib/auth.svelte'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
import { instanceToURL } from '$lib/util.svelte'
import { profile } from '$lib/app/auth.svelte'
import { DEFAULT_INSTANCE_URL } from '$lib/app/instance.svelte'
import { instanceToURL } from '$lib/app/util.svelte'
import { error } from '@sveltejs/kit'
import { type GetSiteResponse } from '$lib/client/types'
import { LemmyClient } from './lemmy/lemmy'
import { PiefedClient } from './piefed/piefed'
import { DEFAULT_CLIENT_TYPE, type ClientType, BaseClient } from './base'
import { BaseClient, DEFAULT_CLIENT_TYPE, type ClientType } from './base'
import { LemmyClient } from './lemmy/adapter'
import { PiefedClient } from './piefed/adapter'
import type { GetSiteResponse } from './types'
class SiteData {
#data = $state<GetSiteResponse>()
File renamed without changes.
@@ -1,5 +1,5 @@
import * as lemmy from 'lemmy-js-client'
import type { GetPosts, ListingType } from '../types'
import * as lemmy from '../types'
export function fromGetPosts(getPosts: GetPosts): lemmy.GetPosts {
return {
@@ -1,10 +1,11 @@
import createClient from 'openapi-fetch'
import type {
import {
BaseClient,
ClientType,
NullableFnArg,
NullableFnReturn,
type ClientType,
type NullableFnArg,
type NullableFnReturn,
} from '../base'
import type { SubscribedType } from '../types'
import {
fromCreateComment,
fromCreatePost,
@@ -33,7 +34,6 @@ import {
toTopicView,
} from './rewrite'
import type { paths } from './schema'
import type { SubscribedType } from '../types'
export class PiefedClient implements BaseClient {
type: ClientType = { name: 'piefed', baseUrl: '/api/alpha' }
@@ -1,5 +1,6 @@
import { Post } from '$lib/feature/post'
import { Search } from 'mono-svelte'
import type {
Comment,
CommentReplyView,
CommentSortType,
CommentView,
@@ -18,10 +19,8 @@ import type {
Person,
PersonMentionView,
PersonView,
Post,
PostView,
PrivateMessageView,
Search,
SortType,
SubscribedType,
TopicView,
File renamed without changes.
@@ -1,3 +1,334 @@
export interface AddAdminResponse {
admins: Array<PersonView>
}
export interface AddModToCommunityResponse {
moderators: Array<CommunityModeratorView>
}
export interface BanFromCommunityResponse {
person_view: PersonView
banned: boolean
}
export interface BannedPersonsResponse {
banned: Array<PersonView>
}
export interface BanPersonResponse {
person_view: PersonView
banned: boolean
}
export interface BlockCommunityResponse {
community_view: CommunityView
blocked: boolean
}
export interface BlockInstanceResponse {
blocked: boolean
}
export interface BlockPersonResponse {
person_view: PersonView
blocked: boolean
}
export interface CaptchaResponse {
png: string
wav: string
uuid: string
}
export interface CommentReplyResponse {
comment_reply_view: CommentReplyView
}
export interface CommentReportResponse {
comment_report_view: CommentReportView
}
export interface CommentResponse {
comment_view: CommentView
recipient_ids: Array<LocalUserId>
}
export interface CommunityResponse {
community_view: CommunityView
discussion_languages: Array<LanguageId>
}
export interface CustomEmojiResponse {
custom_emoji: CustomEmojiView
}
export interface GenerateTotpSecretResponse {
totp_secret_url: string
}
export interface GetCaptchaResponse {
ok?: CaptchaResponse
}
export interface GetComment {
id: CommentId
}
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
}
export interface GetCommentsResponse {
comments: Array<CommentView>
}
export interface GetCommunity {
id?: CommunityId
name?: string
}
export interface GetCommunityResponse {
community_view: CommunityView
site?: Site
moderators: Array<CommunityModeratorView>
discussion_languages: Array<LanguageId>
}
export interface GetFederatedInstancesResponse {
federated_instances?: FederatedInstances
}
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
}
export interface GetModlogResponse {
removed_posts: Array<ModRemovePostView>
locked_posts: Array<ModLockPostView>
featured_posts: Array<ModFeaturePostView>
removed_comments: Array<ModRemoveCommentView>
removed_communities: Array<ModRemoveCommunityView>
banned_from_community: Array<ModBanFromCommunityView>
banned: Array<ModBanView>
added_to_community: Array<ModAddCommunityView>
transferred_to_community: Array<ModTransferCommunityView>
added: Array<ModAddView>
admin_purged_persons: Array<AdminPurgePersonView>
admin_purged_communities: Array<AdminPurgeCommunityView>
admin_purged_posts: Array<AdminPurgePostView>
admin_purged_comments: Array<AdminPurgeCommentView>
hidden_communities: Array<ModHideCommunityView>
}
export interface GetPersonDetails {
person_id?: PersonId
username?: string
sort?: SortType
page?: number
limit?: number
community_id?: CommunityId
saved_only?: boolean
}
export interface GetPersonDetailsResponse {
person_view: PersonView
site?: Site
comments: Array<CommentView>
posts: Array<PostView>
moderates: Array<CommunityModeratorView>
}
export interface GetPersonMentions {
sort?: CommentSortType
page?: number
limit?: number
unread_only?: boolean
}
export interface GetPersonMentionsResponse {
mentions: Array<PersonMentionView>
}
export interface GetPost {
id?: PostId
comment_id?: CommentId
}
export interface GetPostResponse {
post_view: PostView
community_view: CommunityView
moderators: Array<CommunityModeratorView>
cross_posts: Array<PostView>
}
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
feed_id?: string
topic_id?: string
}
export interface GetPostsResponse {
posts: Array<PostView>
next_page: PaginationCursor
}
export interface GetPrivateMessages {
unread_only?: boolean
page?: number
limit?: number
creator_id?: PersonId
}
export interface GetRegistrationApplication {
person_id: PersonId
}
export interface GetReplies {
sort?: CommentSortType
page?: number
limit?: number
unread_only?: boolean
}
export interface GetRepliesResponse {
replies: Array<CommentReplyView>
}
export interface GetReportCount {
community_id?: CommunityId
}
export interface GetReportCountResponse {
community_id?: CommunityId
comment_reports: number
post_reports: number
private_message_reports?: number
}
export interface GetSiteMetadata {
url: string
}
export interface GetSiteMetadataResponse {
metadata: LinkMetadata
}
export interface GetSiteResponse {
site_view: SiteView
admins: Array<PersonView>
version: string
my_user?: MyUserInfo
all_languages: Array<Language>
discussion_languages: Array<LanguageId>
taglines: Array<Tagline>
custom_emojis: Array<CustomEmojiView>
blocked_urls: Array<LocalSiteUrlBlocklist>
}
export interface GetUnreadCountResponse {
replies: number
mentions: number
private_messages: number
}
export interface GetUnreadRegistrationApplicationCountResponse {
registration_applications: number
}
export interface ListCommentLikesResponse {
comment_likes: Array<VoteView>
}
export interface ListCommentReportsResponse {
comment_reports: Array<CommentReportView>
}
export interface ListCommunitiesResponse {
communities: Array<CommunityView>
}
export interface ListMediaResponse {
images: Array<LocalImageView>
}
export interface ListPostLikesResponse {
post_likes: Array<VoteView>
}
export interface ListPostReportsResponse {
post_reports: Array<PostReportView>
}
export interface ListPrivateMessageReportsResponse {
private_message_reports: Array<PrivateMessageReportView>
}
export interface ListRegistrationApplicationsResponse {
registration_applications: Array<RegistrationApplicationView>
}
export interface LoginResponse {
jwt?: string
registration_created: boolean
verify_email_sent: boolean
}
export interface PersonMentionResponse {
person_mention_view: PersonMentionView
}
export interface PostReportResponse {
post_report_view: PostReportView
}
export interface PostResponse {
post_view: PostView
}
export interface PrivateMessageReportResponse {
private_message_report_view: PrivateMessageReportView
}
export interface PrivateMessageResponse {
private_message_view: PrivateMessageView
}
export interface PrivateMessagesResponse {
private_messages: Array<PrivateMessageView>
}
export interface RegistrationApplicationResponse {
registration_application: RegistrationApplicationView
}
export interface ResolveObjectResponse {
comment?: CommentView
post?: PostView
community?: CommunityView
person?: PersonView
}
// TODO fix
type ActivityId = any
@@ -2063,3 +2394,22 @@ export interface AssignFlair {
post_id: number
flair_id_list: number[]
}
export interface SearchResponse {
type_: SearchType
comments: Array<CommentView>
posts: Array<PostView>
communities: Array<CommunityView>
users: Array<PersonView>
}
export interface SiteResponse {
site_view: SiteView
taglines: Array<Tagline>
}
export interface SuccessResponse {
success: boolean
}
export interface UpdateTotpResponse {
enabled: boolean
}
+1
View File
@@ -0,0 +1 @@
export * from './generated'
@@ -1,16 +1,16 @@
import { browser } from '$app/environment'
import { env } from '$env/dynamic/public'
import { amModOfAny, isAdmin } from '$comp/lemmy/moderation/moderation.js'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
import { client, getClient, site } from '$lib/client/lemmy.svelte'
import { instanceToURL, moveItem } from '$lib/util.svelte'
import { DEFAULT_CLIENT_TYPE, type ClientType } from '$lib/api/base'
import { client, getClient, site } from '$lib/api/client.svelte'
import type { Community, GetSiteResponse, MyUserInfo } from '$lib/api/types'
import { amModOfAny, isAdmin } from '$lib/feature/moderation/moderation'
import { publishedToDate } from '$lib/ui/util/date'
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'
import { DEFAULT_CLIENT_TYPE, type ClientType } from './client/base'
import { errorMessage } from './error'
import { t } from './i18n'
import { DEFAULT_INSTANCE_URL } from './instance.svelte'
import { instanceToURL, moveItem } from './util.svelte'
function getFromStorage<T>(key: string): T | undefined {
if (typeof localStorage == 'undefined') return undefined
@@ -1,5 +1,3 @@
import { t } from '$lib/i18n/translations'
// eslint-disable-next-line
export function errorMessage(error: any, instance?: string): string {
try {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
import i18n, { type Config, type Parser } from 'sveltekit-i18n'
import { default as i18n, type Config, type Parser } from 'sveltekit-i18n'
const config: Config = {
loaders: [
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,33 @@
<script lang="ts" module>
import { marked } from 'marked'
import { linkify, subSupscriptExtension } from './renderers/plugins.js'
import containerExtension from './renderers/spoiler/spoiler.js'
import { setContext } from 'svelte'
import type { ClassValue } from 'svelte/elements'
import MdTree from './MdTree.svelte'
import MdCode from './renderers/MdCode.svelte'
import MdHeading from './renderers/MdHeading.svelte'
import MdHr from './renderers/MdHr.svelte'
import MdHtml from './renderers/MdHtml.svelte'
import MdImage from './renderers/MdImage.svelte'
import MdLink from './renderers/MdLink.svelte'
import MdList from './renderers/MdList.svelte'
import MdListItem from './renderers/MdListItem.svelte'
import MdParagraph from './renderers/MdParagraph.svelte'
import MdQuote from './renderers/MdQuote.svelte'
import MdSpoiler from './renderers/MdSpoiler.svelte'
import MdSubscript from './renderers/MdSubscript.svelte'
import MdSuperscript from './renderers/MdSuperscript.svelte'
import MdText from './renderers/MdText.svelte'
import { linkify, subSupscriptExtension } from './renderers/plugins'
import containerExtension from './renderers/spoiler/spoiler'
import MdCodespan from './renderers/subtext/MdCodespan.svelte'
import MdDel from './renderers/subtext/MdDel.svelte'
import MdEm from './renderers/subtext/MdEm.svelte'
import MdStrong from './renderers/subtext/MdStrong.svelte'
import MdTable from './renderers/table/MdTable.svelte'
import MdTableBody from './renderers/table/MdTableBody.svelte'
import MdTableCell from './renderers/table/MdTableCell.svelte'
import MdTableHead from './renderers/table/MdTableHead.svelte'
import MdTableRow from './renderers/table/MdTableRow.svelte'
marked.setOptions({
gfm: true,
@@ -10,7 +36,6 @@
marked.use(linkify, {
extensions: [
// @ts-expect-error hell with marked
containerExtension((params: any) => {
if (params.type == 'spoiler') {
return {
@@ -22,7 +47,6 @@
}
return null
}),
// @ts-expect-error hell with marked
subSupscriptExtension((params: any) => {
if (params.type == 'subscript') {
return {
@@ -87,33 +111,6 @@
</script>
<script lang="ts">
import { setContext } from 'svelte'
import type { ClassValue } from 'svelte/elements'
import MdTree from './MdTree.svelte'
import MdEm from './renderers/subtext/MdEm.svelte'
import MdHeading from './renderers/MdHeading.svelte'
import MdImage from './renderers/MdImage.svelte'
import MdLink from './renderers/MdLink.svelte'
import MdQuote from './renderers/MdQuote.svelte'
import MdHr from './renderers/MdHr.svelte'
import MdHtml from './renderers/MdHtml.svelte'
import MdCode from './renderers/MdCode.svelte'
import MdList from './renderers/MdList.svelte'
import MdSpoiler from './renderers/MdSpoiler.svelte'
import MdTable from './renderers/table/MdTable.svelte'
import MdTableBody from './renderers/table/MdTableBody.svelte'
import MdTableCell from './renderers/table/MdTableCell.svelte'
import MdTableHead from './renderers/table/MdTableHead.svelte'
import MdTableRow from './renderers/table/MdTableRow.svelte'
import MdParagraph from './renderers/MdParagraph.svelte'
import MdListItem from './renderers/MdListItem.svelte'
import MdSubscript from './renderers/MdSubscript.svelte'
import MdSuperscript from './renderers/MdSuperscript.svelte'
import MdText from './renderers/MdText.svelte'
import MdStrong from './renderers/subtext/MdStrong.svelte'
import MdDel from './renderers/subtext/MdDel.svelte'
import MdCodespan from './renderers/subtext/MdCodespan.svelte'
interface RendererOptions {
autoloadImages: boolean
}
@@ -1,7 +1,6 @@
<script lang="ts">
import MultiSelect from '$comp/input/Switch.svelte'
import Markdown from '$comp/markdown/Markdown.svelte'
import { t } from '$lib/i18n/translations'
import ImageAttachForm from '$lib/ui/form/ImageAttachForm.svelte'
import MultiSelect from '$lib/ui/form/Switch.svelte'
import { Button, Label, Modal, TextArea } from 'mono-svelte'
import type { TextAreaProps } from 'mono-svelte/forms/TextArea.svelte'
import { tick } from 'svelte'
@@ -16,9 +15,10 @@
ListBullet,
Photo,
Strikethrough,
} from 'svelte-hero-icons'
} from 'svelte-hero-icons/dist'
import type { ClassValue } from 'svelte/elements'
import ImageAttachForm from '../form/ImageAttachForm.svelte'
import { t } from '../i18n'
import Markdown from './Markdown.svelte'
let textArea: HTMLTextAreaElement | undefined = $state()
@@ -1,7 +1,6 @@
<script lang="ts">
import type { Tokens } from 'marked'
import type { Renderer } from './Markdown.svelte'
import Self from './MdTree.svelte'
interface Props {
@@ -1,7 +1,7 @@
<script lang="ts">
import { t } from '$lib/i18n/translations'
import { t } from '$lib/app/i18n'
import { Button, Material, toast } from 'mono-svelte'
import { Icon, ClipboardDocument } from 'svelte-hero-icons'
import { ClipboardDocument, Icon } from 'svelte-hero-icons/dist'
interface Props {
raw: string
@@ -1,14 +1,14 @@
<script lang="ts">
import { t } from '$lib/app/i18n'
import {
iframeType,
mediaType,
optimizeImageURL,
PostIframe,
} from '$comp/lemmy/post'
import { showImage } from '$comp/ui/ExpandableImage.svelte'
import { t } from '$lib/i18n/translations'
} from '$lib/feature/post'
import { showImage } from '$lib/ui/generic/ExpandableImage.svelte'
import { getContext } from 'svelte'
import { ArrowDownTray, Icon } from 'svelte-hero-icons'
import { ArrowDownTray, Icon } from 'svelte-hero-icons/dist'
let loaded: boolean = $state(
(getContext('options') as { autoloadImages: boolean })?.autoloadImages ??
@@ -1,5 +1,5 @@
<script lang="ts">
import { photonify } from './plugins.js'
import { photonify } from './plugins'
interface Props {
href?: string
@@ -1,5 +1,5 @@
<script lang="ts">
import Expandable from '$comp/ui/Expandable.svelte'
import { Expandable } from 'mono-svelte'
import type { Snippet } from 'svelte'
interface Props {
@@ -1,11 +1,11 @@
<script lang="ts" generics="T">
import { browser } from '$app/environment'
import { settings } from '$lib/settings.svelte'
import { Expandable } from 'mono-svelte'
import { debounce } from 'mono-svelte/util/time'
import { onDestroy, onMount, untrack, type Snippet } from 'svelte'
import { type Snippet, onDestroy, onMount, untrack } from 'svelte'
import type { HTMLAttributes } from 'svelte/elements'
import { innerHeight } from 'svelte/reactivity/window'
import Expandable from '../ui/Expandable.svelte'
import { settings } from '../settings.svelte'
interface Props extends HTMLAttributes<HTMLDivElement> {
items: T[]
@@ -1,5 +1,5 @@
import { browser } from '$app/environment'
import type { CommunityView } from '$lib/client/types'
import type { CommunityView } from '$lib/api/types'
interface SessionStorage {
lastSeenCommunity?: CommunityView
@@ -1,7 +1,7 @@
import type { CommentSortType, ListingType, SortType } from '$lib/client/types'
import { env } from '$env/dynamic/public'
import { locale } from './i18n/translations'
import { browser } from '$app/environment'
import { env } from '$env/dynamic/public'
import type { CommentSortType, ListingType, SortType } from '$lib/api/types'
import { locale } from './i18n'
export type View = 'cozy' | 'compact'
File renamed without changes.
@@ -1,6 +1,6 @@
import { browser } from '$app/environment'
import { env } from '$env/dynamic/public'
import { getDefaultTheme, presets } from './presets'
import { browser } from "$app/environment"
import { env } from "$env/dynamic/public"
import { getDefaultTheme, presets } from "./presets"
type ColorScheme = 'system' | 'light' | 'dark'
@@ -1,11 +1,12 @@
import { browser } from '$app/environment'
import { goto } from '$app/navigation'
import { client } from '$lib/client/lemmy.svelte'
import { client } from '$lib/api/client.svelte'
import type { Community, Person } from '$lib/api/types'
import { SvelteURL } from 'svelte/reactivity'
import { t } from './i18n/translations'
import type { Community, Person } from './client/types'
import { t } from './i18n'
// Despite the name, this will round up
// This is because I do not care
// Example: findClosestNumber([8, 16, 32, 64, 128], 76) will return 128
export const findClosestNumber = (numbers: number[], target: number): number =>
numbers.reduce((prev, curr) =>
-65
View File
@@ -1,65 +0,0 @@
export * from './schemas/AddAdminResponse'
export * from './schemas/AddModToCommunityResponse'
export * from './schemas/BanFromCommunityResponse'
export * from './schemas/BanPersonResponse'
export * from './schemas/BannedPersonsResponse'
export * from './schemas/BlockCommunityResponse'
export * from './schemas/BlockInstanceResponse'
export * from './schemas/BlockPersonResponse'
export * from './schemas/CaptchaResponse'
export * from './schemas/CommentReplyResponse'
export * from './schemas/CommentReportResponse'
export * from './schemas/CommentResponse'
export * from './schemas/CommunityResponse'
export * from './schemas/CustomEmojiResponse'
export * from './schemas/GenerateTotpSecretResponse'
export * from './schemas/GetCaptchaResponse'
export * from './schemas/GetComment'
export * from './schemas/GetComments'
export * from './schemas/GetCommentsResponse'
export * from './schemas/GetCommunity'
export * from './schemas/GetCommunityResponse'
export * from './schemas/GetFederatedInstancesResponse'
export * from './schemas/GetModlog'
export * from './schemas/GetModlogResponse'
export * from './schemas/GetPersonDetails'
export * from './schemas/GetPersonDetailsResponse'
export * from './schemas/GetPersonMentions'
export * from './schemas/GetPersonMentionsResponse'
export * from './schemas/GetPost'
export * from './schemas/GetPostResponse'
export * from './schemas/GetPosts'
export * from './schemas/GetPostsResponse'
export * from './schemas/GetPrivateMessages'
export * from './schemas/GetRegistrationApplication'
export * from './schemas/GetReplies'
export * from './schemas/GetRepliesResponse'
export * from './schemas/GetReportCount'
export * from './schemas/GetReportCountResponse'
export * from './schemas/GetSiteMetadata'
export * from './schemas/GetSiteMetadataResponse'
export * from './schemas/GetSiteResponse'
export * from './schemas/GetUnreadCountResponse'
export * from './schemas/GetUnreadRegistrationApplicationCountResponse'
export * from './schemas/ListCommentLikesResponse'
export * from './schemas/ListCommentReportsResponse'
export * from './schemas/ListCommunitiesResponse'
export * from './schemas/ListMediaResponse'
export * from './schemas/ListPostLikesResponse'
export * from './schemas/ListPostReportsResponse'
export * from './schemas/ListPrivateMessageReportsResponse'
export * from './schemas/ListRegistrationApplicationsResponse'
export * from './schemas/LoginResponse'
export * from './schemas/PersonMentionResponse'
export * from './schemas/PostReportResponse'
export * from './schemas/PostResponse'
export * from './schemas/PrivateMessageReportResponse'
export * from './schemas/PrivateMessageResponse'
export * from './schemas/PrivateMessagesResponse'
export * from './schemas/RegistrationApplicationResponse'
export * from './schemas/ResolveObjectResponse'
export * from './schemas/SearchResponse'
export * from './schemas/SiteResponse'
export * from './schemas/SuccessResponse'
export * from './schemas/UpdateTotpResponse'
export * from './schemas/schemas'
@@ -1,4 +0,0 @@
import type { PersonView } from './schemas'
export interface AddAdminResponse {
admins: Array<PersonView>
}
@@ -1,4 +0,0 @@
import type { CommunityModeratorView } from './schemas'
export interface AddModToCommunityResponse {
moderators: Array<CommunityModeratorView>
}
@@ -1,5 +0,0 @@
import type { PersonView } from './schemas'
export interface BanFromCommunityResponse {
person_view: PersonView
banned: boolean
}
@@ -1,5 +0,0 @@
import type { PersonView } from './schemas'
export interface BanPersonResponse {
person_view: PersonView
banned: boolean
}
@@ -1,4 +0,0 @@
import type { PersonView } from './schemas'
export interface BannedPersonsResponse {
banned: Array<PersonView>
}
@@ -1,5 +0,0 @@
import type { CommunityView } from './schemas'
export interface BlockCommunityResponse {
community_view: CommunityView
blocked: boolean
}
@@ -1,3 +0,0 @@
export interface BlockInstanceResponse {
blocked: boolean
}
@@ -1,5 +0,0 @@
import type { PersonView } from './schemas'
export interface BlockPersonResponse {
person_view: PersonView
blocked: boolean
}
@@ -1,5 +0,0 @@
export interface CaptchaResponse {
png: string
wav: string
uuid: string
}
@@ -1,4 +0,0 @@
import type { CommentReplyView } from './schemas'
export interface CommentReplyResponse {
comment_reply_view: CommentReplyView
}
@@ -1,4 +0,0 @@
import type { CommentReportView } from './schemas'
export interface CommentReportResponse {
comment_report_view: CommentReportView
}
@@ -1,6 +0,0 @@
import type { CommentView } from './schemas'
import type { LocalUserId } from './schemas'
export interface CommentResponse {
comment_view: CommentView
recipient_ids: Array<LocalUserId>
}
@@ -1,6 +0,0 @@
import type { CommunityView } from './schemas'
import type { LanguageId } from './schemas'
export interface CommunityResponse {
community_view: CommunityView
discussion_languages: Array<LanguageId>
}
@@ -1,4 +0,0 @@
import type { CustomEmojiView } from './schemas'
export interface CustomEmojiResponse {
custom_emoji: CustomEmojiView
}
@@ -1,3 +0,0 @@
export interface GenerateTotpSecretResponse {
totp_secret_url: string
}
@@ -1,4 +0,0 @@
import type { CaptchaResponse } from './schemas'
export interface GetCaptchaResponse {
ok?: CaptchaResponse
}
@@ -1,4 +0,0 @@
import type { CommentId } from './schemas'
export interface GetComment {
id: CommentId
}
@@ -1,19 +0,0 @@
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
}
@@ -1,4 +0,0 @@
import type { CommentView } from './schemas'
export interface GetCommentsResponse {
comments: Array<CommentView>
}
@@ -1,5 +0,0 @@
import type { CommunityId } from './schemas'
export interface GetCommunity {
id?: CommunityId
name?: string
}
@@ -1,10 +0,0 @@
import type { CommunityModeratorView } from './schemas'
import type { CommunityView } from './schemas'
import type { LanguageId } from './schemas'
import type { Site } from './schemas'
export interface GetCommunityResponse {
community_view: CommunityView
site?: Site
moderators: Array<CommunityModeratorView>
discussion_languages: Array<LanguageId>
}
@@ -1,4 +0,0 @@
import type { FederatedInstances } from './schemas'
export interface GetFederatedInstancesResponse {
federated_instances?: FederatedInstances
}
-15
View File
@@ -1,15 +0,0 @@
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
}
@@ -1,32 +0,0 @@
import type { AdminPurgeCommentView } from './schemas'
import type { AdminPurgeCommunityView } from './schemas'
import type { AdminPurgePersonView } from './schemas'
import type { AdminPurgePostView } from './schemas'
import type { ModAddCommunityView } from './schemas'
import type { ModAddView } from './schemas'
import type { ModBanFromCommunityView } from './schemas'
import type { ModBanView } from './schemas'
import type { ModFeaturePostView } from './schemas'
import type { ModHideCommunityView } from './schemas'
import type { ModLockPostView } from './schemas'
import type { ModRemoveCommentView } from './schemas'
import type { ModRemoveCommunityView } from './schemas'
import type { ModRemovePostView } from './schemas'
import type { ModTransferCommunityView } from './schemas'
export interface GetModlogResponse {
removed_posts: Array<ModRemovePostView>
locked_posts: Array<ModLockPostView>
featured_posts: Array<ModFeaturePostView>
removed_comments: Array<ModRemoveCommentView>
removed_communities: Array<ModRemoveCommunityView>
banned_from_community: Array<ModBanFromCommunityView>
banned: Array<ModBanView>
added_to_community: Array<ModAddCommunityView>
transferred_to_community: Array<ModTransferCommunityView>
added: Array<ModAddView>
admin_purged_persons: Array<AdminPurgePersonView>
admin_purged_communities: Array<AdminPurgeCommunityView>
admin_purged_posts: Array<AdminPurgePostView>
admin_purged_comments: Array<AdminPurgeCommentView>
hidden_communities: Array<ModHideCommunityView>
}
@@ -1,12 +0,0 @@
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
}
@@ -1,12 +0,0 @@
import type { CommentView } from './schemas'
import type { CommunityModeratorView } from './schemas'
import type { PersonView } from './schemas'
import type { PostView } from './schemas'
import type { Site } from './schemas'
export interface GetPersonDetailsResponse {
person_view: PersonView
site?: Site
comments: Array<CommentView>
posts: Array<PostView>
moderates: Array<CommunityModeratorView>
}
@@ -1,7 +0,0 @@
import type { CommentSortType } from './schemas'
export interface GetPersonMentions {
sort?: CommentSortType
page?: number
limit?: number
unread_only?: boolean
}
@@ -1,4 +0,0 @@
import type { PersonMentionView } from './schemas'
export interface GetPersonMentionsResponse {
mentions: Array<PersonMentionView>
}
-6
View File
@@ -1,6 +0,0 @@
import type { CommentId } from './schemas'
import type { PostId } from './schemas'
export interface GetPost {
id?: PostId
comment_id?: CommentId
}
@@ -1,9 +0,0 @@
import type { CommunityModeratorView } from './schemas'
import type { CommunityView } from './schemas'
import type { PostView } from './schemas'
export interface GetPostResponse {
post_view: PostView
community_view: CommunityView
moderators: Array<CommunityModeratorView>
cross_posts: Array<PostView>
}
-21
View File
@@ -1,21 +0,0 @@
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
feed_id?: string
topic_id?: string
}
Loaded 100 of 423 files, more files were not shown because too many files have changed in this diff. Show more