@remnawave/backend-contract 0.3.73 → 0.3.75

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 (26) hide show
  1. package/build/backend/api/controllers/nodes.d.ts +1 -0
  2. package/build/backend/api/controllers/nodes.d.ts.map +1 -1
  3. package/build/backend/api/controllers/nodes.js +1 -0
  4. package/build/backend/api/routes.d.ts +1 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +1 -0
  7. package/build/backend/commands/nodes/get-node-user-usage-by-range.command.d.ts +63 -0
  8. package/build/backend/commands/nodes/get-node-user-usage-by-range.command.d.ts.map +1 -0
  9. package/build/backend/commands/nodes/get-node-user-usage-by-range.command.js +26 -0
  10. package/build/backend/commands/nodes/index.d.ts +1 -0
  11. package/build/backend/commands/nodes/index.d.ts.map +1 -1
  12. package/build/backend/commands/nodes/index.js +1 -0
  13. package/build/backend/commands/users/get-user-usage-by-range.command.d.ts +4 -4
  14. package/build/backend/constants/errors/errors.d.ts +5 -0
  15. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  16. package/build/backend/constants/errors/errors.js +5 -0
  17. package/build/backend/constants/events/events.d.ts +0 -2
  18. package/build/backend/constants/events/events.d.ts.map +1 -1
  19. package/build/backend/constants/events/events.js +0 -2
  20. package/build/frontend/api/controllers/nodes.js +1 -0
  21. package/build/frontend/api/routes.js +1 -0
  22. package/build/frontend/commands/nodes/get-node-user-usage-by-range.command.js +26 -0
  23. package/build/frontend/commands/nodes/index.js +1 -0
  24. package/build/frontend/constants/errors/errors.js +5 -0
  25. package/build/frontend/constants/events/events.js +0 -2
  26. package/package.json +1 -1
@@ -11,6 +11,7 @@ export declare const NODES_ROUTES: {
11
11
  readonly GET_ONE: "get-one";
12
12
  readonly STATS: {
13
13
  readonly USAGE_BY_RANGE: "usage/range";
14
+ readonly USAGE_BY_RANGE_USER: "usage/users/range";
14
15
  };
15
16
  readonly REORDER: "reorder";
16
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../api/controllers/nodes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAef,CAAC"}
1
+ {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../api/controllers/nodes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;CAgBf,CAAC"}
@@ -14,6 +14,7 @@ exports.NODES_ROUTES = {
14
14
  GET_ONE: 'get-one',
15
15
  STATS: {
16
16
  USAGE_BY_RANGE: 'usage/range',
17
+ USAGE_BY_RANGE_USER: 'usage/users/range',
17
18
  },
18
19
  REORDER: 'reorder',
19
20
  };
@@ -27,6 +27,7 @@ export declare const REST_API: {
27
27
  readonly RESTART_ALL: "/api/nodes/restart-all";
28
28
  readonly STATS: {
29
29
  readonly USAGE_BY_RANGE: "/api/nodes/usage/range";
30
+ readonly USAGE_BY_RANGE_USER: (uuid: string) => string;
30
31
  };
31
32
  readonly REORDER: "/api/nodes/reorder";
32
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;+CAGI,MAAM;;4CAGT,MAAM;;;;;;;;;;;;;kDAcA,MAAM;uCAEjB,MAAM;;gDAGG,MAAM;;;;kCAKpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;iDAKW,MAAM;;;;;;;;;;;kDAYL,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;+CAGI,MAAM;;4CAGT,MAAM;;;;;;;;;;;;;kDAcA,MAAM;uCAEjB,MAAM;;gDAGG,MAAM;;;;kCAKpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
@@ -64,6 +64,7 @@ exports.REST_API = {
64
64
  RESTART_ALL: `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.RESTART_ALL}`,
65
65
  STATS: {
66
66
  USAGE_BY_RANGE: `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.STATS.USAGE_BY_RANGE}`,
67
+ USAGE_BY_RANGE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.STATS.USAGE_BY_RANGE_USER}/${uuid}`,
67
68
  },
68
69
  REORDER: `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.REORDER}`,
69
70
  },
@@ -0,0 +1,63 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetNodeUserUsageByRangeCommand {
3
+ const url: (uuid: string) => string;
4
+ const TSQ_url: string;
5
+ const RequestSchema: z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ uuid: string;
9
+ }, {
10
+ uuid: string;
11
+ }>;
12
+ type Request = z.infer<typeof RequestSchema>;
13
+ const RequestQuerySchema: z.ZodObject<{
14
+ start: z.ZodString;
15
+ end: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ start: string;
18
+ end: string;
19
+ }, {
20
+ start: string;
21
+ end: string;
22
+ }>;
23
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
24
+ const ResponseSchema: z.ZodObject<{
25
+ response: z.ZodArray<z.ZodObject<{
26
+ userUuid: z.ZodString;
27
+ username: z.ZodString;
28
+ nodeUuid: z.ZodString;
29
+ total: z.ZodNumber;
30
+ date: z.ZodEffects<z.ZodString, Date, string>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ username: string;
33
+ date: Date;
34
+ userUuid: string;
35
+ nodeUuid: string;
36
+ total: number;
37
+ }, {
38
+ username: string;
39
+ date: string;
40
+ userUuid: string;
41
+ nodeUuid: string;
42
+ total: number;
43
+ }>, "many">;
44
+ }, "strip", z.ZodTypeAny, {
45
+ response: {
46
+ username: string;
47
+ date: Date;
48
+ userUuid: string;
49
+ nodeUuid: string;
50
+ total: number;
51
+ }[];
52
+ }, {
53
+ response: {
54
+ username: string;
55
+ date: string;
56
+ userUuid: string;
57
+ nodeUuid: string;
58
+ total: number;
59
+ }[];
60
+ }>;
61
+ type Response = z.infer<typeof ResponseSchema>;
62
+ }
63
+ //# sourceMappingURL=get-node-user-usage-by-range.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-node-user-usage-by-range.command.d.ts","sourceRoot":"","sources":["../../../../commands/nodes/get-node-user-usage-by-range.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,8BAA8B,CAAC;IACrC,MAAM,GAAG,0BAA2C,CAAC;IACrD,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,kBAAkB;;;;;;;;;MAG7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetNodeUserUsageByRangeCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var GetNodeUserUsageByRangeCommand;
7
+ (function (GetNodeUserUsageByRangeCommand) {
8
+ GetNodeUserUsageByRangeCommand.url = api_1.REST_API.NODES.STATS.USAGE_BY_RANGE_USER;
9
+ GetNodeUserUsageByRangeCommand.TSQ_url = GetNodeUserUsageByRangeCommand.url(':uuid');
10
+ GetNodeUserUsageByRangeCommand.RequestSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().uuid(),
12
+ });
13
+ GetNodeUserUsageByRangeCommand.RequestQuerySchema = zod_1.z.object({
14
+ start: zod_1.z.string(),
15
+ end: zod_1.z.string(),
16
+ });
17
+ GetNodeUserUsageByRangeCommand.ResponseSchema = zod_1.z.object({
18
+ response: zod_1.z.array(zod_1.z.object({
19
+ userUuid: zod_1.z.string().uuid(),
20
+ username: zod_1.z.string(),
21
+ nodeUuid: zod_1.z.string().uuid(),
22
+ total: zod_1.z.number(),
23
+ date: zod_1.z.string().transform((str) => new Date(str)),
24
+ })),
25
+ });
26
+ })(GetNodeUserUsageByRangeCommand || (exports.GetNodeUserUsageByRangeCommand = GetNodeUserUsageByRangeCommand = {}));
@@ -3,6 +3,7 @@ export * from './delete.command';
3
3
  export * from './disable.command';
4
4
  export * from './enable.command';
5
5
  export * from './get-all.command';
6
+ export * from './get-node-user-usage-by-range.command';
6
7
  export * from './get-nodes-usage-by-range.command';
7
8
  export * from './get-one.command';
8
9
  export * from './reorder.command';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oCAAoC,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -19,6 +19,7 @@ __exportStar(require("./delete.command"), exports);
19
19
  __exportStar(require("./disable.command"), exports);
20
20
  __exportStar(require("./enable.command"), exports);
21
21
  __exportStar(require("./get-all.command"), exports);
22
+ __exportStar(require("./get-node-user-usage-by-range.command"), exports);
22
23
  __exportStar(require("./get-nodes-usage-by-range.command"), exports);
23
24
  __exportStar(require("./get-one.command"), exports);
24
25
  __exportStar(require("./reorder.command"), exports);
@@ -31,31 +31,31 @@ export declare namespace GetUserUsageByRangeCommand {
31
31
  }, "strip", z.ZodTypeAny, {
32
32
  date: Date;
33
33
  nodeName: string;
34
+ userUuid: string;
34
35
  nodeUuid: string;
35
36
  total: number;
36
- userUuid: string;
37
37
  }, {
38
38
  date: string;
39
39
  nodeName: string;
40
+ userUuid: string;
40
41
  nodeUuid: string;
41
42
  total: number;
42
- userUuid: string;
43
43
  }>, "many">;
44
44
  }, "strip", z.ZodTypeAny, {
45
45
  response: {
46
46
  date: Date;
47
47
  nodeName: string;
48
+ userUuid: string;
48
49
  nodeUuid: string;
49
50
  total: number;
50
- userUuid: string;
51
51
  }[];
52
52
  }, {
53
53
  response: {
54
54
  date: string;
55
55
  nodeName: string;
56
+ userUuid: string;
56
57
  nodeUuid: string;
57
58
  total: number;
58
- userUuid: string;
59
59
  }[];
60
60
  }>;
61
61
  type Response = z.infer<typeof ResponseSchema>;
@@ -494,5 +494,10 @@ export declare const ERRORS: {
494
494
  readonly message: "Activate all inbounds error";
495
495
  readonly httpCode: 500;
496
496
  };
497
+ readonly GET_NODES_USER_USAGE_BY_RANGE_ERROR: {
498
+ readonly code: "A094";
499
+ readonly message: "Get nodes user usage by range error";
500
+ readonly httpCode: 500;
501
+ };
497
502
  };
498
503
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmK3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwK3B,CAAC"}
@@ -465,4 +465,9 @@ exports.ERRORS = {
465
465
  message: 'Activate all inbounds error',
466
466
  httpCode: 500,
467
467
  },
468
+ GET_NODES_USER_USAGE_BY_RANGE_ERROR: {
469
+ code: 'A094',
470
+ message: 'Get nodes user usage by range error',
471
+ httpCode: 500,
472
+ },
468
473
  };
@@ -9,7 +9,6 @@ export declare const EVENTS: {
9
9
  readonly LIMITED: "user.limited";
10
10
  readonly EXPIRED: "user.expired";
11
11
  readonly TRAFFIC_RESET: "user.traffic_reset";
12
- readonly TRAFFIC_REACHED: "user.traffic_reached";
13
12
  readonly EXPIRE_NOTIFY: {
14
13
  readonly EXPIRES_IN_72_HOURS: "user.expires_in_72_hours";
15
14
  readonly EXPIRES_IN_48_HOURS: "user.expires_in_48_hours";
@@ -25,7 +24,6 @@ export declare const EVENTS: {
25
24
  readonly DELETED: "node.deleted";
26
25
  readonly CONNECTION_LOST: "node.connection_lost";
27
26
  readonly CONNECTION_RESTORED: "node.connection_restored";
28
- readonly RESTARTED: "node.restarted";
29
27
  readonly TRAFFIC_NOTIFY: "node.traffic_notify";
30
28
  };
31
29
  readonly CATCH_ALL_USER_EVENTS: "user.*";
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../constants/events/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCT,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../constants/events/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BT,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC"}
@@ -12,7 +12,6 @@ exports.EVENTS = {
12
12
  LIMITED: 'user.limited',
13
13
  EXPIRED: 'user.expired',
14
14
  TRAFFIC_RESET: 'user.traffic_reset',
15
- TRAFFIC_REACHED: 'user.traffic_reached',
16
15
  EXPIRE_NOTIFY: {
17
16
  EXPIRES_IN_72_HOURS: 'user.expires_in_72_hours',
18
17
  EXPIRES_IN_48_HOURS: 'user.expires_in_48_hours',
@@ -28,7 +27,6 @@ exports.EVENTS = {
28
27
  DELETED: 'node.deleted',
29
28
  CONNECTION_LOST: 'node.connection_lost',
30
29
  CONNECTION_RESTORED: 'node.connection_restored',
31
- RESTARTED: 'node.restarted',
32
30
  TRAFFIC_NOTIFY: 'node.traffic_notify',
33
31
  },
34
32
  CATCH_ALL_USER_EVENTS: 'user.*',
@@ -14,6 +14,7 @@ exports.NODES_ROUTES = {
14
14
  GET_ONE: 'get-one',
15
15
  STATS: {
16
16
  USAGE_BY_RANGE: 'usage/range',
17
+ USAGE_BY_RANGE_USER: 'usage/users/range',
17
18
  },
18
19
  REORDER: 'reorder',
19
20
  };
@@ -64,6 +64,7 @@ exports.REST_API = {
64
64
  RESTART_ALL: `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.RESTART_ALL}`,
65
65
  STATS: {
66
66
  USAGE_BY_RANGE: `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.STATS.USAGE_BY_RANGE}`,
67
+ USAGE_BY_RANGE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.STATS.USAGE_BY_RANGE_USER}/${uuid}`,
67
68
  },
68
69
  REORDER: `${exports.ROOT}/${CONTROLLERS.NODES_CONTROLLER}/${CONTROLLERS.NODES_ROUTES.REORDER}`,
69
70
  },
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetNodeUserUsageByRangeCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var GetNodeUserUsageByRangeCommand;
7
+ (function (GetNodeUserUsageByRangeCommand) {
8
+ GetNodeUserUsageByRangeCommand.url = api_1.REST_API.NODES.STATS.USAGE_BY_RANGE_USER;
9
+ GetNodeUserUsageByRangeCommand.TSQ_url = GetNodeUserUsageByRangeCommand.url(':uuid');
10
+ GetNodeUserUsageByRangeCommand.RequestSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().uuid(),
12
+ });
13
+ GetNodeUserUsageByRangeCommand.RequestQuerySchema = zod_1.z.object({
14
+ start: zod_1.z.string(),
15
+ end: zod_1.z.string(),
16
+ });
17
+ GetNodeUserUsageByRangeCommand.ResponseSchema = zod_1.z.object({
18
+ response: zod_1.z.array(zod_1.z.object({
19
+ userUuid: zod_1.z.string().uuid(),
20
+ username: zod_1.z.string(),
21
+ nodeUuid: zod_1.z.string().uuid(),
22
+ total: zod_1.z.number(),
23
+ date: zod_1.z.string().transform((str) => new Date(str)),
24
+ })),
25
+ });
26
+ })(GetNodeUserUsageByRangeCommand || (exports.GetNodeUserUsageByRangeCommand = GetNodeUserUsageByRangeCommand = {}));
@@ -19,6 +19,7 @@ __exportStar(require("./delete.command"), exports);
19
19
  __exportStar(require("./disable.command"), exports);
20
20
  __exportStar(require("./enable.command"), exports);
21
21
  __exportStar(require("./get-all.command"), exports);
22
+ __exportStar(require("./get-node-user-usage-by-range.command"), exports);
22
23
  __exportStar(require("./get-nodes-usage-by-range.command"), exports);
23
24
  __exportStar(require("./get-one.command"), exports);
24
25
  __exportStar(require("./reorder.command"), exports);
@@ -465,4 +465,9 @@ exports.ERRORS = {
465
465
  message: 'Activate all inbounds error',
466
466
  httpCode: 500,
467
467
  },
468
+ GET_NODES_USER_USAGE_BY_RANGE_ERROR: {
469
+ code: 'A094',
470
+ message: 'Get nodes user usage by range error',
471
+ httpCode: 500,
472
+ },
468
473
  };
@@ -12,7 +12,6 @@ exports.EVENTS = {
12
12
  LIMITED: 'user.limited',
13
13
  EXPIRED: 'user.expired',
14
14
  TRAFFIC_RESET: 'user.traffic_reset',
15
- TRAFFIC_REACHED: 'user.traffic_reached',
16
15
  EXPIRE_NOTIFY: {
17
16
  EXPIRES_IN_72_HOURS: 'user.expires_in_72_hours',
18
17
  EXPIRES_IN_48_HOURS: 'user.expires_in_48_hours',
@@ -28,7 +27,6 @@ exports.EVENTS = {
28
27
  DELETED: 'node.deleted',
29
28
  CONNECTION_LOST: 'node.connection_lost',
30
29
  CONNECTION_RESTORED: 'node.connection_restored',
31
- RESTARTED: 'node.restarted',
32
30
  TRAFFIC_NOTIFY: 'node.traffic_notify',
33
31
  },
34
32
  CATCH_ALL_USER_EVENTS: 'user.*',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.3.73",
3
+ "version": "0.3.75",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",