tods-competition-factory 1.8.27 → 1.8.29
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/forge/generate.mjs +2 -2
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +2 -1
- package/dist/forge/query.mjs +3 -2
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +2 -2
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +23 -17
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +116 -111
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -2404,7 +2404,7 @@ const matchUpFormatCode = {
|
|
|
2404
2404
|
};
|
|
2405
2405
|
|
|
2406
2406
|
function factoryVersion() {
|
|
2407
|
-
return "1.8.
|
|
2407
|
+
return "1.8.29";
|
|
2408
2408
|
}
|
|
2409
2409
|
|
|
2410
2410
|
function getObjectTieFormat(obj) {
|
|
@@ -2631,9 +2631,9 @@ function genderValidityCheck({
|
|
|
2631
2631
|
stack
|
|
2632
2632
|
});
|
|
2633
2633
|
}
|
|
2634
|
-
if (
|
|
2634
|
+
if (referenceGender === MIXED && (gender !== MIXED || matchUpType === TypeEnum.Singles))
|
|
2635
2635
|
return decorateResult({
|
|
2636
|
-
info: "
|
|
2636
|
+
info: "MIXED events can only contain MIXED doubles collections",
|
|
2637
2637
|
result: { error: INVALID_GENDER, valid: false },
|
|
2638
2638
|
stack
|
|
2639
2639
|
});
|
|
@@ -29183,12 +29183,12 @@ function modifyCollectionDefinition$1({
|
|
|
29183
29183
|
|
|
29184
29184
|
function resolveTournamentRecord(params) {
|
|
29185
29185
|
const { method, tournamentRecords, ...args } = params;
|
|
29186
|
-
|
|
29186
|
+
if (!method)
|
|
29187
|
+
return { error: MISSING_VALUE };
|
|
29188
|
+
const tournamentId = params.tournamentId || findTournamentId({ tournamentRecords, ...args });
|
|
29187
29189
|
if (typeof tournamentId !== "string")
|
|
29188
29190
|
return { error: MISSING_TOURNAMENT_ID };
|
|
29189
29191
|
const tournamentRecord = tournamentRecords[tournamentId];
|
|
29190
|
-
if (!tournamentRecord)
|
|
29191
|
-
return { error: MISSING_TOURNAMENT_RECORD };
|
|
29192
29192
|
return method({ ...args, tournamentRecord });
|
|
29193
29193
|
}
|
|
29194
29194
|
|
|
@@ -30308,6 +30308,7 @@ function findMatchUp({
|
|
|
30308
30308
|
contextContent,
|
|
30309
30309
|
contextProfile,
|
|
30310
30310
|
drawDefinition,
|
|
30311
|
+
nextMatchUps,
|
|
30311
30312
|
matchUpId,
|
|
30312
30313
|
inContext,
|
|
30313
30314
|
eventId,
|
|
@@ -30318,8 +30319,8 @@ function findMatchUp({
|
|
|
30318
30319
|
return { error: MISSING_TOURNAMENT_RECORD };
|
|
30319
30320
|
if (typeof matchUpId !== "string")
|
|
30320
30321
|
return { error: MISSING_MATCHUP_ID };
|
|
30321
|
-
if (!drawDefinition || !event) {
|
|
30322
|
-
const matchUps = allTournamentMatchUps({ tournamentRecord }).matchUps ?? [];
|
|
30322
|
+
if (!drawDefinition || !event || nextMatchUps) {
|
|
30323
|
+
const matchUps = allTournamentMatchUps({ tournamentRecord, nextMatchUps }).matchUps ?? [];
|
|
30323
30324
|
const inContextMatchUp = matchUps.find(
|
|
30324
30325
|
(matchUp2) => matchUp2.matchUpId === matchUpId
|
|
30325
30326
|
);
|
|
@@ -36150,7 +36151,7 @@ function credits() {
|
|
|
36150
36151
|
This project would not have been possible without the generous input and patience
|
|
36151
36152
|
of tournament organizers and directors who worked with early versions of CourtHive/TMX.
|
|
36152
36153
|
|
|
36153
|
-
Thanks to Pavel, Ivan, Mladen, Zdenko,
|
|
36154
|
+
Thanks to Pavel, Ivan, Mladen, Zdenko, Antonia, Jakov, Kreso, Barry, Jeff, Bobby... to name just a few.
|
|
36154
36155
|
|
|
36155
36156
|
The project would not have even begun without the support of Miro, or the introduction by Sretchko.
|
|
36156
36157
|
The project would not have succeeded without the enthusiasm of Randy and Bruce.
|
|
@@ -54949,7 +54950,7 @@ function getParticipantStats({
|
|
|
54949
54950
|
if (matchUps && !Array.isArray(matchUps))
|
|
54950
54951
|
return { error: INVALID_MATCHUP };
|
|
54951
54952
|
const participantsProfile = withScaleValues ? { withScaleValues } : void 0;
|
|
54952
|
-
matchUps = matchUps
|
|
54953
|
+
matchUps = matchUps ?? allTournamentMatchUps({ tournamentRecord, participantsProfile }).matchUps;
|
|
54953
54954
|
if (!matchUps?.length)
|
|
54954
54955
|
return { error: MISSING_MATCHUPS };
|
|
54955
54956
|
const teamParticipantIds = [];
|
|
@@ -55007,6 +55008,9 @@ function getParticipantStats({
|
|
|
55007
55008
|
participantName: participant.participantName,
|
|
55008
55009
|
ratings: participant.ratings
|
|
55009
55010
|
});
|
|
55011
|
+
const stats = participantStats.get(participant.participantId);
|
|
55012
|
+
if (stats)
|
|
55013
|
+
stats.participantName = participant.participantName;
|
|
55010
55014
|
}
|
|
55011
55015
|
}
|
|
55012
55016
|
const getCompetitorIds = ({ side, individualParticipantIds }) => {
|
|
@@ -55044,16 +55048,17 @@ function getParticipantStats({
|
|
|
55044
55048
|
};
|
|
55045
55049
|
if (teamParticipantId) {
|
|
55046
55050
|
const processForTeam = !opponentParticipantId || sides.every((side) => {
|
|
55047
|
-
side.participant && (getCompetitorIds({
|
|
55048
|
-
|
|
55049
|
-
|
|
55051
|
+
return side.participant && (getCompetitorIds({
|
|
55052
|
+
individualParticipantIds: teamMap.get(teamParticipantId),
|
|
55053
|
+
side
|
|
55050
55054
|
}) || getCompetitorIds({
|
|
55051
|
-
|
|
55052
|
-
|
|
55055
|
+
individualParticipantIds: teamMap.get(opponentParticipantId),
|
|
55056
|
+
side
|
|
55053
55057
|
}));
|
|
55054
55058
|
});
|
|
55055
|
-
if (processForTeam)
|
|
55059
|
+
if (processForTeam) {
|
|
55056
55060
|
processSides(teamParticipantId, teamMap.get(teamParticipantId));
|
|
55061
|
+
}
|
|
55057
55062
|
} else {
|
|
55058
55063
|
for (const [thisTeamId, individualParticipantIds] of teamMap) {
|
|
55059
55064
|
processSides(thisTeamId, individualParticipantIds);
|
|
@@ -61959,6 +61964,7 @@ var lastNames = [
|
|
|
61959
61964
|
"Dallas",
|
|
61960
61965
|
"Diamond",
|
|
61961
61966
|
"Deckard",
|
|
61967
|
+
"Drazic",
|
|
61962
61968
|
"Dunbar",
|
|
61963
61969
|
"Earhart",
|
|
61964
61970
|
"Eisenstein",
|
|
@@ -62039,7 +62045,7 @@ var firstFemale = [
|
|
|
62039
62045
|
"Amelie",
|
|
62040
62046
|
"America",
|
|
62041
62047
|
"Anne",
|
|
62042
|
-
"
|
|
62048
|
+
"Antonia",
|
|
62043
62049
|
"Aravis",
|
|
62044
62050
|
"Astrid",
|
|
62045
62051
|
"Beatrice",
|