@juki-team/commons 0.1.46 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/{types/constants → constants}/commons.d.ts +1 -1
  2. package/dist/constants/commons.js +648 -0
  3. package/dist/{types/constants → constants}/contest.d.ts +1 -1
  4. package/dist/constants/contest.js +28 -0
  5. package/dist/{types/constants → constants}/course.d.ts +1 -1
  6. package/dist/constants/course.js +12 -0
  7. package/dist/constants/date.js +23 -0
  8. package/dist/constants/email.js +34 -0
  9. package/dist/{types/constants → constants}/entity.d.ts +1 -1
  10. package/dist/constants/entity.js +18 -0
  11. package/dist/{types/constants → constants}/file.d.ts +1 -1
  12. package/dist/constants/file.js +45 -0
  13. package/dist/constants/index.d.ts +18 -0
  14. package/dist/constants/index.js +18 -0
  15. package/dist/{types/constants → constants}/judge.d.ts +1 -1
  16. package/dist/constants/judge.js +225 -0
  17. package/dist/{types/constants → constants}/organization.d.ts +1 -1
  18. package/dist/constants/organization.js +24 -0
  19. package/dist/{types/constants → constants}/problem.d.ts +1 -1
  20. package/dist/constants/problem.js +69 -0
  21. package/dist/constants/routing.js +7 -0
  22. package/dist/{types/constants → constants}/services.d.ts +1 -1
  23. package/dist/constants/services.js +157 -0
  24. package/dist/{types/constants → constants}/system.d.ts +1 -1
  25. package/dist/constants/system.js +9 -0
  26. package/dist/{types/constants → constants}/teams.d.ts +1 -1
  27. package/dist/constants/teams.js +17 -0
  28. package/dist/constants/time.js +9 -0
  29. package/dist/{types/constants → constants}/user.d.ts +2 -2
  30. package/dist/constants/user.js +40 -0
  31. package/dist/{types/constants → constants}/websocket.d.ts +7 -3
  32. package/dist/constants/websocket.js +56 -0
  33. package/dist/{types/constants → constants}/worksheet.d.ts +1 -1
  34. package/dist/constants/worksheet.js +66 -0
  35. package/dist/{types/dto → dto}/class.d.ts +3 -3
  36. package/dist/dto/class.js +1 -0
  37. package/dist/{types/dto → dto}/code.d.ts +1 -1
  38. package/dist/dto/code.js +1 -0
  39. package/dist/{types/dto → dto}/comments.d.ts +1 -1
  40. package/dist/dto/comments.js +1 -0
  41. package/dist/{types/dto → dto}/contest.d.ts +4 -4
  42. package/dist/dto/contest.js +7 -0
  43. package/dist/{types/dto → dto}/course.d.ts +4 -4
  44. package/dist/dto/course.js +1 -0
  45. package/dist/{types/dto → dto}/entity.d.ts +2 -2
  46. package/dist/dto/entity.js +5 -0
  47. package/dist/{types/dto → dto}/excalidraw.d.ts +3 -3
  48. package/dist/dto/excalidraw.js +1 -0
  49. package/dist/{types/dto → dto}/file.d.ts +2 -2
  50. package/dist/dto/file.js +1 -0
  51. package/dist/dto/image.js +1 -0
  52. package/dist/dto/index.d.ts +25 -0
  53. package/dist/dto/index.js +25 -0
  54. package/dist/{types/dto → dto}/judge.d.ts +1 -1
  55. package/dist/dto/judge.js +1 -0
  56. package/dist/{types/dto → dto}/markdown.d.ts +3 -3
  57. package/dist/dto/markdown.js +1 -0
  58. package/dist/{types/dto → dto}/mermaid.d.ts +3 -3
  59. package/dist/dto/mermaid.js +1 -0
  60. package/dist/{types/dto → dto}/organization.d.ts +3 -3
  61. package/dist/dto/organization.js +1 -0
  62. package/dist/{types/dto → dto}/problem.d.ts +3 -3
  63. package/dist/dto/problem.js +1 -0
  64. package/dist/{types/dto → dto}/scoreboard.d.ts +2 -2
  65. package/dist/dto/scoreboard.js +1 -0
  66. package/dist/{types/dto → dto}/session.d.ts +2 -2
  67. package/dist/dto/session.js +1 -0
  68. package/dist/{types/dto → dto}/socket.d.ts +5 -5
  69. package/dist/dto/socket.js +1 -0
  70. package/dist/{types/dto → dto}/statistics.d.ts +1 -1
  71. package/dist/dto/statistics.js +1 -0
  72. package/dist/{types/dto → dto}/submission.d.ts +3 -3
  73. package/dist/dto/submission.js +1 -0
  74. package/dist/{types/dto → dto}/system.d.ts +1 -1
  75. package/dist/dto/system.js +1 -0
  76. package/dist/dto/url.js +1 -0
  77. package/dist/{types/dto → dto}/user.d.ts +3 -3
  78. package/dist/dto/user.js +1 -0
  79. package/dist/{types/dto → dto}/virtual-user.d.ts +1 -1
  80. package/dist/dto/virtual-user.js +1 -0
  81. package/dist/{types/dto → dto}/worksheet-submissions.d.ts +3 -3
  82. package/dist/dto/worksheet-submissions.js +1 -0
  83. package/dist/{types/dto → dto}/worksheet.d.ts +3 -3
  84. package/dist/dto/worksheet.js +1 -0
  85. package/dist/{types/helpers → helpers}/class.d.ts +1 -1
  86. package/dist/helpers/class.js +10 -0
  87. package/dist/helpers/comments.js +4 -0
  88. package/dist/{types/helpers → helpers}/commons.d.ts +1 -1
  89. package/dist/helpers/commons.js +187 -0
  90. package/dist/{types/helpers → helpers}/contest.d.ts +1 -1
  91. package/dist/helpers/contest.js +21 -0
  92. package/dist/helpers/date.js +181 -0
  93. package/dist/{types/helpers → helpers}/document.d.ts +2 -2
  94. package/dist/helpers/document.js +51 -0
  95. package/dist/{types/helpers → helpers}/errors.d.ts +1 -1
  96. package/dist/helpers/errors.js +17 -0
  97. package/dist/helpers/file.js +4 -0
  98. package/dist/helpers/index.d.ts +17 -0
  99. package/dist/helpers/index.js +17 -0
  100. package/dist/helpers/interval.js +24 -0
  101. package/dist/{types/helpers → helpers}/judging.d.ts +1 -1
  102. package/dist/helpers/judging.js +124 -0
  103. package/dist/helpers/number.js +2 -0
  104. package/dist/helpers/object.js +33 -0
  105. package/dist/{types/helpers → helpers}/responses.d.ts +2 -2
  106. package/dist/helpers/responses.js +95 -0
  107. package/dist/{types/helpers → helpers}/socket.d.ts +3 -3
  108. package/dist/helpers/socket.js +279 -0
  109. package/dist/{types/helpers → helpers}/time.d.ts +1 -1
  110. package/dist/helpers/time.js +69 -0
  111. package/dist/{types/helpers → helpers}/user.d.ts +1 -1
  112. package/dist/helpers/user.js +14 -0
  113. package/dist/{types/helpers → helpers}/worksheet.d.ts +1 -1
  114. package/dist/helpers/worksheet.js +107 -0
  115. package/dist/index.d.ts +4 -0
  116. package/dist/index.js +4 -0
  117. package/dist/types/account.js +10 -0
  118. package/dist/types/{types/class.d.ts → class.d.ts} +2 -2
  119. package/dist/types/class.js +7 -0
  120. package/dist/types/comments.js +1 -0
  121. package/dist/types/{types/commons.d.ts → commons.d.ts} +1 -1
  122. package/dist/types/commons.js +69 -0
  123. package/dist/types/{types/contest.d.ts → contest.d.ts} +4 -4
  124. package/dist/types/contest.js +27 -0
  125. package/dist/types/{types/course.d.ts → course.d.ts} +1 -1
  126. package/dist/types/course.js +1 -0
  127. package/dist/types/entity.js +50 -0
  128. package/dist/types/{types/excalidraw.d.ts → excalidraw.d.ts} +1 -1
  129. package/dist/types/excalidraw.js +1 -0
  130. package/dist/types/{types/file.d.ts → file.d.ts} +2 -2
  131. package/dist/types/file.js +19 -0
  132. package/dist/types/{types/group.d.ts → group.d.ts} +1 -1
  133. package/dist/types/group.js +5 -0
  134. package/dist/types/index.d.ts +27 -4
  135. package/dist/types/index.js +27 -0
  136. package/dist/types/{types/judge.d.ts → judge.d.ts} +2 -2
  137. package/dist/types/judge.js +49 -0
  138. package/dist/types/{types/markdown.d.ts → markdown.d.ts} +1 -1
  139. package/dist/types/markdown.js +1 -0
  140. package/dist/types/{types/mermaid.d.ts → mermaid.d.ts} +1 -1
  141. package/dist/types/mermaid.js +1 -0
  142. package/dist/types/notification.js +8 -0
  143. package/dist/types/organization.js +14 -0
  144. package/dist/types/{types/prisma.d.ts → prisma.d.ts} +1 -1
  145. package/dist/types/prisma.js +106 -0
  146. package/dist/types/{types/problems.d.ts → problems.d.ts} +3 -3
  147. package/dist/types/problems.js +28 -0
  148. package/dist/types/scoreboard.js +1 -0
  149. package/dist/types/{types/services.d.ts → services.d.ts} +1 -1
  150. package/dist/types/services.js +152 -0
  151. package/dist/types/{types/sheet.d.ts → sheet.d.ts} +2 -2
  152. package/dist/types/sheet.js +16 -0
  153. package/dist/types/{types/socket.d.ts → socket.d.ts} +3 -2
  154. package/dist/types/socket.js +76 -0
  155. package/dist/types/submission.js +1 -0
  156. package/dist/types/system.js +1 -0
  157. package/dist/types/{types/teams.d.ts → teams.d.ts} +2 -2
  158. package/dist/types/teams.js +1 -0
  159. package/dist/types/{types/users.d.ts → users.d.ts} +2 -2
  160. package/dist/types/users.js +23 -0
  161. package/dist/types/virtual-user.js +8 -0
  162. package/dist/types/{types/worksheet.d.ts → worksheet.d.ts} +3 -3
  163. package/dist/types/worksheet.js +11 -0
  164. package/package.json +8 -11
  165. package/dist/cjs/index.cjs +0 -3695
  166. package/dist/esm/index.js +0 -3415
  167. package/dist/types/constants/index.d.ts +0 -18
  168. package/dist/types/dto/index.d.ts +0 -25
  169. package/dist/types/helpers/index.d.ts +0 -17
  170. package/dist/types/types/index.d.ts +0 -27
  171. /package/dist/{types/constants → constants}/date.d.ts +0 -0
  172. /package/dist/{types/constants → constants}/email.d.ts +0 -0
  173. /package/dist/{types/constants → constants}/routing.d.ts +0 -0
  174. /package/dist/{types/constants → constants}/time.d.ts +0 -0
  175. /package/dist/{types/dto → dto}/image.d.ts +0 -0
  176. /package/dist/{types/dto → dto}/url.d.ts +0 -0
  177. /package/dist/{types/helpers → helpers}/comments.d.ts +0 -0
  178. /package/dist/{types/helpers → helpers}/date.d.ts +0 -0
  179. /package/dist/{types/helpers → helpers}/file.d.ts +0 -0
  180. /package/dist/{types/helpers → helpers}/interval.d.ts +0 -0
  181. /package/dist/{types/helpers → helpers}/number.d.ts +0 -0
  182. /package/dist/{types/helpers → helpers}/object.d.ts +0 -0
  183. /package/dist/types/{types/account.d.ts → account.d.ts} +0 -0
  184. /package/dist/types/{types/comments.d.ts → comments.d.ts} +0 -0
  185. /package/dist/types/{types/entity.d.ts → entity.d.ts} +0 -0
  186. /package/dist/types/{types/notification.d.ts → notification.d.ts} +0 -0
  187. /package/dist/types/{types/organization.d.ts → organization.d.ts} +0 -0
  188. /package/dist/types/{types/scoreboard.d.ts → scoreboard.d.ts} +0 -0
  189. /package/dist/types/{types/submission.d.ts → submission.d.ts} +0 -0
  190. /package/dist/types/{types/system.d.ts → system.d.ts} +0 -0
  191. /package/dist/types/{types/virtual-user.d.ts → virtual-user.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { CodeLanguage, Language, Theme } from '../types';
1
+ import { CodeLanguage, Language, Theme } from '../types/index.js';
2
2
  export declare const LANGUAGE: {
3
3
  [key in Language]: {
4
4
  value: Language;
@@ -0,0 +1,648 @@
1
+ import { CodeLanguage, Language, Theme } from '../types/index.js';
2
+ export const LANGUAGE = {
3
+ [Language.EN]: { value: Language.EN, label: 'english' },
4
+ [Language.ES]: { value: Language.ES, label: 'español' },
5
+ };
6
+ export const THEME = {
7
+ [Theme.LIGHT]: { value: Theme.LIGHT, label: 'light' },
8
+ [Theme.DARK]: { value: Theme.DARK, label: 'dark' },
9
+ };
10
+ const GCC_VERSION = `gcc (Debian 12.2.0-14+deb12u1) 12.2.0
11
+ Copyright (C) 2022 Free Software Foundation, Inc.
12
+ This is free software; see the source for copying conditions. There is NO
13
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.`;
14
+ const GPP_VERSION = `g++ (Debian 12.2.0-14+deb12u1) 12.2.0
15
+ Copyright (C) 2022 Free Software Foundation, Inc.
16
+ This is free software; see the source for copying conditions. There is NO
17
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.`;
18
+ const JAVAC_VERSION = `javac 17.0.15`;
19
+ const NODE_VERSION = `v20.19.2`;
20
+ const PYTHON3_VERSION = 'Python 3.11.2';
21
+ const PYPY3_VERSION = `Python 3.9.16 (7.3.11+dfsg-2+deb12u3, Dec 30 2024, 22:36:23)
22
+ [PyPy 7.3.11 with GCC 12.2.0]`;
23
+ const PSEINT_VERSION = `PSeInt 20230904-l64-wx3
24
+ http://pseint.sourceforge.net
25
+ by Pablo Novara (zaskar_84@yahoo.com.ar)
26
+ psExport 20230904-l64-wx3
27
+ http://pseint.sourceforge.net
28
+ by Pablo Novara (zaskar_84@yahoo.com.ar)`;
29
+ const C = {
30
+ mime: 'text/x-csrc',
31
+ mainFilename: 'main.c',
32
+ fileExtension: ['c'],
33
+ hasBuildFile: true,
34
+ executable: 'gcc',
35
+ executableVersion: GCC_VERSION,
36
+ templateSourceCode: '#include <stdio.h>\n \nint main(void) {\n \n printf("Hello World\\n");\n \n return 0;\n}',
37
+ monacoKey: 'c',
38
+ codeMirrorKey: 'c',
39
+ highlightJsKey: 'c',
40
+ };
41
+ const CPP = {
42
+ mime: 'text/x-c++src',
43
+ mainFilename: 'main.cpp',
44
+ fileExtension: ['cpp', 'c++', 'cxx', 'cc'],
45
+ hasBuildFile: true,
46
+ executable: 'g++',
47
+ executableVersion: GPP_VERSION,
48
+ templateSourceCode: '#include <iostream>\n\nusing namespace std;\n\n' + 'int main() {\n \n cout << "Hello World" << endl;\n \n return 0;\n}',
49
+ monacoKey: 'cpp',
50
+ codeMirrorKey: 'cpp',
51
+ highlightJsKey: 'cpp',
52
+ };
53
+ const PYTHON = {
54
+ mime: 'text/x-python',
55
+ mainFilename: 'main.py',
56
+ fileExtension: ['py'],
57
+ hasBuildFile: false,
58
+ templateSourceCode: 'print("Hello World\\n")',
59
+ monacoKey: 'python',
60
+ codeMirrorKey: 'python',
61
+ highlightJsKey: 'python',
62
+ };
63
+ export const CODE_LANGUAGE = {
64
+ [CodeLanguage.C_11]: {
65
+ value: CodeLanguage.C_11,
66
+ label: 'C 11',
67
+ compilePattern: '/usr/bin/jk-c11 -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -O2 -std=gnu11 -o ' +
68
+ '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
69
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
70
+ ...C,
71
+ /*
72
+ -static
73
+ Binario independiente.
74
+ -fno-optimize-sibling-calls
75
+ Desactiva la optimización de llamadas recursivas “tail call”. Facilita detectar desbordes de pila o trazas correctas.
76
+ -fno-strict-aliasing
77
+ Evita asumir aliasing de punteros agresivo. Previene bugs raros en código competitivo.
78
+ -DONLINE_JUDGE
79
+ Define la macro ONLINE_JUDGE, usada a veces para omitir logs o debug prints (#ifdef ONLINE_JUDGE).
80
+ -fno-asm
81
+ Prohíbe insertar código ensamblador inline (asm()). Seguridad en entornos restringidos.
82
+ -lm
83
+ Enlaza libm.
84
+ -s
85
+ “Strips symbols”: elimina toda información de depuración. Binario más pequeño y más difícil de desensamblar.
86
+ -O2
87
+ Nivel medio de optimización (rápido y seguro).
88
+ -std=gnu11
89
+ Usa el estándar C11 con extensiones GNU.
90
+ */
91
+ },
92
+ [CodeLanguage.CPP_11]: {
93
+ value: CodeLanguage.CPP_11,
94
+ label: 'C++ 11',
95
+ compilePattern: '/usr/bin/jk-cpp11 -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=gnu++11 -o ' +
96
+ '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
97
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
98
+ ...CPP,
99
+ },
100
+ [CodeLanguage.CPP_20]: {
101
+ value: CodeLanguage.CPP_20,
102
+ label: 'C++ 20',
103
+ compilePattern: '/usr/bin/jk-cpp20 -x c++ -static -DONLINE_JUDGE -lm -s -O2 -std=gnu++20 -o ' +
104
+ '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
105
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
106
+ ...CPP,
107
+ },
108
+ [CodeLanguage.JAVA_21]: {
109
+ value: CodeLanguage.JAVA_21,
110
+ label: 'Java 21',
111
+ mime: 'text/x-java',
112
+ mainFilename: 'Main.java',
113
+ fileExtension: ['java'],
114
+ compilePattern: "/usr/bin/jk-javac -cp '.;*' {{folder_path}}/{{source_full_file_name}}",
115
+ // compilePattern: 'javac {{folder_path}}/{{source_full_file_name}}',
116
+ // runPattern: 'java -cp {{folder_path}} {{class_name}}'
117
+ runPattern: '/usr/bin/jk-java -Xmx512M -Xss64M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -cp ' + '{{folder_path}} {{class_name}}',
118
+ templateSourceCode: 'class Main {\n public static void main (String[] args) {' + '\n \n System.out.println("Hello World");\n \n }\n}',
119
+ hasBuildFile: true,
120
+ executable: 'java',
121
+ executableVersion: JAVAC_VERSION,
122
+ monacoKey: 'java',
123
+ codeMirrorKey: 'java',
124
+ highlightJsKey: 'java',
125
+ },
126
+ [CodeLanguage.PYTHON_2]: {
127
+ // DEPRECATED
128
+ value: CodeLanguage.PYTHON_2,
129
+ label: 'Python 2 *',
130
+ compilePattern: '/usr/bin/jk-python2 -m py_compile {{folder_path}}/{{source_full_file_name}}',
131
+ runPattern: '/usr/bin/jk-python2 {{folder_path}}/{{source_full_file_name}}',
132
+ executable: 'python2',
133
+ executableVersion: PYPY3_VERSION,
134
+ ...PYTHON,
135
+ },
136
+ [CodeLanguage.PYTHON_3]: {
137
+ value: CodeLanguage.PYTHON_3,
138
+ label: 'Python 3',
139
+ compilePattern: '/usr/bin/jk-python3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
140
+ runPattern: '/usr/bin/jk-python3 {{folder_path}}/{{source_full_file_name}}',
141
+ executable: 'python3',
142
+ executableVersion: PYPY3_VERSION,
143
+ ...PYTHON,
144
+ },
145
+ [CodeLanguage.PYTHON_PYPY_2]: {
146
+ // DEPRECATED
147
+ value: CodeLanguage.PYTHON_PYPY_2,
148
+ label: 'PyPy 2 *',
149
+ compilePattern: '/usr/bin/jk-pypy2 -m py_compile {{folder_path}}/{{source_full_file_name}}',
150
+ runPattern: '/usr/bin/jk-pypy2 {{folder_path}}/{{source_full_file_name}}',
151
+ executable: 'pypy2',
152
+ executableVersion: PYPY3_VERSION,
153
+ ...PYTHON,
154
+ },
155
+ [CodeLanguage.PYTHON_PYPY_3]: {
156
+ value: CodeLanguage.PYTHON_PYPY_3,
157
+ label: 'PyPy 3',
158
+ compilePattern: '/usr/bin/jk-pypy3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
159
+ runPattern: '/usr/bin/jk-pypy3 {{folder_path}}/{{source_full_file_name}}',
160
+ executable: 'pypy3',
161
+ executableVersion: PYPY3_VERSION,
162
+ ...PYTHON,
163
+ },
164
+ [CodeLanguage.JAVASCRIPT_NODE_JS_22]: {
165
+ value: CodeLanguage.JAVASCRIPT_NODE_JS_22,
166
+ label: 'Javascript Node.js 22',
167
+ mime: 'application/x-javascript',
168
+ mainFilename: 'main.js',
169
+ fileExtension: ['js'],
170
+ compilePattern: '',
171
+ runPattern: '/usr/bin/jk-node22 {{folder_path}}/{{source_full_file_name}}',
172
+ templateSourceCode: 'console.log("Hello World\\n")',
173
+ hasBuildFile: false,
174
+ executable: 'node',
175
+ executableVersion: NODE_VERSION,
176
+ monacoKey: 'javascript',
177
+ codeMirrorKey: 'javascript',
178
+ highlightJsKey: 'javascript',
179
+ },
180
+ [CodeLanguage.ICPC_C]: {
181
+ // DEPRECATED
182
+ value: CodeLanguage.ICPC_C,
183
+ label: 'ICPC C *',
184
+ compilePattern: 'gcc -x c -g -O2 -std=gnu11 -static -lm -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
185
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
186
+ ...C,
187
+ },
188
+ [CodeLanguage.C]: {
189
+ // DEPRECATED
190
+ value: CodeLanguage.C,
191
+ label: 'C *',
192
+ compilePattern: 'gcc -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -O2 -o ' +
193
+ '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
194
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
195
+ ...C,
196
+ },
197
+ [CodeLanguage.ICPC_CPP]: {
198
+ // DEPRECATED
199
+ value: CodeLanguage.ICPC_CPP,
200
+ label: 'ICPC C++ *',
201
+ compilePattern: 'g++ -x c++ -static -g -O2 -std=gnu++20 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
202
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
203
+ ...CPP,
204
+ },
205
+ [CodeLanguage.CPP]: {
206
+ // DEPRECATED
207
+ value: CodeLanguage.CPP,
208
+ label: 'C++ *',
209
+ compilePattern: 'g++ -x c++ -static -DONLINE_JUDGE -lm -s -O2 -o ' + '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}',
210
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
211
+ ...CPP,
212
+ },
213
+ [CodeLanguage.CPP11]: {
214
+ // DEPRECATED
215
+ value: CodeLanguage.CPP11,
216
+ label: 'C++ 11 *',
217
+ 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}}',
218
+ // compilePattern: 'g++ -O2 -s -Wall -std=c++11 -o {{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}} -lm',
219
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
220
+ ...CPP,
221
+ },
222
+ [CodeLanguage.CPP14]: {
223
+ // DEPRECATED
224
+ value: CodeLanguage.CPP14,
225
+ label: 'C++ 14 *',
226
+ // compilePattern: 'g++ -O2 -s -Wall -std=c++14 -o {{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}} -lm',
227
+ 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}}',
228
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
229
+ ...CPP,
230
+ },
231
+ [CodeLanguage.CPP17]: {
232
+ // DEPRECATED
233
+ value: CodeLanguage.CPP17,
234
+ label: 'C++ 17 *',
235
+ // compilePattern: 'g++ -O2 -s -Wall -std=c++17 -o {{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}} -lm',
236
+ 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}}',
237
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
238
+ ...CPP,
239
+ },
240
+ [CodeLanguage.JAVA]: {
241
+ // DEPRECATED
242
+ value: CodeLanguage.JAVA,
243
+ label: 'Java *',
244
+ mime: 'text/x-java',
245
+ mainFilename: 'Main.java',
246
+ fileExtension: ['java'],
247
+ compilePattern: "javac -cp '.;*' {{folder_path}}/{{source_full_file_name}}",
248
+ // compilePattern: 'javac {{folder_path}}/{{source_full_file_name}}',
249
+ // runPattern: 'java -cp {{folder_path}} {{class_name}}'
250
+ 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 ' +
251
+ '{{folder_path}} {{class_name}}',
252
+ templateSourceCode: 'class Main {\n public static void main (String[] args) {' + '\n \n System.out.println("Hello World");\n \n }\n}',
253
+ hasBuildFile: true,
254
+ executable: 'javac',
255
+ executableVersion: JAVAC_VERSION,
256
+ monacoKey: 'java',
257
+ codeMirrorKey: 'java',
258
+ highlightJsKey: 'java',
259
+ },
260
+ [CodeLanguage.ICPC_PYTHON]: {
261
+ // DEPRECATED
262
+ value: CodeLanguage.ICPC_PYTHON,
263
+ label: 'ICPC Python *',
264
+ compilePattern: 'pypy3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
265
+ runPattern: '/usr/bin/pypy3 {{folder_path}}/{{source_full_file_name}}',
266
+ executable: 'pypy3',
267
+ executableVersion: PYPY3_VERSION,
268
+ ...PYTHON,
269
+ },
270
+ [CodeLanguage.PYTHON]: {
271
+ // DEPRECATED
272
+ value: CodeLanguage.PYTHON,
273
+ label: 'Python *',
274
+ compilePattern: 'python3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
275
+ runPattern: '/usr/bin/python3 {{folder_path}}/{{source_full_file_name}}',
276
+ executable: 'python3',
277
+ executableVersion: PYTHON3_VERSION,
278
+ ...PYTHON,
279
+ },
280
+ [CodeLanguage.PYTHON2]: {
281
+ // DEPRECATED
282
+ value: CodeLanguage.PYTHON2,
283
+ label: 'Python 2 *',
284
+ compilePattern: 'python2 -m py_compile {{folder_path}}/{{source_full_file_name}}',
285
+ runPattern: '/usr/bin/python2 {{folder_path}}/{{source_full_file_name}}',
286
+ executable: 'python',
287
+ executableVersion: 'Python 2.7.18',
288
+ ...PYTHON,
289
+ },
290
+ [CodeLanguage.PYTHON3]: {
291
+ // DEPRECATED
292
+ value: CodeLanguage.PYTHON3,
293
+ label: 'Python 3 *',
294
+ compilePattern: 'python3 -m py_compile {{folder_path}}/{{source_full_file_name}}',
295
+ runPattern: '/usr/bin/python3 {{folder_path}}/{{source_full_file_name}}',
296
+ executable: 'python3',
297
+ executableVersion: PYTHON3_VERSION,
298
+ ...PYTHON,
299
+ },
300
+ [CodeLanguage.JAVASCRIPT]: {
301
+ // DEPRECATED
302
+ value: CodeLanguage.JAVASCRIPT,
303
+ label: 'Javascript *',
304
+ mime: 'application/x-javascript',
305
+ mainFilename: 'main.js',
306
+ fileExtension: ['js'],
307
+ compilePattern: '',
308
+ runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
309
+ templateSourceCode: 'console.log("Hello World\\n")',
310
+ hasBuildFile: false,
311
+ executable: 'node',
312
+ executableVersion: NODE_VERSION,
313
+ monacoKey: 'javascript',
314
+ codeMirrorKey: 'javascript',
315
+ highlightJsKey: 'javascript',
316
+ },
317
+ [CodeLanguage.TYPESCRIPT]: {
318
+ // DEPRECATED
319
+ value: CodeLanguage.TYPESCRIPT,
320
+ label: 'Typescript *',
321
+ mime: 'application/x-typescript',
322
+ mainFilename: 'main.ts',
323
+ fileExtension: ['ts'],
324
+ compilePattern: '',
325
+ runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
326
+ templateSourceCode: 'console.log("Hello World\\n")',
327
+ hasBuildFile: false,
328
+ executable: 'node',
329
+ executableVersion: NODE_VERSION,
330
+ monacoKey: 'typescript',
331
+ codeMirrorKey: 'typescript',
332
+ highlightJsKey: 'typescript',
333
+ },
334
+ [CodeLanguage.TSX]: {
335
+ // DEPRECATED
336
+ value: CodeLanguage.TSX,
337
+ label: 'TSX *',
338
+ mime: 'application/x-typescript',
339
+ mainFilename: 'main.tsx',
340
+ fileExtension: ['tsx'],
341
+ compilePattern: '',
342
+ runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
343
+ templateSourceCode: 'console.log("Hello World\\n")',
344
+ hasBuildFile: false,
345
+ executable: 'node',
346
+ executableVersion: NODE_VERSION,
347
+ monacoKey: 'typescript',
348
+ codeMirrorKey: 'typescript',
349
+ highlightJsKey: 'typescript',
350
+ },
351
+ [CodeLanguage.JSX]: {
352
+ // DEPRECATED
353
+ value: CodeLanguage.JSX,
354
+ label: 'JSX *',
355
+ mime: 'application/x-javascript',
356
+ mainFilename: 'main.jsx',
357
+ fileExtension: ['jsx'],
358
+ compilePattern: '',
359
+ runPattern: '/usr/bin/node {{folder_path}}/{{source_full_file_name}}',
360
+ templateSourceCode: 'console.log("Hello World\\n")',
361
+ hasBuildFile: false,
362
+ executable: 'node',
363
+ executableVersion: NODE_VERSION,
364
+ monacoKey: 'javascript',
365
+ codeMirrorKey: 'javascript',
366
+ highlightJsKey: 'javascript',
367
+ },
368
+ [CodeLanguage.PSEUDOCODE_PSEINT]: {
369
+ value: CodeLanguage.PSEUDOCODE_PSEINT,
370
+ label: 'Pseudo-código (PSeInt)',
371
+ mime: 'text/plain',
372
+ mainFilename: 'main.psc',
373
+ fileExtension: ['psc'],
374
+ compilePattern: 'jk-pseint {{folder_path}}/{{source_full_file_name}} --norun --nouser' +
375
+ ' && jk-pseint {{folder_path}}/{{source_full_file_name}} --draw {{folder_path}}/{{source_full_file_name}}.psd' +
376
+ ' && jk-psexport {{folder_path}}/{{source_full_file_name}}.psd {{folder_path}}/{{source_full_file_name}}.cpp --lang=cpp' +
377
+ ' && g++ -x c++ -g -O2 -std=gnu++20 -static -o ' +
378
+ '{{folder_path}}/{{compiled_file_name}} {{folder_path}}/{{source_full_file_name}}.cpp',
379
+ runPattern: '{{folder_path}}/{{compiled_file_name}}',
380
+ templateSourceCode: 'Algoritmo HOLA_MUNDO\n\tImprimir "Hello World"\nFinAlgoritmo\n',
381
+ hasBuildFile: false,
382
+ executable: '',
383
+ executableVersion: PSEINT_VERSION,
384
+ monacoKey: 'text',
385
+ codeMirrorKey: 'pseudocode-pseint',
386
+ highlightJsKey: 'plaintext',
387
+ },
388
+ [CodeLanguage.DOT]: {
389
+ value: CodeLanguage.DOT,
390
+ label: 'DOT',
391
+ mime: 'text/vnd.graphviz',
392
+ mainFilename: 'diagram.dot',
393
+ fileExtension: ['dot'],
394
+ compilePattern: '',
395
+ runPattern: '',
396
+ templateSourceCode: 'digraph G {\n A -> B;\n B -> C;\n}',
397
+ hasBuildFile: false,
398
+ executable: '',
399
+ executableVersion: '',
400
+ monacoKey: 'dot',
401
+ codeMirrorKey: 'dot',
402
+ highlightJsKey: 'plaintext',
403
+ },
404
+ [CodeLanguage.MERMAID]: {
405
+ value: CodeLanguage.MERMAID,
406
+ label: 'Mermaid',
407
+ mime: 'text/mermaid',
408
+ mainFilename: 'diagram.mmd',
409
+ fileExtension: ['mmd', 'mermaid'],
410
+ compilePattern: '',
411
+ runPattern: '',
412
+ templateSourceCode: `graph TD
413
+ A[Start] --> B{Is it working?}
414
+ B -- Yes --> C[Great!]
415
+ B -- No --> D[Fix it]
416
+ D --> B
417
+ `,
418
+ hasBuildFile: false,
419
+ executable: '',
420
+ executableVersion: '',
421
+ monacoKey: 'mermaid',
422
+ codeMirrorKey: 'mermaid',
423
+ highlightJsKey: 'plaintext',
424
+ },
425
+ [CodeLanguage.JSON]: {
426
+ value: CodeLanguage.JSON,
427
+ label: 'JSON',
428
+ mime: 'application/json',
429
+ mainFilename: 'main.json',
430
+ fileExtension: ['json'],
431
+ compilePattern: '',
432
+ runPattern: '',
433
+ templateSourceCode: '{\n \n}',
434
+ hasBuildFile: false,
435
+ executable: '',
436
+ executableVersion: '',
437
+ monacoKey: 'json',
438
+ codeMirrorKey: 'javascript',
439
+ highlightJsKey: 'json',
440
+ },
441
+ [CodeLanguage.TEXT]: {
442
+ value: CodeLanguage.TEXT,
443
+ label: 'plain text',
444
+ mime: 'text/plain',
445
+ mainFilename: 'main.txt',
446
+ fileExtension: ['txt', 'text', 'in', 'out'],
447
+ compilePattern: '',
448
+ runPattern: '',
449
+ templateSourceCode: '',
450
+ hasBuildFile: false,
451
+ executable: '',
452
+ executableVersion: '',
453
+ monacoKey: 'text',
454
+ codeMirrorKey: 'text',
455
+ highlightJsKey: 'plaintext',
456
+ },
457
+ [CodeLanguage.DIFF]: {
458
+ value: CodeLanguage.DIFF,
459
+ label: 'diff',
460
+ mime: 'text/plain',
461
+ mainFilename: 'main.patch',
462
+ fileExtension: ['diff', 'patch'],
463
+ compilePattern: '',
464
+ runPattern: '',
465
+ templateSourceCode: '',
466
+ hasBuildFile: false,
467
+ executable: '',
468
+ executableVersion: '',
469
+ monacoKey: 'diff',
470
+ codeMirrorKey: 'diff',
471
+ highlightJsKey: 'diff',
472
+ },
473
+ [CodeLanguage.LATEX]: {
474
+ value: CodeLanguage.LATEX,
475
+ label: 'LaTeX',
476
+ mime: 'application/x-latex',
477
+ mainFilename: 'main.tex',
478
+ fileExtension: ['tex'],
479
+ compilePattern: '',
480
+ runPattern: '',
481
+ templateSourceCode: '',
482
+ hasBuildFile: false,
483
+ executable: '',
484
+ executableVersion: '',
485
+ monacoKey: 'latex',
486
+ codeMirrorKey: 'stex',
487
+ highlightJsKey: 'latex',
488
+ },
489
+ // asc txt text diff pot
490
+ [CodeLanguage.MARKDOWN]: {
491
+ value: CodeLanguage.MARKDOWN,
492
+ label: 'Markdown',
493
+ mime: 'text/plain',
494
+ mainFilename: 'main.md',
495
+ fileExtension: ['md'],
496
+ compilePattern: '',
497
+ runPattern: '',
498
+ templateSourceCode: '# Hello World\n',
499
+ hasBuildFile: false,
500
+ executable: '',
501
+ executableVersion: '',
502
+ monacoKey: 'markdown',
503
+ codeMirrorKey: 'markdown',
504
+ highlightJsKey: 'markdown',
505
+ },
506
+ [CodeLanguage.MDX]: {
507
+ value: CodeLanguage.MDX,
508
+ label: 'MDX',
509
+ mime: 'text/plain',
510
+ mainFilename: 'main.mdx',
511
+ fileExtension: ['mdx'],
512
+ compilePattern: '',
513
+ runPattern: '',
514
+ templateSourceCode: '# Hello World\n',
515
+ hasBuildFile: false,
516
+ executable: '',
517
+ executableVersion: '',
518
+ monacoKey: 'markdown',
519
+ codeMirrorKey: 'markdown',
520
+ highlightJsKey: 'markdown',
521
+ },
522
+ [CodeLanguage.ARDUINO]: {
523
+ value: CodeLanguage.ARDUINO,
524
+ label: 'Arduino',
525
+ mime: 'text/plain',
526
+ mainFilename: 'main.c',
527
+ fileExtension: ['c', 'cpp', 'pde', 'h', 'ino'],
528
+ compilePattern: '',
529
+ runPattern: '',
530
+ templateSourceCode: '',
531
+ hasBuildFile: false,
532
+ executable: '',
533
+ executableVersion: '',
534
+ monacoKey: 'c',
535
+ codeMirrorKey: 'c',
536
+ highlightJsKey: 'c',
537
+ },
538
+ [CodeLanguage.HTML]: {
539
+ value: CodeLanguage.HTML,
540
+ label: 'HTML',
541
+ mime: 'text/HTML',
542
+ mainFilename: 'index.html',
543
+ fileExtension: ['html'],
544
+ compilePattern: '',
545
+ runPattern: '',
546
+ templateSourceCode: '',
547
+ hasBuildFile: false,
548
+ executable: '',
549
+ executableVersion: '',
550
+ monacoKey: 'html',
551
+ codeMirrorKey: 'html',
552
+ highlightJsKey: 'xml',
553
+ },
554
+ [CodeLanguage.BASH]: {
555
+ value: CodeLanguage.BASH,
556
+ label: 'Bash',
557
+ mime: 'text/plain',
558
+ mainFilename: 'main.sh',
559
+ fileExtension: ['sh', 'bash'],
560
+ compilePattern: '',
561
+ runPattern: '',
562
+ templateSourceCode: '#!/bin/bash\necho "Hello World"\n',
563
+ hasBuildFile: false,
564
+ executable: 'bash',
565
+ executableVersion: '',
566
+ monacoKey: 'shell',
567
+ codeMirrorKey: 'shell',
568
+ highlightJsKey: 'bash',
569
+ },
570
+ };
571
+ export const PAGE_SIZES = ['32', '64', '128', '256', '512'];
572
+ export const PALLETE = {
573
+ VIVOS: [
574
+ { color: '#FF0000', title: 'Rojo' },
575
+ { color: '#FF5900', title: 'Rojo - Naranja' },
576
+ { color: '#FF8600', title: 'Naranja' },
577
+ { color: '#FFBF00', title: 'Ámbar' },
578
+ { color: '#FFFF00', title: 'Amarillo' },
579
+ { color: '#A6FF00', title: 'Lima o Verde limon' },
580
+ { color: '#00FF8C', title: 'Verde puro' },
581
+ { color: '#00FF8C', title: 'Verde cian' },
582
+ { color: '#00FFFF', title: 'Cian' },
583
+ { color: '#0099FF', title: 'Cerúleo o Azur' },
584
+ { color: '#0000FF', title: 'Azul' },
585
+ { color: '#9F00FF', title: 'Violeta' },
586
+ { color: '#FF00FF', title: 'Magenta' },
587
+ { color: '#FF0099', title: 'Fucsia' },
588
+ ],
589
+ OSCUROS: [
590
+ { color: '#880000', title: 'Granate' },
591
+ { color: '#882F00', title: 'Caoba o Rojo indio' },
592
+ { color: '#884700', title: 'Marrón o Pardo' },
593
+ { color: '#886600', title: 'Marrón dorado' },
594
+ { color: '#888800', title: 'Oliva' },
595
+ { color: '#588800', title: 'Verde palta' },
596
+ { color: '#008800', title: 'Verde estándar' },
597
+ { color: '#008858', title: 'Esmeralda' },
598
+ { color: '#008888', title: 'Cerceta o Azul verde' },
599
+ { color: '#005288', title: 'Añil' },
600
+ { color: '#000080', title: 'Azul marino' },
601
+ { color: '#880088', title: 'Azul púrpura' },
602
+ { color: '#880088', title: 'Púrpura o Morado' },
603
+ { color: '#880047', title: 'Vino' },
604
+ ],
605
+ AGRISADOS: [
606
+ { color: '#BF4040', title: 'Lacre' },
607
+ { color: '#BF6340', title: 'Cobre' },
608
+ { color: '#BF8340', title: 'Cnalea o Ocre' },
609
+ { color: '#BF9F40', title: 'Dorado' },
610
+ { color: '#BFBF40', title: 'Chartreuse' },
611
+ { color: '#93BF40', title: 'Verde manzana' },
612
+ { color: '#93BF40', title: 'Verde bosque' },
613
+ { color: '#40BF40', title: 'Verde mar' },
614
+ { color: '#40BFBF', title: 'Turquesa' },
615
+ { color: '#408CBF', title: 'Azul acero' },
616
+ { color: '#4040BF', title: 'Zafiro' },
617
+ { color: '#9340BF', title: 'Amastista' },
618
+ { color: '#B140BF', title: 'Púrpureo' },
619
+ { color: '#B140BF', title: 'Fandango' },
620
+ ],
621
+ CLAROS: [
622
+ { color: '#FF7777', title: 'Coral' },
623
+ { color: '#FF9977', title: 'Salmón' },
624
+ { color: '#FFB977', title: 'Melón o Durazno' },
625
+ { color: '#FFDA80', title: 'Crema' },
626
+ { color: '#FFFF88', title: 'Maíz' },
627
+ { color: '#CFFF77', title: 'Té verde' },
628
+ { color: '#77FF77', title: 'Verde claro' },
629
+ { color: '#77FFAA', title: 'Menta' },
630
+ { color: '#80FFFF', title: 'Aguamarina' },
631
+ { color: '#73C7FF', title: 'Celeste' },
632
+ { color: '#8082FF', title: 'Bígaro o aciano' },
633
+ { color: '#C977FF', title: 'Lavanda o lila' },
634
+ { color: '#FF77FF', title: 'Malva' },
635
+ { color: '#FF77C1', title: 'Rosado' },
636
+ ],
637
+ };
638
+ export const UPPERCASE_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
639
+ export const LOWERCASE_LETTERS = UPPERCASE_LETTERS.toLowerCase();
640
+ export const NUMBERS = '012345678';
641
+ export const DEFAULT_JUKI_PROFILE_IMAGE = 'https://juki-judge.s3.us-east-2.amazonaws.com/public/file/5f69783aa7a8e048ef8d0ce2.';
642
+ export const SEPARATOR_TOKEN = '\x1E';
643
+ export const HEADER_JUKI_FORWARDED_HOST = 'x-juki-forwarded-host';
644
+ export const HEADER_JUKI_VISITOR_SESSION_ID = 'x-juki-visitor-session-id';
645
+ export const HEADER_JUKI_METADATA = 'x-juki-metadata';
646
+ export const HEADER_JUKI_SECRET_TOKEN = 'x-juki-secret-token';
647
+ export const HEADER_JUKI_INTERNAL_API_KEY = 'x-juki-internal-api-key';
648
+ export const COOKIE_JUKI_SESSION_ID = 'juki-session-id';
@@ -1,4 +1,4 @@
1
- import { ContestRole, ContestStatus } from '../types';
1
+ import { ContestRole, ContestStatus } from '../types/index.js';
2
2
  export declare const CONTEST_STATUS: {
3
3
  [key in ContestStatus]: {
4
4
  value: ContestStatus;