@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/api/tournament-api.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { TournamentStageTeam } from '../models/tournament-stage-team';
|
|
|
14
14
|
import { TournamentEvent, TournamentEventTypes } from '../models/tournament-event';
|
|
15
15
|
import { ConfigService } from '../services/config.service';
|
|
16
16
|
import { HockeyStatistic } from '../models/hockey-statistic';
|
|
17
|
+
import { LeagueUserPermissions } from '../models/league-user';
|
|
17
18
|
export interface TournamentGamesFilters {
|
|
18
19
|
tournamentStageId?: number;
|
|
19
20
|
tournamentTour?: number;
|
|
@@ -64,4 +65,5 @@ export declare class TournamentApi {
|
|
|
64
65
|
getVolleyballStatistic(filters?: StatisticFilters): Promise<VolleyballStatistic[]>;
|
|
65
66
|
getHockeyStatistic(filters?: StatisticFilters): Promise<HockeyStatistic[]>;
|
|
66
67
|
getTournamentTeamUsers(tournamentTeamId: number): Promise<TournamentTeamUser[]>;
|
|
68
|
+
myPermission(tournamentId: number): Promise<LeagueUserPermissions[]>;
|
|
67
69
|
}
|
|
@@ -5037,6 +5037,63 @@
|
|
|
5037
5037
|
return TournamentStageTeam;
|
|
5038
5038
|
}(BaseModel));
|
|
5039
5039
|
|
|
5040
|
+
var LeagueUserRoles;
|
|
5041
|
+
(function (LeagueUserRoles) {
|
|
5042
|
+
LeagueUserRoles[LeagueUserRoles["admin"] = 1] = "admin";
|
|
5043
|
+
LeagueUserRoles[LeagueUserRoles["moderator"] = 2] = "moderator";
|
|
5044
|
+
LeagueUserRoles[LeagueUserRoles["game_manager"] = 3] = "game_manager";
|
|
5045
|
+
})(LeagueUserRoles || (LeagueUserRoles = {}));
|
|
5046
|
+
var LeagueUserPermissions;
|
|
5047
|
+
(function (LeagueUserPermissions) {
|
|
5048
|
+
LeagueUserPermissions[LeagueUserPermissions["settings"] = 1] = "settings";
|
|
5049
|
+
LeagueUserPermissions[LeagueUserPermissions["users"] = 2] = "users";
|
|
5050
|
+
LeagueUserPermissions[LeagueUserPermissions["teams"] = 3] = "teams";
|
|
5051
|
+
LeagueUserPermissions[LeagueUserPermissions["media"] = 4] = "media";
|
|
5052
|
+
LeagueUserPermissions[LeagueUserPermissions["news"] = 5] = "news";
|
|
5053
|
+
LeagueUserPermissions[LeagueUserPermissions["game_export"] = 6] = "game_export";
|
|
5054
|
+
LeagueUserPermissions[LeagueUserPermissions["schedule"] = 7] = "schedule";
|
|
5055
|
+
LeagueUserPermissions[LeagueUserPermissions["game_management"] = 8] = "game_management";
|
|
5056
|
+
})(LeagueUserPermissions || (LeagueUserPermissions = {}));
|
|
5057
|
+
var LeagueUser = /** @class */ (function (_super) {
|
|
5058
|
+
__extends(LeagueUser, _super);
|
|
5059
|
+
function LeagueUser() {
|
|
5060
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5061
|
+
}
|
|
5062
|
+
Object.defineProperty(LeagueUser.prototype, "role", {
|
|
5063
|
+
get: function () {
|
|
5064
|
+
return this._role;
|
|
5065
|
+
},
|
|
5066
|
+
set: function (value) {
|
|
5067
|
+
this._role = LeagueUserRoles[value];
|
|
5068
|
+
},
|
|
5069
|
+
enumerable: true,
|
|
5070
|
+
configurable: true
|
|
5071
|
+
});
|
|
5072
|
+
LeagueUser.toFront = function (data) { };
|
|
5073
|
+
LeagueUser.toBack = function (data) { };
|
|
5074
|
+
__decorate([
|
|
5075
|
+
ToFrontHook
|
|
5076
|
+
], LeagueUser, "toFront", null);
|
|
5077
|
+
__decorate([
|
|
5078
|
+
ToBackHook
|
|
5079
|
+
], LeagueUser, "toBack", null);
|
|
5080
|
+
LeagueUser = __decorate([
|
|
5081
|
+
ModelInstance({
|
|
5082
|
+
mappingFields: {
|
|
5083
|
+
id: 'id',
|
|
5084
|
+
user: 'user',
|
|
5085
|
+
role: 'role',
|
|
5086
|
+
permissions: 'permissions'
|
|
5087
|
+
},
|
|
5088
|
+
relation: {
|
|
5089
|
+
user: User,
|
|
5090
|
+
permissions: listField(enumField(LeagueUserPermissions))
|
|
5091
|
+
}
|
|
5092
|
+
})
|
|
5093
|
+
], LeagueUser);
|
|
5094
|
+
return LeagueUser;
|
|
5095
|
+
}(BaseModel));
|
|
5096
|
+
|
|
5040
5097
|
var TournamentApi = /** @class */ (function () {
|
|
5041
5098
|
function TournamentApi(httpClient, configService) {
|
|
5042
5099
|
this.httpClient = httpClient;
|
|
@@ -5287,6 +5344,13 @@
|
|
|
5287
5344
|
});
|
|
5288
5345
|
});
|
|
5289
5346
|
};
|
|
5347
|
+
TournamentApi.prototype.myPermission = function (tournamentId) {
|
|
5348
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5349
|
+
return __generator(this, function (_a) {
|
|
5350
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/permission/").pipe(operators.map(function (data) { return (data.permissions || []).map(function (item) { return LeagueUserPermissions[item]; }); })).toPromise()];
|
|
5351
|
+
});
|
|
5352
|
+
});
|
|
5353
|
+
};
|
|
5290
5354
|
TournamentApi.ctorParameters = function () { return [
|
|
5291
5355
|
{ type: http.HttpClient },
|
|
5292
5356
|
{ type: ConfigService }
|