@mtgame/core 1.0.34 → 1.0.35
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/league-api.d.ts +10 -1
- package/bundles/mtgame-core.umd.js +24 -6
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/league-api.js +25 -7
- package/fesm2015/mtgame-core.js +25 -7
- package/fesm2015/mtgame-core.js.map +1 -1
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/api/league-api.d.ts
CHANGED
|
@@ -14,8 +14,17 @@ import { LeagueDocument } from '../models/league-document';
|
|
|
14
14
|
import { TeamsAndUsers } from '../models/teams-and-users';
|
|
15
15
|
import { SeasonTournament } from '../models/season-tournament';
|
|
16
16
|
import { LeaguePlayerField } from '../models/league-player-field';
|
|
17
|
+
export declare enum TournamentFilterStatusEnum {
|
|
18
|
+
open = 1,
|
|
19
|
+
recruitment = 2,
|
|
20
|
+
in_progress = 3,
|
|
21
|
+
closed = 4
|
|
22
|
+
}
|
|
17
23
|
export interface TournamentListFilters {
|
|
18
|
-
statuses
|
|
24
|
+
statuses?: TournamentStatuses[];
|
|
25
|
+
tournamentStatus?: TournamentFilterStatusEnum;
|
|
26
|
+
seasonId?: number;
|
|
27
|
+
seasonTournamentId?: number;
|
|
19
28
|
}
|
|
20
29
|
export declare class LeagueApi {
|
|
21
30
|
private httpClient;
|
|
@@ -9001,6 +9001,13 @@
|
|
|
9001
9001
|
})
|
|
9002
9002
|
], SeasonTournament);
|
|
9003
9003
|
|
|
9004
|
+
exports.TournamentFilterStatusEnum = void 0;
|
|
9005
|
+
(function (TournamentFilterStatusEnum) {
|
|
9006
|
+
TournamentFilterStatusEnum[TournamentFilterStatusEnum["open"] = 1] = "open";
|
|
9007
|
+
TournamentFilterStatusEnum[TournamentFilterStatusEnum["recruitment"] = 2] = "recruitment";
|
|
9008
|
+
TournamentFilterStatusEnum[TournamentFilterStatusEnum["in_progress"] = 3] = "in_progress";
|
|
9009
|
+
TournamentFilterStatusEnum[TournamentFilterStatusEnum["closed"] = 4] = "closed";
|
|
9010
|
+
})(exports.TournamentFilterStatusEnum || (exports.TournamentFilterStatusEnum = {}));
|
|
9004
9011
|
var LeagueApi = /** @class */ (function () {
|
|
9005
9012
|
function LeagueApi(httpClient, configService) {
|
|
9006
9013
|
this.httpClient = httpClient;
|
|
@@ -9033,9 +9040,7 @@
|
|
|
9033
9040
|
return __generator(this, function (_a) {
|
|
9034
9041
|
params = new i1.HttpParams();
|
|
9035
9042
|
if (filters) {
|
|
9036
|
-
|
|
9037
|
-
params = params.set('statuses', filters.statuses.map(function (s) { return exports.TournamentStatuses[s]; }).join(','));
|
|
9038
|
-
}
|
|
9043
|
+
params = applyTournamentListFilters(params, filters);
|
|
9039
9044
|
}
|
|
9040
9045
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/", { params: params }).pipe(operators.map(function (result) { return exports.Tournament.toFront(result); })).toPromise()];
|
|
9041
9046
|
});
|
|
@@ -9047,9 +9052,7 @@
|
|
|
9047
9052
|
return __generator(this, function (_a) {
|
|
9048
9053
|
params = new i1.HttpParams().set('page', page).set('size', size);
|
|
9049
9054
|
if (filters) {
|
|
9050
|
-
|
|
9051
|
-
params = params.set('statuses', filters.statuses.map(function (s) { return exports.TournamentStatuses[s]; }).join(','));
|
|
9052
|
-
}
|
|
9055
|
+
params = applyTournamentListFilters(params, filters);
|
|
9053
9056
|
}
|
|
9054
9057
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/", { params: params, observe: 'response' }).pipe(operators.map(function (response) { return ({
|
|
9055
9058
|
total: +response.headers.get('X-Page-Count'),
|
|
@@ -9192,6 +9195,21 @@
|
|
|
9192
9195
|
{ type: i1.HttpClient },
|
|
9193
9196
|
{ type: ConfigService }
|
|
9194
9197
|
]; };
|
|
9198
|
+
function applyTournamentListFilters(params, filters) {
|
|
9199
|
+
if (filters.statuses) {
|
|
9200
|
+
params = params.set('statuses', filters.statuses.map(function (s) { return exports.TournamentStatuses[s]; }).join(','));
|
|
9201
|
+
}
|
|
9202
|
+
if (filters.tournamentStatus) {
|
|
9203
|
+
params = params.set('tournament_status', exports.TournamentFilterStatusEnum[filters.tournamentStatus]);
|
|
9204
|
+
}
|
|
9205
|
+
if (filters.seasonId) {
|
|
9206
|
+
params = params.set('season_id', filters.seasonId);
|
|
9207
|
+
}
|
|
9208
|
+
if (filters.seasonTournamentId) {
|
|
9209
|
+
params = params.set('season_tournament_id', filters.seasonTournamentId);
|
|
9210
|
+
}
|
|
9211
|
+
return params;
|
|
9212
|
+
}
|
|
9195
9213
|
|
|
9196
9214
|
var LeagueNewsApi = /** @class */ (function () {
|
|
9197
9215
|
function LeagueNewsApi(httpClient, configService) {
|