@juki-team/commons 0.1.47 → 0.1.48

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 (191) hide show
  1. package/dist/{types/constants → constants}/commons.d.ts +1 -1
  2. package/dist/constants/commons.js +648 -0
  3. package/dist/{types/constants → constants}/contest.d.ts +1 -1
  4. package/dist/constants/contest.js +28 -0
  5. package/dist/{types/constants → constants}/course.d.ts +1 -1
  6. package/dist/constants/course.js +12 -0
  7. package/dist/constants/date.js +23 -0
  8. package/dist/constants/email.js +34 -0
  9. package/dist/{types/constants → constants}/entity.d.ts +1 -1
  10. package/dist/constants/entity.js +18 -0
  11. package/dist/{types/constants → constants}/file.d.ts +1 -1
  12. package/dist/constants/file.js +45 -0
  13. package/dist/constants/index.d.ts +18 -0
  14. package/dist/constants/index.js +18 -0
  15. package/dist/{types/constants → constants}/judge.d.ts +1 -1
  16. package/dist/constants/judge.js +225 -0
  17. package/dist/{types/constants → constants}/organization.d.ts +1 -1
  18. package/dist/constants/organization.js +24 -0
  19. package/dist/{types/constants → constants}/problem.d.ts +1 -1
  20. package/dist/constants/problem.js +69 -0
  21. package/dist/constants/routing.js +7 -0
  22. package/dist/{types/constants → constants}/services.d.ts +1 -1
  23. package/dist/constants/services.js +157 -0
  24. package/dist/{types/constants → constants}/system.d.ts +1 -1
  25. package/dist/constants/system.js +9 -0
  26. package/dist/{types/constants → constants}/teams.d.ts +1 -1
  27. package/dist/constants/teams.js +17 -0
  28. package/dist/constants/time.js +9 -0
  29. package/dist/{types/constants → constants}/user.d.ts +2 -2
  30. package/dist/constants/user.js +40 -0
  31. package/dist/{types/constants → constants}/websocket.d.ts +1 -1
  32. package/dist/constants/websocket.js +56 -0
  33. package/dist/{types/constants → constants}/worksheet.d.ts +1 -1
  34. package/dist/constants/worksheet.js +66 -0
  35. package/dist/{types/dto → dto}/class.d.ts +3 -3
  36. package/dist/dto/class.js +1 -0
  37. package/dist/{types/dto → dto}/code.d.ts +1 -1
  38. package/dist/dto/code.js +1 -0
  39. package/dist/{types/dto → dto}/comments.d.ts +1 -1
  40. package/dist/dto/comments.js +1 -0
  41. package/dist/{types/dto → dto}/contest.d.ts +4 -4
  42. package/dist/dto/contest.js +7 -0
  43. package/dist/{types/dto → dto}/course.d.ts +4 -4
  44. package/dist/dto/course.js +1 -0
  45. package/dist/{types/dto → dto}/entity.d.ts +2 -2
  46. package/dist/dto/entity.js +5 -0
  47. package/dist/{types/dto → dto}/excalidraw.d.ts +3 -3
  48. package/dist/dto/excalidraw.js +1 -0
  49. package/dist/{types/dto → dto}/file.d.ts +2 -2
  50. package/dist/dto/file.js +1 -0
  51. package/dist/dto/image.js +1 -0
  52. package/dist/dto/index.d.ts +25 -0
  53. package/dist/dto/index.js +25 -0
  54. package/dist/{types/dto → dto}/judge.d.ts +1 -1
  55. package/dist/dto/judge.js +1 -0
  56. package/dist/{types/dto → dto}/markdown.d.ts +3 -3
  57. package/dist/dto/markdown.js +1 -0
  58. package/dist/{types/dto → dto}/mermaid.d.ts +3 -3
  59. package/dist/dto/mermaid.js +1 -0
  60. package/dist/{types/dto → dto}/organization.d.ts +3 -3
  61. package/dist/dto/organization.js +1 -0
  62. package/dist/{types/dto → dto}/problem.d.ts +3 -3
  63. package/dist/dto/problem.js +1 -0
  64. package/dist/{types/dto → dto}/scoreboard.d.ts +2 -2
  65. package/dist/dto/scoreboard.js +1 -0
  66. package/dist/{types/dto → dto}/session.d.ts +2 -2
  67. package/dist/dto/session.js +1 -0
  68. package/dist/{types/dto → dto}/socket.d.ts +3 -3
  69. package/dist/dto/socket.js +1 -0
  70. package/dist/{types/dto → dto}/statistics.d.ts +1 -1
  71. package/dist/dto/statistics.js +1 -0
  72. package/dist/{types/dto → dto}/submission.d.ts +3 -3
  73. package/dist/dto/submission.js +1 -0
  74. package/dist/{types/dto → dto}/system.d.ts +1 -1
  75. package/dist/dto/system.js +1 -0
  76. package/dist/dto/url.js +1 -0
  77. package/dist/{types/dto → dto}/user.d.ts +3 -3
  78. package/dist/dto/user.js +1 -0
  79. package/dist/{types/dto → dto}/virtual-user.d.ts +1 -1
  80. package/dist/dto/virtual-user.js +1 -0
  81. package/dist/{types/dto → dto}/worksheet-submissions.d.ts +3 -3
  82. package/dist/dto/worksheet-submissions.js +1 -0
  83. package/dist/{types/dto → dto}/worksheet.d.ts +3 -3
  84. package/dist/dto/worksheet.js +1 -0
  85. package/dist/{types/helpers → helpers}/class.d.ts +1 -1
  86. package/dist/helpers/class.js +10 -0
  87. package/dist/helpers/comments.js +4 -0
  88. package/dist/{types/helpers → helpers}/commons.d.ts +1 -1
  89. package/dist/helpers/commons.js +187 -0
  90. package/dist/{types/helpers → helpers}/contest.d.ts +1 -1
  91. package/dist/helpers/contest.js +21 -0
  92. package/dist/helpers/date.js +181 -0
  93. package/dist/{types/helpers → helpers}/document.d.ts +2 -2
  94. package/dist/helpers/document.js +51 -0
  95. package/dist/{types/helpers → helpers}/errors.d.ts +1 -1
  96. package/dist/helpers/errors.js +17 -0
  97. package/dist/helpers/file.js +4 -0
  98. package/dist/helpers/index.d.ts +17 -0
  99. package/dist/helpers/index.js +17 -0
  100. package/dist/helpers/interval.js +24 -0
  101. package/dist/{types/helpers → helpers}/judging.d.ts +1 -1
  102. package/dist/helpers/judging.js +124 -0
  103. package/dist/helpers/number.js +2 -0
  104. package/dist/helpers/object.js +33 -0
  105. package/dist/{types/helpers → helpers}/responses.d.ts +2 -2
  106. package/dist/helpers/responses.js +95 -0
  107. package/dist/{types/helpers → helpers}/socket.d.ts +2 -2
  108. package/dist/helpers/socket.js +279 -0
  109. package/dist/{types/helpers → helpers}/time.d.ts +1 -1
  110. package/dist/helpers/time.js +69 -0
  111. package/dist/{types/helpers → helpers}/user.d.ts +1 -1
  112. package/dist/helpers/user.js +14 -0
  113. package/dist/{types/helpers → helpers}/worksheet.d.ts +1 -1
  114. package/dist/helpers/worksheet.js +107 -0
  115. package/dist/index.d.ts +4 -0
  116. package/dist/index.js +4 -0
  117. package/dist/types/account.js +10 -0
  118. package/dist/types/{types/class.d.ts → class.d.ts} +2 -2
  119. package/dist/types/class.js +7 -0
  120. package/dist/types/comments.js +1 -0
  121. package/dist/types/{types/commons.d.ts → commons.d.ts} +1 -1
  122. package/dist/types/commons.js +69 -0
  123. package/dist/types/{types/contest.d.ts → contest.d.ts} +4 -4
  124. package/dist/types/contest.js +27 -0
  125. package/dist/types/{types/course.d.ts → course.d.ts} +1 -1
  126. package/dist/types/course.js +1 -0
  127. package/dist/types/entity.js +50 -0
  128. package/dist/types/{types/excalidraw.d.ts → excalidraw.d.ts} +1 -1
  129. package/dist/types/excalidraw.js +1 -0
  130. package/dist/types/{types/file.d.ts → file.d.ts} +2 -2
  131. package/dist/types/file.js +19 -0
  132. package/dist/types/{types/group.d.ts → group.d.ts} +1 -1
  133. package/dist/types/group.js +5 -0
  134. package/dist/types/index.d.ts +27 -4
  135. package/dist/types/index.js +27 -0
  136. package/dist/types/{types/judge.d.ts → judge.d.ts} +2 -2
  137. package/dist/types/judge.js +49 -0
  138. package/dist/types/{types/markdown.d.ts → markdown.d.ts} +1 -1
  139. package/dist/types/markdown.js +1 -0
  140. package/dist/types/{types/mermaid.d.ts → mermaid.d.ts} +1 -1
  141. package/dist/types/mermaid.js +1 -0
  142. package/dist/types/notification.js +8 -0
  143. package/dist/types/organization.js +14 -0
  144. package/dist/types/{types/prisma.d.ts → prisma.d.ts} +1 -1
  145. package/dist/types/prisma.js +106 -0
  146. package/dist/types/{types/problems.d.ts → problems.d.ts} +3 -3
  147. package/dist/types/problems.js +28 -0
  148. package/dist/types/scoreboard.js +1 -0
  149. package/dist/types/{types/services.d.ts → services.d.ts} +1 -1
  150. package/dist/types/services.js +152 -0
  151. package/dist/types/{types/sheet.d.ts → sheet.d.ts} +2 -2
  152. package/dist/types/sheet.js +16 -0
  153. package/dist/types/{types/socket.d.ts → socket.d.ts} +1 -1
  154. package/dist/types/socket.js +76 -0
  155. package/dist/types/submission.js +1 -0
  156. package/dist/types/system.js +1 -0
  157. package/dist/types/{types/teams.d.ts → teams.d.ts} +2 -2
  158. package/dist/types/teams.js +1 -0
  159. package/dist/types/{types/users.d.ts → users.d.ts} +2 -2
  160. package/dist/types/users.js +23 -0
  161. package/dist/types/virtual-user.js +8 -0
  162. package/dist/types/{types/worksheet.d.ts → worksheet.d.ts} +3 -3
  163. package/dist/types/worksheet.js +11 -0
  164. package/package.json +8 -11
  165. package/dist/cjs/index.cjs +0 -3700
  166. package/dist/esm/index.js +0 -3420
  167. package/dist/types/constants/index.d.ts +0 -18
  168. package/dist/types/dto/index.d.ts +0 -25
  169. package/dist/types/helpers/index.d.ts +0 -17
  170. package/dist/types/types/index.d.ts +0 -27
  171. /package/dist/{types/constants → constants}/date.d.ts +0 -0
  172. /package/dist/{types/constants → constants}/email.d.ts +0 -0
  173. /package/dist/{types/constants → constants}/routing.d.ts +0 -0
  174. /package/dist/{types/constants → constants}/time.d.ts +0 -0
  175. /package/dist/{types/dto → dto}/image.d.ts +0 -0
  176. /package/dist/{types/dto → dto}/url.d.ts +0 -0
  177. /package/dist/{types/helpers → helpers}/comments.d.ts +0 -0
  178. /package/dist/{types/helpers → helpers}/date.d.ts +0 -0
  179. /package/dist/{types/helpers → helpers}/file.d.ts +0 -0
  180. /package/dist/{types/helpers → helpers}/interval.d.ts +0 -0
  181. /package/dist/{types/helpers → helpers}/number.d.ts +0 -0
  182. /package/dist/{types/helpers → helpers}/object.d.ts +0 -0
  183. /package/dist/types/{types/account.d.ts → account.d.ts} +0 -0
  184. /package/dist/types/{types/comments.d.ts → comments.d.ts} +0 -0
  185. /package/dist/types/{types/entity.d.ts → entity.d.ts} +0 -0
  186. /package/dist/types/{types/notification.d.ts → notification.d.ts} +0 -0
  187. /package/dist/types/{types/organization.d.ts → organization.d.ts} +0 -0
  188. /package/dist/types/{types/scoreboard.d.ts → scoreboard.d.ts} +0 -0
  189. /package/dist/types/{types/submission.d.ts → submission.d.ts} +0 -0
  190. /package/dist/types/{types/system.d.ts → system.d.ts} +0 -0
  191. /package/dist/types/{types/virtual-user.d.ts → virtual-user.d.ts} +0 -0
@@ -0,0 +1,28 @@
1
+ import { ContestStatus, Role } from '../types/index.js';
2
+ export const CONTEST_STATUS = {
3
+ [ContestStatus.PUBLIC]: {
4
+ value: ContestStatus.PUBLIC,
5
+ label: 'public',
6
+ description: 'the contest will appear in the contest list and the users will have access according to their roles',
7
+ },
8
+ [ContestStatus.RESERVED]: {
9
+ value: ContestStatus.RESERVED,
10
+ label: 'reserved',
11
+ description: 'the contest will appear in the contest list only for contest members and the users will have access according to their roles',
12
+ },
13
+ [ContestStatus.ARCHIVED]: {
14
+ value: ContestStatus.ARCHIVED,
15
+ label: 'archived',
16
+ description: 'the contest will not appear for anyone, contact the administrator to see it again',
17
+ },
18
+ };
19
+ export const CONTEST_ROLE = {
20
+ [Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 7 },
21
+ [Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 6 },
22
+ [Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 5 },
23
+ [Role.CREATOR]: { value: Role.CREATOR, label: 'creator', level: 4 },
24
+ [Role.MANAGER]: { value: Role.MANAGER, label: 'manager', level: 3 },
25
+ [Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
26
+ [Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
27
+ [Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
28
+ };
@@ -1,4 +1,4 @@
1
- import { CourseRole } from '../types';
1
+ import { CourseRole } from '../types/index.js';
2
2
  export declare const COURSE_ROLE: {
3
3
  [key in CourseRole]: {
4
4
  value: CourseRole;
@@ -0,0 +1,12 @@
1
+ import { CourseRole } from '../types/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,23 @@
1
+ import { range } from '../helpers/commons.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,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>`;
@@ -1,3 +1,3 @@
1
- import { DocumentMembersResponseDto, EntityMembersResponseDto } from '../dto';
1
+ import { DocumentMembersResponseDto, EntityMembersResponseDto } from '../dto/index.js';
2
2
  export declare const EMPTY_DOCUMENT_MEMBERS: () => DocumentMembersResponseDto;
3
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
+ });
@@ -1,4 +1,4 @@
1
- import { EntityAccess, EntityState, FileRole, FileType } from '../types';
1
+ import { EntityAccess, EntityState, FileRole, FileType } from '../types/index.js';
2
2
  export declare const FILE_TYPE: {
3
3
  [key in FileType]: {
4
4
  value: FileType;
@@ -0,0 +1,45 @@
1
+ import { EntityAccess, EntityState, FileType, Role } from '../types/index.js';
2
+ export const FILE_TYPE = {
3
+ [FileType.FILE]: { value: FileType.FILE, label: 'file' },
4
+ [FileType.FOLDER]: { value: FileType.FOLDER, label: 'folder' },
5
+ };
6
+ export const FILE_ROLE = {
7
+ [Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 5 },
8
+ [Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 4 },
9
+ [Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 3 },
10
+ [Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
11
+ [Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
12
+ [Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
13
+ };
14
+ export const ENTITY_STATE = {
15
+ [EntityState.RELEASED]: {
16
+ value: EntityState.RELEASED,
17
+ label: 'released',
18
+ },
19
+ [EntityState.ARCHIVED]: {
20
+ value: EntityState.ARCHIVED,
21
+ label: 'archived',
22
+ },
23
+ };
24
+ export const ENTITY_ACCESS = {
25
+ [EntityAccess.PRIVATE]: {
26
+ value: EntityAccess.PRIVATE,
27
+ label: 'private',
28
+ description: 'the record will be visible and editable only to the owner',
29
+ },
30
+ [EntityAccess.RESTRICTED]: {
31
+ value: EntityAccess.RESTRICTED,
32
+ label: 'restricted',
33
+ description: 'the record will be visible to viewers and the owner and editable to editors and the owner',
34
+ },
35
+ [EntityAccess.PUBLIC]: {
36
+ value: EntityAccess.PUBLIC,
37
+ label: 'public',
38
+ description: 'the record will be visible to anyone and editable to editors and the owner',
39
+ },
40
+ [EntityAccess.EXPOSED]: {
41
+ value: EntityAccess.EXPOSED,
42
+ label: 'exposed',
43
+ description: 'the record will be visible and editable to anyone',
44
+ },
45
+ };
@@ -0,0 +1,18 @@
1
+ export * from './commons.js';
2
+ export * from './organization.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 './judge.js';
9
+ export * from './problem.js';
10
+ export * from './routing.js';
11
+ export * from './services.js';
12
+ export * from './file.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 './organization.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 './judge.js';
9
+ export * from './problem.js';
10
+ export * from './routing.js';
11
+ export * from './services.js';
12
+ export * from './file.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';
@@ -1,4 +1,4 @@
1
- import { CodeLanguage, Judge, ProblemScoringMode, ProblemType, ProblemVerdict, RunnerType, SubmissionRunStatus } from '../types';
1
+ import { CodeLanguage, Judge, ProblemScoringMode, ProblemType, ProblemVerdict, RunnerType, SubmissionRunStatus } from '../types/index.js';
2
2
  export type JudgeType = {
3
3
  [key in Judge]: {
4
4
  value: Judge;
@@ -0,0 +1,225 @@
1
+ import { CodeLanguage, Judge, ProblemScoringMode, ProblemType, ProblemVerdict, RunnerType, SubmissionRunStatus, } from '../types/index.js';
2
+ export const JUDGE = {
3
+ // [Judge.CUSTOMER]: {
4
+ // value: Judge.CUSTOMER,
5
+ // label: '',
6
+ // logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
7
+ // logoSize: [ 883.991, 435 ],
8
+ // url: '',
9
+ // // getLoginUrl: () => '',
10
+ // // getProfileUrl: () => '',
11
+ // // getSubmitUrl: () => '',
12
+ // // getSubmissionUrl: () => '',
13
+ // // getProblemUrl: (key: string) => `/problem/view/${key}`,
14
+ // // getUserSubmissionsUrl: () => '',
15
+ // },
16
+ [Judge.JUKI_JUDGE]: {
17
+ value: Judge.JUKI_JUDGE,
18
+ label: 'Juki Judge',
19
+ logo: 'https://images.juki.pub/c/juki-judge-logo-horizontal-color.svg',
20
+ logoSize: [883.991, 435],
21
+ url: 'https://judge.juki.app',
22
+ // getLoginUrl: () => '',
23
+ // getProfileUrl: () => '',
24
+ // getSubmitUrl: () => '',
25
+ // getSubmissionUrl: () => '',
26
+ // getProblemUrl: (key: string) => `https://judge.juki.app/problem/view/${key}`,
27
+ // getUserSubmissionsUrl: () => '',
28
+ },
29
+ [Judge.CODEFORCES]: {
30
+ value: Judge.CODEFORCES,
31
+ label: 'Codeforces',
32
+ logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
33
+ logoSize: [1232.75, 145.12],
34
+ url: 'https://codeforces.com',
35
+ // getLoginUrl: () => 'https://codeforces.com/enter',
36
+ // getProfileUrl: () => '',
37
+ // getSubmitUrl: () => 'https://codeforces.com/problemset/submit',
38
+ // getSubmissionUrl: (problemKey: string, submissionId: string) => {
39
+ // const [ contestId ] = problemKey.split('-');
40
+ // return `https://codeforces.com/problemset/submission/${contestId}/${submissionId}`;
41
+ // },
42
+ // getProblemUrl: (problemKey: string) => {
43
+ // const [ contestId, index ] = problemKey.split('-');
44
+ // return `https://codeforces.com/problemset/problem/${contestId}/${index}`;
45
+ // },
46
+ // getUserSubmissionsUrl: () => '',
47
+ },
48
+ [Judge.CODEFORCES_GYM]: {
49
+ value: Judge.CODEFORCES_GYM,
50
+ label: 'Codeforces Gym',
51
+ logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
52
+ logoSize: [1232.75, 145.12],
53
+ url: 'https://codeforces.com',
54
+ // getLoginUrl: () => 'https://codeforces.com/enter',
55
+ // getProfileUrl: () => '',
56
+ // getSubmitUrl: (problemKey: string) => {
57
+ // const [ gymContestId, index ] = problemKey.split('-');
58
+ // return `https://codeforces.com/gym/${gymContestId}/submit`;
59
+ // },
60
+ // getSubmissionUrl: (problemKey: string, submissionId: string) => {
61
+ // const [ gymContestId ] = problemKey.split('-');
62
+ // return `https://codeforces.com/gym/${gymContestId}/submission/${submissionId}`;
63
+ // },
64
+ // getProblemUrl: (problemKey: string) => {
65
+ // const [ gymContestId, index ] = problemKey.split('-');
66
+ // return `https://codeforces.com/gym/${gymContestId}/problem/${index}`;
67
+ // },
68
+ // getUserSubmissionsUrl: () => '',
69
+ },
70
+ [Judge.JV_UMSA]: {
71
+ value: Judge.JV_UMSA,
72
+ label: 'Juez Virtual UMSA',
73
+ logo: 'https://images.juki.pub/c/codeforces-logo-horizontal-color.svg',
74
+ logoSize: [1232.75, 145.12],
75
+ url: 'https://jv.umsa.bo',
76
+ // getLoginUrl: () => 'https://jv.umsa.bo/oj/login.php',
77
+ // getProfileUrl: () => 'https://jv.umsa.bo/oj/userInfo.php',
78
+ // getSubmitUrl: (problemKey: string) => {
79
+ // // single problem: '1019'
80
+ // // cib problem: '1019-A'
81
+ // const isContestProblem = problemKey.includes('-');
82
+ // // A -> 0, B -> 1, C -> 2, D -> 3, E -> 4, F -> 5, G -> 6, H -> 7, I -> 8, J -> 9
83
+ // const params = problemKey.split('-');
84
+ // return isContestProblem
85
+ // ? `https://jv.umsa.bo/oj/submitpage.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
86
+ // : `https://jv.umsa.bo/oj/submitpage.php?id=${problemKey}`;
87
+ // },
88
+ // getSubmissionUrl: (problemKey: string, submissionId: string, username: string) => {
89
+ // // return `https://jv.umsa.bo/status.php?problem_id=&user_id=${username}&language=-1&jresult=-1`;
90
+ // return `https://jv.umsa.bo/oj/showsource.php?id=${submissionId}`;
91
+ // },
92
+ // getProblemUrl: (problemKey: string) => {
93
+ // const isContestProblem = problemKey.includes('-');
94
+ // const params = problemKey.split('-');
95
+ // return isContestProblem
96
+ // ? `https://jv.umsa.bo/oj/problem.php?cid=${params[0]}&pid=${params[1].charCodeAt(0) - 65}`
97
+ // : `https://jv.umsa.bo/oj/problem.php?id=${problemKey}`;
98
+ // },
99
+ // getUserSubmissionsUrl: (username: string) => `https://jv.umsa.bo/oj/status.php?user_id=${username}`,
100
+ },
101
+ [Judge.UVA_ONLINE_JUDGE]: {
102
+ value: Judge.UVA_ONLINE_JUDGE,
103
+ label: 'Uva Online Judge',
104
+ logo: 'https://images.juki.pub/c/uva-online-judge-logo-color.png',
105
+ logoSize: [150, 135.994],
106
+ url: 'https://onlinejudge.org',
107
+ },
108
+ [Judge.AT_CODER]: {
109
+ value: Judge.AT_CODER,
110
+ label: 'AtCoder',
111
+ logo: 'https://images.juki.pub/c/at-coder-logo-color.png',
112
+ logoSize: [762.997, 675],
113
+ url: 'https://atcoder.jp',
114
+ },
115
+ [Judge.CODECHEF]: {
116
+ value: Judge.CODECHEF,
117
+ label: 'Codechef',
118
+ logo: 'https://images.juki.pub/c/codechef-logo-color.svg',
119
+ logoSize: [1207.7, 453.17],
120
+ url: 'https://www.codechef.com',
121
+ },
122
+ [Judge.TOPCODER]: {
123
+ value: Judge.TOPCODER,
124
+ label: 'Topcoder',
125
+ logo: 'https://images.juki.pub/c/topcoder-logo-color.png',
126
+ logoSize: [971.99, 415.99],
127
+ url: 'https://www.topcoder.com',
128
+ },
129
+ [Judge.LEETCODE]: {
130
+ value: Judge.LEETCODE,
131
+ label: 'LeetCode',
132
+ logo: 'https://images.juki.pub/assets/leetcode-logo-color.svg',
133
+ logoSize: [95, 111],
134
+ url: 'https://leetcode.com',
135
+ // getProblemUrl: (problemKey: string) => {
136
+ // return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}`;
137
+ // },
138
+ // getProfileUrl: (userNickname: string) => {
139
+ // return `https://leetcode.com/u/${userNickname}`;
140
+ // },
141
+ // getSubmissionUrl: (problemKey: string, submissionId: string, username: string, submissionRunId: string) => {
142
+ // return `https://leetcode.com/problems/${problemKey.replace('PL-', '')}/submissions/${submissionRunId}`;
143
+ // },
144
+ },
145
+ };
146
+ export const RUNNER_ACCEPTED_PROBLEM_MODES = [
147
+ ProblemScoringMode.TOTAL,
148
+ ProblemScoringMode.SUBTASK,
149
+ ProblemScoringMode.PARTIAL,
150
+ ];
151
+ export const RUNNER_ACCEPTED_PROBLEM_TYPES = [
152
+ ProblemType.STANDARD,
153
+ ProblemType.DYNAMIC,
154
+ ];
155
+ export const RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES = [
156
+ CodeLanguage.C_11,
157
+ CodeLanguage.CPP_11,
158
+ CodeLanguage.CPP_20,
159
+ CodeLanguage.JAVA_21,
160
+ CodeLanguage.PYTHON_3,
161
+ CodeLanguage.PYTHON_PYPY_3,
162
+ CodeLanguage.JAVASCRIPT_NODE_JS_22,
163
+ CodeLanguage.PSEUDOCODE_PSEINT,
164
+ ];
165
+ export const ACCEPTED_PROGRAMMING_LANGUAGES = [
166
+ ...RUNNER_ACCEPTED_PROGRAMMING_LANGUAGES,
167
+ ];
168
+ export const PROBLEM_VERDICT = {
169
+ [ProblemVerdict.NONE]: { value: ProblemVerdict.NONE, label: 'none', color: '#555555' },
170
+ [ProblemVerdict.PENDING]: { value: ProblemVerdict.PENDING, label: 'pending', color: '#79B6FD' },
171
+ [ProblemVerdict.HIDDEN]: { value: ProblemVerdict.HIDDEN, label: 'hidden', color: '#555555' },
172
+ [ProblemVerdict.AC]: { value: ProblemVerdict.AC, label: 'accepted', color: '#43D787' },
173
+ [ProblemVerdict.PE]: { value: ProblemVerdict.PE, label: 'presentation error', color: '#55db93' },
174
+ [ProblemVerdict.PA]: { value: ProblemVerdict.PA, label: 'partial accepted', color: '#55db93' },
175
+ [ProblemVerdict.CE]: { value: ProblemVerdict.CE, label: 'compilation error', color: '#FE9F9F' },
176
+ [ProblemVerdict.RE]: { value: ProblemVerdict.RE, label: 'runtime error', color: '#FE9F9F' },
177
+ [ProblemVerdict.TLE]: { value: ProblemVerdict.TLE, label: 'time limit exceed', color: '#FE9F9F' },
178
+ [ProblemVerdict.MLE]: { value: ProblemVerdict.MLE, label: 'memory limit exceed', color: '#FE9F9F' },
179
+ [ProblemVerdict.WA]: { value: ProblemVerdict.WA, label: 'wrong answer', color: '#FE9F9F' },
180
+ };
181
+ export const PROBLEM_VERDICTS = [
182
+ ProblemVerdict.NONE,
183
+ ProblemVerdict.PENDING,
184
+ ProblemVerdict.AC,
185
+ ProblemVerdict.PE,
186
+ ProblemVerdict.PA,
187
+ ProblemVerdict.CE,
188
+ ProblemVerdict.RE,
189
+ ProblemVerdict.TLE,
190
+ ProblemVerdict.MLE,
191
+ ProblemVerdict.WA,
192
+ ];
193
+ export const SUBMISSION_RUN_STATUS = {
194
+ [SubmissionRunStatus.NONE]: { value: SubmissionRunStatus.NONE, label: 'none' }, // status
195
+ [SubmissionRunStatus.RECEIVED]: { value: SubmissionRunStatus.RECEIVED, label: 'received' }, // state
196
+ [SubmissionRunStatus.COMPILING]: { value: SubmissionRunStatus.COMPILING, label: 'compiling' }, // state
197
+ [SubmissionRunStatus.COMPILED]: { value: SubmissionRunStatus.COMPILED, label: 'compiled' }, // status
198
+ [SubmissionRunStatus.COMPILATION_ERROR]: { value: SubmissionRunStatus.COMPILATION_ERROR, label: 'compilation error' }, // status
199
+ [SubmissionRunStatus.FETCHING_TEST_CASES]: {
200
+ value: SubmissionRunStatus.FETCHING_TEST_CASES,
201
+ label: 'fetching test cases',
202
+ }, // state
203
+ [SubmissionRunStatus.RUNNING_TEST_CASE]: { value: SubmissionRunStatus.RUNNING_TEST_CASE, label: 'running test case' }, // state
204
+ [SubmissionRunStatus.RUNNING_TEST_CASES]: {
205
+ value: SubmissionRunStatus.RUNNING_TEST_CASES,
206
+ label: 'running test cases',
207
+ }, // state
208
+ [SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES]: {
209
+ value: SubmissionRunStatus.RUNNING_SAMPLE_TEST_CASES,
210
+ label: 'running sample cases',
211
+ }, // state
212
+ [SubmissionRunStatus.EXECUTED_TEST_CASE]: {
213
+ value: SubmissionRunStatus.EXECUTED_TEST_CASE,
214
+ label: 'executed test case',
215
+ }, // status
216
+ [SubmissionRunStatus.FAILED_TEST_CASE]: { value: SubmissionRunStatus.FAILED_TEST_CASE, label: 'failed test case' }, // status
217
+ [SubmissionRunStatus.JUDGING_TEST_CASE]: { value: SubmissionRunStatus.JUDGING_TEST_CASE, label: 'judging test case' }, // state
218
+ [SubmissionRunStatus.GRADING]: { value: SubmissionRunStatus.GRADING, label: 'grading' }, // status
219
+ [SubmissionRunStatus.FAILED]: { value: SubmissionRunStatus.FAILED, label: 'failed' }, // status
220
+ [SubmissionRunStatus.COMPLETED]: { value: SubmissionRunStatus.COMPLETED, label: 'completed' }, // status
221
+ };
222
+ export const RUNNER_TYPE = {
223
+ [RunnerType.HIGH_PERFORMANCE]: { value: RunnerType.HIGH_PERFORMANCE, label: 'high performance' },
224
+ [RunnerType.LOW_PERFORMANCE]: { value: RunnerType.LOW_PERFORMANCE, label: 'low performance' },
225
+ };
@@ -1,4 +1,4 @@
1
- import { OrganizationPlan } from '../types/organization';
1
+ import { OrganizationPlan } from '../types/organization.js';
2
2
  export declare const JUKI_APP_ORGANIZATION_KEY = "juki-app";
3
3
  export declare const ORGANIZATION_PLAN: {
4
4
  [key in OrganizationPlan]: {
@@ -0,0 +1,24 @@
1
+ import { OrganizationPlan } from '../types/organization.js';
2
+ export const JUKI_APP_ORGANIZATION_KEY = 'juki-app';
3
+ export const ORGANIZATION_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
+ };
@@ -1,4 +1,4 @@
1
- import { ProblemInput, ProblemOutput, ProblemRole, ProblemScoringMode, ProblemType } from '../types';
1
+ import { ProblemInput, ProblemOutput, ProblemRole, ProblemScoringMode, ProblemType } from '../types/index.js';
2
2
  export declare const PROBLEM_INPUT: {
3
3
  [key in ProblemInput]: {
4
4
  value: ProblemInput;
@@ -0,0 +1,69 @@
1
+ import { ProblemInput, ProblemOutput, ProblemScoringMode, ProblemType, Role } from '../types/index.js';
2
+ export const PROBLEM_INPUT = {
3
+ [ProblemInput.STANDARD]: { value: ProblemInput.STANDARD, label: 'standard' },
4
+ [ProblemInput.INTERACTIVE]: { value: ProblemInput.INTERACTIVE, label: 'interactive' },
5
+ };
6
+ export const PROBLEM_OUTPUT = {
7
+ [ProblemOutput.STANDARD]: { value: ProblemOutput.STANDARD, label: 'standard' },
8
+ [ProblemOutput.DYNAMIC]: { value: ProblemOutput.DYNAMIC, label: 'dynamic' },
9
+ [ProblemOutput.INTERACTIVE]: { value: ProblemOutput.INTERACTIVE, label: 'interactive' },
10
+ };
11
+ export const PROBLEM_MODES = [ProblemScoringMode.TOTAL, ProblemScoringMode.SUBTASK, ProblemScoringMode.PARTIAL];
12
+ export const PROBLEM_MODE = {
13
+ [ProblemScoringMode.TOTAL]: {
14
+ value: ProblemScoringMode.TOTAL,
15
+ label: 'total',
16
+ description: 'if all test cases are Accepted the result is Accepted '
17
+ + 'otherwise it will be Runtime Error, Time Limited Exceeded, Memory Limited Exceeded, Wrong Answer or Presentation Error in that order.',
18
+ },
19
+ [ProblemScoringMode.SUBTASK]: {
20
+ value: ProblemScoringMode.SUBTASK,
21
+ label: 'subtask',
22
+ description: 'the test cases are grouped and each group of test cases is assigned a score, '
23
+ + 'if all test cases in a group are Accepted then the score assigned to that group of test cases is added to total score, '
24
+ + 'if total score is equal to the sum of the assigned scores of all groups of test cases then the result is Accepted, '
25
+ + 'otherwise if the total score is greater than zero the result is Partial Accepted with the total accumulated score, '
26
+ + 'otherwise it will be Runtime Error, Time Limited Exceeded, Memory Limited Exceeded, Wrong Answer or Presentation Error in that order.',
27
+ },
28
+ [ProblemScoringMode.PARTIAL]: {
29
+ value: ProblemScoringMode.PARTIAL,
30
+ label: 'partial',
31
+ description: 'the test cases are grouped and each group is associated with X points, '
32
+ + 'and each test case in a group scores X points ',
33
+ },
34
+ };
35
+ export const PROBLEM_TYPES = [ProblemType.STANDARD, ProblemType.DYNAMIC, ProblemType.INTERACTIVE];
36
+ export const PROBLEM_TYPE = {
37
+ [ProblemType.STANDARD]: {
38
+ value: ProblemType.STANDARD,
39
+ label: 'standard',
40
+ description: 'The contestant submit a single source code in one of the allowed programming languages. '
41
+ + 'The source code is either standalone or to be compiled. '
42
+ + 'The resulting user\'s executable does I/O standard input and output. '
43
+ + 'The output produced by the contestant\'s program is then compared to the correct output using a simple diff algorithm.',
44
+ },
45
+ [ProblemType.INTERACTIVE]: {
46
+ value: ProblemType.INTERACTIVE, label: 'interactive', description: 'developing..',
47
+ },
48
+ [ProblemType.DYNAMIC]: {
49
+ value: ProblemType.DYNAMIC,
50
+ label: 'dynamic',
51
+ description: 'The contestant submit a single source code in one of the allowed programming languages. '
52
+ + 'The user\'s source code is either standalone or to be compiled. '
53
+ + 'The resulting user\'s executable does I/O standard input and output. '
54
+ + 'The output produced by the contestant\'s program is saved. '
55
+ + 'The problem editor save a single source code in C++ 17. '
56
+ + 'The editor\'s source code can read judge input filepath argv[1], judge output filepath argv[2], user\'s output filepath argv[3], user\'s error filepath argv[4], user\'s log filepath argv[5], user\'s source filepath argv[6] and submission information filepath argv[7] (companyId, submitId, runId, userId, contestId, problemId, language, userNickname, timestamp). '
57
+ + 'The resulting editor\'s executable should be "AC" or a number between 1 and 100 for partial accepted',
58
+ },
59
+ };
60
+ export const PROBLEM_ROLE = {
61
+ [Role.RESTRICTED]: { value: Role.RESTRICTED, label: 'restricted', level: 7 },
62
+ [Role.GUEST]: { value: Role.GUEST, label: 'guest', level: 6 },
63
+ [Role.REGULAR]: { value: Role.REGULAR, label: 'regular', level: 5 },
64
+ [Role.CREATOR]: { value: Role.CREATOR, label: 'creator', level: 4 },
65
+ [Role.MANAGER]: { value: Role.MANAGER, label: 'manager', level: 3 },
66
+ [Role.MASTER]: { value: Role.MASTER, label: 'master', level: 2 },
67
+ [Role.ADMIN]: { value: Role.ADMIN, label: 'admin', level: 1 },
68
+ [Role.SUPER_ADMIN]: { value: Role.SUPER_ADMIN, label: 'super admin', level: 0 },
69
+ };
@@ -0,0 +1,7 @@
1
+ export const _TYPE = ':type';
2
+ export const _KEY = ':key';
3
+ export const _TAB = ':tab';
4
+ export const _SUB_TAB = ':subTab?';
5
+ export const _SUB_SUB_TAB = ':subSubTab?';
6
+ export const PAGE = 'page';
7
+ export const PAGE_SIZE = 'size';
@@ -1,4 +1,4 @@
1
- import { ErrorCode } from '../types';
1
+ import { ErrorCode } from '../types/index.js';
2
2
  export declare const ERROR: {
3
3
  [key in ErrorCode]: {
4
4
  value: ErrorCode;