2023-01-13 05:40:33 +01:00
|
|
|
import config from "@/config/index.js";
|
2022-12-13 00:07:38 +01:00
|
|
|
|
2023-01-13 05:40:33 +01:00
|
|
|
export const MAX_NOTE_TEXT_LENGTH =
|
|
|
|
config.maxNoteLength != null ? config.maxNoteLength : 3000;
|
2022-02-20 08:07:43 +01:00
|
|
|
|
2022-07-14 00:01:23 +02:00
|
|
|
export const SECOND = 1000;
|
2022-07-25 22:57:13 +02:00
|
|
|
export const SEC = 1000;
|
2022-07-14 00:01:23 +02:00
|
|
|
export const MINUTE = 60 * SEC;
|
2022-07-25 22:57:13 +02:00
|
|
|
export const MIN = 60 * SEC;
|
2022-07-14 00:01:23 +02:00
|
|
|
export const HOUR = 60 * MIN;
|
|
|
|
export const DAY = 24 * HOUR;
|
|
|
|
|
2021-04-17 08:30:26 +02:00
|
|
|
export const USER_ONLINE_THRESHOLD = 1000 * 60 * 10; // 10min
|
|
|
|
export const USER_ACTIVE_THRESHOLD = 1000 * 60 * 60 * 24 * 3; // 3days
|
2022-01-01 14:25:30 +01:00
|
|
|
|
|
|
|
// ブラウザで直接表示することを許可するファイルの種類のリスト
|
|
|
|
// ここに含まれないものは application/octet-stream としてレスポンスされる
|
|
|
|
// SVGはXSSを生むので許可しない
|
|
|
|
export const FILE_TYPE_BROWSERSAFE = [
|
|
|
|
// Images
|
2023-01-13 05:40:33 +01:00
|
|
|
"image/png",
|
|
|
|
"image/gif",
|
|
|
|
"image/jpeg",
|
|
|
|
"image/webp",
|
|
|
|
"image/apng",
|
|
|
|
"image/bmp",
|
|
|
|
"image/tiff",
|
|
|
|
"image/x-icon",
|
2022-01-01 14:25:30 +01:00
|
|
|
|
|
|
|
// OggS
|
2023-01-13 05:40:33 +01:00
|
|
|
"audio/opus",
|
|
|
|
"video/ogg",
|
|
|
|
"audio/ogg",
|
|
|
|
"application/ogg",
|
2022-01-01 14:25:30 +01:00
|
|
|
|
|
|
|
// ISO/IEC base media file format
|
2023-01-13 05:40:33 +01:00
|
|
|
"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",
|
|
|
|
"audio/x-flac",
|
|
|
|
"audio/vnd.wave",
|
2022-01-01 14:25:30 +01: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
|
|
|
|
*/
|