@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.
- package/api/tournament-api.d.ts +1 -0
- package/bundles/mtgame-core.umd.js +21 -0
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +2 -2
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/api/tournament-api.js +8 -1
- package/esm2015/services/centrifugo.service.js +10 -2
- package/esm5/api/tournament-api.js +10 -1
- package/esm5/services/centrifugo.service.js +14 -2
- package/fesm2015/mtgame-core.js +15 -0
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +21 -0
- package/fesm5/mtgame-core.js.map +1 -1
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
- package/services/centrifugo.service.d.ts +2 -0
package/api/tournament-api.d.ts
CHANGED
|
@@ -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
|
}
|