mowojang 0.3.8 → 0.3.9
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 +2 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +1 -0
- package/dist/types/misc.d.ts +26 -0
- package/dist/types/misc.js +1 -0
- package/dist/types/player.d.ts +18 -0
- package/dist/types/player.js +1 -0
- package/dist/types/structures.d.ts +23 -0
- package/dist/types/structures.js +1 -0
- package/package.json +4 -1
- package/tsconfig.json +0 -15
package/dist/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mowojang",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "A simple JavaScript and TypeScript compatible wrapper for the Mowojang-API.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
7
8
|
"type": "module",
|
|
8
9
|
"scripts": {
|
|
9
10
|
"build": "pnpm tsc",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CacheOptions, CacheRequestConfig } from "axios-cache-interceptor";
|
|
2
|
+
export type ClientOptions = {
|
|
3
|
+
timeout?: number;
|
|
4
|
+
validation?: ValidationOptions;
|
|
5
|
+
cache?: CacheOptions;
|
|
6
|
+
};
|
|
7
|
+
export type AxiosOptions = {
|
|
8
|
+
timeout?: number;
|
|
9
|
+
cache?: CacheOptions;
|
|
10
|
+
};
|
|
11
|
+
export type ValidationOptions = {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
minimumUsernameLength?: 1 | 2;
|
|
14
|
+
};
|
|
15
|
+
export type MowojangRequestConfig = {
|
|
16
|
+
validation?: ValidationOptions;
|
|
17
|
+
cache?: CacheRequestConfig<any, any>["cache"];
|
|
18
|
+
};
|
|
19
|
+
export type MowojangError = "INVALID_PLAYER";
|
|
20
|
+
export type MowojangResponse<D, E extends MowojangError | undefined> = Promise<{
|
|
21
|
+
data: D;
|
|
22
|
+
error: null;
|
|
23
|
+
} | {
|
|
24
|
+
data: null;
|
|
25
|
+
error: E extends undefined ? "UNKOWN_ERROR" | "INVALID_INPUT" : E | "UNKOWN_ERROR" | "INVALID_INPUT";
|
|
26
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minecraft Username or UUIDv4 (both undashed and dashed will be accepted)
|
|
3
|
+
*
|
|
4
|
+
* @example "Technoblade" or "b876ec32-e396-476b-a115-8438d83c67d4"
|
|
5
|
+
*/
|
|
6
|
+
export type Player = string | UUID;
|
|
7
|
+
/**
|
|
8
|
+
* Minecraft Username
|
|
9
|
+
*
|
|
10
|
+
* @example "Pixelic"
|
|
11
|
+
*/
|
|
12
|
+
export type Username = string;
|
|
13
|
+
/**
|
|
14
|
+
* Minecraft UUIDv4 (both undashed and dashed will be accepted)
|
|
15
|
+
*
|
|
16
|
+
* @example b876ec32e396476ba1158438d83c67d4
|
|
17
|
+
*/
|
|
18
|
+
export type UUID = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UUID, Username } from "./index.d.ts";
|
|
2
|
+
export type MowojangProfile = {
|
|
3
|
+
UUID: UUID;
|
|
4
|
+
username: Username;
|
|
5
|
+
};
|
|
6
|
+
export type MowojangSession = {
|
|
7
|
+
UUID: UUID;
|
|
8
|
+
username: Username;
|
|
9
|
+
skin: MowojangSkin;
|
|
10
|
+
cape: MowojangCape;
|
|
11
|
+
actions: ("FORCED_NAME_CHANGE" | "USING_BANNED_SKIN")[];
|
|
12
|
+
};
|
|
13
|
+
export type MowojangSkin = null | {
|
|
14
|
+
url: string;
|
|
15
|
+
hash: string;
|
|
16
|
+
metadata: {
|
|
17
|
+
slim: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type MowojangCape = null | {
|
|
21
|
+
url: string;
|
|
22
|
+
hash: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mowojang",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "A simple JavaScript and TypeScript compatible wrapper for the Mowojang-API.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
7
10
|
"type": "module",
|
|
8
11
|
"repository": {
|
|
9
12
|
"type": "git",
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"moduleResolution": "NodeNext",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"outDir": "dist",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"skipDefaultLibCheck": true,
|
|
11
|
-
"resolveJsonModule": true
|
|
12
|
-
},
|
|
13
|
-
"include": ["src", "types"],
|
|
14
|
-
"exclude": ["node_modules"]
|
|
15
|
-
}
|