tods-competition-factory 1.8.36 → 1.8.38

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.36";
2407
+ return "1.8.38";
2408
2408
  }
2409
2409
 
2410
2410
  function getObjectTieFormat(obj) {
@@ -15787,15 +15787,16 @@ function addNationalityCode({
15787
15787
  persons.forEach(annotatePerson);
15788
15788
  }
15789
15789
 
15790
- function addIndividualParticipants({ participantMap }) {
15790
+ function addIndividualParticipants({ participantMap, template }) {
15791
15791
  const participantObjects = Object.values(participantMap);
15792
15792
  for (const participantObject of participantObjects) {
15793
15793
  const participant = participantObject.participant;
15794
15794
  if (participant.individualParticipantIds?.length) {
15795
15795
  participant.individualParticipants = [];
15796
15796
  for (const participantId of participant.individualParticipantIds) {
15797
+ const source = participantMap[participantId].participant;
15797
15798
  participant.individualParticipants.push(
15798
- participantMap[participantId].participant
15799
+ template ? attributeFilter({ template, source }) : source
15799
15800
  );
15800
15801
  }
15801
15802
  }
@@ -15972,8 +15973,10 @@ function getParticipantMap({
15972
15973
  withIOC
15973
15974
  });
15974
15975
  }
15975
- if (withIndividualParticipants)
15976
- addIndividualParticipants({ participantMap });
15976
+ if (withIndividualParticipants) {
15977
+ const template = isObject(withIndividualParticipants) ? withIndividualParticipants : void 0;
15978
+ addIndividualParticipants({ participantMap, template });
15979
+ }
15977
15980
  return { participantMap };
15978
15981
  }
15979
15982
  function signedIn(participant) {
@@ -16033,7 +16036,7 @@ function initializeParticipantId({ participantMap, participantId }) {
16033
16036
  participantMap[participantId] = {
16034
16037
  structureParticipation: {},
16035
16038
  potentialMatchUps: {},
16036
- scheduleConflicts: [],
16039
+ scheduleConflicts: {},
16037
16040
  scheduleItems: [],
16038
16041
  participant: {
16039
16042
  groupParticipantIds: [],
@@ -27153,7 +27156,7 @@ function getEventSeedAssignments({
27153
27156
  }
27154
27157
 
27155
27158
  function processEventEntry({
27156
- extensionConversions,
27159
+ convertExtensions,
27157
27160
  seedAssignments,
27158
27161
  participant,
27159
27162
  withSeeding,
@@ -27163,10 +27166,8 @@ function processEventEntry({
27163
27166
  entry
27164
27167
  }) {
27165
27168
  const { entryStatus, entryStage, entryPosition, extensions } = entry;
27166
- const entryExtensions = extensions?.length ? Object.assign({}, ...extensionsToAttributes(extensions)) : {};
27169
+ const entryExtensions = extensions?.length && convertExtensions ? Object.assign({}, ...extensionsToAttributes(extensions)) : {};
27167
27170
  const attributes = Object.assign(entryExtensions, {
27168
- ...extensionConversions,
27169
- // this should be deprecated and clients should use derivedEventInfo
27170
27171
  entryPosition,
27171
27172
  entryStatus,
27172
27173
  entryStage,
@@ -27583,7 +27584,6 @@ function getParticipantEntries(params) {
27583
27584
  continue;
27584
27585
  const {
27585
27586
  drawDefinitions = [],
27586
- extensions = [],
27587
27587
  eventType,
27588
27588
  eventName,
27589
27589
  category,
@@ -27598,9 +27598,7 @@ function getParticipantEntries(params) {
27598
27598
  if (publishStatuses)
27599
27599
  eventsPublishStatuses[eventId] = publishStatuses;
27600
27600
  if (withEvents || withSeeding || withRankingProfile) {
27601
- const extensionConversions = convertExtensions ? Object.assign({}, ...extensionsToAttributes(extensions)) : {};
27602
27601
  derivedEventInfo[eventId] = {
27603
- ...extensionConversions,
27604
27602
  eventName,
27605
27603
  eventType,
27606
27604
  category,
@@ -27632,7 +27630,7 @@ function getParticipantEntries(params) {
27632
27630
  return;
27633
27631
  const participant = participantMap[id];
27634
27632
  processEventEntry({
27635
- extensionConversions,
27633
+ convertExtensions,
27636
27634
  seedAssignments,
27637
27635
  participant,
27638
27636
  withSeeding,
@@ -28014,15 +28012,16 @@ function getParticipantEntries(params) {
28014
28012
  const itemIsPrior = consideredMinutes >= scheduledMinutes;
28015
28013
  const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : itemIsPrior && timeStringMinutes(consideredItem.scheduledTime) < timeStringMinutes(notBeforeTime);
28016
28014
  if (timeOverlap && !(bothPotential && sameDraw) && itemIsPrior) {
28017
- participantAggregator.scheduleConflicts.push({
28015
+ const key = [scheduleItem.matchUpId, consideredItem.matchUpId].sort().join("|");
28016
+ participantAggregator.scheduleConflicts[key] = {
28018
28017
  priorScheduledMatchUpId: scheduleItem.matchUpId,
28019
28018
  matchUpIdWithConflict: consideredItem.matchUpId
28020
- });
28019
+ };
28021
28020
  }
28022
28021
  }
28023
28022
  }
28024
28023
  const pid = participantAggregator.participant.participantId;
28025
- if (participantAggregator.scheduleConflicts.length) {
28024
+ if (Object.keys(participantAggregator.scheduleConflicts).length) {
28026
28025
  participantIdsWithConflicts.push(pid);
28027
28026
  }
28028
28027
  participantMap[pid].scheduleConflicts = participantAggregator.scheduleConflicts;
@@ -28250,7 +28249,7 @@ function getParticipants$1(params) {
28250
28249
  return definedAttributes(
28251
28250
  {
28252
28251
  ...participant,
28253
- scheduleConflicts: scheduleAnalysis ? scheduleConflicts : void 0,
28252
+ scheduleConflicts: scheduleAnalysis ? Object.values(scheduleConflicts) : void 0,
28254
28253
  draws: withDraws || withRankingProfile ? participantDraws : void 0,
28255
28254
  events: withEvents || withRankingProfile ? Object.values(events) : void 0,
28256
28255
  matchUps: withMatchUps || withRankingProfile ? Object.values(matchUps2) : void 0,
@@ -28277,12 +28276,14 @@ function getParticipants$1(params) {
28277
28276
  tournamentRecord
28278
28277
  });
28279
28278
  if (withIndividualParticipants) {
28279
+ const template2 = isObject(withIndividualParticipants) ? withIndividualParticipants : void 0;
28280
28280
  for (const participant of filteredParticipants) {
28281
28281
  for (const individualParticipantId of participant.individualParticipantIds ?? []) {
28282
28282
  if (!participant.individualParticipants)
28283
28283
  participant.individualParticipants = [];
28284
+ const source = ppMap.get(individualParticipantId);
28284
28285
  participant.individualParticipants.push(
28285
- ppMap.get(individualParticipantId)
28286
+ template2 ? attributeFilter({ template: template2, source }) : source
28286
28287
  );
28287
28288
  }
28288
28289
  }
@@ -62171,6 +62172,7 @@ var lastNames = [
62171
62172
  "Ampleforth",
62172
62173
  "Atreides",
62173
62174
  "Austen",
62175
+ "Bach",
62174
62176
  "Banks",
62175
62177
  "Barrington",
62176
62178
  "Batty",
@@ -62201,6 +62203,7 @@ var lastNames = [
62201
62203
  "Eisenstein",
62202
62204
  "Eldritch",
62203
62205
  "Elliot",
62206
+ "Escher",
62204
62207
  "Eyre",
62205
62208
  "Faulkner",
62206
62209
  "Fukuoka",
@@ -62370,6 +62373,7 @@ var firstMale = [
62370
62373
  "James",
62371
62374
  "Jared",
62372
62375
  "Joe",
62376
+ "Johann",
62373
62377
  "Julian",
62374
62378
  "John Michael",
62375
62379
  "Jonathan",
@@ -62380,6 +62384,7 @@ var firstMale = [
62380
62384
  "Malachi",
62381
62385
  "Mark",
62382
62386
  "Masanobu",
62387
+ "Maurits",
62383
62388
  "Michael",
62384
62389
  "Mustapha",
62385
62390
  "Neil",