mowojang 0.2.1 → 0.2.2

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mowojang",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A simple JavaScript and TypeScript compatible API Wrapper for the Mowojang-API.",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "axios-cache-interceptor": "^1.5.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/node": "^20.14.7",
34
+ "@types/node": "^20.14.9",
35
35
  "typescript": "^5.5.2"
36
36
  }
37
37
  }
@@ -1,4 +1,4 @@
1
1
  import { AxiosCacheInstance } from "axios-cache-interceptor";
2
2
  import { AxiosOptions } from "../types/index.js";
3
- declare const _default: (options: AxiosOptions) => AxiosCacheInstance;
3
+ declare const _default: (options?: AxiosOptions) => AxiosCacheInstance;
4
4
  export default _default;
@@ -6,7 +6,7 @@ export default (options) => {
6
6
  timeout: options?.timeout ?? 5000,
7
7
  maxRedirects: 0,
8
8
  headers: {
9
- "User-Agent": `axios/${axios.VERSION} mowojang/${PackageJSON.version} (https://github.com/pixelicc/mowojang-api-wrapper)`,
9
+ "User-Agent": `axios/${axios.VERSION} mowojang/${PackageJSON.version} (https://www.npmjs.com/package/mowojang)`,
10
10
  Accept: "application/json",
11
11
  },
12
12
  }), {
@@ -1,7 +1,7 @@
1
1
  import { Player, Username, UUID, ClientOptions, MowojangCape, MowojangProfile, MowojangRequestConfig, MowojangResponse, MowojangSession, MowojangSkin } from "../types/index.js";
2
2
  export default class Client {
3
3
  private axios;
4
- constructor(clientOptions: ClientOptions);
4
+ constructor(clientOptions?: ClientOptions);
5
5
  /**
6
6
  * Returns an Array of Player Profiles
7
7
  *
@@ -13,7 +13,15 @@ export default class Client {
13
13
  *
14
14
  */
15
15
  getProfile(player: Player, config?: MowojangRequestConfig): MowojangResponse<MowojangProfile, "INVALID_PLAYER">;
16
+ /**
17
+ * Simple Wrapper to only retrieve the UUID from the Player's Profile Data
18
+ *
19
+ */
16
20
  getUUID(username: Username, config?: MowojangRequestConfig): Promise<null | Username>;
21
+ /**
22
+ * Simple Wrapper to only retrieve the Username from the Player's Profile Data
23
+ *
24
+ */
17
25
  getUsername(UUID: UUID, config?: MowojangRequestConfig): Promise<null | UUID>;
18
26
  /**
19
27
  * Returns an Array of Player Sessions
@@ -54,6 +54,10 @@ export default class Client {
54
54
  return { data: null, error: "INVALID_PLAYER" };
55
55
  return { data: profiles.data[0], error: null };
56
56
  }
57
+ /**
58
+ * Simple Wrapper to only retrieve the UUID from the Player's Profile Data
59
+ *
60
+ */
57
61
  async getUUID(username, config) {
58
62
  if (!validateUsername(username))
59
63
  return null;
@@ -62,6 +66,10 @@ export default class Client {
62
66
  return null;
63
67
  return profile.data.UUID;
64
68
  }
69
+ /**
70
+ * Simple Wrapper to only retrieve the Username from the Player's Profile Data
71
+ *
72
+ */
65
73
  async getUsername(UUID, config) {
66
74
  if (!validateUUID(UUID))
67
75
  return null;
@@ -7,8 +7,8 @@ export declare const validate: {
7
7
  username: (username: string) => boolean;
8
8
  };
9
9
  export declare const utils: {
10
- dashUUID: (UUID: string) => string;
11
- undashUUID: (UUID: string) => string;
10
+ dashUUID: (UUID: string) => import("../types/player.js").UUID;
11
+ undashUUID: (UUID: string) => import("../types/player.js").UUID;
12
12
  };
13
13
  export declare const cache: {
14
14
  buildStorage: typeof buildStorage;
@@ -1,2 +1,3 @@
1
- export declare const undashUUID: (UUID: string) => string;
2
- export declare const dashUUID: (UUID: string) => string;
1
+ import { UUID } from "../types/index.js";
2
+ export declare const undashUUID: (UUID: string) => UUID;
3
+ export declare const dashUUID: (UUID: string) => UUID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mowojang",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A simple JavaScript and TypeScript compatible API Wrapper for the Mowojang-API.",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "axios-cache-interceptor": "^1.5.3"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/node": "^20.14.7",
28
+ "@types/node": "^20.14.9",
29
29
  "typescript": "^5.5.2"
30
30
  },
31
31
  "scripts": {