Releases: martinsileno/pubg-typescript-api
v1.6.0: support for PUBG API at v7.7.0
v1.5.1: Add typing for seasonState attribute
Add typing for seasonState attribute
v1.5.0: Support for PUBG API version 6.0.0
This version brings support for PUBG API version 6.0.0, due to be released in a few hours.
👍 All credits go to @Tdortiz for his PR #13.
For a full changelog please visit PUBG docs.
The most important thing to note is that if you previously were using killPoints
, killPointsDelta
, winPoints
, winPointsDelta
, these will now be undefined
on PC.
PC will now switch to rank-based attributes, such as: bestRankPoints
, dailyWins
, rankPoints
, weeklyWins
.
v1.4.1: Fix telemetry parsing crash
Fix two possible crashes when parsing telemetry data due to unexpectedly undefined values in some events (see issue #9).
v1.4.0: support for PUBG API @ v1.5.0
This release brings the library up to date with the latest changes on PUBG API (v1.5.0).
New data
- New telemetry event
LogSwimStart
- New telemetry event
LogSwimEnd
- New telemetry event
LogArmorDestroy
- New telemetry event
LogPlayerMakeGroggy
- New telemetry event
LogPlayerRevive
- New telemetry event
LogWheelDestroy
- Add
swimDistance
to participants - Add
rideDistance
andseatIndex
toLogVehicleLeave
telemetry event - Add
seatIndex
toLogVehicleRide
telemetry event - Add
isCustomMatch
to match attributes - Add
isCustomGame
andisEventMode
toLogMatchStart
telemetry event
Removed data
This may be a breaking change if you used these fields...
- Remove
_V
from telemetry events - Remove
mapName
andmatchId
from telemetry events (they are still available inLogMatchStart
andLogMatchDefinition
telemetry events)
v1.3.1
Player Season Stats
This release adds support for the new aggregated player stats by season.
Season
Retrieve season IDs using the Season.list
static method, the argument is, as always, the PubgAPI
instance.
const seasonsList = await Season.list(api);
Once you have a season ID, you can use it to query player stats.
PlayerSeason
Use PlayerSeason.get(api, PLAYER_ID, SEASON_ID)
to retrieve stats for a player in a season.
Returned object will contain:
- solo FPP stats
- solo FPP list of match IDs
- solo TPP stats
- solo TPP list of match IDs
- duo FPP stats
- duo FPP list of match IDs
- duo TPP stats
- duo TPP list of match IDs
- squad FPP stats
- squad FPP list of match IDs
- squad TPP stats
- squad TPP list of match IDs
Stats objects contain stats like kills, assists, revives and many more. For a complete list, see the GameModeStats
class.
Telemetry support
Added support for parsing telemetry data.
Changed
Match
- [feature] add
.getTelemetry(api)
to return the correspondingTelemetry
object - [fix]
.asset
cannot be undefined
New
TelemetryPubgAPI
Used to make telemetry requests to the API. Should not be used directly, as telemetry objects for a Match
can be returned using getTelemetry
.
Telemetry
This object contains one list for each possible telemetry event, such as:
- care package landing and spawn
- item attach, detach, drop, equip, pickup, unequip, use
- match definition, end, start
- player attack, create, kill, login, logout, position, take damage
- vehicle destroy, leave, ride
See each class in /src/entities/telemetry/events
for details on their content.
v1.1.0
- Add support for Samples endpoint
To use it, just call the static method get()
on the new Sample
class. The method accepts an optional date as first argument.
const sample = await Sample.get(api);
const matchIds = sample.matchIds;
- Add
getWinners()
method to match objects to, obviously, return winner(s) of the match
v1.0.0 release
v1.0.0: first stable release
Usage has (almost) completely changed: everything is now based on Entities, classes that roughly correspond to the API resources (like Player, Match, etc.).
Entities
Entities are instantiated by calling their static methods, such as Match.get(...)
to get a Match
entity by ID or Player.filterByName(...)
to get a list of Player
s by name.
They contain most attributes from the API as their fields, in addition to other helpful fields (like .totalDistance = this._walkDistance + this._rideDistance
).
Entity instances are related to each other, for example a Match
has .participants
and .rosters
, lists of other Entities (Participant
and Roster
). This makes it easier to navigate a Match
object, searching for Participants inside it etc.