@juki-team/commons 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/cjs/index.cjs +3567 -0
- package/dist/esm/index.js +3347 -0
- package/dist/types/constants/commons.d.ts +62 -0
- package/dist/types/constants/company.d.ts +9 -0
- package/dist/types/constants/contest.d.ts +15 -0
- package/dist/types/constants/course.d.ts +8 -0
- package/dist/types/constants/date.d.ts +9 -0
- package/dist/types/constants/email.d.ts +2 -0
- package/dist/types/constants/entity.d.ts +3 -0
- package/dist/types/constants/file.d.ts +27 -0
- package/dist/types/constants/index.d.ts +18 -0
- package/dist/types/constants/judge.d.ts +35 -0
- package/dist/types/constants/problem.d.ts +36 -0
- package/dist/types/constants/routing.d.ts +7 -0
- package/dist/types/constants/services.d.ts +8 -0
- package/dist/types/constants/system.d.ts +8 -0
- package/dist/types/constants/teams.d.ts +14 -0
- package/dist/types/constants/time.d.ts +9 -0
- package/dist/types/constants/user.d.ts +16 -0
- package/dist/types/constants/websocket.d.ts +6 -0
- package/dist/types/constants/worksheet.d.ts +11 -0
- package/dist/types/dto/class.d.ts +115 -0
- package/dist/types/dto/code.d.ts +13 -0
- package/dist/types/dto/comments.d.ts +21 -0
- package/dist/types/dto/company.d.ts +67 -0
- package/dist/types/dto/contest.d.ts +94 -0
- package/dist/types/dto/course.d.ts +34 -0
- package/dist/types/dto/entity.d.ts +92 -0
- package/dist/types/dto/excalidraw.d.ts +12 -0
- package/dist/types/dto/file.d.ts +34 -0
- package/dist/types/dto/image.d.ts +6 -0
- package/dist/types/dto/index.d.ts +25 -0
- package/dist/types/dto/judge.d.ts +16 -0
- package/dist/types/dto/markdown.d.ts +12 -0
- package/dist/types/dto/mermaid.d.ts +12 -0
- package/dist/types/dto/problem.d.ts +66 -0
- package/dist/types/dto/scoreboard.d.ts +35 -0
- package/dist/types/dto/session.d.ts +15 -0
- package/dist/types/dto/socket.d.ts +256 -0
- package/dist/types/dto/statistics.d.ts +43 -0
- package/dist/types/dto/submission.d.ts +94 -0
- package/dist/types/dto/system.d.ts +91 -0
- package/dist/types/dto/url.d.ts +8 -0
- package/dist/types/dto/user.d.ts +109 -0
- package/dist/types/dto/virtual-user.d.ts +38 -0
- package/dist/types/dto/worksheet-submissions.d.ts +64 -0
- package/dist/types/dto/worksheet.d.ts +39 -0
- package/dist/types/helpers/class.d.ts +4 -0
- package/dist/types/helpers/comments.d.ts +4 -0
- package/dist/types/helpers/commons.d.ts +35 -0
- package/dist/types/helpers/contest.d.ts +5 -0
- package/dist/types/helpers/document.d.ts +14 -0
- package/dist/types/helpers/file.d.ts +1 -0
- package/dist/types/helpers/index.d.ts +14 -0
- package/dist/types/helpers/interval.d.ts +2 -0
- package/dist/types/helpers/judging.d.ts +24 -0
- package/dist/types/helpers/object.d.ts +1 -0
- package/dist/types/helpers/responses.d.ts +8 -0
- package/dist/types/helpers/socket.d.ts +45 -0
- package/dist/types/helpers/time.d.ts +13 -0
- package/dist/types/helpers/user.d.ts +11 -0
- package/dist/types/helpers/worksheet.d.ts +10 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/prototypes/Date.d.ts +62 -0
- package/dist/types/prototypes/Error.d.ts +10 -0
- package/dist/types/prototypes/Number.d.ts +7 -0
- package/dist/types/prototypes/index.d.ts +3 -0
- package/dist/types/types/account.d.ts +9 -0
- package/dist/types/types/class.d.ts +67 -0
- package/dist/types/types/comments.d.ts +17 -0
- package/dist/types/types/commons.d.ts +84 -0
- package/dist/types/types/company.d.ts +29 -0
- package/dist/types/types/contest.d.ts +161 -0
- package/dist/types/types/course.d.ts +13 -0
- package/dist/types/types/entity.d.ts +116 -0
- package/dist/types/types/excalidraw.d.ts +9 -0
- package/dist/types/types/file.d.ts +27 -0
- package/dist/types/types/group.d.ts +12 -0
- package/dist/types/types/index.d.ts +25 -0
- package/dist/types/types/judge.d.ts +75 -0
- package/dist/types/types/markdown.d.ts +8 -0
- package/dist/types/types/mermaid.d.ts +8 -0
- package/dist/types/types/notification.d.ts +7 -0
- package/dist/types/types/prisma.d.ts +284 -0
- package/dist/types/types/problems.d.ts +102 -0
- package/dist/types/types/services.d.ts +213 -0
- package/dist/types/types/sheet.d.ts +103 -0
- package/dist/types/types/socket.d.ts +49 -0
- package/dist/types/types/submission.d.ts +5 -0
- package/dist/types/types/teams.d.ts +73 -0
- package/dist/types/types/users.d.ts +59 -0
- package/dist/types/types/virtual-user.d.ts +7 -0
- package/dist/types/types/worksheet.d.ts +42 -0
- package/package.json +38 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { CodeLanguage } from './commons';
|
|
2
|
+
import { DataLog } from './submission';
|
|
3
|
+
export type JudgeLanguage = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
associatedLanguage: CodeLanguage;
|
|
8
|
+
};
|
|
9
|
+
export interface JudgeBaseDocument {
|
|
10
|
+
key: string | Judge;
|
|
11
|
+
name: string;
|
|
12
|
+
languages: JudgeLanguage[];
|
|
13
|
+
problemTags: string[];
|
|
14
|
+
keyPrefix: string;
|
|
15
|
+
isExternal: boolean;
|
|
16
|
+
isSubmitSupported: boolean;
|
|
17
|
+
logo: string;
|
|
18
|
+
logoSize: [number, number];
|
|
19
|
+
url: string;
|
|
20
|
+
getLoginUrl: string;
|
|
21
|
+
getProfileUrl: string;
|
|
22
|
+
getSubmitUrl: string;
|
|
23
|
+
getSubmissionUrl: string;
|
|
24
|
+
getProblemUrl: string;
|
|
25
|
+
getUserSubmissionsUrl: string;
|
|
26
|
+
submissionsWithHighPriority: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare enum Judge {
|
|
29
|
+
JUKI_JUDGE = "JUKI_JUDGE",
|
|
30
|
+
CODEFORCES = "CODEFORCES",
|
|
31
|
+
CODEFORCES_GYM = "CODEFORCES_GYM",
|
|
32
|
+
JV_UMSA = "JV_UMSA",
|
|
33
|
+
UVA_ONLINE_JUDGE = "UVA_ONLINE_JUDGE",
|
|
34
|
+
AT_CODER = "AT_CODER",
|
|
35
|
+
CODECHEF = "CODECHEF",
|
|
36
|
+
TOPCODER = "TOPCODER",
|
|
37
|
+
LEETCODE = "LEETCODE"
|
|
38
|
+
}
|
|
39
|
+
export declare enum ProblemVerdict {
|
|
40
|
+
NONE = "NONE",// No judge
|
|
41
|
+
PENDING = "PENDING",// Pending
|
|
42
|
+
HIDDEN = "HIDDEN",// Hidden
|
|
43
|
+
CE = "CE",// Compilation Error
|
|
44
|
+
RE = "RE",// Runtime Error
|
|
45
|
+
TLE = "TLE",// Time Limit Exceded
|
|
46
|
+
MLE = "MLE",// Memory Limit Exceded
|
|
47
|
+
WA = "WA",// Wrong Answer
|
|
48
|
+
PE = "PE",// Presentation Error
|
|
49
|
+
PA = "PA",// Partial Accepted
|
|
50
|
+
AC = "AC"
|
|
51
|
+
}
|
|
52
|
+
export declare enum SubmissionRunStatus {
|
|
53
|
+
NONE = "NONE",
|
|
54
|
+
RECEIVED = "RECEIVED",
|
|
55
|
+
COMPILING = "COMPILING",
|
|
56
|
+
COMPILED = "COMPILED",
|
|
57
|
+
COMPILATION_ERROR = "COMPILATION_ERROR",
|
|
58
|
+
FETCHING_TEST_CASES = "FETCHING_TEST_CASES",
|
|
59
|
+
RUNNING_TEST_CASE = "RUNNING_TEST_CASE",
|
|
60
|
+
RUNNING_TEST_CASES = "RUNNING_TEST_CASES",
|
|
61
|
+
RUNNING_SAMPLE_TEST_CASES = "RUNNING_SAMPLE_TEST_CASES",
|
|
62
|
+
EXECUTED_TEST_CASE = "EXECUTED_TEST_CASE",
|
|
63
|
+
FAILED_TEST_CASE = "FAILED_TEST_CASE",
|
|
64
|
+
JUDGING_TEST_CASE = "JUDGING_TEST_CASE",
|
|
65
|
+
GRADING = "GRADING",
|
|
66
|
+
FAILED = "FAILED",
|
|
67
|
+
COMPLETED = "COMPLETED"
|
|
68
|
+
}
|
|
69
|
+
export declare enum RunnerType {
|
|
70
|
+
HIGH_PERFORMANCE = "HIGH_PERFORMANCE",
|
|
71
|
+
LOW_PERFORMANCE = "LOW_PERFORMANCE"
|
|
72
|
+
}
|
|
73
|
+
export type TestCaseVerdict = DataLog & {
|
|
74
|
+
verdict: ProblemVerdict;
|
|
75
|
+
};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { ProfileSetting } from './account';
|
|
2
|
+
/**
|
|
3
|
+
* Model Course
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type Course = {
|
|
7
|
+
id: number;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
key: string;
|
|
11
|
+
title: string;
|
|
12
|
+
abstract: string;
|
|
13
|
+
description: string;
|
|
14
|
+
goals: string;
|
|
15
|
+
coverImageUrl: string;
|
|
16
|
+
status: CourseStatus;
|
|
17
|
+
type: CourseType;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Model UsersCourses
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export type UsersCourses = {
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
userId: number;
|
|
27
|
+
courseId: number;
|
|
28
|
+
invited: boolean;
|
|
29
|
+
editor: boolean;
|
|
30
|
+
owner: boolean;
|
|
31
|
+
reviewer: boolean;
|
|
32
|
+
admin: boolean;
|
|
33
|
+
enrolled: boolean;
|
|
34
|
+
unlocked: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Model Task
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export type TaskPrisma = {
|
|
41
|
+
id: number;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
trainingId: number;
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
dueDate: Date;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Model TaskComment
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export type TaskComment = {
|
|
54
|
+
id: number;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
taskId: number;
|
|
58
|
+
userId: number;
|
|
59
|
+
content: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Model Assignment
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export type AssignmentPrisma = {
|
|
66
|
+
id: number;
|
|
67
|
+
createdAt: Date;
|
|
68
|
+
updatedAt: Date;
|
|
69
|
+
taskId: number;
|
|
70
|
+
description: string;
|
|
71
|
+
type: AssignmentType;
|
|
72
|
+
content: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Model UsersAssignment
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
export type UsersAssignment = {
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
updatedAt: Date;
|
|
81
|
+
userId: number;
|
|
82
|
+
subtaskId: number;
|
|
83
|
+
status: AssignmentState;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Model Team
|
|
87
|
+
*
|
|
88
|
+
*/
|
|
89
|
+
export type TeamPrisma = {
|
|
90
|
+
id: number;
|
|
91
|
+
createdAt: Date;
|
|
92
|
+
updatedAt: Date;
|
|
93
|
+
createdByUserId: number;
|
|
94
|
+
code: string;
|
|
95
|
+
codeEnabled: boolean;
|
|
96
|
+
name: string;
|
|
97
|
+
aboutTeam: string;
|
|
98
|
+
country: string;
|
|
99
|
+
city: string;
|
|
100
|
+
institution: string;
|
|
101
|
+
imageUrl: string;
|
|
102
|
+
status: TeamStatus;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Model UsersTeams
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
export type UsersTeams = {
|
|
109
|
+
createdAt: Date;
|
|
110
|
+
updatedAt: Date;
|
|
111
|
+
userId: number;
|
|
112
|
+
teamId: number;
|
|
113
|
+
role: MemberRole;
|
|
114
|
+
status: UserTeamStatus;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Model Training
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
export type TrainingPrisma = {
|
|
121
|
+
id: number;
|
|
122
|
+
createdAt: Date;
|
|
123
|
+
updatedAt: Date;
|
|
124
|
+
teamId: number;
|
|
125
|
+
name: string;
|
|
126
|
+
startDate: Date;
|
|
127
|
+
endDate: Date;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Model User
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
export type User = {
|
|
134
|
+
id: number;
|
|
135
|
+
createdAt: Date;
|
|
136
|
+
updatedAt: Date;
|
|
137
|
+
givenName: string;
|
|
138
|
+
familyName: string;
|
|
139
|
+
nickname: string;
|
|
140
|
+
imageUrl: string;
|
|
141
|
+
aboutMe: string;
|
|
142
|
+
country: string;
|
|
143
|
+
city: string;
|
|
144
|
+
institution: string;
|
|
145
|
+
email: string;
|
|
146
|
+
telegramUsername: string;
|
|
147
|
+
codeforcesHandle: string;
|
|
148
|
+
topcoderHandle: string;
|
|
149
|
+
atCoderHandle: string;
|
|
150
|
+
codeChefHandle: string;
|
|
151
|
+
[ProfileSetting.LANGUAGE]: Language;
|
|
152
|
+
[ProfileSetting.THEME]: Theme;
|
|
153
|
+
emailSubscription: EmailSubscription;
|
|
154
|
+
emailValidationState: EmailValidationState;
|
|
155
|
+
emailValidationToken: string;
|
|
156
|
+
emailValidationTimestamp: Date;
|
|
157
|
+
passwordResetToken: string | null;
|
|
158
|
+
passwordResetTimestamp: Date | null;
|
|
159
|
+
status: UserStatus;
|
|
160
|
+
userRole: UserRole;
|
|
161
|
+
teamRole: TeamRole;
|
|
162
|
+
courseRole: CourseRole;
|
|
163
|
+
password: string;
|
|
164
|
+
salt: string;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Enums
|
|
168
|
+
*/
|
|
169
|
+
export declare const CourseStatus: {
|
|
170
|
+
RELEASED: 'RELEASED';
|
|
171
|
+
IN_DRAFT: 'IN_DRAFT';
|
|
172
|
+
IN_REVIEW: 'IN_REVIEW';
|
|
173
|
+
ARCHIVED: 'ARCHIVED';
|
|
174
|
+
};
|
|
175
|
+
export type CourseStatus = (typeof CourseStatus)[keyof typeof CourseStatus];
|
|
176
|
+
export declare const CourseType: {
|
|
177
|
+
PUBLIC: 'PUBLIC';
|
|
178
|
+
PRIVATE: 'PRIVATE';
|
|
179
|
+
CLOSED: 'CLOSED';
|
|
180
|
+
};
|
|
181
|
+
export type CourseType = (typeof CourseType)[keyof typeof CourseType];
|
|
182
|
+
export declare const AssignmentType: {
|
|
183
|
+
READING_PDF: 'READING_PDF';
|
|
184
|
+
READING_WEB: 'READING_WEB';
|
|
185
|
+
SOLVE_JUKI_JUDGE_PROBLEM: 'SOLVE_JUKI_JUDGE_PROBLEM';
|
|
186
|
+
SOLVE_CODEFORCES_JUDGE_PROBLEM: 'SOLVE_CODEFORCES_JUDGE_PROBLEM';
|
|
187
|
+
};
|
|
188
|
+
export type AssignmentType = (typeof AssignmentType)[keyof typeof AssignmentType];
|
|
189
|
+
export declare const AssignmentState: {
|
|
190
|
+
ASSIGNED: 'ASSIGNED';
|
|
191
|
+
IN_PROGRESS: 'IN_PROGRESS';
|
|
192
|
+
TO_REVIEW: 'TO_REVIEW';
|
|
193
|
+
RESOLVED: 'RESOLVED';
|
|
194
|
+
};
|
|
195
|
+
export type AssignmentState = (typeof AssignmentState)[keyof typeof AssignmentState];
|
|
196
|
+
export declare const TeamStatus: {
|
|
197
|
+
ACTIVE: 'ACTIVE';
|
|
198
|
+
REPORTED: 'REPORTED';
|
|
199
|
+
ARCHIVED: 'ARCHIVED';
|
|
200
|
+
};
|
|
201
|
+
export type TeamStatus = (typeof TeamStatus)[keyof typeof TeamStatus];
|
|
202
|
+
export declare const MemberRole: {
|
|
203
|
+
COACH: 'COACH';
|
|
204
|
+
CO_COACH: 'CO_COACH';
|
|
205
|
+
CONTESTANT: 'CONTESTANT';
|
|
206
|
+
ATTENDEE: 'ATTENDEE';
|
|
207
|
+
RESERVE: 'RESERVE';
|
|
208
|
+
STAFF: 'STAFF';
|
|
209
|
+
};
|
|
210
|
+
export type MemberRole = (typeof MemberRole)[keyof typeof MemberRole];
|
|
211
|
+
export declare const UserTeamStatus: {
|
|
212
|
+
PENDING: 'PENDING';
|
|
213
|
+
ACCEPTED: 'ACCEPTED';
|
|
214
|
+
REJECTED: 'REJECTED';
|
|
215
|
+
};
|
|
216
|
+
export type UserTeamStatus = (typeof UserTeamStatus)[keyof typeof UserTeamStatus];
|
|
217
|
+
export declare const Language: {
|
|
218
|
+
ES: 'ES';
|
|
219
|
+
EN: 'EN';
|
|
220
|
+
};
|
|
221
|
+
export type Language = (typeof Language)[keyof typeof Language];
|
|
222
|
+
export declare const Theme: {
|
|
223
|
+
LIGHT: 'LIGHT';
|
|
224
|
+
DARK: 'DARK';
|
|
225
|
+
};
|
|
226
|
+
export type Theme = (typeof Theme)[keyof typeof Theme];
|
|
227
|
+
export declare const EmailSubscription: {
|
|
228
|
+
NONE: 'NONE';
|
|
229
|
+
RANKED_CONTESTS: 'RANKED_CONTESTS';
|
|
230
|
+
WEEKLY_NEWS_SUBSCRIPTION: 'WEEKLY_NEWS_SUBSCRIPTION';
|
|
231
|
+
MONTHLY_NEWS_SUBSCRIPTION: 'MONTHLY_NEWS_SUBSCRIPTION';
|
|
232
|
+
};
|
|
233
|
+
export type EmailSubscription = (typeof EmailSubscription)[keyof typeof EmailSubscription];
|
|
234
|
+
export declare const EmailValidationState: {
|
|
235
|
+
PENDING: 'PENDING';
|
|
236
|
+
VALIDATED: 'VALIDATED';
|
|
237
|
+
};
|
|
238
|
+
export type EmailValidationState = (typeof EmailValidationState)[keyof typeof EmailValidationState];
|
|
239
|
+
export declare const UserStatus: {
|
|
240
|
+
ACTIVE: 'ACTIVE';
|
|
241
|
+
REPORTED: 'REPORTED';
|
|
242
|
+
ARCHIVED: 'ARCHIVED';
|
|
243
|
+
};
|
|
244
|
+
export type UserStatus = (typeof UserStatus)[keyof typeof UserStatus];
|
|
245
|
+
export declare const UserRole: {
|
|
246
|
+
RESTRICTED: 'RESTRICTED';
|
|
247
|
+
GUEST: 'GUEST';
|
|
248
|
+
LIMITED: 'LIMITED';
|
|
249
|
+
REGULAR: 'REGULAR';
|
|
250
|
+
MANAGER: 'MANAGER';
|
|
251
|
+
ADMIN: 'ADMIN';
|
|
252
|
+
SUPER_ADMIN: 'SUPER_ADMIN';
|
|
253
|
+
};
|
|
254
|
+
export type UserRole = (typeof UserRole)[keyof typeof UserRole];
|
|
255
|
+
export declare const SystemRole: {
|
|
256
|
+
GUEST: 'GUEST';
|
|
257
|
+
REGULAR: 'REGULAR';
|
|
258
|
+
MANAGER: 'MANAGER';
|
|
259
|
+
MASTER: 'MASTER';
|
|
260
|
+
ADMIN: 'ADMIN';
|
|
261
|
+
SUPER_ADMIN: 'SUPER_ADMIN';
|
|
262
|
+
};
|
|
263
|
+
export type SystemRole = (typeof SystemRole)[keyof typeof SystemRole];
|
|
264
|
+
export declare const TeamRole: {
|
|
265
|
+
RESTRICTED: 'RESTRICTED';
|
|
266
|
+
GUEST: 'GUEST';
|
|
267
|
+
REGULAR: 'REGULAR';
|
|
268
|
+
MANAGER: 'MANAGER';
|
|
269
|
+
ADMIN: 'ADMIN';
|
|
270
|
+
SUPER_ADMIN: 'SUPER_ADMIN';
|
|
271
|
+
};
|
|
272
|
+
export type TeamRole = (typeof TeamRole)[keyof typeof TeamRole];
|
|
273
|
+
export declare const CourseRole: {
|
|
274
|
+
RESTRICTED: 'RESTRICTED';
|
|
275
|
+
GUEST: 'GUEST';
|
|
276
|
+
REGULAR: 'REGULAR';
|
|
277
|
+
CREATOR: 'CREATOR';
|
|
278
|
+
SUPER_CREATOR: 'SUPER_CREATOR';
|
|
279
|
+
MANAGER: 'MANAGER';
|
|
280
|
+
MASTER: 'MASTER';
|
|
281
|
+
ADMIN: 'ADMIN';
|
|
282
|
+
SUPER_ADMIN: 'SUPER_ADMIN';
|
|
283
|
+
};
|
|
284
|
+
export type CourseRole = (typeof CourseRole)[keyof typeof CourseRole];
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { CodeLanguage, TextLanguage } from './commons';
|
|
2
|
+
import { EntityMembers } from './entity';
|
|
3
|
+
import { ProblemTestCase } from './services';
|
|
4
|
+
export interface TestCase {
|
|
5
|
+
id: string;
|
|
6
|
+
group: number;
|
|
7
|
+
input: boolean;
|
|
8
|
+
output: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare enum TypeTestCase {
|
|
11
|
+
INPUT = "INPUT",
|
|
12
|
+
OUTPUT = "OUTPUT"
|
|
13
|
+
}
|
|
14
|
+
export declare enum ProblemInput {
|
|
15
|
+
STANDARD = "STANDARD",
|
|
16
|
+
INTERACTIVE = "INTERACTIVE"
|
|
17
|
+
}
|
|
18
|
+
export declare enum ProblemOutput {
|
|
19
|
+
STANDARD = "STANDARD",
|
|
20
|
+
DYNAMIC = "DYNAMIC",
|
|
21
|
+
INTERACTIVE = "INTERACTIVE"
|
|
22
|
+
}
|
|
23
|
+
export declare enum ProblemType {
|
|
24
|
+
STANDARD = "STANDARD",// The output is evaluated by the judge // Supported
|
|
25
|
+
DYNAMIC = "DYNAMIC",// The output is evaluated other file // Supported
|
|
26
|
+
INTERACTIVE = "INTERACTIVE"
|
|
27
|
+
}
|
|
28
|
+
export declare enum ProblemScoringMode {
|
|
29
|
+
SUBTASK = "SUBTASK",// by groups // Supported
|
|
30
|
+
TOTAL = "TOTAL",// one group // Supported
|
|
31
|
+
PARTIAL = "PARTIAL"
|
|
32
|
+
}
|
|
33
|
+
export type ProblemSettingsPointsByGroups = {
|
|
34
|
+
[key: number]: {
|
|
35
|
+
points: number;
|
|
36
|
+
partial: number;
|
|
37
|
+
group: number;
|
|
38
|
+
description: TextLanguage;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ProblemSettingsByProgrammingLanguage = {
|
|
42
|
+
[key: string]: {
|
|
43
|
+
language: CodeLanguage;
|
|
44
|
+
timeLimit: number;
|
|
45
|
+
memoryLimit: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export type ProblemSampleCases = {
|
|
49
|
+
input: string;
|
|
50
|
+
output: string;
|
|
51
|
+
}[];
|
|
52
|
+
export type ProblemStatement = {
|
|
53
|
+
description: TextLanguage;
|
|
54
|
+
input: TextLanguage;
|
|
55
|
+
output: TextLanguage;
|
|
56
|
+
sampleCases: ProblemSampleCases;
|
|
57
|
+
note: TextLanguage;
|
|
58
|
+
html: TextLanguage;
|
|
59
|
+
pdfUrl: TextLanguage;
|
|
60
|
+
};
|
|
61
|
+
export type ProblemSettings = {
|
|
62
|
+
timeLimit: number;
|
|
63
|
+
memoryLimit: number;
|
|
64
|
+
withPE: boolean;
|
|
65
|
+
type: ProblemType;
|
|
66
|
+
scoringMode: ProblemScoringMode;
|
|
67
|
+
byProgrammingLanguage: ProblemSettingsByProgrammingLanguage;
|
|
68
|
+
evaluatorSource: string;
|
|
69
|
+
pointsByGroups: ProblemSettingsPointsByGroups;
|
|
70
|
+
};
|
|
71
|
+
export type ProblemUser = {
|
|
72
|
+
isOwner: boolean;
|
|
73
|
+
isAdministrator: boolean;
|
|
74
|
+
isManager: boolean;
|
|
75
|
+
isSpectator: boolean;
|
|
76
|
+
solved: boolean;
|
|
77
|
+
tried: boolean;
|
|
78
|
+
};
|
|
79
|
+
export interface ProblemBaseDocument {
|
|
80
|
+
name: string;
|
|
81
|
+
shortname: string;
|
|
82
|
+
author: string;
|
|
83
|
+
settings: ProblemSettings;
|
|
84
|
+
tags: string[];
|
|
85
|
+
statement: ProblemStatement;
|
|
86
|
+
editorial: TextLanguage;
|
|
87
|
+
judgeId: string;
|
|
88
|
+
key: string;
|
|
89
|
+
testCases: ProblemTestCase[];
|
|
90
|
+
testCasesUpdatedAtTimestamp: number;
|
|
91
|
+
members: EntityMembers;
|
|
92
|
+
costs: {
|
|
93
|
+
unlockEditorial: number;
|
|
94
|
+
unlockHint: number;
|
|
95
|
+
viewTestCases: number;
|
|
96
|
+
};
|
|
97
|
+
rewardJukiCoins: {
|
|
98
|
+
forSolving: number;
|
|
99
|
+
forSolvingFirstTry: number;
|
|
100
|
+
forSolvingInAnExtraLanguage: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { CodeLanguage } from './commons';
|
|
2
|
+
export declare enum ErrorCode {
|
|
3
|
+
ERR400 = "ERR400",
|
|
4
|
+
ERR401 = "ERR401",
|
|
5
|
+
ERR403 = "ERR403",
|
|
6
|
+
ERR404 = "ERR404",
|
|
7
|
+
ERR405 = "ERR405",
|
|
8
|
+
ERR500 = "ERR500",
|
|
9
|
+
ERR9997 = "ERR9997",// 'aborted request'
|
|
10
|
+
ERR9998 = "ERR9998",// 'error on response'
|
|
11
|
+
ERR9999 = "ERR9999",// 'service no found'
|
|
12
|
+
ERR0000 = "ERR0000",
|
|
13
|
+
ERR0010 = "ERR0010",
|
|
14
|
+
ERR0011 = "ERR0011",
|
|
15
|
+
ERR0012 = "ERR0012",
|
|
16
|
+
ERR0013 = "ERR0013",
|
|
17
|
+
ERR0014 = "ERR0014",
|
|
18
|
+
ERR0015 = "ERR0015",
|
|
19
|
+
ERR0016 = "ERR0016",
|
|
20
|
+
ERR0017 = "ERR0017",
|
|
21
|
+
ERR0018 = "ERR0018",
|
|
22
|
+
ERR0019 = "ERR0019",
|
|
23
|
+
ERR0020 = "ERR0020",
|
|
24
|
+
ERR0021 = "ERR0021",
|
|
25
|
+
ERR0022 = "ERR0022",
|
|
26
|
+
ERR0023 = "ERR0023",
|
|
27
|
+
ERR0024 = "ERR0024",
|
|
28
|
+
ERR0050 = "ERR0050",
|
|
29
|
+
ERR0051 = "ERR0051",
|
|
30
|
+
ERR0052 = "ERR0052",
|
|
31
|
+
ERR0053 = "ERR0053",
|
|
32
|
+
ERR0100 = "ERR0100",
|
|
33
|
+
ERR0110 = "ERR0110",
|
|
34
|
+
ERR0111 = "ERR0111",
|
|
35
|
+
ERR0112 = " ERR0112",
|
|
36
|
+
ERR0113 = "ERR0113",
|
|
37
|
+
ERR0114 = "ERR0114",
|
|
38
|
+
ERR0115 = "ERR0115",
|
|
39
|
+
ERR0116 = "ERR0116",
|
|
40
|
+
ERR0117 = "ERR0117",
|
|
41
|
+
ERR0118 = "ERR0118",
|
|
42
|
+
ERR0119 = "ERR0119",
|
|
43
|
+
ERR0120 = "ERR0120",
|
|
44
|
+
ERR0121 = "ERR0121",
|
|
45
|
+
ERR0122 = "ERR0122",
|
|
46
|
+
ERR0200 = "ERR0200",
|
|
47
|
+
ERR0210 = "ERR0210",
|
|
48
|
+
ERR0211 = "ERR0211",
|
|
49
|
+
ERR0212 = "ERR0212",
|
|
50
|
+
ERR0213 = "ERR0213",
|
|
51
|
+
ERR0214 = "ERR0214",
|
|
52
|
+
ERR0215 = "ERR0215",
|
|
53
|
+
ERR0216 = "ERR0216",
|
|
54
|
+
ERR0217 = "ERR0217",
|
|
55
|
+
ERR0218 = "ERR0218",
|
|
56
|
+
ERR0219 = "ERR0219",
|
|
57
|
+
ERR0220 = "ERR0220",
|
|
58
|
+
ERR0230 = "ERR0230",
|
|
59
|
+
ERR0231 = "ERR0231",
|
|
60
|
+
ERR0232 = "ERR0232",
|
|
61
|
+
ERR0233 = "ERR0233",
|
|
62
|
+
ERR0234 = "ERR0234",
|
|
63
|
+
ERR0235 = "ERR0235",
|
|
64
|
+
ERR0236 = "ERR0236",
|
|
65
|
+
ERR0237 = "ERR0237",
|
|
66
|
+
ERR0240 = "ERR0240",
|
|
67
|
+
ERR0241 = "ERR0241",
|
|
68
|
+
ERR0242 = "ERR0242",
|
|
69
|
+
ERR0243 = "ERR0243",
|
|
70
|
+
ERR0244 = "ERR0244",
|
|
71
|
+
ERR0245 = "ERR0245",
|
|
72
|
+
ERR0246 = "ERR0246",
|
|
73
|
+
ERR0247 = "ERR0247",
|
|
74
|
+
ERR0300 = "ERR0300",
|
|
75
|
+
ERR0301 = "ERR0301",
|
|
76
|
+
ERR0302 = "ERR0302",
|
|
77
|
+
ERR0303 = "ERR0303",
|
|
78
|
+
ERR0310 = "ERR0310",
|
|
79
|
+
ERR0311 = "ERR0311",
|
|
80
|
+
ERR0321 = "ERR0321",
|
|
81
|
+
ERR0331 = "ERR0331",
|
|
82
|
+
ERR0400 = "ERR0400",// 'internal server error on utils services'
|
|
83
|
+
ERR0410 = "ERR0410",// 'empty image'
|
|
84
|
+
ERR0420 = "ERR0420",
|
|
85
|
+
ERR0421 = "ERR0421",
|
|
86
|
+
ERR0430 = "ERR0430",
|
|
87
|
+
ERR0440 = "ERR0440",
|
|
88
|
+
ERR0600 = "ERR0600",
|
|
89
|
+
ERR0610 = "ERR0610",
|
|
90
|
+
ERR0611 = "ERR0611",
|
|
91
|
+
ERR0612 = "ERR0612",
|
|
92
|
+
ERR0613 = "ERR0613",
|
|
93
|
+
ERR0614 = "ERR0614",
|
|
94
|
+
ERR0615 = "ERR0615",
|
|
95
|
+
ERR0616 = "ERR0665",
|
|
96
|
+
ERR0617 = "ERR0617",
|
|
97
|
+
ERR0618 = "ERR0618",
|
|
98
|
+
ERR0619 = "ERR0619",
|
|
99
|
+
ERR0800 = "ERR0800",
|
|
100
|
+
ERR0810 = "ERR0810",
|
|
101
|
+
ERR0811 = "ERR0811",
|
|
102
|
+
ERR0812 = "ERR0812",
|
|
103
|
+
ERR0813 = "ERR0813",
|
|
104
|
+
ERR0814 = "ERR0814",
|
|
105
|
+
ERR0815 = "ERR0815",
|
|
106
|
+
ERR0816 = "ERR0865",
|
|
107
|
+
ERR0817 = "ERR0817",
|
|
108
|
+
ERR0818 = "ERR0818",
|
|
109
|
+
ERR0819 = "ERR0819",
|
|
110
|
+
ERR0820 = "ERR0820",
|
|
111
|
+
ERR9900 = "ERR9900",
|
|
112
|
+
ERR9910 = "ERR9910",
|
|
113
|
+
ERR9911 = "ERR9911",
|
|
114
|
+
ERR9912 = "ERR9912",
|
|
115
|
+
ERR9913 = "ERR9913",
|
|
116
|
+
ERR9914 = "ERR9914",
|
|
117
|
+
ERR9915 = "ERR9915",
|
|
118
|
+
ERR9916 = "ERR9916",
|
|
119
|
+
ERR9917 = "ERR9917"
|
|
120
|
+
}
|
|
121
|
+
export type ApiError = {
|
|
122
|
+
code: ErrorCode;
|
|
123
|
+
detail: string;
|
|
124
|
+
message: string;
|
|
125
|
+
};
|
|
126
|
+
export type ErrorResponse = {
|
|
127
|
+
success: false;
|
|
128
|
+
message: string;
|
|
129
|
+
errors: ApiError[];
|
|
130
|
+
};
|
|
131
|
+
export type ContentResponse<T> = {
|
|
132
|
+
success: true;
|
|
133
|
+
message: string;
|
|
134
|
+
content: T;
|
|
135
|
+
};
|
|
136
|
+
export type ContentsMeta = {
|
|
137
|
+
page: number;
|
|
138
|
+
size: number;
|
|
139
|
+
totalElements: number;
|
|
140
|
+
sort: {
|
|
141
|
+
[key: string]: number;
|
|
142
|
+
}[];
|
|
143
|
+
filter: Record<any, any>;
|
|
144
|
+
};
|
|
145
|
+
export type ContentsResponse<T> = {
|
|
146
|
+
success: true;
|
|
147
|
+
message: string;
|
|
148
|
+
contents: T[];
|
|
149
|
+
meta: ContentsMeta;
|
|
150
|
+
};
|
|
151
|
+
export declare enum LogLevel {
|
|
152
|
+
FATAL = "FATAL",
|
|
153
|
+
ERROR = "ERROR",
|
|
154
|
+
WARN = "WARN",
|
|
155
|
+
INFO = "INFO",
|
|
156
|
+
DEBUG = "DEBUG",
|
|
157
|
+
TRACE = "TRACE"
|
|
158
|
+
}
|
|
159
|
+
export declare enum HTTPMethod {
|
|
160
|
+
POST = "POST",
|
|
161
|
+
GET = "GET",
|
|
162
|
+
PUT = "PUT",
|
|
163
|
+
PATCH = "PATCH",
|
|
164
|
+
DELETE = "DELETE"
|
|
165
|
+
}
|
|
166
|
+
export type RunnerNextRequest = {
|
|
167
|
+
type: 'request';
|
|
168
|
+
body: string;
|
|
169
|
+
method: HTTPMethod;
|
|
170
|
+
url: string;
|
|
171
|
+
};
|
|
172
|
+
export type RunnerNextQueue = {
|
|
173
|
+
type: 'queue';
|
|
174
|
+
messageBody: string;
|
|
175
|
+
messageGroupId: string;
|
|
176
|
+
messageDeduplicationId: string;
|
|
177
|
+
};
|
|
178
|
+
export type RunnerNext = RunnerNextRequest | RunnerNextQueue;
|
|
179
|
+
export type RunCommand = {
|
|
180
|
+
commandLine: string;
|
|
181
|
+
inputFilePath: string;
|
|
182
|
+
outputFilePath: string;
|
|
183
|
+
errorFilePath: string;
|
|
184
|
+
logFilePath: string;
|
|
185
|
+
folderPath: string;
|
|
186
|
+
timeLimit: number;
|
|
187
|
+
memoryLimit: number;
|
|
188
|
+
lockFilePath?: string;
|
|
189
|
+
endFilePath?: string;
|
|
190
|
+
rawExecution: boolean;
|
|
191
|
+
isolated: boolean;
|
|
192
|
+
next?: RunnerNext;
|
|
193
|
+
};
|
|
194
|
+
export type RunnerSQSMessageBody = {
|
|
195
|
+
executions: RunCommand[];
|
|
196
|
+
next?: RunnerNext;
|
|
197
|
+
};
|
|
198
|
+
export type Case = {
|
|
199
|
+
caseKey: string;
|
|
200
|
+
groups: number[];
|
|
201
|
+
};
|
|
202
|
+
export type ProblemTestCase = {
|
|
203
|
+
testCaseKey: string;
|
|
204
|
+
groups: number[];
|
|
205
|
+
};
|
|
206
|
+
export type ProblemSampleCase = {
|
|
207
|
+
input: string;
|
|
208
|
+
output: string;
|
|
209
|
+
};
|
|
210
|
+
export type JudgingFile = {
|
|
211
|
+
language: CodeLanguage;
|
|
212
|
+
fullFileName: string;
|
|
213
|
+
};
|