@juki-team/commons 0.1.46 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{types/constants → constants}/commons.d.ts +1 -1
- package/dist/constants/commons.js +648 -0
- package/dist/{types/constants → constants}/contest.d.ts +1 -1
- package/dist/constants/contest.js +28 -0
- package/dist/{types/constants → constants}/course.d.ts +1 -1
- package/dist/constants/course.js +12 -0
- package/dist/constants/date.js +23 -0
- package/dist/constants/email.js +34 -0
- package/dist/{types/constants → constants}/entity.d.ts +1 -1
- package/dist/constants/entity.js +18 -0
- package/dist/{types/constants → constants}/file.d.ts +1 -1
- package/dist/constants/file.js +45 -0
- package/dist/constants/index.d.ts +18 -0
- package/dist/constants/index.js +18 -0
- package/dist/{types/constants → constants}/judge.d.ts +1 -1
- package/dist/constants/judge.js +225 -0
- package/dist/{types/constants → constants}/organization.d.ts +1 -1
- package/dist/constants/organization.js +24 -0
- package/dist/{types/constants → constants}/problem.d.ts +1 -1
- package/dist/constants/problem.js +69 -0
- package/dist/constants/routing.js +7 -0
- package/dist/{types/constants → constants}/services.d.ts +1 -1
- package/dist/constants/services.js +157 -0
- package/dist/{types/constants → constants}/system.d.ts +1 -1
- package/dist/constants/system.js +9 -0
- package/dist/{types/constants → constants}/teams.d.ts +1 -1
- package/dist/constants/teams.js +17 -0
- package/dist/constants/time.js +9 -0
- package/dist/{types/constants → constants}/user.d.ts +2 -2
- package/dist/constants/user.js +40 -0
- package/dist/{types/constants → constants}/websocket.d.ts +7 -3
- package/dist/constants/websocket.js +56 -0
- package/dist/{types/constants → constants}/worksheet.d.ts +1 -1
- package/dist/constants/worksheet.js +66 -0
- package/dist/{types/dto → dto}/class.d.ts +3 -3
- package/dist/dto/class.js +1 -0
- package/dist/{types/dto → dto}/code.d.ts +1 -1
- package/dist/dto/code.js +1 -0
- package/dist/{types/dto → dto}/comments.d.ts +1 -1
- package/dist/dto/comments.js +1 -0
- package/dist/{types/dto → dto}/contest.d.ts +4 -4
- package/dist/dto/contest.js +7 -0
- package/dist/{types/dto → dto}/course.d.ts +4 -4
- package/dist/dto/course.js +1 -0
- package/dist/{types/dto → dto}/entity.d.ts +2 -2
- package/dist/dto/entity.js +5 -0
- package/dist/{types/dto → dto}/excalidraw.d.ts +3 -3
- package/dist/dto/excalidraw.js +1 -0
- package/dist/{types/dto → dto}/file.d.ts +2 -2
- package/dist/dto/file.js +1 -0
- package/dist/dto/image.js +1 -0
- package/dist/dto/index.d.ts +25 -0
- package/dist/dto/index.js +25 -0
- package/dist/{types/dto → dto}/judge.d.ts +1 -1
- package/dist/dto/judge.js +1 -0
- package/dist/{types/dto → dto}/markdown.d.ts +3 -3
- package/dist/dto/markdown.js +1 -0
- package/dist/{types/dto → dto}/mermaid.d.ts +3 -3
- package/dist/dto/mermaid.js +1 -0
- package/dist/{types/dto → dto}/organization.d.ts +3 -3
- package/dist/dto/organization.js +1 -0
- package/dist/{types/dto → dto}/problem.d.ts +3 -3
- package/dist/dto/problem.js +1 -0
- package/dist/{types/dto → dto}/scoreboard.d.ts +2 -2
- package/dist/dto/scoreboard.js +1 -0
- package/dist/{types/dto → dto}/session.d.ts +2 -2
- package/dist/dto/session.js +1 -0
- package/dist/{types/dto → dto}/socket.d.ts +5 -5
- package/dist/dto/socket.js +1 -0
- package/dist/{types/dto → dto}/statistics.d.ts +1 -1
- package/dist/dto/statistics.js +1 -0
- package/dist/{types/dto → dto}/submission.d.ts +3 -3
- package/dist/dto/submission.js +1 -0
- package/dist/{types/dto → dto}/system.d.ts +1 -1
- package/dist/dto/system.js +1 -0
- package/dist/dto/url.js +1 -0
- package/dist/{types/dto → dto}/user.d.ts +3 -3
- package/dist/dto/user.js +1 -0
- package/dist/{types/dto → dto}/virtual-user.d.ts +1 -1
- package/dist/dto/virtual-user.js +1 -0
- package/dist/{types/dto → dto}/worksheet-submissions.d.ts +3 -3
- package/dist/dto/worksheet-submissions.js +1 -0
- package/dist/{types/dto → dto}/worksheet.d.ts +3 -3
- package/dist/dto/worksheet.js +1 -0
- package/dist/{types/helpers → helpers}/class.d.ts +1 -1
- package/dist/helpers/class.js +10 -0
- package/dist/helpers/comments.js +4 -0
- package/dist/{types/helpers → helpers}/commons.d.ts +1 -1
- package/dist/helpers/commons.js +187 -0
- package/dist/{types/helpers → helpers}/contest.d.ts +1 -1
- package/dist/helpers/contest.js +21 -0
- package/dist/helpers/date.js +181 -0
- package/dist/{types/helpers → helpers}/document.d.ts +2 -2
- package/dist/helpers/document.js +51 -0
- package/dist/{types/helpers → helpers}/errors.d.ts +1 -1
- package/dist/helpers/errors.js +17 -0
- package/dist/helpers/file.js +4 -0
- package/dist/helpers/index.d.ts +17 -0
- package/dist/helpers/index.js +17 -0
- package/dist/helpers/interval.js +24 -0
- package/dist/{types/helpers → helpers}/judging.d.ts +1 -1
- package/dist/helpers/judging.js +124 -0
- package/dist/helpers/number.js +2 -0
- package/dist/helpers/object.js +33 -0
- package/dist/{types/helpers → helpers}/responses.d.ts +2 -2
- package/dist/helpers/responses.js +95 -0
- package/dist/{types/helpers → helpers}/socket.d.ts +3 -3
- package/dist/helpers/socket.js +279 -0
- package/dist/{types/helpers → helpers}/time.d.ts +1 -1
- package/dist/helpers/time.js +69 -0
- package/dist/{types/helpers → helpers}/user.d.ts +1 -1
- package/dist/helpers/user.js +14 -0
- package/dist/{types/helpers → helpers}/worksheet.d.ts +1 -1
- package/dist/helpers/worksheet.js +107 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/types/account.js +10 -0
- package/dist/types/{types/class.d.ts → class.d.ts} +2 -2
- package/dist/types/class.js +7 -0
- package/dist/types/comments.js +1 -0
- package/dist/types/{types/commons.d.ts → commons.d.ts} +1 -1
- package/dist/types/commons.js +69 -0
- package/dist/types/{types/contest.d.ts → contest.d.ts} +4 -4
- package/dist/types/contest.js +27 -0
- package/dist/types/{types/course.d.ts → course.d.ts} +1 -1
- package/dist/types/course.js +1 -0
- package/dist/types/entity.js +50 -0
- package/dist/types/{types/excalidraw.d.ts → excalidraw.d.ts} +1 -1
- package/dist/types/excalidraw.js +1 -0
- package/dist/types/{types/file.d.ts → file.d.ts} +2 -2
- package/dist/types/file.js +19 -0
- package/dist/types/{types/group.d.ts → group.d.ts} +1 -1
- package/dist/types/group.js +5 -0
- package/dist/types/index.d.ts +27 -4
- package/dist/types/index.js +27 -0
- package/dist/types/{types/judge.d.ts → judge.d.ts} +2 -2
- package/dist/types/judge.js +49 -0
- package/dist/types/{types/markdown.d.ts → markdown.d.ts} +1 -1
- package/dist/types/markdown.js +1 -0
- package/dist/types/{types/mermaid.d.ts → mermaid.d.ts} +1 -1
- package/dist/types/mermaid.js +1 -0
- package/dist/types/notification.js +8 -0
- package/dist/types/organization.js +14 -0
- package/dist/types/{types/prisma.d.ts → prisma.d.ts} +1 -1
- package/dist/types/prisma.js +106 -0
- package/dist/types/{types/problems.d.ts → problems.d.ts} +3 -3
- package/dist/types/problems.js +28 -0
- package/dist/types/scoreboard.js +1 -0
- package/dist/types/{types/services.d.ts → services.d.ts} +1 -1
- package/dist/types/services.js +152 -0
- package/dist/types/{types/sheet.d.ts → sheet.d.ts} +2 -2
- package/dist/types/sheet.js +16 -0
- package/dist/types/{types/socket.d.ts → socket.d.ts} +3 -2
- package/dist/types/socket.js +76 -0
- package/dist/types/submission.js +1 -0
- package/dist/types/system.js +1 -0
- package/dist/types/{types/teams.d.ts → teams.d.ts} +2 -2
- package/dist/types/teams.js +1 -0
- package/dist/types/{types/users.d.ts → users.d.ts} +2 -2
- package/dist/types/users.js +23 -0
- package/dist/types/virtual-user.js +8 -0
- package/dist/types/{types/worksheet.d.ts → worksheet.d.ts} +3 -3
- package/dist/types/worksheet.js +11 -0
- package/package.json +8 -11
- package/dist/cjs/index.cjs +0 -3695
- package/dist/esm/index.js +0 -3415
- package/dist/types/constants/index.d.ts +0 -18
- package/dist/types/dto/index.d.ts +0 -25
- package/dist/types/helpers/index.d.ts +0 -17
- package/dist/types/types/index.d.ts +0 -27
- /package/dist/{types/constants → constants}/date.d.ts +0 -0
- /package/dist/{types/constants → constants}/email.d.ts +0 -0
- /package/dist/{types/constants → constants}/routing.d.ts +0 -0
- /package/dist/{types/constants → constants}/time.d.ts +0 -0
- /package/dist/{types/dto → dto}/image.d.ts +0 -0
- /package/dist/{types/dto → dto}/url.d.ts +0 -0
- /package/dist/{types/helpers → helpers}/comments.d.ts +0 -0
- /package/dist/{types/helpers → helpers}/date.d.ts +0 -0
- /package/dist/{types/helpers → helpers}/file.d.ts +0 -0
- /package/dist/{types/helpers → helpers}/interval.d.ts +0 -0
- /package/dist/{types/helpers → helpers}/number.d.ts +0 -0
- /package/dist/{types/helpers → helpers}/object.d.ts +0 -0
- /package/dist/types/{types/account.d.ts → account.d.ts} +0 -0
- /package/dist/types/{types/comments.d.ts → comments.d.ts} +0 -0
- /package/dist/types/{types/entity.d.ts → entity.d.ts} +0 -0
- /package/dist/types/{types/notification.d.ts → notification.d.ts} +0 -0
- /package/dist/types/{types/organization.d.ts → organization.d.ts} +0 -0
- /package/dist/types/{types/scoreboard.d.ts → scoreboard.d.ts} +0 -0
- /package/dist/types/{types/submission.d.ts → submission.d.ts} +0 -0
- /package/dist/types/{types/system.d.ts → system.d.ts} +0 -0
- /package/dist/types/{types/virtual-user.d.ts → virtual-user.d.ts} +0 -0
package/dist/cjs/index.cjs
DELETED
|
@@ -1,3695 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var uuid = require('uuid');
|
|
4
|
-
|
|
5
|
-
exports.ProfileSetting = void 0;
|
|
6
|
-
(function (ProfileSetting) {
|
|
7
|
-
ProfileSetting["NEWSLETTER_SUBSCRIPTION"] = "newsletterSubscription";
|
|
8
|
-
ProfileSetting["LANGUAGE"] = "preferredLanguage";
|
|
9
|
-
ProfileSetting["THEME"] = "preferredTheme";
|
|
10
|
-
ProfileSetting["DATA_VIEW_MODE"] = "preferredDataViewMode";
|
|
11
|
-
ProfileSetting["MENU_VIEW_MODE"] = "preferredMenuViewMode";
|
|
12
|
-
ProfileSetting["TIME_ZONE"] = "preferredTimeZone";
|
|
13
|
-
ProfileSetting["FONT_SIZE"] = "preferredFontSize";
|
|
14
|
-
})(exports.ProfileSetting || (exports.ProfileSetting = {}));
|
|
15
|
-
|
|
16
|
-
exports.AssignmentClass = void 0;
|
|
17
|
-
(function (AssignmentClass) {
|
|
18
|
-
AssignmentClass["NONE"] = "NONE";
|
|
19
|
-
AssignmentClass["COURSE"] = "COURSE";
|
|
20
|
-
AssignmentClass["WORKSHEET"] = "WORKSHEET";
|
|
21
|
-
AssignmentClass["CONTEST"] = "CONTEST";
|
|
22
|
-
})(exports.AssignmentClass || (exports.AssignmentClass = {}));
|
|
23
|
-
|
|
24
|
-
exports.CodeLanguage = void 0;
|
|
25
|
-
(function (CodeLanguage) {
|
|
26
|
-
CodeLanguage["C_11"] = "c11";
|
|
27
|
-
CodeLanguage["CPP_11"] = "cpp11";
|
|
28
|
-
CodeLanguage["CPP_20"] = "cpp20";
|
|
29
|
-
CodeLanguage["JAVA_21"] = "java21";
|
|
30
|
-
CodeLanguage["PYTHON_3"] = "python3";
|
|
31
|
-
CodeLanguage["PYTHON_PYPY_3"] = "pypy3";
|
|
32
|
-
CodeLanguage["JAVASCRIPT_NODE_JS_22"] = "nodejs22";
|
|
33
|
-
// DEPRECATED
|
|
34
|
-
CodeLanguage["PYTHON_2"] = "python2";
|
|
35
|
-
CodeLanguage["PYTHON_PYPY_2"] = "pypy2";
|
|
36
|
-
CodeLanguage["ICPC_C"] = "ICPC_C";
|
|
37
|
-
CodeLanguage["C"] = "C";
|
|
38
|
-
CodeLanguage["CPP"] = "CPP";
|
|
39
|
-
CodeLanguage["ICPC_CPP"] = "ICPC_CPP";
|
|
40
|
-
CodeLanguage["CPP11"] = "CPP11";
|
|
41
|
-
CodeLanguage["CPP14"] = "CPP14";
|
|
42
|
-
CodeLanguage["CPP17"] = "CPP17";
|
|
43
|
-
CodeLanguage["JAVA"] = "JAVA";
|
|
44
|
-
CodeLanguage["ICPC_PYTHON"] = "ICPC_PYTHON";
|
|
45
|
-
CodeLanguage["PYTHON"] = "PYTHON";
|
|
46
|
-
CodeLanguage["PYTHON2"] = "PYTHON2";
|
|
47
|
-
CodeLanguage["PYTHON3"] = "PYTHON3";
|
|
48
|
-
CodeLanguage["JAVASCRIPT"] = "JAVASCRIPT";
|
|
49
|
-
CodeLanguage["TYPESCRIPT"] = "TYPESCRIPT";
|
|
50
|
-
CodeLanguage["JSX"] = "JSX";
|
|
51
|
-
CodeLanguage["TSX"] = "TSX";
|
|
52
|
-
CodeLanguage["MDX"] = "MDX";
|
|
53
|
-
CodeLanguage["PSEUDOCODE_PSEINT"] = "PSEUDOCODE_PSEINT";
|
|
54
|
-
CodeLanguage["LATEX"] = "LATEX";
|
|
55
|
-
CodeLanguage["JSON"] = "JSON";
|
|
56
|
-
CodeLanguage["HTML"] = "HTML";
|
|
57
|
-
CodeLanguage["TEXT"] = "TEXT";
|
|
58
|
-
CodeLanguage["DIFF"] = "DIFF";
|
|
59
|
-
CodeLanguage["MARKDOWN"] = "MARKDOWN";
|
|
60
|
-
CodeLanguage["ARDUINO"] = "ARDUINO";
|
|
61
|
-
CodeLanguage["DOT"] = "DOT";
|
|
62
|
-
CodeLanguage["MERMAID"] = "MERMAID";
|
|
63
|
-
CodeLanguage["BASH"] = "BASH";
|
|
64
|
-
})(exports.CodeLanguage || (exports.CodeLanguage = {}));
|
|
65
|
-
exports.ScopeData = void 0;
|
|
66
|
-
(function (ScopeData) {
|
|
67
|
-
ScopeData["USER"] = "USER";
|
|
68
|
-
ScopeData["PROBLEM"] = "PROBLEM";
|
|
69
|
-
ScopeData["CONTEST"] = "CONTEST";
|
|
70
|
-
ScopeData["ATTEMPT"] = "ATTEMPT";
|
|
71
|
-
})(exports.ScopeData || (exports.ScopeData = {}));
|
|
72
|
-
exports.Status = void 0;
|
|
73
|
-
(function (Status) {
|
|
74
|
-
Status["SUCCESS"] = "SUCCESS";
|
|
75
|
-
Status["ERROR"] = "ERROR";
|
|
76
|
-
Status["LOADING"] = "LOADING";
|
|
77
|
-
Status["NONE"] = "NONE";
|
|
78
|
-
})(exports.Status || (exports.Status = {}));
|
|
79
|
-
exports.EntityStatus = void 0;
|
|
80
|
-
(function (EntityStatus) {
|
|
81
|
-
EntityStatus["PUBLIC"] = "PUBLIC";
|
|
82
|
-
EntityStatus["RESERVED"] = "RESERVED";
|
|
83
|
-
EntityStatus["PRIVATE"] = "PRIVATE";
|
|
84
|
-
EntityStatus["ARCHIVED"] = "ARCHIVED";
|
|
85
|
-
})(exports.EntityStatus || (exports.EntityStatus = {}));
|
|
86
|
-
exports.EntityAccess = void 0;
|
|
87
|
-
(function (EntityAccess) {
|
|
88
|
-
EntityAccess["PRIVATE"] = "PRIVATE";
|
|
89
|
-
EntityAccess["RESTRICTED"] = "RESTRICTED";
|
|
90
|
-
EntityAccess["PUBLIC"] = "PUBLIC";
|
|
91
|
-
EntityAccess["EXPOSED"] = "EXPOSED";
|
|
92
|
-
})(exports.EntityAccess || (exports.EntityAccess = {}));
|
|
93
|
-
|
|
94
|
-
exports.OrganizationPlan = void 0;
|
|
95
|
-
(function (OrganizationPlan) {
|
|
96
|
-
OrganizationPlan["FREE"] = "FREE";
|
|
97
|
-
OrganizationPlan["STANDARD"] = "STANDARD";
|
|
98
|
-
OrganizationPlan["PREMIUM"] = "PREMIUM";
|
|
99
|
-
OrganizationPlan["CUSTOM"] = "CUSTOM";
|
|
100
|
-
})(exports.OrganizationPlan || (exports.OrganizationPlan = {}));
|
|
101
|
-
exports.OrganizationLogoType = void 0;
|
|
102
|
-
(function (OrganizationLogoType) {
|
|
103
|
-
OrganizationLogoType["HORIZONTAL_WHITE"] = "horizontal-white";
|
|
104
|
-
OrganizationLogoType["HORIZONTAL_COLOR"] = "horizontal-color";
|
|
105
|
-
OrganizationLogoType["VERTICAL_WHITE"] = "vertical-white";
|
|
106
|
-
OrganizationLogoType["VERTICAL_COLOR"] = "vertical-color";
|
|
107
|
-
})(exports.OrganizationLogoType || (exports.OrganizationLogoType = {}));
|
|
108
|
-
|
|
109
|
-
exports.ContestStatus = void 0;
|
|
110
|
-
(function (ContestStatus) {
|
|
111
|
-
ContestStatus["PUBLIC"] = "PUBLIC";
|
|
112
|
-
ContestStatus["RESERVED"] = "RESERVED";
|
|
113
|
-
ContestStatus["ARCHIVED"] = "ARCHIVED";
|
|
114
|
-
})(exports.ContestStatus || (exports.ContestStatus = {}));
|
|
115
|
-
exports.ContestTimeStatus = void 0;
|
|
116
|
-
(function (ContestTimeStatus) {
|
|
117
|
-
ContestTimeStatus["UPCOMING"] = "upcoming";
|
|
118
|
-
ContestTimeStatus["LIVE"] = "live";
|
|
119
|
-
ContestTimeStatus["PAST"] = "past";
|
|
120
|
-
})(exports.ContestTimeStatus || (exports.ContestTimeStatus = {}));
|
|
121
|
-
exports.ContestProblemPrerequisiteType = void 0;
|
|
122
|
-
(function (ContestProblemPrerequisiteType) {
|
|
123
|
-
ContestProblemPrerequisiteType["INDIVIDUALLY"] = "INDIVIDUALLY";
|
|
124
|
-
ContestProblemPrerequisiteType["CONTEST"] = "CONTEST";
|
|
125
|
-
})(exports.ContestProblemPrerequisiteType || (exports.ContestProblemPrerequisiteType = {}));
|
|
126
|
-
exports.ContestEventAction = void 0;
|
|
127
|
-
(function (ContestEventAction) {
|
|
128
|
-
ContestEventAction["DATA_UPDATE"] = "DATA_UPDATE";
|
|
129
|
-
ContestEventAction["SCOREBOARD_RECALCULATE"] = "SCOREBOARD_RECALCULATE";
|
|
130
|
-
ContestEventAction["SCOREBOARD_UNLOCK"] = "SCOREBOARD_UNLOCK";
|
|
131
|
-
ContestEventAction["SCOREBOARD_LOCK"] = "SCOREBOARD_LOCK";
|
|
132
|
-
ContestEventAction["ENABLE_UPSOLVING"] = "ENABLE_UPSOLVING";
|
|
133
|
-
ContestEventAction["DISABLE_UPSOLVING"] = "DISABLE_UPSOLVING";
|
|
134
|
-
ContestEventAction["PARTICIPANT_JOIN"] = "PARTICIPANT_JOIN";
|
|
135
|
-
})(exports.ContestEventAction || (exports.ContestEventAction = {}));
|
|
136
|
-
|
|
137
|
-
exports.EntityMembersRank = void 0;
|
|
138
|
-
(function (EntityMembersRank) {
|
|
139
|
-
EntityMembersRank["NONE"] = "NONE";
|
|
140
|
-
EntityMembersRank["CLOSE"] = "CLOSE";
|
|
141
|
-
EntityMembersRank["OPEN"] = "OPEN";
|
|
142
|
-
})(exports.EntityMembersRank || (exports.EntityMembersRank = {}));
|
|
143
|
-
exports.EntityState = void 0;
|
|
144
|
-
(function (EntityState) {
|
|
145
|
-
EntityState["RELEASED"] = "RELEASED";
|
|
146
|
-
EntityState["ARCHIVED"] = "ARCHIVED";
|
|
147
|
-
})(exports.EntityState || (exports.EntityState = {}));
|
|
148
|
-
exports.EntityCollection = void 0;
|
|
149
|
-
(function (EntityCollection) {
|
|
150
|
-
EntityCollection["ORGANIZATION"] = "ORGANIZATION";
|
|
151
|
-
EntityCollection["PROBLEM"] = "PROBLEM";
|
|
152
|
-
EntityCollection["CONTEST"] = "CONTEST";
|
|
153
|
-
EntityCollection["JUDGE"] = "JUDGE";
|
|
154
|
-
EntityCollection["USER"] = "USER";
|
|
155
|
-
EntityCollection["SUBMISSION"] = "SUBMISSION";
|
|
156
|
-
})(exports.EntityCollection || (exports.EntityCollection = {}));
|
|
157
|
-
exports.CollectionKey = void 0;
|
|
158
|
-
(function (CollectionKey) {
|
|
159
|
-
CollectionKey["ORGANIZATION"] = "C";
|
|
160
|
-
CollectionKey["USER"] = "U";
|
|
161
|
-
CollectionKey["PROBLEM"] = "P";
|
|
162
|
-
CollectionKey["CLASS"] = "K";
|
|
163
|
-
CollectionKey["CLASS_ASSIGNMENT"] = "KA";
|
|
164
|
-
CollectionKey["CONTEST"] = "T";
|
|
165
|
-
CollectionKey["SCOREBOARD"] = "B";
|
|
166
|
-
CollectionKey["SCOREBOARD_EVENTS"] = "BE";
|
|
167
|
-
CollectionKey["COURSE"] = "R";
|
|
168
|
-
CollectionKey["FILE"] = "F";
|
|
169
|
-
CollectionKey["GROUP"] = "G";
|
|
170
|
-
CollectionKey["JUDGE"] = "J";
|
|
171
|
-
CollectionKey["WORKSHEET"] = "W";
|
|
172
|
-
CollectionKey["WORKSHEET_SUBMISSIONS"] = "WS";
|
|
173
|
-
CollectionKey["SUBMIT"] = "S";
|
|
174
|
-
CollectionKey["LOCALE"] = "L";
|
|
175
|
-
CollectionKey["COMMENT"] = "M";
|
|
176
|
-
CollectionKey["EXCALIDRAW"] = "E";
|
|
177
|
-
CollectionKey["MARKDOWN"] = "MD";
|
|
178
|
-
CollectionKey["DOCUMENT_TEMPLATE"] = "DT";
|
|
179
|
-
CollectionKey["MERMAID"] = "MM";
|
|
180
|
-
})(exports.CollectionKey || (exports.CollectionKey = {}));
|
|
181
|
-
exports.LogOperation = void 0;
|
|
182
|
-
(function (LogOperation) {
|
|
183
|
-
LogOperation["REMOVE"] = "REMOVE";
|
|
184
|
-
LogOperation["ADD"] = "ADD";
|
|
185
|
-
LogOperation["UPDATE"] = "UPDATE";
|
|
186
|
-
})(exports.LogOperation || (exports.LogOperation = {}));
|
|
187
|
-
|
|
188
|
-
exports.FileMemberRole = void 0;
|
|
189
|
-
(function (FileMemberRole) {
|
|
190
|
-
FileMemberRole["VIEWER"] = "VIEWER";
|
|
191
|
-
FileMemberRole["EDITOR"] = "EDITOR";
|
|
192
|
-
})(exports.FileMemberRole || (exports.FileMemberRole = {}));
|
|
193
|
-
exports.FileType = void 0;
|
|
194
|
-
(function (FileType) {
|
|
195
|
-
FileType["FOLDER"] = "FOLDER";
|
|
196
|
-
FileType["FILE"] = "FILE";
|
|
197
|
-
})(exports.FileType || (exports.FileType = {}));
|
|
198
|
-
exports.FilesJukiPub = void 0;
|
|
199
|
-
(function (FilesJukiPub) {
|
|
200
|
-
FilesJukiPub["SHARED"] = "shared";
|
|
201
|
-
FilesJukiPub["SHARED_EXCALIDRAW"] = "shared/E";
|
|
202
|
-
FilesJukiPub["TEMP"] = "temp";
|
|
203
|
-
FilesJukiPub["PROBLEMS"] = "problems";
|
|
204
|
-
FilesJukiPub["CONTESTS"] = "contests";
|
|
205
|
-
})(exports.FilesJukiPub || (exports.FilesJukiPub = {}));
|
|
206
|
-
|
|
207
|
-
exports.GroupType = void 0;
|
|
208
|
-
(function (GroupType) {
|
|
209
|
-
GroupType["CLASS"] = "CLASS";
|
|
210
|
-
GroupType["TEAM"] = "TEAM";
|
|
211
|
-
})(exports.GroupType || (exports.GroupType = {}));
|
|
212
|
-
|
|
213
|
-
exports.Judge = void 0;
|
|
214
|
-
(function (Judge) {
|
|
215
|
-
Judge["JUKI_JUDGE"] = "JUKI_JUDGE";
|
|
216
|
-
Judge["CODEFORCES"] = "CODEFORCES";
|
|
217
|
-
Judge["CODEFORCES_GYM"] = "CODEFORCES_GYM";
|
|
218
|
-
Judge["JV_UMSA"] = "JV_UMSA";
|
|
219
|
-
Judge["UVA_ONLINE_JUDGE"] = "UVA_ONLINE_JUDGE";
|
|
220
|
-
Judge["AT_CODER"] = "AT_CODER";
|
|
221
|
-
Judge["CODECHEF"] = "CODECHEF";
|
|
222
|
-
Judge["TOPCODER"] = "TOPCODER";
|
|
223
|
-
Judge["LEETCODE"] = "LEETCODE";
|
|
224
|
-
})(exports.Judge || (exports.Judge = {}));
|
|
225
|
-
exports.ProblemVerdict = void 0;
|
|
226
|
-
(function (ProblemVerdict) {
|
|
227
|
-
ProblemVerdict["NONE"] = "NONE";
|
|
228
|
-
ProblemVerdict["PENDING"] = "PENDING";
|
|
229
|
-
ProblemVerdict["HIDDEN"] = "HIDDEN";
|
|
230
|
-
ProblemVerdict["CE"] = "CE";
|
|
231
|
-
ProblemVerdict["RE"] = "RE";
|
|
232
|
-
ProblemVerdict["TLE"] = "TLE";
|
|
233
|
-
ProblemVerdict["MLE"] = "MLE";
|
|
234
|
-
ProblemVerdict["WA"] = "WA";
|
|
235
|
-
ProblemVerdict["PE"] = "PE";
|
|
236
|
-
ProblemVerdict["PA"] = "PA";
|
|
237
|
-
ProblemVerdict["AC"] = "AC";
|
|
238
|
-
})(exports.ProblemVerdict || (exports.ProblemVerdict = {}));
|
|
239
|
-
exports.SubmissionRunStatus = void 0;
|
|
240
|
-
(function (SubmissionRunStatus) {
|
|
241
|
-
SubmissionRunStatus["NONE"] = "NONE";
|
|
242
|
-
SubmissionRunStatus["RECEIVED"] = "RECEIVED";
|
|
243
|
-
SubmissionRunStatus["COMPILING"] = "COMPILING";
|
|
244
|
-
SubmissionRunStatus["COMPILED"] = "COMPILED";
|
|
245
|
-
SubmissionRunStatus["COMPILATION_ERROR"] = "COMPILATION_ERROR";
|
|
246
|
-
SubmissionRunStatus["FETCHING_TEST_CASES"] = "FETCHING_TEST_CASES";
|
|
247
|
-
SubmissionRunStatus["RUNNING_TEST_CASE"] = "RUNNING_TEST_CASE";
|
|
248
|
-
SubmissionRunStatus["RUNNING_TEST_CASES"] = "RUNNING_TEST_CASES";
|
|
249
|
-
SubmissionRunStatus["RUNNING_SAMPLE_TEST_CASES"] = "RUNNING_SAMPLE_TEST_CASES";
|
|
250
|
-
SubmissionRunStatus["EXECUTED_TEST_CASE"] = "EXECUTED_TEST_CASE";
|
|
251
|
-
SubmissionRunStatus["FAILED_TEST_CASE"] = "FAILED_TEST_CASE";
|
|
252
|
-
SubmissionRunStatus["JUDGING_TEST_CASE"] = "JUDGING_TEST_CASE";
|
|
253
|
-
SubmissionRunStatus["GRADING"] = "GRADING";
|
|
254
|
-
SubmissionRunStatus["FAILED"] = "FAILED";
|
|
255
|
-
SubmissionRunStatus["COMPLETED"] = "COMPLETED";
|
|
256
|
-
})(exports.SubmissionRunStatus || (exports.SubmissionRunStatus = {}));
|
|
257
|
-
exports.RunnerType = void 0;
|
|
258
|
-
(function (RunnerType) {
|
|
259
|
-
RunnerType["HIGH_PERFORMANCE"] = "HIGH_PERFORMANCE";
|
|
260
|
-
RunnerType["LOW_PERFORMANCE"] = "LOW_PERFORMANCE";
|
|
261
|
-
})(exports.RunnerType || (exports.RunnerType = {}));
|
|
262
|
-
|
|
263
|
-
exports.NotificationType = void 0;
|
|
264
|
-
(function (NotificationType) {
|
|
265
|
-
NotificationType["SUCCESS"] = "success";
|
|
266
|
-
NotificationType["INFO"] = "info";
|
|
267
|
-
NotificationType["WARNING"] = "warning";
|
|
268
|
-
NotificationType["ERROR"] = "error";
|
|
269
|
-
NotificationType["QUIET"] = "quiet";
|
|
270
|
-
})(exports.NotificationType || (exports.NotificationType = {}));
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Enums
|
|
274
|
-
*/
|
|
275
|
-
// Based on
|
|
276
|
-
// https://github.com/microsoft/TypeScript/issues/3192#issuecomment-261720275
|
|
277
|
-
const CourseStatus = {
|
|
278
|
-
RELEASED: 'RELEASED',
|
|
279
|
-
IN_DRAFT: 'IN_DRAFT',
|
|
280
|
-
IN_REVIEW: 'IN_REVIEW',
|
|
281
|
-
ARCHIVED: 'ARCHIVED',
|
|
282
|
-
};
|
|
283
|
-
const CourseType = {
|
|
284
|
-
PUBLIC: 'PUBLIC',
|
|
285
|
-
PRIVATE: 'PRIVATE',
|
|
286
|
-
CLOSED: 'CLOSED',
|
|
287
|
-
};
|
|
288
|
-
const AssignmentType = {
|
|
289
|
-
READING_PDF: 'READING_PDF',
|
|
290
|
-
READING_WEB: 'READING_WEB',
|
|
291
|
-
SOLVE_JUKI_JUDGE_PROBLEM: 'SOLVE_JUKI_JUDGE_PROBLEM',
|
|
292
|
-
SOLVE_CODEFORCES_JUDGE_PROBLEM: 'SOLVE_CODEFORCES_JUDGE_PROBLEM',
|
|
293
|
-
};
|
|
294
|
-
const AssignmentState = {
|
|
295
|
-
ASSIGNED: 'ASSIGNED',
|
|
296
|
-
IN_PROGRESS: 'IN_PROGRESS',
|
|
297
|
-
TO_REVIEW: 'TO_REVIEW',
|
|
298
|
-
RESOLVED: 'RESOLVED',
|
|
299
|
-
};
|
|
300
|
-
const TeamStatus = {
|
|
301
|
-
ACTIVE: 'ACTIVE',
|
|
302
|
-
REPORTED: 'REPORTED',
|
|
303
|
-
ARCHIVED: 'ARCHIVED',
|
|
304
|
-
};
|
|
305
|
-
const MemberRole = {
|
|
306
|
-
COACH: 'COACH',
|
|
307
|
-
CO_COACH: 'CO_COACH',
|
|
308
|
-
CONTESTANT: 'CONTESTANT',
|
|
309
|
-
ATTENDEE: 'ATTENDEE',
|
|
310
|
-
RESERVE: 'RESERVE',
|
|
311
|
-
STAFF: 'STAFF',
|
|
312
|
-
};
|
|
313
|
-
const UserTeamStatus = {
|
|
314
|
-
PENDING: 'PENDING',
|
|
315
|
-
ACCEPTED: 'ACCEPTED',
|
|
316
|
-
REJECTED: 'REJECTED',
|
|
317
|
-
};
|
|
318
|
-
const Language = {
|
|
319
|
-
ES: 'ES',
|
|
320
|
-
EN: 'EN',
|
|
321
|
-
};
|
|
322
|
-
const Theme = {
|
|
323
|
-
LIGHT: 'LIGHT',
|
|
324
|
-
DARK: 'DARK',
|
|
325
|
-
};
|
|
326
|
-
const EmailSubscription = {
|
|
327
|
-
NONE: 'NONE',
|
|
328
|
-
RANKED_CONTESTS: 'RANKED_CONTESTS',
|
|
329
|
-
WEEKLY_NEWS_SUBSCRIPTION: 'WEEKLY_NEWS_SUBSCRIPTION',
|
|
330
|
-
MONTHLY_NEWS_SUBSCRIPTION: 'MONTHLY_NEWS_SUBSCRIPTION',
|
|
331
|
-
};
|
|
332
|
-
const EmailValidationState = {
|
|
333
|
-
PENDING: 'PENDING',
|
|
334
|
-
VALIDATED: 'VALIDATED',
|
|
335
|
-
};
|
|
336
|
-
const UserStatus = {
|
|
337
|
-
ACTIVE: 'ACTIVE',
|
|
338
|
-
REPORTED: 'REPORTED',
|
|
339
|
-
ARCHIVED: 'ARCHIVED',
|
|
340
|
-
};
|
|
341
|
-
const UserRole = {
|
|
342
|
-
RESTRICTED: 'RESTRICTED',
|
|
343
|
-
GUEST: 'GUEST',
|
|
344
|
-
LIMITED: 'LIMITED',
|
|
345
|
-
REGULAR: 'REGULAR',
|
|
346
|
-
MANAGER: 'MANAGER',
|
|
347
|
-
ADMIN: 'ADMIN',
|
|
348
|
-
SUPER_ADMIN: 'SUPER_ADMIN',
|
|
349
|
-
};
|
|
350
|
-
const SystemRole = {
|
|
351
|
-
GUEST: 'GUEST',
|
|
352
|
-
REGULAR: 'REGULAR',
|
|
353
|
-
MANAGER: 'MANAGER',
|
|
354
|
-
MASTER: 'MASTER',
|
|
355
|
-
ADMIN: 'ADMIN',
|
|
356
|
-
SUPER_ADMIN: 'SUPER_ADMIN',
|
|
357
|
-
};
|
|
358
|
-
const TeamRole = {
|
|
359
|
-
RESTRICTED: 'RESTRICTED',
|
|
360
|
-
GUEST: 'GUEST',
|
|
361
|
-
REGULAR: 'REGULAR',
|
|
362
|
-
MANAGER: 'MANAGER',
|
|
363
|
-
ADMIN: 'ADMIN',
|
|
364
|
-
SUPER_ADMIN: 'SUPER_ADMIN',
|
|
365
|
-
};
|
|
366
|
-
const CourseRole = {
|
|
367
|
-
RESTRICTED: 'RESTRICTED',
|
|
368
|
-
GUEST: 'GUEST',
|
|
369
|
-
REGULAR: 'REGULAR',
|
|
370
|
-
CREATOR: 'CREATOR',
|
|
371
|
-
SUPER_CREATOR: 'SUPER_CREATOR',
|
|
372
|
-
MANAGER: 'MANAGER',
|
|
373
|
-
MASTER: 'MASTER',
|
|
374
|
-
ADMIN: 'ADMIN',
|
|
375
|
-
SUPER_ADMIN: 'SUPER_ADMIN',
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
exports.TypeTestCase = void 0;
|
|
379
|
-
(function (TypeTestCase) {
|
|
380
|
-
TypeTestCase["INPUT"] = "INPUT";
|
|
381
|
-
TypeTestCase["OUTPUT"] = "OUTPUT";
|
|
382
|
-
})(exports.TypeTestCase || (exports.TypeTestCase = {}));
|
|
383
|
-
exports.ProblemInput = void 0;
|
|
384
|
-
(function (ProblemInput) {
|
|
385
|
-
ProblemInput["STANDARD"] = "STANDARD";
|
|
386
|
-
ProblemInput["INTERACTIVE"] = "INTERACTIVE";
|
|
387
|
-
})(exports.ProblemInput || (exports.ProblemInput = {}));
|
|
388
|
-
exports.ProblemOutput = void 0;
|
|
389
|
-
(function (ProblemOutput) {
|
|
390
|
-
ProblemOutput["STANDARD"] = "STANDARD";
|
|
391
|
-
ProblemOutput["DYNAMIC"] = "DYNAMIC";
|
|
392
|
-
ProblemOutput["INTERACTIVE"] = "INTERACTIVE";
|
|
393
|
-
})(exports.ProblemOutput || (exports.ProblemOutput = {}));
|
|
394
|
-
exports.ProblemType = void 0;
|
|
395
|
-
(function (ProblemType) {
|
|
396
|
-
ProblemType["STANDARD"] = "STANDARD";
|
|
397
|
-
ProblemType["DYNAMIC"] = "DYNAMIC";
|
|
398
|
-
ProblemType["INTERACTIVE"] = "INTERACTIVE";
|
|
399
|
-
})(exports.ProblemType || (exports.ProblemType = {}));
|
|
400
|
-
exports.ProblemScoringMode = void 0;
|
|
401
|
-
(function (ProblemScoringMode) {
|
|
402
|
-
ProblemScoringMode["SUBTASK"] = "SUBTASK";
|
|
403
|
-
ProblemScoringMode["TOTAL"] = "TOTAL";
|
|
404
|
-
ProblemScoringMode["PARTIAL"] = "PARTIAL";
|
|
405
|
-
})(exports.ProblemScoringMode || (exports.ProblemScoringMode = {}));
|
|
406
|
-
|
|
407
|
-
exports.ErrorCode = void 0;
|
|
408
|
-
(function (ErrorCode) {
|
|
409
|
-
// General errors
|
|
410
|
-
ErrorCode["ERR400"] = "ERR400";
|
|
411
|
-
ErrorCode["ERR401"] = "ERR401";
|
|
412
|
-
ErrorCode["ERR403"] = "ERR403";
|
|
413
|
-
ErrorCode["ERR404"] = "ERR404";
|
|
414
|
-
ErrorCode["ERR405"] = "ERR405";
|
|
415
|
-
ErrorCode["ERR500"] = "ERR500";
|
|
416
|
-
// UI general errors
|
|
417
|
-
ErrorCode["ERR9997"] = "ERR9997";
|
|
418
|
-
ErrorCode["ERR9998"] = "ERR9998";
|
|
419
|
-
ErrorCode["ERR9999"] = "ERR9999";
|
|
420
|
-
// User errors // 'unable update nickname yet', 'User not active'
|
|
421
|
-
ErrorCode["ERR0000"] = "ERR0000";
|
|
422
|
-
ErrorCode["ERR0010"] = "ERR0010";
|
|
423
|
-
ErrorCode["ERR0011"] = "ERR0011";
|
|
424
|
-
ErrorCode["ERR0012"] = "ERR0012";
|
|
425
|
-
ErrorCode["ERR0013"] = "ERR0013";
|
|
426
|
-
ErrorCode["ERR0014"] = "ERR0014";
|
|
427
|
-
ErrorCode["ERR0015"] = "ERR0015";
|
|
428
|
-
ErrorCode["ERR0016"] = "ERR0016";
|
|
429
|
-
ErrorCode["ERR0017"] = "ERR0017";
|
|
430
|
-
ErrorCode["ERR0018"] = "ERR0018";
|
|
431
|
-
ErrorCode["ERR0019"] = "ERR0019";
|
|
432
|
-
ErrorCode["ERR0020"] = "ERR0020";
|
|
433
|
-
ErrorCode["ERR0021"] = "ERR0021";
|
|
434
|
-
ErrorCode["ERR0022"] = "ERR0022";
|
|
435
|
-
ErrorCode["ERR0023"] = "ERR0023";
|
|
436
|
-
ErrorCode["ERR0024"] = "ERR0024";
|
|
437
|
-
ErrorCode["ERR0050"] = "ERR0050";
|
|
438
|
-
ErrorCode["ERR0051"] = "ERR0051";
|
|
439
|
-
ErrorCode["ERR0052"] = "ERR0052";
|
|
440
|
-
ErrorCode["ERR0053"] = "ERR0053";
|
|
441
|
-
// Problem Errors ERR01XX',
|
|
442
|
-
ErrorCode["ERR0100"] = "ERR0100";
|
|
443
|
-
ErrorCode["ERR0110"] = "ERR0110";
|
|
444
|
-
ErrorCode["ERR0111"] = "ERR0111";
|
|
445
|
-
ErrorCode["ERR0112"] = " ERR0112";
|
|
446
|
-
ErrorCode["ERR0113"] = "ERR0113";
|
|
447
|
-
ErrorCode["ERR0114"] = "ERR0114";
|
|
448
|
-
ErrorCode["ERR0115"] = "ERR0115";
|
|
449
|
-
ErrorCode["ERR0116"] = "ERR0116";
|
|
450
|
-
ErrorCode["ERR0117"] = "ERR0117";
|
|
451
|
-
ErrorCode["ERR0118"] = "ERR0118";
|
|
452
|
-
ErrorCode["ERR0119"] = "ERR0119";
|
|
453
|
-
ErrorCode["ERR0120"] = "ERR0120";
|
|
454
|
-
ErrorCode["ERR0121"] = "ERR0121";
|
|
455
|
-
ErrorCode["ERR0122"] = "ERR0122";
|
|
456
|
-
// Contest Errors ERR02XX',
|
|
457
|
-
ErrorCode["ERR0200"] = "ERR0200";
|
|
458
|
-
// CRUD contest
|
|
459
|
-
ErrorCode["ERR0210"] = "ERR0210";
|
|
460
|
-
ErrorCode["ERR0211"] = "ERR0211";
|
|
461
|
-
ErrorCode["ERR0212"] = "ERR0212";
|
|
462
|
-
ErrorCode["ERR0213"] = "ERR0213";
|
|
463
|
-
// permissions contest
|
|
464
|
-
ErrorCode["ERR0214"] = "ERR0214";
|
|
465
|
-
ErrorCode["ERR0215"] = "ERR0215";
|
|
466
|
-
ErrorCode["ERR0216"] = "ERR0216";
|
|
467
|
-
ErrorCode["ERR0217"] = "ERR0217";
|
|
468
|
-
ErrorCode["ERR0218"] = "ERR0218";
|
|
469
|
-
ErrorCode["ERR0219"] = "ERR0219";
|
|
470
|
-
ErrorCode["ERR0220"] = "ERR0220";
|
|
471
|
-
// CRUD scoreboard
|
|
472
|
-
ErrorCode["ERR0230"] = "ERR0230";
|
|
473
|
-
ErrorCode["ERR0231"] = "ERR0231";
|
|
474
|
-
ErrorCode["ERR0232"] = "ERR0232";
|
|
475
|
-
ErrorCode["ERR0233"] = "ERR0233";
|
|
476
|
-
// permissions scoreboard
|
|
477
|
-
ErrorCode["ERR0234"] = "ERR0234";
|
|
478
|
-
ErrorCode["ERR0235"] = "ERR0235";
|
|
479
|
-
ErrorCode["ERR0236"] = "ERR0236";
|
|
480
|
-
ErrorCode["ERR0237"] = "ERR0237";
|
|
481
|
-
ErrorCode["ERR0240"] = "ERR0240";
|
|
482
|
-
ErrorCode["ERR0241"] = "ERR0241";
|
|
483
|
-
ErrorCode["ERR0242"] = "ERR0242";
|
|
484
|
-
ErrorCode["ERR0243"] = "ERR0243";
|
|
485
|
-
ErrorCode["ERR0244"] = "ERR0244";
|
|
486
|
-
ErrorCode["ERR0245"] = "ERR0245";
|
|
487
|
-
ErrorCode["ERR0246"] = "ERR0246";
|
|
488
|
-
ErrorCode["ERR0247"] = "ERR0247";
|
|
489
|
-
// Submission Errors ERR03XXX',
|
|
490
|
-
ErrorCode["ERR0300"] = "ERR0300";
|
|
491
|
-
ErrorCode["ERR0301"] = "ERR0301";
|
|
492
|
-
ErrorCode["ERR0302"] = "ERR0302";
|
|
493
|
-
ErrorCode["ERR0303"] = "ERR0303";
|
|
494
|
-
ErrorCode["ERR0310"] = "ERR0310";
|
|
495
|
-
ErrorCode["ERR0311"] = "ERR0311";
|
|
496
|
-
ErrorCode["ERR0321"] = "ERR0321";
|
|
497
|
-
ErrorCode["ERR0331"] = "ERR0331";
|
|
498
|
-
// Utils Errors ERR04XX
|
|
499
|
-
ErrorCode["ERR0400"] = "ERR0400";
|
|
500
|
-
ErrorCode["ERR0410"] = "ERR0410";
|
|
501
|
-
ErrorCode["ERR0420"] = "ERR0420";
|
|
502
|
-
ErrorCode["ERR0421"] = "ERR0421";
|
|
503
|
-
ErrorCode["ERR0430"] = "ERR0430";
|
|
504
|
-
ErrorCode["ERR0440"] = "ERR0440";
|
|
505
|
-
// Team Errors ERR06XX
|
|
506
|
-
ErrorCode["ERR0600"] = "ERR0600";
|
|
507
|
-
ErrorCode["ERR0610"] = "ERR0610";
|
|
508
|
-
ErrorCode["ERR0611"] = "ERR0611";
|
|
509
|
-
ErrorCode["ERR0612"] = "ERR0612";
|
|
510
|
-
ErrorCode["ERR0613"] = "ERR0613";
|
|
511
|
-
ErrorCode["ERR0614"] = "ERR0614";
|
|
512
|
-
ErrorCode["ERR0615"] = "ERR0615";
|
|
513
|
-
ErrorCode["ERR0616"] = "ERR0665";
|
|
514
|
-
ErrorCode["ERR0617"] = "ERR0617";
|
|
515
|
-
ErrorCode["ERR0618"] = "ERR0618";
|
|
516
|
-
ErrorCode["ERR0619"] = "ERR0619";
|
|
517
|
-
// Course Errors ERR07XXX',
|
|
518
|
-
// Sheets Errors ERR08XXX',
|
|
519
|
-
ErrorCode["ERR0800"] = "ERR0800";
|
|
520
|
-
ErrorCode["ERR0810"] = "ERR0810";
|
|
521
|
-
ErrorCode["ERR0811"] = "ERR0811";
|
|
522
|
-
ErrorCode["ERR0812"] = "ERR0812";
|
|
523
|
-
ErrorCode["ERR0813"] = "ERR0813";
|
|
524
|
-
ErrorCode["ERR0814"] = "ERR0814";
|
|
525
|
-
ErrorCode["ERR0815"] = "ERR0815";
|
|
526
|
-
ErrorCode["ERR0816"] = "ERR0865";
|
|
527
|
-
ErrorCode["ERR0817"] = "ERR0817";
|
|
528
|
-
ErrorCode["ERR0818"] = "ERR0818";
|
|
529
|
-
ErrorCode["ERR0819"] = "ERR0819";
|
|
530
|
-
ErrorCode["ERR0820"] = "ERR0820";
|
|
531
|
-
// Organization Errors ERR99XXX',
|
|
532
|
-
ErrorCode["ERR9900"] = "ERR9900";
|
|
533
|
-
ErrorCode["ERR9910"] = "ERR9910";
|
|
534
|
-
ErrorCode["ERR9911"] = "ERR9911";
|
|
535
|
-
ErrorCode["ERR9912"] = "ERR9912";
|
|
536
|
-
ErrorCode["ERR9913"] = "ERR9913";
|
|
537
|
-
ErrorCode["ERR9914"] = "ERR9914";
|
|
538
|
-
ErrorCode["ERR9915"] = "ERR9915";
|
|
539
|
-
ErrorCode["ERR9916"] = "ERR9916";
|
|
540
|
-
ErrorCode["ERR9917"] = "ERR9917";
|
|
541
|
-
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
542
|
-
exports.LogLevel = void 0;
|
|
543
|
-
(function (LogLevel) {
|
|
544
|
-
LogLevel["FATAL"] = "FATAL";
|
|
545
|
-
LogLevel["ERROR"] = "ERROR";
|
|
546
|
-
LogLevel["WARN"] = "WARN";
|
|
547
|
-
LogLevel["INFO"] = "INFO";
|
|
548
|
-
LogLevel["DEBUG"] = "DEBUG";
|
|
549
|
-
LogLevel["TRACE"] = "TRACE";
|
|
550
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
551
|
-
exports.HTTPMethod = void 0;
|
|
552
|
-
(function (HTTPMethod) {
|
|
553
|
-
HTTPMethod["POST"] = "POST";
|
|
554
|
-
HTTPMethod["GET"] = "GET";
|
|
555
|
-
HTTPMethod["PUT"] = "PUT";
|
|
556
|
-
HTTPMethod["PATCH"] = "PATCH";
|
|
557
|
-
HTTPMethod["DELETE"] = "DELETE";
|
|
558
|
-
})(exports.HTTPMethod || (exports.HTTPMethod = {}));
|
|
559
|
-
|
|
560
|
-
exports.WorksheetType = void 0;
|
|
561
|
-
(function (WorksheetType) {
|
|
562
|
-
WorksheetType["JK_MD"] = "JK_MD";
|
|
563
|
-
WorksheetType["CODE_EDITOR"] = "CODE_EDITOR";
|
|
564
|
-
WorksheetType["LIST"] = "LIST";
|
|
565
|
-
WorksheetType["GRAPH"] = "GRAPH";
|
|
566
|
-
WorksheetType["QUIZ_PROBLEM"] = "QUIZ_PROBLEM";
|
|
567
|
-
WorksheetType["QUIZ_TEXT"] = "QUIZ_TEXT";
|
|
568
|
-
WorksheetType["QUIZ_OPTIONS"] = "QUIZ_OPTIONS";
|
|
569
|
-
WorksheetType["NEW_PAGE"] = "NEW_PAGE";
|
|
570
|
-
})(exports.WorksheetType || (exports.WorksheetType = {}));
|
|
571
|
-
exports.QuizScoringMode = void 0;
|
|
572
|
-
(function (QuizScoringMode) {
|
|
573
|
-
QuizScoringMode["TOTAL"] = "TOTAL";
|
|
574
|
-
QuizScoringMode["PARTIAL"] = "PARTIAL";
|
|
575
|
-
})(exports.QuizScoringMode || (exports.QuizScoringMode = {}));
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Subscriptions of the client. With the TOPIC channels they are not sent to the server anymore:
|
|
579
|
-
* they only say which channel the client attaches (`getChannelOfWebSocketSubscribeEvent`) and the dispatch key.
|
|
580
|
-
*/
|
|
581
|
-
exports.WebSocketSubscriptionEvent = void 0;
|
|
582
|
-
(function (WebSocketSubscriptionEvent) {
|
|
583
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_CODE_RUN_STATUS"] = "SUBSCRIBE_CODE_RUN_STATUS";
|
|
584
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_CODE_RUN_STATUS"] = "UNSUBSCRIBE_CODE_RUN_STATUS";
|
|
585
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_SUBMISSION_RUN_STATUS"] = "SUBSCRIBE_SUBMISSION_RUN_STATUS";
|
|
586
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_SUBMISSION_RUN_STATUS"] = "UNSUBSCRIBE_SUBMISSION_RUN_STATUS";
|
|
587
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_GET_DATA"] = "SUBSCRIBE_GET_DATA";
|
|
588
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_GET_DATA"] = "SUBSCRIBE_GET_DATA";
|
|
589
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_PROBLEM_CRAWLED"] = "SUBSCRIBE_PROBLEM_CRAWLED";
|
|
590
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_PROBLEM_CRAWLED"] = "UNSUBSCRIBE_PROBLEM_CRAWLED";
|
|
591
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_SUBMISSIONS_CRAWL"] = "SUBSCRIBE_SUBMISSIONS_CRAWL";
|
|
592
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_SUBMISSIONS_CRAWL"] = "UNSUBSCRIBE_SUBMISSIONS_CRAWL";
|
|
593
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_CONTEST_CHANGES"] = "SUBSCRIBE_CONTEST_CHANGES";
|
|
594
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_CONTEST_CHANGES"] = "UNSUBSCRIBE_CONTEST_CHANGES";
|
|
595
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_USER_NOTIFICATION"] = "SUBSCRIBE_USER_NOTIFICATION";
|
|
596
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_USER_NOTIFICATION"] = "UNSUBSCRIBE_USER_NOTIFICATION";
|
|
597
|
-
WebSocketSubscriptionEvent["SUBSCRIBE_SUBMISSIONS_JUDGING"] = "SUBSCRIBE_SUBMISSIONS_JUDGING";
|
|
598
|
-
WebSocketSubscriptionEvent["UNSUBSCRIBE_SUBMISSIONS_JUDGING"] = "UNSUBSCRIBE_SUBMISSIONS_JUDGING";
|
|
599
|
-
})(exports.WebSocketSubscriptionEvent || (exports.WebSocketSubscriptionEvent = {}));
|
|
600
|
-
exports.WebSocketResponseEvent = void 0;
|
|
601
|
-
(function (WebSocketResponseEvent) {
|
|
602
|
-
WebSocketResponseEvent["CODE_RUN_STATUS"] = "CODE_RUN_STATUS";
|
|
603
|
-
WebSocketResponseEvent["SUBMISSION_RUN_STATUS"] = "SUBMISSION_RUN_STATUS";
|
|
604
|
-
WebSocketResponseEvent["USER_MESSAGE"] = "USER_MESSAGE";
|
|
605
|
-
WebSocketResponseEvent["SEND_DATA_"] = "SEND_DATA_";
|
|
606
|
-
WebSocketResponseEvent["SEND_DATA_ECS_TASK_DEFINITIONS_LIST"] = "SEND_DATA_ECS_TASK_DEFINITIONS_LIST";
|
|
607
|
-
WebSocketResponseEvent["SEND_DATA_ECS_TASKS_LIST"] = "SEND_DATA_ECS_TASKS_LIST";
|
|
608
|
-
WebSocketResponseEvent["SEND_DATA_EC2_INSTANCES_LIST"] = "SEND_DATA_EC2_INSTANCES_LIST";
|
|
609
|
-
WebSocketResponseEvent["SEND_DATA_SSM_SESSIONS_LIST"] = "SEND_DATA_SSM_SESSIONS_LIST";
|
|
610
|
-
WebSocketResponseEvent["SEND_DATA_RUN_COMMAND"] = "SEND_DATA_RUN_COMMAND";
|
|
611
|
-
WebSocketResponseEvent["PROBLEM_CRAWLED"] = "PROBLEM_CRAWLED";
|
|
612
|
-
WebSocketResponseEvent["SUBMISSIONS_CRAWL"] = "SUBMISSIONS_CRAWL";
|
|
613
|
-
WebSocketResponseEvent["CONTEST_CHANGES"] = "CONTEST_CHANGES";
|
|
614
|
-
WebSocketResponseEvent["USER_NOTIFICATION_"] = "USER_NOTIFICATION_";
|
|
615
|
-
WebSocketResponseEvent["USER_NOTIFICATION_SUBMISSION"] = "USER_NOTIFICATION_SUBMISSION";
|
|
616
|
-
WebSocketResponseEvent["USER_NOTIFICATION_CONTEST_CLARIFICATION"] = "USER_NOTIFICATION_CONTEST_CLARIFICATION";
|
|
617
|
-
WebSocketResponseEvent["SUBMISSION_JUDGING"] = "SUBMISSION_JUDGING";
|
|
618
|
-
})(exports.WebSocketResponseEvent || (exports.WebSocketResponseEvent = {}));
|
|
619
|
-
/**
|
|
620
|
-
* Roles of a contest, with the same names as the contest members in the DB.
|
|
621
|
-
* Each role has its own Ably channel: `contest:{contestKey}:{role}` (see `CHANNEL_CONTEST`).
|
|
622
|
-
* The inclusions follow `getContestAccessPermissions`:
|
|
623
|
-
* spectators ⊇ managers ⊇ administrators, spectators ⊇ participants, spectators ⊇ guests
|
|
624
|
-
*/
|
|
625
|
-
exports.ContestChannelRole = void 0;
|
|
626
|
-
(function (ContestChannelRole) {
|
|
627
|
-
ContestChannelRole["ADMINISTRATORS"] = "administrators";
|
|
628
|
-
ContestChannelRole["MANAGERS"] = "managers";
|
|
629
|
-
ContestChannelRole["PARTICIPANTS"] = "participants";
|
|
630
|
-
ContestChannelRole["GUESTS"] = "guests";
|
|
631
|
-
ContestChannelRole["SPECTATORS"] = "spectators";
|
|
632
|
-
})(exports.ContestChannelRole || (exports.ContestChannelRole = {}));
|
|
633
|
-
/**
|
|
634
|
-
* Roles of a problem, the ones computed by `getProblemAccessPermissions` (backend).
|
|
635
|
-
* Each role has its own Ably channel: `problem:{problemKey}:{role}` (see `CHANNEL_PROBLEM`).
|
|
636
|
-
*/
|
|
637
|
-
exports.ProblemChannelRole = void 0;
|
|
638
|
-
(function (ProblemChannelRole) {
|
|
639
|
-
ProblemChannelRole["ADMINISTRATORS"] = "administrators";
|
|
640
|
-
ProblemChannelRole["MANAGERS"] = "managers";
|
|
641
|
-
ProblemChannelRole["SPECTATORS"] = "spectators";
|
|
642
|
-
})(exports.ProblemChannelRole || (exports.ProblemChannelRole = {}));
|
|
643
|
-
/**
|
|
644
|
-
* Roles of the public channels of a user: `user:{userId}:{role}` (see `CHANNEL_USER_ROLE`).
|
|
645
|
-
* There are no per-user permissions: `spectators` is everyone who can list the submissions of the user.
|
|
646
|
-
* The private channel of the user is `user:{userId}` (see `CHANNEL_USER`).
|
|
647
|
-
*/
|
|
648
|
-
exports.UserChannelRole = void 0;
|
|
649
|
-
(function (UserChannelRole) {
|
|
650
|
-
UserChannelRole["SPECTATORS"] = "spectators";
|
|
651
|
-
})(exports.UserChannelRole || (exports.UserChannelRole = {}));
|
|
652
|
-
|
|
653
|
-
exports.DataViewMode = void 0;
|
|
654
|
-
(function (DataViewMode) {
|
|
655
|
-
DataViewMode["CARDS"] = "CARDS";
|
|
656
|
-
DataViewMode["ROWS"] = "ROWS";
|
|
657
|
-
})(exports.DataViewMode || (exports.DataViewMode = {}));
|
|
658
|
-
exports.MenuViewMode = void 0;
|
|
659
|
-
(function (MenuViewMode) {
|
|
660
|
-
MenuViewMode["HORIZONTAL"] = "HORIZONTAL";
|
|
661
|
-
MenuViewMode["VERTICAL"] = "VERTICAL";
|
|
662
|
-
})(exports.MenuViewMode || (exports.MenuViewMode = {}));
|
|
663
|
-
exports.Role = void 0;
|
|
664
|
-
(function (Role) {
|
|
665
|
-
Role["SUPER_ADMIN"] = "SUPER_ADMIN";
|
|
666
|
-
Role["ADMIN"] = "ADMIN";
|
|
667
|
-
Role["MASTER"] = "MASTER";
|
|
668
|
-
Role["MANAGER"] = "MANAGER";
|
|
669
|
-
Role["CREATOR"] = "CREATOR";
|
|
670
|
-
Role["REGULAR"] = "REGULAR";
|
|
671
|
-
Role["LIMITED"] = "LIMITED";
|
|
672
|
-
Role["GUEST"] = "GUEST";
|
|
673
|
-
Role["RESTRICTED"] = "RESTRICTED";
|
|
674
|
-
})(exports.Role || (exports.Role = {}));
|
|
675
|
-
|
|
676
|
-
exports.WorkingIn = void 0;
|
|
677
|
-
(function (WorkingIn) {
|
|
678
|
-
WorkingIn["NOTHING"] = "NOTHING";
|
|
679
|
-
WorkingIn["SEND_SUBMISSION"] = "SEND_SUBMISSION";
|
|
680
|
-
WorkingIn["TRACKING_SUBMISSION"] = "TRACKING_SUBMISSION";
|
|
681
|
-
WorkingIn["CRAWLING_LANGUAGES"] = "CRAWLING_LANGUAGES";
|
|
682
|
-
WorkingIn["CRAWLING_PROBLEM_DATA"] = "CRAWLING_PROBLEM_DATA";
|
|
683
|
-
})(exports.WorkingIn || (exports.WorkingIn = {}));
|
|
684
|
-
|
|
685
|
-
exports.AspectRatio = void 0;
|
|
686
|
-
(function (AspectRatio) {
|
|
687
|
-
AspectRatio["RATIO_21_9"] = "21:9";
|
|
688
|
-
AspectRatio["RATIO_20_9"] = "20:9";
|
|
689
|
-
AspectRatio["RATIO_16_9"] = "16:9";
|
|
690
|
-
AspectRatio["RATIO_16_10"] = "16:10";
|
|
691
|
-
AspectRatio["RATIO_3_2"] = "3:2";
|
|
692
|
-
AspectRatio["RATIO_4_3"] = "4:3";
|
|
693
|
-
AspectRatio["RATIO_5_4"] = "5:4";
|
|
694
|
-
AspectRatio["RATIO_1_1"] = "1:1";
|
|
695
|
-
})(exports.AspectRatio || (exports.AspectRatio = {}));
|
|
696
|
-
|
|
697
|
-
const LANGUAGE = {
|
|
698
|
-
[Language.EN]: { value: Language.EN, label: 'english' },
|
|
699
|
-
[Language.ES]: { value: Language.ES, label: 'español' },
|
|
700
|
-
};
|
|
701
|
-
const THEME = {
|
|
702
|
-
[Theme.LIGHT]: { value: Theme.LIGHT, label: 'light' },
|
|
703
|
-
[Theme.DARK]: { value: Theme.DARK, label: 'dark' },
|
|
704
|
-
};
|
|
705
|
-
const GCC_VERSION = `gcc (Debian 12.2.0-14+deb12u1) 12.2.0
|
|
706
|
-
Copyright (C) 2022 Free Software Foundation, Inc.
|
|
707
|
-
This is free software; see the source for copying conditions. There is NO
|
|
708
|
-
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.`;
|
|
709
|
-
const GPP_VERSION = `g++ (Debian 12.2.0-14+deb12u1) 12.2.0
|
|
710
|
-
Copyright (C) 2022 Free Software Foundation, Inc.
|
|
711
|
-
This is free software; see the source for copying conditions. There is NO
|
|
712
|
-
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.`;
|
|
713
|
-
const JAVAC_VERSION = `javac 17.0.15`;
|
|
714
|
-
const NODE_VERSION = `v20.19.2`;
|
|
715
|
-
const PYTHON3_VERSION = 'Python 3.11.2';
|
|
716
|
-
const PYPY3_VERSION = `Python 3.9.16 (7.3.11+dfsg-2+deb12u3, Dec 30 2024, 22:36:23)
|
|
717
|
-
[PyPy 7.3.11 with GCC 12.2.0]`;
|
|
718
|
-
const PSEINT_VERSION = `PSeInt 20230904-l64-wx3
|
|
719
|
-
http://pseint.sourceforge.net
|
|
720
|
-
by Pablo Novara (zaskar_84@yahoo.com.ar)
|
|
721
|
-
psExport 20230904-l64-wx3
|
|
722
|
-
http://pseint.sourceforge.net
|
|
723
|
-
by Pablo Novara (zaskar_84@yahoo.com.ar)`;
|
|
724
|
-
const C = {
|
|
725
|
-
mime: 'text/x-csrc',
|
|
726
|
-
mainFilename: 'main.c',
|
|
727
|
-
fileExtension: ['c'],
|
|
728
|
-
hasBuildFile: true,
|
|
729
|
-
executable: 'gcc',
|
|
730
|
-
executableVersion: GCC_VERSION,
|
|
731
|
-
templateSourceCode: '#include <stdio.h>\n \nint main(void) {\n \n printf("Hello World\\n");\n \n return 0;\n}',
|
|
732
|
-
monacoKey: 'c',
|
|
733
|
-
codeMirrorKey: 'c',
|
|
734
|
-
highlightJsKey: 'c',
|
|
735
|
-
};
|
|
736
|
-
const CPP = {
|
|
737
|
-
mime: 'text/x-c++src',
|
|
738
|
-
mainFilename: 'main.cpp',
|
|
739
|
-
fileExtension: ['cpp', 'c++', 'cxx', 'cc'],
|
|
740
|
-
hasBuildFile: true,
|
|
741
|
-
executable: 'g++',
|
|
742
|
-
executableVersion: GPP_VERSION,
|
|
743
|
-
templateSourceCode: '#include <iostream>\n\nusing namespace std;\n\n' + 'int main() {\n \n cout << "Hello World" << endl;\n \n return 0;\n}',
|
|
744
|
-
monacoKey: 'cpp',
|
|
745
|
-
codeMirrorKey: 'cpp',
|
|
746
|
-
highlightJsKey: 'cpp',
|
|
747
|
-
};
|
|
748
|
-
const PYTHON = {
|
|
749
|
-
mime: 'text/x-python',
|
|
750
|
-
mainFilename: 'main.py',
|
|
751
|
-
fileExtension: ['py'],
|
|
752
|
-
hasBuildFile: false,
|
|
753
|
-
templateSourceCode: 'print("Hello World\\n")',
|
|
754
|
-
monacoKey: 'python',
|
|
755
|
-
codeMirrorKey: 'python',
|
|
756
|
-
highlightJsKey: 'python',
|
|
757
|
-
};
|
|
758
|
-
const CODE_LANGUAGE = {
|
|
759
|
-
[exports.CodeLanguage.C_11]: {
|
|
760
|
-
value: exports.CodeLanguage.C_11,
|
|
761
|
-
label: 'C 11',
|
|
762
|
-
compilePattern: '/usr/bin/jk-c11 -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -O2 -std=gnu11 -o ' +
|
|
763
|
-
'{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
764
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
765
|
-
...C,
|
|
766
|
-
/*
|
|
767
|
-
-static
|
|
768
|
-
Binario independiente.
|
|
769
|
-
-fno-optimize-sibling-calls
|
|
770
|
-
Desactiva la optimización de llamadas recursivas “tail call”. Facilita detectar desbordes de pila o trazas correctas.
|
|
771
|
-
-fno-strict-aliasing
|
|
772
|
-
Evita asumir aliasing de punteros agresivo. Previene bugs raros en código competitivo.
|
|
773
|
-
-DONLINE_JUDGE
|
|
774
|
-
Define la macro ONLINE_JUDGE, usada a veces para omitir logs o debug prints (#ifdef ONLINE_JUDGE).
|
|
775
|
-
-fno-asm
|
|
776
|
-
Prohíbe insertar código ensamblador inline (asm()). Seguridad en entornos restringidos.
|
|
777
|
-
-lm
|
|
778
|
-
Enlaza libm.
|
|
779
|
-
-s
|
|
780
|
-
“Strips symbols”: elimina toda información de depuración. Binario más pequeño y más difícil de desensamblar.
|
|
781
|
-
-O2
|
|
782
|
-
Nivel medio de optimización (rápido y seguro).
|
|
783
|
-
-std=gnu11
|
|
784
|
-
Usa el estándar C11 con extensiones GNU.
|
|
785
|
-
*/
|
|
786
|
-
},
|
|
787
|
-
[exports.CodeLanguage.CPP_11]: {
|
|
788
|
-
value: exports.CodeLanguage.CPP_11,
|
|
789
|
-
label: 'C++ 11',
|
|
790
|
-
compilePattern: '/usr/bin/jk-cpp11 -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=gnu++11 -o ' +
|
|
791
|
-
'{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
792
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
793
|
-
...CPP,
|
|
794
|
-
},
|
|
795
|
-
[exports.CodeLanguage.CPP_20]: {
|
|
796
|
-
value: exports.CodeLanguage.CPP_20,
|
|
797
|
-
label: 'C++ 20',
|
|
798
|
-
compilePattern: '/usr/bin/jk-cpp20 -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=gnu++20 -o ' +
|
|
799
|
-
'{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
800
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
801
|
-
...CPP,
|
|
802
|
-
},
|
|
803
|
-
[exports.CodeLanguage.JAVA_21]: {
|
|
804
|
-
value: exports.CodeLanguage.JAVA_21,
|
|
805
|
-
label: 'Java 21',
|
|
806
|
-
mime: 'text/x-java',
|
|
807
|
-
mainFilename: 'Main.java',
|
|
808
|
-
fileExtension: ['java'],
|
|
809
|
-
compilePattern: "/usr/bin/jk-javac -cp '.;*' {{folder_path}}/{{source_full_file_name}}",
|
|
810
|
-
// compilePattern: 'javac {{folder_path}}/{{source_full_file_name}}',
|
|
811
|
-
// runPattern: 'java -cp {{folder_path}} {{class_name}}'
|
|
812
|
-
runPattern: '/usr/bin/jk-java -Xmx512M -Xss64M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -cp ' + '{{folder_path}} {{class_name}}',
|
|
813
|
-
templateSourceCode: 'class Main {\n public static void main (String[] args) {' + '\n \n System.out.println("Hello World");\n \n }\n}',
|
|
814
|
-
hasBuildFile: true,
|
|
815
|
-
executable: 'java',
|
|
816
|
-
executableVersion: JAVAC_VERSION,
|
|
817
|
-
monacoKey: 'java',
|
|
818
|
-
codeMirrorKey: 'java',
|
|
819
|
-
highlightJsKey: 'java',
|
|
820
|
-
},
|
|
821
|
-
[exports.CodeLanguage.PYTHON_2]: {
|
|
822
|
-
// DEPRECATED
|
|
823
|
-
value: exports.CodeLanguage.PYTHON_2,
|
|
824
|
-
label: 'Python 2 *',
|
|
825
|
-
compilePattern: '/usr/bin/jk-python2 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
826
|
-
runPattern: '/usr/bin/jk-python2 {{folder_path}}/{{source_full_file_name}}',
|
|
827
|
-
executable: 'python2',
|
|
828
|
-
executableVersion: PYPY3_VERSION,
|
|
829
|
-
...PYTHON,
|
|
830
|
-
},
|
|
831
|
-
[exports.CodeLanguage.PYTHON_3]: {
|
|
832
|
-
value: exports.CodeLanguage.PYTHON_3,
|
|
833
|
-
label: 'Python 3',
|
|
834
|
-
compilePattern: '/usr/bin/jk-python3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
835
|
-
runPattern: '/usr/bin/jk-python3 {{folder_path}}/{{source_full_file_name}}',
|
|
836
|
-
executable: 'python3',
|
|
837
|
-
executableVersion: PYPY3_VERSION,
|
|
838
|
-
...PYTHON,
|
|
839
|
-
},
|
|
840
|
-
[exports.CodeLanguage.PYTHON_PYPY_2]: {
|
|
841
|
-
// DEPRECATED
|
|
842
|
-
value: exports.CodeLanguage.PYTHON_PYPY_2,
|
|
843
|
-
label: 'PyPy 2 *',
|
|
844
|
-
compilePattern: '/usr/bin/jk-pypy2 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
845
|
-
runPattern: '/usr/bin/jk-pypy2 {{folder_path}}/{{source_full_file_name}}',
|
|
846
|
-
executable: 'pypy2',
|
|
847
|
-
executableVersion: PYPY3_VERSION,
|
|
848
|
-
...PYTHON,
|
|
849
|
-
},
|
|
850
|
-
[exports.CodeLanguage.PYTHON_PYPY_3]: {
|
|
851
|
-
value: exports.CodeLanguage.PYTHON_PYPY_3,
|
|
852
|
-
label: 'PyPy 3',
|
|
853
|
-
compilePattern: '/usr/bin/jk-pypy3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
854
|
-
runPattern: '/usr/bin/jk-pypy3 {{folder_path}}/{{source_full_file_name}}',
|
|
855
|
-
executable: 'pypy3',
|
|
856
|
-
executableVersion: PYPY3_VERSION,
|
|
857
|
-
...PYTHON,
|
|
858
|
-
},
|
|
859
|
-
[exports.CodeLanguage.JAVASCRIPT_NODE_JS_22]: {
|
|
860
|
-
value: exports.CodeLanguage.JAVASCRIPT_NODE_JS_22,
|
|
861
|
-
label: 'Javascript Node.js 22',
|
|
862
|
-
mime: 'application/x-javascript',
|
|
863
|
-
mainFilename: 'main.js',
|
|
864
|
-
fileExtension: ['js'],
|
|
865
|
-
compilePattern: '',
|
|
866
|
-
runPattern: '/usr/bin/jk-node22 {{folder_path}}/{{source_full_file_name}}',
|
|
867
|
-
templateSourceCode: 'console.log("Hello World\\n")',
|
|
868
|
-
hasBuildFile: false,
|
|
869
|
-
executable: 'node',
|
|
870
|
-
executableVersion: NODE_VERSION,
|
|
871
|
-
monacoKey: 'javascript',
|
|
872
|
-
codeMirrorKey: 'javascript',
|
|
873
|
-
highlightJsKey: 'javascript',
|
|
874
|
-
},
|
|
875
|
-
[exports.CodeLanguage.ICPC_C]: {
|
|
876
|
-
// DEPRECATED
|
|
877
|
-
value: exports.CodeLanguage.ICPC_C,
|
|
878
|
-
label: 'ICPC C *',
|
|
879
|
-
compilePattern: 'gcc -x c -g -O2 -std=gnu11 -static -lm -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
880
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
881
|
-
...C,
|
|
882
|
-
},
|
|
883
|
-
[exports.CodeLanguage.C]: {
|
|
884
|
-
// DEPRECATED
|
|
885
|
-
value: exports.CodeLanguage.C,
|
|
886
|
-
label: 'C *',
|
|
887
|
-
compilePattern: 'gcc -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -O2 -o ' +
|
|
888
|
-
'{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
889
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
890
|
-
...C,
|
|
891
|
-
},
|
|
892
|
-
[exports.CodeLanguage.ICPC_CPP]: {
|
|
893
|
-
// DEPRECATED
|
|
894
|
-
value: exports.CodeLanguage.ICPC_CPP,
|
|
895
|
-
label: 'ICPC C++ *',
|
|
896
|
-
compilePattern: 'g++ -x c++ -static -g -O2 -std=gnu++20 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
897
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
898
|
-
...CPP,
|
|
899
|
-
},
|
|
900
|
-
[exports.CodeLanguage.CPP]: {
|
|
901
|
-
// DEPRECATED
|
|
902
|
-
value: exports.CodeLanguage.CPP,
|
|
903
|
-
label: 'C++ *',
|
|
904
|
-
compilePattern: 'g++ -x c++ -static -DONLINE_JUDGE -lm -s -O2 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
905
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
906
|
-
...CPP,
|
|
907
|
-
},
|
|
908
|
-
[exports.CodeLanguage.CPP11]: {
|
|
909
|
-
// DEPRECATED
|
|
910
|
-
value: exports.CodeLanguage.CPP11,
|
|
911
|
-
label: 'C++ 11 *',
|
|
912
|
-
compilePattern: 'g++ -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=c++11 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
913
|
-
// compilePattern: 'g++ -O2 -s -Wall -std=c++11 -o {{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}} -lm',
|
|
914
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
915
|
-
...CPP,
|
|
916
|
-
},
|
|
917
|
-
[exports.CodeLanguage.CPP14]: {
|
|
918
|
-
// DEPRECATED
|
|
919
|
-
value: exports.CodeLanguage.CPP14,
|
|
920
|
-
label: 'C++ 14 *',
|
|
921
|
-
// compilePattern: 'g++ -O2 -s -Wall -std=c++14 -o {{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}} -lm',
|
|
922
|
-
compilePattern: 'g++ -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=c++14 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
923
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
924
|
-
...CPP,
|
|
925
|
-
},
|
|
926
|
-
[exports.CodeLanguage.CPP17]: {
|
|
927
|
-
// DEPRECATED
|
|
928
|
-
value: exports.CodeLanguage.CPP17,
|
|
929
|
-
label: 'C++ 17 *',
|
|
930
|
-
// compilePattern: 'g++ -O2 -s -Wall -std=c++17 -o {{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}} -lm',
|
|
931
|
-
compilePattern: 'g++ -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=c++17 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
|
|
932
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
933
|
-
...CPP,
|
|
934
|
-
},
|
|
935
|
-
[exports.CodeLanguage.JAVA]: {
|
|
936
|
-
// DEPRECATED
|
|
937
|
-
value: exports.CodeLanguage.JAVA,
|
|
938
|
-
label: 'Java *',
|
|
939
|
-
mime: 'text/x-java',
|
|
940
|
-
mainFilename: 'Main.java',
|
|
941
|
-
fileExtension: ['java'],
|
|
942
|
-
compilePattern: "javac -cp '.;*' {{folder_path}}/{{source_full_file_name}}",
|
|
943
|
-
// compilePattern: 'javac {{folder_path}}/{{source_full_file_name}}',
|
|
944
|
-
// runPattern: 'java -cp {{folder_path}} {{class_name}}'
|
|
945
|
-
runPattern: '/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Xmx512M -Xss64M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -cp ' +
|
|
946
|
-
'{{folder_path}} {{class_name}}',
|
|
947
|
-
templateSourceCode: 'class Main {\n public static void main (String[] args) {' + '\n \n System.out.println("Hello World");\n \n }\n}',
|
|
948
|
-
hasBuildFile: true,
|
|
949
|
-
executable: 'javac',
|
|
950
|
-
executableVersion: JAVAC_VERSION,
|
|
951
|
-
monacoKey: 'java',
|
|
952
|
-
codeMirrorKey: 'java',
|
|
953
|
-
highlightJsKey: 'java',
|
|
954
|
-
},
|
|
955
|
-
[exports.CodeLanguage.ICPC_PYTHON]: {
|
|
956
|
-
// DEPRECATED
|
|
957
|
-
value: exports.CodeLanguage.ICPC_PYTHON,
|
|
958
|
-
label: 'ICPC Python *',
|
|
959
|
-
compilePattern: 'pypy3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
960
|
-
runPattern: '/usr/bin/pypy3 {{folder_path}}/{{source_full_file_name}}',
|
|
961
|
-
executable: 'pypy3',
|
|
962
|
-
executableVersion: PYPY3_VERSION,
|
|
963
|
-
...PYTHON,
|
|
964
|
-
},
|
|
965
|
-
[exports.CodeLanguage.PYTHON]: {
|
|
966
|
-
// DEPRECATED
|
|
967
|
-
value: exports.CodeLanguage.PYTHON,
|
|
968
|
-
label: 'Python *',
|
|
969
|
-
compilePattern: 'python3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
970
|
-
runPattern: '/usr/bin/python3 {{folder_path}}/{{source_full_file_name}}',
|
|
971
|
-
executable: 'python3',
|
|
972
|
-
executableVersion: PYTHON3_VERSION,
|
|
973
|
-
...PYTHON,
|
|
974
|
-
},
|
|
975
|
-
[exports.CodeLanguage.PYTHON2]: {
|
|
976
|
-
// DEPRECATED
|
|
977
|
-
value: exports.CodeLanguage.PYTHON2,
|
|
978
|
-
label: 'Python 2 *',
|
|
979
|
-
compilePattern: 'python2 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
980
|
-
runPattern: '/usr/bin/python2 {{folder_path}}/{{source_full_file_name}}',
|
|
981
|
-
executable: 'python',
|
|
982
|
-
executableVersion: 'Python 2.7.18',
|
|
983
|
-
...PYTHON,
|
|
984
|
-
},
|
|
985
|
-
[exports.CodeLanguage.PYTHON3]: {
|
|
986
|
-
// DEPRECATED
|
|
987
|
-
value: exports.CodeLanguage.PYTHON3,
|
|
988
|
-
label: 'Python 3 *',
|
|
989
|
-
compilePattern: 'python3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
|
|
990
|
-
runPattern: '/usr/bin/python3 {{folder_path}}/{{source_full_file_name}}',
|
|
991
|
-
executable: 'python3',
|
|
992
|
-
executableVersion: PYTHON3_VERSION,
|
|
993
|
-
...PYTHON,
|
|
994
|
-
},
|
|
995
|
-
[exports.CodeLanguage.JAVASCRIPT]: {
|
|
996
|
-
// DEPRECATED
|
|
997
|
-
value: exports.CodeLanguage.JAVASCRIPT,
|
|
998
|
-
label: 'Javascript *',
|
|
999
|
-
mime: 'application/x-javascript',
|
|
1000
|
-
mainFilename: 'main.js',
|
|
1001
|
-
fileExtension: ['js'],
|
|
1002
|
-
compilePattern: '',
|
|
1003
|
-
runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
|
|
1004
|
-
templateSourceCode: 'console.log("Hello World\\n")',
|
|
1005
|
-
hasBuildFile: false,
|
|
1006
|
-
executable: 'node',
|
|
1007
|
-
executableVersion: NODE_VERSION,
|
|
1008
|
-
monacoKey: 'javascript',
|
|
1009
|
-
codeMirrorKey: 'javascript',
|
|
1010
|
-
highlightJsKey: 'javascript',
|
|
1011
|
-
},
|
|
1012
|
-
[exports.CodeLanguage.TYPESCRIPT]: {
|
|
1013
|
-
// DEPRECATED
|
|
1014
|
-
value: exports.CodeLanguage.TYPESCRIPT,
|
|
1015
|
-
label: 'Typescript *',
|
|
1016
|
-
mime: 'application/x-typescript',
|
|
1017
|
-
mainFilename: 'main.ts',
|
|
1018
|
-
fileExtension: ['ts'],
|
|
1019
|
-
compilePattern: '',
|
|
1020
|
-
runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
|
|
1021
|
-
templateSourceCode: 'console.log("Hello World\\n")',
|
|
1022
|
-
hasBuildFile: false,
|
|
1023
|
-
executable: 'node',
|
|
1024
|
-
executableVersion: NODE_VERSION,
|
|
1025
|
-
monacoKey: 'typescript',
|
|
1026
|
-
codeMirrorKey: 'typescript',
|
|
1027
|
-
highlightJsKey: 'typescript',
|
|
1028
|
-
},
|
|
1029
|
-
[exports.CodeLanguage.TSX]: {
|
|
1030
|
-
// DEPRECATED
|
|
1031
|
-
value: exports.CodeLanguage.TSX,
|
|
1032
|
-
label: 'TSX *',
|
|
1033
|
-
mime: 'application/x-typescript',
|
|
1034
|
-
mainFilename: 'main.tsx',
|
|
1035
|
-
fileExtension: ['tsx'],
|
|
1036
|
-
compilePattern: '',
|
|
1037
|
-
runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
|
|
1038
|
-
templateSourceCode: 'console.log("Hello World\\n")',
|
|
1039
|
-
hasBuildFile: false,
|
|
1040
|
-
executable: 'node',
|
|
1041
|
-
executableVersion: NODE_VERSION,
|
|
1042
|
-
monacoKey: 'typescript',
|
|
1043
|
-
codeMirrorKey: 'typescript',
|
|
1044
|
-
highlightJsKey: 'typescript',
|
|
1045
|
-
},
|
|
1046
|
-
[exports.CodeLanguage.JSX]: {
|
|
1047
|
-
// DEPRECATED
|
|
1048
|
-
value: exports.CodeLanguage.JSX,
|
|
1049
|
-
label: 'JSX *',
|
|
1050
|
-
mime: 'application/x-javascript',
|
|
1051
|
-
mainFilename: 'main.jsx',
|
|
1052
|
-
fileExtension: ['jsx'],
|
|
1053
|
-
compilePattern: '',
|
|
1054
|
-
runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
|
|
1055
|
-
templateSourceCode: 'console.log("Hello World\\n")',
|
|
1056
|
-
hasBuildFile: false,
|
|
1057
|
-
executable: 'node',
|
|
1058
|
-
executableVersion: NODE_VERSION,
|
|
1059
|
-
monacoKey: 'javascript',
|
|
1060
|
-
codeMirrorKey: 'javascript',
|
|
1061
|
-
highlightJsKey: 'javascript',
|
|
1062
|
-
},
|
|
1063
|
-
[exports.CodeLanguage.PSEUDOCODE_PSEINT]: {
|
|
1064
|
-
value: exports.CodeLanguage.PSEUDOCODE_PSEINT,
|
|
1065
|
-
label: 'Pseudo-código (PSeInt)',
|
|
1066
|
-
mime: 'text/plain',
|
|
1067
|
-
mainFilename: 'main.psc',
|
|
1068
|
-
fileExtension: ['psc'],
|
|
1069
|
-
compilePattern: 'jk-pseint {{folder_path}}/{{source_full_file_name}} --norun --nouser' +
|
|
1070
|
-
' && jk-pseint {{folder_path}}/{{source_full_file_name}} --draw {{folder_path}}/{{source_full_file_name}}.psd' +
|
|
1071
|
-
' && jk-psexport {{folder_path}}/{{source_full_file_name}}.psd {{folder_path}}/{{source_full_file_name}}.cpp --lang=cpp' +
|
|
1072
|
-
' && g++ -x c++ -g -O2 -std=gnu++20 -static -o ' +
|
|
1073
|
-
'{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}.cpp',
|
|
1074
|
-
runPattern: '{{folder_path}}/{{compiled_file_name}}',
|
|
1075
|
-
templateSourceCode: 'Algoritmo HOLA_MUNDO\n\tImprimir "Hello World"\nFinAlgoritmo\n',
|
|
1076
|
-
hasBuildFile: false,
|
|
1077
|
-
executable: '',
|
|
1078
|
-
executableVersion: PSEINT_VERSION,
|
|
1079
|
-
monacoKey: 'text',
|
|
1080
|
-
codeMirrorKey: 'pseudocode-pseint',
|
|
1081
|
-
highlightJsKey: 'plaintext',
|
|
1082
|
-
},
|
|
1083
|
-
[exports.CodeLanguage.DOT]: {
|
|
1084
|
-
value: exports.CodeLanguage.DOT,
|
|
1085
|
-
label: 'DOT',
|
|
1086
|
-
mime: 'text/vnd.graphviz',
|
|
1087
|
-
mainFilename: 'diagram.dot',
|
|
1088
|
-
fileExtension: ['dot'],
|
|
1089
|
-
compilePattern: '',
|
|
1090
|
-
runPattern: '',
|
|
1091
|
-
templateSourceCode: 'digraph G {\n A -> B;\n B -> C;\n}',
|
|
1092
|
-
hasBuildFile: false,
|
|
1093
|
-
executable: '',
|
|
1094
|
-
executableVersion: '',
|
|
1095
|
-
monacoKey: 'dot',
|
|
1096
|
-
codeMirrorKey: 'dot',
|
|
1097
|
-
highlightJsKey: 'plaintext',
|
|
1098
|
-
},
|
|
1099
|
-
[exports.CodeLanguage.MERMAID]: {
|
|
1100
|
-
value: exports.CodeLanguage.MERMAID,
|
|
1101
|
-
label: 'Mermaid',
|
|
1102
|
-
mime: 'text/mermaid',
|
|
1103
|
-
mainFilename: 'diagram.mmd',
|
|
1104
|
-
fileExtension: ['mmd', 'mermaid'],
|
|
1105
|
-
compilePattern: '',
|
|
1106
|
-
runPattern: '',
|
|
1107
|
-
templateSourceCode: `graph TD
|
|
1108
|
-
A[Start] --> B{Is it working?}
|
|
1109
|
-
B -- Yes --> C[Great!]
|
|
1110
|
-
B -- No --> D[Fix it]
|
|
1111
|
-
D --> B
|
|
1112
|
-
`,
|
|
1113
|
-
hasBuildFile: false,
|
|
1114
|
-
executable: '',
|
|
1115
|
-
executableVersion: '',
|
|
1116
|
-
monacoKey: 'mermaid',
|
|
1117
|
-
codeMirrorKey: 'mermaid',
|
|
1118
|
-
highlightJsKey: 'plaintext',
|
|
1119
|
-
},
|
|
1120
|
-
[exports.CodeLanguage.JSON]: {
|
|
1121
|
-
value: exports.CodeLanguage.JSON,
|
|
1122
|
-
label: 'JSON',
|
|
1123
|
-
mime: 'application/json',
|
|
1124
|
-
mainFilename: 'main.json',
|
|
1125
|
-
fileExtension: ['json'],
|
|
1126
|
-
compilePattern: '',
|
|
1127
|
-
runPattern: '',
|
|
1128
|
-
templateSourceCode: '{\n \n}',
|
|
1129
|
-
hasBuildFile: false,
|
|
1130
|
-
executable: '',
|
|
1131
|
-
executableVersion: '',
|
|
1132
|
-
monacoKey: 'json',
|
|
1133
|
-
codeMirrorKey: 'javascript',
|
|
1134
|
-
highlightJsKey: 'json',
|
|
1135
|
-
},
|
|
1136
|
-
[exports.CodeLanguage.TEXT]: {
|
|
1137
|
-
value: exports.CodeLanguage.TEXT,
|
|
1138
|
-
label: 'plain text',
|
|
1139
|
-
mime: 'text/plain',
|
|
1140
|
-
mainFilename: 'main.txt',
|
|
1141
|
-
fileExtension: ['txt', 'text', 'in', 'out'],
|
|
1142
|
-
compilePattern: '',
|
|
1143
|
-
runPattern: '',
|
|
1144
|
-
templateSourceCode: '',
|
|
1145
|
-
hasBuildFile: false,
|
|
1146
|
-
executable: '',
|
|
1147
|
-
executableVersion: '',
|
|
1148
|
-
monacoKey: 'text',
|
|
1149
|
-
codeMirrorKey: 'text',
|
|
1150
|
-
highlightJsKey: 'plaintext',
|
|
1151
|
-
},
|
|
1152
|
-
[exports.CodeLanguage.DIFF]: {
|
|
1153
|
-
value: exports.CodeLanguage.DIFF,
|
|
1154
|
-
label: 'diff',
|
|
1155
|
-
mime: 'text/plain',
|
|
1156
|
-
mainFilename: 'main.patch',
|
|
1157
|
-
fileExtension: ['diff', 'patch'],
|
|
1158
|
-
compilePattern: '',
|
|
1159
|
-
runPattern: '',
|
|
1160
|
-
templateSourceCode: '',
|
|
1161
|
-
hasBuildFile: false,
|
|
1162
|
-
executable: '',
|
|
1163
|
-
executableVersion: '',
|
|
1164
|
-
monacoKey: 'diff',
|
|
1165
|
-
codeMirrorKey: 'diff',
|
|
1166
|
-
highlightJsKey: 'diff',
|
|
1167
|
-
},
|
|
1168
|
-
[exports.CodeLanguage.LATEX]: {
|
|
1169
|
-
value: exports.CodeLanguage.LATEX,
|
|
1170
|
-
label: 'LaTeX',
|
|
1171
|
-
mime: 'application/x-latex',
|
|
1172
|
-
mainFilename: 'main.tex',
|
|
1173
|
-
fileExtension: ['tex'],
|
|
1174
|
-
compilePattern: '',
|
|
1175
|
-
runPattern: '',
|
|
1176
|
-
templateSourceCode: '',
|
|
1177
|
-
hasBuildFile: false,
|
|
1178
|
-
executable: '',
|
|
1179
|
-
executableVersion: '',
|
|
1180
|
-
monacoKey: 'latex',
|
|
1181
|
-
codeMirrorKey: 'stex',
|
|
1182
|
-
highlightJsKey: 'latex',
|
|
1183
|
-
},
|
|
1184
|
-
// asc txt text diff pot
|
|
1185
|
-
[exports.CodeLanguage.MARKDOWN]: {
|
|
1186
|
-
value: exports.CodeLanguage.MARKDOWN,
|
|
1187
|
-
label: 'Markdown',
|
|
1188
|
-
mime: 'text/plain',
|
|
1189
|
-
mainFilename: 'main.md',
|
|
1190
|
-
fileExtension: ['md'],
|
|
1191
|
-
compilePattern: '',
|
|
1192
|
-
runPattern: '',
|
|
1193
|
-
templateSourceCode: '# Hello World\n',
|
|
1194
|
-
hasBuildFile: false,
|
|
1195
|
-
executable: '',
|
|
1196
|
-
executableVersion: '',
|
|
1197
|
-
monacoKey: 'markdown',
|
|
1198
|
-
codeMirrorKey: 'markdown',
|
|
1199
|
-
highlightJsKey: 'markdown',
|
|
1200
|
-
},
|
|
1201
|
-
[exports.CodeLanguage.MDX]: {
|
|
1202
|
-
value: exports.CodeLanguage.MDX,
|
|
1203
|
-
label: 'MDX',
|
|
1204
|
-
mime: 'text/plain',
|
|
1205
|
-
mainFilename: 'main.mdx',
|
|
1206
|
-
fileExtension: ['mdx'],
|
|
1207
|
-
compilePattern: '',
|
|
1208
|
-
runPattern: '',
|
|
1209
|
-
templateSourceCode: '# Hello World\n',
|
|
1210
|
-
hasBuildFile: false,
|
|
1211
|
-
executable: '',
|
|
1212
|
-
executableVersion: '',
|
|
1213
|
-
monacoKey: 'markdown',
|
|
1214
|
-
codeMirrorKey: 'markdown',
|
|
1215
|
-
highlightJsKey: 'markdown',
|
|
1216
|
-
},
|
|
1217
|
-
[exports.CodeLanguage.ARDUINO]: {
|
|
1218
|
-
value: exports.CodeLanguage.ARDUINO,
|
|
1219
|
-
label: 'Arduino',
|
|
1220
|
-
mime: 'text/plain',
|
|
1221
|
-
mainFilename: 'main.c',
|
|
1222
|
-
fileExtension: ['c', 'cpp', 'pde', 'h', 'ino'],
|
|
1223
|
-
compilePattern: '',
|
|
1224
|
-
runPattern: '',
|
|
1225
|
-
templateSourceCode: '',
|
|
1226
|
-
hasBuildFile: false,
|
|
1227
|
-
executable: '',
|
|
1228
|
-
executableVersion: '',
|
|
1229
|
-
monacoKey: 'c',
|
|
1230
|
-
codeMirrorKey: 'c',
|
|
1231
|
-
highlightJsKey: 'c',
|
|
1232
|
-
},
|
|
1233
|
-
[exports.CodeLanguage.HTML]: {
|
|
1234
|
-
value: exports.CodeLanguage.HTML,
|
|
1235
|
-
label: 'HTML',
|
|
1236
|
-
mime: 'text/HTML',
|
|
1237
|
-
mainFilename: 'index.html',
|
|
1238
|
-
fileExtension: ['html'],
|
|
1239
|
-
compilePattern: '',
|
|
1240
|
-
runPattern: '',
|
|
1241
|
-
templateSourceCode: '',
|
|
1242
|
-
hasBuildFile: false,
|
|
1243
|
-
executable: '',
|
|
1244
|
-
executableVersion: '',
|
|
1245
|
-
monacoKey: 'html',
|
|
1246
|
-
codeMirrorKey: 'html',
|
|
1247
|
-
highlightJsKey: 'xml',
|
|
1248
|
-
},
|
|
1249
|
-
[exports.CodeLanguage.BASH]: {
|
|
1250
|
-
value: exports.CodeLanguage.BASH,
|
|
1251
|
-
label: 'Bash',
|
|
1252
|
-
mime: 'text/plain',
|
|
1253
|
-
mainFilename: 'main.sh',
|
|
1254
|
-
fileExtension: ['sh', 'bash'],
|
|
1255
|
-
compilePattern: '',
|
|
1256
|
-
runPattern: '',
|
|
1257
|
-
templateSourceCode: '#!/bin/bash\necho "Hello World"\n',
|
|
1258
|
-
hasBuildFile: false,
|
|
1259
|
-
executable: 'bash',
|
|
1260
|
-
executableVersion: '',
|
|
1261
|
-
monacoKey: 'shell',
|
|
1262
|
-
codeMirrorKey: 'shell',
|
|
1263
|
-
highlightJsKey: 'bash',
|
|
1264
|
-
},
|
|
1265
|
-
};
|
|
1266
|
-
const PAGE_SIZES = ['32', '64', '128', '256', '512'];
|
|
1267
|
-
const PALLETE = {
|
|
1268
|
-
VIVOS: [
|
|
1269
|
-
{ color: '#FF0000', title: 'Rojo' },
|
|
1270
|
-
{ color: '#FF5900', title: 'Rojo - Naranja' },
|
|
1271
|
-
{ color: '#FF8600', title: 'Naranja' },
|
|
1272
|
-
{ color: '#FFBF00', title: 'Ámbar' },
|
|
1273
|
-
{ color: '#FFFF00', title: 'Amarillo' },
|
|
1274
|
-
{ color: '#A6FF00', title: 'Lima o Verde limon' },
|
|
1275
|
-
{ color: '#00FF8C', title: 'Verde puro' },
|
|
1276
|
-
{ color: '#00FF8C', title: 'Verde cian' },
|
|
1277
|
-
{ color: '#00FFFF', title: 'Cian' },
|
|
1278
|
-
{ color: '#0099FF', title: 'Cerúleo o Azur' },
|
|
1279
|
-
{ color: '#0000FF', title: 'Azul' },
|
|
1280
|
-
{ color: '#9F00FF', title: 'Violeta' },
|
|
1281
|
-
{ color: '#FF00FF', title: 'Magenta' },
|
|
1282
|
-
{ color: '#FF0099', title: 'Fucsia' },
|
|
1283
|
-
],
|
|
1284
|
-
OSCUROS: [
|
|
1285
|
-
{ color: '#880000', title: 'Granate' },
|
|
1286
|
-
{ color: '#882F00', title: 'Caoba o Rojo indio' },
|
|
1287
|
-
{ color: '#884700', title: 'Marrón o Pardo' },
|
|
1288
|
-
{ color: '#886600', title: 'Marrón dorado' },
|
|
1289
|
-
{ color: '#888800', title: 'Oliva' },
|
|
1290
|
-
{ color: '#588800', title: 'Verde palta' },
|
|
1291
|
-
{ color: '#008800', title: 'Verde estándar' },
|
|
1292
|
-
{ color: '#008858', title: 'Esmeralda' },
|
|
1293
|
-
{ color: '#008888', title: 'Cerceta o Azul verde' },
|
|
1294
|
-
{ color: '#005288', title: 'Añil' },
|
|
1295
|
-
{ color: '#000080', title: 'Azul marino' },
|
|
1296
|
-
{ color: '#880088', title: 'Azul púrpura' },
|
|
1297
|
-
{ color: '#880088', title: 'Púrpura o Morado' },
|
|
1298
|
-
{ color: '#880047', title: 'Vino' },
|
|
1299
|
-
],
|
|
1300
|
-
AGRISADOS: [
|
|
1301
|
-
{ color: '#BF4040', title: 'Lacre' },
|
|
1302
|
-
{ color: '#BF6340', title: 'Cobre' },
|
|
1303
|
-
{ color: '#BF8340', title: 'Cnalea o Ocre' },
|
|
1304
|
-
{ color: '#BF9F40', title: 'Dorado' },
|
|
1305
|
-
{ color: '#BFBF40', title: 'Chartreuse' },
|
|
1306
|
-
{ color: '#93BF40', title: 'Verde manzana' },
|
|
1307
|
-
{ color: '#93BF40', title: 'Verde bosque' },
|
|
1308
|
-
{ color: '#40BF40', title: 'Verde mar' },
|
|
1309
|
-
{ color: '#40BFBF', title: 'Turquesa' },
|
|
1310
|
-
{ color: '#408CBF', title: 'Azul acero' },
|
|
1311
|
-
{ color: '#4040BF', title: 'Zafiro' },
|
|
1312
|
-
{ color: '#9340BF', title: 'Amastista' },
|
|
1313
|
-
{ color: '#B140BF', title: 'Púrpureo' },
|
|
1314
|
-
{ color: '#B140BF', title: 'Fandango' },
|
|
1315
|
-
],
|
|
1316
|
-
CLAROS: [
|
|
1317
|
-
{ color: '#FF7777', title: 'Coral' },
|
|
1318
|
-
{ color: '#FF9977', title: 'Salmón' },
|
|
1319
|
-
{ color: '#FFB977', title: 'Melón o Durazno' },
|
|
1320
|
-
{ color: '#FFDA80', title: 'Crema' },
|
|
1321
|
-
{ color: '#FFFF88', title: 'Maíz' },
|
|
1322
|
-
{ color: '#CFFF77', title: 'Té verde' },
|
|
1323
|
-
{ color: '#77FF77', title: 'Verde claro' },
|
|
1324
|
-
{ color: '#77FFAA', title: 'Menta' },
|
|
1325
|
-
{ color: '#80FFFF', title: 'Aguamarina' },
|
|
1326
|
-
{ color: '#73C7FF', title: 'Celeste' },
|
|
1327
|
-
{ color: '#8082FF', title: 'Bígaro o aciano' },
|
|
1328
|
-
{ color: '#C977FF', title: 'Lavanda o lila' },
|
|
1329
|
-
{ color: '#FF77FF', title: 'Malva' },
|
|
1330
|
-
{ color: '#FF77C1', title: 'Rosado' },
|
|
1331
|
-
],
|
|
1332
|
-
};
|
|
1333
|
-
const UPPERCASE_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
1334
|
-
const LOWERCASE_LETTERS = UPPERCASE_LETTERS.toLowerCase();
|
|
1335
|
-
const NUMBERS = '012345678';
|
|
1336
|
-
const DEFAULT_JUKI_PROFILE_IMAGE = 'https://juki-judge.s3.us-east-2.amazonaws.com/public/file/5f69783aa7a8e048ef8d0ce2.';
|
|
1337
|
-
const SEPARATOR_TOKEN = '\x1E';
|
|
1338
|
-
const HEADER_JUKI_FORWARDED_HOST = 'x-juki-forwarded-host';
|
|
1339
|
-
const HEADER_JUKI_VISITOR_SESSION_ID = 'x-juki-visitor-session-id';
|
|
1340
|
-
const HEADER_JUKI_METADATA = 'x-juki-metadata';
|
|
1341
|
-
const HEADER_JUKI_SECRET_TOKEN = 'x-juki-secret-token';
|
|
1342
|
-
const HEADER_JUKI_INTERNAL_API_KEY = 'x-juki-internal-api-key';
|
|
1343
|
-
const COOKIE_JUKI_SESSION_ID = 'juki-session-id';
|
|
1344
|
-
|
|
1345
|
-
const JUKI_APP_ORGANIZATION_KEY = 'juki-app';
|
|
1346
|
-
const ORGANIZATION_PLAN = {
|
|
1347
|
-
[exports.OrganizationPlan.FREE]: {
|
|
1348
|
-
value: exports.OrganizationPlan.FREE,
|
|
1349
|
-
label: 'free',
|
|
1350
|
-
description: 'the resources, runners and compilers, are shared with the juki.app giving priority to juki.app',
|
|
1351
|
-
},
|
|
1352
|
-
[exports.OrganizationPlan.STANDARD]: {
|
|
1353
|
-
value: exports.OrganizationPlan.STANDARD,
|
|
1354
|
-
label: 'standard',
|
|
1355
|
-
description: 'the resources are dedicated, 1 runner and 1 compiler',
|
|
1356
|
-
},
|
|
1357
|
-
[exports.OrganizationPlan.PREMIUM]: {
|
|
1358
|
-
value: exports.OrganizationPlan.PREMIUM,
|
|
1359
|
-
label: 'premium',
|
|
1360
|
-
description: 'the resources are dedicated and on demand use with at least 1 runner and 1 compiler',
|
|
1361
|
-
},
|
|
1362
|
-
[exports.OrganizationPlan.CUSTOM]: {
|
|
1363
|
-
value: exports.OrganizationPlan.CUSTOM,
|
|
1364
|
-
label: 'custom',
|
|
1365
|
-
description: 'the resources are dedicated and on demand use with at least 1 (settable) runner and 1 (settable) compiler',
|
|
1366
|
-
},
|
|
1367
|
-
};
|
|
1368
|
-
|
|
1369
|
-
const CONTEST_STATUS = {
|
|
1370
|
-
[exports.ContestStatus.PUBLIC]: {
|
|
1371
|
-
value: exports.ContestStatus.PUBLIC,
|
|
1372
|
-
label: 'public',
|
|
1373
|
-
description: 'the contest will appear in the contest list and the users will have access according to their roles',
|
|
1374
|
-
},
|
|
1375
|
-
[exports.ContestStatus.RESERVED]: {
|
|
1376
|
-
value: exports.ContestStatus.RESERVED,
|
|
1377
|
-
label: 'reserved',
|
|
1378
|
-
description: 'the contest will appear in the contest list only for contest members and the users will have access according to their roles',
|
|
1379
|
-
},
|
|
1380
|
-
[exports.ContestStatus.ARCHIVED]: {
|
|
1381
|
-
value: exports.ContestStatus.ARCHIVED,
|
|
1382
|
-
label: 'archived',
|
|
1383
|
-
description: 'the contest will not appear for anyone, contact the administrator to see it again',
|
|
1384
|
-
},
|
|
1385
|
-
};
|
|
1386
|
-
const CONTEST_ROLE = {
|
|
1387
|
-
[exports.Role.RESTRICTED]: { value: exports.Role.RESTRICTED, label: 'restricted', level: 7 },
|
|
1388
|
-
[exports.Role.GUEST]: { value: exports.Role.GUEST, label: 'guest', level: 6 },
|
|
1389
|
-
[exports.Role.REGULAR]: { value: exports.Role.REGULAR, label: 'regular', level: 5 },
|
|
1390
|
-
[exports.Role.CREATOR]: { value: exports.Role.CREATOR, label: 'creator', level: 4 },
|
|
1391
|
-
[exports.Role.MANAGER]: { value: exports.Role.MANAGER, label: 'manager', level: 3 },
|
|
1392
|
-
[exports.Role.MASTER]: { value: exports.Role.MASTER, label: 'master', level: 2 },
|
|
1393
|
-
[exports.Role.ADMIN]: { value: exports.Role.ADMIN, label: 'admin', level: 1 },
|
|
1394
|
-
[exports.Role.SUPER_ADMIN]: { value: exports.Role.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
1395
|
-
};
|
|
1396
|
-
|
|
1397
|
-
const COURSE_ROLE = {
|
|
1398
|
-
[CourseRole.RESTRICTED]: { value: CourseRole.RESTRICTED, label: 'restricted', level: 8 },
|
|
1399
|
-
[CourseRole.GUEST]: { value: CourseRole.GUEST, label: 'guest', level: 7 },
|
|
1400
|
-
[CourseRole.REGULAR]: { value: CourseRole.REGULAR, label: 'regular', level: 6 },
|
|
1401
|
-
[CourseRole.CREATOR]: { value: CourseRole.CREATOR, label: 'creator', level: 5 },
|
|
1402
|
-
[CourseRole.SUPER_CREATOR]: { value: CourseRole.SUPER_CREATOR, label: 'super creator', level: 4 },
|
|
1403
|
-
[CourseRole.MANAGER]: { value: CourseRole.MANAGER, label: 'manager', level: 3 },
|
|
1404
|
-
[CourseRole.MASTER]: { value: CourseRole.MASTER, label: 'super admin', level: 2 },
|
|
1405
|
-
[CourseRole.ADMIN]: { value: CourseRole.ADMIN, label: 'admin', level: 1 },
|
|
1406
|
-
[CourseRole.SUPER_ADMIN]: { value: CourseRole.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
1407
|
-
};
|
|
1408
|
-
|
|
1409
|
-
function isStringJson(str) {
|
|
1410
|
-
try {
|
|
1411
|
-
if (typeof str === 'string') {
|
|
1412
|
-
JSON.parse(str);
|
|
1413
|
-
return true;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
catch (e) {
|
|
1417
|
-
return false;
|
|
1418
|
-
}
|
|
1419
|
-
return false;
|
|
1420
|
-
}
|
|
1421
|
-
function safeJsonParse(str) {
|
|
1422
|
-
try {
|
|
1423
|
-
if (typeof str === 'string') {
|
|
1424
|
-
return JSON.parse(str);
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
catch (e) {
|
|
1428
|
-
return null;
|
|
1429
|
-
}
|
|
1430
|
-
return null;
|
|
1431
|
-
}
|
|
1432
|
-
function isObjectJson(obj) {
|
|
1433
|
-
try {
|
|
1434
|
-
return typeof JSON.stringify(obj) === 'string';
|
|
1435
|
-
}
|
|
1436
|
-
catch (e) {
|
|
1437
|
-
return false;
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
function mex(array) {
|
|
1441
|
-
let i = 0;
|
|
1442
|
-
while (array.indexOf(i) !== -1) {
|
|
1443
|
-
i++;
|
|
1444
|
-
}
|
|
1445
|
-
return i;
|
|
1446
|
-
}
|
|
1447
|
-
function range(start, end) {
|
|
1448
|
-
const result = [];
|
|
1449
|
-
for (let i = start; i < end; i++) {
|
|
1450
|
-
result.push(i);
|
|
1451
|
-
}
|
|
1452
|
-
return result;
|
|
1453
|
-
}
|
|
1454
|
-
async function getPlainText(url) {
|
|
1455
|
-
return await fetch(url)
|
|
1456
|
-
.then(data => data.text())
|
|
1457
|
-
.catch((error) => {
|
|
1458
|
-
console.error('ERROR:', error);
|
|
1459
|
-
return '';
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
function objectUpdate(base, update) {
|
|
1463
|
-
if (JSON.stringify(base) === JSON.stringify(update)) {
|
|
1464
|
-
return base;
|
|
1465
|
-
}
|
|
1466
|
-
if (base !== null && update !== null && !Array.isArray(base) && typeof base === 'object' && typeof update === 'object') {
|
|
1467
|
-
const mergeKeys = new Set([...Object.keys(base), ...Object.keys(update)]);
|
|
1468
|
-
Array.from(mergeKeys).forEach(key => {
|
|
1469
|
-
if (update[key] !== null && update[key] !== undefined && base[key] !== update[key]) {
|
|
1470
|
-
base[key] = objectUpdate(base[key], update[key]);
|
|
1471
|
-
}
|
|
1472
|
-
});
|
|
1473
|
-
return base;
|
|
1474
|
-
}
|
|
1475
|
-
if (update !== null && update !== undefined) {
|
|
1476
|
-
return update;
|
|
1477
|
-
}
|
|
1478
|
-
return base;
|
|
1479
|
-
}
|
|
1480
|
-
function objectsUpdate(base, ...objects) {
|
|
1481
|
-
let newObject = { ...base };
|
|
1482
|
-
objects.forEach((update) => {
|
|
1483
|
-
newObject = objectUpdate(newObject, update);
|
|
1484
|
-
});
|
|
1485
|
-
return newObject;
|
|
1486
|
-
}
|
|
1487
|
-
function consoleWarn(...warn) {
|
|
1488
|
-
console.warn(new Date().toLocaleString(), ...warn);
|
|
1489
|
-
}
|
|
1490
|
-
function consoleInfo(...info) {
|
|
1491
|
-
console.info(new Date().toLocaleString(), ...info);
|
|
1492
|
-
}
|
|
1493
|
-
function consoleError(...error) {
|
|
1494
|
-
console.error(new Date().toLocaleString(), ...error);
|
|
1495
|
-
}
|
|
1496
|
-
function indexToLetters(index) {
|
|
1497
|
-
const d = Math.ceil(index / 26);
|
|
1498
|
-
if (d === 1) {
|
|
1499
|
-
return UPPERCASE_LETTERS.charAt(index - 1);
|
|
1500
|
-
}
|
|
1501
|
-
return UPPERCASE_LETTERS.charAt(d - 2) + UPPERCASE_LETTERS.charAt(index - (26 * (d - 1)) - 1);
|
|
1502
|
-
}
|
|
1503
|
-
function lettersToIndex(index) {
|
|
1504
|
-
if (index.length) {
|
|
1505
|
-
if (index.length === 1) {
|
|
1506
|
-
const d = UPPERCASE_LETTERS.indexOf(index);
|
|
1507
|
-
if (d !== -1) {
|
|
1508
|
-
return d + 1;
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
else if (index.length === 2) {
|
|
1512
|
-
const a = index.charAt(0);
|
|
1513
|
-
const b = index.charAt(1);
|
|
1514
|
-
const numA = lettersToIndex(a);
|
|
1515
|
-
const numB = lettersToIndex(b);
|
|
1516
|
-
return numA * 26 + numB;
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
return 0;
|
|
1520
|
-
}
|
|
1521
|
-
function getProblemJudgeKey(judge, key) {
|
|
1522
|
-
return `${judge}-${key}`;
|
|
1523
|
-
}
|
|
1524
|
-
/**
|
|
1525
|
-
* https://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable-string
|
|
1526
|
-
* Format bytes as human-readable text.
|
|
1527
|
-
*
|
|
1528
|
-
* @param bytes Number of bytes.
|
|
1529
|
-
* @param si True to use metric (SI) units, aka powers of 1000. False to use
|
|
1530
|
-
* binary (IEC), aka powers of 1024.
|
|
1531
|
-
* @param dp Number of decimal places to display.
|
|
1532
|
-
*
|
|
1533
|
-
* @return Formatted string.
|
|
1534
|
-
*/
|
|
1535
|
-
function humanFileSize(bytes, si = false, dp = 1) {
|
|
1536
|
-
const thresh = si ? 1000 : 1024;
|
|
1537
|
-
if (Math.abs(bytes) < thresh) {
|
|
1538
|
-
return bytes + ' B';
|
|
1539
|
-
}
|
|
1540
|
-
const units = si
|
|
1541
|
-
? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
1542
|
-
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
1543
|
-
let u = -1;
|
|
1544
|
-
const r = 10 ** dp;
|
|
1545
|
-
do {
|
|
1546
|
-
bytes /= thresh;
|
|
1547
|
-
++u;
|
|
1548
|
-
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
1549
|
-
return bytes.toFixed(dp) + ' ' + units[u];
|
|
1550
|
-
}
|
|
1551
|
-
function stringToArrayBuffer(str) {
|
|
1552
|
-
const buf = new ArrayBuffer(str.length); //convert str to arrayBuffer
|
|
1553
|
-
const view = new Uint8Array(buf); //create Uint8Array as viewer
|
|
1554
|
-
for (let i = 0; i < str.length; i++) {
|
|
1555
|
-
view[i] = str.charCodeAt(i) & 0xFF; //convert to octet
|
|
1556
|
-
}
|
|
1557
|
-
return buf;
|
|
1558
|
-
}
|
|
1559
|
-
function chunkString(str, size) {
|
|
1560
|
-
const numChunks = Math.ceil(str.length / size);
|
|
1561
|
-
const chunks = new Array(numChunks);
|
|
1562
|
-
for (let i = 0, o = 0; i < numChunks; ++i, o += size) {
|
|
1563
|
-
chunks[i] = str.substr(o, size);
|
|
1564
|
-
}
|
|
1565
|
-
return chunks;
|
|
1566
|
-
}
|
|
1567
|
-
function getRandomString(length) {
|
|
1568
|
-
const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; // 62
|
|
1569
|
-
let retVal = '';
|
|
1570
|
-
for (let i = 0; i < length; ++i) {
|
|
1571
|
-
retVal += charset.charAt(Math.floor(Math.random() * charset.length));
|
|
1572
|
-
}
|
|
1573
|
-
return retVal;
|
|
1574
|
-
}
|
|
1575
|
-
function join(array) {
|
|
1576
|
-
return array.join(SEPARATOR_TOKEN);
|
|
1577
|
-
}
|
|
1578
|
-
function split(text) {
|
|
1579
|
-
return text.split(SEPARATOR_TOKEN);
|
|
1580
|
-
}
|
|
1581
|
-
const areArraysDifferent = (a, b) => {
|
|
1582
|
-
if (a === b) {
|
|
1583
|
-
return false;
|
|
1584
|
-
}
|
|
1585
|
-
if (a.length !== b.length) {
|
|
1586
|
-
return true;
|
|
1587
|
-
}
|
|
1588
|
-
for (let i = 0; i < b.length; i += 1) {
|
|
1589
|
-
if (b[i] !== a[i]) {
|
|
1590
|
-
return true;
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
return false;
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
const YEARS = range(1970, 2100);
|
|
1597
|
-
const MONTH_NAMES = [
|
|
1598
|
-
'January',
|
|
1599
|
-
'February',
|
|
1600
|
-
'March',
|
|
1601
|
-
'April',
|
|
1602
|
-
'May',
|
|
1603
|
-
'June',
|
|
1604
|
-
'July',
|
|
1605
|
-
'August',
|
|
1606
|
-
'September',
|
|
1607
|
-
'October',
|
|
1608
|
-
'November',
|
|
1609
|
-
'December',
|
|
1610
|
-
];
|
|
1611
|
-
const DAY_NAMES = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
1612
|
-
const HOURS = range(0, 24);
|
|
1613
|
-
const MINUTES = range(0, 60);
|
|
1614
|
-
const SECONDS = range(0, 60);
|
|
1615
|
-
const MILLISECONDS = range(0, 1000);
|
|
1616
|
-
const MAX_DATE = new Date(8640000000000000);
|
|
1617
|
-
const MIN_DATE = new Date(0);
|
|
1618
|
-
|
|
1619
|
-
const SUPPORT_EMAIL = 'support@juki.app';
|
|
1620
|
-
const JUKI_APP_EMAIL_TEMPLATE = `<div style="width: 100%; background: #F2F2F2;">
|
|
1621
|
-
<div style="background: #164066; width: 100%;">
|
|
1622
|
-
<div style="height: 56px; color: white; width: 100px; margin: 0 auto">
|
|
1623
|
-
<img
|
|
1624
|
-
src="https://images.juki.pub/assets/juki-app-horizontal-white-logo.svg"
|
|
1625
|
-
alt="juki app logo"
|
|
1626
|
-
height="56px"
|
|
1627
|
-
style="padding:10px; box-sizing: border-box"
|
|
1628
|
-
/>
|
|
1629
|
-
</div>
|
|
1630
|
-
</div>
|
|
1631
|
-
<div style="padding: 24px; color: #333333; font-family: sans-serif; font-size: 16px; line-height: 24px;">
|
|
1632
|
-
<div style="max-width: 520px; margin: 0 auto; padding: 24px; background: white; border-radius: 6px;">
|
|
1633
|
-
<section style="padding: 0 0 1em 0; border-bottom: 1px solid #828282;">
|
|
1634
|
-
{{content}}
|
|
1635
|
-
</section>
|
|
1636
|
-
<div style="font-size: 14px; text-align: center; color: #828282; line-height: 16px; padding-top: 1em">
|
|
1637
|
-
<p style="margin: 0;">
|
|
1638
|
-
Si tú no realizaste la solicitud, escribenos a
|
|
1639
|
-
<a href="mailto:${SUPPORT_EMAIL}" style="color: #2468A6; text-decoration: none;">
|
|
1640
|
-
${SUPPORT_EMAIL}
|
|
1641
|
-
</a>
|
|
1642
|
-
</p>
|
|
1643
|
-
<p style="margin: 0;">
|
|
1644
|
-
Este mensaje fue enviado por el equipo de
|
|
1645
|
-
<a href="https://juki.app" style="color: #2468A6; text-decoration: none;">
|
|
1646
|
-
juki.app
|
|
1647
|
-
</a>
|
|
1648
|
-
</p>
|
|
1649
|
-
</div>
|
|
1650
|
-
</div>
|
|
1651
|
-
</div>
|
|
1652
|
-
</div>`;
|
|
1653
|
-
|
|
1654
|
-
const EMPTY_DOCUMENT_MEMBERS = () => ({
|
|
1655
|
-
access: exports.EntityAccess.PRIVATE,
|
|
1656
|
-
managers: {},
|
|
1657
|
-
spectators: {},
|
|
1658
|
-
});
|
|
1659
|
-
const EMPTY_ENTITY_MEMBERS = () => ({
|
|
1660
|
-
rankAdministrators: exports.EntityMembersRank.CLOSE,
|
|
1661
|
-
administrators: {},
|
|
1662
|
-
rankManagers: exports.EntityMembersRank.CLOSE,
|
|
1663
|
-
managers: {},
|
|
1664
|
-
rankGuests: exports.EntityMembersRank.CLOSE,
|
|
1665
|
-
guests: {},
|
|
1666
|
-
rankSpectators: exports.EntityMembersRank.CLOSE,
|
|
1667
|
-
spectators: {},
|
|
1668
|
-
rankParticipants: exports.EntityMembersRank.CLOSE,
|
|
1669
|
-
participants: {},
|
|
1670
|
-
});
|
|
1671
|
-
|
|
1672
|
-
const JUDGE = {
|
|
1673
|
-
// [Judge.CUSTOMER]: {
|
|
1674
|
-
// value: Judge.CUSTOMER,
|
|
1675
|
-
// label: '',
|
|
1676
|
-
// logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
|
|
1677
|
-
// logoSize: [ 883.991, 435 ],
|
|
1678
|
-
// url: '',
|
|
1679
|
-
// // getLoginUrl: () => '',
|
|
1680
|
-
// // getProfileUrl: () => '',
|
|
1681
|
-
// // getSubmitUrl: () => '',
|
|
1682
|
-
// // getSubmissionUrl: () => '',
|
|
1683
|
-
// // getProblemUrl: (key: string) => `/problem/view/${key}`,
|
|
1684
|
-
// // getUserSubmissionsUrl: () => '',
|
|
1685
|
-
// },
|
|
1686
|
-
[exports.Judge.JUKI_JUDGE]: {
|
|
1687
|
-
value: exports.Judge.JUKI_JUDGE,
|
|
1688
|
-
label: 'Juki Judge',
|
|
1689
|
-
logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
|
|
1690
|
-
logoSize: [883.991, 435],
|
|
1691
|
-
url: 'https://judge.juki.app',
|
|
1692
|
-
// getLoginUrl: () => '',
|
|
1693
|
-
// getProfileUrl: () => '',
|
|
1694
|
-
// getSubmitUrl: () => '',
|
|
1695
|
-
// getSubmissionUrl: () => '',
|
|
1696
|
-
// getProblemUrl: (key: string) => `https://judge.juki.app/problem/view/${key}`,
|
|
1697
|
-
// getUserSubmissionsUrl: () => '',
|
|
1698
|
-
},
|
|
1699
|
-
[exports.Judge.CODEFORCES]: {
|
|
1700
|
-
value: exports.Judge.CODEFORCES,
|
|
1701
|
-
label: 'Codeforces',
|
|
1702
|
-
logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
|
|
1703
|
-
logoSize: [1232.75, 145.12],
|
|
1704
|
-
url: 'https://codeforces.com',
|
|
1705
|
-
// getLoginUrl: () => 'https://codeforces.com/enter',
|
|
1706
|
-
// getProfileUrl: () => '',
|
|
1707
|
-
// getSubmitUrl: () => 'https://codeforces.com/problemset/submit',
|
|
1708
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string) => {
|
|
1709
|
-
// const [ contestId ] = problemKey.split('-');
|
|
1710
|
-
// return `https://codeforces.com/problemset/submission/${contestId}/${submissionId}`;
|
|
1711
|
-
// },
|
|
1712
|
-
// getProblemUrl: (problemKey: string) => {
|
|
1713
|
-
// const [ contestId, index ] = problemKey.split('-');
|
|
1714
|
-
// return `https://codeforces.com/problemset/problem/${contestId}/${index}`;
|
|
1715
|
-
// },
|
|
1716
|
-
// getUserSubmissionsUrl: () => '',
|
|
1717
|
-
},
|
|
1718
|
-
[exports.Judge.CODEFORCES_GYM]: {
|
|
1719
|
-
value: exports.Judge.CODEFORCES_GYM,
|
|
1720
|
-
label: 'Codeforces Gym',
|
|
1721
|
-
logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
|
|
1722
|
-
logoSize: [1232.75, 145.12],
|
|
1723
|
-
url: 'https://codeforces.com',
|
|
1724
|
-
// getLoginUrl: () => 'https://codeforces.com/enter',
|
|
1725
|
-
// getProfileUrl: () => '',
|
|
1726
|
-
// getSubmitUrl: (problemKey: string) => {
|
|
1727
|
-
// const [ gymContestId, index ] = problemKey.split('-');
|
|
1728
|
-
// return `https://codeforces.com/gym/${gymContestId}/submit`;
|
|
1729
|
-
// },
|
|
1730
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string) => {
|
|
1731
|
-
// const [ gymContestId ] = problemKey.split('-');
|
|
1732
|
-
// return `https://codeforces.com/gym/${gymContestId}/submission/${submissionId}`;
|
|
1733
|
-
// },
|
|
1734
|
-
// getProblemUrl: (problemKey: string) => {
|
|
1735
|
-
// const [ gymContestId, index ] = problemKey.split('-');
|
|
1736
|
-
// return `https://codeforces.com/gym/${gymContestId}/problem/${index}`;
|
|
1737
|
-
// },
|
|
1738
|
-
// getUserSubmissionsUrl: () => '',
|
|
1739
|
-
},
|
|
1740
|
-
[exports.Judge.JV_UMSA]: {
|
|
1741
|
-
value: exports.Judge.JV_UMSA,
|
|
1742
|
-
label: 'Juez Virtual UMSA',
|
|
1743
|
-
logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
|
|
1744
|
-
logoSize: [1232.75, 145.12],
|
|
1745
|
-
url: 'https://jv.umsa.bo',
|
|
1746
|
-
// getLoginUrl: () => 'https://jv.umsa.bo/oj/login.php',
|
|
1747
|
-
// getProfileUrl: () => 'https://jv.umsa.bo/oj/userInfo.php',
|
|
1748
|
-
// getSubmitUrl: (problemKey: string) => {
|
|
1749
|
-
// // single problem: '1019'
|
|
1750
|
-
// // cib problem: '1019-A'
|
|
1751
|
-
// const isContestProblem = problemKey.includes('-');
|
|
1752
|
-
// // A -> 0, B -> 1, C -> 2, D -> 3, E -> 4, F -> 5, G -> 6, H -> 7, I -> 8, J -> 9
|
|
1753
|
-
// const params = problemKey.split('-');
|
|
1754
|
-
// return isContestProblem
|
|
1755
|
-
// ? `https://jv.umsa.bo/oj/submitpage.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
|
|
1756
|
-
// : `https://jv.umsa.bo/oj/submitpage.php?id=${problemKey}`;
|
|
1757
|
-
// },
|
|
1758
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string, username: string) => {
|
|
1759
|
-
// // return `https://jv.umsa.bo/status.php?problem_id=&user_id=${username}&language=-1&jresult=-1`;
|
|
1760
|
-
// return `https://jv.umsa.bo/oj/showsource.php?id=${submissionId}`;
|
|
1761
|
-
// },
|
|
1762
|
-
// getProblemUrl: (problemKey: string) => {
|
|
1763
|
-
// const isContestProblem = problemKey.includes('-');
|
|
1764
|
-
// const params = problemKey.split('-');
|
|
1765
|
-
// return isContestProblem
|
|
1766
|
-
// ? `https://jv.umsa.bo/oj/problem.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
|
|
1767
|
-
// : `https://jv.umsa.bo/oj/problem.php?id=${problemKey}`;
|
|
1768
|
-
// },
|
|
1769
|
-
// getUserSubmissionsUrl: (username: string) => `https://jv.umsa.bo/oj/status.php?user_id=${username}`,
|
|
1770
|
-
},
|
|
1771
|
-
[exports.Judge.UVA_ONLINE_JUDGE]: {
|
|
1772
|
-
value: exports.Judge.UVA_ONLINE_JUDGE,
|
|
1773
|
-
label: 'Uva Online Judge',
|
|
1774
|
-
logo: 'https://images.juki.pub/c/uva-online-judge-logo-color.png',
|
|
1775
|
-
logoSize: [150, 135.994],
|
|
1776
|
-
url: 'https://onlinejudge.org',
|
|
1777
|
-
},
|
|
1778
|
-
[exports.Judge.AT_CODER]: {
|
|
1779
|
-
value: exports.Judge.AT_CODER,
|
|
1780
|
-
label: 'AtCoder',
|
|
1781
|
-
logo: 'https://images.juki.pub/c/at-coder-logo-color.png',
|
|
1782
|
-
logoSize: [762.997, 675],
|
|
1783
|
-
url: 'https://atcoder.jp',
|
|
1784
|
-
},
|
|
1785
|
-
[exports.Judge.CODECHEF]: {
|
|
1786
|
-
value: exports.Judge.CODECHEF,
|
|
1787
|
-
label: 'Codechef',
|
|
1788
|
-
logo: 'https://images.juki.pub/c/codechef-logo-color.svg',
|
|
1789
|
-
logoSize: [1207.7, 453.17],
|
|
1790
|
-
url: 'https://www.codechef.com',
|
|
1791
|
-
},
|
|
1792
|
-
[exports.Judge.TOPCODER]: {
|
|
1793
|
-
value: exports.Judge.TOPCODER,
|
|
1794
|
-
label: 'Topcoder',
|
|
1795
|
-
logo: 'https://images.juki.pub/c/topcoder-logo-color.png',
|
|
1796
|
-
logoSize: [971.99, 415.99],
|
|
1797
|
-
url: 'https://www.topcoder.com',
|
|
1798
|
-
},
|
|
1799
|
-
[exports.Judge.LEETCODE]: {
|
|
1800
|
-
value: exports.Judge.LEETCODE,
|
|
1801
|
-
label: 'LeetCode',
|
|
1802
|
-
logo: 'https://images.juki.pub/assets/leetcode-logo-color.svg',
|
|
1803
|
-
logoSize: [95, 111],
|
|
1804
|
-
url: 'https://leetcode.com',
|
|
1805
|
-
// getProblemUrl: (problemKey: string) => {
|
|
1806
|
-
// return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}`;
|
|
1807
|
-
// },
|
|
1808
|
-
// getProfileUrl: (userNickname: string) => {
|
|
1809
|
-
// return `https://leetcode.com/u/${userNickname}`;
|
|
1810
|
-
// },
|
|
1811
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string, username: string, submissionRunId: string) => {
|
|
1812
|
-
// return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}/submissions/${submissionRunId}`;
|
|
1813
|
-
// },
|
|
1814
|
-
},
|
|
1815
|
-
};
|
|
1816
|
-
const RUNNER_ACCEPTED_PROBLEM_MODES = [
|
|
1817
|
-
exports.ProblemScoringMode.TOTAL,
|
|
1818
|
-
exports.ProblemScoringMode.SUBTASK,
|
|
1819
|
-
exports.ProblemScoringMode.PARTIAL,
|
|
1820
|
-
];
|
|
1821
|
-
const RUNNER_ACCEPTED_PROBLEM_TYPES = [
|
|
1822
|
-
exports.ProblemType.STANDARD,
|
|
1823
|
-
exports.ProblemType.DYNAMIC,
|
|
1824
|
-
];
|
|
1825
|
-
const RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES = [
|
|
1826
|
-
exports.CodeLanguage.C_11,
|
|
1827
|
-
exports.CodeLanguage.CPP_11,
|
|
1828
|
-
exports.CodeLanguage.CPP_20,
|
|
1829
|
-
exports.CodeLanguage.JAVA_21,
|
|
1830
|
-
exports.CodeLanguage.PYTHON_3,
|
|
1831
|
-
exports.CodeLanguage.PYTHON_PYPY_3,
|
|
1832
|
-
exports.CodeLanguage.JAVASCRIPT_NODE_JS_22,
|
|
1833
|
-
exports.CodeLanguage.PSEUDOCODE_PSEINT,
|
|
1834
|
-
];
|
|
1835
|
-
const ACCEPTED_PROGRAMMING_LANGUAGES = [
|
|
1836
|
-
...RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES,
|
|
1837
|
-
];
|
|
1838
|
-
const PROBLEM_VERDICT = {
|
|
1839
|
-
[exports.ProblemVerdict.NONE]: { value: exports.ProblemVerdict.NONE, label: 'none', color: '#555555' },
|
|
1840
|
-
[exports.ProblemVerdict.PENDING]: { value: exports.ProblemVerdict.PENDING, label: 'pending', color: '#79B6FD' },
|
|
1841
|
-
[exports.ProblemVerdict.HIDDEN]: { value: exports.ProblemVerdict.HIDDEN, label: 'hidden', color: '#555555' },
|
|
1842
|
-
[exports.ProblemVerdict.AC]: { value: exports.ProblemVerdict.AC, label: 'accepted', color: '#43D787' },
|
|
1843
|
-
[exports.ProblemVerdict.PE]: { value: exports.ProblemVerdict.PE, label: 'presentation error', color: '#55db93' },
|
|
1844
|
-
[exports.ProblemVerdict.PA]: { value: exports.ProblemVerdict.PA, label: 'partial accepted', color: '#55db93' },
|
|
1845
|
-
[exports.ProblemVerdict.CE]: { value: exports.ProblemVerdict.CE, label: 'compilation error', color: '#FE9F9F' },
|
|
1846
|
-
[exports.ProblemVerdict.RE]: { value: exports.ProblemVerdict.RE, label: 'runtime error', color: '#FE9F9F' },
|
|
1847
|
-
[exports.ProblemVerdict.TLE]: { value: exports.ProblemVerdict.TLE, label: 'time limit exceed', color: '#FE9F9F' },
|
|
1848
|
-
[exports.ProblemVerdict.MLE]: { value: exports.ProblemVerdict.MLE, label: 'memory limit exceed', color: '#FE9F9F' },
|
|
1849
|
-
[exports.ProblemVerdict.WA]: { value: exports.ProblemVerdict.WA, label: 'wrong answer', color: '#FE9F9F' },
|
|
1850
|
-
};
|
|
1851
|
-
const PROBLEM_VERDICTS = [
|
|
1852
|
-
exports.ProblemVerdict.NONE,
|
|
1853
|
-
exports.ProblemVerdict.PENDING,
|
|
1854
|
-
exports.ProblemVerdict.AC,
|
|
1855
|
-
exports.ProblemVerdict.PE,
|
|
1856
|
-
exports.ProblemVerdict.PA,
|
|
1857
|
-
exports.ProblemVerdict.CE,
|
|
1858
|
-
exports.ProblemVerdict.RE,
|
|
1859
|
-
exports.ProblemVerdict.TLE,
|
|
1860
|
-
exports.ProblemVerdict.MLE,
|
|
1861
|
-
exports.ProblemVerdict.WA,
|
|
1862
|
-
];
|
|
1863
|
-
const SUBMISSION_RUN_STATUS = {
|
|
1864
|
-
[exports.SubmissionRunStatus.NONE]: { value: exports.SubmissionRunStatus.NONE, label: 'none' }, // status
|
|
1865
|
-
[exports.SubmissionRunStatus.RECEIVED]: { value: exports.SubmissionRunStatus.RECEIVED, label: 'received' }, // state
|
|
1866
|
-
[exports.SubmissionRunStatus.COMPILING]: { value: exports.SubmissionRunStatus.COMPILING, label: 'compiling' }, // state
|
|
1867
|
-
[exports.SubmissionRunStatus.COMPILED]: { value: exports.SubmissionRunStatus.COMPILED, label: 'compiled' }, // status
|
|
1868
|
-
[exports.SubmissionRunStatus.COMPILATION_ERROR]: { value: exports.SubmissionRunStatus.COMPILATION_ERROR, label: 'compilation error' }, // status
|
|
1869
|
-
[exports.SubmissionRunStatus.FETCHING_TEST_CASES]: {
|
|
1870
|
-
value: exports.SubmissionRunStatus.FETCHING_TEST_CASES,
|
|
1871
|
-
label: 'fetching test cases',
|
|
1872
|
-
}, // state
|
|
1873
|
-
[exports.SubmissionRunStatus.RUNNING_TEST_CASE]: { value: exports.SubmissionRunStatus.RUNNING_TEST_CASE, label: 'running test case' }, // state
|
|
1874
|
-
[exports.SubmissionRunStatus.RUNNING_TEST_CASES]: {
|
|
1875
|
-
value: exports.SubmissionRunStatus.RUNNING_TEST_CASES,
|
|
1876
|
-
label: 'running test cases',
|
|
1877
|
-
}, // state
|
|
1878
|
-
[exports.SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES]: {
|
|
1879
|
-
value: exports.SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES,
|
|
1880
|
-
label: 'running sample cases',
|
|
1881
|
-
}, // state
|
|
1882
|
-
[exports.SubmissionRunStatus.EXECUTED_TEST_CASE]: {
|
|
1883
|
-
value: exports.SubmissionRunStatus.EXECUTED_TEST_CASE,
|
|
1884
|
-
label: 'executed test case',
|
|
1885
|
-
}, // status
|
|
1886
|
-
[exports.SubmissionRunStatus.FAILED_TEST_CASE]: { value: exports.SubmissionRunStatus.FAILED_TEST_CASE, label: 'failed test case' }, // status
|
|
1887
|
-
[exports.SubmissionRunStatus.JUDGING_TEST_CASE]: { value: exports.SubmissionRunStatus.JUDGING_TEST_CASE, label: 'judging test case' }, // state
|
|
1888
|
-
[exports.SubmissionRunStatus.GRADING]: { value: exports.SubmissionRunStatus.GRADING, label: 'grading' }, // status
|
|
1889
|
-
[exports.SubmissionRunStatus.FAILED]: { value: exports.SubmissionRunStatus.FAILED, label: 'failed' }, // status
|
|
1890
|
-
[exports.SubmissionRunStatus.COMPLETED]: { value: exports.SubmissionRunStatus.COMPLETED, label: 'completed' }, // status
|
|
1891
|
-
};
|
|
1892
|
-
const RUNNER_TYPE = {
|
|
1893
|
-
[exports.RunnerType.HIGH_PERFORMANCE]: { value: exports.RunnerType.HIGH_PERFORMANCE, label: 'high performance' },
|
|
1894
|
-
[exports.RunnerType.LOW_PERFORMANCE]: { value: exports.RunnerType.LOW_PERFORMANCE, label: 'low performance' },
|
|
1895
|
-
};
|
|
1896
|
-
|
|
1897
|
-
const PROBLEM_INPUT = {
|
|
1898
|
-
[exports.ProblemInput.STANDARD]: { value: exports.ProblemInput.STANDARD, label: 'standard' },
|
|
1899
|
-
[exports.ProblemInput.INTERACTIVE]: { value: exports.ProblemInput.INTERACTIVE, label: 'interactive' },
|
|
1900
|
-
};
|
|
1901
|
-
const PROBLEM_OUTPUT = {
|
|
1902
|
-
[exports.ProblemOutput.STANDARD]: { value: exports.ProblemOutput.STANDARD, label: 'standard' },
|
|
1903
|
-
[exports.ProblemOutput.DYNAMIC]: { value: exports.ProblemOutput.DYNAMIC, label: 'dynamic' },
|
|
1904
|
-
[exports.ProblemOutput.INTERACTIVE]: { value: exports.ProblemOutput.INTERACTIVE, label: 'interactive' },
|
|
1905
|
-
};
|
|
1906
|
-
const PROBLEM_MODES = [exports.ProblemScoringMode.TOTAL, exports.ProblemScoringMode.SUBTASK, exports.ProblemScoringMode.PARTIAL];
|
|
1907
|
-
const PROBLEM_MODE = {
|
|
1908
|
-
[exports.ProblemScoringMode.TOTAL]: {
|
|
1909
|
-
value: exports.ProblemScoringMode.TOTAL,
|
|
1910
|
-
label: 'total',
|
|
1911
|
-
description: 'if all test cases are Accepted the result is Accepted '
|
|
1912
|
-
+ 'otherwise it will be Runtime Error, Time Limited Exceeded, Memory Limited Exceeded, Wrong Answer or Presentation Error in that order.',
|
|
1913
|
-
},
|
|
1914
|
-
[exports.ProblemScoringMode.SUBTASK]: {
|
|
1915
|
-
value: exports.ProblemScoringMode.SUBTASK,
|
|
1916
|
-
label: 'subtask',
|
|
1917
|
-
description: 'the test cases are grouped and each group of test cases is assigned a score, '
|
|
1918
|
-
+ 'if all test cases in a group are Accepted then the score assigned to that group of test cases is added to total score, '
|
|
1919
|
-
+ 'if total score is equal to the sum of the assigned scores of all groups of test cases then the result is Accepted, '
|
|
1920
|
-
+ 'otherwise if the total score is greater than zero the result is Partial Accepted with the total accumulated score, '
|
|
1921
|
-
+ 'otherwise it will be Runtime Error, Time Limited Exceeded, Memory Limited Exceeded, Wrong Answer or Presentation Error in that order.',
|
|
1922
|
-
},
|
|
1923
|
-
[exports.ProblemScoringMode.PARTIAL]: {
|
|
1924
|
-
value: exports.ProblemScoringMode.PARTIAL,
|
|
1925
|
-
label: 'partial',
|
|
1926
|
-
description: 'the test cases are grouped and each group is associated with X points, '
|
|
1927
|
-
+ 'and each test case in a group scores X points ',
|
|
1928
|
-
},
|
|
1929
|
-
};
|
|
1930
|
-
const PROBLEM_TYPES = [exports.ProblemType.STANDARD, exports.ProblemType.DYNAMIC, exports.ProblemType.INTERACTIVE];
|
|
1931
|
-
const PROBLEM_TYPE = {
|
|
1932
|
-
[exports.ProblemType.STANDARD]: {
|
|
1933
|
-
value: exports.ProblemType.STANDARD,
|
|
1934
|
-
label: 'standard',
|
|
1935
|
-
description: 'The contestant submit a single source code in one of the allowed programming languages. '
|
|
1936
|
-
+ 'The source code is either standalone or to be compiled. '
|
|
1937
|
-
+ 'The resulting user\'s executable does I/O standard input and output. '
|
|
1938
|
-
+ 'The output produced by the contestant\'s program is then compared to the correct output using a simple diff algorithm.',
|
|
1939
|
-
},
|
|
1940
|
-
[exports.ProblemType.INTERACTIVE]: {
|
|
1941
|
-
value: exports.ProblemType.INTERACTIVE, label: 'interactive', description: 'developing..',
|
|
1942
|
-
},
|
|
1943
|
-
[exports.ProblemType.DYNAMIC]: {
|
|
1944
|
-
value: exports.ProblemType.DYNAMIC,
|
|
1945
|
-
label: 'dynamic',
|
|
1946
|
-
description: 'The contestant submit a single source code in one of the allowed programming languages. '
|
|
1947
|
-
+ 'The user\'s source code is either standalone or to be compiled. '
|
|
1948
|
-
+ 'The resulting user\'s executable does I/O standard input and output. '
|
|
1949
|
-
+ 'The output produced by the contestant\'s program is saved. '
|
|
1950
|
-
+ 'The problem editor save a single source code in C++ 17. '
|
|
1951
|
-
+ 'The editor\'s source code can read judge input filepath argv[1], judge output filepath argv[2], user\'s output filepath argv[3], user\'s error filepath argv[4], user\'s log filepath argv[5], user\'s source filepath argv[6] and submission information filepath argv[7] (companyId, submitId, runId, userId, contestId, problemId, language, userNickname, timestamp). '
|
|
1952
|
-
+ 'The resulting editor\'s executable should be "AC" or a number between 1 and 100 for partial accepted',
|
|
1953
|
-
},
|
|
1954
|
-
};
|
|
1955
|
-
const PROBLEM_ROLE = {
|
|
1956
|
-
[exports.Role.RESTRICTED]: { value: exports.Role.RESTRICTED, label: 'restricted', level: 7 },
|
|
1957
|
-
[exports.Role.GUEST]: { value: exports.Role.GUEST, label: 'guest', level: 6 },
|
|
1958
|
-
[exports.Role.REGULAR]: { value: exports.Role.REGULAR, label: 'regular', level: 5 },
|
|
1959
|
-
[exports.Role.CREATOR]: { value: exports.Role.CREATOR, label: 'creator', level: 4 },
|
|
1960
|
-
[exports.Role.MANAGER]: { value: exports.Role.MANAGER, label: 'manager', level: 3 },
|
|
1961
|
-
[exports.Role.MASTER]: { value: exports.Role.MASTER, label: 'master', level: 2 },
|
|
1962
|
-
[exports.Role.ADMIN]: { value: exports.Role.ADMIN, label: 'admin', level: 1 },
|
|
1963
|
-
[exports.Role.SUPER_ADMIN]: { value: exports.Role.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
1964
|
-
};
|
|
1965
|
-
|
|
1966
|
-
const _TYPE = ':type';
|
|
1967
|
-
const _KEY = ':key';
|
|
1968
|
-
const _TAB = ':tab';
|
|
1969
|
-
const _SUB_TAB = ':subTab?';
|
|
1970
|
-
const _SUB_SUB_TAB = ':subSubTab?';
|
|
1971
|
-
const PAGE = 'page';
|
|
1972
|
-
const PAGE_SIZE = 'size';
|
|
1973
|
-
|
|
1974
|
-
const ERROR = {
|
|
1975
|
-
// Http Errors
|
|
1976
|
-
[exports.ErrorCode.ERR500]: { value: exports.ErrorCode.ERR500, message: 'internal server error', status: 500 },
|
|
1977
|
-
[exports.ErrorCode.ERR400]: { value: exports.ErrorCode.ERR400, message: 'bad request', status: 400 },
|
|
1978
|
-
[exports.ErrorCode.ERR401]: { value: exports.ErrorCode.ERR401, message: 'unauthorized', status: 401 },
|
|
1979
|
-
[exports.ErrorCode.ERR403]: { value: exports.ErrorCode.ERR403, message: 'forbidden', status: 403 },
|
|
1980
|
-
[exports.ErrorCode.ERR404]: { value: exports.ErrorCode.ERR404, message: 'not found', status: 404 },
|
|
1981
|
-
[exports.ErrorCode.ERR405]: { value: exports.ErrorCode.ERR405, message: 'method not allowed', status: 405 },
|
|
1982
|
-
// UI general errors
|
|
1983
|
-
[exports.ErrorCode.ERR9997]: { value: exports.ErrorCode.ERR9997, message: 'aborted request', status: 400 },
|
|
1984
|
-
[exports.ErrorCode.ERR9998]: { value: exports.ErrorCode.ERR9998, message: 'error on response', status: 400 },
|
|
1985
|
-
[exports.ErrorCode.ERR9999]: { value: exports.ErrorCode.ERR9999, message: 'service no found', status: 400 },
|
|
1986
|
-
// ORGANIZATION ERRORS ERR99XX
|
|
1987
|
-
[exports.ErrorCode.ERR9900]: { value: exports.ErrorCode.ERR9900, message: 'internal server error on organization service', status: 500 },
|
|
1988
|
-
// Organization server errors
|
|
1989
|
-
[exports.ErrorCode.ERR9910]: { value: exports.ErrorCode.ERR9910, message: 'organization not created', status: 500 },
|
|
1990
|
-
[exports.ErrorCode.ERR9911]: { value: exports.ErrorCode.ERR9911, message: 'organization not found', status: 500 },
|
|
1991
|
-
[exports.ErrorCode.ERR9912]: { value: exports.ErrorCode.ERR9912, message: 'organization not updated', status: 500 },
|
|
1992
|
-
[exports.ErrorCode.ERR9913]: { value: exports.ErrorCode.ERR9913, message: 'organization not deleted', status: 500 },
|
|
1993
|
-
// Organization user permission error
|
|
1994
|
-
[exports.ErrorCode.ERR9914]: { value: exports.ErrorCode.ERR9914, message: 'not allowed to create the organization', status: 400 },
|
|
1995
|
-
[exports.ErrorCode.ERR9915]: { value: exports.ErrorCode.ERR9915, message: 'not allowed to view the organization', status: 400 },
|
|
1996
|
-
[exports.ErrorCode.ERR9916]: { value: exports.ErrorCode.ERR9916, message: 'not allowed to updated the organization', status: 400 },
|
|
1997
|
-
[exports.ErrorCode.ERR9917]: { value: exports.ErrorCode.ERR9917, message: 'not allowed to deleted the organization', status: 400 },
|
|
1998
|
-
// USER ERRORS ERR00XX
|
|
1999
|
-
[exports.ErrorCode.ERR0000]: { value: exports.ErrorCode.ERR0000, message: 'internal server error on users service', status: 500 },
|
|
2000
|
-
// User server errors
|
|
2001
|
-
[exports.ErrorCode.ERR0010]: { value: exports.ErrorCode.ERR0010, message: 'user not created', status: 500 },
|
|
2002
|
-
[exports.ErrorCode.ERR0011]: { value: exports.ErrorCode.ERR0011, message: 'user not found', status: 500 },
|
|
2003
|
-
[exports.ErrorCode.ERR0012]: { value: exports.ErrorCode.ERR0012, message: 'user not updated', status: 500 },
|
|
2004
|
-
[exports.ErrorCode.ERR0013]: { value: exports.ErrorCode.ERR0013, message: 'user not deleted', status: 500 },
|
|
2005
|
-
// User user permission error
|
|
2006
|
-
[exports.ErrorCode.ERR0014]: { value: exports.ErrorCode.ERR0014, message: 'not allowed to create the user', status: 400 },
|
|
2007
|
-
[exports.ErrorCode.ERR0015]: { value: exports.ErrorCode.ERR0015, message: 'not allowed to view the user', status: 400 },
|
|
2008
|
-
[exports.ErrorCode.ERR0016]: { value: exports.ErrorCode.ERR0016, message: 'not allowed to updated the user', status: 400 },
|
|
2009
|
-
[exports.ErrorCode.ERR0017]: { value: exports.ErrorCode.ERR0017, message: 'not allowed to deleted the user', status: 400 },
|
|
2010
|
-
// User status permissions errors
|
|
2011
|
-
[exports.ErrorCode.ERR0018]: { value: exports.ErrorCode.ERR0018, message: 'user is reported', status: 400 },
|
|
2012
|
-
[exports.ErrorCode.ERR0019]: { value: exports.ErrorCode.ERR0019, message: 'user is archived', status: 400 },
|
|
2013
|
-
// User others permissions errors
|
|
2014
|
-
[exports.ErrorCode.ERR0020]: { value: exports.ErrorCode.ERR0020, message: 'user with email requested not found', status: 400 },
|
|
2015
|
-
[exports.ErrorCode.ERR0021]: { value: exports.ErrorCode.ERR0021, message: 'user with nickname requested not found', status: 400 },
|
|
2016
|
-
[exports.ErrorCode.ERR0022]: { value: exports.ErrorCode.ERR0022, message: 'the email is already registered', status: 400 },
|
|
2017
|
-
[exports.ErrorCode.ERR0023]: { value: exports.ErrorCode.ERR0023, message: 'the nickname is already taken', status: 400 },
|
|
2018
|
-
[exports.ErrorCode.ERR0024]: { value: exports.ErrorCode.ERR0024, message: 'incorrect password', status: 400 },
|
|
2019
|
-
// User sessions errors
|
|
2020
|
-
[exports.ErrorCode.ERR0050]: { value: exports.ErrorCode.ERR0050, message: 'user session not created', status: 500 },
|
|
2021
|
-
[exports.ErrorCode.ERR0051]: { value: exports.ErrorCode.ERR0051, message: 'user session not found', status: 500 },
|
|
2022
|
-
[exports.ErrorCode.ERR0052]: { value: exports.ErrorCode.ERR0052, message: 'user session not updated', status: 500 },
|
|
2023
|
-
[exports.ErrorCode.ERR0053]: { value: exports.ErrorCode.ERR0053, message: 'user session not deleted', status: 500 },
|
|
2024
|
-
// PROBLEM ERRORS ERR01XX
|
|
2025
|
-
[exports.ErrorCode.ERR0100]: { value: exports.ErrorCode.ERR0100, message: 'internal server error on problems service', status: 500 },
|
|
2026
|
-
// Problem server errors
|
|
2027
|
-
[exports.ErrorCode.ERR0110]: { value: exports.ErrorCode.ERR0110, message: 'problem not created', status: 500 },
|
|
2028
|
-
[exports.ErrorCode.ERR0111]: { value: exports.ErrorCode.ERR0111, message: 'problem not found', status: 500 },
|
|
2029
|
-
[exports.ErrorCode.ERR0112]: { value: exports.ErrorCode.ERR0112, message: 'problem not updated', status: 500 },
|
|
2030
|
-
[exports.ErrorCode.ERR0113]: { value: exports.ErrorCode.ERR0113, message: 'problem not deleted', status: 500 },
|
|
2031
|
-
// Problem user permission error
|
|
2032
|
-
[exports.ErrorCode.ERR0114]: { value: exports.ErrorCode.ERR0114, message: 'not allowed to create the problem', status: 400 },
|
|
2033
|
-
[exports.ErrorCode.ERR0115]: { value: exports.ErrorCode.ERR0115, message: 'not allowed to view the problem', status: 400 },
|
|
2034
|
-
[exports.ErrorCode.ERR0116]: { value: exports.ErrorCode.ERR0116, message: 'not allowed to updated the problem', status: 400 },
|
|
2035
|
-
[exports.ErrorCode.ERR0117]: { value: exports.ErrorCode.ERR0117, message: 'not allowed to deleted the problem', status: 400 },
|
|
2036
|
-
// Problem others permissions errors
|
|
2037
|
-
[exports.ErrorCode.ERR0118]: { value: exports.ErrorCode.ERR0118, message: 'problem mode not supported', status: 500 },
|
|
2038
|
-
[exports.ErrorCode.ERR0119]: { value: exports.ErrorCode.ERR0119, message: 'problem type not supported', status: 500 },
|
|
2039
|
-
[exports.ErrorCode.ERR0120]: { value: exports.ErrorCode.ERR0120, message: 'problem time limit must be a number', status: 500 },
|
|
2040
|
-
[exports.ErrorCode.ERR0121]: { value: exports.ErrorCode.ERR0121, message: 'problem memory limit must be number', status: 500 },
|
|
2041
|
-
[exports.ErrorCode.ERR0122]: { value: exports.ErrorCode.ERR0122, message: 'test case file empty', status: 400 },
|
|
2042
|
-
// Contest Errors ERR02XX
|
|
2043
|
-
[exports.ErrorCode.ERR0200]: { value: exports.ErrorCode.ERR0200, message: 'internal server error on contests service', status: 500 },
|
|
2044
|
-
// Contest Server Error
|
|
2045
|
-
[exports.ErrorCode.ERR0210]: { value: exports.ErrorCode.ERR0210, message: 'contest not created', status: 500 },
|
|
2046
|
-
[exports.ErrorCode.ERR0211]: { value: exports.ErrorCode.ERR0211, message: 'contest not found', status: 500 },
|
|
2047
|
-
[exports.ErrorCode.ERR0212]: { value: exports.ErrorCode.ERR0212, message: 'contest not updated', status: 500 },
|
|
2048
|
-
[exports.ErrorCode.ERR0213]: { value: exports.ErrorCode.ERR0213, message: 'contest not deleted', status: 500 },
|
|
2049
|
-
// Contest User Permission error
|
|
2050
|
-
[exports.ErrorCode.ERR0214]: { value: exports.ErrorCode.ERR0214, message: 'not allowed to create the contest', status: 400 },
|
|
2051
|
-
[exports.ErrorCode.ERR0215]: { value: exports.ErrorCode.ERR0215, message: 'not allowed to view the contest', status: 400 },
|
|
2052
|
-
[exports.ErrorCode.ERR0216]: { value: exports.ErrorCode.ERR0216, message: 'not allowed to updated the contest', status: 400 },
|
|
2053
|
-
[exports.ErrorCode.ERR0217]: { value: exports.ErrorCode.ERR0217, message: 'not allowed to deleted the contest', status: 400 },
|
|
2054
|
-
// Contest Others permissions errors
|
|
2055
|
-
[exports.ErrorCode.ERR0218]: { value: exports.ErrorCode.ERR0218, message: 'not allowed to register to the contest', status: 400 },
|
|
2056
|
-
[exports.ErrorCode.ERR0219]: { value: exports.ErrorCode.ERR0219, message: 'is already registered', status: 400 },
|
|
2057
|
-
[exports.ErrorCode.ERR0220]: { value: exports.ErrorCode.ERR0220, message: 'not allowed to view contests', status: 400 },
|
|
2058
|
-
[exports.ErrorCode.ERR0230]: { value: exports.ErrorCode.ERR0230, message: 'scoreboard not created', status: 500 },
|
|
2059
|
-
[exports.ErrorCode.ERR0231]: { value: exports.ErrorCode.ERR0231, message: 'scoreboard not found', status: 500 },
|
|
2060
|
-
[exports.ErrorCode.ERR0232]: { value: exports.ErrorCode.ERR0232, message: 'scoreboard not updated', status: 500 },
|
|
2061
|
-
[exports.ErrorCode.ERR0233]: { value: exports.ErrorCode.ERR0233, message: 'scoreboard not deleted', status: 500 },
|
|
2062
|
-
[exports.ErrorCode.ERR0234]: { value: exports.ErrorCode.ERR0234, message: 'not allowed to create the scoreboard', status: 400 },
|
|
2063
|
-
[exports.ErrorCode.ERR0235]: { value: exports.ErrorCode.ERR0235, message: 'not allowed to view the scoreboard', status: 400 },
|
|
2064
|
-
[exports.ErrorCode.ERR0236]: { value: exports.ErrorCode.ERR0236, message: 'not allowed to update the scoreboard', status: 400 },
|
|
2065
|
-
[exports.ErrorCode.ERR0237]: { value: exports.ErrorCode.ERR0237, message: 'not allowed to delete the scoreboard', status: 400 },
|
|
2066
|
-
[exports.ErrorCode.ERR0240]: { value: exports.ErrorCode.ERR0240, message: 'clarification not created', status: 500 },
|
|
2067
|
-
[exports.ErrorCode.ERR0241]: { value: exports.ErrorCode.ERR0241, message: 'clarification not found', status: 500 },
|
|
2068
|
-
[exports.ErrorCode.ERR0242]: { value: exports.ErrorCode.ERR0242, message: 'clarification not updated', status: 500 },
|
|
2069
|
-
[exports.ErrorCode.ERR0243]: { value: exports.ErrorCode.ERR0243, message: 'clarification not deleted', status: 500 },
|
|
2070
|
-
[exports.ErrorCode.ERR0244]: { value: exports.ErrorCode.ERR0244, message: 'not allowed to submit clarification', status: 400 },
|
|
2071
|
-
[exports.ErrorCode.ERR0245]: { value: exports.ErrorCode.ERR0245, message: 'not allowed to view clarification', status: 400 },
|
|
2072
|
-
[exports.ErrorCode.ERR0246]: { value: exports.ErrorCode.ERR0246, message: 'not allowed to update clarification', status: 400 },
|
|
2073
|
-
[exports.ErrorCode.ERR0247]: { value: exports.ErrorCode.ERR0247, message: 'not allowed to delete clarification', status: 400 },
|
|
2074
|
-
// Submission Errors ERR03XXX
|
|
2075
|
-
[exports.ErrorCode.ERR0300]: {
|
|
2076
|
-
value: exports.ErrorCode.ERR0300,
|
|
2077
|
-
message: 'internal server error on submissions service',
|
|
2078
|
-
status: 500,
|
|
2079
|
-
},
|
|
2080
|
-
[exports.ErrorCode.ERR0301]: { value: exports.ErrorCode.ERR0301, message: 'submission not found', status: 500 },
|
|
2081
|
-
[exports.ErrorCode.ERR0302]: { value: exports.ErrorCode.ERR0302, message: 'submission not created', status: 500 },
|
|
2082
|
-
[exports.ErrorCode.ERR0303]: { value: exports.ErrorCode.ERR0303, message: 'submission not updated', status: 500 },
|
|
2083
|
-
[exports.ErrorCode.ERR0310]: { value: exports.ErrorCode.ERR0310, message: 'source empty', status: 400 },
|
|
2084
|
-
[exports.ErrorCode.ERR0311]: { value: exports.ErrorCode.ERR0311, message: 'programming language not supported', status: 400 },
|
|
2085
|
-
[exports.ErrorCode.ERR0321]: {
|
|
2086
|
-
value: exports.ErrorCode.ERR0321,
|
|
2087
|
-
message: 'not allowed submit the problem in the contest',
|
|
2088
|
-
status: 400,
|
|
2089
|
-
},
|
|
2090
|
-
[exports.ErrorCode.ERR0331]: { value: exports.ErrorCode.ERR0331, message: 'judgement unavailable', status: 400 },
|
|
2091
|
-
// Utils Errors ERR04XX
|
|
2092
|
-
[exports.ErrorCode.ERR0400]: { value: exports.ErrorCode.ERR0400, message: 'internal server error on utils services', status: 500 },
|
|
2093
|
-
[exports.ErrorCode.ERR0410]: { value: exports.ErrorCode.ERR0410, message: 'empty image', status: 400 },
|
|
2094
|
-
[exports.ErrorCode.ERR0420]: { value: exports.ErrorCode.ERR0420, message: '', status: 400 }, // codes
|
|
2095
|
-
[exports.ErrorCode.ERR0421]: { value: exports.ErrorCode.ERR0421, message: 'compilation failed', status: 400 }, // codes
|
|
2096
|
-
[exports.ErrorCode.ERR0430]: { value: exports.ErrorCode.ERR0430, message: '', status: 400 }, // files
|
|
2097
|
-
[exports.ErrorCode.ERR0440]: { value: exports.ErrorCode.ERR0440, message: 'the email could not be sent', status: 400 }, // mails
|
|
2098
|
-
// TEAMS ERRORS ERR06XX
|
|
2099
|
-
[exports.ErrorCode.ERR0600]: { value: exports.ErrorCode.ERR0600, message: 'internal server error on teams service', status: 500 },
|
|
2100
|
-
// Teams server errors
|
|
2101
|
-
[exports.ErrorCode.ERR0610]: { value: exports.ErrorCode.ERR0610, message: 'team not created', status: 400 },
|
|
2102
|
-
[exports.ErrorCode.ERR0611]: { value: exports.ErrorCode.ERR0611, message: 'team not found', status: 400 },
|
|
2103
|
-
[exports.ErrorCode.ERR0612]: { value: exports.ErrorCode.ERR0612, message: 'team not updated', status: 400 },
|
|
2104
|
-
[exports.ErrorCode.ERR0613]: { value: exports.ErrorCode.ERR0613, message: 'team not deleted', status: 400 },
|
|
2105
|
-
// Teams user permission error
|
|
2106
|
-
[exports.ErrorCode.ERR0614]: { value: exports.ErrorCode.ERR0614, message: 'not allowed to create the team', status: 400 },
|
|
2107
|
-
[exports.ErrorCode.ERR0615]: { value: exports.ErrorCode.ERR0615, message: 'not allowed to view the team', status: 400 },
|
|
2108
|
-
[exports.ErrorCode.ERR0616]: { value: exports.ErrorCode.ERR0616, message: 'not allowed to updated the team', status: 400 },
|
|
2109
|
-
[exports.ErrorCode.ERR0617]: { value: exports.ErrorCode.ERR0617, message: 'not allowed to deleted the team', status: 400 },
|
|
2110
|
-
// Teams status permission error
|
|
2111
|
-
[exports.ErrorCode.ERR0618]: { value: exports.ErrorCode.ERR0618, message: 'team is reported', status: 400 },
|
|
2112
|
-
[exports.ErrorCode.ERR0619]: { value: exports.ErrorCode.ERR0619, message: 'team is archived', status: 400 },
|
|
2113
|
-
// FILES ERRORS ERR08XX
|
|
2114
|
-
[exports.ErrorCode.ERR0800]: { value: exports.ErrorCode.ERR0800, message: 'internal server error on files service', status: 500 },
|
|
2115
|
-
// Files server errors
|
|
2116
|
-
[exports.ErrorCode.ERR0810]: { value: exports.ErrorCode.ERR0810, message: 'file not created', status: 400 },
|
|
2117
|
-
[exports.ErrorCode.ERR0811]: { value: exports.ErrorCode.ERR0811, message: 'file not found', status: 400 },
|
|
2118
|
-
[exports.ErrorCode.ERR0812]: { value: exports.ErrorCode.ERR0812, message: 'file not updated', status: 400 },
|
|
2119
|
-
[exports.ErrorCode.ERR0813]: { value: exports.ErrorCode.ERR0813, message: 'file not deleted', status: 400 },
|
|
2120
|
-
// Files user permission error
|
|
2121
|
-
[exports.ErrorCode.ERR0814]: { value: exports.ErrorCode.ERR0814, message: 'not allowed to create the file', status: 400 },
|
|
2122
|
-
[exports.ErrorCode.ERR0815]: { value: exports.ErrorCode.ERR0815, message: 'not allowed to view the file', status: 400 },
|
|
2123
|
-
[exports.ErrorCode.ERR0816]: { value: exports.ErrorCode.ERR0816, message: 'not allowed to updated the file', status: 400 },
|
|
2124
|
-
[exports.ErrorCode.ERR0817]: { value: exports.ErrorCode.ERR0817, message: 'not allowed to deleted the file', status: 400 },
|
|
2125
|
-
// Files status permission error
|
|
2126
|
-
[exports.ErrorCode.ERR0818]: { value: exports.ErrorCode.ERR0818, message: 'file is reserved', status: 400 },
|
|
2127
|
-
[exports.ErrorCode.ERR0819]: { value: exports.ErrorCode.ERR0819, message: 'file is private', status: 400 },
|
|
2128
|
-
[exports.ErrorCode.ERR0820]: { value: exports.ErrorCode.ERR0820, message: 'file is archived', status: 400 },
|
|
2129
|
-
};
|
|
2130
|
-
|
|
2131
|
-
const FILE_TYPE = {
|
|
2132
|
-
[exports.FileType.FILE]: { value: exports.FileType.FILE, label: 'file' },
|
|
2133
|
-
[exports.FileType.FOLDER]: { value: exports.FileType.FOLDER, label: 'folder' },
|
|
2134
|
-
};
|
|
2135
|
-
const FILE_ROLE = {
|
|
2136
|
-
[exports.Role.RESTRICTED]: { value: exports.Role.RESTRICTED, label: 'restricted', level: 5 },
|
|
2137
|
-
[exports.Role.GUEST]: { value: exports.Role.GUEST, label: 'guest', level: 4 },
|
|
2138
|
-
[exports.Role.REGULAR]: { value: exports.Role.REGULAR, label: 'regular', level: 3 },
|
|
2139
|
-
[exports.Role.MASTER]: { value: exports.Role.MASTER, label: 'master', level: 2 },
|
|
2140
|
-
[exports.Role.ADMIN]: { value: exports.Role.ADMIN, label: 'admin', level: 1 },
|
|
2141
|
-
[exports.Role.SUPER_ADMIN]: { value: exports.Role.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
2142
|
-
};
|
|
2143
|
-
const ENTITY_STATE = {
|
|
2144
|
-
[exports.EntityState.RELEASED]: {
|
|
2145
|
-
value: exports.EntityState.RELEASED,
|
|
2146
|
-
label: 'released',
|
|
2147
|
-
},
|
|
2148
|
-
[exports.EntityState.ARCHIVED]: {
|
|
2149
|
-
value: exports.EntityState.ARCHIVED,
|
|
2150
|
-
label: 'archived',
|
|
2151
|
-
},
|
|
2152
|
-
};
|
|
2153
|
-
const ENTITY_ACCESS = {
|
|
2154
|
-
[exports.EntityAccess.PRIVATE]: {
|
|
2155
|
-
value: exports.EntityAccess.PRIVATE,
|
|
2156
|
-
label: 'private',
|
|
2157
|
-
description: 'the record will be visible and editable only to the owner',
|
|
2158
|
-
},
|
|
2159
|
-
[exports.EntityAccess.RESTRICTED]: {
|
|
2160
|
-
value: exports.EntityAccess.RESTRICTED,
|
|
2161
|
-
label: 'restricted',
|
|
2162
|
-
description: 'the record will be visible to viewers and the owner and editable to editors and the owner',
|
|
2163
|
-
},
|
|
2164
|
-
[exports.EntityAccess.PUBLIC]: {
|
|
2165
|
-
value: exports.EntityAccess.PUBLIC,
|
|
2166
|
-
label: 'public',
|
|
2167
|
-
description: 'the record will be visible to anyone and editable to editors and the owner',
|
|
2168
|
-
},
|
|
2169
|
-
[exports.EntityAccess.EXPOSED]: {
|
|
2170
|
-
value: exports.EntityAccess.EXPOSED,
|
|
2171
|
-
label: 'exposed',
|
|
2172
|
-
description: 'the record will be visible and editable to anyone',
|
|
2173
|
-
},
|
|
2174
|
-
};
|
|
2175
|
-
|
|
2176
|
-
const SYSTEM_ROLE = {
|
|
2177
|
-
[SystemRole.GUEST]: { value: SystemRole.GUEST, label: 'guest', level: 5 },
|
|
2178
|
-
[SystemRole.REGULAR]: { value: SystemRole.REGULAR, label: 'regular', level: 4 },
|
|
2179
|
-
[SystemRole.MANAGER]: { value: SystemRole.MANAGER, label: 'manager', level: 3 },
|
|
2180
|
-
[SystemRole.MASTER]: { value: SystemRole.MASTER, label: 'master', level: 2 },
|
|
2181
|
-
[SystemRole.ADMIN]: { value: SystemRole.ADMIN, label: 'admin', level: 1 },
|
|
2182
|
-
[SystemRole.SUPER_ADMIN]: { value: SystemRole.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
2183
|
-
};
|
|
2184
|
-
|
|
2185
|
-
const MEMBER_ROLE = {
|
|
2186
|
-
[MemberRole.COACH]: { value: MemberRole.COACH, label: 'coach' },
|
|
2187
|
-
[MemberRole.CO_COACH]: { value: MemberRole.CO_COACH, label: 'co-coach' },
|
|
2188
|
-
[MemberRole.STAFF]: { value: MemberRole.STAFF, label: 'staff' },
|
|
2189
|
-
[MemberRole.ATTENDEE]: { value: MemberRole.ATTENDEE, label: 'attendee' },
|
|
2190
|
-
[MemberRole.RESERVE]: { value: MemberRole.RESERVE, label: 'reserve' },
|
|
2191
|
-
[MemberRole.CONTESTANT]: { value: MemberRole.CONTESTANT, label: 'contestant' },
|
|
2192
|
-
};
|
|
2193
|
-
const TEAM_ROLE = {
|
|
2194
|
-
[TeamRole.RESTRICTED]: { value: TeamRole.RESTRICTED, label: 'restricted', level: 5 },
|
|
2195
|
-
[TeamRole.GUEST]: { value: TeamRole.GUEST, label: 'guest', level: 4 },
|
|
2196
|
-
[TeamRole.REGULAR]: { value: TeamRole.REGULAR, label: 'regular', level: 3 },
|
|
2197
|
-
[TeamRole.MANAGER]: { value: TeamRole.MANAGER, label: 'manager', level: 2 },
|
|
2198
|
-
[TeamRole.ADMIN]: { value: TeamRole.ADMIN, label: 'admin', level: 1 },
|
|
2199
|
-
[TeamRole.SUPER_ADMIN]: { value: TeamRole.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
2200
|
-
};
|
|
2201
|
-
|
|
2202
|
-
const ONE_SECOND = 1000;
|
|
2203
|
-
const SEC_30 = ONE_SECOND * 30;
|
|
2204
|
-
const SEC_60 = ONE_SECOND * 60;
|
|
2205
|
-
const SEC_90 = ONE_SECOND * 90;
|
|
2206
|
-
const SEC_120 = ONE_SECOND * 120;
|
|
2207
|
-
const ONE_MINUTE = ONE_SECOND * 60;
|
|
2208
|
-
const ONE_HOUR = ONE_MINUTE * 60;
|
|
2209
|
-
const ONE_DAY = ONE_HOUR * 24;
|
|
2210
|
-
const ONE_WEEK = ONE_DAY * 7;
|
|
2211
|
-
|
|
2212
|
-
const USER_STATUS = {
|
|
2213
|
-
[UserStatus.ACTIVE]: { value: UserStatus.ACTIVE, label: 'active' },
|
|
2214
|
-
[UserStatus.REPORTED]: { value: UserStatus.REPORTED, label: 'reported' },
|
|
2215
|
-
[UserStatus.ARCHIVED]: { value: UserStatus.ARCHIVED, label: 'archived' },
|
|
2216
|
-
};
|
|
2217
|
-
const USER_ROLE = {
|
|
2218
|
-
[UserRole.RESTRICTED]: { value: UserRole.RESTRICTED, label: 'restricted', level: 6 },
|
|
2219
|
-
[UserRole.GUEST]: { value: UserRole.GUEST, label: 'guest', level: 5 },
|
|
2220
|
-
[UserRole.LIMITED]: { value: UserRole.LIMITED, label: 'limited', level: 4 },
|
|
2221
|
-
[UserRole.REGULAR]: { value: UserRole.REGULAR, label: 'regular', level: 3 },
|
|
2222
|
-
[UserRole.MANAGER]: { value: UserRole.MANAGER, label: 'manager', level: 2 },
|
|
2223
|
-
[UserRole.ADMIN]: { value: UserRole.ADMIN, label: 'admin', level: 1 },
|
|
2224
|
-
[UserRole.SUPER_ADMIN]: { value: UserRole.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
2225
|
-
};
|
|
2226
|
-
const EMPTY_USER_PERMISSIONS = {
|
|
2227
|
-
users: {
|
|
2228
|
-
create: false,
|
|
2229
|
-
manage: false,
|
|
2230
|
-
administrate: false,
|
|
2231
|
-
},
|
|
2232
|
-
problems: {
|
|
2233
|
-
create: false,
|
|
2234
|
-
manage: false,
|
|
2235
|
-
},
|
|
2236
|
-
submissions: {
|
|
2237
|
-
manage: false,
|
|
2238
|
-
},
|
|
2239
|
-
contests: {
|
|
2240
|
-
create: false,
|
|
2241
|
-
manage: false,
|
|
2242
|
-
},
|
|
2243
|
-
organization: {
|
|
2244
|
-
manage: false,
|
|
2245
|
-
administrate: false,
|
|
2246
|
-
},
|
|
2247
|
-
services: {
|
|
2248
|
-
administrate: false,
|
|
2249
|
-
},
|
|
2250
|
-
};
|
|
2251
|
-
|
|
2252
|
-
// TOPIC channels
|
|
2253
|
-
// The backend publishes each event once on the channel of its topic and Ably does the fan-out.
|
|
2254
|
-
// Who can subscribe to each channel is decided by the API in the Ably token (capability), never by the client.
|
|
2255
|
-
// Dynamic segments are encoded so a key can never inject a `:` (the Ably segment separator used by the wildcards).
|
|
2256
|
-
const segment = (value) => encodeURIComponent(value);
|
|
2257
|
-
/** private: events of one session (code runs, requested data) */
|
|
2258
|
-
const CHANNEL_SESSION = (sessionId) => `session:${segment(sessionId)}`;
|
|
2259
|
-
/** private: events of one user (own submissions while the contest is frozen, notifications, own problem crawls) */
|
|
2260
|
-
const CHANNEL_USER = (userId) => `user:${segment(userId)}`;
|
|
2261
|
-
/** per role: public events of one user (judging of its submissions visible to everyone, see `UserChannelRole`) */
|
|
2262
|
-
const CHANNEL_USER_ROLE = (userId, role) => `user:${segment(userId)}:${role}`;
|
|
2263
|
-
/** public: status of a submission when it is visible to everyone */
|
|
2264
|
-
const CHANNEL_SUBMISSION = (submitId) => `submission:${segment(submitId)}`;
|
|
2265
|
-
/** per role: events of a problem for one role (judging of its submissions, see `ProblemChannelRole`) */
|
|
2266
|
-
const CHANNEL_PROBLEM = (problemKey, role) => `problem:${segment(problemKey)}:${role}`;
|
|
2267
|
-
/** per role: events of a contest for one role (and the roles above it, see `ContestChannelRole`) */
|
|
2268
|
-
const CHANNEL_CONTEST = (contestKey, role) => `contest:${segment(contestKey)}:${role}`;
|
|
2269
|
-
/**
|
|
2270
|
-
* presence of the clients (tabs) of the logged users of a organization (by its key), data: `UserPresenceData`.
|
|
2271
|
-
* The clients only enter (capability `presence`), only the administrators of the organization receive it
|
|
2272
|
-
* (capability `presence-subscribe`). Ably limits the presence members per channel (200 by default,
|
|
2273
|
-
* more with server-side batching enabled on the `presence` namespace).
|
|
2274
|
-
* The identity of a member is its `clientId` (`sessionId|uiId`, verified by Ably), never its data.
|
|
2275
|
-
*/
|
|
2276
|
-
const CHANNEL_ORGANIZATION_PRESENCE = (organizationKey) => `presence:organization:${segment(organizationKey)}`;
|
|
2277
|
-
// capability resources (wildcards) of the public channels.
|
|
2278
|
-
// Ably: a trailing `*` replaces one or more segments, any other `*` exactly one segment. So `user:*:spectators`
|
|
2279
|
-
// matches every `user:{userId}:spectators` but never the private `user:{userId}`.
|
|
2280
|
-
// There is no public `problem:*`: it would also match the role channels `problem:{problemKey}:{role}`.
|
|
2281
|
-
const CHANNEL_SUBMISSION_ALL = 'submission:*';
|
|
2282
|
-
const CHANNEL_USER_SPECTATORS_ALL = `user:*:${exports.UserChannelRole.SPECTATORS}`;
|
|
2283
|
-
/**
|
|
2284
|
-
* Returns the contest and role of a `CHANNEL_CONTEST` channel name, or null if it is not one.
|
|
2285
|
-
*/
|
|
2286
|
-
const getContestChannelParams = (channel) => {
|
|
2287
|
-
const [namespace, contestKey, role, ...rest] = channel.split(':');
|
|
2288
|
-
if (namespace !== 'contest' || !contestKey || rest.length || !Object.values(exports.ContestChannelRole).includes(role)) {
|
|
2289
|
-
return null;
|
|
2290
|
-
}
|
|
2291
|
-
return { contestKey: decodeURIComponent(contestKey), role: role };
|
|
2292
|
-
};
|
|
2293
|
-
/**
|
|
2294
|
-
* Returns the problem and role of a `CHANNEL_PROBLEM` channel name, or null if it is not one.
|
|
2295
|
-
*/
|
|
2296
|
-
const getProblemChannelParams = (channel) => {
|
|
2297
|
-
const [namespace, problemKey, role, ...rest] = channel.split(':');
|
|
2298
|
-
if (namespace !== 'problem' || !problemKey || rest.length || !Object.values(exports.ProblemChannelRole).includes(role)) {
|
|
2299
|
-
return null;
|
|
2300
|
-
}
|
|
2301
|
-
return { problemKey: decodeURIComponent(problemKey), role: role };
|
|
2302
|
-
};
|
|
2303
|
-
|
|
2304
|
-
const NEW_PAGE_SHEET = () => ({
|
|
2305
|
-
id: uuid.v4(),
|
|
2306
|
-
type: exports.WorksheetType.NEW_PAGE,
|
|
2307
|
-
title: '',
|
|
2308
|
-
points: 0,
|
|
2309
|
-
});
|
|
2310
|
-
const ASPECT_RATIO = {
|
|
2311
|
-
[exports.AspectRatio.RATIO_21_9]: {
|
|
2312
|
-
aspectRatio: exports.AspectRatio.RATIO_21_9,
|
|
2313
|
-
width: 2520,
|
|
2314
|
-
height: 1080,
|
|
2315
|
-
decimal: 21 / 9,
|
|
2316
|
-
label: 'ultrawide',
|
|
2317
|
-
},
|
|
2318
|
-
[exports.AspectRatio.RATIO_20_9]: {
|
|
2319
|
-
aspectRatio: exports.AspectRatio.RATIO_20_9,
|
|
2320
|
-
width: 2400,
|
|
2321
|
-
height: 1080,
|
|
2322
|
-
decimal: 20 / 9,
|
|
2323
|
-
label: 'mobile wide',
|
|
2324
|
-
},
|
|
2325
|
-
[exports.AspectRatio.RATIO_16_9]: {
|
|
2326
|
-
aspectRatio: exports.AspectRatio.RATIO_16_9,
|
|
2327
|
-
width: 1920,
|
|
2328
|
-
height: 1080,
|
|
2329
|
-
decimal: 16 / 9,
|
|
2330
|
-
label: 'widescreen',
|
|
2331
|
-
},
|
|
2332
|
-
[exports.AspectRatio.RATIO_16_10]: {
|
|
2333
|
-
aspectRatio: exports.AspectRatio.RATIO_16_10,
|
|
2334
|
-
width: 1920,
|
|
2335
|
-
height: 1200,
|
|
2336
|
-
decimal: 16 / 10,
|
|
2337
|
-
label: 'widescreen tall',
|
|
2338
|
-
},
|
|
2339
|
-
[exports.AspectRatio.RATIO_3_2]: {
|
|
2340
|
-
aspectRatio: exports.AspectRatio.RATIO_3_2,
|
|
2341
|
-
width: 1440,
|
|
2342
|
-
height: 960,
|
|
2343
|
-
decimal: 3 / 2,
|
|
2344
|
-
label: 'balanced',
|
|
2345
|
-
},
|
|
2346
|
-
[exports.AspectRatio.RATIO_4_3]: {
|
|
2347
|
-
aspectRatio: exports.AspectRatio.RATIO_4_3,
|
|
2348
|
-
width: 1024,
|
|
2349
|
-
height: 768,
|
|
2350
|
-
decimal: 4 / 3,
|
|
2351
|
-
label: 'standard',
|
|
2352
|
-
},
|
|
2353
|
-
[exports.AspectRatio.RATIO_5_4]: {
|
|
2354
|
-
aspectRatio: exports.AspectRatio.RATIO_5_4,
|
|
2355
|
-
width: 1280,
|
|
2356
|
-
height: 1024,
|
|
2357
|
-
decimal: 5 / 4,
|
|
2358
|
-
label: 'square old',
|
|
2359
|
-
},
|
|
2360
|
-
[exports.AspectRatio.RATIO_1_1]: {
|
|
2361
|
-
aspectRatio: exports.AspectRatio.RATIO_1_1,
|
|
2362
|
-
width: 1000,
|
|
2363
|
-
height: 1000,
|
|
2364
|
-
decimal: 1,
|
|
2365
|
-
label: 'square',
|
|
2366
|
-
},
|
|
2367
|
-
};
|
|
2368
|
-
|
|
2369
|
-
exports.ContestProblemBlockedByType = void 0;
|
|
2370
|
-
(function (ContestProblemBlockedByType) {
|
|
2371
|
-
ContestProblemBlockedByType["UNMET_PREREQUISITES"] = "UNMET_PREREQUISITES";
|
|
2372
|
-
ContestProblemBlockedByType["MAX_ACCEPTED_SUBMISSIONS_ACHIEVED"] = "MAX_ACCEPTED_SUBMISSIONS_ACHIEVED";
|
|
2373
|
-
ContestProblemBlockedByType["START_TIME_IN_THE_FUTURE"] = "START_TIME_IN_THE_FUTURE";
|
|
2374
|
-
ContestProblemBlockedByType["END_TIME_IN_THE_PAST"] = "END_TIME_IN_THE_PAST";
|
|
2375
|
-
})(exports.ContestProblemBlockedByType || (exports.ContestProblemBlockedByType = {}));
|
|
2376
|
-
|
|
2377
|
-
exports.MemberType = void 0;
|
|
2378
|
-
(function (MemberType) {
|
|
2379
|
-
MemberType["USER"] = "USER";
|
|
2380
|
-
MemberType["TEAM"] = "TEAM";
|
|
2381
|
-
})(exports.MemberType || (exports.MemberType = {}));
|
|
2382
|
-
|
|
2383
|
-
const isWorksheetAssignment = (assignment) => {
|
|
2384
|
-
return assignment.type === exports.AssignmentClass.WORKSHEET;
|
|
2385
|
-
};
|
|
2386
|
-
const isCourseAssignment = (assignment) => {
|
|
2387
|
-
return assignment.type === exports.AssignmentClass.COURSE;
|
|
2388
|
-
};
|
|
2389
|
-
const isContestAssignment = (assignment) => {
|
|
2390
|
-
return assignment.type === exports.AssignmentClass.CONTEST;
|
|
2391
|
-
};
|
|
2392
|
-
|
|
2393
|
-
const getAssignmentCommentKey = (classKey, cycleKey, sessionKey, assignmentKey) => `class:${classKey}|cycle:${cycleKey}|session:${sessionKey}|assignment:${assignmentKey}`;
|
|
2394
|
-
const getAssignmentUserCommentKey = (classKey, cycleKey, sessionKey, assignmentKey, userNickname, userOrganization) => `class:${classKey}|cycle:${cycleKey}|session:${sessionKey}|assignment:${assignmentKey}|user_nickname:${userNickname}|user_organization:${userOrganization}`;
|
|
2395
|
-
const getProblemCommentKey = (problemKey) => `problem:${problemKey}`;
|
|
2396
|
-
const getContestCommentKey = (contestKey) => `contest:${contestKey}`;
|
|
2397
|
-
|
|
2398
|
-
const isEndlessContest = (settings) => {
|
|
2399
|
-
return settings?.startsAt === MIN_DATE.getTime()
|
|
2400
|
-
&& settings?.frozenAt === MAX_DATE.getTime()
|
|
2401
|
-
&& settings?.silencedAt === MAX_DATE.getTime()
|
|
2402
|
-
&& settings?.endsAt === MAX_DATE.getTime()
|
|
2403
|
-
&& settings?.penalty === 0;
|
|
2404
|
-
};
|
|
2405
|
-
const isGlobalContest = (settings) => {
|
|
2406
|
-
return settings?.startsAt === 0
|
|
2407
|
-
&& settings?.frozenAt === 0
|
|
2408
|
-
&& settings?.silencedAt === 0
|
|
2409
|
-
&& settings?.endsAt === 0
|
|
2410
|
-
&& settings?.penalty === 0;
|
|
2411
|
-
};
|
|
2412
|
-
const isPastContest = (settings) => {
|
|
2413
|
-
return Date.now() > (settings?.endsAt ?? 0);
|
|
2414
|
-
};
|
|
2415
|
-
const isFutureContest = (settings) => {
|
|
2416
|
-
return (settings?.startsAt ?? 0) > Date.now();
|
|
2417
|
-
};
|
|
2418
|
-
|
|
2419
|
-
const changeYear = (date, year) => {
|
|
2420
|
-
const newDate = new Date(date);
|
|
2421
|
-
newDate.setFullYear(year);
|
|
2422
|
-
return newDate;
|
|
2423
|
-
};
|
|
2424
|
-
const changeMonth = (date, monthIndex) => {
|
|
2425
|
-
const newDate = new Date(date);
|
|
2426
|
-
newDate.setMonth(monthIndex);
|
|
2427
|
-
return newDate;
|
|
2428
|
-
};
|
|
2429
|
-
const changeDay = (date, day) => {
|
|
2430
|
-
const newDate = new Date(date);
|
|
2431
|
-
newDate.setDate(day);
|
|
2432
|
-
return newDate;
|
|
2433
|
-
};
|
|
2434
|
-
const changeHours = (date, hours) => {
|
|
2435
|
-
const newDate = new Date(date);
|
|
2436
|
-
newDate.setHours(hours);
|
|
2437
|
-
return newDate;
|
|
2438
|
-
};
|
|
2439
|
-
const changeMinutes = (date, minutes) => {
|
|
2440
|
-
const newDate = new Date(date);
|
|
2441
|
-
newDate.setMinutes(minutes);
|
|
2442
|
-
return newDate;
|
|
2443
|
-
};
|
|
2444
|
-
const changeSeconds = (date, seconds) => {
|
|
2445
|
-
const newDate = new Date(date);
|
|
2446
|
-
newDate.setSeconds(seconds);
|
|
2447
|
-
return newDate;
|
|
2448
|
-
};
|
|
2449
|
-
const changeMilliseconds = (date, milliseconds) => {
|
|
2450
|
-
const newDate = new Date(date);
|
|
2451
|
-
newDate.setMilliseconds(milliseconds);
|
|
2452
|
-
return newDate;
|
|
2453
|
-
};
|
|
2454
|
-
const decreaseYear = (date, count = 1) => changeYear(date, date.getFullYear() - count);
|
|
2455
|
-
const increaseYear = (date, count = 1) => changeYear(date, date.getFullYear() + count);
|
|
2456
|
-
const decreaseMonth = (date) => {
|
|
2457
|
-
const newDate = new Date(date);
|
|
2458
|
-
newDate.setMonth(newDate.getMonth() - 1);
|
|
2459
|
-
return newDate;
|
|
2460
|
-
};
|
|
2461
|
-
const increaseMonth = (date) => {
|
|
2462
|
-
const newDate = new Date(date);
|
|
2463
|
-
newDate.setMonth(newDate.getMonth() + 1);
|
|
2464
|
-
return newDate;
|
|
2465
|
-
};
|
|
2466
|
-
const decreaseDay = (date) => {
|
|
2467
|
-
const newDate = new Date(date);
|
|
2468
|
-
newDate.setDate(newDate.getDate() - 1);
|
|
2469
|
-
return newDate;
|
|
2470
|
-
};
|
|
2471
|
-
const increaseDay = (date) => {
|
|
2472
|
-
const newDate = new Date(date);
|
|
2473
|
-
newDate.setDate(newDate.getDate() + 1);
|
|
2474
|
-
return newDate;
|
|
2475
|
-
};
|
|
2476
|
-
const startOfDay = (date) => {
|
|
2477
|
-
const newDate = new Date(date);
|
|
2478
|
-
newDate.setHours(0, 0, 0, 0);
|
|
2479
|
-
return newDate;
|
|
2480
|
-
};
|
|
2481
|
-
const endOfDay = (date) => {
|
|
2482
|
-
const newDate = new Date(date);
|
|
2483
|
-
newDate.setHours(23, 59, 59, 999);
|
|
2484
|
-
return newDate;
|
|
2485
|
-
};
|
|
2486
|
-
const startOfMonth = (date) => {
|
|
2487
|
-
const newDate = new Date(date);
|
|
2488
|
-
newDate.setDate(1);
|
|
2489
|
-
return startOfDay(newDate);
|
|
2490
|
-
};
|
|
2491
|
-
const endOfMonth = (date) => {
|
|
2492
|
-
const nextMonth = startOfMonth(increaseMonth(date));
|
|
2493
|
-
return new Date(nextMonth.getTime() - 1);
|
|
2494
|
-
};
|
|
2495
|
-
const startOfYear = (date) => {
|
|
2496
|
-
const newDate = new Date(date);
|
|
2497
|
-
newDate.setMonth(0);
|
|
2498
|
-
return startOfMonth(newDate);
|
|
2499
|
-
};
|
|
2500
|
-
const endOfYear = (date) => {
|
|
2501
|
-
const nextYear = startOfYear(increaseYear(date));
|
|
2502
|
-
return new Date(nextYear.getTime() - 1);
|
|
2503
|
-
};
|
|
2504
|
-
const startOfWeek = (date) => {
|
|
2505
|
-
const newDate = new Date(date);
|
|
2506
|
-
while (newDate.getDay()) {
|
|
2507
|
-
newDate.setDate(newDate.getDate() - 1);
|
|
2508
|
-
}
|
|
2509
|
-
return startOfDay(newDate);
|
|
2510
|
-
};
|
|
2511
|
-
const endOfWeek = (date) => {
|
|
2512
|
-
const newDate = new Date(date);
|
|
2513
|
-
while (newDate.getDay() < 6) {
|
|
2514
|
-
newDate.setDate(newDate.getDate() + 1);
|
|
2515
|
-
}
|
|
2516
|
-
return endOfDay(newDate);
|
|
2517
|
-
};
|
|
2518
|
-
const startOfHour = (date) => {
|
|
2519
|
-
const newDate = new Date(date);
|
|
2520
|
-
newDate.setMinutes(0, 0, 0);
|
|
2521
|
-
return newDate;
|
|
2522
|
-
};
|
|
2523
|
-
const endOfHour = (date) => {
|
|
2524
|
-
const newDate = new Date(date);
|
|
2525
|
-
newDate.setMinutes(59, 59, 999);
|
|
2526
|
-
return newDate;
|
|
2527
|
-
};
|
|
2528
|
-
const startOfMinute = (date) => {
|
|
2529
|
-
const newDate = new Date(date);
|
|
2530
|
-
newDate.setSeconds(0, 0);
|
|
2531
|
-
return newDate;
|
|
2532
|
-
};
|
|
2533
|
-
const endOfMinute = (date) => {
|
|
2534
|
-
const newDate = new Date(date);
|
|
2535
|
-
newDate.setSeconds(59, 999);
|
|
2536
|
-
return newDate;
|
|
2537
|
-
};
|
|
2538
|
-
const startOfSecond = (date) => {
|
|
2539
|
-
const newDate = new Date(date);
|
|
2540
|
-
newDate.setMilliseconds(0);
|
|
2541
|
-
return newDate;
|
|
2542
|
-
};
|
|
2543
|
-
const endOfSecond = (date) => {
|
|
2544
|
-
const newDate = new Date(date);
|
|
2545
|
-
newDate.setMilliseconds(999);
|
|
2546
|
-
return newDate;
|
|
2547
|
-
};
|
|
2548
|
-
const isEqual = (a, b) => a.getTime() === b.getTime();
|
|
2549
|
-
const isSameYear = (a, b) => a.getFullYear() === b.getFullYear();
|
|
2550
|
-
const isSameMonth = (a, b) => isSameYear(a, b) && a.getMonth() === b.getMonth();
|
|
2551
|
-
const isSameDay = (a, b) => isSameMonth(a, b) && a.getDate() === b.getDate();
|
|
2552
|
-
const isSameHour = (a, b) => isSameDay(a, b) && a.getHours() === b.getHours();
|
|
2553
|
-
const isSameMinute = (a, b) => isSameHour(a, b) && a.getMinutes() === b.getMinutes();
|
|
2554
|
-
const isSameSecond = (a, b) => isSameMinute(a, b) && a.getSeconds() === b.getSeconds();
|
|
2555
|
-
const isSameMillisecond = (a, b) => isEqual(a, b);
|
|
2556
|
-
const isToday = (date) => isSameDay(date, new Date());
|
|
2557
|
-
const isValidDate = (date) => date instanceof Date && !Number.isNaN(date.getTime());
|
|
2558
|
-
const isAfter = (a, b) => a.getTime() > b.getTime();
|
|
2559
|
-
const isBefore = (a, b) => a.getTime() < b.getTime();
|
|
2560
|
-
const isYearAfter = (a, b) => a.getFullYear() > b.getFullYear();
|
|
2561
|
-
const isMonthAfter = (a, b) => isYearAfter(a, b) || (isSameYear(a, b) && a.getMonth() > b.getMonth());
|
|
2562
|
-
const isDayAfter = (a, b) => isMonthAfter(a, b) || (isSameMonth(a, b) && a.getDate() > b.getDate());
|
|
2563
|
-
const isHoursAfter = (a, b) => isDayAfter(a, b) || (isSameDay(a, b) && a.getHours() > b.getHours());
|
|
2564
|
-
const isMinutesAfter = (a, b) => isHoursAfter(a, b) || (isSameHour(a, b) && a.getMinutes() > b.getMinutes());
|
|
2565
|
-
const isSecondsAfter = (a, b) => isMinutesAfter(a, b) || (isSameMinute(a, b) && a.getSeconds() > b.getSeconds());
|
|
2566
|
-
const isMillisecondsAfter = (a, b) => isSecondsAfter(a, b) || (isSameSecond(a, b) && a.getMilliseconds() > b.getMilliseconds());
|
|
2567
|
-
const isYearBefore = (a, b) => a.getFullYear() < b.getFullYear();
|
|
2568
|
-
const isMonthBefore = (a, b) => isYearBefore(a, b) || (isSameYear(a, b) && a.getMonth() < b.getMonth());
|
|
2569
|
-
const isDayBefore = (a, b) => isMonthBefore(a, b) || (isSameMonth(a, b) && a.getDate() < b.getDate());
|
|
2570
|
-
const isHoursBefore = (a, b) => isDayBefore(a, b) || (isSameDay(a, b) && a.getHours() < b.getHours());
|
|
2571
|
-
const isMinutesBefore = (a, b) => isHoursBefore(a, b) || (isSameHour(a, b) && a.getMinutes() < b.getMinutes());
|
|
2572
|
-
const isSecondsBefore = (a, b) => isMinutesBefore(a, b) || (isSameMinute(a, b) && a.getSeconds() < b.getSeconds());
|
|
2573
|
-
const isMillisecondsBefore = (a, b) => isSecondsBefore(a, b) || (isSameSecond(a, b) && a.getMilliseconds() < b.getMilliseconds());
|
|
2574
|
-
const isWithinInterval = (date, { start, end }, cmp = '[]') => (cmp.charAt(0) === '[' ? isEqual(date, start) || isAfter(date, start) : isAfter(date, start)) &&
|
|
2575
|
-
(cmp.charAt(1) === ']' ? isEqual(date, end) || isBefore(date, end) : isBefore(date, end));
|
|
2576
|
-
const normalizeToLocalStartOfDay = (timestamp) => {
|
|
2577
|
-
const d = new Date(timestamp);
|
|
2578
|
-
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
2579
|
-
};
|
|
2580
|
-
const normalizeToLocalStartOfHour = (timestamp) => {
|
|
2581
|
-
const d = new Date(timestamp);
|
|
2582
|
-
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours());
|
|
2583
|
-
};
|
|
2584
|
-
const normalizeToLocalStartOfMinutes = (timestamp) => {
|
|
2585
|
-
const d = new Date(timestamp);
|
|
2586
|
-
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes());
|
|
2587
|
-
};
|
|
2588
|
-
const normalizeToLocalStartOfSeconds = (timestamp) => {
|
|
2589
|
-
const d = new Date(timestamp);
|
|
2590
|
-
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds());
|
|
2591
|
-
};
|
|
2592
|
-
const getYears = (d) => d.getFullYear();
|
|
2593
|
-
const getMonths = (d) => d.getFullYear() * 12 + d.getMonth();
|
|
2594
|
-
const getDays = (d) => Math.floor(normalizeToLocalStartOfDay(d).getTime() / ONE_DAY);
|
|
2595
|
-
const getHours = (d) => Math.floor(normalizeToLocalStartOfHour(d).getTime() / ONE_HOUR);
|
|
2596
|
-
const getMinutes = (d) => Math.floor(normalizeToLocalStartOfMinutes(d).getTime() / ONE_MINUTE);
|
|
2597
|
-
const getSeconds = (d) => Math.floor(normalizeToLocalStartOfSeconds(d).getTime() / 1000);
|
|
2598
|
-
const getMilliseconds = (d) => d.getTime();
|
|
2599
|
-
|
|
2600
|
-
const getDocumentAccess = (document) => {
|
|
2601
|
-
switch (true) {
|
|
2602
|
-
case (document?.members?.rankAdministrators === exports.EntityMembersRank.NONE || document?.members?.rankAdministrators === exports.EntityMembersRank.CLOSE)
|
|
2603
|
-
&& document?.members?.rankManagers === exports.EntityMembersRank.OPEN
|
|
2604
|
-
&& (document?.members?.rankGuests === exports.EntityMembersRank.NONE || document?.members?.rankGuests === exports.EntityMembersRank.CLOSE || document?.members?.rankGuests === exports.EntityMembersRank.OPEN)
|
|
2605
|
-
&& document?.members?.rankSpectators === exports.EntityMembersRank.OPEN
|
|
2606
|
-
&& (document?.members?.rankParticipants === exports.EntityMembersRank.NONE || document?.members?.rankParticipants === exports.EntityMembersRank.CLOSE || document?.members?.rankParticipants === exports.EntityMembersRank.OPEN):
|
|
2607
|
-
return exports.EntityAccess.EXPOSED;
|
|
2608
|
-
case (document?.members?.rankAdministrators === exports.EntityMembersRank.NONE || document?.members?.rankAdministrators === exports.EntityMembersRank.CLOSE)
|
|
2609
|
-
&& document?.members?.rankManagers === exports.EntityMembersRank.CLOSE
|
|
2610
|
-
&& (document?.members?.rankGuests === exports.EntityMembersRank.NONE || document?.members?.rankGuests === exports.EntityMembersRank.CLOSE || document?.members?.rankGuests === exports.EntityMembersRank.OPEN)
|
|
2611
|
-
&& document?.members?.rankSpectators === exports.EntityMembersRank.OPEN
|
|
2612
|
-
&& (document?.members?.rankParticipants === exports.EntityMembersRank.NONE || document?.members?.rankParticipants === exports.EntityMembersRank.CLOSE || document?.members?.rankParticipants === exports.EntityMembersRank.OPEN):
|
|
2613
|
-
return exports.EntityAccess.PUBLIC;
|
|
2614
|
-
case (document?.members?.rankAdministrators === exports.EntityMembersRank.NONE || document?.members?.rankAdministrators === exports.EntityMembersRank.CLOSE)
|
|
2615
|
-
&& document?.members?.rankManagers === exports.EntityMembersRank.CLOSE
|
|
2616
|
-
&& (document?.members?.rankGuests === exports.EntityMembersRank.NONE || document?.members?.rankGuests === exports.EntityMembersRank.CLOSE || document?.members?.rankGuests === exports.EntityMembersRank.OPEN)
|
|
2617
|
-
&& document?.members?.rankSpectators === exports.EntityMembersRank.CLOSE
|
|
2618
|
-
&& (document?.members?.rankParticipants === exports.EntityMembersRank.NONE || document?.members?.rankParticipants === exports.EntityMembersRank.CLOSE || document?.members?.rankParticipants === exports.EntityMembersRank.OPEN):
|
|
2619
|
-
return exports.EntityAccess.RESTRICTED;
|
|
2620
|
-
case document?.members?.rankAdministrators === exports.EntityMembersRank.NONE
|
|
2621
|
-
&& document?.members?.rankManagers === exports.EntityMembersRank.NONE
|
|
2622
|
-
&& document?.members?.rankGuests === exports.EntityMembersRank.NONE
|
|
2623
|
-
&& document?.members?.rankSpectators === exports.EntityMembersRank.NONE
|
|
2624
|
-
&& document?.members?.rankParticipants === exports.EntityMembersRank.NONE:
|
|
2625
|
-
return exports.EntityAccess.PRIVATE;
|
|
2626
|
-
default:
|
|
2627
|
-
return exports.EntityAccess.PRIVATE;
|
|
2628
|
-
}
|
|
2629
|
-
};
|
|
2630
|
-
const isUserMember = (member) => {
|
|
2631
|
-
return typeof member.userId === 'string';
|
|
2632
|
-
};
|
|
2633
|
-
const isTeamMember = (member) => {
|
|
2634
|
-
return typeof member.teamId === 'string';
|
|
2635
|
-
};
|
|
2636
|
-
const toEntityMembersDto = (members) => {
|
|
2637
|
-
return {
|
|
2638
|
-
rankAdministrators: members.rankAdministrators,
|
|
2639
|
-
administrators: Object.keys(members.administrators),
|
|
2640
|
-
rankManagers: members.rankManagers,
|
|
2641
|
-
managers: Object.keys(members.managers),
|
|
2642
|
-
rankParticipants: members.rankParticipants,
|
|
2643
|
-
participants: Object.keys(members.participants),
|
|
2644
|
-
rankGuests: members.rankGuests,
|
|
2645
|
-
guests: Object.keys(members.guests),
|
|
2646
|
-
rankSpectators: members.rankSpectators,
|
|
2647
|
-
spectators: Object.keys(members.spectators),
|
|
2648
|
-
};
|
|
2649
|
-
};
|
|
2650
|
-
|
|
2651
|
-
class JkError extends Error {
|
|
2652
|
-
constructor(code, custom) {
|
|
2653
|
-
const message = custom?.message || ERROR[code].message;
|
|
2654
|
-
super(message);
|
|
2655
|
-
this.message = message;
|
|
2656
|
-
this.code = code;
|
|
2657
|
-
if (custom?.stack) {
|
|
2658
|
-
this.stack = custom.stack;
|
|
2659
|
-
}
|
|
2660
|
-
if (custom?.data) {
|
|
2661
|
-
this.data = custom.data;
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
|
-
function removeExtension(fileName) {
|
|
2667
|
-
const i = fileName.lastIndexOf('.');
|
|
2668
|
-
return i !== -1 ? fileName.substring(0, i) : fileName;
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
// https://dev.to/jsmccrumb/asynchronous-setinterval-4j69
|
|
2672
|
-
const asyncIntervals = [];
|
|
2673
|
-
const runAsyncInterval = async (cb, interval, intervalIndex) => {
|
|
2674
|
-
await cb();
|
|
2675
|
-
if (asyncIntervals[intervalIndex]) {
|
|
2676
|
-
setTimeout(() => runAsyncInterval(cb, interval, intervalIndex), interval);
|
|
2677
|
-
}
|
|
2678
|
-
};
|
|
2679
|
-
const setAsyncInterval = (cb, interval) => {
|
|
2680
|
-
if (cb && typeof cb === 'function') {
|
|
2681
|
-
const intervalIndex = asyncIntervals.length;
|
|
2682
|
-
asyncIntervals.push(true);
|
|
2683
|
-
void runAsyncInterval(cb, interval, intervalIndex);
|
|
2684
|
-
return intervalIndex;
|
|
2685
|
-
}
|
|
2686
|
-
else {
|
|
2687
|
-
throw new Error('Callback must be a function');
|
|
2688
|
-
}
|
|
2689
|
-
};
|
|
2690
|
-
const clearAsyncInterval = (intervalIndex) => {
|
|
2691
|
-
if (asyncIntervals[intervalIndex]) {
|
|
2692
|
-
asyncIntervals[intervalIndex] = false;
|
|
2693
|
-
}
|
|
2694
|
-
};
|
|
2695
|
-
|
|
2696
|
-
const getDataOfTestCase = (testCase, timeLimit, memoryLimit) => {
|
|
2697
|
-
const { timeUsed, memoryUsed, exitCode } = getDataLog(testCase?.log);
|
|
2698
|
-
const timeLimitExceeded = timeUsed > timeLimit;
|
|
2699
|
-
const memoryLimitExceeded = memoryUsed > memoryLimit;
|
|
2700
|
-
const runtimeError = exitCode !== 0;
|
|
2701
|
-
const compilationError = testCase?.status === exports.SubmissionRunStatus.COMPILATION_ERROR;
|
|
2702
|
-
return {
|
|
2703
|
-
compilationError,
|
|
2704
|
-
timeUsed,
|
|
2705
|
-
timeLimitExceeded: timeLimitExceeded,
|
|
2706
|
-
memoryUsed,
|
|
2707
|
-
memoryLimitExceeded: memoryLimitExceeded,
|
|
2708
|
-
exitCode,
|
|
2709
|
-
runtimeError,
|
|
2710
|
-
failed: !!testCase?.log && (timeLimitExceeded || memoryLimitExceeded || runtimeError),
|
|
2711
|
-
};
|
|
2712
|
-
};
|
|
2713
|
-
const getVerdictFromTestCase = (testCaseValue, timeLimit, memoryLimit) => {
|
|
2714
|
-
const { compilationError, timeLimitExceeded, memoryLimitExceeded, runtimeError, timeUsed, memoryUsed, exitCode, } = getDataOfTestCase(testCaseValue, timeLimit, memoryLimit);
|
|
2715
|
-
return {
|
|
2716
|
-
verdict: compilationError
|
|
2717
|
-
? exports.ProblemVerdict.CE
|
|
2718
|
-
: timeLimitExceeded
|
|
2719
|
-
? exports.ProblemVerdict.TLE
|
|
2720
|
-
: memoryLimitExceeded
|
|
2721
|
-
? exports.ProblemVerdict.MLE
|
|
2722
|
-
: runtimeError
|
|
2723
|
-
? exports.ProblemVerdict.RE
|
|
2724
|
-
: testCaseValue.out === testCaseValue.testOut
|
|
2725
|
-
? exports.ProblemVerdict.AC
|
|
2726
|
-
: testCaseValue.withPE && testCaseValue.out.split(' ').join('').split('\n').join('') === testCaseValue.testOut.split(' ').join('').split('\n').join('')
|
|
2727
|
-
? exports.ProblemVerdict.PE
|
|
2728
|
-
: !testCaseValue.withPE && testCaseValue.out.split(' ').join('').split('\n').join('') === testCaseValue.testOut.split(' ').join('').split('\n').join('')
|
|
2729
|
-
? exports.ProblemVerdict.AC
|
|
2730
|
-
: exports.ProblemVerdict.WA,
|
|
2731
|
-
timeUsed,
|
|
2732
|
-
memoryUsed,
|
|
2733
|
-
exitCode,
|
|
2734
|
-
};
|
|
2735
|
-
};
|
|
2736
|
-
const mergeVerdicts = (first, second) => {
|
|
2737
|
-
let verdict = first.verdict;
|
|
2738
|
-
if (second.verdict === exports.ProblemVerdict.RE) {
|
|
2739
|
-
verdict = exports.ProblemVerdict.RE;
|
|
2740
|
-
}
|
|
2741
|
-
else if (second.verdict === exports.ProblemVerdict.TLE && verdict != exports.ProblemVerdict.RE) {
|
|
2742
|
-
verdict = exports.ProblemVerdict.TLE;
|
|
2743
|
-
}
|
|
2744
|
-
else if (second.verdict === exports.ProblemVerdict.MLE
|
|
2745
|
-
&& verdict !== exports.ProblemVerdict.TLE
|
|
2746
|
-
&& verdict !== exports.ProblemVerdict.RE) {
|
|
2747
|
-
verdict = exports.ProblemVerdict.MLE;
|
|
2748
|
-
}
|
|
2749
|
-
else if (second.verdict === exports.ProblemVerdict.WA
|
|
2750
|
-
&& verdict !== exports.ProblemVerdict.MLE
|
|
2751
|
-
&& verdict !== exports.ProblemVerdict.TLE
|
|
2752
|
-
&& verdict !== exports.ProblemVerdict.RE) {
|
|
2753
|
-
verdict = exports.ProblemVerdict.WA;
|
|
2754
|
-
}
|
|
2755
|
-
else if (second.verdict === exports.ProblemVerdict.PE
|
|
2756
|
-
&& verdict !== exports.ProblemVerdict.WA
|
|
2757
|
-
&& verdict !== exports.ProblemVerdict.MLE
|
|
2758
|
-
&& verdict !== exports.ProblemVerdict.TLE
|
|
2759
|
-
&& verdict !== exports.ProblemVerdict.RE) {
|
|
2760
|
-
verdict = exports.ProblemVerdict.PE;
|
|
2761
|
-
}
|
|
2762
|
-
else if (second.verdict === exports.ProblemVerdict.PA
|
|
2763
|
-
&& verdict !== exports.ProblemVerdict.PE
|
|
2764
|
-
&& verdict !== exports.ProblemVerdict.WA
|
|
2765
|
-
&& verdict !== exports.ProblemVerdict.MLE
|
|
2766
|
-
&& verdict !== exports.ProblemVerdict.TLE
|
|
2767
|
-
&& verdict !== exports.ProblemVerdict.RE) {
|
|
2768
|
-
verdict = exports.ProblemVerdict.PA;
|
|
2769
|
-
}
|
|
2770
|
-
else if (second.verdict === exports.ProblemVerdict.AC
|
|
2771
|
-
&& verdict !== exports.ProblemVerdict.PA
|
|
2772
|
-
&& verdict !== exports.ProblemVerdict.PE
|
|
2773
|
-
&& verdict !== exports.ProblemVerdict.WA
|
|
2774
|
-
&& verdict !== exports.ProblemVerdict.MLE
|
|
2775
|
-
&& verdict !== exports.ProblemVerdict.TLE
|
|
2776
|
-
&& verdict !== exports.ProblemVerdict.RE) {
|
|
2777
|
-
verdict = exports.ProblemVerdict.AC;
|
|
2778
|
-
}
|
|
2779
|
-
return {
|
|
2780
|
-
timeUsed: Math.max(first.timeUsed, second.timeUsed),
|
|
2781
|
-
memoryUsed: Math.max(first.memoryUsed, second.memoryUsed),
|
|
2782
|
-
exitCode: first.exitCode || second.exitCode,
|
|
2783
|
-
verdict,
|
|
2784
|
-
};
|
|
2785
|
-
};
|
|
2786
|
-
const getDataLog = (log) => {
|
|
2787
|
-
const lines = log?.split?.('\n') || [];
|
|
2788
|
-
let timeUsed = 0;
|
|
2789
|
-
let memoryUsed = 0;
|
|
2790
|
-
let exitCode = -1;
|
|
2791
|
-
if (lines.length > 4) {
|
|
2792
|
-
for (const line of lines) {
|
|
2793
|
-
if (line.startsWith('time:')) {
|
|
2794
|
-
timeUsed = +line.split(':')[1];
|
|
2795
|
-
if (Number.isNaN(timeUsed)) {
|
|
2796
|
-
timeUsed = 0;
|
|
2797
|
-
}
|
|
2798
|
-
timeUsed *= 1000;
|
|
2799
|
-
}
|
|
2800
|
-
else if (line.startsWith('max-rss:')) {
|
|
2801
|
-
memoryUsed = parseInt(line.split(':')[1], 10); // en KB
|
|
2802
|
-
}
|
|
2803
|
-
else if (line.startsWith('exitcode:')) {
|
|
2804
|
-
exitCode = parseInt(line.split(':')[1], 10);
|
|
2805
|
-
}
|
|
2806
|
-
}
|
|
2807
|
-
}
|
|
2808
|
-
else if (lines.length >= 3) {
|
|
2809
|
-
timeUsed = +lines[0];
|
|
2810
|
-
memoryUsed = +lines[1];
|
|
2811
|
-
exitCode = +lines[2];
|
|
2812
|
-
}
|
|
2813
|
-
return {
|
|
2814
|
-
timeUsed: Number.isNaN(timeUsed) ? 0 : timeUsed,
|
|
2815
|
-
memoryUsed: Number.isNaN(memoryUsed) ? 0 : memoryUsed,
|
|
2816
|
-
exitCode: Number.isNaN(exitCode) ? -1 : exitCode,
|
|
2817
|
-
};
|
|
2818
|
-
};
|
|
2819
|
-
|
|
2820
|
-
const padStart = (n, maxLength, fillString = '0') => `${n}`.padStart(maxLength, fillString);
|
|
2821
|
-
const padEnd = (n, maxLength, fillString = '0') => `${n}`.padEnd(maxLength, fillString);
|
|
2822
|
-
|
|
2823
|
-
function memorySizeOf(obj) {
|
|
2824
|
-
let bytes = 0;
|
|
2825
|
-
function sizeOf(obj) {
|
|
2826
|
-
if (obj !== null && obj !== undefined) {
|
|
2827
|
-
switch (typeof obj) {
|
|
2828
|
-
case "number":
|
|
2829
|
-
bytes += 8;
|
|
2830
|
-
break;
|
|
2831
|
-
case "string":
|
|
2832
|
-
bytes += obj.length * 2;
|
|
2833
|
-
break;
|
|
2834
|
-
case "boolean":
|
|
2835
|
-
bytes += 4;
|
|
2836
|
-
break;
|
|
2837
|
-
case "object":
|
|
2838
|
-
const objClass = Object.prototype.toString.call(obj).slice(8, -1);
|
|
2839
|
-
if (objClass === "Object" || objClass === "Array") {
|
|
2840
|
-
for (const key in obj) {
|
|
2841
|
-
if (!obj.hasOwnProperty(key))
|
|
2842
|
-
continue;
|
|
2843
|
-
bytes += key.length * 2;
|
|
2844
|
-
sizeOf(obj[key]);
|
|
2845
|
-
}
|
|
2846
|
-
}
|
|
2847
|
-
else
|
|
2848
|
-
bytes += obj.toString().length * 2;
|
|
2849
|
-
break;
|
|
2850
|
-
}
|
|
2851
|
-
}
|
|
2852
|
-
return bytes;
|
|
2853
|
-
}
|
|
2854
|
-
return sizeOf(obj);
|
|
2855
|
-
}
|
|
2856
|
-
|
|
2857
|
-
function toJkError(err) {
|
|
2858
|
-
const error = new Error();
|
|
2859
|
-
let code = err?.code;
|
|
2860
|
-
if (!(code in exports.ErrorCode)) {
|
|
2861
|
-
code = exports.ErrorCode.ERR500;
|
|
2862
|
-
}
|
|
2863
|
-
return new JkError(code, {
|
|
2864
|
-
message: err?.message || error.message,
|
|
2865
|
-
stack: err?.stack || error.stack,
|
|
2866
|
-
data: err?.data || null,
|
|
2867
|
-
});
|
|
2868
|
-
}
|
|
2869
|
-
function errorsResponse(message, ...errors) {
|
|
2870
|
-
return {
|
|
2871
|
-
success: false,
|
|
2872
|
-
message: message,
|
|
2873
|
-
errors: errors.map(error => ({
|
|
2874
|
-
code: error.code,
|
|
2875
|
-
message: error.message,
|
|
2876
|
-
detail: error.stack || new Error().stack || '',
|
|
2877
|
-
data: error.data,
|
|
2878
|
-
})),
|
|
2879
|
-
};
|
|
2880
|
-
}
|
|
2881
|
-
function contentResponse(message, content) {
|
|
2882
|
-
return {
|
|
2883
|
-
success: true,
|
|
2884
|
-
message,
|
|
2885
|
-
content,
|
|
2886
|
-
};
|
|
2887
|
-
}
|
|
2888
|
-
function contentsResponse(message, contents, meta) {
|
|
2889
|
-
return {
|
|
2890
|
-
success: true,
|
|
2891
|
-
message,
|
|
2892
|
-
contents,
|
|
2893
|
-
meta,
|
|
2894
|
-
};
|
|
2895
|
-
}
|
|
2896
|
-
const cleanRequest = (responseText) => {
|
|
2897
|
-
if (!isStringJson(responseText)) {
|
|
2898
|
-
// this occurs when the endpoint don't exits or server is down
|
|
2899
|
-
const response = {
|
|
2900
|
-
success: false,
|
|
2901
|
-
message: ERROR[exports.ErrorCode.ERR9999].message,
|
|
2902
|
-
errors: [{ code: exports.ErrorCode.ERR9999, detail: '', message: ERROR[exports.ErrorCode.ERR9999].message }],
|
|
2903
|
-
};
|
|
2904
|
-
consoleError({ message: 'response is not string json, success false on cleaning request', responseText, response });
|
|
2905
|
-
// jukiApiManager.reportError({ message: 'success false on cleaning request', responseText, response });
|
|
2906
|
-
return response;
|
|
2907
|
-
}
|
|
2908
|
-
const responseJson = JSON.parse(responseText);
|
|
2909
|
-
if (typeof responseJson.success === 'boolean') {
|
|
2910
|
-
if (responseJson.success === true && typeof responseJson.message === 'string' && responseJson.content) { // V1
|
|
2911
|
-
return {
|
|
2912
|
-
success: true,
|
|
2913
|
-
message: responseJson.message,
|
|
2914
|
-
content: responseJson.content,
|
|
2915
|
-
};
|
|
2916
|
-
}
|
|
2917
|
-
else if (responseJson.success === true && typeof responseJson.message === 'string' && Array.isArray(responseJson.contents) && responseJson.meta) { // V1
|
|
2918
|
-
return {
|
|
2919
|
-
success: true,
|
|
2920
|
-
message: responseJson.message,
|
|
2921
|
-
contents: responseJson.contents,
|
|
2922
|
-
meta: responseJson.meta,
|
|
2923
|
-
};
|
|
2924
|
-
}
|
|
2925
|
-
else if (responseJson.success === false && typeof responseJson.message === 'string' && Array.isArray(responseJson.errors)) { // V1
|
|
2926
|
-
const response = {
|
|
2927
|
-
success: false,
|
|
2928
|
-
message: responseJson.message,
|
|
2929
|
-
errors: responseJson.errors,
|
|
2930
|
-
};
|
|
2931
|
-
consoleError({ message: 'success false on cleaning request', responseText, response });
|
|
2932
|
-
// jukiApiManager.reportError({ message: 'success false on cleaning request', responseText, response });
|
|
2933
|
-
return response;
|
|
2934
|
-
}
|
|
2935
|
-
}
|
|
2936
|
-
const response = {
|
|
2937
|
-
success: false,
|
|
2938
|
-
message: ERROR[exports.ErrorCode.ERR9998].message,
|
|
2939
|
-
errors: [{ code: exports.ErrorCode.ERR9998, detail: '', message: ERROR[exports.ErrorCode.ERR9998].message }],
|
|
2940
|
-
};
|
|
2941
|
-
consoleError({ message: 'success false on cleaning request', responseText, response });
|
|
2942
|
-
// jukiApiManager.reportError({ message: 'success false on cleaning request', responseText, response });
|
|
2943
|
-
return response;
|
|
2944
|
-
};
|
|
2945
|
-
const getDefaultMeta = (contents, sort) => {
|
|
2946
|
-
return { sort: sort ?? [], page: 1, size: contents.length, totalElements: contents.length, filter: {} };
|
|
2947
|
-
};
|
|
2948
|
-
|
|
2949
|
-
const isWebsocketSubscription = (event) => {
|
|
2950
|
-
return Object.values(exports.WebSocketSubscriptionEvent).includes(event?.event)
|
|
2951
|
-
&& typeof event?.clientId === 'string' && !!event.clientId;
|
|
2952
|
-
};
|
|
2953
|
-
// CHANNEL_PUBLISH_SUBSCRIPTIONS
|
|
2954
|
-
const isSubscribeCodeRunStatusWebSocketEventDto = (event) => {
|
|
2955
|
-
return isWebsocketSubscription(event)
|
|
2956
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_CODE_RUN_STATUS
|
|
2957
|
-
&& typeof event?.runId === 'string' && !!event.runId;
|
|
2958
|
-
};
|
|
2959
|
-
const isUnsubscribeCodeRunStatusWebSocketEventDto = (event) => {
|
|
2960
|
-
return isWebsocketSubscription(event)
|
|
2961
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_CODE_RUN_STATUS
|
|
2962
|
-
&& typeof event?.runId === 'string' && !!event.runId;
|
|
2963
|
-
};
|
|
2964
|
-
const isSubscribeSubmissionRunStatusWebSocketEventDto = (event) => {
|
|
2965
|
-
return isWebsocketSubscription(event)
|
|
2966
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_SUBMISSION_RUN_STATUS
|
|
2967
|
-
&& typeof event?.submitId === 'string' && !!event.submitId;
|
|
2968
|
-
};
|
|
2969
|
-
const isUnsubscribeSubmissionRunStatusWebSocketEventDto = (event) => {
|
|
2970
|
-
return isWebsocketSubscription(event)
|
|
2971
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_SUBMISSION_RUN_STATUS
|
|
2972
|
-
&& typeof event?.submitId === 'string' && !!event.submitId;
|
|
2973
|
-
};
|
|
2974
|
-
const isSubscribeGetDataWebSocketEventDto = (event) => {
|
|
2975
|
-
return isWebsocketSubscription(event)
|
|
2976
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_GET_DATA;
|
|
2977
|
-
};
|
|
2978
|
-
const isUnsubscribeGetDataWebSocketEventDto = (event) => {
|
|
2979
|
-
return isWebsocketSubscription(event)
|
|
2980
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_GET_DATA;
|
|
2981
|
-
};
|
|
2982
|
-
const isSubscribeProblemCrawledWebSocketEventDto = (event) => {
|
|
2983
|
-
return isWebsocketSubscription(event)
|
|
2984
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_PROBLEM_CRAWLED;
|
|
2985
|
-
};
|
|
2986
|
-
const isUnsubscribeProblemCrawledWebSocketEventDto = (event) => {
|
|
2987
|
-
return isWebsocketSubscription(event)
|
|
2988
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_PROBLEM_CRAWLED;
|
|
2989
|
-
};
|
|
2990
|
-
const isSubscribeSubmissionsCrawlWebSocketEventDto = (event) => {
|
|
2991
|
-
return isWebsocketSubscription(event)
|
|
2992
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_SUBMISSIONS_CRAWL;
|
|
2993
|
-
};
|
|
2994
|
-
const isUnsubscribeSubmissionsCrawlWebSocketEventDto = (event) => {
|
|
2995
|
-
return isWebsocketSubscription(event)
|
|
2996
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_SUBMISSIONS_CRAWL;
|
|
2997
|
-
};
|
|
2998
|
-
const isSubscribeContestChangesWebSocketEventDto = (event) => {
|
|
2999
|
-
return isWebsocketSubscription(event)
|
|
3000
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_CONTEST_CHANGES;
|
|
3001
|
-
};
|
|
3002
|
-
const isUnsubscribeContestChangesWebSocketEventDto = (event) => {
|
|
3003
|
-
return isWebsocketSubscription(event)
|
|
3004
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_CONTEST_CHANGES;
|
|
3005
|
-
};
|
|
3006
|
-
const isSubscribeUserNotificationWebSocketEventDto = (event) => {
|
|
3007
|
-
return isWebsocketSubscription(event)
|
|
3008
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_USER_NOTIFICATION;
|
|
3009
|
-
};
|
|
3010
|
-
const isUnsubscribeUserNotificationWebSocketEventDto = (event) => {
|
|
3011
|
-
return isWebsocketSubscription(event)
|
|
3012
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_USER_NOTIFICATION;
|
|
3013
|
-
};
|
|
3014
|
-
const isNonEmptyString = (value) => typeof value === 'string' && !!value;
|
|
3015
|
-
/**
|
|
3016
|
-
* Exactly one of `problemKey` / `contestKey` / `userId` is set.
|
|
3017
|
-
*/
|
|
3018
|
-
const isSubmissionsJudgingScope = (scope) => {
|
|
3019
|
-
return [scope?.problemKey, scope?.contestKey, scope?.userId].filter(isNonEmptyString).length === 1;
|
|
3020
|
-
};
|
|
3021
|
-
const isSubscribeSubmissionsJudgingWebSocketEventDto = (event) => {
|
|
3022
|
-
return isWebsocketSubscription(event)
|
|
3023
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.SUBSCRIBE_SUBMISSIONS_JUDGING
|
|
3024
|
-
&& isSubmissionsJudgingScope(event);
|
|
3025
|
-
};
|
|
3026
|
-
const isUnsubscribeSubmissionsJudgingWebSocketEventDto = (event) => {
|
|
3027
|
-
return isWebsocketSubscription(event)
|
|
3028
|
-
&& event?.event === exports.WebSocketSubscriptionEvent.UNSUBSCRIBE_SUBMISSIONS_JUDGING
|
|
3029
|
-
&& isSubmissionsJudgingScope(event);
|
|
3030
|
-
};
|
|
3031
|
-
// is WebSocketResponseEventDto, CHANNEL_SUBSCRIBE_CLIENT
|
|
3032
|
-
const isWebSocketResponseEventDto = (event) => {
|
|
3033
|
-
return Object.values(exports.WebSocketResponseEvent).includes(event?.event)
|
|
3034
|
-
&& typeof event?.key === 'string'
|
|
3035
|
-
&& typeof event?.connectionId === 'string'
|
|
3036
|
-
&& typeof event?.createdAt === 'number' && !!event.createdAt;
|
|
3037
|
-
};
|
|
3038
|
-
const isCodeRunStatusMessageWebSocketResponseEventDto = (event) => {
|
|
3039
|
-
return isWebSocketResponseEventDto(event)
|
|
3040
|
-
&& event?.event === exports.WebSocketResponseEvent.CODE_RUN_STATUS
|
|
3041
|
-
&& typeof event?.runId === 'string' && !!event.runId
|
|
3042
|
-
&& event?.status in exports.SubmissionRunStatus;
|
|
3043
|
-
};
|
|
3044
|
-
const isSubmissionRunStatusMessageWebSocketResponseEventDto = (event) => {
|
|
3045
|
-
return isWebSocketResponseEventDto(event)
|
|
3046
|
-
&& event?.event === exports.WebSocketResponseEvent.SUBMISSION_RUN_STATUS
|
|
3047
|
-
&& typeof event?.submitId === 'string' && !!event.submitId
|
|
3048
|
-
&& event?.status in exports.SubmissionRunStatus
|
|
3049
|
-
&& event?.verdict in exports.ProblemVerdict
|
|
3050
|
-
&& typeof event?.points === 'number';
|
|
3051
|
-
};
|
|
3052
|
-
const isSubmissionJudgingWebSocketResponseEventDto = (event) => {
|
|
3053
|
-
return isWebSocketResponseEventDto(event)
|
|
3054
|
-
&& event?.event === exports.WebSocketResponseEvent.SUBMISSION_JUDGING
|
|
3055
|
-
&& isNonEmptyString(event?.submitId)
|
|
3056
|
-
&& isNonEmptyString(event?.problemKey)
|
|
3057
|
-
&& (event?.contestKey === null || isNonEmptyString(event?.contestKey))
|
|
3058
|
-
&& isNonEmptyString(event?.userId)
|
|
3059
|
-
&& typeof event?.judging === 'boolean'
|
|
3060
|
-
&& event?.status in exports.SubmissionRunStatus
|
|
3061
|
-
&& event?.verdict in exports.ProblemVerdict
|
|
3062
|
-
&& typeof event?.points === 'number';
|
|
3063
|
-
};
|
|
3064
|
-
const isUserMessageWebSocketResponseEventDto = (event) => {
|
|
3065
|
-
return isWebSocketResponseEventDto(event)
|
|
3066
|
-
&& event?.event === exports.WebSocketResponseEvent.USER_MESSAGE
|
|
3067
|
-
&& typeof event?.user?.nickname === 'string' && !!event.user?.nickname
|
|
3068
|
-
&& typeof event?.user?.imageUrl === 'string' && !!event.user?.imageUrl
|
|
3069
|
-
&& typeof event?.user?.organization?.key === 'string' && !!event.user?.organization?.key
|
|
3070
|
-
&& !!event?.content;
|
|
3071
|
-
};
|
|
3072
|
-
const isSendDataWebSocketResponseEventDto = (event) => {
|
|
3073
|
-
return [
|
|
3074
|
-
exports.WebSocketResponseEvent.SEND_DATA_ECS_TASK_DEFINITIONS_LIST,
|
|
3075
|
-
exports.WebSocketResponseEvent.SEND_DATA_EC2_INSTANCES_LIST,
|
|
3076
|
-
exports.WebSocketResponseEvent.SEND_DATA_ECS_TASKS_LIST,
|
|
3077
|
-
exports.WebSocketResponseEvent.SEND_DATA_SSM_SESSIONS_LIST,
|
|
3078
|
-
exports.WebSocketResponseEvent.SEND_DATA_RUN_COMMAND,
|
|
3079
|
-
].includes(event?.event)
|
|
3080
|
-
&& typeof event?.dataId === 'string' && !!event.dataId
|
|
3081
|
-
&& !!event?.content;
|
|
3082
|
-
};
|
|
3083
|
-
const isSendDataEcsTaskDefinitionListWebSocketResponseEventDto = (event) => {
|
|
3084
|
-
return isWebSocketResponseEventDto(event) && isSendDataWebSocketResponseEventDto(event)
|
|
3085
|
-
&& event?.event === exports.WebSocketResponseEvent.SEND_DATA_ECS_TASK_DEFINITIONS_LIST;
|
|
3086
|
-
};
|
|
3087
|
-
const isSendDataEc2InstancesListWebSocketResponseEventDto = (event) => {
|
|
3088
|
-
return isWebSocketResponseEventDto(event) && isSendDataWebSocketResponseEventDto(event)
|
|
3089
|
-
&& event?.event === exports.WebSocketResponseEvent.SEND_DATA_EC2_INSTANCES_LIST;
|
|
3090
|
-
};
|
|
3091
|
-
const isSendDataEcsTasksListWebSocketResponseEventDto = (event) => {
|
|
3092
|
-
return isWebSocketResponseEventDto(event) && isSendDataWebSocketResponseEventDto(event)
|
|
3093
|
-
&& event?.event === exports.WebSocketResponseEvent.SEND_DATA_ECS_TASKS_LIST;
|
|
3094
|
-
};
|
|
3095
|
-
const isSendDataSsmSessionsListWebSocketResponseEventDto = (event) => {
|
|
3096
|
-
return isWebSocketResponseEventDto(event) && isSendDataWebSocketResponseEventDto(event)
|
|
3097
|
-
&& event?.event === exports.WebSocketResponseEvent.SEND_DATA_SSM_SESSIONS_LIST;
|
|
3098
|
-
};
|
|
3099
|
-
const isSendDataRunCommandWebSocketResponseEventDto = (event) => {
|
|
3100
|
-
return isWebSocketResponseEventDto(event) && isSendDataWebSocketResponseEventDto(event)
|
|
3101
|
-
&& event?.event === exports.WebSocketResponseEvent.SEND_DATA_RUN_COMMAND;
|
|
3102
|
-
};
|
|
3103
|
-
const isProblemCrawledWebSocketResponseEventDto = (event) => {
|
|
3104
|
-
return isWebSocketResponseEventDto(event)
|
|
3105
|
-
&& event?.event === exports.WebSocketResponseEvent.PROBLEM_CRAWLED
|
|
3106
|
-
&& !!event?.content;
|
|
3107
|
-
};
|
|
3108
|
-
const isSubmissionsCrawlWebSocketResponseEventDto = (event) => {
|
|
3109
|
-
return isWebSocketResponseEventDto(event)
|
|
3110
|
-
&& event?.event === exports.WebSocketResponseEvent.SUBMISSIONS_CRAWL
|
|
3111
|
-
&& !!event?.content;
|
|
3112
|
-
};
|
|
3113
|
-
const isContestChangesWebSocketResponseEventDto = (event) => {
|
|
3114
|
-
return isWebSocketResponseEventDto(event)
|
|
3115
|
-
&& event?.event === exports.WebSocketResponseEvent.CONTEST_CHANGES
|
|
3116
|
-
&& !!event?.content;
|
|
3117
|
-
};
|
|
3118
|
-
const isUserNotificationWebSocketResponseEventDto = (event) => {
|
|
3119
|
-
return [
|
|
3120
|
-
exports.WebSocketResponseEvent.USER_NOTIFICATION_SUBMISSION,
|
|
3121
|
-
exports.WebSocketResponseEvent.USER_NOTIFICATION_CONTEST_CLARIFICATION,
|
|
3122
|
-
].includes(event?.event)
|
|
3123
|
-
&& !!event?.content;
|
|
3124
|
-
};
|
|
3125
|
-
const isUserNotificationSubmissionWebSocketResponseEventDto = (event) => {
|
|
3126
|
-
return isWebSocketResponseEventDto(event) && isUserNotificationWebSocketResponseEventDto(event)
|
|
3127
|
-
&& event?.event === exports.WebSocketResponseEvent.USER_NOTIFICATION_SUBMISSION;
|
|
3128
|
-
};
|
|
3129
|
-
const isUserNotificationContestClarificationWebSocketResponseEventDto = (event) => {
|
|
3130
|
-
return isWebSocketResponseEventDto(event) && isUserNotificationWebSocketResponseEventDto(event)
|
|
3131
|
-
&& event?.event === exports.WebSocketResponseEvent.USER_NOTIFICATION_CONTEST_CLARIFICATION;
|
|
3132
|
-
};
|
|
3133
|
-
// generic
|
|
3134
|
-
const getWebSocketResponseEventKey = (event, clientId, id) => {
|
|
3135
|
-
return `${event}-${clientId}-${id}`;
|
|
3136
|
-
};
|
|
3137
|
-
const isWebSocketChannelsMessageDto = (message) => {
|
|
3138
|
-
return Array.isArray(message?.channels)
|
|
3139
|
-
&& message.channels.every((channel) => typeof channel === 'string' && !!channel)
|
|
3140
|
-
&& Object.values(exports.WebSocketResponseEvent).includes(message?.event?.event);
|
|
3141
|
-
};
|
|
3142
|
-
/**
|
|
3143
|
-
* Key used by the client to dispatch a response received on a TOPIC channel to its subscribers.
|
|
3144
|
-
* It is the same key that `getKeyWebSocketEventDto` (base-ui) computes for the subscription.
|
|
3145
|
-
* Returns null when the response is not addressed to this client.
|
|
3146
|
-
*/
|
|
3147
|
-
const getWebSocketResponseEventKeyOfResponse = (response, clientId) => {
|
|
3148
|
-
if (isCodeRunStatusMessageWebSocketResponseEventDto(response)) {
|
|
3149
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.CODE_RUN_STATUS, clientId, response.runId);
|
|
3150
|
-
}
|
|
3151
|
-
if (isSubmissionRunStatusMessageWebSocketResponseEventDto(response)) {
|
|
3152
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.SUBMISSION_RUN_STATUS, clientId, response.submitId);
|
|
3153
|
-
}
|
|
3154
|
-
if (isSendDataWebSocketResponseEventDto(response)) {
|
|
3155
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.SEND_DATA_, clientId, response.dataId);
|
|
3156
|
-
}
|
|
3157
|
-
if (isContestChangesWebSocketResponseEventDto(response)) {
|
|
3158
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.CONTEST_CHANGES, clientId, response.content.contestKey);
|
|
3159
|
-
}
|
|
3160
|
-
if (isProblemCrawledWebSocketResponseEventDto(response)) {
|
|
3161
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.PROBLEM_CRAWLED, clientId, response.content.problemKey);
|
|
3162
|
-
}
|
|
3163
|
-
if (isSubmissionsCrawlWebSocketResponseEventDto(response)) {
|
|
3164
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.SUBMISSIONS_CRAWL, clientId, join([response.content.contestKey, response.content.problemKeys]));
|
|
3165
|
-
}
|
|
3166
|
-
if (isUserNotificationWebSocketResponseEventDto(response)) {
|
|
3167
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.USER_NOTIFICATION_, clientId, '*');
|
|
3168
|
-
}
|
|
3169
|
-
if (isSubmissionJudgingWebSocketResponseEventDto(response)) {
|
|
3170
|
-
// one key for every table: the same event is published on several channels (problem / contest / user) and the
|
|
3171
|
-
// client deduplicates it, so it is dispatched once; each table filters by the submissions it lists
|
|
3172
|
-
return getWebSocketResponseEventKey(exports.WebSocketResponseEvent.SUBMISSION_JUDGING, clientId, '*');
|
|
3173
|
-
}
|
|
3174
|
-
return null;
|
|
3175
|
-
};
|
|
3176
|
-
/**
|
|
3177
|
-
* TOPIC channel that the client has to attach to receive the events of a subscription,
|
|
3178
|
-
* or null when the events arrive by the private channels (session / user) the client is always attached to.
|
|
3179
|
-
* Ably rejects the attach if the token has no capability for the channel.
|
|
3180
|
-
*/
|
|
3181
|
-
const getChannelOfWebSocketSubscribeEvent = (event) => {
|
|
3182
|
-
if (isSubscribeSubmissionRunStatusWebSocketEventDto(event)) {
|
|
3183
|
-
return CHANNEL_SUBMISSION(event.submitId);
|
|
3184
|
-
}
|
|
3185
|
-
// SUBSCRIBE_PROBLEM_CRAWLED: the event arrives by the private user channel of who requested the crawl
|
|
3186
|
-
if (isSubscribeContestChangesWebSocketEventDto(event) || isSubscribeSubmissionsCrawlWebSocketEventDto(event)) {
|
|
3187
|
-
return CHANNEL_CONTEST(event.contestKey, exports.ContestChannelRole.SPECTATORS);
|
|
3188
|
-
}
|
|
3189
|
-
if (isSubscribeSubmissionsJudgingWebSocketEventDto(event)) {
|
|
3190
|
-
// the judging start/end is published on the spectators channel when it is visible to everyone; the hidden ones
|
|
3191
|
-
// (frozen / quiet contests) arrive by the role channels of the contest (managers) and the private user channel
|
|
3192
|
-
if ('problemKey' in event && event.problemKey) {
|
|
3193
|
-
return CHANNEL_PROBLEM(event.problemKey, exports.ProblemChannelRole.SPECTATORS);
|
|
3194
|
-
}
|
|
3195
|
-
if ('contestKey' in event && event.contestKey) {
|
|
3196
|
-
return CHANNEL_CONTEST(event.contestKey, exports.ContestChannelRole.SPECTATORS);
|
|
3197
|
-
}
|
|
3198
|
-
if ('userId' in event && event.userId) {
|
|
3199
|
-
return CHANNEL_USER_ROLE(event.userId, exports.UserChannelRole.SPECTATORS);
|
|
3200
|
-
}
|
|
3201
|
-
}
|
|
3202
|
-
return null;
|
|
3203
|
-
};
|
|
3204
|
-
/**
|
|
3205
|
-
* Contest whose role channels the client needs (the API grants them when the token is requested with this contest).
|
|
3206
|
-
*/
|
|
3207
|
-
const getContestKeyOfWebSocketSubscribeEvent = (event) => {
|
|
3208
|
-
if (isSubscribeContestChangesWebSocketEventDto(event) || isSubscribeSubmissionsCrawlWebSocketEventDto(event)) {
|
|
3209
|
-
return event.contestKey;
|
|
3210
|
-
}
|
|
3211
|
-
if (isSubscribeSubmissionsJudgingWebSocketEventDto(event) && 'contestKey' in event && event.contestKey) {
|
|
3212
|
-
return event.contestKey;
|
|
3213
|
-
}
|
|
3214
|
-
return null;
|
|
3215
|
-
};
|
|
3216
|
-
/**
|
|
3217
|
-
* Problem whose role channels the client needs (the API grants them when the token is requested with this problem).
|
|
3218
|
-
*/
|
|
3219
|
-
const getProblemKeyOfWebSocketSubscribeEvent = (event) => {
|
|
3220
|
-
if (isSubscribeSubmissionsJudgingWebSocketEventDto(event) && 'problemKey' in event && event.problemKey) {
|
|
3221
|
-
return event.problemKey;
|
|
3222
|
-
}
|
|
3223
|
-
return null;
|
|
3224
|
-
};
|
|
3225
|
-
|
|
3226
|
-
function splitTime(timeRemaining) {
|
|
3227
|
-
const remaining = [];
|
|
3228
|
-
// const aYearMilliseconds = 1000 * 60 * 60 * 24 * 365;
|
|
3229
|
-
// const remainingYears = Math.floor(timeRemaining / aYearMilliseconds);
|
|
3230
|
-
// remaining.push({ remaining: remainingYears, label: 'years', milliseconds: aYearMilliseconds });
|
|
3231
|
-
// const aWeekMilliseconds = 1000 * 60 * 60 * 24 * 7;
|
|
3232
|
-
// const remainingWeeks = Math.floor((timeRemaining % aYearMilliseconds) / aWeekMilliseconds);
|
|
3233
|
-
// remaining.push({ remaining: remainingWeeks, label: 'weeks', milliseconds: aWeekMilliseconds });
|
|
3234
|
-
const aSecondMilliseconds = 1000;
|
|
3235
|
-
const aMinuteMilliseconds = aSecondMilliseconds * 60;
|
|
3236
|
-
const aHourMilliseconds = aMinuteMilliseconds * 60;
|
|
3237
|
-
const aDayMilliseconds = aHourMilliseconds * 24;
|
|
3238
|
-
const aWeekMilliseconds = aDayMilliseconds * 7;
|
|
3239
|
-
const remainingWeeks = Math.floor(timeRemaining / aWeekMilliseconds);
|
|
3240
|
-
remaining.push({
|
|
3241
|
-
remaining: remainingWeeks,
|
|
3242
|
-
label: remainingWeeks === 1 ? 'week' : 'weeks',
|
|
3243
|
-
abbreviatedLabel: 'w',
|
|
3244
|
-
milliseconds: aWeekMilliseconds,
|
|
3245
|
-
digits: 2,
|
|
3246
|
-
});
|
|
3247
|
-
const remainingDays = Math.floor((timeRemaining % aWeekMilliseconds) / aDayMilliseconds);
|
|
3248
|
-
remaining.push({
|
|
3249
|
-
remaining: remainingDays,
|
|
3250
|
-
label: remainingDays === 1 ? 'day' : 'days',
|
|
3251
|
-
abbreviatedLabel: 'd',
|
|
3252
|
-
milliseconds: aDayMilliseconds,
|
|
3253
|
-
digits: 2,
|
|
3254
|
-
});
|
|
3255
|
-
const remainingHours = Math.floor((timeRemaining % aDayMilliseconds) / aHourMilliseconds);
|
|
3256
|
-
remaining.push({
|
|
3257
|
-
remaining: remainingHours,
|
|
3258
|
-
label: remainingHours === 1 ? 'hour' : 'hours',
|
|
3259
|
-
abbreviatedLabel: 'h',
|
|
3260
|
-
milliseconds: aHourMilliseconds,
|
|
3261
|
-
digits: 2,
|
|
3262
|
-
});
|
|
3263
|
-
const remainingMinutes = Math.floor((timeRemaining % aHourMilliseconds) / aMinuteMilliseconds);
|
|
3264
|
-
remaining.push({
|
|
3265
|
-
remaining: remainingMinutes,
|
|
3266
|
-
label: remainingMinutes === 1 ? 'minute' : 'minutes',
|
|
3267
|
-
abbreviatedLabel: 'm',
|
|
3268
|
-
milliseconds: aMinuteMilliseconds,
|
|
3269
|
-
digits: 2,
|
|
3270
|
-
});
|
|
3271
|
-
const remainingSeconds = Math.floor((timeRemaining % aMinuteMilliseconds) / aSecondMilliseconds);
|
|
3272
|
-
remaining.push({
|
|
3273
|
-
remaining: remainingSeconds,
|
|
3274
|
-
label: remainingSeconds === 1 ? 'second' : 'seconds',
|
|
3275
|
-
abbreviatedLabel: 's',
|
|
3276
|
-
milliseconds: aSecondMilliseconds,
|
|
3277
|
-
digits: 2,
|
|
3278
|
-
});
|
|
3279
|
-
const remainingMilliseconds = Math.floor(timeRemaining % aSecondMilliseconds);
|
|
3280
|
-
remaining.push({
|
|
3281
|
-
remaining: remainingMilliseconds,
|
|
3282
|
-
label: remainingMilliseconds === 1 ? 'millisecond' : 'milliseconds',
|
|
3283
|
-
abbreviatedLabel: 'ms',
|
|
3284
|
-
milliseconds: 1,
|
|
3285
|
-
digits: 3,
|
|
3286
|
-
});
|
|
3287
|
-
// while (remaining[0].remaining <= 0) {
|
|
3288
|
-
// remaining.shift();
|
|
3289
|
-
// if (remaining.length === 3) {
|
|
3290
|
-
// break;
|
|
3291
|
-
// }
|
|
3292
|
-
// }
|
|
3293
|
-
return remaining;
|
|
3294
|
-
}
|
|
3295
|
-
|
|
3296
|
-
const getUserKey = (userNickname, userOrganizationKey) => {
|
|
3297
|
-
return userNickname + '|' + userOrganizationKey;
|
|
3298
|
-
};
|
|
3299
|
-
const getParamsOfUserKey = (userKey) => {
|
|
3300
|
-
const [userNickname, userOrganizationKey] = userKey.split('|');
|
|
3301
|
-
return { userNickname, userOrganizationKey };
|
|
3302
|
-
};
|
|
3303
|
-
const getClientId = (sessionId, uiId) => {
|
|
3304
|
-
return `${sessionId}|${uiId}`;
|
|
3305
|
-
};
|
|
3306
|
-
const getParamsOfClientId = (clientId) => {
|
|
3307
|
-
const [sessionId, uiId] = clientId.split('|');
|
|
3308
|
-
return { sessionId, uiId };
|
|
3309
|
-
};
|
|
3310
|
-
|
|
3311
|
-
const getWorksheetsInPages = (initialSheets) => {
|
|
3312
|
-
const sheets = [...initialSheets];
|
|
3313
|
-
if (sheets[0]?.type !== exports.WorksheetType.NEW_PAGE) {
|
|
3314
|
-
sheets.unshift(NEW_PAGE_SHEET());
|
|
3315
|
-
}
|
|
3316
|
-
let newPage = sheets[0];
|
|
3317
|
-
let content = [];
|
|
3318
|
-
const sheetsByPages = [];
|
|
3319
|
-
for (let i = 1; i < sheets.length; i++) {
|
|
3320
|
-
const sheet = sheets[i];
|
|
3321
|
-
if (sheet.type === exports.WorksheetType.NEW_PAGE) {
|
|
3322
|
-
sheetsByPages.push({
|
|
3323
|
-
header: newPage,
|
|
3324
|
-
content: [...content],
|
|
3325
|
-
});
|
|
3326
|
-
newPage = sheet;
|
|
3327
|
-
content = [];
|
|
3328
|
-
}
|
|
3329
|
-
else {
|
|
3330
|
-
content.push(sheet);
|
|
3331
|
-
}
|
|
3332
|
-
}
|
|
3333
|
-
sheetsByPages.push({
|
|
3334
|
-
header: newPage,
|
|
3335
|
-
content: [...content],
|
|
3336
|
-
});
|
|
3337
|
-
return sheetsByPages;
|
|
3338
|
-
};
|
|
3339
|
-
const getSummaryWorksheetsInPages = (initialSheets) => {
|
|
3340
|
-
const sheets = [...initialSheets];
|
|
3341
|
-
if (sheets[0]?.type !== exports.WorksheetType.NEW_PAGE) {
|
|
3342
|
-
sheets.unshift(NEW_PAGE_SHEET());
|
|
3343
|
-
}
|
|
3344
|
-
let newPage = sheets[0];
|
|
3345
|
-
let content = [];
|
|
3346
|
-
const sheetsByPages = [];
|
|
3347
|
-
for (let i = 1; i < sheets.length; i++) {
|
|
3348
|
-
const sheet = sheets[i];
|
|
3349
|
-
if (sheet.type === exports.WorksheetType.NEW_PAGE) {
|
|
3350
|
-
sheetsByPages.push({
|
|
3351
|
-
header: newPage,
|
|
3352
|
-
content: content.map(c => ({
|
|
3353
|
-
id: c.id,
|
|
3354
|
-
type: c.type,
|
|
3355
|
-
title: c.title,
|
|
3356
|
-
points: c.points,
|
|
3357
|
-
})),
|
|
3358
|
-
});
|
|
3359
|
-
newPage = sheet;
|
|
3360
|
-
content = [];
|
|
3361
|
-
}
|
|
3362
|
-
else {
|
|
3363
|
-
content.push(sheet);
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
|
-
sheetsByPages.push({
|
|
3367
|
-
header: newPage,
|
|
3368
|
-
content: [...content],
|
|
3369
|
-
});
|
|
3370
|
-
return sheetsByPages;
|
|
3371
|
-
};
|
|
3372
|
-
const getTotalExercisesOfSummaryWorksheetsInPages = (content) => content.reduce((sum, { content }) => sum + content.reduce((sum, { type }) => sum + +(type === exports.WorksheetType.QUIZ_OPTIONS || type === exports.WorksheetType.QUIZ_PROBLEM || type === exports.WorksheetType.QUIZ_TEXT), 0), 0);
|
|
3373
|
-
const isBasicWorksheet = (value) => {
|
|
3374
|
-
return typeof value?.id == 'string' && value.id
|
|
3375
|
-
&& Object.values(exports.WorksheetType).includes(value?.type)
|
|
3376
|
-
&& typeof value?.title == 'string'
|
|
3377
|
-
&& typeof value?.points == 'number';
|
|
3378
|
-
};
|
|
3379
|
-
const isJkmdSheet = (value) => {
|
|
3380
|
-
return isBasicWorksheet(value)
|
|
3381
|
-
&& value?.type === exports.WorksheetType.JK_MD
|
|
3382
|
-
&& typeof value?.content == 'string';
|
|
3383
|
-
};
|
|
3384
|
-
const isCodeEditorSheet = (value) => {
|
|
3385
|
-
return isBasicWorksheet(value)
|
|
3386
|
-
&& value?.type === exports.WorksheetType.CODE_EDITOR
|
|
3387
|
-
&& typeof value?.sourceCode === 'object' && value?.sourceCode !== null
|
|
3388
|
-
&& value?.testCases === 'object' && value?.testCases !== null
|
|
3389
|
-
&& Array.isArray(value?.languages)
|
|
3390
|
-
&& typeof value?.height == 'number';
|
|
3391
|
-
};
|
|
3392
|
-
const isQuizProblemSheet = (value) => {
|
|
3393
|
-
return isBasicWorksheet(value)
|
|
3394
|
-
&& value?.type === exports.WorksheetType.QUIZ_PROBLEM
|
|
3395
|
-
&& Object.values(exports.Judge).includes(value?.problemJudge) || typeof value?.problemJudge === 'string'
|
|
3396
|
-
&& typeof value?.problemKey == 'string'
|
|
3397
|
-
&& Array.isArray(value?.languages)
|
|
3398
|
-
&& typeof value?.height == 'number';
|
|
3399
|
-
};
|
|
3400
|
-
const isQuizOptionsSheet = (value) => {
|
|
3401
|
-
return isBasicWorksheet(value)
|
|
3402
|
-
&& value?.type === exports.WorksheetType.QUIZ_OPTIONS
|
|
3403
|
-
&& typeof value?.description == 'string'
|
|
3404
|
-
&& Array.isArray(value?.options)
|
|
3405
|
-
&& value?.options.every((option) => typeof option?.label == 'string' && typeof option?.correct == 'boolean' && typeof option?.id == 'string')
|
|
3406
|
-
&& typeof value?.multiple == 'boolean'
|
|
3407
|
-
&& (value?.scoringMode === 'TOTAL' || value?.scoringMode === 'PARTIAL');
|
|
3408
|
-
};
|
|
3409
|
-
const isQuizTextSheet = (value) => {
|
|
3410
|
-
return isBasicWorksheet(value)
|
|
3411
|
-
&& value?.type === exports.WorksheetType.QUIZ_TEXT
|
|
3412
|
-
&& typeof value?.description == 'string'
|
|
3413
|
-
&& typeof value?.answer == 'string'
|
|
3414
|
-
&& ['text', 'number', 'textarea'].includes(value?.inputType);
|
|
3415
|
-
};
|
|
3416
|
-
|
|
3417
|
-
exports.ACCEPTED_PROGRAMMING_LANGUAGES = ACCEPTED_PROGRAMMING_LANGUAGES;
|
|
3418
|
-
exports.ASPECT_RATIO = ASPECT_RATIO;
|
|
3419
|
-
exports.AssignmentState = AssignmentState;
|
|
3420
|
-
exports.AssignmentType = AssignmentType;
|
|
3421
|
-
exports.CHANNEL_CONTEST = CHANNEL_CONTEST;
|
|
3422
|
-
exports.CHANNEL_ORGANIZATION_PRESENCE = CHANNEL_ORGANIZATION_PRESENCE;
|
|
3423
|
-
exports.CHANNEL_PROBLEM = CHANNEL_PROBLEM;
|
|
3424
|
-
exports.CHANNEL_SESSION = CHANNEL_SESSION;
|
|
3425
|
-
exports.CHANNEL_SUBMISSION = CHANNEL_SUBMISSION;
|
|
3426
|
-
exports.CHANNEL_SUBMISSION_ALL = CHANNEL_SUBMISSION_ALL;
|
|
3427
|
-
exports.CHANNEL_USER = CHANNEL_USER;
|
|
3428
|
-
exports.CHANNEL_USER_ROLE = CHANNEL_USER_ROLE;
|
|
3429
|
-
exports.CHANNEL_USER_SPECTATORS_ALL = CHANNEL_USER_SPECTATORS_ALL;
|
|
3430
|
-
exports.CODE_LANGUAGE = CODE_LANGUAGE;
|
|
3431
|
-
exports.CONTEST_ROLE = CONTEST_ROLE;
|
|
3432
|
-
exports.CONTEST_STATUS = CONTEST_STATUS;
|
|
3433
|
-
exports.COOKIE_JUKI_SESSION_ID = COOKIE_JUKI_SESSION_ID;
|
|
3434
|
-
exports.COURSE_ROLE = COURSE_ROLE;
|
|
3435
|
-
exports.CourseRole = CourseRole;
|
|
3436
|
-
exports.CourseStatus = CourseStatus;
|
|
3437
|
-
exports.CourseType = CourseType;
|
|
3438
|
-
exports.DAY_NAMES = DAY_NAMES;
|
|
3439
|
-
exports.DEFAULT_JUKI_PROFILE_IMAGE = DEFAULT_JUKI_PROFILE_IMAGE;
|
|
3440
|
-
exports.EMPTY_DOCUMENT_MEMBERS = EMPTY_DOCUMENT_MEMBERS;
|
|
3441
|
-
exports.EMPTY_ENTITY_MEMBERS = EMPTY_ENTITY_MEMBERS;
|
|
3442
|
-
exports.EMPTY_USER_PERMISSIONS = EMPTY_USER_PERMISSIONS;
|
|
3443
|
-
exports.ENTITY_ACCESS = ENTITY_ACCESS;
|
|
3444
|
-
exports.ENTITY_STATE = ENTITY_STATE;
|
|
3445
|
-
exports.ERROR = ERROR;
|
|
3446
|
-
exports.EmailSubscription = EmailSubscription;
|
|
3447
|
-
exports.EmailValidationState = EmailValidationState;
|
|
3448
|
-
exports.FILE_ROLE = FILE_ROLE;
|
|
3449
|
-
exports.FILE_TYPE = FILE_TYPE;
|
|
3450
|
-
exports.HEADER_JUKI_FORWARDED_HOST = HEADER_JUKI_FORWARDED_HOST;
|
|
3451
|
-
exports.HEADER_JUKI_INTERNAL_API_KEY = HEADER_JUKI_INTERNAL_API_KEY;
|
|
3452
|
-
exports.HEADER_JUKI_METADATA = HEADER_JUKI_METADATA;
|
|
3453
|
-
exports.HEADER_JUKI_SECRET_TOKEN = HEADER_JUKI_SECRET_TOKEN;
|
|
3454
|
-
exports.HEADER_JUKI_VISITOR_SESSION_ID = HEADER_JUKI_VISITOR_SESSION_ID;
|
|
3455
|
-
exports.HOURS = HOURS;
|
|
3456
|
-
exports.JUDGE = JUDGE;
|
|
3457
|
-
exports.JUKI_APP_EMAIL_TEMPLATE = JUKI_APP_EMAIL_TEMPLATE;
|
|
3458
|
-
exports.JUKI_APP_ORGANIZATION_KEY = JUKI_APP_ORGANIZATION_KEY;
|
|
3459
|
-
exports.JkError = JkError;
|
|
3460
|
-
exports.LANGUAGE = LANGUAGE;
|
|
3461
|
-
exports.LOWERCASE_LETTERS = LOWERCASE_LETTERS;
|
|
3462
|
-
exports.Language = Language;
|
|
3463
|
-
exports.MAX_DATE = MAX_DATE;
|
|
3464
|
-
exports.MEMBER_ROLE = MEMBER_ROLE;
|
|
3465
|
-
exports.MILLISECONDS = MILLISECONDS;
|
|
3466
|
-
exports.MINUTES = MINUTES;
|
|
3467
|
-
exports.MIN_DATE = MIN_DATE;
|
|
3468
|
-
exports.MONTH_NAMES = MONTH_NAMES;
|
|
3469
|
-
exports.MemberRole = MemberRole;
|
|
3470
|
-
exports.NEW_PAGE_SHEET = NEW_PAGE_SHEET;
|
|
3471
|
-
exports.NUMBERS = NUMBERS;
|
|
3472
|
-
exports.ONE_DAY = ONE_DAY;
|
|
3473
|
-
exports.ONE_HOUR = ONE_HOUR;
|
|
3474
|
-
exports.ONE_MINUTE = ONE_MINUTE;
|
|
3475
|
-
exports.ONE_SECOND = ONE_SECOND;
|
|
3476
|
-
exports.ONE_WEEK = ONE_WEEK;
|
|
3477
|
-
exports.ORGANIZATION_PLAN = ORGANIZATION_PLAN;
|
|
3478
|
-
exports.PAGE = PAGE;
|
|
3479
|
-
exports.PAGE_SIZE = PAGE_SIZE;
|
|
3480
|
-
exports.PAGE_SIZES = PAGE_SIZES;
|
|
3481
|
-
exports.PALLETE = PALLETE;
|
|
3482
|
-
exports.PROBLEM_INPUT = PROBLEM_INPUT;
|
|
3483
|
-
exports.PROBLEM_MODE = PROBLEM_MODE;
|
|
3484
|
-
exports.PROBLEM_MODES = PROBLEM_MODES;
|
|
3485
|
-
exports.PROBLEM_OUTPUT = PROBLEM_OUTPUT;
|
|
3486
|
-
exports.PROBLEM_ROLE = PROBLEM_ROLE;
|
|
3487
|
-
exports.PROBLEM_TYPE = PROBLEM_TYPE;
|
|
3488
|
-
exports.PROBLEM_TYPES = PROBLEM_TYPES;
|
|
3489
|
-
exports.PROBLEM_VERDICT = PROBLEM_VERDICT;
|
|
3490
|
-
exports.PROBLEM_VERDICTS = PROBLEM_VERDICTS;
|
|
3491
|
-
exports.RUNNER_ACCEPTED_PROBLEM_MODES = RUNNER_ACCEPTED_PROBLEM_MODES;
|
|
3492
|
-
exports.RUNNER_ACCEPTED_PROBLEM_TYPES = RUNNER_ACCEPTED_PROBLEM_TYPES;
|
|
3493
|
-
exports.RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES = RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES;
|
|
3494
|
-
exports.RUNNER_TYPE = RUNNER_TYPE;
|
|
3495
|
-
exports.SECONDS = SECONDS;
|
|
3496
|
-
exports.SEC_120 = SEC_120;
|
|
3497
|
-
exports.SEC_30 = SEC_30;
|
|
3498
|
-
exports.SEC_60 = SEC_60;
|
|
3499
|
-
exports.SEC_90 = SEC_90;
|
|
3500
|
-
exports.SEPARATOR_TOKEN = SEPARATOR_TOKEN;
|
|
3501
|
-
exports.SUBMISSION_RUN_STATUS = SUBMISSION_RUN_STATUS;
|
|
3502
|
-
exports.SUPPORT_EMAIL = SUPPORT_EMAIL;
|
|
3503
|
-
exports.SYSTEM_ROLE = SYSTEM_ROLE;
|
|
3504
|
-
exports.SystemRole = SystemRole;
|
|
3505
|
-
exports.TEAM_ROLE = TEAM_ROLE;
|
|
3506
|
-
exports.THEME = THEME;
|
|
3507
|
-
exports.TeamRole = TeamRole;
|
|
3508
|
-
exports.TeamStatus = TeamStatus;
|
|
3509
|
-
exports.Theme = Theme;
|
|
3510
|
-
exports.UPPERCASE_LETTERS = UPPERCASE_LETTERS;
|
|
3511
|
-
exports.USER_ROLE = USER_ROLE;
|
|
3512
|
-
exports.USER_STATUS = USER_STATUS;
|
|
3513
|
-
exports.UserRole = UserRole;
|
|
3514
|
-
exports.UserStatus = UserStatus;
|
|
3515
|
-
exports.UserTeamStatus = UserTeamStatus;
|
|
3516
|
-
exports.YEARS = YEARS;
|
|
3517
|
-
exports._KEY = _KEY;
|
|
3518
|
-
exports._SUB_SUB_TAB = _SUB_SUB_TAB;
|
|
3519
|
-
exports._SUB_TAB = _SUB_TAB;
|
|
3520
|
-
exports._TAB = _TAB;
|
|
3521
|
-
exports._TYPE = _TYPE;
|
|
3522
|
-
exports.areArraysDifferent = areArraysDifferent;
|
|
3523
|
-
exports.changeDay = changeDay;
|
|
3524
|
-
exports.changeHours = changeHours;
|
|
3525
|
-
exports.changeMilliseconds = changeMilliseconds;
|
|
3526
|
-
exports.changeMinutes = changeMinutes;
|
|
3527
|
-
exports.changeMonth = changeMonth;
|
|
3528
|
-
exports.changeSeconds = changeSeconds;
|
|
3529
|
-
exports.changeYear = changeYear;
|
|
3530
|
-
exports.chunkString = chunkString;
|
|
3531
|
-
exports.cleanRequest = cleanRequest;
|
|
3532
|
-
exports.clearAsyncInterval = clearAsyncInterval;
|
|
3533
|
-
exports.consoleError = consoleError;
|
|
3534
|
-
exports.consoleInfo = consoleInfo;
|
|
3535
|
-
exports.consoleWarn = consoleWarn;
|
|
3536
|
-
exports.contentResponse = contentResponse;
|
|
3537
|
-
exports.contentsResponse = contentsResponse;
|
|
3538
|
-
exports.decreaseDay = decreaseDay;
|
|
3539
|
-
exports.decreaseMonth = decreaseMonth;
|
|
3540
|
-
exports.decreaseYear = decreaseYear;
|
|
3541
|
-
exports.endOfDay = endOfDay;
|
|
3542
|
-
exports.endOfHour = endOfHour;
|
|
3543
|
-
exports.endOfMinute = endOfMinute;
|
|
3544
|
-
exports.endOfMonth = endOfMonth;
|
|
3545
|
-
exports.endOfSecond = endOfSecond;
|
|
3546
|
-
exports.endOfWeek = endOfWeek;
|
|
3547
|
-
exports.endOfYear = endOfYear;
|
|
3548
|
-
exports.errorsResponse = errorsResponse;
|
|
3549
|
-
exports.getAssignmentCommentKey = getAssignmentCommentKey;
|
|
3550
|
-
exports.getAssignmentUserCommentKey = getAssignmentUserCommentKey;
|
|
3551
|
-
exports.getChannelOfWebSocketSubscribeEvent = getChannelOfWebSocketSubscribeEvent;
|
|
3552
|
-
exports.getClientId = getClientId;
|
|
3553
|
-
exports.getContestChannelParams = getContestChannelParams;
|
|
3554
|
-
exports.getContestCommentKey = getContestCommentKey;
|
|
3555
|
-
exports.getContestKeyOfWebSocketSubscribeEvent = getContestKeyOfWebSocketSubscribeEvent;
|
|
3556
|
-
exports.getDataLog = getDataLog;
|
|
3557
|
-
exports.getDataOfTestCase = getDataOfTestCase;
|
|
3558
|
-
exports.getDays = getDays;
|
|
3559
|
-
exports.getDefaultMeta = getDefaultMeta;
|
|
3560
|
-
exports.getDocumentAccess = getDocumentAccess;
|
|
3561
|
-
exports.getHours = getHours;
|
|
3562
|
-
exports.getMilliseconds = getMilliseconds;
|
|
3563
|
-
exports.getMinutes = getMinutes;
|
|
3564
|
-
exports.getMonths = getMonths;
|
|
3565
|
-
exports.getParamsOfClientId = getParamsOfClientId;
|
|
3566
|
-
exports.getParamsOfUserKey = getParamsOfUserKey;
|
|
3567
|
-
exports.getPlainText = getPlainText;
|
|
3568
|
-
exports.getProblemChannelParams = getProblemChannelParams;
|
|
3569
|
-
exports.getProblemCommentKey = getProblemCommentKey;
|
|
3570
|
-
exports.getProblemJudgeKey = getProblemJudgeKey;
|
|
3571
|
-
exports.getProblemKeyOfWebSocketSubscribeEvent = getProblemKeyOfWebSocketSubscribeEvent;
|
|
3572
|
-
exports.getRandomString = getRandomString;
|
|
3573
|
-
exports.getSeconds = getSeconds;
|
|
3574
|
-
exports.getSummaryWorksheetsInPages = getSummaryWorksheetsInPages;
|
|
3575
|
-
exports.getTotalExercisesOfSummaryWorksheetsInPages = getTotalExercisesOfSummaryWorksheetsInPages;
|
|
3576
|
-
exports.getUserKey = getUserKey;
|
|
3577
|
-
exports.getVerdictFromTestCase = getVerdictFromTestCase;
|
|
3578
|
-
exports.getWebSocketResponseEventKey = getWebSocketResponseEventKey;
|
|
3579
|
-
exports.getWebSocketResponseEventKeyOfResponse = getWebSocketResponseEventKeyOfResponse;
|
|
3580
|
-
exports.getWorksheetsInPages = getWorksheetsInPages;
|
|
3581
|
-
exports.getYears = getYears;
|
|
3582
|
-
exports.humanFileSize = humanFileSize;
|
|
3583
|
-
exports.increaseDay = increaseDay;
|
|
3584
|
-
exports.increaseMonth = increaseMonth;
|
|
3585
|
-
exports.increaseYear = increaseYear;
|
|
3586
|
-
exports.indexToLetters = indexToLetters;
|
|
3587
|
-
exports.isAfter = isAfter;
|
|
3588
|
-
exports.isBasicWorksheet = isBasicWorksheet;
|
|
3589
|
-
exports.isBefore = isBefore;
|
|
3590
|
-
exports.isCodeEditorSheet = isCodeEditorSheet;
|
|
3591
|
-
exports.isCodeRunStatusMessageWebSocketResponseEventDto = isCodeRunStatusMessageWebSocketResponseEventDto;
|
|
3592
|
-
exports.isContestAssignment = isContestAssignment;
|
|
3593
|
-
exports.isContestChangesWebSocketResponseEventDto = isContestChangesWebSocketResponseEventDto;
|
|
3594
|
-
exports.isCourseAssignment = isCourseAssignment;
|
|
3595
|
-
exports.isDayAfter = isDayAfter;
|
|
3596
|
-
exports.isDayBefore = isDayBefore;
|
|
3597
|
-
exports.isEndlessContest = isEndlessContest;
|
|
3598
|
-
exports.isEqual = isEqual;
|
|
3599
|
-
exports.isFutureContest = isFutureContest;
|
|
3600
|
-
exports.isGlobalContest = isGlobalContest;
|
|
3601
|
-
exports.isHoursAfter = isHoursAfter;
|
|
3602
|
-
exports.isHoursBefore = isHoursBefore;
|
|
3603
|
-
exports.isJkmdSheet = isJkmdSheet;
|
|
3604
|
-
exports.isMillisecondsAfter = isMillisecondsAfter;
|
|
3605
|
-
exports.isMillisecondsBefore = isMillisecondsBefore;
|
|
3606
|
-
exports.isMinutesAfter = isMinutesAfter;
|
|
3607
|
-
exports.isMinutesBefore = isMinutesBefore;
|
|
3608
|
-
exports.isMonthAfter = isMonthAfter;
|
|
3609
|
-
exports.isMonthBefore = isMonthBefore;
|
|
3610
|
-
exports.isObjectJson = isObjectJson;
|
|
3611
|
-
exports.isPastContest = isPastContest;
|
|
3612
|
-
exports.isProblemCrawledWebSocketResponseEventDto = isProblemCrawledWebSocketResponseEventDto;
|
|
3613
|
-
exports.isQuizOptionsSheet = isQuizOptionsSheet;
|
|
3614
|
-
exports.isQuizProblemSheet = isQuizProblemSheet;
|
|
3615
|
-
exports.isQuizTextSheet = isQuizTextSheet;
|
|
3616
|
-
exports.isSameDay = isSameDay;
|
|
3617
|
-
exports.isSameHour = isSameHour;
|
|
3618
|
-
exports.isSameMillisecond = isSameMillisecond;
|
|
3619
|
-
exports.isSameMinute = isSameMinute;
|
|
3620
|
-
exports.isSameMonth = isSameMonth;
|
|
3621
|
-
exports.isSameSecond = isSameSecond;
|
|
3622
|
-
exports.isSameYear = isSameYear;
|
|
3623
|
-
exports.isSecondsAfter = isSecondsAfter;
|
|
3624
|
-
exports.isSecondsBefore = isSecondsBefore;
|
|
3625
|
-
exports.isSendDataEc2InstancesListWebSocketResponseEventDto = isSendDataEc2InstancesListWebSocketResponseEventDto;
|
|
3626
|
-
exports.isSendDataEcsTaskDefinitionListWebSocketResponseEventDto = isSendDataEcsTaskDefinitionListWebSocketResponseEventDto;
|
|
3627
|
-
exports.isSendDataEcsTasksListWebSocketResponseEventDto = isSendDataEcsTasksListWebSocketResponseEventDto;
|
|
3628
|
-
exports.isSendDataRunCommandWebSocketResponseEventDto = isSendDataRunCommandWebSocketResponseEventDto;
|
|
3629
|
-
exports.isSendDataSsmSessionsListWebSocketResponseEventDto = isSendDataSsmSessionsListWebSocketResponseEventDto;
|
|
3630
|
-
exports.isSendDataWebSocketResponseEventDto = isSendDataWebSocketResponseEventDto;
|
|
3631
|
-
exports.isStringJson = isStringJson;
|
|
3632
|
-
exports.isSubmissionJudgingWebSocketResponseEventDto = isSubmissionJudgingWebSocketResponseEventDto;
|
|
3633
|
-
exports.isSubmissionRunStatusMessageWebSocketResponseEventDto = isSubmissionRunStatusMessageWebSocketResponseEventDto;
|
|
3634
|
-
exports.isSubmissionsCrawlWebSocketResponseEventDto = isSubmissionsCrawlWebSocketResponseEventDto;
|
|
3635
|
-
exports.isSubmissionsJudgingScope = isSubmissionsJudgingScope;
|
|
3636
|
-
exports.isSubscribeCodeRunStatusWebSocketEventDto = isSubscribeCodeRunStatusWebSocketEventDto;
|
|
3637
|
-
exports.isSubscribeContestChangesWebSocketEventDto = isSubscribeContestChangesWebSocketEventDto;
|
|
3638
|
-
exports.isSubscribeGetDataWebSocketEventDto = isSubscribeGetDataWebSocketEventDto;
|
|
3639
|
-
exports.isSubscribeProblemCrawledWebSocketEventDto = isSubscribeProblemCrawledWebSocketEventDto;
|
|
3640
|
-
exports.isSubscribeSubmissionRunStatusWebSocketEventDto = isSubscribeSubmissionRunStatusWebSocketEventDto;
|
|
3641
|
-
exports.isSubscribeSubmissionsCrawlWebSocketEventDto = isSubscribeSubmissionsCrawlWebSocketEventDto;
|
|
3642
|
-
exports.isSubscribeSubmissionsJudgingWebSocketEventDto = isSubscribeSubmissionsJudgingWebSocketEventDto;
|
|
3643
|
-
exports.isSubscribeUserNotificationWebSocketEventDto = isSubscribeUserNotificationWebSocketEventDto;
|
|
3644
|
-
exports.isTeamMember = isTeamMember;
|
|
3645
|
-
exports.isToday = isToday;
|
|
3646
|
-
exports.isUnsubscribeCodeRunStatusWebSocketEventDto = isUnsubscribeCodeRunStatusWebSocketEventDto;
|
|
3647
|
-
exports.isUnsubscribeContestChangesWebSocketEventDto = isUnsubscribeContestChangesWebSocketEventDto;
|
|
3648
|
-
exports.isUnsubscribeGetDataWebSocketEventDto = isUnsubscribeGetDataWebSocketEventDto;
|
|
3649
|
-
exports.isUnsubscribeProblemCrawledWebSocketEventDto = isUnsubscribeProblemCrawledWebSocketEventDto;
|
|
3650
|
-
exports.isUnsubscribeSubmissionRunStatusWebSocketEventDto = isUnsubscribeSubmissionRunStatusWebSocketEventDto;
|
|
3651
|
-
exports.isUnsubscribeSubmissionsCrawlWebSocketEventDto = isUnsubscribeSubmissionsCrawlWebSocketEventDto;
|
|
3652
|
-
exports.isUnsubscribeSubmissionsJudgingWebSocketEventDto = isUnsubscribeSubmissionsJudgingWebSocketEventDto;
|
|
3653
|
-
exports.isUnsubscribeUserNotificationWebSocketEventDto = isUnsubscribeUserNotificationWebSocketEventDto;
|
|
3654
|
-
exports.isUserMember = isUserMember;
|
|
3655
|
-
exports.isUserMessageWebSocketResponseEventDto = isUserMessageWebSocketResponseEventDto;
|
|
3656
|
-
exports.isUserNotificationContestClarificationWebSocketResponseEventDto = isUserNotificationContestClarificationWebSocketResponseEventDto;
|
|
3657
|
-
exports.isUserNotificationSubmissionWebSocketResponseEventDto = isUserNotificationSubmissionWebSocketResponseEventDto;
|
|
3658
|
-
exports.isUserNotificationWebSocketResponseEventDto = isUserNotificationWebSocketResponseEventDto;
|
|
3659
|
-
exports.isValidDate = isValidDate;
|
|
3660
|
-
exports.isWebSocketChannelsMessageDto = isWebSocketChannelsMessageDto;
|
|
3661
|
-
exports.isWebSocketResponseEventDto = isWebSocketResponseEventDto;
|
|
3662
|
-
exports.isWebsocketSubscription = isWebsocketSubscription;
|
|
3663
|
-
exports.isWithinInterval = isWithinInterval;
|
|
3664
|
-
exports.isWorksheetAssignment = isWorksheetAssignment;
|
|
3665
|
-
exports.isYearAfter = isYearAfter;
|
|
3666
|
-
exports.isYearBefore = isYearBefore;
|
|
3667
|
-
exports.join = join;
|
|
3668
|
-
exports.lettersToIndex = lettersToIndex;
|
|
3669
|
-
exports.memorySizeOf = memorySizeOf;
|
|
3670
|
-
exports.mergeVerdicts = mergeVerdicts;
|
|
3671
|
-
exports.mex = mex;
|
|
3672
|
-
exports.normalizeToLocalStartOfDay = normalizeToLocalStartOfDay;
|
|
3673
|
-
exports.normalizeToLocalStartOfHour = normalizeToLocalStartOfHour;
|
|
3674
|
-
exports.normalizeToLocalStartOfMinutes = normalizeToLocalStartOfMinutes;
|
|
3675
|
-
exports.normalizeToLocalStartOfSeconds = normalizeToLocalStartOfSeconds;
|
|
3676
|
-
exports.objectUpdate = objectUpdate;
|
|
3677
|
-
exports.objectsUpdate = objectsUpdate;
|
|
3678
|
-
exports.padEnd = padEnd;
|
|
3679
|
-
exports.padStart = padStart;
|
|
3680
|
-
exports.range = range;
|
|
3681
|
-
exports.removeExtension = removeExtension;
|
|
3682
|
-
exports.safeJsonParse = safeJsonParse;
|
|
3683
|
-
exports.setAsyncInterval = setAsyncInterval;
|
|
3684
|
-
exports.split = split;
|
|
3685
|
-
exports.splitTime = splitTime;
|
|
3686
|
-
exports.startOfDay = startOfDay;
|
|
3687
|
-
exports.startOfHour = startOfHour;
|
|
3688
|
-
exports.startOfMinute = startOfMinute;
|
|
3689
|
-
exports.startOfMonth = startOfMonth;
|
|
3690
|
-
exports.startOfSecond = startOfSecond;
|
|
3691
|
-
exports.startOfWeek = startOfWeek;
|
|
3692
|
-
exports.startOfYear = startOfYear;
|
|
3693
|
-
exports.stringToArrayBuffer = stringToArrayBuffer;
|
|
3694
|
-
exports.toEntityMembersDto = toEntityMembersDto;
|
|
3695
|
-
exports.toJkError = toJkError;
|