osrs-json-hiscores 2.23.0 → 2.24.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/lib/hiscores.d.ts +2 -1
- package/lib/types.d.ts +2 -7
- package/lib/utils/constants.d.ts +12 -7
- package/lib/utils/constants.js +10 -3
- package/lib/utils/helpers.d.ts +2 -2
- package/package.json +1 -1
package/lib/hiscores.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { Player, Stats,
|
|
2
|
+
import { Player, Stats, PlayerSkillRow, PlayerActivityRow, GetStatsOptions, HiscoresResponse } from './types';
|
|
3
|
+
import { Gamemode, SkillName, ActivityName } from './utils';
|
|
3
4
|
/**
|
|
4
5
|
* Gets a player's stats from the official OSRS JSON endpoint.
|
|
5
6
|
*
|
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
|
|
2
|
+
import { BHType, Boss, ClueType, Gamemode, SkillName } from './utils';
|
|
3
3
|
export interface Skill {
|
|
4
4
|
rank: number;
|
|
5
5
|
level: number;
|
|
@@ -9,23 +9,18 @@ export interface Activity {
|
|
|
9
9
|
rank: number;
|
|
10
10
|
score: number;
|
|
11
11
|
}
|
|
12
|
-
export type SkillName = 'overall' | 'attack' | 'defence' | 'strength' | 'hitpoints' | 'ranged' | 'prayer' | 'magic' | 'cooking' | 'woodcutting' | 'fletching' | 'fishing' | 'firemaking' | 'crafting' | 'smithing' | 'mining' | 'herblore' | 'agility' | 'thieving' | 'slayer' | 'farming' | 'runecraft' | 'hunter' | 'construction';
|
|
13
12
|
export type Skills = {
|
|
14
13
|
[Name in SkillName]: Skill;
|
|
15
14
|
};
|
|
16
|
-
export type ClueType = 'all' | 'beginner' | 'easy' | 'medium' | 'hard' | 'elite' | 'master';
|
|
17
15
|
export type Clues = {
|
|
18
16
|
[Type in ClueType]: Activity;
|
|
19
17
|
};
|
|
20
|
-
export type BHType = 'rogue' | 'hunter' | 'rogueV2' | 'hunterV2';
|
|
21
18
|
export type BH = {
|
|
22
19
|
[Type in BHType]: Activity;
|
|
23
20
|
};
|
|
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' | 'doomOfMokhaiotl' | '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
21
|
export type Bosses = {
|
|
26
22
|
[Type in Boss]: Activity;
|
|
27
23
|
};
|
|
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
24
|
export interface Stats {
|
|
30
25
|
skills: Skills;
|
|
31
26
|
clues: Clues;
|
|
@@ -49,7 +44,7 @@ export interface Stats {
|
|
|
49
44
|
export type Modes = {
|
|
50
45
|
[M in Gamemode]?: Stats;
|
|
51
46
|
};
|
|
52
|
-
export interface Player extends Modes {
|
|
47
|
+
export interface Player extends Pick<Modes, 'main' | 'ironman' | 'hardcore' | 'ultimate'> {
|
|
53
48
|
name: string;
|
|
54
49
|
mode: Gamemode;
|
|
55
50
|
dead: boolean;
|
package/lib/utils/constants.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BHType, Boss, ClueType, Gamemode, SkillName, ActivityName } from '../types';
|
|
2
1
|
export declare const BASE_URL = "https://secure.runescape.com/m=hiscore_oldschool";
|
|
3
2
|
export declare const STATS_URL = "index_lite.ws?player=";
|
|
4
3
|
export declare const JSON_STATS_URL = "index_lite.json?player=";
|
|
@@ -7,12 +6,18 @@ export type GamemodeUrl = {
|
|
|
7
6
|
[key in Gamemode]: string;
|
|
8
7
|
};
|
|
9
8
|
export declare const GAMEMODE_URL: GamemodeUrl;
|
|
10
|
-
export declare const SKILLS:
|
|
11
|
-
export
|
|
12
|
-
export declare const
|
|
13
|
-
export
|
|
14
|
-
export declare const
|
|
15
|
-
export
|
|
9
|
+
export declare const SKILLS: readonly ["overall", "attack", "defence", "strength", "hitpoints", "ranged", "prayer", "magic", "cooking", "woodcutting", "fletching", "fishing", "firemaking", "crafting", "smithing", "mining", "herblore", "agility", "thieving", "slayer", "farming", "runecraft", "hunter", "construction", "sailing"];
|
|
10
|
+
export type SkillName = (typeof SKILLS)[number];
|
|
11
|
+
export declare const CLUES: readonly ["all", "beginner", "easy", "medium", "hard", "elite", "master"];
|
|
12
|
+
export type ClueType = (typeof CLUES)[number];
|
|
13
|
+
export declare const BH_MODES: readonly ["hunterV2", "rogueV2", "hunter", "rogue"];
|
|
14
|
+
export type BHType = (typeof BH_MODES)[number];
|
|
15
|
+
export declare const GAMEMODES: readonly ["main", "ironman", "hardcore", "ultimate", "deadman", "seasonal", "tournament", "skiller", "oneDefence", "freshStart"];
|
|
16
|
+
export type Gamemode = (typeof GAMEMODES)[number];
|
|
17
|
+
export declare const BOSSES: readonly ["abyssalSire", "alchemicalHydra", "amoxliatl", "araxxor", "artio", "barrows", "bryophyta", "callisto", "calvarion", "cerberus", "chambersOfXeric", "chambersOfXericChallengeMode", "chaosElemental", "chaosFanatic", "commanderZilyana", "corporealBeast", "crazyArchaeologist", "dagannothPrime", "dagannothRex", "dagannothSupreme", "derangedArchaeologist", "doomOfMokhaiotl", "dukeSucellus", "generalGraardor", "giantMole", "grotesqueGuardians", "hespori", "kalphiteQueen", "kingBlackDragon", "kraken", "kreeArra", "krilTsutsaroth", "lunarChests", "mimic", "nex", "nightmare", "phosanisNightmare", "obor", "phantomMuspah", "sarachnis", "scorpia", "scurrius", "shellbaneGryphon", "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"];
|
|
18
|
+
export type Boss = (typeof BOSSES)[number];
|
|
19
|
+
export declare const ACTIVITIES: readonly ["leaguePoints", "deadmanPoints", "hunterBHV2", "rogueBHV2", "hunterBH", "rogueBH", "allClues", "beginnerClues", "easyClues", "mediumClues", "hardClues", "eliteClues", "masterClues", "lastManStanding", "pvpArena", "soulWarsZeal", "riftsClosed", "colosseumGlory", "collectionsLogged", "abyssalSire", "alchemicalHydra", "amoxliatl", "araxxor", "artio", "barrows", "bryophyta", "callisto", "calvarion", "cerberus", "chambersOfXeric", "chambersOfXericChallengeMode", "chaosElemental", "chaosFanatic", "commanderZilyana", "corporealBeast", "crazyArchaeologist", "dagannothPrime", "dagannothRex", "dagannothSupreme", "derangedArchaeologist", "doomOfMokhaiotl", "dukeSucellus", "generalGraardor", "giantMole", "grotesqueGuardians", "hespori", "kalphiteQueen", "kingBlackDragon", "kraken", "kreeArra", "krilTsutsaroth", "lunarChests", "mimic", "nex", "nightmare", "phosanisNightmare", "obor", "phantomMuspah", "sarachnis", "scorpia", "scurrius", "shellbaneGryphon", "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"];
|
|
20
|
+
export type ActivityName = (typeof ACTIVITIES)[number];
|
|
16
21
|
export type FormattedBossNames = {
|
|
17
22
|
[key in Boss]: string;
|
|
18
23
|
};
|
package/lib/utils/constants.js
CHANGED
|
@@ -65,7 +65,8 @@ exports.SKILLS = [
|
|
|
65
65
|
'farming',
|
|
66
66
|
'runecraft',
|
|
67
67
|
'hunter',
|
|
68
|
-
'construction'
|
|
68
|
+
'construction',
|
|
69
|
+
'sailing'
|
|
69
70
|
];
|
|
70
71
|
exports.CLUES = [
|
|
71
72
|
'all',
|
|
@@ -84,7 +85,10 @@ exports.GAMEMODES = [
|
|
|
84
85
|
'ultimate',
|
|
85
86
|
'deadman',
|
|
86
87
|
'seasonal',
|
|
87
|
-
'tournament'
|
|
88
|
+
'tournament',
|
|
89
|
+
'skiller',
|
|
90
|
+
'oneDefence',
|
|
91
|
+
'freshStart'
|
|
88
92
|
];
|
|
89
93
|
exports.BOSSES = [
|
|
90
94
|
'abyssalSire',
|
|
@@ -129,6 +133,7 @@ exports.BOSSES = [
|
|
|
129
133
|
'sarachnis',
|
|
130
134
|
'scorpia',
|
|
131
135
|
'scurrius',
|
|
136
|
+
'shellbaneGryphon',
|
|
132
137
|
'skotizo',
|
|
133
138
|
'solHeredit',
|
|
134
139
|
'spindel',
|
|
@@ -219,6 +224,7 @@ exports.FORMATTED_BOSS_NAMES = {
|
|
|
219
224
|
sarachnis: 'Sarachnis',
|
|
220
225
|
scorpia: 'Scorpia',
|
|
221
226
|
scurrius: 'Scurrius',
|
|
227
|
+
shellbaneGryphon: 'Shellbane Gryphon',
|
|
222
228
|
skotizo: 'Skotizo',
|
|
223
229
|
solHeredit: 'Sol Heredit',
|
|
224
230
|
spindel: 'Spindel',
|
|
@@ -269,7 +275,8 @@ exports.FORMATTED_SKILL_NAMES = {
|
|
|
269
275
|
farming: 'Farming',
|
|
270
276
|
runecraft: 'Runecraft',
|
|
271
277
|
hunter: 'Hunter',
|
|
272
|
-
construction: 'Construction'
|
|
278
|
+
construction: 'Construction',
|
|
279
|
+
sailing: 'Sailing'
|
|
273
280
|
};
|
|
274
281
|
exports.FORMATTED_CLUE_NAMES = {
|
|
275
282
|
all: 'Clue Scrolls (all)',
|
package/lib/utils/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { Gamemode, SkillName, ActivityName } from '
|
|
2
|
+
import { Gamemode, SkillName, ActivityName } from './constants';
|
|
3
3
|
/**
|
|
4
4
|
* Will generate a stats URL for the official OSRS API.
|
|
5
5
|
*
|
|
@@ -55,7 +55,7 @@ export declare const rsnFromElement: (el: Element | null) => string;
|
|
|
55
55
|
* @param url URL to run a `GET` request against.
|
|
56
56
|
* @returns Axios response.
|
|
57
57
|
*/
|
|
58
|
-
export declare const httpGet: <Response_1>(url: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<Response_1, any>>;
|
|
58
|
+
export declare const httpGet: <Response_1>(url: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<Response_1, any, {}>>;
|
|
59
59
|
/**
|
|
60
60
|
* Validates that a provided RSN has the same username restrictions as Jagex.
|
|
61
61
|
* @param rsn Username to validate.
|