2023-12-03 03:45:18 +00:00
|
|
|
import { ModerationLogPayloads } from './consts.js';
|
2024-01-20 04:57:03 +00:00
|
|
|
import { Announcement, EmojiDetailed, MeDetailed, MeDetailedOnly, Page, User, UserDetailed } from './autogen/models.js';
|
2023-12-03 03:45:18 +00:00
|
|
|
|
2024-01-20 04:57:03 +00:00
|
|
|
export * from './autogen/entities.js';
|
|
|
|
export * from './autogen/models.js';
|
2023-09-23 09:28:16 +00:00
|
|
|
|
2023-03-30 00:33:19 +00:00
|
|
|
export type ID = string;
|
|
|
|
export type DateString = string;
|
|
|
|
|
|
|
|
export type PageEvent = {
|
|
|
|
pageId: Page['id'];
|
|
|
|
event: string;
|
|
|
|
var: any;
|
|
|
|
userId: User['id'];
|
|
|
|
user: User;
|
|
|
|
};
|
|
|
|
|
2023-09-23 09:28:16 +00:00
|
|
|
export type ModerationLog = {
|
|
|
|
id: ID;
|
|
|
|
createdAt: DateString;
|
|
|
|
userId: User['id'];
|
|
|
|
user: UserDetailed | null;
|
|
|
|
} & ({
|
|
|
|
type: 'updateServerSettings';
|
|
|
|
info: ModerationLogPayloads['updateServerSettings'];
|
|
|
|
} | {
|
|
|
|
type: 'suspend';
|
|
|
|
info: ModerationLogPayloads['suspend'];
|
|
|
|
} | {
|
|
|
|
type: 'unsuspend';
|
|
|
|
info: ModerationLogPayloads['unsuspend'];
|
|
|
|
} | {
|
|
|
|
type: 'updateUserNote';
|
|
|
|
info: ModerationLogPayloads['updateUserNote'];
|
|
|
|
} | {
|
|
|
|
type: 'addCustomEmoji';
|
|
|
|
info: ModerationLogPayloads['addCustomEmoji'];
|
2023-09-24 01:57:24 +00:00
|
|
|
} | {
|
|
|
|
type: 'updateCustomEmoji';
|
|
|
|
info: ModerationLogPayloads['updateCustomEmoji'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteCustomEmoji';
|
|
|
|
info: ModerationLogPayloads['deleteCustomEmoji'];
|
2023-09-23 09:28:16 +00:00
|
|
|
} | {
|
|
|
|
type: 'assignRole';
|
|
|
|
info: ModerationLogPayloads['assignRole'];
|
|
|
|
} | {
|
|
|
|
type: 'unassignRole';
|
|
|
|
info: ModerationLogPayloads['unassignRole'];
|
2023-09-25 01:29:12 +00:00
|
|
|
} | {
|
|
|
|
type: 'createRole';
|
|
|
|
info: ModerationLogPayloads['createRole'];
|
2023-09-23 09:28:16 +00:00
|
|
|
} | {
|
|
|
|
type: 'updateRole';
|
|
|
|
info: ModerationLogPayloads['updateRole'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteRole';
|
|
|
|
info: ModerationLogPayloads['deleteRole'];
|
|
|
|
} | {
|
|
|
|
type: 'clearQueue';
|
|
|
|
info: ModerationLogPayloads['clearQueue'];
|
|
|
|
} | {
|
|
|
|
type: 'promoteQueue';
|
|
|
|
info: ModerationLogPayloads['promoteQueue'];
|
2023-09-24 01:46:09 +00:00
|
|
|
} | {
|
|
|
|
type: 'deleteDriveFile';
|
|
|
|
info: ModerationLogPayloads['deleteDriveFile'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteNote';
|
|
|
|
info: ModerationLogPayloads['deleteNote'];
|
|
|
|
} | {
|
|
|
|
type: 'createGlobalAnnouncement';
|
|
|
|
info: ModerationLogPayloads['createGlobalAnnouncement'];
|
|
|
|
} | {
|
|
|
|
type: 'createUserAnnouncement';
|
|
|
|
info: ModerationLogPayloads['createUserAnnouncement'];
|
|
|
|
} | {
|
|
|
|
type: 'updateGlobalAnnouncement';
|
|
|
|
info: ModerationLogPayloads['updateGlobalAnnouncement'];
|
|
|
|
} | {
|
|
|
|
type: 'updateUserAnnouncement';
|
|
|
|
info: ModerationLogPayloads['updateUserAnnouncement'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteGlobalAnnouncement';
|
|
|
|
info: ModerationLogPayloads['deleteGlobalAnnouncement'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteUserAnnouncement';
|
|
|
|
info: ModerationLogPayloads['deleteUserAnnouncement'];
|
2023-09-23 11:50:02 +00:00
|
|
|
} | {
|
|
|
|
type: 'resetPassword';
|
|
|
|
info: ModerationLogPayloads['resetPassword'];
|
|
|
|
} | {
|
|
|
|
type: 'suspendRemoteInstance';
|
|
|
|
info: ModerationLogPayloads['suspendRemoteInstance'];
|
|
|
|
} | {
|
|
|
|
type: 'unsuspendRemoteInstance';
|
|
|
|
info: ModerationLogPayloads['unsuspendRemoteInstance'];
|
2023-09-24 06:40:38 +00:00
|
|
|
} | {
|
|
|
|
type: 'markSensitiveDriveFile';
|
|
|
|
info: ModerationLogPayloads['markSensitiveDriveFile'];
|
|
|
|
} | {
|
|
|
|
type: 'unmarkSensitiveDriveFile';
|
|
|
|
info: ModerationLogPayloads['unmarkSensitiveDriveFile'];
|
2023-09-28 01:02:05 +00:00
|
|
|
} | {
|
|
|
|
type: 'createInvitation';
|
|
|
|
info: ModerationLogPayloads['createInvitation'];
|
2023-09-29 06:01:13 +00:00
|
|
|
} | {
|
|
|
|
type: 'createAd';
|
|
|
|
info: ModerationLogPayloads['createAd'];
|
|
|
|
} | {
|
|
|
|
type: 'updateAd';
|
|
|
|
info: ModerationLogPayloads['updateAd'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteAd';
|
|
|
|
info: ModerationLogPayloads['deleteAd'];
|
2023-10-21 09:38:07 +00:00
|
|
|
} | {
|
|
|
|
type: 'createAvatarDecoration';
|
|
|
|
info: ModerationLogPayloads['createAvatarDecoration'];
|
|
|
|
} | {
|
|
|
|
type: 'updateAvatarDecoration';
|
|
|
|
info: ModerationLogPayloads['updateAvatarDecoration'];
|
|
|
|
} | {
|
|
|
|
type: 'deleteAvatarDecoration';
|
|
|
|
info: ModerationLogPayloads['deleteAvatarDecoration'];
|
|
|
|
} | {
|
|
|
|
type: 'resolveAbuseReport';
|
|
|
|
info: ModerationLogPayloads['resolveAbuseReport'];
|
2023-11-19 01:18:57 +00:00
|
|
|
} | {
|
|
|
|
type: 'unsetUserAvatar';
|
|
|
|
info: ModerationLogPayloads['unsetUserAvatar'];
|
|
|
|
} | {
|
|
|
|
type: 'unsetUserBanner';
|
|
|
|
info: ModerationLogPayloads['unsetUserBanner'];
|
2023-09-23 09:28:16 +00:00
|
|
|
});
|
2023-12-03 03:45:18 +00:00
|
|
|
|
|
|
|
export type ServerStats = {
|
|
|
|
cpu: number;
|
|
|
|
mem: {
|
|
|
|
used: number;
|
|
|
|
active: number;
|
|
|
|
};
|
|
|
|
net: {
|
|
|
|
rx: number;
|
|
|
|
tx: number;
|
|
|
|
};
|
|
|
|
fs: {
|
|
|
|
r: number;
|
|
|
|
w: number;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-01-07 14:56:46 +00:00
|
|
|
export type ServerStatsLog = ServerStats[];
|
2023-12-03 03:45:18 +00:00
|
|
|
|
|
|
|
export type QueueStats = {
|
|
|
|
deliver: {
|
|
|
|
activeSincePrevTick: number;
|
|
|
|
active: number;
|
|
|
|
waiting: number;
|
|
|
|
delayed: number;
|
|
|
|
};
|
|
|
|
inbox: {
|
|
|
|
activeSincePrevTick: number;
|
|
|
|
active: number;
|
|
|
|
waiting: number;
|
|
|
|
delayed: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-07 14:56:46 +00:00
|
|
|
export type QueueStatsLog = QueueStats[];
|
2023-12-03 03:45:18 +00:00
|
|
|
|
|
|
|
export type EmojiAdded = {
|
|
|
|
emoji: EmojiDetailed
|
|
|
|
};
|
|
|
|
|
|
|
|
export type EmojiUpdated = {
|
|
|
|
emojis: EmojiDetailed[]
|
|
|
|
};
|
|
|
|
|
|
|
|
export type EmojiDeleted = {
|
|
|
|
emojis: EmojiDetailed[]
|
|
|
|
};
|
|
|
|
|
|
|
|
export type AnnouncementCreated = {
|
|
|
|
announcement: Announcement;
|
|
|
|
};
|
2024-01-03 04:41:28 +00:00
|
|
|
|
|
|
|
export type SignupRequest = {
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
host?: string;
|
|
|
|
invitationCode?: string;
|
|
|
|
emailAddress?: string;
|
|
|
|
'hcaptcha-response'?: string | null;
|
|
|
|
'g-recaptcha-response'?: string | null;
|
|
|
|
'turnstile-response'?: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SignupResponse = MeDetailed & {
|
|
|
|
token: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SignupPendingRequest = {
|
|
|
|
code: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type SignupPendingResponse = {
|
|
|
|
id: User['id'],
|
|
|
|
i: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type SigninRequest = {
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
token?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type SigninResponse = {
|
|
|
|
id: User['id'],
|
|
|
|
i: string,
|
|
|
|
};
|