@remnawave/backend-contract 0.0.27 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
@@ -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,
|
@@ -1,4 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TEMPLATE_KEYS = void 0;
|
4
|
-
exports.TEMPLATE_KEYS = [
|
4
|
+
exports.TEMPLATE_KEYS = [
|
5
|
+
'DAYS_LEFT',
|
6
|
+
'TRAFFIC_USED',
|
7
|
+
'TRAFFIC_LEFT',
|
8
|
+
'STATUS',
|
9
|
+
'TOTAL_TRAFFIC',
|
10
|
+
];
|
@@ -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>;
|
@@ -1,2 +1,8 @@
|
|
1
|
-
export const TEMPLATE_KEYS = [
|
1
|
+
export const TEMPLATE_KEYS = [
|
2
|
+
'DAYS_LEFT',
|
3
|
+
'TRAFFIC_USED',
|
4
|
+
'TRAFFIC_LEFT',
|
5
|
+
'STATUS',
|
6
|
+
'TOTAL_TRAFFIC',
|
7
|
+
] as const;
|
2
8
|
export type TemplateKeys = (typeof TEMPLATE_KEYS)[number];
|