osrs-json-hiscores 2.6.0 → 2.9.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 +5 -0
- package/lib/hiscores.js +6 -1
- package/lib/types.d.ts +4 -2
- package/lib/utils/constants.d.ts +3 -0
- package/lib/utils/constants.js +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -109,7 +109,9 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses
|
|
109
109
|
| Bounty Hunter (Rogue) | `rogueBH` |
|
110
110
|
| Bounty Hunter (Hunter) | `hunterBH` |
|
111
111
|
| Last Man Standing | `lastManStanding` |
|
112
|
+
| PvP Arena | `pvpArena` |
|
112
113
|
| Soul Wars Zeal | `soulWarsZeal` |
|
114
|
+
| Rifts Closed | `riftsClosed` |
|
113
115
|
|
114
116
|
### Leagues
|
115
117
|
|
@@ -148,6 +150,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses
|
|
148
150
|
| Kreearra | `kreeArra` |
|
149
151
|
| K'ril Tsutsaroth | `krilTsutsaroth` |
|
150
152
|
| Mimic | `mimic` |
|
153
|
+
| Nex | `nex` |
|
151
154
|
| The Nightmare of Ashihama | `nightmare` |
|
152
155
|
| Phosani's Nightmare | `phosanisNightmare` |
|
153
156
|
| Obor | `obor` |
|
@@ -191,7 +194,9 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses
|
|
191
194
|
leaguePoints: {},
|
192
195
|
bountyHunter: {},
|
193
196
|
lastManStanding: {},
|
197
|
+
pvpArena: {},
|
194
198
|
soulWarsZeal: {},
|
199
|
+
riftsClosed: {},
|
195
200
|
bosses: {}
|
196
201
|
}
|
197
202
|
}
|
package/lib/hiscores.js
CHANGED
@@ -105,6 +105,9 @@ function parseStats(csv) {
|
|
105
105
|
.split('\n')
|
106
106
|
.filter(function (entry) { return !!entry; })
|
107
107
|
.map(function (stat) { return stat.split(','); });
|
108
|
+
if (splitCSV.length !== utils_1.SKILLS.length + utils_1.BH_MODES.length + utils_1.CLUES.length + utils_1.BOSSES.length + 5) {
|
109
|
+
throw Error(utils_1.INVALID_FORMAT_ERROR);
|
110
|
+
}
|
108
111
|
var skillObjects = splitCSV
|
109
112
|
.filter(function (stat) { return stat.length === 3; })
|
110
113
|
.map(function (stat) {
|
@@ -129,7 +132,7 @@ function parseStats(csv) {
|
|
129
132
|
var leaguePoints = activityObjects.splice(0, 1)[0];
|
130
133
|
var bhObjects = activityObjects.splice(0, utils_1.BH_MODES.length);
|
131
134
|
var clueObjects = activityObjects.splice(0, utils_1.CLUES.length);
|
132
|
-
var _a = activityObjects.splice(0,
|
135
|
+
var _a = activityObjects.splice(0, 4), lastManStanding = _a[0], pvpArena = _a[1], soulWarsZeal = _a[2], riftsClosed = _a[3];
|
133
136
|
var bossObjects = activityObjects.splice(0, utils_1.BOSSES.length);
|
134
137
|
var skills = skillObjects.reduce(function (prev, curr, index) {
|
135
138
|
var newSkills = __assign({}, prev);
|
@@ -156,7 +159,9 @@ function parseStats(csv) {
|
|
156
159
|
leaguePoints: leaguePoints,
|
157
160
|
bountyHunter: bountyHunter,
|
158
161
|
lastManStanding: lastManStanding,
|
162
|
+
pvpArena: pvpArena,
|
159
163
|
soulWarsZeal: soulWarsZeal,
|
164
|
+
riftsClosed: riftsClosed,
|
160
165
|
clues: clues,
|
161
166
|
bosses: bosses
|
162
167
|
};
|
package/lib/types.d.ts
CHANGED
@@ -20,18 +20,20 @@ export declare type BHType = 'rogue' | 'hunter';
|
|
20
20
|
export declare type BH = {
|
21
21
|
[Type in BHType]: Activity;
|
22
22
|
};
|
23
|
-
export declare type Boss = 'abyssalSire' | 'alchemicalHydra' | 'barrows' | 'bryophyta' | 'callisto' | 'cerberus' | 'chambersOfXeric' | 'chambersOfXericChallengeMode' | 'chaosElemental' | 'chaosFanatic' | 'commanderZilyana' | 'corporealBeast' | 'crazyArchaeologist' | 'dagannothPrime' | 'dagannothRex' | 'dagannothSupreme' | 'derangedArchaeologist' | 'generalGraardor' | 'giantMole' | 'grotesqueGuardians' | 'hespori' | 'kalphiteQueen' | 'kingBlackDragon' | 'kraken' | 'kreeArra' | 'krilTsutsaroth' | 'mimic' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'sarachnis' | 'scorpia' | 'skotizo' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tzKalZuk' | 'tzTokJad' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
|
23
|
+
export declare type Boss = 'abyssalSire' | 'alchemicalHydra' | 'barrows' | 'bryophyta' | 'callisto' | 'cerberus' | 'chambersOfXeric' | 'chambersOfXericChallengeMode' | 'chaosElemental' | 'chaosFanatic' | 'commanderZilyana' | 'corporealBeast' | 'crazyArchaeologist' | 'dagannothPrime' | 'dagannothRex' | 'dagannothSupreme' | 'derangedArchaeologist' | 'generalGraardor' | 'giantMole' | 'grotesqueGuardians' | 'hespori' | 'kalphiteQueen' | 'kingBlackDragon' | 'kraken' | 'kreeArra' | 'krilTsutsaroth' | 'mimic' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'sarachnis' | 'scorpia' | 'skotizo' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tzKalZuk' | 'tzTokJad' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
|
24
24
|
export declare type Bosses = {
|
25
25
|
[Type in Boss]: Activity;
|
26
26
|
};
|
27
|
-
export declare type ActivityName = 'leaguePoints' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'soulWarsZeal' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | Boss;
|
27
|
+
export declare type ActivityName = 'leaguePoints' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | Boss;
|
28
28
|
export interface Stats {
|
29
29
|
skills: Skills;
|
30
30
|
clues: Clues;
|
31
31
|
leaguePoints: Activity;
|
32
32
|
bountyHunter: BH;
|
33
33
|
lastManStanding: Activity;
|
34
|
+
pvpArena: Activity;
|
34
35
|
soulWarsZeal: Activity;
|
36
|
+
riftsClosed: Activity;
|
35
37
|
bosses: Bosses;
|
36
38
|
}
|
37
39
|
export declare type Modes = {
|
package/lib/utils/constants.d.ts
CHANGED
@@ -29,5 +29,8 @@ export declare type FormattedBHNames = {
|
|
29
29
|
};
|
30
30
|
export declare const FORMATTED_BH_NAMES: FormattedBHNames;
|
31
31
|
export declare const FORMATTED_LMS = "Last Man Standing";
|
32
|
+
export declare const FORMATTED_PVP_ARENA = "PvP Arena";
|
32
33
|
export declare const FORMATTED_SOUL_WARS = "Soul Wars Zeal";
|
33
34
|
export declare const FORMATTED_LEAGUE_POINTS = "League Points";
|
35
|
+
export declare const FORMATTED_RIFTS_CLOSED = "Rifts Closed";
|
36
|
+
export declare const INVALID_FORMAT_ERROR = "Invalid hiscores format";
|
package/lib/utils/constants.js
CHANGED
@@ -5,7 +5,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
5
5
|
return to;
|
6
6
|
};
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
8
|
-
exports.FORMATTED_LEAGUE_POINTS = exports.FORMATTED_SOUL_WARS = 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.STATS_URL = exports.BASE_URL = void 0;
|
8
|
+
exports.INVALID_FORMAT_ERROR = exports.FORMATTED_RIFTS_CLOSED = 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.STATS_URL = exports.BASE_URL = void 0;
|
9
9
|
exports.BASE_URL = 'https://secure.runescape.com/m=hiscore_oldschool';
|
10
10
|
exports.STATS_URL = 'index_lite.ws?player=';
|
11
11
|
exports.SCORES_URL = 'overall.ws?';
|
@@ -91,6 +91,7 @@ exports.BOSSES = [
|
|
91
91
|
'kreeArra',
|
92
92
|
'krilTsutsaroth',
|
93
93
|
'mimic',
|
94
|
+
'nex',
|
94
95
|
'nightmare',
|
95
96
|
'phosanisNightmare',
|
96
97
|
'obor',
|
@@ -124,7 +125,9 @@ exports.ACTIVITIES = __spreadArray([
|
|
124
125
|
'eliteClues',
|
125
126
|
'masterClues',
|
126
127
|
'lastManStanding',
|
127
|
-
'
|
128
|
+
'pvpArena',
|
129
|
+
'soulWarsZeal',
|
130
|
+
'riftsClosed'
|
128
131
|
], exports.BOSSES);
|
129
132
|
exports.FORMATTED_BOSS_NAMES = {
|
130
133
|
abyssalSire: 'Abyssal Sire',
|
@@ -154,6 +157,7 @@ exports.FORMATTED_BOSS_NAMES = {
|
|
154
157
|
kreeArra: "Kree'Arra",
|
155
158
|
krilTsutsaroth: "K'ril Tsutsaroth",
|
156
159
|
mimic: 'Mimic',
|
160
|
+
nex: 'Nex',
|
157
161
|
nightmare: 'The Nightmare of Ashihama',
|
158
162
|
phosanisNightmare: "Phosani's Nightmare",
|
159
163
|
obor: 'Obor',
|
@@ -215,5 +219,8 @@ exports.FORMATTED_BH_NAMES = {
|
|
215
219
|
hunter: 'Bounty Hunter - Hunter'
|
216
220
|
};
|
217
221
|
exports.FORMATTED_LMS = 'Last Man Standing';
|
222
|
+
exports.FORMATTED_PVP_ARENA = 'PvP Arena';
|
218
223
|
exports.FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
|
219
224
|
exports.FORMATTED_LEAGUE_POINTS = 'League Points';
|
225
|
+
exports.FORMATTED_RIFTS_CLOSED = 'Rifts Closed';
|
226
|
+
exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
|