@stacksjs/whois 0.58.73 → 0.59.1
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/index.d.ts +151 -0
- package/dist/parameters.d.ts +5 -0
- package/dist/servers.d.ts +319 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of the proxy. Either SOCKS4 or SOCKS5
|
|
3
|
+
* @enum
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ProxyType {
|
|
6
|
+
/**
|
|
7
|
+
* SOCKS4 type of proxy
|
|
8
|
+
*/
|
|
9
|
+
SOCKS4 = 0,
|
|
10
|
+
/**
|
|
11
|
+
* SOCKS5 type of proxy
|
|
12
|
+
*/
|
|
13
|
+
SOCKS5 = 1
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Proxy related data
|
|
17
|
+
* @interface
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export interface ProxyData {
|
|
21
|
+
/**
|
|
22
|
+
* Proxy IP
|
|
23
|
+
*/
|
|
24
|
+
ip: string;
|
|
25
|
+
/**
|
|
26
|
+
* Proxy port
|
|
27
|
+
*/
|
|
28
|
+
port: number;
|
|
29
|
+
/**
|
|
30
|
+
* Username to connect to the proxy
|
|
31
|
+
*/
|
|
32
|
+
username?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Password to connect to the proxy
|
|
35
|
+
*/
|
|
36
|
+
password?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* {@link ProxyType}
|
|
39
|
+
*/
|
|
40
|
+
type: ProxyType;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* WhoIs options
|
|
44
|
+
* @interface
|
|
45
|
+
*/
|
|
46
|
+
export interface WhoIsOptions {
|
|
47
|
+
/**
|
|
48
|
+
* TLD of the domain. If the {@link tld} is not provided (or null), then it will be automatically determined as to the given domain name
|
|
49
|
+
*/
|
|
50
|
+
tld?: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* The encoding type used for WhoIs server and response. By default UTF-8 is used.
|
|
53
|
+
*/
|
|
54
|
+
encoding?: string | null;
|
|
55
|
+
/** {@link ProxyData} */
|
|
56
|
+
proxy?: ProxyData | null;
|
|
57
|
+
/**
|
|
58
|
+
* The WhoIs server to collect data from. If not provided, the server will automatically determined using the {@link tld}
|
|
59
|
+
*/
|
|
60
|
+
server?: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* The port of the WhoIs server. By default, port 43 is used.
|
|
63
|
+
*/
|
|
64
|
+
serverPort?: number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Which data needs to be extracted/parsed from the WhoIs response.
|
|
67
|
+
* An object can be passed which contains keys of the fields of the WhoIs response.
|
|
68
|
+
* A copy of the provided object will be returned with the values filled for the provided keys.
|
|
69
|
+
*
|
|
70
|
+
* The keys can have default value of empty string. However, if the WhoIs response has multiple values for the same field (eg: 'Domain Status'),
|
|
71
|
+
* then all the values can be collected by providing a default value of an Array([]).
|
|
72
|
+
*
|
|
73
|
+
* Following example shows an object used to collect 'Domain Name', 'Domain Status' (multiple values) and 'Registrar' from WhoIs response
|
|
74
|
+
*
|
|
75
|
+
* @example {'Domain Name': '', 'Domain Status': [], 'Registrar': ''}
|
|
76
|
+
*/
|
|
77
|
+
parseData?: object | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Response returned from whois function. Contains the raw text from WhoIs server and parsed/fornatted WhoIs data (if parsed is true)
|
|
81
|
+
*
|
|
82
|
+
* @interface
|
|
83
|
+
*/
|
|
84
|
+
export interface WhoIsResponse {
|
|
85
|
+
/**
|
|
86
|
+
* Raw text response from WhoIs server
|
|
87
|
+
*/
|
|
88
|
+
_raw: string;
|
|
89
|
+
/**
|
|
90
|
+
* Parsed/Formatted key-value pairs of the response (if parsed is true)
|
|
91
|
+
*/
|
|
92
|
+
parsedData: any | null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Parse collected raw WhoIs data
|
|
96
|
+
*
|
|
97
|
+
* @class
|
|
98
|
+
*/
|
|
99
|
+
export declare class WhoIsParser {
|
|
100
|
+
/**
|
|
101
|
+
* Iterated through the complete text and returns extracted values
|
|
102
|
+
*
|
|
103
|
+
* @param rawData raw text from WhoIs server
|
|
104
|
+
* @param outputData Data which needs to be extracted from the raw text (key/value pairs). Keys are used to extract from raw text and values are filled.
|
|
105
|
+
* @returns Filled {@link outputData}
|
|
106
|
+
*/
|
|
107
|
+
private static iterParse;
|
|
108
|
+
/**
|
|
109
|
+
* Parse the raw WhoIs text and returns extracted values
|
|
110
|
+
*
|
|
111
|
+
* @param rawData raw text from WhoIs server
|
|
112
|
+
* @param outputData Data which needs to be extracted from the raw text (key/value pairs). Keys are used to extract from raw text and values are filled.
|
|
113
|
+
* @returns Filled {@link outputData}
|
|
114
|
+
*/
|
|
115
|
+
static parseData(rawData: string, outputData: any | null): any;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Connects to the provided {@link server}:{@link port} through TCP (through a proxy if a proxy is given), run the WhoIs query and returns the response
|
|
119
|
+
*
|
|
120
|
+
* @param domain Domain name
|
|
121
|
+
* @param queryOptions Query options which can be used with the specific WhoIs server to get the complete response
|
|
122
|
+
* @param server WhoIs server
|
|
123
|
+
* @param port WhoIs server port
|
|
124
|
+
* @param encoding Encoding used by the WhoIs server
|
|
125
|
+
* @param proxy {@link ProxyData}
|
|
126
|
+
* @returns The {string} WhoIs response for the query. Empty string is returned for errors
|
|
127
|
+
*/
|
|
128
|
+
export declare function tcpWhois(domain: string, queryOptions: string, server: string, port: number, encoding: string, proxy: ProxyData | null): Promise<string>;
|
|
129
|
+
/**
|
|
130
|
+
* Collect WhoIs data for the mentioned {@link domain}. Parse the reveived response if {@link parse} is true, accordingly.
|
|
131
|
+
*
|
|
132
|
+
* @param domain Domain name
|
|
133
|
+
* @param parse Whether the raw text needs to be parsed/formatted or not
|
|
134
|
+
* @param options {@link WhoIsOptions}
|
|
135
|
+
* @returns {@link WhoIsResponse} Returns a {@link WhoIsResponse} object which contains the raw text and parsed data (if parse is true)
|
|
136
|
+
*/
|
|
137
|
+
export declare function whois(domain: string, parse?: boolean, options?: WhoIsOptions | null): Promise<WhoIsResponse>;
|
|
138
|
+
export declare function lookup(domain: string, options?: WhoIsOptions | null): Promise<WhoIsResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Collects (and parse/format if set to be true) for the provided {@link domains}. If {@link parallel} is set to be true, multiple threads will be used to batch process the domains according to {@link threads} mentioned.
|
|
141
|
+
* If <i>options.parsedData</i> is mentioned, then it will be used to parse <b>all</b> the responses.
|
|
142
|
+
* If a proxy is mentioned in {@link options}, then the proxy will be used to collect <b>all</b> the WhoIs data.
|
|
143
|
+
*
|
|
144
|
+
* @param domains Domains Names
|
|
145
|
+
* @param parallel Whether data should be collected parallally or not
|
|
146
|
+
* @param threads Batch size (for parallel processing)
|
|
147
|
+
* @param parse Whether the raw text needs to be parsed/formatted or not
|
|
148
|
+
* @param options {@link WhoIsOptions}
|
|
149
|
+
* @returns Array of {@link WhoIsResponse} for all the domains. Order is not guaranteed
|
|
150
|
+
*/
|
|
151
|
+
export declare function batchWhois(domains: string[], parallel?: boolean, threads?: number, parse?: boolean, options?: WhoIsOptions | null): Promise<WhoIsResponse[]>;
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'br.com': string;
|
|
3
|
+
'cn.com': string;
|
|
4
|
+
'de.com': string;
|
|
5
|
+
'eu.com': string;
|
|
6
|
+
'gb.com': string;
|
|
7
|
+
'gb.net': string;
|
|
8
|
+
'gr.com': string;
|
|
9
|
+
'hu.com': string;
|
|
10
|
+
'in.net': string;
|
|
11
|
+
'no.com': string;
|
|
12
|
+
'qc.com': string;
|
|
13
|
+
'ru.com': string;
|
|
14
|
+
'sa.com': string;
|
|
15
|
+
'se.com': string;
|
|
16
|
+
'se.net': string;
|
|
17
|
+
'uk.com': string;
|
|
18
|
+
'uk.net': string;
|
|
19
|
+
'us.com': string;
|
|
20
|
+
'uy.com': string;
|
|
21
|
+
'za.com': string;
|
|
22
|
+
'jpn.com': string;
|
|
23
|
+
'web.com': string;
|
|
24
|
+
com: string;
|
|
25
|
+
'za.net': string;
|
|
26
|
+
net: string;
|
|
27
|
+
'eu.org': string;
|
|
28
|
+
'za.org': string;
|
|
29
|
+
org: string;
|
|
30
|
+
'llyw.cymru': string;
|
|
31
|
+
'gov.scot': string;
|
|
32
|
+
'gov.wales': string;
|
|
33
|
+
edu: string;
|
|
34
|
+
gov: string;
|
|
35
|
+
int: string;
|
|
36
|
+
'e164.arpa': string;
|
|
37
|
+
arpa: string;
|
|
38
|
+
aero: string;
|
|
39
|
+
asia: string;
|
|
40
|
+
biz: string;
|
|
41
|
+
cat: string;
|
|
42
|
+
coop: string;
|
|
43
|
+
info: string;
|
|
44
|
+
jobs: string;
|
|
45
|
+
mobi: string;
|
|
46
|
+
museum: string;
|
|
47
|
+
name: string;
|
|
48
|
+
post: string;
|
|
49
|
+
pro: string;
|
|
50
|
+
tel: string;
|
|
51
|
+
travel: string;
|
|
52
|
+
xxx: string;
|
|
53
|
+
ac: string;
|
|
54
|
+
ae: string;
|
|
55
|
+
af: string;
|
|
56
|
+
ag: string;
|
|
57
|
+
ai: string;
|
|
58
|
+
am: string;
|
|
59
|
+
ar: string;
|
|
60
|
+
as: string;
|
|
61
|
+
'priv.at': string;
|
|
62
|
+
at: string;
|
|
63
|
+
au: string;
|
|
64
|
+
aw: string;
|
|
65
|
+
ax: string;
|
|
66
|
+
be: string;
|
|
67
|
+
bf: string;
|
|
68
|
+
bg: string;
|
|
69
|
+
bh: string;
|
|
70
|
+
bi: string;
|
|
71
|
+
bj: string;
|
|
72
|
+
bm: string;
|
|
73
|
+
bn: string;
|
|
74
|
+
bo: string;
|
|
75
|
+
br: string;
|
|
76
|
+
by: string;
|
|
77
|
+
bw: string;
|
|
78
|
+
bz: string;
|
|
79
|
+
'co.ca': string;
|
|
80
|
+
ca: string;
|
|
81
|
+
cc: string;
|
|
82
|
+
cd: string;
|
|
83
|
+
ch: string;
|
|
84
|
+
ci: string;
|
|
85
|
+
cl: string;
|
|
86
|
+
cm: string;
|
|
87
|
+
'edu.cn': string;
|
|
88
|
+
cn: string;
|
|
89
|
+
'uk.co': string;
|
|
90
|
+
co: string;
|
|
91
|
+
cr: string;
|
|
92
|
+
cx: string;
|
|
93
|
+
cz: string;
|
|
94
|
+
de: string;
|
|
95
|
+
dk: string;
|
|
96
|
+
dm: string;
|
|
97
|
+
do: string;
|
|
98
|
+
dz: string;
|
|
99
|
+
ec: string;
|
|
100
|
+
ee: string;
|
|
101
|
+
eu: string;
|
|
102
|
+
fi: string;
|
|
103
|
+
fj: string;
|
|
104
|
+
fm: string;
|
|
105
|
+
fo: string;
|
|
106
|
+
fr: string;
|
|
107
|
+
gd: string;
|
|
108
|
+
ge: string;
|
|
109
|
+
gf: string;
|
|
110
|
+
gg: string;
|
|
111
|
+
gh: string;
|
|
112
|
+
gi: string;
|
|
113
|
+
gl: string;
|
|
114
|
+
gp: string;
|
|
115
|
+
gq: string;
|
|
116
|
+
gs: string;
|
|
117
|
+
gy: string;
|
|
118
|
+
hk: string;
|
|
119
|
+
hm: string;
|
|
120
|
+
hn: string;
|
|
121
|
+
hr: string;
|
|
122
|
+
ht: string;
|
|
123
|
+
hu: string;
|
|
124
|
+
id: string;
|
|
125
|
+
ie: string;
|
|
126
|
+
il: string;
|
|
127
|
+
im: string;
|
|
128
|
+
in: string;
|
|
129
|
+
io: string;
|
|
130
|
+
iq: string;
|
|
131
|
+
ir: string;
|
|
132
|
+
is: string;
|
|
133
|
+
it: string;
|
|
134
|
+
je: string;
|
|
135
|
+
jp: string;
|
|
136
|
+
ke: string;
|
|
137
|
+
kg: string;
|
|
138
|
+
ki: string;
|
|
139
|
+
kn: string;
|
|
140
|
+
kr: string;
|
|
141
|
+
kw: string;
|
|
142
|
+
ky: string;
|
|
143
|
+
kz: string;
|
|
144
|
+
la: string;
|
|
145
|
+
lb: string;
|
|
146
|
+
lc: string;
|
|
147
|
+
li: string;
|
|
148
|
+
lk: string;
|
|
149
|
+
ls: string;
|
|
150
|
+
lt: string;
|
|
151
|
+
lu: string;
|
|
152
|
+
lv: string;
|
|
153
|
+
ly: string;
|
|
154
|
+
ma: string;
|
|
155
|
+
md: string;
|
|
156
|
+
me: string;
|
|
157
|
+
mg: string;
|
|
158
|
+
mk: string;
|
|
159
|
+
ml: string;
|
|
160
|
+
mm: string;
|
|
161
|
+
mn: string;
|
|
162
|
+
mq: string;
|
|
163
|
+
mr: string;
|
|
164
|
+
ms: string;
|
|
165
|
+
mt: string;
|
|
166
|
+
mu: string;
|
|
167
|
+
mw: string;
|
|
168
|
+
mx: string;
|
|
169
|
+
my: string;
|
|
170
|
+
mz: string;
|
|
171
|
+
na: string;
|
|
172
|
+
nc: string;
|
|
173
|
+
nf: string;
|
|
174
|
+
ng: string;
|
|
175
|
+
nl: string;
|
|
176
|
+
no: string;
|
|
177
|
+
nu: string;
|
|
178
|
+
nz: string;
|
|
179
|
+
om: string;
|
|
180
|
+
pe: string;
|
|
181
|
+
pf: string;
|
|
182
|
+
pk: string;
|
|
183
|
+
'co.pl': string;
|
|
184
|
+
pl: string;
|
|
185
|
+
pm: string;
|
|
186
|
+
pr: string;
|
|
187
|
+
ps: string;
|
|
188
|
+
pt: string;
|
|
189
|
+
pw: string;
|
|
190
|
+
qa: string;
|
|
191
|
+
re: string;
|
|
192
|
+
ro: string;
|
|
193
|
+
rs: string;
|
|
194
|
+
'ac.ru': string;
|
|
195
|
+
'edu.ru': string;
|
|
196
|
+
'com.ru': string;
|
|
197
|
+
'msk.ru': string;
|
|
198
|
+
'net.ru': string;
|
|
199
|
+
'nov.ru': string;
|
|
200
|
+
'org.ru': string;
|
|
201
|
+
'pp.ru': string;
|
|
202
|
+
'spb.ru': string;
|
|
203
|
+
ru: string;
|
|
204
|
+
rw: string;
|
|
205
|
+
sa: string;
|
|
206
|
+
sb: string;
|
|
207
|
+
sc: string;
|
|
208
|
+
sd: string;
|
|
209
|
+
se: string;
|
|
210
|
+
sg: string;
|
|
211
|
+
sh: string;
|
|
212
|
+
si: string;
|
|
213
|
+
sk: string;
|
|
214
|
+
sl: string;
|
|
215
|
+
sm: string;
|
|
216
|
+
sn: string;
|
|
217
|
+
so: string;
|
|
218
|
+
ss: string;
|
|
219
|
+
st: string;
|
|
220
|
+
'msk.su': string;
|
|
221
|
+
'nov.su': string;
|
|
222
|
+
'spb.su': string;
|
|
223
|
+
su: string;
|
|
224
|
+
sx: string;
|
|
225
|
+
sy: string;
|
|
226
|
+
tc: string;
|
|
227
|
+
td: string;
|
|
228
|
+
tf: string;
|
|
229
|
+
tg: string;
|
|
230
|
+
th: string;
|
|
231
|
+
tk: string;
|
|
232
|
+
tl: string;
|
|
233
|
+
tm: string;
|
|
234
|
+
tn: string;
|
|
235
|
+
to: string;
|
|
236
|
+
tr: string;
|
|
237
|
+
tv: string;
|
|
238
|
+
tw: string;
|
|
239
|
+
tz: string;
|
|
240
|
+
'biz.ua': string;
|
|
241
|
+
'co.ua': string;
|
|
242
|
+
'pp.ua': string;
|
|
243
|
+
ua: string;
|
|
244
|
+
ug: string;
|
|
245
|
+
'ac.uk': string;
|
|
246
|
+
'gov.uk': string;
|
|
247
|
+
uk: string;
|
|
248
|
+
'fed.us': string;
|
|
249
|
+
us: string;
|
|
250
|
+
uy: string;
|
|
251
|
+
uz: string;
|
|
252
|
+
vc: string;
|
|
253
|
+
ve: string;
|
|
254
|
+
vg: string;
|
|
255
|
+
vu: string;
|
|
256
|
+
wf: string;
|
|
257
|
+
ws: string;
|
|
258
|
+
yt: string;
|
|
259
|
+
'ac.za': string;
|
|
260
|
+
'co.za': string;
|
|
261
|
+
'gov.za': string;
|
|
262
|
+
'net.za': string;
|
|
263
|
+
'org.za': string;
|
|
264
|
+
'web.za': string;
|
|
265
|
+
zm: string;
|
|
266
|
+
'xn--2scrj9c': string;
|
|
267
|
+
'xn--3e0b707e': string;
|
|
268
|
+
'xn--3hcrj9c': string;
|
|
269
|
+
'xn--45br5cyl': string;
|
|
270
|
+
'xn--45brj9c': string;
|
|
271
|
+
'xn--4dbrk0ce': string;
|
|
272
|
+
'xn--80ao21a': string;
|
|
273
|
+
'xn--90a3ac': string;
|
|
274
|
+
'xn--90ae': string;
|
|
275
|
+
'xn--90ais': string;
|
|
276
|
+
'xn--clchc0ea0b2g2a9gcd': string;
|
|
277
|
+
'xn--d1alf': string;
|
|
278
|
+
'xn--e1a4c': string;
|
|
279
|
+
'xn--fiqs8s': string;
|
|
280
|
+
'xn--fiqz9s': string;
|
|
281
|
+
'xn--fpcrj9c3d': string;
|
|
282
|
+
'xn--fzc2c9e2c': string;
|
|
283
|
+
'xn--gecrj9c': string;
|
|
284
|
+
'xn--h2breg3eve': string;
|
|
285
|
+
'xn--h2brj9c8c': string;
|
|
286
|
+
'xn--h2brj9c': string;
|
|
287
|
+
'xn--j1amh': string;
|
|
288
|
+
'xn--j6w193g': string;
|
|
289
|
+
'xn--kprw13d': string;
|
|
290
|
+
'xn--kpry57d': string;
|
|
291
|
+
'xn--lgbbat1ad8j': string;
|
|
292
|
+
'xn--mgb9awbf': string;
|
|
293
|
+
'xn--mgba3a4f16a': string;
|
|
294
|
+
'xn--mgbaam7a8h': string;
|
|
295
|
+
'xn--mgbah1a3hjkrd': string;
|
|
296
|
+
'xn--mgbbh1a71e': string;
|
|
297
|
+
'xn--mgbbh1a': string;
|
|
298
|
+
'xn--mgberp4a5d4ar': string;
|
|
299
|
+
'xn--mgbgu82a': string;
|
|
300
|
+
'xn--mgbtx2b': string;
|
|
301
|
+
'xn--mgbx4cd0ab': string;
|
|
302
|
+
'xn--node': string;
|
|
303
|
+
'xn--o3cw4h': string;
|
|
304
|
+
'xn--ogbpf8fl': string;
|
|
305
|
+
'xn--p1ai': string;
|
|
306
|
+
'xn--pgbs0dh': string;
|
|
307
|
+
'xn--q7ce6a': string;
|
|
308
|
+
'xn--qxa6a': string;
|
|
309
|
+
'xn--rvc1e0am3e': string;
|
|
310
|
+
'xn--s9brj9c': string;
|
|
311
|
+
'xn--wgbh1c': string;
|
|
312
|
+
'xn--wgbl6a': string;
|
|
313
|
+
'xn--xkc2al3hye2a': string;
|
|
314
|
+
'xn--xkc2dl3a5ee0h': string;
|
|
315
|
+
'xn--y9a3aq': string;
|
|
316
|
+
'xn--yfro4i67o': string;
|
|
317
|
+
'xn--ygbi2ammx': string;
|
|
318
|
+
};
|
|
319
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/whois",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.1",
|
|
5
5
|
"description": "Easily get whois info.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"node-fetch": "^3.3.2",
|
|
52
|
-
"socks": "^2.
|
|
52
|
+
"socks": "^2.8.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"node-fetch": "^3.3.2",
|
|
56
|
-
"socks": "^2.
|
|
56
|
+
"socks": "^2.8.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@stacksjs/development": "latest"
|