@mtgame/core 0.2.92 → 0.2.94
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/tournament-api.d.ts +7 -1
- package/bundles/mtgame-core.umd.js +41 -46
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/tournament-api.js +32 -39
- package/esm2015/models/league-field-base-value.js +1 -1
- package/esm2015/models/league-player-field-value.js +2 -1
- package/esm2015/models/tournament-team-field-value.js +2 -1
- package/fesm2015/mtgame-core.js +33 -38
- package/fesm2015/mtgame-core.js.map +1 -1
- package/models/league-field-base-value.d.ts +1 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/fesm2015/mtgame-core.js
CHANGED
|
@@ -2440,6 +2440,7 @@ TournamentTeamFieldValue = __decorate([
|
|
|
2440
2440
|
league_team_field: 'leagueTeamField',
|
|
2441
2441
|
value: 'value',
|
|
2442
2442
|
file: 'file',
|
|
2443
|
+
value_text: 'valueText',
|
|
2443
2444
|
},
|
|
2444
2445
|
relation: {
|
|
2445
2446
|
file: File,
|
|
@@ -2661,6 +2662,7 @@ LeaguePlayerFieldValue = __decorate([
|
|
|
2661
2662
|
league_player_field: 'leaguePlayerField',
|
|
2662
2663
|
value: 'value',
|
|
2663
2664
|
file: 'file',
|
|
2665
|
+
value_text: 'valueText',
|
|
2664
2666
|
},
|
|
2665
2667
|
relation: {
|
|
2666
2668
|
file: File,
|
|
@@ -6276,9 +6278,8 @@ class TournamentApi {
|
|
|
6276
6278
|
}
|
|
6277
6279
|
getBasketballStatistic(filters) {
|
|
6278
6280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/basketball_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6281
|
+
const data = applyStatisticFilters(filters);
|
|
6282
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/basketball_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6282
6283
|
total: +result.headers.get('X-Page-Count'),
|
|
6283
6284
|
data: BasketballStatistic.toFront(result.body)
|
|
6284
6285
|
}))).toPromise();
|
|
@@ -6286,9 +6287,8 @@ class TournamentApi {
|
|
|
6286
6287
|
}
|
|
6287
6288
|
getVolleyballStatistic(filters) {
|
|
6288
6289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/volleyball_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6290
|
+
const data = applyStatisticFilters(filters);
|
|
6291
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/volleyball_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6292
6292
|
total: +result.headers.get('X-Page-Count'),
|
|
6293
6293
|
data: VolleyballStatistic.toFront(result.body)
|
|
6294
6294
|
}))).toPromise();
|
|
@@ -6296,9 +6296,8 @@ class TournamentApi {
|
|
|
6296
6296
|
}
|
|
6297
6297
|
getHockeyStatistic(filters) {
|
|
6298
6298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/hockey_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6299
|
+
const data = applyStatisticFilters(filters);
|
|
6300
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/hockey_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6302
6301
|
total: +result.headers.get('X-Page-Count'),
|
|
6303
6302
|
data: HockeyStatistic.toFront(result.body)
|
|
6304
6303
|
}))).toPromise();
|
|
@@ -6306,9 +6305,8 @@ class TournamentApi {
|
|
|
6306
6305
|
}
|
|
6307
6306
|
getFootballStatistic(filters) {
|
|
6308
6307
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/football_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6308
|
+
const data = applyStatisticFilters(filters);
|
|
6309
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/football_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6312
6310
|
total: +result.headers.get('X-Page-Count'),
|
|
6313
6311
|
data: FootballStatistic.toFront(result.body)
|
|
6314
6312
|
}))).toPromise();
|
|
@@ -6316,9 +6314,8 @@ class TournamentApi {
|
|
|
6316
6314
|
}
|
|
6317
6315
|
getHandballStatistic(filters) {
|
|
6318
6316
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/handball_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6317
|
+
const data = applyStatisticFilters(filters);
|
|
6318
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/handball_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6322
6319
|
total: +result.headers.get('X-Page-Count'),
|
|
6323
6320
|
data: HandballStatistic.toFront(result.body)
|
|
6324
6321
|
}))).toPromise();
|
|
@@ -6326,9 +6323,8 @@ class TournamentApi {
|
|
|
6326
6323
|
}
|
|
6327
6324
|
getRugbyStatistic(filters) {
|
|
6328
6325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/rugby_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6326
|
+
const data = applyStatisticFilters(filters);
|
|
6327
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/rugby_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6332
6328
|
total: +result.headers.get('X-Page-Count'),
|
|
6333
6329
|
data: RugbyStatistic.toFront(result.body)
|
|
6334
6330
|
}))).toPromise();
|
|
@@ -6336,9 +6332,8 @@ class TournamentApi {
|
|
|
6336
6332
|
}
|
|
6337
6333
|
getWaterpoloStatistic(filters) {
|
|
6338
6334
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/waterpolo_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6335
|
+
const data = applyStatisticFilters(filters);
|
|
6336
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/waterpolo_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6342
6337
|
total: +result.headers.get('X-Page-Count'),
|
|
6343
6338
|
data: WaterpoloStatistic.toFront(result.body)
|
|
6344
6339
|
}))).toPromise();
|
|
@@ -6346,9 +6341,8 @@ class TournamentApi {
|
|
|
6346
6341
|
}
|
|
6347
6342
|
getWrestballStatistic(filters) {
|
|
6348
6343
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/wrestball_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
|
|
6344
|
+
const data = applyStatisticFilters(filters);
|
|
6345
|
+
return this.httpClient.post(`${this.configService.get('apiUrl')}/api/v1/wrestball_statistic/`, data, { observe: 'response' }).pipe(map(result => ({
|
|
6352
6346
|
total: +result.headers.get('X-Page-Count'),
|
|
6353
6347
|
data: WrestballStatistic.toFront(result.body)
|
|
6354
6348
|
}))).toPromise();
|
|
@@ -6450,48 +6444,49 @@ function applyGamesFilters(filters, params) {
|
|
|
6450
6444
|
}
|
|
6451
6445
|
return params;
|
|
6452
6446
|
}
|
|
6453
|
-
function applyStatisticFilters(filters
|
|
6447
|
+
function applyStatisticFilters(filters) {
|
|
6448
|
+
const rawFilters = {};
|
|
6454
6449
|
for (const key of Object.keys(filters)) {
|
|
6455
6450
|
if (filters[key]) {
|
|
6456
6451
|
if (key === 'basketball_position') {
|
|
6457
|
-
|
|
6452
|
+
rawFilters[key] = GameBasketballPosition[filters[key]];
|
|
6458
6453
|
}
|
|
6459
6454
|
else if (key === 'volleyball_position') {
|
|
6460
|
-
|
|
6455
|
+
rawFilters[key] = GameVolleyballPosition[filters[key]];
|
|
6461
6456
|
}
|
|
6462
6457
|
else if (key === 'hockey_position') {
|
|
6463
|
-
|
|
6458
|
+
rawFilters[key] = GameHockeyPosition[filters[key]];
|
|
6464
6459
|
}
|
|
6465
6460
|
else if (key === 'football_position') {
|
|
6466
|
-
|
|
6461
|
+
rawFilters[key] = GameFootballPosition[filters[key]];
|
|
6467
6462
|
}
|
|
6468
6463
|
else if (key === 'handball_position') {
|
|
6469
|
-
|
|
6464
|
+
rawFilters[key] = GameHandballPosition[filters[key]];
|
|
6470
6465
|
}
|
|
6471
6466
|
else if (key === 'waterpolo_position') {
|
|
6472
|
-
|
|
6467
|
+
rawFilters[key] = GameWaterpoloPosition[filters[key]];
|
|
6473
6468
|
}
|
|
6474
6469
|
else if (key === 'rugby_position') {
|
|
6475
|
-
|
|
6470
|
+
rawFilters[key] = GameRugbyPosition[filters[key]];
|
|
6476
6471
|
}
|
|
6477
6472
|
else {
|
|
6478
|
-
|
|
6473
|
+
rawFilters[key] = filters[key];
|
|
6479
6474
|
}
|
|
6480
6475
|
}
|
|
6481
6476
|
}
|
|
6482
6477
|
if (filters.per_game !== undefined) {
|
|
6483
|
-
|
|
6478
|
+
rawFilters['per_game'] = filters.per_game ? '1' : '0';
|
|
6484
6479
|
}
|
|
6485
6480
|
if (filters.tournament_ids) {
|
|
6486
|
-
|
|
6481
|
+
rawFilters['tournament_ids'] = filters.tournament_ids.join(',');
|
|
6487
6482
|
}
|
|
6488
6483
|
if (filters.tournament_season_ids) {
|
|
6489
|
-
|
|
6484
|
+
rawFilters['tournament_season_ids'] = filters.tournament_season_ids.join(',');
|
|
6490
6485
|
}
|
|
6491
6486
|
if (filters.is_playoff !== undefined && filters.is_playoff !== null) {
|
|
6492
|
-
|
|
6487
|
+
rawFilters['is_playoff'] = filters.is_playoff ? '1' : '0';
|
|
6493
6488
|
}
|
|
6494
|
-
return
|
|
6489
|
+
return rawFilters;
|
|
6495
6490
|
}
|
|
6496
6491
|
function applyStatisticLeadersFilters(filters, params) {
|
|
6497
6492
|
for (const key of Object.keys(filters)) {
|