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.
Files changed (203) hide show
  1. package/README.md +13 -13
  2. package/dist/application/application.client.d.ts +12 -12
  3. package/dist/application/application.client.js +11 -11
  4. package/dist/application/index.d.ts +2 -2
  5. package/dist/application/index.js +2 -2
  6. package/dist/application/location/index.d.ts +3 -3
  7. package/dist/application/location/index.js +3 -3
  8. package/dist/application/location/location.client.d.ts +2 -2
  9. package/dist/application/location/location.client.js +5 -5
  10. package/dist/application/location/location.schemas.d.ts +1 -1
  11. package/dist/application/location/location.schemas.js +4 -4
  12. package/dist/application/location/location.types.d.ts +2 -2
  13. package/dist/application/locations/index.d.ts +3 -3
  14. package/dist/application/locations/index.js +3 -3
  15. package/dist/application/locations/locations.client.d.ts +3 -3
  16. package/dist/application/locations/locations.client.js +5 -5
  17. package/dist/application/locations/locations.schemas.d.ts +1 -1
  18. package/dist/application/locations/locations.schemas.js +1 -1
  19. package/dist/application/locations/locations.types.d.ts +2 -2
  20. package/dist/application/nest/egg/egg.client.d.ts +1 -1
  21. package/dist/application/nest/egg/egg.client.js +2 -2
  22. package/dist/application/nest/egg/egg.types.d.ts +1 -1
  23. package/dist/application/nest/eggs/eggs.client.d.ts +1 -1
  24. package/dist/application/nest/eggs/eggs.client.d.ts.map +1 -1
  25. package/dist/application/nest/eggs/eggs.client.js +1 -1
  26. package/dist/application/nest/eggs/eggs.types.d.ts +2 -2
  27. package/dist/application/nest/index.d.ts +6 -5
  28. package/dist/application/nest/index.d.ts.map +1 -1
  29. package/dist/application/nest/index.js +6 -5
  30. package/dist/application/nest/nest.client.d.ts +5 -1
  31. package/dist/application/nest/nest.client.d.ts.map +1 -1
  32. package/dist/application/nest/nest.client.js +9 -2
  33. package/dist/application/nest/nest.schemas.js +1 -1
  34. package/dist/application/nest/nest.types.d.ts +1 -1
  35. package/dist/application/nest/nest.types.d.ts.map +1 -1
  36. package/dist/application/nests/index.d.ts +2 -2
  37. package/dist/application/nests/index.js +2 -2
  38. package/dist/application/nests/nests.client.d.ts +1 -1
  39. package/dist/application/nests/nests.client.js +1 -1
  40. package/dist/application/nests/nests.types.d.ts +2 -2
  41. package/dist/application/node/allocation/allocation.client.d.ts +1 -1
  42. package/dist/application/node/allocation/allocation.client.js +2 -2
  43. package/dist/application/node/allocations/allocations.client.d.ts +3 -3
  44. package/dist/application/node/allocations/allocations.client.js +4 -4
  45. package/dist/application/node/allocations/allocations.types.d.ts +2 -2
  46. package/dist/application/node/index.d.ts +6 -6
  47. package/dist/application/node/index.js +6 -6
  48. package/dist/application/node/node.client.d.ts +5 -5
  49. package/dist/application/node/node.client.js +9 -9
  50. package/dist/application/node/node.schemas.d.ts +1 -1
  51. package/dist/application/node/node.schemas.js +2 -2
  52. package/dist/application/node/node.types.d.ts +1 -1
  53. package/dist/application/nodes/index.d.ts +3 -3
  54. package/dist/application/nodes/index.js +3 -3
  55. package/dist/application/nodes/nodes.client.d.ts +3 -3
  56. package/dist/application/nodes/nodes.client.js +5 -5
  57. package/dist/application/nodes/nodes.schemas.d.ts +1 -1
  58. package/dist/application/nodes/nodes.schemas.js +3 -3
  59. package/dist/application/nodes/nodes.types.d.ts +3 -3
  60. package/dist/application/nodes/nodes.types.d.ts.map +1 -1
  61. package/dist/application/server/database/database.client.d.ts +2 -2
  62. package/dist/application/server/database/database.client.js +4 -4
  63. package/dist/application/server/database/database.types.d.ts +3 -3
  64. package/dist/application/server/database/password/password.client.d.ts +1 -1
  65. package/dist/application/server/database/password/password.client.js +1 -1
  66. package/dist/application/server/databases/databases.client.d.ts +2 -2
  67. package/dist/application/server/databases/databases.client.js +4 -4
  68. package/dist/application/server/databases/databases.types.d.ts +4 -4
  69. package/dist/application/server/index.d.ts +8 -8
  70. package/dist/application/server/index.js +8 -8
  71. package/dist/application/server/server.client.d.ts +4 -4
  72. package/dist/application/server/server.client.js +13 -13
  73. package/dist/application/server/server.schemas.d.ts +1 -1
  74. package/dist/application/server/server.schemas.js +2 -2
  75. package/dist/application/server/server.types.d.ts +1 -1
  76. package/dist/application/servers/index.d.ts +3 -3
  77. package/dist/application/servers/index.js +3 -3
  78. package/dist/application/servers/servers.client.d.ts +3 -3
  79. package/dist/application/servers/servers.client.js +5 -5
  80. package/dist/application/servers/servers.schemas.d.ts +1 -1
  81. package/dist/application/servers/servers.schemas.js +2 -2
  82. package/dist/application/servers/servers.types.d.ts +4 -4
  83. package/dist/application/user/index.d.ts +3 -3
  84. package/dist/application/user/index.js +3 -3
  85. package/dist/application/user/user.client.d.ts +3 -3
  86. package/dist/application/user/user.client.js +6 -6
  87. package/dist/application/user/user.schemas.d.ts +1 -1
  88. package/dist/application/user/user.schemas.js +2 -2
  89. package/dist/application/users/index.d.ts +3 -3
  90. package/dist/application/users/index.js +3 -3
  91. package/dist/application/users/users.client.d.ts +3 -3
  92. package/dist/application/users/users.client.d.ts.map +1 -1
  93. package/dist/application/users/users.client.js +5 -5
  94. package/dist/application/users/users.schemas.d.ts +1 -1
  95. package/dist/application/users/users.schemas.js +1 -1
  96. package/dist/application/users/users.types.d.ts +5 -5
  97. package/dist/class/HttpClient.d.ts +2 -2
  98. package/dist/class/HttpClient.js +3 -3
  99. package/dist/class.d.ts +4 -4
  100. package/dist/class.js +6 -6
  101. package/dist/client/account/a2f/a2f.client.d.ts +3 -3
  102. package/dist/client/account/a2f/a2f.client.js +5 -5
  103. package/dist/client/account/a2f/a2f.types.d.ts +3 -3
  104. package/dist/client/account/account.client.d.ts +8 -8
  105. package/dist/client/account/account.client.js +8 -8
  106. package/dist/client/account/account.schemas.d.ts +1 -1
  107. package/dist/client/account/account.schemas.js +13 -13
  108. package/dist/client/account/account.types.d.ts +2 -2
  109. package/dist/client/account/activity/activity.client.d.ts +5 -5
  110. package/dist/client/account/activity/activity.client.d.ts.map +1 -1
  111. package/dist/client/account/activity/activity.client.js +3 -3
  112. package/dist/client/account/activity/activity.types.d.ts +8 -8
  113. package/dist/client/account/api-key/api-key.client.d.ts +2 -2
  114. package/dist/client/account/api-key/api-key.client.js +4 -4
  115. package/dist/client/account/api-key/api-key.types.d.ts +2 -2
  116. package/dist/client/account/email/email.client.d.ts +2 -2
  117. package/dist/client/account/email/email.client.js +2 -2
  118. package/dist/client/account/email/email.types.d.ts +1 -1
  119. package/dist/client/account/index.d.ts +15 -15
  120. package/dist/client/account/index.js +15 -15
  121. package/dist/client/account/password/password.client.d.ts +2 -2
  122. package/dist/client/account/password/password.client.js +2 -2
  123. package/dist/client/account/password/password.types.d.ts +1 -1
  124. package/dist/client/account/ssh-key/ssh-key.client.d.ts +2 -2
  125. package/dist/client/account/ssh-key/ssh-key.client.js +4 -4
  126. package/dist/client/account/ssh-key/ssh-key.types.d.ts +2 -2
  127. package/dist/client/client.class.d.ts +3 -3
  128. package/dist/client/client.class.js +6 -6
  129. package/dist/client/client.schema.d.ts +1 -1
  130. package/dist/client/client.schema.js +2 -2
  131. package/dist/client/index.d.ts +2 -2
  132. package/dist/client/index.js +2 -2
  133. package/dist/client/server/allocation/allocation.client.d.ts +3 -3
  134. package/dist/client/server/allocation/allocation.client.js +4 -4
  135. package/dist/client/server/allocation.types.d.ts +2 -2
  136. package/dist/client/server/allocations/allocations.client.d.ts +3 -3
  137. package/dist/client/server/allocations/allocations.client.js +3 -3
  138. package/dist/client/server/backup/backup.client.d.ts +3 -3
  139. package/dist/client/server/backup/backup.client.js +6 -6
  140. package/dist/client/server/backup/lock/lock.client.d.ts +1 -1
  141. package/dist/client/server/backup/lock/lock.client.js +1 -1
  142. package/dist/client/server/backup.types.d.ts +3 -3
  143. package/dist/client/server/backups/backups.client.d.ts +2 -2
  144. package/dist/client/server/backups/backups.client.js +3 -3
  145. package/dist/client/server/console/console.client.d.ts +3 -3
  146. package/dist/client/server/console/console.client.js +3 -3
  147. package/dist/client/server/console/console.types.d.ts +2 -2
  148. package/dist/client/server/console/console.types.js +1 -1
  149. package/dist/client/server/console/websocket/websocket.console.client.d.ts +3 -3
  150. package/dist/client/server/console/websocket/websocket.console.client.js +13 -13
  151. package/dist/client/server/console/websocket/websocket.console.types.d.ts +13 -13
  152. package/dist/client/server/database/database.client.d.ts +2 -2
  153. package/dist/client/server/database/database.client.js +3 -3
  154. package/dist/client/server/database/password/password.client.d.ts +1 -1
  155. package/dist/client/server/database/password/password.client.js +1 -1
  156. package/dist/client/server/database.types.d.ts +6 -6
  157. package/dist/client/server/databases/databases.client.d.ts +2 -2
  158. package/dist/client/server/databases/databases.client.js +3 -3
  159. package/dist/client/server/image/image.client.d.ts +2 -2
  160. package/dist/client/server/image/image.client.js +2 -2
  161. package/dist/client/server/image/image.types.d.ts +1 -1
  162. package/dist/client/server/index.d.ts +29 -29
  163. package/dist/client/server/index.js +29 -29
  164. package/dist/client/server/power/power.client.d.ts +1 -1
  165. package/dist/client/server/power/power.client.js +8 -8
  166. package/dist/client/server/power/power.types.d.ts +2 -2
  167. package/dist/client/server/ressource/ressource.client.d.ts +2 -2
  168. package/dist/client/server/ressource/ressource.client.js +1 -1
  169. package/dist/client/server/ressource/ressource.types.d.ts +2 -2
  170. package/dist/client/server/schedule/schedule.client.d.ts +4 -4
  171. package/dist/client/server/schedule/schedule.client.js +7 -7
  172. package/dist/client/server/schedule/schedule.types.d.ts +6 -6
  173. package/dist/client/server/schedule/schedule.types.d.ts.map +1 -1
  174. package/dist/client/server/schedule/task/task.client.d.ts +3 -3
  175. package/dist/client/server/schedule/task/task.client.js +3 -3
  176. package/dist/client/server/schedule/tasks/tasks.client.d.ts +3 -3
  177. package/dist/client/server/schedule/tasks/tasks.client.js +3 -3
  178. package/dist/client/server/schedule/tasks.types.d.ts +3 -3
  179. package/dist/client/server/schedule.types.d.ts +6 -6
  180. package/dist/client/server/schedules/schedules.client.d.ts +2 -2
  181. package/dist/client/server/schedules/schedules.client.js +3 -3
  182. package/dist/client/server/server.client.d.ts +18 -18
  183. package/dist/client/server/server.client.js +22 -22
  184. package/dist/client/server/server.schemas.d.ts +1 -1
  185. package/dist/client/server/server.schemas.js +83 -83
  186. package/dist/client/server/server.types.d.ts +73 -73
  187. package/dist/client/server/startup/startup.client.d.ts +3 -3
  188. package/dist/client/server/startup/startup.client.js +3 -3
  189. package/dist/client/server/startup/startup.types.d.ts +2 -2
  190. package/dist/client/server/subuser/subuser.client.d.ts +4 -4
  191. package/dist/client/server/subuser/subuser.client.js +4 -4
  192. package/dist/client/server/subuser.types.d.ts +4 -4
  193. package/dist/client/server/subusers/subusers.client.d.ts +4 -4
  194. package/dist/client/server/subusers/subusers.client.js +3 -3
  195. package/dist/index.d.ts +5 -5
  196. package/dist/index.js +5 -5
  197. package/dist/schemas.d.ts +1 -1
  198. package/dist/schemas.js +4 -4
  199. package/dist/types.d.ts +6 -6
  200. package/dist/types.d.ts.map +1 -1
  201. package/dist/utils/buildQueryParams.d.ts +1 -1
  202. package/dist/utils/buildQueryParams.js +3 -3
  203. package/package.json +5 -2
@@ -1,10 +1,10 @@
1
- import { editEmailSchema } from "../account.schemas.js";
1
+ import { editEmailSchema } from '../account.schemas.js';
2
2
  export default class EmailClient {
3
3
  httpClient;
4
4
  constructor(httpClient) {
5
5
  this.httpClient = httpClient;
6
6
  }
7
7
  edit(options) {
8
- return this.httpClient.request("PUT", "/client/account/email", editEmailSchema.parse(options));
8
+ return this.httpClient.request('PUT', '/client/account/email', editEmailSchema.parse(options));
9
9
  }
10
10
  }
@@ -1,4 +1,4 @@
1
- import type { EditAcountArgs } from "../account.types.js";
1
+ import type { EditAcountArgs } from '../account.types.js';
2
2
  export interface EditEmailArgs extends EditAcountArgs {
3
3
  email: string;
4
4
  }
@@ -1,16 +1,16 @@
1
- export { default as Account } from "./account.client.js";
2
- export { default as A2fClient } from "./a2f/a2f.client.js";
3
- export { default as ActivityClient } from "./activity/activity.client.js";
4
- export { default as ApiKeyClient } from "./api-key/api-key.client.js";
5
- export { default as EmailClient } from "./email/email.client.js";
6
- export { default as PasswordClient } from "./password/password.client.js";
7
- export { default as SshKeyClient } from "./ssh-key/ssh-key.client.js";
8
- export * from "./account.types.js";
9
- export * from "./a2f/a2f.types.js";
10
- export * from "./activity/activity.types.js";
11
- export * from "./api-key/api-key.types.js";
12
- export * from "./email/email.types.js";
13
- export * from "./password/password.types.js";
14
- export * from "./ssh-key/ssh-key.types.js";
15
- export * from "./account.schemas.js";
1
+ export { default as Account } from './account.client.js';
2
+ export { default as A2fClient } from './a2f/a2f.client.js';
3
+ export { default as ActivityClient } from './activity/activity.client.js';
4
+ export { default as ApiKeyClient } from './api-key/api-key.client.js';
5
+ export { default as EmailClient } from './email/email.client.js';
6
+ export { default as PasswordClient } from './password/password.client.js';
7
+ export { default as SshKeyClient } from './ssh-key/ssh-key.client.js';
8
+ export * from './account.types.js';
9
+ export * from './a2f/a2f.types.js';
10
+ export * from './activity/activity.types.js';
11
+ export * from './api-key/api-key.types.js';
12
+ export * from './email/email.types.js';
13
+ export * from './password/password.types.js';
14
+ export * from './ssh-key/ssh-key.types.js';
15
+ export * from './account.schemas.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1,15 +1,15 @@
1
- export { default as Account } from "./account.client.js";
2
- export { default as A2fClient } from "./a2f/a2f.client.js";
3
- export { default as ActivityClient } from "./activity/activity.client.js";
4
- export { default as ApiKeyClient } from "./api-key/api-key.client.js";
5
- export { default as EmailClient } from "./email/email.client.js";
6
- export { default as PasswordClient } from "./password/password.client.js";
7
- export { default as SshKeyClient } from "./ssh-key/ssh-key.client.js";
8
- export * from "./account.types.js";
9
- export * from "./a2f/a2f.types.js";
10
- export * from "./activity/activity.types.js";
11
- export * from "./api-key/api-key.types.js";
12
- export * from "./email/email.types.js";
13
- export * from "./password/password.types.js";
14
- export * from "./ssh-key/ssh-key.types.js";
15
- export * from "./account.schemas.js";
1
+ export { default as Account } from './account.client.js';
2
+ export { default as A2fClient } from './a2f/a2f.client.js';
3
+ export { default as ActivityClient } from './activity/activity.client.js';
4
+ export { default as ApiKeyClient } from './api-key/api-key.client.js';
5
+ export { default as EmailClient } from './email/email.client.js';
6
+ export { default as PasswordClient } from './password/password.client.js';
7
+ export { default as SshKeyClient } from './ssh-key/ssh-key.client.js';
8
+ export * from './account.types.js';
9
+ export * from './a2f/a2f.types.js';
10
+ export * from './activity/activity.types.js';
11
+ export * from './api-key/api-key.types.js';
12
+ export * from './email/email.types.js';
13
+ export * from './password/password.types.js';
14
+ export * from './ssh-key/ssh-key.types.js';
15
+ export * from './account.schemas.js';
@@ -1,5 +1,5 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { EditPasswordArgs } from "./password.types.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { EditPasswordArgs } from './password.types.js';
3
3
  export default class PasswordClient {
4
4
  private httpClient;
5
5
  constructor(httpClient: HttpClient);
@@ -1,10 +1,10 @@
1
- import { editPasswordSchema } from "../account.schemas.js";
1
+ import { editPasswordSchema } from '../account.schemas.js';
2
2
  export default class PasswordClient {
3
3
  httpClient;
4
4
  constructor(httpClient) {
5
5
  this.httpClient = httpClient;
6
6
  }
7
7
  edit(options) {
8
- return this.httpClient.request("PUT", "/client/account/password", editPasswordSchema.parse(options));
8
+ return this.httpClient.request('PUT', '/client/account/password', editPasswordSchema.parse(options));
9
9
  }
10
10
  }
@@ -1,4 +1,4 @@
1
- import type { BaseArgs } from "../../../types.js";
1
+ import type { BaseArgs } from '../../../types.js';
2
2
  export interface EditPasswordArgs extends BaseArgs {
3
3
  current_password: string;
4
4
  password: string;
@@ -1,5 +1,5 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { CreateSshKeyArgs, DeleteSshKeyArgs } from "./ssh-key.types.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { CreateSshKeyArgs, DeleteSshKeyArgs } from './ssh-key.types.js';
3
3
  export default class SshKeyClient {
4
4
  private httpClient;
5
5
  constructor(httpClient: HttpClient);
@@ -1,11 +1,11 @@
1
- import { createSshKeySchema, deleteSshKeySchema } from "../account.schemas.js";
1
+ import { createSshKeySchema, deleteSshKeySchema } from '../account.schemas.js';
2
2
  export default class SshKeyClient {
3
3
  httpClient;
4
4
  constructor(httpClient) {
5
5
  this.httpClient = httpClient;
6
6
  }
7
7
  async list() {
8
- const res = await this.httpClient.request("GET", "/client/account/ssh-keys");
8
+ const res = await this.httpClient.request('GET', '/client/account/ssh-keys');
9
9
  return {
10
10
  ...res,
11
11
  data: res.data.map((sshKey) => ({
@@ -18,7 +18,7 @@ export default class SshKeyClient {
18
18
  };
19
19
  }
20
20
  async create(options) {
21
- const res = await this.httpClient.request("POST", "/client/account/ssh-keys", createSshKeySchema.parse(options));
21
+ const res = await this.httpClient.request('POST', '/client/account/ssh-keys', createSshKeySchema.parse(options));
22
22
  return {
23
23
  ...res,
24
24
  attributes: {
@@ -28,6 +28,6 @@ export default class SshKeyClient {
28
28
  };
29
29
  }
30
30
  delete(options) {
31
- return this.httpClient.request("POST", `/client/account/ssh-keys/remove`, deleteSshKeySchema.parse(options));
31
+ return this.httpClient.request('POST', `/client/account/ssh-keys/remove`, deleteSshKeySchema.parse(options));
32
32
  }
33
33
  }
@@ -1,6 +1,6 @@
1
- import type { BaseArgs, List } from "../../../types.js";
1
+ import type { BaseArgs, List } from '../../../types.js';
2
2
  export interface SshKey<T> {
3
- object: "ssh_key";
3
+ object: 'ssh_key';
4
4
  attributes: {
5
5
  name: string;
6
6
  fingerprint: string;
@@ -1,6 +1,6 @@
1
- import type { BaseListArgs } from "../types.js";
2
- import { Account } from "./account/index.js";
3
- import { Server, type UserServerList } from "./server/index.js";
1
+ import type { BaseListArgs } from '../types.js';
2
+ import { Account } from './account/index.js';
3
+ import { Server, type UserServerList } from './server/index.js';
4
4
  export default class ClientAPI {
5
5
  private httpClient;
6
6
  readonly panelUrl: URL;
@@ -1,8 +1,8 @@
1
- import HttpClient from "../class/HttpClient.js";
2
- import buildQueryParams from "../utils/buildQueryParams.js";
3
- import { Account } from "./account/index.js";
4
- import { userServerFilterSchema } from "./client.schema.js";
5
- import { Server } from "./server/index.js";
1
+ import HttpClient from '../class/HttpClient.js';
2
+ import buildQueryParams from '../utils/buildQueryParams.js';
3
+ import { Account } from './account/index.js';
4
+ import { userServerFilterSchema } from './client.schema.js';
5
+ import { Server } from './server/index.js';
6
6
  export default class ClientAPI {
7
7
  httpClient;
8
8
  panelUrl;
@@ -18,7 +18,7 @@ export default class ClientAPI {
18
18
  ...options,
19
19
  filter,
20
20
  });
21
- return this.httpClient.request("GET", `/client?${queries}`);
21
+ return this.httpClient.request('GET', `/client?${queries}`);
22
22
  }
23
23
  server(id) {
24
24
  return new Server(this.httpClient, this.panelUrl, id);
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import z from 'zod';
2
2
  export declare const userServerFilterSchema: z.ZodObject<{
3
3
  uuid: z.ZodOptional<z.ZodUUID>;
4
4
  name: z.ZodOptional<z.ZodString>;
@@ -1,5 +1,5 @@
1
- import z from "zod";
2
- import { uuidSchema } from "../schemas.js";
1
+ import z from 'zod';
2
+ import { uuidSchema } from '../schemas.js';
3
3
  export const userServerFilterSchema = z.object({
4
4
  uuid: uuidSchema.optional(),
5
5
  name: z.string().optional(),
@@ -1,3 +1,3 @@
1
- export { default as ClientAPI } from "./client.class.js";
2
- export * from "./client.schema.js";
1
+ export { default as ClientAPI } from './client.class.js';
2
+ export * from './client.schema.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { default as ClientAPI } from "./client.class.js";
2
- export * from "./client.schema.js";
1
+ export { default as ClientAPI } from './client.class.js';
2
+ export * from './client.schema.js';
@@ -1,6 +1,6 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { Allocation } from "../server.types.js";
3
- import type { EditAllocationArgs } from "../allocation.types.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { Allocation } from '../server.types.js';
3
+ import type { EditAllocationArgs } from '../allocation.types.js';
4
4
  export default class AllocationClient {
5
5
  private httpClient;
6
6
  readonly server: string;
@@ -1,4 +1,4 @@
1
- import { allocationId, editAllocationSchema } from "../server.schemas.js";
1
+ import { allocationId, editAllocationSchema } from '../server.schemas.js';
2
2
  export default class AllocationClient {
3
3
  httpClient;
4
4
  server;
@@ -9,12 +9,12 @@ export default class AllocationClient {
9
9
  this.allocation = allocationId.parse(allocation);
10
10
  }
11
11
  setPrimary() {
12
- return this.httpClient.request("POST", `/client/servers/${this.server}/network/allocations/${this.allocation}/primary`);
12
+ return this.httpClient.request('POST', `/client/servers/${this.server}/network/allocations/${this.allocation}/primary`);
13
13
  }
14
14
  edit(options = {}) {
15
- return this.httpClient.request("POST", `/client/servers/${this.server}/network/allocations/${this.allocation}`, editAllocationSchema.parse(options));
15
+ return this.httpClient.request('POST', `/client/servers/${this.server}/network/allocations/${this.allocation}`, editAllocationSchema.parse(options));
16
16
  }
17
17
  delete() {
18
- return this.httpClient.request("DELETE", `/client/servers/${this.server}/network/allocations/${this.allocation}`);
18
+ return this.httpClient.request('DELETE', `/client/servers/${this.server}/network/allocations/${this.allocation}`);
19
19
  }
20
20
  }
@@ -1,5 +1,5 @@
1
- import type { BaseArgs, IP, List } from "../../types.js";
2
- import type { Allocation } from "./server.types.js";
1
+ import type { BaseArgs, IP, List } from '../../types.js';
2
+ import type { Allocation } from './server.types.js';
3
3
  export interface AllocationList extends List {
4
4
  data: Allocation[];
5
5
  }
@@ -1,6 +1,6 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { Allocation } from "../server.types.js";
3
- import type { AllocationList, AssignAllocationArgs } from "../allocation.types.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { Allocation } from '../server.types.js';
3
+ import type { AllocationList, AssignAllocationArgs } from '../allocation.types.js';
4
4
  export default class AllocationsClient {
5
5
  private httpClient;
6
6
  readonly server: string;
@@ -1,4 +1,4 @@
1
- import { assignAllocationSchema } from "../server.schemas.js";
1
+ import { assignAllocationSchema } from '../server.schemas.js';
2
2
  export default class AllocationsClient {
3
3
  httpClient;
4
4
  server;
@@ -7,9 +7,9 @@ export default class AllocationsClient {
7
7
  this.server = server;
8
8
  }
9
9
  list() {
10
- return this.httpClient.request("GET", `/client/servers/${this.server}/network/allocations`);
10
+ return this.httpClient.request('GET', `/client/servers/${this.server}/network/allocations`);
11
11
  }
12
12
  assign(options) {
13
- return this.httpClient.request("POST", `/client/servers/${this.server}/network/allocations`, assignAllocationSchema.parse(options));
13
+ return this.httpClient.request('POST', `/client/servers/${this.server}/network/allocations`, assignAllocationSchema.parse(options));
14
14
  }
15
15
  }
@@ -1,6 +1,6 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { DownloadBackupUrl, RestoreBackupArgs } from "../backup.types.js";
3
- import LockClient from "./lock/lock.client.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { DownloadBackupUrl, RestoreBackupArgs } from '../backup.types.js';
3
+ import LockClient from './lock/lock.client.js';
4
4
  export default class BackupClient {
5
5
  private httpClient;
6
6
  readonly server: string;
@@ -1,5 +1,5 @@
1
- import { restoreBackupSchema, userServerBackupId } from "../server.schemas.js";
2
- import LockClient from "./lock/lock.client.js";
1
+ import { restoreBackupSchema, userServerBackupId } from '../server.schemas.js';
2
+ import LockClient from './lock/lock.client.js';
3
3
  export default class BackupClient {
4
4
  httpClient;
5
5
  server;
@@ -12,7 +12,7 @@ export default class BackupClient {
12
12
  this.lock = new LockClient(httpClient, server, backup);
13
13
  }
14
14
  async info() {
15
- const res = await this.httpClient.request("GET", `/client/servers/${this.server}/backups/${this.backup}`);
15
+ const res = await this.httpClient.request('GET', `/client/servers/${this.server}/backups/${this.backup}`);
16
16
  return {
17
17
  ...res,
18
18
  attributes: {
@@ -25,12 +25,12 @@ export default class BackupClient {
25
25
  };
26
26
  }
27
27
  download() {
28
- return this.httpClient.request("GET", `/client/servers/${this.server}/backups/${this.backup}/download`);
28
+ return this.httpClient.request('GET', `/client/servers/${this.server}/backups/${this.backup}/download`);
29
29
  }
30
30
  delete() {
31
- return this.httpClient.request("DELETE", `/client/servers/${this.server}/backups/${this.backup}`);
31
+ return this.httpClient.request('DELETE', `/client/servers/${this.server}/backups/${this.backup}`);
32
32
  }
33
33
  restore(options = {}) {
34
- return this.httpClient.request("POST", `/client/servers/${this.server}/backups/${this.backup}/restore`, restoreBackupSchema.parse(options));
34
+ return this.httpClient.request('POST', `/client/servers/${this.server}/backups/${this.backup}/restore`, restoreBackupSchema.parse(options));
35
35
  }
36
36
  }
@@ -1,4 +1,4 @@
1
- import type HttpClient from "../../../../class/HttpClient.js";
1
+ import type HttpClient from '../../../../class/HttpClient.js';
2
2
  export default class LockClient {
3
3
  private httpClient;
4
4
  readonly server: string;
@@ -8,6 +8,6 @@ export default class LockClient {
8
8
  this.backup = backup;
9
9
  }
10
10
  toggle() {
11
- return this.httpClient.request("POST", `/client/servers/${this.server}/backups/${this.backup}/lock`);
11
+ return this.httpClient.request('POST', `/client/servers/${this.server}/backups/${this.backup}/lock`);
12
12
  }
13
13
  }
@@ -1,4 +1,4 @@
1
- import type { BaseArgs, List, Pagination, Tuple } from "../../types.js";
1
+ import type { BaseArgs, List, Pagination, Tuple } from '../../types.js';
2
2
  export interface BackupList<N extends number = number> extends List {
3
3
  data: Tuple<Backup<string>, N>;
4
4
  meta: {
@@ -15,13 +15,13 @@ export interface RestoreBackupArgs extends BaseArgs {
15
15
  truncate?: boolean | undefined;
16
16
  }
17
17
  export interface DownloadBackupUrl {
18
- object: "signed_url";
18
+ object: 'signed_url';
19
19
  attributes: {
20
20
  url: string;
21
21
  };
22
22
  }
23
23
  export interface Backup<T extends string | Date> {
24
- object: "backup";
24
+ object: 'backup';
25
25
  attributes: {
26
26
  uuid: string;
27
27
  name: string;
@@ -1,5 +1,5 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { CreateBackupArgs } from "../backup.types.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { CreateBackupArgs } from '../backup.types.js';
3
3
  export default class BackupsClient {
4
4
  private httpClient;
5
5
  readonly server: string;
@@ -1,4 +1,4 @@
1
- import { createBackupSchema } from "../server.schemas.js";
1
+ import { createBackupSchema } from '../server.schemas.js';
2
2
  export default class BackupsClient {
3
3
  httpClient;
4
4
  server;
@@ -7,7 +7,7 @@ export default class BackupsClient {
7
7
  this.server = server;
8
8
  }
9
9
  async list() {
10
- const res = await this.httpClient.request("GET", `/client/servers/${this.server}/backups`);
10
+ const res = await this.httpClient.request('GET', `/client/servers/${this.server}/backups`);
11
11
  return {
12
12
  ...res,
13
13
  data: res.data.map((backup) => ({
@@ -23,7 +23,7 @@ export default class BackupsClient {
23
23
  };
24
24
  }
25
25
  async create(options) {
26
- const res = await this.httpClient.request("POST", `/client/servers/${this.server}/backups`, createBackupSchema.parse(options));
26
+ const res = await this.httpClient.request('POST', `/client/servers/${this.server}/backups`, createBackupSchema.parse(options));
27
27
  return {
28
28
  ...res,
29
29
  attributes: {
@@ -1,6 +1,6 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { SendConsoleCommandArgs } from "./console.types.js";
3
- import WebsocketClient from "./websocket/websocket.console.client.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { SendConsoleCommandArgs } from './console.types.js';
3
+ import WebsocketClient from './websocket/websocket.console.client.js';
4
4
  export default class ConsoleClient {
5
5
  private httpClient;
6
6
  readonly server: string;
@@ -1,5 +1,5 @@
1
- import { userServerCommandSchema } from "../server.schemas.js";
2
- import WebsocketClient from "./websocket/websocket.console.client.js";
1
+ import { userServerCommandSchema } from '../server.schemas.js';
2
+ import WebsocketClient from './websocket/websocket.console.client.js';
3
3
  export default class ConsoleClient {
4
4
  httpClient;
5
5
  server;
@@ -10,6 +10,6 @@ export default class ConsoleClient {
10
10
  this.websocket = new WebsocketClient(httpClient, panelUrl, this.server);
11
11
  }
12
12
  send(options) {
13
- return this.httpClient.request("POST", `/client/servers/${this.server}/command`, userServerCommandSchema.parse(options));
13
+ return this.httpClient.request('POST', `/client/servers/${this.server}/command`, userServerCommandSchema.parse(options));
14
14
  }
15
15
  }
@@ -1,6 +1,6 @@
1
- import type { BaseArgs } from "../../../types.js";
1
+ import type { BaseArgs } from '../../../types.js';
2
2
  export interface SendConsoleCommandArgs extends BaseArgs {
3
3
  command: string;
4
4
  }
5
- export * from "./websocket/websocket.console.types.js";
5
+ export * from './websocket/websocket.console.types.js';
6
6
  //# sourceMappingURL=console.types.d.ts.map
@@ -1 +1 @@
1
- export * from "./websocket/websocket.console.types.js";
1
+ export * from './websocket/websocket.console.types.js';
@@ -1,6 +1,6 @@
1
- import HttpClient from "../../../../class/HttpClient.js";
2
- import type { WebSocketCredentials, WebSocketCredentialsOptions } from "./websocket.console.types.js";
3
- import type { Signal } from "../../server.types.js";
1
+ import HttpClient from '../../../../class/HttpClient.js';
2
+ import type { WebSocketCredentials, WebSocketCredentialsOptions } from './websocket.console.types.js';
3
+ import type { Signal } from '../../server.types.js';
4
4
  export default class WebsocketClient {
5
5
  private httpClient;
6
6
  private panelUrl;
@@ -1,6 +1,6 @@
1
- import HttpClient from "../../../../class/HttpClient.js";
2
- import WebSocket from "ws";
3
- import { userServerWebsocketSchema } from "../../server.schemas.js";
1
+ import HttpClient from '../../../../class/HttpClient.js';
2
+ import WebSocket from 'ws';
3
+ import { userServerWebsocketSchema } from '../../server.schemas.js';
4
4
  export default class WebsocketClient {
5
5
  httpClient;
6
6
  panelUrl;
@@ -11,7 +11,7 @@ export default class WebsocketClient {
11
11
  this.server = server;
12
12
  }
13
13
  credentials() {
14
- return this.httpClient.request("GET", `/client/servers/${this.server}/websocket`);
14
+ return this.httpClient.request('GET', `/client/servers/${this.server}/websocket`);
15
15
  }
16
16
  async connect(options = {}) {
17
17
  const { onConsoleOutput, onStats, onStatusChange } = userServerWebsocketSchema.parse(options);
@@ -22,38 +22,38 @@ export default class WebsocketClient {
22
22
  Origin: this.panelUrl.origin,
23
23
  },
24
24
  });
25
- socket.addEventListener("open", () => {
25
+ socket.addEventListener('open', () => {
26
26
  socket.send(JSON.stringify({
27
- event: "auth",
27
+ event: 'auth',
28
28
  args: [credentials.data.token],
29
29
  }));
30
- socket.addEventListener("message", async (event) => {
30
+ socket.addEventListener('message', async (event) => {
31
31
  const data = JSON.parse(event.data.toString());
32
- if (data.event === "stats" && onStats)
32
+ if (data.event === 'stats' && onStats)
33
33
  await onStats(JSON.parse(data.args[0]));
34
- if (data.event === "status" && onStatusChange)
34
+ if (data.event === 'status' && onStatusChange)
35
35
  await onStatusChange(data.args[0]);
36
- if (data.event === "console output" && onConsoleOutput)
36
+ if (data.event === 'console output' && onConsoleOutput)
37
37
  await onConsoleOutput(data.args[0]);
38
38
  });
39
39
  setTimeout(() => {
40
40
  resolve({
41
41
  sendCommand(command) {
42
42
  socket.send(JSON.stringify({
43
- event: "send command",
43
+ event: 'send command',
44
44
  args: [command],
45
45
  }));
46
46
  },
47
47
  sendSignal(state) {
48
48
  socket.send(JSON.stringify({
49
- event: "set state",
49
+ event: 'set state',
50
50
  args: [state],
51
51
  }));
52
52
  },
53
53
  });
54
54
  }, 1000);
55
55
  });
56
- socket.addEventListener("error", (err) => {
56
+ socket.addEventListener('error', (err) => {
57
57
  reject(err);
58
58
  });
59
59
  });
@@ -1,4 +1,4 @@
1
- import type { State } from "../../server.types.js";
1
+ import type { State } from '../../server.types.js';
2
2
  export interface WebSocketCredentials {
3
3
  data: {
4
4
  token: string;
@@ -22,23 +22,23 @@ export interface ServerStats {
22
22
  state: State;
23
23
  uptime: number;
24
24
  }
25
- export type ServerStatsString = `{
26
- cpu_absolute: ${number};
27
- disk_bytes: ${number};
28
- memory_bytes: ${number};
29
- memory_limit_bytes: ${number};
30
- network: { rx_bytes: ${number}; tx_bytes: ${number} };
31
- state: ${State};
32
- uptime: ${number};
25
+ export type ServerStatsString = `{
26
+ cpu_absolute: ${number};
27
+ disk_bytes: ${number};
28
+ memory_bytes: ${number};
29
+ memory_limit_bytes: ${number};
30
+ network: { rx_bytes: ${number}; tx_bytes: ${number} };
31
+ state: ${State};
32
+ uptime: ${number};
33
33
  }`;
34
- export type WebSocketEvent = "auth success" | "status" | "stats" | "console output";
34
+ export type WebSocketEvent = 'auth success' | 'status' | 'stats' | 'console output';
35
35
  export type WebSocketMessage = {
36
- event: "auth success";
36
+ event: 'auth success';
37
37
  } | {
38
- event: "stats";
38
+ event: 'stats';
39
39
  args: [ServerStatsString];
40
40
  } | {
41
- event: "status" | "console output";
41
+ event: 'status' | 'console output';
42
42
  args: [State];
43
43
  };
44
44
  //# sourceMappingURL=websocket.console.types.d.ts.map
@@ -1,5 +1,5 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import PasswordClient from "./password/password.client.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import PasswordClient from './password/password.client.js';
3
3
  export default class DatabaseClient {
4
4
  private httpClient;
5
5
  readonly server: string;
@@ -1,5 +1,5 @@
1
- import { userServerDatabaseId } from "../server.schemas.js";
2
- import PasswordClient from "./password/password.client.js";
1
+ import { userServerDatabaseId } from '../server.schemas.js';
2
+ import PasswordClient from './password/password.client.js';
3
3
  export default class DatabaseClient {
4
4
  httpClient;
5
5
  server;
@@ -12,6 +12,6 @@ export default class DatabaseClient {
12
12
  this.database = userServerDatabaseId.parse(database);
13
13
  }
14
14
  delete() {
15
- return this.httpClient.request("DELETE", `/client/servers/${this.server}/databases/${this.database}`);
15
+ return this.httpClient.request('DELETE', `/client/servers/${this.server}/databases/${this.database}`);
16
16
  }
17
17
  }