2023-07-26 22:31:52 -07:00
|
|
|
/*
|
2024-02-13 07:59:27 -08:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-26 22:31:52 -07:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-01-26 07:08:48 -08:00
|
|
|
// ブラウザで直接表示することを許可するファイルの種類のリスト
|
|
|
|
// ここに含まれないものは application/octet-stream としてレスポンスされる
|
|
|
|
// SVGはXSSを生むので許可しない
|
|
|
|
export const FILE_TYPE_BROWSERSAFE = [
|
|
|
|
// Images
|
|
|
|
'image/png',
|
|
|
|
'image/gif',
|
|
|
|
'image/jpeg',
|
|
|
|
'image/webp',
|
2022-12-07 21:49:49 -08:00
|
|
|
'image/avif',
|
2022-01-26 07:08:48 -08:00
|
|
|
'image/apng',
|
|
|
|
'image/bmp',
|
|
|
|
'image/tiff',
|
|
|
|
'image/x-icon',
|
2023-11-02 15:14:36 -07:00
|
|
|
'image/jxl',
|
2022-01-26 07:08:48 -08:00
|
|
|
|
|
|
|
// 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 10:17:58 -07:00
|
|
|
|
|
|
|
// see https://github.com/misskey-dev/misskey/pull/10686
|
|
|
|
'audio/flac',
|
|
|
|
'audio/wav',
|
|
|
|
// backward compatibility
|
2022-01-26 07:08:48 -08:00
|
|
|
'audio/x-flac',
|
|
|
|
'audio/vnd.wave',
|
|
|
|
];
|
2023-11-02 15:14:36 -07:00
|
|
|
|
|
|
|
export const FILE_TYPE_TRACKER_MODULES = [
|
|
|
|
'audio/mod',
|
|
|
|
'audio/x-mod',
|
|
|
|
'audio/s3m',
|
|
|
|
'audio/x-s3m',
|
|
|
|
'audio/xm',
|
|
|
|
'audio/x-xm',
|
|
|
|
'audio/it',
|
|
|
|
'audio/x-it',
|
|
|
|
];
|
|
|
|
|
|
|
|
export const FILE_EXT_TRACKER_MODULES = [
|
|
|
|
'mod',
|
|
|
|
's3m',
|
|
|
|
'xm',
|
|
|
|
'it',
|
|
|
|
'mptm',
|
|
|
|
'stm',
|
|
|
|
'nst',
|
|
|
|
'm15',
|
|
|
|
'stk',
|
|
|
|
'wow',
|
|
|
|
'ult',
|
|
|
|
'669',
|
|
|
|
'mtm',
|
|
|
|
'med',
|
|
|
|
'far',
|
|
|
|
'mdl',
|
|
|
|
'ams',
|
|
|
|
'dsm',
|
|
|
|
'amf',
|
|
|
|
'okt',
|
|
|
|
'dmf',
|
|
|
|
'ptm',
|
|
|
|
'psm',
|
|
|
|
'mt2',
|
|
|
|
'dbm',
|
|
|
|
'digi',
|
|
|
|
'imf',
|
|
|
|
'j2b',
|
|
|
|
'gdm',
|
|
|
|
'umx',
|
|
|
|
'plm',
|
|
|
|
'mo3',
|
|
|
|
'xpk',
|
|
|
|
'ppm',
|
|
|
|
'mmcmp',
|
|
|
|
];
|
|
|
|
|
2022-01-26 07:08:48 -08:00
|
|
|
/*
|
|
|
|
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 03:46:14 -08:00
|
|
|
|
2023-12-20 17:39:11 -08:00
|
|
|
export const notificationTypes = [
|
|
|
|
'note',
|
|
|
|
'follow',
|
|
|
|
'mention',
|
|
|
|
'reply',
|
|
|
|
'renote',
|
|
|
|
'quote',
|
|
|
|
'reaction',
|
|
|
|
'pollEnded',
|
|
|
|
'receiveFollowRequest',
|
|
|
|
'followRequestAccepted',
|
|
|
|
'roleAssigned',
|
|
|
|
'achievementEarned',
|
|
|
|
'app',
|
|
|
|
] as const;
|
2023-02-23 03:46:14 -08:00
|
|
|
export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const;
|
2023-03-02 01:40:43 -08:00
|
|
|
|
2023-03-02 03:47:24 -08:00
|
|
|
export const ROLE_POLICIES = [
|
|
|
|
'gtlAvailable',
|
|
|
|
'ltlAvailable',
|
2023-12-03 17:10:51 -08:00
|
|
|
'btlAvailable',
|
2023-03-02 03:47:24 -08:00
|
|
|
'canPublicNote',
|
2023-11-12 06:07:32 -08:00
|
|
|
'canImportNotes',
|
2024-03-02 08:36:49 -08:00
|
|
|
'mentionLimit',
|
2023-03-02 03:47:24 -08:00
|
|
|
'canInvite',
|
2023-07-14 17:57:58 -07:00
|
|
|
'inviteLimit',
|
|
|
|
'inviteLimitCycle',
|
|
|
|
'inviteExpirationTime',
|
2023-03-02 03:47:24 -08:00
|
|
|
'canManageCustomEmojis',
|
2023-10-29 23:33:15 -07:00
|
|
|
'canManageAvatarDecorations',
|
2023-03-13 01:52:24 -07:00
|
|
|
'canSearchNotes',
|
2023-09-29 15:54:11 -07:00
|
|
|
'canUseTranslator',
|
2023-03-02 03:47:24 -08:00
|
|
|
'canHideAds',
|
|
|
|
'driveCapacityMb',
|
2023-05-04 22:18:06 -07:00
|
|
|
'alwaysMarkNsfw',
|
2023-03-02 03:47:24 -08:00
|
|
|
'pinLimit',
|
|
|
|
'antennaLimit',
|
|
|
|
'wordMuteLimit',
|
|
|
|
'webhookLimit',
|
|
|
|
'clipLimit',
|
|
|
|
'noteEachClipsLimit',
|
|
|
|
'userListLimit',
|
|
|
|
'userEachUserListsLimit',
|
|
|
|
'rateLimitFactor',
|
2023-12-12 23:56:19 -08:00
|
|
|
'avatarDecorationLimit',
|
2023-03-02 03:47:24 -08:00
|
|
|
] as const;
|
|
|
|
|
2023-03-02 01:40:43 -08: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-08 22:00:53 -07:00
|
|
|
|
2023-11-15 14:47:29 -08:00
|
|
|
export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://launcher.moe/error.png';
|
|
|
|
export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://launcher.moe/missingpage.webp';
|
|
|
|
export const DEFAULT_INFO_IMAGE_URL = 'https://launcher.moe/nothinghere.png';
|
2023-11-16 20:09:56 -08:00
|
|
|
|
2024-05-23 11:08:31 -07: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', 'followmouse'];
|
2024-01-19 01:50:26 -08: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-05-23 11:08:31 -07:00
|
|
|
border: ['width=', 'style=', 'color=', 'radius=', 'noclip'],
|
2024-01-19 01:50:26 -08:00
|
|
|
font: ['serif', 'monospace', 'cursive', 'fantasy', 'emoji', 'math'],
|
|
|
|
blur: [],
|
|
|
|
rainbow: ['speed=', 'delay='],
|
|
|
|
rotate: ['deg='],
|
|
|
|
ruby: [],
|
|
|
|
unixtime: [],
|
2024-05-23 11:08:31 -07:00
|
|
|
followmouse: ['x', 'y', 'rotateByVelocity', 'speed='],
|
2024-01-19 01:50:26 -08:00
|
|
|
};
|