@mtgame/core 0.1.95 → 0.1.97
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 +4 -2
- package/bundles/mtgame-core.umd.js +49 -2
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/tournament-join-api.js +5 -3
- package/esm2015/models/public-api.js +2 -1
- package/esm2015/models/tournament-join1x1-data.js +31 -0
- package/esm2015/utils/date.js +12 -0
- package/esm2015/utils/public-api.js +11 -10
- package/fesm2015/mtgame-core.js +43 -3
- package/fesm2015/mtgame-core.js.map +1 -1
- package/models/public-api.d.ts +1 -0
- package/models/tournament-join1x1-data.d.ts +11 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
- package/utils/date.d.ts +1 -0
- package/utils/public-api.d.ts +10 -9
|
@@ -4,10 +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
|
+
import { TournamentJoin1x1Data } from '../models/tournament-join1x1-data';
|
|
7
8
|
export declare enum TournamentJoin1x1Status {
|
|
8
9
|
not_sent = 1,
|
|
9
10
|
invite_sent = 2,
|
|
10
|
-
in_tournament = 3
|
|
11
|
+
in_tournament = 3,
|
|
12
|
+
not_valid = 4
|
|
11
13
|
}
|
|
12
14
|
export declare class TournamentJoinApi {
|
|
13
15
|
private httpClient;
|
|
@@ -16,6 +18,6 @@ export declare class TournamentJoinApi {
|
|
|
16
18
|
getTeamsForJoin(tournamentId: number): Promise<TournamentJoinTeam[]>;
|
|
17
19
|
getTeamUsers(teamId: number): Promise<TeamUser[]>;
|
|
18
20
|
joinTournament(tournamentId: number, teamId: number, invites: TournamentTeamUserInvite[]): Promise<TournamentInvite>;
|
|
19
|
-
join1x1Tournament(tournamentId: number): Promise<TournamentInvite>;
|
|
21
|
+
join1x1Tournament(tournamentId: number, additionalData: TournamentJoin1x1Data): Promise<TournamentInvite>;
|
|
20
22
|
join1x1TournamentStatus(tournamentId: number): Promise<TournamentJoin1x1Status>;
|
|
21
23
|
}
|
|
@@ -8817,11 +8817,44 @@
|
|
|
8817
8817
|
})
|
|
8818
8818
|
], exports.TournamentJoinTeam);
|
|
8819
8819
|
|
|
8820
|
+
exports.TournamentJoin1x1Data = /** @class */ (function (_super) {
|
|
8821
|
+
__extends(TournamentJoin1x1Data, _super);
|
|
8822
|
+
function TournamentJoin1x1Data() {
|
|
8823
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
8824
|
+
}
|
|
8825
|
+
TournamentJoin1x1Data.toFront = function (data) { };
|
|
8826
|
+
TournamentJoin1x1Data.toBack = function (data) { };
|
|
8827
|
+
return TournamentJoin1x1Data;
|
|
8828
|
+
}(BaseModel));
|
|
8829
|
+
__decorate([
|
|
8830
|
+
ToFrontHook
|
|
8831
|
+
], exports.TournamentJoin1x1Data, "toFront", null);
|
|
8832
|
+
__decorate([
|
|
8833
|
+
ToBackHook
|
|
8834
|
+
], exports.TournamentJoin1x1Data, "toBack", null);
|
|
8835
|
+
exports.TournamentJoin1x1Data = __decorate([
|
|
8836
|
+
ModelInstance({
|
|
8837
|
+
mappingFields: {
|
|
8838
|
+
email: 'email',
|
|
8839
|
+
phone: 'phone',
|
|
8840
|
+
gender: 'gender',
|
|
8841
|
+
birth_date: 'birthDate',
|
|
8842
|
+
size: 'size',
|
|
8843
|
+
nickname: 'nickname',
|
|
8844
|
+
},
|
|
8845
|
+
relation: {
|
|
8846
|
+
birthDate: DateField,
|
|
8847
|
+
gender: enumField(exports.UserGender),
|
|
8848
|
+
}
|
|
8849
|
+
})
|
|
8850
|
+
], exports.TournamentJoin1x1Data);
|
|
8851
|
+
|
|
8820
8852
|
exports.TournamentJoin1x1Status = void 0;
|
|
8821
8853
|
(function (TournamentJoin1x1Status) {
|
|
8822
8854
|
TournamentJoin1x1Status[TournamentJoin1x1Status["not_sent"] = 1] = "not_sent";
|
|
8823
8855
|
TournamentJoin1x1Status[TournamentJoin1x1Status["invite_sent"] = 2] = "invite_sent";
|
|
8824
8856
|
TournamentJoin1x1Status[TournamentJoin1x1Status["in_tournament"] = 3] = "in_tournament";
|
|
8857
|
+
TournamentJoin1x1Status[TournamentJoin1x1Status["not_valid"] = 4] = "not_valid";
|
|
8825
8858
|
})(exports.TournamentJoin1x1Status || (exports.TournamentJoin1x1Status = {}));
|
|
8826
8859
|
var TournamentJoinApi = /** @class */ (function () {
|
|
8827
8860
|
function TournamentJoinApi(httpClient, configService) {
|
|
@@ -8858,10 +8891,10 @@
|
|
|
8858
8891
|
});
|
|
8859
8892
|
});
|
|
8860
8893
|
};
|
|
8861
|
-
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId) {
|
|
8894
|
+
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId, additionalData) {
|
|
8862
8895
|
return __awaiter(this, void 0, void 0, function () {
|
|
8863
8896
|
return __generator(this, function (_a) {
|
|
8864
|
-
return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1/",
|
|
8897
|
+
return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1/", exports.TournamentJoin1x1Data.toBack(additionalData))
|
|
8865
8898
|
.pipe(operators.map(function (data) { return exports.TournamentInvite.toFront(data); }))
|
|
8866
8899
|
.toPromise()];
|
|
8867
8900
|
});
|
|
@@ -10609,6 +10642,19 @@
|
|
|
10609
10642
|
return null;
|
|
10610
10643
|
}
|
|
10611
10644
|
|
|
10645
|
+
function parseDate(input, format) {
|
|
10646
|
+
if (format === void 0) { format = 'yyyy-mm-dd'; }
|
|
10647
|
+
var parts = input.match(/(\d+)/g);
|
|
10648
|
+
var i = 0;
|
|
10649
|
+
var result = {};
|
|
10650
|
+
// extract date-part indexes from the format
|
|
10651
|
+
format.replace(/(yyyy|dd|mm)/g, function (part) {
|
|
10652
|
+
result[part] = +parts[i++];
|
|
10653
|
+
return '';
|
|
10654
|
+
});
|
|
10655
|
+
return new Date(result.yyyy, result.mm - 1, result.dd);
|
|
10656
|
+
}
|
|
10657
|
+
|
|
10612
10658
|
function isTouchDevice() {
|
|
10613
10659
|
var prefixes = ' -webkit- -moz- -o- -ms- '.split(' ');
|
|
10614
10660
|
var mq = function (q) {
|
|
@@ -10891,6 +10937,7 @@
|
|
|
10891
10937
|
exports.listField = listField;
|
|
10892
10938
|
exports.markFormGroupTouched = markFormGroupTouched;
|
|
10893
10939
|
exports.minLengthArrayValidator = minLengthArrayValidator;
|
|
10940
|
+
exports.parseDate = parseDate;
|
|
10894
10941
|
exports.patchItemInArray = patchItemInArray;
|
|
10895
10942
|
exports.penaltyTypeField = penaltyTypeField;
|
|
10896
10943
|
exports.updateItemInArray = updateItemInArray;
|