surgio 3.15.0 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/constant/constant.d.ts +2 -0
- package/build/constant/constant.js +9 -1
- package/build/constant/constant.js.map +1 -1
- package/build/filters/filters.d.ts +1 -0
- package/build/filters/filters.js +4 -1
- package/build/filters/filters.js.map +1 -1
- package/build/generator/artifact.d.ts +3 -0
- package/build/generator/artifact.js +4 -0
- package/build/generator/artifact.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/provider/ClashProvider.d.ts +2 -2
- package/build/provider/ClashProvider.js +68 -4
- package/build/provider/ClashProvider.js.map +1 -1
- package/build/provider/CustomProvider.js +7 -0
- package/build/provider/CustomProvider.js.map +1 -1
- package/build/types.d.ts +6 -3
- package/build/types.js +1 -0
- package/build/types.js.map +1 -1
- package/build/utils/clash.js +40 -2
- package/build/utils/clash.js.map +1 -1
- package/build/utils/singbox.d.ts +7 -0
- package/build/utils/singbox.js +46 -2
- package/build/utils/singbox.js.map +1 -1
- package/build/utils/surge.d.ts +1 -0
- package/build/utils/surge.js +55 -3
- package/build/utils/surge.js.map +1 -1
- package/build/validators/index.d.ts +1 -0
- package/build/validators/index.js +1 -0
- package/build/validators/index.js.map +1 -1
- package/build/validators/tailscale.d.ts +206 -0
- package/build/validators/tailscale.js +72 -0
- package/build/validators/tailscale.js.map +1 -0
- package/build/validators/vless.d.ts +31 -3
- package/build/validators/vless.js +21 -2
- package/build/validators/vless.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NodeTypeEnum } from '../types';
|
|
3
|
+
export declare const TailscaleNodeConfigValidator: z.ZodObject<{
|
|
4
|
+
nodeName: z.ZodString;
|
|
5
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
tfo: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
mptcp: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
ecn: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
shadowTls: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
version: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string | number, string | number>>;
|
|
11
|
+
password: z.ZodString;
|
|
12
|
+
sni: z.ZodString;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
password: string;
|
|
15
|
+
sni: string;
|
|
16
|
+
version?: string | number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
password: string;
|
|
19
|
+
sni: string;
|
|
20
|
+
version?: string | number | undefined;
|
|
21
|
+
}>>;
|
|
22
|
+
blockQuic: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"on">, z.ZodLiteral<"off">]>>;
|
|
23
|
+
portHopping: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
24
|
+
portHoppingInterval: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
underlyingProxy: z.ZodOptional<z.ZodString>;
|
|
26
|
+
testUrl: z.ZodOptional<z.ZodString>;
|
|
27
|
+
testTimeout: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
surgeConfig: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
resolveHostname: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
vmessAEAD: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
resolveHostname?: boolean | undefined;
|
|
33
|
+
vmessAEAD?: boolean | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
resolveHostname?: boolean | undefined;
|
|
36
|
+
vmessAEAD?: boolean | undefined;
|
|
37
|
+
}>>;
|
|
38
|
+
surfboardConfig: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
vmessAEAD: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
vmessAEAD?: boolean | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
vmessAEAD?: boolean | undefined;
|
|
44
|
+
}>>;
|
|
45
|
+
quantumultXConfig: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
vmessAEAD: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
vmessAEAD?: boolean | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
vmessAEAD?: boolean | undefined;
|
|
51
|
+
}>>;
|
|
52
|
+
clashConfig: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
enableTuic: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
enableShadowTls: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
enableHysteria2: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
enableVless: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
clashCore: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"clash">, z.ZodLiteral<"clash.meta">, z.ZodLiteral<"stash">]>>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
enableTuic?: boolean | undefined;
|
|
60
|
+
enableShadowTls?: boolean | undefined;
|
|
61
|
+
enableHysteria2?: boolean | undefined;
|
|
62
|
+
enableVless?: boolean | undefined;
|
|
63
|
+
clashCore?: "clash" | "clash.meta" | "stash" | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
enableTuic?: boolean | undefined;
|
|
66
|
+
enableShadowTls?: boolean | undefined;
|
|
67
|
+
enableHysteria2?: boolean | undefined;
|
|
68
|
+
enableVless?: boolean | undefined;
|
|
69
|
+
clashCore?: "clash" | "clash.meta" | "stash" | undefined;
|
|
70
|
+
}>>;
|
|
71
|
+
hostnameIp: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString, "many">>>;
|
|
72
|
+
binPath: z.ZodOptional<z.ZodString>;
|
|
73
|
+
localPort: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
interfaceName: z.ZodOptional<z.ZodString>;
|
|
75
|
+
} & {
|
|
76
|
+
type: z.ZodLiteral<NodeTypeEnum.Tailscale>;
|
|
77
|
+
authKey: z.ZodOptional<z.ZodString>;
|
|
78
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
79
|
+
controlUrl: z.ZodOptional<z.ZodString>;
|
|
80
|
+
exitNode: z.ZodOptional<z.ZodString>;
|
|
81
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
stateDir: z.ZodOptional<z.ZodString>;
|
|
83
|
+
udpRelay: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
acceptRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
exitNodeAllowLanAccess: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
routingMark: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
derpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
idleKeepalive: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
preferIpv6: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
dnsServers: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
91
|
+
mtu: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
noErrorAlert: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
ipVersion: z.ZodOptional<z.ZodEnum<["dual", "ipv4", "ipv6", "ipv4-prefer", "ipv6-prefer"]>>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
type: NodeTypeEnum.Tailscale;
|
|
96
|
+
nodeName: string;
|
|
97
|
+
enable?: boolean | undefined;
|
|
98
|
+
tfo?: boolean | undefined;
|
|
99
|
+
mptcp?: boolean | undefined;
|
|
100
|
+
ecn?: boolean | undefined;
|
|
101
|
+
shadowTls?: {
|
|
102
|
+
password: string;
|
|
103
|
+
sni: string;
|
|
104
|
+
version?: string | number | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
blockQuic?: "auto" | "on" | "off" | undefined;
|
|
107
|
+
portHopping?: string | undefined;
|
|
108
|
+
portHoppingInterval?: number | undefined;
|
|
109
|
+
underlyingProxy?: string | undefined;
|
|
110
|
+
testUrl?: string | undefined;
|
|
111
|
+
testTimeout?: number | undefined;
|
|
112
|
+
surgeConfig?: {
|
|
113
|
+
resolveHostname?: boolean | undefined;
|
|
114
|
+
vmessAEAD?: boolean | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
surfboardConfig?: {
|
|
117
|
+
vmessAEAD?: boolean | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
quantumultXConfig?: {
|
|
120
|
+
vmessAEAD?: boolean | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
clashConfig?: {
|
|
123
|
+
enableTuic?: boolean | undefined;
|
|
124
|
+
enableShadowTls?: boolean | undefined;
|
|
125
|
+
enableHysteria2?: boolean | undefined;
|
|
126
|
+
enableVless?: boolean | undefined;
|
|
127
|
+
clashCore?: "clash" | "clash.meta" | "stash" | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
hostnameIp?: readonly string[] | undefined;
|
|
130
|
+
binPath?: string | undefined;
|
|
131
|
+
localPort?: number | undefined;
|
|
132
|
+
interfaceName?: string | undefined;
|
|
133
|
+
ipVersion?: "dual" | "ipv4" | "ipv6" | "ipv4-prefer" | "ipv6-prefer" | undefined;
|
|
134
|
+
hostname?: string | undefined;
|
|
135
|
+
udpRelay?: boolean | undefined;
|
|
136
|
+
preferIpv6?: boolean | undefined;
|
|
137
|
+
mtu?: number | undefined;
|
|
138
|
+
dnsServers?: [string, ...string[]] | undefined;
|
|
139
|
+
authKey?: string | undefined;
|
|
140
|
+
controlUrl?: string | undefined;
|
|
141
|
+
exitNode?: string | undefined;
|
|
142
|
+
ephemeral?: boolean | undefined;
|
|
143
|
+
stateDir?: string | undefined;
|
|
144
|
+
acceptRoutes?: boolean | undefined;
|
|
145
|
+
exitNodeAllowLanAccess?: boolean | undefined;
|
|
146
|
+
routingMark?: number | undefined;
|
|
147
|
+
derpOnly?: boolean | undefined;
|
|
148
|
+
idleKeepalive?: number | undefined;
|
|
149
|
+
noErrorAlert?: boolean | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
type: NodeTypeEnum.Tailscale;
|
|
152
|
+
nodeName: string;
|
|
153
|
+
enable?: boolean | undefined;
|
|
154
|
+
tfo?: boolean | undefined;
|
|
155
|
+
mptcp?: boolean | undefined;
|
|
156
|
+
ecn?: boolean | undefined;
|
|
157
|
+
shadowTls?: {
|
|
158
|
+
password: string;
|
|
159
|
+
sni: string;
|
|
160
|
+
version?: string | number | undefined;
|
|
161
|
+
} | undefined;
|
|
162
|
+
blockQuic?: "auto" | "on" | "off" | undefined;
|
|
163
|
+
portHopping?: string | undefined;
|
|
164
|
+
portHoppingInterval?: number | undefined;
|
|
165
|
+
underlyingProxy?: string | undefined;
|
|
166
|
+
testUrl?: string | undefined;
|
|
167
|
+
testTimeout?: number | undefined;
|
|
168
|
+
surgeConfig?: {
|
|
169
|
+
resolveHostname?: boolean | undefined;
|
|
170
|
+
vmessAEAD?: boolean | undefined;
|
|
171
|
+
} | undefined;
|
|
172
|
+
surfboardConfig?: {
|
|
173
|
+
vmessAEAD?: boolean | undefined;
|
|
174
|
+
} | undefined;
|
|
175
|
+
quantumultXConfig?: {
|
|
176
|
+
vmessAEAD?: boolean | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
clashConfig?: {
|
|
179
|
+
enableTuic?: boolean | undefined;
|
|
180
|
+
enableShadowTls?: boolean | undefined;
|
|
181
|
+
enableHysteria2?: boolean | undefined;
|
|
182
|
+
enableVless?: boolean | undefined;
|
|
183
|
+
clashCore?: "clash" | "clash.meta" | "stash" | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
hostnameIp?: readonly string[] | undefined;
|
|
186
|
+
binPath?: string | undefined;
|
|
187
|
+
localPort?: number | undefined;
|
|
188
|
+
interfaceName?: string | undefined;
|
|
189
|
+
ipVersion?: "dual" | "ipv4" | "ipv6" | "ipv4-prefer" | "ipv6-prefer" | undefined;
|
|
190
|
+
hostname?: string | undefined;
|
|
191
|
+
udpRelay?: boolean | undefined;
|
|
192
|
+
preferIpv6?: boolean | undefined;
|
|
193
|
+
mtu?: number | undefined;
|
|
194
|
+
dnsServers?: [string, ...string[]] | undefined;
|
|
195
|
+
authKey?: string | undefined;
|
|
196
|
+
controlUrl?: string | undefined;
|
|
197
|
+
exitNode?: string | undefined;
|
|
198
|
+
ephemeral?: boolean | undefined;
|
|
199
|
+
stateDir?: string | undefined;
|
|
200
|
+
acceptRoutes?: boolean | undefined;
|
|
201
|
+
exitNodeAllowLanAccess?: boolean | undefined;
|
|
202
|
+
routingMark?: number | undefined;
|
|
203
|
+
derpOnly?: boolean | undefined;
|
|
204
|
+
idleKeepalive?: number | undefined;
|
|
205
|
+
noErrorAlert?: boolean | undefined;
|
|
206
|
+
}>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TailscaleNodeConfigValidator = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const NonEmptyStringValidator = zod_1.z.string().min(1);
|
|
8
|
+
exports.TailscaleNodeConfigValidator = common_1.SimpleNodeConfigValidator.extend({
|
|
9
|
+
type: zod_1.z
|
|
10
|
+
.literal(types_1.NodeTypeEnum.Tailscale)
|
|
11
|
+
.describe('节点类型,固定为 tailscale'),
|
|
12
|
+
authKey: NonEmptyStringValidator.optional().describe('Tailscale 鉴权密钥(Auth Key),用于自动登录并将设备加入 tailnet'),
|
|
13
|
+
hostname: NonEmptyStringValidator.optional().describe('节点在 tailnet 中显示的主机名,默认使用系统主机名'),
|
|
14
|
+
controlUrl: zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.url()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('自定义控制服务器(coordination server)地址,默认为 https://controlplane.tailscale.com,可指向 Headscale 等自建服务'),
|
|
19
|
+
exitNode: NonEmptyStringValidator.optional().describe('用作出口节点(exit node)的节点名称或 IP 地址'),
|
|
20
|
+
ephemeral: zod_1.z
|
|
21
|
+
.boolean()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('是否以临时节点(ephemeral node)身份注册,离线后会自动从 tailnet 移除'),
|
|
24
|
+
stateDir: NonEmptyStringValidator.optional().describe('存放 Tailscale 状态数据的目录,默认为 tailscale'),
|
|
25
|
+
udpRelay: zod_1.z.boolean().optional().describe('是否启用 UDP 转发,默认开启'),
|
|
26
|
+
acceptRoutes: zod_1.z
|
|
27
|
+
.boolean()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('是否接受其它节点通告的子网路由(subnet routes)'),
|
|
30
|
+
exitNodeAllowLanAccess: zod_1.z
|
|
31
|
+
.boolean()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('使用出口节点时,是否允许直接访问本地局域网而不经由出口节点'),
|
|
34
|
+
routingMark: zod_1.z
|
|
35
|
+
.number()
|
|
36
|
+
.int()
|
|
37
|
+
.min(0)
|
|
38
|
+
.max(0xffff_ffff)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('为 Tailscale 流量设置的路由标记(fwmark),仅在 Linux 下有效'),
|
|
41
|
+
derpOnly: zod_1.z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('是否强制仅通过 DERP 中继服务器连接,禁用点对点直连'),
|
|
45
|
+
idleKeepalive: zod_1.z
|
|
46
|
+
.number()
|
|
47
|
+
.int()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('空闲连接的保活间隔,单位为秒'),
|
|
50
|
+
preferIpv6: zod_1.z.boolean().optional().describe('是否优先使用 IPv6'),
|
|
51
|
+
dnsServers: zod_1.z
|
|
52
|
+
.array(NonEmptyStringValidator)
|
|
53
|
+
.nonempty()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('自定义 DNS 服务器列表'),
|
|
56
|
+
mtu: zod_1.z
|
|
57
|
+
.number()
|
|
58
|
+
.int()
|
|
59
|
+
.min(576)
|
|
60
|
+
.max(1420)
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('网络接口的 MTU(最大传输单元),取值范围 576-1420'),
|
|
63
|
+
noErrorAlert: zod_1.z
|
|
64
|
+
.boolean()
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('是否在连接出错时不弹出提示(Surge 专用)'),
|
|
67
|
+
ipVersion: zod_1.z
|
|
68
|
+
.enum(['dual', 'ipv4', 'ipv6', 'ipv4-prefer', 'ipv6-prefer'])
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('IP 版本偏好'),
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=tailscale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailscale.js","sourceRoot":"","sources":["../../src/validators/tailscale.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,oCAAuC;AAEvC,qCAAoD;AAEpD,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAEpC,QAAA,4BAA4B,GAAG,kCAAyB,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,OAAC;SACJ,OAAO,CAAC,oBAAY,CAAC,SAAS,CAAC;SAC/B,QAAQ,CAAC,oBAAoB,CAAC;IACjC,OAAO,EAAE,uBAAuB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAClD,+CAA+C,CAChD;IACD,QAAQ,EAAE,uBAAuB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnD,+BAA+B,CAChC;IACD,UAAU,EAAE,OAAC;SACV,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CACP,4FAA4F,CAC7F;IACH,QAAQ,EAAE,uBAAuB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC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9C,YAAY,EAAE,OAAC;SACZ,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,yBAAyB,CAAC;IACtC,SAAS,EAAE,OAAC;SACT,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;SAC5D,QAAQ,EAAE;SACV,QAAQ,CAAC,SAAS,CAAC;CACvB,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { NodeTypeEnum } from '../types';
|
|
3
|
+
export declare const VlessNetworkValidator: z.ZodUnion<[z.ZodLiteral<"tcp">, z.ZodLiteral<"ws">, z.ZodLiteral<"h2">, z.ZodLiteral<"http">, z.ZodLiteral<"grpc">, z.ZodLiteral<"xhttp">, z.ZodLiteral<"quic">, z.ZodLiteral<"httpupgrade">]>;
|
|
3
4
|
export declare const VlessRealityOptsValidator: z.ZodObject<{
|
|
4
5
|
publicKey: z.ZodString;
|
|
5
6
|
shortId: z.ZodOptional<z.ZodString>;
|
|
@@ -13,6 +14,14 @@ export declare const VlessRealityOptsValidator: z.ZodObject<{
|
|
|
13
14
|
shortId?: string | undefined;
|
|
14
15
|
spiderX?: string | undefined;
|
|
15
16
|
}>;
|
|
17
|
+
export declare const VlessXHTTPOptsValidator: z.ZodObject<{
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
20
|
+
path: z.ZodString;
|
|
21
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
22
|
+
path: z.ZodString;
|
|
23
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
24
|
+
export declare const VlessECHPortsValidator: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
16
25
|
export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
17
26
|
nodeName: z.ZodString;
|
|
18
27
|
enable: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -98,7 +107,7 @@ export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
|
98
107
|
port: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string | number, string | number>;
|
|
99
108
|
method: z.ZodLiteral<"none">;
|
|
100
109
|
uuid: z.ZodString;
|
|
101
|
-
network: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"tcp">, z.ZodLiteral<"ws">, z.ZodLiteral<"h2">, z.ZodLiteral<"http">, z.ZodLiteral<"grpc">, z.ZodLiteral<"quic">, z.ZodLiteral<"httpupgrade">]>>;
|
|
110
|
+
network: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"tcp">, z.ZodLiteral<"ws">, z.ZodLiteral<"h2">, z.ZodLiteral<"http">, z.ZodLiteral<"grpc">, z.ZodLiteral<"xhttp">, z.ZodLiteral<"quic">, z.ZodLiteral<"httpupgrade">]>>;
|
|
102
111
|
udpRelay: z.ZodOptional<z.ZodBoolean>;
|
|
103
112
|
flow: z.ZodOptional<z.ZodString>;
|
|
104
113
|
encryption: z.ZodOptional<z.ZodString>;
|
|
@@ -142,6 +151,15 @@ export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
|
142
151
|
}, {
|
|
143
152
|
serviceName: string;
|
|
144
153
|
}>>;
|
|
154
|
+
xhttpOpts: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
path: z.ZodString;
|
|
156
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
157
|
+
path: z.ZodString;
|
|
158
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
159
|
+
path: z.ZodString;
|
|
160
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
161
|
+
echOpts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
162
|
+
packetEncoding: z.ZodOptional<z.ZodString>;
|
|
145
163
|
quicOpts: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
146
164
|
httpUpgradeOpts: z.ZodOptional<z.ZodObject<{
|
|
147
165
|
path: z.ZodString;
|
|
@@ -213,7 +231,7 @@ export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
|
213
231
|
hostname: string;
|
|
214
232
|
method: "none";
|
|
215
233
|
uuid: string;
|
|
216
|
-
network: "tcp" | "http" | "ws" | "h2" | "grpc" | "quic" | "httpupgrade";
|
|
234
|
+
network: "tcp" | "http" | "ws" | "h2" | "grpc" | "xhttp" | "quic" | "httpupgrade";
|
|
217
235
|
enable?: boolean | undefined;
|
|
218
236
|
tfo?: boolean | undefined;
|
|
219
237
|
mptcp?: boolean | undefined;
|
|
@@ -293,6 +311,11 @@ export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
|
293
311
|
} | undefined;
|
|
294
312
|
flow?: string | undefined;
|
|
295
313
|
encryption?: string | undefined;
|
|
314
|
+
xhttpOpts?: z.objectOutputType<{
|
|
315
|
+
path: z.ZodString;
|
|
316
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
317
|
+
echOpts?: Record<string, any> | undefined;
|
|
318
|
+
packetEncoding?: string | undefined;
|
|
296
319
|
realityOpts?: {
|
|
297
320
|
publicKey: string;
|
|
298
321
|
shortId?: string | undefined;
|
|
@@ -360,7 +383,7 @@ export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
|
360
383
|
downMbps: number;
|
|
361
384
|
} | undefined;
|
|
362
385
|
} | undefined;
|
|
363
|
-
network?: "tcp" | "http" | "ws" | "h2" | "grpc" | "quic" | "httpupgrade" | undefined;
|
|
386
|
+
network?: "tcp" | "http" | "ws" | "h2" | "grpc" | "xhttp" | "quic" | "httpupgrade" | undefined;
|
|
364
387
|
wsOpts?: {
|
|
365
388
|
path: string;
|
|
366
389
|
headers?: Record<string, string> | undefined;
|
|
@@ -385,6 +408,11 @@ export declare const VlessNodeConfigValidator: z.ZodObject<{
|
|
|
385
408
|
} | undefined;
|
|
386
409
|
flow?: string | undefined;
|
|
387
410
|
encryption?: string | undefined;
|
|
411
|
+
xhttpOpts?: z.objectInputType<{
|
|
412
|
+
path: z.ZodString;
|
|
413
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
414
|
+
echOpts?: Record<string, any> | undefined;
|
|
415
|
+
packetEncoding?: string | undefined;
|
|
388
416
|
realityOpts?: {
|
|
389
417
|
publicKey: string;
|
|
390
418
|
shortId?: string | undefined;
|
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VlessNodeConfigValidator = exports.VlessRealityOptsValidator = void 0;
|
|
3
|
+
exports.VlessNodeConfigValidator = exports.VlessECHPortsValidator = exports.VlessXHTTPOptsValidator = exports.VlessRealityOptsValidator = exports.VlessNetworkValidator = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
7
|
const vmess_1 = require("./vmess");
|
|
8
|
+
exports.VlessNetworkValidator = zod_1.z.union([
|
|
9
|
+
zod_1.z.literal('tcp'),
|
|
10
|
+
zod_1.z.literal('ws'),
|
|
11
|
+
zod_1.z.literal('h2'),
|
|
12
|
+
zod_1.z.literal('http'),
|
|
13
|
+
zod_1.z.literal('grpc'),
|
|
14
|
+
zod_1.z.literal('xhttp'),
|
|
15
|
+
zod_1.z.literal('quic'),
|
|
16
|
+
zod_1.z.literal('httpupgrade'),
|
|
17
|
+
]);
|
|
8
18
|
exports.VlessRealityOptsValidator = zod_1.z.object({
|
|
9
19
|
publicKey: zod_1.z.string(),
|
|
10
20
|
shortId: zod_1.z.ostring(),
|
|
11
21
|
spiderX: zod_1.z.ostring(),
|
|
12
22
|
});
|
|
23
|
+
exports.VlessXHTTPOptsValidator = zod_1.z
|
|
24
|
+
.object({
|
|
25
|
+
path: zod_1.z.string(),
|
|
26
|
+
})
|
|
27
|
+
.passthrough();
|
|
28
|
+
exports.VlessECHPortsValidator = zod_1.z.record(zod_1.z.any());
|
|
13
29
|
exports.VlessNodeConfigValidator = common_1.TlsNodeConfigValidator.extend({
|
|
14
30
|
type: zod_1.z.literal(types_1.NodeTypeEnum.Vless),
|
|
15
31
|
hostname: zod_1.z.string(),
|
|
16
32
|
port: common_1.PortValidator,
|
|
17
33
|
method: zod_1.z.literal('none'),
|
|
18
34
|
uuid: zod_1.z.string().uuid(),
|
|
19
|
-
network:
|
|
35
|
+
network: exports.VlessNetworkValidator.default('tcp'),
|
|
20
36
|
udpRelay: zod_1.z.oboolean(),
|
|
21
37
|
flow: zod_1.z.ostring(),
|
|
22
38
|
encryption: zod_1.z.ostring(),
|
|
@@ -24,6 +40,9 @@ exports.VlessNodeConfigValidator = common_1.TlsNodeConfigValidator.extend({
|
|
|
24
40
|
h2Opts: vmess_1.VmessH2OptsValidator.optional(),
|
|
25
41
|
httpOpts: vmess_1.VmessHttpOptsValidator.optional(),
|
|
26
42
|
grpcOpts: vmess_1.VmessGRPCOptsValidator.optional(),
|
|
43
|
+
xhttpOpts: exports.VlessXHTTPOptsValidator.optional(),
|
|
44
|
+
echOpts: exports.VlessECHPortsValidator.optional(),
|
|
45
|
+
packetEncoding: zod_1.z.ostring(),
|
|
27
46
|
quicOpts: vmess_1.VmessQuicOptsValidator.optional(),
|
|
28
47
|
httpUpgradeOpts: vmess_1.VmessHttpUpgradeOptsValidator.optional(),
|
|
29
48
|
realityOpts: exports.VlessRealityOptsValidator.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vless.js","sourceRoot":"","sources":["../../src/validators/vless.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,oCAAuC;AAEvC,qCAIiB;AACjB,
|
|
1
|
+
{"version":3,"file":"vless.js","sourceRoot":"","sources":["../../src/validators/vless.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,oCAAuC;AAEvC,qCAIiB;AACjB,mCAOgB;AAEH,QAAA,qBAAqB,GAAG,OAAC,CAAC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