@mtgame/core 0.2.93 → 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.
@@ -6278,9 +6278,8 @@ class TournamentApi {
6278
6278
  }
6279
6279
  getBasketballStatistic(filters) {
6280
6280
  return __awaiter(this, void 0, void 0, function* () {
6281
- let params = new HttpParams();
6282
- params = applyStatisticFilters(filters, params);
6283
- 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 => ({
6284
6283
  total: +result.headers.get('X-Page-Count'),
6285
6284
  data: BasketballStatistic.toFront(result.body)
6286
6285
  }))).toPromise();
@@ -6288,9 +6287,8 @@ class TournamentApi {
6288
6287
  }
6289
6288
  getVolleyballStatistic(filters) {
6290
6289
  return __awaiter(this, void 0, void 0, function* () {
6291
- let params = new HttpParams();
6292
- params = applyStatisticFilters(filters, params);
6293
- 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 => ({
6294
6292
  total: +result.headers.get('X-Page-Count'),
6295
6293
  data: VolleyballStatistic.toFront(result.body)
6296
6294
  }))).toPromise();
@@ -6298,9 +6296,8 @@ class TournamentApi {
6298
6296
  }
6299
6297
  getHockeyStatistic(filters) {
6300
6298
  return __awaiter(this, void 0, void 0, function* () {
6301
- let params = new HttpParams();
6302
- params = applyStatisticFilters(filters, params);
6303
- 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 => ({
6304
6301
  total: +result.headers.get('X-Page-Count'),
6305
6302
  data: HockeyStatistic.toFront(result.body)
6306
6303
  }))).toPromise();
@@ -6308,9 +6305,8 @@ class TournamentApi {
6308
6305
  }
6309
6306
  getFootballStatistic(filters) {
6310
6307
  return __awaiter(this, void 0, void 0, function* () {
6311
- let params = new HttpParams();
6312
- params = applyStatisticFilters(filters, params);
6313
- 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 => ({
6314
6310
  total: +result.headers.get('X-Page-Count'),
6315
6311
  data: FootballStatistic.toFront(result.body)
6316
6312
  }))).toPromise();
@@ -6318,9 +6314,8 @@ class TournamentApi {
6318
6314
  }
6319
6315
  getHandballStatistic(filters) {
6320
6316
  return __awaiter(this, void 0, void 0, function* () {
6321
- let params = new HttpParams();
6322
- params = applyStatisticFilters(filters, params);
6323
- 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 => ({
6324
6319
  total: +result.headers.get('X-Page-Count'),
6325
6320
  data: HandballStatistic.toFront(result.body)
6326
6321
  }))).toPromise();
@@ -6328,9 +6323,8 @@ class TournamentApi {
6328
6323
  }
6329
6324
  getRugbyStatistic(filters) {
6330
6325
  return __awaiter(this, void 0, void 0, function* () {
6331
- let params = new HttpParams();
6332
- params = applyStatisticFilters(filters, params);
6333
- 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 => ({
6334
6328
  total: +result.headers.get('X-Page-Count'),
6335
6329
  data: RugbyStatistic.toFront(result.body)
6336
6330
  }))).toPromise();
@@ -6338,9 +6332,8 @@ class TournamentApi {
6338
6332
  }
6339
6333
  getWaterpoloStatistic(filters) {
6340
6334
  return __awaiter(this, void 0, void 0, function* () {
6341
- let params = new HttpParams();
6342
- params = applyStatisticFilters(filters, params);
6343
- 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 => ({
6344
6337
  total: +result.headers.get('X-Page-Count'),
6345
6338
  data: WaterpoloStatistic.toFront(result.body)
6346
6339
  }))).toPromise();
@@ -6348,9 +6341,8 @@ class TournamentApi {
6348
6341
  }
6349
6342
  getWrestballStatistic(filters) {
6350
6343
  return __awaiter(this, void 0, void 0, function* () {
6351
- let params = new HttpParams();
6352
- params = applyStatisticFilters(filters, params);
6353
- 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 => ({
6354
6346
  total: +result.headers.get('X-Page-Count'),
6355
6347
  data: WrestballStatistic.toFront(result.body)
6356
6348
  }))).toPromise();
@@ -6452,48 +6444,49 @@ function applyGamesFilters(filters, params) {
6452
6444
  }
6453
6445
  return params;
6454
6446
  }
6455
- function applyStatisticFilters(filters, params) {
6447
+ function applyStatisticFilters(filters) {
6448
+ const rawFilters = {};
6456
6449
  for (const key of Object.keys(filters)) {
6457
6450
  if (filters[key]) {
6458
6451
  if (key === 'basketball_position') {
6459
- params = params.set(key, GameBasketballPosition[filters[key]]);
6452
+ rawFilters[key] = GameBasketballPosition[filters[key]];
6460
6453
  }
6461
6454
  else if (key === 'volleyball_position') {
6462
- params = params.set(key, GameVolleyballPosition[filters[key]]);
6455
+ rawFilters[key] = GameVolleyballPosition[filters[key]];
6463
6456
  }
6464
6457
  else if (key === 'hockey_position') {
6465
- params = params.set(key, GameHockeyPosition[filters[key]]);
6458
+ rawFilters[key] = GameHockeyPosition[filters[key]];
6466
6459
  }
6467
6460
  else if (key === 'football_position') {
6468
- params = params.set(key, GameFootballPosition[filters[key]]);
6461
+ rawFilters[key] = GameFootballPosition[filters[key]];
6469
6462
  }
6470
6463
  else if (key === 'handball_position') {
6471
- params = params.set(key, GameHandballPosition[filters[key]]);
6464
+ rawFilters[key] = GameHandballPosition[filters[key]];
6472
6465
  }
6473
6466
  else if (key === 'waterpolo_position') {
6474
- params = params.set(key, GameWaterpoloPosition[filters[key]]);
6467
+ rawFilters[key] = GameWaterpoloPosition[filters[key]];
6475
6468
  }
6476
6469
  else if (key === 'rugby_position') {
6477
- params = params.set(key, GameRugbyPosition[filters[key]]);
6470
+ rawFilters[key] = GameRugbyPosition[filters[key]];
6478
6471
  }
6479
6472
  else {
6480
- params = params.set(key, filters[key]);
6473
+ rawFilters[key] = filters[key];
6481
6474
  }
6482
6475
  }
6483
6476
  }
6484
6477
  if (filters.per_game !== undefined) {
6485
- params = params.set('per_game', filters.per_game ? '1' : '0');
6478
+ rawFilters['per_game'] = filters.per_game ? '1' : '0';
6486
6479
  }
6487
6480
  if (filters.tournament_ids) {
6488
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
6481
+ rawFilters['tournament_ids'] = filters.tournament_ids.join(',');
6489
6482
  }
6490
6483
  if (filters.tournament_season_ids) {
6491
- params = params.set('tournament_season_ids', filters.tournament_season_ids.join(','));
6484
+ rawFilters['tournament_season_ids'] = filters.tournament_season_ids.join(',');
6492
6485
  }
6493
6486
  if (filters.is_playoff !== undefined && filters.is_playoff !== null) {
6494
- params = params.set('is_playoff', filters.is_playoff ? '1' : '0');
6487
+ rawFilters['is_playoff'] = filters.is_playoff ? '1' : '0';
6495
6488
  }
6496
- return params;
6489
+ return rawFilters;
6497
6490
  }
6498
6491
  function applyStatisticLeadersFilters(filters, params) {
6499
6492
  for (const key of Object.keys(filters)) {