@remnawave/backend-contract 2.0.0-alpha.3 → 2.0.0-alpha.5

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,142 @@
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
+ nodes: z.ZodArray<z.ZodObject<{
18
+ uuid: z.ZodString;
19
+ name: 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
+ fromInternalSquads: z.ZodArray<z.ZodString, "many">;
27
+ }, "strip", z.ZodTypeAny, {
28
+ inboundTag: string;
29
+ fromInternalSquads: string[];
30
+ }, {
31
+ inboundTag: string;
32
+ fromInternalSquads: string[];
33
+ }>, "many">;
34
+ }, "strip", z.ZodTypeAny, {
35
+ configProfileUuid: string;
36
+ activeInbounds: {
37
+ inboundTag: string;
38
+ fromInternalSquads: string[];
39
+ }[];
40
+ configProfileName: string;
41
+ }, {
42
+ configProfileUuid: string;
43
+ activeInbounds: {
44
+ inboundTag: string;
45
+ fromInternalSquads: string[];
46
+ }[];
47
+ configProfileName: string;
48
+ }>, "many">;
49
+ }, "strip", z.ZodTypeAny, {
50
+ uuid: string;
51
+ name: string;
52
+ countryCode: string;
53
+ reasons: {
54
+ configProfileUuid: string;
55
+ activeInbounds: {
56
+ inboundTag: string;
57
+ fromInternalSquads: string[];
58
+ }[];
59
+ configProfileName: string;
60
+ }[];
61
+ }, {
62
+ uuid: string;
63
+ name: string;
64
+ countryCode: string;
65
+ reasons: {
66
+ configProfileUuid: string;
67
+ activeInbounds: {
68
+ inboundTag: string;
69
+ fromInternalSquads: string[];
70
+ }[];
71
+ configProfileName: string;
72
+ }[];
73
+ }>, "many">;
74
+ }, "strip", z.ZodTypeAny, {
75
+ nodes: {
76
+ uuid: string;
77
+ name: string;
78
+ countryCode: string;
79
+ reasons: {
80
+ configProfileUuid: string;
81
+ activeInbounds: {
82
+ inboundTag: string;
83
+ fromInternalSquads: string[];
84
+ }[];
85
+ configProfileName: string;
86
+ }[];
87
+ }[];
88
+ userUuid: string;
89
+ }, {
90
+ nodes: {
91
+ uuid: string;
92
+ name: string;
93
+ countryCode: string;
94
+ reasons: {
95
+ configProfileUuid: string;
96
+ activeInbounds: {
97
+ inboundTag: string;
98
+ fromInternalSquads: string[];
99
+ }[];
100
+ configProfileName: string;
101
+ }[];
102
+ }[];
103
+ userUuid: string;
104
+ }>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ response: {
107
+ nodes: {
108
+ uuid: string;
109
+ name: string;
110
+ countryCode: string;
111
+ reasons: {
112
+ configProfileUuid: string;
113
+ activeInbounds: {
114
+ inboundTag: string;
115
+ fromInternalSquads: string[];
116
+ }[];
117
+ configProfileName: string;
118
+ }[];
119
+ }[];
120
+ userUuid: string;
121
+ };
122
+ }, {
123
+ response: {
124
+ nodes: {
125
+ uuid: string;
126
+ name: string;
127
+ countryCode: string;
128
+ reasons: {
129
+ configProfileUuid: string;
130
+ activeInbounds: {
131
+ inboundTag: string;
132
+ fromInternalSquads: string[];
133
+ }[];
134
+ configProfileName: string;
135
+ }[];
136
+ }[];
137
+ userUuid: string;
138
+ };
139
+ }>;
140
+ type Response = z.infer<typeof ResponseSchema>;
141
+ }
142
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuBzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,33 @@
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
+ nodes: zod_1.z.array(zod_1.z.object({
19
+ uuid: zod_1.z.string().uuid(),
20
+ name: 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
+ fromInternalSquads: zod_1.z.array(zod_1.z.string()),
28
+ })),
29
+ })),
30
+ })),
31
+ }),
32
+ });
33
+ })(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,33 @@
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
+ nodes: zod_1.z.array(zod_1.z.object({
19
+ uuid: zod_1.z.string().uuid(),
20
+ name: 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
+ fromInternalSquads: zod_1.z.array(zod_1.z.string()),
28
+ })),
29
+ })),
30
+ })),
31
+ }),
32
+ });
33
+ })(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.3",
3
+ "version": "2.0.0-alpha.5",
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.",