@mtgame/core 0.1.19 → 0.1.21

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.
@@ -25,6 +25,7 @@ export interface TournamentGamesFilters {
25
25
  teamId?: number;
26
26
  playoffStage?: number;
27
27
  playoffId?: number;
28
+ isPlayoff?: boolean;
28
29
  status?: GameStatuses;
29
30
  statuses?: GameStatuses[];
30
31
  tournamentCourtId?: number;
@@ -5217,33 +5217,10 @@
5217
5217
  };
5218
5218
  TournamentApi.prototype.getBasketballStatistic = function (filters) {
5219
5219
  return __awaiter(this, void 0, void 0, function () {
5220
- var params, _a, _b, key;
5221
- var e_6, _c;
5222
- return __generator(this, function (_d) {
5220
+ var params;
5221
+ return __generator(this, function (_a) {
5223
5222
  params = new http.HttpParams();
5224
- if (filters) {
5225
- try {
5226
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5227
- key = _b.value;
5228
- if (filters[key]) {
5229
- params = params.set(key, filters[key]);
5230
- }
5231
- }
5232
- }
5233
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
5234
- finally {
5235
- try {
5236
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
5237
- }
5238
- finally { if (e_6) throw e_6.error; }
5239
- }
5240
- if (filters.per_game !== undefined) {
5241
- params = params.set('per_game', filters.per_game ? '1' : '0');
5242
- }
5243
- if (filters.tournament_ids) {
5244
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
5245
- }
5246
- }
5223
+ params = applyStatisticFilters(filters, params);
5247
5224
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
5248
5225
  total: +result.headers.get('X-Page-Count'),
5249
5226
  data: BasketballStatistic.toFront(result.body)
@@ -5253,33 +5230,10 @@
5253
5230
  };
5254
5231
  TournamentApi.prototype.getVolleyballStatistic = function (filters) {
5255
5232
  return __awaiter(this, void 0, void 0, function () {
5256
- var params, _a, _b, key;
5257
- var e_7, _c;
5258
- return __generator(this, function (_d) {
5233
+ var params;
5234
+ return __generator(this, function (_a) {
5259
5235
  params = new http.HttpParams();
5260
- if (filters) {
5261
- try {
5262
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5263
- key = _b.value;
5264
- if (filters[key]) {
5265
- params = params.set(key, filters[key]);
5266
- }
5267
- }
5268
- }
5269
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
5270
- finally {
5271
- try {
5272
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
5273
- }
5274
- finally { if (e_7) throw e_7.error; }
5275
- }
5276
- if (filters.per_game !== undefined) {
5277
- params = params.set('per_game', filters.per_game ? '1' : '0');
5278
- }
5279
- if (filters.tournament_ids) {
5280
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
5281
- }
5282
- }
5236
+ params = applyStatisticFilters(filters, params);
5283
5237
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
5284
5238
  total: +result.headers.get('X-Page-Count'),
5285
5239
  data: VolleyballStatistic.toFront(result.body)
@@ -5289,33 +5243,10 @@
5289
5243
  };
5290
5244
  TournamentApi.prototype.getHockeyStatistic = function (filters) {
5291
5245
  return __awaiter(this, void 0, void 0, function () {
5292
- var params, _a, _b, key;
5293
- var e_8, _c;
5294
- return __generator(this, function (_d) {
5246
+ var params;
5247
+ return __generator(this, function (_a) {
5295
5248
  params = new http.HttpParams();
5296
- if (filters) {
5297
- try {
5298
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5299
- key = _b.value;
5300
- if (filters[key]) {
5301
- params = params.set(key, filters[key]);
5302
- }
5303
- }
5304
- }
5305
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
5306
- finally {
5307
- try {
5308
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
5309
- }
5310
- finally { if (e_8) throw e_8.error; }
5311
- }
5312
- if (filters.per_game !== undefined) {
5313
- params = params.set('per_game', filters.per_game ? '1' : '0');
5314
- }
5315
- if (filters.tournament_ids) {
5316
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
5317
- }
5318
- }
5249
+ params = applyStatisticFilters(filters, params);
5319
5250
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
5320
5251
  total: +result.headers.get('X-Page-Count'),
5321
5252
  data: HockeyStatistic.toFront(result.body)
@@ -5325,33 +5256,10 @@
5325
5256
  };
5326
5257
  TournamentApi.prototype.getFootballStatistic = function (filters) {
5327
5258
  return __awaiter(this, void 0, void 0, function () {
5328
- var params, _a, _b, key;
5329
- var e_9, _c;
5330
- return __generator(this, function (_d) {
5259
+ var params;
5260
+ return __generator(this, function (_a) {
5331
5261
  params = new http.HttpParams();
5332
- if (filters) {
5333
- try {
5334
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5335
- key = _b.value;
5336
- if (filters[key]) {
5337
- params = params.set(key, filters[key]);
5338
- }
5339
- }
5340
- }
5341
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
5342
- finally {
5343
- try {
5344
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
5345
- }
5346
- finally { if (e_9) throw e_9.error; }
5347
- }
5348
- if (filters.per_game !== undefined) {
5349
- params = params.set('per_game', filters.per_game ? '1' : '0');
5350
- }
5351
- if (filters.tournament_ids) {
5352
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
5353
- }
5354
- }
5262
+ params = applyStatisticFilters(filters, params);
5355
5263
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
5356
5264
  total: +result.headers.get('X-Page-Count'),
5357
5265
  data: FootballStatistic.toFront(result.body)
@@ -5361,33 +5269,10 @@
5361
5269
  };
5362
5270
  TournamentApi.prototype.getHandballStatistic = function (filters) {
5363
5271
  return __awaiter(this, void 0, void 0, function () {
5364
- var params, _a, _b, key;
5365
- var e_10, _c;
5366
- return __generator(this, function (_d) {
5272
+ var params;
5273
+ return __generator(this, function (_a) {
5367
5274
  params = new http.HttpParams();
5368
- if (filters) {
5369
- try {
5370
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5371
- key = _b.value;
5372
- if (filters[key]) {
5373
- params = params.set(key, filters[key]);
5374
- }
5375
- }
5376
- }
5377
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
5378
- finally {
5379
- try {
5380
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
5381
- }
5382
- finally { if (e_10) throw e_10.error; }
5383
- }
5384
- if (filters.per_game !== undefined) {
5385
- params = params.set('per_game', filters.per_game ? '1' : '0');
5386
- }
5387
- if (filters.tournament_ids) {
5388
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
5389
- }
5390
- }
5275
+ params = applyStatisticFilters(filters, params);
5391
5276
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/handball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
5392
5277
  total: +result.headers.get('X-Page-Count'),
5393
5278
  data: HandballStatistic.toFront(result.body)
@@ -5465,10 +5350,13 @@
5465
5350
  if (filters.query) {
5466
5351
  params = params.set('query', filters.query);
5467
5352
  }
5353
+ if (filters.isPlayoff !== undefined && filters.isPlayoff !== null) {
5354
+ params = params.set('is_playoff', filters.isPlayoff ? '1' : '0');
5355
+ }
5468
5356
  return params;
5469
5357
  }
5470
5358
  function applyStatisticFilters(filters, params) {
5471
- var e_11, _a;
5359
+ var e_6, _a;
5472
5360
  try {
5473
5361
  for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
5474
5362
  var key = _c.value;
@@ -5477,12 +5365,12 @@
5477
5365
  }
5478
5366
  }
5479
5367
  }
5480
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
5368
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
5481
5369
  finally {
5482
5370
  try {
5483
5371
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5484
5372
  }
5485
- finally { if (e_11) throw e_11.error; }
5373
+ finally { if (e_6) throw e_6.error; }
5486
5374
  }
5487
5375
  if (filters.per_game !== undefined) {
5488
5376
  params = params.set('per_game', filters.per_game ? '1' : '0');
@@ -5490,10 +5378,13 @@
5490
5378
  if (filters.tournament_ids) {
5491
5379
  params = params.set('tournament_ids', filters.tournament_ids.join(','));
5492
5380
  }
5381
+ if (filters.is_playoff !== undefined && filters.is_playoff !== null) {
5382
+ params = params.set('is_playoff', filters.is_playoff ? '1' : '0');
5383
+ }
5493
5384
  return params;
5494
5385
  }
5495
5386
  function applyStatisticLeadersFilters(filters, params) {
5496
- var e_12, _a;
5387
+ var e_7, _a;
5497
5388
  try {
5498
5389
  for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
5499
5390
  var key = _c.value;
@@ -5502,12 +5393,12 @@
5502
5393
  }
5503
5394
  }
5504
5395
  }
5505
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
5396
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
5506
5397
  finally {
5507
5398
  try {
5508
5399
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5509
5400
  }
5510
- finally { if (e_12) throw e_12.error; }
5401
+ finally { if (e_7) throw e_7.error; }
5511
5402
  }
5512
5403
  if (filters.per_game !== undefined) {
5513
5404
  params = params.set('per_game', filters.per_game ? '1' : '0');