@mtgame/core 0.0.16 → 0.0.18

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.
@@ -10,6 +10,56 @@ import { captureException } from '@sentry/browser';
10
10
  import { FormGroup } from '@angular/forms';
11
11
  import { isPlatformBrowser } from '@angular/common';
12
12
 
13
+ const HockeyPenaltyTypes = [
14
+ { id: 1, code: 'АГРЕС', title: 'Агрессор в драке' },
15
+ { id: 2, code: 'АТ-В-ГОЛ', title: 'Атака в голову или шею' },
16
+ { id: 3, code: 'АТ-ВР', title: 'Атака вратаря' },
17
+ { id: 4, code: 'АТ-СЗ', title: 'Атака сзади' },
18
+ { id: 5, code: 'БЛОК', title: 'Блокировка' },
19
+ { id: 6, code: 'БР-КЛ', title: 'Бросок клюшки' },
20
+ { id: 7, code: 'ВБ-ШБ', title: 'Выброс шайбы' },
21
+ { id: 8, code: 'ГРУБ', title: 'Грубость' },
22
+ { id: 9, code: 'ДИСЦ', title: 'Дисциплинарный штраф' },
23
+ { id: 10, code: 'ДИС-КН', title: 'Дисциплинарный до конца матча' },
24
+ { id: 11, code: 'ДРАКА', title: 'Драка' },
25
+ { id: 12, code: 'ЗАЧИН', title: 'Зачинщик драки' },
26
+ { id: 13, code: 'ЗД-ИГ', title: 'Задержка игры' },
27
+ { id: 14, code: 'ЗД-КЛ-СП', title: 'Задержка клюшки соперника' },
28
+ { id: 15, code: 'ЗД-КЛ', title: 'Задержка клюшкой' },
29
+ { id: 16, code: 'ЗД-СП', title: 'Задержка соперника' },
30
+ { id: 17, code: 'ЗД-ШБ', title: 'Задержка шайбы руками' },
31
+ { id: 18, code: 'СЛ-КЛ', title: 'Игра со сломанной клюшкой' },
32
+ { id: 19, code: 'ВП-КЛ', title: 'Игра высоко поднятой клюшкой' },
33
+ { id: 20, code: 'КЛ-УД', title: 'Колющий удар' },
34
+ { id: 21, code: 'СК-ШТ', title: 'Малый скамеечный штраф' },
35
+ { id: 22, code: 'МШ', title: 'Матч-штраф' },
36
+ { id: 23, code: 'НП-АТ', title: 'Неправильная атака' },
37
+ { id: 24, code: 'ЧС-СТ', title: 'Нарушение численного состава' },
38
+ { id: 25, code: 'НС-КЛ', title: 'Нестандартная клюшка' },
39
+ { id: 26, code: 'НАР-ЭК', title: 'Опасное снаряжение' },
40
+ { id: 27, code: 'НС-ПВ', title: 'Оскорбление судей и неспортивное поведение' },
41
+ { id: 28, code: 'ОТ-ИГ', title: 'Отказ начать игру' },
42
+ { id: 29, code: 'ОТСЧ', title: 'Отсечение' },
43
+ { id: 30, code: 'ПЛЕВОК', title: 'Плевок' },
44
+ { id: 31, code: 'ПОДН', title: 'Подножка' },
45
+ { id: 32, code: 'ПОДС', title: 'Подсечка' },
46
+ { id: 33, code: 'ПР-ИН', title: 'Предупреждение инфекций' },
47
+ { id: 34, code: 'ПК-СК', title: 'Покидание скамейки во время конфликта' },
48
+ { id: 35, code: 'СД-ВР', title: 'Сдвиг ворот' },
49
+ { id: 36, code: 'СИМ', title: 'Симуляция' },
50
+ { id: 37, code: 'ТЛ-БР', title: 'Толчок на борт' },
51
+ { id: 38, code: 'ТЛ-КЛ', title: 'Толчок клюшкой' },
52
+ { id: 39, code: 'УД-ГОЛ', title: 'Удар головой' },
53
+ { id: 40, code: 'УД-КЛ', title: 'Удар клюшкой' },
54
+ { id: 41, code: 'УД-К-КЛ', title: 'Удар концом клюшки' },
55
+ { id: 42, code: 'УД-КОЛ', title: 'Удар коленом' },
56
+ { id: 43, code: 'УД-ЛОК', title: 'Удар локтем' },
57
+ { id: 44, code: 'УД-НГ', title: 'Удар ногой' },
58
+ { id: 45, code: 'УКУС', title: 'Укус' },
59
+ { id: 46, code: 'КН-ЗР', title: 'Физический контакт со зрителем' },
60
+ { id: 47, code: 'ШТ-ВР', title: 'Штраф вратаря' }
61
+ ];
62
+
13
63
  const MODEL_MAPPING_FIELDS_KEY = '_mapping_fields_';
14
64
  const MODEL_RELATION_KEY = '_relation_';
15
65
  const MODEL_TO_FRONT_KEY = '_to_front_';
@@ -49,6 +99,22 @@ function enumField(enumClass) {
49
99
  }
50
100
  };
51
101
  }
102
+ function penaltyTypeField() {
103
+ return {
104
+ toFront: (data) => {
105
+ if (typeof data === 'object') {
106
+ return data;
107
+ }
108
+ return HockeyPenaltyTypes.find(item => item.id === data);
109
+ },
110
+ toBack: (data) => {
111
+ if (typeof data === 'object') {
112
+ return data.id;
113
+ }
114
+ return data;
115
+ }
116
+ };
117
+ }
52
118
  function listField(modelClass) {
53
119
  return {
54
120
  toFront: (value) => {
@@ -552,6 +618,9 @@ let Team = class Team extends BaseModel {
552
618
  if (this.sport.isVolleyball()) {
553
619
  classList.push('empty-logo-volleyball');
554
620
  }
621
+ if (this.sport.isHockey()) {
622
+ classList.push('empty-logo-hockey');
623
+ }
555
624
  return classList.join(' ');
556
625
  }
557
626
  static toFront(data) {
@@ -783,6 +852,9 @@ let Tournament = class Tournament extends BaseModel {
783
852
  if (this.sport.isVolleyball()) {
784
853
  classList.push('empty-logo-volleyball');
785
854
  }
855
+ if (this.sport.isHockey()) {
856
+ classList.push('empty-logo-hockey');
857
+ }
786
858
  return classList.join(' ');
787
859
  }
788
860
  static toFront(data) { }
@@ -1897,6 +1969,13 @@ let HockeyGameLog = class HockeyGameLog extends BaseModel {
1897
1969
  isScoreType() {
1898
1970
  return [HockeyGameLogTypes.goal, HockeyGameLogTypes.shootout_goal].indexOf(this.logType) > -1;
1899
1971
  }
1972
+ isPenaltyType() {
1973
+ return [
1974
+ HockeyGameLogTypes.minor_penalty, HockeyGameLogTypes.major_penalty,
1975
+ HockeyGameLogTypes.misconduct_penalty, HockeyGameLogTypes.game_misconduct_penalty,
1976
+ HockeyGameLogTypes.penalty_shot, HockeyGameLogTypes.match_penalty
1977
+ ].indexOf(this.logType) > -1;
1978
+ }
1900
1979
  static toFront(value) { }
1901
1980
  static toBack(value) { }
1902
1981
  };
@@ -1922,11 +2001,13 @@ HockeyGameLog = __decorate([
1922
2001
  is_highlight: 'isHighlight',
1923
2002
  advantage: 'advantage',
1924
2003
  is_goalie: 'isGoalie',
2004
+ penalty_type: 'penaltyType'
1925
2005
  },
1926
2006
  relation: {
1927
2007
  datetime: DateTimeField,
1928
2008
  logType: enumField(HockeyGameLogTypes),
1929
2009
  advantage: enumField(HockeyAdvantageTypes),
2010
+ penaltyType: penaltyTypeField()
1930
2011
  }
1931
2012
  })
1932
2013
  ], HockeyGameLog);
@@ -4043,6 +4124,11 @@ let TournamentApi = class TournamentApi {
4043
4124
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/hockey_statistic/`, { params }).pipe(map(result => HockeyStatistic.toFront(result))).toPromise();
4044
4125
  });
4045
4126
  }
4127
+ getTournamentTeamUsers(tournamentTeamId) {
4128
+ return __awaiter(this, void 0, void 0, function* () {
4129
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/users/`).pipe(map(result => TournamentTeamUser.toFront(result))).toPromise();
4130
+ });
4131
+ }
4046
4132
  };
4047
4133
  TournamentApi.ctorParameters = () => [
4048
4134
  { type: HttpClient },
@@ -5240,5 +5326,5 @@ HttpCookieInterceptor = __decorate([
5240
5326
  * Generated bundle index. Do not edit.
5241
5327
  */
5242
5328
 
5243
- export { BaseModel, BaseService, BaseStatistic, 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, Game, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueCourt, LeagueNews, LeagueNewsApi, LocalStorageEngine, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, 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, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
5329
+ export { BaseModel, BaseService, BaseStatistic, 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, Game, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueCourt, LeagueNews, LeagueNewsApi, LocalStorageEngine, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, 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, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl, penaltyTypeField as ɵa };
5244
5330
  //# sourceMappingURL=mtgame-core.js.map