@mtgame/core 0.0.46 → 0.0.47

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.
@@ -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[]>>;
@@ -5317,6 +5317,15 @@
5317
5317
  this.httpClient = httpClient;
5318
5318
  this.configService = configService;
5319
5319
  }
5320
+ TournamentApi.prototype.getById = function (tournamentId) {
5321
+ return __awaiter(this, void 0, void 0, function () {
5322
+ return __generator(this, function (_a) {
5323
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/")
5324
+ .pipe(operators.map(function (result) { return Tournament.toFront(result); }))
5325
+ .toPromise()];
5326
+ });
5327
+ });
5328
+ };
5320
5329
  TournamentApi.prototype.getByAlias = function (leagueId, alias) {
5321
5330
  return __awaiter(this, void 0, void 0, function () {
5322
5331
  return __generator(this, function (_a) {
@@ -6728,7 +6737,15 @@
6728
6737
  this.configService = configService;
6729
6738
  this.channels$ = {};
6730
6739
  this.subscriptions = {};
6740
+ this.connectedSubject = new rxjs.BehaviorSubject(false);
6731
6741
  }
6742
+ Object.defineProperty(CentrifugoService.prototype, "connected$", {
6743
+ get: function () {
6744
+ return this.connectedSubject;
6745
+ },
6746
+ enumerable: true,
6747
+ configurable: true
6748
+ });
6732
6749
  CentrifugoService.prototype.listen = function (channel) {
6733
6750
  var _this = this;
6734
6751
  if (channel in this.channels$) {
@@ -6769,6 +6786,10 @@
6769
6786
  _this.centrifuge.connect();
6770
6787
  _this.centrifuge.on('connect', function () {
6771
6788
  _this.initializeEngineSubject.next(true);
6789
+ _this.connectedSubject.next(true);
6790
+ });
6791
+ _this.centrifuge.on('disconnect', function () {
6792
+ _this.connectedSubject.next(false);
6772
6793
  });
6773
6794
  });
6774
6795
  }