@remnawave/xtls-sdk 0.4.0 → 0.5.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.
Files changed (67) hide show
  1. package/build/index.d.ts +2 -2
  2. package/build/index.d.ts.map +1 -1
  3. package/build/index.js +4 -2
  4. package/build/src/handler/models/get-inbound-users/get-inbound-users.response.model.d.ts.map +1 -1
  5. package/build/src/stats/models/get-all-inbounds-stats/get-all-inbounds-stats.response.model.d.ts.map +1 -1
  6. package/build/src/stats/models/get-all-inbounds-stats/get-all-inbounds-stats.response.model.js +8 -8
  7. package/build/src/stats/models/get-all-outbounds-stats/get-all-outbounds-stats.response.model.d.ts.map +1 -1
  8. package/build/src/stats/models/get-all-outbounds-stats/get-all-outbounds-stats.response.model.js +8 -8
  9. package/build/src/stats/models/get-all-users-stats/get-all-users-stats.response.model.d.ts.map +1 -1
  10. package/build/src/stats/models/get-all-users-stats/get-all-users-stats.response.model.js +8 -8
  11. package/build/src/stats/models/get-inbound-stats/get-inbound-stats.response.model.d.ts.map +1 -1
  12. package/build/src/stats/models/get-inbound-stats/get-inbound-stats.response.model.js +8 -8
  13. package/build/src/stats/models/get-outbound-stats/get-outbound-stats.response.model.d.ts.map +1 -1
  14. package/build/src/stats/models/get-outbound-stats/get-outbound-stats.response.model.js +8 -8
  15. package/build/src/stats/models/get-user-stats/get-user-stats.response.model.d.ts.map +1 -1
  16. package/build/src/stats/models/get-user-stats/get-user-stats.response.model.js +8 -8
  17. package/build/src/xray-protos/app/commander/config.js +1 -1
  18. package/build/src/xray-protos/app/dispatcher/config.js +1 -1
  19. package/build/src/xray-protos/app/log/command/config.js +1 -1
  20. package/build/src/xray-protos/app/log/config.js +1 -1
  21. package/build/src/xray-protos/app/metrics/config.js +1 -1
  22. package/build/src/xray-protos/app/policy/config.js +1 -1
  23. package/build/src/xray-protos/app/proxyman/command/command.d.ts +1 -0
  24. package/build/src/xray-protos/app/proxyman/command/command.d.ts.map +1 -1
  25. package/build/src/xray-protos/app/proxyman/command/command.js +24 -7
  26. package/build/src/xray-protos/app/proxyman/config.js +1 -1
  27. package/build/src/xray-protos/app/reverse/config.js +1 -1
  28. package/build/src/xray-protos/app/router/command/command.js +1 -1
  29. package/build/src/xray-protos/app/router/config.js +1 -1
  30. package/build/src/xray-protos/app/stats/command/command.js +1 -1
  31. package/build/src/xray-protos/app/stats/config.js +1 -1
  32. package/build/src/xray-protos/app/version/config.d.ts +24 -0
  33. package/build/src/xray-protos/app/version/config.d.ts.map +1 -0
  34. package/build/src/xray-protos/app/version/config.js +101 -0
  35. package/build/src/xray-protos/common/log/log.js +1 -1
  36. package/build/src/xray-protos/common/net/address.js +1 -1
  37. package/build/src/xray-protos/common/net/destination.js +1 -1
  38. package/build/src/xray-protos/common/net/network.js +1 -1
  39. package/build/src/xray-protos/common/net/port.js +1 -1
  40. package/build/src/xray-protos/common/protocol/headers.js +1 -1
  41. package/build/src/xray-protos/common/protocol/server_spec.js +1 -1
  42. package/build/src/xray-protos/common/protocol/user.js +1 -1
  43. package/build/src/xray-protos/common/serial/typed_message.js +1 -1
  44. package/build/src/xray-protos/core/config.js +1 -1
  45. package/build/src/xray-protos/proxy/blackhole/config.js +1 -1
  46. package/build/src/xray-protos/proxy/dns/config.js +1 -1
  47. package/build/src/xray-protos/proxy/dokodemo/config.d.ts +9 -0
  48. package/build/src/xray-protos/proxy/dokodemo/config.d.ts.map +1 -1
  49. package/build/src/xray-protos/proxy/dokodemo/config.js +111 -2
  50. package/build/src/xray-protos/proxy/freedom/config.js +1 -1
  51. package/build/src/xray-protos/proxy/http/config.js +1 -1
  52. package/build/src/xray-protos/proxy/loopback/config.js +1 -1
  53. package/build/src/xray-protos/proxy/shadowsocks/config.js +1 -1
  54. package/build/src/xray-protos/proxy/shadowsocks_2022/config.js +1 -1
  55. package/build/src/xray-protos/proxy/socks/config.js +1 -1
  56. package/build/src/xray-protos/proxy/trojan/config.js +1 -1
  57. package/build/src/xray-protos/proxy/vless/account.js +1 -1
  58. package/build/src/xray-protos/proxy/vless/encoding/addons.js +1 -1
  59. package/build/src/xray-protos/proxy/vless/inbound/config.js +1 -1
  60. package/build/src/xray-protos/proxy/vless/outbound/config.js +1 -1
  61. package/build/src/xray-protos/proxy/vmess/account.js +1 -1
  62. package/build/src/xray-protos/proxy/vmess/inbound/config.js +1 -1
  63. package/build/src/xray-protos/proxy/vmess/outbound/config.js +1 -1
  64. package/build/src/xray-protos/proxy/wireguard/config.js +1 -1
  65. package/build/src/xray-protos/transport/internet/config.js +1 -1
  66. package/build/src/xray-protos/typeRegistry.js +1 -1
  67. package/package.json +1 -1
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.2.7
5
+ // protoc v5.29.3
6
+ // source: app/version/config.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Config = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const typeRegistry_1 = require("../../typeRegistry");
12
+ exports.protobufPackage = "xray.app.version";
13
+ function createBaseConfig() {
14
+ return { $type: "xray.app.version.Config", coreVersion: "", minVersion: "", maxVersion: "" };
15
+ }
16
+ exports.Config = {
17
+ $type: "xray.app.version.Config",
18
+ encode(message, writer = new wire_1.BinaryWriter()) {
19
+ if (message.coreVersion !== "") {
20
+ writer.uint32(10).string(message.coreVersion);
21
+ }
22
+ if (message.minVersion !== "") {
23
+ writer.uint32(18).string(message.minVersion);
24
+ }
25
+ if (message.maxVersion !== "") {
26
+ writer.uint32(26).string(message.maxVersion);
27
+ }
28
+ return writer;
29
+ },
30
+ decode(input, length) {
31
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
32
+ let end = length === undefined ? reader.len : reader.pos + length;
33
+ const message = createBaseConfig();
34
+ while (reader.pos < end) {
35
+ const tag = reader.uint32();
36
+ switch (tag >>> 3) {
37
+ case 1: {
38
+ if (tag !== 10) {
39
+ break;
40
+ }
41
+ message.coreVersion = reader.string();
42
+ continue;
43
+ }
44
+ case 2: {
45
+ if (tag !== 18) {
46
+ break;
47
+ }
48
+ message.minVersion = reader.string();
49
+ continue;
50
+ }
51
+ case 3: {
52
+ if (tag !== 26) {
53
+ break;
54
+ }
55
+ message.maxVersion = reader.string();
56
+ continue;
57
+ }
58
+ }
59
+ if ((tag & 7) === 4 || tag === 0) {
60
+ break;
61
+ }
62
+ reader.skip(tag & 7);
63
+ }
64
+ return message;
65
+ },
66
+ fromJSON(object) {
67
+ return {
68
+ $type: exports.Config.$type,
69
+ coreVersion: isSet(object.coreVersion) ? globalThis.String(object.coreVersion) : "",
70
+ minVersion: isSet(object.minVersion) ? globalThis.String(object.minVersion) : "",
71
+ maxVersion: isSet(object.maxVersion) ? globalThis.String(object.maxVersion) : "",
72
+ };
73
+ },
74
+ toJSON(message) {
75
+ const obj = {};
76
+ if (message.coreVersion !== "") {
77
+ obj.coreVersion = message.coreVersion;
78
+ }
79
+ if (message.minVersion !== "") {
80
+ obj.minVersion = message.minVersion;
81
+ }
82
+ if (message.maxVersion !== "") {
83
+ obj.maxVersion = message.maxVersion;
84
+ }
85
+ return obj;
86
+ },
87
+ create(base) {
88
+ return exports.Config.fromPartial(base ?? {});
89
+ },
90
+ fromPartial(object) {
91
+ const message = createBaseConfig();
92
+ message.coreVersion = object.coreVersion ?? "";
93
+ message.minVersion = object.minVersion ?? "";
94
+ message.maxVersion = object.maxVersion ?? "";
95
+ return message;
96
+ },
97
+ };
98
+ typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
99
+ function isSet(value) {
100
+ return value !== null && value !== undefined;
101
+ }
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/log/log.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Severity = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/net/address.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.IPOrDomain = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/net/destination.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Endpoint = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/net/network.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.NetworkList = exports.Network = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/net/port.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PortList = exports.PortRange = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/protocol/headers.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.SecurityConfig = exports.SecurityType = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/protocol/server_spec.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ServerEndpoint = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/protocol/user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.User = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: common/serial/typed_message.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.TypedMessage = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: core/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.OutboundHandlerConfig = exports.InboundHandlerConfig = exports.Config = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/blackhole/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.HTTPResponse = exports.NoneResponse = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/dns/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.protobufPackage = void 0;
@@ -6,12 +6,21 @@ export interface Config {
6
6
  $type: "xray.proxy.dokodemo.Config";
7
7
  address: IPOrDomain | undefined;
8
8
  port: number;
9
+ portMap: {
10
+ [key: string]: string;
11
+ };
9
12
  /** List of networks that the Dokodemo accepts. */
10
13
  networks: Network[];
11
14
  followRedirect: boolean;
12
15
  userLevel: number;
13
16
  }
17
+ export interface Config_PortMapEntry {
18
+ $type: "xray.proxy.dokodemo.Config.PortMapEntry";
19
+ key: string;
20
+ value: string;
21
+ }
14
22
  export declare const Config: MessageFns<Config, "xray.proxy.dokodemo.Config">;
23
+ export declare const Config_PortMapEntry: MessageFns<Config_PortMapEntry, "xray.proxy.dokodemo.Config.PortMapEntry">;
15
24
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
16
25
  export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
17
26
  [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/dokodemo/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAkC,MAAM,0BAA0B,CAAC;AAGnF,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,4B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,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;AAUf,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"}
@@ -2,10 +2,10 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/dokodemo/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Config = exports.protobufPackage = void 0;
8
+ exports.Config_PortMapEntry = exports.Config = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const address_1 = require("../../common/net/address");
@@ -17,6 +17,7 @@ function createBaseConfig() {
17
17
  $type: "xray.proxy.dokodemo.Config",
18
18
  address: undefined,
19
19
  port: 0,
20
+ portMap: {},
20
21
  networks: [],
21
22
  followRedirect: false,
22
23
  userLevel: 0,
@@ -31,6 +32,9 @@ exports.Config = {
31
32
  if (message.port !== 0) {
32
33
  writer.uint32(16).uint32(message.port);
33
34
  }
35
+ Object.entries(message.portMap).forEach(([key, value]) => {
36
+ exports.Config_PortMapEntry.encode({ $type: "xray.proxy.dokodemo.Config.PortMapEntry", key: key, value }, writer.uint32(26).fork()).join();
37
+ });
34
38
  writer.uint32(58).fork();
35
39
  for (const v of message.networks) {
36
40
  writer.int32(v);
@@ -65,6 +69,16 @@ exports.Config = {
65
69
  message.port = reader.uint32();
66
70
  continue;
67
71
  }
72
+ case 3: {
73
+ if (tag !== 26) {
74
+ break;
75
+ }
76
+ const entry3 = exports.Config_PortMapEntry.decode(reader, reader.uint32());
77
+ if (entry3.value !== undefined) {
78
+ message.portMap[entry3.key] = entry3.value;
79
+ }
80
+ continue;
81
+ }
68
82
  case 7: {
69
83
  if (tag === 56) {
70
84
  message.networks.push(reader.int32());
@@ -106,6 +120,12 @@ exports.Config = {
106
120
  $type: exports.Config.$type,
107
121
  address: isSet(object.address) ? address_1.IPOrDomain.fromJSON(object.address) : undefined,
108
122
  port: isSet(object.port) ? globalThis.Number(object.port) : 0,
123
+ portMap: isObject(object.portMap)
124
+ ? Object.entries(object.portMap).reduce((acc, [key, value]) => {
125
+ acc[key] = String(value);
126
+ return acc;
127
+ }, {})
128
+ : {},
109
129
  networks: globalThis.Array.isArray(object?.networks) ? object.networks.map((e) => (0, network_1.networkFromJSON)(e)) : [],
110
130
  followRedirect: isSet(object.followRedirect) ? globalThis.Boolean(object.followRedirect) : false,
111
131
  userLevel: isSet(object.userLevel) ? globalThis.Number(object.userLevel) : 0,
@@ -119,6 +139,15 @@ exports.Config = {
119
139
  if (message.port !== 0) {
120
140
  obj.port = Math.round(message.port);
121
141
  }
142
+ if (message.portMap) {
143
+ const entries = Object.entries(message.portMap);
144
+ if (entries.length > 0) {
145
+ obj.portMap = {};
146
+ entries.forEach(([k, v]) => {
147
+ obj.portMap[k] = v;
148
+ });
149
+ }
150
+ }
122
151
  if (message.networks?.length) {
123
152
  obj.networks = message.networks.map((e) => (0, network_1.networkToJSON)(e));
124
153
  }
@@ -139,6 +168,12 @@ exports.Config = {
139
168
  ? address_1.IPOrDomain.fromPartial(object.address)
140
169
  : undefined;
141
170
  message.port = object.port ?? 0;
171
+ message.portMap = Object.entries(object.portMap ?? {}).reduce((acc, [key, value]) => {
172
+ if (value !== undefined) {
173
+ acc[key] = globalThis.String(value);
174
+ }
175
+ return acc;
176
+ }, {});
142
177
  message.networks = object.networks?.map((e) => e) || [];
143
178
  message.followRedirect = object.followRedirect ?? false;
144
179
  message.userLevel = object.userLevel ?? 0;
@@ -146,6 +181,80 @@ exports.Config = {
146
181
  },
147
182
  };
148
183
  typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
184
+ function createBaseConfig_PortMapEntry() {
185
+ return { $type: "xray.proxy.dokodemo.Config.PortMapEntry", key: "", value: "" };
186
+ }
187
+ exports.Config_PortMapEntry = {
188
+ $type: "xray.proxy.dokodemo.Config.PortMapEntry",
189
+ encode(message, writer = new wire_1.BinaryWriter()) {
190
+ if (message.key !== "") {
191
+ writer.uint32(10).string(message.key);
192
+ }
193
+ if (message.value !== "") {
194
+ writer.uint32(18).string(message.value);
195
+ }
196
+ return writer;
197
+ },
198
+ decode(input, length) {
199
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
200
+ let end = length === undefined ? reader.len : reader.pos + length;
201
+ const message = createBaseConfig_PortMapEntry();
202
+ while (reader.pos < end) {
203
+ const tag = reader.uint32();
204
+ switch (tag >>> 3) {
205
+ case 1: {
206
+ if (tag !== 10) {
207
+ break;
208
+ }
209
+ message.key = reader.string();
210
+ continue;
211
+ }
212
+ case 2: {
213
+ if (tag !== 18) {
214
+ break;
215
+ }
216
+ message.value = reader.string();
217
+ continue;
218
+ }
219
+ }
220
+ if ((tag & 7) === 4 || tag === 0) {
221
+ break;
222
+ }
223
+ reader.skip(tag & 7);
224
+ }
225
+ return message;
226
+ },
227
+ fromJSON(object) {
228
+ return {
229
+ $type: exports.Config_PortMapEntry.$type,
230
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
231
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
232
+ };
233
+ },
234
+ toJSON(message) {
235
+ const obj = {};
236
+ if (message.key !== "") {
237
+ obj.key = message.key;
238
+ }
239
+ if (message.value !== "") {
240
+ obj.value = message.value;
241
+ }
242
+ return obj;
243
+ },
244
+ create(base) {
245
+ return exports.Config_PortMapEntry.fromPartial(base ?? {});
246
+ },
247
+ fromPartial(object) {
248
+ const message = createBaseConfig_PortMapEntry();
249
+ message.key = object.key ?? "";
250
+ message.value = object.value ?? "";
251
+ return message;
252
+ },
253
+ };
254
+ typeRegistry_1.messageTypeRegistry.set(exports.Config_PortMapEntry.$type, exports.Config_PortMapEntry);
255
+ function isObject(value) {
256
+ return typeof value === "object" && value !== null;
257
+ }
149
258
  function isSet(value) {
150
259
  return value !== null && value !== undefined;
151
260
  }
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/freedom/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.Noise = exports.Fragment = exports.DestinationOverride = exports.Config_DomainStrategy = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/http/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ClientConfig = exports.Header = exports.ServerConfig_AccountsEntry = exports.ServerConfig = exports.Account = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/loopback/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/shadowsocks/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ClientConfig = exports.ServerConfig = exports.Account = exports.CipherType = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/shadowsocks_2022/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ClientConfig = exports.Account = exports.RelayServerConfig = exports.RelayDestination = exports.MultiUserServerConfig = exports.ServerConfig = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/socks/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ClientConfig = exports.ServerConfig_AccountsEntry = exports.ServerConfig = exports.Account = exports.AuthType = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/trojan/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ServerConfig = exports.ClientConfig = exports.Fallback = exports.Account = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vless/account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Account = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vless/encoding/addons.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Addons = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vless/inbound/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.Fallback = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vless/outbound/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vmess/account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Account = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vmess/inbound/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.DefaultConfig = exports.DetourConfig = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/vmess/outbound/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Config = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: proxy/wireguard/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.DeviceConfig = exports.PeerConfig = exports.DeviceConfig_DomainStrategy = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  // source: transport/internet/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.HappyEyeballsConfig = exports.SocketConfig = exports.CustomSockopt = exports.ProxyConfig = exports.StreamConfig = exports.TransportConfig = exports.SocketConfig_TProxyMode = exports.AddressPortStrategy = exports.DomainStrategy = exports.protobufPackage = void 0;
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
5
+ // protoc v5.29.3
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.messageTypeRegistry = void 0;
8
8
  exports.messageTypeRegistry = new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/xtls-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A Typescript SDK for XRAY (XTLS) Core GRPC Api",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",