@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, 'Name is required').optional(),
14
- address: zod_1.z.string().min(2, 'Address is required').optional(),
15
- port: zod_1.z.number().int().min(1, 'Port is required').optional(),
16
- isTrafficTrackingActive: zod_1.z.boolean().optional(),
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
- .optional(),
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 = ['DAYS_LEFT', 'TRAFFIC_USED', 'TRAFFIC_LEFT', 'STATUS'];
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, 'Name is required').optional(),
12
- address: z.string().min(2, 'Address is required').optional(),
13
- port: z.number().int().min(1, 'Port is required').optional(),
14
- isTrafficTrackingActive: z.boolean().optional(),
15
- trafficLimitBytes: z
16
- .number()
17
- .int()
18
- .min(0, 'Traffic limit must be greater than 0')
19
- .optional(),
20
- notifyPercent: z
21
- .number()
22
- .int()
23
- .min(0, 'Notify percent must be greater than 0')
24
- .max(100, 'Notify percent must be less than 100')
25
- .optional(),
26
- trafficResetDay: z
27
- .number()
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 = ['DAYS_LEFT', 'TRAFFIC_USED', 'TRAFFIC_LEFT', 'STATUS'] as const;
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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.27",
3
+ "version": "0.0.30",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "index.js",
6
6
  "scripts": {