pterodactyl-api-client 3.3.1 → 3.4.1
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/README.md +13 -13
- package/dist/application/application.client.d.ts +12 -12
- package/dist/application/application.client.js +11 -11
- package/dist/application/index.d.ts +2 -2
- package/dist/application/index.js +2 -2
- package/dist/application/location/index.d.ts +3 -3
- package/dist/application/location/index.js +3 -3
- package/dist/application/location/location.client.d.ts +2 -2
- package/dist/application/location/location.client.js +5 -5
- package/dist/application/location/location.schemas.d.ts +1 -1
- package/dist/application/location/location.schemas.js +4 -4
- package/dist/application/location/location.types.d.ts +2 -2
- package/dist/application/locations/index.d.ts +3 -3
- package/dist/application/locations/index.js +3 -3
- package/dist/application/locations/locations.client.d.ts +3 -3
- package/dist/application/locations/locations.client.js +5 -5
- package/dist/application/locations/locations.schemas.d.ts +1 -1
- package/dist/application/locations/locations.schemas.js +1 -1
- package/dist/application/locations/locations.types.d.ts +2 -2
- package/dist/application/nest/egg/egg.client.d.ts +1 -1
- package/dist/application/nest/egg/egg.client.js +2 -2
- package/dist/application/nest/egg/egg.types.d.ts +1 -1
- package/dist/application/nest/eggs/eggs.client.d.ts +1 -1
- package/dist/application/nest/eggs/eggs.client.d.ts.map +1 -1
- package/dist/application/nest/eggs/eggs.client.js +1 -1
- package/dist/application/nest/eggs/eggs.types.d.ts +2 -2
- package/dist/application/nest/index.d.ts +6 -5
- package/dist/application/nest/index.d.ts.map +1 -1
- package/dist/application/nest/index.js +6 -5
- package/dist/application/nest/nest.client.d.ts +5 -1
- package/dist/application/nest/nest.client.d.ts.map +1 -1
- package/dist/application/nest/nest.client.js +9 -2
- package/dist/application/nest/nest.schemas.js +1 -1
- package/dist/application/nest/nest.types.d.ts +1 -1
- package/dist/application/nest/nest.types.d.ts.map +1 -1
- package/dist/application/nests/index.d.ts +2 -2
- package/dist/application/nests/index.js +2 -2
- package/dist/application/nests/nests.client.d.ts +1 -1
- package/dist/application/nests/nests.client.js +1 -1
- package/dist/application/nests/nests.types.d.ts +2 -2
- package/dist/application/node/allocation/allocation.client.d.ts +1 -1
- package/dist/application/node/allocation/allocation.client.js +2 -2
- package/dist/application/node/allocations/allocations.client.d.ts +3 -3
- package/dist/application/node/allocations/allocations.client.js +4 -4
- package/dist/application/node/allocations/allocations.types.d.ts +2 -2
- package/dist/application/node/index.d.ts +6 -6
- package/dist/application/node/index.js +6 -6
- package/dist/application/node/node.client.d.ts +5 -5
- package/dist/application/node/node.client.js +9 -9
- package/dist/application/node/node.schemas.d.ts +1 -1
- package/dist/application/node/node.schemas.js +2 -2
- package/dist/application/node/node.types.d.ts +1 -1
- package/dist/application/nodes/index.d.ts +3 -3
- package/dist/application/nodes/index.js +3 -3
- package/dist/application/nodes/nodes.client.d.ts +3 -3
- package/dist/application/nodes/nodes.client.js +5 -5
- package/dist/application/nodes/nodes.schemas.d.ts +1 -1
- package/dist/application/nodes/nodes.schemas.js +3 -3
- package/dist/application/nodes/nodes.types.d.ts +3 -3
- package/dist/application/nodes/nodes.types.d.ts.map +1 -1
- package/dist/application/server/database/database.client.d.ts +2 -2
- package/dist/application/server/database/database.client.js +4 -4
- package/dist/application/server/database/database.types.d.ts +3 -3
- package/dist/application/server/database/password/password.client.d.ts +1 -1
- package/dist/application/server/database/password/password.client.js +1 -1
- package/dist/application/server/databases/databases.client.d.ts +2 -2
- package/dist/application/server/databases/databases.client.js +4 -4
- package/dist/application/server/databases/databases.types.d.ts +4 -4
- package/dist/application/server/index.d.ts +8 -8
- package/dist/application/server/index.js +8 -8
- package/dist/application/server/server.client.d.ts +4 -4
- package/dist/application/server/server.client.js +13 -13
- package/dist/application/server/server.schemas.d.ts +1 -1
- package/dist/application/server/server.schemas.js +2 -2
- package/dist/application/server/server.types.d.ts +1 -1
- package/dist/application/servers/index.d.ts +3 -3
- package/dist/application/servers/index.js +3 -3
- package/dist/application/servers/servers.client.d.ts +3 -3
- package/dist/application/servers/servers.client.js +5 -5
- package/dist/application/servers/servers.schemas.d.ts +1 -1
- package/dist/application/servers/servers.schemas.js +2 -2
- package/dist/application/servers/servers.types.d.ts +4 -4
- package/dist/application/user/index.d.ts +3 -3
- package/dist/application/user/index.js +3 -3
- package/dist/application/user/user.client.d.ts +3 -3
- package/dist/application/user/user.client.js +6 -6
- package/dist/application/user/user.schemas.d.ts +1 -1
- package/dist/application/user/user.schemas.js +2 -2
- package/dist/application/users/index.d.ts +3 -3
- package/dist/application/users/index.js +3 -3
- package/dist/application/users/users.client.d.ts +3 -3
- package/dist/application/users/users.client.d.ts.map +1 -1
- package/dist/application/users/users.client.js +5 -5
- package/dist/application/users/users.schemas.d.ts +1 -1
- package/dist/application/users/users.schemas.js +1 -1
- package/dist/application/users/users.types.d.ts +5 -5
- package/dist/class/HttpClient.d.ts +2 -2
- package/dist/class/HttpClient.js +3 -3
- package/dist/class.d.ts +4 -4
- package/dist/class.js +6 -6
- package/dist/client/account/a2f/a2f.client.d.ts +3 -3
- package/dist/client/account/a2f/a2f.client.js +5 -5
- package/dist/client/account/a2f/a2f.types.d.ts +3 -3
- package/dist/client/account/account.client.d.ts +8 -8
- package/dist/client/account/account.client.js +8 -8
- package/dist/client/account/account.schemas.d.ts +1 -1
- package/dist/client/account/account.schemas.js +13 -13
- package/dist/client/account/account.types.d.ts +2 -2
- package/dist/client/account/activity/activity.client.d.ts +5 -5
- package/dist/client/account/activity/activity.client.d.ts.map +1 -1
- package/dist/client/account/activity/activity.client.js +3 -3
- package/dist/client/account/activity/activity.types.d.ts +8 -8
- package/dist/client/account/api-key/api-key.client.d.ts +2 -2
- package/dist/client/account/api-key/api-key.client.js +4 -4
- package/dist/client/account/api-key/api-key.types.d.ts +2 -2
- package/dist/client/account/email/email.client.d.ts +2 -2
- package/dist/client/account/email/email.client.js +2 -2
- package/dist/client/account/email/email.types.d.ts +1 -1
- package/dist/client/account/index.d.ts +15 -15
- package/dist/client/account/index.js +15 -15
- package/dist/client/account/password/password.client.d.ts +2 -2
- package/dist/client/account/password/password.client.js +2 -2
- package/dist/client/account/password/password.types.d.ts +1 -1
- package/dist/client/account/ssh-key/ssh-key.client.d.ts +2 -2
- package/dist/client/account/ssh-key/ssh-key.client.js +4 -4
- package/dist/client/account/ssh-key/ssh-key.types.d.ts +2 -2
- package/dist/client/client.class.d.ts +3 -3
- package/dist/client/client.class.js +6 -6
- package/dist/client/client.schema.d.ts +1 -1
- package/dist/client/client.schema.js +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +2 -2
- package/dist/client/server/allocation/allocation.client.d.ts +3 -3
- package/dist/client/server/allocation/allocation.client.js +4 -4
- package/dist/client/server/allocation.types.d.ts +2 -2
- package/dist/client/server/allocations/allocations.client.d.ts +3 -3
- package/dist/client/server/allocations/allocations.client.js +3 -3
- package/dist/client/server/backup/backup.client.d.ts +3 -3
- package/dist/client/server/backup/backup.client.js +6 -6
- package/dist/client/server/backup/lock/lock.client.d.ts +1 -1
- package/dist/client/server/backup/lock/lock.client.js +1 -1
- package/dist/client/server/backup.types.d.ts +3 -3
- package/dist/client/server/backups/backups.client.d.ts +2 -2
- package/dist/client/server/backups/backups.client.js +3 -3
- package/dist/client/server/console/console.client.d.ts +3 -3
- package/dist/client/server/console/console.client.js +3 -3
- package/dist/client/server/console/console.types.d.ts +2 -2
- package/dist/client/server/console/console.types.js +1 -1
- package/dist/client/server/console/websocket/websocket.console.client.d.ts +3 -3
- package/dist/client/server/console/websocket/websocket.console.client.js +13 -13
- package/dist/client/server/console/websocket/websocket.console.types.d.ts +13 -13
- package/dist/client/server/database/database.client.d.ts +2 -2
- package/dist/client/server/database/database.client.js +3 -3
- package/dist/client/server/database/password/password.client.d.ts +1 -1
- package/dist/client/server/database/password/password.client.js +1 -1
- package/dist/client/server/database.types.d.ts +6 -6
- package/dist/client/server/databases/databases.client.d.ts +2 -2
- package/dist/client/server/databases/databases.client.js +3 -3
- package/dist/client/server/image/image.client.d.ts +2 -2
- package/dist/client/server/image/image.client.js +2 -2
- package/dist/client/server/image/image.types.d.ts +1 -1
- package/dist/client/server/index.d.ts +29 -29
- package/dist/client/server/index.js +29 -29
- package/dist/client/server/power/power.client.d.ts +1 -1
- package/dist/client/server/power/power.client.js +8 -8
- package/dist/client/server/power/power.types.d.ts +2 -2
- package/dist/client/server/ressource/ressource.client.d.ts +2 -2
- package/dist/client/server/ressource/ressource.client.js +1 -1
- package/dist/client/server/ressource/ressource.types.d.ts +2 -2
- package/dist/client/server/schedule/schedule.client.d.ts +4 -4
- package/dist/client/server/schedule/schedule.client.js +7 -7
- package/dist/client/server/schedule/schedule.types.d.ts +6 -6
- package/dist/client/server/schedule/schedule.types.d.ts.map +1 -1
- package/dist/client/server/schedule/task/task.client.d.ts +3 -3
- package/dist/client/server/schedule/task/task.client.js +3 -3
- package/dist/client/server/schedule/tasks/tasks.client.d.ts +3 -3
- package/dist/client/server/schedule/tasks/tasks.client.js +3 -3
- package/dist/client/server/schedule/tasks.types.d.ts +3 -3
- package/dist/client/server/schedule.types.d.ts +6 -6
- package/dist/client/server/schedules/schedules.client.d.ts +2 -2
- package/dist/client/server/schedules/schedules.client.js +3 -3
- package/dist/client/server/server.client.d.ts +18 -18
- package/dist/client/server/server.client.js +22 -22
- package/dist/client/server/server.schemas.d.ts +1 -1
- package/dist/client/server/server.schemas.js +83 -83
- package/dist/client/server/server.types.d.ts +73 -73
- package/dist/client/server/startup/startup.client.d.ts +3 -3
- package/dist/client/server/startup/startup.client.js +3 -3
- package/dist/client/server/startup/startup.types.d.ts +2 -2
- package/dist/client/server/subuser/subuser.client.d.ts +4 -4
- package/dist/client/server/subuser/subuser.client.js +4 -4
- package/dist/client/server/subuser.types.d.ts +4 -4
- package/dist/client/server/subusers/subusers.client.d.ts +4 -4
- package/dist/client/server/subusers/subusers.client.js +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +4 -4
- package/dist/types.d.ts +6 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/buildQueryParams.d.ts +1 -1
- package/dist/utils/buildQueryParams.js +3 -3
- package/package.json +5 -2
|
@@ -8,7 +8,7 @@ export default class PasswordClient {
|
|
|
8
8
|
this.database = database;
|
|
9
9
|
}
|
|
10
10
|
async rotate() {
|
|
11
|
-
const res = await this.httpClient.request(
|
|
11
|
+
const res = await this.httpClient.request('POST', `/client/servers/${this.server}/databases/${this.database}/rotate-password`);
|
|
12
12
|
return {
|
|
13
13
|
...res,
|
|
14
14
|
password: res.attributes.relationships.password.attributes.password,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { BaseArgs, IP, List } from
|
|
1
|
+
import type { BaseArgs, IP, List } from '../../types.js';
|
|
2
2
|
export interface DatabaseList extends List {
|
|
3
3
|
data: Database[];
|
|
4
4
|
}
|
|
5
5
|
export interface CreateDatabaseArgs extends BaseArgs {
|
|
6
6
|
database: string;
|
|
7
|
-
remote: string | IP |
|
|
7
|
+
remote: string | IP | '%';
|
|
8
8
|
}
|
|
9
9
|
export interface DatabaseAttributes {
|
|
10
10
|
id: string;
|
|
@@ -14,17 +14,17 @@ export interface DatabaseAttributes {
|
|
|
14
14
|
};
|
|
15
15
|
name: string;
|
|
16
16
|
username: string;
|
|
17
|
-
connections_from: string | IP |
|
|
17
|
+
connections_from: string | IP | '%';
|
|
18
18
|
max_connections: number;
|
|
19
19
|
}
|
|
20
20
|
export interface Database {
|
|
21
|
-
object:
|
|
21
|
+
object: 'server_database';
|
|
22
22
|
attributes: DatabaseAttributes;
|
|
23
23
|
}
|
|
24
24
|
export interface DatabaseAttributesWithPassword extends DatabaseAttributes {
|
|
25
25
|
relationships: {
|
|
26
26
|
password: {
|
|
27
|
-
object:
|
|
27
|
+
object: 'database_password';
|
|
28
28
|
attributes: {
|
|
29
29
|
password: string;
|
|
30
30
|
};
|
|
@@ -32,7 +32,7 @@ export interface DatabaseAttributesWithPassword extends DatabaseAttributes {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export interface DatabaseWithPassword {
|
|
35
|
-
object:
|
|
35
|
+
object: 'server_database';
|
|
36
36
|
attributes: DatabaseAttributesWithPassword;
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=database.types.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import type { CreateDatabaseArgs, DatabaseList } from
|
|
1
|
+
import type HttpClient from '../../../class/HttpClient.js';
|
|
2
|
+
import type { CreateDatabaseArgs, DatabaseList } from '../database.types.js';
|
|
3
3
|
export default class DatabasesClient {
|
|
4
4
|
private httpClient;
|
|
5
5
|
readonly server: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createDatabaseSchema } from
|
|
1
|
+
import { createDatabaseSchema } from '../server.schemas.js';
|
|
2
2
|
export default class DatabasesClient {
|
|
3
3
|
httpClient;
|
|
4
4
|
server;
|
|
@@ -7,10 +7,10 @@ export default class DatabasesClient {
|
|
|
7
7
|
this.server = server;
|
|
8
8
|
}
|
|
9
9
|
list() {
|
|
10
|
-
return this.httpClient.request(
|
|
10
|
+
return this.httpClient.request('GET', `/client/servers/${this.server}/databases`);
|
|
11
11
|
}
|
|
12
12
|
async create(options) {
|
|
13
|
-
const res = await this.httpClient.request(
|
|
13
|
+
const res = await this.httpClient.request('POST', `/client/servers/${this.server}/databases`, createDatabaseSchema.parse(options));
|
|
14
14
|
return {
|
|
15
15
|
...res,
|
|
16
16
|
password: res.attributes.relationships.password.attributes.password,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import type { EditImageArgs } from
|
|
1
|
+
import type HttpClient from '../../../class/HttpClient.js';
|
|
2
|
+
import type { EditImageArgs } from './image.types.js';
|
|
3
3
|
export default class ImageClient {
|
|
4
4
|
private httpClient;
|
|
5
5
|
readonly server: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { editImageSchema } from
|
|
1
|
+
import { editImageSchema } from '../server.schemas.js';
|
|
2
2
|
export default class ImageClient {
|
|
3
3
|
httpClient;
|
|
4
4
|
server;
|
|
@@ -7,6 +7,6 @@ export default class ImageClient {
|
|
|
7
7
|
this.server = server;
|
|
8
8
|
}
|
|
9
9
|
edit(options) {
|
|
10
|
-
return this.httpClient.request(
|
|
10
|
+
return this.httpClient.request('PUT', `/client/servers/${this.server}/settings/docker-image`, editImageSchema.parse(options));
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
export { default as Server } from
|
|
2
|
-
export { default as AllocationClient } from
|
|
3
|
-
export { default as AllocationsClient } from
|
|
4
|
-
export { default as BackupClient } from
|
|
5
|
-
export { default as BackupsClient } from
|
|
6
|
-
export { default as ConsoleClient } from
|
|
7
|
-
export { default as DatabaseClient } from
|
|
8
|
-
export { default as DatabasesClient } from
|
|
9
|
-
export { default as ImageClient } from
|
|
10
|
-
export { default as PowerClient } from
|
|
11
|
-
export { default as RessourceClient } from
|
|
12
|
-
export { default as ScheduleClient } from
|
|
13
|
-
export { default as SchedulesClient } from
|
|
14
|
-
export { default as StartupClient } from
|
|
15
|
-
export { default as SubuserClient } from
|
|
16
|
-
export { default as SubusersClient } from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
1
|
+
export { default as Server } from './server.client.js';
|
|
2
|
+
export { default as AllocationClient } from './allocation/allocation.client.js';
|
|
3
|
+
export { default as AllocationsClient } from './allocations/allocations.client.js';
|
|
4
|
+
export { default as BackupClient } from './backup/backup.client.js';
|
|
5
|
+
export { default as BackupsClient } from './backups/backups.client.js';
|
|
6
|
+
export { default as ConsoleClient } from './console/console.client.js';
|
|
7
|
+
export { default as DatabaseClient } from './database/database.client.js';
|
|
8
|
+
export { default as DatabasesClient } from './databases/databases.client.js';
|
|
9
|
+
export { default as ImageClient } from './image/image.client.js';
|
|
10
|
+
export { default as PowerClient } from './power/power.client.js';
|
|
11
|
+
export { default as RessourceClient } from './ressource/ressource.client.js';
|
|
12
|
+
export { default as ScheduleClient } from './schedule/schedule.client.js';
|
|
13
|
+
export { default as SchedulesClient } from './schedules/schedules.client.js';
|
|
14
|
+
export { default as StartupClient } from './startup/startup.client.js';
|
|
15
|
+
export { default as SubuserClient } from './subuser/subuser.client.js';
|
|
16
|
+
export { default as SubusersClient } from './subusers/subusers.client.js';
|
|
17
|
+
export * from './server.types.js';
|
|
18
|
+
export * from './allocation.types.js';
|
|
19
|
+
export * from './backup.types.js';
|
|
20
|
+
export * from './console/console.types.js';
|
|
21
|
+
export * from './database.types.js';
|
|
22
|
+
export * from './image/image.types.js';
|
|
23
|
+
export * from './power/power.types.js';
|
|
24
|
+
export * from './ressource/ressource.types.js';
|
|
25
|
+
export * from './schedule.types.js';
|
|
26
|
+
export * from './schedule/tasks.types.js';
|
|
27
|
+
export * from './startup/startup.types.js';
|
|
28
|
+
export * from './subuser.types.js';
|
|
29
|
+
export * from './server.schemas.js';
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export { default as Server } from
|
|
2
|
-
export { default as AllocationClient } from
|
|
3
|
-
export { default as AllocationsClient } from
|
|
4
|
-
export { default as BackupClient } from
|
|
5
|
-
export { default as BackupsClient } from
|
|
6
|
-
export { default as ConsoleClient } from
|
|
7
|
-
export { default as DatabaseClient } from
|
|
8
|
-
export { default as DatabasesClient } from
|
|
9
|
-
export { default as ImageClient } from
|
|
10
|
-
export { default as PowerClient } from
|
|
11
|
-
export { default as RessourceClient } from
|
|
12
|
-
export { default as ScheduleClient } from
|
|
13
|
-
export { default as SchedulesClient } from
|
|
14
|
-
export { default as StartupClient } from
|
|
15
|
-
export { default as SubuserClient } from
|
|
16
|
-
export { default as SubusersClient } from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
1
|
+
export { default as Server } from './server.client.js';
|
|
2
|
+
export { default as AllocationClient } from './allocation/allocation.client.js';
|
|
3
|
+
export { default as AllocationsClient } from './allocations/allocations.client.js';
|
|
4
|
+
export { default as BackupClient } from './backup/backup.client.js';
|
|
5
|
+
export { default as BackupsClient } from './backups/backups.client.js';
|
|
6
|
+
export { default as ConsoleClient } from './console/console.client.js';
|
|
7
|
+
export { default as DatabaseClient } from './database/database.client.js';
|
|
8
|
+
export { default as DatabasesClient } from './databases/databases.client.js';
|
|
9
|
+
export { default as ImageClient } from './image/image.client.js';
|
|
10
|
+
export { default as PowerClient } from './power/power.client.js';
|
|
11
|
+
export { default as RessourceClient } from './ressource/ressource.client.js';
|
|
12
|
+
export { default as ScheduleClient } from './schedule/schedule.client.js';
|
|
13
|
+
export { default as SchedulesClient } from './schedules/schedules.client.js';
|
|
14
|
+
export { default as StartupClient } from './startup/startup.client.js';
|
|
15
|
+
export { default as SubuserClient } from './subuser/subuser.client.js';
|
|
16
|
+
export { default as SubusersClient } from './subusers/subusers.client.js';
|
|
17
|
+
export * from './server.types.js';
|
|
18
|
+
export * from './allocation.types.js';
|
|
19
|
+
export * from './backup.types.js';
|
|
20
|
+
export * from './console/console.types.js';
|
|
21
|
+
export * from './database.types.js';
|
|
22
|
+
export * from './image/image.types.js';
|
|
23
|
+
export * from './power/power.types.js';
|
|
24
|
+
export * from './ressource/ressource.types.js';
|
|
25
|
+
export * from './schedule.types.js';
|
|
26
|
+
export * from './schedule/tasks.types.js';
|
|
27
|
+
export * from './startup/startup.types.js';
|
|
28
|
+
export * from './subuser.types.js';
|
|
29
|
+
export * from './server.schemas.js';
|
|
@@ -6,23 +6,23 @@ export default class PowerClient {
|
|
|
6
6
|
this.server = server;
|
|
7
7
|
}
|
|
8
8
|
start() {
|
|
9
|
-
return this.httpClient.request(
|
|
10
|
-
signal:
|
|
9
|
+
return this.httpClient.request('POST', `/client/servers/${this.server}/power`, {
|
|
10
|
+
signal: 'start',
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
stop() {
|
|
14
|
-
return this.httpClient.request(
|
|
15
|
-
signal:
|
|
14
|
+
return this.httpClient.request('POST', `/client/servers/${this.server}/power`, {
|
|
15
|
+
signal: 'stop',
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
restart() {
|
|
19
|
-
return this.httpClient.request(
|
|
20
|
-
signal:
|
|
19
|
+
return this.httpClient.request('POST', `/client/servers/${this.server}/power`, {
|
|
20
|
+
signal: 'restart',
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
kill() {
|
|
24
|
-
return this.httpClient.request(
|
|
25
|
-
signal:
|
|
24
|
+
return this.httpClient.request('POST', `/client/servers/${this.server}/power`, {
|
|
25
|
+
signal: 'kill',
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BaseArgs } from
|
|
2
|
-
import type { Signal } from
|
|
1
|
+
import type { BaseArgs } from '../../../types.js';
|
|
2
|
+
import type { Signal } from '../server.types.js';
|
|
3
3
|
export interface PowerArgs extends BaseArgs {
|
|
4
4
|
signal: Signal;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import type { Stats } from
|
|
1
|
+
import type HttpClient from '../../../class/HttpClient.js';
|
|
2
|
+
import type { Stats } from './ressource.types.js';
|
|
3
3
|
export default class RessourceClient {
|
|
4
4
|
private httpClient;
|
|
5
5
|
readonly server: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import TaskClient from
|
|
3
|
-
import type { CreateScheduleArgs } from
|
|
4
|
-
import TasksClient from
|
|
1
|
+
import type HttpClient from '../../../class/HttpClient.js';
|
|
2
|
+
import TaskClient from './task/task.client.js';
|
|
3
|
+
import type { CreateScheduleArgs } from '../schedule.types.js';
|
|
4
|
+
import TasksClient from './tasks/tasks.client.js';
|
|
5
5
|
export default class ScheduleClient {
|
|
6
6
|
private httpClient;
|
|
7
7
|
readonly server: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createScheduleSchema, userServerScheduleId, } from
|
|
2
|
-
import TaskClient from
|
|
3
|
-
import TasksClient from
|
|
1
|
+
import { createScheduleSchema, userServerScheduleId, } from '../server.schemas.js';
|
|
2
|
+
import TaskClient from './task/task.client.js';
|
|
3
|
+
import TasksClient from './tasks/tasks.client.js';
|
|
4
4
|
export default class ScheduleClient {
|
|
5
5
|
httpClient;
|
|
6
6
|
server;
|
|
@@ -16,7 +16,7 @@ export default class ScheduleClient {
|
|
|
16
16
|
return new TaskClient(this.httpClient, this.server, this.schedule, task);
|
|
17
17
|
}
|
|
18
18
|
async info() {
|
|
19
|
-
const res = await this.httpClient.request(
|
|
19
|
+
const res = await this.httpClient.request('GET', `/client/servers/${this.server}/schedules/${this.schedule}`);
|
|
20
20
|
return {
|
|
21
21
|
...res,
|
|
22
22
|
attributes: {
|
|
@@ -43,12 +43,12 @@ export default class ScheduleClient {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
edit(options) {
|
|
46
|
-
return this.httpClient.request(
|
|
46
|
+
return this.httpClient.request('POST', `/client/servers/${this.server}/schedules/${this.schedule}`, createScheduleSchema.parse(options));
|
|
47
47
|
}
|
|
48
48
|
delete() {
|
|
49
|
-
return this.httpClient.request(
|
|
49
|
+
return this.httpClient.request('DELETE', `/client/servers/${this.server}/schedules/${this.schedule}`);
|
|
50
50
|
}
|
|
51
51
|
execute() {
|
|
52
|
-
return this.httpClient.request(
|
|
52
|
+
return this.httpClient.request('POST', `/client/servers/${this.server}/schedules/${this.schedule}/execute`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { List } from
|
|
2
|
-
import type { Signal, TaskAction } from
|
|
3
|
-
export type CronString =
|
|
1
|
+
import type { List } from '../../../types.js';
|
|
2
|
+
import type { Signal, TaskAction } from '../server.types.js';
|
|
3
|
+
export type CronString = '*' | `${number}` | `*/${number}`;
|
|
4
4
|
export interface ScheduleTask<T extends string | Date, A extends TaskAction = TaskAction> {
|
|
5
|
-
object:
|
|
5
|
+
object: 'schedule_task';
|
|
6
6
|
attributes: {
|
|
7
7
|
id: number;
|
|
8
8
|
sequence_id: number;
|
|
9
9
|
action: A;
|
|
10
|
-
payload: A extends
|
|
10
|
+
payload: A extends 'power' ? Signal : string;
|
|
11
11
|
time_offset: number;
|
|
12
12
|
is_queued: boolean;
|
|
13
13
|
continue_on_failure: boolean;
|
|
@@ -19,7 +19,7 @@ export interface ScheduleTaskList extends List {
|
|
|
19
19
|
data: ScheduleTask<string>[];
|
|
20
20
|
}
|
|
21
21
|
export interface Schedule<T extends string | Date> {
|
|
22
|
-
object:
|
|
22
|
+
object: 'server_schedule';
|
|
23
23
|
attributes: {
|
|
24
24
|
id: number;
|
|
25
25
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.types.d.ts","sourceRoot":"","sources":["../../../../src/client/server/schedule/schedule.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schedule.types.d.ts","sourceRoot":"","sources":["../../../../src/client/server/schedule/schedule.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,MAAM,EAAE,GAAG,KAAK,MAAM,EAAE,CAAC;AAE3D,MAAM,WAAW,YAAY,CAC3B,CAAC,SAAS,MAAM,GAAG,IAAI,EACvB,CAAC,SAAS,UAAU,GAAG,UAAU;IAEjC,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,CAAC,CAAC;QACV,OAAO,EAAE,CAAC,SAAS,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;QAC7C,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;QACnB,mBAAmB,EAAE,OAAO,CAAC;QAC7B,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI;IAC5C,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IAC/C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YACJ,WAAW,EAAE,UAAU,CAAC;YACxB,YAAY,EAAE,UAAU,CAAC;YACzB,KAAK,EAAE,UAAU,CAAC;YAClB,IAAI,EAAE,UAAU,CAAC;YACjB,MAAM,EAAE,UAAU,CAAC;SACpB,CAAC;QACF,SAAS,EAAE,OAAO,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;QACtB,WAAW,EAAE,CAAC,CAAC;QACf,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;QACd,aAAa,EAAE;YACb,KAAK,EAAE,gBAAgB,CAAC;SACzB,CAAC;KACH,CAAC;CACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import type { TaskAction } from
|
|
3
|
-
import type { CreateScheduleTaskArgs } from
|
|
1
|
+
import type HttpClient from '../../../../class/HttpClient.js';
|
|
2
|
+
import type { TaskAction } from '../../server.types.js';
|
|
3
|
+
import type { CreateScheduleTaskArgs } from '../tasks.types.js';
|
|
4
4
|
export default class TaskClient {
|
|
5
5
|
private httpClient;
|
|
6
6
|
readonly server: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTaskSchema, userServerScheduleTaskId, } from
|
|
1
|
+
import { createTaskSchema, userServerScheduleTaskId, } from '../../server.schemas.js';
|
|
2
2
|
export default class TaskClient {
|
|
3
3
|
httpClient;
|
|
4
4
|
server;
|
|
@@ -11,7 +11,7 @@ export default class TaskClient {
|
|
|
11
11
|
this.task = userServerScheduleTaskId.parse(task);
|
|
12
12
|
}
|
|
13
13
|
async edit(options) {
|
|
14
|
-
const res = await this.httpClient.request(
|
|
14
|
+
const res = await this.httpClient.request('POST', `/client/servers/${this.server}/schedules/${this.schedule}/tasks/${this.task}`, createTaskSchema.parse(options));
|
|
15
15
|
return {
|
|
16
16
|
...res,
|
|
17
17
|
attributes: {
|
|
@@ -22,6 +22,6 @@ export default class TaskClient {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
delete() {
|
|
25
|
-
return this.httpClient.request(
|
|
25
|
+
return this.httpClient.request('DELETE', `/client/servers/${this.server}/schedules/${this.schedule}/tasks/${this.task}`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import type { TaskAction } from
|
|
3
|
-
import type { CreateScheduleTaskArgs } from
|
|
1
|
+
import type HttpClient from '../../../../class/HttpClient.js';
|
|
2
|
+
import type { TaskAction } from '../../server.types.js';
|
|
3
|
+
import type { CreateScheduleTaskArgs } from '../tasks.types.js';
|
|
4
4
|
export default class TasksClient {
|
|
5
5
|
private httpClient;
|
|
6
6
|
readonly server: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTaskSchema } from
|
|
1
|
+
import { createTaskSchema } from '../../server.schemas.js';
|
|
2
2
|
export default class TasksClient {
|
|
3
3
|
httpClient;
|
|
4
4
|
server;
|
|
@@ -9,7 +9,7 @@ export default class TasksClient {
|
|
|
9
9
|
this.schedule = schedule;
|
|
10
10
|
}
|
|
11
11
|
async list() {
|
|
12
|
-
const res = await this.httpClient.request(
|
|
12
|
+
const res = await this.httpClient.request('GET', `/client/servers/${this.server}/schedules/${this.schedule}`);
|
|
13
13
|
return {
|
|
14
14
|
...res.attributes.relationships.tasks,
|
|
15
15
|
data: res.attributes.relationships.tasks.data.map((task) => ({
|
|
@@ -23,7 +23,7 @@ export default class TasksClient {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
async create(options) {
|
|
26
|
-
const res = await this.httpClient.request(
|
|
26
|
+
const res = await this.httpClient.request('POST', `/client/servers/${this.server}/schedules/${this.schedule}/tasks`, createTaskSchema.parse(options));
|
|
27
27
|
return {
|
|
28
28
|
...res,
|
|
29
29
|
attributes: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BaseArgs } from
|
|
2
|
-
import type { Signal, TaskAction } from
|
|
1
|
+
import type { BaseArgs } from '../../../types.js';
|
|
2
|
+
import type { Signal, TaskAction } from '../server.types.js';
|
|
3
3
|
export interface CreateScheduleTaskArgs<T extends TaskAction = TaskAction> extends BaseArgs {
|
|
4
4
|
action: T;
|
|
5
|
-
payload: T extends
|
|
5
|
+
payload: T extends 'power' ? Signal : string;
|
|
6
6
|
time_offset: number;
|
|
7
7
|
continue_on_failure?: boolean | undefined;
|
|
8
8
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { BaseArgs, List } from
|
|
2
|
-
import type { Signal, TaskAction } from
|
|
3
|
-
export type CronString =
|
|
1
|
+
import type { BaseArgs, List } from '../../types.js';
|
|
2
|
+
import type { Signal, TaskAction } from './server.types.js';
|
|
3
|
+
export type CronString = '*' | `${number}` | `*/${number}`;
|
|
4
4
|
export interface ScheduleTask<T extends string | Date, A extends TaskAction = TaskAction> {
|
|
5
|
-
object:
|
|
5
|
+
object: 'schedule_task';
|
|
6
6
|
attributes: {
|
|
7
7
|
id: number;
|
|
8
8
|
sequence_id: number;
|
|
9
9
|
action: A;
|
|
10
|
-
payload: A extends
|
|
10
|
+
payload: A extends 'power' ? Signal : string;
|
|
11
11
|
time_offset: number;
|
|
12
12
|
is_queued: boolean;
|
|
13
13
|
continue_on_failure: boolean;
|
|
@@ -19,7 +19,7 @@ export interface ScheduleTaskList extends List {
|
|
|
19
19
|
data: ScheduleTask<string>[];
|
|
20
20
|
}
|
|
21
21
|
export interface Schedule<T extends string | Date> {
|
|
22
|
-
object:
|
|
22
|
+
object: 'server_schedule';
|
|
23
23
|
attributes: {
|
|
24
24
|
id: number;
|
|
25
25
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type HttpClient from
|
|
2
|
-
import type { CreateScheduleArgs } from
|
|
1
|
+
import type HttpClient from '../../../class/HttpClient.js';
|
|
2
|
+
import type { CreateScheduleArgs } from '../schedule.types.js';
|
|
3
3
|
export default class SchedulesClient {
|
|
4
4
|
private httpClient;
|
|
5
5
|
readonly server: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createScheduleSchema } from
|
|
1
|
+
import { createScheduleSchema } from '../server.schemas.js';
|
|
2
2
|
export default class SchedulesClient {
|
|
3
3
|
httpClient;
|
|
4
4
|
server;
|
|
@@ -7,7 +7,7 @@ export default class SchedulesClient {
|
|
|
7
7
|
this.server = server;
|
|
8
8
|
}
|
|
9
9
|
async list() {
|
|
10
|
-
const res = await this.httpClient.request(
|
|
10
|
+
const res = await this.httpClient.request('GET', `/client/servers/${this.server}/schedules`);
|
|
11
11
|
return {
|
|
12
12
|
...res,
|
|
13
13
|
data: res.data.map((schedule) => ({
|
|
@@ -38,7 +38,7 @@ export default class SchedulesClient {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
async create(options) {
|
|
41
|
-
const res = await this.httpClient.request(
|
|
41
|
+
const res = await this.httpClient.request('POST', `/client/servers/${this.server}/schedules`, createScheduleSchema.parse(options));
|
|
42
42
|
return {
|
|
43
43
|
...res,
|
|
44
44
|
attributes: {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import HttpClient from
|
|
2
|
-
import type { BaseListArgs, Sort } from
|
|
3
|
-
import AllocationClient from
|
|
4
|
-
import AllocationsClient from
|
|
5
|
-
import BackupClient from
|
|
6
|
-
import BackupsClient from
|
|
7
|
-
import ConsoleClient from
|
|
8
|
-
import DatabaseClient from
|
|
9
|
-
import DatabasesClient from
|
|
10
|
-
import ImageClient from
|
|
11
|
-
import PowerClient from
|
|
12
|
-
import RessourceClient from
|
|
13
|
-
import ScheduleClient from
|
|
14
|
-
import SchedulesClient from
|
|
15
|
-
import type { EditServerArgs, ServerEvent, ServerActivityList, UserServerWithDetails } from
|
|
16
|
-
import StartupClient from
|
|
17
|
-
import SubuserClient from
|
|
18
|
-
import SubusersClient from
|
|
1
|
+
import HttpClient from '../../class/HttpClient.js';
|
|
2
|
+
import type { BaseListArgs, Sort } from '../../types.js';
|
|
3
|
+
import AllocationClient from './allocation/allocation.client.js';
|
|
4
|
+
import AllocationsClient from './allocations/allocations.client.js';
|
|
5
|
+
import BackupClient from './backup/backup.client.js';
|
|
6
|
+
import BackupsClient from './backups/backups.client.js';
|
|
7
|
+
import ConsoleClient from './console/console.client.js';
|
|
8
|
+
import DatabaseClient from './database/database.client.js';
|
|
9
|
+
import DatabasesClient from './databases/databases.client.js';
|
|
10
|
+
import ImageClient from './image/image.client.js';
|
|
11
|
+
import PowerClient from './power/power.client.js';
|
|
12
|
+
import RessourceClient from './ressource/ressource.client.js';
|
|
13
|
+
import ScheduleClient from './schedule/schedule.client.js';
|
|
14
|
+
import SchedulesClient from './schedules/schedules.client.js';
|
|
15
|
+
import type { EditServerArgs, ServerEvent, ServerActivityList, UserServerWithDetails } from './server.types.js';
|
|
16
|
+
import StartupClient from './startup/startup.client.js';
|
|
17
|
+
import SubuserClient from './subuser/subuser.client.js';
|
|
18
|
+
import SubusersClient from './subusers/subusers.client.js';
|
|
19
19
|
export default class Servers {
|
|
20
20
|
private httpClient;
|
|
21
21
|
readonly panelUrl: URL;
|