-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathgeneral.constant.js
More file actions
187 lines (171 loc) Β· 5.87 KB
/
general.constant.js
File metadata and controls
187 lines (171 loc) Β· 5.87 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
"use strict";
const HACKATHON_NAME = "McHacks";
// constants kept in alphabetical order
// matches optional http://, https://, http:, https:, and optional www., and then matches for devpost.com and further parameters
const DEVPOST_REGEX = /^(http(s)?:(\/\/)?)?(www\.)?(([-a-zA-Z0-9@:%._\+~#=]{2,256}\.)?devpost\.com)\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
// from https://emailregex.com
const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const HACKER_STATUS_NONE = "None";
const HACKER_STATUS_APPLIED = "Applied";
const HACKER_STATUS_ACCEPTED = "Accepted";
const HACKER_STATUS_WAITLISTED = "Waitlisted";
const HACKER_STATUS_DECLINED = "Declined";
const HACKER_STATUS_CONFIRMED = "Confirmed";
const HACKER_STATUS_WITHDRAWN = "Withdrawn";
const HACKER_STATUS_CHECKED_IN = "Checked-in";
const HACKER_STATUSES = [
HACKER_STATUS_NONE,
HACKER_STATUS_APPLIED,
HACKER_STATUS_ACCEPTED,
HACKER_STATUS_WAITLISTED,
HACKER_STATUS_CONFIRMED,
HACKER_STATUS_WITHDRAWN,
HACKER_STATUS_CHECKED_IN,
HACKER_STATUS_DECLINED
];
const SAMPLE_DIET_RESTRICTIONS = [
"None",
"Vegan",
"Vegetarian",
"Keto",
"Gluten free",
"Pescetarian",
"Peanut allergy",
"Milk allergy",
"Egg allergy",
"Allergy",
"No beef",
"No porc",
"No fish",
"No shellfish"
];
const HACKER = "Hacker";
const VOLUNTEER = "Volunteer";
const ADMIN = "Admin";
const SPONSOR = "Sponsor";
const SPONSOR_T1 = "SponsorT1";
const SPONSOR_T2 = "SponsorT2";
const SPONSOR_T3 = "SponsorT3";
const SPONSOR_T4 = "SponsorT4";
const SPONSOR_T5 = "SponsorT5";
const JOB_INTERESTS = ["Internship", "Full-time", "None"];
const ROLE_CATEGORIES = {
SELF: ":self",
ALL: ":all"
};
// enum of type of requests
const REQUEST_TYPES = {
GET: "GET",
POST: "POST",
PATCH: "PATCH",
DELETE: "DELETE",
PUT: "PUT"
};
//Define names of the roles specifically associated with permission to create an account
const POST_ROLES = {};
POST_ROLES[HACKER] = "postHacker";
POST_ROLES[SPONSOR_T1] = "postSponsor";
POST_ROLES[SPONSOR_T2] = "postSponsor";
POST_ROLES[SPONSOR_T3] = "postSponsor";
POST_ROLES[SPONSOR_T4] = "postSponsor";
POST_ROLES[SPONSOR_T5] = "postSponsor";
POST_ROLES[VOLUNTEER] = "postVolunteer";
POST_ROLES[ADMIN] = "postAdmin";
const SHIRT_SIZES = ["XS", "S", "M", "L", "XL", "XXL"];
const USER_TYPES = [HACKER, VOLUNTEER, ADMIN, SPONSOR];
const SPONSOR_TIERS = [
SPONSOR_T1,
SPONSOR_T2,
SPONSOR_T3,
SPONSOR_T4,
SPONSOR_T5
];
const EXTENDED_USER_TYPES = [
HACKER,
VOLUNTEER,
ADMIN,
SPONSOR_T1,
SPONSOR_T2,
SPONSOR_T3,
SPONSOR_T4,
SPONSOR_T5
];
// matches optional http://, https://, http:, https:, and optional www.
// matches the domain, and then optional route, path, query parameters
const URL_REGEX = /^(http(s)?:(\/\/)?)?(www\.)?([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6})\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
const ANY_REGEX = /^.+$/;
const MAX_TEAM_SIZE = 4;
const WEEK_OF = "Week Of";
const EMAIL_SUBJECTS = {};
EMAIL_SUBJECTS[
HACKER_STATUS_NONE
] = `Application for ${HACKATHON_NAME} incomplete`;
EMAIL_SUBJECTS[
HACKER_STATUS_APPLIED
] = `Thanks for applying to ${HACKATHON_NAME}`;
EMAIL_SUBJECTS[HACKER_STATUS_ACCEPTED] = `Great update from ${HACKATHON_NAME}`;
EMAIL_SUBJECTS[HACKER_STATUS_DECLINED] = `Update from ${HACKATHON_NAME}`;
EMAIL_SUBJECTS[HACKER_STATUS_WAITLISTED] = `Update from ${HACKATHON_NAME}`;
EMAIL_SUBJECTS[
HACKER_STATUS_CONFIRMED
] = `Thanks for confirming your attendance to ${HACKATHON_NAME}`;
EMAIL_SUBJECTS[HACKER_STATUS_WITHDRAWN] = "Sorry to see you go";
EMAIL_SUBJECTS[HACKER_STATUS_CHECKED_IN] = `Welcome to ${HACKATHON_NAME}`;
EMAIL_SUBJECTS[WEEK_OF] = `Welcome to ${HACKATHON_NAME}`;
const CONFIRM_ACC_EMAIL_SUBJECT = `Please complete your hacker application for ${HACKATHON_NAME}`;
const CREATE_ACC_EMAIL_SUBJECTS = {};
CREATE_ACC_EMAIL_SUBJECTS[
HACKER
] = `You've been invited to create a hacker account for ${HACKATHON_NAME}`;
CREATE_ACC_EMAIL_SUBJECTS[
SPONSOR
] = `You've been invited to create a sponsor account for ${HACKATHON_NAME}`;
CREATE_ACC_EMAIL_SUBJECTS[
VOLUNTEER
] = `You've been invited to create a volunteer account for ${HACKATHON_NAME}`;
CREATE_ACC_EMAIL_SUBJECTS[
ADMIN
] = `You've been invited to create an admin account for ${HACKATHON_NAME}`;
const CACHE_TIMEOUT_STATS = 5 * 60 * 1000;
const CACHE_KEY_STATS = "hackerStats";
module.exports = {
HACKATHON_NAME: HACKATHON_NAME,
DEVPOST_REGEX: DEVPOST_REGEX,
EMAIL_REGEX: EMAIL_REGEX,
ANY_REGEX: ANY_REGEX,
HACKER_STATUS_NONE: HACKER_STATUS_NONE,
HACKER_STATUS_APPLIED: HACKER_STATUS_APPLIED,
HACKER_STATUS_ACCEPTED: HACKER_STATUS_ACCEPTED,
HACKER_STATUS_DECLINED: HACKER_STATUS_DECLINED,
HACKER_STATUS_WAITLISTED: HACKER_STATUS_WAITLISTED,
HACKER_STATUS_CONFIRMED: HACKER_STATUS_CONFIRMED,
HACKER_STATUS_WITHDRAWN: HACKER_STATUS_WITHDRAWN,
HACKER_STATUS_CHECKED_IN: HACKER_STATUS_CHECKED_IN,
HACKER_STATUSES: HACKER_STATUSES,
REQUEST_TYPES: REQUEST_TYPES,
JOB_INTERESTS: JOB_INTERESTS,
SHIRT_SIZES: SHIRT_SIZES,
USER_TYPES: USER_TYPES,
SPONSOR_TIERS: SPONSOR_TIERS,
EXTENDED_USER_TYPES: EXTENDED_USER_TYPES,
URL_REGEX: URL_REGEX,
EMAIL_SUBJECTS: EMAIL_SUBJECTS,
CREATE_ACC_EMAIL_SUBJECTS: CREATE_ACC_EMAIL_SUBJECTS,
CONFIRM_ACC_EMAIL_SUBJECT: CONFIRM_ACC_EMAIL_SUBJECT,
HACKER: HACKER,
SPONSOR: SPONSOR,
VOLUNTEER: VOLUNTEER,
ADMIN: ADMIN,
SPONSOR_T1: SPONSOR_T1,
SPONSOR_T2: SPONSOR_T2,
SPONSOR_T3: SPONSOR_T3,
SPONSOR_T4: SPONSOR_T4,
SPONSOR_T5: SPONSOR_T5,
ROLE_CATEGORIES: ROLE_CATEGORIES,
POST_ROLES: POST_ROLES,
CACHE_TIMEOUT_STATS: CACHE_TIMEOUT_STATS,
CACHE_KEY_STATS: CACHE_KEY_STATS,
MAX_TEAM_SIZE: MAX_TEAM_SIZE,
WEEK_OF: WEEK_OF,
SAMPLE_DIET_RESTRICTIONS: SAMPLE_DIET_RESTRICTIONS
};