@juki-team/commons 0.1.32 → 0.1.41

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