@mtgame/core 0.1.37 → 0.1.39

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.
Files changed (58) hide show
  1. package/api/public-api.d.ts +10 -9
  2. package/api/rugby-game-api.d.ts +16 -0
  3. package/api/tournament-api.d.ts +3 -1
  4. package/bundles/mtgame-core.umd.js +676 -159
  5. package/bundles/mtgame-core.umd.js.map +1 -1
  6. package/bundles/mtgame-core.umd.min.js +1 -1
  7. package/bundles/mtgame-core.umd.min.js.map +1 -1
  8. package/esm2015/api/public-api.js +10 -9
  9. package/esm2015/api/rugby-game-api.js +50 -0
  10. package/esm2015/api/tournament-api.js +18 -3
  11. package/esm2015/localization/public-api.js +2 -1
  12. package/esm2015/localization/rugby-game-log-types.js +36 -0
  13. package/esm2015/localization/user-profile.js +10 -1
  14. package/esm2015/models/public-api.js +7 -1
  15. package/esm2015/models/rugby-game-config.js +34 -0
  16. package/esm2015/models/rugby-game-log.js +124 -0
  17. package/esm2015/models/rugby-game-statistic.js +51 -0
  18. package/esm2015/models/rugby-game-team-statistic.js +27 -0
  19. package/esm2015/models/rugby-profile.js +37 -0
  20. package/esm2015/models/rugby-statistic.js +84 -0
  21. package/esm2015/models/sport.js +13 -1
  22. package/esm2015/models/tournament.js +4 -2
  23. package/esm2015/models/user.js +4 -1
  24. package/esm5/api/public-api.js +10 -9
  25. package/esm5/api/rugby-game-api.js +61 -0
  26. package/esm5/api/tournament-api.js +22 -3
  27. package/esm5/localization/public-api.js +2 -1
  28. package/esm5/localization/rugby-game-log-types.js +37 -0
  29. package/esm5/localization/user-profile.js +11 -2
  30. package/esm5/models/public-api.js +7 -1
  31. package/esm5/models/rugby-game-config.js +39 -0
  32. package/esm5/models/rugby-game-log.js +132 -0
  33. package/esm5/models/rugby-game-statistic.js +64 -0
  34. package/esm5/models/rugby-game-team-statistic.js +32 -0
  35. package/esm5/models/rugby-profile.js +42 -0
  36. package/esm5/models/rugby-statistic.js +93 -0
  37. package/esm5/models/sport.js +13 -1
  38. package/esm5/models/tournament.js +4 -2
  39. package/esm5/models/user.js +4 -1
  40. package/fesm2015/mtgame-core.js +445 -4
  41. package/fesm2015/mtgame-core.js.map +1 -1
  42. package/fesm5/mtgame-core.js +662 -160
  43. package/fesm5/mtgame-core.js.map +1 -1
  44. package/localization/public-api.d.ts +1 -0
  45. package/localization/rugby-game-log-types.d.ts +35 -0
  46. package/localization/user-profile.d.ts +9 -0
  47. package/models/public-api.d.ts +6 -0
  48. package/models/rugby-game-config.d.ts +15 -0
  49. package/models/rugby-game-log.d.ts +71 -0
  50. package/models/rugby-game-statistic.d.ts +29 -0
  51. package/models/rugby-game-team-statistic.d.ts +8 -0
  52. package/models/rugby-profile.d.ts +16 -0
  53. package/models/rugby-statistic.d.ts +52 -0
  54. package/models/sport.d.ts +7 -1
  55. package/models/tournament.d.ts +2 -0
  56. package/models/user.d.ts +2 -0
  57. package/mtgame-core.metadata.json +1 -1
  58. package/package.json +1 -1
@@ -357,6 +357,9 @@ var SportTypes;
357
357
  SportTypes[SportTypes["mini_football"] = 12] = "mini_football";
358
358
  SportTypes[SportTypes["handball"] = 13] = "handball";
359
359
  SportTypes[SportTypes["handball_classic"] = 14] = "handball_classic";
360
+ SportTypes[SportTypes["rugby"] = 15] = "rugby";
361
+ SportTypes[SportTypes["rugby7"] = 16] = "rugby7";
362
+ SportTypes[SportTypes["rugby15"] = 17] = "rugby15";
360
363
  })(SportTypes || (SportTypes = {}));
361
364
  let Sport = class Sport extends BaseModel {
362
365
  isBasketball() {
@@ -401,6 +404,15 @@ let Sport = class Sport extends BaseModel {
401
404
  isHandballClassic() {
402
405
  return this.id === SportTypes.handball_classic;
403
406
  }
407
+ isRugby() {
408
+ return this.id === SportTypes.rugby || this.parentId === SportTypes.rugby;
409
+ }
410
+ isRugby15() {
411
+ return this.id === SportTypes.rugby15;
412
+ }
413
+ isRugby7() {
414
+ return this.id === SportTypes.rugby7;
415
+ }
404
416
  static toFront(data) {
405
417
  return null;
406
418
  }
@@ -658,6 +670,40 @@ HandballProfile = __decorate([
658
670
  })
659
671
  ], HandballProfile);
660
672
 
673
+ var GameRugbyPosition;
674
+ (function (GameRugbyPosition) {
675
+ GameRugbyPosition[GameRugbyPosition["front_line"] = 1] = "front_line";
676
+ GameRugbyPosition[GameRugbyPosition["second_line"] = 2] = "second_line";
677
+ GameRugbyPosition[GameRugbyPosition["back_line"] = 3] = "back_line";
678
+ GameRugbyPosition[GameRugbyPosition["halfback"] = 4] = "halfback";
679
+ GameRugbyPosition[GameRugbyPosition["three_quarter"] = 5] = "three_quarter";
680
+ GameRugbyPosition[GameRugbyPosition["fullback"] = 6] = "fullback";
681
+ })(GameRugbyPosition || (GameRugbyPosition = {}));
682
+ let RugbyProfile = class RugbyProfile extends BaseModel {
683
+ static toFront(value) {
684
+ }
685
+ static toBack(value) {
686
+ }
687
+ };
688
+ __decorate([
689
+ ToFrontHook
690
+ ], RugbyProfile, "toFront", null);
691
+ __decorate([
692
+ ToBackHook
693
+ ], RugbyProfile, "toBack", null);
694
+ RugbyProfile = __decorate([
695
+ ModelInstance({
696
+ mappingFields: {
697
+ id: 'id',
698
+ user_id: 'userId',
699
+ position: 'position'
700
+ },
701
+ relation: {
702
+ position: enumField(GameRugbyPosition),
703
+ }
704
+ })
705
+ ], RugbyProfile);
706
+
661
707
  var UserGender;
662
708
  (function (UserGender) {
663
709
  UserGender[UserGender["male"] = 1] = "male";
@@ -710,6 +756,7 @@ User = __decorate([
710
756
  hockey_profile: 'hockeyProfile',
711
757
  football_profile: 'footballProfile',
712
758
  handball_profile: 'handballProfile',
759
+ rugby_profile: 'rugbyProfile',
713
760
  wizards: 'wizards',
714
761
  city: 'city',
715
762
  gender: 'gender',
@@ -724,6 +771,7 @@ User = __decorate([
724
771
  hockeyProfile: HockeyProfile,
725
772
  footballProfile: FootballProfile,
726
773
  handballProfile: HandballProfile,
774
+ rugbyProfile: RugbyProfile,
727
775
  city: City,
728
776
  gender: enumField(UserGender)
729
777
  }
@@ -997,7 +1045,9 @@ TournamentSettings = __decorate([
997
1045
  volleyball_statistic_type: 'volleyballStatisticType',
998
1046
  shot_clock_enabled: 'shotClockEnabled',
999
1047
  game_time_type: 'gameTimeType',
1000
- with_result_table: 'withResultTable'
1048
+ with_result_table: 'withResultTable',
1049
+ free_substitute_enabled: 'freeSubstituteEnabled',
1050
+ bonus_points_enabled: 'bonusPointsEnabled',
1001
1051
  },
1002
1052
  relation: {
1003
1053
  type: enumField(TournamentTypes),
@@ -4100,6 +4150,82 @@ LeagueUser = __decorate([
4100
4150
  })
4101
4151
  ], LeagueUser);
4102
4152
 
4153
+ let RugbyStatistic = class RugbyStatistic extends BaseModel {
4154
+ get userMinutes() {
4155
+ if (!this.gameTime) {
4156
+ return '00:00';
4157
+ }
4158
+ const minutes = Math.floor(this.gameTime / 60);
4159
+ const seconds = Math.floor(this.gameTime - minutes * 60);
4160
+ return `${minutes < 10 ? 0 : ''}${minutes}:${seconds < 10 ? 0 : ''}${seconds}`;
4161
+ }
4162
+ static toFront(data) { }
4163
+ static toBack(data) { }
4164
+ };
4165
+ __decorate([
4166
+ ToFrontHook
4167
+ ], RugbyStatistic, "toFront", null);
4168
+ __decorate([
4169
+ ToBackHook
4170
+ ], RugbyStatistic, "toBack", null);
4171
+ RugbyStatistic = __decorate([
4172
+ ModelInstance({
4173
+ mappingFields: {
4174
+ tournament_team_user: 'tournamentTeamUser',
4175
+ team: 'team',
4176
+ team_user: 'teamUser',
4177
+ user: 'user',
4178
+ tournament_team: 'tournamentTeam',
4179
+ month: 'month',
4180
+ win_lose: 'winLose',
4181
+ games_count: 'gamesCount',
4182
+ won_games_count: 'wonGamesCount',
4183
+ newbie: 'newbie',
4184
+ // User statistic
4185
+ points: 'points',
4186
+ tries: 'tries',
4187
+ penalty_tries: 'penaltyTries',
4188
+ conversion_goals: 'conversionGoals',
4189
+ conversion_misses: 'conversionMisses',
4190
+ drawing_ball: 'drawingBall',
4191
+ penalty_misses: 'penaltyMisses',
4192
+ penalty_goals: 'penaltyGoals',
4193
+ drop_goals: 'dropGoals',
4194
+ drop_goal_misses: 'dropGoalMisses',
4195
+ free_kicks: 'freeKicks',
4196
+ yellow_cards: 'yellowCards',
4197
+ red_cards: 'redCards',
4198
+ offloads: 'offloads',
4199
+ tackles: 'tackles',
4200
+ outs: 'outs',
4201
+ handling_errors: 'handlingErrors',
4202
+ carries_other_gainline: 'carriesOtherGainline',
4203
+ plus_minus: 'plusMinus',
4204
+ game_time: 'gameTime',
4205
+ // Team statistic
4206
+ scrums_won: 'scrumsWon',
4207
+ scrum_losses: 'scrumLosses',
4208
+ scrums_won_free: 'scrumsWonFree',
4209
+ lineouts_success: 'lineoutsSuccess',
4210
+ lineouts_steal: 'lineoutsSteal',
4211
+ quick_throws: 'quickThrows',
4212
+ rucks_won: 'rucksWon',
4213
+ ruck_losses: 'ruckLosses',
4214
+ mauls_won: 'maulsWon',
4215
+ maul_losses: 'maulLosses',
4216
+ fouls: 'fouls'
4217
+ },
4218
+ relation: {
4219
+ tournamentTeamUser: TournamentTeamUser,
4220
+ team: Team,
4221
+ teamUser: TeamUser,
4222
+ user: User,
4223
+ tournamentTeam: TournamentTeam,
4224
+ month: DateField
4225
+ }
4226
+ })
4227
+ ], RugbyStatistic);
4228
+
4103
4229
  let TournamentApi = class TournamentApi {
4104
4230
  constructor(httpClient, configService) {
4105
4231
  this.httpClient = httpClient;
@@ -4189,9 +4315,13 @@ let TournamentApi = class TournamentApi {
4189
4315
  }))).toPromise();
4190
4316
  });
4191
4317
  }
4192
- getTeams(tournamentId) {
4318
+ getTeams(tournamentId, groupId) {
4193
4319
  return __awaiter(this, void 0, void 0, function* () {
4194
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/teams/`)
4320
+ let params = new HttpParams();
4321
+ if (groupId) {
4322
+ params = params.set('group_id', groupId.toString());
4323
+ }
4324
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/teams/`, { params })
4195
4325
  .pipe(map(result => TournamentTeam.toFront(result)))
4196
4326
  .toPromise();
4197
4327
  });
@@ -4334,6 +4464,16 @@ let TournamentApi = class TournamentApi {
4334
4464
  }))).toPromise();
4335
4465
  });
4336
4466
  }
4467
+ getRugbyStatistic(filters) {
4468
+ return __awaiter(this, void 0, void 0, function* () {
4469
+ let params = new HttpParams();
4470
+ params = applyStatisticFilters(filters, params);
4471
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/rugby_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
4472
+ total: +result.headers.get('X-Page-Count'),
4473
+ data: RugbyStatistic.toFront(result.body)
4474
+ }))).toPromise();
4475
+ });
4476
+ }
4337
4477
  getTournamentTeamUsers(tournamentTeamId) {
4338
4478
  return __awaiter(this, void 0, void 0, function* () {
4339
4479
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/users/`).pipe(map(result => TournamentTeamUser.toFront(result))).toPromise();
@@ -5439,6 +5579,234 @@ ReferenceApi = __decorate([
5439
5579
  Injectable({ providedIn: 'root' })
5440
5580
  ], ReferenceApi);
5441
5581
 
5582
+ let RugbyGameTeamStatistic = class RugbyGameTeamStatistic extends BaseModel {
5583
+ static toFront(data) { }
5584
+ static toBack(data) { }
5585
+ };
5586
+ __decorate([
5587
+ ToFrontHook
5588
+ ], RugbyGameTeamStatistic, "toFront", null);
5589
+ __decorate([
5590
+ ToBackHook
5591
+ ], RugbyGameTeamStatistic, "toBack", null);
5592
+ RugbyGameTeamStatistic = __decorate([
5593
+ ModelInstance({
5594
+ mappingFields: {
5595
+ team: 'team',
5596
+ competitor_team: 'competitorTeam'
5597
+ },
5598
+ relation: {
5599
+ team: RugbyStatistic,
5600
+ competitorTeam: RugbyStatistic
5601
+ }
5602
+ })
5603
+ ], RugbyGameTeamStatistic);
5604
+
5605
+ let RugbyGameStatistic = class RugbyGameStatistic extends BaseModel {
5606
+ get id() {
5607
+ return this.gameUserId;
5608
+ }
5609
+ get gameMinutes() {
5610
+ return Math.floor(this.gameTime / 60);
5611
+ }
5612
+ static toFront(data) { }
5613
+ static toBack(data) { }
5614
+ };
5615
+ __decorate([
5616
+ ToFrontHook
5617
+ ], RugbyGameStatistic, "toFront", null);
5618
+ __decorate([
5619
+ ToBackHook
5620
+ ], RugbyGameStatistic, "toBack", null);
5621
+ RugbyGameStatistic = __decorate([
5622
+ ModelInstance({
5623
+ mappingFields: {
5624
+ game_user_id: 'gameUserId',
5625
+ updated_at: 'updatedAt',
5626
+ points: 'points',
5627
+ tries: 'tries',
5628
+ penalty_tries: 'penaltyTries',
5629
+ conversion_goals: 'conversionGoals',
5630
+ conversion_misses: 'conversionMisses',
5631
+ drawing_ball: 'drawingBall',
5632
+ penalty_misses: 'penaltyMisses',
5633
+ penalty_goals: 'penaltyGoals',
5634
+ drop_goals: 'dropGoals',
5635
+ drop_goal_misses: 'dropGoalMisses',
5636
+ free_kicks: 'freeKicks',
5637
+ yellow_cards: 'yellowCards',
5638
+ red_cards: 'redCards',
5639
+ offloads: 'offloads',
5640
+ tackles: 'tackles',
5641
+ outs: 'outs',
5642
+ handling_errors: 'handlingErrors',
5643
+ carries_other_gainline: 'carriesOtherGainline',
5644
+ game_time: 'gameTime',
5645
+ plus_minus: 'plusMinus'
5646
+ },
5647
+ relation: {
5648
+ updatedAt: DateTimeField,
5649
+ }
5650
+ })
5651
+ ], RugbyGameStatistic);
5652
+
5653
+ var RugbyGameLogTypes;
5654
+ (function (RugbyGameLogTypes) {
5655
+ RugbyGameLogTypes[RugbyGameLogTypes["enter_game"] = 1] = "enter_game";
5656
+ RugbyGameLogTypes[RugbyGameLogTypes["exit_game"] = 2] = "exit_game";
5657
+ RugbyGameLogTypes[RugbyGameLogTypes["try"] = 3] = "try";
5658
+ RugbyGameLogTypes[RugbyGameLogTypes["penalty_try"] = 4] = "penalty_try";
5659
+ RugbyGameLogTypes[RugbyGameLogTypes["conversion_goal"] = 5] = "conversion_goal";
5660
+ RugbyGameLogTypes[RugbyGameLogTypes["conversion_miss"] = 6] = "conversion_miss";
5661
+ RugbyGameLogTypes[RugbyGameLogTypes["drawing_ball"] = 7] = "drawing_ball";
5662
+ RugbyGameLogTypes[RugbyGameLogTypes["penalty_miss"] = 8] = "penalty_miss";
5663
+ RugbyGameLogTypes[RugbyGameLogTypes["penalty_goal"] = 9] = "penalty_goal";
5664
+ RugbyGameLogTypes[RugbyGameLogTypes["drop_goal"] = 10] = "drop_goal";
5665
+ RugbyGameLogTypes[RugbyGameLogTypes["drop_goal_miss"] = 11] = "drop_goal_miss";
5666
+ RugbyGameLogTypes[RugbyGameLogTypes["free_kick"] = 12] = "free_kick";
5667
+ RugbyGameLogTypes[RugbyGameLogTypes["yellow_card"] = 13] = "yellow_card";
5668
+ RugbyGameLogTypes[RugbyGameLogTypes["red_card"] = 14] = "red_card";
5669
+ RugbyGameLogTypes[RugbyGameLogTypes["offload"] = 15] = "offload";
5670
+ RugbyGameLogTypes[RugbyGameLogTypes["tackle"] = 16] = "tackle";
5671
+ RugbyGameLogTypes[RugbyGameLogTypes["out"] = 17] = "out";
5672
+ RugbyGameLogTypes[RugbyGameLogTypes["handling_error"] = 18] = "handling_error";
5673
+ RugbyGameLogTypes[RugbyGameLogTypes["carries_other_gainline"] = 19] = "carries_other_gainline";
5674
+ // team actions
5675
+ RugbyGameLogTypes[RugbyGameLogTypes["timeout"] = 20] = "timeout";
5676
+ RugbyGameLogTypes[RugbyGameLogTypes["scrum_won"] = 21] = "scrum_won";
5677
+ RugbyGameLogTypes[RugbyGameLogTypes["scrum_lose"] = 22] = "scrum_lose";
5678
+ RugbyGameLogTypes[RugbyGameLogTypes["scrum_won_free"] = 23] = "scrum_won_free";
5679
+ RugbyGameLogTypes[RugbyGameLogTypes["lineout_success"] = 24] = "lineout_success";
5680
+ RugbyGameLogTypes[RugbyGameLogTypes["lineout_loss"] = 25] = "lineout_loss";
5681
+ RugbyGameLogTypes[RugbyGameLogTypes["lineout_steal"] = 26] = "lineout_steal";
5682
+ RugbyGameLogTypes[RugbyGameLogTypes["quick_throw"] = 27] = "quick_throw";
5683
+ RugbyGameLogTypes[RugbyGameLogTypes["ruck_won"] = 28] = "ruck_won";
5684
+ RugbyGameLogTypes[RugbyGameLogTypes["ruck_lose"] = 29] = "ruck_lose";
5685
+ RugbyGameLogTypes[RugbyGameLogTypes["maul_won"] = 30] = "maul_won";
5686
+ RugbyGameLogTypes[RugbyGameLogTypes["maul_lose"] = 31] = "maul_lose";
5687
+ RugbyGameLogTypes[RugbyGameLogTypes["team_foul"] = 32] = "team_foul";
5688
+ })(RugbyGameLogTypes || (RugbyGameLogTypes = {}));
5689
+ const RUGBY_GAME_LOG_TYPE_POINTS = {
5690
+ [RugbyGameLogTypes.penalty_try]: 7,
5691
+ [RugbyGameLogTypes.try]: 5,
5692
+ [RugbyGameLogTypes.conversion_goal]: 2,
5693
+ [RugbyGameLogTypes.penalty_goal]: 3,
5694
+ [RugbyGameLogTypes.drop_goal]: 3
5695
+ };
5696
+ const RUGBY_TEAM_LOG_TYPES = [
5697
+ RugbyGameLogTypes.timeout, RugbyGameLogTypes.scrum_won, RugbyGameLogTypes.scrum_lose, RugbyGameLogTypes.scrum_won_free,
5698
+ RugbyGameLogTypes.lineout_success, RugbyGameLogTypes.lineout_loss, RugbyGameLogTypes.lineout_steal, RugbyGameLogTypes.quick_throw,
5699
+ RugbyGameLogTypes.ruck_won, RugbyGameLogTypes.ruck_lose, RugbyGameLogTypes.maul_won, RugbyGameLogTypes.maul_lose,
5700
+ RugbyGameLogTypes.team_foul,
5701
+ ];
5702
+ let RugbyGameLog = class RugbyGameLog extends BaseModel {
5703
+ constructor() {
5704
+ super(...arguments);
5705
+ this.active = true;
5706
+ }
5707
+ compare(model) {
5708
+ if (this.time === model.time && this.period === model.period) {
5709
+ return this.datetime.getTime() < model.datetime.getTime() ? 1 : -1;
5710
+ }
5711
+ if (this.period === model.period) {
5712
+ return this.time < model.time ? 1 : -1;
5713
+ }
5714
+ return this.period < model.period ? 1 : -1;
5715
+ }
5716
+ get timeFormatted() {
5717
+ const minutes = Math.floor(this.time / 60);
5718
+ const seconds = this.time - minutes * 60;
5719
+ return `${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
5720
+ }
5721
+ isScoreType() {
5722
+ return RUGBY_GAME_LOG_TYPE_POINTS[this.logType] !== undefined;
5723
+ }
5724
+ scorePoints() {
5725
+ return RUGBY_GAME_LOG_TYPE_POINTS[this.logType];
5726
+ }
5727
+ isAfter(log) {
5728
+ if (this.time === log.time && this.period === log.period) {
5729
+ return this.id > log.id;
5730
+ }
5731
+ if (this.period === log.period) {
5732
+ return this.time > log.time;
5733
+ }
5734
+ return this.period > log.period;
5735
+ }
5736
+ isFoulType() {
5737
+ return [RugbyGameLogTypes.team_foul, RugbyGameLogTypes.yellow_card, RugbyGameLogTypes.red_card].indexOf(this.logType) > -1;
5738
+ }
5739
+ isTeamType() {
5740
+ return RUGBY_TEAM_LOG_TYPES.includes(this.logType);
5741
+ }
5742
+ static toFront(value) { }
5743
+ static toBack(value) { }
5744
+ };
5745
+ __decorate([
5746
+ ToFrontHook
5747
+ ], RugbyGameLog, "toFront", null);
5748
+ __decorate([
5749
+ ToBackHook
5750
+ ], RugbyGameLog, "toBack", null);
5751
+ RugbyGameLog = __decorate([
5752
+ ModelInstance({
5753
+ mappingFields: {
5754
+ id: 'id',
5755
+ unique_id: 'uniqueId',
5756
+ game_id: 'gameId',
5757
+ game_user_id: 'gameUserId',
5758
+ team_id: 'teamId',
5759
+ log_type: 'logType',
5760
+ datetime: 'datetime',
5761
+ time: 'time',
5762
+ period: 'period',
5763
+ active: 'active',
5764
+ is_highlight: 'isHighlight',
5765
+ penalty_type: 'penaltyType',
5766
+ },
5767
+ relation: {
5768
+ datetime: DateTimeField,
5769
+ logType: enumField(RugbyGameLogTypes)
5770
+ }
5771
+ })
5772
+ ], RugbyGameLog);
5773
+
5774
+ let RugbyGameApi = class RugbyGameApi extends GameBaseApi {
5775
+ constructor(httpClient, configService) {
5776
+ super(httpClient, configService);
5777
+ this.httpClient = httpClient;
5778
+ this.configService = configService;
5779
+ }
5780
+ getById(gameId) {
5781
+ return __awaiter(this, void 0, void 0, function* () {
5782
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
5783
+ });
5784
+ }
5785
+ getTeamStatistic(gameId) {
5786
+ return __awaiter(this, void 0, void 0, function* () {
5787
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/team_statistic/`).pipe(map(result => RugbyGameTeamStatistic.toFront(result))).toPromise();
5788
+ });
5789
+ }
5790
+ getUserStatistic(gameId) {
5791
+ return __awaiter(this, void 0, void 0, function* () {
5792
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/user_statistic/`).pipe(map(result => RugbyGameStatistic.toFront(result))).toPromise();
5793
+ });
5794
+ }
5795
+ getLogs(gameId) {
5796
+ return __awaiter(this, void 0, void 0, function* () {
5797
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/logs/`).pipe(map(result => RugbyGameLog.toFront(result))).toPromise();
5798
+ });
5799
+ }
5800
+ };
5801
+ RugbyGameApi.ctorParameters = () => [
5802
+ { type: HttpClient },
5803
+ { type: ConfigService }
5804
+ ];
5805
+ RugbyGameApi.ɵprov = ɵɵdefineInjectable({ factory: function RugbyGameApi_Factory() { return new RugbyGameApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: RugbyGameApi, providedIn: "root" });
5806
+ RugbyGameApi = __decorate([
5807
+ Injectable({ providedIn: 'root' })
5808
+ ], RugbyGameApi);
5809
+
5442
5810
  let TeamInviteExternal = class TeamInviteExternal extends BaseModel {
5443
5811
  static toFront(data) { }
5444
5812
  static toBack(data) { }
@@ -6953,6 +7321,41 @@ const OvertimeTypeLocalization = {
6953
7321
  [OvertimeTypes.time_and_penalties]: 'Дополнительное время + пенальти'
6954
7322
  };
6955
7323
 
7324
+ const RugbyGameLogTypeLocalization = {
7325
+ [RugbyGameLogTypes.enter_game]: 'Выход на площадку',
7326
+ [RugbyGameLogTypes.exit_game]: 'Ушел с площадки',
7327
+ [RugbyGameLogTypes.try]: 'Попытка',
7328
+ [RugbyGameLogTypes.penalty_try]: 'Штрафная попытка',
7329
+ [RugbyGameLogTypes.conversion_goal]: 'Реализация',
7330
+ [RugbyGameLogTypes.conversion_miss]: 'Реализация промах',
7331
+ [RugbyGameLogTypes.drawing_ball]: 'Розыгрыш мяча',
7332
+ [RugbyGameLogTypes.penalty_miss]: 'Штрафной промах',
7333
+ [RugbyGameLogTypes.penalty_goal]: 'Штрафной гол',
7334
+ [RugbyGameLogTypes.drop_goal]: 'Дроп-гол',
7335
+ [RugbyGameLogTypes.drop_goal_miss]: 'Дроп-гол промах',
7336
+ [RugbyGameLogTypes.free_kick]: 'Свободный удар',
7337
+ [RugbyGameLogTypes.yellow_card]: 'Желтая карточка',
7338
+ [RugbyGameLogTypes.red_card]: 'Красная карточка',
7339
+ [RugbyGameLogTypes.offload]: 'Скидка при завхвате',
7340
+ [RugbyGameLogTypes.tackle]: 'Успешный захват',
7341
+ [RugbyGameLogTypes.out]: 'Аут',
7342
+ [RugbyGameLogTypes.handling_error]: 'Ошибка приема',
7343
+ [RugbyGameLogTypes.carries_other_gainline]: 'Прорыв линии',
7344
+ [RugbyGameLogTypes.timeout]: 'Таймаут',
7345
+ [RugbyGameLogTypes.scrum_won]: 'Свахтка выиграна',
7346
+ [RugbyGameLogTypes.scrum_lose]: 'Схватка проиграна',
7347
+ [RugbyGameLogTypes.scrum_won_free]: 'Схватка выиграна без сопротивления',
7348
+ [RugbyGameLogTypes.lineout_success]: 'Корридор выиграно',
7349
+ [RugbyGameLogTypes.lineout_loss]: 'Корридор потеря',
7350
+ [RugbyGameLogTypes.lineout_steal]: 'Корридор перехват',
7351
+ [RugbyGameLogTypes.quick_throw]: 'Быстрый вброс',
7352
+ [RugbyGameLogTypes.ruck_won]: 'Рак выиграно',
7353
+ [RugbyGameLogTypes.ruck_lose]: 'Рак проиграно',
7354
+ [RugbyGameLogTypes.maul_won]: 'Мол выиграно',
7355
+ [RugbyGameLogTypes.maul_lose]: 'Мол проиграно',
7356
+ [RugbyGameLogTypes.team_foul]: 'Фол',
7357
+ };
7358
+
6956
7359
  const TeamUserRoleLocalization = {
6957
7360
  [TeamUserRole.member]: 'Пользователь',
6958
7361
  [TeamUserRole.moderator]: 'Модератор',
@@ -7032,6 +7435,14 @@ const GameHandballPositionLocalization = {
7032
7435
  [GameHandballPosition.centre_back]: 'Центральный',
7033
7436
  [GameHandballPosition.fullback]: 'Полусредний',
7034
7437
  };
7438
+ const GameRugbyPositionLocalization = {
7439
+ [GameRugbyPosition.front_line]: 'Надающий первой линии',
7440
+ [GameRugbyPosition.second_line]: 'Нападающий второй линии',
7441
+ [GameRugbyPosition.back_line]: 'Нападающий задней линии',
7442
+ [GameRugbyPosition.halfback]: 'Полузащитник',
7443
+ [GameRugbyPosition.three_quarter]: 'Трехчетвертный',
7444
+ [GameRugbyPosition.fullback]: 'Замыкающий'
7445
+ };
7035
7446
 
7036
7447
  const VolleyballGameLogTypeLocalization = {
7037
7448
  [VolleyballGameLogType.enter_game]: 'Выход на площадку',
@@ -7082,6 +7493,36 @@ LeaguePlaylist = __decorate([
7082
7493
  })
7083
7494
  ], LeaguePlaylist);
7084
7495
 
7496
+ let RugbyGameConfig = class RugbyGameConfig extends BaseModel {
7497
+ static toFront(data) { }
7498
+ static toBack(data) { }
7499
+ };
7500
+ __decorate([
7501
+ ToFrontHook
7502
+ ], RugbyGameConfig, "toFront", null);
7503
+ __decorate([
7504
+ ToBackHook
7505
+ ], RugbyGameConfig, "toBack", null);
7506
+ RugbyGameConfig = __decorate([
7507
+ ModelInstance({
7508
+ mappingFields: {
7509
+ periods_count: 'periodsCount',
7510
+ period_time: 'periodTime',
7511
+ overtime_type: 'overtimeType',
7512
+ overtime_time: 'overtimeTime',
7513
+ overtime_periods: 'overtimePeriods',
7514
+ max_game_players: 'maxGamePlayers',
7515
+ game_time_type: 'gameTimeType',
7516
+ substitute_count: 'substituteCount',
7517
+ free_substitute_enabled: 'freeSubstituteEnabled',
7518
+ },
7519
+ relation: {
7520
+ overtimeType: enumField(OvertimeTypes),
7521
+ gameTimeType: enumField(GameTimeTypes),
7522
+ }
7523
+ })
7524
+ ], RugbyGameConfig);
7525
+
7085
7526
  let CentrifugoService = class CentrifugoService {
7086
7527
  constructor(httpClient, configService) {
7087
7528
  this.httpClient = httpClient;
@@ -7450,5 +7891,5 @@ HttpCookieInterceptor = __decorate([
7450
7891
  * Generated bundle index. Do not edit.
7451
7892
  */
7452
7893
 
7453
- export { BannerLocation, BaseModel, BaseService, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameTeamStatistic, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DateField, DateTimeField, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameBaseApi, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameUserLimitationTypes, GameUserLimitations, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueDocument, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlayer, LeaguePlayerApi, LeaguePlaylist, LocalStorageEngine, MODEL_MAPPING_FIELDS_KEY, MODEL_RELATION_KEY, MODEL_TO_BACK_KEY, MODEL_TO_FRONT_KEY, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, ReferenceApi, SCORE_LOG_TYPES, Sport, SportTypes, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, ToBackHook, ToFrontHook, Tournament, TournamentApi, TournamentDisqualification, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamShort, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, penaltyTypeField, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
7894
+ export { BannerLocation, BaseModel, BaseService, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameTeamStatistic, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DateField, DateTimeField, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameBaseApi, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameRugbyPosition, GameRugbyPositionLocalization, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameUserLimitationTypes, GameUserLimitations, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueDocument, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlayer, LeaguePlayerApi, LeaguePlaylist, LocalStorageEngine, MODEL_MAPPING_FIELDS_KEY, MODEL_RELATION_KEY, MODEL_TO_BACK_KEY, MODEL_TO_FRONT_KEY, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, RUGBY_GAME_LOG_TYPE_POINTS, RUGBY_TEAM_LOG_TYPES, ReferenceApi, RugbyGameApi, RugbyGameConfig, RugbyGameLog, RugbyGameLogTypeLocalization, RugbyGameLogTypes, RugbyGameStatistic, RugbyGameTeamStatistic, RugbyProfile, RugbyStatistic, SCORE_LOG_TYPES, Sport, SportTypes, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, ToBackHook, ToFrontHook, Tournament, TournamentApi, TournamentDisqualification, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamShort, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, applyGameMediaFilters, applyGamesFilters, applyStatisticFilters, applyStatisticLeadersFilters, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, penaltyTypeField, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
7454
7895
  //# sourceMappingURL=mtgame-core.js.map