@stacksjs/whois 0.64.6 → 0.66.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.
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Response returned from whois function. Contains the raw text from WhoIs server and parsed/fornatted WhoIs data (if parsed is true)
3
+ *
4
+ * @interface
5
+ */
6
+ export interface WhoIsResponse {
7
+ /**
8
+ * Raw text response from WhoIs server
9
+ */
10
+ _raw: string;
11
+ /**
12
+ * Parsed/Formatted key-value pairs of the response (if parsed is true)
13
+ */
14
+ parsedData: any | null;
15
+ }
16
+ /**
17
+ * Type of the proxy. Either SOCKS4 or SOCKS5
18
+ * @enum
19
+ */
20
+ export declare enum ProxyType {
21
+ /**
22
+ * SOCKS4 type of proxy
23
+ */
24
+ SOCKS4 = 0,
25
+ /**
26
+ * SOCKS5 type of proxy
27
+ */
28
+ SOCKS5 = 1,
29
+ }
30
+ /**
31
+ * Proxy related data
32
+ * @interface
33
+ *
34
+ */
35
+ export interface ProxyData {
36
+ /**
37
+ * Proxy IP
38
+ */
39
+ ip: string;
40
+ /**
41
+ * Proxy port
42
+ */
43
+ port: number;
44
+ /**
45
+ * Username to connect to the proxy
46
+ */
47
+ username?: string | null;
48
+ /**
49
+ * Password to connect to the proxy
50
+ */
51
+ password?: string | null;
52
+ /**
53
+ * {@link ProxyType}
54
+ */
55
+ type: ProxyType;
56
+ }
57
+ /**
58
+ * WhoIs options
59
+ * @interface
60
+ */
61
+ export interface WhoIsOptions {
62
+ /**
63
+ * 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
64
+ */
65
+ tld?: string | null;
66
+ /**
67
+ * The encoding type used for WhoIs server and response. By default UTF-8 is used.
68
+ */
69
+ encoding?: string | null;
70
+ /** {@link ProxyData} */
71
+ proxy?: ProxyData | null;
72
+ /**
73
+ * The WhoIs server to collect data from. If not provided, the server will automatically determined using the {@link tld}
74
+ */
75
+ server?: string | null;
76
+ /**
77
+ * The port of the WhoIs server. By default, port 43 is used.
78
+ */
79
+ serverPort?: number | null;
80
+ /**
81
+ * Which data needs to be extracted/parsed from the WhoIs response.
82
+ * An object can be passed which contains keys of the fields of the WhoIs response.
83
+ * A copy of the provided object will be returned with the values filled for the provided keys.
84
+ *
85
+ * The keys can have default value of empty string. However, if the WhoIs response has multiple values for the same field (eg: 'Domain Status'),
86
+ * then all the values can be collected by providing a default value of an Array([]).
87
+ *
88
+ * Following example shows an object used to collect 'Domain Name', 'Domain Status' (multiple values) and 'Registrar' from WhoIs response
89
+ *
90
+ * @example {'Domain Name': '', 'Domain Status': [], 'Registrar': ''}
91
+ */
92
+ parseData?: object | null;
93
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copy an Object with its values
3
+ *
4
+ * @param obj Object which needs to be copied
5
+ * @returns A copy of the object
6
+ */
7
+ export declare function shallowCopy<T>(obj: T): T;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@stacksjs/whois",
3
3
  "type": "module",
4
- "version": "0.64.6",
4
+ "version": "0.66.0",
5
5
  "description": "Easily get whois info.",
6
6
  "author": "Chris Breuer",
7
+ "contributors": ["Chris Breuer <chris@stacksjs.org>"],
7
8
  "license": "MIT",
8
9
  "funding": "https://github.com/sponsors/chrisbbreuer",
9
10
  "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/whois#readme",
@@ -27,6 +28,7 @@
27
28
  "exports": {
28
29
  ".": {
29
30
  "bun": "./src/index.ts",
31
+ "types": "./dist/index.d.ts",
30
32
  "import": "./dist/index.js"
31
33
  },
32
34
  "./*": {
@@ -34,17 +36,12 @@
34
36
  "import": "./dist/*"
35
37
  }
36
38
  },
37
- "contributors": [
38
- "Chris Breuer <chris@stacksjs.org>"
39
- ],
40
- "files": [
41
- "README.md",
42
- "dist",
43
- "src"
44
- ],
39
+ "types": "./dist/index.d.ts",
40
+ "files": ["README.md", "dist", "src"],
45
41
  "scripts": {
46
- "build": "bun --bun build.ts",
47
- "typecheck": "bun --bun tsc --noEmit",
42
+ "build": "bun build.ts",
43
+ "typecheck": "bun tsc --noEmit",
44
+ "test": "bun test",
48
45
  "prepublishOnly": "bun run build"
49
46
  },
50
47
  "dependencies": {
@@ -52,6 +49,6 @@
52
49
  "socks": "^2.8.3"
53
50
  },
54
51
  "devDependencies": {
55
- "@stacksjs/development": "latest"
52
+ "@stacksjs/development": "0.65.1"
56
53
  }
57
54
  }
@@ -0,0 +1,325 @@
1
+ export const IANA_CHK_URL: string = 'https://www.iana.org/whois?q='
2
+
3
+ export const PARAMETERS: Record<string, string> = {
4
+ 'whois.denic.de': '-T dn,ace',
5
+ 'whois.nic.fr': '-V Md5.2',
6
+ }
7
+
8
+ export const SERVERS: Record<string, string> = {
9
+ 'br.com': 'whois.centralnic.net',
10
+ 'cn.com': 'whois.centralnic.net',
11
+ 'de.com': 'whois.centralnic.net',
12
+ 'eu.com': 'whois.centralnic.net',
13
+ 'gb.com': 'whois.centralnic.net',
14
+ 'gb.net': 'whois.centralnic.net',
15
+ 'gr.com': 'whois.centralnic.net',
16
+ 'hu.com': 'whois.centralnic.net',
17
+ 'in.net': 'whois.centralnic.net',
18
+ 'no.com': 'whois.centralnic.net',
19
+ 'qc.com': 'whois.centralnic.net',
20
+ 'ru.com': 'whois.centralnic.net',
21
+ 'sa.com': 'whois.centralnic.net',
22
+ 'se.com': 'whois.centralnic.net',
23
+ 'se.net': 'whois.centralnic.net',
24
+ 'uk.com': 'whois.centralnic.net',
25
+ 'uk.net': 'whois.centralnic.net',
26
+ 'us.com': 'whois.centralnic.net',
27
+ 'uy.com': 'whois.centralnic.net',
28
+ 'za.com': 'whois.centralnic.net',
29
+ 'jpn.com': 'whois.centralnic.ne',
30
+ 'web.com': 'whois.centralnic.ne',
31
+ 'com': 'whois.verisign-grs.com',
32
+ 'za.net': 'whois.za.net',
33
+ 'net': 'whois.verisign-grs.com',
34
+ 'eu.org': 'whois.eu.org',
35
+ 'za.org': 'whois.za.org',
36
+ 'org': 'whois.pir.org',
37
+ 'llyw.cymru': 'whois.nic.llyw.cymru',
38
+ 'gov.scot': 'whois.nic.gov.scot',
39
+ 'gov.wales': 'whois.nic.gov.wales',
40
+ 'edu': 'whois.educause.edu',
41
+ 'gov': 'whois.dotgov.gov',
42
+ 'int': 'whois.iana.org',
43
+ 'e164.arpa': 'whois.ripe.net',
44
+ 'arpa': 'whois.iana.org',
45
+ 'aero': 'whois.aero',
46
+ 'asia': 'whois.nic.asia',
47
+ 'biz': 'whois.nic.biz',
48
+ 'cat': 'whois.nic.cat',
49
+ 'coop': 'whois.nic.coop',
50
+ 'info': 'whois.afilias.net',
51
+ 'jobs': 'whois.nic.jobs',
52
+ 'mobi': 'whois.afilias.net',
53
+ 'museum': 'whois.nic.museum',
54
+ 'name': 'whois.nic.name',
55
+ 'post': 'whois.dotpostregistry.net',
56
+ 'pro': 'whois.nic.pro',
57
+ 'tel': 'whois.nic.tel',
58
+ 'travel': 'whois.nic.travel',
59
+ 'xxx': 'whois.nic.xxx',
60
+ 'ac': 'whois.nic.ac',
61
+ 'ae': 'whois.aeda.net.ae',
62
+ 'af': 'whois.nic.af',
63
+ 'ag': 'whois.nic.ag',
64
+ 'ai': 'whois.nic.ai',
65
+ 'am': 'whois.amnic.net',
66
+ 'ar': 'whois.nic.ar',
67
+ 'as': 'whois.nic.as',
68
+ 'priv.at': 'whois.nic.priv.at',
69
+ 'at': 'whois.nic.at',
70
+ 'au': 'whois.auda.org.au',
71
+ 'aw': 'whois.nic.aw',
72
+ 'ax': 'whois.ax',
73
+ 'be': 'whois.dns.be',
74
+ 'bf': 'whois.registre.bf',
75
+ 'bg': 'whois.register.bg',
76
+ 'bh': 'whois.nic.bh',
77
+ 'bi': 'whois1.nic.bi',
78
+ 'bj': 'whois.nic.bj',
79
+ 'bm': 'whois.afilias-srs.net',
80
+ 'bn': 'whois.bnnic.bn',
81
+ 'bo': 'whois.nic.bo',
82
+ 'br': 'whois.registro.br',
83
+ 'by': 'whois.cctld.by',
84
+ 'bw': 'whois.nic.net.bw',
85
+ 'bz': 'whois.afilias-grs.info',
86
+ 'co.ca': 'whois.co.ca',
87
+ 'ca': 'whois.cira.ca',
88
+ 'cc': 'ccwhois.verisign-grs.com',
89
+ 'cd': 'whois.nic.cd',
90
+ 'ch': 'whois.nic.ch',
91
+ 'ci': 'whois.nic.ci',
92
+ 'cl': 'whois.nic.cl',
93
+ 'cm': 'whois.netcom.cm',
94
+ 'edu.cn': 'whois.edu.cn',
95
+ 'cn': 'whois.cnnic.cn',
96
+ 'uk.co': 'whois.uk.co',
97
+ 'co': 'whois.nic.co',
98
+ 'cr': 'whois.nic.cr',
99
+ 'cx': 'whois.nic.cx',
100
+ 'cz': 'whois.nic.cz',
101
+ 'de': 'whois.denic.de',
102
+ 'dk': 'whois.dk-hostmaster.dk',
103
+ 'dm': 'whois.dmdomains.dm',
104
+ 'do': 'whois.nic.do',
105
+ 'dz': 'whois.nic.dz',
106
+ 'ec': 'whois.nic.ec',
107
+ 'ee': 'whois.tld.ee',
108
+ 'eu': 'whois.eu',
109
+ 'fi': 'whois.fi',
110
+ 'fj': 'www.whois.fj',
111
+ 'fm': 'whois.nic.fm',
112
+ 'fo': 'whois.nic.fo',
113
+ 'fr': 'whois.nic.fr',
114
+ 'gd': 'whois.nic.gd',
115
+ 'ge': 'whois.nic.ge',
116
+ 'gf': 'whois.mediaserv.net',
117
+ 'gg': 'whois.gg',
118
+ 'gh': 'whois.nic.gh',
119
+ 'gi': 'whois2.afilias-grs.net',
120
+ 'gl': 'whois.nic.gl',
121
+ 'gp': 'whois.nic.gp',
122
+ 'gq': 'whois.dominio.gq',
123
+ 'gs': 'whois.nic.gs',
124
+ 'gy': 'whois.registry.gy',
125
+ 'hk': 'whois.hkirc.hk',
126
+ 'hm': 'whois.registry.hm',
127
+ 'hn': 'whois.nic.hn',
128
+ 'hr': 'whois.dns.hr',
129
+ 'ht': 'whois.nic.ht',
130
+ 'hu': 'whois.nic.hu',
131
+ 'id': 'whois.id',
132
+ 'ie': 'whois.weare.ie',
133
+ 'il': 'whois.isoc.org.il',
134
+ 'im': 'whois.nic.im',
135
+ 'in': 'whois.registry.in',
136
+ 'io': 'whois.nic.io',
137
+ 'iq': 'whois.cmc.iq',
138
+ 'ir': 'whois.nic.ir',
139
+ 'is': 'whois.isnic.is',
140
+ 'it': 'whois.nic.it',
141
+ 'je': 'whois.je',
142
+ 'jp': 'whois.jprs.jp',
143
+ 'ke': 'whois.kenic.or.ke',
144
+ 'kg': 'whois.kg',
145
+ 'ki': 'whois.nic.ki',
146
+ 'kn': 'whois.nic.kn',
147
+ 'kr': 'whois.kr',
148
+ 'kw': 'whois.nic.kw',
149
+ 'ky': 'whois.kyregistry.ky',
150
+ 'kz': 'whois.nic.kz',
151
+ 'la': 'whois.nic.la',
152
+ 'lb': 'whois.lbdr.org.lb',
153
+ 'lc': 'whois2.afilias-grs.net',
154
+ 'li': 'whois.nic.li',
155
+ 'lk': 'whois.nic.lk',
156
+ 'ls': 'whois.nic.ls',
157
+ 'lt': 'whois.domreg.lt',
158
+ 'lu': 'whois.dns.lu',
159
+ 'lv': 'whois.nic.lv',
160
+ 'ly': 'whois.nic.ly',
161
+ 'ma': 'whois.registre.ma',
162
+ 'md': 'whois.nic.md',
163
+ 'me': 'whois.nic.me',
164
+ 'mg': 'whois.nic.mg',
165
+ 'mk': 'whois.marnet.mk',
166
+ 'ml': 'whois.dot.ml',
167
+ 'mm': 'whois.registry.gov.mm',
168
+ 'mn': 'whois.nic.mn',
169
+ 'mq': 'whois.mediaserv.net',
170
+ 'mr': 'whois.nic.mr',
171
+ 'ms': 'whois.nic.ms',
172
+ 'mt': 'whois.nic.org.mt',
173
+ 'mu': 'whois.nic.mu',
174
+ 'mw': 'whois.nic.mw',
175
+ 'mx': 'whois.mx',
176
+ 'my': 'whois.mynic.my',
177
+ 'mz': 'whois.nic.mz',
178
+ 'na': 'whois.na-nic.com.na',
179
+ 'nc': 'whois.nc',
180
+ 'nf': 'whois.nic.nf',
181
+ 'ng': 'whois.nic.net.ng',
182
+ 'nl': 'whois.domain-registry.nl',
183
+ 'no': 'whois.norid.no',
184
+ 'nu': 'whois.iis.nu',
185
+ 'nz': 'whois.irs.net.nz',
186
+ 'om': 'whois.registry.om',
187
+ 'pe': 'kero.yachay.pe',
188
+ 'pf': 'whois.registry.pf',
189
+ 'pk': 'whois.pknic.net.pk',
190
+ 'co.pl': 'whois.co.pl',
191
+ 'pl': 'whois.dns.pl',
192
+ 'pm': 'whois.nic.pm',
193
+ 'pr': 'whois.afilias-srs.net',
194
+ 'ps': 'whois.pnina.ps',
195
+ 'pt': 'whois.dns.pt',
196
+ 'pw': 'whois.nic.pw',
197
+ 'qa': 'whois.registry.qa',
198
+ 're': 'whois.nic.re',
199
+ 'ro': 'whois.rotld.ro',
200
+ 'rs': 'whois.rnids.rs',
201
+ 'ac.ru': 'whois.free.net',
202
+ 'edu.ru': 'whois.informika.ru',
203
+ 'com.ru': 'whois.flexireg.net',
204
+ 'msk.ru': 'whois.flexireg.net',
205
+ 'net.ru': 'whois.nic.net.ru',
206
+ 'nov.ru': 'whois.flexireg.net',
207
+ 'org.ru': 'whois.nic.net.ru',
208
+ 'pp.ru': 'whois.nic.net.ru',
209
+ 'spb.ru': 'whois.flexireg.net',
210
+ 'ru': 'whois.tcinet.ru',
211
+ 'rw': 'whois.ricta.org.rw',
212
+ 'sa': 'whois.nic.net.sa',
213
+ 'sb': 'whois.nic.net.sb',
214
+ 'sc': 'whois2.afilias-grs.net',
215
+ 'sd': 'whois.sdnic.sd',
216
+ 'se': 'whois.iis.se',
217
+ 'sg': 'whois.sgnic.sg',
218
+ 'sh': 'whois.nic.sh',
219
+ 'si': 'whois.register.si',
220
+ 'sk': 'whois.sk-nic.sk',
221
+ 'sl': 'whois.nic.sl',
222
+ 'sm': 'whois.nic.sm',
223
+ 'sn': 'whois.nic.sn',
224
+ 'so': 'whois.nic.so',
225
+ 'ss': 'whois.nic.ss',
226
+ 'st': 'whois.nic.st',
227
+ 'msk.su': 'whois.flexireg.net',
228
+ 'nov.su': 'whois.flexireg.net',
229
+ 'spb.su': 'whois.flexireg.net',
230
+ 'su': 'whois.tcinet.ru',
231
+ 'sx': 'whois.sx',
232
+ 'sy': 'whois.tld.sy',
233
+ 'tc': 'whois.nic.tc',
234
+ 'td': 'whois.nic.td',
235
+ 'tf': 'whois.nic.tf',
236
+ 'tg': 'whois.nic.tg',
237
+ 'th': 'whois.thnic.co.th',
238
+ 'tk': 'whois.dot.tk',
239
+ 'tl': 'whois.nic.tl',
240
+ 'tm': 'whois.nic.tm',
241
+ 'tn': 'whois.ati.tn',
242
+ 'to': 'whois.tonic.to',
243
+ 'tr': 'whois.trabis.gov.tr',
244
+ 'tv': 'whois.nic.tv',
245
+ 'tw': 'whois.twnic.net.tw',
246
+ 'tz': 'whois.tznic.or.tz',
247
+ 'biz.ua': 'whois.biz.ua',
248
+ 'co.ua': 'whois.co.ua',
249
+ 'pp.ua': 'whois.pp.ua',
250
+ 'ua': 'whois.ua',
251
+ 'ug': 'whois.co.ug',
252
+ 'ac.uk': 'whois.nic.ac.uk',
253
+ 'gov.uk': 'whois.gov.uk',
254
+ 'uk': 'whois.nic.uk',
255
+ 'fed.us': 'whois.nic.gov',
256
+ 'us': 'whois.nic.us',
257
+ 'uy': 'whois.nic.org.uy',
258
+ 'uz': 'whois.cctld.uz',
259
+ 'vc': 'whois2.afilias-grs.net',
260
+ 've': 'whois.nic.ve',
261
+ 'vg': 'whois.nic.vg',
262
+ 'vu': 'whois.dnrs.vu',
263
+ 'wf': 'whois.nic.wf',
264
+ 'ws': 'whois.website.ws',
265
+ 'yt': 'whois.nic.yt',
266
+ 'ac.za': 'whois.ac.za',
267
+ 'co.za': 'whois.registry.net.za',
268
+ 'gov.za': 'whois.gov.za',
269
+ 'net.za': 'net-whois.registry.net.za',
270
+ 'org.za': 'org-whois.registry.net.za',
271
+ 'web.za': 'web-whois.registry.net.za',
272
+ 'zm': 'whois.zicta.zm',
273
+ 'xn--2scrj9c': 'whois.registry.in',
274
+ 'xn--3e0b707e': 'whois.kr',
275
+ 'xn--3hcrj9c': 'whois.registry.in',
276
+ 'xn--45br5cyl': 'whois.registry.in',
277
+ 'xn--45brj9c': 'whois.registry.in',
278
+ 'xn--4dbrk0ce': 'whois.isoc.org.il',
279
+ 'xn--80ao21a': 'whois.nic.kz',
280
+ 'xn--90a3ac': 'whois.rnids.rs',
281
+ 'xn--90ae': 'whois.imena.bg',
282
+ 'xn--90ais': 'whois.cctld.by',
283
+ 'xn--clchc0ea0b2g2a9gcd': 'whois.sgnic.sg',
284
+ 'xn--d1alf': 'whois.marnet.mk',
285
+ 'xn--e1a4c': 'whois.eu',
286
+ 'xn--fiqs8s': 'cwhois.cnnic.cn',
287
+ 'xn--fiqz9s': 'cwhois.cnnic.cn',
288
+ 'xn--fpcrj9c3d': 'whois.registry.in',
289
+ 'xn--fzc2c9e2c': 'whois.nic.lk',
290
+ 'xn--gecrj9c': 'whois.registry.in',
291
+ 'xn--h2breg3eve': 'whois.registry.in',
292
+ 'xn--h2brj9c8c': 'whois.registry.in',
293
+ 'xn--h2brj9c': 'whois.registry.in',
294
+ 'xn--j1amh': 'whois.dotukr.com',
295
+ 'xn--j6w193g': 'whois.hkirc.hk',
296
+ 'xn--kprw13d': 'whois.twnic.net.tw',
297
+ 'xn--kpry57d': 'whois.twnic.net.tw',
298
+ 'xn--lgbbat1ad8j': 'whois.nic.dz',
299
+ 'xn--mgb9awbf': 'whois.registry.om',
300
+ 'xn--mgba3a4f16a': 'whois.nic.ir',
301
+ 'xn--mgbaam7a8h': 'whois.aeda.net.ae',
302
+ 'xn--mgbah1a3hjkrd': 'whois.nic.mr',
303
+ 'xn--mgbbh1a71e': 'whois.registry.in',
304
+ 'xn--mgbbh1a': 'whois.registry.in',
305
+ 'xn--mgberp4a5d4ar': 'whois.nic.net.sa',
306
+ 'xn--mgbgu82a': 'whois.registry.in',
307
+ 'xn--mgbtx2b': 'whois.cmc.iq',
308
+ 'xn--mgbx4cd0ab': 'whois.mynic.my',
309
+ 'xn--node': 'whois.itdc.ge',
310
+ 'xn--o3cw4h': 'whois.thnic.co.th',
311
+ 'xn--ogbpf8fl': 'whois.tld.sy',
312
+ 'xn--p1ai': 'whois.tcinet.ru',
313
+ 'xn--pgbs0dh': 'whois.ati.tn',
314
+ 'xn--q7ce6a': 'whois.nic.la',
315
+ 'xn--qxa6a': 'whois.eu',
316
+ 'xn--rvc1e0am3e': 'whois.registry.in',
317
+ 'xn--s9brj9c': 'whois.registry.in',
318
+ 'xn--wgbh1c': 'whois.dotmasr.eg',
319
+ 'xn--wgbl6a': 'whois.registry.qa',
320
+ 'xn--xkc2al3hye2a': 'whois.nic.lk',
321
+ 'xn--xkc2dl3a5ee0h': 'whois.registry.in',
322
+ 'xn--y9a3aq': 'whois.amnic.net',
323
+ 'xn--yfro4i67o': 'whois.sgnic.sg',
324
+ 'xn--ygbi2ammx': 'whois.pnina.ps',
325
+ }