hive-bedrock-api 2.0.4 → 2.1.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 (72) hide show
  1. package/README.md +18 -0
  2. package/lib/helpers/fetchEndpoint.js +1 -1
  3. package/lib/helpers/isGame.js +1 -1
  4. package/lib/helpers/toPoint.js +3 -1
  5. package/lib/index.d.ts +5 -3
  6. package/lib/index.js +20 -1
  7. package/lib/methods/getAllTimeLeaderboard.d.ts +3 -3
  8. package/lib/methods/getAllTimeLeaderboard.js +6 -8
  9. package/lib/methods/getAllTimeStatistics.d.ts +6 -5
  10. package/lib/methods/getAllTimeStatistics.js +23 -88
  11. package/lib/methods/getGlobalStatistics.js +1 -1
  12. package/lib/methods/getMaps.js +1 -1
  13. package/lib/methods/getMetadata.js +1 -1
  14. package/lib/methods/getMonthlyLeaderboard.d.ts +3 -3
  15. package/lib/methods/getMonthlyLeaderboard.js +7 -9
  16. package/lib/methods/getMonthlyStatistics.d.ts +4 -4
  17. package/lib/methods/getMonthlyStatistics.js +24 -50
  18. package/lib/methods/getPlayerInfomation.d.ts +2 -2
  19. package/lib/methods/getPlayerInfomation.js +5 -6
  20. package/lib/methods/getSeasonLeaderboard.d.ts +10 -0
  21. package/lib/methods/getSeasonLeaderboard.js +87 -0
  22. package/lib/methods/getSeasonStatistics.d.ts +10 -0
  23. package/lib/methods/getSeasonStatistics.js +87 -0
  24. package/lib/processors/bed.d.ts +19 -0
  25. package/lib/processors/bed.js +35 -0
  26. package/lib/processors/bridge.d.ts +24 -0
  27. package/lib/processors/bridge.js +40 -0
  28. package/lib/processors/build.d.ts +19 -0
  29. package/lib/processors/build.js +35 -0
  30. package/lib/processors/ctf.d.ts +19 -0
  31. package/lib/processors/ctf.js +35 -0
  32. package/lib/processors/dr.d.ts +19 -0
  33. package/lib/processors/dr.js +35 -0
  34. package/lib/processors/drop.d.ts +17 -0
  35. package/lib/processors/drop.js +34 -0
  36. package/lib/processors/grav.d.ts +17 -0
  37. package/lib/processors/grav.js +34 -0
  38. package/lib/processors/ground.d.ts +19 -0
  39. package/lib/processors/ground.js +35 -0
  40. package/lib/processors/helpers/processBuildRatings.d.ts +8 -0
  41. package/lib/processors/helpers/processBuildRatings.js +23 -0
  42. package/lib/processors/helpers/processGameAndXP.d.ts +6 -0
  43. package/lib/processors/helpers/processGameAndXP.js +10 -0
  44. package/lib/processors/helpers/processHiderKillsAndDeaths.d.ts +5 -0
  45. package/lib/processors/helpers/processHiderKillsAndDeaths.js +13 -0
  46. package/lib/processors/helpers/processKillsAndDeaths.d.ts +5 -0
  47. package/lib/processors/helpers/processKillsAndDeaths.js +13 -0
  48. package/lib/processors/helpers/processMurdersAndDeaths.d.ts +5 -0
  49. package/lib/processors/helpers/processMurdersAndDeaths.js +13 -0
  50. package/lib/processors/helpers/processPlayedAndVictories.d.ts +6 -0
  51. package/lib/processors/helpers/processPlayedAndVictories.js +12 -0
  52. package/lib/processors/hide.d.ts +19 -0
  53. package/lib/processors/hide.js +35 -0
  54. package/lib/processors/index.d.ts +11 -6
  55. package/lib/processors/index.js +70 -136
  56. package/lib/processors/murder.d.ts +19 -0
  57. package/lib/processors/murder.js +35 -0
  58. package/lib/processors/parkour.d.ts +5 -0
  59. package/lib/processors/parkour.js +99 -0
  60. package/lib/processors/party.d.ts +17 -0
  61. package/lib/processors/party.js +34 -0
  62. package/lib/processors/player.d.ts +9 -0
  63. package/lib/processors/player.js +36 -0
  64. package/lib/processors/sg.d.ts +19 -0
  65. package/lib/processors/sg.js +35 -0
  66. package/lib/processors/sky.d.ts +19 -0
  67. package/lib/processors/sky.js +35 -0
  68. package/lib/processors/wars.d.ts +19 -0
  69. package/lib/processors/wars.js +35 -0
  70. package/lib/types/output.d.ts +53 -69
  71. package/lib/types/types.d.ts +2 -0
  72. package/package.json +2 -2
@@ -0,0 +1,87 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.default = getSeasonLeaderboard;
54
+ var fetchEndpoint_1 = __importDefault(require("../helpers/fetchEndpoint"));
55
+ var isGame_1 = __importDefault(require("../helpers/isGame"));
56
+ var processors_1 = require("../processors");
57
+ function getSeasonLeaderboard(game_id, options) {
58
+ return __awaiter(this, void 0, void 0, function () {
59
+ var endpoint, response, response_data, processed_data;
60
+ var _a, _b, _c;
61
+ return __generator(this, function (_d) {
62
+ switch (_d.label) {
63
+ case 0:
64
+ if (!(0, isGame_1.default)(game_id))
65
+ return [2 /*return*/, {
66
+ status: 404,
67
+ error: {
68
+ code: 404,
69
+ message: "Game not found.",
70
+ },
71
+ data: null,
72
+ }];
73
+ endpoint = "/game/season/".concat(game_id, "/").concat((_a = options === null || options === void 0 ? void 0 : options.season) !== null && _a !== void 0 ? _a : 1, "/").concat((_b = options === null || options === void 0 ? void 0 : options.amount) !== null && _b !== void 0 ? _b : 100, "/").concat((_c = options === null || options === void 0 ? void 0 : options.skip) !== null && _c !== void 0 ? _c : 0);
74
+ return [4 /*yield*/, (0, fetchEndpoint_1.default)(endpoint, options === null || options === void 0 ? void 0 : options.init)];
75
+ case 1:
76
+ response = _d.sent();
77
+ if (response.error)
78
+ return [2 /*return*/, response];
79
+ response_data = response.data;
80
+ processed_data = Array.from(response_data).map(function (statistics) {
81
+ return processors_1.LeaderboardProcessors[game_id](statistics);
82
+ });
83
+ return [2 /*return*/, __assign(__assign({}, response), { data: processed_data, error: null })];
84
+ }
85
+ });
86
+ });
87
+ }
@@ -0,0 +1,10 @@
1
+ import { Game } from "hive-bedrock-data";
2
+ import { APIResponse, Options } from "../types/types";
3
+ import { MonthlyProcessedStatistics } from "../types/output";
4
+ interface SeasonOptions extends Options {
5
+ season: number;
6
+ month: number;
7
+ year: number;
8
+ }
9
+ export default function getSeasonStatistics<G extends Game>(identifier: string, game_id: G, options?: SeasonOptions): Promise<APIResponse<MonthlyProcessedStatistics[G]>>;
10
+ export {};
@@ -0,0 +1,87 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.default = getSeasonStatistics;
54
+ var isGame_1 = __importDefault(require("../helpers/isGame"));
55
+ var fetchEndpoint_1 = __importDefault(require("../helpers/fetchEndpoint"));
56
+ var processors_1 = require("../processors");
57
+ function getSeasonStatistics(identifier, game_id, options) {
58
+ return __awaiter(this, void 0, void 0, function () {
59
+ var endpoint, response, response_data, processed_data;
60
+ var _a;
61
+ return __generator(this, function (_b) {
62
+ switch (_b.label) {
63
+ case 0:
64
+ if (!(0, isGame_1.default)(game_id))
65
+ return [2 /*return*/, {
66
+ status: 404,
67
+ error: {
68
+ code: 404,
69
+ message: "Game not found.",
70
+ },
71
+ data: null,
72
+ }];
73
+ endpoint = "/game/season/player/".concat(game_id, "/").concat(identifier, "/").concat((_a = options === null || options === void 0 ? void 0 : options.season) !== null && _a !== void 0 ? _a : 1);
74
+ return [4 /*yield*/, (0, fetchEndpoint_1.default)(endpoint, options === null || options === void 0 ? void 0 : options.init)];
75
+ case 1:
76
+ response = _b.sent();
77
+ if (response.error)
78
+ return [2 /*return*/, response];
79
+ response_data = response.data;
80
+ if (Array.isArray(response_data))
81
+ return [2 /*return*/, __assign(__assign({}, response), { status: 404, data: null, error: { code: 404, message: "Not Found" } })];
82
+ processed_data = processors_1.MonthlyProcessors[game_id](response_data);
83
+ return [2 /*return*/, __assign(__assign({}, response), { data: processed_data, error: null })];
84
+ }
85
+ });
86
+ });
87
+ }
@@ -0,0 +1,19 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_BedWars_AllTimeStatistics extends OmittedSpecialStatistics<Game.BedWars, Timeframe.AllTime> {
4
+ id: Game.BedWars;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ kdr: number;
9
+ first_played: number | null;
10
+ }
11
+ export interface Processed_BedWars_MonthlyStatistics extends Statistics<Game.BedWars, Timeframe.Monthly> {
12
+ id: Game.BedWars;
13
+ level: number;
14
+ losses: number;
15
+ win_percentage: number;
16
+ kdr: number;
17
+ }
18
+ export declare function processAllTime_BED(statistics: Partial<Statistics<Game.BedWars, Timeframe.AllTime>>): Processed_BedWars_AllTimeStatistics | null;
19
+ export declare function processMonthly_BED(statistics: Partial<Statistics<Game.BedWars, Timeframe.Monthly>>): Processed_BedWars_MonthlyStatistics | null;
@@ -0,0 +1,35 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_BED = processAllTime_BED;
18
+ exports.processMonthly_BED = processMonthly_BED;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processKillsAndDeaths_1 = __importDefault(require("./helpers/processKillsAndDeaths"));
21
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
22
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
23
+ function processAllTime_BED(statistics) {
24
+ var _a, _b, _c;
25
+ if (!statistics || Array.isArray(statistics))
26
+ return null;
27
+ return __assign(__assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.BedWars, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { final_kills: (_a = statistics.final_kills) !== null && _a !== void 0 ? _a : 0, beds_destroyed: (_b = statistics.beds_destroyed) !== null && _b !== void 0 ? _b : 0, first_played: (_c = statistics.first_played) !== null && _c !== void 0 ? _c : null });
28
+ }
29
+ function processMonthly_BED(statistics) {
30
+ var _a, _b, _c, _d;
31
+ if (!statistics || Array.isArray(statistics))
32
+ return null;
33
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
34
+ return __assign(__assign(__assign(__assign({ index: (_b = statistics.index) !== null && _b !== void 0 ? _b : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.BedWars, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { final_kills: (_c = statistics.final_kills) !== null && _c !== void 0 ? _c : 0, beds_destroyed: (_d = statistics.beds_destroyed) !== null && _d !== void 0 ? _d : 0 });
35
+ }
@@ -0,0 +1,24 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_TheBridge_AllTimeStatistics extends OmittedSpecialStatistics<Game.TheBridge, Timeframe.AllTime> {
4
+ id: Game.TheBridge;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ kdr: number;
9
+ first_played: number | null;
10
+ }
11
+ export interface Processed_TheBridge_MonthlyStatistics extends Omit<Statistics<Game.TheBridge, Timeframe.Monthly>, "m_solo_played" | "m_solo_victories" | "m_solo_kills" | "m_solo_deaths" | "m_solo_goals"> {
12
+ id: Game.TheBridge;
13
+ level: number;
14
+ played: number;
15
+ victories: number;
16
+ losses: number;
17
+ win_percentage: number;
18
+ kills: number;
19
+ deaths: number;
20
+ kdr: number;
21
+ goals: number;
22
+ }
23
+ export declare function processAllTime_BRIDGE(statistics: Partial<Statistics<Game.TheBridge, Timeframe.AllTime>>): Processed_TheBridge_AllTimeStatistics | null;
24
+ export declare function processMonthly_BRIDGE(statistics: Partial<Statistics<Game.TheBridge, Timeframe.Monthly>>): Processed_TheBridge_MonthlyStatistics | null;
@@ -0,0 +1,40 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_BRIDGE = processAllTime_BRIDGE;
18
+ exports.processMonthly_BRIDGE = processMonthly_BRIDGE;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
21
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
22
+ var processKillsAndDeaths_1 = __importDefault(require("./helpers/processKillsAndDeaths"));
23
+ function processAllTime_BRIDGE(statistics) {
24
+ var _a, _b;
25
+ if (!statistics || Array.isArray(statistics))
26
+ return null;
27
+ return __assign(__assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.TheBridge, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { goals: (_a = statistics.goals) !== null && _a !== void 0 ? _a : 0, first_played: (_b = statistics.first_played) !== null && _b !== void 0 ? _b : null });
28
+ }
29
+ function processMonthly_BRIDGE(statistics) {
30
+ var _a, _b, _c, _d, _e, _f, _g;
31
+ if (!statistics || Array.isArray(statistics))
32
+ return null;
33
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
34
+ var played = (_b = statistics.played) !== null && _b !== void 0 ? _b : statistics.m_solo_played;
35
+ var victories = (_c = statistics.victories) !== null && _c !== void 0 ? _c : statistics.m_solo_victories;
36
+ var kills = (_d = statistics.kills) !== null && _d !== void 0 ? _d : statistics.m_solo_kills;
37
+ var deaths = (_e = statistics.deaths) !== null && _e !== void 0 ? _e : statistics.m_solo_deaths;
38
+ var goals = (_f = statistics.goals) !== null && _f !== void 0 ? _f : statistics.m_solo_goals;
39
+ return __assign(__assign(__assign(__assign({ index: (_g = statistics.index) !== null && _g !== void 0 ? _g : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.TheBridge, statistics.xp)), (0, processPlayedAndVictories_1.default)(played, victories)), (0, processKillsAndDeaths_1.default)(kills, deaths)), { goals: goals !== null && goals !== void 0 ? goals : 0 });
40
+ }
@@ -0,0 +1,19 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_JustBuild_AllTimeStatistics extends OmittedSpecialStatistics<Game.JustBuild, Timeframe.AllTime> {
4
+ id: Game.JustBuild;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ total_ratings: number;
9
+ first_played: number | null;
10
+ }
11
+ export interface Processed_JustBuild_MonthlyStatistics extends Statistics<Game.JustBuild, Timeframe.Monthly> {
12
+ id: Game.JustBuild;
13
+ level: number;
14
+ total_ratings: number;
15
+ losses: number;
16
+ win_percentage: number;
17
+ }
18
+ export declare function processAllTime_BUILD(statistics: Partial<Statistics<Game.JustBuild, Timeframe.AllTime>>): Processed_JustBuild_AllTimeStatistics | null;
19
+ export declare function processMonthly_BUILD(statistics: Partial<Statistics<Game.JustBuild, Timeframe.Monthly>>): Processed_JustBuild_MonthlyStatistics | null;
@@ -0,0 +1,35 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_BUILD = processAllTime_BUILD;
18
+ exports.processMonthly_BUILD = processMonthly_BUILD;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
21
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
22
+ var processBuildRatings_1 = __importDefault(require("./helpers/processBuildRatings"));
23
+ function processAllTime_BUILD(statistics) {
24
+ var _a;
25
+ if (!statistics || Array.isArray(statistics))
26
+ return null;
27
+ return __assign(__assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.JustBuild, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processBuildRatings_1.default)(statistics.rating_love_received, statistics.rating_great_received, statistics.rating_good_received, statistics.rating_okay_received, statistics.rating_meh_received)), { first_played: (_a = statistics.first_played) !== null && _a !== void 0 ? _a : null });
28
+ }
29
+ function processMonthly_BUILD(statistics) {
30
+ var _a, _b;
31
+ if (!statistics || Array.isArray(statistics))
32
+ return null;
33
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
34
+ return __assign(__assign(__assign({ index: (_b = statistics.index) !== null && _b !== void 0 ? _b : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.JustBuild, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processBuildRatings_1.default)(statistics.rating_love_received, statistics.rating_great_received, statistics.rating_good_received, statistics.rating_okay_received, statistics.rating_meh_received));
35
+ }
@@ -0,0 +1,19 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_CaptureTheFlag_AllTimeStatistics extends OmittedSpecialStatistics<Game.CaptureTheFlag, Timeframe.AllTime> {
4
+ id: Game.CaptureTheFlag;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ kdr: number;
9
+ first_played: number | null;
10
+ }
11
+ export interface Processed_CaptureTheFlag_MonthlyStatistics extends Statistics<Game.CaptureTheFlag, Timeframe.Monthly> {
12
+ id: Game.CaptureTheFlag;
13
+ level: number;
14
+ losses: number;
15
+ win_percentage: number;
16
+ kdr: number;
17
+ }
18
+ export declare function processAllTime_CTF(statistics: Partial<Statistics<Game.CaptureTheFlag, Timeframe.AllTime>>): Processed_CaptureTheFlag_AllTimeStatistics | null;
19
+ export declare function processMonthly_CTF(statistics: Partial<Statistics<Game.CaptureTheFlag, Timeframe.Monthly>>): Processed_CaptureTheFlag_MonthlyStatistics | null;
@@ -0,0 +1,35 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_CTF = processAllTime_CTF;
18
+ exports.processMonthly_CTF = processMonthly_CTF;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
21
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
22
+ var processKillsAndDeaths_1 = __importDefault(require("./helpers/processKillsAndDeaths"));
23
+ function processAllTime_CTF(statistics) {
24
+ var _a, _b, _c, _d;
25
+ if (!statistics || Array.isArray(statistics))
26
+ return null;
27
+ return __assign(__assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.CaptureTheFlag, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { assists: (_a = statistics.assists) !== null && _a !== void 0 ? _a : 0, flags_captured: (_b = statistics.flags_captured) !== null && _b !== void 0 ? _b : 0, flags_returned: (_c = statistics.flags_returned) !== null && _c !== void 0 ? _c : 0, first_played: (_d = statistics.first_played) !== null && _d !== void 0 ? _d : null });
28
+ }
29
+ function processMonthly_CTF(statistics) {
30
+ var _a, _b, _c, _d, _e;
31
+ if (!statistics || Array.isArray(statistics))
32
+ return null;
33
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
34
+ return __assign(__assign(__assign(__assign({ index: (_b = statistics.index) !== null && _b !== void 0 ? _b : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.CaptureTheFlag, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { assists: (_c = statistics.assists) !== null && _c !== void 0 ? _c : 0, flags_captured: (_d = statistics.flags_captured) !== null && _d !== void 0 ? _d : 0, flags_returned: (_e = statistics.flags_returned) !== null && _e !== void 0 ? _e : 0 });
35
+ }
@@ -0,0 +1,19 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_DeathRun_AllTimeStatistics extends OmittedSpecialStatistics<Game.DeathRun, Timeframe.AllTime> {
4
+ id: Game.DeathRun;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ kdr: number;
9
+ first_played: number | null;
10
+ }
11
+ export interface Processed_DeathRun_MonthlyStatistics extends Statistics<Game.DeathRun, Timeframe.Monthly> {
12
+ id: Game.DeathRun;
13
+ level: number;
14
+ losses: number;
15
+ win_percentage: number;
16
+ kdr: number;
17
+ }
18
+ export declare function processAllTime_DR(statistics: Partial<Statistics<Game.DeathRun, Timeframe.AllTime>>): Processed_DeathRun_AllTimeStatistics | null;
19
+ export declare function processMonthly_DR(statistics: Partial<Statistics<Game.DeathRun, Timeframe.Monthly>>): Processed_DeathRun_MonthlyStatistics | null;
@@ -0,0 +1,35 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_DR = processAllTime_DR;
18
+ exports.processMonthly_DR = processMonthly_DR;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
21
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
22
+ var processKillsAndDeaths_1 = __importDefault(require("./helpers/processKillsAndDeaths"));
23
+ function processAllTime_DR(statistics) {
24
+ var _a, _b, _c;
25
+ if (!statistics || Array.isArray(statistics))
26
+ return null;
27
+ return __assign(__assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.DeathRun, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { activated: (_a = statistics.activated) !== null && _a !== void 0 ? _a : 0, checkpoints: (_b = statistics.checkpoints) !== null && _b !== void 0 ? _b : 0, first_played: (_c = statistics.first_played) !== null && _c !== void 0 ? _c : null });
28
+ }
29
+ function processMonthly_DR(statistics) {
30
+ var _a, _b, _c, _d;
31
+ if (!statistics || Array.isArray(statistics))
32
+ return null;
33
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
34
+ return __assign(__assign(__assign(__assign({ index: (_b = statistics.index) !== null && _b !== void 0 ? _b : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.DeathRun, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { activated: (_c = statistics.activated) !== null && _c !== void 0 ? _c : 0, checkpoints: (_d = statistics.checkpoints) !== null && _d !== void 0 ? _d : 0 });
35
+ }
@@ -0,0 +1,17 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_BlockDrop_AllTimeStatistics extends OmittedSpecialStatistics<Game.BlockDrop, Timeframe.AllTime> {
4
+ id: Game.BlockDrop;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ first_played: number | null;
9
+ }
10
+ export interface Processed_BlockDrop_MonthlyStatistics extends Statistics<Game.BlockDrop, Timeframe.Monthly> {
11
+ id: Game.BlockDrop;
12
+ level: number;
13
+ losses: number;
14
+ win_percentage: number;
15
+ }
16
+ export declare function processAllTime_DROP(statistics: Partial<Statistics<Game.BlockDrop, Timeframe.AllTime>>): Processed_BlockDrop_AllTimeStatistics | null;
17
+ export declare function processMonthly_DROP(statistics: Partial<Statistics<Game.BlockDrop, Timeframe.Monthly>>): Processed_BlockDrop_MonthlyStatistics | null;
@@ -0,0 +1,34 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_DROP = processAllTime_DROP;
18
+ exports.processMonthly_DROP = processMonthly_DROP;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
21
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
22
+ function processAllTime_DROP(statistics) {
23
+ var _a, _b, _c, _d, _e;
24
+ if (!statistics || Array.isArray(statistics))
25
+ return null;
26
+ return __assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.BlockDrop, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), { deaths: (_a = statistics.deaths) !== null && _a !== void 0 ? _a : 0, blocks_destroyed: (_b = statistics.blocks_destroyed) !== null && _b !== void 0 ? _b : 0, powerups_collected: (_c = statistics.powerups_collected) !== null && _c !== void 0 ? _c : 0, vaults_used: (_d = statistics.vaults_used) !== null && _d !== void 0 ? _d : 0, first_played: (_e = statistics.first_played) !== null && _e !== void 0 ? _e : null });
27
+ }
28
+ function processMonthly_DROP(statistics) {
29
+ var _a, _b, _c, _d, _e, _f;
30
+ if (!statistics || Array.isArray(statistics))
31
+ return null;
32
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
33
+ return __assign(__assign(__assign({ index: (_b = statistics.index) !== null && _b !== void 0 ? _b : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.BlockDrop, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), { deaths: (_c = statistics.deaths) !== null && _c !== void 0 ? _c : 0, blocks_destroyed: (_d = statistics.blocks_destroyed) !== null && _d !== void 0 ? _d : 0, powerups_collected: (_e = statistics.powerups_collected) !== null && _e !== void 0 ? _e : 0, vaults_used: (_f = statistics.vaults_used) !== null && _f !== void 0 ? _f : 0 });
34
+ }
@@ -0,0 +1,17 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_Gravity_AllTimeStatistics extends OmittedSpecialStatistics<Game.Gravity, Timeframe.AllTime> {
4
+ id: Game.Gravity;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ first_played: number | null;
9
+ }
10
+ export interface Processed_Gravity_MonthlyStatistics extends Statistics<Game.Gravity, Timeframe.Monthly> {
11
+ id: Game.Gravity;
12
+ level: number;
13
+ losses: number;
14
+ win_percentage: number;
15
+ }
16
+ export declare function processAllTime_GRAV(statistics: Partial<Statistics<Game.Gravity, Timeframe.AllTime>>): Processed_Gravity_AllTimeStatistics | null;
17
+ export declare function processMonthly_GRAV(statistics: Partial<Statistics<Game.Gravity, Timeframe.Monthly>>): Processed_Gravity_MonthlyStatistics | null;
@@ -0,0 +1,34 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.processAllTime_GRAV = processAllTime_GRAV;
18
+ exports.processMonthly_GRAV = processMonthly_GRAV;
19
+ var hive_bedrock_data_1 = require("hive-bedrock-data");
20
+ var processGameAndXP_1 = __importDefault(require("./helpers/processGameAndXP"));
21
+ var processPlayedAndVictories_1 = __importDefault(require("./helpers/processPlayedAndVictories"));
22
+ function processAllTime_GRAV(statistics) {
23
+ var _a, _b, _c, _d;
24
+ if (!statistics || Array.isArray(statistics))
25
+ return null;
26
+ return __assign(__assign(__assign({ UUID: statistics.UUID }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.Gravity, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), { deaths: (_a = statistics.deaths) !== null && _a !== void 0 ? _a : 0, maps_completed: (_b = statistics.maps_completed) !== null && _b !== void 0 ? _b : 0, maps_completed_without_dying: (_c = statistics.maps_completed_without_dying) !== null && _c !== void 0 ? _c : 0, first_played: (_d = statistics.first_played) !== null && _d !== void 0 ? _d : null });
27
+ }
28
+ function processMonthly_GRAV(statistics) {
29
+ var _a, _b, _c, _d, _e;
30
+ if (!statistics || Array.isArray(statistics))
31
+ return null;
32
+ var index = (_a = statistics.index) !== null && _a !== void 0 ? _a : 0;
33
+ return __assign(__assign(__assign({ index: (_b = statistics.index) !== null && _b !== void 0 ? _b : 0, human_index: index + 1, username: statistics.username }, (0, processGameAndXP_1.default)(hive_bedrock_data_1.Game.Gravity, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), { deaths: (_c = statistics.deaths) !== null && _c !== void 0 ? _c : 0, maps_completed: (_d = statistics.maps_completed) !== null && _d !== void 0 ? _d : 0, maps_completed_without_dying: (_e = statistics.maps_completed_without_dying) !== null && _e !== void 0 ? _e : 0 });
34
+ }
@@ -0,0 +1,19 @@
1
+ import { Game, Statistics, Timeframe } from "hive-bedrock-data";
2
+ import { OmittedSpecialStatistics } from "../types/types";
3
+ export interface Processed_GroundWars_AllTimeStatistics extends OmittedSpecialStatistics<Game.GroundWars, Timeframe.AllTime> {
4
+ id: Game.GroundWars;
5
+ level: number;
6
+ losses: number;
7
+ win_percentage: number;
8
+ kdr: number;
9
+ first_played: number | null;
10
+ }
11
+ export interface Processed_GroundWars_MonthlyStatistics extends Statistics<Game.GroundWars, Timeframe.Monthly> {
12
+ id: Game.GroundWars;
13
+ level: number;
14
+ losses: number;
15
+ win_percentage: number;
16
+ kdr: number;
17
+ }
18
+ export declare function processAllTime_GROUND(statistics: Partial<Statistics<Game.GroundWars, Timeframe.AllTime>>): Processed_GroundWars_AllTimeStatistics | null;
19
+ export declare function processMonthly_GROUND(statistics: Partial<Statistics<Game.GroundWars, Timeframe.Monthly>>): Processed_GroundWars_MonthlyStatistics | null;