@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.
@@ -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;
@@ -3225,6 +3225,7 @@
3225
3225
  league_team_field: 'leagueTeamField',
3226
3226
  value: 'value',
3227
3227
  file: 'file',
3228
+ value_text: 'valueText',
3228
3229
  },
3229
3230
  relation: {
3230
3231
  file: exports.File,
@@ -3478,6 +3479,7 @@
3478
3479
  league_player_field: 'leaguePlayerField',
3479
3480
  value: 'value',
3480
3481
  file: 'file',
3482
+ value_text: 'valueText',
3481
3483
  },
3482
3484
  relation: {
3483
3485
  file: exports.File,
@@ -8065,11 +8067,10 @@
8065
8067
  };
8066
8068
  TournamentApi.prototype.getBasketballStatistic = function (filters) {
8067
8069
  return __awaiter(this, void 0, void 0, function () {
8068
- var params;
8070
+ var data;
8069
8071
  return __generator(this, function (_a) {
8070
- params = new i1.HttpParams();
8071
- params = applyStatisticFilters(filters, params);
8072
- 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 ({
8073
8074
  total: +result.headers.get('X-Page-Count'),
8074
8075
  data: exports.BasketballStatistic.toFront(result.body)
8075
8076
  }); })).toPromise()];
@@ -8078,11 +8079,10 @@
8078
8079
  };
8079
8080
  TournamentApi.prototype.getVolleyballStatistic = function (filters) {
8080
8081
  return __awaiter(this, void 0, void 0, function () {
8081
- var params;
8082
+ var data;
8082
8083
  return __generator(this, function (_a) {
8083
- params = new i1.HttpParams();
8084
- params = applyStatisticFilters(filters, params);
8085
- 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 ({
8086
8086
  total: +result.headers.get('X-Page-Count'),
8087
8087
  data: exports.VolleyballStatistic.toFront(result.body)
8088
8088
  }); })).toPromise()];
@@ -8091,11 +8091,10 @@
8091
8091
  };
8092
8092
  TournamentApi.prototype.getHockeyStatistic = function (filters) {
8093
8093
  return __awaiter(this, void 0, void 0, function () {
8094
- var params;
8094
+ var data;
8095
8095
  return __generator(this, function (_a) {
8096
- params = new i1.HttpParams();
8097
- params = applyStatisticFilters(filters, params);
8098
- 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 ({
8099
8098
  total: +result.headers.get('X-Page-Count'),
8100
8099
  data: exports.HockeyStatistic.toFront(result.body)
8101
8100
  }); })).toPromise()];
@@ -8104,11 +8103,10 @@
8104
8103
  };
8105
8104
  TournamentApi.prototype.getFootballStatistic = function (filters) {
8106
8105
  return __awaiter(this, void 0, void 0, function () {
8107
- var params;
8106
+ var data;
8108
8107
  return __generator(this, function (_a) {
8109
- params = new i1.HttpParams();
8110
- params = applyStatisticFilters(filters, params);
8111
- 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 ({
8112
8110
  total: +result.headers.get('X-Page-Count'),
8113
8111
  data: exports.FootballStatistic.toFront(result.body)
8114
8112
  }); })).toPromise()];
@@ -8117,11 +8115,10 @@
8117
8115
  };
8118
8116
  TournamentApi.prototype.getHandballStatistic = function (filters) {
8119
8117
  return __awaiter(this, void 0, void 0, function () {
8120
- var params;
8118
+ var data;
8121
8119
  return __generator(this, function (_a) {
8122
- params = new i1.HttpParams();
8123
- params = applyStatisticFilters(filters, params);
8124
- 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 ({
8125
8122
  total: +result.headers.get('X-Page-Count'),
8126
8123
  data: exports.HandballStatistic.toFront(result.body)
8127
8124
  }); })).toPromise()];
@@ -8130,11 +8127,10 @@
8130
8127
  };
8131
8128
  TournamentApi.prototype.getRugbyStatistic = function (filters) {
8132
8129
  return __awaiter(this, void 0, void 0, function () {
8133
- var params;
8130
+ var data;
8134
8131
  return __generator(this, function (_a) {
8135
- params = new i1.HttpParams();
8136
- params = applyStatisticFilters(filters, params);
8137
- 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 ({
8138
8134
  total: +result.headers.get('X-Page-Count'),
8139
8135
  data: exports.RugbyStatistic.toFront(result.body)
8140
8136
  }); })).toPromise()];
@@ -8143,11 +8139,10 @@
8143
8139
  };
8144
8140
  TournamentApi.prototype.getWaterpoloStatistic = function (filters) {
8145
8141
  return __awaiter(this, void 0, void 0, function () {
8146
- var params;
8142
+ var data;
8147
8143
  return __generator(this, function (_a) {
8148
- params = new i1.HttpParams();
8149
- params = applyStatisticFilters(filters, params);
8150
- 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 ({
8151
8146
  total: +result.headers.get('X-Page-Count'),
8152
8147
  data: exports.WaterpoloStatistic.toFront(result.body)
8153
8148
  }); })).toPromise()];
@@ -8156,11 +8151,10 @@
8156
8151
  };
8157
8152
  TournamentApi.prototype.getWrestballStatistic = function (filters) {
8158
8153
  return __awaiter(this, void 0, void 0, function () {
8159
- var params;
8154
+ var data;
8160
8155
  return __generator(this, function (_a) {
8161
- params = new i1.HttpParams();
8162
- params = applyStatisticFilters(filters, params);
8163
- 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 ({
8164
8158
  total: +result.headers.get('X-Page-Count'),
8165
8159
  data: exports.WrestballStatistic.toFront(result.body)
8166
8160
  }); })).toPromise()];
@@ -8287,35 +8281,36 @@
8287
8281
  }
8288
8282
  return params;
8289
8283
  }
8290
- function applyStatisticFilters(filters, params) {
8284
+ function applyStatisticFilters(filters) {
8291
8285
  var e_8, _a;
8286
+ var rawFilters = {};
8292
8287
  try {
8293
8288
  for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
8294
8289
  var key = _c.value;
8295
8290
  if (filters[key]) {
8296
8291
  if (key === 'basketball_position') {
8297
- params = params.set(key, exports.GameBasketballPosition[filters[key]]);
8292
+ rawFilters[key] = exports.GameBasketballPosition[filters[key]];
8298
8293
  }
8299
8294
  else if (key === 'volleyball_position') {
8300
- params = params.set(key, exports.GameVolleyballPosition[filters[key]]);
8295
+ rawFilters[key] = exports.GameVolleyballPosition[filters[key]];
8301
8296
  }
8302
8297
  else if (key === 'hockey_position') {
8303
- params = params.set(key, exports.GameHockeyPosition[filters[key]]);
8298
+ rawFilters[key] = exports.GameHockeyPosition[filters[key]];
8304
8299
  }
8305
8300
  else if (key === 'football_position') {
8306
- params = params.set(key, exports.GameFootballPosition[filters[key]]);
8301
+ rawFilters[key] = exports.GameFootballPosition[filters[key]];
8307
8302
  }
8308
8303
  else if (key === 'handball_position') {
8309
- params = params.set(key, exports.GameHandballPosition[filters[key]]);
8304
+ rawFilters[key] = exports.GameHandballPosition[filters[key]];
8310
8305
  }
8311
8306
  else if (key === 'waterpolo_position') {
8312
- params = params.set(key, exports.GameWaterpoloPosition[filters[key]]);
8307
+ rawFilters[key] = exports.GameWaterpoloPosition[filters[key]];
8313
8308
  }
8314
8309
  else if (key === 'rugby_position') {
8315
- params = params.set(key, exports.GameRugbyPosition[filters[key]]);
8310
+ rawFilters[key] = exports.GameRugbyPosition[filters[key]];
8316
8311
  }
8317
8312
  else {
8318
- params = params.set(key, filters[key]);
8313
+ rawFilters[key] = filters[key];
8319
8314
  }
8320
8315
  }
8321
8316
  }
@@ -8328,18 +8323,18 @@
8328
8323
  finally { if (e_8) throw e_8.error; }
8329
8324
  }
8330
8325
  if (filters.per_game !== undefined) {
8331
- params = params.set('per_game', filters.per_game ? '1' : '0');
8326
+ rawFilters['per_game'] = filters.per_game ? '1' : '0';
8332
8327
  }
8333
8328
  if (filters.tournament_ids) {
8334
- params = params.set('tournament_ids', filters.tournament_ids.join(','));
8329
+ rawFilters['tournament_ids'] = filters.tournament_ids.join(',');
8335
8330
  }
8336
8331
  if (filters.tournament_season_ids) {
8337
- params = params.set('tournament_season_ids', filters.tournament_season_ids.join(','));
8332
+ rawFilters['tournament_season_ids'] = filters.tournament_season_ids.join(',');
8338
8333
  }
8339
8334
  if (filters.is_playoff !== undefined && filters.is_playoff !== null) {
8340
- params = params.set('is_playoff', filters.is_playoff ? '1' : '0');
8335
+ rawFilters['is_playoff'] = filters.is_playoff ? '1' : '0';
8341
8336
  }
8342
- return params;
8337
+ return rawFilters;
8343
8338
  }
8344
8339
  function applyStatisticLeadersFilters(filters, params) {
8345
8340
  var e_9, _a;