@mtgame/core 0.0.76 → 0.1.0
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.
- package/api/league-api.d.ts +7 -3
- package/api/media-api.d.ts +6 -9
- package/api/tournament-api.d.ts +44 -5
- package/bundles/mtgame-core.umd.js +290 -88
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +1 -1
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/api/league-api.js +27 -8
- package/esm2015/api/media-api.js +31 -41
- package/esm2015/api/tournament-api.js +115 -6
- package/esm2015/api/tournament-season-api.js +4 -22
- package/esm2015/models/base-statistic.js +1 -1
- package/esm2015/models/public-api.js +37 -37
- package/esm2015/models/tournament-season.js +2 -1
- package/esm2015/models/tournament-team.js +3 -1
- package/esm2015/mtgame-core.js +2 -3
- package/esm5/api/league-api.js +32 -8
- package/esm5/api/media-api.js +31 -41
- package/esm5/api/tournament-api.js +222 -21
- package/esm5/api/tournament-season-api.js +4 -22
- package/esm5/models/base-statistic.js +1 -1
- package/esm5/models/public-api.js +37 -37
- package/esm5/models/tournament-season.js +2 -1
- package/esm5/models/tournament-team.js +3 -1
- package/esm5/mtgame-core.js +2 -3
- package/fesm2015/mtgame-core.js +173 -72
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +285 -87
- package/fesm5/mtgame-core.js.map +1 -1
- package/models/base-statistic.d.ts +1 -0
- package/models/public-api.d.ts +37 -37
- package/models/tournament-team.d.ts +1 -0
- package/mtgame-core.d.ts +1 -2
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/mtgame-core.js
CHANGED
|
@@ -1053,6 +1053,7 @@ var TournamentSeason = /** @class */ (function (_super) {
|
|
|
1053
1053
|
status: 'status',
|
|
1054
1054
|
start_date: 'startDate',
|
|
1055
1055
|
closed_date: 'closedDate',
|
|
1056
|
+
tournaments: 'tournaments',
|
|
1056
1057
|
},
|
|
1057
1058
|
relation: {
|
|
1058
1059
|
logo: File,
|
|
@@ -1965,12 +1966,14 @@ var TournamentTeam = /** @class */ (function (_super) {
|
|
|
1965
1966
|
lose_normal_time_games_count: 'loseNormalTimeGamesCount',
|
|
1966
1967
|
win_overtime_games_count: 'winOvertimeGamesCount',
|
|
1967
1968
|
lose_overtime_games_count: 'loseOvertimeGamesCount',
|
|
1969
|
+
last_five_games: 'lastFiveGames'
|
|
1968
1970
|
},
|
|
1969
1971
|
relation: {
|
|
1970
1972
|
tournament: Tournament,
|
|
1971
1973
|
team: Team,
|
|
1972
1974
|
group: TournamentGroup,
|
|
1973
1975
|
games: Game,
|
|
1976
|
+
lastFiveGames: Game,
|
|
1974
1977
|
}
|
|
1975
1978
|
})
|
|
1976
1979
|
], TournamentTeam);
|
|
@@ -4728,10 +4731,140 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4728
4731
|
});
|
|
4729
4732
|
});
|
|
4730
4733
|
};
|
|
4734
|
+
TournamentApi.prototype.getBasketballStatisticLeaders = function (filters) {
|
|
4735
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4736
|
+
var params;
|
|
4737
|
+
return __generator(this, function (_a) {
|
|
4738
|
+
params = new HttpParams();
|
|
4739
|
+
params = applyStatisticLeadersFilters(filters, params);
|
|
4740
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic_leaders/", { params: params }).pipe(map(function (result) {
|
|
4741
|
+
var e_1, _a;
|
|
4742
|
+
try {
|
|
4743
|
+
for (var _b = __values(Object.keys(result)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4744
|
+
var key = _c.value;
|
|
4745
|
+
result[key] = BasketballStatistic.toFront(result[key]);
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4749
|
+
finally {
|
|
4750
|
+
try {
|
|
4751
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4752
|
+
}
|
|
4753
|
+
finally { if (e_1) throw e_1.error; }
|
|
4754
|
+
}
|
|
4755
|
+
return result;
|
|
4756
|
+
})).toPromise()];
|
|
4757
|
+
});
|
|
4758
|
+
});
|
|
4759
|
+
};
|
|
4760
|
+
TournamentApi.prototype.getVolleyballStatisticLeaders = function (filters) {
|
|
4761
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4762
|
+
var params;
|
|
4763
|
+
return __generator(this, function (_a) {
|
|
4764
|
+
params = new HttpParams();
|
|
4765
|
+
params = applyStatisticLeadersFilters(filters, params);
|
|
4766
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic_leaders/", { params: params }).pipe(map(function (result) {
|
|
4767
|
+
var e_2, _a;
|
|
4768
|
+
try {
|
|
4769
|
+
for (var _b = __values(Object.keys(result)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4770
|
+
var key = _c.value;
|
|
4771
|
+
result[key] = VolleyballStatistic.toFront(result[key]);
|
|
4772
|
+
}
|
|
4773
|
+
}
|
|
4774
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4775
|
+
finally {
|
|
4776
|
+
try {
|
|
4777
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4778
|
+
}
|
|
4779
|
+
finally { if (e_2) throw e_2.error; }
|
|
4780
|
+
}
|
|
4781
|
+
return result;
|
|
4782
|
+
})).toPromise()];
|
|
4783
|
+
});
|
|
4784
|
+
});
|
|
4785
|
+
};
|
|
4786
|
+
TournamentApi.prototype.getHockeyStatisticLeaders = function (filters) {
|
|
4787
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4788
|
+
var params;
|
|
4789
|
+
return __generator(this, function (_a) {
|
|
4790
|
+
params = new HttpParams();
|
|
4791
|
+
params = applyStatisticLeadersFilters(filters, params);
|
|
4792
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic_leaders/", { params: params }).pipe(map(function (result) {
|
|
4793
|
+
var e_3, _a;
|
|
4794
|
+
try {
|
|
4795
|
+
for (var _b = __values(Object.keys(result)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4796
|
+
var key = _c.value;
|
|
4797
|
+
result[key] = HockeyStatistic.toFront(result[key]);
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
4801
|
+
finally {
|
|
4802
|
+
try {
|
|
4803
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4804
|
+
}
|
|
4805
|
+
finally { if (e_3) throw e_3.error; }
|
|
4806
|
+
}
|
|
4807
|
+
return result;
|
|
4808
|
+
})).toPromise()];
|
|
4809
|
+
});
|
|
4810
|
+
});
|
|
4811
|
+
};
|
|
4812
|
+
TournamentApi.prototype.getFootballStatisticLeaders = function (filters) {
|
|
4813
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4814
|
+
var params;
|
|
4815
|
+
return __generator(this, function (_a) {
|
|
4816
|
+
params = new HttpParams();
|
|
4817
|
+
params = applyStatisticLeadersFilters(filters, params);
|
|
4818
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic_leaders/", { params: params }).pipe(map(function (result) {
|
|
4819
|
+
var e_4, _a;
|
|
4820
|
+
try {
|
|
4821
|
+
for (var _b = __values(Object.keys(result)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4822
|
+
var key = _c.value;
|
|
4823
|
+
result[key] = FootballStatistic.toFront(result[key]);
|
|
4824
|
+
}
|
|
4825
|
+
}
|
|
4826
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
4827
|
+
finally {
|
|
4828
|
+
try {
|
|
4829
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4830
|
+
}
|
|
4831
|
+
finally { if (e_4) throw e_4.error; }
|
|
4832
|
+
}
|
|
4833
|
+
return result;
|
|
4834
|
+
})).toPromise()];
|
|
4835
|
+
});
|
|
4836
|
+
});
|
|
4837
|
+
};
|
|
4838
|
+
TournamentApi.prototype.getHandballStatisticLeaders = function (filters) {
|
|
4839
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4840
|
+
var params;
|
|
4841
|
+
return __generator(this, function (_a) {
|
|
4842
|
+
params = new HttpParams();
|
|
4843
|
+
params = applyStatisticLeadersFilters(filters, params);
|
|
4844
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/handball_statistic_leaders/", { params: params }).pipe(map(function (result) {
|
|
4845
|
+
var e_5, _a;
|
|
4846
|
+
try {
|
|
4847
|
+
for (var _b = __values(Object.keys(result)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4848
|
+
var key = _c.value;
|
|
4849
|
+
result[key] = HandballStatistic.toFront(result[key]);
|
|
4850
|
+
}
|
|
4851
|
+
}
|
|
4852
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
4853
|
+
finally {
|
|
4854
|
+
try {
|
|
4855
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4856
|
+
}
|
|
4857
|
+
finally { if (e_5) throw e_5.error; }
|
|
4858
|
+
}
|
|
4859
|
+
return result;
|
|
4860
|
+
})).toPromise()];
|
|
4861
|
+
});
|
|
4862
|
+
});
|
|
4863
|
+
};
|
|
4731
4864
|
TournamentApi.prototype.getBasketballStatistic = function (filters) {
|
|
4732
4865
|
return __awaiter(this, void 0, void 0, function () {
|
|
4733
4866
|
var params, _a, _b, key;
|
|
4734
|
-
var
|
|
4867
|
+
var e_6, _c;
|
|
4735
4868
|
return __generator(this, function (_d) {
|
|
4736
4869
|
params = new HttpParams();
|
|
4737
4870
|
if (filters) {
|
|
@@ -4743,12 +4876,12 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4743
4876
|
}
|
|
4744
4877
|
}
|
|
4745
4878
|
}
|
|
4746
|
-
catch (
|
|
4879
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
4747
4880
|
finally {
|
|
4748
4881
|
try {
|
|
4749
4882
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
4750
4883
|
}
|
|
4751
|
-
finally { if (
|
|
4884
|
+
finally { if (e_6) throw e_6.error; }
|
|
4752
4885
|
}
|
|
4753
4886
|
if (filters.per_game !== undefined) {
|
|
4754
4887
|
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
@@ -4757,14 +4890,17 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4757
4890
|
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
4758
4891
|
}
|
|
4759
4892
|
}
|
|
4760
|
-
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", { params: params }).pipe(map(function (result) { return
|
|
4893
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
|
|
4894
|
+
total: +result.headers.get('X-Page-Count'),
|
|
4895
|
+
data: BasketballStatistic.toFront(result.body)
|
|
4896
|
+
}); })).toPromise()];
|
|
4761
4897
|
});
|
|
4762
4898
|
});
|
|
4763
4899
|
};
|
|
4764
4900
|
TournamentApi.prototype.getVolleyballStatistic = function (filters) {
|
|
4765
4901
|
return __awaiter(this, void 0, void 0, function () {
|
|
4766
4902
|
var params, _a, _b, key;
|
|
4767
|
-
var
|
|
4903
|
+
var e_7, _c;
|
|
4768
4904
|
return __generator(this, function (_d) {
|
|
4769
4905
|
params = new HttpParams();
|
|
4770
4906
|
if (filters) {
|
|
@@ -4776,12 +4912,12 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4776
4912
|
}
|
|
4777
4913
|
}
|
|
4778
4914
|
}
|
|
4779
|
-
catch (
|
|
4915
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
4780
4916
|
finally {
|
|
4781
4917
|
try {
|
|
4782
4918
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
4783
4919
|
}
|
|
4784
|
-
finally { if (
|
|
4920
|
+
finally { if (e_7) throw e_7.error; }
|
|
4785
4921
|
}
|
|
4786
4922
|
if (filters.per_game !== undefined) {
|
|
4787
4923
|
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
@@ -4790,14 +4926,17 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4790
4926
|
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
4791
4927
|
}
|
|
4792
4928
|
}
|
|
4793
|
-
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", { params: params }).pipe(map(function (result) { return
|
|
4929
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
|
|
4930
|
+
total: +result.headers.get('X-Page-Count'),
|
|
4931
|
+
data: VolleyballStatistic.toFront(result)
|
|
4932
|
+
}); })).toPromise()];
|
|
4794
4933
|
});
|
|
4795
4934
|
});
|
|
4796
4935
|
};
|
|
4797
4936
|
TournamentApi.prototype.getHockeyStatistic = function (filters) {
|
|
4798
4937
|
return __awaiter(this, void 0, void 0, function () {
|
|
4799
4938
|
var params, _a, _b, key;
|
|
4800
|
-
var
|
|
4939
|
+
var e_8, _c;
|
|
4801
4940
|
return __generator(this, function (_d) {
|
|
4802
4941
|
params = new HttpParams();
|
|
4803
4942
|
if (filters) {
|
|
@@ -4809,12 +4948,12 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4809
4948
|
}
|
|
4810
4949
|
}
|
|
4811
4950
|
}
|
|
4812
|
-
catch (
|
|
4951
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
4813
4952
|
finally {
|
|
4814
4953
|
try {
|
|
4815
4954
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
4816
4955
|
}
|
|
4817
|
-
finally { if (
|
|
4956
|
+
finally { if (e_8) throw e_8.error; }
|
|
4818
4957
|
}
|
|
4819
4958
|
if (filters.per_game !== undefined) {
|
|
4820
4959
|
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
@@ -4823,14 +4962,17 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4823
4962
|
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
4824
4963
|
}
|
|
4825
4964
|
}
|
|
4826
|
-
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", { params: params }).pipe(map(function (result) { return
|
|
4965
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
|
|
4966
|
+
total: +result.headers.get('X-Page-Count'),
|
|
4967
|
+
data: HockeyStatistic.toFront(result)
|
|
4968
|
+
}); })).toPromise()];
|
|
4827
4969
|
});
|
|
4828
4970
|
});
|
|
4829
4971
|
};
|
|
4830
4972
|
TournamentApi.prototype.getFootballStatistic = function (filters) {
|
|
4831
4973
|
return __awaiter(this, void 0, void 0, function () {
|
|
4832
4974
|
var params, _a, _b, key;
|
|
4833
|
-
var
|
|
4975
|
+
var e_9, _c;
|
|
4834
4976
|
return __generator(this, function (_d) {
|
|
4835
4977
|
params = new HttpParams();
|
|
4836
4978
|
if (filters) {
|
|
@@ -4842,12 +4984,12 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4842
4984
|
}
|
|
4843
4985
|
}
|
|
4844
4986
|
}
|
|
4845
|
-
catch (
|
|
4987
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
4846
4988
|
finally {
|
|
4847
4989
|
try {
|
|
4848
4990
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
4849
4991
|
}
|
|
4850
|
-
finally { if (
|
|
4992
|
+
finally { if (e_9) throw e_9.error; }
|
|
4851
4993
|
}
|
|
4852
4994
|
if (filters.per_game !== undefined) {
|
|
4853
4995
|
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
@@ -4856,14 +4998,17 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4856
4998
|
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
4857
4999
|
}
|
|
4858
5000
|
}
|
|
4859
|
-
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic/", { params: params }).pipe(map(function (result) { return
|
|
5001
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
|
|
5002
|
+
total: +result.headers.get('X-Page-Count'),
|
|
5003
|
+
data: FootballStatistic.toFront(result)
|
|
5004
|
+
}); })).toPromise()];
|
|
4860
5005
|
});
|
|
4861
5006
|
});
|
|
4862
5007
|
};
|
|
4863
5008
|
TournamentApi.prototype.getHandballStatistic = function (filters) {
|
|
4864
5009
|
return __awaiter(this, void 0, void 0, function () {
|
|
4865
5010
|
var params, _a, _b, key;
|
|
4866
|
-
var
|
|
5011
|
+
var e_10, _c;
|
|
4867
5012
|
return __generator(this, function (_d) {
|
|
4868
5013
|
params = new HttpParams();
|
|
4869
5014
|
if (filters) {
|
|
@@ -4875,12 +5020,12 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4875
5020
|
}
|
|
4876
5021
|
}
|
|
4877
5022
|
}
|
|
4878
|
-
catch (
|
|
5023
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
4879
5024
|
finally {
|
|
4880
5025
|
try {
|
|
4881
5026
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
4882
5027
|
}
|
|
4883
|
-
finally { if (
|
|
5028
|
+
finally { if (e_10) throw e_10.error; }
|
|
4884
5029
|
}
|
|
4885
5030
|
if (filters.per_game !== undefined) {
|
|
4886
5031
|
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
@@ -4889,7 +5034,10 @@ var TournamentApi = /** @class */ (function () {
|
|
|
4889
5034
|
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
4890
5035
|
}
|
|
4891
5036
|
}
|
|
4892
|
-
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/handball_statistic/", { params: params }).pipe(map(function (result) { return
|
|
5037
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/handball_statistic/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
|
|
5038
|
+
total: +result.headers.get('X-Page-Count'),
|
|
5039
|
+
data: HandballStatistic.toFront(result)
|
|
5040
|
+
}); })).toPromise()];
|
|
4893
5041
|
});
|
|
4894
5042
|
});
|
|
4895
5043
|
};
|
|
@@ -4960,6 +5108,62 @@ function applyGamesFilters(filters, params) {
|
|
|
4960
5108
|
if (filters.userId) {
|
|
4961
5109
|
params = params.set('user_id', filters.userId.toString());
|
|
4962
5110
|
}
|
|
5111
|
+
if (filters.query) {
|
|
5112
|
+
params = params.set('query', filters.query);
|
|
5113
|
+
}
|
|
5114
|
+
return params;
|
|
5115
|
+
}
|
|
5116
|
+
function applyStatisticFilters(filters, params) {
|
|
5117
|
+
var e_11, _a;
|
|
5118
|
+
try {
|
|
5119
|
+
for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
5120
|
+
var key = _c.value;
|
|
5121
|
+
if (filters[key]) {
|
|
5122
|
+
params = params.set(key, filters[key]);
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
}
|
|
5126
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
5127
|
+
finally {
|
|
5128
|
+
try {
|
|
5129
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
5130
|
+
}
|
|
5131
|
+
finally { if (e_11) throw e_11.error; }
|
|
5132
|
+
}
|
|
5133
|
+
if (filters.per_game !== undefined) {
|
|
5134
|
+
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
5135
|
+
}
|
|
5136
|
+
if (filters.tournament_ids) {
|
|
5137
|
+
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
5138
|
+
}
|
|
5139
|
+
return params;
|
|
5140
|
+
}
|
|
5141
|
+
function applyStatisticLeadersFilters(filters, params) {
|
|
5142
|
+
var e_12, _a;
|
|
5143
|
+
try {
|
|
5144
|
+
for (var _b = __values(Object.keys(filters)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
5145
|
+
var key = _c.value;
|
|
5146
|
+
if (filters[key]) {
|
|
5147
|
+
params = params.set(key, filters[key]);
|
|
5148
|
+
}
|
|
5149
|
+
}
|
|
5150
|
+
}
|
|
5151
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
5152
|
+
finally {
|
|
5153
|
+
try {
|
|
5154
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
5155
|
+
}
|
|
5156
|
+
finally { if (e_12) throw e_12.error; }
|
|
5157
|
+
}
|
|
5158
|
+
if (filters.per_game !== undefined) {
|
|
5159
|
+
params = params.set('per_game', filters.per_game ? '1' : '0');
|
|
5160
|
+
}
|
|
5161
|
+
if (filters.tournament_ids) {
|
|
5162
|
+
params = params.set('tournament_ids', filters.tournament_ids.join(','));
|
|
5163
|
+
}
|
|
5164
|
+
if (filters.fields) {
|
|
5165
|
+
params = params.set('fields', filters.fields.join(','));
|
|
5166
|
+
}
|
|
4963
5167
|
return params;
|
|
4964
5168
|
}
|
|
4965
5169
|
|
|
@@ -5052,10 +5256,17 @@ var LeagueApi = /** @class */ (function () {
|
|
|
5052
5256
|
});
|
|
5053
5257
|
});
|
|
5054
5258
|
};
|
|
5055
|
-
LeagueApi.prototype.getTournaments = function (leagueId) {
|
|
5259
|
+
LeagueApi.prototype.getTournaments = function (leagueId, filters) {
|
|
5056
5260
|
return __awaiter(this, void 0, void 0, function () {
|
|
5261
|
+
var params;
|
|
5057
5262
|
return __generator(this, function (_a) {
|
|
5058
|
-
|
|
5263
|
+
params = new HttpParams();
|
|
5264
|
+
if (filters) {
|
|
5265
|
+
if (filters.statuses) {
|
|
5266
|
+
params = params.set('statuses', filters.statuses.map(function (s) { return TournamentStatuses[s]; }).join(','));
|
|
5267
|
+
}
|
|
5268
|
+
}
|
|
5269
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/", { params: params }).pipe(map(function (result) { return Tournament.toFront(result); })).toPromise()];
|
|
5059
5270
|
});
|
|
5060
5271
|
});
|
|
5061
5272
|
};
|
|
@@ -5106,13 +5317,22 @@ var LeagueApi = /** @class */ (function () {
|
|
|
5106
5317
|
});
|
|
5107
5318
|
});
|
|
5108
5319
|
};
|
|
5109
|
-
LeagueApi.prototype.getSeasons = function (leagueId, notClosed) {
|
|
5320
|
+
LeagueApi.prototype.getSeasons = function (leagueId, page, size, notClosed, include) {
|
|
5321
|
+
if (page === void 0) { page = 1; }
|
|
5322
|
+
if (size === void 0) { size = 20; }
|
|
5110
5323
|
return __awaiter(this, void 0, void 0, function () {
|
|
5111
5324
|
var params;
|
|
5112
5325
|
return __generator(this, function (_a) {
|
|
5113
|
-
params = new HttpParams()
|
|
5114
|
-
|
|
5115
|
-
|
|
5326
|
+
params = new HttpParams()
|
|
5327
|
+
.set('page', page.toString())
|
|
5328
|
+
.set('size', size.toString())
|
|
5329
|
+
.set('not_closed', notClosed ? '1' : '')
|
|
5330
|
+
.set('include', include ? include.join(',') : '');
|
|
5331
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournament_seasons/", { params: params, observe: 'response' })
|
|
5332
|
+
.pipe(map(function (result) { return ({
|
|
5333
|
+
total: +result.headers.get('X-Page-Count'),
|
|
5334
|
+
data: TournamentSeason.toFront(result.body)
|
|
5335
|
+
}); }))
|
|
5116
5336
|
.toPromise()];
|
|
5117
5337
|
});
|
|
5118
5338
|
});
|
|
@@ -5140,6 +5360,14 @@ var LeagueApi = /** @class */ (function () {
|
|
|
5140
5360
|
});
|
|
5141
5361
|
});
|
|
5142
5362
|
};
|
|
5363
|
+
LeagueApi.prototype.getGraphicSettings = function (leagueId) {
|
|
5364
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5365
|
+
return __generator(this, function (_a) {
|
|
5366
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/graphic_settings/")
|
|
5367
|
+
.toPromise()];
|
|
5368
|
+
});
|
|
5369
|
+
});
|
|
5370
|
+
};
|
|
5143
5371
|
LeagueApi.ctorParameters = function () { return [
|
|
5144
5372
|
{ type: HttpClient },
|
|
5145
5373
|
{ type: ConfigService }
|
|
@@ -5240,26 +5468,7 @@ var MediaApi = /** @class */ (function () {
|
|
|
5240
5468
|
var params;
|
|
5241
5469
|
return __generator(this, function (_a) {
|
|
5242
5470
|
params = new HttpParams().set('page', page.toString()).set('size', size.toString());
|
|
5243
|
-
|
|
5244
|
-
if (filters.tournamentTour) {
|
|
5245
|
-
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5246
|
-
}
|
|
5247
|
-
if (filters.teamId) {
|
|
5248
|
-
params = params.set('team_id', filters.teamId.toString());
|
|
5249
|
-
}
|
|
5250
|
-
if (filters.tournamentStageId) {
|
|
5251
|
-
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
5252
|
-
}
|
|
5253
|
-
if (filters.playoffId) {
|
|
5254
|
-
params = params.set('playoff_id', filters.playoffId.toString());
|
|
5255
|
-
}
|
|
5256
|
-
if (filters.playoffStage) {
|
|
5257
|
-
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
5258
|
-
}
|
|
5259
|
-
if (filters.status) {
|
|
5260
|
-
params = params.set('status', GameStatuses[filters.status]);
|
|
5261
|
-
}
|
|
5262
|
-
}
|
|
5471
|
+
params = applyGameMediaFilters(filters, params);
|
|
5263
5472
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/game_media/", { observe: 'response', params: params }).pipe(map(function (response) {
|
|
5264
5473
|
return {
|
|
5265
5474
|
total: +response.headers.get('X-Page-Count'),
|
|
@@ -5274,26 +5483,7 @@ var MediaApi = /** @class */ (function () {
|
|
|
5274
5483
|
var params;
|
|
5275
5484
|
return __generator(this, function (_a) {
|
|
5276
5485
|
params = new HttpParams().set('page', page.toString()).set('size', size.toString());
|
|
5277
|
-
|
|
5278
|
-
if (filters.tournamentTour) {
|
|
5279
|
-
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5280
|
-
}
|
|
5281
|
-
if (filters.teamId) {
|
|
5282
|
-
params = params.set('team_id', filters.teamId.toString());
|
|
5283
|
-
}
|
|
5284
|
-
if (filters.tournamentStageId) {
|
|
5285
|
-
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
5286
|
-
}
|
|
5287
|
-
if (filters.playoffId) {
|
|
5288
|
-
params = params.set('playoff_id', filters.playoffId.toString());
|
|
5289
|
-
}
|
|
5290
|
-
if (filters.playoffStage) {
|
|
5291
|
-
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
5292
|
-
}
|
|
5293
|
-
if (filters.status) {
|
|
5294
|
-
params = params.set('status', GameStatuses[filters.status]);
|
|
5295
|
-
}
|
|
5296
|
-
}
|
|
5486
|
+
params = applyGameMediaFilters(filters, params);
|
|
5297
5487
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/game_media/", { observe: 'response', params: params }).pipe(map(function (response) {
|
|
5298
5488
|
return {
|
|
5299
5489
|
total: +response.headers.get('X-Page-Count'),
|
|
@@ -5364,6 +5554,33 @@ var MediaApi = /** @class */ (function () {
|
|
|
5364
5554
|
], MediaApi);
|
|
5365
5555
|
return MediaApi;
|
|
5366
5556
|
}());
|
|
5557
|
+
function applyGameMediaFilters(filters, params) {
|
|
5558
|
+
if (filters) {
|
|
5559
|
+
params = applyGamesFilters(filters, params);
|
|
5560
|
+
if (filters.tournamentTour) {
|
|
5561
|
+
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
5562
|
+
}
|
|
5563
|
+
if (filters.teamId) {
|
|
5564
|
+
params = params.set('team_id', filters.teamId.toString());
|
|
5565
|
+
}
|
|
5566
|
+
if (filters.tournamentStageId) {
|
|
5567
|
+
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
5568
|
+
}
|
|
5569
|
+
if (filters.playoffId) {
|
|
5570
|
+
params = params.set('playoff_id', filters.playoffId.toString());
|
|
5571
|
+
}
|
|
5572
|
+
if (filters.playoffStage) {
|
|
5573
|
+
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
5574
|
+
}
|
|
5575
|
+
if (filters.status) {
|
|
5576
|
+
params = params.set('status', GameStatuses[filters.status]);
|
|
5577
|
+
}
|
|
5578
|
+
if (filters.mediaCount) {
|
|
5579
|
+
params = params.set('media_count', filters.mediaCount.toString());
|
|
5580
|
+
}
|
|
5581
|
+
}
|
|
5582
|
+
return params;
|
|
5583
|
+
}
|
|
5367
5584
|
|
|
5368
5585
|
var PollStatuses;
|
|
5369
5586
|
(function (PollStatuses) {
|
|
@@ -6924,26 +7141,7 @@ var TournamentSeasonApi = /** @class */ (function () {
|
|
|
6924
7141
|
var params;
|
|
6925
7142
|
return __generator(this, function (_a) {
|
|
6926
7143
|
params = new HttpParams().set('page', page.toString()).set('size', size.toString());
|
|
6927
|
-
|
|
6928
|
-
if (filters.tournamentTour) {
|
|
6929
|
-
params = params.set('tournament_tour', filters.tournamentTour.toString());
|
|
6930
|
-
}
|
|
6931
|
-
if (filters.teamId) {
|
|
6932
|
-
params = params.set('team_id', filters.teamId.toString());
|
|
6933
|
-
}
|
|
6934
|
-
if (filters.tournamentStageId) {
|
|
6935
|
-
params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
|
|
6936
|
-
}
|
|
6937
|
-
if (filters.playoffId) {
|
|
6938
|
-
params = params.set('playoff_id', filters.playoffId.toString());
|
|
6939
|
-
}
|
|
6940
|
-
if (filters.playoffStage) {
|
|
6941
|
-
params = params.set('playoff_stage', filters.playoffStage.toString());
|
|
6942
|
-
}
|
|
6943
|
-
if (filters.status) {
|
|
6944
|
-
params = params.set('status', GameStatuses[filters.status]);
|
|
6945
|
-
}
|
|
6946
|
-
}
|
|
7144
|
+
params = applyGameMediaFilters(filters, params);
|
|
6947
7145
|
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/game_media/", { observe: 'response', params: params })
|
|
6948
7146
|
.pipe(map(function (response) {
|
|
6949
7147
|
return {
|
|
@@ -8447,5 +8645,5 @@ var HttpCookieInterceptor = /** @class */ (function () {
|
|
|
8447
8645
|
* Generated bundle index. Do not edit.
|
|
8448
8646
|
*/
|
|
8449
8647
|
|
|
8450
|
-
export { BannerLocation, BaseModel, BaseService, BaseStatistic, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameTeamStatistic, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DateField, DateTimeField, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlaylist, LocalStorageEngine, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, ReferenceApi, SCORE_LOG_TYPES, Sport, SportTypes, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, ToBackHook, ToFrontHook, Tournament, TournamentApi, TournamentDisqualification, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl,
|
|
8648
|
+
export { BannerLocation, BaseModel, BaseService, BaseStatistic, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameTeamStatistic, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DateField, DateTimeField, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlaylist, LocalStorageEngine, MODEL_MAPPING_FIELDS_KEY, MODEL_RELATION_KEY, MODEL_TO_BACK_KEY, MODEL_TO_FRONT_KEY, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, ReferenceApi, SCORE_LOG_TYPES, Sport, SportTypes, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, ToBackHook, ToFrontHook, Tournament, TournamentApi, TournamentDisqualification, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, penaltyTypeField, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl, GameBaseApi as ɵa };
|
|
8451
8649
|
//# sourceMappingURL=mtgame-core.js.map
|