@remnawave/backend-contract 0.0.28 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/nodes/update.command.js +9 -17
- package/build/commands/xray/index.js +1 -0
- package/build/commands/xray/update-config.command.js +15 -0
- package/build/constants/errors/errors.js +5 -0
- package/commands/nodes/update.command.ts +17 -21
- package/commands/xray/index.ts +1 -0
- package/commands/xray/update-config.command.ts +18 -0
- package/constants/errors/errors.ts +5 -0
- package/package.json +1 -1
@@ -10,27 +10,19 @@ var UpdateNodeCommand;
|
|
10
10
|
UpdateNodeCommand.RequestSchema = models_1.NodesSchema.pick({
|
11
11
|
uuid: true,
|
12
12
|
}).extend({
|
13
|
-
name: zod_1.z.string().min(5, '
|
14
|
-
address: zod_1.z.string().min(2, '
|
15
|
-
port: zod_1.z.
|
16
|
-
isTrafficTrackingActive: zod_1.z.
|
17
|
-
trafficLimitBytes: zod_1.z
|
13
|
+
name: zod_1.z.optional(zod_1.z.string().min(5, 'Min. 5 characters')),
|
14
|
+
address: zod_1.z.optional(zod_1.z.string().min(2, 'Min. 2 characters')),
|
15
|
+
port: zod_1.z.optional(zod_1.z.number()),
|
16
|
+
isTrafficTrackingActive: zod_1.z.optional(zod_1.z.boolean()),
|
17
|
+
trafficLimitBytes: zod_1.z.optional(zod_1.z.number().min(0, 'Traffic limit must be greater than 0')),
|
18
|
+
notifyPercent: zod_1.z.optional(zod_1.z
|
18
19
|
.number()
|
19
|
-
.int()
|
20
|
-
.min(0, 'Traffic limit must be greater than 0')
|
21
|
-
.optional(),
|
22
|
-
notifyPercent: zod_1.z
|
23
|
-
.number()
|
24
|
-
.int()
|
25
20
|
.min(0, 'Notify percent must be greater than 0')
|
26
|
-
.max(100, 'Notify percent must be less than 100')
|
27
|
-
|
28
|
-
trafficResetDay: zod_1.z
|
21
|
+
.max(100, 'Notify percent must be less than 100')),
|
22
|
+
trafficResetDay: zod_1.z.optional(zod_1.z
|
29
23
|
.number()
|
30
|
-
.int()
|
31
24
|
.min(1, 'Traffic reset day must be greater than 0')
|
32
|
-
.max(31, 'Traffic reset day must be less than 31')
|
33
|
-
.optional(),
|
25
|
+
.max(31, 'Traffic reset day must be less than 31')),
|
34
26
|
});
|
35
27
|
UpdateNodeCommand.ResponseSchema = zod_1.z.object({
|
36
28
|
response: models_1.NodesSchema,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.UpdateXrayConfigCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const api_1 = require("../../api");
|
6
|
+
var UpdateXrayConfigCommand;
|
7
|
+
(function (UpdateXrayConfigCommand) {
|
8
|
+
UpdateXrayConfigCommand.url = api_1.REST_API.XRAY.UPDATE_CONFIG;
|
9
|
+
UpdateXrayConfigCommand.RequestSchema = zod_1.z.record(zod_1.z.any());
|
10
|
+
UpdateXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
11
|
+
response: zod_1.z.object({
|
12
|
+
config: zod_1.z.record(zod_1.z.any()),
|
13
|
+
}),
|
14
|
+
});
|
15
|
+
})(UpdateXrayConfigCommand || (exports.UpdateXrayConfigCommand = UpdateXrayConfigCommand = {}));
|
@@ -8,27 +8,23 @@ export namespace UpdateNodeCommand {
|
|
8
8
|
export const RequestSchema = NodesSchema.pick({
|
9
9
|
uuid: true,
|
10
10
|
}).extend({
|
11
|
-
name: z.string().min(5, '
|
12
|
-
address: z.string().min(2, '
|
13
|
-
port: z.
|
14
|
-
isTrafficTrackingActive: z.
|
15
|
-
trafficLimitBytes: z
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
.int()
|
29
|
-
.min(1, 'Traffic reset day must be greater than 0')
|
30
|
-
.max(31, 'Traffic reset day must be less than 31')
|
31
|
-
.optional(),
|
11
|
+
name: z.optional(z.string().min(5, 'Min. 5 characters')),
|
12
|
+
address: z.optional(z.string().min(2, 'Min. 2 characters')),
|
13
|
+
port: z.optional(z.number()),
|
14
|
+
isTrafficTrackingActive: z.optional(z.boolean()),
|
15
|
+
trafficLimitBytes: z.optional(z.number().min(0, 'Traffic limit must be greater than 0')),
|
16
|
+
notifyPercent: z.optional(
|
17
|
+
z
|
18
|
+
.number()
|
19
|
+
.min(0, 'Notify percent must be greater than 0')
|
20
|
+
.max(100, 'Notify percent must be less than 100'),
|
21
|
+
),
|
22
|
+
trafficResetDay: z.optional(
|
23
|
+
z
|
24
|
+
.number()
|
25
|
+
.min(1, 'Traffic reset day must be greater than 0')
|
26
|
+
.max(31, 'Traffic reset day must be less than 31'),
|
27
|
+
),
|
32
28
|
});
|
33
29
|
|
34
30
|
export type Request = z.infer<typeof RequestSchema>;
|
package/commands/xray/index.ts
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { REST_API } from '../../api';
|
3
|
+
|
4
|
+
export namespace UpdateXrayConfigCommand {
|
5
|
+
export const url = REST_API.XRAY.UPDATE_CONFIG;
|
6
|
+
|
7
|
+
export const RequestSchema = z.record(z.any());
|
8
|
+
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
10
|
+
|
11
|
+
export const ResponseSchema = z.object({
|
12
|
+
response: z.object({
|
13
|
+
config: z.record(z.any()),
|
14
|
+
}),
|
15
|
+
});
|
16
|
+
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
18
|
+
}
|