@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,24 @@
1
+ import { OrganizationPlan } from '../prisma/enums/index.js';
2
+ export const JUKI_APP_COMPANY_KEY = 'juki-app';
3
+ export const COMPANY_PLAN = {
4
+ [OrganizationPlan.FREE]: {
5
+ value: OrganizationPlan.FREE,
6
+ label: 'free',
7
+ description: 'the resources, runners and compilers, are shared with the juki.app giving priority to juki.app',
8
+ },
9
+ [OrganizationPlan.STANDARD]: {
10
+ value: OrganizationPlan.STANDARD,
11
+ label: 'standard',
12
+ description: 'the resources are dedicated, 1 runner and 1 compiler',
13
+ },
14
+ [OrganizationPlan.PREMIUM]: {
15
+ value: OrganizationPlan.PREMIUM,
16
+ label: 'premium',
17
+ description: 'the resources are dedicated and on demand use with at least 1 runner and 1 compiler',
18
+ },
19
+ [OrganizationPlan.CUSTOM]: {
20
+ value: OrganizationPlan.CUSTOM,
21
+ label: 'custom',
22
+ description: 'the resources are dedicated and on demand use with at least 1 (settable) runner and 1 (settable) compiler',
23
+ },
24
+ };
@@ -0,0 +1,15 @@
1
+ import { type ContestRole, ContestStatus } from '../prisma/enums/index.js';
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,29 @@
1
+ import { ContestStatus } from '../prisma/enums/index.js';
2
+ import { Role } from '../types/index.js';
3
+ export const CONTEST_STATUS = {
4
+ [ContestStatus.PUBLIC]: {
5
+ value: ContestStatus.PUBLIC,
6
+ label: 'public',
7
+ description: 'the contest will appear in the contest list and the users will have access according to their roles',
8
+ },
9
+ [ContestStatus.RESERVED]: {
10
+ value: ContestStatus.RESERVED,
11
+ label: 'reserved',
12
+ description: 'the contest will appear in the contest list only for contest members and the users will have access according to their roles',
13
+ },
14
+ [ContestStatus.ARCHIVED]: {
15
+ value: ContestStatus.ARCHIVED,
16
+ label: 'archived',
17
+ description: 'the contest will not appear for anyone, contact the administrator to see it again',
18
+ },
19
+ };
20
+ export const CONTEST_ROLE = {
21
+ [Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 7 },
22
+ [Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 6 },
23
+ [Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 5 },
24
+ [Role.CREATOR]: { value: Role.CREATOR, label: 'creator', level: 4 },
25
+ [Role.MANAGER]: { value: Role.MANAGER, label: 'manager', level: 3 },
26
+ [Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
27
+ [Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
28
+ [Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
29
+ };
@@ -0,0 +1,8 @@
1
+ import { CourseRole } from '../prisma/enums/index.js';
2
+ export declare const COURSE_ROLE: {
3
+ [Key in CourseRole]: {
4
+ value: CourseRole;
5
+ label: string;
6
+ level: number;
7
+ };
8
+ };
@@ -0,0 +1,12 @@
1
+ import { CourseRole } from '../prisma/enums/index.js';
2
+ export const COURSE_ROLE = {
3
+ [CourseRole.RESTRICTED]: { value: CourseRole.RESTRICTED, label: 'restricted', level: 8 },
4
+ [CourseRole.GUEST]: { value: CourseRole.GUEST, label: 'guest', level: 7 },
5
+ [CourseRole.REGULAR]: { value: CourseRole.REGULAR, label: 'regular', level: 6 },
6
+ [CourseRole.CREATOR]: { value: CourseRole.CREATOR, label: 'creator', level: 5 },
7
+ [CourseRole.SUPER_CREATOR]: { value: CourseRole.SUPER_CREATOR, label: 'super creator', level: 4 },
8
+ [CourseRole.MANAGER]: { value: CourseRole.MANAGER, label: 'manager', level: 3 },
9
+ [CourseRole.MASTER]: { value: CourseRole.MASTER, label: 'super admin', level: 2 },
10
+ [CourseRole.ADMIN]: { value: CourseRole.ADMIN, label: 'admin', level: 1 },
11
+ [CourseRole.SUPER_ADMIN]: { value: CourseRole.SUPER_ADMIN, label: 'super admin', level: 0 },
12
+ };
@@ -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,23 @@
1
+ import { range } from '../helpers/index.js';
2
+ export const YEARS = range(1970, 2100);
3
+ export const MONTH_NAMES = [
4
+ 'January',
5
+ 'February',
6
+ 'March',
7
+ 'April',
8
+ 'May',
9
+ 'June',
10
+ 'July',
11
+ 'August',
12
+ 'September',
13
+ 'October',
14
+ 'November',
15
+ 'December',
16
+ ];
17
+ export const DAY_NAMES = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
18
+ export const HOURS = range(0, 24);
19
+ export const MINUTES = range(0, 60);
20
+ export const SECONDS = range(0, 60);
21
+ export const MILLISECONDS = range(0, 1000);
22
+ export const MAX_DATE = new Date(8640000000000000);
23
+ export const MIN_DATE = new Date(0);
@@ -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,34 @@
1
+ export const SUPPORT_EMAIL = 'support@juki.app';
2
+ export const JUKI_APP_EMAIL_TEMPLATE = `<div style="width: 100%; background: #F2F2F2;">
3
+ <div style="background: #164066; width: 100%;">
4
+ <div style="height: 56px; color: white; width: 100px; margin: 0 auto">
5
+ <img
6
+ src="https://images.juki.pub/assets/juki-app-horizontal-white-logo.svg"
7
+ alt="juki app logo"
8
+ height="56px"
9
+ style="padding:10px; box-sizing: border-box"
10
+ />
11
+ </div>
12
+ </div>
13
+ <div style="padding: 24px; color: #333333; font-family: sans-serif; font-size: 16px; line-height: 24px;">
14
+ <div style="max-width: 520px; margin: 0 auto; padding: 24px; background: white; border-radius: 6px;">
15
+ <section style="padding: 0 0 1em 0; border-bottom: 1px solid #828282;">
16
+ {{content}}
17
+ </section>
18
+ <div style="font-size: 14px; text-align: center; color: #828282; line-height: 16px; padding-top: 1em">
19
+ <p style="margin: 0;">
20
+ Si tú no realizaste la solicitud, escribenos a
21
+ <a href="mailto:${SUPPORT_EMAIL}" style="color: #2468A6; text-decoration: none;">
22
+ ${SUPPORT_EMAIL}
23
+ </a>
24
+ </p>
25
+ <p style="margin: 0;">
26
+ Este mensaje fue enviado por el equipo de
27
+ <a href="https://juki.app" style="color: #2468A6; text-decoration: none;">
28
+ juki.app
29
+ </a>
30
+ </p>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>`;
@@ -0,0 +1,3 @@
1
+ import type { DocumentMembersResponseDTO, EntityMembersResponseDTO } from '../dto/index.js';
2
+ export declare const EMPTY_DOCUMENT_MEMBERS: () => DocumentMembersResponseDTO;
3
+ export declare const EMPTY_ENTITY_MEMBERS: () => EntityMembersResponseDTO;
@@ -0,0 +1,18 @@
1
+ import { EntityAccess, EntityMembersRank } from '../types/index.js';
2
+ export const EMPTY_DOCUMENT_MEMBERS = () => ({
3
+ access: EntityAccess.PRIVATE,
4
+ managers: {},
5
+ spectators: {},
6
+ });
7
+ export const EMPTY_ENTITY_MEMBERS = () => ({
8
+ rankAdministrators: EntityMembersRank.CLOSE,
9
+ administrators: {},
10
+ rankManagers: EntityMembersRank.CLOSE,
11
+ managers: {},
12
+ rankGuests: EntityMembersRank.CLOSE,
13
+ guests: {},
14
+ rankSpectators: EntityMembersRank.CLOSE,
15
+ spectators: {},
16
+ rankParticipants: EntityMembersRank.CLOSE,
17
+ participants: {},
18
+ });
@@ -0,0 +1,28 @@
1
+ import { type FileRole, FileType } from '../prisma/enums/index.js';
2
+ import { EntityAccess, EntityState } from '../types/index.js';
3
+ export declare const FILE_TYPE: {
4
+ [Key in FileType]: {
5
+ value: FileType;
6
+ label: string;
7
+ };
8
+ };
9
+ export declare const FILE_ROLE: {
10
+ [Key in FileRole]: {
11
+ value: FileRole;
12
+ label: string;
13
+ level: number;
14
+ };
15
+ };
16
+ export declare const ENTITY_STATE: {
17
+ [Key in EntityState]: {
18
+ value: EntityState;
19
+ label: string;
20
+ };
21
+ };
22
+ export declare const ENTITY_ACCESS: {
23
+ [Key in EntityAccess]: {
24
+ value: EntityAccess;
25
+ label: string;
26
+ description: string;
27
+ };
28
+ };
@@ -0,0 +1,46 @@
1
+ import { FileType } from '../prisma/enums/index.js';
2
+ import { EntityAccess, EntityState, Role } from '../types/index.js';
3
+ export const FILE_TYPE = {
4
+ [FileType.FILE]: { value: FileType.FILE, label: 'file' },
5
+ [FileType.FOLDER]: { value: FileType.FOLDER, label: 'folder' },
6
+ };
7
+ export const FILE_ROLE = {
8
+ [Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 5 },
9
+ [Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 4 },
10
+ [Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 3 },
11
+ [Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
12
+ [Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
13
+ [Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
14
+ };
15
+ export const ENTITY_STATE = {
16
+ [EntityState.RELEASED]: {
17
+ value: EntityState.RELEASED,
18
+ label: 'released',
19
+ },
20
+ [EntityState.ARCHIVED]: {
21
+ value: EntityState.ARCHIVED,
22
+ label: 'archived',
23
+ },
24
+ };
25
+ export const ENTITY_ACCESS = {
26
+ [EntityAccess.PRIVATE]: {
27
+ value: EntityAccess.PRIVATE,
28
+ label: 'private',
29
+ description: 'the record will be visible and editable only to the owner',
30
+ },
31
+ [EntityAccess.RESTRICTED]: {
32
+ value: EntityAccess.RESTRICTED,
33
+ label: 'restricted',
34
+ description: 'the record will be visible to viewers and the owner and editable to editors and the owner',
35
+ },
36
+ [EntityAccess.PUBLIC]: {
37
+ value: EntityAccess.PUBLIC,
38
+ label: 'public',
39
+ description: 'the record will be visible to anyone and editable to editors and the owner',
40
+ },
41
+ [EntityAccess.EXPOSED]: {
42
+ value: EntityAccess.EXPOSED,
43
+ label: 'exposed',
44
+ description: 'the record will be visible and editable to anyone',
45
+ },
46
+ };
@@ -0,0 +1,18 @@
1
+ export * from './commons.js';
2
+ export * from './company.js';
3
+ export * from './contest.js';
4
+ export * from './course.js';
5
+ export * from './date.js';
6
+ export * from './email.js';
7
+ export * from './entity.js';
8
+ export * from './file.js';
9
+ export * from './judge.js';
10
+ export * from './problem.js';
11
+ export * from './routing.js';
12
+ export * from './services.js';
13
+ export * from './system.js';
14
+ export * from './teams.js';
15
+ export * from './time.js';
16
+ export * from './user.js';
17
+ export * from './websocket.js';
18
+ export * from './worksheet.js';
@@ -0,0 +1,18 @@
1
+ export * from './commons.js';
2
+ export * from './company.js';
3
+ export * from './contest.js';
4
+ export * from './course.js';
5
+ export * from './date.js';
6
+ export * from './email.js';
7
+ export * from './entity.js';
8
+ export * from './file.js';
9
+ export * from './judge.js';
10
+ export * from './problem.js';
11
+ export * from './routing.js';
12
+ export * from './services.js';
13
+ export * from './system.js';
14
+ export * from './teams.js';
15
+ export * from './time.js';
16
+ export * from './user.js';
17
+ export * from './websocket.js';
18
+ export * from './worksheet.js';
@@ -0,0 +1,37 @@
1
+ import { JudgeType, ProblemScoringMode, ProblemType, ProblemVerdict, SubmissionRunStatus } from '../prisma/enums/index.js';
2
+ import { CodeLanguage, RunnerType } from '../types/index.js';
3
+ type Judge = {
4
+ [Key in JudgeType]: {
5
+ value: JudgeType;
6
+ label: string;
7
+ logo: string;
8
+ logoSize: [number, number];
9
+ url: string;
10
+ };
11
+ };
12
+ export declare const JUDGE: Judge;
13
+ export declare const RUNNER_ACCEPTED_PROBLEM_MODES: ProblemScoringMode[];
14
+ export declare const RUNNER_ACCEPTED_PROBLEM_TYPES: ProblemType[];
15
+ export declare const RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES: CodeLanguage[];
16
+ export declare const ACCEPTED_PROGRAMMING_LANGUAGES: CodeLanguage[];
17
+ export declare const PROBLEM_VERDICT: {
18
+ [Key in ProblemVerdict]: {
19
+ value: ProblemVerdict;
20
+ label: string;
21
+ color: string;
22
+ };
23
+ };
24
+ export declare const PROBLEM_VERDICTS: ("NONE" | "PENDING" | "CE" | "RE" | "TLE" | "MLE" | "WA" | "PE" | "PA" | "AC")[];
25
+ export declare const SUBMISSION_RUN_STATUS: {
26
+ [Key in SubmissionRunStatus]: {
27
+ value: SubmissionRunStatus;
28
+ label: string;
29
+ };
30
+ };
31
+ export declare const RUNNER_TYPE: {
32
+ [Key in RunnerType]: {
33
+ value: RunnerType;
34
+ label: string;
35
+ };
36
+ };
37
+ export {};
@@ -0,0 +1,221 @@
1
+ import { JudgeType, ProblemScoringMode, ProblemType, ProblemVerdict, SubmissionRunStatus } from '../prisma/enums/index.js';
2
+ import { CodeLanguage, RunnerType } from '../types/index.js';
3
+ export const JUDGE = {
4
+ // [Judge.CUSTOMER]: {
5
+ // value: Judge.CUSTOMER,
6
+ // label: '',
7
+ // logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
8
+ // logoSize: [ 883.991, 435 ],
9
+ // url: '',
10
+ // // getLoginUrl: () => '',
11
+ // // getProfileUrl: () => '',
12
+ // // getSubmitUrl: () => '',
13
+ // // getSubmissionUrl: () => '',
14
+ // // getProblemUrl: (key: string) => `/problem/view/${key}`,
15
+ // // getUserSubmissionsUrl: () => '',
16
+ // },
17
+ [JudgeType.JUKI_JUDGE]: {
18
+ value: JudgeType.JUKI_JUDGE,
19
+ label: 'Juki Judge',
20
+ logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
21
+ logoSize: [883.991, 435],
22
+ url: 'https://judge.juki.app',
23
+ // getLoginUrl: () => '',
24
+ // getProfileUrl: () => '',
25
+ // getSubmitUrl: () => '',
26
+ // getSubmissionUrl: () => '',
27
+ // getProblemUrl: (key: string) => `https://judge.juki.app/problem/view/${key}`,
28
+ // getUserSubmissionsUrl: () => '',
29
+ },
30
+ [JudgeType.CODEFORCES]: {
31
+ value: JudgeType.CODEFORCES,
32
+ label: 'Codeforces',
33
+ logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
34
+ logoSize: [1232.75, 145.12],
35
+ url: 'https://codeforces.com',
36
+ // getLoginUrl: () => 'https://codeforces.com/enter',
37
+ // getProfileUrl: () => '',
38
+ // getSubmitUrl: () => 'https://codeforces.com/problemset/submit',
39
+ // getSubmissionUrl: (problemKey: string, submissionId: string) => {
40
+ // const [ contestId ] = problemKey.split('-');
41
+ // return `https://codeforces.com/problemset/submission/${contestId}/${submissionId}`;
42
+ // },
43
+ // getProblemUrl: (problemKey: string) => {
44
+ // const [ contestId, index ] = problemKey.split('-');
45
+ // return `https://codeforces.com/problemset/problem/${contestId}/${index}`;
46
+ // },
47
+ // getUserSubmissionsUrl: () => '',
48
+ },
49
+ [JudgeType.CODEFORCES_GYM]: {
50
+ value: JudgeType.CODEFORCES_GYM,
51
+ label: 'Codeforces Gym',
52
+ logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
53
+ logoSize: [1232.75, 145.12],
54
+ url: 'https://codeforces.com',
55
+ // getLoginUrl: () => 'https://codeforces.com/enter',
56
+ // getProfileUrl: () => '',
57
+ // getSubmitUrl: (problemKey: string) => {
58
+ // const [ gymContestId, index ] = problemKey.split('-');
59
+ // return `https://codeforces.com/gym/${gymContestId}/submit`;
60
+ // },
61
+ // getSubmissionUrl: (problemKey: string, submissionId: string) => {
62
+ // const [ gymContestId ] = problemKey.split('-');
63
+ // return `https://codeforces.com/gym/${gymContestId}/submission/${submissionId}`;
64
+ // },
65
+ // getProblemUrl: (problemKey: string) => {
66
+ // const [ gymContestId, index ] = problemKey.split('-');
67
+ // return `https://codeforces.com/gym/${gymContestId}/problem/${index}`;
68
+ // },
69
+ // getUserSubmissionsUrl: () => '',
70
+ },
71
+ [JudgeType.JV_UMSA]: {
72
+ value: JudgeType.JV_UMSA,
73
+ label: 'Juez Virtual UMSA',
74
+ logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
75
+ logoSize: [1232.75, 145.12],
76
+ url: 'https://jv.umsa.bo',
77
+ // getLoginUrl: () => 'https://jv.umsa.bo/oj/login.php',
78
+ // getProfileUrl: () => 'https://jv.umsa.bo/oj/userInfo.php',
79
+ // getSubmitUrl: (problemKey: string) => {
80
+ // // single problem: '1019'
81
+ // // cib problem: '1019-A'
82
+ // const isContestProblem = problemKey.includes('-');
83
+ // // A -> 0, B -> 1, C -> 2, D -> 3, E -> 4, F -> 5, G -> 6, H -> 7, I -> 8, J -> 9
84
+ // const params = problemKey.split('-');
85
+ // return isContestProblem
86
+ // ? `https://jv.umsa.bo/oj/submitpage.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
87
+ // : `https://jv.umsa.bo/oj/submitpage.php?id=${problemKey}`;
88
+ // },
89
+ // getSubmissionUrl: (problemKey: string, submissionId: string, username: string) => {
90
+ // // return `https://jv.umsa.bo/status.php?problem_id=&user_id=${username}&language=-1&jresult=-1`;
91
+ // return `https://jv.umsa.bo/oj/showsource.php?id=${submissionId}`;
92
+ // },
93
+ // getProblemUrl: (problemKey: string) => {
94
+ // const isContestProblem = problemKey.includes('-');
95
+ // const params = problemKey.split('-');
96
+ // return isContestProblem
97
+ // ? `https://jv.umsa.bo/oj/problem.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
98
+ // : `https://jv.umsa.bo/oj/problem.php?id=${problemKey}`;
99
+ // },
100
+ // getUserSubmissionsUrl: (username: string) => `https://jv.umsa.bo/oj/status.php?user_id=${username}`,
101
+ },
102
+ [JudgeType.UVA_ONLINE_JUDGE]: {
103
+ value: JudgeType.UVA_ONLINE_JUDGE,
104
+ label: 'Uva Online Judge',
105
+ logo: 'https://images.juki.pub/c/uva-online-judge-logo-color.png',
106
+ logoSize: [150, 135.994],
107
+ url: 'https://onlinejudge.org',
108
+ },
109
+ [JudgeType.AT_CODER]: {
110
+ value: JudgeType.AT_CODER,
111
+ label: 'AtCoder',
112
+ logo: 'https://images.juki.pub/c/at-coder-logo-color.png',
113
+ logoSize: [762.997, 675],
114
+ url: 'https://atcoder.jp',
115
+ },
116
+ [JudgeType.CODECHEF]: {
117
+ value: JudgeType.CODECHEF,
118
+ label: 'Codechef',
119
+ logo: 'https://images.juki.pub/c/codechef-logo-color.svg',
120
+ logoSize: [1207.7, 453.17],
121
+ url: 'https://www.codechef.com',
122
+ },
123
+ [JudgeType.TOPCODER]: {
124
+ value: JudgeType.TOPCODER,
125
+ label: 'Topcoder',
126
+ logo: 'https://images.juki.pub/c/topcoder-logo-color.png',
127
+ logoSize: [971.99, 415.99],
128
+ url: 'https://www.topcoder.com',
129
+ },
130
+ [JudgeType.LEETCODE]: {
131
+ value: JudgeType.LEETCODE,
132
+ label: 'LeetCode',
133
+ logo: 'https://images.juki.pub/assets/leetcode-logo-color.svg',
134
+ logoSize: [95, 111],
135
+ url: 'https://leetcode.com',
136
+ // getProblemUrl: (problemKey: string) => {
137
+ // return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}`;
138
+ // },
139
+ // getProfileUrl: (userNickname: string) => {
140
+ // return `https://leetcode.com/u/${userNickname}`;
141
+ // },
142
+ // getSubmissionUrl: (problemKey: string, submissionId: string, username: string, submissionRunId: string) => {
143
+ // return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}/submissions/${submissionRunId}`;
144
+ // },
145
+ },
146
+ };
147
+ export const RUNNER_ACCEPTED_PROBLEM_MODES = [
148
+ ProblemScoringMode.TOTAL,
149
+ ProblemScoringMode.SUBTASK,
150
+ ProblemScoringMode.PARTIAL,
151
+ ];
152
+ export const RUNNER_ACCEPTED_PROBLEM_TYPES = [ProblemType.STANDARD, ProblemType.DYNAMIC];
153
+ export const RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES = [
154
+ CodeLanguage.C_11,
155
+ CodeLanguage.CPP_11,
156
+ CodeLanguage.CPP_20,
157
+ CodeLanguage.JAVA_21,
158
+ CodeLanguage.PYTHON_3,
159
+ CodeLanguage.PYTHON_PYPY_3,
160
+ CodeLanguage.JAVASCRIPT_NODE_JS_22,
161
+ CodeLanguage.PSEUDOCODE_PSEINT,
162
+ ];
163
+ export const ACCEPTED_PROGRAMMING_LANGUAGES = [...RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES];
164
+ export const PROBLEM_VERDICT = {
165
+ [ProblemVerdict.NONE]: { value: ProblemVerdict.NONE, label: 'none', color: '#555555' },
166
+ [ProblemVerdict.PENDING]: { value: ProblemVerdict.PENDING, label: 'pending', color: '#79B6FD' },
167
+ [ProblemVerdict.HIDDEN]: { value: ProblemVerdict.HIDDEN, label: 'hidden', color: '#555555' },
168
+ [ProblemVerdict.AC]: { value: ProblemVerdict.AC, label: 'accepted', color: '#43D787' },
169
+ [ProblemVerdict.PE]: { value: ProblemVerdict.PE, label: 'presentation error', color: '#55db93' },
170
+ [ProblemVerdict.PA]: { value: ProblemVerdict.PA, label: 'partial accepted', color: '#55db93' },
171
+ [ProblemVerdict.CE]: { value: ProblemVerdict.CE, label: 'compilation error', color: '#FE9F9F' },
172
+ [ProblemVerdict.RE]: { value: ProblemVerdict.RE, label: 'runtime error', color: '#FE9F9F' },
173
+ [ProblemVerdict.TLE]: { value: ProblemVerdict.TLE, label: 'time limit exceed', color: '#FE9F9F' },
174
+ [ProblemVerdict.MLE]: { value: ProblemVerdict.MLE, label: 'memory limit exceed', color: '#FE9F9F' },
175
+ [ProblemVerdict.WA]: { value: ProblemVerdict.WA, label: 'wrong answer', color: '#FE9F9F' },
176
+ };
177
+ export const PROBLEM_VERDICTS = [
178
+ ProblemVerdict.NONE,
179
+ ProblemVerdict.PENDING,
180
+ ProblemVerdict.AC,
181
+ ProblemVerdict.PE,
182
+ ProblemVerdict.PA,
183
+ ProblemVerdict.CE,
184
+ ProblemVerdict.RE,
185
+ ProblemVerdict.TLE,
186
+ ProblemVerdict.MLE,
187
+ ProblemVerdict.WA,
188
+ ];
189
+ export const SUBMISSION_RUN_STATUS = {
190
+ [SubmissionRunStatus.NONE]: { value: SubmissionRunStatus.NONE, label: 'none' }, // status
191
+ [SubmissionRunStatus.RECEIVED]: { value: SubmissionRunStatus.RECEIVED, label: 'received' }, // state
192
+ [SubmissionRunStatus.COMPILING]: { value: SubmissionRunStatus.COMPILING, label: 'compiling' }, // state
193
+ [SubmissionRunStatus.COMPILED]: { value: SubmissionRunStatus.COMPILED, label: 'compiled' }, // status
194
+ [SubmissionRunStatus.COMPILATION_ERROR]: { value: SubmissionRunStatus.COMPILATION_ERROR, label: 'compilation error' }, // status
195
+ [SubmissionRunStatus.FETCHING_TEST_CASES]: {
196
+ value: SubmissionRunStatus.FETCHING_TEST_CASES,
197
+ label: 'fetching test cases',
198
+ }, // state
199
+ [SubmissionRunStatus.RUNNING_TEST_CASE]: { value: SubmissionRunStatus.RUNNING_TEST_CASE, label: 'running test case' }, // state
200
+ [SubmissionRunStatus.RUNNING_TEST_CASES]: {
201
+ value: SubmissionRunStatus.RUNNING_TEST_CASES,
202
+ label: 'running test cases',
203
+ }, // state
204
+ [SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES]: {
205
+ value: SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES,
206
+ label: 'running sample cases',
207
+ }, // state
208
+ [SubmissionRunStatus.EXECUTED_TEST_CASE]: {
209
+ value: SubmissionRunStatus.EXECUTED_TEST_CASE,
210
+ label: 'executed test case',
211
+ }, // status
212
+ [SubmissionRunStatus.FAILED_TEST_CASE]: { value: SubmissionRunStatus.FAILED_TEST_CASE, label: 'failed test case' }, // status
213
+ [SubmissionRunStatus.JUDGING_TEST_CASE]: { value: SubmissionRunStatus.JUDGING_TEST_CASE, label: 'judging test case' }, // state
214
+ [SubmissionRunStatus.GRADING]: { value: SubmissionRunStatus.GRADING, label: 'grading' }, // status
215
+ [SubmissionRunStatus.FAILED]: { value: SubmissionRunStatus.FAILED, label: 'failed' }, // status
216
+ [SubmissionRunStatus.COMPLETED]: { value: SubmissionRunStatus.COMPLETED, label: 'completed' }, // status
217
+ };
218
+ export const RUNNER_TYPE = {
219
+ [RunnerType.HIGH_PERFORMANCE]: { value: RunnerType.HIGH_PERFORMANCE, label: 'high performance' },
220
+ [RunnerType.LOW_PERFORMANCE]: { value: RunnerType.LOW_PERFORMANCE, label: 'low performance' },
221
+ };
@@ -0,0 +1,37 @@
1
+ import { type ProblemRole, ProblemScoringMode, ProblemType } from '../prisma/enums/index.js';
2
+ import { ProblemInput, ProblemOutput } from '../types/index.js';
3
+ export declare const PROBLEM_INPUT: {
4
+ [Key in ProblemInput]: {
5
+ value: ProblemInput;
6
+ label: string;
7
+ };
8
+ };
9
+ export declare const PROBLEM_OUTPUT: {
10
+ [Key in ProblemOutput]: {
11
+ value: ProblemOutput;
12
+ label: string;
13
+ };
14
+ };
15
+ export declare const PROBLEM_MODES: ("SUBTASK" | "TOTAL" | "PARTIAL")[];
16
+ export declare const PROBLEM_MODE: {
17
+ [Key in ProblemScoringMode]: {
18
+ value: ProblemScoringMode;
19
+ label: string;
20
+ description: string;
21
+ };
22
+ };
23
+ export declare const PROBLEM_TYPES: ("STANDARD" | "DYNAMIC" | "INTERACTIVE")[];
24
+ export declare const PROBLEM_TYPE: {
25
+ [Key in ProblemType]: {
26
+ value: ProblemType;
27
+ label: string;
28
+ description: string;
29
+ };
30
+ };
31
+ export declare const PROBLEM_ROLE: {
32
+ [Key in ProblemRole]: {
33
+ value: ProblemRole;
34
+ label: string;
35
+ level: number;
36
+ };
37
+ };