@remnawave/xtls-sdk 0.12.5 → 0.14.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/README.md +3 -1
- package/build/src/router/interfaces/index.d.ts +0 -1
- package/build/src/router/interfaces/index.d.ts.map +1 -1
- package/build/src/router/interfaces/index.js +0 -1
- package/build/src/router/models/index.d.ts +0 -1
- package/build/src/router/models/index.d.ts.map +1 -1
- package/build/src/router/models/index.js +0 -1
- package/build/src/router/router.service.d.ts +2 -12
- package/build/src/router/router.service.d.ts.map +1 -1
- package/build/src/router/router.service.js +1 -57
- package/build/src/xray-protos/app/geodata/config.d.ts +30 -0
- package/build/src/xray-protos/app/geodata/config.d.ts.map +1 -0
- package/build/src/xray-protos/app/geodata/config.js +172 -0
- package/build/src/xray-protos/app/proxyman/config.d.ts +3 -1
- package/build/src/xray-protos/app/proxyman/config.d.ts.map +1 -1
- package/build/src/xray-protos/app/proxyman/config.js +27 -6
- package/build/src/xray-protos/common/geodata/geodat.d.ts +111 -0
- package/build/src/xray-protos/common/geodata/geodat.d.ts.map +1 -0
- package/build/src/xray-protos/common/geodata/geodat.js +1027 -0
- package/build/src/xray-protos/proxy/dns/config.d.ts +19 -7
- package/build/src/xray-protos/proxy/dns/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/dns/config.js +161 -52
- package/build/src/xray-protos/proxy/freedom/config.d.ts +26 -0
- package/build/src/xray-protos/proxy/freedom/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/freedom/config.js +272 -1
- package/build/src/xray-protos/proxy/tun/config.d.ts +4 -0
- package/build/src/xray-protos/proxy/tun/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/tun/config.js +80 -3
- package/build/src/xray-protos/transport/internet/config.d.ts +0 -2
- package/build/src/xray-protos/transport/internet/config.d.ts.map +1 -1
- package/build/src/xray-protos/transport/internet/config.js +0 -65
- package/package.json +3 -4
- package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts +0 -7
- package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts.map +0 -1
- package/build/src/router/interfaces/add-source-ip-rule.interface.js +0 -2
- package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts +0 -5
- package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts.map +0 -1
- package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.js +0 -9
- package/build/src/router/models/add-source-ip-rule/index.d.ts +0 -2
- package/build/src/router/models/add-source-ip-rule/index.d.ts.map +0 -1
- package/build/src/router/models/add-source-ip-rule/index.js +0 -17
- package/build/src/xray-protos/app/router/config.d.ts +0 -193
- package/build/src/xray-protos/app/router/config.d.ts.map +0 -1
- package/build/src/xray-protos/app/router/config.js +0 -1797
|
@@ -1,1797 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
-
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.11.2
|
|
5
|
-
// protoc v6.33.4
|
|
6
|
-
// source: app/router/config.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.Config = exports.StrategyLeastLoadConfig = exports.StrategyWeight = exports.BalancingRule = exports.WebhookConfig_HeadersEntry = exports.WebhookConfig = exports.RoutingRule_AttributesEntry = exports.RoutingRule = exports.GeoSiteList = exports.GeoSite = exports.GeoIPList = exports.GeoIP = exports.CIDR = exports.Domain_Attribute = exports.Domain = exports.Config_DomainStrategy = exports.Domain_Type = exports.protobufPackage = void 0;
|
|
9
|
-
exports.domain_TypeFromJSON = domain_TypeFromJSON;
|
|
10
|
-
exports.domain_TypeToJSON = domain_TypeToJSON;
|
|
11
|
-
exports.config_DomainStrategyFromJSON = config_DomainStrategyFromJSON;
|
|
12
|
-
exports.config_DomainStrategyToJSON = config_DomainStrategyToJSON;
|
|
13
|
-
/* eslint-disable */
|
|
14
|
-
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
15
|
-
const network_1 = require("../../common/net/network");
|
|
16
|
-
const port_1 = require("../../common/net/port");
|
|
17
|
-
const typed_message_1 = require("../../common/serial/typed_message");
|
|
18
|
-
const typeRegistry_1 = require("../../typeRegistry");
|
|
19
|
-
exports.protobufPackage = "xray.app.router";
|
|
20
|
-
/** Type of domain value. */
|
|
21
|
-
var Domain_Type;
|
|
22
|
-
(function (Domain_Type) {
|
|
23
|
-
/** Plain - The value is used as is. */
|
|
24
|
-
Domain_Type[Domain_Type["Plain"] = 0] = "Plain";
|
|
25
|
-
/** Regex - The value is used as a regular expression. */
|
|
26
|
-
Domain_Type[Domain_Type["Regex"] = 1] = "Regex";
|
|
27
|
-
/** Domain - The value is a root domain. */
|
|
28
|
-
Domain_Type[Domain_Type["Domain"] = 2] = "Domain";
|
|
29
|
-
/** Full - The value is a domain. */
|
|
30
|
-
Domain_Type[Domain_Type["Full"] = 3] = "Full";
|
|
31
|
-
Domain_Type[Domain_Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
32
|
-
})(Domain_Type || (exports.Domain_Type = Domain_Type = {}));
|
|
33
|
-
function domain_TypeFromJSON(object) {
|
|
34
|
-
switch (object) {
|
|
35
|
-
case 0:
|
|
36
|
-
case "Plain":
|
|
37
|
-
return Domain_Type.Plain;
|
|
38
|
-
case 1:
|
|
39
|
-
case "Regex":
|
|
40
|
-
return Domain_Type.Regex;
|
|
41
|
-
case 2:
|
|
42
|
-
case "Domain":
|
|
43
|
-
return Domain_Type.Domain;
|
|
44
|
-
case 3:
|
|
45
|
-
case "Full":
|
|
46
|
-
return Domain_Type.Full;
|
|
47
|
-
case -1:
|
|
48
|
-
case "UNRECOGNIZED":
|
|
49
|
-
default:
|
|
50
|
-
return Domain_Type.UNRECOGNIZED;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function domain_TypeToJSON(object) {
|
|
54
|
-
switch (object) {
|
|
55
|
-
case Domain_Type.Plain:
|
|
56
|
-
return "Plain";
|
|
57
|
-
case Domain_Type.Regex:
|
|
58
|
-
return "Regex";
|
|
59
|
-
case Domain_Type.Domain:
|
|
60
|
-
return "Domain";
|
|
61
|
-
case Domain_Type.Full:
|
|
62
|
-
return "Full";
|
|
63
|
-
case Domain_Type.UNRECOGNIZED:
|
|
64
|
-
default:
|
|
65
|
-
return "UNRECOGNIZED";
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var Config_DomainStrategy;
|
|
69
|
-
(function (Config_DomainStrategy) {
|
|
70
|
-
/** AsIs - Use domain as is. */
|
|
71
|
-
Config_DomainStrategy[Config_DomainStrategy["AsIs"] = 0] = "AsIs";
|
|
72
|
-
/** IpIfNonMatch - Resolve to IP if the domain doesn't match any rules. */
|
|
73
|
-
Config_DomainStrategy[Config_DomainStrategy["IpIfNonMatch"] = 2] = "IpIfNonMatch";
|
|
74
|
-
/** IpOnDemand - Resolve to IP if any rule requires IP matching. */
|
|
75
|
-
Config_DomainStrategy[Config_DomainStrategy["IpOnDemand"] = 3] = "IpOnDemand";
|
|
76
|
-
Config_DomainStrategy[Config_DomainStrategy["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
77
|
-
})(Config_DomainStrategy || (exports.Config_DomainStrategy = Config_DomainStrategy = {}));
|
|
78
|
-
function config_DomainStrategyFromJSON(object) {
|
|
79
|
-
switch (object) {
|
|
80
|
-
case 0:
|
|
81
|
-
case "AsIs":
|
|
82
|
-
return Config_DomainStrategy.AsIs;
|
|
83
|
-
case 2:
|
|
84
|
-
case "IpIfNonMatch":
|
|
85
|
-
return Config_DomainStrategy.IpIfNonMatch;
|
|
86
|
-
case 3:
|
|
87
|
-
case "IpOnDemand":
|
|
88
|
-
return Config_DomainStrategy.IpOnDemand;
|
|
89
|
-
case -1:
|
|
90
|
-
case "UNRECOGNIZED":
|
|
91
|
-
default:
|
|
92
|
-
return Config_DomainStrategy.UNRECOGNIZED;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function config_DomainStrategyToJSON(object) {
|
|
96
|
-
switch (object) {
|
|
97
|
-
case Config_DomainStrategy.AsIs:
|
|
98
|
-
return "AsIs";
|
|
99
|
-
case Config_DomainStrategy.IpIfNonMatch:
|
|
100
|
-
return "IpIfNonMatch";
|
|
101
|
-
case Config_DomainStrategy.IpOnDemand:
|
|
102
|
-
return "IpOnDemand";
|
|
103
|
-
case Config_DomainStrategy.UNRECOGNIZED:
|
|
104
|
-
default:
|
|
105
|
-
return "UNRECOGNIZED";
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function createBaseDomain() {
|
|
109
|
-
return { $type: "xray.app.router.Domain", type: 0, value: "", attribute: [] };
|
|
110
|
-
}
|
|
111
|
-
exports.Domain = {
|
|
112
|
-
$type: "xray.app.router.Domain",
|
|
113
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
114
|
-
if (message.type !== 0) {
|
|
115
|
-
writer.uint32(8).int32(message.type);
|
|
116
|
-
}
|
|
117
|
-
if (message.value !== "") {
|
|
118
|
-
writer.uint32(18).string(message.value);
|
|
119
|
-
}
|
|
120
|
-
for (const v of message.attribute) {
|
|
121
|
-
exports.Domain_Attribute.encode(v, writer.uint32(26).fork()).join();
|
|
122
|
-
}
|
|
123
|
-
return writer;
|
|
124
|
-
},
|
|
125
|
-
decode(input, length) {
|
|
126
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
127
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
128
|
-
const message = createBaseDomain();
|
|
129
|
-
while (reader.pos < end) {
|
|
130
|
-
const tag = reader.uint32();
|
|
131
|
-
switch (tag >>> 3) {
|
|
132
|
-
case 1: {
|
|
133
|
-
if (tag !== 8) {
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
message.type = reader.int32();
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
case 2: {
|
|
140
|
-
if (tag !== 18) {
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
message.value = reader.string();
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
case 3: {
|
|
147
|
-
if (tag !== 26) {
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
message.attribute.push(exports.Domain_Attribute.decode(reader, reader.uint32()));
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
reader.skip(tag & 7);
|
|
158
|
-
}
|
|
159
|
-
return message;
|
|
160
|
-
},
|
|
161
|
-
fromJSON(object) {
|
|
162
|
-
return {
|
|
163
|
-
$type: exports.Domain.$type,
|
|
164
|
-
type: isSet(object.type) ? domain_TypeFromJSON(object.type) : 0,
|
|
165
|
-
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
166
|
-
attribute: globalThis.Array.isArray(object?.attribute)
|
|
167
|
-
? object.attribute.map((e) => exports.Domain_Attribute.fromJSON(e))
|
|
168
|
-
: [],
|
|
169
|
-
};
|
|
170
|
-
},
|
|
171
|
-
toJSON(message) {
|
|
172
|
-
const obj = {};
|
|
173
|
-
if (message.type !== 0) {
|
|
174
|
-
obj.type = domain_TypeToJSON(message.type);
|
|
175
|
-
}
|
|
176
|
-
if (message.value !== "") {
|
|
177
|
-
obj.value = message.value;
|
|
178
|
-
}
|
|
179
|
-
if (message.attribute?.length) {
|
|
180
|
-
obj.attribute = message.attribute.map((e) => exports.Domain_Attribute.toJSON(e));
|
|
181
|
-
}
|
|
182
|
-
return obj;
|
|
183
|
-
},
|
|
184
|
-
create(base) {
|
|
185
|
-
return exports.Domain.fromPartial(base ?? {});
|
|
186
|
-
},
|
|
187
|
-
fromPartial(object) {
|
|
188
|
-
const message = createBaseDomain();
|
|
189
|
-
message.type = object.type ?? 0;
|
|
190
|
-
message.value = object.value ?? "";
|
|
191
|
-
message.attribute = object.attribute?.map((e) => exports.Domain_Attribute.fromPartial(e)) || [];
|
|
192
|
-
return message;
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
typeRegistry_1.messageTypeRegistry.set(exports.Domain.$type, exports.Domain);
|
|
196
|
-
function createBaseDomain_Attribute() {
|
|
197
|
-
return { $type: "xray.app.router.Domain.Attribute", key: "", boolValue: undefined, intValue: undefined };
|
|
198
|
-
}
|
|
199
|
-
exports.Domain_Attribute = {
|
|
200
|
-
$type: "xray.app.router.Domain.Attribute",
|
|
201
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
202
|
-
if (message.key !== "") {
|
|
203
|
-
writer.uint32(10).string(message.key);
|
|
204
|
-
}
|
|
205
|
-
if (message.boolValue !== undefined) {
|
|
206
|
-
writer.uint32(16).bool(message.boolValue);
|
|
207
|
-
}
|
|
208
|
-
if (message.intValue !== undefined) {
|
|
209
|
-
writer.uint32(24).int64(message.intValue);
|
|
210
|
-
}
|
|
211
|
-
return writer;
|
|
212
|
-
},
|
|
213
|
-
decode(input, length) {
|
|
214
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
215
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
216
|
-
const message = createBaseDomain_Attribute();
|
|
217
|
-
while (reader.pos < end) {
|
|
218
|
-
const tag = reader.uint32();
|
|
219
|
-
switch (tag >>> 3) {
|
|
220
|
-
case 1: {
|
|
221
|
-
if (tag !== 10) {
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
message.key = reader.string();
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
case 2: {
|
|
228
|
-
if (tag !== 16) {
|
|
229
|
-
break;
|
|
230
|
-
}
|
|
231
|
-
message.boolValue = reader.bool();
|
|
232
|
-
continue;
|
|
233
|
-
}
|
|
234
|
-
case 3: {
|
|
235
|
-
if (tag !== 24) {
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
message.intValue = longToNumber(reader.int64());
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
reader.skip(tag & 7);
|
|
246
|
-
}
|
|
247
|
-
return message;
|
|
248
|
-
},
|
|
249
|
-
fromJSON(object) {
|
|
250
|
-
return {
|
|
251
|
-
$type: exports.Domain_Attribute.$type,
|
|
252
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
253
|
-
boolValue: isSet(object.boolValue)
|
|
254
|
-
? globalThis.Boolean(object.boolValue)
|
|
255
|
-
: isSet(object.bool_value)
|
|
256
|
-
? globalThis.Boolean(object.bool_value)
|
|
257
|
-
: undefined,
|
|
258
|
-
intValue: isSet(object.intValue)
|
|
259
|
-
? globalThis.Number(object.intValue)
|
|
260
|
-
: isSet(object.int_value)
|
|
261
|
-
? globalThis.Number(object.int_value)
|
|
262
|
-
: undefined,
|
|
263
|
-
};
|
|
264
|
-
},
|
|
265
|
-
toJSON(message) {
|
|
266
|
-
const obj = {};
|
|
267
|
-
if (message.key !== "") {
|
|
268
|
-
obj.key = message.key;
|
|
269
|
-
}
|
|
270
|
-
if (message.boolValue !== undefined) {
|
|
271
|
-
obj.boolValue = message.boolValue;
|
|
272
|
-
}
|
|
273
|
-
if (message.intValue !== undefined) {
|
|
274
|
-
obj.intValue = Math.round(message.intValue);
|
|
275
|
-
}
|
|
276
|
-
return obj;
|
|
277
|
-
},
|
|
278
|
-
create(base) {
|
|
279
|
-
return exports.Domain_Attribute.fromPartial(base ?? {});
|
|
280
|
-
},
|
|
281
|
-
fromPartial(object) {
|
|
282
|
-
const message = createBaseDomain_Attribute();
|
|
283
|
-
message.key = object.key ?? "";
|
|
284
|
-
message.boolValue = object.boolValue ?? undefined;
|
|
285
|
-
message.intValue = object.intValue ?? undefined;
|
|
286
|
-
return message;
|
|
287
|
-
},
|
|
288
|
-
};
|
|
289
|
-
typeRegistry_1.messageTypeRegistry.set(exports.Domain_Attribute.$type, exports.Domain_Attribute);
|
|
290
|
-
function createBaseCIDR() {
|
|
291
|
-
return { $type: "xray.app.router.CIDR", ip: new Uint8Array(0), prefix: 0 };
|
|
292
|
-
}
|
|
293
|
-
exports.CIDR = {
|
|
294
|
-
$type: "xray.app.router.CIDR",
|
|
295
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
296
|
-
if (message.ip.length !== 0) {
|
|
297
|
-
writer.uint32(10).bytes(message.ip);
|
|
298
|
-
}
|
|
299
|
-
if (message.prefix !== 0) {
|
|
300
|
-
writer.uint32(16).uint32(message.prefix);
|
|
301
|
-
}
|
|
302
|
-
return writer;
|
|
303
|
-
},
|
|
304
|
-
decode(input, length) {
|
|
305
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
306
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
307
|
-
const message = createBaseCIDR();
|
|
308
|
-
while (reader.pos < end) {
|
|
309
|
-
const tag = reader.uint32();
|
|
310
|
-
switch (tag >>> 3) {
|
|
311
|
-
case 1: {
|
|
312
|
-
if (tag !== 10) {
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
message.ip = reader.bytes();
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
case 2: {
|
|
319
|
-
if (tag !== 16) {
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
message.prefix = reader.uint32();
|
|
323
|
-
continue;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
327
|
-
break;
|
|
328
|
-
}
|
|
329
|
-
reader.skip(tag & 7);
|
|
330
|
-
}
|
|
331
|
-
return message;
|
|
332
|
-
},
|
|
333
|
-
fromJSON(object) {
|
|
334
|
-
return {
|
|
335
|
-
$type: exports.CIDR.$type,
|
|
336
|
-
ip: isSet(object.ip) ? bytesFromBase64(object.ip) : new Uint8Array(0),
|
|
337
|
-
prefix: isSet(object.prefix) ? globalThis.Number(object.prefix) : 0,
|
|
338
|
-
};
|
|
339
|
-
},
|
|
340
|
-
toJSON(message) {
|
|
341
|
-
const obj = {};
|
|
342
|
-
if (message.ip.length !== 0) {
|
|
343
|
-
obj.ip = base64FromBytes(message.ip);
|
|
344
|
-
}
|
|
345
|
-
if (message.prefix !== 0) {
|
|
346
|
-
obj.prefix = Math.round(message.prefix);
|
|
347
|
-
}
|
|
348
|
-
return obj;
|
|
349
|
-
},
|
|
350
|
-
create(base) {
|
|
351
|
-
return exports.CIDR.fromPartial(base ?? {});
|
|
352
|
-
},
|
|
353
|
-
fromPartial(object) {
|
|
354
|
-
const message = createBaseCIDR();
|
|
355
|
-
message.ip = object.ip ?? new Uint8Array(0);
|
|
356
|
-
message.prefix = object.prefix ?? 0;
|
|
357
|
-
return message;
|
|
358
|
-
},
|
|
359
|
-
};
|
|
360
|
-
typeRegistry_1.messageTypeRegistry.set(exports.CIDR.$type, exports.CIDR);
|
|
361
|
-
function createBaseGeoIP() {
|
|
362
|
-
return { $type: "xray.app.router.GeoIP", countryCode: "", cidr: [], reverseMatch: false };
|
|
363
|
-
}
|
|
364
|
-
exports.GeoIP = {
|
|
365
|
-
$type: "xray.app.router.GeoIP",
|
|
366
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
367
|
-
if (message.countryCode !== "") {
|
|
368
|
-
writer.uint32(10).string(message.countryCode);
|
|
369
|
-
}
|
|
370
|
-
for (const v of message.cidr) {
|
|
371
|
-
exports.CIDR.encode(v, writer.uint32(18).fork()).join();
|
|
372
|
-
}
|
|
373
|
-
if (message.reverseMatch !== false) {
|
|
374
|
-
writer.uint32(24).bool(message.reverseMatch);
|
|
375
|
-
}
|
|
376
|
-
return writer;
|
|
377
|
-
},
|
|
378
|
-
decode(input, length) {
|
|
379
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
380
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
381
|
-
const message = createBaseGeoIP();
|
|
382
|
-
while (reader.pos < end) {
|
|
383
|
-
const tag = reader.uint32();
|
|
384
|
-
switch (tag >>> 3) {
|
|
385
|
-
case 1: {
|
|
386
|
-
if (tag !== 10) {
|
|
387
|
-
break;
|
|
388
|
-
}
|
|
389
|
-
message.countryCode = reader.string();
|
|
390
|
-
continue;
|
|
391
|
-
}
|
|
392
|
-
case 2: {
|
|
393
|
-
if (tag !== 18) {
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
message.cidr.push(exports.CIDR.decode(reader, reader.uint32()));
|
|
397
|
-
continue;
|
|
398
|
-
}
|
|
399
|
-
case 3: {
|
|
400
|
-
if (tag !== 24) {
|
|
401
|
-
break;
|
|
402
|
-
}
|
|
403
|
-
message.reverseMatch = reader.bool();
|
|
404
|
-
continue;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
410
|
-
reader.skip(tag & 7);
|
|
411
|
-
}
|
|
412
|
-
return message;
|
|
413
|
-
},
|
|
414
|
-
fromJSON(object) {
|
|
415
|
-
return {
|
|
416
|
-
$type: exports.GeoIP.$type,
|
|
417
|
-
countryCode: isSet(object.countryCode)
|
|
418
|
-
? globalThis.String(object.countryCode)
|
|
419
|
-
: isSet(object.country_code)
|
|
420
|
-
? globalThis.String(object.country_code)
|
|
421
|
-
: "",
|
|
422
|
-
cidr: globalThis.Array.isArray(object?.cidr) ? object.cidr.map((e) => exports.CIDR.fromJSON(e)) : [],
|
|
423
|
-
reverseMatch: isSet(object.reverseMatch)
|
|
424
|
-
? globalThis.Boolean(object.reverseMatch)
|
|
425
|
-
: isSet(object.reverse_match)
|
|
426
|
-
? globalThis.Boolean(object.reverse_match)
|
|
427
|
-
: false,
|
|
428
|
-
};
|
|
429
|
-
},
|
|
430
|
-
toJSON(message) {
|
|
431
|
-
const obj = {};
|
|
432
|
-
if (message.countryCode !== "") {
|
|
433
|
-
obj.countryCode = message.countryCode;
|
|
434
|
-
}
|
|
435
|
-
if (message.cidr?.length) {
|
|
436
|
-
obj.cidr = message.cidr.map((e) => exports.CIDR.toJSON(e));
|
|
437
|
-
}
|
|
438
|
-
if (message.reverseMatch !== false) {
|
|
439
|
-
obj.reverseMatch = message.reverseMatch;
|
|
440
|
-
}
|
|
441
|
-
return obj;
|
|
442
|
-
},
|
|
443
|
-
create(base) {
|
|
444
|
-
return exports.GeoIP.fromPartial(base ?? {});
|
|
445
|
-
},
|
|
446
|
-
fromPartial(object) {
|
|
447
|
-
const message = createBaseGeoIP();
|
|
448
|
-
message.countryCode = object.countryCode ?? "";
|
|
449
|
-
message.cidr = object.cidr?.map((e) => exports.CIDR.fromPartial(e)) || [];
|
|
450
|
-
message.reverseMatch = object.reverseMatch ?? false;
|
|
451
|
-
return message;
|
|
452
|
-
},
|
|
453
|
-
};
|
|
454
|
-
typeRegistry_1.messageTypeRegistry.set(exports.GeoIP.$type, exports.GeoIP);
|
|
455
|
-
function createBaseGeoIPList() {
|
|
456
|
-
return { $type: "xray.app.router.GeoIPList", entry: [] };
|
|
457
|
-
}
|
|
458
|
-
exports.GeoIPList = {
|
|
459
|
-
$type: "xray.app.router.GeoIPList",
|
|
460
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
461
|
-
for (const v of message.entry) {
|
|
462
|
-
exports.GeoIP.encode(v, writer.uint32(10).fork()).join();
|
|
463
|
-
}
|
|
464
|
-
return writer;
|
|
465
|
-
},
|
|
466
|
-
decode(input, length) {
|
|
467
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
468
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
469
|
-
const message = createBaseGeoIPList();
|
|
470
|
-
while (reader.pos < end) {
|
|
471
|
-
const tag = reader.uint32();
|
|
472
|
-
switch (tag >>> 3) {
|
|
473
|
-
case 1: {
|
|
474
|
-
if (tag !== 10) {
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
|
-
message.entry.push(exports.GeoIP.decode(reader, reader.uint32()));
|
|
478
|
-
continue;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
482
|
-
break;
|
|
483
|
-
}
|
|
484
|
-
reader.skip(tag & 7);
|
|
485
|
-
}
|
|
486
|
-
return message;
|
|
487
|
-
},
|
|
488
|
-
fromJSON(object) {
|
|
489
|
-
return {
|
|
490
|
-
$type: exports.GeoIPList.$type,
|
|
491
|
-
entry: globalThis.Array.isArray(object?.entry) ? object.entry.map((e) => exports.GeoIP.fromJSON(e)) : [],
|
|
492
|
-
};
|
|
493
|
-
},
|
|
494
|
-
toJSON(message) {
|
|
495
|
-
const obj = {};
|
|
496
|
-
if (message.entry?.length) {
|
|
497
|
-
obj.entry = message.entry.map((e) => exports.GeoIP.toJSON(e));
|
|
498
|
-
}
|
|
499
|
-
return obj;
|
|
500
|
-
},
|
|
501
|
-
create(base) {
|
|
502
|
-
return exports.GeoIPList.fromPartial(base ?? {});
|
|
503
|
-
},
|
|
504
|
-
fromPartial(object) {
|
|
505
|
-
const message = createBaseGeoIPList();
|
|
506
|
-
message.entry = object.entry?.map((e) => exports.GeoIP.fromPartial(e)) || [];
|
|
507
|
-
return message;
|
|
508
|
-
},
|
|
509
|
-
};
|
|
510
|
-
typeRegistry_1.messageTypeRegistry.set(exports.GeoIPList.$type, exports.GeoIPList);
|
|
511
|
-
function createBaseGeoSite() {
|
|
512
|
-
return { $type: "xray.app.router.GeoSite", countryCode: "", domain: [] };
|
|
513
|
-
}
|
|
514
|
-
exports.GeoSite = {
|
|
515
|
-
$type: "xray.app.router.GeoSite",
|
|
516
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
517
|
-
if (message.countryCode !== "") {
|
|
518
|
-
writer.uint32(10).string(message.countryCode);
|
|
519
|
-
}
|
|
520
|
-
for (const v of message.domain) {
|
|
521
|
-
exports.Domain.encode(v, writer.uint32(18).fork()).join();
|
|
522
|
-
}
|
|
523
|
-
return writer;
|
|
524
|
-
},
|
|
525
|
-
decode(input, length) {
|
|
526
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
527
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
528
|
-
const message = createBaseGeoSite();
|
|
529
|
-
while (reader.pos < end) {
|
|
530
|
-
const tag = reader.uint32();
|
|
531
|
-
switch (tag >>> 3) {
|
|
532
|
-
case 1: {
|
|
533
|
-
if (tag !== 10) {
|
|
534
|
-
break;
|
|
535
|
-
}
|
|
536
|
-
message.countryCode = reader.string();
|
|
537
|
-
continue;
|
|
538
|
-
}
|
|
539
|
-
case 2: {
|
|
540
|
-
if (tag !== 18) {
|
|
541
|
-
break;
|
|
542
|
-
}
|
|
543
|
-
message.domain.push(exports.Domain.decode(reader, reader.uint32()));
|
|
544
|
-
continue;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
reader.skip(tag & 7);
|
|
551
|
-
}
|
|
552
|
-
return message;
|
|
553
|
-
},
|
|
554
|
-
fromJSON(object) {
|
|
555
|
-
return {
|
|
556
|
-
$type: exports.GeoSite.$type,
|
|
557
|
-
countryCode: isSet(object.countryCode)
|
|
558
|
-
? globalThis.String(object.countryCode)
|
|
559
|
-
: isSet(object.country_code)
|
|
560
|
-
? globalThis.String(object.country_code)
|
|
561
|
-
: "",
|
|
562
|
-
domain: globalThis.Array.isArray(object?.domain) ? object.domain.map((e) => exports.Domain.fromJSON(e)) : [],
|
|
563
|
-
};
|
|
564
|
-
},
|
|
565
|
-
toJSON(message) {
|
|
566
|
-
const obj = {};
|
|
567
|
-
if (message.countryCode !== "") {
|
|
568
|
-
obj.countryCode = message.countryCode;
|
|
569
|
-
}
|
|
570
|
-
if (message.domain?.length) {
|
|
571
|
-
obj.domain = message.domain.map((e) => exports.Domain.toJSON(e));
|
|
572
|
-
}
|
|
573
|
-
return obj;
|
|
574
|
-
},
|
|
575
|
-
create(base) {
|
|
576
|
-
return exports.GeoSite.fromPartial(base ?? {});
|
|
577
|
-
},
|
|
578
|
-
fromPartial(object) {
|
|
579
|
-
const message = createBaseGeoSite();
|
|
580
|
-
message.countryCode = object.countryCode ?? "";
|
|
581
|
-
message.domain = object.domain?.map((e) => exports.Domain.fromPartial(e)) || [];
|
|
582
|
-
return message;
|
|
583
|
-
},
|
|
584
|
-
};
|
|
585
|
-
typeRegistry_1.messageTypeRegistry.set(exports.GeoSite.$type, exports.GeoSite);
|
|
586
|
-
function createBaseGeoSiteList() {
|
|
587
|
-
return { $type: "xray.app.router.GeoSiteList", entry: [] };
|
|
588
|
-
}
|
|
589
|
-
exports.GeoSiteList = {
|
|
590
|
-
$type: "xray.app.router.GeoSiteList",
|
|
591
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
592
|
-
for (const v of message.entry) {
|
|
593
|
-
exports.GeoSite.encode(v, writer.uint32(10).fork()).join();
|
|
594
|
-
}
|
|
595
|
-
return writer;
|
|
596
|
-
},
|
|
597
|
-
decode(input, length) {
|
|
598
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
599
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
600
|
-
const message = createBaseGeoSiteList();
|
|
601
|
-
while (reader.pos < end) {
|
|
602
|
-
const tag = reader.uint32();
|
|
603
|
-
switch (tag >>> 3) {
|
|
604
|
-
case 1: {
|
|
605
|
-
if (tag !== 10) {
|
|
606
|
-
break;
|
|
607
|
-
}
|
|
608
|
-
message.entry.push(exports.GeoSite.decode(reader, reader.uint32()));
|
|
609
|
-
continue;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
613
|
-
break;
|
|
614
|
-
}
|
|
615
|
-
reader.skip(tag & 7);
|
|
616
|
-
}
|
|
617
|
-
return message;
|
|
618
|
-
},
|
|
619
|
-
fromJSON(object) {
|
|
620
|
-
return {
|
|
621
|
-
$type: exports.GeoSiteList.$type,
|
|
622
|
-
entry: globalThis.Array.isArray(object?.entry) ? object.entry.map((e) => exports.GeoSite.fromJSON(e)) : [],
|
|
623
|
-
};
|
|
624
|
-
},
|
|
625
|
-
toJSON(message) {
|
|
626
|
-
const obj = {};
|
|
627
|
-
if (message.entry?.length) {
|
|
628
|
-
obj.entry = message.entry.map((e) => exports.GeoSite.toJSON(e));
|
|
629
|
-
}
|
|
630
|
-
return obj;
|
|
631
|
-
},
|
|
632
|
-
create(base) {
|
|
633
|
-
return exports.GeoSiteList.fromPartial(base ?? {});
|
|
634
|
-
},
|
|
635
|
-
fromPartial(object) {
|
|
636
|
-
const message = createBaseGeoSiteList();
|
|
637
|
-
message.entry = object.entry?.map((e) => exports.GeoSite.fromPartial(e)) || [];
|
|
638
|
-
return message;
|
|
639
|
-
},
|
|
640
|
-
};
|
|
641
|
-
typeRegistry_1.messageTypeRegistry.set(exports.GeoSiteList.$type, exports.GeoSiteList);
|
|
642
|
-
function createBaseRoutingRule() {
|
|
643
|
-
return {
|
|
644
|
-
$type: "xray.app.router.RoutingRule",
|
|
645
|
-
tag: undefined,
|
|
646
|
-
balancingTag: undefined,
|
|
647
|
-
ruleTag: "",
|
|
648
|
-
domain: [],
|
|
649
|
-
geoip: [],
|
|
650
|
-
portList: undefined,
|
|
651
|
-
networks: [],
|
|
652
|
-
sourceGeoip: [],
|
|
653
|
-
sourcePortList: undefined,
|
|
654
|
-
userEmail: [],
|
|
655
|
-
inboundTag: [],
|
|
656
|
-
protocol: [],
|
|
657
|
-
attributes: {},
|
|
658
|
-
localGeoip: [],
|
|
659
|
-
localPortList: undefined,
|
|
660
|
-
vlessRouteList: undefined,
|
|
661
|
-
process: [],
|
|
662
|
-
webhook: undefined,
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
exports.RoutingRule = {
|
|
666
|
-
$type: "xray.app.router.RoutingRule",
|
|
667
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
668
|
-
if (message.tag !== undefined) {
|
|
669
|
-
writer.uint32(10).string(message.tag);
|
|
670
|
-
}
|
|
671
|
-
if (message.balancingTag !== undefined) {
|
|
672
|
-
writer.uint32(98).string(message.balancingTag);
|
|
673
|
-
}
|
|
674
|
-
if (message.ruleTag !== "") {
|
|
675
|
-
writer.uint32(154).string(message.ruleTag);
|
|
676
|
-
}
|
|
677
|
-
for (const v of message.domain) {
|
|
678
|
-
exports.Domain.encode(v, writer.uint32(18).fork()).join();
|
|
679
|
-
}
|
|
680
|
-
for (const v of message.geoip) {
|
|
681
|
-
exports.GeoIP.encode(v, writer.uint32(82).fork()).join();
|
|
682
|
-
}
|
|
683
|
-
if (message.portList !== undefined) {
|
|
684
|
-
port_1.PortList.encode(message.portList, writer.uint32(114).fork()).join();
|
|
685
|
-
}
|
|
686
|
-
writer.uint32(106).fork();
|
|
687
|
-
for (const v of message.networks) {
|
|
688
|
-
writer.int32(v);
|
|
689
|
-
}
|
|
690
|
-
writer.join();
|
|
691
|
-
for (const v of message.sourceGeoip) {
|
|
692
|
-
exports.GeoIP.encode(v, writer.uint32(90).fork()).join();
|
|
693
|
-
}
|
|
694
|
-
if (message.sourcePortList !== undefined) {
|
|
695
|
-
port_1.PortList.encode(message.sourcePortList, writer.uint32(130).fork()).join();
|
|
696
|
-
}
|
|
697
|
-
for (const v of message.userEmail) {
|
|
698
|
-
writer.uint32(58).string(v);
|
|
699
|
-
}
|
|
700
|
-
for (const v of message.inboundTag) {
|
|
701
|
-
writer.uint32(66).string(v);
|
|
702
|
-
}
|
|
703
|
-
for (const v of message.protocol) {
|
|
704
|
-
writer.uint32(74).string(v);
|
|
705
|
-
}
|
|
706
|
-
globalThis.Object.entries(message.attributes).forEach(([key, value]) => {
|
|
707
|
-
exports.RoutingRule_AttributesEntry.encode({
|
|
708
|
-
$type: "xray.app.router.RoutingRule.AttributesEntry",
|
|
709
|
-
key: key,
|
|
710
|
-
value,
|
|
711
|
-
}, writer.uint32(122).fork()).join();
|
|
712
|
-
});
|
|
713
|
-
for (const v of message.localGeoip) {
|
|
714
|
-
exports.GeoIP.encode(v, writer.uint32(138).fork()).join();
|
|
715
|
-
}
|
|
716
|
-
if (message.localPortList !== undefined) {
|
|
717
|
-
port_1.PortList.encode(message.localPortList, writer.uint32(146).fork()).join();
|
|
718
|
-
}
|
|
719
|
-
if (message.vlessRouteList !== undefined) {
|
|
720
|
-
port_1.PortList.encode(message.vlessRouteList, writer.uint32(162).fork()).join();
|
|
721
|
-
}
|
|
722
|
-
for (const v of message.process) {
|
|
723
|
-
writer.uint32(170).string(v);
|
|
724
|
-
}
|
|
725
|
-
if (message.webhook !== undefined) {
|
|
726
|
-
exports.WebhookConfig.encode(message.webhook, writer.uint32(178).fork()).join();
|
|
727
|
-
}
|
|
728
|
-
return writer;
|
|
729
|
-
},
|
|
730
|
-
decode(input, length) {
|
|
731
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
732
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
733
|
-
const message = createBaseRoutingRule();
|
|
734
|
-
while (reader.pos < end) {
|
|
735
|
-
const tag = reader.uint32();
|
|
736
|
-
switch (tag >>> 3) {
|
|
737
|
-
case 1: {
|
|
738
|
-
if (tag !== 10) {
|
|
739
|
-
break;
|
|
740
|
-
}
|
|
741
|
-
message.tag = reader.string();
|
|
742
|
-
continue;
|
|
743
|
-
}
|
|
744
|
-
case 12: {
|
|
745
|
-
if (tag !== 98) {
|
|
746
|
-
break;
|
|
747
|
-
}
|
|
748
|
-
message.balancingTag = reader.string();
|
|
749
|
-
continue;
|
|
750
|
-
}
|
|
751
|
-
case 19: {
|
|
752
|
-
if (tag !== 154) {
|
|
753
|
-
break;
|
|
754
|
-
}
|
|
755
|
-
message.ruleTag = reader.string();
|
|
756
|
-
continue;
|
|
757
|
-
}
|
|
758
|
-
case 2: {
|
|
759
|
-
if (tag !== 18) {
|
|
760
|
-
break;
|
|
761
|
-
}
|
|
762
|
-
message.domain.push(exports.Domain.decode(reader, reader.uint32()));
|
|
763
|
-
continue;
|
|
764
|
-
}
|
|
765
|
-
case 10: {
|
|
766
|
-
if (tag !== 82) {
|
|
767
|
-
break;
|
|
768
|
-
}
|
|
769
|
-
message.geoip.push(exports.GeoIP.decode(reader, reader.uint32()));
|
|
770
|
-
continue;
|
|
771
|
-
}
|
|
772
|
-
case 14: {
|
|
773
|
-
if (tag !== 114) {
|
|
774
|
-
break;
|
|
775
|
-
}
|
|
776
|
-
message.portList = port_1.PortList.decode(reader, reader.uint32());
|
|
777
|
-
continue;
|
|
778
|
-
}
|
|
779
|
-
case 13: {
|
|
780
|
-
if (tag === 104) {
|
|
781
|
-
message.networks.push(reader.int32());
|
|
782
|
-
continue;
|
|
783
|
-
}
|
|
784
|
-
if (tag === 106) {
|
|
785
|
-
const end2 = reader.uint32() + reader.pos;
|
|
786
|
-
while (reader.pos < end2) {
|
|
787
|
-
message.networks.push(reader.int32());
|
|
788
|
-
}
|
|
789
|
-
continue;
|
|
790
|
-
}
|
|
791
|
-
break;
|
|
792
|
-
}
|
|
793
|
-
case 11: {
|
|
794
|
-
if (tag !== 90) {
|
|
795
|
-
break;
|
|
796
|
-
}
|
|
797
|
-
message.sourceGeoip.push(exports.GeoIP.decode(reader, reader.uint32()));
|
|
798
|
-
continue;
|
|
799
|
-
}
|
|
800
|
-
case 16: {
|
|
801
|
-
if (tag !== 130) {
|
|
802
|
-
break;
|
|
803
|
-
}
|
|
804
|
-
message.sourcePortList = port_1.PortList.decode(reader, reader.uint32());
|
|
805
|
-
continue;
|
|
806
|
-
}
|
|
807
|
-
case 7: {
|
|
808
|
-
if (tag !== 58) {
|
|
809
|
-
break;
|
|
810
|
-
}
|
|
811
|
-
message.userEmail.push(reader.string());
|
|
812
|
-
continue;
|
|
813
|
-
}
|
|
814
|
-
case 8: {
|
|
815
|
-
if (tag !== 66) {
|
|
816
|
-
break;
|
|
817
|
-
}
|
|
818
|
-
message.inboundTag.push(reader.string());
|
|
819
|
-
continue;
|
|
820
|
-
}
|
|
821
|
-
case 9: {
|
|
822
|
-
if (tag !== 74) {
|
|
823
|
-
break;
|
|
824
|
-
}
|
|
825
|
-
message.protocol.push(reader.string());
|
|
826
|
-
continue;
|
|
827
|
-
}
|
|
828
|
-
case 15: {
|
|
829
|
-
if (tag !== 122) {
|
|
830
|
-
break;
|
|
831
|
-
}
|
|
832
|
-
const entry15 = exports.RoutingRule_AttributesEntry.decode(reader, reader.uint32());
|
|
833
|
-
if (entry15.value !== undefined) {
|
|
834
|
-
message.attributes[entry15.key] = entry15.value;
|
|
835
|
-
}
|
|
836
|
-
continue;
|
|
837
|
-
}
|
|
838
|
-
case 17: {
|
|
839
|
-
if (tag !== 138) {
|
|
840
|
-
break;
|
|
841
|
-
}
|
|
842
|
-
message.localGeoip.push(exports.GeoIP.decode(reader, reader.uint32()));
|
|
843
|
-
continue;
|
|
844
|
-
}
|
|
845
|
-
case 18: {
|
|
846
|
-
if (tag !== 146) {
|
|
847
|
-
break;
|
|
848
|
-
}
|
|
849
|
-
message.localPortList = port_1.PortList.decode(reader, reader.uint32());
|
|
850
|
-
continue;
|
|
851
|
-
}
|
|
852
|
-
case 20: {
|
|
853
|
-
if (tag !== 162) {
|
|
854
|
-
break;
|
|
855
|
-
}
|
|
856
|
-
message.vlessRouteList = port_1.PortList.decode(reader, reader.uint32());
|
|
857
|
-
continue;
|
|
858
|
-
}
|
|
859
|
-
case 21: {
|
|
860
|
-
if (tag !== 170) {
|
|
861
|
-
break;
|
|
862
|
-
}
|
|
863
|
-
message.process.push(reader.string());
|
|
864
|
-
continue;
|
|
865
|
-
}
|
|
866
|
-
case 22: {
|
|
867
|
-
if (tag !== 178) {
|
|
868
|
-
break;
|
|
869
|
-
}
|
|
870
|
-
message.webhook = exports.WebhookConfig.decode(reader, reader.uint32());
|
|
871
|
-
continue;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
875
|
-
break;
|
|
876
|
-
}
|
|
877
|
-
reader.skip(tag & 7);
|
|
878
|
-
}
|
|
879
|
-
return message;
|
|
880
|
-
},
|
|
881
|
-
fromJSON(object) {
|
|
882
|
-
return {
|
|
883
|
-
$type: exports.RoutingRule.$type,
|
|
884
|
-
tag: isSet(object.tag) ? globalThis.String(object.tag) : undefined,
|
|
885
|
-
balancingTag: isSet(object.balancingTag)
|
|
886
|
-
? globalThis.String(object.balancingTag)
|
|
887
|
-
: isSet(object.balancing_tag)
|
|
888
|
-
? globalThis.String(object.balancing_tag)
|
|
889
|
-
: undefined,
|
|
890
|
-
ruleTag: isSet(object.ruleTag)
|
|
891
|
-
? globalThis.String(object.ruleTag)
|
|
892
|
-
: isSet(object.rule_tag)
|
|
893
|
-
? globalThis.String(object.rule_tag)
|
|
894
|
-
: "",
|
|
895
|
-
domain: globalThis.Array.isArray(object?.domain) ? object.domain.map((e) => exports.Domain.fromJSON(e)) : [],
|
|
896
|
-
geoip: globalThis.Array.isArray(object?.geoip) ? object.geoip.map((e) => exports.GeoIP.fromJSON(e)) : [],
|
|
897
|
-
portList: isSet(object.portList)
|
|
898
|
-
? port_1.PortList.fromJSON(object.portList)
|
|
899
|
-
: isSet(object.port_list)
|
|
900
|
-
? port_1.PortList.fromJSON(object.port_list)
|
|
901
|
-
: undefined,
|
|
902
|
-
networks: globalThis.Array.isArray(object?.networks) ? object.networks.map((e) => (0, network_1.networkFromJSON)(e)) : [],
|
|
903
|
-
sourceGeoip: globalThis.Array.isArray(object?.sourceGeoip)
|
|
904
|
-
? object.sourceGeoip.map((e) => exports.GeoIP.fromJSON(e))
|
|
905
|
-
: globalThis.Array.isArray(object?.source_geoip)
|
|
906
|
-
? object.source_geoip.map((e) => exports.GeoIP.fromJSON(e))
|
|
907
|
-
: [],
|
|
908
|
-
sourcePortList: isSet(object.sourcePortList)
|
|
909
|
-
? port_1.PortList.fromJSON(object.sourcePortList)
|
|
910
|
-
: isSet(object.source_port_list)
|
|
911
|
-
? port_1.PortList.fromJSON(object.source_port_list)
|
|
912
|
-
: undefined,
|
|
913
|
-
userEmail: globalThis.Array.isArray(object?.userEmail)
|
|
914
|
-
? object.userEmail.map((e) => globalThis.String(e))
|
|
915
|
-
: globalThis.Array.isArray(object?.user_email)
|
|
916
|
-
? object.user_email.map((e) => globalThis.String(e))
|
|
917
|
-
: [],
|
|
918
|
-
inboundTag: globalThis.Array.isArray(object?.inboundTag)
|
|
919
|
-
? object.inboundTag.map((e) => globalThis.String(e))
|
|
920
|
-
: globalThis.Array.isArray(object?.inbound_tag)
|
|
921
|
-
? object.inbound_tag.map((e) => globalThis.String(e))
|
|
922
|
-
: [],
|
|
923
|
-
protocol: globalThis.Array.isArray(object?.protocol)
|
|
924
|
-
? object.protocol.map((e) => globalThis.String(e))
|
|
925
|
-
: [],
|
|
926
|
-
attributes: isObject(object.attributes)
|
|
927
|
-
? globalThis.Object.entries(object.attributes).reduce((acc, [key, value]) => {
|
|
928
|
-
acc[key] = globalThis.String(value);
|
|
929
|
-
return acc;
|
|
930
|
-
}, {})
|
|
931
|
-
: {},
|
|
932
|
-
localGeoip: globalThis.Array.isArray(object?.localGeoip)
|
|
933
|
-
? object.localGeoip.map((e) => exports.GeoIP.fromJSON(e))
|
|
934
|
-
: globalThis.Array.isArray(object?.local_geoip)
|
|
935
|
-
? object.local_geoip.map((e) => exports.GeoIP.fromJSON(e))
|
|
936
|
-
: [],
|
|
937
|
-
localPortList: isSet(object.localPortList)
|
|
938
|
-
? port_1.PortList.fromJSON(object.localPortList)
|
|
939
|
-
: isSet(object.local_port_list)
|
|
940
|
-
? port_1.PortList.fromJSON(object.local_port_list)
|
|
941
|
-
: undefined,
|
|
942
|
-
vlessRouteList: isSet(object.vlessRouteList)
|
|
943
|
-
? port_1.PortList.fromJSON(object.vlessRouteList)
|
|
944
|
-
: isSet(object.vless_route_list)
|
|
945
|
-
? port_1.PortList.fromJSON(object.vless_route_list)
|
|
946
|
-
: undefined,
|
|
947
|
-
process: globalThis.Array.isArray(object?.process)
|
|
948
|
-
? object.process.map((e) => globalThis.String(e))
|
|
949
|
-
: [],
|
|
950
|
-
webhook: isSet(object.webhook) ? exports.WebhookConfig.fromJSON(object.webhook) : undefined,
|
|
951
|
-
};
|
|
952
|
-
},
|
|
953
|
-
toJSON(message) {
|
|
954
|
-
const obj = {};
|
|
955
|
-
if (message.tag !== undefined) {
|
|
956
|
-
obj.tag = message.tag;
|
|
957
|
-
}
|
|
958
|
-
if (message.balancingTag !== undefined) {
|
|
959
|
-
obj.balancingTag = message.balancingTag;
|
|
960
|
-
}
|
|
961
|
-
if (message.ruleTag !== "") {
|
|
962
|
-
obj.ruleTag = message.ruleTag;
|
|
963
|
-
}
|
|
964
|
-
if (message.domain?.length) {
|
|
965
|
-
obj.domain = message.domain.map((e) => exports.Domain.toJSON(e));
|
|
966
|
-
}
|
|
967
|
-
if (message.geoip?.length) {
|
|
968
|
-
obj.geoip = message.geoip.map((e) => exports.GeoIP.toJSON(e));
|
|
969
|
-
}
|
|
970
|
-
if (message.portList !== undefined) {
|
|
971
|
-
obj.portList = port_1.PortList.toJSON(message.portList);
|
|
972
|
-
}
|
|
973
|
-
if (message.networks?.length) {
|
|
974
|
-
obj.networks = message.networks.map((e) => (0, network_1.networkToJSON)(e));
|
|
975
|
-
}
|
|
976
|
-
if (message.sourceGeoip?.length) {
|
|
977
|
-
obj.sourceGeoip = message.sourceGeoip.map((e) => exports.GeoIP.toJSON(e));
|
|
978
|
-
}
|
|
979
|
-
if (message.sourcePortList !== undefined) {
|
|
980
|
-
obj.sourcePortList = port_1.PortList.toJSON(message.sourcePortList);
|
|
981
|
-
}
|
|
982
|
-
if (message.userEmail?.length) {
|
|
983
|
-
obj.userEmail = message.userEmail;
|
|
984
|
-
}
|
|
985
|
-
if (message.inboundTag?.length) {
|
|
986
|
-
obj.inboundTag = message.inboundTag;
|
|
987
|
-
}
|
|
988
|
-
if (message.protocol?.length) {
|
|
989
|
-
obj.protocol = message.protocol;
|
|
990
|
-
}
|
|
991
|
-
if (message.attributes) {
|
|
992
|
-
const entries = globalThis.Object.entries(message.attributes);
|
|
993
|
-
if (entries.length > 0) {
|
|
994
|
-
obj.attributes = {};
|
|
995
|
-
entries.forEach(([k, v]) => {
|
|
996
|
-
obj.attributes[k] = v;
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
if (message.localGeoip?.length) {
|
|
1001
|
-
obj.localGeoip = message.localGeoip.map((e) => exports.GeoIP.toJSON(e));
|
|
1002
|
-
}
|
|
1003
|
-
if (message.localPortList !== undefined) {
|
|
1004
|
-
obj.localPortList = port_1.PortList.toJSON(message.localPortList);
|
|
1005
|
-
}
|
|
1006
|
-
if (message.vlessRouteList !== undefined) {
|
|
1007
|
-
obj.vlessRouteList = port_1.PortList.toJSON(message.vlessRouteList);
|
|
1008
|
-
}
|
|
1009
|
-
if (message.process?.length) {
|
|
1010
|
-
obj.process = message.process;
|
|
1011
|
-
}
|
|
1012
|
-
if (message.webhook !== undefined) {
|
|
1013
|
-
obj.webhook = exports.WebhookConfig.toJSON(message.webhook);
|
|
1014
|
-
}
|
|
1015
|
-
return obj;
|
|
1016
|
-
},
|
|
1017
|
-
create(base) {
|
|
1018
|
-
return exports.RoutingRule.fromPartial(base ?? {});
|
|
1019
|
-
},
|
|
1020
|
-
fromPartial(object) {
|
|
1021
|
-
const message = createBaseRoutingRule();
|
|
1022
|
-
message.tag = object.tag ?? undefined;
|
|
1023
|
-
message.balancingTag = object.balancingTag ?? undefined;
|
|
1024
|
-
message.ruleTag = object.ruleTag ?? "";
|
|
1025
|
-
message.domain = object.domain?.map((e) => exports.Domain.fromPartial(e)) || [];
|
|
1026
|
-
message.geoip = object.geoip?.map((e) => exports.GeoIP.fromPartial(e)) || [];
|
|
1027
|
-
message.portList = (object.portList !== undefined && object.portList !== null)
|
|
1028
|
-
? port_1.PortList.fromPartial(object.portList)
|
|
1029
|
-
: undefined;
|
|
1030
|
-
message.networks = object.networks?.map((e) => e) || [];
|
|
1031
|
-
message.sourceGeoip = object.sourceGeoip?.map((e) => exports.GeoIP.fromPartial(e)) || [];
|
|
1032
|
-
message.sourcePortList = (object.sourcePortList !== undefined && object.sourcePortList !== null)
|
|
1033
|
-
? port_1.PortList.fromPartial(object.sourcePortList)
|
|
1034
|
-
: undefined;
|
|
1035
|
-
message.userEmail = object.userEmail?.map((e) => e) || [];
|
|
1036
|
-
message.inboundTag = object.inboundTag?.map((e) => e) || [];
|
|
1037
|
-
message.protocol = object.protocol?.map((e) => e) || [];
|
|
1038
|
-
message.attributes = globalThis.Object.entries(object.attributes ?? {}).reduce((acc, [key, value]) => {
|
|
1039
|
-
if (value !== undefined) {
|
|
1040
|
-
acc[key] = globalThis.String(value);
|
|
1041
|
-
}
|
|
1042
|
-
return acc;
|
|
1043
|
-
}, {});
|
|
1044
|
-
message.localGeoip = object.localGeoip?.map((e) => exports.GeoIP.fromPartial(e)) || [];
|
|
1045
|
-
message.localPortList = (object.localPortList !== undefined && object.localPortList !== null)
|
|
1046
|
-
? port_1.PortList.fromPartial(object.localPortList)
|
|
1047
|
-
: undefined;
|
|
1048
|
-
message.vlessRouteList = (object.vlessRouteList !== undefined && object.vlessRouteList !== null)
|
|
1049
|
-
? port_1.PortList.fromPartial(object.vlessRouteList)
|
|
1050
|
-
: undefined;
|
|
1051
|
-
message.process = object.process?.map((e) => e) || [];
|
|
1052
|
-
message.webhook = (object.webhook !== undefined && object.webhook !== null)
|
|
1053
|
-
? exports.WebhookConfig.fromPartial(object.webhook)
|
|
1054
|
-
: undefined;
|
|
1055
|
-
return message;
|
|
1056
|
-
},
|
|
1057
|
-
};
|
|
1058
|
-
typeRegistry_1.messageTypeRegistry.set(exports.RoutingRule.$type, exports.RoutingRule);
|
|
1059
|
-
function createBaseRoutingRule_AttributesEntry() {
|
|
1060
|
-
return { $type: "xray.app.router.RoutingRule.AttributesEntry", key: "", value: "" };
|
|
1061
|
-
}
|
|
1062
|
-
exports.RoutingRule_AttributesEntry = {
|
|
1063
|
-
$type: "xray.app.router.RoutingRule.AttributesEntry",
|
|
1064
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1065
|
-
if (message.key !== "") {
|
|
1066
|
-
writer.uint32(10).string(message.key);
|
|
1067
|
-
}
|
|
1068
|
-
if (message.value !== "") {
|
|
1069
|
-
writer.uint32(18).string(message.value);
|
|
1070
|
-
}
|
|
1071
|
-
return writer;
|
|
1072
|
-
},
|
|
1073
|
-
decode(input, length) {
|
|
1074
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1075
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1076
|
-
const message = createBaseRoutingRule_AttributesEntry();
|
|
1077
|
-
while (reader.pos < end) {
|
|
1078
|
-
const tag = reader.uint32();
|
|
1079
|
-
switch (tag >>> 3) {
|
|
1080
|
-
case 1: {
|
|
1081
|
-
if (tag !== 10) {
|
|
1082
|
-
break;
|
|
1083
|
-
}
|
|
1084
|
-
message.key = reader.string();
|
|
1085
|
-
continue;
|
|
1086
|
-
}
|
|
1087
|
-
case 2: {
|
|
1088
|
-
if (tag !== 18) {
|
|
1089
|
-
break;
|
|
1090
|
-
}
|
|
1091
|
-
message.value = reader.string();
|
|
1092
|
-
continue;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1096
|
-
break;
|
|
1097
|
-
}
|
|
1098
|
-
reader.skip(tag & 7);
|
|
1099
|
-
}
|
|
1100
|
-
return message;
|
|
1101
|
-
},
|
|
1102
|
-
fromJSON(object) {
|
|
1103
|
-
return {
|
|
1104
|
-
$type: exports.RoutingRule_AttributesEntry.$type,
|
|
1105
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1106
|
-
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
1107
|
-
};
|
|
1108
|
-
},
|
|
1109
|
-
toJSON(message) {
|
|
1110
|
-
const obj = {};
|
|
1111
|
-
if (message.key !== "") {
|
|
1112
|
-
obj.key = message.key;
|
|
1113
|
-
}
|
|
1114
|
-
if (message.value !== "") {
|
|
1115
|
-
obj.value = message.value;
|
|
1116
|
-
}
|
|
1117
|
-
return obj;
|
|
1118
|
-
},
|
|
1119
|
-
create(base) {
|
|
1120
|
-
return exports.RoutingRule_AttributesEntry.fromPartial(base ?? {});
|
|
1121
|
-
},
|
|
1122
|
-
fromPartial(object) {
|
|
1123
|
-
const message = createBaseRoutingRule_AttributesEntry();
|
|
1124
|
-
message.key = object.key ?? "";
|
|
1125
|
-
message.value = object.value ?? "";
|
|
1126
|
-
return message;
|
|
1127
|
-
},
|
|
1128
|
-
};
|
|
1129
|
-
typeRegistry_1.messageTypeRegistry.set(exports.RoutingRule_AttributesEntry.$type, exports.RoutingRule_AttributesEntry);
|
|
1130
|
-
function createBaseWebhookConfig() {
|
|
1131
|
-
return { $type: "xray.app.router.WebhookConfig", url: "", deduplication: 0, headers: {} };
|
|
1132
|
-
}
|
|
1133
|
-
exports.WebhookConfig = {
|
|
1134
|
-
$type: "xray.app.router.WebhookConfig",
|
|
1135
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1136
|
-
if (message.url !== "") {
|
|
1137
|
-
writer.uint32(10).string(message.url);
|
|
1138
|
-
}
|
|
1139
|
-
if (message.deduplication !== 0) {
|
|
1140
|
-
writer.uint32(16).uint32(message.deduplication);
|
|
1141
|
-
}
|
|
1142
|
-
globalThis.Object.entries(message.headers).forEach(([key, value]) => {
|
|
1143
|
-
exports.WebhookConfig_HeadersEntry.encode({ $type: "xray.app.router.WebhookConfig.HeadersEntry", key: key, value }, writer.uint32(26).fork()).join();
|
|
1144
|
-
});
|
|
1145
|
-
return writer;
|
|
1146
|
-
},
|
|
1147
|
-
decode(input, length) {
|
|
1148
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1149
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1150
|
-
const message = createBaseWebhookConfig();
|
|
1151
|
-
while (reader.pos < end) {
|
|
1152
|
-
const tag = reader.uint32();
|
|
1153
|
-
switch (tag >>> 3) {
|
|
1154
|
-
case 1: {
|
|
1155
|
-
if (tag !== 10) {
|
|
1156
|
-
break;
|
|
1157
|
-
}
|
|
1158
|
-
message.url = reader.string();
|
|
1159
|
-
continue;
|
|
1160
|
-
}
|
|
1161
|
-
case 2: {
|
|
1162
|
-
if (tag !== 16) {
|
|
1163
|
-
break;
|
|
1164
|
-
}
|
|
1165
|
-
message.deduplication = reader.uint32();
|
|
1166
|
-
continue;
|
|
1167
|
-
}
|
|
1168
|
-
case 3: {
|
|
1169
|
-
if (tag !== 26) {
|
|
1170
|
-
break;
|
|
1171
|
-
}
|
|
1172
|
-
const entry3 = exports.WebhookConfig_HeadersEntry.decode(reader, reader.uint32());
|
|
1173
|
-
if (entry3.value !== undefined) {
|
|
1174
|
-
message.headers[entry3.key] = entry3.value;
|
|
1175
|
-
}
|
|
1176
|
-
continue;
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1180
|
-
break;
|
|
1181
|
-
}
|
|
1182
|
-
reader.skip(tag & 7);
|
|
1183
|
-
}
|
|
1184
|
-
return message;
|
|
1185
|
-
},
|
|
1186
|
-
fromJSON(object) {
|
|
1187
|
-
return {
|
|
1188
|
-
$type: exports.WebhookConfig.$type,
|
|
1189
|
-
url: isSet(object.url) ? globalThis.String(object.url) : "",
|
|
1190
|
-
deduplication: isSet(object.deduplication) ? globalThis.Number(object.deduplication) : 0,
|
|
1191
|
-
headers: isObject(object.headers)
|
|
1192
|
-
? globalThis.Object.entries(object.headers).reduce((acc, [key, value]) => {
|
|
1193
|
-
acc[key] = globalThis.String(value);
|
|
1194
|
-
return acc;
|
|
1195
|
-
}, {})
|
|
1196
|
-
: {},
|
|
1197
|
-
};
|
|
1198
|
-
},
|
|
1199
|
-
toJSON(message) {
|
|
1200
|
-
const obj = {};
|
|
1201
|
-
if (message.url !== "") {
|
|
1202
|
-
obj.url = message.url;
|
|
1203
|
-
}
|
|
1204
|
-
if (message.deduplication !== 0) {
|
|
1205
|
-
obj.deduplication = Math.round(message.deduplication);
|
|
1206
|
-
}
|
|
1207
|
-
if (message.headers) {
|
|
1208
|
-
const entries = globalThis.Object.entries(message.headers);
|
|
1209
|
-
if (entries.length > 0) {
|
|
1210
|
-
obj.headers = {};
|
|
1211
|
-
entries.forEach(([k, v]) => {
|
|
1212
|
-
obj.headers[k] = v;
|
|
1213
|
-
});
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
return obj;
|
|
1217
|
-
},
|
|
1218
|
-
create(base) {
|
|
1219
|
-
return exports.WebhookConfig.fromPartial(base ?? {});
|
|
1220
|
-
},
|
|
1221
|
-
fromPartial(object) {
|
|
1222
|
-
const message = createBaseWebhookConfig();
|
|
1223
|
-
message.url = object.url ?? "";
|
|
1224
|
-
message.deduplication = object.deduplication ?? 0;
|
|
1225
|
-
message.headers = globalThis.Object.entries(object.headers ?? {}).reduce((acc, [key, value]) => {
|
|
1226
|
-
if (value !== undefined) {
|
|
1227
|
-
acc[key] = globalThis.String(value);
|
|
1228
|
-
}
|
|
1229
|
-
return acc;
|
|
1230
|
-
}, {});
|
|
1231
|
-
return message;
|
|
1232
|
-
},
|
|
1233
|
-
};
|
|
1234
|
-
typeRegistry_1.messageTypeRegistry.set(exports.WebhookConfig.$type, exports.WebhookConfig);
|
|
1235
|
-
function createBaseWebhookConfig_HeadersEntry() {
|
|
1236
|
-
return { $type: "xray.app.router.WebhookConfig.HeadersEntry", key: "", value: "" };
|
|
1237
|
-
}
|
|
1238
|
-
exports.WebhookConfig_HeadersEntry = {
|
|
1239
|
-
$type: "xray.app.router.WebhookConfig.HeadersEntry",
|
|
1240
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1241
|
-
if (message.key !== "") {
|
|
1242
|
-
writer.uint32(10).string(message.key);
|
|
1243
|
-
}
|
|
1244
|
-
if (message.value !== "") {
|
|
1245
|
-
writer.uint32(18).string(message.value);
|
|
1246
|
-
}
|
|
1247
|
-
return writer;
|
|
1248
|
-
},
|
|
1249
|
-
decode(input, length) {
|
|
1250
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1251
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1252
|
-
const message = createBaseWebhookConfig_HeadersEntry();
|
|
1253
|
-
while (reader.pos < end) {
|
|
1254
|
-
const tag = reader.uint32();
|
|
1255
|
-
switch (tag >>> 3) {
|
|
1256
|
-
case 1: {
|
|
1257
|
-
if (tag !== 10) {
|
|
1258
|
-
break;
|
|
1259
|
-
}
|
|
1260
|
-
message.key = reader.string();
|
|
1261
|
-
continue;
|
|
1262
|
-
}
|
|
1263
|
-
case 2: {
|
|
1264
|
-
if (tag !== 18) {
|
|
1265
|
-
break;
|
|
1266
|
-
}
|
|
1267
|
-
message.value = reader.string();
|
|
1268
|
-
continue;
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1272
|
-
break;
|
|
1273
|
-
}
|
|
1274
|
-
reader.skip(tag & 7);
|
|
1275
|
-
}
|
|
1276
|
-
return message;
|
|
1277
|
-
},
|
|
1278
|
-
fromJSON(object) {
|
|
1279
|
-
return {
|
|
1280
|
-
$type: exports.WebhookConfig_HeadersEntry.$type,
|
|
1281
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1282
|
-
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
1283
|
-
};
|
|
1284
|
-
},
|
|
1285
|
-
toJSON(message) {
|
|
1286
|
-
const obj = {};
|
|
1287
|
-
if (message.key !== "") {
|
|
1288
|
-
obj.key = message.key;
|
|
1289
|
-
}
|
|
1290
|
-
if (message.value !== "") {
|
|
1291
|
-
obj.value = message.value;
|
|
1292
|
-
}
|
|
1293
|
-
return obj;
|
|
1294
|
-
},
|
|
1295
|
-
create(base) {
|
|
1296
|
-
return exports.WebhookConfig_HeadersEntry.fromPartial(base ?? {});
|
|
1297
|
-
},
|
|
1298
|
-
fromPartial(object) {
|
|
1299
|
-
const message = createBaseWebhookConfig_HeadersEntry();
|
|
1300
|
-
message.key = object.key ?? "";
|
|
1301
|
-
message.value = object.value ?? "";
|
|
1302
|
-
return message;
|
|
1303
|
-
},
|
|
1304
|
-
};
|
|
1305
|
-
typeRegistry_1.messageTypeRegistry.set(exports.WebhookConfig_HeadersEntry.$type, exports.WebhookConfig_HeadersEntry);
|
|
1306
|
-
function createBaseBalancingRule() {
|
|
1307
|
-
return {
|
|
1308
|
-
$type: "xray.app.router.BalancingRule",
|
|
1309
|
-
tag: "",
|
|
1310
|
-
outboundSelector: [],
|
|
1311
|
-
strategy: "",
|
|
1312
|
-
strategySettings: undefined,
|
|
1313
|
-
fallbackTag: "",
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
exports.BalancingRule = {
|
|
1317
|
-
$type: "xray.app.router.BalancingRule",
|
|
1318
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1319
|
-
if (message.tag !== "") {
|
|
1320
|
-
writer.uint32(10).string(message.tag);
|
|
1321
|
-
}
|
|
1322
|
-
for (const v of message.outboundSelector) {
|
|
1323
|
-
writer.uint32(18).string(v);
|
|
1324
|
-
}
|
|
1325
|
-
if (message.strategy !== "") {
|
|
1326
|
-
writer.uint32(26).string(message.strategy);
|
|
1327
|
-
}
|
|
1328
|
-
if (message.strategySettings !== undefined) {
|
|
1329
|
-
typed_message_1.TypedMessage.encode(message.strategySettings, writer.uint32(34).fork()).join();
|
|
1330
|
-
}
|
|
1331
|
-
if (message.fallbackTag !== "") {
|
|
1332
|
-
writer.uint32(42).string(message.fallbackTag);
|
|
1333
|
-
}
|
|
1334
|
-
return writer;
|
|
1335
|
-
},
|
|
1336
|
-
decode(input, length) {
|
|
1337
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1338
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1339
|
-
const message = createBaseBalancingRule();
|
|
1340
|
-
while (reader.pos < end) {
|
|
1341
|
-
const tag = reader.uint32();
|
|
1342
|
-
switch (tag >>> 3) {
|
|
1343
|
-
case 1: {
|
|
1344
|
-
if (tag !== 10) {
|
|
1345
|
-
break;
|
|
1346
|
-
}
|
|
1347
|
-
message.tag = reader.string();
|
|
1348
|
-
continue;
|
|
1349
|
-
}
|
|
1350
|
-
case 2: {
|
|
1351
|
-
if (tag !== 18) {
|
|
1352
|
-
break;
|
|
1353
|
-
}
|
|
1354
|
-
message.outboundSelector.push(reader.string());
|
|
1355
|
-
continue;
|
|
1356
|
-
}
|
|
1357
|
-
case 3: {
|
|
1358
|
-
if (tag !== 26) {
|
|
1359
|
-
break;
|
|
1360
|
-
}
|
|
1361
|
-
message.strategy = reader.string();
|
|
1362
|
-
continue;
|
|
1363
|
-
}
|
|
1364
|
-
case 4: {
|
|
1365
|
-
if (tag !== 34) {
|
|
1366
|
-
break;
|
|
1367
|
-
}
|
|
1368
|
-
message.strategySettings = typed_message_1.TypedMessage.decode(reader, reader.uint32());
|
|
1369
|
-
continue;
|
|
1370
|
-
}
|
|
1371
|
-
case 5: {
|
|
1372
|
-
if (tag !== 42) {
|
|
1373
|
-
break;
|
|
1374
|
-
}
|
|
1375
|
-
message.fallbackTag = reader.string();
|
|
1376
|
-
continue;
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1380
|
-
break;
|
|
1381
|
-
}
|
|
1382
|
-
reader.skip(tag & 7);
|
|
1383
|
-
}
|
|
1384
|
-
return message;
|
|
1385
|
-
},
|
|
1386
|
-
fromJSON(object) {
|
|
1387
|
-
return {
|
|
1388
|
-
$type: exports.BalancingRule.$type,
|
|
1389
|
-
tag: isSet(object.tag) ? globalThis.String(object.tag) : "",
|
|
1390
|
-
outboundSelector: globalThis.Array.isArray(object?.outboundSelector)
|
|
1391
|
-
? object.outboundSelector.map((e) => globalThis.String(e))
|
|
1392
|
-
: globalThis.Array.isArray(object?.outbound_selector)
|
|
1393
|
-
? object.outbound_selector.map((e) => globalThis.String(e))
|
|
1394
|
-
: [],
|
|
1395
|
-
strategy: isSet(object.strategy) ? globalThis.String(object.strategy) : "",
|
|
1396
|
-
strategySettings: isSet(object.strategySettings)
|
|
1397
|
-
? typed_message_1.TypedMessage.fromJSON(object.strategySettings)
|
|
1398
|
-
: isSet(object.strategy_settings)
|
|
1399
|
-
? typed_message_1.TypedMessage.fromJSON(object.strategy_settings)
|
|
1400
|
-
: undefined,
|
|
1401
|
-
fallbackTag: isSet(object.fallbackTag)
|
|
1402
|
-
? globalThis.String(object.fallbackTag)
|
|
1403
|
-
: isSet(object.fallback_tag)
|
|
1404
|
-
? globalThis.String(object.fallback_tag)
|
|
1405
|
-
: "",
|
|
1406
|
-
};
|
|
1407
|
-
},
|
|
1408
|
-
toJSON(message) {
|
|
1409
|
-
const obj = {};
|
|
1410
|
-
if (message.tag !== "") {
|
|
1411
|
-
obj.tag = message.tag;
|
|
1412
|
-
}
|
|
1413
|
-
if (message.outboundSelector?.length) {
|
|
1414
|
-
obj.outboundSelector = message.outboundSelector;
|
|
1415
|
-
}
|
|
1416
|
-
if (message.strategy !== "") {
|
|
1417
|
-
obj.strategy = message.strategy;
|
|
1418
|
-
}
|
|
1419
|
-
if (message.strategySettings !== undefined) {
|
|
1420
|
-
obj.strategySettings = typed_message_1.TypedMessage.toJSON(message.strategySettings);
|
|
1421
|
-
}
|
|
1422
|
-
if (message.fallbackTag !== "") {
|
|
1423
|
-
obj.fallbackTag = message.fallbackTag;
|
|
1424
|
-
}
|
|
1425
|
-
return obj;
|
|
1426
|
-
},
|
|
1427
|
-
create(base) {
|
|
1428
|
-
return exports.BalancingRule.fromPartial(base ?? {});
|
|
1429
|
-
},
|
|
1430
|
-
fromPartial(object) {
|
|
1431
|
-
const message = createBaseBalancingRule();
|
|
1432
|
-
message.tag = object.tag ?? "";
|
|
1433
|
-
message.outboundSelector = object.outboundSelector?.map((e) => e) || [];
|
|
1434
|
-
message.strategy = object.strategy ?? "";
|
|
1435
|
-
message.strategySettings = (object.strategySettings !== undefined && object.strategySettings !== null)
|
|
1436
|
-
? typed_message_1.TypedMessage.fromPartial(object.strategySettings)
|
|
1437
|
-
: undefined;
|
|
1438
|
-
message.fallbackTag = object.fallbackTag ?? "";
|
|
1439
|
-
return message;
|
|
1440
|
-
},
|
|
1441
|
-
};
|
|
1442
|
-
typeRegistry_1.messageTypeRegistry.set(exports.BalancingRule.$type, exports.BalancingRule);
|
|
1443
|
-
function createBaseStrategyWeight() {
|
|
1444
|
-
return { $type: "xray.app.router.StrategyWeight", regexp: false, match: "", value: 0 };
|
|
1445
|
-
}
|
|
1446
|
-
exports.StrategyWeight = {
|
|
1447
|
-
$type: "xray.app.router.StrategyWeight",
|
|
1448
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1449
|
-
if (message.regexp !== false) {
|
|
1450
|
-
writer.uint32(8).bool(message.regexp);
|
|
1451
|
-
}
|
|
1452
|
-
if (message.match !== "") {
|
|
1453
|
-
writer.uint32(18).string(message.match);
|
|
1454
|
-
}
|
|
1455
|
-
if (message.value !== 0) {
|
|
1456
|
-
writer.uint32(29).float(message.value);
|
|
1457
|
-
}
|
|
1458
|
-
return writer;
|
|
1459
|
-
},
|
|
1460
|
-
decode(input, length) {
|
|
1461
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1462
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1463
|
-
const message = createBaseStrategyWeight();
|
|
1464
|
-
while (reader.pos < end) {
|
|
1465
|
-
const tag = reader.uint32();
|
|
1466
|
-
switch (tag >>> 3) {
|
|
1467
|
-
case 1: {
|
|
1468
|
-
if (tag !== 8) {
|
|
1469
|
-
break;
|
|
1470
|
-
}
|
|
1471
|
-
message.regexp = reader.bool();
|
|
1472
|
-
continue;
|
|
1473
|
-
}
|
|
1474
|
-
case 2: {
|
|
1475
|
-
if (tag !== 18) {
|
|
1476
|
-
break;
|
|
1477
|
-
}
|
|
1478
|
-
message.match = reader.string();
|
|
1479
|
-
continue;
|
|
1480
|
-
}
|
|
1481
|
-
case 3: {
|
|
1482
|
-
if (tag !== 29) {
|
|
1483
|
-
break;
|
|
1484
|
-
}
|
|
1485
|
-
message.value = reader.float();
|
|
1486
|
-
continue;
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1490
|
-
break;
|
|
1491
|
-
}
|
|
1492
|
-
reader.skip(tag & 7);
|
|
1493
|
-
}
|
|
1494
|
-
return message;
|
|
1495
|
-
},
|
|
1496
|
-
fromJSON(object) {
|
|
1497
|
-
return {
|
|
1498
|
-
$type: exports.StrategyWeight.$type,
|
|
1499
|
-
regexp: isSet(object.regexp) ? globalThis.Boolean(object.regexp) : false,
|
|
1500
|
-
match: isSet(object.match) ? globalThis.String(object.match) : "",
|
|
1501
|
-
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
1502
|
-
};
|
|
1503
|
-
},
|
|
1504
|
-
toJSON(message) {
|
|
1505
|
-
const obj = {};
|
|
1506
|
-
if (message.regexp !== false) {
|
|
1507
|
-
obj.regexp = message.regexp;
|
|
1508
|
-
}
|
|
1509
|
-
if (message.match !== "") {
|
|
1510
|
-
obj.match = message.match;
|
|
1511
|
-
}
|
|
1512
|
-
if (message.value !== 0) {
|
|
1513
|
-
obj.value = message.value;
|
|
1514
|
-
}
|
|
1515
|
-
return obj;
|
|
1516
|
-
},
|
|
1517
|
-
create(base) {
|
|
1518
|
-
return exports.StrategyWeight.fromPartial(base ?? {});
|
|
1519
|
-
},
|
|
1520
|
-
fromPartial(object) {
|
|
1521
|
-
const message = createBaseStrategyWeight();
|
|
1522
|
-
message.regexp = object.regexp ?? false;
|
|
1523
|
-
message.match = object.match ?? "";
|
|
1524
|
-
message.value = object.value ?? 0;
|
|
1525
|
-
return message;
|
|
1526
|
-
},
|
|
1527
|
-
};
|
|
1528
|
-
typeRegistry_1.messageTypeRegistry.set(exports.StrategyWeight.$type, exports.StrategyWeight);
|
|
1529
|
-
function createBaseStrategyLeastLoadConfig() {
|
|
1530
|
-
return {
|
|
1531
|
-
$type: "xray.app.router.StrategyLeastLoadConfig",
|
|
1532
|
-
costs: [],
|
|
1533
|
-
baselines: [],
|
|
1534
|
-
expected: 0,
|
|
1535
|
-
maxRTT: 0,
|
|
1536
|
-
tolerance: 0,
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
exports.StrategyLeastLoadConfig = {
|
|
1540
|
-
$type: "xray.app.router.StrategyLeastLoadConfig",
|
|
1541
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1542
|
-
for (const v of message.costs) {
|
|
1543
|
-
exports.StrategyWeight.encode(v, writer.uint32(18).fork()).join();
|
|
1544
|
-
}
|
|
1545
|
-
writer.uint32(26).fork();
|
|
1546
|
-
for (const v of message.baselines) {
|
|
1547
|
-
writer.int64(v);
|
|
1548
|
-
}
|
|
1549
|
-
writer.join();
|
|
1550
|
-
if (message.expected !== 0) {
|
|
1551
|
-
writer.uint32(32).int32(message.expected);
|
|
1552
|
-
}
|
|
1553
|
-
if (message.maxRTT !== 0) {
|
|
1554
|
-
writer.uint32(40).int64(message.maxRTT);
|
|
1555
|
-
}
|
|
1556
|
-
if (message.tolerance !== 0) {
|
|
1557
|
-
writer.uint32(53).float(message.tolerance);
|
|
1558
|
-
}
|
|
1559
|
-
return writer;
|
|
1560
|
-
},
|
|
1561
|
-
decode(input, length) {
|
|
1562
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1563
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1564
|
-
const message = createBaseStrategyLeastLoadConfig();
|
|
1565
|
-
while (reader.pos < end) {
|
|
1566
|
-
const tag = reader.uint32();
|
|
1567
|
-
switch (tag >>> 3) {
|
|
1568
|
-
case 2: {
|
|
1569
|
-
if (tag !== 18) {
|
|
1570
|
-
break;
|
|
1571
|
-
}
|
|
1572
|
-
message.costs.push(exports.StrategyWeight.decode(reader, reader.uint32()));
|
|
1573
|
-
continue;
|
|
1574
|
-
}
|
|
1575
|
-
case 3: {
|
|
1576
|
-
if (tag === 24) {
|
|
1577
|
-
message.baselines.push(longToNumber(reader.int64()));
|
|
1578
|
-
continue;
|
|
1579
|
-
}
|
|
1580
|
-
if (tag === 26) {
|
|
1581
|
-
const end2 = reader.uint32() + reader.pos;
|
|
1582
|
-
while (reader.pos < end2) {
|
|
1583
|
-
message.baselines.push(longToNumber(reader.int64()));
|
|
1584
|
-
}
|
|
1585
|
-
continue;
|
|
1586
|
-
}
|
|
1587
|
-
break;
|
|
1588
|
-
}
|
|
1589
|
-
case 4: {
|
|
1590
|
-
if (tag !== 32) {
|
|
1591
|
-
break;
|
|
1592
|
-
}
|
|
1593
|
-
message.expected = reader.int32();
|
|
1594
|
-
continue;
|
|
1595
|
-
}
|
|
1596
|
-
case 5: {
|
|
1597
|
-
if (tag !== 40) {
|
|
1598
|
-
break;
|
|
1599
|
-
}
|
|
1600
|
-
message.maxRTT = longToNumber(reader.int64());
|
|
1601
|
-
continue;
|
|
1602
|
-
}
|
|
1603
|
-
case 6: {
|
|
1604
|
-
if (tag !== 53) {
|
|
1605
|
-
break;
|
|
1606
|
-
}
|
|
1607
|
-
message.tolerance = reader.float();
|
|
1608
|
-
continue;
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1612
|
-
break;
|
|
1613
|
-
}
|
|
1614
|
-
reader.skip(tag & 7);
|
|
1615
|
-
}
|
|
1616
|
-
return message;
|
|
1617
|
-
},
|
|
1618
|
-
fromJSON(object) {
|
|
1619
|
-
return {
|
|
1620
|
-
$type: exports.StrategyLeastLoadConfig.$type,
|
|
1621
|
-
costs: globalThis.Array.isArray(object?.costs) ? object.costs.map((e) => exports.StrategyWeight.fromJSON(e)) : [],
|
|
1622
|
-
baselines: globalThis.Array.isArray(object?.baselines)
|
|
1623
|
-
? object.baselines.map((e) => globalThis.Number(e))
|
|
1624
|
-
: [],
|
|
1625
|
-
expected: isSet(object.expected) ? globalThis.Number(object.expected) : 0,
|
|
1626
|
-
maxRTT: isSet(object.maxRTT) ? globalThis.Number(object.maxRTT) : 0,
|
|
1627
|
-
tolerance: isSet(object.tolerance) ? globalThis.Number(object.tolerance) : 0,
|
|
1628
|
-
};
|
|
1629
|
-
},
|
|
1630
|
-
toJSON(message) {
|
|
1631
|
-
const obj = {};
|
|
1632
|
-
if (message.costs?.length) {
|
|
1633
|
-
obj.costs = message.costs.map((e) => exports.StrategyWeight.toJSON(e));
|
|
1634
|
-
}
|
|
1635
|
-
if (message.baselines?.length) {
|
|
1636
|
-
obj.baselines = message.baselines.map((e) => Math.round(e));
|
|
1637
|
-
}
|
|
1638
|
-
if (message.expected !== 0) {
|
|
1639
|
-
obj.expected = Math.round(message.expected);
|
|
1640
|
-
}
|
|
1641
|
-
if (message.maxRTT !== 0) {
|
|
1642
|
-
obj.maxRTT = Math.round(message.maxRTT);
|
|
1643
|
-
}
|
|
1644
|
-
if (message.tolerance !== 0) {
|
|
1645
|
-
obj.tolerance = message.tolerance;
|
|
1646
|
-
}
|
|
1647
|
-
return obj;
|
|
1648
|
-
},
|
|
1649
|
-
create(base) {
|
|
1650
|
-
return exports.StrategyLeastLoadConfig.fromPartial(base ?? {});
|
|
1651
|
-
},
|
|
1652
|
-
fromPartial(object) {
|
|
1653
|
-
const message = createBaseStrategyLeastLoadConfig();
|
|
1654
|
-
message.costs = object.costs?.map((e) => exports.StrategyWeight.fromPartial(e)) || [];
|
|
1655
|
-
message.baselines = object.baselines?.map((e) => e) || [];
|
|
1656
|
-
message.expected = object.expected ?? 0;
|
|
1657
|
-
message.maxRTT = object.maxRTT ?? 0;
|
|
1658
|
-
message.tolerance = object.tolerance ?? 0;
|
|
1659
|
-
return message;
|
|
1660
|
-
},
|
|
1661
|
-
};
|
|
1662
|
-
typeRegistry_1.messageTypeRegistry.set(exports.StrategyLeastLoadConfig.$type, exports.StrategyLeastLoadConfig);
|
|
1663
|
-
function createBaseConfig() {
|
|
1664
|
-
return { $type: "xray.app.router.Config", domainStrategy: 0, rule: [], balancingRule: [] };
|
|
1665
|
-
}
|
|
1666
|
-
exports.Config = {
|
|
1667
|
-
$type: "xray.app.router.Config",
|
|
1668
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1669
|
-
if (message.domainStrategy !== 0) {
|
|
1670
|
-
writer.uint32(8).int32(message.domainStrategy);
|
|
1671
|
-
}
|
|
1672
|
-
for (const v of message.rule) {
|
|
1673
|
-
exports.RoutingRule.encode(v, writer.uint32(18).fork()).join();
|
|
1674
|
-
}
|
|
1675
|
-
for (const v of message.balancingRule) {
|
|
1676
|
-
exports.BalancingRule.encode(v, writer.uint32(26).fork()).join();
|
|
1677
|
-
}
|
|
1678
|
-
return writer;
|
|
1679
|
-
},
|
|
1680
|
-
decode(input, length) {
|
|
1681
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1682
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1683
|
-
const message = createBaseConfig();
|
|
1684
|
-
while (reader.pos < end) {
|
|
1685
|
-
const tag = reader.uint32();
|
|
1686
|
-
switch (tag >>> 3) {
|
|
1687
|
-
case 1: {
|
|
1688
|
-
if (tag !== 8) {
|
|
1689
|
-
break;
|
|
1690
|
-
}
|
|
1691
|
-
message.domainStrategy = reader.int32();
|
|
1692
|
-
continue;
|
|
1693
|
-
}
|
|
1694
|
-
case 2: {
|
|
1695
|
-
if (tag !== 18) {
|
|
1696
|
-
break;
|
|
1697
|
-
}
|
|
1698
|
-
message.rule.push(exports.RoutingRule.decode(reader, reader.uint32()));
|
|
1699
|
-
continue;
|
|
1700
|
-
}
|
|
1701
|
-
case 3: {
|
|
1702
|
-
if (tag !== 26) {
|
|
1703
|
-
break;
|
|
1704
|
-
}
|
|
1705
|
-
message.balancingRule.push(exports.BalancingRule.decode(reader, reader.uint32()));
|
|
1706
|
-
continue;
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1710
|
-
break;
|
|
1711
|
-
}
|
|
1712
|
-
reader.skip(tag & 7);
|
|
1713
|
-
}
|
|
1714
|
-
return message;
|
|
1715
|
-
},
|
|
1716
|
-
fromJSON(object) {
|
|
1717
|
-
return {
|
|
1718
|
-
$type: exports.Config.$type,
|
|
1719
|
-
domainStrategy: isSet(object.domainStrategy)
|
|
1720
|
-
? config_DomainStrategyFromJSON(object.domainStrategy)
|
|
1721
|
-
: isSet(object.domain_strategy)
|
|
1722
|
-
? config_DomainStrategyFromJSON(object.domain_strategy)
|
|
1723
|
-
: 0,
|
|
1724
|
-
rule: globalThis.Array.isArray(object?.rule) ? object.rule.map((e) => exports.RoutingRule.fromJSON(e)) : [],
|
|
1725
|
-
balancingRule: globalThis.Array.isArray(object?.balancingRule)
|
|
1726
|
-
? object.balancingRule.map((e) => exports.BalancingRule.fromJSON(e))
|
|
1727
|
-
: globalThis.Array.isArray(object?.balancing_rule)
|
|
1728
|
-
? object.balancing_rule.map((e) => exports.BalancingRule.fromJSON(e))
|
|
1729
|
-
: [],
|
|
1730
|
-
};
|
|
1731
|
-
},
|
|
1732
|
-
toJSON(message) {
|
|
1733
|
-
const obj = {};
|
|
1734
|
-
if (message.domainStrategy !== 0) {
|
|
1735
|
-
obj.domainStrategy = config_DomainStrategyToJSON(message.domainStrategy);
|
|
1736
|
-
}
|
|
1737
|
-
if (message.rule?.length) {
|
|
1738
|
-
obj.rule = message.rule.map((e) => exports.RoutingRule.toJSON(e));
|
|
1739
|
-
}
|
|
1740
|
-
if (message.balancingRule?.length) {
|
|
1741
|
-
obj.balancingRule = message.balancingRule.map((e) => exports.BalancingRule.toJSON(e));
|
|
1742
|
-
}
|
|
1743
|
-
return obj;
|
|
1744
|
-
},
|
|
1745
|
-
create(base) {
|
|
1746
|
-
return exports.Config.fromPartial(base ?? {});
|
|
1747
|
-
},
|
|
1748
|
-
fromPartial(object) {
|
|
1749
|
-
const message = createBaseConfig();
|
|
1750
|
-
message.domainStrategy = object.domainStrategy ?? 0;
|
|
1751
|
-
message.rule = object.rule?.map((e) => exports.RoutingRule.fromPartial(e)) || [];
|
|
1752
|
-
message.balancingRule = object.balancingRule?.map((e) => exports.BalancingRule.fromPartial(e)) || [];
|
|
1753
|
-
return message;
|
|
1754
|
-
},
|
|
1755
|
-
};
|
|
1756
|
-
typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
|
|
1757
|
-
function bytesFromBase64(b64) {
|
|
1758
|
-
if (globalThis.Buffer) {
|
|
1759
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
1760
|
-
}
|
|
1761
|
-
else {
|
|
1762
|
-
const bin = globalThis.atob(b64);
|
|
1763
|
-
const arr = new Uint8Array(bin.length);
|
|
1764
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
1765
|
-
arr[i] = bin.charCodeAt(i);
|
|
1766
|
-
}
|
|
1767
|
-
return arr;
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
function base64FromBytes(arr) {
|
|
1771
|
-
if (globalThis.Buffer) {
|
|
1772
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
1773
|
-
}
|
|
1774
|
-
else {
|
|
1775
|
-
const bin = [];
|
|
1776
|
-
arr.forEach((byte) => {
|
|
1777
|
-
bin.push(globalThis.String.fromCharCode(byte));
|
|
1778
|
-
});
|
|
1779
|
-
return globalThis.btoa(bin.join(""));
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
function longToNumber(int64) {
|
|
1783
|
-
const num = globalThis.Number(int64.toString());
|
|
1784
|
-
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1785
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1786
|
-
}
|
|
1787
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1788
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1789
|
-
}
|
|
1790
|
-
return num;
|
|
1791
|
-
}
|
|
1792
|
-
function isObject(value) {
|
|
1793
|
-
return typeof value === "object" && value !== null;
|
|
1794
|
-
}
|
|
1795
|
-
function isSet(value) {
|
|
1796
|
-
return value !== null && value !== undefined;
|
|
1797
|
-
}
|