tods-competition-factory 1.8.12 → 1.8.14
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 +8 -8
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +21 -13
- package/dist/forge/query.mjs +28 -23
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +42 -27
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/forge/utilities.mjs +4 -4
- package/dist/forge/utilities.mjs.map +1 -1
- package/dist/index.mjs +318 -162
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +582 -314
- 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 +4 -4
package/dist/forge/query.d.ts
CHANGED
|
@@ -1650,6 +1650,26 @@ type ParsedFormat = {
|
|
|
1650
1650
|
};
|
|
1651
1651
|
declare function parse(matchUpFormatCode: string): ParsedFormat | undefined;
|
|
1652
1652
|
|
|
1653
|
+
type ResultType = {
|
|
1654
|
+
context?: {
|
|
1655
|
+
[key: string]: any;
|
|
1656
|
+
};
|
|
1657
|
+
stack?: string | string[];
|
|
1658
|
+
error?: ErrorType;
|
|
1659
|
+
errors?: string[];
|
|
1660
|
+
success?: boolean;
|
|
1661
|
+
valid?: boolean;
|
|
1662
|
+
info?: any;
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
type GetAssignedParticipantIdsArgs = {
|
|
1666
|
+
drawDefinition: DrawDefinition;
|
|
1667
|
+
stages?: StageTypeEnum[];
|
|
1668
|
+
};
|
|
1669
|
+
declare function getAssignedParticipantIds({ drawDefinition, stages, }: GetAssignedParticipantIdsArgs): ResultType & {
|
|
1670
|
+
assignedParticipantIds?: string[];
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1653
1673
|
type GetPolicyDefinitionsArgs = {
|
|
1654
1674
|
tournamentRecord?: Tournament;
|
|
1655
1675
|
drawDefinition?: DrawDefinition;
|
|
@@ -1663,18 +1683,6 @@ declare function getPolicyDefinitions({ policyTypes, tournamentRecord, drawDefin
|
|
|
1663
1683
|
info?: string;
|
|
1664
1684
|
};
|
|
1665
1685
|
|
|
1666
|
-
type ResultType = {
|
|
1667
|
-
context?: {
|
|
1668
|
-
[key: string]: any;
|
|
1669
|
-
};
|
|
1670
|
-
stack?: string | string[];
|
|
1671
|
-
error?: ErrorType;
|
|
1672
|
-
errors?: string[];
|
|
1673
|
-
success?: boolean;
|
|
1674
|
-
valid?: boolean;
|
|
1675
|
-
info?: any;
|
|
1676
|
-
};
|
|
1677
|
-
|
|
1678
1686
|
type TimeItemResult = {
|
|
1679
1687
|
timeItem?: TimeItem;
|
|
1680
1688
|
previousItems?: any;
|
|
@@ -2217,4 +2225,4 @@ declare function tournamentMatchUps(params: GetMatchUpsArgs): GroupsMatchUpsResu
|
|
|
2217
2225
|
declare function eventMatchUps(params: GetMatchUpsArgs): GroupsMatchUpsResult;
|
|
2218
2226
|
declare function drawMatchUps({ participants: tournamentParticipants, tournamentAppliedPolicies, scheduleVisibilityFilters, participantsProfile, afterRecoveryTimes, policyDefinitions, useParticipantMap, tournamentRecord, contextFilters, contextProfile, contextContent, drawDefinition, matchUpFilters, participantMap, nextMatchUps, tournamentId, inContext, context, event, }: GetMatchUpsArgs): GroupsMatchUpsResult;
|
|
2219
2227
|
|
|
2220
|
-
export { allCompetitionMatchUps, allDrawMatchUps, allEventMatchUps, allTournamentMatchUps, matchUpActions$1 as competitionMatchUpActions, competitionMatchUps, competitionScheduleMatchUps, drawMatchUps, eventMatchUps, filterParticipants, findExtension, findMatchUp, publicFindParticipant as findParticipant, generateSeedingScaleItems, getCompetitionDateRange, getCompetitionParticipants, getCompetitionVenues, getVenuesAndCourts$1 as getCompetitionVenuesAndCourts, getEligibleVoluntaryConsolationParticipants, getEntriesAndSeedsCount, getEventData, getEventMatchUpFormatTiming, getFlightProfile, getMatchUpDailyLimits, getMatchUpDailyLimitsUpdate, getMatchUpFormatTimingUpdate, getOrderedDrawPositions, getParticipantEventDetails, getParticipantScaleItem, getPolicyDefinitions, getPositionAssignments, getProfileRounds, getRoundContextProfile, getRoundMatchUps, getRounds, getSeedsCount, getTimeItem, getVenuesAndCourts as getTournamentVenuesAndCourts, getValidGroupSizes, isValid as isValidMatchUpFormat, parse as parseMatchUpFormat, parseScoreString, participantScaleItem, positionActions, matchUpActions as tournamentMatchUpActions, tournamentMatchUps, validateScore };
|
|
2228
|
+
export { allCompetitionMatchUps, allDrawMatchUps, allEventMatchUps, allTournamentMatchUps, matchUpActions$1 as competitionMatchUpActions, competitionMatchUps, competitionScheduleMatchUps, drawMatchUps, eventMatchUps, filterParticipants, findExtension, findMatchUp, publicFindParticipant as findParticipant, generateSeedingScaleItems, getAssignedParticipantIds, getCompetitionDateRange, getCompetitionParticipants, getCompetitionVenues, getVenuesAndCourts$1 as getCompetitionVenuesAndCourts, getEligibleVoluntaryConsolationParticipants, getEntriesAndSeedsCount, getEventData, getEventMatchUpFormatTiming, getFlightProfile, getMatchUpDailyLimits, getMatchUpDailyLimitsUpdate, getMatchUpFormatTimingUpdate, getOrderedDrawPositions, getParticipantEventDetails, getParticipantScaleItem, getPolicyDefinitions, getPositionAssignments, getProfileRounds, getRoundContextProfile, getRoundMatchUps, getRounds, getSeedsCount, getTimeItem, getVenuesAndCourts as getTournamentVenuesAndCourts, getValidGroupSizes, isValid as isValidMatchUpFormat, parse as parseMatchUpFormat, parseScoreString, participantScaleItem, positionActions, matchUpActions as tournamentMatchUpActions, tournamentMatchUps, validateScore };
|
package/dist/forge/query.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function numericSort(a, b) {
|
|
2
|
+
return a - b;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
function ensureInt(val) {
|
|
2
6
|
if (typeof val === "number")
|
|
3
7
|
return parseInt(val.toString());
|
|
@@ -817,10 +821,6 @@ function attributeFilter(params) {
|
|
|
817
821
|
}
|
|
818
822
|
}
|
|
819
823
|
|
|
820
|
-
function numericSort(a, b) {
|
|
821
|
-
return a - b;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
824
|
function UUID() {
|
|
825
825
|
const lut = [];
|
|
826
826
|
for (let i = 0; i < 256; i++) {
|
|
@@ -8372,6 +8372,26 @@ function isValid(matchUpFormat) {
|
|
|
8372
8372
|
return stringified === matchUpFormat;
|
|
8373
8373
|
}
|
|
8374
8374
|
|
|
8375
|
+
function getAssignedParticipantIds({
|
|
8376
|
+
drawDefinition,
|
|
8377
|
+
stages
|
|
8378
|
+
}) {
|
|
8379
|
+
if (!drawDefinition)
|
|
8380
|
+
return { error: MISSING_DRAW_DEFINITION };
|
|
8381
|
+
const stageStructures = (drawDefinition?.structures || []).filter(
|
|
8382
|
+
(structure) => !stages?.length || structure.stage && stages.includes(structure.stage)
|
|
8383
|
+
);
|
|
8384
|
+
const assignedParticipantIds = unique(
|
|
8385
|
+
stageStructures.map((structure) => {
|
|
8386
|
+
const { positionAssignments } = getPositionAssignments({
|
|
8387
|
+
structure
|
|
8388
|
+
});
|
|
8389
|
+
return positionAssignments ? positionAssignments.map(extractAttributes("participantId")) : [];
|
|
8390
|
+
}).flat().filter(Boolean)
|
|
8391
|
+
);
|
|
8392
|
+
return { ...SUCCESS, assignedParticipantIds };
|
|
8393
|
+
}
|
|
8394
|
+
|
|
8375
8395
|
function findMatchUp$1({
|
|
8376
8396
|
tournamentParticipants,
|
|
8377
8397
|
afterRecoveryTimes,
|
|
@@ -11568,7 +11588,7 @@ function getMatchUpDependencies(params) {
|
|
|
11568
11588
|
const allTournamentRecords = Object.values(tournamentRecords);
|
|
11569
11589
|
const allLinks = allTournamentRecords.reduce(
|
|
11570
11590
|
(allLinks2, tournamentRecord2) => {
|
|
11571
|
-
return allLinks2.concat(tournamentRecord2.events
|
|
11591
|
+
return allLinks2.concat(tournamentRecord2.events ?? []).map(
|
|
11572
11592
|
(event) => (event.drawDefinitions || []).map(
|
|
11573
11593
|
(drawDefinition2) => drawDefinition2.links || []
|
|
11574
11594
|
)
|
|
@@ -11600,7 +11620,7 @@ function getMatchUpDependencies(params) {
|
|
|
11600
11620
|
for (const sourceStructureId of sourceStructureIds) {
|
|
11601
11621
|
positionDependencies[sourceStructureId] = [];
|
|
11602
11622
|
}
|
|
11603
|
-
for (const matchUp of matchUps
|
|
11623
|
+
for (const matchUp of matchUps ?? []) {
|
|
11604
11624
|
const sourceStructureId = matchUp.containerStructureId || matchUp.structureId;
|
|
11605
11625
|
if (sourceStructureIds.includes(sourceStructureId)) {
|
|
11606
11626
|
positionDependencies[sourceStructureId].push(matchUp.matchUpId);
|
|
@@ -13132,21 +13152,6 @@ function getStructureDrawPositionProfiles(params) {
|
|
|
13132
13152
|
};
|
|
13133
13153
|
}
|
|
13134
13154
|
|
|
13135
|
-
function getAssignedParticipantIds({
|
|
13136
|
-
drawDefinition,
|
|
13137
|
-
stages
|
|
13138
|
-
}) {
|
|
13139
|
-
const stageStructures = (drawDefinition?.structures || []).filter(
|
|
13140
|
-
(structure) => !stages?.length || structure.stage && stages.includes(structure.stage)
|
|
13141
|
-
);
|
|
13142
|
-
return stageStructures.map((structure) => {
|
|
13143
|
-
const { positionAssignments } = getPositionAssignments({
|
|
13144
|
-
structure
|
|
13145
|
-
});
|
|
13146
|
-
return positionAssignments ? positionAssignments.map(extractAttributes("participantId")) : [];
|
|
13147
|
-
}).flat();
|
|
13148
|
-
}
|
|
13149
|
-
|
|
13150
13155
|
function getValidModifyAssignedPairAction({
|
|
13151
13156
|
tournamentParticipants,
|
|
13152
13157
|
returnParticipants,
|
|
@@ -14263,7 +14268,7 @@ function positionActions$1(params) {
|
|
|
14263
14268
|
const stageAssignedParticipantIds = getAssignedParticipantIds({
|
|
14264
14269
|
drawDefinition,
|
|
14265
14270
|
stages
|
|
14266
|
-
});
|
|
14271
|
+
}).assignedParticipantIds ?? [];
|
|
14267
14272
|
const unassignedParticipantIds = stageEntries.filter(
|
|
14268
14273
|
(entry) => !stageAssignedParticipantIds.includes(entry.participantId)
|
|
14269
14274
|
).map((entry) => entry.participantId);
|
|
@@ -14842,5 +14847,5 @@ function getEventData(params) {
|
|
|
14842
14847
|
return { ...SUCCESS, eventData };
|
|
14843
14848
|
}
|
|
14844
14849
|
|
|
14845
|
-
export { allCompetitionMatchUps, allDrawMatchUps, allEventMatchUps, allTournamentMatchUps, matchUpActions as competitionMatchUpActions, competitionMatchUps, competitionScheduleMatchUps, drawMatchUps, eventMatchUps, filterParticipants, findExtension, findMatchUp, publicFindParticipant as findParticipant, generateSeedingScaleItems, getCompetitionDateRange, getCompetitionParticipants, getCompetitionVenues, getVenuesAndCourts as getCompetitionVenuesAndCourts, getEligibleVoluntaryConsolationParticipants, getEntriesAndSeedsCount, getEventData, getEventMatchUpFormatTiming, getFlightProfile, getMatchUpDailyLimits, getMatchUpDailyLimitsUpdate, getMatchUpFormatTimingUpdate, getOrderedDrawPositions, getParticipantEventDetails, getParticipantScaleItem, getPolicyDefinitions, getPositionAssignments, getProfileRounds, getRoundContextProfile, getRoundMatchUps, getRounds, getSeedsCount, getTimeItem, getVenuesAndCourts$1 as getTournamentVenuesAndCourts, getValidGroupSizes, isValid as isValidMatchUpFormat, parse as parseMatchUpFormat, parseScoreString, participantScaleItem, positionActions, matchUpActions$1 as tournamentMatchUpActions, tournamentMatchUps, validateScore };
|
|
14850
|
+
export { allCompetitionMatchUps, allDrawMatchUps, allEventMatchUps, allTournamentMatchUps, matchUpActions as competitionMatchUpActions, competitionMatchUps, competitionScheduleMatchUps, drawMatchUps, eventMatchUps, filterParticipants, findExtension, findMatchUp, publicFindParticipant as findParticipant, generateSeedingScaleItems, getAssignedParticipantIds, getCompetitionDateRange, getCompetitionParticipants, getCompetitionVenues, getVenuesAndCourts as getCompetitionVenuesAndCourts, getEligibleVoluntaryConsolationParticipants, getEntriesAndSeedsCount, getEventData, getEventMatchUpFormatTiming, getFlightProfile, getMatchUpDailyLimits, getMatchUpDailyLimitsUpdate, getMatchUpFormatTimingUpdate, getOrderedDrawPositions, getParticipantEventDetails, getParticipantScaleItem, getPolicyDefinitions, getPositionAssignments, getProfileRounds, getRoundContextProfile, getRoundMatchUps, getRounds, getSeedsCount, getTimeItem, getVenuesAndCourts$1 as getTournamentVenuesAndCourts, getValidGroupSizes, isValid as isValidMatchUpFormat, parse as parseMatchUpFormat, parseScoreString, participantScaleItem, positionActions, matchUpActions$1 as tournamentMatchUpActions, tournamentMatchUps, validateScore };
|
|
14846
14851
|
//# sourceMappingURL=query.mjs.map
|