@mtgame/core 0.0.18 → 0.0.20
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/hockey-game-api.d.ts +2 -0
- package/bundles/mtgame-core.umd.js +26 -0
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +1 -1
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/api/hockey-game-api.js +18 -2
- package/esm2015/models/util.js +7 -1
- package/esm5/api/hockey-game-api.js +22 -2
- package/esm5/models/util.js +7 -1
- package/fesm2015/mtgame-core.js +22 -0
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +26 -0
- package/fesm5/mtgame-core.js.map +1 -1
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/mtgame-core.js
CHANGED
|
@@ -114,12 +114,18 @@ function enumField(enumClass) {
|
|
|
114
114
|
function penaltyTypeField() {
|
|
115
115
|
return {
|
|
116
116
|
toFront: function (data) {
|
|
117
|
+
if (!data) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
117
120
|
if (typeof data === 'object') {
|
|
118
121
|
return data;
|
|
119
122
|
}
|
|
120
123
|
return HockeyPenaltyTypes.find(function (item) { return item.id === data; });
|
|
121
124
|
},
|
|
122
125
|
toBack: function (data) {
|
|
126
|
+
if (!data) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
123
129
|
if (typeof data === 'object') {
|
|
124
130
|
return data.id;
|
|
125
131
|
}
|
|
@@ -2657,6 +2663,26 @@ var HockeyGameApi = /** @class */ (function () {
|
|
|
2657
2663
|
});
|
|
2658
2664
|
});
|
|
2659
2665
|
};
|
|
2666
|
+
HockeyGameApi.prototype.downloadProtocol = function (gameId, format) {
|
|
2667
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2668
|
+
return __generator(this, function (_a) {
|
|
2669
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_hockey_game/" + gameId + "/game_protocol/", {
|
|
2670
|
+
params: new HttpParams().set('file_type', format),
|
|
2671
|
+
responseType: 'blob'
|
|
2672
|
+
}).toPromise()];
|
|
2673
|
+
});
|
|
2674
|
+
});
|
|
2675
|
+
};
|
|
2676
|
+
HockeyGameApi.prototype.downloadApplication = function (gameId, format, type) {
|
|
2677
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2678
|
+
return __generator(this, function (_a) {
|
|
2679
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament_hockey_game/" + gameId + "/game_application_file/", {
|
|
2680
|
+
params: new HttpParams().set('file_type', format).set('application_type', type),
|
|
2681
|
+
responseType: 'blob'
|
|
2682
|
+
}).toPromise()];
|
|
2683
|
+
});
|
|
2684
|
+
});
|
|
2685
|
+
};
|
|
2660
2686
|
HockeyGameApi.ctorParameters = function () { return [
|
|
2661
2687
|
{ type: HttpClient },
|
|
2662
2688
|
{ type: ConfigService }
|