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
package/README.md CHANGED
@@ -20,22 +20,22 @@ npm install pterodactyl-api-client
20
20
  ### ESM
21
21
 
22
22
  ```js
23
- import { PterodactylAPIClient } from "pterodactyl-api-client";
23
+ import { PterodactylAPIClient } from 'pterodactyl-api-client';
24
24
 
25
25
  const client = new PterodactylAPIClient({
26
- baseUrl: "https://panel.example.com",
27
- apiKey: "VOTRE_CLE_API",
26
+ baseUrl: 'https://panel.example.com',
27
+ apiKey: 'VOTRE_CLE_API',
28
28
  });
29
29
  ```
30
30
 
31
31
  ### CommonJS
32
32
 
33
33
  ```js
34
- const { PterodactylAPIClient } = require("pterodactyl-api-client");
34
+ const { PterodactylAPIClient } = require('pterodactyl-api-client');
35
35
 
36
36
  const client = new PterodactylAPIClient({
37
- baseUrl: "https://panel.example.com",
38
- apiKey: "VOTRE_CLE_API",
37
+ baseUrl: 'https://panel.example.com',
38
+ apiKey: 'VOTRE_CLE_API',
39
39
  });
40
40
  ```
41
41
 
@@ -57,7 +57,7 @@ const keys = await client.user.account.apiKey.list();
57
57
  console.log(keys.data);
58
58
 
59
59
  const created = await client.user.account.apiKey.create({
60
- description: "Bot",
60
+ description: 'Bot',
61
61
  });
62
62
  ```
63
63
 
@@ -117,7 +117,7 @@ Les erreurs retournées par l’API sont encapsulées dans une classe d’erreur
117
117
  - erreurs API avec statut HTTP
118
118
 
119
119
  ```js
120
- import { PterodactylAPIError } from "pterodactyl-api-client";
120
+ import { PterodactylAPIError } from 'pterodactyl-api-client';
121
121
 
122
122
  try {
123
123
  const activity = await client.user.servers.activity.list({
@@ -126,10 +126,10 @@ try {
126
126
  });
127
127
  } catch (e) {
128
128
  if (e instanceof PterodactylAPIError) {
129
- console.error("HTTP Status :", e.status);
130
- console.error("Message :", e.message);
131
- console.error("Endpoint :", e.path);
132
- console.error("Contenu de la requête :", e?.body ?? "Aucun");
129
+ console.error('HTTP Status :', e.status);
130
+ console.error('Message :', e.message);
131
+ console.error('Endpoint :', e.path);
132
+ console.error('Contenu de la requête :', e?.body ?? 'Aucun');
133
133
  }
134
134
  }
135
- ```
135
+ ```
@@ -1,15 +1,15 @@
1
- import LocationClient from "./location/location.client.js";
2
- import LocationsClient from "./locations/locations.client.js";
3
- import NestClient from "./nest/nest.client.js";
4
- import NestsClient from "./nests/nests.client.js";
5
- import NodeClient from "./node/node.client.js";
6
- import NodesClient from "./nodes/nodes.client.js";
7
- import ServerClient from "./server/server.client.js";
8
- import UserClient from "./user/user.client.js";
9
- import UsersClient from "./users/users.client.js";
10
- import ServersClient from "./servers/servers.client.js";
11
- import type { UserId } from "./user/user.types.js";
12
- import type { ApplicationServerId } from "./server/server.types.js";
1
+ import LocationClient from './location/location.client.js';
2
+ import LocationsClient from './locations/locations.client.js';
3
+ import NestClient from './nest/nest.client.js';
4
+ import NestsClient from './nests/nests.client.js';
5
+ import NodeClient from './node/node.client.js';
6
+ import NodesClient from './nodes/nodes.client.js';
7
+ import ServerClient from './server/server.client.js';
8
+ import UserClient from './user/user.client.js';
9
+ import UsersClient from './users/users.client.js';
10
+ import ServersClient from './servers/servers.client.js';
11
+ import type { UserId } from './user/user.types.js';
12
+ import type { ApplicationServerId } from './server/server.types.js';
13
13
  export default class ApplicationAPI {
14
14
  private httpClient;
15
15
  readonly panelUrl: URL;
@@ -1,14 +1,14 @@
1
- import HttpClient from "../class/HttpClient.js";
2
- import LocationClient from "./location/location.client.js";
3
- import LocationsClient from "./locations/locations.client.js";
4
- import NestClient from "./nest/nest.client.js";
5
- import NestsClient from "./nests/nests.client.js";
6
- import NodeClient from "./node/node.client.js";
7
- import NodesClient from "./nodes/nodes.client.js";
8
- import ServerClient from "./server/server.client.js";
9
- import UserClient from "./user/user.client.js";
10
- import UsersClient from "./users/users.client.js";
11
- import ServersClient from "./servers/servers.client.js";
1
+ import HttpClient from '../class/HttpClient.js';
2
+ import LocationClient from './location/location.client.js';
3
+ import LocationsClient from './locations/locations.client.js';
4
+ import NestClient from './nest/nest.client.js';
5
+ import NestsClient from './nests/nests.client.js';
6
+ import NodeClient from './node/node.client.js';
7
+ import NodesClient from './nodes/nodes.client.js';
8
+ import ServerClient from './server/server.client.js';
9
+ import UserClient from './user/user.client.js';
10
+ import UsersClient from './users/users.client.js';
11
+ import ServersClient from './servers/servers.client.js';
12
12
  export default class ApplicationAPI {
13
13
  httpClient;
14
14
  panelUrl;
@@ -1,3 +1,3 @@
1
- export { default as ApplicationAPI } from "./application.client.js";
2
- export * from "./user/user.types.js";
1
+ export { default as ApplicationAPI } from './application.client.js';
2
+ export * from './user/user.types.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { default as ApplicationAPI } from "./application.client.js";
2
- export * from "./user/user.types.js";
1
+ export { default as ApplicationAPI } from './application.client.js';
2
+ export * from './user/user.types.js';
@@ -1,4 +1,4 @@
1
- export { default as Location } from "./location.client.js";
2
- export * from "./location.types.js";
3
- export * from "./location.schemas.js";
1
+ export { default as Location } from './location.client.js';
2
+ export * from './location.types.js';
3
+ export * from './location.schemas.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,3 @@
1
- export { default as Location } from "./location.client.js";
2
- export * from "./location.types.js";
3
- export * from "./location.schemas.js";
1
+ export { default as Location } from './location.client.js';
2
+ export * from './location.types.js';
3
+ export * from './location.schemas.js';
@@ -1,5 +1,5 @@
1
- import type HttpClient from "../../class/HttpClient.js";
2
- import type { EditLocationArgs } from "./location.types.js";
1
+ import type HttpClient from '../../class/HttpClient.js';
2
+ import type { EditLocationArgs } from './location.types.js';
3
3
  export default class LocationClient {
4
4
  private httpClient;
5
5
  readonly id: number;
@@ -1,5 +1,5 @@
1
- import z from "zod";
2
- import { editLocationSchema, locationId } from "./location.schemas.js";
1
+ import z from 'zod';
2
+ import { editLocationSchema, locationId } from './location.schemas.js';
3
3
  export default class LocationClient {
4
4
  httpClient;
5
5
  id;
@@ -8,7 +8,7 @@ export default class LocationClient {
8
8
  this.id = locationId.parse(id);
9
9
  }
10
10
  async info() {
11
- const res = await this.httpClient.request("GET", `/application/locations/${this.id}`);
11
+ const res = await this.httpClient.request('GET', `/application/locations/${this.id}`);
12
12
  return {
13
13
  ...res,
14
14
  attributes: {
@@ -19,7 +19,7 @@ export default class LocationClient {
19
19
  };
20
20
  }
21
21
  async edit(options) {
22
- const res = await this.httpClient.request("PATCH", `/application/locations/${this.id}`, editLocationSchema.parse(options));
22
+ const res = await this.httpClient.request('PATCH', `/application/locations/${this.id}`, editLocationSchema.parse(options));
23
23
  return {
24
24
  ...res,
25
25
  attributes: {
@@ -30,6 +30,6 @@ export default class LocationClient {
30
30
  };
31
31
  }
32
32
  delete() {
33
- return this.httpClient.request("DELETE", `/application/locations/${this.id}`);
33
+ return this.httpClient.request('DELETE', `/application/locations/${this.id}`);
34
34
  }
35
35
  }
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import z from 'zod';
2
2
  export declare const locationId: z.ZodInt;
3
3
  export declare const editLocationSchema: z.ZodObject<{
4
4
  short: z.ZodOptional<z.ZodString>;
@@ -1,5 +1,5 @@
1
- import z from "zod";
2
- import { idSchema } from "../../schemas.js";
1
+ import z from 'zod';
2
+ import { idSchema } from '../../schemas.js';
3
3
  export const locationId = idSchema;
4
4
  export const editLocationSchema = z
5
5
  .object({
@@ -7,6 +7,6 @@ export const editLocationSchema = z
7
7
  long: z.string().min(3).max(191).optional(),
8
8
  })
9
9
  .refine((data) => data.short || data.long, {
10
- message: "Either short or long must be provided",
11
- path: ["short"],
10
+ message: 'Either short or long must be provided',
11
+ path: ['short'],
12
12
  });
@@ -1,6 +1,6 @@
1
- import type { BaseArgs } from "../../types.js";
1
+ import type { BaseArgs } from '../../types.js';
2
2
  export interface Location<T extends Date | string> {
3
- object: "location";
3
+ object: 'location';
4
4
  attributes: {
5
5
  id: number;
6
6
  short: string;
@@ -1,4 +1,4 @@
1
- export { default as Locations } from "./locations.client.js";
2
- export * from "./locations.types.js";
3
- export * from "./locations.schemas.js";
1
+ export { default as Locations } from './locations.client.js';
2
+ export * from './locations.types.js';
3
+ export * from './locations.schemas.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,3 @@
1
- export { default as Locations } from "./locations.client.js";
2
- export * from "./locations.types.js";
3
- export * from "./locations.schemas.js";
1
+ export { default as Locations } from './locations.client.js';
2
+ export * from './locations.types.js';
3
+ export * from './locations.schemas.js';
@@ -1,6 +1,6 @@
1
- import type HttpClient from "../../class/HttpClient.js";
2
- import type { CreateLocationArgs } from "./locations.types.js";
3
- import type { BaseListArgs, Sort } from "../../types.js";
1
+ import type HttpClient from '../../class/HttpClient.js';
2
+ import type { CreateLocationArgs } from './locations.types.js';
3
+ import type { BaseListArgs, Sort } from '../../types.js';
4
4
  export default class LocationsClient {
5
5
  private httpClient;
6
6
  constructor(httpClient: HttpClient);
@@ -1,6 +1,6 @@
1
- import z from "zod";
2
- import { createLocationSchema, listLocationsFilterSchema, } from "./locations.schemas.js";
3
- import buildQueryParams from "../../utils/buildQueryParams.js";
1
+ import z from 'zod';
2
+ import { createLocationSchema, listLocationsFilterSchema, } from './locations.schemas.js';
3
+ import buildQueryParams from '../../utils/buildQueryParams.js';
4
4
  export default class LocationsClient {
5
5
  httpClient;
6
6
  constructor(httpClient) {
@@ -9,7 +9,7 @@ export default class LocationsClient {
9
9
  async list(options = {}) {
10
10
  const filter = listLocationsFilterSchema.optional().parse(options.filter);
11
11
  const queries = buildQueryParams({ ...options, filter });
12
- const res = await this.httpClient.request("GET", `/application/locations?${queries}`);
12
+ const res = await this.httpClient.request('GET', `/application/locations?${queries}`);
13
13
  return {
14
14
  ...res,
15
15
  data: res.data.map((location) => ({
@@ -23,7 +23,7 @@ export default class LocationsClient {
23
23
  };
24
24
  }
25
25
  async create(options) {
26
- const res = await this.httpClient.request("POST", `/application/locations`, createLocationSchema.parse(options));
26
+ const res = await this.httpClient.request('POST', `/application/locations`, createLocationSchema.parse(options));
27
27
  return {
28
28
  ...res,
29
29
  attributes: {
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import z from 'zod';
2
2
  export declare const createLocationSchema: z.ZodObject<{
3
3
  short: z.ZodString;
4
4
  long: z.ZodString;
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import z from 'zod';
2
2
  export const createLocationSchema = z.object({
3
3
  short: z.string().min(3).max(60),
4
4
  long: z.string().min(3).max(191),
@@ -1,5 +1,5 @@
1
- import type { BaseArgs, ListwithPagination } from "../../types.js";
2
- import type { Location } from "../location/location.types.js";
1
+ import type { BaseArgs, ListwithPagination } from '../../types.js';
2
+ import type { Location } from '../location/location.types.js';
3
3
  export interface LocationList extends ListwithPagination {
4
4
  data: Location<string>[];
5
5
  }
@@ -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 EggClient {
3
3
  private httpClient;
4
4
  readonly nest: number;
@@ -1,4 +1,4 @@
1
- import { nestEggId } from "../nest.schemas.js";
1
+ import { nestEggId } from '../nest.schemas.js';
2
2
  export default class EggClient {
3
3
  httpClient;
4
4
  nest;
@@ -9,7 +9,7 @@ export default class EggClient {
9
9
  this.egg = nestEggId.parse(egg);
10
10
  }
11
11
  async info() {
12
- const res = await this.httpClient.request("GET", `/application/nests/${this.nest}/eggs/${this.egg}`);
12
+ const res = await this.httpClient.request('GET', `/application/nests/${this.nest}/eggs/${this.egg}`);
13
13
  return {
14
14
  ...res,
15
15
  attributes: {
@@ -1,5 +1,5 @@
1
1
  export interface Egg<T extends string | Date> {
2
- object: "egg";
2
+ object: 'egg';
3
3
  attributes: {
4
4
  id: number;
5
5
  uuid: string;
@@ -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 EggsClient {
3
3
  private httpClient;
4
4
  readonly nest: number;
@@ -1 +1 @@
1
- {"version":3,"file":"eggs.client.d.ts","sourceRoot":"","sources":["../../../../src/application/nest/eggs/eggs.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,MAAM,CAAC,OAAO,OAAO,UAAU;IACjB,OAAO,CAAC,UAAU;IAAc,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAA7C,UAAU,EAAE,UAAU,EAAW,IAAI,EAAE,MAAM;IAE3D,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcX"}
1
+ {"version":3,"file":"eggs.client.d.ts","sourceRoot":"","sources":["../../../../src/application/nest/eggs/eggs.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,MAAM,CAAC,OAAO,OAAO,UAAU;IAE3B,OAAO,CAAC,UAAU;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM;gBADb,UAAU,EAAE,UAAU,EACrB,IAAI,EAAE,MAAM;IAGjB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcX"}
@@ -6,7 +6,7 @@ export default class EggsClient {
6
6
  this.nest = nest;
7
7
  }
8
8
  async list() {
9
- const res = await this.httpClient.request("GET", `/application/nests/${this.nest}/eggs`);
9
+ const res = await this.httpClient.request('GET', `/application/nests/${this.nest}/eggs`);
10
10
  return {
11
11
  ...res,
12
12
  data: res.data.map((egg) => ({
@@ -1,5 +1,5 @@
1
- import type { List } from "../../../types.js";
2
- import type { Egg } from "../egg/egg.types.js";
1
+ import type { List } from '../../../types.js';
2
+ import type { Egg } from '../egg/egg.types.js';
3
3
  export interface EggList extends List {
4
4
  data: Egg<string>[];
5
5
  }
@@ -1,6 +1,7 @@
1
- export { default as Nest } from "./nest.client.js";
2
- export { default as EggClient } from "./egg/egg.client.js";
3
- export * from "./nest.types.js";
4
- export * from "./egg/egg.types.js";
5
- export * from "./nest.schemas.js";
1
+ export { default as Nest } from './nest.client.js';
2
+ export { default as EggClient } from './egg/egg.client.js';
3
+ export * from './nest.types.js';
4
+ export * from './egg/egg.types.js';
5
+ export * from './eggs/eggs.types.js';
6
+ export * from './nest.schemas.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/nest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE3D,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/nest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE3D,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAErC,cAAc,mBAAmB,CAAC"}
@@ -1,5 +1,6 @@
1
- export { default as Nest } from "./nest.client.js";
2
- export { default as EggClient } from "./egg/egg.client.js";
3
- export * from "./nest.types.js";
4
- export * from "./egg/egg.types.js";
5
- export * from "./nest.schemas.js";
1
+ export { default as Nest } from './nest.client.js';
2
+ export { default as EggClient } from './egg/egg.client.js';
3
+ export * from './nest.types.js';
4
+ export * from './egg/egg.types.js';
5
+ export * from './eggs/eggs.types.js';
6
+ export * from './nest.schemas.js';
@@ -1,8 +1,12 @@
1
- import type HttpClient from "../../class/HttpClient.js";
1
+ import type HttpClient from '../../class/HttpClient.js';
2
+ import EggsClient from './eggs/eggs.client.js';
3
+ import EggClient from './egg/egg.client.js';
2
4
  export default class NestClient {
3
5
  private httpClient;
6
+ eggs: EggsClient;
4
7
  readonly id: number;
5
8
  constructor(httpClient: HttpClient, id: number);
9
+ egg(id: number): EggClient;
6
10
  info(): Promise<{
7
11
  attributes: {
8
12
  created_at: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"nest.client.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAIxD,MAAM,CAAC,OAAO,OAAO,UAAU;IAI3B,OAAO,CAAC,UAAU;IAHpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAGV,UAAU,EAAE,UAAU,EAC9B,EAAE,EAAE,MAAM;IAKN,IAAI;;;;;;;;;;;;CAcX"}
1
+ {"version":3,"file":"nest.client.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAGxD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,UAAU;IAK3B,OAAO,CAAC,UAAU;IAJb,IAAI,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAGV,UAAU,EAAE,UAAU,EAC9B,EAAE,EAAE,MAAM;IAMZ,GAAG,CAAC,EAAE,EAAE,MAAM;IAIR,IAAI;;;;;;;;;;;;CAcX"}
@@ -1,13 +1,20 @@
1
- import { nestId } from "./nest.schemas.js";
1
+ import { nestId } from './nest.schemas.js';
2
+ import EggsClient from './eggs/eggs.client.js';
3
+ import EggClient from './egg/egg.client.js';
2
4
  export default class NestClient {
3
5
  httpClient;
6
+ eggs;
4
7
  id;
5
8
  constructor(httpClient, id) {
6
9
  this.httpClient = httpClient;
7
10
  this.id = nestId.parse(id);
11
+ this.eggs = new EggsClient(httpClient, this.id);
12
+ }
13
+ egg(id) {
14
+ return new EggClient(this.httpClient, this.id, id);
8
15
  }
9
16
  async info() {
10
- const res = await this.httpClient.request("GET", `/application/nests/${this.id}`);
17
+ const res = await this.httpClient.request('GET', `/application/nests/${this.id}`);
11
18
  return {
12
19
  ...res,
13
20
  attributes: {
@@ -1,3 +1,3 @@
1
- import { idSchema } from "../../schemas.js";
1
+ import { idSchema } from '../../schemas.js';
2
2
  export const nestId = idSchema;
3
3
  export const nestEggId = idSchema;
@@ -1,5 +1,5 @@
1
1
  export interface Nest<T extends string | Date> {
2
- object: "nest";
2
+ object: 'nest';
3
3
  attributes: {
4
4
  id: number;
5
5
  uuid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"nest.types.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;KACf,CAAC;CACH"}
1
+ {"version":3,"file":"nest.types.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;KACf,CAAC;CACH"}
@@ -1,3 +1,3 @@
1
- export { default as Nests } from "./nests.client.js";
2
- export * from "./nests.types.js";
1
+ export { default as Nests } from './nests.client.js';
2
+ export * from './nests.types.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { default as Nests } from "./nests.client.js";
2
- export * from "./nests.types.js";
1
+ export { default as Nests } from './nests.client.js';
2
+ export * from './nests.types.js';
@@ -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 NestsClient {
3
3
  private httpClient;
4
4
  constructor(httpClient: HttpClient);
@@ -4,7 +4,7 @@ export default class NestsClient {
4
4
  this.httpClient = httpClient;
5
5
  }
6
6
  async list() {
7
- const res = await this.httpClient.request("GET", "/application/nests");
7
+ const res = await this.httpClient.request('GET', '/application/nests');
8
8
  return {
9
9
  ...res,
10
10
  data: res.data.map((nest) => ({
@@ -1,5 +1,5 @@
1
- import type { ListwithPagination } from "../../types.js";
2
- import type { Nest } from "../nest/nest.types.js";
1
+ import type { ListwithPagination } from '../../types.js';
2
+ import type { Nest } from '../nest/nest.types.js';
3
3
  export interface NestList extends ListwithPagination {
4
4
  data: Nest<string>[];
5
5
  }
@@ -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 AllocationClient {
3
3
  private httpClient;
4
4
  readonly node: number;
@@ -1,4 +1,4 @@
1
- import { allocationId } from "../node.schemas.js";
1
+ import { allocationId } from '../node.schemas.js';
2
2
  export default class AllocationClient {
3
3
  httpClient;
4
4
  node;
@@ -9,6 +9,6 @@ export default class AllocationClient {
9
9
  this.id = allocationId.parse(id);
10
10
  }
11
11
  delete() {
12
- return this.httpClient.request("DELETE", `/application/nodes/${this.node}/allocations/${this.id}`);
12
+ return this.httpClient.request('DELETE', `/application/nodes/${this.node}/allocations/${this.id}`);
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
- import type HttpClient from "../../../class/HttpClient.js";
2
- import type { BaseListArgs, IP } from "../../../types.js";
3
- import type { ApplicationAllocationList, ApplicationAllocationListWithDate, CreateApplicationAllocationArgs } from "./allocations.types.js";
1
+ import type HttpClient from '../../../class/HttpClient.js';
2
+ import type { BaseListArgs, IP } from '../../../types.js';
3
+ import type { ApplicationAllocationList, ApplicationAllocationListWithDate, CreateApplicationAllocationArgs } from './allocations.types.js';
4
4
  export default class AllocationClient {
5
5
  private httpClient;
6
6
  readonly node: number;
@@ -1,5 +1,5 @@
1
- import buildQueryParams from "../../../utils/buildQueryParams.js";
2
- import { listAllocationsFilterSchema } from "../node.schemas.js";
1
+ import buildQueryParams from '../../../utils/buildQueryParams.js';
2
+ import { listAllocationsFilterSchema } from '../node.schemas.js';
3
3
  export default class AllocationClient {
4
4
  httpClient;
5
5
  node;
@@ -10,9 +10,9 @@ export default class AllocationClient {
10
10
  list(options = {}) {
11
11
  const filter = listAllocationsFilterSchema.optional().parse(options.filter);
12
12
  const queries = buildQueryParams({ ...options, filter });
13
- return this.httpClient.request("GET", `/application/nodes/${this.node}/allocations?${queries}`);
13
+ return this.httpClient.request('GET', `/application/nodes/${this.node}/allocations?${queries}`);
14
14
  }
15
15
  create(options) {
16
- return this.httpClient.request("POST", `/application/nodes/${this.node}/allocations`, options);
16
+ return this.httpClient.request('POST', `/application/nodes/${this.node}/allocations`, options);
17
17
  }
18
18
  }
@@ -1,8 +1,8 @@
1
- import type { BaseArgs, IP, List, ListwithPagination } from "../../../types.js";
1
+ import type { BaseArgs, IP, List, ListwithPagination } from '../../../types.js';
2
2
  export type Port = `${number}`;
3
3
  export type PortRange = `${number}-${number}`;
4
4
  export interface ApplicationAllocation {
5
- object: "allocation";
5
+ object: 'allocation';
6
6
  attributes: {
7
7
  id: number;
8
8
  ip: IP;
@@ -1,7 +1,7 @@
1
- export { default as Node } from "./node.client.js";
2
- export { default as AllocationClient } from "./allocation/allocation.client.js";
3
- export { default as AllocationsClient } from "./allocations/allocations.client.js";
4
- export * from "./node.types.js";
5
- export * from "./allocations/allocations.types.js";
6
- export * from "./node.schemas.js";
1
+ export { default as Node } from './node.client.js';
2
+ export { default as AllocationClient } from './allocation/allocation.client.js';
3
+ export { default as AllocationsClient } from './allocations/allocations.client.js';
4
+ export * from './node.types.js';
5
+ export * from './allocations/allocations.types.js';
6
+ export * from './node.schemas.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- export { default as Node } from "./node.client.js";
2
- export { default as AllocationClient } from "./allocation/allocation.client.js";
3
- export { default as AllocationsClient } from "./allocations/allocations.client.js";
4
- export * from "./node.types.js";
5
- export * from "./allocations/allocations.types.js";
6
- export * from "./node.schemas.js";
1
+ export { default as Node } from './node.client.js';
2
+ export { default as AllocationClient } from './allocation/allocation.client.js';
3
+ export { default as AllocationsClient } from './allocations/allocations.client.js';
4
+ export * from './node.types.js';
5
+ export * from './allocations/allocations.types.js';
6
+ export * from './node.schemas.js';