osrs-json-hiscores 2.14.1 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -0
- package/lib/hiscores.d.ts +47 -47
- package/lib/hiscores.js +401 -401
- package/lib/index.d.ts +5 -5
- package/lib/index.js +21 -17
- package/lib/types.d.ts +78 -78
- package/lib/types.js +2 -2
- package/lib/utils/constants.d.ts +36 -36
- package/lib/utils/constants.js +257 -245
- package/lib/utils/helpers.d.ts +63 -63
- package/lib/utils/helpers.js +119 -119
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +18 -14
- package/package.json +19 -20
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,21 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
Object.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
var
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
var hiscores = require("./hiscores");
|
18
|
+
__exportStar(require("./hiscores"), exports);
|
19
|
+
__exportStar(require("./types"), exports);
|
20
|
+
__exportStar(require("./utils"), exports);
|
21
|
+
exports.default = hiscores;
|
package/lib/types.d.ts
CHANGED
@@ -1,78 +1,78 @@
|
|
1
|
-
import { AxiosRequestConfig } from 'axios';
|
2
|
-
export
|
3
|
-
export interface Skill {
|
4
|
-
rank: number;
|
5
|
-
level: number;
|
6
|
-
xp: number;
|
7
|
-
}
|
8
|
-
export interface Activity {
|
9
|
-
rank: number;
|
10
|
-
score: number;
|
11
|
-
}
|
12
|
-
export
|
13
|
-
export
|
14
|
-
[Name in SkillName]: Skill;
|
15
|
-
};
|
16
|
-
export
|
17
|
-
export
|
18
|
-
[Type in ClueType]: Activity;
|
19
|
-
};
|
20
|
-
export
|
21
|
-
export
|
22
|
-
[Type in BHType]: Activity;
|
23
|
-
};
|
24
|
-
export
|
25
|
-
export
|
26
|
-
[Type in Boss]: Activity;
|
27
|
-
};
|
28
|
-
export
|
29
|
-
export interface Stats {
|
30
|
-
skills: Skills;
|
31
|
-
clues: Clues;
|
32
|
-
leaguePoints: Activity;
|
33
|
-
bountyHunter: BH;
|
34
|
-
lastManStanding: Activity;
|
35
|
-
pvpArena: Activity;
|
36
|
-
soulWarsZeal: Activity;
|
37
|
-
riftsClosed: Activity;
|
38
|
-
bosses: Bosses;
|
39
|
-
}
|
40
|
-
export
|
41
|
-
[M in Gamemode]?: Stats;
|
42
|
-
};
|
43
|
-
export interface Player extends Modes {
|
44
|
-
name: string;
|
45
|
-
mode: Gamemode;
|
46
|
-
dead: boolean;
|
47
|
-
deulted: boolean;
|
48
|
-
deironed: boolean;
|
49
|
-
}
|
50
|
-
export interface PlayerSkillRow extends Skill {
|
51
|
-
name: string;
|
52
|
-
dead: boolean;
|
53
|
-
}
|
54
|
-
export interface PlayerActivityRow extends Activity {
|
55
|
-
name: string;
|
56
|
-
dead: boolean;
|
57
|
-
}
|
58
|
-
export interface GetStatsOptions {
|
59
|
-
/**
|
60
|
-
* Other game modes to fetch ranks for.
|
61
|
-
* @defaultvalue `['ironman', 'hardcore', 'ultimate']`
|
62
|
-
*/
|
63
|
-
otherGamemodes?: Extract<Gamemode, 'ironman' | 'hardcore' | 'ultimate'>[];
|
64
|
-
/**
|
65
|
-
* If true, the formatted RSN will be fetched. Otherwise it will return the provided, unformatted RSN.
|
66
|
-
* @defaultvalue `true`
|
67
|
-
*/
|
68
|
-
shouldGetFormattedRsn?: boolean;
|
69
|
-
/**
|
70
|
-
* Map of configs for each requests that can take place in the `getStats` function.
|
71
|
-
*/
|
72
|
-
axiosConfigs?: Partial<Record<Gamemode, AxiosRequestConfig>> & {
|
73
|
-
/**
|
74
|
-
* The axios request config object to use for the RSN format request.
|
75
|
-
*/
|
76
|
-
rsn?: AxiosRequestConfig;
|
77
|
-
};
|
78
|
-
}
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
2
|
+
export type Gamemode = 'main' | 'ironman' | 'ultimate' | 'hardcore' | 'deadman' | 'seasonal' | 'tournament' | 'skiller' | 'oneDefence' | 'freshStart';
|
3
|
+
export interface Skill {
|
4
|
+
rank: number;
|
5
|
+
level: number;
|
6
|
+
xp: number;
|
7
|
+
}
|
8
|
+
export interface Activity {
|
9
|
+
rank: number;
|
10
|
+
score: number;
|
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
|
+
export type Skills = {
|
14
|
+
[Name in SkillName]: Skill;
|
15
|
+
};
|
16
|
+
export type ClueType = 'all' | 'beginner' | 'easy' | 'medium' | 'hard' | 'elite' | 'master';
|
17
|
+
export type Clues = {
|
18
|
+
[Type in ClueType]: Activity;
|
19
|
+
};
|
20
|
+
export type BHType = 'rogue' | 'hunter' | 'rogueV2' | 'hunterV2';
|
21
|
+
export type BH = {
|
22
|
+
[Type in BHType]: Activity;
|
23
|
+
};
|
24
|
+
export type Boss = 'abyssalSire' | 'alchemicalHydra' | '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' | 'mimic' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'phantomMuspah' | 'sarachnis' | 'scorpia' | 'skotizo' | 'spindel' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'leviathan' | 'whisperer' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'vardorvis' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
|
25
|
+
export type Bosses = {
|
26
|
+
[Type in Boss]: Activity;
|
27
|
+
};
|
28
|
+
export type ActivityName = 'leaguePoints' | 'hunterBHV2' | 'rogueBHV2' | 'hunterBH' | 'rogueBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' | 'allClues' | 'beginnerClues' | 'easyClues' | 'mediumClues' | 'hardClues' | 'eliteClues' | 'masterClues' | Boss;
|
29
|
+
export interface Stats {
|
30
|
+
skills: Skills;
|
31
|
+
clues: Clues;
|
32
|
+
leaguePoints: Activity;
|
33
|
+
bountyHunter: BH;
|
34
|
+
lastManStanding: Activity;
|
35
|
+
pvpArena: Activity;
|
36
|
+
soulWarsZeal: Activity;
|
37
|
+
riftsClosed: Activity;
|
38
|
+
bosses: Bosses;
|
39
|
+
}
|
40
|
+
export type Modes = {
|
41
|
+
[M in Gamemode]?: Stats;
|
42
|
+
};
|
43
|
+
export interface Player extends Modes {
|
44
|
+
name: string;
|
45
|
+
mode: Gamemode;
|
46
|
+
dead: boolean;
|
47
|
+
deulted: boolean;
|
48
|
+
deironed: boolean;
|
49
|
+
}
|
50
|
+
export interface PlayerSkillRow extends Skill {
|
51
|
+
name: string;
|
52
|
+
dead: boolean;
|
53
|
+
}
|
54
|
+
export interface PlayerActivityRow extends Activity {
|
55
|
+
name: string;
|
56
|
+
dead: boolean;
|
57
|
+
}
|
58
|
+
export interface GetStatsOptions {
|
59
|
+
/**
|
60
|
+
* Other game modes to fetch ranks for.
|
61
|
+
* @defaultvalue `['ironman', 'hardcore', 'ultimate']`
|
62
|
+
*/
|
63
|
+
otherGamemodes?: Extract<Gamemode, 'ironman' | 'hardcore' | 'ultimate'>[];
|
64
|
+
/**
|
65
|
+
* If true, the formatted RSN will be fetched. Otherwise it will return the provided, unformatted RSN.
|
66
|
+
* @defaultvalue `true`
|
67
|
+
*/
|
68
|
+
shouldGetFormattedRsn?: boolean;
|
69
|
+
/**
|
70
|
+
* Map of configs for each requests that can take place in the `getStats` function.
|
71
|
+
*/
|
72
|
+
axiosConfigs?: Partial<Record<Gamemode, AxiosRequestConfig>> & {
|
73
|
+
/**
|
74
|
+
* The axios request config object to use for the RSN format request.
|
75
|
+
*/
|
76
|
+
rsn?: AxiosRequestConfig;
|
77
|
+
};
|
78
|
+
}
|
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
|
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
|
16
|
-
[key in Boss]: string;
|
17
|
-
};
|
18
|
-
export declare const FORMATTED_BOSS_NAMES: FormattedBossNames;
|
19
|
-
export
|
20
|
-
[key in SkillName]: string;
|
21
|
-
};
|
22
|
-
export declare const FORMATTED_SKILL_NAMES: FormattedSkillNames;
|
23
|
-
export
|
24
|
-
[key in ClueType]: string;
|
25
|
-
};
|
26
|
-
export declare const FORMATTED_CLUE_NAMES: FormattedClueNames;
|
27
|
-
export
|
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 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 type FormattedBossNames = {
|
16
|
+
[key in Boss]: string;
|
17
|
+
};
|
18
|
+
export declare const FORMATTED_BOSS_NAMES: FormattedBossNames;
|
19
|
+
export type FormattedSkillNames = {
|
20
|
+
[key in SkillName]: string;
|
21
|
+
};
|
22
|
+
export declare const FORMATTED_SKILL_NAMES: FormattedSkillNames;
|
23
|
+
export type FormattedClueNames = {
|
24
|
+
[key in ClueType]: string;
|
25
|
+
};
|
26
|
+
export declare const FORMATTED_CLUE_NAMES: FormattedClueNames;
|
27
|
+
export 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";
|