hypixel-api-reborn 10.0.0 → 11.0.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.
Files changed (105) hide show
  1. package/.prettierrc +13 -0
  2. package/README.md +27 -15
  3. package/package.json +60 -58
  4. package/src/API/getAPIStatus.js +8 -8
  5. package/src/API/getBoosters.js +6 -6
  6. package/src/API/getGameCounts.js +6 -6
  7. package/src/API/getGuild.js +18 -18
  8. package/src/API/getLeaderboards.js +13 -13
  9. package/src/API/getPlayer.js +22 -27
  10. package/src/API/getRecentGames.js +18 -18
  11. package/src/API/getServerInfo.js +66 -77
  12. package/src/API/getStatus.js +8 -8
  13. package/src/API/getWatchdogStats.js +6 -6
  14. package/src/API/index.js +19 -23
  15. package/src/API/skyblock/getEndedSkyblockAuctions.js +10 -10
  16. package/src/API/skyblock/getSkyblockAuctions.js +64 -64
  17. package/src/API/skyblock/getSkyblockAuctionsByPlayer.js +11 -11
  18. package/src/API/skyblock/getSkyblockBazaar.js +10 -10
  19. package/src/API/skyblock/getSkyblockMember.js +28 -25
  20. package/src/API/skyblock/getSkyblockNews.js +6 -6
  21. package/src/API/skyblock/getSkyblockProfiles.js +44 -41
  22. package/src/Client.js +406 -450
  23. package/src/Errors.js +44 -39
  24. package/src/Private/defaultCache.js +77 -78
  25. package/src/Private/rateLimit.js +79 -98
  26. package/src/Private/requests.js +65 -54
  27. package/src/Private/updater.js +45 -45
  28. package/src/Private/uuidCache.js +37 -33
  29. package/src/Private/validate.js +97 -97
  30. package/src/index.js +82 -83
  31. package/src/structures/APIIncident.js +78 -78
  32. package/src/structures/APIStatus.js +47 -47
  33. package/src/structures/Boosters/Booster.js +83 -87
  34. package/src/structures/Color.js +129 -129
  35. package/src/structures/Game.js +164 -160
  36. package/src/structures/GameCounts.js +151 -151
  37. package/src/structures/Guild/Guild.js +204 -218
  38. package/src/structures/Guild/GuildMember.js +66 -66
  39. package/src/structures/Guild/GuildRank.js +48 -48
  40. package/src/structures/ItemBytes.js +33 -36
  41. package/src/structures/Leaderboard.js +31 -31
  42. package/src/structures/MiniGames/Arcade.js +567 -569
  43. package/src/structures/MiniGames/ArenaBrawl.js +52 -56
  44. package/src/structures/MiniGames/BedWars.js +423 -351
  45. package/src/structures/MiniGames/BlitzSurvivalGames.js +172 -148
  46. package/src/structures/MiniGames/BuildBattle.js +53 -53
  47. package/src/structures/MiniGames/CopsAndCrims.js +90 -90
  48. package/src/structures/MiniGames/Duels.js +694 -630
  49. package/src/structures/MiniGames/MegaWalls.js +137 -137
  50. package/src/structures/MiniGames/MurderMystery.js +93 -93
  51. package/src/structures/MiniGames/Paintball.js +67 -67
  52. package/src/structures/MiniGames/Pit.js +19 -19
  53. package/src/structures/MiniGames/Quakecraft.js +101 -101
  54. package/src/structures/MiniGames/SkyWars.js +508 -559
  55. package/src/structures/MiniGames/SmashHeroes.js +144 -151
  56. package/src/structures/MiniGames/SpeedUHC.js +115 -57
  57. package/src/structures/MiniGames/TNTGames.js +116 -116
  58. package/src/structures/MiniGames/TurboKartRacers.js +201 -176
  59. package/src/structures/MiniGames/UHC.js +164 -143
  60. package/src/structures/MiniGames/VampireZ.js +60 -60
  61. package/src/structures/MiniGames/Walls.js +52 -52
  62. package/src/structures/MiniGames/Warlords.js +62 -62
  63. package/src/structures/MiniGames/WoolWars.js +123 -0
  64. package/src/structures/Pet.js +96 -97
  65. package/src/structures/Pets.js +64 -64
  66. package/src/structures/Player.js +433 -449
  67. package/src/structures/PlayerCosmetics.js +100 -95
  68. package/src/structures/RecentGame.js +57 -57
  69. package/src/structures/ServerInfo.js +78 -78
  70. package/src/structures/SkyBlock/Auctions/Auction.js +104 -104
  71. package/src/structures/SkyBlock/Auctions/AuctionInfo.js +54 -54
  72. package/src/structures/SkyBlock/Auctions/BaseAuction.js +45 -45
  73. package/src/structures/SkyBlock/Auctions/Bid.js +48 -48
  74. package/src/structures/SkyBlock/Auctions/PartialAuction.js +25 -25
  75. package/src/structures/SkyBlock/Bazzar/Order.js +38 -38
  76. package/src/structures/SkyBlock/Bazzar/Product.js +53 -53
  77. package/src/structures/SkyBlock/News/SkyblockNews.js +60 -68
  78. package/src/structures/SkyBlock/SkyblockInventoryItem.js +124 -130
  79. package/src/structures/SkyBlock/SkyblockMember.js +820 -687
  80. package/src/structures/SkyBlock/SkyblockPet.js +71 -71
  81. package/src/structures/SkyBlock/SkyblockProfile.js +60 -60
  82. package/src/structures/Status.js +41 -41
  83. package/src/structures/Watchdog/Stats.js +36 -36
  84. package/src/utils/Constants.js +2789 -809
  85. package/src/utils/SkyblockUtils.js +208 -164
  86. package/src/utils/arrayTools.js +4 -4
  87. package/src/utils/divide.js +5 -5
  88. package/src/utils/guildExp.js +57 -67
  89. package/src/utils/index.js +13 -13
  90. package/src/utils/isGuildID.js +3 -3
  91. package/src/utils/isUUID.js +5 -5
  92. package/src/utils/oscillation.js +15 -23
  93. package/src/utils/removeSnakeCase.js +22 -35
  94. package/src/utils/rgbToHexColor.js +8 -8
  95. package/src/utils/romanize.js +11 -13
  96. package/src/utils/toIGN.js +20 -20
  97. package/src/utils/toUuid.js +19 -19
  98. package/src/utils/varInt.js +17 -21
  99. package/typings/index.d.ts +3532 -2644
  100. package/src/API/getFriends.js +0 -14
  101. package/src/API/getKeyInfo.js +0 -10
  102. package/src/API/getRankedSkyWars.js +0 -11
  103. package/src/structures/Friend.js +0 -38
  104. package/src/structures/KeyInfo.js +0 -42
  105. package/src/structures/MiniGames/SkyWarsRanked.js +0 -45
@@ -1,33 +1,37 @@
1
- /* eslint-disable require-jsdoc */
2
- const fetch = require('node-fetch');
3
- const cachedUuids = new Map();
4
-
5
- // TODO - use this for all cache models
6
-
7
- async function putCache (response) {
8
- try {
9
- response = await response.json();
10
- cachedUuids.set(response.id, response.name);
11
- setTimeout(deleteCache, 1000 * 60 * 10, response.id);
12
- } catch (e) {
13
- // F
14
- }
15
- }
16
- function deleteCache (id) {
17
- return cachedUuids.delete(id);
18
- }
19
- function response (obj) {
20
- return new fetch.Response(JSON.stringify(obj));
21
- }
22
- function checkHit (query) {
23
- if (cachedUuids.has(query)) return response({ id: query, name: cachedUuids.get(query) });
24
- const reverseSearch = Array.from(cachedUuids.entries()).find((pair) => pair[1].toLowerCase() === query.toLowerCase());
25
- if (reverseSearch) return response({ id: reverseSearch[0], name: query });
26
- return null;
27
- }
28
- module.exports = async (url, query) => {
29
- if (checkHit(query || url)) return checkHit(query || url);
30
- const res = await fetch(url);
31
- setTimeout(putCache, 0, res);
32
- return await res.clone();
33
- };
1
+ /* eslint-disable require-jsdoc */
2
+ const requireFetch = !globalThis.fetch;
3
+ const externalFetch = require('node-fetch');
4
+ const fetch = requireFetch ? externalFetch : globalThis.fetch;
5
+ const cachedUuids = new Map();
6
+
7
+ // TODO - use this for all cache models
8
+
9
+ async function putCache(response) {
10
+ try {
11
+ response = await response.json();
12
+ cachedUuids.set(response.id, response.name);
13
+ setTimeout(deleteCache, 1000 * 60 * 10, response.id);
14
+ } catch (e) {
15
+ // F
16
+ }
17
+ }
18
+ function deleteCache(id) {
19
+ return cachedUuids.delete(id);
20
+ }
21
+ function response(obj) {
22
+ return new fetch.Response(JSON.stringify(obj));
23
+ }
24
+ function checkHit(query) {
25
+ if (cachedUuids.has(query)) return response({ id: query, name: cachedUuids.get(query) });
26
+ const reverseSearch = Array.from(cachedUuids.entries()).find((pair) => pair[1].toLowerCase() === query.toLowerCase());
27
+ if (reverseSearch) return response({ id: reverseSearch[0], name: query });
28
+ return null;
29
+ }
30
+ module.exports = async (url, query) => {
31
+ if (checkHit(query || url)) return checkHit(query || url);
32
+ const res = await fetch(url);
33
+ const response = await res.clone().json();
34
+ // Don't cache 5xx
35
+ if (response.error !== 'Internal Server Error' && response.status < 500) setTimeout(putCache, 0, res.clone());
36
+ return res;
37
+ };
@@ -1,97 +1,97 @@
1
- /* eslint-disable require-jsdoc */
2
- const Errors = require('../Errors');
3
- const { isStrArray, strToArray } = require('../utils/arrayTools');
4
- /**
5
- * Validation Class, used internally to validate provided arguments
6
- */
7
- class Validation {
8
- /**
9
- * Check if cache options are valid
10
- * @param {Object} options Global Cache Options to be validated
11
- * @returns {void} Void
12
- * @private
13
- */
14
- validateOptions (options) {
15
- if (typeof options.cacheTime !== 'number') throw new Error(Errors.CACHE_TIME_MUST_BE_A_NUMBER);
16
- if (typeof options.cacheSize !== 'number') throw new Error(Errors.CACHE_LIMIT_MUST_BE_A_NUMBER);
17
- if (typeof options.rateLimit !== 'string' || !['AUTO', 'HARD', 'NONE'].includes(options.rateLimit)) throw new Error(Errors.INVALID_RATE_LIMIT_OPTION);
18
- if (typeof options.keyLimit !== 'number') throw new Error(Errors.INVALID_KEY_LIMIT_OPTION);
19
- if (typeof options.syncWithHeaders !== 'boolean') throw new Error(Errors.INVALID_HEADER_SYNC_OPTION);
20
- if (typeof options.headers !== 'object') throw new Error(Errors.INVALID_HEADERS);
21
- }
22
-
23
- /**
24
- * Parses cache options
25
- * @param {Object} options Options to be parsed
26
- * @returns {Object} Parsed cache options
27
- * @private
28
- */
29
- parseOptions (options) {
30
- if (typeof options !== 'object' || options === null) throw new Error(Errors.OPTIONS_MUST_BE_AN_OBJECT);
31
- return {
32
- cache: options.cache || false,
33
- cacheTime: options.cacheTime || 60,
34
- cacheSize: (options.cacheSize === -1 ? Infinity : options.cacheSize) || Infinity,
35
- cacheFilter: typeof options.cacheFilter === 'function' ? options.cacheFilter : this._handleFilter(options.cacheFilter),
36
- rateLimit: options.rateLimit || 'AUTO',
37
- keyLimit: options.keyLimit || 120,
38
- syncWithHeaders: !!options.syncWithHeaders,
39
- headers: options.headers || {},
40
- silent: !!options.silent,
41
- checkForUpdates: options.checkForUpdates || false
42
- };
43
- }
44
-
45
- /**
46
- * Checks if Key is provided in a correct format
47
- * @param {string} key API Key
48
- * @returns {string} Key
49
- * @private
50
- */
51
- validateKey (key) {
52
- if (!key) throw new Error(Errors.NO_API_KEY);
53
- if (typeof key !== 'string') throw new Error(Errors.KEY_MUST_BE_A_STRING);
54
- return key;
55
- }
56
-
57
- /**
58
- * Check if suboptions are valid
59
- * @param {Object} input Cache options
60
- * @returns {boolean} Whether options are valid
61
- * @private
62
- */
63
- cacheSuboptions (input) {
64
- if (typeof input !== 'object' || input === null) return false;
65
- if (!input.noCacheCheck && !input.noCaching && !input.raw) return false;
66
- return true;
67
- }
68
-
69
- /**
70
- * Handles & parses the filter
71
- * @param {*} filter FilterResolvable to be parsed
72
- * @returns {Function} Filter function
73
- * @private
74
- */
75
- _handleFilter (filter) {
76
- if (!filter) return () => true;
77
- if (typeof filter === 'object' && !Array.isArray(filter)) {
78
- if (filter.whitelist && isStrArray(filter.whitelist)) return (x) => strToArray(filter.whitelist).includes(x);
79
- if (filter.blacklist && isStrArray(filter.blacklist)) return (x) => !strToArray(filter.blacklist).includes(x);
80
- throw new Error(Errors.CACHE_FILTER_INVALID);
81
- }
82
- if (!isStrArray(filter)) throw new Error(Errors.CACHE_FILTER_INVALID);
83
- // blacklist by default
84
- return (x) => !strToArray(filter).includes(x);
85
- }
86
- /**
87
- * Checks user's node version
88
- * -12 will return an error; -14 will result in a warning
89
- * @returns {void}
90
- * @private
91
- */
92
- validateNodeVersion () {
93
- const nodeVersion = parseInt(process.version.match(/v(\d{2})\.\d{1,}\.\d+/)[1], 10);
94
- if (nodeVersion < 12) throw new Error(Errors.NODE_VERSION_ERR);
95
- }
96
- }
97
- module.exports = Validation;
1
+ /* eslint-disable require-jsdoc */
2
+ const Errors = require('../Errors');
3
+ const { isStrArray, strToArray } = require('../utils/arrayTools');
4
+ /**
5
+ * Validation Class, used internally to validate provided arguments
6
+ */
7
+ class Validation {
8
+ /**
9
+ * Check if cache options are valid
10
+ * @param {Object} options Global Cache Options to be validated
11
+ * @returns {void} Void
12
+ * @private
13
+ */
14
+ validateOptions(options) {
15
+ if (typeof options.cacheTime !== 'number') throw new Error(Errors.CACHE_TIME_MUST_BE_A_NUMBER);
16
+ if (typeof options.cacheSize !== 'number') throw new Error(Errors.CACHE_LIMIT_MUST_BE_A_NUMBER);
17
+ if (typeof options.rateLimit !== 'string' || !['AUTO', 'HARD', 'NONE'].includes(options.rateLimit)) throw new Error(Errors.INVALID_RATE_LIMIT_OPTION);
18
+ if (typeof options.keyLimit !== 'number') throw new Error(Errors.INVALID_KEY_LIMIT_OPTION);
19
+ if (typeof options.syncWithHeaders !== 'boolean') throw new Error(Errors.INVALID_HEADER_SYNC_OPTION);
20
+ if (typeof options.headers !== 'object') throw new Error(Errors.INVALID_HEADERS);
21
+ }
22
+
23
+ /**
24
+ * Parses cache options
25
+ * @param {Object} options Options to be parsed
26
+ * @returns {Object} Parsed cache options
27
+ * @private
28
+ */
29
+ parseOptions(options) {
30
+ if (typeof options !== 'object' || options === null) throw new Error(Errors.OPTIONS_MUST_BE_AN_OBJECT);
31
+ return {
32
+ cache: options.cache || false,
33
+ cacheTime: options.cacheTime || 60,
34
+ cacheSize: (options.cacheSize === -1 ? Infinity : options.cacheSize) || Infinity,
35
+ cacheFilter: typeof options.cacheFilter === 'function' ? options.cacheFilter : this._handleFilter(options.cacheFilter),
36
+ rateLimit: options.rateLimit || 'AUTO',
37
+ keyLimit: options.keyLimit || 120,
38
+ syncWithHeaders: !!options.syncWithHeaders,
39
+ headers: options.headers || {},
40
+ silent: !!options.silent,
41
+ checkForUpdates: options.checkForUpdates || false
42
+ };
43
+ }
44
+
45
+ /**
46
+ * Checks if Key is provided in a correct format
47
+ * @param {string} key API Key
48
+ * @returns {string} Key
49
+ * @private
50
+ */
51
+ validateKey(key) {
52
+ if (!key) throw new Error(Errors.NO_API_KEY);
53
+ if (typeof key !== 'string') throw new Error(Errors.KEY_MUST_BE_A_STRING);
54
+ return key;
55
+ }
56
+
57
+ /**
58
+ * Check if suboptions are valid
59
+ * @param {Object} input Cache options
60
+ * @returns {boolean} Whether options are valid
61
+ * @private
62
+ */
63
+ cacheSuboptions(input) {
64
+ if (typeof input !== 'object' || input === null) return false;
65
+ if (!input.noCacheCheck && !input.noCaching && !input.raw) return false;
66
+ return true;
67
+ }
68
+
69
+ /**
70
+ * Handles & parses the filter
71
+ * @param {*} filter FilterResolvable to be parsed
72
+ * @returns {Function} Filter function
73
+ * @private
74
+ */
75
+ _handleFilter(filter) {
76
+ if (!filter) return () => true;
77
+ if (typeof filter === 'object' && !Array.isArray(filter)) {
78
+ if (filter.whitelist && isStrArray(filter.whitelist)) return (x) => strToArray(filter.whitelist).includes(x);
79
+ if (filter.blacklist && isStrArray(filter.blacklist)) return (x) => !strToArray(filter.blacklist).includes(x);
80
+ throw new Error(Errors.CACHE_FILTER_INVALID);
81
+ }
82
+ if (!isStrArray(filter)) throw new Error(Errors.CACHE_FILTER_INVALID);
83
+ // blacklist by default
84
+ return (x) => !strToArray(filter).includes(x);
85
+ }
86
+ /**
87
+ * Checks user's node version
88
+ * -12 will return an error; -14 will result in a warning
89
+ * @returns {void}
90
+ * @private
91
+ */
92
+ validateNodeVersion() {
93
+ const nodeVersion = parseInt(process.version.match(/v(\d{2})\.\d{1,}\.\d+/)[1], 10);
94
+ if (nodeVersion < 12) throw new Error(Errors.NODE_VERSION_ERR);
95
+ }
96
+ }
97
+ module.exports = Validation;
package/src/index.js CHANGED
@@ -1,83 +1,82 @@
1
- module.exports = {
2
- Client: require('./Client.js'),
3
- version: require('../package.json').version,
4
-
5
- /* API Status */
6
- APIStatus: require('./structures/APIStatus.js'),
7
- APIIncident: require('./structures/APIIncident.js'),
8
-
9
- Player: require('./structures/Player.js'),
10
- Game: require('./structures/Game.js'),
11
- Friend: require('./structures/Friend.js'),
12
- Status: require('./structures/Status.js'),
13
- Color: require('./structures/Color.js'),
14
- KeyInfo: require('./structures/KeyInfo.js'),
15
- Pet: require('./structures/Pet'),
16
- Pets: require('./structures/Pets'),
17
- PlayerCosmetics: require('./structures/PlayerCosmetics'),
18
-
19
- /* Watchdog */
20
- WatchdogStats: require('./structures/Watchdog/Stats.js'),
21
-
22
- /* Guild */
23
- Guild: require('./structures/Guild/Guild.js'),
24
- GuildMember: require('./structures/Guild/GuildMember.js'),
25
- GuildRank: require('./structures/Guild/GuildRank.js'),
26
-
27
- /* SkyBlock */
28
- SkyblockProfile: require('./structures/SkyBlock/SkyblockProfile.js'),
29
- SkyblockMember: require('./structures/SkyBlock/SkyblockMember.js'),
30
- SkyblockInventoryItem: require('./structures/SkyBlock/SkyblockInventoryItem.js'),
31
- SkyblockPet: require('./structures/SkyBlock/SkyblockPet'),
32
-
33
- /* Skyblock Auctions */
34
- BaseAuction: require('./structures/SkyBlock/Auctions/BaseAuction.js'),
35
- PartialAuction: require('./structures/SkyBlock/Auctions/PartialAuction.js'),
36
- Auction: require('./structures/SkyBlock/Auctions/Auction.js'),
37
- AuctionInfo: require('./structures/SkyBlock/Auctions/AuctionInfo.js'),
38
- Bid: require('./structures/SkyBlock/Auctions/Bid.js'),
39
-
40
- /* Skyblock Bazaar */
41
- Product: require('./structures/SkyBlock/Bazzar/Product.js'),
42
- Order: require('./structures/SkyBlock/Bazzar/Order.js'),
43
-
44
- /** Skyblock News */
45
- SkyblockNews: require('./structures/SkyBlock/News/SkyblockNews'),
46
-
47
- /* Booster */
48
- Booster: require('./structures/Boosters/Booster.js'),
49
-
50
- /* MiniGames */
51
- Arcade: require('./structures/MiniGames/Arcade.js'),
52
- ArenaBrawl: require('./structures/MiniGames/ArenaBrawl.js'),
53
- BedWars: require('./structures/MiniGames/BedWars.js'),
54
- BlitzSurvivalGames: require('./structures/MiniGames/BlitzSurvivalGames.js'),
55
- BuildBattle: require('./structures/MiniGames/BuildBattle.js'),
56
- CopsAndCrims: require('./structures/MiniGames/CopsAndCrims.js'),
57
- Duels: require('./structures/MiniGames/Duels.js'),
58
- MegaWalls: require('./structures/MiniGames/MegaWalls.js'),
59
- MurderMystery: require('./structures/MiniGames/MurderMystery.js'),
60
- Paintball: require('./structures/MiniGames/Paintball.js'),
61
- Quakecraft: require('./structures/MiniGames/Quakecraft.js'),
62
- SkyWars: require('./structures/MiniGames/SkyWars.js'),
63
- SmashHeroes: require('./structures/MiniGames/SmashHeroes.js'),
64
- SpeedUHC: require('./structures/MiniGames/SpeedUHC.js'),
65
- TNTGames: require('./structures/MiniGames/TNTGames.js'),
66
- TurboKartRacers: require('./structures/MiniGames/TurboKartRacers.js'),
67
- UHC: require('./structures/MiniGames/UHC.js'),
68
- VampireZ: require('./structures/MiniGames/VampireZ.js'),
69
- Walls: require('./structures/MiniGames/Walls.js'),
70
- Warlords: require('./structures/MiniGames/Warlords.js'),
71
-
72
- /* Leaderboards */
73
- Leaderboard: require('./structures/Leaderboard.js'),
74
-
75
- /** Server Info */
76
- ServerInfo: require('./structures/ServerInfo'),
77
-
78
- /* Errors */
79
- Errors: require('./Errors.js'),
80
-
81
- /* Utils */
82
- Utils: require('./utils')
83
- };
1
+ module.exports = {
2
+ Client: require('./Client.js'),
3
+ version: require('../package.json').version,
4
+
5
+ /* API Status */
6
+ APIStatus: require('./structures/APIStatus.js'),
7
+ APIIncident: require('./structures/APIIncident.js'),
8
+
9
+ Player: require('./structures/Player.js'),
10
+ Game: require('./structures/Game.js'),
11
+ Status: require('./structures/Status.js'),
12
+ Color: require('./structures/Color.js'),
13
+ Pet: require('./structures/Pet'),
14
+ Pets: require('./structures/Pets'),
15
+ PlayerCosmetics: require('./structures/PlayerCosmetics'),
16
+
17
+ /* Watchdog */
18
+ WatchdogStats: require('./structures/Watchdog/Stats.js'),
19
+
20
+ /* Guild */
21
+ Guild: require('./structures/Guild/Guild.js'),
22
+ GuildMember: require('./structures/Guild/GuildMember.js'),
23
+ GuildRank: require('./structures/Guild/GuildRank.js'),
24
+
25
+ /* SkyBlock */
26
+ SkyblockProfile: require('./structures/SkyBlock/SkyblockProfile.js'),
27
+ SkyblockMember: require('./structures/SkyBlock/SkyblockMember.js'),
28
+ SkyblockInventoryItem: require('./structures/SkyBlock/SkyblockInventoryItem.js'),
29
+ SkyblockPet: require('./structures/SkyBlock/SkyblockPet'),
30
+
31
+ /* Skyblock Auctions */
32
+ BaseAuction: require('./structures/SkyBlock/Auctions/BaseAuction.js'),
33
+ PartialAuction: require('./structures/SkyBlock/Auctions/PartialAuction.js'),
34
+ Auction: require('./structures/SkyBlock/Auctions/Auction.js'),
35
+ AuctionInfo: require('./structures/SkyBlock/Auctions/AuctionInfo.js'),
36
+ Bid: require('./structures/SkyBlock/Auctions/Bid.js'),
37
+
38
+ /* Skyblock Bazaar */
39
+ Product: require('./structures/SkyBlock/Bazzar/Product.js'),
40
+ Order: require('./structures/SkyBlock/Bazzar/Order.js'),
41
+
42
+ /* Skyblock News */
43
+ SkyblockNews: require('./structures/SkyBlock/News/SkyblockNews'),
44
+
45
+ /* Booster */
46
+ Booster: require('./structures/Boosters/Booster.js'),
47
+
48
+ /* MiniGames */
49
+ Arcade: require('./structures/MiniGames/Arcade.js'),
50
+ ArenaBrawl: require('./structures/MiniGames/ArenaBrawl.js'),
51
+ BedWars: require('./structures/MiniGames/BedWars.js'),
52
+ BlitzSurvivalGames: require('./structures/MiniGames/BlitzSurvivalGames.js'),
53
+ BuildBattle: require('./structures/MiniGames/BuildBattle.js'),
54
+ CopsAndCrims: require('./structures/MiniGames/CopsAndCrims.js'),
55
+ Duels: require('./structures/MiniGames/Duels.js'),
56
+ MegaWalls: require('./structures/MiniGames/MegaWalls.js'),
57
+ MurderMystery: require('./structures/MiniGames/MurderMystery.js'),
58
+ Paintball: require('./structures/MiniGames/Paintball.js'),
59
+ Quakecraft: require('./structures/MiniGames/Quakecraft.js'),
60
+ SkyWars: require('./structures/MiniGames/SkyWars.js'),
61
+ SmashHeroes: require('./structures/MiniGames/SmashHeroes.js'),
62
+ SpeedUHC: require('./structures/MiniGames/SpeedUHC.js'),
63
+ TNTGames: require('./structures/MiniGames/TNTGames.js'),
64
+ TurboKartRacers: require('./structures/MiniGames/TurboKartRacers.js'),
65
+ UHC: require('./structures/MiniGames/UHC.js'),
66
+ VampireZ: require('./structures/MiniGames/VampireZ.js'),
67
+ Walls: require('./structures/MiniGames/Walls.js'),
68
+ Warlords: require('./structures/MiniGames/Warlords.js'),
69
+ WoolWars: require('./structures/MiniGames/WoolWars.js'),
70
+
71
+ /* Leaderboards */
72
+ Leaderboard: require('./structures/Leaderboard.js'),
73
+
74
+ /* Server Info */
75
+ ServerInfo: require('./structures/ServerInfo.js'),
76
+
77
+ /* Errors */
78
+ Errors: require('./Errors.js'),
79
+
80
+ /* Utils */
81
+ Utils: require('./utils')
82
+ };
@@ -1,78 +1,78 @@
1
- const regex = /https:\/\/status.hypixel.net\/incidents\/([a-z0-9]+)/;
2
- /**
3
- * API incident class
4
- */
5
- class APIIncident {
6
- /**
7
- * @param {object} data API incident data
8
- */
9
- constructor (data) {
10
- /**
11
- * Link to incident
12
- * @type {string|null}
13
- */
14
- this.link = data.link || null;
15
- /**
16
- * Timestamp when investigation was started as Date object
17
- * @type {object|null}
18
- */
19
- this.start = new Date(data.pubDate) || null;
20
- /**
21
- * Formatted timestamp when investigation was started
22
- * @type {string|null}
23
- */
24
- this.startFormatted = data.pubDate || null;
25
- /**
26
- * Timestamp when investigation was started as Date
27
- * @type {Date|null}
28
- */
29
- this.startTimestamp = new Date(data.pubDate).getTime() || null;
30
- /**
31
- * Incident author
32
- * @type {string|null}
33
- */
34
- this.author = data.creator || null;
35
- /**
36
- * Content as HTML
37
- * @type {string|null}
38
- */
39
- this.HTMLContent = data.content || null;
40
- /**
41
- * Content snippet
42
- * @type {string|null}
43
- */
44
- this.snippet = data.contentSnippet || null;
45
- /**
46
- * Content as plain text
47
- * The parsing might be faulty!
48
- * @type {string|null}
49
- */
50
- this.TextContent = (data.content || '').replace(/<[^>]+>/g, '') || null;
51
- /**
52
- * GUID
53
- * @type {string|null}
54
- */
55
- this.guid = data.guid ? regex.exec(data.guid)[1] : null;
56
- /**
57
- * Incident categories
58
- * @type {string[]}
59
- */
60
- this.categories = data.categories || [];
61
- /**
62
- * Whether the incident is resolved/completed or not
63
- * @author linearaccelerator
64
- * @type {boolean}
65
- * @version >6.0.1
66
- */
67
- this.isResolved = this.TextContent.includes('Resolved -') || this.TextContent.includes('Completed -');
68
- }
69
- /**
70
- * Text Content
71
- * @return {string}
72
- */
73
- toString() {
74
- return this.TextContent;
75
- }
76
- }
77
-
78
- module.exports = APIIncident;
1
+ const regex = /https:\/\/status.hypixel.net\/incidents\/([a-z0-9]+)/;
2
+ /**
3
+ * API incident class
4
+ */
5
+ class APIIncident {
6
+ /**
7
+ * @param {object} data API incident data
8
+ */
9
+ constructor(data) {
10
+ /**
11
+ * Link to incident
12
+ * @type {string|null}
13
+ */
14
+ this.link = data.link || null;
15
+ /**
16
+ * Timestamp when investigation was started as Date object
17
+ * @type {object|null}
18
+ */
19
+ this.start = new Date(data.pubDate) || null;
20
+ /**
21
+ * Formatted timestamp when investigation was started
22
+ * @type {string|null}
23
+ */
24
+ this.startFormatted = data.pubDate || null;
25
+ /**
26
+ * Timestamp when investigation was started as Date
27
+ * @type {Date|null}
28
+ */
29
+ this.startTimestamp = new Date(data.pubDate).getTime() || null;
30
+ /**
31
+ * Incident author
32
+ * @type {string|null}
33
+ */
34
+ this.author = data.creator || null;
35
+ /**
36
+ * Content as HTML
37
+ * @type {string|null}
38
+ */
39
+ this.HTMLContent = data.content || null;
40
+ /**
41
+ * Content snippet
42
+ * @type {string|null}
43
+ */
44
+ this.snippet = data.contentSnippet || null;
45
+ /**
46
+ * Content as plain text
47
+ * The parsing might be faulty!
48
+ * @type {string|null}
49
+ */
50
+ this.TextContent = (data.content || '').replace(/<[^>]+>/g, '') || null;
51
+ /**
52
+ * GUID
53
+ * @type {string|null}
54
+ */
55
+ this.guid = data.guid ? regex.exec(data.guid)[1] : null;
56
+ /**
57
+ * Incident categories
58
+ * @type {string[]}
59
+ */
60
+ this.categories = data.categories || [];
61
+ /**
62
+ * Whether the incident is resolved/completed or not
63
+ * @author linearaccelerator
64
+ * @type {boolean}
65
+ * @version >6.0.1
66
+ */
67
+ this.isResolved = this.TextContent.includes('Resolved -') || this.TextContent.includes('Completed -');
68
+ }
69
+ /**
70
+ * Text Content
71
+ * @return {string}
72
+ */
73
+ toString() {
74
+ return this.TextContent;
75
+ }
76
+ }
77
+
78
+ module.exports = APIIncident;