2022-10-05 04:54:16 +00:00
|
|
|
// Time constants
|
2022-07-13 22:01:23 +00:00
|
|
|
export const SECOND = 1000;
|
2022-07-17 21:44:13 +00:00
|
|
|
export const MINUTE = 60 * SECOND;
|
|
|
|
export const HOUR = 60 * MINUTE;
|
2022-07-13 22:01:23 +00:00
|
|
|
export const DAY = 24 * HOUR;
|
2022-11-16 22:52:13 +00:00
|
|
|
export const WEEK = 7 * DAY;
|
|
|
|
export const MONTH = 30 * DAY;
|
|
|
|
export const YEAR = 365 * DAY;
|
2022-07-13 22:01:23 +00:00
|
|
|
|
2022-10-05 04:54:16 +00:00
|
|
|
export const USER_ONLINE_THRESHOLD = 10 * MINUTE;
|
|
|
|
export const USER_ACTIVE_THRESHOLD = 3 * DAY;
|
2022-01-01 13:25:30 +00:00
|
|
|
|
2022-10-05 04:52:52 +00:00
|
|
|
// List of file types allowed to be viewed directly in the browser.
|
|
|
|
// Anything not included here will be reported as application/octet-stream
|
|
|
|
// SVG is not allowed because it can lead to XSS
|
2022-01-01 13:25:30 +00:00
|
|
|
export const FILE_TYPE_BROWSERSAFE = [
|
|
|
|
// Images
|
|
|
|
'image/png',
|
|
|
|
'image/gif',
|
|
|
|
'image/jpeg',
|
|
|
|
'image/webp',
|
|
|
|
'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',
|
|
|
|
'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
|
|
|
|
*/
|