volleyballsimtypes 0.0.104 → 0.0.106
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/league.d.ts +2 -1
- 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/league.js +6 -1
- package/dist/cjs/src/data/transformers/match-set.js +1 -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/league.d.ts +2 -1
- 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/league.js +6 -1
- package/dist/esm/src/data/transformers/match-set.js +1 -1
- 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';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CountryId, CountryModel, LeagueSeasonId, LeagueSeasonModel, TeamId, TeamModel } from '.';
|
|
3
|
+
import { CountryId, CountryModel, LeagueSeasonAttributes, LeagueSeasonId, LeagueSeasonModel, TeamId, TeamModel } from '.';
|
|
4
4
|
export interface LeagueAttributes {
|
|
5
5
|
league_id: string;
|
|
6
6
|
country_id: string;
|
|
7
7
|
name: string;
|
|
8
|
+
LeagueSeasons?: LeagueSeasonAttributes[];
|
|
8
9
|
}
|
|
9
10
|
export type LeaguePk = 'league_id';
|
|
10
11
|
export type LeagueId = LeagueModel[LeaguePk];
|
|
@@ -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];
|
|
@@ -4,10 +4,15 @@ exports.transformFromLeague = exports.transformToAPILeague = exports.transformTo
|
|
|
4
4
|
const service_1 = require("../../service");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
function transformToAttributes(league) {
|
|
7
|
+
const LeagueSeasons = league.seasons != null ? league.seasons.map(season => ({
|
|
8
|
+
league_id: league.id,
|
|
9
|
+
competition_id: season.id
|
|
10
|
+
})) : undefined;
|
|
7
11
|
return {
|
|
8
12
|
league_id: league.id,
|
|
9
13
|
country_id: league.country.id,
|
|
10
|
-
name: league.name
|
|
14
|
+
name: league.name,
|
|
15
|
+
LeagueSeasons
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
exports.transformFromLeague = transformToAttributes;
|
|
@@ -13,7 +13,7 @@ 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
17
|
MatchSetStats: set.stats != null ? set.stats.map(stats => (0, _1.transformFromMatchSetStats)(stats, set.id)) : undefined,
|
|
18
18
|
Rallies: set.rallies != null ? set.rallies.map(rally => (0, _1.transformFromRally)(rally, set.id)) : undefined
|
|
19
19
|
};
|
|
@@ -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';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CountryId, CountryModel, LeagueSeasonId, LeagueSeasonModel, TeamId, TeamModel } from '.';
|
|
3
|
+
import { CountryId, CountryModel, LeagueSeasonAttributes, LeagueSeasonId, LeagueSeasonModel, TeamId, TeamModel } from '.';
|
|
4
4
|
export interface LeagueAttributes {
|
|
5
5
|
league_id: string;
|
|
6
6
|
country_id: string;
|
|
7
7
|
name: string;
|
|
8
|
+
LeagueSeasons?: LeagueSeasonAttributes[];
|
|
8
9
|
}
|
|
9
10
|
export type LeaguePk = 'league_id';
|
|
10
11
|
export type LeagueId = LeagueModel[LeaguePk];
|
|
@@ -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,10 +1,15 @@
|
|
|
1
1
|
import { League } from '../../service';
|
|
2
2
|
import { transformToCountry, transformToSeason } from '.';
|
|
3
3
|
function transformToAttributes(league) {
|
|
4
|
+
const LeagueSeasons = league.seasons != null ? league.seasons.map(season => ({
|
|
5
|
+
league_id: league.id,
|
|
6
|
+
competition_id: season.id
|
|
7
|
+
})) : undefined;
|
|
4
8
|
return {
|
|
5
9
|
league_id: league.id,
|
|
6
10
|
country_id: league.country.id,
|
|
7
|
-
name: league.name
|
|
11
|
+
name: league.name,
|
|
12
|
+
LeagueSeasons
|
|
8
13
|
};
|
|
9
14
|
}
|
|
10
15
|
function transformToObject(model) {
|
|
@@ -10,7 +10,7 @@ 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
14
|
MatchSetStats: set.stats != null ? set.stats.map(stats => transformFromMatchSetStats(stats, set.id)) : undefined,
|
|
15
15
|
Rallies: set.rallies != null ? set.rallies.map(rally => transformFromRally(rally, set.id)) : undefined
|
|
16
16
|
};
|
|
@@ -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) {
|