2023-07-27 05:31:52 +00:00
|
|
|
|
/*
|
2024-02-13 15:59:27 +00:00
|
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 05:31:52 +00:00
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
*/
|
|
|
|
|
|
2023-09-21 09:48:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* note - 通知オンにしているユーザーが投稿した
|
|
|
|
|
* follow - フォローされた
|
|
|
|
|
* mention - 投稿で自分が言及された
|
|
|
|
|
* reply - 投稿に返信された
|
|
|
|
|
* renote - 投稿がRenoteされた
|
|
|
|
|
* quote - 投稿が引用Renoteされた
|
|
|
|
|
* reaction - 投稿にリアクションされた
|
|
|
|
|
* pollEnded - 自分のアンケートもしくは自分が投票したアンケートが終了した
|
|
|
|
|
* receiveFollowRequest - フォローリクエストされた
|
|
|
|
|
* followRequestAccepted - 自分の送ったフォローリクエストが承認された
|
2023-12-21 01:39:11 +00:00
|
|
|
|
* roleAssigned - ロールが付与された
|
2023-09-21 09:48:15 +00:00
|
|
|
|
* achievementEarned - 実績を獲得
|
|
|
|
|
* app - アプリ通知
|
|
|
|
|
* test - テスト通知(サーバー側)
|
|
|
|
|
*/
|
2023-12-21 01:39:11 +00:00
|
|
|
|
export const notificationTypes = [
|
|
|
|
|
'note',
|
|
|
|
|
'follow',
|
|
|
|
|
'mention',
|
|
|
|
|
'reply',
|
|
|
|
|
'renote',
|
|
|
|
|
'quote',
|
|
|
|
|
'reaction',
|
|
|
|
|
'pollEnded',
|
2024-03-02 16:36:49 +00:00
|
|
|
|
'edited',
|
2023-12-21 01:39:11 +00:00
|
|
|
|
'receiveFollowRequest',
|
|
|
|
|
'followRequestAccepted',
|
|
|
|
|
'roleAssigned',
|
|
|
|
|
'achievementEarned',
|
|
|
|
|
'app',
|
2024-03-02 16:36:49 +00:00
|
|
|
|
'test',
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
export const groupedNotificationTypes = [
|
|
|
|
|
...notificationTypes,
|
|
|
|
|
'reaction:grouped',
|
|
|
|
|
'renote:grouped',
|
|
|
|
|
] as const;
|
|
|
|
|
|
2023-02-23 11:46:14 +00:00
|
|
|
|
export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const;
|
2020-05-26 05:33:55 +00:00
|
|
|
|
|
|
|
|
|
export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const;
|
2020-07-27 04:34:20 +00:00
|
|
|
|
|
|
|
|
|
export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const;
|
2021-11-07 09:04:32 +00:00
|
|
|
|
|
2023-12-18 11:59:20 +00:00
|
|
|
|
export const followingVisibilities = ['public', 'followers', 'private'] as const;
|
|
|
|
|
export const followersVisibilities = ['public', 'followers', 'private'] as const;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
|
|
|
|
|
export const moderationLogTypes = [
|
|
|
|
|
'updateServerSettings',
|
|
|
|
|
'suspend',
|
2023-10-18 00:41:36 +00:00
|
|
|
|
'approve',
|
2023-09-23 09:28:16 +00:00
|
|
|
|
'unsuspend',
|
|
|
|
|
'updateUserNote',
|
|
|
|
|
'addCustomEmoji',
|
2023-09-24 01:57:24 +00:00
|
|
|
|
'updateCustomEmoji',
|
|
|
|
|
'deleteCustomEmoji',
|
2023-09-23 09:28:16 +00:00
|
|
|
|
'assignRole',
|
|
|
|
|
'unassignRole',
|
2023-09-25 01:29:12 +00:00
|
|
|
|
'createRole',
|
2023-09-23 09:28:16 +00:00
|
|
|
|
'updateRole',
|
|
|
|
|
'deleteRole',
|
|
|
|
|
'clearQueue',
|
|
|
|
|
'promoteQueue',
|
|
|
|
|
'deleteDriveFile',
|
|
|
|
|
'deleteNote',
|
|
|
|
|
'createGlobalAnnouncement',
|
|
|
|
|
'createUserAnnouncement',
|
2023-09-24 01:46:09 +00:00
|
|
|
|
'updateGlobalAnnouncement',
|
|
|
|
|
'updateUserAnnouncement',
|
|
|
|
|
'deleteGlobalAnnouncement',
|
|
|
|
|
'deleteUserAnnouncement',
|
2023-09-23 11:50:02 +00:00
|
|
|
|
'resetPassword',
|
|
|
|
|
'suspendRemoteInstance',
|
|
|
|
|
'unsuspendRemoteInstance',
|
2024-02-22 11:59:52 +00:00
|
|
|
|
'updateRemoteInstanceNote',
|
2023-09-24 06:40:38 +00:00
|
|
|
|
'markSensitiveDriveFile',
|
|
|
|
|
'unmarkSensitiveDriveFile',
|
2023-09-25 07:03:43 +00:00
|
|
|
|
'resolveAbuseReport',
|
2023-09-28 01:02:05 +00:00
|
|
|
|
'createInvitation',
|
2023-09-29 04:26:11 +00:00
|
|
|
|
'createAd',
|
|
|
|
|
'updateAd',
|
|
|
|
|
'deleteAd',
|
2023-10-21 09:38:07 +00:00
|
|
|
|
'createAvatarDecoration',
|
|
|
|
|
'updateAvatarDecoration',
|
|
|
|
|
'deleteAvatarDecoration',
|
2023-11-19 01:18:57 +00:00
|
|
|
|
'unsetUserAvatar',
|
|
|
|
|
'unsetUserBanner',
|
2023-09-23 09:28:16 +00:00
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
export type ModerationLogPayloads = {
|
|
|
|
|
updateServerSettings: {
|
|
|
|
|
before: any | null;
|
|
|
|
|
after: any | null;
|
|
|
|
|
};
|
|
|
|
|
suspend: {
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
2023-10-18 00:41:36 +00:00
|
|
|
|
approve: {
|
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
|
|
|
|
};
|
2023-09-23 09:28:16 +00:00
|
|
|
|
unsuspend: {
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
|
|
|
|
updateUserNote: {
|
|
|
|
|
userId: string;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
before: string | null;
|
|
|
|
|
after: string | null;
|
|
|
|
|
};
|
|
|
|
|
addCustomEmoji: {
|
|
|
|
|
emojiId: string;
|
2023-09-24 01:57:24 +00:00
|
|
|
|
emoji: any;
|
|
|
|
|
};
|
|
|
|
|
updateCustomEmoji: {
|
|
|
|
|
emojiId: string;
|
|
|
|
|
before: any;
|
|
|
|
|
after: any;
|
|
|
|
|
};
|
|
|
|
|
deleteCustomEmoji: {
|
|
|
|
|
emojiId: string;
|
|
|
|
|
emoji: any;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
|
|
|
|
assignRole: {
|
|
|
|
|
userId: string;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
roleId: string;
|
|
|
|
|
roleName: string;
|
|
|
|
|
expiresAt: string | null;
|
|
|
|
|
};
|
|
|
|
|
unassignRole: {
|
|
|
|
|
userId: string;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
roleId: string;
|
|
|
|
|
roleName: string;
|
|
|
|
|
};
|
2023-09-25 01:29:12 +00:00
|
|
|
|
createRole: {
|
|
|
|
|
roleId: string;
|
|
|
|
|
role: any;
|
|
|
|
|
};
|
2023-09-23 09:28:16 +00:00
|
|
|
|
updateRole: {
|
|
|
|
|
roleId: string;
|
|
|
|
|
before: any;
|
|
|
|
|
after: any;
|
|
|
|
|
};
|
|
|
|
|
deleteRole: {
|
|
|
|
|
roleId: string;
|
2023-09-24 01:33:30 +00:00
|
|
|
|
role: any;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
|
|
|
|
clearQueue: Record<string, never>;
|
|
|
|
|
promoteQueue: Record<string, never>;
|
|
|
|
|
deleteDriveFile: {
|
|
|
|
|
fileId: string;
|
|
|
|
|
fileUserId: string | null;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
fileUserUsername: string | null;
|
|
|
|
|
fileUserHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
|
|
|
|
deleteNote: {
|
|
|
|
|
noteId: string;
|
|
|
|
|
noteUserId: string;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
noteUserUsername: string;
|
|
|
|
|
noteUserHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
note: any;
|
|
|
|
|
};
|
|
|
|
|
createGlobalAnnouncement: {
|
|
|
|
|
announcementId: string;
|
|
|
|
|
announcement: any;
|
|
|
|
|
};
|
|
|
|
|
createUserAnnouncement: {
|
|
|
|
|
announcementId: string;
|
|
|
|
|
announcement: any;
|
|
|
|
|
userId: string;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
2023-09-24 01:46:09 +00:00
|
|
|
|
updateGlobalAnnouncement: {
|
|
|
|
|
announcementId: string;
|
|
|
|
|
before: any;
|
|
|
|
|
after: any;
|
|
|
|
|
};
|
|
|
|
|
updateUserAnnouncement: {
|
|
|
|
|
announcementId: string;
|
|
|
|
|
before: any;
|
|
|
|
|
after: any;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-24 01:46:09 +00:00
|
|
|
|
};
|
|
|
|
|
deleteGlobalAnnouncement: {
|
|
|
|
|
announcementId: string;
|
|
|
|
|
announcement: any;
|
|
|
|
|
};
|
|
|
|
|
deleteUserAnnouncement: {
|
|
|
|
|
announcementId: string;
|
|
|
|
|
announcement: any;
|
2023-10-04 10:55:35 +00:00
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-24 01:46:09 +00:00
|
|
|
|
};
|
2023-09-23 11:50:02 +00:00
|
|
|
|
resetPassword: {
|
2023-09-25 01:29:12 +00:00
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
2023-09-23 11:50:02 +00:00
|
|
|
|
};
|
|
|
|
|
suspendRemoteInstance: {
|
|
|
|
|
id: string;
|
|
|
|
|
host: string;
|
|
|
|
|
};
|
|
|
|
|
unsuspendRemoteInstance: {
|
|
|
|
|
id: string;
|
|
|
|
|
host: string;
|
|
|
|
|
};
|
2024-02-22 11:59:52 +00:00
|
|
|
|
updateRemoteInstanceNote: {
|
|
|
|
|
id: string;
|
|
|
|
|
host: string;
|
|
|
|
|
before: string | null;
|
|
|
|
|
after: string | null;
|
|
|
|
|
};
|
2023-09-24 06:40:38 +00:00
|
|
|
|
markSensitiveDriveFile: {
|
|
|
|
|
fileId: string;
|
|
|
|
|
fileUserId: string | null;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
fileUserUsername: string | null;
|
|
|
|
|
fileUserHost: string | null;
|
2023-09-24 06:40:38 +00:00
|
|
|
|
};
|
|
|
|
|
unmarkSensitiveDriveFile: {
|
|
|
|
|
fileId: string;
|
|
|
|
|
fileUserId: string | null;
|
2023-09-25 01:29:12 +00:00
|
|
|
|
fileUserUsername: string | null;
|
|
|
|
|
fileUserHost: string | null;
|
2023-09-24 06:40:38 +00:00
|
|
|
|
};
|
2023-09-25 07:03:43 +00:00
|
|
|
|
resolveAbuseReport: {
|
|
|
|
|
reportId: string;
|
|
|
|
|
report: any;
|
|
|
|
|
forwarded: boolean;
|
|
|
|
|
};
|
2023-09-28 01:02:05 +00:00
|
|
|
|
createInvitation: {
|
|
|
|
|
invitations: any[];
|
|
|
|
|
};
|
2023-09-29 04:26:11 +00:00
|
|
|
|
createAd: {
|
|
|
|
|
adId: string;
|
|
|
|
|
ad: any;
|
|
|
|
|
};
|
|
|
|
|
updateAd: {
|
|
|
|
|
adId: string;
|
|
|
|
|
before: any;
|
|
|
|
|
after: any;
|
|
|
|
|
};
|
|
|
|
|
deleteAd: {
|
|
|
|
|
adId: string;
|
|
|
|
|
ad: any;
|
|
|
|
|
};
|
2023-10-21 09:38:07 +00:00
|
|
|
|
createAvatarDecoration: {
|
|
|
|
|
avatarDecorationId: string;
|
|
|
|
|
avatarDecoration: any;
|
|
|
|
|
};
|
|
|
|
|
updateAvatarDecoration: {
|
|
|
|
|
avatarDecorationId: string;
|
|
|
|
|
before: any;
|
|
|
|
|
after: any;
|
|
|
|
|
};
|
|
|
|
|
deleteAvatarDecoration: {
|
|
|
|
|
avatarDecorationId: string;
|
|
|
|
|
avatarDecoration: any;
|
|
|
|
|
};
|
2023-11-19 01:18:57 +00:00
|
|
|
|
unsetUserAvatar: {
|
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
|
|
|
|
fileId: string;
|
|
|
|
|
};
|
|
|
|
|
unsetUserBanner: {
|
|
|
|
|
userId: string;
|
|
|
|
|
userUsername: string;
|
|
|
|
|
userHost: string | null;
|
|
|
|
|
fileId: string;
|
|
|
|
|
};
|
2023-09-23 09:28:16 +00:00
|
|
|
|
};
|
2023-09-29 02:29:54 +00:00
|
|
|
|
|
|
|
|
|
export type Serialized<T> = {
|
|
|
|
|
[K in keyof T]:
|
|
|
|
|
T[K] extends Date
|
|
|
|
|
? string
|
|
|
|
|
: T[K] extends (Date | null)
|
|
|
|
|
? (string | null)
|
|
|
|
|
: T[K] extends Record<string, any>
|
|
|
|
|
? Serialized<T[K]>
|
2024-01-22 06:41:29 +00:00
|
|
|
|
: T[K] extends (Record<string, any> | null)
|
|
|
|
|
? (Serialized<T[K]> | null)
|
|
|
|
|
: T[K] extends (Record<string, any> | undefined)
|
|
|
|
|
? (Serialized<T[K]> | undefined)
|
|
|
|
|
: T[K];
|
2023-09-29 02:29:54 +00:00
|
|
|
|
};
|
2023-11-02 06:57:55 +00:00
|
|
|
|
|
|
|
|
|
export type FilterUnionByProperty<
|
|
|
|
|
Union,
|
|
|
|
|
Property extends string | number | symbol,
|
|
|
|
|
Condition
|
|
|
|
|
> = Union extends Record<Property, Condition> ? Union : never;
|