pterodactyl-api-client 2.0.2 → 2.2.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/server/database/database.client.d.ts +58 -0
- package/dist/application/server/database/database.client.d.ts.map +1 -0
- package/dist/application/server/database/database.client.js +48 -0
- package/dist/application/server/database/database.types.d.ts +43 -0
- package/dist/application/server/database/database.types.d.ts.map +1 -0
- package/dist/application/server/database/database.types.js +1 -0
- package/dist/application/server/database/password/password.client.d.ts +7 -0
- package/dist/application/server/database/password/password.client.d.ts.map +1 -0
- package/dist/application/server/database/password/password.client.js +9 -0
- package/dist/application/server/index.cjs +3 -0
- package/dist/application/server/index.d.ts +5 -0
- package/dist/application/server/index.d.ts.map +1 -0
- package/dist/application/server/index.js +4 -0
- package/dist/application/server/server.client.d.ts +224 -0
- package/dist/application/server/server.client.d.ts.map +1 -0
- package/dist/application/server/server.client.js +90 -0
- package/dist/application/server/server.types.d.ts +68 -0
- package/dist/application/server/server.types.d.ts.map +1 -0
- package/dist/application/server/server.types.js +1 -0
- package/dist/application/user/index.d.ts +3 -0
- package/dist/application/user/index.d.ts.map +1 -0
- package/dist/application/user/index.js +2 -0
- package/dist/application/user/user.types.d.ts +0 -2
- package/dist/application/user/user.types.d.ts.map +1 -1
- package/dist/types.d.ts +2 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import ServerClient from "./server/server.client.js";
|
|
1
2
|
import UserClient from "./user/user.client.js";
|
|
2
3
|
export default class ApplicationAPI {
|
|
3
4
|
private httpClient;
|
|
4
5
|
readonly panelUrl: URL;
|
|
5
6
|
user: UserClient;
|
|
7
|
+
server: ServerClient;
|
|
6
8
|
constructor({ apiKey, panelUrl }: {
|
|
7
9
|
apiKey: string;
|
|
8
10
|
panelUrl: URL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.client.d.ts","sourceRoot":"","sources":["../../src/application/application.client.ts"],"names":[],"mappings":"AACA,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;
|
|
1
|
+
{"version":3,"file":"application.client.d.ts","sourceRoot":"","sources":["../../src/application/application.client.ts"],"names":[],"mappings":"AACA,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;gBAEhB,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAA;KAAE;CAMpE"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import HttpClient from "../class/HttpClient.js";
|
|
2
|
+
import ServerClient from "./server/server.client.js";
|
|
2
3
|
import UserClient from "./user/user.client.js";
|
|
3
4
|
export default class ApplicationAPI {
|
|
4
5
|
httpClient;
|
|
5
6
|
panelUrl;
|
|
6
7
|
user;
|
|
8
|
+
server;
|
|
7
9
|
constructor({ apiKey, panelUrl }) {
|
|
8
10
|
this.panelUrl = panelUrl;
|
|
9
11
|
this.httpClient = new HttpClient(panelUrl, apiKey);
|
|
10
12
|
this.user = new UserClient(this.httpClient);
|
|
13
|
+
this.server = new ServerClient(this.httpClient);
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type HttpClient from "../../../class/HttpClient.js";
|
|
2
|
+
import type { CreateApplicationDatabase } from "./database.types.js";
|
|
3
|
+
import PasswordClient from "./password/password.client.js";
|
|
4
|
+
export default class DatabaseClient {
|
|
5
|
+
private httpClient;
|
|
6
|
+
password: PasswordClient;
|
|
7
|
+
constructor(httpClient: HttpClient);
|
|
8
|
+
list(server: number): Promise<{
|
|
9
|
+
data: {
|
|
10
|
+
attributes: {
|
|
11
|
+
created_at: Date;
|
|
12
|
+
updated_at: Date;
|
|
13
|
+
id: number;
|
|
14
|
+
server: number;
|
|
15
|
+
host: number;
|
|
16
|
+
database: string;
|
|
17
|
+
username: string;
|
|
18
|
+
remote: string | import("../../../types.js").IP | "%";
|
|
19
|
+
max_connections: number;
|
|
20
|
+
};
|
|
21
|
+
object: "server_database";
|
|
22
|
+
}[];
|
|
23
|
+
object: "list";
|
|
24
|
+
}>;
|
|
25
|
+
info(server: number, database: number): Promise<{
|
|
26
|
+
attributes: {
|
|
27
|
+
created_at: Date;
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
id: number;
|
|
30
|
+
server: number;
|
|
31
|
+
host: number;
|
|
32
|
+
database: string;
|
|
33
|
+
username: string;
|
|
34
|
+
remote: string | import("../../../types.js").IP | "%";
|
|
35
|
+
max_connections: number;
|
|
36
|
+
};
|
|
37
|
+
object: "server_database";
|
|
38
|
+
}>;
|
|
39
|
+
create(server: number, args: CreateApplicationDatabase): Promise<{
|
|
40
|
+
attributes: {
|
|
41
|
+
created_at: Date;
|
|
42
|
+
updated_at: Date;
|
|
43
|
+
id: number;
|
|
44
|
+
server: number;
|
|
45
|
+
host: number;
|
|
46
|
+
database: string;
|
|
47
|
+
username: string;
|
|
48
|
+
remote: string | import("../../../types.js").IP | "%";
|
|
49
|
+
max_connections: number;
|
|
50
|
+
};
|
|
51
|
+
meta: {
|
|
52
|
+
ressource: string;
|
|
53
|
+
};
|
|
54
|
+
object: "server_database";
|
|
55
|
+
}>;
|
|
56
|
+
delete(server: number, database: number): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=database.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.client.d.ts","sourceRoot":"","sources":["../../../../src/application/server/database/database.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAIV,yBAAyB,EAE1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,cAAc;IAGrB,OAAO,CAAC,UAAU;IAFvB,QAAQ,EAAE,cAAc,CAAC;gBAEZ,UAAU,EAAE,UAAU;IAIpC,IAAI,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;IAkBnB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;IAerC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB;;;;;;;;;;;;;;;;;IAe5D,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMxC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import PasswordClient from "./password/password.client.js";
|
|
2
|
+
export default class DatabaseClient {
|
|
3
|
+
httpClient;
|
|
4
|
+
password;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
this.password = new PasswordClient(httpClient);
|
|
8
|
+
}
|
|
9
|
+
async list(server) {
|
|
10
|
+
const res = await this.httpClient.request("GET", `/application/servers/${server}/databases`);
|
|
11
|
+
return {
|
|
12
|
+
...res,
|
|
13
|
+
data: res.data.map((db) => ({
|
|
14
|
+
...db,
|
|
15
|
+
attributes: {
|
|
16
|
+
...db.attributes,
|
|
17
|
+
created_at: new Date(db.attributes.created_at),
|
|
18
|
+
updated_at: new Date(db.attributes.updated_at),
|
|
19
|
+
},
|
|
20
|
+
})),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async info(server, database) {
|
|
24
|
+
const res = await this.httpClient.request("GET", `/application/servers/${server}/databases/${database}`);
|
|
25
|
+
return {
|
|
26
|
+
...res,
|
|
27
|
+
attributes: {
|
|
28
|
+
...res.attributes,
|
|
29
|
+
created_at: new Date(res.attributes.created_at),
|
|
30
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
async create(server, args) {
|
|
35
|
+
const res = await this.httpClient.request("POST", `/application/servers/${server}/databases`, args);
|
|
36
|
+
return {
|
|
37
|
+
...res,
|
|
38
|
+
attributes: {
|
|
39
|
+
...res.attributes,
|
|
40
|
+
created_at: new Date(res.attributes.created_at),
|
|
41
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
delete(server, database) {
|
|
46
|
+
return this.httpClient.request("DELETE", `/application/servers/${server}/databases/${database}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BaseArgs, IP, List } from "../../../types.js";
|
|
2
|
+
export interface ApplicationDatabaseAttributes<T extends string | Date> {
|
|
3
|
+
id: number;
|
|
4
|
+
server: number;
|
|
5
|
+
host: number;
|
|
6
|
+
database: string;
|
|
7
|
+
username: string;
|
|
8
|
+
remote: string | IP | "%";
|
|
9
|
+
max_connections: number;
|
|
10
|
+
created_at: T;
|
|
11
|
+
updated_at: T;
|
|
12
|
+
}
|
|
13
|
+
export interface ApplicationDatabase<T extends string | Date> {
|
|
14
|
+
object: "server_database";
|
|
15
|
+
attributes: ApplicationDatabaseAttributes<T>;
|
|
16
|
+
}
|
|
17
|
+
export interface ApplicationDatabaseList extends List {
|
|
18
|
+
data: ApplicationDatabase<string>[];
|
|
19
|
+
}
|
|
20
|
+
export interface CreateApplicationDatabase extends BaseArgs {
|
|
21
|
+
database: string;
|
|
22
|
+
remote: string | IP | "%";
|
|
23
|
+
host: number;
|
|
24
|
+
}
|
|
25
|
+
export interface CreatedApplicationDatabase extends ApplicationDatabase<string> {
|
|
26
|
+
meta: {
|
|
27
|
+
ressource: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface ApplicationDatabaseWithPassword {
|
|
31
|
+
object: "server_database";
|
|
32
|
+
attributes: ApplicationDatabaseAttributes<string> & {
|
|
33
|
+
relationships: {
|
|
34
|
+
password: {
|
|
35
|
+
object: "database_password";
|
|
36
|
+
attributes: {
|
|
37
|
+
password: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=database.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.types.d.ts","sourceRoot":"","sources":["../../../../src/application/server/database/database.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,EAAE,GAAG,GAAG,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,CAAC,CAAC;IACd,UAAU,EAAE,CAAC,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IAC1D,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,6BAA6B,CAAC,CAAC,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,uBAAwB,SAAQ,IAAI;IACnD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,yBAA0B,SAAQ,QAAQ;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,EAAE,GAAG,GAAG,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB,CAAC,MAAM,CAAC;IAC7E,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,6BAA6B,CAAC,MAAM,CAAC,GAAG;QAClD,aAAa,EAAE;YACb,QAAQ,EAAE;gBACR,MAAM,EAAE,mBAAmB,CAAC;gBAC5B,UAAU,EAAE;oBACV,QAAQ,EAAE,MAAM,CAAC;iBAClB,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type HttpClient from "../../../../class/HttpClient.js";
|
|
2
|
+
export default class PasswordClient {
|
|
3
|
+
private httpClient;
|
|
4
|
+
constructor(httpClient: HttpClient);
|
|
5
|
+
reset(server: number, database: number): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=password.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password.client.d.ts","sourceRoot":"","sources":["../../../../../src/application/server/database/password/password.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,cAAc;IACrB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMvC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default class PasswordClient {
|
|
2
|
+
httpClient;
|
|
3
|
+
constructor(httpClient) {
|
|
4
|
+
this.httpClient = httpClient;
|
|
5
|
+
}
|
|
6
|
+
reset(server, database) {
|
|
7
|
+
return this.httpClient.request("POST", `/application/servers/${server}/databases/${database}/reset-password`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type HttpClient from "../../class/HttpClient.js";
|
|
2
|
+
import type { UserServer, UserServerAttributesWithDate } from "../../client/server/server.types.js";
|
|
3
|
+
import DatabaseClient from "./database/database.client.js";
|
|
4
|
+
import type { CreateServerArgs, EditApplicationServerArgs } from "./server.types.js";
|
|
5
|
+
export default class ServerClient {
|
|
6
|
+
private httpClient;
|
|
7
|
+
database: DatabaseClient;
|
|
8
|
+
constructor(httpClient: HttpClient);
|
|
9
|
+
list(): Promise<{
|
|
10
|
+
data: {
|
|
11
|
+
created_at: Date;
|
|
12
|
+
updated_at: Date;
|
|
13
|
+
server_owner: boolean;
|
|
14
|
+
identifier: string;
|
|
15
|
+
internal_id: number;
|
|
16
|
+
uuid: string;
|
|
17
|
+
name: string;
|
|
18
|
+
is_node_under_maintenance: boolean;
|
|
19
|
+
description: string;
|
|
20
|
+
status: null;
|
|
21
|
+
is_suspended: boolean;
|
|
22
|
+
is_installing: boolean;
|
|
23
|
+
is_transferring: boolean;
|
|
24
|
+
node: string;
|
|
25
|
+
sftp_details: {
|
|
26
|
+
ip: string;
|
|
27
|
+
port: number;
|
|
28
|
+
};
|
|
29
|
+
invocation: string;
|
|
30
|
+
docker_image: string;
|
|
31
|
+
egg_features: string[];
|
|
32
|
+
feature_limits: {
|
|
33
|
+
databases: number;
|
|
34
|
+
allocations: number;
|
|
35
|
+
backups: number;
|
|
36
|
+
};
|
|
37
|
+
user_permissions: import("../../client/server/server.types.js").ServerPermissions[];
|
|
38
|
+
limits: {
|
|
39
|
+
memory: number;
|
|
40
|
+
swap: number;
|
|
41
|
+
disk: number;
|
|
42
|
+
io: number;
|
|
43
|
+
cpu: number;
|
|
44
|
+
threads: null | string;
|
|
45
|
+
oom_disabled: boolean;
|
|
46
|
+
};
|
|
47
|
+
relationships: {
|
|
48
|
+
allocations: {
|
|
49
|
+
object: "list";
|
|
50
|
+
data: import("../../client/server/server.types.js").Allocation[];
|
|
51
|
+
};
|
|
52
|
+
variables: {
|
|
53
|
+
object: "list";
|
|
54
|
+
data: import("../../client/server/server.types.js").EggVariable[];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}[];
|
|
58
|
+
meta: {
|
|
59
|
+
pagination: import("../../types.js").Pagination;
|
|
60
|
+
};
|
|
61
|
+
object: "list";
|
|
62
|
+
}>;
|
|
63
|
+
info({ id, external_id, }: {
|
|
64
|
+
id?: number | undefined;
|
|
65
|
+
external_id?: number | undefined;
|
|
66
|
+
}): Promise<{
|
|
67
|
+
attributes: {
|
|
68
|
+
created_at: Date;
|
|
69
|
+
updated_at: Date;
|
|
70
|
+
server_owner: boolean;
|
|
71
|
+
identifier: string;
|
|
72
|
+
internal_id: number;
|
|
73
|
+
uuid: string;
|
|
74
|
+
name: string;
|
|
75
|
+
is_node_under_maintenance: boolean;
|
|
76
|
+
description: string;
|
|
77
|
+
status: null;
|
|
78
|
+
is_suspended: boolean;
|
|
79
|
+
is_installing: boolean;
|
|
80
|
+
is_transferring: boolean;
|
|
81
|
+
node: string;
|
|
82
|
+
sftp_details: {
|
|
83
|
+
ip: string;
|
|
84
|
+
port: number;
|
|
85
|
+
};
|
|
86
|
+
invocation: string;
|
|
87
|
+
docker_image: string;
|
|
88
|
+
egg_features: string[];
|
|
89
|
+
feature_limits: {
|
|
90
|
+
databases: number;
|
|
91
|
+
allocations: number;
|
|
92
|
+
backups: number;
|
|
93
|
+
};
|
|
94
|
+
user_permissions: import("../../client/server/server.types.js").ServerPermissions[];
|
|
95
|
+
limits: {
|
|
96
|
+
memory: number;
|
|
97
|
+
swap: number;
|
|
98
|
+
disk: number;
|
|
99
|
+
io: number;
|
|
100
|
+
cpu: number;
|
|
101
|
+
threads: null | string;
|
|
102
|
+
oom_disabled: boolean;
|
|
103
|
+
};
|
|
104
|
+
relationships: {
|
|
105
|
+
allocations: {
|
|
106
|
+
object: "list";
|
|
107
|
+
data: import("../../client/server/server.types.js").Allocation[];
|
|
108
|
+
};
|
|
109
|
+
variables: {
|
|
110
|
+
object: "list";
|
|
111
|
+
data: import("../../client/server/server.types.js").EggVariable[];
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
object: "server";
|
|
116
|
+
}>;
|
|
117
|
+
create(options: CreateServerArgs): Promise<{
|
|
118
|
+
attributes: {
|
|
119
|
+
created_at: Date;
|
|
120
|
+
updated_at: Date;
|
|
121
|
+
server_owner: boolean;
|
|
122
|
+
identifier: string;
|
|
123
|
+
internal_id: number;
|
|
124
|
+
uuid: string;
|
|
125
|
+
name: string;
|
|
126
|
+
is_node_under_maintenance: boolean;
|
|
127
|
+
description: string;
|
|
128
|
+
status: null;
|
|
129
|
+
is_suspended: boolean;
|
|
130
|
+
is_installing: boolean;
|
|
131
|
+
is_transferring: boolean;
|
|
132
|
+
node: string;
|
|
133
|
+
sftp_details: {
|
|
134
|
+
ip: string;
|
|
135
|
+
port: number;
|
|
136
|
+
};
|
|
137
|
+
invocation: string;
|
|
138
|
+
docker_image: string;
|
|
139
|
+
egg_features: string[];
|
|
140
|
+
feature_limits: {
|
|
141
|
+
databases: number;
|
|
142
|
+
allocations: number;
|
|
143
|
+
backups: number;
|
|
144
|
+
};
|
|
145
|
+
user_permissions: import("../../client/server/server.types.js").ServerPermissions[];
|
|
146
|
+
limits: {
|
|
147
|
+
memory: number;
|
|
148
|
+
swap: number;
|
|
149
|
+
disk: number;
|
|
150
|
+
io: number;
|
|
151
|
+
cpu: number;
|
|
152
|
+
threads: null | string;
|
|
153
|
+
oom_disabled: boolean;
|
|
154
|
+
};
|
|
155
|
+
relationships: {
|
|
156
|
+
allocations: {
|
|
157
|
+
object: "list";
|
|
158
|
+
data: import("../../client/server/server.types.js").Allocation[];
|
|
159
|
+
};
|
|
160
|
+
variables: {
|
|
161
|
+
object: "list";
|
|
162
|
+
data: import("../../client/server/server.types.js").EggVariable[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
object: "server";
|
|
167
|
+
}>;
|
|
168
|
+
edit(server: number, { details, configuration, startup }: EditApplicationServerArgs): Promise<{
|
|
169
|
+
attributes: {
|
|
170
|
+
created_at: Date;
|
|
171
|
+
updated_at: Date;
|
|
172
|
+
server_owner: boolean;
|
|
173
|
+
identifier: string;
|
|
174
|
+
internal_id: number;
|
|
175
|
+
uuid: string;
|
|
176
|
+
name: string;
|
|
177
|
+
is_node_under_maintenance: boolean;
|
|
178
|
+
description: string;
|
|
179
|
+
status: null;
|
|
180
|
+
is_suspended: boolean;
|
|
181
|
+
is_installing: boolean;
|
|
182
|
+
is_transferring: boolean;
|
|
183
|
+
node: string;
|
|
184
|
+
sftp_details: {
|
|
185
|
+
ip: string;
|
|
186
|
+
port: number;
|
|
187
|
+
};
|
|
188
|
+
invocation: string;
|
|
189
|
+
docker_image: string;
|
|
190
|
+
egg_features: string[];
|
|
191
|
+
feature_limits: {
|
|
192
|
+
databases: number;
|
|
193
|
+
allocations: number;
|
|
194
|
+
backups: number;
|
|
195
|
+
};
|
|
196
|
+
user_permissions: import("../../client/server/server.types.js").ServerPermissions[];
|
|
197
|
+
limits: {
|
|
198
|
+
memory: number;
|
|
199
|
+
swap: number;
|
|
200
|
+
disk: number;
|
|
201
|
+
io: number;
|
|
202
|
+
cpu: number;
|
|
203
|
+
threads: null | string;
|
|
204
|
+
oom_disabled: boolean;
|
|
205
|
+
};
|
|
206
|
+
relationships: {
|
|
207
|
+
allocations: {
|
|
208
|
+
object: "list";
|
|
209
|
+
data: import("../../client/server/server.types.js").Allocation[];
|
|
210
|
+
};
|
|
211
|
+
variables: {
|
|
212
|
+
object: "list";
|
|
213
|
+
data: import("../../client/server/server.types.js").EggVariable[];
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
object: "server";
|
|
218
|
+
}>;
|
|
219
|
+
suspend(id: number): Promise<UserServer<UserServerAttributesWithDate<string>>>;
|
|
220
|
+
unsuspend(id: number): Promise<UserServer<UserServerAttributesWithDate<string>>>;
|
|
221
|
+
reinstall(id: number): Promise<UserServer<UserServerAttributesWithDate<string>>>;
|
|
222
|
+
delete(id: number, force?: boolean | undefined): Promise<UserServer<UserServerAttributesWithDate<string>>>;
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=server.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.client.d.ts","sourceRoot":"","sources":["../../../src/application/server/server.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAEV,gBAAgB,EAChB,yBAAyB,EAI1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,YAAY;IAGnB,OAAO,CAAC,UAAU;IAFvB,QAAQ,EAAE,cAAc,CAAC;gBAEZ,UAAU,EAAE,UAAU;IAIpC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeJ,IAAI,CAAC,EACT,EAAE,EACF,WAAW,GACZ,EAAE;QACD,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BK,MAAM,CAAC,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAehC,IAAI,CACR,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2ChE,OAAO,CAAC,EAAE,EAAE,MAAM;IAMlB,SAAS,CAAC,EAAE,EAAE,MAAM;IAMpB,SAAS,CAAC,EAAE,EAAE,MAAM;IAMpB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS;CAK/C"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import DatabaseClient from "./database/database.client.js";
|
|
2
|
+
export default class ServerClient {
|
|
3
|
+
httpClient;
|
|
4
|
+
database;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
this.database = new DatabaseClient(httpClient);
|
|
8
|
+
}
|
|
9
|
+
async list() {
|
|
10
|
+
const res = await this.httpClient.request("GET", "/application/servers");
|
|
11
|
+
return {
|
|
12
|
+
...res,
|
|
13
|
+
data: res.data.map((server) => ({
|
|
14
|
+
...server,
|
|
15
|
+
created_at: new Date(server.created_at),
|
|
16
|
+
updated_at: new Date(server.updated_at),
|
|
17
|
+
})),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async info({ id, external_id, }) {
|
|
21
|
+
if (id) {
|
|
22
|
+
const res = await this.httpClient.request("GET", `/application/servers/${id}`);
|
|
23
|
+
return {
|
|
24
|
+
...res,
|
|
25
|
+
attributes: {
|
|
26
|
+
...res.attributes,
|
|
27
|
+
created_at: new Date(res.attributes.created_at),
|
|
28
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
else if (external_id) {
|
|
33
|
+
const res = await this.httpClient.request("GET", `/application/servers/external/${external_id}`);
|
|
34
|
+
return {
|
|
35
|
+
...res,
|
|
36
|
+
attributes: {
|
|
37
|
+
...res.attributes,
|
|
38
|
+
created_at: new Date(res.attributes.created_at),
|
|
39
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
else
|
|
44
|
+
throw new Error("Vous devez spécifier au moins un des 2 paramètres de recherche d'un utilisateur !");
|
|
45
|
+
}
|
|
46
|
+
async create(options) {
|
|
47
|
+
const res = await this.httpClient.request("POST", `/application/servers`, options);
|
|
48
|
+
return {
|
|
49
|
+
...res,
|
|
50
|
+
attributes: {
|
|
51
|
+
...res.attributes,
|
|
52
|
+
created_at: new Date(res.attributes.created_at),
|
|
53
|
+
updated_at: new Date(res.attributes.updated_at),
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async edit(server, { details, configuration, startup }) {
|
|
58
|
+
const basePath = `/application/servers/${server}`;
|
|
59
|
+
const requests = [];
|
|
60
|
+
if (details)
|
|
61
|
+
requests.push(this.httpClient.request("PATCH", `${basePath}/details`, details));
|
|
62
|
+
if (configuration)
|
|
63
|
+
requests.push(this.httpClient.request("PATCH", `${basePath}/build`, configuration));
|
|
64
|
+
if (startup)
|
|
65
|
+
requests.push(this.httpClient.request("PATCH", `${basePath}/startup`, startup));
|
|
66
|
+
if (requests.length === 0)
|
|
67
|
+
throw new Error("Aucunes modifications spécifiées !");
|
|
68
|
+
const res = await Promise.all(requests);
|
|
69
|
+
return {
|
|
70
|
+
...res[0],
|
|
71
|
+
attributes: {
|
|
72
|
+
...res[0].attributes,
|
|
73
|
+
created_at: new Date(res[0].attributes.created_at),
|
|
74
|
+
updated_at: new Date(res[0].attributes.updated_at),
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
suspend(id) {
|
|
79
|
+
return this.httpClient.request("POST", `/application/servers/${id}/suspend`);
|
|
80
|
+
}
|
|
81
|
+
unsuspend(id) {
|
|
82
|
+
return this.httpClient.request("POST", `/application/servers/${id}/unsuspend`);
|
|
83
|
+
}
|
|
84
|
+
reinstall(id) {
|
|
85
|
+
return this.httpClient.request("POST", `/application/servers/${id}/reinstall`);
|
|
86
|
+
}
|
|
87
|
+
delete(id, force) {
|
|
88
|
+
return this.httpClient.request("DELETE", `/application/servers/${id}${force ? "?force=true" : ""}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { UserServerAttributesWithDate } from "../../client/server/server.types.js";
|
|
2
|
+
import type { BaseArgs, EnvironmentVariable, ListwithPagination } from "../../types.js";
|
|
3
|
+
export interface ApplicationServerList extends ListwithPagination {
|
|
4
|
+
data: UserServerAttributesWithDate<string>[];
|
|
5
|
+
}
|
|
6
|
+
export interface CreateServerArgs extends BaseArgs {
|
|
7
|
+
name: string;
|
|
8
|
+
user: number;
|
|
9
|
+
egg: number;
|
|
10
|
+
limits: {
|
|
11
|
+
memory: number;
|
|
12
|
+
swap: number;
|
|
13
|
+
disk: number;
|
|
14
|
+
cpu: number;
|
|
15
|
+
io: number;
|
|
16
|
+
threads?: string | undefined;
|
|
17
|
+
oom_disabled?: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
feature_limits: {
|
|
20
|
+
databases: number;
|
|
21
|
+
allocations: number;
|
|
22
|
+
backups: number;
|
|
23
|
+
};
|
|
24
|
+
allocation: {
|
|
25
|
+
[key: string]: number | number[];
|
|
26
|
+
default: number;
|
|
27
|
+
additional?: number[];
|
|
28
|
+
};
|
|
29
|
+
docker_image?: string | undefined;
|
|
30
|
+
startup?: string | undefined;
|
|
31
|
+
environment?: Record<EnvironmentVariable, string> | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface EditApplicationServerDetailsArgs extends BaseArgs {
|
|
34
|
+
name: string;
|
|
35
|
+
user: number;
|
|
36
|
+
external_id?: string | undefined;
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface EditApplicationServerConfigurationArgs extends BaseArgs {
|
|
40
|
+
allocation: number;
|
|
41
|
+
memory: number;
|
|
42
|
+
swap: number;
|
|
43
|
+
disk: number;
|
|
44
|
+
io: number;
|
|
45
|
+
cpu: number;
|
|
46
|
+
threads?: string | undefined;
|
|
47
|
+
feature_limits: {
|
|
48
|
+
databases: number;
|
|
49
|
+
backups: number;
|
|
50
|
+
allocations?: number | undefined;
|
|
51
|
+
};
|
|
52
|
+
add_allocations?: number[] | undefined;
|
|
53
|
+
remove_allocations?: number[] | undefined;
|
|
54
|
+
oom_disabled?: boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
export interface EditApplicationServerStartupArgs extends BaseArgs {
|
|
57
|
+
startup: string;
|
|
58
|
+
environment: Record<EnvironmentVariable, string>;
|
|
59
|
+
egg: number;
|
|
60
|
+
image: string;
|
|
61
|
+
skip_scripts: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface EditApplicationServerArgs extends BaseArgs {
|
|
64
|
+
details?: EditApplicationServerDetailsArgs | undefined;
|
|
65
|
+
configuration?: EditApplicationServerConfigurationArgs | undefined;
|
|
66
|
+
startup?: EditApplicationServerStartupArgs | undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=server.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.types.d.ts","sourceRoot":"","sources":["../../../src/application/server/server.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;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AC;IACvE,aAAa,EAAE;QACb,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,UAAU,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;SAC1D,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,QAAQ,CACvB,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,GAAG,yBAAyB,CAC5D,SAAQ,kBAAkB;IAC1B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export type method = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
2
|
-
export
|
|
3
|
-
[key: string]: string | string[] | number | boolean | undefined;
|
|
4
|
-
}
|
|
2
|
+
export type BaseArgs = Record<string, any>;
|
|
5
3
|
export type IP = `${number}.${number}.${number}.${number}`;
|
|
6
4
|
export interface Pagination {
|
|
7
5
|
total: number;
|
|
@@ -21,5 +19,6 @@ export interface ListwithPagination extends List {
|
|
|
21
19
|
pagination: Pagination;
|
|
22
20
|
};
|
|
23
21
|
}
|
|
22
|
+
export type EnvironmentVariable = Uppercase<string>;
|
|
24
23
|
export {};
|
|
25
24
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEjE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEjE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE3C,MAAM,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GAC3E,CAAC,GACD,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAE9B,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,GAChD,MAAM,SAAS,CAAC,GACd,CAAC,EAAE,GACH,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACpB,KAAK,CAAC;AAEV,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI;IAC9C,IAAI,EAAE;QACJ,UAAU,EAAE,UAAU,CAAC;KACxB,CAAC;CACH;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pterodactyl-api-client",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.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",
|
|
@@ -34,6 +34,16 @@
|
|
|
34
34
|
"types": "./dist/application/index.d.ts",
|
|
35
35
|
"import": "./dist/application/index.js",
|
|
36
36
|
"require": "./dist/application/index.cjs"
|
|
37
|
+
},
|
|
38
|
+
"./application/user": {
|
|
39
|
+
"types": "./dist/application/user/index.d.ts",
|
|
40
|
+
"import": "./dist/application/user/index.js",
|
|
41
|
+
"require": "./dist/application/user/index.cjs"
|
|
42
|
+
},
|
|
43
|
+
"./application/server": {
|
|
44
|
+
"types": "./dist/application/server/index.d.ts",
|
|
45
|
+
"import": "./dist/application/server/index.js",
|
|
46
|
+
"require": "./dist/application/server/index.cjs"
|
|
37
47
|
}
|
|
38
48
|
},
|
|
39
49
|
"scripts": {
|