2023-05-22 01:35:48 +09:00
|
|
|
import { Packed } from "./schemas";
|
|
|
|
|
2023-05-22 01:44:29 +09:00
|
|
|
export type ID = Packed<'Id'>;
|
2023-03-30 09:33:19 +09:00
|
|
|
export type DateString = string;
|
|
|
|
|
|
|
|
type TODO = Record<string, any>;
|
|
|
|
|
|
|
|
// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように
|
2023-05-22 01:35:48 +09:00
|
|
|
export type User = Packed<'User'>;
|
2023-05-22 14:20:19 +09:00
|
|
|
|
2023-05-22 01:35:48 +09:00
|
|
|
export type UserLite = Packed<'UserLite'>;
|
|
|
|
export type UserDetailed = Packed<'UserDetailed'>;
|
2023-05-22 01:44:29 +09:00
|
|
|
export type UserList = Packed<'UserList'>;
|
|
|
|
export type MeDetailed = Packed<'MeDetailed'>;
|
|
|
|
export type DriveFile = Packed<'DriveFile'>;
|
|
|
|
export type DriveFolder = Packed<'DriveFolder'>;
|
|
|
|
export type GalleryPost = Packed<'GalleryPost'>;
|
|
|
|
export type Note = Packed<'Note'>;
|
|
|
|
export type NoteReaction = Packed<'NoteReaction'>;
|
|
|
|
export type NoteFavorite = Packed<'NoteFavorite'>;
|
|
|
|
export type Notification = Packed<'NotificationStrict'>;
|
|
|
|
export type CustomEmoji = Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>;
|
|
|
|
export type Page = Packed<'Page'>;
|
2023-03-30 09:33:19 +09:00
|
|
|
|
2023-05-22 01:44:29 +09:00
|
|
|
export type PageEvent = {
|
|
|
|
pageId: Page['id'];
|
|
|
|
event: string;
|
|
|
|
var: any;
|
2023-03-30 09:33:19 +09:00
|
|
|
userId: User['id'];
|
|
|
|
user: User;
|
|
|
|
};
|
|
|
|
|
2023-05-22 01:44:29 +09:00
|
|
|
export type Announcement = Packed<'Announcement'>;
|
|
|
|
export type Antenna = Packed<'Antenna'>;
|
|
|
|
export type App = Packed<'App'>;
|
|
|
|
export type Ad = Packed<'Ad'>;
|
|
|
|
export type Clip = Packed<'Clip'>;
|
|
|
|
export type Channel = Packed<'Channel'>;
|
|
|
|
export type Following = Packed<'Following'>;
|
|
|
|
export type Blocking = Packed<'Blocking'>;
|
2023-05-28 01:06:42 +09:00
|
|
|
export type Relay = Packed<'Relay'>;
|
2023-05-28 04:17:29 +09:00
|
|
|
export type Role = Packed<'Role'>;
|
|
|
|
export type RoleAssign = Packed<'RoleAssign'>;
|
|
|
|
export type RolePolicy = Packed<'RolePolicy'>;
|
|
|
|
export type RoleCondFormula = Packed<'RoleCondFormula'>;
|
2023-03-30 09:33:19 +09:00
|
|
|
|
|
|
|
export type LiteInstanceMetadata = {
|
|
|
|
maintainerName: string | null;
|
|
|
|
maintainerEmail: string | null;
|
|
|
|
version: string;
|
|
|
|
name: string | null;
|
|
|
|
uri: string;
|
|
|
|
description: string | null;
|
|
|
|
langs: string[];
|
|
|
|
tosUrl: string | null;
|
|
|
|
repositoryUrl: string;
|
|
|
|
feedbackUrl: string;
|
|
|
|
disableRegistration: boolean;
|
|
|
|
disableLocalTimeline: boolean;
|
|
|
|
disableGlobalTimeline: boolean;
|
|
|
|
driveCapacityPerLocalUserMb: number;
|
|
|
|
driveCapacityPerRemoteUserMb: number;
|
|
|
|
emailRequiredForSignup: boolean;
|
|
|
|
enableHcaptcha: boolean;
|
|
|
|
hcaptchaSiteKey: string | null;
|
|
|
|
enableRecaptcha: boolean;
|
|
|
|
recaptchaSiteKey: string | null;
|
|
|
|
enableTurnstile: boolean;
|
|
|
|
turnstileSiteKey: string | null;
|
|
|
|
swPublickey: string | null;
|
|
|
|
themeColor: string | null;
|
|
|
|
mascotImageUrl: string | null;
|
|
|
|
bannerUrl: string | null;
|
|
|
|
errorImageUrl: string | null;
|
|
|
|
iconUrl: string | null;
|
|
|
|
backgroundImageUrl: string | null;
|
|
|
|
logoImageUrl: string | null;
|
|
|
|
maxNoteTextLength: number;
|
|
|
|
enableEmail: boolean;
|
|
|
|
enableTwitterIntegration: boolean;
|
|
|
|
enableGithubIntegration: boolean;
|
|
|
|
enableDiscordIntegration: boolean;
|
|
|
|
enableServiceWorker: boolean;
|
|
|
|
emojis: CustomEmoji[];
|
|
|
|
defaultDarkTheme: string | null;
|
|
|
|
defaultLightTheme: string | null;
|
|
|
|
ads: {
|
|
|
|
id: ID;
|
|
|
|
ratio: number;
|
|
|
|
place: string;
|
|
|
|
url: string;
|
|
|
|
imageUrl: string;
|
|
|
|
}[];
|
|
|
|
translatorAvailable: boolean;
|
2023-04-19 21:24:31 +09:00
|
|
|
serverRules: string[];
|
2023-03-30 09:33:19 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
export type DetailedInstanceMetadata = LiteInstanceMetadata & {
|
|
|
|
pinnedPages: string[];
|
|
|
|
pinnedClipId: string | null;
|
|
|
|
cacheRemoteFiles: boolean;
|
|
|
|
requireSetup: boolean;
|
|
|
|
proxyAccountName: string | null;
|
|
|
|
features: Record<string, any>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
|
|
|
|
|
2023-05-30 01:30:50 +09:00
|
|
|
export type ServerInfo = Packed<'ServerInfo'>;
|
2023-03-30 09:33:19 +09:00
|
|
|
|
|
|
|
export type Stats = {
|
|
|
|
notesCount: number;
|
|
|
|
originalNotesCount: number;
|
|
|
|
usersCount: number;
|
|
|
|
originalUsersCount: number;
|
|
|
|
instances: number;
|
|
|
|
driveUsageLocal: number;
|
|
|
|
driveUsageRemote: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type AuthSession = {
|
|
|
|
id: ID;
|
|
|
|
app: App;
|
|
|
|
token: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type FollowRequest = {
|
|
|
|
id: ID;
|
|
|
|
follower: User;
|
|
|
|
followee: User;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type FollowingFolloweePopulated = Following & {
|
|
|
|
followee: UserDetailed;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type FollowingFollowerPopulated = Following & {
|
|
|
|
follower: UserDetailed;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Instance = {
|
|
|
|
id: ID;
|
|
|
|
caughtAt: DateString;
|
|
|
|
host: string;
|
|
|
|
usersCount: number;
|
|
|
|
notesCount: number;
|
|
|
|
followingCount: number;
|
|
|
|
followersCount: number;
|
|
|
|
driveUsage: number;
|
|
|
|
driveFiles: number;
|
|
|
|
latestRequestSentAt: DateString | null;
|
|
|
|
latestStatus: number | null;
|
|
|
|
latestRequestReceivedAt: DateString | null;
|
|
|
|
lastCommunicatedAt: DateString;
|
|
|
|
isNotResponding: boolean;
|
|
|
|
isSuspended: boolean;
|
|
|
|
softwareName: string | null;
|
|
|
|
softwareVersion: string | null;
|
|
|
|
openRegistrations: boolean | null;
|
|
|
|
name: string | null;
|
|
|
|
description: string | null;
|
|
|
|
maintainerName: string | null;
|
|
|
|
maintainerEmail: string | null;
|
|
|
|
iconUrl: string | null;
|
|
|
|
faviconUrl: string | null;
|
|
|
|
themeColor: string | null;
|
|
|
|
infoUpdatedAt: DateString | null;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Signin = {
|
|
|
|
id: ID;
|
|
|
|
createdAt: DateString;
|
|
|
|
ip: string;
|
|
|
|
headers: Record<string, any>;
|
|
|
|
success: boolean;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type UserSorting =
|
|
|
|
| '+follower'
|
|
|
|
| '-follower'
|
|
|
|
| '+createdAt'
|
|
|
|
| '-createdAt'
|
|
|
|
| '+updatedAt'
|
|
|
|
| '-updatedAt';
|
|
|
|
export type OriginType = 'combined' | 'local' | 'remote';
|