Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x 83x | /**
* Constants for the suggestions feature.
* Centralised validation rules, tag lists, and configuration.
*/
const VALID_TAGS = [
'compliance',
'platform',
'revenue',
'social',
'quality-of-life',
'entertainment',
'support',
'website',
];
const VALID_LANGUAGES = [
// SHY-0289 — the five ShyTalk ships. A suggestion submitted in a language we
// no longer support would be stored in one nobody here can read or moderate,
// and the sanitiser normalises anything outside this list to undefined
// (English) rather than rejecting the submission.
//
// Suggestions ALREADY stored in a retired language keep their tag; this gates
// what arrives from now on.
'en',
'id',
'th',
'vi',
'zh',
];
const VALID_STATUSES = ['pending', 'accepted', 'planned', 'completed', 'rejected'];
const PUBLIC_STATUSES = ['accepted', 'planned', 'completed', 'rejected'];
const VOTABLE_STATUSES = ['accepted'];
const COMMENTABLE_STATUSES = ['accepted'];
const MAX_TITLE_LENGTH = 80;
const MAX_DESCRIPTION_LENGTH = 5000;
const MAX_COMMENT_LENGTH = 2000;
const MAX_VOTE_REASON_LENGTH = 500;
const MAX_REJECT_REASON_LENGTH = 2000;
const MAX_TAGS_PER_SUGGESTION = 5;
const MAX_PENDING_PER_USER = 10;
const MAX_PAGE_SIZE = 50;
const DEFAULT_PAGE_SIZE = 20;
const SEARCH_MIN_LENGTH = 2;
const SEARCH_PAGE_SIZE = 3;
const MAX_NOTIFICATIONS_PER_USER = 200;
const NOTIFICATION_TTL_DAYS = 90;
const SIMILARITY_THRESHOLD = 0.7;
module.exports = {
VALID_TAGS,
VALID_LANGUAGES,
VALID_STATUSES,
PUBLIC_STATUSES,
VOTABLE_STATUSES,
COMMENTABLE_STATUSES,
MAX_TITLE_LENGTH,
MAX_DESCRIPTION_LENGTH,
MAX_COMMENT_LENGTH,
MAX_VOTE_REASON_LENGTH,
MAX_REJECT_REASON_LENGTH,
MAX_TAGS_PER_SUGGESTION,
MAX_PENDING_PER_USER,
MAX_PAGE_SIZE,
DEFAULT_PAGE_SIZE,
SEARCH_MIN_LENGTH,
SEARCH_PAGE_SIZE,
MAX_NOTIFICATIONS_PER_USER,
NOTIFICATION_TTL_DAYS,
SIMILARITY_THRESHOLD,
};
|