@mshowes/brackets-manager 1.8.1

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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -0
  3. package/dist/base/getter.d.ts +272 -0
  4. package/dist/base/getter.d.ts.map +1 -0
  5. package/dist/base/getter.js +545 -0
  6. package/dist/base/getter.js.map +1 -0
  7. package/dist/base/stage/creator.d.ts +269 -0
  8. package/dist/base/stage/creator.d.ts.map +1 -0
  9. package/dist/base/stage/creator.js +735 -0
  10. package/dist/base/stage/creator.js.map +1 -0
  11. package/dist/base/updater.d.ts +121 -0
  12. package/dist/base/updater.d.ts.map +1 -0
  13. package/dist/base/updater.js +323 -0
  14. package/dist/base/updater.js.map +1 -0
  15. package/dist/create.d.ts +25 -0
  16. package/dist/create.d.ts.map +1 -0
  17. package/dist/create.js +55 -0
  18. package/dist/create.js.map +1 -0
  19. package/dist/delete.d.ts +33 -0
  20. package/dist/delete.d.ts.map +1 -0
  21. package/dist/delete.js +57 -0
  22. package/dist/delete.js.map +1 -0
  23. package/dist/find.d.ts +60 -0
  24. package/dist/find.d.ts.map +1 -0
  25. package/dist/find.js +196 -0
  26. package/dist/find.js.map +1 -0
  27. package/dist/get.d.ts +121 -0
  28. package/dist/get.d.ts.map +1 -0
  29. package/dist/get.js +420 -0
  30. package/dist/get.js.map +1 -0
  31. package/dist/helpers.d.ts +804 -0
  32. package/dist/helpers.d.ts.map +1 -0
  33. package/dist/helpers.js +1897 -0
  34. package/dist/helpers.js.map +1 -0
  35. package/dist/index.d.ts +11 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +21 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/manager.d.ts +60 -0
  40. package/dist/manager.d.ts.map +1 -0
  41. package/dist/manager.js +189 -0
  42. package/dist/manager.js.map +1 -0
  43. package/dist/ordering.d.ts +7 -0
  44. package/dist/ordering.d.ts.map +1 -0
  45. package/dist/ordering.js +147 -0
  46. package/dist/ordering.js.map +1 -0
  47. package/dist/reset.d.ts +27 -0
  48. package/dist/reset.d.ts.map +1 -0
  49. package/dist/reset.js +82 -0
  50. package/dist/reset.js.map +1 -0
  51. package/dist/types.d.ts +260 -0
  52. package/dist/types.d.ts.map +1 -0
  53. package/dist/types.js +3 -0
  54. package/dist/types.js.map +1 -0
  55. package/dist/update.d.ts +111 -0
  56. package/dist/update.d.ts.map +1 -0
  57. package/dist/update.js +265 -0
  58. package/dist/update.js.map +1 -0
  59. package/package.json +67 -0
package/dist/get.js ADDED
@@ -0,0 +1,420 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Get = void 0;
4
+ const brackets_model_1 = require("brackets-model");
5
+ const getter_1 = require("./base/getter");
6
+ const helpers = require("./helpers");
7
+ class Get extends getter_1.BaseGetter {
8
+ /**
9
+ * Returns the data needed to display a stage.
10
+ *
11
+ * @param stageId ID of the stage.
12
+ */
13
+ async stageData(stageId) {
14
+ const stage = await this.storage.select('stage', stageId);
15
+ if (!stage)
16
+ throw Error('Stage not found.');
17
+ const stageData = await this.getStageSpecificData(stage.id);
18
+ const participants = await this.storage.select('participant', {
19
+ tournament_id: stage.tournament_id,
20
+ });
21
+ if (!participants)
22
+ throw Error('Error getting participants.');
23
+ return {
24
+ stage: [stage],
25
+ group: stageData.groups,
26
+ round: stageData.rounds,
27
+ match: stageData.matches,
28
+ match_game: stageData.matchGames,
29
+ participant: participants,
30
+ };
31
+ }
32
+ /**
33
+ * Returns the data needed to display a whole tournament with all its stages.
34
+ *
35
+ * @param tournamentId ID of the tournament.
36
+ */
37
+ async tournamentData(tournamentId) {
38
+ const stages = await this.storage.select('stage', {
39
+ tournament_id: tournamentId,
40
+ });
41
+ if (!stages)
42
+ throw Error('Error getting stages.');
43
+ const stagesData = await Promise.all(stages.map((stage) => this.getStageSpecificData(stage.id)));
44
+ const participants = await this.storage.select('participant', {
45
+ tournament_id: tournamentId,
46
+ });
47
+ if (!participants)
48
+ throw Error('Error getting participants.');
49
+ return {
50
+ stage: stages,
51
+ group: stagesData.reduce((acc, data) => [...acc, ...data.groups], []),
52
+ round: stagesData.reduce((acc, data) => [...acc, ...data.rounds], []),
53
+ match: stagesData.reduce((acc, data) => [...acc, ...data.matches], []),
54
+ match_game: stagesData.reduce((acc, data) => [...acc, ...data.matchGames], []),
55
+ participant: participants,
56
+ };
57
+ }
58
+ /**
59
+ * Returns the match games associated to a list of matches.
60
+ *
61
+ * @param matches A list of matches.
62
+ */
63
+ async matchGames(matches) {
64
+ const parentMatches = matches.filter((match) => match.child_count > 0);
65
+ const matchGamesQueries = await Promise.all(parentMatches.map((match) => this.storage.select('match_game', { parent_id: match.id })));
66
+ if (matchGamesQueries.some((game) => game === null))
67
+ throw Error('Error getting match games.');
68
+ return helpers.getNonNull(matchGamesQueries).flat();
69
+ }
70
+ /**
71
+ * Returns the stage that is not completed yet, because of uncompleted matches.
72
+ * If all matches are completed in this tournament, there is no "current stage", so `null` is returned.
73
+ *
74
+ * @param tournamentId ID of the tournament.
75
+ */
76
+ async currentStage(tournamentId) {
77
+ const stages = await this.storage.select('stage', {
78
+ tournament_id: tournamentId,
79
+ });
80
+ if (!stages)
81
+ throw Error('Error getting stages.');
82
+ for (const stage of stages) {
83
+ const matches = await this.storage.select('match', {
84
+ stage_id: stage.id,
85
+ });
86
+ if (!matches)
87
+ throw Error('Error getting matches.');
88
+ if (matches.every((match) => match.status >= brackets_model_1.Status.Completed))
89
+ continue;
90
+ return stage;
91
+ }
92
+ return null;
93
+ }
94
+ /**
95
+ * Returns the round that is not completed yet, because of uncompleted matches.
96
+ * If all matches are completed in this stage of a tournament, there is no "current round", so `null` is returned.
97
+ *
98
+ * Note: The consolation final of single elimination and the grand final of double elimination will be in a different `Group`.
99
+ *
100
+ * @param stageId ID of the stage.
101
+ * @example
102
+ * If you don't know the stage id, you can first get the current stage.
103
+ * ```js
104
+ * const tournamentId = 3;
105
+ * const currentStage = await manager.get.currentStage(tournamentId);
106
+ * const currentRound = await manager.get.currentRound(currentStage.id);
107
+ * ```
108
+ */
109
+ async currentRound(stageId) {
110
+ const matches = await this.storage.select('match', {
111
+ stage_id: stageId,
112
+ });
113
+ if (!matches)
114
+ throw Error('Error getting matches.');
115
+ const matchesByRound = helpers.splitBy(matches, 'round_id');
116
+ for (const roundMatches of matchesByRound) {
117
+ if (roundMatches.every((match) => match.status >= brackets_model_1.Status.Completed))
118
+ continue;
119
+ const round = await this.storage.select('round', roundMatches[0].round_id);
120
+ if (!round)
121
+ throw Error('Round not found.');
122
+ return round;
123
+ }
124
+ return null;
125
+ }
126
+ /**
127
+ * Returns the matches that can currently be played in parallel.
128
+ * If the stage doesn't contain any, an empty array is returned.
129
+ *
130
+ * Note:
131
+ * - Returned matches are ongoing (i.e. ready or running).
132
+ * - Returned matches can be from different rounds.
133
+ *
134
+ * @param stageId ID of the stage.
135
+ * @example
136
+ * If you don't know the stage id, you can first get the current stage.
137
+ * ```js
138
+ * const tournamentId = 3;
139
+ * const currentStage = await manager.get.currentStage(tournamentId);
140
+ * const currentMatches = await manager.get.currentMatches(currentStage.id);
141
+ * ```
142
+ */
143
+ async currentMatches(stageId) {
144
+ const stage = await this.storage.select('stage', stageId);
145
+ if (!stage)
146
+ throw Error('Stage not found.');
147
+ // TODO: Implement this for all stage types.
148
+ // - For round robin, 1 round per group can be played in parallel at their own pace.
149
+ // - For double elimination, 1 round per bracket (upper and lower) can be played in parallel at their own pace.
150
+ if (stage.type !== 'single_elimination') {
151
+ throw Error('Not implemented for round robin and double elimination. Ask if needed.');
152
+ }
153
+ const matches = await this.storage.select('match', {
154
+ stage_id: stageId,
155
+ });
156
+ if (!matches)
157
+ throw Error('Error getting matches.');
158
+ const matchesByRound = helpers.splitBy(matches, 'round_id');
159
+ const roundCount = helpers.getUpperBracketRoundCount(stage.settings.size);
160
+ // Save multiple queries for `round`.
161
+ let currentRoundIndex = -1;
162
+ const currentMatches = [];
163
+ for (const roundMatches of matchesByRound) {
164
+ currentRoundIndex++;
165
+ if (stage.settings.consolationFinal &&
166
+ currentRoundIndex === roundCount - 1) {
167
+ const [final] = roundMatches;
168
+ const [consolationFinal] = matchesByRound[currentRoundIndex + 1];
169
+ const finals = [final, consolationFinal];
170
+ if (finals.every((match) => !helpers.isMatchOngoing(match)))
171
+ return currentMatches;
172
+ return finals.filter((match) => helpers.isMatchOngoing(match));
173
+ }
174
+ if (roundMatches.every((match) => !helpers.isMatchOngoing(match)))
175
+ continue;
176
+ currentMatches.push(...roundMatches.filter((match) => helpers.isMatchOngoing(match)));
177
+ }
178
+ return currentMatches;
179
+ }
180
+ /**
181
+ * Returns the seeding of a stage.
182
+ *
183
+ * @param stageId ID of the stage.
184
+ */
185
+ async seeding(stageId) {
186
+ const stage = await this.storage.select('stage', stageId);
187
+ if (!stage)
188
+ throw Error('Stage not found.');
189
+ const pickRelevantProps = (slot) => {
190
+ if (slot === null)
191
+ return null;
192
+ const { id, position } = slot;
193
+ return { id, position };
194
+ };
195
+ if (stage.type === 'round_robin')
196
+ return (await this.roundRobinSeeding(stage)).map(pickRelevantProps);
197
+ return (await this.eliminationSeeding(stage)).map(pickRelevantProps);
198
+ }
199
+ // eslint-disable-next-line jsdoc/require-jsdoc
200
+ async finalStandings(stageId, roundRobinOptions) {
201
+ const stage = await this.storage.select('stage', stageId);
202
+ if (!stage)
203
+ throw Error('Stage not found.');
204
+ switch (stage.type) {
205
+ case 'round_robin': {
206
+ if (!roundRobinOptions) {
207
+ throw Error('Round-robin options are required for round-robin stages.');
208
+ }
209
+ return this.roundRobinStandings(stage, roundRobinOptions);
210
+ }
211
+ case 'single_elimination': {
212
+ if (roundRobinOptions) {
213
+ throw Error('Round-robin options are not supported for elimination stages.');
214
+ }
215
+ return this.singleEliminationStandings(stage);
216
+ }
217
+ case 'double_elimination': {
218
+ if (roundRobinOptions) {
219
+ throw Error('Round-robin options are not supported for elimination stages.');
220
+ }
221
+ return this.doubleEliminationStandings(stage);
222
+ }
223
+ default:
224
+ throw Error('Unknown stage type.');
225
+ }
226
+ }
227
+ /**
228
+ * Returns the seeding of a round-robin stage.
229
+ *
230
+ * @param stage The stage.
231
+ */
232
+ async roundRobinSeeding(stage) {
233
+ if (stage.settings.size === undefined)
234
+ throw Error('The size of the seeding is undefined.');
235
+ const matches = await this.storage.select('match', {
236
+ stage_id: stage.id,
237
+ });
238
+ if (!matches)
239
+ throw Error('Error getting matches.');
240
+ const slots = helpers.convertMatchesToSeeding(matches);
241
+ // BYE vs. BYE matches of a round-robin stage are removed
242
+ // when the stage is created. We need to add them back temporarily.
243
+ if (slots.length < stage.settings.size) {
244
+ const diff = stage.settings.size - slots.length;
245
+ for (let i = 0; i < diff; i++)
246
+ slots.push(null);
247
+ }
248
+ const unique = helpers.uniqueBy(slots, (item) => item && item.position);
249
+ const seeding = helpers.setArraySize(unique, stage.settings.size, null);
250
+ return seeding;
251
+ }
252
+ /**
253
+ * Returns the seeding of an elimination stage.
254
+ *
255
+ * @param stage The stage.
256
+ */
257
+ async eliminationSeeding(stage) {
258
+ const firstRound = await this.storage.selectFirst('round', { stage_id: stage.id, number: 1 }, false);
259
+ if (!firstRound)
260
+ throw Error('Error getting the first round.');
261
+ const matches = await this.storage.select('match', {
262
+ round_id: firstRound.id,
263
+ });
264
+ if (!matches)
265
+ throw Error('Error getting matches.');
266
+ return helpers.convertMatchesToSeeding(matches);
267
+ }
268
+ /**
269
+ * Returns the final standings of a round-robin stage.
270
+ *
271
+ * @param stage The stage.
272
+ * @param roundRobinOptions The options for the round-robin standings.
273
+ */
274
+ async roundRobinStandings(stage, roundRobinOptions) {
275
+ const participants = await this.storage.select('participant', {
276
+ tournament_id: stage.tournament_id,
277
+ });
278
+ if (!participants)
279
+ throw Error('Error getting participants.');
280
+ const matches = await this.storage.select('match', {
281
+ stage_id: stage.id,
282
+ });
283
+ if (!matches)
284
+ throw Error('Error getting matches.');
285
+ const matchesByGroup = helpers.splitBy(matches, 'group_id');
286
+ const unsortedRanking = matchesByGroup.flatMap((groupMatches) => {
287
+ const groupRanking = helpers.getRanking(groupMatches, roundRobinOptions.rankingFormula);
288
+ const qualifiedOnly = groupRanking.slice(0, roundRobinOptions.maxQualifiedParticipantsPerGroup);
289
+ return qualifiedOnly.map((item) => ({
290
+ ...item,
291
+ groupId: groupMatches[0].group_id,
292
+ name: helpers.findParticipant(participants, item).name,
293
+ }));
294
+ });
295
+ return unsortedRanking.sort((a, b) => a.rank - b.rank);
296
+ }
297
+ /**
298
+ * Returns the final standings of a single elimination stage.
299
+ *
300
+ * @param stage The stage.
301
+ */
302
+ async singleEliminationStandings(stage) {
303
+ var _a;
304
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call */
305
+ const grouped = [];
306
+ const { group: groups, match: matches, participant: participants, } = await this.stageData(stage.id);
307
+ const [singleBracket, finalGroup] = groups;
308
+ const final = matches
309
+ .filter((match) => match.group_id === singleBracket.id)
310
+ .pop();
311
+ if (!final)
312
+ throw Error('Final not found.');
313
+ // 1st place: Final winner.
314
+ grouped[0] = [
315
+ helpers.findParticipant(participants, getFinalWinnerIfDefined(final)),
316
+ ];
317
+ // Rest: every loser in reverse order.
318
+ const losers = helpers.getLosers(participants, matches.filter((match) => match.group_id === singleBracket.id));
319
+ grouped.push(...losers.reverse());
320
+ if ((_a = stage.settings) === null || _a === void 0 ? void 0 : _a.consolationFinal) {
321
+ const consolationFinal = matches
322
+ .filter((match) => match.group_id === finalGroup.id)
323
+ .pop();
324
+ if (!consolationFinal)
325
+ throw Error('Consolation final not found.');
326
+ const consolationFinalWinner = helpers.findParticipant(participants, getFinalWinnerIfDefined(consolationFinal));
327
+ const consolationFinalLoser = helpers.findParticipant(participants, helpers.getLoser(consolationFinal));
328
+ // Overwrite semi-final losers with the consolation final results.
329
+ grouped.splice(2, 1, [consolationFinalWinner], [consolationFinalLoser]);
330
+ }
331
+ return helpers.makeFinalStandings(grouped);
332
+ }
333
+ /* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call */
334
+ /**
335
+ * Returns the final standings of a double elimination stage.
336
+ *
337
+ * @param stage The stage.
338
+ */
339
+ async doubleEliminationStandings(stage) {
340
+ var _a, _b;
341
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call */
342
+ const grouped = [];
343
+ const { group: groups, match: matches, participant: participants, } = await this.stageData(stage.id);
344
+ const [winnerBracket, loserBracket, finalGroup] = groups;
345
+ if (((_a = stage.settings) === null || _a === void 0 ? void 0 : _a.grandFinal) === 'none') {
346
+ const finalWB = matches
347
+ .filter((match) => match.group_id === winnerBracket.id)
348
+ .pop();
349
+ if (!finalWB)
350
+ throw Error('WB final not found.');
351
+ const finalLB = matches
352
+ .filter((match) => match.group_id === loserBracket.id)
353
+ .pop();
354
+ if (!finalLB)
355
+ throw Error('LB final not found.');
356
+ // 1st place: WB Final winner.
357
+ grouped[0] = [
358
+ helpers.findParticipant(participants, getFinalWinnerIfDefined(finalWB)),
359
+ ];
360
+ // 2nd place: LB Final winner.
361
+ grouped[1] = [
362
+ helpers.findParticipant(participants, getFinalWinnerIfDefined(finalLB)),
363
+ ];
364
+ }
365
+ else {
366
+ const grandFinalMatches = matches.filter((match) => match.group_id === finalGroup.id);
367
+ const decisiveMatch = helpers.getGrandFinalDecisiveMatch(((_b = stage.settings) === null || _b === void 0 ? void 0 : _b.grandFinal) || 'none', grandFinalMatches);
368
+ // 1st place: Grand Final winner.
369
+ grouped[0] = [
370
+ helpers.findParticipant(participants, getFinalWinnerIfDefined(decisiveMatch)),
371
+ ];
372
+ // 2nd place: Grand Final loser.
373
+ grouped[1] = [
374
+ helpers.findParticipant(participants, helpers.getLoser(decisiveMatch)),
375
+ ];
376
+ }
377
+ // Rest: every loser in reverse order.
378
+ const losers = helpers.getLosers(participants, matches.filter((match) => match.group_id === loserBracket.id));
379
+ grouped.push(...losers.reverse());
380
+ return helpers.makeFinalStandings(grouped);
381
+ }
382
+ /* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call */
383
+ /**
384
+ * Returns only the data specific to the given stage (without the participants).
385
+ *
386
+ * @param stageId ID of the stage.
387
+ */
388
+ async getStageSpecificData(stageId) {
389
+ const groups = await this.storage.select('group', {
390
+ stage_id: stageId,
391
+ });
392
+ if (!groups)
393
+ throw Error('Error getting groups.');
394
+ const rounds = await this.storage.select('round', {
395
+ stage_id: stageId,
396
+ });
397
+ if (!rounds)
398
+ throw Error('Error getting rounds.');
399
+ const matches = await this.storage.select('match', {
400
+ stage_id: stageId,
401
+ });
402
+ if (!matches)
403
+ throw Error('Error getting matches.');
404
+ const matchGames = await this.matchGames(matches);
405
+ return {
406
+ groups,
407
+ rounds,
408
+ matches,
409
+ matchGames,
410
+ };
411
+ }
412
+ }
413
+ exports.Get = Get;
414
+ const getFinalWinnerIfDefined = (match) => {
415
+ const winner = helpers.getWinner(match);
416
+ if (!winner)
417
+ throw Error('The final match does not have a winner.');
418
+ return winner;
419
+ };
420
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../src/get.ts"],"names":[],"mappings":";;;AAAA,mDAUwB;AAQxB,0CAA2C;AAC3C,qCAAqC;AAErC,MAAa,GAAI,SAAQ,mBAAU;IAC/B;;;;OAIG;IACI,KAAK,CAAC,SAAS,CAAC,OAAW;QAC9B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK;YAAE,MAAM,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAE5C,MAAM,SAAS,GA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