@mtgame/core 0.0.55 → 0.0.57

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.
Files changed (50) hide show
  1. package/api/basketball-game-api.d.ts +4 -5
  2. package/api/football-game-api.d.ts +4 -5
  3. package/api/game-base-api.d.ts +10 -0
  4. package/api/hockey-game-api.d.ts +4 -5
  5. package/api/public-api.d.ts +2 -0
  6. package/api/public-team-api.d.ts +11 -0
  7. package/api/public-user-api.d.ts +13 -0
  8. package/api/tournament-api.d.ts +8 -1
  9. package/api/volleyball-game-api.d.ts +4 -5
  10. package/bundles/mtgame-core.umd.js +1467 -1404
  11. package/bundles/mtgame-core.umd.js.map +1 -1
  12. package/bundles/mtgame-core.umd.min.js +1 -1
  13. package/bundles/mtgame-core.umd.min.js.map +1 -1
  14. package/esm2015/api/basketball-game-api.js +4 -8
  15. package/esm2015/api/football-game-api.js +4 -8
  16. package/esm2015/api/game-base-api.js +35 -0
  17. package/esm2015/api/hockey-game-api.js +4 -8
  18. package/esm2015/api/league-api.js +4 -24
  19. package/esm2015/api/public-api.js +3 -1
  20. package/esm2015/api/public-team-api.js +33 -0
  21. package/esm2015/api/public-user-api.js +38 -0
  22. package/esm2015/api/tournament-api.js +55 -23
  23. package/esm2015/api/tournament-season-api.js +3 -23
  24. package/esm2015/api/volleyball-game-api.js +4 -8
  25. package/esm2015/models/game-user.js +2 -1
  26. package/esm2015/models/tournament.js +2 -1
  27. package/esm2015/mtgame-core.js +2 -1
  28. package/esm5/api/basketball-game-api.js +10 -14
  29. package/esm5/api/football-game-api.js +10 -14
  30. package/esm5/api/game-base-api.js +40 -0
  31. package/esm5/api/hockey-game-api.js +10 -14
  32. package/esm5/api/league-api.js +5 -25
  33. package/esm5/api/public-api.js +3 -1
  34. package/esm5/api/public-team-api.js +34 -0
  35. package/esm5/api/public-user-api.js +39 -0
  36. package/esm5/api/tournament-api.js +60 -24
  37. package/esm5/api/tournament-season-api.js +4 -24
  38. package/esm5/api/volleyball-game-api.js +10 -14
  39. package/esm5/models/game-user.js +2 -1
  40. package/esm5/models/tournament.js +2 -1
  41. package/esm5/mtgame-core.js +2 -1
  42. package/fesm2015/mtgame-core.js +1995 -1946
  43. package/fesm2015/mtgame-core.js.map +1 -1
  44. package/fesm5/mtgame-core.js +1466 -1406
  45. package/fesm5/mtgame-core.js.map +1 -1
  46. package/models/game-user.d.ts +1 -0
  47. package/models/tournament.d.ts +1 -0
  48. package/mtgame-core.d.ts +1 -0
  49. package/mtgame-core.metadata.json +1 -1
  50. package/package.json +1 -1
@@ -1173,6 +1173,7 @@ var Tournament = /** @class */ (function (_super) {
1173
1173
  team_second: 'teamSecond',
1174
1174
  team_third: 'teamThird',
1175
1175
  season: 'season',
1176
+ season_id: 'seasonId',
1176
1177
  },
1177
1178
  relation: {
1178
1179
  logo: File,
@@ -1560,255 +1561,6 @@ var Game = /** @class */ (function (_super) {
1560
1561
  return Game;
1561
1562
  }(BaseModel));
1562
1563
 
1563
- var TeamUserRole;
1564
- (function (TeamUserRole) {
1565
- TeamUserRole[TeamUserRole["member"] = 1] = "member";
1566
- TeamUserRole[TeamUserRole["moderator"] = 2] = "moderator";
1567
- TeamUserRole[TeamUserRole["admin"] = 3] = "admin";
1568
- })(TeamUserRole || (TeamUserRole = {}));
1569
- var TeamUser = /** @class */ (function (_super) {
1570
- __extends(TeamUser, _super);
1571
- function TeamUser() {
1572
- return _super !== null && _super.apply(this, arguments) || this;
1573
- }
1574
- TeamUser.toFront = function (data) { };
1575
- TeamUser.toBack = function (teamPlayer) { };
1576
- __decorate([
1577
- ToFrontHook
1578
- ], TeamUser, "toFront", null);
1579
- __decorate([
1580
- ToBackHook
1581
- ], TeamUser, "toBack", null);
1582
- TeamUser = __decorate([
1583
- ModelInstance({
1584
- mappingFields: {
1585
- id: 'id',
1586
- team_id: 'teamId',
1587
- user: 'user',
1588
- role: 'role',
1589
- number: 'number',
1590
- team: 'team',
1591
- },
1592
- relation: {
1593
- user: User,
1594
- team: Team,
1595
- role: enumField(TeamUserRole)
1596
- }
1597
- })
1598
- ], TeamUser);
1599
- return TeamUser;
1600
- }(BaseModel));
1601
-
1602
- var TournamentGroup = /** @class */ (function (_super) {
1603
- __extends(TournamentGroup, _super);
1604
- function TournamentGroup() {
1605
- return _super !== null && _super.apply(this, arguments) || this;
1606
- }
1607
- TournamentGroup.toFront = function (data) { };
1608
- TournamentGroup.toBack = function (data) { };
1609
- __decorate([
1610
- ToFrontHook
1611
- ], TournamentGroup, "toFront", null);
1612
- __decorate([
1613
- ToBackHook
1614
- ], TournamentGroup, "toBack", null);
1615
- TournamentGroup = __decorate([
1616
- ModelInstance({
1617
- mappingFields: {
1618
- id: 'id',
1619
- name: 'name',
1620
- tournament_stage_id: 'tournamentStageId'
1621
- }
1622
- })
1623
- ], TournamentGroup);
1624
- return TournamentGroup;
1625
- }(BaseModel));
1626
-
1627
- var TournamentTeam = /** @class */ (function (_super) {
1628
- __extends(TournamentTeam, _super);
1629
- function TournamentTeam() {
1630
- return _super !== null && _super.apply(this, arguments) || this;
1631
- }
1632
- Object.defineProperty(TournamentTeam.prototype, "gamesWonPercent", {
1633
- get: function () {
1634
- if (!this.gamesCount) {
1635
- return 0;
1636
- }
1637
- return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
1638
- },
1639
- enumerable: true,
1640
- configurable: true
1641
- });
1642
- TournamentTeam.toFront = function (data) { };
1643
- TournamentTeam.toBack = function (data) { };
1644
- __decorate([
1645
- ToFrontHook
1646
- ], TournamentTeam, "toFront", null);
1647
- __decorate([
1648
- ToBackHook
1649
- ], TournamentTeam, "toBack", null);
1650
- TournamentTeam = __decorate([
1651
- ModelInstance({
1652
- mappingFields: {
1653
- id: 'id',
1654
- team_id: 'teamId',
1655
- tournament_id: 'tournamentId',
1656
- tournament: 'tournament',
1657
- team: 'team',
1658
- group: 'group',
1659
- final_standing: 'finalStanding',
1660
- games_count: 'gamesCount',
1661
- won_games_count: 'wonGamesCount',
1662
- draw_games_count: 'drawGamesCount',
1663
- last_games_count: 'lastGamesCount',
1664
- last_games_won: 'lastGamesWon',
1665
- score_sum: 'scoreSum',
1666
- missed_sum: 'missedSum',
1667
- score_points_sum: 'scorePointsSum',
1668
- missed_points_sum: 'missedPointsSum',
1669
- points: 'points',
1670
- users_count: 'usersCount',
1671
- games: 'games',
1672
- notifications_count: 'notificationsCount',
1673
- win_normal_time_games_count: 'winNormalTimeGamesCount',
1674
- lose_normal_time_games_count: 'loseNormalTimeGamesCount',
1675
- win_overtime_games_count: 'winOvertimeGamesCount',
1676
- lose_overtime_games_count: 'loseOvertimeGamesCount',
1677
- },
1678
- relation: {
1679
- tournament: Tournament,
1680
- team: Team,
1681
- group: TournamentGroup,
1682
- games: Game,
1683
- }
1684
- })
1685
- ], TournamentTeam);
1686
- return TournamentTeam;
1687
- }(BaseModel));
1688
-
1689
- var TournamentDisqualification = /** @class */ (function (_super) {
1690
- __extends(TournamentDisqualification, _super);
1691
- function TournamentDisqualification() {
1692
- return _super !== null && _super.apply(this, arguments) || this;
1693
- }
1694
- TournamentDisqualification.toFront = function (data) { };
1695
- TournamentDisqualification.toBack = function (data) { };
1696
- __decorate([
1697
- ToFrontHook
1698
- ], TournamentDisqualification, "toFront", null);
1699
- __decorate([
1700
- ToBackHook
1701
- ], TournamentDisqualification, "toBack", null);
1702
- TournamentDisqualification = __decorate([
1703
- ModelInstance({
1704
- mappingFields: {
1705
- id: 'id',
1706
- tournament_team_user_id: 'tournamentTeamUserId',
1707
- date_from: 'dateFrom',
1708
- date_to: 'dateTo',
1709
- matches_count: 'matchesCount',
1710
- },
1711
- relation: {
1712
- dateFrom: DateField,
1713
- dateTo: DateField,
1714
- }
1715
- })
1716
- ], TournamentDisqualification);
1717
- return TournamentDisqualification;
1718
- }(BaseModel));
1719
-
1720
- var TournamentTeamUser = /** @class */ (function (_super) {
1721
- __extends(TournamentTeamUser, _super);
1722
- function TournamentTeamUser() {
1723
- return _super !== null && _super.apply(this, arguments) || this;
1724
- }
1725
- Object.defineProperty(TournamentTeamUser.prototype, "fullName", {
1726
- get: function () {
1727
- return [this.lastName, this.firstName, this.middleName].filter(function (s) { return s; }).join(' ');
1728
- },
1729
- enumerable: true,
1730
- configurable: true
1731
- });
1732
- Object.defineProperty(TournamentTeamUser.prototype, "shortName", {
1733
- get: function () {
1734
- return [this.lastName, this.firstName].filter(function (s) { return s; }).join(' ');
1735
- },
1736
- enumerable: true,
1737
- configurable: true
1738
- });
1739
- Object.defineProperty(TournamentTeamUser.prototype, "initials", {
1740
- get: function () {
1741
- return [this.lastName, this.firstName].filter(function (s) { return s; }).map(function (s) { return s.substr(0, 1); }).join('');
1742
- },
1743
- enumerable: true,
1744
- configurable: true
1745
- });
1746
- TournamentTeamUser.toFront = function (data) { };
1747
- TournamentTeamUser.toBack = function (data) { };
1748
- __decorate([
1749
- ToFrontHook
1750
- ], TournamentTeamUser, "toFront", null);
1751
- __decorate([
1752
- ToBackHook
1753
- ], TournamentTeamUser, "toBack", null);
1754
- TournamentTeamUser = __decorate([
1755
- ModelInstance({
1756
- mappingFields: {
1757
- id: 'id',
1758
- tournament_team: 'tournamentTeam',
1759
- team_user: 'teamUser',
1760
- disqualified: 'disqualified',
1761
- first_name: 'firstName',
1762
- last_name: 'lastName',
1763
- middle_name: 'middleName',
1764
- photo: 'photo',
1765
- disqualification: 'disqualification',
1766
- has_changes: 'hasChanges',
1767
- rating: 'rating'
1768
- },
1769
- relation: {
1770
- tournamentTeam: TournamentTeam,
1771
- teamUser: TeamUser,
1772
- photo: File,
1773
- disqualification: TournamentDisqualification,
1774
- }
1775
- })
1776
- ], TournamentTeamUser);
1777
- return TournamentTeamUser;
1778
- }(BaseModel));
1779
-
1780
- var GameUser = /** @class */ (function (_super) {
1781
- __extends(GameUser, _super);
1782
- function GameUser() {
1783
- return _super !== null && _super.apply(this, arguments) || this;
1784
- }
1785
- GameUser.toFront = function (data) { };
1786
- GameUser.toBack = function (data) { };
1787
- __decorate([
1788
- ToFrontHook
1789
- ], GameUser, "toFront", null);
1790
- __decorate([
1791
- ToBackHook
1792
- ], GameUser, "toBack", null);
1793
- GameUser = __decorate([
1794
- ModelInstance({
1795
- mappingFields: {
1796
- id: 'id',
1797
- game_id: 'gameId',
1798
- team_user: 'teamUser',
1799
- tournament_team_user: 'tournamentTeamUser',
1800
- updated_at: 'updatedAt'
1801
- },
1802
- relation: {
1803
- teamUser: TeamUser,
1804
- tournamentTeamUser: TournamentTeamUser,
1805
- updatedAt: DateTimeField,
1806
- }
1807
- })
1808
- ], GameUser);
1809
- return GameUser;
1810
- }(BaseModel));
1811
-
1812
1564
  function updateItemInArray(data, item, force, checkFunction) {
1813
1565
  if (force === void 0) { force = false; }
1814
1566
  if (!Array.isArray(data)) {
@@ -2020,10 +1772,227 @@ var ConfigService = /** @class */ (function (_super) {
2020
1772
  return ConfigService;
2021
1773
  }(BaseService));
2022
1774
 
2023
- var BaseStatistic = /** @class */ (function () {
2024
- function BaseStatistic() {
1775
+ var TournamentGroup = /** @class */ (function (_super) {
1776
+ __extends(TournamentGroup, _super);
1777
+ function TournamentGroup() {
1778
+ return _super !== null && _super.apply(this, arguments) || this;
2025
1779
  }
2026
- return BaseStatistic;
1780
+ TournamentGroup.toFront = function (data) { };
1781
+ TournamentGroup.toBack = function (data) { };
1782
+ __decorate([
1783
+ ToFrontHook
1784
+ ], TournamentGroup, "toFront", null);
1785
+ __decorate([
1786
+ ToBackHook
1787
+ ], TournamentGroup, "toBack", null);
1788
+ TournamentGroup = __decorate([
1789
+ ModelInstance({
1790
+ mappingFields: {
1791
+ id: 'id',
1792
+ name: 'name',
1793
+ tournament_stage_id: 'tournamentStageId'
1794
+ }
1795
+ })
1796
+ ], TournamentGroup);
1797
+ return TournamentGroup;
1798
+ }(BaseModel));
1799
+
1800
+ var TournamentTeam = /** @class */ (function (_super) {
1801
+ __extends(TournamentTeam, _super);
1802
+ function TournamentTeam() {
1803
+ return _super !== null && _super.apply(this, arguments) || this;
1804
+ }
1805
+ Object.defineProperty(TournamentTeam.prototype, "gamesWonPercent", {
1806
+ get: function () {
1807
+ if (!this.gamesCount) {
1808
+ return 0;
1809
+ }
1810
+ return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
1811
+ },
1812
+ enumerable: true,
1813
+ configurable: true
1814
+ });
1815
+ TournamentTeam.toFront = function (data) { };
1816
+ TournamentTeam.toBack = function (data) { };
1817
+ __decorate([
1818
+ ToFrontHook
1819
+ ], TournamentTeam, "toFront", null);
1820
+ __decorate([
1821
+ ToBackHook
1822
+ ], TournamentTeam, "toBack", null);
1823
+ TournamentTeam = __decorate([
1824
+ ModelInstance({
1825
+ mappingFields: {
1826
+ id: 'id',
1827
+ team_id: 'teamId',
1828
+ tournament_id: 'tournamentId',
1829
+ tournament: 'tournament',
1830
+ team: 'team',
1831
+ group: 'group',
1832
+ final_standing: 'finalStanding',
1833
+ games_count: 'gamesCount',
1834
+ won_games_count: 'wonGamesCount',
1835
+ draw_games_count: 'drawGamesCount',
1836
+ last_games_count: 'lastGamesCount',
1837
+ last_games_won: 'lastGamesWon',
1838
+ score_sum: 'scoreSum',
1839
+ missed_sum: 'missedSum',
1840
+ score_points_sum: 'scorePointsSum',
1841
+ missed_points_sum: 'missedPointsSum',
1842
+ points: 'points',
1843
+ users_count: 'usersCount',
1844
+ games: 'games',
1845
+ notifications_count: 'notificationsCount',
1846
+ win_normal_time_games_count: 'winNormalTimeGamesCount',
1847
+ lose_normal_time_games_count: 'loseNormalTimeGamesCount',
1848
+ win_overtime_games_count: 'winOvertimeGamesCount',
1849
+ lose_overtime_games_count: 'loseOvertimeGamesCount',
1850
+ },
1851
+ relation: {
1852
+ tournament: Tournament,
1853
+ team: Team,
1854
+ group: TournamentGroup,
1855
+ games: Game,
1856
+ }
1857
+ })
1858
+ ], TournamentTeam);
1859
+ return TournamentTeam;
1860
+ }(BaseModel));
1861
+
1862
+ var TeamUserRole;
1863
+ (function (TeamUserRole) {
1864
+ TeamUserRole[TeamUserRole["member"] = 1] = "member";
1865
+ TeamUserRole[TeamUserRole["moderator"] = 2] = "moderator";
1866
+ TeamUserRole[TeamUserRole["admin"] = 3] = "admin";
1867
+ })(TeamUserRole || (TeamUserRole = {}));
1868
+ var TeamUser = /** @class */ (function (_super) {
1869
+ __extends(TeamUser, _super);
1870
+ function TeamUser() {
1871
+ return _super !== null && _super.apply(this, arguments) || this;
1872
+ }
1873
+ TeamUser.toFront = function (data) { };
1874
+ TeamUser.toBack = function (teamPlayer) { };
1875
+ __decorate([
1876
+ ToFrontHook
1877
+ ], TeamUser, "toFront", null);
1878
+ __decorate([
1879
+ ToBackHook
1880
+ ], TeamUser, "toBack", null);
1881
+ TeamUser = __decorate([
1882
+ ModelInstance({
1883
+ mappingFields: {
1884
+ id: 'id',
1885
+ team_id: 'teamId',
1886
+ user: 'user',
1887
+ role: 'role',
1888
+ number: 'number',
1889
+ team: 'team',
1890
+ },
1891
+ relation: {
1892
+ user: User,
1893
+ team: Team,
1894
+ role: enumField(TeamUserRole)
1895
+ }
1896
+ })
1897
+ ], TeamUser);
1898
+ return TeamUser;
1899
+ }(BaseModel));
1900
+
1901
+ var TournamentDisqualification = /** @class */ (function (_super) {
1902
+ __extends(TournamentDisqualification, _super);
1903
+ function TournamentDisqualification() {
1904
+ return _super !== null && _super.apply(this, arguments) || this;
1905
+ }
1906
+ TournamentDisqualification.toFront = function (data) { };
1907
+ TournamentDisqualification.toBack = function (data) { };
1908
+ __decorate([
1909
+ ToFrontHook
1910
+ ], TournamentDisqualification, "toFront", null);
1911
+ __decorate([
1912
+ ToBackHook
1913
+ ], TournamentDisqualification, "toBack", null);
1914
+ TournamentDisqualification = __decorate([
1915
+ ModelInstance({
1916
+ mappingFields: {
1917
+ id: 'id',
1918
+ tournament_team_user_id: 'tournamentTeamUserId',
1919
+ date_from: 'dateFrom',
1920
+ date_to: 'dateTo',
1921
+ matches_count: 'matchesCount',
1922
+ },
1923
+ relation: {
1924
+ dateFrom: DateField,
1925
+ dateTo: DateField,
1926
+ }
1927
+ })
1928
+ ], TournamentDisqualification);
1929
+ return TournamentDisqualification;
1930
+ }(BaseModel));
1931
+
1932
+ var TournamentTeamUser = /** @class */ (function (_super) {
1933
+ __extends(TournamentTeamUser, _super);
1934
+ function TournamentTeamUser() {
1935
+ return _super !== null && _super.apply(this, arguments) || this;
1936
+ }
1937
+ Object.defineProperty(TournamentTeamUser.prototype, "fullName", {
1938
+ get: function () {
1939
+ return [this.lastName, this.firstName, this.middleName].filter(function (s) { return s; }).join(' ');
1940
+ },
1941
+ enumerable: true,
1942
+ configurable: true
1943
+ });
1944
+ Object.defineProperty(TournamentTeamUser.prototype, "shortName", {
1945
+ get: function () {
1946
+ return [this.lastName, this.firstName].filter(function (s) { return s; }).join(' ');
1947
+ },
1948
+ enumerable: true,
1949
+ configurable: true
1950
+ });
1951
+ Object.defineProperty(TournamentTeamUser.prototype, "initials", {
1952
+ get: function () {
1953
+ return [this.lastName, this.firstName].filter(function (s) { return s; }).map(function (s) { return s.substr(0, 1); }).join('');
1954
+ },
1955
+ enumerable: true,
1956
+ configurable: true
1957
+ });
1958
+ TournamentTeamUser.toFront = function (data) { };
1959
+ TournamentTeamUser.toBack = function (data) { };
1960
+ __decorate([
1961
+ ToFrontHook
1962
+ ], TournamentTeamUser, "toFront", null);
1963
+ __decorate([
1964
+ ToBackHook
1965
+ ], TournamentTeamUser, "toBack", null);
1966
+ TournamentTeamUser = __decorate([
1967
+ ModelInstance({
1968
+ mappingFields: {
1969
+ id: 'id',
1970
+ tournament_team: 'tournamentTeam',
1971
+ team_user: 'teamUser',
1972
+ disqualified: 'disqualified',
1973
+ first_name: 'firstName',
1974
+ last_name: 'lastName',
1975
+ middle_name: 'middleName',
1976
+ photo: 'photo',
1977
+ disqualification: 'disqualification',
1978
+ has_changes: 'hasChanges',
1979
+ rating: 'rating'
1980
+ },
1981
+ relation: {
1982
+ tournamentTeam: TournamentTeam,
1983
+ teamUser: TeamUser,
1984
+ photo: File,
1985
+ disqualification: TournamentDisqualification,
1986
+ }
1987
+ })
1988
+ ], TournamentTeamUser);
1989
+ return TournamentTeamUser;
1990
+ }(BaseModel));
1991
+
1992
+ var BaseStatistic = /** @class */ (function () {
1993
+ function BaseStatistic() {
1994
+ }
1995
+ return BaseStatistic;
2027
1996
  }());
2028
1997
 
2029
1998
  var BasketballStatistic = /** @class */ (function (_super) {
@@ -2298,28 +2267,87 @@ var BasketballGameLog = /** @class */ (function (_super) {
2298
2267
  return BasketballGameLog;
2299
2268
  }(BaseModel));
2300
2269
 
2301
- var BasketballGameApi = /** @class */ (function () {
2302
- function BasketballGameApi(httpClient, configService) {
2270
+ var GameUser = /** @class */ (function (_super) {
2271
+ __extends(GameUser, _super);
2272
+ function GameUser() {
2273
+ return _super !== null && _super.apply(this, arguments) || this;
2274
+ }
2275
+ GameUser.toFront = function (data) { };
2276
+ GameUser.toBack = function (data) { };
2277
+ __decorate([
2278
+ ToFrontHook
2279
+ ], GameUser, "toFront", null);
2280
+ __decorate([
2281
+ ToBackHook
2282
+ ], GameUser, "toBack", null);
2283
+ GameUser = __decorate([
2284
+ ModelInstance({
2285
+ mappingFields: {
2286
+ id: 'id',
2287
+ game_id: 'gameId',
2288
+ team_user: 'teamUser',
2289
+ tournament_team_user: 'tournamentTeamUser',
2290
+ is_mvp: 'isMvp',
2291
+ updated_at: 'updatedAt'
2292
+ },
2293
+ relation: {
2294
+ teamUser: TeamUser,
2295
+ tournamentTeamUser: TournamentTeamUser,
2296
+ updatedAt: DateTimeField,
2297
+ }
2298
+ })
2299
+ ], GameUser);
2300
+ return GameUser;
2301
+ }(BaseModel));
2302
+
2303
+ var GameBaseApi = /** @class */ (function () {
2304
+ function GameBaseApi(httpClient, configService) {
2303
2305
  this.httpClient = httpClient;
2304
2306
  this.configService = configService;
2305
2307
  }
2306
- BasketballGameApi.prototype.getById = function (gameId) {
2308
+ GameBaseApi.prototype.getUsers = function (gameId) {
2307
2309
  return __awaiter(this, void 0, void 0, function () {
2308
2310
  return __generator(this, function (_a) {
2309
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_basketball_game/" + gameId + "/").pipe(map(function (result) { return Game.toFront(result); })).toPromise()];
2311
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_game/" + gameId + "/users/").pipe(map(function (result) { return GameUser.toFront(result); })).toPromise()];
2310
2312
  });
2311
2313
  });
2312
2314
  };
2313
- BasketballGameApi.prototype.getUsers = function (gameId) {
2315
+ GameBaseApi.prototype.getMvp = function (gameId) {
2314
2316
  return __awaiter(this, void 0, void 0, function () {
2315
2317
  return __generator(this, function (_a) {
2316
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_game/" + gameId + "/users/").pipe(map(function (result) { return GameUser.toFront(result); })).toPromise()];
2318
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_game/" + gameId + "/mvp/").pipe(map(function (result) { return GameUser.toFront(result); })).toPromise()];
2317
2319
  });
2318
2320
  });
2319
2321
  };
2320
- BasketballGameApi.prototype.getTeamStatistic = function (gameId) {
2321
- return __awaiter(this, void 0, void 0, function () {
2322
- return __generator(this, function (_a) {
2322
+ GameBaseApi.ctorParameters = function () { return [
2323
+ { type: HttpClient },
2324
+ { type: ConfigService }
2325
+ ]; };
2326
+ GameBaseApi.ɵprov = ɵɵdefineInjectable({ factory: function GameBaseApi_Factory() { return new GameBaseApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: GameBaseApi, providedIn: "root" });
2327
+ GameBaseApi = __decorate([
2328
+ Injectable({ providedIn: 'root' })
2329
+ ], GameBaseApi);
2330
+ return GameBaseApi;
2331
+ }());
2332
+
2333
+ var BasketballGameApi = /** @class */ (function (_super) {
2334
+ __extends(BasketballGameApi, _super);
2335
+ function BasketballGameApi(httpClient, configService) {
2336
+ var _this = _super.call(this, httpClient, configService) || this;
2337
+ _this.httpClient = httpClient;
2338
+ _this.configService = configService;
2339
+ return _this;
2340
+ }
2341
+ BasketballGameApi.prototype.getById = function (gameId) {
2342
+ return __awaiter(this, void 0, void 0, function () {
2343
+ return __generator(this, function (_a) {
2344
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_basketball_game/" + gameId + "/").pipe(map(function (result) { return Game.toFront(result); })).toPromise()];
2345
+ });
2346
+ });
2347
+ };
2348
+ BasketballGameApi.prototype.getTeamStatistic = function (gameId) {
2349
+ return __awaiter(this, void 0, void 0, function () {
2350
+ return __generator(this, function (_a) {
2323
2351
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_basketball_game/" + gameId + "/team_statistic/").pipe(map(function (result) { return BasketballGameTeamStatistic.toFront(result); })).toPromise()];
2324
2352
  });
2325
2353
  });
@@ -2363,7 +2391,7 @@ var BasketballGameApi = /** @class */ (function () {
2363
2391
  Injectable({ providedIn: 'root' })
2364
2392
  ], BasketballGameApi);
2365
2393
  return BasketballGameApi;
2366
- }());
2394
+ }(GameBaseApi));
2367
2395
 
2368
2396
  var Feedback = /** @class */ (function () {
2369
2397
  function Feedback() {
@@ -2914,10 +2942,13 @@ var HockeyGameTeamStatistic = /** @class */ (function (_super) {
2914
2942
  return HockeyGameTeamStatistic;
2915
2943
  }(BaseModel));
2916
2944
 
2917
- var HockeyGameApi = /** @class */ (function () {
2945
+ var HockeyGameApi = /** @class */ (function (_super) {
2946
+ __extends(HockeyGameApi, _super);
2918
2947
  function HockeyGameApi(httpClient, configService) {
2919
- this.httpClient = httpClient;
2920
- this.configService = configService;
2948
+ var _this = _super.call(this, httpClient, configService) || this;
2949
+ _this.httpClient = httpClient;
2950
+ _this.configService = configService;
2951
+ return _this;
2921
2952
  }
2922
2953
  HockeyGameApi.prototype.getById = function (gameId) {
2923
2954
  return __awaiter(this, void 0, void 0, function () {
@@ -2926,13 +2957,6 @@ var HockeyGameApi = /** @class */ (function () {
2926
2957
  });
2927
2958
  });
2928
2959
  };
2929
- HockeyGameApi.prototype.getUsers = function (gameId) {
2930
- return __awaiter(this, void 0, void 0, function () {
2931
- return __generator(this, function (_a) {
2932
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_game/" + gameId + "/users/").pipe(map(function (result) { return GameUser.toFront(result); })).toPromise()];
2933
- });
2934
- });
2935
- };
2936
2960
  HockeyGameApi.prototype.getTeamStatistic = function (gameId) {
2937
2961
  return __awaiter(this, void 0, void 0, function () {
2938
2962
  return __generator(this, function (_a) {
@@ -2983,7 +3007,7 @@ var HockeyGameApi = /** @class */ (function () {
2983
3007
  Injectable({ providedIn: 'root' })
2984
3008
  ], HockeyGameApi);
2985
3009
  return HockeyGameApi;
2986
- }());
3010
+ }(GameBaseApi));
2987
3011
 
2988
3012
  var FootballGameLogTypes;
2989
3013
  (function (FootballGameLogTypes) {
@@ -3406,10 +3430,13 @@ var FootballGameTeamStatistic = /** @class */ (function (_super) {
3406
3430
  return FootballGameTeamStatistic;
3407
3431
  }(BaseModel));
3408
3432
 
3409
- var FootballGameApi = /** @class */ (function () {
3433
+ var FootballGameApi = /** @class */ (function (_super) {
3434
+ __extends(FootballGameApi, _super);
3410
3435
  function FootballGameApi(httpClient, configService) {
3411
- this.httpClient = httpClient;
3412
- this.configService = configService;
3436
+ var _this = _super.call(this, httpClient, configService) || this;
3437
+ _this.httpClient = httpClient;
3438
+ _this.configService = configService;
3439
+ return _this;
3413
3440
  }
3414
3441
  FootballGameApi.prototype.getById = function (gameId) {
3415
3442
  return __awaiter(this, void 0, void 0, function () {
@@ -3418,13 +3445,6 @@ var FootballGameApi = /** @class */ (function () {
3418
3445
  });
3419
3446
  });
3420
3447
  };
3421
- FootballGameApi.prototype.getUsers = function (gameId) {
3422
- return __awaiter(this, void 0, void 0, function () {
3423
- return __generator(this, function (_a) {
3424
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_game/" + gameId + "/users/").pipe(map(function (result) { return GameUser.toFront(result); })).toPromise()];
3425
- });
3426
- });
3427
- };
3428
3448
  FootballGameApi.prototype.getTeamStatistic = function (gameId) {
3429
3449
  return __awaiter(this, void 0, void 0, function () {
3430
3450
  return __generator(this, function (_a) {
@@ -3475,170 +3495,928 @@ var FootballGameApi = /** @class */ (function () {
3475
3495
  Injectable({ providedIn: 'root' })
3476
3496
  ], FootballGameApi);
3477
3497
  return FootballGameApi;
3478
- }());
3498
+ }(GameBaseApi));
3479
3499
 
3480
- var LeagueNewsType;
3481
- (function (LeagueNewsType) {
3482
- LeagueNewsType[LeagueNewsType["text"] = 1] = "text";
3483
- LeagueNewsType[LeagueNewsType["video"] = 2] = "video";
3484
- })(LeagueNewsType || (LeagueNewsType = {}));
3485
- var LeagueNews = /** @class */ (function (_super) {
3486
- __extends(LeagueNews, _super);
3487
- function LeagueNews() {
3500
+ var TournamentNews = /** @class */ (function (_super) {
3501
+ __extends(TournamentNews, _super);
3502
+ function TournamentNews() {
3488
3503
  return _super !== null && _super.apply(this, arguments) || this;
3489
3504
  }
3490
- LeagueNews.toFront = function (data) {
3491
- return undefined;
3492
- };
3493
- LeagueNews.toBack = function (data) { };
3505
+ TournamentNews.toFront = function (data) { };
3506
+ TournamentNews.toBack = function (data) { };
3494
3507
  __decorate([
3495
3508
  ToFrontHook
3496
- ], LeagueNews, "toFront", null);
3509
+ ], TournamentNews, "toFront", null);
3497
3510
  __decorate([
3498
3511
  ToBackHook
3499
- ], LeagueNews, "toBack", null);
3500
- LeagueNews = __decorate([
3512
+ ], TournamentNews, "toBack", null);
3513
+ TournamentNews = __decorate([
3501
3514
  ModelInstance({
3502
3515
  mappingFields: {
3503
3516
  id: 'id',
3504
3517
  title: 'title',
3505
- datetime: 'datetime',
3506
- preview_text: 'previewText',
3507
- detail_text: 'detailText',
3508
3518
  picture: 'picture',
3509
- cover: 'cover',
3510
- mobile_picture: 'mobilePicture',
3511
- is_main: 'isMain',
3512
- tournaments: 'tournaments',
3513
- type: 'type',
3514
- video_link: 'videoLink',
3515
- tag: 'tag',
3519
+ text: 'text',
3520
+ author: 'author',
3521
+ created_at: 'createdAt',
3516
3522
  },
3517
3523
  relation: {
3518
- datetime: DateTimeField,
3519
3524
  picture: File,
3520
- cover: File,
3521
- mobilePicture: File,
3522
- tournaments: listField(Tournament),
3523
- type: enumField(LeagueNewsType),
3525
+ author: User,
3526
+ createdAt: DateTimeField,
3524
3527
  }
3525
3528
  })
3526
- ], LeagueNews);
3527
- return LeagueNews;
3529
+ ], TournamentNews);
3530
+ return TournamentNews;
3528
3531
  }(BaseModel));
3529
3532
 
3530
- var TournamentEventTypes;
3531
- (function (TournamentEventTypes) {
3532
- TournamentEventTypes[TournamentEventTypes["game_closed"] = 1] = "game_closed";
3533
- TournamentEventTypes[TournamentEventTypes["media_added"] = 2] = "media_added";
3534
- TournamentEventTypes[TournamentEventTypes["news"] = 3] = "news";
3535
- })(TournamentEventTypes || (TournamentEventTypes = {}));
3536
- var TournamentEvent = /** @class */ (function (_super) {
3537
- __extends(TournamentEvent, _super);
3538
- function TournamentEvent() {
3533
+ var GameTimelineStageItem = /** @class */ (function () {
3534
+ function GameTimelineStageItem() {
3535
+ }
3536
+ GameTimelineStageItem.toFront = function (data) { };
3537
+ GameTimelineStageItem.toBack = function (data) { };
3538
+ __decorate([
3539
+ ToFrontHook
3540
+ ], GameTimelineStageItem, "toFront", null);
3541
+ __decorate([
3542
+ ToBackHook
3543
+ ], GameTimelineStageItem, "toBack", null);
3544
+ GameTimelineStageItem = __decorate([
3545
+ ModelInstance({
3546
+ mappingFields: {
3547
+ stage_id: 'stageId',
3548
+ tours_count: 'toursCount',
3549
+ playoff_stages_count: 'playoffStagesCount',
3550
+ }
3551
+ })
3552
+ ], GameTimelineStageItem);
3553
+ return GameTimelineStageItem;
3554
+ }());
3555
+ var GameTimelineStages = /** @class */ (function (_super) {
3556
+ __extends(GameTimelineStages, _super);
3557
+ function GameTimelineStages() {
3539
3558
  return _super !== null && _super.apply(this, arguments) || this;
3540
3559
  }
3541
- TournamentEvent.toFront = function (data) { };
3542
- TournamentEvent.toBack = function (data) { };
3560
+ GameTimelineStages.toFront = function (data) { };
3561
+ GameTimelineStages.toBack = function (data) { };
3543
3562
  __decorate([
3544
3563
  ToFrontHook
3545
- ], TournamentEvent, "toFront", null);
3564
+ ], GameTimelineStages, "toFront", null);
3546
3565
  __decorate([
3547
3566
  ToBackHook
3548
- ], TournamentEvent, "toBack", null);
3549
- TournamentEvent = __decorate([
3567
+ ], GameTimelineStages, "toBack", null);
3568
+ GameTimelineStages = __decorate([
3550
3569
  ModelInstance({
3551
3570
  mappingFields: {
3552
- id: 'id',
3553
- game: 'game',
3554
- news: 'news',
3555
- league: 'league',
3556
- tournaments: 'tournaments',
3557
- event: 'event',
3558
- datetime: 'datetime'
3571
+ tours_count: 'toursCount',
3572
+ playoff_stages_count: 'playoffStagesCount',
3573
+ current_tour: 'currentTour',
3574
+ current_playoff_stage: 'currentPlayoffStage',
3575
+ stages: 'stages',
3576
+ tournament_stage_id: 'tournamentStageId',
3559
3577
  },
3560
3578
  relation: {
3561
- game: Game,
3562
- news: LeagueNews,
3563
- league: League,
3564
- tournaments: listField(Tournament),
3565
- datetime: DateField,
3566
- event: enumField(TournamentEventTypes)
3579
+ stages: listField(GameTimelineStageItem)
3567
3580
  }
3568
3581
  })
3569
- ], TournamentEvent);
3570
- return TournamentEvent;
3582
+ ], GameTimelineStages);
3583
+ return GameTimelineStages;
3571
3584
  }(BaseModel));
3572
3585
 
3573
- var LeaguePartner = /** @class */ (function (_super) {
3574
- __extends(LeaguePartner, _super);
3575
- function LeaguePartner() {
3586
+ var TournamentStageStatuses;
3587
+ (function (TournamentStageStatuses) {
3588
+ TournamentStageStatuses[TournamentStageStatuses["open"] = 0] = "open";
3589
+ TournamentStageStatuses[TournamentStageStatuses["in_progress"] = 1] = "in_progress";
3590
+ TournamentStageStatuses[TournamentStageStatuses["closed"] = 2] = "closed";
3591
+ })(TournamentStageStatuses || (TournamentStageStatuses = {}));
3592
+ var TournamentStage = /** @class */ (function (_super) {
3593
+ __extends(TournamentStage, _super);
3594
+ function TournamentStage() {
3576
3595
  return _super !== null && _super.apply(this, arguments) || this;
3577
3596
  }
3578
- LeaguePartner.toFront = function (data) { };
3579
- LeaguePartner.toBack = function (data) { };
3597
+ TournamentStage.toFront = function (data) { };
3598
+ TournamentStage.toBack = function (data) { };
3580
3599
  __decorate([
3581
3600
  ToFrontHook
3582
- ], LeaguePartner, "toFront", null);
3601
+ ], TournamentStage, "toFront", null);
3583
3602
  __decorate([
3584
3603
  ToBackHook
3585
- ], LeaguePartner, "toBack", null);
3586
- LeaguePartner = __decorate([
3604
+ ], TournamentStage, "toBack", null);
3605
+ TournamentStage = __decorate([
3587
3606
  ModelInstance({
3588
3607
  mappingFields: {
3589
3608
  id: 'id',
3590
- title: 'title',
3591
- picture: 'picture',
3592
- link: 'link',
3593
- sort: 'sort',
3609
+ name: 'name',
3610
+ date: 'date',
3611
+ tournament_id: 'tournamentId',
3612
+ status: 'status',
3594
3613
  },
3595
3614
  relation: {
3596
- picture: File
3615
+ date: DateField,
3616
+ status: enumField(TournamentStageStatuses)
3597
3617
  }
3598
3618
  })
3599
- ], LeaguePartner);
3600
- return LeaguePartner;
3619
+ ], TournamentStage);
3620
+ return TournamentStage;
3601
3621
  }(BaseModel));
3602
3622
 
3603
- var BannerLocation;
3604
- (function (BannerLocation) {
3605
- BannerLocation["slider"] = "slider";
3606
- BannerLocation["central"] = "central";
3607
- BannerLocation["media"] = "media";
3608
- })(BannerLocation || (BannerLocation = {}));
3609
- var LeagueBanner = /** @class */ (function (_super) {
3610
- __extends(LeagueBanner, _super);
3611
- function LeagueBanner() {
3623
+ function generateArray(length) {
3624
+ if (length <= 0) {
3625
+ return [];
3626
+ }
3627
+ return Array.apply(null, Array(length)).map(function (_, i) { return i + 1; });
3628
+ }
3629
+ function getArrayChunks(array, length) {
3630
+ var chunks = [];
3631
+ var chunkLength = Math.ceil(array.length / length);
3632
+ if (chunkLength === 0) {
3633
+ return [array];
3634
+ }
3635
+ for (var i = 0; i < chunkLength; i++) {
3636
+ chunks.push(array.slice(i * length, (i + 1) * length));
3637
+ }
3638
+ return chunks;
3639
+ }
3640
+
3641
+ var PlayoffTypes;
3642
+ (function (PlayoffTypes) {
3643
+ PlayoffTypes["double_elimination"] = "double_elimination";
3644
+ PlayoffTypes["elimination"] = "elimination";
3645
+ })(PlayoffTypes || (PlayoffTypes = {}));
3646
+ var PlayoffSettings = /** @class */ (function (_super) {
3647
+ __extends(PlayoffSettings, _super);
3648
+ function PlayoffSettings() {
3612
3649
  return _super !== null && _super.apply(this, arguments) || this;
3613
3650
  }
3614
- LeagueBanner.toFront = function (data) {
3615
- };
3616
- LeagueBanner.toBack = function (data) {
3617
- };
3651
+ PlayoffSettings.toFront = function (data) { };
3652
+ PlayoffSettings.toBack = function (data) { };
3618
3653
  __decorate([
3619
3654
  ToFrontHook
3620
- ], LeagueBanner, "toFront", null);
3655
+ ], PlayoffSettings, "toFront", null);
3621
3656
  __decorate([
3622
3657
  ToBackHook
3623
- ], LeagueBanner, "toBack", null);
3624
- LeagueBanner = __decorate([
3658
+ ], PlayoffSettings, "toBack", null);
3659
+ PlayoffSettings = __decorate([
3625
3660
  ModelInstance({
3626
3661
  mappingFields: {
3627
- id: 'id',
3628
- title: 'title',
3629
- picture: 'picture',
3630
- link: 'link',
3631
- sort: 'sort',
3632
- location: 'location',
3662
+ rounds: 'rounds',
3663
+ final_rounds: 'finalRounds',
3664
+ third_place_rounds: 'thirdPlaceRounds',
3665
+ teams_count: 'teamsCount',
3666
+ type: 'type',
3633
3667
  },
3634
3668
  relation: {
3635
- picture: File,
3636
- location: enumField(BannerLocation),
3669
+ type: enumField(PlayoffTypes)
3637
3670
  }
3638
3671
  })
3639
- ], LeagueBanner);
3640
- return LeagueBanner;
3641
- }(BaseModel));
3672
+ ], PlayoffSettings);
3673
+ return PlayoffSettings;
3674
+ }(BaseModel));
3675
+ var Playoff = /** @class */ (function (_super) {
3676
+ __extends(Playoff, _super);
3677
+ function Playoff() {
3678
+ var _this = _super !== null && _super.apply(this, arguments) || this;
3679
+ _this.stages = [];
3680
+ return _this;
3681
+ }
3682
+ Playoff.toFront = function (data) { };
3683
+ Playoff.toBack = function (data) { };
3684
+ Object.defineProperty(Playoff.prototype, "stagesCount", {
3685
+ get: function () {
3686
+ return Math.log(this.settings.teamsCount) / Math.log(2);
3687
+ },
3688
+ enumerable: true,
3689
+ configurable: true
3690
+ });
3691
+ Playoff.prototype.getPlayoffStages = function () {
3692
+ var _this = this;
3693
+ if (this.stages.length === 0 && this.settings.teamsCount) {
3694
+ var stagesCount = Math.log(this.settings.teamsCount) / Math.log(2);
3695
+ this.stages = generateArray(stagesCount).map(function (stage) {
3696
+ var playoffStage = _this.settings.teamsCount / Math.pow(2, stage);
3697
+ var title = '';
3698
+ if (playoffStage === 1) {
3699
+ title = 'Финал';
3700
+ }
3701
+ else {
3702
+ title = "1 / " + playoffStage;
3703
+ }
3704
+ return {
3705
+ value: stage,
3706
+ title: title
3707
+ };
3708
+ });
3709
+ }
3710
+ return this.stages;
3711
+ };
3712
+ __decorate([
3713
+ ToFrontHook
3714
+ ], Playoff, "toFront", null);
3715
+ __decorate([
3716
+ ToBackHook
3717
+ ], Playoff, "toBack", null);
3718
+ Playoff = __decorate([
3719
+ ModelInstance({
3720
+ mappingFields: {
3721
+ id: 'id',
3722
+ name: 'name',
3723
+ settings: 'settings',
3724
+ tournament_id: 'tournamentId',
3725
+ tournament_stage_id: 'tournamentStageId',
3726
+ is_official: 'isOfficial'
3727
+ },
3728
+ relation: {
3729
+ settings: PlayoffSettings
3730
+ }
3731
+ })
3732
+ ], Playoff);
3733
+ return Playoff;
3734
+ }(BaseModel));
3735
+
3736
+ var VolleyballStatistic = /** @class */ (function (_super) {
3737
+ __extends(VolleyballStatistic, _super);
3738
+ function VolleyballStatistic() {
3739
+ return _super !== null && _super.apply(this, arguments) || this;
3740
+ }
3741
+ VolleyballStatistic.toFront = function (data) { };
3742
+ VolleyballStatistic.toBack = function (data) { };
3743
+ __decorate([
3744
+ ToFrontHook
3745
+ ], VolleyballStatistic, "toFront", null);
3746
+ __decorate([
3747
+ ToBackHook
3748
+ ], VolleyballStatistic, "toBack", null);
3749
+ VolleyballStatistic = __decorate([
3750
+ ModelInstance({
3751
+ mappingFields: {
3752
+ team: 'team',
3753
+ team_user: 'teamUser',
3754
+ tournament_team_user: 'tournamentTeamUser',
3755
+ tournament_team: 'tournamentTeam',
3756
+ user: 'user',
3757
+ month: 'month',
3758
+ win_lose: 'winLose',
3759
+ games_count: 'gamesCount',
3760
+ won_games_count: 'wonGamesCount',
3761
+ serve_hits: 'serveHits',
3762
+ serve_faults: 'serveFaults',
3763
+ serve_aces: 'serveAces',
3764
+ serve_percent: 'servePercent',
3765
+ ace_percent: 'acePercent',
3766
+ stuff_blocks: 'stuffBlocks',
3767
+ block_faults: 'blockFaults',
3768
+ block_rebounds: 'blockRebounds',
3769
+ block_percent: 'blockPercent',
3770
+ attack_spikes: 'attackSpikes',
3771
+ attack_faults: 'attackFaults',
3772
+ attack_shots: 'attackShots',
3773
+ attack_percent: 'attackPercent',
3774
+ receives: 'receives',
3775
+ receive_faults: 'receiveFaults',
3776
+ excellent_receives: 'excellentReceives',
3777
+ receive_percent: 'receivePercent',
3778
+ serve_receives: 'serveReceives',
3779
+ serve_receive_faults: 'serveReceiveFaults',
3780
+ excellent_serve_receives: 'excellentServeReceives',
3781
+ serve_receive_percent: 'serveReceivePercent',
3782
+ points: 'points',
3783
+ faults: 'faults',
3784
+ newbie: 'newbie',
3785
+ },
3786
+ relation: {
3787
+ team: Team,
3788
+ teamUser: TeamUser,
3789
+ tournamentTeamUser: TournamentTeamUser,
3790
+ tournamentTeam: TournamentTeam,
3791
+ user: User,
3792
+ month: DateField,
3793
+ }
3794
+ })
3795
+ ], VolleyballStatistic);
3796
+ return VolleyballStatistic;
3797
+ }(BaseStatistic));
3798
+
3799
+ var TournamentStageTeam = /** @class */ (function (_super) {
3800
+ __extends(TournamentStageTeam, _super);
3801
+ function TournamentStageTeam() {
3802
+ return _super !== null && _super.apply(this, arguments) || this;
3803
+ }
3804
+ Object.defineProperty(TournamentStageTeam.prototype, "gamesWonPercent", {
3805
+ get: function () {
3806
+ if (!this.gamesCount) {
3807
+ return 0;
3808
+ }
3809
+ return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
3810
+ },
3811
+ enumerable: true,
3812
+ configurable: true
3813
+ });
3814
+ TournamentStageTeam.toFront = function (data) { };
3815
+ TournamentStageTeam.toBack = function (data) { };
3816
+ __decorate([
3817
+ ToFrontHook
3818
+ ], TournamentStageTeam, "toFront", null);
3819
+ __decorate([
3820
+ ToBackHook
3821
+ ], TournamentStageTeam, "toBack", null);
3822
+ TournamentStageTeam = __decorate([
3823
+ ModelInstance({
3824
+ mappingFields: {
3825
+ id: 'id',
3826
+ tournament_team: 'tournamentTeam',
3827
+ group: 'group',
3828
+ tournament_stage_id: 'tournamentStageId',
3829
+ games_count: 'gamesCount',
3830
+ won_games_count: 'wonGamesCount',
3831
+ score_sum: 'scoreSum',
3832
+ missed_sum: 'missedSum',
3833
+ last_games_count: 'lastGamesCount',
3834
+ last_games_won: 'lastGamesWon',
3835
+ points: 'points',
3836
+ final_standing: 'finalStanding',
3837
+ received_points: 'receivedPoints',
3838
+ },
3839
+ relation: {
3840
+ tournamentTeam: TournamentTeam,
3841
+ group: TournamentGroup
3842
+ }
3843
+ })
3844
+ ], TournamentStageTeam);
3845
+ return TournamentStageTeam;
3846
+ }(BaseModel));
3847
+
3848
+ var LeagueNewsType;
3849
+ (function (LeagueNewsType) {
3850
+ LeagueNewsType[LeagueNewsType["text"] = 1] = "text";
3851
+ LeagueNewsType[LeagueNewsType["video"] = 2] = "video";
3852
+ })(LeagueNewsType || (LeagueNewsType = {}));
3853
+ var LeagueNews = /** @class */ (function (_super) {
3854
+ __extends(LeagueNews, _super);
3855
+ function LeagueNews() {
3856
+ return _super !== null && _super.apply(this, arguments) || this;
3857
+ }
3858
+ LeagueNews.toFront = function (data) {
3859
+ return undefined;
3860
+ };
3861
+ LeagueNews.toBack = function (data) { };
3862
+ __decorate([
3863
+ ToFrontHook
3864
+ ], LeagueNews, "toFront", null);
3865
+ __decorate([
3866
+ ToBackHook
3867
+ ], LeagueNews, "toBack", null);
3868
+ LeagueNews = __decorate([
3869
+ ModelInstance({
3870
+ mappingFields: {
3871
+ id: 'id',
3872
+ title: 'title',
3873
+ datetime: 'datetime',
3874
+ preview_text: 'previewText',
3875
+ detail_text: 'detailText',
3876
+ picture: 'picture',
3877
+ cover: 'cover',
3878
+ mobile_picture: 'mobilePicture',
3879
+ is_main: 'isMain',
3880
+ tournaments: 'tournaments',
3881
+ type: 'type',
3882
+ video_link: 'videoLink',
3883
+ tag: 'tag',
3884
+ },
3885
+ relation: {
3886
+ datetime: DateTimeField,
3887
+ picture: File,
3888
+ cover: File,
3889
+ mobilePicture: File,
3890
+ tournaments: listField(Tournament),
3891
+ type: enumField(LeagueNewsType),
3892
+ }
3893
+ })
3894
+ ], LeagueNews);
3895
+ return LeagueNews;
3896
+ }(BaseModel));
3897
+
3898
+ var TournamentEventTypes;
3899
+ (function (TournamentEventTypes) {
3900
+ TournamentEventTypes[TournamentEventTypes["game_closed"] = 1] = "game_closed";
3901
+ TournamentEventTypes[TournamentEventTypes["media_added"] = 2] = "media_added";
3902
+ TournamentEventTypes[TournamentEventTypes["news"] = 3] = "news";
3903
+ })(TournamentEventTypes || (TournamentEventTypes = {}));
3904
+ var TournamentEvent = /** @class */ (function (_super) {
3905
+ __extends(TournamentEvent, _super);
3906
+ function TournamentEvent() {
3907
+ return _super !== null && _super.apply(this, arguments) || this;
3908
+ }
3909
+ TournamentEvent.toFront = function (data) { };
3910
+ TournamentEvent.toBack = function (data) { };
3911
+ __decorate([
3912
+ ToFrontHook
3913
+ ], TournamentEvent, "toFront", null);
3914
+ __decorate([
3915
+ ToBackHook
3916
+ ], TournamentEvent, "toBack", null);
3917
+ TournamentEvent = __decorate([
3918
+ ModelInstance({
3919
+ mappingFields: {
3920
+ id: 'id',
3921
+ game: 'game',
3922
+ news: 'news',
3923
+ league: 'league',
3924
+ tournaments: 'tournaments',
3925
+ event: 'event',
3926
+ datetime: 'datetime'
3927
+ },
3928
+ relation: {
3929
+ game: Game,
3930
+ news: LeagueNews,
3931
+ league: League,
3932
+ tournaments: listField(Tournament),
3933
+ datetime: DateField,
3934
+ event: enumField(TournamentEventTypes)
3935
+ }
3936
+ })
3937
+ ], TournamentEvent);
3938
+ return TournamentEvent;
3939
+ }(BaseModel));
3940
+
3941
+ var LeagueUserRoles;
3942
+ (function (LeagueUserRoles) {
3943
+ LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
3944
+ LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
3945
+ LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
3946
+ })(LeagueUserRoles || (LeagueUserRoles = {}));
3947
+ var LeagueUserPermissions;
3948
+ (function (LeagueUserPermissions) {
3949
+ LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
3950
+ LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
3951
+ LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
3952
+ LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
3953
+ LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
3954
+ LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
3955
+ LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
3956
+ LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
3957
+ })(LeagueUserPermissions || (LeagueUserPermissions = {}));
3958
+ var LeagueUser = /** @class */ (function (_super) {
3959
+ __extends(LeagueUser, _super);
3960
+ function LeagueUser() {
3961
+ return _super !== null && _super.apply(this, arguments) || this;
3962
+ }
3963
+ Object.defineProperty(LeagueUser.prototype, "role", {
3964
+ get: function () {
3965
+ return this._role;
3966
+ },
3967
+ set: function (value) {
3968
+ this._role = LeagueUserRoles[value];
3969
+ },
3970
+ enumerable: true,
3971
+ configurable: true
3972
+ });
3973
+ LeagueUser.toFront = function (data) { };
3974
+ LeagueUser.toBack = function (data) { };
3975
+ __decorate([
3976
+ ToFrontHook
3977
+ ], LeagueUser, "toFront", null);
3978
+ __decorate([
3979
+ ToBackHook
3980
+ ], LeagueUser, "toBack", null);
3981
+ LeagueUser = __decorate([
3982
+ ModelInstance({
3983
+ mappingFields: {
3984
+ id: 'id',
3985
+ user: 'user',
3986
+ role: 'role',
3987
+ permissions: 'permissions'
3988
+ },
3989
+ relation: {
3990
+ user: User,
3991
+ permissions: listField(enumField(LeagueUserPermissions))
3992
+ }
3993
+ })
3994
+ ], LeagueUser);
3995
+ return LeagueUser;
3996
+ }(BaseModel));
3997
+
3998
+ var TournamentApi = /** @class */ (function () {
3999
+ function TournamentApi(httpClient, configService) {
4000
+ this.httpClient = httpClient;
4001
+ this.configService = configService;
4002
+ }
4003
+ TournamentApi.prototype.getById = function (tournamentId) {
4004
+ return __awaiter(this, void 0, void 0, function () {
4005
+ return __generator(this, function (_a) {
4006
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/")
4007
+ .pipe(map(function (result) { return Tournament.toFront(result); }))
4008
+ .toPromise()];
4009
+ });
4010
+ });
4011
+ };
4012
+ TournamentApi.prototype.getByAlias = function (leagueId, alias) {
4013
+ return __awaiter(this, void 0, void 0, function () {
4014
+ return __generator(this, function (_a) {
4015
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/" + alias + "/")
4016
+ .pipe(map(function (result) { return Tournament.toFront(result); }))
4017
+ .toPromise()];
4018
+ });
4019
+ });
4020
+ };
4021
+ TournamentApi.prototype.getNews = function (tournamentId) {
4022
+ return __awaiter(this, void 0, void 0, function () {
4023
+ return __generator(this, function (_a) {
4024
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/news/")
4025
+ .pipe(map(function (result) { return TournamentNews.toFront(result); }))
4026
+ .toPromise()];
4027
+ });
4028
+ });
4029
+ };
4030
+ TournamentApi.prototype.getEvents = function (tournamentId, page, size, filters) {
4031
+ return __awaiter(this, void 0, void 0, function () {
4032
+ var params;
4033
+ return __generator(this, function (_a) {
4034
+ params = new HttpParams().set('page', page.toString())
4035
+ .set('size', size.toString());
4036
+ if (filters) {
4037
+ if (filters.event) {
4038
+ params = params.set('event', TournamentEventTypes[filters.event]);
4039
+ }
4040
+ if (filters.search) {
4041
+ params = params.set('search', filters.search);
4042
+ }
4043
+ if (filters.tournamentTour) {
4044
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
4045
+ }
4046
+ }
4047
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/events/", { params: params, observe: 'response' })
4048
+ .pipe(map(function (result) { return ({
4049
+ total: +result.headers.get('X-Page-Count'),
4050
+ data: TournamentEvent.toFront(result.body)
4051
+ }); }))
4052
+ .toPromise()];
4053
+ });
4054
+ });
4055
+ };
4056
+ TournamentApi.prototype.getTournamentStages = function (tournamentId) {
4057
+ return __awaiter(this, void 0, void 0, function () {
4058
+ return __generator(this, function (_a) {
4059
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/stages/").pipe(map(function (data) { return TournamentStage.toFront(data); })).toPromise()];
4060
+ });
4061
+ });
4062
+ };
4063
+ TournamentApi.prototype.getPlayoff = function (tournamentId) {
4064
+ return __awaiter(this, void 0, void 0, function () {
4065
+ return __generator(this, function (_a) {
4066
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/playoff/").pipe(map(function (result) { return Playoff.toFront(result); })).toPromise()];
4067
+ });
4068
+ });
4069
+ };
4070
+ TournamentApi.prototype.getPlayoffGames = function (playoffId) {
4071
+ return __awaiter(this, void 0, void 0, function () {
4072
+ return __generator(this, function (_a) {
4073
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_playoff/" + playoffId + "/games/").pipe(map(function (result) { return Game.toFront(result); })).toPromise()];
4074
+ });
4075
+ });
4076
+ };
4077
+ TournamentApi.prototype.getGamesStages = function (tournamentId) {
4078
+ return __awaiter(this, void 0, void 0, function () {
4079
+ return __generator(this, function (_a) {
4080
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games_stages/")
4081
+ .pipe(map(function (data) { return GameTimelineStages.toFront(data); }))
4082
+ .toPromise()];
4083
+ });
4084
+ });
4085
+ };
4086
+ TournamentApi.prototype.getGames = function (tournamentId, page, size, filters) {
4087
+ if (filters === void 0) { filters = {}; }
4088
+ return __awaiter(this, void 0, void 0, function () {
4089
+ var params;
4090
+ return __generator(this, function (_a) {
4091
+ params = new HttpParams().set('page', page.toString());
4092
+ if (size) {
4093
+ params = params.set('size', size.toString());
4094
+ }
4095
+ params = applyGamesFilters(filters, params);
4096
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games/", { params: params, observe: 'response' })
4097
+ .pipe(map(function (result) { return ({
4098
+ total: +result.headers.get('X-Page-Count'),
4099
+ data: Game.toFront(result.body)
4100
+ }); })).toPromise()];
4101
+ });
4102
+ });
4103
+ };
4104
+ TournamentApi.prototype.getTeams = function (tournamentId) {
4105
+ return __awaiter(this, void 0, void 0, function () {
4106
+ return __generator(this, function (_a) {
4107
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/teams/")
4108
+ .pipe(map(function (result) { return TournamentTeam.toFront(result); }))
4109
+ .toPromise()];
4110
+ });
4111
+ });
4112
+ };
4113
+ TournamentApi.prototype.getStageTeams = function (tournamentId) {
4114
+ return __awaiter(this, void 0, void 0, function () {
4115
+ return __generator(this, function (_a) {
4116
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/stage_teams/")
4117
+ .pipe(map(function (result) { return TournamentStageTeam.toFront(result); }))
4118
+ .toPromise()];
4119
+ });
4120
+ });
4121
+ };
4122
+ TournamentApi.prototype.getTeamById = function (tournamentTeamId) {
4123
+ return __awaiter(this, void 0, void 0, function () {
4124
+ return __generator(this, function (_a) {
4125
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/")
4126
+ .pipe(map(function (result) { return TournamentTeam.toFront(result); }))
4127
+ .toPromise()];
4128
+ });
4129
+ });
4130
+ };
4131
+ TournamentApi.prototype.getUserById = function (userId) {
4132
+ return __awaiter(this, void 0, void 0, function () {
4133
+ return __generator(this, function (_a) {
4134
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team_user/" + userId + "/")
4135
+ .pipe(map(function (result) { return TournamentTeamUser.toFront(result); }))
4136
+ .toPromise()];
4137
+ });
4138
+ });
4139
+ };
4140
+ TournamentApi.prototype.getUserGames = function (tournamentUserId) {
4141
+ return __awaiter(this, void 0, void 0, function () {
4142
+ return __generator(this, function (_a) {
4143
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team_user/" + tournamentUserId + "/games/")
4144
+ .pipe(map(function (result) { return Game.toFront(result); }))
4145
+ .toPromise()];
4146
+ });
4147
+ });
4148
+ };
4149
+ TournamentApi.prototype.getBasketballStatistic = function (filters) {
4150
+ return __awaiter(this, void 0, void 0, function () {
4151
+ var params, _a, _b, key;
4152
+ var e_1, _c;
4153
+ return __generator(this, function (_d) {
4154
+ params = new HttpParams();
4155
+ if (filters) {
4156
+ try {
4157
+ for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
4158
+ key = _b.value;
4159
+ if (filters[key]) {
4160
+ params = params.set(key, filters[key]);
4161
+ }
4162
+ }
4163
+ }
4164
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
4165
+ finally {
4166
+ try {
4167
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
4168
+ }
4169
+ finally { if (e_1) throw e_1.error; }
4170
+ }
4171
+ if (filters.per_game !== undefined) {
4172
+ params = params.set('per_game', filters.per_game ? '1' : '0');
4173
+ }
4174
+ if (filters.tournament_ids) {
4175
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
4176
+ }
4177
+ }
4178
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", { params: params }).pipe(map(function (result) { return BasketballStatistic.toFront(result); })).toPromise()];
4179
+ });
4180
+ });
4181
+ };
4182
+ TournamentApi.prototype.getVolleyballStatistic = function (filters) {
4183
+ return __awaiter(this, void 0, void 0, function () {
4184
+ var params, _a, _b, key;
4185
+ var e_2, _c;
4186
+ return __generator(this, function (_d) {
4187
+ params = new HttpParams();
4188
+ if (filters) {
4189
+ try {
4190
+ for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
4191
+ key = _b.value;
4192
+ if (filters[key]) {
4193
+ params = params.set(key, filters[key]);
4194
+ }
4195
+ }
4196
+ }
4197
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
4198
+ finally {
4199
+ try {
4200
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
4201
+ }
4202
+ finally { if (e_2) throw e_2.error; }
4203
+ }
4204
+ if (filters.per_game !== undefined) {
4205
+ params = params.set('per_game', filters.per_game ? '1' : '0');
4206
+ }
4207
+ if (filters.tournament_ids) {
4208
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
4209
+ }
4210
+ }
4211
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", { params: params }).pipe(map(function (result) { return VolleyballStatistic.toFront(result); })).toPromise()];
4212
+ });
4213
+ });
4214
+ };
4215
+ TournamentApi.prototype.getHockeyStatistic = function (filters) {
4216
+ return __awaiter(this, void 0, void 0, function () {
4217
+ var params, _a, _b, key;
4218
+ var e_3, _c;
4219
+ return __generator(this, function (_d) {
4220
+ params = new HttpParams();
4221
+ if (filters) {
4222
+ try {
4223
+ for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
4224
+ key = _b.value;
4225
+ if (filters[key]) {
4226
+ params = params.set(key, filters[key]);
4227
+ }
4228
+ }
4229
+ }
4230
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
4231
+ finally {
4232
+ try {
4233
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
4234
+ }
4235
+ finally { if (e_3) throw e_3.error; }
4236
+ }
4237
+ if (filters.per_game !== undefined) {
4238
+ params = params.set('per_game', filters.per_game ? '1' : '0');
4239
+ }
4240
+ if (filters.tournament_ids) {
4241
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
4242
+ }
4243
+ }
4244
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", { params: params }).pipe(map(function (result) { return HockeyStatistic.toFront(result); })).toPromise()];
4245
+ });
4246
+ });
4247
+ };
4248
+ TournamentApi.prototype.getFootballStatistic = function (filters) {
4249
+ return __awaiter(this, void 0, void 0, function () {
4250
+ var params, _a, _b, key;
4251
+ var e_4, _c;
4252
+ return __generator(this, function (_d) {
4253
+ params = new HttpParams();
4254
+ if (filters) {
4255
+ try {
4256
+ for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
4257
+ key = _b.value;
4258
+ if (filters[key]) {
4259
+ params = params.set(key, filters[key]);
4260
+ }
4261
+ }
4262
+ }
4263
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
4264
+ finally {
4265
+ try {
4266
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
4267
+ }
4268
+ finally { if (e_4) throw e_4.error; }
4269
+ }
4270
+ if (filters.per_game !== undefined) {
4271
+ params = params.set('per_game', filters.per_game ? '1' : '0');
4272
+ }
4273
+ if (filters.tournament_ids) {
4274
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
4275
+ }
4276
+ }
4277
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic/", { params: params }).pipe(map(function (result) { return FootballStatistic.toFront(result); })).toPromise()];
4278
+ });
4279
+ });
4280
+ };
4281
+ TournamentApi.prototype.getTournamentTeamUsers = function (tournamentTeamId) {
4282
+ return __awaiter(this, void 0, void 0, function () {
4283
+ return __generator(this, function (_a) {
4284
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/users/").pipe(map(function (result) { return TournamentTeamUser.toFront(result); })).toPromise()];
4285
+ });
4286
+ });
4287
+ };
4288
+ TournamentApi.prototype.myPermission = function (tournamentId) {
4289
+ return __awaiter(this, void 0, void 0, function () {
4290
+ return __generator(this, function (_a) {
4291
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/permission/").pipe(map(function (data) { return (data.permissions || []).map(function (item) { return LeagueUserPermissions[item]; }); })).toPromise()];
4292
+ });
4293
+ });
4294
+ };
4295
+ TournamentApi.prototype.getTournamentTeamTournaments = function (tournamentTeamId) {
4296
+ return __awaiter(this, void 0, void 0, function () {
4297
+ return __generator(this, function (_a) {
4298
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/tournaments/").pipe(map(function (result) { return Tournament.toFront(result); })).toPromise()];
4299
+ });
4300
+ });
4301
+ };
4302
+ TournamentApi.prototype.getTournamentUserTournaments = function (tournamentTeamUserId) {
4303
+ return __awaiter(this, void 0, void 0, function () {
4304
+ return __generator(this, function (_a) {
4305
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team_user/" + tournamentTeamUserId + "/tournaments/").pipe(map(function (result) { return Tournament.toFront(result); })).toPromise()];
4306
+ });
4307
+ });
4308
+ };
4309
+ TournamentApi.ctorParameters = function () { return [
4310
+ { type: HttpClient },
4311
+ { type: ConfigService }
4312
+ ]; };
4313
+ TournamentApi.ɵprov = ɵɵdefineInjectable({ factory: function TournamentApi_Factory() { return new TournamentApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TournamentApi, providedIn: "root" });
4314
+ TournamentApi = __decorate([
4315
+ Injectable({ providedIn: 'root' })
4316
+ ], TournamentApi);
4317
+ return TournamentApi;
4318
+ }());
4319
+ function applyGamesFilters(filters, params) {
4320
+ if (filters.tournamentIds) {
4321
+ params = params.set('tournament_ids', filters.tournamentIds.join(','));
4322
+ }
4323
+ if (filters.tournamentStageId) {
4324
+ params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
4325
+ }
4326
+ if (filters.tournamentTour) {
4327
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
4328
+ }
4329
+ if (filters.playoffStage) {
4330
+ params = params.set('playoff_stage', filters.playoffStage.toString());
4331
+ }
4332
+ if (filters.teamId) {
4333
+ params = params.set('team_id', filters.teamId.toString());
4334
+ }
4335
+ if (filters.status) {
4336
+ params = params.set('status', GameStatuses[filters.status]);
4337
+ }
4338
+ if (filters.statuses) {
4339
+ var statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
4340
+ params = params.set('statuses', statuses.join(','));
4341
+ }
4342
+ if (filters.tournamentCourtId) {
4343
+ params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
4344
+ }
4345
+ if (filters.userId) {
4346
+ params = params.set('user_id', filters.userId.toString());
4347
+ }
4348
+ return params;
4349
+ }
4350
+
4351
+ var LeaguePartner = /** @class */ (function (_super) {
4352
+ __extends(LeaguePartner, _super);
4353
+ function LeaguePartner() {
4354
+ return _super !== null && _super.apply(this, arguments) || this;
4355
+ }
4356
+ LeaguePartner.toFront = function (data) { };
4357
+ LeaguePartner.toBack = function (data) { };
4358
+ __decorate([
4359
+ ToFrontHook
4360
+ ], LeaguePartner, "toFront", null);
4361
+ __decorate([
4362
+ ToBackHook
4363
+ ], LeaguePartner, "toBack", null);
4364
+ LeaguePartner = __decorate([
4365
+ ModelInstance({
4366
+ mappingFields: {
4367
+ id: 'id',
4368
+ title: 'title',
4369
+ picture: 'picture',
4370
+ link: 'link',
4371
+ sort: 'sort',
4372
+ },
4373
+ relation: {
4374
+ picture: File
4375
+ }
4376
+ })
4377
+ ], LeaguePartner);
4378
+ return LeaguePartner;
4379
+ }(BaseModel));
4380
+
4381
+ var BannerLocation;
4382
+ (function (BannerLocation) {
4383
+ BannerLocation["slider"] = "slider";
4384
+ BannerLocation["central"] = "central";
4385
+ BannerLocation["media"] = "media";
4386
+ })(BannerLocation || (BannerLocation = {}));
4387
+ var LeagueBanner = /** @class */ (function (_super) {
4388
+ __extends(LeagueBanner, _super);
4389
+ function LeagueBanner() {
4390
+ return _super !== null && _super.apply(this, arguments) || this;
4391
+ }
4392
+ LeagueBanner.toFront = function (data) {
4393
+ };
4394
+ LeagueBanner.toBack = function (data) {
4395
+ };
4396
+ __decorate([
4397
+ ToFrontHook
4398
+ ], LeagueBanner, "toFront", null);
4399
+ __decorate([
4400
+ ToBackHook
4401
+ ], LeagueBanner, "toBack", null);
4402
+ LeagueBanner = __decorate([
4403
+ ModelInstance({
4404
+ mappingFields: {
4405
+ id: 'id',
4406
+ title: 'title',
4407
+ picture: 'picture',
4408
+ link: 'link',
4409
+ sort: 'sort',
4410
+ location: 'location',
4411
+ },
4412
+ relation: {
4413
+ picture: File,
4414
+ location: enumField(BannerLocation),
4415
+ }
4416
+ })
4417
+ ], LeagueBanner);
4418
+ return LeagueBanner;
4419
+ }(BaseModel));
3642
4420
 
3643
4421
  var LeagueApi = /** @class */ (function () {
3644
4422
  function LeagueApi(httpClient, configService) {
@@ -3699,34 +4477,13 @@ var LeagueApi = /** @class */ (function () {
3699
4477
  };
3700
4478
  LeagueApi.prototype.getGames = function (leagueId, page, size, filters) {
3701
4479
  return __awaiter(this, void 0, void 0, function () {
3702
- var params, statuses;
4480
+ var params;
3703
4481
  return __generator(this, function (_a) {
3704
4482
  params = new HttpParams().set('page', page.toString());
3705
4483
  if (size) {
3706
4484
  params = params.set('size', size.toString());
3707
4485
  }
3708
- if (filters.tournamentStageId) {
3709
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3710
- }
3711
- if (filters.tournamentTour) {
3712
- params = params.set('tournament_tour', filters.tournamentTour.toString());
3713
- }
3714
- if (filters.playoffStage) {
3715
- params = params.set('playoff_stage', filters.playoffStage.toString());
3716
- }
3717
- if (filters.teamId) {
3718
- params = params.set('team_id', filters.teamId.toString());
3719
- }
3720
- if (filters.status) {
3721
- params = params.set('status', GameStatuses[filters.status]);
3722
- }
3723
- if (filters.statuses) {
3724
- statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
3725
- params = params.set('statuses', statuses.join(','));
3726
- }
3727
- if (filters.tournamentCourtId) {
3728
- params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
3729
- }
4486
+ params = applyGamesFilters(filters, params);
3730
4487
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/games/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
3731
4488
  total: +result.headers.get('X-Page-Count'),
3732
4489
  data: Game.toFront(result.body)
@@ -4739,69 +5496,6 @@ var TeamInviteExternal = /** @class */ (function (_super) {
4739
5496
  return TeamInviteExternal;
4740
5497
  }(BaseModel));
4741
5498
 
4742
- var VolleyballStatistic = /** @class */ (function (_super) {
4743
- __extends(VolleyballStatistic, _super);
4744
- function VolleyballStatistic() {
4745
- return _super !== null && _super.apply(this, arguments) || this;
4746
- }
4747
- VolleyballStatistic.toFront = function (data) { };
4748
- VolleyballStatistic.toBack = function (data) { };
4749
- __decorate([
4750
- ToFrontHook
4751
- ], VolleyballStatistic, "toFront", null);
4752
- __decorate([
4753
- ToBackHook
4754
- ], VolleyballStatistic, "toBack", null);
4755
- VolleyballStatistic = __decorate([
4756
- ModelInstance({
4757
- mappingFields: {
4758
- team: 'team',
4759
- team_user: 'teamUser',
4760
- tournament_team_user: 'tournamentTeamUser',
4761
- tournament_team: 'tournamentTeam',
4762
- user: 'user',
4763
- month: 'month',
4764
- win_lose: 'winLose',
4765
- games_count: 'gamesCount',
4766
- won_games_count: 'wonGamesCount',
4767
- serve_hits: 'serveHits',
4768
- serve_faults: 'serveFaults',
4769
- serve_aces: 'serveAces',
4770
- serve_percent: 'servePercent',
4771
- ace_percent: 'acePercent',
4772
- stuff_blocks: 'stuffBlocks',
4773
- block_faults: 'blockFaults',
4774
- block_rebounds: 'blockRebounds',
4775
- block_percent: 'blockPercent',
4776
- attack_spikes: 'attackSpikes',
4777
- attack_faults: 'attackFaults',
4778
- attack_shots: 'attackShots',
4779
- attack_percent: 'attackPercent',
4780
- receives: 'receives',
4781
- receive_faults: 'receiveFaults',
4782
- excellent_receives: 'excellentReceives',
4783
- receive_percent: 'receivePercent',
4784
- serve_receives: 'serveReceives',
4785
- serve_receive_faults: 'serveReceiveFaults',
4786
- excellent_serve_receives: 'excellentServeReceives',
4787
- serve_receive_percent: 'serveReceivePercent',
4788
- points: 'points',
4789
- faults: 'faults',
4790
- newbie: 'newbie',
4791
- },
4792
- relation: {
4793
- team: Team,
4794
- teamUser: TeamUser,
4795
- tournamentTeamUser: TournamentTeamUser,
4796
- tournamentTeam: TournamentTeam,
4797
- user: User,
4798
- month: DateField,
4799
- }
4800
- })
4801
- ], VolleyballStatistic);
4802
- return VolleyballStatistic;
4803
- }(BaseStatistic));
4804
-
4805
5499
  var TeamPermissionTypes;
4806
5500
  (function (TeamPermissionTypes) {
4807
5501
  TeamPermissionTypes[TeamPermissionTypes["for_all"] = 1] = "for_all";
@@ -4895,1203 +5589,544 @@ var TeamApi = /** @class */ (function () {
4895
5589
  }
4896
5590
  TeamApi.prototype.search = function (query, sportId) {
4897
5591
  return __awaiter(this, void 0, void 0, function () {
4898
- var params;
4899
- return __generator(this, function (_a) {
4900
- params = (new HttpParams()).set('search', query);
4901
- if (sportId) {
4902
- params = params.set('sport', sportId.toString());
4903
- }
4904
- return [2 /*return*/, this.httpClient
4905
- .get(this.configService.get('apiUrl') + "/api/v1/team/", { params: params })
4906
- .pipe(map(function (data) { return Team.toFront(data); }))
4907
- .toPromise()];
4908
- });
4909
- });
4910
- };
4911
- TeamApi.prototype.create = function (team) {
4912
- return __awaiter(this, void 0, void 0, function () {
4913
- return __generator(this, function (_a) {
4914
- return [2 /*return*/, this.httpClient
4915
- .post(this.configService.get('apiUrl') + "/api/v1/team/", Team.toBack(team))
4916
- .pipe(map(function (data) { return Team.toFront(data); }))
4917
- .toPromise()];
4918
- });
4919
- });
4920
- };
4921
- TeamApi.prototype.getById = function (teamId) {
4922
- return __awaiter(this, void 0, void 0, function () {
4923
- return __generator(this, function (_a) {
4924
- return [2 /*return*/, this.httpClient
4925
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/")
4926
- .pipe(map(function (data) { return Team.toFront(data); }))
4927
- .toPromise()];
4928
- });
4929
- });
4930
- };
4931
- TeamApi.prototype.getTeamAccess = function (teamId) {
4932
- return __awaiter(this, void 0, void 0, function () {
4933
- return __generator(this, function (_a) {
4934
- return [2 /*return*/, this.httpClient
4935
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/access/")
4936
- .pipe(map(function (data) { return TeamAccess.toFront(data); }))
4937
- .toPromise()];
4938
- });
4939
- });
4940
- };
4941
- TeamApi.prototype.update = function (teamId, values) {
4942
- return __awaiter(this, void 0, void 0, function () {
4943
- return __generator(this, function (_a) {
4944
- return [2 /*return*/, this.httpClient
4945
- .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/", Team.toBack(values))
4946
- .pipe(map(function (data) { return Team.toFront(data); }))
4947
- .toPromise()];
4948
- });
4949
- });
4950
- };
4951
- TeamApi.prototype.delete = function (team) {
4952
- return __awaiter(this, void 0, void 0, function () {
4953
- return __generator(this, function (_a) {
4954
- return [2 /*return*/, this.httpClient
4955
- .delete(this.configService.get('apiUrl') + "/api/v1/team/" + team.id + "/")
4956
- .toPromise()];
4957
- });
4958
- });
4959
- };
4960
- TeamApi.prototype.getPermission = function (teamId) {
4961
- return __awaiter(this, void 0, void 0, function () {
4962
- return __generator(this, function (_a) {
4963
- return [2 /*return*/, this.httpClient
4964
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/permission/")
4965
- .pipe(map(function (data) { return TeamPermission.toFront(data); }))
4966
- .toPromise()];
4967
- });
4968
- });
4969
- };
4970
- TeamApi.prototype.updatePermission = function (teamId, permission) {
4971
- return __awaiter(this, void 0, void 0, function () {
4972
- return __generator(this, function (_a) {
4973
- return [2 /*return*/, this.httpClient
4974
- .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/permission/", TeamPermission.toBack(permission))
4975
- .pipe(map(function (data) { return TeamPermission.toFront(data); }))
4976
- .toPromise()];
4977
- });
4978
- });
4979
- };
4980
- TeamApi.prototype.getUsers = function (teamId, tournamentId) {
4981
- return __awaiter(this, void 0, void 0, function () {
4982
- var params;
4983
- return __generator(this, function (_a) {
4984
- params = new HttpParams();
4985
- if (tournamentId) {
4986
- params = params.set('tournament_id', tournamentId.toString());
4987
- }
4988
- return [2 /*return*/, this.httpClient
4989
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/users/", { params: params })
4990
- .pipe(map(function (data) { return TeamUser.toFront(data); }))
4991
- .toPromise()];
4992
- });
4993
- });
4994
- };
4995
- TeamApi.prototype.updateUserRole = function (teamId, teamUserId, role) {
4996
- return __awaiter(this, void 0, void 0, function () {
4997
- return __generator(this, function (_a) {
4998
- return [2 /*return*/, this.httpClient
4999
- .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/users/" + teamUserId + "/role/", { role: TeamUserRole[role] })
5000
- .pipe(map(function (data) { return TeamUser.toFront(data); }))
5001
- .toPromise()];
5002
- });
5003
- });
5004
- };
5005
- TeamApi.prototype.updateUserNumber = function (teamId, teamUserId, gameNumber) {
5006
- return __awaiter(this, void 0, void 0, function () {
5007
- return __generator(this, function (_a) {
5008
- return [2 /*return*/, this.httpClient
5009
- .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/users/" + teamUserId + "/number/", { number: gameNumber.toString() })
5010
- .pipe(map(function (data) { return TeamUser.toFront(data); }))
5011
- .toPromise()];
5012
- });
5013
- });
5014
- };
5015
- TeamApi.prototype.deleteUser = function (teamUser) {
5016
- return __awaiter(this, void 0, void 0, function () {
5017
- return __generator(this, function (_a) {
5018
- return [2 /*return*/, this.httpClient
5019
- .delete(this.configService.get('apiUrl') + "/api/v1/team/" + teamUser.teamId + "/users/" + teamUser.id + "/")
5020
- .toPromise()];
5021
- });
5022
- });
5023
- };
5024
- TeamApi.prototype.changeOwner = function (teamId, user) {
5025
- return __awaiter(this, void 0, void 0, function () {
5026
- return __generator(this, function (_a) {
5027
- return [2 /*return*/, this.httpClient
5028
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/owner/", { id: user.id })
5029
- .pipe(map(function (data) { return Team.toFront(data); }))
5030
- .toPromise()];
5031
- });
5032
- });
5033
- };
5034
- TeamApi.prototype.getInvites = function (teamId) {
5035
- return __awaiter(this, void 0, void 0, function () {
5592
+ var params;
5036
5593
  return __generator(this, function (_a) {
5594
+ params = (new HttpParams()).set('search', query);
5595
+ if (sportId) {
5596
+ params = params.set('sport', sportId.toString());
5597
+ }
5037
5598
  return [2 /*return*/, this.httpClient
5038
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites/")
5039
- .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5599
+ .get(this.configService.get('apiUrl') + "/api/v1/team/", { params: params })
5600
+ .pipe(map(function (data) { return Team.toFront(data); }))
5040
5601
  .toPromise()];
5041
5602
  });
5042
5603
  });
5043
5604
  };
5044
- TeamApi.prototype.sendInvite = function (teamId, user) {
5605
+ TeamApi.prototype.create = function (team) {
5045
5606
  return __awaiter(this, void 0, void 0, function () {
5046
5607
  return __generator(this, function (_a) {
5047
5608
  return [2 /*return*/, this.httpClient
5048
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites/", { user: user })
5049
- .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5609
+ .post(this.configService.get('apiUrl') + "/api/v1/team/", Team.toBack(team))
5610
+ .pipe(map(function (data) { return Team.toFront(data); }))
5050
5611
  .toPromise()];
5051
5612
  });
5052
5613
  });
5053
5614
  };
5054
- TeamApi.prototype.acceptInvite = function (invite) {
5615
+ TeamApi.prototype.getById = function (teamId) {
5055
5616
  return __awaiter(this, void 0, void 0, function () {
5056
5617
  return __generator(this, function (_a) {
5057
5618
  return [2 /*return*/, this.httpClient
5058
- .post(this.configService.get('apiUrl') + "/api/v1/team_invite/" + invite.id + "/accept/", {})
5059
- .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5619
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/")
5620
+ .pipe(map(function (data) { return Team.toFront(data); }))
5060
5621
  .toPromise()];
5061
5622
  });
5062
5623
  });
5063
5624
  };
5064
- TeamApi.prototype.declineInvite = function (invite) {
5625
+ TeamApi.prototype.getTeamAccess = function (teamId) {
5065
5626
  return __awaiter(this, void 0, void 0, function () {
5066
5627
  return __generator(this, function (_a) {
5067
5628
  return [2 /*return*/, this.httpClient
5068
- .post(this.configService.get('apiUrl') + "/api/v1/team_invite/" + invite.id + "/decline/", {})
5069
- .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5629
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/access/")
5630
+ .pipe(map(function (data) { return TeamAccess.toFront(data); }))
5070
5631
  .toPromise()];
5071
5632
  });
5072
5633
  });
5073
5634
  };
5074
- TeamApi.prototype.resendInvite = function (invite) {
5635
+ TeamApi.prototype.update = function (teamId, values) {
5075
5636
  return __awaiter(this, void 0, void 0, function () {
5076
5637
  return __generator(this, function (_a) {
5077
5638
  return [2 /*return*/, this.httpClient
5078
- .post(this.configService.get('apiUrl') + "/api/v1/team_invite/" + invite.id + "/resend/", {})
5079
- .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5639
+ .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/", Team.toBack(values))
5640
+ .pipe(map(function (data) { return Team.toFront(data); }))
5080
5641
  .toPromise()];
5081
5642
  });
5082
5643
  });
5083
5644
  };
5084
- TeamApi.prototype.getInvitesExternal = function (teamId) {
5645
+ TeamApi.prototype.delete = function (team) {
5085
5646
  return __awaiter(this, void 0, void 0, function () {
5086
5647
  return __generator(this, function (_a) {
5087
5648
  return [2 /*return*/, this.httpClient
5088
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites_external/")
5089
- .pipe(map(function (data) { return TeamInviteExternal.toFront(data); }))
5649
+ .delete(this.configService.get('apiUrl') + "/api/v1/team/" + team.id + "/")
5090
5650
  .toPromise()];
5091
5651
  });
5092
5652
  });
5093
5653
  };
5094
- TeamApi.prototype.sendInviteExternal = function (teamId, invite) {
5654
+ TeamApi.prototype.getPermission = function (teamId) {
5095
5655
  return __awaiter(this, void 0, void 0, function () {
5096
5656
  return __generator(this, function (_a) {
5097
5657
  return [2 /*return*/, this.httpClient
5098
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites_external/", TeamInviteExternal.toBack(invite))
5099
- .pipe(map(function (data) { return TeamInviteExternal.toFront(data); }))
5658
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/permission/")
5659
+ .pipe(map(function (data) { return TeamPermission.toFront(data); }))
5100
5660
  .toPromise()];
5101
5661
  });
5102
5662
  });
5103
5663
  };
5104
- TeamApi.prototype.deleteInviteExternal = function (invite) {
5664
+ TeamApi.prototype.updatePermission = function (teamId, permission) {
5105
5665
  return __awaiter(this, void 0, void 0, function () {
5106
5666
  return __generator(this, function (_a) {
5107
5667
  return [2 /*return*/, this.httpClient
5108
- .delete(this.configService.get('apiUrl') + "/api/v1/invites_external/" + invite.id + "/")
5668
+ .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/permission/", TeamPermission.toBack(permission))
5669
+ .pipe(map(function (data) { return TeamPermission.toFront(data); }))
5109
5670
  .toPromise()];
5110
5671
  });
5111
5672
  });
5112
5673
  };
5113
- TeamApi.prototype.resendInviteExternal = function (invite) {
5674
+ TeamApi.prototype.getUsers = function (teamId, tournamentId) {
5114
5675
  return __awaiter(this, void 0, void 0, function () {
5676
+ var params;
5115
5677
  return __generator(this, function (_a) {
5678
+ params = new HttpParams();
5679
+ if (tournamentId) {
5680
+ params = params.set('tournament_id', tournamentId.toString());
5681
+ }
5116
5682
  return [2 /*return*/, this.httpClient
5117
- .post(this.configService.get('apiUrl') + "/api/v1/invites_external/" + invite.id + "/resend/", {})
5118
- .pipe(map(function (data) { return TeamInviteExternal.toFront(data); }))
5683
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/users/", { params: params })
5684
+ .pipe(map(function (data) { return TeamUser.toFront(data); }))
5119
5685
  .toPromise()];
5120
5686
  });
5121
5687
  });
5122
5688
  };
5123
- TeamApi.prototype.getPolls = function (teamId, archive) {
5124
- if (archive === void 0) { archive = false; }
5689
+ TeamApi.prototype.updateUserRole = function (teamId, teamUserId, role) {
5125
5690
  return __awaiter(this, void 0, void 0, function () {
5126
5691
  return __generator(this, function (_a) {
5127
5692
  return [2 /*return*/, this.httpClient
5128
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/polls/" + (archive ? '?archive=1' : ''))
5129
- .pipe(map(function (data) { return Poll.toFront(data); }))
5693
+ .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/users/" + teamUserId + "/role/", { role: TeamUserRole[role] })
5694
+ .pipe(map(function (data) { return TeamUser.toFront(data); }))
5130
5695
  .toPromise()];
5131
5696
  });
5132
5697
  });
5133
5698
  };
5134
- TeamApi.prototype.createPoll = function (teamId, poll) {
5699
+ TeamApi.prototype.updateUserNumber = function (teamId, teamUserId, gameNumber) {
5135
5700
  return __awaiter(this, void 0, void 0, function () {
5136
5701
  return __generator(this, function (_a) {
5137
5702
  return [2 /*return*/, this.httpClient
5138
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/polls/", Poll.toBack(poll))
5139
- .pipe(map(function (data) { return Poll.toFront(data); }))
5703
+ .patch(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/users/" + teamUserId + "/number/", { number: gameNumber.toString() })
5704
+ .pipe(map(function (data) { return TeamUser.toFront(data); }))
5140
5705
  .toPromise()];
5141
5706
  });
5142
5707
  });
5143
5708
  };
5144
- TeamApi.prototype.getUsersStatistic = function (teamId) {
5709
+ TeamApi.prototype.deleteUser = function (teamUser) {
5145
5710
  return __awaiter(this, void 0, void 0, function () {
5146
5711
  return __generator(this, function (_a) {
5147
5712
  return [2 /*return*/, this.httpClient
5148
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/statistics/")
5149
- .pipe(map(function (data) { return BasketballStatistic.toFront(data); }))
5713
+ .delete(this.configService.get('apiUrl') + "/api/v1/team/" + teamUser.teamId + "/users/" + teamUser.id + "/")
5150
5714
  .toPromise()];
5151
5715
  });
5152
5716
  });
5153
5717
  };
5154
- TeamApi.prototype.getVolleyballStatistic = function (teamId) {
5718
+ TeamApi.prototype.changeOwner = function (teamId, user) {
5155
5719
  return __awaiter(this, void 0, void 0, function () {
5156
5720
  return __generator(this, function (_a) {
5157
5721
  return [2 /*return*/, this.httpClient
5158
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/volleyball_statistics/")
5159
- .pipe(map(function (data) { return VolleyballStatistic.toFront(data); }))
5722
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/owner/", { id: user.id })
5723
+ .pipe(map(function (data) { return Team.toFront(data); }))
5160
5724
  .toPromise()];
5161
5725
  });
5162
5726
  });
5163
5727
  };
5164
- TeamApi.prototype.joinTeam = function (teamId) {
5728
+ TeamApi.prototype.getInvites = function (teamId) {
5165
5729
  return __awaiter(this, void 0, void 0, function () {
5166
5730
  return __generator(this, function (_a) {
5167
5731
  return [2 /*return*/, this.httpClient
5168
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/join/", {})
5732
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites/")
5169
5733
  .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5170
5734
  .toPromise()];
5171
5735
  });
5172
5736
  });
5173
5737
  };
5174
- TeamApi.prototype.leaveTeam = function (teamId) {
5175
- return __awaiter(this, void 0, void 0, function () {
5176
- return __generator(this, function (_a) {
5177
- return [2 /*return*/, this.httpClient
5178
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/leave/", {})
5179
- .toPromise()];
5180
- });
5181
- });
5182
- };
5183
- TeamApi.prototype.getGames = function (teamId, archive) {
5184
- if (archive === void 0) { archive = false; }
5185
- return __awaiter(this, void 0, void 0, function () {
5186
- return __generator(this, function (_a) {
5187
- return [2 /*return*/, this.httpClient
5188
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/games/" + (archive ? '?archive=1' : ''))
5189
- .pipe(map(function (data) { return Game.toFront(data); }))
5190
- .toPromise()];
5191
- });
5192
- });
5193
- };
5194
- TeamApi.prototype.createGame = function (teamId, game) {
5195
- return __awaiter(this, void 0, void 0, function () {
5196
- return __generator(this, function (_a) {
5197
- return [2 /*return*/, this.httpClient
5198
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/games/", Game.toBack(game))
5199
- .pipe(map(function (data) { return Game.toFront(data); }))
5200
- .toPromise()];
5201
- });
5202
- });
5203
- };
5204
- TeamApi.prototype.getTeamEvents = function (teamId) {
5205
- return __awaiter(this, void 0, void 0, function () {
5206
- return __generator(this, function (_a) {
5207
- return [2 /*return*/, this.httpClient
5208
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/events/")
5209
- .pipe(map(function (data) { return TeamEvent.toFront(data); }))
5210
- .toPromise()];
5211
- });
5212
- });
5213
- };
5214
- TeamApi.prototype.createTeamEvent = function (teamId, teamEvent) {
5215
- return __awaiter(this, void 0, void 0, function () {
5216
- return __generator(this, function (_a) {
5217
- return [2 /*return*/, this.httpClient
5218
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/events/", TeamEvent.toBack(teamEvent))
5219
- .pipe(map(function (data) { return TeamEvent.toFront(data); }))
5220
- .toPromise()];
5221
- });
5222
- });
5223
- };
5224
- TeamApi.prototype.getTournaments = function (teamId) {
5225
- return __awaiter(this, void 0, void 0, function () {
5226
- return __generator(this, function (_a) {
5227
- return [2 /*return*/, this.httpClient
5228
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournaments/")
5229
- .pipe(map(function (data) { return Tournament.toFront(data); }))
5230
- .toPromise()];
5231
- });
5232
- });
5233
- };
5234
- TeamApi.prototype.getTournamentTeams = function (teamId) {
5235
- return __awaiter(this, void 0, void 0, function () {
5236
- return __generator(this, function (_a) {
5237
- return [2 /*return*/, this.httpClient
5238
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournament_teams/")
5239
- .pipe(map(function (data) { return TournamentTeam.toFront(data); }))
5240
- .toPromise()];
5241
- });
5242
- });
5243
- };
5244
- TeamApi.prototype.getTournamentInvites = function (teamId) {
5245
- return __awaiter(this, void 0, void 0, function () {
5246
- return __generator(this, function (_a) {
5247
- return [2 /*return*/, this.httpClient
5248
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournament_invites/")
5249
- .pipe(map(function (data) { return TournamentInvite.toFront(data); }))
5250
- .toPromise()];
5251
- });
5252
- });
5253
- };
5254
- TeamApi.prototype.getTournamentGames = function (teamId, tournamentId, page, size) {
5255
- return __awaiter(this, void 0, void 0, function () {
5256
- var params;
5257
- return __generator(this, function (_a) {
5258
- params = new HttpParams().set('page', page.toString());
5259
- if (size) {
5260
- params = params.set('size', size.toString());
5261
- }
5262
- return [2 /*return*/, this.httpClient
5263
- .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournaments/" + tournamentId + "/games/", { params: params, observe: 'response' })
5264
- .pipe(map(function (response) {
5265
- return {
5266
- total: +response.headers.get('X-Page-Count'),
5267
- data: Game.toFront(response.body)
5268
- };
5269
- }))
5270
- .toPromise()];
5271
- });
5272
- });
5273
- };
5274
- TeamApi.prototype.acceptTournamentInvite = function (inviteId) {
5275
- return __awaiter(this, void 0, void 0, function () {
5276
- return __generator(this, function (_a) {
5277
- return [2 /*return*/, this.httpClient
5278
- .post(this.configService.get('apiUrl') + "/api/v1/tournament_invite/" + inviteId + "/accept/", {})
5279
- .pipe(map(function (data) { return TournamentInvite.toFront(data); }))
5280
- .toPromise()];
5281
- });
5282
- });
5283
- };
5284
- TeamApi.prototype.declineTournamentInvite = function (inviteId) {
5285
- return __awaiter(this, void 0, void 0, function () {
5286
- return __generator(this, function (_a) {
5287
- return [2 /*return*/, this.httpClient
5288
- .post(this.configService.get('apiUrl') + "/api/v1/tournament_invite/" + inviteId + "/decline/", {})
5289
- .pipe(map(function (data) { return TournamentInvite.toFront(data); }))
5290
- .toPromise()];
5291
- });
5292
- });
5293
- };
5294
- TeamApi.prototype.registerLazyUser = function (teamId, userData) {
5738
+ TeamApi.prototype.sendInvite = function (teamId, user) {
5295
5739
  return __awaiter(this, void 0, void 0, function () {
5296
5740
  return __generator(this, function (_a) {
5297
5741
  return [2 /*return*/, this.httpClient
5298
- .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/lazy_user/", { user: User.toBack(userData) })
5299
- .pipe(map(function (data) { return TeamUser.toFront(data); }))
5742
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites/", { user: user })
5743
+ .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5300
5744
  .toPromise()];
5301
5745
  });
5302
5746
  });
5303
5747
  };
5304
- TeamApi.prototype.getLazyUser = function (teamUserId) {
5748
+ TeamApi.prototype.acceptInvite = function (invite) {
5305
5749
  return __awaiter(this, void 0, void 0, function () {
5306
5750
  return __generator(this, function (_a) {
5307
5751
  return [2 /*return*/, this.httpClient
5308
- .get(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/")
5309
- .pipe(map(function (data) { return TeamUser.toFront(data); }))
5752
+ .post(this.configService.get('apiUrl') + "/api/v1/team_invite/" + invite.id + "/accept/", {})
5753
+ .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5310
5754
  .toPromise()];
5311
5755
  });
5312
5756
  });
5313
5757
  };
5314
- TeamApi.prototype.updateLazyUser = function (teamUserId, userData) {
5758
+ TeamApi.prototype.declineInvite = function (invite) {
5315
5759
  return __awaiter(this, void 0, void 0, function () {
5316
5760
  return __generator(this, function (_a) {
5317
5761
  return [2 /*return*/, this.httpClient
5318
- .patch(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/", { user: User.toBack(userData) })
5319
- .pipe(map(function (data) { return TeamUser.toFront(data); }))
5762
+ .post(this.configService.get('apiUrl') + "/api/v1/team_invite/" + invite.id + "/decline/", {})
5763
+ .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5320
5764
  .toPromise()];
5321
5765
  });
5322
5766
  });
5323
5767
  };
5324
- TeamApi.prototype.deleteLazyUser = function (teamUserId) {
5768
+ TeamApi.prototype.resendInvite = function (invite) {
5325
5769
  return __awaiter(this, void 0, void 0, function () {
5326
5770
  return __generator(this, function (_a) {
5327
5771
  return [2 /*return*/, this.httpClient
5328
- .delete(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/")
5772
+ .post(this.configService.get('apiUrl') + "/api/v1/team_invite/" + invite.id + "/resend/", {})
5773
+ .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5329
5774
  .toPromise()];
5330
5775
  });
5331
5776
  });
5332
5777
  };
5333
- TeamApi.prototype.resendLazyUserEmail = function (teamUserId) {
5778
+ TeamApi.prototype.getInvitesExternal = function (teamId) {
5334
5779
  return __awaiter(this, void 0, void 0, function () {
5335
5780
  return __generator(this, function (_a) {
5336
5781
  return [2 /*return*/, this.httpClient
5337
- .post(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/resend_email/", {})
5782
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites_external/")
5783
+ .pipe(map(function (data) { return TeamInviteExternal.toFront(data); }))
5338
5784
  .toPromise()];
5339
5785
  });
5340
5786
  });
5341
5787
  };
5342
- TeamApi.ctorParameters = function () { return [
5343
- { type: HttpClient },
5344
- { type: ConfigService }
5345
- ]; };
5346
- TeamApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamApi_Factory() { return new TeamApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamApi, providedIn: "root" });
5347
- TeamApi = __decorate([
5348
- Injectable({ providedIn: 'root' })
5349
- ], TeamApi);
5350
- return TeamApi;
5351
- }());
5352
-
5353
- var TeamEventApi = /** @class */ (function () {
5354
- function TeamEventApi(httpClient, configService) {
5355
- this.httpClient = httpClient;
5356
- this.configService = configService;
5357
- }
5358
- TeamEventApi.prototype.getTeamEvent = function (teamEventId) {
5788
+ TeamApi.prototype.sendInviteExternal = function (teamId, invite) {
5359
5789
  return __awaiter(this, void 0, void 0, function () {
5360
5790
  return __generator(this, function (_a) {
5361
5791
  return [2 /*return*/, this.httpClient
5362
- .get(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/")
5363
- .pipe(map(function (data) { return TeamEvent.toFront(data); }))
5792
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/invites_external/", TeamInviteExternal.toBack(invite))
5793
+ .pipe(map(function (data) { return TeamInviteExternal.toFront(data); }))
5364
5794
  .toPromise()];
5365
5795
  });
5366
5796
  });
5367
5797
  };
5368
- TeamEventApi.prototype.updateTeamEvent = function (teamEvent) {
5798
+ TeamApi.prototype.deleteInviteExternal = function (invite) {
5369
5799
  return __awaiter(this, void 0, void 0, function () {
5370
5800
  return __generator(this, function (_a) {
5371
5801
  return [2 /*return*/, this.httpClient
5372
- .patch(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEvent.id + "/", TeamEvent.toBack(teamEvent))
5373
- .pipe(map(function (data) { return TeamEvent.toFront(data); }))
5802
+ .delete(this.configService.get('apiUrl') + "/api/v1/invites_external/" + invite.id + "/")
5374
5803
  .toPromise()];
5375
5804
  });
5376
5805
  });
5377
5806
  };
5378
- TeamEventApi.prototype.deleteTeamEvent = function (teamEventId) {
5807
+ TeamApi.prototype.resendInviteExternal = function (invite) {
5379
5808
  return __awaiter(this, void 0, void 0, function () {
5380
5809
  return __generator(this, function (_a) {
5381
5810
  return [2 /*return*/, this.httpClient
5382
- .delete(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/")
5811
+ .post(this.configService.get('apiUrl') + "/api/v1/invites_external/" + invite.id + "/resend/", {})
5812
+ .pipe(map(function (data) { return TeamInviteExternal.toFront(data); }))
5383
5813
  .toPromise()];
5384
5814
  });
5385
5815
  });
5386
5816
  };
5387
- TeamEventApi.prototype.getTeamEventInvites = function (teamEventId) {
5817
+ TeamApi.prototype.getPolls = function (teamId, archive) {
5818
+ if (archive === void 0) { archive = false; }
5388
5819
  return __awaiter(this, void 0, void 0, function () {
5389
5820
  return __generator(this, function (_a) {
5390
5821
  return [2 /*return*/, this.httpClient
5391
- .get(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/invites/")
5392
- .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
5822
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/polls/" + (archive ? '?archive=1' : ''))
5823
+ .pipe(map(function (data) { return Poll.toFront(data); }))
5393
5824
  .toPromise()];
5394
5825
  });
5395
5826
  });
5396
5827
  };
5397
- TeamEventApi.prototype.createTeamEventInvite = function (teamEventId, teamUserId) {
5828
+ TeamApi.prototype.createPoll = function (teamId, poll) {
5398
5829
  return __awaiter(this, void 0, void 0, function () {
5399
5830
  return __generator(this, function (_a) {
5400
5831
  return [2 /*return*/, this.httpClient
5401
- .post(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/invites/", { team_user_id: teamUserId })
5402
- .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
5832
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/polls/", Poll.toBack(poll))
5833
+ .pipe(map(function (data) { return Poll.toFront(data); }))
5403
5834
  .toPromise()];
5404
5835
  });
5405
5836
  });
5406
5837
  };
5407
- TeamEventApi.prototype.acceptTeamEventInvite = function (teamEventInvite) {
5838
+ TeamApi.prototype.getUsersStatistic = function (teamId) {
5408
5839
  return __awaiter(this, void 0, void 0, function () {
5409
5840
  return __generator(this, function (_a) {
5410
5841
  return [2 /*return*/, this.httpClient
5411
- .post(this.configService.get('apiUrl') + "/api/v1/team_event_invite/" + teamEventInvite.id + "/accept/", {})
5412
- .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
5842
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/statistics/")
5843
+ .pipe(map(function (data) { return BasketballStatistic.toFront(data); }))
5413
5844
  .toPromise()];
5414
5845
  });
5415
5846
  });
5416
5847
  };
5417
- TeamEventApi.prototype.declineTeamEventInvite = function (teamEventInvite) {
5848
+ TeamApi.prototype.getVolleyballStatistic = function (teamId) {
5418
5849
  return __awaiter(this, void 0, void 0, function () {
5419
5850
  return __generator(this, function (_a) {
5420
5851
  return [2 /*return*/, this.httpClient
5421
- .post(this.configService.get('apiUrl') + "/api/v1/team_event_invite/" + teamEventInvite.id + "/decline/", {})
5422
- .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
5852
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/volleyball_statistics/")
5853
+ .pipe(map(function (data) { return VolleyballStatistic.toFront(data); }))
5423
5854
  .toPromise()];
5424
5855
  });
5425
5856
  });
5426
5857
  };
5427
- TeamEventApi.ctorParameters = function () { return [
5428
- { type: HttpClient },
5429
- { type: ConfigService }
5430
- ]; };
5431
- TeamEventApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamEventApi_Factory() { return new TeamEventApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamEventApi, providedIn: "root" });
5432
- TeamEventApi = __decorate([
5433
- Injectable({ providedIn: 'root' })
5434
- ], TeamEventApi);
5435
- return TeamEventApi;
5436
- }());
5437
-
5438
- var TournamentNews = /** @class */ (function (_super) {
5439
- __extends(TournamentNews, _super);
5440
- function TournamentNews() {
5441
- return _super !== null && _super.apply(this, arguments) || this;
5442
- }
5443
- TournamentNews.toFront = function (data) { };
5444
- TournamentNews.toBack = function (data) { };
5445
- __decorate([
5446
- ToFrontHook
5447
- ], TournamentNews, "toFront", null);
5448
- __decorate([
5449
- ToBackHook
5450
- ], TournamentNews, "toBack", null);
5451
- TournamentNews = __decorate([
5452
- ModelInstance({
5453
- mappingFields: {
5454
- id: 'id',
5455
- title: 'title',
5456
- picture: 'picture',
5457
- text: 'text',
5458
- author: 'author',
5459
- created_at: 'createdAt',
5460
- },
5461
- relation: {
5462
- picture: File,
5463
- author: User,
5464
- createdAt: DateTimeField,
5465
- }
5466
- })
5467
- ], TournamentNews);
5468
- return TournamentNews;
5469
- }(BaseModel));
5470
-
5471
- var GameTimelineStageItem = /** @class */ (function () {
5472
- function GameTimelineStageItem() {
5473
- }
5474
- GameTimelineStageItem.toFront = function (data) { };
5475
- GameTimelineStageItem.toBack = function (data) { };
5476
- __decorate([
5477
- ToFrontHook
5478
- ], GameTimelineStageItem, "toFront", null);
5479
- __decorate([
5480
- ToBackHook
5481
- ], GameTimelineStageItem, "toBack", null);
5482
- GameTimelineStageItem = __decorate([
5483
- ModelInstance({
5484
- mappingFields: {
5485
- stage_id: 'stageId',
5486
- tours_count: 'toursCount',
5487
- playoff_stages_count: 'playoffStagesCount',
5488
- }
5489
- })
5490
- ], GameTimelineStageItem);
5491
- return GameTimelineStageItem;
5492
- }());
5493
- var GameTimelineStages = /** @class */ (function (_super) {
5494
- __extends(GameTimelineStages, _super);
5495
- function GameTimelineStages() {
5496
- return _super !== null && _super.apply(this, arguments) || this;
5497
- }
5498
- GameTimelineStages.toFront = function (data) { };
5499
- GameTimelineStages.toBack = function (data) { };
5500
- __decorate([
5501
- ToFrontHook
5502
- ], GameTimelineStages, "toFront", null);
5503
- __decorate([
5504
- ToBackHook
5505
- ], GameTimelineStages, "toBack", null);
5506
- GameTimelineStages = __decorate([
5507
- ModelInstance({
5508
- mappingFields: {
5509
- tours_count: 'toursCount',
5510
- playoff_stages_count: 'playoffStagesCount',
5511
- current_tour: 'currentTour',
5512
- current_playoff_stage: 'currentPlayoffStage',
5513
- stages: 'stages',
5514
- tournament_stage_id: 'tournamentStageId',
5515
- },
5516
- relation: {
5517
- stages: listField(GameTimelineStageItem)
5518
- }
5519
- })
5520
- ], GameTimelineStages);
5521
- return GameTimelineStages;
5522
- }(BaseModel));
5523
-
5524
- var TournamentStageStatuses;
5525
- (function (TournamentStageStatuses) {
5526
- TournamentStageStatuses[TournamentStageStatuses["open"] = 0] = "open";
5527
- TournamentStageStatuses[TournamentStageStatuses["in_progress"] = 1] = "in_progress";
5528
- TournamentStageStatuses[TournamentStageStatuses["closed"] = 2] = "closed";
5529
- })(TournamentStageStatuses || (TournamentStageStatuses = {}));
5530
- var TournamentStage = /** @class */ (function (_super) {
5531
- __extends(TournamentStage, _super);
5532
- function TournamentStage() {
5533
- return _super !== null && _super.apply(this, arguments) || this;
5534
- }
5535
- TournamentStage.toFront = function (data) { };
5536
- TournamentStage.toBack = function (data) { };
5537
- __decorate([
5538
- ToFrontHook
5539
- ], TournamentStage, "toFront", null);
5540
- __decorate([
5541
- ToBackHook
5542
- ], TournamentStage, "toBack", null);
5543
- TournamentStage = __decorate([
5544
- ModelInstance({
5545
- mappingFields: {
5546
- id: 'id',
5547
- name: 'name',
5548
- date: 'date',
5549
- tournament_id: 'tournamentId',
5550
- status: 'status',
5551
- },
5552
- relation: {
5553
- date: DateField,
5554
- status: enumField(TournamentStageStatuses)
5555
- }
5556
- })
5557
- ], TournamentStage);
5558
- return TournamentStage;
5559
- }(BaseModel));
5560
-
5561
- function generateArray(length) {
5562
- if (length <= 0) {
5563
- return [];
5564
- }
5565
- return Array.apply(null, Array(length)).map(function (_, i) { return i + 1; });
5566
- }
5567
- function getArrayChunks(array, length) {
5568
- var chunks = [];
5569
- var chunkLength = Math.ceil(array.length / length);
5570
- if (chunkLength === 0) {
5571
- return [array];
5572
- }
5573
- for (var i = 0; i < chunkLength; i++) {
5574
- chunks.push(array.slice(i * length, (i + 1) * length));
5575
- }
5576
- return chunks;
5577
- }
5578
-
5579
- var PlayoffTypes;
5580
- (function (PlayoffTypes) {
5581
- PlayoffTypes["double_elimination"] = "double_elimination";
5582
- PlayoffTypes["elimination"] = "elimination";
5583
- })(PlayoffTypes || (PlayoffTypes = {}));
5584
- var PlayoffSettings = /** @class */ (function (_super) {
5585
- __extends(PlayoffSettings, _super);
5586
- function PlayoffSettings() {
5587
- return _super !== null && _super.apply(this, arguments) || this;
5588
- }
5589
- PlayoffSettings.toFront = function (data) { };
5590
- PlayoffSettings.toBack = function (data) { };
5591
- __decorate([
5592
- ToFrontHook
5593
- ], PlayoffSettings, "toFront", null);
5594
- __decorate([
5595
- ToBackHook
5596
- ], PlayoffSettings, "toBack", null);
5597
- PlayoffSettings = __decorate([
5598
- ModelInstance({
5599
- mappingFields: {
5600
- rounds: 'rounds',
5601
- final_rounds: 'finalRounds',
5602
- third_place_rounds: 'thirdPlaceRounds',
5603
- teams_count: 'teamsCount',
5604
- type: 'type',
5605
- },
5606
- relation: {
5607
- type: enumField(PlayoffTypes)
5608
- }
5609
- })
5610
- ], PlayoffSettings);
5611
- return PlayoffSettings;
5612
- }(BaseModel));
5613
- var Playoff = /** @class */ (function (_super) {
5614
- __extends(Playoff, _super);
5615
- function Playoff() {
5616
- var _this = _super !== null && _super.apply(this, arguments) || this;
5617
- _this.stages = [];
5618
- return _this;
5619
- }
5620
- Playoff.toFront = function (data) { };
5621
- Playoff.toBack = function (data) { };
5622
- Object.defineProperty(Playoff.prototype, "stagesCount", {
5623
- get: function () {
5624
- return Math.log(this.settings.teamsCount) / Math.log(2);
5625
- },
5626
- enumerable: true,
5627
- configurable: true
5628
- });
5629
- Playoff.prototype.getPlayoffStages = function () {
5630
- var _this = this;
5631
- if (this.stages.length === 0 && this.settings.teamsCount) {
5632
- var stagesCount = Math.log(this.settings.teamsCount) / Math.log(2);
5633
- this.stages = generateArray(stagesCount).map(function (stage) {
5634
- var playoffStage = _this.settings.teamsCount / Math.pow(2, stage);
5635
- var title = '';
5636
- if (playoffStage === 1) {
5637
- title = 'Финал';
5638
- }
5639
- else {
5640
- title = "1 / " + playoffStage;
5641
- }
5642
- return {
5643
- value: stage,
5644
- title: title
5645
- };
5858
+ TeamApi.prototype.joinTeam = function (teamId) {
5859
+ return __awaiter(this, void 0, void 0, function () {
5860
+ return __generator(this, function (_a) {
5861
+ return [2 /*return*/, this.httpClient
5862
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/join/", {})
5863
+ .pipe(map(function (data) { return TeamInvite.toFront(data); }))
5864
+ .toPromise()];
5646
5865
  });
5647
- }
5648
- return this.stages;
5866
+ });
5649
5867
  };
5650
- __decorate([
5651
- ToFrontHook
5652
- ], Playoff, "toFront", null);
5653
- __decorate([
5654
- ToBackHook
5655
- ], Playoff, "toBack", null);
5656
- Playoff = __decorate([
5657
- ModelInstance({
5658
- mappingFields: {
5659
- id: 'id',
5660
- name: 'name',
5661
- settings: 'settings',
5662
- tournament_id: 'tournamentId',
5663
- tournament_stage_id: 'tournamentStageId',
5664
- is_official: 'isOfficial'
5665
- },
5666
- relation: {
5667
- settings: PlayoffSettings
5668
- }
5669
- })
5670
- ], Playoff);
5671
- return Playoff;
5672
- }(BaseModel));
5673
-
5674
- var TournamentStageTeam = /** @class */ (function (_super) {
5675
- __extends(TournamentStageTeam, _super);
5676
- function TournamentStageTeam() {
5677
- return _super !== null && _super.apply(this, arguments) || this;
5678
- }
5679
- Object.defineProperty(TournamentStageTeam.prototype, "gamesWonPercent", {
5680
- get: function () {
5681
- if (!this.gamesCount) {
5682
- return 0;
5683
- }
5684
- return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
5685
- },
5686
- enumerable: true,
5687
- configurable: true
5688
- });
5689
- TournamentStageTeam.toFront = function (data) { };
5690
- TournamentStageTeam.toBack = function (data) { };
5691
- __decorate([
5692
- ToFrontHook
5693
- ], TournamentStageTeam, "toFront", null);
5694
- __decorate([
5695
- ToBackHook
5696
- ], TournamentStageTeam, "toBack", null);
5697
- TournamentStageTeam = __decorate([
5698
- ModelInstance({
5699
- mappingFields: {
5700
- id: 'id',
5701
- tournament_team: 'tournamentTeam',
5702
- group: 'group',
5703
- tournament_stage_id: 'tournamentStageId',
5704
- games_count: 'gamesCount',
5705
- won_games_count: 'wonGamesCount',
5706
- score_sum: 'scoreSum',
5707
- missed_sum: 'missedSum',
5708
- last_games_count: 'lastGamesCount',
5709
- last_games_won: 'lastGamesWon',
5710
- points: 'points',
5711
- final_standing: 'finalStanding',
5712
- received_points: 'receivedPoints',
5713
- },
5714
- relation: {
5715
- tournamentTeam: TournamentTeam,
5716
- group: TournamentGroup
5717
- }
5718
- })
5719
- ], TournamentStageTeam);
5720
- return TournamentStageTeam;
5721
- }(BaseModel));
5722
-
5723
- var LeagueUserRoles;
5724
- (function (LeagueUserRoles) {
5725
- LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
5726
- LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
5727
- LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
5728
- })(LeagueUserRoles || (LeagueUserRoles = {}));
5729
- var LeagueUserPermissions;
5730
- (function (LeagueUserPermissions) {
5731
- LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
5732
- LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
5733
- LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
5734
- LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
5735
- LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
5736
- LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
5737
- LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
5738
- LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
5739
- })(LeagueUserPermissions || (LeagueUserPermissions = {}));
5740
- var LeagueUser = /** @class */ (function (_super) {
5741
- __extends(LeagueUser, _super);
5742
- function LeagueUser() {
5743
- return _super !== null && _super.apply(this, arguments) || this;
5744
- }
5745
- Object.defineProperty(LeagueUser.prototype, "role", {
5746
- get: function () {
5747
- return this._role;
5748
- },
5749
- set: function (value) {
5750
- this._role = LeagueUserRoles[value];
5751
- },
5752
- enumerable: true,
5753
- configurable: true
5754
- });
5755
- LeagueUser.toFront = function (data) { };
5756
- LeagueUser.toBack = function (data) { };
5757
- __decorate([
5758
- ToFrontHook
5759
- ], LeagueUser, "toFront", null);
5760
- __decorate([
5761
- ToBackHook
5762
- ], LeagueUser, "toBack", null);
5763
- LeagueUser = __decorate([
5764
- ModelInstance({
5765
- mappingFields: {
5766
- id: 'id',
5767
- user: 'user',
5768
- role: 'role',
5769
- permissions: 'permissions'
5770
- },
5771
- relation: {
5772
- user: User,
5773
- permissions: listField(enumField(LeagueUserPermissions))
5774
- }
5775
- })
5776
- ], LeagueUser);
5777
- return LeagueUser;
5778
- }(BaseModel));
5779
-
5780
- var TournamentApi = /** @class */ (function () {
5781
- function TournamentApi(httpClient, configService) {
5782
- this.httpClient = httpClient;
5783
- this.configService = configService;
5784
- }
5785
- TournamentApi.prototype.getById = function (tournamentId) {
5868
+ TeamApi.prototype.leaveTeam = function (teamId) {
5786
5869
  return __awaiter(this, void 0, void 0, function () {
5787
5870
  return __generator(this, function (_a) {
5788
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/")
5789
- .pipe(map(function (result) { return Tournament.toFront(result); }))
5871
+ return [2 /*return*/, this.httpClient
5872
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/leave/", {})
5790
5873
  .toPromise()];
5791
5874
  });
5792
5875
  });
5793
5876
  };
5794
- TournamentApi.prototype.getByAlias = function (leagueId, alias) {
5877
+ TeamApi.prototype.getGames = function (teamId, archive) {
5878
+ if (archive === void 0) { archive = false; }
5795
5879
  return __awaiter(this, void 0, void 0, function () {
5796
5880
  return __generator(this, function (_a) {
5797
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/tournaments/" + alias + "/")
5798
- .pipe(map(function (result) { return Tournament.toFront(result); }))
5881
+ return [2 /*return*/, this.httpClient
5882
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/games/" + (archive ? '?archive=1' : ''))
5883
+ .pipe(map(function (data) { return Game.toFront(data); }))
5799
5884
  .toPromise()];
5800
5885
  });
5801
5886
  });
5802
5887
  };
5803
- TournamentApi.prototype.getNews = function (tournamentId) {
5888
+ TeamApi.prototype.createGame = function (teamId, game) {
5804
5889
  return __awaiter(this, void 0, void 0, function () {
5805
5890
  return __generator(this, function (_a) {
5806
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/news/")
5807
- .pipe(map(function (result) { return TournamentNews.toFront(result); }))
5891
+ return [2 /*return*/, this.httpClient
5892
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/games/", Game.toBack(game))
5893
+ .pipe(map(function (data) { return Game.toFront(data); }))
5808
5894
  .toPromise()];
5809
5895
  });
5810
5896
  });
5811
5897
  };
5812
- TournamentApi.prototype.getEvents = function (tournamentId, page, size, filters) {
5898
+ TeamApi.prototype.getTeamEvents = function (teamId) {
5813
5899
  return __awaiter(this, void 0, void 0, function () {
5814
- var params;
5815
5900
  return __generator(this, function (_a) {
5816
- params = new HttpParams().set('page', page.toString())
5817
- .set('size', size.toString());
5818
- if (filters) {
5819
- if (filters.event) {
5820
- params = params.set('event', TournamentEventTypes[filters.event]);
5821
- }
5822
- if (filters.search) {
5823
- params = params.set('search', filters.search);
5824
- }
5825
- if (filters.tournamentTour) {
5826
- params = params.set('tournament_tour', filters.tournamentTour.toString());
5827
- }
5828
- }
5829
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/events/", { params: params, observe: 'response' })
5830
- .pipe(map(function (result) { return ({
5831
- total: +result.headers.get('X-Page-Count'),
5832
- data: TournamentEvent.toFront(result.body)
5833
- }); }))
5901
+ return [2 /*return*/, this.httpClient
5902
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/events/")
5903
+ .pipe(map(function (data) { return TeamEvent.toFront(data); }))
5834
5904
  .toPromise()];
5835
5905
  });
5836
5906
  });
5837
5907
  };
5838
- TournamentApi.prototype.getTournamentStages = function (tournamentId) {
5908
+ TeamApi.prototype.createTeamEvent = function (teamId, teamEvent) {
5839
5909
  return __awaiter(this, void 0, void 0, function () {
5840
5910
  return __generator(this, function (_a) {
5841
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/stages/").pipe(map(function (data) { return TournamentStage.toFront(data); })).toPromise()];
5911
+ return [2 /*return*/, this.httpClient
5912
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/events/", TeamEvent.toBack(teamEvent))
5913
+ .pipe(map(function (data) { return TeamEvent.toFront(data); }))
5914
+ .toPromise()];
5842
5915
  });
5843
5916
  });
5844
5917
  };
5845
- TournamentApi.prototype.getPlayoff = function (tournamentId) {
5918
+ TeamApi.prototype.getTournaments = function (teamId) {
5846
5919
  return __awaiter(this, void 0, void 0, function () {
5847
5920
  return __generator(this, function (_a) {
5848
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/playoff/").pipe(map(function (result) { return Playoff.toFront(result); })).toPromise()];
5921
+ return [2 /*return*/, this.httpClient
5922
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournaments/")
5923
+ .pipe(map(function (data) { return Tournament.toFront(data); }))
5924
+ .toPromise()];
5849
5925
  });
5850
5926
  });
5851
5927
  };
5852
- TournamentApi.prototype.getPlayoffGames = function (playoffId) {
5928
+ TeamApi.prototype.getTournamentTeams = function (teamId) {
5853
5929
  return __awaiter(this, void 0, void 0, function () {
5854
5930
  return __generator(this, function (_a) {
5855
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_playoff/" + playoffId + "/games/").pipe(map(function (result) { return Game.toFront(result); })).toPromise()];
5931
+ return [2 /*return*/, this.httpClient
5932
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournament_teams/")
5933
+ .pipe(map(function (data) { return TournamentTeam.toFront(data); }))
5934
+ .toPromise()];
5856
5935
  });
5857
5936
  });
5858
5937
  };
5859
- TournamentApi.prototype.getGamesStages = function (tournamentId) {
5938
+ TeamApi.prototype.getTournamentInvites = function (teamId) {
5860
5939
  return __awaiter(this, void 0, void 0, function () {
5861
5940
  return __generator(this, function (_a) {
5862
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games_stages/")
5863
- .pipe(map(function (data) { return GameTimelineStages.toFront(data); }))
5941
+ return [2 /*return*/, this.httpClient
5942
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournament_invites/")
5943
+ .pipe(map(function (data) { return TournamentInvite.toFront(data); }))
5864
5944
  .toPromise()];
5865
5945
  });
5866
5946
  });
5867
5947
  };
5868
- TournamentApi.prototype.getGames = function (tournamentId, page, size, filters) {
5869
- if (filters === void 0) { filters = {}; }
5948
+ TeamApi.prototype.getTournamentGames = function (teamId, tournamentId, page, size) {
5870
5949
  return __awaiter(this, void 0, void 0, function () {
5871
- var params, statuses;
5950
+ var params;
5872
5951
  return __generator(this, function (_a) {
5873
5952
  params = new HttpParams().set('page', page.toString());
5874
5953
  if (size) {
5875
5954
  params = params.set('size', size.toString());
5876
5955
  }
5877
- if (filters.tournamentStageId) {
5878
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
5879
- }
5880
- if (filters.tournamentTour) {
5881
- params = params.set('tournament_tour', filters.tournamentTour.toString());
5882
- }
5883
- if (filters.playoffStage) {
5884
- params = params.set('playoff_stage', filters.playoffStage.toString());
5885
- }
5886
- if (filters.teamId) {
5887
- params = params.set('team_id', filters.teamId.toString());
5888
- }
5889
- if (filters.status) {
5890
- params = params.set('status', GameStatuses[filters.status]);
5891
- }
5892
- if (filters.statuses) {
5893
- statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
5894
- params = params.set('statuses', statuses.join(','));
5895
- }
5896
- if (filters.tournamentCourtId) {
5897
- params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
5898
- }
5899
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games/", { params: params, observe: 'response' })
5900
- .pipe(map(function (result) { return ({
5901
- total: +result.headers.get('X-Page-Count'),
5902
- data: Game.toFront(result.body)
5903
- }); })).toPromise()];
5956
+ return [2 /*return*/, this.httpClient
5957
+ .get(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/tournaments/" + tournamentId + "/games/", { params: params, observe: 'response' })
5958
+ .pipe(map(function (response) {
5959
+ return {
5960
+ total: +response.headers.get('X-Page-Count'),
5961
+ data: Game.toFront(response.body)
5962
+ };
5963
+ }))
5964
+ .toPromise()];
5965
+ });
5966
+ });
5967
+ };
5968
+ TeamApi.prototype.acceptTournamentInvite = function (inviteId) {
5969
+ return __awaiter(this, void 0, void 0, function () {
5970
+ return __generator(this, function (_a) {
5971
+ return [2 /*return*/, this.httpClient
5972
+ .post(this.configService.get('apiUrl') + "/api/v1/tournament_invite/" + inviteId + "/accept/", {})
5973
+ .pipe(map(function (data) { return TournamentInvite.toFront(data); }))
5974
+ .toPromise()];
5975
+ });
5976
+ });
5977
+ };
5978
+ TeamApi.prototype.declineTournamentInvite = function (inviteId) {
5979
+ return __awaiter(this, void 0, void 0, function () {
5980
+ return __generator(this, function (_a) {
5981
+ return [2 /*return*/, this.httpClient
5982
+ .post(this.configService.get('apiUrl') + "/api/v1/tournament_invite/" + inviteId + "/decline/", {})
5983
+ .pipe(map(function (data) { return TournamentInvite.toFront(data); }))
5984
+ .toPromise()];
5904
5985
  });
5905
5986
  });
5906
5987
  };
5907
- TournamentApi.prototype.getTeams = function (tournamentId) {
5988
+ TeamApi.prototype.registerLazyUser = function (teamId, userData) {
5908
5989
  return __awaiter(this, void 0, void 0, function () {
5909
5990
  return __generator(this, function (_a) {
5910
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/teams/")
5911
- .pipe(map(function (result) { return TournamentTeam.toFront(result); }))
5991
+ return [2 /*return*/, this.httpClient
5992
+ .post(this.configService.get('apiUrl') + "/api/v1/team/" + teamId + "/lazy_user/", { user: User.toBack(userData) })
5993
+ .pipe(map(function (data) { return TeamUser.toFront(data); }))
5912
5994
  .toPromise()];
5913
5995
  });
5914
5996
  });
5915
5997
  };
5916
- TournamentApi.prototype.getStageTeams = function (tournamentId) {
5998
+ TeamApi.prototype.getLazyUser = function (teamUserId) {
5917
5999
  return __awaiter(this, void 0, void 0, function () {
5918
6000
  return __generator(this, function (_a) {
5919
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/stage_teams/")
5920
- .pipe(map(function (result) { return TournamentStageTeam.toFront(result); }))
6001
+ return [2 /*return*/, this.httpClient
6002
+ .get(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/")
6003
+ .pipe(map(function (data) { return TeamUser.toFront(data); }))
5921
6004
  .toPromise()];
5922
6005
  });
5923
6006
  });
5924
6007
  };
5925
- TournamentApi.prototype.getTeamById = function (tournamentTeamId) {
6008
+ TeamApi.prototype.updateLazyUser = function (teamUserId, userData) {
5926
6009
  return __awaiter(this, void 0, void 0, function () {
5927
6010
  return __generator(this, function (_a) {
5928
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/")
5929
- .pipe(map(function (result) { return TournamentTeam.toFront(result); }))
6011
+ return [2 /*return*/, this.httpClient
6012
+ .patch(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/", { user: User.toBack(userData) })
6013
+ .pipe(map(function (data) { return TeamUser.toFront(data); }))
5930
6014
  .toPromise()];
5931
6015
  });
5932
6016
  });
5933
6017
  };
5934
- TournamentApi.prototype.getUserById = function (userId) {
6018
+ TeamApi.prototype.deleteLazyUser = function (teamUserId) {
5935
6019
  return __awaiter(this, void 0, void 0, function () {
5936
6020
  return __generator(this, function (_a) {
5937
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team_user/" + userId + "/")
5938
- .pipe(map(function (result) { return TournamentTeamUser.toFront(result); }))
6021
+ return [2 /*return*/, this.httpClient
6022
+ .delete(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/")
5939
6023
  .toPromise()];
5940
6024
  });
5941
6025
  });
5942
6026
  };
5943
- TournamentApi.prototype.getUserGames = function (tournamentUserId) {
6027
+ TeamApi.prototype.resendLazyUserEmail = function (teamUserId) {
5944
6028
  return __awaiter(this, void 0, void 0, function () {
5945
6029
  return __generator(this, function (_a) {
5946
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team_user/" + tournamentUserId + "/games/")
5947
- .pipe(map(function (result) { return Game.toFront(result); }))
6030
+ return [2 /*return*/, this.httpClient
6031
+ .post(this.configService.get('apiUrl') + "/api/v1/lazy_user/" + teamUserId + "/resend_email/", {})
5948
6032
  .toPromise()];
5949
6033
  });
5950
6034
  });
5951
6035
  };
5952
- TournamentApi.prototype.getBasketballStatistic = function (filters) {
6036
+ TeamApi.ctorParameters = function () { return [
6037
+ { type: HttpClient },
6038
+ { type: ConfigService }
6039
+ ]; };
6040
+ TeamApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamApi_Factory() { return new TeamApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamApi, providedIn: "root" });
6041
+ TeamApi = __decorate([
6042
+ Injectable({ providedIn: 'root' })
6043
+ ], TeamApi);
6044
+ return TeamApi;
6045
+ }());
6046
+
6047
+ var TeamEventApi = /** @class */ (function () {
6048
+ function TeamEventApi(httpClient, configService) {
6049
+ this.httpClient = httpClient;
6050
+ this.configService = configService;
6051
+ }
6052
+ TeamEventApi.prototype.getTeamEvent = function (teamEventId) {
5953
6053
  return __awaiter(this, void 0, void 0, function () {
5954
- var params, _a, _b, key;
5955
- var e_1, _c;
5956
- return __generator(this, function (_d) {
5957
- params = new HttpParams();
5958
- if (filters) {
5959
- try {
5960
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5961
- key = _b.value;
5962
- if (filters[key]) {
5963
- params = params.set(key, filters[key]);
5964
- }
5965
- }
5966
- }
5967
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
5968
- finally {
5969
- try {
5970
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
5971
- }
5972
- finally { if (e_1) throw e_1.error; }
5973
- }
5974
- if (filters.per_game !== undefined) {
5975
- params = params.set('per_game', filters.per_game ? '1' : '0');
5976
- }
5977
- }
5978
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/basketball_statistic/", { params: params }).pipe(map(function (result) { return BasketballStatistic.toFront(result); })).toPromise()];
6054
+ return __generator(this, function (_a) {
6055
+ return [2 /*return*/, this.httpClient
6056
+ .get(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/")
6057
+ .pipe(map(function (data) { return TeamEvent.toFront(data); }))
6058
+ .toPromise()];
5979
6059
  });
5980
6060
  });
5981
6061
  };
5982
- TournamentApi.prototype.getVolleyballStatistic = function (filters) {
6062
+ TeamEventApi.prototype.updateTeamEvent = function (teamEvent) {
5983
6063
  return __awaiter(this, void 0, void 0, function () {
5984
- var params, _a, _b, key;
5985
- var e_2, _c;
5986
- return __generator(this, function (_d) {
5987
- params = new HttpParams();
5988
- if (filters) {
5989
- try {
5990
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
5991
- key = _b.value;
5992
- if (filters[key]) {
5993
- params = params.set(key, filters[key]);
5994
- }
5995
- }
5996
- }
5997
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
5998
- finally {
5999
- try {
6000
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
6001
- }
6002
- finally { if (e_2) throw e_2.error; }
6003
- }
6004
- if (filters.per_game !== undefined) {
6005
- params = params.set('per_game', filters.per_game ? '1' : '0');
6006
- }
6007
- }
6008
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/volleyball_statistic/", { params: params }).pipe(map(function (result) { return VolleyballStatistic.toFront(result); })).toPromise()];
6064
+ return __generator(this, function (_a) {
6065
+ return [2 /*return*/, this.httpClient
6066
+ .patch(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEvent.id + "/", TeamEvent.toBack(teamEvent))
6067
+ .pipe(map(function (data) { return TeamEvent.toFront(data); }))
6068
+ .toPromise()];
6009
6069
  });
6010
6070
  });
6011
6071
  };
6012
- TournamentApi.prototype.getHockeyStatistic = function (filters) {
6072
+ TeamEventApi.prototype.deleteTeamEvent = function (teamEventId) {
6013
6073
  return __awaiter(this, void 0, void 0, function () {
6014
- var params, _a, _b, key;
6015
- var e_3, _c;
6016
- return __generator(this, function (_d) {
6017
- params = new HttpParams();
6018
- if (filters) {
6019
- try {
6020
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
6021
- key = _b.value;
6022
- if (filters[key]) {
6023
- params = params.set(key, filters[key]);
6024
- }
6025
- }
6026
- }
6027
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
6028
- finally {
6029
- try {
6030
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
6031
- }
6032
- finally { if (e_3) throw e_3.error; }
6033
- }
6034
- if (filters.per_game !== undefined) {
6035
- params = params.set('per_game', filters.per_game ? '1' : '0');
6036
- }
6037
- }
6038
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/hockey_statistic/", { params: params }).pipe(map(function (result) { return HockeyStatistic.toFront(result); })).toPromise()];
6074
+ return __generator(this, function (_a) {
6075
+ return [2 /*return*/, this.httpClient
6076
+ .delete(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/")
6077
+ .toPromise()];
6039
6078
  });
6040
6079
  });
6041
6080
  };
6042
- TournamentApi.prototype.getFootballStatistic = function (filters) {
6081
+ TeamEventApi.prototype.getTeamEventInvites = function (teamEventId) {
6043
6082
  return __awaiter(this, void 0, void 0, function () {
6044
- var params, _a, _b, key;
6045
- var e_4, _c;
6046
- return __generator(this, function (_d) {
6047
- params = new HttpParams();
6048
- if (filters) {
6049
- try {
6050
- for (_a = __values(Object.keys(filters)), _b = _a.next(); !_b.done; _b = _a.next()) {
6051
- key = _b.value;
6052
- if (filters[key]) {
6053
- params = params.set(key, filters[key]);
6054
- }
6055
- }
6056
- }
6057
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
6058
- finally {
6059
- try {
6060
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
6061
- }
6062
- finally { if (e_4) throw e_4.error; }
6063
- }
6064
- if (filters.per_game !== undefined) {
6065
- params = params.set('per_game', filters.per_game ? '1' : '0');
6066
- }
6067
- }
6068
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/football_statistic/", { params: params }).pipe(map(function (result) { return FootballStatistic.toFront(result); })).toPromise()];
6083
+ return __generator(this, function (_a) {
6084
+ return [2 /*return*/, this.httpClient
6085
+ .get(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/invites/")
6086
+ .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
6087
+ .toPromise()];
6069
6088
  });
6070
6089
  });
6071
6090
  };
6072
- TournamentApi.prototype.getTournamentTeamUsers = function (tournamentTeamId) {
6091
+ TeamEventApi.prototype.createTeamEventInvite = function (teamEventId, teamUserId) {
6073
6092
  return __awaiter(this, void 0, void 0, function () {
6074
6093
  return __generator(this, function (_a) {
6075
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_team/" + tournamentTeamId + "/users/").pipe(map(function (result) { return TournamentTeamUser.toFront(result); })).toPromise()];
6094
+ return [2 /*return*/, this.httpClient
6095
+ .post(this.configService.get('apiUrl') + "/api/v1/team_event/" + teamEventId + "/invites/", { team_user_id: teamUserId })
6096
+ .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
6097
+ .toPromise()];
6076
6098
  });
6077
6099
  });
6078
6100
  };
6079
- TournamentApi.prototype.myPermission = function (tournamentId) {
6101
+ TeamEventApi.prototype.acceptTeamEventInvite = function (teamEventInvite) {
6080
6102
  return __awaiter(this, void 0, void 0, function () {
6081
6103
  return __generator(this, function (_a) {
6082
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/permission/").pipe(map(function (data) { return (data.permissions || []).map(function (item) { return LeagueUserPermissions[item]; }); })).toPromise()];
6104
+ return [2 /*return*/, this.httpClient
6105
+ .post(this.configService.get('apiUrl') + "/api/v1/team_event_invite/" + teamEventInvite.id + "/accept/", {})
6106
+ .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
6107
+ .toPromise()];
6083
6108
  });
6084
6109
  });
6085
6110
  };
6086
- TournamentApi.ctorParameters = function () { return [
6111
+ TeamEventApi.prototype.declineTeamEventInvite = function (teamEventInvite) {
6112
+ return __awaiter(this, void 0, void 0, function () {
6113
+ return __generator(this, function (_a) {
6114
+ return [2 /*return*/, this.httpClient
6115
+ .post(this.configService.get('apiUrl') + "/api/v1/team_event_invite/" + teamEventInvite.id + "/decline/", {})
6116
+ .pipe(map(function (data) { return TeamEventInvite.toFront(data); }))
6117
+ .toPromise()];
6118
+ });
6119
+ });
6120
+ };
6121
+ TeamEventApi.ctorParameters = function () { return [
6087
6122
  { type: HttpClient },
6088
6123
  { type: ConfigService }
6089
6124
  ]; };
6090
- TournamentApi.ɵprov = ɵɵdefineInjectable({ factory: function TournamentApi_Factory() { return new TournamentApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TournamentApi, providedIn: "root" });
6091
- TournamentApi = __decorate([
6125
+ TeamEventApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamEventApi_Factory() { return new TeamEventApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamEventApi, providedIn: "root" });
6126
+ TeamEventApi = __decorate([
6092
6127
  Injectable({ providedIn: 'root' })
6093
- ], TournamentApi);
6094
- return TournamentApi;
6128
+ ], TeamEventApi);
6129
+ return TeamEventApi;
6095
6130
  }());
6096
6131
 
6097
6132
  var TournamentJoinData = /** @class */ (function (_super) {
@@ -6229,34 +6264,13 @@ var TournamentSeasonApi = /** @class */ (function () {
6229
6264
  };
6230
6265
  TournamentSeasonApi.prototype.getGames = function (seasonId, page, size, filters) {
6231
6266
  return __awaiter(this, void 0, void 0, function () {
6232
- var params, statuses;
6267
+ var params;
6233
6268
  return __generator(this, function (_a) {
6234
6269
  params = new HttpParams().set('page', page.toString());
6235
6270
  if (size) {
6236
6271
  params = params.set('size', size.toString());
6237
6272
  }
6238
- if (filters.tournamentStageId) {
6239
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
6240
- }
6241
- if (filters.tournamentTour) {
6242
- params = params.set('tournament_tour', filters.tournamentTour.toString());
6243
- }
6244
- if (filters.playoffStage) {
6245
- params = params.set('playoff_stage', filters.playoffStage.toString());
6246
- }
6247
- if (filters.teamId) {
6248
- params = params.set('team_id', filters.teamId.toString());
6249
- }
6250
- if (filters.status) {
6251
- params = params.set('status', GameStatuses[filters.status]);
6252
- }
6253
- if (filters.statuses) {
6254
- statuses = filters.statuses.map(function (i) { return GameStatuses[i]; });
6255
- params = params.set('statuses', statuses.join(','));
6256
- }
6257
- if (filters.tournamentCourtId) {
6258
- params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
6259
- }
6273
+ params = applyGamesFilters(filters, params);
6260
6274
  return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_season/" + seasonId + "/games/", { params: params, observe: 'response' }).pipe(map(function (result) { return ({
6261
6275
  total: +result.headers.get('X-Page-Count'),
6262
6276
  data: Game.toFront(result.body)
@@ -7035,10 +7049,13 @@ var VolleyballGameLog = /** @class */ (function (_super) {
7035
7049
  return VolleyballGameLog;
7036
7050
  }(BaseModel));
7037
7051
 
7038
- var VolleyballGameApi = /** @class */ (function () {
7052
+ var VolleyballGameApi = /** @class */ (function (_super) {
7053
+ __extends(VolleyballGameApi, _super);
7039
7054
  function VolleyballGameApi(httpClient, configService) {
7040
- this.httpClient = httpClient;
7041
- this.configService = configService;
7055
+ var _this = _super.call(this, httpClient, configService) || this;
7056
+ _this.httpClient = httpClient;
7057
+ _this.configService = configService;
7058
+ return _this;
7042
7059
  }
7043
7060
  VolleyballGameApi.prototype.getById = function (gameId) {
7044
7061
  return __awaiter(this, void 0, void 0, function () {
@@ -7047,13 +7064,6 @@ var VolleyballGameApi = /** @class */ (function () {
7047
7064
  });
7048
7065
  });
7049
7066
  };
7050
- VolleyballGameApi.prototype.getUsers = function (gameId) {
7051
- return __awaiter(this, void 0, void 0, function () {
7052
- return __generator(this, function (_a) {
7053
- return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_game/" + gameId + "/users/").pipe(map(function (result) { return GameUser.toFront(result); })).toPromise()];
7054
- });
7055
- });
7056
- };
7057
7067
  VolleyballGameApi.prototype.getTeamStatistic = function (gameId) {
7058
7068
  return __awaiter(this, void 0, void 0, function () {
7059
7069
  return __generator(this, function (_a) {
@@ -7084,6 +7094,56 @@ var VolleyballGameApi = /** @class */ (function () {
7084
7094
  Injectable({ providedIn: 'root' })
7085
7095
  ], VolleyballGameApi);
7086
7096
  return VolleyballGameApi;
7097
+ }(GameBaseApi));
7098
+
7099
+ var PublicTeamApi = /** @class */ (function () {
7100
+ function PublicTeamApi(httpClient, configService) {
7101
+ this.httpClient = httpClient;
7102
+ this.configService = configService;
7103
+ }
7104
+ PublicTeamApi.prototype.getById = function (teamId) {
7105
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/public_team/" + teamId + "/").pipe(map(function (result) { return Team.toFront(result); })).toPromise();
7106
+ };
7107
+ PublicTeamApi.prototype.getTournamentTeams = function (teamId, leagueId) {
7108
+ var params = new HttpParams().set('league_id', leagueId.toString());
7109
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/public_team/" + teamId + "/tournament_teams/", { params: params }).pipe(map(function (result) { return TournamentTeam.toFront(result); })).toPromise();
7110
+ };
7111
+ PublicTeamApi.ctorParameters = function () { return [
7112
+ { type: HttpClient },
7113
+ { type: ConfigService }
7114
+ ]; };
7115
+ PublicTeamApi.ɵprov = ɵɵdefineInjectable({ factory: function PublicTeamApi_Factory() { return new PublicTeamApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: PublicTeamApi, providedIn: "root" });
7116
+ PublicTeamApi = __decorate([
7117
+ Injectable({ providedIn: 'root' })
7118
+ ], PublicTeamApi);
7119
+ return PublicTeamApi;
7120
+ }());
7121
+
7122
+ var PublicUserApi = /** @class */ (function () {
7123
+ function PublicUserApi(httpClient, configService) {
7124
+ this.httpClient = httpClient;
7125
+ this.configService = configService;
7126
+ }
7127
+ PublicUserApi.prototype.getById = function (userId) {
7128
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/public_user/" + userId + "/").pipe(map(function (result) { return User.toFront(result); })).toPromise();
7129
+ };
7130
+ PublicUserApi.prototype.getTournaments = function (userId, leagueId) {
7131
+ var params = new HttpParams().set('league_id', leagueId.toString());
7132
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/public_user/" + userId + "/tournaments/", { params: params }).pipe(map(function (result) { return Tournament.toFront(result); })).toPromise();
7133
+ };
7134
+ PublicUserApi.prototype.getTournamentUser = function (userId, seasonId) {
7135
+ var params = new HttpParams().set('season_id', seasonId.toString());
7136
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/public_user/" + userId + "/tournament_user/", { params: params }).pipe(map(function (result) { return TournamentTeamUser.toFront(result); })).toPromise();
7137
+ };
7138
+ PublicUserApi.ctorParameters = function () { return [
7139
+ { type: HttpClient },
7140
+ { type: ConfigService }
7141
+ ]; };
7142
+ PublicUserApi.ɵprov = ɵɵdefineInjectable({ factory: function PublicUserApi_Factory() { return new PublicUserApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: PublicUserApi, providedIn: "root" });
7143
+ PublicUserApi = __decorate([
7144
+ Injectable({ providedIn: 'root' })
7145
+ ], PublicUserApi);
7146
+ return PublicUserApi;
7087
7147
  }());
7088
7148
 
7089
7149
  var _a$1;
@@ -7718,5 +7778,5 @@ var HttpCookieInterceptor = /** @class */ (function () {
7718
7778
  * Generated bundle index. Do not edit.
7719
7779
  */
7720
7780
 
7721
- 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, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, 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, 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, penaltyTypeField as ɵa };
7781
+ 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, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, 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, penaltyTypeField as ɵa, GameBaseApi as ɵb };
7722
7782
  //# sourceMappingURL=mtgame-core.js.map