@mtgame/core 1.0.36 → 1.0.38

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.
@@ -15,4 +15,5 @@ export declare class HockeyGameApi extends GameBaseApi {
15
15
  getLogs(gameId: number): Promise<HockeyGameLog[]>;
16
16
  downloadProtocol(gameId: number, format: 'pdf' | 'xlsx' | 'html'): Promise<any>;
17
17
  downloadApplication(gameId: number, format: 'pdf' | 'xlsx' | 'html', type: 'game_user' | 'tournament_user'): Promise<any>;
18
+ downloadShlApplication(gameId: number, format: 'pdf' | 'xlsx' | 'html', type: 'game_user' | 'tournament_user'): Promise<any>;
18
19
  }
@@ -33,6 +33,7 @@ import { GameBasketballPosition } from '../models/basketball-profile';
33
33
  import { GameVolleyballPosition } from '../models/volleyball-profile';
34
34
  import { GameRugbyPosition } from '../models/rugby-profile';
35
35
  import { WrestballStatistic } from '../models/wrestball-statistic';
36
+ import { TournamentRoundTeam } from '../models/tournament-round-team';
36
37
  export interface TournamentGamesFilters {
37
38
  tournamentIds?: number[];
38
39
  tournamentSeasonId?: number;
@@ -146,6 +147,7 @@ export declare class TournamentApi {
146
147
  getStageTeams(tournamentId: number): Promise<TournamentStageTeam[]>;
147
148
  getTeamsAchievements(tournamentId: number): Promise<TeamAchievement[]>;
148
149
  getTeamById(tournamentTeamId: number): Promise<TournamentTeam>;
150
+ getTeamRoundTeams(tournamentTeamId: number): Promise<TournamentRoundTeam[]>;
149
151
  getUserById(userId: number): Promise<TournamentTeamUser>;
150
152
  getUserGames(tournamentUserId: number): Promise<Game[]>;
151
153
  downloadTable(tournamentId: number, format: 'pdf' | 'xlsx', isChess?: boolean): Promise<any>;
@@ -5680,6 +5680,16 @@
5680
5680
  });
5681
5681
  });
5682
5682
  };
5683
+ HockeyGameApi.prototype.downloadShlApplication = function (gameId, format, type) {
5684
+ return __awaiter(this, void 0, void 0, function () {
5685
+ return __generator(this, function (_a) {
5686
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_hockey_game/" + gameId + "/shl_game_application_file/", {
5687
+ params: new i1.HttpParams().set('file_type', format).set('application_type', type),
5688
+ responseType: 'blob'
5689
+ }).toPromise()];
5690
+ });
5691
+ });
5692
+ };
5683
5693
  return HockeyGameApi;
5684
5694
  }(GameBaseApi));
5685
5695
  HockeyGameApi.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function HockeyGameApi_Factory() { return new HockeyGameApi(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(ConfigService)); }, token: HockeyGameApi, providedIn: "root" });
@@ -8134,6 +8144,108 @@
8134
8144
  })
8135
8145
  ], exports.WrestballStatistic);
8136
8146
 
8147
+ exports.RoundTeamGame = /** @class */ (function (_super) {
8148
+ __extends(RoundTeamGame, _super);
8149
+ function RoundTeamGame() {
8150
+ return _super !== null && _super.apply(this, arguments) || this;
8151
+ }
8152
+ RoundTeamGame.toFront = function (data) { };
8153
+ RoundTeamGame.toBack = function (data) { };
8154
+ return RoundTeamGame;
8155
+ }(BaseModel));
8156
+ __decorate([
8157
+ ToFrontHook
8158
+ ], exports.RoundTeamGame, "toFront", null);
8159
+ __decorate([
8160
+ ToBackHook
8161
+ ], exports.RoundTeamGame, "toBack", null);
8162
+ exports.RoundTeamGame = __decorate([
8163
+ ModelInstance({
8164
+ mappingFields: {
8165
+ id: 'id',
8166
+ team_id: 'teamId',
8167
+ competitor_team_id: 'competitorTeamId',
8168
+ team_score: 'teamScore',
8169
+ competitor_team_score: 'competitorTeamScore',
8170
+ }
8171
+ })
8172
+ ], exports.RoundTeamGame);
8173
+ exports.TournamentRoundTeam = /** @class */ (function (_super) {
8174
+ __extends(TournamentRoundTeam, _super);
8175
+ function TournamentRoundTeam() {
8176
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
8177
+ _this.gamesMapping = {};
8178
+ return _this;
8179
+ }
8180
+ Object.defineProperty(TournamentRoundTeam.prototype, "games", {
8181
+ get: function () {
8182
+ return this._games;
8183
+ },
8184
+ set: function (value) {
8185
+ var _this = this;
8186
+ this._games = value;
8187
+ this.gamesMapping = value.reduce(function (acc, game) {
8188
+ var _a;
8189
+ var competitorTeamId = game.teamId === _this.tournamentTeam.team.id ? game.competitorTeamId : game.teamId;
8190
+ return Object.assign(Object.assign({}, acc), (_a = {}, _a[competitorTeamId] = __spreadArray(__spreadArray([], __read((acc[competitorTeamId] || []))), [
8191
+ game,
8192
+ ]), _a));
8193
+ }, {});
8194
+ },
8195
+ enumerable: false,
8196
+ configurable: true
8197
+ });
8198
+ TournamentRoundTeam.toFront = function (data) { };
8199
+ TournamentRoundTeam.toBack = function (data) { };
8200
+ return TournamentRoundTeam;
8201
+ }(BaseModel));
8202
+ __decorate([
8203
+ ToFrontHook
8204
+ ], exports.TournamentRoundTeam, "toFront", null);
8205
+ __decorate([
8206
+ ToBackHook
8207
+ ], exports.TournamentRoundTeam, "toBack", null);
8208
+ exports.TournamentRoundTeam = __decorate([
8209
+ ModelInstance({
8210
+ mappingFields: {
8211
+ id: 'id',
8212
+ tournament_team: 'tournamentTeam',
8213
+ group: 'group',
8214
+ division: 'division',
8215
+ division_id: 'divisionId',
8216
+ points: 'points',
8217
+ handicap: 'handicap',
8218
+ games_count: 'gamesCount',
8219
+ won_games_count: 'wonGamesCount',
8220
+ lose_games_count: 'loseGamesCount',
8221
+ draw_games_count: 'drawGamesCount',
8222
+ score_sum: 'scoreSum',
8223
+ missed_sum: 'missedSum',
8224
+ games_won_percent: 'gamesWonPercent',
8225
+ score_points_sum: 'scorePointsSum',
8226
+ missed_points_sum: 'missedPointsSum',
8227
+ win_normal_time_games_count: 'winNormalTimeGamesCount',
8228
+ lose_normal_time_games_count: 'loseNormalTimeGamesCount',
8229
+ win_overtime_games_count: 'winOvertimeGamesCount',
8230
+ lose_overtime_games_count: 'loseOvertimeGamesCount',
8231
+ last_games_won: 'lastGamesWon',
8232
+ last_games_count: 'lastGamesCount',
8233
+ tries_scored: 'triesScored',
8234
+ tries_missed: 'triesMissed',
8235
+ attack_bonuses: 'attackBonuses',
8236
+ defense_bonuses: 'defenseBonuses',
8237
+ games_by_score_count: 'gamesByScoreCount',
8238
+ games: 'games',
8239
+ },
8240
+ relation: {
8241
+ group: exports.TournamentGroup,
8242
+ division: exports.TournamentDivision,
8243
+ tournamentTeam: exports.TournamentTeam,
8244
+ games: listField(exports.RoundTeamGame),
8245
+ }
8246
+ })
8247
+ ], exports.TournamentRoundTeam);
8248
+
8137
8249
  var TournamentApi = /** @class */ (function () {
8138
8250
  function TournamentApi(httpClient, configService) {
8139
8251
  this.httpClient = httpClient;
@@ -8339,6 +8451,13 @@
8339
8451
  });
8340
8452
  });
8341
8453
  };
8454
+ TournamentApi.prototype.getTeamRoundTeams = function (tournamentTeamId) {
8455
+ return __awaiter(this, void 0, void 0, function () {
8456
+ return __generator(this, function (_a) {
8457
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/tournament_round_teams/").pipe(operators.map(function (response) { return exports.TournamentRoundTeam.toFront(response); })).toPromise()];
8458
+ });
8459
+ });
8460
+ };
8342
8461
  TournamentApi.prototype.getUserById = function (userId) {
8343
8462
  return __awaiter(this, void 0, void 0, function () {
8344
8463
  return __generator(this, function (_a) {
@@ -11494,108 +11613,6 @@
11494
11613
  { type: ConfigService }
11495
11614
  ]; };
11496
11615
 
11497
- exports.RoundTeamGame = /** @class */ (function (_super) {
11498
- __extends(RoundTeamGame, _super);
11499
- function RoundTeamGame() {
11500
- return _super !== null && _super.apply(this, arguments) || this;
11501
- }
11502
- RoundTeamGame.toFront = function (data) { };
11503
- RoundTeamGame.toBack = function (data) { };
11504
- return RoundTeamGame;
11505
- }(BaseModel));
11506
- __decorate([
11507
- ToFrontHook
11508
- ], exports.RoundTeamGame, "toFront", null);
11509
- __decorate([
11510
- ToBackHook
11511
- ], exports.RoundTeamGame, "toBack", null);
11512
- exports.RoundTeamGame = __decorate([
11513
- ModelInstance({
11514
- mappingFields: {
11515
- id: 'id',
11516
- team_id: 'teamId',
11517
- competitor_team_id: 'competitorTeamId',
11518
- team_score: 'teamScore',
11519
- competitor_team_score: 'competitorTeamScore',
11520
- }
11521
- })
11522
- ], exports.RoundTeamGame);
11523
- exports.TournamentRoundTeam = /** @class */ (function (_super) {
11524
- __extends(TournamentRoundTeam, _super);
11525
- function TournamentRoundTeam() {
11526
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
11527
- _this.gamesMapping = {};
11528
- return _this;
11529
- }
11530
- Object.defineProperty(TournamentRoundTeam.prototype, "games", {
11531
- get: function () {
11532
- return this._games;
11533
- },
11534
- set: function (value) {
11535
- var _this = this;
11536
- this._games = value;
11537
- this.gamesMapping = value.reduce(function (acc, game) {
11538
- var _a;
11539
- var competitorTeamId = game.teamId === _this.tournamentTeam.team.id ? game.competitorTeamId : game.teamId;
11540
- return Object.assign(Object.assign({}, acc), (_a = {}, _a[competitorTeamId] = __spreadArray(__spreadArray([], __read((acc[competitorTeamId] || []))), [
11541
- game,
11542
- ]), _a));
11543
- }, {});
11544
- },
11545
- enumerable: false,
11546
- configurable: true
11547
- });
11548
- TournamentRoundTeam.toFront = function (data) { };
11549
- TournamentRoundTeam.toBack = function (data) { };
11550
- return TournamentRoundTeam;
11551
- }(BaseModel));
11552
- __decorate([
11553
- ToFrontHook
11554
- ], exports.TournamentRoundTeam, "toFront", null);
11555
- __decorate([
11556
- ToBackHook
11557
- ], exports.TournamentRoundTeam, "toBack", null);
11558
- exports.TournamentRoundTeam = __decorate([
11559
- ModelInstance({
11560
- mappingFields: {
11561
- id: 'id',
11562
- tournament_team: 'tournamentTeam',
11563
- group: 'group',
11564
- division: 'division',
11565
- division_id: 'divisionId',
11566
- points: 'points',
11567
- handicap: 'handicap',
11568
- games_count: 'gamesCount',
11569
- won_games_count: 'wonGamesCount',
11570
- lose_games_count: 'loseGamesCount',
11571
- draw_games_count: 'drawGamesCount',
11572
- score_sum: 'scoreSum',
11573
- missed_sum: 'missedSum',
11574
- games_won_percent: 'gamesWonPercent',
11575
- score_points_sum: 'scorePointsSum',
11576
- missed_points_sum: 'missedPointsSum',
11577
- win_normal_time_games_count: 'winNormalTimeGamesCount',
11578
- lose_normal_time_games_count: 'loseNormalTimeGamesCount',
11579
- win_overtime_games_count: 'winOvertimeGamesCount',
11580
- lose_overtime_games_count: 'loseOvertimeGamesCount',
11581
- last_games_won: 'lastGamesWon',
11582
- last_games_count: 'lastGamesCount',
11583
- tries_scored: 'triesScored',
11584
- tries_missed: 'triesMissed',
11585
- attack_bonuses: 'attackBonuses',
11586
- defense_bonuses: 'defenseBonuses',
11587
- games_by_score_count: 'gamesByScoreCount',
11588
- games: 'games',
11589
- },
11590
- relation: {
11591
- group: exports.TournamentGroup,
11592
- division: exports.TournamentDivision,
11593
- tournamentTeam: exports.TournamentTeam,
11594
- games: listField(exports.RoundTeamGame),
11595
- }
11596
- })
11597
- ], exports.TournamentRoundTeam);
11598
-
11599
11616
  var TournamentRoundApi = /** @class */ (function () {
11600
11617
  function TournamentRoundApi(httpClient, configService) {
11601
11618
  this.httpClient = httpClient;