@juki-team/commons 0.2.5 → 0.2.8
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/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/{company.d.ts → organization.d.ts} +2 -2
- package/dist/constants/{company.js → organization.js} +2 -2
- package/dist/constants/problem.js +1 -1
- package/dist/constants/services.js +10 -10
- package/dist/constants/user.js +1 -1
- package/dist/dto/contest.d.ts +4 -4
- package/dist/dto/organization.d.ts +2 -2
- package/dist/dto/problem.d.ts +5 -6
- package/dist/dto/session.d.ts +2 -2
- package/dist/dto/statistics.d.ts +1 -1
- package/dist/dto/submission.d.ts +5 -5
- package/dist/dto/system.d.ts +2 -2
- package/dist/dto/user.d.ts +9 -9
- package/dist/enums/manual/CollectionKey.d.ts +1 -1
- package/dist/enums/manual/CollectionKey.js +1 -1
- package/dist/enums/manual/EntityCollection.d.ts +1 -1
- package/dist/enums/manual/EntityCollection.js +1 -1
- package/dist/enums/manual/ErrorCode.d.ts +9 -9
- package/dist/enums/manual/ErrorCode.js +10 -10
- package/dist/enums/prisma/TelemetryType.js +1 -1
- package/dist/helpers/comments.d.ts +1 -1
- package/dist/helpers/comments.js +1 -1
- package/dist/helpers/socket.js +3 -3
- package/dist/helpers/user.d.ts +2 -2
- package/dist/helpers/user.js +4 -4
- package/dist/types/entity.d.ts +5 -5
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './commons.js';
|
|
2
|
-
export * from './company.js';
|
|
3
2
|
export * from './contest.js';
|
|
4
3
|
export * from './course.js';
|
|
5
4
|
export * from './date.js';
|
|
@@ -8,6 +7,7 @@ export * from './email.js';
|
|
|
8
7
|
export * from './entity.js';
|
|
9
8
|
export * from './file.js';
|
|
10
9
|
export * from './judge.js';
|
|
10
|
+
export * from './organization.js';
|
|
11
11
|
export * from './problem.js';
|
|
12
12
|
export * from './routing.js';
|
|
13
13
|
export * from './services.js';
|
package/dist/constants/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './commons.js';
|
|
2
|
-
export * from './company.js';
|
|
3
2
|
export * from './contest.js';
|
|
4
3
|
export * from './course.js';
|
|
5
4
|
export * from './date.js';
|
|
@@ -8,6 +7,7 @@ export * from './email.js';
|
|
|
8
7
|
export * from './entity.js';
|
|
9
8
|
export * from './file.js';
|
|
10
9
|
export * from './judge.js';
|
|
10
|
+
export * from './organization.js';
|
|
11
11
|
export * from './problem.js';
|
|
12
12
|
export * from './routing.js';
|
|
13
13
|
export * from './services.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrganizationPlan } from '../enums/index.js';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const JUKI_APP_ORGANIZATION_KEY = "juki-app";
|
|
3
|
+
export declare const ORGANIZATION_PLAN: {
|
|
4
4
|
[Key in OrganizationPlan]: {
|
|
5
5
|
value: OrganizationPlan;
|
|
6
6
|
label: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrganizationPlan } from '../enums/index.js';
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
2
|
+
export const JUKI_APP_ORGANIZATION_KEY = 'juki-app';
|
|
3
|
+
export const ORGANIZATION_PLAN = {
|
|
4
4
|
[OrganizationPlan.FREE]: {
|
|
5
5
|
value: OrganizationPlan.FREE,
|
|
6
6
|
label: 'free',
|
|
@@ -55,7 +55,7 @@ export const PROBLEM_TYPE = {
|
|
|
55
55
|
"The resulting user's executable does I/O standard input and output. " +
|
|
56
56
|
"The output produced by the contestant's program is saved. " +
|
|
57
57
|
'The problem editor save a single source code in C++ 17. ' +
|
|
58
|
-
"The editor's source code can read judge input filepath argv[1], judge output filepath argv[2], user's output filepath argv[3], user's error filepath argv[4], user's log filepath argv[5], user's source filepath argv[6] and submission information filepath argv[7] (
|
|
58
|
+
"The editor's source code can read judge input filepath argv[1], judge output filepath argv[2], user's output filepath argv[3], user's error filepath argv[4], user's log filepath argv[5], user's source filepath argv[6] and submission information filepath argv[7] (organizationId, submitId, runId, userId, contestId, problemId, language, userNickname, timestamp). " +
|
|
59
59
|
'The resulting editor\'s executable should be "AC" or a number between 1 and 100 for partial accepted',
|
|
60
60
|
},
|
|
61
61
|
};
|
|
@@ -13,16 +13,16 @@ export const ERROR_HTTP_STATUS = {
|
|
|
13
13
|
[ErrorCode.ABORTED_REQUEST]: 400,
|
|
14
14
|
[ErrorCode.ERROR_ON_RESPONSE]: 400,
|
|
15
15
|
[ErrorCode.SERVICE_NOT_FOUND]: 404,
|
|
16
|
-
//
|
|
17
|
-
[ErrorCode.
|
|
18
|
-
[ErrorCode.
|
|
19
|
-
[ErrorCode.
|
|
20
|
-
[ErrorCode.
|
|
21
|
-
[ErrorCode.
|
|
22
|
-
[ErrorCode.
|
|
23
|
-
[ErrorCode.
|
|
24
|
-
[ErrorCode.
|
|
25
|
-
[ErrorCode.
|
|
16
|
+
// Organization errors
|
|
17
|
+
[ErrorCode.INTERNAL_SERVER_ERROR_ON_ORGANIZATION_SERVICE]: 500,
|
|
18
|
+
[ErrorCode.ORGANIZATION_NOT_CREATED]: 500,
|
|
19
|
+
[ErrorCode.ORGANIZATION_NOT_FOUND]: 404,
|
|
20
|
+
[ErrorCode.ORGANIZATION_NOT_UPDATED]: 500,
|
|
21
|
+
[ErrorCode.ORGANIZATION_NOT_DELETED]: 500,
|
|
22
|
+
[ErrorCode.NOT_ALLOWED_TO_CREATE_ORGANIZATION]: 403,
|
|
23
|
+
[ErrorCode.NOT_ALLOWED_TO_VIEW_ORGANIZATION]: 403,
|
|
24
|
+
[ErrorCode.NOT_ALLOWED_TO_UPDATE_ORGANIZATION]: 403,
|
|
25
|
+
[ErrorCode.NOT_ALLOWED_TO_DELETE_ORGANIZATION]: 403,
|
|
26
26
|
// User errors
|
|
27
27
|
[ErrorCode.INTERNAL_SERVER_ERROR_ON_USERS_SERVICE]: 500,
|
|
28
28
|
[ErrorCode.USER_NOT_CREATED]: 500,
|
package/dist/constants/user.js
CHANGED
package/dist/dto/contest.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ContestEventAction, ContestProblemBlockedByType, EntityState } from '../enums/index.js';
|
|
2
2
|
import type { ContestBaseDocument, ContestClarification, ContestProblem, ContestProblemPrerequisite, ContestSettings, ContestUser, ProblemSettings, ProblemStatement, TextLanguage } from '../types/index.js';
|
|
3
3
|
import type { EntityMembersDTO, EntityMembersWithTimestampsResponseDTO } from './entity.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { EntityOrganizationSummaryListResponseDTO, EntityOrganizationSystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO, ProblemSummaryListResponseDTO } from './problem.js';
|
|
5
5
|
import type { EntityOwnerSystemSummaryListResponseDTO, UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
6
6
|
export type UpsertContestProblemPrerequisiteDTO = (Omit<ContestProblemPrerequisite, 'problemId'> & {
|
|
7
7
|
problemIndex: string;
|
|
@@ -20,7 +20,7 @@ export interface UpsertContestDTO extends Omit<ContestBaseDocument, 'key' | 'mem
|
|
|
20
20
|
export interface ContestSummaryListResponseDTO extends Pick<ContestBaseDocument, 'key' | 'name' | 'tags'> {
|
|
21
21
|
user: ContestUser;
|
|
22
22
|
owner: UserOrganizationBasicInfoResponseDTO;
|
|
23
|
-
|
|
23
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
24
24
|
settings: Pick<ContestSettings, 'startTimestamp' | 'endTimestamp' | 'frozenTimestamp' | 'quietTimestamp' | 'penalty' | 'upsolvingEnabled'>;
|
|
25
25
|
totalContestants: number;
|
|
26
26
|
isLive: boolean;
|
|
@@ -35,7 +35,7 @@ export interface ContestSystemSummaryListResponseDTO extends ContestSummaryListR
|
|
|
35
35
|
state: EntityState;
|
|
36
36
|
id: string;
|
|
37
37
|
owner: EntityOwnerSystemSummaryListResponseDTO;
|
|
38
|
-
|
|
38
|
+
organization: EntityOrganizationSystemSummaryListResponseDTO;
|
|
39
39
|
creationTimestamp: number;
|
|
40
40
|
updateTimestamp: number;
|
|
41
41
|
}
|
|
@@ -45,7 +45,7 @@ export interface ContestProblemBasicDataResponseDTO extends Omit<ContestProblem,
|
|
|
45
45
|
prerequisites: UpsertContestProblemPrerequisiteDTO;
|
|
46
46
|
judge: ProblemJudgeSummaryListResponseDTO;
|
|
47
47
|
tags: string[];
|
|
48
|
-
|
|
48
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
49
49
|
}
|
|
50
50
|
export interface ContestContestProblemDataResponseDTO extends Omit<ProblemSummaryListResponseDTO, 'user'> {
|
|
51
51
|
author: string;
|
|
@@ -6,7 +6,7 @@ export interface OrganizationJudgeResponseDTO {
|
|
|
6
6
|
name: string;
|
|
7
7
|
keyPrefix: string;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface OrganizationTrustedOrganizationResponseDTO {
|
|
10
10
|
key: string;
|
|
11
11
|
name: string;
|
|
12
12
|
}
|
|
@@ -20,7 +20,7 @@ export interface OrganizationResponseDTO extends EmailDataResponseDTO {
|
|
|
20
20
|
plan: OrganizationPlan;
|
|
21
21
|
startTimestamp: number;
|
|
22
22
|
judges: OrganizationJudgeResponseDTO[];
|
|
23
|
-
|
|
23
|
+
trustedOrganizations: OrganizationTrustedOrganizationResponseDTO[];
|
|
24
24
|
styles: OrganizationStylesResponseDTO;
|
|
25
25
|
}
|
|
26
26
|
export interface OrganizationUserPermissionsResponseDTO extends OrganizationResponseDTO {
|
package/dist/dto/problem.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { EntityState, ProblemScoringMode, ProblemType } from '../enums/index.js';
|
|
2
2
|
import type { JudgeBaseDocument, ProblemBaseDocument, ProblemSettings, ProblemStatement, ProblemUser, TextLanguage } from '../types/index.js';
|
|
3
|
-
import type { EntityMembersDTO
|
|
3
|
+
import type { EntityMembersDTO } from './entity.js';
|
|
4
4
|
import type { EntityOwnerSystemSummaryListResponseDTO, UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
5
5
|
export interface ProblemJudgeSummaryListResponseDTO extends Pick<JudgeBaseDocument, 'isExternal' | 'isSubmitSupported' | 'name' | 'key'> {
|
|
6
6
|
isCustom: boolean;
|
|
7
7
|
isMain: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface EntityOrganizationSummaryListResponseDTO {
|
|
10
10
|
key: string;
|
|
11
11
|
}
|
|
12
12
|
export interface ProblemBasicSummaryListResponseDTO {
|
|
13
|
-
|
|
13
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
14
14
|
judge: ProblemJudgeSummaryListResponseDTO;
|
|
15
15
|
key: string;
|
|
16
16
|
name: string;
|
|
@@ -20,7 +20,6 @@ export interface ProblemBasicSummaryListResponseDTO {
|
|
|
20
20
|
scoringMode: ProblemScoringMode;
|
|
21
21
|
type: ProblemType;
|
|
22
22
|
};
|
|
23
|
-
members: EntityMembersResponseDTO;
|
|
24
23
|
externalUrl: string;
|
|
25
24
|
}
|
|
26
25
|
export interface ProblemSummaryListResponseDTO extends ProblemBasicSummaryListResponseDTO {
|
|
@@ -39,7 +38,7 @@ export interface ProblemJudgeSystemSummaryListResponseDTO extends ProblemJudgeSu
|
|
|
39
38
|
name: string;
|
|
40
39
|
id: string;
|
|
41
40
|
}
|
|
42
|
-
export interface
|
|
41
|
+
export interface EntityOrganizationSystemSummaryListResponseDTO extends EntityOrganizationSummaryListResponseDTO {
|
|
43
42
|
name: string;
|
|
44
43
|
id: string;
|
|
45
44
|
}
|
|
@@ -48,7 +47,7 @@ export interface ProblemSystemSummaryListResponseDTO extends ProblemSummaryListR
|
|
|
48
47
|
id: string;
|
|
49
48
|
owner: EntityOwnerSystemSummaryListResponseDTO;
|
|
50
49
|
judge: ProblemJudgeSystemSummaryListResponseDTO;
|
|
51
|
-
|
|
50
|
+
organization: EntityOrganizationSystemSummaryListResponseDTO;
|
|
52
51
|
creationTimestamp: number;
|
|
53
52
|
updateTimestamp: number;
|
|
54
53
|
}
|
package/dist/dto/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EntityOrganizationSystemSummaryListResponseDTO } from './problem.js';
|
|
2
2
|
import type { UserBasicResponseDTO } from './user.js';
|
|
3
3
|
export interface SessionBasicResponseDTO {
|
|
4
4
|
id: string;
|
|
@@ -11,5 +11,5 @@ export interface SessionBasicResponseDTO {
|
|
|
11
11
|
export interface UserSessionSystemSummaryListResponseDTO extends SessionBasicResponseDTO {
|
|
12
12
|
userId: string;
|
|
13
13
|
user: UserBasicResponseDTO;
|
|
14
|
-
|
|
14
|
+
organization: EntityOrganizationSystemSummaryListResponseDTO;
|
|
15
15
|
}
|
package/dist/dto/statistics.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
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
|
|
4
|
+
export interface StatisticsOrganizationResponseDTO {
|
|
5
5
|
codeEditorRuns: StatisticsGrouped<number>;
|
|
6
6
|
judgingRuns: StatisticsGrouped<number>;
|
|
7
7
|
reJudgingRuns: StatisticsGrouped<number>;
|
package/dist/dto/submission.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CodeLanguage, EntityState, ProblemScoringMode, ProblemType, ProblemVerdict, SubmissionRunStatus } from '../enums/index.js';
|
|
2
2
|
import type { ContestUser, DataLog } from '../types/index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EntityOrganizationSummaryListResponseDTO, EntityOrganizationSystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO } from './problem.js';
|
|
4
4
|
import type { UserOrganizationBasicInfoResponseDTO } from './user.js';
|
|
5
5
|
export interface SubmissionProblemSummaryListResponseDTO {
|
|
6
6
|
isAdministrator: boolean;
|
|
@@ -11,7 +11,7 @@ export interface SubmissionProblemSummaryListResponseDTO {
|
|
|
11
11
|
type: ProblemType;
|
|
12
12
|
timeLimit: number;
|
|
13
13
|
memoryLimit: number;
|
|
14
|
-
|
|
14
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
15
15
|
judge: ProblemJudgeSummaryListResponseDTO;
|
|
16
16
|
}
|
|
17
17
|
export interface SubmissionContestSummaryListResponseDTO {
|
|
@@ -21,7 +21,7 @@ export interface SubmissionContestSummaryListResponseDTO {
|
|
|
21
21
|
isManager: boolean;
|
|
22
22
|
problemIndex: string;
|
|
23
23
|
problemColor: string;
|
|
24
|
-
|
|
24
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
25
25
|
isFrozen: boolean;
|
|
26
26
|
isQuiet: boolean;
|
|
27
27
|
isUpsolving: boolean;
|
|
@@ -52,7 +52,7 @@ export interface SubmissionSummaryListResponseDTO {
|
|
|
52
52
|
processed: number;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
56
56
|
}
|
|
57
57
|
export interface SubmissionProblemSystemSummaryListResponseDTO extends SubmissionProblemSummaryListResponseDTO {
|
|
58
58
|
id: string;
|
|
@@ -64,7 +64,7 @@ export interface SubmissionContestSystemSummaryListResponseDTO extends Submissio
|
|
|
64
64
|
export interface SubmissionSystemSummaryListResponseDTO extends SubmissionSummaryListResponseDTO {
|
|
65
65
|
problem: SubmissionProblemSystemSummaryListResponseDTO;
|
|
66
66
|
contest: SubmissionContestSystemSummaryListResponseDTO | null;
|
|
67
|
-
|
|
67
|
+
organization: EntityOrganizationSystemSummaryListResponseDTO;
|
|
68
68
|
creationTimestamp: number;
|
|
69
69
|
updateTimestamp: number;
|
|
70
70
|
state: EntityState;
|
package/dist/dto/system.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface EcsTask {
|
|
|
16
16
|
containers?: TaskResponseDTOContainer[];
|
|
17
17
|
}
|
|
18
18
|
export interface EcsTaskSystemSummaryListResponseDTO extends EcsTask {
|
|
19
|
-
|
|
19
|
+
isHighRunnerOrganizationKeys: string[];
|
|
20
20
|
}
|
|
21
21
|
export interface EcsTaskDefinition {
|
|
22
22
|
family: string;
|
|
@@ -27,7 +27,7 @@ export interface EcsTaskDefinition {
|
|
|
27
27
|
registeredAt: Date;
|
|
28
28
|
}
|
|
29
29
|
export interface EcsTaskDefinitionSystemSummaryListResponseDTO extends EcsTaskDefinition {
|
|
30
|
-
|
|
30
|
+
isHighRunnerOrganizationKeys: string[];
|
|
31
31
|
}
|
|
32
32
|
export interface Ec2Instance {
|
|
33
33
|
instanceId: string;
|
package/dist/dto/user.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { ContestRole, CourseRole, FileRole, ProblemRole, SystemRole, TeamRole, UserRole } from '../enums/index.js';
|
|
2
2
|
import type { RecordId, UserBasicInfo, UserHandles, UserSettings } from '../types/index.js';
|
|
3
3
|
import type { OrganizationStylesResponseDTO } from './organization.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { EntityOrganizationSummaryListResponseDTO, EntityOrganizationSystemSummaryListResponseDTO } from './problem.js';
|
|
5
5
|
export interface EntityOwnerSystemSummaryListResponseDTO {
|
|
6
6
|
id: string;
|
|
7
7
|
nickname: string;
|
|
8
8
|
imageUrl: string;
|
|
9
|
-
|
|
9
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
10
10
|
}
|
|
11
11
|
export interface UserOrganizationBasicInfoResponseDTO extends UserBasicInfo {
|
|
12
|
-
|
|
12
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
13
13
|
}
|
|
14
14
|
export interface UserSummaryListResponseDTO extends UserOrganizationBasicInfoResponseDTO {
|
|
15
15
|
email: string;
|
|
@@ -30,7 +30,7 @@ export interface UserSystemSummaryListResponseDTO extends UserSummaryListRespons
|
|
|
30
30
|
courseRole: CourseRole;
|
|
31
31
|
canResetPassword: boolean;
|
|
32
32
|
owner: EntityOwnerSystemSummaryListResponseDTO;
|
|
33
|
-
|
|
33
|
+
organization: EntityOrganizationSystemSummaryListResponseDTO;
|
|
34
34
|
createdAt: number;
|
|
35
35
|
updatedAt: number;
|
|
36
36
|
archivedAt: number | null;
|
|
@@ -66,7 +66,7 @@ export type UserPermissionsResponseDTO = {
|
|
|
66
66
|
create: boolean;
|
|
67
67
|
manage: boolean;
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
organization: {
|
|
70
70
|
manage: boolean;
|
|
71
71
|
administrate: boolean;
|
|
72
72
|
};
|
|
@@ -81,9 +81,9 @@ export type UserPing = {
|
|
|
81
81
|
settings: UserSettings;
|
|
82
82
|
isLogged: boolean;
|
|
83
83
|
sessionId: RecordId;
|
|
84
|
-
|
|
84
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
85
85
|
};
|
|
86
|
-
export type
|
|
86
|
+
export type OrganizationPingResponseDTO = {
|
|
87
87
|
key: string;
|
|
88
88
|
contactEmail: string;
|
|
89
89
|
contactCellPhoneNumber: string;
|
|
@@ -95,7 +95,7 @@ export type CompanyPingResponseDTO = {
|
|
|
95
95
|
};
|
|
96
96
|
export interface PingResponseDTO {
|
|
97
97
|
user: UserPing;
|
|
98
|
-
|
|
98
|
+
organization: OrganizationPingResponseDTO;
|
|
99
99
|
}
|
|
100
100
|
export interface UserRankResponseDTO {
|
|
101
101
|
imageUrl: string;
|
|
@@ -105,5 +105,5 @@ export interface UserRankResponseDTO {
|
|
|
105
105
|
institution: string;
|
|
106
106
|
problemPoints: number;
|
|
107
107
|
competitionPoints: number;
|
|
108
|
-
|
|
108
|
+
organization: EntityOrganizationSummaryListResponseDTO;
|
|
109
109
|
}
|
|
@@ -9,15 +9,15 @@ export declare const ErrorCode: {
|
|
|
9
9
|
readonly ABORTED_REQUEST: "ABORTED_REQUEST";
|
|
10
10
|
readonly ERROR_ON_RESPONSE: "ERROR_ON_RESPONSE";
|
|
11
11
|
readonly SERVICE_NOT_FOUND: "SERVICE_NOT_FOUND";
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
12
|
+
readonly INTERNAL_SERVER_ERROR_ON_ORGANIZATION_SERVICE: "INTERNAL_SERVER_ERROR_ON_ORGANIZATION_SERVICE";
|
|
13
|
+
readonly ORGANIZATION_NOT_CREATED: "ORGANIZATION_NOT_CREATED";
|
|
14
|
+
readonly ORGANIZATION_NOT_FOUND: "ORGANIZATION_NOT_FOUND";
|
|
15
|
+
readonly ORGANIZATION_NOT_UPDATED: "ORGANIZATION_NOT_UPDATED";
|
|
16
|
+
readonly ORGANIZATION_NOT_DELETED: "ORGANIZATION_NOT_DELETED";
|
|
17
|
+
readonly NOT_ALLOWED_TO_CREATE_ORGANIZATION: "NOT_ALLOWED_TO_CREATE_ORGANIZATION";
|
|
18
|
+
readonly NOT_ALLOWED_TO_VIEW_ORGANIZATION: "NOT_ALLOWED_TO_VIEW_ORGANIZATION";
|
|
19
|
+
readonly NOT_ALLOWED_TO_UPDATE_ORGANIZATION: "NOT_ALLOWED_TO_UPDATE_ORGANIZATION";
|
|
20
|
+
readonly NOT_ALLOWED_TO_DELETE_ORGANIZATION: "NOT_ALLOWED_TO_DELETE_ORGANIZATION";
|
|
21
21
|
readonly INTERNAL_SERVER_ERROR_ON_USERS_SERVICE: "INTERNAL_SERVER_ERROR_ON_USERS_SERVICE";
|
|
22
22
|
readonly USER_NOT_CREATED: "USER_NOT_CREATED";
|
|
23
23
|
readonly USER_NOT_FOUND: "USER_NOT_FOUND";
|
|
@@ -11,16 +11,16 @@ export const ErrorCode = {
|
|
|
11
11
|
ABORTED_REQUEST: 'ABORTED_REQUEST',
|
|
12
12
|
ERROR_ON_RESPONSE: 'ERROR_ON_RESPONSE',
|
|
13
13
|
SERVICE_NOT_FOUND: 'SERVICE_NOT_FOUND',
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
// Organization errors
|
|
15
|
+
INTERNAL_SERVER_ERROR_ON_ORGANIZATION_SERVICE: 'INTERNAL_SERVER_ERROR_ON_ORGANIZATION_SERVICE',
|
|
16
|
+
ORGANIZATION_NOT_CREATED: 'ORGANIZATION_NOT_CREATED',
|
|
17
|
+
ORGANIZATION_NOT_FOUND: 'ORGANIZATION_NOT_FOUND',
|
|
18
|
+
ORGANIZATION_NOT_UPDATED: 'ORGANIZATION_NOT_UPDATED',
|
|
19
|
+
ORGANIZATION_NOT_DELETED: 'ORGANIZATION_NOT_DELETED',
|
|
20
|
+
NOT_ALLOWED_TO_CREATE_ORGANIZATION: 'NOT_ALLOWED_TO_CREATE_ORGANIZATION',
|
|
21
|
+
NOT_ALLOWED_TO_VIEW_ORGANIZATION: 'NOT_ALLOWED_TO_VIEW_ORGANIZATION',
|
|
22
|
+
NOT_ALLOWED_TO_UPDATE_ORGANIZATION: 'NOT_ALLOWED_TO_UPDATE_ORGANIZATION',
|
|
23
|
+
NOT_ALLOWED_TO_DELETE_ORGANIZATION: 'NOT_ALLOWED_TO_DELETE_ORGANIZATION',
|
|
24
24
|
// User errors
|
|
25
25
|
INTERNAL_SERVER_ERROR_ON_USERS_SERVICE: 'INTERNAL_SERVER_ERROR_ON_USERS_SERVICE',
|
|
26
26
|
USER_NOT_CREATED: 'USER_NOT_CREATED',
|
|
@@ -4,5 +4,5 @@ export const TelemetryType = {
|
|
|
4
4
|
EC2: 'EC2',
|
|
5
5
|
ECS_TASK: 'ECS_TASK',
|
|
6
6
|
INSTANCES: 'INSTANCES',
|
|
7
|
-
USER_SESSION: 'USER_SESSION', //
|
|
7
|
+
USER_SESSION: 'USER_SESSION', // organization-id/user-id: { timestamp: number, href: string, uiId: string
|
|
8
8
|
};
|
|
@@ -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,
|
|
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;
|
package/dist/helpers/comments.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const getAssignmentCommentKey = (classKey, cycleKey, sessionKey, assignmentKey) => `class:${classKey}|cycle:${cycleKey}|session:${sessionKey}|assignment:${assignmentKey}`;
|
|
2
|
-
export const getAssignmentUserCommentKey = (classKey, cycleKey, sessionKey, assignmentKey, userNickname,
|
|
2
|
+
export const getAssignmentUserCommentKey = (classKey, cycleKey, sessionKey, assignmentKey, userNickname, userOrganization) => `class:${classKey}|cycle:${cycleKey}|session:${sessionKey}|assignment:${assignmentKey}|user_nickname:${userNickname}|user_organization:${userOrganization}`;
|
|
3
3
|
export const getProblemCommentKey = (problemKey) => `problem:${problemKey}`;
|
|
4
4
|
export const getContestCommentKey = (contestKey) => `contest:${contestKey}`;
|
package/dist/helpers/socket.js
CHANGED
|
@@ -129,14 +129,14 @@ export const isUserMessageWebSocketResponseEventDTO = (event) => {
|
|
|
129
129
|
return false;
|
|
130
130
|
const v = event;
|
|
131
131
|
const user = v.user;
|
|
132
|
-
const
|
|
132
|
+
const organization = user?.organization;
|
|
133
133
|
return (event.event === WebSocketResponseEvent.USER_MESSAGE &&
|
|
134
134
|
typeof user?.nickname === 'string' &&
|
|
135
135
|
!!user.nickname &&
|
|
136
136
|
typeof user?.imageUrl === 'string' &&
|
|
137
137
|
!!user.imageUrl &&
|
|
138
|
-
typeof
|
|
139
|
-
!!
|
|
138
|
+
typeof organization?.key === 'string' &&
|
|
139
|
+
!!organization.key &&
|
|
140
140
|
!!v.content);
|
|
141
141
|
};
|
|
142
142
|
export const isSendDataWebSocketResponseEventDTO = (event) => {
|
package/dist/helpers/user.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ClientId, RecordId } from '../types/index.js';
|
|
2
|
-
export declare const getUserKey: (userNickname: string,
|
|
2
|
+
export declare const getUserKey: (userNickname: string, userOrganizationKey: string) => string;
|
|
3
3
|
export declare const getParamsOfUserKey: (userKey: string) => {
|
|
4
4
|
userNickname: string;
|
|
5
|
-
|
|
5
|
+
userOrganizationKey: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const getClientId: (sessionId: RecordId, uiId: string) => ClientId;
|
|
8
8
|
export declare const getParamsOfClientId: (clientId: ClientId) => {
|
package/dist/helpers/user.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const getUserKey = (userNickname,
|
|
2
|
-
return `${userNickname}|${
|
|
1
|
+
export const getUserKey = (userNickname, userOrganizationKey) => {
|
|
2
|
+
return `${userNickname}|${userOrganizationKey}`;
|
|
3
3
|
};
|
|
4
4
|
export const getParamsOfUserKey = (userKey) => {
|
|
5
|
-
const [userNickname,
|
|
6
|
-
return { userNickname,
|
|
5
|
+
const [userNickname, userOrganizationKey] = userKey.split('|');
|
|
6
|
+
return { userNickname, userOrganizationKey };
|
|
7
7
|
};
|
|
8
8
|
export const getClientId = (sessionId, uiId) => {
|
|
9
9
|
return `${sessionId}|${uiId}`;
|
package/dist/types/entity.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ export interface EntityMembers {
|
|
|
36
36
|
export interface EntityOwnerDocument {
|
|
37
37
|
ownerUserId: string;
|
|
38
38
|
}
|
|
39
|
-
export interface
|
|
40
|
-
|
|
39
|
+
export interface EntityOrganizationDocument {
|
|
40
|
+
organizationId: string;
|
|
41
41
|
}
|
|
42
42
|
export interface EntityTimestampsDocument {
|
|
43
43
|
createdAt: Date;
|
|
@@ -62,9 +62,9 @@ export interface EntityLog {
|
|
|
62
62
|
export interface EntityLogsDocument {
|
|
63
63
|
logs: EntityLog[];
|
|
64
64
|
}
|
|
65
|
-
export type NewEntityDocument<T> = T &
|
|
66
|
-
export type CreateEntityDocument<T> = Omit<T, '_id' | 'createdAt' | 'updatedAt' | '
|
|
67
|
-
export type UpdateEntityDocument<T> = Partial<Omit<T, '_id' | 'createdAt' | 'updatedAt' | '
|
|
65
|
+
export type NewEntityDocument<T> = T & EntityOrganizationDocument & EntityOwnerDocument & EntityTimestampsDocument & EntityStateDocument & EntityLogsDocument;
|
|
66
|
+
export type CreateEntityDocument<T> = Omit<T, '_id' | 'createdAt' | 'updatedAt' | 'organizationId' | 'ownerUserId' | 'state' | 'logs'>;
|
|
67
|
+
export type UpdateEntityDocument<T> = Partial<Omit<T, '_id' | 'createdAt' | 'updatedAt' | 'organizationId' | 'ownerUserId' | 'state' | 'logs' | 'key'>>;
|
|
68
68
|
export interface LogDataResponseDTO {
|
|
69
69
|
changes: EntityLogChanges[];
|
|
70
70
|
timestamp: number;
|