Skip to content

Commit

Permalink
fix: getLeaderboard return type
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharlock10 committed Jan 28, 2024
1 parent 30b19a7 commit beb0b9f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v4.0.0
# v4.0.1
- *BREAKING CHANGE*: Removed `getBountyItems` api
- Added `getPlayerQueueStatsBatch` api
- Added `getLeaderboard` api
Expand Down Expand Up @@ -47,4 +47,4 @@
- Added `TaskForce` to `Enums`
- Fixed `champion_id` type in `ChampionCard`

View release on [npm](https://www.npmjs.com/package/pe-paladins.js/v/4.0.0)
View release on [npm](https://www.npmjs.com/package/pe-paladins.js/v/4.0.1)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A strongly typed fork of [paladins.js](https://www.npmjs.com/package/paladins.js

## Changelog

### v4.0.0
### v4.0.1
- *BREAKING CHANGE*: Removed `getBountyItems` api
- Added `getPlayerQueueStatsBatch` api
- Added `getLeaderboard` api
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pe-paladins.js",
"version": "4.0.0",
"version": "4.0.1",
"description": "A strongly typed fork of paladins.js, used by Paladins Edge",
"keywords": [
"paladins",
Expand Down Expand Up @@ -58,4 +58,4 @@
"typedoc": "^0.22.18",
"typescript": "^4.7.4"
}
}
}
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class API {
*/
public getLeaderboard(rank: Enums.Ranks, round = 1) {
const queue = Queue.Ranked;
return this.endpoint<ApiResponse.GetPlayerQueueStats>('getleagueleaderboard', [null, null, null, null, queue, rank, null, null, round]);
return this.endpoint<ApiResponse.GetLeaderboard>('getleagueleaderboard', [null, null, null, null, queue, rank, null, null, round]);
}

/**
Expand Down
18 changes: 18 additions & 0 deletions src/apiResponse/getLeaderboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Ranks } from '../enums';

interface LeaderboardPlayer {
Leaves: number,
Losses: number,
Name: string,
Points: number,
PrevRank: number,
Rank: number,
Season: number,
Tier: Ranks,
Trend: number,
Wins: number,
player_id: string,
ret_msg: string | null;
}

export type GetLeaderboard = LeaderboardPlayer[];
3 changes: 2 additions & 1 deletion src/apiResponse/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
export * from './getActiveMatchDetails';
export * from './getBountyItems';
export * from './getChampionCards';
export * from './getChampions';
export * from './getChampionSkins';
export * from './getChampions';
export * from './getDataUsage';
export * from './getItems';
export * from './getLeaderboard';
export * from './getMatchDetails';
export * from './getMatchIdsByQueue';
export * from './getPlayer';
Expand Down

0 comments on commit beb0b9f

Please sign in to comment.