@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.
- package/api/league-api.d.ts +2 -0
- package/api/tournament-api.d.ts +1 -0
- package/bundles/mtgame-core.umd.js +28 -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/league-api.js +7 -1
- package/esm2015/api/tournament-api.js +8 -1
- package/esm2015/services/centrifugo.service.js +10 -2
- package/esm5/api/league-api.js +9 -1
- package/esm5/api/tournament-api.js +10 -1
- package/esm5/services/centrifugo.service.js +14 -2
- package/fesm2015/mtgame-core.js +20 -0
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +28 -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/fesm5/mtgame-core.js
CHANGED
|
@@ -3090,6 +3090,13 @@ var LeagueApi = /** @class */ (function () {
|
|
|
3090
3090
|
});
|
|
3091
3091
|
});
|
|
3092
3092
|
};
|
|
3093
|
+
LeagueApi.prototype.getCourts = function (leagueId) {
|
|
3094
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3095
|
+
return __generator(this, function (_a) {
|
|
3096
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league/" + leagueId + "/courts/").pipe(map(function (result) { return LeagueCourt.toFront(result); })).toPromise()];
|
|
3097
|
+
});
|
|
3098
|
+
});
|
|
3099
|
+
};
|
|
3093
3100
|
LeagueApi.ctorParameters = function () { return [
|
|
3094
3101
|
{ type: HttpClient },
|
|
3095
3102
|
{ type: ConfigService }
|
|
@@ -5104,6 +5111,15 @@ var TournamentApi = /** @class */ (function () {
|
|
|
5104
5111
|
this.httpClient = httpClient;
|
|
5105
5112
|
this.configService = configService;
|
|
5106
5113
|
}
|
|
5114
|
+
TournamentApi.prototype.getById = function (tournamentId) {
|
|
5115
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5116
|
+
return __generator(this, function (_a) {
|
|
5117
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/")
|
|
5118
|
+
.pipe(map(function (result) { return Tournament.toFront(result); }))
|
|
5119
|
+
.toPromise()];
|
|
5120
|
+
});
|
|
5121
|
+
});
|
|
5122
|
+
};
|
|
5107
5123
|
TournamentApi.prototype.getByAlias = function (leagueId, alias) {
|
|
5108
5124
|
return __awaiter(this, void 0, void 0, function () {
|
|
5109
5125
|
return __generator(this, function (_a) {
|
|
@@ -6515,7 +6531,15 @@ var CentrifugoService = /** @class */ (function () {
|
|
|
6515
6531
|
this.configService = configService;
|
|
6516
6532
|
this.channels$ = {};
|
|
6517
6533
|
this.subscriptions = {};
|
|
6534
|
+
this.connectedSubject = new BehaviorSubject(false);
|
|
6518
6535
|
}
|
|
6536
|
+
Object.defineProperty(CentrifugoService.prototype, "connected$", {
|
|
6537
|
+
get: function () {
|
|
6538
|
+
return this.connectedSubject;
|
|
6539
|
+
},
|
|
6540
|
+
enumerable: true,
|
|
6541
|
+
configurable: true
|
|
6542
|
+
});
|
|
6519
6543
|
CentrifugoService.prototype.listen = function (channel) {
|
|
6520
6544
|
var _this = this;
|
|
6521
6545
|
if (channel in this.channels$) {
|
|
@@ -6556,6 +6580,10 @@ var CentrifugoService = /** @class */ (function () {
|
|
|
6556
6580
|
_this.centrifuge.connect();
|
|
6557
6581
|
_this.centrifuge.on('connect', function () {
|
|
6558
6582
|
_this.initializeEngineSubject.next(true);
|
|
6583
|
+
_this.connectedSubject.next(true);
|
|
6584
|
+
});
|
|
6585
|
+
_this.centrifuge.on('disconnect', function () {
|
|
6586
|
+
_this.connectedSubject.next(false);
|
|
6559
6587
|
});
|
|
6560
6588
|
});
|
|
6561
6589
|
}
|