@xcpcio/core 0.76.1 → 0.76.3
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 +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -595,7 +595,7 @@ function createSubmission(submissionJSON, contest) {
|
|
|
595
595
|
}
|
|
596
596
|
if (submissionJSON.reaction) {
|
|
597
597
|
s.reaction = submissionJSON.reaction;
|
|
598
|
-
} else if (contest?.options.reactionVideoUrlTemplate) {
|
|
598
|
+
} else if (contest?.options.reactionVideoUrlTemplate && !submissionJSON.missing_reaction) {
|
|
599
599
|
s.reaction = {
|
|
600
600
|
url: contest.options.reactionVideoUrlTemplate.replace(/\$\{submission_id\}/, s.id)
|
|
601
601
|
};
|
|
@@ -604,10 +604,10 @@ function createSubmission(submissionJSON, contest) {
|
|
|
604
604
|
}
|
|
605
605
|
function createSubmissions(submissionsJSON, contest) {
|
|
606
606
|
if (Array.isArray(submissionsJSON)) {
|
|
607
|
-
return submissionsJSON.map((s, index) => createSubmission({ ...s, id: s.submission_id ?? String(index) }, contest));
|
|
607
|
+
return submissionsJSON.map((s, index) => createSubmission({ ...s, id: s.id ?? s.submission_id ?? String(index) }, contest));
|
|
608
608
|
} else {
|
|
609
609
|
const submissions = Object.entries(submissionsJSON).map(
|
|
610
|
-
([submissionId, s]) => createSubmission({ ...s, id: s.submission_id ?? submissionId }, contest)
|
|
610
|
+
([submissionId, s]) => createSubmission({ ...s, id: s.id ?? s.submission_id ?? String(submissionId) }, contest)
|
|
611
611
|
);
|
|
612
612
|
return submissions;
|
|
613
613
|
}
|
|
@@ -903,7 +903,7 @@ function createTeams(teamsJSON) {
|
|
|
903
903
|
return teamsJSON.map((t) => createTeam(t));
|
|
904
904
|
} else {
|
|
905
905
|
const teams = Object.entries(teamsJSON).map(
|
|
906
|
-
([teamId, team]) => createTeam({ ...team,
|
|
906
|
+
([teamId, team]) => createTeam({ ...team, id: team.id ?? team.team_id ?? String(teamId) })
|
|
907
907
|
);
|
|
908
908
|
return teams;
|
|
909
909
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -564,7 +564,7 @@ function createSubmission(submissionJSON, contest) {
|
|
|
564
564
|
}
|
|
565
565
|
if (submissionJSON.reaction) {
|
|
566
566
|
s.reaction = submissionJSON.reaction;
|
|
567
|
-
} else if (contest?.options.reactionVideoUrlTemplate) {
|
|
567
|
+
} else if (contest?.options.reactionVideoUrlTemplate && !submissionJSON.missing_reaction) {
|
|
568
568
|
s.reaction = {
|
|
569
569
|
url: contest.options.reactionVideoUrlTemplate.replace(/\$\{submission_id\}/, s.id)
|
|
570
570
|
};
|
|
@@ -573,10 +573,10 @@ function createSubmission(submissionJSON, contest) {
|
|
|
573
573
|
}
|
|
574
574
|
function createSubmissions(submissionsJSON, contest) {
|
|
575
575
|
if (Array.isArray(submissionsJSON)) {
|
|
576
|
-
return submissionsJSON.map((s, index) => createSubmission({ ...s, id: s.submission_id ?? String(index) }, contest));
|
|
576
|
+
return submissionsJSON.map((s, index) => createSubmission({ ...s, id: s.id ?? s.submission_id ?? String(index) }, contest));
|
|
577
577
|
} else {
|
|
578
578
|
const submissions = Object.entries(submissionsJSON).map(
|
|
579
|
-
([submissionId, s]) => createSubmission({ ...s, id: s.submission_id ?? submissionId }, contest)
|
|
579
|
+
([submissionId, s]) => createSubmission({ ...s, id: s.id ?? s.submission_id ?? String(submissionId) }, contest)
|
|
580
580
|
);
|
|
581
581
|
return submissions;
|
|
582
582
|
}
|
|
@@ -872,7 +872,7 @@ function createTeams(teamsJSON) {
|
|
|
872
872
|
return teamsJSON.map((t) => createTeam(t));
|
|
873
873
|
} else {
|
|
874
874
|
const teams = Object.entries(teamsJSON).map(
|
|
875
|
-
([teamId, team]) => createTeam({ ...team,
|
|
875
|
+
([teamId, team]) => createTeam({ ...team, id: team.id ?? team.team_id ?? String(teamId) })
|
|
876
876
|
);
|
|
877
877
|
return teams;
|
|
878
878
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.76.
|
|
4
|
+
"version": "0.76.3",
|
|
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.76.
|
|
45
|
+
"@xcpcio/types": "0.76.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/types": "^7.28.5",
|