volleyballsimtypes 0.0.9 → 0.0.11
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 +2 -1
- package/dist/cjs/src/data/index.js +4 -2
- package/dist/cjs/src/data/init-models.d.ts +26 -0
- package/dist/cjs/src/data/init-models.js +183 -0
- package/dist/cjs/src/index.d.ts +2 -2
- package/dist/cjs/src/index.js +3 -2
- package/dist/cjs/src/service/league/league.d.ts +0 -4
- package/dist/cjs/src/service/league/league.js +0 -75
- package/dist/esm/src/data/index.d.ts +2 -1
- package/dist/esm/src/data/index.js +2 -1
- package/dist/esm/src/data/init-models.d.ts +26 -0
- package/dist/esm/src/data/init-models.js +179 -0
- package/dist/esm/src/index.d.ts +2 -2
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/service/league/league.d.ts +0 -4
- package/dist/esm/src/service/league/league.js +0 -72
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, 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 } from './models';
|
|
2
2
|
import { 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, 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 './transformers';
|
|
3
|
-
|
|
3
|
+
import { initModels } from './init-models';
|
|
4
|
+
export { initModels, BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, 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, 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 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.transformToTrait = exports.transformToTeam = exports.transformToSubstitution = exports.transformToSpike = exports.transformToSet = exports.transformToServe = exports.transformToSeason = exports.transformToScore = exports.transformToRole = exports.transformToReception = exports.transformToRally = exports.transformToPlayerPosition = exports.transformToPlayer = exports.transformToPerformanceStats = exports.transformToMatchSetStats = exports.transformToMatchSet = exports.transformToMatch = exports.transformToLiberoReplacement = exports.transformToLeague = exports.transformToFormation = exports.transformToEventType = exports.transformToCourtTarget = exports.transformToCourtPosition = exports.transformToCountry = exports.transformToCoach = exports.transformToBlock = exports.transformToAPITrait = exports.transformToAPITeam = exports.transformToAPISubstitution = exports.transformToAPISpike = exports.transformToAPISet = exports.transformToAPIServe = exports.transformToAPISeason = exports.transformToAPIScore = exports.transformToAPIReception = exports.transformToAPIRally = exports.transformToAPIPlayer = exports.transformToAPIMatchSetStats = exports.transformToAPIMatchSet = exports.transformToAPIMatch = void 0;
|
|
3
|
+
exports.transformToAPIBlock = exports.transformFromTrait = exports.transformFromTeam = exports.transformFromSubstitution = exports.transformFromSpike = exports.transformFromSet = exports.transformFromServe = exports.transformFromSeason = exports.transformFromScore = exports.transformFromRole = exports.transformFromReception = exports.transformFromRally = exports.transformFromPlayerPosition = exports.transformFromPlayer = exports.transformFromPerformanceStats = exports.transformFromMatchSetStats = exports.transformFromMatchSet = exports.transformFromMatch = exports.transformFromLiberoReplacement = exports.transformFromLeague = exports.transformFromFormation = exports.transformFromEventType = exports.transformFromCourtTarget = exports.transformFromCourtPosition = exports.transformFromCountry = exports.transformFromCoach = exports.transformFromBlock = exports.TeamModel = exports.SubstitutionModel = exports.SpikeModel = exports.SetModel = exports.ServeModel = exports.SeasonTeamsModel = exports.SeasonModel = exports.ScoreModel = exports.ReceptionModel = exports.RallyPositionModel = exports.RallyModel = exports.PlayerModel = exports.PerformanceStatsModel = exports.MatchSetStatsModel = exports.MatchSetModel = exports.MatchModel = exports.LiberoReplacementModel = exports.LeagueModel = exports.EventModel = exports.CountryModel = exports.CoachModel = exports.BlockModel = exports.initModels = void 0;
|
|
4
|
+
exports.transformToTrait = exports.transformToTeam = exports.transformToSubstitution = exports.transformToSpike = exports.transformToSet = exports.transformToServe = exports.transformToSeason = exports.transformToScore = exports.transformToRole = exports.transformToReception = exports.transformToRally = exports.transformToPlayerPosition = exports.transformToPlayer = exports.transformToPerformanceStats = exports.transformToMatchSetStats = exports.transformToMatchSet = exports.transformToMatch = exports.transformToLiberoReplacement = exports.transformToLeague = exports.transformToFormation = exports.transformToEventType = exports.transformToCourtTarget = exports.transformToCourtPosition = exports.transformToCountry = exports.transformToCoach = exports.transformToBlock = exports.transformToAPITrait = exports.transformToAPITeam = exports.transformToAPISubstitution = exports.transformToAPISpike = exports.transformToAPISet = exports.transformToAPIServe = exports.transformToAPISeason = exports.transformToAPIScore = exports.transformToAPIReception = exports.transformToAPIRally = exports.transformToAPIPlayer = exports.transformToAPIMatchSetStats = exports.transformToAPIMatchSet = exports.transformToAPIMatch = exports.transformToAPILiberoReplacement = void 0;
|
|
5
5
|
const models_1 = require("./models");
|
|
6
6
|
Object.defineProperty(exports, "BlockModel", { enumerable: true, get: function () { return models_1.BlockModel; } });
|
|
7
7
|
Object.defineProperty(exports, "CoachModel", { enumerable: true, get: function () { return models_1.CoachModel; } });
|
|
@@ -94,3 +94,5 @@ Object.defineProperty(exports, "transformToSpike", { enumerable: true, get: func
|
|
|
94
94
|
Object.defineProperty(exports, "transformToSubstitution", { enumerable: true, get: function () { return transformers_1.transformToSubstitution; } });
|
|
95
95
|
Object.defineProperty(exports, "transformToTeam", { enumerable: true, get: function () { return transformers_1.transformToTeam; } });
|
|
96
96
|
Object.defineProperty(exports, "transformToTrait", { enumerable: true, get: function () { return transformers_1.transformToTrait; } });
|
|
97
|
+
const init_models_1 = require("./init-models");
|
|
98
|
+
Object.defineProperty(exports, "initModels", { enumerable: true, get: function () { return init_models_1.initModels; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Sequelize } from 'sequelize';
|
|
2
|
+
import { BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel } from './models';
|
|
3
|
+
export declare function initModels(sequelize: Sequelize): {
|
|
4
|
+
Block: typeof BlockModel;
|
|
5
|
+
Coach: typeof CoachModel;
|
|
6
|
+
Country: typeof CountryModel;
|
|
7
|
+
Event: typeof EventModel;
|
|
8
|
+
League: typeof LeagueModel;
|
|
9
|
+
LiberoReplacement: typeof LiberoReplacementModel;
|
|
10
|
+
Match: typeof MatchModel;
|
|
11
|
+
MatchSet: typeof MatchSetModel;
|
|
12
|
+
MatchSetStats: typeof MatchSetStatsModel;
|
|
13
|
+
PerformanceStats: typeof PerformanceStatsModel;
|
|
14
|
+
Player: typeof PlayerModel;
|
|
15
|
+
Rally: typeof RallyModel;
|
|
16
|
+
RallyPosition: typeof RallyPositionModel;
|
|
17
|
+
Reception: typeof ReceptionModel;
|
|
18
|
+
Score: typeof ScoreModel;
|
|
19
|
+
Season: typeof SeasonModel;
|
|
20
|
+
SeasonTeams: typeof SeasonTeamsModel;
|
|
21
|
+
Serve: typeof ServeModel;
|
|
22
|
+
Set: typeof SetModel;
|
|
23
|
+
Spike: typeof SpikeModel;
|
|
24
|
+
Substitution: typeof SubstitutionModel;
|
|
25
|
+
Team: typeof TeamModel;
|
|
26
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initModels = void 0;
|
|
4
|
+
const models_1 = require("./models");
|
|
5
|
+
function initModels(sequelize) {
|
|
6
|
+
const Block = models_1.BlockModel.initModel(sequelize);
|
|
7
|
+
const Coach = models_1.CoachModel.initModel(sequelize);
|
|
8
|
+
const Country = models_1.CountryModel.initModel(sequelize);
|
|
9
|
+
const Event = models_1.EventModel.initModel(sequelize);
|
|
10
|
+
const League = models_1.LeagueModel.initModel(sequelize);
|
|
11
|
+
const LiberoReplacement = models_1.LiberoReplacementModel.initModel(sequelize);
|
|
12
|
+
const Match = models_1.MatchModel.initModel(sequelize);
|
|
13
|
+
const MatchSet = models_1.MatchSetModel.initModel(sequelize);
|
|
14
|
+
const MatchSetStats = models_1.MatchSetStatsModel.initModel(sequelize);
|
|
15
|
+
const PerformanceStats = models_1.PerformanceStatsModel.initModel(sequelize);
|
|
16
|
+
const Player = models_1.PlayerModel.initModel(sequelize);
|
|
17
|
+
const Rally = models_1.RallyModel.initModel(sequelize);
|
|
18
|
+
const RallyPosition = models_1.RallyPositionModel.initModel(sequelize);
|
|
19
|
+
const Reception = models_1.ReceptionModel.initModel(sequelize);
|
|
20
|
+
const Score = models_1.ScoreModel.initModel(sequelize);
|
|
21
|
+
const Season = models_1.SeasonModel.initModel(sequelize);
|
|
22
|
+
const SeasonTeams = models_1.SeasonTeamsModel.initModel(sequelize);
|
|
23
|
+
const Serve = models_1.ServeModel.initModel(sequelize);
|
|
24
|
+
const Set = models_1.SetModel.initModel(sequelize);
|
|
25
|
+
const Spike = models_1.SpikeModel.initModel(sequelize);
|
|
26
|
+
const Substitution = models_1.SubstitutionModel.initModel(sequelize);
|
|
27
|
+
const Team = models_1.TeamModel.initModel(sequelize);
|
|
28
|
+
MatchSet.belongsToMany(Player, {
|
|
29
|
+
as: 'player_id_Players',
|
|
30
|
+
through: MatchSetStats,
|
|
31
|
+
foreignKey: 'match_set_id',
|
|
32
|
+
otherKey: 'player_id'
|
|
33
|
+
});
|
|
34
|
+
Player.belongsToMany(MatchSet, {
|
|
35
|
+
as: 'match_set_id_MatchSets',
|
|
36
|
+
through: MatchSetStats,
|
|
37
|
+
foreignKey: 'player_id',
|
|
38
|
+
otherKey: 'match_set_id'
|
|
39
|
+
});
|
|
40
|
+
Player.belongsToMany(Rally, {
|
|
41
|
+
as: 'rally_id_Rallies',
|
|
42
|
+
through: RallyPosition,
|
|
43
|
+
foreignKey: 'player_id',
|
|
44
|
+
otherKey: 'rally_id'
|
|
45
|
+
});
|
|
46
|
+
Rally.belongsToMany(Player, {
|
|
47
|
+
as: 'player_id_Player_RallyPositions',
|
|
48
|
+
through: RallyPosition,
|
|
49
|
+
foreignKey: 'rally_id',
|
|
50
|
+
otherKey: 'player_id'
|
|
51
|
+
});
|
|
52
|
+
Season.belongsToMany(Team, {
|
|
53
|
+
as: 'seasonTeams',
|
|
54
|
+
through: SeasonTeams,
|
|
55
|
+
foreignKey: 'season_id',
|
|
56
|
+
otherKey: 'team_id'
|
|
57
|
+
});
|
|
58
|
+
Team.belongsToMany(Season, {
|
|
59
|
+
as: 'season_id_Seasons',
|
|
60
|
+
through: SeasonTeams,
|
|
61
|
+
foreignKey: 'team_id',
|
|
62
|
+
otherKey: 'season_id'
|
|
63
|
+
});
|
|
64
|
+
Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
|
|
65
|
+
Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
|
|
66
|
+
Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
67
|
+
Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
|
|
68
|
+
League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
69
|
+
Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
|
|
70
|
+
Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
71
|
+
Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
|
|
72
|
+
Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
73
|
+
Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
|
|
74
|
+
Season.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
|
|
75
|
+
League.hasMany(Season, { as: 'Seasons', foreignKey: 'league_id' });
|
|
76
|
+
MatchSet.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
|
|
77
|
+
Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
|
|
78
|
+
MatchSetStats.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
|
|
79
|
+
MatchSet.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'match_set_id' });
|
|
80
|
+
Rally.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
|
|
81
|
+
MatchSet.hasMany(Rally, { as: 'Rallies', foreignKey: 'match_set_id' });
|
|
82
|
+
Block.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
83
|
+
Player.hasMany(Block, { as: 'Blocks', foreignKey: 'player_id' });
|
|
84
|
+
Block.belongsTo(Player, { as: 'blocker_1_Player', foreignKey: 'blocker_1' });
|
|
85
|
+
Player.hasMany(Block, { as: 'blocker_1_Blocks', foreignKey: 'blocker_1' });
|
|
86
|
+
Block.belongsTo(Player, { as: 'blocker_2_Player', foreignKey: 'blocker_2' });
|
|
87
|
+
Player.hasMany(Block, { as: 'blocker_2_Blocks', foreignKey: 'blocker_2' });
|
|
88
|
+
Block.belongsTo(Player, { as: 'blocker_3_Player', foreignKey: 'blocker_3' });
|
|
89
|
+
Player.hasMany(Block, { as: 'blocker_3_Blocks', foreignKey: 'blocker_3' });
|
|
90
|
+
Event.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
91
|
+
Player.hasMany(Event, { as: 'Events', foreignKey: 'player_id' });
|
|
92
|
+
LiberoReplacement.belongsTo(Player, { as: 'libero_Player', foreignKey: 'libero' });
|
|
93
|
+
Player.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'libero' });
|
|
94
|
+
LiberoReplacement.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
95
|
+
Player.hasMany(LiberoReplacement, { as: 'player_LiberoReplacements', foreignKey: 'player_id' });
|
|
96
|
+
MatchSet.belongsTo(Player, { as: 'away_libero_Player', foreignKey: 'away_libero' });
|
|
97
|
+
Player.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'away_libero' });
|
|
98
|
+
MatchSet.belongsTo(Player, { as: 'home_libero_Player', foreignKey: 'home_libero' });
|
|
99
|
+
Player.hasMany(MatchSet, { as: 'home_libero_MatchSets', foreignKey: 'home_libero' });
|
|
100
|
+
MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
101
|
+
Player.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'player_id' });
|
|
102
|
+
PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
103
|
+
Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
|
|
104
|
+
RallyPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
105
|
+
Player.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'player_id' });
|
|
106
|
+
Reception.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
107
|
+
Player.hasMany(Reception, { as: 'Receptions', foreignKey: 'player_id' });
|
|
108
|
+
Score.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
109
|
+
Player.hasMany(Score, { as: 'Scores', foreignKey: 'player_id' });
|
|
110
|
+
Serve.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
111
|
+
Player.hasMany(Serve, { as: 'Serves', foreignKey: 'player_id' });
|
|
112
|
+
Set.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
113
|
+
Player.hasMany(Set, { as: 'Sets', foreignKey: 'player_id' });
|
|
114
|
+
Spike.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
115
|
+
Player.hasMany(Spike, { as: 'Spikes', foreignKey: 'player_id' });
|
|
116
|
+
Substitution.belongsTo(Player, { as: 'player_out_Player', foreignKey: 'player_out' });
|
|
117
|
+
Player.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'player_out' });
|
|
118
|
+
Substitution.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
119
|
+
Player.hasMany(Substitution, { as: 'player_Substitutions', foreignKey: 'player_id' });
|
|
120
|
+
Block.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
121
|
+
Rally.hasMany(Block, { as: 'Blocks', foreignKey: 'rally_id' });
|
|
122
|
+
Event.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
123
|
+
Rally.hasMany(Event, { as: 'Events', foreignKey: 'rally_id' });
|
|
124
|
+
LiberoReplacement.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
125
|
+
Rally.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'rally_id' });
|
|
126
|
+
RallyPosition.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
127
|
+
Rally.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'rally_id' });
|
|
128
|
+
Reception.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
129
|
+
Rally.hasMany(Reception, { as: 'Receptions', foreignKey: 'rally_id' });
|
|
130
|
+
Score.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
131
|
+
Rally.hasMany(Score, { as: 'Scores', foreignKey: 'rally_id' });
|
|
132
|
+
Serve.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
133
|
+
Rally.hasMany(Serve, { as: 'Serves', foreignKey: 'rally_id' });
|
|
134
|
+
Set.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
135
|
+
Rally.hasMany(Set, { as: 'Sets', foreignKey: 'rally_id' });
|
|
136
|
+
Spike.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
137
|
+
Rally.hasMany(Spike, { as: 'Spikes', foreignKey: 'rally_id' });
|
|
138
|
+
Substitution.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
139
|
+
Rally.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'rally_id' });
|
|
140
|
+
SeasonTeams.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
|
|
141
|
+
Season.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'season_id' });
|
|
142
|
+
Match.belongsTo(Team, { as: 'homeTeam', foreignKey: 'home_team' });
|
|
143
|
+
Team.hasMany(Match, { as: 'Matches', foreignKey: 'home_team' });
|
|
144
|
+
Match.belongsTo(Team, { as: 'awayTeam', foreignKey: 'away_team' });
|
|
145
|
+
Team.hasMany(Match, { as: 'away_team_Matches', foreignKey: 'away_team' });
|
|
146
|
+
Player.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
147
|
+
Team.hasMany(Player, { as: 'Players', foreignKey: 'team_id' });
|
|
148
|
+
Rally.belongsTo(Team, { as: 'serving_team_Team', foreignKey: 'serving_team' });
|
|
149
|
+
Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
|
|
150
|
+
Score.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
151
|
+
Team.hasMany(Score, { as: 'Scores', foreignKey: 'team_id' });
|
|
152
|
+
SeasonTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
153
|
+
Team.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'team_id' });
|
|
154
|
+
Match.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
|
|
155
|
+
Season.hasMany(Match, { as: 'Matches', foreignKey: 'season_id' });
|
|
156
|
+
Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
|
|
157
|
+
League.hasMany(League, { as: 'Teams', foreignKey: 'league_id' });
|
|
158
|
+
return {
|
|
159
|
+
Block,
|
|
160
|
+
Coach,
|
|
161
|
+
Country,
|
|
162
|
+
Event,
|
|
163
|
+
League,
|
|
164
|
+
LiberoReplacement,
|
|
165
|
+
Match,
|
|
166
|
+
MatchSet,
|
|
167
|
+
MatchSetStats,
|
|
168
|
+
PerformanceStats,
|
|
169
|
+
Player,
|
|
170
|
+
Rally,
|
|
171
|
+
RallyPosition,
|
|
172
|
+
Reception,
|
|
173
|
+
Score,
|
|
174
|
+
Season,
|
|
175
|
+
SeasonTeams,
|
|
176
|
+
Serve,
|
|
177
|
+
Set,
|
|
178
|
+
Spike,
|
|
179
|
+
Substitution,
|
|
180
|
+
Team
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
exports.initModels = initModels;
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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
2
|
import { APIBlock, 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, 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, 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, APIEvent, APILiberoReplacement, APIRally, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution, APILeague, APIMatch, APIInPlayEvent, APIMatchSet, APIPlayer, APISeason, APITeam, APITrait, APISetStatistics, 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, 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 };
|
|
3
|
+
import { initModels, BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, 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, 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, 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, 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 };
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateUUID = exports.getRandomEnumValue = exports.Trait = exports.shuffle = exports.Team = exports.SpikeType = exports.SpikeFailure = exports.ReceptionFailure = exports.SetType = exports.SetFailure = exports.ServeType = exports.ServeFailure = exports.ReceptionType = exports.randomNumber = exports.RallyState = exports.Player = exports.MatchTeam = exports.getKeys = exports.generateModifier = exports.formatNumber = exports.CourtTarget = exports.CourtPosition = exports.CourtRow = exports.InPlayEvent = exports.Match = exports.MatchSetState = exports.BlockFailure = exports.LiberoReplacementType = exports.BlockType = exports.Substitution = exports.Spike = exports.Set = exports.Serve = exports.Score = exports.Reception = exports.RallyEvent = exports.Rally = exports.MatchSet = exports.LiberoReplacement = exports.EventType = exports.Block = exports.Formation = exports.PerformanceStats = exports.GeneralStat = exports.Role = exports.Coach = exports.Country = exports.Season = exports.Standing = exports.League = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.transformToRole = exports.transformToLeague = exports.transformToTrait = exports.transformToTeam = exports.transformToSeason = exports.transformToMatch = exports.transformToRally = exports.transformToPlayer = exports.transformToPerformanceStats = exports.transformToMatchSetStats = exports.transformToFormation = exports.transformToCourtTarget = exports.transformToCourtPosition = exports.transformToMatchSet = exports.transformToEventType = exports.transformToCountry = exports.transformToCoach = exports.transformToLiberoReplacement = exports.transformToAPILiberoReplacement = exports.transformFromLiberoReplacement = exports.transformToAPITrait = exports.transformToAPITeam = exports.transformToAPISeason = exports.transformToAPIRally = exports.transformToAPIPlayer = exports.transformToAPIMatchSetStats = exports.transformToAPIMatchSet = exports.transformToAPIMatch = exports.transformFromTrait = exports.transformFromTeam = exports.transformToSubstitution = exports.transformToAPISubstitution = exports.transformFromSubstitution = exports.transformToSpike = exports.transformToAPISpike = exports.transformFromSpike = exports.transformFromSet = exports.transformToServe = exports.transformToAPIServe = exports.transformFromServe = exports.transformFromEventType = void 0;
|
|
4
|
+
exports.transformFromScore = exports.transformFromRole = exports.transformFromReception = exports.transformFromPerformanceStats = exports.transformFromCourtTarget = exports.transformFromCourtPosition = exports.transformToPlayerPosition = exports.transformFromPlayerPosition = exports.transformFromPlayer = exports.transformFromLeague = exports.transformFromMatchSetStats = exports.transformFromMatchSet = exports.transformToSet = exports.transformToAPISet = exports.transformFromMatch = exports.transformFromFormation = exports.transformToScore = exports.transformToAPIScore = exports.transformToReception = exports.transformToAPIReception = exports.transformFromRally = exports.transformFromCountry = exports.transformFromCoach = exports.transformToBlock = exports.transformToAPIBlock = exports.transformFromBlock = exports.SubstitutionModel = exports.TeamModel = exports.SpikeModel = exports.SetModel = exports.ServeModel = exports.SeasonModel = exports.SeasonTeamsModel = exports.PlayerModel = exports.MatchModel = exports.LeagueModel = exports.RallyPositionModel = exports.CoachModel = exports.ScoreModel = exports.CountryModel = exports.ReceptionModel = exports.MatchSetStatsModel = exports.LiberoReplacementModel = exports.PerformanceStatsModel = exports.MatchSetModel = exports.EventModel = exports.RallyModel = exports.BlockModel = exports.initModels = exports.APITrait = void 0;
|
|
5
|
+
exports.transformToRole = exports.transformToLeague = exports.transformToTrait = exports.transformToTeam = exports.transformToSeason = exports.transformToMatch = exports.transformToRally = exports.transformToPlayer = exports.transformToPerformanceStats = exports.transformToMatchSetStats = exports.transformToFormation = exports.transformToCourtTarget = exports.transformToCourtPosition = exports.transformToMatchSet = exports.transformToEventType = exports.transformToCountry = exports.transformToCoach = exports.transformToLiberoReplacement = exports.transformToAPILiberoReplacement = exports.transformFromLiberoReplacement = exports.transformToAPITrait = exports.transformToAPITeam = exports.transformToAPISeason = exports.transformToAPIRally = exports.transformToAPIPlayer = exports.transformToAPIMatchSetStats = exports.transformToAPIMatchSet = exports.transformToAPIMatch = exports.transformFromTrait = exports.transformFromTeam = exports.transformToSubstitution = exports.transformToAPISubstitution = exports.transformFromSubstitution = exports.transformToSpike = exports.transformToAPISpike = exports.transformFromSpike = exports.transformFromSet = exports.transformToServe = exports.transformToAPIServe = exports.transformFromServe = exports.transformFromEventType = exports.transformFromSeason = void 0;
|
|
6
6
|
const service_1 = require("./service");
|
|
7
7
|
Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return service_1.Block; } });
|
|
8
8
|
Object.defineProperty(exports, "BlockFailure", { enumerable: true, get: function () { return service_1.BlockFailure; } });
|
|
@@ -57,6 +57,7 @@ Object.defineProperty(exports, "validateUUID", { enumerable: true, get: function
|
|
|
57
57
|
const routing_1 = require("./routing");
|
|
58
58
|
Object.defineProperty(exports, "APITrait", { enumerable: true, get: function () { return routing_1.APITrait; } });
|
|
59
59
|
const data_1 = require("./data");
|
|
60
|
+
Object.defineProperty(exports, "initModels", { enumerable: true, get: function () { return data_1.initModels; } });
|
|
60
61
|
Object.defineProperty(exports, "BlockModel", { enumerable: true, get: function () { return data_1.BlockModel; } });
|
|
61
62
|
Object.defineProperty(exports, "CoachModel", { enumerable: true, get: function () { return data_1.CoachModel; } });
|
|
62
63
|
Object.defineProperty(exports, "CountryModel", { enumerable: true, get: function () { return data_1.CountryModel; } });
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Season } from './season';
|
|
2
2
|
import { Country } from '../country';
|
|
3
|
-
import { Team } from '../team';
|
|
4
|
-
import { Match } from '../match';
|
|
5
3
|
export interface LeagueOpts {
|
|
6
4
|
readonly id: string;
|
|
7
5
|
readonly name: string;
|
|
@@ -14,6 +12,4 @@ export declare class League {
|
|
|
14
12
|
readonly seasons: Season[];
|
|
15
13
|
readonly country: Country;
|
|
16
14
|
constructor({ id, name, country, seasons }: LeagueOpts);
|
|
17
|
-
newSeason(teams: Team[]): Season;
|
|
18
|
-
static generateMatches(teams: Team[], baseDate: Date): Match[];
|
|
19
15
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.League = void 0;
|
|
7
|
-
const season_1 = require("./season");
|
|
8
|
-
const match_1 = require("../match");
|
|
9
|
-
const moment_1 = __importDefault(require("moment/moment"));
|
|
10
|
-
const utils_1 = require("../utils");
|
|
11
|
-
const uuid_1 = require("uuid");
|
|
12
4
|
class League {
|
|
13
5
|
constructor({ id, name, country, seasons }) {
|
|
14
6
|
this.id = id;
|
|
@@ -16,72 +8,5 @@ class League {
|
|
|
16
8
|
this.country = country;
|
|
17
9
|
this.seasons = seasons;
|
|
18
10
|
}
|
|
19
|
-
newSeason(teams) {
|
|
20
|
-
const matches = League.generateMatches(teams, (0, moment_1.default)().add(4, 'hour').toDate());
|
|
21
|
-
const season = new season_1.Season({
|
|
22
|
-
id: (0, uuid_1.v4)(),
|
|
23
|
-
iteration: this.seasons.length,
|
|
24
|
-
teams,
|
|
25
|
-
matches
|
|
26
|
-
});
|
|
27
|
-
this.seasons.push(season);
|
|
28
|
-
return season;
|
|
29
|
-
}
|
|
30
|
-
static generateMatches(teams, baseDate) {
|
|
31
|
-
const t = new Set(teams.map(x => x.id));
|
|
32
|
-
const date = (0, moment_1.default)(baseDate);
|
|
33
|
-
date.startOf('hour');
|
|
34
|
-
if (t.size !== teams.length) {
|
|
35
|
-
throw new Error('DUPLICATE_TEAMS');
|
|
36
|
-
}
|
|
37
|
-
let shuffled = (0, utils_1.shuffle)([...teams]);
|
|
38
|
-
const l = shuffled.length - 1;
|
|
39
|
-
const half = Math.ceil(shuffled.length / 2);
|
|
40
|
-
const matches = [];
|
|
41
|
-
// We fix the first team
|
|
42
|
-
let firstTeam = shuffled.shift();
|
|
43
|
-
if (firstTeam == null) {
|
|
44
|
-
throw new Error('EMPTY_TEAM_ARRAY');
|
|
45
|
-
}
|
|
46
|
-
let homeRow;
|
|
47
|
-
let awayRow;
|
|
48
|
-
for (let i = 0; i < l; i++) {
|
|
49
|
-
// split array in 2 halves
|
|
50
|
-
const row1 = shuffled.slice(0, half);
|
|
51
|
-
const row2 = shuffled.slice(half);
|
|
52
|
-
const scheduledDate = date.add(30, 'minutes').toDate();
|
|
53
|
-
row2.push(firstTeam);
|
|
54
|
-
if (i % 2 === 0) {
|
|
55
|
-
homeRow = row1;
|
|
56
|
-
awayRow = row2;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
homeRow = row2;
|
|
60
|
-
awayRow = row1;
|
|
61
|
-
}
|
|
62
|
-
for (let j = 0; j < half; j++) {
|
|
63
|
-
matches.push(new match_1.Match({
|
|
64
|
-
id: (0, uuid_1.v4)(),
|
|
65
|
-
homeTeam: homeRow[j],
|
|
66
|
-
awayTeam: awayRow[j],
|
|
67
|
-
scheduledDate,
|
|
68
|
-
sets: []
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
firstTeam = row2.pop();
|
|
72
|
-
row1.unshift(row2.shift());
|
|
73
|
-
row2.push(row1.pop());
|
|
74
|
-
shuffled = [...row1, ...row2];
|
|
75
|
-
}
|
|
76
|
-
// Generate Inverted matches for home-away pairings
|
|
77
|
-
matches.push(...matches.map(match => new match_1.Match({
|
|
78
|
-
id: (0, uuid_1.v4)(),
|
|
79
|
-
homeTeam: match.awayTeam,
|
|
80
|
-
awayTeam: match.homeTeam,
|
|
81
|
-
scheduledDate: date.add(30, 'minutes').toDate(),
|
|
82
|
-
sets: []
|
|
83
|
-
})));
|
|
84
|
-
return matches;
|
|
85
|
-
}
|
|
86
11
|
}
|
|
87
12
|
exports.League = League;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, 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 } from './models';
|
|
2
2
|
import { 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, 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 './transformers';
|
|
3
|
-
|
|
3
|
+
import { initModels } from './init-models';
|
|
4
|
+
export { initModels, BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, 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, 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 };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, } from './models';
|
|
2
2
|
import { 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, 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 './transformers';
|
|
3
|
-
|
|
3
|
+
import { initModels } from './init-models';
|
|
4
|
+
export { initModels, BlockModel, CoachModel, CountryModel, EventModel, 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, 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 };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Sequelize } from 'sequelize';
|
|
2
|
+
import { BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel } from './models';
|
|
3
|
+
export declare function initModels(sequelize: Sequelize): {
|
|
4
|
+
Block: typeof BlockModel;
|
|
5
|
+
Coach: typeof CoachModel;
|
|
6
|
+
Country: typeof CountryModel;
|
|
7
|
+
Event: typeof EventModel;
|
|
8
|
+
League: typeof LeagueModel;
|
|
9
|
+
LiberoReplacement: typeof LiberoReplacementModel;
|
|
10
|
+
Match: typeof MatchModel;
|
|
11
|
+
MatchSet: typeof MatchSetModel;
|
|
12
|
+
MatchSetStats: typeof MatchSetStatsModel;
|
|
13
|
+
PerformanceStats: typeof PerformanceStatsModel;
|
|
14
|
+
Player: typeof PlayerModel;
|
|
15
|
+
Rally: typeof RallyModel;
|
|
16
|
+
RallyPosition: typeof RallyPositionModel;
|
|
17
|
+
Reception: typeof ReceptionModel;
|
|
18
|
+
Score: typeof ScoreModel;
|
|
19
|
+
Season: typeof SeasonModel;
|
|
20
|
+
SeasonTeams: typeof SeasonTeamsModel;
|
|
21
|
+
Serve: typeof ServeModel;
|
|
22
|
+
Set: typeof SetModel;
|
|
23
|
+
Spike: typeof SpikeModel;
|
|
24
|
+
Substitution: typeof SubstitutionModel;
|
|
25
|
+
Team: typeof TeamModel;
|
|
26
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel } from './models';
|
|
2
|
+
export function initModels(sequelize) {
|
|
3
|
+
const Block = BlockModel.initModel(sequelize);
|
|
4
|
+
const Coach = CoachModel.initModel(sequelize);
|
|
5
|
+
const Country = CountryModel.initModel(sequelize);
|
|
6
|
+
const Event = EventModel.initModel(sequelize);
|
|
7
|
+
const League = LeagueModel.initModel(sequelize);
|
|
8
|
+
const LiberoReplacement = LiberoReplacementModel.initModel(sequelize);
|
|
9
|
+
const Match = MatchModel.initModel(sequelize);
|
|
10
|
+
const MatchSet = MatchSetModel.initModel(sequelize);
|
|
11
|
+
const MatchSetStats = MatchSetStatsModel.initModel(sequelize);
|
|
12
|
+
const PerformanceStats = PerformanceStatsModel.initModel(sequelize);
|
|
13
|
+
const Player = PlayerModel.initModel(sequelize);
|
|
14
|
+
const Rally = RallyModel.initModel(sequelize);
|
|
15
|
+
const RallyPosition = RallyPositionModel.initModel(sequelize);
|
|
16
|
+
const Reception = ReceptionModel.initModel(sequelize);
|
|
17
|
+
const Score = ScoreModel.initModel(sequelize);
|
|
18
|
+
const Season = SeasonModel.initModel(sequelize);
|
|
19
|
+
const SeasonTeams = SeasonTeamsModel.initModel(sequelize);
|
|
20
|
+
const Serve = ServeModel.initModel(sequelize);
|
|
21
|
+
const Set = SetModel.initModel(sequelize);
|
|
22
|
+
const Spike = SpikeModel.initModel(sequelize);
|
|
23
|
+
const Substitution = SubstitutionModel.initModel(sequelize);
|
|
24
|
+
const Team = TeamModel.initModel(sequelize);
|
|
25
|
+
MatchSet.belongsToMany(Player, {
|
|
26
|
+
as: 'player_id_Players',
|
|
27
|
+
through: MatchSetStats,
|
|
28
|
+
foreignKey: 'match_set_id',
|
|
29
|
+
otherKey: 'player_id'
|
|
30
|
+
});
|
|
31
|
+
Player.belongsToMany(MatchSet, {
|
|
32
|
+
as: 'match_set_id_MatchSets',
|
|
33
|
+
through: MatchSetStats,
|
|
34
|
+
foreignKey: 'player_id',
|
|
35
|
+
otherKey: 'match_set_id'
|
|
36
|
+
});
|
|
37
|
+
Player.belongsToMany(Rally, {
|
|
38
|
+
as: 'rally_id_Rallies',
|
|
39
|
+
through: RallyPosition,
|
|
40
|
+
foreignKey: 'player_id',
|
|
41
|
+
otherKey: 'rally_id'
|
|
42
|
+
});
|
|
43
|
+
Rally.belongsToMany(Player, {
|
|
44
|
+
as: 'player_id_Player_RallyPositions',
|
|
45
|
+
through: RallyPosition,
|
|
46
|
+
foreignKey: 'rally_id',
|
|
47
|
+
otherKey: 'player_id'
|
|
48
|
+
});
|
|
49
|
+
Season.belongsToMany(Team, {
|
|
50
|
+
as: 'seasonTeams',
|
|
51
|
+
through: SeasonTeams,
|
|
52
|
+
foreignKey: 'season_id',
|
|
53
|
+
otherKey: 'team_id'
|
|
54
|
+
});
|
|
55
|
+
Team.belongsToMany(Season, {
|
|
56
|
+
as: 'season_id_Seasons',
|
|
57
|
+
through: SeasonTeams,
|
|
58
|
+
foreignKey: 'team_id',
|
|
59
|
+
otherKey: 'season_id'
|
|
60
|
+
});
|
|
61
|
+
Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
|
|
62
|
+
Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
|
|
63
|
+
Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
64
|
+
Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
|
|
65
|
+
League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
66
|
+
Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
|
|
67
|
+
Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
68
|
+
Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
|
|
69
|
+
Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
70
|
+
Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
|
|
71
|
+
Season.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
|
|
72
|
+
League.hasMany(Season, { as: 'Seasons', foreignKey: 'league_id' });
|
|
73
|
+
MatchSet.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
|
|
74
|
+
Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
|
|
75
|
+
MatchSetStats.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
|
|
76
|
+
MatchSet.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'match_set_id' });
|
|
77
|
+
Rally.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
|
|
78
|
+
MatchSet.hasMany(Rally, { as: 'Rallies', foreignKey: 'match_set_id' });
|
|
79
|
+
Block.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
80
|
+
Player.hasMany(Block, { as: 'Blocks', foreignKey: 'player_id' });
|
|
81
|
+
Block.belongsTo(Player, { as: 'blocker_1_Player', foreignKey: 'blocker_1' });
|
|
82
|
+
Player.hasMany(Block, { as: 'blocker_1_Blocks', foreignKey: 'blocker_1' });
|
|
83
|
+
Block.belongsTo(Player, { as: 'blocker_2_Player', foreignKey: 'blocker_2' });
|
|
84
|
+
Player.hasMany(Block, { as: 'blocker_2_Blocks', foreignKey: 'blocker_2' });
|
|
85
|
+
Block.belongsTo(Player, { as: 'blocker_3_Player', foreignKey: 'blocker_3' });
|
|
86
|
+
Player.hasMany(Block, { as: 'blocker_3_Blocks', foreignKey: 'blocker_3' });
|
|
87
|
+
Event.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
88
|
+
Player.hasMany(Event, { as: 'Events', foreignKey: 'player_id' });
|
|
89
|
+
LiberoReplacement.belongsTo(Player, { as: 'libero_Player', foreignKey: 'libero' });
|
|
90
|
+
Player.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'libero' });
|
|
91
|
+
LiberoReplacement.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
92
|
+
Player.hasMany(LiberoReplacement, { as: 'player_LiberoReplacements', foreignKey: 'player_id' });
|
|
93
|
+
MatchSet.belongsTo(Player, { as: 'away_libero_Player', foreignKey: 'away_libero' });
|
|
94
|
+
Player.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'away_libero' });
|
|
95
|
+
MatchSet.belongsTo(Player, { as: 'home_libero_Player', foreignKey: 'home_libero' });
|
|
96
|
+
Player.hasMany(MatchSet, { as: 'home_libero_MatchSets', foreignKey: 'home_libero' });
|
|
97
|
+
MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
98
|
+
Player.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'player_id' });
|
|
99
|
+
PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
100
|
+
Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
|
|
101
|
+
RallyPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
102
|
+
Player.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'player_id' });
|
|
103
|
+
Reception.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
104
|
+
Player.hasMany(Reception, { as: 'Receptions', foreignKey: 'player_id' });
|
|
105
|
+
Score.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
106
|
+
Player.hasMany(Score, { as: 'Scores', foreignKey: 'player_id' });
|
|
107
|
+
Serve.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
108
|
+
Player.hasMany(Serve, { as: 'Serves', foreignKey: 'player_id' });
|
|
109
|
+
Set.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
110
|
+
Player.hasMany(Set, { as: 'Sets', foreignKey: 'player_id' });
|
|
111
|
+
Spike.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
112
|
+
Player.hasMany(Spike, { as: 'Spikes', foreignKey: 'player_id' });
|
|
113
|
+
Substitution.belongsTo(Player, { as: 'player_out_Player', foreignKey: 'player_out' });
|
|
114
|
+
Player.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'player_out' });
|
|
115
|
+
Substitution.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
116
|
+
Player.hasMany(Substitution, { as: 'player_Substitutions', foreignKey: 'player_id' });
|
|
117
|
+
Block.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
118
|
+
Rally.hasMany(Block, { as: 'Blocks', foreignKey: 'rally_id' });
|
|
119
|
+
Event.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
120
|
+
Rally.hasMany(Event, { as: 'Events', foreignKey: 'rally_id' });
|
|
121
|
+
LiberoReplacement.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
122
|
+
Rally.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'rally_id' });
|
|
123
|
+
RallyPosition.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
124
|
+
Rally.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'rally_id' });
|
|
125
|
+
Reception.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
126
|
+
Rally.hasMany(Reception, { as: 'Receptions', foreignKey: 'rally_id' });
|
|
127
|
+
Score.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
128
|
+
Rally.hasMany(Score, { as: 'Scores', foreignKey: 'rally_id' });
|
|
129
|
+
Serve.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
130
|
+
Rally.hasMany(Serve, { as: 'Serves', foreignKey: 'rally_id' });
|
|
131
|
+
Set.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
132
|
+
Rally.hasMany(Set, { as: 'Sets', foreignKey: 'rally_id' });
|
|
133
|
+
Spike.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
134
|
+
Rally.hasMany(Spike, { as: 'Spikes', foreignKey: 'rally_id' });
|
|
135
|
+
Substitution.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
|
|
136
|
+
Rally.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'rally_id' });
|
|
137
|
+
SeasonTeams.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
|
|
138
|
+
Season.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'season_id' });
|
|
139
|
+
Match.belongsTo(Team, { as: 'homeTeam', foreignKey: 'home_team' });
|
|
140
|
+
Team.hasMany(Match, { as: 'Matches', foreignKey: 'home_team' });
|
|
141
|
+
Match.belongsTo(Team, { as: 'awayTeam', foreignKey: 'away_team' });
|
|
142
|
+
Team.hasMany(Match, { as: 'away_team_Matches', foreignKey: 'away_team' });
|
|
143
|
+
Player.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
144
|
+
Team.hasMany(Player, { as: 'Players', foreignKey: 'team_id' });
|
|
145
|
+
Rally.belongsTo(Team, { as: 'serving_team_Team', foreignKey: 'serving_team' });
|
|
146
|
+
Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
|
|
147
|
+
Score.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
148
|
+
Team.hasMany(Score, { as: 'Scores', foreignKey: 'team_id' });
|
|
149
|
+
SeasonTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
150
|
+
Team.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'team_id' });
|
|
151
|
+
Match.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
|
|
152
|
+
Season.hasMany(Match, { as: 'Matches', foreignKey: 'season_id' });
|
|
153
|
+
Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
|
|
154
|
+
League.hasMany(League, { as: 'Teams', foreignKey: 'league_id' });
|
|
155
|
+
return {
|
|
156
|
+
Block,
|
|
157
|
+
Coach,
|
|
158
|
+
Country,
|
|
159
|
+
Event,
|
|
160
|
+
League,
|
|
161
|
+
LiberoReplacement,
|
|
162
|
+
Match,
|
|
163
|
+
MatchSet,
|
|
164
|
+
MatchSetStats,
|
|
165
|
+
PerformanceStats,
|
|
166
|
+
Player,
|
|
167
|
+
Rally,
|
|
168
|
+
RallyPosition,
|
|
169
|
+
Reception,
|
|
170
|
+
Score,
|
|
171
|
+
Season,
|
|
172
|
+
SeasonTeams,
|
|
173
|
+
Serve,
|
|
174
|
+
Set,
|
|
175
|
+
Spike,
|
|
176
|
+
Substitution,
|
|
177
|
+
Team
|
|
178
|
+
};
|
|
179
|
+
}
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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
2
|
import { APIBlock, 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, 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, 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, APIEvent, APILiberoReplacement, APIRally, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution, APILeague, APIMatch, APIInPlayEvent, APIMatchSet, APIPlayer, APISeason, APITeam, APITrait, APISetStatistics, 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, 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 };
|
|
3
|
+
import { initModels, BlockAttributes, BlockCreationAttributes, BlockId, BlockModel, BlockOptionalAttributes, BlockPk, CoachAttributes, CoachCreationAttributes, CoachId, CoachModel, CoachOptionalAttributes, CoachPk, CountryAttributes, CountryCreationAttributes, CountryId, CountryModel, CountryPk, EventAttributes, EventCreationAttributes, EventId, EventModel, EventPk, 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, 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, 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, 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 };
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
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';
|
|
2
2
|
import { APITrait } from './routing';
|
|
3
|
-
import { BlockModel, CoachModel, CountryModel, EventModel, 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, 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, BlockModel, RallyModel, EventModel, MatchSetModel, PerformanceStatsModel, LiberoReplacementModel, MatchSetStatsModel, ReceptionModel, CountryModel, ScoreModel, CoachModel, RallyPositionModel, LeagueModel, MatchModel, 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 { initModels, BlockModel, CoachModel, CountryModel, EventModel, 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, 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, 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 };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Season } from './season';
|
|
2
2
|
import { Country } from '../country';
|
|
3
|
-
import { Team } from '../team';
|
|
4
|
-
import { Match } from '../match';
|
|
5
3
|
export interface LeagueOpts {
|
|
6
4
|
readonly id: string;
|
|
7
5
|
readonly name: string;
|
|
@@ -14,6 +12,4 @@ export declare class League {
|
|
|
14
12
|
readonly seasons: Season[];
|
|
15
13
|
readonly country: Country;
|
|
16
14
|
constructor({ id, name, country, seasons }: LeagueOpts);
|
|
17
|
-
newSeason(teams: Team[]): Season;
|
|
18
|
-
static generateMatches(teams: Team[], baseDate: Date): Match[];
|
|
19
15
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { Season } from './season';
|
|
2
|
-
import { Match } from '../match';
|
|
3
|
-
import moment from 'moment/moment';
|
|
4
|
-
import { shuffle } from '../utils';
|
|
5
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
6
1
|
export class League {
|
|
7
2
|
constructor({ id, name, country, seasons }) {
|
|
8
3
|
this.id = id;
|
|
@@ -10,71 +5,4 @@ export class League {
|
|
|
10
5
|
this.country = country;
|
|
11
6
|
this.seasons = seasons;
|
|
12
7
|
}
|
|
13
|
-
newSeason(teams) {
|
|
14
|
-
const matches = League.generateMatches(teams, moment().add(4, 'hour').toDate());
|
|
15
|
-
const season = new Season({
|
|
16
|
-
id: uuidv4(),
|
|
17
|
-
iteration: this.seasons.length,
|
|
18
|
-
teams,
|
|
19
|
-
matches
|
|
20
|
-
});
|
|
21
|
-
this.seasons.push(season);
|
|
22
|
-
return season;
|
|
23
|
-
}
|
|
24
|
-
static generateMatches(teams, baseDate) {
|
|
25
|
-
const t = new Set(teams.map(x => x.id));
|
|
26
|
-
const date = moment(baseDate);
|
|
27
|
-
date.startOf('hour');
|
|
28
|
-
if (t.size !== teams.length) {
|
|
29
|
-
throw new Error('DUPLICATE_TEAMS');
|
|
30
|
-
}
|
|
31
|
-
let shuffled = shuffle([...teams]);
|
|
32
|
-
const l = shuffled.length - 1;
|
|
33
|
-
const half = Math.ceil(shuffled.length / 2);
|
|
34
|
-
const matches = [];
|
|
35
|
-
// We fix the first team
|
|
36
|
-
let firstTeam = shuffled.shift();
|
|
37
|
-
if (firstTeam == null) {
|
|
38
|
-
throw new Error('EMPTY_TEAM_ARRAY');
|
|
39
|
-
}
|
|
40
|
-
let homeRow;
|
|
41
|
-
let awayRow;
|
|
42
|
-
for (let i = 0; i < l; i++) {
|
|
43
|
-
// split array in 2 halves
|
|
44
|
-
const row1 = shuffled.slice(0, half);
|
|
45
|
-
const row2 = shuffled.slice(half);
|
|
46
|
-
const scheduledDate = date.add(30, 'minutes').toDate();
|
|
47
|
-
row2.push(firstTeam);
|
|
48
|
-
if (i % 2 === 0) {
|
|
49
|
-
homeRow = row1;
|
|
50
|
-
awayRow = row2;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
homeRow = row2;
|
|
54
|
-
awayRow = row1;
|
|
55
|
-
}
|
|
56
|
-
for (let j = 0; j < half; j++) {
|
|
57
|
-
matches.push(new Match({
|
|
58
|
-
id: uuidv4(),
|
|
59
|
-
homeTeam: homeRow[j],
|
|
60
|
-
awayTeam: awayRow[j],
|
|
61
|
-
scheduledDate,
|
|
62
|
-
sets: []
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
firstTeam = row2.pop();
|
|
66
|
-
row1.unshift(row2.shift());
|
|
67
|
-
row2.push(row1.pop());
|
|
68
|
-
shuffled = [...row1, ...row2];
|
|
69
|
-
}
|
|
70
|
-
// Generate Inverted matches for home-away pairings
|
|
71
|
-
matches.push(...matches.map(match => new Match({
|
|
72
|
-
id: uuidv4(),
|
|
73
|
-
homeTeam: match.awayTeam,
|
|
74
|
-
awayTeam: match.homeTeam,
|
|
75
|
-
scheduledDate: date.add(30, 'minutes').toDate(),
|
|
76
|
-
sets: []
|
|
77
|
-
})));
|
|
78
|
-
return matches;
|
|
79
|
-
}
|
|
80
8
|
}
|