@mtgame/core 0.0.38 → 0.0.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.
@@ -879,6 +879,12 @@ var League = /** @class */ (function (_super) {
879
879
  return League;
880
880
  }(BaseModel));
881
881
 
882
+ var TournamentSeasonStatuses;
883
+ (function (TournamentSeasonStatuses) {
884
+ TournamentSeasonStatuses[TournamentSeasonStatuses["open"] = 0] = "open";
885
+ TournamentSeasonStatuses[TournamentSeasonStatuses["in_progress"] = 1] = "in_progress";
886
+ TournamentSeasonStatuses[TournamentSeasonStatuses["closed"] = 2] = "closed";
887
+ })(TournamentSeasonStatuses || (TournamentSeasonStatuses = {}));
882
888
  var TournamentSeason = /** @class */ (function (_super) {
883
889
  __extends(TournamentSeason, _super);
884
890
  function TournamentSeason() {
@@ -901,11 +907,13 @@ var TournamentSeason = /** @class */ (function (_super) {
901
907
  logo: 'logo',
902
908
  cover: 'cover',
903
909
  preview_image: 'previewImage',
910
+ status: 'status',
904
911
  },
905
912
  relation: {
906
913
  logo: File,
907
914
  cover: File,
908
- previewImage: File
915
+ previewImage: File,
916
+ status: enumField(TournamentSeasonStatuses),
909
917
  }
910
918
  })
911
919
  ], TournamentSeason);
@@ -1090,6 +1098,8 @@ var Tournament = /** @class */ (function (_super) {
1090
1098
  closest_game_datetime: 'closestGameDatetime',
1091
1099
  status: 'status',
1092
1100
  team_winner: 'teamWinner',
1101
+ team_second: 'teamSecond',
1102
+ team_third: 'teamThird',
1093
1103
  season: 'season',
1094
1104
  },
1095
1105
  relation: {
@@ -1104,6 +1114,8 @@ var Tournament = /** @class */ (function (_super) {
1104
1114
  league: League,
1105
1115
  status: enumField(TournamentStatuses),
1106
1116
  teamWinner: TournamentTeamWinner,
1117
+ teamSecond: TournamentTeamWinner,
1118
+ teamThird: TournamentTeamWinner,
1107
1119
  season: TournamentSeason,
1108
1120
  }
1109
1121
  })
@@ -1533,6 +1545,7 @@ var TournamentTeam = /** @class */ (function (_super) {
1533
1545
  tournament: 'tournament',
1534
1546
  team: 'team',
1535
1547
  group: 'group',
1548
+ final_standing: 'finalStanding',
1536
1549
  games_count: 'gamesCount',
1537
1550
  won_games_count: 'wonGamesCount',
1538
1551
  draw_games_count: 'drawGamesCount',
@@ -2952,6 +2965,9 @@ var LeagueApi = /** @class */ (function () {
2952
2965
  if (filters.search) {
2953
2966
  params = params.set('search', filters.search);
2954
2967
  }
2968
+ if (filters.tournamentTour) {
2969
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
2970
+ }
2955
2971
  }
2956
2972
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/events/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
2957
2973
  total: +result.headers.get('X-Page-Count'),
@@ -2969,7 +2985,7 @@ var LeagueApi = /** @class */ (function () {
2969
2985
  };
2970
2986
  LeagueApi.prototype.getGames = function (leagueId, page, size, filters) {
2971
2987
  return __awaiter(this, void 0, void 0, function () {
2972
- var params;
2988
+ var params, statuses;
2973
2989
  return __generator(this, function (_a) {
2974
2990
  params = new HttpParams().set('page', page.toString());
2975
2991
  if (size) {
@@ -2990,6 +3006,10 @@ var LeagueApi = /** @class */ (function () {
2990
3006
  if (filters.status) {
2991
3007
  params = params.set('status', GameStatuses[filters.status]);
2992
3008
  }
3009
+ if (filters.statuses) {
3010
+ statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
3011
+ params = params.set('statuses', statuses.join(','));
3012
+ }
2993
3013
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/games/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
2994
3014
  total: +result.headers.get('X-Page-Count'),
2995
3015
  data: Game.toFront(result.body)
@@ -2997,6 +3017,17 @@ var LeagueApi = /** @class */ (function () {
2997
3017
  });
2998
3018
  });
2999
3019
  };
3020
+ LeagueApi.prototype.getSeasons = function (leagueId, notClosed) {
3021
+ return __awaiter(this, void 0, void 0, function () {
3022
+ var params;
3023
+ return __generator(this, function (_a) {
3024
+ params = new HttpParams().set('not_closed', notClosed ? '1' : '');
3025
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournament_seasons/", { params: params })
3026
+ .pipe(map(function (result) { return TournamentSeason.toFront(result); }))
3027
+ .toPromise()];
3028
+ });
3029
+ });
3030
+ };
3000
3031
  LeagueApi.ctorParameters = function () { return [
3001
3032
  { type: HttpClient },
3002
3033
  { type: ConfigService }
@@ -3013,10 +3044,13 @@ var LeagueNewsApi = /** @class */ (function () {
3013
3044
  this.httpClient = httpClient;
3014
3045
  this.configService = configService;
3015
3046
  }
3016
- LeagueNewsApi.prototype.getLeagueNewsList = function (leagueId) {
3047
+ LeagueNewsApi.prototype.getLeagueNewsList = function (leagueId, page, size) {
3017
3048
  return __awaiter(this, void 0, void 0, function () {
3049
+ var params;
3018
3050
  return __generator(this, function (_a) {
3019
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/news/", { observe: 'response' })
3051
+ params = new HttpParams().set('page', page.toString())
3052
+ .set('size', size.toString());
3053
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/news/", { params: params, observe: 'response' })
3020
3054
  .pipe(map(function (response) { return ({
3021
3055
  total: +response.headers.get('X-Page-Count'),
3022
3056
  data: LeagueNews.toFront(response.body)
@@ -3034,6 +3068,15 @@ var LeagueNewsApi = /** @class */ (function () {
3034
3068
  });
3035
3069
  });
3036
3070
  };
3071
+ LeagueNewsApi.prototype.getMainLeagueNewsList = function (leagueId) {
3072
+ return __awaiter(this, void 0, void 0, function () {
3073
+ return __generator(this, function (_a) {
3074
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/news/?is_main=true")
3075
+ .pipe(map(function (response) { return LeagueNews.toFront(response); }))
3076
+ .toPromise()];
3077
+ });
3078
+ });
3079
+ };
3037
3080
  LeagueNewsApi.prototype.getNewsById = function (newsId) {
3038
3081
  return __awaiter(this, void 0, void 0, function () {
3039
3082
  return __generator(this, function (_a) {
@@ -3155,6 +3198,9 @@ var MediaApi = /** @class */ (function () {
3155
3198
  if (filters.mediaType) {
3156
3199
  params = params.set('media_type', filters.mediaType);
3157
3200
  }
3201
+ if (filters.sort) {
3202
+ params = params.set('sort', filters.sort);
3203
+ }
3158
3204
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/media/", { params: params, observe: 'response' })
3159
3205
  .pipe(map(function (response) { return ({
3160
3206
  total: +response.headers.get('X-Page-Count'),
@@ -4994,10 +5040,10 @@ var TournamentApi = /** @class */ (function () {
4994
5040
  this.httpClient = httpClient;
4995
5041
  this.configService = configService;
4996
5042
  }
4997
- TournamentApi.prototype.getByAlias = function (alias) {
5043
+ TournamentApi.prototype.getByAlias = function (leagueId, alias) {
4998
5044
  return __awaiter(this, void 0, void 0, function () {
4999
5045
  return __generator(this, function (_a) {
5000
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + alias + "/")
5046
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/" + alias + "/")
5001
5047
  .pipe(map(function (result) { return Tournament.toFront(result); }))
5002
5048
  .toPromise()];
5003
5049
  });
@@ -5025,6 +5071,9 @@ var TournamentApi = /** @class */ (function () {
5025
5071
  if (filters.search) {
5026
5072
  params = params.set('search', filters.search);
5027
5073
  }
5074
+ if (filters.tournamentTour) {
5075
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
5076
+ }
5028
5077
  }
5029
5078
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/events/", { params: params, observe: 'response' })
5030
5079
  .pipe(map(function (result) { return ({
@@ -5068,7 +5117,7 @@ var TournamentApi = /** @class */ (function () {
5068
5117
  TournamentApi.prototype.getGames = function (tournamentId, page, size, filters) {
5069
5118
  if (filters === void 0) { filters = {}; }
5070
5119
  return __awaiter(this, void 0, void 0, function () {
5071
- var params;
5120
+ var params, statuses;
5072
5121
  return __generator(this, function (_a) {
5073
5122
  params = new HttpParams().set('page', page.toString());
5074
5123
  if (size) {
@@ -5089,6 +5138,10 @@ var TournamentApi = /** @class */ (function () {
5089
5138
  if (filters.status) {
5090
5139
  params = params.set('status', GameStatuses[filters.status]);
5091
5140
  }
5141
+ if (filters.statuses) {
5142
+ statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
5143
+ params = params.set('statuses', statuses.join(','));
5144
+ }
5092
5145
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games/", { params: params, observe: 'response' })
5093
5146
  .pipe(map(function (result) { return ({
5094
5147
  total: +result.headers.get('X-Page-Count'),
@@ -5376,10 +5429,10 @@ var TournamentSeasonApi = /** @class */ (function () {
5376
5429
  this.httpClient = httpClient;
5377
5430
  this.configService = configService;
5378
5431
  }
5379
- TournamentSeasonApi.prototype.getByAlias = function (alias) {
5432
+ TournamentSeasonApi.prototype.getByAlias = function (leagueId, alias) {
5380
5433
  return __awaiter(this, void 0, void 0, function () {
5381
5434
  return __generator(this, function (_a) {
5382
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + alias + "/").pipe(map(function (result) { return TournamentSeason.toFront(result); })).toPromise()];
5435
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournament_seasons/" + alias + "/").pipe(map(function (result) { return TournamentSeason.toFront(result); })).toPromise()];
5383
5436
  });
5384
5437
  });
5385
5438
  };
@@ -5392,7 +5445,7 @@ var TournamentSeasonApi = /** @class */ (function () {
5392
5445
  };
5393
5446
  TournamentSeasonApi.prototype.getGames = function (seasonId, page, size, filters) {
5394
5447
  return __awaiter(this, void 0, void 0, function () {
5395
- var params;
5448
+ var params, statuses;
5396
5449
  return __generator(this, function (_a) {
5397
5450
  params = new HttpParams().set('page', page.toString());
5398
5451
  if (size) {
@@ -5413,6 +5466,10 @@ var TournamentSeasonApi = /** @class */ (function () {
5413
5466
  if (filters.status) {
5414
5467
  params = params.set('status', GameStatuses[filters.status]);
5415
5468
  }
5469
+ if (filters.statuses) {
5470
+ statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
5471
+ params = params.set('statuses', statuses.join(','));
5472
+ }
5416
5473
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/games/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
5417
5474
  total: +result.headers.get('X-Page-Count'),
5418
5475
  data: Game.toFront(result.body)
@@ -5433,6 +5490,9 @@ var TournamentSeasonApi = /** @class */ (function () {
5433
5490
  if (filters.search) {
5434
5491
  params = params.set('search', filters.search);
5435
5492
  }
5493
+ if (filters.tournamentTour) {
5494
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
5495
+ }
5436
5496
  }
5437
5497
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/events/", { params: params, observe: 'response' })
5438
5498
  .pipe(map(function (result) { return ({
@@ -5485,6 +5545,15 @@ var TournamentSeasonApi = /** @class */ (function () {
5485
5545
  });
5486
5546
  });
5487
5547
  };
5548
+ TournamentSeasonApi.prototype.getGamesStages = function (seasonId) {
5549
+ return __awaiter(this, void 0, void 0, function () {
5550
+ return __generator(this, function (_a) {
5551
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/games_stages/")
5552
+ .pipe(map(function (data) { return GameTimelineStages.toFront(data); }))
5553
+ .toPromise()];
5554
+ });
5555
+ });
5556
+ };
5488
5557
  TournamentSeasonApi.ctorParameters = function () { return [
5489
5558
  { type: HttpClient },
5490
5559
  { type: ConfigService }
@@ -6779,5 +6848,5 @@ var HttpCookieInterceptor = /** @class */ (function () {
6779
6848
  * Generated bundle index. Do not edit.
6780
6849
  */
6781
6850
 
6782
- 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, TournamentSeason, TournamentSeasonApi, 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, VolleyballStatisticTypes, 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 };
6851
+ 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, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, 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, VolleyballStatisticTypes, 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 };
6783
6852
  //# sourceMappingURL=mtgame-core.js.map