@juki-team/commons 0.1.31

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 (235) hide show
  1. package/README.md +3 -0
  2. package/biome.shared.json +102 -0
  3. package/dist/constants/commons.d.ts +62 -0
  4. package/dist/constants/commons.js +658 -0
  5. package/dist/constants/company.d.ts +9 -0
  6. package/dist/constants/company.js +24 -0
  7. package/dist/constants/contest.d.ts +15 -0
  8. package/dist/constants/contest.js +29 -0
  9. package/dist/constants/course.d.ts +8 -0
  10. package/dist/constants/course.js +12 -0
  11. package/dist/constants/date.d.ts +9 -0
  12. package/dist/constants/date.js +23 -0
  13. package/dist/constants/email.d.ts +2 -0
  14. package/dist/constants/email.js +34 -0
  15. package/dist/constants/entity.d.ts +3 -0
  16. package/dist/constants/entity.js +18 -0
  17. package/dist/constants/file.d.ts +28 -0
  18. package/dist/constants/file.js +46 -0
  19. package/dist/constants/index.d.ts +18 -0
  20. package/dist/constants/index.js +18 -0
  21. package/dist/constants/judge.d.ts +37 -0
  22. package/dist/constants/judge.js +221 -0
  23. package/dist/constants/problem.d.ts +37 -0
  24. package/dist/constants/problem.js +72 -0
  25. package/dist/constants/routing.d.ts +7 -0
  26. package/dist/constants/routing.js +7 -0
  27. package/dist/constants/services.d.ts +5 -0
  28. package/dist/constants/services.js +131 -0
  29. package/dist/constants/system.d.ts +8 -0
  30. package/dist/constants/system.js +9 -0
  31. package/dist/constants/teams.d.ts +15 -0
  32. package/dist/constants/teams.js +18 -0
  33. package/dist/constants/time.d.ts +9 -0
  34. package/dist/constants/time.js +9 -0
  35. package/dist/constants/user.d.ts +10 -0
  36. package/dist/constants/user.js +35 -0
  37. package/dist/constants/websocket.d.ts +6 -0
  38. package/dist/constants/websocket.js +5 -0
  39. package/dist/constants/worksheet.d.ts +11 -0
  40. package/dist/constants/worksheet.js +66 -0
  41. package/dist/dto/class.d.ts +115 -0
  42. package/dist/dto/class.js +1 -0
  43. package/dist/dto/code.d.ts +13 -0
  44. package/dist/dto/code.js +1 -0
  45. package/dist/dto/comments.d.ts +21 -0
  46. package/dist/dto/comments.js +1 -0
  47. package/dist/dto/contest.d.ts +95 -0
  48. package/dist/dto/contest.js +7 -0
  49. package/dist/dto/course.d.ts +34 -0
  50. package/dist/dto/course.js +1 -0
  51. package/dist/dto/entity.d.ts +92 -0
  52. package/dist/dto/entity.js +5 -0
  53. package/dist/dto/excalidraw.d.ts +12 -0
  54. package/dist/dto/excalidraw.js +1 -0
  55. package/dist/dto/file.d.ts +34 -0
  56. package/dist/dto/file.js +1 -0
  57. package/dist/dto/image.d.ts +6 -0
  58. package/dist/dto/image.js +1 -0
  59. package/dist/dto/index.d.ts +24 -0
  60. package/dist/dto/index.js +24 -0
  61. package/dist/dto/judge.d.ts +16 -0
  62. package/dist/dto/judge.js +1 -0
  63. package/dist/dto/markdown.d.ts +12 -0
  64. package/dist/dto/markdown.js +1 -0
  65. package/dist/dto/mermaid.d.ts +12 -0
  66. package/dist/dto/mermaid.js +1 -0
  67. package/dist/dto/organization.d.ts +102 -0
  68. package/dist/dto/organization.js +1 -0
  69. package/dist/dto/problem.d.ts +67 -0
  70. package/dist/dto/problem.js +1 -0
  71. package/dist/dto/scoreboard.d.ts +35 -0
  72. package/dist/dto/scoreboard.js +1 -0
  73. package/dist/dto/session.d.ts +15 -0
  74. package/dist/dto/session.js +1 -0
  75. package/dist/dto/socket.d.ts +257 -0
  76. package/dist/dto/socket.js +1 -0
  77. package/dist/dto/statistics.d.ts +43 -0
  78. package/dist/dto/statistics.js +1 -0
  79. package/dist/dto/submission.d.ts +95 -0
  80. package/dist/dto/submission.js +1 -0
  81. package/dist/dto/system.d.ts +91 -0
  82. package/dist/dto/system.js +1 -0
  83. package/dist/dto/url.d.ts +8 -0
  84. package/dist/dto/url.js +1 -0
  85. package/dist/dto/user.d.ts +109 -0
  86. package/dist/dto/user.js +1 -0
  87. package/dist/dto/virtual-user.d.ts +39 -0
  88. package/dist/dto/virtual-user.js +1 -0
  89. package/dist/dto/worksheet-submissions.d.ts +64 -0
  90. package/dist/dto/worksheet-submissions.js +1 -0
  91. package/dist/dto/worksheet.d.ts +39 -0
  92. package/dist/dto/worksheet.js +1 -0
  93. package/dist/helpers/class.d.ts +4 -0
  94. package/dist/helpers/class.js +10 -0
  95. package/dist/helpers/comments.d.ts +4 -0
  96. package/dist/helpers/comments.js +4 -0
  97. package/dist/helpers/commons.d.ts +33 -0
  98. package/dist/helpers/commons.js +191 -0
  99. package/dist/helpers/contest.d.ts +5 -0
  100. package/dist/helpers/contest.js +21 -0
  101. package/dist/helpers/document.d.ts +14 -0
  102. package/dist/helpers/document.js +38 -0
  103. package/dist/helpers/file.d.ts +1 -0
  104. package/dist/helpers/file.js +4 -0
  105. package/dist/helpers/index.d.ts +14 -0
  106. package/dist/helpers/index.js +14 -0
  107. package/dist/helpers/interval.d.ts +2 -0
  108. package/dist/helpers/interval.js +22 -0
  109. package/dist/helpers/judging.d.ts +25 -0
  110. package/dist/helpers/judging.js +107 -0
  111. package/dist/helpers/object.d.ts +1 -0
  112. package/dist/helpers/object.js +32 -0
  113. package/dist/helpers/responses.d.ts +8 -0
  114. package/dist/helpers/responses.js +78 -0
  115. package/dist/helpers/socket.d.ts +45 -0
  116. package/dist/helpers/socket.js +238 -0
  117. package/dist/helpers/time.d.ts +13 -0
  118. package/dist/helpers/time.js +101 -0
  119. package/dist/helpers/user.d.ts +11 -0
  120. package/dist/helpers/user.js +14 -0
  121. package/dist/helpers/worksheet.d.ts +10 -0
  122. package/dist/helpers/worksheet.js +131 -0
  123. package/dist/index.d.ts +6 -0
  124. package/dist/index.js +6 -0
  125. package/dist/prisma/enums/AssignmentClassType.d.ts +7 -0
  126. package/dist/prisma/enums/AssignmentClassType.js +6 -0
  127. package/dist/prisma/enums/ContestEventAction.d.ts +10 -0
  128. package/dist/prisma/enums/ContestEventAction.js +9 -0
  129. package/dist/prisma/enums/ContestProblemPrerequisiteType.d.ts +5 -0
  130. package/dist/prisma/enums/ContestProblemPrerequisiteType.js +4 -0
  131. package/dist/prisma/enums/ContestRole.d.ts +11 -0
  132. package/dist/prisma/enums/ContestRole.js +10 -0
  133. package/dist/prisma/enums/ContestStatus.d.ts +6 -0
  134. package/dist/prisma/enums/ContestStatus.js +5 -0
  135. package/dist/prisma/enums/CourseRole.d.ts +12 -0
  136. package/dist/prisma/enums/CourseRole.js +11 -0
  137. package/dist/prisma/enums/EntityObjectType.d.ts +13 -0
  138. package/dist/prisma/enums/EntityObjectType.js +12 -0
  139. package/dist/prisma/enums/EntityRole.d.ts +8 -0
  140. package/dist/prisma/enums/EntityRole.js +7 -0
  141. package/dist/prisma/enums/EntitySubjectType.d.ts +7 -0
  142. package/dist/prisma/enums/EntitySubjectType.js +6 -0
  143. package/dist/prisma/enums/FileRole.d.ts +9 -0
  144. package/dist/prisma/enums/FileRole.js +8 -0
  145. package/dist/prisma/enums/FileType.d.ts +5 -0
  146. package/dist/prisma/enums/FileType.js +4 -0
  147. package/dist/prisma/enums/GroupType.d.ts +5 -0
  148. package/dist/prisma/enums/GroupType.js +4 -0
  149. package/dist/prisma/enums/JudgeType.d.ts +12 -0
  150. package/dist/prisma/enums/JudgeType.js +11 -0
  151. package/dist/prisma/enums/OrganizationPlan.d.ts +7 -0
  152. package/dist/prisma/enums/OrganizationPlan.js +6 -0
  153. package/dist/prisma/enums/ProblemRole.d.ts +11 -0
  154. package/dist/prisma/enums/ProblemRole.js +10 -0
  155. package/dist/prisma/enums/ProblemScoringMode.d.ts +6 -0
  156. package/dist/prisma/enums/ProblemScoringMode.js +5 -0
  157. package/dist/prisma/enums/ProblemType.d.ts +6 -0
  158. package/dist/prisma/enums/ProblemType.js +5 -0
  159. package/dist/prisma/enums/ProblemVerdict.d.ts +14 -0
  160. package/dist/prisma/enums/ProblemVerdict.js +13 -0
  161. package/dist/prisma/enums/ShareLinkVisibility.d.ts +5 -0
  162. package/dist/prisma/enums/ShareLinkVisibility.js +4 -0
  163. package/dist/prisma/enums/SubmissionRunStatus.d.ts +18 -0
  164. package/dist/prisma/enums/SubmissionRunStatus.js +17 -0
  165. package/dist/prisma/enums/SystemRole.d.ts +9 -0
  166. package/dist/prisma/enums/SystemRole.js +8 -0
  167. package/dist/prisma/enums/TeamRole.d.ts +9 -0
  168. package/dist/prisma/enums/TeamRole.js +8 -0
  169. package/dist/prisma/enums/TelemetryType.d.ts +9 -0
  170. package/dist/prisma/enums/TelemetryType.js +8 -0
  171. package/dist/prisma/enums/UserRole.d.ts +10 -0
  172. package/dist/prisma/enums/UserRole.js +9 -0
  173. package/dist/prisma/enums/WorkingIn.d.ts +8 -0
  174. package/dist/prisma/enums/WorkingIn.js +7 -0
  175. package/dist/prisma/enums/WorksheetContentType.d.ts +10 -0
  176. package/dist/prisma/enums/WorksheetContentType.js +9 -0
  177. package/dist/prisma/enums/index.d.ts +26 -0
  178. package/dist/prisma/enums/index.js +26 -0
  179. package/dist/prototypes/Date.d.ts +62 -0
  180. package/dist/prototypes/Date.js +218 -0
  181. package/dist/prototypes/Error.d.ts +10 -0
  182. package/dist/prototypes/Error.js +17 -0
  183. package/dist/prototypes/Number.d.ts +7 -0
  184. package/dist/prototypes/Number.js +8 -0
  185. package/dist/prototypes/index.d.ts +3 -0
  186. package/dist/prototypes/index.js +3 -0
  187. package/dist/types/account.d.ts +9 -0
  188. package/dist/types/account.js +10 -0
  189. package/dist/types/class.d.ts +67 -0
  190. package/dist/types/class.js +7 -0
  191. package/dist/types/comments.d.ts +17 -0
  192. package/dist/types/comments.js +1 -0
  193. package/dist/types/commons.d.ts +84 -0
  194. package/dist/types/commons.js +69 -0
  195. package/dist/types/company.d.ts +6 -0
  196. package/dist/types/company.js +7 -0
  197. package/dist/types/contest.d.ts +144 -0
  198. package/dist/types/contest.js +6 -0
  199. package/dist/types/course.d.ts +13 -0
  200. package/dist/types/course.js +1 -0
  201. package/dist/types/entity.d.ts +116 -0
  202. package/dist/types/entity.js +50 -0
  203. package/dist/types/excalidraw.d.ts +9 -0
  204. package/dist/types/excalidraw.js +1 -0
  205. package/dist/types/file.d.ts +22 -0
  206. package/dist/types/file.js +13 -0
  207. package/dist/types/group.d.ts +9 -0
  208. package/dist/types/group.js +1 -0
  209. package/dist/types/index.d.ts +23 -0
  210. package/dist/types/index.js +23 -0
  211. package/dist/types/judge.d.ts +46 -0
  212. package/dist/types/judge.js +17 -0
  213. package/dist/types/markdown.d.ts +8 -0
  214. package/dist/types/markdown.js +1 -0
  215. package/dist/types/mermaid.d.ts +8 -0
  216. package/dist/types/mermaid.js +1 -0
  217. package/dist/types/notification.d.ts +7 -0
  218. package/dist/types/notification.js +8 -0
  219. package/dist/types/problems.d.ts +93 -0
  220. package/dist/types/problems.js +16 -0
  221. package/dist/types/services.d.ts +214 -0
  222. package/dist/types/services.js +147 -0
  223. package/dist/types/sheet.d.ts +104 -0
  224. package/dist/types/sheet.js +16 -0
  225. package/dist/types/socket.d.ts +49 -0
  226. package/dist/types/socket.js +49 -0
  227. package/dist/types/submission.d.ts +5 -0
  228. package/dist/types/submission.js +1 -0
  229. package/dist/types/teams.d.ts +96 -0
  230. package/dist/types/teams.js +28 -0
  231. package/dist/types/users.d.ts +65 -0
  232. package/dist/types/users.js +33 -0
  233. package/dist/types/worksheet.d.ts +42 -0
  234. package/dist/types/worksheet.js +11 -0
  235. package/package.json +42 -0
@@ -0,0 +1,131 @@
1
+ import { NEW_PAGE_SHEET } from '../constants/worksheet.js';
2
+ import { Judge, WorksheetType, } from '../types/index.js';
3
+ export const getWorksheetsInPages = (initialSheets) => {
4
+ const sheets = [...initialSheets];
5
+ if (sheets[0]?.type !== WorksheetType.NEW_PAGE) {
6
+ sheets.unshift(NEW_PAGE_SHEET());
7
+ }
8
+ let newPage = sheets[0];
9
+ let content = [];
10
+ const sheetsByPages = [];
11
+ for (let i = 1; i < sheets.length; i++) {
12
+ const sheet = sheets[i];
13
+ if (sheet.type === WorksheetType.NEW_PAGE) {
14
+ sheetsByPages.push({
15
+ header: newPage,
16
+ content: [...content],
17
+ });
18
+ newPage = sheet;
19
+ content = [];
20
+ }
21
+ else {
22
+ content.push(sheet);
23
+ }
24
+ }
25
+ sheetsByPages.push({
26
+ header: newPage,
27
+ content: [...content],
28
+ });
29
+ return sheetsByPages;
30
+ };
31
+ export const getSummaryWorksheetsInPages = (initialSheets) => {
32
+ const sheets = [...initialSheets];
33
+ if (sheets[0]?.type !== WorksheetType.NEW_PAGE) {
34
+ sheets.unshift(NEW_PAGE_SHEET());
35
+ }
36
+ let newPage = sheets[0];
37
+ let content = [];
38
+ const sheetsByPages = [];
39
+ for (let i = 1; i < sheets.length; i++) {
40
+ const sheet = sheets[i];
41
+ if (sheet.type === WorksheetType.NEW_PAGE) {
42
+ sheetsByPages.push({
43
+ header: newPage,
44
+ content: content.map((c) => ({
45
+ id: c.id,
46
+ type: c.type,
47
+ title: c.title,
48
+ points: c.points,
49
+ })),
50
+ });
51
+ newPage = sheet;
52
+ content = [];
53
+ }
54
+ else {
55
+ content.push(sheet);
56
+ }
57
+ }
58
+ sheetsByPages.push({
59
+ header: newPage,
60
+ content: [...content],
61
+ });
62
+ return sheetsByPages;
63
+ };
64
+ export const getTotalExercisesOfSummaryWorksheetsInPages = (content) => content.reduce((sum, { content }) => sum +
65
+ content.reduce((sum, { type }) => sum +
66
+ +(type === WorksheetType.QUIZ_OPTIONS || type === WorksheetType.QUIZ_PROBLEM || type === WorksheetType.QUIZ_TEXT), 0), 0);
67
+ export const isBasicWorksheet = (value) => {
68
+ if (typeof value !== 'object' || value === null)
69
+ return false;
70
+ const v = value;
71
+ return (typeof v.id === 'string' &&
72
+ !!v.id &&
73
+ Object.values(WorksheetType).includes(v.type) &&
74
+ typeof v.title === 'string' &&
75
+ typeof v.points === 'number');
76
+ };
77
+ export const isJkmdSheet = (value) => {
78
+ if (!isBasicWorksheet(value))
79
+ return false;
80
+ const v = value;
81
+ return value.type === WorksheetType.JK_MD && typeof v.content === 'string';
82
+ };
83
+ export const isCodeEditorSheet = (value) => {
84
+ if (!isBasicWorksheet(value))
85
+ return false;
86
+ const v = value;
87
+ return (value.type === WorksheetType.CODE_EDITOR &&
88
+ typeof v.sourceCode === 'object' &&
89
+ v.sourceCode !== null &&
90
+ typeof v.testCases === 'object' &&
91
+ v.testCases !== null &&
92
+ Array.isArray(v.languages) &&
93
+ typeof v.height === 'number');
94
+ };
95
+ export const isQuizProblemSheet = (value) => {
96
+ if (typeof value !== 'object' || value === null)
97
+ return false;
98
+ const v = value;
99
+ return ((isBasicWorksheet(value) &&
100
+ value.type === WorksheetType.QUIZ_PROBLEM &&
101
+ Object.values(Judge).includes(v.problemJudge)) ||
102
+ (typeof v.problemJudge === 'string' &&
103
+ typeof v.problemKey === 'string' &&
104
+ Array.isArray(v.languages) &&
105
+ typeof v.height === 'number'));
106
+ };
107
+ export const isQuizOptionsSheet = (value) => {
108
+ if (!isBasicWorksheet(value))
109
+ return false;
110
+ const v = value;
111
+ return (value.type === WorksheetType.QUIZ_OPTIONS &&
112
+ typeof v.description === 'string' &&
113
+ Array.isArray(v.options) &&
114
+ v.options.every((option) => {
115
+ if (typeof option !== 'object' || option === null)
116
+ return false;
117
+ const o = option;
118
+ return typeof o.label === 'string' && typeof o.correct === 'boolean' && typeof o.id === 'string';
119
+ }) &&
120
+ typeof v.multiple === 'boolean' &&
121
+ (v.scoringMode === 'TOTAL' || v.scoringMode === 'PARTIAL'));
122
+ };
123
+ export const isQuizTextSheet = (value) => {
124
+ if (!isBasicWorksheet(value))
125
+ return false;
126
+ const v = value;
127
+ return (value.type === WorksheetType.QUIZ_TEXT &&
128
+ typeof v.description === 'string' &&
129
+ typeof v.answer === 'string' &&
130
+ (v.inputType === 'text' || v.inputType === 'number' || v.inputType === 'textarea'));
131
+ };
@@ -0,0 +1,6 @@
1
+ export * from './constants/index.js';
2
+ export * from './dto/index.js';
3
+ export * from './helpers/index.js';
4
+ export * from './prisma/enums/index.js';
5
+ export * from './prototypes/index.js';
6
+ export * from './types/index.js';
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from './constants/index.js';
2
+ export * from './dto/index.js';
3
+ export * from './helpers/index.js';
4
+ export * from './prisma/enums/index.js';
5
+ export * from './prototypes/index.js';
6
+ export * from './types/index.js';
@@ -0,0 +1,7 @@
1
+ export declare const AssignmentClassType: {
2
+ readonly NONE: "NONE";
3
+ readonly COURSE: "COURSE";
4
+ readonly WORKSHEET: "WORKSHEET";
5
+ readonly CONTEST: "CONTEST";
6
+ };
7
+ export type AssignmentClassType = (typeof AssignmentClassType)[keyof typeof AssignmentClassType];
@@ -0,0 +1,6 @@
1
+ export const AssignmentClassType = {
2
+ NONE: 'NONE',
3
+ COURSE: 'COURSE',
4
+ WORKSHEET: 'WORKSHEET',
5
+ CONTEST: 'CONTEST',
6
+ };
@@ -0,0 +1,10 @@
1
+ export declare const ContestEventAction: {
2
+ readonly DATA_UPDATE: "DATA_UPDATE";
3
+ readonly SCOREBOARD_RECALCULATE: "SCOREBOARD_RECALCULATE";
4
+ readonly SCOREBOARD_UNLOCK: "SCOREBOARD_UNLOCK";
5
+ readonly SCOREBOARD_LOCK: "SCOREBOARD_LOCK";
6
+ readonly ENABLE_UPSOLVING: "ENABLE_UPSOLVING";
7
+ readonly DISABLE_UPSOLVING: "DISABLE_UPSOLVING";
8
+ readonly PARTICIPANT_JOIN: "PARTICIPANT_JOIN";
9
+ };
10
+ export type ContestEventAction = (typeof ContestEventAction)[keyof typeof ContestEventAction];
@@ -0,0 +1,9 @@
1
+ export const ContestEventAction = {
2
+ DATA_UPDATE: 'DATA_UPDATE',
3
+ SCOREBOARD_RECALCULATE: 'SCOREBOARD_RECALCULATE',
4
+ SCOREBOARD_UNLOCK: 'SCOREBOARD_UNLOCK',
5
+ SCOREBOARD_LOCK: 'SCOREBOARD_LOCK',
6
+ ENABLE_UPSOLVING: 'ENABLE_UPSOLVING',
7
+ DISABLE_UPSOLVING: 'DISABLE_UPSOLVING',
8
+ PARTICIPANT_JOIN: 'PARTICIPANT_JOIN',
9
+ };
@@ -0,0 +1,5 @@
1
+ export declare const ContestProblemPrerequisiteType: {
2
+ readonly INDIVIDUALLY: "INDIVIDUALLY";
3
+ readonly CONTEST: "CONTEST";
4
+ };
5
+ export type ContestProblemPrerequisiteType = (typeof ContestProblemPrerequisiteType)[keyof typeof ContestProblemPrerequisiteType];
@@ -0,0 +1,4 @@
1
+ export const ContestProblemPrerequisiteType = {
2
+ INDIVIDUALLY: 'INDIVIDUALLY',
3
+ CONTEST: 'CONTEST',
4
+ };
@@ -0,0 +1,11 @@
1
+ export declare const ContestRole: {
2
+ readonly RESTRICTED: "RESTRICTED";
3
+ readonly GUEST: "GUEST";
4
+ readonly REGULAR: "REGULAR";
5
+ readonly CREATOR: "CREATOR";
6
+ readonly MANAGER: "MANAGER";
7
+ readonly MASTER: "MASTER";
8
+ readonly ADMIN: "ADMIN";
9
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
10
+ };
11
+ export type ContestRole = (typeof ContestRole)[keyof typeof ContestRole];
@@ -0,0 +1,10 @@
1
+ export const ContestRole = {
2
+ RESTRICTED: 'RESTRICTED',
3
+ GUEST: 'GUEST',
4
+ REGULAR: 'REGULAR',
5
+ CREATOR: 'CREATOR',
6
+ MANAGER: 'MANAGER',
7
+ MASTER: 'MASTER',
8
+ ADMIN: 'ADMIN',
9
+ SUPER_ADMIN: 'SUPER_ADMIN',
10
+ };
@@ -0,0 +1,6 @@
1
+ export declare const ContestStatus: {
2
+ readonly PUBLIC: "PUBLIC";
3
+ readonly RESERVED: "RESERVED";
4
+ readonly ARCHIVED: "ARCHIVED";
5
+ };
6
+ export type ContestStatus = (typeof ContestStatus)[keyof typeof ContestStatus];
@@ -0,0 +1,5 @@
1
+ export const ContestStatus = {
2
+ PUBLIC: 'PUBLIC',
3
+ RESERVED: 'RESERVED',
4
+ ARCHIVED: 'ARCHIVED',
5
+ };
@@ -0,0 +1,12 @@
1
+ export declare const CourseRole: {
2
+ readonly RESTRICTED: "RESTRICTED";
3
+ readonly GUEST: "GUEST";
4
+ readonly REGULAR: "REGULAR";
5
+ readonly CREATOR: "CREATOR";
6
+ readonly SUPER_CREATOR: "SUPER_CREATOR";
7
+ readonly MANAGER: "MANAGER";
8
+ readonly MASTER: "MASTER";
9
+ readonly ADMIN: "ADMIN";
10
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
11
+ };
12
+ export type CourseRole = (typeof CourseRole)[keyof typeof CourseRole];
@@ -0,0 +1,11 @@
1
+ export const CourseRole = {
2
+ RESTRICTED: 'RESTRICTED',
3
+ GUEST: 'GUEST',
4
+ REGULAR: 'REGULAR',
5
+ CREATOR: 'CREATOR',
6
+ SUPER_CREATOR: 'SUPER_CREATOR',
7
+ MANAGER: 'MANAGER',
8
+ MASTER: 'MASTER',
9
+ ADMIN: 'ADMIN',
10
+ SUPER_ADMIN: 'SUPER_ADMIN',
11
+ };
@@ -0,0 +1,13 @@
1
+ export declare const EntityObjectType: {
2
+ readonly PROBLEM: "PROBLEM";
3
+ readonly CONTEST: "CONTEST";
4
+ readonly COURSE: "COURSE";
5
+ readonly CLASS: "CLASS";
6
+ readonly GROUP: "GROUP";
7
+ readonly WORKSHEET: "WORKSHEET";
8
+ readonly FILE: "FILE";
9
+ readonly EXCALIDRAW: "EXCALIDRAW";
10
+ readonly MARKDOWN: "MARKDOWN";
11
+ readonly MERMAID: "MERMAID";
12
+ };
13
+ export type EntityObjectType = (typeof EntityObjectType)[keyof typeof EntityObjectType];
@@ -0,0 +1,12 @@
1
+ export const EntityObjectType = {
2
+ PROBLEM: 'PROBLEM',
3
+ CONTEST: 'CONTEST',
4
+ COURSE: 'COURSE',
5
+ CLASS: 'CLASS',
6
+ GROUP: 'GROUP',
7
+ WORKSHEET: 'WORKSHEET',
8
+ FILE: 'FILE',
9
+ EXCALIDRAW: 'EXCALIDRAW',
10
+ MARKDOWN: 'MARKDOWN',
11
+ MERMAID: 'MERMAID',
12
+ };
@@ -0,0 +1,8 @@
1
+ export declare const EntityRole: {
2
+ readonly ADMINISTRATOR: "ADMINISTRATOR";
3
+ readonly MANAGER: "MANAGER";
4
+ readonly PARTICIPANT: "PARTICIPANT";
5
+ readonly SPECTATOR: "SPECTATOR";
6
+ readonly GUEST: "GUEST";
7
+ };
8
+ export type EntityRole = (typeof EntityRole)[keyof typeof EntityRole];
@@ -0,0 +1,7 @@
1
+ export const EntityRole = {
2
+ ADMINISTRATOR: 'ADMINISTRATOR',
3
+ MANAGER: 'MANAGER',
4
+ PARTICIPANT: 'PARTICIPANT',
5
+ SPECTATOR: 'SPECTATOR',
6
+ GUEST: 'GUEST',
7
+ };
@@ -0,0 +1,7 @@
1
+ export declare const EntitySubjectType: {
2
+ readonly USER: "USER";
3
+ readonly GROUP: "GROUP";
4
+ readonly PUBLIC: "PUBLIC";
5
+ readonly SHARE_LINK: "SHARE_LINK";
6
+ };
7
+ export type EntitySubjectType = (typeof EntitySubjectType)[keyof typeof EntitySubjectType];
@@ -0,0 +1,6 @@
1
+ export const EntitySubjectType = {
2
+ USER: 'USER',
3
+ GROUP: 'GROUP',
4
+ PUBLIC: 'PUBLIC', // wildcard — anyone. subjectId must be 0
5
+ SHARE_LINK: 'SHARE_LINK',
6
+ };
@@ -0,0 +1,9 @@
1
+ export declare const FileRole: {
2
+ readonly RESTRICTED: "RESTRICTED";
3
+ readonly GUEST: "GUEST";
4
+ readonly REGULAR: "REGULAR";
5
+ readonly MASTER: "MASTER";
6
+ readonly ADMIN: "ADMIN";
7
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
8
+ };
9
+ export type FileRole = (typeof FileRole)[keyof typeof FileRole];
@@ -0,0 +1,8 @@
1
+ export const FileRole = {
2
+ RESTRICTED: 'RESTRICTED',
3
+ GUEST: 'GUEST',
4
+ REGULAR: 'REGULAR',
5
+ MASTER: 'MASTER',
6
+ ADMIN: 'ADMIN',
7
+ SUPER_ADMIN: 'SUPER_ADMIN',
8
+ };
@@ -0,0 +1,5 @@
1
+ export declare const FileType: {
2
+ readonly FOLDER: "FOLDER";
3
+ readonly FILE: "FILE";
4
+ };
5
+ export type FileType = (typeof FileType)[keyof typeof FileType];
@@ -0,0 +1,4 @@
1
+ export const FileType = {
2
+ FOLDER: 'FOLDER',
3
+ FILE: 'FILE',
4
+ };
@@ -0,0 +1,5 @@
1
+ export declare const GroupType: {
2
+ readonly CLASS: "CLASS";
3
+ readonly TEAM: "TEAM";
4
+ };
5
+ export type GroupType = (typeof GroupType)[keyof typeof GroupType];
@@ -0,0 +1,4 @@
1
+ export const GroupType = {
2
+ CLASS: 'CLASS',
3
+ TEAM: 'TEAM',
4
+ };
@@ -0,0 +1,12 @@
1
+ export declare const JudgeType: {
2
+ readonly JUKI_JUDGE: "JUKI_JUDGE";
3
+ readonly CODEFORCES: "CODEFORCES";
4
+ readonly CODEFORCES_GYM: "CODEFORCES_GYM";
5
+ readonly JV_UMSA: "JV_UMSA";
6
+ readonly UVA_ONLINE_JUDGE: "UVA_ONLINE_JUDGE";
7
+ readonly AT_CODER: "AT_CODER";
8
+ readonly CODECHEF: "CODECHEF";
9
+ readonly TOPCODER: "TOPCODER";
10
+ readonly LEETCODE: "LEETCODE";
11
+ };
12
+ export type JudgeType = (typeof JudgeType)[keyof typeof JudgeType];
@@ -0,0 +1,11 @@
1
+ export const JudgeType = {
2
+ JUKI_JUDGE: 'JUKI_JUDGE',
3
+ CODEFORCES: 'CODEFORCES',
4
+ CODEFORCES_GYM: 'CODEFORCES_GYM',
5
+ JV_UMSA: 'JV_UMSA',
6
+ UVA_ONLINE_JUDGE: 'UVA_ONLINE_JUDGE',
7
+ AT_CODER: 'AT_CODER',
8
+ CODECHEF: 'CODECHEF',
9
+ TOPCODER: 'TOPCODER',
10
+ LEETCODE: 'LEETCODE',
11
+ };
@@ -0,0 +1,7 @@
1
+ export declare const OrganizationPlan: {
2
+ readonly FREE: "FREE";
3
+ readonly STANDARD: "STANDARD";
4
+ readonly PREMIUM: "PREMIUM";
5
+ readonly CUSTOM: "CUSTOM";
6
+ };
7
+ export type OrganizationPlan = (typeof OrganizationPlan)[keyof typeof OrganizationPlan];
@@ -0,0 +1,6 @@
1
+ export const OrganizationPlan = {
2
+ FREE: 'FREE',
3
+ STANDARD: 'STANDARD',
4
+ PREMIUM: 'PREMIUM',
5
+ CUSTOM: 'CUSTOM',
6
+ };
@@ -0,0 +1,11 @@
1
+ export declare const ProblemRole: {
2
+ readonly RESTRICTED: "RESTRICTED";
3
+ readonly GUEST: "GUEST";
4
+ readonly REGULAR: "REGULAR";
5
+ readonly CREATOR: "CREATOR";
6
+ readonly MANAGER: "MANAGER";
7
+ readonly MASTER: "MASTER";
8
+ readonly ADMIN: "ADMIN";
9
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
10
+ };
11
+ export type ProblemRole = (typeof ProblemRole)[keyof typeof ProblemRole];
@@ -0,0 +1,10 @@
1
+ export const ProblemRole = {
2
+ RESTRICTED: 'RESTRICTED',
3
+ GUEST: 'GUEST',
4
+ REGULAR: 'REGULAR',
5
+ CREATOR: 'CREATOR',
6
+ MANAGER: 'MANAGER',
7
+ MASTER: 'MASTER',
8
+ ADMIN: 'ADMIN',
9
+ SUPER_ADMIN: 'SUPER_ADMIN',
10
+ };
@@ -0,0 +1,6 @@
1
+ export declare const ProblemScoringMode: {
2
+ readonly SUBTASK: "SUBTASK";
3
+ readonly TOTAL: "TOTAL";
4
+ readonly PARTIAL: "PARTIAL";
5
+ };
6
+ export type ProblemScoringMode = (typeof ProblemScoringMode)[keyof typeof ProblemScoringMode];
@@ -0,0 +1,5 @@
1
+ export const ProblemScoringMode = {
2
+ SUBTASK: 'SUBTASK',
3
+ TOTAL: 'TOTAL',
4
+ PARTIAL: 'PARTIAL',
5
+ };
@@ -0,0 +1,6 @@
1
+ export declare const ProblemType: {
2
+ readonly STANDARD: "STANDARD";
3
+ readonly DYNAMIC: "DYNAMIC";
4
+ readonly INTERACTIVE: "INTERACTIVE";
5
+ };
6
+ export type ProblemType = (typeof ProblemType)[keyof typeof ProblemType];
@@ -0,0 +1,5 @@
1
+ export const ProblemType = {
2
+ STANDARD: 'STANDARD',
3
+ DYNAMIC: 'DYNAMIC',
4
+ INTERACTIVE: 'INTERACTIVE',
5
+ };
@@ -0,0 +1,14 @@
1
+ export declare const ProblemVerdict: {
2
+ readonly NONE: "NONE";
3
+ readonly PENDING: "PENDING";
4
+ readonly HIDDEN: "HIDDEN";
5
+ readonly CE: "CE";
6
+ readonly RE: "RE";
7
+ readonly TLE: "TLE";
8
+ readonly MLE: "MLE";
9
+ readonly WA: "WA";
10
+ readonly PE: "PE";
11
+ readonly PA: "PA";
12
+ readonly AC: "AC";
13
+ };
14
+ export type ProblemVerdict = (typeof ProblemVerdict)[keyof typeof ProblemVerdict];
@@ -0,0 +1,13 @@
1
+ export const ProblemVerdict = {
2
+ NONE: 'NONE',
3
+ PENDING: 'PENDING',
4
+ HIDDEN: 'HIDDEN',
5
+ CE: 'CE',
6
+ RE: 'RE',
7
+ TLE: 'TLE',
8
+ MLE: 'MLE',
9
+ WA: 'WA',
10
+ PE: 'PE',
11
+ PA: 'PA',
12
+ AC: 'AC',
13
+ };
@@ -0,0 +1,5 @@
1
+ export declare const ShareLinkVisibility: {
2
+ readonly PUBLIC: "PUBLIC";
3
+ readonly RESTRICTED: "RESTRICTED";
4
+ };
5
+ export type ShareLinkVisibility = (typeof ShareLinkVisibility)[keyof typeof ShareLinkVisibility];
@@ -0,0 +1,4 @@
1
+ export const ShareLinkVisibility = {
2
+ PUBLIC: 'PUBLIC', // anyone with the link
3
+ RESTRICTED: 'RESTRICTED', // only allowedUserIds
4
+ };
@@ -0,0 +1,18 @@
1
+ export declare const SubmissionRunStatus: {
2
+ readonly NONE: "NONE";
3
+ readonly RECEIVED: "RECEIVED";
4
+ readonly COMPILING: "COMPILING";
5
+ readonly COMPILED: "COMPILED";
6
+ readonly COMPILATION_ERROR: "COMPILATION_ERROR";
7
+ readonly FETCHING_TEST_CASES: "FETCHING_TEST_CASES";
8
+ readonly RUNNING_TEST_CASE: "RUNNING_TEST_CASE";
9
+ readonly RUNNING_TEST_CASES: "RUNNING_TEST_CASES";
10
+ readonly RUNNING_SAMPLE_TEST_CASES: "RUNNING_SAMPLE_TEST_CASES";
11
+ readonly EXECUTED_TEST_CASE: "EXECUTED_TEST_CASE";
12
+ readonly FAILED_TEST_CASE: "FAILED_TEST_CASE";
13
+ readonly JUDGING_TEST_CASE: "JUDGING_TEST_CASE";
14
+ readonly GRADING: "GRADING";
15
+ readonly FAILED: "FAILED";
16
+ readonly COMPLETED: "COMPLETED";
17
+ };
18
+ export type SubmissionRunStatus = (typeof SubmissionRunStatus)[keyof typeof SubmissionRunStatus];
@@ -0,0 +1,17 @@
1
+ export const SubmissionRunStatus = {
2
+ NONE: 'NONE',
3
+ RECEIVED: 'RECEIVED',
4
+ COMPILING: 'COMPILING',
5
+ COMPILED: 'COMPILED',
6
+ COMPILATION_ERROR: 'COMPILATION_ERROR',
7
+ FETCHING_TEST_CASES: 'FETCHING_TEST_CASES',
8
+ RUNNING_TEST_CASE: 'RUNNING_TEST_CASE',
9
+ RUNNING_TEST_CASES: 'RUNNING_TEST_CASES',
10
+ RUNNING_SAMPLE_TEST_CASES: 'RUNNING_SAMPLE_TEST_CASES',
11
+ EXECUTED_TEST_CASE: 'EXECUTED_TEST_CASE',
12
+ FAILED_TEST_CASE: 'FAILED_TEST_CASE',
13
+ JUDGING_TEST_CASE: 'JUDGING_TEST_CASE',
14
+ GRADING: 'GRADING',
15
+ FAILED: 'FAILED',
16
+ COMPLETED: 'COMPLETED',
17
+ };
@@ -0,0 +1,9 @@
1
+ export declare const SystemRole: {
2
+ readonly GUEST: "GUEST";
3
+ readonly REGULAR: "REGULAR";
4
+ readonly MANAGER: "MANAGER";
5
+ readonly MASTER: "MASTER";
6
+ readonly ADMIN: "ADMIN";
7
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
8
+ };
9
+ export type SystemRole = (typeof SystemRole)[keyof typeof SystemRole];
@@ -0,0 +1,8 @@
1
+ export const SystemRole = {
2
+ GUEST: 'GUEST',
3
+ REGULAR: 'REGULAR',
4
+ MANAGER: 'MANAGER',
5
+ MASTER: 'MASTER',
6
+ ADMIN: 'ADMIN',
7
+ SUPER_ADMIN: 'SUPER_ADMIN',
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare const TeamRole: {
2
+ readonly RESTRICTED: "RESTRICTED";
3
+ readonly GUEST: "GUEST";
4
+ readonly REGULAR: "REGULAR";
5
+ readonly MANAGER: "MANAGER";
6
+ readonly ADMIN: "ADMIN";
7
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
8
+ };
9
+ export type TeamRole = (typeof TeamRole)[keyof typeof TeamRole];
@@ -0,0 +1,8 @@
1
+ export const TeamRole = {
2
+ RESTRICTED: 'RESTRICTED',
3
+ GUEST: 'GUEST',
4
+ REGULAR: 'REGULAR',
5
+ MANAGER: 'MANAGER',
6
+ ADMIN: 'ADMIN',
7
+ SUPER_ADMIN: 'SUPER_ADMIN',
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare const TelemetryType: {
2
+ readonly UI_ERROR: "UI_ERROR";
3
+ readonly UI_INFO: "UI_INFO";
4
+ readonly EC2: "EC2";
5
+ readonly ECS_TASK: "ECS_TASK";
6
+ readonly INSTANCES: "INSTANCES";
7
+ readonly USER_SESSION: "USER_SESSION";
8
+ };
9
+ export type TelemetryType = (typeof TelemetryType)[keyof typeof TelemetryType];
@@ -0,0 +1,8 @@
1
+ export const TelemetryType = {
2
+ UI_ERROR: 'UI_ERROR',
3
+ UI_INFO: 'UI_INFO',
4
+ EC2: 'EC2',
5
+ ECS_TASK: 'ECS_TASK',
6
+ INSTANCES: 'INSTANCES',
7
+ USER_SESSION: 'USER_SESSION', // company-id/user-id: { timestamp: number, href: string, uiId: string
8
+ };
@@ -0,0 +1,10 @@
1
+ export declare const UserRole: {
2
+ readonly RESTRICTED: "RESTRICTED";
3
+ readonly GUEST: "GUEST";
4
+ readonly LIMITED: "LIMITED";
5
+ readonly REGULAR: "REGULAR";
6
+ readonly MANAGER: "MANAGER";
7
+ readonly ADMIN: "ADMIN";
8
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
9
+ };
10
+ export type UserRole = (typeof UserRole)[keyof typeof UserRole];
@@ -0,0 +1,9 @@
1
+ export const UserRole = {
2
+ RESTRICTED: 'RESTRICTED',
3
+ GUEST: 'GUEST',
4
+ LIMITED: 'LIMITED',
5
+ REGULAR: 'REGULAR',
6
+ MANAGER: 'MANAGER',
7
+ ADMIN: 'ADMIN',
8
+ SUPER_ADMIN: 'SUPER_ADMIN',
9
+ };