osrs-json-hiscores 2.20.0 → 2.21.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.
package/README.md CHANGED
@@ -1,231 +1,235 @@
1
- # OSRS .json Hiscores
2
-
3
- [![npm](https://img.shields.io/npm/v/osrs-json-hiscores.svg?style=flat-square)](https://www.npmjs.com/package/osrs-json-hiscores)
4
- [![downloads](https://img.shields.io/npm/dm/osrs-json-hiscores.svg?style=flat-square)](https://npm-stat.com/charts.html?package=osrs-json-hiscores)
5
- [![types](https://img.shields.io/npm/types/osrs-json-hiscores.svg?style=flat-square)](https://github.com/maxswa/osrs-json-hiscores/blob/master/src/types.ts)
6
- [![build](https://img.shields.io/github/actions/workflow/status/maxswa/osrs-json-hiscores/main.yml?style=flat-square&branch=main)](https://github.com/maxswa/osrs-json-hiscores/actions/workflows/main.yml?query=branch%3Amain)
7
-
8
- **The Old School RuneScape API wrapper that does more!**
9
-
10
- ## What it does
11
-
12
- The official hiscores API for Old School RuneScape (OSRS) can return CSV or a simple JSON array.
13
- This wrapper converts the hiscores data into a more usable JSON object and provides extra information about the given player. By comparing player info it infers the player's game mode, as well as any previous modes (de-ultimated, de-ironed and/or died as a hardcore ironman).
14
-
15
- Additional functions are provided that screen-scrape the OSRS leaderboards and return a list of players as json. Also simple utility functions are provided to fetch the raw responses from Jagex's APIs, if desired.
16
-
17
- `osrs-json-hiscores` has TypeScript support, with full definitions for all functions and custom data types.
18
-
19
- ---
20
-
21
- ### ⚠ Disclaimer ⚠
22
-
23
- Jagex does not provide `Access-Control-Allow-Origin` headers in their responses. This means that [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) will block all browser requests to their hiscores API. In order to get around this, osrs-json-hiscores needs to be installed on the server side and exposed to the front end via a simple API. Here is an example of this in use: [codesandbox.io/s/osrs-json-hiscores-demo](https://codesandbox.io/s/osrs-json-hiscores-demo-qz656)
24
-
25
- TLDR: You cannot use this library directly in your client side app e.g. React or Vue, you must set up a server which uses this lib internally and have your client fetch data from your server.
26
-
27
- ---
28
-
29
- ## Installation
30
-
31
- With npm:
32
-
33
- ```
34
- $ npm install osrs-json-hiscores
35
- ```
36
-
37
- With Yarn:
38
-
39
- ```
40
- $ yarn add osrs-json-hiscores
41
- ```
42
-
43
- ## How to use
44
-
45
- Install the package and then import it into your project:
46
-
47
- ```typescript
48
- import { getStatsByGamemode, getSkillPage } from 'osrs-json-hiscores';
49
- ```
50
-
51
- Once you import it you can call the functions asynchronously:
52
-
53
- ```typescript
54
- const stats = await getStatsByGamemode('Lynx Titan');
55
- const topPage = await getSkillPage('overall');
56
- ```
57
-
58
- `getStats` will return a full player object with gamemode.
59
- `getStatsByGameMode` will return a stats object and accepts a gamemode parameter:
60
-
61
- | Game mode | Param |
62
- | ---------------- | :----------: |
63
- | Regular | `main` |
64
- | Ironman | `ironman` |
65
- | Hardcore Ironman | `hardcore` |
66
- | Ultimate Ironman | `ultimate` |
67
- | Deadman Mode | `deadman` |
68
- | Tournament | `tournament` |
69
- | Leagues | `seasonal` |
70
-
71
- `getSkillPage` and `getActivityPage` require a skill / activity and optionally a gamemode and page:
72
-
73
- ```typescript
74
- getSkillPage('attack', 'main', 1)
75
- .then((res) => console.log(res))
76
- .catch((err) => console.error(err));
77
- ```
78
-
79
- Activities consist of all levels of clue scrolls as well as minigames and bosses:
80
-
81
- ### Clue Scrolls
82
-
83
- | Type | Param |
84
- | -------- | :-------------: |
85
- | All | `allClues` |
86
- | Beginner | `beginnerClues` |
87
- | Easy | `easyClues` |
88
- | Medium | `mediumClues` |
89
- | Hard | `hardClues` |
90
- | Elite | `eliteClues` |
91
- | Master | `masterClues` |
92
-
93
- ### Minigames
94
-
95
- | Minigame | Param |
96
- | ------------------------------- | :---------------: |
97
- | Bounty Hunter (Legacy - Rogue) | `rogueBH` |
98
- | Bounty Hunter (Legacy - Hunter) | `hunterBH` |
99
- | Bounty Hunter (Rogue) | `rogueBHV2` |
100
- | Bounty Hunter (Hunter) | `hunterBHV2` |
101
- | LMS - Rank | `lastManStanding` |
102
- | PvP Arena - Rank | `pvpArena` |
103
- | Soul Wars Zeal | `soulWarsZeal` |
104
- | Rifts closed | `riftsClosed` |
105
- | Colosseum Glory | `colosseumGlory` |
106
-
107
- ### Points
108
-
109
- | Activity | Param |
110
- | -------------- | :-------------: |
111
- | League Points | `leaguePoints` |
112
- | Deadman Points | `deadmanPoints` |
113
-
114
- ### Bosses
115
-
116
- | Boss Name | Param |
117
- | --------------------------------- | :----------------------------: |
118
- | Abyssal Sire | `abyssalSire` |
119
- | Alchemical Hydra | `alchemicalHydra` |
120
- | Amoxliatl | `amoxliatl` |
121
- | Araxxor | `araxxor` |
122
- | Artio | `artio` |
123
- | Barrows Chests | `barrows` |
124
- | Bryophyta | `bryophyta` |
125
- | Callisto | `callisto` |
126
- | Calvar'ion | `calvarion` |
127
- | Cerberus | `cerberus` |
128
- | Chambers Of Xeric | `chambersOfXeric` |
129
- | Chambers Of Xeric: Challenge Mode | `chambersOfXericChallengeMode` |
130
- | Chaos Elemental | `chaosElemental` |
131
- | Chaos Fanatic | `chaosFanatic` |
132
- | Commander Zilyana | `commanderZilyana` |
133
- | Corporeal Beast | `corporealBeast` |
134
- | Crazy Archaeologist | `crazyArchaeologist` |
135
- | Dagannoth Prime | `dagannothPrime` |
136
- | Dagannoth Rex | `dagannothRex` |
137
- | Dagannoth Supreme | `dagannothSupreme` |
138
- | Deranged Archaeologist | `derangedArchaeologist` |
139
- | Duke Sucellus | `dukeSucellus` |
140
- | General Graardor | `generalGraardor` |
141
- | Giant Mole | `giantMole` |
142
- | Grotesque Guardians | `grotesqueGuardians` |
143
- | Hespori | `hespori` |
144
- | Kalphite Queen | `kalphiteQueen` |
145
- | King Black Dragon | `kingBlackDragon` |
146
- | Kraken | `kraken` |
147
- | Kreearra | `kreeArra` |
148
- | K'ril Tsutsaroth | `krilTsutsaroth` |
149
- | Lunar Chests | `lunarChests` |
150
- | Mimic | `mimic` |
151
- | Nex | `nex` |
152
- | Nightmare | `nightmare` |
153
- | Phosani's Nightmare | `phosanisNightmare` |
154
- | Obor | `obor` |
155
- | Phantom Muspah | `phantomMuspah` |
156
- | Sarachnis | `sarachnis` |
157
- | Scorpia | `scorpia` |
158
- | Scurrius | `scurrius` |
159
- | Skotizo | `skotizo` |
160
- | Sol Heredit | `solHeredit` |
161
- | Spindel | `spindel` |
162
- | Tempoross | `tempoross` |
163
- | The Gauntlet | `gauntlet` |
164
- | The Corrupted Gauntlet | `corruptedGauntlet` |
165
- | The Hueycoatl | `hueycoatl` |
166
- | The Leviathan | `leviathan` |
167
- | The Whisperer | `whisperer` |
168
- | Theatre Of Blood | `theatreOfBlood` |
169
- | Theatre Of Blood: Hard Mode | `theatreOfBloodHardMode` |
170
- | Thermonuclear Smoke Devil | `thermonuclearSmokeDevil` |
171
- | Tombs of Amascut | `tombsOfAmascut` |
172
- | Tombs of Amascut: Expert Mode | `tombsOfAmascutExpertMode` |
173
- | TzKal-Zuk | `tzKalZuk` |
174
- | TzTok-Jad | `tzTokJad` |
175
- | Vardorvis | `vardorvis` |
176
- | Venenatis | `venenatis` |
177
- | Vetion | `vetion` |
178
- | Vorkath | `vorkath` |
179
- | Wintertodt | `wintertodt` |
180
- | Zalcano | `zalcano` |
181
- | Zulrah | `zulrah` |
182
-
183
- ## What you'll get
184
-
185
- `getStats` returns a player object that looks like this:
186
-
187
- ```typescript
188
- {
189
- name: 'Lynx Titan',
190
- mode: 'main',
191
- dead: false,
192
- deulted: false,
193
- deironed: false,
194
- main: {
195
- skills: {
196
- overall: {rank: 1, level: 2277, xp: 4600000000},
197
- attack: {},
198
- defence: {},
199
- // ...
200
- },
201
- clues: {},
202
- leaguePoints: {},
203
- bountyHunter: {},
204
- lastManStanding: {},
205
- pvpArena: {},
206
- soulWarsZeal: {},
207
- riftsClosed: {},
208
- bosses: {}
209
- }
210
- }
211
- ```
212
-
213
- `getSkillPage` returns and array of 25 players (This represents a page on the hiscores):
214
-
215
- ```typescript
216
- [
217
- { rank: 1, name: 'Lynx Titan', level: 2277, xp: 4600000000, dead: false },
218
- {},
219
- {}
220
- // ...
221
- ];
222
- ```
223
-
224
- ## Helpful Extras
225
-
226
- Get the properly formatted name of any skill, boss, clue or other activity:
227
-
228
- ```typescript
229
- // kril === "K'ril Tsutsaroth"
230
- const kril = FORMATTED_BOSS_NAMES['krilTsutsaroth'];
231
- ```
1
+ # OSRS .json Hiscores
2
+
3
+ [![npm](https://img.shields.io/npm/v/osrs-json-hiscores.svg?style=flat-square)](https://www.npmjs.com/package/osrs-json-hiscores)
4
+ [![downloads](https://img.shields.io/npm/dm/osrs-json-hiscores.svg?style=flat-square)](https://npm-stat.com/charts.html?package=osrs-json-hiscores)
5
+ [![types](https://img.shields.io/npm/types/osrs-json-hiscores.svg?style=flat-square)](https://github.com/maxswa/osrs-json-hiscores/blob/master/src/types.ts)
6
+ [![build](https://img.shields.io/github/actions/workflow/status/maxswa/osrs-json-hiscores/main.yml?style=flat-square&branch=main)](https://github.com/maxswa/osrs-json-hiscores/actions/workflows/main.yml?query=branch%3Amain)
7
+
8
+ **The Old School RuneScape API wrapper that does more!**
9
+
10
+ ## What it does
11
+
12
+ The official hiscores API for Old School RuneScape (OSRS) can return CSV or a simple JSON array.
13
+ This wrapper converts the hiscores data into a more usable JSON object and provides extra information about the given player. By comparing player info it infers the player's game mode, as well as any previous modes (de-ultimated, de-ironed and/or died as a hardcore ironman).
14
+
15
+ Additional functions are provided that screen-scrape the OSRS leaderboards and return a list of players as json. Also simple utility functions are provided to fetch the raw responses from Jagex's APIs, if desired.
16
+
17
+ `osrs-json-hiscores` has TypeScript support, with full definitions for all functions and custom data types.
18
+
19
+ ---
20
+
21
+ ### ⚠ Disclaimer ⚠
22
+
23
+ Jagex does not provide `Access-Control-Allow-Origin` headers in their responses. This means that [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) will block all browser requests to their hiscores API. In order to get around this, osrs-json-hiscores needs to be installed on the server side and exposed to the front end via a simple API. Here is an example of this in use: [codesandbox.io/s/osrs-json-hiscores-demo](https://codesandbox.io/s/osrs-json-hiscores-demo-qz656)
24
+
25
+ TLDR: You cannot use this library directly in your client side app e.g. React or Vue, you must set up a server which uses this lib internally and have your client fetch data from your server.
26
+
27
+ ---
28
+
29
+ ## Installation
30
+
31
+ With npm:
32
+
33
+ ```
34
+ $ npm install osrs-json-hiscores
35
+ ```
36
+
37
+ With Yarn:
38
+
39
+ ```
40
+ $ yarn add osrs-json-hiscores
41
+ ```
42
+
43
+ ## How to use
44
+
45
+ Install the package and then import it into your project:
46
+
47
+ ```typescript
48
+ import { getStatsByGamemode, getSkillPage } from 'osrs-json-hiscores';
49
+ ```
50
+
51
+ Once you import it you can call the functions asynchronously:
52
+
53
+ ```typescript
54
+ const stats = await getStatsByGamemode('Lynx Titan');
55
+ const topPage = await getSkillPage('overall');
56
+ ```
57
+
58
+ `getStats` will return a full player object with gamemode.
59
+ `getStatsByGameMode` will return a stats object and accepts a gamemode parameter:
60
+
61
+ | Game mode | Param |
62
+ | ---------------- | :----------: |
63
+ | Regular | `main` |
64
+ | Ironman | `ironman` |
65
+ | Hardcore Ironman | `hardcore` |
66
+ | Ultimate Ironman | `ultimate` |
67
+ | Deadman Mode | `deadman` |
68
+ | Tournament | `tournament` |
69
+ | Leagues | `seasonal` |
70
+
71
+ `getSkillPage` and `getActivityPage` require a skill / activity and optionally a gamemode and page:
72
+
73
+ ```typescript
74
+ getSkillPage('attack', 'main', 1)
75
+ .then((res) => console.log(res))
76
+ .catch((err) => console.error(err));
77
+ ```
78
+
79
+ Activities consist of all levels of clue scrolls as well as minigames and bosses:
80
+
81
+ ### Clue Scrolls
82
+
83
+ | Type | Param |
84
+ | -------- | :-------------: |
85
+ | All | `allClues` |
86
+ | Beginner | `beginnerClues` |
87
+ | Easy | `easyClues` |
88
+ | Medium | `mediumClues` |
89
+ | Hard | `hardClues` |
90
+ | Elite | `eliteClues` |
91
+ | Master | `masterClues` |
92
+
93
+ ### Minigames
94
+
95
+ | Minigame | Param |
96
+ | ------------------------------- | :-----------------: |
97
+ | Bounty Hunter (Legacy - Rogue) | `rogueBH` |
98
+ | Bounty Hunter (Legacy - Hunter) | `hunterBH` |
99
+ | Bounty Hunter (Rogue) | `rogueBHV2` |
100
+ | Bounty Hunter (Hunter) | `hunterBHV2` |
101
+ | LMS - Rank | `lastManStanding` |
102
+ | PvP Arena - Rank | `pvpArena` |
103
+ | Soul Wars Zeal | `soulWarsZeal` |
104
+ | Rifts closed | `riftsClosed` |
105
+ | Colosseum Glory | `colosseumGlory` |
106
+ | Collections Logged | `collectionsLogged` |
107
+
108
+ ### Points
109
+
110
+ | Activity | Param |
111
+ | -------------- | :-------------: |
112
+ | League Points | `leaguePoints` |
113
+ | Deadman Points | `deadmanPoints` |
114
+
115
+ ### Bosses
116
+
117
+ | Boss Name | Param |
118
+ | --------------------------------- | :----------------------------: |
119
+ | Abyssal Sire | `abyssalSire` |
120
+ | Alchemical Hydra | `alchemicalHydra` |
121
+ | Amoxliatl | `amoxliatl` |
122
+ | Araxxor | `araxxor` |
123
+ | Artio | `artio` |
124
+ | Barrows Chests | `barrows` |
125
+ | Bryophyta | `bryophyta` |
126
+ | Callisto | `callisto` |
127
+ | Calvar'ion | `calvarion` |
128
+ | Cerberus | `cerberus` |
129
+ | Chambers Of Xeric | `chambersOfXeric` |
130
+ | Chambers Of Xeric: Challenge Mode | `chambersOfXericChallengeMode` |
131
+ | Chaos Elemental | `chaosElemental` |
132
+ | Chaos Fanatic | `chaosFanatic` |
133
+ | Commander Zilyana | `commanderZilyana` |
134
+ | Corporeal Beast | `corporealBeast` |
135
+ | Crazy Archaeologist | `crazyArchaeologist` |
136
+ | Dagannoth Prime | `dagannothPrime` |
137
+ | Dagannoth Rex | `dagannothRex` |
138
+ | Dagannoth Supreme | `dagannothSupreme` |
139
+ | Deranged Archaeologist | `derangedArchaeologist` |
140
+ | Duke Sucellus | `dukeSucellus` |
141
+ | General Graardor | `generalGraardor` |
142
+ | Giant Mole | `giantMole` |
143
+ | Grotesque Guardians | `grotesqueGuardians` |
144
+ | Hespori | `hespori` |
145
+ | Kalphite Queen | `kalphiteQueen` |
146
+ | King Black Dragon | `kingBlackDragon` |
147
+ | Kraken | `kraken` |
148
+ | Kreearra | `kreeArra` |
149
+ | K'ril Tsutsaroth | `krilTsutsaroth` |
150
+ | Lunar Chests | `lunarChests` |
151
+ | Mimic | `mimic` |
152
+ | Nex | `nex` |
153
+ | Nightmare | `nightmare` |
154
+ | Phosani's Nightmare | `phosanisNightmare` |
155
+ | Obor | `obor` |
156
+ | Phantom Muspah | `phantomMuspah` |
157
+ | Sarachnis | `sarachnis` |
158
+ | Scorpia | `scorpia` |
159
+ | Scurrius | `scurrius` |
160
+ | Skotizo | `skotizo` |
161
+ | Sol Heredit | `solHeredit` |
162
+ | Spindel | `spindel` |
163
+ | Tempoross | `tempoross` |
164
+ | The Gauntlet | `gauntlet` |
165
+ | The Corrupted Gauntlet | `corruptedGauntlet` |
166
+ | The Hueycoatl | `hueycoatl` |
167
+ | The Leviathan | `leviathan` |
168
+ | The Royal Titans | `royalTitans` |
169
+ | The Whisperer | `whisperer` |
170
+ | Theatre Of Blood | `theatreOfBlood` |
171
+ | Theatre Of Blood: Hard Mode | `theatreOfBloodHardMode` |
172
+ | Thermonuclear Smoke Devil | `thermonuclearSmokeDevil` |
173
+ | Tombs of Amascut | `tombsOfAmascut` |
174
+ | Tombs of Amascut: Expert Mode | `tombsOfAmascutExpertMode` |
175
+ | TzKal-Zuk | `tzKalZuk` |
176
+ | TzTok-Jad | `tzTokJad` |
177
+ | Vardorvis | `vardorvis` |
178
+ | Venenatis | `venenatis` |
179
+ | Vetion | `vetion` |
180
+ | Vorkath | `vorkath` |
181
+ | Wintertodt | `wintertodt` |
182
+ | Zalcano | `zalcano` |
183
+ | Zulrah | `zulrah` |
184
+
185
+ ## What you'll get
186
+
187
+ `getStats` returns a player object that looks like this:
188
+
189
+ ```typescript
190
+ {
191
+ name: 'Lynx Titan',
192
+ mode: 'main',
193
+ dead: false,
194
+ deulted: false,
195
+ deironed: false,
196
+ main: {
197
+ skills: {
198
+ overall: {rank: 1, level: 2277, xp: 4600000000},
199
+ attack: {},
200
+ defence: {},
201
+ // ...
202
+ },
203
+ clues: {},
204
+ leaguePoints: {},
205
+ bountyHunter: {},
206
+ lastManStanding: {},
207
+ pvpArena: {},
208
+ soulWarsZeal: {},
209
+ riftsClosed: {},
210
+ colosseumGlory: {},
211
+ collectionsLogged: {},
212
+ bosses: {}
213
+ }
214
+ }
215
+ ```
216
+
217
+ `getSkillPage` returns and array of 25 players (This represents a page on the hiscores):
218
+
219
+ ```typescript
220
+ [
221
+ { rank: 1, name: 'Lynx Titan', level: 2277, xp: 4600000000, dead: false },
222
+ {},
223
+ {}
224
+ // ...
225
+ ];
226
+ ```
227
+
228
+ ## Helpful Extras
229
+
230
+ Get the properly formatted name of any skill, boss, clue or other activity:
231
+
232
+ ```typescript
233
+ // kril === "K'ril Tsutsaroth"
234
+ const kril = FORMATTED_BOSS_NAMES['krilTsutsaroth'];
235
+ ```
package/lib/hiscores.d.ts CHANGED
@@ -16,7 +16,7 @@ export declare function getOfficialStats(rsn: string, mode?: Gamemode, config?:
16
16
  * @param config Optional axios request config object.
17
17
  * @returns Formatted version of the rsn.
18
18
  */
19
- export declare function getRSNFormat(rsn: string, config?: AxiosRequestConfig): Promise<string>;
19
+ export declare function getRSNFormat(rsn: string, config?: AxiosRequestConfig, mode?: Gamemode): Promise<string>;
20
20
  /**
21
21
  * Parses official JSON object of raw stats and returns a stats object.
22
22
  *
package/lib/hiscores.js CHANGED
@@ -96,14 +96,15 @@ exports.getOfficialStats = getOfficialStats;
96
96
  * @param config Optional axios request config object.
97
97
  * @returns Formatted version of the rsn.
98
98
  */
99
- function getRSNFormat(rsn, config) {
99
+ function getRSNFormat(rsn, config, mode) {
100
+ if (mode === void 0) { mode = 'main'; }
100
101
  return __awaiter(this, void 0, void 0, function () {
101
102
  var url, response, dom, anchor, _a;
102
103
  return __generator(this, function (_b) {
103
104
  switch (_b.label) {
104
105
  case 0:
105
106
  (0, utils_1.validateRSN)(rsn);
106
- url = (0, utils_1.getPlayerTableURL)('main', rsn);
107
+ url = (0, utils_1.getPlayerTableURL)(mode, rsn);
107
108
  _b.label = 1;
108
109
  case 1:
109
110
  _b.trys.push([1, 3, , 4]);
@@ -115,11 +116,11 @@ function getRSNFormat(rsn, config) {
115
116
  if (anchor) {
116
117
  return [2 /*return*/, (0, utils_1.rsnFromElement)(anchor)];
117
118
  }
118
- throw new utils_1.PlayerNotFoundError();
119
+ return [3 /*break*/, 4];
119
120
  case 3:
120
121
  _a = _b.sent();
121
122
  throw new utils_1.HiScoresError();
122
- case 4: return [2 /*return*/];
123
+ case 4: throw new utils_1.PlayerNotFoundError();
123
124
  }
124
125
  });
125
126
  });
@@ -176,6 +177,7 @@ function parseJsonStats(json) {
176
177
  var soulWarsZeal = getActivity(utils_1.FORMATTED_SOUL_WARS);
177
178
  var riftsClosed = getActivity(utils_1.FORMATTED_RIFTS_CLOSED);
178
179
  var colosseumGlory = getActivity(utils_1.FORMATTED_COLOSSEUM_GLORY);
180
+ var collectionsLogged = getActivity(utils_1.FORMATTED_COLLECTIONS_LOGGED);
179
181
  var stats = {
180
182
  skills: skills,
181
183
  leaguePoints: leaguePoints,
@@ -186,6 +188,7 @@ function parseJsonStats(json) {
186
188
  soulWarsZeal: soulWarsZeal,
187
189
  riftsClosed: riftsClosed,
188
190
  colosseumGlory: colosseumGlory,
191
+ collectionsLogged: collectionsLogged,
189
192
  clues: clues,
190
193
  bosses: bosses
191
194
  };
@@ -230,7 +233,7 @@ function parseStats(csv) {
230
233
  var _a = activityObjects.splice(0, 2), leaguePoints = _a[0], deadmanPoints = _a[1];
231
234
  var bhObjects = activityObjects.splice(0, utils_1.BH_MODES.length);
232
235
  var clueObjects = activityObjects.splice(0, utils_1.CLUES.length);
233
- var _b = activityObjects.splice(0, 5), lastManStanding = _b[0], pvpArena = _b[1], soulWarsZeal = _b[2], riftsClosed = _b[3], colosseumGlory = _b[4];
236
+ var _b = activityObjects.splice(0, 6), lastManStanding = _b[0], pvpArena = _b[1], soulWarsZeal = _b[2], riftsClosed = _b[3], colosseumGlory = _b[4], collectionsLogged = _b[5];
234
237
  var bossObjects = activityObjects.splice(0, utils_1.BOSSES.length);
235
238
  var skills = skillObjects.reduce(function (prev, curr, index) {
236
239
  var newSkills = __assign({}, prev);
@@ -262,6 +265,7 @@ function parseStats(csv) {
262
265
  soulWarsZeal: soulWarsZeal,
263
266
  riftsClosed: riftsClosed,
264
267
  colosseumGlory: colosseumGlory,
268
+ collectionsLogged: collectionsLogged,
265
269
  clues: clues,
266
270
  bosses: bosses
267
271
  };
package/lib/types.d.ts CHANGED
@@ -21,11 +21,11 @@ export type BHType = 'rogue' | 'hunter' | 'rogueV2' | 'hunterV2';
21
21
  export type BH = {
22
22
  [Type in BHType]: Activity;
23
23
  };
24
- export type Boss = 'abyssalSire' | 'alchemicalHydra' | 'amoxliatl' | 'araxxor' | 'artio' | 'barrows' | 'bryophyta' | 'callisto' | 'calvarion' | 'cerberus' | 'chambersOfXeric' | 'chambersOfXericChallengeMode' | 'chaosElemental' | 'chaosFanatic' | 'commanderZilyana' | 'corporealBeast' | 'crazyArchaeologist' | 'dagannothPrime' | 'dagannothRex' | 'dagannothSupreme' | 'derangedArchaeologist' | 'dukeSucellus' | 'generalGraardor' | 'giantMole' | 'grotesqueGuardians' | 'hespori' | 'kalphiteQueen' | 'kingBlackDragon' | 'kraken' | 'kreeArra' | 'krilTsutsaroth' | 'lunarChests' | 'mimic' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'phantomMuspah' | 'sarachnis' | 'scorpia' | 'scurrius' | 'skotizo' | 'solHeredit' | 'spindel' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'hueycoatl' | 'leviathan' | 'whisperer' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'vardorvis' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
24
+ export type Boss = 'abyssalSire' | 'alchemicalHydra' | 'amoxliatl' | 'araxxor' | 'artio' | 'barrows' | 'bryophyta' | 'callisto' | 'calvarion' | 'cerberus' | 'chambersOfXeric' | 'chambersOfXericChallengeMode' | 'chaosElemental' | 'chaosFanatic' | 'commanderZilyana' | 'corporealBeast' | 'crazyArchaeologist' | 'dagannothPrime' | 'dagannothRex' | 'dagannothSupreme' | 'derangedArchaeologist' | 'dukeSucellus' | 'generalGraardor' | 'giantMole' | 'grotesqueGuardians' | 'hespori' | 'kalphiteQueen' | 'kingBlackDragon' | 'kraken' | 'kreeArra' | 'krilTsutsaroth' | 'lunarChests' | 'mimic' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'phantomMuspah' | 'sarachnis' | 'scorpia' | 'scurrius' | 'skotizo' | 'solHeredit' | 'spindel' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'hueycoatl' | 'leviathan' | 'royalTitans' | 'whisperer' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'vardorvis' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
25
25
  export type Bosses = {
26
26
  [Type in Boss]: Activity;
27
27
  };
28
- export type ActivityName = 'leaguePoints' | 'deadmanPoints' | 'hunterBHV2' | 'rogueBHV2' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | 'colosseumGlory' | Boss;
28
+ export type ActivityName = 'leaguePoints' | 'deadmanPoints' | 'hunterBHV2' | 'rogueBHV2' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | 'colosseumGlory' | 'collectionsLogged' | Boss;
29
29
  export interface Stats {
30
30
  skills: Skills;
31
31
  clues: Clues;
@@ -43,6 +43,7 @@ export interface Stats {
43
43
  soulWarsZeal: Activity;
44
44
  riftsClosed: Activity;
45
45
  colosseumGlory: Activity;
46
+ collectionsLogged: Activity;
46
47
  bosses: Bosses;
47
48
  }
48
49
  export type Modes = {
@@ -36,6 +36,7 @@ export declare const FORMATTED_LEAGUE_POINTS = "League Points";
36
36
  export declare const FORMATTED_DEADMAN_POINTS = "Deadman Points";
37
37
  export declare const FORMATTED_RIFTS_CLOSED = "Rifts closed";
38
38
  export declare const FORMATTED_COLOSSEUM_GLORY = "Colosseum Glory";
39
+ export declare const FORMATTED_COLLECTIONS_LOGGED = "Collections Logged";
39
40
  export declare const INVALID_FORMAT_ERROR = "Invalid hiscores format";
40
41
  export declare const PLAYER_NOT_FOUND_ERROR = "Player not found";
41
42
  export declare const HISCORES_ERROR = "HiScores not responding";
@@ -24,7 +24,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
24
  return to.concat(ar || Array.prototype.slice.call(from));
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.HiScoresError = exports.PlayerNotFoundError = exports.InvalidRSNError = exports.InvalidFormatError = exports.HISCORES_ERROR = exports.PLAYER_NOT_FOUND_ERROR = exports.INVALID_FORMAT_ERROR = exports.FORMATTED_COLOSSEUM_GLORY = exports.FORMATTED_RIFTS_CLOSED = exports.FORMATTED_DEADMAN_POINTS = exports.FORMATTED_LEAGUE_POINTS = exports.FORMATTED_SOUL_WARS = exports.FORMATTED_PVP_ARENA = exports.FORMATTED_LMS = exports.FORMATTED_BH_NAMES = exports.FORMATTED_CLUE_NAMES = exports.FORMATTED_SKILL_NAMES = exports.FORMATTED_BOSS_NAMES = exports.ACTIVITIES = exports.BOSSES = exports.GAMEMODES = exports.BH_MODES = exports.CLUES = exports.SKILLS = exports.GAMEMODE_URL = exports.SCORES_URL = exports.JSON_STATS_URL = exports.STATS_URL = exports.BASE_URL = void 0;
27
+ exports.HiScoresError = exports.PlayerNotFoundError = exports.InvalidRSNError = exports.InvalidFormatError = exports.HISCORES_ERROR = exports.PLAYER_NOT_FOUND_ERROR = exports.INVALID_FORMAT_ERROR = exports.FORMATTED_COLLECTIONS_LOGGED = exports.FORMATTED_COLOSSEUM_GLORY = exports.FORMATTED_RIFTS_CLOSED = exports.FORMATTED_DEADMAN_POINTS = exports.FORMATTED_LEAGUE_POINTS = exports.FORMATTED_SOUL_WARS = exports.FORMATTED_PVP_ARENA = exports.FORMATTED_LMS = exports.FORMATTED_BH_NAMES = exports.FORMATTED_CLUE_NAMES = exports.FORMATTED_SKILL_NAMES = exports.FORMATTED_BOSS_NAMES = exports.ACTIVITIES = exports.BOSSES = exports.GAMEMODES = exports.BH_MODES = exports.CLUES = exports.SKILLS = exports.GAMEMODE_URL = exports.SCORES_URL = exports.JSON_STATS_URL = exports.STATS_URL = exports.BASE_URL = void 0;
28
28
  exports.BASE_URL = 'https://secure.runescape.com/m=hiscore_oldschool';
29
29
  exports.STATS_URL = 'index_lite.ws?player=';
30
30
  exports.JSON_STATS_URL = 'index_lite.json?player=';
@@ -136,6 +136,7 @@ exports.BOSSES = [
136
136
  'corruptedGauntlet',
137
137
  'hueycoatl',
138
138
  'leviathan',
139
+ 'royalTitans',
139
140
  'whisperer',
140
141
  'theatreOfBlood',
141
142
  'theatreOfBloodHardMode',
@@ -170,7 +171,8 @@ exports.ACTIVITIES = __spreadArray([
170
171
  'pvpArena',
171
172
  'soulWarsZeal',
172
173
  'riftsClosed',
173
- 'colosseumGlory'
174
+ 'colosseumGlory',
175
+ 'collectionsLogged'
174
176
  ], exports.BOSSES, true);
175
177
  exports.FORMATTED_BOSS_NAMES = {
176
178
  abyssalSire: 'Abyssal Sire',
@@ -222,6 +224,7 @@ exports.FORMATTED_BOSS_NAMES = {
222
224
  corruptedGauntlet: 'The Corrupted Gauntlet',
223
225
  hueycoatl: 'The Hueycoatl',
224
226
  leviathan: 'The Leviathan',
227
+ royalTitans: 'The Royal Titans',
225
228
  whisperer: 'The Whisperer',
226
229
  theatreOfBlood: 'Theatre of Blood',
227
230
  theatreOfBloodHardMode: 'Theatre of Blood: Hard Mode',
@@ -286,6 +289,7 @@ exports.FORMATTED_LEAGUE_POINTS = 'League Points';
286
289
  exports.FORMATTED_DEADMAN_POINTS = 'Deadman Points';
287
290
  exports.FORMATTED_RIFTS_CLOSED = 'Rifts closed';
288
291
  exports.FORMATTED_COLOSSEUM_GLORY = 'Colosseum Glory';
292
+ exports.FORMATTED_COLLECTIONS_LOGGED = 'Collections Logged';
289
293
  exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
290
294
  exports.PLAYER_NOT_FOUND_ERROR = 'Player not found';
291
295
  exports.HISCORES_ERROR = 'HiScores not responding';
package/package.json CHANGED
@@ -1,119 +1,119 @@
1
- {
2
- "name": "osrs-json-hiscores",
3
- "version": "2.20.0",
4
- "description": "The Old School Runescape API wrapper that does more!",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "files": [
8
- "lib/**/*"
9
- ],
10
- "scripts": {
11
- "dev": "yarn build --watch",
12
- "build": "tsc",
13
- "format": "prettier --write \"src/**/*.ts\"",
14
- "lint": "eslint --fix \"src/**/*.ts\"",
15
- "test": "jest",
16
- "prepublish": "yarn run build",
17
- "release": "np"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/maxswa/osrs-json-hiscores.git"
22
- },
23
- "keywords": [
24
- "oldschool",
25
- "runescape",
26
- "osrs",
27
- "api",
28
- "json",
29
- "hiscores",
30
- "stats",
31
- "skills"
32
- ],
33
- "publishConfig": {
34
- "registry": "https://registry.npmjs.org"
35
- },
36
- "author": "maxswa",
37
- "license": "ISC",
38
- "bugs": {
39
- "url": "https://github.com/maxswa/osrs-json-hiscores/issues"
40
- },
41
- "homepage": "https://github.com/maxswa/osrs-json-hiscores#readme",
42
- "husky": {
43
- "hooks": {
44
- "pre-commit": "lint-staged"
45
- }
46
- },
47
- "lint-staged": {
48
- "*.{ts}": [
49
- "eslint --fix",
50
- "prettier --write",
51
- "git add"
52
- ]
53
- },
54
- "eslintConfig": {
55
- "root": true,
56
- "parser": "@typescript-eslint/parser",
57
- "parserOptions": {
58
- "project": "./tsconfig.eslint.json"
59
- },
60
- "plugins": [
61
- "@typescript-eslint"
62
- ],
63
- "extends": [
64
- "airbnb-base",
65
- "airbnb-typescript/base",
66
- "prettier"
67
- ],
68
- "ignorePatterns": [
69
- "**/@types/*"
70
- ],
71
- "rules": {
72
- "max-classes-per-file": "off"
73
- }
74
- },
75
- "prettier": {
76
- "trailingComma": "none",
77
- "tabWidth": 2,
78
- "semi": true,
79
- "singleQuote": true,
80
- "endOfLine": "auto"
81
- },
82
- "jest": {
83
- "transform": {
84
- "^.+\\.(t|j)sx?$": "ts-jest"
85
- },
86
- "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
87
- "moduleFileExtensions": [
88
- "ts",
89
- "tsx",
90
- "js",
91
- "jsx",
92
- "json",
93
- "node"
94
- ],
95
- "testEnvironment": "node"
96
- },
97
- "dependencies": {
98
- "axios": "^1.6.2",
99
- "jsdom": "^22.1.0",
100
- "useragent-generator": "^1.1.0"
101
- },
102
- "devDependencies": {
103
- "@types/jest": "^29.5.3",
104
- "@types/jsdom": "^21.1.1",
105
- "@typescript-eslint/eslint-plugin": "^6.0.0",
106
- "@typescript-eslint/parser": "^6.0.0",
107
- "eslint": "^8.44.0",
108
- "eslint-config-airbnb-typescript": "^17.1.0",
109
- "eslint-config-prettier": "^8.8.0",
110
- "eslint-plugin-import": "^2.27.5",
111
- "husky": "^5.2.0",
112
- "jest": "^29.6.1",
113
- "lint-staged": "^13.2.3",
114
- "np": "^7.7.0",
115
- "prettier": "^3.0.0",
116
- "ts-jest": "^29.1.1",
117
- "typescript": "^5.1.6"
118
- }
119
- }
1
+ {
2
+ "name": "osrs-json-hiscores",
3
+ "version": "2.21.1",
4
+ "description": "The Old School Runescape API wrapper that does more!",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": [
8
+ "lib/**/*"
9
+ ],
10
+ "scripts": {
11
+ "dev": "yarn build --watch",
12
+ "build": "tsc",
13
+ "format": "prettier --write \"src/**/*.ts\"",
14
+ "lint": "eslint --fix \"src/**/*.ts\"",
15
+ "test": "jest",
16
+ "prepublish": "yarn run build",
17
+ "release": "np"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/maxswa/osrs-json-hiscores.git"
22
+ },
23
+ "keywords": [
24
+ "oldschool",
25
+ "runescape",
26
+ "osrs",
27
+ "api",
28
+ "json",
29
+ "hiscores",
30
+ "stats",
31
+ "skills"
32
+ ],
33
+ "publishConfig": {
34
+ "registry": "https://registry.npmjs.org"
35
+ },
36
+ "author": "maxswa",
37
+ "license": "ISC",
38
+ "bugs": {
39
+ "url": "https://github.com/maxswa/osrs-json-hiscores/issues"
40
+ },
41
+ "homepage": "https://github.com/maxswa/osrs-json-hiscores#readme",
42
+ "husky": {
43
+ "hooks": {
44
+ "pre-commit": "lint-staged"
45
+ }
46
+ },
47
+ "lint-staged": {
48
+ "*.{ts}": [
49
+ "eslint --fix",
50
+ "prettier --write",
51
+ "git add"
52
+ ]
53
+ },
54
+ "eslintConfig": {
55
+ "root": true,
56
+ "parser": "@typescript-eslint/parser",
57
+ "parserOptions": {
58
+ "project": "./tsconfig.eslint.json"
59
+ },
60
+ "plugins": [
61
+ "@typescript-eslint"
62
+ ],
63
+ "extends": [
64
+ "airbnb-base",
65
+ "airbnb-typescript/base",
66
+ "prettier"
67
+ ],
68
+ "ignorePatterns": [
69
+ "**/@types/*"
70
+ ],
71
+ "rules": {
72
+ "max-classes-per-file": "off"
73
+ }
74
+ },
75
+ "prettier": {
76
+ "trailingComma": "none",
77
+ "tabWidth": 2,
78
+ "semi": true,
79
+ "singleQuote": true,
80
+ "endOfLine": "auto"
81
+ },
82
+ "jest": {
83
+ "transform": {
84
+ "^.+\\.(t|j)sx?$": "ts-jest"
85
+ },
86
+ "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
87
+ "moduleFileExtensions": [
88
+ "ts",
89
+ "tsx",
90
+ "js",
91
+ "jsx",
92
+ "json",
93
+ "node"
94
+ ],
95
+ "testEnvironment": "node"
96
+ },
97
+ "dependencies": {
98
+ "axios": "^1.6.2",
99
+ "jsdom": "^22.1.0",
100
+ "useragent-generator": "^1.1.0"
101
+ },
102
+ "devDependencies": {
103
+ "@types/jest": "^29.5.3",
104
+ "@types/jsdom": "^21.1.1",
105
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
106
+ "@typescript-eslint/parser": "^6.0.0",
107
+ "eslint": "^8.44.0",
108
+ "eslint-config-airbnb-typescript": "^17.1.0",
109
+ "eslint-config-prettier": "^8.8.0",
110
+ "eslint-plugin-import": "^2.27.5",
111
+ "husky": "^5.2.0",
112
+ "jest": "^29.6.1",
113
+ "lint-staged": "^13.2.3",
114
+ "np": "^7.7.0",
115
+ "prettier": "^3.0.0",
116
+ "ts-jest": "^29.1.1",
117
+ "typescript": "^5.1.6"
118
+ }
119
+ }