@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
@@ -1008,6 +1008,7 @@ Tournament = __decorate([
1008
1008
  team_second: 'teamSecond',
1009
1009
  team_third: 'teamThird',
1010
1010
  season: 'season',
1011
+ season_id: 'seasonId',
1011
1012
  },
1012
1013
  relation: {
1013
1014
  logo: File,
@@ -1329,209 +1330,6 @@ Game = __decorate([
1329
1330
  })
1330
1331
  ], Game);
1331
1332
 
1332
- var TeamUserRole;
1333
- (function (TeamUserRole) {
1334
- TeamUserRole[TeamUserRole["member"] = 1] = "member";
1335
- TeamUserRole[TeamUserRole["moderator"] = 2] = "moderator";
1336
- TeamUserRole[TeamUserRole["admin"] = 3] = "admin";
1337
- })(TeamUserRole || (TeamUserRole = {}));
1338
- let TeamUser = class TeamUser extends BaseModel {
1339
- static toFront(data) { }
1340
- static toBack(teamPlayer) { }
1341
- };
1342
- __decorate([
1343
- ToFrontHook
1344
- ], TeamUser, "toFront", null);
1345
- __decorate([
1346
- ToBackHook
1347
- ], TeamUser, "toBack", null);
1348
- TeamUser = __decorate([
1349
- ModelInstance({
1350
- mappingFields: {
1351
- id: 'id',
1352
- team_id: 'teamId',
1353
- user: 'user',
1354
- role: 'role',
1355
- number: 'number',
1356
- team: 'team',
1357
- },
1358
- relation: {
1359
- user: User,
1360
- team: Team,
1361
- role: enumField(TeamUserRole)
1362
- }
1363
- })
1364
- ], TeamUser);
1365
-
1366
- let TournamentGroup = class TournamentGroup extends BaseModel {
1367
- static toFront(data) { }
1368
- static toBack(data) { }
1369
- };
1370
- __decorate([
1371
- ToFrontHook
1372
- ], TournamentGroup, "toFront", null);
1373
- __decorate([
1374
- ToBackHook
1375
- ], TournamentGroup, "toBack", null);
1376
- TournamentGroup = __decorate([
1377
- ModelInstance({
1378
- mappingFields: {
1379
- id: 'id',
1380
- name: 'name',
1381
- tournament_stage_id: 'tournamentStageId'
1382
- }
1383
- })
1384
- ], TournamentGroup);
1385
-
1386
- let TournamentTeam = class TournamentTeam extends BaseModel {
1387
- get gamesWonPercent() {
1388
- if (!this.gamesCount) {
1389
- return 0;
1390
- }
1391
- return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
1392
- }
1393
- static toFront(data) { }
1394
- static toBack(data) { }
1395
- };
1396
- __decorate([
1397
- ToFrontHook
1398
- ], TournamentTeam, "toFront", null);
1399
- __decorate([
1400
- ToBackHook
1401
- ], TournamentTeam, "toBack", null);
1402
- TournamentTeam = __decorate([
1403
- ModelInstance({
1404
- mappingFields: {
1405
- id: 'id',
1406
- team_id: 'teamId',
1407
- tournament_id: 'tournamentId',
1408
- tournament: 'tournament',
1409
- team: 'team',
1410
- group: 'group',
1411
- final_standing: 'finalStanding',
1412
- games_count: 'gamesCount',
1413
- won_games_count: 'wonGamesCount',
1414
- draw_games_count: 'drawGamesCount',
1415
- last_games_count: 'lastGamesCount',
1416
- last_games_won: 'lastGamesWon',
1417
- score_sum: 'scoreSum',
1418
- missed_sum: 'missedSum',
1419
- score_points_sum: 'scorePointsSum',
1420
- missed_points_sum: 'missedPointsSum',
1421
- points: 'points',
1422
- users_count: 'usersCount',
1423
- games: 'games',
1424
- notifications_count: 'notificationsCount',
1425
- win_normal_time_games_count: 'winNormalTimeGamesCount',
1426
- lose_normal_time_games_count: 'loseNormalTimeGamesCount',
1427
- win_overtime_games_count: 'winOvertimeGamesCount',
1428
- lose_overtime_games_count: 'loseOvertimeGamesCount',
1429
- },
1430
- relation: {
1431
- tournament: Tournament,
1432
- team: Team,
1433
- group: TournamentGroup,
1434
- games: Game,
1435
- }
1436
- })
1437
- ], TournamentTeam);
1438
-
1439
- let TournamentDisqualification = class TournamentDisqualification extends BaseModel {
1440
- static toFront(data) { }
1441
- static toBack(data) { }
1442
- };
1443
- __decorate([
1444
- ToFrontHook
1445
- ], TournamentDisqualification, "toFront", null);
1446
- __decorate([
1447
- ToBackHook
1448
- ], TournamentDisqualification, "toBack", null);
1449
- TournamentDisqualification = __decorate([
1450
- ModelInstance({
1451
- mappingFields: {
1452
- id: 'id',
1453
- tournament_team_user_id: 'tournamentTeamUserId',
1454
- date_from: 'dateFrom',
1455
- date_to: 'dateTo',
1456
- matches_count: 'matchesCount',
1457
- },
1458
- relation: {
1459
- dateFrom: DateField,
1460
- dateTo: DateField,
1461
- }
1462
- })
1463
- ], TournamentDisqualification);
1464
-
1465
- let TournamentTeamUser = class TournamentTeamUser extends BaseModel {
1466
- get fullName() {
1467
- return [this.lastName, this.firstName, this.middleName].filter(s => s).join(' ');
1468
- }
1469
- get shortName() {
1470
- return [this.lastName, this.firstName].filter(s => s).join(' ');
1471
- }
1472
- get initials() {
1473
- return [this.lastName, this.firstName].filter(s => s).map(s => s.substr(0, 1)).join('');
1474
- }
1475
- static toFront(data) { }
1476
- static toBack(data) { }
1477
- };
1478
- __decorate([
1479
- ToFrontHook
1480
- ], TournamentTeamUser, "toFront", null);
1481
- __decorate([
1482
- ToBackHook
1483
- ], TournamentTeamUser, "toBack", null);
1484
- TournamentTeamUser = __decorate([
1485
- ModelInstance({
1486
- mappingFields: {
1487
- id: 'id',
1488
- tournament_team: 'tournamentTeam',
1489
- team_user: 'teamUser',
1490
- disqualified: 'disqualified',
1491
- first_name: 'firstName',
1492
- last_name: 'lastName',
1493
- middle_name: 'middleName',
1494
- photo: 'photo',
1495
- disqualification: 'disqualification',
1496
- has_changes: 'hasChanges',
1497
- rating: 'rating'
1498
- },
1499
- relation: {
1500
- tournamentTeam: TournamentTeam,
1501
- teamUser: TeamUser,
1502
- photo: File,
1503
- disqualification: TournamentDisqualification,
1504
- }
1505
- })
1506
- ], TournamentTeamUser);
1507
-
1508
- let GameUser = class GameUser extends BaseModel {
1509
- static toFront(data) { }
1510
- static toBack(data) { }
1511
- };
1512
- __decorate([
1513
- ToFrontHook
1514
- ], GameUser, "toFront", null);
1515
- __decorate([
1516
- ToBackHook
1517
- ], GameUser, "toBack", null);
1518
- GameUser = __decorate([
1519
- ModelInstance({
1520
- mappingFields: {
1521
- id: 'id',
1522
- game_id: 'gameId',
1523
- team_user: 'teamUser',
1524
- tournament_team_user: 'tournamentTeamUser',
1525
- updated_at: 'updatedAt'
1526
- },
1527
- relation: {
1528
- teamUser: TeamUser,
1529
- tournamentTeamUser: TournamentTeamUser,
1530
- updatedAt: DateTimeField,
1531
- }
1532
- })
1533
- ], GameUser);
1534
-
1535
1333
  function updateItemInArray(data, item, force = false, checkFunction) {
1536
1334
  if (!Array.isArray(data)) {
1537
1335
  return data;
@@ -1715,39 +1513,215 @@ ConfigService = __decorate([
1715
1513
  __param(0, Optional()), __param(0, Inject(CONFIG_DATA))
1716
1514
  ], ConfigService);
1717
1515
 
1718
- class BaseStatistic {
1719
- }
1516
+ let TournamentGroup = class TournamentGroup extends BaseModel {
1517
+ static toFront(data) { }
1518
+ static toBack(data) { }
1519
+ };
1520
+ __decorate([
1521
+ ToFrontHook
1522
+ ], TournamentGroup, "toFront", null);
1523
+ __decorate([
1524
+ ToBackHook
1525
+ ], TournamentGroup, "toBack", null);
1526
+ TournamentGroup = __decorate([
1527
+ ModelInstance({
1528
+ mappingFields: {
1529
+ id: 'id',
1530
+ name: 'name',
1531
+ tournament_stage_id: 'tournamentStageId'
1532
+ }
1533
+ })
1534
+ ], TournamentGroup);
1720
1535
 
1721
- let BasketballStatistic = class BasketballStatistic extends BaseStatistic {
1722
- get totalFouls() {
1723
- return this.personalFouls + this.technicalFouls + this.unsportsmanlikeFouls;
1536
+ let TournamentTeam = class TournamentTeam extends BaseModel {
1537
+ get gamesWonPercent() {
1538
+ if (!this.gamesCount) {
1539
+ return 0;
1540
+ }
1541
+ return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
1724
1542
  }
1725
1543
  static toFront(data) { }
1726
1544
  static toBack(data) { }
1727
1545
  };
1728
1546
  __decorate([
1729
1547
  ToFrontHook
1730
- ], BasketballStatistic, "toFront", null);
1548
+ ], TournamentTeam, "toFront", null);
1731
1549
  __decorate([
1732
1550
  ToBackHook
1733
- ], BasketballStatistic, "toBack", null);
1734
- BasketballStatistic = __decorate([
1551
+ ], TournamentTeam, "toBack", null);
1552
+ TournamentTeam = __decorate([
1735
1553
  ModelInstance({
1736
1554
  mappingFields: {
1737
- tournament_team_user: 'tournamentTeamUser',
1555
+ id: 'id',
1556
+ team_id: 'teamId',
1557
+ tournament_id: 'tournamentId',
1558
+ tournament: 'tournament',
1738
1559
  team: 'team',
1739
- team_user: 'teamUser',
1740
- user: 'user',
1741
- tournament_team: 'tournamentTeam',
1742
- month: 'month',
1743
- win_lose: 'winLose',
1560
+ group: 'group',
1561
+ final_standing: 'finalStanding',
1744
1562
  games_count: 'gamesCount',
1745
1563
  won_games_count: 'wonGamesCount',
1746
- points: 'points',
1747
- two_points_made: 'twoPointsMade',
1748
- three_points_made: 'threePointsMade',
1749
- free_throws_made: 'freeThrowsMade',
1750
- one_points_made: 'onePointsMade',
1564
+ draw_games_count: 'drawGamesCount',
1565
+ last_games_count: 'lastGamesCount',
1566
+ last_games_won: 'lastGamesWon',
1567
+ score_sum: 'scoreSum',
1568
+ missed_sum: 'missedSum',
1569
+ score_points_sum: 'scorePointsSum',
1570
+ missed_points_sum: 'missedPointsSum',
1571
+ points: 'points',
1572
+ users_count: 'usersCount',
1573
+ games: 'games',
1574
+ notifications_count: 'notificationsCount',
1575
+ win_normal_time_games_count: 'winNormalTimeGamesCount',
1576
+ lose_normal_time_games_count: 'loseNormalTimeGamesCount',
1577
+ win_overtime_games_count: 'winOvertimeGamesCount',
1578
+ lose_overtime_games_count: 'loseOvertimeGamesCount',
1579
+ },
1580
+ relation: {
1581
+ tournament: Tournament,
1582
+ team: Team,
1583
+ group: TournamentGroup,
1584
+ games: Game,
1585
+ }
1586
+ })
1587
+ ], TournamentTeam);
1588
+
1589
+ var TeamUserRole;
1590
+ (function (TeamUserRole) {
1591
+ TeamUserRole[TeamUserRole["member"] = 1] = "member";
1592
+ TeamUserRole[TeamUserRole["moderator"] = 2] = "moderator";
1593
+ TeamUserRole[TeamUserRole["admin"] = 3] = "admin";
1594
+ })(TeamUserRole || (TeamUserRole = {}));
1595
+ let TeamUser = class TeamUser extends BaseModel {
1596
+ static toFront(data) { }
1597
+ static toBack(teamPlayer) { }
1598
+ };
1599
+ __decorate([
1600
+ ToFrontHook
1601
+ ], TeamUser, "toFront", null);
1602
+ __decorate([
1603
+ ToBackHook
1604
+ ], TeamUser, "toBack", null);
1605
+ TeamUser = __decorate([
1606
+ ModelInstance({
1607
+ mappingFields: {
1608
+ id: 'id',
1609
+ team_id: 'teamId',
1610
+ user: 'user',
1611
+ role: 'role',
1612
+ number: 'number',
1613
+ team: 'team',
1614
+ },
1615
+ relation: {
1616
+ user: User,
1617
+ team: Team,
1618
+ role: enumField(TeamUserRole)
1619
+ }
1620
+ })
1621
+ ], TeamUser);
1622
+
1623
+ let TournamentDisqualification = class TournamentDisqualification extends BaseModel {
1624
+ static toFront(data) { }
1625
+ static toBack(data) { }
1626
+ };
1627
+ __decorate([
1628
+ ToFrontHook
1629
+ ], TournamentDisqualification, "toFront", null);
1630
+ __decorate([
1631
+ ToBackHook
1632
+ ], TournamentDisqualification, "toBack", null);
1633
+ TournamentDisqualification = __decorate([
1634
+ ModelInstance({
1635
+ mappingFields: {
1636
+ id: 'id',
1637
+ tournament_team_user_id: 'tournamentTeamUserId',
1638
+ date_from: 'dateFrom',
1639
+ date_to: 'dateTo',
1640
+ matches_count: 'matchesCount',
1641
+ },
1642
+ relation: {
1643
+ dateFrom: DateField,
1644
+ dateTo: DateField,
1645
+ }
1646
+ })
1647
+ ], TournamentDisqualification);
1648
+
1649
+ let TournamentTeamUser = class TournamentTeamUser extends BaseModel {
1650
+ get fullName() {
1651
+ return [this.lastName, this.firstName, this.middleName].filter(s => s).join(' ');
1652
+ }
1653
+ get shortName() {
1654
+ return [this.lastName, this.firstName].filter(s => s).join(' ');
1655
+ }
1656
+ get initials() {
1657
+ return [this.lastName, this.firstName].filter(s => s).map(s => s.substr(0, 1)).join('');
1658
+ }
1659
+ static toFront(data) { }
1660
+ static toBack(data) { }
1661
+ };
1662
+ __decorate([
1663
+ ToFrontHook
1664
+ ], TournamentTeamUser, "toFront", null);
1665
+ __decorate([
1666
+ ToBackHook
1667
+ ], TournamentTeamUser, "toBack", null);
1668
+ TournamentTeamUser = __decorate([
1669
+ ModelInstance({
1670
+ mappingFields: {
1671
+ id: 'id',
1672
+ tournament_team: 'tournamentTeam',
1673
+ team_user: 'teamUser',
1674
+ disqualified: 'disqualified',
1675
+ first_name: 'firstName',
1676
+ last_name: 'lastName',
1677
+ middle_name: 'middleName',
1678
+ photo: 'photo',
1679
+ disqualification: 'disqualification',
1680
+ has_changes: 'hasChanges',
1681
+ rating: 'rating'
1682
+ },
1683
+ relation: {
1684
+ tournamentTeam: TournamentTeam,
1685
+ teamUser: TeamUser,
1686
+ photo: File,
1687
+ disqualification: TournamentDisqualification,
1688
+ }
1689
+ })
1690
+ ], TournamentTeamUser);
1691
+
1692
+ class BaseStatistic {
1693
+ }
1694
+
1695
+ let BasketballStatistic = class BasketballStatistic extends BaseStatistic {
1696
+ get totalFouls() {
1697
+ return this.personalFouls + this.technicalFouls + this.unsportsmanlikeFouls;
1698
+ }
1699
+ static toFront(data) { }
1700
+ static toBack(data) { }
1701
+ };
1702
+ __decorate([
1703
+ ToFrontHook
1704
+ ], BasketballStatistic, "toFront", null);
1705
+ __decorate([
1706
+ ToBackHook
1707
+ ], BasketballStatistic, "toBack", null);
1708
+ BasketballStatistic = __decorate([
1709
+ ModelInstance({
1710
+ mappingFields: {
1711
+ tournament_team_user: 'tournamentTeamUser',
1712
+ team: 'team',
1713
+ team_user: 'teamUser',
1714
+ user: 'user',
1715
+ tournament_team: 'tournamentTeam',
1716
+ month: 'month',
1717
+ win_lose: 'winLose',
1718
+ games_count: 'gamesCount',
1719
+ won_games_count: 'wonGamesCount',
1720
+ points: 'points',
1721
+ two_points_made: 'twoPointsMade',
1722
+ three_points_made: 'threePointsMade',
1723
+ free_throws_made: 'freeThrowsMade',
1724
+ one_points_made: 'onePointsMade',
1751
1725
  two_point_attempts: 'twoPointAttempts',
1752
1726
  three_point_attempts: 'threePointAttempts',
1753
1727
  free_throw_attempts: 'freeThrowAttempts',
@@ -1955,19 +1929,68 @@ BasketballGameLog = __decorate([
1955
1929
  })
1956
1930
  ], BasketballGameLog);
1957
1931
 
1958
- let BasketballGameApi = class BasketballGameApi {
1932
+ let GameUser = class GameUser extends BaseModel {
1933
+ static toFront(data) { }
1934
+ static toBack(data) { }
1935
+ };
1936
+ __decorate([
1937
+ ToFrontHook
1938
+ ], GameUser, "toFront", null);
1939
+ __decorate([
1940
+ ToBackHook
1941
+ ], GameUser, "toBack", null);
1942
+ GameUser = __decorate([
1943
+ ModelInstance({
1944
+ mappingFields: {
1945
+ id: 'id',
1946
+ game_id: 'gameId',
1947
+ team_user: 'teamUser',
1948
+ tournament_team_user: 'tournamentTeamUser',
1949
+ is_mvp: 'isMvp',
1950
+ updated_at: 'updatedAt'
1951
+ },
1952
+ relation: {
1953
+ teamUser: TeamUser,
1954
+ tournamentTeamUser: TournamentTeamUser,
1955
+ updatedAt: DateTimeField,
1956
+ }
1957
+ })
1958
+ ], GameUser);
1959
+
1960
+ let GameBaseApi = class GameBaseApi {
1959
1961
  constructor(httpClient, configService) {
1960
1962
  this.httpClient = httpClient;
1961
1963
  this.configService = configService;
1962
1964
  }
1963
- getById(gameId) {
1965
+ getUsers(gameId) {
1964
1966
  return __awaiter(this, void 0, void 0, function* () {
1965
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_basketball_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
1967
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/users/`).pipe(map(result => GameUser.toFront(result))).toPromise();
1966
1968
  });
1967
1969
  }
1968
- getUsers(gameId) {
1970
+ getMvp(gameId) {
1969
1971
  return __awaiter(this, void 0, void 0, function* () {
1970
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/users/`).pipe(map(result => GameUser.toFront(result))).toPromise();
1972
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/mvp/`).pipe(map(result => GameUser.toFront(result))).toPromise();
1973
+ });
1974
+ }
1975
+ };
1976
+ GameBaseApi.ctorParameters = () => [
1977
+ { type: HttpClient },
1978
+ { type: ConfigService }
1979
+ ];
1980
+ GameBaseApi.ɵprov = ɵɵdefineInjectable({ factory: function GameBaseApi_Factory() { return new GameBaseApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: GameBaseApi, providedIn: "root" });
1981
+ GameBaseApi = __decorate([
1982
+ Injectable({ providedIn: 'root' })
1983
+ ], GameBaseApi);
1984
+
1985
+ let BasketballGameApi = class BasketballGameApi extends GameBaseApi {
1986
+ constructor(httpClient, configService) {
1987
+ super(httpClient, configService);
1988
+ this.httpClient = httpClient;
1989
+ this.configService = configService;
1990
+ }
1991
+ getById(gameId) {
1992
+ return __awaiter(this, void 0, void 0, function* () {
1993
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_basketball_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
1971
1994
  });
1972
1995
  }
1973
1996
  getTeamStatistic(gameId) {
@@ -2432,8 +2455,9 @@ HockeyGameTeamStatistic = __decorate([
2432
2455
  })
2433
2456
  ], HockeyGameTeamStatistic);
2434
2457
 
2435
- let HockeyGameApi = class HockeyGameApi {
2458
+ let HockeyGameApi = class HockeyGameApi extends GameBaseApi {
2436
2459
  constructor(httpClient, configService) {
2460
+ super(httpClient, configService);
2437
2461
  this.httpClient = httpClient;
2438
2462
  this.configService = configService;
2439
2463
  }
@@ -2442,11 +2466,6 @@ let HockeyGameApi = class HockeyGameApi {
2442
2466
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_hockey_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
2443
2467
  });
2444
2468
  }
2445
- getUsers(gameId) {
2446
- return __awaiter(this, void 0, void 0, function* () {
2447
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/users/`).pipe(map(result => GameUser.toFront(result))).toPromise();
2448
- });
2449
- }
2450
2469
  getTeamStatistic(gameId) {
2451
2470
  return __awaiter(this, void 0, void 0, function* () {
2452
2471
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_hockey_game/${gameId}/team_statistic/`).pipe(map(result => HockeyGameTeamStatistic.toFront(result))).toPromise();
@@ -2811,8 +2830,9 @@ FootballGameTeamStatistic = __decorate([
2811
2830
  })
2812
2831
  ], FootballGameTeamStatistic);
2813
2832
 
2814
- let FootballGameApi = class FootballGameApi {
2833
+ let FootballGameApi = class FootballGameApi extends GameBaseApi {
2815
2834
  constructor(httpClient, configService) {
2835
+ super(httpClient, configService);
2816
2836
  this.httpClient = httpClient;
2817
2837
  this.configService = configService;
2818
2838
  }
@@ -2821,11 +2841,6 @@ let FootballGameApi = class FootballGameApi {
2821
2841
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_football_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
2822
2842
  });
2823
2843
  }
2824
- getUsers(gameId) {
2825
- return __awaiter(this, void 0, void 0, function* () {
2826
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/users/`).pipe(map(result => GameUser.toFront(result))).toPromise();
2827
- });
2828
- }
2829
2844
  getTeamStatistic(gameId) {
2830
2845
  return __awaiter(this, void 0, void 0, function* () {
2831
2846
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_football_game/${gameId}/team_statistic/`).pipe(map(result => FootballGameTeamStatistic.toFront(result))).toPromise();
@@ -2867,2161 +2882,2172 @@ FootballGameApi = __decorate([
2867
2882
  Injectable({ providedIn: 'root' })
2868
2883
  ], FootballGameApi);
2869
2884
 
2870
- var LeagueNewsType;
2871
- (function (LeagueNewsType) {
2872
- LeagueNewsType[LeagueNewsType["text"] = 1] = "text";
2873
- LeagueNewsType[LeagueNewsType["video"] = 2] = "video";
2874
- })(LeagueNewsType || (LeagueNewsType = {}));
2875
- let LeagueNews = class LeagueNews extends BaseModel {
2876
- static toFront(data) {
2877
- return undefined;
2878
- }
2885
+ let TournamentNews = class TournamentNews extends BaseModel {
2886
+ static toFront(data) { }
2879
2887
  static toBack(data) { }
2880
2888
  };
2881
2889
  __decorate([
2882
2890
  ToFrontHook
2883
- ], LeagueNews, "toFront", null);
2891
+ ], TournamentNews, "toFront", null);
2884
2892
  __decorate([
2885
2893
  ToBackHook
2886
- ], LeagueNews, "toBack", null);
2887
- LeagueNews = __decorate([
2894
+ ], TournamentNews, "toBack", null);
2895
+ TournamentNews = __decorate([
2888
2896
  ModelInstance({
2889
2897
  mappingFields: {
2890
2898
  id: 'id',
2891
2899
  title: 'title',
2892
- datetime: 'datetime',
2893
- preview_text: 'previewText',
2894
- detail_text: 'detailText',
2895
2900
  picture: 'picture',
2896
- cover: 'cover',
2897
- mobile_picture: 'mobilePicture',
2898
- is_main: 'isMain',
2899
- tournaments: 'tournaments',
2900
- type: 'type',
2901
- video_link: 'videoLink',
2902
- tag: 'tag',
2901
+ text: 'text',
2902
+ author: 'author',
2903
+ created_at: 'createdAt',
2903
2904
  },
2904
2905
  relation: {
2905
- datetime: DateTimeField,
2906
2906
  picture: File,
2907
- cover: File,
2908
- mobilePicture: File,
2909
- tournaments: listField(Tournament),
2910
- type: enumField(LeagueNewsType),
2907
+ author: User,
2908
+ createdAt: DateTimeField,
2911
2909
  }
2912
2910
  })
2913
- ], LeagueNews);
2911
+ ], TournamentNews);
2914
2912
 
2915
- var TournamentEventTypes;
2916
- (function (TournamentEventTypes) {
2917
- TournamentEventTypes[TournamentEventTypes["game_closed"] = 1] = "game_closed";
2918
- TournamentEventTypes[TournamentEventTypes["media_added"] = 2] = "media_added";
2919
- TournamentEventTypes[TournamentEventTypes["news"] = 3] = "news";
2920
- })(TournamentEventTypes || (TournamentEventTypes = {}));
2921
- let TournamentEvent = class TournamentEvent extends BaseModel {
2913
+ let GameTimelineStageItem = class GameTimelineStageItem {
2922
2914
  static toFront(data) { }
2923
2915
  static toBack(data) { }
2924
2916
  };
2925
2917
  __decorate([
2926
2918
  ToFrontHook
2927
- ], TournamentEvent, "toFront", null);
2919
+ ], GameTimelineStageItem, "toFront", null);
2928
2920
  __decorate([
2929
2921
  ToBackHook
2930
- ], TournamentEvent, "toBack", null);
2931
- TournamentEvent = __decorate([
2922
+ ], GameTimelineStageItem, "toBack", null);
2923
+ GameTimelineStageItem = __decorate([
2932
2924
  ModelInstance({
2933
2925
  mappingFields: {
2934
- id: 'id',
2935
- game: 'game',
2936
- news: 'news',
2937
- league: 'league',
2938
- tournaments: 'tournaments',
2939
- event: 'event',
2940
- datetime: 'datetime'
2926
+ stage_id: 'stageId',
2927
+ tours_count: 'toursCount',
2928
+ playoff_stages_count: 'playoffStagesCount',
2929
+ }
2930
+ })
2931
+ ], GameTimelineStageItem);
2932
+ let GameTimelineStages = class GameTimelineStages extends BaseModel {
2933
+ static toFront(data) { }
2934
+ static toBack(data) { }
2935
+ };
2936
+ __decorate([
2937
+ ToFrontHook
2938
+ ], GameTimelineStages, "toFront", null);
2939
+ __decorate([
2940
+ ToBackHook
2941
+ ], GameTimelineStages, "toBack", null);
2942
+ GameTimelineStages = __decorate([
2943
+ ModelInstance({
2944
+ mappingFields: {
2945
+ tours_count: 'toursCount',
2946
+ playoff_stages_count: 'playoffStagesCount',
2947
+ current_tour: 'currentTour',
2948
+ current_playoff_stage: 'currentPlayoffStage',
2949
+ stages: 'stages',
2950
+ tournament_stage_id: 'tournamentStageId',
2941
2951
  },
2942
2952
  relation: {
2943
- game: Game,
2944
- news: LeagueNews,
2945
- league: League,
2946
- tournaments: listField(Tournament),
2947
- datetime: DateField,
2948
- event: enumField(TournamentEventTypes)
2953
+ stages: listField(GameTimelineStageItem)
2949
2954
  }
2950
2955
  })
2951
- ], TournamentEvent);
2956
+ ], GameTimelineStages);
2952
2957
 
2953
- let LeaguePartner = class LeaguePartner extends BaseModel {
2958
+ var TournamentStageStatuses;
2959
+ (function (TournamentStageStatuses) {
2960
+ TournamentStageStatuses[TournamentStageStatuses["open"] = 0] = "open";
2961
+ TournamentStageStatuses[TournamentStageStatuses["in_progress"] = 1] = "in_progress";
2962
+ TournamentStageStatuses[TournamentStageStatuses["closed"] = 2] = "closed";
2963
+ })(TournamentStageStatuses || (TournamentStageStatuses = {}));
2964
+ let TournamentStage = class TournamentStage extends BaseModel {
2954
2965
  static toFront(data) { }
2955
2966
  static toBack(data) { }
2956
2967
  };
2957
2968
  __decorate([
2958
2969
  ToFrontHook
2959
- ], LeaguePartner, "toFront", null);
2970
+ ], TournamentStage, "toFront", null);
2960
2971
  __decorate([
2961
2972
  ToBackHook
2962
- ], LeaguePartner, "toBack", null);
2963
- LeaguePartner = __decorate([
2973
+ ], TournamentStage, "toBack", null);
2974
+ TournamentStage = __decorate([
2964
2975
  ModelInstance({
2965
2976
  mappingFields: {
2966
2977
  id: 'id',
2967
- title: 'title',
2968
- picture: 'picture',
2969
- link: 'link',
2970
- sort: 'sort',
2978
+ name: 'name',
2979
+ date: 'date',
2980
+ tournament_id: 'tournamentId',
2981
+ status: 'status',
2971
2982
  },
2972
2983
  relation: {
2973
- picture: File
2984
+ date: DateField,
2985
+ status: enumField(TournamentStageStatuses)
2974
2986
  }
2975
2987
  })
2976
- ], LeaguePartner);
2988
+ ], TournamentStage);
2977
2989
 
2978
- var BannerLocation;
2979
- (function (BannerLocation) {
2980
- BannerLocation["slider"] = "slider";
2981
- BannerLocation["central"] = "central";
2982
- BannerLocation["media"] = "media";
2983
- })(BannerLocation || (BannerLocation = {}));
2984
- let LeagueBanner = class LeagueBanner extends BaseModel {
2985
- static toFront(data) {
2990
+ function generateArray(length) {
2991
+ if (length <= 0) {
2992
+ return [];
2986
2993
  }
2987
- static toBack(data) {
2994
+ return Array.apply(null, Array(length)).map((_, i) => i + 1);
2995
+ }
2996
+ function getArrayChunks(array, length) {
2997
+ const chunks = [];
2998
+ const chunkLength = Math.ceil(array.length / length);
2999
+ if (chunkLength === 0) {
3000
+ return [array];
3001
+ }
3002
+ for (let i = 0; i < chunkLength; i++) {
3003
+ chunks.push(array.slice(i * length, (i + 1) * length));
2988
3004
  }
3005
+ return chunks;
3006
+ }
3007
+
3008
+ var PlayoffTypes;
3009
+ (function (PlayoffTypes) {
3010
+ PlayoffTypes["double_elimination"] = "double_elimination";
3011
+ PlayoffTypes["elimination"] = "elimination";
3012
+ })(PlayoffTypes || (PlayoffTypes = {}));
3013
+ let PlayoffSettings = class PlayoffSettings extends BaseModel {
3014
+ static toFront(data) { }
3015
+ static toBack(data) { }
2989
3016
  };
2990
3017
  __decorate([
2991
3018
  ToFrontHook
2992
- ], LeagueBanner, "toFront", null);
3019
+ ], PlayoffSettings, "toFront", null);
2993
3020
  __decorate([
2994
3021
  ToBackHook
2995
- ], LeagueBanner, "toBack", null);
2996
- LeagueBanner = __decorate([
3022
+ ], PlayoffSettings, "toBack", null);
3023
+ PlayoffSettings = __decorate([
2997
3024
  ModelInstance({
2998
3025
  mappingFields: {
2999
- id: 'id',
3000
- title: 'title',
3001
- picture: 'picture',
3002
- link: 'link',
3003
- sort: 'sort',
3004
- location: 'location',
3026
+ rounds: 'rounds',
3027
+ final_rounds: 'finalRounds',
3028
+ third_place_rounds: 'thirdPlaceRounds',
3029
+ teams_count: 'teamsCount',
3030
+ type: 'type',
3005
3031
  },
3006
3032
  relation: {
3007
- picture: File,
3008
- location: enumField(BannerLocation),
3033
+ type: enumField(PlayoffTypes)
3009
3034
  }
3010
3035
  })
3011
- ], LeagueBanner);
3012
-
3013
- let LeagueApi = class LeagueApi {
3014
- constructor(httpClient, configService) {
3015
- this.httpClient = httpClient;
3016
- this.configService = configService;
3017
- }
3018
- getByAlias(alias) {
3019
- return __awaiter(this, void 0, void 0, function* () {
3020
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${alias}/`).pipe(map(result => League.toFront(result))).toPromise();
3021
- });
3022
- }
3023
- getByDomain(domain) {
3024
- return __awaiter(this, void 0, void 0, function* () {
3025
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/by_domain/${domain}/`).pipe(map(result => League.toFront(result))).toPromise();
3026
- });
3036
+ ], PlayoffSettings);
3037
+ let Playoff = class Playoff extends BaseModel {
3038
+ constructor() {
3039
+ super(...arguments);
3040
+ this.stages = [];
3027
3041
  }
3028
- getTournaments(leagueId) {
3029
- return __awaiter(this, void 0, void 0, function* () {
3030
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournaments/`).pipe(map(result => Tournament.toFront(result))).toPromise();
3031
- });
3042
+ static toFront(data) { }
3043
+ static toBack(data) { }
3044
+ get stagesCount() {
3045
+ return Math.log(this.settings.teamsCount) / Math.log(2);
3032
3046
  }
3033
- getEvents(leagueId, page, size, filters) {
3034
- return __awaiter(this, void 0, void 0, function* () {
3035
- let params = new HttpParams().set('page', page.toString())
3036
- .set('size', size.toString());
3037
- if (filters) {
3038
- if (filters.event) {
3039
- params = params.set('event', TournamentEventTypes[filters.event]);
3040
- }
3041
- if (filters.search) {
3042
- params = params.set('search', filters.search);
3047
+ getPlayoffStages() {
3048
+ if (this.stages.length === 0 && this.settings.teamsCount) {
3049
+ const stagesCount = Math.log(this.settings.teamsCount) / Math.log(2);
3050
+ this.stages = generateArray(stagesCount).map(stage => {
3051
+ const playoffStage = this.settings.teamsCount / Math.pow(2, stage);
3052
+ let title = '';
3053
+ if (playoffStage === 1) {
3054
+ title = 'Финал';
3043
3055
  }
3044
- if (filters.tournamentTour) {
3045
- params = params.set('tournament_tour', filters.tournamentTour.toString());
3056
+ else {
3057
+ title = `1 / ${playoffStage}`;
3046
3058
  }
3047
- }
3048
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/events/`, { params, observe: 'response' }).pipe(map(result => ({
3049
- total: +result.headers.get('X-Page-Count'),
3050
- data: TournamentEvent.toFront(result.body)
3051
- }))).toPromise();
3052
- });
3053
- }
3054
- getTournamentSeasons(leagueId) {
3055
- return __awaiter(this, void 0, void 0, function* () {
3056
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournament_seasons/`).pipe(map(result => TournamentSeason.toFront(result))).toPromise();
3057
- });
3058
- }
3059
- getGames(leagueId, page, size, filters) {
3060
- return __awaiter(this, void 0, void 0, function* () {
3061
- let params = new HttpParams().set('page', page.toString());
3062
- if (size) {
3063
- params = params.set('size', size.toString());
3064
- }
3065
- if (filters.tournamentStageId) {
3066
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3067
- }
3068
- if (filters.tournamentTour) {
3069
- params = params.set('tournament_tour', filters.tournamentTour.toString());
3070
- }
3071
- if (filters.playoffStage) {
3072
- params = params.set('playoff_stage', filters.playoffStage.toString());
3073
- }
3074
- if (filters.teamId) {
3075
- params = params.set('team_id', filters.teamId.toString());
3076
- }
3077
- if (filters.status) {
3078
- params = params.set('status', GameStatuses[filters.status]);
3079
- }
3080
- if (filters.statuses) {
3081
- const statuses = filters.statuses.map(i => GameStatuses[i]);
3082
- params = params.set('statuses', statuses.join(','));
3083
- }
3084
- if (filters.tournamentCourtId) {
3085
- params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
3086
- }
3087
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/games/`, { params, observe: 'response' }).pipe(map(result => ({
3088
- total: +result.headers.get('X-Page-Count'),
3089
- data: Game.toFront(result.body)
3090
- }))).toPromise();
3091
- });
3092
- }
3093
- getSeasons(leagueId, notClosed) {
3094
- return __awaiter(this, void 0, void 0, function* () {
3095
- const params = new HttpParams().set('not_closed', notClosed ? '1' : '');
3096
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournament_seasons/`, { params })
3097
- .pipe(map(result => TournamentSeason.toFront(result)))
3098
- .toPromise();
3099
- });
3100
- }
3101
- getPartners(leagueId) {
3102
- return __awaiter(this, void 0, void 0, function* () {
3103
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/partners/`).pipe(map(result => LeaguePartner.toFront(result))).toPromise();
3104
- });
3105
- }
3106
- getBanners(leagueId, location) {
3107
- return __awaiter(this, void 0, void 0, function* () {
3108
- const params = location ? new HttpParams().set('location', location) : new HttpParams();
3109
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/banners/`, { params }).pipe(map(result => LeagueBanner.toFront(result))).toPromise();
3110
- });
3111
- }
3112
- getCourts(leagueId) {
3113
- return __awaiter(this, void 0, void 0, function* () {
3114
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/courts/`).pipe(map(result => LeagueCourt.toFront(result))).toPromise();
3115
- });
3059
+ return {
3060
+ value: stage,
3061
+ title
3062
+ };
3063
+ });
3064
+ }
3065
+ return this.stages;
3116
3066
  }
3117
3067
  };
3118
- LeagueApi.ctorParameters = () => [
3119
- { type: HttpClient },
3120
- { type: ConfigService }
3121
- ];
3122
- LeagueApi.ɵprov = ɵɵdefineInjectable({ factory: function LeagueApi_Factory() { return new LeagueApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: LeagueApi, providedIn: "root" });
3123
- LeagueApi = __decorate([
3124
- Injectable({ providedIn: 'root' })
3125
- ], LeagueApi);
3126
-
3127
- let LeagueNewsApi = class LeagueNewsApi {
3128
- constructor(httpClient, configService) {
3129
- this.httpClient = httpClient;
3130
- this.configService = configService;
3131
- }
3132
- getLeagueNewsList(leagueId, page, size, type = LeagueNewsType.text) {
3133
- return __awaiter(this, void 0, void 0, function* () {
3134
- const params = new HttpParams().set('page', page.toString())
3135
- .set('size', size.toString())
3136
- .set('type', LeagueNewsType[type]);
3137
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/news/`, { params, observe: 'response' })
3138
- .pipe(map(response => ({
3139
- total: +response.headers.get('X-Page-Count'),
3140
- data: LeagueNews.toFront(response.body)
3141
- })))
3142
- .toPromise();
3143
- });
3144
- }
3145
- getMainLeagueNews(leagueId) {
3146
- return __awaiter(this, void 0, void 0, function* () {
3147
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/news/?is_main=true`)
3148
- .pipe(map(response => response && response.length > 0 ? LeagueNews.toFront(response[0]) : null))
3149
- .toPromise();
3150
- });
3151
- }
3152
- getMainLeagueNewsList(leagueId) {
3153
- return __awaiter(this, void 0, void 0, function* () {
3154
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/news/?is_main=true`)
3155
- .pipe(map(response => LeagueNews.toFront(response)))
3156
- .toPromise();
3157
- });
3158
- }
3159
- getNewsById(newsId) {
3160
- return __awaiter(this, void 0, void 0, function* () {
3161
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league_news/${newsId}/`)
3162
- .pipe(map(response => LeagueNews.toFront(response)))
3163
- .toPromise();
3164
- });
3165
- }
3166
- getTournamentNewsList(tournamentId) {
3167
- return __awaiter(this, void 0, void 0, function* () {
3168
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/news/`, { observe: 'response' })
3169
- .pipe(map(response => ({
3170
- total: +response.headers.get('X-Page-Count'),
3171
- data: LeagueNews.toFront(response.body)
3172
- })))
3173
- .toPromise();
3174
- });
3175
- }
3176
- };
3177
- LeagueNewsApi.ctorParameters = () => [
3178
- { type: HttpClient },
3179
- { type: ConfigService }
3180
- ];
3181
- LeagueNewsApi.ɵprov = ɵɵdefineInjectable({ factory: function LeagueNewsApi_Factory() { return new LeagueNewsApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: LeagueNewsApi, providedIn: "root" });
3182
- LeagueNewsApi = __decorate([
3183
- Injectable({ providedIn: 'root' })
3184
- ], LeagueNewsApi);
3185
-
3186
- let MediaApi = class MediaApi {
3187
- constructor(httpClient, configService) {
3188
- this.httpClient = httpClient;
3189
- this.configService = configService;
3190
- }
3191
- getMedia(mediaId) {
3192
- return __awaiter(this, void 0, void 0, function* () {
3193
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/media/${mediaId}/`).pipe(map(result => MediaItem.toFront(result))).toPromise();
3194
- });
3195
- }
3196
- getTournamentGameMedia(tournamentId, page, size, filters) {
3197
- return __awaiter(this, void 0, void 0, function* () {
3198
- let params = new HttpParams().set('page', page.toString()).set('size', size.toString());
3199
- if (filters) {
3200
- if (filters.tournamentTour) {
3201
- params = params.set('tournament_tour', filters.tournamentTour.toString());
3202
- }
3203
- if (filters.teamId) {
3204
- params = params.set('team_id', filters.teamId.toString());
3205
- }
3206
- if (filters.tournamentStageId) {
3207
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3208
- }
3209
- if (filters.playoffId) {
3210
- params = params.set('playoff_id', filters.playoffId.toString());
3211
- }
3212
- if (filters.playoffStage) {
3213
- params = params.set('playoff_stage', filters.playoffStage.toString());
3214
- }
3215
- if (filters.status) {
3216
- params = params.set('status', GameStatuses[filters.status]);
3217
- }
3218
- }
3219
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/game_media/`, { observe: 'response', params }).pipe(map(response => {
3220
- return {
3221
- total: +response.headers.get('X-Page-Count'),
3222
- data: Game.toFront(response.body)
3223
- };
3224
- })).toPromise();
3225
- });
3226
- }
3227
- getLeagueGameMedia(leagueId, page, size, filters) {
3228
- return __awaiter(this, void 0, void 0, function* () {
3229
- let params = new HttpParams().set('page', page.toString()).set('size', size.toString());
3230
- if (filters) {
3231
- if (filters.tournamentTour) {
3232
- params = params.set('tournament_tour', filters.tournamentTour.toString());
3233
- }
3234
- if (filters.teamId) {
3235
- params = params.set('team_id', filters.teamId.toString());
3236
- }
3237
- if (filters.tournamentStageId) {
3238
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3239
- }
3240
- if (filters.playoffId) {
3241
- params = params.set('playoff_id', filters.playoffId.toString());
3242
- }
3243
- if (filters.playoffStage) {
3244
- params = params.set('playoff_stage', filters.playoffStage.toString());
3245
- }
3246
- if (filters.status) {
3247
- params = params.set('status', GameStatuses[filters.status]);
3248
- }
3249
- }
3250
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/game_media/`, { observe: 'response', params }).pipe(map(response => {
3251
- return {
3252
- total: +response.headers.get('X-Page-Count'),
3253
- data: Game.toFront(response.body)
3254
- };
3255
- })).toPromise();
3256
- });
3257
- }
3258
- getLeagueMedia(leagueId, page, size, filters = {}) {
3259
- return __awaiter(this, void 0, void 0, function* () {
3260
- let params = new HttpParams().set('page', page.toString()).set('size', size.toString());
3261
- if (filters.mediaType) {
3262
- params = params.set('media_type', filters.mediaType);
3263
- }
3264
- if (filters.sort) {
3265
- params = params.set('sort', filters.sort);
3266
- }
3267
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/media/`, { params, observe: 'response' })
3268
- .pipe(map(response => ({
3269
- total: +response.headers.get('X-Page-Count'),
3270
- data: MediaItem.toFront(response.body)
3271
- }))).toPromise();
3272
- });
3273
- }
3274
- getGameMediaById(gameId) {
3275
- return __awaiter(this, void 0, void 0, function* () {
3276
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/game_media/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
3277
- });
3278
- }
3279
- getGameMedia(gameId) {
3280
- return __awaiter(this, void 0, void 0, function* () {
3281
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/media/`).pipe(map(result => MediaItem.toFront(result))).toPromise();
3282
- });
3283
- }
3284
- createZip(mediaIds) {
3285
- return __awaiter(this, void 0, void 0, function* () {
3286
- return this.httpClient
3287
- .post(`${this.configService.get('apiUrl')}/api/v1/media/zip/`, mediaIds, { responseType: 'blob' })
3288
- .toPromise();
3289
- });
3290
- }
3291
- downloadMedia(mediaId) {
3292
- return __awaiter(this, void 0, void 0, function* () {
3293
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/media/${mediaId}/download/`, { responseType: 'blob' })
3294
- .toPromise();
3295
- });
3296
- }
3297
- };
3298
- MediaApi.ctorParameters = () => [
3299
- { type: HttpClient },
3300
- { type: ConfigService }
3301
- ];
3302
- MediaApi.ɵprov = ɵɵdefineInjectable({ factory: function MediaApi_Factory() { return new MediaApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: MediaApi, providedIn: "root" });
3303
- MediaApi = __decorate([
3304
- Injectable({ providedIn: 'root' })
3305
- ], MediaApi);
3306
-
3307
- var PollStatuses;
3308
- (function (PollStatuses) {
3309
- PollStatuses[PollStatuses["open"] = 1] = "open";
3310
- PollStatuses[PollStatuses["closed"] = 2] = "closed";
3311
- PollStatuses[PollStatuses["archived"] = 3] = "archived";
3312
- })(PollStatuses || (PollStatuses = {}));
3313
- let PollVariant = class PollVariant extends BaseModel {
3314
- static toFront(data) { }
3315
- static toBack(data) { }
3316
- };
3317
3068
  __decorate([
3318
3069
  ToFrontHook
3319
- ], PollVariant, "toFront", null);
3070
+ ], Playoff, "toFront", null);
3320
3071
  __decorate([
3321
3072
  ToBackHook
3322
- ], PollVariant, "toBack", null);
3323
- PollVariant = __decorate([
3073
+ ], Playoff, "toBack", null);
3074
+ Playoff = __decorate([
3324
3075
  ModelInstance({
3325
3076
  mappingFields: {
3326
- uuid: 'uuid',
3327
- name: 'name'
3077
+ id: 'id',
3078
+ name: 'name',
3079
+ settings: 'settings',
3080
+ tournament_id: 'tournamentId',
3081
+ tournament_stage_id: 'tournamentStageId',
3082
+ is_official: 'isOfficial'
3083
+ },
3084
+ relation: {
3085
+ settings: PlayoffSettings
3328
3086
  }
3329
3087
  })
3330
- ], PollVariant);
3331
- let PollAnswer = class PollAnswer extends BaseModel {
3088
+ ], Playoff);
3089
+
3090
+ let VolleyballStatistic = class VolleyballStatistic extends BaseStatistic {
3332
3091
  static toFront(data) { }
3333
3092
  static toBack(data) { }
3334
3093
  };
3335
3094
  __decorate([
3336
3095
  ToFrontHook
3337
- ], PollAnswer, "toFront", null);
3096
+ ], VolleyballStatistic, "toFront", null);
3338
3097
  __decorate([
3339
3098
  ToBackHook
3340
- ], PollAnswer, "toBack", null);
3341
- PollAnswer = __decorate([
3099
+ ], VolleyballStatistic, "toBack", null);
3100
+ VolleyballStatistic = __decorate([
3342
3101
  ModelInstance({
3343
3102
  mappingFields: {
3344
- id: 'id',
3345
- answer_uuid: 'answerUuid',
3103
+ team: 'team',
3104
+ team_user: 'teamUser',
3105
+ tournament_team_user: 'tournamentTeamUser',
3106
+ tournament_team: 'tournamentTeam',
3346
3107
  user: 'user',
3347
- poll_id: 'pollId',
3108
+ month: 'month',
3109
+ win_lose: 'winLose',
3110
+ games_count: 'gamesCount',
3111
+ won_games_count: 'wonGamesCount',
3112
+ serve_hits: 'serveHits',
3113
+ serve_faults: 'serveFaults',
3114
+ serve_aces: 'serveAces',
3115
+ serve_percent: 'servePercent',
3116
+ ace_percent: 'acePercent',
3117
+ stuff_blocks: 'stuffBlocks',
3118
+ block_faults: 'blockFaults',
3119
+ block_rebounds: 'blockRebounds',
3120
+ block_percent: 'blockPercent',
3121
+ attack_spikes: 'attackSpikes',
3122
+ attack_faults: 'attackFaults',
3123
+ attack_shots: 'attackShots',
3124
+ attack_percent: 'attackPercent',
3125
+ receives: 'receives',
3126
+ receive_faults: 'receiveFaults',
3127
+ excellent_receives: 'excellentReceives',
3128
+ receive_percent: 'receivePercent',
3129
+ serve_receives: 'serveReceives',
3130
+ serve_receive_faults: 'serveReceiveFaults',
3131
+ excellent_serve_receives: 'excellentServeReceives',
3132
+ serve_receive_percent: 'serveReceivePercent',
3133
+ points: 'points',
3134
+ faults: 'faults',
3135
+ newbie: 'newbie',
3348
3136
  },
3349
3137
  relation: {
3350
- user: User
3138
+ team: Team,
3139
+ teamUser: TeamUser,
3140
+ tournamentTeamUser: TournamentTeamUser,
3141
+ tournamentTeam: TournamentTeam,
3142
+ user: User,
3143
+ month: DateField,
3351
3144
  }
3352
3145
  })
3353
- ], PollAnswer);
3354
- let Poll = class Poll extends BaseModel {
3355
- constructor() {
3356
- super(...arguments);
3357
- this.variantsWithAnswers = [];
3358
- }
3359
- set variants(value) {
3360
- this._variants = value || [];
3361
- if (this._answers) {
3362
- this.calculateAnswersPercentage();
3363
- }
3364
- }
3365
- get variants() {
3366
- return this._variants;
3367
- }
3368
- set answers(value) {
3369
- this._answers = value || [];
3370
- if (this._variants) {
3371
- this.calculateAnswersPercentage();
3372
- }
3373
- }
3374
- get answers() {
3375
- return this._answers;
3376
- }
3377
- calculateAnswersPercentage() {
3378
- if (!this._answers.length) {
3379
- return;
3146
+ ], VolleyballStatistic);
3147
+
3148
+ let TournamentStageTeam = class TournamentStageTeam extends BaseModel {
3149
+ get gamesWonPercent() {
3150
+ if (!this.gamesCount) {
3151
+ return 0;
3380
3152
  }
3381
- const variants = this._variants.map(v => v.uuid);
3382
- const answersByVariant = this._answers.reduce((acc, item) => {
3383
- if (variants.indexOf(item.answerUuid) < 0) {
3384
- return acc;
3385
- }
3386
- if (!acc[item.answerUuid]) {
3387
- acc[item.answerUuid] = 0;
3388
- }
3389
- acc[item.answerUuid]++;
3390
- return acc;
3391
- }, {});
3392
- this.variantsWithAnswers = this._variants.map(item => ({
3393
- variant: item,
3394
- percent: answersByVariant[item.uuid] ? Math.round(100 * answersByVariant[item.uuid] / this._answers.length) : 0
3395
- }))
3396
- .sort((a, b) => a.percent > b.percent ? -1 : 1);
3153
+ return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
3397
3154
  }
3398
3155
  static toFront(data) { }
3399
3156
  static toBack(data) { }
3400
3157
  };
3401
3158
  __decorate([
3402
3159
  ToFrontHook
3403
- ], Poll, "toFront", null);
3160
+ ], TournamentStageTeam, "toFront", null);
3404
3161
  __decorate([
3405
3162
  ToBackHook
3406
- ], Poll, "toBack", null);
3407
- Poll = __decorate([
3163
+ ], TournamentStageTeam, "toBack", null);
3164
+ TournamentStageTeam = __decorate([
3408
3165
  ModelInstance({
3409
3166
  mappingFields: {
3410
3167
  id: 'id',
3411
- active: 'active',
3412
- status: 'status',
3413
- team_id: 'teamId',
3414
- name: 'name',
3415
- description: 'description',
3416
- variants: 'variants',
3417
- author: 'author',
3418
- answers: 'answers',
3419
- multiple_answer: 'multipleAnswer',
3420
- anonymous: 'anonymous',
3421
- created_at: 'createdAt'
3168
+ tournament_team: 'tournamentTeam',
3169
+ group: 'group',
3170
+ tournament_stage_id: 'tournamentStageId',
3171
+ games_count: 'gamesCount',
3172
+ won_games_count: 'wonGamesCount',
3173
+ score_sum: 'scoreSum',
3174
+ missed_sum: 'missedSum',
3175
+ last_games_count: 'lastGamesCount',
3176
+ last_games_won: 'lastGamesWon',
3177
+ points: 'points',
3178
+ final_standing: 'finalStanding',
3179
+ received_points: 'receivedPoints',
3422
3180
  },
3423
3181
  relation: {
3424
- status: enumField(PollStatuses),
3425
- variants: PollVariant,
3426
- author: User,
3427
- answers: PollAnswer,
3428
- createdAt: DateTimeField,
3182
+ tournamentTeam: TournamentTeam,
3183
+ group: TournamentGroup
3429
3184
  }
3430
3185
  })
3431
- ], Poll);
3186
+ ], TournamentStageTeam);
3432
3187
 
3433
- let TeamInvite = class TeamInvite extends BaseModel {
3434
- static toFront(data) { }
3188
+ var LeagueNewsType;
3189
+ (function (LeagueNewsType) {
3190
+ LeagueNewsType[LeagueNewsType["text"] = 1] = "text";
3191
+ LeagueNewsType[LeagueNewsType["video"] = 2] = "video";
3192
+ })(LeagueNewsType || (LeagueNewsType = {}));
3193
+ let LeagueNews = class LeagueNews extends BaseModel {
3194
+ static toFront(data) {
3195
+ return undefined;
3196
+ }
3435
3197
  static toBack(data) { }
3436
3198
  };
3437
3199
  __decorate([
3438
3200
  ToFrontHook
3439
- ], TeamInvite, "toFront", null);
3201
+ ], LeagueNews, "toFront", null);
3440
3202
  __decorate([
3441
3203
  ToBackHook
3442
- ], TeamInvite, "toBack", null);
3443
- TeamInvite = __decorate([
3204
+ ], LeagueNews, "toBack", null);
3205
+ LeagueNews = __decorate([
3444
3206
  ModelInstance({
3445
3207
  mappingFields: {
3446
3208
  id: 'id',
3447
- user_id: 'userId',
3448
- user: 'user',
3449
- team: 'team',
3450
- team_id: 'teamId',
3451
- user_accept: 'userAccept',
3452
- team_accept: 'teamAccept',
3453
- users_count: 'usersCount',
3454
- games_count: 'gamesCount',
3455
- won_games_count: 'wonGamesCount',
3456
- score_sum: 'scoreSum',
3457
- created_at: 'createdAt',
3458
- updated_at: 'updatedAt',
3209
+ title: 'title',
3210
+ datetime: 'datetime',
3211
+ preview_text: 'previewText',
3212
+ detail_text: 'detailText',
3213
+ picture: 'picture',
3214
+ cover: 'cover',
3215
+ mobile_picture: 'mobilePicture',
3216
+ is_main: 'isMain',
3217
+ tournaments: 'tournaments',
3218
+ type: 'type',
3219
+ video_link: 'videoLink',
3220
+ tag: 'tag',
3459
3221
  },
3460
3222
  relation: {
3461
- user: User,
3462
- team: Team,
3463
- createdAt: DateTimeField,
3464
- updateAt: DateTimeField,
3223
+ datetime: DateTimeField,
3224
+ picture: File,
3225
+ cover: File,
3226
+ mobilePicture: File,
3227
+ tournaments: listField(Tournament),
3228
+ type: enumField(LeagueNewsType),
3465
3229
  }
3466
3230
  })
3467
- ], TeamInvite);
3231
+ ], LeagueNews);
3468
3232
 
3469
- var GameInviteStatus;
3470
- (function (GameInviteStatus) {
3471
- GameInviteStatus[GameInviteStatus["accepted"] = 1] = "accepted";
3472
- GameInviteStatus[GameInviteStatus["declined"] = 2] = "declined";
3473
- })(GameInviteStatus || (GameInviteStatus = {}));
3474
- let GameInvite = class GameInvite extends BaseModel {
3233
+ var TournamentEventTypes;
3234
+ (function (TournamentEventTypes) {
3235
+ TournamentEventTypes[TournamentEventTypes["game_closed"] = 1] = "game_closed";
3236
+ TournamentEventTypes[TournamentEventTypes["media_added"] = 2] = "media_added";
3237
+ TournamentEventTypes[TournamentEventTypes["news"] = 3] = "news";
3238
+ })(TournamentEventTypes || (TournamentEventTypes = {}));
3239
+ let TournamentEvent = class TournamentEvent extends BaseModel {
3475
3240
  static toFront(data) { }
3476
3241
  static toBack(data) { }
3477
3242
  };
3478
3243
  __decorate([
3479
3244
  ToFrontHook
3480
- ], GameInvite, "toFront", null);
3245
+ ], TournamentEvent, "toFront", null);
3481
3246
  __decorate([
3482
3247
  ToBackHook
3483
- ], GameInvite, "toBack", null);
3484
- GameInvite = __decorate([
3248
+ ], TournamentEvent, "toBack", null);
3249
+ TournamentEvent = __decorate([
3485
3250
  ModelInstance({
3486
3251
  mappingFields: {
3487
3252
  id: 'id',
3488
- team_user: 'teamUser',
3489
- game_id: 'gameId',
3490
3253
  game: 'game',
3491
- status: 'status',
3254
+ news: 'news',
3255
+ league: 'league',
3256
+ tournaments: 'tournaments',
3257
+ event: 'event',
3258
+ datetime: 'datetime'
3492
3259
  },
3493
3260
  relation: {
3494
3261
  game: Game,
3495
- teamUser: TeamUser,
3496
- status: enumField(GameInviteStatus),
3262
+ news: LeagueNews,
3263
+ league: League,
3264
+ tournaments: listField(Tournament),
3265
+ datetime: DateField,
3266
+ event: enumField(TournamentEventTypes)
3497
3267
  }
3498
3268
  })
3499
- ], GameInvite);
3500
-
3501
- var TeamEventTypes;
3502
- (function (TeamEventTypes) {
3503
- TeamEventTypes[TeamEventTypes["training"] = 1] = "training";
3504
- TeamEventTypes[TeamEventTypes["other"] = 2] = "other";
3505
- })(TeamEventTypes || (TeamEventTypes = {}));
3506
-
3507
- const TeamEventTypeLocalization = {
3508
- [TeamEventTypes.training]: 'Тренировка',
3509
- [TeamEventTypes.other]: 'Другое'
3510
- };
3269
+ ], TournamentEvent);
3511
3270
 
3512
- let TeamEvent = class TeamEvent extends BaseModel {
3513
- get name() {
3514
- if (this.eventType === TeamEventTypes.other) {
3515
- return this.eventCustomName;
3516
- }
3517
- return TeamEventTypeLocalization[this.eventType];
3271
+ var LeagueUserRoles;
3272
+ (function (LeagueUserRoles) {
3273
+ LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
3274
+ LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
3275
+ LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
3276
+ })(LeagueUserRoles || (LeagueUserRoles = {}));
3277
+ var LeagueUserPermissions;
3278
+ (function (LeagueUserPermissions) {
3279
+ LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
3280
+ LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
3281
+ LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
3282
+ LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
3283
+ LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
3284
+ LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
3285
+ LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
3286
+ LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
3287
+ })(LeagueUserPermissions || (LeagueUserPermissions = {}));
3288
+ let LeagueUser = class LeagueUser extends BaseModel {
3289
+ set role(value) {
3290
+ this._role = LeagueUserRoles[value];
3518
3291
  }
3519
- get isClosed() {
3520
- return this.datetime.getTime() < new Date().getTime();
3292
+ get role() {
3293
+ return this._role;
3521
3294
  }
3522
3295
  static toFront(data) { }
3523
3296
  static toBack(data) { }
3524
3297
  };
3525
3298
  __decorate([
3526
3299
  ToFrontHook
3527
- ], TeamEvent, "toFront", null);
3300
+ ], LeagueUser, "toFront", null);
3528
3301
  __decorate([
3529
3302
  ToBackHook
3530
- ], TeamEvent, "toBack", null);
3531
- TeamEvent = __decorate([
3303
+ ], LeagueUser, "toBack", null);
3304
+ LeagueUser = __decorate([
3532
3305
  ModelInstance({
3533
3306
  mappingFields: {
3534
3307
  id: 'id',
3535
- team_id: 'teamId',
3536
- team: 'team',
3537
- event_type: 'eventType',
3538
- event_custom_name: 'eventCustomName',
3539
- description: 'description',
3540
- datetime: 'datetime',
3541
- location: 'location',
3308
+ user: 'user',
3309
+ role: 'role',
3310
+ permissions: 'permissions'
3542
3311
  },
3543
3312
  relation: {
3544
- eventType: enumField(TeamEventTypes),
3545
- team: Team,
3546
- datetime: DateTimeField,
3313
+ user: User,
3314
+ permissions: listField(enumField(LeagueUserPermissions))
3547
3315
  }
3548
3316
  })
3549
- ], TeamEvent);
3317
+ ], LeagueUser);
3550
3318
 
3551
- var TeamEventInviteStatuses;
3552
- (function (TeamEventInviteStatuses) {
3553
- TeamEventInviteStatuses[TeamEventInviteStatuses["accepted"] = 1] = "accepted";
3554
- TeamEventInviteStatuses[TeamEventInviteStatuses["declined"] = 2] = "declined";
3555
- })(TeamEventInviteStatuses || (TeamEventInviteStatuses = {}));
3556
- let TeamEventInvite = class TeamEventInvite {
3557
- static toFront(data) { }
3558
- static toBack(data) { }
3559
- };
3319
+ let TournamentApi = class TournamentApi {
3320
+ constructor(httpClient, configService) {
3321
+ this.httpClient = httpClient;
3322
+ this.configService = configService;
3323
+ }
3324
+ getById(tournamentId) {
3325
+ return __awaiter(this, void 0, void 0, function* () {
3326
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/`)
3327
+ .pipe(map(result => Tournament.toFront(result)))
3328
+ .toPromise();
3329
+ });
3330
+ }
3331
+ getByAlias(leagueId, alias) {
3332
+ return __awaiter(this, void 0, void 0, function* () {
3333
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournaments/${alias}/`)
3334
+ .pipe(map(result => Tournament.toFront(result)))
3335
+ .toPromise();
3336
+ });
3337
+ }
3338
+ getNews(tournamentId) {
3339
+ return __awaiter(this, void 0, void 0, function* () {
3340
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/news/`)
3341
+ .pipe(map(result => TournamentNews.toFront(result)))
3342
+ .toPromise();
3343
+ });
3344
+ }
3345
+ getEvents(tournamentId, page, size, filters) {
3346
+ return __awaiter(this, void 0, void 0, function* () {
3347
+ let params = new HttpParams().set('page', page.toString())
3348
+ .set('size', size.toString());
3349
+ if (filters) {
3350
+ if (filters.event) {
3351
+ params = params.set('event', TournamentEventTypes[filters.event]);
3352
+ }
3353
+ if (filters.search) {
3354
+ params = params.set('search', filters.search);
3355
+ }
3356
+ if (filters.tournamentTour) {
3357
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
3358
+ }
3359
+ }
3360
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/events/`, { params, observe: 'response' })
3361
+ .pipe(map(result => ({
3362
+ total: +result.headers.get('X-Page-Count'),
3363
+ data: TournamentEvent.toFront(result.body)
3364
+ })))
3365
+ .toPromise();
3366
+ });
3367
+ }
3368
+ getTournamentStages(tournamentId) {
3369
+ return __awaiter(this, void 0, void 0, function* () {
3370
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/stages/`).pipe(map(data => TournamentStage.toFront(data))).toPromise();
3371
+ });
3372
+ }
3373
+ getPlayoff(tournamentId) {
3374
+ return __awaiter(this, void 0, void 0, function* () {
3375
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/playoff/`).pipe(map(result => Playoff.toFront(result))).toPromise();
3376
+ });
3377
+ }
3378
+ getPlayoffGames(playoffId) {
3379
+ return __awaiter(this, void 0, void 0, function* () {
3380
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_playoff/${playoffId}/games/`).pipe(map(result => Game.toFront(result))).toPromise();
3381
+ });
3382
+ }
3383
+ getGamesStages(tournamentId) {
3384
+ return __awaiter(this, void 0, void 0, function* () {
3385
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/games_stages/`)
3386
+ .pipe(map(data => GameTimelineStages.toFront(data)))
3387
+ .toPromise();
3388
+ });
3389
+ }
3390
+ getGames(tournamentId, page, size, filters = {}) {
3391
+ return __awaiter(this, void 0, void 0, function* () {
3392
+ let params = new HttpParams().set('page', page.toString());
3393
+ if (size) {
3394
+ params = params.set('size', size.toString());
3395
+ }
3396
+ params = applyGamesFilters(filters, params);
3397
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/games/`, { params, observe: 'response' })
3398
+ .pipe(map(result => ({
3399
+ total: +result.headers.get('X-Page-Count'),
3400
+ data: Game.toFront(result.body)
3401
+ }))).toPromise();
3402
+ });
3403
+ }
3404
+ getTeams(tournamentId) {
3405
+ return __awaiter(this, void 0, void 0, function* () {
3406
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/teams/`)
3407
+ .pipe(map(result => TournamentTeam.toFront(result)))
3408
+ .toPromise();
3409
+ });
3410
+ }
3411
+ getStageTeams(tournamentId) {
3412
+ return __awaiter(this, void 0, void 0, function* () {
3413
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/stage_teams/`)
3414
+ .pipe(map(result => TournamentStageTeam.toFront(result)))
3415
+ .toPromise();
3416
+ });
3417
+ }
3418
+ getTeamById(tournamentTeamId) {
3419
+ return __awaiter(this, void 0, void 0, function* () {
3420
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/`)
3421
+ .pipe(map(result => TournamentTeam.toFront(result)))
3422
+ .toPromise();
3423
+ });
3424
+ }
3425
+ getUserById(userId) {
3426
+ return __awaiter(this, void 0, void 0, function* () {
3427
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team_user/${userId}/`)
3428
+ .pipe(map(result => TournamentTeamUser.toFront(result)))
3429
+ .toPromise();
3430
+ });
3431
+ }
3432
+ getUserGames(tournamentUserId) {
3433
+ return __awaiter(this, void 0, void 0, function* () {
3434
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team_user/${tournamentUserId}/games/`)
3435
+ .pipe(map(result => Game.toFront(result)))
3436
+ .toPromise();
3437
+ });
3438
+ }
3439
+ getBasketballStatistic(filters) {
3440
+ return __awaiter(this, void 0, void 0, function* () {
3441
+ let params = new HttpParams();
3442
+ if (filters) {
3443
+ for (const key of Object.keys(filters)) {
3444
+ if (filters[key]) {
3445
+ params = params.set(key, filters[key]);
3446
+ }
3447
+ }
3448
+ if (filters.per_game !== undefined) {
3449
+ params = params.set('per_game', filters.per_game ? '1' : '0');
3450
+ }
3451
+ if (filters.tournament_ids) {
3452
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
3453
+ }
3454
+ }
3455
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/basketball_statistic/`, { params }).pipe(map(result => BasketballStatistic.toFront(result))).toPromise();
3456
+ });
3457
+ }
3458
+ getVolleyballStatistic(filters) {
3459
+ return __awaiter(this, void 0, void 0, function* () {
3460
+ let params = new HttpParams();
3461
+ if (filters) {
3462
+ for (const key of Object.keys(filters)) {
3463
+ if (filters[key]) {
3464
+ params = params.set(key, filters[key]);
3465
+ }
3466
+ }
3467
+ if (filters.per_game !== undefined) {
3468
+ params = params.set('per_game', filters.per_game ? '1' : '0');
3469
+ }
3470
+ if (filters.tournament_ids) {
3471
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
3472
+ }
3473
+ }
3474
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/volleyball_statistic/`, { params }).pipe(map(result => VolleyballStatistic.toFront(result))).toPromise();
3475
+ });
3476
+ }
3477
+ getHockeyStatistic(filters) {
3478
+ return __awaiter(this, void 0, void 0, function* () {
3479
+ let params = new HttpParams();
3480
+ if (filters) {
3481
+ for (const key of Object.keys(filters)) {
3482
+ if (filters[key]) {
3483
+ params = params.set(key, filters[key]);
3484
+ }
3485
+ }
3486
+ if (filters.per_game !== undefined) {
3487
+ params = params.set('per_game', filters.per_game ? '1' : '0');
3488
+ }
3489
+ if (filters.tournament_ids) {
3490
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
3491
+ }
3492
+ }
3493
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/hockey_statistic/`, { params }).pipe(map(result => HockeyStatistic.toFront(result))).toPromise();
3494
+ });
3495
+ }
3496
+ getFootballStatistic(filters) {
3497
+ return __awaiter(this, void 0, void 0, function* () {
3498
+ let params = new HttpParams();
3499
+ if (filters) {
3500
+ for (const key of Object.keys(filters)) {
3501
+ if (filters[key]) {
3502
+ params = params.set(key, filters[key]);
3503
+ }
3504
+ }
3505
+ if (filters.per_game !== undefined) {
3506
+ params = params.set('per_game', filters.per_game ? '1' : '0');
3507
+ }
3508
+ if (filters.tournament_ids) {
3509
+ params = params.set('tournament_ids', filters.tournament_ids.join(','));
3510
+ }
3511
+ }
3512
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/football_statistic/`, { params }).pipe(map(result => FootballStatistic.toFront(result))).toPromise();
3513
+ });
3514
+ }
3515
+ getTournamentTeamUsers(tournamentTeamId) {
3516
+ return __awaiter(this, void 0, void 0, function* () {
3517
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/users/`).pipe(map(result => TournamentTeamUser.toFront(result))).toPromise();
3518
+ });
3519
+ }
3520
+ myPermission(tournamentId) {
3521
+ return __awaiter(this, void 0, void 0, function* () {
3522
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/permission/`).pipe(map((data) => (data.permissions || []).map(item => LeagueUserPermissions[item]))).toPromise();
3523
+ });
3524
+ }
3525
+ getTournamentTeamTournaments(tournamentTeamId) {
3526
+ return __awaiter(this, void 0, void 0, function* () {
3527
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/tournaments/`).pipe(map(result => Tournament.toFront(result))).toPromise();
3528
+ });
3529
+ }
3530
+ getTournamentUserTournaments(tournamentTeamUserId) {
3531
+ return __awaiter(this, void 0, void 0, function* () {
3532
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team_user/${tournamentTeamUserId}/tournaments/`).pipe(map(result => Tournament.toFront(result))).toPromise();
3533
+ });
3534
+ }
3535
+ };
3536
+ TournamentApi.ctorParameters = () => [
3537
+ { type: HttpClient },
3538
+ { type: ConfigService }
3539
+ ];
3540
+ TournamentApi.ɵprov = ɵɵdefineInjectable({ factory: function TournamentApi_Factory() { return new TournamentApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TournamentApi, providedIn: "root" });
3541
+ TournamentApi = __decorate([
3542
+ Injectable({ providedIn: 'root' })
3543
+ ], TournamentApi);
3544
+ function applyGamesFilters(filters, params) {
3545
+ if (filters.tournamentIds) {
3546
+ params = params.set('tournament_ids', filters.tournamentIds.join(','));
3547
+ }
3548
+ if (filters.tournamentStageId) {
3549
+ params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3550
+ }
3551
+ if (filters.tournamentTour) {
3552
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
3553
+ }
3554
+ if (filters.playoffStage) {
3555
+ params = params.set('playoff_stage', filters.playoffStage.toString());
3556
+ }
3557
+ if (filters.teamId) {
3558
+ params = params.set('team_id', filters.teamId.toString());
3559
+ }
3560
+ if (filters.status) {
3561
+ params = params.set('status', GameStatuses[filters.status]);
3562
+ }
3563
+ if (filters.statuses) {
3564
+ const statuses = filters.statuses.map(i => GameStatuses[i]);
3565
+ params = params.set('statuses', statuses.join(','));
3566
+ }
3567
+ if (filters.tournamentCourtId) {
3568
+ params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
3569
+ }
3570
+ if (filters.userId) {
3571
+ params = params.set('user_id', filters.userId.toString());
3572
+ }
3573
+ return params;
3574
+ }
3575
+
3576
+ let LeaguePartner = class LeaguePartner extends BaseModel {
3577
+ static toFront(data) { }
3578
+ static toBack(data) { }
3579
+ };
3580
+ __decorate([
3581
+ ToFrontHook
3582
+ ], LeaguePartner, "toFront", null);
3583
+ __decorate([
3584
+ ToBackHook
3585
+ ], LeaguePartner, "toBack", null);
3586
+ LeaguePartner = __decorate([
3587
+ ModelInstance({
3588
+ mappingFields: {
3589
+ id: 'id',
3590
+ title: 'title',
3591
+ picture: 'picture',
3592
+ link: 'link',
3593
+ sort: 'sort',
3594
+ },
3595
+ relation: {
3596
+ picture: File
3597
+ }
3598
+ })
3599
+ ], LeaguePartner);
3600
+
3601
+ var BannerLocation;
3602
+ (function (BannerLocation) {
3603
+ BannerLocation["slider"] = "slider";
3604
+ BannerLocation["central"] = "central";
3605
+ BannerLocation["media"] = "media";
3606
+ })(BannerLocation || (BannerLocation = {}));
3607
+ let LeagueBanner = class LeagueBanner extends BaseModel {
3608
+ static toFront(data) {
3609
+ }
3610
+ static toBack(data) {
3611
+ }
3612
+ };
3613
+ __decorate([
3614
+ ToFrontHook
3615
+ ], LeagueBanner, "toFront", null);
3616
+ __decorate([
3617
+ ToBackHook
3618
+ ], LeagueBanner, "toBack", null);
3619
+ LeagueBanner = __decorate([
3620
+ ModelInstance({
3621
+ mappingFields: {
3622
+ id: 'id',
3623
+ title: 'title',
3624
+ picture: 'picture',
3625
+ link: 'link',
3626
+ sort: 'sort',
3627
+ location: 'location',
3628
+ },
3629
+ relation: {
3630
+ picture: File,
3631
+ location: enumField(BannerLocation),
3632
+ }
3633
+ })
3634
+ ], LeagueBanner);
3635
+
3636
+ let LeagueApi = class LeagueApi {
3637
+ constructor(httpClient, configService) {
3638
+ this.httpClient = httpClient;
3639
+ this.configService = configService;
3640
+ }
3641
+ getByAlias(alias) {
3642
+ return __awaiter(this, void 0, void 0, function* () {
3643
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${alias}/`).pipe(map(result => League.toFront(result))).toPromise();
3644
+ });
3645
+ }
3646
+ getByDomain(domain) {
3647
+ return __awaiter(this, void 0, void 0, function* () {
3648
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/by_domain/${domain}/`).pipe(map(result => League.toFront(result))).toPromise();
3649
+ });
3650
+ }
3651
+ getTournaments(leagueId) {
3652
+ return __awaiter(this, void 0, void 0, function* () {
3653
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournaments/`).pipe(map(result => Tournament.toFront(result))).toPromise();
3654
+ });
3655
+ }
3656
+ getEvents(leagueId, page, size, filters) {
3657
+ return __awaiter(this, void 0, void 0, function* () {
3658
+ let params = new HttpParams().set('page', page.toString())
3659
+ .set('size', size.toString());
3660
+ if (filters) {
3661
+ if (filters.event) {
3662
+ params = params.set('event', TournamentEventTypes[filters.event]);
3663
+ }
3664
+ if (filters.search) {
3665
+ params = params.set('search', filters.search);
3666
+ }
3667
+ if (filters.tournamentTour) {
3668
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
3669
+ }
3670
+ }
3671
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/events/`, { params, observe: 'response' }).pipe(map(result => ({
3672
+ total: +result.headers.get('X-Page-Count'),
3673
+ data: TournamentEvent.toFront(result.body)
3674
+ }))).toPromise();
3675
+ });
3676
+ }
3677
+ getTournamentSeasons(leagueId) {
3678
+ return __awaiter(this, void 0, void 0, function* () {
3679
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournament_seasons/`).pipe(map(result => TournamentSeason.toFront(result))).toPromise();
3680
+ });
3681
+ }
3682
+ getGames(leagueId, page, size, filters) {
3683
+ return __awaiter(this, void 0, void 0, function* () {
3684
+ let params = new HttpParams().set('page', page.toString());
3685
+ if (size) {
3686
+ params = params.set('size', size.toString());
3687
+ }
3688
+ params = applyGamesFilters(filters, params);
3689
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/games/`, { params, observe: 'response' }).pipe(map(result => ({
3690
+ total: +result.headers.get('X-Page-Count'),
3691
+ data: Game.toFront(result.body)
3692
+ }))).toPromise();
3693
+ });
3694
+ }
3695
+ getSeasons(leagueId, notClosed) {
3696
+ return __awaiter(this, void 0, void 0, function* () {
3697
+ const params = new HttpParams().set('not_closed', notClosed ? '1' : '');
3698
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournament_seasons/`, { params })
3699
+ .pipe(map(result => TournamentSeason.toFront(result)))
3700
+ .toPromise();
3701
+ });
3702
+ }
3703
+ getPartners(leagueId) {
3704
+ return __awaiter(this, void 0, void 0, function* () {
3705
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/partners/`).pipe(map(result => LeaguePartner.toFront(result))).toPromise();
3706
+ });
3707
+ }
3708
+ getBanners(leagueId, location) {
3709
+ return __awaiter(this, void 0, void 0, function* () {
3710
+ const params = location ? new HttpParams().set('location', location) : new HttpParams();
3711
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/banners/`, { params }).pipe(map(result => LeagueBanner.toFront(result))).toPromise();
3712
+ });
3713
+ }
3714
+ getCourts(leagueId) {
3715
+ return __awaiter(this, void 0, void 0, function* () {
3716
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/courts/`).pipe(map(result => LeagueCourt.toFront(result))).toPromise();
3717
+ });
3718
+ }
3719
+ };
3720
+ LeagueApi.ctorParameters = () => [
3721
+ { type: HttpClient },
3722
+ { type: ConfigService }
3723
+ ];
3724
+ LeagueApi.ɵprov = ɵɵdefineInjectable({ factory: function LeagueApi_Factory() { return new LeagueApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: LeagueApi, providedIn: "root" });
3725
+ LeagueApi = __decorate([
3726
+ Injectable({ providedIn: 'root' })
3727
+ ], LeagueApi);
3728
+
3729
+ let LeagueNewsApi = class LeagueNewsApi {
3730
+ constructor(httpClient, configService) {
3731
+ this.httpClient = httpClient;
3732
+ this.configService = configService;
3733
+ }
3734
+ getLeagueNewsList(leagueId, page, size, type = LeagueNewsType.text) {
3735
+ return __awaiter(this, void 0, void 0, function* () {
3736
+ const params = new HttpParams().set('page', page.toString())
3737
+ .set('size', size.toString())
3738
+ .set('type', LeagueNewsType[type]);
3739
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/news/`, { params, observe: 'response' })
3740
+ .pipe(map(response => ({
3741
+ total: +response.headers.get('X-Page-Count'),
3742
+ data: LeagueNews.toFront(response.body)
3743
+ })))
3744
+ .toPromise();
3745
+ });
3746
+ }
3747
+ getMainLeagueNews(leagueId) {
3748
+ return __awaiter(this, void 0, void 0, function* () {
3749
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/news/?is_main=true`)
3750
+ .pipe(map(response => response && response.length > 0 ? LeagueNews.toFront(response[0]) : null))
3751
+ .toPromise();
3752
+ });
3753
+ }
3754
+ getMainLeagueNewsList(leagueId) {
3755
+ return __awaiter(this, void 0, void 0, function* () {
3756
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/news/?is_main=true`)
3757
+ .pipe(map(response => LeagueNews.toFront(response)))
3758
+ .toPromise();
3759
+ });
3760
+ }
3761
+ getNewsById(newsId) {
3762
+ return __awaiter(this, void 0, void 0, function* () {
3763
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league_news/${newsId}/`)
3764
+ .pipe(map(response => LeagueNews.toFront(response)))
3765
+ .toPromise();
3766
+ });
3767
+ }
3768
+ getTournamentNewsList(tournamentId) {
3769
+ return __awaiter(this, void 0, void 0, function* () {
3770
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/news/`, { observe: 'response' })
3771
+ .pipe(map(response => ({
3772
+ total: +response.headers.get('X-Page-Count'),
3773
+ data: LeagueNews.toFront(response.body)
3774
+ })))
3775
+ .toPromise();
3776
+ });
3777
+ }
3778
+ };
3779
+ LeagueNewsApi.ctorParameters = () => [
3780
+ { type: HttpClient },
3781
+ { type: ConfigService }
3782
+ ];
3783
+ LeagueNewsApi.ɵprov = ɵɵdefineInjectable({ factory: function LeagueNewsApi_Factory() { return new LeagueNewsApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: LeagueNewsApi, providedIn: "root" });
3784
+ LeagueNewsApi = __decorate([
3785
+ Injectable({ providedIn: 'root' })
3786
+ ], LeagueNewsApi);
3787
+
3788
+ let MediaApi = class MediaApi {
3789
+ constructor(httpClient, configService) {
3790
+ this.httpClient = httpClient;
3791
+ this.configService = configService;
3792
+ }
3793
+ getMedia(mediaId) {
3794
+ return __awaiter(this, void 0, void 0, function* () {
3795
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/media/${mediaId}/`).pipe(map(result => MediaItem.toFront(result))).toPromise();
3796
+ });
3797
+ }
3798
+ getTournamentGameMedia(tournamentId, page, size, filters) {
3799
+ return __awaiter(this, void 0, void 0, function* () {
3800
+ let params = new HttpParams().set('page', page.toString()).set('size', size.toString());
3801
+ if (filters) {
3802
+ if (filters.tournamentTour) {
3803
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
3804
+ }
3805
+ if (filters.teamId) {
3806
+ params = params.set('team_id', filters.teamId.toString());
3807
+ }
3808
+ if (filters.tournamentStageId) {
3809
+ params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3810
+ }
3811
+ if (filters.playoffId) {
3812
+ params = params.set('playoff_id', filters.playoffId.toString());
3813
+ }
3814
+ if (filters.playoffStage) {
3815
+ params = params.set('playoff_stage', filters.playoffStage.toString());
3816
+ }
3817
+ if (filters.status) {
3818
+ params = params.set('status', GameStatuses[filters.status]);
3819
+ }
3820
+ }
3821
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/game_media/`, { observe: 'response', params }).pipe(map(response => {
3822
+ return {
3823
+ total: +response.headers.get('X-Page-Count'),
3824
+ data: Game.toFront(response.body)
3825
+ };
3826
+ })).toPromise();
3827
+ });
3828
+ }
3829
+ getLeagueGameMedia(leagueId, page, size, filters) {
3830
+ return __awaiter(this, void 0, void 0, function* () {
3831
+ let params = new HttpParams().set('page', page.toString()).set('size', size.toString());
3832
+ if (filters) {
3833
+ if (filters.tournamentTour) {
3834
+ params = params.set('tournament_tour', filters.tournamentTour.toString());
3835
+ }
3836
+ if (filters.teamId) {
3837
+ params = params.set('team_id', filters.teamId.toString());
3838
+ }
3839
+ if (filters.tournamentStageId) {
3840
+ params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
3841
+ }
3842
+ if (filters.playoffId) {
3843
+ params = params.set('playoff_id', filters.playoffId.toString());
3844
+ }
3845
+ if (filters.playoffStage) {
3846
+ params = params.set('playoff_stage', filters.playoffStage.toString());
3847
+ }
3848
+ if (filters.status) {
3849
+ params = params.set('status', GameStatuses[filters.status]);
3850
+ }
3851
+ }
3852
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/game_media/`, { observe: 'response', params }).pipe(map(response => {
3853
+ return {
3854
+ total: +response.headers.get('X-Page-Count'),
3855
+ data: Game.toFront(response.body)
3856
+ };
3857
+ })).toPromise();
3858
+ });
3859
+ }
3860
+ getLeagueMedia(leagueId, page, size, filters = {}) {
3861
+ return __awaiter(this, void 0, void 0, function* () {
3862
+ let params = new HttpParams().set('page', page.toString()).set('size', size.toString());
3863
+ if (filters.mediaType) {
3864
+ params = params.set('media_type', filters.mediaType);
3865
+ }
3866
+ if (filters.sort) {
3867
+ params = params.set('sort', filters.sort);
3868
+ }
3869
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/media/`, { params, observe: 'response' })
3870
+ .pipe(map(response => ({
3871
+ total: +response.headers.get('X-Page-Count'),
3872
+ data: MediaItem.toFront(response.body)
3873
+ }))).toPromise();
3874
+ });
3875
+ }
3876
+ getGameMediaById(gameId) {
3877
+ return __awaiter(this, void 0, void 0, function* () {
3878
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/game_media/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
3879
+ });
3880
+ }
3881
+ getGameMedia(gameId) {
3882
+ return __awaiter(this, void 0, void 0, function* () {
3883
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/media/`).pipe(map(result => MediaItem.toFront(result))).toPromise();
3884
+ });
3885
+ }
3886
+ createZip(mediaIds) {
3887
+ return __awaiter(this, void 0, void 0, function* () {
3888
+ return this.httpClient
3889
+ .post(`${this.configService.get('apiUrl')}/api/v1/media/zip/`, mediaIds, { responseType: 'blob' })
3890
+ .toPromise();
3891
+ });
3892
+ }
3893
+ downloadMedia(mediaId) {
3894
+ return __awaiter(this, void 0, void 0, function* () {
3895
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/media/${mediaId}/download/`, { responseType: 'blob' })
3896
+ .toPromise();
3897
+ });
3898
+ }
3899
+ };
3900
+ MediaApi.ctorParameters = () => [
3901
+ { type: HttpClient },
3902
+ { type: ConfigService }
3903
+ ];
3904
+ MediaApi.ɵprov = ɵɵdefineInjectable({ factory: function MediaApi_Factory() { return new MediaApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: MediaApi, providedIn: "root" });
3905
+ MediaApi = __decorate([
3906
+ Injectable({ providedIn: 'root' })
3907
+ ], MediaApi);
3908
+
3909
+ var PollStatuses;
3910
+ (function (PollStatuses) {
3911
+ PollStatuses[PollStatuses["open"] = 1] = "open";
3912
+ PollStatuses[PollStatuses["closed"] = 2] = "closed";
3913
+ PollStatuses[PollStatuses["archived"] = 3] = "archived";
3914
+ })(PollStatuses || (PollStatuses = {}));
3915
+ let PollVariant = class PollVariant extends BaseModel {
3916
+ static toFront(data) { }
3917
+ static toBack(data) { }
3918
+ };
3560
3919
  __decorate([
3561
3920
  ToFrontHook
3562
- ], TeamEventInvite, "toFront", null);
3921
+ ], PollVariant, "toFront", null);
3563
3922
  __decorate([
3564
3923
  ToBackHook
3565
- ], TeamEventInvite, "toBack", null);
3566
- TeamEventInvite = __decorate([
3924
+ ], PollVariant, "toBack", null);
3925
+ PollVariant = __decorate([
3567
3926
  ModelInstance({
3568
3927
  mappingFields: {
3569
- id: 'id',
3570
- team_event_id: 'teamEventId',
3571
- team_user_id: 'teamUserId',
3572
- status: 'status',
3573
- },
3574
- relation: {
3575
- status: enumField(TeamEventInviteStatuses)
3928
+ uuid: 'uuid',
3929
+ name: 'name'
3576
3930
  }
3577
3931
  })
3578
- ], TeamEventInvite);
3579
-
3580
- let TournamentTeamUserInvite = class TournamentTeamUserInvite extends BaseModel {
3932
+ ], PollVariant);
3933
+ let PollAnswer = class PollAnswer extends BaseModel {
3581
3934
  static toFront(data) { }
3582
3935
  static toBack(data) { }
3583
3936
  };
3584
3937
  __decorate([
3585
3938
  ToFrontHook
3586
- ], TournamentTeamUserInvite, "toFront", null);
3939
+ ], PollAnswer, "toFront", null);
3587
3940
  __decorate([
3588
3941
  ToBackHook
3589
- ], TournamentTeamUserInvite, "toBack", null);
3590
- TournamentTeamUserInvite = __decorate([
3942
+ ], PollAnswer, "toBack", null);
3943
+ PollAnswer = __decorate([
3591
3944
  ModelInstance({
3592
3945
  mappingFields: {
3593
3946
  id: 'id',
3594
- tournament_team_invite_id: 'tournamentTeamInviteId',
3595
- tournament_team_id: 'tournamentTeamId',
3596
- team_user: 'teamUser',
3597
- accepted: 'accepted'
3947
+ answer_uuid: 'answerUuid',
3948
+ user: 'user',
3949
+ poll_id: 'pollId',
3598
3950
  },
3599
3951
  relation: {
3600
- teamUser: TeamUser
3952
+ user: User
3601
3953
  }
3602
3954
  })
3603
- ], TournamentTeamUserInvite);
3604
-
3605
- let TournamentInvite = class TournamentInvite extends BaseModel {
3606
- get isOpen() {
3607
- return (this.teamAccept === null || this.organizationAccept === null) && this.teamAccept !== false && this.organizationAccept !== false;
3955
+ ], PollAnswer);
3956
+ let Poll = class Poll extends BaseModel {
3957
+ constructor() {
3958
+ super(...arguments);
3959
+ this.variantsWithAnswers = [];
3960
+ }
3961
+ set variants(value) {
3962
+ this._variants = value || [];
3963
+ if (this._answers) {
3964
+ this.calculateAnswersPercentage();
3965
+ }
3966
+ }
3967
+ get variants() {
3968
+ return this._variants;
3969
+ }
3970
+ set answers(value) {
3971
+ this._answers = value || [];
3972
+ if (this._variants) {
3973
+ this.calculateAnswersPercentage();
3974
+ }
3975
+ }
3976
+ get answers() {
3977
+ return this._answers;
3978
+ }
3979
+ calculateAnswersPercentage() {
3980
+ if (!this._answers.length) {
3981
+ return;
3982
+ }
3983
+ const variants = this._variants.map(v => v.uuid);
3984
+ const answersByVariant = this._answers.reduce((acc, item) => {
3985
+ if (variants.indexOf(item.answerUuid) < 0) {
3986
+ return acc;
3987
+ }
3988
+ if (!acc[item.answerUuid]) {
3989
+ acc[item.answerUuid] = 0;
3990
+ }
3991
+ acc[item.answerUuid]++;
3992
+ return acc;
3993
+ }, {});
3994
+ this.variantsWithAnswers = this._variants.map(item => ({
3995
+ variant: item,
3996
+ percent: answersByVariant[item.uuid] ? Math.round(100 * answersByVariant[item.uuid] / this._answers.length) : 0
3997
+ }))
3998
+ .sort((a, b) => a.percent > b.percent ? -1 : 1);
3608
3999
  }
3609
4000
  static toFront(data) { }
3610
4001
  static toBack(data) { }
3611
4002
  };
3612
4003
  __decorate([
3613
4004
  ToFrontHook
3614
- ], TournamentInvite, "toFront", null);
3615
- __decorate([
3616
- ToBackHook
3617
- ], TournamentInvite, "toBack", null);
3618
- TournamentInvite = __decorate([
3619
- ModelInstance({
3620
- mappingFields: {
3621
- id: 'id',
3622
- team: 'team',
3623
- tournament: 'tournament',
3624
- team_accept: 'teamAccept',
3625
- organization_accept: 'organizationAccept',
3626
- user_invites_count: 'userInvitesCount',
3627
- user_invites: 'userInvites',
3628
- notifications_count: 'notificationsCount',
3629
- },
3630
- relation: {
3631
- team: Team,
3632
- tournament: Tournament,
3633
- userInvites: TournamentTeamUserInvite,
3634
- }
3635
- })
3636
- ], TournamentInvite);
3637
-
3638
- var NotificationType;
3639
- (function (NotificationType) {
3640
- NotificationType[NotificationType["team_updated"] = 1] = "team_updated";
3641
- NotificationType[NotificationType["team_invited"] = 2] = "team_invited";
3642
- NotificationType[NotificationType["team_join_request"] = 3] = "team_join_request";
3643
- NotificationType[NotificationType["team_join_declined_by_team"] = 4] = "team_join_declined_by_team";
3644
- NotificationType[NotificationType["team_join_declined_by_user"] = 5] = "team_join_declined_by_user";
3645
- NotificationType[NotificationType["team_join_canceled_by_team"] = 6] = "team_join_canceled_by_team";
3646
- NotificationType[NotificationType["team_join_canceled_by_user"] = 7] = "team_join_canceled_by_user";
3647
- NotificationType[NotificationType["team_joined_for_user"] = 8] = "team_joined_for_user";
3648
- NotificationType[NotificationType["team_joined_for_team"] = 9] = "team_joined_for_team";
3649
- NotificationType[NotificationType["team_user_role_changed_for_user"] = 10] = "team_user_role_changed_for_user";
3650
- NotificationType[NotificationType["team_user_role_changed_for_team"] = 11] = "team_user_role_changed_for_team";
3651
- NotificationType[NotificationType["team_user_number_changed"] = 12] = "team_user_number_changed";
3652
- NotificationType[NotificationType["team_user_deleted_for_user"] = 13] = "team_user_deleted_for_user";
3653
- NotificationType[NotificationType["team_user_deleted_for_team"] = 14] = "team_user_deleted_for_team";
3654
- NotificationType[NotificationType["team_user_left"] = 15] = "team_user_left";
3655
- NotificationType[NotificationType["game_updated"] = 16] = "game_updated";
3656
- NotificationType[NotificationType["game_invited"] = 17] = "game_invited";
3657
- NotificationType[NotificationType["game_invite_accepted"] = 18] = "game_invite_accepted";
3658
- NotificationType[NotificationType["game_invite_declined"] = 19] = "game_invite_declined";
3659
- NotificationType[NotificationType["game_remind"] = 20] = "game_remind";
3660
- NotificationType[NotificationType["game_won"] = 21] = "game_won";
3661
- NotificationType[NotificationType["game_losing"] = 22] = "game_losing";
3662
- NotificationType[NotificationType["game_tech_defeat"] = 23] = "game_tech_defeat";
3663
- NotificationType[NotificationType["game_tech_victory"] = 24] = "game_tech_victory";
3664
- NotificationType[NotificationType["poll_created"] = 25] = "poll_created";
3665
- NotificationType[NotificationType["poll_closed"] = 26] = "poll_closed";
3666
- NotificationType[NotificationType["team_event_invited"] = 27] = "team_event_invited";
3667
- NotificationType[NotificationType["team_event_accepted"] = 28] = "team_event_accepted";
3668
- NotificationType[NotificationType["team_event_declined"] = 29] = "team_event_declined";
3669
- NotificationType[NotificationType["team_event_remind"] = 30] = "team_event_remind";
3670
- NotificationType[NotificationType["tournament_invited"] = 31] = "tournament_invited";
3671
- NotificationType[NotificationType["tournament_joined"] = 32] = "tournament_joined";
3672
- NotificationType[NotificationType["tournament_join_declined"] = 33] = "tournament_join_declined";
3673
- NotificationType[NotificationType["tournament_join_canceled"] = 34] = "tournament_join_canceled";
3674
- NotificationType[NotificationType["tournament_user_invited"] = 35] = "tournament_user_invited";
3675
- NotificationType[NotificationType["tournament_user_accepted_for_team"] = 36] = "tournament_user_accepted_for_team";
3676
- NotificationType[NotificationType["tournament_user_accepted_for_user"] = 37] = "tournament_user_accepted_for_user";
3677
- NotificationType[NotificationType["tournament_user_added"] = 38] = "tournament_user_added";
3678
- NotificationType[NotificationType["tournament_user_declined_for_team"] = 39] = "tournament_user_declined_for_team";
3679
- NotificationType[NotificationType["tournament_user_declined_for_user"] = 40] = "tournament_user_declined_for_user";
3680
- NotificationType[NotificationType["tournament_user_invite_deleted"] = 41] = "tournament_user_invite_deleted";
3681
- NotificationType[NotificationType["tournament_user_deleted"] = 42] = "tournament_user_deleted";
3682
- NotificationType[NotificationType["tournament_user_disqualified_for_team"] = 43] = "tournament_user_disqualified_for_team";
3683
- NotificationType[NotificationType["tournament_user_disqualified_for_user"] = 44] = "tournament_user_disqualified_for_user";
3684
- NotificationType[NotificationType["tournament_user_disqualification_updated_for_team"] = 45] = "tournament_user_disqualification_updated_for_team";
3685
- NotificationType[NotificationType["tournament_user_disqualification_updated_for_user"] = 46] = "tournament_user_disqualification_updated_for_user";
3686
- NotificationType[NotificationType["tournament_team_deleted"] = 47] = "tournament_team_deleted";
3687
- NotificationType[NotificationType["org_tournament_invite_created"] = 48] = "org_tournament_invite_created";
3688
- NotificationType[NotificationType["org_tournament_invite_declined"] = 49] = "org_tournament_invite_declined";
3689
- NotificationType[NotificationType["org_tournament_invite_deleted"] = 50] = "org_tournament_invite_deleted";
3690
- NotificationType[NotificationType["org_tournament_invite_changed"] = 51] = "org_tournament_invite_changed";
3691
- NotificationType[NotificationType["org_tournament_user_deleted"] = 52] = "org_tournament_user_deleted";
3692
- NotificationType[NotificationType["org_tournament_user_invited"] = 53] = "org_tournament_user_invited";
3693
- NotificationType[NotificationType["org_tournament_user_has_changes"] = 54] = "org_tournament_user_has_changes";
3694
- NotificationType[NotificationType["org_tournament_team_leave"] = 55] = "org_tournament_team_leave";
3695
- })(NotificationType || (NotificationType = {}));
3696
- var NotificationServiceEnum;
3697
- (function (NotificationServiceEnum) {
3698
- NotificationServiceEnum[NotificationServiceEnum["public"] = 1] = "public";
3699
- NotificationServiceEnum[NotificationServiceEnum["org"] = 2] = "org";
3700
- })(NotificationServiceEnum || (NotificationServiceEnum = {}));
3701
- let Notification = class Notification extends BaseModel {
3702
- get important() {
3703
- return true;
3704
- }
3705
- static toFront(value) { }
3706
- static toBack(value) { }
4005
+ ], Poll, "toFront", null);
4006
+ __decorate([
4007
+ ToBackHook
4008
+ ], Poll, "toBack", null);
4009
+ Poll = __decorate([
4010
+ ModelInstance({
4011
+ mappingFields: {
4012
+ id: 'id',
4013
+ active: 'active',
4014
+ status: 'status',
4015
+ team_id: 'teamId',
4016
+ name: 'name',
4017
+ description: 'description',
4018
+ variants: 'variants',
4019
+ author: 'author',
4020
+ answers: 'answers',
4021
+ multiple_answer: 'multipleAnswer',
4022
+ anonymous: 'anonymous',
4023
+ created_at: 'createdAt'
4024
+ },
4025
+ relation: {
4026
+ status: enumField(PollStatuses),
4027
+ variants: PollVariant,
4028
+ author: User,
4029
+ answers: PollAnswer,
4030
+ createdAt: DateTimeField,
4031
+ }
4032
+ })
4033
+ ], Poll);
4034
+
4035
+ let TeamInvite = class TeamInvite extends BaseModel {
4036
+ static toFront(data) { }
4037
+ static toBack(data) { }
3707
4038
  };
3708
4039
  __decorate([
3709
4040
  ToFrontHook
3710
- ], Notification, "toFront", null);
4041
+ ], TeamInvite, "toFront", null);
3711
4042
  __decorate([
3712
4043
  ToBackHook
3713
- ], Notification, "toBack", null);
3714
- Notification = __decorate([
4044
+ ], TeamInvite, "toBack", null);
4045
+ TeamInvite = __decorate([
3715
4046
  ModelInstance({
3716
4047
  mappingFields: {
3717
4048
  id: 'id',
3718
- event_type: 'event',
3719
- data: 'data',
3720
- initiator: 'initiator',
4049
+ user_id: 'userId',
4050
+ user: 'user',
3721
4051
  team: 'team',
3722
- team_invite: 'teamInvite',
3723
- team_user: 'teamUser',
3724
- poll: 'poll',
3725
- game: 'game',
3726
- game_invite: 'gameInvite',
3727
- team_event: 'teamEvent',
3728
- team_event_invite: 'teamEventInvite',
3729
- tournament: 'tournament',
3730
- tournament_invite: 'tournamentInvite',
3731
- tournament_team: 'tournamentTeam',
3732
- viewed: 'viewed',
3733
- protected: 'protected',
3734
- service: 'service',
4052
+ team_id: 'teamId',
4053
+ user_accept: 'userAccept',
4054
+ team_accept: 'teamAccept',
4055
+ users_count: 'usersCount',
4056
+ games_count: 'gamesCount',
4057
+ won_games_count: 'wonGamesCount',
4058
+ score_sum: 'scoreSum',
3735
4059
  created_at: 'createdAt',
4060
+ updated_at: 'updatedAt',
3736
4061
  },
3737
4062
  relation: {
3738
- event: enumField(NotificationType),
3739
- initiator: User,
4063
+ user: User,
3740
4064
  team: Team,
3741
- teamInvite: TeamInvite,
3742
- teamUser: TeamUser,
3743
- poll: Poll,
3744
- game: Game,
3745
- gameInvite: GameInvite,
3746
- teamEvent: TeamEvent,
3747
- teamEventInvite: TeamEventInvite,
3748
- tournament: Tournament,
3749
- tournamentInvite: TournamentInvite,
3750
- tournamentTeam: TournamentTeam,
3751
- service: enumField(NotificationServiceEnum),
3752
4065
  createdAt: DateTimeField,
4066
+ updateAt: DateTimeField,
3753
4067
  }
3754
4068
  })
3755
- ], Notification);
4069
+ ], TeamInvite);
3756
4070
 
3757
- var NotificationAllowTypes;
3758
- (function (NotificationAllowTypes) {
3759
- NotificationAllowTypes[NotificationAllowTypes["all"] = 1] = "all";
3760
- NotificationAllowTypes[NotificationAllowTypes["important"] = 2] = "important";
3761
- NotificationAllowTypes[NotificationAllowTypes["none"] = 3] = "none";
3762
- })(NotificationAllowTypes || (NotificationAllowTypes = {}));
3763
- let NotificationSettings = class NotificationSettings extends BaseModel {
4071
+ var GameInviteStatus;
4072
+ (function (GameInviteStatus) {
4073
+ GameInviteStatus[GameInviteStatus["accepted"] = 1] = "accepted";
4074
+ GameInviteStatus[GameInviteStatus["declined"] = 2] = "declined";
4075
+ })(GameInviteStatus || (GameInviteStatus = {}));
4076
+ let GameInvite = class GameInvite extends BaseModel {
3764
4077
  static toFront(data) { }
3765
4078
  static toBack(data) { }
3766
4079
  };
3767
4080
  __decorate([
3768
4081
  ToFrontHook
3769
- ], NotificationSettings, "toFront", null);
4082
+ ], GameInvite, "toFront", null);
3770
4083
  __decorate([
3771
4084
  ToBackHook
3772
- ], NotificationSettings, "toBack", null);
3773
- NotificationSettings = __decorate([
4085
+ ], GameInvite, "toBack", null);
4086
+ GameInvite = __decorate([
3774
4087
  ModelInstance({
3775
4088
  mappingFields: {
3776
- user_id: 'userId',
3777
- popup: 'popup',
3778
- sound: 'sound',
3779
- browser: 'browser',
3780
- email: 'email'
4089
+ id: 'id',
4090
+ team_user: 'teamUser',
4091
+ game_id: 'gameId',
4092
+ game: 'game',
4093
+ status: 'status',
3781
4094
  },
3782
4095
  relation: {
3783
- sound: enumField(NotificationAllowTypes),
3784
- browser: enumField(NotificationAllowTypes),
4096
+ game: Game,
4097
+ teamUser: TeamUser,
4098
+ status: enumField(GameInviteStatus),
3785
4099
  }
3786
4100
  })
3787
- ], NotificationSettings);
3788
-
3789
- let NotificationBaseApi = class NotificationBaseApi {
3790
- constructor(httpClient, configService) {
3791
- this.httpClient = httpClient;
3792
- this.configService = configService;
3793
- }
3794
- getCount() {
3795
- return __awaiter(this, void 0, void 0, function* () {
3796
- return this.httpClient
3797
- .get(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/count/`)
3798
- .pipe(map(data => +data))
3799
- .toPromise();
3800
- });
3801
- }
3802
- getList(page, size, filters = {}) {
3803
- return __awaiter(this, void 0, void 0, function* () {
3804
- let params = new HttpParams()
3805
- .set('page', page.toString())
3806
- .set('size', size.toString());
3807
- for (const key of Object.keys(filters)) {
3808
- params = params.set(key, filters[key]);
3809
- }
3810
- return this.httpClient
3811
- .get(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/`, { params, observe: 'response' })
3812
- .pipe(map(response => {
3813
- const data = Notification.toFront(response.body);
3814
- return {
3815
- total: +response.headers.get('x-page-count'),
3816
- data
3817
- };
3818
- })).toPromise();
3819
- });
3820
- }
3821
- markViewed(notificationId, viewed) {
3822
- return __awaiter(this, void 0, void 0, function* () {
3823
- return this.httpClient
3824
- .post(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/${notificationId}/viewed/`, { viewed })
3825
- .pipe(map(data => Notification.toFront(data)))
3826
- .toPromise();
3827
- });
3828
- }
3829
- markAllViewed() {
3830
- return __awaiter(this, void 0, void 0, function* () {
3831
- return this.httpClient
3832
- .post(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/viewed/`, {})
3833
- .pipe(map(data => Notification.toFront(data)))
3834
- .toPromise();
3835
- });
3836
- }
3837
- getNotificationSettings() {
3838
- return __awaiter(this, void 0, void 0, function* () {
3839
- return this.httpClient.get(`${this.configService.get('apiUrl')}${this.apiUrl}/notification_settings/`)
3840
- .pipe(map(data => NotificationSettings.toFront(data)))
3841
- .toPromise();
3842
- });
3843
- }
3844
- updateNotificationSettings(data) {
3845
- return __awaiter(this, void 0, void 0, function* () {
3846
- return this.httpClient.post(`${this.configService.get('apiUrl')}${this.apiUrl}/notification_settings/`, NotificationSettings.toBack(data))
3847
- .pipe(map(result => NotificationSettings.toFront(result)))
3848
- .toPromise();
3849
- });
3850
- }
3851
- };
3852
- NotificationBaseApi.ctorParameters = () => [
3853
- { type: HttpClient },
3854
- { type: ConfigService }
3855
- ];
3856
- NotificationBaseApi.ɵprov = ɵɵdefineInjectable({ factory: function NotificationBaseApi_Factory() { return new NotificationBaseApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: NotificationBaseApi, providedIn: "root" });
3857
- NotificationBaseApi = __decorate([
3858
- Injectable({ providedIn: 'root' })
3859
- ], NotificationBaseApi);
4101
+ ], GameInvite);
3860
4102
 
3861
- let NotificationApi = class NotificationApi extends NotificationBaseApi {
3862
- constructor() {
3863
- super(...arguments);
3864
- this.apiUrl = '/api/v1';
3865
- }
3866
- };
3867
- NotificationApi.ɵprov = ɵɵdefineInjectable({ factory: function NotificationApi_Factory() { return new NotificationApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: NotificationApi, providedIn: "root" });
3868
- NotificationApi = __decorate([
3869
- Injectable({ providedIn: 'root' })
3870
- ], NotificationApi);
4103
+ var TeamEventTypes;
4104
+ (function (TeamEventTypes) {
4105
+ TeamEventTypes[TeamEventTypes["training"] = 1] = "training";
4106
+ TeamEventTypes[TeamEventTypes["other"] = 2] = "other";
4107
+ })(TeamEventTypes || (TeamEventTypes = {}));
3871
4108
 
3872
- let OrgNotificationApi = class OrgNotificationApi extends NotificationBaseApi {
3873
- constructor() {
3874
- super(...arguments);
3875
- this.apiUrl = '/org/api/v1';
3876
- }
4109
+ const TeamEventTypeLocalization = {
4110
+ [TeamEventTypes.training]: 'Тренировка',
4111
+ [TeamEventTypes.other]: 'Другое'
3877
4112
  };
3878
- OrgNotificationApi.ɵprov = ɵɵdefineInjectable({ factory: function OrgNotificationApi_Factory() { return new OrgNotificationApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: OrgNotificationApi, providedIn: "root" });
3879
- OrgNotificationApi = __decorate([
3880
- Injectable({ providedIn: 'root' })
3881
- ], OrgNotificationApi);
3882
4113
 
3883
- let ReferenceApi = class ReferenceApi {
3884
- constructor(httpClient, configService) {
3885
- this.httpClient = httpClient;
3886
- this.configService = configService;
3887
- }
3888
- getCities() {
3889
- return __awaiter(this, void 0, void 0, function* () {
3890
- return this.httpClient
3891
- .get(`${this.configService.get('apiUrl')}/api/v1/reference/cities/`)
3892
- .pipe(map(data => City.toFront(data))).toPromise();
3893
- });
4114
+ let TeamEvent = class TeamEvent extends BaseModel {
4115
+ get name() {
4116
+ if (this.eventType === TeamEventTypes.other) {
4117
+ return this.eventCustomName;
4118
+ }
4119
+ return TeamEventTypeLocalization[this.eventType];
3894
4120
  }
3895
- getSports() {
3896
- return __awaiter(this, void 0, void 0, function* () {
3897
- return this.httpClient
3898
- .get(`${this.configService.get('apiUrl')}/api/v1/sport/`)
3899
- .pipe(map(data => Sport.toFront(data))).toPromise();
3900
- });
4121
+ get isClosed() {
4122
+ return this.datetime.getTime() < new Date().getTime();
3901
4123
  }
4124
+ static toFront(data) { }
4125
+ static toBack(data) { }
3902
4126
  };
3903
- ReferenceApi.ctorParameters = () => [
3904
- { type: HttpClient },
3905
- { type: ConfigService }
3906
- ];
3907
- ReferenceApi.ɵprov = ɵɵdefineInjectable({ factory: function ReferenceApi_Factory() { return new ReferenceApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: ReferenceApi, providedIn: "root" });
3908
- ReferenceApi = __decorate([
3909
- Injectable({ providedIn: 'root' })
3910
- ], ReferenceApi);
4127
+ __decorate([
4128
+ ToFrontHook
4129
+ ], TeamEvent, "toFront", null);
4130
+ __decorate([
4131
+ ToBackHook
4132
+ ], TeamEvent, "toBack", null);
4133
+ TeamEvent = __decorate([
4134
+ ModelInstance({
4135
+ mappingFields: {
4136
+ id: 'id',
4137
+ team_id: 'teamId',
4138
+ team: 'team',
4139
+ event_type: 'eventType',
4140
+ event_custom_name: 'eventCustomName',
4141
+ description: 'description',
4142
+ datetime: 'datetime',
4143
+ location: 'location',
4144
+ },
4145
+ relation: {
4146
+ eventType: enumField(TeamEventTypes),
4147
+ team: Team,
4148
+ datetime: DateTimeField,
4149
+ }
4150
+ })
4151
+ ], TeamEvent);
3911
4152
 
3912
- let TeamInviteExternal = class TeamInviteExternal extends BaseModel {
4153
+ var TeamEventInviteStatuses;
4154
+ (function (TeamEventInviteStatuses) {
4155
+ TeamEventInviteStatuses[TeamEventInviteStatuses["accepted"] = 1] = "accepted";
4156
+ TeamEventInviteStatuses[TeamEventInviteStatuses["declined"] = 2] = "declined";
4157
+ })(TeamEventInviteStatuses || (TeamEventInviteStatuses = {}));
4158
+ let TeamEventInvite = class TeamEventInvite {
3913
4159
  static toFront(data) { }
3914
4160
  static toBack(data) { }
3915
4161
  };
3916
4162
  __decorate([
3917
4163
  ToFrontHook
3918
- ], TeamInviteExternal, "toFront", null);
4164
+ ], TeamEventInvite, "toFront", null);
3919
4165
  __decorate([
3920
4166
  ToBackHook
3921
- ], TeamInviteExternal, "toBack", null);
3922
- TeamInviteExternal = __decorate([
4167
+ ], TeamEventInvite, "toBack", null);
4168
+ TeamEventInvite = __decorate([
3923
4169
  ModelInstance({
3924
4170
  mappingFields: {
3925
4171
  id: 'id',
3926
- team_id: 'teamId',
3927
- email: 'email',
3928
- first_name: 'firstName',
3929
- last_name: 'lastName',
4172
+ team_event_id: 'teamEventId',
4173
+ team_user_id: 'teamUserId',
4174
+ status: 'status',
3930
4175
  },
4176
+ relation: {
4177
+ status: enumField(TeamEventInviteStatuses)
4178
+ }
3931
4179
  })
3932
- ], TeamInviteExternal);
4180
+ ], TeamEventInvite);
3933
4181
 
3934
- let VolleyballStatistic = class VolleyballStatistic extends BaseStatistic {
4182
+ let TournamentTeamUserInvite = class TournamentTeamUserInvite extends BaseModel {
3935
4183
  static toFront(data) { }
3936
4184
  static toBack(data) { }
3937
4185
  };
3938
4186
  __decorate([
3939
4187
  ToFrontHook
3940
- ], VolleyballStatistic, "toFront", null);
4188
+ ], TournamentTeamUserInvite, "toFront", null);
3941
4189
  __decorate([
3942
4190
  ToBackHook
3943
- ], VolleyballStatistic, "toBack", null);
3944
- VolleyballStatistic = __decorate([
4191
+ ], TournamentTeamUserInvite, "toBack", null);
4192
+ TournamentTeamUserInvite = __decorate([
3945
4193
  ModelInstance({
3946
4194
  mappingFields: {
3947
- team: 'team',
4195
+ id: 'id',
4196
+ tournament_team_invite_id: 'tournamentTeamInviteId',
4197
+ tournament_team_id: 'tournamentTeamId',
3948
4198
  team_user: 'teamUser',
3949
- tournament_team_user: 'tournamentTeamUser',
3950
- tournament_team: 'tournamentTeam',
3951
- user: 'user',
3952
- month: 'month',
3953
- win_lose: 'winLose',
3954
- games_count: 'gamesCount',
3955
- won_games_count: 'wonGamesCount',
3956
- serve_hits: 'serveHits',
3957
- serve_faults: 'serveFaults',
3958
- serve_aces: 'serveAces',
3959
- serve_percent: 'servePercent',
3960
- ace_percent: 'acePercent',
3961
- stuff_blocks: 'stuffBlocks',
3962
- block_faults: 'blockFaults',
3963
- block_rebounds: 'blockRebounds',
3964
- block_percent: 'blockPercent',
3965
- attack_spikes: 'attackSpikes',
3966
- attack_faults: 'attackFaults',
3967
- attack_shots: 'attackShots',
3968
- attack_percent: 'attackPercent',
3969
- receives: 'receives',
3970
- receive_faults: 'receiveFaults',
3971
- excellent_receives: 'excellentReceives',
3972
- receive_percent: 'receivePercent',
3973
- serve_receives: 'serveReceives',
3974
- serve_receive_faults: 'serveReceiveFaults',
3975
- excellent_serve_receives: 'excellentServeReceives',
3976
- serve_receive_percent: 'serveReceivePercent',
3977
- points: 'points',
3978
- faults: 'faults',
3979
- newbie: 'newbie',
4199
+ accepted: 'accepted'
3980
4200
  },
3981
4201
  relation: {
3982
- team: Team,
3983
- teamUser: TeamUser,
3984
- tournamentTeamUser: TournamentTeamUser,
3985
- tournamentTeam: TournamentTeam,
3986
- user: User,
3987
- month: DateField,
4202
+ teamUser: TeamUser
3988
4203
  }
3989
4204
  })
3990
- ], VolleyballStatistic);
4205
+ ], TournamentTeamUserInvite);
3991
4206
 
3992
- var TeamPermissionTypes;
3993
- (function (TeamPermissionTypes) {
3994
- TeamPermissionTypes[TeamPermissionTypes["for_all"] = 1] = "for_all";
3995
- TeamPermissionTypes[TeamPermissionTypes["for_users"] = 2] = "for_users";
3996
- TeamPermissionTypes[TeamPermissionTypes["for_team"] = 3] = "for_team";
3997
- })(TeamPermissionTypes || (TeamPermissionTypes = {}));
3998
- let TeamPermission = class TeamPermission extends BaseModel {
4207
+ let TournamentInvite = class TournamentInvite extends BaseModel {
4208
+ get isOpen() {
4209
+ return (this.teamAccept === null || this.organizationAccept === null) && this.teamAccept !== false && this.organizationAccept !== false;
4210
+ }
3999
4211
  static toFront(data) { }
4000
4212
  static toBack(data) { }
4001
4213
  };
4002
4214
  __decorate([
4003
4215
  ToFrontHook
4004
- ], TeamPermission, "toFront", null);
4216
+ ], TournamentInvite, "toFront", null);
4005
4217
  __decorate([
4006
4218
  ToBackHook
4007
- ], TeamPermission, "toBack", null);
4008
- TeamPermission = __decorate([
4219
+ ], TournamentInvite, "toBack", null);
4220
+ TournamentInvite = __decorate([
4009
4221
  ModelInstance({
4010
4222
  mappingFields: {
4011
- players: 'players',
4012
- games: 'games',
4013
- statistic: 'statistic',
4014
- polls: 'polls',
4015
- events: 'events'
4223
+ id: 'id',
4224
+ team: 'team',
4225
+ tournament: 'tournament',
4226
+ team_accept: 'teamAccept',
4227
+ organization_accept: 'organizationAccept',
4228
+ user_invites_count: 'userInvitesCount',
4229
+ user_invites: 'userInvites',
4230
+ notifications_count: 'notificationsCount',
4016
4231
  },
4017
4232
  relation: {
4018
- players: enumField(TeamPermissionTypes),
4019
- games: enumField(TeamPermissionTypes),
4020
- statistic: enumField(TeamPermissionTypes),
4021
- polls: enumField(TeamPermissionTypes),
4022
- events: enumField(TeamPermissionTypes)
4233
+ team: Team,
4234
+ tournament: Tournament,
4235
+ userInvites: TournamentTeamUserInvite,
4023
4236
  }
4024
4237
  })
4025
- ], TeamPermission);
4238
+ ], TournamentInvite);
4239
+
4240
+ var NotificationType;
4241
+ (function (NotificationType) {
4242
+ NotificationType[NotificationType["team_updated"] = 1] = "team_updated";
4243
+ NotificationType[NotificationType["team_invited"] = 2] = "team_invited";
4244
+ NotificationType[NotificationType["team_join_request"] = 3] = "team_join_request";
4245
+ NotificationType[NotificationType["team_join_declined_by_team"] = 4] = "team_join_declined_by_team";
4246
+ NotificationType[NotificationType["team_join_declined_by_user"] = 5] = "team_join_declined_by_user";
4247
+ NotificationType[NotificationType["team_join_canceled_by_team"] = 6] = "team_join_canceled_by_team";
4248
+ NotificationType[NotificationType["team_join_canceled_by_user"] = 7] = "team_join_canceled_by_user";
4249
+ NotificationType[NotificationType["team_joined_for_user"] = 8] = "team_joined_for_user";
4250
+ NotificationType[NotificationType["team_joined_for_team"] = 9] = "team_joined_for_team";
4251
+ NotificationType[NotificationType["team_user_role_changed_for_user"] = 10] = "team_user_role_changed_for_user";
4252
+ NotificationType[NotificationType["team_user_role_changed_for_team"] = 11] = "team_user_role_changed_for_team";
4253
+ NotificationType[NotificationType["team_user_number_changed"] = 12] = "team_user_number_changed";
4254
+ NotificationType[NotificationType["team_user_deleted_for_user"] = 13] = "team_user_deleted_for_user";
4255
+ NotificationType[NotificationType["team_user_deleted_for_team"] = 14] = "team_user_deleted_for_team";
4256
+ NotificationType[NotificationType["team_user_left"] = 15] = "team_user_left";
4257
+ NotificationType[NotificationType["game_updated"] = 16] = "game_updated";
4258
+ NotificationType[NotificationType["game_invited"] = 17] = "game_invited";
4259
+ NotificationType[NotificationType["game_invite_accepted"] = 18] = "game_invite_accepted";
4260
+ NotificationType[NotificationType["game_invite_declined"] = 19] = "game_invite_declined";
4261
+ NotificationType[NotificationType["game_remind"] = 20] = "game_remind";
4262
+ NotificationType[NotificationType["game_won"] = 21] = "game_won";
4263
+ NotificationType[NotificationType["game_losing"] = 22] = "game_losing";
4264
+ NotificationType[NotificationType["game_tech_defeat"] = 23] = "game_tech_defeat";
4265
+ NotificationType[NotificationType["game_tech_victory"] = 24] = "game_tech_victory";
4266
+ NotificationType[NotificationType["poll_created"] = 25] = "poll_created";
4267
+ NotificationType[NotificationType["poll_closed"] = 26] = "poll_closed";
4268
+ NotificationType[NotificationType["team_event_invited"] = 27] = "team_event_invited";
4269
+ NotificationType[NotificationType["team_event_accepted"] = 28] = "team_event_accepted";
4270
+ NotificationType[NotificationType["team_event_declined"] = 29] = "team_event_declined";
4271
+ NotificationType[NotificationType["team_event_remind"] = 30] = "team_event_remind";
4272
+ NotificationType[NotificationType["tournament_invited"] = 31] = "tournament_invited";
4273
+ NotificationType[NotificationType["tournament_joined"] = 32] = "tournament_joined";
4274
+ NotificationType[NotificationType["tournament_join_declined"] = 33] = "tournament_join_declined";
4275
+ NotificationType[NotificationType["tournament_join_canceled"] = 34] = "tournament_join_canceled";
4276
+ NotificationType[NotificationType["tournament_user_invited"] = 35] = "tournament_user_invited";
4277
+ NotificationType[NotificationType["tournament_user_accepted_for_team"] = 36] = "tournament_user_accepted_for_team";
4278
+ NotificationType[NotificationType["tournament_user_accepted_for_user"] = 37] = "tournament_user_accepted_for_user";
4279
+ NotificationType[NotificationType["tournament_user_added"] = 38] = "tournament_user_added";
4280
+ NotificationType[NotificationType["tournament_user_declined_for_team"] = 39] = "tournament_user_declined_for_team";
4281
+ NotificationType[NotificationType["tournament_user_declined_for_user"] = 40] = "tournament_user_declined_for_user";
4282
+ NotificationType[NotificationType["tournament_user_invite_deleted"] = 41] = "tournament_user_invite_deleted";
4283
+ NotificationType[NotificationType["tournament_user_deleted"] = 42] = "tournament_user_deleted";
4284
+ NotificationType[NotificationType["tournament_user_disqualified_for_team"] = 43] = "tournament_user_disqualified_for_team";
4285
+ NotificationType[NotificationType["tournament_user_disqualified_for_user"] = 44] = "tournament_user_disqualified_for_user";
4286
+ NotificationType[NotificationType["tournament_user_disqualification_updated_for_team"] = 45] = "tournament_user_disqualification_updated_for_team";
4287
+ NotificationType[NotificationType["tournament_user_disqualification_updated_for_user"] = 46] = "tournament_user_disqualification_updated_for_user";
4288
+ NotificationType[NotificationType["tournament_team_deleted"] = 47] = "tournament_team_deleted";
4289
+ NotificationType[NotificationType["org_tournament_invite_created"] = 48] = "org_tournament_invite_created";
4290
+ NotificationType[NotificationType["org_tournament_invite_declined"] = 49] = "org_tournament_invite_declined";
4291
+ NotificationType[NotificationType["org_tournament_invite_deleted"] = 50] = "org_tournament_invite_deleted";
4292
+ NotificationType[NotificationType["org_tournament_invite_changed"] = 51] = "org_tournament_invite_changed";
4293
+ NotificationType[NotificationType["org_tournament_user_deleted"] = 52] = "org_tournament_user_deleted";
4294
+ NotificationType[NotificationType["org_tournament_user_invited"] = 53] = "org_tournament_user_invited";
4295
+ NotificationType[NotificationType["org_tournament_user_has_changes"] = 54] = "org_tournament_user_has_changes";
4296
+ NotificationType[NotificationType["org_tournament_team_leave"] = 55] = "org_tournament_team_leave";
4297
+ })(NotificationType || (NotificationType = {}));
4298
+ var NotificationServiceEnum;
4299
+ (function (NotificationServiceEnum) {
4300
+ NotificationServiceEnum[NotificationServiceEnum["public"] = 1] = "public";
4301
+ NotificationServiceEnum[NotificationServiceEnum["org"] = 2] = "org";
4302
+ })(NotificationServiceEnum || (NotificationServiceEnum = {}));
4303
+ let Notification = class Notification extends BaseModel {
4304
+ get important() {
4305
+ return true;
4306
+ }
4307
+ static toFront(value) { }
4308
+ static toBack(value) { }
4309
+ };
4310
+ __decorate([
4311
+ ToFrontHook
4312
+ ], Notification, "toFront", null);
4313
+ __decorate([
4314
+ ToBackHook
4315
+ ], Notification, "toBack", null);
4316
+ Notification = __decorate([
4317
+ ModelInstance({
4318
+ mappingFields: {
4319
+ id: 'id',
4320
+ event_type: 'event',
4321
+ data: 'data',
4322
+ initiator: 'initiator',
4323
+ team: 'team',
4324
+ team_invite: 'teamInvite',
4325
+ team_user: 'teamUser',
4326
+ poll: 'poll',
4327
+ game: 'game',
4328
+ game_invite: 'gameInvite',
4329
+ team_event: 'teamEvent',
4330
+ team_event_invite: 'teamEventInvite',
4331
+ tournament: 'tournament',
4332
+ tournament_invite: 'tournamentInvite',
4333
+ tournament_team: 'tournamentTeam',
4334
+ viewed: 'viewed',
4335
+ protected: 'protected',
4336
+ service: 'service',
4337
+ created_at: 'createdAt',
4338
+ },
4339
+ relation: {
4340
+ event: enumField(NotificationType),
4341
+ initiator: User,
4342
+ team: Team,
4343
+ teamInvite: TeamInvite,
4344
+ teamUser: TeamUser,
4345
+ poll: Poll,
4346
+ game: Game,
4347
+ gameInvite: GameInvite,
4348
+ teamEvent: TeamEvent,
4349
+ teamEventInvite: TeamEventInvite,
4350
+ tournament: Tournament,
4351
+ tournamentInvite: TournamentInvite,
4352
+ tournamentTeam: TournamentTeam,
4353
+ service: enumField(NotificationServiceEnum),
4354
+ createdAt: DateTimeField,
4355
+ }
4356
+ })
4357
+ ], Notification);
4026
4358
 
4027
- let TeamAccess = class TeamAccess extends BaseModel {
4359
+ var NotificationAllowTypes;
4360
+ (function (NotificationAllowTypes) {
4361
+ NotificationAllowTypes[NotificationAllowTypes["all"] = 1] = "all";
4362
+ NotificationAllowTypes[NotificationAllowTypes["important"] = 2] = "important";
4363
+ NotificationAllowTypes[NotificationAllowTypes["none"] = 3] = "none";
4364
+ })(NotificationAllowTypes || (NotificationAllowTypes = {}));
4365
+ let NotificationSettings = class NotificationSettings extends BaseModel {
4028
4366
  static toFront(data) { }
4029
4367
  static toBack(data) { }
4030
4368
  };
4031
4369
  __decorate([
4032
4370
  ToFrontHook
4033
- ], TeamAccess, "toFront", null);
4371
+ ], NotificationSettings, "toFront", null);
4034
4372
  __decorate([
4035
4373
  ToBackHook
4036
- ], TeamAccess, "toBack", null);
4037
- TeamAccess = __decorate([
4374
+ ], NotificationSettings, "toBack", null);
4375
+ NotificationSettings = __decorate([
4038
4376
  ModelInstance({
4039
4377
  mappingFields: {
4040
- can_edit: 'canEdit',
4041
- can_view_users: 'canViewUsers',
4042
- can_manage_permission: 'canManagePermission',
4043
- can_change_owner: 'canChangeOwner',
4044
- can_delete: 'canDelete',
4045
- can_manage_invites: 'canManageInvites',
4046
- can_view_invites: 'canViewInvites',
4047
- can_manage_polls: 'canManagePolls',
4048
- can_view_polls: 'canViewPolls',
4049
- can_answer_poll: 'canAnswerPoll',
4050
- can_manage_games: 'canManageGames',
4051
- can_view_games: 'canViewGames',
4052
- can_view_statistic: 'canViewStatistic',
4053
- can_promote_users: 'canPromoteUsers',
4054
- can_edit_users: 'canEditUsers',
4055
- can_delete_users: 'canDeleteUsers',
4056
- can_view_events: 'canViewEvents',
4057
- can_manage_events: 'canManageEvents',
4058
- can_view_tournaments: 'canViewTournaments',
4059
- can_manage_tournaments: 'canManageTournaments',
4060
- role: 'role'
4378
+ user_id: 'userId',
4379
+ popup: 'popup',
4380
+ sound: 'sound',
4381
+ browser: 'browser',
4382
+ email: 'email'
4061
4383
  },
4062
4384
  relation: {
4063
- role: enumField(TeamUserRole)
4385
+ sound: enumField(NotificationAllowTypes),
4386
+ browser: enumField(NotificationAllowTypes),
4064
4387
  }
4065
4388
  })
4066
- ], TeamAccess);
4389
+ ], NotificationSettings);
4067
4390
 
4068
- let TeamApi = class TeamApi {
4069
- constructor(httpClient, configService) {
4070
- this.httpClient = httpClient;
4071
- this.configService = configService;
4072
- }
4073
- search(query, sportId) {
4074
- return __awaiter(this, void 0, void 0, function* () {
4075
- let params = (new HttpParams()).set('search', query);
4076
- if (sportId) {
4077
- params = params.set('sport', sportId.toString());
4078
- }
4079
- return this.httpClient
4080
- .get(`${this.configService.get('apiUrl')}/api/v1/team/`, { params })
4081
- .pipe(map(data => Team.toFront(data)))
4082
- .toPromise();
4083
- });
4084
- }
4085
- create(team) {
4086
- return __awaiter(this, void 0, void 0, function* () {
4087
- return this.httpClient
4088
- .post(`${this.configService.get('apiUrl')}/api/v1/team/`, Team.toBack(team))
4089
- .pipe(map(data => Team.toFront(data)))
4090
- .toPromise();
4091
- });
4092
- }
4093
- getById(teamId) {
4094
- return __awaiter(this, void 0, void 0, function* () {
4095
- return this.httpClient
4096
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/`)
4097
- .pipe(map(data => Team.toFront(data)))
4098
- .toPromise();
4099
- });
4100
- }
4101
- getTeamAccess(teamId) {
4102
- return __awaiter(this, void 0, void 0, function* () {
4103
- return this.httpClient
4104
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/access/`)
4105
- .pipe(map(data => TeamAccess.toFront(data)))
4106
- .toPromise();
4107
- });
4108
- }
4109
- update(teamId, values) {
4110
- return __awaiter(this, void 0, void 0, function* () {
4111
- return this.httpClient
4112
- .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/`, Team.toBack(values))
4113
- .pipe(map(data => Team.toFront(data)))
4114
- .toPromise();
4115
- });
4116
- }
4117
- delete(team) {
4118
- return __awaiter(this, void 0, void 0, function* () {
4119
- return this.httpClient
4120
- .delete(`${this.configService.get('apiUrl')}/api/v1/team/${team.id}/`)
4121
- .toPromise();
4122
- });
4123
- }
4124
- getPermission(teamId) {
4125
- return __awaiter(this, void 0, void 0, function* () {
4126
- return this.httpClient
4127
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/permission/`)
4128
- .pipe(map(data => TeamPermission.toFront(data)))
4129
- .toPromise();
4130
- });
4131
- }
4132
- updatePermission(teamId, permission) {
4133
- return __awaiter(this, void 0, void 0, function* () {
4134
- return this.httpClient
4135
- .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/permission/`, TeamPermission.toBack(permission))
4136
- .pipe(map(data => TeamPermission.toFront(data)))
4137
- .toPromise();
4138
- });
4139
- }
4140
- getUsers(teamId, tournamentId) {
4141
- return __awaiter(this, void 0, void 0, function* () {
4142
- let params = new HttpParams();
4143
- if (tournamentId) {
4144
- params = params.set('tournament_id', tournamentId.toString());
4145
- }
4146
- return this.httpClient
4147
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/users/`, { params })
4148
- .pipe(map(data => TeamUser.toFront(data)))
4149
- .toPromise();
4150
- });
4151
- }
4152
- updateUserRole(teamId, teamUserId, role) {
4153
- return __awaiter(this, void 0, void 0, function* () {
4154
- return this.httpClient
4155
- .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/users/${teamUserId}/role/`, { role: TeamUserRole[role] })
4156
- .pipe(map(data => TeamUser.toFront(data)))
4157
- .toPromise();
4158
- });
4159
- }
4160
- updateUserNumber(teamId, teamUserId, gameNumber) {
4161
- return __awaiter(this, void 0, void 0, function* () {
4162
- return this.httpClient
4163
- .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/users/${teamUserId}/number/`, { number: gameNumber.toString() })
4164
- .pipe(map(data => TeamUser.toFront(data)))
4165
- .toPromise();
4166
- });
4167
- }
4168
- deleteUser(teamUser) {
4169
- return __awaiter(this, void 0, void 0, function* () {
4170
- return this.httpClient
4171
- .delete(`${this.configService.get('apiUrl')}/api/v1/team/${teamUser.teamId}/users/${teamUser.id}/`)
4172
- .toPromise();
4173
- });
4174
- }
4175
- changeOwner(teamId, user) {
4176
- return __awaiter(this, void 0, void 0, function* () {
4177
- return this.httpClient
4178
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/owner/`, { id: user.id })
4179
- .pipe(map(data => Team.toFront(data)))
4180
- .toPromise();
4181
- });
4182
- }
4183
- getInvites(teamId) {
4184
- return __awaiter(this, void 0, void 0, function* () {
4185
- return this.httpClient
4186
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites/`)
4187
- .pipe(map(data => TeamInvite.toFront(data)))
4188
- .toPromise();
4189
- });
4190
- }
4191
- sendInvite(teamId, user) {
4192
- return __awaiter(this, void 0, void 0, function* () {
4193
- return this.httpClient
4194
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites/`, { user })
4195
- .pipe(map(data => TeamInvite.toFront(data)))
4196
- .toPromise();
4197
- });
4198
- }
4199
- acceptInvite(invite) {
4200
- return __awaiter(this, void 0, void 0, function* () {
4201
- return this.httpClient
4202
- .post(`${this.configService.get('apiUrl')}/api/v1/team_invite/${invite.id}/accept/`, {})
4203
- .pipe(map(data => TeamInvite.toFront(data)))
4204
- .toPromise();
4205
- });
4206
- }
4207
- declineInvite(invite) {
4208
- return __awaiter(this, void 0, void 0, function* () {
4209
- return this.httpClient
4210
- .post(`${this.configService.get('apiUrl')}/api/v1/team_invite/${invite.id}/decline/`, {})
4211
- .pipe(map(data => TeamInvite.toFront(data)))
4212
- .toPromise();
4213
- });
4214
- }
4215
- resendInvite(invite) {
4216
- return __awaiter(this, void 0, void 0, function* () {
4217
- return this.httpClient
4218
- .post(`${this.configService.get('apiUrl')}/api/v1/team_invite/${invite.id}/resend/`, {})
4219
- .pipe(map(data => TeamInvite.toFront(data)))
4220
- .toPromise();
4221
- });
4222
- }
4223
- getInvitesExternal(teamId) {
4224
- return __awaiter(this, void 0, void 0, function* () {
4225
- return this.httpClient
4226
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites_external/`)
4227
- .pipe(map(data => TeamInviteExternal.toFront(data)))
4228
- .toPromise();
4229
- });
4230
- }
4231
- sendInviteExternal(teamId, invite) {
4232
- return __awaiter(this, void 0, void 0, function* () {
4233
- return this.httpClient
4234
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites_external/`, TeamInviteExternal.toBack(invite))
4235
- .pipe(map(data => TeamInviteExternal.toFront(data)))
4236
- .toPromise();
4237
- });
4238
- }
4239
- deleteInviteExternal(invite) {
4240
- return __awaiter(this, void 0, void 0, function* () {
4241
- return this.httpClient
4242
- .delete(`${this.configService.get('apiUrl')}/api/v1/invites_external/${invite.id}/`)
4243
- .toPromise();
4244
- });
4245
- }
4246
- resendInviteExternal(invite) {
4247
- return __awaiter(this, void 0, void 0, function* () {
4248
- return this.httpClient
4249
- .post(`${this.configService.get('apiUrl')}/api/v1/invites_external/${invite.id}/resend/`, {})
4250
- .pipe(map(data => TeamInviteExternal.toFront(data)))
4251
- .toPromise();
4252
- });
4253
- }
4254
- getPolls(teamId, archive = false) {
4255
- return __awaiter(this, void 0, void 0, function* () {
4256
- return this.httpClient
4257
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/polls/${archive ? '?archive=1' : ''}`)
4258
- .pipe(map(data => Poll.toFront(data)))
4259
- .toPromise();
4260
- });
4261
- }
4262
- createPoll(teamId, poll) {
4263
- return __awaiter(this, void 0, void 0, function* () {
4264
- return this.httpClient
4265
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/polls/`, Poll.toBack(poll))
4266
- .pipe(map(data => Poll.toFront(data)))
4267
- .toPromise();
4268
- });
4269
- }
4270
- getUsersStatistic(teamId) {
4271
- return __awaiter(this, void 0, void 0, function* () {
4272
- return this.httpClient
4273
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/statistics/`)
4274
- .pipe(map(data => BasketballStatistic.toFront(data)))
4275
- .toPromise();
4276
- });
4391
+ let NotificationBaseApi = class NotificationBaseApi {
4392
+ constructor(httpClient, configService) {
4393
+ this.httpClient = httpClient;
4394
+ this.configService = configService;
4277
4395
  }
4278
- getVolleyballStatistic(teamId) {
4396
+ getCount() {
4279
4397
  return __awaiter(this, void 0, void 0, function* () {
4280
4398
  return this.httpClient
4281
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/volleyball_statistics/`)
4282
- .pipe(map(data => VolleyballStatistic.toFront(data)))
4399
+ .get(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/count/`)
4400
+ .pipe(map(data => +data))
4283
4401
  .toPromise();
4284
4402
  });
4285
4403
  }
4286
- joinTeam(teamId) {
4404
+ getList(page, size, filters = {}) {
4287
4405
  return __awaiter(this, void 0, void 0, function* () {
4406
+ let params = new HttpParams()
4407
+ .set('page', page.toString())
4408
+ .set('size', size.toString());
4409
+ for (const key of Object.keys(filters)) {
4410
+ params = params.set(key, filters[key]);
4411
+ }
4288
4412
  return this.httpClient
4289
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/join/`, {})
4290
- .pipe(map(data => TeamInvite.toFront(data)))
4291
- .toPromise();
4413
+ .get(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/`, { params, observe: 'response' })
4414
+ .pipe(map(response => {
4415
+ const data = Notification.toFront(response.body);
4416
+ return {
4417
+ total: +response.headers.get('x-page-count'),
4418
+ data
4419
+ };
4420
+ })).toPromise();
4292
4421
  });
4293
4422
  }
4294
- leaveTeam(teamId) {
4423
+ markViewed(notificationId, viewed) {
4295
4424
  return __awaiter(this, void 0, void 0, function* () {
4296
4425
  return this.httpClient
4297
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/leave/`, {})
4426
+ .post(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/${notificationId}/viewed/`, { viewed })
4427
+ .pipe(map(data => Notification.toFront(data)))
4298
4428
  .toPromise();
4299
4429
  });
4300
4430
  }
4301
- getGames(teamId, archive = false) {
4431
+ markAllViewed() {
4302
4432
  return __awaiter(this, void 0, void 0, function* () {
4303
4433
  return this.httpClient
4304
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/games/${archive ? '?archive=1' : ''}`)
4305
- .pipe(map(data => Game.toFront(data)))
4434
+ .post(`${this.configService.get('apiUrl')}${this.apiUrl}/notification/viewed/`, {})
4435
+ .pipe(map(data => Notification.toFront(data)))
4306
4436
  .toPromise();
4307
4437
  });
4308
4438
  }
4309
- createGame(teamId, game) {
4439
+ getNotificationSettings() {
4310
4440
  return __awaiter(this, void 0, void 0, function* () {
4311
- return this.httpClient
4312
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/games/`, Game.toBack(game))
4313
- .pipe(map(data => Game.toFront(data)))
4441
+ return this.httpClient.get(`${this.configService.get('apiUrl')}${this.apiUrl}/notification_settings/`)
4442
+ .pipe(map(data => NotificationSettings.toFront(data)))
4314
4443
  .toPromise();
4315
4444
  });
4316
4445
  }
4317
- getTeamEvents(teamId) {
4446
+ updateNotificationSettings(data) {
4318
4447
  return __awaiter(this, void 0, void 0, function* () {
4319
- return this.httpClient
4320
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/events/`)
4321
- .pipe(map(data => TeamEvent.toFront(data)))
4448
+ return this.httpClient.post(`${this.configService.get('apiUrl')}${this.apiUrl}/notification_settings/`, NotificationSettings.toBack(data))
4449
+ .pipe(map(result => NotificationSettings.toFront(result)))
4322
4450
  .toPromise();
4323
4451
  });
4324
4452
  }
4325
- createTeamEvent(teamId, teamEvent) {
4326
- return __awaiter(this, void 0, void 0, function* () {
4327
- return this.httpClient
4328
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/events/`, TeamEvent.toBack(teamEvent))
4329
- .pipe(map(data => TeamEvent.toFront(data)))
4330
- .toPromise();
4331
- });
4453
+ };
4454
+ NotificationBaseApi.ctorParameters = () => [
4455
+ { type: HttpClient },
4456
+ { type: ConfigService }
4457
+ ];
4458
+ NotificationBaseApi.ɵprov = ɵɵdefineInjectable({ factory: function NotificationBaseApi_Factory() { return new NotificationBaseApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: NotificationBaseApi, providedIn: "root" });
4459
+ NotificationBaseApi = __decorate([
4460
+ Injectable({ providedIn: 'root' })
4461
+ ], NotificationBaseApi);
4462
+
4463
+ let NotificationApi = class NotificationApi extends NotificationBaseApi {
4464
+ constructor() {
4465
+ super(...arguments);
4466
+ this.apiUrl = '/api/v1';
4332
4467
  }
4333
- getTournaments(teamId) {
4468
+ };
4469
+ NotificationApi.ɵprov = ɵɵdefineInjectable({ factory: function NotificationApi_Factory() { return new NotificationApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: NotificationApi, providedIn: "root" });
4470
+ NotificationApi = __decorate([
4471
+ Injectable({ providedIn: 'root' })
4472
+ ], NotificationApi);
4473
+
4474
+ let OrgNotificationApi = class OrgNotificationApi extends NotificationBaseApi {
4475
+ constructor() {
4476
+ super(...arguments);
4477
+ this.apiUrl = '/org/api/v1';
4478
+ }
4479
+ };
4480
+ OrgNotificationApi.ɵprov = ɵɵdefineInjectable({ factory: function OrgNotificationApi_Factory() { return new OrgNotificationApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: OrgNotificationApi, providedIn: "root" });
4481
+ OrgNotificationApi = __decorate([
4482
+ Injectable({ providedIn: 'root' })
4483
+ ], OrgNotificationApi);
4484
+
4485
+ let ReferenceApi = class ReferenceApi {
4486
+ constructor(httpClient, configService) {
4487
+ this.httpClient = httpClient;
4488
+ this.configService = configService;
4489
+ }
4490
+ getCities() {
4334
4491
  return __awaiter(this, void 0, void 0, function* () {
4335
4492
  return this.httpClient
4336
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournaments/`)
4337
- .pipe(map(data => Tournament.toFront(data)))
4338
- .toPromise();
4493
+ .get(`${this.configService.get('apiUrl')}/api/v1/reference/cities/`)
4494
+ .pipe(map(data => City.toFront(data))).toPromise();
4339
4495
  });
4340
4496
  }
4341
- getTournamentTeams(teamId) {
4497
+ getSports() {
4342
4498
  return __awaiter(this, void 0, void 0, function* () {
4343
4499
  return this.httpClient
4344
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournament_teams/`)
4345
- .pipe(map(data => TournamentTeam.toFront(data)))
4346
- .toPromise();
4500
+ .get(`${this.configService.get('apiUrl')}/api/v1/sport/`)
4501
+ .pipe(map(data => Sport.toFront(data))).toPromise();
4347
4502
  });
4348
4503
  }
4349
- getTournamentInvites(teamId) {
4504
+ };
4505
+ ReferenceApi.ctorParameters = () => [
4506
+ { type: HttpClient },
4507
+ { type: ConfigService }
4508
+ ];
4509
+ ReferenceApi.ɵprov = ɵɵdefineInjectable({ factory: function ReferenceApi_Factory() { return new ReferenceApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: ReferenceApi, providedIn: "root" });
4510
+ ReferenceApi = __decorate([
4511
+ Injectable({ providedIn: 'root' })
4512
+ ], ReferenceApi);
4513
+
4514
+ let TeamInviteExternal = class TeamInviteExternal extends BaseModel {
4515
+ static toFront(data) { }
4516
+ static toBack(data) { }
4517
+ };
4518
+ __decorate([
4519
+ ToFrontHook
4520
+ ], TeamInviteExternal, "toFront", null);
4521
+ __decorate([
4522
+ ToBackHook
4523
+ ], TeamInviteExternal, "toBack", null);
4524
+ TeamInviteExternal = __decorate([
4525
+ ModelInstance({
4526
+ mappingFields: {
4527
+ id: 'id',
4528
+ team_id: 'teamId',
4529
+ email: 'email',
4530
+ first_name: 'firstName',
4531
+ last_name: 'lastName',
4532
+ },
4533
+ })
4534
+ ], TeamInviteExternal);
4535
+
4536
+ var TeamPermissionTypes;
4537
+ (function (TeamPermissionTypes) {
4538
+ TeamPermissionTypes[TeamPermissionTypes["for_all"] = 1] = "for_all";
4539
+ TeamPermissionTypes[TeamPermissionTypes["for_users"] = 2] = "for_users";
4540
+ TeamPermissionTypes[TeamPermissionTypes["for_team"] = 3] = "for_team";
4541
+ })(TeamPermissionTypes || (TeamPermissionTypes = {}));
4542
+ let TeamPermission = class TeamPermission extends BaseModel {
4543
+ static toFront(data) { }
4544
+ static toBack(data) { }
4545
+ };
4546
+ __decorate([
4547
+ ToFrontHook
4548
+ ], TeamPermission, "toFront", null);
4549
+ __decorate([
4550
+ ToBackHook
4551
+ ], TeamPermission, "toBack", null);
4552
+ TeamPermission = __decorate([
4553
+ ModelInstance({
4554
+ mappingFields: {
4555
+ players: 'players',
4556
+ games: 'games',
4557
+ statistic: 'statistic',
4558
+ polls: 'polls',
4559
+ events: 'events'
4560
+ },
4561
+ relation: {
4562
+ players: enumField(TeamPermissionTypes),
4563
+ games: enumField(TeamPermissionTypes),
4564
+ statistic: enumField(TeamPermissionTypes),
4565
+ polls: enumField(TeamPermissionTypes),
4566
+ events: enumField(TeamPermissionTypes)
4567
+ }
4568
+ })
4569
+ ], TeamPermission);
4570
+
4571
+ let TeamAccess = class TeamAccess extends BaseModel {
4572
+ static toFront(data) { }
4573
+ static toBack(data) { }
4574
+ };
4575
+ __decorate([
4576
+ ToFrontHook
4577
+ ], TeamAccess, "toFront", null);
4578
+ __decorate([
4579
+ ToBackHook
4580
+ ], TeamAccess, "toBack", null);
4581
+ TeamAccess = __decorate([
4582
+ ModelInstance({
4583
+ mappingFields: {
4584
+ can_edit: 'canEdit',
4585
+ can_view_users: 'canViewUsers',
4586
+ can_manage_permission: 'canManagePermission',
4587
+ can_change_owner: 'canChangeOwner',
4588
+ can_delete: 'canDelete',
4589
+ can_manage_invites: 'canManageInvites',
4590
+ can_view_invites: 'canViewInvites',
4591
+ can_manage_polls: 'canManagePolls',
4592
+ can_view_polls: 'canViewPolls',
4593
+ can_answer_poll: 'canAnswerPoll',
4594
+ can_manage_games: 'canManageGames',
4595
+ can_view_games: 'canViewGames',
4596
+ can_view_statistic: 'canViewStatistic',
4597
+ can_promote_users: 'canPromoteUsers',
4598
+ can_edit_users: 'canEditUsers',
4599
+ can_delete_users: 'canDeleteUsers',
4600
+ can_view_events: 'canViewEvents',
4601
+ can_manage_events: 'canManageEvents',
4602
+ can_view_tournaments: 'canViewTournaments',
4603
+ can_manage_tournaments: 'canManageTournaments',
4604
+ role: 'role'
4605
+ },
4606
+ relation: {
4607
+ role: enumField(TeamUserRole)
4608
+ }
4609
+ })
4610
+ ], TeamAccess);
4611
+
4612
+ let TeamApi = class TeamApi {
4613
+ constructor(httpClient, configService) {
4614
+ this.httpClient = httpClient;
4615
+ this.configService = configService;
4616
+ }
4617
+ search(query, sportId) {
4350
4618
  return __awaiter(this, void 0, void 0, function* () {
4619
+ let params = (new HttpParams()).set('search', query);
4620
+ if (sportId) {
4621
+ params = params.set('sport', sportId.toString());
4622
+ }
4351
4623
  return this.httpClient
4352
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournament_invites/`)
4353
- .pipe(map(data => TournamentInvite.toFront(data)))
4624
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/`, { params })
4625
+ .pipe(map(data => Team.toFront(data)))
4354
4626
  .toPromise();
4355
4627
  });
4356
4628
  }
4357
- getTournamentGames(teamId, tournamentId, page, size) {
4629
+ create(team) {
4358
4630
  return __awaiter(this, void 0, void 0, function* () {
4359
- let params = new HttpParams().set('page', page.toString());
4360
- if (size) {
4361
- params = params.set('size', size.toString());
4362
- }
4363
4631
  return this.httpClient
4364
- .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournaments/${tournamentId}/games/`, { params, observe: 'response' })
4365
- .pipe(map((response) => {
4366
- return {
4367
- total: +response.headers.get('X-Page-Count'),
4368
- data: Game.toFront(response.body)
4369
- };
4370
- }))
4632
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/`, Team.toBack(team))
4633
+ .pipe(map(data => Team.toFront(data)))
4371
4634
  .toPromise();
4372
4635
  });
4373
4636
  }
4374
- acceptTournamentInvite(inviteId) {
4637
+ getById(teamId) {
4375
4638
  return __awaiter(this, void 0, void 0, function* () {
4376
4639
  return this.httpClient
4377
- .post(`${this.configService.get('apiUrl')}/api/v1/tournament_invite/${inviteId}/accept/`, {})
4378
- .pipe(map(data => TournamentInvite.toFront(data)))
4640
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/`)
4641
+ .pipe(map(data => Team.toFront(data)))
4379
4642
  .toPromise();
4380
4643
  });
4381
4644
  }
4382
- declineTournamentInvite(inviteId) {
4645
+ getTeamAccess(teamId) {
4383
4646
  return __awaiter(this, void 0, void 0, function* () {
4384
4647
  return this.httpClient
4385
- .post(`${this.configService.get('apiUrl')}/api/v1/tournament_invite/${inviteId}/decline/`, {})
4386
- .pipe(map(data => TournamentInvite.toFront(data)))
4648
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/access/`)
4649
+ .pipe(map(data => TeamAccess.toFront(data)))
4387
4650
  .toPromise();
4388
4651
  });
4389
4652
  }
4390
- registerLazyUser(teamId, userData) {
4653
+ update(teamId, values) {
4391
4654
  return __awaiter(this, void 0, void 0, function* () {
4392
4655
  return this.httpClient
4393
- .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/lazy_user/`, { user: User.toBack(userData) })
4394
- .pipe(map(data => TeamUser.toFront(data)))
4656
+ .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/`, Team.toBack(values))
4657
+ .pipe(map(data => Team.toFront(data)))
4395
4658
  .toPromise();
4396
4659
  });
4397
4660
  }
4398
- getLazyUser(teamUserId) {
4661
+ delete(team) {
4399
4662
  return __awaiter(this, void 0, void 0, function* () {
4400
4663
  return this.httpClient
4401
- .get(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/`)
4402
- .pipe(map(data => TeamUser.toFront(data)))
4664
+ .delete(`${this.configService.get('apiUrl')}/api/v1/team/${team.id}/`)
4403
4665
  .toPromise();
4404
4666
  });
4405
4667
  }
4406
- updateLazyUser(teamUserId, userData) {
4668
+ getPermission(teamId) {
4407
4669
  return __awaiter(this, void 0, void 0, function* () {
4408
4670
  return this.httpClient
4409
- .patch(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/`, { user: User.toBack(userData) })
4410
- .pipe(map(data => TeamUser.toFront(data)))
4671
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/permission/`)
4672
+ .pipe(map(data => TeamPermission.toFront(data)))
4411
4673
  .toPromise();
4412
4674
  });
4413
4675
  }
4414
- deleteLazyUser(teamUserId) {
4676
+ updatePermission(teamId, permission) {
4415
4677
  return __awaiter(this, void 0, void 0, function* () {
4416
4678
  return this.httpClient
4417
- .delete(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/`)
4679
+ .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/permission/`, TeamPermission.toBack(permission))
4680
+ .pipe(map(data => TeamPermission.toFront(data)))
4418
4681
  .toPromise();
4419
4682
  });
4420
4683
  }
4421
- resendLazyUserEmail(teamUserId) {
4684
+ getUsers(teamId, tournamentId) {
4422
4685
  return __awaiter(this, void 0, void 0, function* () {
4686
+ let params = new HttpParams();
4687
+ if (tournamentId) {
4688
+ params = params.set('tournament_id', tournamentId.toString());
4689
+ }
4423
4690
  return this.httpClient
4424
- .post(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/resend_email/`, {})
4691
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/users/`, { params })
4692
+ .pipe(map(data => TeamUser.toFront(data)))
4425
4693
  .toPromise();
4426
4694
  });
4427
4695
  }
4428
- };
4429
- TeamApi.ctorParameters = () => [
4430
- { type: HttpClient },
4431
- { type: ConfigService }
4432
- ];
4433
- TeamApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamApi_Factory() { return new TeamApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamApi, providedIn: "root" });
4434
- TeamApi = __decorate([
4435
- Injectable({ providedIn: 'root' })
4436
- ], TeamApi);
4437
-
4438
- let TeamEventApi = class TeamEventApi {
4439
- constructor(httpClient, configService) {
4440
- this.httpClient = httpClient;
4441
- this.configService = configService;
4442
- }
4443
- getTeamEvent(teamEventId) {
4696
+ updateUserRole(teamId, teamUserId, role) {
4444
4697
  return __awaiter(this, void 0, void 0, function* () {
4445
4698
  return this.httpClient
4446
- .get(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/`)
4447
- .pipe(map(data => TeamEvent.toFront(data)))
4699
+ .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/users/${teamUserId}/role/`, { role: TeamUserRole[role] })
4700
+ .pipe(map(data => TeamUser.toFront(data)))
4448
4701
  .toPromise();
4449
4702
  });
4450
4703
  }
4451
- updateTeamEvent(teamEvent) {
4704
+ updateUserNumber(teamId, teamUserId, gameNumber) {
4452
4705
  return __awaiter(this, void 0, void 0, function* () {
4453
4706
  return this.httpClient
4454
- .patch(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEvent.id}/`, TeamEvent.toBack(teamEvent))
4455
- .pipe(map(data => TeamEvent.toFront(data)))
4707
+ .patch(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/users/${teamUserId}/number/`, { number: gameNumber.toString() })
4708
+ .pipe(map(data => TeamUser.toFront(data)))
4456
4709
  .toPromise();
4457
4710
  });
4458
4711
  }
4459
- deleteTeamEvent(teamEventId) {
4712
+ deleteUser(teamUser) {
4460
4713
  return __awaiter(this, void 0, void 0, function* () {
4461
4714
  return this.httpClient
4462
- .delete(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/`)
4715
+ .delete(`${this.configService.get('apiUrl')}/api/v1/team/${teamUser.teamId}/users/${teamUser.id}/`)
4463
4716
  .toPromise();
4464
4717
  });
4465
4718
  }
4466
- getTeamEventInvites(teamEventId) {
4719
+ changeOwner(teamId, user) {
4467
4720
  return __awaiter(this, void 0, void 0, function* () {
4468
4721
  return this.httpClient
4469
- .get(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/invites/`)
4470
- .pipe(map(data => TeamEventInvite.toFront(data)))
4722
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/owner/`, { id: user.id })
4723
+ .pipe(map(data => Team.toFront(data)))
4471
4724
  .toPromise();
4472
4725
  });
4473
4726
  }
4474
- createTeamEventInvite(teamEventId, teamUserId) {
4727
+ getInvites(teamId) {
4475
4728
  return __awaiter(this, void 0, void 0, function* () {
4476
4729
  return this.httpClient
4477
- .post(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/invites/`, { team_user_id: teamUserId })
4478
- .pipe(map(data => TeamEventInvite.toFront(data)))
4730
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites/`)
4731
+ .pipe(map(data => TeamInvite.toFront(data)))
4479
4732
  .toPromise();
4480
4733
  });
4481
4734
  }
4482
- acceptTeamEventInvite(teamEventInvite) {
4735
+ sendInvite(teamId, user) {
4483
4736
  return __awaiter(this, void 0, void 0, function* () {
4484
4737
  return this.httpClient
4485
- .post(`${this.configService.get('apiUrl')}/api/v1/team_event_invite/${teamEventInvite.id}/accept/`, {})
4486
- .pipe(map(data => TeamEventInvite.toFront(data)))
4738
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites/`, { user })
4739
+ .pipe(map(data => TeamInvite.toFront(data)))
4487
4740
  .toPromise();
4488
4741
  });
4489
4742
  }
4490
- declineTeamEventInvite(teamEventInvite) {
4743
+ acceptInvite(invite) {
4491
4744
  return __awaiter(this, void 0, void 0, function* () {
4492
4745
  return this.httpClient
4493
- .post(`${this.configService.get('apiUrl')}/api/v1/team_event_invite/${teamEventInvite.id}/decline/`, {})
4494
- .pipe(map(data => TeamEventInvite.toFront(data)))
4746
+ .post(`${this.configService.get('apiUrl')}/api/v1/team_invite/${invite.id}/accept/`, {})
4747
+ .pipe(map(data => TeamInvite.toFront(data)))
4495
4748
  .toPromise();
4496
4749
  });
4497
4750
  }
4498
- };
4499
- TeamEventApi.ctorParameters = () => [
4500
- { type: HttpClient },
4501
- { type: ConfigService }
4502
- ];
4503
- TeamEventApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamEventApi_Factory() { return new TeamEventApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamEventApi, providedIn: "root" });
4504
- TeamEventApi = __decorate([
4505
- Injectable({ providedIn: 'root' })
4506
- ], TeamEventApi);
4507
-
4508
- let TournamentNews = class TournamentNews extends BaseModel {
4509
- static toFront(data) { }
4510
- static toBack(data) { }
4511
- };
4512
- __decorate([
4513
- ToFrontHook
4514
- ], TournamentNews, "toFront", null);
4515
- __decorate([
4516
- ToBackHook
4517
- ], TournamentNews, "toBack", null);
4518
- TournamentNews = __decorate([
4519
- ModelInstance({
4520
- mappingFields: {
4521
- id: 'id',
4522
- title: 'title',
4523
- picture: 'picture',
4524
- text: 'text',
4525
- author: 'author',
4526
- created_at: 'createdAt',
4527
- },
4528
- relation: {
4529
- picture: File,
4530
- author: User,
4531
- createdAt: DateTimeField,
4532
- }
4533
- })
4534
- ], TournamentNews);
4535
-
4536
- let GameTimelineStageItem = class GameTimelineStageItem {
4537
- static toFront(data) { }
4538
- static toBack(data) { }
4539
- };
4540
- __decorate([
4541
- ToFrontHook
4542
- ], GameTimelineStageItem, "toFront", null);
4543
- __decorate([
4544
- ToBackHook
4545
- ], GameTimelineStageItem, "toBack", null);
4546
- GameTimelineStageItem = __decorate([
4547
- ModelInstance({
4548
- mappingFields: {
4549
- stage_id: 'stageId',
4550
- tours_count: 'toursCount',
4551
- playoff_stages_count: 'playoffStagesCount',
4552
- }
4553
- })
4554
- ], GameTimelineStageItem);
4555
- let GameTimelineStages = class GameTimelineStages extends BaseModel {
4556
- static toFront(data) { }
4557
- static toBack(data) { }
4558
- };
4559
- __decorate([
4560
- ToFrontHook
4561
- ], GameTimelineStages, "toFront", null);
4562
- __decorate([
4563
- ToBackHook
4564
- ], GameTimelineStages, "toBack", null);
4565
- GameTimelineStages = __decorate([
4566
- ModelInstance({
4567
- mappingFields: {
4568
- tours_count: 'toursCount',
4569
- playoff_stages_count: 'playoffStagesCount',
4570
- current_tour: 'currentTour',
4571
- current_playoff_stage: 'currentPlayoffStage',
4572
- stages: 'stages',
4573
- tournament_stage_id: 'tournamentStageId',
4574
- },
4575
- relation: {
4576
- stages: listField(GameTimelineStageItem)
4577
- }
4578
- })
4579
- ], GameTimelineStages);
4580
-
4581
- var TournamentStageStatuses;
4582
- (function (TournamentStageStatuses) {
4583
- TournamentStageStatuses[TournamentStageStatuses["open"] = 0] = "open";
4584
- TournamentStageStatuses[TournamentStageStatuses["in_progress"] = 1] = "in_progress";
4585
- TournamentStageStatuses[TournamentStageStatuses["closed"] = 2] = "closed";
4586
- })(TournamentStageStatuses || (TournamentStageStatuses = {}));
4587
- let TournamentStage = class TournamentStage extends BaseModel {
4588
- static toFront(data) { }
4589
- static toBack(data) { }
4590
- };
4591
- __decorate([
4592
- ToFrontHook
4593
- ], TournamentStage, "toFront", null);
4594
- __decorate([
4595
- ToBackHook
4596
- ], TournamentStage, "toBack", null);
4597
- TournamentStage = __decorate([
4598
- ModelInstance({
4599
- mappingFields: {
4600
- id: 'id',
4601
- name: 'name',
4602
- date: 'date',
4603
- tournament_id: 'tournamentId',
4604
- status: 'status',
4605
- },
4606
- relation: {
4607
- date: DateField,
4608
- status: enumField(TournamentStageStatuses)
4609
- }
4610
- })
4611
- ], TournamentStage);
4612
-
4613
- function generateArray(length) {
4614
- if (length <= 0) {
4615
- return [];
4616
- }
4617
- return Array.apply(null, Array(length)).map((_, i) => i + 1);
4618
- }
4619
- function getArrayChunks(array, length) {
4620
- const chunks = [];
4621
- const chunkLength = Math.ceil(array.length / length);
4622
- if (chunkLength === 0) {
4623
- return [array];
4624
- }
4625
- for (let i = 0; i < chunkLength; i++) {
4626
- chunks.push(array.slice(i * length, (i + 1) * length));
4627
- }
4628
- return chunks;
4629
- }
4630
-
4631
- var PlayoffTypes;
4632
- (function (PlayoffTypes) {
4633
- PlayoffTypes["double_elimination"] = "double_elimination";
4634
- PlayoffTypes["elimination"] = "elimination";
4635
- })(PlayoffTypes || (PlayoffTypes = {}));
4636
- let PlayoffSettings = class PlayoffSettings extends BaseModel {
4637
- static toFront(data) { }
4638
- static toBack(data) { }
4639
- };
4640
- __decorate([
4641
- ToFrontHook
4642
- ], PlayoffSettings, "toFront", null);
4643
- __decorate([
4644
- ToBackHook
4645
- ], PlayoffSettings, "toBack", null);
4646
- PlayoffSettings = __decorate([
4647
- ModelInstance({
4648
- mappingFields: {
4649
- rounds: 'rounds',
4650
- final_rounds: 'finalRounds',
4651
- third_place_rounds: 'thirdPlaceRounds',
4652
- teams_count: 'teamsCount',
4653
- type: 'type',
4654
- },
4655
- relation: {
4656
- type: enumField(PlayoffTypes)
4657
- }
4658
- })
4659
- ], PlayoffSettings);
4660
- let Playoff = class Playoff extends BaseModel {
4661
- constructor() {
4662
- super(...arguments);
4663
- this.stages = [];
4751
+ declineInvite(invite) {
4752
+ return __awaiter(this, void 0, void 0, function* () {
4753
+ return this.httpClient
4754
+ .post(`${this.configService.get('apiUrl')}/api/v1/team_invite/${invite.id}/decline/`, {})
4755
+ .pipe(map(data => TeamInvite.toFront(data)))
4756
+ .toPromise();
4757
+ });
4664
4758
  }
4665
- static toFront(data) { }
4666
- static toBack(data) { }
4667
- get stagesCount() {
4668
- return Math.log(this.settings.teamsCount) / Math.log(2);
4759
+ resendInvite(invite) {
4760
+ return __awaiter(this, void 0, void 0, function* () {
4761
+ return this.httpClient
4762
+ .post(`${this.configService.get('apiUrl')}/api/v1/team_invite/${invite.id}/resend/`, {})
4763
+ .pipe(map(data => TeamInvite.toFront(data)))
4764
+ .toPromise();
4765
+ });
4669
4766
  }
4670
- getPlayoffStages() {
4671
- if (this.stages.length === 0 && this.settings.teamsCount) {
4672
- const stagesCount = Math.log(this.settings.teamsCount) / Math.log(2);
4673
- this.stages = generateArray(stagesCount).map(stage => {
4674
- const playoffStage = this.settings.teamsCount / Math.pow(2, stage);
4675
- let title = '';
4676
- if (playoffStage === 1) {
4677
- title = 'Финал';
4678
- }
4679
- else {
4680
- title = `1 / ${playoffStage}`;
4681
- }
4682
- return {
4683
- value: stage,
4684
- title
4685
- };
4686
- });
4687
- }
4688
- return this.stages;
4767
+ getInvitesExternal(teamId) {
4768
+ return __awaiter(this, void 0, void 0, function* () {
4769
+ return this.httpClient
4770
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites_external/`)
4771
+ .pipe(map(data => TeamInviteExternal.toFront(data)))
4772
+ .toPromise();
4773
+ });
4689
4774
  }
4690
- };
4691
- __decorate([
4692
- ToFrontHook
4693
- ], Playoff, "toFront", null);
4694
- __decorate([
4695
- ToBackHook
4696
- ], Playoff, "toBack", null);
4697
- Playoff = __decorate([
4698
- ModelInstance({
4699
- mappingFields: {
4700
- id: 'id',
4701
- name: 'name',
4702
- settings: 'settings',
4703
- tournament_id: 'tournamentId',
4704
- tournament_stage_id: 'tournamentStageId',
4705
- is_official: 'isOfficial'
4706
- },
4707
- relation: {
4708
- settings: PlayoffSettings
4709
- }
4710
- })
4711
- ], Playoff);
4712
-
4713
- let TournamentStageTeam = class TournamentStageTeam extends BaseModel {
4714
- get gamesWonPercent() {
4715
- if (!this.gamesCount) {
4716
- return 0;
4717
- }
4718
- return Math.floor(1000 * this.wonGamesCount / this.gamesCount) / 10;
4775
+ sendInviteExternal(teamId, invite) {
4776
+ return __awaiter(this, void 0, void 0, function* () {
4777
+ return this.httpClient
4778
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/invites_external/`, TeamInviteExternal.toBack(invite))
4779
+ .pipe(map(data => TeamInviteExternal.toFront(data)))
4780
+ .toPromise();
4781
+ });
4719
4782
  }
4720
- static toFront(data) { }
4721
- static toBack(data) { }
4722
- };
4723
- __decorate([
4724
- ToFrontHook
4725
- ], TournamentStageTeam, "toFront", null);
4726
- __decorate([
4727
- ToBackHook
4728
- ], TournamentStageTeam, "toBack", null);
4729
- TournamentStageTeam = __decorate([
4730
- ModelInstance({
4731
- mappingFields: {
4732
- id: 'id',
4733
- tournament_team: 'tournamentTeam',
4734
- group: 'group',
4735
- tournament_stage_id: 'tournamentStageId',
4736
- games_count: 'gamesCount',
4737
- won_games_count: 'wonGamesCount',
4738
- score_sum: 'scoreSum',
4739
- missed_sum: 'missedSum',
4740
- last_games_count: 'lastGamesCount',
4741
- last_games_won: 'lastGamesWon',
4742
- points: 'points',
4743
- final_standing: 'finalStanding',
4744
- received_points: 'receivedPoints',
4745
- },
4746
- relation: {
4747
- tournamentTeam: TournamentTeam,
4748
- group: TournamentGroup
4749
- }
4750
- })
4751
- ], TournamentStageTeam);
4752
-
4753
- var LeagueUserRoles;
4754
- (function (LeagueUserRoles) {
4755
- LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
4756
- LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
4757
- LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
4758
- })(LeagueUserRoles || (LeagueUserRoles = {}));
4759
- var LeagueUserPermissions;
4760
- (function (LeagueUserPermissions) {
4761
- LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
4762
- LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
4763
- LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
4764
- LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
4765
- LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
4766
- LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
4767
- LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
4768
- LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
4769
- })(LeagueUserPermissions || (LeagueUserPermissions = {}));
4770
- let LeagueUser = class LeagueUser extends BaseModel {
4771
- set role(value) {
4772
- this._role = LeagueUserRoles[value];
4783
+ deleteInviteExternal(invite) {
4784
+ return __awaiter(this, void 0, void 0, function* () {
4785
+ return this.httpClient
4786
+ .delete(`${this.configService.get('apiUrl')}/api/v1/invites_external/${invite.id}/`)
4787
+ .toPromise();
4788
+ });
4773
4789
  }
4774
- get role() {
4775
- return this._role;
4790
+ resendInviteExternal(invite) {
4791
+ return __awaiter(this, void 0, void 0, function* () {
4792
+ return this.httpClient
4793
+ .post(`${this.configService.get('apiUrl')}/api/v1/invites_external/${invite.id}/resend/`, {})
4794
+ .pipe(map(data => TeamInviteExternal.toFront(data)))
4795
+ .toPromise();
4796
+ });
4776
4797
  }
4777
- static toFront(data) { }
4778
- static toBack(data) { }
4779
- };
4780
- __decorate([
4781
- ToFrontHook
4782
- ], LeagueUser, "toFront", null);
4783
- __decorate([
4784
- ToBackHook
4785
- ], LeagueUser, "toBack", null);
4786
- LeagueUser = __decorate([
4787
- ModelInstance({
4788
- mappingFields: {
4789
- id: 'id',
4790
- user: 'user',
4791
- role: 'role',
4792
- permissions: 'permissions'
4793
- },
4794
- relation: {
4795
- user: User,
4796
- permissions: listField(enumField(LeagueUserPermissions))
4797
- }
4798
- })
4799
- ], LeagueUser);
4800
-
4801
- let TournamentApi = class TournamentApi {
4802
- constructor(httpClient, configService) {
4803
- this.httpClient = httpClient;
4804
- this.configService = configService;
4798
+ getPolls(teamId, archive = false) {
4799
+ return __awaiter(this, void 0, void 0, function* () {
4800
+ return this.httpClient
4801
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/polls/${archive ? '?archive=1' : ''}`)
4802
+ .pipe(map(data => Poll.toFront(data)))
4803
+ .toPromise();
4804
+ });
4805
4805
  }
4806
- getById(tournamentId) {
4806
+ createPoll(teamId, poll) {
4807
4807
  return __awaiter(this, void 0, void 0, function* () {
4808
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/`)
4809
- .pipe(map(result => Tournament.toFront(result)))
4808
+ return this.httpClient
4809
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/polls/`, Poll.toBack(poll))
4810
+ .pipe(map(data => Poll.toFront(data)))
4810
4811
  .toPromise();
4811
4812
  });
4812
4813
  }
4813
- getByAlias(leagueId, alias) {
4814
+ getUsersStatistic(teamId) {
4814
4815
  return __awaiter(this, void 0, void 0, function* () {
4815
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/league/${leagueId}/tournaments/${alias}/`)
4816
- .pipe(map(result => Tournament.toFront(result)))
4816
+ return this.httpClient
4817
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/statistics/`)
4818
+ .pipe(map(data => BasketballStatistic.toFront(data)))
4817
4819
  .toPromise();
4818
4820
  });
4819
4821
  }
4820
- getNews(tournamentId) {
4822
+ getVolleyballStatistic(teamId) {
4821
4823
  return __awaiter(this, void 0, void 0, function* () {
4822
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/news/`)
4823
- .pipe(map(result => TournamentNews.toFront(result)))
4824
+ return this.httpClient
4825
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/volleyball_statistics/`)
4826
+ .pipe(map(data => VolleyballStatistic.toFront(data)))
4824
4827
  .toPromise();
4825
4828
  });
4826
4829
  }
4827
- getEvents(tournamentId, page, size, filters) {
4830
+ joinTeam(teamId) {
4828
4831
  return __awaiter(this, void 0, void 0, function* () {
4829
- let params = new HttpParams().set('page', page.toString())
4830
- .set('size', size.toString());
4831
- if (filters) {
4832
- if (filters.event) {
4833
- params = params.set('event', TournamentEventTypes[filters.event]);
4834
- }
4835
- if (filters.search) {
4836
- params = params.set('search', filters.search);
4837
- }
4838
- if (filters.tournamentTour) {
4839
- params = params.set('tournament_tour', filters.tournamentTour.toString());
4840
- }
4841
- }
4842
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/events/`, { params, observe: 'response' })
4843
- .pipe(map(result => ({
4844
- total: +result.headers.get('X-Page-Count'),
4845
- data: TournamentEvent.toFront(result.body)
4846
- })))
4832
+ return this.httpClient
4833
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/join/`, {})
4834
+ .pipe(map(data => TeamInvite.toFront(data)))
4835
+ .toPromise();
4836
+ });
4837
+ }
4838
+ leaveTeam(teamId) {
4839
+ return __awaiter(this, void 0, void 0, function* () {
4840
+ return this.httpClient
4841
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/leave/`, {})
4842
+ .toPromise();
4843
+ });
4844
+ }
4845
+ getGames(teamId, archive = false) {
4846
+ return __awaiter(this, void 0, void 0, function* () {
4847
+ return this.httpClient
4848
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/games/${archive ? '?archive=1' : ''}`)
4849
+ .pipe(map(data => Game.toFront(data)))
4850
+ .toPromise();
4851
+ });
4852
+ }
4853
+ createGame(teamId, game) {
4854
+ return __awaiter(this, void 0, void 0, function* () {
4855
+ return this.httpClient
4856
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/games/`, Game.toBack(game))
4857
+ .pipe(map(data => Game.toFront(data)))
4858
+ .toPromise();
4859
+ });
4860
+ }
4861
+ getTeamEvents(teamId) {
4862
+ return __awaiter(this, void 0, void 0, function* () {
4863
+ return this.httpClient
4864
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/events/`)
4865
+ .pipe(map(data => TeamEvent.toFront(data)))
4847
4866
  .toPromise();
4848
4867
  });
4849
4868
  }
4850
- getTournamentStages(tournamentId) {
4869
+ createTeamEvent(teamId, teamEvent) {
4851
4870
  return __awaiter(this, void 0, void 0, function* () {
4852
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/stages/`).pipe(map(data => TournamentStage.toFront(data))).toPromise();
4871
+ return this.httpClient
4872
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/events/`, TeamEvent.toBack(teamEvent))
4873
+ .pipe(map(data => TeamEvent.toFront(data)))
4874
+ .toPromise();
4853
4875
  });
4854
4876
  }
4855
- getPlayoff(tournamentId) {
4877
+ getTournaments(teamId) {
4856
4878
  return __awaiter(this, void 0, void 0, function* () {
4857
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/playoff/`).pipe(map(result => Playoff.toFront(result))).toPromise();
4879
+ return this.httpClient
4880
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournaments/`)
4881
+ .pipe(map(data => Tournament.toFront(data)))
4882
+ .toPromise();
4858
4883
  });
4859
4884
  }
4860
- getPlayoffGames(playoffId) {
4885
+ getTournamentTeams(teamId) {
4861
4886
  return __awaiter(this, void 0, void 0, function* () {
4862
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_playoff/${playoffId}/games/`).pipe(map(result => Game.toFront(result))).toPromise();
4887
+ return this.httpClient
4888
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournament_teams/`)
4889
+ .pipe(map(data => TournamentTeam.toFront(data)))
4890
+ .toPromise();
4863
4891
  });
4864
4892
  }
4865
- getGamesStages(tournamentId) {
4893
+ getTournamentInvites(teamId) {
4866
4894
  return __awaiter(this, void 0, void 0, function* () {
4867
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/games_stages/`)
4868
- .pipe(map(data => GameTimelineStages.toFront(data)))
4895
+ return this.httpClient
4896
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournament_invites/`)
4897
+ .pipe(map(data => TournamentInvite.toFront(data)))
4869
4898
  .toPromise();
4870
4899
  });
4871
4900
  }
4872
- getGames(tournamentId, page, size, filters = {}) {
4901
+ getTournamentGames(teamId, tournamentId, page, size) {
4873
4902
  return __awaiter(this, void 0, void 0, function* () {
4874
4903
  let params = new HttpParams().set('page', page.toString());
4875
4904
  if (size) {
4876
4905
  params = params.set('size', size.toString());
4877
4906
  }
4878
- if (filters.tournamentStageId) {
4879
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
4880
- }
4881
- if (filters.tournamentTour) {
4882
- params = params.set('tournament_tour', filters.tournamentTour.toString());
4883
- }
4884
- if (filters.playoffStage) {
4885
- params = params.set('playoff_stage', filters.playoffStage.toString());
4886
- }
4887
- if (filters.teamId) {
4888
- params = params.set('team_id', filters.teamId.toString());
4889
- }
4890
- if (filters.status) {
4891
- params = params.set('status', GameStatuses[filters.status]);
4892
- }
4893
- if (filters.statuses) {
4894
- const statuses = filters.statuses.map(i => GameStatuses[i]);
4895
- params = params.set('statuses', statuses.join(','));
4896
- }
4897
- if (filters.tournamentCourtId) {
4898
- params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
4899
- }
4900
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/games/`, { params, observe: 'response' })
4901
- .pipe(map(result => ({
4902
- total: +result.headers.get('X-Page-Count'),
4903
- data: Game.toFront(result.body)
4904
- }))).toPromise();
4907
+ return this.httpClient
4908
+ .get(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/tournaments/${tournamentId}/games/`, { params, observe: 'response' })
4909
+ .pipe(map((response) => {
4910
+ return {
4911
+ total: +response.headers.get('X-Page-Count'),
4912
+ data: Game.toFront(response.body)
4913
+ };
4914
+ }))
4915
+ .toPromise();
4905
4916
  });
4906
4917
  }
4907
- getTeams(tournamentId) {
4918
+ acceptTournamentInvite(inviteId) {
4908
4919
  return __awaiter(this, void 0, void 0, function* () {
4909
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/teams/`)
4910
- .pipe(map(result => TournamentTeam.toFront(result)))
4920
+ return this.httpClient
4921
+ .post(`${this.configService.get('apiUrl')}/api/v1/tournament_invite/${inviteId}/accept/`, {})
4922
+ .pipe(map(data => TournamentInvite.toFront(data)))
4911
4923
  .toPromise();
4912
4924
  });
4913
4925
  }
4914
- getStageTeams(tournamentId) {
4926
+ declineTournamentInvite(inviteId) {
4915
4927
  return __awaiter(this, void 0, void 0, function* () {
4916
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/stage_teams/`)
4917
- .pipe(map(result => TournamentStageTeam.toFront(result)))
4928
+ return this.httpClient
4929
+ .post(`${this.configService.get('apiUrl')}/api/v1/tournament_invite/${inviteId}/decline/`, {})
4930
+ .pipe(map(data => TournamentInvite.toFront(data)))
4918
4931
  .toPromise();
4919
4932
  });
4920
4933
  }
4921
- getTeamById(tournamentTeamId) {
4934
+ registerLazyUser(teamId, userData) {
4922
4935
  return __awaiter(this, void 0, void 0, function* () {
4923
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/`)
4924
- .pipe(map(result => TournamentTeam.toFront(result)))
4936
+ return this.httpClient
4937
+ .post(`${this.configService.get('apiUrl')}/api/v1/team/${teamId}/lazy_user/`, { user: User.toBack(userData) })
4938
+ .pipe(map(data => TeamUser.toFront(data)))
4925
4939
  .toPromise();
4926
4940
  });
4927
4941
  }
4928
- getUserById(userId) {
4942
+ getLazyUser(teamUserId) {
4929
4943
  return __awaiter(this, void 0, void 0, function* () {
4930
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team_user/${userId}/`)
4931
- .pipe(map(result => TournamentTeamUser.toFront(result)))
4944
+ return this.httpClient
4945
+ .get(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/`)
4946
+ .pipe(map(data => TeamUser.toFront(data)))
4932
4947
  .toPromise();
4933
4948
  });
4934
4949
  }
4935
- getUserGames(tournamentUserId) {
4950
+ updateLazyUser(teamUserId, userData) {
4936
4951
  return __awaiter(this, void 0, void 0, function* () {
4937
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team_user/${tournamentUserId}/games/`)
4938
- .pipe(map(result => Game.toFront(result)))
4952
+ return this.httpClient
4953
+ .patch(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/`, { user: User.toBack(userData) })
4954
+ .pipe(map(data => TeamUser.toFront(data)))
4939
4955
  .toPromise();
4940
4956
  });
4941
4957
  }
4942
- getBasketballStatistic(filters) {
4958
+ deleteLazyUser(teamUserId) {
4943
4959
  return __awaiter(this, void 0, void 0, function* () {
4944
- let params = new HttpParams();
4945
- if (filters) {
4946
- for (const key of Object.keys(filters)) {
4947
- if (filters[key]) {
4948
- params = params.set(key, filters[key]);
4949
- }
4950
- }
4951
- if (filters.per_game !== undefined) {
4952
- params = params.set('per_game', filters.per_game ? '1' : '0');
4953
- }
4954
- }
4955
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/basketball_statistic/`, { params }).pipe(map(result => BasketballStatistic.toFront(result))).toPromise();
4960
+ return this.httpClient
4961
+ .delete(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/`)
4962
+ .toPromise();
4956
4963
  });
4957
4964
  }
4958
- getVolleyballStatistic(filters) {
4965
+ resendLazyUserEmail(teamUserId) {
4959
4966
  return __awaiter(this, void 0, void 0, function* () {
4960
- let params = new HttpParams();
4961
- if (filters) {
4962
- for (const key of Object.keys(filters)) {
4963
- if (filters[key]) {
4964
- params = params.set(key, filters[key]);
4965
- }
4966
- }
4967
- if (filters.per_game !== undefined) {
4968
- params = params.set('per_game', filters.per_game ? '1' : '0');
4969
- }
4970
- }
4971
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/volleyball_statistic/`, { params }).pipe(map(result => VolleyballStatistic.toFront(result))).toPromise();
4967
+ return this.httpClient
4968
+ .post(`${this.configService.get('apiUrl')}/api/v1/lazy_user/${teamUserId}/resend_email/`, {})
4969
+ .toPromise();
4972
4970
  });
4973
4971
  }
4974
- getHockeyStatistic(filters) {
4972
+ };
4973
+ TeamApi.ctorParameters = () => [
4974
+ { type: HttpClient },
4975
+ { type: ConfigService }
4976
+ ];
4977
+ TeamApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamApi_Factory() { return new TeamApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamApi, providedIn: "root" });
4978
+ TeamApi = __decorate([
4979
+ Injectable({ providedIn: 'root' })
4980
+ ], TeamApi);
4981
+
4982
+ let TeamEventApi = class TeamEventApi {
4983
+ constructor(httpClient, configService) {
4984
+ this.httpClient = httpClient;
4985
+ this.configService = configService;
4986
+ }
4987
+ getTeamEvent(teamEventId) {
4975
4988
  return __awaiter(this, void 0, void 0, function* () {
4976
- let params = new HttpParams();
4977
- if (filters) {
4978
- for (const key of Object.keys(filters)) {
4979
- if (filters[key]) {
4980
- params = params.set(key, filters[key]);
4981
- }
4982
- }
4983
- if (filters.per_game !== undefined) {
4984
- params = params.set('per_game', filters.per_game ? '1' : '0');
4985
- }
4986
- }
4987
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/hockey_statistic/`, { params }).pipe(map(result => HockeyStatistic.toFront(result))).toPromise();
4989
+ return this.httpClient
4990
+ .get(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/`)
4991
+ .pipe(map(data => TeamEvent.toFront(data)))
4992
+ .toPromise();
4988
4993
  });
4989
4994
  }
4990
- getFootballStatistic(filters) {
4995
+ updateTeamEvent(teamEvent) {
4991
4996
  return __awaiter(this, void 0, void 0, function* () {
4992
- let params = new HttpParams();
4993
- if (filters) {
4994
- for (const key of Object.keys(filters)) {
4995
- if (filters[key]) {
4996
- params = params.set(key, filters[key]);
4997
- }
4998
- }
4999
- if (filters.per_game !== undefined) {
5000
- params = params.set('per_game', filters.per_game ? '1' : '0');
5001
- }
5002
- }
5003
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/football_statistic/`, { params }).pipe(map(result => FootballStatistic.toFront(result))).toPromise();
4997
+ return this.httpClient
4998
+ .patch(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEvent.id}/`, TeamEvent.toBack(teamEvent))
4999
+ .pipe(map(data => TeamEvent.toFront(data)))
5000
+ .toPromise();
5004
5001
  });
5005
5002
  }
5006
- getTournamentTeamUsers(tournamentTeamId) {
5003
+ deleteTeamEvent(teamEventId) {
5007
5004
  return __awaiter(this, void 0, void 0, function* () {
5008
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/users/`).pipe(map(result => TournamentTeamUser.toFront(result))).toPromise();
5005
+ return this.httpClient
5006
+ .delete(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/`)
5007
+ .toPromise();
5009
5008
  });
5010
5009
  }
5011
- myPermission(tournamentId) {
5010
+ getTeamEventInvites(teamEventId) {
5012
5011
  return __awaiter(this, void 0, void 0, function* () {
5013
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament/${tournamentId}/permission/`).pipe(map((data) => (data.permissions || []).map(item => LeagueUserPermissions[item]))).toPromise();
5012
+ return this.httpClient
5013
+ .get(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/invites/`)
5014
+ .pipe(map(data => TeamEventInvite.toFront(data)))
5015
+ .toPromise();
5016
+ });
5017
+ }
5018
+ createTeamEventInvite(teamEventId, teamUserId) {
5019
+ return __awaiter(this, void 0, void 0, function* () {
5020
+ return this.httpClient
5021
+ .post(`${this.configService.get('apiUrl')}/api/v1/team_event/${teamEventId}/invites/`, { team_user_id: teamUserId })
5022
+ .pipe(map(data => TeamEventInvite.toFront(data)))
5023
+ .toPromise();
5024
+ });
5025
+ }
5026
+ acceptTeamEventInvite(teamEventInvite) {
5027
+ return __awaiter(this, void 0, void 0, function* () {
5028
+ return this.httpClient
5029
+ .post(`${this.configService.get('apiUrl')}/api/v1/team_event_invite/${teamEventInvite.id}/accept/`, {})
5030
+ .pipe(map(data => TeamEventInvite.toFront(data)))
5031
+ .toPromise();
5032
+ });
5033
+ }
5034
+ declineTeamEventInvite(teamEventInvite) {
5035
+ return __awaiter(this, void 0, void 0, function* () {
5036
+ return this.httpClient
5037
+ .post(`${this.configService.get('apiUrl')}/api/v1/team_event_invite/${teamEventInvite.id}/decline/`, {})
5038
+ .pipe(map(data => TeamEventInvite.toFront(data)))
5039
+ .toPromise();
5014
5040
  });
5015
5041
  }
5016
5042
  };
5017
- TournamentApi.ctorParameters = () => [
5043
+ TeamEventApi.ctorParameters = () => [
5018
5044
  { type: HttpClient },
5019
5045
  { type: ConfigService }
5020
5046
  ];
5021
- TournamentApi.ɵprov = ɵɵdefineInjectable({ factory: function TournamentApi_Factory() { return new TournamentApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TournamentApi, providedIn: "root" });
5022
- TournamentApi = __decorate([
5047
+ TeamEventApi.ɵprov = ɵɵdefineInjectable({ factory: function TeamEventApi_Factory() { return new TeamEventApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: TeamEventApi, providedIn: "root" });
5048
+ TeamEventApi = __decorate([
5023
5049
  Injectable({ providedIn: 'root' })
5024
- ], TournamentApi);
5050
+ ], TeamEventApi);
5025
5051
 
5026
5052
  let TournamentJoinData = class TournamentJoinData extends BaseModel {
5027
5053
  get usersCount() {
@@ -5132,28 +5158,7 @@ let TournamentSeasonApi = class TournamentSeasonApi {
5132
5158
  if (size) {
5133
5159
  params = params.set('size', size.toString());
5134
5160
  }
5135
- if (filters.tournamentStageId) {
5136
- params = params.set('tournament_stage_id', filters.tournamentStageId.toString());
5137
- }
5138
- if (filters.tournamentTour) {
5139
- params = params.set('tournament_tour', filters.tournamentTour.toString());
5140
- }
5141
- if (filters.playoffStage) {
5142
- params = params.set('playoff_stage', filters.playoffStage.toString());
5143
- }
5144
- if (filters.teamId) {
5145
- params = params.set('team_id', filters.teamId.toString());
5146
- }
5147
- if (filters.status) {
5148
- params = params.set('status', GameStatuses[filters.status]);
5149
- }
5150
- if (filters.statuses) {
5151
- const statuses = filters.statuses.map(i => GameStatuses[i]);
5152
- params = params.set('statuses', statuses.join(','));
5153
- }
5154
- if (filters.tournamentCourtId) {
5155
- params = params.set('tournament_court_id', filters.tournamentCourtId.toString());
5156
- }
5161
+ params = applyGamesFilters(filters, params);
5157
5162
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_season/${seasonId}/games/`, { params, observe: 'response' }).pipe(map(result => ({
5158
5163
  total: +result.headers.get('X-Page-Count'),
5159
5164
  data: Game.toFront(result.body)
@@ -5806,8 +5811,9 @@ VolleyballGameLog = __decorate([
5806
5811
  })
5807
5812
  ], VolleyballGameLog);
5808
5813
 
5809
- let VolleyballGameApi = class VolleyballGameApi {
5814
+ let VolleyballGameApi = class VolleyballGameApi extends GameBaseApi {
5810
5815
  constructor(httpClient, configService) {
5816
+ super(httpClient, configService);
5811
5817
  this.httpClient = httpClient;
5812
5818
  this.configService = configService;
5813
5819
  }
@@ -5816,11 +5822,6 @@ let VolleyballGameApi = class VolleyballGameApi {
5816
5822
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_volleyball_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
5817
5823
  });
5818
5824
  }
5819
- getUsers(gameId) {
5820
- return __awaiter(this, void 0, void 0, function* () {
5821
- return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_game/${gameId}/users/`).pipe(map(result => GameUser.toFront(result))).toPromise();
5822
- });
5823
- }
5824
5825
  getTeamStatistic(gameId) {
5825
5826
  return __awaiter(this, void 0, void 0, function* () {
5826
5827
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_volleyball_game/${gameId}/team_statistic/`).pipe(map(result => VolleyballGameTeamStatistic.toFront(result))).toPromise();
@@ -5846,6 +5847,54 @@ VolleyballGameApi = __decorate([
5846
5847
  Injectable({ providedIn: 'root' })
5847
5848
  ], VolleyballGameApi);
5848
5849
 
5850
+ let PublicTeamApi = class PublicTeamApi {
5851
+ constructor(httpClient, configService) {
5852
+ this.httpClient = httpClient;
5853
+ this.configService = configService;
5854
+ }
5855
+ getById(teamId) {
5856
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/public_team/${teamId}/`).pipe(map(result => Team.toFront(result))).toPromise();
5857
+ }
5858
+ getTournamentTeams(teamId, leagueId) {
5859
+ const params = new HttpParams().set('league_id', leagueId.toString());
5860
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/public_team/${teamId}/tournament_teams/`, { params }).pipe(map(result => TournamentTeam.toFront(result))).toPromise();
5861
+ }
5862
+ };
5863
+ PublicTeamApi.ctorParameters = () => [
5864
+ { type: HttpClient },
5865
+ { type: ConfigService }
5866
+ ];
5867
+ PublicTeamApi.ɵprov = ɵɵdefineInjectable({ factory: function PublicTeamApi_Factory() { return new PublicTeamApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: PublicTeamApi, providedIn: "root" });
5868
+ PublicTeamApi = __decorate([
5869
+ Injectable({ providedIn: 'root' })
5870
+ ], PublicTeamApi);
5871
+
5872
+ let PublicUserApi = class PublicUserApi {
5873
+ constructor(httpClient, configService) {
5874
+ this.httpClient = httpClient;
5875
+ this.configService = configService;
5876
+ }
5877
+ getById(userId) {
5878
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/public_user/${userId}/`).pipe(map(result => User.toFront(result))).toPromise();
5879
+ }
5880
+ getTournaments(userId, leagueId) {
5881
+ const params = new HttpParams().set('league_id', leagueId.toString());
5882
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/public_user/${userId}/tournaments/`, { params }).pipe(map(result => Tournament.toFront(result))).toPromise();
5883
+ }
5884
+ getTournamentUser(userId, seasonId) {
5885
+ const params = new HttpParams().set('season_id', seasonId.toString());
5886
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/public_user/${userId}/tournament_user/`, { params }).pipe(map(result => TournamentTeamUser.toFront(result))).toPromise();
5887
+ }
5888
+ };
5889
+ PublicUserApi.ctorParameters = () => [
5890
+ { type: HttpClient },
5891
+ { type: ConfigService }
5892
+ ];
5893
+ PublicUserApi.ɵprov = ɵɵdefineInjectable({ factory: function PublicUserApi_Factory() { return new PublicUserApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: PublicUserApi, providedIn: "root" });
5894
+ PublicUserApi = __decorate([
5895
+ Injectable({ providedIn: 'root' })
5896
+ ], PublicUserApi);
5897
+
5849
5898
  const BasketballGameLogTypeLocalization = {
5850
5899
  [BasketballGameLogTypes.enter_game]: 'Выход на площадку',
5851
5900
  [BasketballGameLogTypes.exit_game]: 'Ушел с площадки',
@@ -6414,5 +6463,5 @@ HttpCookieInterceptor = __decorate([
6414
6463
  * Generated bundle index. Do not edit.
6415
6464
  */
6416
6465
 
6417
- 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 };
6466
+ 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 };
6418
6467
  //# sourceMappingURL=mtgame-core.js.map