pterodactyl-api-client 2.4.0 → 2.5.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.
- package/dist/application/application.client.d.ts +2 -0
- package/dist/application/application.client.d.ts.map +1 -1
- package/dist/application/application.client.js +3 -0
- package/dist/application/nest/egg/egg.client.d.ts +80 -0
- package/dist/application/nest/egg/egg.client.d.ts.map +1 -0
- package/dist/application/nest/egg/egg.client.js +28 -0
- package/dist/application/nest/egg/egg.types.d.ts +42 -0
- package/dist/application/nest/egg/egg.types.d.ts.map +1 -0
- package/dist/application/nest/egg/egg.types.js +1 -0
- package/dist/application/nest/index.cjs +3 -0
- package/dist/application/nest/index.d.ts +5 -0
- package/dist/application/nest/index.d.ts.map +1 -0
- package/dist/application/nest/index.js +4 -0
- package/dist/application/nest/nest.client.d.ts +36 -0
- package/dist/application/nest/nest.client.d.ts.map +1 -0
- package/dist/application/nest/nest.client.js +31 -0
- package/dist/application/nest/nest.types.d.ts +17 -0
- package/dist/application/nest/nest.types.d.ts.map +1 -0
- package/dist/application/nest/nest.types.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import LocationClient from "./location/location.client.js";
|
|
2
|
+
import NestClient from "./nest/nest.client.js";
|
|
2
3
|
import NodeClient from "./node/node.client.js";
|
|
3
4
|
import ServerClient from "./server/server.client.js";
|
|
4
5
|
import UserClient from "./user/user.client.js";
|
|
@@ -9,6 +10,7 @@ export default class ApplicationAPI {
|
|
|
9
10
|
server: ServerClient;
|
|
10
11
|
location: LocationClient;
|
|
11
12
|
node: NodeClient;
|
|
13
|
+
nest: NestClient;
|
|
12
14
|
constructor({ apiKey, panelUrl }: {
|
|
13
15
|
apiKey: string;
|
|
14
16
|
panelUrl: URL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.client.d.ts","sourceRoot":"","sources":["../../src/application/application.client.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,UAAU,CAAa;IAC/B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,UAAU,CAAC;gBAEZ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"application.client.d.ts","sourceRoot":"","sources":["../../src/application/application.client.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,UAAU,CAAa;IAC/B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;gBAEZ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAA;KAAE;CASpE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import HttpClient from "../class/HttpClient.js";
|
|
2
2
|
import LocationClient from "./location/location.client.js";
|
|
3
|
+
import NestClient from "./nest/nest.client.js";
|
|
3
4
|
import NodeClient from "./node/node.client.js";
|
|
4
5
|
import ServerClient from "./server/server.client.js";
|
|
5
6
|
import UserClient from "./user/user.client.js";
|
|
@@ -10,6 +11,7 @@ export default class ApplicationAPI {
|
|
|
10
11
|
server;
|
|
11
12
|
location;
|
|
12
13
|
node;
|
|
14
|
+
nest;
|
|
13
15
|
constructor({ apiKey, panelUrl }) {
|
|
14
16
|
this.panelUrl = panelUrl;
|
|
15
17
|
this.httpClient = new HttpClient(panelUrl, apiKey);
|
|
@@ -17,5 +19,6 @@ export default class ApplicationAPI {
|
|
|
17
19
|
this.server = new ServerClient(this.httpClient);
|
|
18
20
|
this.location = new LocationClient(this.httpClient);
|
|
19
21
|
this.node = new NodeClient(this.httpClient);
|
|
22
|
+
this.nest = new NestClient(this.httpClient);
|
|
20
23
|
}
|
|
21
24
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type HttpClient from "../../../class/HttpClient.js";
|
|
2
|
+
export default class EggClient {
|
|
3
|
+
private httpClient;
|
|
4
|
+
constructor(httpClient: HttpClient);
|
|
5
|
+
list(id: number): Promise<{
|
|
6
|
+
data: {
|
|
7
|
+
created_at: Date;
|
|
8
|
+
updated_at: Date;
|
|
9
|
+
id: number;
|
|
10
|
+
uuid: string;
|
|
11
|
+
name: string;
|
|
12
|
+
nest: number;
|
|
13
|
+
author: string;
|
|
14
|
+
description: string;
|
|
15
|
+
docker_image: string;
|
|
16
|
+
docker_images: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
config: {
|
|
20
|
+
files: {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
startup: {
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
stop: string;
|
|
27
|
+
logs: unknown;
|
|
28
|
+
file_denylist: unknown;
|
|
29
|
+
extends: null;
|
|
30
|
+
};
|
|
31
|
+
startup: string;
|
|
32
|
+
script: {
|
|
33
|
+
privileged: boolean;
|
|
34
|
+
install: string;
|
|
35
|
+
entry: string;
|
|
36
|
+
container: string;
|
|
37
|
+
extends: null;
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
object: "list";
|
|
41
|
+
}>;
|
|
42
|
+
info(id: number, egg: number): Promise<{
|
|
43
|
+
attributes: {
|
|
44
|
+
created_at: Date;
|
|
45
|
+
updated_at: Date;
|
|
46
|
+
id: number;
|
|
47
|
+
uuid: string;
|
|
48
|
+
name: string;
|
|
49
|
+
nest: number;
|
|
50
|
+
author: string;
|
|
51
|
+
description: string;
|
|
52
|
+
docker_image: string;
|
|
53
|
+
docker_images: {
|
|
54
|
+
[key: string]: string;
|
|
55
|
+
};
|
|
56
|
+
config: {
|
|
57
|
+
files: {
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
};
|
|
60
|
+
startup: {
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
stop: string;
|
|
64
|
+
logs: unknown;
|
|
65
|
+
file_denylist: unknown;
|
|
66
|
+
extends: null;
|
|
67
|
+
};
|
|
68
|
+
startup: string;
|
|
69
|
+
script: {
|
|
70
|
+
privileged: boolean;
|
|
71
|
+
install: string;
|
|
72
|
+
entry: string;
|
|
73
|
+
container: string;
|
|
74
|
+
extends: null;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
object: "egg";
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=egg.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"egg.client.d.ts","sourceRoot":"","sources":["../../../../src/application/nest/egg/egg.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,MAAM,CAAC,OAAO,OAAO,SAAS;IAChB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAef,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcnC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default class EggClient {
|
|
2
|
+
httpClient;
|
|
3
|
+
constructor(httpClient) {
|
|
4
|
+
this.httpClient = httpClient;
|
|
5
|
+
}
|
|
6
|
+
async list(id) {
|
|
7
|
+
const res = await this.httpClient.request("GET", `/application/nests/${id}/eggs`);
|
|
8
|
+
return {
|
|
9
|
+
...res,
|
|
10
|
+
data: res.data.map((egg) => ({
|
|
11
|
+
...egg.attributes,
|
|
12
|
+
created_at: new Date(egg.attributes.created_at),
|
|
13
|
+
updated_at: new Date(egg.attributes.updated_at),
|
|
14
|
+
})),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
async info(id, egg) {
|
|
18
|
+
const res = await this.httpClient.request("GET", `/application/nests/${id}/eggs/${egg}`);
|
|
19
|
+
return {
|
|
20
|
+
...res,
|
|
21
|
+
attributes: {
|
|
22
|
+
...res.attributes,
|
|
23
|
+
created_at: new Date(res.attributes.created_at),
|
|
24
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { List } from "../../../types.js";
|
|
2
|
+
export interface Egg<T extends string | Date> {
|
|
3
|
+
object: "egg";
|
|
4
|
+
attributes: {
|
|
5
|
+
id: number;
|
|
6
|
+
uuid: string;
|
|
7
|
+
name: string;
|
|
8
|
+
nest: number;
|
|
9
|
+
author: string;
|
|
10
|
+
description: string;
|
|
11
|
+
docker_image: string;
|
|
12
|
+
docker_images: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
config: {
|
|
16
|
+
files: {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
startup: {
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
stop: string;
|
|
23
|
+
logs: unknown;
|
|
24
|
+
file_denylist: unknown;
|
|
25
|
+
extends: null;
|
|
26
|
+
};
|
|
27
|
+
startup: string;
|
|
28
|
+
script: {
|
|
29
|
+
privileged: boolean;
|
|
30
|
+
install: string;
|
|
31
|
+
entry: string;
|
|
32
|
+
container: string;
|
|
33
|
+
extends: null;
|
|
34
|
+
};
|
|
35
|
+
created_at: T;
|
|
36
|
+
updated_at: T;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface EggList extends List {
|
|
40
|
+
data: Egg<string>[];
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=egg.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"egg.types.d.ts","sourceRoot":"","sources":["../../../../src/application/nest/egg/egg.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,GAAG,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IAC1C,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE;YACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;SACvB,CAAC;QACF,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;aACxB,CAAC;YACF,OAAO,EAAE;gBACP,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;aACxB,CAAC;YACF,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,OAAO,CAAC;YACd,aAAa,EAAE,OAAO,CAAC;YACvB,OAAO,EAAE,IAAI,CAAC;SACf,CAAC;QACF,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE;YACN,UAAU,EAAE,OAAO,CAAC;YACpB,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC;YACd,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,IAAI,CAAC;SACf,CAAC;QACF,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,OAAQ,SAAQ,IAAI;IACnC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/nest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE3D,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type HttpClient from "../../class/HttpClient.js";
|
|
2
|
+
export default class NestClient {
|
|
3
|
+
private httpClient;
|
|
4
|
+
constructor(httpClient: HttpClient);
|
|
5
|
+
list(): Promise<{
|
|
6
|
+
data: {
|
|
7
|
+
attributes: {
|
|
8
|
+
created_at: Date;
|
|
9
|
+
updated_at: Date;
|
|
10
|
+
id: number;
|
|
11
|
+
uuid: string;
|
|
12
|
+
author: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
object: "nest";
|
|
17
|
+
}[];
|
|
18
|
+
meta: {
|
|
19
|
+
pagination: import("../../types.js").Pagination;
|
|
20
|
+
};
|
|
21
|
+
object: "list";
|
|
22
|
+
}>;
|
|
23
|
+
info(id: number): Promise<{
|
|
24
|
+
attributes: {
|
|
25
|
+
created_at: Date;
|
|
26
|
+
updated_at: Date;
|
|
27
|
+
id: number;
|
|
28
|
+
uuid: string;
|
|
29
|
+
author: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
object: "nest";
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=nest.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest.client.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAGxD,MAAM,CAAC,OAAO,OAAO,UAAU;IACjB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI;;;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;CActB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export default class NestClient {
|
|
2
|
+
httpClient;
|
|
3
|
+
constructor(httpClient) {
|
|
4
|
+
this.httpClient = httpClient;
|
|
5
|
+
}
|
|
6
|
+
async list() {
|
|
7
|
+
const res = await this.httpClient.request("GET", "/application/nests");
|
|
8
|
+
return {
|
|
9
|
+
...res,
|
|
10
|
+
data: res.data.map((nest) => ({
|
|
11
|
+
...nest,
|
|
12
|
+
attributes: {
|
|
13
|
+
...nest.attributes,
|
|
14
|
+
created_at: new Date(nest.attributes.created_at),
|
|
15
|
+
updated_at: new Date(nest.attributes.updated_at),
|
|
16
|
+
},
|
|
17
|
+
})),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async info(id) {
|
|
21
|
+
const res = await this.httpClient.request("GET", `/application/nests/${id}`);
|
|
22
|
+
return {
|
|
23
|
+
...res,
|
|
24
|
+
attributes: {
|
|
25
|
+
...res.attributes,
|
|
26
|
+
created_at: new Date(res.attributes.created_at),
|
|
27
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ListwithPagination } from "../../types.js";
|
|
2
|
+
export interface Nest<T extends string | Date> {
|
|
3
|
+
object: "nest";
|
|
4
|
+
attributes: {
|
|
5
|
+
id: number;
|
|
6
|
+
uuid: string;
|
|
7
|
+
author: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
created_at: T;
|
|
11
|
+
updated_at: T;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface NestList extends ListwithPagination {
|
|
15
|
+
data: Nest<string>[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=nest.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest.types.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,QAAS,SAAQ,kBAAkB;IAClD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pterodactyl-api-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "SDK TypeScript non officiel et entièrement typé pour l’API Pterodactyl.\nCouvre l’ensemble des endpoints client et application avec une architecture modulaire, orientée classes, conçue pour Node.js et les environnements TypeScript stricts.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|