hypixel-api-reborn 10.0.0 → 11.0.1
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/.prettierrc +13 -0
- package/README.md +28 -16
- package/package.json +60 -58
- package/src/API/getAPIStatus.js +8 -8
- package/src/API/getBoosters.js +6 -6
- package/src/API/getGameCounts.js +6 -6
- package/src/API/getGuild.js +18 -18
- package/src/API/getLeaderboards.js +13 -13
- package/src/API/getPlayer.js +22 -27
- package/src/API/getRecentGames.js +18 -18
- package/src/API/getServerInfo.js +66 -77
- package/src/API/getStatus.js +8 -8
- package/src/API/getWatchdogStats.js +6 -6
- package/src/API/index.js +19 -23
- package/src/API/skyblock/getEndedSkyblockAuctions.js +10 -10
- package/src/API/skyblock/getSkyblockAuctions.js +64 -64
- package/src/API/skyblock/getSkyblockAuctionsByPlayer.js +11 -11
- package/src/API/skyblock/getSkyblockBazaar.js +10 -10
- package/src/API/skyblock/getSkyblockMember.js +28 -25
- package/src/API/skyblock/getSkyblockNews.js +6 -6
- package/src/API/skyblock/getSkyblockProfiles.js +44 -41
- package/src/Client.js +406 -450
- package/src/Errors.js +44 -39
- package/src/Private/defaultCache.js +77 -78
- package/src/Private/rateLimit.js +79 -98
- package/src/Private/requests.js +65 -54
- package/src/Private/updater.js +45 -45
- package/src/Private/uuidCache.js +37 -33
- package/src/Private/validate.js +97 -97
- package/src/index.js +82 -83
- package/src/structures/APIIncident.js +78 -78
- package/src/structures/APIStatus.js +47 -47
- package/src/structures/Boosters/Booster.js +83 -87
- package/src/structures/Color.js +129 -129
- package/src/structures/Game.js +164 -160
- package/src/structures/GameCounts.js +151 -151
- package/src/structures/Guild/Guild.js +204 -218
- package/src/structures/Guild/GuildMember.js +66 -66
- package/src/structures/Guild/GuildRank.js +48 -48
- package/src/structures/ItemBytes.js +33 -36
- package/src/structures/Leaderboard.js +31 -31
- package/src/structures/MiniGames/Arcade.js +567 -569
- package/src/structures/MiniGames/ArenaBrawl.js +52 -56
- package/src/structures/MiniGames/BedWars.js +423 -351
- package/src/structures/MiniGames/BlitzSurvivalGames.js +172 -148
- package/src/structures/MiniGames/BuildBattle.js +53 -53
- package/src/structures/MiniGames/CopsAndCrims.js +90 -90
- package/src/structures/MiniGames/Duels.js +694 -630
- package/src/structures/MiniGames/MegaWalls.js +137 -137
- package/src/structures/MiniGames/MurderMystery.js +93 -93
- package/src/structures/MiniGames/Paintball.js +67 -67
- package/src/structures/MiniGames/Pit.js +19 -19
- package/src/structures/MiniGames/Quakecraft.js +101 -101
- package/src/structures/MiniGames/SkyWars.js +508 -559
- package/src/structures/MiniGames/SmashHeroes.js +144 -151
- package/src/structures/MiniGames/SpeedUHC.js +115 -57
- package/src/structures/MiniGames/TNTGames.js +116 -116
- package/src/structures/MiniGames/TurboKartRacers.js +201 -176
- package/src/structures/MiniGames/UHC.js +164 -143
- package/src/structures/MiniGames/VampireZ.js +60 -60
- package/src/structures/MiniGames/Walls.js +52 -52
- package/src/structures/MiniGames/Warlords.js +62 -62
- package/src/structures/MiniGames/WoolWars.js +123 -0
- package/src/structures/Pet.js +96 -97
- package/src/structures/Pets.js +64 -64
- package/src/structures/Player.js +433 -449
- package/src/structures/PlayerCosmetics.js +100 -95
- package/src/structures/RecentGame.js +57 -57
- package/src/structures/ServerInfo.js +78 -78
- package/src/structures/SkyBlock/Auctions/Auction.js +104 -104
- package/src/structures/SkyBlock/Auctions/AuctionInfo.js +54 -54
- package/src/structures/SkyBlock/Auctions/BaseAuction.js +45 -45
- package/src/structures/SkyBlock/Auctions/Bid.js +48 -48
- package/src/structures/SkyBlock/Auctions/PartialAuction.js +25 -25
- package/src/structures/SkyBlock/Bazzar/Order.js +38 -38
- package/src/structures/SkyBlock/Bazzar/Product.js +53 -53
- package/src/structures/SkyBlock/News/SkyblockNews.js +60 -68
- package/src/structures/SkyBlock/SkyblockInventoryItem.js +124 -130
- package/src/structures/SkyBlock/SkyblockMember.js +820 -687
- package/src/structures/SkyBlock/SkyblockPet.js +71 -71
- package/src/structures/SkyBlock/SkyblockProfile.js +60 -60
- package/src/structures/Status.js +41 -41
- package/src/structures/Watchdog/Stats.js +36 -36
- package/src/utils/Constants.js +2789 -809
- package/src/utils/SkyblockUtils.js +208 -164
- package/src/utils/arrayTools.js +4 -4
- package/src/utils/divide.js +5 -5
- package/src/utils/guildExp.js +57 -67
- package/src/utils/index.js +13 -13
- package/src/utils/isGuildID.js +3 -3
- package/src/utils/isUUID.js +5 -5
- package/src/utils/oscillation.js +15 -23
- package/src/utils/removeSnakeCase.js +22 -35
- package/src/utils/rgbToHexColor.js +8 -8
- package/src/utils/romanize.js +11 -13
- package/src/utils/toIGN.js +20 -20
- package/src/utils/toUuid.js +19 -19
- package/src/utils/varInt.js +17 -21
- package/typings/index.d.ts +3532 -2644
- package/src/API/getFriends.js +0 -14
- package/src/API/getKeyInfo.js +0 -10
- package/src/API/getRankedSkyWars.js +0 -11
- package/src/structures/Friend.js +0 -38
- package/src/structures/KeyInfo.js +0 -42
- package/src/structures/MiniGames/SkyWarsRanked.js +0 -45
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
// eslint-disable-next-line camelcase
|
|
2
|
-
const { pet_score } = require('../../utils/Constants');
|
|
3
|
-
/**
|
|
4
|
-
* Skyblock Pet class
|
|
5
|
-
*/
|
|
6
|
-
class SkyblockPet {
|
|
7
|
-
/**
|
|
8
|
-
* Skyblock pet data
|
|
9
|
-
* @param {object} data
|
|
10
|
-
*/
|
|
11
|
-
constructor(data) {
|
|
12
|
-
/**
|
|
13
|
-
* Skyblock Pet UUID
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
this.uuid = data.uuid;
|
|
17
|
-
/**
|
|
18
|
-
* Skyblock Pet type
|
|
19
|
-
* @type {string}
|
|
20
|
-
*/
|
|
21
|
-
this.type = data.type;
|
|
22
|
-
/**
|
|
23
|
-
* Skyblock Pet experience
|
|
24
|
-
* @type {number}
|
|
25
|
-
*/
|
|
26
|
-
this.xp = data.exp || 0;
|
|
27
|
-
/**
|
|
28
|
-
* wether the pet is currently equipped
|
|
29
|
-
* @type {boolean}
|
|
30
|
-
*/
|
|
31
|
-
this.active = Boolean(data.active);
|
|
32
|
-
/**
|
|
33
|
-
* Skyblock Pet rarity
|
|
34
|
-
* @type {Rarity}
|
|
35
|
-
*/
|
|
36
|
-
this.rarity = data.tier;
|
|
37
|
-
/**
|
|
38
|
-
* Skyblock Pet score
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/
|
|
41
|
-
this.petScore = pet_score[data.tier] || 0;
|
|
42
|
-
/**
|
|
43
|
-
* Skyblock Pet held item
|
|
44
|
-
* @type {string|null}
|
|
45
|
-
*/
|
|
46
|
-
this.heldItem = data.heldItem ? data.heldItem.replace(/^PET_ITEM_/, '') : null;
|
|
47
|
-
/**
|
|
48
|
-
* Skyblock Pet candy used
|
|
49
|
-
* @type {number}
|
|
50
|
-
*/
|
|
51
|
-
this.candyUsed = data.candyUsed || 0;
|
|
52
|
-
/**
|
|
53
|
-
* Skyblock Pet skin
|
|
54
|
-
* @type {string|null}
|
|
55
|
-
*/
|
|
56
|
-
this.skin = data.skin;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* @typedef {string} Rarity
|
|
61
|
-
* * `VERY_SPECIAL`
|
|
62
|
-
* * `SPECIAL`
|
|
63
|
-
* * `SUPREME`
|
|
64
|
-
* * `MYTHIC`
|
|
65
|
-
* * `LEGENDARY`
|
|
66
|
-
* * `EPIC`
|
|
67
|
-
* * `RARE`
|
|
68
|
-
* * `UNCOMMON`
|
|
69
|
-
* * `COMMON`
|
|
70
|
-
*/
|
|
71
|
-
module.exports = SkyblockPet;
|
|
1
|
+
// eslint-disable-next-line camelcase
|
|
2
|
+
const { pet_score } = require('../../utils/Constants');
|
|
3
|
+
/**
|
|
4
|
+
* Skyblock Pet class
|
|
5
|
+
*/
|
|
6
|
+
class SkyblockPet {
|
|
7
|
+
/**
|
|
8
|
+
* Skyblock pet data
|
|
9
|
+
* @param {object} data
|
|
10
|
+
*/
|
|
11
|
+
constructor(data) {
|
|
12
|
+
/**
|
|
13
|
+
* Skyblock Pet UUID
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
this.uuid = data.uuid;
|
|
17
|
+
/**
|
|
18
|
+
* Skyblock Pet type
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
this.type = data.type;
|
|
22
|
+
/**
|
|
23
|
+
* Skyblock Pet experience
|
|
24
|
+
* @type {number}
|
|
25
|
+
*/
|
|
26
|
+
this.xp = data.exp || 0;
|
|
27
|
+
/**
|
|
28
|
+
* wether the pet is currently equipped
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
*/
|
|
31
|
+
this.active = Boolean(data.active);
|
|
32
|
+
/**
|
|
33
|
+
* Skyblock Pet rarity
|
|
34
|
+
* @type {Rarity}
|
|
35
|
+
*/
|
|
36
|
+
this.rarity = data.tier;
|
|
37
|
+
/**
|
|
38
|
+
* Skyblock Pet score
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
this.petScore = pet_score[data.tier] || 0;
|
|
42
|
+
/**
|
|
43
|
+
* Skyblock Pet held item
|
|
44
|
+
* @type {string|null}
|
|
45
|
+
*/
|
|
46
|
+
this.heldItem = data.heldItem ? data.heldItem.replace(/^PET_ITEM_/, '') : null;
|
|
47
|
+
/**
|
|
48
|
+
* Skyblock Pet candy used
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
this.candyUsed = data.candyUsed || 0;
|
|
52
|
+
/**
|
|
53
|
+
* Skyblock Pet skin
|
|
54
|
+
* @type {string|null}
|
|
55
|
+
*/
|
|
56
|
+
this.skin = data.skin;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @typedef {string} Rarity
|
|
61
|
+
* * `VERY_SPECIAL`
|
|
62
|
+
* * `SPECIAL`
|
|
63
|
+
* * `SUPREME`
|
|
64
|
+
* * `MYTHIC`
|
|
65
|
+
* * `LEGENDARY`
|
|
66
|
+
* * `EPIC`
|
|
67
|
+
* * `RARE`
|
|
68
|
+
* * `UNCOMMON`
|
|
69
|
+
* * `COMMON`
|
|
70
|
+
*/
|
|
71
|
+
module.exports = SkyblockPet;
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
const SkyblockMember = require('./SkyblockMember');
|
|
2
|
-
/**
|
|
3
|
-
* Skyblock Profile class
|
|
4
|
-
*/
|
|
5
|
-
class SkyblockProfile {
|
|
6
|
-
/**
|
|
7
|
-
* Skyblock profile data
|
|
8
|
-
* @param {object} data
|
|
9
|
-
*/
|
|
10
|
-
constructor
|
|
11
|
-
/**
|
|
12
|
-
* Skyblock profile ID
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
this.profileId = data.profile_id;
|
|
16
|
-
/**
|
|
17
|
-
* Skyblock profile name
|
|
18
|
-
* @type {string}
|
|
19
|
-
*/
|
|
20
|
-
this.profileName = data.profile_name;
|
|
21
|
-
/**
|
|
22
|
-
* Skyblock profile members
|
|
23
|
-
* @type {SkyblockMember[]}
|
|
24
|
-
*/
|
|
25
|
-
this.members = edit(data.members, this.profileName).map((m) => new SkyblockMember(m));
|
|
26
|
-
/**
|
|
27
|
-
* Queried player's member stats
|
|
28
|
-
* @type {SkyblockMember}
|
|
29
|
-
*/
|
|
30
|
-
this.me = this.members.find((x) => x.uuid === data.me);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
function edit
|
|
48
|
-
const edited = [];
|
|
49
|
-
Object.keys(members).forEach((k) => {
|
|
50
|
-
const m = members[k];
|
|
51
|
-
edited.push({
|
|
52
|
-
uuid: k,
|
|
53
|
-
profileName,
|
|
54
|
-
m
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
return edited;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
module.exports = SkyblockProfile;
|
|
1
|
+
const SkyblockMember = require('./SkyblockMember');
|
|
2
|
+
/**
|
|
3
|
+
* Skyblock Profile class
|
|
4
|
+
*/
|
|
5
|
+
class SkyblockProfile {
|
|
6
|
+
/**
|
|
7
|
+
* Skyblock profile data
|
|
8
|
+
* @param {object} data
|
|
9
|
+
*/
|
|
10
|
+
constructor(data) {
|
|
11
|
+
/**
|
|
12
|
+
* Skyblock profile ID
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
this.profileId = data.profile_id;
|
|
16
|
+
/**
|
|
17
|
+
* Skyblock profile name
|
|
18
|
+
* @type {string}
|
|
19
|
+
*/
|
|
20
|
+
this.profileName = data.profile_name;
|
|
21
|
+
/**
|
|
22
|
+
* Skyblock profile members
|
|
23
|
+
* @type {SkyblockMember[]}
|
|
24
|
+
*/
|
|
25
|
+
this.members = edit(data.members, this.profileName).map((m) => new SkyblockMember(m));
|
|
26
|
+
/**
|
|
27
|
+
* Queried player's member stats
|
|
28
|
+
* @type {SkyblockMember}
|
|
29
|
+
*/
|
|
30
|
+
this.me = this.members.find((x) => x.uuid === data.me);
|
|
31
|
+
/**
|
|
32
|
+
* Is the profile selected
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
35
|
+
this.selected = data.selected;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Profile Name
|
|
39
|
+
* @return {string}
|
|
40
|
+
*/
|
|
41
|
+
toString() {
|
|
42
|
+
return this.profileName;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line require-jsdoc
|
|
47
|
+
function edit(members, profileName) {
|
|
48
|
+
const edited = [];
|
|
49
|
+
Object.keys(members).forEach((k) => {
|
|
50
|
+
const m = members[k];
|
|
51
|
+
edited.push({
|
|
52
|
+
uuid: k,
|
|
53
|
+
profileName,
|
|
54
|
+
m
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
return edited;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = SkyblockProfile;
|
package/src/structures/Status.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
const Game = require('./Game');
|
|
2
|
-
/**
|
|
3
|
-
* Status class
|
|
4
|
-
*/
|
|
5
|
-
class Status {
|
|
6
|
-
/**
|
|
7
|
-
* @param {object} data Status data
|
|
8
|
-
*/
|
|
9
|
-
constructor
|
|
10
|
-
/**
|
|
11
|
-
* Player online status.<br>
|
|
12
|
-
* <br>
|
|
13
|
-
* Players can disable this endpoint via in-game settings. When done so the API will return as if the player is offline.
|
|
14
|
-
* @type {boolean}
|
|
15
|
-
*/
|
|
16
|
-
this.online = data.online;
|
|
17
|
-
/**
|
|
18
|
-
* Game type
|
|
19
|
-
* @type {Game|null}
|
|
20
|
-
*/
|
|
21
|
-
this.game = data.gameType ? new Game(data.gameType) : null;
|
|
22
|
-
/**
|
|
23
|
-
* Game mode
|
|
24
|
-
* @type {string|null}
|
|
25
|
-
*/
|
|
26
|
-
this.mode = data.mode ? data.mode : null;
|
|
27
|
-
/**
|
|
28
|
-
* Map
|
|
29
|
-
* @type {string|null}
|
|
30
|
-
*/
|
|
31
|
-
this.map = data.map ? data.map : null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Online Status
|
|
35
|
-
* @return {string}
|
|
36
|
-
*/
|
|
37
|
-
toString() {
|
|
38
|
-
return this.online ? 'Online' : 'Offline';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
module.exports = Status;
|
|
1
|
+
const Game = require('./Game');
|
|
2
|
+
/**
|
|
3
|
+
* Status class
|
|
4
|
+
*/
|
|
5
|
+
class Status {
|
|
6
|
+
/**
|
|
7
|
+
* @param {object} data Status data
|
|
8
|
+
*/
|
|
9
|
+
constructor(data) {
|
|
10
|
+
/**
|
|
11
|
+
* Player online status.<br>
|
|
12
|
+
* <br>
|
|
13
|
+
* Players can disable this endpoint via in-game settings. When done so the API will return as if the player is offline.
|
|
14
|
+
* @type {boolean}
|
|
15
|
+
*/
|
|
16
|
+
this.online = data.online;
|
|
17
|
+
/**
|
|
18
|
+
* Game type
|
|
19
|
+
* @type {Game|null}
|
|
20
|
+
*/
|
|
21
|
+
this.game = data.gameType ? new Game(data.gameType) : null;
|
|
22
|
+
/**
|
|
23
|
+
* Game mode
|
|
24
|
+
* @type {string|null}
|
|
25
|
+
*/
|
|
26
|
+
this.mode = data.mode ? data.mode : null;
|
|
27
|
+
/**
|
|
28
|
+
* Map
|
|
29
|
+
* @type {string|null}
|
|
30
|
+
*/
|
|
31
|
+
this.map = data.map ? data.map : null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Online Status
|
|
35
|
+
* @return {string}
|
|
36
|
+
*/
|
|
37
|
+
toString() {
|
|
38
|
+
return this.online ? 'Online' : 'Offline';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
module.exports = Status;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WatchdogStats class
|
|
3
|
-
*/
|
|
4
|
-
class WatchdogStats {
|
|
5
|
-
/**
|
|
6
|
-
* @param {object} data Watchdog data
|
|
7
|
-
*/
|
|
8
|
-
constructor
|
|
9
|
-
/**
|
|
10
|
-
* Total watchdog's bans
|
|
11
|
-
* @type {number}
|
|
12
|
-
*/
|
|
13
|
-
this.byWatchdogTotal = data.watchdog_total || 0;
|
|
14
|
-
/**
|
|
15
|
-
* Watchdog's bans in the last minute
|
|
16
|
-
* @type {number}
|
|
17
|
-
*/
|
|
18
|
-
this.byWatchdogLastMinute = data.watchdog_lastMinute || 0;
|
|
19
|
-
/**
|
|
20
|
-
* Watchdog's bans in the last day ( resets at 5 am UTC ).
|
|
21
|
-
* @type {number}
|
|
22
|
-
*/
|
|
23
|
-
this.byWatchdogRollingDay = data.watchdog_rollingDaily || 0;
|
|
24
|
-
/**
|
|
25
|
-
* Total staff bans
|
|
26
|
-
* @type {number}
|
|
27
|
-
*/
|
|
28
|
-
this.byStaffTotal = data.staff_total || 0;
|
|
29
|
-
/**
|
|
30
|
-
* Staff bans in the last day ( resets at 5 am UTC ).
|
|
31
|
-
* @type {number}
|
|
32
|
-
*/
|
|
33
|
-
this.byStaffRollingDay = data.staff_rollingDaily || 0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
module.exports = WatchdogStats;
|
|
1
|
+
/**
|
|
2
|
+
* WatchdogStats class
|
|
3
|
+
*/
|
|
4
|
+
class WatchdogStats {
|
|
5
|
+
/**
|
|
6
|
+
* @param {object} data Watchdog data
|
|
7
|
+
*/
|
|
8
|
+
constructor(data) {
|
|
9
|
+
/**
|
|
10
|
+
* Total watchdog's bans
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
this.byWatchdogTotal = data.watchdog_total || 0;
|
|
14
|
+
/**
|
|
15
|
+
* Watchdog's bans in the last minute
|
|
16
|
+
* @type {number}
|
|
17
|
+
*/
|
|
18
|
+
this.byWatchdogLastMinute = data.watchdog_lastMinute || 0;
|
|
19
|
+
/**
|
|
20
|
+
* Watchdog's bans in the last day ( resets at 5 am UTC ).
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
this.byWatchdogRollingDay = data.watchdog_rollingDaily || 0;
|
|
24
|
+
/**
|
|
25
|
+
* Total staff bans
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
this.byStaffTotal = data.staff_total || 0;
|
|
29
|
+
/**
|
|
30
|
+
* Staff bans in the last day ( resets at 5 am UTC ).
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
this.byStaffRollingDay = data.staff_rollingDaily || 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
module.exports = WatchdogStats;
|