@mtgame/core 0.0.46 → 0.0.48

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.
@@ -8,6 +8,7 @@ import { TournamentEvent } from '../models/tournament-event';
8
8
  import { TournamentSeason } from '../models/tournament-season';
9
9
  import { Game } from '../models/game';
10
10
  import { LeaguePartner } from '../models/league-partner';
11
+ import { LeagueCourt } from '../models/league-court';
11
12
  export declare class LeagueApi {
12
13
  private httpClient;
13
14
  private configService;
@@ -20,4 +21,5 @@ export declare class LeagueApi {
20
21
  getGames(leagueId: number, page: number, size: number, filters: TournamentGamesFilters): Promise<PaginatedResponse<Game[]>>;
21
22
  getSeasons(leagueId: number, notClosed?: boolean): Promise<TournamentSeason[]>;
22
23
  getPartners(leagueId: number): Promise<LeaguePartner[]>;
24
+ getCourts(leagueId: number): Promise<LeagueCourt[]>;
23
25
  }
@@ -51,6 +51,7 @@ export declare class TournamentApi {
51
51
  private httpClient;
52
52
  private configService;
53
53
  constructor(httpClient: HttpClient, configService: ConfigService);
54
+ getById(tournamentId: number): Promise<Tournament>;
54
55
  getByAlias(leagueId: number, alias: string): Promise<Tournament>;
55
56
  getNews(tournamentId: number): Promise<TournamentNews[]>;
56
57
  getEvents(tournamentId: number, page: number, size: number, filters?: TournamentEventsListFilter): Promise<PaginatedResponse<TournamentEvent[]>>;
@@ -3303,6 +3303,13 @@
3303
3303
  });
3304
3304
  });
3305
3305
  };
3306
+ LeagueApi.prototype.getCourts = function (leagueId) {
3307
+ return __awaiter(this, void 0, void 0, function () {
3308
+ return __generator(this, function (_a) {
3309
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/courts/").pipe(operators.map(function (result) { return LeagueCourt.toFront(result); })).toPromise()];
3310
+ });
3311
+ });
3312
+ };
3306
3313
  LeagueApi.ctorParameters = function () { return [
3307
3314
  { type: http.HttpClient },
3308
3315
  { type: ConfigService }
@@ -5317,6 +5324,15 @@
5317
5324
  this.httpClient = httpClient;
5318
5325
  this.configService = configService;
5319
5326
  }
5327
+ TournamentApi.prototype.getById = function (tournamentId) {
5328
+ return __awaiter(this, void 0, void 0, function () {
5329
+ return __generator(this, function (_a) {
5330
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/")
5331
+ .pipe(operators.map(function (result) { return Tournament.toFront(result); }))
5332
+ .toPromise()];
5333
+ });
5334
+ });
5335
+ };
5320
5336
  TournamentApi.prototype.getByAlias = function (leagueId, alias) {
5321
5337
  return __awaiter(this, void 0, void 0, function () {
5322
5338
  return __generator(this, function (_a) {
@@ -6728,7 +6744,15 @@
6728
6744
  this.configService = configService;
6729
6745
  this.channels$ = {};
6730
6746
  this.subscriptions = {};
6747
+ this.connectedSubject = new rxjs.BehaviorSubject(false);
6731
6748
  }
6749
+ Object.defineProperty(CentrifugoService.prototype, "connected$", {
6750
+ get: function () {
6751
+ return this.connectedSubject;
6752
+ },
6753
+ enumerable: true,
6754
+ configurable: true
6755
+ });
6732
6756
  CentrifugoService.prototype.listen = function (channel) {
6733
6757
  var _this = this;
6734
6758
  if (channel in this.channels$) {
@@ -6769,6 +6793,10 @@
6769
6793
  _this.centrifuge.connect();
6770
6794
  _this.centrifuge.on('connect', function () {
6771
6795
  _this.initializeEngineSubject.next(true);
6796
+ _this.connectedSubject.next(true);
6797
+ });
6798
+ _this.centrifuge.on('disconnect', function () {
6799
+ _this.connectedSubject.next(false);
6772
6800
  });
6773
6801
  });
6774
6802
  }