@juki-team/commons 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/biome.shared.json +102 -0
- package/dist/constants/commons.d.ts +62 -0
- package/dist/constants/commons.js +658 -0
- package/dist/constants/company.d.ts +9 -0
- package/dist/constants/company.js +24 -0
- package/dist/constants/contest.d.ts +15 -0
- package/dist/constants/contest.js +29 -0
- package/dist/constants/course.d.ts +8 -0
- package/dist/constants/course.js +12 -0
- package/dist/constants/date.d.ts +9 -0
- package/dist/constants/date.js +23 -0
- package/dist/constants/email.d.ts +2 -0
- package/dist/constants/email.js +34 -0
- package/dist/constants/entity.d.ts +3 -0
- package/dist/constants/entity.js +18 -0
- package/dist/constants/file.d.ts +28 -0
- package/dist/constants/file.js +46 -0
- package/dist/constants/index.d.ts +18 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/judge.d.ts +37 -0
- package/dist/constants/judge.js +221 -0
- package/dist/constants/problem.d.ts +37 -0
- package/dist/constants/problem.js +72 -0
- package/dist/constants/routing.d.ts +7 -0
- package/dist/constants/routing.js +7 -0
- package/dist/constants/services.d.ts +5 -0
- package/dist/constants/services.js +131 -0
- package/dist/constants/system.d.ts +8 -0
- package/dist/constants/system.js +9 -0
- package/dist/constants/teams.d.ts +15 -0
- package/dist/constants/teams.js +18 -0
- package/dist/constants/time.d.ts +9 -0
- package/dist/constants/time.js +9 -0
- package/dist/constants/user.d.ts +10 -0
- package/dist/constants/user.js +35 -0
- package/dist/constants/websocket.d.ts +6 -0
- package/dist/constants/websocket.js +5 -0
- package/dist/constants/worksheet.d.ts +11 -0
- package/dist/constants/worksheet.js +66 -0
- package/dist/dto/class.d.ts +115 -0
- package/dist/dto/class.js +1 -0
- package/dist/dto/code.d.ts +13 -0
- package/dist/dto/code.js +1 -0
- package/dist/dto/comments.d.ts +21 -0
- package/dist/dto/comments.js +1 -0
- package/dist/dto/contest.d.ts +95 -0
- package/dist/dto/contest.js +7 -0
- package/dist/dto/course.d.ts +34 -0
- package/dist/dto/course.js +1 -0
- package/dist/dto/entity.d.ts +92 -0
- package/dist/dto/entity.js +5 -0
- package/dist/dto/excalidraw.d.ts +12 -0
- package/dist/dto/excalidraw.js +1 -0
- package/dist/dto/file.d.ts +34 -0
- package/dist/dto/file.js +1 -0
- package/dist/dto/image.d.ts +6 -0
- package/dist/dto/image.js +1 -0
- package/dist/dto/index.d.ts +24 -0
- package/dist/dto/index.js +24 -0
- package/dist/dto/judge.d.ts +16 -0
- package/dist/dto/judge.js +1 -0
- package/dist/dto/markdown.d.ts +12 -0
- package/dist/dto/markdown.js +1 -0
- package/dist/dto/mermaid.d.ts +12 -0
- package/dist/dto/mermaid.js +1 -0
- package/dist/dto/organization.d.ts +102 -0
- package/dist/dto/organization.js +1 -0
- package/dist/dto/problem.d.ts +67 -0
- package/dist/dto/problem.js +1 -0
- package/dist/dto/scoreboard.d.ts +35 -0
- package/dist/dto/scoreboard.js +1 -0
- package/dist/dto/session.d.ts +15 -0
- package/dist/dto/session.js +1 -0
- package/dist/dto/socket.d.ts +257 -0
- package/dist/dto/socket.js +1 -0
- package/dist/dto/statistics.d.ts +43 -0
- package/dist/dto/statistics.js +1 -0
- package/dist/dto/submission.d.ts +95 -0
- package/dist/dto/submission.js +1 -0
- package/dist/dto/system.d.ts +91 -0
- package/dist/dto/system.js +1 -0
- package/dist/dto/url.d.ts +8 -0
- package/dist/dto/url.js +1 -0
- package/dist/dto/user.d.ts +109 -0
- package/dist/dto/user.js +1 -0
- package/dist/dto/virtual-user.d.ts +39 -0
- package/dist/dto/virtual-user.js +1 -0
- package/dist/dto/worksheet-submissions.d.ts +64 -0
- package/dist/dto/worksheet-submissions.js +1 -0
- package/dist/dto/worksheet.d.ts +39 -0
- package/dist/dto/worksheet.js +1 -0
- package/dist/helpers/class.d.ts +4 -0
- package/dist/helpers/class.js +10 -0
- package/dist/helpers/comments.d.ts +4 -0
- package/dist/helpers/comments.js +4 -0
- package/dist/helpers/commons.d.ts +33 -0
- package/dist/helpers/commons.js +191 -0
- package/dist/helpers/contest.d.ts +5 -0
- package/dist/helpers/contest.js +21 -0
- package/dist/helpers/document.d.ts +14 -0
- package/dist/helpers/document.js +38 -0
- package/dist/helpers/file.d.ts +1 -0
- package/dist/helpers/file.js +4 -0
- package/dist/helpers/index.d.ts +14 -0
- package/dist/helpers/index.js +14 -0
- package/dist/helpers/interval.d.ts +2 -0
- package/dist/helpers/interval.js +22 -0
- package/dist/helpers/judging.d.ts +25 -0
- package/dist/helpers/judging.js +107 -0
- package/dist/helpers/object.d.ts +1 -0
- package/dist/helpers/object.js +32 -0
- package/dist/helpers/responses.d.ts +8 -0
- package/dist/helpers/responses.js +78 -0
- package/dist/helpers/socket.d.ts +45 -0
- package/dist/helpers/socket.js +238 -0
- package/dist/helpers/time.d.ts +13 -0
- package/dist/helpers/time.js +101 -0
- package/dist/helpers/user.d.ts +11 -0
- package/dist/helpers/user.js +14 -0
- package/dist/helpers/worksheet.d.ts +10 -0
- package/dist/helpers/worksheet.js +131 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/prisma/enums/AssignmentClassType.d.ts +7 -0
- package/dist/prisma/enums/AssignmentClassType.js +6 -0
- package/dist/prisma/enums/ContestEventAction.d.ts +10 -0
- package/dist/prisma/enums/ContestEventAction.js +9 -0
- package/dist/prisma/enums/ContestProblemPrerequisiteType.d.ts +5 -0
- package/dist/prisma/enums/ContestProblemPrerequisiteType.js +4 -0
- package/dist/prisma/enums/ContestRole.d.ts +11 -0
- package/dist/prisma/enums/ContestRole.js +10 -0
- package/dist/prisma/enums/ContestStatus.d.ts +6 -0
- package/dist/prisma/enums/ContestStatus.js +5 -0
- package/dist/prisma/enums/CourseRole.d.ts +12 -0
- package/dist/prisma/enums/CourseRole.js +11 -0
- package/dist/prisma/enums/EntityObjectType.d.ts +13 -0
- package/dist/prisma/enums/EntityObjectType.js +12 -0
- package/dist/prisma/enums/EntityRole.d.ts +8 -0
- package/dist/prisma/enums/EntityRole.js +7 -0
- package/dist/prisma/enums/EntitySubjectType.d.ts +7 -0
- package/dist/prisma/enums/EntitySubjectType.js +6 -0
- package/dist/prisma/enums/FileRole.d.ts +9 -0
- package/dist/prisma/enums/FileRole.js +8 -0
- package/dist/prisma/enums/FileType.d.ts +5 -0
- package/dist/prisma/enums/FileType.js +4 -0
- package/dist/prisma/enums/GroupType.d.ts +5 -0
- package/dist/prisma/enums/GroupType.js +4 -0
- package/dist/prisma/enums/JudgeType.d.ts +12 -0
- package/dist/prisma/enums/JudgeType.js +11 -0
- package/dist/prisma/enums/OrganizationPlan.d.ts +7 -0
- package/dist/prisma/enums/OrganizationPlan.js +6 -0
- package/dist/prisma/enums/ProblemRole.d.ts +11 -0
- package/dist/prisma/enums/ProblemRole.js +10 -0
- package/dist/prisma/enums/ProblemScoringMode.d.ts +6 -0
- package/dist/prisma/enums/ProblemScoringMode.js +5 -0
- package/dist/prisma/enums/ProblemType.d.ts +6 -0
- package/dist/prisma/enums/ProblemType.js +5 -0
- package/dist/prisma/enums/ProblemVerdict.d.ts +14 -0
- package/dist/prisma/enums/ProblemVerdict.js +13 -0
- package/dist/prisma/enums/ShareLinkVisibility.d.ts +5 -0
- package/dist/prisma/enums/ShareLinkVisibility.js +4 -0
- package/dist/prisma/enums/SubmissionRunStatus.d.ts +18 -0
- package/dist/prisma/enums/SubmissionRunStatus.js +17 -0
- package/dist/prisma/enums/SystemRole.d.ts +9 -0
- package/dist/prisma/enums/SystemRole.js +8 -0
- package/dist/prisma/enums/TeamRole.d.ts +9 -0
- package/dist/prisma/enums/TeamRole.js +8 -0
- package/dist/prisma/enums/TelemetryType.d.ts +9 -0
- package/dist/prisma/enums/TelemetryType.js +8 -0
- package/dist/prisma/enums/UserRole.d.ts +10 -0
- package/dist/prisma/enums/UserRole.js +9 -0
- package/dist/prisma/enums/WorkingIn.d.ts +8 -0
- package/dist/prisma/enums/WorkingIn.js +7 -0
- package/dist/prisma/enums/WorksheetContentType.d.ts +10 -0
- package/dist/prisma/enums/WorksheetContentType.js +9 -0
- package/dist/prisma/enums/index.d.ts +26 -0
- package/dist/prisma/enums/index.js +26 -0
- package/dist/prototypes/Date.d.ts +62 -0
- package/dist/prototypes/Date.js +218 -0
- package/dist/prototypes/Error.d.ts +10 -0
- package/dist/prototypes/Error.js +17 -0
- package/dist/prototypes/Number.d.ts +7 -0
- package/dist/prototypes/Number.js +8 -0
- package/dist/prototypes/index.d.ts +3 -0
- package/dist/prototypes/index.js +3 -0
- package/dist/types/account.d.ts +9 -0
- package/dist/types/account.js +10 -0
- package/dist/types/class.d.ts +67 -0
- package/dist/types/class.js +7 -0
- package/dist/types/comments.d.ts +17 -0
- package/dist/types/comments.js +1 -0
- package/dist/types/commons.d.ts +84 -0
- package/dist/types/commons.js +69 -0
- package/dist/types/company.d.ts +6 -0
- package/dist/types/company.js +7 -0
- package/dist/types/contest.d.ts +144 -0
- package/dist/types/contest.js +6 -0
- package/dist/types/course.d.ts +13 -0
- package/dist/types/course.js +1 -0
- package/dist/types/entity.d.ts +116 -0
- package/dist/types/entity.js +50 -0
- package/dist/types/excalidraw.d.ts +9 -0
- package/dist/types/excalidraw.js +1 -0
- package/dist/types/file.d.ts +22 -0
- package/dist/types/file.js +13 -0
- package/dist/types/group.d.ts +9 -0
- package/dist/types/group.js +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.js +23 -0
- package/dist/types/judge.d.ts +46 -0
- package/dist/types/judge.js +17 -0
- package/dist/types/markdown.d.ts +8 -0
- package/dist/types/markdown.js +1 -0
- package/dist/types/mermaid.d.ts +8 -0
- package/dist/types/mermaid.js +1 -0
- package/dist/types/notification.d.ts +7 -0
- package/dist/types/notification.js +8 -0
- package/dist/types/problems.d.ts +93 -0
- package/dist/types/problems.js +16 -0
- package/dist/types/services.d.ts +214 -0
- package/dist/types/services.js +147 -0
- package/dist/types/sheet.d.ts +104 -0
- package/dist/types/sheet.js +16 -0
- package/dist/types/socket.d.ts +49 -0
- package/dist/types/socket.js +49 -0
- package/dist/types/submission.d.ts +5 -0
- package/dist/types/submission.js +1 -0
- package/dist/types/teams.d.ts +96 -0
- package/dist/types/teams.js +28 -0
- package/dist/types/users.d.ts +65 -0
- package/dist/types/users.js +33 -0
- package/dist/types/worksheet.d.ts +42 -0
- package/dist/types/worksheet.js +11 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
|
|
3
|
+
"formatter": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"formatWithErrors": false,
|
|
6
|
+
"indentStyle": "space",
|
|
7
|
+
"indentWidth": 2,
|
|
8
|
+
"lineEnding": "lf",
|
|
9
|
+
"lineWidth": 128,
|
|
10
|
+
"attributePosition": "auto",
|
|
11
|
+
"bracketSameLine": false,
|
|
12
|
+
"bracketSpacing": true,
|
|
13
|
+
"expand": "auto",
|
|
14
|
+
"useEditorconfig": true
|
|
15
|
+
},
|
|
16
|
+
"linter": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"rules": {
|
|
19
|
+
"recommended": true,
|
|
20
|
+
"correctness": {
|
|
21
|
+
"noUnusedImports": "error",
|
|
22
|
+
"noUnusedVariables": "error",
|
|
23
|
+
"noUnusedPrivateClassMembers": "error",
|
|
24
|
+
"noUnusedFunctionParameters": "error",
|
|
25
|
+
"useExhaustiveDependencies": "error",
|
|
26
|
+
"noConstantCondition": "error",
|
|
27
|
+
"noVoidTypeReturn": "error",
|
|
28
|
+
"noUndeclaredVariables": "error",
|
|
29
|
+
"useImportExtensions": "off"
|
|
30
|
+
},
|
|
31
|
+
"suspicious": {
|
|
32
|
+
"noConsole": { "level": "error", "options": { "allow": ["error", "warn", "info"] } },
|
|
33
|
+
"noExplicitAny": "error",
|
|
34
|
+
"noDoubleEquals": "error",
|
|
35
|
+
"noEmptyBlockStatements": "error",
|
|
36
|
+
"noConfusingVoidType": "error",
|
|
37
|
+
"useAwait": "error",
|
|
38
|
+
"noAssignInExpressions": "error",
|
|
39
|
+
"noMisleadingInstantiator": "error"
|
|
40
|
+
},
|
|
41
|
+
"style": {
|
|
42
|
+
"noNonNullAssertion": "error",
|
|
43
|
+
"useConst": "error",
|
|
44
|
+
"useTemplate": "error",
|
|
45
|
+
"noParameterAssign": "error",
|
|
46
|
+
"useShorthandAssign": "error",
|
|
47
|
+
"noUselessElse": "error",
|
|
48
|
+
"useDefaultParameterLast": "error",
|
|
49
|
+
"noDefaultExport": "error",
|
|
50
|
+
"useNamingConvention": {
|
|
51
|
+
"level": "error",
|
|
52
|
+
"options": {
|
|
53
|
+
"strictCase": false,
|
|
54
|
+
"conventions": [
|
|
55
|
+
{
|
|
56
|
+
"selector": { "kind": "enumMember" },
|
|
57
|
+
"formats": ["CONSTANT_CASE"]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"useImportType": "error"
|
|
63
|
+
},
|
|
64
|
+
"performance": {
|
|
65
|
+
"noDelete": "error",
|
|
66
|
+
"noAccumulatingSpread": "error",
|
|
67
|
+
"noNamespaceImport": "error"
|
|
68
|
+
},
|
|
69
|
+
"complexity": {
|
|
70
|
+
"noExcessiveCognitiveComplexity": { "level": "warn", "options": { "maxAllowedComplexity": 10 } },
|
|
71
|
+
"noForEach": "error",
|
|
72
|
+
"useSimplifiedLogicExpression": "error",
|
|
73
|
+
"useFlatMap": "error",
|
|
74
|
+
"noStaticOnlyClass": "error",
|
|
75
|
+
"noUselessSwitchCase": "error"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"javascript": {
|
|
80
|
+
"formatter": {
|
|
81
|
+
"jsxQuoteStyle": "double",
|
|
82
|
+
"quoteProperties": "asNeeded",
|
|
83
|
+
"trailingCommas": "all",
|
|
84
|
+
"semicolons": "always",
|
|
85
|
+
"arrowParentheses": "always",
|
|
86
|
+
"bracketSameLine": false,
|
|
87
|
+
"quoteStyle": "single",
|
|
88
|
+
"attributePosition": "auto",
|
|
89
|
+
"bracketSpacing": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"html": {
|
|
93
|
+
"formatter": {
|
|
94
|
+
"indentScriptAndStyle": false,
|
|
95
|
+
"selfCloseVoidElements": "always"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"assist": {
|
|
99
|
+
"enabled": true,
|
|
100
|
+
"actions": { "source": { "organizeImports": "on" } }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CodeLanguage, Language, Theme } from '../types/index.js';
|
|
2
|
+
export declare const LANGUAGE: {
|
|
3
|
+
[Key in Language]: {
|
|
4
|
+
value: Language;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const THEME: {
|
|
9
|
+
[Key in Theme]: {
|
|
10
|
+
value: Theme;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type CodeLanguageMeta = {
|
|
15
|
+
value: CodeLanguage;
|
|
16
|
+
label: string;
|
|
17
|
+
mime: string;
|
|
18
|
+
mainFilename: string;
|
|
19
|
+
fileExtension: Array<string>;
|
|
20
|
+
compilePattern: string;
|
|
21
|
+
runPattern: string;
|
|
22
|
+
templateSourceCode: string;
|
|
23
|
+
hasBuildFile: boolean;
|
|
24
|
+
executable: string;
|
|
25
|
+
executableVersion: string;
|
|
26
|
+
monacoKey: string;
|
|
27
|
+
codeMirrorKey: string;
|
|
28
|
+
highlightJsKey: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const CODE_LANGUAGE: {
|
|
31
|
+
[Key in CodeLanguage]: CodeLanguageMeta;
|
|
32
|
+
};
|
|
33
|
+
export declare const PAGE_SIZES: string[];
|
|
34
|
+
export declare const PALLETE: {
|
|
35
|
+
vivos: {
|
|
36
|
+
color: string;
|
|
37
|
+
title: string;
|
|
38
|
+
}[];
|
|
39
|
+
oscuros: {
|
|
40
|
+
color: string;
|
|
41
|
+
title: string;
|
|
42
|
+
}[];
|
|
43
|
+
agrisados: {
|
|
44
|
+
color: string;
|
|
45
|
+
title: string;
|
|
46
|
+
}[];
|
|
47
|
+
claros: {
|
|
48
|
+
color: string;
|
|
49
|
+
title: string;
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
export declare const UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
53
|
+
export declare const LOWERCASE_LETTERS: string;
|
|
54
|
+
export declare const NUMBERS = "012345678";
|
|
55
|
+
export declare const DEFAULT_JUKI_PROFILE_IMAGE = "https://juki-judge.s3.us-east-2.amazonaws.com/public/file/5f69783aa7a8e048ef8d0ce2.";
|
|
56
|
+
export declare const SEPARATOR_TOKEN = "\u001E";
|
|
57
|
+
export declare const HEADER_JUKI_FORWARDED_HOST = "x-juki-forwarded-host";
|
|
58
|
+
export declare const HEADER_JUKI_VISITOR_SESSION_ID = "x-juki-visitor-session-id";
|
|
59
|
+
export declare const HEADER_JUKI_METADATA = "x-juki-metadata";
|
|
60
|
+
export declare const HEADER_JUKI_SECRET_TOKEN = "x-juki-secret-token";
|
|
61
|
+
export declare const HEADER_JUKI_INTERNAL_API_KEY = "x-juki-internal-api-key";
|
|
62
|
+
export declare const COOKIE_JUKI_SESSION_ID = "juki-session-id";
|