hypixel-api-reborn 11.2.0 → 11.3.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 -1
- package/eslint.config.mjs +71 -0
- package/package.json +14 -20
- package/src/API/getAchievements.js +1 -0
- package/src/API/getBoosters.js +1 -0
- package/src/API/getChallenges.js +1 -0
- package/src/API/getGameCounts.js +1 -0
- package/src/API/getGuild.js +4 -3
- package/src/API/getGuildAchievements.js +1 -0
- package/src/API/getLeaderboards.js +1 -1
- package/src/API/getPlayer.js +1 -0
- package/src/API/getQuests.js +1 -0
- package/src/API/getRecentGames.js +5 -9
- package/src/API/getServerInfo.js +40 -37
- package/src/API/getStatus.js +1 -0
- package/src/API/getWatchdogStats.js +1 -0
- package/src/API/housing/getActiveHouses.js +7 -0
- package/src/API/housing/getHouse.js +9 -0
- package/src/API/housing/getPlayerHouses.js +11 -0
- package/src/API/index.js +6 -1
- package/src/API/skyblock/getAuction.js +8 -6
- package/src/API/skyblock/getAuctions.js +15 -12
- package/src/API/skyblock/getAuctionsByPlayer.js +1 -1
- package/src/API/skyblock/getBazaar.js +1 -3
- package/src/API/skyblock/getBingo.js +1 -2
- package/src/API/skyblock/getBingoByPlayer.js +3 -3
- package/src/API/skyblock/getEndedAuctions.js +1 -0
- package/src/API/skyblock/getFireSales.js +1 -1
- package/src/API/skyblock/getGarden.js +7 -0
- package/src/API/skyblock/getGovernment.js +1 -2
- package/src/API/skyblock/getMember.js +5 -2
- package/src/API/skyblock/getMuseum.js +1 -0
- package/src/API/skyblock/getNews.js +1 -0
- package/src/API/skyblock/getProfiles.js +5 -2
- package/src/Client.js +88 -16
- package/src/Private/rateLimit.js +7 -11
- package/src/Private/requests.js +12 -13
- package/src/Private/updater.js +2 -3
- package/src/Private/uuidCache.js +1 -2
- package/src/Private/validate.js +19 -19
- package/src/index.js +5 -0
- package/src/structures/APIIncident.js +1 -2
- package/src/structures/APIStatus.js +0 -1
- package/src/structures/Boosters/Booster.js +9 -8
- package/src/structures/Game.js +1 -1
- package/src/structures/Guild/Guild.js +19 -36
- package/src/structures/Guild/GuildMember.js +2 -2
- package/src/structures/House.js +54 -0
- package/src/structures/MiniGames/Arcade.js +798 -312
- package/src/structures/MiniGames/ArenaBrawl.js +98 -32
- package/src/structures/MiniGames/BedWars.js +197 -194
- package/src/structures/MiniGames/BlitzSurvivalGames.js +381 -129
- package/src/structures/MiniGames/BuildBattle.js +19 -8
- package/src/structures/MiniGames/CopsAndCrims.js +253 -25
- package/src/structures/MiniGames/Duels.js +905 -664
- package/src/structures/MiniGames/MegaWalls.js +390 -51
- package/src/structures/MiniGames/MurderMystery.js +151 -30
- package/src/structures/MiniGames/Paintball.js +31 -11
- package/src/structures/MiniGames/Pit.js +4 -5
- package/src/structures/MiniGames/Quakecraft.js +113 -50
- package/src/structures/MiniGames/SkyWars.js +528 -372
- package/src/structures/MiniGames/SmashHeroes.js +201 -73
- package/src/structures/MiniGames/SpeedUHC.js +77 -24
- package/src/structures/MiniGames/TNTGames.js +242 -73
- package/src/structures/MiniGames/TurboKartRacers.js +55 -115
- package/src/structures/MiniGames/UHC.js +144 -132
- package/src/structures/MiniGames/VampireZ.js +70 -37
- package/src/structures/MiniGames/Warlords.js +126 -1
- package/src/structures/MiniGames/WoolWars.js +60 -9
- package/src/structures/Pet.js +1 -1
- package/src/structures/Player.js +43 -128
- package/src/structures/PlayerCosmetics.js +5 -4
- package/src/structures/SkyBlock/Auctions/AuctionInfo.js +2 -1
- package/src/structures/SkyBlock/Auctions/BaseAuction.js +1 -1
- package/src/structures/SkyBlock/News/SkyblockNews.js +15 -15
- package/src/structures/SkyBlock/PlayerBingo.js +7 -14
- package/src/structures/SkyBlock/SkyblockGarden.js +146 -0
- package/src/structures/SkyBlock/SkyblockInventoryItem.js +4 -28
- package/src/structures/SkyBlock/SkyblockMember.js +90 -228
- package/src/structures/SkyBlock/SkyblockPet.js +3 -4
- package/src/structures/SkyBlock/Static/Bingo.js +10 -11
- package/src/structures/SkyBlock/Static/BingoData.js +1 -1
- package/src/structures/Static/Achievement.js +16 -15
- package/src/structures/Static/AchievementTier.js +2 -2
- package/src/structures/Static/Quest.js +2 -2
- package/src/utils/Constants.js +522 -520
- package/src/utils/{guildExp.js → Guild.js} +42 -12
- package/src/utils/Player.js +112 -0
- package/src/utils/SkyblockUtils.js +482 -192
- package/src/utils/arrayTools.js +1 -1
- package/src/utils/divide.js +1 -1
- package/src/utils/index.js +2 -1
- package/src/utils/isGuildID.js +1 -1
- package/src/utils/oscillation.js +4 -2
- package/src/utils/removeSnakeCase.js +11 -7
- package/src/utils/rgbToHexColor.js +1 -1
- package/src/utils/romanize.js +3 -3
- package/src/utils/toUuid.js +4 -4
- package/src/utils/varInt.js +2 -2
- package/typings/index.d.ts +1186 -967
- package/src/utils/toIGN.js +0 -24
|
@@ -1,4 +1,108 @@
|
|
|
1
1
|
const divide = require('../../utils/divide');
|
|
2
|
+
|
|
3
|
+
class SmashHeroesMode {
|
|
4
|
+
/**
|
|
5
|
+
* @param {object} data SmashHeroes data
|
|
6
|
+
* @param {string} mode SmashHeores mode
|
|
7
|
+
*/
|
|
8
|
+
constructor(data, mode) {
|
|
9
|
+
/**
|
|
10
|
+
* kills
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
this.kills = data[`kills_${mode}`] || 0;
|
|
14
|
+
/**
|
|
15
|
+
* deaths
|
|
16
|
+
* @type {number}
|
|
17
|
+
*/
|
|
18
|
+
this.deaths = data[`deaths_${mode}`] || 0;
|
|
19
|
+
/**
|
|
20
|
+
* KDRatio
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
this.KDRatio = divide(this.kills, this.deaths);
|
|
24
|
+
/**
|
|
25
|
+
* wins
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
this.wins = data[`wins_${mode}`] || 0;
|
|
29
|
+
/**
|
|
30
|
+
* losses
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
this.losses = data[`losses_${mode}`] || 0;
|
|
34
|
+
/**
|
|
35
|
+
* WLRatio
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
this.WLRatio = divide(this.wins, this.losses);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
class SmashHeoresHero {
|
|
43
|
+
/**
|
|
44
|
+
* @param {object} data SmashHeroes data
|
|
45
|
+
* @param {string} hero Hero name
|
|
46
|
+
*/
|
|
47
|
+
constructor(data, hero) {
|
|
48
|
+
/**
|
|
49
|
+
* Hero Name
|
|
50
|
+
* @type {string}
|
|
51
|
+
*/
|
|
52
|
+
this.name = hero;
|
|
53
|
+
/**
|
|
54
|
+
* Level
|
|
55
|
+
* @type {number}
|
|
56
|
+
*/
|
|
57
|
+
this.level = data[`lastLevel_${hero}`] || 0;
|
|
58
|
+
/**
|
|
59
|
+
* Xp
|
|
60
|
+
* @type {number}
|
|
61
|
+
*/
|
|
62
|
+
this.xp = data[`xp_${hero}`] || 0;
|
|
63
|
+
/**
|
|
64
|
+
* Prestige
|
|
65
|
+
* @type {number}
|
|
66
|
+
*/
|
|
67
|
+
this.prestige = data[`pg_${hero}`] || 0;
|
|
68
|
+
/**
|
|
69
|
+
* Played Games
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
this.playedGames = data.class_stats?.[hero]?.games || 0;
|
|
73
|
+
/**
|
|
74
|
+
* Kills
|
|
75
|
+
* @type {number}
|
|
76
|
+
*/
|
|
77
|
+
this.kills = data.class_stats?.[hero]?.kills || 0;
|
|
78
|
+
/**
|
|
79
|
+
* Deaths
|
|
80
|
+
* @type {number}
|
|
81
|
+
*/
|
|
82
|
+
this.deaths = data.class_stats?.[hero]?.deaths || 0;
|
|
83
|
+
/**
|
|
84
|
+
* KDRatio
|
|
85
|
+
* @type {number}
|
|
86
|
+
*/
|
|
87
|
+
this.KDRatio = divide(this.kills, this.deaths);
|
|
88
|
+
/**
|
|
89
|
+
* Wins
|
|
90
|
+
* @type {number}
|
|
91
|
+
*/
|
|
92
|
+
this.wins = data.class_stats?.[hero]?.wins || 0;
|
|
93
|
+
/**
|
|
94
|
+
* Losses
|
|
95
|
+
* @type {number}
|
|
96
|
+
*/
|
|
97
|
+
this.losses = data.class_stats?.[hero]?.losses || 0;
|
|
98
|
+
/**
|
|
99
|
+
* WLRatio
|
|
100
|
+
* @type {number}
|
|
101
|
+
*/
|
|
102
|
+
this.WLRatio = divide(this.wins, this.losses);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
2
106
|
/**
|
|
3
107
|
* SmashHeroes class
|
|
4
108
|
*/
|
|
@@ -57,88 +161,112 @@ class SmashHeroes {
|
|
|
57
161
|
* @type {number}
|
|
58
162
|
*/
|
|
59
163
|
this.WLRatio = divide(this.wins, this.losses);
|
|
164
|
+
/**
|
|
165
|
+
* Smashed
|
|
166
|
+
* @type {number}
|
|
167
|
+
*/
|
|
168
|
+
this.smashed = data.smashed || 0;
|
|
169
|
+
/**
|
|
170
|
+
* Stats for each mode
|
|
171
|
+
* @type {SmashHeroesMode}
|
|
172
|
+
*/
|
|
173
|
+
this['1v1v1v1'] = new SmashHeroesMode(data, 'normal');
|
|
174
|
+
/**
|
|
175
|
+
* Stats for each mode
|
|
176
|
+
* @type {SmashHeroesMode}
|
|
177
|
+
*/
|
|
178
|
+
this['2v2'] = new SmashHeroesMode(data, '2v2');
|
|
60
179
|
/**
|
|
61
180
|
* Stats for each mode
|
|
62
|
-
* @type {
|
|
181
|
+
* @type {SmashHeroesMode}
|
|
63
182
|
*/
|
|
64
|
-
this
|
|
65
|
-
'1v1v1v1': generateModeStats(data, 'normal'),
|
|
66
|
-
'2v2': generateModeStats(data, '2v2'),
|
|
67
|
-
'2v2v2': generateModeStats(data, 'teams')
|
|
68
|
-
};
|
|
183
|
+
this['2v2v2'] = new SmashHeroesMode(data, 'teams');
|
|
69
184
|
/**
|
|
70
185
|
* Active class
|
|
71
186
|
* @type {string}
|
|
72
187
|
*/
|
|
73
|
-
this.activeClass = data.active_class
|
|
188
|
+
this.activeClass = data.active_class || null;
|
|
74
189
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @type {
|
|
190
|
+
* The Bulk
|
|
191
|
+
* @type {SmashHeoresHero}
|
|
77
192
|
*/
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
193
|
+
this.theBulk = new SmashHeoresHero(data, 'THE_BULK');
|
|
194
|
+
/**
|
|
195
|
+
* Cake Monster
|
|
196
|
+
* @type {SmashHeoresHero}
|
|
197
|
+
*/
|
|
198
|
+
this.cakeMonster = new SmashHeoresHero(data, 'CAKE_MONSTER');
|
|
199
|
+
/**
|
|
200
|
+
* General Cluck
|
|
201
|
+
* @type {SmashHeoresHero}
|
|
202
|
+
*/
|
|
203
|
+
this.generalCluck = new SmashHeoresHero(data, 'GENERAL_CLUCK');
|
|
204
|
+
/**
|
|
205
|
+
* Botmun
|
|
206
|
+
* @type {SmashHeoresHero}
|
|
207
|
+
*/
|
|
208
|
+
this.botmun = new SmashHeoresHero(data, 'BOTMUN');
|
|
209
|
+
/**
|
|
210
|
+
* Marauder
|
|
211
|
+
* @type {SmashHeoresHero}
|
|
212
|
+
*/
|
|
213
|
+
this.marauder = new SmashHeoresHero(data, 'MARAUDER');
|
|
214
|
+
/**
|
|
215
|
+
* Pug
|
|
216
|
+
* @type {SmashHeoresHero}
|
|
217
|
+
*/
|
|
218
|
+
this.pug = new SmashHeoresHero(data, 'PUG');
|
|
219
|
+
/**
|
|
220
|
+
* Tinman
|
|
221
|
+
* @type {SmashHeoresHero}
|
|
222
|
+
*/
|
|
223
|
+
this.tinman = new SmashHeoresHero(data, 'TINMAN');
|
|
224
|
+
/**
|
|
225
|
+
* Spoderman
|
|
226
|
+
* @type {SmashHeoresHero}
|
|
227
|
+
*/
|
|
228
|
+
this.spoderman = new SmashHeoresHero(data, 'SPODERMAN');
|
|
229
|
+
/**
|
|
230
|
+
* Frosty
|
|
231
|
+
* @type {SmashHeoresHero}
|
|
232
|
+
*/
|
|
233
|
+
this.frosty = new SmashHeoresHero(data, 'FROSTY');
|
|
234
|
+
/**
|
|
235
|
+
* Sergeant Shield
|
|
236
|
+
* @type {SmashHeoresHero}
|
|
237
|
+
*/
|
|
238
|
+
this.sergeantShield = new SmashHeoresHero(data, 'SERGEANT_SHIELD');
|
|
239
|
+
/**
|
|
240
|
+
* Skullfire
|
|
241
|
+
* @type {SmashHeoresHero}
|
|
242
|
+
*/
|
|
243
|
+
this.skullfire = new SmashHeoresHero(data, 'SKULLFIRE');
|
|
244
|
+
/**
|
|
245
|
+
* Goku
|
|
246
|
+
* @type {SmashHeoresHero}
|
|
247
|
+
*/
|
|
248
|
+
this.goku = new SmashHeoresHero(data, 'GOKU');
|
|
249
|
+
/**
|
|
250
|
+
* Sanic
|
|
251
|
+
* @type {SmashHeoresHero}
|
|
252
|
+
*/
|
|
253
|
+
this.sanic = new SmashHeoresHero(data, 'SANIC');
|
|
254
|
+
/**
|
|
255
|
+
* Dusk Crawler
|
|
256
|
+
* @type {SmashHeoresHero}
|
|
257
|
+
*/
|
|
258
|
+
this.duskCrawler = new SmashHeoresHero(data, 'DUSK_CRAWLER');
|
|
259
|
+
/**
|
|
260
|
+
* Shoop Da Whoop
|
|
261
|
+
* @type {SmashHeoresHero}
|
|
262
|
+
*/
|
|
263
|
+
this.shoopDaWhoop = new SmashHeoresHero(data, 'SHOOP_DA_WHOOP');
|
|
264
|
+
/**
|
|
265
|
+
* Green Hood
|
|
266
|
+
* @type {SmashHeoresHero}
|
|
267
|
+
*/
|
|
268
|
+
this.greenHood = new SmashHeoresHero(data, 'GREEN_HOOD');
|
|
112
269
|
}
|
|
113
|
-
return stats;
|
|
114
270
|
}
|
|
115
|
-
|
|
116
|
-
* @typedef {object} SmashHeroesModes
|
|
117
|
-
* @property {SmashHeroesModeStats} '1v1v1v1' 1v1v1v1
|
|
118
|
-
* @property {SmashHeroesModeStats} '2v2' 2v2
|
|
119
|
-
* @property {SmashHeroesModeStats} '2v2v2' 2v2v2
|
|
120
|
-
*/
|
|
121
|
-
/**
|
|
122
|
-
* @typedef {object} SmashHeroesModeStats
|
|
123
|
-
* @property {number} kills Kills
|
|
124
|
-
* @property {number} deaths Deaths
|
|
125
|
-
* @property {number} KDRatio Kill/Death ratio
|
|
126
|
-
* @property {number} wins Wins
|
|
127
|
-
* @property {number} losses Losses
|
|
128
|
-
* @property {number} WLRatio Win/Loss ratio
|
|
129
|
-
*/
|
|
130
|
-
/**
|
|
131
|
-
* @typedef {object} SmashHeroesClassStats
|
|
132
|
-
* @property {string} name Name
|
|
133
|
-
* @property {number} level Level
|
|
134
|
-
* @property {number} xp XP
|
|
135
|
-
* @property {number} prestige Prestige
|
|
136
|
-
* @property {number} playedGames Played games
|
|
137
|
-
* @property {number} kills Kills
|
|
138
|
-
* @property {number} deaths Deaths
|
|
139
|
-
* @property {number} KDRatio Kill/Death ratio
|
|
140
|
-
* @property {number} wins Wins
|
|
141
|
-
* @property {number} losses Losses
|
|
142
|
-
* @property {number} WLRatio Win/Loss ratio
|
|
143
|
-
*/
|
|
271
|
+
|
|
144
272
|
module.exports = SmashHeroes;
|
|
@@ -1,4 +1,54 @@
|
|
|
1
1
|
const divide = require('../../utils/divide');
|
|
2
|
+
|
|
3
|
+
class SpeedUHCMode {
|
|
4
|
+
/**
|
|
5
|
+
* @param {object} data Speed UHC data
|
|
6
|
+
* @param {string} data Speed UHC data
|
|
7
|
+
*/
|
|
8
|
+
constructor(data, mode) {
|
|
9
|
+
/**
|
|
10
|
+
* Kills
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
this.kills = data[`kills_${mode}`] || 0;
|
|
14
|
+
/**
|
|
15
|
+
* Deaths
|
|
16
|
+
* @type {number}
|
|
17
|
+
*/
|
|
18
|
+
this.deaths = data[`deaths_${mode}`] || 0;
|
|
19
|
+
/**
|
|
20
|
+
* Wins
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
this.wins = data[`wins_${mode}`] || 0;
|
|
24
|
+
/**
|
|
25
|
+
* Losses
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
this.losses = data[`losses_${mode}`] || 0;
|
|
29
|
+
/**
|
|
30
|
+
* Played Games
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
this.playedGames = data[`games_${mode}`] || 0;
|
|
34
|
+
/**
|
|
35
|
+
* Winstreak
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
this.winstreak = data[`win_streak_${mode}`] || 0;
|
|
39
|
+
/**
|
|
40
|
+
* Kill Streak
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
this.killStreak = data[`killstreak_${mode}`] || 0;
|
|
44
|
+
/**
|
|
45
|
+
* Assists
|
|
46
|
+
* @type {number}
|
|
47
|
+
*/
|
|
48
|
+
this.assists = data[`assists_${mode}`] || 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
2
52
|
/**
|
|
3
53
|
* Speed UHC class
|
|
4
54
|
*/
|
|
@@ -84,32 +134,35 @@ class SpeedUHC {
|
|
|
84
134
|
this.assists = data.assists || 0;
|
|
85
135
|
/**
|
|
86
136
|
* Solo
|
|
87
|
-
* @type {
|
|
88
|
-
*/
|
|
89
|
-
this.solo =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
* @type {SpeedUHCMode}
|
|
138
|
+
*/
|
|
139
|
+
this.solo = new SpeedUHCMode(data, 'solo');
|
|
140
|
+
/**
|
|
141
|
+
* Solo Normal
|
|
142
|
+
* @type {SpeedUHCMode}
|
|
143
|
+
*/
|
|
144
|
+
this.soloNormal = new SpeedUHCMode(data, 'solo_normal');
|
|
145
|
+
/**
|
|
146
|
+
* Solo Insane
|
|
147
|
+
* @type {SpeedUHCMode}
|
|
148
|
+
*/
|
|
149
|
+
this.soloInsane = new SpeedUHCMode(data, 'solo_insane');
|
|
99
150
|
/**
|
|
100
151
|
* Team
|
|
101
|
-
* @type {
|
|
102
|
-
*/
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
152
|
+
* @type {SpeedUHCMode}
|
|
153
|
+
*/
|
|
154
|
+
this.team = new SpeedUHCMode(data, 'team');
|
|
155
|
+
/**
|
|
156
|
+
* Team Normal
|
|
157
|
+
* @type {SpeedUHCMode}
|
|
158
|
+
*/
|
|
159
|
+
this.teamNormal = new SpeedUHCMode(data, 'team_normal');
|
|
160
|
+
/**
|
|
161
|
+
* Team Insane
|
|
162
|
+
* @type {SpeedUHCMode}
|
|
163
|
+
*/
|
|
164
|
+
this.teamInsane = new SpeedUHCMode(data, 'team_insane');
|
|
113
165
|
}
|
|
114
166
|
}
|
|
167
|
+
|
|
115
168
|
module.exports = SpeedUHC;
|