@juki-team/commons 0.2.4 → 0.2.6

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.
@@ -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,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 JUKI_APP_COMPANY_KEY = "juki-app";
3
- export declare const COMPANY_PLAN: {
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 JUKI_APP_COMPANY_KEY = 'juki-app';
3
- export const COMPANY_PLAN = {
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] (companyId, submitId, runId, userId, contestId, problemId, language, userNickname, timestamp). " +
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
  };
@@ -1,5 +1,5 @@
1
1
  import { ErrorCode } from '../enums/index.js';
2
2
  export declare const getErrorMessage: (code: ErrorCode) => string;
3
3
  export declare const ERROR_HTTP_STATUS: {
4
- [Key in ErrorCode]: 500 | 400 | 401 | 403 | 404 | 405;
4
+ [Key in ErrorCode]: 500 | 400 | 401 | 403 | 404 | 405 | 409;
5
5
  };
@@ -8,36 +8,37 @@ export const ERROR_HTTP_STATUS = {
8
8
  [ErrorCode.FORBIDDEN]: 403,
9
9
  [ErrorCode.NOT_FOUND]: 404,
10
10
  [ErrorCode.METHOD_NOT_ALLOWED]: 405,
11
+ [ErrorCode.CONFLICT]: 409,
11
12
  // UI general errors
12
13
  [ErrorCode.ABORTED_REQUEST]: 400,
13
14
  [ErrorCode.ERROR_ON_RESPONSE]: 400,
14
15
  [ErrorCode.SERVICE_NOT_FOUND]: 404,
15
- // Company errors
16
- [ErrorCode.INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE]: 500,
17
- [ErrorCode.COMPANY_NOT_CREATED]: 500,
18
- [ErrorCode.COMPANY_NOT_FOUND]: 404,
19
- [ErrorCode.COMPANY_NOT_UPDATED]: 500,
20
- [ErrorCode.COMPANY_NOT_DELETED]: 500,
21
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_COMPANY]: 403,
22
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_COMPANY]: 403,
23
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_COMPANY]: 403,
24
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_COMPANY]: 403,
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,
25
26
  // User errors
26
27
  [ErrorCode.INTERNAL_SERVER_ERROR_ON_USERS_SERVICE]: 500,
27
28
  [ErrorCode.USER_NOT_CREATED]: 500,
28
29
  [ErrorCode.USER_NOT_FOUND]: 404,
30
+ [ErrorCode.USER_NOT_FOUND_BY_EMAIL]: 404,
31
+ [ErrorCode.USER_NOT_FOUND_BY_NICKNAME]: 404,
29
32
  [ErrorCode.USER_NOT_UPDATED]: 500,
30
33
  [ErrorCode.USER_NOT_DELETED]: 500,
31
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_USER]: 403,
32
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_USER]: 403,
33
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_USER]: 403,
34
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_USER]: 403,
34
+ [ErrorCode.NOT_ALLOWED_TO_CREATE_USER]: 403,
35
+ [ErrorCode.NOT_ALLOWED_TO_VIEW_USER]: 403,
36
+ [ErrorCode.NOT_ALLOWED_TO_UPDATE_USER]: 403,
37
+ [ErrorCode.NOT_ALLOWED_TO_DELETE_USER]: 403,
35
38
  [ErrorCode.USER_IS_REPORTED]: 403,
36
39
  [ErrorCode.USER_IS_ARCHIVED]: 403,
37
- [ErrorCode.USER_WITH_EMAIL_REQUESTED_NOT_FOUND]: 404,
38
- [ErrorCode.USER_WITH_NICKNAME_REQUESTED_NOT_FOUND]: 404,
39
- [ErrorCode.THE_EMAIL_IS_ALREADY_REGISTERED]: 400,
40
- [ErrorCode.THE_NICKNAME_IS_ALREADY_TAKEN]: 400,
40
+ [ErrorCode.EMAIL_ALREADY_IN_USE]: 409,
41
+ [ErrorCode.NICKNAME_ALREADY_TAKEN]: 409,
41
42
  [ErrorCode.INCORRECT_PASSWORD]: 401,
42
43
  [ErrorCode.USER_SESSION_NOT_CREATED]: 500,
43
44
  [ErrorCode.USER_SESSION_NOT_FOUND]: 404,
@@ -49,13 +50,13 @@ export const ERROR_HTTP_STATUS = {
49
50
  [ErrorCode.PROBLEM_NOT_FOUND]: 404,
50
51
  [ErrorCode.PROBLEM_NOT_UPDATED]: 500,
51
52
  [ErrorCode.PROBLEM_NOT_DELETED]: 500,
52
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_PROBLEM]: 403,
53
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_PROBLEM]: 403,
54
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_PROBLEM]: 403,
55
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_PROBLEM]: 403,
53
+ [ErrorCode.NOT_ALLOWED_TO_CREATE_PROBLEM]: 403,
54
+ [ErrorCode.NOT_ALLOWED_TO_VIEW_PROBLEM]: 403,
55
+ [ErrorCode.NOT_ALLOWED_TO_UPDATE_PROBLEM]: 403,
56
+ [ErrorCode.NOT_ALLOWED_TO_DELETE_PROBLEM]: 403,
56
57
  [ErrorCode.PROBLEM_MODE_NOT_SUPPORTED]: 400,
57
58
  [ErrorCode.PROBLEM_TYPE_NOT_SUPPORTED]: 400,
58
- [ErrorCode.PROBLEM_TIME_LIMIT_MUST_BE_A_NUMBER]: 400,
59
+ [ErrorCode.PROBLEM_TIME_LIMIT_MUST_BE_NUMBER]: 400,
59
60
  [ErrorCode.PROBLEM_MEMORY_LIMIT_MUST_BE_NUMBER]: 400,
60
61
  [ErrorCode.TEST_CASE_FILE_EMPTY]: 400,
61
62
  // Contest errors
@@ -64,21 +65,21 @@ export const ERROR_HTTP_STATUS = {
64
65
  [ErrorCode.CONTEST_NOT_FOUND]: 404,
65
66
  [ErrorCode.CONTEST_NOT_UPDATED]: 500,
66
67
  [ErrorCode.CONTEST_NOT_DELETED]: 500,
67
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_CONTEST]: 403,
68
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_CONTEST]: 403,
69
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_CONTEST]: 403,
70
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_CONTEST]: 403,
71
- [ErrorCode.NOT_ALLOWED_TO_REGISTER_TO_THE_CONTEST]: 403,
72
- [ErrorCode.IS_ALREADY_REGISTERED]: 400,
68
+ [ErrorCode.NOT_ALLOWED_TO_CREATE_CONTEST]: 403,
69
+ [ErrorCode.NOT_ALLOWED_TO_VIEW_CONTEST]: 403,
70
+ [ErrorCode.NOT_ALLOWED_TO_UPDATE_CONTEST]: 403,
71
+ [ErrorCode.NOT_ALLOWED_TO_DELETE_CONTEST]: 403,
72
+ [ErrorCode.NOT_ALLOWED_TO_REGISTER_TO_CONTEST]: 403,
73
+ [ErrorCode.ALREADY_REGISTERED]: 409,
73
74
  [ErrorCode.NOT_ALLOWED_TO_VIEW_CONTESTS]: 403,
74
75
  [ErrorCode.SCOREBOARD_NOT_CREATED]: 500,
75
76
  [ErrorCode.SCOREBOARD_NOT_FOUND]: 404,
76
77
  [ErrorCode.SCOREBOARD_NOT_UPDATED]: 500,
77
78
  [ErrorCode.SCOREBOARD_NOT_DELETED]: 500,
78
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_SCOREBOARD]: 403,
79
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_SCOREBOARD]: 403,
80
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_SCOREBOARD]: 403,
81
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_SCOREBOARD]: 403,
79
+ [ErrorCode.NOT_ALLOWED_TO_CREATE_SCOREBOARD]: 403,
80
+ [ErrorCode.NOT_ALLOWED_TO_VIEW_SCOREBOARD]: 403,
81
+ [ErrorCode.NOT_ALLOWED_TO_UPDATE_SCOREBOARD]: 403,
82
+ [ErrorCode.NOT_ALLOWED_TO_DELETE_SCOREBOARD]: 403,
82
83
  [ErrorCode.CLARIFICATION_NOT_CREATED]: 500,
83
84
  [ErrorCode.CLARIFICATION_NOT_FOUND]: 404,
84
85
  [ErrorCode.CLARIFICATION_NOT_UPDATED]: 500,
@@ -94,7 +95,7 @@ export const ERROR_HTTP_STATUS = {
94
95
  [ErrorCode.SUBMISSION_NOT_UPDATED]: 500,
95
96
  [ErrorCode.SOURCE_EMPTY]: 400,
96
97
  [ErrorCode.PROGRAMMING_LANGUAGE_NOT_SUPPORTED]: 400,
97
- [ErrorCode.NOT_ALLOWED_SUBMIT_THE_PROBLEM_IN_THE_CONTEST]: 403,
98
+ [ErrorCode.NOT_ALLOWED_TO_SUBMIT_PROBLEM_IN_CONTEST]: 403,
98
99
  [ErrorCode.JUDGEMENT_UNAVAILABLE]: 500,
99
100
  // Utils errors
100
101
  [ErrorCode.INTERNAL_SERVER_ERROR_ON_UTILS_SERVICES]: 500,
@@ -102,17 +103,17 @@ export const ERROR_HTTP_STATUS = {
102
103
  [ErrorCode.CODES_ERROR]: 400,
103
104
  [ErrorCode.COMPILATION_FAILED]: 400,
104
105
  [ErrorCode.FILES_ERROR]: 400,
105
- [ErrorCode.THE_EMAIL_COULD_NOT_BE_SENT]: 500,
106
+ [ErrorCode.EMAIL_NOT_SENT]: 500,
106
107
  // Team errors
107
108
  [ErrorCode.INTERNAL_SERVER_ERROR_ON_TEAMS_SERVICE]: 500,
108
109
  [ErrorCode.TEAM_NOT_CREATED]: 500,
109
110
  [ErrorCode.TEAM_NOT_FOUND]: 404,
110
111
  [ErrorCode.TEAM_NOT_UPDATED]: 500,
111
112
  [ErrorCode.TEAM_NOT_DELETED]: 500,
112
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_TEAM]: 403,
113
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_TEAM]: 403,
114
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_TEAM]: 403,
115
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_TEAM]: 403,
113
+ [ErrorCode.NOT_ALLOWED_TO_CREATE_TEAM]: 403,
114
+ [ErrorCode.NOT_ALLOWED_TO_VIEW_TEAM]: 403,
115
+ [ErrorCode.NOT_ALLOWED_TO_UPDATE_TEAM]: 403,
116
+ [ErrorCode.NOT_ALLOWED_TO_DELETE_TEAM]: 403,
116
117
  [ErrorCode.TEAM_IS_REPORTED]: 403,
117
118
  [ErrorCode.TEAM_IS_ARCHIVED]: 403,
118
119
  // File errors
@@ -121,10 +122,10 @@ export const ERROR_HTTP_STATUS = {
121
122
  [ErrorCode.FILE_NOT_FOUND]: 404,
122
123
  [ErrorCode.FILE_NOT_UPDATED]: 500,
123
124
  [ErrorCode.FILE_NOT_DELETED]: 500,
124
- [ErrorCode.NOT_ALLOWED_TO_CREATE_THE_FILE]: 403,
125
- [ErrorCode.NOT_ALLOWED_TO_VIEW_THE_FILE]: 403,
126
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_THE_FILE]: 403,
127
- [ErrorCode.NOT_ALLOWED_TO_DELETE_THE_FILE]: 403,
125
+ [ErrorCode.NOT_ALLOWED_TO_CREATE_FILE]: 403,
126
+ [ErrorCode.NOT_ALLOWED_TO_VIEW_FILE]: 403,
127
+ [ErrorCode.NOT_ALLOWED_TO_UPDATE_FILE]: 403,
128
+ [ErrorCode.NOT_ALLOWED_TO_DELETE_FILE]: 403,
128
129
  [ErrorCode.FILE_IS_RESERVED]: 403,
129
130
  [ErrorCode.FILE_IS_PRIVATE]: 403,
130
131
  [ErrorCode.FILE_IS_ARCHIVED]: 403,
@@ -25,7 +25,7 @@ export const EMPTY_USER_PERMISSIONS = {
25
25
  create: false,
26
26
  manage: false,
27
27
  },
28
- company: {
28
+ organization: {
29
29
  manage: false,
30
30
  administrate: false,
31
31
  },
@@ -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 { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO, ProblemSummaryListResponseDTO } from './problem.js';
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
- company: EntityCompanySummaryListResponseDTO;
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
- company: EntityCompanySystemSummaryListResponseDTO;
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
- company: EntityCompanySummaryListResponseDTO;
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 OrganizationTrustedCompanyResponseDTO {
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
- trustedCompanies: OrganizationTrustedCompanyResponseDTO[];
23
+ trustedOrganizations: OrganizationTrustedOrganizationResponseDTO[];
24
24
  styles: OrganizationStylesResponseDTO;
25
25
  }
26
26
  export interface OrganizationUserPermissionsResponseDTO extends OrganizationResponseDTO {
@@ -6,11 +6,11 @@ export interface ProblemJudgeSummaryListResponseDTO extends Pick<JudgeBaseDocume
6
6
  isCustom: boolean;
7
7
  isMain: boolean;
8
8
  }
9
- export interface EntityCompanySummaryListResponseDTO {
9
+ export interface EntityOrganizationSummaryListResponseDTO {
10
10
  key: string;
11
11
  }
12
12
  export interface ProblemBasicSummaryListResponseDTO {
13
- company: EntityCompanySummaryListResponseDTO;
13
+ organization: EntityOrganizationSummaryListResponseDTO;
14
14
  judge: ProblemJudgeSummaryListResponseDTO;
15
15
  key: string;
16
16
  name: string;
@@ -39,7 +39,7 @@ export interface ProblemJudgeSystemSummaryListResponseDTO extends ProblemJudgeSu
39
39
  name: string;
40
40
  id: string;
41
41
  }
42
- export interface EntityCompanySystemSummaryListResponseDTO extends EntityCompanySummaryListResponseDTO {
42
+ export interface EntityOrganizationSystemSummaryListResponseDTO extends EntityOrganizationSummaryListResponseDTO {
43
43
  name: string;
44
44
  id: string;
45
45
  }
@@ -48,7 +48,7 @@ export interface ProblemSystemSummaryListResponseDTO extends ProblemSummaryListR
48
48
  id: string;
49
49
  owner: EntityOwnerSystemSummaryListResponseDTO;
50
50
  judge: ProblemJudgeSystemSummaryListResponseDTO;
51
- company: EntityCompanySystemSummaryListResponseDTO;
51
+ organization: EntityOrganizationSystemSummaryListResponseDTO;
52
52
  creationTimestamp: number;
53
53
  updateTimestamp: number;
54
54
  }
@@ -1,4 +1,4 @@
1
- import type { EntityCompanySystemSummaryListResponseDTO } from './problem.js';
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
- company: EntityCompanySystemSummaryListResponseDTO;
14
+ organization: EntityOrganizationSystemSummaryListResponseDTO;
15
15
  }
@@ -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 StatisticsCompanyResponseDTO {
4
+ export interface StatisticsOrganizationResponseDTO {
5
5
  codeEditorRuns: StatisticsGrouped<number>;
6
6
  judgingRuns: StatisticsGrouped<number>;
7
7
  reJudgingRuns: StatisticsGrouped<number>;
@@ -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 { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO, ProblemJudgeSummaryListResponseDTO } from './problem.js';
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
- company: EntityCompanySummaryListResponseDTO;
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
- company: EntityCompanySummaryListResponseDTO;
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
- company: EntityCompanySummaryListResponseDTO;
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
- company: EntityCompanySystemSummaryListResponseDTO;
67
+ organization: EntityOrganizationSystemSummaryListResponseDTO;
68
68
  creationTimestamp: number;
69
69
  updateTimestamp: number;
70
70
  state: EntityState;
@@ -16,7 +16,7 @@ export interface EcsTask {
16
16
  containers?: TaskResponseDTOContainer[];
17
17
  }
18
18
  export interface EcsTaskSystemSummaryListResponseDTO extends EcsTask {
19
- isHighRunnerCompanyKeys: string[];
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
- isHighRunnerCompanyKeys: string[];
30
+ isHighRunnerOrganizationKeys: string[];
31
31
  }
32
32
  export interface Ec2Instance {
33
33
  instanceId: string;
@@ -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 { EntityCompanySummaryListResponseDTO, EntityCompanySystemSummaryListResponseDTO } from './problem.js';
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
- company: EntityCompanySummaryListResponseDTO;
9
+ organization: EntityOrganizationSummaryListResponseDTO;
10
10
  }
11
11
  export interface UserOrganizationBasicInfoResponseDTO extends UserBasicInfo {
12
- company: EntityCompanySummaryListResponseDTO;
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
- company: EntityCompanySystemSummaryListResponseDTO;
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
- company: {
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
- company: EntityCompanySummaryListResponseDTO;
84
+ organization: EntityOrganizationSummaryListResponseDTO;
85
85
  };
86
- export type CompanyPingResponseDTO = {
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
- company: CompanyPingResponseDTO;
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
- company: EntityCompanySummaryListResponseDTO;
108
+ organization: EntityOrganizationSummaryListResponseDTO;
109
109
  }
@@ -1,5 +1,5 @@
1
1
  export declare const CollectionKey: {
2
- readonly COMPANY: "C";
2
+ readonly ORGANIZATION: "C";
3
3
  readonly USER: "U";
4
4
  readonly PROBLEM: "P";
5
5
  readonly CLASS: "K";
@@ -1,5 +1,5 @@
1
1
  export const CollectionKey = {
2
- COMPANY: 'C',
2
+ ORGANIZATION: 'C',
3
3
  USER: 'U',
4
4
  PROBLEM: 'P',
5
5
  CLASS: 'K',
@@ -1,5 +1,5 @@
1
1
  export declare const EntityCollection: {
2
- readonly COMPANY: "COMPANY";
2
+ readonly ORGANIZATION: "ORGANIZATION";
3
3
  readonly PROBLEM: "PROBLEM";
4
4
  readonly CONTEST: "CONTEST";
5
5
  readonly JUDGE: "JUDGE";
@@ -1,5 +1,5 @@
1
1
  export const EntityCollection = {
2
- COMPANY: 'COMPANY',
2
+ ORGANIZATION: 'ORGANIZATION',
3
3
  PROBLEM: 'PROBLEM',
4
4
  CONTEST: 'CONTEST',
5
5
  JUDGE: 'JUDGE',
@@ -4,34 +4,35 @@ export declare const ErrorCode: {
4
4
  readonly FORBIDDEN: "FORBIDDEN";
5
5
  readonly NOT_FOUND: "NOT_FOUND";
6
6
  readonly METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
7
+ readonly CONFLICT: "CONFLICT";
7
8
  readonly INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR";
8
9
  readonly ABORTED_REQUEST: "ABORTED_REQUEST";
9
10
  readonly ERROR_ON_RESPONSE: "ERROR_ON_RESPONSE";
10
11
  readonly SERVICE_NOT_FOUND: "SERVICE_NOT_FOUND";
11
- readonly INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE: "INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE";
12
- readonly COMPANY_NOT_CREATED: "COMPANY_NOT_CREATED";
13
- readonly COMPANY_NOT_FOUND: "COMPANY_NOT_FOUND";
14
- readonly COMPANY_NOT_UPDATED: "COMPANY_NOT_UPDATED";
15
- readonly COMPANY_NOT_DELETED: "COMPANY_NOT_DELETED";
16
- readonly NOT_ALLOWED_TO_CREATE_THE_COMPANY: "NOT_ALLOWED_TO_CREATE_THE_COMPANY";
17
- readonly NOT_ALLOWED_TO_VIEW_THE_COMPANY: "NOT_ALLOWED_TO_VIEW_THE_COMPANY";
18
- readonly NOT_ALLOWED_TO_UPDATE_THE_COMPANY: "NOT_ALLOWED_TO_UPDATE_THE_COMPANY";
19
- readonly NOT_ALLOWED_TO_DELETE_THE_COMPANY: "NOT_ALLOWED_TO_DELETE_THE_COMPANY";
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";
20
21
  readonly INTERNAL_SERVER_ERROR_ON_USERS_SERVICE: "INTERNAL_SERVER_ERROR_ON_USERS_SERVICE";
21
22
  readonly USER_NOT_CREATED: "USER_NOT_CREATED";
22
23
  readonly USER_NOT_FOUND: "USER_NOT_FOUND";
24
+ readonly USER_NOT_FOUND_BY_EMAIL: "USER_NOT_FOUND_BY_EMAIL";
25
+ readonly USER_NOT_FOUND_BY_NICKNAME: "USER_NOT_FOUND_BY_NICKNAME";
23
26
  readonly USER_NOT_UPDATED: "USER_NOT_UPDATED";
24
27
  readonly USER_NOT_DELETED: "USER_NOT_DELETED";
25
- readonly NOT_ALLOWED_TO_CREATE_THE_USER: "NOT_ALLOWED_TO_CREATE_THE_USER";
26
- readonly NOT_ALLOWED_TO_VIEW_THE_USER: "NOT_ALLOWED_TO_VIEW_THE_USER";
27
- readonly NOT_ALLOWED_TO_UPDATE_THE_USER: "NOT_ALLOWED_TO_UPDATE_THE_USER";
28
- readonly NOT_ALLOWED_TO_DELETE_THE_USER: "NOT_ALLOWED_TO_DELETE_THE_USER";
28
+ readonly NOT_ALLOWED_TO_CREATE_USER: "NOT_ALLOWED_TO_CREATE_USER";
29
+ readonly NOT_ALLOWED_TO_VIEW_USER: "NOT_ALLOWED_TO_VIEW_USER";
30
+ readonly NOT_ALLOWED_TO_UPDATE_USER: "NOT_ALLOWED_TO_UPDATE_USER";
31
+ readonly NOT_ALLOWED_TO_DELETE_USER: "NOT_ALLOWED_TO_DELETE_USER";
29
32
  readonly USER_IS_REPORTED: "USER_IS_REPORTED";
30
33
  readonly USER_IS_ARCHIVED: "USER_IS_ARCHIVED";
31
- readonly USER_WITH_EMAIL_REQUESTED_NOT_FOUND: "USER_WITH_EMAIL_REQUESTED_NOT_FOUND";
32
- readonly USER_WITH_NICKNAME_REQUESTED_NOT_FOUND: "USER_WITH_NICKNAME_REQUESTED_NOT_FOUND";
33
- readonly THE_EMAIL_IS_ALREADY_REGISTERED: "THE_EMAIL_IS_ALREADY_REGISTERED";
34
- readonly THE_NICKNAME_IS_ALREADY_TAKEN: "THE_NICKNAME_IS_ALREADY_TAKEN";
34
+ readonly EMAIL_ALREADY_IN_USE: "EMAIL_ALREADY_IN_USE";
35
+ readonly NICKNAME_ALREADY_TAKEN: "NICKNAME_ALREADY_TAKEN";
35
36
  readonly INCORRECT_PASSWORD: "INCORRECT_PASSWORD";
36
37
  readonly USER_SESSION_NOT_CREATED: "USER_SESSION_NOT_CREATED";
37
38
  readonly USER_SESSION_NOT_FOUND: "USER_SESSION_NOT_FOUND";
@@ -42,13 +43,13 @@ export declare const ErrorCode: {
42
43
  readonly PROBLEM_NOT_FOUND: "PROBLEM_NOT_FOUND";
43
44
  readonly PROBLEM_NOT_UPDATED: "PROBLEM_NOT_UPDATED";
44
45
  readonly PROBLEM_NOT_DELETED: "PROBLEM_NOT_DELETED";
45
- readonly NOT_ALLOWED_TO_CREATE_THE_PROBLEM: "NOT_ALLOWED_TO_CREATE_THE_PROBLEM";
46
- readonly NOT_ALLOWED_TO_VIEW_THE_PROBLEM: "NOT_ALLOWED_TO_VIEW_THE_PROBLEM";
47
- readonly NOT_ALLOWED_TO_UPDATE_THE_PROBLEM: "NOT_ALLOWED_TO_UPDATE_THE_PROBLEM";
48
- readonly NOT_ALLOWED_TO_DELETE_THE_PROBLEM: "NOT_ALLOWED_TO_DELETE_THE_PROBLEM";
46
+ readonly NOT_ALLOWED_TO_CREATE_PROBLEM: "NOT_ALLOWED_TO_CREATE_PROBLEM";
47
+ readonly NOT_ALLOWED_TO_VIEW_PROBLEM: "NOT_ALLOWED_TO_VIEW_PROBLEM";
48
+ readonly NOT_ALLOWED_TO_UPDATE_PROBLEM: "NOT_ALLOWED_TO_UPDATE_PROBLEM";
49
+ readonly NOT_ALLOWED_TO_DELETE_PROBLEM: "NOT_ALLOWED_TO_DELETE_PROBLEM";
49
50
  readonly PROBLEM_MODE_NOT_SUPPORTED: "PROBLEM_MODE_NOT_SUPPORTED";
50
51
  readonly PROBLEM_TYPE_NOT_SUPPORTED: "PROBLEM_TYPE_NOT_SUPPORTED";
51
- readonly PROBLEM_TIME_LIMIT_MUST_BE_A_NUMBER: "PROBLEM_TIME_LIMIT_MUST_BE_A_NUMBER";
52
+ readonly PROBLEM_TIME_LIMIT_MUST_BE_NUMBER: "PROBLEM_TIME_LIMIT_MUST_BE_NUMBER";
52
53
  readonly PROBLEM_MEMORY_LIMIT_MUST_BE_NUMBER: "PROBLEM_MEMORY_LIMIT_MUST_BE_NUMBER";
53
54
  readonly TEST_CASE_FILE_EMPTY: "TEST_CASE_FILE_EMPTY";
54
55
  readonly INTERNAL_SERVER_ERROR_ON_CONTESTS_SERVICE: "INTERNAL_SERVER_ERROR_ON_CONTESTS_SERVICE";
@@ -56,21 +57,21 @@ export declare const ErrorCode: {
56
57
  readonly CONTEST_NOT_FOUND: "CONTEST_NOT_FOUND";
57
58
  readonly CONTEST_NOT_UPDATED: "CONTEST_NOT_UPDATED";
58
59
  readonly CONTEST_NOT_DELETED: "CONTEST_NOT_DELETED";
59
- readonly NOT_ALLOWED_TO_CREATE_THE_CONTEST: "NOT_ALLOWED_TO_CREATE_THE_CONTEST";
60
- readonly NOT_ALLOWED_TO_VIEW_THE_CONTEST: "NOT_ALLOWED_TO_VIEW_THE_CONTEST";
61
- readonly NOT_ALLOWED_TO_UPDATE_THE_CONTEST: "NOT_ALLOWED_TO_UPDATE_THE_CONTEST";
62
- readonly NOT_ALLOWED_TO_DELETE_THE_CONTEST: "NOT_ALLOWED_TO_DELETE_THE_CONTEST";
63
- readonly NOT_ALLOWED_TO_REGISTER_TO_THE_CONTEST: "NOT_ALLOWED_TO_REGISTER_TO_THE_CONTEST";
64
- readonly IS_ALREADY_REGISTERED: "IS_ALREADY_REGISTERED";
60
+ readonly NOT_ALLOWED_TO_CREATE_CONTEST: "NOT_ALLOWED_TO_CREATE_CONTEST";
61
+ readonly NOT_ALLOWED_TO_VIEW_CONTEST: "NOT_ALLOWED_TO_VIEW_CONTEST";
62
+ readonly NOT_ALLOWED_TO_UPDATE_CONTEST: "NOT_ALLOWED_TO_UPDATE_CONTEST";
63
+ readonly NOT_ALLOWED_TO_DELETE_CONTEST: "NOT_ALLOWED_TO_DELETE_CONTEST";
64
+ readonly NOT_ALLOWED_TO_REGISTER_TO_CONTEST: "NOT_ALLOWED_TO_REGISTER_TO_CONTEST";
65
+ readonly ALREADY_REGISTERED: "ALREADY_REGISTERED";
65
66
  readonly NOT_ALLOWED_TO_VIEW_CONTESTS: "NOT_ALLOWED_TO_VIEW_CONTESTS";
66
67
  readonly SCOREBOARD_NOT_CREATED: "SCOREBOARD_NOT_CREATED";
67
68
  readonly SCOREBOARD_NOT_FOUND: "SCOREBOARD_NOT_FOUND";
68
69
  readonly SCOREBOARD_NOT_UPDATED: "SCOREBOARD_NOT_UPDATED";
69
70
  readonly SCOREBOARD_NOT_DELETED: "SCOREBOARD_NOT_DELETED";
70
- readonly NOT_ALLOWED_TO_CREATE_THE_SCOREBOARD: "NOT_ALLOWED_TO_CREATE_THE_SCOREBOARD";
71
- readonly NOT_ALLOWED_TO_VIEW_THE_SCOREBOARD: "NOT_ALLOWED_TO_VIEW_THE_SCOREBOARD";
72
- readonly NOT_ALLOWED_TO_UPDATE_THE_SCOREBOARD: "NOT_ALLOWED_TO_UPDATE_THE_SCOREBOARD";
73
- readonly NOT_ALLOWED_TO_DELETE_THE_SCOREBOARD: "NOT_ALLOWED_TO_DELETE_THE_SCOREBOARD";
71
+ readonly NOT_ALLOWED_TO_CREATE_SCOREBOARD: "NOT_ALLOWED_TO_CREATE_SCOREBOARD";
72
+ readonly NOT_ALLOWED_TO_VIEW_SCOREBOARD: "NOT_ALLOWED_TO_VIEW_SCOREBOARD";
73
+ readonly NOT_ALLOWED_TO_UPDATE_SCOREBOARD: "NOT_ALLOWED_TO_UPDATE_SCOREBOARD";
74
+ readonly NOT_ALLOWED_TO_DELETE_SCOREBOARD: "NOT_ALLOWED_TO_DELETE_SCOREBOARD";
74
75
  readonly CLARIFICATION_NOT_CREATED: "CLARIFICATION_NOT_CREATED";
75
76
  readonly CLARIFICATION_NOT_FOUND: "CLARIFICATION_NOT_FOUND";
76
77
  readonly CLARIFICATION_NOT_UPDATED: "CLARIFICATION_NOT_UPDATED";
@@ -85,23 +86,23 @@ export declare const ErrorCode: {
85
86
  readonly SUBMISSION_NOT_UPDATED: "SUBMISSION_NOT_UPDATED";
86
87
  readonly SOURCE_EMPTY: "SOURCE_EMPTY";
87
88
  readonly PROGRAMMING_LANGUAGE_NOT_SUPPORTED: "PROGRAMMING_LANGUAGE_NOT_SUPPORTED";
88
- readonly NOT_ALLOWED_SUBMIT_THE_PROBLEM_IN_THE_CONTEST: "NOT_ALLOWED_SUBMIT_THE_PROBLEM_IN_THE_CONTEST";
89
+ readonly NOT_ALLOWED_TO_SUBMIT_PROBLEM_IN_CONTEST: "NOT_ALLOWED_TO_SUBMIT_PROBLEM_IN_CONTEST";
89
90
  readonly JUDGEMENT_UNAVAILABLE: "JUDGEMENT_UNAVAILABLE";
90
91
  readonly INTERNAL_SERVER_ERROR_ON_UTILS_SERVICES: "INTERNAL_SERVER_ERROR_ON_UTILS_SERVICES";
91
92
  readonly EMPTY_IMAGE: "EMPTY_IMAGE";
92
93
  readonly CODES_ERROR: "CODES_ERROR";
93
94
  readonly COMPILATION_FAILED: "COMPILATION_FAILED";
94
95
  readonly FILES_ERROR: "FILES_ERROR";
95
- readonly THE_EMAIL_COULD_NOT_BE_SENT: "THE_EMAIL_COULD_NOT_BE_SENT";
96
+ readonly EMAIL_NOT_SENT: "EMAIL_NOT_SENT";
96
97
  readonly INTERNAL_SERVER_ERROR_ON_TEAMS_SERVICE: "INTERNAL_SERVER_ERROR_ON_TEAMS_SERVICE";
97
98
  readonly TEAM_NOT_CREATED: "TEAM_NOT_CREATED";
98
99
  readonly TEAM_NOT_FOUND: "TEAM_NOT_FOUND";
99
100
  readonly TEAM_NOT_UPDATED: "TEAM_NOT_UPDATED";
100
101
  readonly TEAM_NOT_DELETED: "TEAM_NOT_DELETED";
101
- readonly NOT_ALLOWED_TO_CREATE_THE_TEAM: "NOT_ALLOWED_TO_CREATE_THE_TEAM";
102
- readonly NOT_ALLOWED_TO_VIEW_THE_TEAM: "NOT_ALLOWED_TO_VIEW_THE_TEAM";
103
- readonly NOT_ALLOWED_TO_UPDATE_THE_TEAM: "NOT_ALLOWED_TO_UPDATE_THE_TEAM";
104
- readonly NOT_ALLOWED_TO_DELETE_THE_TEAM: "NOT_ALLOWED_TO_DELETE_THE_TEAM";
102
+ readonly NOT_ALLOWED_TO_CREATE_TEAM: "NOT_ALLOWED_TO_CREATE_TEAM";
103
+ readonly NOT_ALLOWED_TO_VIEW_TEAM: "NOT_ALLOWED_TO_VIEW_TEAM";
104
+ readonly NOT_ALLOWED_TO_UPDATE_TEAM: "NOT_ALLOWED_TO_UPDATE_TEAM";
105
+ readonly NOT_ALLOWED_TO_DELETE_TEAM: "NOT_ALLOWED_TO_DELETE_TEAM";
105
106
  readonly TEAM_IS_REPORTED: "TEAM_IS_REPORTED";
106
107
  readonly TEAM_IS_ARCHIVED: "TEAM_IS_ARCHIVED";
107
108
  readonly INTERNAL_SERVER_ERROR_ON_FILES_SERVICE: "INTERNAL_SERVER_ERROR_ON_FILES_SERVICE";
@@ -109,10 +110,10 @@ export declare const ErrorCode: {
109
110
  readonly FILE_NOT_FOUND: "FILE_NOT_FOUND";
110
111
  readonly FILE_NOT_UPDATED: "FILE_NOT_UPDATED";
111
112
  readonly FILE_NOT_DELETED: "FILE_NOT_DELETED";
112
- readonly NOT_ALLOWED_TO_CREATE_THE_FILE: "NOT_ALLOWED_TO_CREATE_THE_FILE";
113
- readonly NOT_ALLOWED_TO_VIEW_THE_FILE: "NOT_ALLOWED_TO_VIEW_THE_FILE";
114
- readonly NOT_ALLOWED_TO_UPDATE_THE_FILE: "NOT_ALLOWED_TO_UPDATE_THE_FILE";
115
- readonly NOT_ALLOWED_TO_DELETE_THE_FILE: "NOT_ALLOWED_TO_DELETE_THE_FILE";
113
+ readonly NOT_ALLOWED_TO_CREATE_FILE: "NOT_ALLOWED_TO_CREATE_FILE";
114
+ readonly NOT_ALLOWED_TO_VIEW_FILE: "NOT_ALLOWED_TO_VIEW_FILE";
115
+ readonly NOT_ALLOWED_TO_UPDATE_FILE: "NOT_ALLOWED_TO_UPDATE_FILE";
116
+ readonly NOT_ALLOWED_TO_DELETE_FILE: "NOT_ALLOWED_TO_DELETE_FILE";
116
117
  readonly FILE_IS_RESERVED: "FILE_IS_RESERVED";
117
118
  readonly FILE_IS_PRIVATE: "FILE_IS_PRIVATE";
118
119
  readonly FILE_IS_ARCHIVED: "FILE_IS_ARCHIVED";
@@ -5,37 +5,38 @@ export const ErrorCode = {
5
5
  FORBIDDEN: 'FORBIDDEN',
6
6
  NOT_FOUND: 'NOT_FOUND',
7
7
  METHOD_NOT_ALLOWED: 'METHOD_NOT_ALLOWED',
8
+ CONFLICT: 'CONFLICT',
8
9
  INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR',
9
10
  // UI general errors
10
11
  ABORTED_REQUEST: 'ABORTED_REQUEST',
11
12
  ERROR_ON_RESPONSE: 'ERROR_ON_RESPONSE',
12
13
  SERVICE_NOT_FOUND: 'SERVICE_NOT_FOUND',
13
- // Company errors
14
- INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE: 'INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE',
15
- COMPANY_NOT_CREATED: 'COMPANY_NOT_CREATED',
16
- COMPANY_NOT_FOUND: 'COMPANY_NOT_FOUND',
17
- COMPANY_NOT_UPDATED: 'COMPANY_NOT_UPDATED',
18
- COMPANY_NOT_DELETED: 'COMPANY_NOT_DELETED',
19
- NOT_ALLOWED_TO_CREATE_THE_COMPANY: 'NOT_ALLOWED_TO_CREATE_THE_COMPANY',
20
- NOT_ALLOWED_TO_VIEW_THE_COMPANY: 'NOT_ALLOWED_TO_VIEW_THE_COMPANY',
21
- NOT_ALLOWED_TO_UPDATE_THE_COMPANY: 'NOT_ALLOWED_TO_UPDATE_THE_COMPANY',
22
- NOT_ALLOWED_TO_DELETE_THE_COMPANY: 'NOT_ALLOWED_TO_DELETE_THE_COMPANY',
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',
23
24
  // User errors
24
25
  INTERNAL_SERVER_ERROR_ON_USERS_SERVICE: 'INTERNAL_SERVER_ERROR_ON_USERS_SERVICE',
25
26
  USER_NOT_CREATED: 'USER_NOT_CREATED',
26
27
  USER_NOT_FOUND: 'USER_NOT_FOUND',
28
+ USER_NOT_FOUND_BY_EMAIL: 'USER_NOT_FOUND_BY_EMAIL',
29
+ USER_NOT_FOUND_BY_NICKNAME: 'USER_NOT_FOUND_BY_NICKNAME',
27
30
  USER_NOT_UPDATED: 'USER_NOT_UPDATED',
28
31
  USER_NOT_DELETED: 'USER_NOT_DELETED',
29
- NOT_ALLOWED_TO_CREATE_THE_USER: 'NOT_ALLOWED_TO_CREATE_THE_USER',
30
- NOT_ALLOWED_TO_VIEW_THE_USER: 'NOT_ALLOWED_TO_VIEW_THE_USER',
31
- NOT_ALLOWED_TO_UPDATE_THE_USER: 'NOT_ALLOWED_TO_UPDATE_THE_USER',
32
- NOT_ALLOWED_TO_DELETE_THE_USER: 'NOT_ALLOWED_TO_DELETE_THE_USER',
32
+ NOT_ALLOWED_TO_CREATE_USER: 'NOT_ALLOWED_TO_CREATE_USER',
33
+ NOT_ALLOWED_TO_VIEW_USER: 'NOT_ALLOWED_TO_VIEW_USER',
34
+ NOT_ALLOWED_TO_UPDATE_USER: 'NOT_ALLOWED_TO_UPDATE_USER',
35
+ NOT_ALLOWED_TO_DELETE_USER: 'NOT_ALLOWED_TO_DELETE_USER',
33
36
  USER_IS_REPORTED: 'USER_IS_REPORTED',
34
37
  USER_IS_ARCHIVED: 'USER_IS_ARCHIVED',
35
- USER_WITH_EMAIL_REQUESTED_NOT_FOUND: 'USER_WITH_EMAIL_REQUESTED_NOT_FOUND',
36
- USER_WITH_NICKNAME_REQUESTED_NOT_FOUND: 'USER_WITH_NICKNAME_REQUESTED_NOT_FOUND',
37
- THE_EMAIL_IS_ALREADY_REGISTERED: 'THE_EMAIL_IS_ALREADY_REGISTERED',
38
- THE_NICKNAME_IS_ALREADY_TAKEN: 'THE_NICKNAME_IS_ALREADY_TAKEN',
38
+ EMAIL_ALREADY_IN_USE: 'EMAIL_ALREADY_IN_USE',
39
+ NICKNAME_ALREADY_TAKEN: 'NICKNAME_ALREADY_TAKEN',
39
40
  INCORRECT_PASSWORD: 'INCORRECT_PASSWORD',
40
41
  USER_SESSION_NOT_CREATED: 'USER_SESSION_NOT_CREATED',
41
42
  USER_SESSION_NOT_FOUND: 'USER_SESSION_NOT_FOUND',
@@ -47,13 +48,13 @@ export const ErrorCode = {
47
48
  PROBLEM_NOT_FOUND: 'PROBLEM_NOT_FOUND',
48
49
  PROBLEM_NOT_UPDATED: 'PROBLEM_NOT_UPDATED',
49
50
  PROBLEM_NOT_DELETED: 'PROBLEM_NOT_DELETED',
50
- NOT_ALLOWED_TO_CREATE_THE_PROBLEM: 'NOT_ALLOWED_TO_CREATE_THE_PROBLEM',
51
- NOT_ALLOWED_TO_VIEW_THE_PROBLEM: 'NOT_ALLOWED_TO_VIEW_THE_PROBLEM',
52
- NOT_ALLOWED_TO_UPDATE_THE_PROBLEM: 'NOT_ALLOWED_TO_UPDATE_THE_PROBLEM',
53
- NOT_ALLOWED_TO_DELETE_THE_PROBLEM: 'NOT_ALLOWED_TO_DELETE_THE_PROBLEM',
51
+ NOT_ALLOWED_TO_CREATE_PROBLEM: 'NOT_ALLOWED_TO_CREATE_PROBLEM',
52
+ NOT_ALLOWED_TO_VIEW_PROBLEM: 'NOT_ALLOWED_TO_VIEW_PROBLEM',
53
+ NOT_ALLOWED_TO_UPDATE_PROBLEM: 'NOT_ALLOWED_TO_UPDATE_PROBLEM',
54
+ NOT_ALLOWED_TO_DELETE_PROBLEM: 'NOT_ALLOWED_TO_DELETE_PROBLEM',
54
55
  PROBLEM_MODE_NOT_SUPPORTED: 'PROBLEM_MODE_NOT_SUPPORTED',
55
56
  PROBLEM_TYPE_NOT_SUPPORTED: 'PROBLEM_TYPE_NOT_SUPPORTED',
56
- PROBLEM_TIME_LIMIT_MUST_BE_A_NUMBER: 'PROBLEM_TIME_LIMIT_MUST_BE_A_NUMBER',
57
+ PROBLEM_TIME_LIMIT_MUST_BE_NUMBER: 'PROBLEM_TIME_LIMIT_MUST_BE_NUMBER',
57
58
  PROBLEM_MEMORY_LIMIT_MUST_BE_NUMBER: 'PROBLEM_MEMORY_LIMIT_MUST_BE_NUMBER',
58
59
  TEST_CASE_FILE_EMPTY: 'TEST_CASE_FILE_EMPTY',
59
60
  // Contest errors
@@ -62,21 +63,21 @@ export const ErrorCode = {
62
63
  CONTEST_NOT_FOUND: 'CONTEST_NOT_FOUND',
63
64
  CONTEST_NOT_UPDATED: 'CONTEST_NOT_UPDATED',
64
65
  CONTEST_NOT_DELETED: 'CONTEST_NOT_DELETED',
65
- NOT_ALLOWED_TO_CREATE_THE_CONTEST: 'NOT_ALLOWED_TO_CREATE_THE_CONTEST',
66
- NOT_ALLOWED_TO_VIEW_THE_CONTEST: 'NOT_ALLOWED_TO_VIEW_THE_CONTEST',
67
- NOT_ALLOWED_TO_UPDATE_THE_CONTEST: 'NOT_ALLOWED_TO_UPDATE_THE_CONTEST',
68
- NOT_ALLOWED_TO_DELETE_THE_CONTEST: 'NOT_ALLOWED_TO_DELETE_THE_CONTEST',
69
- NOT_ALLOWED_TO_REGISTER_TO_THE_CONTEST: 'NOT_ALLOWED_TO_REGISTER_TO_THE_CONTEST',
70
- IS_ALREADY_REGISTERED: 'IS_ALREADY_REGISTERED',
66
+ NOT_ALLOWED_TO_CREATE_CONTEST: 'NOT_ALLOWED_TO_CREATE_CONTEST',
67
+ NOT_ALLOWED_TO_VIEW_CONTEST: 'NOT_ALLOWED_TO_VIEW_CONTEST',
68
+ NOT_ALLOWED_TO_UPDATE_CONTEST: 'NOT_ALLOWED_TO_UPDATE_CONTEST',
69
+ NOT_ALLOWED_TO_DELETE_CONTEST: 'NOT_ALLOWED_TO_DELETE_CONTEST',
70
+ NOT_ALLOWED_TO_REGISTER_TO_CONTEST: 'NOT_ALLOWED_TO_REGISTER_TO_CONTEST',
71
+ ALREADY_REGISTERED: 'ALREADY_REGISTERED',
71
72
  NOT_ALLOWED_TO_VIEW_CONTESTS: 'NOT_ALLOWED_TO_VIEW_CONTESTS',
72
73
  SCOREBOARD_NOT_CREATED: 'SCOREBOARD_NOT_CREATED',
73
74
  SCOREBOARD_NOT_FOUND: 'SCOREBOARD_NOT_FOUND',
74
75
  SCOREBOARD_NOT_UPDATED: 'SCOREBOARD_NOT_UPDATED',
75
76
  SCOREBOARD_NOT_DELETED: 'SCOREBOARD_NOT_DELETED',
76
- NOT_ALLOWED_TO_CREATE_THE_SCOREBOARD: 'NOT_ALLOWED_TO_CREATE_THE_SCOREBOARD',
77
- NOT_ALLOWED_TO_VIEW_THE_SCOREBOARD: 'NOT_ALLOWED_TO_VIEW_THE_SCOREBOARD',
78
- NOT_ALLOWED_TO_UPDATE_THE_SCOREBOARD: 'NOT_ALLOWED_TO_UPDATE_THE_SCOREBOARD',
79
- NOT_ALLOWED_TO_DELETE_THE_SCOREBOARD: 'NOT_ALLOWED_TO_DELETE_THE_SCOREBOARD',
77
+ NOT_ALLOWED_TO_CREATE_SCOREBOARD: 'NOT_ALLOWED_TO_CREATE_SCOREBOARD',
78
+ NOT_ALLOWED_TO_VIEW_SCOREBOARD: 'NOT_ALLOWED_TO_VIEW_SCOREBOARD',
79
+ NOT_ALLOWED_TO_UPDATE_SCOREBOARD: 'NOT_ALLOWED_TO_UPDATE_SCOREBOARD',
80
+ NOT_ALLOWED_TO_DELETE_SCOREBOARD: 'NOT_ALLOWED_TO_DELETE_SCOREBOARD',
80
81
  CLARIFICATION_NOT_CREATED: 'CLARIFICATION_NOT_CREATED',
81
82
  CLARIFICATION_NOT_FOUND: 'CLARIFICATION_NOT_FOUND',
82
83
  CLARIFICATION_NOT_UPDATED: 'CLARIFICATION_NOT_UPDATED',
@@ -92,7 +93,7 @@ export const ErrorCode = {
92
93
  SUBMISSION_NOT_UPDATED: 'SUBMISSION_NOT_UPDATED',
93
94
  SOURCE_EMPTY: 'SOURCE_EMPTY',
94
95
  PROGRAMMING_LANGUAGE_NOT_SUPPORTED: 'PROGRAMMING_LANGUAGE_NOT_SUPPORTED',
95
- NOT_ALLOWED_SUBMIT_THE_PROBLEM_IN_THE_CONTEST: 'NOT_ALLOWED_SUBMIT_THE_PROBLEM_IN_THE_CONTEST',
96
+ NOT_ALLOWED_TO_SUBMIT_PROBLEM_IN_CONTEST: 'NOT_ALLOWED_TO_SUBMIT_PROBLEM_IN_CONTEST',
96
97
  JUDGEMENT_UNAVAILABLE: 'JUDGEMENT_UNAVAILABLE',
97
98
  // Utils errors
98
99
  INTERNAL_SERVER_ERROR_ON_UTILS_SERVICES: 'INTERNAL_SERVER_ERROR_ON_UTILS_SERVICES',
@@ -100,17 +101,17 @@ export const ErrorCode = {
100
101
  CODES_ERROR: 'CODES_ERROR',
101
102
  COMPILATION_FAILED: 'COMPILATION_FAILED',
102
103
  FILES_ERROR: 'FILES_ERROR',
103
- THE_EMAIL_COULD_NOT_BE_SENT: 'THE_EMAIL_COULD_NOT_BE_SENT',
104
+ EMAIL_NOT_SENT: 'EMAIL_NOT_SENT',
104
105
  // Team errors
105
106
  INTERNAL_SERVER_ERROR_ON_TEAMS_SERVICE: 'INTERNAL_SERVER_ERROR_ON_TEAMS_SERVICE',
106
107
  TEAM_NOT_CREATED: 'TEAM_NOT_CREATED',
107
108
  TEAM_NOT_FOUND: 'TEAM_NOT_FOUND',
108
109
  TEAM_NOT_UPDATED: 'TEAM_NOT_UPDATED',
109
110
  TEAM_NOT_DELETED: 'TEAM_NOT_DELETED',
110
- NOT_ALLOWED_TO_CREATE_THE_TEAM: 'NOT_ALLOWED_TO_CREATE_THE_TEAM',
111
- NOT_ALLOWED_TO_VIEW_THE_TEAM: 'NOT_ALLOWED_TO_VIEW_THE_TEAM',
112
- NOT_ALLOWED_TO_UPDATE_THE_TEAM: 'NOT_ALLOWED_TO_UPDATE_THE_TEAM',
113
- NOT_ALLOWED_TO_DELETE_THE_TEAM: 'NOT_ALLOWED_TO_DELETE_THE_TEAM',
111
+ NOT_ALLOWED_TO_CREATE_TEAM: 'NOT_ALLOWED_TO_CREATE_TEAM',
112
+ NOT_ALLOWED_TO_VIEW_TEAM: 'NOT_ALLOWED_TO_VIEW_TEAM',
113
+ NOT_ALLOWED_TO_UPDATE_TEAM: 'NOT_ALLOWED_TO_UPDATE_TEAM',
114
+ NOT_ALLOWED_TO_DELETE_TEAM: 'NOT_ALLOWED_TO_DELETE_TEAM',
114
115
  TEAM_IS_REPORTED: 'TEAM_IS_REPORTED',
115
116
  TEAM_IS_ARCHIVED: 'TEAM_IS_ARCHIVED',
116
117
  // File errors
@@ -119,10 +120,10 @@ export const ErrorCode = {
119
120
  FILE_NOT_FOUND: 'FILE_NOT_FOUND',
120
121
  FILE_NOT_UPDATED: 'FILE_NOT_UPDATED',
121
122
  FILE_NOT_DELETED: 'FILE_NOT_DELETED',
122
- NOT_ALLOWED_TO_CREATE_THE_FILE: 'NOT_ALLOWED_TO_CREATE_THE_FILE',
123
- NOT_ALLOWED_TO_VIEW_THE_FILE: 'NOT_ALLOWED_TO_VIEW_THE_FILE',
124
- NOT_ALLOWED_TO_UPDATE_THE_FILE: 'NOT_ALLOWED_TO_UPDATE_THE_FILE',
125
- NOT_ALLOWED_TO_DELETE_THE_FILE: 'NOT_ALLOWED_TO_DELETE_THE_FILE',
123
+ NOT_ALLOWED_TO_CREATE_FILE: 'NOT_ALLOWED_TO_CREATE_FILE',
124
+ NOT_ALLOWED_TO_VIEW_FILE: 'NOT_ALLOWED_TO_VIEW_FILE',
125
+ NOT_ALLOWED_TO_UPDATE_FILE: 'NOT_ALLOWED_TO_UPDATE_FILE',
126
+ NOT_ALLOWED_TO_DELETE_FILE: 'NOT_ALLOWED_TO_DELETE_FILE',
126
127
  FILE_IS_RESERVED: 'FILE_IS_RESERVED',
127
128
  FILE_IS_PRIVATE: 'FILE_IS_PRIVATE',
128
129
  FILE_IS_ARCHIVED: 'FILE_IS_ARCHIVED',
@@ -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', // company-id/user-id: { timestamp: number, href: string, uiId: string
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, 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,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, userCompany) => `class:${classKey}|cycle:${cycleKey}|session:${sessionKey}|assignment:${assignmentKey}|user_nickname:${userNickname}|user_company:${userCompany}`;
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}`;
@@ -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 company = user?.company;
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 company?.key === 'string' &&
139
- !!company.key &&
138
+ typeof organization?.key === 'string' &&
139
+ !!organization.key &&
140
140
  !!v.content);
141
141
  };
142
142
  export const isSendDataWebSocketResponseEventDTO = (event) => {
@@ -1,8 +1,8 @@
1
1
  import type { ClientId, RecordId } from '../types/index.js';
2
- export declare const getUserKey: (userNickname: string, userCompanyKey: string) => string;
2
+ export declare const getUserKey: (userNickname: string, userOrganizationKey: string) => string;
3
3
  export declare const getParamsOfUserKey: (userKey: string) => {
4
4
  userNickname: string;
5
- userCompanyKey: string;
5
+ userOrganizationKey: string;
6
6
  };
7
7
  export declare const getClientId: (sessionId: RecordId, uiId: string) => ClientId;
8
8
  export declare const getParamsOfClientId: (clientId: ClientId) => {
@@ -1,9 +1,9 @@
1
- export const getUserKey = (userNickname, userCompanyKey) => {
2
- return `${userNickname}|${userCompanyKey}`;
1
+ export const getUserKey = (userNickname, userOrganizationKey) => {
2
+ return `${userNickname}|${userOrganizationKey}`;
3
3
  };
4
4
  export const getParamsOfUserKey = (userKey) => {
5
- const [userNickname, userCompanyKey] = userKey.split('|');
6
- return { userNickname, userCompanyKey };
5
+ const [userNickname, userOrganizationKey] = userKey.split('|');
6
+ return { userNickname, userOrganizationKey };
7
7
  };
8
8
  export const getClientId = (sessionId, uiId) => {
9
9
  return `${sessionId}|${uiId}`;
@@ -36,8 +36,8 @@ export interface EntityMembers {
36
36
  export interface EntityOwnerDocument {
37
37
  ownerUserId: string;
38
38
  }
39
- export interface EntityCompanyDocument {
40
- companyId: string;
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 & EntityCompanyDocument & EntityOwnerDocument & EntityTimestampsDocument & EntityStateDocument & EntityLogsDocument;
66
- export type CreateEntityDocument<T> = Omit<T, '_id' | 'createdAt' | 'updatedAt' | 'companyId' | 'ownerUserId' | 'state' | 'logs'>;
67
- export type UpdateEntityDocument<T> = Partial<Omit<T, '_id' | 'createdAt' | 'updatedAt' | 'companyId' | 'ownerUserId' | 'state' | 'logs' | 'key'>>;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juki-team/commons",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "author": "juki-team",
5
5
  "license": "MIT",
6
6
  "type": "module",