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.
@@ -2929,7 +2929,7 @@ var matchUpFormatCode = {
2929
2929
  };
2930
2930
 
2931
2931
  function factoryVersion() {
2932
- return '1.8.36';
2932
+ return '1.8.38';
2933
2933
  }
2934
2934
 
2935
2935
  function getObjectTieFormat(obj) {
@@ -17454,7 +17454,7 @@ function addNationalityCode(_a) {
17454
17454
  function addIndividualParticipants(_a) {
17455
17455
  var e_1, _b, e_2, _c;
17456
17456
  var _d;
17457
- var participantMap = _a.participantMap;
17457
+ var participantMap = _a.participantMap, template = _a.template;
17458
17458
  var participantObjects = Object.values(participantMap);
17459
17459
  try {
17460
17460
  for (var participantObjects_1 = __values(participantObjects), participantObjects_1_1 = participantObjects_1.next(); !participantObjects_1_1.done; participantObjects_1_1 = participantObjects_1.next()) {
@@ -17465,7 +17465,8 @@ function addIndividualParticipants(_a) {
17465
17465
  try {
17466
17466
  for (var _e = (e_2 = void 0, __values(participant.individualParticipantIds)), _f = _e.next(); !_f.done; _f = _e.next()) {
17467
17467
  var participantId = _f.value;
17468
- participant.individualParticipants.push(participantMap[participantId].participant);
17468
+ var source = participantMap[participantId].participant;
17469
+ participant.individualParticipants.push(template ? attributeFilter({ template: template, source: source }) : source);
17469
17470
  }
17470
17471
  }
17471
17472
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -17652,8 +17653,12 @@ function getParticipantMap(_a) {
17652
17653
  }
17653
17654
  finally { if (e_2) throw e_2.error; }
17654
17655
  }
17655
- if (withIndividualParticipants)
17656
- addIndividualParticipants({ participantMap: participantMap });
17656
+ if (withIndividualParticipants) {
17657
+ var template = isObject(withIndividualParticipants)
17658
+ ? withIndividualParticipants
17659
+ : undefined;
17660
+ addIndividualParticipants({ participantMap: participantMap, template: template });
17661
+ }
17657
17662
  return { participantMap: participantMap };
17658
17663
  }
17659
17664
  function signedIn(participant) {
@@ -17719,7 +17724,7 @@ function initializeParticipantId(_a) {
17719
17724
  participantMap[participantId] = {
17720
17725
  structureParticipation: {},
17721
17726
  potentialMatchUps: {},
17722
- scheduleConflicts: [],
17727
+ scheduleConflicts: {},
17723
17728
  scheduleItems: [],
17724
17729
  participant: {
17725
17730
  groupParticipantIds: [],
@@ -29386,12 +29391,17 @@ function getEventSeedAssignments(_a) {
29386
29391
  }
29387
29392
 
29388
29393
  function processEventEntry(_a) {
29389
- var extensionConversions = _a.extensionConversions, seedAssignments = _a.seedAssignments, participant = _a.participant, withSeeding = _a.withSeeding, seedValue = _a.seedValue, eventId = _a.eventId, ranking = _a.ranking, entry = _a.entry;
29394
+ var convertExtensions = _a.convertExtensions, seedAssignments = _a.seedAssignments, participant = _a.participant, withSeeding = _a.withSeeding, seedValue = _a.seedValue, eventId = _a.eventId, ranking = _a.ranking, entry = _a.entry;
29390
29395
  var entryStatus = entry.entryStatus, entryStage = entry.entryStage, entryPosition = entry.entryPosition, extensions = entry.extensions;
29391
- var entryExtensions = (extensions === null || extensions === void 0 ? void 0 : extensions.length)
29396
+ var entryExtensions = (extensions === null || extensions === void 0 ? void 0 : extensions.length) && convertExtensions
29392
29397
  ? Object.assign.apply(Object, __spreadArray([{}], __read(extensionsToAttributes(extensions)), false)) : {};
29393
- var attributes = Object.assign(entryExtensions, __assign(__assign({}, extensionConversions), { // this should be deprecated and clients should use derivedEventInfo
29394
- entryPosition: entryPosition, entryStatus: entryStatus, entryStage: entryStage, ranking: ranking, eventId: eventId }));
29398
+ var attributes = Object.assign(entryExtensions, {
29399
+ entryPosition: entryPosition,
29400
+ entryStatus: entryStatus,
29401
+ entryStage: entryStage,
29402
+ ranking: ranking,
29403
+ eventId: eventId,
29404
+ });
29395
29405
  participant.events[eventId] = definedAttributes(attributes, false, false, true);
29396
29406
  if (withSeeding) {
29397
29407
  if (seedAssignments)
@@ -29744,7 +29754,7 @@ function getParticipantEntries(params) {
29744
29754
  if ((participantFilters === null || participantFilters === void 0 ? void 0 : participantFilters.eventIds) &&
29745
29755
  !participantFilters.eventIds.includes(event_1.eventId))
29746
29756
  return "continue";
29747
- var _p = event_1.drawDefinitions, drawDefinitions = _p === void 0 ? [] : _p, _q = event_1.extensions, extensions = _q === void 0 ? [] : _q, eventType = event_1.eventType, eventName = event_1.eventName, category = event_1.category, entries = event_1.entries, eventId = event_1.eventId, gender = event_1.gender;
29757
+ var _p = event_1.drawDefinitions, drawDefinitions = _p === void 0 ? [] : _p, eventType = event_1.eventType, eventName = event_1.eventName, category = event_1.category, entries = event_1.entries, eventId = event_1.eventId, gender = event_1.gender;
29748
29758
  var flightProfile = getFlightProfile({ event: event_1 }).flightProfile;
29749
29759
  var flights = (_c = flightProfile === null || flightProfile === void 0 ? void 0 : flightProfile.flights) !== null && _c !== void 0 ? _c : [];
29750
29760
  var publishStatuses = getEventPublishStatuses({ event: event_1 });
@@ -29752,15 +29762,19 @@ function getParticipantEntries(params) {
29752
29762
  if (publishStatuses)
29753
29763
  eventsPublishStatuses[eventId] = publishStatuses;
29754
29764
  if (withEvents || withSeeding || withRankingProfile) {
29755
- var extensionConversions_1 = convertExtensions
29756
- ? Object.assign.apply(Object, __spreadArray([{}], __read(extensionsToAttributes(extensions)), false)) : {};
29757
- derivedEventInfo[eventId] = __assign(__assign({}, extensionConversions_1), { eventName: eventName, eventType: eventType, category: category, eventId: eventId, gender: gender });
29765
+ derivedEventInfo[eventId] = {
29766
+ eventName: eventName,
29767
+ eventType: eventType,
29768
+ category: category,
29769
+ eventId: eventId,
29770
+ gender: gender,
29771
+ };
29758
29772
  var scaleNames = [
29759
29773
  category === null || category === void 0 ? void 0 : category.categoryName,
29760
29774
  category === null || category === void 0 ? void 0 : category.ageCategoryCode,
29761
29775
  ].filter(Boolean);
29762
29776
  var _loop_3 = function (entry) {
29763
- var _r;
29777
+ var _q;
29764
29778
  var participantId = entry.participantId;
29765
29779
  if (!participantId || !participantMap[participantId])
29766
29780
  return "continue"; // handle bad data
@@ -29769,13 +29783,13 @@ function getParticipantEntries(params) {
29769
29783
  var seedAssignments, seedValue;
29770
29784
  if (withSeeding) {
29771
29785
  var participant = participantMap[participantId].participant;
29772
- (_r = getEventSeedAssignments({
29786
+ (_q = getEventSeedAssignments({
29773
29787
  publishedSeeding: publishedSeeding,
29774
29788
  usePublishState: usePublishState,
29775
29789
  withSeeding: withSeeding,
29776
29790
  participant: participant,
29777
29791
  event: event_1,
29778
- }), seedAssignments = _r.seedAssignments, seedValue = _r.seedValue);
29792
+ }), seedAssignments = _q.seedAssignments, seedValue = _q.seedValue);
29779
29793
  }
29780
29794
  // IMPORTANT NOTE!
29781
29795
  // id is the pair, team or individual participant currently being processed
@@ -29786,7 +29800,7 @@ function getParticipantEntries(params) {
29786
29800
  return;
29787
29801
  var participant = participantMap[id];
29788
29802
  processEventEntry({
29789
- extensionConversions: extensionConversions_1,
29803
+ convertExtensions: convertExtensions,
29790
29804
  seedAssignments: seedAssignments,
29791
29805
  participant: participant,
29792
29806
  withSeeding: withSeeding,
@@ -29830,11 +29844,11 @@ function getParticipantEntries(params) {
29830
29844
  };
29831
29845
  var drawIds = unique(__spreadArray(__spreadArray([], __read(drawDefinitions.map(extractAttributes('drawId'))), false), __read(flights.map(extractAttributes('drawId'))), false));
29832
29846
  var _loop_4 = function (drawId) {
29833
- var e_6, _s;
29847
+ var e_6, _r;
29834
29848
  var drawDefinition = drawDefinitions.find(function (drawDefinition) { return drawDefinition.drawId === drawId; });
29835
29849
  var flight = flights === null || flights === void 0 ? void 0 : flights.find(function (flight) { return flight.drawId === drawId; });
29836
29850
  var entries_2 = (drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.entries) || (flight === null || flight === void 0 ? void 0 : flight.drawEntries);
29837
- var _t = drawDefinition !== null && drawDefinition !== void 0 ? drawDefinition : {}, _u = _t.structures, structures = _u === void 0 ? [] : _u, drawOrder = _t.drawOrder, drawName = _t.drawName, drawType = _t.drawType;
29851
+ var _s = drawDefinition !== null && drawDefinition !== void 0 ? drawDefinition : {}, _t = _s.structures, structures = _t === void 0 ? [] : _t, drawOrder = _s.drawOrder, drawName = _s.drawName, drawType = _s.drawType;
29838
29852
  var flightNumber = flight === null || flight === void 0 ? void 0 : flight.flightNumber;
29839
29853
  var scaleNames = [
29840
29854
  category === null || category === void 0 ? void 0 : category.categoryName,
@@ -29994,7 +30008,7 @@ function getParticipantEntries(params) {
29994
30008
  catch (e_6_1) { e_6 = { error: e_6_1 }; }
29995
30009
  finally {
29996
30010
  try {
29997
- if (relevantEntries_1_1 && !relevantEntries_1_1.done && (_s = relevantEntries_1.return)) _s.call(relevantEntries_1);
30011
+ if (relevantEntries_1_1 && !relevantEntries_1_1.done && (_r = relevantEntries_1.return)) _r.call(relevantEntries_1);
29998
30012
  }
29999
30013
  finally { if (e_6) throw e_6.error; }
30000
30014
  }
@@ -30048,8 +30062,8 @@ function getParticipantEntries(params) {
30048
30062
  event: event_1,
30049
30063
  })) === null || _g === void 0 ? void 0 : _g.matchUps) !== null && _h !== void 0 ? _h : [];
30050
30064
  var _loop_5 = function (matchUp) {
30051
- var e_7, _v;
30052
- var finishingPositionRange = matchUp.finishingPositionRange, potentialParticipants = matchUp.potentialParticipants, _w = matchUp.tieMatchUps, tieMatchUps = _w === void 0 ? [] : _w, _x = matchUp.sides, sides = _x === void 0 ? [] : _x, winningSide = matchUp.winningSide, matchUpType = matchUp.matchUpType, matchUpId = matchUp.matchUpId, eventId_1 = matchUp.eventId, drawId = matchUp.drawId, collectionId = matchUp.collectionId, stageSequence = matchUp.stageSequence, finishingRound = matchUp.finishingRound, matchUpStatus = matchUp.matchUpStatus, roundPosition = matchUp.roundPosition, roundNumber = matchUp.roundNumber, structureId = matchUp.structureId, schedule = matchUp.schedule, score = matchUp.score, stage = matchUp.stage;
30065
+ var e_7, _u;
30066
+ var finishingPositionRange = matchUp.finishingPositionRange, potentialParticipants = matchUp.potentialParticipants, _v = matchUp.tieMatchUps, tieMatchUps = _v === void 0 ? [] : _v, _w = matchUp.sides, sides = _w === void 0 ? [] : _w, winningSide = matchUp.winningSide, matchUpType = matchUp.matchUpType, matchUpId = matchUp.matchUpId, eventId_1 = matchUp.eventId, drawId = matchUp.drawId, collectionId = matchUp.collectionId, stageSequence = matchUp.stageSequence, finishingRound = matchUp.finishingRound, matchUpStatus = matchUp.matchUpStatus, roundPosition = matchUp.roundPosition, roundNumber = matchUp.roundNumber, structureId = matchUp.structureId, schedule = matchUp.schedule, score = matchUp.score, stage = matchUp.stage;
30053
30067
  mappedMatchUps[matchUpId] = matchUp;
30054
30068
  var baseAttrs = {
30055
30069
  finishingPositionRange: finishingPositionRange,
@@ -30069,14 +30083,14 @@ function getParticipantEntries(params) {
30069
30083
  try {
30070
30084
  for (var tieMatchUps_1 = (e_7 = void 0, __values(tieMatchUps)), tieMatchUps_1_1 = tieMatchUps_1.next(); !tieMatchUps_1_1.done; tieMatchUps_1_1 = tieMatchUps_1.next()) {
30071
30085
  var tieMatchUp = tieMatchUps_1_1.value;
30072
- var tieMatchUpWinningSide = tieMatchUp.winningSide, _y = tieMatchUp.sides, tieMatchUpSides = _y === void 0 ? [] : _y, tieMatchUpId = tieMatchUp.matchUpId, matchUpStatus_1 = tieMatchUp.matchUpStatus, matchUpType_1 = tieMatchUp.matchUpType;
30086
+ var tieMatchUpWinningSide = tieMatchUp.winningSide, _x = tieMatchUp.sides, tieMatchUpSides = _x === void 0 ? [] : _x, tieMatchUpId = tieMatchUp.matchUpId, matchUpStatus_1 = tieMatchUp.matchUpStatus, matchUpType_1 = tieMatchUp.matchUpType;
30073
30087
  processSides(__assign(__assign(__assign({}, baseAttrs), withOpts), { winningSide: tieMatchUpWinningSide, tieWinningSide: winningSide, matchUpTieId: matchUpId, matchUpId: tieMatchUpId, sides: tieMatchUpSides, matchUpSides: sides, matchUpStatus: matchUpStatus_1, matchUpType: matchUpType_1 }));
30074
30088
  }
30075
30089
  }
30076
30090
  catch (e_7_1) { e_7 = { error: e_7_1 }; }
30077
30091
  finally {
30078
30092
  try {
30079
- if (tieMatchUps_1_1 && !tieMatchUps_1_1.done && (_v = tieMatchUps_1.return)) _v.call(tieMatchUps_1);
30093
+ if (tieMatchUps_1_1 && !tieMatchUps_1_1.done && (_u = tieMatchUps_1.return)) _u.call(tieMatchUps_1);
30080
30094
  }
30081
30095
  finally { if (e_7) throw e_7.error; }
30082
30096
  }
@@ -30150,8 +30164,8 @@ function getParticipantEntries(params) {
30150
30164
  if (withStatistics || withRankingProfile || !!scheduleAnalysis) {
30151
30165
  var aggregators = Object.values(participantMap);
30152
30166
  var _loop_2 = function (participantAggregator) {
30153
- var e_8, _z, e_9, _0, e_10, _1;
30154
- var _2 = participantAggregator.counters, wins = _2.wins, losses = _2.losses, _3 = SINGLES$1, _4 = _2[_3], singlesWins = _4.wins, singlesLosses = _4.losses, _5 = DOUBLES$1, _6 = _2[_5], doublesWins = _6.wins, doublesLosses = _6.losses;
30167
+ var e_8, _y, e_9, _z, e_10, _0;
30168
+ var _1 = participantAggregator.counters, wins = _1.wins, losses = _1.losses, _2 = SINGLES$1, _3 = _1[_2], singlesWins = _3.wins, singlesLosses = _3.losses, _4 = DOUBLES$1, _5 = _1[_4], doublesWins = _5.wins, doublesLosses = _5.losses;
30155
30169
  var addStatValue = function (statCode, wins, losses) {
30156
30170
  var denominator = wins + losses;
30157
30171
  var numerator = wins;
@@ -30174,7 +30188,7 @@ function getParticipantEntries(params) {
30174
30188
  return Math.abs(range[0] - range[1]);
30175
30189
  };
30176
30190
  var _loop_7 = function (drawId) {
30177
- var _9 = derivedDrawInfo[drawId] || {}, _10 = _9.orderedStructureIds, orderedStructureIds = _10 === void 0 ? [] : _10, flightNumber = _9.flightNumber;
30191
+ var _8 = derivedDrawInfo[drawId] || {}, _9 = _8.orderedStructureIds, orderedStructureIds = _9 === void 0 ? [] : _9, flightNumber = _8.flightNumber;
30178
30192
  if (participantAggregator.structureParticipation &&
30179
30193
  orderedStructureIds.length) {
30180
30194
  var finishingPositionRange_1;
@@ -30210,15 +30224,15 @@ function getParticipantEntries(params) {
30210
30224
  }
30211
30225
  };
30212
30226
  try {
30213
- for (var _7 = (e_8 = void 0, __values(Object.keys(participantAggregator.draws))), _8 = _7.next(); !_8.done; _8 = _7.next()) {
30214
- var drawId = _8.value;
30227
+ for (var _6 = (e_8 = void 0, __values(Object.keys(participantAggregator.draws))), _7 = _6.next(); !_7.done; _7 = _6.next()) {
30228
+ var drawId = _7.value;
30215
30229
  _loop_7(drawId);
30216
30230
  }
30217
30231
  }
30218
30232
  catch (e_8_1) { e_8 = { error: e_8_1 }; }
30219
30233
  finally {
30220
30234
  try {
30221
- if (_8 && !_8.done && (_z = _7.return)) _z.call(_7);
30235
+ if (_7 && !_7.done && (_y = _6.return)) _y.call(_6);
30222
30236
  }
30223
30237
  finally { if (e_8) throw e_8.error; }
30224
30238
  }
@@ -30276,17 +30290,20 @@ function getParticipantEntries(params) {
30276
30290
  timeStringMinutes(notBeforeTime);
30277
30291
  // if there is a time overlap capture both the prior matchUpId and the conflicted matchUpId
30278
30292
  if (timeOverlap && !(bothPotential && sameDraw) && itemIsPrior) {
30279
- participantAggregator.scheduleConflicts.push({
30293
+ var key = [scheduleItem.matchUpId, consideredItem.matchUpId]
30294
+ .sort()
30295
+ .join('|');
30296
+ participantAggregator.scheduleConflicts[key] = {
30280
30297
  priorScheduledMatchUpId: scheduleItem.matchUpId,
30281
30298
  matchUpIdWithConflict: consideredItem.matchUpId,
30282
- });
30299
+ };
30283
30300
  }
30284
30301
  }
30285
30302
  }
30286
30303
  catch (e_10_1) { e_10 = { error: e_10_1 }; }
30287
30304
  finally {
30288
30305
  try {
30289
- if (scheduleItemsToConsider_1_1 && !scheduleItemsToConsider_1_1.done && (_1 = scheduleItemsToConsider_1.return)) _1.call(scheduleItemsToConsider_1);
30306
+ if (scheduleItemsToConsider_1_1 && !scheduleItemsToConsider_1_1.done && (_0 = scheduleItemsToConsider_1.return)) _0.call(scheduleItemsToConsider_1);
30290
30307
  }
30291
30308
  finally { if (e_10) throw e_10.error; }
30292
30309
  }
@@ -30295,12 +30312,12 @@ function getParticipantEntries(params) {
30295
30312
  catch (e_9_1) { e_9 = { error: e_9_1 }; }
30296
30313
  finally {
30297
30314
  try {
30298
- if (scheduleItems_1_1 && !scheduleItems_1_1.done && (_0 = scheduleItems_1.return)) _0.call(scheduleItems_1);
30315
+ if (scheduleItems_1_1 && !scheduleItems_1_1.done && (_z = scheduleItems_1.return)) _z.call(scheduleItems_1);
30299
30316
  }
30300
30317
  finally { if (e_9) throw e_9.error; }
30301
30318
  }
30302
30319
  var pid = participantAggregator.participant.participantId;
30303
- if (participantAggregator.scheduleConflicts.length) {
30320
+ if (Object.keys(participantAggregator.scheduleConflicts).length) {
30304
30321
  participantIdsWithConflicts.push(pid);
30305
30322
  }
30306
30323
  participantMap[pid].scheduleConflicts =
@@ -30555,7 +30572,9 @@ function getParticipants$1(params) {
30555
30572
  draw.opponents = participantOpponents.filter(function (opponent) { return opponent.drawId === draw.drawId; });
30556
30573
  });
30557
30574
  }
30558
- return definedAttributes(__assign(__assign({}, participant), { scheduleConflicts: scheduleAnalysis ? scheduleConflicts : undefined, draws: withDraws || withRankingProfile ? participantDraws : undefined, events: withEvents || withRankingProfile ? Object.values(events) : undefined, matchUps: withMatchUps || withRankingProfile
30575
+ return definedAttributes(__assign(__assign({}, participant), { scheduleConflicts: scheduleAnalysis
30576
+ ? Object.values(scheduleConflicts)
30577
+ : undefined, draws: withDraws || withRankingProfile ? participantDraws : undefined, events: withEvents || withRankingProfile ? Object.values(events) : undefined, matchUps: withMatchUps || withRankingProfile
30559
30578
  ? Object.values(matchUps)
30560
30579
  : undefined, opponents: withOpponents ? participantOpponents : undefined, potentialMatchUps: nextMatchUps
30561
30580
  ? Object.values(potentialMatchUps)
@@ -30585,6 +30604,9 @@ function getParticipants$1(params) {
30585
30604
  tournamentRecord: tournamentRecord,
30586
30605
  });
30587
30606
  if (withIndividualParticipants) {
30607
+ var template_1 = isObject(withIndividualParticipants)
30608
+ ? withIndividualParticipants
30609
+ : undefined;
30588
30610
  try {
30589
30611
  for (var filteredParticipants_1 = __values(filteredParticipants), filteredParticipants_1_1 = filteredParticipants_1.next(); !filteredParticipants_1_1.done; filteredParticipants_1_1 = filteredParticipants_1.next()) {
30590
30612
  var participant = filteredParticipants_1_1.value;
@@ -30593,7 +30615,8 @@ function getParticipants$1(params) {
30593
30615
  var individualParticipantId = _j.value;
30594
30616
  if (!participant.individualParticipants)
30595
30617
  participant.individualParticipants = [];
30596
- participant.individualParticipants.push(ppMap.get(individualParticipantId));
30618
+ var source = ppMap.get(individualParticipantId);
30619
+ participant.individualParticipants.push(template_1 ? attributeFilter({ template: template_1, source: source }) : source);
30597
30620
  }
30598
30621
  }
30599
30622
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
@@ -67806,6 +67829,7 @@ var lastNames = [
67806
67829
  "Ampleforth",
67807
67830
  "Atreides",
67808
67831
  "Austen",
67832
+ "Bach",
67809
67833
  "Banks",
67810
67834
  "Barrington",
67811
67835
  "Batty",
@@ -67836,6 +67860,7 @@ var lastNames = [
67836
67860
  "Eisenstein",
67837
67861
  "Eldritch",
67838
67862
  "Elliot",
67863
+ "Escher",
67839
67864
  "Eyre",
67840
67865
  "Faulkner",
67841
67866
  "Fukuoka",
@@ -68005,6 +68030,7 @@ var firstMale = [
68005
68030
  "James",
68006
68031
  "Jared",
68007
68032
  "Joe",
68033
+ "Johann",
68008
68034
  "Julian",
68009
68035
  "John Michael",
68010
68036
  "Jonathan",
@@ -68015,6 +68041,7 @@ var firstMale = [
68015
68041
  "Malachi",
68016
68042
  "Mark",
68017
68043
  "Masanobu",
68044
+ "Maurits",
68018
68045
  "Michael",
68019
68046
  "Mustapha",
68020
68047
  "Neil",