@mtgame/core 0.2.68 → 0.2.70
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-api.d.ts +2 -0
- package/bundles/mtgame-core.umd.js +229 -0
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/api/tournament-api.js +12 -1
- package/esm2015/models/game.js +16 -1
- package/esm2015/models/tournament.js +5 -1
- package/esm2015/models/wrestball-game-config.js +42 -0
- package/esm2015/models/wrestball-statistic.js +123 -0
- package/esm2015/mtgame-core.js +2 -1
- package/fesm2015/mtgame-core.js +181 -1
- package/fesm2015/mtgame-core.js.map +1 -1
- package/models/game.d.ts +4 -0
- package/models/tournament.d.ts +3 -0
- package/models/wrestball-game-config.d.ts +21 -0
- package/models/wrestball-statistic.d.ts +72 -0
- package/mtgame-core.d.ts +1 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
package/api/tournament-api.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { GameWaterpoloPosition } from '../models/waterpolo-profile';
|
|
|
32
32
|
import { GameBasketballPosition } from '../models/basketball-profile';
|
|
33
33
|
import { GameVolleyballPosition } from '../models/volleyball-profile';
|
|
34
34
|
import { GameRugbyPosition } from '../models/rugby-profile';
|
|
35
|
+
import { WrestballStatistic } from '../models/wrestball-statistic';
|
|
35
36
|
export interface TournamentGamesFilters {
|
|
36
37
|
tournamentIds?: number[];
|
|
37
38
|
tournamentSeasonId?: number;
|
|
@@ -165,6 +166,7 @@ export declare class TournamentApi {
|
|
|
165
166
|
getHandballStatistic(filters?: StatisticFilters): Promise<PaginatedResponse<HandballStatistic[]>>;
|
|
166
167
|
getRugbyStatistic(filters?: StatisticFilters): Promise<PaginatedResponse<RugbyStatistic[]>>;
|
|
167
168
|
getWaterpoloStatistic(filters?: StatisticFilters): Promise<PaginatedResponse<WaterpoloStatistic[]>>;
|
|
169
|
+
getWrestballStatistic(filters?: StatisticFilters): Promise<PaginatedResponse<WrestballStatistic[]>>;
|
|
168
170
|
getTournamentTeamUsers(tournamentTeamId: number, includes?: string[]): Promise<TournamentTeamUser[]>;
|
|
169
171
|
myPermission(tournamentId: number): Promise<LeagueUserPermissions[]>;
|
|
170
172
|
getTournamentTeamTournaments(tournamentTeamId: number): Promise<Tournament[]>;
|
|
@@ -1620,6 +1620,10 @@
|
|
|
1620
1620
|
WaterpoloStatisticTypes[WaterpoloStatisticTypes["standard"] = 1] = "standard";
|
|
1621
1621
|
WaterpoloStatisticTypes[WaterpoloStatisticTypes["light"] = 2] = "light";
|
|
1622
1622
|
})(exports.WaterpoloStatisticTypes || (exports.WaterpoloStatisticTypes = {}));
|
|
1623
|
+
exports.WrestballStatisticTypes = void 0;
|
|
1624
|
+
(function (WrestballStatisticTypes) {
|
|
1625
|
+
WrestballStatisticTypes[WrestballStatisticTypes["standard"] = 1] = "standard";
|
|
1626
|
+
})(exports.WrestballStatisticTypes || (exports.WrestballStatisticTypes = {}));
|
|
1623
1627
|
exports.GameTimeTypes = void 0;
|
|
1624
1628
|
(function (GameTimeTypes) {
|
|
1625
1629
|
GameTimeTypes[GameTimeTypes["clean"] = 1] = "clean";
|
|
@@ -2426,6 +2430,49 @@
|
|
|
2426
2430
|
})
|
|
2427
2431
|
], exports.WaterpoloGameConfig);
|
|
2428
2432
|
|
|
2433
|
+
exports.ɵa = /** @class */ (function (_super) {
|
|
2434
|
+
__extends(WrestballGameConfig, _super);
|
|
2435
|
+
function WrestballGameConfig() {
|
|
2436
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2437
|
+
}
|
|
2438
|
+
WrestballGameConfig.toFront = function (data) { };
|
|
2439
|
+
WrestballGameConfig.toBack = function (data) { };
|
|
2440
|
+
return WrestballGameConfig;
|
|
2441
|
+
}(BaseModel));
|
|
2442
|
+
__decorate([
|
|
2443
|
+
ToFrontHook
|
|
2444
|
+
], exports.ɵa, "toFront", null);
|
|
2445
|
+
__decorate([
|
|
2446
|
+
ToBackHook
|
|
2447
|
+
], exports.ɵa, "toBack", null);
|
|
2448
|
+
exports.ɵa = __decorate([
|
|
2449
|
+
ModelInstance({
|
|
2450
|
+
mappingFields: {
|
|
2451
|
+
periods_count: 'periodsCount',
|
|
2452
|
+
period_time: 'periodTime',
|
|
2453
|
+
game_up_to_score: 'gameUpToScore',
|
|
2454
|
+
overtime_type: 'overtimeType',
|
|
2455
|
+
overtime_time: 'overtimeTime',
|
|
2456
|
+
overtime_score: 'overtimeScore',
|
|
2457
|
+
max_game_players: 'maxGamePlayers',
|
|
2458
|
+
timeout_count: 'timeoutCount',
|
|
2459
|
+
overtime_timeout_count: 'overtimeTimeoutCount',
|
|
2460
|
+
timeout_time: 'timeoutTime',
|
|
2461
|
+
statistic_type: 'statisticType',
|
|
2462
|
+
shot_clock_enabled: 'shotClockEnabled',
|
|
2463
|
+
game_time_type: 'gameTimeType',
|
|
2464
|
+
timer_type: 'timerType',
|
|
2465
|
+
wrestler_scrums_count: 'wrestlerScrumsCount'
|
|
2466
|
+
},
|
|
2467
|
+
relation: {
|
|
2468
|
+
overtimeType: enumField(exports.OvertimeTypes),
|
|
2469
|
+
statisticType: enumField(exports.WrestballStatisticTypes),
|
|
2470
|
+
gameTimeType: enumField(exports.GameTimeTypes),
|
|
2471
|
+
timerType: enumField(exports.TimerTypes),
|
|
2472
|
+
}
|
|
2473
|
+
})
|
|
2474
|
+
], exports.ɵa);
|
|
2475
|
+
|
|
2429
2476
|
exports.GameStatuses = void 0;
|
|
2430
2477
|
(function (GameStatuses) {
|
|
2431
2478
|
GameStatuses[GameStatuses["open"] = 1] = "open";
|
|
@@ -2609,6 +2656,22 @@
|
|
|
2609
2656
|
enumerable: false,
|
|
2610
2657
|
configurable: true
|
|
2611
2658
|
});
|
|
2659
|
+
Object.defineProperty(Game.prototype, "wrestballGameConfig", {
|
|
2660
|
+
get: function () {
|
|
2661
|
+
if (this._wrestballGameConfig && this._wrestballGameConfig.periodsCount) {
|
|
2662
|
+
return this._wrestballGameConfig;
|
|
2663
|
+
}
|
|
2664
|
+
if (this.gameConfig) {
|
|
2665
|
+
this._wrestballGameConfig = exports.ɵa.toFront(this.gameConfig);
|
|
2666
|
+
}
|
|
2667
|
+
return this._wrestballGameConfig;
|
|
2668
|
+
},
|
|
2669
|
+
set: function (value) {
|
|
2670
|
+
this._wrestballGameConfig = value;
|
|
2671
|
+
},
|
|
2672
|
+
enumerable: false,
|
|
2673
|
+
configurable: true
|
|
2674
|
+
});
|
|
2612
2675
|
Object.defineProperty(Game.prototype, "scoreByPeriodList", {
|
|
2613
2676
|
get: function () {
|
|
2614
2677
|
var _this = this;
|
|
@@ -2733,6 +2796,7 @@
|
|
|
2733
2796
|
handball_game_config: 'handballGameConfig',
|
|
2734
2797
|
rugby_game_config: 'rugbyGameConfig',
|
|
2735
2798
|
waterpolo_game_config: 'waterpoloGameConfig',
|
|
2799
|
+
wrestball_game_config: 'wrestballGameConfig',
|
|
2736
2800
|
score_by_period: 'scoreByPeriod',
|
|
2737
2801
|
playoff_stage: 'playoffStage',
|
|
2738
2802
|
playoff_round: 'playoffRound',
|
|
@@ -2761,6 +2825,7 @@
|
|
|
2761
2825
|
handballGameConfig: exports.HandballGameConfig,
|
|
2762
2826
|
rugbyGameConfig: exports.RugbyGameConfig,
|
|
2763
2827
|
waterpoloGameConfig: exports.WaterpoloGameConfig,
|
|
2828
|
+
wrestballGameConfig: exports.ɵa,
|
|
2764
2829
|
tournamentPlayoff: exports.Playoff,
|
|
2765
2830
|
tournamentCourt: exports.LeagueCourt,
|
|
2766
2831
|
media: listField(exports.MediaItem),
|
|
@@ -7339,6 +7404,157 @@
|
|
|
7339
7404
|
})
|
|
7340
7405
|
], exports.TournamentRound);
|
|
7341
7406
|
|
|
7407
|
+
var WrestballStatistic = /** @class */ (function (_super) {
|
|
7408
|
+
__extends(WrestballStatistic, _super);
|
|
7409
|
+
function WrestballStatistic() {
|
|
7410
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7411
|
+
}
|
|
7412
|
+
Object.defineProperty(WrestballStatistic.prototype, "totalFouls", {
|
|
7413
|
+
get: function () {
|
|
7414
|
+
return Math.floor(10 * ((this.personalFouls || 0))) / 10;
|
|
7415
|
+
},
|
|
7416
|
+
enumerable: false,
|
|
7417
|
+
configurable: true
|
|
7418
|
+
});
|
|
7419
|
+
Object.defineProperty(WrestballStatistic.prototype, "gameMinutes", {
|
|
7420
|
+
get: function () {
|
|
7421
|
+
return Math.floor(this.gameTime / 60);
|
|
7422
|
+
},
|
|
7423
|
+
enumerable: false,
|
|
7424
|
+
configurable: true
|
|
7425
|
+
});
|
|
7426
|
+
Object.defineProperty(WrestballStatistic.prototype, "tournamentTeamPoints", {
|
|
7427
|
+
get: function () {
|
|
7428
|
+
return this.tournamentTeam && this.tournamentTeam.points;
|
|
7429
|
+
},
|
|
7430
|
+
enumerable: false,
|
|
7431
|
+
configurable: true
|
|
7432
|
+
});
|
|
7433
|
+
Object.defineProperty(WrestballStatistic.prototype, "onePointsPercent", {
|
|
7434
|
+
get: function () {
|
|
7435
|
+
if (!this.onePointsMade || !this.onePointAttempts) {
|
|
7436
|
+
return 0;
|
|
7437
|
+
}
|
|
7438
|
+
return Math.round(1000 * this.onePointsMade / this.onePointAttempts) / 10;
|
|
7439
|
+
},
|
|
7440
|
+
enumerable: false,
|
|
7441
|
+
configurable: true
|
|
7442
|
+
});
|
|
7443
|
+
Object.defineProperty(WrestballStatistic.prototype, "twoPointsPercent", {
|
|
7444
|
+
get: function () {
|
|
7445
|
+
if (!this.twoPointsMade || !this.twoPointAttempts) {
|
|
7446
|
+
return 0;
|
|
7447
|
+
}
|
|
7448
|
+
return Math.round(1000 * this.twoPointsMade / this.twoPointAttempts) / 10;
|
|
7449
|
+
},
|
|
7450
|
+
enumerable: false,
|
|
7451
|
+
configurable: true
|
|
7452
|
+
});
|
|
7453
|
+
Object.defineProperty(WrestballStatistic.prototype, "threePointsPercent", {
|
|
7454
|
+
get: function () {
|
|
7455
|
+
if (!this.threePointsMade || !this.threePointAttempts) {
|
|
7456
|
+
return 0;
|
|
7457
|
+
}
|
|
7458
|
+
return Math.round(1000 * this.threePointsMade / this.threePointAttempts) / 10;
|
|
7459
|
+
},
|
|
7460
|
+
enumerable: false,
|
|
7461
|
+
configurable: true
|
|
7462
|
+
});
|
|
7463
|
+
Object.defineProperty(WrestballStatistic.prototype, "freeThrowsPercent", {
|
|
7464
|
+
get: function () {
|
|
7465
|
+
if (!this.freeThrowsMade || !this.freeThrowAttempts) {
|
|
7466
|
+
return 0;
|
|
7467
|
+
}
|
|
7468
|
+
return Math.round(1000 * this.freeThrowsMade / this.freeThrowAttempts) / 10;
|
|
7469
|
+
},
|
|
7470
|
+
enumerable: false,
|
|
7471
|
+
configurable: true
|
|
7472
|
+
});
|
|
7473
|
+
Object.defineProperty(WrestballStatistic.prototype, "totalRebounds", {
|
|
7474
|
+
get: function () {
|
|
7475
|
+
return Math.floor(10 * ((this.offensiveRebounds || 0) + (this.defensiveRebounds || 0))) / 10;
|
|
7476
|
+
},
|
|
7477
|
+
enumerable: false,
|
|
7478
|
+
configurable: true
|
|
7479
|
+
});
|
|
7480
|
+
WrestballStatistic.toFront = function (data) { };
|
|
7481
|
+
WrestballStatistic.toBack = function (data) { };
|
|
7482
|
+
return WrestballStatistic;
|
|
7483
|
+
}(BaseModel));
|
|
7484
|
+
__decorate([
|
|
7485
|
+
ToFrontHook
|
|
7486
|
+
], WrestballStatistic, "toFront", null);
|
|
7487
|
+
__decorate([
|
|
7488
|
+
ToBackHook
|
|
7489
|
+
], WrestballStatistic, "toBack", null);
|
|
7490
|
+
WrestballStatistic = __decorate([
|
|
7491
|
+
ModelInstance({
|
|
7492
|
+
mappingFields: {
|
|
7493
|
+
league_player: 'leaguePlayer',
|
|
7494
|
+
tournament_team_user: 'tournamentTeamUser',
|
|
7495
|
+
team: 'team',
|
|
7496
|
+
team_user: 'teamUser',
|
|
7497
|
+
user: 'user',
|
|
7498
|
+
tournament_team: 'tournamentTeam',
|
|
7499
|
+
month: 'month',
|
|
7500
|
+
win_lose: 'winLose',
|
|
7501
|
+
games_count: 'gamesCount',
|
|
7502
|
+
won_games_count: 'wonGamesCount',
|
|
7503
|
+
team_score_sum: 'teamScoreSum',
|
|
7504
|
+
team_missed_sum: 'teamMissedSum',
|
|
7505
|
+
tournament_points: 'tournamentPoints',
|
|
7506
|
+
points: 'points',
|
|
7507
|
+
two_points_made: 'twoPointsMade',
|
|
7508
|
+
three_points_made: 'threePointsMade',
|
|
7509
|
+
free_throws_made: 'freeThrowsMade',
|
|
7510
|
+
one_points_made: 'onePointsMade',
|
|
7511
|
+
two_point_attempts: 'twoPointAttempts',
|
|
7512
|
+
three_point_attempts: 'threePointAttempts',
|
|
7513
|
+
free_throw_attempts: 'freeThrowAttempts',
|
|
7514
|
+
one_point_attempts: 'onePointAttempts',
|
|
7515
|
+
two_point_percent: 'twoPointPercent',
|
|
7516
|
+
three_point_percent: 'threePointPercent',
|
|
7517
|
+
free_throw_percent: 'freeThrowPercent',
|
|
7518
|
+
one_point_percent: 'onePointPercent',
|
|
7519
|
+
assists: 'assists',
|
|
7520
|
+
blocks: 'blocks',
|
|
7521
|
+
rebounds: 'rebounds',
|
|
7522
|
+
offensive_rebounds: 'offensiveRebounds',
|
|
7523
|
+
defensive_rebounds: 'defensiveRebounds',
|
|
7524
|
+
steals: 'steals',
|
|
7525
|
+
turnovers: 'turnovers',
|
|
7526
|
+
personal_fouls: 'personalFouls',
|
|
7527
|
+
drawn_fouls: 'drawnFouls',
|
|
7528
|
+
wrestler_scrums_won: 'wrestlerScrumsWon',
|
|
7529
|
+
wrestler_scrums_lost: 'wrestlerScrumsLost',
|
|
7530
|
+
wrestler_scrums_tie: 'wrestlerScrumsTie',
|
|
7531
|
+
wrestler_scrum_points: 'wrestlerScrumPoints',
|
|
7532
|
+
scrums_won: 'scrumsWon',
|
|
7533
|
+
scrums_lost: 'scrumsLost',
|
|
7534
|
+
scrums_tie: 'scrumsTie',
|
|
7535
|
+
scrum_points: 'scrumPoints',
|
|
7536
|
+
yellow_cards: 'yellowCards',
|
|
7537
|
+
red_cards: 'redCards',
|
|
7538
|
+
wrestler_scrums: 'wrestlerScrums',
|
|
7539
|
+
wrestler_scrums_won_percent: 'wrestlerScrumsWonPercent',
|
|
7540
|
+
scrums: 'scrums',
|
|
7541
|
+
scrums_won_percent: 'scrumsWonPercent',
|
|
7542
|
+
game_time: 'gameTime',
|
|
7543
|
+
newbie: 'newbie',
|
|
7544
|
+
rank: 'rank',
|
|
7545
|
+
},
|
|
7546
|
+
relation: {
|
|
7547
|
+
leaguePlayer: exports.LeaguePlayer,
|
|
7548
|
+
tournamentTeamUser: exports.TournamentTeamUser,
|
|
7549
|
+
team: exports.Team,
|
|
7550
|
+
teamUser: exports.TeamUser,
|
|
7551
|
+
user: exports.User,
|
|
7552
|
+
tournamentTeam: exports.TournamentTeam,
|
|
7553
|
+
month: DateField
|
|
7554
|
+
}
|
|
7555
|
+
})
|
|
7556
|
+
], WrestballStatistic);
|
|
7557
|
+
|
|
7342
7558
|
var TournamentApi = /** @class */ (function () {
|
|
7343
7559
|
function TournamentApi(httpClient, configService) {
|
|
7344
7560
|
this.httpClient = httpClient;
|
|
@@ -7821,6 +8037,19 @@
|
|
|
7821
8037
|
});
|
|
7822
8038
|
});
|
|
7823
8039
|
};
|
|
8040
|
+
TournamentApi.prototype.getWrestballStatistic = function (filters) {
|
|
8041
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8042
|
+
var params;
|
|
8043
|
+
return __generator(this, function (_a) {
|
|
8044
|
+
params = new i1.HttpParams();
|
|
8045
|
+
params = applyStatisticFilters(filters, params);
|
|
8046
|
+
return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/wrestball_statistic/", { params: params, observe: 'response' }).pipe(operators.map(function (result) { return ({
|
|
8047
|
+
total: +result.headers.get('X-Page-Count'),
|
|
8048
|
+
data: WrestballStatistic.toFront(result.body)
|
|
8049
|
+
}); })).toPromise()];
|
|
8050
|
+
});
|
|
8051
|
+
});
|
|
8052
|
+
};
|
|
7824
8053
|
TournamentApi.prototype.getTournamentTeamUsers = function (tournamentTeamId, includes) {
|
|
7825
8054
|
if (includes === void 0) { includes = []; }
|
|
7826
8055
|
return __awaiter(this, void 0, void 0, function () {
|