@mtgame/core 0.0.32 → 0.0.35
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/basketball-game-api.d.ts +1 -0
- package/api/tournament-api.d.ts +2 -0
- package/bundles/mtgame-core.umd.js +72 -0
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +1 -1
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/api/basketball-game-api.js +7 -1
- package/esm2015/api/tournament-api.js +7 -1
- package/esm2015/models/league-user.js +52 -0
- package/esm5/api/basketball-game-api.js +9 -1
- package/esm5/api/tournament-api.js +9 -1
- package/esm5/models/league-user.js +61 -0
- package/fesm2015/mtgame-core.js +59 -0
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +72 -0
- package/fesm5/mtgame-core.js.map +1 -1
- package/models/league-user.d.ts +27 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/mtgame-core.js
CHANGED
|
@@ -2176,6 +2176,14 @@ var BasketballGameApi = /** @class */ (function () {
|
|
|
2176
2176
|
});
|
|
2177
2177
|
});
|
|
2178
2178
|
};
|
|
2179
|
+
BasketballGameApi.prototype.downloadProtocol = function (gameId) {
|
|
2180
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2181
|
+
return __generator(this, function (_a) {
|
|
2182
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_basketball_game/" + gameId + "/game_protocol/", { responseType: 'blob' })
|
|
2183
|
+
.toPromise()];
|
|
2184
|
+
});
|
|
2185
|
+
});
|
|
2186
|
+
};
|
|
2179
2187
|
BasketballGameApi.ctorParameters = function () { return [
|
|
2180
2188
|
{ type: HttpClient },
|
|
2181
2189
|
{ type: ConfigService }
|
|
@@ -4824,6 +4832,63 @@ var TournamentStageTeam = /** @class */ (function (_super) {
|
|
|
4824
4832
|
return TournamentStageTeam;
|
|
4825
4833
|
}(BaseModel));
|
|
4826
4834
|
|
|
4835
|
+
var LeagueUserRoles;
|
|
4836
|
+
(function (LeagueUserRoles) {
|
|
4837
|
+
LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
|
|
4838
|
+
LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
|
|
4839
|
+
LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
|
|
4840
|
+
})(LeagueUserRoles || (LeagueUserRoles = {}));
|
|
4841
|
+
var LeagueUserPermissions;
|
|
4842
|
+
(function (LeagueUserPermissions) {
|
|
4843
|
+
LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
|
|
4844
|
+
LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
|
|
4845
|
+
LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
|
|
4846
|
+
LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
|
|
4847
|
+
LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
|
|
4848
|
+
LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
|
|
4849
|
+
LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
|
|
4850
|
+
LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
|
|
4851
|
+
})(LeagueUserPermissions || (LeagueUserPermissions = {}));
|
|
4852
|
+
var LeagueUser = /** @class */ (function (_super) {
|
|
4853
|
+
__extends(LeagueUser, _super);
|
|
4854
|
+
function LeagueUser() {
|
|
4855
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4856
|
+
}
|
|
4857
|
+
Object.defineProperty(LeagueUser.prototype, "role", {
|
|
4858
|
+
get: function () {
|
|
4859
|
+
return this._role;
|
|
4860
|
+
},
|
|
4861
|
+
set: function (value) {
|
|
4862
|
+
this._role = LeagueUserRoles[value];
|
|
4863
|
+
},
|
|
4864
|
+
enumerable: true,
|
|
4865
|
+
configurable: true
|
|
4866
|
+
});
|
|
4867
|
+
LeagueUser.toFront = function (data) { };
|
|
4868
|
+
LeagueUser.toBack = function (data) { };
|
|
4869
|
+
__decorate([
|
|
4870
|
+
ToFrontHook
|
|
4871
|
+
], LeagueUser, "toFront", null);
|
|
4872
|
+
__decorate([
|
|
4873
|
+
ToBackHook
|
|
4874
|
+
], LeagueUser, "toBack", null);
|
|
4875
|
+
LeagueUser = __decorate([
|
|
4876
|
+
ModelInstance({
|
|
4877
|
+
mappingFields: {
|
|
4878
|
+
id: 'id',
|
|
4879
|
+
user: 'user',
|
|
4880
|
+
role: 'role',
|
|
4881
|
+
permissions: 'permissions'
|
|
4882
|
+
},
|
|
4883
|
+
relation: {
|
|
4884
|
+
user: User,
|
|
4885
|
+
permissions: listField(enumField(LeagueUserPermissions))
|
|
4886
|
+
}
|
|
4887
|
+
})
|
|
4888
|
+
], LeagueUser);
|
|
4889
|
+
return LeagueUser;
|
|
4890
|
+
}(BaseModel));
|
|
4891
|
+
|
|
4827
4892
|
var TournamentApi = /** @class */ (function () {
|
|
4828
4893
|
function TournamentApi(httpClient, configService) {
|
|
4829
4894
|
this.httpClient = httpClient;
|
|
@@ -5074,6 +5139,13 @@ var TournamentApi = /** @class */ (function () {
|
|
|
5074
5139
|
});
|
|
5075
5140
|
});
|
|
5076
5141
|
};
|
|
5142
|
+
TournamentApi.prototype.myPermission = function (tournamentId) {
|
|
5143
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5144
|
+
return __generator(this, function (_a) {
|
|
5145
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/permission/").pipe(map(function (data) { return (data.permissions || []).map(function (item) { return LeagueUserPermissions[item]; }); })).toPromise()];
|
|
5146
|
+
});
|
|
5147
|
+
});
|
|
5148
|
+
};
|
|
5077
5149
|
TournamentApi.ctorParameters = function () { return [
|
|
5078
5150
|
{ type: HttpClient },
|
|
5079
5151
|
{ type: ConfigService }
|