@valolytics/ts-valorant-dtos 11.0.1

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.
Files changed (115) hide show
  1. package/dist/dtos/agents.json +1758 -0
  2. package/dist/dtos/buddies.json +12782 -0
  3. package/dist/dtos/bundles.json +3362 -0
  4. package/dist/dtos/ceremonies.json +32 -0
  5. package/dist/dtos/competitiveTiers.json +1549 -0
  6. package/dist/dtos/contentTiers.json +57 -0
  7. package/dist/dtos/contracts.json +33904 -0
  8. package/dist/dtos/currencies.json +38 -0
  9. package/dist/dtos/events.json +106 -0
  10. package/dist/dtos/gameModes.json +399 -0
  11. package/dist/dtos/gears.json +102 -0
  12. package/dist/dtos/levelBorders.json +202 -0
  13. package/dist/dtos/maps.json +3186 -0
  14. package/dist/dtos/playerCards.json +8439 -0
  15. package/dist/dtos/playerTitles.json +2158 -0
  16. package/dist/dtos/roles.json +30 -0
  17. package/dist/dtos/seasons.json +452 -0
  18. package/dist/dtos/sprays.json +17436 -0
  19. package/dist/dtos/themes.json +2543 -0
  20. package/dist/dtos/weapons.json +55152 -0
  21. package/dist/index.d.ts +30 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +64 -0
  24. package/dist/logger/index.d.ts +3 -0
  25. package/dist/logger/index.d.ts.map +1 -0
  26. package/dist/logger/index.js +8 -0
  27. package/dist/models/account.model.d.ts +9 -0
  28. package/dist/models/account.model.d.ts.map +1 -0
  29. package/dist/models/account.model.js +13 -0
  30. package/dist/models/activeShard.model.d.ts +7 -0
  31. package/dist/models/activeShard.model.d.ts.map +1 -0
  32. package/dist/models/activeShard.model.js +11 -0
  33. package/dist/models/agent.model.d.ts +59 -0
  34. package/dist/models/agent.model.d.ts.map +1 -0
  35. package/dist/models/agent.model.js +78 -0
  36. package/dist/models/buddy.model.d.ts +21 -0
  37. package/dist/models/buddy.model.d.ts.map +1 -0
  38. package/dist/models/buddy.model.js +27 -0
  39. package/dist/models/bundle.model.d.ts +15 -0
  40. package/dist/models/bundle.model.d.ts.map +1 -0
  41. package/dist/models/bundle.model.js +21 -0
  42. package/dist/models/ceremony.model.d.ts +7 -0
  43. package/dist/models/ceremony.model.d.ts.map +1 -0
  44. package/dist/models/ceremony.model.js +11 -0
  45. package/dist/models/competitiveTier.model.d.ts +21 -0
  46. package/dist/models/competitiveTier.model.d.ts.map +1 -0
  47. package/dist/models/competitiveTier.model.js +27 -0
  48. package/dist/models/contentTier.model.d.ts +13 -0
  49. package/dist/models/contentTier.model.d.ts.map +1 -0
  50. package/dist/models/contentTier.model.js +17 -0
  51. package/dist/models/contract.model.d.ts +43 -0
  52. package/dist/models/contract.model.d.ts.map +1 -0
  53. package/dist/models/contract.model.js +55 -0
  54. package/dist/models/currency.model.d.ts +10 -0
  55. package/dist/models/currency.model.d.ts.map +1 -0
  56. package/dist/models/currency.model.js +14 -0
  57. package/dist/models/event.model.d.ts +10 -0
  58. package/dist/models/event.model.d.ts.map +1 -0
  59. package/dist/models/event.model.js +14 -0
  60. package/dist/models/gameMode.model.d.ts +29 -0
  61. package/dist/models/gameMode.model.d.ts.map +1 -0
  62. package/dist/models/gameMode.model.js +37 -0
  63. package/dist/models/gear.model.d.ts +18 -0
  64. package/dist/models/gear.model.d.ts.map +1 -0
  65. package/dist/models/gear.model.js +24 -0
  66. package/dist/models/levelBorder.model.d.ts +10 -0
  67. package/dist/models/levelBorder.model.d.ts.map +1 -0
  68. package/dist/models/levelBorder.model.js +14 -0
  69. package/dist/models/location.model.d.ts +15 -0
  70. package/dist/models/location.model.d.ts.map +1 -0
  71. package/dist/models/location.model.js +28 -0
  72. package/dist/models/map.model.d.ts +31 -0
  73. package/dist/models/map.model.d.ts.map +1 -0
  74. package/dist/models/map.model.js +47 -0
  75. package/dist/models/match.model.d.ts +648 -0
  76. package/dist/models/match.model.d.ts.map +1 -0
  77. package/dist/models/match.model.js +506 -0
  78. package/dist/models/matchlist.model.d.ts +13 -0
  79. package/dist/models/matchlist.model.d.ts.map +1 -0
  80. package/dist/models/matchlist.model.js +22 -0
  81. package/dist/models/playerCard.model.d.ts +14 -0
  82. package/dist/models/playerCard.model.d.ts.map +1 -0
  83. package/dist/models/playerCard.model.js +18 -0
  84. package/dist/models/playerTitle.model.d.ts +9 -0
  85. package/dist/models/playerTitle.model.d.ts.map +1 -0
  86. package/dist/models/playerTitle.model.js +13 -0
  87. package/dist/models/role.model.d.ts +9 -0
  88. package/dist/models/role.model.d.ts.map +1 -0
  89. package/dist/models/role.model.js +13 -0
  90. package/dist/models/season.model.d.ts +11 -0
  91. package/dist/models/season.model.d.ts.map +1 -0
  92. package/dist/models/season.model.js +15 -0
  93. package/dist/models/shopData.model.d.ts +19 -0
  94. package/dist/models/shopData.model.d.ts.map +1 -0
  95. package/dist/models/shopData.model.js +25 -0
  96. package/dist/models/spray.model.d.ts +26 -0
  97. package/dist/models/spray.model.d.ts.map +1 -0
  98. package/dist/models/spray.model.js +32 -0
  99. package/dist/models/theme.model.d.ts +9 -0
  100. package/dist/models/theme.model.d.ts.map +1 -0
  101. package/dist/models/theme.model.js +13 -0
  102. package/dist/models/version.model.d.ts +12 -0
  103. package/dist/models/version.model.d.ts.map +1 -0
  104. package/dist/models/version.model.js +16 -0
  105. package/dist/models/weapon.model.d.ts +100 -0
  106. package/dist/models/weapon.model.d.ts.map +1 -0
  107. package/dist/models/weapon.model.js +126 -0
  108. package/dist/scripts/fetch-data.d.ts +2 -0
  109. package/dist/scripts/fetch-data.d.ts.map +1 -0
  110. package/dist/scripts/fetch-data.js +75 -0
  111. package/dist/services/dtos.service.d.ts +184 -0
  112. package/dist/services/dtos.service.d.ts.map +1 -0
  113. package/dist/services/dtos.service.js +274 -0
  114. package/dist/tsconfig.tsbuildinfo +1 -0
  115. package/package.json +32 -0
@@ -0,0 +1,506 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Match = exports.MatchDto = exports.Round = exports.PlayerRoundStats = exports.AbilityEffects = exports.Economy = exports.Damage = exports.Kill = exports.FinishingDamage = exports.PlayerLocation = exports.Team = exports.Side = exports.Coach = exports.Player = exports.PlayerStats = exports.AbilityCasts = exports.MatchInfo = exports.PremierMatchInfo = void 0;
4
+ const dtos_service_js_1 = require("../services/dtos.service.js");
5
+ const agent_model_js_1 = require("./agent.model.js");
6
+ const map_model_js_1 = require("./map.model.js");
7
+ const weapon_model_js_1 = require("./weapon.model.js");
8
+ const location_model_js_1 = require("./location.model.js");
9
+ class PremierMatchInfo {
10
+ constructor(data) {
11
+ if (data === null || data === undefined) {
12
+ this.premierSeasonId = null;
13
+ this.premierEventId = null;
14
+ }
15
+ else {
16
+ this.premierSeasonId = data.premierSeasonId;
17
+ this.premierEventId = data.premierEventId;
18
+ }
19
+ }
20
+ }
21
+ exports.PremierMatchInfo = PremierMatchInfo;
22
+ class MatchInfo {
23
+ constructor(data) {
24
+ var _a;
25
+ this.matchId = data.matchId;
26
+ this.mapId = data.mapId;
27
+ this.gameVersion = data.gameVersion;
28
+ this.gameLengthMillis = data.gameLengthMillis;
29
+ this.region = data.region;
30
+ this.gameStartMillis = data.gameStartMillis;
31
+ this.provisioningFlowId = data.provisioningFlowId;
32
+ this.isCompleted = data.isCompleted;
33
+ this.customGameName = data.customGameName;
34
+ this.queueId = data.queueId;
35
+ this.gameMode = data.gameMode;
36
+ this.isRanked = data.isRanked;
37
+ this.seasonId = data.seasonId;
38
+ this.premierMatchInfo = new PremierMatchInfo(data.premierMatchInfo);
39
+ this.map = (_a = map_model_js_1.MapDto.getMap(data.mapId)) !== null && _a !== void 0 ? _a : null;
40
+ }
41
+ toJSON() {
42
+ var _a;
43
+ return {
44
+ matchId: this.matchId,
45
+ mapId: this.mapId,
46
+ gameVersion: this.gameVersion,
47
+ gameLengthMillis: this.gameLengthMillis,
48
+ region: this.region,
49
+ gameStartMillis: this.gameStartMillis,
50
+ provisioningFlowId: this.provisioningFlowId,
51
+ isCompleted: this.isCompleted,
52
+ customGameName: this.customGameName,
53
+ queueId: this.queueId,
54
+ gameMode: this.gameMode,
55
+ isRanked: this.isRanked,
56
+ seasonId: this.seasonId,
57
+ premierMatchInfo: this.premierMatchInfo,
58
+ map: (_a = this.map) === null || _a === void 0 ? void 0 : _a.displayName,
59
+ };
60
+ }
61
+ }
62
+ exports.MatchInfo = MatchInfo;
63
+ class AbilityCasts {
64
+ constructor(data) {
65
+ this.grenadeCasts = data.grenadeCasts;
66
+ this.ability1Casts = data.ability1Casts;
67
+ this.ability2Casts = data.ability2Casts;
68
+ this.ultimateCasts = data.ultimateCasts;
69
+ }
70
+ }
71
+ exports.AbilityCasts = AbilityCasts;
72
+ class PlayerStats {
73
+ constructor(data) {
74
+ this.score = data.score;
75
+ this.roundsPlayed = data.roundsPlayed;
76
+ this.kills = data.kills;
77
+ this.deaths = data.deaths;
78
+ this.assists = data.assists;
79
+ this.playtimeMillis = data.playtimeMillis;
80
+ this.abilityCasts = data.abilityCasts ? new AbilityCasts(data.abilityCasts) : null;
81
+ this.vlrRating = data.vlrRating;
82
+ this.vlrRating2 = data.vlrRating2;
83
+ }
84
+ toJSON() {
85
+ return {
86
+ score: this.score,
87
+ roundsPlayed: this.roundsPlayed,
88
+ kills: this.kills,
89
+ deaths: this.deaths,
90
+ assists: this.assists,
91
+ playtimeMillis: this.playtimeMillis,
92
+ abilityCasts: this.abilityCasts,
93
+ vlrRating: this.vlrRating,
94
+ vlrRating2: this.vlrRating2
95
+ };
96
+ }
97
+ }
98
+ exports.PlayerStats = PlayerStats;
99
+ class Player {
100
+ constructor(data, teams) {
101
+ var _a, _b;
102
+ this.puuid = data.puuid;
103
+ this.gameName = data.gameName;
104
+ this.tagLine = data.tagLine;
105
+ this.team = (_a = teams[data.teamId]) !== null && _a !== void 0 ? _a : null;
106
+ if (data.teamId !== 'Neutral') {
107
+ teams[data.teamId].players.push(this);
108
+ }
109
+ this.partyId = data.partyId;
110
+ this.agent = dtos_service_js_1.AGENTS.getByProperty("uuid", data.characterId);
111
+ this.stats = data.stats ? new PlayerStats(data.stats) : null;
112
+ this.competitiveTier = Object.values(dtos_service_js_1.COMPETITIVE_TIERS.all)[Object.keys(dtos_service_js_1.COMPETITIVE_TIERS.all).length - 1].tiers[data.competitiveTier];
113
+ this.isObserver = data.isObserver;
114
+ this.playerCard = (_b = dtos_service_js_1.PLAYER_CARDS.getByProperty("uuid", data.playerCard)) !== null && _b !== void 0 ? _b : dtos_service_js_1.PLAYER_CARDS.default;
115
+ this.playerTitle = dtos_service_js_1.PLAYER_TITLES.getByProperty("uuid", data.playerTitle);
116
+ this.accountLevel = data.accountLevel;
117
+ }
118
+ getPlayerRoundStats(round) {
119
+ var _a;
120
+ return (_a = round.playerStats.find(playerStats => playerStats.player.puuid === this.puuid)) !== null && _a !== void 0 ? _a : null;
121
+ }
122
+ toJSON() {
123
+ var _a, _b, _c, _d, _e, _f, _g, _h;
124
+ return {
125
+ puuid: this.puuid,
126
+ gameName: this.gameName,
127
+ tagLine: this.tagLine,
128
+ teamId: (_b = (_a = this.team) === null || _a === void 0 ? void 0 : _a.teamId) !== null && _b !== void 0 ? _b : 'Neutral',
129
+ partyId: this.partyId,
130
+ characterId: (_d = (_c = this.agent) === null || _c === void 0 ? void 0 : _c.uuid) !== null && _d !== void 0 ? _d : null,
131
+ stats: (_f = (_e = this.stats) === null || _e === void 0 ? void 0 : _e.toJSON()) !== null && _f !== void 0 ? _f : null,
132
+ competitiveTier: this.competitiveTier.tier,
133
+ isObserver: this.isObserver,
134
+ playerCard: this.playerCard.uuid,
135
+ playerTitle: (_h = (_g = this.playerTitle) === null || _g === void 0 ? void 0 : _g.uuid) !== null && _h !== void 0 ? _h : '',
136
+ accountLevel: this.accountLevel,
137
+ };
138
+ }
139
+ }
140
+ exports.Player = Player;
141
+ class Coach {
142
+ constructor(data, teams) {
143
+ this.puuid = data.puuid;
144
+ this.team = teams[data.teamId];
145
+ }
146
+ toJSON() {
147
+ var _a;
148
+ return {
149
+ puuid: this.puuid,
150
+ teamId: (_a = this.team) === null || _a === void 0 ? void 0 : _a.teamId,
151
+ };
152
+ }
153
+ }
154
+ exports.Coach = Coach;
155
+ var Side;
156
+ (function (Side) {
157
+ Side["ATTACK"] = "Attack";
158
+ Side["DEFENSE"] = "Defense";
159
+ })(Side || (exports.Side = Side = {}));
160
+ class Team {
161
+ constructor(data) {
162
+ this.teamId = data.teamId;
163
+ this.won = data.won;
164
+ this.roundsPlayed = data.roundsPlayed;
165
+ this.roundsWon = data.roundsWon;
166
+ this.numPoints = data.numPoints;
167
+ this.players = [];
168
+ }
169
+ side(roundNum) {
170
+ if (roundNum < 12 || (roundNum >= 24 && (roundNum % 2 === 0))) {
171
+ return this.teamId === 'Red' ? Side.ATTACK : Side.DEFENSE;
172
+ }
173
+ else {
174
+ return this.teamId === 'Red' ? Side.DEFENSE : Side.ATTACK;
175
+ }
176
+ }
177
+ toJSON() {
178
+ return {
179
+ teamId: this.teamId,
180
+ won: this.won,
181
+ roundsPlayed: this.roundsPlayed,
182
+ roundsWon: this.roundsWon,
183
+ numPoints: this.numPoints
184
+ };
185
+ }
186
+ }
187
+ exports.Team = Team;
188
+ class PlayerLocation {
189
+ constructor(data, players, map) {
190
+ this.player = players[data.puuid];
191
+ this.viewRadians = data.viewRadians;
192
+ this.location = new location_model_js_1.NormalizedLocation(data.location, map);
193
+ }
194
+ toJSON() {
195
+ return {
196
+ puuid: this.player.puuid,
197
+ viewRadians: this.viewRadians,
198
+ location: this.location.toJSON(),
199
+ };
200
+ }
201
+ }
202
+ exports.PlayerLocation = PlayerLocation;
203
+ class FinishingDamage {
204
+ constructor(data, killer) {
205
+ var _a, _b, _c, _d, _e, _f;
206
+ if (((_a = data.damageItem) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === '856d9a7e-4b06-dc37-15dc-9d809c37cb90') { // Chamber: Headhunter
207
+ data.damageType = 'Ability';
208
+ data.damageItem = 'Ability1';
209
+ }
210
+ else if (((_b = data.damageItem) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === '39099fb5-4293-def4-1e09-2e9080ce7456') { // Chamber: Tour De Force
211
+ data.damageType = 'Ability';
212
+ data.damageItem = 'Ultimate';
213
+ }
214
+ else if (((_c = data.damageItem) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === '95336ae4-45d4-1032-cfaf-6bad01910607') { // Neon: Overdrive
215
+ data.damageType = 'Ability';
216
+ data.damageItem = 'Ultimate';
217
+ }
218
+ this.damageType = data.damageType === '' ? 'Bomb' : data.damageType;
219
+ this.damageItem = data.damageType === 'Ability' ? ((_e = (_d = killer.agent) === null || _d === void 0 ? void 0 : _d.abilities[data.damageItem === 'GrenadeAbility' ? 'Grenade' : data.damageItem]) !== null && _e !== void 0 ? _e : undefined)
220
+ : ((data.damageType === 'Weapon' && data.damageItem !== '') ? dtos_service_js_1.WEAPONS.getByProperty("uuid", (_f = data.damageItem) === null || _f === void 0 ? void 0 : _f.toLowerCase()) : undefined);
221
+ this.isSecondaryFireMode = data.isSecondaryFireMode;
222
+ }
223
+ toJSON() {
224
+ return {
225
+ damageType: this.damageType,
226
+ damageItem: this.damageItem instanceof agent_model_js_1.Ability ? (this.damageItem.slot === 'Grenade' ? 'GrenadeAbility' : this.damageItem.slot) : (this.damageItem instanceof weapon_model_js_1.Weapon ? this.damageItem.uuid.toUpperCase() : ''),
227
+ isSecondaryFireMode: this.isSecondaryFireMode,
228
+ };
229
+ }
230
+ }
231
+ exports.FinishingDamage = FinishingDamage;
232
+ class Kill {
233
+ constructor(data, players, map) {
234
+ this.timeSinceGameStartMillis = data.timeSinceGameStartMillis;
235
+ this.timeSinceRoundStartMillis = data.timeSinceRoundStartMillis;
236
+ this.killer = players[data.killer];
237
+ this.victim = players[data.victim];
238
+ this.victimLocation = new location_model_js_1.NormalizedLocation(data.victimLocation, map);
239
+ this.assistants = data.assistants.map((assistant) => players[assistant]);
240
+ this.playerLocations = {};
241
+ data.playerLocations.forEach((playerLocation) => {
242
+ this.playerLocations[playerLocation.puuid] = new PlayerLocation(playerLocation, players, map);
243
+ });
244
+ this.finishingDamage = new FinishingDamage(data.finishingDamage, players[data.killer]);
245
+ }
246
+ toJSON() {
247
+ return {
248
+ timeSinceGameStartMillis: this.timeSinceGameStartMillis,
249
+ timeSinceRoundStartMillis: this.timeSinceRoundStartMillis,
250
+ killer: this.killer.puuid,
251
+ victim: this.victim.puuid,
252
+ victimLocation: this.victimLocation.toJSON(),
253
+ assistants: this.assistants.map(assistant => assistant.puuid),
254
+ playerLocations: Object.values(this.playerLocations).map(playerLocation => playerLocation.toJSON()),
255
+ finishingDamage: this.finishingDamage.toJSON(),
256
+ };
257
+ }
258
+ }
259
+ exports.Kill = Kill;
260
+ class Damage {
261
+ constructor(data, players) {
262
+ this.receiver = players[data.receiver];
263
+ this.damage = data.damage;
264
+ this.headshots = data.headshots;
265
+ this.bodyshots = data.bodyshots;
266
+ this.legshots = data.legshots;
267
+ }
268
+ toJSON() {
269
+ return {
270
+ receiver: this.receiver.puuid,
271
+ damage: this.damage,
272
+ legshots: this.legshots,
273
+ bodyshots: this.bodyshots,
274
+ headshots: this.headshots,
275
+ };
276
+ }
277
+ }
278
+ exports.Damage = Damage;
279
+ class Economy {
280
+ constructor(data) {
281
+ this.loadoutValue = data.loadoutValue;
282
+ this.weapon = dtos_service_js_1.WEAPONS.getByProperty("uuid", data.weapon.toLowerCase());
283
+ this.armor = dtos_service_js_1.GEARS.getByProperty("uuid", data.armor.toLowerCase());
284
+ this.remaining = data.remaining;
285
+ this.spent = data.spent;
286
+ }
287
+ toJSON() {
288
+ var _a, _b, _c, _d;
289
+ return {
290
+ loadoutValue: this.loadoutValue,
291
+ weapon: (_b = (_a = this.weapon) === null || _a === void 0 ? void 0 : _a.uuid.toUpperCase()) !== null && _b !== void 0 ? _b : '',
292
+ armor: (_d = (_c = this.armor) === null || _c === void 0 ? void 0 : _c.uuid.toUpperCase()) !== null && _d !== void 0 ? _d : '',
293
+ remaining: this.remaining,
294
+ spent: this.spent,
295
+ };
296
+ }
297
+ }
298
+ exports.Economy = Economy;
299
+ class AbilityEffects {
300
+ constructor(data) {
301
+ this.grenadeEffects = data.grenadeEffects;
302
+ this.ability1Effects = data.ability1Effects;
303
+ this.ability2Effects = data.ability2Effects;
304
+ this.ultimateEffects = data.ultimateEffects;
305
+ }
306
+ }
307
+ exports.AbilityEffects = AbilityEffects;
308
+ class PlayerRoundStats {
309
+ constructor(data, players, map) {
310
+ this.player = players[data.puuid];
311
+ this.kills = [];
312
+ data.kills.forEach((kill) => {
313
+ this.kills.push(new Kill(kill, players, map));
314
+ });
315
+ this.damage = [];
316
+ data.damage.forEach((damage) => {
317
+ this.damage.push(new Damage(damage, players));
318
+ });
319
+ this.score = data.score;
320
+ this.economy = new Economy(data.economy);
321
+ this.ability = new AbilityEffects(data.ability);
322
+ }
323
+ toJSON() {
324
+ return {
325
+ puuid: this.player.puuid,
326
+ kills: this.kills.map(kill => kill.toJSON()),
327
+ damage: this.damage.map(damage => damage.toJSON()),
328
+ score: this.score,
329
+ economy: this.economy.toJSON(),
330
+ ability: this.ability,
331
+ };
332
+ }
333
+ }
334
+ exports.PlayerRoundStats = PlayerRoundStats;
335
+ class Round {
336
+ constructor(data, players, teams, map) {
337
+ this.roundNum = data.roundNum;
338
+ this.roundResult = data.roundResult;
339
+ this.roundCeremony = data.roundCeremony;
340
+ this.winningTeam = teams[data.winningTeam];
341
+ this.bombPlanter = players[data.bombPlanter];
342
+ this.bombDefuser = players[data.bombDefuser];
343
+ this.plantRoundTime = data.plantRoundTime;
344
+ if (data.plantPlayerLocations) {
345
+ this.plantPlayerLocations = {};
346
+ data.plantPlayerLocations.forEach((plantPlayerLocation) => {
347
+ this.plantPlayerLocations[plantPlayerLocation.puuid] = new PlayerLocation(plantPlayerLocation, players, map);
348
+ });
349
+ }
350
+ else {
351
+ this.plantPlayerLocations = null;
352
+ }
353
+ this.plantLocation = new location_model_js_1.NormalizedLocation(data.plantLocation, map);
354
+ this.plantSite = data.plantSite;
355
+ this.defuseRoundTime = data.defuseRoundTime;
356
+ if (data.defusePlayerLocations) {
357
+ this.defusePlayerLocations = {};
358
+ data.defusePlayerLocations.forEach((defusePlayerLocation) => {
359
+ this.defusePlayerLocations[defusePlayerLocation.puuid] = new PlayerLocation(defusePlayerLocation, players, map);
360
+ });
361
+ }
362
+ else {
363
+ this.defusePlayerLocations = null;
364
+ }
365
+ this.defuseLocation = new location_model_js_1.NormalizedLocation(data.defuseLocation, map);
366
+ this.playerStats = [];
367
+ data.playerStats.forEach((playerStat) => {
368
+ this.playerStats.push(new PlayerRoundStats(playerStat, players, map));
369
+ });
370
+ this.roundResultCode = data.roundResultCode;
371
+ }
372
+ isKastRoundFor(puuid, kills = []) {
373
+ const playerstats = this.playerStats.find(playerStat => playerStat.player.puuid === puuid);
374
+ if (!playerstats) {
375
+ return false;
376
+ }
377
+ if (playerstats.kills.length > 0) {
378
+ return true;
379
+ }
380
+ if (kills.length === 0) {
381
+ kills = this.getKills();
382
+ }
383
+ if (this.didPlayerSurvived(puuid, kills)) {
384
+ return true;
385
+ }
386
+ if (this.hasPlayerAssist(puuid, kills)) {
387
+ return true;
388
+ }
389
+ if (this.gotPlayerTraded(puuid, kills)) {
390
+ return true;
391
+ }
392
+ return false;
393
+ }
394
+ getKills() {
395
+ const kills = [];
396
+ this.playerStats.forEach(player => {
397
+ kills.push(...player.kills);
398
+ });
399
+ return kills.sort((a, b) => a.timeSinceRoundStartMillis - b.timeSinceRoundStartMillis);
400
+ }
401
+ didPlayerSurvived(puuid, kills = []) {
402
+ if (kills.length === 0) {
403
+ kills = this.getKills();
404
+ }
405
+ return kills.length > 0 && Object.keys(kills[kills.length - 1].playerLocations).some(p => p === puuid);
406
+ }
407
+ hasPlayerAssist(puuid, kills = []) {
408
+ if (kills.length === 0) {
409
+ kills = this.getKills();
410
+ }
411
+ return kills.some(kill => kill.assistants.some(assistant => assistant.puuid === puuid));
412
+ }
413
+ gotPlayerTraded(puuid, kills = []) {
414
+ if (kills.length === 0) {
415
+ kills = this.getKills();
416
+ }
417
+ const death = kills.filter(kill => kill.victim.puuid === puuid);
418
+ return kills.some(kill => death === null || death === void 0 ? void 0 : death.some(d => d.killer.puuid === kill.victim.puuid && d.timeSinceRoundStartMillis + 5000 > kill.timeSinceRoundStartMillis));
419
+ }
420
+ toJSON() {
421
+ var _a, _b, _c, _d, _e, _f;
422
+ return {
423
+ roundNum: this.roundNum,
424
+ roundResult: this.roundResult,
425
+ roundCeremony: this.roundCeremony,
426
+ winningTeam: this.winningTeam.teamId,
427
+ bombPlanter: (_b = (_a = this.bombPlanter) === null || _a === void 0 ? void 0 : _a.puuid) !== null && _b !== void 0 ? _b : null,
428
+ bombDefuser: (_d = (_c = this.bombDefuser) === null || _c === void 0 ? void 0 : _c.puuid) !== null && _d !== void 0 ? _d : null,
429
+ plantRoundTime: this.plantRoundTime,
430
+ plantPlayerLocations: this.plantPlayerLocations ? Object.values(this.plantPlayerLocations).map(plantPlayerLocation => plantPlayerLocation.toJSON()) : null,
431
+ plantLocation: (_e = this.plantLocation) === null || _e === void 0 ? void 0 : _e.toJSON(),
432
+ plantSite: this.plantSite,
433
+ defuseRoundTime: this.defuseRoundTime,
434
+ defusePlayerLocations: this.defusePlayerLocations ? Object.values(this.defusePlayerLocations).map(defusePlayerLocation => defusePlayerLocation.toJSON()) : null,
435
+ defuseLocation: (_f = this.defuseLocation) === null || _f === void 0 ? void 0 : _f.toJSON(),
436
+ playerStats: this.playerStats.map(playerStat => playerStat.toJSON()),
437
+ roundResultCode: this.roundResultCode,
438
+ };
439
+ }
440
+ }
441
+ exports.Round = Round;
442
+ class MatchDto {
443
+ constructor(data) {
444
+ this.matchInfo = new MatchInfo(data.matchInfo);
445
+ this.teams = {};
446
+ data.teams.forEach((team) => {
447
+ this.teams[team.teamId] = new Team(team);
448
+ });
449
+ this.players = {};
450
+ this.observers = {};
451
+ data.players.forEach((player) => {
452
+ if (player.isObserver) {
453
+ this.observers[player.puuid] = new Player(player, this.teams);
454
+ }
455
+ else {
456
+ this.players[player.puuid] = new Player(player, this.teams);
457
+ }
458
+ });
459
+ this.coaches = {};
460
+ data.coaches.forEach((coach) => {
461
+ this.coaches[coach.puuid] = new Coach(coach, this.teams);
462
+ });
463
+ this.roundResults = [];
464
+ const map = map_model_js_1.MapDto.getMap(data.matchInfo.mapId);
465
+ if (map) {
466
+ data.roundResults.forEach((round) => {
467
+ this.roundResults.push(new Round(round, this.players, this.teams, map));
468
+ });
469
+ }
470
+ }
471
+ toJSON() {
472
+ return {
473
+ matchInfo: this.matchInfo.toJSON(),
474
+ players: [
475
+ ...Object.values(this.players).map(player => player.toJSON()),
476
+ ...Object.values(this.observers).map(observer => observer.toJSON())
477
+ ],
478
+ coaches: Object.values(this.coaches).map(coach => coach.toJSON()),
479
+ teams: Object.values(this.teams).map(team => team.toJSON()),
480
+ roundResults: this.roundResults.map(round => round.toJSON()),
481
+ };
482
+ }
483
+ }
484
+ exports.MatchDto = MatchDto;
485
+ class Match {
486
+ constructor(data) {
487
+ var _a;
488
+ this.match_id = data.matchInfo.matchId;
489
+ this.game_start = data.matchInfo.gameStartMillis;
490
+ const mapName = (_a = map_model_js_1.MapDto.getMap(data.matchInfo.mapId)) === null || _a === void 0 ? void 0 : _a.displayName;
491
+ if (!mapName) {
492
+ throw new Error('Map not found');
493
+ }
494
+ this.map = mapName;
495
+ this.data = new MatchDto(data);
496
+ }
497
+ toJSON() {
498
+ return {
499
+ match_id: this.match_id,
500
+ game_start: this.game_start,
501
+ map: this.map,
502
+ data: this.data.toJSON(),
503
+ };
504
+ }
505
+ }
506
+ exports.Match = Match;
@@ -0,0 +1,13 @@
1
+ export declare class MatchlistEntry {
2
+ matchId: string;
3
+ gameStartTimeMillis: number;
4
+ gameStartTime: Date;
5
+ queueId: string;
6
+ constructor(matchId: string, gameStartTimeMillis: number, queueId: string);
7
+ }
8
+ export declare class Matchlist {
9
+ puuid: string;
10
+ history: MatchlistEntry[];
11
+ constructor(puuid: string, history: MatchlistEntry[]);
12
+ }
13
+ //# sourceMappingURL=matchlist.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchlist.model.d.ts","sourceRoot":"","sources":["../../src/models/matchlist.model.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;gBAEJ,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAM5E;AAED,qBAAa,SAAS;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,EAAE,CAAC;gBAEd,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE;CAOvD"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Matchlist = exports.MatchlistEntry = void 0;
4
+ class MatchlistEntry {
5
+ constructor(matchId, gameStartTimeMillis, queueId) {
6
+ this.matchId = matchId;
7
+ this.gameStartTimeMillis = gameStartTimeMillis;
8
+ this.gameStartTime = new Date(gameStartTimeMillis);
9
+ this.queueId = queueId;
10
+ }
11
+ }
12
+ exports.MatchlistEntry = MatchlistEntry;
13
+ class Matchlist {
14
+ constructor(puuid, history) {
15
+ this.puuid = puuid;
16
+ this.history = [];
17
+ for (let entry of history) {
18
+ this.history.push(new MatchlistEntry(entry.matchId, entry.gameStartTimeMillis, entry.queueId));
19
+ }
20
+ }
21
+ }
22
+ exports.Matchlist = Matchlist;
@@ -0,0 +1,14 @@
1
+ import { Theme } from './theme.model';
2
+ export declare class PlayerCard {
3
+ uuid: string;
4
+ displayName: string;
5
+ isHiddenIfNotOwned: boolean;
6
+ themeUuid: Theme | undefined;
7
+ displayIcon: string;
8
+ smallArt: string;
9
+ wideArt: string;
10
+ largeArt: string;
11
+ assetPath: string;
12
+ constructor(data: any);
13
+ }
14
+ //# sourceMappingURL=playerCard.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playerCard.model.d.ts","sourceRoot":"","sources":["../../src/models/playerCard.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,qBAAa,UAAU;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;gBAEN,IAAI,EAAE,GAAG;CAWxB"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlayerCard = void 0;
4
+ const dtos_service_js_1 = require("../services/dtos.service.js");
5
+ class PlayerCard {
6
+ constructor(data) {
7
+ this.uuid = data.uuid;
8
+ this.displayName = data.displayName;
9
+ this.isHiddenIfNotOwned = data.isHiddenIfNotOwned;
10
+ this.themeUuid = dtos_service_js_1.THEMES.getByProperty("uuid", data.themeUuid);
11
+ this.displayIcon = data.displayIcon;
12
+ this.smallArt = data.smallArt;
13
+ this.wideArt = data.wideArt;
14
+ this.largeArt = data.largeArt;
15
+ this.assetPath = data.assetPath;
16
+ }
17
+ }
18
+ exports.PlayerCard = PlayerCard;
@@ -0,0 +1,9 @@
1
+ export declare class PlayerTitle {
2
+ uuid: string;
3
+ displayName: string | null;
4
+ titleText: string | null;
5
+ isHiddenIfNotOwned: boolean;
6
+ assetPath: string;
7
+ constructor(data: any);
8
+ }
9
+ //# sourceMappingURL=playerTitle.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playerTitle.model.d.ts","sourceRoot":"","sources":["../../src/models/playerTitle.model.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;gBAEN,IAAI,EAAE,GAAG;CAOxB"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlayerTitle = void 0;
4
+ class PlayerTitle {
5
+ constructor(data) {
6
+ this.uuid = data.uuid;
7
+ this.displayName = data.displayName;
8
+ this.titleText = data.titleText;
9
+ this.isHiddenIfNotOwned = data.isHiddenIfNotOwned;
10
+ this.assetPath = data.assetPath;
11
+ }
12
+ }
13
+ exports.PlayerTitle = PlayerTitle;
@@ -0,0 +1,9 @@
1
+ export declare class Role {
2
+ uuid: string;
3
+ displayName: string;
4
+ description: string;
5
+ displayIcon: string;
6
+ assetPath: string;
7
+ constructor(data: any);
8
+ }
9
+ //# sourceMappingURL=role.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.model.d.ts","sourceRoot":"","sources":["../../src/models/role.model.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;gBAEN,IAAI,EAAE,GAAG;CAOxB"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Role = void 0;
4
+ class Role {
5
+ constructor(data) {
6
+ this.uuid = data.uuid;
7
+ this.displayName = data.displayName;
8
+ this.description = data.description;
9
+ this.displayIcon = data.displayIcon;
10
+ this.assetPath = data.assetPath;
11
+ }
12
+ }
13
+ exports.Role = Role;
@@ -0,0 +1,11 @@
1
+ export declare class Season {
2
+ uuid: string;
3
+ displayName: string;
4
+ type: string | null;
5
+ startTime: string;
6
+ endTime: string;
7
+ parentUuid: string | null;
8
+ assetPath: string;
9
+ constructor(data: any);
10
+ }
11
+ //# sourceMappingURL=season.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"season.model.d.ts","sourceRoot":"","sources":["../../src/models/season.model.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;gBAEN,IAAI,EAAE,GAAG;CASxB"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Season = void 0;
4
+ class Season {
5
+ constructor(data) {
6
+ this.uuid = data.uuid;
7
+ this.displayName = data.displayName;
8
+ this.type = data.type;
9
+ this.startTime = data.startTime;
10
+ this.endTime = data.endTime;
11
+ this.parentUuid = data.parentUuid;
12
+ this.assetPath = data.assetPath;
13
+ }
14
+ }
15
+ exports.Season = Season;