volleyballsimtypes 0.0.103 → 0.0.105
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/models/competition-match.d.ts +1 -1
- package/dist/cjs/src/data/models/competition.d.ts +3 -3
- package/dist/cjs/src/data/models/match-set.d.ts +1 -1
- package/dist/cjs/src/data/models/match.d.ts +2 -1
- package/dist/cjs/src/data/transformers/match-set.js +3 -1
- package/dist/cjs/src/data/transformers/season-match.js +1 -1
- package/dist/cjs/src/data/transformers/season.js +3 -3
- package/dist/cjs/src/data/transformers/tournament-match.js +1 -1
- package/dist/cjs/src/data/transformers/tournament.js +3 -3
- package/dist/esm/src/data/models/competition-match.d.ts +1 -1
- package/dist/esm/src/data/models/competition.d.ts +3 -3
- package/dist/esm/src/data/models/match-set.d.ts +1 -1
- package/dist/esm/src/data/models/match.d.ts +2 -1
- package/dist/esm/src/data/transformers/match-set.js +4 -2
- package/dist/esm/src/data/transformers/season-match.js +1 -1
- package/dist/esm/src/data/transformers/season.js +3 -3
- package/dist/esm/src/data/transformers/tournament-match.js +1 -1
- package/dist/esm/src/data/transformers/tournament.js +3 -3
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export interface CompetitionMatchAttributes {
|
|
|
6
6
|
match_id: string;
|
|
7
7
|
index: number;
|
|
8
8
|
stage: CompetitionStage;
|
|
9
|
-
|
|
9
|
+
Match?: MatchAttributes;
|
|
10
10
|
}
|
|
11
11
|
export type CompetitionMatchPk = 'match_id';
|
|
12
12
|
export type CompetitionMatchId = CompetitionMatchModel[CompetitionMatchPk];
|
|
@@ -6,9 +6,9 @@ export interface CompetitionAttributes {
|
|
|
6
6
|
iteration: number;
|
|
7
7
|
type: CompetitionType;
|
|
8
8
|
leagueSeason?: LeagueSeasonAttributes;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
CompetitionChampion?: CompetitionChampionAttributes;
|
|
10
|
+
CompetitionMatches?: CompetitionMatchAttributes[];
|
|
11
|
+
CompetitionTeams?: CompetitionTeamsAttributes[];
|
|
12
12
|
}
|
|
13
13
|
export type CompetitionPk = 'competition_id';
|
|
14
14
|
export type CompetitionType = 'LEAGUE' | 'TOURNAMENT';
|
|
@@ -8,7 +8,7 @@ export interface MatchSetAttributes {
|
|
|
8
8
|
order: number;
|
|
9
9
|
home_score: number;
|
|
10
10
|
away_score: number;
|
|
11
|
-
|
|
11
|
+
SetPositions?: SetPositionAttributes[];
|
|
12
12
|
Rallies?: RallyAttributes[];
|
|
13
13
|
MatchSetStats?: MatchSetStatsAttributes[];
|
|
14
14
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CompetitionMatchId, CompetitionMatchModel, MatchRatingId, MatchRatingModel, MatchSetId, MatchSetModel, TeamId, TeamModel } from '.';
|
|
3
|
+
import { CompetitionMatchId, CompetitionMatchModel, MatchRatingId, MatchRatingModel, MatchSetAttributes, MatchSetId, MatchSetModel, TeamId, TeamModel } from '.';
|
|
4
4
|
export interface MatchAttributes {
|
|
5
5
|
match_id: string;
|
|
6
6
|
home_team: string;
|
|
7
7
|
away_team: string;
|
|
8
8
|
scheduled_date: Date;
|
|
9
9
|
is_simulated: boolean;
|
|
10
|
+
MatchSets?: MatchSetAttributes[];
|
|
10
11
|
}
|
|
11
12
|
export type MatchPk = 'match_id';
|
|
12
13
|
export type MatchId = MatchModel[MatchPk];
|
|
@@ -13,7 +13,9 @@ function transformToAttributes(set, matchId) {
|
|
|
13
13
|
is_tie_break: set.isTieBreak,
|
|
14
14
|
home_score: set.getHomeScore(),
|
|
15
15
|
away_score: set.getAwayScore(),
|
|
16
|
-
|
|
16
|
+
SetPositions: [...homeSetPositions, ...awaySetPositions],
|
|
17
|
+
MatchSetStats: set.stats != null ? set.stats.map(stats => (0, _1.transformFromMatchSetStats)(stats, set.id)) : undefined,
|
|
18
|
+
Rallies: set.rallies != null ? set.rallies.map(rally => (0, _1.transformFromRally)(rally, set.id)) : undefined
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
exports.transformFromMatchSet = transformToAttributes;
|
|
@@ -10,7 +10,7 @@ function transformToAttributes(seasonId, match, index) {
|
|
|
10
10
|
match_id: match.id,
|
|
11
11
|
index,
|
|
12
12
|
stage: (0, stage_1.transformFromStage)(service_1.Stage.LEAGUE),
|
|
13
|
-
|
|
13
|
+
Match: (0, match_1.transformFromMatch)(match)
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
exports.transformFromSeasonMatch = transformToAttributes;
|
|
@@ -19,9 +19,9 @@ function transformToAttributes(season, leagueId) {
|
|
|
19
19
|
type: 'LEAGUE',
|
|
20
20
|
iteration: season.iteration.id,
|
|
21
21
|
leagueSeason: { league_id: leagueId, competition_id: season.id },
|
|
22
|
-
champion,
|
|
23
|
-
matches,
|
|
24
|
-
teams
|
|
22
|
+
CompetitionChampion: champion,
|
|
23
|
+
CompetitionMatches: matches,
|
|
24
|
+
CompetitionTeams: teams
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
exports.transformFromSeason = transformToAttributes;
|
|
@@ -9,7 +9,7 @@ function transformToAttributes(tournamentMatch, tournamentId) {
|
|
|
9
9
|
match_id: tournamentMatch.match.id,
|
|
10
10
|
index: tournamentMatch.index,
|
|
11
11
|
stage: (0, _1.transformFromStage)(tournamentMatch.stage),
|
|
12
|
-
|
|
12
|
+
Match: (0, _1.transformFromMatch)(tournamentMatch.match)
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
exports.transformFromTournamentMatch = transformToAttributes;
|
|
@@ -17,9 +17,9 @@ function transformToAttributes(tournament) {
|
|
|
17
17
|
competition_id: tournament.id,
|
|
18
18
|
type: 'TOURNAMENT',
|
|
19
19
|
iteration: tournament.iteration.id,
|
|
20
|
-
champion,
|
|
21
|
-
matches,
|
|
22
|
-
teams
|
|
20
|
+
CompetitionChampion: champion,
|
|
21
|
+
CompetitionMatches: matches,
|
|
22
|
+
CompetitionTeams: teams
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
exports.transformFromTournament = transformToAttributes;
|
|
@@ -6,7 +6,7 @@ export interface CompetitionMatchAttributes {
|
|
|
6
6
|
match_id: string;
|
|
7
7
|
index: number;
|
|
8
8
|
stage: CompetitionStage;
|
|
9
|
-
|
|
9
|
+
Match?: MatchAttributes;
|
|
10
10
|
}
|
|
11
11
|
export type CompetitionMatchPk = 'match_id';
|
|
12
12
|
export type CompetitionMatchId = CompetitionMatchModel[CompetitionMatchPk];
|
|
@@ -6,9 +6,9 @@ export interface CompetitionAttributes {
|
|
|
6
6
|
iteration: number;
|
|
7
7
|
type: CompetitionType;
|
|
8
8
|
leagueSeason?: LeagueSeasonAttributes;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
CompetitionChampion?: CompetitionChampionAttributes;
|
|
10
|
+
CompetitionMatches?: CompetitionMatchAttributes[];
|
|
11
|
+
CompetitionTeams?: CompetitionTeamsAttributes[];
|
|
12
12
|
}
|
|
13
13
|
export type CompetitionPk = 'competition_id';
|
|
14
14
|
export type CompetitionType = 'LEAGUE' | 'TOURNAMENT';
|
|
@@ -8,7 +8,7 @@ export interface MatchSetAttributes {
|
|
|
8
8
|
order: number;
|
|
9
9
|
home_score: number;
|
|
10
10
|
away_score: number;
|
|
11
|
-
|
|
11
|
+
SetPositions?: SetPositionAttributes[];
|
|
12
12
|
Rallies?: RallyAttributes[];
|
|
13
13
|
MatchSetStats?: MatchSetStatsAttributes[];
|
|
14
14
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CompetitionMatchId, CompetitionMatchModel, MatchRatingId, MatchRatingModel, MatchSetId, MatchSetModel, TeamId, TeamModel } from '.';
|
|
3
|
+
import { CompetitionMatchId, CompetitionMatchModel, MatchRatingId, MatchRatingModel, MatchSetAttributes, MatchSetId, MatchSetModel, TeamId, TeamModel } from '.';
|
|
4
4
|
export interface MatchAttributes {
|
|
5
5
|
match_id: string;
|
|
6
6
|
home_team: string;
|
|
7
7
|
away_team: string;
|
|
8
8
|
scheduled_date: Date;
|
|
9
9
|
is_simulated: boolean;
|
|
10
|
+
MatchSets?: MatchSetAttributes[];
|
|
10
11
|
}
|
|
11
12
|
export type MatchPk = 'match_id';
|
|
12
13
|
export type MatchId = MatchModel[MatchPk];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MatchSet } from '../../service';
|
|
2
|
-
import { transformFromPlayerPosition, transformToAPIMatchSetStats, transformToAPIRally, transformToMatchSetStats, transformToPlayerPosition, transformToRally } from '.';
|
|
2
|
+
import { transformFromMatchSetStats, transformFromPlayerPosition, transformFromRally, transformToAPIMatchSetStats, transformToAPIRally, transformToMatchSetStats, transformToPlayerPosition, transformToRally } from '.';
|
|
3
3
|
function transformToAttributes(set, matchId) {
|
|
4
4
|
const homeSetPositions = set.homePlayerPosition.map(position => transformFromPlayerPosition(position, 'Home', set.id));
|
|
5
5
|
const awaySetPositions = set.awayPlayerPosition.map(position => transformFromPlayerPosition(position, 'Away', set.id));
|
|
@@ -10,7 +10,9 @@ function transformToAttributes(set, matchId) {
|
|
|
10
10
|
is_tie_break: set.isTieBreak,
|
|
11
11
|
home_score: set.getHomeScore(),
|
|
12
12
|
away_score: set.getAwayScore(),
|
|
13
|
-
|
|
13
|
+
SetPositions: [...homeSetPositions, ...awaySetPositions],
|
|
14
|
+
MatchSetStats: set.stats != null ? set.stats.map(stats => transformFromMatchSetStats(stats, set.id)) : undefined,
|
|
15
|
+
Rallies: set.rallies != null ? set.rallies.map(rally => transformFromRally(rally, set.id)) : undefined
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
18
|
function transformToObject(model) {
|
|
@@ -7,7 +7,7 @@ function transformToAttributes(seasonId, match, index) {
|
|
|
7
7
|
match_id: match.id,
|
|
8
8
|
index,
|
|
9
9
|
stage: transformFromStage(Stage.LEAGUE),
|
|
10
|
-
|
|
10
|
+
Match: transformFromMatch(match)
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
export { transformToAttributes as transformFromSeasonMatch };
|
|
@@ -16,9 +16,9 @@ function transformToAttributes(season, leagueId) {
|
|
|
16
16
|
type: 'LEAGUE',
|
|
17
17
|
iteration: season.iteration.id,
|
|
18
18
|
leagueSeason: { league_id: leagueId, competition_id: season.id },
|
|
19
|
-
champion,
|
|
20
|
-
matches,
|
|
21
|
-
teams
|
|
19
|
+
CompetitionChampion: champion,
|
|
20
|
+
CompetitionMatches: matches,
|
|
21
|
+
CompetitionTeams: teams
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
function transformToObject(model) {
|
|
@@ -6,7 +6,7 @@ function transformToAttributes(tournamentMatch, tournamentId) {
|
|
|
6
6
|
match_id: tournamentMatch.match.id,
|
|
7
7
|
index: tournamentMatch.index,
|
|
8
8
|
stage: transformFromStage(tournamentMatch.stage),
|
|
9
|
-
|
|
9
|
+
Match: transformFromMatch(tournamentMatch.match)
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function transformToObject(model) {
|
|
@@ -14,9 +14,9 @@ function transformToAttributes(tournament) {
|
|
|
14
14
|
competition_id: tournament.id,
|
|
15
15
|
type: 'TOURNAMENT',
|
|
16
16
|
iteration: tournament.iteration.id,
|
|
17
|
-
champion,
|
|
18
|
-
matches,
|
|
19
|
-
teams
|
|
17
|
+
CompetitionChampion: champion,
|
|
18
|
+
CompetitionMatches: matches,
|
|
19
|
+
CompetitionTeams: teams
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function transformToObject(model) {
|