@mtgame/core 0.0.37 → 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.
- package/api/basketball-game-api.d.ts +1 -0
- package/api/league-api.d.ts +6 -1
- package/api/league-news-api.d.ts +2 -1
- package/api/media-api.d.ts +5 -0
- package/api/public-api.d.ts +1 -0
- package/api/tournament-api.d.ts +4 -1
- package/api/tournament-season-api.d.ts +23 -0
- package/bundles/mtgame-core.umd.js +302 -7
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +1 -1
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/api/basketball-game-api.js +7 -1
- package/esm2015/api/league-api.js +50 -1
- package/esm2015/api/league-news-api.js +13 -4
- package/esm2015/api/media-api.js +17 -1
- package/esm2015/api/public-api.js +2 -1
- package/esm2015/api/tournament-api.js +10 -3
- package/esm2015/api/tournament-season-api.js +138 -0
- package/esm2015/models/game.js +4 -1
- package/esm2015/models/public-api.js +2 -1
- package/esm2015/models/tournament-season.js +40 -0
- package/esm2015/models/tournament-team.js +2 -1
- package/esm2015/models/tournament.js +10 -3
- package/esm5/api/basketball-game-api.js +9 -1
- package/esm5/api/league-api.js +58 -1
- package/esm5/api/league-news-api.js +16 -4
- package/esm5/api/media-api.js +21 -1
- package/esm5/api/public-api.js +2 -1
- package/esm5/api/tournament-api.js +11 -4
- package/esm5/api/tournament-season-api.js +156 -0
- package/esm5/models/game.js +4 -1
- package/esm5/models/public-api.js +2 -1
- package/esm5/models/tournament-season.js +45 -0
- package/esm5/models/tournament-team.js +2 -1
- package/esm5/models/tournament.js +10 -3
- package/fesm2015/mtgame-core.js +260 -7
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +301 -8
- package/fesm5/mtgame-core.js.map +1 -1
- package/models/game.d.ts +2 -0
- package/models/public-api.d.ts +1 -0
- package/models/tournament-season.d.ts +18 -0
- package/models/tournament-team.d.ts +1 -0
- package/models/tournament.d.ts +4 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -15,4 +15,5 @@ export declare class BasketballGameApi {
|
|
|
15
15
|
getUserStatistic(gameId: number): Promise<BasketballGameStatistic[]>;
|
|
16
16
|
getLogs(gameId: number): Promise<BasketballGameLog[]>;
|
|
17
17
|
downloadProtocol(gameId: number, fileType: 'xlsx' | 'pdf'): Promise<any>;
|
|
18
|
+
downloadFibaProtocol(gameId: number, fileType: 'xlsx' | 'pdf'): Promise<any>;
|
|
18
19
|
}
|
package/api/league-api.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { HttpClient } from '@angular/common/http';
|
|
|
2
2
|
import { League } from '../models/league';
|
|
3
3
|
import { Tournament } from '../models/tournament';
|
|
4
4
|
import { ConfigService } from '../services/config.service';
|
|
5
|
-
import { TournamentEventsListFilter } from './tournament-api';
|
|
5
|
+
import { TournamentEventsListFilter, TournamentGamesFilters } from './tournament-api';
|
|
6
6
|
import { PaginatedResponse } from './paginated-response.interface';
|
|
7
7
|
import { TournamentEvent } from '../models/tournament-event';
|
|
8
|
+
import { TournamentSeason } from '../models/tournament-season';
|
|
9
|
+
import { Game } from '../models/game';
|
|
8
10
|
export declare class LeagueApi {
|
|
9
11
|
private httpClient;
|
|
10
12
|
private configService;
|
|
@@ -13,4 +15,7 @@ export declare class LeagueApi {
|
|
|
13
15
|
getByDomain(domain: string): Promise<League>;
|
|
14
16
|
getTournaments(leagueId: number): Promise<Tournament[]>;
|
|
15
17
|
getEvents(leagueId: number, page: number, size: number, filters?: TournamentEventsListFilter): Promise<PaginatedResponse<TournamentEvent[]>>;
|
|
18
|
+
getTournamentSeasons(leagueId: number): Promise<TournamentSeason[]>;
|
|
19
|
+
getGames(leagueId: number, page: number, size: number, filters: TournamentGamesFilters): Promise<PaginatedResponse<Game[]>>;
|
|
20
|
+
getSeasons(leagueId: number, notClosed?: boolean): Promise<TournamentSeason[]>;
|
|
16
21
|
}
|
package/api/league-news-api.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export declare class LeagueNewsApi {
|
|
|
6
6
|
private httpClient;
|
|
7
7
|
private configService;
|
|
8
8
|
constructor(httpClient: HttpClient, configService: ConfigService);
|
|
9
|
-
getLeagueNewsList(leagueId: number): Promise<PaginatedResponse<LeagueNews[]>>;
|
|
9
|
+
getLeagueNewsList(leagueId: number, page: number, size: number): Promise<PaginatedResponse<LeagueNews[]>>;
|
|
10
10
|
getMainLeagueNews(leagueId: number): Promise<LeagueNews>;
|
|
11
|
+
getMainLeagueNewsList(leagueId: number): Promise<LeagueNews[]>;
|
|
11
12
|
getNewsById(newsId: number): Promise<LeagueNews>;
|
|
12
13
|
getTournamentNewsList(tournamentId: number): Promise<PaginatedResponse<LeagueNews[]>>;
|
|
13
14
|
}
|
package/api/media-api.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export interface GameMediaFilters {
|
|
|
11
11
|
playoffId?: number;
|
|
12
12
|
status?: GameStatuses;
|
|
13
13
|
}
|
|
14
|
+
export interface MediaFilters {
|
|
15
|
+
mediaType?: 'photo' | 'video' | 'live_video';
|
|
16
|
+
sort?: string;
|
|
17
|
+
}
|
|
14
18
|
export declare class MediaApi {
|
|
15
19
|
private httpClient;
|
|
16
20
|
private configService;
|
|
@@ -18,6 +22,7 @@ export declare class MediaApi {
|
|
|
18
22
|
getMedia(mediaId: number): Promise<MediaItem>;
|
|
19
23
|
getTournamentGameMedia(tournamentId: number, page: number, size: number, filters?: GameMediaFilters): Promise<PaginatedResponse<Game[]>>;
|
|
20
24
|
getLeagueGameMedia(leagueId: number, page: number, size: number, filters?: GameMediaFilters): Promise<PaginatedResponse<Game[]>>;
|
|
25
|
+
getLeagueMedia(leagueId: number, page: number, size: number, filters?: MediaFilters): Promise<PaginatedResponse<MediaItem[]>>;
|
|
21
26
|
getGameMediaById(gameId: number): Promise<Game>;
|
|
22
27
|
getGameMedia(gameId: number): Promise<MediaItem[]>;
|
|
23
28
|
createZip(mediaIds: number[]): Promise<any>;
|
package/api/public-api.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './team-api';
|
|
|
14
14
|
export * from './team-event-api';
|
|
15
15
|
export { TournamentApi, TournamentGamesFilters, TournamentEventsListFilter, StatisticGroupByTypes, StatisticFilters } from './tournament-api';
|
|
16
16
|
export { TournamentJoinApi } from './tournament-join-api';
|
|
17
|
+
export * from './tournament-season-api';
|
|
17
18
|
export { TournamentStageApi } from './tournament-stage-api';
|
|
18
19
|
export * from './user-api';
|
|
19
20
|
export { VolleyballGameApi } from './volleyball-game-api';
|
package/api/tournament-api.d.ts
CHANGED
|
@@ -22,10 +22,12 @@ export interface TournamentGamesFilters {
|
|
|
22
22
|
playoffStage?: number;
|
|
23
23
|
playoffId?: number;
|
|
24
24
|
status?: GameStatuses;
|
|
25
|
+
statuses?: GameStatuses[];
|
|
25
26
|
}
|
|
26
27
|
export declare type StatisticGroupByTypes = 'team' | 'user' | 'team_user' | 'tournament_team' | 'tournament_team_user' | 'month' | 'win_loses';
|
|
27
28
|
export interface StatisticFilters {
|
|
28
29
|
tournament_id?: number;
|
|
30
|
+
tournament_season_id?: number;
|
|
29
31
|
tournament_team_id?: number;
|
|
30
32
|
tournament_team_user_id?: number;
|
|
31
33
|
team_id?: number;
|
|
@@ -43,12 +45,13 @@ export interface StatisticFilters {
|
|
|
43
45
|
export interface TournamentEventsListFilter {
|
|
44
46
|
event?: TournamentEventTypes;
|
|
45
47
|
search?: string;
|
|
48
|
+
tournamentTour?: number;
|
|
46
49
|
}
|
|
47
50
|
export declare class TournamentApi {
|
|
48
51
|
private httpClient;
|
|
49
52
|
private configService;
|
|
50
53
|
constructor(httpClient: HttpClient, configService: ConfigService);
|
|
51
|
-
getByAlias(alias: string): Promise<Tournament>;
|
|
54
|
+
getByAlias(leagueId: number, alias: string): Promise<Tournament>;
|
|
52
55
|
getNews(tournamentId: number): Promise<TournamentNews[]>;
|
|
53
56
|
getEvents(tournamentId: number, page: number, size: number, filters?: TournamentEventsListFilter): Promise<PaginatedResponse<TournamentEvent[]>>;
|
|
54
57
|
getTournamentStages(tournamentId: number): Promise<TournamentStage[]>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { TournamentSeason } from '../models/tournament-season';
|
|
3
|
+
import { ConfigService } from '../services/config.service';
|
|
4
|
+
import { Game } from '../models/game';
|
|
5
|
+
import { Tournament } from '../models/tournament';
|
|
6
|
+
import { TournamentEventsListFilter, TournamentGamesFilters } from './tournament-api';
|
|
7
|
+
import { PaginatedResponse } from './paginated-response.interface';
|
|
8
|
+
import { TournamentEvent } from '../models/tournament-event';
|
|
9
|
+
import { GameMediaFilters } from './media-api';
|
|
10
|
+
import { TournamentTeam } from '../models/tournament-team';
|
|
11
|
+
import { GameTimelineStages } from '../models/game-timeline-stages';
|
|
12
|
+
export declare class TournamentSeasonApi {
|
|
13
|
+
private httpClient;
|
|
14
|
+
private configService;
|
|
15
|
+
constructor(httpClient: HttpClient, configService: ConfigService);
|
|
16
|
+
getByAlias(leagueId: number, alias: string): Promise<TournamentSeason>;
|
|
17
|
+
getTournaments(seasonId: number): Promise<Tournament[]>;
|
|
18
|
+
getGames(seasonId: number, page: number, size: number, filters: TournamentGamesFilters): Promise<PaginatedResponse<Game[]>>;
|
|
19
|
+
getEvents(seasonId: number, page: number, size: number, filters?: TournamentEventsListFilter): Promise<PaginatedResponse<TournamentEvent[]>>;
|
|
20
|
+
getGameMedia(seasonId: number, page: number, size: number, filters: GameMediaFilters): Promise<PaginatedResponse<Game[]>>;
|
|
21
|
+
getTeams(seasonId: number): Promise<TournamentTeam[]>;
|
|
22
|
+
getGamesStages(seasonId: number): Promise<GameTimelineStages>;
|
|
23
|
+
}
|
|
@@ -1093,6 +1093,47 @@
|
|
|
1093
1093
|
}(BaseModel));
|
|
1094
1094
|
|
|
1095
1095
|
|
|
1096
|
+
(function (TournamentSeasonStatuses) {
|
|
1097
|
+
TournamentSeasonStatuses[TournamentSeasonStatuses["open"] = 0] = "open";
|
|
1098
|
+
TournamentSeasonStatuses[TournamentSeasonStatuses["in_progress"] = 1] = "in_progress";
|
|
1099
|
+
TournamentSeasonStatuses[TournamentSeasonStatuses["closed"] = 2] = "closed";
|
|
1100
|
+
})(exports.TournamentSeasonStatuses || (exports.TournamentSeasonStatuses = {}));
|
|
1101
|
+
var TournamentSeason = /** @class */ (function (_super) {
|
|
1102
|
+
__extends(TournamentSeason, _super);
|
|
1103
|
+
function TournamentSeason() {
|
|
1104
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1105
|
+
}
|
|
1106
|
+
TournamentSeason.toFront = function (data) { };
|
|
1107
|
+
TournamentSeason.toBack = function (data) { };
|
|
1108
|
+
__decorate([
|
|
1109
|
+
ToFrontHook
|
|
1110
|
+
], TournamentSeason, "toFront", null);
|
|
1111
|
+
__decorate([
|
|
1112
|
+
ToBackHook
|
|
1113
|
+
], TournamentSeason, "toBack", null);
|
|
1114
|
+
TournamentSeason = __decorate([
|
|
1115
|
+
ModelInstance({
|
|
1116
|
+
mappingFields: {
|
|
1117
|
+
id: 'id',
|
|
1118
|
+
name: 'name',
|
|
1119
|
+
alias: 'alias',
|
|
1120
|
+
logo: 'logo',
|
|
1121
|
+
cover: 'cover',
|
|
1122
|
+
preview_image: 'previewImage',
|
|
1123
|
+
status: 'status',
|
|
1124
|
+
},
|
|
1125
|
+
relation: {
|
|
1126
|
+
logo: File,
|
|
1127
|
+
cover: File,
|
|
1128
|
+
previewImage: File,
|
|
1129
|
+
status: enumField(exports.TournamentSeasonStatuses),
|
|
1130
|
+
}
|
|
1131
|
+
})
|
|
1132
|
+
], TournamentSeason);
|
|
1133
|
+
return TournamentSeason;
|
|
1134
|
+
}(BaseModel));
|
|
1135
|
+
|
|
1136
|
+
|
|
1096
1137
|
(function (TournamentTypes) {
|
|
1097
1138
|
TournamentTypes["group"] = "group";
|
|
1098
1139
|
TournamentTypes["elimination"] = "elimination";
|
|
@@ -1269,7 +1310,10 @@
|
|
|
1269
1310
|
teams_count: 'teamsCount',
|
|
1270
1311
|
closest_game_datetime: 'closestGameDatetime',
|
|
1271
1312
|
status: 'status',
|
|
1272
|
-
team_winner: 'teamWinner'
|
|
1313
|
+
team_winner: 'teamWinner',
|
|
1314
|
+
team_second: 'teamSecond',
|
|
1315
|
+
team_third: 'teamThird',
|
|
1316
|
+
season: 'season',
|
|
1273
1317
|
},
|
|
1274
1318
|
relation: {
|
|
1275
1319
|
logo: File,
|
|
@@ -1282,7 +1326,10 @@
|
|
|
1282
1326
|
date: DateTimeField,
|
|
1283
1327
|
league: League,
|
|
1284
1328
|
status: enumField(exports.TournamentStatuses),
|
|
1285
|
-
teamWinner: TournamentTeamWinner
|
|
1329
|
+
teamWinner: TournamentTeamWinner,
|
|
1330
|
+
teamSecond: TournamentTeamWinner,
|
|
1331
|
+
teamThird: TournamentTeamWinner,
|
|
1332
|
+
season: TournamentSeason,
|
|
1286
1333
|
}
|
|
1287
1334
|
})
|
|
1288
1335
|
], Tournament);
|
|
@@ -1595,6 +1642,7 @@
|
|
|
1595
1642
|
tournament_court: 'tournamentCourt',
|
|
1596
1643
|
media_count: 'mediaCount',
|
|
1597
1644
|
media: 'media',
|
|
1645
|
+
tournament: 'tournament',
|
|
1598
1646
|
},
|
|
1599
1647
|
relation: {
|
|
1600
1648
|
status: enumField(exports.GameStatuses),
|
|
@@ -1607,6 +1655,7 @@
|
|
|
1607
1655
|
hockeyGameConfig: HockeyGameConfig,
|
|
1608
1656
|
tournamentCourt: LeagueCourt,
|
|
1609
1657
|
media: listField(MediaItem),
|
|
1658
|
+
tournament: Tournament,
|
|
1610
1659
|
}
|
|
1611
1660
|
})
|
|
1612
1661
|
], Game);
|
|
@@ -1709,6 +1758,7 @@
|
|
|
1709
1758
|
tournament: 'tournament',
|
|
1710
1759
|
team: 'team',
|
|
1711
1760
|
group: 'group',
|
|
1761
|
+
final_standing: 'finalStanding',
|
|
1712
1762
|
games_count: 'gamesCount',
|
|
1713
1763
|
won_games_count: 'wonGamesCount',
|
|
1714
1764
|
draw_games_count: 'drawGamesCount',
|
|
@@ -2397,6 +2447,14 @@
|
|
|
2397
2447
|
});
|
|
2398
2448
|
});
|
|
2399
2449
|
};
|
|
2450
|
+
BasketballGameApi.prototype.downloadFibaProtocol = function (gameId, fileType) {
|
|
2451
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2452
|
+
return __generator(this, function (_a) {
|
|
2453
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_basketball_game/" + gameId + "/game_protocol_fiba/?file_type=" + fileType, { responseType: 'blob' })
|
|
2454
|
+
.toPromise()];
|
|
2455
|
+
});
|
|
2456
|
+
});
|
|
2457
|
+
};
|
|
2400
2458
|
BasketballGameApi.ctorParameters = function () { return [
|
|
2401
2459
|
{ type: http.HttpClient },
|
|
2402
2460
|
{ type: ConfigService }
|
|
@@ -3120,6 +3178,9 @@
|
|
|
3120
3178
|
if (filters.search) {
|
|
3121
3179
|
params = params.set('search', filters.search);
|
|
3122
3180
|
}
|
|
3181
|
+
if (filters.tournamentTour) {
|
|
3182
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
3183
|
+
}
|
|
3123
3184
|
}
|
|
3124
3185
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/events/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
|
|
3125
3186
|
total: +result.headers.get('X-Page-Count'),
|
|
@@ -3128,6 +3189,58 @@
|
|
|
3128
3189
|
});
|
|
3129
3190
|
});
|
|
3130
3191
|
};
|
|
3192
|
+
LeagueApi.prototype.getTournamentSeasons = function (leagueId) {
|
|
3193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3194
|
+
return __generator(this, function (_a) {
|
|
3195
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournament_seasons/").pipe(operators.map(function (result) { return TournamentSeason.toFront(result); })).toPromise()];
|
|
3196
|
+
});
|
|
3197
|
+
});
|
|
3198
|
+
};
|
|
3199
|
+
LeagueApi.prototype.getGames = function (leagueId, page, size, filters) {
|
|
3200
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3201
|
+
var params, statuses;
|
|
3202
|
+
return __generator(this, function (_a) {
|
|
3203
|
+
params = new http.HttpParams().set('page', page.toString());
|
|
3204
|
+
if (size) {
|
|
3205
|
+
params = params.set('size', size.toString());
|
|
3206
|
+
}
|
|
3207
|
+
if (filters.tournamentStageId) {
|
|
3208
|
+
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
3209
|
+
}
|
|
3210
|
+
if (filters.tournamentTour) {
|
|
3211
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
3212
|
+
}
|
|
3213
|
+
if (filters.playoffStage) {
|
|
3214
|
+
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
3215
|
+
}
|
|
3216
|
+
if (filters.teamId) {
|
|
3217
|
+
params = params.set('team_id', filters.teamId.toString());
|
|
3218
|
+
}
|
|
3219
|
+
if (filters.status) {
|
|
3220
|
+
params = params.set('status', exports.GameStatuses[filters.status]);
|
|
3221
|
+
}
|
|
3222
|
+
if (filters.statuses) {
|
|
3223
|
+
statuses = filters.statuses.map(function (i) { return exports.GameStatuses[i]; });
|
|
3224
|
+
params = params.set('statuses', statuses.join(','));
|
|
3225
|
+
}
|
|
3226
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/games/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
|
|
3227
|
+
total: +result.headers.get('X-Page-Count'),
|
|
3228
|
+
data: Game.toFront(result.body)
|
|
3229
|
+
}); })).toPromise()];
|
|
3230
|
+
});
|
|
3231
|
+
});
|
|
3232
|
+
};
|
|
3233
|
+
LeagueApi.prototype.getSeasons = function (leagueId, notClosed) {
|
|
3234
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3235
|
+
var params;
|
|
3236
|
+
return __generator(this, function (_a) {
|
|
3237
|
+
params = new http.HttpParams().set('not_closed', notClosed ? '1' : '');
|
|
3238
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournament_seasons/", { params: params })
|
|
3239
|
+
.pipe(operators.map(function (result) { return TournamentSeason.toFront(result); }))
|
|
3240
|
+
.toPromise()];
|
|
3241
|
+
});
|
|
3242
|
+
});
|
|
3243
|
+
};
|
|
3131
3244
|
LeagueApi.ctorParameters = function () { return [
|
|
3132
3245
|
{ type: http.HttpClient },
|
|
3133
3246
|
{ type: ConfigService }
|
|
@@ -3144,10 +3257,13 @@
|
|
|
3144
3257
|
this.httpClient = httpClient;
|
|
3145
3258
|
this.configService = configService;
|
|
3146
3259
|
}
|
|
3147
|
-
LeagueNewsApi.prototype.getLeagueNewsList = function (leagueId) {
|
|
3260
|
+
LeagueNewsApi.prototype.getLeagueNewsList = function (leagueId, page, size) {
|
|
3148
3261
|
return __awaiter(this, void 0, void 0, function () {
|
|
3262
|
+
var params;
|
|
3149
3263
|
return __generator(this, function (_a) {
|
|
3150
|
-
|
|
3264
|
+
params = new http.HttpParams().set('page', page.toString())
|
|
3265
|
+
.set('size', size.toString());
|
|
3266
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/news/", { params: params, observe: 'response' })
|
|
3151
3267
|
.pipe(operators.map(function (response) { return ({
|
|
3152
3268
|
total: +response.headers.get('X-Page-Count'),
|
|
3153
3269
|
data: LeagueNews.toFront(response.body)
|
|
@@ -3165,6 +3281,15 @@
|
|
|
3165
3281
|
});
|
|
3166
3282
|
});
|
|
3167
3283
|
};
|
|
3284
|
+
LeagueNewsApi.prototype.getMainLeagueNewsList = function (leagueId) {
|
|
3285
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3286
|
+
return __generator(this, function (_a) {
|
|
3287
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/news/?is_main=true")
|
|
3288
|
+
.pipe(operators.map(function (response) { return LeagueNews.toFront(response); }))
|
|
3289
|
+
.toPromise()];
|
|
3290
|
+
});
|
|
3291
|
+
});
|
|
3292
|
+
};
|
|
3168
3293
|
LeagueNewsApi.prototype.getNewsById = function (newsId) {
|
|
3169
3294
|
return __awaiter(this, void 0, void 0, function () {
|
|
3170
3295
|
return __generator(this, function (_a) {
|
|
@@ -3277,6 +3402,26 @@
|
|
|
3277
3402
|
});
|
|
3278
3403
|
});
|
|
3279
3404
|
};
|
|
3405
|
+
MediaApi.prototype.getLeagueMedia = function (leagueId, page, size, filters) {
|
|
3406
|
+
if (filters === void 0) { filters = {}; }
|
|
3407
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3408
|
+
var params;
|
|
3409
|
+
return __generator(this, function (_a) {
|
|
3410
|
+
params = new http.HttpParams().set('page', page.toString()).set('size', size.toString());
|
|
3411
|
+
if (filters.mediaType) {
|
|
3412
|
+
params = params.set('media_type', filters.mediaType);
|
|
3413
|
+
}
|
|
3414
|
+
if (filters.sort) {
|
|
3415
|
+
params = params.set('sort', filters.sort);
|
|
3416
|
+
}
|
|
3417
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/media/", { params: params, observe: 'response' })
|
|
3418
|
+
.pipe(operators.map(function (response) { return ({
|
|
3419
|
+
total: +response.headers.get('X-Page-Count'),
|
|
3420
|
+
data: MediaItem.toFront(response.body)
|
|
3421
|
+
}); })).toPromise()];
|
|
3422
|
+
});
|
|
3423
|
+
});
|
|
3424
|
+
};
|
|
3280
3425
|
MediaApi.prototype.getGameMediaById = function (gameId) {
|
|
3281
3426
|
return __awaiter(this, void 0, void 0, function () {
|
|
3282
3427
|
return __generator(this, function (_a) {
|
|
@@ -5108,10 +5253,10 @@
|
|
|
5108
5253
|
this.httpClient = httpClient;
|
|
5109
5254
|
this.configService = configService;
|
|
5110
5255
|
}
|
|
5111
|
-
TournamentApi.prototype.getByAlias = function (alias) {
|
|
5256
|
+
TournamentApi.prototype.getByAlias = function (leagueId, alias) {
|
|
5112
5257
|
return __awaiter(this, void 0, void 0, function () {
|
|
5113
5258
|
return __generator(this, function (_a) {
|
|
5114
|
-
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/
|
|
5259
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/" + alias + "/")
|
|
5115
5260
|
.pipe(operators.map(function (result) { return Tournament.toFront(result); }))
|
|
5116
5261
|
.toPromise()];
|
|
5117
5262
|
});
|
|
@@ -5139,6 +5284,9 @@
|
|
|
5139
5284
|
if (filters.search) {
|
|
5140
5285
|
params = params.set('search', filters.search);
|
|
5141
5286
|
}
|
|
5287
|
+
if (filters.tournamentTour) {
|
|
5288
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5289
|
+
}
|
|
5142
5290
|
}
|
|
5143
5291
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/events/", { params: params, observe: 'response' })
|
|
5144
5292
|
.pipe(operators.map(function (result) { return ({
|
|
@@ -5182,7 +5330,7 @@
|
|
|
5182
5330
|
TournamentApi.prototype.getGames = function (tournamentId, page, size, filters) {
|
|
5183
5331
|
if (filters === void 0) { filters = {}; }
|
|
5184
5332
|
return __awaiter(this, void 0, void 0, function () {
|
|
5185
|
-
var params;
|
|
5333
|
+
var params, statuses;
|
|
5186
5334
|
return __generator(this, function (_a) {
|
|
5187
5335
|
params = new http.HttpParams().set('page', page.toString());
|
|
5188
5336
|
if (size) {
|
|
@@ -5203,6 +5351,10 @@
|
|
|
5203
5351
|
if (filters.status) {
|
|
5204
5352
|
params = params.set('status', exports.GameStatuses[filters.status]);
|
|
5205
5353
|
}
|
|
5354
|
+
if (filters.statuses) {
|
|
5355
|
+
statuses = filters.statuses.map(function (i) { return exports.GameStatuses[i]; });
|
|
5356
|
+
params = params.set('statuses', statuses.join(','));
|
|
5357
|
+
}
|
|
5206
5358
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games/", { params: params, observe: 'response' })
|
|
5207
5359
|
.pipe(operators.map(function (result) { return ({
|
|
5208
5360
|
total: +result.headers.get('X-Page-Count'),
|
|
@@ -5485,6 +5637,147 @@
|
|
|
5485
5637
|
return TournamentJoinApi;
|
|
5486
5638
|
}());
|
|
5487
5639
|
|
|
5640
|
+
var TournamentSeasonApi = /** @class */ (function () {
|
|
5641
|
+
function TournamentSeasonApi(httpClient, configService) {
|
|
5642
|
+
this.httpClient = httpClient;
|
|
5643
|
+
this.configService = configService;
|
|
5644
|
+
}
|
|
5645
|
+
TournamentSeasonApi.prototype.getByAlias = function (leagueId, alias) {
|
|
5646
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5647
|
+
return __generator(this, function (_a) {
|
|
5648
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournament_seasons/" + alias + "/").pipe(operators.map(function (result) { return TournamentSeason.toFront(result); })).toPromise()];
|
|
5649
|
+
});
|
|
5650
|
+
});
|
|
5651
|
+
};
|
|
5652
|
+
TournamentSeasonApi.prototype.getTournaments = function (seasonId) {
|
|
5653
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5654
|
+
return __generator(this, function (_a) {
|
|
5655
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/tournaments/").pipe(operators.map(function (result) { return Tournament.toFront(result); })).toPromise()];
|
|
5656
|
+
});
|
|
5657
|
+
});
|
|
5658
|
+
};
|
|
5659
|
+
TournamentSeasonApi.prototype.getGames = function (seasonId, page, size, filters) {
|
|
5660
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5661
|
+
var params, statuses;
|
|
5662
|
+
return __generator(this, function (_a) {
|
|
5663
|
+
params = new http.HttpParams().set('page', page.toString());
|
|
5664
|
+
if (size) {
|
|
5665
|
+
params = params.set('size', size.toString());
|
|
5666
|
+
}
|
|
5667
|
+
if (filters.tournamentStageId) {
|
|
5668
|
+
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
5669
|
+
}
|
|
5670
|
+
if (filters.tournamentTour) {
|
|
5671
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5672
|
+
}
|
|
5673
|
+
if (filters.playoffStage) {
|
|
5674
|
+
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
5675
|
+
}
|
|
5676
|
+
if (filters.teamId) {
|
|
5677
|
+
params = params.set('team_id', filters.teamId.toString());
|
|
5678
|
+
}
|
|
5679
|
+
if (filters.status) {
|
|
5680
|
+
params = params.set('status', exports.GameStatuses[filters.status]);
|
|
5681
|
+
}
|
|
5682
|
+
if (filters.statuses) {
|
|
5683
|
+
statuses = filters.statuses.map(function (i) { return exports.GameStatuses[i]; });
|
|
5684
|
+
params = params.set('statuses', statuses.join(','));
|
|
5685
|
+
}
|
|
5686
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/games/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
|
|
5687
|
+
total: +result.headers.get('X-Page-Count'),
|
|
5688
|
+
data: Game.toFront(result.body)
|
|
5689
|
+
}); })).toPromise()];
|
|
5690
|
+
});
|
|
5691
|
+
});
|
|
5692
|
+
};
|
|
5693
|
+
TournamentSeasonApi.prototype.getEvents = function (seasonId, page, size, filters) {
|
|
5694
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5695
|
+
var params;
|
|
5696
|
+
return __generator(this, function (_a) {
|
|
5697
|
+
params = new http.HttpParams().set('page', page.toString())
|
|
5698
|
+
.set('size', size.toString());
|
|
5699
|
+
if (filters) {
|
|
5700
|
+
if (filters.event) {
|
|
5701
|
+
params = params.set('event', exports.TournamentEventTypes[filters.event]);
|
|
5702
|
+
}
|
|
5703
|
+
if (filters.search) {
|
|
5704
|
+
params = params.set('search', filters.search);
|
|
5705
|
+
}
|
|
5706
|
+
if (filters.tournamentTour) {
|
|
5707
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5708
|
+
}
|
|
5709
|
+
}
|
|
5710
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/events/", { params: params, observe: 'response' })
|
|
5711
|
+
.pipe(operators.map(function (result) { return ({
|
|
5712
|
+
total: +result.headers.get('X-Page-Count'),
|
|
5713
|
+
data: TournamentEvent.toFront(result.body)
|
|
5714
|
+
}); }))
|
|
5715
|
+
.toPromise()];
|
|
5716
|
+
});
|
|
5717
|
+
});
|
|
5718
|
+
};
|
|
5719
|
+
TournamentSeasonApi.prototype.getGameMedia = function (seasonId, page, size, filters) {
|
|
5720
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5721
|
+
var params;
|
|
5722
|
+
return __generator(this, function (_a) {
|
|
5723
|
+
params = new http.HttpParams().set('page', page.toString()).set('size', size.toString());
|
|
5724
|
+
if (filters) {
|
|
5725
|
+
if (filters.tournamentTour) {
|
|
5726
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5727
|
+
}
|
|
5728
|
+
if (filters.teamId) {
|
|
5729
|
+
params = params.set('team_id', filters.teamId.toString());
|
|
5730
|
+
}
|
|
5731
|
+
if (filters.tournamentStageId) {
|
|
5732
|
+
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
5733
|
+
}
|
|
5734
|
+
if (filters.playoffId) {
|
|
5735
|
+
params = params.set('playoff_id', filters.playoffId.toString());
|
|
5736
|
+
}
|
|
5737
|
+
if (filters.playoffStage) {
|
|
5738
|
+
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
5739
|
+
}
|
|
5740
|
+
if (filters.status) {
|
|
5741
|
+
params = params.set('status', exports.GameStatuses[filters.status]);
|
|
5742
|
+
}
|
|
5743
|
+
}
|
|
5744
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/game_media/", { observe: 'response', params: params })
|
|
5745
|
+
.pipe(operators.map(function (response) {
|
|
5746
|
+
return {
|
|
5747
|
+
total: +response.headers.get('X-Page-Count'),
|
|
5748
|
+
data: Game.toFront(response.body)
|
|
5749
|
+
};
|
|
5750
|
+
})).toPromise()];
|
|
5751
|
+
});
|
|
5752
|
+
});
|
|
5753
|
+
};
|
|
5754
|
+
TournamentSeasonApi.prototype.getTeams = function (seasonId) {
|
|
5755
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5756
|
+
return __generator(this, function (_a) {
|
|
5757
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/teams/").pipe(operators.map(function (result) { return TournamentTeam.toFront(result); })).toPromise()];
|
|
5758
|
+
});
|
|
5759
|
+
});
|
|
5760
|
+
};
|
|
5761
|
+
TournamentSeasonApi.prototype.getGamesStages = function (seasonId) {
|
|
5762
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5763
|
+
return __generator(this, function (_a) {
|
|
5764
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/games_stages/")
|
|
5765
|
+
.pipe(operators.map(function (data) { return GameTimelineStages.toFront(data); }))
|
|
5766
|
+
.toPromise()];
|
|
5767
|
+
});
|
|
5768
|
+
});
|
|
5769
|
+
};
|
|
5770
|
+
TournamentSeasonApi.ctorParameters = function () { return [
|
|
5771
|
+
{ type: http.HttpClient },
|
|
5772
|
+
{ type: ConfigService }
|
|
5773
|
+
]; };
|
|
5774
|
+
TournamentSeasonApi.ɵprov = core.ɵɵdefineInjectable({ factory: function TournamentSeasonApi_Factory() { return new TournamentSeasonApi(core.ɵɵinject(http.HttpClient), core.ɵɵinject(ConfigService)); }, token: TournamentSeasonApi, providedIn: "root" });
|
|
5775
|
+
TournamentSeasonApi = __decorate([
|
|
5776
|
+
core.Injectable({ providedIn: 'root' })
|
|
5777
|
+
], TournamentSeasonApi);
|
|
5778
|
+
return TournamentSeasonApi;
|
|
5779
|
+
}());
|
|
5780
|
+
|
|
5488
5781
|
var TournamentStageApi = /** @class */ (function () {
|
|
5489
5782
|
function TournamentStageApi(httpClient, configService) {
|
|
5490
5783
|
this.httpClient = httpClient;
|
|
@@ -6858,6 +7151,8 @@
|
|
|
6858
7151
|
exports.TournamentJoinData = TournamentJoinData;
|
|
6859
7152
|
exports.TournamentJoinTeam = TournamentJoinTeam;
|
|
6860
7153
|
exports.TournamentNews = TournamentNews;
|
|
7154
|
+
exports.TournamentSeason = TournamentSeason;
|
|
7155
|
+
exports.TournamentSeasonApi = TournamentSeasonApi;
|
|
6861
7156
|
exports.TournamentSettings = TournamentSettings;
|
|
6862
7157
|
exports.TournamentStage = TournamentStage;
|
|
6863
7158
|
exports.TournamentStageApi = TournamentStageApi;
|