2021-05-15 14:25:18 +09:00
|
|
|
export type ID = string;
|
2021-05-21 12:27:13 +09:00
|
|
|
export type DateString = string;
|
2021-05-14 11:46:39 +09:00
|
|
|
|
2021-05-17 19:50:31 +09:00
|
|
|
type TODO = Record<string, any>;
|
|
|
|
|
2021-05-14 11:46:39 +09:00
|
|
|
export type User = {
|
|
|
|
id: ID;
|
|
|
|
username: string;
|
|
|
|
host: string | null;
|
|
|
|
name: string;
|
|
|
|
onlineStatus: 'online' | 'active' | 'offline' | 'unknown';
|
|
|
|
avatarUrl: string;
|
|
|
|
avatarBlurhash: string;
|
|
|
|
emojis: {
|
|
|
|
name: string;
|
|
|
|
url: string;
|
|
|
|
}[];
|
|
|
|
};
|
|
|
|
|
2021-05-21 12:27:13 +09:00
|
|
|
export type UserGroup = TODO;
|
|
|
|
|
2021-05-21 13:55:39 +09:00
|
|
|
export type UserList = {
|
|
|
|
id: ID;
|
|
|
|
createdAt: DateString;
|
|
|
|
name: string;
|
|
|
|
userIds: User['id'][];
|
|
|
|
};
|
2021-05-21 12:27:13 +09:00
|
|
|
|
2021-05-17 19:50:31 +09:00
|
|
|
export type MeDetailed = User & {
|
|
|
|
avatarId: DriveFile['id'];
|
|
|
|
bannerId: DriveFile['id'];
|
|
|
|
autoAcceptFollowed: boolean;
|
|
|
|
noCrawle: boolean;
|
|
|
|
isExplorable: boolean;
|
|
|
|
hideOnlineStatus: boolean;
|
|
|
|
mutedWords: string[][];
|
|
|
|
[other: string]: any;
|
|
|
|
};
|
|
|
|
|
2021-05-14 11:46:39 +09:00
|
|
|
export type DriveFile = {
|
|
|
|
id: ID;
|
2021-05-21 12:27:13 +09:00
|
|
|
createdAt: DateString;
|
2021-05-14 11:46:39 +09:00
|
|
|
isSensitive: boolean;
|
|
|
|
name: string;
|
|
|
|
thumbnailUrl: string;
|
|
|
|
url: string;
|
|
|
|
type: string;
|
|
|
|
size: number;
|
|
|
|
md5: string;
|
|
|
|
blurhash: string;
|
|
|
|
properties: Record<string, any>;
|
|
|
|
};
|
|
|
|
|
2021-05-21 12:27:13 +09:00
|
|
|
export type DriveFolder = TODO;
|
|
|
|
|
|
|
|
export type GalleryPost = TODO;
|
|
|
|
|
2021-05-14 11:46:39 +09:00
|
|
|
export type Note = {
|
|
|
|
id: ID;
|
2021-05-21 12:27:13 +09:00
|
|
|
createdAt: DateString;
|
2021-05-14 11:46:39 +09:00
|
|
|
text: string | null;
|
|
|
|
cw: string | null;
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
reply?: Note;
|
|
|
|
replyId: Note['id'];
|
|
|
|
renote?: Note;
|
|
|
|
renoteId: Note['id'];
|
|
|
|
files: DriveFile[];
|
|
|
|
fileIds: DriveFile['id'][];
|
|
|
|
visibility: 'public' | 'home' | 'followers' | 'specified';
|
|
|
|
myReaction?: string;
|
|
|
|
reactions: Record<string, number>;
|
|
|
|
poll?: {
|
2021-05-21 12:27:13 +09:00
|
|
|
expiresAt: DateString | null;
|
2021-05-14 11:46:39 +09:00
|
|
|
multiple: boolean;
|
|
|
|
choices: {
|
|
|
|
isVoted: boolean;
|
|
|
|
text: string;
|
|
|
|
votes: number;
|
|
|
|
}[];
|
|
|
|
};
|
|
|
|
emojis: {
|
|
|
|
name: string;
|
|
|
|
url: string;
|
|
|
|
}[];
|
|
|
|
};
|
|
|
|
|
2021-05-17 19:50:31 +09:00
|
|
|
export type Notification = {
|
|
|
|
id: ID;
|
2021-05-21 12:27:13 +09:00
|
|
|
createdAt: DateString;
|
2021-05-17 19:50:31 +09:00
|
|
|
isRead: boolean;
|
|
|
|
} & ({
|
|
|
|
type: 'reaction';
|
|
|
|
reaction: string;
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
note: Note;
|
|
|
|
} | {
|
|
|
|
type: 'reply';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
note: Note;
|
|
|
|
} | {
|
|
|
|
type: 'renote';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
note: Note;
|
|
|
|
} | {
|
|
|
|
type: 'quote';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
note: Note;
|
|
|
|
} | {
|
|
|
|
type: 'mention';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
note: Note;
|
|
|
|
} | {
|
|
|
|
type: 'pollVote';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
note: Note;
|
|
|
|
} | {
|
|
|
|
type: 'follow';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
} | {
|
|
|
|
type: 'followRequestAccepted';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
} | {
|
|
|
|
type: 'receiveFollowRequest';
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
} | {
|
|
|
|
type: 'groupInvited'; // TODO
|
|
|
|
} | {
|
|
|
|
type: 'app';
|
|
|
|
body: string;
|
|
|
|
icon: string;
|
|
|
|
});
|
|
|
|
|
|
|
|
export type MessagingMessage = {
|
|
|
|
id: ID;
|
2021-05-21 12:27:13 +09:00
|
|
|
createdAt: DateString;
|
2021-05-17 19:50:31 +09:00
|
|
|
file: DriveFile | null;
|
|
|
|
fileId: DriveFile['id'] | null;
|
|
|
|
isRead: boolean;
|
|
|
|
reads: User['id'][];
|
|
|
|
text: string | null;
|
|
|
|
user: User;
|
|
|
|
userId: User['id'];
|
|
|
|
groupId: string; // TODO
|
|
|
|
};
|
|
|
|
|
2021-05-16 11:19:51 +09:00
|
|
|
export type InstanceMetadata = {
|
2021-05-14 11:46:39 +09:00
|
|
|
emojis: {
|
|
|
|
category: string;
|
|
|
|
}[];
|
|
|
|
ads: {
|
|
|
|
id: ID;
|
|
|
|
ratio: number;
|
|
|
|
place: string;
|
|
|
|
url: string;
|
|
|
|
imageUrl: string;
|
|
|
|
}[];
|
|
|
|
};
|
2021-05-15 14:25:18 +09:00
|
|
|
|
|
|
|
export type ServerInfo = {
|
|
|
|
machine: string;
|
|
|
|
cpu: {
|
|
|
|
model: string;
|
|
|
|
cores: number;
|
|
|
|
};
|
|
|
|
mem: {
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
fs: {
|
|
|
|
total: number;
|
|
|
|
used: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Stats = {
|
|
|
|
notesCount: number;
|
|
|
|
originalNotesCount: number;
|
|
|
|
usersCount: number;
|
|
|
|
originalUsersCount: number;
|
|
|
|
instances: number;
|
|
|
|
driveUsageLocal: number;
|
|
|
|
driveUsageRemote: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Page = {
|
|
|
|
id: ID;
|
2021-05-21 12:27:13 +09:00
|
|
|
createdAt: DateString;
|
|
|
|
updatedAt: DateString;
|
2021-05-15 14:25:18 +09:00
|
|
|
userId: User['id'];
|
|
|
|
user: User;
|
|
|
|
content: Record<string, any>[];
|
|
|
|
variables: Record<string, any>[];
|
|
|
|
title: string;
|
|
|
|
name: string;
|
|
|
|
summary: string | null;
|
|
|
|
hideTitleWhenPinned: boolean;
|
|
|
|
alignCenter: boolean;
|
|
|
|
font: string;
|
|
|
|
script: string;
|
|
|
|
eyeCatchingImageId: DriveFile['id'] | null;
|
|
|
|
eyeCatchingImage: DriveFile | null;
|
|
|
|
attachedFiles: any;
|
|
|
|
likedCount: number;
|
|
|
|
isLiked?: boolean;
|
|
|
|
};
|
|
|
|
|
2021-05-17 19:50:31 +09:00
|
|
|
export type PageEvent = {
|
|
|
|
pageId: Page['id'];
|
|
|
|
event: string;
|
|
|
|
var: any;
|
|
|
|
userId: User['id'];
|
|
|
|
user: User;
|
|
|
|
};
|
|
|
|
|
2021-05-21 12:27:13 +09:00
|
|
|
export type Announcement = {
|
|
|
|
id: ID;
|
|
|
|
createdAt: DateString;
|
|
|
|
updatedAt: DateString | null;
|
|
|
|
text: string;
|
|
|
|
title: string;
|
|
|
|
imageUrl: string | null;
|
|
|
|
isRead?: boolean;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Antenna = {
|
|
|
|
id: ID;
|
|
|
|
createdAt: DateString;
|
|
|
|
name: string;
|
|
|
|
keywords: string[][]; // TODO
|
|
|
|
excludeKeywords: string[][]; // TODO
|
|
|
|
src: 'home' | 'all' | 'users' | 'list' | 'group';
|
|
|
|
userListId: ID | null; // TODO
|
|
|
|
userGroupId: ID | null; // TODO
|
|
|
|
users: string[]; // TODO
|
|
|
|
caseSensitive: boolean;
|
|
|
|
notify: boolean;
|
|
|
|
withReplies: boolean;
|
|
|
|
withFile: boolean;
|
|
|
|
hasUnreadNote: boolean;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type App = TODO;
|
|
|
|
|
|
|
|
export type AuthSession = {
|
|
|
|
id: ID;
|
|
|
|
app: App;
|
|
|
|
token: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Ad = TODO;
|
|
|
|
|
|
|
|
export type Clip = TODO;
|
|
|
|
|
2021-05-15 14:25:18 +09:00
|
|
|
export type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt';
|
|
|
|
export type OriginType = 'combined' | 'local' | 'remote';
|