@xcpcio/core 0.50.5 → 0.51.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/dist/index.cjs CHANGED
@@ -1386,6 +1386,9 @@ function createSubmission(submissionJSON) {
1386
1386
  if (submissionJSON.language) {
1387
1387
  s.language = submissionJSON.language;
1388
1388
  }
1389
+ if (submissionJSON.reaction) {
1390
+ s.reaction = submissionJSON.reaction;
1391
+ }
1389
1392
  return s;
1390
1393
  }
1391
1394
  function createSubmissions(submissionsJSON) {
@@ -1536,6 +1539,7 @@ class ContestOptions {
1536
1539
  this.submissionTimestampUnit = "second";
1537
1540
  this.submissionHasTimeField = false;
1538
1541
  this.submissionHasLanguageField = false;
1542
+ this.submissionEnableActionField = false;
1539
1543
  }
1540
1544
  }
1541
1545
  function createContestOptions(contestOptionsJSON = {}) {
@@ -1547,6 +1551,9 @@ function createContestOptions(contestOptionsJSON = {}) {
1547
1551
  if (j.submission_timestamp_unit) {
1548
1552
  o.submissionTimestampUnit = j.submission_timestamp_unit;
1549
1553
  }
1554
+ if (j.submission_has_reaction) {
1555
+ o.submissionEnableActionField = j.submission_has_reaction;
1556
+ }
1550
1557
  return o;
1551
1558
  }
1552
1559
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TimeUnit, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, Lang, CalculationOfPenalty, StatusTimeDisplay, MedalPreset, Image, BannerMode, ContestState, Contest as Contest$1, Team as Team$1, Teams as Teams$1, IPerson, IRatingHistory, IRatingUser, IRating, ContestIndex as ContestIndex$1 } from '@xcpcio/types';
1
+ import { TimeUnit, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, Lang, CalculationOfPenalty, StatusTimeDisplay, MedalPreset, Image, BannerMode, ContestState, Contest as Contest$1, Team as Team$1, Teams as Teams$1, IPerson, IRatingHistory, IRatingUser, IRating, ContestIndex as ContestIndex$1 } from '@xcpcio/types';
2
2
  import dayjs from 'dayjs';
3
3
  export { default as dayjs } from 'dayjs';
4
4
  import * as XLSX from 'xlsx-js-style';
@@ -11,6 +11,7 @@ declare class Submission {
11
11
  timestampUnit: TimeUnit;
12
12
  time?: number;
13
13
  language?: string;
14
+ reaction?: SubmissionReaction;
14
15
  status: SubmissionStatus;
15
16
  isIgnore: boolean;
16
17
  isSolved: boolean;
@@ -122,6 +123,7 @@ declare class ContestOptions {
122
123
  submissionTimestampUnit: TimeUnit;
123
124
  submissionHasTimeField: boolean;
124
125
  submissionHasLanguageField: boolean;
126
+ submissionEnableActionField: boolean;
125
127
  constructor();
126
128
  }
127
129
 
package/dist/index.mjs CHANGED
@@ -1353,6 +1353,9 @@ function createSubmission(submissionJSON) {
1353
1353
  if (submissionJSON.language) {
1354
1354
  s.language = submissionJSON.language;
1355
1355
  }
1356
+ if (submissionJSON.reaction) {
1357
+ s.reaction = submissionJSON.reaction;
1358
+ }
1356
1359
  return s;
1357
1360
  }
1358
1361
  function createSubmissions(submissionsJSON) {
@@ -1503,6 +1506,7 @@ class ContestOptions {
1503
1506
  this.submissionTimestampUnit = "second";
1504
1507
  this.submissionHasTimeField = false;
1505
1508
  this.submissionHasLanguageField = false;
1509
+ this.submissionEnableActionField = false;
1506
1510
  }
1507
1511
  }
1508
1512
  function createContestOptions(contestOptionsJSON = {}) {
@@ -1514,6 +1518,9 @@ function createContestOptions(contestOptionsJSON = {}) {
1514
1518
  if (j.submission_timestamp_unit) {
1515
1519
  o.submissionTimestampUnit = j.submission_timestamp_unit;
1516
1520
  }
1521
+ if (j.submission_has_reaction) {
1522
+ o.submissionEnableActionField = j.submission_has_reaction;
1523
+ }
1517
1524
  return o;
1518
1525
  }
1519
1526
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.50.5",
3
+ "version": "0.51.1",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -40,36 +40,36 @@
40
40
  "dist"
41
41
  ],
42
42
  "dependencies": {
43
- "chroma-js": "^2.4.2",
43
+ "chroma-js": "^2.6.0",
44
44
  "color-diff": "^1.4.0",
45
- "dayjs": "^1.11.8",
46
- "js-base64": "^3.7.5",
45
+ "dayjs": "^1.11.13",
46
+ "js-base64": "^3.7.7",
47
47
  "lodash": "^4.17.21",
48
48
  "ordinal": "^1.0.3",
49
49
  "papaparse": "^5.4.1",
50
50
  "string-width": "^6.1.0",
51
51
  "xlsx-js-style": "^1.2.0",
52
- "@xcpcio/types": "0.50.5"
52
+ "@xcpcio/types": "0.51.1"
53
53
  },
54
54
  "devDependencies": {
55
- "@babel/types": "^7.22.4",
56
- "@types/chroma-js": "^2.4.2",
57
- "@types/color-diff": "^1.2.3",
58
- "@types/lodash": "^4.14.195",
55
+ "@babel/types": "^7.25.6",
56
+ "@types/chroma-js": "^2.4.4",
57
+ "@types/color-diff": "^1.2.5",
58
+ "@types/lodash": "^4.17.9",
59
59
  "@types/node": "^17.0.45",
60
60
  "@types/papaparse": "^5.3.14",
61
- "@typescript-eslint/eslint-plugin": "^5.59.9",
62
- "@typescript-eslint/parser": "^5.59.9",
61
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
62
+ "@typescript-eslint/parser": "^5.62.0",
63
63
  "bumpp": "^7.2.0",
64
- "eslint": "^8.42.0",
64
+ "eslint": "^8.57.1",
65
65
  "esmo": "^0.14.1",
66
66
  "npm-run-all": "^4.1.5",
67
- "pnpm": "^7.33.0",
68
- "taze": "^0.10.2",
67
+ "pnpm": "^7.33.7",
68
+ "taze": "^0.10.3",
69
69
  "typescript": "^4.9.5",
70
70
  "unbuild": "^0.7.6",
71
- "vite": "^4.3.9",
72
- "vitest": "^0.32.0"
71
+ "vite": "^4.5.5",
72
+ "vitest": "^0.32.4"
73
73
  },
74
74
  "scripts": {
75
75
  "build": "unbuild",
@@ -6,6 +6,7 @@ export class ContestOptions {
6
6
 
7
7
  submissionHasTimeField: boolean;
8
8
  submissionHasLanguageField: boolean;
9
+ submissionEnableActionField: boolean;
9
10
 
10
11
  constructor() {
11
12
  this.calculationOfPenalty = "in_minutes";
@@ -13,6 +14,7 @@ export class ContestOptions {
13
14
 
14
15
  this.submissionHasTimeField = false;
15
16
  this.submissionHasLanguageField = false;
17
+ this.submissionEnableActionField = false;
16
18
  }
17
19
  }
18
20
 
@@ -28,5 +30,9 @@ export function createContestOptions(contestOptionsJSON: IContestOptions = {}):
28
30
  o.submissionTimestampUnit = j.submission_timestamp_unit;
29
31
  }
30
32
 
33
+ if (j.submission_has_reaction) {
34
+ o.submissionEnableActionField = j.submission_has_reaction;
35
+ }
36
+
31
37
  return o;
32
38
  }
package/src/submission.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Submission as ISubmission, Submissions as ISubmissions, TimeUnit } from "@xcpcio/types";
1
+ import type { Submission as ISubmission, Submissions as ISubmissions, SubmissionReaction, TimeUnit } from "@xcpcio/types";
2
2
  import { SubmissionStatus } from "@xcpcio/types";
3
3
 
4
4
  import {
@@ -19,6 +19,8 @@ export class Submission {
19
19
  time?: number;
20
20
  language?: string;
21
21
 
22
+ reaction?: SubmissionReaction;
23
+
22
24
  status = SubmissionStatus.UNKNOWN;
23
25
  isIgnore = false;
24
26
  isSolved = false;
@@ -150,6 +152,10 @@ export function createSubmission(submissionJSON: ISubmission): Submission {
150
152
  s.language = submissionJSON.language;
151
153
  }
152
154
 
155
+ if (submissionJSON.reaction) {
156
+ s.reaction = submissionJSON.reaction;
157
+ }
158
+
153
159
  return s;
154
160
  }
155
161