@remnawave/backend-contract 0.0.40 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
7
7
  var GetOneNodeCommand;
8
8
  (function (GetOneNodeCommand) {
9
9
  GetOneNodeCommand.url = api_1.REST_API.NODES.GET_ONE;
10
+ GetOneNodeCommand.TSQ_url = GetOneNodeCommand.url(':uuid');
10
11
  GetOneNodeCommand.RequestSchema = zod_1.z.object({
11
12
  uuid: zod_1.z.string().uuid(),
12
13
  });
@@ -31,18 +31,6 @@ var GetStatsCommand;
31
31
  totalUsers: zod_1.z.number(),
32
32
  totalTrafficBytes: zod_1.z.string(),
33
33
  }),
34
- stats: zod_1.z.object({
35
- nodesUsageLastTwoDays: zod_1.z.object({
36
- current: zod_1.z.string(),
37
- previous: zod_1.z.string(),
38
- percentage: zod_1.z.number(),
39
- }),
40
- sevenDaysStats: zod_1.z.array(zod_1.z.object({
41
- nodeName: zod_1.z.string(),
42
- totalBytes: zod_1.z.string(),
43
- date: zod_1.z.string(),
44
- })),
45
- }),
46
34
  }),
47
35
  });
48
36
  })(GetStatsCommand || (exports.GetStatsCommand = GetStatsCommand = {}));
@@ -6,23 +6,23 @@ exports.NodesSchema = zod_1.z.object({
6
6
  uuid: zod_1.z.string().uuid(),
7
7
  name: zod_1.z.string(),
8
8
  address: zod_1.z.string(),
9
- port: zod_1.z.number().int().nullable(),
10
- isConnected: zod_1.z.boolean().default(false),
11
- isDisabled: zod_1.z.boolean().default(false),
12
- isConnecting: zod_1.z.boolean().default(false),
13
- isNodeOnline: zod_1.z.boolean().default(false),
14
- isXrayRunning: zod_1.z.boolean().default(false),
15
- lastStatusChange: zod_1.z.date().nullable(),
16
- lastStatusMessage: zod_1.z.string().nullable(),
17
- xrayVersion: zod_1.z.string().nullable(),
18
- isTrafficTrackingActive: zod_1.z.boolean().default(false),
19
- trafficResetDay: zod_1.z.number().int().nullable(),
20
- trafficLimitBytes: zod_1.z.number().nullable(),
21
- trafficUsedBytes: zod_1.z.number().nullable(),
22
- notifyPercent: zod_1.z.number().int().nullable(),
23
- cpuCount: zod_1.z.number().int().nullable(),
24
- cpuModel: zod_1.z.string().nullable(),
25
- totalRam: zod_1.z.string().nullable(),
9
+ port: zod_1.z.nullable(zod_1.z.number().int()),
10
+ isConnected: zod_1.z.boolean(),
11
+ isDisabled: zod_1.z.boolean(),
12
+ isConnecting: zod_1.z.boolean(),
13
+ isNodeOnline: zod_1.z.boolean(),
14
+ isXrayRunning: zod_1.z.boolean(),
15
+ lastStatusChange: zod_1.z.nullable(zod_1.z.date()),
16
+ lastStatusMessage: zod_1.z.nullable(zod_1.z.string()),
17
+ xrayVersion: zod_1.z.nullable(zod_1.z.string()),
18
+ isTrafficTrackingActive: zod_1.z.boolean(),
19
+ trafficResetDay: zod_1.z.nullable(zod_1.z.number().int()),
20
+ trafficLimitBytes: zod_1.z.nullable(zod_1.z.number()),
21
+ trafficUsedBytes: zod_1.z.nullable(zod_1.z.number()),
22
+ notifyPercent: zod_1.z.nullable(zod_1.z.number().int()),
23
+ cpuCount: zod_1.z.nullable(zod_1.z.number().int()),
24
+ cpuModel: zod_1.z.nullable(zod_1.z.string()),
25
+ totalRam: zod_1.z.nullable(zod_1.z.string()),
26
26
  createdAt: zod_1.z.date(),
27
27
  updatedAt: zod_1.z.date(),
28
28
  });
@@ -4,6 +4,7 @@ import { NodesSchema } from '../../models';
4
4
 
5
5
  export namespace GetOneNodeCommand {
6
6
  export const url = REST_API.NODES.GET_ONE;
7
+ export const TSQ_url = url(':uuid');
7
8
 
8
9
  export const RequestSchema = z.object({
9
10
  uuid: z.string().uuid(),
@@ -35,20 +35,6 @@ export namespace GetStatsCommand {
35
35
  totalUsers: z.number(),
36
36
  totalTrafficBytes: z.string(),
37
37
  }),
38
- stats: z.object({
39
- nodesUsageLastTwoDays: z.object({
40
- current: z.string(),
41
- previous: z.string(),
42
- percentage: z.number(),
43
- }),
44
- sevenDaysStats: z.array(
45
- z.object({
46
- nodeName: z.string(),
47
- totalBytes: z.string(),
48
- date: z.string(),
49
- }),
50
- ),
51
- }),
52
38
  }),
53
39
  });
54
40
 
@@ -4,24 +4,24 @@ export const NodesSchema = z.object({
4
4
  uuid: z.string().uuid(),
5
5
  name: z.string(),
6
6
  address: z.string(),
7
- port: z.number().int().nullable(),
8
- isConnected: z.boolean().default(false),
9
- isDisabled: z.boolean().default(false),
10
- isConnecting: z.boolean().default(false),
11
- isNodeOnline: z.boolean().default(false),
12
- isXrayRunning: z.boolean().default(false),
13
- lastStatusChange: z.date().nullable(),
14
- lastStatusMessage: z.string().nullable(),
15
- xrayVersion: z.string().nullable(),
16
- isTrafficTrackingActive: z.boolean().default(false),
17
- trafficResetDay: z.number().int().nullable(),
18
- trafficLimitBytes: z.number().nullable(),
19
- trafficUsedBytes: z.number().nullable(),
20
- notifyPercent: z.number().int().nullable(),
7
+ port: z.nullable(z.number().int()),
8
+ isConnected: z.boolean(),
9
+ isDisabled: z.boolean(),
10
+ isConnecting: z.boolean(),
11
+ isNodeOnline: z.boolean(),
12
+ isXrayRunning: z.boolean(),
13
+ lastStatusChange: z.nullable(z.date()),
14
+ lastStatusMessage: z.nullable(z.string()),
15
+ xrayVersion: z.nullable(z.string()),
16
+ isTrafficTrackingActive: z.boolean(),
17
+ trafficResetDay: z.nullable(z.number().int()),
18
+ trafficLimitBytes: z.nullable(z.number()),
19
+ trafficUsedBytes: z.nullable(z.number()),
20
+ notifyPercent: z.nullable(z.number().int()),
21
21
 
22
- cpuCount: z.number().int().nullable(),
23
- cpuModel: z.string().nullable(),
24
- totalRam: z.string().nullable(),
22
+ cpuCount: z.nullable(z.number().int()),
23
+ cpuModel: z.nullable(z.string()),
24
+ totalRam: z.nullable(z.string()),
25
25
 
26
26
  createdAt: z.date(),
27
27
  updatedAt: z.date(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "index.js",
6
6
  "scripts": {