@xcpcio/core 0.79.0 → 0.79.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
@@ -1053,6 +1053,7 @@ class BattleOfGiants {
1053
1053
  }
1054
1054
 
1055
1055
  class ContestOptions {
1056
+ enableOrganization;
1056
1057
  calculationOfPenalty;
1057
1058
  submissionTimestampUnit;
1058
1059
  submissionHasTimeField;
@@ -1066,6 +1067,7 @@ class ContestOptions {
1066
1067
  teamWebcamStreamUrlTemplate;
1067
1068
  teamScreenStreamUrlTemplate;
1068
1069
  constructor() {
1070
+ this.enableOrganization = false;
1069
1071
  this.calculationOfPenalty = "in_minutes";
1070
1072
  this.submissionTimestampUnit = "second";
1071
1073
  this.submissionHasTimeField = false;
@@ -1078,6 +1080,7 @@ class ContestOptions {
1078
1080
  function createContestOptions(contestOptionsJSON = {}) {
1079
1081
  const j = contestOptionsJSON;
1080
1082
  const o = new ContestOptions();
1083
+ o.enableOrganization = !!j.enable_organization;
1081
1084
  if (j.calculation_of_penalty) {
1082
1085
  o.calculationOfPenalty = j.calculation_of_penalty;
1083
1086
  }
@@ -1164,7 +1167,6 @@ class Contest {
1164
1167
  problems;
1165
1168
  problemsMap;
1166
1169
  statusTimeDisplay;
1167
- badge;
1168
1170
  organization;
1169
1171
  medal;
1170
1172
  awards;
@@ -1327,7 +1329,6 @@ function createContest(contestJSON) {
1327
1329
  pending: Boolean(contestJSON.status_time_display.pending ?? false)
1328
1330
  };
1329
1331
  }
1330
- c.badge = contestJSON.badge;
1331
1332
  c.organization = contestJSON.organization;
1332
1333
  c.medal = contestJSON.medal;
1333
1334
  (() => {
@@ -1400,6 +1401,9 @@ function createContest(contestJSON) {
1400
1401
  if (contestJSON.options) {
1401
1402
  c.options = createContestOptions(contestJSON.options);
1402
1403
  }
1404
+ if (c.organization) {
1405
+ c.options.enableOrganization = true;
1406
+ }
1403
1407
  if (contestJSON.organizations) {
1404
1408
  c.organizations = createOrganizations(contestJSON.organizations);
1405
1409
  }
@@ -1680,9 +1684,9 @@ class GeneralExcelConverter {
1680
1684
  {
1681
1685
  const head = [];
1682
1686
  head.push("Rank");
1683
- if (rank.contest.organization) {
1684
- head.push(`${rank.contest.organization} Rank`);
1685
- head.push(rank.contest.organization);
1687
+ if (rank.contest.options.enableOrganization) {
1688
+ head.push("Organization Rank");
1689
+ head.push("Organization");
1686
1690
  }
1687
1691
  head.push("Team", "Solved", "Penalty", ...rank.contest.problems.map((p) => p.label), "Dirt");
1688
1692
  if (enableAwards) {
@@ -2023,7 +2027,7 @@ class Rank {
2023
2027
  });
2024
2028
  }
2025
2029
  buildOrganizationsMap() {
2026
- if (!this.contest.organization) {
2030
+ if (!this.contest.options.enableOrganization) {
2027
2031
  return /* @__PURE__ */ new Map();
2028
2032
  }
2029
2033
  const res = /* @__PURE__ */ new Map();
@@ -2209,7 +2213,7 @@ class Rank {
2209
2213
  }
2210
2214
  }
2211
2215
  buildOrgRank() {
2212
- if (!this.contest.organization) {
2216
+ if (!this.contest.options.enableOrganization) {
2213
2217
  return;
2214
2218
  }
2215
2219
  let rank = 1;
package/dist/index.d.cts CHANGED
@@ -20,6 +20,7 @@ declare function isValidMedalType(medal: MedalType): boolean;
20
20
  type Awards = Map<string, Award[]>;
21
21
 
22
22
  declare class ContestOptions {
23
+ enableOrganization: boolean;
23
24
  calculationOfPenalty: CalculationOfPenalty;
24
25
  submissionTimestampUnit: TimeUnit;
25
26
  submissionHasTimeField: boolean;
@@ -171,7 +172,6 @@ declare class Contest {
171
172
  problems: Problems;
172
173
  problemsMap: Map<string, Problem>;
173
174
  statusTimeDisplay: StatusTimeDisplay;
174
- badge?: string;
175
175
  organization?: string;
176
176
  medal?: Record<string, Record<string, number>> | MedalPreset;
177
177
  awards?: Awards;
package/dist/index.d.mts CHANGED
@@ -20,6 +20,7 @@ declare function isValidMedalType(medal: MedalType): boolean;
20
20
  type Awards = Map<string, Award[]>;
21
21
 
22
22
  declare class ContestOptions {
23
+ enableOrganization: boolean;
23
24
  calculationOfPenalty: CalculationOfPenalty;
24
25
  submissionTimestampUnit: TimeUnit;
25
26
  submissionHasTimeField: boolean;
@@ -171,7 +172,6 @@ declare class Contest {
171
172
  problems: Problems;
172
173
  problemsMap: Map<string, Problem>;
173
174
  statusTimeDisplay: StatusTimeDisplay;
174
- badge?: string;
175
175
  organization?: string;
176
176
  medal?: Record<string, Record<string, number>> | MedalPreset;
177
177
  awards?: Awards;
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ declare function isValidMedalType(medal: MedalType): boolean;
20
20
  type Awards = Map<string, Award[]>;
21
21
 
22
22
  declare class ContestOptions {
23
+ enableOrganization: boolean;
23
24
  calculationOfPenalty: CalculationOfPenalty;
24
25
  submissionTimestampUnit: TimeUnit;
25
26
  submissionHasTimeField: boolean;
@@ -171,7 +172,6 @@ declare class Contest {
171
172
  problems: Problems;
172
173
  problemsMap: Map<string, Problem>;
173
174
  statusTimeDisplay: StatusTimeDisplay;
174
- badge?: string;
175
175
  organization?: string;
176
176
  medal?: Record<string, Record<string, number>> | MedalPreset;
177
177
  awards?: Awards;
package/dist/index.mjs CHANGED
@@ -1022,6 +1022,7 @@ class BattleOfGiants {
1022
1022
  }
1023
1023
 
1024
1024
  class ContestOptions {
1025
+ enableOrganization;
1025
1026
  calculationOfPenalty;
1026
1027
  submissionTimestampUnit;
1027
1028
  submissionHasTimeField;
@@ -1035,6 +1036,7 @@ class ContestOptions {
1035
1036
  teamWebcamStreamUrlTemplate;
1036
1037
  teamScreenStreamUrlTemplate;
1037
1038
  constructor() {
1039
+ this.enableOrganization = false;
1038
1040
  this.calculationOfPenalty = "in_minutes";
1039
1041
  this.submissionTimestampUnit = "second";
1040
1042
  this.submissionHasTimeField = false;
@@ -1047,6 +1049,7 @@ class ContestOptions {
1047
1049
  function createContestOptions(contestOptionsJSON = {}) {
1048
1050
  const j = contestOptionsJSON;
1049
1051
  const o = new ContestOptions();
1052
+ o.enableOrganization = !!j.enable_organization;
1050
1053
  if (j.calculation_of_penalty) {
1051
1054
  o.calculationOfPenalty = j.calculation_of_penalty;
1052
1055
  }
@@ -1133,7 +1136,6 @@ class Contest {
1133
1136
  problems;
1134
1137
  problemsMap;
1135
1138
  statusTimeDisplay;
1136
- badge;
1137
1139
  organization;
1138
1140
  medal;
1139
1141
  awards;
@@ -1296,7 +1298,6 @@ function createContest(contestJSON) {
1296
1298
  pending: Boolean(contestJSON.status_time_display.pending ?? false)
1297
1299
  };
1298
1300
  }
1299
- c.badge = contestJSON.badge;
1300
1301
  c.organization = contestJSON.organization;
1301
1302
  c.medal = contestJSON.medal;
1302
1303
  (() => {
@@ -1369,6 +1370,9 @@ function createContest(contestJSON) {
1369
1370
  if (contestJSON.options) {
1370
1371
  c.options = createContestOptions(contestJSON.options);
1371
1372
  }
1373
+ if (c.organization) {
1374
+ c.options.enableOrganization = true;
1375
+ }
1372
1376
  if (contestJSON.organizations) {
1373
1377
  c.organizations = createOrganizations(contestJSON.organizations);
1374
1378
  }
@@ -1649,9 +1653,9 @@ class GeneralExcelConverter {
1649
1653
  {
1650
1654
  const head = [];
1651
1655
  head.push("Rank");
1652
- if (rank.contest.organization) {
1653
- head.push(`${rank.contest.organization} Rank`);
1654
- head.push(rank.contest.organization);
1656
+ if (rank.contest.options.enableOrganization) {
1657
+ head.push("Organization Rank");
1658
+ head.push("Organization");
1655
1659
  }
1656
1660
  head.push("Team", "Solved", "Penalty", ...rank.contest.problems.map((p) => p.label), "Dirt");
1657
1661
  if (enableAwards) {
@@ -1992,7 +1996,7 @@ class Rank {
1992
1996
  });
1993
1997
  }
1994
1998
  buildOrganizationsMap() {
1995
- if (!this.contest.organization) {
1999
+ if (!this.contest.options.enableOrganization) {
1996
2000
  return /* @__PURE__ */ new Map();
1997
2001
  }
1998
2002
  const res = /* @__PURE__ */ new Map();
@@ -2178,7 +2182,7 @@ class Rank {
2178
2182
  }
2179
2183
  }
2180
2184
  buildOrgRank() {
2181
- if (!this.contest.organization) {
2185
+ if (!this.contest.options.enableOrganization) {
2182
2186
  return;
2183
2187
  }
2184
2188
  let rank = 1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
3
  "type": "module",
4
- "version": "0.79.0",
4
+ "version": "0.79.1",
5
5
  "description": "The core library for XCPCIO",
6
6
  "author": "Dup4 <hi@dup4.com>",
7
7
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "papaparse": "^5.5.3",
43
43
  "string-width": "^8.1.0",
44
44
  "xlsx-js-style": "^1.2.0",
45
- "@xcpcio/types": "0.79.0"
45
+ "@xcpcio/types": "0.79.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@babel/types": "^7.28.6",