@mtgame/core 0.1.83 → 0.1.86

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.
@@ -97,6 +97,7 @@ export declare class TournamentApi {
97
97
  getPlayoffGames(playoffId: number, playoffNumber?: string): Promise<Game[]>;
98
98
  getGamesStages(tournamentId: number): Promise<GameTimelineStages>;
99
99
  getGames(tournamentId: number, page: number, size: number, filters?: TournamentGamesFilters): Promise<PaginatedResponse<Game[]>>;
100
+ getGamesDates(tournamentId: number): Promise<any>;
100
101
  getGroups(tournamentId: number): Promise<TournamentGroup[]>;
101
102
  getTeams(tournamentId: number, groupId?: number): Promise<TournamentTeam[]>;
102
103
  getStageTeams(tournamentId: number): Promise<TournamentStageTeam[]>;
@@ -2996,6 +2996,53 @@
2996
2996
  enumerable: false,
2997
2997
  configurable: true
2998
2998
  });
2999
+ Object.defineProperty(BasketballStatistic.prototype, "onePointsPercent", {
3000
+ get: function () {
3001
+ if (!this.onePointsMade || !this.onePointAttempts) {
3002
+ return 0;
3003
+ }
3004
+ return Math.round(1000 * this.onePointsMade / this.onePointAttempts) / 10;
3005
+ },
3006
+ enumerable: false,
3007
+ configurable: true
3008
+ });
3009
+ Object.defineProperty(BasketballStatistic.prototype, "twoPointsPercent", {
3010
+ get: function () {
3011
+ if (!this.twoPointsMade || !this.twoPointAttempts) {
3012
+ return 0;
3013
+ }
3014
+ return Math.round(1000 * this.twoPointsMade / this.twoPointAttempts) / 10;
3015
+ },
3016
+ enumerable: false,
3017
+ configurable: true
3018
+ });
3019
+ Object.defineProperty(BasketballStatistic.prototype, "threePointsPercent", {
3020
+ get: function () {
3021
+ if (!this.threePointsMade || !this.threePointAttempts) {
3022
+ return 0;
3023
+ }
3024
+ return Math.round(1000 * this.threePointsMade / this.threePointAttempts) / 10;
3025
+ },
3026
+ enumerable: false,
3027
+ configurable: true
3028
+ });
3029
+ Object.defineProperty(BasketballStatistic.prototype, "freeThrowsPercent", {
3030
+ get: function () {
3031
+ if (!this.freeThrowsMade || !this.freeThrowAttempts) {
3032
+ return 0;
3033
+ }
3034
+ return Math.round(1000 * this.freeThrowsMade / this.freeThrowAttempts) / 10;
3035
+ },
3036
+ enumerable: false,
3037
+ configurable: true
3038
+ });
3039
+ Object.defineProperty(BasketballStatistic.prototype, "totalRebounds", {
3040
+ get: function () {
3041
+ return Math.floor(10 * ((this.offensiveRebounds || 0) + (this.defensiveRebounds || 0))) / 10;
3042
+ },
3043
+ enumerable: false,
3044
+ configurable: true
3045
+ });
2999
3046
  BasketballStatistic.toFront = function (data) { };
3000
3047
  BasketballStatistic.toBack = function (data) { };
3001
3048
  return BasketballStatistic;
@@ -3107,6 +3154,53 @@
3107
3154
  enumerable: false,
3108
3155
  configurable: true
3109
3156
  });
3157
+ Object.defineProperty(BasketballGameStatistic.prototype, "onePointsPercent", {
3158
+ get: function () {
3159
+ if (!this.onePointsMade || !this.onePointAttempts) {
3160
+ return 0;
3161
+ }
3162
+ return Math.round(1000 * this.onePointsMade / this.onePointAttempts) / 10;
3163
+ },
3164
+ enumerable: false,
3165
+ configurable: true
3166
+ });
3167
+ Object.defineProperty(BasketballGameStatistic.prototype, "twoPointsPercent", {
3168
+ get: function () {
3169
+ if (!this.twoPointsMade || !this.twoPointAttempts) {
3170
+ return 0;
3171
+ }
3172
+ return Math.round(1000 * this.twoPointsMade / this.twoPointAttempts) / 10;
3173
+ },
3174
+ enumerable: false,
3175
+ configurable: true
3176
+ });
3177
+ Object.defineProperty(BasketballGameStatistic.prototype, "threePointsPercent", {
3178
+ get: function () {
3179
+ if (!this.threePointsMade || !this.threePointAttempts) {
3180
+ return 0;
3181
+ }
3182
+ return Math.round(1000 * this.threePointsMade / this.threePointAttempts) / 10;
3183
+ },
3184
+ enumerable: false,
3185
+ configurable: true
3186
+ });
3187
+ Object.defineProperty(BasketballGameStatistic.prototype, "freeThrowsPercent", {
3188
+ get: function () {
3189
+ if (!this.freeThrowsMade || !this.freeThrowAttempts) {
3190
+ return 0;
3191
+ }
3192
+ return Math.round(1000 * this.freeThrowsMade / this.freeThrowAttempts) / 10;
3193
+ },
3194
+ enumerable: false,
3195
+ configurable: true
3196
+ });
3197
+ Object.defineProperty(BasketballGameStatistic.prototype, "totalRebounds", {
3198
+ get: function () {
3199
+ return Math.floor(10 * ((this.offensiveRebounds || 0) + (this.defensiveRebounds || 0))) / 10;
3200
+ },
3201
+ enumerable: false,
3202
+ configurable: true
3203
+ });
3110
3204
  return BasketballGameStatistic;
3111
3205
  }(BaseModel));
3112
3206
  __decorate([
@@ -3958,6 +4052,26 @@
3958
4052
  enumerable: false,
3959
4053
  configurable: true
3960
4054
  });
4055
+ Object.defineProperty(HockeyGameStatistic.prototype, "goalsPercent", {
4056
+ get: function () {
4057
+ if (!this.totalGoals || !this.totalShots) {
4058
+ return 0;
4059
+ }
4060
+ return Math.round(1000 * this.totalGoals / this.totalShots) / 10;
4061
+ },
4062
+ enumerable: false,
4063
+ configurable: true
4064
+ });
4065
+ Object.defineProperty(HockeyGameStatistic.prototype, "faceOffPercent", {
4066
+ get: function () {
4067
+ if (!this.faceOffWins || !this.faceOffs) {
4068
+ return 0;
4069
+ }
4070
+ return Math.round(1000 * this.faceOffWins / this.faceOffs) / 10;
4071
+ },
4072
+ enumerable: false,
4073
+ configurable: true
4074
+ });
3961
4075
  HockeyGameStatistic.toFront = function (data) { };
3962
4076
  HockeyGameStatistic.toBack = function (data) { };
3963
4077
  return HockeyGameStatistic;
@@ -4406,7 +4520,7 @@
4406
4520
  });
4407
4521
  Object.defineProperty(FootballGameStatistic.prototype, "penaltyGoalsPercent", {
4408
4522
  get: function () {
4409
- if (!this.penaltyAttempts || !this.penaltyGoals) {
4523
+ if (!this.penalties || !this.penaltyGoals) {
4410
4524
  return 0;
4411
4525
  }
4412
4526
  return Math.round(1000 * this.penaltyGoals / this.penalties) / 10;
@@ -4423,7 +4537,7 @@
4423
4537
  });
4424
4538
  Object.defineProperty(FootballGameStatistic.prototype, "smallPenaltyGoalsPercent", {
4425
4539
  get: function () {
4426
- if (!this.smallPenaltyAttempts || !this.smallPenaltyGoals) {
4540
+ if (!this.smallPenalties || !this.smallPenaltyGoals) {
4427
4541
  return 0;
4428
4542
  }
4429
4543
  return Math.round(1000 * this.smallPenaltyGoals / this.smallPenalties) / 10;
@@ -4943,14 +5057,14 @@
4943
5057
  });
4944
5058
  Object.defineProperty(HandballGameStatistic.prototype, "shots", {
4945
5059
  get: function () {
4946
- return (this.shotMisses || 0) + (this.shotsOnGoal || 0) + (this.shotsBlocked || 0);
5060
+ return Math.floor(10 * ((this.shotMisses || 0) + (this.shotsOnGoal || 0) + (this.shotsBlocked || 0))) / 10;
4947
5061
  },
4948
5062
  enumerable: false,
4949
5063
  configurable: true
4950
5064
  });
4951
5065
  Object.defineProperty(HandballGameStatistic.prototype, "totalGoals", {
4952
5066
  get: function () {
4953
- return (this.goals || 0) + (this.penaltyGoals || 0);
5067
+ return Math.floor(10 * ((this.goals || 0) + (this.penaltyGoals || 0))) / 10;
4954
5068
  },
4955
5069
  enumerable: false,
4956
5070
  configurable: true
@@ -4977,7 +5091,7 @@
4977
5091
  });
4978
5092
  Object.defineProperty(HandballGameStatistic.prototype, "penaltyShots", {
4979
5093
  get: function () {
4980
- return (this.penaltyShotsOnGoal || 0) + (this.penaltyMisses || 0);
5094
+ return Math.floor(10 * ((this.penaltyShotsOnGoal || 0) + (this.penaltyMisses || 0))) / 10;
4981
5095
  },
4982
5096
  enumerable: false,
4983
5097
  configurable: true
@@ -4994,28 +5108,28 @@
4994
5108
  });
4995
5109
  Object.defineProperty(HandballGameStatistic.prototype, "shotsAgainst", {
4996
5110
  get: function () {
4997
- return (this.saves || 0) + (this.goalsAgainst || 0);
5111
+ return Math.floor(10 * ((this.saves || 0) + (this.goalsAgainst || 0))) / 10;
4998
5112
  },
4999
5113
  enumerable: false,
5000
5114
  configurable: true
5001
5115
  });
5002
5116
  Object.defineProperty(HandballGameStatistic.prototype, "penaltyShotsAgainst", {
5003
5117
  get: function () {
5004
- return (this.penaltySaves || 0) + (this.penaltyGoalsAgainst || 0);
5118
+ return Math.floor(10 * ((this.penaltySaves || 0) + (this.penaltyGoalsAgainst || 0))) / 10;
5005
5119
  },
5006
5120
  enumerable: false,
5007
5121
  configurable: true
5008
5122
  });
5009
5123
  Object.defineProperty(HandballGameStatistic.prototype, "totalGoalsAgainst", {
5010
5124
  get: function () {
5011
- return (this.goalsAgainst || 0) + (this.penaltyGoalsAgainst || 0);
5125
+ return Math.floor(10 * ((this.goalsAgainst || 0) + (this.penaltyGoalsAgainst || 0))) / 10;
5012
5126
  },
5013
5127
  enumerable: false,
5014
5128
  configurable: true
5015
5129
  });
5016
5130
  Object.defineProperty(HandballGameStatistic.prototype, "totalSaves", {
5017
5131
  get: function () {
5018
- return (this.saves || 0) + (this.penaltySaves || 0);
5132
+ return Math.floor(10 * ((this.saves || 0) + (this.penaltySaves || 0))) / 10;
5019
5133
  },
5020
5134
  enumerable: false,
5021
5135
  configurable: true
@@ -5934,6 +6048,16 @@
5934
6048
  });
5935
6049
  });
5936
6050
  };
6051
+ TournamentApi.prototype.getGamesDates = function (tournamentId) {
6052
+ return __awaiter(this, void 0, void 0, function () {
6053
+ return __generator(this, function (_a) {
6054
+ return [2 /*return*/, this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/tournament/" + tournamentId + "/games_dates/", { observe: 'response' }).pipe(operators.map(function (result) { return ({
6055
+ total: +result.headers.get('X-Page-Count'),
6056
+ data: result.body
6057
+ }); })).toPromise()];
6058
+ });
6059
+ });
6060
+ };
5937
6061
  TournamentApi.prototype.getGroups = function (tournamentId) {
5938
6062
  return __awaiter(this, void 0, void 0, function () {
5939
6063
  return __generator(this, function (_a) {