@mtgame/core 0.1.96 → 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 +2 -1
- package/bundles/mtgame-core.umd.js +48 -2
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/tournament-join-api.js +4 -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 +42 -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,6 +4,7 @@ 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,
|
|
@@ -17,6 +18,6 @@ export declare class TournamentJoinApi {
|
|
|
17
18
|
getTeamsForJoin(tournamentId: number): Promise<TournamentJoinTeam[]>;
|
|
18
19
|
getTeamUsers(teamId: number): Promise<TeamUser[]>;
|
|
19
20
|
joinTournament(tournamentId: number, teamId: number, invites: TournamentTeamUserInvite[]): Promise<TournamentInvite>;
|
|
20
|
-
join1x1Tournament(tournamentId: number): Promise<TournamentInvite>;
|
|
21
|
+
join1x1Tournament(tournamentId: number, additionalData: TournamentJoin1x1Data): Promise<TournamentInvite>;
|
|
21
22
|
join1x1TournamentStatus(tournamentId: number): Promise<TournamentJoin1x1Status>;
|
|
22
23
|
}
|
|
@@ -8817,6 +8817,38 @@
|
|
|
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";
|
|
@@ -8859,10 +8891,10 @@
|
|
|
8859
8891
|
});
|
|
8860
8892
|
});
|
|
8861
8893
|
};
|
|
8862
|
-
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId) {
|
|
8894
|
+
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId, additionalData) {
|
|
8863
8895
|
return __awaiter(this, void 0, void 0, function () {
|
|
8864
8896
|
return __generator(this, function (_a) {
|
|
8865
|
-
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))
|
|
8866
8898
|
.pipe(operators.map(function (data) { return exports.TournamentInvite.toFront(data); }))
|
|
8867
8899
|
.toPromise()];
|
|
8868
8900
|
});
|
|
@@ -10610,6 +10642,19 @@
|
|
|
10610
10642
|
return null;
|
|
10611
10643
|
}
|
|
10612
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
|
+
|
|
10613
10658
|
function isTouchDevice() {
|
|
10614
10659
|
var prefixes = ' -webkit- -moz- -o- -ms- '.split(' ');
|
|
10615
10660
|
var mq = function (q) {
|
|
@@ -10892,6 +10937,7 @@
|
|
|
10892
10937
|
exports.listField = listField;
|
|
10893
10938
|
exports.markFormGroupTouched = markFormGroupTouched;
|
|
10894
10939
|
exports.minLengthArrayValidator = minLengthArrayValidator;
|
|
10940
|
+
exports.parseDate = parseDate;
|
|
10895
10941
|
exports.patchItemInArray = patchItemInArray;
|
|
10896
10942
|
exports.penaltyTypeField = penaltyTypeField;
|
|
10897
10943
|
exports.updateItemInArray = updateItemInArray;
|