hive-bedrock-api 1.0.10 → 2.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 (51) hide show
  1. package/README.md +37 -41
  2. package/lib/helpers/fetchEndpoint.d.ts +3 -0
  3. package/lib/{methods/fetchData.js → helpers/fetchEndpoint.js} +18 -14
  4. package/lib/helpers/isGame.d.ts +2 -0
  5. package/lib/helpers/isGame.js +7 -0
  6. package/lib/helpers/toPoint.d.ts +1 -0
  7. package/lib/helpers/toPoint.js +6 -0
  8. package/lib/index.d.ts +9 -9
  9. package/lib/index.js +13 -31
  10. package/lib/methods/getAllTimeLeaderboard.d.ts +4 -5
  11. package/lib/methods/getAllTimeLeaderboard.js +25 -19
  12. package/lib/methods/getAllTimeStatistics.d.ts +9 -0
  13. package/lib/methods/getAllTimeStatistics.js +180 -0
  14. package/lib/methods/getGlobalStatistics.d.ts +3 -3
  15. package/lib/methods/getGlobalStatistics.js +7 -30
  16. package/lib/methods/getMaps.d.ts +3 -4
  17. package/lib/methods/getMaps.js +17 -38
  18. package/lib/methods/getMetadata.d.ts +3 -0
  19. package/lib/methods/{getPlayerInfo.js → getMetadata.js} +20 -18
  20. package/lib/methods/getMonthlyLeaderboard.d.ts +9 -11
  21. package/lib/methods/getMonthlyLeaderboard.js +28 -56
  22. package/lib/methods/getMonthlyStatistics.d.ts +10 -0
  23. package/lib/methods/getMonthlyStatistics.js +154 -0
  24. package/lib/methods/getPlayerInfomation.d.ts +3 -0
  25. package/lib/methods/{getGameMetadata.js → getPlayerInfomation.js} +15 -21
  26. package/lib/processors/index.d.ts +7 -0
  27. package/lib/processors/index.js +116 -0
  28. package/lib/types/output.d.ts +67 -0
  29. package/lib/types/{GAMES.js → output.js} +1 -1
  30. package/lib/types/types.d.ts +21 -0
  31. package/package.json +7 -8
  32. package/lib/format/gameFormat.d.ts +0 -30
  33. package/lib/format/gameFormat.js +0 -164
  34. package/lib/methods/calculateLevel.d.ts +0 -2
  35. package/lib/methods/calculateLevel.js +0 -45
  36. package/lib/methods/fetchData.d.ts +0 -25
  37. package/lib/methods/getAllTimeStats.d.ts +0 -13
  38. package/lib/methods/getAllTimeStats.js +0 -186
  39. package/lib/methods/getGameMetadata.d.ts +0 -4
  40. package/lib/methods/getMonthlyStats.d.ts +0 -15
  41. package/lib/methods/getMonthlyStats.js +0 -192
  42. package/lib/methods/getPlayerInfo.d.ts +0 -4
  43. package/lib/types/API.d.ts +0 -224
  44. package/lib/types/API.js +0 -37
  45. package/lib/types/ENDPOINTS.d.ts +0 -11
  46. package/lib/types/GAMES.d.ts +0 -85
  47. package/lib/types/GAME_INFO.d.ts +0 -26
  48. package/lib/types/GAME_INFO.js +0 -113
  49. package/lib/types/METHODS.d.ts +0 -8
  50. package/lib/types/METHODS.js +0 -2
  51. /package/lib/types/{ENDPOINTS.js → types.js} +0 -0
@@ -1,192 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __read = (this && this.__read) || function (o, n) {
50
- var m = typeof Symbol === "function" && o[Symbol.iterator];
51
- if (!m) return o;
52
- var i = m.call(o), r, ar = [], e;
53
- try {
54
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
- }
56
- catch (error) { e = { error: error }; }
57
- finally {
58
- try {
59
- if (r && !r.done && (m = i["return"])) m.call(i);
60
- }
61
- finally { if (e) throw e.error; }
62
- }
63
- return ar;
64
- };
65
- var __importDefault = (this && this.__importDefault) || function (mod) {
66
- return (mod && mod.__esModule) ? mod : { "default": mod };
67
- };
68
- Object.defineProperty(exports, "__esModule", { value: true });
69
- var gameFormat_1 = __importDefault(require("../format/gameFormat"));
70
- var GAME_INFO_1 = require("../types/GAME_INFO");
71
- var fetchData_1 = __importDefault(require("./fetchData"));
72
- function getMonthlyStats(playerIdentifier, game, options) {
73
- var _a, _b;
74
- return __awaiter(this, void 0, void 0, function () {
75
- var _c, data, error, gameData, filteredGamesEntries, filteredGames, err_1, year, month, _d, data, error, gameData, err_2, _e, data, error, gameData, err_3, _f, data, error, FILTER_GAMES_1, filteredGamesEntries, filteredGames, gameData, err_4;
76
- var _g, _h;
77
- return __generator(this, function (_j) {
78
- switch (_j.label) {
79
- case 0:
80
- if (typeof game === "object" && !(game instanceof Array)) {
81
- options = game;
82
- game = undefined;
83
- }
84
- if (!!game) return [3 /*break*/, 4];
85
- _j.label = 1;
86
- case 1:
87
- _j.trys.push([1, 3, , 4]);
88
- return [4 /*yield*/, (0, fetchData_1.default)("/game/monthly/player/all/".concat(playerIdentifier), options === null || options === void 0 ? void 0 : options.fetch)];
89
- case 2:
90
- _c = _j.sent(), data = _c.data, error = _c.error;
91
- if (error || !data)
92
- return [2 /*return*/, {
93
- data: null,
94
- error: __assign({ message: "Failed to fetch data." }, error),
95
- }];
96
- gameData = (0, gameFormat_1.default)(data);
97
- filteredGamesEntries = Object.entries(gameData).filter(function (_a) {
98
- var _b = __read(_a, 1), key = _b[0];
99
- return Object.values(GAME_INFO_1.GAME).includes(key);
100
- });
101
- filteredGames = Object.fromEntries(filteredGamesEntries);
102
- return [2 /*return*/, { data: filteredGames, error: null }];
103
- case 3:
104
- err_1 = _j.sent();
105
- console.error(err_1);
106
- return [2 /*return*/, { data: null, error: { message: "Failed to fetch data." } }];
107
- case 4:
108
- if (!(((options === null || options === void 0 ? void 0 : options.year) || (options === null || options === void 0 ? void 0 : options.month) || (options === null || options === void 0 ? void 0 : options.date)) &&
109
- typeof game === "string")) return [3 /*break*/, 8];
110
- year = (_a = options.year) !== null && _a !== void 0 ? _a : new Date().getFullYear();
111
- month = (_b = options.month) !== null && _b !== void 0 ? _b : new Date().getMonth() + 1;
112
- if (options.date) {
113
- year = options.date.getFullYear();
114
- month = options.date.getMonth() + 1;
115
- }
116
- _j.label = 5;
117
- case 5:
118
- _j.trys.push([5, 7, , 8]);
119
- return [4 /*yield*/, (0, fetchData_1.default)("/game/monthly/player/".concat(game, "/").concat(playerIdentifier, "/").concat(year, "/").concat(month), options === null || options === void 0 ? void 0 : options.fetch)];
120
- case 6:
121
- _d = _j.sent(), data = _d.data, error = _d.error;
122
- if (error || !data)
123
- return [2 /*return*/, {
124
- data: null,
125
- error: __assign({ message: "Failed to fetch data." }, error),
126
- }];
127
- gameData = (0, gameFormat_1.default)((_g = {},
128
- _g[game] = data,
129
- _g), true);
130
- return [2 /*return*/, {
131
- data: gameData,
132
- error: null,
133
- }];
134
- case 7:
135
- err_2 = _j.sent();
136
- console.error(err_2);
137
- return [2 /*return*/, { data: null, error: { message: "Failed to fetch data." } }];
138
- case 8:
139
- if (!(typeof game === "string")) return [3 /*break*/, 12];
140
- _j.label = 9;
141
- case 9:
142
- _j.trys.push([9, 11, , 12]);
143
- return [4 /*yield*/, (0, fetchData_1.default)("/game/monthly/player/".concat(game, "/").concat(playerIdentifier), options === null || options === void 0 ? void 0 : options.fetch)];
144
- case 10:
145
- _e = _j.sent(), data = _e.data, error = _e.error;
146
- if (error || !data)
147
- return [2 /*return*/, {
148
- data: null,
149
- error: __assign({ message: "Failed to fetch data." }, error),
150
- }];
151
- gameData = (0, gameFormat_1.default)((_h = {},
152
- _h[game] = data,
153
- _h), true);
154
- return [2 /*return*/, {
155
- data: gameData,
156
- error: null,
157
- }];
158
- case 11:
159
- err_3 = _j.sent();
160
- console.error(err_3);
161
- return [2 /*return*/, { data: null, error: { message: "Failed to fetch data." } }];
162
- case 12:
163
- if (!Array.isArray(game)) return [3 /*break*/, 16];
164
- _j.label = 13;
165
- case 13:
166
- _j.trys.push([13, 15, , 16]);
167
- return [4 /*yield*/, (0, fetchData_1.default)("/game/monthly/player/all/".concat(playerIdentifier), options === null || options === void 0 ? void 0 : options.fetch)];
168
- case 14:
169
- _f = _j.sent(), data = _f.data, error = _f.error;
170
- if (error || !data)
171
- return [2 /*return*/, {
172
- data: null,
173
- error: __assign({ message: "Failed to fetch data." }, error),
174
- }];
175
- FILTER_GAMES_1 = game;
176
- filteredGamesEntries = Object.entries(data).filter(function (_a) {
177
- var _b = __read(_a, 1), key = _b[0];
178
- return FILTER_GAMES_1.includes(key);
179
- });
180
- filteredGames = Object.fromEntries(filteredGamesEntries);
181
- gameData = (0, gameFormat_1.default)(filteredGames);
182
- return [2 /*return*/, { data: gameData, error: null }];
183
- case 15:
184
- err_4 = _j.sent();
185
- console.error(err_4);
186
- return [2 /*return*/, { data: null, error: { message: "Failed to fetch data." } }];
187
- case 16: return [2 /*return*/, { data: null, error: { message: "Failed to detect game type." } }];
188
- }
189
- });
190
- });
191
- }
192
- exports.default = getMonthlyStats;
@@ -1,4 +0,0 @@
1
- import { Options } from "../types/API";
2
- import { USER_MAIN } from "../types/GAMES";
3
- import { MethodResponse } from "../types/METHODS";
4
- export default function getPlayerInfo(playerIdentifier: string, options?: Options): Promise<MethodResponse<USER_MAIN>>;
@@ -1,224 +0,0 @@
1
- import { FetchOptions } from "../methods/fetchData";
2
- import { GAME } from "./GAME_INFO";
3
- export interface API_ERROR {
4
- request?: {
5
- status: number;
6
- statusText: string;
7
- };
8
- ratelimit?: {
9
- limit: string | null;
10
- remaining: string | null;
11
- };
12
- error?: any;
13
- }
14
- export interface Options {
15
- fetch?: FetchOptions;
16
- }
17
- export declare enum MAP_SEASON {
18
- None = "NO_SEASON",
19
- Winter = "WINTERFEST",
20
- Spring = "SPRING",
21
- Summer = "SUMMER",
22
- Halloween = "HALLOWEEN",
23
- Autumn = "AUTUMN"
24
- }
25
- export declare enum MAP_VARIANT {
26
- Regular = "REGULAR",
27
- Duos = "DUOS",
28
- Trios = "TRIOS",
29
- Squads = "SQUADS",
30
- Mega = "MEGA",
31
- Royale = "ROYALE"
32
- }
33
- export declare enum RANK {
34
- Regular = "REGULAR",
35
- Plus = "PLUS",
36
- Youtuber = "YOUTUBER",
37
- Streamer = "STREAMER",
38
- Tiktok = "TIKTOK",
39
- VIP = "VIP",
40
- Helper = "HELPER",
41
- Moderator = "MODERATOR",
42
- Hive = "HIVE_TEAM",
43
- StaffManager = "STAFF_MANAGER",
44
- CommunityManager = "COMMUNITY_MANAGER",
45
- Owner = "OWNER"
46
- }
47
- export type API_REQUEST_ALL = {
48
- [G in GAME]: API_GAME_STATS_ALL<G>;
49
- } & {
50
- main: API_USER_MAIN;
51
- };
52
- export type API_REQUEST_MONTHLY = {
53
- [G in GAME]: API_GAME_STATS_MONTHLY<G>;
54
- };
55
- export type API_REQUEST_LB<G extends GAME> = API_LB_STATS<G>[];
56
- export type API_GAME_STATS<M extends API_BASE_GAME_ALL | API_BASE_GAME_MONTHLY | API_BASE_LB> = {
57
- [GAME.HideAndSeek]: M & API_GAME_HIDE;
58
- [GAME.DeathRun]: M & API_GAME_DR;
59
- [GAME.TreasureWars]: M & API_GAME_WARS;
60
- [GAME.MurderMystery]: M & API_GAME_MURDER;
61
- [GAME.SurvivalGames]: M & API_GAME_SG;
62
- [GAME.Skywars]: M & API_GAME_SKY;
63
- [GAME.CaptureTheFlag]: M & API_GAME_CTF;
64
- [GAME.BlockDrop]: M & API_GAME_DROP;
65
- [GAME.GroundWars]: M & API_GAME_GROUND;
66
- [GAME.JustBuild]: M & API_GAME_BUILD;
67
- [GAME.BlockParty]: M & API_GAME_PARTY;
68
- [GAME.TheBridge]: M & API_GAME_BRIDGE;
69
- [GAME.Gravity]: M & API_GAME_GRAV;
70
- };
71
- export type API_LB_STATS<G extends GAME> = API_GAME_STATS<API_BASE_LB>[G];
72
- export type API_GAME_STATS_ALL<G extends GAME> = API_GAME_STATS<API_BASE_GAME_ALL>[G];
73
- export type API_GAME_STATS_MONTHLY<G extends GAME> = API_GAME_STATS<API_BASE_GAME_MONTHLY>[G];
74
- export interface API_BASE_LB extends API_BASE_GAME_MONTHLY {
75
- UUID: string;
76
- }
77
- export interface API_GLOBAL_STATISTICS {
78
- unique_players: {
79
- [key in GAME]: number;
80
- } & {
81
- global: number;
82
- main: number;
83
- };
84
- }
85
- export interface API_MAP {
86
- name: string;
87
- season: MAP_SEASON;
88
- variant: MAP_VARIANT;
89
- image: string;
90
- }
91
- export interface API_METADATA {
92
- name: string;
93
- shortName: string;
94
- maxLevel: number;
95
- allowPrestiging: boolean;
96
- maxPrestige: number;
97
- experienceToLevel: {
98
- [xp: string]: number;
99
- };
100
- }
101
- export interface API_BASE_GAME_ALL {
102
- UUID: string;
103
- xp: number;
104
- played: number;
105
- victories: number;
106
- first_played: number;
107
- }
108
- export interface API_BASE_GAME_MONTHLY {
109
- index: number;
110
- human_index: number;
111
- username: string;
112
- xp: number;
113
- played: number;
114
- victories: number;
115
- }
116
- export type AVATAR = {
117
- url: string;
118
- name: string;
119
- };
120
- export interface API_USER_MAIN {
121
- UUID: string;
122
- xuid: number;
123
- username: string;
124
- username_cc: string;
125
- rank: RANK;
126
- first_played: number;
127
- daily_login_streak: number;
128
- longest_daily_login_streak: number;
129
- hub_title_count: number;
130
- hub_title_unlocked: string[];
131
- costume_count: number;
132
- costume_unlocked: string[];
133
- avatar_count: number;
134
- avatar_unlocked: AVATAR[];
135
- friend_count: number;
136
- equipped_hub_title: string | null;
137
- equipped_costume: string | null;
138
- equipped_avatar: AVATAR | null;
139
- quest_count: number;
140
- paid_ranks: RANK[];
141
- pets: string[];
142
- mounts: string[];
143
- hats: string[];
144
- }
145
- export interface API_GAME_HIDE {
146
- deaths: number;
147
- hider_kills: number;
148
- seeker_kills: number;
149
- }
150
- export interface API_GAME_DR {
151
- deaths: number;
152
- checkpoints: number;
153
- activated: number;
154
- kills: number;
155
- }
156
- export interface API_GAME_WARS {
157
- final_kills: number;
158
- kills: number;
159
- treasure_destroyed: number;
160
- deaths: number;
161
- prestige: number;
162
- }
163
- export interface API_GAME_MURDER {
164
- deaths: number;
165
- coins: number;
166
- murders: number;
167
- murderer_eliminations: number;
168
- prestige: number;
169
- }
170
- export interface API_GAME_SG {
171
- crates: number;
172
- deathmatches: number;
173
- cows: number;
174
- kills: number;
175
- deaths: number;
176
- }
177
- export interface API_GAME_SKY {
178
- kills: number;
179
- mystery_chests_destroyed: number;
180
- ores_mined: number;
181
- spells_used: number;
182
- deaths: number;
183
- }
184
- export interface API_GAME_CTF {
185
- assists: number;
186
- deaths: number;
187
- flags_captured: number;
188
- kills: number;
189
- flags_returned: number;
190
- }
191
- export interface API_GAME_DROP {
192
- blocks_destroyed: number;
193
- powerups_collected: number;
194
- vaults_used: number;
195
- deaths: number;
196
- }
197
- export interface API_GAME_GROUND {
198
- blocks_destroyed: number;
199
- blocks_placed: number;
200
- deaths: number;
201
- projectiles_fired: number;
202
- kills: number;
203
- }
204
- export interface API_GAME_BUILD {
205
- rating_good_received: number;
206
- rating_love_received: number;
207
- rating_meh_received: number;
208
- rating_okay_received: number;
209
- rating_great_received: number;
210
- }
211
- export interface API_GAME_PARTY {
212
- powerups_collected: number;
213
- rounds_survived: number;
214
- }
215
- export interface API_GAME_BRIDGE {
216
- deaths: number;
217
- goals: number;
218
- kills: number;
219
- }
220
- export interface API_GAME_GRAV {
221
- deaths: number;
222
- maps_completed: number;
223
- maps_completed_without_dying: number;
224
- }
package/lib/types/API.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RANK = exports.MAP_VARIANT = exports.MAP_SEASON = void 0;
4
- var GAME_INFO_1 = require("./GAME_INFO");
5
- var MAP_SEASON;
6
- (function (MAP_SEASON) {
7
- MAP_SEASON["None"] = "NO_SEASON";
8
- MAP_SEASON["Winter"] = "WINTERFEST";
9
- MAP_SEASON["Spring"] = "SPRING";
10
- MAP_SEASON["Summer"] = "SUMMER";
11
- MAP_SEASON["Halloween"] = "HALLOWEEN";
12
- MAP_SEASON["Autumn"] = "AUTUMN";
13
- })(MAP_SEASON || (exports.MAP_SEASON = MAP_SEASON = {}));
14
- var MAP_VARIANT;
15
- (function (MAP_VARIANT) {
16
- MAP_VARIANT["Regular"] = "REGULAR";
17
- MAP_VARIANT["Duos"] = "DUOS";
18
- MAP_VARIANT["Trios"] = "TRIOS";
19
- MAP_VARIANT["Squads"] = "SQUADS";
20
- MAP_VARIANT["Mega"] = "MEGA";
21
- MAP_VARIANT["Royale"] = "ROYALE";
22
- })(MAP_VARIANT || (exports.MAP_VARIANT = MAP_VARIANT = {}));
23
- var RANK;
24
- (function (RANK) {
25
- RANK["Regular"] = "REGULAR";
26
- RANK["Plus"] = "PLUS";
27
- RANK["Youtuber"] = "YOUTUBER";
28
- RANK["Streamer"] = "STREAMER";
29
- RANK["Tiktok"] = "TIKTOK";
30
- RANK["VIP"] = "VIP";
31
- RANK["Helper"] = "HELPER";
32
- RANK["Moderator"] = "MODERATOR";
33
- RANK["Hive"] = "HIVE_TEAM";
34
- RANK["StaffManager"] = "STAFF_MANAGER";
35
- RANK["CommunityManager"] = "COMMUNITY_MANAGER";
36
- RANK["Owner"] = "OWNER";
37
- })(RANK || (exports.RANK = RANK = {}));
@@ -1,11 +0,0 @@
1
- import { GAME } from "./GAME_INFO";
2
- export type PLAYER_ALLTIME_ENDPOINT<G extends GAME | "all" | "main", ID extends string> = `/game/all/${G}/${ID}`;
3
- export type PLAYER_MONTHLY_ENDPOINT<G extends GAME | "all", ID extends string> = `/game/monthly/player/${G}/${ID}`;
4
- export type GAME_LB_ALLTIME_ENDPOINT<G extends GAME> = `/game/all/${G}`;
5
- export type GAME_LB_MONTHLY_ENDPOINT<G extends GAME> = `/game/monthly/${G}`;
6
- export type PLAYER_LB_SPECIFIC_MONTHLY_ENDPOINT<G extends GAME, ID extends string, Y extends number, M extends number, A extends number, S extends number> = `/game/monthly/player/${G}/${ID}/${Y}/${M}/${A}/${S}`;
7
- export type GAME_LB_SPECIFIC_MONTHLY_ENDPOINT<G extends GAME, Y extends number, M extends number, A extends number, S extends number> = `/game/monthly/${G}/${Y}/${M}/${A}/${S}`;
8
- export type GLOBAL_STATISTICS_ENDPOINT = `/global/statistics`;
9
- export type GAME_MAPS_ENDPOINT<G extends GAME> = `/game/map/${G}`;
10
- export type GAME_METADATA_ENDPOINT<G extends GAME> = `/game/meta/${G}`;
11
- export type ENDPOINTS<G extends GAME> = PLAYER_ALLTIME_ENDPOINT<"all", string> | PLAYER_ALLTIME_ENDPOINT<G, string> | PLAYER_MONTHLY_ENDPOINT<"all", string> | PLAYER_MONTHLY_ENDPOINT<G, string> | GAME_LB_ALLTIME_ENDPOINT<G> | GAME_LB_MONTHLY_ENDPOINT<G> | PLAYER_LB_SPECIFIC_MONTHLY_ENDPOINT<G, string, number, number, number, number> | GAME_LB_SPECIFIC_MONTHLY_ENDPOINT<GAME, number, number, number, number> | GLOBAL_STATISTICS_ENDPOINT | GAME_MAPS_ENDPOINT<G> | GAME_METADATA_ENDPOINT<G>;
@@ -1,85 +0,0 @@
1
- import { API_BASE_GAME_ALL, API_BASE_GAME_MONTHLY, API_BASE_LB, API_GAME_BRIDGE, API_GAME_BUILD, API_GAME_CTF, API_GAME_DR, API_GAME_DROP, API_GAME_GRAV, API_GAME_GROUND, API_GAME_HIDE, API_GAME_MURDER, API_GAME_PARTY, API_GAME_SG, API_GAME_SKY, API_GAME_WARS, API_USER_MAIN } from "./API";
2
- import { GAME } from "./GAME_INFO";
3
- export type REQUEST_ALL = {
4
- [G in GAME]: GAME_STATS_ALL<G>;
5
- } & {
6
- main: USER_MAIN;
7
- };
8
- export type REQUEST_MONTHLY = {
9
- [G in GAME]: GAME_STATS_MONTHLY<G>;
10
- };
11
- export type REQUEST_LB<G extends GAME> = LB_STATS<G>[];
12
- export type GAME_STATS<M extends BASE_GAME_ALL | BASE_GAME_MONTHLY | BASE_LB> = {
13
- [GAME.HideAndSeek]: M & GAME_HIDE;
14
- [GAME.DeathRun]: M & GAME_DR;
15
- [GAME.TreasureWars]: M & GAME_WARS;
16
- [GAME.MurderMystery]: M & GAME_MURDER;
17
- [GAME.SurvivalGames]: M & GAME_SG;
18
- [GAME.Skywars]: M & GAME_SKY;
19
- [GAME.CaptureTheFlag]: M & GAME_CTF;
20
- [GAME.BlockDrop]: M & GAME_DROP;
21
- [GAME.GroundWars]: M & GAME_GROUND;
22
- [GAME.JustBuild]: M & GAME_BUILD;
23
- [GAME.BlockParty]: M & GAME_PARTY;
24
- [GAME.TheBridge]: M & GAME_BRIDGE;
25
- [GAME.Gravity]: M & GAME_GRAV;
26
- };
27
- export type LB_STATS<G extends GAME> = GAME_STATS<BASE_LB>[G];
28
- export type GAME_STATS_ALL<G extends GAME> = GAME_STATS<BASE_GAME_ALL>[G];
29
- export type GAME_STATS_MONTHLY<G extends GAME> = GAME_STATS<BASE_GAME_MONTHLY>[G];
30
- export interface BASE_LB extends API_BASE_LB {
31
- id: GAME;
32
- level: number;
33
- losses: number;
34
- win_percentage: number;
35
- }
36
- export interface BASE_GAME_ALL extends Omit<API_BASE_GAME_ALL, "first_played"> {
37
- id: GAME;
38
- level: number;
39
- losses: number;
40
- first_played: number;
41
- win_percentage: number;
42
- }
43
- export interface BASE_GAME_MONTHLY extends API_BASE_GAME_MONTHLY {
44
- id: GAME;
45
- level: number;
46
- losses: number;
47
- win_percentage: number;
48
- }
49
- export interface USER_MAIN extends Omit<API_USER_MAIN, "first_played"> {
50
- first_played: number;
51
- }
52
- export interface GAME_HIDE extends API_GAME_HIDE {
53
- }
54
- export interface GAME_DR extends API_GAME_DR {
55
- kdr: number;
56
- }
57
- export interface GAME_WARS extends API_GAME_WARS {
58
- kdr: number;
59
- }
60
- export interface GAME_MURDER extends API_GAME_MURDER {
61
- kdr: number;
62
- }
63
- export interface GAME_SG extends API_GAME_SG {
64
- kdr: number;
65
- }
66
- export interface GAME_SKY extends API_GAME_SKY {
67
- kdr: number;
68
- }
69
- export interface GAME_CTF extends API_GAME_CTF {
70
- kdr: number;
71
- }
72
- export interface GAME_DROP extends API_GAME_DROP {
73
- }
74
- export interface GAME_GROUND extends API_GAME_GROUND {
75
- kdr: number;
76
- }
77
- export interface GAME_BUILD extends API_GAME_BUILD {
78
- }
79
- export interface GAME_PARTY extends API_GAME_PARTY {
80
- }
81
- export interface GAME_BRIDGE extends API_GAME_BRIDGE {
82
- kdr: number;
83
- }
84
- export interface GAME_GRAV extends API_GAME_GRAV {
85
- }
@@ -1,26 +0,0 @@
1
- export declare enum GAME {
2
- HideAndSeek = "hide",
3
- DeathRun = "dr",
4
- TreasureWars = "wars",
5
- MurderMystery = "murder",
6
- SurvivalGames = "sg",
7
- Skywars = "sky",
8
- CaptureTheFlag = "ctf",
9
- BlockDrop = "drop",
10
- GroundWars = "ground",
11
- JustBuild = "build",
12
- BlockParty = "party",
13
- TheBridge = "bridge",
14
- Gravity = "grav"
15
- }
16
- interface GAME_INFO_TYPE {
17
- id: string;
18
- maxLevel: number;
19
- increment: number;
20
- incrementCap: number | null;
21
- prestige: boolean;
22
- }
23
- export declare const GAME_INFO: {
24
- [key in GAME]: GAME_INFO_TYPE;
25
- };
26
- export {};