pterodactyl-api-client 2.9.0 → 2.10.2

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 (48) hide show
  1. package/dist/application/index.d.ts +1 -2
  2. package/dist/application/index.d.ts.map +1 -1
  3. package/dist/application/index.js +1 -2
  4. package/dist/application/location/index.d.ts +1 -0
  5. package/dist/application/location/index.d.ts.map +1 -1
  6. package/dist/application/location/index.js +1 -0
  7. package/dist/application/location/location.schemas.d.ts +1 -1
  8. package/dist/application/location/location.schemas.d.ts.map +1 -1
  9. package/dist/application/location/location.schemas.js +2 -1
  10. package/dist/application/nest/index.d.ts +1 -0
  11. package/dist/application/nest/index.d.ts.map +1 -1
  12. package/dist/application/nest/index.js +1 -0
  13. package/dist/application/nest/nest.schemas.d.ts +2 -3
  14. package/dist/application/nest/nest.schemas.d.ts.map +1 -1
  15. package/dist/application/nest/nest.schemas.js +3 -3
  16. package/dist/application/node/index.d.ts +1 -0
  17. package/dist/application/node/index.d.ts.map +1 -1
  18. package/dist/application/node/index.js +1 -0
  19. package/dist/application/node/node.schemas.d.ts +9 -9
  20. package/dist/application/node/node.schemas.d.ts.map +1 -1
  21. package/dist/application/node/node.schemas.js +12 -11
  22. package/dist/application/server/server.schemas.d.ts +28 -28
  23. package/dist/application/server/server.schemas.d.ts.map +1 -1
  24. package/dist/application/server/server.schemas.js +32 -31
  25. package/dist/application/user/index.d.ts +1 -0
  26. package/dist/application/user/index.d.ts.map +1 -1
  27. package/dist/application/user/index.js +1 -0
  28. package/dist/application/user/user.client.d.ts.map +1 -1
  29. package/dist/application/user/user.client.js +6 -25
  30. package/dist/application/user/user.schemas.d.ts +14 -0
  31. package/dist/application/user/user.schemas.d.ts.map +1 -0
  32. package/dist/application/user/user.schemas.js +14 -0
  33. package/dist/class.d.ts +1 -1
  34. package/dist/class.d.ts.map +1 -1
  35. package/dist/class.js +1 -1
  36. package/dist/client/server/index.d.ts +1 -0
  37. package/dist/client/server/index.d.ts.map +1 -1
  38. package/dist/client/server/index.js +1 -0
  39. package/dist/client/server/server.schemas.d.ts +14 -14
  40. package/dist/client/server/server.schemas.d.ts.map +1 -1
  41. package/dist/client/server/server.schemas.js +15 -12
  42. package/dist/common.schemas.d.ts +14 -0
  43. package/dist/common.schemas.d.ts.map +1 -0
  44. package/dist/common.schemas.js +15 -0
  45. package/dist/schemas.d.ts +5 -0
  46. package/dist/schemas.d.ts.map +1 -1
  47. package/dist/schemas.js +5 -0
  48. package/package.json +1 -1
@@ -1,4 +1,3 @@
1
- export { default as Application } from "./application.client.js";
2
- export { default as UserClient } from "./user/user.client.js";
1
+ export { default as ApplicationAPI } from "./application.client.js";
3
2
  export * from "./user/user.types.js";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE9D,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,cAAc,sBAAsB,CAAC"}
@@ -1,3 +1,2 @@
1
- export { default as Application } from "./application.client.js";
2
- export { default as UserClient } from "./user/user.client.js";
1
+ export { default as ApplicationAPI } from "./application.client.js";
3
2
  export * from "./user/user.types.js";
@@ -1,3 +1,4 @@
1
1
  export { default as Location } from "./location.client.js";
2
2
  export * from "./location.types.js";
3
+ export * from "./location.schemas.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/location/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/location/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,cAAc,qBAAqB,CAAC;AAEpC,cAAc,uBAAuB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { default as Location } from "./location.client.js";
2
2
  export * from "./location.types.js";
3
+ export * from "./location.schemas.js";
@@ -1,5 +1,5 @@
1
1
  import z from "zod";
2
- export declare const locationId: z.ZodNumber;
2
+ export declare const locationId: z.ZodInt;
3
3
  export declare const createLocationSchema: z.ZodObject<{
4
4
  short: z.ZodString;
5
5
  long: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"location.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/location/location.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,eAAO,MAAM,oBAAoB;;;mBAG/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;mBAQ3B,CAAC"}
1
+ {"version":3,"file":"location.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/location/location.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,UAAU,UAAW,CAAC;AAEnC,eAAO,MAAM,oBAAoB;;;mBAG/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;mBAQ3B,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import z from "zod";
2
- export const locationId = z.number();
2
+ import { idSchema } from "../../schemas.js";
3
+ export const locationId = idSchema;
3
4
  export const createLocationSchema = z.object({
4
5
  short: z.string().min(3).max(60),
5
6
  long: z.string().min(3).max(191),
@@ -2,4 +2,5 @@ export { default as Nest } from "./nest.client.js";
2
2
  export { default as EggClient } from "./egg/egg.client.js";
3
3
  export * from "./nest.types.js";
4
4
  export * from "./egg/egg.types.js";
5
+ export * from "./nest.schemas.js";
5
6
  //# 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"}
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"}
@@ -2,3 +2,4 @@ export { default as Nest } from "./nest.client.js";
2
2
  export { default as EggClient } from "./egg/egg.client.js";
3
3
  export * from "./nest.types.js";
4
4
  export * from "./egg/egg.types.js";
5
+ export * from "./nest.schemas.js";
@@ -1,4 +1,3 @@
1
- import z from "zod";
2
- export declare const nestId: z.ZodNumber;
3
- export declare const nestEggId: z.ZodNumber;
1
+ export declare const nestId: import("zod").ZodInt;
2
+ export declare const nestEggId: import("zod").ZodInt;
4
3
  //# sourceMappingURL=nest.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nest.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,MAAM,aAAa,CAAC;AACjC,eAAO,MAAM,SAAS,aAAa,CAAC"}
1
+ {"version":3,"file":"nest.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/nest/nest.schemas.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,sBAAW,CAAC;AAC/B,eAAO,MAAM,SAAS,sBAAW,CAAC"}
@@ -1,3 +1,3 @@
1
- import z from "zod";
2
- export const nestId = z.number();
3
- export const nestEggId = z.number();
1
+ import { idSchema } from "../../schemas.js";
2
+ export const nestId = idSchema;
3
+ export const nestEggId = idSchema;
@@ -2,4 +2,5 @@ export { default as Node } from "./node.client.js";
2
2
  export { default as AllocationClient } from "./allocation/allocation.client.js";
3
3
  export * from "./node.types.js";
4
4
  export * from "./allocation/allocation.types.js";
5
+ export * from "./node.schemas.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,cAAc,iBAAiB,CAAC;AAChC,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,cAAc,iBAAiB,CAAC;AAChC,cAAc,kCAAkC,CAAC;AAEjD,cAAc,mBAAmB,CAAC"}
@@ -2,3 +2,4 @@ export { default as Node } from "./node.client.js";
2
2
  export { default as AllocationClient } from "./allocation/allocation.client.js";
3
3
  export * from "./node.types.js";
4
4
  export * from "./allocation/allocation.types.js";
5
+ export * from "./node.schemas.js";
@@ -1,9 +1,9 @@
1
1
  import z from "zod";
2
- export declare const nodeId: z.ZodNumber;
2
+ export declare const nodeId: z.ZodInt;
3
3
  export declare const createNodeSchema: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  description: z.ZodOptional<z.ZodString>;
6
- location_id: z.ZodNumber;
6
+ location_id: z.ZodInt;
7
7
  fqdn: z.ZodString;
8
8
  scheme: z.ZodEnum<{
9
9
  https: "https";
@@ -12,13 +12,13 @@ export declare const createNodeSchema: z.ZodObject<{
12
12
  behind_proxy: z.ZodOptional<z.ZodBoolean>;
13
13
  public: z.ZodOptional<z.ZodBoolean>;
14
14
  daemon_base: z.ZodOptional<z.ZodString>;
15
- daemon_sftp: z.ZodNumber;
16
- daemon_listen: z.ZodNumber;
17
- memory: z.ZodNumber;
18
- memory_overallocate: z.ZodNumber;
19
- disk: z.ZodNumber;
20
- disk_overallocate: z.ZodNumber;
21
- upload_size: z.ZodOptional<z.ZodNumber>;
15
+ daemon_sftp: z.ZodInt;
16
+ daemon_listen: z.ZodInt;
17
+ memory: z.ZodInt;
18
+ memory_overallocate: z.ZodInt;
19
+ disk: z.ZodInt;
20
+ disk_overallocate: z.ZodInt;
21
+ upload_size: z.ZodOptional<z.ZodInt>;
22
22
  maintenance_mode: z.ZodOptional<z.ZodBoolean>;
23
23
  }, z.z.core.$strip>;
24
24
  //# sourceMappingURL=node.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/node/node.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;mBAiB3B,CAAC"}
1
+ {"version":3,"file":"node.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/node/node.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,MAAM,UAAW,CAAC;AAE/B,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;mBAiB3B,CAAC"}
@@ -1,20 +1,21 @@
1
1
  import z from "zod";
2
- export const nodeId = z.number();
2
+ import { descriptionSchema, idSchema, nameSchema } from "../../schemas.js";
3
+ export const nodeId = idSchema;
3
4
  export const createNodeSchema = z.object({
4
- name: z.string().min(1).max(191),
5
- description: z.string().optional(),
6
- location_id: z.number(),
5
+ name: nameSchema,
6
+ description: descriptionSchema,
7
+ location_id: idSchema,
7
8
  fqdn: z.string().min(1).max(191),
8
9
  scheme: z.enum(["https", "http"]),
9
10
  behind_proxy: z.boolean().optional(),
10
11
  public: z.boolean().optional(),
11
12
  daemon_base: z.string().optional(),
12
- daemon_sftp: z.number(),
13
- daemon_listen: z.number(),
14
- memory: z.number(),
15
- memory_overallocate: z.number(),
16
- disk: z.number(),
17
- disk_overallocate: z.number(),
18
- upload_size: z.number().optional(),
13
+ daemon_sftp: z.int().positive(),
14
+ daemon_listen: z.int().positive(),
15
+ memory: z.int().positive(),
16
+ memory_overallocate: z.int().positive(),
17
+ disk: z.int().positive(),
18
+ disk_overallocate: z.int().positive(),
19
+ upload_size: z.int().positive().optional(),
19
20
  maintenance_mode: z.boolean().optional(),
20
21
  });
@@ -1,72 +1,72 @@
1
1
  import z from "zod";
2
- export declare const applicationServerId: z.ZodNumber;
2
+ export declare const applicationServerId: z.ZodInt;
3
3
  export declare const applicationServerExternalId: z.ZodString;
4
- export declare const applicationServerDatabaseId: z.ZodNumber;
4
+ export declare const applicationServerDatabaseId: z.ZodInt;
5
5
  export declare const createServerSchema: z.ZodObject<{
6
6
  external_id: z.ZodOptional<z.ZodString>;
7
7
  name: z.ZodString;
8
8
  description: z.ZodOptional<z.ZodString>;
9
- user: z.ZodNumber;
10
- egg: z.ZodNumber;
9
+ user: z.ZodInt;
10
+ egg: z.ZodInt;
11
11
  docker_image: z.ZodString;
12
12
  startup: z.ZodString;
13
13
  environment: z.ZodRecord<z.ZodString, z.ZodString>;
14
14
  skip_scripts: z.ZodOptional<z.ZodBoolean>;
15
15
  oom_disabled: z.ZodOptional<z.ZodBoolean>;
16
16
  limits: z.ZodObject<{
17
- memory: z.ZodNumber;
18
- swap: z.ZodNumber;
19
- disk: z.ZodNumber;
20
- io: z.ZodNumber;
17
+ memory: z.ZodInt;
18
+ swap: z.ZodInt;
19
+ disk: z.ZodInt;
20
+ io: z.ZodInt;
21
21
  threads: z.ZodOptional<z.ZodString>;
22
- cpu: z.ZodNumber;
22
+ cpu: z.ZodInt;
23
23
  }, z.z.core.$strip>;
24
24
  feature_limits: z.ZodObject<{
25
- databases: z.ZodNumber;
26
- backups: z.ZodNumber;
27
- allocations: z.ZodOptional<z.ZodNumber>;
25
+ databases: z.ZodInt;
26
+ backups: z.ZodInt;
27
+ allocations: z.ZodOptional<z.ZodInt>;
28
28
  }, z.z.core.$strip>;
29
29
  allocation: z.ZodObject<{
30
- default: z.ZodNumber;
31
- additional: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
30
+ default: z.ZodInt;
31
+ additional: z.ZodOptional<z.ZodArray<z.ZodInt>>;
32
32
  }, z.z.core.$strip>;
33
33
  start_on_completion: z.ZodOptional<z.ZodBoolean>;
34
34
  }, z.z.core.$strip>;
35
35
  export declare const editApplicationServerDetailsSchema: z.ZodObject<{
36
36
  name: z.ZodString;
37
- user: z.ZodNumber;
37
+ user: z.ZodInt;
38
38
  external_id: z.ZodOptional<z.ZodString>;
39
39
  description: z.ZodOptional<z.ZodString>;
40
40
  }, z.z.core.$strip>;
41
41
  export declare const editApplicationServerConfigurationSchema: z.ZodObject<{
42
- allocation: z.ZodNumber;
42
+ allocation: z.ZodInt;
43
43
  oom_disabled: z.ZodOptional<z.ZodBoolean>;
44
44
  limits: z.ZodObject<{
45
- memory: z.ZodOptional<z.ZodNumber>;
46
- swap: z.ZodOptional<z.ZodNumber>;
47
- disk: z.ZodOptional<z.ZodNumber>;
48
- io: z.ZodOptional<z.ZodNumber>;
45
+ memory: z.ZodOptional<z.ZodInt>;
46
+ swap: z.ZodOptional<z.ZodInt>;
47
+ disk: z.ZodOptional<z.ZodInt>;
48
+ io: z.ZodOptional<z.ZodInt>;
49
49
  threads: z.ZodOptional<z.ZodString>;
50
- cpu: z.ZodOptional<z.ZodNumber>;
50
+ cpu: z.ZodOptional<z.ZodInt>;
51
51
  }, z.z.core.$strip>;
52
52
  feature_limits: z.ZodOptional<z.ZodObject<{
53
- databases: z.ZodNumber;
54
- backups: z.ZodNumber;
55
- allocations: z.ZodOptional<z.ZodNumber>;
53
+ databases: z.ZodInt;
54
+ backups: z.ZodInt;
55
+ allocations: z.ZodOptional<z.ZodInt>;
56
56
  }, z.z.core.$strip>>;
57
- add_allocations: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
58
- remove_allocations: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
57
+ add_allocations: z.ZodOptional<z.ZodArray<z.ZodInt>>;
58
+ remove_allocations: z.ZodOptional<z.ZodArray<z.ZodInt>>;
59
59
  }, z.z.core.$strip>;
60
60
  export declare const editApplicationServerStartupSchema: z.ZodObject<{
61
61
  startup: z.ZodString;
62
62
  environment: z.ZodRecord<z.ZodString, z.ZodString>;
63
- egg: z.ZodNumber;
63
+ egg: z.ZodInt;
64
64
  image: z.ZodString;
65
65
  skip_scripts: z.ZodBoolean;
66
66
  }, z.z.core.$strip>;
67
67
  export declare const createApplicationDatabaseSchema: z.ZodObject<{
68
68
  database: z.ZodString;
69
69
  remote: z.ZodString;
70
- host: z.ZodNumber;
70
+ host: z.ZodInt;
71
71
  }, z.z.core.$strip>;
72
72
  //# sourceMappingURL=server.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/server/server.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,2BAA2B,aAA6B,CAAC;AACtE,eAAO,MAAM,2BAA2B,aAAa,CAAC;AAEtD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmC7B,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;mBAK7C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;mBAuBnD,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;mBAS7C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;mBAI1C,CAAC"}
1
+ {"version":3,"file":"server.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/server/server.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,mBAAmB,UAAW,CAAC;AAC5C,eAAO,MAAM,2BAA2B,aAAa,CAAC;AACtD,eAAO,MAAM,2BAA2B,UAAW,CAAC;AAEpD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmC7B,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;mBAK7C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;mBAuBnD,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;mBAS7C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;mBAI1C,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import z from "zod";
2
- export const applicationServerId = z.number();
3
- export const applicationServerExternalId = z.string().min(1).max(191);
4
- export const applicationServerDatabaseId = z.number();
2
+ import { descriptionSchema, idSchema, nameSchema } from "../../schemas.js";
3
+ export const applicationServerId = idSchema;
4
+ export const applicationServerExternalId = nameSchema;
5
+ export const applicationServerDatabaseId = idSchema;
5
6
  export const createServerSchema = z.object({
6
7
  external_id: applicationServerExternalId.optional(),
7
- name: z.string().min(1).max(191),
8
- description: z.string().optional(),
9
- user: z.number(),
10
- egg: z.number(),
8
+ name: nameSchema,
9
+ description: descriptionSchema,
10
+ user: idSchema,
11
+ egg: idSchema,
11
12
  docker_image: z
12
13
  .string()
13
14
  .max(191)
@@ -17,61 +18,61 @@ export const createServerSchema = z.object({
17
18
  skip_scripts: z.boolean().optional(),
18
19
  oom_disabled: z.boolean().optional(),
19
20
  limits: z.object({
20
- memory: z.number().min(0),
21
- swap: z.number().min(-1),
22
- disk: z.number().min(0),
23
- io: z.number().min(10).max(1000),
21
+ memory: z.int().positive().min(0),
22
+ swap: z.int().min(-1),
23
+ disk: z.int().positive().min(0),
24
+ io: z.int().positive().min(10).max(1000),
24
25
  threads: z
25
26
  .string()
26
27
  .regex(/^[0-9-,]+$/)
27
28
  .optional(),
28
- cpu: z.number().min(0),
29
+ cpu: z.int().positive().min(0),
29
30
  }),
30
31
  feature_limits: z.object({
31
- databases: z.number().min(0),
32
- backups: z.number().min(0),
33
- allocations: z.number().min(0).optional(),
32
+ databases: z.int().positive().min(0),
33
+ backups: z.int().positive().min(0),
34
+ allocations: z.int().positive().min(0).optional(),
34
35
  }),
35
36
  allocation: z.object({
36
- default: z.number(),
37
- additional: z.array(z.number()).optional(),
37
+ default: z.int().positive(),
38
+ additional: z.array(z.int().positive()).optional(),
38
39
  }),
39
40
  start_on_completion: z.boolean().optional(),
40
41
  });
41
42
  export const editApplicationServerDetailsSchema = z.object({
42
43
  name: z.string().min(1).max(191),
43
- user: z.number(),
44
+ user: z.int().positive(),
44
45
  external_id: applicationServerExternalId.optional(),
45
46
  description: z.string().optional(),
46
47
  });
47
48
  export const editApplicationServerConfigurationSchema = z.object({
48
- allocation: z.number(),
49
+ allocation: z.int().positive(),
49
50
  oom_disabled: z.boolean().optional(),
50
51
  limits: z.object({
51
- memory: z.number().min(0).optional(),
52
- swap: z.number().min(-1).optional(),
53
- disk: z.number().min(0).optional(),
54
- io: z.number().min(10).max(1000).optional(),
52
+ memory: z.int().positive().min(0).optional(),
53
+ swap: z.int().min(-1).optional(),
54
+ disk: z.int().positive().min(0).optional(),
55
+ io: z.int().positive().min(10).max(1000).optional(),
55
56
  threads: z
56
57
  .string()
57
58
  .regex(/^[0-9-,]+$/)
58
59
  .optional(),
59
- cpu: z.number().min(0).optional(),
60
+ cpu: z.int().positive().min(0).optional(),
60
61
  }),
61
62
  feature_limits: z
62
63
  .object({
63
- databases: z.number().min(0),
64
- backups: z.number().min(0),
65
- allocations: z.number().min(0).optional(),
64
+ databases: z.int().positive().min(0),
65
+ backups: z.int().positive().min(0),
66
+ allocations: z.int().positive().min(0).optional(),
66
67
  })
67
68
  .optional(),
68
- add_allocations: z.number().array().optional(),
69
- remove_allocations: z.number().array().optional(),
69
+ add_allocations: z.int().positive().array().optional(),
70
+ remove_allocations: z.int().positive().array().optional(),
70
71
  });
71
72
  export const editApplicationServerStartupSchema = z.object({
72
73
  startup: z.string(),
73
74
  environment: z.record(z.string().uppercase(), z.string()),
74
- egg: z.number(),
75
+ egg: z.int().positive(),
75
76
  image: z
76
77
  .string()
77
78
  .max(191)
@@ -81,5 +82,5 @@ export const editApplicationServerStartupSchema = z.object({
81
82
  export const createApplicationDatabaseSchema = z.object({
82
83
  database: z.string().min(1).max(48),
83
84
  remote: z.string().regex(/^[0-9%.]{1,15}$/),
84
- host: z.number(),
85
+ host: z.int().positive(),
85
86
  });
@@ -1,3 +1,4 @@
1
1
  export { default as User } from "./user.client.js";
2
2
  export * from "./user.types.js";
3
+ export * from "./user.schemas.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEnD,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEnD,cAAc,iBAAiB,CAAC;AAEhC,cAAc,mBAAmB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { default as User } from "./user.client.js";
2
2
  export * from "./user.types.js";
3
+ export * from "./user.schemas.js";
@@ -1 +1 @@
1
- {"version":3,"file":"user.client.d.ts","sourceRoot":"","sources":["../../../src/application/user/user.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,IAAI,EACJ,cAAc,EAEd,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,UAAU;IACjB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,EAAE,EACxC,cAAc,GACf,GAAE;QAAE,cAAc,CAAC,EAAE,CAAC,CAAA;KAAO;;;;;;;;;;;;;IA+CxB,IAAI,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,EACtC,EACE,EAAE,EACF,WAAW,GACZ,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,EAChE,EAAE,cAAc,EAAE,GAAE;QAAE,cAAc,CAAC,EAAE,CAAC,CAAA;KAAO;;;;;;;;;;;;;IA0CjD,MAAM,CAAC,IAAI,EAAE,cAAc;IAiB3B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc;IAiBrC,MAAM,CAAC,EAAE,EAAE,MAAM;CAGlB"}
1
+ {"version":3,"file":"user.client.d.ts","sourceRoot":"","sources":["../../../src/application/user/user.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EACV,cAAc,EACd,IAAI,EACJ,cAAc,EAEd,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,UAAU;IACjB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,EAAE,EACxC,cAAc,GACf,GAAE;QAAE,cAAc,CAAC,EAAE,CAAC,CAAA;KAAO;;;;;;;;;;;;;IA+CxB,IAAI,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,EACtC,EACE,EAAE,EACF,WAAW,GACZ,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,EAChE,EAAE,cAAc,EAAE,GAAE;QAAE,cAAc,CAAC,EAAE,CAAC,CAAA;KAAO;;;;;;;;;;;;;IA0CjD,MAAM,CAAC,IAAI,EAAE,cAAc;IAO3B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc;IAWrC,MAAM,CAAC,EAAE,EAAE,MAAM;CAMlB"}
@@ -1,4 +1,5 @@
1
1
  import z from "zod";
2
+ import { createUserSchema, externalUserId, userId } from "./user.schemas.js";
2
3
  export default class UserClient {
3
4
  httpClient;
4
5
  constructor(httpClient) {
@@ -46,7 +47,7 @@ export default class UserClient {
46
47
  }
47
48
  async info({ id, external_id, }, { includeServers } = {}) {
48
49
  if (id) {
49
- const res = await this.httpClient.request("GET", `/application/users/${id}${includeServers ? "?include=servers" : ""}`);
50
+ const res = await this.httpClient.request("GET", `/application/users/${userId.parse(id)}${includeServers ? "?include=servers" : ""}`);
50
51
  return {
51
52
  ...res,
52
53
  attributes: {
@@ -57,7 +58,7 @@ export default class UserClient {
57
58
  };
58
59
  }
59
60
  else if (external_id) {
60
- const res = await this.httpClient.request("GET", `/application/users/external/${external_id}${includeServers ? "?include=servers" : ""}`);
61
+ const res = await this.httpClient.request("GET", `/application/users/external/${externalUserId.parse(external_id)}${includeServers ? "?include=servers" : ""}`);
61
62
  return {
62
63
  ...res,
63
64
  attributes: {
@@ -71,32 +72,12 @@ export default class UserClient {
71
72
  throw new Error("Vous devez spécifier au moins un des 2 paramètres de recherche d'un utilisateur !");
72
73
  }
73
74
  create(args) {
74
- const schema = z.object({
75
- email: z.email(),
76
- username: z.string(),
77
- first_name: z.string(),
78
- last_name: z.string(),
79
- password: z.string().optional(),
80
- language: z.string().optional(),
81
- root_admin: z.boolean().optional(),
82
- external_id: z.string().optional(),
83
- });
84
- return this.httpClient.request("POST", "/application/users", schema.parse(args));
75
+ return this.httpClient.request("POST", "/application/users", createUserSchema.parse(args));
85
76
  }
86
77
  edit(id, args) {
87
- const schema = z.object({
88
- email: z.email(),
89
- username: z.string(),
90
- first_name: z.string(),
91
- last_name: z.string(),
92
- password: z.string().optional(),
93
- language: z.string().optional(),
94
- root_admin: z.boolean().optional(),
95
- external_id: z.string().optional(),
96
- });
97
- return this.httpClient.request("PATCH", `/application/users/${id}`, schema.parse(args));
78
+ return this.httpClient.request("PATCH", `/application/users/${userId.parse(id)}`, createUserSchema.parse(args));
98
79
  }
99
80
  delete(id) {
100
- return this.httpClient.request("DELETE", `/application/users/${id}`);
81
+ return this.httpClient.request("DELETE", `/application/users/${userId.parse(id)}`);
101
82
  }
102
83
  }
@@ -0,0 +1,14 @@
1
+ import z from "zod";
2
+ export declare const userId: z.ZodInt;
3
+ export declare const externalUserId: z.ZodString;
4
+ export declare const createUserSchema: z.ZodObject<{
5
+ email: z.ZodEmail;
6
+ username: z.ZodString;
7
+ first_name: z.ZodString;
8
+ last_name: z.ZodString;
9
+ password: z.ZodOptional<z.ZodString>;
10
+ language: z.ZodOptional<z.ZodString>;
11
+ root_admin: z.ZodOptional<z.ZodBoolean>;
12
+ external_id: z.ZodOptional<z.ZodString>;
13
+ }, z.z.core.$strip>;
14
+ //# sourceMappingURL=user.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.schemas.d.ts","sourceRoot":"","sources":["../../../src/application/user/user.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,MAAM,UAAW,CAAC;AAC/B,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,eAAO,MAAM,gBAAgB;;;;;;;;;mBAS3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import z from "zod";
2
+ import { idSchema, nameSchema } from "../../schemas.js";
3
+ export const userId = idSchema;
4
+ export const externalUserId = nameSchema;
5
+ export const createUserSchema = z.object({
6
+ email: z.email().min(1).max(191),
7
+ username: z.string().min(1).max(191),
8
+ first_name: z.string().min(1).max(191),
9
+ last_name: z.string().min(1).max(191),
10
+ password: z.string().min(8).optional(),
11
+ language: z.string().optional(),
12
+ root_admin: z.boolean().optional(),
13
+ external_id: z.string().min(1).max(191).optional(),
14
+ });
package/dist/class.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import ApplicationAPI from "./application/application.client.js";
1
+ import { ApplicationAPI } from "./application/index.js";
2
2
  import { ClientAPI } from "./client/index.js";
3
3
  export default class PterodactylAPIClient {
4
4
  readonly panelUrl: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../src/class.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;gBAElB,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAQvE"}
1
+ {"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../src/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;gBAElB,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAQvE"}
package/dist/class.js CHANGED
@@ -1,4 +1,4 @@
1
- import ApplicationAPI from "./application/application.client.js";
1
+ import { ApplicationAPI } from "./application/index.js";
2
2
  import { ClientAPI } from "./client/index.js";
3
3
  export default class PterodactylAPIClient {
4
4
  panelUrl;
@@ -22,4 +22,5 @@ export * from "./ressource/ressource.types.js";
22
22
  export * from "./schedule/schedule.types.js";
23
23
  export * from "./startup/startup.types.js";
24
24
  export * from "./subuser/subuser.types.js";
25
+ export * from "./server.schemas.js";
25
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEvE,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEvE,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,qBAAqB,CAAC"}
@@ -22,3 +22,4 @@ export * from "./ressource/ressource.types.js";
22
22
  export * from "./schedule/schedule.types.js";
23
23
  export * from "./startup/startup.types.js";
24
24
  export * from "./subuser/subuser.types.js";
25
+ export * from "./server.schemas.js";
@@ -2,10 +2,10 @@ import z from "zod";
2
2
  export declare const userServerId: z.ZodUnion<readonly [z.ZodString, z.ZodUUID]>;
3
3
  export declare const userServerSubuserId: z.ZodUUID;
4
4
  export declare const userServerDatabaseId: z.ZodString;
5
- export declare const userServerPort: z.ZodNumber;
5
+ export declare const userServerPort: z.ZodInt;
6
6
  export declare const userServerBackupId: z.ZodUUID;
7
- export declare const userServerScheduleId: z.ZodNumber;
8
- export declare const userServerScheduleTaskId: z.ZodNumber;
7
+ export declare const userServerScheduleId: z.ZodInt;
8
+ export declare const userServerScheduleTaskId: z.ZodInt;
9
9
  export declare const allocationId: z.z.ZodCoercedNumber<number>;
10
10
  export declare const state: z.ZodLiteral<"running" | "starting" | "stopping" | "offline">;
11
11
  export declare const cronString: z.ZodString;
@@ -19,7 +19,7 @@ export declare const userServerActivityPaginationSchema: z.ZodObject<{
19
19
  }, z.z.core.$strip>;
20
20
  export declare const assignAllocationSchema: z.ZodObject<{
21
21
  ip: z.ZodIPv4;
22
- port: z.ZodNumber;
22
+ port: z.ZodInt;
23
23
  }, z.z.core.$strip>;
24
24
  export declare const editAllocationSchema: z.ZodObject<{
25
25
  notes: z.ZodOptional<z.ZodString>;
@@ -30,16 +30,16 @@ export declare const userServerCommandSchema: z.ZodObject<{
30
30
  export declare const userServerWebsocketSchema: z.ZodObject<{
31
31
  onConsoleOutput: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodUnion<readonly [z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>>;
32
32
  onStats: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
33
- cpu_absolute: z.ZodNumber;
34
- disk_bytes: z.ZodNumber;
35
- memory_bytes: z.ZodNumber;
36
- memory_limit_bytes: z.ZodNumber;
33
+ cpu_absolute: z.ZodInt;
34
+ disk_bytes: z.ZodInt;
35
+ memory_bytes: z.ZodInt;
36
+ memory_limit_bytes: z.ZodInt;
37
37
  network: z.ZodObject<{
38
- rx_bytes: z.ZodNumber;
39
- tx_bytes: z.ZodNumber;
38
+ rx_bytes: z.ZodInt;
39
+ tx_bytes: z.ZodInt;
40
40
  }, z.z.core.$strip>;
41
41
  state: z.ZodLiteral<"running" | "starting" | "stopping" | "offline">;
42
- uptime: z.ZodNumber;
42
+ uptime: z.ZodInt;
43
43
  }, z.z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>>;
44
44
  onStatusChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodLiteral<"running" | "starting" | "stopping" | "offline">], null>, z.ZodUnion<readonly [z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>>;
45
45
  }, z.z.core.$strip>;
@@ -61,17 +61,17 @@ export declare const createScheduleSchema: z.ZodObject<{
61
61
  export declare const createTaskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
62
62
  action: z.ZodLiteral<"command">;
63
63
  payload: z.ZodString;
64
- time_offset: z.ZodNumber;
64
+ time_offset: z.ZodInt;
65
65
  continue_on_failure: z.ZodOptional<z.ZodBoolean>;
66
66
  }, z.z.core.$strip>, z.ZodObject<{
67
67
  action: z.ZodLiteral<"power">;
68
68
  payload: z.ZodLiteral<"start" | "stop" | "restart" | "kill">;
69
- time_offset: z.ZodNumber;
69
+ time_offset: z.ZodInt;
70
70
  continue_on_failure: z.ZodOptional<z.ZodBoolean>;
71
71
  }, z.z.core.$strip>, z.ZodObject<{
72
72
  action: z.ZodLiteral<"backup">;
73
73
  payload: z.ZodOptional<z.ZodString>;
74
- time_offset: z.ZodNumber;
74
+ time_offset: z.ZodInt;
75
75
  continue_on_failure: z.ZodOptional<z.ZodBoolean>;
76
76
  }, z.z.core.$strip>], "action">;
77
77
  export declare const serverPermissionSchema: z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"server.schemas.d.ts","sourceRoot":"","sources":["../../../src/client/server/server.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,YAAY,+CAA8C,CAAC;AACxE,eAAO,MAAM,mBAAmB,WAAa,CAAC;AAC9C,eAAO,MAAM,oBAAoB,aAAuB,CAAC;AACzD,eAAO,MAAM,cAAc,aAAkC,CAAC;AAC9D,eAAO,MAAM,kBAAkB,WAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,wBAAwB,aAAa,CAAC;AACnD,eAAO,MAAM,YAAY,8BAA4B,CAAC;AACtD,eAAO,MAAM,KAAK,+DAA4D,CAAC;AAC/E,eAAO,MAAM,UAAU,aAA2C,CAAC;AAEnE,eAAO,MAAM,kCAAkC;;;;;;;mBA2C7C,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;mBAGjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;mBAE/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;mBAElC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;mBA6BpC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;mBAI7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;mBAS/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;+BAmB3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAGlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAG9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAE5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;mBAG/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;mBAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;oBAA8B,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;mBAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;mBAG7B,CAAC;AAEH,eAAO,MAAM,eAAe;;mBAK1B,CAAC"}
1
+ {"version":3,"file":"server.schemas.d.ts","sourceRoot":"","sources":["../../../src/client/server/server.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,YAAY,+CAA8C,CAAC;AACxE,eAAO,MAAM,mBAAmB,WAAa,CAAC;AAC9C,eAAO,MAAM,oBAAoB,aAAuB,CAAC;AACzD,eAAO,MAAM,cAAc,UAA0C,CAAC;AACtE,eAAO,MAAM,kBAAkB,WAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,UAAqB,CAAC;AACvD,eAAO,MAAM,wBAAwB,UAAqB,CAAC;AAC3D,eAAO,MAAM,YAAY,8BAA4B,CAAC;AACtD,eAAO,MAAM,KAAK,+DAA4D,CAAC;AAC/E,eAAO,MAAM,UAAU,aAA2C,CAAC;AAEnE,eAAO,MAAM,kCAAkC;;;;;;;mBA2C7C,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;mBAGjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;mBAE/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;mBAElC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;mBAgCpC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;mBAI7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;mBAS/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;+BAmB3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAGlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAG9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAE5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;mBAG/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;mBAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;oBAA8B,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;mBAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;mBAG7B,CAAC;AAEH,eAAO,MAAM,eAAe;;mBAK1B,CAAC"}
@@ -3,10 +3,10 @@ import { paginationSchema } from "../../schemas.js";
3
3
  export const userServerId = z.union([z.string().length(8), z.uuidv4()]);
4
4
  export const userServerSubuserId = z.uuidv4();
5
5
  export const userServerDatabaseId = z.string().length(8);
6
- export const userServerPort = z.number().min(1024).max(65535);
6
+ export const userServerPort = z.int().positive().min(1024).max(65535);
7
7
  export const userServerBackupId = z.uuidv4();
8
- export const userServerScheduleId = z.number();
9
- export const userServerScheduleTaskId = z.number();
8
+ export const userServerScheduleId = z.int().positive();
9
+ export const userServerScheduleTaskId = z.int().positive();
10
10
  export const allocationId = z.coerce.number();
11
11
  export const state = z.literal(["running", "starting", "stopping", "offline"]);
12
12
  export const cronString = z.string().regex(/^(?:\*|\d+|\*\/\d+)$/);
@@ -75,13 +75,16 @@ export const userServerWebsocketSchema = z.object({
75
75
  .function({
76
76
  input: [
77
77
  z.object({
78
- cpu_absolute: z.number(),
79
- disk_bytes: z.number(),
80
- memory_bytes: z.number(),
81
- memory_limit_bytes: z.number(),
82
- network: z.object({ rx_bytes: z.number(), tx_bytes: z.number() }),
78
+ cpu_absolute: z.int().positive(),
79
+ disk_bytes: z.int().positive(),
80
+ memory_bytes: z.int().positive(),
81
+ memory_limit_bytes: z.int().positive(),
82
+ network: z.object({
83
+ rx_bytes: z.int().positive(),
84
+ tx_bytes: z.int().positive(),
85
+ }),
83
86
  state: state,
84
- uptime: z.number(),
87
+ uptime: z.int().positive(),
85
88
  }),
86
89
  ],
87
90
  output: z.union([z.promise(z.void()), z.void()]),
@@ -113,19 +116,19 @@ export const createTaskSchema = z.discriminatedUnion("action", [
113
116
  z.object({
114
117
  action: z.literal("command"),
115
118
  payload: z.string(),
116
- time_offset: z.number().min(0).max(900),
119
+ time_offset: z.int().positive().min(0).max(900),
117
120
  continue_on_failure: z.boolean().optional(),
118
121
  }),
119
122
  z.object({
120
123
  action: z.literal("power"),
121
124
  payload: z.literal(["start", "stop", "restart", "kill"]),
122
- time_offset: z.number().min(0).max(900),
125
+ time_offset: z.int().positive().min(0).max(900),
123
126
  continue_on_failure: z.boolean().optional(),
124
127
  }),
125
128
  z.object({
126
129
  action: z.literal("backup"),
127
130
  payload: z.string().optional(),
128
- time_offset: z.number().min(0).max(900),
131
+ time_offset: z.int().positive().min(0).max(900),
129
132
  continue_on_failure: z.boolean().optional(),
130
133
  }),
131
134
  ]);
@@ -0,0 +1,14 @@
1
+ import z from "zod";
2
+ export declare const idSchema: z.ZodInt;
3
+ export declare const uuidSchema: z.ZodString;
4
+ export declare const nameSchema: z.ZodString;
5
+ export declare const descriptionSchema: z.ZodOptional<z.ZodString>;
6
+ export declare const dateSchema: z.ZodDate;
7
+ export declare const paginationSchema: z.ZodObject<{
8
+ page: z.ZodOptional<z.z.ZodCoercedNumber<number>>;
9
+ per_page: z.ZodOptional<z.z.ZodCoercedNumber<number>>;
10
+ sort: z.ZodOptional<z.ZodObject<{
11
+ timestamp: z.ZodOptional<z.ZodLiteral<"ascending" | "descending">>;
12
+ }, z.z.core.$strip>>;
13
+ }, z.z.core.$strip>;
14
+ //# sourceMappingURL=common.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.schemas.d.ts","sourceRoot":"","sources":["../src/common.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,QAAQ,UAAqB,CAAC;AAC3C,eAAO,MAAM,UAAU,aAAoB,CAAC;AAC5C,eAAO,MAAM,UAAU,aAA6B,CAAC;AACrD,eAAO,MAAM,iBAAiB,4BAAwB,CAAC;AACvD,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,eAAO,MAAM,gBAAgB;;;;;;mBAQ3B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import z from "zod";
2
+ export const idSchema = z.int().positive();
3
+ export const uuidSchema = z.string().uuid();
4
+ export const nameSchema = z.string().min(1).max(191);
5
+ export const descriptionSchema = z.string().optional();
6
+ export const dateSchema = z.date();
7
+ export const paginationSchema = z.object({
8
+ page: z.coerce.number().optional(),
9
+ per_page: z.coerce.number().min(1).max(100).optional(),
10
+ sort: z
11
+ .object({
12
+ timestamp: z.literal(["ascending", "descending"]).optional(),
13
+ })
14
+ .optional(),
15
+ });
package/dist/schemas.d.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  import z from "zod";
2
+ export declare const idSchema: z.ZodInt;
3
+ export declare const uuidSchema: z.ZodString;
4
+ export declare const nameSchema: z.ZodString;
5
+ export declare const descriptionSchema: z.ZodOptional<z.ZodString>;
6
+ export declare const dateSchema: z.ZodDate;
2
7
  export declare const paginationSchema: z.ZodObject<{
3
8
  page: z.ZodOptional<z.z.ZodCoercedNumber<number>>;
4
9
  per_page: z.ZodOptional<z.z.ZodCoercedNumber<number>>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,gBAAgB;;;;;;mBAQ3B,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,QAAQ,UAAqB,CAAC;AAC3C,eAAO,MAAM,UAAU,aAAoB,CAAC;AAC5C,eAAO,MAAM,UAAU,aAA6B,CAAC;AACrD,eAAO,MAAM,iBAAiB,4BAAwB,CAAC;AACvD,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,eAAO,MAAM,gBAAgB;;;;;;mBAQ3B,CAAC"}
package/dist/schemas.js CHANGED
@@ -1,4 +1,9 @@
1
1
  import z from "zod";
2
+ export const idSchema = z.int().positive();
3
+ export const uuidSchema = z.string().uuid();
4
+ export const nameSchema = z.string().min(1).max(191);
5
+ export const descriptionSchema = z.string().optional();
6
+ export const dateSchema = z.date();
2
7
  export const paginationSchema = z.object({
3
8
  page: z.coerce.number().optional(),
4
9
  per_page: z.coerce.number().min(1).max(100).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pterodactyl-api-client",
3
- "version": "2.9.0",
3
+ "version": "2.10.2",
4
4
  "description": "SDK TypeScript non officiel et entièrement typé pour l’API Pterodactyl.\nCouvre l’ensemble des endpoints client et application avec une architecture modulaire, orientée classes, conçue pour Node.js et les environnements TypeScript stricts.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",