2023-08-14 19:52:38 +02:00
|
|
|
/*
|
2024-02-12 03:37:45 +01:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-08-14 19:52:38 +02:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-01-26 16:08:48 +01:00
|
|
|
// ブラウザで直接表示することを許可するファイルの種類のリスト
|
|
|
|
// ここに含まれないものは application/octet-stream としてレスポンスされる
|
|
|
|
// SVGはXSSを生むので許可しない
|
|
|
|
export const FILE_TYPE_BROWSERSAFE = [
|
|
|
|
// Images
|
|
|
|
'image/png',
|
|
|
|
'image/gif',
|
|
|
|
'image/jpeg',
|
|
|
|
'image/webp',
|
2022-12-08 06:49:49 +01:00
|
|
|
'image/avif',
|
2022-01-26 16:08:48 +01:00
|
|
|
'image/apng',
|
|
|
|
'image/bmp',
|
|
|
|
'image/tiff',
|
|
|
|
'image/x-icon',
|
|
|
|
|
|
|
|
// OggS
|
|
|
|
'audio/opus',
|
|
|
|
'video/ogg',
|
|
|
|
'audio/ogg',
|
|
|
|
'application/ogg',
|
|
|
|
|
|
|
|
// ISO/IEC base media file format
|
|
|
|
'video/quicktime',
|
|
|
|
'video/mp4',
|
|
|
|
'audio/mp4',
|
|
|
|
'video/x-m4v',
|
|
|
|
'audio/x-m4a',
|
|
|
|
'video/3gpp',
|
|
|
|
'video/3gpp2',
|
|
|
|
|
|
|
|
'video/mpeg',
|
|
|
|
'audio/mpeg',
|
|
|
|
|
|
|
|
'video/webm',
|
|
|
|
'audio/webm',
|
|
|
|
|
|
|
|
'audio/aac',
|
2023-04-25 19:17:58 +02:00
|
|
|
|
|
|
|
// see https://github.com/misskey-dev/misskey/pull/10686
|
|
|
|
'audio/flac',
|
|
|
|
'audio/wav',
|
|
|
|
// backward compatibility
|
2022-01-26 16:08:48 +01:00
|
|
|
'audio/x-flac',
|
|
|
|
'audio/vnd.wave',
|
|
|
|
];
|
|
|
|
/*
|
|
|
|
https://github.com/sindresorhus/file-type/blob/main/supported.js
|
|
|
|
https://github.com/sindresorhus/file-type/blob/main/core.js
|
|
|
|
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
|
|
|
*/
|
2023-02-23 12:46:14 +01:00
|
|
|
|
2023-12-21 02:39:11 +01:00
|
|
|
export const notificationTypes = [
|
|
|
|
'note',
|
|
|
|
'follow',
|
|
|
|
'mention',
|
|
|
|
'reply',
|
|
|
|
'renote',
|
|
|
|
'quote',
|
|
|
|
'reaction',
|
|
|
|
'pollEnded',
|
|
|
|
'receiveFollowRequest',
|
|
|
|
'followRequestAccepted',
|
|
|
|
'roleAssigned',
|
|
|
|
'achievementEarned',
|
|
|
|
'app',
|
|
|
|
] as const;
|
2023-02-23 12:46:14 +01:00
|
|
|
export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const;
|
2023-03-02 10:40:43 +01:00
|
|
|
|
2023-03-02 12:47:24 +01:00
|
|
|
export const ROLE_POLICIES = [
|
|
|
|
'gtlAvailable',
|
|
|
|
'ltlAvailable',
|
|
|
|
'canPublicNote',
|
2024-02-26 18:51:17 +01:00
|
|
|
'canInitiateConversation',
|
2023-07-27 21:21:59 +02:00
|
|
|
'canCreateContent',
|
|
|
|
'canUpdateContent',
|
|
|
|
'canDeleteContent',
|
2024-01-23 12:37:14 +01:00
|
|
|
'canUpdateAvatar',
|
|
|
|
'canUpdateBanner',
|
2024-02-29 12:48:02 +01:00
|
|
|
'mentionLimit',
|
2023-03-02 12:47:24 +01:00
|
|
|
'canInvite',
|
2023-07-15 02:57:58 +02:00
|
|
|
'inviteLimit',
|
|
|
|
'inviteLimitCycle',
|
|
|
|
'inviteExpirationTime',
|
2023-03-02 12:47:24 +01:00
|
|
|
'canManageCustomEmojis',
|
2023-10-30 07:33:15 +01:00
|
|
|
'canManageAvatarDecorations',
|
2023-03-13 09:52:24 +01:00
|
|
|
'canSearchNotes',
|
2023-09-30 00:54:11 +02:00
|
|
|
'canUseTranslator',
|
2023-12-27 02:16:48 +01:00
|
|
|
'canUseDriveFileInSoundSettings',
|
2023-03-02 12:47:24 +01:00
|
|
|
'canHideAds',
|
|
|
|
'driveCapacityMb',
|
2023-05-05 07:18:06 +02:00
|
|
|
'alwaysMarkNsfw',
|
2024-03-02 19:48:47 +01:00
|
|
|
'skipNsfwDetection',
|
2023-03-02 12:47:24 +01:00
|
|
|
'pinLimit',
|
|
|
|
'antennaLimit',
|
2024-03-02 18:42:13 +01:00
|
|
|
'antennaNotesLimit',
|
2023-03-02 12:47:24 +01:00
|
|
|
'wordMuteLimit',
|
|
|
|
'webhookLimit',
|
|
|
|
'clipLimit',
|
|
|
|
'noteEachClipsLimit',
|
|
|
|
'userListLimit',
|
|
|
|
'userEachUserListsLimit',
|
|
|
|
'rateLimitFactor',
|
2023-12-13 08:56:19 +01:00
|
|
|
'avatarDecorationLimit',
|
2023-03-02 12:47:24 +01:00
|
|
|
] as const;
|
|
|
|
|
2023-03-02 10:40:43 +01:00
|
|
|
// なんか動かない
|
|
|
|
//export const CURRENT_STICKY_TOP = Symbol('CURRENT_STICKY_TOP');
|
|
|
|
//export const CURRENT_STICKY_BOTTOM = Symbol('CURRENT_STICKY_BOTTOM');
|
|
|
|
export const CURRENT_STICKY_TOP = 'CURRENT_STICKY_TOP';
|
|
|
|
export const CURRENT_STICKY_BOTTOM = 'CURRENT_STICKY_BOTTOM';
|
2023-06-09 07:00:53 +02:00
|
|
|
|
|
|
|
export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://xn--931a.moe/assets/error.jpg';
|
|
|
|
export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://xn--931a.moe/assets/not-found.jpg';
|
|
|
|
export const DEFAULT_INFO_IMAGE_URL = 'https://xn--931a.moe/assets/info.jpg';
|
2023-11-17 05:09:56 +01:00
|
|
|
|
2024-01-13 13:17:00 +01:00
|
|
|
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'scale', 'position', 'fg', 'bg', 'border', 'font', 'blur', 'rainbow', 'sparkle', 'rotate', 'ruby', 'unixtime'];
|
2024-01-19 10:50:26 +01:00
|
|
|
export const MFM_PARAMS: Record<typeof MFM_TAGS[number], string[]> = {
|
|
|
|
tada: ['speed=', 'delay='],
|
|
|
|
jelly: ['speed=', 'delay='],
|
|
|
|
twitch: ['speed=', 'delay='],
|
|
|
|
shake: ['speed=', 'delay='],
|
|
|
|
spin: ['speed=', 'delay=', 'left', 'alternate', 'x', 'y'],
|
|
|
|
jump: ['speed=', 'delay='],
|
|
|
|
bounce: ['speed=', 'delay='],
|
|
|
|
flip: ['h', 'v'],
|
|
|
|
x2: [],
|
|
|
|
x3: [],
|
|
|
|
x4: [],
|
|
|
|
scale: ['x=', 'y='],
|
|
|
|
position: ['x=', 'y='],
|
|
|
|
fg: ['color='],
|
|
|
|
bg: ['color='],
|
2024-02-26 18:51:17 +01:00
|
|
|
border: ['width=', 'style=', 'color=', 'radius=', 'noclip'],
|
2024-01-19 10:50:26 +01:00
|
|
|
font: ['serif', 'monospace', 'cursive', 'fantasy', 'emoji', 'math'],
|
|
|
|
blur: [],
|
|
|
|
rainbow: ['speed=', 'delay='],
|
|
|
|
rotate: ['deg='],
|
|
|
|
ruby: [],
|
|
|
|
unixtime: [],
|
|
|
|
};
|