@remnawave/node-contract 0.7.1 → 2.6.0
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.
- package/build/api/controllers/stats.d.ts +1 -0
- package/build/api/controllers/stats.d.ts.map +1 -1
- package/build/api/controllers/stats.js +1 -0
- package/build/api/routes.d.ts +1 -0
- package/build/api/routes.d.ts.map +1 -1
- package/build/api/routes.js +1 -0
- package/build/commands/stats/get-user-ip-list.command.d.ts +31 -0
- package/build/commands/stats/get-user-ip-list.command.d.ts.map +1 -0
- package/build/commands/stats/get-user-ip-list.command.js +17 -0
- package/build/commands/stats/index.d.ts +1 -0
- package/build/commands/stats/index.d.ts.map +1 -1
- package/build/commands/stats/index.js +1 -0
- package/build/constants/internal/internal.constants.d.ts +0 -1
- package/build/constants/internal/internal.constants.d.ts.map +1 -1
- package/build/constants/internal/internal.constants.js +1 -2
- package/build/constants/xray/stats.d.ts +27 -8
- package/build/constants/xray/stats.d.ts.map +1 -1
- package/build/constants/xray/stats.js +36 -9
- package/package.json +1 -1
|
@@ -8,5 +8,6 @@ export declare const STATS_ROUTES: {
|
|
|
8
8
|
readonly GET_ALL_OUTBOUNDS_STATS: "get-all-outbounds-stats";
|
|
9
9
|
readonly GET_ALL_INBOUNDS_STATS: "get-all-inbounds-stats";
|
|
10
10
|
readonly GET_COMBINED_STATS: "get-combined-stats";
|
|
11
|
+
readonly GET_USER_IP_LIST: "get-user-ip-list";
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../api/controllers/stats.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../api/controllers/stats.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;CAcf,CAAC"}
|
package/build/api/routes.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const REST_API: {
|
|
|
15
15
|
readonly GET_ALL_OUTBOUNDS_STATS: "/node/stats/get-all-outbounds-stats";
|
|
16
16
|
readonly GET_ALL_INBOUNDS_STATS: "/node/stats/get-all-inbounds-stats";
|
|
17
17
|
readonly GET_COMBINED_STATS: "/node/stats/get-combined-stats";
|
|
18
|
+
readonly GET_USER_IP_LIST: "/node/stats/get-user-ip-list";
|
|
18
19
|
};
|
|
19
20
|
readonly HANDLER: {
|
|
20
21
|
readonly ADD_USER: "/node/handler/add-user";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,OAAgB,CAAC;AAErC,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,OAAgB,CAAC;AAErC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BX,CAAC"}
|
package/build/api/routes.js
CHANGED
|
@@ -52,6 +52,7 @@ exports.REST_API = {
|
|
|
52
52
|
GET_ALL_OUTBOUNDS_STATS: `${exports.ROOT}/${CONTROLLERS.STATS_CONTROLLER}/${CONTROLLERS.STATS_ROUTES.GET_ALL_OUTBOUNDS_STATS}`,
|
|
53
53
|
GET_ALL_INBOUNDS_STATS: `${exports.ROOT}/${CONTROLLERS.STATS_CONTROLLER}/${CONTROLLERS.STATS_ROUTES.GET_ALL_INBOUNDS_STATS}`,
|
|
54
54
|
GET_COMBINED_STATS: `${exports.ROOT}/${CONTROLLERS.STATS_CONTROLLER}/${CONTROLLERS.STATS_ROUTES.GET_COMBINED_STATS}`,
|
|
55
|
+
GET_USER_IP_LIST: `${exports.ROOT}/${CONTROLLERS.STATS_CONTROLLER}/${CONTROLLERS.STATS_ROUTES.GET_USER_IP_LIST}`,
|
|
55
56
|
},
|
|
56
57
|
HANDLER: {
|
|
57
58
|
ADD_USER: `${exports.ROOT}/${CONTROLLERS.HANDLER_CONTROLLER}/${CONTROLLERS.HANDLER_ROUTES.ADD_USER}`,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare namespace GetUserIpListCommand {
|
|
3
|
+
const url: "/node/stats/get-user-ip-list";
|
|
4
|
+
const RequestSchema: z.ZodObject<{
|
|
5
|
+
userId: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
userId: string;
|
|
8
|
+
}, {
|
|
9
|
+
userId: string;
|
|
10
|
+
}>;
|
|
11
|
+
type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
const ResponseSchema: z.ZodObject<{
|
|
13
|
+
response: z.ZodObject<{
|
|
14
|
+
ips: z.ZodArray<z.ZodString, "many">;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
ips: string[];
|
|
17
|
+
}, {
|
|
18
|
+
ips: string[];
|
|
19
|
+
}>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
response: {
|
|
22
|
+
ips: string[];
|
|
23
|
+
};
|
|
24
|
+
}, {
|
|
25
|
+
response: {
|
|
26
|
+
ips: string[];
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=get-user-ip-list.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-ip-list.command.d.ts","sourceRoot":"","sources":["../../../commands/stats/get-user-ip-list.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,gCAAkC,CAAC;IAE5C,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetUserIpListCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
var GetUserIpListCommand;
|
|
7
|
+
(function (GetUserIpListCommand) {
|
|
8
|
+
GetUserIpListCommand.url = api_1.REST_API.STATS.GET_USER_IP_LIST;
|
|
9
|
+
GetUserIpListCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
userId: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
GetUserIpListCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
response: zod_1.z.object({
|
|
14
|
+
ips: zod_1.z.array(zod_1.z.string()),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
})(GetUserIpListCommand || (exports.GetUserIpListCommand = GetUserIpListCommand = {}));
|
|
@@ -4,6 +4,7 @@ export * from './get-combined-stats.command';
|
|
|
4
4
|
export * from './get-inbound-stats.command';
|
|
5
5
|
export * from './get-outbound-stats.command';
|
|
6
6
|
export * from './get-system-stats.command';
|
|
7
|
+
export * from './get-user-ip-list.command';
|
|
7
8
|
export * from './get-user-online-status.command';
|
|
8
9
|
export * from './get-users-stats.command';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC"}
|
|
@@ -20,5 +20,6 @@ __exportStar(require("./get-combined-stats.command"), exports);
|
|
|
20
20
|
__exportStar(require("./get-inbound-stats.command"), exports);
|
|
21
21
|
__exportStar(require("./get-outbound-stats.command"), exports);
|
|
22
22
|
__exportStar(require("./get-system-stats.command"), exports);
|
|
23
|
+
__exportStar(require("./get-user-ip-list.command"), exports);
|
|
23
24
|
__exportStar(require("./get-user-online-status.command"), exports);
|
|
24
25
|
__exportStar(require("./get-users-stats.command"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.constants.d.ts","sourceRoot":"","sources":["../../../constants/internal/internal.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"internal.constants.d.ts","sourceRoot":"","sources":["../../../constants/internal/internal.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,aAAa,CAAC;AACvD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,uBAAuB,yBAA8D,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.XRAY_INTERNAL_FULL_PATH = exports.XRAY_INTERNAL_API_PATH = exports.XRAY_INTERNAL_API_CONTROLLER =
|
|
4
|
-
exports.XRAY_INTERNAL_API_PORT = 61001;
|
|
3
|
+
exports.XRAY_INTERNAL_FULL_PATH = exports.XRAY_INTERNAL_API_PATH = exports.XRAY_INTERNAL_API_CONTROLLER = void 0;
|
|
5
4
|
exports.XRAY_INTERNAL_API_CONTROLLER = 'internal';
|
|
6
5
|
exports.XRAY_INTERNAL_API_PATH = '/get-config';
|
|
7
6
|
exports.XRAY_INTERNAL_FULL_PATH = `/${exports.XRAY_INTERNAL_API_CONTROLLER}${exports.XRAY_INTERNAL_API_PATH}`;
|
|
@@ -4,7 +4,7 @@ export declare const XRAY_DEFAULT_POLICY_MODEL: {
|
|
|
4
4
|
readonly '0': {
|
|
5
5
|
readonly statsUserUplink: true;
|
|
6
6
|
readonly statsUserDownlink: true;
|
|
7
|
-
readonly statsUserOnline:
|
|
7
|
+
readonly statsUserOnline: true;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
readonly system: {
|
|
@@ -21,22 +21,41 @@ export declare const XRAY_DEFAULT_STATS_MODEL: {
|
|
|
21
21
|
export declare const XRAY_DEFAULT_API_MODEL: {
|
|
22
22
|
readonly api: {
|
|
23
23
|
readonly services: readonly ["HandlerService", "StatsService", "RoutingService"];
|
|
24
|
-
readonly listen: "127.0.0.1:61000";
|
|
25
24
|
readonly tag: "REMNAWAVE_API";
|
|
26
25
|
};
|
|
27
26
|
};
|
|
28
|
-
export declare const XRAY_API_INBOUND_MODEL: {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export declare const XRAY_API_INBOUND_MODEL: ({ port, caCertPem, serverCertPem, serverKeyPem, }: {
|
|
28
|
+
port: number;
|
|
29
|
+
caCertPem: string;
|
|
30
|
+
serverCertPem: string;
|
|
31
|
+
serverKeyPem: string;
|
|
32
|
+
}) => {
|
|
33
|
+
readonly tag: "REMNAWAVE_API_INBOUND";
|
|
34
|
+
readonly port: number;
|
|
31
35
|
readonly listen: "127.0.0.1";
|
|
32
36
|
readonly protocol: "dokodemo-door";
|
|
33
37
|
readonly settings: {
|
|
34
38
|
readonly address: "127.0.0.1";
|
|
35
39
|
};
|
|
40
|
+
readonly streamSettings: {
|
|
41
|
+
readonly security: "tls";
|
|
42
|
+
readonly tlsSettings: {
|
|
43
|
+
readonly alpn: readonly ["h2"];
|
|
44
|
+
readonly serverName: "internal.remnawave.local";
|
|
45
|
+
readonly disableSystemRoot: true;
|
|
46
|
+
readonly rejectUnknownSni: true;
|
|
47
|
+
readonly certificates: readonly [{
|
|
48
|
+
readonly certificate: string[];
|
|
49
|
+
readonly key: string[];
|
|
50
|
+
}, {
|
|
51
|
+
readonly usage: "verify";
|
|
52
|
+
readonly certificate: string[];
|
|
53
|
+
}];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
36
56
|
};
|
|
37
57
|
export declare const XRAY_ROUTING_RULES_MODEL: {
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly outboundTag: "api";
|
|
58
|
+
readonly inboundTag: readonly ["REMNAWAVE_API_INBOUND"];
|
|
59
|
+
readonly outboundTag: "REMNAWAVE_API";
|
|
41
60
|
};
|
|
42
61
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../constants/xray/stats.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAgB5B,CAAC;AAEX,eAAO,MAAM,wBAAwB;;CAE3B,CAAC;AAEX,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../constants/xray/stats.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAgB5B,CAAC;AAEX,eAAO,MAAM,wBAAwB;;CAE3B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,eAAO,MAAM,sBAAsB,GAAI,mDAKpC;IACC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;CAqCc,CAAC;AAEhB,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC"}
|
|
@@ -7,7 +7,7 @@ exports.XRAY_DEFAULT_POLICY_MODEL = {
|
|
|
7
7
|
'0': {
|
|
8
8
|
statsUserUplink: true,
|
|
9
9
|
statsUserDownlink: true,
|
|
10
|
-
statsUserOnline:
|
|
10
|
+
statsUserOnline: true,
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
system: {
|
|
@@ -24,21 +24,48 @@ exports.XRAY_DEFAULT_STATS_MODEL = {
|
|
|
24
24
|
exports.XRAY_DEFAULT_API_MODEL = {
|
|
25
25
|
api: {
|
|
26
26
|
services: ['HandlerService', 'StatsService', 'RoutingService'],
|
|
27
|
-
listen: '127.0.0.1:61000',
|
|
28
27
|
tag: 'REMNAWAVE_API',
|
|
29
28
|
},
|
|
30
29
|
};
|
|
31
|
-
|
|
32
|
-
tag: '
|
|
33
|
-
port:
|
|
30
|
+
const XRAY_API_INBOUND_MODEL = ({ port, caCertPem, serverCertPem, serverKeyPem, }) => ({
|
|
31
|
+
tag: 'REMNAWAVE_API_INBOUND',
|
|
32
|
+
port: port,
|
|
34
33
|
listen: '127.0.0.1',
|
|
35
34
|
protocol: 'dokodemo-door',
|
|
36
35
|
settings: {
|
|
37
36
|
address: '127.0.0.1',
|
|
38
37
|
},
|
|
39
|
-
|
|
38
|
+
streamSettings: {
|
|
39
|
+
security: 'tls',
|
|
40
|
+
tlsSettings: {
|
|
41
|
+
alpn: ['h2'],
|
|
42
|
+
serverName: 'internal.remnawave.local',
|
|
43
|
+
disableSystemRoot: true,
|
|
44
|
+
rejectUnknownSni: true,
|
|
45
|
+
certificates: [
|
|
46
|
+
{
|
|
47
|
+
certificate: serverCertPem
|
|
48
|
+
.replace(/\r\n/g, '\n')
|
|
49
|
+
.split('\n')
|
|
50
|
+
.filter((line) => line),
|
|
51
|
+
key: serverKeyPem
|
|
52
|
+
.replace(/\r\n/g, '\n')
|
|
53
|
+
.split('\n')
|
|
54
|
+
.filter((line) => line),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
usage: 'verify',
|
|
58
|
+
certificate: caCertPem
|
|
59
|
+
.replace(/\r\n/g, '\n')
|
|
60
|
+
.split('\n')
|
|
61
|
+
.filter((line) => line),
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
exports.XRAY_API_INBOUND_MODEL = XRAY_API_INBOUND_MODEL;
|
|
40
68
|
exports.XRAY_ROUTING_RULES_MODEL = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
outboundTag: 'api',
|
|
69
|
+
inboundTag: ['REMNAWAVE_API_INBOUND'],
|
|
70
|
+
outboundTag: 'REMNAWAVE_API',
|
|
44
71
|
};
|