@mtgame/core 0.1.92 → 0.1.93
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/api/tournament-stage-api.d.ts +2 -0
- package/bundles/mtgame-core.umd.js +86 -0
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/tournament-api.js +9 -1
- package/esm2015/api/tournament-stage-api.js +9 -1
- package/esm2015/models/achievement.js +33 -0
- package/esm2015/models/public-api.js +3 -1
- package/esm2015/models/team-achievement.js +34 -0
- package/fesm2015/mtgame-core.js +73 -1
- package/fesm2015/mtgame-core.js.map +1 -1
- package/models/achievement.d.ts +14 -0
- package/models/public-api.d.ts +2 -0
- package/models/team-achievement.d.ts +14 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/api/tournament-api.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { LeagueUserPermissions } from '../models/league-user';
|
|
|
19
19
|
import { HandballStatistic } from '../models/handball-statistic';
|
|
20
20
|
import { RugbyStatistic } from '../models/rugby-statistic';
|
|
21
21
|
import { TournamentGroup } from '../models/tournament-group';
|
|
22
|
+
import { TeamAchievement } from '../models/team-achievement';
|
|
22
23
|
export interface TournamentGamesFilters {
|
|
23
24
|
tournamentIds?: number[];
|
|
24
25
|
tournamentSeasonId?: number;
|
|
@@ -101,6 +102,7 @@ export declare class TournamentApi {
|
|
|
101
102
|
getGroups(tournamentId: number): Promise<TournamentGroup[]>;
|
|
102
103
|
getTeams(tournamentId: number, groupId?: number): Promise<TournamentTeam[]>;
|
|
103
104
|
getStageTeams(tournamentId: number): Promise<TournamentStageTeam[]>;
|
|
105
|
+
getTeamsAchievements(tournamentId: number): Promise<TeamAchievement[]>;
|
|
104
106
|
getTeamById(tournamentTeamId: number): Promise<TournamentTeam>;
|
|
105
107
|
getUserById(userId: number): Promise<TournamentTeamUser>;
|
|
106
108
|
getUserGames(tournamentUserId: number): Promise<Game[]>;
|
|
@@ -4,12 +4,14 @@ import { TournamentGroup } from '../models/tournament-group';
|
|
|
4
4
|
import { Playoff } from '../models/playoff';
|
|
5
5
|
import { TournamentStageTeam } from '../models/tournament-stage-team';
|
|
6
6
|
import { ConfigService } from '../services/config.service';
|
|
7
|
+
import { TeamAchievement } from '../models/team-achievement';
|
|
7
8
|
export declare class TournamentStageApi {
|
|
8
9
|
private httpClient;
|
|
9
10
|
private configService;
|
|
10
11
|
constructor(httpClient: HttpClient, configService: ConfigService);
|
|
11
12
|
getById(id: number): Promise<TournamentStage>;
|
|
12
13
|
getGroups(stageId: number): Promise<TournamentGroup[]>;
|
|
14
|
+
getTeamsAchievements(stageId: number): Promise<TeamAchievement[]>;
|
|
13
15
|
getPlayoffs(stageId: number): Promise<Playoff[]>;
|
|
14
16
|
getTeams(stageId: number): Promise<TournamentStageTeam[]>;
|
|
15
17
|
}
|
|
@@ -5945,6 +5945,74 @@
|
|
|
5945
5945
|
})
|
|
5946
5946
|
], exports.RugbyStatistic);
|
|
5947
5947
|
|
|
5948
|
+
exports.AchievementTypes = void 0;
|
|
5949
|
+
(function (AchievementTypes) {
|
|
5950
|
+
AchievementTypes[AchievementTypes["by_game"] = 1] = "by_game";
|
|
5951
|
+
AchievementTypes[AchievementTypes["by_stage"] = 2] = "by_stage";
|
|
5952
|
+
})(exports.AchievementTypes || (exports.AchievementTypes = {}));
|
|
5953
|
+
exports.Achievement = /** @class */ (function (_super) {
|
|
5954
|
+
__extends(Achievement, _super);
|
|
5955
|
+
function Achievement() {
|
|
5956
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5957
|
+
}
|
|
5958
|
+
Achievement.toFront = function (data) { };
|
|
5959
|
+
Achievement.toBack = function (data) { };
|
|
5960
|
+
return Achievement;
|
|
5961
|
+
}(BaseModel));
|
|
5962
|
+
__decorate([
|
|
5963
|
+
ToFrontHook
|
|
5964
|
+
], exports.Achievement, "toFront", null);
|
|
5965
|
+
__decorate([
|
|
5966
|
+
ToBackHook
|
|
5967
|
+
], exports.Achievement, "toBack", null);
|
|
5968
|
+
exports.Achievement = __decorate([
|
|
5969
|
+
ModelInstance({
|
|
5970
|
+
mappingFields: {
|
|
5971
|
+
id: 'id',
|
|
5972
|
+
name: 'name',
|
|
5973
|
+
alias: 'type',
|
|
5974
|
+
value: 'value',
|
|
5975
|
+
type: 'type',
|
|
5976
|
+
},
|
|
5977
|
+
relation: {
|
|
5978
|
+
type: enumField(exports.AchievementTypes),
|
|
5979
|
+
}
|
|
5980
|
+
})
|
|
5981
|
+
], exports.Achievement);
|
|
5982
|
+
|
|
5983
|
+
exports.TeamAchievement = /** @class */ (function (_super) {
|
|
5984
|
+
__extends(TeamAchievement, _super);
|
|
5985
|
+
function TeamAchievement() {
|
|
5986
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
5987
|
+
}
|
|
5988
|
+
TeamAchievement.toFront = function (data) { };
|
|
5989
|
+
TeamAchievement.toBack = function (data) { };
|
|
5990
|
+
return TeamAchievement;
|
|
5991
|
+
}(BaseModel));
|
|
5992
|
+
__decorate([
|
|
5993
|
+
ToFrontHook
|
|
5994
|
+
], exports.TeamAchievement, "toFront", null);
|
|
5995
|
+
__decorate([
|
|
5996
|
+
ToBackHook
|
|
5997
|
+
], exports.TeamAchievement, "toBack", null);
|
|
5998
|
+
exports.TeamAchievement = __decorate([
|
|
5999
|
+
ModelInstance({
|
|
6000
|
+
mappingFields: {
|
|
6001
|
+
id: 'id',
|
|
6002
|
+
achievement: 'achievement',
|
|
6003
|
+
tournament_stage: 'tournamentStage',
|
|
6004
|
+
team_id: 'teamId',
|
|
6005
|
+
game: 'game',
|
|
6006
|
+
mt_points: 'mtPoints',
|
|
6007
|
+
},
|
|
6008
|
+
relation: {
|
|
6009
|
+
achievement: exports.Achievement,
|
|
6010
|
+
tournamentStage: exports.TournamentStage,
|
|
6011
|
+
game: exports.Game
|
|
6012
|
+
}
|
|
6013
|
+
})
|
|
6014
|
+
], exports.TeamAchievement);
|
|
6015
|
+
|
|
5948
6016
|
var TournamentApi = /** @class */ (function () {
|
|
5949
6017
|
function TournamentApi(httpClient, configService) {
|
|
5950
6018
|
this.httpClient = httpClient;
|
|
@@ -6098,6 +6166,15 @@
|
|
|
6098
6166
|
});
|
|
6099
6167
|
});
|
|
6100
6168
|
};
|
|
6169
|
+
TournamentApi.prototype.getTeamsAchievements = function (tournamentId) {
|
|
6170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6171
|
+
return __generator(this, function (_a) {
|
|
6172
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/achievements/")
|
|
6173
|
+
.pipe(operators.map(function (result) { return exports.TeamAchievement.toFront(result); }))
|
|
6174
|
+
.toPromise()];
|
|
6175
|
+
});
|
|
6176
|
+
});
|
|
6177
|
+
};
|
|
6101
6178
|
TournamentApi.prototype.getTeamById = function (tournamentTeamId) {
|
|
6102
6179
|
return __awaiter(this, void 0, void 0, function () {
|
|
6103
6180
|
return __generator(this, function (_a) {
|
|
@@ -8920,6 +8997,15 @@
|
|
|
8920
8997
|
});
|
|
8921
8998
|
});
|
|
8922
8999
|
};
|
|
9000
|
+
TournamentStageApi.prototype.getTeamsAchievements = function (stageId) {
|
|
9001
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9002
|
+
return __generator(this, function (_a) {
|
|
9003
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_stage/" + stageId + "/achievements/")
|
|
9004
|
+
.pipe(operators.map(function (result) { return exports.TeamAchievement.toFront(result); }))
|
|
9005
|
+
.toPromise()];
|
|
9006
|
+
});
|
|
9007
|
+
});
|
|
9008
|
+
};
|
|
8923
9009
|
TournamentStageApi.prototype.getPlayoffs = function (stageId) {
|
|
8924
9010
|
return __awaiter(this, void 0, void 0, function () {
|
|
8925
9011
|
return __generator(this, function (_a) {
|