@remnawave/xtls-sdk 0.14.0 → 0.16.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/src/handler/handler.service.d.ts +11 -2
- package/build/src/handler/handler.service.d.ts.map +1 -1
- package/build/src/handler/handler.service.js +57 -11
- package/build/src/handler/interfaces/add-user/add-wireguard-user.interface.d.ts +8 -0
- package/build/src/handler/interfaces/add-user/add-wireguard-user.interface.d.ts.map +1 -0
- package/build/src/handler/interfaces/add-user/add-wireguard-user.interface.js +2 -0
- package/build/src/handler/interfaces/add-user/index.d.ts +1 -0
- package/build/src/handler/interfaces/add-user/index.d.ts.map +1 -1
- package/build/src/handler/interfaces/add-user/index.js +1 -0
- package/build/src/xray-protos/app/commander/config.js +1 -1
- package/build/src/xray-protos/app/dispatcher/config.js +1 -1
- package/build/src/xray-protos/app/geodata/config.js +1 -1
- package/build/src/xray-protos/app/log/command/config.d.ts +2 -2
- package/build/src/xray-protos/app/log/command/config.d.ts.map +1 -1
- package/build/src/xray-protos/app/log/command/config.js +1 -1
- package/build/src/xray-protos/app/log/config.js +1 -1
- package/build/src/xray-protos/app/metrics/config.js +1 -1
- package/build/src/xray-protos/app/policy/config.js +1 -1
- package/build/src/xray-protos/app/proxyman/command/command.d.ts +20 -20
- package/build/src/xray-protos/app/proxyman/command/command.d.ts.map +1 -1
- package/build/src/xray-protos/app/proxyman/command/command.js +1 -1
- package/build/src/xray-protos/app/proxyman/config.js +1 -1
- package/build/src/xray-protos/app/reverse/config.js +1 -1
- package/build/src/xray-protos/app/router/command/command.d.ts +14 -14
- package/build/src/xray-protos/app/router/command/command.d.ts.map +1 -1
- package/build/src/xray-protos/app/router/command/command.js +1 -1
- package/build/src/xray-protos/app/stats/command/command.d.ts +14 -14
- package/build/src/xray-protos/app/stats/command/command.d.ts.map +1 -1
- package/build/src/xray-protos/app/stats/command/command.js +1 -1
- package/build/src/xray-protos/app/stats/config.js +1 -1
- package/build/src/xray-protos/app/version/config.js +1 -1
- package/build/src/xray-protos/common/geodata/geodat.js +1 -1
- package/build/src/xray-protos/common/log/log.js +1 -1
- package/build/src/xray-protos/common/net/address.js +1 -1
- package/build/src/xray-protos/common/net/destination.js +1 -1
- package/build/src/xray-protos/common/net/network.js +1 -1
- package/build/src/xray-protos/common/net/port.js +1 -1
- package/build/src/xray-protos/common/protocol/headers.js +1 -1
- package/build/src/xray-protos/common/protocol/server_spec.js +1 -1
- package/build/src/xray-protos/common/protocol/user.js +1 -1
- package/build/src/xray-protos/common/serial/typed_message.js +1 -1
- package/build/src/xray-protos/core/config.js +1 -1
- package/build/src/xray-protos/proxy/blackhole/config.js +1 -1
- package/build/src/xray-protos/proxy/dns/config.d.ts +4 -3
- package/build/src/xray-protos/proxy/dns/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/dns/config.js +50 -23
- package/build/src/xray-protos/proxy/dokodemo/config.d.ts +4 -4
- package/build/src/xray-protos/proxy/dokodemo/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/dokodemo/config.js +55 -43
- package/build/src/xray-protos/proxy/freedom/config.js +1 -1
- package/build/src/xray-protos/proxy/http/config.js +1 -1
- package/build/src/xray-protos/proxy/hysteria/account/config.js +1 -1
- package/build/src/xray-protos/proxy/hysteria/config.d.ts +0 -1
- package/build/src/xray-protos/proxy/hysteria/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/hysteria/config.js +4 -19
- package/build/src/xray-protos/proxy/loopback/config.d.ts +2 -0
- package/build/src/xray-protos/proxy/loopback/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/loopback/config.js +20 -2
- package/build/src/xray-protos/proxy/shadowsocks/config.js +1 -1
- package/build/src/xray-protos/proxy/shadowsocks_2022/config.d.ts +0 -2
- package/build/src/xray-protos/proxy/shadowsocks_2022/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/shadowsocks_2022/config.js +2 -48
- package/build/src/xray-protos/proxy/socks/config.js +1 -1
- package/build/src/xray-protos/proxy/trojan/config.js +1 -1
- package/build/src/xray-protos/proxy/tun/config.js +1 -1
- package/build/src/xray-protos/proxy/vless/account.js +1 -1
- package/build/src/xray-protos/proxy/vless/encoding/addons.js +1 -1
- package/build/src/xray-protos/proxy/vless/inbound/config.d.ts +1 -1
- package/build/src/xray-protos/proxy/vless/inbound/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/vless/inbound/config.js +8 -8
- package/build/src/xray-protos/proxy/vless/outbound/config.js +1 -1
- package/build/src/xray-protos/proxy/vmess/account.js +1 -1
- package/build/src/xray-protos/proxy/vmess/inbound/config.js +1 -1
- package/build/src/xray-protos/proxy/vmess/outbound/config.js +1 -1
- package/build/src/xray-protos/proxy/wireguard/config.d.ts +3 -2
- package/build/src/xray-protos/proxy/wireguard/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/wireguard/config.js +28 -31
- package/build/src/xray-protos/transport/internet/config.js +1 -1
- package/build/src/xray-protos/typeRegistry.js +1 -1
- package/package.json +39 -46
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/vless/inbound/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -145,7 +145,7 @@ typeRegistry_1.messageTypeRegistry.set(exports.Fallback.$type, exports.Fallback)
|
|
|
145
145
|
function createBaseConfig() {
|
|
146
146
|
return {
|
|
147
147
|
$type: "xray.proxy.vless.inbound.Config",
|
|
148
|
-
|
|
148
|
+
users: [],
|
|
149
149
|
fallbacks: [],
|
|
150
150
|
decryption: "",
|
|
151
151
|
xorMode: 0,
|
|
@@ -157,7 +157,7 @@ function createBaseConfig() {
|
|
|
157
157
|
exports.Config = {
|
|
158
158
|
$type: "xray.proxy.vless.inbound.Config",
|
|
159
159
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
160
|
-
for (const v of message.
|
|
160
|
+
for (const v of message.users) {
|
|
161
161
|
user_1.User.encode(v, writer.uint32(10).fork()).join();
|
|
162
162
|
}
|
|
163
163
|
for (const v of message.fallbacks) {
|
|
@@ -191,7 +191,7 @@ exports.Config = {
|
|
|
191
191
|
if (tag !== 10) {
|
|
192
192
|
break;
|
|
193
193
|
}
|
|
194
|
-
message.
|
|
194
|
+
message.users.push(user_1.User.decode(reader, reader.uint32()));
|
|
195
195
|
continue;
|
|
196
196
|
}
|
|
197
197
|
case 2: {
|
|
@@ -247,7 +247,7 @@ exports.Config = {
|
|
|
247
247
|
fromJSON(object) {
|
|
248
248
|
return {
|
|
249
249
|
$type: exports.Config.$type,
|
|
250
|
-
|
|
250
|
+
users: globalThis.Array.isArray(object?.users) ? object.users.map((e) => user_1.User.fromJSON(e)) : [],
|
|
251
251
|
fallbacks: globalThis.Array.isArray(object?.fallbacks)
|
|
252
252
|
? object.fallbacks.map((e) => exports.Fallback.fromJSON(e))
|
|
253
253
|
: [],
|
|
@@ -268,8 +268,8 @@ exports.Config = {
|
|
|
268
268
|
},
|
|
269
269
|
toJSON(message) {
|
|
270
270
|
const obj = {};
|
|
271
|
-
if (message.
|
|
272
|
-
obj.
|
|
271
|
+
if (message.users?.length) {
|
|
272
|
+
obj.users = message.users.map((e) => user_1.User.toJSON(e));
|
|
273
273
|
}
|
|
274
274
|
if (message.fallbacks?.length) {
|
|
275
275
|
obj.fallbacks = message.fallbacks.map((e) => exports.Fallback.toJSON(e));
|
|
@@ -296,7 +296,7 @@ exports.Config = {
|
|
|
296
296
|
},
|
|
297
297
|
fromPartial(object) {
|
|
298
298
|
const message = createBaseConfig();
|
|
299
|
-
message.
|
|
299
|
+
message.users = object.users?.map((e) => user_1.User.fromPartial(e)) || [];
|
|
300
300
|
message.fallbacks = object.fallbacks?.map((e) => exports.Fallback.fromPartial(e)) || [];
|
|
301
301
|
message.decryption = object.decryption ?? "";
|
|
302
302
|
message.xorMode = object.xorMode ?? 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/vless/outbound/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/vmess/account.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/vmess/inbound/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/vmess/outbound/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { User } from "../../common/protocol/user";
|
|
2
3
|
export declare const protobufPackage = "xray.proxy.wireguard";
|
|
3
4
|
export interface PeerConfig {
|
|
4
5
|
$type: "xray.proxy.wireguard.PeerConfig";
|
|
5
6
|
publicKey: string;
|
|
6
7
|
preSharedKey: string;
|
|
7
8
|
endpoint: string;
|
|
8
|
-
keepAlive:
|
|
9
|
+
keepAlive: string;
|
|
9
10
|
allowedIps: string[];
|
|
10
11
|
}
|
|
11
12
|
export interface DeviceConfig {
|
|
@@ -13,8 +14,8 @@ export interface DeviceConfig {
|
|
|
13
14
|
secretKey: string;
|
|
14
15
|
endpoint: string[];
|
|
15
16
|
peers: PeerConfig[];
|
|
17
|
+
users: User[];
|
|
16
18
|
mtu: number;
|
|
17
|
-
numWorkers: number;
|
|
18
19
|
reserved: Uint8Array;
|
|
19
20
|
domainStrategy: DeviceConfig_DomainStrategy;
|
|
20
21
|
isClient: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/wireguard/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/wireguard/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGlD,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,iCAAiC,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,mCAAmC,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,UAAU,CAAC;IACrB,cAAc,EAAE,2BAA2B,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,oBAAY,2BAA2B;IACrC,QAAQ,IAAI;IACZ,SAAS,IAAI;IACb,SAAS,IAAI;IACb,UAAU,IAAI;IACd,UAAU,IAAI;IACd,YAAY,KAAK;CAClB;AAED,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,GAAG,GAAG,2BAA2B,CAsB5F;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,2BAA2B,GAAG,MAAM,CAgB7F;AAaD,eAAO,MAAM,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,iCAAiC,CAyIhF,CAAC;AAmBF,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE,mCAAmC,CAyMtF,CAAC;AA6BF,KAAK,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GAC9C,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACvE,OAAO,CAAC,CAAC,CAAC,CAAC;AAMf,MAAM,WAAW,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM;IAC7C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/wireguard/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -10,6 +10,7 @@ exports.deviceConfig_DomainStrategyFromJSON = deviceConfig_DomainStrategyFromJSO
|
|
|
10
10
|
exports.deviceConfig_DomainStrategyToJSON = deviceConfig_DomainStrategyToJSON;
|
|
11
11
|
/* eslint-disable */
|
|
12
12
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
13
|
+
const user_1 = require("../../common/protocol/user");
|
|
13
14
|
const typeRegistry_1 = require("../../typeRegistry");
|
|
14
15
|
exports.protobufPackage = "xray.proxy.wireguard";
|
|
15
16
|
var DeviceConfig_DomainStrategy;
|
|
@@ -67,7 +68,7 @@ function createBasePeerConfig() {
|
|
|
67
68
|
publicKey: "",
|
|
68
69
|
preSharedKey: "",
|
|
69
70
|
endpoint: "",
|
|
70
|
-
keepAlive:
|
|
71
|
+
keepAlive: "",
|
|
71
72
|
allowedIps: [],
|
|
72
73
|
};
|
|
73
74
|
}
|
|
@@ -83,8 +84,8 @@ exports.PeerConfig = {
|
|
|
83
84
|
if (message.endpoint !== "") {
|
|
84
85
|
writer.uint32(26).string(message.endpoint);
|
|
85
86
|
}
|
|
86
|
-
if (message.keepAlive !==
|
|
87
|
-
writer.uint32(
|
|
87
|
+
if (message.keepAlive !== "") {
|
|
88
|
+
writer.uint32(34).string(message.keepAlive);
|
|
88
89
|
}
|
|
89
90
|
for (const v of message.allowedIps) {
|
|
90
91
|
writer.uint32(42).string(v);
|
|
@@ -120,10 +121,10 @@ exports.PeerConfig = {
|
|
|
120
121
|
continue;
|
|
121
122
|
}
|
|
122
123
|
case 4: {
|
|
123
|
-
if (tag !==
|
|
124
|
+
if (tag !== 34) {
|
|
124
125
|
break;
|
|
125
126
|
}
|
|
126
|
-
message.keepAlive = reader.
|
|
127
|
+
message.keepAlive = reader.string();
|
|
127
128
|
continue;
|
|
128
129
|
}
|
|
129
130
|
case 5: {
|
|
@@ -156,10 +157,10 @@ exports.PeerConfig = {
|
|
|
156
157
|
: "",
|
|
157
158
|
endpoint: isSet(object.endpoint) ? globalThis.String(object.endpoint) : "",
|
|
158
159
|
keepAlive: isSet(object.keepAlive)
|
|
159
|
-
? globalThis.
|
|
160
|
+
? globalThis.String(object.keepAlive)
|
|
160
161
|
: isSet(object.keep_alive)
|
|
161
|
-
? globalThis.
|
|
162
|
-
:
|
|
162
|
+
? globalThis.String(object.keep_alive)
|
|
163
|
+
: "",
|
|
163
164
|
allowedIps: globalThis.Array.isArray(object?.allowedIps)
|
|
164
165
|
? object.allowedIps.map((e) => globalThis.String(e))
|
|
165
166
|
: globalThis.Array.isArray(object?.allowed_ips)
|
|
@@ -178,8 +179,8 @@ exports.PeerConfig = {
|
|
|
178
179
|
if (message.endpoint !== "") {
|
|
179
180
|
obj.endpoint = message.endpoint;
|
|
180
181
|
}
|
|
181
|
-
if (message.keepAlive !==
|
|
182
|
-
obj.keepAlive =
|
|
182
|
+
if (message.keepAlive !== "") {
|
|
183
|
+
obj.keepAlive = message.keepAlive;
|
|
183
184
|
}
|
|
184
185
|
if (message.allowedIps?.length) {
|
|
185
186
|
obj.allowedIps = message.allowedIps;
|
|
@@ -194,7 +195,7 @@ exports.PeerConfig = {
|
|
|
194
195
|
message.publicKey = object.publicKey ?? "";
|
|
195
196
|
message.preSharedKey = object.preSharedKey ?? "";
|
|
196
197
|
message.endpoint = object.endpoint ?? "";
|
|
197
|
-
message.keepAlive = object.keepAlive ??
|
|
198
|
+
message.keepAlive = object.keepAlive ?? "";
|
|
198
199
|
message.allowedIps = object.allowedIps?.map((e) => e) || [];
|
|
199
200
|
return message;
|
|
200
201
|
},
|
|
@@ -206,8 +207,8 @@ function createBaseDeviceConfig() {
|
|
|
206
207
|
secretKey: "",
|
|
207
208
|
endpoint: [],
|
|
208
209
|
peers: [],
|
|
210
|
+
users: [],
|
|
209
211
|
mtu: 0,
|
|
210
|
-
numWorkers: 0,
|
|
211
212
|
reserved: new Uint8Array(0),
|
|
212
213
|
domainStrategy: 0,
|
|
213
214
|
isClient: false,
|
|
@@ -226,12 +227,12 @@ exports.DeviceConfig = {
|
|
|
226
227
|
for (const v of message.peers) {
|
|
227
228
|
exports.PeerConfig.encode(v, writer.uint32(26).fork()).join();
|
|
228
229
|
}
|
|
230
|
+
for (const v of message.users) {
|
|
231
|
+
user_1.User.encode(v, writer.uint32(42).fork()).join();
|
|
232
|
+
}
|
|
229
233
|
if (message.mtu !== 0) {
|
|
230
234
|
writer.uint32(32).int32(message.mtu);
|
|
231
235
|
}
|
|
232
|
-
if (message.numWorkers !== 0) {
|
|
233
|
-
writer.uint32(40).int32(message.numWorkers);
|
|
234
|
-
}
|
|
235
236
|
if (message.reserved.length !== 0) {
|
|
236
237
|
writer.uint32(50).bytes(message.reserved);
|
|
237
238
|
}
|
|
@@ -274,18 +275,18 @@ exports.DeviceConfig = {
|
|
|
274
275
|
message.peers.push(exports.PeerConfig.decode(reader, reader.uint32()));
|
|
275
276
|
continue;
|
|
276
277
|
}
|
|
277
|
-
case
|
|
278
|
-
if (tag !==
|
|
278
|
+
case 5: {
|
|
279
|
+
if (tag !== 42) {
|
|
279
280
|
break;
|
|
280
281
|
}
|
|
281
|
-
message.
|
|
282
|
+
message.users.push(user_1.User.decode(reader, reader.uint32()));
|
|
282
283
|
continue;
|
|
283
284
|
}
|
|
284
|
-
case
|
|
285
|
-
if (tag !==
|
|
285
|
+
case 4: {
|
|
286
|
+
if (tag !== 32) {
|
|
286
287
|
break;
|
|
287
288
|
}
|
|
288
|
-
message.
|
|
289
|
+
message.mtu = reader.int32();
|
|
289
290
|
continue;
|
|
290
291
|
}
|
|
291
292
|
case 6: {
|
|
@@ -334,12 +335,8 @@ exports.DeviceConfig = {
|
|
|
334
335
|
: "",
|
|
335
336
|
endpoint: globalThis.Array.isArray(object?.endpoint) ? object.endpoint.map((e) => globalThis.String(e)) : [],
|
|
336
337
|
peers: globalThis.Array.isArray(object?.peers) ? object.peers.map((e) => exports.PeerConfig.fromJSON(e)) : [],
|
|
338
|
+
users: globalThis.Array.isArray(object?.users) ? object.users.map((e) => user_1.User.fromJSON(e)) : [],
|
|
337
339
|
mtu: isSet(object.mtu) ? globalThis.Number(object.mtu) : 0,
|
|
338
|
-
numWorkers: isSet(object.numWorkers)
|
|
339
|
-
? globalThis.Number(object.numWorkers)
|
|
340
|
-
: isSet(object.num_workers)
|
|
341
|
-
? globalThis.Number(object.num_workers)
|
|
342
|
-
: 0,
|
|
343
340
|
reserved: isSet(object.reserved) ? bytesFromBase64(object.reserved) : new Uint8Array(0),
|
|
344
341
|
domainStrategy: isSet(object.domainStrategy)
|
|
345
342
|
? deviceConfig_DomainStrategyFromJSON(object.domainStrategy)
|
|
@@ -369,12 +366,12 @@ exports.DeviceConfig = {
|
|
|
369
366
|
if (message.peers?.length) {
|
|
370
367
|
obj.peers = message.peers.map((e) => exports.PeerConfig.toJSON(e));
|
|
371
368
|
}
|
|
369
|
+
if (message.users?.length) {
|
|
370
|
+
obj.users = message.users.map((e) => user_1.User.toJSON(e));
|
|
371
|
+
}
|
|
372
372
|
if (message.mtu !== 0) {
|
|
373
373
|
obj.mtu = Math.round(message.mtu);
|
|
374
374
|
}
|
|
375
|
-
if (message.numWorkers !== 0) {
|
|
376
|
-
obj.numWorkers = Math.round(message.numWorkers);
|
|
377
|
-
}
|
|
378
375
|
if (message.reserved.length !== 0) {
|
|
379
376
|
obj.reserved = base64FromBytes(message.reserved);
|
|
380
377
|
}
|
|
@@ -397,8 +394,8 @@ exports.DeviceConfig = {
|
|
|
397
394
|
message.secretKey = object.secretKey ?? "";
|
|
398
395
|
message.endpoint = object.endpoint?.map((e) => e) || [];
|
|
399
396
|
message.peers = object.peers?.map((e) => exports.PeerConfig.fromPartial(e)) || [];
|
|
397
|
+
message.users = object.users?.map((e) => user_1.User.fromPartial(e)) || [];
|
|
400
398
|
message.mtu = object.mtu ?? 0;
|
|
401
|
-
message.numWorkers = object.numWorkers ?? 0;
|
|
402
399
|
message.reserved = object.reserved ?? new Uint8Array(0);
|
|
403
400
|
message.domainStrategy = object.domainStrategy ?? 0;
|
|
404
401
|
message.isClient = object.isClient ?? false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: transport/internet/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.messageTypeRegistry = void 0;
|
package/package.json
CHANGED
|
@@ -1,63 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnawave/xtls-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "A Typescript SDK for XRAY (XTLS) Core GRPC Api",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"types": "build/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"build/**/*"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"prepublish": "rm -rf build && tsc",
|
|
12
|
-
"build": "tsc"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/remnawave/xtls-sdk.git"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://github.com/remnawave/xtls-sdk#readme",
|
|
19
|
-
"bugs": {
|
|
20
|
-
"url": "https://github.com/remnawave/xtls-sdk/issues"
|
|
21
|
-
},
|
|
22
|
-
"author": "Remnawave <https://github.com/remnawave>",
|
|
23
|
-
"license": "AGPL-3.0-only",
|
|
24
5
|
"keywords": [
|
|
25
|
-
"xtls",
|
|
26
|
-
"grpc",
|
|
27
|
-
"sdk",
|
|
28
|
-
"xray core api",
|
|
29
|
-
"typescript",
|
|
30
|
-
"xray",
|
|
31
|
-
"xray-core",
|
|
32
6
|
"api",
|
|
33
7
|
"client",
|
|
8
|
+
"grpc",
|
|
34
9
|
"network",
|
|
35
|
-
"proxy",
|
|
36
10
|
"protocol",
|
|
11
|
+
"proxy",
|
|
12
|
+
"sdk",
|
|
37
13
|
"trojan",
|
|
38
|
-
"
|
|
14
|
+
"typescript",
|
|
15
|
+
"vless",
|
|
16
|
+
"xray",
|
|
17
|
+
"xray core api",
|
|
18
|
+
"xray-core",
|
|
19
|
+
"xtls"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://github.com/remnawave/xtls-sdk#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/remnawave/xtls-sdk/issues"
|
|
24
|
+
},
|
|
25
|
+
"license": "AGPL-3.0-only",
|
|
26
|
+
"author": "Remnawave <https://github.com/remnawave>",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/remnawave/xtls-sdk.git"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"build/**/*"
|
|
39
33
|
],
|
|
34
|
+
"main": "build/index.js",
|
|
35
|
+
"types": "build/index.d.ts",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"prepublish": "rm -rf build && tsc",
|
|
38
|
+
"build": "tsc"
|
|
39
|
+
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@bufbuild/protobuf": "^2.12.1",
|
|
41
42
|
"long": "^5.3.2",
|
|
42
|
-
"nice-grpc": "^2.1.
|
|
43
|
-
"protobufjs": "^8.
|
|
44
|
-
"@bufbuild/protobuf": "^2.11.0"
|
|
43
|
+
"nice-grpc": "^2.1.16",
|
|
44
|
+
"protobufjs": "^8.6.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
47
|
+
"@types/node": ">= 24 < 25",
|
|
48
|
+
"eslint-plugin-perfectionist": "5.9.1",
|
|
49
49
|
"grpc-tools": "^1.13.1",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"eslint-config-prettier": "^10.1.8",
|
|
56
|
-
"eslint-plugin-paths": "^1.1.0",
|
|
57
|
-
"eslint-plugin-perfectionist": "^4.15.1",
|
|
58
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
59
|
-
"prettier": "^3.7.4",
|
|
60
|
-
"tsconfig-paths": "^4.2.0",
|
|
61
|
-
"typescript-eslint": "^8.49.0"
|
|
50
|
+
"oxfmt": "^0.56.0",
|
|
51
|
+
"oxlint": "^1.71.0",
|
|
52
|
+
"tar": "^7.5.17",
|
|
53
|
+
"ts-proto": "^2.11.8",
|
|
54
|
+
"typescript": "~5.9.3"
|
|
62
55
|
}
|
|
63
56
|
}
|