@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
+ var 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
  var MODEL_MAPPING_FIELDS_KEY = '_mapping_fields_';
14
64
  var MODEL_RELATION_KEY = '_relation_';
15
65
  var MODEL_TO_FRONT_KEY = '_to_front_';
@@ -61,6 +111,22 @@ function enumField(enumClass) {
61
111
  }
62
112
  };
63
113
  }
114
+ function penaltyTypeField() {
115
+ return {
116
+ toFront: function (data) {
117
+ if (typeof data === 'object') {
118
+ return data;
119
+ }
120
+ return HockeyPenaltyTypes.find(function (item) { return item.id === data; });
121
+ },
122
+ toBack: function (data) {
123
+ if (typeof data === 'object') {
124
+ return data.id;
125
+ }
126
+ return data;
127
+ }
128
+ };
129
+ }
64
130
  function listField(modelClass) {
65
131
  return {
66
132
  toFront: function (value) {
@@ -671,6 +737,9 @@ var Team = /** @class */ (function (_super) {
671
737
  if (this.sport.isVolleyball()) {
672
738
  classList.push('empty-logo-volleyball');
673
739
  }
740
+ if (this.sport.isHockey()) {
741
+ classList.push('empty-logo-hockey');
742
+ }
674
743
  return classList.join(' ');
675
744
  };
676
745
  Team.toFront = function (data) {
@@ -939,6 +1008,9 @@ var Tournament = /** @class */ (function (_super) {
939
1008
  if (this.sport.isVolleyball()) {
940
1009
  classList.push('empty-logo-volleyball');
941
1010
  }
1011
+ if (this.sport.isHockey()) {
1012
+ classList.push('empty-logo-hockey');
1013
+ }
942
1014
  return classList.join(' ');
943
1015
  };
944
1016
  Tournament.toFront = function (data) { };
@@ -2266,6 +2338,13 @@ var HockeyGameLog = /** @class */ (function (_super) {
2266
2338
  HockeyGameLog.prototype.isScoreType = function () {
2267
2339
  return [HockeyGameLogTypes.goal, HockeyGameLogTypes.shootout_goal].indexOf(this.logType) > -1;
2268
2340
  };
2341
+ HockeyGameLog.prototype.isPenaltyType = function () {
2342
+ return [
2343
+ HockeyGameLogTypes.minor_penalty, HockeyGameLogTypes.major_penalty,
2344
+ HockeyGameLogTypes.misconduct_penalty, HockeyGameLogTypes.game_misconduct_penalty,
2345
+ HockeyGameLogTypes.penalty_shot, HockeyGameLogTypes.match_penalty
2346
+ ].indexOf(this.logType) > -1;
2347
+ };
2269
2348
  HockeyGameLog.toFront = function (value) { };
2270
2349
  HockeyGameLog.toBack = function (value) { };
2271
2350
  __decorate([
@@ -2290,11 +2369,13 @@ var HockeyGameLog = /** @class */ (function (_super) {
2290
2369
  is_highlight: 'isHighlight',
2291
2370
  advantage: 'advantage',
2292
2371
  is_goalie: 'isGoalie',
2372
+ penalty_type: 'penaltyType'
2293
2373
  },
2294
2374
  relation: {
2295
2375
  datetime: DateTimeField,
2296
2376
  logType: enumField(HockeyGameLogTypes),
2297
2377
  advantage: enumField(HockeyAdvantageTypes),
2378
+ penaltyType: penaltyTypeField()
2298
2379
  }
2299
2380
  })
2300
2381
  ], HockeyGameLog);
@@ -4877,6 +4958,13 @@ var TournamentApi = /** @class */ (function () {
4877
4958
  });
4878
4959
  });
4879
4960
  };
4961
+ TournamentApi.prototype.getTournamentTeamUsers = function (tournamentTeamId) {
4962
+ return __awaiter(this, void 0, void 0, function () {
4963
+ return __generator(this, function (_a) {
4964
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/users/").pipe(map(function (result) { return TournamentTeamUser.toFront(result); })).toPromise()];
4965
+ });
4966
+ });
4967
+ };
4880
4968
  TournamentApi.ctorParameters = function () { return [
4881
4969
  { type: HttpClient },
4882
4970
  { type: ConfigService }
@@ -6280,5 +6368,5 @@ var HttpCookieInterceptor = /** @class */ (function () {
6280
6368
  * Generated bundle index. Do not edit.
6281
6369
  */
6282
6370
 
6283
- 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 };
6371
+ 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 };
6284
6372
  //# sourceMappingURL=mtgame-core.js.map