@juki-team/commons 0.1.31 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +3567 -0
- package/dist/esm/index.js +3347 -0
- package/dist/{constants → types/constants}/commons.d.ts +8 -8
- package/dist/{constants → types/constants}/company.d.ts +3 -3
- package/dist/{constants → types/constants}/contest.d.ts +3 -3
- package/dist/{constants → types/constants}/course.d.ts +2 -2
- package/dist/{constants → types/constants}/entity.d.ts +1 -1
- package/dist/{constants → types/constants}/file.d.ts +5 -6
- package/dist/types/constants/index.d.ts +18 -0
- package/dist/{constants → types/constants}/judge.d.ts +9 -11
- package/dist/{constants → types/constants}/problem.d.ts +8 -9
- package/dist/types/constants/services.d.ts +8 -0
- package/dist/{constants → types/constants}/system.d.ts +2 -2
- package/dist/{constants → types/constants}/teams.d.ts +3 -4
- package/dist/types/constants/user.d.ts +16 -0
- package/dist/{constants → types/constants}/websocket.d.ts +1 -1
- package/dist/{constants → types/constants}/worksheet.d.ts +2 -2
- package/dist/{dto → types/dto}/class.d.ts +4 -4
- package/dist/{dto → types/dto}/code.d.ts +1 -1
- package/dist/{dto → types/dto}/comments.d.ts +3 -3
- package/dist/types/dto/company.d.ts +67 -0
- package/dist/{dto → types/dto}/contest.d.ts +8 -9
- package/dist/{dto → types/dto}/course.d.ts +5 -5
- package/dist/{dto → types/dto}/entity.d.ts +3 -3
- package/dist/{dto → types/dto}/excalidraw.d.ts +4 -4
- package/dist/{dto → types/dto}/file.d.ts +2 -2
- package/dist/types/dto/index.d.ts +25 -0
- package/dist/{dto → types/dto}/judge.d.ts +1 -1
- package/dist/{dto → types/dto}/markdown.d.ts +4 -4
- package/dist/{dto → types/dto}/mermaid.d.ts +4 -4
- package/dist/{dto → types/dto}/problem.d.ts +4 -5
- package/dist/{dto → types/dto}/scoreboard.d.ts +1 -1
- package/dist/{dto → types/dto}/session.d.ts +2 -2
- package/dist/{dto → types/dto}/socket.d.ts +7 -8
- package/dist/{dto → types/dto}/statistics.d.ts +2 -2
- package/dist/{dto → types/dto}/submission.d.ts +4 -5
- package/dist/{dto → types/dto}/system.d.ts +18 -18
- package/dist/{dto → types/dto}/user.d.ts +14 -14
- package/dist/{dto → types/dto}/virtual-user.d.ts +1 -2
- package/dist/{dto → types/dto}/worksheet-submissions.d.ts +4 -4
- package/dist/{dto → types/dto}/worksheet.d.ts +4 -4
- package/dist/{helpers → types/helpers}/class.d.ts +1 -1
- package/dist/{helpers → types/helpers}/commons.d.ts +11 -9
- package/dist/{helpers → types/helpers}/contest.d.ts +1 -1
- package/dist/{helpers → types/helpers}/document.d.ts +2 -2
- package/dist/types/helpers/index.d.ts +14 -0
- package/dist/types/helpers/interval.d.ts +2 -0
- package/dist/{helpers → types/helpers}/judging.d.ts +2 -3
- 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/{helpers → types/helpers}/time.d.ts +1 -1
- package/dist/{helpers → types/helpers}/user.d.ts +1 -1
- package/dist/types/helpers/worksheet.d.ts +10 -0
- package/dist/types/index.d.ts +5 -23
- package/dist/{prototypes → types/prototypes}/Error.d.ts +3 -3
- package/dist/types/prototypes/Number.d.ts +7 -0
- package/dist/types/prototypes/index.d.ts +3 -0
- package/dist/types/{class.d.ts → types/class.d.ts} +2 -2
- package/dist/types/{commons.d.ts → types/commons.d.ts} +3 -3
- package/dist/types/types/company.d.ts +29 -0
- package/dist/types/{contest.d.ts → types/contest.d.ts} +26 -9
- package/dist/types/{course.d.ts → types/course.d.ts} +1 -1
- package/dist/types/{entity.d.ts → types/entity.d.ts} +4 -4
- package/dist/types/{excalidraw.d.ts → types/excalidraw.d.ts} +3 -3
- package/dist/types/{file.d.ts → types/file.d.ts} +9 -4
- package/dist/types/{group.d.ts → types/group.d.ts} +5 -2
- package/dist/types/types/index.d.ts +25 -0
- package/dist/types/{judge.d.ts → types/judge.d.ts} +32 -3
- package/dist/types/{markdown.d.ts → types/markdown.d.ts} +1 -1
- package/dist/types/{mermaid.d.ts → types/mermaid.d.ts} +1 -1
- package/dist/types/types/prisma.d.ts +284 -0
- package/dist/types/{problems.d.ts → types/problems.d.ts} +13 -4
- package/dist/types/types/services.d.ts +213 -0
- package/dist/types/{sheet.d.ts → types/sheet.d.ts} +2 -3
- package/dist/types/{socket.d.ts → types/socket.d.ts} +3 -3
- package/dist/types/{teams.d.ts → types/teams.d.ts} +2 -25
- package/dist/types/{users.d.ts → types/users.d.ts} +4 -10
- package/dist/types/types/virtual-user.d.ts +7 -0
- package/dist/types/{worksheet.d.ts → types/worksheet.d.ts} +3 -3
- package/package.json +18 -22
- package/biome.shared.json +0 -102
- package/dist/constants/commons.js +0 -658
- package/dist/constants/company.js +0 -24
- package/dist/constants/contest.js +0 -29
- package/dist/constants/course.js +0 -12
- package/dist/constants/date.js +0 -23
- package/dist/constants/email.js +0 -34
- package/dist/constants/entity.js +0 -18
- package/dist/constants/file.js +0 -46
- package/dist/constants/index.d.ts +0 -18
- package/dist/constants/index.js +0 -18
- package/dist/constants/judge.js +0 -221
- package/dist/constants/problem.js +0 -72
- package/dist/constants/routing.js +0 -7
- package/dist/constants/services.d.ts +0 -5
- package/dist/constants/services.js +0 -131
- package/dist/constants/system.js +0 -9
- package/dist/constants/teams.js +0 -18
- package/dist/constants/time.js +0 -9
- package/dist/constants/user.d.ts +0 -10
- package/dist/constants/user.js +0 -35
- package/dist/constants/websocket.js +0 -5
- package/dist/constants/worksheet.js +0 -66
- package/dist/dto/class.js +0 -1
- package/dist/dto/code.js +0 -1
- package/dist/dto/comments.js +0 -1
- package/dist/dto/contest.js +0 -7
- package/dist/dto/course.js +0 -1
- package/dist/dto/entity.js +0 -5
- package/dist/dto/excalidraw.js +0 -1
- package/dist/dto/file.js +0 -1
- package/dist/dto/image.js +0 -1
- package/dist/dto/index.d.ts +0 -24
- package/dist/dto/index.js +0 -24
- package/dist/dto/judge.js +0 -1
- package/dist/dto/markdown.js +0 -1
- package/dist/dto/mermaid.js +0 -1
- package/dist/dto/organization.d.ts +0 -102
- package/dist/dto/organization.js +0 -1
- package/dist/dto/problem.js +0 -1
- package/dist/dto/scoreboard.js +0 -1
- package/dist/dto/session.js +0 -1
- package/dist/dto/socket.js +0 -1
- package/dist/dto/statistics.js +0 -1
- package/dist/dto/submission.js +0 -1
- package/dist/dto/system.js +0 -1
- package/dist/dto/url.js +0 -1
- package/dist/dto/user.js +0 -1
- package/dist/dto/virtual-user.js +0 -1
- package/dist/dto/worksheet-submissions.js +0 -1
- package/dist/dto/worksheet.js +0 -1
- package/dist/helpers/class.js +0 -10
- package/dist/helpers/comments.js +0 -4
- package/dist/helpers/commons.js +0 -191
- package/dist/helpers/contest.js +0 -21
- package/dist/helpers/document.js +0 -38
- package/dist/helpers/file.js +0 -4
- package/dist/helpers/index.d.ts +0 -14
- package/dist/helpers/index.js +0 -14
- package/dist/helpers/interval.d.ts +0 -2
- package/dist/helpers/interval.js +0 -22
- package/dist/helpers/judging.js +0 -107
- package/dist/helpers/object.d.ts +0 -1
- package/dist/helpers/object.js +0 -32
- package/dist/helpers/responses.d.ts +0 -8
- package/dist/helpers/responses.js +0 -78
- package/dist/helpers/socket.d.ts +0 -45
- package/dist/helpers/socket.js +0 -238
- package/dist/helpers/time.js +0 -101
- package/dist/helpers/user.js +0 -14
- package/dist/helpers/worksheet.d.ts +0 -10
- package/dist/helpers/worksheet.js +0 -131
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -6
- package/dist/prisma/enums/AssignmentClassType.d.ts +0 -7
- package/dist/prisma/enums/AssignmentClassType.js +0 -6
- package/dist/prisma/enums/ContestEventAction.d.ts +0 -10
- package/dist/prisma/enums/ContestEventAction.js +0 -9
- package/dist/prisma/enums/ContestProblemPrerequisiteType.d.ts +0 -5
- package/dist/prisma/enums/ContestProblemPrerequisiteType.js +0 -4
- package/dist/prisma/enums/ContestRole.d.ts +0 -11
- package/dist/prisma/enums/ContestRole.js +0 -10
- package/dist/prisma/enums/ContestStatus.d.ts +0 -6
- package/dist/prisma/enums/ContestStatus.js +0 -5
- package/dist/prisma/enums/CourseRole.d.ts +0 -12
- package/dist/prisma/enums/CourseRole.js +0 -11
- package/dist/prisma/enums/EntityObjectType.d.ts +0 -13
- package/dist/prisma/enums/EntityObjectType.js +0 -12
- package/dist/prisma/enums/EntityRole.d.ts +0 -8
- package/dist/prisma/enums/EntityRole.js +0 -7
- package/dist/prisma/enums/EntitySubjectType.d.ts +0 -7
- package/dist/prisma/enums/EntitySubjectType.js +0 -6
- package/dist/prisma/enums/FileRole.d.ts +0 -9
- package/dist/prisma/enums/FileRole.js +0 -8
- package/dist/prisma/enums/FileType.d.ts +0 -5
- package/dist/prisma/enums/FileType.js +0 -4
- package/dist/prisma/enums/GroupType.d.ts +0 -5
- package/dist/prisma/enums/GroupType.js +0 -4
- package/dist/prisma/enums/JudgeType.d.ts +0 -12
- package/dist/prisma/enums/JudgeType.js +0 -11
- package/dist/prisma/enums/OrganizationPlan.d.ts +0 -7
- package/dist/prisma/enums/OrganizationPlan.js +0 -6
- package/dist/prisma/enums/ProblemRole.d.ts +0 -11
- package/dist/prisma/enums/ProblemRole.js +0 -10
- package/dist/prisma/enums/ProblemScoringMode.d.ts +0 -6
- package/dist/prisma/enums/ProblemScoringMode.js +0 -5
- package/dist/prisma/enums/ProblemType.d.ts +0 -6
- package/dist/prisma/enums/ProblemType.js +0 -5
- package/dist/prisma/enums/ProblemVerdict.d.ts +0 -14
- package/dist/prisma/enums/ProblemVerdict.js +0 -13
- package/dist/prisma/enums/ShareLinkVisibility.d.ts +0 -5
- package/dist/prisma/enums/ShareLinkVisibility.js +0 -4
- package/dist/prisma/enums/SubmissionRunStatus.d.ts +0 -18
- package/dist/prisma/enums/SubmissionRunStatus.js +0 -17
- package/dist/prisma/enums/SystemRole.d.ts +0 -9
- package/dist/prisma/enums/SystemRole.js +0 -8
- package/dist/prisma/enums/TeamRole.d.ts +0 -9
- package/dist/prisma/enums/TeamRole.js +0 -8
- package/dist/prisma/enums/TelemetryType.d.ts +0 -9
- package/dist/prisma/enums/TelemetryType.js +0 -8
- package/dist/prisma/enums/UserRole.d.ts +0 -10
- package/dist/prisma/enums/UserRole.js +0 -9
- package/dist/prisma/enums/WorkingIn.d.ts +0 -8
- package/dist/prisma/enums/WorkingIn.js +0 -7
- package/dist/prisma/enums/WorksheetContentType.d.ts +0 -10
- package/dist/prisma/enums/WorksheetContentType.js +0 -9
- package/dist/prisma/enums/index.d.ts +0 -26
- package/dist/prisma/enums/index.js +0 -26
- package/dist/prototypes/Date.js +0 -218
- package/dist/prototypes/Error.js +0 -17
- package/dist/prototypes/Number.d.ts +0 -7
- package/dist/prototypes/Number.js +0 -8
- package/dist/prototypes/index.d.ts +0 -3
- package/dist/prototypes/index.js +0 -3
- package/dist/types/account.js +0 -10
- package/dist/types/class.js +0 -7
- package/dist/types/comments.js +0 -1
- package/dist/types/commons.js +0 -69
- package/dist/types/company.d.ts +0 -6
- package/dist/types/company.js +0 -7
- package/dist/types/contest.js +0 -6
- package/dist/types/course.js +0 -1
- package/dist/types/entity.js +0 -50
- package/dist/types/excalidraw.js +0 -1
- package/dist/types/file.js +0 -13
- package/dist/types/group.js +0 -1
- package/dist/types/index.js +0 -23
- package/dist/types/judge.js +0 -17
- package/dist/types/markdown.js +0 -1
- package/dist/types/mermaid.js +0 -1
- package/dist/types/notification.js +0 -8
- package/dist/types/problems.js +0 -16
- package/dist/types/services.d.ts +0 -214
- package/dist/types/services.js +0 -147
- package/dist/types/sheet.js +0 -16
- package/dist/types/socket.js +0 -49
- package/dist/types/submission.js +0 -1
- package/dist/types/teams.js +0 -28
- package/dist/types/users.js +0 -33
- package/dist/types/worksheet.js +0 -11
- /package/dist/{constants → types/constants}/date.d.ts +0 -0
- /package/dist/{constants → types/constants}/email.d.ts +0 -0
- /package/dist/{constants → types/constants}/routing.d.ts +0 -0
- /package/dist/{constants → types/constants}/time.d.ts +0 -0
- /package/dist/{dto → types/dto}/image.d.ts +0 -0
- /package/dist/{dto → types/dto}/url.d.ts +0 -0
- /package/dist/{helpers → types/helpers}/comments.d.ts +0 -0
- /package/dist/{helpers → types/helpers}/file.d.ts +0 -0
- /package/dist/{prototypes → types/prototypes}/Date.d.ts +0 -0
- /package/dist/types/{account.d.ts → types/account.d.ts} +0 -0
- /package/dist/types/{comments.d.ts → types/comments.d.ts} +0 -0
- /package/dist/types/{notification.d.ts → types/notification.d.ts} +0 -0
- /package/dist/types/{submission.d.ts → types/submission.d.ts} +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ContestStatus } from '../prisma/enums/index.js';
|
|
2
|
-
import { Role } from '../types/index.js';
|
|
3
|
-
export const CONTEST_STATUS = {
|
|
4
|
-
[ContestStatus.PUBLIC]: {
|
|
5
|
-
value: ContestStatus.PUBLIC,
|
|
6
|
-
label: 'public',
|
|
7
|
-
description: 'the contest will appear in the contest list and the users will have access according to their roles',
|
|
8
|
-
},
|
|
9
|
-
[ContestStatus.RESERVED]: {
|
|
10
|
-
value: ContestStatus.RESERVED,
|
|
11
|
-
label: 'reserved',
|
|
12
|
-
description: 'the contest will appear in the contest list only for contest members and the users will have access according to their roles',
|
|
13
|
-
},
|
|
14
|
-
[ContestStatus.ARCHIVED]: {
|
|
15
|
-
value: ContestStatus.ARCHIVED,
|
|
16
|
-
label: 'archived',
|
|
17
|
-
description: 'the contest will not appear for anyone, contact the administrator to see it again',
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
export const CONTEST_ROLE = {
|
|
21
|
-
[Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 7 },
|
|
22
|
-
[Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 6 },
|
|
23
|
-
[Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 5 },
|
|
24
|
-
[Role.CREATOR]: { value: Role.CREATOR, label: 'creator', level: 4 },
|
|
25
|
-
[Role.MANAGER]: { value: Role.MANAGER, label: 'manager', level: 3 },
|
|
26
|
-
[Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
|
|
27
|
-
[Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
|
|
28
|
-
[Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
29
|
-
};
|
package/dist/constants/course.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CourseRole } from '../prisma/enums/index.js';
|
|
2
|
-
export const COURSE_ROLE = {
|
|
3
|
-
[CourseRole.RESTRICTED]: { value: CourseRole.RESTRICTED, label: 'restricted', level: 8 },
|
|
4
|
-
[CourseRole.GUEST]: { value: CourseRole.GUEST, label: 'guest', level: 7 },
|
|
5
|
-
[CourseRole.REGULAR]: { value: CourseRole.REGULAR, label: 'regular', level: 6 },
|
|
6
|
-
[CourseRole.CREATOR]: { value: CourseRole.CREATOR, label: 'creator', level: 5 },
|
|
7
|
-
[CourseRole.SUPER_CREATOR]: { value: CourseRole.SUPER_CREATOR, label: 'super creator', level: 4 },
|
|
8
|
-
[CourseRole.MANAGER]: { value: CourseRole.MANAGER, label: 'manager', level: 3 },
|
|
9
|
-
[CourseRole.MASTER]: { value: CourseRole.MASTER, label: 'super admin', level: 2 },
|
|
10
|
-
[CourseRole.ADMIN]: { value: CourseRole.ADMIN, label: 'admin', level: 1 },
|
|
11
|
-
[CourseRole.SUPER_ADMIN]: { value: CourseRole.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
12
|
-
};
|
package/dist/constants/date.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { range } from '../helpers/index.js';
|
|
2
|
-
export const YEARS = range(1970, 2100);
|
|
3
|
-
export const MONTH_NAMES = [
|
|
4
|
-
'January',
|
|
5
|
-
'February',
|
|
6
|
-
'March',
|
|
7
|
-
'April',
|
|
8
|
-
'May',
|
|
9
|
-
'June',
|
|
10
|
-
'July',
|
|
11
|
-
'August',
|
|
12
|
-
'September',
|
|
13
|
-
'October',
|
|
14
|
-
'November',
|
|
15
|
-
'December',
|
|
16
|
-
];
|
|
17
|
-
export const DAY_NAMES = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
18
|
-
export const HOURS = range(0, 24);
|
|
19
|
-
export const MINUTES = range(0, 60);
|
|
20
|
-
export const SECONDS = range(0, 60);
|
|
21
|
-
export const MILLISECONDS = range(0, 1000);
|
|
22
|
-
export const MAX_DATE = new Date(8640000000000000);
|
|
23
|
-
export const MIN_DATE = new Date(0);
|
package/dist/constants/email.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const SUPPORT_EMAIL = 'support@juki.app';
|
|
2
|
-
export const JUKI_APP_EMAIL_TEMPLATE = `<div style="width: 100%; background: #F2F2F2;">
|
|
3
|
-
<div style="background: #164066; width: 100%;">
|
|
4
|
-
<div style="height: 56px; color: white; width: 100px; margin: 0 auto">
|
|
5
|
-
<img
|
|
6
|
-
src="https://images.juki.pub/assets/juki-app-horizontal-white-logo.svg"
|
|
7
|
-
alt="juki app logo"
|
|
8
|
-
height="56px"
|
|
9
|
-
style="padding:10px; box-sizing: border-box"
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
<div style="padding: 24px; color: #333333; font-family: sans-serif; font-size: 16px; line-height: 24px;">
|
|
14
|
-
<div style="max-width: 520px; margin: 0 auto; padding: 24px; background: white; border-radius: 6px;">
|
|
15
|
-
<section style="padding: 0 0 1em 0; border-bottom: 1px solid #828282;">
|
|
16
|
-
{{content}}
|
|
17
|
-
</section>
|
|
18
|
-
<div style="font-size: 14px; text-align: center; color: #828282; line-height: 16px; padding-top: 1em">
|
|
19
|
-
<p style="margin: 0;">
|
|
20
|
-
Si tú no realizaste la solicitud, escribenos a
|
|
21
|
-
<a href="mailto:${SUPPORT_EMAIL}" style="color: #2468A6; text-decoration: none;">
|
|
22
|
-
${SUPPORT_EMAIL}
|
|
23
|
-
</a>
|
|
24
|
-
</p>
|
|
25
|
-
<p style="margin: 0;">
|
|
26
|
-
Este mensaje fue enviado por el equipo de
|
|
27
|
-
<a href="https://juki.app" style="color: #2468A6; text-decoration: none;">
|
|
28
|
-
juki.app
|
|
29
|
-
</a>
|
|
30
|
-
</p>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</div>`;
|
package/dist/constants/entity.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { EntityAccess, EntityMembersRank } from '../types/index.js';
|
|
2
|
-
export const EMPTY_DOCUMENT_MEMBERS = () => ({
|
|
3
|
-
access: EntityAccess.PRIVATE,
|
|
4
|
-
managers: {},
|
|
5
|
-
spectators: {},
|
|
6
|
-
});
|
|
7
|
-
export const EMPTY_ENTITY_MEMBERS = () => ({
|
|
8
|
-
rankAdministrators: EntityMembersRank.CLOSE,
|
|
9
|
-
administrators: {},
|
|
10
|
-
rankManagers: EntityMembersRank.CLOSE,
|
|
11
|
-
managers: {},
|
|
12
|
-
rankGuests: EntityMembersRank.CLOSE,
|
|
13
|
-
guests: {},
|
|
14
|
-
rankSpectators: EntityMembersRank.CLOSE,
|
|
15
|
-
spectators: {},
|
|
16
|
-
rankParticipants: EntityMembersRank.CLOSE,
|
|
17
|
-
participants: {},
|
|
18
|
-
});
|
package/dist/constants/file.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { FileType } from '../prisma/enums/index.js';
|
|
2
|
-
import { EntityAccess, EntityState, Role } from '../types/index.js';
|
|
3
|
-
export const FILE_TYPE = {
|
|
4
|
-
[FileType.FILE]: { value: FileType.FILE, label: 'file' },
|
|
5
|
-
[FileType.FOLDER]: { value: FileType.FOLDER, label: 'folder' },
|
|
6
|
-
};
|
|
7
|
-
export const FILE_ROLE = {
|
|
8
|
-
[Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 5 },
|
|
9
|
-
[Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 4 },
|
|
10
|
-
[Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 3 },
|
|
11
|
-
[Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
|
|
12
|
-
[Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
|
|
13
|
-
[Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
14
|
-
};
|
|
15
|
-
export const ENTITY_STATE = {
|
|
16
|
-
[EntityState.RELEASED]: {
|
|
17
|
-
value: EntityState.RELEASED,
|
|
18
|
-
label: 'released',
|
|
19
|
-
},
|
|
20
|
-
[EntityState.ARCHIVED]: {
|
|
21
|
-
value: EntityState.ARCHIVED,
|
|
22
|
-
label: 'archived',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
export const ENTITY_ACCESS = {
|
|
26
|
-
[EntityAccess.PRIVATE]: {
|
|
27
|
-
value: EntityAccess.PRIVATE,
|
|
28
|
-
label: 'private',
|
|
29
|
-
description: 'the record will be visible and editable only to the owner',
|
|
30
|
-
},
|
|
31
|
-
[EntityAccess.RESTRICTED]: {
|
|
32
|
-
value: EntityAccess.RESTRICTED,
|
|
33
|
-
label: 'restricted',
|
|
34
|
-
description: 'the record will be visible to viewers and the owner and editable to editors and the owner',
|
|
35
|
-
},
|
|
36
|
-
[EntityAccess.PUBLIC]: {
|
|
37
|
-
value: EntityAccess.PUBLIC,
|
|
38
|
-
label: 'public',
|
|
39
|
-
description: 'the record will be visible to anyone and editable to editors and the owner',
|
|
40
|
-
},
|
|
41
|
-
[EntityAccess.EXPOSED]: {
|
|
42
|
-
value: EntityAccess.EXPOSED,
|
|
43
|
-
label: 'exposed',
|
|
44
|
-
description: 'the record will be visible and editable to anyone',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './commons.js';
|
|
2
|
-
export * from './company.js';
|
|
3
|
-
export * from './contest.js';
|
|
4
|
-
export * from './course.js';
|
|
5
|
-
export * from './date.js';
|
|
6
|
-
export * from './email.js';
|
|
7
|
-
export * from './entity.js';
|
|
8
|
-
export * from './file.js';
|
|
9
|
-
export * from './judge.js';
|
|
10
|
-
export * from './problem.js';
|
|
11
|
-
export * from './routing.js';
|
|
12
|
-
export * from './services.js';
|
|
13
|
-
export * from './system.js';
|
|
14
|
-
export * from './teams.js';
|
|
15
|
-
export * from './time.js';
|
|
16
|
-
export * from './user.js';
|
|
17
|
-
export * from './websocket.js';
|
|
18
|
-
export * from './worksheet.js';
|
package/dist/constants/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './commons.js';
|
|
2
|
-
export * from './company.js';
|
|
3
|
-
export * from './contest.js';
|
|
4
|
-
export * from './course.js';
|
|
5
|
-
export * from './date.js';
|
|
6
|
-
export * from './email.js';
|
|
7
|
-
export * from './entity.js';
|
|
8
|
-
export * from './file.js';
|
|
9
|
-
export * from './judge.js';
|
|
10
|
-
export * from './problem.js';
|
|
11
|
-
export * from './routing.js';
|
|
12
|
-
export * from './services.js';
|
|
13
|
-
export * from './system.js';
|
|
14
|
-
export * from './teams.js';
|
|
15
|
-
export * from './time.js';
|
|
16
|
-
export * from './user.js';
|
|
17
|
-
export * from './websocket.js';
|
|
18
|
-
export * from './worksheet.js';
|
package/dist/constants/judge.js
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { JudgeType, ProblemScoringMode, ProblemType, ProblemVerdict, SubmissionRunStatus } from '../prisma/enums/index.js';
|
|
2
|
-
import { CodeLanguage, RunnerType } from '../types/index.js';
|
|
3
|
-
export const JUDGE = {
|
|
4
|
-
// [Judge.CUSTOMER]: {
|
|
5
|
-
// value: Judge.CUSTOMER,
|
|
6
|
-
// label: '',
|
|
7
|
-
// logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
|
|
8
|
-
// logoSize: [ 883.991, 435 ],
|
|
9
|
-
// url: '',
|
|
10
|
-
// // getLoginUrl: () => '',
|
|
11
|
-
// // getProfileUrl: () => '',
|
|
12
|
-
// // getSubmitUrl: () => '',
|
|
13
|
-
// // getSubmissionUrl: () => '',
|
|
14
|
-
// // getProblemUrl: (key: string) => `/problem/view/${key}`,
|
|
15
|
-
// // getUserSubmissionsUrl: () => '',
|
|
16
|
-
// },
|
|
17
|
-
[JudgeType.JUKI_JUDGE]: {
|
|
18
|
-
value: JudgeType.JUKI_JUDGE,
|
|
19
|
-
label: 'Juki Judge',
|
|
20
|
-
logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
|
|
21
|
-
logoSize: [883.991, 435],
|
|
22
|
-
url: 'https://judge.juki.app',
|
|
23
|
-
// getLoginUrl: () => '',
|
|
24
|
-
// getProfileUrl: () => '',
|
|
25
|
-
// getSubmitUrl: () => '',
|
|
26
|
-
// getSubmissionUrl: () => '',
|
|
27
|
-
// getProblemUrl: (key: string) => `https://judge.juki.app/problem/view/${key}`,
|
|
28
|
-
// getUserSubmissionsUrl: () => '',
|
|
29
|
-
},
|
|
30
|
-
[JudgeType.CODEFORCES]: {
|
|
31
|
-
value: JudgeType.CODEFORCES,
|
|
32
|
-
label: 'Codeforces',
|
|
33
|
-
logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
|
|
34
|
-
logoSize: [1232.75, 145.12],
|
|
35
|
-
url: 'https://codeforces.com',
|
|
36
|
-
// getLoginUrl: () => 'https://codeforces.com/enter',
|
|
37
|
-
// getProfileUrl: () => '',
|
|
38
|
-
// getSubmitUrl: () => 'https://codeforces.com/problemset/submit',
|
|
39
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string) => {
|
|
40
|
-
// const [ contestId ] = problemKey.split('-');
|
|
41
|
-
// return `https://codeforces.com/problemset/submission/${contestId}/${submissionId}`;
|
|
42
|
-
// },
|
|
43
|
-
// getProblemUrl: (problemKey: string) => {
|
|
44
|
-
// const [ contestId, index ] = problemKey.split('-');
|
|
45
|
-
// return `https://codeforces.com/problemset/problem/${contestId}/${index}`;
|
|
46
|
-
// },
|
|
47
|
-
// getUserSubmissionsUrl: () => '',
|
|
48
|
-
},
|
|
49
|
-
[JudgeType.CODEFORCES_GYM]: {
|
|
50
|
-
value: JudgeType.CODEFORCES_GYM,
|
|
51
|
-
label: 'Codeforces Gym',
|
|
52
|
-
logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
|
|
53
|
-
logoSize: [1232.75, 145.12],
|
|
54
|
-
url: 'https://codeforces.com',
|
|
55
|
-
// getLoginUrl: () => 'https://codeforces.com/enter',
|
|
56
|
-
// getProfileUrl: () => '',
|
|
57
|
-
// getSubmitUrl: (problemKey: string) => {
|
|
58
|
-
// const [ gymContestId, index ] = problemKey.split('-');
|
|
59
|
-
// return `https://codeforces.com/gym/${gymContestId}/submit`;
|
|
60
|
-
// },
|
|
61
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string) => {
|
|
62
|
-
// const [ gymContestId ] = problemKey.split('-');
|
|
63
|
-
// return `https://codeforces.com/gym/${gymContestId}/submission/${submissionId}`;
|
|
64
|
-
// },
|
|
65
|
-
// getProblemUrl: (problemKey: string) => {
|
|
66
|
-
// const [ gymContestId, index ] = problemKey.split('-');
|
|
67
|
-
// return `https://codeforces.com/gym/${gymContestId}/problem/${index}`;
|
|
68
|
-
// },
|
|
69
|
-
// getUserSubmissionsUrl: () => '',
|
|
70
|
-
},
|
|
71
|
-
[JudgeType.JV_UMSA]: {
|
|
72
|
-
value: JudgeType.JV_UMSA,
|
|
73
|
-
label: 'Juez Virtual UMSA',
|
|
74
|
-
logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
|
|
75
|
-
logoSize: [1232.75, 145.12],
|
|
76
|
-
url: 'https://jv.umsa.bo',
|
|
77
|
-
// getLoginUrl: () => 'https://jv.umsa.bo/oj/login.php',
|
|
78
|
-
// getProfileUrl: () => 'https://jv.umsa.bo/oj/userInfo.php',
|
|
79
|
-
// getSubmitUrl: (problemKey: string) => {
|
|
80
|
-
// // single problem: '1019'
|
|
81
|
-
// // cib problem: '1019-A'
|
|
82
|
-
// const isContestProblem = problemKey.includes('-');
|
|
83
|
-
// // A -> 0, B -> 1, C -> 2, D -> 3, E -> 4, F -> 5, G -> 6, H -> 7, I -> 8, J -> 9
|
|
84
|
-
// const params = problemKey.split('-');
|
|
85
|
-
// return isContestProblem
|
|
86
|
-
// ? `https://jv.umsa.bo/oj/submitpage.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
|
|
87
|
-
// : `https://jv.umsa.bo/oj/submitpage.php?id=${problemKey}`;
|
|
88
|
-
// },
|
|
89
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string, username: string) => {
|
|
90
|
-
// // return `https://jv.umsa.bo/status.php?problem_id=&user_id=${username}&language=-1&jresult=-1`;
|
|
91
|
-
// return `https://jv.umsa.bo/oj/showsource.php?id=${submissionId}`;
|
|
92
|
-
// },
|
|
93
|
-
// getProblemUrl: (problemKey: string) => {
|
|
94
|
-
// const isContestProblem = problemKey.includes('-');
|
|
95
|
-
// const params = problemKey.split('-');
|
|
96
|
-
// return isContestProblem
|
|
97
|
-
// ? `https://jv.umsa.bo/oj/problem.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
|
|
98
|
-
// : `https://jv.umsa.bo/oj/problem.php?id=${problemKey}`;
|
|
99
|
-
// },
|
|
100
|
-
// getUserSubmissionsUrl: (username: string) => `https://jv.umsa.bo/oj/status.php?user_id=${username}`,
|
|
101
|
-
},
|
|
102
|
-
[JudgeType.UVA_ONLINE_JUDGE]: {
|
|
103
|
-
value: JudgeType.UVA_ONLINE_JUDGE,
|
|
104
|
-
label: 'Uva Online Judge',
|
|
105
|
-
logo: 'https://images.juki.pub/c/uva-online-judge-logo-color.png',
|
|
106
|
-
logoSize: [150, 135.994],
|
|
107
|
-
url: 'https://onlinejudge.org',
|
|
108
|
-
},
|
|
109
|
-
[JudgeType.AT_CODER]: {
|
|
110
|
-
value: JudgeType.AT_CODER,
|
|
111
|
-
label: 'AtCoder',
|
|
112
|
-
logo: 'https://images.juki.pub/c/at-coder-logo-color.png',
|
|
113
|
-
logoSize: [762.997, 675],
|
|
114
|
-
url: 'https://atcoder.jp',
|
|
115
|
-
},
|
|
116
|
-
[JudgeType.CODECHEF]: {
|
|
117
|
-
value: JudgeType.CODECHEF,
|
|
118
|
-
label: 'Codechef',
|
|
119
|
-
logo: 'https://images.juki.pub/c/codechef-logo-color.svg',
|
|
120
|
-
logoSize: [1207.7, 453.17],
|
|
121
|
-
url: 'https://www.codechef.com',
|
|
122
|
-
},
|
|
123
|
-
[JudgeType.TOPCODER]: {
|
|
124
|
-
value: JudgeType.TOPCODER,
|
|
125
|
-
label: 'Topcoder',
|
|
126
|
-
logo: 'https://images.juki.pub/c/topcoder-logo-color.png',
|
|
127
|
-
logoSize: [971.99, 415.99],
|
|
128
|
-
url: 'https://www.topcoder.com',
|
|
129
|
-
},
|
|
130
|
-
[JudgeType.LEETCODE]: {
|
|
131
|
-
value: JudgeType.LEETCODE,
|
|
132
|
-
label: 'LeetCode',
|
|
133
|
-
logo: 'https://images.juki.pub/assets/leetcode-logo-color.svg',
|
|
134
|
-
logoSize: [95, 111],
|
|
135
|
-
url: 'https://leetcode.com',
|
|
136
|
-
// getProblemUrl: (problemKey: string) => {
|
|
137
|
-
// return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}`;
|
|
138
|
-
// },
|
|
139
|
-
// getProfileUrl: (userNickname: string) => {
|
|
140
|
-
// return `https://leetcode.com/u/${userNickname}`;
|
|
141
|
-
// },
|
|
142
|
-
// getSubmissionUrl: (problemKey: string, submissionId: string, username: string, submissionRunId: string) => {
|
|
143
|
-
// return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}/submissions/${submissionRunId}`;
|
|
144
|
-
// },
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
export const RUNNER_ACCEPTED_PROBLEM_MODES = [
|
|
148
|
-
ProblemScoringMode.TOTAL,
|
|
149
|
-
ProblemScoringMode.SUBTASK,
|
|
150
|
-
ProblemScoringMode.PARTIAL,
|
|
151
|
-
];
|
|
152
|
-
export const RUNNER_ACCEPTED_PROBLEM_TYPES = [ProblemType.STANDARD, ProblemType.DYNAMIC];
|
|
153
|
-
export const RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES = [
|
|
154
|
-
CodeLanguage.C_11,
|
|
155
|
-
CodeLanguage.CPP_11,
|
|
156
|
-
CodeLanguage.CPP_20,
|
|
157
|
-
CodeLanguage.JAVA_21,
|
|
158
|
-
CodeLanguage.PYTHON_3,
|
|
159
|
-
CodeLanguage.PYTHON_PYPY_3,
|
|
160
|
-
CodeLanguage.JAVASCRIPT_NODE_JS_22,
|
|
161
|
-
CodeLanguage.PSEUDOCODE_PSEINT,
|
|
162
|
-
];
|
|
163
|
-
export const ACCEPTED_PROGRAMMING_LANGUAGES = [...RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES];
|
|
164
|
-
export const PROBLEM_VERDICT = {
|
|
165
|
-
[ProblemVerdict.NONE]: { value: ProblemVerdict.NONE, label: 'none', color: '#555555' },
|
|
166
|
-
[ProblemVerdict.PENDING]: { value: ProblemVerdict.PENDING, label: 'pending', color: '#79B6FD' },
|
|
167
|
-
[ProblemVerdict.HIDDEN]: { value: ProblemVerdict.HIDDEN, label: 'hidden', color: '#555555' },
|
|
168
|
-
[ProblemVerdict.AC]: { value: ProblemVerdict.AC, label: 'accepted', color: '#43D787' },
|
|
169
|
-
[ProblemVerdict.PE]: { value: ProblemVerdict.PE, label: 'presentation error', color: '#55db93' },
|
|
170
|
-
[ProblemVerdict.PA]: { value: ProblemVerdict.PA, label: 'partial accepted', color: '#55db93' },
|
|
171
|
-
[ProblemVerdict.CE]: { value: ProblemVerdict.CE, label: 'compilation error', color: '#FE9F9F' },
|
|
172
|
-
[ProblemVerdict.RE]: { value: ProblemVerdict.RE, label: 'runtime error', color: '#FE9F9F' },
|
|
173
|
-
[ProblemVerdict.TLE]: { value: ProblemVerdict.TLE, label: 'time limit exceed', color: '#FE9F9F' },
|
|
174
|
-
[ProblemVerdict.MLE]: { value: ProblemVerdict.MLE, label: 'memory limit exceed', color: '#FE9F9F' },
|
|
175
|
-
[ProblemVerdict.WA]: { value: ProblemVerdict.WA, label: 'wrong answer', color: '#FE9F9F' },
|
|
176
|
-
};
|
|
177
|
-
export const PROBLEM_VERDICTS = [
|
|
178
|
-
ProblemVerdict.NONE,
|
|
179
|
-
ProblemVerdict.PENDING,
|
|
180
|
-
ProblemVerdict.AC,
|
|
181
|
-
ProblemVerdict.PE,
|
|
182
|
-
ProblemVerdict.PA,
|
|
183
|
-
ProblemVerdict.CE,
|
|
184
|
-
ProblemVerdict.RE,
|
|
185
|
-
ProblemVerdict.TLE,
|
|
186
|
-
ProblemVerdict.MLE,
|
|
187
|
-
ProblemVerdict.WA,
|
|
188
|
-
];
|
|
189
|
-
export const SUBMISSION_RUN_STATUS = {
|
|
190
|
-
[SubmissionRunStatus.NONE]: { value: SubmissionRunStatus.NONE, label: 'none' }, // status
|
|
191
|
-
[SubmissionRunStatus.RECEIVED]: { value: SubmissionRunStatus.RECEIVED, label: 'received' }, // state
|
|
192
|
-
[SubmissionRunStatus.COMPILING]: { value: SubmissionRunStatus.COMPILING, label: 'compiling' }, // state
|
|
193
|
-
[SubmissionRunStatus.COMPILED]: { value: SubmissionRunStatus.COMPILED, label: 'compiled' }, // status
|
|
194
|
-
[SubmissionRunStatus.COMPILATION_ERROR]: { value: SubmissionRunStatus.COMPILATION_ERROR, label: 'compilation error' }, // status
|
|
195
|
-
[SubmissionRunStatus.FETCHING_TEST_CASES]: {
|
|
196
|
-
value: SubmissionRunStatus.FETCHING_TEST_CASES,
|
|
197
|
-
label: 'fetching test cases',
|
|
198
|
-
}, // state
|
|
199
|
-
[SubmissionRunStatus.RUNNING_TEST_CASE]: { value: SubmissionRunStatus.RUNNING_TEST_CASE, label: 'running test case' }, // state
|
|
200
|
-
[SubmissionRunStatus.RUNNING_TEST_CASES]: {
|
|
201
|
-
value: SubmissionRunStatus.RUNNING_TEST_CASES,
|
|
202
|
-
label: 'running test cases',
|
|
203
|
-
}, // state
|
|
204
|
-
[SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES]: {
|
|
205
|
-
value: SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES,
|
|
206
|
-
label: 'running sample cases',
|
|
207
|
-
}, // state
|
|
208
|
-
[SubmissionRunStatus.EXECUTED_TEST_CASE]: {
|
|
209
|
-
value: SubmissionRunStatus.EXECUTED_TEST_CASE,
|
|
210
|
-
label: 'executed test case',
|
|
211
|
-
}, // status
|
|
212
|
-
[SubmissionRunStatus.FAILED_TEST_CASE]: { value: SubmissionRunStatus.FAILED_TEST_CASE, label: 'failed test case' }, // status
|
|
213
|
-
[SubmissionRunStatus.JUDGING_TEST_CASE]: { value: SubmissionRunStatus.JUDGING_TEST_CASE, label: 'judging test case' }, // state
|
|
214
|
-
[SubmissionRunStatus.GRADING]: { value: SubmissionRunStatus.GRADING, label: 'grading' }, // status
|
|
215
|
-
[SubmissionRunStatus.FAILED]: { value: SubmissionRunStatus.FAILED, label: 'failed' }, // status
|
|
216
|
-
[SubmissionRunStatus.COMPLETED]: { value: SubmissionRunStatus.COMPLETED, label: 'completed' }, // status
|
|
217
|
-
};
|
|
218
|
-
export const RUNNER_TYPE = {
|
|
219
|
-
[RunnerType.HIGH_PERFORMANCE]: { value: RunnerType.HIGH_PERFORMANCE, label: 'high performance' },
|
|
220
|
-
[RunnerType.LOW_PERFORMANCE]: { value: RunnerType.LOW_PERFORMANCE, label: 'low performance' },
|
|
221
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ProblemScoringMode, ProblemType } from '../prisma/enums/index.js';
|
|
2
|
-
import { ProblemInput, ProblemOutput, Role } from '../types/index.js';
|
|
3
|
-
export const PROBLEM_INPUT = {
|
|
4
|
-
[ProblemInput.STANDARD]: { value: ProblemInput.STANDARD, label: 'standard' },
|
|
5
|
-
[ProblemInput.INTERACTIVE]: { value: ProblemInput.INTERACTIVE, label: 'interactive' },
|
|
6
|
-
};
|
|
7
|
-
export const PROBLEM_OUTPUT = {
|
|
8
|
-
[ProblemOutput.STANDARD]: { value: ProblemOutput.STANDARD, label: 'standard' },
|
|
9
|
-
[ProblemOutput.DYNAMIC]: { value: ProblemOutput.DYNAMIC, label: 'dynamic' },
|
|
10
|
-
[ProblemOutput.INTERACTIVE]: { value: ProblemOutput.INTERACTIVE, label: 'interactive' },
|
|
11
|
-
};
|
|
12
|
-
export const PROBLEM_MODES = [ProblemScoringMode.TOTAL, ProblemScoringMode.SUBTASK, ProblemScoringMode.PARTIAL];
|
|
13
|
-
export const PROBLEM_MODE = {
|
|
14
|
-
[ProblemScoringMode.TOTAL]: {
|
|
15
|
-
value: ProblemScoringMode.TOTAL,
|
|
16
|
-
label: 'total',
|
|
17
|
-
description: 'if all test cases are Accepted the result is Accepted ' +
|
|
18
|
-
'otherwise it will be Runtime Error, Time Limited Exceeded, Memory Limited Exceeded, Wrong Answer or Presentation Error in that order.',
|
|
19
|
-
},
|
|
20
|
-
[ProblemScoringMode.SUBTASK]: {
|
|
21
|
-
value: ProblemScoringMode.SUBTASK,
|
|
22
|
-
label: 'subtask',
|
|
23
|
-
description: 'the test cases are grouped and each group of test cases is assigned a score, ' +
|
|
24
|
-
'if all test cases in a group are Accepted then the score assigned to that group of test cases is added to total score, ' +
|
|
25
|
-
'if total score is equal to the sum of the assigned scores of all groups of test cases then the result is Accepted, ' +
|
|
26
|
-
'otherwise if the total score is greater than zero the result is Partial Accepted with the total accumulated score, ' +
|
|
27
|
-
'otherwise it will be Runtime Error, Time Limited Exceeded, Memory Limited Exceeded, Wrong Answer or Presentation Error in that order.',
|
|
28
|
-
},
|
|
29
|
-
[ProblemScoringMode.PARTIAL]: {
|
|
30
|
-
value: ProblemScoringMode.PARTIAL,
|
|
31
|
-
label: 'partial',
|
|
32
|
-
description: 'the test cases are grouped and each group is associated with X points, ' +
|
|
33
|
-
'and each test case in a group scores X points ',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
export const PROBLEM_TYPES = [ProblemType.STANDARD, ProblemType.DYNAMIC, ProblemType.INTERACTIVE];
|
|
37
|
-
export const PROBLEM_TYPE = {
|
|
38
|
-
[ProblemType.STANDARD]: {
|
|
39
|
-
value: ProblemType.STANDARD,
|
|
40
|
-
label: 'standard',
|
|
41
|
-
description: 'The contestant submit a single source code in one of the allowed programming languages. ' +
|
|
42
|
-
'The source code is either standalone or to be compiled. ' +
|
|
43
|
-
"The resulting user's executable does I/O standard input and output. " +
|
|
44
|
-
"The output produced by the contestant's program is then compared to the correct output using a simple diff algorithm.",
|
|
45
|
-
},
|
|
46
|
-
[ProblemType.INTERACTIVE]: {
|
|
47
|
-
value: ProblemType.INTERACTIVE,
|
|
48
|
-
label: 'interactive',
|
|
49
|
-
description: 'developing..',
|
|
50
|
-
},
|
|
51
|
-
[ProblemType.DYNAMIC]: {
|
|
52
|
-
value: ProblemType.DYNAMIC,
|
|
53
|
-
label: 'dynamic',
|
|
54
|
-
description: 'The contestant submit a single source code in one of the allowed programming languages. ' +
|
|
55
|
-
"The user's source code is either standalone or to be compiled. " +
|
|
56
|
-
"The resulting user's executable does I/O standard input and output. " +
|
|
57
|
-
"The output produced by the contestant's program is saved. " +
|
|
58
|
-
'The problem editor save a single source code in C++ 17. ' +
|
|
59
|
-
"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). " +
|
|
60
|
-
'The resulting editor\'s executable should be "AC" or a number between 1 and 100 for partial accepted',
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
export const PROBLEM_ROLE = {
|
|
64
|
-
[Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 7 },
|
|
65
|
-
[Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 6 },
|
|
66
|
-
[Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 5 },
|
|
67
|
-
[Role.CREATOR]: { value: Role.CREATOR, label: 'creator', level: 4 },
|
|
68
|
-
[Role.MANAGER]: { value: Role.MANAGER, label: 'manager', level: 3 },
|
|
69
|
-
[Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
|
|
70
|
-
[Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
|
|
71
|
-
[Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
72
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { ErrorCode } from '../types/index.js';
|
|
2
|
-
export const getErrorMessage = (code) => code.toLowerCase().replace(/_/g, ' ');
|
|
3
|
-
export const ERROR_HTTP_STATUS = {
|
|
4
|
-
// Http Errors
|
|
5
|
-
[ErrorCode.INTERNAL_SERVER_ERROR]: 500,
|
|
6
|
-
[ErrorCode.BAD_REQUEST]: 400,
|
|
7
|
-
[ErrorCode.UNAUTHORIZED]: 401,
|
|
8
|
-
[ErrorCode.FORBIDDEN]: 403,
|
|
9
|
-
[ErrorCode.NOT_FOUND]: 404,
|
|
10
|
-
[ErrorCode.METHOD_NOT_ALLOWED]: 405,
|
|
11
|
-
// UI general errors
|
|
12
|
-
[ErrorCode.ABORTED_REQUEST]: 400,
|
|
13
|
-
[ErrorCode.ERROR_ON_RESPONSE]: 400,
|
|
14
|
-
[ErrorCode.SERVICE_NOT_FOUND]: 404,
|
|
15
|
-
// Company errors
|
|
16
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE]: 500,
|
|
17
|
-
[ErrorCode.COMPANY_NOT_CREATED]: 500,
|
|
18
|
-
[ErrorCode.COMPANY_NOT_FOUND]: 404,
|
|
19
|
-
[ErrorCode.COMPANY_NOT_UPDATED]: 500,
|
|
20
|
-
[ErrorCode.COMPANY_NOT_DELETED]: 500,
|
|
21
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_COMPANY]: 403,
|
|
22
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_COMPANY]: 403,
|
|
23
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_COMPANY]: 403,
|
|
24
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_COMPANY]: 403,
|
|
25
|
-
// User errors
|
|
26
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_USERS_SERVICE]: 500,
|
|
27
|
-
[ErrorCode.USER_NOT_CREATED]: 500,
|
|
28
|
-
[ErrorCode.USER_NOT_FOUND]: 404,
|
|
29
|
-
[ErrorCode.USER_NOT_UPDATED]: 500,
|
|
30
|
-
[ErrorCode.USER_NOT_DELETED]: 500,
|
|
31
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_USER]: 403,
|
|
32
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_USER]: 403,
|
|
33
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_USER]: 403,
|
|
34
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_USER]: 403,
|
|
35
|
-
[ErrorCode.USER_IS_REPORTED]: 403,
|
|
36
|
-
[ErrorCode.USER_IS_ARCHIVED]: 403,
|
|
37
|
-
[ErrorCode.USER_WITH_EMAIL_REQUESTED_NOT_FOUND]: 404,
|
|
38
|
-
[ErrorCode.USER_WITH_NICKNAME_REQUESTED_NOT_FOUND]: 404,
|
|
39
|
-
[ErrorCode.THE_EMAIL_IS_ALREADY_REGISTERED]: 400,
|
|
40
|
-
[ErrorCode.THE_NICKNAME_IS_ALREADY_TAKEN]: 400,
|
|
41
|
-
[ErrorCode.INCORRECT_PASSWORD]: 401,
|
|
42
|
-
[ErrorCode.USER_SESSION_NOT_CREATED]: 500,
|
|
43
|
-
[ErrorCode.USER_SESSION_NOT_FOUND]: 404,
|
|
44
|
-
[ErrorCode.USER_SESSION_NOT_UPDATED]: 500,
|
|
45
|
-
[ErrorCode.USER_SESSION_NOT_DELETED]: 500,
|
|
46
|
-
// Problem errors
|
|
47
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_PROBLEMS_SERVICE]: 500,
|
|
48
|
-
[ErrorCode.PROBLEM_NOT_CREATED]: 500,
|
|
49
|
-
[ErrorCode.PROBLEM_NOT_FOUND]: 404,
|
|
50
|
-
[ErrorCode.PROBLEM_NOT_UPDATED]: 500,
|
|
51
|
-
[ErrorCode.PROBLEM_NOT_DELETED]: 500,
|
|
52
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_PROBLEM]: 403,
|
|
53
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_PROBLEM]: 403,
|
|
54
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_PROBLEM]: 403,
|
|
55
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_PROBLEM]: 403,
|
|
56
|
-
[ErrorCode.PROBLEM_MODE_NOT_SUPPORTED]: 400,
|
|
57
|
-
[ErrorCode.PROBLEM_TYPE_NOT_SUPPORTED]: 400,
|
|
58
|
-
[ErrorCode.PROBLEM_TIME_LIMIT_MUST_BE_A_NUMBER]: 400,
|
|
59
|
-
[ErrorCode.PROBLEM_MEMORY_LIMIT_MUST_BE_NUMBER]: 400,
|
|
60
|
-
[ErrorCode.TEST_CASE_FILE_EMPTY]: 400,
|
|
61
|
-
// Contest errors
|
|
62
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_CONTESTS_SERVICE]: 500,
|
|
63
|
-
[ErrorCode.CONTEST_NOT_CREATED]: 500,
|
|
64
|
-
[ErrorCode.CONTEST_NOT_FOUND]: 404,
|
|
65
|
-
[ErrorCode.CONTEST_NOT_UPDATED]: 500,
|
|
66
|
-
[ErrorCode.CONTEST_NOT_DELETED]: 500,
|
|
67
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_CONTEST]: 403,
|
|
68
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_CONTEST]: 403,
|
|
69
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_CONTEST]: 403,
|
|
70
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_CONTEST]: 403,
|
|
71
|
-
[ErrorCode.NOT_ALLOWED_TO_REGISTER_TO_THE_CONTEST]: 403,
|
|
72
|
-
[ErrorCode.IS_ALREADY_REGISTERED]: 400,
|
|
73
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_CONTESTS]: 403,
|
|
74
|
-
[ErrorCode.SCOREBOARD_NOT_CREATED]: 500,
|
|
75
|
-
[ErrorCode.SCOREBOARD_NOT_FOUND]: 404,
|
|
76
|
-
[ErrorCode.SCOREBOARD_NOT_UPDATED]: 500,
|
|
77
|
-
[ErrorCode.SCOREBOARD_NOT_DELETED]: 500,
|
|
78
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_SCOREBOARD]: 403,
|
|
79
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_SCOREBOARD]: 403,
|
|
80
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_SCOREBOARD]: 403,
|
|
81
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_SCOREBOARD]: 403,
|
|
82
|
-
[ErrorCode.CLARIFICATION_NOT_CREATED]: 500,
|
|
83
|
-
[ErrorCode.CLARIFICATION_NOT_FOUND]: 404,
|
|
84
|
-
[ErrorCode.CLARIFICATION_NOT_UPDATED]: 500,
|
|
85
|
-
[ErrorCode.CLARIFICATION_NOT_DELETED]: 500,
|
|
86
|
-
[ErrorCode.NOT_ALLOWED_TO_SUBMIT_CLARIFICATION]: 403,
|
|
87
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_CLARIFICATION]: 403,
|
|
88
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_CLARIFICATION]: 403,
|
|
89
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_CLARIFICATION]: 403,
|
|
90
|
-
// Submission errors
|
|
91
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_SUBMISSIONS_SERVICE]: 500,
|
|
92
|
-
[ErrorCode.SUBMISSION_NOT_FOUND]: 404,
|
|
93
|
-
[ErrorCode.SUBMISSION_NOT_CREATED]: 500,
|
|
94
|
-
[ErrorCode.SUBMISSION_NOT_UPDATED]: 500,
|
|
95
|
-
[ErrorCode.SOURCE_EMPTY]: 400,
|
|
96
|
-
[ErrorCode.PROGRAMMING_LANGUAGE_NOT_SUPPORTED]: 400,
|
|
97
|
-
[ErrorCode.NOT_ALLOWED_SUBMIT_THE_PROBLEM_IN_THE_CONTEST]: 403,
|
|
98
|
-
[ErrorCode.JUDGEMENT_UNAVAILABLE]: 500,
|
|
99
|
-
// Utils errors
|
|
100
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_UTILS_SERVICES]: 500,
|
|
101
|
-
[ErrorCode.EMPTY_IMAGE]: 400,
|
|
102
|
-
[ErrorCode.CODES_ERROR]: 400,
|
|
103
|
-
[ErrorCode.COMPILATION_FAILED]: 400,
|
|
104
|
-
[ErrorCode.FILES_ERROR]: 400,
|
|
105
|
-
[ErrorCode.THE_EMAIL_COULD_NOT_BE_SENT]: 500,
|
|
106
|
-
// Team errors
|
|
107
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_TEAMS_SERVICE]: 500,
|
|
108
|
-
[ErrorCode.TEAM_NOT_CREATED]: 500,
|
|
109
|
-
[ErrorCode.TEAM_NOT_FOUND]: 404,
|
|
110
|
-
[ErrorCode.TEAM_NOT_UPDATED]: 500,
|
|
111
|
-
[ErrorCode.TEAM_NOT_DELETED]: 500,
|
|
112
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_TEAM]: 403,
|
|
113
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_TEAM]: 403,
|
|
114
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_TEAM]: 403,
|
|
115
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_TEAM]: 403,
|
|
116
|
-
[ErrorCode.TEAM_IS_REPORTED]: 403,
|
|
117
|
-
[ErrorCode.TEAM_IS_ARCHIVED]: 403,
|
|
118
|
-
// File errors
|
|
119
|
-
[ErrorCode.INTERNAL_SERVER_ERROR_ON_FILES_SERVICE]: 500,
|
|
120
|
-
[ErrorCode.FILE_NOT_CREATED]: 500,
|
|
121
|
-
[ErrorCode.FILE_NOT_FOUND]: 404,
|
|
122
|
-
[ErrorCode.FILE_NOT_UPDATED]: 500,
|
|
123
|
-
[ErrorCode.FILE_NOT_DELETED]: 500,
|
|
124
|
-
[ErrorCode.NOT_ALLOWED_TO_CREATE_THE_FILE]: 403,
|
|
125
|
-
[ErrorCode.NOT_ALLOWED_TO_VIEW_THE_FILE]: 403,
|
|
126
|
-
[ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_FILE]: 403,
|
|
127
|
-
[ErrorCode.NOT_ALLOWED_TO_DELETE_THE_FILE]: 403,
|
|
128
|
-
[ErrorCode.FILE_IS_RESERVED]: 403,
|
|
129
|
-
[ErrorCode.FILE_IS_PRIVATE]: 403,
|
|
130
|
-
[ErrorCode.FILE_IS_ARCHIVED]: 403,
|
|
131
|
-
};
|
package/dist/constants/system.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SystemRole } from '../prisma/enums/index.js';
|
|
2
|
-
export const SYSTEM_ROLE = {
|
|
3
|
-
[SystemRole.GUEST]: { value: SystemRole.GUEST, label: 'guest', level: 5 },
|
|
4
|
-
[SystemRole.REGULAR]: { value: SystemRole.REGULAR, label: 'regular', level: 4 },
|
|
5
|
-
[SystemRole.MANAGER]: { value: SystemRole.MANAGER, label: 'manager', level: 3 },
|
|
6
|
-
[SystemRole.MASTER]: { value: SystemRole.MASTER, label: 'master', level: 2 },
|
|
7
|
-
[SystemRole.ADMIN]: { value: SystemRole.ADMIN, label: 'admin', level: 1 },
|
|
8
|
-
[SystemRole.SUPER_ADMIN]: { value: SystemRole.SUPER_ADMIN, label: 'super admin', level: 0 },
|
|
9
|
-
};
|