@remnawave/backend-contract 2.0.0-alpha.4 → 2.0.0-alpha.6

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.
@@ -6,6 +6,7 @@ export declare const USERS_ROUTES: {
6
6
  readonly GET: "";
7
7
  readonly DELETE: (uuid: string) => string;
8
8
  readonly GET_BY_UUID: (uuid: string) => string;
9
+ readonly ACCESSIBLE_NODES: (uuid: string) => string;
9
10
  readonly ACTIONS: {
10
11
  readonly ENABLE: (uuid: string) => string;
11
12
  readonly DISABLE: (uuid: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;4BAIN,MAAM;iCACD,MAAM;;gCAEP,MAAM;iCACL,MAAM;uCACA,MAAM;6CACA,MAAM;;;yCAGV,MAAM;sCACT,MAAM;uDACW,MAAM;2CAClB,MAAM;gCACjB,MAAM;4BACV,MAAM;;;;;;;;;;;;;;;4CAiBU,MAAM;;;;;CAM/B,CAAC"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;4BAIN,MAAM;iCACD,MAAM;sCACD,MAAM;;gCAEZ,MAAM;iCACL,MAAM;uCACA,MAAM;6CACA,MAAM;;;yCAGV,MAAM;sCACT,MAAM;uDACW,MAAM;2CAClB,MAAM;gCACjB,MAAM;4BACV,MAAM;;;;;;;;;;;;;;;4CAiBU,MAAM;;;;;CAM/B,CAAC"}
@@ -9,6 +9,7 @@ exports.USERS_ROUTES = {
9
9
  GET: '',
10
10
  DELETE: (uuid) => `${uuid}`,
11
11
  GET_BY_UUID: (uuid) => `${uuid}`,
12
+ ACCESSIBLE_NODES: (uuid) => `${uuid}/accessible-nodes`,
12
13
  ACTIONS: {
13
14
  ENABLE: (uuid) => `${uuid}/${exports.USERS_ACTIONS_ROUTE}/enable`,
14
15
  DISABLE: (uuid) => `${uuid}/${exports.USERS_ACTIONS_ROUTE}/disable`,
@@ -43,6 +43,7 @@ export declare const REST_API: {
43
43
  readonly GET: "/api/users/";
44
44
  readonly DELETE: (uuid: string) => string;
45
45
  readonly GET_BY_UUID: (uuid: string) => string;
46
+ readonly ACCESSIBLE_NODES: (uuid: string) => string;
46
47
  readonly ACTIONS: {
47
48
  readonly DISABLE: (uuid: string) => string;
48
49
  readonly ENABLE: (uuid: string) => string;
@@ -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;;;;;;;;;;;gCAYE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;gCAWvB,MAAM;qCAGD,MAAM;;qCAIN,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;gDAmBU,MAAM;;;;;;;kCAWpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;qCAuBD,MAAM;;;;;;;;;mDAYQ,MAAM;;;;;;0CASf,MAAM;;;;;;;qCAUX,MAAM;gCAIX,MAAM;sDAIgB,MAAM;;;;;;;qCAUvB,MAAM;gCAIX,MAAM;;CAKnB,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;;;;;;;;;;;gCAYE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;gCAWvB,MAAM;qCAGD,MAAM;0CAED,MAAM;;qCAIX,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;gDAmBU,MAAM;;;;;;;kCAWpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;qCAuBD,MAAM;;;;;;;;;mDAYQ,MAAM;;;;;;0CASf,MAAM;;;;;;;qCAUX,MAAM;gCAIX,MAAM;sDAIgB,MAAM;;;;;;;qCAUvB,MAAM;gCAIX,MAAM;;CAKnB,CAAC"}
@@ -80,6 +80,7 @@ exports.REST_API = {
80
80
  GET: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET}`,
81
81
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE(uuid)}`,
82
82
  GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID(uuid)}`,
83
+ ACCESSIBLE_NODES: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACCESSIBLE_NODES(uuid)}`,
83
84
  ACTIONS: {
84
85
  DISABLE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.DISABLE(uuid)}`,
85
86
  ENABLE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.ENABLE(uuid)}`,
@@ -0,0 +1,168 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetUserAccessibleNodesCommand {
3
+ const url: (uuid: string) => string;
4
+ const TSQ_url: string;
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const RequestSchema: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ uuid: string;
10
+ }, {
11
+ uuid: string;
12
+ }>;
13
+ type Request = z.infer<typeof RequestSchema>;
14
+ const ResponseSchema: z.ZodObject<{
15
+ response: z.ZodObject<{
16
+ userUuid: z.ZodString;
17
+ activeNodes: z.ZodArray<z.ZodObject<{
18
+ uuid: z.ZodString;
19
+ nodeName: z.ZodString;
20
+ countryCode: z.ZodString;
21
+ reasons: z.ZodArray<z.ZodObject<{
22
+ configProfileUuid: z.ZodString;
23
+ configProfileName: z.ZodString;
24
+ activeInbounds: z.ZodArray<z.ZodObject<{
25
+ inboundTag: z.ZodString;
26
+ fromSquads: z.ZodArray<z.ZodObject<{
27
+ squadName: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ squadName: string;
30
+ }, {
31
+ squadName: string;
32
+ }>, "many">;
33
+ }, "strip", z.ZodTypeAny, {
34
+ inboundTag: string;
35
+ fromSquads: {
36
+ squadName: string;
37
+ }[];
38
+ }, {
39
+ inboundTag: string;
40
+ fromSquads: {
41
+ squadName: string;
42
+ }[];
43
+ }>, "many">;
44
+ }, "strip", z.ZodTypeAny, {
45
+ configProfileUuid: string;
46
+ activeInbounds: {
47
+ inboundTag: string;
48
+ fromSquads: {
49
+ squadName: string;
50
+ }[];
51
+ }[];
52
+ configProfileName: string;
53
+ }, {
54
+ configProfileUuid: string;
55
+ activeInbounds: {
56
+ inboundTag: string;
57
+ fromSquads: {
58
+ squadName: string;
59
+ }[];
60
+ }[];
61
+ configProfileName: string;
62
+ }>, "many">;
63
+ }, "strip", z.ZodTypeAny, {
64
+ uuid: string;
65
+ countryCode: string;
66
+ nodeName: string;
67
+ reasons: {
68
+ configProfileUuid: string;
69
+ activeInbounds: {
70
+ inboundTag: string;
71
+ fromSquads: {
72
+ squadName: string;
73
+ }[];
74
+ }[];
75
+ configProfileName: string;
76
+ }[];
77
+ }, {
78
+ uuid: string;
79
+ countryCode: string;
80
+ nodeName: string;
81
+ reasons: {
82
+ configProfileUuid: string;
83
+ activeInbounds: {
84
+ inboundTag: string;
85
+ fromSquads: {
86
+ squadName: string;
87
+ }[];
88
+ }[];
89
+ configProfileName: string;
90
+ }[];
91
+ }>, "many">;
92
+ }, "strip", z.ZodTypeAny, {
93
+ userUuid: string;
94
+ activeNodes: {
95
+ uuid: string;
96
+ countryCode: string;
97
+ nodeName: string;
98
+ reasons: {
99
+ configProfileUuid: string;
100
+ activeInbounds: {
101
+ inboundTag: string;
102
+ fromSquads: {
103
+ squadName: string;
104
+ }[];
105
+ }[];
106
+ configProfileName: string;
107
+ }[];
108
+ }[];
109
+ }, {
110
+ userUuid: string;
111
+ activeNodes: {
112
+ uuid: string;
113
+ countryCode: string;
114
+ nodeName: string;
115
+ reasons: {
116
+ configProfileUuid: string;
117
+ activeInbounds: {
118
+ inboundTag: string;
119
+ fromSquads: {
120
+ squadName: string;
121
+ }[];
122
+ }[];
123
+ configProfileName: string;
124
+ }[];
125
+ }[];
126
+ }>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ response: {
129
+ userUuid: string;
130
+ activeNodes: {
131
+ uuid: string;
132
+ countryCode: string;
133
+ nodeName: string;
134
+ reasons: {
135
+ configProfileUuid: string;
136
+ activeInbounds: {
137
+ inboundTag: string;
138
+ fromSquads: {
139
+ squadName: string;
140
+ }[];
141
+ }[];
142
+ configProfileName: string;
143
+ }[];
144
+ }[];
145
+ };
146
+ }, {
147
+ response: {
148
+ userUuid: string;
149
+ activeNodes: {
150
+ uuid: string;
151
+ countryCode: string;
152
+ nodeName: string;
153
+ reasons: {
154
+ configProfileUuid: string;
155
+ activeInbounds: {
156
+ inboundTag: string;
157
+ fromSquads: {
158
+ squadName: string;
159
+ }[];
160
+ }[];
161
+ configProfileName: string;
162
+ }[];
163
+ }[];
164
+ };
165
+ }>;
166
+ type Response = z.infer<typeof ResponseSchema>;
167
+ }
168
+ //# sourceMappingURL=get-user-accessible-nodes.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-user-accessible-nodes.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-user-accessible-nodes.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,6BAA6B,CAAC;IACpC,MAAM,GAAG,0BAAkC,CAAC;IAC5C,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2BzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUserAccessibleNodesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const api_1 = require("../../api");
7
+ var GetUserAccessibleNodesCommand;
8
+ (function (GetUserAccessibleNodesCommand) {
9
+ GetUserAccessibleNodesCommand.url = api_1.REST_API.USERS.ACCESSIBLE_NODES;
10
+ GetUserAccessibleNodesCommand.TSQ_url = GetUserAccessibleNodesCommand.url(':uuid');
11
+ GetUserAccessibleNodesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACCESSIBLE_NODES(':uuid'), 'get', 'Get user accessible nodes');
12
+ GetUserAccessibleNodesCommand.RequestSchema = zod_1.z.object({
13
+ uuid: zod_1.z.string().uuid(),
14
+ });
15
+ GetUserAccessibleNodesCommand.ResponseSchema = zod_1.z.object({
16
+ response: zod_1.z.object({
17
+ userUuid: zod_1.z.string().uuid(),
18
+ activeNodes: zod_1.z.array(zod_1.z.object({
19
+ uuid: zod_1.z.string().uuid(),
20
+ nodeName: zod_1.z.string(),
21
+ countryCode: zod_1.z.string(),
22
+ reasons: zod_1.z.array(zod_1.z.object({
23
+ configProfileUuid: zod_1.z.string().uuid(),
24
+ configProfileName: zod_1.z.string(),
25
+ activeInbounds: zod_1.z.array(zod_1.z.object({
26
+ inboundTag: zod_1.z.string(),
27
+ fromSquads: zod_1.z.array(zod_1.z.object({
28
+ squadName: zod_1.z.string(),
29
+ })),
30
+ })),
31
+ })),
32
+ })),
33
+ }),
34
+ });
35
+ })(GetUserAccessibleNodesCommand || (exports.GetUserAccessibleNodesCommand = GetUserAccessibleNodesCommand = {}));
@@ -5,6 +5,7 @@ export * from './create-user.command';
5
5
  export * from './delete-user.command';
6
6
  export * from './get-all-users.command';
7
7
  export * from './get-by';
8
+ export * from './get-user-accessible-nodes.command';
8
9
  export * from './get-user-by-uuid.command';
9
10
  export * from './get-user-usage-by-range.command';
10
11
  export * from './tags';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AAEzB,cAAc,4BAA4B,CAAC;AAE3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,QAAQ,CAAC;AAEvB,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AAEzB,cAAc,qCAAqC,CAAC;AAEpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAElD,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC"}
@@ -21,6 +21,7 @@ __exportStar(require("./create-user.command"), exports);
21
21
  __exportStar(require("./delete-user.command"), exports);
22
22
  __exportStar(require("./get-all-users.command"), exports);
23
23
  __exportStar(require("./get-by"), exports);
24
+ __exportStar(require("./get-user-accessible-nodes.command"), exports);
24
25
  __exportStar(require("./get-user-by-uuid.command"), exports);
25
26
  __exportStar(require("./get-user-usage-by-range.command"), exports);
26
27
  __exportStar(require("./tags"), exports);
@@ -649,5 +649,10 @@ export declare const ERRORS: {
649
649
  readonly message: "Config profile inbound not found in specified profile";
650
650
  readonly httpCode: 404;
651
651
  };
652
+ readonly GET_USER_ACCESSIBLE_NODES_ERROR: {
653
+ readonly code: "A125";
654
+ readonly message: "Get user accessible nodes error";
655
+ readonly httpCode: 500;
656
+ };
652
657
  };
653
658
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+T3B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoU3B,CAAC"}
@@ -620,4 +620,9 @@ exports.ERRORS = {
620
620
  message: 'Config profile inbound not found in specified profile',
621
621
  httpCode: 404,
622
622
  },
623
+ GET_USER_ACCESSIBLE_NODES_ERROR: {
624
+ code: 'A125',
625
+ message: 'Get user accessible nodes error',
626
+ httpCode: 500,
627
+ },
623
628
  };
@@ -9,6 +9,7 @@ exports.USERS_ROUTES = {
9
9
  GET: '',
10
10
  DELETE: (uuid) => `${uuid}`,
11
11
  GET_BY_UUID: (uuid) => `${uuid}`,
12
+ ACCESSIBLE_NODES: (uuid) => `${uuid}/accessible-nodes`,
12
13
  ACTIONS: {
13
14
  ENABLE: (uuid) => `${uuid}/${exports.USERS_ACTIONS_ROUTE}/enable`,
14
15
  DISABLE: (uuid) => `${uuid}/${exports.USERS_ACTIONS_ROUTE}/disable`,
@@ -80,6 +80,7 @@ exports.REST_API = {
80
80
  GET: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET}`,
81
81
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE(uuid)}`,
82
82
  GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID(uuid)}`,
83
+ ACCESSIBLE_NODES: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACCESSIBLE_NODES(uuid)}`,
83
84
  ACTIONS: {
84
85
  DISABLE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.DISABLE(uuid)}`,
85
86
  ENABLE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.ENABLE(uuid)}`,
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUserAccessibleNodesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const api_1 = require("../../api");
7
+ var GetUserAccessibleNodesCommand;
8
+ (function (GetUserAccessibleNodesCommand) {
9
+ GetUserAccessibleNodesCommand.url = api_1.REST_API.USERS.ACCESSIBLE_NODES;
10
+ GetUserAccessibleNodesCommand.TSQ_url = GetUserAccessibleNodesCommand.url(':uuid');
11
+ GetUserAccessibleNodesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACCESSIBLE_NODES(':uuid'), 'get', 'Get user accessible nodes');
12
+ GetUserAccessibleNodesCommand.RequestSchema = zod_1.z.object({
13
+ uuid: zod_1.z.string().uuid(),
14
+ });
15
+ GetUserAccessibleNodesCommand.ResponseSchema = zod_1.z.object({
16
+ response: zod_1.z.object({
17
+ userUuid: zod_1.z.string().uuid(),
18
+ activeNodes: zod_1.z.array(zod_1.z.object({
19
+ uuid: zod_1.z.string().uuid(),
20
+ nodeName: zod_1.z.string(),
21
+ countryCode: zod_1.z.string(),
22
+ reasons: zod_1.z.array(zod_1.z.object({
23
+ configProfileUuid: zod_1.z.string().uuid(),
24
+ configProfileName: zod_1.z.string(),
25
+ activeInbounds: zod_1.z.array(zod_1.z.object({
26
+ inboundTag: zod_1.z.string(),
27
+ fromSquads: zod_1.z.array(zod_1.z.object({
28
+ squadName: zod_1.z.string(),
29
+ })),
30
+ })),
31
+ })),
32
+ })),
33
+ }),
34
+ });
35
+ })(GetUserAccessibleNodesCommand || (exports.GetUserAccessibleNodesCommand = GetUserAccessibleNodesCommand = {}));
@@ -21,6 +21,7 @@ __exportStar(require("./create-user.command"), exports);
21
21
  __exportStar(require("./delete-user.command"), exports);
22
22
  __exportStar(require("./get-all-users.command"), exports);
23
23
  __exportStar(require("./get-by"), exports);
24
+ __exportStar(require("./get-user-accessible-nodes.command"), exports);
24
25
  __exportStar(require("./get-user-by-uuid.command"), exports);
25
26
  __exportStar(require("./get-user-usage-by-range.command"), exports);
26
27
  __exportStar(require("./tags"), exports);
@@ -620,4 +620,9 @@ exports.ERRORS = {
620
620
  message: 'Config profile inbound not found in specified profile',
621
621
  httpCode: 404,
622
622
  },
623
+ GET_USER_ACCESSIBLE_NODES_ERROR: {
624
+ code: 'A125',
625
+ message: 'Get user accessible nodes error',
626
+ httpCode: 500,
627
+ },
623
628
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.6",
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.",