@xcpcio/types 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 XCPCIO
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # xcpcio/libs/types
2
+
3
+ ## License
4
+
5
+ [MIT](../../../LICENSE) License © 2023 [XCPCIO][xcpcio]
6
+
7
+ [xcpcio]: https://github.com/XCPCIO
package/dist/index.cjs ADDED
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const GITHUB_URL = "https://github.com/xcpcio/xcpcio";
6
+ const VERSION = "0.2.0";
7
+
8
+ var ContestState = /* @__PURE__ */ ((ContestState2) => {
9
+ ContestState2["PENDING"] = "PENDING";
10
+ ContestState2["RUNNING"] = "RUNNING";
11
+ ContestState2["FROZEN"] = "FROZEN";
12
+ ContestState2["FINISHED"] = "FINISHED";
13
+ return ContestState2;
14
+ })(ContestState || {});
15
+
16
+ var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
17
+ SubmissionStatus2["PENDING"] = "PENDING";
18
+ SubmissionStatus2["WAITING"] = "WAITING";
19
+ SubmissionStatus2["JUDGING"] = "JUDGING";
20
+ SubmissionStatus2["FROZEN"] = "FROZEN";
21
+ SubmissionStatus2["ACCEPTED"] = "ACCEPTED";
22
+ SubmissionStatus2["CORRECT"] = "CORRECT";
23
+ SubmissionStatus2["PARTIALLY_CORRECT"] = "PARTIALLY_CORRECT";
24
+ SubmissionStatus2["REJECTED"] = "REJECTED";
25
+ SubmissionStatus2["WRONG_ANSWER"] = "WRONG_ANSWER";
26
+ SubmissionStatus2["COMPILE_ERROR"] = "COMPILE_ERROR";
27
+ SubmissionStatus2["PRESENTATION_ERROR"] = "PRESENTATION_ERROR";
28
+ SubmissionStatus2["RUNTIME_ERROR"] = "RUNTIME_ERROR";
29
+ SubmissionStatus2["TIME_LIMIT_EXCEEDED"] = "TIME_LIMIT_EXCEEDED";
30
+ SubmissionStatus2["MEMORY_LIMIT_EXCEEDED"] = "MEMORY_LIMIT_EXCEEDED";
31
+ SubmissionStatus2["OUTPUT_LIMIT_EXCEEDED"] = "OUTPUT_LIMIT_EXCEEDED";
32
+ SubmissionStatus2["IDLENESS_LIMIT_EXCEEDED"] = "IDLENESS_LIMIT_EXCEEDED";
33
+ SubmissionStatus2["HACKED"] = "HACKED";
34
+ SubmissionStatus2["JUDGEMENT_FAILED"] = "JUDGEMENT_FAILED";
35
+ SubmissionStatus2["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
36
+ SubmissionStatus2["SYSTEM_ERROR"] = "SYSTEM_ERROR";
37
+ SubmissionStatus2["CANCELED"] = "CANCELED";
38
+ SubmissionStatus2["SKIPPED"] = "SKIPPED";
39
+ SubmissionStatus2["SECURITY_VIOLATED"] = "SECURITY_VIOLATED";
40
+ SubmissionStatus2["DENIAL_OF_JUDGEMENT"] = "DENIAL_OF_JUDGEMENT";
41
+ SubmissionStatus2["UNKNOWN"] = "UNKNOWN";
42
+ SubmissionStatus2["UNDEFINED"] = "UNDEFINED";
43
+ return SubmissionStatus2;
44
+ })(SubmissionStatus || {});
45
+
46
+ exports.ContestState = ContestState;
47
+ exports.GITHUB_URL = GITHUB_URL;
48
+ exports.SubmissionStatus = SubmissionStatus;
49
+ exports.VERSION = VERSION;
@@ -0,0 +1,185 @@
1
+ /**
2
+ * ISO8601 String.
3
+ * @example
4
+ * '2019-01-01T00:00:00Z'
5
+ * '2019-01-01T08:00:00+08:00'
6
+ * '2019-01-01T00:00:00.000Z'
7
+ */
8
+ type DateTimeISO8601String = string;
9
+ /**
10
+ * Color HEX.
11
+ * @example
12
+ * '#FFFFFF'
13
+ */
14
+ type ColorHEX = string;
15
+ /**
16
+ * Color RGB.
17
+ * @example
18
+ * 'rgb(255, 255, 255)'
19
+ */
20
+ type ColorRGB = string;
21
+ /**
22
+ * Color RGBA.
23
+ * @example
24
+ * 'rgba(255, 255, 255, 0.75)'
25
+ */
26
+ type ColorRGBA = string;
27
+ /** General color format. */
28
+ type Color = ColorHEX | ColorRGB | ColorRGBA;
29
+ type ThemeColor = Color | {
30
+ light: Color;
31
+ dark: Color;
32
+ };
33
+ interface Style {
34
+ /**
35
+ * Text color.
36
+ * @defaultValue Determined by renderer.
37
+ */
38
+ text_color?: ThemeColor;
39
+ /**
40
+ * Background color.
41
+ * @defaultValue Determined by renderer.
42
+ */
43
+ background_color?: ThemeColor;
44
+ }
45
+ interface BalloonColor {
46
+ color: ThemeColor;
47
+ background_color: ThemeColor;
48
+ }
49
+ /**
50
+ * i18n string set.
51
+ * @example
52
+ * { "en-US": 'English', "zh-CN": '中文', fallback: 'English' }
53
+ */
54
+ type I18NStringSet = {
55
+ /** The fallback string if renderer cannot determine the language to use. */
56
+ fallback: string;
57
+ /** The key is the IETF BCP 47 language tag, and the value is the string for this language tag. */
58
+ [key: string]: string;
59
+ };
60
+ /**
61
+ * Text (i18n supported).
62
+ */
63
+ type Text = string | I18NStringSet;
64
+ /**
65
+ * Contributor field. The email and url are optional.
66
+ * @example
67
+ * 'bLue <mail@example.com> (https://example.com/)'
68
+ */
69
+ type Contributor = string;
70
+ type Base64 = string;
71
+ type LinkString = string;
72
+ interface Link {
73
+ link: LinkString;
74
+ title?: string;
75
+ }
76
+ interface Image {
77
+ url?: string;
78
+ base64?: Base64;
79
+ type?: "png" | "svg" | "jpg" | "jpeg";
80
+ [key: string]: string | undefined;
81
+ }
82
+ interface StatusTimeDisplay {
83
+ correct: boolean;
84
+ incorrect: boolean;
85
+ pending: boolean;
86
+ }
87
+
88
+ declare const GITHUB_URL = "https://github.com/xcpcio/xcpcio";
89
+ declare const VERSION = "0.2.0";
90
+
91
+ interface Problem {
92
+ id: string;
93
+ label: string;
94
+ name?: string;
95
+ time_limit?: string;
96
+ memory_limit?: string;
97
+ balloon_color?: BalloonColor;
98
+ }
99
+ type Problems = Array<Problem>;
100
+
101
+ declare enum ContestState {
102
+ PENDING = "PENDING",
103
+ RUNNING = "RUNNING",
104
+ FROZEN = "FROZEN",
105
+ FINISHED = "FINISHED"
106
+ }
107
+ interface Contest {
108
+ contest_name: string;
109
+ start_time: number | DateTimeISO8601String;
110
+ end_time: number | DateTimeISO8601String;
111
+ freeze_time?: number | DateTimeISO8601String;
112
+ frozen_time?: number;
113
+ penalty: number;
114
+ problems?: Array<Problem>;
115
+ problem_id?: Array<string>;
116
+ organization?: string;
117
+ status_time_display?: Record<string, boolean>;
118
+ badge?: string;
119
+ medal?: Record<string, Record<string, number>>;
120
+ balloon_color?: Array<BalloonColor>;
121
+ group?: Record<string, string>;
122
+ tag?: Record<string, string>;
123
+ logo?: Image;
124
+ banner?: Image;
125
+ board_link?: string;
126
+ version?: string;
127
+ }
128
+
129
+ declare enum SubmissionStatus {
130
+ PENDING = "PENDING",
131
+ WAITING = "WAITING",
132
+ JUDGING = "JUDGING",
133
+ FROZEN = "FROZEN",
134
+ ACCEPTED = "ACCEPTED",
135
+ CORRECT = "CORRECT",
136
+ PARTIALLY_CORRECT = "PARTIALLY_CORRECT",
137
+ REJECTED = "REJECTED",
138
+ WRONG_ANSWER = "WRONG_ANSWER",
139
+ COMPILE_ERROR = "COMPILE_ERROR",
140
+ PRESENTATION_ERROR = "PRESENTATION_ERROR",
141
+ RUNTIME_ERROR = "RUNTIME_ERROR",
142
+ TIME_LIMIT_EXCEEDED = "TIME_LIMIT_EXCEEDED",
143
+ MEMORY_LIMIT_EXCEEDED = "MEMORY_LIMIT_EXCEEDED",
144
+ OUTPUT_LIMIT_EXCEEDED = "OUTPUT_LIMIT_EXCEEDED",
145
+ IDLENESS_LIMIT_EXCEEDED = "IDLENESS_LIMIT_EXCEEDED",
146
+ HACKED = "HACKED",
147
+ JUDGEMENT_FAILED = "JUDGEMENT_FAILED",
148
+ CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
149
+ SYSTEM_ERROR = "SYSTEM_ERROR",
150
+ CANCELED = "CANCELED",
151
+ SKIPPED = "SKIPPED",
152
+ SECURITY_VIOLATED = "SECURITY_VIOLATED",
153
+ DENIAL_OF_JUDGEMENT = "DENIAL_OF_JUDGEMENT",
154
+ UNKNOWN = "UNKNOWN",
155
+ UNDEFINED = "UNDEFINED"
156
+ }
157
+
158
+ interface Submission {
159
+ id?: string;
160
+ submission_id?: string;
161
+ team_id: string;
162
+ problem_id: number | string;
163
+ timestamp: number;
164
+ status: SubmissionStatus | string;
165
+ is_ignore?: boolean;
166
+ }
167
+ type Submissions = Array<Submission> | Record<string, Submission>;
168
+
169
+ interface Team {
170
+ id?: string;
171
+ team_id?: string;
172
+ name?: string;
173
+ team_name?: string;
174
+ organization?: string;
175
+ group?: Array<string>;
176
+ tag?: Array<string>;
177
+ coach?: string | Array<string>;
178
+ members?: string | Array<string>;
179
+ official?: boolean;
180
+ unofficial?: boolean;
181
+ girl?: boolean;
182
+ }
183
+ type Teams = Array<Team> | Record<string, Team>;
184
+
185
+ export { BalloonColor, Base64, Color, ColorHEX, ColorRGB, ColorRGBA, Contest, ContestState, Contributor, DateTimeISO8601String, GITHUB_URL, I18NStringSet, Image, Link, LinkString, Problem, Problems, StatusTimeDisplay, Style, Submission, SubmissionStatus, Submissions, Team, Teams, Text, ThemeColor, VERSION };
package/dist/index.mjs ADDED
@@ -0,0 +1,42 @@
1
+ const GITHUB_URL = "https://github.com/xcpcio/xcpcio";
2
+ const VERSION = "0.2.0";
3
+
4
+ var ContestState = /* @__PURE__ */ ((ContestState2) => {
5
+ ContestState2["PENDING"] = "PENDING";
6
+ ContestState2["RUNNING"] = "RUNNING";
7
+ ContestState2["FROZEN"] = "FROZEN";
8
+ ContestState2["FINISHED"] = "FINISHED";
9
+ return ContestState2;
10
+ })(ContestState || {});
11
+
12
+ var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
13
+ SubmissionStatus2["PENDING"] = "PENDING";
14
+ SubmissionStatus2["WAITING"] = "WAITING";
15
+ SubmissionStatus2["JUDGING"] = "JUDGING";
16
+ SubmissionStatus2["FROZEN"] = "FROZEN";
17
+ SubmissionStatus2["ACCEPTED"] = "ACCEPTED";
18
+ SubmissionStatus2["CORRECT"] = "CORRECT";
19
+ SubmissionStatus2["PARTIALLY_CORRECT"] = "PARTIALLY_CORRECT";
20
+ SubmissionStatus2["REJECTED"] = "REJECTED";
21
+ SubmissionStatus2["WRONG_ANSWER"] = "WRONG_ANSWER";
22
+ SubmissionStatus2["COMPILE_ERROR"] = "COMPILE_ERROR";
23
+ SubmissionStatus2["PRESENTATION_ERROR"] = "PRESENTATION_ERROR";
24
+ SubmissionStatus2["RUNTIME_ERROR"] = "RUNTIME_ERROR";
25
+ SubmissionStatus2["TIME_LIMIT_EXCEEDED"] = "TIME_LIMIT_EXCEEDED";
26
+ SubmissionStatus2["MEMORY_LIMIT_EXCEEDED"] = "MEMORY_LIMIT_EXCEEDED";
27
+ SubmissionStatus2["OUTPUT_LIMIT_EXCEEDED"] = "OUTPUT_LIMIT_EXCEEDED";
28
+ SubmissionStatus2["IDLENESS_LIMIT_EXCEEDED"] = "IDLENESS_LIMIT_EXCEEDED";
29
+ SubmissionStatus2["HACKED"] = "HACKED";
30
+ SubmissionStatus2["JUDGEMENT_FAILED"] = "JUDGEMENT_FAILED";
31
+ SubmissionStatus2["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
32
+ SubmissionStatus2["SYSTEM_ERROR"] = "SYSTEM_ERROR";
33
+ SubmissionStatus2["CANCELED"] = "CANCELED";
34
+ SubmissionStatus2["SKIPPED"] = "SKIPPED";
35
+ SubmissionStatus2["SECURITY_VIOLATED"] = "SECURITY_VIOLATED";
36
+ SubmissionStatus2["DENIAL_OF_JUDGEMENT"] = "DENIAL_OF_JUDGEMENT";
37
+ SubmissionStatus2["UNKNOWN"] = "UNKNOWN";
38
+ SubmissionStatus2["UNDEFINED"] = "UNDEFINED";
39
+ return SubmissionStatus2;
40
+ })(SubmissionStatus || {});
41
+
42
+ export { ContestState, GITHUB_URL, SubmissionStatus, VERSION };
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@xcpcio/types",
3
+ "description": "XCPCIO Types",
4
+ "version": "0.2.1",
5
+ "license": "MIT",
6
+ "author": "Dup4 <lyuzhi.pan@gmail.com>",
7
+ "keywords": [
8
+ "ICPC",
9
+ "CCPC"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/xcpcio/xcpcio.git"
14
+ },
15
+ "homepage": "https://github.com/xcpcio/xcpcio",
16
+ "bugs": {
17
+ "url": "https://github.com/xcpcio/xcpcio/issues"
18
+ },
19
+ "main": "./dist/index.mjs",
20
+ "module": "./dist/index.mjs",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "require": "./dist/index.cjs",
25
+ "import": "./dist/index.mjs",
26
+ "types": "./dist/index.d.ts"
27
+ }
28
+ },
29
+ "typesVersions": {
30
+ "*": {
31
+ "*": [
32
+ "./dist/*",
33
+ "./dist/index.d.ts"
34
+ ]
35
+ }
36
+ },
37
+ "files": [
38
+ "src",
39
+ "dist"
40
+ ],
41
+ "sideEffects": false,
42
+ "devDependencies": {
43
+ "@babel/types": "^7.22.4",
44
+ "@types/node": "^17.0.45",
45
+ "@typescript-eslint/eslint-plugin": "^5.59.9",
46
+ "@typescript-eslint/parser": "^5.59.9",
47
+ "bumpp": "^7.2.0",
48
+ "eslint": "^8.42.0",
49
+ "esmo": "^0.14.1",
50
+ "npm-run-all": "^4.1.5",
51
+ "pnpm": "^7.33.0",
52
+ "prettier": "^2.8.8",
53
+ "taze": "^0.10.2",
54
+ "typescript": "^4.9.5",
55
+ "unbuild": "^0.7.6",
56
+ "vite": "^4.3.9",
57
+ "vitest": "^0.32.0"
58
+ },
59
+ "scripts": {
60
+ "build": "unbuild",
61
+ "dev": "unbuild --stub",
62
+ "start": "esmo src/index.ts",
63
+ "test": "vitest",
64
+ "lint": "run-p lint:*",
65
+ "lint:build": "# tsc --noEmit"
66
+ }
67
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * ISO8601 String.
3
+ * @example
4
+ * '2019-01-01T00:00:00Z'
5
+ * '2019-01-01T08:00:00+08:00'
6
+ * '2019-01-01T00:00:00.000Z'
7
+ */
8
+ export type DateTimeISO8601String = string;
9
+
10
+ /**
11
+ * Color HEX.
12
+ * @example
13
+ * '#FFFFFF'
14
+ */
15
+ export type ColorHEX = string;
16
+
17
+ /**
18
+ * Color RGB.
19
+ * @example
20
+ * 'rgb(255, 255, 255)'
21
+ */
22
+ export type ColorRGB = string;
23
+
24
+ /**
25
+ * Color RGBA.
26
+ * @example
27
+ * 'rgba(255, 255, 255, 0.75)'
28
+ */
29
+ export type ColorRGBA = string;
30
+
31
+ /** General color format. */
32
+ export type Color = ColorHEX | ColorRGB | ColorRGBA;
33
+
34
+ export type ThemeColor =
35
+ | Color
36
+ | {
37
+ light: Color;
38
+ dark: Color;
39
+ };
40
+
41
+ export interface Style {
42
+ /**
43
+ * Text color.
44
+ * @defaultValue Determined by renderer.
45
+ */
46
+ text_color?: ThemeColor;
47
+
48
+ /**
49
+ * Background color.
50
+ * @defaultValue Determined by renderer.
51
+ */
52
+ background_color?: ThemeColor;
53
+ }
54
+
55
+ export interface BalloonColor {
56
+ color: ThemeColor;
57
+ background_color: ThemeColor;
58
+ }
59
+
60
+ /**
61
+ * i18n string set.
62
+ * @example
63
+ * { "en-US": 'English', "zh-CN": '中文', fallback: 'English' }
64
+ */
65
+ export type I18NStringSet = {
66
+ /** The fallback string if renderer cannot determine the language to use. */
67
+ fallback: string;
68
+ /** The key is the IETF BCP 47 language tag, and the value is the string for this language tag. */
69
+ [key: string]: string;
70
+ };
71
+
72
+ /**
73
+ * Text (i18n supported).
74
+ */
75
+ export type Text = string | I18NStringSet;
76
+
77
+ /**
78
+ * Contributor field. The email and url are optional.
79
+ * @example
80
+ * 'bLue <mail@example.com> (https://example.com/)'
81
+ */
82
+ export type Contributor = string;
83
+
84
+ export type Base64 = string;
85
+
86
+ export type LinkString = string;
87
+
88
+ export interface Link {
89
+ link: LinkString;
90
+ title?: string;
91
+ }
92
+
93
+ export interface Image {
94
+ url?: string;
95
+ base64?: Base64;
96
+ type?: "png" | "svg" | "jpg" | "jpeg";
97
+ [key: string]: string | undefined;
98
+ }
99
+
100
+ export interface StatusTimeDisplay {
101
+ correct: boolean;
102
+ incorrect: boolean;
103
+ pending: boolean;
104
+ }
@@ -0,0 +1,2 @@
1
+ export const GITHUB_URL = "import.meta.package.homepage";
2
+ export const VERSION = "import.meta.package.version";
package/src/contest.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { BalloonColor, Image, DateTimeISO8601String } from "./basic-types";
2
+ import { Problem } from "./problem";
3
+
4
+ export enum ContestState {
5
+ PENDING = "PENDING",
6
+ RUNNING = "RUNNING",
7
+ FROZEN = "FROZEN",
8
+ FINISHED = "FINISHED",
9
+ }
10
+
11
+ export interface Contest {
12
+ contest_name: string;
13
+
14
+ start_time: number | DateTimeISO8601String;
15
+ end_time: number | DateTimeISO8601String;
16
+ freeze_time?: number | DateTimeISO8601String;
17
+
18
+ frozen_time?: number; // unit: seconds
19
+ penalty: number; // unit: seconds
20
+
21
+ problems?: Array<Problem>;
22
+ problem_id?: Array<string>;
23
+
24
+ organization?: string;
25
+ status_time_display?: Record<string, boolean>;
26
+
27
+ badge?: string;
28
+ medal?: Record<string, Record<string, number>>;
29
+ balloon_color?: Array<BalloonColor>;
30
+
31
+ group?: Record<string, string>;
32
+ tag?: Record<string, string>;
33
+
34
+ logo?: Image;
35
+ banner?: Image;
36
+ board_link?: string;
37
+
38
+ version?: string;
39
+ }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./basic-types";
2
+ export * from "./constant";
3
+ export * from "./contest";
4
+ export * from "./problem";
5
+ export * from "./submission-status";
6
+ export * from "./submission";
7
+ export * from "./team";
package/src/problem.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { BalloonColor } from "./basic-types";
2
+
3
+ export interface Problem {
4
+ id: string;
5
+ label: string;
6
+
7
+ name?: string;
8
+
9
+ time_limit?: string;
10
+ memory_limit?: string;
11
+
12
+ balloon_color?: BalloonColor;
13
+ }
14
+
15
+ export type Problems = Array<Problem>;
@@ -0,0 +1,36 @@
1
+ export enum SubmissionStatus {
2
+ PENDING = "PENDING",
3
+ WAITING = "WAITING",
4
+ JUDGING = "JUDGING",
5
+ FROZEN = "FROZEN",
6
+
7
+ ACCEPTED = "ACCEPTED",
8
+ CORRECT = "CORRECT",
9
+ PARTIALLY_CORRECT = "PARTIALLY_CORRECT",
10
+
11
+ REJECTED = "REJECTED",
12
+ WRONG_ANSWER = "WRONG_ANSWER",
13
+
14
+ COMPILE_ERROR = "COMPILE_ERROR",
15
+ PRESENTATION_ERROR = "PRESENTATION_ERROR",
16
+
17
+ RUNTIME_ERROR = "RUNTIME_ERROR",
18
+ TIME_LIMIT_EXCEEDED = "TIME_LIMIT_EXCEEDED",
19
+ MEMORY_LIMIT_EXCEEDED = "MEMORY_LIMIT_EXCEEDED",
20
+ OUTPUT_LIMIT_EXCEEDED = "OUTPUT_LIMIT_EXCEEDED",
21
+ IDLENESS_LIMIT_EXCEEDED = "IDLENESS_LIMIT_EXCEEDED",
22
+
23
+ HACKED = "HACKED",
24
+
25
+ JUDGEMENT_FAILED = "JUDGEMENT_FAILED",
26
+ CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
27
+ SYSTEM_ERROR = "SYSTEM_ERROR",
28
+ CANCELED = "CANCELED",
29
+ SKIPPED = "SKIPPED",
30
+
31
+ SECURITY_VIOLATED = "SECURITY_VIOLATED",
32
+ DENIAL_OF_JUDGEMENT = "DENIAL_OF_JUDGEMENT",
33
+
34
+ UNKNOWN = "UNKNOWN",
35
+ UNDEFINED = "UNDEFINED",
36
+ }
@@ -0,0 +1,15 @@
1
+ import { SubmissionStatus } from "./submission-status";
2
+
3
+ export interface Submission {
4
+ id?: string;
5
+ submission_id?: string;
6
+
7
+ team_id: string;
8
+ problem_id: number | string;
9
+ timestamp: number; // unit: seconds
10
+ status: SubmissionStatus | string;
11
+
12
+ is_ignore?: boolean;
13
+ }
14
+
15
+ export type Submissions = Array<Submission> | Record<string, Submission>;
package/src/team.ts ADDED
@@ -0,0 +1,20 @@
1
+ export interface Team {
2
+ id?: string;
3
+ team_id?: string;
4
+
5
+ name?: string;
6
+ team_name?: string;
7
+
8
+ organization?: string;
9
+ group?: Array<string>;
10
+ tag?: Array<string>;
11
+
12
+ coach?: string | Array<string>;
13
+ members?: string | Array<string>;
14
+
15
+ official?: boolean;
16
+ unofficial?: boolean;
17
+ girl?: boolean;
18
+ }
19
+
20
+ export type Teams = Array<Team> | Record<string, Team>;