martinsileno / pubg-typescript-api

TypeScript wrapper on official PUBG API.
MIT License
12 stars 9 forks source link

Updating api for v6.0.0 #12

Closed ThomasOrtiz closed 5 years ago

ThomasOrtiz commented 5 years ago

PUBG API is updating their api to v6.0.0:

Task List

Major Updates

New Ranking

New Player Season-Stats and Matches:

Matches:

Old:  /shards/ {platform-region} /matches/{id}
New:  /shards/ {steam or kakao}  /matches/{id}

Player's Season Stats:

PC (after  10/3)   - /shards/    {steam or kakao}   /players/{playerId}/seasons/{seasonId}
PC (before 10/3)   - /shards/ {pc or xbox}-{region} /players/{playerId}/seasons/{seasonId}
Xbox               - /shards/ {pc or xbox}-{region} /players/{playerId}/seasons/{seasonId}

Player by Id:

Remains the same    - https://api.pubg.com/shards/{region}/players/{id}

Source / Documentation

image

martinsileno commented 5 years ago

Hi,

thanks for the issue and the PR!

The only thing left to worry about is the removal of killPoints, killPointsDelta, winPoints and winPointsDelta from PC's participants attributes.

I think the easiest way to handle it would be to mark those fields as nullable in IParticipantAttributes (and by consequence, mark the same fields as nullable in the class Participant). This way we would keep the same code working for both PC and XBOX, otherwise we'd have to split Participant objects according to the platform requested, and I don't really like that.

Something like this: https://gist.github.com/martinsileno/e84b6daa11f1469fd7ddb5dd6e913ea9.

If you have better ideas let me know!

Anyway, since they are marked as deprecated, according to their release process they will still be available for two weeks after the release.

ThomasOrtiz commented 5 years ago

I like the idea of keeping one participant object instead of separating them out -- keeps the models more maintainable for now.

I took your gist and updated my PR with your changes 👍

ThomasOrtiz commented 5 years ago

@martinsileno PUBG made another announcement today so I updated this issue to be generically for v6.0.0 and updated notes.

martinsileno commented 5 years ago

PR merged and version v1.5.0 released! 🎉

Only thing left is to add typing for seasonState, as soon as we know its format.