@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.
Files changed (95) hide show
  1. package/README.md +3 -0
  2. package/dist/cjs/index.cjs +3567 -0
  3. package/dist/esm/index.js +3347 -0
  4. package/dist/types/constants/commons.d.ts +62 -0
  5. package/dist/types/constants/company.d.ts +9 -0
  6. package/dist/types/constants/contest.d.ts +15 -0
  7. package/dist/types/constants/course.d.ts +8 -0
  8. package/dist/types/constants/date.d.ts +9 -0
  9. package/dist/types/constants/email.d.ts +2 -0
  10. package/dist/types/constants/entity.d.ts +3 -0
  11. package/dist/types/constants/file.d.ts +27 -0
  12. package/dist/types/constants/index.d.ts +18 -0
  13. package/dist/types/constants/judge.d.ts +35 -0
  14. package/dist/types/constants/problem.d.ts +36 -0
  15. package/dist/types/constants/routing.d.ts +7 -0
  16. package/dist/types/constants/services.d.ts +8 -0
  17. package/dist/types/constants/system.d.ts +8 -0
  18. package/dist/types/constants/teams.d.ts +14 -0
  19. package/dist/types/constants/time.d.ts +9 -0
  20. package/dist/types/constants/user.d.ts +16 -0
  21. package/dist/types/constants/websocket.d.ts +6 -0
  22. package/dist/types/constants/worksheet.d.ts +11 -0
  23. package/dist/types/dto/class.d.ts +115 -0
  24. package/dist/types/dto/code.d.ts +13 -0
  25. package/dist/types/dto/comments.d.ts +21 -0
  26. package/dist/types/dto/company.d.ts +67 -0
  27. package/dist/types/dto/contest.d.ts +94 -0
  28. package/dist/types/dto/course.d.ts +34 -0
  29. package/dist/types/dto/entity.d.ts +92 -0
  30. package/dist/types/dto/excalidraw.d.ts +12 -0
  31. package/dist/types/dto/file.d.ts +34 -0
  32. package/dist/types/dto/image.d.ts +6 -0
  33. package/dist/types/dto/index.d.ts +25 -0
  34. package/dist/types/dto/judge.d.ts +16 -0
  35. package/dist/types/dto/markdown.d.ts +12 -0
  36. package/dist/types/dto/mermaid.d.ts +12 -0
  37. package/dist/types/dto/problem.d.ts +66 -0
  38. package/dist/types/dto/scoreboard.d.ts +35 -0
  39. package/dist/types/dto/session.d.ts +15 -0
  40. package/dist/types/dto/socket.d.ts +256 -0
  41. package/dist/types/dto/statistics.d.ts +43 -0
  42. package/dist/types/dto/submission.d.ts +94 -0
  43. package/dist/types/dto/system.d.ts +91 -0
  44. package/dist/types/dto/url.d.ts +8 -0
  45. package/dist/types/dto/user.d.ts +109 -0
  46. package/dist/types/dto/virtual-user.d.ts +38 -0
  47. package/dist/types/dto/worksheet-submissions.d.ts +64 -0
  48. package/dist/types/dto/worksheet.d.ts +39 -0
  49. package/dist/types/helpers/class.d.ts +4 -0
  50. package/dist/types/helpers/comments.d.ts +4 -0
  51. package/dist/types/helpers/commons.d.ts +35 -0
  52. package/dist/types/helpers/contest.d.ts +5 -0
  53. package/dist/types/helpers/document.d.ts +14 -0
  54. package/dist/types/helpers/file.d.ts +1 -0
  55. package/dist/types/helpers/index.d.ts +14 -0
  56. package/dist/types/helpers/interval.d.ts +2 -0
  57. package/dist/types/helpers/judging.d.ts +24 -0
  58. package/dist/types/helpers/object.d.ts +1 -0
  59. package/dist/types/helpers/responses.d.ts +8 -0
  60. package/dist/types/helpers/socket.d.ts +45 -0
  61. package/dist/types/helpers/time.d.ts +13 -0
  62. package/dist/types/helpers/user.d.ts +11 -0
  63. package/dist/types/helpers/worksheet.d.ts +10 -0
  64. package/dist/types/index.d.ts +5 -0
  65. package/dist/types/prototypes/Date.d.ts +62 -0
  66. package/dist/types/prototypes/Error.d.ts +10 -0
  67. package/dist/types/prototypes/Number.d.ts +7 -0
  68. package/dist/types/prototypes/index.d.ts +3 -0
  69. package/dist/types/types/account.d.ts +9 -0
  70. package/dist/types/types/class.d.ts +67 -0
  71. package/dist/types/types/comments.d.ts +17 -0
  72. package/dist/types/types/commons.d.ts +84 -0
  73. package/dist/types/types/company.d.ts +29 -0
  74. package/dist/types/types/contest.d.ts +161 -0
  75. package/dist/types/types/course.d.ts +13 -0
  76. package/dist/types/types/entity.d.ts +116 -0
  77. package/dist/types/types/excalidraw.d.ts +9 -0
  78. package/dist/types/types/file.d.ts +27 -0
  79. package/dist/types/types/group.d.ts +12 -0
  80. package/dist/types/types/index.d.ts +25 -0
  81. package/dist/types/types/judge.d.ts +75 -0
  82. package/dist/types/types/markdown.d.ts +8 -0
  83. package/dist/types/types/mermaid.d.ts +8 -0
  84. package/dist/types/types/notification.d.ts +7 -0
  85. package/dist/types/types/prisma.d.ts +284 -0
  86. package/dist/types/types/problems.d.ts +102 -0
  87. package/dist/types/types/services.d.ts +213 -0
  88. package/dist/types/types/sheet.d.ts +103 -0
  89. package/dist/types/types/socket.d.ts +49 -0
  90. package/dist/types/types/submission.d.ts +5 -0
  91. package/dist/types/types/teams.d.ts +73 -0
  92. package/dist/types/types/users.d.ts +59 -0
  93. package/dist/types/types/virtual-user.d.ts +7 -0
  94. package/dist/types/types/worksheet.d.ts +42 -0
  95. package/package.json +38 -0
@@ -0,0 +1,62 @@
1
+ import { CodeLanguage, Language, Theme } from '../types';
2
+ export declare const LANGUAGE: {
3
+ [key in Language]: {
4
+ value: Language;
5
+ label: string;
6
+ };
7
+ };
8
+ export declare const THEME: {
9
+ [key in Theme]: {
10
+ value: Theme;
11
+ label: string;
12
+ };
13
+ };
14
+ export type CodeLanguageMeta = {
15
+ value: CodeLanguage;
16
+ label: string;
17
+ mime: string;
18
+ mainFilename: string;
19
+ fileExtension: Array<string>;
20
+ compilePattern: string;
21
+ runPattern: string;
22
+ templateSourceCode: string;
23
+ hasBuildFile: boolean;
24
+ executable: string;
25
+ executableVersion: string;
26
+ monacoKey: string;
27
+ codeMirrorKey: string;
28
+ highlightJsKey: string;
29
+ };
30
+ export declare const CODE_LANGUAGE: {
31
+ [key in CodeLanguage]: CodeLanguageMeta;
32
+ };
33
+ export declare const PAGE_SIZES: string[];
34
+ export declare const PALLETE: {
35
+ VIVOS: {
36
+ color: string;
37
+ title: string;
38
+ }[];
39
+ OSCUROS: {
40
+ color: string;
41
+ title: string;
42
+ }[];
43
+ AGRISADOS: {
44
+ color: string;
45
+ title: string;
46
+ }[];
47
+ CLAROS: {
48
+ color: string;
49
+ title: string;
50
+ }[];
51
+ };
52
+ export declare const UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
53
+ export declare const LOWERCASE_LETTERS: string;
54
+ export declare const NUMBERS = "012345678";
55
+ export declare const DEFAULT_JUKI_PROFILE_IMAGE = "https://juki-judge.s3.us-east-2.amazonaws.com/public/file/5f69783aa7a8e048ef8d0ce2.";
56
+ export declare const SEPARATOR_TOKEN = "\u001E";
57
+ export declare const HEADER_JUKI_FORWARDED_HOST = "x-juki-forwarded-host";
58
+ export declare const HEADER_JUKI_VISITOR_SESSION_ID = "x-juki-visitor-session-id";
59
+ export declare const HEADER_JUKI_METADATA = "x-juki-metadata";
60
+ export declare const HEADER_JUKI_SECRET_TOKEN = "x-juki-secret-token";
61
+ export declare const HEADER_JUKI_INTERNAL_API_KEY = "x-juki-internal-api-key";
62
+ export declare const COOKIE_JUKI_SESSION_ID = "juki-session-id";
@@ -0,0 +1,9 @@
1
+ import { CompanyPlan } from '../types/company';
2
+ export declare const JUKI_APP_COMPANY_KEY = "juki-app";
3
+ export declare const COMPANY_PLAN: {
4
+ [key in CompanyPlan]: {
5
+ value: CompanyPlan;
6
+ label: string;
7
+ description: string;
8
+ };
9
+ };
@@ -0,0 +1,15 @@
1
+ import { ContestRole, ContestStatus } from '../types';
2
+ export declare const CONTEST_STATUS: {
3
+ [key in ContestStatus]: {
4
+ value: ContestStatus;
5
+ label: string;
6
+ description: string;
7
+ };
8
+ };
9
+ export declare const CONTEST_ROLE: {
10
+ [key in ContestRole]: {
11
+ value: ContestRole;
12
+ label: string;
13
+ level: number;
14
+ };
15
+ };
@@ -0,0 +1,8 @@
1
+ import { CourseRole } from '../types';
2
+ export declare const COURSE_ROLE: {
3
+ [key in CourseRole]: {
4
+ value: CourseRole;
5
+ label: string;
6
+ level: number;
7
+ };
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare const YEARS: number[];
2
+ export declare const MONTH_NAMES: string[];
3
+ export declare const DAY_NAMES: string[];
4
+ export declare const HOURS: number[];
5
+ export declare const MINUTES: number[];
6
+ export declare const SECONDS: number[];
7
+ export declare const MILLISECONDS: number[];
8
+ export declare const MAX_DATE: Date;
9
+ export declare const MIN_DATE: Date;
@@ -0,0 +1,2 @@
1
+ export declare const SUPPORT_EMAIL = "support@juki.app";
2
+ export declare const JUKI_APP_EMAIL_TEMPLATE = "<div style=\"width: 100%; background: #F2F2F2;\">\n <div style=\"background: #164066; width: 100%;\">\n <div style=\"height: 56px; color: white; width: 100px; margin: 0 auto\">\n <img\n src=\"https://images.juki.pub/assets/juki-app-horizontal-white-logo.svg\"\n alt=\"juki app logo\"\n height=\"56px\"\n style=\"padding:10px; box-sizing: border-box\"\n />\n </div>\n </div>\n <div style=\"padding: 24px; color: #333333; font-family: sans-serif; font-size: 16px; line-height: 24px;\">\n <div style=\"max-width: 520px; margin: 0 auto; padding: 24px; background: white; border-radius: 6px;\">\n <section style=\"padding: 0 0 1em 0; border-bottom: 1px solid #828282;\">\n {{content}}\n </section>\n <div style=\"font-size: 14px; text-align: center; color: #828282; line-height: 16px; padding-top: 1em\">\n <p style=\"margin: 0;\">\n Si t\u00FA no realizaste la solicitud, escribenos a\n <a href=\"mailto:support@juki.app\" style=\"color: #2468A6; text-decoration: none;\">\n support@juki.app\n </a>\n </p>\n <p style=\"margin: 0;\">\n Este mensaje fue enviado por el equipo de\n <a href=\"https://juki.app\" style=\"color: #2468A6; text-decoration: none;\">\n juki.app\n </a>\n </p>\n </div>\n </div>\n </div>\n</div>";
@@ -0,0 +1,3 @@
1
+ import { DocumentMembersResponseDTO, EntityMembersResponseDTO } from '../dto';
2
+ export declare const EMPTY_DOCUMENT_MEMBERS: () => DocumentMembersResponseDTO;
3
+ export declare const EMPTY_ENTITY_MEMBERS: () => EntityMembersResponseDTO;
@@ -0,0 +1,27 @@
1
+ import { EntityAccess, EntityState, FileRole, FileType } from '../types';
2
+ export declare const FILE_TYPE: {
3
+ [key in FileType]: {
4
+ value: FileType;
5
+ label: string;
6
+ };
7
+ };
8
+ export declare const FILE_ROLE: {
9
+ [key in FileRole]: {
10
+ value: FileRole;
11
+ label: string;
12
+ level: number;
13
+ };
14
+ };
15
+ export declare const ENTITY_STATE: {
16
+ [key in EntityState]: {
17
+ value: EntityState;
18
+ label: string;
19
+ };
20
+ };
21
+ export declare const ENTITY_ACCESS: {
22
+ [key in EntityAccess]: {
23
+ value: EntityAccess;
24
+ label: string;
25
+ description: string;
26
+ };
27
+ };
@@ -0,0 +1,18 @@
1
+ export * from './commons';
2
+ export * from './company';
3
+ export * from './contest';
4
+ export * from './course';
5
+ export * from './date';
6
+ export * from './email';
7
+ export * from './entity';
8
+ export * from './judge';
9
+ export * from './problem';
10
+ export * from './routing';
11
+ export * from './services';
12
+ export * from './file';
13
+ export * from './system';
14
+ export * from './teams';
15
+ export * from './time';
16
+ export * from './user';
17
+ export * from './websocket';
18
+ export * from './worksheet';
@@ -0,0 +1,35 @@
1
+ import { CodeLanguage, Judge, ProblemScoringMode, ProblemType, ProblemVerdict, RunnerType, SubmissionRunStatus } from '../types';
2
+ export type JudgeType = {
3
+ [key in Judge]: {
4
+ value: Judge;
5
+ label: string;
6
+ logo: string;
7
+ logoSize: [number, number];
8
+ url: string;
9
+ };
10
+ };
11
+ export declare const JUDGE: JudgeType;
12
+ export declare const RUNNER_ACCEPTED_PROBLEM_MODES: ProblemScoringMode[];
13
+ export declare const RUNNER_ACCEPTED_PROBLEM_TYPES: ProblemType[];
14
+ export declare const RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES: CodeLanguage[];
15
+ export declare const ACCEPTED_PROGRAMMING_LANGUAGES: CodeLanguage[];
16
+ export declare const PROBLEM_VERDICT: {
17
+ [key in ProblemVerdict]: {
18
+ value: ProblemVerdict;
19
+ label: string;
20
+ color: string;
21
+ };
22
+ };
23
+ export declare const PROBLEM_VERDICTS: ProblemVerdict[];
24
+ export declare const SUBMISSION_RUN_STATUS: {
25
+ [key in SubmissionRunStatus]: {
26
+ value: SubmissionRunStatus;
27
+ label: string;
28
+ };
29
+ };
30
+ export declare const RUNNER_TYPE: {
31
+ [key in RunnerType]: {
32
+ value: RunnerType;
33
+ label: string;
34
+ };
35
+ };
@@ -0,0 +1,36 @@
1
+ import { ProblemInput, ProblemOutput, ProblemRole, ProblemScoringMode, ProblemType } from '../types';
2
+ export declare const PROBLEM_INPUT: {
3
+ [key in ProblemInput]: {
4
+ value: ProblemInput;
5
+ label: string;
6
+ };
7
+ };
8
+ export declare const PROBLEM_OUTPUT: {
9
+ [key in ProblemOutput]: {
10
+ value: ProblemOutput;
11
+ label: string;
12
+ };
13
+ };
14
+ export declare const PROBLEM_MODES: ProblemScoringMode[];
15
+ export declare const PROBLEM_MODE: {
16
+ [key in ProblemScoringMode]: {
17
+ value: ProblemScoringMode;
18
+ label: string;
19
+ description: string;
20
+ };
21
+ };
22
+ export declare const PROBLEM_TYPES: ProblemType[];
23
+ export declare const PROBLEM_TYPE: {
24
+ [key in ProblemType]: {
25
+ value: ProblemType;
26
+ label: string;
27
+ description: string;
28
+ };
29
+ };
30
+ export declare const PROBLEM_ROLE: {
31
+ [key in ProblemRole]: {
32
+ value: ProblemRole;
33
+ label: string;
34
+ level: number;
35
+ };
36
+ };
@@ -0,0 +1,7 @@
1
+ export declare const _TYPE = ":type";
2
+ export declare const _KEY = ":key";
3
+ export declare const _TAB = ":tab";
4
+ export declare const _SUB_TAB = ":subTab?";
5
+ export declare const _SUB_SUB_TAB = ":subSubTab?";
6
+ export declare const PAGE = "page";
7
+ export declare const PAGE_SIZE = "size";
@@ -0,0 +1,8 @@
1
+ import { ErrorCode } from '../types';
2
+ export declare const ERROR: {
3
+ [key in ErrorCode]: {
4
+ value: ErrorCode;
5
+ message: string;
6
+ status: 500 | 400 | 401 | 403 | 404 | 405;
7
+ };
8
+ };
@@ -0,0 +1,8 @@
1
+ import { SystemRole } from '../types';
2
+ export declare const SYSTEM_ROLE: {
3
+ [key in SystemRole]: {
4
+ value: SystemRole;
5
+ label: string;
6
+ level: number;
7
+ };
8
+ };
@@ -0,0 +1,14 @@
1
+ import { MemberRole, TeamRole } from '../types';
2
+ export declare const MEMBER_ROLE: {
3
+ [key in MemberRole]: {
4
+ value: MemberRole;
5
+ label: string;
6
+ };
7
+ };
8
+ export declare const TEAM_ROLE: {
9
+ [key in TeamRole]: {
10
+ value: TeamRole;
11
+ label: string;
12
+ level: number;
13
+ };
14
+ };
@@ -0,0 +1,9 @@
1
+ export declare const ONE_SECOND = 1000;
2
+ export declare const SEC_30: number;
3
+ export declare const SEC_60: number;
4
+ export declare const SEC_90: number;
5
+ export declare const SEC_120: number;
6
+ export declare const ONE_MINUTE: number;
7
+ export declare const ONE_HOUR: number;
8
+ export declare const ONE_DAY: number;
9
+ export declare const ONE_WEEK: number;
@@ -0,0 +1,16 @@
1
+ import { UserPermissions } from '../dto';
2
+ import { UserRole, UserStatus } from '../types';
3
+ export declare const USER_STATUS: {
4
+ [key in UserStatus]: {
5
+ value: UserStatus;
6
+ label: string;
7
+ };
8
+ };
9
+ export declare const USER_ROLE: {
10
+ [key in UserRole]: {
11
+ value: UserRole;
12
+ label: string;
13
+ level: number;
14
+ };
15
+ };
16
+ export declare const EMPTY_USER_PERMISSIONS: UserPermissions;
@@ -0,0 +1,6 @@
1
+ import { ClientId } from '../types';
2
+ export declare const CHANNEL_PUBLISH_SUBSCRIPTIONS = "pub:subscriptions";
3
+ export declare const CHANNEL_SUBSCRIBE_NOTIFICATIONS = "sub:notifications";
4
+ export declare const CHANNEL_SUBSCRIBE_CLIENT: (clientId: ClientId) => string;
5
+ export declare const CHANNEL_PUBLISH_MESSAGES = "pub:messages";
6
+ export declare const CHANNEL_PRESENCE_CLIENT = "pre:client";
@@ -0,0 +1,11 @@
1
+ import { AspectRatio, NewPageSheet } from '../types';
2
+ export declare const NEW_PAGE_SHEET: () => NewPageSheet;
3
+ export declare const ASPECT_RATIO: {
4
+ [key in AspectRatio]: {
5
+ aspectRatio: AspectRatio;
6
+ width: number;
7
+ height: number;
8
+ decimal: number;
9
+ label: string;
10
+ };
11
+ };
@@ -0,0 +1,115 @@
1
+ import { AssignmentBasicInfo, AssignmentClass, ClassBaseDocument, ClassCycleTag, EntityState } from '../types';
2
+ import { EntityMembersDTO, EntityMembersResponseDTO } from './entity';
3
+ import { UserCompanyBasicInfoResponseDTO, UserSummaryListResponseDTO } from './user';
4
+ interface ClassUserResponseDTO {
5
+ isOwner: boolean;
6
+ isManager: boolean;
7
+ isSpectator: boolean;
8
+ isParticipant: boolean;
9
+ isGuest: boolean;
10
+ }
11
+ export interface ClassSummaryListResponseDTO {
12
+ key: string;
13
+ name: string;
14
+ description: string;
15
+ state: EntityState;
16
+ owner: UserCompanyBasicInfoResponseDTO;
17
+ user: ClassUserResponseDTO;
18
+ }
19
+ export interface ContestAssignmentSessionCycleClassDataResponseDTO extends AssignmentBasicInfo {
20
+ type: AssignmentClass.CONTEST;
21
+ contestKey: string;
22
+ numberProblems: number;
23
+ }
24
+ export interface CourseAssignmentSessionCycleClassDataResponseDTO extends AssignmentBasicInfo {
25
+ type: AssignmentClass.COURSE;
26
+ courseKey: string;
27
+ numberLessons: number;
28
+ }
29
+ export interface WorksheetAssignmentSessionCycleClassDataResponseDTO extends AssignmentBasicInfo {
30
+ type: AssignmentClass.WORKSHEET;
31
+ worksheetKey: string;
32
+ numberPages: number;
33
+ }
34
+ export interface NoneAssignmentSessionCycleClassDataResponseDTO extends AssignmentBasicInfo {
35
+ type: AssignmentClass.NONE;
36
+ }
37
+ export type AssignmentSessionCycleClassDataResponseDTO = ContestAssignmentSessionCycleClassDataResponseDTO | CourseAssignmentSessionCycleClassDataResponseDTO | WorksheetAssignmentSessionCycleClassDataResponseDTO | NoneAssignmentSessionCycleClassDataResponseDTO;
38
+ export interface SessionCycleClassDataResponseDTO {
39
+ id: string;
40
+ index: number;
41
+ name: string;
42
+ assignments: {
43
+ [key: string]: AssignmentSessionCycleClassDataResponseDTO;
44
+ };
45
+ startTimestamp: number;
46
+ endTimestamp: number;
47
+ state: EntityState;
48
+ }
49
+ export interface CycleClassDataResponseDTO {
50
+ id: string;
51
+ index: number;
52
+ name: string;
53
+ sessions: {
54
+ [key: string]: SessionCycleClassDataResponseDTO;
55
+ };
56
+ tags: ClassCycleTag[];
57
+ startTimestamp: number;
58
+ endTimestamp: number;
59
+ state: EntityState;
60
+ }
61
+ export interface ClassCycleDataResponseDTO extends ClassSummaryListResponseDTO {
62
+ members: EntityMembersResponseDTO;
63
+ cycle: CycleClassDataResponseDTO;
64
+ cycles: {
65
+ [key: string]: {
66
+ name: string;
67
+ index: number;
68
+ id: string;
69
+ };
70
+ };
71
+ }
72
+ export interface ClassCyclesCycleDataResponseDTO extends Omit<CycleClassDataResponseDTO, 'sessions'> {
73
+ sessions: {
74
+ [key: string]: Omit<SessionCycleClassDataResponseDTO, 'assignments'>;
75
+ };
76
+ }
77
+ export interface ClassCyclesDataResponseDTO extends ClassSummaryListResponseDTO {
78
+ members: EntityMembersResponseDTO;
79
+ cycles: {
80
+ [key: string]: ClassCyclesCycleDataResponseDTO;
81
+ };
82
+ }
83
+ export interface AssignmentContestUpsert extends AssignmentBasicInfo {
84
+ type: AssignmentClass.CONTEST;
85
+ contestKey: string;
86
+ }
87
+ export interface AssignmentCourseUpsert extends AssignmentBasicInfo {
88
+ type: AssignmentClass.COURSE;
89
+ courseKey: string;
90
+ }
91
+ export interface AssignmentWorksheetUpsert extends AssignmentBasicInfo {
92
+ type: AssignmentClass.WORKSHEET;
93
+ worksheetKey: string;
94
+ }
95
+ export interface UpsertClassDTO extends Omit<ClassBaseDocument, 'members' | 'key' | 'cycles'> {
96
+ members: EntityMembersDTO;
97
+ }
98
+ export interface UpsertClassCycleDTO extends Omit<ClassBaseDocument['cycles'][string], 'sessions' | 'id'> {
99
+ }
100
+ export interface UpsertClassCycleSessionDTO extends Omit<ClassBaseDocument['cycles'][string]['sessions'][string], 'assignments' | 'id'> {
101
+ }
102
+ export interface UpsertClassCycleSessionAssignmentDTO extends Omit<AssignmentBasicInfo, 'id'> {
103
+ key: string;
104
+ }
105
+ export interface ClassAssignmentBaseDocument {
106
+ userId: string;
107
+ assignmentId: string;
108
+ points: number;
109
+ }
110
+ export interface ClassAssignmentDataResponseDTO {
111
+ user: UserSummaryListResponseDTO;
112
+ assignmentId: string;
113
+ points: number;
114
+ }
115
+ export {};
@@ -0,0 +1,13 @@
1
+ import { JudgingFile } from '../types';
2
+ export interface CodeRunDTO {
3
+ runId: string;
4
+ timeLimit: number;
5
+ memoryLimit: number;
6
+ connectionId: string;
7
+ files: (JudgingFile & {
8
+ source: string;
9
+ isInput: boolean;
10
+ isEntryPoint: boolean;
11
+ toCompile: boolean;
12
+ })[];
13
+ }
@@ -0,0 +1,21 @@
1
+ import { UserCompanyBasicInfoResponseDTO } from './user';
2
+ export type ReactionUserResponseData = {
3
+ key: string;
4
+ user: UserCompanyBasicInfoResponseDTO;
5
+ createdTimestamp: number;
6
+ updatedTimestamp: number;
7
+ };
8
+ export interface CommentDataResponseDTO {
9
+ id: string;
10
+ content: string;
11
+ user: UserCompanyBasicInfoResponseDTO;
12
+ hidden: boolean;
13
+ reactions: {
14
+ [key: string]: {
15
+ [key: string]: ReactionUserResponseData;
16
+ };
17
+ };
18
+ replies: CommentDataResponseDTO[];
19
+ createdTimestamp: number;
20
+ updatedTimestamp: number;
21
+ }
@@ -0,0 +1,67 @@
1
+ import { CompanyPlan, ResourceInstance, ResourceLogger, Theme } from '../types';
2
+ import { EmailDataResponseDTO } from './system';
3
+ import { UserCompanyBasicInfoResponseDTO, UserPermissions } from './user';
4
+ export interface CompanyJudgeResponseDTO {
5
+ key: string;
6
+ name: string;
7
+ keyPrefix: string;
8
+ }
9
+ export interface CompanyTrustedCompanyResponseDTO {
10
+ key: string;
11
+ name: string;
12
+ }
13
+ export interface CompanyResponseDTO extends EmailDataResponseDTO {
14
+ name: string;
15
+ key: string;
16
+ hosts: string[];
17
+ imageUrl: string;
18
+ managerUser: UserCompanyBasicInfoResponseDTO;
19
+ systemAdminUser: UserCompanyBasicInfoResponseDTO;
20
+ plan: CompanyPlan;
21
+ startTimestamp: number;
22
+ judges: CompanyJudgeResponseDTO[];
23
+ trustedCompanies: CompanyTrustedCompanyResponseDTO[];
24
+ styles: CompanyStyles;
25
+ }
26
+ export interface CompanyUserPermissionsResponseDTO extends CompanyResponseDTO {
27
+ userPermissions: UserPermissions;
28
+ contactEmail: string;
29
+ contactCellPhoneNumber: string;
30
+ contactTelegram: string;
31
+ }
32
+ export interface CompanyResourceSpecificationsResponseDTO {
33
+ logger: ResourceLogger;
34
+ runnerInstance: ResourceInstance;
35
+ runnerListener: {
36
+ taskDefinition: string;
37
+ minimum: number;
38
+ maximum: number;
39
+ };
40
+ highPerformanceRunner: {
41
+ taskDefinition: string;
42
+ minimum: number;
43
+ maximum: number;
44
+ };
45
+ lowPerformanceRunner: {
46
+ taskDefinition: string;
47
+ minimum: number;
48
+ maximum: number;
49
+ };
50
+ }
51
+ export type CompanyStyles = Record<Theme, {
52
+ body: {
53
+ backgroundColor: string;
54
+ backgroundColorHighlight: string;
55
+ textColor: string;
56
+ textColorHighlight: string;
57
+ textColorHighlightInset: string;
58
+ accentColor: string;
59
+ accentColorInset: string;
60
+ };
61
+ navbar: {
62
+ textColor: string;
63
+ backgroundColor: string;
64
+ logoTheme: Theme;
65
+ accentColor: string;
66
+ };
67
+ }>;
@@ -0,0 +1,94 @@
1
+ import { ContestBaseDocument, ContestClarification, ContestEventAction, ContestProblemPrerequisite, ContestProblem, ContestSettings, ContestUser, EntityState, ProblemSettings, ProblemStatement, TextLanguage } from '../types';
2
+ import { EntityMembersDTO, EntityMembersWithTimestampsResponseDTO } from './entity';
3
+ import { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO, ProblemSummaryListResponseDTO } from './problem';
4
+ import { EntityOwnerSystemSummaryListResponseDTO, UserCompanyBasicInfoResponseDTO } from './user';
5
+ export type UpsertContestProblemPrerequisiteDTO = (Omit<ContestProblemPrerequisite, 'problemId'> & {
6
+ problemIndex: string;
7
+ })[];
8
+ export interface UpsertContestProblemDTO extends Omit<ContestProblem, 'id' | 'prerequisites'> {
9
+ key: string;
10
+ prerequisites: UpsertContestProblemPrerequisiteDTO;
11
+ }
12
+ export interface UpsertContestDTO extends Omit<ContestBaseDocument, 'key' | 'members' | 'problems' | 'settings' | 'events'> {
13
+ members: EntityMembersDTO;
14
+ problems: {
15
+ [key: string]: UpsertContestProblemDTO;
16
+ };
17
+ settings: Omit<ContestSettings, 'locked'>;
18
+ }
19
+ export interface ContestSummaryListResponseDTO extends Pick<ContestBaseDocument, 'key' | 'name' | 'tags'> {
20
+ user: ContestUser;
21
+ owner: UserCompanyBasicInfoResponseDTO;
22
+ company: EntityCompanySummaryListResponseDTO;
23
+ settings: Pick<ContestSettings, 'startTimestamp' | 'endTimestamp' | 'frozenTimestamp' | 'quietTimestamp' | 'penalty' | 'upsolvingEnabled'>;
24
+ totalContestants: number;
25
+ isLive: boolean;
26
+ isPast: boolean;
27
+ isFuture: boolean;
28
+ isEndless: boolean;
29
+ isGlobal: boolean;
30
+ isFrozenTime: boolean;
31
+ isQuietTime: boolean;
32
+ }
33
+ export interface ContestSystemSummaryListResponseDTO extends ContestSummaryListResponseDTO {
34
+ state: EntityState;
35
+ id: string;
36
+ owner: EntityOwnerSystemSummaryListResponseDTO;
37
+ company: EntityCompanySystemSummaryListResponseDTO;
38
+ creationTimestamp: number;
39
+ updateTimestamp: number;
40
+ }
41
+ export interface ContestProblemBasicDataResponseDTO extends Omit<ContestProblem, 'id' | 'prerequisites'> {
42
+ name: string;
43
+ key: string;
44
+ prerequisites: UpsertContestProblemPrerequisiteDTO;
45
+ judge: ProblemJudgeSummaryListResponseDTO;
46
+ tags: string[];
47
+ company: EntityCompanySummaryListResponseDTO;
48
+ }
49
+ export interface ContestContestProblemDataResponseDTO extends Omit<ProblemSummaryListResponseDTO, 'user'> {
50
+ author: string;
51
+ shortname: string;
52
+ statement: ProblemStatement;
53
+ editorial: TextLanguage;
54
+ settings: ProblemSettings;
55
+ ownerNickname: string;
56
+ }
57
+ export declare enum ContestProblemBlockedByType {
58
+ UNMET_PREREQUISITES = "UNMET_PREREQUISITES",
59
+ MAX_ACCEPTED_SUBMISSIONS_ACHIEVED = "MAX_ACCEPTED_SUBMISSIONS_ACHIEVED",
60
+ START_TIME_IN_THE_FUTURE = "START_TIME_IN_THE_FUTURE",
61
+ END_TIME_IN_THE_PAST = "END_TIME_IN_THE_PAST"
62
+ }
63
+ export type ContestProblemDataResponseDTO = ContestProblemBasicDataResponseDTO & ContestContestProblemDataResponseDTO & {
64
+ blockedBy: {
65
+ type: ContestProblemBlockedByType;
66
+ details: Record<string, any>;
67
+ }[];
68
+ totalSuccess: number;
69
+ totalAttempts: number;
70
+ myAttempts: number;
71
+ myPoints: number;
72
+ mySuccess: boolean;
73
+ myPenalty: number;
74
+ myIndexAccepted: number;
75
+ };
76
+ export interface ContestEventResponseDTO {
77
+ action: ContestEventAction;
78
+ user: UserCompanyBasicInfoResponseDTO;
79
+ timestamp: number;
80
+ details: Record<string, any>;
81
+ }
82
+ export interface ContestDataResponseDTO extends Omit<ContestSummaryListResponseDTO, 'settings'>, Pick<ContestBaseDocument, 'settings' | 'description' | 'groups'> {
83
+ problems: Record<string, ContestProblemDataResponseDTO>;
84
+ state: EntityState;
85
+ }
86
+ export interface ContestMembersResponseDTO {
87
+ members: EntityMembersWithTimestampsResponseDTO;
88
+ }
89
+ export interface ContestClarificationsResponseDTO {
90
+ clarifications: ContestClarification[];
91
+ }
92
+ export interface ContestEventsResponseDTO {
93
+ events: ContestEventResponseDTO[];
94
+ }