@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.
@@ -88,6 +88,12 @@ export interface StatisticFilters {
88
88
  handball_position?: GameHandballPosition;
89
89
  waterpolo_position?: GameWaterpoloPosition;
90
90
  rugby_position?: GameRugbyPosition;
91
+ league_player_field_value: {
92
+ [key: string]: string;
93
+ };
94
+ tournament_team_field_value: {
95
+ [key: string]: string;
96
+ };
91
97
  per_game?: boolean;
92
98
  group_by: StatisticGroupByTypes;
93
99
  order_by?: string;
@@ -174,5 +180,5 @@ export declare class TournamentApi {
174
180
  getTournamentTeamUsersLimitation(tournamentTeamId: number): Promise<GameUserLimitations[]>;
175
181
  }
176
182
  export declare function applyGamesFilters(filters: TournamentGamesFilters, params: HttpParams): HttpParams;
177
- export declare function applyStatisticFilters(filters: StatisticFilters, params: HttpParams): HttpParams;
183
+ export declare function applyStatisticFilters(filters: StatisticFilters): object;
178
184
  export declare function applyStatisticLeadersFilters(filters: StatisticLeadersFilters, params: HttpParams): HttpParams;
@@ -8067,11 +8067,10 @@
8067
8067
  };
8068
8068
  TournamentApi.prototype.getBasketballStatistic = function (filters) {
8069
8069
  return __awaiter(this, void 0, void 0, function () {
8070
- var params;
8070
+ var data;
8071
8071
  return __generator(this, function (_a) {
8072
- params = new i1.HttpParams();
8073
- params = applyStatisticFilters(filters, params);
8074
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8072
+ data = applyStatisticFilters(filters);
8073
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8075
8074
  total: +result.headers.get('X-Page-Count'),
8076
8075
  data: exports.BasketballStatistic.toFront(result.body)
8077
8076
  }); })).toPromise()];
@@ -8080,11 +8079,10 @@
8080
8079
  };
8081
8080
  TournamentApi.prototype.getVolleyballStatistic = function (filters) {
8082
8081
  return __awaiter(this, void 0, void 0, function () {
8083
- var params;
8082
+ var data;
8084
8083
  return __generator(this, function (_a) {
8085
- params = new i1.HttpParams();
8086
- params = applyStatisticFilters(filters, params);
8087
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8084
+ data = applyStatisticFilters(filters);
8085
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8088
8086
  total: +result.headers.get('X-Page-Count'),
8089
8087
  data: exports.VolleyballStatistic.toFront(result.body)
8090
8088
  }); })).toPromise()];
@@ -8093,11 +8091,10 @@
8093
8091
  };
8094
8092
  TournamentApi.prototype.getHockeyStatistic = function (filters) {
8095
8093
  return __awaiter(this, void 0, void 0, function () {
8096
- var params;
8094
+ var data;
8097
8095
  return __generator(this, function (_a) {
8098
- params = new i1.HttpParams();
8099
- params = applyStatisticFilters(filters, params);
8100
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8096
+ data = applyStatisticFilters(filters);
8097
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8101
8098
  total: +result.headers.get('X-Page-Count'),
8102
8099
  data: exports.HockeyStatistic.toFront(result.body)
8103
8100
  }); })).toPromise()];
@@ -8106,11 +8103,10 @@
8106
8103
  };
8107
8104
  TournamentApi.prototype.getFootballStatistic = function (filters) {
8108
8105
  return __awaiter(this, void 0, void 0, function () {
8109
- var params;
8106
+ var data;
8110
8107
  return __generator(this, function (_a) {
8111
- params = new i1.HttpParams();
8112
- params = applyStatisticFilters(filters, params);
8113
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8108
+ data = applyStatisticFilters(filters);
8109
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/football_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8114
8110
  total: +result.headers.get('X-Page-Count'),
8115
8111
  data: exports.FootballStatistic.toFront(result.body)
8116
8112
  }); })).toPromise()];
@@ -8119,11 +8115,10 @@
8119
8115
  };
8120
8116
  TournamentApi.prototype.getHandballStatistic = function (filters) {
8121
8117
  return __awaiter(this, void 0, void 0, function () {
8122
- var params;
8118
+ var data;
8123
8119
  return __generator(this, function (_a) {
8124
- params = new i1.HttpParams();
8125
- params = applyStatisticFilters(filters, params);
8126
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/handball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8120
+ data = applyStatisticFilters(filters);
8121
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/handball_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8127
8122
  total: +result.headers.get('X-Page-Count'),
8128
8123
  data: exports.HandballStatistic.toFront(result.body)
8129
8124
  }); })).toPromise()];
@@ -8132,11 +8127,10 @@
8132
8127
  };
8133
8128
  TournamentApi.prototype.getRugbyStatistic = function (filters) {
8134
8129
  return __awaiter(this, void 0, void 0, function () {
8135
- var params;
8130
+ var data;
8136
8131
  return __generator(this, function (_a) {
8137
- params = new i1.HttpParams();
8138
- params = applyStatisticFilters(filters, params);
8139
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/rugby_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8132
+ data = applyStatisticFilters(filters);
8133
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/rugby_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8140
8134
  total: +result.headers.get('X-Page-Count'),
8141
8135
  data: exports.RugbyStatistic.toFront(result.body)
8142
8136
  }); })).toPromise()];
@@ -8145,11 +8139,10 @@
8145
8139
  };
8146
8140
  TournamentApi.prototype.getWaterpoloStatistic = function (filters) {
8147
8141
  return __awaiter(this, void 0, void 0, function () {
8148
- var params;
8142
+ var data;
8149
8143
  return __generator(this, function (_a) {
8150
- params = new i1.HttpParams();
8151
- params = applyStatisticFilters(filters, params);
8152
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/waterpolo_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8144
+ data = applyStatisticFilters(filters);
8145
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/waterpolo_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8153
8146
  total: +result.headers.get('X-Page-Count'),
8154
8147
  data: exports.WaterpoloStatistic.toFront(result.body)
8155
8148
  }); })).toPromise()];
@@ -8158,11 +8151,10 @@
8158
8151
  };
8159
8152
  TournamentApi.prototype.getWrestballStatistic = function (filters) {
8160
8153
  return __awaiter(this, void 0, void 0, function () {
8161
- var params;
8154
+ var data;
8162
8155
  return __generator(this, function (_a) {
8163
- params = new i1.HttpParams();
8164
- params = applyStatisticFilters(filters, params);
8165
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/wrestball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
8156
+ data = applyStatisticFilters(filters);
8157
+ return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/wrestball_statistic/", data, { observe: 'response' }).pipe(operators.map(function (result) { return ({
8166
8158
  total: +result.headers.get('X-Page-Count'),
8167
8159
  data: exports.WrestballStatistic.toFront(result.body)
8168
8160
  }); })).toPromise()];
@@ -8289,35 +8281,36 @@
8289
8281
  }
8290
8282
  return params;
8291
8283
  }
8292
- function applyStatisticFilters(filters, params) {
8284
+ function applyStatisticFilters(filters) {
8293
8285
  var e_8, _a;
8286
+ var rawFilters = {};
8294
8287
  try {
8295
8288
  for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
8296
8289
  var key = _c.value;
8297
8290
  if (filters[key]) {
8298
8291
  if (key === 'basketball_position') {
8299
- params = params.set(key, exports.GameBasketballPosition[filters[key]]);
8292
+ rawFilters[key] = exports.GameBasketballPosition[filters[key]];
8300
8293
  }
8301
8294
  else if (key === 'volleyball_position') {
8302
- params = params.set(key, exports.GameVolleyballPosition[filters[key]]);
8295
+ rawFilters[key] = exports.GameVolleyballPosition[filters[key]];
8303
8296
  }
8304
8297
  else if (key === 'hockey_position') {
8305
- params = params.set(key, exports.GameHockeyPosition[filters[key]]);
8298
+ rawFilters[key] = exports.GameHockeyPosition[filters[key]];
8306
8299
  }
8307
8300
  else if (key === 'football_position') {
8308
- params = params.set(key, exports.GameFootballPosition[filters[key]]);
8301
+ rawFilters[key] = exports.GameFootballPosition[filters[key]];
8309
8302
  }
8310
8303
  else if (key === 'handball_position') {
8311
- params = params.set(key, exports.GameHandballPosition[filters[key]]);
8304
+ rawFilters[key] = exports.GameHandballPosition[filters[key]];
8312
8305
  }
8313
8306
  else if (key === 'waterpolo_position') {
8314
- params = params.set(key, exports.GameWaterpoloPosition[filters[key]]);
8307
+ rawFilters[key] = exports.GameWaterpoloPosition[filters[key]];
8315
8308
  }
8316
8309
  else if (key === 'rugby_position') {
8317
- params = params.set(key, exports.GameRugbyPosition[filters[key]]);
8310
+ rawFilters[key] = exports.GameRugbyPosition[filters[key]];
8318
8311
  }
8319
8312
  else {
8320
- params = params.set(key, filters[key]);
8313
+ rawFilters[key] = filters[key];
8321
8314
  }
8322
8315
  }
8323
8316
  }
@@ -8330,18 +8323,18 @@
8330
8323
  finally { if (e_8) throw e_8.error; }
8331
8324
  }
8332
8325
  if (filters.per_game !== undefined) {
8333
- params = params.set('per_game', filters.per_game ? '1' : '0');
8326
+ rawFilters['per_game'] = filters.per_game ? '1' : '0';
8334
8327
  }
8335
8328
  if (filters.tournament_ids) {
8336
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
8329
+ rawFilters['tournament_ids'] = filters.tournament_ids.join(',');
8337
8330
  }
8338
8331
  if (filters.tournament_season_ids) {
8339
- params = params.set('tournament_season_ids', filters.tournament_season_ids.join(','));
8332
+ rawFilters['tournament_season_ids'] = filters.tournament_season_ids.join(',');
8340
8333
  }
8341
8334
  if (filters.is_playoff !== undefined && filters.is_playoff !== null) {
8342
- params = params.set('is_playoff', filters.is_playoff ? '1' : '0');
8335
+ rawFilters['is_playoff'] = filters.is_playoff ? '1' : '0';
8343
8336
  }
8344
- return params;
8337
+ return rawFilters;
8345
8338
  }
8346
8339
  function applyStatisticLeadersFilters(filters, params) {
8347
8340
  var e_9, _a;