tods-competition-factory 1.8.27 → 1.8.28

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.mjs CHANGED
@@ -2404,7 +2404,7 @@ const matchUpFormatCode = {
2404
2404
  };
2405
2405
 
2406
2406
  function factoryVersion() {
2407
- return "1.8.27";
2407
+ return "1.8.28";
2408
2408
  }
2409
2409
 
2410
2410
  function getObjectTieFormat(obj) {
@@ -2631,9 +2631,9 @@ function genderValidityCheck({
2631
2631
  stack
2632
2632
  });
2633
2633
  }
2634
- if (matchUpType === TypeEnum.Singles && referenceGender === MIXED)
2634
+ if (referenceGender === MIXED && (gender !== MIXED || matchUpType === TypeEnum.Singles))
2635
2635
  return decorateResult({
2636
- info: "matchUpType SINGLES is invalid for gender MIXED",
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
- const tournamentId = params.tournamentId || findTournamentId(args);
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, Antoina, Jakov, Kreso, Barry, Jeff, Bobby... to name just a few.
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 || allTournamentMatchUps({ tournamentRecord, participantsProfile }).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 }) => {
@@ -61959,6 +61963,7 @@ var lastNames = [
61959
61963
  "Dallas",
61960
61964
  "Diamond",
61961
61965
  "Deckard",
61966
+ "Drazic",
61962
61967
  "Dunbar",
61963
61968
  "Earhart",
61964
61969
  "Eisenstein",
@@ -62039,7 +62044,7 @@ var firstFemale = [
62039
62044
  "Amelie",
62040
62045
  "America",
62041
62046
  "Anne",
62042
- "Antoina",
62047
+ "Antonia",
62043
62048
  "Aravis",
62044
62049
  "Astrid",
62045
62050
  "Beatrice",