tods-competition-factory 1.8.34 → 1.8.36
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 +26 -12
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +1 -2
- package/dist/forge/query.mjs.map +1 -1
- package/dist/index.mjs +91 -45
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +216 -150
- 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 +5 -5
package/dist/forge/generate.mjs
CHANGED
|
@@ -10748,11 +10748,11 @@ function swapAssignedPositions({
|
|
|
10748
10748
|
);
|
|
10749
10749
|
const secondAssignment = candidatePositionAssignments.find(
|
|
10750
10750
|
(assignment) => assignment.drawPosition === secondPosition
|
|
10751
|
-
);
|
|
10751
|
+
) ?? {};
|
|
10752
10752
|
const updatedFirstAssignmentAttributes = {
|
|
10753
|
-
participantId: secondAssignment
|
|
10754
|
-
qualifier: secondAssignment
|
|
10755
|
-
bye: secondAssignment
|
|
10753
|
+
participantId: secondAssignment?.participantId,
|
|
10754
|
+
qualifier: secondAssignment?.qualifier,
|
|
10755
|
+
bye: secondAssignment?.bye
|
|
10756
10756
|
};
|
|
10757
10757
|
const updatedSecondAssignmentAttributes = {
|
|
10758
10758
|
participantId: firstAssignment.participantId,
|
|
@@ -12233,7 +12233,7 @@ function randomUnseededSeparation({
|
|
|
12233
12233
|
});
|
|
12234
12234
|
if (result.error)
|
|
12235
12235
|
return decorateResult({ result, stack });
|
|
12236
|
-
} else {
|
|
12236
|
+
} else if (assignment.participantId) {
|
|
12237
12237
|
const result = assignDrawPosition({
|
|
12238
12238
|
automaticPlacement: true,
|
|
12239
12239
|
inContextDrawMatchUps,
|
|
@@ -18752,12 +18752,11 @@ function getParticipantEntries(params) {
|
|
|
18752
18752
|
const targetParticipantIds = participantFilters?.participantIds;
|
|
18753
18753
|
const getRelevantParticipantIds = (participantId) => {
|
|
18754
18754
|
const relevantParticipantIds = [participantId];
|
|
18755
|
-
relevantParticipantIds.push(participantId);
|
|
18756
18755
|
participantMap[participantId]?.participant.individualParticipantIds?.forEach(
|
|
18757
18756
|
(individualParticiapntId) => relevantParticipantIds.push(individualParticiapntId)
|
|
18758
18757
|
);
|
|
18759
18758
|
return relevantParticipantIds.some(
|
|
18760
|
-
(
|
|
18759
|
+
(id) => !targetParticipantIds?.length || targetParticipantIds.includes(id)
|
|
18761
18760
|
) ? relevantParticipantIds : [];
|
|
18762
18761
|
};
|
|
18763
18762
|
const withOpts = {
|
|
@@ -23570,7 +23569,13 @@ const POLICY_SEEDING_USTA = {
|
|
|
23570
23569
|
validSeedPositions: { ignore: true },
|
|
23571
23570
|
duplicateSeedNumbers: true,
|
|
23572
23571
|
drawSizeProgression: true,
|
|
23573
|
-
seedingProfile: {
|
|
23572
|
+
seedingProfile: {
|
|
23573
|
+
drawTypes: {
|
|
23574
|
+
[ROUND_ROBIN_WITH_PLAYOFF]: { positioning: WATERFALL },
|
|
23575
|
+
[ROUND_ROBIN]: { positioning: WATERFALL }
|
|
23576
|
+
},
|
|
23577
|
+
positioning: SEPARATE
|
|
23578
|
+
},
|
|
23574
23579
|
policyName: "USTA SEEDING",
|
|
23575
23580
|
seedsCountThresholds: [
|
|
23576
23581
|
{ drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 },
|
|
@@ -23591,11 +23596,9 @@ function generateDrawDefinition(params) {
|
|
|
23591
23596
|
ignoreAllowedDrawTypes,
|
|
23592
23597
|
voluntaryConsolation,
|
|
23593
23598
|
hydrateCollections,
|
|
23594
|
-
policyDefinitions,
|
|
23595
23599
|
ignoreStageSpace,
|
|
23596
23600
|
tournamentRecord,
|
|
23597
23601
|
qualifyingOnly,
|
|
23598
|
-
seedingProfile,
|
|
23599
23602
|
tieFormatName,
|
|
23600
23603
|
drawEntries,
|
|
23601
23604
|
addToEvent,
|
|
@@ -23606,8 +23609,19 @@ function generateDrawDefinition(params) {
|
|
|
23606
23609
|
tournamentRecord,
|
|
23607
23610
|
event
|
|
23608
23611
|
}).appliedPolicies ?? {};
|
|
23609
|
-
const
|
|
23612
|
+
const policyDefinitions = params.policyDefinitions ?? {};
|
|
23613
|
+
const drawTypeCoercion = params.drawTypeCoercion ?? policyDefinitions?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? appliedPolicies?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? true;
|
|
23610
23614
|
const drawType = drawTypeCoercion && params.drawSize === 2 && DrawTypeEnum.SingleElimination || params.drawType || DrawTypeEnum.SingleElimination;
|
|
23615
|
+
const seedingPolicy = policyDefinitions?.[POLICY_TYPE_SEEDING] ?? appliedPolicies?.[POLICY_TYPE_SEEDING];
|
|
23616
|
+
const seedingProfile = params.seedingProfile ?? seedingPolicy?.seedingProfile?.drawTypes?.[drawType] ?? seedingPolicy?.seedingProfile;
|
|
23617
|
+
if (params.seedingProfile) {
|
|
23618
|
+
if (!policyDefinitions[POLICY_TYPE_SEEDING]) {
|
|
23619
|
+
policyDefinitions[POLICY_TYPE_SEEDING] = {
|
|
23620
|
+
...POLICY_SEEDING_USTA[POLICY_TYPE_SEEDING]
|
|
23621
|
+
};
|
|
23622
|
+
}
|
|
23623
|
+
policyDefinitions[POLICY_TYPE_SEEDING].seedingProfile = seedingProfile;
|
|
23624
|
+
}
|
|
23611
23625
|
const { participants, participantMap } = getParticipants({
|
|
23612
23626
|
withIndividualParticipants: true,
|
|
23613
23627
|
tournamentRecord
|
|
@@ -23740,7 +23754,7 @@ function generateDrawDefinition(params) {
|
|
|
23740
23754
|
}
|
|
23741
23755
|
}
|
|
23742
23756
|
}
|
|
23743
|
-
if (!appliedPolicies[POLICY_TYPE_SEEDING]) {
|
|
23757
|
+
if (!appliedPolicies[POLICY_TYPE_SEEDING] && !policyDefinitions[POLICY_TYPE_SEEDING]) {
|
|
23744
23758
|
attachPolicies({ drawDefinition, policyDefinitions: POLICY_SEEDING_USTA });
|
|
23745
23759
|
Object.assign(appliedPolicies, POLICY_SEEDING_USTA);
|
|
23746
23760
|
}
|