volleyballsimtypes 0.0.87 → 0.0.89
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/event-trait.d.ts +1 -1
- package/dist/cjs/src/data/models/event-trait.js +4 -1
- package/dist/cjs/src/data/models/season.d.ts +2 -1
- package/dist/cjs/src/data/models/tournament.d.ts +2 -1
- package/dist/cjs/src/data/transformers/season.js +3 -1
- package/dist/cjs/src/data/transformers/tournament.js +7 -3
- package/dist/esm/src/data/models/event-trait.d.ts +1 -1
- package/dist/esm/src/data/models/event-trait.js +4 -1
- package/dist/esm/src/data/models/season.d.ts +2 -1
- package/dist/esm/src/data/models/tournament.d.ts +2 -1
- package/dist/esm/src/data/transformers/season.js +3 -1
- package/dist/esm/src/data/transformers/tournament.js +7 -3
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export interface EventTraitAttributes {
|
|
|
10
10
|
event_id: string;
|
|
11
11
|
trait_id: string;
|
|
12
12
|
}
|
|
13
|
-
export type EventTraitPk = 'event_id';
|
|
13
|
+
export type EventTraitPk = 'event_id' | 'trait_id';
|
|
14
14
|
export type EventTraitId = EventTraitModel[EventTraitPk];
|
|
15
15
|
export type EventTraitOptionalAttributes = 'block_id' | 'reception_id' | 'serve_id' | 'set_id' | 'spike_id';
|
|
16
16
|
export type EventTraitCreationAttributes = Optional<EventTraitAttributes, EventTraitOptionalAttributes>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
|
|
3
|
+
import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
|
|
4
4
|
import { IterationModel, SeasonMatchId, SeasonMatchModel } from '.';
|
|
5
5
|
export interface SeasonAttributes {
|
|
6
6
|
season_id: string;
|
|
@@ -8,6 +8,7 @@ export interface SeasonAttributes {
|
|
|
8
8
|
league_id: string;
|
|
9
9
|
seasonTeams?: TeamAttributes[];
|
|
10
10
|
SeasonMatches?: SeasonMatchAttributes[];
|
|
11
|
+
SeasonTeams?: SeasonTeamsAttributes[];
|
|
11
12
|
league?: LeagueAttributes;
|
|
12
13
|
champion?: string;
|
|
13
14
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model, Optional } from 'sequelize';
|
|
3
|
-
import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsId } from '.';
|
|
3
|
+
import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsAttributes, TournamentTeamsId } from '.';
|
|
4
4
|
import { IterationModel, TeamAttributes, TournamentTeamsModel } from '.';
|
|
5
5
|
export interface TournamentAttributes {
|
|
6
6
|
tournament_id: string;
|
|
7
7
|
iteration: number;
|
|
8
8
|
champion?: string;
|
|
9
9
|
TournamentMatches?: TournamentMatchAttributes[];
|
|
10
|
+
TournamentTeams?: TournamentTeamsAttributes[];
|
|
10
11
|
tournamentTeams?: TeamAttributes[];
|
|
11
12
|
}
|
|
12
13
|
export type TournamentPk = 'tournament_id';
|
|
@@ -6,13 +6,15 @@ const service_1 = require("../../service");
|
|
|
6
6
|
function transformToAttributes(season, leagueId) {
|
|
7
7
|
const seasonMatches = season.matches != null ?
|
|
8
8
|
season.matches.map(match => (0, _1.transformFromSeasonMatch)(season.id, match.id)) : [];
|
|
9
|
+
const seasonTeams = season.teams.map(team => ({ season_id: season.id, team_id: team.id }));
|
|
9
10
|
return {
|
|
10
11
|
season_id: season.id,
|
|
11
12
|
iteration: season.iteration.id,
|
|
12
13
|
league_id: leagueId,
|
|
13
14
|
champion: season.champion != null ? season.champion.id : undefined,
|
|
14
15
|
seasonTeams: season.teams != null ? season.teams.map(_1.transformFromTeam) : [],
|
|
15
|
-
SeasonMatches: seasonMatches
|
|
16
|
+
SeasonMatches: seasonMatches,
|
|
17
|
+
SeasonTeams: seasonTeams
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
20
|
exports.transformFromSeason = transformToAttributes;
|
|
@@ -4,14 +4,18 @@ exports.transformFromTournament = exports.transformToAPITournament = exports.tra
|
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
const service_1 = require("../../service");
|
|
6
6
|
function transformToAttributes(tournament) {
|
|
7
|
-
const tournamentMatches = tournament.matches
|
|
8
|
-
|
|
7
|
+
const tournamentMatches = tournament.matches.map(match => (0, _1.transformFromTournamentMatch)(match, tournament.id));
|
|
8
|
+
const tournamentTeams = tournament.teams.map(team => ({
|
|
9
|
+
tournament_id: tournament.id,
|
|
10
|
+
team_id: team.id
|
|
11
|
+
}));
|
|
9
12
|
return {
|
|
10
13
|
tournament_id: tournament.id,
|
|
11
14
|
iteration: tournament.iteration.id,
|
|
12
15
|
champion: tournament.champion != null ? tournament.champion.id : undefined,
|
|
13
16
|
tournamentTeams: tournament.teams != null ? tournament.teams.map(_1.transformFromTeam) : [],
|
|
14
|
-
TournamentMatches: tournamentMatches
|
|
17
|
+
TournamentMatches: tournamentMatches,
|
|
18
|
+
TournamentTeams: tournamentTeams
|
|
15
19
|
};
|
|
16
20
|
}
|
|
17
21
|
exports.transformFromTournament = transformToAttributes;
|
|
@@ -10,7 +10,7 @@ export interface EventTraitAttributes {
|
|
|
10
10
|
event_id: string;
|
|
11
11
|
trait_id: string;
|
|
12
12
|
}
|
|
13
|
-
export type EventTraitPk = 'event_id';
|
|
13
|
+
export type EventTraitPk = 'event_id' | 'trait_id';
|
|
14
14
|
export type EventTraitId = EventTraitModel[EventTraitPk];
|
|
15
15
|
export type EventTraitOptionalAttributes = 'block_id' | 'reception_id' | 'serve_id' | 'set_id' | 'spike_id';
|
|
16
16
|
export type EventTraitCreationAttributes = Optional<EventTraitAttributes, EventTraitOptionalAttributes>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
|
|
3
|
+
import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
|
|
4
4
|
import { IterationModel, SeasonMatchId, SeasonMatchModel } from '.';
|
|
5
5
|
export interface SeasonAttributes {
|
|
6
6
|
season_id: string;
|
|
@@ -8,6 +8,7 @@ export interface SeasonAttributes {
|
|
|
8
8
|
league_id: string;
|
|
9
9
|
seasonTeams?: TeamAttributes[];
|
|
10
10
|
SeasonMatches?: SeasonMatchAttributes[];
|
|
11
|
+
SeasonTeams?: SeasonTeamsAttributes[];
|
|
11
12
|
league?: LeagueAttributes;
|
|
12
13
|
champion?: string;
|
|
13
14
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model, Optional } from 'sequelize';
|
|
3
|
-
import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsId } from '.';
|
|
3
|
+
import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsAttributes, TournamentTeamsId } from '.';
|
|
4
4
|
import { IterationModel, TeamAttributes, TournamentTeamsModel } from '.';
|
|
5
5
|
export interface TournamentAttributes {
|
|
6
6
|
tournament_id: string;
|
|
7
7
|
iteration: number;
|
|
8
8
|
champion?: string;
|
|
9
9
|
TournamentMatches?: TournamentMatchAttributes[];
|
|
10
|
+
TournamentTeams?: TournamentTeamsAttributes[];
|
|
10
11
|
tournamentTeams?: TeamAttributes[];
|
|
11
12
|
}
|
|
12
13
|
export type TournamentPk = 'tournament_id';
|
|
@@ -3,13 +3,15 @@ import { Season } from '../../service';
|
|
|
3
3
|
function transformToAttributes(season, leagueId) {
|
|
4
4
|
const seasonMatches = season.matches != null ?
|
|
5
5
|
season.matches.map(match => transformFromSeasonMatch(season.id, match.id)) : [];
|
|
6
|
+
const seasonTeams = season.teams.map(team => ({ season_id: season.id, team_id: team.id }));
|
|
6
7
|
return {
|
|
7
8
|
season_id: season.id,
|
|
8
9
|
iteration: season.iteration.id,
|
|
9
10
|
league_id: leagueId,
|
|
10
11
|
champion: season.champion != null ? season.champion.id : undefined,
|
|
11
12
|
seasonTeams: season.teams != null ? season.teams.map(transformFromTeam) : [],
|
|
12
|
-
SeasonMatches: seasonMatches
|
|
13
|
+
SeasonMatches: seasonMatches,
|
|
14
|
+
SeasonTeams: seasonTeams
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
function transformToObject(model) {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { transformFromTeam, transformFromTournamentMatch, transformToAPITeam, transformToAPITournamentMatch, transformToIteration, transformToTeam, transformToTournamentMatch } from '.';
|
|
2
2
|
import { Tournament } from '../../service';
|
|
3
3
|
function transformToAttributes(tournament) {
|
|
4
|
-
const tournamentMatches = tournament.matches
|
|
5
|
-
|
|
4
|
+
const tournamentMatches = tournament.matches.map(match => transformFromTournamentMatch(match, tournament.id));
|
|
5
|
+
const tournamentTeams = tournament.teams.map(team => ({
|
|
6
|
+
tournament_id: tournament.id,
|
|
7
|
+
team_id: team.id
|
|
8
|
+
}));
|
|
6
9
|
return {
|
|
7
10
|
tournament_id: tournament.id,
|
|
8
11
|
iteration: tournament.iteration.id,
|
|
9
12
|
champion: tournament.champion != null ? tournament.champion.id : undefined,
|
|
10
13
|
tournamentTeams: tournament.teams != null ? tournament.teams.map(transformFromTeam) : [],
|
|
11
|
-
TournamentMatches: tournamentMatches
|
|
14
|
+
TournamentMatches: tournamentMatches,
|
|
15
|
+
TournamentTeams: tournamentTeams
|
|
12
16
|
};
|
|
13
17
|
}
|
|
14
18
|
function transformToObject(model) {
|