@mtgame/core 0.1.94 → 0.1.96
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-join-api.d.ts +8 -0
- package/bundles/mtgame-core.umd.js +29 -0
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/tournament-join-api.js +22 -1
- package/esm2015/models/sport.js +5 -1
- package/fesm2015/mtgame-core.js +26 -1
- package/fesm2015/mtgame-core.js.map +1 -1
- package/models/sport.d.ts +3 -1
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,12 @@ import { TeamUser } from '../models/team-user';
|
|
|
4
4
|
import { TournamentTeamUserInvite } from '../models/tournament-team-user-invite';
|
|
5
5
|
import { TournamentInvite } from '../models/tournament-invite';
|
|
6
6
|
import { ConfigService } from '../services/config.service';
|
|
7
|
+
export declare enum TournamentJoin1x1Status {
|
|
8
|
+
not_sent = 1,
|
|
9
|
+
invite_sent = 2,
|
|
10
|
+
in_tournament = 3,
|
|
11
|
+
not_valid = 4
|
|
12
|
+
}
|
|
7
13
|
export declare class TournamentJoinApi {
|
|
8
14
|
private httpClient;
|
|
9
15
|
private configService;
|
|
@@ -11,4 +17,6 @@ export declare class TournamentJoinApi {
|
|
|
11
17
|
getTeamsForJoin(tournamentId: number): Promise<TournamentJoinTeam[]>;
|
|
12
18
|
getTeamUsers(teamId: number): Promise<TeamUser[]>;
|
|
13
19
|
joinTournament(tournamentId: number, teamId: number, invites: TournamentTeamUserInvite[]): Promise<TournamentInvite>;
|
|
20
|
+
join1x1Tournament(tournamentId: number): Promise<TournamentInvite>;
|
|
21
|
+
join1x1TournamentStatus(tournamentId: number): Promise<TournamentJoin1x1Status>;
|
|
14
22
|
}
|
|
@@ -776,6 +776,7 @@
|
|
|
776
776
|
SportTypes[SportTypes["rugby"] = 15] = "rugby";
|
|
777
777
|
SportTypes[SportTypes["rugby7"] = 16] = "rugby7";
|
|
778
778
|
SportTypes[SportTypes["rugby15"] = 17] = "rugby15";
|
|
779
|
+
SportTypes[SportTypes["basketball_1x1"] = 18] = "basketball_1x1";
|
|
779
780
|
})(exports.SportTypes || (exports.SportTypes = {}));
|
|
780
781
|
exports.Sport = /** @class */ (function (_super) {
|
|
781
782
|
__extends(Sport, _super);
|
|
@@ -791,6 +792,9 @@
|
|
|
791
792
|
Sport.prototype.isStreetball = function () {
|
|
792
793
|
return this.id === exports.SportTypes.streetball;
|
|
793
794
|
};
|
|
795
|
+
Sport.prototype.isBasketball1x1 = function () {
|
|
796
|
+
return this.id === exports.SportTypes.basketball_1x1;
|
|
797
|
+
};
|
|
794
798
|
Sport.prototype.isVolleyball = function () {
|
|
795
799
|
return this.id === exports.SportTypes.volleyball || this.parentId === exports.SportTypes.volleyball;
|
|
796
800
|
};
|
|
@@ -8813,6 +8817,13 @@
|
|
|
8813
8817
|
})
|
|
8814
8818
|
], exports.TournamentJoinTeam);
|
|
8815
8819
|
|
|
8820
|
+
exports.TournamentJoin1x1Status = void 0;
|
|
8821
|
+
(function (TournamentJoin1x1Status) {
|
|
8822
|
+
TournamentJoin1x1Status[TournamentJoin1x1Status["not_sent"] = 1] = "not_sent";
|
|
8823
|
+
TournamentJoin1x1Status[TournamentJoin1x1Status["invite_sent"] = 2] = "invite_sent";
|
|
8824
|
+
TournamentJoin1x1Status[TournamentJoin1x1Status["in_tournament"] = 3] = "in_tournament";
|
|
8825
|
+
TournamentJoin1x1Status[TournamentJoin1x1Status["not_valid"] = 4] = "not_valid";
|
|
8826
|
+
})(exports.TournamentJoin1x1Status || (exports.TournamentJoin1x1Status = {}));
|
|
8816
8827
|
var TournamentJoinApi = /** @class */ (function () {
|
|
8817
8828
|
function TournamentJoinApi(httpClient, configService) {
|
|
8818
8829
|
this.httpClient = httpClient;
|
|
@@ -8848,6 +8859,24 @@
|
|
|
8848
8859
|
});
|
|
8849
8860
|
});
|
|
8850
8861
|
};
|
|
8862
|
+
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId) {
|
|
8863
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8864
|
+
return __generator(this, function (_a) {
|
|
8865
|
+
return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1/", {})
|
|
8866
|
+
.pipe(operators.map(function (data) { return exports.TournamentInvite.toFront(data); }))
|
|
8867
|
+
.toPromise()];
|
|
8868
|
+
});
|
|
8869
|
+
});
|
|
8870
|
+
};
|
|
8871
|
+
TournamentJoinApi.prototype.join1x1TournamentStatus = function (tournamentId) {
|
|
8872
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8873
|
+
return __generator(this, function (_a) {
|
|
8874
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1_status/")
|
|
8875
|
+
.pipe(operators.map(function (data) { return exports.TournamentJoin1x1Status[data.status]; }))
|
|
8876
|
+
.toPromise()];
|
|
8877
|
+
});
|
|
8878
|
+
});
|
|
8879
|
+
};
|
|
8851
8880
|
return TournamentJoinApi;
|
|
8852
8881
|
}());
|
|
8853
8882
|
TournamentJoinApi.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function TournamentJoinApi_Factory() { return new TournamentJoinApi(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(ConfigService)); }, token: TournamentJoinApi, providedIn: "root" });
|