@mtgame/core 0.1.96 → 0.1.98
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 +49 -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 +32 -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 +12 -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,39 @@
|
|
|
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
|
+
city: 'city',
|
|
8845
|
+
},
|
|
8846
|
+
relation: {
|
|
8847
|
+
birthDate: DateField,
|
|
8848
|
+
gender: enumField(exports.UserGender),
|
|
8849
|
+
}
|
|
8850
|
+
})
|
|
8851
|
+
], exports.TournamentJoin1x1Data);
|
|
8852
|
+
|
|
8820
8853
|
exports.TournamentJoin1x1Status = void 0;
|
|
8821
8854
|
(function (TournamentJoin1x1Status) {
|
|
8822
8855
|
TournamentJoin1x1Status[TournamentJoin1x1Status["not_sent"] = 1] = "not_sent";
|
|
@@ -8859,10 +8892,10 @@
|
|
|
8859
8892
|
});
|
|
8860
8893
|
});
|
|
8861
8894
|
};
|
|
8862
|
-
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId) {
|
|
8895
|
+
TournamentJoinApi.prototype.join1x1Tournament = function (tournamentId, additionalData) {
|
|
8863
8896
|
return __awaiter(this, void 0, void 0, function () {
|
|
8864
8897
|
return __generator(this, function (_a) {
|
|
8865
|
-
return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1/",
|
|
8898
|
+
return [2 /*return*/, this.httpClient.post(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/join_1x1/", exports.TournamentJoin1x1Data.toBack(additionalData))
|
|
8866
8899
|
.pipe(operators.map(function (data) { return exports.TournamentInvite.toFront(data); }))
|
|
8867
8900
|
.toPromise()];
|
|
8868
8901
|
});
|
|
@@ -10610,6 +10643,19 @@
|
|
|
10610
10643
|
return null;
|
|
10611
10644
|
}
|
|
10612
10645
|
|
|
10646
|
+
function parseDate(input, format) {
|
|
10647
|
+
if (format === void 0) { format = 'yyyy-mm-dd'; }
|
|
10648
|
+
var parts = input.match(/(\d+)/g);
|
|
10649
|
+
var i = 0;
|
|
10650
|
+
var result = {};
|
|
10651
|
+
// extract date-part indexes from the format
|
|
10652
|
+
format.replace(/(yyyy|dd|mm)/g, function (part) {
|
|
10653
|
+
result[part] = +parts[i++];
|
|
10654
|
+
return '';
|
|
10655
|
+
});
|
|
10656
|
+
return new Date(result.yyyy, result.mm - 1, result.dd);
|
|
10657
|
+
}
|
|
10658
|
+
|
|
10613
10659
|
function isTouchDevice() {
|
|
10614
10660
|
var prefixes = ' -webkit- -moz- -o- -ms- '.split(' ');
|
|
10615
10661
|
var mq = function (q) {
|
|
@@ -10892,6 +10938,7 @@
|
|
|
10892
10938
|
exports.listField = listField;
|
|
10893
10939
|
exports.markFormGroupTouched = markFormGroupTouched;
|
|
10894
10940
|
exports.minLengthArrayValidator = minLengthArrayValidator;
|
|
10941
|
+
exports.parseDate = parseDate;
|
|
10895
10942
|
exports.patchItemInArray = patchItemInArray;
|
|
10896
10943
|
exports.penaltyTypeField = penaltyTypeField;
|
|
10897
10944
|
exports.updateItemInArray = updateItemInArray;
|