mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🚨 Turn every linter rule on and fix issues (there were a LOT :3)
This commit is contained in:
parent
2e98859153
commit
a1e02d0d78
177 changed files with 1826 additions and 1248 deletions
|
|
@ -4,7 +4,7 @@ import type { z } from "zod";
|
|||
import type { RolePermissions } from "~/drizzle/schema";
|
||||
|
||||
export type HttpVerb = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS";
|
||||
export interface APIRouteMetadata {
|
||||
export interface ApiRouteMetadata {
|
||||
allowedMethods: HttpVerb[];
|
||||
ratelimits: {
|
||||
max: number;
|
||||
|
|
@ -19,13 +19,13 @@ export interface APIRouteMetadata {
|
|||
permissions?: {
|
||||
required: RolePermissions[];
|
||||
methodOverrides?: {
|
||||
[key in HttpVerb]?: RolePermissions[];
|
||||
[Key in HttpVerb]?: RolePermissions[];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface APIRouteExports {
|
||||
meta: APIRouteMetadata;
|
||||
export interface ApiRouteExports {
|
||||
meta: ApiRouteMetadata;
|
||||
schemas?: {
|
||||
query?: z.AnyZodObject;
|
||||
body?: z.AnyZodObject;
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ export type Account = {
|
|||
avatar_static: string;
|
||||
header: string;
|
||||
header_static: string;
|
||||
emojis: Array<Emoji>;
|
||||
emojis: Emoji[];
|
||||
moved: Account | null;
|
||||
fields: Array<Field>;
|
||||
fields: Field[];
|
||||
bot: boolean | null;
|
||||
source?: Source;
|
||||
role?: Role;
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ export type Announcement = {
|
|||
published_at: string;
|
||||
updated_at: string | null;
|
||||
read: boolean | null;
|
||||
mentions: Array<AnnouncementAccount>;
|
||||
statuses: Array<AnnouncementStatus>;
|
||||
tags: Array<StatusTag>;
|
||||
emojis: Array<Emoji>;
|
||||
reactions: Array<AnnouncementReaction>;
|
||||
mentions: AnnouncementAccount[];
|
||||
statuses: AnnouncementStatus[];
|
||||
tags: StatusTag[];
|
||||
emojis: Emoji[];
|
||||
reactions: AnnouncementReaction[];
|
||||
};
|
||||
|
||||
export type AnnouncementAccount = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { Status } from "./status";
|
||||
|
||||
export type Context = {
|
||||
ancestors: Array<Status>;
|
||||
descendants: Array<Status>;
|
||||
ancestors: Status[];
|
||||
descendants: Status[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Status } from "./status";
|
|||
|
||||
export type Conversation = {
|
||||
id: string;
|
||||
accounts: Array<Account>;
|
||||
accounts: Account[];
|
||||
last_status: Status | null;
|
||||
unread: boolean;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export type Filter = {
|
||||
id: string;
|
||||
phrase: string;
|
||||
context: Array<FilterContext>;
|
||||
context: FilterContext[];
|
||||
expires_at: string | null;
|
||||
irreversible: boolean;
|
||||
whole_word: boolean;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ export type FollowRequest = {
|
|||
followers_count: number;
|
||||
following_count: number;
|
||||
statuses_count: number;
|
||||
emojis: Array<Emoji>;
|
||||
fields: Array<Field>;
|
||||
emojis: Emoji[];
|
||||
fields: Field[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export type Instance = {
|
|||
thumbnail: string | null;
|
||||
urls: URLs | null;
|
||||
stats: Stats;
|
||||
languages: Array<string>;
|
||||
languages: string[];
|
||||
registrations: boolean;
|
||||
approval_required: boolean;
|
||||
invites_enabled?: boolean;
|
||||
|
|
@ -29,7 +29,7 @@ export type Instance = {
|
|||
};
|
||||
};
|
||||
contact_account?: Account;
|
||||
rules?: Array<InstanceRule>;
|
||||
rules?: InstanceRule[];
|
||||
};
|
||||
|
||||
export type InstanceRule = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export type Poll = {
|
|||
expired: boolean;
|
||||
multiple: boolean;
|
||||
votes_count: number;
|
||||
options: Array<PollOption>;
|
||||
options: PollOption[];
|
||||
voted: boolean;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export type Reaction = {
|
|||
name: string;
|
||||
url?: string;
|
||||
static_url?: string;
|
||||
accounts?: Array<Account>;
|
||||
account_ids?: Array<string>;
|
||||
accounts?: Account[];
|
||||
account_ids?: string[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ export type Report = {
|
|||
id: string;
|
||||
action_taken: boolean;
|
||||
action_taken_at: string | null;
|
||||
status_ids: Array<string> | null;
|
||||
rule_ids: Array<string> | null;
|
||||
status_ids: string[] | null;
|
||||
rule_ids: string[] | null;
|
||||
// These parameters don't exist in Pleroma
|
||||
category: Category | null;
|
||||
comment: string | null;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Status } from "./status";
|
|||
import type { Tag } from "./tag";
|
||||
|
||||
export type Results = {
|
||||
accounts: Array<Account>;
|
||||
statuses: Array<Status>;
|
||||
hashtags: Array<Tag>;
|
||||
accounts: Account[];
|
||||
statuses: Status[];
|
||||
hashtags: Tag[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ export type ScheduledStatus = {
|
|||
id: string;
|
||||
scheduled_at: string;
|
||||
params: StatusParams;
|
||||
media_attachments: Array<Attachment> | null;
|
||||
media_attachments: Attachment[] | null;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ export type Source = {
|
|||
sensitive: boolean | null;
|
||||
language: string | null;
|
||||
note: string;
|
||||
fields: Array<Field>;
|
||||
fields: Field[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,15 +29,15 @@ export type Status = {
|
|||
sensitive: boolean;
|
||||
spoiler_text: string;
|
||||
visibility: StatusVisibility;
|
||||
media_attachments: Array<Attachment>;
|
||||
mentions: Array<Mention>;
|
||||
tags: Array<StatusTag>;
|
||||
media_attachments: Attachment[];
|
||||
mentions: Mention[];
|
||||
tags: StatusTag[];
|
||||
card: Card | null;
|
||||
poll: Poll | null;
|
||||
application: Application | null;
|
||||
language: string | null;
|
||||
pinned: boolean | null;
|
||||
emoji_reactions: Array<Reaction>;
|
||||
emoji_reactions: Reaction[];
|
||||
quote: boolean;
|
||||
bookmarked: boolean;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { StatusVisibility } from "./status";
|
|||
export type StatusParams = {
|
||||
text: string;
|
||||
in_reply_to_id: string | null;
|
||||
media_ids: Array<string> | null;
|
||||
media_ids: string[] | null;
|
||||
sensitive: boolean | null;
|
||||
spoiler_text: string | null;
|
||||
visibility: StatusVisibility | null;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ import type { History } from "./history";
|
|||
export type Tag = {
|
||||
name: string;
|
||||
url: string;
|
||||
history: Array<History>;
|
||||
history: History[];
|
||||
following?: boolean;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue