nodelistparser 0.0.0 → 0.1.2
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/dist/cjs/index.d.ts +271 -0
- package/dist/cjs/index.js +515 -0
- package/dist/es/index.d.mts +271 -0
- package/dist/es/index.mjs +513 -0
- package/package.json +28 -12
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
interface SharedConfigBase {
|
|
2
|
+
raw: string;
|
|
3
|
+
name: string;
|
|
4
|
+
server: string;
|
|
5
|
+
port: number;
|
|
6
|
+
/** tfo */
|
|
7
|
+
tfo?: boolean;
|
|
8
|
+
/** block-quic */
|
|
9
|
+
blockQuic?: string;
|
|
10
|
+
}
|
|
11
|
+
interface TlsSharedConfig {
|
|
12
|
+
/** sni */
|
|
13
|
+
sni: string | undefined;
|
|
14
|
+
/** skip-cert-verify */
|
|
15
|
+
skipCertVerify: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface HttpProxyConfig extends SharedConfigBase {
|
|
18
|
+
type: 'http';
|
|
19
|
+
username: string;
|
|
20
|
+
password: string;
|
|
21
|
+
}
|
|
22
|
+
interface ShadowSocksConfig extends SharedConfigBase {
|
|
23
|
+
type: 'ss';
|
|
24
|
+
/** encrypt-method */
|
|
25
|
+
cipher: string;
|
|
26
|
+
password: string;
|
|
27
|
+
/** udp-relay */
|
|
28
|
+
udp: boolean;
|
|
29
|
+
obfs?: undefined | 'http' | 'tls';
|
|
30
|
+
/** obfs-host */
|
|
31
|
+
obfsHost?: string;
|
|
32
|
+
/** obfs-uri */
|
|
33
|
+
obfsUri?: string;
|
|
34
|
+
/** udp-port */
|
|
35
|
+
udpPort?: number;
|
|
36
|
+
}
|
|
37
|
+
interface TrojanConfig extends SharedConfigBase, TlsSharedConfig {
|
|
38
|
+
type: 'trojan';
|
|
39
|
+
password: string;
|
|
40
|
+
/** udp-relay */
|
|
41
|
+
udp: boolean;
|
|
42
|
+
}
|
|
43
|
+
interface SnellConfig extends SharedConfigBase {
|
|
44
|
+
type: 'snell';
|
|
45
|
+
psk: string;
|
|
46
|
+
version: number;
|
|
47
|
+
reuse: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface TrojanBasicConfig extends SharedConfigBase, TlsSharedConfig {
|
|
50
|
+
type: 'trojan';
|
|
51
|
+
password: string;
|
|
52
|
+
/** udp-relay */
|
|
53
|
+
udp: boolean;
|
|
54
|
+
}
|
|
55
|
+
interface TuicConfig extends SharedConfigBase {
|
|
56
|
+
type: 'tuic';
|
|
57
|
+
sni: string;
|
|
58
|
+
uuid: string;
|
|
59
|
+
alpn: string;
|
|
60
|
+
password: string;
|
|
61
|
+
version: number;
|
|
62
|
+
}
|
|
63
|
+
interface Socks5Config extends SharedConfigBase {
|
|
64
|
+
type: 'socks5';
|
|
65
|
+
udp: boolean;
|
|
66
|
+
username: string;
|
|
67
|
+
password: string;
|
|
68
|
+
}
|
|
69
|
+
interface VmessConfig extends SharedConfigBase, TlsSharedConfig {
|
|
70
|
+
type: 'vmess';
|
|
71
|
+
/** uuid */
|
|
72
|
+
username: string;
|
|
73
|
+
tls: boolean;
|
|
74
|
+
vmessAead: boolean | undefined;
|
|
75
|
+
ws: boolean | undefined;
|
|
76
|
+
wsPath: string | undefined;
|
|
77
|
+
wsHeaders: string | undefined;
|
|
78
|
+
udp: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface Hysteria2Config extends SharedConfigBase, Omit<TlsSharedConfig, 'sni'> {
|
|
81
|
+
type: 'hysteria2';
|
|
82
|
+
password: string;
|
|
83
|
+
/** download-bandwidth in mbps */
|
|
84
|
+
downloadBandwidth: number;
|
|
85
|
+
/** port hopping */
|
|
86
|
+
portHopping?: string;
|
|
87
|
+
/** port hopping interval */
|
|
88
|
+
portHoppingInterval?: number;
|
|
89
|
+
}
|
|
90
|
+
type SupportedConfig = HttpProxyConfig | SnellConfig | TrojanConfig | ShadowSocksConfig | TuicConfig | Socks5Config | VmessConfig | Hysteria2Config;
|
|
91
|
+
|
|
92
|
+
declare function decode$1(raw: string): SupportedConfig;
|
|
93
|
+
declare function encode$1(config: SupportedConfig): string;
|
|
94
|
+
|
|
95
|
+
declare namespace index$2 {
|
|
96
|
+
export { decode$1 as decode, encode$1 as encode };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare function decode(config: any): SupportedConfig;
|
|
100
|
+
declare function encode(config: SupportedConfig): {
|
|
101
|
+
tfo: boolean | undefined;
|
|
102
|
+
plugin?: string | undefined;
|
|
103
|
+
'plugin-opts'?: {
|
|
104
|
+
mode: "http" | "tls";
|
|
105
|
+
host: string | undefined;
|
|
106
|
+
uri: string | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
name: string;
|
|
109
|
+
type: string;
|
|
110
|
+
server: string;
|
|
111
|
+
port: number;
|
|
112
|
+
cipher: string;
|
|
113
|
+
password: string;
|
|
114
|
+
udp: boolean;
|
|
115
|
+
alterId?: undefined;
|
|
116
|
+
tls?: undefined;
|
|
117
|
+
uuid?: undefined;
|
|
118
|
+
servername?: undefined;
|
|
119
|
+
'ws-path'?: undefined;
|
|
120
|
+
'ws-headers'?: undefined;
|
|
121
|
+
'ws-opts'?: undefined;
|
|
122
|
+
network?: undefined;
|
|
123
|
+
ports?: undefined;
|
|
124
|
+
down?: undefined;
|
|
125
|
+
'skip-cert-verify'?: undefined;
|
|
126
|
+
} | {
|
|
127
|
+
tfo: boolean | undefined;
|
|
128
|
+
name: string;
|
|
129
|
+
type: string;
|
|
130
|
+
server: string;
|
|
131
|
+
port: number;
|
|
132
|
+
password: string;
|
|
133
|
+
sni: string | undefined;
|
|
134
|
+
'skip-cert-verify': boolean;
|
|
135
|
+
udp: boolean;
|
|
136
|
+
alterId?: undefined;
|
|
137
|
+
tls?: undefined;
|
|
138
|
+
uuid?: undefined;
|
|
139
|
+
servername?: undefined;
|
|
140
|
+
'ws-path'?: undefined;
|
|
141
|
+
'ws-headers'?: undefined;
|
|
142
|
+
cipher?: undefined;
|
|
143
|
+
'ws-opts'?: undefined;
|
|
144
|
+
network?: undefined;
|
|
145
|
+
ports?: undefined;
|
|
146
|
+
down?: undefined;
|
|
147
|
+
} | {
|
|
148
|
+
tfo: boolean | undefined;
|
|
149
|
+
name: string;
|
|
150
|
+
type: string;
|
|
151
|
+
server: string;
|
|
152
|
+
port: number;
|
|
153
|
+
sni: string;
|
|
154
|
+
uuid: string;
|
|
155
|
+
alpn: string[];
|
|
156
|
+
token: string;
|
|
157
|
+
version: number;
|
|
158
|
+
udp: boolean;
|
|
159
|
+
alterId?: undefined;
|
|
160
|
+
tls?: undefined;
|
|
161
|
+
servername?: undefined;
|
|
162
|
+
'ws-path'?: undefined;
|
|
163
|
+
'ws-headers'?: undefined;
|
|
164
|
+
cipher?: undefined;
|
|
165
|
+
'ws-opts'?: undefined;
|
|
166
|
+
network?: undefined;
|
|
167
|
+
ports?: undefined;
|
|
168
|
+
password?: undefined;
|
|
169
|
+
down?: undefined;
|
|
170
|
+
'skip-cert-verify'?: undefined;
|
|
171
|
+
} | {
|
|
172
|
+
tfo: boolean | undefined;
|
|
173
|
+
name: string;
|
|
174
|
+
type: string;
|
|
175
|
+
server: string;
|
|
176
|
+
port: number;
|
|
177
|
+
username: string;
|
|
178
|
+
password: string;
|
|
179
|
+
udp: boolean;
|
|
180
|
+
alterId?: undefined;
|
|
181
|
+
tls?: undefined;
|
|
182
|
+
uuid?: undefined;
|
|
183
|
+
servername?: undefined;
|
|
184
|
+
'ws-path'?: undefined;
|
|
185
|
+
'ws-headers'?: undefined;
|
|
186
|
+
cipher?: undefined;
|
|
187
|
+
'ws-opts'?: undefined;
|
|
188
|
+
network?: undefined;
|
|
189
|
+
ports?: undefined;
|
|
190
|
+
down?: undefined;
|
|
191
|
+
'skip-cert-verify'?: undefined;
|
|
192
|
+
} | {
|
|
193
|
+
tfo: boolean | undefined;
|
|
194
|
+
name: string;
|
|
195
|
+
type: string;
|
|
196
|
+
server: string;
|
|
197
|
+
port: number;
|
|
198
|
+
username: string;
|
|
199
|
+
password: string;
|
|
200
|
+
alterId?: undefined;
|
|
201
|
+
tls?: undefined;
|
|
202
|
+
udp?: undefined;
|
|
203
|
+
uuid?: undefined;
|
|
204
|
+
servername?: undefined;
|
|
205
|
+
'ws-path'?: undefined;
|
|
206
|
+
'ws-headers'?: undefined;
|
|
207
|
+
cipher?: undefined;
|
|
208
|
+
'ws-opts'?: undefined;
|
|
209
|
+
network?: undefined;
|
|
210
|
+
ports?: undefined;
|
|
211
|
+
down?: undefined;
|
|
212
|
+
'skip-cert-verify'?: undefined;
|
|
213
|
+
} | {
|
|
214
|
+
alterId: number | undefined;
|
|
215
|
+
tls: boolean;
|
|
216
|
+
udp: boolean;
|
|
217
|
+
uuid: string;
|
|
218
|
+
name: string;
|
|
219
|
+
servername: string | undefined;
|
|
220
|
+
'ws-path': string | undefined;
|
|
221
|
+
server: string;
|
|
222
|
+
'ws-headers': Record<string, string> | undefined;
|
|
223
|
+
cipher: string;
|
|
224
|
+
'ws-opts': {
|
|
225
|
+
path: string | undefined;
|
|
226
|
+
headers: Record<string, string> | undefined;
|
|
227
|
+
};
|
|
228
|
+
type: string;
|
|
229
|
+
port: number;
|
|
230
|
+
network: string;
|
|
231
|
+
ports?: undefined;
|
|
232
|
+
password?: undefined;
|
|
233
|
+
down?: undefined;
|
|
234
|
+
'skip-cert-verify'?: undefined;
|
|
235
|
+
} | {
|
|
236
|
+
name: string;
|
|
237
|
+
type: string;
|
|
238
|
+
server: string;
|
|
239
|
+
port: number;
|
|
240
|
+
ports: string | undefined;
|
|
241
|
+
password: string;
|
|
242
|
+
down: string;
|
|
243
|
+
'skip-cert-verify': boolean;
|
|
244
|
+
alterId?: undefined;
|
|
245
|
+
tls?: undefined;
|
|
246
|
+
udp?: undefined;
|
|
247
|
+
uuid?: undefined;
|
|
248
|
+
servername?: undefined;
|
|
249
|
+
'ws-path'?: undefined;
|
|
250
|
+
'ws-headers'?: undefined;
|
|
251
|
+
cipher?: undefined;
|
|
252
|
+
'ws-opts'?: undefined;
|
|
253
|
+
network?: undefined;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
declare const index$1_decode: typeof decode;
|
|
257
|
+
declare const index$1_encode: typeof encode;
|
|
258
|
+
declare namespace index$1 {
|
|
259
|
+
export { index$1_decode as decode, index$1_encode as encode };
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare function decodeOne(sip002: string): ShadowSocksConfig;
|
|
263
|
+
declare function decodeMultiline(text: string): ShadowSocksConfig[];
|
|
264
|
+
|
|
265
|
+
declare const index_decodeMultiline: typeof decodeMultiline;
|
|
266
|
+
declare const index_decodeOne: typeof decodeOne;
|
|
267
|
+
declare namespace index {
|
|
268
|
+
export { index_decodeMultiline as decodeMultiline, index_decodeOne as decodeOne };
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export { type HttpProxyConfig, type Hysteria2Config, type ShadowSocksConfig, type SharedConfigBase, type SnellConfig, type Socks5Config, type SupportedConfig, type TrojanBasicConfig, type TrojanConfig, type TuicConfig, type VmessConfig, index$1 as clash, index as ss, index$2 as surge };
|