@mtgame/core 0.0.32 → 0.0.34
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 +2 -0
- package/bundles/mtgame-core.umd.js +64 -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/tournament-api.js +7 -1
- package/esm2015/models/league-user.js +52 -0
- package/esm5/api/tournament-api.js +9 -1
- package/esm5/models/league-user.js +61 -0
- package/fesm2015/mtgame-core.js +53 -0
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +64 -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
|
@@ -4824,6 +4824,63 @@ var TournamentStageTeam = /** @class */ (function (_super) {
|
|
|
4824
4824
|
return TournamentStageTeam;
|
|
4825
4825
|
}(BaseModel));
|
|
4826
4826
|
|
|
4827
|
+
var LeagueUserRoles;
|
|
4828
|
+
(function (LeagueUserRoles) {
|
|
4829
|
+
LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
|
|
4830
|
+
LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
|
|
4831
|
+
LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
|
|
4832
|
+
})(LeagueUserRoles || (LeagueUserRoles = {}));
|
|
4833
|
+
var LeagueUserPermissions;
|
|
4834
|
+
(function (LeagueUserPermissions) {
|
|
4835
|
+
LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
|
|
4836
|
+
LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
|
|
4837
|
+
LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
|
|
4838
|
+
LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
|
|
4839
|
+
LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
|
|
4840
|
+
LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
|
|
4841
|
+
LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
|
|
4842
|
+
LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
|
|
4843
|
+
})(LeagueUserPermissions || (LeagueUserPermissions = {}));
|
|
4844
|
+
var LeagueUser = /** @class */ (function (_super) {
|
|
4845
|
+
__extends(LeagueUser, _super);
|
|
4846
|
+
function LeagueUser() {
|
|
4847
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4848
|
+
}
|
|
4849
|
+
Object.defineProperty(LeagueUser.prototype, "role", {
|
|
4850
|
+
get: function () {
|
|
4851
|
+
return this._role;
|
|
4852
|
+
},
|
|
4853
|
+
set: function (value) {
|
|
4854
|
+
this._role = LeagueUserRoles[value];
|
|
4855
|
+
},
|
|
4856
|
+
enumerable: true,
|
|
4857
|
+
configurable: true
|
|
4858
|
+
});
|
|
4859
|
+
LeagueUser.toFront = function (data) { };
|
|
4860
|
+
LeagueUser.toBack = function (data) { };
|
|
4861
|
+
__decorate([
|
|
4862
|
+
ToFrontHook
|
|
4863
|
+
], LeagueUser, "toFront", null);
|
|
4864
|
+
__decorate([
|
|
4865
|
+
ToBackHook
|
|
4866
|
+
], LeagueUser, "toBack", null);
|
|
4867
|
+
LeagueUser = __decorate([
|
|
4868
|
+
ModelInstance({
|
|
4869
|
+
mappingFields: {
|
|
4870
|
+
id: 'id',
|
|
4871
|
+
user: 'user',
|
|
4872
|
+
role: 'role',
|
|
4873
|
+
permissions: 'permissions'
|
|
4874
|
+
},
|
|
4875
|
+
relation: {
|
|
4876
|
+
user: User,
|
|
4877
|
+
permissions: listField(enumField(LeagueUserPermissions))
|
|
4878
|
+
}
|
|
4879
|
+
})
|
|
4880
|
+
], LeagueUser);
|
|
4881
|
+
return LeagueUser;
|
|
4882
|
+
}(BaseModel));
|
|
4883
|
+
|
|
4827
4884
|
var TournamentApi = /** @class */ (function () {
|
|
4828
4885
|
function TournamentApi(httpClient, configService) {
|
|
4829
4886
|
this.httpClient = httpClient;
|
|
@@ -5074,6 +5131,13 @@ var TournamentApi = /** @class */ (function () {
|
|
|
5074
5131
|
});
|
|
5075
5132
|
});
|
|
5076
5133
|
};
|
|
5134
|
+
TournamentApi.prototype.myPermission = function (tournamentId) {
|
|
5135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5136
|
+
return __generator(this, function (_a) {
|
|
5137
|
+
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()];
|
|
5138
|
+
});
|
|
5139
|
+
});
|
|
5140
|
+
};
|
|
5077
5141
|
TournamentApi.ctorParameters = function () { return [
|
|
5078
5142
|
{ type: HttpClient },
|
|
5079
5143
|
{ type: ConfigService }
|