pterodactyl-api-client 2.5.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/application/location/location.client.d.ts.map +1 -1
  2. package/dist/application/location/location.client.js +5 -20
  3. package/dist/application/location/location.schemas.d.ts +11 -0
  4. package/dist/application/location/location.schemas.d.ts.map +1 -0
  5. package/dist/application/location/location.schemas.js +15 -0
  6. package/dist/application/nest/egg/egg.client.d.ts.map +1 -1
  7. package/dist/application/nest/egg/egg.client.js +3 -2
  8. package/dist/application/nest/nest.client.d.ts.map +1 -1
  9. package/dist/application/nest/nest.client.js +2 -1
  10. package/dist/application/nest/nest.schemas.d.ts +4 -0
  11. package/dist/application/nest/nest.schemas.d.ts.map +1 -0
  12. package/dist/application/nest/nest.schemas.js +3 -0
  13. package/dist/application/node/allocation/allocation.client.d.ts +1 -1
  14. package/dist/application/node/allocation/allocation.client.d.ts.map +1 -1
  15. package/dist/application/node/node.client.d.ts.map +1 -1
  16. package/dist/application/node/node.client.js +7 -5
  17. package/dist/application/node/node.schemas.d.ts +24 -0
  18. package/dist/application/node/node.schemas.d.ts.map +1 -0
  19. package/dist/application/node/node.schemas.js +20 -0
  20. package/dist/application/server/database/database.client.d.ts.map +1 -1
  21. package/dist/application/server/database/database.client.js +6 -4
  22. package/dist/application/server/database/password/password.client.d.ts.map +1 -1
  23. package/dist/application/server/database/password/password.client.js +2 -1
  24. package/dist/application/server/server.client.d.ts.map +1 -1
  25. package/dist/application/server/server.client.js +14 -12
  26. package/dist/application/server/server.schemas.d.ts +72 -0
  27. package/dist/application/server/server.schemas.d.ts.map +1 -0
  28. package/dist/application/server/server.schemas.js +85 -0
  29. package/dist/application/server/server.types.d.ts +19 -15
  30. package/dist/application/server/server.types.d.ts.map +1 -1
  31. package/dist/client/account/a2f/a2f.client.d.ts +3 -3
  32. package/dist/client/account/a2f/a2f.client.d.ts.map +1 -1
  33. package/dist/client/account/a2f/a2f.client.js +7 -5
  34. package/dist/client/account/a2f/a2f.types.d.ts +1 -1
  35. package/dist/client/account/a2f/a2f.types.d.ts.map +1 -1
  36. package/dist/client/account/account.schemas.d.ts +40 -0
  37. package/dist/client/account/account.schemas.d.ts.map +1 -0
  38. package/dist/client/account/account.schemas.js +51 -0
  39. package/dist/client/account/activity/activity.client.d.ts +5 -1
  40. package/dist/client/account/activity/activity.client.d.ts.map +1 -1
  41. package/dist/client/account/activity/activity.client.js +9 -2
  42. package/dist/client/account/activity/activity.types.d.ts +3 -3
  43. package/dist/client/account/activity/activity.types.d.ts.map +1 -1
  44. package/dist/client/account/api-key/api-key.client.d.ts +2 -2
  45. package/dist/client/account/api-key/api-key.client.d.ts.map +1 -1
  46. package/dist/client/account/api-key/api-key.client.js +5 -6
  47. package/dist/client/account/email/email.client.d.ts +1 -1
  48. package/dist/client/account/email/email.client.d.ts.map +1 -1
  49. package/dist/client/account/email/email.client.js +3 -2
  50. package/dist/client/account/index.d.ts +1 -0
  51. package/dist/client/account/index.d.ts.map +1 -1
  52. package/dist/client/account/index.js +1 -0
  53. package/dist/client/account/password/password.client.d.ts +1 -1
  54. package/dist/client/account/password/password.client.d.ts.map +1 -1
  55. package/dist/client/account/password/password.client.js +3 -6
  56. package/dist/client/account/ssh-key/ssh-key.client.d.ts +2 -2
  57. package/dist/client/account/ssh-key/ssh-key.client.d.ts.map +1 -1
  58. package/dist/client/account/ssh-key/ssh-key.client.js +5 -7
  59. package/dist/client/server/activity/activity.client.d.ts +5 -1
  60. package/dist/client/server/activity/activity.client.d.ts.map +1 -1
  61. package/dist/client/server/activity/activity.client.js +9 -2
  62. package/dist/client/server/activity/activity.types.d.ts +1 -1
  63. package/dist/client/server/activity/activity.types.d.ts.map +1 -1
  64. package/dist/client/server/allocation/allocation.client.d.ts +2 -2
  65. package/dist/client/server/allocation/allocation.client.d.ts.map +1 -1
  66. package/dist/client/server/allocation/allocation.client.js +8 -11
  67. package/dist/client/server/backup/backup.client.d.ts +4 -4
  68. package/dist/client/server/backup/backup.client.d.ts.map +1 -1
  69. package/dist/client/server/backup/backup.client.js +9 -8
  70. package/dist/client/server/backup/lock/lock.client.d.ts.map +1 -1
  71. package/dist/client/server/backup/lock/lock.client.js +2 -1
  72. package/dist/client/server/console/console.client.d.ts +1 -1
  73. package/dist/client/server/console/console.client.d.ts.map +1 -1
  74. package/dist/client/server/console/console.client.js +3 -2
  75. package/dist/client/server/console/websocket/websocket.console.client.d.ts +1 -1
  76. package/dist/client/server/console/websocket/websocket.console.client.d.ts.map +1 -1
  77. package/dist/client/server/console/websocket/websocket.console.client.js +9 -7
  78. package/dist/client/server/console/websocket/websocket.console.types.d.ts +1 -1
  79. package/dist/client/server/console/websocket/websocket.console.types.d.ts.map +1 -1
  80. package/dist/client/server/database/database.client.d.ts +3 -3
  81. package/dist/client/server/database/database.client.d.ts.map +1 -1
  82. package/dist/client/server/database/database.client.js +5 -10
  83. package/dist/client/server/database/password/password.client.d.ts.map +1 -1
  84. package/dist/client/server/database/password/password.client.js +2 -1
  85. package/dist/client/server/image/image.client.d.ts +1 -1
  86. package/dist/client/server/image/image.client.d.ts.map +1 -1
  87. package/dist/client/server/image/image.client.js +3 -2
  88. package/dist/client/server/power/power.client.d.ts.map +1 -1
  89. package/dist/client/server/power/power.client.js +5 -4
  90. package/dist/client/server/ressource/ressource.client.d.ts.map +1 -1
  91. package/dist/client/server/ressource/ressource.client.js +2 -1
  92. package/dist/client/server/schedule/schedule.client.d.ts +3 -3
  93. package/dist/client/server/schedule/schedule.client.d.ts.map +1 -1
  94. package/dist/client/server/schedule/schedule.client.js +9 -26
  95. package/dist/client/server/schedule/schedule.types.d.ts +0 -10
  96. package/dist/client/server/schedule/schedule.types.d.ts.map +1 -1
  97. package/dist/client/server/schedule/task/task.client.d.ts +2 -3
  98. package/dist/client/server/schedule/task/task.client.d.ts.map +1 -1
  99. package/dist/client/server/schedule/task/task.client.js +6 -16
  100. package/dist/client/server/server.client.d.ts +2 -2
  101. package/dist/client/server/server.client.d.ts.map +1 -1
  102. package/dist/client/server/server.client.js +8 -12
  103. package/dist/client/server/server.schemas.d.ts +263 -0
  104. package/dist/client/server/server.schemas.d.ts.map +1 -0
  105. package/dist/client/server/server.schemas.js +203 -0
  106. package/dist/client/server/startup/startup.client.d.ts +1 -1
  107. package/dist/client/server/startup/startup.client.d.ts.map +1 -1
  108. package/dist/client/server/startup/startup.client.js +4 -3
  109. package/dist/client/server/subuser/subuser.client.d.ts +2 -2
  110. package/dist/client/server/subuser/subuser.client.d.ts.map +1 -1
  111. package/dist/client/server/subuser/subuser.client.js +8 -7
  112. package/dist/schemas.d.ts +9 -0
  113. package/dist/schemas.d.ts.map +1 -0
  114. package/dist/schemas.js +10 -0
  115. package/dist/types.d.ts +1 -0
  116. package/dist/types.d.ts.map +1 -1
  117. package/package.json +19 -3
@@ -1 +1 @@
1
- {"version":3,"file":"location.client.d.ts","sourceRoot":"","sources":["../../../src/application/location/location.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,cAAc;IACrB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAgBf,MAAM,CAAC,OAAO,EAAE,kBAAkB;;;;;;;;;;IAoBlC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB;;;;;;;;;;IAyBhD,MAAM,CAAC,EAAE,EAAE,MAAM;CAMlB"}
1
+ {"version":3,"file":"location.client.d.ts","sourceRoot":"","sources":["../../../src/application/location/location.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAMxD,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,cAAc;IACrB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAef,MAAM,CAAC,OAAO,EAAE,kBAAkB;;;;;;;;;;IAelC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB;;;;;;;;;;IAmBhD,MAAM,CAAC,EAAE,EAAE,MAAM;CAMlB"}
@@ -1,4 +1,5 @@
1
1
  import z from "zod";
2
+ import { createLocationSchema, editLocationSchema, locationId, } from "./location.schemas.js";
2
3
  export default class LocationClient {
3
4
  httpClient;
4
5
  constructor(httpClient) {
@@ -19,9 +20,8 @@ export default class LocationClient {
19
20
  };
20
21
  }
21
22
  async info(id) {
22
- const res = await this.httpClient.request("GET", `/application/locations/${id}`);
23
+ const res = await this.httpClient.request("GET", `/application/locations/${locationId.parse(id)}`);
23
24
  return {
24
- ...res,
25
25
  ...res,
26
26
  attributes: {
27
27
  ...res.attributes,
@@ -31,13 +31,8 @@ export default class LocationClient {
31
31
  };
32
32
  }
33
33
  async create(options) {
34
- const schema = z.object({
35
- short: z.string().min(3).max(60),
36
- long: z.string().min(3).max(191),
37
- });
38
- const res = await this.httpClient.request("POST", `/application/locations`, schema.parse(options));
34
+ const res = await this.httpClient.request("POST", `/application/locations`, createLocationSchema.parse(options));
39
35
  return {
40
- ...res,
41
36
  ...res,
42
37
  attributes: {
43
38
  ...res.attributes,
@@ -47,18 +42,8 @@ export default class LocationClient {
47
42
  };
48
43
  }
49
44
  async edit(id, options) {
50
- const schema = z
51
- .object({
52
- short: z.string().min(3).max(60).optional(),
53
- long: z.string().min(3).max(191).optional(),
54
- })
55
- .refine((data) => data.short || data.long, {
56
- message: "Either short or long must be provided",
57
- path: ["short"],
58
- });
59
- const res = await this.httpClient.request("PATCH", `/application/locations/${id}`, schema.parse(options));
45
+ const res = await this.httpClient.request("PATCH", `/application/locations/${locationId.parse(id)}`, editLocationSchema.parse(options));
60
46
  return {
61
- ...res,
62
47
  ...res,
63
48
  attributes: {
64
49
  ...res.attributes,
@@ -68,6 +53,6 @@ export default class LocationClient {
68
53
  };
69
54
  }
70
55
  delete(id) {
71
- return this.httpClient.request("POST", `/application/locations/${id}`);
56
+ return this.httpClient.request("DELETE", `/application/locations/${locationId.parse(id)}`);
72
57
  }
73
58
  }
@@ -0,0 +1,11 @@
1
+ import z from "zod";
2
+ export declare const locationId: z.ZodNumber;
3
+ export declare const createLocationSchema: z.ZodObject<{
4
+ short: z.ZodString;
5
+ long: z.ZodString;
6
+ }, z.z.core.$strip>;
7
+ export declare const editLocationSchema: z.ZodObject<{
8
+ short: z.ZodOptional<z.ZodString>;
9
+ long: z.ZodOptional<z.ZodString>;
10
+ }, z.z.core.$strip>;
11
+ //# sourceMappingURL=location.schemas.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,15 @@
1
+ import z from "zod";
2
+ export const locationId = z.number();
3
+ export const createLocationSchema = z.object({
4
+ short: z.string().min(3).max(60),
5
+ long: z.string().min(3).max(191),
6
+ });
7
+ export const editLocationSchema = z
8
+ .object({
9
+ short: z.string().min(3).max(60).optional(),
10
+ long: z.string().min(3).max(191).optional(),
11
+ })
12
+ .refine((data) => data.short || data.long, {
13
+ message: "Either short or long must be provided",
14
+ path: ["short"],
15
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"egg.client.d.ts","sourceRoot":"","sources":["../../../../src/application/nest/egg/egg.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,MAAM,CAAC,OAAO,OAAO,SAAS;IAChB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAef,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcnC"}
1
+ {"version":3,"file":"egg.client.d.ts","sourceRoot":"","sources":["../../../../src/application/nest/egg/egg.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAI3D,MAAM,CAAC,OAAO,OAAO,SAAS;IAChB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAef,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcnC"}
@@ -1,10 +1,11 @@
1
+ import { nestEggId, nestId } from "../nest.schemas.js";
1
2
  export default class EggClient {
2
3
  httpClient;
3
4
  constructor(httpClient) {
4
5
  this.httpClient = httpClient;
5
6
  }
6
7
  async list(id) {
7
- const res = await this.httpClient.request("GET", `/application/nests/${id}/eggs`);
8
+ const res = await this.httpClient.request("GET", `/application/nests/${nestId.parse(id)}/eggs`);
8
9
  return {
9
10
  ...res,
10
11
  data: res.data.map((egg) => ({
@@ -15,7 +16,7 @@ export default class EggClient {
15
16
  };
16
17
  }
17
18
  async info(id, egg) {
18
- const res = await this.httpClient.request("GET", `/application/nests/${id}/eggs/${egg}`);
19
+ const res = await this.httpClient.request("GET", `/application/nests/${nestId.parse(id)}/eggs/${nestEggId.parse(egg)}`);
19
20
  return {
20
21
  ...res,
21
22
  attributes: {
@@ -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;AAGxD,MAAM,CAAC,OAAO,OAAO,UAAU;IACjB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI;;;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;CActB"}
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;IACjB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEpC,IAAI;;;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;CActB"}
@@ -1,3 +1,4 @@
1
+ import { nestId } from "./nest.schemas.js";
1
2
  export default class NestClient {
2
3
  httpClient;
3
4
  constructor(httpClient) {
@@ -18,7 +19,7 @@ export default class NestClient {
18
19
  };
19
20
  }
20
21
  async info(id) {
21
- const res = await this.httpClient.request("GET", `/application/nests/${id}`);
22
+ const res = await this.httpClient.request("GET", `/application/nests/${nestId.parse(id)}`);
22
23
  return {
23
24
  ...res,
24
25
  attributes: {
@@ -0,0 +1,4 @@
1
+ import z from "zod";
2
+ export declare const nestId: z.ZodNumber;
3
+ export declare const nestEggId: z.ZodNumber;
4
+ //# sourceMappingURL=nest.schemas.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ import z from "zod";
2
+ export const nestId = z.number();
3
+ export const nestEggId = z.number();
@@ -5,6 +5,6 @@ export default class AllocationClient {
5
5
  constructor(httpClient: HttpClient);
6
6
  list(id: number): Promise<ApplicationAllocationListWithDate>;
7
7
  create(id: number, options: CreateApplicationAllocationArgs): Promise<ApplicationAllocationList>;
8
- delete(id: number, allocation: number): Promise<ApplicationAllocationList>;
8
+ delete(id: number, allocation: number): Promise<void>;
9
9
  }
10
10
  //# sourceMappingURL=allocation.client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"allocation.client.d.ts","sourceRoot":"","sources":["../../../../src/application/node/allocation/allocation.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAEV,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACvB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,IAAI,CAAC,EAAE,EAAE,MAAM;IAOf,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,+BAA+B;IAO3D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAMtC"}
1
+ {"version":3,"file":"allocation.client.d.ts","sourceRoot":"","sources":["../../../../src/application/node/allocation/allocation.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EACV,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACvB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,IAAI,CAAC,EAAE,EAAE,MAAM;IAOf,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,+BAA+B;IAO3D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAMtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"node.client.d.ts","sourceRoot":"","sources":["../../../src/application/node/node.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EACV,cAAc,EACd,IAAI,EACJ,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,UAAU;IAGjB,OAAO,CAAC,UAAU;IAFvB,UAAU,EAAE,gBAAgB,CAAC;gBAEhB,UAAU,EAAE,UAAU;IAIpC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAef,MAAM,CAAC,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgB9B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgB9C,aAAa,CAAC,EAAE,EAAE,MAAM;IAOxB,MAAM,CAAC,EAAE,EAAE,MAAM;CAMlB"}
1
+ {"version":3,"file":"node.client.d.ts","sourceRoot":"","sources":["../../../src/application/node/node.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,IAAI,EACJ,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,UAAU;IAGjB,OAAO,CAAC,UAAU;IAFvB,UAAU,EAAE,gBAAgB,CAAC;gBAEhB,UAAU,EAAE,UAAU;IAIpC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBJ,IAAI,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAef,MAAM,CAAC,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAe9B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmB9C,aAAa,CAAC,EAAE,EAAE,MAAM;IAOxB,MAAM,CAAC,EAAE,EAAE,MAAM;CAMlB"}
@@ -1,4 +1,6 @@
1
+ import z from "zod";
1
2
  import AllocationClient from "./allocation/allocation.client.js";
3
+ import { createNodeSchema, nodeId } from "./node.schemas.js";
2
4
  export default class NodeClient {
3
5
  httpClient;
4
6
  allocation;
@@ -21,7 +23,7 @@ export default class NodeClient {
21
23
  };
22
24
  }
23
25
  async info(id) {
24
- const res = await this.httpClient.request("GET", `/application/nodes/${id}`);
26
+ const res = await this.httpClient.request("GET", `/application/nodes/${nodeId.parse(id)}`);
25
27
  return {
26
28
  ...res,
27
29
  attributes: {
@@ -32,7 +34,7 @@ export default class NodeClient {
32
34
  };
33
35
  }
34
36
  async create(options) {
35
- const res = await this.httpClient.request("POST", "/application/nodes", options);
37
+ const res = await this.httpClient.request("POST", "/application/nodes", createNodeSchema.parse(options));
36
38
  return {
37
39
  ...res,
38
40
  attributes: {
@@ -43,7 +45,7 @@ export default class NodeClient {
43
45
  };
44
46
  }
45
47
  async edit(id, options) {
46
- const res = await this.httpClient.request("PATCH", `/application/nodes/${id}`, options);
48
+ const res = await this.httpClient.request("PATCH", `/application/nodes/${nodeId.parse(id)}`, createNodeSchema.parse(options));
47
49
  return {
48
50
  ...res,
49
51
  attributes: {
@@ -54,9 +56,9 @@ export default class NodeClient {
54
56
  };
55
57
  }
56
58
  configuration(id) {
57
- return this.httpClient.request("GET", `/application/nodes/${id}/configuration`);
59
+ return this.httpClient.request("GET", `/application/nodes/${nodeId.parse(id)}/configuration`);
58
60
  }
59
61
  delete(id) {
60
- return this.httpClient.request("DELETE", `/application/nodes/${id}`);
62
+ return this.httpClient.request("DELETE", `/application/nodes/${nodeId.parse(id)}`);
61
63
  }
62
64
  }
@@ -0,0 +1,24 @@
1
+ import z from "zod";
2
+ export declare const nodeId: z.ZodNumber;
3
+ export declare const createNodeSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ location_id: z.ZodNumber;
7
+ fqdn: z.ZodString;
8
+ scheme: z.ZodEnum<{
9
+ https: "https";
10
+ http: "http";
11
+ }>;
12
+ behind_proxy: z.ZodOptional<z.ZodBoolean>;
13
+ public: z.ZodOptional<z.ZodBoolean>;
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>;
22
+ maintenance_mode: z.ZodOptional<z.ZodBoolean>;
23
+ }, z.z.core.$strip>;
24
+ //# sourceMappingURL=node.schemas.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,20 @@
1
+ import z from "zod";
2
+ export const nodeId = z.number();
3
+ export const createNodeSchema = z.object({
4
+ name: z.string().min(1).max(191),
5
+ description: z.string().optional(),
6
+ location_id: z.number(),
7
+ fqdn: z.string().min(1).max(191),
8
+ scheme: z.enum(["https", "http"]),
9
+ behind_proxy: z.boolean().optional(),
10
+ public: z.boolean().optional(),
11
+ 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(),
19
+ maintenance_mode: z.boolean().optional(),
20
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"database.client.d.ts","sourceRoot":"","sources":["../../../../src/application/server/database/database.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAIV,yBAAyB,EAE1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,cAAc;IAGrB,OAAO,CAAC,UAAU;IAFvB,QAAQ,EAAE,cAAc,CAAC;gBAEZ,UAAU,EAAE,UAAU;IAIpC,IAAI,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;IAkBnB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;IAerC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB;;;;;;;;;;;;;;;;;IAe5D,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMxC"}
1
+ {"version":3,"file":"database.client.d.ts","sourceRoot":"","sources":["../../../../src/application/server/database/database.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAE3D,OAAO,KAAK,EAGV,yBAAyB,EAE1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,cAAc;IAGrB,OAAO,CAAC,UAAU;IAFvB,QAAQ,EAAE,cAAc,CAAC;gBAEZ,UAAU,EAAE,UAAU;IAIpC,IAAI,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;IAkBnB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;IAerC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB;;;;;;;;;;;;;;;;;IAmB5D,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMxC"}
@@ -1,3 +1,5 @@
1
+ import z from "zod";
2
+ import { applicationServerDatabaseId, applicationServerId, createApplicationDatabaseSchema } from "../server.schemas.js";
1
3
  import PasswordClient from "./password/password.client.js";
2
4
  export default class DatabaseClient {
3
5
  httpClient;
@@ -7,7 +9,7 @@ export default class DatabaseClient {
7
9
  this.password = new PasswordClient(httpClient);
8
10
  }
9
11
  async list(server) {
10
- const res = await this.httpClient.request("GET", `/application/servers/${server}/databases`);
12
+ const res = await this.httpClient.request("GET", `/application/servers/${applicationServerId.parse(server)}/databases`);
11
13
  return {
12
14
  ...res,
13
15
  data: res.data.map((db) => ({
@@ -21,7 +23,7 @@ export default class DatabaseClient {
21
23
  };
22
24
  }
23
25
  async info(server, database) {
24
- const res = await this.httpClient.request("GET", `/application/servers/${server}/databases/${database}`);
26
+ const res = await this.httpClient.request("GET", `/application/servers/${applicationServerId.parse(server)}/databases/${applicationServerDatabaseId.parse(database)}`);
25
27
  return {
26
28
  ...res,
27
29
  attributes: {
@@ -32,7 +34,7 @@ export default class DatabaseClient {
32
34
  };
33
35
  }
34
36
  async create(server, args) {
35
- const res = await this.httpClient.request("POST", `/application/servers/${server}/databases`, args);
37
+ const res = await this.httpClient.request("POST", `/application/servers/${applicationServerId.parse(server)}/databases`, createApplicationDatabaseSchema.parse(args));
36
38
  return {
37
39
  ...res,
38
40
  attributes: {
@@ -43,6 +45,6 @@ export default class DatabaseClient {
43
45
  };
44
46
  }
45
47
  delete(server, database) {
46
- return this.httpClient.request("DELETE", `/application/servers/${server}/databases/${database}`);
48
+ return this.httpClient.request("DELETE", `/application/servers/${applicationServerId.parse(server)}/databases/${applicationServerDatabaseId.parse(database)}`);
47
49
  }
48
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"password.client.d.ts","sourceRoot":"","sources":["../../../../../src/application/server/database/password/password.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,cAAc;IACrB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMvC"}
1
+ {"version":3,"file":"password.client.d.ts","sourceRoot":"","sources":["../../../../../src/application/server/database/password/password.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAM9D,MAAM,CAAC,OAAO,OAAO,cAAc;IACrB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMvC"}
@@ -1,9 +1,10 @@
1
+ import { applicationServerDatabaseId, applicationServerId, } from "../../server.schemas.js";
1
2
  export default class PasswordClient {
2
3
  httpClient;
3
4
  constructor(httpClient) {
4
5
  this.httpClient = httpClient;
5
6
  }
6
7
  reset(server, database) {
7
- return this.httpClient.request("POST", `/application/servers/${server}/databases/${database}/reset-password`);
8
+ return this.httpClient.request("POST", `/application/servers/${applicationServerId.parse(server)}/databases/${applicationServerDatabaseId.parse(database)}/reset-password`);
8
9
  }
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.client.d.ts","sourceRoot":"","sources":["../../../src/application/server/server.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAEV,gBAAgB,EAChB,yBAAyB,EAI1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,YAAY;IAGnB,OAAO,CAAC,UAAU;IAFvB,QAAQ,EAAE,cAAc,CAAC;gBAEZ,UAAU,EAAE,UAAU;IAIpC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeJ,IAAI,CAAC,EACT,EAAE,EACF,WAAW,GACZ,EAAE;QACD,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BK,MAAM,CAAC,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAehC,IAAI,CACR,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2ChE,OAAO,CAAC,EAAE,EAAE,MAAM;IAMlB,SAAS,CAAC,EAAE,EAAE,MAAM;IAMpB,SAAS,CAAC,EAAE,EAAE,MAAM;IAMpB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS;CAK/C"}
1
+ {"version":3,"file":"server.client.d.ts","sourceRoot":"","sources":["../../../src/application/server/server.client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAU3D,OAAO,KAAK,EAEV,gBAAgB,EAChB,yBAAyB,EAI1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,YAAY;IAGnB,OAAO,CAAC,UAAU;IAFvB,QAAQ,EAAE,cAAc,CAAC;gBAEZ,UAAU,EAAE,UAAU;IAIpC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeJ,IAAI,CAAC,EACT,EAAE,EACF,WAAW,GACZ,EAAE;QACD,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkCK,MAAM,CAAC,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAehC,IAAI,CACR,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuDhE,OAAO,CAAC,EAAE,EAAE,MAAM;IAMlB,SAAS,CAAC,EAAE,EAAE,MAAM;IASpB,SAAS,CAAC,EAAE,EAAE,MAAM;IASpB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS;CAQ/C"}
@@ -1,4 +1,6 @@
1
+ import z from "zod";
1
2
  import DatabaseClient from "./database/database.client.js";
3
+ import { applicationServerExternalId, applicationServerId, createApplicationDatabaseSchema, createServerSchema, editApplicationServerConfigurationSchema, editApplicationServerDetailsSchema, editApplicationServerStartupSchema, } from "./server.schemas.js";
2
4
  export default class ServerClient {
3
5
  httpClient;
4
6
  database;
@@ -19,7 +21,7 @@ export default class ServerClient {
19
21
  }
20
22
  async info({ id, external_id, }) {
21
23
  if (id) {
22
- const res = await this.httpClient.request("GET", `/application/servers/${id}`);
24
+ const res = await this.httpClient.request("GET", `/application/servers/${applicationServerId.parse(id)}`);
23
25
  return {
24
26
  ...res,
25
27
  attributes: {
@@ -30,7 +32,7 @@ export default class ServerClient {
30
32
  };
31
33
  }
32
34
  else if (external_id) {
33
- const res = await this.httpClient.request("GET", `/application/servers/external/${external_id}`);
35
+ const res = await this.httpClient.request("GET", `/application/servers/external/${applicationServerExternalId.parse(external_id)}`);
34
36
  return {
35
37
  ...res,
36
38
  attributes: {
@@ -41,10 +43,10 @@ export default class ServerClient {
41
43
  };
42
44
  }
43
45
  else
44
- throw new Error("Vous devez spécifier au moins un des 2 paramètres de recherche d'un utilisateur !");
46
+ throw new Error("Vous devez spécifier au moins un des 2 paramètres de recherche d'un serveur !");
45
47
  }
46
48
  async create(options) {
47
- const res = await this.httpClient.request("POST", `/application/servers`, options);
49
+ const res = await this.httpClient.request("POST", `/application/servers`, createServerSchema.parse(options));
48
50
  return {
49
51
  ...res,
50
52
  attributes: {
@@ -55,14 +57,14 @@ export default class ServerClient {
55
57
  };
56
58
  }
57
59
  async edit(server, { details, configuration, startup }) {
58
- const basePath = `/application/servers/${server}`;
60
+ const basePath = `/application/servers/${applicationServerId.parse(server)}`;
59
61
  const requests = [];
60
62
  if (details)
61
- requests.push(this.httpClient.request("PATCH", `${basePath}/details`, details));
63
+ requests.push(this.httpClient.request("PATCH", `${basePath}/details`, editApplicationServerDetailsSchema.parse(details)));
62
64
  if (configuration)
63
- requests.push(this.httpClient.request("PATCH", `${basePath}/build`, configuration));
65
+ requests.push(this.httpClient.request("PATCH", `${basePath}/build`, editApplicationServerConfigurationSchema.parse(configuration)));
64
66
  if (startup)
65
- requests.push(this.httpClient.request("PATCH", `${basePath}/startup`, startup));
67
+ requests.push(this.httpClient.request("PATCH", `${basePath}/startup`, editApplicationServerStartupSchema.parse(startup)));
66
68
  if (requests.length === 0)
67
69
  throw new Error("Aucunes modifications spécifiées !");
68
70
  const res = await Promise.all(requests);
@@ -76,15 +78,15 @@ export default class ServerClient {
76
78
  };
77
79
  }
78
80
  suspend(id) {
79
- return this.httpClient.request("POST", `/application/servers/${id}/suspend`);
81
+ return this.httpClient.request("POST", `/application/servers/${applicationServerId.parse(id)}/suspend`);
80
82
  }
81
83
  unsuspend(id) {
82
- return this.httpClient.request("POST", `/application/servers/${id}/unsuspend`);
84
+ return this.httpClient.request("POST", `/application/servers/${applicationServerId.parse(id)}/unsuspend`);
83
85
  }
84
86
  reinstall(id) {
85
- return this.httpClient.request("POST", `/application/servers/${id}/reinstall`);
87
+ return this.httpClient.request("POST", `/application/servers/${applicationServerId.parse(id)}/reinstall`);
86
88
  }
87
89
  delete(id, force) {
88
- return this.httpClient.request("DELETE", `/application/servers/${id}${force ? "?force=true" : ""}`);
90
+ return this.httpClient.request("DELETE", `/application/servers/${applicationServerId.parse(id)}${force ? "?force=true" : ""}`);
89
91
  }
90
92
  }
@@ -0,0 +1,72 @@
1
+ import z from "zod";
2
+ export declare const applicationServerId: z.ZodNumber;
3
+ export declare const applicationServerExternalId: z.ZodString;
4
+ export declare const applicationServerDatabaseId: z.ZodNumber;
5
+ export declare const createServerSchema: z.ZodObject<{
6
+ external_id: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodString;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ user: z.ZodNumber;
10
+ egg: z.ZodNumber;
11
+ docker_image: z.ZodString;
12
+ startup: z.ZodString;
13
+ environment: z.ZodRecord<z.ZodString, z.ZodString>;
14
+ skip_scripts: z.ZodOptional<z.ZodBoolean>;
15
+ oom_disabled: z.ZodOptional<z.ZodBoolean>;
16
+ limits: z.ZodObject<{
17
+ memory: z.ZodNumber;
18
+ swap: z.ZodNumber;
19
+ disk: z.ZodNumber;
20
+ io: z.ZodNumber;
21
+ threads: z.ZodOptional<z.ZodString>;
22
+ cpu: z.ZodNumber;
23
+ }, z.z.core.$strip>;
24
+ feature_limits: z.ZodObject<{
25
+ databases: z.ZodNumber;
26
+ backups: z.ZodNumber;
27
+ allocations: z.ZodOptional<z.ZodNumber>;
28
+ }, z.z.core.$strip>;
29
+ allocation: z.ZodObject<{
30
+ default: z.ZodNumber;
31
+ additional: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
32
+ }, z.z.core.$strip>;
33
+ start_on_completion: z.ZodOptional<z.ZodBoolean>;
34
+ }, z.z.core.$strip>;
35
+ export declare const editApplicationServerDetailsSchema: z.ZodObject<{
36
+ name: z.ZodString;
37
+ user: z.ZodNumber;
38
+ external_id: z.ZodOptional<z.ZodString>;
39
+ description: z.ZodOptional<z.ZodString>;
40
+ }, z.z.core.$strip>;
41
+ export declare const editApplicationServerConfigurationSchema: z.ZodObject<{
42
+ allocation: z.ZodNumber;
43
+ oom_disabled: z.ZodOptional<z.ZodBoolean>;
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>;
49
+ threads: z.ZodOptional<z.ZodString>;
50
+ cpu: z.ZodOptional<z.ZodNumber>;
51
+ }, z.z.core.$strip>;
52
+ feature_limits: z.ZodOptional<z.ZodObject<{
53
+ databases: z.ZodNumber;
54
+ backups: z.ZodNumber;
55
+ allocations: z.ZodOptional<z.ZodNumber>;
56
+ }, z.z.core.$strip>>;
57
+ add_allocations: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
58
+ remove_allocations: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
59
+ }, z.z.core.$strip>;
60
+ export declare const editApplicationServerStartupSchema: z.ZodObject<{
61
+ startup: z.ZodString;
62
+ environment: z.ZodRecord<z.ZodString, z.ZodString>;
63
+ egg: z.ZodNumber;
64
+ image: z.ZodString;
65
+ skip_scripts: z.ZodBoolean;
66
+ }, z.z.core.$strip>;
67
+ export declare const createApplicationDatabaseSchema: z.ZodObject<{
68
+ database: z.ZodString;
69
+ remote: z.ZodString;
70
+ host: z.ZodNumber;
71
+ }, z.z.core.$strip>;
72
+ //# sourceMappingURL=server.schemas.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,85 @@
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();
5
+ export const createServerSchema = z.object({
6
+ 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(),
11
+ docker_image: z
12
+ .string()
13
+ .max(191)
14
+ .regex(/^~?[\w\.\/\-:@ ]*$/),
15
+ startup: z.string(),
16
+ environment: z.record(z.string().uppercase(), z.string()),
17
+ skip_scripts: z.boolean().optional(),
18
+ oom_disabled: z.boolean().optional(),
19
+ 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),
24
+ threads: z
25
+ .string()
26
+ .regex(/^[0-9-,]+$/)
27
+ .optional(),
28
+ cpu: z.number().min(0),
29
+ }),
30
+ feature_limits: z.object({
31
+ databases: z.number().min(0),
32
+ backups: z.number().min(0),
33
+ allocations: z.number().min(0).optional(),
34
+ }),
35
+ allocation: z.object({
36
+ default: z.number(),
37
+ additional: z.array(z.number()).optional(),
38
+ }),
39
+ start_on_completion: z.boolean().optional(),
40
+ });
41
+ export const editApplicationServerDetailsSchema = z.object({
42
+ name: z.string().min(1).max(191),
43
+ user: z.number(),
44
+ external_id: applicationServerExternalId.optional(),
45
+ description: z.string().optional(),
46
+ });
47
+ export const editApplicationServerConfigurationSchema = z.object({
48
+ allocation: z.number(),
49
+ oom_disabled: z.boolean().optional(),
50
+ 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(),
55
+ threads: z
56
+ .string()
57
+ .regex(/^[0-9-,]+$/)
58
+ .optional(),
59
+ cpu: z.number().min(0).optional(),
60
+ }),
61
+ feature_limits: z
62
+ .object({
63
+ databases: z.number().min(0),
64
+ backups: z.number().min(0),
65
+ allocations: z.number().min(0).optional(),
66
+ })
67
+ .optional(),
68
+ add_allocations: z.number().array().optional(),
69
+ remove_allocations: z.number().array().optional(),
70
+ });
71
+ export const editApplicationServerStartupSchema = z.object({
72
+ startup: z.string(),
73
+ environment: z.record(z.string().uppercase(), z.string()),
74
+ egg: z.number(),
75
+ image: z
76
+ .string()
77
+ .max(191)
78
+ .regex(/^~?[\w\.\/\-:@ ]*$/),
79
+ skip_scripts: z.boolean(),
80
+ });
81
+ export const createApplicationDatabaseSchema = z.object({
82
+ database: z.string().min(1).max(48),
83
+ remote: z.string().regex(/^[0-9%.]{1,15}$/),
84
+ host: z.number(),
85
+ });