@juki-team/commons 0.1.43 → 0.1.46

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 (65) hide show
  1. package/dist/cjs/index.cjs +514 -546
  2. package/dist/esm/index.js +416 -491
  3. package/dist/types/constants/entity.d.ts +3 -3
  4. package/dist/types/constants/index.d.ts +1 -1
  5. package/dist/types/constants/organization.d.ts +9 -0
  6. package/dist/types/constants/websocket.d.ts +18 -22
  7. package/dist/types/dto/class.d.ts +34 -34
  8. package/dist/types/dto/code.d.ts +1 -1
  9. package/dist/types/dto/comments.d.ts +9 -9
  10. package/dist/types/dto/contest.d.ts +46 -42
  11. package/dist/types/dto/course.d.ts +13 -13
  12. package/dist/types/dto/entity.d.ts +30 -25
  13. package/dist/types/dto/excalidraw.d.ts +7 -7
  14. package/dist/types/dto/file.d.ts +10 -15
  15. package/dist/types/dto/image.d.ts +2 -2
  16. package/dist/types/dto/index.d.ts +1 -1
  17. package/dist/types/dto/judge.d.ts +5 -5
  18. package/dist/types/dto/markdown.d.ts +7 -7
  19. package/dist/types/dto/mermaid.d.ts +7 -7
  20. package/dist/types/dto/{company.d.ts → organization.d.ts} +16 -16
  21. package/dist/types/dto/problem.d.ts +22 -22
  22. package/dist/types/dto/scoreboard.d.ts +8 -18
  23. package/dist/types/dto/session.d.ts +9 -9
  24. package/dist/types/dto/socket.d.ts +76 -125
  25. package/dist/types/dto/statistics.d.ts +7 -7
  26. package/dist/types/dto/submission.d.ts +22 -22
  27. package/dist/types/dto/system.d.ts +7 -82
  28. package/dist/types/dto/url.d.ts +1 -1
  29. package/dist/types/dto/user.d.ts +22 -22
  30. package/dist/types/dto/virtual-user.d.ts +3 -25
  31. package/dist/types/dto/worksheet-submissions.d.ts +22 -22
  32. package/dist/types/dto/worksheet.d.ts +12 -12
  33. package/dist/types/helpers/class.d.ts +4 -4
  34. package/dist/types/helpers/comments.d.ts +1 -1
  35. package/dist/types/helpers/contest.d.ts +4 -4
  36. package/dist/types/helpers/date.d.ts +68 -0
  37. package/dist/types/helpers/document.d.ts +2 -2
  38. package/dist/types/helpers/index.d.ts +3 -0
  39. package/dist/types/helpers/number.d.ts +2 -0
  40. package/dist/types/helpers/responses.d.ts +1 -1
  41. package/dist/types/helpers/socket.d.ts +48 -50
  42. package/dist/types/helpers/time.d.ts +0 -11
  43. package/dist/types/helpers/user.d.ts +2 -2
  44. package/dist/types/index.d.ts +0 -1
  45. package/dist/types/types/class.d.ts +6 -6
  46. package/dist/types/types/comments.d.ts +2 -2
  47. package/dist/types/types/contest.d.ts +20 -23
  48. package/dist/types/types/entity.d.ts +13 -19
  49. package/dist/types/types/file.d.ts +6 -0
  50. package/dist/types/types/index.d.ts +3 -1
  51. package/dist/types/types/{company.d.ts → organization.d.ts} +2 -2
  52. package/dist/types/types/prisma.d.ts +2 -2
  53. package/dist/types/types/problems.d.ts +1 -1
  54. package/dist/types/types/scoreboard.d.ts +11 -0
  55. package/dist/types/types/sheet.d.ts +1 -1
  56. package/dist/types/types/socket.d.ts +32 -16
  57. package/dist/types/types/system.d.ts +76 -0
  58. package/dist/types/types/teams.d.ts +8 -8
  59. package/dist/types/types/virtual-user.d.ts +22 -0
  60. package/package.json +1 -1
  61. package/dist/types/constants/company.d.ts +0 -9
  62. package/dist/types/prototypes/Date.d.ts +0 -62
  63. package/dist/types/prototypes/Number.d.ts +0 -7
  64. package/dist/types/prototypes/index.d.ts +0 -3
  65. /package/dist/types/{prototypes/Error.d.ts → helpers/errors.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import { UserCompanyBasicInfoResponseDTO } from './user';
1
+ import { UserOrganizationBasicInfoResponseDto } from './user';
2
2
  export type GroupByTimestampKey = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | number;
3
3
  export type StatisticsGrouped<T> = Partial<Record<GroupByTimestampKey, Record<number, T>>>;
4
- export interface StatisticsCompanyResponseDTO {
4
+ export interface StatisticsOrganizationResponseDto {
5
5
  codeEditorRuns: StatisticsGrouped<number>;
6
6
  judgingRuns: StatisticsGrouped<number>;
7
7
  reJudgingRuns: StatisticsGrouped<number>;
@@ -9,7 +9,7 @@ export interface StatisticsCompanyResponseDTO {
9
9
  problems: number;
10
10
  contests: number;
11
11
  }
12
- export interface StatisticsProblemResponseDTO {
12
+ export interface StatisticsProblemResponseDto {
13
13
  verdict: {
14
14
  [key: string]: {
15
15
  key: string;
@@ -26,7 +26,7 @@ export interface StatisticsProblemResponseDTO {
26
26
  };
27
27
  date: StatisticsGrouped<number>;
28
28
  }
29
- export type StatisticsUserTrackDataResponseDTO = {
29
+ export type StatisticsUserTrackDataResponseDto = {
30
30
  timestamp: number;
31
31
  history: {
32
32
  href: string;
@@ -34,10 +34,10 @@ export type StatisticsUserTrackDataResponseDTO = {
34
34
  timestamp: number;
35
35
  }[];
36
36
  };
37
- export interface StatisticsUserTrackResponseDTO {
37
+ export interface StatisticsUserTrackResponseDto {
38
38
  [key: string]: {
39
- user: UserCompanyBasicInfoResponseDTO;
39
+ user: UserOrganizationBasicInfoResponseDto;
40
40
  sessionId: string;
41
- data: StatisticsGrouped<StatisticsUserTrackDataResponseDTO>;
41
+ data: StatisticsGrouped<StatisticsUserTrackDataResponseDto>;
42
42
  };
43
43
  }
@@ -1,7 +1,7 @@
1
1
  import { CodeLanguage, ContestUser, DataLog, EntityState, ProblemScoringMode, ProblemType, ProblemVerdict, SubmissionRunStatus } from '../types';
2
- import { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO } from './problem';
3
- import { UserCompanyBasicInfoResponseDTO } from './user';
4
- export interface SubmissionProblemSummaryListResponseDTO {
2
+ import { EntityOrganizationSummaryListResponseDto, EntityOrganizationSystemSummaryListResponseDto, ProblemJudgeSummaryListResponseDto } from './problem';
3
+ import { UserOrganizationBasicInfoResponseDto } from './user';
4
+ export interface SubmissionProblemSummaryListResponseDto {
5
5
  isAdministrator: boolean;
6
6
  isManager: boolean;
7
7
  key: string;
@@ -10,22 +10,22 @@ export interface SubmissionProblemSummaryListResponseDTO {
10
10
  type: ProblemType;
11
11
  timeLimit: number;
12
12
  memoryLimit: number;
13
- company: EntityCompanySummaryListResponseDTO;
14
- judge: ProblemJudgeSummaryListResponseDTO;
13
+ organization: EntityOrganizationSummaryListResponseDto;
14
+ judge: ProblemJudgeSummaryListResponseDto;
15
15
  }
16
- export interface SubmissionContestSummaryListResponseDTO {
16
+ export interface SubmissionContestSummaryListResponseDto {
17
17
  key: string;
18
18
  name: string;
19
- settingsStartTimestamp: number;
19
+ settingsStartsAt: number;
20
20
  isManager: boolean;
21
21
  problemIndex: string;
22
22
  problemColor: string;
23
- company: EntityCompanySummaryListResponseDTO;
23
+ organization: EntityOrganizationSummaryListResponseDto;
24
24
  isFrozen: boolean;
25
25
  isQuiet: boolean;
26
26
  isUpsolving: boolean;
27
27
  }
28
- export interface SubmissionSummaryListResponseDTO {
28
+ export interface SubmissionSummaryListResponseDto {
29
29
  submitId: string;
30
30
  language: CodeLanguage;
31
31
  timestamp: number;
@@ -34,11 +34,11 @@ export interface SubmissionSummaryListResponseDTO {
34
34
  verdict: ProblemVerdict;
35
35
  points: number;
36
36
  status: SubmissionRunStatus;
37
- problem: SubmissionProblemSummaryListResponseDTO;
38
- user: UserCompanyBasicInfoResponseDTO & {
37
+ problem: SubmissionProblemSummaryListResponseDto;
38
+ user: UserOrganizationBasicInfoResponseDto & {
39
39
  canViewSourceCode: boolean;
40
40
  };
41
- contest: SubmissionContestSummaryListResponseDTO | null;
41
+ contest: SubmissionContestSummaryListResponseDto | null;
42
42
  hiddenSubmission: boolean;
43
43
  hiddenVerdict: boolean;
44
44
  processedCases: {
@@ -51,21 +51,21 @@ export interface SubmissionSummaryListResponseDTO {
51
51
  processed: number;
52
52
  };
53
53
  };
54
- company: EntityCompanySummaryListResponseDTO;
54
+ organization: EntityOrganizationSummaryListResponseDto;
55
55
  }
56
- export interface SubmissionProblemSystemSummaryListResponseDTO extends SubmissionProblemSummaryListResponseDTO {
56
+ export interface SubmissionProblemSystemSummaryListResponseDto extends SubmissionProblemSummaryListResponseDto {
57
57
  id: string;
58
58
  }
59
- export interface SubmissionContestSystemSummaryListResponseDTO extends SubmissionContestSummaryListResponseDTO {
59
+ export interface SubmissionContestSystemSummaryListResponseDto extends SubmissionContestSummaryListResponseDto {
60
60
  id: string;
61
61
  user: ContestUser;
62
62
  }
63
- export interface SubmissionSystemSummaryListResponseDTO extends SubmissionSummaryListResponseDTO {
64
- problem: SubmissionProblemSystemSummaryListResponseDTO;
65
- contest: SubmissionContestSystemSummaryListResponseDTO | null;
66
- company: EntityCompanySystemSummaryListResponseDTO;
67
- creationTimestamp: number;
68
- updateTimestamp: number;
63
+ export interface SubmissionSystemSummaryListResponseDto extends SubmissionSummaryListResponseDto {
64
+ problem: SubmissionProblemSystemSummaryListResponseDto;
65
+ contest: SubmissionContestSystemSummaryListResponseDto | null;
66
+ organization: EntityOrganizationSystemSummaryListResponseDto;
67
+ createdAt: number;
68
+ updatedAt: number;
69
69
  state: EntityState;
70
70
  }
71
71
  export type TestCaseResult = DataLog & {
@@ -84,7 +84,7 @@ export type CompilationResult = DataLog & {
84
84
  err: string;
85
85
  success: boolean;
86
86
  };
87
- export interface SubmissionDataResponseDTO extends SubmissionSummaryListResponseDTO {
87
+ export interface SubmissionDataResponseDto extends SubmissionSummaryListResponseDto {
88
88
  judgmentTime: number;
89
89
  sourceCode: string;
90
90
  verdictByGroups: VerdictByGroups;
@@ -1,91 +1,16 @@
1
- export type TaskResponseDTOContainer = {
2
- runtimeId?: string;
3
- };
4
- export interface EcsTask {
5
- taskArn: string;
6
- taskDefinitionArn: string;
7
- group: string;
8
- version: number;
9
- cpu: string;
10
- memory: string;
11
- launchType: string;
12
- createdAt: Date;
13
- startedAt: Date;
14
- desiredStatus: string;
15
- lastStatus: string;
16
- containers?: TaskResponseDTOContainer[];
1
+ import { EcsTask, EcsTaskDefinition, SqsProperties } from '../types';
2
+ export interface EcsTaskSystemSummaryListResponseDto extends EcsTask {
3
+ isHighRunnerOrganizationKeys: string[];
17
4
  }
18
- export interface EcsTaskSystemSummaryListResponseDTO extends EcsTask {
19
- isHighRunnerCompanyKeys: string[];
5
+ export interface EcsTaskDefinitionSystemSummaryListResponseDto extends EcsTaskDefinition {
6
+ isHighRunnerOrganizationKeys: string[];
20
7
  }
21
- export interface EcsTaskDefinition {
22
- family: string;
23
- taskDefinitionArn: string;
24
- revision: number;
25
- cpu: string;
26
- memory: string;
27
- registeredAt: Date;
28
- }
29
- export interface EcsTaskDefinitionSystemSummaryListResponseDTO extends EcsTaskDefinition {
30
- isHighRunnerCompanyKeys: string[];
31
- }
32
- export interface Ec2Instance {
33
- instanceId: string;
34
- state: 'pending' | 'running' | 'shutting-down' | 'stopped' | 'stopping' | 'terminated' | undefined;
35
- instanceType: string;
36
- privateIpAddress: string;
37
- publicIpAddress: string;
38
- tags: {
39
- key: string;
40
- value: string;
41
- }[];
42
- launchTime: Date | undefined;
43
- instanceLifecycle: 'capacity-block' | 'scheduled' | 'spot' | 'interruptible-capacity-reservation' | undefined;
44
- imageId: string;
45
- vpcId: string;
46
- subnet: {
47
- id: string;
48
- name: string;
49
- };
50
- securityGroups: {
51
- groupId: string;
52
- groupName: string;
53
- }[];
54
- raw: any;
55
- }
56
- export type SqsProperties = {
57
- QueueArn: string;
58
- ApproximateNumberOfMessages: string;
59
- ApproximateNumberOfMessagesNotVisible: string;
60
- ApproximateNumberOfMessagesDelayed: string;
61
- CreatedTimestamp: string;
62
- LastModifiedTimestamp: string;
63
- VisibilityTimeout: string;
64
- MaximumMessageSize: string;
65
- MessageRetentionPeriod: string;
66
- DelaySeconds: string;
67
- ReceiveMessageWaitTimeSeconds: string;
68
- SqsManagedSseEnabled: string;
69
- FifoQueue: string;
70
- DeduplicationScope: string;
71
- FifoThroughputLimit: string;
72
- ContentBasedDeduplication: string;
73
- };
74
- export interface SqsPropertiesResponseDTO {
8
+ export interface SqsPropertiesResponseDto {
75
9
  sqsJukiHighRunnerFifo: SqsProperties;
76
10
  sqsJukiLowRunnerFifo: SqsProperties;
77
11
  }
78
- export interface EmailDataResponseDTO {
12
+ export interface EmailDataResponseDto {
79
13
  emailTemplate: string;
80
14
  contactEmails: string[];
81
15
  mainEmail: string;
82
16
  }
83
- export type SsmSession = {
84
- sessionId: string;
85
- target: string;
86
- status: 'Connected' | 'Connecting' | 'Disconnected' | 'Failed' | 'Terminating' | 'Terminated' | undefined;
87
- startTimestamps: number;
88
- owner: string;
89
- maxSessionDuration: number;
90
- raw: any;
91
- };
@@ -1,4 +1,4 @@
1
- export interface ShorterListResponseDTO {
1
+ export interface ShorterListResponseDto {
2
2
  slug: string;
3
3
  url: string;
4
4
  createdAt: number;
@@ -1,21 +1,21 @@
1
1
  import { ContestRole, CourseRole, FileRole, ProblemRole, RecordId, SystemRole, TeamRole, UserBasicInfo, UserHandles, UserRole, UserSettings, UserStatus } from '../types';
2
- import { CompanyStyles } from './company';
3
- import { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO } from './problem';
4
- export interface EntityOwnerSystemSummaryListResponseDTO {
2
+ import { OrganizationStyles } from './organization';
3
+ import { EntityOrganizationSummaryListResponseDto, EntityOrganizationSystemSummaryListResponseDto } from './problem';
4
+ export interface EntityOwnerSystemSummaryListResponseDto {
5
5
  id: string;
6
6
  nickname: string;
7
7
  imageUrl: string;
8
- company: EntityCompanySummaryListResponseDTO;
8
+ organization: EntityOrganizationSummaryListResponseDto;
9
9
  }
10
- export interface UserCompanyBasicInfoResponseDTO extends UserBasicInfo {
11
- company: EntityCompanySummaryListResponseDTO;
10
+ export interface UserOrganizationBasicInfoResponseDto extends UserBasicInfo {
11
+ organization: EntityOrganizationSummaryListResponseDto;
12
12
  }
13
- export interface UserSummaryListResponseDTO extends UserCompanyBasicInfoResponseDTO {
13
+ export interface UserSummaryListResponseDto extends UserOrganizationBasicInfoResponseDto {
14
14
  email: string;
15
15
  familyName: string;
16
16
  givenName: string;
17
17
  }
18
- export interface UserSystemSummaryListResponseDTO extends UserSummaryListResponseDTO {
18
+ export interface UserSystemSummaryListResponseDto extends UserSummaryListResponseDto {
19
19
  id: string;
20
20
  status: UserStatus;
21
21
  city: string;
@@ -29,19 +29,19 @@ export interface UserSystemSummaryListResponseDTO extends UserSummaryListRespons
29
29
  teamRole: TeamRole;
30
30
  courseRole: CourseRole;
31
31
  canResetPassword: boolean;
32
- owner: EntityOwnerSystemSummaryListResponseDTO;
33
- company: EntityCompanySystemSummaryListResponseDTO;
34
- creationTimestamp: number;
35
- updateTimestamp: number;
32
+ owner: EntityOwnerSystemSummaryListResponseDto;
33
+ organization: EntityOrganizationSystemSummaryListResponseDto;
34
+ createdAt: number;
35
+ updatedAt: number;
36
36
  }
37
- export interface UserBasicResponseDTO extends UserSummaryListResponseDTO {
37
+ export interface UserBasicResponseDto extends UserSummaryListResponseDto {
38
38
  aboutMe: string;
39
39
  city: string;
40
40
  country: string;
41
41
  institution: string;
42
42
  handles: UserHandles;
43
43
  }
44
- export interface UserProfileResponseDTO extends UserBasicResponseDTO {
44
+ export interface UserProfileResponseDto extends UserBasicResponseDto {
45
45
  canEditProfileData: boolean;
46
46
  canEditSettingsData: boolean;
47
47
  canEditPermissionsData: boolean;
@@ -65,7 +65,7 @@ export type UserPermissions = {
65
65
  create: boolean;
66
66
  manage: boolean;
67
67
  };
68
- company: {
68
+ organization: {
69
69
  manage: boolean;
70
70
  administrate: boolean;
71
71
  };
@@ -80,9 +80,9 @@ export type UserPing = {
80
80
  settings: UserSettings;
81
81
  isLogged: boolean;
82
82
  sessionId: RecordId;
83
- company: EntityCompanySummaryListResponseDTO;
83
+ organization: EntityOrganizationSummaryListResponseDto;
84
84
  };
85
- export type CompanyPing = {
85
+ export type OrganizationPing = {
86
86
  key: string;
87
87
  contactEmail: string;
88
88
  contactCellPhoneNumber: string;
@@ -90,13 +90,13 @@ export type CompanyPing = {
90
90
  imageUrl: string;
91
91
  name: string;
92
92
  codeEditorRunEnabled: boolean;
93
- styles: CompanyStyles;
93
+ styles: OrganizationStyles;
94
94
  };
95
- export interface PingResponseDTO {
95
+ export interface PingResponseDto {
96
96
  user: UserPing;
97
- company: CompanyPing;
97
+ organization: OrganizationPing;
98
98
  }
99
- export interface UserRankResponseDTO {
99
+ export interface UserRankResponseDto {
100
100
  imageUrl: string;
101
101
  nickname: string;
102
102
  status: UserStatus;
@@ -105,5 +105,5 @@ export interface UserRankResponseDTO {
105
105
  institution: string;
106
106
  problemPoints: number;
107
107
  competitionPoints: number;
108
- company: EntityCompanySummaryListResponseDTO;
108
+ organization: EntityOrganizationSummaryListResponseDto;
109
109
  }
@@ -1,27 +1,5 @@
1
- import { Judge, WorkingIn } from '../types';
2
- export type CookieSameSite = 'Strict' | 'Lax' | 'None';
3
- export type CookiePriority = 'Low' | 'Medium' | 'High';
4
- export interface CookiePartitionKey {
5
- sourceOrigin: string;
6
- hasCrossSiteAncestor?: boolean;
7
- }
8
- export interface Cookie {
9
- name: string;
10
- value: string;
11
- domain: string;
12
- path: string;
13
- expires: number;
14
- size: number;
15
- httpOnly?: boolean;
16
- secure: boolean;
17
- session: boolean;
18
- sameSite?: CookieSameSite;
19
- priority?: CookiePriority;
20
- sameParty?: boolean;
21
- partitionKey?: CookiePartitionKey | string;
22
- partitionKeyOpaque?: boolean;
23
- }
24
- export interface VirtualUserResponseDTO {
1
+ import { Cookie, Judge, WorkingIn } from '../types';
2
+ export interface VirtualUserResponseDto {
25
3
  id: string;
26
4
  judge: Judge;
27
5
  email: string;
@@ -30,7 +8,7 @@ export interface VirtualUserResponseDTO {
30
8
  submitId: string;
31
9
  attempts: number;
32
10
  workingIn: WorkingIn;
33
- updatedAt: Date;
11
+ updatedAt: number;
34
12
  judgeSubmissionId: string;
35
13
  session: {
36
14
  cookies: Cookie[];
@@ -1,64 +1,64 @@
1
1
  import { CodeEditorSheet, CodeLanguage, JkmdSheet, QuizOptionsSheet, QuizProblemSheet, QuizTextSheet, UserBasic, WorksheetType } from '../types';
2
- import { SubmissionSummaryListResponseDTO } from './submission';
3
- import { UserCompanyBasicInfoResponseDTO } from './user';
2
+ import { SubmissionSummaryListResponseDto } from './submission';
3
+ import { UserOrganizationBasicInfoResponseDto } from './user';
4
4
  export type WorksheetResponseBasicInfoProcessed = {
5
5
  submittedAt: number;
6
6
  points: number;
7
7
  isCompleted: boolean;
8
8
  };
9
- export interface QuizProblemSubmissionDTO extends Pick<QuizProblemSheet, 'id' | 'type'> {
9
+ export interface QuizProblemSubmissionDto extends Pick<QuizProblemSheet, 'id' | 'type'> {
10
10
  language: CodeLanguage;
11
11
  source: string;
12
12
  }
13
- export interface QuizProblemSubmissionResponseDTO extends WorksheetResponseBasicInfoProcessed, Omit<QuizProblemSubmissionDTO, 'source' | 'language'> {
14
- submissionResult: SubmissionSummaryListResponseDTO;
13
+ export interface QuizProblemSubmissionResponseDto extends WorksheetResponseBasicInfoProcessed, Omit<QuizProblemSubmissionDto, 'source' | 'language'> {
14
+ submissionResult: SubmissionSummaryListResponseDto;
15
15
  }
16
- export interface JkmdSubmissionDTO extends Pick<JkmdSheet, 'id' | 'type'> {
16
+ export interface JkmdSubmissionDto extends Pick<JkmdSheet, 'id' | 'type'> {
17
17
  read: boolean;
18
18
  }
19
- export interface JkmdSubmissionResponseDTO extends WorksheetResponseBasicInfoProcessed, JkmdSubmissionDTO {
19
+ export interface JkmdSubmissionResponseDto extends WorksheetResponseBasicInfoProcessed, JkmdSubmissionDto {
20
20
  }
21
- export interface CodeEditorSubmissionDTO extends Pick<CodeEditorSheet, 'id' | 'type' | 'files' | 'testCases'> {
21
+ export interface CodeEditorSubmissionDto extends Pick<CodeEditorSheet, 'id' | 'type' | 'files' | 'testCases'> {
22
22
  }
23
- export interface CodeEditorSubmissionResponseDTO extends WorksheetResponseBasicInfoProcessed, CodeEditorSubmissionDTO {
23
+ export interface CodeEditorSubmissionResponseDto extends WorksheetResponseBasicInfoProcessed, CodeEditorSubmissionDto {
24
24
  }
25
- export interface QuizOptionsSubmissionDTO extends Pick<QuizOptionsSheet, 'id' | 'type'> {
25
+ export interface QuizOptionsSubmissionDto extends Pick<QuizOptionsSheet, 'id' | 'type'> {
26
26
  checkedOptions: string[];
27
27
  }
28
- export interface QuizOptionsSubmissionResponseDTO extends WorksheetResponseBasicInfoProcessed, QuizOptionsSubmissionDTO {
28
+ export interface QuizOptionsSubmissionResponseDto extends WorksheetResponseBasicInfoProcessed, QuizOptionsSubmissionDto {
29
29
  }
30
- export interface QuizTextSubmissionDTO extends Pick<QuizTextSheet, 'id' | 'type'> {
30
+ export interface QuizTextSubmissionDto extends Pick<QuizTextSheet, 'id' | 'type'> {
31
31
  response: string;
32
32
  }
33
- export interface QuizTextSubmissionResponseDTO extends WorksheetResponseBasicInfoProcessed, QuizTextSubmissionDTO {
33
+ export interface QuizTextSubmissionResponseDto extends WorksheetResponseBasicInfoProcessed, QuizTextSubmissionDto {
34
34
  }
35
35
  export type WorkSheetSubmissions = {
36
36
  [WorksheetType.JK_MD]: {
37
- [key: string]: JkmdSubmissionResponseDTO[];
37
+ [key: string]: JkmdSubmissionResponseDto[];
38
38
  };
39
39
  [WorksheetType.CODE_EDITOR]: {
40
- [key: string]: CodeEditorSubmissionResponseDTO[];
40
+ [key: string]: CodeEditorSubmissionResponseDto[];
41
41
  };
42
42
  [WorksheetType.QUIZ_PROBLEM]: {
43
- [key: string]: QuizProblemSubmissionResponseDTO[];
43
+ [key: string]: QuizProblemSubmissionResponseDto[];
44
44
  };
45
45
  [WorksheetType.QUIZ_OPTIONS]: {
46
- [key: string]: QuizOptionsSubmissionResponseDTO[];
46
+ [key: string]: QuizOptionsSubmissionResponseDto[];
47
47
  };
48
48
  [WorksheetType.QUIZ_TEXT]: {
49
- [key: string]: QuizTextSubmissionResponseDTO[];
49
+ [key: string]: QuizTextSubmissionResponseDto[];
50
50
  };
51
51
  };
52
- export interface WorksheetSubmissionsResponseDTO {
52
+ export interface WorksheetSubmissionsResponseDto {
53
53
  [key: string]: {
54
54
  submissions: WorkSheetSubmissions;
55
55
  user: UserBasic;
56
56
  };
57
57
  }
58
- export interface WorksheetSubmissionsUsersResponseDTO {
59
- [key: string]: UserCompanyBasicInfoResponseDTO;
58
+ export interface WorksheetSubmissionsUsersResponseDto {
59
+ [key: string]: UserOrganizationBasicInfoResponseDto;
60
60
  }
61
- export interface WorksheetUserSubmissionsResponseDTO {
61
+ export interface WorksheetUserSubmissionsResponseDto {
62
62
  submissions: WorkSheetSubmissions;
63
63
  user: UserBasic;
64
64
  }
@@ -1,28 +1,28 @@
1
1
  import { BodyWorksheet, SummaryWorksheetsInPages, WorksheetBaseDocument } from '../types';
2
- import { EntityMembersDTO, EntityMembersResponseDTO } from './entity';
3
- import { UserCompanyBasicInfoResponseDTO } from './user';
4
- export interface WorksheetUserResponseDTO {
2
+ import { EntityMembersDto, EntityMembersResponseDto } from './entity';
3
+ import { UserOrganizationBasicInfoResponseDto } from './user';
4
+ export interface WorksheetUserResponseDto {
5
5
  isOwner: boolean;
6
6
  isManager: boolean;
7
7
  isSpectator: boolean;
8
8
  }
9
- export interface WorksheetSummaryListResponseDTO extends Pick<WorksheetBaseDocument, 'key' | 'name' | 'description'> {
10
- updatedAt: Date;
9
+ export interface WorksheetSummaryListResponseDto extends Pick<WorksheetBaseDocument, 'key' | 'name' | 'description'> {
10
+ updatedAt: number;
11
11
  content: SummaryWorksheetsInPages;
12
- user: WorksheetUserResponseDTO;
13
- owner: UserCompanyBasicInfoResponseDTO;
12
+ user: WorksheetUserResponseDto;
13
+ owner: UserOrganizationBasicInfoResponseDto;
14
14
  }
15
- export interface WorksheetDataResponseDTO extends Omit<WorksheetSummaryListResponseDTO, 'content'> {
15
+ export interface WorksheetDataResponseDto extends Omit<WorksheetSummaryListResponseDto, 'content'> {
16
16
  folderId: string;
17
17
  content: BodyWorksheet[];
18
- members: EntityMembersResponseDTO;
18
+ members: EntityMembersResponseDto;
19
19
  quiz: WorksheetBaseDocument['quiz'];
20
20
  slides: WorksheetBaseDocument['slides'];
21
21
  }
22
- export interface UpsertWorksheetDTO extends Omit<WorksheetBaseDocument, 'members' | 'key' | 'state'> {
23
- members: EntityMembersDTO;
22
+ export interface UpsertWorksheetDto extends Omit<WorksheetBaseDocument, 'members' | 'key' | 'state'> {
23
+ members: EntityMembersDto;
24
24
  }
25
- export interface WorksheetsProgressByUsersResponseDTO {
25
+ export interface WorksheetsProgressByUsersResponseDto {
26
26
  [key: string]: {
27
27
  [key: string]: {
28
28
  pages: {
@@ -1,4 +1,4 @@
1
- import { AssignmentSessionCycleClassDataResponseDTO, ContestAssignmentSessionCycleClassDataResponseDTO, CourseAssignmentSessionCycleClassDataResponseDTO, WorksheetAssignmentSessionCycleClassDataResponseDTO } from '../dto';
2
- export declare const isWorksheetAssignment: (assignment: AssignmentSessionCycleClassDataResponseDTO) => assignment is WorksheetAssignmentSessionCycleClassDataResponseDTO;
3
- export declare const isCourseAssignment: (assignment: AssignmentSessionCycleClassDataResponseDTO) => assignment is CourseAssignmentSessionCycleClassDataResponseDTO;
4
- export declare const isContestAssignment: (assignment: AssignmentSessionCycleClassDataResponseDTO) => assignment is ContestAssignmentSessionCycleClassDataResponseDTO;
1
+ import { AssignmentSessionCycleClassDataResponseDto, ContestAssignmentSessionCycleClassDataResponseDto, CourseAssignmentSessionCycleClassDataResponseDto, WorksheetAssignmentSessionCycleClassDataResponseDto } from '../dto';
2
+ export declare const isWorksheetAssignment: (assignment: AssignmentSessionCycleClassDataResponseDto) => assignment is WorksheetAssignmentSessionCycleClassDataResponseDto;
3
+ export declare const isCourseAssignment: (assignment: AssignmentSessionCycleClassDataResponseDto) => assignment is CourseAssignmentSessionCycleClassDataResponseDto;
4
+ export declare const isContestAssignment: (assignment: AssignmentSessionCycleClassDataResponseDto) => assignment is ContestAssignmentSessionCycleClassDataResponseDto;
@@ -1,4 +1,4 @@
1
1
  export declare const getAssignmentCommentKey: (classKey: string, cycleKey: string, sessionKey: string, assignmentKey: string) => string;
2
- export declare const getAssignmentUserCommentKey: (classKey: string, cycleKey: string, sessionKey: string, assignmentKey: string, userNickname: string, userCompany: string) => string;
2
+ export declare const getAssignmentUserCommentKey: (classKey: string, cycleKey: string, sessionKey: string, assignmentKey: string, userNickname: string, userOrganization: string) => string;
3
3
  export declare const getProblemCommentKey: (problemKey: string) => string;
4
4
  export declare const getContestCommentKey: (contestKey: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { ContestSettings } from '../types';
2
- export declare const isEndlessContest: (settings: Pick<ContestSettings, "startTimestamp" | "frozenTimestamp" | "quietTimestamp" | "endTimestamp" | "penalty"> | undefined) => boolean;
3
- export declare const isGlobalContest: (settings: Pick<ContestSettings, "startTimestamp" | "frozenTimestamp" | "quietTimestamp" | "endTimestamp" | "penalty"> | undefined) => boolean;
4
- export declare const isPastContest: (settings: Pick<ContestSettings, "endTimestamp"> | undefined) => boolean;
5
- export declare const isFutureContest: (settings: Pick<ContestSettings, "startTimestamp"> | undefined) => boolean;
2
+ export declare const isEndlessContest: (settings: Pick<ContestSettings, "startsAt" | "frozenAt" | "silencedAt" | "endsAt" | "penalty"> | undefined) => boolean;
3
+ export declare const isGlobalContest: (settings: Pick<ContestSettings, "startsAt" | "frozenAt" | "silencedAt" | "endsAt" | "penalty"> | undefined) => boolean;
4
+ export declare const isPastContest: (settings: Pick<ContestSettings, "endsAt"> | undefined) => boolean;
5
+ export declare const isFutureContest: (settings: Pick<ContestSettings, "startsAt"> | undefined) => boolean;
@@ -0,0 +1,68 @@
1
+ export declare const changeYear: (date: Date, year: number) => Date;
2
+ export declare const changeMonth: (date: Date, monthIndex: number) => Date;
3
+ export declare const changeDay: (date: Date, day: number) => Date;
4
+ export declare const changeHours: (date: Date, hours: number) => Date;
5
+ export declare const changeMinutes: (date: Date, minutes: number) => Date;
6
+ export declare const changeSeconds: (date: Date, seconds: number) => Date;
7
+ export declare const changeMilliseconds: (date: Date, milliseconds: number) => Date;
8
+ export declare const decreaseYear: (date: Date, count?: number) => Date;
9
+ export declare const increaseYear: (date: Date, count?: number) => Date;
10
+ export declare const decreaseMonth: (date: Date) => Date;
11
+ export declare const increaseMonth: (date: Date) => Date;
12
+ export declare const decreaseDay: (date: Date) => Date;
13
+ export declare const increaseDay: (date: Date) => Date;
14
+ export declare const startOfDay: (date: Date) => Date;
15
+ export declare const endOfDay: (date: Date) => Date;
16
+ export declare const startOfMonth: (date: Date) => Date;
17
+ export declare const endOfMonth: (date: Date) => Date;
18
+ export declare const startOfYear: (date: Date) => Date;
19
+ export declare const endOfYear: (date: Date) => Date;
20
+ export declare const startOfWeek: (date: Date) => Date;
21
+ export declare const endOfWeek: (date: Date) => Date;
22
+ export declare const startOfHour: (date: Date) => Date;
23
+ export declare const endOfHour: (date: Date) => Date;
24
+ export declare const startOfMinute: (date: Date) => Date;
25
+ export declare const endOfMinute: (date: Date) => Date;
26
+ export declare const startOfSecond: (date: Date) => Date;
27
+ export declare const endOfSecond: (date: Date) => Date;
28
+ export declare const isEqual: (a: Date, b: Date) => boolean;
29
+ export declare const isSameYear: (a: Date, b: Date) => boolean;
30
+ export declare const isSameMonth: (a: Date, b: Date) => boolean;
31
+ export declare const isSameDay: (a: Date, b: Date) => boolean;
32
+ export declare const isSameHour: (a: Date, b: Date) => boolean;
33
+ export declare const isSameMinute: (a: Date, b: Date) => boolean;
34
+ export declare const isSameSecond: (a: Date, b: Date) => boolean;
35
+ export declare const isSameMillisecond: (a: Date, b: Date) => boolean;
36
+ export declare const isToday: (date: Date) => boolean;
37
+ export declare const isValidDate: (date: unknown) => date is Date;
38
+ export declare const isAfter: (a: Date, b: Date) => boolean;
39
+ export declare const isBefore: (a: Date, b: Date) => boolean;
40
+ export declare const isYearAfter: (a: Date, b: Date) => boolean;
41
+ export declare const isMonthAfter: (a: Date, b: Date) => boolean;
42
+ export declare const isDayAfter: (a: Date, b: Date) => boolean;
43
+ export declare const isHoursAfter: (a: Date, b: Date) => boolean;
44
+ export declare const isMinutesAfter: (a: Date, b: Date) => boolean;
45
+ export declare const isSecondsAfter: (a: Date, b: Date) => boolean;
46
+ export declare const isMillisecondsAfter: (a: Date, b: Date) => boolean;
47
+ export declare const isYearBefore: (a: Date, b: Date) => boolean;
48
+ export declare const isMonthBefore: (a: Date, b: Date) => boolean;
49
+ export declare const isDayBefore: (a: Date, b: Date) => boolean;
50
+ export declare const isHoursBefore: (a: Date, b: Date) => boolean;
51
+ export declare const isMinutesBefore: (a: Date, b: Date) => boolean;
52
+ export declare const isSecondsBefore: (a: Date, b: Date) => boolean;
53
+ export declare const isMillisecondsBefore: (a: Date, b: Date) => boolean;
54
+ export declare const isWithinInterval: (date: Date, { start, end }: {
55
+ start: Date;
56
+ end: Date;
57
+ }, cmp?: "[]" | "()" | "[)" | "(]") => boolean;
58
+ export declare const normalizeToLocalStartOfDay: (timestamp: number | Date) => Date;
59
+ export declare const normalizeToLocalStartOfHour: (timestamp: number | Date) => Date;
60
+ export declare const normalizeToLocalStartOfMinutes: (timestamp: number | Date) => Date;
61
+ export declare const normalizeToLocalStartOfSeconds: (timestamp: number | Date) => Date;
62
+ export declare const getYears: (d: Date) => number;
63
+ export declare const getMonths: (d: Date) => number;
64
+ export declare const getDays: (d: Date) => number;
65
+ export declare const getHours: (d: Date) => number;
66
+ export declare const getMinutes: (d: Date) => number;
67
+ export declare const getSeconds: (d: Date) => number;
68
+ export declare const getMilliseconds: (d: Date) => number;
@@ -1,4 +1,4 @@
1
- import { EntityMembersDTO, EntityMembersResponseDTO } from '../dto';
1
+ import { EntityMembersDto, EntityMembersResponseDto } from '../dto';
2
2
  import { EntityAccess, EntityMembers, EntityTeamsMemberUserData, EntityUsersMemberUserData } from '../types';
3
3
  export declare const getDocumentAccess: (document: {
4
4
  members: Pick<EntityMembers, "rankAdministrators" | "rankManagers" | "rankGuests" | "rankSpectators" | "rankParticipants">;
@@ -11,4 +11,4 @@ export declare const isTeamMember: (member: {
11
11
  userId?: string;
12
12
  teamId?: string;
13
13
  }) => member is EntityTeamsMemberUserData;
14
- export declare const toEntityMembersDTO: (members: EntityMembersResponseDTO) => EntityMembersDTO;
14
+ export declare const toEntityMembersDto: (members: EntityMembersResponseDto) => EntityMembersDto;
@@ -2,10 +2,13 @@ export * from './class';
2
2
  export * from './comments';
3
3
  export * from './commons';
4
4
  export * from './contest';
5
+ export * from './date';
5
6
  export * from './document';
7
+ export * from './errors';
6
8
  export * from './file';
7
9
  export * from './interval';
8
10
  export * from './judging';
11
+ export * from './number';
9
12
  export * from './object';
10
13
  export * from './responses';
11
14
  export * from './socket';
@@ -0,0 +1,2 @@
1
+ export declare const padStart: (n: number, maxLength: number, fillString?: string) => string;
2
+ export declare const padEnd: (n: number, maxLength: number, fillString?: string) => string;
@@ -1,4 +1,4 @@
1
- import { JkError } from '../prototypes';
1
+ import { JkError } from './errors';
2
2
  import { ContentResponse, ContentsMeta, ContentsResponse, ErrorResponse } from '../types';
3
3
  export declare function toJkError(err: any): JkError;
4
4
  export declare function errorsResponse(message: string, ...errors: JkError[]): ErrorResponse;