@juki-team/commons 0.2.0 → 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 (91) 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/{date/index.d.ts → helpers/date.d.ts} +11 -0
  12. package/dist/{date/index.js → helpers/date.js} +24 -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/object.d.ts +2 -0
  28. package/dist/helpers/object.js +28 -0
  29. package/dist/helpers/problem.d.ts +2 -0
  30. package/dist/helpers/problem.js +1 -0
  31. package/dist/helpers/responses.d.ts +1 -1
  32. package/dist/helpers/responses.js +3 -2
  33. package/dist/helpers/string.d.ts +7 -0
  34. package/dist/helpers/string.js +52 -0
  35. package/dist/index.d.ts +0 -3
  36. package/dist/index.js +0 -3
  37. package/dist/prisma/enums/index.d.ts +11 -11
  38. package/dist/prisma/enums/index.js +11 -11
  39. package/dist/types/assignment.d.ts +28 -0
  40. package/dist/types/assignment.js +7 -0
  41. package/dist/types/class.d.ts +1 -27
  42. package/dist/types/class.js +1 -7
  43. package/dist/types/code.d.ts +39 -0
  44. package/dist/types/{commons.js → code.js} +0 -28
  45. package/dist/types/contest.d.ts +2 -2
  46. package/dist/types/device.d.ts +7 -0
  47. package/dist/types/device.js +1 -0
  48. package/dist/types/duration.d.ts +7 -0
  49. package/dist/types/duration.js +1 -0
  50. package/dist/types/entity.d.ts +12 -0
  51. package/dist/types/entity.js +14 -0
  52. package/dist/types/id.d.ts +3 -0
  53. package/dist/types/id.js +1 -0
  54. package/dist/types/index.d.ts +10 -5
  55. package/dist/types/index.js +10 -5
  56. package/dist/types/judge.d.ts +1 -1
  57. package/dist/types/{problems.d.ts → problem.d.ts} +2 -1
  58. package/dist/types/services.d.ts +1 -1
  59. package/dist/types/socket.d.ts +1 -1
  60. package/dist/types/state.d.ts +12 -0
  61. package/dist/types/state.js +14 -0
  62. package/dist/types/teams.d.ts +1 -1
  63. package/dist/types/text.d.ts +4 -0
  64. package/dist/types/text.js +1 -0
  65. package/dist/types/{users.d.ts → user.d.ts} +1 -1
  66. package/dist/types/{users.js → user.js} +1 -1
  67. package/dist/types/worksheet.d.ts +105 -2
  68. package/dist/types/worksheet.js +16 -0
  69. package/package.json +6 -19
  70. package/dist/helpers/commons.d.ts +0 -33
  71. package/dist/helpers/commons.js +0 -191
  72. package/dist/helpers/time.d.ts +0 -13
  73. package/dist/helpers/time.js +0 -101
  74. package/dist/types/commons.d.ts +0 -84
  75. package/dist/types/sheet.d.ts +0 -104
  76. package/dist/types/sheet.js +0 -16
  77. /package/dist/constants/{time.d.ts → duration.d.ts} +0 -0
  78. /package/dist/constants/{time.js → duration.js} +0 -0
  79. /package/dist/dto/{virtual-user.d.ts → virtualUser.d.ts} +0 -0
  80. /package/dist/dto/{virtual-user.js → virtualUser.js} +0 -0
  81. /package/dist/dto/{worksheet-submissions.d.ts → worksheetSubmission.d.ts} +0 -0
  82. /package/dist/dto/{worksheet-submissions.js → worksheetSubmission.js} +0 -0
  83. /package/dist/helpers/{class.d.ts → assignment.d.ts} +0 -0
  84. /package/dist/helpers/{class.js → assignment.js} +0 -0
  85. /package/dist/{errors/index.d.ts → helpers/errors.d.ts} +0 -0
  86. /package/dist/{errors/index.js → helpers/errors.js} +0 -0
  87. /package/dist/{number/index.d.ts → helpers/number.d.ts} +0 -0
  88. /package/dist/{number/index.js → helpers/number.js} +0 -0
  89. /package/dist/types/{problems.js → problem.js} +0 -0
  90. /package/dist/types/{account.d.ts → profile.d.ts} +0 -0
  91. /package/dist/types/{account.js → profile.js} +0 -0
@@ -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";
@@ -1,6 +1,109 @@
1
- import type { Theme } from 'typedoc';
1
+ import type { SubmissionRunStatus } from '../prisma/enums/index.js';
2
+ import type { CodeLanguage } from './code.js';
2
3
  import type { EntityMembers } from './entity.js';
3
- import type { BasicWorksheet, BodyWorksheet, NewPageSheet } from './sheet.js';
4
+ import type { Theme } from './user.js';
5
+ export declare enum WorksheetType {
6
+ JK_MD = "JK_MD",
7
+ CODE_EDITOR = "CODE_EDITOR",
8
+ LIST = "LIST",
9
+ GRAPH = "GRAPH",
10
+ QUIZ_PROBLEM = "QUIZ_PROBLEM",
11
+ QUIZ_TEXT = "QUIZ_TEXT",
12
+ QUIZ_OPTIONS = "QUIZ_OPTIONS",
13
+ NEW_PAGE = "NEW_PAGE"
14
+ }
15
+ export type BasicWorksheet = {
16
+ id: string;
17
+ type: WorksheetType;
18
+ title: string;
19
+ points: number;
20
+ };
21
+ export type JkmdSheet = BasicWorksheet & {
22
+ type: WorksheetType.JK_MD;
23
+ content: string;
24
+ };
25
+ export type SubmissionTestCase = {
26
+ out: string;
27
+ err: string;
28
+ log: string;
29
+ status: SubmissionRunStatus;
30
+ };
31
+ export interface CodeEditorTestCase extends SubmissionTestCase {
32
+ key: string;
33
+ in: string;
34
+ testOut: string;
35
+ withPE: boolean;
36
+ sample: boolean;
37
+ hidden: boolean;
38
+ index: number;
39
+ messageTimestamp: number;
40
+ }
41
+ export type CodeEditorFile<T> = {
42
+ description: string;
43
+ folderPath: string;
44
+ source: string;
45
+ language: T;
46
+ index: number;
47
+ name: string;
48
+ hidden: boolean;
49
+ readonly: boolean;
50
+ protected: boolean;
51
+ active: boolean;
52
+ };
53
+ export type CodeEditorFiles<T> = {
54
+ [key: string]: CodeEditorFile<T>;
55
+ };
56
+ export type CodeEditorTestCases = {
57
+ [key: string]: CodeEditorTestCase;
58
+ };
59
+ export type CodeEditorSheet = BasicWorksheet & {
60
+ type: WorksheetType.CODE_EDITOR;
61
+ files: CodeEditorFiles<CodeLanguage>;
62
+ testCases: CodeEditorTestCases;
63
+ languages: CodeLanguage[];
64
+ height: number;
65
+ };
66
+ export type GraphSheet = BasicWorksheet & {
67
+ type: WorksheetType.GRAPH;
68
+ dots: string[];
69
+ };
70
+ export type QuizProblemSheet = BasicWorksheet & {
71
+ type: WorksheetType.QUIZ_PROBLEM;
72
+ problemKey: string;
73
+ languages: CodeLanguage[];
74
+ height: number;
75
+ };
76
+ export type QuizTextSheet = BasicWorksheet & {
77
+ type: WorksheetType.QUIZ_TEXT;
78
+ description: string;
79
+ answer: string;
80
+ inputType: 'text' | 'number' | 'textarea';
81
+ };
82
+ export declare enum QuizScoringMode {
83
+ TOTAL = "TOTAL",
84
+ PARTIAL = "PARTIAL"
85
+ }
86
+ export type QuizOptionsSheet = BasicWorksheet & {
87
+ type: WorksheetType.QUIZ_OPTIONS;
88
+ description: string;
89
+ options: {
90
+ label: string;
91
+ correct: boolean;
92
+ id: string;
93
+ }[];
94
+ multiple: boolean;
95
+ scoringMode: QuizScoringMode;
96
+ };
97
+ export type ListSheet = BasicWorksheet & {
98
+ type: WorksheetType.LIST;
99
+ header: string;
100
+ content: (JkmdSheet | CodeEditorSheet | GraphSheet | QuizProblemSheet | QuizTextSheet | QuizOptionsSheet)[];
101
+ children: ListSheet[];
102
+ };
103
+ export type NewPageSheet = BasicWorksheet & {
104
+ type: WorksheetType.NEW_PAGE;
105
+ };
106
+ export type BodyWorksheet = JkmdSheet | CodeEditorSheet | ListSheet | GraphSheet | QuizProblemSheet | QuizTextSheet | QuizOptionsSheet | NewPageSheet;
4
107
  export declare enum AspectRatio {
5
108
  RATIO_21_9 = "21:9",
6
109
  RATIO_20_9 = "20:9",
@@ -1,3 +1,19 @@
1
+ export var WorksheetType;
2
+ (function (WorksheetType) {
3
+ WorksheetType["JK_MD"] = "JK_MD";
4
+ WorksheetType["CODE_EDITOR"] = "CODE_EDITOR";
5
+ WorksheetType["LIST"] = "LIST";
6
+ WorksheetType["GRAPH"] = "GRAPH";
7
+ WorksheetType["QUIZ_PROBLEM"] = "QUIZ_PROBLEM";
8
+ WorksheetType["QUIZ_TEXT"] = "QUIZ_TEXT";
9
+ WorksheetType["QUIZ_OPTIONS"] = "QUIZ_OPTIONS";
10
+ WorksheetType["NEW_PAGE"] = "NEW_PAGE";
11
+ })(WorksheetType || (WorksheetType = {}));
12
+ export var QuizScoringMode;
13
+ (function (QuizScoringMode) {
14
+ QuizScoringMode["TOTAL"] = "TOTAL";
15
+ QuizScoringMode["PARTIAL"] = "PARTIAL";
16
+ })(QuizScoringMode || (QuizScoringMode = {}));
1
17
  export var AspectRatio;
2
18
  (function (AspectRatio) {
3
19
  AspectRatio["RATIO_21_9"] = "21:9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juki-team/commons",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "author": "juki-team",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,35 +8,19 @@
8
8
  "types": "dist/index.d.ts",
9
9
  "sideEffects": false,
10
10
  "exports": {
11
- ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js"
14
- },
15
11
  "./constants": {
16
12
  "types": "./dist/constants/index.d.ts",
17
13
  "import": "./dist/constants/index.js"
18
14
  },
19
- "./date": {
20
- "types": "./dist/date/index.d.ts",
21
- "import": "./dist/date/index.js"
22
- },
23
15
  "./dto": {
24
16
  "types": "./dist/dto/index.d.ts",
25
17
  "import": "./dist/dto/index.js"
26
18
  },
27
- "./errors": {
28
- "types": "./dist/errors/index.d.ts",
29
- "import": "./dist/errors/index.js"
30
- },
31
19
  "./helpers": {
32
20
  "types": "./dist/helpers/index.d.ts",
33
21
  "import": "./dist/helpers/index.js"
34
22
  },
35
- "./number": {
36
- "types": "./dist/number/index.d.ts",
37
- "import": "./dist/number/index.js"
38
- },
39
- "./prisma/enums": {
23
+ "./prisma-enums": {
40
24
  "types": "./dist/prisma/enums/index.d.ts",
41
25
  "import": "./dist/prisma/enums/index.js"
42
26
  },
@@ -45,7 +29,10 @@
45
29
  "import": "./dist/types/index.js"
46
30
  }
47
31
  },
48
- "files": ["dist", "biome.shared.json"],
32
+ "files": [
33
+ "dist",
34
+ "biome.shared.json"
35
+ ],
49
36
  "repository": "https://github.com/juki-team/commons.git",
50
37
  "publishConfig": {
51
38
  "access": "public",