hive-bedrock-api 3.0.0-alpha.21 → 3.0.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/lib/helpers/fetchEndpoint.d.ts +0 -3
- package/lib/helpers/fetchEndpoint.js +0 -88
- package/lib/helpers/isGame.d.ts +0 -2
- package/lib/helpers/isGame.js +0 -7
- package/lib/helpers/toPoint.d.ts +0 -1
- package/lib/helpers/toPoint.js +0 -10
- package/lib/index.d.ts +0 -101
- package/lib/index.js +0 -404
- package/lib/methods/getAllTimeLeaderboard.d.ts +0 -4
- package/lib/methods/getAllTimeLeaderboard.js +0 -85
- package/lib/methods/getAllTimeStatistics.d.ts +0 -10
- package/lib/methods/getAllTimeStatistics.js +0 -126
- package/lib/methods/getGlobalStatistics.d.ts +0 -3
- package/lib/methods/getGlobalStatistics.js +0 -56
- package/lib/methods/getMaps.d.ts +0 -3
- package/lib/methods/getMaps.js +0 -81
- package/lib/methods/getMetadata.d.ts +0 -3
- package/lib/methods/getMetadata.js +0 -81
- package/lib/methods/getMonthlyLeaderboard.d.ts +0 -11
- package/lib/methods/getMonthlyLeaderboard.js +0 -88
- package/lib/methods/getMonthlyStatistics.d.ts +0 -10
- package/lib/methods/getMonthlyStatistics.js +0 -132
- package/lib/methods/getPlayerInfomation.d.ts +0 -3
- package/lib/methods/getPlayerInfomation.js +0 -72
- package/lib/methods/getSeasonLeaderboard.d.ts +0 -10
- package/lib/methods/getSeasonLeaderboard.js +0 -87
- package/lib/methods/getSeasonStatistics.d.ts +0 -10
- package/lib/methods/getSeasonStatistics.js +0 -87
- package/lib/processors/bed.d.ts +0 -19
- package/lib/processors/bed.js +0 -35
- package/lib/processors/bridge.d.ts +0 -24
- package/lib/processors/bridge.js +0 -40
- package/lib/processors/build.d.ts +0 -19
- package/lib/processors/build.js +0 -35
- package/lib/processors/ctf.d.ts +0 -19
- package/lib/processors/ctf.js +0 -35
- package/lib/processors/dr.d.ts +0 -19
- package/lib/processors/dr.js +0 -35
- package/lib/processors/drop.d.ts +0 -17
- package/lib/processors/drop.js +0 -34
- package/lib/processors/game.d.ts +0 -315
- package/lib/processors/game.js +0 -395
- package/lib/processors/global_statistics.d.ts +0 -9
- package/lib/processors/global_statistics.js +0 -2
- package/lib/processors/grav.d.ts +0 -17
- package/lib/processors/grav.js +0 -34
- package/lib/processors/ground.d.ts +0 -19
- package/lib/processors/ground.js +0 -35
- package/lib/processors/helpers/processBuildRatings.d.ts +0 -8
- package/lib/processors/helpers/processBuildRatings.js +0 -23
- package/lib/processors/helpers/processGameAndXP.d.ts +0 -6
- package/lib/processors/helpers/processGameAndXP.js +0 -10
- package/lib/processors/helpers/processHiderKillsAndDeaths.d.ts +0 -5
- package/lib/processors/helpers/processHiderKillsAndDeaths.js +0 -13
- package/lib/processors/helpers/processKillsAndDeaths.d.ts +0 -5
- package/lib/processors/helpers/processKillsAndDeaths.js +0 -13
- package/lib/processors/helpers/processMurdersAndDeaths.d.ts +0 -5
- package/lib/processors/helpers/processMurdersAndDeaths.js +0 -13
- package/lib/processors/helpers/processPlayedAndVictories.d.ts +0 -6
- package/lib/processors/helpers/processPlayedAndVictories.js +0 -12
- package/lib/processors/hide.d.ts +0 -19
- package/lib/processors/hide.js +0 -35
- package/lib/processors/index.d.ts +0 -12
- package/lib/processors/index.js +0 -73
- package/lib/processors/map.d.ts +0 -8
- package/lib/processors/map.js +0 -2
- package/lib/processors/meta.d.ts +0 -45
- package/lib/processors/meta.js +0 -2
- package/lib/processors/murder.d.ts +0 -19
- package/lib/processors/murder.js +0 -35
- package/lib/processors/parkour.d.ts +0 -5
- package/lib/processors/parkour.js +0 -99
- package/lib/processors/party.d.ts +0 -17
- package/lib/processors/party.js +0 -34
- package/lib/processors/player.d.ts +0 -61
- package/lib/processors/player.js +0 -54
- package/lib/processors/player_search.d.ts +0 -6
- package/lib/processors/player_search.js +0 -11
- package/lib/processors/sg.d.ts +0 -19
- package/lib/processors/sg.js +0 -35
- package/lib/processors/sky.d.ts +0 -19
- package/lib/processors/sky.js +0 -35
- package/lib/processors/wars.d.ts +0 -19
- package/lib/processors/wars.js +0 -35
- package/lib/types/output.d.ts +0 -62
- package/lib/types/output.js +0 -3
- package/lib/types/types.d.ts +0 -24
- package/lib/types/types.js +0 -2
- package/lib/utils.d.ts +0 -21
- package/lib/utils.js +0 -2
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = processPlayedAndVictories;
|
|
4
|
-
function processPlayedAndVictories(played, victories) {
|
|
5
|
-
played !== null && played !== void 0 ? played : (played = 0);
|
|
6
|
-
victories !== null && victories !== void 0 ? victories : (victories = 0);
|
|
7
|
-
var losses = played - victories;
|
|
8
|
-
var win_percentage = victories / played;
|
|
9
|
-
if (isNaN(win_percentage))
|
|
10
|
-
win_percentage = 0;
|
|
11
|
-
return { played: played, victories: victories, losses: losses, win_percentage: win_percentage };
|
|
12
|
-
}
|
package/lib/processors/hide.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Game, Statistics, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
import { OmittedSpecialStatistics } from "../types/types";
|
|
3
|
-
export interface Processed_HideAndSeek_AllTimeStatistics extends OmittedSpecialStatistics<Game.HideAndSeek, Timeframe.AllTime> {
|
|
4
|
-
id: Game.HideAndSeek;
|
|
5
|
-
level: number;
|
|
6
|
-
losses: number;
|
|
7
|
-
win_percentage: number;
|
|
8
|
-
kdr: number;
|
|
9
|
-
first_played: number | null;
|
|
10
|
-
}
|
|
11
|
-
export interface Processed_HideAndSeek_MonthlyStatistics extends Statistics<Game.HideAndSeek, Timeframe.Monthly> {
|
|
12
|
-
id: Game.HideAndSeek;
|
|
13
|
-
level: number;
|
|
14
|
-
losses: number;
|
|
15
|
-
win_percentage: number;
|
|
16
|
-
kdr: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function processAllTime_HIDE(statistics: Partial<Statistics<Game.HideAndSeek, Timeframe.AllTime>>): Processed_HideAndSeek_AllTimeStatistics | null;
|
|
19
|
-
export declare function processMonthly_HIDE(statistics: Partial<Statistics<Game.HideAndSeek, Timeframe.Monthly>>): Processed_HideAndSeek_MonthlyStatistics | null;
|
package/lib/processors/hide.js
DELETED
|
@@ -1,35 +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 __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_HIDE = processAllTime_HIDE;
|
|
18
|
-
exports.processMonthly_HIDE = processMonthly_HIDE;
|
|
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 processHiderKillsAndDeaths_1 = __importDefault(require("./helpers/processHiderKillsAndDeaths"));
|
|
23
|
-
function processAllTime_HIDE(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.HideAndSeek, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processHiderKillsAndDeaths_1.default)(statistics.hider_kills, statistics.deaths)), { seeker_kills: (_a = statistics.seeker_kills) !== null && _a !== void 0 ? _a : 0, first_played: (_b = statistics.first_played) !== null && _b !== void 0 ? _b : null });
|
|
28
|
-
}
|
|
29
|
-
function processMonthly_HIDE(statistics) {
|
|
30
|
-
var _a, _b, _c;
|
|
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.HideAndSeek, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processHiderKillsAndDeaths_1.default)(statistics.hider_kills, statistics.deaths)), { seeker_kills: (_c = statistics.seeker_kills) !== null && _c !== void 0 ? _c : 0 });
|
|
35
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Game, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
import { PlayerProcessorType, Processor } from "../types/output";
|
|
3
|
-
export declare const AllTimeProcessors: {
|
|
4
|
-
[G in Game]: Processor<G, Timeframe.AllTime>;
|
|
5
|
-
};
|
|
6
|
-
export declare const MonthlyProcessors: {
|
|
7
|
-
[G in Game]: G extends Game.ParkourWorlds ? never : Processor<G, Timeframe.Monthly>;
|
|
8
|
-
};
|
|
9
|
-
export declare const LeaderboardProcessors: {
|
|
10
|
-
[G in Game]: G extends Game.ParkourWorlds ? never : Processor<G, Timeframe.Monthly>;
|
|
11
|
-
};
|
|
12
|
-
export declare const PlayerProcessor: PlayerProcessorType;
|
package/lib/processors/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a, _b, _c;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PlayerProcessor = exports.LeaderboardProcessors = exports.MonthlyProcessors = exports.AllTimeProcessors = void 0;
|
|
5
|
-
var hive_bedrock_data_1 = require("hive-bedrock-data");
|
|
6
|
-
var bed_1 = require("./bed");
|
|
7
|
-
var drop_1 = require("./drop");
|
|
8
|
-
var party_1 = require("./party");
|
|
9
|
-
var ctf_1 = require("./ctf");
|
|
10
|
-
var dr_1 = require("./dr");
|
|
11
|
-
var grav_1 = require("./grav");
|
|
12
|
-
var ground_1 = require("./ground");
|
|
13
|
-
var hide_1 = require("./hide");
|
|
14
|
-
var build_1 = require("./build");
|
|
15
|
-
var murder_1 = require("./murder");
|
|
16
|
-
var parkour_1 = require("./parkour");
|
|
17
|
-
var sky_1 = require("./sky");
|
|
18
|
-
var sg_1 = require("./sg");
|
|
19
|
-
var bridge_1 = require("./bridge");
|
|
20
|
-
var wars_1 = require("./wars");
|
|
21
|
-
var player_1 = require("./player");
|
|
22
|
-
exports.AllTimeProcessors = (_a = {},
|
|
23
|
-
_a[hive_bedrock_data_1.Game.BedWars] = bed_1.processAllTime_BED,
|
|
24
|
-
_a[hive_bedrock_data_1.Game.BlockDrop] = drop_1.processAllTime_DROP,
|
|
25
|
-
_a[hive_bedrock_data_1.Game.BlockParty] = party_1.processAllTime_PARTY,
|
|
26
|
-
_a[hive_bedrock_data_1.Game.CaptureTheFlag] = ctf_1.processAllTime_CTF,
|
|
27
|
-
_a[hive_bedrock_data_1.Game.DeathRun] = dr_1.processAllTime_DR,
|
|
28
|
-
_a[hive_bedrock_data_1.Game.Gravity] = grav_1.processAllTime_GRAV,
|
|
29
|
-
_a[hive_bedrock_data_1.Game.GroundWars] = ground_1.processAllTime_GROUND,
|
|
30
|
-
_a[hive_bedrock_data_1.Game.HideAndSeek] = hide_1.processAllTime_HIDE,
|
|
31
|
-
_a[hive_bedrock_data_1.Game.BuildBattle] = build_1.processAllTime_BUILD,
|
|
32
|
-
_a[hive_bedrock_data_1.Game.MurderMystery] = murder_1.processAllTime_MURDER,
|
|
33
|
-
_a[hive_bedrock_data_1.Game.ParkourWorlds] = parkour_1.processAllTime_PARKOUR,
|
|
34
|
-
_a[hive_bedrock_data_1.Game.Skywars] = sky_1.processAllTime_SKY,
|
|
35
|
-
_a[hive_bedrock_data_1.Game.SurvivalGames] = sg_1.processAllTime_SG,
|
|
36
|
-
_a[hive_bedrock_data_1.Game.TheBridge] = bridge_1.processAllTime_BRIDGE,
|
|
37
|
-
_a[hive_bedrock_data_1.Game.TreasureWars] = wars_1.processAllTime_WARS,
|
|
38
|
-
_a);
|
|
39
|
-
exports.MonthlyProcessors = (_b = {},
|
|
40
|
-
_b[hive_bedrock_data_1.Game.BedWars] = bed_1.processMonthly_BED,
|
|
41
|
-
_b[hive_bedrock_data_1.Game.BlockDrop] = drop_1.processMonthly_DROP,
|
|
42
|
-
_b[hive_bedrock_data_1.Game.BlockParty] = party_1.processMonthly_PARTY,
|
|
43
|
-
_b[hive_bedrock_data_1.Game.CaptureTheFlag] = ctf_1.processMonthly_CTF,
|
|
44
|
-
_b[hive_bedrock_data_1.Game.DeathRun] = dr_1.processMonthly_DR,
|
|
45
|
-
_b[hive_bedrock_data_1.Game.Gravity] = grav_1.processMonthly_GRAV,
|
|
46
|
-
_b[hive_bedrock_data_1.Game.GroundWars] = ground_1.processMonthly_GROUND,
|
|
47
|
-
_b[hive_bedrock_data_1.Game.HideAndSeek] = hide_1.processMonthly_HIDE,
|
|
48
|
-
_b[hive_bedrock_data_1.Game.BuildBattle] = build_1.processMonthly_BUILD,
|
|
49
|
-
_b[hive_bedrock_data_1.Game.MurderMystery] = murder_1.processMonthly_MURDER,
|
|
50
|
-
_b[hive_bedrock_data_1.Game.Skywars] = sky_1.processMonthly_SKY,
|
|
51
|
-
_b[hive_bedrock_data_1.Game.SurvivalGames] = sg_1.processMonthly_SG,
|
|
52
|
-
_b[hive_bedrock_data_1.Game.TheBridge] = bridge_1.processMonthly_BRIDGE,
|
|
53
|
-
_b[hive_bedrock_data_1.Game.TreasureWars] = wars_1.processMonthly_WARS,
|
|
54
|
-
_b[hive_bedrock_data_1.Game.ParkourWorlds] = null,
|
|
55
|
-
_b);
|
|
56
|
-
exports.LeaderboardProcessors = (_c = {},
|
|
57
|
-
_c[hive_bedrock_data_1.Game.BedWars] = bed_1.processMonthly_BED,
|
|
58
|
-
_c[hive_bedrock_data_1.Game.BlockDrop] = drop_1.processMonthly_DROP,
|
|
59
|
-
_c[hive_bedrock_data_1.Game.BlockParty] = party_1.processMonthly_PARTY,
|
|
60
|
-
_c[hive_bedrock_data_1.Game.CaptureTheFlag] = ctf_1.processMonthly_CTF,
|
|
61
|
-
_c[hive_bedrock_data_1.Game.DeathRun] = dr_1.processMonthly_DR,
|
|
62
|
-
_c[hive_bedrock_data_1.Game.Gravity] = grav_1.processMonthly_GRAV,
|
|
63
|
-
_c[hive_bedrock_data_1.Game.GroundWars] = ground_1.processMonthly_GROUND,
|
|
64
|
-
_c[hive_bedrock_data_1.Game.HideAndSeek] = hide_1.processMonthly_HIDE,
|
|
65
|
-
_c[hive_bedrock_data_1.Game.BuildBattle] = build_1.processMonthly_BUILD,
|
|
66
|
-
_c[hive_bedrock_data_1.Game.MurderMystery] = murder_1.processMonthly_MURDER,
|
|
67
|
-
_c[hive_bedrock_data_1.Game.Skywars] = sky_1.processMonthly_SKY,
|
|
68
|
-
_c[hive_bedrock_data_1.Game.SurvivalGames] = sg_1.processMonthly_SG,
|
|
69
|
-
_c[hive_bedrock_data_1.Game.TheBridge] = bridge_1.processMonthly_BRIDGE,
|
|
70
|
-
_c[hive_bedrock_data_1.Game.TreasureWars] = wars_1.processMonthly_WARS,
|
|
71
|
-
_c[hive_bedrock_data_1.Game.ParkourWorlds] = null,
|
|
72
|
-
_c);
|
|
73
|
-
exports.PlayerProcessor = player_1.process_PLAYER;
|
package/lib/processors/map.d.ts
DELETED
package/lib/processors/map.js
DELETED
package/lib/processors/meta.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface ProcessedGameMetadata {
|
|
2
|
-
name: string;
|
|
3
|
-
shortName: string;
|
|
4
|
-
maxLevel: number;
|
|
5
|
-
allowPrestiging: boolean;
|
|
6
|
-
maxPrestige: number;
|
|
7
|
-
experienceToLevel: {
|
|
8
|
-
[xp: number]: number;
|
|
9
|
-
};
|
|
10
|
-
levelUnlocks: {
|
|
11
|
-
[level: number]: LevelUnlock[];
|
|
12
|
-
};
|
|
13
|
-
levelUnlockTypes: {
|
|
14
|
-
[type: string]: {
|
|
15
|
-
name: string;
|
|
16
|
-
icon: string | null;
|
|
17
|
-
default: string | null;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export type LevelUnlock = {
|
|
22
|
-
name: string;
|
|
23
|
-
icon: string | null;
|
|
24
|
-
type: string;
|
|
25
|
-
global: false;
|
|
26
|
-
} & ({
|
|
27
|
-
global: false;
|
|
28
|
-
} | {
|
|
29
|
-
global: true;
|
|
30
|
-
globalCosmetic: GlobalUnlock;
|
|
31
|
-
});
|
|
32
|
-
export type GlobalUnlock = GlobalTitleUnlock | GlobalAvatarUnlock | GlobalCostumeUnlock;
|
|
33
|
-
export interface GlobalTitleUnlock {
|
|
34
|
-
type: "hub_title";
|
|
35
|
-
display: string;
|
|
36
|
-
}
|
|
37
|
-
export interface GlobalAvatarUnlock {
|
|
38
|
-
type: "avatar";
|
|
39
|
-
name: string;
|
|
40
|
-
url: string;
|
|
41
|
-
}
|
|
42
|
-
export interface GlobalCostumeUnlock {
|
|
43
|
-
type: "costume";
|
|
44
|
-
name: string;
|
|
45
|
-
}
|
package/lib/processors/meta.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Game, Statistics, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
import { OmittedSpecialStatistics } from "../types/types";
|
|
3
|
-
export interface Processed_MurderMystery_AllTimeStatistics extends OmittedSpecialStatistics<Game.MurderMystery, Timeframe.AllTime> {
|
|
4
|
-
id: Game.MurderMystery;
|
|
5
|
-
level: number;
|
|
6
|
-
losses: number;
|
|
7
|
-
win_percentage: number;
|
|
8
|
-
kdr: number;
|
|
9
|
-
first_played: number | null;
|
|
10
|
-
}
|
|
11
|
-
export interface Processed_MurderMystery_MonthlyStatistics extends Statistics<Game.MurderMystery, Timeframe.Monthly> {
|
|
12
|
-
id: Game.MurderMystery;
|
|
13
|
-
level: number;
|
|
14
|
-
losses: number;
|
|
15
|
-
win_percentage: number;
|
|
16
|
-
kdr: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function processAllTime_MURDER(statistics: Partial<Statistics<Game.MurderMystery, Timeframe.AllTime>>): Processed_MurderMystery_AllTimeStatistics | null;
|
|
19
|
-
export declare function processMonthly_MURDER(statistics: Partial<Statistics<Game.MurderMystery, Timeframe.Monthly>>): Processed_MurderMystery_MonthlyStatistics | null;
|
package/lib/processors/murder.js
DELETED
|
@@ -1,35 +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 __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_MURDER = processAllTime_MURDER;
|
|
18
|
-
exports.processMonthly_MURDER = processMonthly_MURDER;
|
|
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 processMurdersAndDeaths_1 = __importDefault(require("./helpers/processMurdersAndDeaths"));
|
|
23
|
-
function processAllTime_MURDER(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.MurderMystery, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processMurdersAndDeaths_1.default)(statistics.murders, statistics.deaths)), { murderer_eliminations: (_a = statistics.murderer_eliminations) !== null && _a !== void 0 ? _a : 0, coins: (_b = statistics.coins) !== null && _b !== void 0 ? _b : 0, prestige: (_c = statistics.prestige) !== null && _c !== void 0 ? _c : 0, first_played: (_d = statistics.first_played) !== null && _d !== void 0 ? _d : null });
|
|
28
|
-
}
|
|
29
|
-
function processMonthly_MURDER(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.MurderMystery, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processMurdersAndDeaths_1.default)(statistics.murders, statistics.deaths)), { murderer_eliminations: (_c = statistics.murderer_eliminations) !== null && _c !== void 0 ? _c : 0, coins: (_d = statistics.coins) !== null && _d !== void 0 ? _d : 0, prestige: (_e = statistics.prestige) !== null && _e !== void 0 ? _e : 0 });
|
|
35
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Game, Statistics, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
export interface Processed_ParkourWorlds_AllTimeStatistics extends Statistics<Game.ParkourWorlds, Timeframe.AllTime> {
|
|
3
|
-
id: Game.ParkourWorlds;
|
|
4
|
-
}
|
|
5
|
-
export declare function processAllTime_PARKOUR(statistics: Partial<Statistics<Game.ParkourWorlds, Timeframe.AllTime>>): Processed_ParkourWorlds_AllTimeStatistics | null;
|
|
@@ -1,99 +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 __values = (this && this.__values) || function(o) {
|
|
14
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
15
|
-
if (m) return m.call(o);
|
|
16
|
-
if (o && typeof o.length === "number") return {
|
|
17
|
-
next: function () {
|
|
18
|
-
if (o && i >= o.length) o = void 0;
|
|
19
|
-
return { value: o && o[i++], done: !o };
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
23
|
-
};
|
|
24
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
-
if (!m) return o;
|
|
27
|
-
var i = m.call(o), r, ar = [], e;
|
|
28
|
-
try {
|
|
29
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
-
}
|
|
31
|
-
catch (error) { e = { error: error }; }
|
|
32
|
-
finally {
|
|
33
|
-
try {
|
|
34
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
-
}
|
|
36
|
-
finally { if (e) throw e.error; }
|
|
37
|
-
}
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.processAllTime_PARKOUR = processAllTime_PARKOUR;
|
|
42
|
-
var hive_bedrock_data_1 = require("hive-bedrock-data");
|
|
43
|
-
function processParkourWorld(world) {
|
|
44
|
-
var e_1, _a;
|
|
45
|
-
var _b, _c, _d, _e;
|
|
46
|
-
var processedCourses = [];
|
|
47
|
-
try {
|
|
48
|
-
for (var _f = __values(Object.entries(world)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
49
|
-
var _h = __read(_g.value, 2), name_1 = _h[0], course = _h[1];
|
|
50
|
-
if (typeof course !== "object")
|
|
51
|
-
continue;
|
|
52
|
-
var processedCourse = {
|
|
53
|
-
best_run_time: (_b = course.best_run_time) !== null && _b !== void 0 ? _b : 0,
|
|
54
|
-
best_checkpoint_times: (_c = course.best_checkpoint_times) !== null && _c !== void 0 ? _c : [],
|
|
55
|
-
collected_stars: (_d = course.collected_stars) !== null && _d !== void 0 ? _d : [],
|
|
56
|
-
course_stars: (_e = course.course_stars) !== null && _e !== void 0 ? _e : [],
|
|
57
|
-
};
|
|
58
|
-
processedCourses.push([name_1, processedCourse]);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
-
finally {
|
|
63
|
-
try {
|
|
64
|
-
if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
|
|
65
|
-
}
|
|
66
|
-
finally { if (e_1) throw e_1.error; }
|
|
67
|
-
}
|
|
68
|
-
return __assign({ parkour_stars: world.parkour_stars }, Object.fromEntries(processedCourses));
|
|
69
|
-
}
|
|
70
|
-
function processAllTime_PARKOUR(statistics) {
|
|
71
|
-
var e_2, _a;
|
|
72
|
-
var _b, _c, _d;
|
|
73
|
-
if (!statistics || Array.isArray(statistics))
|
|
74
|
-
return null;
|
|
75
|
-
var worlds = Object.entries((_b = statistics.parkours) !== null && _b !== void 0 ? _b : {});
|
|
76
|
-
var processedWorlds = [];
|
|
77
|
-
try {
|
|
78
|
-
for (var worlds_1 = __values(worlds), worlds_1_1 = worlds_1.next(); !worlds_1_1.done; worlds_1_1 = worlds_1.next()) {
|
|
79
|
-
var _e = __read(worlds_1_1.value, 2), worldName = _e[0], world = _e[1];
|
|
80
|
-
if (typeof world !== "object")
|
|
81
|
-
continue;
|
|
82
|
-
processedWorlds.push([worldName, processParkourWorld(world)]);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
86
|
-
finally {
|
|
87
|
-
try {
|
|
88
|
-
if (worlds_1_1 && !worlds_1_1.done && (_a = worlds_1.return)) _a.call(worlds_1);
|
|
89
|
-
}
|
|
90
|
-
finally { if (e_2) throw e_2.error; }
|
|
91
|
-
}
|
|
92
|
-
var parkours = __assign({ total_stars: (_d = (_c = statistics.parkours) === null || _c === void 0 ? void 0 : _c.total_stars) !== null && _d !== void 0 ? _d : 0 }, Object.fromEntries(processedWorlds));
|
|
93
|
-
var parkourStatistics = {
|
|
94
|
-
UUID: statistics.UUID,
|
|
95
|
-
id: hive_bedrock_data_1.Game.ParkourWorlds,
|
|
96
|
-
parkours: parkours,
|
|
97
|
-
};
|
|
98
|
-
return parkourStatistics;
|
|
99
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Game, Statistics, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
import { OmittedSpecialStatistics } from "../types/types";
|
|
3
|
-
export interface Processed_BlockParty_AllTimeStatistics extends OmittedSpecialStatistics<Game.BlockParty, Timeframe.AllTime> {
|
|
4
|
-
id: Game.BlockParty;
|
|
5
|
-
level: number;
|
|
6
|
-
losses: number;
|
|
7
|
-
win_percentage: number;
|
|
8
|
-
first_played: number | null;
|
|
9
|
-
}
|
|
10
|
-
export interface Processed_BlockParty_MonthlyStatistics extends Statistics<Game.BlockParty, Timeframe.Monthly> {
|
|
11
|
-
id: Game.BlockParty;
|
|
12
|
-
level: number;
|
|
13
|
-
losses: number;
|
|
14
|
-
win_percentage: number;
|
|
15
|
-
}
|
|
16
|
-
export declare function processAllTime_PARTY(statistics: Partial<Statistics<Game.BlockParty, Timeframe.AllTime>>): Processed_BlockParty_AllTimeStatistics | null;
|
|
17
|
-
export declare function processMonthly_PARTY(statistics: Partial<Statistics<Game.BlockParty, Timeframe.Monthly>>): Processed_BlockParty_MonthlyStatistics | null;
|
package/lib/processors/party.js
DELETED
|
@@ -1,34 +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 __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_PARTY = processAllTime_PARTY;
|
|
18
|
-
exports.processMonthly_PARTY = processMonthly_PARTY;
|
|
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_PARTY(statistics) {
|
|
23
|
-
var _a, _b, _c;
|
|
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.BlockParty, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), { powerups_collected: (_a = statistics.powerups_collected) !== null && _a !== void 0 ? _a : 0, rounds_survived: (_b = statistics.rounds_survived) !== null && _b !== void 0 ? _b : 0, first_played: (_c = statistics.first_played) !== null && _c !== void 0 ? _c : null });
|
|
27
|
-
}
|
|
28
|
-
function processMonthly_PARTY(statistics) {
|
|
29
|
-
var _a, _b, _c, _d;
|
|
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.BlockParty, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), { powerups_collected: (_c = statistics.powerups_collected) !== null && _c !== void 0 ? _c : 0, rounds_survived: (_d = statistics.rounds_survived) !== null && _d !== void 0 ? _d : 0 });
|
|
34
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export interface ProcessedPlayerResponse {
|
|
2
|
-
info: {
|
|
3
|
-
uuid: string;
|
|
4
|
-
xuid: string;
|
|
5
|
-
username: string;
|
|
6
|
-
rank: string;
|
|
7
|
-
first_played: number;
|
|
8
|
-
login_streak: {
|
|
9
|
-
current: number;
|
|
10
|
-
longest: number;
|
|
11
|
-
};
|
|
12
|
-
friend_count: number;
|
|
13
|
-
quest_count: number;
|
|
14
|
-
};
|
|
15
|
-
equipped_cosmetics: {
|
|
16
|
-
costume: CosmeticResponseTypes[CosmeticType.Costume];
|
|
17
|
-
avatar: CosmeticResponseTypes[CosmeticType.Avatar];
|
|
18
|
-
hub_title: CosmeticResponseTypes[CosmeticType.HubTitle];
|
|
19
|
-
hat: CosmeticResponseTypes[CosmeticType.Hat];
|
|
20
|
-
backbling: CosmeticResponseTypes[CosmeticType.Backbling];
|
|
21
|
-
};
|
|
22
|
-
owned_cosmetics: {
|
|
23
|
-
costume: CosmeticResponseTypes[CosmeticType.Costume][];
|
|
24
|
-
avatar: CosmeticResponseTypes[CosmeticType.Avatar][];
|
|
25
|
-
hub_title: CosmeticResponseTypes[CosmeticType.HubTitle][];
|
|
26
|
-
hat: CosmeticResponseTypes[CosmeticType.Hat][];
|
|
27
|
-
pet: CosmeticResponseTypes[CosmeticType.Pet][];
|
|
28
|
-
mount: CosmeticResponseTypes[CosmeticType.Mount][];
|
|
29
|
-
backbling: CosmeticResponseTypes[CosmeticType.Backbling][];
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export declare enum CosmeticType {
|
|
33
|
-
Costume = "costume",
|
|
34
|
-
Avatar = "avatar",
|
|
35
|
-
HubTitle = "hub_title",
|
|
36
|
-
Hat = "hat",
|
|
37
|
-
Pet = "pet",
|
|
38
|
-
Mount = "mount",
|
|
39
|
-
Backbling = "backbling"
|
|
40
|
-
}
|
|
41
|
-
export interface CosmeticResponseTypes {
|
|
42
|
-
[CosmeticType.Costume]: string;
|
|
43
|
-
[CosmeticType.Avatar]: {
|
|
44
|
-
name: string;
|
|
45
|
-
url: string;
|
|
46
|
-
};
|
|
47
|
-
[CosmeticType.HubTitle]: string;
|
|
48
|
-
[CosmeticType.Hat]: {
|
|
49
|
-
name: string;
|
|
50
|
-
icon: string;
|
|
51
|
-
rarity: string;
|
|
52
|
-
};
|
|
53
|
-
[CosmeticType.Pet]: string;
|
|
54
|
-
[CosmeticType.Mount]: string;
|
|
55
|
-
[CosmeticType.Backbling]: {
|
|
56
|
-
name: string;
|
|
57
|
-
icon: string;
|
|
58
|
-
rarity: string;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export default function processPlayerInfo(playerResponse: any): ProcessedPlayerResponse | null;
|
package/lib/processors/player.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CosmeticType = void 0;
|
|
4
|
-
exports.default = processPlayerInfo;
|
|
5
|
-
var CosmeticType;
|
|
6
|
-
(function (CosmeticType) {
|
|
7
|
-
CosmeticType["Costume"] = "costume";
|
|
8
|
-
CosmeticType["Avatar"] = "avatar";
|
|
9
|
-
CosmeticType["HubTitle"] = "hub_title";
|
|
10
|
-
CosmeticType["Hat"] = "hat";
|
|
11
|
-
CosmeticType["Pet"] = "pet";
|
|
12
|
-
CosmeticType["Mount"] = "mount";
|
|
13
|
-
CosmeticType["Backbling"] = "backbling";
|
|
14
|
-
})(CosmeticType || (exports.CosmeticType = CosmeticType = {}));
|
|
15
|
-
function processPlayerInfo(playerResponse) {
|
|
16
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
17
|
-
if (!playerResponse)
|
|
18
|
-
return null;
|
|
19
|
-
var player = playerResponse.main;
|
|
20
|
-
var info = {
|
|
21
|
-
uuid: player.UUID,
|
|
22
|
-
xuid: player.xuid.toString(),
|
|
23
|
-
username: player.username_cc,
|
|
24
|
-
rank: player.rank,
|
|
25
|
-
first_played: player.first_played,
|
|
26
|
-
login_streak: {
|
|
27
|
-
current: (_a = player.daily_login_streak) !== null && _a !== void 0 ? _a : 0,
|
|
28
|
-
longest: (_b = player.longest_daily_login_streak) !== null && _b !== void 0 ? _b : 0,
|
|
29
|
-
},
|
|
30
|
-
friend_count: (_c = player.friend_count) !== null && _c !== void 0 ? _c : 0,
|
|
31
|
-
quest_count: (_d = player.quest_count) !== null && _d !== void 0 ? _d : 0,
|
|
32
|
-
};
|
|
33
|
-
var equipped_cosmetics = {
|
|
34
|
-
costume: (_e = player.equipped_costume) !== null && _e !== void 0 ? _e : null,
|
|
35
|
-
avatar: (_f = player.equipped_avatar) !== null && _f !== void 0 ? _f : null,
|
|
36
|
-
hub_title: (_g = player.equipped_hub_title) !== null && _g !== void 0 ? _g : null,
|
|
37
|
-
hat: (_h = player.equipped_hat) !== null && _h !== void 0 ? _h : null,
|
|
38
|
-
backbling: (_j = player.equipped_backbling) !== null && _j !== void 0 ? _j : null,
|
|
39
|
-
};
|
|
40
|
-
var owned_cosmetics = {
|
|
41
|
-
costume: (_k = player.costume_unlocked) !== null && _k !== void 0 ? _k : [],
|
|
42
|
-
avatar: (_l = player.avatar_unlocked) !== null && _l !== void 0 ? _l : [],
|
|
43
|
-
hub_title: (_m = player.hub_title_unlocked) !== null && _m !== void 0 ? _m : [],
|
|
44
|
-
hat: (_o = player.hat_unlocked) !== null && _o !== void 0 ? _o : [],
|
|
45
|
-
pet: (_p = player.pets) !== null && _p !== void 0 ? _p : [],
|
|
46
|
-
mount: (_q = player.mounts) !== null && _q !== void 0 ? _q : [],
|
|
47
|
-
backbling: (_r = player["cosmetics.backbling"]) !== null && _r !== void 0 ? _r : [],
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
info: info,
|
|
51
|
-
equipped_cosmetics: equipped_cosmetics,
|
|
52
|
-
owned_cosmetics: owned_cosmetics,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = processPlayerSearch;
|
|
4
|
-
function processPlayerSearch(playerSearchResponse) {
|
|
5
|
-
if (!playerSearchResponse)
|
|
6
|
-
return null;
|
|
7
|
-
return playerSearchResponse.map(function (player) { return ({
|
|
8
|
-
uuid: player.UUID,
|
|
9
|
-
username: player.username_cc,
|
|
10
|
-
}); });
|
|
11
|
-
}
|
package/lib/processors/sg.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Game, Statistics, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
import { OmittedSpecialStatistics } from "../types/types";
|
|
3
|
-
export interface Processed_SurvivalGames_AllTimeStatistics extends OmittedSpecialStatistics<Game.SurvivalGames, Timeframe.AllTime> {
|
|
4
|
-
id: Game.SurvivalGames;
|
|
5
|
-
level: number;
|
|
6
|
-
losses: number;
|
|
7
|
-
win_percentage: number;
|
|
8
|
-
kdr: number;
|
|
9
|
-
first_played: number | null;
|
|
10
|
-
}
|
|
11
|
-
export interface Processed_SurvivalGames_MonthlyStatistics extends Statistics<Game.SurvivalGames, Timeframe.Monthly> {
|
|
12
|
-
id: Game.SurvivalGames;
|
|
13
|
-
level: number;
|
|
14
|
-
kdr: number;
|
|
15
|
-
losses: number;
|
|
16
|
-
win_percentage: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function processAllTime_SG(statistics: Partial<Statistics<Game.SurvivalGames, Timeframe.AllTime>>): Processed_SurvivalGames_AllTimeStatistics | null;
|
|
19
|
-
export declare function processMonthly_SG(statistics: Partial<Statistics<Game.SurvivalGames, Timeframe.Monthly>>): Processed_SurvivalGames_MonthlyStatistics | null;
|
package/lib/processors/sg.js
DELETED
|
@@ -1,35 +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 __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_SG = processAllTime_SG;
|
|
18
|
-
exports.processMonthly_SG = processMonthly_SG;
|
|
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_SG(statistics) {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
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.SurvivalGames, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { deathmatches: (_a = statistics.deathmatches) !== null && _a !== void 0 ? _a : 0, flares_used: (_b = statistics.flares_used) !== null && _b !== void 0 ? _b : 0, launchpads_used: (_c = statistics.launchpads_used) !== null && _c !== void 0 ? _c : 0, cows: (_d = statistics.cows) !== null && _d !== void 0 ? _d : 0, crates: (_e = statistics.crates) !== null && _e !== void 0 ? _e : 0, teleporters_used: (_f = statistics.teleporters_used) !== null && _f !== void 0 ? _f : 0, first_played: (_g = statistics.first_played) !== null && _g !== void 0 ? _g : null });
|
|
28
|
-
}
|
|
29
|
-
function processMonthly_SG(statistics) {
|
|
30
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
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.SurvivalGames, statistics.xp)), (0, processPlayedAndVictories_1.default)(statistics.played, statistics.victories)), (0, processKillsAndDeaths_1.default)(statistics.kills, statistics.deaths)), { deathmatches: (_c = statistics.deathmatches) !== null && _c !== void 0 ? _c : 0, flares_used: (_d = statistics.flares_used) !== null && _d !== void 0 ? _d : 0, launchpads_used: (_e = statistics.launchpads_used) !== null && _e !== void 0 ? _e : 0, cows: (_f = statistics.cows) !== null && _f !== void 0 ? _f : 0, crates: (_g = statistics.crates) !== null && _g !== void 0 ? _g : 0, teleporters_used: (_h = statistics.teleporters_used) !== null && _h !== void 0 ? _h : 0 });
|
|
35
|
-
}
|
package/lib/processors/sky.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Game, Statistics, Timeframe } from "hive-bedrock-data";
|
|
2
|
-
import { OmittedSpecialStatistics } from "../types/types";
|
|
3
|
-
export interface Processed_Skywars_AllTimeStatistics extends OmittedSpecialStatistics<Game.Skywars, Timeframe.AllTime> {
|
|
4
|
-
id: Game.Skywars;
|
|
5
|
-
level: number;
|
|
6
|
-
losses: number;
|
|
7
|
-
win_percentage: number;
|
|
8
|
-
kdr: number;
|
|
9
|
-
first_played: number | null;
|
|
10
|
-
}
|
|
11
|
-
export interface Processed_Skywars_MonthlyStatistics extends Statistics<Game.Skywars, Timeframe.Monthly> {
|
|
12
|
-
id: Game.Skywars;
|
|
13
|
-
level: number;
|
|
14
|
-
losses: number;
|
|
15
|
-
win_percentage: number;
|
|
16
|
-
kdr: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function processAllTime_SKY(statistics: Partial<Statistics<Game.Skywars, Timeframe.AllTime>>): Processed_Skywars_AllTimeStatistics | null;
|
|
19
|
-
export declare function processMonthly_SKY(statistics: Partial<Statistics<Game.Skywars, Timeframe.Monthly>>): Processed_Skywars_MonthlyStatistics | null;
|