@mtgame/core 0.1.19 → 0.1.20

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.
@@ -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)
@@ -5468,7 +5353,7 @@
5468
5353
  return params;
5469
5354
  }
5470
5355
  function applyStatisticFilters(filters, params) {
5471
- var e_11, _a;
5356
+ var e_6, _a;
5472
5357
  try {
5473
5358
  for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
5474
5359
  var key = _c.value;
@@ -5477,12 +5362,12 @@
5477
5362
  }
5478
5363
  }
5479
5364
  }
5480
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
5365
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
5481
5366
  finally {
5482
5367
  try {
5483
5368
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5484
5369
  }
5485
- finally { if (e_11) throw e_11.error; }
5370
+ finally { if (e_6) throw e_6.error; }
5486
5371
  }
5487
5372
  if (filters.per_game !== undefined) {
5488
5373
  params = params.set('per_game', filters.per_game ? '1' : '0');
@@ -5490,10 +5375,13 @@
5490
5375
  if (filters.tournament_ids) {
5491
5376
  params = params.set('tournament_ids', filters.tournament_ids.join(','));
5492
5377
  }
5378
+ if (filters.is_playoff !== undefined && filters.is_playoff !== null) {
5379
+ params = params.set('is_playoff', filters.is_playoff ? '1' : '0');
5380
+ }
5493
5381
  return params;
5494
5382
  }
5495
5383
  function applyStatisticLeadersFilters(filters, params) {
5496
- var e_12, _a;
5384
+ var e_7, _a;
5497
5385
  try {
5498
5386
  for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
5499
5387
  var key = _c.value;
@@ -5502,12 +5390,12 @@
5502
5390
  }
5503
5391
  }
5504
5392
  }
5505
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
5393
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
5506
5394
  finally {
5507
5395
  try {
5508
5396
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5509
5397
  }
5510
- finally { if (e_12) throw e_12.error; }
5398
+ finally { if (e_7) throw e_7.error; }
5511
5399
  }
5512
5400
  if (filters.per_game !== undefined) {
5513
5401
  params = params.set('per_game', filters.per_game ? '1' : '0');