@juki-team/commons 0.1.32 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/dist/cjs/index.cjs +3567 -0
  2. package/dist/esm/index.js +3347 -0
  3. package/dist/{constants → types/constants}/commons.d.ts +8 -8
  4. package/dist/{constants → types/constants}/company.d.ts +3 -3
  5. package/dist/{constants → types/constants}/contest.d.ts +3 -3
  6. package/dist/{constants → types/constants}/course.d.ts +2 -2
  7. package/dist/{constants → types/constants}/entity.d.ts +1 -1
  8. package/dist/{constants → types/constants}/file.d.ts +5 -6
  9. package/dist/types/constants/index.d.ts +18 -0
  10. package/dist/{constants → types/constants}/judge.d.ts +9 -11
  11. package/dist/{constants → types/constants}/problem.d.ts +8 -9
  12. package/dist/types/constants/services.d.ts +8 -0
  13. package/dist/{constants → types/constants}/system.d.ts +2 -2
  14. package/dist/{constants → types/constants}/teams.d.ts +3 -4
  15. package/dist/types/constants/user.d.ts +16 -0
  16. package/dist/{constants → types/constants}/websocket.d.ts +1 -1
  17. package/dist/{constants → types/constants}/worksheet.d.ts +2 -2
  18. package/dist/{dto → types/dto}/class.d.ts +4 -4
  19. package/dist/{dto → types/dto}/code.d.ts +1 -1
  20. package/dist/{dto → types/dto}/comments.d.ts +3 -3
  21. package/dist/types/dto/company.d.ts +67 -0
  22. package/dist/{dto → types/dto}/contest.d.ts +8 -9
  23. package/dist/{dto → types/dto}/course.d.ts +5 -5
  24. package/dist/{dto → types/dto}/entity.d.ts +3 -3
  25. package/dist/{dto → types/dto}/excalidraw.d.ts +4 -4
  26. package/dist/{dto → types/dto}/file.d.ts +2 -2
  27. package/dist/types/dto/index.d.ts +25 -0
  28. package/dist/{dto → types/dto}/judge.d.ts +1 -1
  29. package/dist/{dto → types/dto}/markdown.d.ts +4 -4
  30. package/dist/{dto → types/dto}/mermaid.d.ts +4 -4
  31. package/dist/{dto → types/dto}/problem.d.ts +4 -5
  32. package/dist/{dto → types/dto}/scoreboard.d.ts +1 -1
  33. package/dist/{dto → types/dto}/session.d.ts +2 -2
  34. package/dist/{dto → types/dto}/socket.d.ts +7 -8
  35. package/dist/{dto → types/dto}/statistics.d.ts +2 -2
  36. package/dist/{dto → types/dto}/submission.d.ts +4 -5
  37. package/dist/{dto → types/dto}/system.d.ts +18 -18
  38. package/dist/{dto → types/dto}/user.d.ts +14 -14
  39. package/dist/{dto → types/dto}/virtual-user.d.ts +1 -2
  40. package/dist/{dto → types/dto}/worksheet-submissions.d.ts +4 -4
  41. package/dist/{dto → types/dto}/worksheet.d.ts +4 -4
  42. package/dist/{helpers → types/helpers}/class.d.ts +1 -1
  43. package/dist/{helpers → types/helpers}/commons.d.ts +11 -9
  44. package/dist/{helpers → types/helpers}/contest.d.ts +1 -1
  45. package/dist/{helpers → types/helpers}/document.d.ts +2 -2
  46. package/dist/types/helpers/index.d.ts +14 -0
  47. package/dist/types/helpers/interval.d.ts +2 -0
  48. package/dist/{helpers → types/helpers}/judging.d.ts +2 -3
  49. package/dist/types/helpers/object.d.ts +1 -0
  50. package/dist/types/helpers/responses.d.ts +8 -0
  51. package/dist/types/helpers/socket.d.ts +45 -0
  52. package/dist/{helpers → types/helpers}/time.d.ts +1 -1
  53. package/dist/{helpers → types/helpers}/user.d.ts +1 -1
  54. package/dist/types/helpers/worksheet.d.ts +10 -0
  55. package/dist/types/index.d.ts +5 -23
  56. package/dist/{prototypes → types/prototypes}/Error.d.ts +3 -3
  57. package/dist/types/prototypes/Number.d.ts +7 -0
  58. package/dist/types/prototypes/index.d.ts +3 -0
  59. package/dist/types/{class.d.ts → types/class.d.ts} +2 -2
  60. package/dist/types/{commons.d.ts → types/commons.d.ts} +3 -3
  61. package/dist/types/types/company.d.ts +29 -0
  62. package/dist/types/{contest.d.ts → types/contest.d.ts} +26 -9
  63. package/dist/types/{course.d.ts → types/course.d.ts} +1 -1
  64. package/dist/types/{entity.d.ts → types/entity.d.ts} +4 -4
  65. package/dist/types/{excalidraw.d.ts → types/excalidraw.d.ts} +3 -3
  66. package/dist/types/{file.d.ts → types/file.d.ts} +9 -4
  67. package/dist/types/{group.d.ts → types/group.d.ts} +5 -2
  68. package/dist/types/types/index.d.ts +25 -0
  69. package/dist/types/{judge.d.ts → types/judge.d.ts} +32 -3
  70. package/dist/types/{markdown.d.ts → types/markdown.d.ts} +1 -1
  71. package/dist/types/{mermaid.d.ts → types/mermaid.d.ts} +1 -1
  72. package/dist/types/types/prisma.d.ts +284 -0
  73. package/dist/types/{problems.d.ts → types/problems.d.ts} +13 -4
  74. package/dist/types/types/services.d.ts +213 -0
  75. package/dist/types/{sheet.d.ts → types/sheet.d.ts} +2 -3
  76. package/dist/types/{socket.d.ts → types/socket.d.ts} +3 -3
  77. package/dist/types/{teams.d.ts → types/teams.d.ts} +2 -25
  78. package/dist/types/{users.d.ts → types/users.d.ts} +4 -10
  79. package/dist/types/types/virtual-user.d.ts +7 -0
  80. package/dist/types/{worksheet.d.ts → types/worksheet.d.ts} +3 -3
  81. package/package.json +27 -22
  82. package/biome.shared.json +0 -102
  83. package/dist/constants/commons.js +0 -658
  84. package/dist/constants/company.js +0 -24
  85. package/dist/constants/contest.js +0 -29
  86. package/dist/constants/course.js +0 -12
  87. package/dist/constants/date.js +0 -23
  88. package/dist/constants/email.js +0 -34
  89. package/dist/constants/entity.js +0 -18
  90. package/dist/constants/file.js +0 -46
  91. package/dist/constants/index.d.ts +0 -18
  92. package/dist/constants/index.js +0 -18
  93. package/dist/constants/judge.js +0 -221
  94. package/dist/constants/problem.js +0 -72
  95. package/dist/constants/routing.js +0 -7
  96. package/dist/constants/services.d.ts +0 -5
  97. package/dist/constants/services.js +0 -131
  98. package/dist/constants/system.js +0 -9
  99. package/dist/constants/teams.js +0 -18
  100. package/dist/constants/time.js +0 -9
  101. package/dist/constants/user.d.ts +0 -10
  102. package/dist/constants/user.js +0 -35
  103. package/dist/constants/websocket.js +0 -5
  104. package/dist/constants/worksheet.js +0 -66
  105. package/dist/dto/class.js +0 -1
  106. package/dist/dto/code.js +0 -1
  107. package/dist/dto/comments.js +0 -1
  108. package/dist/dto/contest.js +0 -7
  109. package/dist/dto/course.js +0 -1
  110. package/dist/dto/entity.js +0 -5
  111. package/dist/dto/excalidraw.js +0 -1
  112. package/dist/dto/file.js +0 -1
  113. package/dist/dto/image.js +0 -1
  114. package/dist/dto/index.d.ts +0 -24
  115. package/dist/dto/index.js +0 -24
  116. package/dist/dto/judge.js +0 -1
  117. package/dist/dto/markdown.js +0 -1
  118. package/dist/dto/mermaid.js +0 -1
  119. package/dist/dto/organization.d.ts +0 -102
  120. package/dist/dto/organization.js +0 -1
  121. package/dist/dto/problem.js +0 -1
  122. package/dist/dto/scoreboard.js +0 -1
  123. package/dist/dto/session.js +0 -1
  124. package/dist/dto/socket.js +0 -1
  125. package/dist/dto/statistics.js +0 -1
  126. package/dist/dto/submission.js +0 -1
  127. package/dist/dto/system.js +0 -1
  128. package/dist/dto/url.js +0 -1
  129. package/dist/dto/user.js +0 -1
  130. package/dist/dto/virtual-user.js +0 -1
  131. package/dist/dto/worksheet-submissions.js +0 -1
  132. package/dist/dto/worksheet.js +0 -1
  133. package/dist/helpers/class.js +0 -10
  134. package/dist/helpers/comments.js +0 -4
  135. package/dist/helpers/commons.js +0 -191
  136. package/dist/helpers/contest.js +0 -21
  137. package/dist/helpers/document.js +0 -38
  138. package/dist/helpers/file.js +0 -4
  139. package/dist/helpers/index.d.ts +0 -14
  140. package/dist/helpers/index.js +0 -14
  141. package/dist/helpers/interval.d.ts +0 -2
  142. package/dist/helpers/interval.js +0 -22
  143. package/dist/helpers/judging.js +0 -107
  144. package/dist/helpers/object.d.ts +0 -1
  145. package/dist/helpers/object.js +0 -32
  146. package/dist/helpers/responses.d.ts +0 -8
  147. package/dist/helpers/responses.js +0 -78
  148. package/dist/helpers/socket.d.ts +0 -45
  149. package/dist/helpers/socket.js +0 -238
  150. package/dist/helpers/time.js +0 -101
  151. package/dist/helpers/user.js +0 -14
  152. package/dist/helpers/worksheet.d.ts +0 -10
  153. package/dist/helpers/worksheet.js +0 -131
  154. package/dist/index.d.ts +0 -6
  155. package/dist/index.js +0 -6
  156. package/dist/prisma/enums/AssignmentClassType.d.ts +0 -7
  157. package/dist/prisma/enums/AssignmentClassType.js +0 -6
  158. package/dist/prisma/enums/ContestEventAction.d.ts +0 -10
  159. package/dist/prisma/enums/ContestEventAction.js +0 -9
  160. package/dist/prisma/enums/ContestProblemPrerequisiteType.d.ts +0 -5
  161. package/dist/prisma/enums/ContestProblemPrerequisiteType.js +0 -4
  162. package/dist/prisma/enums/ContestRole.d.ts +0 -11
  163. package/dist/prisma/enums/ContestRole.js +0 -10
  164. package/dist/prisma/enums/ContestStatus.d.ts +0 -6
  165. package/dist/prisma/enums/ContestStatus.js +0 -5
  166. package/dist/prisma/enums/CourseRole.d.ts +0 -12
  167. package/dist/prisma/enums/CourseRole.js +0 -11
  168. package/dist/prisma/enums/EntityObjectType.d.ts +0 -13
  169. package/dist/prisma/enums/EntityObjectType.js +0 -12
  170. package/dist/prisma/enums/EntityRole.d.ts +0 -8
  171. package/dist/prisma/enums/EntityRole.js +0 -7
  172. package/dist/prisma/enums/EntitySubjectType.d.ts +0 -7
  173. package/dist/prisma/enums/EntitySubjectType.js +0 -6
  174. package/dist/prisma/enums/FileRole.d.ts +0 -9
  175. package/dist/prisma/enums/FileRole.js +0 -8
  176. package/dist/prisma/enums/FileType.d.ts +0 -5
  177. package/dist/prisma/enums/FileType.js +0 -4
  178. package/dist/prisma/enums/GroupType.d.ts +0 -5
  179. package/dist/prisma/enums/GroupType.js +0 -4
  180. package/dist/prisma/enums/JudgeType.d.ts +0 -12
  181. package/dist/prisma/enums/JudgeType.js +0 -11
  182. package/dist/prisma/enums/OrganizationPlan.d.ts +0 -7
  183. package/dist/prisma/enums/OrganizationPlan.js +0 -6
  184. package/dist/prisma/enums/ProblemRole.d.ts +0 -11
  185. package/dist/prisma/enums/ProblemRole.js +0 -10
  186. package/dist/prisma/enums/ProblemScoringMode.d.ts +0 -6
  187. package/dist/prisma/enums/ProblemScoringMode.js +0 -5
  188. package/dist/prisma/enums/ProblemType.d.ts +0 -6
  189. package/dist/prisma/enums/ProblemType.js +0 -5
  190. package/dist/prisma/enums/ProblemVerdict.d.ts +0 -14
  191. package/dist/prisma/enums/ProblemVerdict.js +0 -13
  192. package/dist/prisma/enums/ShareLinkVisibility.d.ts +0 -5
  193. package/dist/prisma/enums/ShareLinkVisibility.js +0 -4
  194. package/dist/prisma/enums/SubmissionRunStatus.d.ts +0 -18
  195. package/dist/prisma/enums/SubmissionRunStatus.js +0 -17
  196. package/dist/prisma/enums/SystemRole.d.ts +0 -9
  197. package/dist/prisma/enums/SystemRole.js +0 -8
  198. package/dist/prisma/enums/TeamRole.d.ts +0 -9
  199. package/dist/prisma/enums/TeamRole.js +0 -8
  200. package/dist/prisma/enums/TelemetryType.d.ts +0 -9
  201. package/dist/prisma/enums/TelemetryType.js +0 -8
  202. package/dist/prisma/enums/UserRole.d.ts +0 -10
  203. package/dist/prisma/enums/UserRole.js +0 -9
  204. package/dist/prisma/enums/WorkingIn.d.ts +0 -8
  205. package/dist/prisma/enums/WorkingIn.js +0 -7
  206. package/dist/prisma/enums/WorksheetContentType.d.ts +0 -10
  207. package/dist/prisma/enums/WorksheetContentType.js +0 -9
  208. package/dist/prisma/enums/index.d.ts +0 -26
  209. package/dist/prisma/enums/index.js +0 -26
  210. package/dist/prototypes/Date.js +0 -218
  211. package/dist/prototypes/Error.js +0 -17
  212. package/dist/prototypes/Number.d.ts +0 -7
  213. package/dist/prototypes/Number.js +0 -8
  214. package/dist/prototypes/index.d.ts +0 -3
  215. package/dist/prototypes/index.js +0 -3
  216. package/dist/types/account.js +0 -10
  217. package/dist/types/class.js +0 -7
  218. package/dist/types/comments.js +0 -1
  219. package/dist/types/commons.js +0 -69
  220. package/dist/types/company.d.ts +0 -6
  221. package/dist/types/company.js +0 -7
  222. package/dist/types/contest.js +0 -6
  223. package/dist/types/course.js +0 -1
  224. package/dist/types/entity.js +0 -50
  225. package/dist/types/excalidraw.js +0 -1
  226. package/dist/types/file.js +0 -13
  227. package/dist/types/group.js +0 -1
  228. package/dist/types/index.js +0 -23
  229. package/dist/types/judge.js +0 -17
  230. package/dist/types/markdown.js +0 -1
  231. package/dist/types/mermaid.js +0 -1
  232. package/dist/types/notification.js +0 -8
  233. package/dist/types/problems.js +0 -16
  234. package/dist/types/services.d.ts +0 -214
  235. package/dist/types/services.js +0 -147
  236. package/dist/types/sheet.js +0 -16
  237. package/dist/types/socket.js +0 -49
  238. package/dist/types/submission.js +0 -1
  239. package/dist/types/teams.js +0 -28
  240. package/dist/types/users.js +0 -33
  241. package/dist/types/worksheet.js +0 -11
  242. /package/dist/{constants → types/constants}/date.d.ts +0 -0
  243. /package/dist/{constants → types/constants}/email.d.ts +0 -0
  244. /package/dist/{constants → types/constants}/routing.d.ts +0 -0
  245. /package/dist/{constants → types/constants}/time.d.ts +0 -0
  246. /package/dist/{dto → types/dto}/image.d.ts +0 -0
  247. /package/dist/{dto → types/dto}/url.d.ts +0 -0
  248. /package/dist/{helpers → types/helpers}/comments.d.ts +0 -0
  249. /package/dist/{helpers → types/helpers}/file.d.ts +0 -0
  250. /package/dist/{prototypes → types/prototypes}/Date.d.ts +0 -0
  251. /package/dist/types/{account.d.ts → types/account.d.ts} +0 -0
  252. /package/dist/types/{comments.d.ts → types/comments.d.ts} +0 -0
  253. /package/dist/types/{notification.d.ts → types/notification.d.ts} +0 -0
  254. /package/dist/types/{submission.d.ts → types/submission.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import type { EntityMembers, EntityState } from './entity.js';
1
+ import { EntityMembers, EntityState } from './entity';
2
2
  export interface CourseBaseDocument {
3
3
  key: string;
4
4
  title: string;
@@ -1,4 +1,4 @@
1
- import type { UserOrganizationBasicInfoResponseDTO } from '../dto/index.js';
1
+ import { UserCompanyBasicInfoResponseDTO } from '../dto';
2
2
  export declare enum EntityMembersRank {
3
3
  NONE = "NONE",
4
4
  CLOSE = "CLOSE",
@@ -58,8 +58,8 @@ export interface EntityLogChanges {
58
58
  key: string;
59
59
  path: string;
60
60
  valueType: string | null;
61
- value?: unknown;
62
- oldValue?: unknown;
61
+ value?: any;
62
+ oldValue?: any;
63
63
  type: LogOperation;
64
64
  }
65
65
  export interface EntityLog {
@@ -112,5 +112,5 @@ export declare enum LogOperation {
112
112
  export interface LogDataResponseDTO {
113
113
  changes: EntityLogChanges[];
114
114
  timestamp: number;
115
- customerUser: UserOrganizationBasicInfoResponseDTO;
115
+ customerUser: UserCompanyBasicInfoResponseDTO;
116
116
  }
@@ -1,9 +1,9 @@
1
- import type { EntityMembers } from './entity.js';
1
+ import { EntityMembers } from './entity';
2
2
  export interface ExcalidrawBaseDocument {
3
3
  key: string;
4
4
  name: string;
5
- elements: unknown;
6
- appState: unknown;
5
+ elements: any;
6
+ appState: any;
7
7
  members: EntityMembers;
8
8
  tags: string[];
9
9
  }
@@ -1,13 +1,18 @@
1
- import type { FileType } from '../prisma/enums/index.js';
1
+ import { Role } from './users';
2
+ export type FileRole = Role.RESTRICTED | Role.GUEST | Role.REGULAR | Role.MASTER | Role.ADMIN | Role.SUPER_ADMIN;
2
3
  export declare enum FileMemberRole {
3
4
  VIEWER = "VIEWER",
4
5
  EDITOR = "EDITOR"
5
6
  }
7
+ export declare enum FileType {
8
+ FOLDER = "FOLDER",
9
+ FILE = "FILE"
10
+ }
6
11
  export type FolderFileContent = {
7
- type: typeof FileType.FOLDER;
12
+ type: FileType.FOLDER;
8
13
  };
9
14
  export type FileFileContent = {
10
- type: typeof FileType.FILE;
15
+ type: FileType.FILE;
11
16
  mime: string;
12
17
  key: string;
13
18
  };
@@ -15,7 +20,7 @@ export type FileContent = FolderFileContent | FileFileContent;
15
20
  export type SummaryFileContent = FolderFileContent | Omit<FileFileContent, 'key'>;
16
21
  export declare enum FilesJukiPub {
17
22
  SHARED = "shared",// files to share
18
- SHARED_EXCALIDRAW = "shared/E",// `shared/${CollectionKey.EXCALIDRAW}`,
23
+ SHARED_EXCALIDRAW = "shared/E",
19
24
  TEMP = "temp",// temporal files
20
25
  PROBLEMS = "problems",
21
26
  CONTESTS = "contests"
@@ -1,5 +1,8 @@
1
- import type { GroupType } from '../prisma/enums/index.js';
2
- import type { EntityMembers, EntityState } from './entity.js';
1
+ import { EntityMembers, EntityState } from './entity';
2
+ export declare enum GroupType {
3
+ CLASS = "CLASS",
4
+ TEAM = "TEAM"
5
+ }
3
6
  export interface GroupBaseDocument {
4
7
  name: string;
5
8
  description: string;
@@ -0,0 +1,25 @@
1
+ export * from './account';
2
+ export * from './class';
3
+ export * from './comments';
4
+ export * from './commons';
5
+ export * from './company';
6
+ export * from './contest';
7
+ export * from './course';
8
+ export * from './entity';
9
+ export * from './excalidraw';
10
+ export * from './file';
11
+ export * from './group';
12
+ export * from './judge';
13
+ export * from './markdown';
14
+ export * from './mermaid';
15
+ export * from './notification';
16
+ export * from './prisma';
17
+ export * from './problems';
18
+ export * from './services';
19
+ export * from './sheet';
20
+ export * from './socket';
21
+ export * from './submission';
22
+ export * from './teams';
23
+ export * from './users';
24
+ export * from './virtual-user';
25
+ export * from './worksheet';
@@ -1,6 +1,5 @@
1
- import type { ProblemVerdict } from '../prisma/enums/index.js';
2
- import type { CodeLanguage } from './commons.js';
3
- import type { DataLog } from './submission.js';
1
+ import { CodeLanguage } from './commons';
2
+ import { DataLog } from './submission';
4
3
  export type JudgeLanguage = {
5
4
  value: string;
6
5
  label: string;
@@ -37,6 +36,36 @@ export declare enum Judge {
37
36
  TOPCODER = "TOPCODER",
38
37
  LEETCODE = "LEETCODE"
39
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
+ }
40
69
  export declare enum RunnerType {
41
70
  HIGH_PERFORMANCE = "HIGH_PERFORMANCE",
42
71
  LOW_PERFORMANCE = "LOW_PERFORMANCE"
@@ -1,4 +1,4 @@
1
- import type { CodeEditorFiles, CodeLanguage, EntityMembers } from '../types/index.js';
1
+ import { CodeEditorFiles, CodeLanguage, EntityMembers } from '../types';
2
2
  export interface MarkdownBaseDocument {
3
3
  key: string;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { CodeEditorFiles, CodeLanguage, EntityMembers } from '../types/index.js';
1
+ import { CodeEditorFiles, CodeLanguage, EntityMembers } from '../types';
2
2
  export interface MermaidBaseDocument {
3
3
  key: string;
4
4
  name: string;
@@ -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];
@@ -1,7 +1,6 @@
1
- import type { ProblemScoringMode, ProblemType } from '../prisma/enums/index.js';
2
- import type { CodeLanguage, TextLanguage } from './commons.js';
3
- import type { EntityMembers } from './entity.js';
4
- import type { ProblemTestCase } from './services.js';
1
+ import { CodeLanguage, TextLanguage } from './commons';
2
+ import { EntityMembers } from './entity';
3
+ import { ProblemTestCase } from './services';
5
4
  export interface TestCase {
6
5
  id: string;
7
6
  group: number;
@@ -21,6 +20,16 @@ export declare enum ProblemOutput {
21
20
  DYNAMIC = "DYNAMIC",
22
21
  INTERACTIVE = "INTERACTIVE"
23
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
+ }
24
33
  export type ProblemSettingsPointsByGroups = {
25
34
  [key: number]: {
26
35
  points: number;
@@ -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
+ };