osrs-json-hiscores 2.19.0 → 2.21.0
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 +235 -229
- package/lib/hiscores.js +4 -1
- package/lib/types.d.ts +3 -2
- package/lib/utils/constants.d.ts +1 -0
- package/lib/utils/constants.js +10 -2
- package/package.json +119 -119
package/README.md
CHANGED
@@ -1,229 +1,235 @@
|
|
1
|
-
# OSRS .json Hiscores
|
2
|
-
|
3
|
-
[](https://www.npmjs.com/package/osrs-json-hiscores)
|
4
|
-
[](https://npm-stat.com/charts.html?package=osrs-json-hiscores)
|
5
|
-
[](https://github.com/maxswa/osrs-json-hiscores/blob/master/src/types.ts)
|
6
|
-
[](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 |
|
96
|
-
| ------------------------------- |
|
97
|
-
| Bounty Hunter (Legacy - Rogue) |
|
98
|
-
| Bounty Hunter (Legacy - Hunter) |
|
99
|
-
| Bounty Hunter (Rogue) |
|
100
|
-
| Bounty Hunter (Hunter) |
|
101
|
-
| LMS - Rank |
|
102
|
-
| PvP Arena - Rank |
|
103
|
-
| Soul Wars Zeal |
|
104
|
-
| Rifts closed |
|
105
|
-
| Colosseum Glory |
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
| Dagannoth
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
| The
|
165
|
-
| The
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
`
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
}
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
```
|
227
|
-
|
228
|
-
|
229
|
-
|
1
|
+
# OSRS .json Hiscores
|
2
|
+
|
3
|
+
[](https://www.npmjs.com/package/osrs-json-hiscores)
|
4
|
+
[](https://npm-stat.com/charts.html?package=osrs-json-hiscores)
|
5
|
+
[](https://github.com/maxswa/osrs-json-hiscores/blob/master/src/types.ts)
|
6
|
+
[](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.js
CHANGED
@@ -176,6 +176,7 @@ function parseJsonStats(json) {
|
|
176
176
|
var soulWarsZeal = getActivity(utils_1.FORMATTED_SOUL_WARS);
|
177
177
|
var riftsClosed = getActivity(utils_1.FORMATTED_RIFTS_CLOSED);
|
178
178
|
var colosseumGlory = getActivity(utils_1.FORMATTED_COLOSSEUM_GLORY);
|
179
|
+
var collectionsLogged = getActivity(utils_1.FORMATTED_COLLECTIONS_LOGGED);
|
179
180
|
var stats = {
|
180
181
|
skills: skills,
|
181
182
|
leaguePoints: leaguePoints,
|
@@ -186,6 +187,7 @@ function parseJsonStats(json) {
|
|
186
187
|
soulWarsZeal: soulWarsZeal,
|
187
188
|
riftsClosed: riftsClosed,
|
188
189
|
colosseumGlory: colosseumGlory,
|
190
|
+
collectionsLogged: collectionsLogged,
|
189
191
|
clues: clues,
|
190
192
|
bosses: bosses
|
191
193
|
};
|
@@ -230,7 +232,7 @@ function parseStats(csv) {
|
|
230
232
|
var _a = activityObjects.splice(0, 2), leaguePoints = _a[0], deadmanPoints = _a[1];
|
231
233
|
var bhObjects = activityObjects.splice(0, utils_1.BH_MODES.length);
|
232
234
|
var clueObjects = activityObjects.splice(0, utils_1.CLUES.length);
|
233
|
-
var _b = activityObjects.splice(0,
|
235
|
+
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
236
|
var bossObjects = activityObjects.splice(0, utils_1.BOSSES.length);
|
235
237
|
var skills = skillObjects.reduce(function (prev, curr, index) {
|
236
238
|
var newSkills = __assign({}, prev);
|
@@ -262,6 +264,7 @@ function parseStats(csv) {
|
|
262
264
|
soulWarsZeal: soulWarsZeal,
|
263
265
|
riftsClosed: riftsClosed,
|
264
266
|
colosseumGlory: colosseumGlory,
|
267
|
+
collectionsLogged: collectionsLogged,
|
265
268
|
clues: clues,
|
266
269
|
bosses: bosses
|
267
270
|
};
|
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' | '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' | '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 = {
|
package/lib/utils/constants.d.ts
CHANGED
@@ -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";
|
package/lib/utils/constants.js
CHANGED
@@ -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=';
|
@@ -89,6 +89,7 @@ exports.GAMEMODES = [
|
|
89
89
|
exports.BOSSES = [
|
90
90
|
'abyssalSire',
|
91
91
|
'alchemicalHydra',
|
92
|
+
'amoxliatl',
|
92
93
|
'araxxor',
|
93
94
|
'artio',
|
94
95
|
'barrows',
|
@@ -133,7 +134,9 @@ exports.BOSSES = [
|
|
133
134
|
'tempoross',
|
134
135
|
'gauntlet',
|
135
136
|
'corruptedGauntlet',
|
137
|
+
'hueycoatl',
|
136
138
|
'leviathan',
|
139
|
+
'royalTitans',
|
137
140
|
'whisperer',
|
138
141
|
'theatreOfBlood',
|
139
142
|
'theatreOfBloodHardMode',
|
@@ -168,11 +171,13 @@ exports.ACTIVITIES = __spreadArray([
|
|
168
171
|
'pvpArena',
|
169
172
|
'soulWarsZeal',
|
170
173
|
'riftsClosed',
|
171
|
-
'colosseumGlory'
|
174
|
+
'colosseumGlory',
|
175
|
+
'collectionsLogged'
|
172
176
|
], exports.BOSSES, true);
|
173
177
|
exports.FORMATTED_BOSS_NAMES = {
|
174
178
|
abyssalSire: 'Abyssal Sire',
|
175
179
|
alchemicalHydra: 'Alchemical Hydra',
|
180
|
+
amoxliatl: 'Amoxliatl',
|
176
181
|
araxxor: 'Araxxor',
|
177
182
|
artio: 'Artio',
|
178
183
|
barrows: 'Barrows Chests',
|
@@ -217,7 +222,9 @@ exports.FORMATTED_BOSS_NAMES = {
|
|
217
222
|
tempoross: 'Tempoross',
|
218
223
|
gauntlet: 'The Gauntlet',
|
219
224
|
corruptedGauntlet: 'The Corrupted Gauntlet',
|
225
|
+
hueycoatl: 'The Hueycoatl',
|
220
226
|
leviathan: 'The Leviathan',
|
227
|
+
royalTitans: 'The Royal Titans',
|
221
228
|
whisperer: 'The Whisperer',
|
222
229
|
theatreOfBlood: 'Theatre of Blood',
|
223
230
|
theatreOfBloodHardMode: 'Theatre of Blood: Hard Mode',
|
@@ -282,6 +289,7 @@ exports.FORMATTED_LEAGUE_POINTS = 'League Points';
|
|
282
289
|
exports.FORMATTED_DEADMAN_POINTS = 'Deadman Points';
|
283
290
|
exports.FORMATTED_RIFTS_CLOSED = 'Rifts closed';
|
284
291
|
exports.FORMATTED_COLOSSEUM_GLORY = 'Colosseum Glory';
|
292
|
+
exports.FORMATTED_COLLECTIONS_LOGGED = 'Collections Logged';
|
285
293
|
exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
|
286
294
|
exports.PLAYER_NOT_FOUND_ERROR = 'Player not found';
|
287
295
|
exports.HISCORES_ERROR = 'HiScores not responding';
|
package/package.json
CHANGED
@@ -1,119 +1,119 @@
|
|
1
|
-
{
|
2
|
-
"name": "osrs-json-hiscores",
|
3
|
-
"version": "2.
|
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.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
|
+
}
|