osrs-json-hiscores 2.12.0 → 2.12.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +4 -4
- package/README.md +226 -226
- package/lib/hiscores.d.ts +43 -43
- package/lib/hiscores.js +397 -389
- package/lib/index.d.ts +5 -5
- package/lib/index.js +17 -17
- package/lib/types.d.ts +68 -56
- package/lib/types.js +2 -2
- package/lib/utils/constants.d.ts +36 -36
- package/lib/utils/constants.js +235 -235
- package/lib/utils/helpers.d.ts +62 -56
- package/lib/utils/helpers.js +109 -92
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +14 -14
- package/package.json +117 -114
package/lib/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as hiscores from './hiscores';
|
2
|
-
export * from './hiscores';
|
3
|
-
export * from './types';
|
4
|
-
export * from './utils';
|
5
|
-
export default hiscores;
|
1
|
+
import * as hiscores from './hiscores';
|
2
|
+
export * from './hiscores';
|
3
|
+
export * from './types';
|
4
|
+
export * from './utils';
|
5
|
+
export default hiscores;
|
package/lib/index.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
-
}) : (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
o[k2] = m[k];
|
8
|
-
}));
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
-
};
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
var hiscores = require("./hiscores");
|
14
|
-
__exportStar(require("./hiscores"), exports);
|
15
|
-
__exportStar(require("./types"), exports);
|
16
|
-
__exportStar(require("./utils"), exports);
|
17
|
-
exports.default = hiscores;
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
var hiscores = require("./hiscores");
|
14
|
+
__exportStar(require("./hiscores"), exports);
|
15
|
+
__exportStar(require("./types"), exports);
|
16
|
+
__exportStar(require("./utils"), exports);
|
17
|
+
exports.default = hiscores;
|
package/lib/types.d.ts
CHANGED
@@ -1,56 +1,68 @@
|
|
1
|
-
export declare type Gamemode = 'main' | 'ironman' | 'ultimate' | 'hardcore' | 'deadman' | 'seasonal' | 'tournament' | 'skiller' | 'oneDefence' | 'freshStart';
|
2
|
-
export interface Skill {
|
3
|
-
rank: number;
|
4
|
-
level: number;
|
5
|
-
xp: number;
|
6
|
-
}
|
7
|
-
export interface Activity {
|
8
|
-
rank: number;
|
9
|
-
score: number;
|
10
|
-
}
|
11
|
-
export declare 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';
|
12
|
-
export declare type Skills = {
|
13
|
-
[Name in SkillName]: Skill;
|
14
|
-
};
|
15
|
-
export declare type ClueType = 'all' | 'beginner' | 'easy' | 'medium' | 'hard' | 'elite' | 'master';
|
16
|
-
export declare type Clues = {
|
17
|
-
[Type in ClueType]: Activity;
|
18
|
-
};
|
19
|
-
export declare type BHType = 'rogue' | 'hunter';
|
20
|
-
export declare type BH = {
|
21
|
-
[Type in BHType]: Activity;
|
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' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'phantomMuspah' | 'sarachnis' | 'scorpia' | 'skotizo' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
|
24
|
-
export declare type Bosses = {
|
25
|
-
[Type in Boss]: Activity;
|
26
|
-
};
|
27
|
-
export declare type ActivityName = 'leaguePoints' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | Boss;
|
28
|
-
export interface Stats {
|
29
|
-
skills: Skills;
|
30
|
-
clues: Clues;
|
31
|
-
leaguePoints: Activity;
|
32
|
-
bountyHunter: BH;
|
33
|
-
lastManStanding: Activity;
|
34
|
-
pvpArena: Activity;
|
35
|
-
soulWarsZeal: Activity;
|
36
|
-
riftsClosed: Activity;
|
37
|
-
bosses: Bosses;
|
38
|
-
}
|
39
|
-
export declare type Modes = {
|
40
|
-
[M in Gamemode]?: Stats;
|
41
|
-
};
|
42
|
-
export interface Player extends Modes {
|
43
|
-
name: string;
|
44
|
-
mode: Gamemode;
|
45
|
-
dead: boolean;
|
46
|
-
deulted: boolean;
|
47
|
-
deironed: boolean;
|
48
|
-
}
|
49
|
-
export interface PlayerSkillRow extends Skill {
|
50
|
-
name: string;
|
51
|
-
dead: boolean;
|
52
|
-
}
|
53
|
-
export interface PlayerActivityRow extends Activity {
|
54
|
-
name: string;
|
55
|
-
dead: boolean;
|
56
|
-
}
|
1
|
+
export declare type Gamemode = 'main' | 'ironman' | 'ultimate' | 'hardcore' | 'deadman' | 'seasonal' | 'tournament' | 'skiller' | 'oneDefence' | 'freshStart';
|
2
|
+
export interface Skill {
|
3
|
+
rank: number;
|
4
|
+
level: number;
|
5
|
+
xp: number;
|
6
|
+
}
|
7
|
+
export interface Activity {
|
8
|
+
rank: number;
|
9
|
+
score: number;
|
10
|
+
}
|
11
|
+
export declare 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';
|
12
|
+
export declare type Skills = {
|
13
|
+
[Name in SkillName]: Skill;
|
14
|
+
};
|
15
|
+
export declare type ClueType = 'all' | 'beginner' | 'easy' | 'medium' | 'hard' | 'elite' | 'master';
|
16
|
+
export declare type Clues = {
|
17
|
+
[Type in ClueType]: Activity;
|
18
|
+
};
|
19
|
+
export declare type BHType = 'rogue' | 'hunter';
|
20
|
+
export declare type BH = {
|
21
|
+
[Type in BHType]: Activity;
|
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' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'phantomMuspah' | 'sarachnis' | 'scorpia' | 'skotizo' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
|
24
|
+
export declare type Bosses = {
|
25
|
+
[Type in Boss]: Activity;
|
26
|
+
};
|
27
|
+
export declare type ActivityName = 'leaguePoints' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | Boss;
|
28
|
+
export interface Stats {
|
29
|
+
skills: Skills;
|
30
|
+
clues: Clues;
|
31
|
+
leaguePoints: Activity;
|
32
|
+
bountyHunter: BH;
|
33
|
+
lastManStanding: Activity;
|
34
|
+
pvpArena: Activity;
|
35
|
+
soulWarsZeal: Activity;
|
36
|
+
riftsClosed: Activity;
|
37
|
+
bosses: Bosses;
|
38
|
+
}
|
39
|
+
export declare type Modes = {
|
40
|
+
[M in Gamemode]?: Stats;
|
41
|
+
};
|
42
|
+
export interface Player extends Modes {
|
43
|
+
name: string;
|
44
|
+
mode: Gamemode;
|
45
|
+
dead: boolean;
|
46
|
+
deulted: boolean;
|
47
|
+
deironed: boolean;
|
48
|
+
}
|
49
|
+
export interface PlayerSkillRow extends Skill {
|
50
|
+
name: string;
|
51
|
+
dead: boolean;
|
52
|
+
}
|
53
|
+
export interface PlayerActivityRow extends Activity {
|
54
|
+
name: string;
|
55
|
+
dead: boolean;
|
56
|
+
}
|
57
|
+
export interface GetStatsOptions {
|
58
|
+
/**
|
59
|
+
* Other game modes to fetch ranks for.
|
60
|
+
* @defaultvalue `['ironman', 'hardcore', 'ultimate']`
|
61
|
+
*/
|
62
|
+
otherGamemodes?: Extract<Gamemode, 'ironman' | 'hardcore' | 'ultimate'>[];
|
63
|
+
/**
|
64
|
+
* If true, the formatted RSN will be fetched. Otherwise it will return the provided, unformatted RSN.
|
65
|
+
* @defaultvalue `true`
|
66
|
+
*/
|
67
|
+
shouldGetFormattedRsn?: boolean;
|
68
|
+
}
|
package/lib/types.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/utils/constants.d.ts
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
import { BHType, Boss, ClueType, Gamemode, SkillName, ActivityName } from '../types';
|
2
|
-
export declare const BASE_URL = "https://secure.runescape.com/m=hiscore_oldschool";
|
3
|
-
export declare const STATS_URL = "index_lite.ws?player=";
|
4
|
-
export declare const SCORES_URL = "overall.ws?";
|
5
|
-
export declare type GamemodeUrl = {
|
6
|
-
[key in Gamemode]: string;
|
7
|
-
};
|
8
|
-
export declare const GAMEMODE_URL: GamemodeUrl;
|
9
|
-
export declare const SKILLS: SkillName[];
|
10
|
-
export declare const CLUES: ClueType[];
|
11
|
-
export declare const BH_MODES: BHType[];
|
12
|
-
export declare const GAMEMODES: Gamemode[];
|
13
|
-
export declare const BOSSES: Boss[];
|
14
|
-
export declare const ACTIVITIES: ActivityName[];
|
15
|
-
export declare type FormattedBossNames = {
|
16
|
-
[key in Boss]: string;
|
17
|
-
};
|
18
|
-
export declare const FORMATTED_BOSS_NAMES: FormattedBossNames;
|
19
|
-
export declare type FormattedSkillNames = {
|
20
|
-
[key in SkillName]: string;
|
21
|
-
};
|
22
|
-
export declare const FORMATTED_SKILL_NAMES: FormattedSkillNames;
|
23
|
-
export declare type FormattedClueNames = {
|
24
|
-
[key in ClueType]: string;
|
25
|
-
};
|
26
|
-
export declare const FORMATTED_CLUE_NAMES: FormattedClueNames;
|
27
|
-
export declare type FormattedBHNames = {
|
28
|
-
[key in BHType]: string;
|
29
|
-
};
|
30
|
-
export declare const FORMATTED_BH_NAMES: FormattedBHNames;
|
31
|
-
export declare const FORMATTED_LMS = "Last Man Standing";
|
32
|
-
export declare const FORMATTED_PVP_ARENA = "PvP Arena";
|
33
|
-
export declare const FORMATTED_SOUL_WARS = "Soul Wars Zeal";
|
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";
|
1
|
+
import { BHType, Boss, ClueType, Gamemode, SkillName, ActivityName } from '../types';
|
2
|
+
export declare const BASE_URL = "https://secure.runescape.com/m=hiscore_oldschool";
|
3
|
+
export declare const STATS_URL = "index_lite.ws?player=";
|
4
|
+
export declare const SCORES_URL = "overall.ws?";
|
5
|
+
export declare type GamemodeUrl = {
|
6
|
+
[key in Gamemode]: string;
|
7
|
+
};
|
8
|
+
export declare const GAMEMODE_URL: GamemodeUrl;
|
9
|
+
export declare const SKILLS: SkillName[];
|
10
|
+
export declare const CLUES: ClueType[];
|
11
|
+
export declare const BH_MODES: BHType[];
|
12
|
+
export declare const GAMEMODES: Gamemode[];
|
13
|
+
export declare const BOSSES: Boss[];
|
14
|
+
export declare const ACTIVITIES: ActivityName[];
|
15
|
+
export declare type FormattedBossNames = {
|
16
|
+
[key in Boss]: string;
|
17
|
+
};
|
18
|
+
export declare const FORMATTED_BOSS_NAMES: FormattedBossNames;
|
19
|
+
export declare type FormattedSkillNames = {
|
20
|
+
[key in SkillName]: string;
|
21
|
+
};
|
22
|
+
export declare const FORMATTED_SKILL_NAMES: FormattedSkillNames;
|
23
|
+
export declare type FormattedClueNames = {
|
24
|
+
[key in ClueType]: string;
|
25
|
+
};
|
26
|
+
export declare const FORMATTED_CLUE_NAMES: FormattedClueNames;
|
27
|
+
export declare type FormattedBHNames = {
|
28
|
+
[key in BHType]: string;
|
29
|
+
};
|
30
|
+
export declare const FORMATTED_BH_NAMES: FormattedBHNames;
|
31
|
+
export declare const FORMATTED_LMS = "Last Man Standing";
|
32
|
+
export declare const FORMATTED_PVP_ARENA = "PvP Arena";
|
33
|
+
export declare const FORMATTED_SOUL_WARS = "Soul Wars Zeal";
|
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";
|