@cleandns/whois-rdap 1.0.44 → 1.0.47
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.js +3 -1
- package/dist/port43.js +3 -3
- package/package.json +1 -1
- package/pnpm-workspace.yaml +2 -0
- package/src/index.ts +3 -1
- package/src/port43.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -217,7 +217,9 @@ function findStatus(statuses, domain) {
|
|
|
217
217
|
? statuses
|
|
218
218
|
: statuses && typeof statuses === "object"
|
|
219
219
|
? Object.keys(statuses)
|
|
220
|
-
:
|
|
220
|
+
: typeof statuses === "string"
|
|
221
|
+
? statuses.trim().split(/\s*,\s*/)
|
|
222
|
+
: []).map((status) => normalizeWhoisStatus(status));
|
|
221
223
|
}
|
|
222
224
|
function findNameservers(values) {
|
|
223
225
|
let nameservers = [];
|
package/dist/port43.js
CHANGED
|
@@ -9,7 +9,7 @@ export function determinePort43Domain(actor) {
|
|
|
9
9
|
if (parsed.type === ParseResultType.Listed) {
|
|
10
10
|
let tld = parsed.topLevelDomains.join(".");
|
|
11
11
|
if (port43servers[tld] || port43servers[tld.replace(/^[^.]+\./, "*.")]) {
|
|
12
|
-
const domain = parsed.domain + "." + tld;
|
|
12
|
+
const domain = parsed.domain ? (parsed.domain + "." + tld) : tld;
|
|
13
13
|
return [domain, tld, port43servers[tld] || port43servers[tld.replace(/^[^.]+\./, "*.")]];
|
|
14
14
|
}
|
|
15
15
|
tld = parsed.icann.topLevelDomains.join(".");
|
|
@@ -53,7 +53,7 @@ export async function port43(actor, _fetch) {
|
|
|
53
53
|
port43response = await _fetch(`https://www.whois.com/whois/${domain}`).then(r => r.text()).then((r) => {
|
|
54
54
|
var _a;
|
|
55
55
|
return ((_a = r.match(/<pre class="df-raw" id="registryData">(.*?)<\/pre>/s)) === null || _a === void 0 ? void 0 : _a[1]) || "";
|
|
56
|
-
});
|
|
56
|
+
}).catch((error) => "");
|
|
57
57
|
if (port43response === '') {
|
|
58
58
|
const promiseSocket = new PromiseSocket(new Socket());
|
|
59
59
|
promiseSocket.setTimeout(5 * 1000);
|
|
@@ -68,7 +68,7 @@ export async function port43(actor, _fetch) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
catch (error) {
|
|
71
|
-
console.warn(port, server, query);
|
|
71
|
+
console.warn({ port, server, query, error: error.message });
|
|
72
72
|
response.found = false;
|
|
73
73
|
}
|
|
74
74
|
if (!response.found) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -335,7 +335,9 @@ function findStatus(statuses: string | string[], domain: string): string[] {
|
|
|
335
335
|
? statuses
|
|
336
336
|
: statuses && typeof statuses === "object"
|
|
337
337
|
? Object.keys(statuses)
|
|
338
|
-
:
|
|
338
|
+
: typeof statuses === "string"
|
|
339
|
+
? statuses.trim().split(/\s*,\s*/)
|
|
340
|
+
: []
|
|
339
341
|
).map((status) => normalizeWhoisStatus(status));
|
|
340
342
|
}
|
|
341
343
|
|
package/src/port43.ts
CHANGED
|
@@ -12,7 +12,7 @@ export function determinePort43Domain(actor: string) {
|
|
|
12
12
|
if (parsed.type === ParseResultType.Listed) {
|
|
13
13
|
let tld = parsed.topLevelDomains.join(".");
|
|
14
14
|
if (port43servers[tld] || port43servers[tld.replace(/^[^.]+\./, "*.")]) {
|
|
15
|
-
const domain = parsed.domain + "." + tld;
|
|
15
|
+
const domain = parsed.domain ? (parsed.domain + "." + tld) : tld;
|
|
16
16
|
return [domain, tld, port43servers[tld] || port43servers[tld.replace(/^[^.]+\./, "*.")]];
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -62,7 +62,7 @@ export async function port43(actor: string, _fetch: typeof fetch): Promise<Whois
|
|
|
62
62
|
response.server = server;
|
|
63
63
|
port43response = await _fetch(`https://www.whois.com/whois/${domain}`).then(r => r.text()).then((r) => {
|
|
64
64
|
return r.match(/<pre class="df-raw" id="registryData">(.*?)<\/pre>/s)?.[1] || "";
|
|
65
|
-
});
|
|
65
|
+
}).catch((error) => "");
|
|
66
66
|
|
|
67
67
|
if (port43response === '') {
|
|
68
68
|
const promiseSocket = new PromiseSocket(new Socket());
|
|
@@ -77,7 +77,7 @@ export async function port43(actor: string, _fetch: typeof fetch): Promise<Whois
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
} catch (error: any) {
|
|
80
|
-
console.warn(port, server, query);
|
|
80
|
+
console.warn({ port, server, query, error: error.message });
|
|
81
81
|
response.found = false;
|
|
82
82
|
}
|
|
83
83
|
|