volleyballsimtypes 0.0.19 → 0.0.21
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/data/index.d.ts +3 -3
- package/dist/cjs/src/data/index.js +10 -2
- package/dist/cjs/src/data/init-models.d.ts +3 -1
- package/dist/cjs/src/data/init-models.js +10 -1
- package/dist/cjs/src/data/models/index.d.ts +3 -1
- package/dist/cjs/src/data/models/index.js +5 -1
- package/dist/cjs/src/data/models/rally-position.d.ts +3 -2
- package/dist/cjs/src/data/models/season.d.ts +5 -0
- package/dist/cjs/src/data/models/season.js +8 -0
- package/dist/cjs/src/data/models/team.d.ts +11 -0
- package/dist/cjs/src/data/models/tournament-match.d.ts +29 -0
- package/dist/cjs/src/data/models/tournament-match.js +47 -0
- package/dist/cjs/src/data/models/tournament.d.ts +34 -0
- package/dist/cjs/src/data/models/tournament.js +42 -0
- package/dist/cjs/src/data/transformers/index.d.ts +3 -1
- package/dist/cjs/src/data/transformers/index.js +10 -2
- package/dist/cjs/src/data/transformers/season.js +5 -2
- package/dist/cjs/src/data/transformers/tournament-match.d.ts +7 -0
- package/dist/cjs/src/data/transformers/tournament-match.js +43 -0
- package/dist/cjs/src/data/transformers/tournament.d.ts +7 -0
- package/dist/cjs/src/data/transformers/tournament.js +28 -0
- package/dist/cjs/src/index.d.ts +4 -4
- package/dist/cjs/src/index.js +14 -2
- package/dist/cjs/src/routing/index.d.ts +3 -1
- package/dist/cjs/src/routing/league.d.ts +1 -0
- package/dist/cjs/src/routing/tournament.d.ts +4 -0
- package/dist/cjs/src/routing/tournament.js +2 -0
- package/dist/cjs/src/service/index.d.ts +2 -1
- package/dist/cjs/src/service/index.js +6 -1
- package/dist/cjs/src/service/league/season.d.ts +3 -2
- package/dist/cjs/src/service/league/season.js +2 -6
- package/dist/cjs/src/service/tournament/index.d.ts +3 -0
- package/dist/cjs/src/service/tournament/index.js +8 -0
- package/dist/cjs/src/service/tournament/tournament-match.d.ts +18 -0
- package/dist/cjs/src/service/tournament/tournament-match.js +20 -0
- package/dist/cjs/src/service/tournament/tournament.d.ts +15 -0
- package/dist/cjs/src/service/tournament/tournament.js +12 -0
- package/dist/esm/src/data/index.d.ts +3 -3
- package/dist/esm/src/data/index.js +3 -3
- package/dist/esm/src/data/init-models.d.ts +3 -1
- package/dist/esm/src/data/init-models.js +11 -2
- package/dist/esm/src/data/models/index.d.ts +3 -1
- package/dist/esm/src/data/models/index.js +3 -1
- package/dist/esm/src/data/models/rally-position.d.ts +3 -2
- package/dist/esm/src/data/models/season.d.ts +5 -0
- package/dist/esm/src/data/models/season.js +8 -0
- package/dist/esm/src/data/models/team.d.ts +11 -0
- package/dist/esm/src/data/models/tournament-match.d.ts +29 -0
- package/dist/esm/src/data/models/tournament-match.js +43 -0
- package/dist/esm/src/data/models/tournament.d.ts +34 -0
- package/dist/esm/src/data/models/tournament.js +38 -0
- package/dist/esm/src/data/transformers/index.d.ts +3 -1
- package/dist/esm/src/data/transformers/index.js +3 -1
- package/dist/esm/src/data/transformers/season.js +5 -2
- package/dist/esm/src/data/transformers/tournament-match.d.ts +7 -0
- package/dist/esm/src/data/transformers/tournament-match.js +38 -0
- package/dist/esm/src/data/transformers/tournament.d.ts +7 -0
- package/dist/esm/src/data/transformers/tournament.js +23 -0
- package/dist/esm/src/index.d.ts +4 -4
- package/dist/esm/src/index.js +3 -3
- package/dist/esm/src/routing/index.d.ts +3 -1
- package/dist/esm/src/routing/league.d.ts +1 -0
- package/dist/esm/src/routing/tournament.d.ts +4 -0
- package/dist/esm/src/routing/tournament.js +1 -0
- package/dist/esm/src/service/index.d.ts +2 -1
- package/dist/esm/src/service/index.js +2 -1
- package/dist/esm/src/service/league/season.d.ts +3 -2
- package/dist/esm/src/service/league/season.js +2 -6
- package/dist/esm/src/service/tournament/index.d.ts +3 -0
- package/dist/esm/src/service/tournament/index.js +3 -0
- package/dist/esm/src/service/tournament/tournament-match.d.ts +18 -0
- package/dist/esm/src/service/tournament/tournament-match.js +16 -0
- package/dist/esm/src/service/tournament/tournament.d.ts +15 -0
- package/dist/esm/src/service/tournament/tournament.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class TournamentMatchModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return TournamentMatchModel.init({
|
|
5
|
+
tournament_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true
|
|
9
|
+
},
|
|
10
|
+
index: {
|
|
11
|
+
type: DataTypes.INTEGER,
|
|
12
|
+
allowNull: false
|
|
13
|
+
},
|
|
14
|
+
match_id: {
|
|
15
|
+
type: DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
references: {
|
|
18
|
+
model: 'Match',
|
|
19
|
+
key: 'match_id'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
stage: {
|
|
23
|
+
type: DataTypes.ARRAY(DataTypes.ENUM('ROUND_OF_8', 'QUARTERFINALS', 'SEMIFINALS', 'FINAL')),
|
|
24
|
+
allowNull: false
|
|
25
|
+
},
|
|
26
|
+
}, {
|
|
27
|
+
sequelize,
|
|
28
|
+
tableName: 'TournamentMatch',
|
|
29
|
+
schema: 'public',
|
|
30
|
+
timestamps: false,
|
|
31
|
+
indexes: [
|
|
32
|
+
{
|
|
33
|
+
name: 'TournamentMatch_pk',
|
|
34
|
+
unique: true,
|
|
35
|
+
fields: [
|
|
36
|
+
{ name: 'tournament_id' },
|
|
37
|
+
{ name: 'match_id' },
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { TournamentMatch } from '../../service/tournament/tournament-match';
|
|
4
|
+
import { TournamentMatchId, TournamentMatchModel } from './tournament-match';
|
|
5
|
+
import { TeamId, TeamModel } from './team';
|
|
6
|
+
export interface TournamentAttributes {
|
|
7
|
+
tournament_id: string;
|
|
8
|
+
iteration: number;
|
|
9
|
+
matches?: TournamentMatch[];
|
|
10
|
+
champion?: string;
|
|
11
|
+
}
|
|
12
|
+
export type TournamentPk = 'tournament_id';
|
|
13
|
+
export type TournamentId = TournamentModel[TournamentPk];
|
|
14
|
+
export type TournamentCreationAttributes = TournamentAttributes;
|
|
15
|
+
export declare class TournamentModel extends Model<TournamentAttributes, TournamentCreationAttributes> implements TournamentAttributes {
|
|
16
|
+
tournament_id: string;
|
|
17
|
+
iteration: number;
|
|
18
|
+
Matches: TournamentMatchModel[];
|
|
19
|
+
getMatches: Sequelize.HasManyGetAssociationsMixin<TournamentMatchModel>;
|
|
20
|
+
setMatches: Sequelize.HasManySetAssociationsMixin<TournamentMatchModel, TournamentMatchId>;
|
|
21
|
+
addMatch: Sequelize.HasManyAddAssociationMixin<TournamentMatchModel, TournamentMatchId>;
|
|
22
|
+
addMatches: Sequelize.HasManyAddAssociationsMixin<TournamentMatchModel, TournamentMatchId>;
|
|
23
|
+
createMatch: Sequelize.HasManyCreateAssociationMixin<TournamentMatchModel>;
|
|
24
|
+
removeMatch: Sequelize.HasManyRemoveAssociationMixin<TournamentMatchModel, TournamentMatchId>;
|
|
25
|
+
removeMatches: Sequelize.HasManyRemoveAssociationsMixin<TournamentMatchModel, TournamentMatchId>;
|
|
26
|
+
hasMatch: Sequelize.HasManyHasAssociationMixin<TournamentMatchModel, TournamentMatchId>;
|
|
27
|
+
hasMatches: Sequelize.HasManyHasAssociationsMixin<TournamentMatchModel, TournamentMatchId>;
|
|
28
|
+
countMatches: Sequelize.HasManyCountAssociationsMixin;
|
|
29
|
+
Champion: TeamModel;
|
|
30
|
+
getChampion: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
|
|
31
|
+
setChampion: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
|
|
32
|
+
createChampion: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
|
|
33
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof TournamentModel;
|
|
34
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class TournamentModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return TournamentModel.init({
|
|
5
|
+
tournament_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true
|
|
9
|
+
},
|
|
10
|
+
iteration: {
|
|
11
|
+
type: DataTypes.INTEGER,
|
|
12
|
+
allowNull: false
|
|
13
|
+
},
|
|
14
|
+
champion: {
|
|
15
|
+
type: DataTypes.UUID,
|
|
16
|
+
allowNull: true,
|
|
17
|
+
references: {
|
|
18
|
+
model: 'Team',
|
|
19
|
+
key: 'team_id'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
sequelize,
|
|
24
|
+
tableName: 'Tournament',
|
|
25
|
+
schema: 'public',
|
|
26
|
+
timestamps: false,
|
|
27
|
+
indexes: [
|
|
28
|
+
{
|
|
29
|
+
name: 'Tournament_pk',
|
|
30
|
+
unique: true,
|
|
31
|
+
fields: [
|
|
32
|
+
{ name: 'tournament_id' }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -7,6 +7,8 @@ import { transformFromEventType, transformToEventType } from './event-type';
|
|
|
7
7
|
import { transformFromFormation, transformToFormation } from './formation';
|
|
8
8
|
import { transformFromLeague, transformToLeague } from './league';
|
|
9
9
|
import { transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement } from './libero-replacement';
|
|
10
|
+
import { transformFromTournament, transformToAPITournament, transformToTournament } from './tournament';
|
|
11
|
+
import { transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch } from './tournament-match';
|
|
10
12
|
import { transformFromMatch, transformToAPIMatch, transformToMatch } from './match';
|
|
11
13
|
import { transformFromMatchSet, transformToAPIMatchSet, transformToMatchSet } from './match-set';
|
|
12
14
|
import { transformFromMatchSetStats, transformToAPIMatchSetStats, transformToMatchSetStats } from './match-set-stats';
|
|
@@ -24,4 +26,4 @@ import { transformFromSpike, transformToAPISpike, transformToSpike } from './spi
|
|
|
24
26
|
import { transformFromSubstitution, transformToAPISubstitution, transformToSubstitution } from './substitution';
|
|
25
27
|
import { transformFromTeam, transformToAPITeam, transformToTeam } from './team';
|
|
26
28
|
import { transformFromTrait, transformToAPITrait, transformToTrait } from './trait';
|
|
27
|
-
export { transformFromBlock, transformToAPICoach, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait };
|
|
29
|
+
export { transformFromTournament, transformToAPITournament, transformToTournament, transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, transformFromBlock, transformToAPICoach, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait };
|
|
@@ -7,6 +7,8 @@ import { transformFromEventType, transformToEventType } from './event-type';
|
|
|
7
7
|
import { transformFromFormation, transformToFormation } from './formation';
|
|
8
8
|
import { transformFromLeague, transformToLeague, } from './league';
|
|
9
9
|
import { transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement } from './libero-replacement';
|
|
10
|
+
import { transformFromTournament, transformToAPITournament, transformToTournament } from './tournament';
|
|
11
|
+
import { transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, } from './tournament-match';
|
|
10
12
|
import { transformFromMatch, transformToAPIMatch, transformToMatch } from './match';
|
|
11
13
|
import { transformFromMatchSet, transformToAPIMatchSet, transformToMatchSet } from './match-set';
|
|
12
14
|
import { transformFromMatchSetStats, transformToAPIMatchSetStats, transformToMatchSetStats } from './match-set-stats';
|
|
@@ -24,4 +26,4 @@ import { transformFromSpike, transformToAPISpike, transformToSpike } from './spi
|
|
|
24
26
|
import { transformFromSubstitution, transformToAPISubstitution, transformToSubstitution } from './substitution';
|
|
25
27
|
import { transformFromTeam, transformToAPITeam, transformToTeam } from './team';
|
|
26
28
|
import { transformFromTrait, transformToAPITrait, transformToTrait } from './trait';
|
|
27
|
-
export { transformFromBlock, transformToAPICoach, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait };
|
|
29
|
+
export { transformFromTournament, transformToAPITournament, transformToTournament, transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, transformFromBlock, transformToAPICoach, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait };
|
|
@@ -6,7 +6,8 @@ function transformToAttributes(season, leagueId) {
|
|
|
6
6
|
return {
|
|
7
7
|
season_id: season.id,
|
|
8
8
|
iteration: season.iteration,
|
|
9
|
-
league_id: leagueId
|
|
9
|
+
league_id: leagueId,
|
|
10
|
+
champion: season.champion != null ? season.champion.id : undefined
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
function transformToObject(model) {
|
|
@@ -15,6 +16,7 @@ function transformToObject(model) {
|
|
|
15
16
|
matches: model.Matches != null ? model.Matches.map(transformToMatch) : [],
|
|
16
17
|
iteration: model.iteration,
|
|
17
18
|
teams: model.seasonTeams != null ? model.seasonTeams.map(transformToTeam) : [],
|
|
19
|
+
champion: model.Champion != null ? transformToTeam(model.Champion) : undefined
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
function transformToAPIObject(model) {
|
|
@@ -25,7 +27,8 @@ function transformToAPIObject(model) {
|
|
|
25
27
|
iteration: model.iteration,
|
|
26
28
|
teams: model.seasonTeams != null ? model.seasonTeams.map(transformToAPITeam) : [],
|
|
27
29
|
league: transformToLeague(model.league),
|
|
28
|
-
standings: season.standings
|
|
30
|
+
standings: season.standings,
|
|
31
|
+
champion: model.Champion != null ? transformToAPITeam(model.Champion) : undefined
|
|
29
32
|
};
|
|
30
33
|
}
|
|
31
34
|
export { transformToObject as transformToSeason, transformToAPIObject as transformToAPISeason, transformToAttributes as transformFromSeason };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TournamentMatchAttributes, TournamentMatchModel } from '../models';
|
|
2
|
+
import { Tournament, TournamentMatch } from '../../service';
|
|
3
|
+
import { APITournamentMatch } from '../../routing';
|
|
4
|
+
declare function transformToAttributes(match: TournamentMatch, tournament: Tournament): TournamentMatchAttributes;
|
|
5
|
+
declare function transformToObject(model: TournamentMatchModel): TournamentMatch;
|
|
6
|
+
declare function transformToAPIObject(model: TournamentMatchModel): APITournamentMatch;
|
|
7
|
+
export { transformToObject as transformToTournamentMatch, transformToAPIObject as transformToAPITournamentMatch, transformToAttributes as transformFromTournamentMatch };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Stage, TournamentMatch } from '../../service';
|
|
2
|
+
import { transformToMatch } from './match';
|
|
3
|
+
function transformToStage(stage) {
|
|
4
|
+
switch (stage) {
|
|
5
|
+
case Stage.ROUND_OF_8:
|
|
6
|
+
return 'ROUND_OF_8';
|
|
7
|
+
case Stage.QUARTERFINALS:
|
|
8
|
+
return 'QUARTERFINALS';
|
|
9
|
+
case Stage.SEMIFINALS:
|
|
10
|
+
return 'SEMIFINALS';
|
|
11
|
+
case Stage.FINAL:
|
|
12
|
+
return 'FINAL';
|
|
13
|
+
default:
|
|
14
|
+
throw new Error('UNKNOWN_ROLE');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function transformFromStage(s) {
|
|
18
|
+
return Stage[s];
|
|
19
|
+
}
|
|
20
|
+
function transformToAttributes(match, tournament) {
|
|
21
|
+
return {
|
|
22
|
+
tournament_id: tournament.id,
|
|
23
|
+
match_id: match.match.id,
|
|
24
|
+
index: match.index,
|
|
25
|
+
stage: transformToStage(match.stage)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function transformToObject(model) {
|
|
29
|
+
return new TournamentMatch({
|
|
30
|
+
stage: transformFromStage(model.stage),
|
|
31
|
+
match: transformToMatch(model.match),
|
|
32
|
+
index: model.index
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function transformToAPIObject(model) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
export { transformToObject as transformToTournamentMatch, transformToAPIObject as transformToAPITournamentMatch, transformToAttributes as transformFromTournamentMatch };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TournamentAttributes, TournamentModel } from '../models';
|
|
2
|
+
import { Tournament } from '../../service';
|
|
3
|
+
import { APITournament } from '../../routing';
|
|
4
|
+
declare function transformToAttributes(tournament: Tournament): TournamentAttributes;
|
|
5
|
+
declare function transformToObject(model: TournamentModel): Tournament;
|
|
6
|
+
declare function transformToAPIObject(model: TournamentModel): APITournament;
|
|
7
|
+
export { transformToObject as transformToTournament, transformToAPIObject as transformToAPITournament, transformToAttributes as transformFromTournament };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { transformToTeam } from './team';
|
|
2
|
+
import { Tournament } from '../../service';
|
|
3
|
+
import { transformToTournamentMatch } from './tournament-match';
|
|
4
|
+
function transformToAttributes(tournament) {
|
|
5
|
+
return {
|
|
6
|
+
tournament_id: tournament.id,
|
|
7
|
+
iteration: tournament.iteration,
|
|
8
|
+
matches: tournament.matches != null ? tournament.matches : [],
|
|
9
|
+
champion: tournament.champion != null ? tournament.champion.id : undefined
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function transformToObject(model) {
|
|
13
|
+
return new Tournament({
|
|
14
|
+
id: model.tournament_id,
|
|
15
|
+
iteration: model.iteration,
|
|
16
|
+
matches: model.Matches.map(transformToTournamentMatch),
|
|
17
|
+
champion: model.Champion != null ? transformToTeam(model.Champion) : undefined
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function transformToAPIObject(model) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
export { transformToObject as transformToTournament, transformToAPIObject as transformToAPITournament, transformToAttributes as transformFromTournament };
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Block, BlockFailure, BlockType, Coach, CoachOpts, Country, CountryOpts, CourtPosition, CourtRow, CourtTarget, EventStat, EventType, Formation, formatNumber, GeneralStat, generateModifier, getKeys, getRandomEnumValue, InPlayEvent, InPlayEventOpts, League, LeagueOpts, LiberoReplacement, LiberoReplacementOpts, LiberoReplacementType, Match, MatchSet, MatchSetOpts, MatchSetState, MatchTeam, Name, PerformanceStats, PerformanceStatsOpts, Player, PlayerOpts, PlayerPosition, Rally, RallyEvent, RallyEventOpts, RallyState, randomNumber, Reception, ReceptionFailure, ReceptionType, Role, Score, Season, SeasonOpts, Serve, ServeFailure, ServeType, Set, SetFailure, SetStatistics, SetType, shuffle, Spike, SpikeFailure, SpikeType, Standing, StandingOpts, Stat, SubPriority, Substitution, SubstitutionOpts, Team, TeamOpts, Trait, validateUUID } from './service';
|
|
2
|
-
import { APIBlock, APICoach, APIEvent, APIInPlayEvent, APILeague, APILiberoReplacement, APIMatch, APIMatchSet, APIPlayer, APIRally, APIReception, APIScore, APISeason, APIServe, APISet, APISetStatistics, APISpike, APISubstitution, APITeam, APITrait } from './routing';
|
|
3
|
-
import { BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, initModels, LeagueAttributes, LeagueCreationAttributes, LeagueId, LeagueModel, LeaguePk, LiberoReplacementAttributes, LiberoReplacementCreationAttributes, LiberoReplacementId, LiberoReplacementModel, LiberoReplacementPk, MatchAttributes, MatchCreationAttributes, MatchId, MatchModel, MatchPk, MatchSetAttributes, MatchSetCreationAttributes, MatchSetId, MatchSetModel, MatchSetOptionalAttributes, MatchSetPk, MatchSetStatsAttributes, MatchSetStatsCreationAttributes, MatchSetStatsId, MatchSetStatsModel, MatchSetStatsOptionalAttributes, MatchSetStatsPk, PerformanceStatsAttributes, PerformanceStatsCreationAttributes, PerformanceStatsId, PerformanceStatsModel, PerformanceStatsOptionalAttributes, PerformanceStatsPk, PlayerAttributes, PlayerCreationAttributes, PlayerId, PlayerModel, PlayerPk, RallyAttributes, RallyCreationAttributes, RallyId, RallyModel, RallyPk, RallyPositionAttributes, RallyPositionCreationAttributes, RallyPositionId, RallyPositionModel, RallyPositionPk, ReceptionAttributes, ReceptionCreationAttributes, ReceptionId, ReceptionModel, ReceptionPk, RoleType, ScoreAttributes, ScoreCreationAttributes, ScoreId, ScoreModel, ScorePk, SeasonAttributes, SeasonCreationAttributes, SeasonId, SeasonModel, SeasonPk, SeasonTeamsAttributes, SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsModel, SeasonTeamsPk, ServeAttributes, ServeCreationAttributes, ServeId, ServeModel, ServePk, SetAttributes, SetCreationAttributes, SetId, SetModel, SetPk, SpikeAttributes, SpikeCreationAttributes, SpikeId, SpikeModel, SpikePk, SubstitutionAttributes, SubstitutionCreationAttributes, SubstitutionId, SubstitutionModel, SubstitutionPk, TeamAttributes, TeamCreationAttributes, TeamId, TeamModel, TeamPk, TraitType, transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformToAPICoach, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait } from './data';
|
|
4
|
-
export { League, Standing, LeagueOpts, CountryOpts, SeasonOpts, Season, StandingOpts, Country, CoachOpts, Coach, Role, SubPriority, GeneralStat, PerformanceStats, Formation, Stat, PerformanceStatsOpts, Block, EventType, LiberoReplacement, MatchSet, Rally, RallyEvent, Reception, Score, Serve, Set, Spike, Substitution, BlockType, LiberoReplacementType, BlockFailure, MatchSetState, MatchSetOpts, LiberoReplacementOpts, RallyEventOpts, InPlayEventOpts, EventStat, Match, InPlayEvent, CourtRow, CourtPosition, CourtTarget, formatNumber, generateModifier, getKeys, MatchTeam, Name, PlayerOpts, Player, RallyState, PlayerPosition, randomNumber, ReceptionType, ServeFailure, ServeType, SetFailure, SetStatistics, SetType, ReceptionFailure, SpikeFailure, SpikeType, SubstitutionOpts, Team, shuffle, TeamOpts, Trait, getRandomEnumValue, validateUUID, APIBlock, APICoach, APIEvent, APILiberoReplacement, APIRally, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution, APILeague, APIMatch, APIInPlayEvent, APIMatchSet, APIPlayer, APISeason, APITeam, APITrait, APISetStatistics, initModels, BlockId, BlockModel, RallyModel, RallyId, EventId, EventModel, MatchSetId, MatchSetModel, PerformanceStatsModel, PerformanceStatsId, BlockAttributes, LiberoReplacementId, LiberoReplacementModel, BlockPk, MatchSetStatsId, MatchSetStatsModel, BlockCreationAttributes, ReceptionId, ReceptionModel, BlockOptionalAttributes, CoachAttributes, CoachId, CountryId, CountryModel, CoachCreationAttributes, CoachPk, ScoreId, ScoreModel, CoachModel, RallyPositionId, RallyPositionModel, CoachOptionalAttributes, CountryAttributes, CountryCreationAttributes, CountryPk, EventAttributes, EventPk, EventCreationAttributes, LeagueAttributes, LeagueId, LeagueCreationAttributes, LeagueModel, LeaguePk, LiberoReplacementAttributes, LiberoReplacementCreationAttributes, LiberoReplacementPk, MatchAttributes, MatchId, MatchPk, MatchCreationAttributes, MatchModel, MatchSetAttributes, MatchSetCreationAttributes, MatchSetOptionalAttributes, MatchSetPk, MatchSetStatsAttributes, MatchSetStatsCreationAttributes, MatchSetStatsOptionalAttributes, transformToAPICoach, MatchSetStatsPk, PerformanceStatsAttributes, PerformanceStatsCreationAttributes, PerformanceStatsOptionalAttributes, PerformanceStatsPk, PlayerCreationAttributes, PlayerAttributes, PlayerId, PlayerPk, RallyCreationAttributes, RallyAttributes, RallyPositionAttributes, RallyPositionCreationAttributes, RallyPk, RallyPositionPk, ReceptionCreationAttributes, ReceptionAttributes, ReceptionPk, ScoreCreationAttributes, ScoreAttributes, ScorePk, SeasonCreationAttributes, SeasonAttributes, SeasonId, SeasonTeamsAttributes, PlayerModel, SeasonPk, SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsModel, SeasonModel, SeasonTeamsPk, ServeCreationAttributes, ServeAttributes, ServeId, ServeModel, SetAttributes, ServePk, SetId, SetModel, SetPk, SetCreationAttributes, SpikeCreationAttributes, SpikeAttributes, SpikeId, SpikeModel, SpikePk, SubstitutionCreationAttributes, SubstitutionAttributes, TeamAttributes, TeamId, TeamModel, TeamPk, SubstitutionId, SubstitutionModel, TeamCreationAttributes, SubstitutionPk, RoleType, TraitType, transformFromBlock, transformToAPIBlock, transformToBlock, transformFromCoach, transformFromCountry, transformFromRally, transformToAPIReception, transformToReception, transformToAPIScore, transformToScore, transformFromFormation, transformFromMatch, transformToAPISet, transformToSet, transformFromMatchSet, transformFromMatchSetStats, transformFromLeague, transformFromPlayer, transformFromPlayerPosition, transformToPlayerPosition, transformFromCourtPosition, transformFromCourtTarget, transformFromPerformanceStats, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromEventType, transformFromServe, transformToAPIServe, transformToServe, transformFromSet, transformFromSpike, transformToAPISpike, transformToSpike, transformFromSubstitution, transformToAPISubstitution, transformToSubstitution, transformFromTeam, transformFromTrait, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPISeason, transformToAPITeam, transformToAPITrait, transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement, transformToCoach, transformToCountry, transformToEventType, transformToMatchSet, transformToCourtPosition, transformToCourtTarget, transformToFormation, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToRally, transformToMatch, transformToSeason, transformToTeam, transformToTrait, transformToLeague, transformToRole };
|
|
1
|
+
import { Block, BlockFailure, BlockType, Coach, CoachOpts, Country, CountryOpts, CourtPosition, CourtRow, CourtTarget, EventStat, EventType, Formation, formatNumber, GeneralStat, generateModifier, getKeys, getRandomEnumValue, InPlayEvent, InPlayEventOpts, League, LeagueOpts, LiberoReplacement, LiberoReplacementOpts, LiberoReplacementType, Match, MatchSet, MatchSetOpts, MatchSetState, MatchTeam, Name, PerformanceStats, PerformanceStatsOpts, Player, PlayerOpts, PlayerPosition, Rally, RallyEvent, RallyEventOpts, RallyState, randomNumber, Reception, ReceptionFailure, ReceptionType, Role, Score, Season, SeasonOpts, Serve, ServeFailure, ServeType, Set, SetFailure, SetStatistics, SetType, shuffle, Spike, SpikeFailure, SpikeType, Stage, Standing, StandingOpts, Stat, SubPriority, Substitution, SubstitutionOpts, Team, TeamOpts, Tournament, TournamentMatch, TournamentOpts, TournamentStageOpts, Trait, validateUUID } from './service';
|
|
2
|
+
import { APIBlock, APICoach, APIEvent, APIInPlayEvent, APILeague, APILiberoReplacement, APIMatch, APIMatchSet, APIPlayer, APIRally, APIReception, APIScore, APISeason, APIServe, APISet, APISetStatistics, APISpike, APISubstitution, APITeam, APITournament, APITournamentMatch, APITrait } from './routing';
|
|
3
|
+
import { BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, initModels, LeagueAttributes, LeagueCreationAttributes, LeagueId, LeagueModel, LeaguePk, LiberoReplacementAttributes, LiberoReplacementCreationAttributes, LiberoReplacementId, LiberoReplacementModel, LiberoReplacementPk, MatchAttributes, MatchCreationAttributes, MatchId, MatchModel, MatchPk, MatchSetAttributes, MatchSetCreationAttributes, MatchSetId, MatchSetModel, MatchSetOptionalAttributes, MatchSetPk, MatchSetStatsAttributes, MatchSetStatsCreationAttributes, MatchSetStatsId, MatchSetStatsModel, MatchSetStatsOptionalAttributes, MatchSetStatsPk, PerformanceStatsAttributes, PerformanceStatsCreationAttributes, PerformanceStatsId, PerformanceStatsModel, PerformanceStatsOptionalAttributes, PerformanceStatsPk, PlayerAttributes, PlayerCreationAttributes, PlayerId, PlayerModel, PlayerPk, RallyAttributes, RallyCreationAttributes, RallyId, RallyModel, RallyPk, RallyPositionAttributes, RallyPositionCreationAttributes, RallyPositionId, RallyPositionModel, RallyPositionPk, ReceptionAttributes, ReceptionCreationAttributes, ReceptionId, ReceptionModel, ReceptionPk, RoleType, ScoreAttributes, ScoreCreationAttributes, ScoreId, ScoreModel, ScorePk, SeasonAttributes, SeasonCreationAttributes, SeasonId, SeasonModel, SeasonPk, SeasonTeamsAttributes, SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsModel, SeasonTeamsPk, ServeAttributes, ServeCreationAttributes, ServeId, ServeModel, ServePk, SetAttributes, SetCreationAttributes, SetId, SetModel, SetPk, SpikeAttributes, SpikeCreationAttributes, SpikeId, SpikeModel, SpikePk, SubstitutionAttributes, SubstitutionCreationAttributes, SubstitutionId, SubstitutionModel, SubstitutionPk, TeamAttributes, TeamCreationAttributes, TeamId, TeamModel, TeamPk, TournamentAttributes, TournamentCreationAttributes, TournamentId, TournamentMatchAttributes, TournamentMatchCreationAttributes, TournamentMatchId, TournamentMatchModel, TournamentMatchPk, TournamentModel, TournamentPk, TournamentStage, TraitType, transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTournament, transformFromTournamentMatch, transformFromTrait, transformToAPIBlock, transformToAPICoach, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITournament, transformToAPITournamentMatch, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTournament, transformToTournamentMatch, transformToTrait } from './data';
|
|
4
|
+
export { League, Standing, LeagueOpts, CountryOpts, SeasonOpts, Season, StandingOpts, Country, CoachOpts, Coach, Role, SubPriority, GeneralStat, PerformanceStats, Formation, Stat, PerformanceStatsOpts, Block, EventType, LiberoReplacement, MatchSet, Rally, RallyEvent, Reception, Score, Serve, Set, Spike, Substitution, BlockType, LiberoReplacementType, BlockFailure, MatchSetState, MatchSetOpts, LiberoReplacementOpts, RallyEventOpts, InPlayEventOpts, EventStat, Match, InPlayEvent, CourtRow, CourtPosition, CourtTarget, formatNumber, generateModifier, getKeys, MatchTeam, Name, PlayerOpts, Player, RallyState, PlayerPosition, randomNumber, ReceptionType, ServeFailure, ServeType, SetFailure, SetStatistics, SetType, ReceptionFailure, SpikeFailure, SpikeType, SubstitutionOpts, Team, shuffle, TeamOpts, Trait, getRandomEnumValue, validateUUID, APIBlock, APICoach, APIEvent, APILiberoReplacement, APIRally, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution, APILeague, APIMatch, APIInPlayEvent, APIMatchSet, APIPlayer, APISeason, APITeam, APITrait, APITournament, APITournamentMatch, APISetStatistics, initModels, BlockId, BlockModel, RallyModel, RallyId, EventId, EventModel, MatchSetId, MatchSetModel, PerformanceStatsModel, PerformanceStatsId, BlockAttributes, LiberoReplacementId, LiberoReplacementModel, BlockPk, MatchSetStatsId, MatchSetStatsModel, BlockCreationAttributes, ReceptionId, ReceptionModel, BlockOptionalAttributes, CoachAttributes, CoachId, CountryId, CountryModel, CoachCreationAttributes, CoachPk, ScoreId, ScoreModel, CoachModel, RallyPositionId, RallyPositionModel, CoachOptionalAttributes, CountryAttributes, CountryCreationAttributes, CountryPk, EventAttributes, EventPk, EventCreationAttributes, LeagueAttributes, LeagueId, LeagueCreationAttributes, LeagueModel, LeaguePk, LiberoReplacementAttributes, LiberoReplacementCreationAttributes, LiberoReplacementPk, MatchAttributes, MatchId, MatchPk, MatchCreationAttributes, MatchModel, MatchSetAttributes, MatchSetCreationAttributes, MatchSetOptionalAttributes, MatchSetPk, MatchSetStatsAttributes, MatchSetStatsCreationAttributes, MatchSetStatsOptionalAttributes, transformToAPICoach, MatchSetStatsPk, PerformanceStatsAttributes, PerformanceStatsCreationAttributes, PerformanceStatsOptionalAttributes, PerformanceStatsPk, PlayerCreationAttributes, PlayerAttributes, PlayerId, PlayerPk, RallyCreationAttributes, RallyAttributes, RallyPositionAttributes, RallyPositionCreationAttributes, RallyPk, RallyPositionPk, ReceptionCreationAttributes, ReceptionAttributes, ReceptionPk, ScoreCreationAttributes, ScoreAttributes, ScorePk, SeasonCreationAttributes, SeasonAttributes, SeasonId, SeasonTeamsAttributes, PlayerModel, SeasonPk, SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsModel, SeasonModel, SeasonTeamsPk, ServeCreationAttributes, ServeAttributes, ServeId, ServeModel, SetAttributes, ServePk, SetId, SetModel, SetPk, SetCreationAttributes, SpikeCreationAttributes, SpikeAttributes, SpikeId, SpikeModel, SpikePk, SubstitutionCreationAttributes, SubstitutionAttributes, TeamAttributes, TeamId, TeamModel, TeamPk, SubstitutionId, SubstitutionModel, TeamCreationAttributes, SubstitutionPk, RoleType, TraitType, TournamentAttributes, TournamentCreationAttributes, TournamentId, TournamentModel, TournamentPk, TournamentMatchAttributes, TournamentMatchModel, TournamentMatchCreationAttributes, TournamentMatchId, TournamentMatchPk, TournamentStage, transformFromBlock, transformToAPIBlock, transformToBlock, transformFromCoach, transformFromCountry, transformFromRally, transformToAPIReception, transformToReception, transformToAPIScore, transformToScore, transformFromFormation, transformFromMatch, transformToAPISet, transformToSet, transformFromMatchSet, transformFromMatchSetStats, transformFromLeague, transformFromPlayer, transformFromPlayerPosition, transformToPlayerPosition, transformFromCourtPosition, transformFromCourtTarget, transformFromPerformanceStats, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromEventType, transformFromServe, transformToAPIServe, transformToServe, transformFromSet, transformFromSpike, transformToAPISpike, transformToSpike, transformFromSubstitution, transformToAPISubstitution, transformToSubstitution, transformFromTeam, transformFromTrait, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPISeason, transformToAPITeam, transformToAPITrait, transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement, transformToCoach, transformToCountry, transformToEventType, transformToMatchSet, transformToCourtPosition, transformToCourtTarget, transformToFormation, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToRally, transformToMatch, transformToSeason, transformToTeam, transformToTrait, transformToLeague, transformToRole, transformFromTournament, transformToAPITournament, transformToTournament, transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, Stage, TournamentStageOpts, TournamentMatch, Tournament, TournamentOpts, };
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { 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 } from './service';
|
|
1
|
+
import { 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, Stage, Standing, Substitution, Team, Tournament, TournamentMatch, Trait, validateUUID } from './service';
|
|
2
2
|
import { APITrait } from './routing';
|
|
3
|
-
import { BlockModel, CoachModel, CountryModel, EventModel, initModels, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformToAPICoach, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait } from './data';
|
|
4
|
-
export { League, Standing, Season, Country, Coach, Role, GeneralStat, PerformanceStats, Formation, Block, EventType, LiberoReplacement, MatchSet, Rally, RallyEvent, Reception, Score, Serve, Set, Spike, Substitution, BlockType, LiberoReplacementType, BlockFailure, MatchSetState, Match, InPlayEvent, CourtRow, CourtPosition, CourtTarget, formatNumber, generateModifier, getKeys, MatchTeam, Player, RallyState, randomNumber, ReceptionType, ServeFailure, ServeType, SetFailure, SetType, ReceptionFailure, SpikeFailure, SpikeType, Team, shuffle, Trait, getRandomEnumValue, validateUUID, APITrait, initModels, BlockModel, RallyModel, EventModel, MatchSetModel, PerformanceStatsModel, LiberoReplacementModel, MatchSetStatsModel, ReceptionModel, CountryModel, ScoreModel, CoachModel, RallyPositionModel, LeagueModel, MatchModel, transformToAPICoach, PlayerModel, SeasonTeamsModel, SeasonModel, ServeModel, SetModel, SpikeModel, TeamModel, SubstitutionModel, transformFromBlock, transformToAPIBlock, transformToBlock, transformFromCoach, transformFromCountry, transformFromRally, transformToAPIReception, transformToReception, transformToAPIScore, transformToScore, transformFromFormation, transformFromMatch, transformToAPISet, transformToSet, transformFromMatchSet, transformFromMatchSetStats, transformFromLeague, transformFromPlayer, transformFromPlayerPosition, transformToPlayerPosition, transformFromCourtPosition, transformFromCourtTarget, transformFromPerformanceStats, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromEventType, transformFromServe, transformToAPIServe, transformToServe, transformFromSet, transformFromSpike, transformToAPISpike, transformToSpike, transformFromSubstitution, transformToAPISubstitution, transformToSubstitution, transformFromTeam, transformFromTrait, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPISeason, transformToAPITeam, transformToAPITrait, transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement, transformToCoach, transformToCountry, transformToEventType, transformToMatchSet, transformToCourtPosition, transformToCourtTarget, transformToFormation, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToRally, transformToMatch, transformToSeason, transformToTeam, transformToTrait, transformToLeague, transformToRole };
|
|
3
|
+
import { BlockModel, CoachModel, CountryModel, EventModel, initModels, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, TournamentMatchModel, TournamentModel, transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTournament, transformFromTournamentMatch, transformFromTrait, transformToAPIBlock, transformToAPICoach, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITournament, transformToAPITournamentMatch, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTournament, transformToTournamentMatch, transformToTrait } from './data';
|
|
4
|
+
export { League, Standing, Season, Country, Coach, Role, GeneralStat, PerformanceStats, Formation, Block, EventType, LiberoReplacement, MatchSet, Rally, RallyEvent, Reception, Score, Serve, Set, Spike, Substitution, BlockType, LiberoReplacementType, BlockFailure, MatchSetState, Match, InPlayEvent, CourtRow, CourtPosition, CourtTarget, formatNumber, generateModifier, getKeys, MatchTeam, Player, RallyState, randomNumber, ReceptionType, ServeFailure, ServeType, SetFailure, SetType, ReceptionFailure, SpikeFailure, SpikeType, Team, shuffle, Trait, getRandomEnumValue, validateUUID, APITrait, initModels, BlockModel, RallyModel, EventModel, MatchSetModel, PerformanceStatsModel, LiberoReplacementModel, MatchSetStatsModel, ReceptionModel, CountryModel, ScoreModel, CoachModel, RallyPositionModel, LeagueModel, MatchModel, transformToAPICoach, PlayerModel, SeasonTeamsModel, SeasonModel, ServeModel, SetModel, SpikeModel, TeamModel, SubstitutionModel, TournamentModel, TournamentMatchModel, transformFromBlock, transformToAPIBlock, transformToBlock, transformFromCoach, transformFromCountry, transformFromRally, transformToAPIReception, transformToReception, transformToAPIScore, transformToScore, transformFromFormation, transformFromMatch, transformToAPISet, transformToSet, transformFromMatchSet, transformFromMatchSetStats, transformFromLeague, transformFromPlayer, transformFromPlayerPosition, transformToPlayerPosition, transformFromCourtPosition, transformFromCourtTarget, transformFromPerformanceStats, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromEventType, transformFromServe, transformToAPIServe, transformToServe, transformFromSet, transformFromSpike, transformToAPISpike, transformToSpike, transformFromSubstitution, transformToAPISubstitution, transformToSubstitution, transformFromTeam, transformFromTrait, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPISeason, transformToAPITeam, transformToAPITrait, transformFromLiberoReplacement, transformToAPILiberoReplacement, transformToLiberoReplacement, transformToCoach, transformToCountry, transformToEventType, transformToMatchSet, transformToCourtPosition, transformToCourtTarget, transformToFormation, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToRally, transformToMatch, transformToSeason, transformToTeam, transformToTrait, transformToLeague, transformToRole, transformFromTournament, transformToAPITournament, transformToTournament, transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, Stage, TournamentMatch, Tournament, };
|
|
@@ -4,4 +4,6 @@ import { APIMatch, APIMatchSet, APIRally, APISetStatistics } from './match';
|
|
|
4
4
|
import { APIPlayer, APITrait } from './player';
|
|
5
5
|
import { APITeam } from './team';
|
|
6
6
|
import { APICoach } from './coach';
|
|
7
|
-
|
|
7
|
+
import { APITournament } from './tournament';
|
|
8
|
+
import { APITournamentMatch } from './tournament';
|
|
9
|
+
export { APICoach, APITeam, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution, APIMatchSet, APISetStatistics, APIInPlayEvent, APILeague, APIMatch, APIPlayer, APISeason, APIEvent, APILiberoReplacement, APIBlock, APITrait, APIRally, APITournament, APITournamentMatch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,5 +14,6 @@ import { Spike, SpikeFailure, SpikeType } from './event/spike';
|
|
|
14
14
|
import { Block, BlockFailure, BlockType } from './event/block';
|
|
15
15
|
import { GeneralStat, Name, PerformanceStats, PerformanceStatsOpts, Player, PlayerOpts, Role, Stat, Trait } from './player';
|
|
16
16
|
import { League, LeagueOpts, Season, SeasonOpts, Standing, StandingOpts } from './league';
|
|
17
|
+
import { Stage, Tournament, TournamentMatch, TournamentOpts, TournamentStageOpts } from './tournament';
|
|
17
18
|
import { formatNumber, generateModifier, getKeys, getRandomEnumValue, randomNumber, shuffle, validateUUID } from './utils';
|
|
18
|
-
export { Block, BlockFailure, BlockType, Coach, CoachOpts, Country, CountryOpts, CourtPosition, CourtRow, CourtTarget, EventStat, EventType, Formation, formatNumber, GeneralStat, generateModifier, getKeys, getRandomEnumValue, InPlayEvent, InPlayEventOpts, League, LeagueOpts, LiberoReplacement, LiberoReplacementOpts, LiberoReplacementType, Match, MatchSet, MatchSetOpts, MatchSetState, MatchTeam, Name, PerformanceStats, PerformanceStatsOpts, Player, PlayerOpts, PlayerPosition, Rally, RallyEvent, RallyEventOpts, RallyState, randomNumber, Reception, ReceptionFailure, ReceptionType, Role, Score, Season, SeasonOpts, Serve, ServeFailure, ServeType, Set, SetFailure, SetStatistics, SetType, shuffle, Spike, SpikeFailure, SpikeType, Standing, StandingOpts, Stat, SubPriority, Substitution, SubstitutionOpts, Team, TeamOpts, Trait, validateUUID };
|
|
19
|
+
export { Stage, TournamentStageOpts, TournamentMatch, Tournament, TournamentOpts, Block, BlockFailure, BlockType, Coach, CoachOpts, Country, CountryOpts, CourtPosition, CourtRow, CourtTarget, EventStat, EventType, Formation, formatNumber, GeneralStat, generateModifier, getKeys, getRandomEnumValue, InPlayEvent, InPlayEventOpts, League, LeagueOpts, LiberoReplacement, LiberoReplacementOpts, LiberoReplacementType, Match, MatchSet, MatchSetOpts, MatchSetState, MatchTeam, Name, PerformanceStats, PerformanceStatsOpts, Player, PlayerOpts, PlayerPosition, Rally, RallyEvent, RallyEventOpts, RallyState, randomNumber, Reception, ReceptionFailure, ReceptionType, Role, Score, Season, SeasonOpts, Serve, ServeFailure, ServeType, Set, SetFailure, SetStatistics, SetType, shuffle, Spike, SpikeFailure, SpikeType, Standing, StandingOpts, Stat, SubPriority, Substitution, SubstitutionOpts, Team, TeamOpts, Trait, validateUUID };
|
|
@@ -14,5 +14,6 @@ import { Spike, SpikeFailure, SpikeType, } from './event/spike';
|
|
|
14
14
|
import { Block, BlockFailure, BlockType, } from './event/block';
|
|
15
15
|
import { GeneralStat, PerformanceStats, Player, Role, Trait, } from './player';
|
|
16
16
|
import { League, Season, Standing, } from './league';
|
|
17
|
+
import { Stage, Tournament, TournamentMatch } from './tournament';
|
|
17
18
|
import { formatNumber, generateModifier, getKeys, getRandomEnumValue, randomNumber, shuffle, validateUUID, } from './utils';
|
|
18
|
-
export { 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 };
|
|
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 };
|
|
@@ -6,6 +6,7 @@ export interface SeasonOpts {
|
|
|
6
6
|
readonly teams: Team[];
|
|
7
7
|
readonly matches: Match[];
|
|
8
8
|
readonly iteration: number;
|
|
9
|
+
readonly champion?: Team;
|
|
9
10
|
}
|
|
10
11
|
export declare class Season {
|
|
11
12
|
readonly id: string;
|
|
@@ -13,7 +14,7 @@ export declare class Season {
|
|
|
13
14
|
readonly matches: Match[];
|
|
14
15
|
readonly iteration: number;
|
|
15
16
|
readonly standings: Standing[];
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
champion?: Team;
|
|
18
|
+
constructor({ id, iteration, teams, matches, champion }: SeasonOpts);
|
|
18
19
|
calculateStandings(): Standing[];
|
|
19
20
|
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { Standing } from './standing';
|
|
2
2
|
export class Season {
|
|
3
|
-
constructor({ id, iteration, teams, matches }) {
|
|
3
|
+
constructor({ id, iteration, teams, matches, champion }) {
|
|
4
4
|
this.id = id;
|
|
5
5
|
this.teams = teams;
|
|
6
6
|
this.matches = matches;
|
|
7
7
|
this.iteration = iteration;
|
|
8
8
|
this.standings = this.calculateStandings();
|
|
9
|
-
|
|
10
|
-
get champion() {
|
|
11
|
-
if (this.matches.every(match => !match.isOver()))
|
|
12
|
-
return undefined;
|
|
13
|
-
return this.teams.find(team => team.id === this.standings[0].teamId);
|
|
9
|
+
this.champion = champion;
|
|
14
10
|
}
|
|
15
11
|
calculateStandings() {
|
|
16
12
|
return this.teams.map(team => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Match } from '../match';
|
|
2
|
+
export declare enum Stage {
|
|
3
|
+
ROUND_OF_8 = 8,
|
|
4
|
+
QUARTERFINALS = 4,
|
|
5
|
+
SEMIFINALS = 2,
|
|
6
|
+
FINAL = 1
|
|
7
|
+
}
|
|
8
|
+
export interface TournamentStageOpts {
|
|
9
|
+
readonly stage: Stage;
|
|
10
|
+
readonly match: Match;
|
|
11
|
+
readonly index: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class TournamentMatch {
|
|
14
|
+
readonly stage: Stage;
|
|
15
|
+
readonly match: Match;
|
|
16
|
+
readonly index: number;
|
|
17
|
+
constructor({ stage, match, index }: TournamentStageOpts);
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export class TournamentMatch {
|
|
9
|
+
constructor({ stage, match, index }) {
|
|
10
|
+
if (index > stage || index < 0)
|
|
11
|
+
throw new Error('INDEX_OUT_OF_BOUNDS');
|
|
12
|
+
this.stage = stage;
|
|
13
|
+
this.match = match;
|
|
14
|
+
this.index = index;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TournamentMatch } from './tournament-match';
|
|
2
|
+
import { Team } from '../team';
|
|
3
|
+
export interface TournamentOpts {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly iteration: number;
|
|
6
|
+
readonly matches: TournamentMatch[];
|
|
7
|
+
readonly champion?: Team;
|
|
8
|
+
}
|
|
9
|
+
export declare class Tournament {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly iteration: number;
|
|
12
|
+
readonly matches: TournamentMatch[];
|
|
13
|
+
champion?: Team;
|
|
14
|
+
constructor({ id, iteration, matches, champion }: TournamentOpts);
|
|
15
|
+
}
|