@juki-team/commons 0.1.32 → 0.2.1

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 (97) hide show
  1. package/dist/constants/commons.d.ts +1 -1
  2. package/dist/constants/commons.js +1 -1
  3. package/dist/constants/index.d.ts +1 -1
  4. package/dist/constants/index.js +1 -1
  5. package/dist/dto/index.d.ts +2 -1
  6. package/dist/dto/index.js +2 -1
  7. package/dist/helpers/array.d.ts +3 -0
  8. package/dist/helpers/array.js +28 -0
  9. package/dist/helpers/console.d.ts +3 -0
  10. package/dist/helpers/console.js +9 -0
  11. package/dist/helpers/date.d.ts +68 -0
  12. package/dist/helpers/date.js +181 -0
  13. package/dist/helpers/document.d.ts +1 -11
  14. package/dist/helpers/document.js +1 -21
  15. package/dist/helpers/duration.d.ts +2 -0
  16. package/dist/helpers/duration.js +57 -0
  17. package/dist/helpers/entity.d.ts +11 -0
  18. package/dist/helpers/entity.js +20 -0
  19. package/dist/helpers/file.d.ts +6 -1
  20. package/dist/helpers/file.js +23 -2
  21. package/dist/helpers/http.d.ts +1 -0
  22. package/dist/helpers/http.js +8 -0
  23. package/dist/helpers/index.d.ts +12 -3
  24. package/dist/helpers/index.js +12 -3
  25. package/dist/helpers/json.d.ts +3 -0
  26. package/dist/helpers/json.js +31 -0
  27. package/dist/helpers/number.d.ts +2 -0
  28. package/dist/helpers/number.js +2 -0
  29. package/dist/helpers/object.d.ts +2 -0
  30. package/dist/helpers/object.js +28 -0
  31. package/dist/helpers/problem.d.ts +2 -0
  32. package/dist/helpers/problem.js +1 -0
  33. package/dist/helpers/responses.d.ts +1 -1
  34. package/dist/helpers/responses.js +3 -2
  35. package/dist/helpers/string.d.ts +7 -0
  36. package/dist/helpers/string.js +52 -0
  37. package/dist/index.d.ts +0 -1
  38. package/dist/index.js +0 -1
  39. package/dist/prisma/enums/index.d.ts +11 -11
  40. package/dist/prisma/enums/index.js +11 -11
  41. package/dist/types/assignment.d.ts +28 -0
  42. package/dist/types/assignment.js +7 -0
  43. package/dist/types/class.d.ts +1 -27
  44. package/dist/types/class.js +1 -7
  45. package/dist/types/code.d.ts +39 -0
  46. package/dist/types/{commons.js → code.js} +0 -28
  47. package/dist/types/contest.d.ts +2 -2
  48. package/dist/types/device.d.ts +7 -0
  49. package/dist/types/device.js +1 -0
  50. package/dist/types/duration.d.ts +7 -0
  51. package/dist/types/duration.js +1 -0
  52. package/dist/types/entity.d.ts +12 -0
  53. package/dist/types/entity.js +14 -0
  54. package/dist/types/id.d.ts +3 -0
  55. package/dist/types/id.js +1 -0
  56. package/dist/types/index.d.ts +10 -5
  57. package/dist/types/index.js +10 -5
  58. package/dist/types/judge.d.ts +1 -1
  59. package/dist/types/{problems.d.ts → problem.d.ts} +2 -1
  60. package/dist/types/services.d.ts +1 -1
  61. package/dist/types/socket.d.ts +1 -1
  62. package/dist/types/state.d.ts +12 -0
  63. package/dist/types/state.js +14 -0
  64. package/dist/types/teams.d.ts +1 -1
  65. package/dist/types/text.d.ts +4 -0
  66. package/dist/types/text.js +1 -0
  67. package/dist/types/{users.d.ts → user.d.ts} +1 -1
  68. package/dist/types/{users.js → user.js} +1 -1
  69. package/dist/types/worksheet.d.ts +105 -2
  70. package/dist/types/worksheet.js +16 -0
  71. package/package.json +21 -4
  72. package/dist/helpers/commons.d.ts +0 -33
  73. package/dist/helpers/commons.js +0 -191
  74. package/dist/helpers/time.d.ts +0 -13
  75. package/dist/helpers/time.js +0 -101
  76. package/dist/prototypes/Date.d.ts +0 -62
  77. package/dist/prototypes/Date.js +0 -218
  78. package/dist/prototypes/Number.d.ts +0 -7
  79. package/dist/prototypes/Number.js +0 -8
  80. package/dist/prototypes/index.d.ts +0 -3
  81. package/dist/prototypes/index.js +0 -3
  82. package/dist/types/commons.d.ts +0 -84
  83. package/dist/types/sheet.d.ts +0 -104
  84. package/dist/types/sheet.js +0 -16
  85. /package/dist/constants/{time.d.ts → duration.d.ts} +0 -0
  86. /package/dist/constants/{time.js → duration.js} +0 -0
  87. /package/dist/dto/{virtual-user.d.ts → virtualUser.d.ts} +0 -0
  88. /package/dist/dto/{virtual-user.js → virtualUser.js} +0 -0
  89. /package/dist/dto/{worksheet-submissions.d.ts → worksheetSubmission.d.ts} +0 -0
  90. /package/dist/dto/{worksheet-submissions.js → worksheetSubmission.js} +0 -0
  91. /package/dist/helpers/{class.d.ts → assignment.d.ts} +0 -0
  92. /package/dist/helpers/{class.js → assignment.js} +0 -0
  93. /package/dist/{prototypes/Error.d.ts → helpers/errors.d.ts} +0 -0
  94. /package/dist/{prototypes/Error.js → helpers/errors.js} +0 -0
  95. /package/dist/types/{problems.js → problem.js} +0 -0
  96. /package/dist/types/{account.d.ts → profile.d.ts} +0 -0
  97. /package/dist/types/{account.js → profile.js} +0 -0
@@ -0,0 +1,2 @@
1
+ export const padStart = (n, maxLength, fillString = '0') => `${n}`.padStart(maxLength, fillString);
2
+ export const padEnd = (n, maxLength, fillString = '0') => `${n}`.padEnd(maxLength, fillString);
@@ -1 +1,3 @@
1
1
  export declare function memorySizeOf(obj: unknown): number;
2
+ export declare function objectUpdate(base: unknown, update: unknown): unknown;
3
+ export declare function objectsUpdate(base: Record<string, unknown>, ...objects: Record<string, unknown>[]): Record<string, unknown>;
@@ -30,3 +30,31 @@ function sizeOf(obj) {
30
30
  export function memorySizeOf(obj) {
31
31
  return sizeOf(obj);
32
32
  }
33
+ function mergeRecords(b, u) {
34
+ const mergeKeys = new Set([...Object.keys(b), ...Object.keys(u)]);
35
+ for (const key of mergeKeys) {
36
+ if (u[key] !== null && u[key] !== undefined && b[key] !== u[key]) {
37
+ b[key] = objectUpdate(b[key], u[key]);
38
+ }
39
+ }
40
+ return b;
41
+ }
42
+ export function objectUpdate(base, update) {
43
+ if (JSON.stringify(base) === JSON.stringify(update)) {
44
+ return base;
45
+ }
46
+ if (base !== null && update !== null && !Array.isArray(base) && typeof base === 'object' && typeof update === 'object') {
47
+ return mergeRecords(base, update);
48
+ }
49
+ if (update !== null && update !== undefined) {
50
+ return update;
51
+ }
52
+ return base;
53
+ }
54
+ export function objectsUpdate(base, ...objects) {
55
+ let newObject = { ...base };
56
+ for (const update of objects) {
57
+ newObject = objectUpdate(newObject, update);
58
+ }
59
+ return newObject;
60
+ }
@@ -0,0 +1,2 @@
1
+ import type { Judge } from '../types/index.js';
2
+ export declare const getProblemJudgeKey: (judge: Judge, key: string) => string;
@@ -0,0 +1 @@
1
+ export const getProblemJudgeKey = (judge, key) => `${judge}-${key}`;
@@ -1,5 +1,5 @@
1
- import { JkError } from '../prototypes/index.js';
2
1
  import { type ContentResponse, type ContentsMeta, type ContentsResponse, type ErrorResponse } from '../types/index.js';
2
+ import { JkError } from './errors.js';
3
3
  export declare function toJkError(err: unknown): JkError;
4
4
  export declare function errorsResponse(message: string, ...errors: JkError[]): ErrorResponse;
5
5
  export declare function contentResponse<T>(message: string, content: T): ContentResponse<T>;
@@ -1,7 +1,8 @@
1
1
  import { getErrorMessage } from '../constants/index.js';
2
- import { JkError } from '../prototypes/index.js';
3
2
  import { ErrorCode, } from '../types/index.js';
4
- import { consoleError, isStringJson } from './commons.js';
3
+ import { consoleError } from './console.js';
4
+ import { JkError } from './errors.js';
5
+ import { isStringJson } from './json.js';
5
6
  export function toJkError(err) {
6
7
  const error = new Error();
7
8
  let code = err?.code;
@@ -0,0 +1,7 @@
1
+ export declare const indexToLetters: (index: number) => string;
2
+ export declare const lettersToIndex: (index: string) => number;
3
+ export declare const chunkString: (str: string, size: number) => string[];
4
+ export declare const getRandomString: (length: number) => string;
5
+ export declare const stringToArrayBuffer: (str: string) => ArrayBuffer;
6
+ export declare const join: (array: (string | null | Date)[]) => string;
7
+ export declare const split: (text: string) => string[];
@@ -0,0 +1,52 @@
1
+ import { SEPARATOR_TOKEN, UPPERCASE_LETTERS } from '../constants/commons.js';
2
+ export const indexToLetters = (index) => {
3
+ const d = Math.ceil(index / 26);
4
+ if (d === 1) {
5
+ return UPPERCASE_LETTERS.charAt(index - 1);
6
+ }
7
+ return UPPERCASE_LETTERS.charAt(d - 2) + UPPERCASE_LETTERS.charAt(index - 26 * (d - 1) - 1);
8
+ };
9
+ export const lettersToIndex = (index) => {
10
+ if (index.length) {
11
+ if (index.length === 1) {
12
+ const d = UPPERCASE_LETTERS.indexOf(index);
13
+ if (d !== -1) {
14
+ return d + 1;
15
+ }
16
+ }
17
+ else if (index.length === 2) {
18
+ const a = index.charAt(0);
19
+ const b = index.charAt(1);
20
+ const numA = lettersToIndex(a);
21
+ const numB = lettersToIndex(b);
22
+ return numA * 26 + numB;
23
+ }
24
+ }
25
+ return 0;
26
+ };
27
+ export const chunkString = (str, size) => {
28
+ const numChunks = Math.ceil(str.length / size);
29
+ const chunks = new Array(numChunks);
30
+ for (let i = 0, o = 0; i < numChunks; ++i, o += size) {
31
+ chunks[i] = str.substr(o, size);
32
+ }
33
+ return chunks;
34
+ };
35
+ export const getRandomString = (length) => {
36
+ const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
37
+ let retVal = '';
38
+ for (let i = 0; i < length; ++i) {
39
+ retVal += charset.charAt(Math.floor(Math.random() * charset.length));
40
+ }
41
+ return retVal;
42
+ };
43
+ export const stringToArrayBuffer = (str) => {
44
+ const buf = new ArrayBuffer(str.length);
45
+ const view = new Uint8Array(buf);
46
+ for (let i = 0; i < str.length; i++) {
47
+ view[i] = str.charCodeAt(i) & 0xff;
48
+ }
49
+ return buf;
50
+ };
51
+ export const join = (array) => array.join(SEPARATOR_TOKEN);
52
+ export const split = (text) => text.split(SEPARATOR_TOKEN);
package/dist/index.d.ts CHANGED
@@ -2,5 +2,4 @@ export * from './constants/index.js';
2
2
  export * from './dto/index.js';
3
3
  export * from './helpers/index.js';
4
4
  export * from './prisma/enums/index.js';
5
- export * from './prototypes/index.js';
6
5
  export * from './types/index.js';
package/dist/index.js CHANGED
@@ -2,5 +2,4 @@ export * from './constants/index.js';
2
2
  export * from './dto/index.js';
3
3
  export * from './helpers/index.js';
4
4
  export * from './prisma/enums/index.js';
5
- export * from './prototypes/index.js';
6
5
  export * from './types/index.js';
@@ -1,26 +1,26 @@
1
1
  export { AssignmentClassType } from './AssignmentClassType.js';
2
- export { ContestStatus } from './ContestStatus.js';
3
- export { ContestProblemPrerequisiteType } from './ContestProblemPrerequisiteType.js';
4
2
  export { ContestEventAction } from './ContestEventAction.js';
3
+ export { ContestProblemPrerequisiteType } from './ContestProblemPrerequisiteType.js';
4
+ export { ContestRole } from './ContestRole.js';
5
+ export { ContestStatus } from './ContestStatus.js';
6
+ export { CourseRole } from './CourseRole.js';
5
7
  export { EntityObjectType } from './EntityObjectType.js';
6
- export { EntitySubjectType } from './EntitySubjectType.js';
7
8
  export { EntityRole } from './EntityRole.js';
8
- export { ShareLinkVisibility } from './ShareLinkVisibility.js';
9
+ export { EntitySubjectType } from './EntitySubjectType.js';
10
+ export { FileRole } from './FileRole.js';
9
11
  export { FileType } from './FileType.js';
10
12
  export { GroupType } from './GroupType.js';
11
13
  export { JudgeType } from './JudgeType.js';
12
14
  export { OrganizationPlan } from './OrganizationPlan.js';
13
- export { ProblemType } from './ProblemType.js';
15
+ export { ProblemRole } from './ProblemRole.js';
14
16
  export { ProblemScoringMode } from './ProblemScoringMode.js';
17
+ export { ProblemType } from './ProblemType.js';
15
18
  export { ProblemVerdict } from './ProblemVerdict.js';
19
+ export { ShareLinkVisibility } from './ShareLinkVisibility.js';
16
20
  export { SubmissionRunStatus } from './SubmissionRunStatus.js';
17
- export { TelemetryType } from './TelemetryType.js';
18
- export { UserRole } from './UserRole.js';
19
21
  export { SystemRole } from './SystemRole.js';
20
- export { ProblemRole } from './ProblemRole.js';
21
- export { ContestRole } from './ContestRole.js';
22
22
  export { TeamRole } from './TeamRole.js';
23
- export { CourseRole } from './CourseRole.js';
24
- export { FileRole } from './FileRole.js';
23
+ export { TelemetryType } from './TelemetryType.js';
24
+ export { UserRole } from './UserRole.js';
25
25
  export { WorkingIn } from './WorkingIn.js';
26
26
  export { WorksheetContentType } from './WorksheetContentType.js';
@@ -1,26 +1,26 @@
1
1
  export { AssignmentClassType } from './AssignmentClassType.js';
2
- export { ContestStatus } from './ContestStatus.js';
3
- export { ContestProblemPrerequisiteType } from './ContestProblemPrerequisiteType.js';
4
2
  export { ContestEventAction } from './ContestEventAction.js';
3
+ export { ContestProblemPrerequisiteType } from './ContestProblemPrerequisiteType.js';
4
+ export { ContestRole } from './ContestRole.js';
5
+ export { ContestStatus } from './ContestStatus.js';
6
+ export { CourseRole } from './CourseRole.js';
5
7
  export { EntityObjectType } from './EntityObjectType.js';
6
- export { EntitySubjectType } from './EntitySubjectType.js';
7
8
  export { EntityRole } from './EntityRole.js';
8
- export { ShareLinkVisibility } from './ShareLinkVisibility.js';
9
+ export { EntitySubjectType } from './EntitySubjectType.js';
10
+ export { FileRole } from './FileRole.js';
9
11
  export { FileType } from './FileType.js';
10
12
  export { GroupType } from './GroupType.js';
11
13
  export { JudgeType } from './JudgeType.js';
12
14
  export { OrganizationPlan } from './OrganizationPlan.js';
13
- export { ProblemType } from './ProblemType.js';
15
+ export { ProblemRole } from './ProblemRole.js';
14
16
  export { ProblemScoringMode } from './ProblemScoringMode.js';
17
+ export { ProblemType } from './ProblemType.js';
15
18
  export { ProblemVerdict } from './ProblemVerdict.js';
19
+ export { ShareLinkVisibility } from './ShareLinkVisibility.js';
16
20
  export { SubmissionRunStatus } from './SubmissionRunStatus.js';
17
- export { TelemetryType } from './TelemetryType.js';
18
- export { UserRole } from './UserRole.js';
19
21
  export { SystemRole } from './SystemRole.js';
20
- export { ProblemRole } from './ProblemRole.js';
21
- export { ContestRole } from './ContestRole.js';
22
22
  export { TeamRole } from './TeamRole.js';
23
- export { CourseRole } from './CourseRole.js';
24
- export { FileRole } from './FileRole.js';
23
+ export { TelemetryType } from './TelemetryType.js';
24
+ export { UserRole } from './UserRole.js';
25
25
  export { WorkingIn } from './WorkingIn.js';
26
26
  export { WorksheetContentType } from './WorksheetContentType.js';
@@ -0,0 +1,28 @@
1
+ import type { EntityState } from './entity.js';
2
+ import type { BodyWorksheet } from './worksheet.js';
3
+ export declare enum AssignmentClass {
4
+ NONE = "NONE",
5
+ COURSE = "COURSE",
6
+ WORKSHEET = "WORKSHEET",
7
+ CONTEST = "CONTEST"
8
+ }
9
+ export interface AssignmentBasicInfo {
10
+ id: string;
11
+ index: number;
12
+ type: AssignmentClass;
13
+ points: number;
14
+ startTimestamp: number;
15
+ endTimestamp: number;
16
+ title: string;
17
+ content: BodyWorksheet[];
18
+ tags: string[];
19
+ graded: boolean;
20
+ visible: boolean;
21
+ }
22
+ export interface ClassCycleSessionAssignment extends AssignmentBasicInfo {
23
+ entityId: string;
24
+ state: EntityState;
25
+ }
26
+ export interface ClassCycleSessionAssignments {
27
+ [key: string]: ClassCycleSessionAssignment;
28
+ }
@@ -0,0 +1,7 @@
1
+ export var AssignmentClass;
2
+ (function (AssignmentClass) {
3
+ AssignmentClass["NONE"] = "NONE";
4
+ AssignmentClass["COURSE"] = "COURSE";
5
+ AssignmentClass["WORKSHEET"] = "WORKSHEET";
6
+ AssignmentClass["CONTEST"] = "CONTEST";
7
+ })(AssignmentClass || (AssignmentClass = {}));
@@ -1,31 +1,5 @@
1
+ import type { ClassCycleSessionAssignments } from './assignment.js';
1
2
  import type { EntityMembers, EntityState } from './entity.js';
2
- import type { BodyWorksheet } from './sheet.js';
3
- export declare enum AssignmentClass {
4
- NONE = "NONE",
5
- COURSE = "COURSE",
6
- WORKSHEET = "WORKSHEET",
7
- CONTEST = "CONTEST"
8
- }
9
- export interface AssignmentBasicInfo {
10
- id: string;
11
- index: number;
12
- type: AssignmentClass;
13
- points: number;
14
- startTimestamp: number;
15
- endTimestamp: number;
16
- title: string;
17
- content: BodyWorksheet[];
18
- tags: string[];
19
- graded: boolean;
20
- visible: boolean;
21
- }
22
- export interface ClassCycleSessionAssignment extends AssignmentBasicInfo {
23
- entityId: string;
24
- state: EntityState;
25
- }
26
- export interface ClassCycleSessionAssignments {
27
- [key: string]: ClassCycleSessionAssignment;
28
- }
29
3
  interface ClassCycleSession {
30
4
  id: string;
31
5
  index: number;
@@ -1,7 +1 @@
1
- export var AssignmentClass;
2
- (function (AssignmentClass) {
3
- AssignmentClass["NONE"] = "NONE";
4
- AssignmentClass["COURSE"] = "COURSE";
5
- AssignmentClass["WORKSHEET"] = "WORKSHEET";
6
- AssignmentClass["CONTEST"] = "CONTEST";
7
- })(AssignmentClass || (AssignmentClass = {}));
1
+ export {};
@@ -0,0 +1,39 @@
1
+ export declare enum CodeLanguage {
2
+ C_11 = "c11",
3
+ CPP_11 = "cpp11",
4
+ CPP_20 = "cpp20",
5
+ JAVA_21 = "java21",
6
+ PYTHON_3 = "python3",
7
+ PYTHON_PYPY_3 = "pypy3",
8
+ JAVASCRIPT_NODE_JS_22 = "nodejs22",
9
+ PYTHON_2 = "python2",
10
+ PYTHON_PYPY_2 = "pypy2",
11
+ ICPC_C = "ICPC_C",
12
+ C = "C",
13
+ CPP = "CPP",
14
+ ICPC_CPP = "ICPC_CPP",
15
+ CPP11 = "CPP11",
16
+ CPP14 = "CPP14",
17
+ CPP17 = "CPP17",
18
+ JAVA = "JAVA",
19
+ ICPC_PYTHON = "ICPC_PYTHON",
20
+ PYTHON = "PYTHON",
21
+ PYTHON2 = "PYTHON2",
22
+ PYTHON3 = "PYTHON3",
23
+ JAVASCRIPT = "JAVASCRIPT",
24
+ TYPESCRIPT = "TYPESCRIPT",
25
+ JSX = "JSX",
26
+ TSX = "TSX",
27
+ MDX = "MDX",
28
+ PSEUDOCODE_PSEINT = "PSEUDOCODE_PSEINT",
29
+ LATEX = "LATEX",
30
+ JSON = "JSON",
31
+ HTML = "HTML",
32
+ TEXT = "TEXT",
33
+ DIFF = "DIFF",
34
+ MARKDOWN = "MARKDOWN",
35
+ ARDUINO = "ARDUINO",
36
+ DOT = "DOT",
37
+ MERMAID = "MERMAID",
38
+ BASH = "BASH"
39
+ }
@@ -39,31 +39,3 @@ export var CodeLanguage;
39
39
  CodeLanguage["MERMAID"] = "MERMAID";
40
40
  CodeLanguage["BASH"] = "BASH";
41
41
  })(CodeLanguage || (CodeLanguage = {}));
42
- export var ScopeData;
43
- (function (ScopeData) {
44
- ScopeData["USER"] = "USER";
45
- ScopeData["PROBLEM"] = "PROBLEM";
46
- ScopeData["CONTEST"] = "CONTEST";
47
- ScopeData["ATTEMPT"] = "ATTEMPT";
48
- })(ScopeData || (ScopeData = {}));
49
- export var Status;
50
- (function (Status) {
51
- Status["SUCCESS"] = "SUCCESS";
52
- Status["ERROR"] = "ERROR";
53
- Status["LOADING"] = "LOADING";
54
- Status["NONE"] = "NONE";
55
- })(Status || (Status = {}));
56
- export var EntityStatus;
57
- (function (EntityStatus) {
58
- EntityStatus["PUBLIC"] = "PUBLIC";
59
- EntityStatus["RESERVED"] = "RESERVED";
60
- EntityStatus["PRIVATE"] = "PRIVATE";
61
- EntityStatus["ARCHIVED"] = "ARCHIVED";
62
- })(EntityStatus || (EntityStatus = {}));
63
- export var EntityAccess;
64
- (function (EntityAccess) {
65
- EntityAccess["PRIVATE"] = "PRIVATE";
66
- EntityAccess["RESTRICTED"] = "RESTRICTED";
67
- EntityAccess["PUBLIC"] = "PUBLIC";
68
- EntityAccess["EXPOSED"] = "EXPOSED";
69
- })(EntityAccess || (EntityAccess = {}));
@@ -1,9 +1,9 @@
1
1
  import type { ContestDataResponseDTO, UpsertContestDTO, UserOrganizationBasicInfoResponseDTO } from '../dto/index.js';
2
2
  import type { ContestEventAction, ContestProblemPrerequisiteType } from '../prisma/enums/index.js';
3
- import type { CodeLanguage } from './commons.js';
3
+ import type { CodeLanguage } from './code.js';
4
4
  import type { EntityMembers } from './entity.js';
5
5
  import type { Judge } from './judge.js';
6
- import type { UserBasicInfo } from './users.js';
6
+ import type { UserBasicInfo } from './user.js';
7
7
  export declare enum ContestTimeStatus {
8
8
  UPCOMING = "upcoming",
9
9
  LIVE = "live",
@@ -0,0 +1,7 @@
1
+ export type Device = {
2
+ label: string;
3
+ isMobile: boolean;
4
+ isBrowser: boolean;
5
+ type: string;
6
+ osLabel: string;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export type SplitTime = {
2
+ remaining: number;
3
+ label: string;
4
+ milliseconds: number;
5
+ abbreviatedLabel: string;
6
+ digits: number;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -8,6 +8,18 @@ export declare enum EntityState {
8
8
  RELEASED = "RELEASED",
9
9
  ARCHIVED = "ARCHIVED"
10
10
  }
11
+ export declare enum EntityStatus {
12
+ PUBLIC = "PUBLIC",
13
+ RESERVED = "RESERVED",
14
+ PRIVATE = "PRIVATE",
15
+ ARCHIVED = "ARCHIVED"
16
+ }
17
+ export declare enum EntityAccess {
18
+ PRIVATE = "PRIVATE",
19
+ RESTRICTED = "RESTRICTED",
20
+ PUBLIC = "PUBLIC",
21
+ EXPOSED = "EXPOSED"
22
+ }
11
23
  export type EntityUsersMemberUserData = {
12
24
  userId: string;
13
25
  lastVisitTimestamp: number | null;
@@ -9,6 +9,20 @@ export var EntityState;
9
9
  EntityState["RELEASED"] = "RELEASED";
10
10
  EntityState["ARCHIVED"] = "ARCHIVED";
11
11
  })(EntityState || (EntityState = {}));
12
+ export var EntityStatus;
13
+ (function (EntityStatus) {
14
+ EntityStatus["PUBLIC"] = "PUBLIC";
15
+ EntityStatus["RESERVED"] = "RESERVED";
16
+ EntityStatus["PRIVATE"] = "PRIVATE";
17
+ EntityStatus["ARCHIVED"] = "ARCHIVED";
18
+ })(EntityStatus || (EntityStatus = {}));
19
+ export var EntityAccess;
20
+ (function (EntityAccess) {
21
+ EntityAccess["PRIVATE"] = "PRIVATE";
22
+ EntityAccess["RESTRICTED"] = "RESTRICTED";
23
+ EntityAccess["PUBLIC"] = "PUBLIC";
24
+ EntityAccess["EXPOSED"] = "EXPOSED";
25
+ })(EntityAccess || (EntityAccess = {}));
12
26
  export var EntityCollection;
13
27
  (function (EntityCollection) {
14
28
  EntityCollection["COMPANY"] = "COMPANY";
@@ -0,0 +1,3 @@
1
+ export type RecordId = string | `${string & {
2
+ length: 24;
3
+ }}`;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,23 +1,28 @@
1
- export * from './account.js';
1
+ export * from './assignment.js';
2
2
  export * from './class.js';
3
+ export * from './code.js';
3
4
  export * from './comments.js';
4
- export * from './commons.js';
5
5
  export * from './company.js';
6
6
  export * from './contest.js';
7
7
  export * from './course.js';
8
+ export * from './device.js';
9
+ export * from './duration.js';
8
10
  export * from './entity.js';
9
11
  export * from './excalidraw.js';
10
12
  export * from './file.js';
11
13
  export * from './group.js';
14
+ export * from './id.js';
12
15
  export * from './judge.js';
13
16
  export * from './markdown.js';
14
17
  export * from './mermaid.js';
15
18
  export * from './notification.js';
16
- export * from './problems.js';
19
+ export * from './problem.js';
20
+ export * from './profile.js';
17
21
  export * from './services.js';
18
- export * from './sheet.js';
19
22
  export * from './socket.js';
23
+ export * from './state.js';
20
24
  export * from './submission.js';
21
25
  export * from './teams.js';
22
- export * from './users.js';
26
+ export * from './text.js';
27
+ export * from './user.js';
23
28
  export * from './worksheet.js';
@@ -1,23 +1,28 @@
1
- export * from './account.js';
1
+ export * from './assignment.js';
2
2
  export * from './class.js';
3
+ export * from './code.js';
3
4
  export * from './comments.js';
4
- export * from './commons.js';
5
5
  export * from './company.js';
6
6
  export * from './contest.js';
7
7
  export * from './course.js';
8
+ export * from './device.js';
9
+ export * from './duration.js';
8
10
  export * from './entity.js';
9
11
  export * from './excalidraw.js';
10
12
  export * from './file.js';
11
13
  export * from './group.js';
14
+ export * from './id.js';
12
15
  export * from './judge.js';
13
16
  export * from './markdown.js';
14
17
  export * from './mermaid.js';
15
18
  export * from './notification.js';
16
- export * from './problems.js';
19
+ export * from './problem.js';
20
+ export * from './profile.js';
17
21
  export * from './services.js';
18
- export * from './sheet.js';
19
22
  export * from './socket.js';
23
+ export * from './state.js';
20
24
  export * from './submission.js';
21
25
  export * from './teams.js';
22
- export * from './users.js';
26
+ export * from './text.js';
27
+ export * from './user.js';
23
28
  export * from './worksheet.js';
@@ -1,5 +1,5 @@
1
1
  import type { ProblemVerdict } from '../prisma/enums/index.js';
2
- import type { CodeLanguage } from './commons.js';
2
+ import type { CodeLanguage } from './code.js';
3
3
  import type { DataLog } from './submission.js';
4
4
  export type JudgeLanguage = {
5
5
  value: string;
@@ -1,7 +1,8 @@
1
1
  import type { ProblemScoringMode, ProblemType } from '../prisma/enums/index.js';
2
- import type { CodeLanguage, TextLanguage } from './commons.js';
2
+ import type { CodeLanguage } from './code.js';
3
3
  import type { EntityMembers } from './entity.js';
4
4
  import type { ProblemTestCase } from './services.js';
5
+ import type { TextLanguage } from './text.js';
5
6
  export interface TestCase {
6
7
  id: string;
7
8
  group: number;
@@ -1,4 +1,4 @@
1
- import type { CodeLanguage } from './commons.js';
1
+ import type { CodeLanguage } from './code.js';
2
2
  export declare enum ErrorCode {
3
3
  BAD_REQUEST = "BAD_REQUEST",
4
4
  UNAUTHORIZED = "UNAUTHORIZED",
@@ -1,4 +1,4 @@
1
- import type { RecordId } from './commons.js';
1
+ import type { RecordId } from './id.js';
2
2
  export declare enum WebSocketMessageEvent {
3
3
  PING = "PING",
4
4
  CLIENT_TRACK_LOCATION = "CLIENT_TRACK_LOCATION",
@@ -0,0 +1,12 @@
1
+ export declare enum ScopeData {
2
+ USER = "USER",
3
+ PROBLEM = "PROBLEM",
4
+ CONTEST = "CONTEST",
5
+ ATTEMPT = "ATTEMPT"
6
+ }
7
+ export declare enum Status {
8
+ SUCCESS = "SUCCESS",
9
+ ERROR = "ERROR",
10
+ LOADING = "LOADING",
11
+ NONE = "NONE"
12
+ }
@@ -0,0 +1,14 @@
1
+ export var ScopeData;
2
+ (function (ScopeData) {
3
+ ScopeData["USER"] = "USER";
4
+ ScopeData["PROBLEM"] = "PROBLEM";
5
+ ScopeData["CONTEST"] = "CONTEST";
6
+ ScopeData["ATTEMPT"] = "ATTEMPT";
7
+ })(ScopeData || (ScopeData = {}));
8
+ export var Status;
9
+ (function (Status) {
10
+ Status["SUCCESS"] = "SUCCESS";
11
+ Status["ERROR"] = "ERROR";
12
+ Status["LOADING"] = "LOADING";
13
+ Status["NONE"] = "NONE";
14
+ })(Status || (Status = {}));
@@ -1,4 +1,4 @@
1
- import type { UserBasic, UserProfile } from './users.js';
1
+ import type { UserBasic, UserProfile } from './user.js';
2
2
  export declare enum TeamStatus {
3
3
  ACTIVE = "ACTIVE",
4
4
  REPORTED = "REPORTED",
@@ -0,0 +1,4 @@
1
+ import type { Language } from './user.js';
2
+ export type TextLanguage = {
3
+ [Key in Language]: string;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { ContestRole, CourseRole, ProblemRole, SystemRole, TeamRole, UserRole } from '../prisma/enums/index.js';
2
- import { ProfileSetting } from './account.js';
2
+ import { ProfileSetting } from './profile.js';
3
3
  export interface UserBasicInfo {
4
4
  nickname: string;
5
5
  imageUrl: string;
@@ -1,4 +1,4 @@
1
- import { ProfileSetting } from './account.js';
1
+ import { ProfileSetting } from './profile.js';
2
2
  export var Language;
3
3
  (function (Language) {
4
4
  Language["ES"] = "ES";