@juki-team/commons 0.2.5 → 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
  };
@@ -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
- // Company errors
17
- [ErrorCode.INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE]: 500,
18
- [ErrorCode.COMPANY_NOT_CREATED]: 500,
19
- [ErrorCode.COMPANY_NOT_FOUND]: 404,
20
- [ErrorCode.COMPANY_NOT_UPDATED]: 500,
21
- [ErrorCode.COMPANY_NOT_DELETED]: 500,
22
- [ErrorCode.NOT_ALLOWED_TO_CREATE_COMPANY]: 403,
23
- [ErrorCode.NOT_ALLOWED_TO_VIEW_COMPANY]: 403,
24
- [ErrorCode.NOT_ALLOWED_TO_UPDATE_COMPANY]: 403,
25
- [ErrorCode.NOT_ALLOWED_TO_DELETE_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,
26
26
  // User errors
27
27
  [ErrorCode.INTERNAL_SERVER_ERROR_ON_USERS_SERVICE]: 500,
28
28
  [ErrorCode.USER_NOT_CREATED]: 500,
@@ -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',
@@ -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 INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE: "INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE";
13
- readonly COMPANY_NOT_CREATED: "COMPANY_NOT_CREATED";
14
- readonly COMPANY_NOT_FOUND: "COMPANY_NOT_FOUND";
15
- readonly COMPANY_NOT_UPDATED: "COMPANY_NOT_UPDATED";
16
- readonly COMPANY_NOT_DELETED: "COMPANY_NOT_DELETED";
17
- readonly NOT_ALLOWED_TO_CREATE_COMPANY: "NOT_ALLOWED_TO_CREATE_COMPANY";
18
- readonly NOT_ALLOWED_TO_VIEW_COMPANY: "NOT_ALLOWED_TO_VIEW_COMPANY";
19
- readonly NOT_ALLOWED_TO_UPDATE_COMPANY: "NOT_ALLOWED_TO_UPDATE_COMPANY";
20
- readonly NOT_ALLOWED_TO_DELETE_COMPANY: "NOT_ALLOWED_TO_DELETE_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";
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
- // Company errors
15
- INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE: 'INTERNAL_SERVER_ERROR_ON_COMPANY_SERVICE',
16
- COMPANY_NOT_CREATED: 'COMPANY_NOT_CREATED',
17
- COMPANY_NOT_FOUND: 'COMPANY_NOT_FOUND',
18
- COMPANY_NOT_UPDATED: 'COMPANY_NOT_UPDATED',
19
- COMPANY_NOT_DELETED: 'COMPANY_NOT_DELETED',
20
- NOT_ALLOWED_TO_CREATE_COMPANY: 'NOT_ALLOWED_TO_CREATE_COMPANY',
21
- NOT_ALLOWED_TO_VIEW_COMPANY: 'NOT_ALLOWED_TO_VIEW_COMPANY',
22
- NOT_ALLOWED_TO_UPDATE_COMPANY: 'NOT_ALLOWED_TO_UPDATE_COMPANY',
23
- NOT_ALLOWED_TO_DELETE_COMPANY: 'NOT_ALLOWED_TO_DELETE_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',
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', // 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.5",
3
+ "version": "0.2.6",
4
4
  "author": "juki-team",
5
5
  "license": "MIT",
6
6
  "type": "module",