volleyballsimtypes 0.0.25 → 0.0.26
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/cjs/src/service/player/index.d.ts +1 -1
- package/dist/cjs/src/service/tournament/index.d.ts +2 -1
- package/dist/cjs/src/service/tournament/index.js +2 -1
- package/dist/cjs/src/service/tournament/stage.d.ts +10 -0
- package/dist/cjs/src/service/tournament/stage.js +26 -0
- package/dist/cjs/src/service/tournament/tournament-match.d.ts +1 -6
- package/dist/cjs/src/service/tournament/tournament-match.js +1 -8
- package/dist/esm/src/data/models/index.js +10 -10
- package/dist/esm/src/data/transformers/index.js +3 -3
- package/dist/esm/src/routing/index.js +1 -1
- package/dist/esm/src/service/index.js +15 -15
- package/dist/esm/src/service/match/index.js +5 -5
- package/dist/esm/src/service/player/index.d.ts +1 -1
- package/dist/esm/src/service/player/index.js +5 -5
- package/dist/esm/src/service/team/index.js +1 -1
- package/dist/esm/src/service/tournament/index.d.ts +2 -1
- package/dist/esm/src/service/tournament/index.js +2 -1
- package/dist/esm/src/service/tournament/stage.d.ts +10 -0
- package/dist/esm/src/service/tournament/stage.js +23 -0
- package/dist/esm/src/service/tournament/tournament-match.d.ts +1 -6
- package/dist/esm/src/service/tournament/tournament-match.js +0 -7
- package/dist/esm/src/service/utils/index.js +3 -3
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@ import { PerformanceStats, PerformanceStatsOpts } from './performance-stats';
|
|
|
3
3
|
import { Role } from './role';
|
|
4
4
|
import { Trait } from './trait';
|
|
5
5
|
import { GeneralStat } from './stats';
|
|
6
|
-
export { PerformanceStatsOpts, PlayerOpts, Player, PerformanceStats, GeneralStat, Name, Stat, Role, Trait
|
|
6
|
+
export { PerformanceStatsOpts, PlayerOpts, Player, PerformanceStats, GeneralStat, Name, Stat, Role, Trait };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Tournament, TournamentOpts } from './tournament';
|
|
2
|
-
import {
|
|
2
|
+
import { TournamentMatch, TournamentStageOpts } from './tournament-match';
|
|
3
|
+
import { Stage } from './stage';
|
|
3
4
|
export { TournamentOpts, TournamentStageOpts, TournamentMatch, Stage, Tournament };
|
|
@@ -4,5 +4,6 @@ exports.Tournament = exports.Stage = exports.TournamentMatch = void 0;
|
|
|
4
4
|
const tournament_1 = require("./tournament");
|
|
5
5
|
Object.defineProperty(exports, "Tournament", { enumerable: true, get: function () { return tournament_1.Tournament; } });
|
|
6
6
|
const tournament_match_1 = require("./tournament-match");
|
|
7
|
-
Object.defineProperty(exports, "Stage", { enumerable: true, get: function () { return tournament_match_1.Stage; } });
|
|
8
7
|
Object.defineProperty(exports, "TournamentMatch", { enumerable: true, get: function () { return tournament_match_1.TournamentMatch; } });
|
|
8
|
+
const stage_1 = require("./stage");
|
|
9
|
+
Object.defineProperty(exports, "Stage", { enumerable: true, get: function () { return stage_1.Stage; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Stage = void 0;
|
|
4
|
+
var Stage;
|
|
5
|
+
(function (Stage) {
|
|
6
|
+
Stage[Stage["ROUND_OF_8"] = 8] = "ROUND_OF_8";
|
|
7
|
+
Stage[Stage["QUARTERFINALS"] = 4] = "QUARTERFINALS";
|
|
8
|
+
Stage[Stage["SEMIFINALS"] = 2] = "SEMIFINALS";
|
|
9
|
+
Stage[Stage["FINAL"] = 1] = "FINAL";
|
|
10
|
+
})(Stage = exports.Stage || (exports.Stage = {}));
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
12
|
+
(function (Stage) {
|
|
13
|
+
const STAGES = [Stage.ROUND_OF_8, Stage.QUARTERFINALS, Stage.SEMIFINALS, Stage.FINAL];
|
|
14
|
+
function getStages() {
|
|
15
|
+
return [...STAGES];
|
|
16
|
+
}
|
|
17
|
+
Stage.getStages = getStages;
|
|
18
|
+
function getNextStage(stage) {
|
|
19
|
+
if (stage < 1)
|
|
20
|
+
throw new Error(`INVALID_STAGE ${stage}`);
|
|
21
|
+
if (stage === 1)
|
|
22
|
+
throw new Error('ALREADY_IN_FINAL_STAGE');
|
|
23
|
+
return stage / 2;
|
|
24
|
+
}
|
|
25
|
+
Stage.getNextStage = getNextStage;
|
|
26
|
+
})(Stage = exports.Stage || (exports.Stage = {}));
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Match } from '../match';
|
|
2
|
-
|
|
3
|
-
ROUND_OF_8 = 8,
|
|
4
|
-
QUARTERFINALS = 4,
|
|
5
|
-
SEMIFINALS = 2,
|
|
6
|
-
FINAL = 1
|
|
7
|
-
}
|
|
2
|
+
import { Stage } from './stage';
|
|
8
3
|
export interface TournamentStageOpts {
|
|
9
4
|
readonly stage: Stage;
|
|
10
5
|
readonly match: Match;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TournamentMatch =
|
|
4
|
-
var Stage;
|
|
5
|
-
(function (Stage) {
|
|
6
|
-
Stage[Stage["ROUND_OF_8"] = 8] = "ROUND_OF_8";
|
|
7
|
-
Stage[Stage["QUARTERFINALS"] = 4] = "QUARTERFINALS";
|
|
8
|
-
Stage[Stage["SEMIFINALS"] = 2] = "SEMIFINALS";
|
|
9
|
-
Stage[Stage["FINAL"] = 1] = "FINAL";
|
|
10
|
-
})(Stage = exports.Stage || (exports.Stage = {}));
|
|
3
|
+
exports.TournamentMatch = void 0;
|
|
11
4
|
class TournamentMatch {
|
|
12
5
|
constructor({ stage, match, index }) {
|
|
13
6
|
if (index > stage || index < 0)
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { BlockModel } from './block';
|
|
2
2
|
import { CoachModel } from './coach';
|
|
3
|
-
import { CountryModel
|
|
4
|
-
import { EventModel
|
|
5
|
-
import { LeagueModel
|
|
3
|
+
import { CountryModel } from './country';
|
|
4
|
+
import { EventModel } from './event';
|
|
5
|
+
import { LeagueModel } from './league';
|
|
6
6
|
import { LiberoReplacementModel } from './libero-replacement';
|
|
7
|
-
import { MatchModel
|
|
7
|
+
import { MatchModel } from './match';
|
|
8
8
|
import { MatchSetModel, } from './match-set';
|
|
9
9
|
import { MatchSetStatsModel, } from './match-set-stats';
|
|
10
10
|
import { PerformanceStatsModel, } from './performance-stats';
|
|
11
11
|
import { PlayerModel, } from './player';
|
|
12
|
-
import { RallyModel
|
|
12
|
+
import { RallyModel } from './rally';
|
|
13
13
|
import { RallyPositionModel } from './rally-position';
|
|
14
14
|
import { ReceptionModel, } from './reception';
|
|
15
|
-
import { ScoreModel
|
|
16
|
-
import { SeasonModel
|
|
15
|
+
import { ScoreModel } from './score';
|
|
16
|
+
import { SeasonModel } from './season';
|
|
17
17
|
import { SeasonTeamsModel, } from './season-teams';
|
|
18
|
-
import { ServeModel
|
|
19
|
-
import { SetModel
|
|
18
|
+
import { ServeModel } from './serve';
|
|
19
|
+
import { SetModel } from './set';
|
|
20
20
|
import { SpikeModel } from './spike';
|
|
21
21
|
import { SubstitutionModel, } from './substitution';
|
|
22
|
-
import { TeamModel
|
|
22
|
+
import { TeamModel } from './team';
|
|
23
23
|
import { TournamentModel } from './tournament';
|
|
24
24
|
import { TournamentMatchModel } from './tournament-match';
|
|
25
25
|
export { TournamentModel, TournamentMatchModel, BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, };
|
|
@@ -5,17 +5,17 @@ import { transformFromCourtPosition, transformToCourtPosition } from './court-po
|
|
|
5
5
|
import { transformFromCourtTarget, transformToCourtTarget } from './court-target';
|
|
6
6
|
import { transformFromEventType, transformToEventType } from './event-type';
|
|
7
7
|
import { transformFromFormation, transformToFormation } from './formation';
|
|
8
|
-
import { transformFromLeague, transformToLeague
|
|
8
|
+
import { transformFromLeague, transformToLeague } from './league';
|
|
9
9
|
import { transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement } from './libero-replacement';
|
|
10
10
|
import { transformFromTournament, transformToAPITournament, transformToTournament } from './tournament';
|
|
11
11
|
import { transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, } from './tournament-match';
|
|
12
12
|
import { transformFromMatch, transformToAPIMatch, transformToMatch } from './match';
|
|
13
13
|
import { transformFromMatchSet, transformToAPIMatchSet, transformToMatchSet } from './match-set';
|
|
14
14
|
import { transformFromMatchSetStats, transformToAPIMatchSetStats, transformToMatchSetStats } from './match-set-stats';
|
|
15
|
-
import { transformFromPerformanceStats, transformToPerformanceStats
|
|
15
|
+
import { transformFromPerformanceStats, transformToPerformanceStats } from './performance-stats';
|
|
16
16
|
import { transformFromPlayer, transformToAPIPlayer, transformToPlayer } from './player';
|
|
17
17
|
import { transformFromRally, transformToAPIRally, transformToRally } from './rally';
|
|
18
|
-
import { transformFromPlayerPosition, transformToPlayerPosition
|
|
18
|
+
import { transformFromPlayerPosition, transformToPlayerPosition } from './rally-position';
|
|
19
19
|
import { transformFromReception, transformToAPIReception, transformToReception } from './reception';
|
|
20
20
|
import { transformFromRole, transformToRole } from './role';
|
|
21
21
|
import { transformFromScore, transformToAPIScore, transformToScore } from './score';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { APITrait
|
|
1
|
+
import { APITrait } from './player';
|
|
2
2
|
export { APITrait };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { CourtPosition, CourtRow, CourtTarget, Match, MatchSet, MatchSetState, MatchTeam, Rally, RallyState, } from './match';
|
|
2
|
-
import { Coach, Formation
|
|
3
|
-
import { Country
|
|
4
|
-
import { Team
|
|
5
|
-
import { EventType, RallyEvent
|
|
6
|
-
import { InPlayEvent
|
|
7
|
-
import { Score
|
|
8
|
-
import { Substitution
|
|
9
|
-
import { LiberoReplacement, LiberoReplacementType
|
|
10
|
-
import { Serve, ServeFailure, ServeType
|
|
11
|
-
import { Reception, ReceptionFailure, ReceptionType
|
|
12
|
-
import { Set, SetFailure, SetType
|
|
13
|
-
import { Spike, SpikeFailure, SpikeType
|
|
14
|
-
import { Block, BlockFailure, BlockType
|
|
15
|
-
import { GeneralStat, PerformanceStats, Player, Role, Trait
|
|
16
|
-
import { League, Season, Standing
|
|
2
|
+
import { Coach, Formation } from './coach';
|
|
3
|
+
import { Country } from './country';
|
|
4
|
+
import { Team } from './team';
|
|
5
|
+
import { EventType, RallyEvent } from './event/rally-event';
|
|
6
|
+
import { InPlayEvent } from './event/in-play-event';
|
|
7
|
+
import { Score } from './event/score';
|
|
8
|
+
import { Substitution } from './event/substitution';
|
|
9
|
+
import { LiberoReplacement, LiberoReplacementType } from './event/libero-replacement';
|
|
10
|
+
import { Serve, ServeFailure, ServeType } from './event/serve';
|
|
11
|
+
import { Reception, ReceptionFailure, ReceptionType } from './event/reception';
|
|
12
|
+
import { Set, SetFailure, SetType } from './event/set';
|
|
13
|
+
import { Spike, SpikeFailure, SpikeType } from './event/spike';
|
|
14
|
+
import { Block, BlockFailure, BlockType } from './event/block';
|
|
15
|
+
import { GeneralStat, PerformanceStats, Player, Role, Trait } from './player';
|
|
16
|
+
import { League, Season, Standing } from './league';
|
|
17
17
|
import { Stage, Tournament, TournamentMatch } from './tournament';
|
|
18
18
|
import { formatNumber, generateModifier, getKeys, getRandomEnumValue, randomNumber, shuffle, validateUUID, } from './utils';
|
|
19
19
|
export { Stage, TournamentMatch, Tournament, Block, BlockFailure, BlockType, Coach, Country, CourtPosition, CourtRow, CourtTarget, EventType, Formation, formatNumber, GeneralStat, generateModifier, getKeys, getRandomEnumValue, InPlayEvent, League, LiberoReplacement, LiberoReplacementType, Match, MatchSet, MatchSetState, MatchTeam, PerformanceStats, Player, Rally, RallyEvent, RallyState, randomNumber, Reception, ReceptionFailure, ReceptionType, Role, Score, Season, Serve, ServeFailure, ServeType, Set, SetFailure, SetType, shuffle, Spike, SpikeFailure, SpikeType, Standing, Substitution, Team, Trait, validateUUID };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Match } from './match';
|
|
2
|
-
import { MatchSet, MatchSetState
|
|
3
|
-
import { Rally, RallyState
|
|
4
|
-
import { CourtPosition, CourtRow
|
|
5
|
-
import { CourtTarget
|
|
6
|
-
import { MatchTeam
|
|
2
|
+
import { MatchSet, MatchSetState } from './match-set';
|
|
3
|
+
import { Rally, RallyState } from './rally';
|
|
4
|
+
import { CourtPosition, CourtRow } from './court-position';
|
|
5
|
+
import { CourtTarget } from './court-target';
|
|
6
|
+
import { MatchTeam } from './match-team';
|
|
7
7
|
export { CourtPosition, CourtRow, CourtTarget, Match, MatchSet, MatchSetState, MatchTeam, Rally, RallyState, };
|
|
@@ -3,4 +3,4 @@ import { PerformanceStats, PerformanceStatsOpts } from './performance-stats';
|
|
|
3
3
|
import { Role } from './role';
|
|
4
4
|
import { Trait } from './trait';
|
|
5
5
|
import { GeneralStat } from './stats';
|
|
6
|
-
export { PerformanceStatsOpts, PlayerOpts, Player, PerformanceStats, GeneralStat, Name, Stat, Role, Trait
|
|
6
|
+
export { PerformanceStatsOpts, PlayerOpts, Player, PerformanceStats, GeneralStat, Name, Stat, Role, Trait };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Player
|
|
2
|
-
import { PerformanceStats
|
|
3
|
-
import { Role
|
|
4
|
-
import { Trait
|
|
1
|
+
import { Player } from './player';
|
|
2
|
+
import { PerformanceStats } from './performance-stats';
|
|
3
|
+
import { Role } from './role';
|
|
4
|
+
import { Trait } from './trait';
|
|
5
5
|
import { GeneralStat } from './stats';
|
|
6
|
-
export { Player, PerformanceStats, GeneralStat, Role, Trait
|
|
6
|
+
export { Player, PerformanceStats, GeneralStat, Role, Trait };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Team
|
|
1
|
+
import { Team } from './team';
|
|
2
2
|
export { Team };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Tournament, TournamentOpts } from './tournament';
|
|
2
|
-
import {
|
|
2
|
+
import { TournamentMatch, TournamentStageOpts } from './tournament-match';
|
|
3
|
+
import { Stage } from './stage';
|
|
3
4
|
export { TournamentOpts, TournamentStageOpts, TournamentMatch, Stage, Tournament };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export var Stage;
|
|
2
|
+
(function (Stage) {
|
|
3
|
+
Stage[Stage["ROUND_OF_8"] = 8] = "ROUND_OF_8";
|
|
4
|
+
Stage[Stage["QUARTERFINALS"] = 4] = "QUARTERFINALS";
|
|
5
|
+
Stage[Stage["SEMIFINALS"] = 2] = "SEMIFINALS";
|
|
6
|
+
Stage[Stage["FINAL"] = 1] = "FINAL";
|
|
7
|
+
})(Stage || (Stage = {}));
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
9
|
+
(function (Stage) {
|
|
10
|
+
const STAGES = [Stage.ROUND_OF_8, Stage.QUARTERFINALS, Stage.SEMIFINALS, Stage.FINAL];
|
|
11
|
+
function getStages() {
|
|
12
|
+
return [...STAGES];
|
|
13
|
+
}
|
|
14
|
+
Stage.getStages = getStages;
|
|
15
|
+
function getNextStage(stage) {
|
|
16
|
+
if (stage < 1)
|
|
17
|
+
throw new Error(`INVALID_STAGE ${stage}`);
|
|
18
|
+
if (stage === 1)
|
|
19
|
+
throw new Error('ALREADY_IN_FINAL_STAGE');
|
|
20
|
+
return stage / 2;
|
|
21
|
+
}
|
|
22
|
+
Stage.getNextStage = getNextStage;
|
|
23
|
+
})(Stage || (Stage = {}));
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Match } from '../match';
|
|
2
|
-
|
|
3
|
-
ROUND_OF_8 = 8,
|
|
4
|
-
QUARTERFINALS = 4,
|
|
5
|
-
SEMIFINALS = 2,
|
|
6
|
-
FINAL = 1
|
|
7
|
-
}
|
|
2
|
+
import { Stage } from './stage';
|
|
8
3
|
export interface TournamentStageOpts {
|
|
9
4
|
readonly stage: Stage;
|
|
10
5
|
readonly match: Match;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export var Stage;
|
|
2
|
-
(function (Stage) {
|
|
3
|
-
Stage[Stage["ROUND_OF_8"] = 8] = "ROUND_OF_8";
|
|
4
|
-
Stage[Stage["QUARTERFINALS"] = 4] = "QUARTERFINALS";
|
|
5
|
-
Stage[Stage["SEMIFINALS"] = 2] = "SEMIFINALS";
|
|
6
|
-
Stage[Stage["FINAL"] = 1] = "FINAL";
|
|
7
|
-
})(Stage || (Stage = {}));
|
|
8
1
|
export class TournamentMatch {
|
|
9
2
|
constructor({ stage, match, index }) {
|
|
10
3
|
if (index > stage || index < 0)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getRandomEnumValue } from './enum-utils';
|
|
2
|
-
import { formatNumber, validateUUID
|
|
3
|
-
import { getKeys
|
|
4
|
-
import { generateModifier, randomNumber, shuffle
|
|
2
|
+
import { formatNumber, validateUUID } from './string-utils';
|
|
3
|
+
import { getKeys } from './object-utils';
|
|
4
|
+
import { generateModifier, randomNumber, shuffle } from './rng-utils';
|
|
5
5
|
export { getRandomEnumValue, formatNumber, generateModifier, getKeys, randomNumber, validateUUID, shuffle, };
|