osrs-json-hiscores 2.21.0 → 2.22.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 +1 -0
- package/lib/hiscores.d.ts +1 -1
- package/lib/hiscores.js +5 -4
- package/lib/types.d.ts +1 -1
- package/lib/utils/constants.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
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)(
|
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
|
-
|
119
|
+
return [3 /*break*/, 4];
|
119
120
|
case 3:
|
120
121
|
_a = _b.sent();
|
121
122
|
throw new utils_1.HiScoresError();
|
122
|
-
case 4:
|
123
|
+
case 4: throw new utils_1.PlayerNotFoundError();
|
123
124
|
}
|
124
125
|
});
|
125
126
|
});
|
package/lib/types.d.ts
CHANGED
@@ -21,7 +21,7 @@ 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' | 'royalTitans' | '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' | 'yama' | 'zalcano' | 'zulrah';
|
25
25
|
export type Bosses = {
|
26
26
|
[Type in Boss]: Activity;
|
27
27
|
};
|
package/lib/utils/constants.js
CHANGED
@@ -150,6 +150,7 @@ exports.BOSSES = [
|
|
150
150
|
'vetion',
|
151
151
|
'vorkath',
|
152
152
|
'wintertodt',
|
153
|
+
'yama',
|
153
154
|
'zalcano',
|
154
155
|
'zulrah'
|
155
156
|
];
|
@@ -238,6 +239,7 @@ exports.FORMATTED_BOSS_NAMES = {
|
|
238
239
|
vetion: "Vet'ion",
|
239
240
|
vorkath: 'Vorkath',
|
240
241
|
wintertodt: 'Wintertodt',
|
242
|
+
yama: 'Yama',
|
241
243
|
zalcano: 'Zalcano',
|
242
244
|
zulrah: 'Zulrah'
|
243
245
|
};
|