hive-bedrock-api 1.0.5-beta.1 → 1.0.5

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.
@@ -2,10 +2,10 @@ import { Options } from "../types/API";
2
2
  import { BASE_GAME_ALL, GAME_STATS, GAME_STATS_ALL, REQUEST_ALL, USER_MAIN } from "../types/GAMES";
3
3
  import { GAME } from "../types/GAME_INFO";
4
4
  import { MethodResponse } from "../types/METHODS";
5
- export default function getAllTimeStats(playerIdentifier: string): Promise<MethodResponse<Omit<REQUEST_ALL, "main">> & {
5
+ export default function getAllTimeStats(playerIdentifier: string, options?: Options): Promise<MethodResponse<Omit<REQUEST_ALL, "main">> & {
6
6
  player: USER_MAIN;
7
7
  }>;
8
- export default function getAllTimeStats<G extends GAME>(playerIdentifier: string, game?: G, options?: Options): Promise<MethodResponse<GAME_STATS<BASE_GAME_ALL>[G]>>;
8
+ export default function getAllTimeStats<G extends GAME>(playerIdentifier: string, game: G, options?: Options): Promise<MethodResponse<GAME_STATS<BASE_GAME_ALL>[G]>>;
9
9
  export default function getAllTimeStats<G extends GAME>(playerIdentifier: string, game: G[], options?: Options): Promise<MethodResponse<{
10
10
  [M in G]: GAME_STATS_ALL<M>;
11
11
  }> & {
@@ -99,6 +99,10 @@ function getAllTimeStats(playerIdentifier, game, options) {
99
99
  return __generator(this, function (_e) {
100
100
  switch (_e.label) {
101
101
  case 0:
102
+ if (typeof game === "object" && !(game instanceof Array)) {
103
+ options = game;
104
+ game = undefined;
105
+ }
102
106
  if (!!game) return [3 /*break*/, 4];
103
107
  _e.label = 1;
104
108
  case 1:
@@ -7,9 +7,8 @@ interface OptionsType extends Options {
7
7
  month?: number;
8
8
  date?: Date;
9
9
  }
10
- export default function getMonthlyStats(playerIdentifier: string): Promise<MethodResponse<Omit<REQUEST_MONTHLY, "main">>>;
11
- export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game?: G, options?: Options): Promise<MethodResponse<GAME_STATS<BASE_GAME_MONTHLY>[G]>>;
12
- export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G, options: OptionsType): Promise<MethodResponse<GAME_STATS<BASE_GAME_MONTHLY>[G]>>;
10
+ export default function getMonthlyStats(playerIdentifier: string, options?: Options): Promise<MethodResponse<Omit<REQUEST_MONTHLY, "main">>>;
11
+ export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G, options?: OptionsType): Promise<MethodResponse<GAME_STATS<BASE_GAME_MONTHLY>[G]>>;
13
12
  export default function getMonthlyStats<G extends GAME>(playerIdentifier: string, game: G[], options?: Options): Promise<MethodResponse<{
14
13
  [M in G]: GAME_STATS_ALL<M>;
15
14
  }>>;
@@ -77,6 +77,10 @@ function getMonthlyStats(playerIdentifier, game, options) {
77
77
  return __generator(this, function (_j) {
78
78
  switch (_j.label) {
79
79
  case 0:
80
+ if (typeof game === "object" && !(game instanceof Array)) {
81
+ options = game;
82
+ game = undefined;
83
+ }
80
84
  if (!!game) return [3 /*break*/, 4];
81
85
  _j.label = 1;
82
86
  case 1:
@@ -109,7 +109,7 @@ export type AVATAR = {
109
109
  };
110
110
  export interface API_USER_MAIN {
111
111
  UUID: string;
112
- xuid: string;
112
+ xuid: number;
113
113
  username: string;
114
114
  username_cc: string;
115
115
  rank: RANK;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hive-bedrock-api",
3
- "version": "1.0.5-beta.1",
3
+ "version": "1.0.5",
4
4
  "description": "An API wrapper for the Hive Minecraft Bedrock Edition server.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",