tods-competition-factory 2.2.8 → 2.2.10

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.
@@ -6891,6 +6891,8 @@ type GetParticipantsArgs = {
6891
6891
  scheduleAnalysis?: ScheduleAnalysis;
6892
6892
  policyDefinitions?: PolicyDefinitions;
6893
6893
  withPotentialMatchUps?: boolean;
6894
+ contextFilters?: MatchUpFilters;
6895
+ matchUpFilters?: MatchUpFilters;
6894
6896
  returnParticipantMap?: boolean;
6895
6897
  contextProfile?: ContextProfile;
6896
6898
  tournamentRecord: Tournament;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.2.8';
6
+ return '2.2.10';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -11541,7 +11541,7 @@ function getDrawMatchUps(params) {
11541
11541
 
11542
11542
  function allEventMatchUps(params) {
11543
11543
  let { participants = [], contextContent, participantMap } = params;
11544
- const { scheduleVisibilityFilters, tournamentAppliedPolicies, participantsProfile, afterRecoveryTimes, policyDefinitions, useParticipantMap, tournamentRecord, usePublishState, contextFilters, contextProfile, matchUpFilters, nextMatchUps, inContext, context, event, } = params;
11544
+ const { scheduleVisibilityFilters, tournamentAppliedPolicies, participantsProfile, afterRecoveryTimes, policyDefinitions, useParticipantMap, tournamentRecord, usePublishState, contextFilters, matchUpFilters, contextProfile, nextMatchUps, inContext, context, event, } = params;
11545
11545
  if (!event)
11546
11546
  return { error: MISSING_EVENT };
11547
11547
  const { eventId, eventName, endDate, eventType, category, gender, matchUpFormat } = event ?? {};
@@ -13791,7 +13791,7 @@ function processSides(params) {
13791
13791
  }
13792
13792
 
13793
13793
  function getParticipantEntries(params) {
13794
- const { participantFilters, convertExtensions, policyDefinitions, tournamentRecord, usePublishState, participantMap, contextProfile, withPotentialMatchUps, withRankingProfile, withScheduleItems, scheduleAnalysis, withTeamMatchUps, withStatistics, withOpponents, withMatchUps, withSeeding, withEvents, withDraws, } = params;
13794
+ const { participantFilters, convertExtensions, policyDefinitions, tournamentRecord, usePublishState, contextFilters, matchUpFilters, participantMap, contextProfile, withPotentialMatchUps, withRankingProfile, withScheduleItems, scheduleAnalysis, withTeamMatchUps, withStatistics, withOpponents, withMatchUps, withSeeding, withEvents, withDraws, } = params;
13795
13795
  const targetParticipantIds = participantFilters?.participantIds;
13796
13796
  const getRelevantParticipantIds = (participantId) => {
13797
13797
  const relevantParticipantIds = [participantId];
@@ -14033,8 +14033,10 @@ function getParticipantEntries(params) {
14033
14033
  policyDefinitions,
14034
14034
  tournamentRecord,
14035
14035
  inContext: true,
14036
- contextProfile,
14037
14036
  participantMap,
14037
+ contextFilters,
14038
+ matchUpFilters,
14039
+ contextProfile,
14038
14040
  nextMatchUps,
14039
14041
  event,
14040
14042
  })?.matchUps ?? [];
@@ -14348,7 +14350,7 @@ function getEventEntries({ eventEntryStatuses, tournamentEvents }) {
14348
14350
  }
14349
14351
 
14350
14352
  function getParticipants(params) {
14351
- const { withIndividualParticipants, participantFilters = {}, withPotentialMatchUps, withRankingProfile, convertExtensions, policyDefinitions, withScheduleItems, tournamentRecord, scheduleAnalysis, withSignInStatus, withTeamMatchUps, withScaleValues, usePublishState, contextProfile, withStatistics, withOpponents, withMatchUps, internalUse, withSeeding, withEvents, withDraws, withISO2, withIOC, } = params;
14353
+ const { withIndividualParticipants, participantFilters = {}, withPotentialMatchUps, withRankingProfile, convertExtensions, policyDefinitions, withScheduleItems, tournamentRecord, scheduleAnalysis, withSignInStatus, withTeamMatchUps, withScaleValues, usePublishState, withStatistics, contextFilters, matchUpFilters, contextProfile, withOpponents, withMatchUps, internalUse, withSeeding, withEvents, withDraws, withISO2, withIOC, } = params;
14352
14354
  if (!tournamentRecord)
14353
14355
  return { error: MISSING_TOURNAMENT_RECORD };
14354
14356
  if (withMatchUps || withRankingProfile) {
@@ -14379,6 +14381,8 @@ function getParticipants(params) {
14379
14381
  withTeamMatchUps,
14380
14382
  usePublishState,
14381
14383
  withStatistics,
14384
+ contextFilters,
14385
+ matchUpFilters,
14382
14386
  participantMap,
14383
14387
  withOpponents,
14384
14388
  contextProfile,
@@ -55837,7 +55841,7 @@ function removeCollectionGroup({ updateInProgressMatchUps = true, collectionGrou
55837
55841
 
55838
55842
  function getOrderedTieFormat({ tieFormat, orderMap }) {
55839
55843
  const orderedTieFormat = copyTieFormat(tieFormat);
55840
- orderedTieFormat.collectionDefinitions.forEach((collectionDefinition) => {
55844
+ orderedTieFormat.collectionDefinitions?.forEach((collectionDefinition) => {
55841
55845
  const collectionOrder = orderMap[collectionDefinition.collectionId];
55842
55846
  if (collectionOrder)
55843
55847
  collectionDefinition.collectionOrder = collectionOrder;
@@ -55851,6 +55855,10 @@ function orderCollectionDefinitions({ tournamentRecord, drawDefinition, structur
55851
55855
  result: { error: INVALID_VALUES },
55852
55856
  context: { orderMap },
55853
55857
  });
55858
+ const result = structureId ? findStructure({ drawDefinition, structureId }) : undefined;
55859
+ if (result?.error)
55860
+ return result;
55861
+ const structure = result?.structure;
55854
55862
  if (eventId && event?.tieFormat) {
55855
55863
  updateEventTieFormat({ tournamentRecord, event, orderMap });
55856
55864
  }
@@ -55865,24 +55873,19 @@ function orderCollectionDefinitions({ tournamentRecord, drawDefinition, structur
55865
55873
  matchUp = result.matchUp;
55866
55874
  if (!matchUp)
55867
55875
  return { error: MISSING_MATCHUP };
55868
- if (matchUp?.tieFormat) {
55869
- matchUp.tieFormat = getOrderedTieFormat({
55870
- tieFormat: matchUp.tieFormat,
55871
- orderMap,
55872
- });
55873
- modifyMatchUpNotice({
55874
- tournamentId: tournamentRecord?.tournamentId,
55875
- eventId: event?.eventId,
55876
- drawDefinition,
55877
- matchUp,
55878
- });
55879
- }
55876
+ const tieFormat = getTieFormat$1({ tournamentRecord, matchUpId, structure, drawDefinition, event })?.tieFormat;
55877
+ matchUp.tieFormat = getOrderedTieFormat({
55878
+ tieFormat,
55879
+ orderMap,
55880
+ });
55881
+ modifyMatchUpNotice({
55882
+ tournamentId: tournamentRecord?.tournamentId,
55883
+ eventId: event?.eventId,
55884
+ drawDefinition,
55885
+ matchUp,
55886
+ });
55880
55887
  }
55881
55888
  else if (structureId) {
55882
- const result = findStructure({ drawDefinition, structureId });
55883
- if (result.error)
55884
- return result;
55885
- const structure = result.structure;
55886
55889
  if (structure?.tieFormat) {
55887
55890
  structure.tieFormat = getOrderedTieFormat({
55888
55891
  tieFormat: structure.tieFormat,