@juki-team/commons 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/biome.shared.json +102 -0
- package/dist/constants/commons.d.ts +62 -0
- package/dist/constants/commons.js +658 -0
- package/dist/constants/company.d.ts +9 -0
- package/dist/constants/company.js +24 -0
- package/dist/constants/contest.d.ts +15 -0
- package/dist/constants/contest.js +29 -0
- package/dist/constants/course.d.ts +8 -0
- package/dist/constants/course.js +12 -0
- package/dist/constants/date.d.ts +9 -0
- package/dist/constants/date.js +23 -0
- package/dist/constants/email.d.ts +2 -0
- package/dist/constants/email.js +34 -0
- package/dist/constants/entity.d.ts +3 -0
- package/dist/constants/entity.js +18 -0
- package/dist/constants/file.d.ts +28 -0
- package/dist/constants/file.js +46 -0
- package/dist/constants/index.d.ts +18 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/judge.d.ts +37 -0
- package/dist/constants/judge.js +221 -0
- package/dist/constants/problem.d.ts +37 -0
- package/dist/constants/problem.js +72 -0
- package/dist/constants/routing.d.ts +7 -0
- package/dist/constants/routing.js +7 -0
- package/dist/constants/services.d.ts +5 -0
- package/dist/constants/services.js +131 -0
- package/dist/constants/system.d.ts +8 -0
- package/dist/constants/system.js +9 -0
- package/dist/constants/teams.d.ts +15 -0
- package/dist/constants/teams.js +18 -0
- package/dist/constants/time.d.ts +9 -0
- package/dist/constants/time.js +9 -0
- package/dist/constants/user.d.ts +10 -0
- package/dist/constants/user.js +35 -0
- package/dist/constants/websocket.d.ts +6 -0
- package/dist/constants/websocket.js +5 -0
- package/dist/constants/worksheet.d.ts +11 -0
- package/dist/constants/worksheet.js +66 -0
- package/dist/dto/class.d.ts +115 -0
- package/dist/dto/class.js +1 -0
- package/dist/dto/code.d.ts +13 -0
- package/dist/dto/code.js +1 -0
- package/dist/dto/comments.d.ts +21 -0
- package/dist/dto/comments.js +1 -0
- package/dist/dto/contest.d.ts +95 -0
- package/dist/dto/contest.js +7 -0
- package/dist/dto/course.d.ts +34 -0
- package/dist/dto/course.js +1 -0
- package/dist/dto/entity.d.ts +92 -0
- package/dist/dto/entity.js +5 -0
- package/dist/dto/excalidraw.d.ts +12 -0
- package/dist/dto/excalidraw.js +1 -0
- package/dist/dto/file.d.ts +34 -0
- package/dist/dto/file.js +1 -0
- package/dist/dto/image.d.ts +6 -0
- package/dist/dto/image.js +1 -0
- package/dist/dto/index.d.ts +24 -0
- package/dist/dto/index.js +24 -0
- package/dist/dto/judge.d.ts +16 -0
- package/dist/dto/judge.js +1 -0
- package/dist/dto/markdown.d.ts +12 -0
- package/dist/dto/markdown.js +1 -0
- package/dist/dto/mermaid.d.ts +12 -0
- package/dist/dto/mermaid.js +1 -0
- package/dist/dto/organization.d.ts +102 -0
- package/dist/dto/organization.js +1 -0
- package/dist/dto/problem.d.ts +67 -0
- package/dist/dto/problem.js +1 -0
- package/dist/dto/scoreboard.d.ts +35 -0
- package/dist/dto/scoreboard.js +1 -0
- package/dist/dto/session.d.ts +15 -0
- package/dist/dto/session.js +1 -0
- package/dist/dto/socket.d.ts +257 -0
- package/dist/dto/socket.js +1 -0
- package/dist/dto/statistics.d.ts +43 -0
- package/dist/dto/statistics.js +1 -0
- package/dist/dto/submission.d.ts +95 -0
- package/dist/dto/submission.js +1 -0
- package/dist/dto/system.d.ts +91 -0
- package/dist/dto/system.js +1 -0
- package/dist/dto/url.d.ts +8 -0
- package/dist/dto/url.js +1 -0
- package/dist/dto/user.d.ts +109 -0
- package/dist/dto/user.js +1 -0
- package/dist/dto/virtual-user.d.ts +39 -0
- package/dist/dto/virtual-user.js +1 -0
- package/dist/dto/worksheet-submissions.d.ts +64 -0
- package/dist/dto/worksheet-submissions.js +1 -0
- package/dist/dto/worksheet.d.ts +39 -0
- package/dist/dto/worksheet.js +1 -0
- package/dist/helpers/class.d.ts +4 -0
- package/dist/helpers/class.js +10 -0
- package/dist/helpers/comments.d.ts +4 -0
- package/dist/helpers/comments.js +4 -0
- package/dist/helpers/commons.d.ts +33 -0
- package/dist/helpers/commons.js +191 -0
- package/dist/helpers/contest.d.ts +5 -0
- package/dist/helpers/contest.js +21 -0
- package/dist/helpers/document.d.ts +14 -0
- package/dist/helpers/document.js +38 -0
- package/dist/helpers/file.d.ts +1 -0
- package/dist/helpers/file.js +4 -0
- package/dist/helpers/index.d.ts +14 -0
- package/dist/helpers/index.js +14 -0
- package/dist/helpers/interval.d.ts +2 -0
- package/dist/helpers/interval.js +22 -0
- package/dist/helpers/judging.d.ts +25 -0
- package/dist/helpers/judging.js +107 -0
- package/dist/helpers/object.d.ts +1 -0
- package/dist/helpers/object.js +32 -0
- package/dist/helpers/responses.d.ts +8 -0
- package/dist/helpers/responses.js +78 -0
- package/dist/helpers/socket.d.ts +45 -0
- package/dist/helpers/socket.js +238 -0
- package/dist/helpers/time.d.ts +13 -0
- package/dist/helpers/time.js +101 -0
- package/dist/helpers/user.d.ts +11 -0
- package/dist/helpers/user.js +14 -0
- package/dist/helpers/worksheet.d.ts +10 -0
- package/dist/helpers/worksheet.js +131 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/prisma/enums/AssignmentClassType.d.ts +7 -0
- package/dist/prisma/enums/AssignmentClassType.js +6 -0
- package/dist/prisma/enums/ContestEventAction.d.ts +10 -0
- package/dist/prisma/enums/ContestEventAction.js +9 -0
- package/dist/prisma/enums/ContestProblemPrerequisiteType.d.ts +5 -0
- package/dist/prisma/enums/ContestProblemPrerequisiteType.js +4 -0
- package/dist/prisma/enums/ContestRole.d.ts +11 -0
- package/dist/prisma/enums/ContestRole.js +10 -0
- package/dist/prisma/enums/ContestStatus.d.ts +6 -0
- package/dist/prisma/enums/ContestStatus.js +5 -0
- package/dist/prisma/enums/CourseRole.d.ts +12 -0
- package/dist/prisma/enums/CourseRole.js +11 -0
- package/dist/prisma/enums/EntityObjectType.d.ts +13 -0
- package/dist/prisma/enums/EntityObjectType.js +12 -0
- package/dist/prisma/enums/EntityRole.d.ts +8 -0
- package/dist/prisma/enums/EntityRole.js +7 -0
- package/dist/prisma/enums/EntitySubjectType.d.ts +7 -0
- package/dist/prisma/enums/EntitySubjectType.js +6 -0
- package/dist/prisma/enums/FileRole.d.ts +9 -0
- package/dist/prisma/enums/FileRole.js +8 -0
- package/dist/prisma/enums/FileType.d.ts +5 -0
- package/dist/prisma/enums/FileType.js +4 -0
- package/dist/prisma/enums/GroupType.d.ts +5 -0
- package/dist/prisma/enums/GroupType.js +4 -0
- package/dist/prisma/enums/JudgeType.d.ts +12 -0
- package/dist/prisma/enums/JudgeType.js +11 -0
- package/dist/prisma/enums/OrganizationPlan.d.ts +7 -0
- package/dist/prisma/enums/OrganizationPlan.js +6 -0
- package/dist/prisma/enums/ProblemRole.d.ts +11 -0
- package/dist/prisma/enums/ProblemRole.js +10 -0
- package/dist/prisma/enums/ProblemScoringMode.d.ts +6 -0
- package/dist/prisma/enums/ProblemScoringMode.js +5 -0
- package/dist/prisma/enums/ProblemType.d.ts +6 -0
- package/dist/prisma/enums/ProblemType.js +5 -0
- package/dist/prisma/enums/ProblemVerdict.d.ts +14 -0
- package/dist/prisma/enums/ProblemVerdict.js +13 -0
- package/dist/prisma/enums/ShareLinkVisibility.d.ts +5 -0
- package/dist/prisma/enums/ShareLinkVisibility.js +4 -0
- package/dist/prisma/enums/SubmissionRunStatus.d.ts +18 -0
- package/dist/prisma/enums/SubmissionRunStatus.js +17 -0
- package/dist/prisma/enums/SystemRole.d.ts +9 -0
- package/dist/prisma/enums/SystemRole.js +8 -0
- package/dist/prisma/enums/TeamRole.d.ts +9 -0
- package/dist/prisma/enums/TeamRole.js +8 -0
- package/dist/prisma/enums/TelemetryType.d.ts +9 -0
- package/dist/prisma/enums/TelemetryType.js +8 -0
- package/dist/prisma/enums/UserRole.d.ts +10 -0
- package/dist/prisma/enums/UserRole.js +9 -0
- package/dist/prisma/enums/WorkingIn.d.ts +8 -0
- package/dist/prisma/enums/WorkingIn.js +7 -0
- package/dist/prisma/enums/WorksheetContentType.d.ts +10 -0
- package/dist/prisma/enums/WorksheetContentType.js +9 -0
- package/dist/prisma/enums/index.d.ts +26 -0
- package/dist/prisma/enums/index.js +26 -0
- package/dist/prototypes/Date.d.ts +62 -0
- package/dist/prototypes/Date.js +218 -0
- package/dist/prototypes/Error.d.ts +10 -0
- package/dist/prototypes/Error.js +17 -0
- package/dist/prototypes/Number.d.ts +7 -0
- package/dist/prototypes/Number.js +8 -0
- package/dist/prototypes/index.d.ts +3 -0
- package/dist/prototypes/index.js +3 -0
- package/dist/types/account.d.ts +9 -0
- package/dist/types/account.js +10 -0
- package/dist/types/class.d.ts +67 -0
- package/dist/types/class.js +7 -0
- package/dist/types/comments.d.ts +17 -0
- package/dist/types/comments.js +1 -0
- package/dist/types/commons.d.ts +84 -0
- package/dist/types/commons.js +69 -0
- package/dist/types/company.d.ts +6 -0
- package/dist/types/company.js +7 -0
- package/dist/types/contest.d.ts +144 -0
- package/dist/types/contest.js +6 -0
- package/dist/types/course.d.ts +13 -0
- package/dist/types/course.js +1 -0
- package/dist/types/entity.d.ts +116 -0
- package/dist/types/entity.js +50 -0
- package/dist/types/excalidraw.d.ts +9 -0
- package/dist/types/excalidraw.js +1 -0
- package/dist/types/file.d.ts +22 -0
- package/dist/types/file.js +13 -0
- package/dist/types/group.d.ts +9 -0
- package/dist/types/group.js +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.js +23 -0
- package/dist/types/judge.d.ts +46 -0
- package/dist/types/judge.js +17 -0
- package/dist/types/markdown.d.ts +8 -0
- package/dist/types/markdown.js +1 -0
- package/dist/types/mermaid.d.ts +8 -0
- package/dist/types/mermaid.js +1 -0
- package/dist/types/notification.d.ts +7 -0
- package/dist/types/notification.js +8 -0
- package/dist/types/problems.d.ts +93 -0
- package/dist/types/problems.js +16 -0
- package/dist/types/services.d.ts +214 -0
- package/dist/types/services.js +147 -0
- package/dist/types/sheet.d.ts +104 -0
- package/dist/types/sheet.js +16 -0
- package/dist/types/socket.d.ts +49 -0
- package/dist/types/socket.js +49 -0
- package/dist/types/submission.d.ts +5 -0
- package/dist/types/submission.js +1 -0
- package/dist/types/teams.d.ts +96 -0
- package/dist/types/teams.js +28 -0
- package/dist/types/users.d.ts +65 -0
- package/dist/types/users.js +33 -0
- package/dist/types/worksheet.d.ts +42 -0
- package/dist/types/worksheet.js +11 -0
- package/package.json +42 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ContestEventAction } from '../prisma/enums/index.js';
|
|
2
|
+
import type { ContestBaseDocument, ContestClarification, ContestProblem, ContestProblemPrerequisite, ContestSettings, ContestUser, EntityState, ProblemSettings, ProblemStatement, TextLanguage } from '../types/index.js';
|
|
3
|
+
import type { EntityMembersDTO, EntityMembersWithTimestampsResponseDTO } from './entity.js';
|
|
4
|
+
import type { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO, ProblemSummaryListResponseDTO } from './problem.js';
|
|
5
|
+
import type { EntityOwnerSystemSummaryListResponseDTO, UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
6
|
+
export type UpsertContestProblemPrerequisiteDTO = (Omit<ContestProblemPrerequisite, 'problemId'> & {
|
|
7
|
+
problemIndex: string;
|
|
8
|
+
})[];
|
|
9
|
+
export interface UpsertContestProblemDTO extends Omit<ContestProblem, 'id' | 'prerequisites'> {
|
|
10
|
+
key: string;
|
|
11
|
+
prerequisites: UpsertContestProblemPrerequisiteDTO;
|
|
12
|
+
}
|
|
13
|
+
export interface UpsertContestDTO extends Omit<ContestBaseDocument, 'key' | 'members' | 'problems' | 'settings' | 'events'> {
|
|
14
|
+
members: EntityMembersDTO;
|
|
15
|
+
problems: {
|
|
16
|
+
[key: string]: UpsertContestProblemDTO;
|
|
17
|
+
};
|
|
18
|
+
settings: Omit<ContestSettings, 'locked'>;
|
|
19
|
+
}
|
|
20
|
+
export interface ContestSummaryListResponseDTO extends Pick<ContestBaseDocument, 'key' | 'name' | 'tags'> {
|
|
21
|
+
user: ContestUser;
|
|
22
|
+
owner: UserOrganizationBasicInfoResponseDTO;
|
|
23
|
+
company: EntityCompanySummaryListResponseDTO;
|
|
24
|
+
settings: Pick<ContestSettings, 'startTimestamp' | 'endTimestamp' | 'frozenTimestamp' | 'quietTimestamp' | 'penalty' | 'upsolvingEnabled'>;
|
|
25
|
+
totalContestants: number;
|
|
26
|
+
isLive: boolean;
|
|
27
|
+
isPast: boolean;
|
|
28
|
+
isFuture: boolean;
|
|
29
|
+
isEndless: boolean;
|
|
30
|
+
isGlobal: boolean;
|
|
31
|
+
isFrozenTime: boolean;
|
|
32
|
+
isQuietTime: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface ContestSystemSummaryListResponseDTO extends ContestSummaryListResponseDTO {
|
|
35
|
+
state: EntityState;
|
|
36
|
+
id: string;
|
|
37
|
+
owner: EntityOwnerSystemSummaryListResponseDTO;
|
|
38
|
+
company: EntityCompanySystemSummaryListResponseDTO;
|
|
39
|
+
creationTimestamp: number;
|
|
40
|
+
updateTimestamp: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ContestProblemBasicDataResponseDTO extends Omit<ContestProblem, 'id' | 'prerequisites'> {
|
|
43
|
+
name: string;
|
|
44
|
+
key: string;
|
|
45
|
+
prerequisites: UpsertContestProblemPrerequisiteDTO;
|
|
46
|
+
judge: ProblemJudgeSummaryListResponseDTO;
|
|
47
|
+
tags: string[];
|
|
48
|
+
company: EntityCompanySummaryListResponseDTO;
|
|
49
|
+
}
|
|
50
|
+
export interface ContestContestProblemDataResponseDTO extends Omit<ProblemSummaryListResponseDTO, 'user'> {
|
|
51
|
+
author: string;
|
|
52
|
+
shortname: string;
|
|
53
|
+
statement: ProblemStatement;
|
|
54
|
+
editorial: TextLanguage;
|
|
55
|
+
settings: ProblemSettings;
|
|
56
|
+
ownerNickname: string;
|
|
57
|
+
}
|
|
58
|
+
export declare enum ContestProblemBlockedByType {
|
|
59
|
+
UNMET_PREREQUISITES = "UNMET_PREREQUISITES",
|
|
60
|
+
MAX_ACCEPTED_SUBMISSIONS_ACHIEVED = "MAX_ACCEPTED_SUBMISSIONS_ACHIEVED",
|
|
61
|
+
START_TIME_IN_THE_FUTURE = "START_TIME_IN_THE_FUTURE",
|
|
62
|
+
END_TIME_IN_THE_PAST = "END_TIME_IN_THE_PAST"
|
|
63
|
+
}
|
|
64
|
+
export type ContestProblemDataResponseDTO = ContestProblemBasicDataResponseDTO & ContestContestProblemDataResponseDTO & {
|
|
65
|
+
blockedBy: {
|
|
66
|
+
type: ContestProblemBlockedByType;
|
|
67
|
+
details: Record<string, unknown>;
|
|
68
|
+
}[];
|
|
69
|
+
totalSuccess: number;
|
|
70
|
+
totalAttempts: number;
|
|
71
|
+
myAttempts: number;
|
|
72
|
+
myPoints: number;
|
|
73
|
+
mySuccess: boolean;
|
|
74
|
+
myPenalty: number;
|
|
75
|
+
myIndexAccepted: number;
|
|
76
|
+
};
|
|
77
|
+
export interface ContestEventResponseDTO {
|
|
78
|
+
action: ContestEventAction;
|
|
79
|
+
user: UserOrganizationBasicInfoResponseDTO;
|
|
80
|
+
timestamp: number;
|
|
81
|
+
details: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export interface ContestDataResponseDTO extends Omit<ContestSummaryListResponseDTO, 'settings'>, Pick<ContestBaseDocument, 'settings' | 'description' | 'groups'> {
|
|
84
|
+
problems: Record<string, ContestProblemDataResponseDTO>;
|
|
85
|
+
state: EntityState;
|
|
86
|
+
}
|
|
87
|
+
export interface ContestMembersResponseDTO {
|
|
88
|
+
members: EntityMembersWithTimestampsResponseDTO;
|
|
89
|
+
}
|
|
90
|
+
export interface ContestClarificationsResponseDTO {
|
|
91
|
+
clarifications: ContestClarification[];
|
|
92
|
+
}
|
|
93
|
+
export interface ContestEventsResponseDTO {
|
|
94
|
+
events: ContestEventResponseDTO[];
|
|
95
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var ContestProblemBlockedByType;
|
|
2
|
+
(function (ContestProblemBlockedByType) {
|
|
3
|
+
ContestProblemBlockedByType["UNMET_PREREQUISITES"] = "UNMET_PREREQUISITES";
|
|
4
|
+
ContestProblemBlockedByType["MAX_ACCEPTED_SUBMISSIONS_ACHIEVED"] = "MAX_ACCEPTED_SUBMISSIONS_ACHIEVED";
|
|
5
|
+
ContestProblemBlockedByType["START_TIME_IN_THE_FUTURE"] = "START_TIME_IN_THE_FUTURE";
|
|
6
|
+
ContestProblemBlockedByType["END_TIME_IN_THE_PAST"] = "END_TIME_IN_THE_PAST";
|
|
7
|
+
})(ContestProblemBlockedByType || (ContestProblemBlockedByType = {}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CourseBaseDocument } from '../types/index.js';
|
|
2
|
+
import type { EntityMembersDTO, EntityMembersResponseDTO } from './entity.js';
|
|
3
|
+
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
4
|
+
import type { WorksheetSummaryListResponseDTO } from './worksheet.js';
|
|
5
|
+
export type CourseUserResponseDTO = {
|
|
6
|
+
isOwner: boolean;
|
|
7
|
+
isManager: boolean;
|
|
8
|
+
isSpectator: boolean;
|
|
9
|
+
isParticipant: boolean;
|
|
10
|
+
isGuest: boolean;
|
|
11
|
+
};
|
|
12
|
+
export interface CourseSummaryListResponseDTO {
|
|
13
|
+
key: string;
|
|
14
|
+
title: string;
|
|
15
|
+
abstract: string;
|
|
16
|
+
description: string;
|
|
17
|
+
coverImageUrl: string;
|
|
18
|
+
owner: UserOrganizationBasicInfoResponseDTO;
|
|
19
|
+
user: CourseUserResponseDTO;
|
|
20
|
+
}
|
|
21
|
+
export interface CourseLessonsWorksheetDataResponseDTO extends Pick<WorksheetSummaryListResponseDTO, 'key' | 'name' | 'content'> {
|
|
22
|
+
}
|
|
23
|
+
export interface CourseDataResponseDTO extends CourseSummaryListResponseDTO {
|
|
24
|
+
lessons: {
|
|
25
|
+
worksheet: CourseLessonsWorksheetDataResponseDTO;
|
|
26
|
+
}[];
|
|
27
|
+
members: EntityMembersResponseDTO;
|
|
28
|
+
}
|
|
29
|
+
export interface UpsertCourseDTO extends Omit<CourseBaseDocument, 'members' | 'key' | 'lessons' | 'state'> {
|
|
30
|
+
lessons: {
|
|
31
|
+
worksheetKey: string;
|
|
32
|
+
}[];
|
|
33
|
+
members: EntityMembersDTO;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { EntityAccess, EntityMembersRank } from '../types/index.js';
|
|
2
|
+
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
3
|
+
export interface EntityMembersDTO {
|
|
4
|
+
rankAdministrators: EntityMembersRank;
|
|
5
|
+
administrators: string[];
|
|
6
|
+
rankManagers: EntityMembersRank;
|
|
7
|
+
managers: string[];
|
|
8
|
+
rankGuests: EntityMembersRank;
|
|
9
|
+
guests: string[];
|
|
10
|
+
rankSpectators: EntityMembersRank;
|
|
11
|
+
spectators: string[];
|
|
12
|
+
rankParticipants: EntityMembersRank;
|
|
13
|
+
participants: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface EntityMembersResponseDTO {
|
|
16
|
+
rankAdministrators: EntityMembersRank;
|
|
17
|
+
administrators: {
|
|
18
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
19
|
+
};
|
|
20
|
+
rankManagers: EntityMembersRank;
|
|
21
|
+
managers: {
|
|
22
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
23
|
+
};
|
|
24
|
+
rankGuests: EntityMembersRank;
|
|
25
|
+
guests: {
|
|
26
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
27
|
+
};
|
|
28
|
+
rankSpectators: EntityMembersRank;
|
|
29
|
+
spectators: {
|
|
30
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
31
|
+
};
|
|
32
|
+
rankParticipants: EntityMembersRank;
|
|
33
|
+
participants: {
|
|
34
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface DocumentUserResponseDTO {
|
|
38
|
+
isOwner: boolean;
|
|
39
|
+
isManager: boolean;
|
|
40
|
+
isSpectator: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare enum MemberType {
|
|
43
|
+
USER = "USER",
|
|
44
|
+
TEAM = "TEAM"
|
|
45
|
+
}
|
|
46
|
+
export interface DocumentMemberResponseDTO extends UserOrganizationBasicInfoResponseDTO {
|
|
47
|
+
type: MemberType;
|
|
48
|
+
}
|
|
49
|
+
export interface DocumentMemberWithTimestampsResponseDTO extends DocumentMemberResponseDTO {
|
|
50
|
+
type: MemberType;
|
|
51
|
+
lastVisitTimestamp: number;
|
|
52
|
+
joinedAtTimestamp: number;
|
|
53
|
+
}
|
|
54
|
+
export interface EntityMembersWithTimestampsResponseDTO {
|
|
55
|
+
rankAdministrators: EntityMembersRank;
|
|
56
|
+
administrators: {
|
|
57
|
+
[key: string]: DocumentMemberWithTimestampsResponseDTO;
|
|
58
|
+
};
|
|
59
|
+
rankManagers: EntityMembersRank;
|
|
60
|
+
managers: {
|
|
61
|
+
[key: string]: DocumentMemberWithTimestampsResponseDTO;
|
|
62
|
+
};
|
|
63
|
+
rankGuests: EntityMembersRank;
|
|
64
|
+
guests: {
|
|
65
|
+
[key: string]: DocumentMemberWithTimestampsResponseDTO;
|
|
66
|
+
};
|
|
67
|
+
rankSpectators: EntityMembersRank;
|
|
68
|
+
spectators: {
|
|
69
|
+
[key: string]: DocumentMemberWithTimestampsResponseDTO;
|
|
70
|
+
};
|
|
71
|
+
rankParticipants: EntityMembersRank;
|
|
72
|
+
participants: {
|
|
73
|
+
[key: string]: DocumentMemberWithTimestampsResponseDTO;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export interface DocumentMembersResponseDTO {
|
|
77
|
+
access: EntityAccess;
|
|
78
|
+
managers: {
|
|
79
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
80
|
+
};
|
|
81
|
+
spectators: {
|
|
82
|
+
[key: string]: DocumentMemberResponseDTO;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface DocumentCreateResponseDTO {
|
|
86
|
+
key: string;
|
|
87
|
+
}
|
|
88
|
+
export interface MetadataResponseDTO {
|
|
89
|
+
title: string;
|
|
90
|
+
description: string;
|
|
91
|
+
cover: string;
|
|
92
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExcalidrawBaseDocument } from '../types/index.js';
|
|
2
|
+
import type { EntityMembersDTO, EntityMembersResponseDTO } from './entity.js';
|
|
3
|
+
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
4
|
+
export interface ExcalidrawResponseDTO extends Omit<ExcalidrawBaseDocument, 'members'> {
|
|
5
|
+
owner: UserOrganizationBasicInfoResponseDTO;
|
|
6
|
+
members: EntityMembersResponseDTO;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UpsertExcalidrawDTO extends Omit<ExcalidrawBaseDocument, 'key' | 'members'> {
|
|
11
|
+
members: EntityMembersDTO;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EntityState, FileContent, FileMemberRole, SummaryFileContent, UserBasic } from '../types/index.js';
|
|
2
|
+
import type { DocumentMembersResponseDTO, DocumentUserResponseDTO } from './entity.js';
|
|
3
|
+
export interface FileBasic {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
state: EntityState;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateFileDTO extends FileBasic {
|
|
9
|
+
folderId: string;
|
|
10
|
+
content: FileContent;
|
|
11
|
+
members: FileMembersDTO;
|
|
12
|
+
}
|
|
13
|
+
export interface FileSummaryListResponseDTO extends FileBasic {
|
|
14
|
+
key: string;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
content: SummaryFileContent;
|
|
17
|
+
user: DocumentUserResponseDTO;
|
|
18
|
+
owner: UserBasic;
|
|
19
|
+
}
|
|
20
|
+
export interface FileDataResponseDTO extends FileSummaryListResponseDTO {
|
|
21
|
+
content: FileContent;
|
|
22
|
+
members: DocumentMembersResponseDTO;
|
|
23
|
+
parentFolders: {
|
|
24
|
+
name: string;
|
|
25
|
+
key: string;
|
|
26
|
+
isInOwnerFolder: boolean;
|
|
27
|
+
isInEditorFolder: boolean;
|
|
28
|
+
isInViewerFolder: boolean;
|
|
29
|
+
isInArchivedFolder: boolean;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
export interface FileMembersDTO {
|
|
33
|
+
[key: string]: FileMemberRole;
|
|
34
|
+
}
|
package/dist/dto/file.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './class.js';
|
|
2
|
+
export * from './code.js';
|
|
3
|
+
export * from './comments.js';
|
|
4
|
+
export * from './contest.js';
|
|
5
|
+
export * from './course.js';
|
|
6
|
+
export * from './entity.js';
|
|
7
|
+
export * from './excalidraw.js';
|
|
8
|
+
export * from './file.js';
|
|
9
|
+
export * from './image.js';
|
|
10
|
+
export * from './judge.js';
|
|
11
|
+
export * from './markdown.js';
|
|
12
|
+
export * from './mermaid.js';
|
|
13
|
+
export * from './organization.js';
|
|
14
|
+
export * from './problem.js';
|
|
15
|
+
export * from './scoreboard.js';
|
|
16
|
+
export * from './session.js';
|
|
17
|
+
export * from './socket.js';
|
|
18
|
+
export * from './statistics.js';
|
|
19
|
+
export * from './submission.js';
|
|
20
|
+
export * from './system.js';
|
|
21
|
+
export * from './url.js';
|
|
22
|
+
export * from './user.js';
|
|
23
|
+
export * from './worksheet.js';
|
|
24
|
+
export * from './worksheet-submissions.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './class.js';
|
|
2
|
+
export * from './code.js';
|
|
3
|
+
export * from './comments.js';
|
|
4
|
+
export * from './contest.js';
|
|
5
|
+
export * from './course.js';
|
|
6
|
+
export * from './entity.js';
|
|
7
|
+
export * from './excalidraw.js';
|
|
8
|
+
export * from './file.js';
|
|
9
|
+
export * from './image.js';
|
|
10
|
+
export * from './judge.js';
|
|
11
|
+
export * from './markdown.js';
|
|
12
|
+
export * from './mermaid.js';
|
|
13
|
+
export * from './organization.js';
|
|
14
|
+
export * from './problem.js';
|
|
15
|
+
export * from './scoreboard.js';
|
|
16
|
+
export * from './session.js';
|
|
17
|
+
export * from './socket.js';
|
|
18
|
+
export * from './statistics.js';
|
|
19
|
+
export * from './submission.js';
|
|
20
|
+
export * from './system.js';
|
|
21
|
+
export * from './url.js';
|
|
22
|
+
export * from './user.js';
|
|
23
|
+
export * from './worksheet.js';
|
|
24
|
+
export * from './worksheet-submissions.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JudgeBaseDocument } from '../types/index.js';
|
|
2
|
+
export interface JudgeDataResponseDTO extends Omit<JudgeBaseDocument, 'getProblemUrl' | 'getUserSubmissionsUrl' | 'getLoginUrl' | 'getSubmitUrl'> {
|
|
3
|
+
}
|
|
4
|
+
export interface JudgeSummaryListResponseDTO extends Omit<JudgeBaseDocument, 'getProblemUrl' | 'getUserSubmissionsUrl' | 'getSubmissionUrl' | 'getLoginUrl' | 'getProfileUrl' | 'getSubmitUrl'> {
|
|
5
|
+
}
|
|
6
|
+
export interface JudgeSystemSummaryListResponseDTO extends JudgeSummaryListResponseDTO {
|
|
7
|
+
id: string;
|
|
8
|
+
creationTimestamp: number;
|
|
9
|
+
updateTimestamp: number;
|
|
10
|
+
getLoginUrl: string;
|
|
11
|
+
getProfileUrl: string;
|
|
12
|
+
getSubmitUrl: string;
|
|
13
|
+
getSubmissionUrl: string;
|
|
14
|
+
getProblemUrl: string;
|
|
15
|
+
getUserSubmissionsUrl: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MarkdownBaseDocument } from '../types/index.js';
|
|
2
|
+
import type { EntityMembersDTO, EntityMembersResponseDTO } from './entity.js';
|
|
3
|
+
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
4
|
+
export interface MarkdownResponseDTO extends Omit<MarkdownBaseDocument, 'members'> {
|
|
5
|
+
owner: UserOrganizationBasicInfoResponseDTO;
|
|
6
|
+
members: EntityMembersResponseDTO;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UpsertMarkdownDTO extends Omit<MarkdownBaseDocument, 'key' | 'members'> {
|
|
11
|
+
members: EntityMembersDTO;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MermaidBaseDocument } from '../types/index.js';
|
|
2
|
+
import type { EntityMembersDTO, EntityMembersResponseDTO } from './entity.js';
|
|
3
|
+
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
4
|
+
export interface MermaidResponseDTO extends Omit<MermaidBaseDocument, 'members'> {
|
|
5
|
+
owner: UserOrganizationBasicInfoResponseDTO;
|
|
6
|
+
members: EntityMembersResponseDTO;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UpsertMermaidDTO extends Omit<MermaidBaseDocument, 'key' | 'members'> {
|
|
11
|
+
members: EntityMembersDTO;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { OrganizationPlan } from '../prisma/enums/index.js';
|
|
2
|
+
import type { Theme } from '../types/index.js';
|
|
3
|
+
import type { EmailDataResponseDTO } from './system.js';
|
|
4
|
+
import type { UserOrganizationBasicInfoResponseDTO, UserPermissionsResponseDTO } from './user.js';
|
|
5
|
+
export interface OrganizationJudgeResponseDTO {
|
|
6
|
+
key: string;
|
|
7
|
+
name: string;
|
|
8
|
+
keyPrefix: string;
|
|
9
|
+
}
|
|
10
|
+
export interface OrganizationTrustedCompanyResponseDTO {
|
|
11
|
+
key: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface OrganizationResponseDTO extends EmailDataResponseDTO {
|
|
15
|
+
name: string;
|
|
16
|
+
key: string;
|
|
17
|
+
hosts: string[];
|
|
18
|
+
imageUrl: string;
|
|
19
|
+
managerUser: UserOrganizationBasicInfoResponseDTO;
|
|
20
|
+
systemAdminUser: UserOrganizationBasicInfoResponseDTO;
|
|
21
|
+
plan: OrganizationPlan;
|
|
22
|
+
startTimestamp: number;
|
|
23
|
+
judges: OrganizationJudgeResponseDTO[];
|
|
24
|
+
trustedCompanies: OrganizationTrustedCompanyResponseDTO[];
|
|
25
|
+
styles: OrganizationStylesResponseDTO;
|
|
26
|
+
}
|
|
27
|
+
export interface OrganizationUserPermissionsResponseDTO extends OrganizationResponseDTO {
|
|
28
|
+
userPermissions: UserPermissionsResponseDTO;
|
|
29
|
+
contactEmail: string;
|
|
30
|
+
contactCellPhoneNumber: string;
|
|
31
|
+
contactTelegram: string;
|
|
32
|
+
}
|
|
33
|
+
export interface OrganizationResourcesEcsSpec {
|
|
34
|
+
taskDefinition: string;
|
|
35
|
+
minimum: number;
|
|
36
|
+
maximum: number;
|
|
37
|
+
}
|
|
38
|
+
export interface OrganizationResourcesEc2Instance {
|
|
39
|
+
imageId: string;
|
|
40
|
+
instanceType: string;
|
|
41
|
+
userDataScript: string;
|
|
42
|
+
minimum: number;
|
|
43
|
+
maximum: number;
|
|
44
|
+
}
|
|
45
|
+
export interface OrganizationResourcesTelegramChannel {
|
|
46
|
+
chatId: string;
|
|
47
|
+
messageThreadId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface OrganizationResourcesResponseDTO {
|
|
50
|
+
ecs: {
|
|
51
|
+
listener: OrganizationResourcesEcsSpec;
|
|
52
|
+
highPerformanceRunner: OrganizationResourcesEcsSpec;
|
|
53
|
+
lowPerformanceRunner: OrganizationResourcesEcsSpec;
|
|
54
|
+
};
|
|
55
|
+
ec2: {
|
|
56
|
+
runner: OrganizationResourcesEc2Instance;
|
|
57
|
+
highPerformanceRunner: OrganizationResourcesEc2Instance;
|
|
58
|
+
lowPerformanceRunner: OrganizationResourcesEc2Instance;
|
|
59
|
+
};
|
|
60
|
+
notifications: {
|
|
61
|
+
telegram: {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
info: OrganizationResourcesTelegramChannel;
|
|
64
|
+
error: OrganizationResourcesTelegramChannel;
|
|
65
|
+
};
|
|
66
|
+
slack: {
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
info: {
|
|
69
|
+
webhookUrl: string;
|
|
70
|
+
};
|
|
71
|
+
error: {
|
|
72
|
+
webhookUrl: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
email: {
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
info: {
|
|
78
|
+
address: string;
|
|
79
|
+
};
|
|
80
|
+
error: {
|
|
81
|
+
address: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export type OrganizationStylesResponseDTO = Record<'light' | 'dark', {
|
|
87
|
+
body: {
|
|
88
|
+
backgroundColor: string;
|
|
89
|
+
backgroundColorHighlight: string;
|
|
90
|
+
textColor: string;
|
|
91
|
+
textColorHighlight: string;
|
|
92
|
+
textColorHighlightInset: string;
|
|
93
|
+
accentColor: string;
|
|
94
|
+
accentColorInset: string;
|
|
95
|
+
};
|
|
96
|
+
navbar: {
|
|
97
|
+
textColor: string;
|
|
98
|
+
backgroundColor: string;
|
|
99
|
+
logoTheme: Theme;
|
|
100
|
+
accentColor: string;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ProblemScoringMode, ProblemType } from '../prisma/enums/index.js';
|
|
2
|
+
import type { EntityState, JudgeBaseDocument, ProblemBaseDocument, ProblemSettings, ProblemStatement, ProblemUser, TextLanguage } from '../types/index.js';
|
|
3
|
+
import type { EntityMembersDTO, EntityMembersResponseDTO } from './entity.js';
|
|
4
|
+
import type { EntityOwnerSystemSummaryListResponseDTO, UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
5
|
+
export interface ProblemJudgeSummaryListResponseDTO extends Pick<JudgeBaseDocument, 'isExternal' | 'isSubmitSupported' | 'name' | 'key'> {
|
|
6
|
+
isCustom: boolean;
|
|
7
|
+
isMain: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface EntityCompanySummaryListResponseDTO {
|
|
10
|
+
key: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ProblemBasicSummaryListResponseDTO {
|
|
13
|
+
company: EntityCompanySummaryListResponseDTO;
|
|
14
|
+
judge: ProblemJudgeSummaryListResponseDTO;
|
|
15
|
+
key: string;
|
|
16
|
+
name: string;
|
|
17
|
+
shortname: string;
|
|
18
|
+
tags: string[];
|
|
19
|
+
settings: {
|
|
20
|
+
scoringMode: ProblemScoringMode;
|
|
21
|
+
type: ProblemType;
|
|
22
|
+
};
|
|
23
|
+
members: EntityMembersResponseDTO;
|
|
24
|
+
externalUrl: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ProblemSummaryListResponseDTO extends ProblemBasicSummaryListResponseDTO {
|
|
27
|
+
user: ProblemUser;
|
|
28
|
+
owner: UserOrganizationBasicInfoResponseDTO;
|
|
29
|
+
}
|
|
30
|
+
export interface ProblemDataResponseDTO extends ProblemSummaryListResponseDTO {
|
|
31
|
+
author: string;
|
|
32
|
+
statement: ProblemStatement;
|
|
33
|
+
editorial: TextLanguage;
|
|
34
|
+
settings: ProblemSettings;
|
|
35
|
+
ownerNickname: string;
|
|
36
|
+
state: EntityState;
|
|
37
|
+
}
|
|
38
|
+
export interface ProblemJudgeSystemSummaryListResponseDTO extends ProblemJudgeSummaryListResponseDTO {
|
|
39
|
+
name: string;
|
|
40
|
+
id: string;
|
|
41
|
+
}
|
|
42
|
+
export interface EntityCompanySystemSummaryListResponseDTO extends EntityCompanySummaryListResponseDTO {
|
|
43
|
+
name: string;
|
|
44
|
+
id: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ProblemSystemSummaryListResponseDTO extends ProblemSummaryListResponseDTO {
|
|
47
|
+
state: EntityState;
|
|
48
|
+
id: string;
|
|
49
|
+
owner: EntityOwnerSystemSummaryListResponseDTO;
|
|
50
|
+
judge: ProblemJudgeSystemSummaryListResponseDTO;
|
|
51
|
+
company: EntityCompanySystemSummaryListResponseDTO;
|
|
52
|
+
creationTimestamp: number;
|
|
53
|
+
updateTimestamp: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ProblemTestCaseResponse {
|
|
56
|
+
testCaseKey: string;
|
|
57
|
+
groups: number[];
|
|
58
|
+
inputFileSize: number;
|
|
59
|
+
inputFileLastModified: Date;
|
|
60
|
+
outputFileSize: number;
|
|
61
|
+
outputFileLastModified: Date;
|
|
62
|
+
}
|
|
63
|
+
export interface ProblemTestCasesResponseDTO extends Array<ProblemTestCaseResponse> {
|
|
64
|
+
}
|
|
65
|
+
export interface UpsertProblemDTO extends Omit<ProblemBaseDocument, 'testCases' | 'testCasesUpdatedAtTimestamp' | 'key' | 'members' | 'judgeId'> {
|
|
66
|
+
members: EntityMembersDTO;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { UserSummaryListResponseDTO } from './user.js';
|
|
2
|
+
export type ScoreboardProblem = {
|
|
3
|
+
attempts: number;
|
|
4
|
+
points: number;
|
|
5
|
+
success: boolean;
|
|
6
|
+
penalty: number;
|
|
7
|
+
isFirstAccepted: boolean;
|
|
8
|
+
indexAccepted: number;
|
|
9
|
+
};
|
|
10
|
+
export type ScoreboardProblems = {
|
|
11
|
+
[key: string]: ScoreboardProblem;
|
|
12
|
+
};
|
|
13
|
+
export interface ScoreboardResponseDTO {
|
|
14
|
+
user: UserSummaryListResponseDTO;
|
|
15
|
+
totalPenalty: number;
|
|
16
|
+
totalPoints: number;
|
|
17
|
+
position: number;
|
|
18
|
+
problems: ScoreboardProblems;
|
|
19
|
+
}
|
|
20
|
+
export type ScoreboardTimelineEventResponseDTO = {
|
|
21
|
+
timestamp: number;
|
|
22
|
+
userKey: string;
|
|
23
|
+
problemKey: string;
|
|
24
|
+
attempts: number;
|
|
25
|
+
points: number;
|
|
26
|
+
success: boolean;
|
|
27
|
+
indexAccepted: number;
|
|
28
|
+
penalty: number;
|
|
29
|
+
};
|
|
30
|
+
export interface ScoreboardHistoryResponseDTO {
|
|
31
|
+
contestKey: string;
|
|
32
|
+
userProblemTimelineRefs: Record<string, number[]>;
|
|
33
|
+
timelineEvents: ScoreboardTimelineEventResponseDTO[];
|
|
34
|
+
participants: Record<string, UserSummaryListResponseDTO>;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EntityCompanySystemSummaryListResponseDTO } from './problem.js';
|
|
2
|
+
import type { UserBasicResponseDTO } from './user.js';
|
|
3
|
+
export interface SessionBasicResponseDTO {
|
|
4
|
+
id: string;
|
|
5
|
+
deviceName: string;
|
|
6
|
+
osName: string;
|
|
7
|
+
validUntilTimestamp: number;
|
|
8
|
+
creationTimestamp: number;
|
|
9
|
+
updateTimestamp: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UserSessionSystemSummaryListResponseDTO extends SessionBasicResponseDTO {
|
|
12
|
+
userId: string;
|
|
13
|
+
user: UserBasicResponseDTO;
|
|
14
|
+
company: EntityCompanySystemSummaryListResponseDTO;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|