osrs-json-hiscores 2.7.0 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,222 +1,230 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4
- to[j] = from[i];
5
- return to;
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.INVALID_FORMAT_ERROR = 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;
9
- exports.BASE_URL = 'https://secure.runescape.com/m=hiscore_oldschool';
10
- exports.STATS_URL = 'index_lite.ws?player=';
11
- exports.SCORES_URL = 'overall.ws?';
12
- exports.GAMEMODE_URL = {
13
- main: exports.BASE_URL + "/",
14
- ironman: exports.BASE_URL + "_ironman/",
15
- hardcore: exports.BASE_URL + "_hardcore_ironman/",
16
- ultimate: exports.BASE_URL + "_ultimate/",
17
- deadman: exports.BASE_URL + "_deadman/",
18
- seasonal: exports.BASE_URL + "_seasonal/",
19
- tournament: exports.BASE_URL + "_tournament/"
20
- };
21
- exports.SKILLS = [
22
- 'overall',
23
- 'attack',
24
- 'defence',
25
- 'strength',
26
- 'hitpoints',
27
- 'ranged',
28
- 'prayer',
29
- 'magic',
30
- 'cooking',
31
- 'woodcutting',
32
- 'fletching',
33
- 'fishing',
34
- 'firemaking',
35
- 'crafting',
36
- 'smithing',
37
- 'mining',
38
- 'herblore',
39
- 'agility',
40
- 'thieving',
41
- 'slayer',
42
- 'farming',
43
- 'runecraft',
44
- 'hunter',
45
- 'construction'
46
- ];
47
- exports.CLUES = [
48
- 'all',
49
- 'beginner',
50
- 'easy',
51
- 'medium',
52
- 'hard',
53
- 'elite',
54
- 'master'
55
- ];
56
- exports.BH_MODES = ['hunter', 'rogue'];
57
- exports.GAMEMODES = [
58
- 'main',
59
- 'ironman',
60
- 'hardcore',
61
- 'ultimate',
62
- 'deadman',
63
- 'seasonal',
64
- 'tournament'
65
- ];
66
- exports.BOSSES = [
67
- 'abyssalSire',
68
- 'alchemicalHydra',
69
- 'barrows',
70
- 'bryophyta',
71
- 'callisto',
72
- 'cerberus',
73
- 'chambersOfXeric',
74
- 'chambersOfXericChallengeMode',
75
- 'chaosElemental',
76
- 'chaosFanatic',
77
- 'commanderZilyana',
78
- 'corporealBeast',
79
- 'crazyArchaeologist',
80
- 'dagannothPrime',
81
- 'dagannothRex',
82
- 'dagannothSupreme',
83
- 'derangedArchaeologist',
84
- 'generalGraardor',
85
- 'giantMole',
86
- 'grotesqueGuardians',
87
- 'hespori',
88
- 'kalphiteQueen',
89
- 'kingBlackDragon',
90
- 'kraken',
91
- 'kreeArra',
92
- 'krilTsutsaroth',
93
- 'mimic',
94
- 'nex',
95
- 'nightmare',
96
- 'phosanisNightmare',
97
- 'obor',
98
- 'sarachnis',
99
- 'scorpia',
100
- 'skotizo',
101
- 'tempoross',
102
- 'gauntlet',
103
- 'corruptedGauntlet',
104
- 'theatreOfBlood',
105
- 'theatreOfBloodHardMode',
106
- 'thermonuclearSmokeDevil',
107
- 'tzKalZuk',
108
- 'tzTokJad',
109
- 'venenatis',
110
- 'vetion',
111
- 'vorkath',
112
- 'wintertodt',
113
- 'zalcano',
114
- 'zulrah'
115
- ];
116
- exports.ACTIVITIES = __spreadArray([
117
- 'leaguePoints',
118
- 'hunterBH',
119
- 'rogueBH',
120
- 'allClues',
121
- 'beginnerClues',
122
- 'easyClues',
123
- 'mediumClues',
124
- 'hardClues',
125
- 'eliteClues',
126
- 'masterClues',
127
- 'lastManStanding',
128
- 'soulWarsZeal'
129
- ], exports.BOSSES);
130
- exports.FORMATTED_BOSS_NAMES = {
131
- abyssalSire: 'Abyssal Sire',
132
- alchemicalHydra: 'Alchemical Hydra',
133
- barrows: 'Barrows Chests',
134
- bryophyta: 'Bryophyta',
135
- callisto: 'Callisto',
136
- cerberus: 'Cerberus',
137
- chambersOfXeric: 'Chambers of Xeric',
138
- chambersOfXericChallengeMode: 'Chambers of Xeric: Challenge Mode',
139
- chaosElemental: 'Chaos Elemental',
140
- chaosFanatic: 'Chaos Fanatic',
141
- commanderZilyana: 'Commander Zilyana',
142
- corporealBeast: 'Corporeal Beast',
143
- crazyArchaeologist: 'Crazy Archaeologist',
144
- dagannothPrime: 'Dagannoth Prime',
145
- dagannothRex: 'Dagannoth Rex',
146
- dagannothSupreme: 'Dagannoth Supreme',
147
- derangedArchaeologist: 'Deranged Archaeologist',
148
- generalGraardor: 'General Graardor',
149
- giantMole: 'Giant Mole',
150
- grotesqueGuardians: 'Grotesque Guardians',
151
- hespori: 'Hespori',
152
- kalphiteQueen: 'Kalphite Queen',
153
- kingBlackDragon: 'King Black Dragon',
154
- kraken: 'Kraken',
155
- kreeArra: "Kree'Arra",
156
- krilTsutsaroth: "K'ril Tsutsaroth",
157
- mimic: 'Mimic',
158
- nex: 'Nex',
159
- nightmare: 'The Nightmare of Ashihama',
160
- phosanisNightmare: "Phosani's Nightmare",
161
- obor: 'Obor',
162
- sarachnis: 'Sarachnis',
163
- scorpia: 'Scorpia',
164
- skotizo: 'Skotizo',
165
- tempoross: 'Tempoross',
166
- gauntlet: 'The Gauntlet',
167
- corruptedGauntlet: 'The Corrupted Gauntlet',
168
- theatreOfBlood: 'Theatre of Blood',
169
- theatreOfBloodHardMode: 'Theatre of Blood: Hard Mode',
170
- thermonuclearSmokeDevil: 'Thermonuclear Smoke Devil',
171
- tzKalZuk: 'TzKal-Zuk',
172
- tzTokJad: 'TzTok-Jad',
173
- venenatis: 'Venenatis',
174
- vetion: "Vet'ion",
175
- vorkath: 'Vorkath',
176
- wintertodt: 'Wintertodt',
177
- zalcano: 'Zalcano',
178
- zulrah: 'Zulrah'
179
- };
180
- exports.FORMATTED_SKILL_NAMES = {
181
- overall: 'Overall',
182
- attack: 'Attack',
183
- defence: 'Defence',
184
- strength: 'Strength',
185
- hitpoints: 'Hitpoints',
186
- ranged: 'Ranged',
187
- prayer: 'Prayer',
188
- magic: 'Magic',
189
- cooking: 'Cooking',
190
- woodcutting: 'Woodcutting',
191
- fletching: 'Fletching',
192
- fishing: 'Fishing',
193
- firemaking: 'Firemaking',
194
- crafting: 'Crafting',
195
- smithing: 'Smithing',
196
- mining: 'Mining',
197
- herblore: 'Herblore',
198
- agility: 'Agility',
199
- thieving: 'Thieving',
200
- slayer: 'Slayer',
201
- farming: 'Farming',
202
- runecraft: 'Runecraft',
203
- hunter: 'Hunter',
204
- construction: 'Construction'
205
- };
206
- exports.FORMATTED_CLUE_NAMES = {
207
- all: 'Clue Scrolls (all)',
208
- beginner: 'Clue Scrolls (beginner)',
209
- easy: 'Clue Scrolls (easy)',
210
- medium: 'Clue Scrolls (medium)',
211
- hard: 'Clue Scrolls (hard)',
212
- elite: 'Clue Scrolls (elite)',
213
- master: 'Clue Scrolls (master)'
214
- };
215
- exports.FORMATTED_BH_NAMES = {
216
- rogue: 'Bounty Hunter - Rogue',
217
- hunter: 'Bounty Hunter - Hunter'
218
- };
219
- exports.FORMATTED_LMS = 'Last Man Standing';
220
- exports.FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
221
- exports.FORMATTED_LEAGUE_POINTS = 'League Points';
222
- exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4
+ to[j] = from[i];
5
+ return to;
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
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
+ exports.BASE_URL = 'https://secure.runescape.com/m=hiscore_oldschool';
10
+ exports.STATS_URL = 'index_lite.ws?player=';
11
+ exports.SCORES_URL = 'overall.ws?';
12
+ exports.GAMEMODE_URL = {
13
+ main: exports.BASE_URL + "/",
14
+ ironman: exports.BASE_URL + "_ironman/",
15
+ hardcore: exports.BASE_URL + "_hardcore_ironman/",
16
+ ultimate: exports.BASE_URL + "_ultimate/",
17
+ deadman: exports.BASE_URL + "_deadman/",
18
+ seasonal: exports.BASE_URL + "_seasonal/",
19
+ tournament: exports.BASE_URL + "_tournament/"
20
+ };
21
+ exports.SKILLS = [
22
+ 'overall',
23
+ 'attack',
24
+ 'defence',
25
+ 'strength',
26
+ 'hitpoints',
27
+ 'ranged',
28
+ 'prayer',
29
+ 'magic',
30
+ 'cooking',
31
+ 'woodcutting',
32
+ 'fletching',
33
+ 'fishing',
34
+ 'firemaking',
35
+ 'crafting',
36
+ 'smithing',
37
+ 'mining',
38
+ 'herblore',
39
+ 'agility',
40
+ 'thieving',
41
+ 'slayer',
42
+ 'farming',
43
+ 'runecraft',
44
+ 'hunter',
45
+ 'construction'
46
+ ];
47
+ exports.CLUES = [
48
+ 'all',
49
+ 'beginner',
50
+ 'easy',
51
+ 'medium',
52
+ 'hard',
53
+ 'elite',
54
+ 'master'
55
+ ];
56
+ exports.BH_MODES = ['hunter', 'rogue'];
57
+ exports.GAMEMODES = [
58
+ 'main',
59
+ 'ironman',
60
+ 'hardcore',
61
+ 'ultimate',
62
+ 'deadman',
63
+ 'seasonal',
64
+ 'tournament'
65
+ ];
66
+ exports.BOSSES = [
67
+ 'abyssalSire',
68
+ 'alchemicalHydra',
69
+ 'barrows',
70
+ 'bryophyta',
71
+ 'callisto',
72
+ 'cerberus',
73
+ 'chambersOfXeric',
74
+ 'chambersOfXericChallengeMode',
75
+ 'chaosElemental',
76
+ 'chaosFanatic',
77
+ 'commanderZilyana',
78
+ 'corporealBeast',
79
+ 'crazyArchaeologist',
80
+ 'dagannothPrime',
81
+ 'dagannothRex',
82
+ 'dagannothSupreme',
83
+ 'derangedArchaeologist',
84
+ 'generalGraardor',
85
+ 'giantMole',
86
+ 'grotesqueGuardians',
87
+ 'hespori',
88
+ 'kalphiteQueen',
89
+ 'kingBlackDragon',
90
+ 'kraken',
91
+ 'kreeArra',
92
+ 'krilTsutsaroth',
93
+ 'mimic',
94
+ 'nex',
95
+ 'nightmare',
96
+ 'phosanisNightmare',
97
+ 'obor',
98
+ 'sarachnis',
99
+ 'scorpia',
100
+ 'skotizo',
101
+ 'tempoross',
102
+ 'gauntlet',
103
+ 'corruptedGauntlet',
104
+ 'theatreOfBlood',
105
+ 'theatreOfBloodHardMode',
106
+ 'thermonuclearSmokeDevil',
107
+ 'tombsOfAmascut',
108
+ 'tombsOfAmascutExpertMode',
109
+ 'tzKalZuk',
110
+ 'tzTokJad',
111
+ 'venenatis',
112
+ 'vetion',
113
+ 'vorkath',
114
+ 'wintertodt',
115
+ 'zalcano',
116
+ 'zulrah'
117
+ ];
118
+ exports.ACTIVITIES = __spreadArray([
119
+ 'leaguePoints',
120
+ 'hunterBH',
121
+ 'rogueBH',
122
+ 'allClues',
123
+ 'beginnerClues',
124
+ 'easyClues',
125
+ 'mediumClues',
126
+ 'hardClues',
127
+ 'eliteClues',
128
+ 'masterClues',
129
+ 'lastManStanding',
130
+ 'pvpArena',
131
+ 'soulWarsZeal',
132
+ 'riftsClosed'
133
+ ], exports.BOSSES);
134
+ exports.FORMATTED_BOSS_NAMES = {
135
+ abyssalSire: 'Abyssal Sire',
136
+ alchemicalHydra: 'Alchemical Hydra',
137
+ barrows: 'Barrows Chests',
138
+ bryophyta: 'Bryophyta',
139
+ callisto: 'Callisto',
140
+ cerberus: 'Cerberus',
141
+ chambersOfXeric: 'Chambers of Xeric',
142
+ chambersOfXericChallengeMode: 'Chambers of Xeric: Challenge Mode',
143
+ chaosElemental: 'Chaos Elemental',
144
+ chaosFanatic: 'Chaos Fanatic',
145
+ commanderZilyana: 'Commander Zilyana',
146
+ corporealBeast: 'Corporeal Beast',
147
+ crazyArchaeologist: 'Crazy Archaeologist',
148
+ dagannothPrime: 'Dagannoth Prime',
149
+ dagannothRex: 'Dagannoth Rex',
150
+ dagannothSupreme: 'Dagannoth Supreme',
151
+ derangedArchaeologist: 'Deranged Archaeologist',
152
+ generalGraardor: 'General Graardor',
153
+ giantMole: 'Giant Mole',
154
+ grotesqueGuardians: 'Grotesque Guardians',
155
+ hespori: 'Hespori',
156
+ kalphiteQueen: 'Kalphite Queen',
157
+ kingBlackDragon: 'King Black Dragon',
158
+ kraken: 'Kraken',
159
+ kreeArra: "Kree'Arra",
160
+ krilTsutsaroth: "K'ril Tsutsaroth",
161
+ mimic: 'Mimic',
162
+ nex: 'Nex',
163
+ nightmare: 'The Nightmare of Ashihama',
164
+ phosanisNightmare: "Phosani's Nightmare",
165
+ obor: 'Obor',
166
+ sarachnis: 'Sarachnis',
167
+ scorpia: 'Scorpia',
168
+ skotizo: 'Skotizo',
169
+ tempoross: 'Tempoross',
170
+ gauntlet: 'The Gauntlet',
171
+ corruptedGauntlet: 'The Corrupted Gauntlet',
172
+ theatreOfBlood: 'Theatre of Blood',
173
+ theatreOfBloodHardMode: 'Theatre of Blood: Hard Mode',
174
+ thermonuclearSmokeDevil: 'Thermonuclear Smoke Devil',
175
+ tombsOfAmascut: 'Tombs of Amascut',
176
+ tombsOfAmascutExpertMode: 'Tombs of Amascut: Expert Mode',
177
+ tzKalZuk: 'TzKal-Zuk',
178
+ tzTokJad: 'TzTok-Jad',
179
+ venenatis: 'Venenatis',
180
+ vetion: "Vet'ion",
181
+ vorkath: 'Vorkath',
182
+ wintertodt: 'Wintertodt',
183
+ zalcano: 'Zalcano',
184
+ zulrah: 'Zulrah'
185
+ };
186
+ exports.FORMATTED_SKILL_NAMES = {
187
+ overall: 'Overall',
188
+ attack: 'Attack',
189
+ defence: 'Defence',
190
+ strength: 'Strength',
191
+ hitpoints: 'Hitpoints',
192
+ ranged: 'Ranged',
193
+ prayer: 'Prayer',
194
+ magic: 'Magic',
195
+ cooking: 'Cooking',
196
+ woodcutting: 'Woodcutting',
197
+ fletching: 'Fletching',
198
+ fishing: 'Fishing',
199
+ firemaking: 'Firemaking',
200
+ crafting: 'Crafting',
201
+ smithing: 'Smithing',
202
+ mining: 'Mining',
203
+ herblore: 'Herblore',
204
+ agility: 'Agility',
205
+ thieving: 'Thieving',
206
+ slayer: 'Slayer',
207
+ farming: 'Farming',
208
+ runecraft: 'Runecraft',
209
+ hunter: 'Hunter',
210
+ construction: 'Construction'
211
+ };
212
+ exports.FORMATTED_CLUE_NAMES = {
213
+ all: 'Clue Scrolls (all)',
214
+ beginner: 'Clue Scrolls (beginner)',
215
+ easy: 'Clue Scrolls (easy)',
216
+ medium: 'Clue Scrolls (medium)',
217
+ hard: 'Clue Scrolls (hard)',
218
+ elite: 'Clue Scrolls (elite)',
219
+ master: 'Clue Scrolls (master)'
220
+ };
221
+ exports.FORMATTED_BH_NAMES = {
222
+ rogue: 'Bounty Hunter - Rogue',
223
+ hunter: 'Bounty Hunter - Hunter'
224
+ };
225
+ exports.FORMATTED_LMS = 'Last Man Standing';
226
+ exports.FORMATTED_PVP_ARENA = 'PvP Arena';
227
+ exports.FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
228
+ exports.FORMATTED_LEAGUE_POINTS = 'League Points';
229
+ exports.FORMATTED_RIFTS_CLOSED = 'Rifts Closed';
230
+ exports.INVALID_FORMAT_ERROR = 'Invalid hiscores format';
@@ -1,56 +1,56 @@
1
- import { Gamemode, SkillName, ActivityName } from '../types';
2
- /**
3
- * Will generate a stats URL for the official OSRS API.
4
- *
5
- * @param gamemode Gamemode to fetch ranks for.
6
- * @param rsn Username of the player.
7
- * @returns Encoded stats URL.
8
- */
9
- export declare const getStatsURL: (gamemode: Gamemode, rsn: string) => string;
10
- /**
11
- * Will generate a player table URL for the official OSRS hiscores website.
12
- *
13
- * @param gamemode Gamemode to fetch ranks for.
14
- * @param rsn Username of the player.
15
- * @returns Encoded player table URL.
16
- */
17
- export declare const getPlayerTableURL: (gamemode: Gamemode, rsn: string) => string;
18
- /**
19
- * Will generate a skill table URL for the official OSRS hiscores website.
20
- *
21
- * @param gamemode Gamemode to fetch ranks for.
22
- * @param skill Skill to fetch ranks for.
23
- * @param page Page number.
24
- * @returns
25
- */
26
- export declare const getSkillPageURL: (gamemode: Gamemode, skill: SkillName, page: number) => string;
27
- /**
28
- * Will generate an activity table URL for the official OSRS hiscores website.
29
- *
30
- * @param gamemode Gamemode to fetch ranks for.
31
- * @param activity Activity or boss to fetch ranks for.
32
- * @param page Page number.
33
- * @returns
34
- */
35
- export declare const getActivityPageURL: (gamemode: Gamemode, activity: ActivityName, page: number) => string;
36
- /**
37
- * Extracts a number from an OSRS hiscores table cell element.
38
- *
39
- * @param el OSRS hiscores table cell element.
40
- * @returns Number parsed from cell text.
41
- */
42
- export declare const numberFromElement: (el: Element | null) => number;
43
- /**
44
- * Extracts a RSN from an OSRS hiscores table cell element.
45
- *
46
- * @param el OSRS hiscores table cell element.
47
- * @returns RSN parsed from cell text.
48
- */
49
- export declare const rsnFromElement: (el: Element | null) => string;
50
- /**
51
- * Will run an Axios `GET` request against a given URL after injecting a `User-Agent` header.
52
- *
53
- * @param url URL to run a `GET` request against.
54
- * @returns Axios response.
55
- */
56
- export declare const httpGet: (url: string) => Promise<import("axios").AxiosResponse<any>>;
1
+ import { Gamemode, SkillName, ActivityName } from '../types';
2
+ /**
3
+ * Will generate a stats URL for the official OSRS API.
4
+ *
5
+ * @param gamemode Gamemode to fetch ranks for.
6
+ * @param rsn Username of the player.
7
+ * @returns Encoded stats URL.
8
+ */
9
+ export declare const getStatsURL: (gamemode: Gamemode, rsn: string) => string;
10
+ /**
11
+ * Will generate a player table URL for the official OSRS hiscores website.
12
+ *
13
+ * @param gamemode Gamemode to fetch ranks for.
14
+ * @param rsn Username of the player.
15
+ * @returns Encoded player table URL.
16
+ */
17
+ export declare const getPlayerTableURL: (gamemode: Gamemode, rsn: string) => string;
18
+ /**
19
+ * Will generate a skill table URL for the official OSRS hiscores website.
20
+ *
21
+ * @param gamemode Gamemode to fetch ranks for.
22
+ * @param skill Skill to fetch ranks for.
23
+ * @param page Page number.
24
+ * @returns
25
+ */
26
+ export declare const getSkillPageURL: (gamemode: Gamemode, skill: SkillName, page: number) => string;
27
+ /**
28
+ * Will generate an activity table URL for the official OSRS hiscores website.
29
+ *
30
+ * @param gamemode Gamemode to fetch ranks for.
31
+ * @param activity Activity or boss to fetch ranks for.
32
+ * @param page Page number.
33
+ * @returns
34
+ */
35
+ export declare const getActivityPageURL: (gamemode: Gamemode, activity: ActivityName, page: number) => string;
36
+ /**
37
+ * Extracts a number from an OSRS hiscores table cell element.
38
+ *
39
+ * @param el OSRS hiscores table cell element.
40
+ * @returns Number parsed from cell text.
41
+ */
42
+ export declare const numberFromElement: (el: Element | null) => number;
43
+ /**
44
+ * Extracts a RSN from an OSRS hiscores table cell element.
45
+ *
46
+ * @param el OSRS hiscores table cell element.
47
+ * @returns RSN parsed from cell text.
48
+ */
49
+ export declare const rsnFromElement: (el: Element | null) => string;
50
+ /**
51
+ * Will run an Axios `GET` request against a given URL after injecting a `User-Agent` header.
52
+ *
53
+ * @param url URL to run a `GET` request against.
54
+ * @returns Axios response.
55
+ */
56
+ export declare const httpGet: (url: string) => Promise<import("axios").AxiosResponse<any>>;