@cleandns/whois-rdap 1.0.17 → 1.0.19
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 -3
- package/package.json +2 -1
- package/src/index.ts +3 -3
- package/whois.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const eventMap = new Map([
|
|
|
10
10
|
["expiration", "expires"],
|
|
11
11
|
["expiration date", "expires"],
|
|
12
12
|
]);
|
|
13
|
-
export async function whois(origDomain, options = { fetch: fetch }) {
|
|
13
|
+
export async function whois(origDomain, options = { fetch: fetch, thinOnly: false }) {
|
|
14
14
|
var _a, _b, _c, _d, _e, _f;
|
|
15
15
|
const fetch = options.fetch;
|
|
16
16
|
let domain = origDomain;
|
|
@@ -48,7 +48,7 @@ export async function whois(origDomain, options = { fetch: fetch }) {
|
|
|
48
48
|
link.rel === "related" &&
|
|
49
49
|
link.type === "application/rdap+json")) === null || _d === void 0 ? void 0 : _d.href.replace("/domain/domain/", "/domain/");
|
|
50
50
|
let thickResponse = null;
|
|
51
|
-
if (thickRdap) {
|
|
51
|
+
if (!options.thinOnly && thickRdap) {
|
|
52
52
|
// console.log(`fetching thick RDAP: ${thickRdap}`);
|
|
53
53
|
thickResponse = await fetch(thickRdap)
|
|
54
54
|
.then((r) => r.json())
|
|
@@ -88,7 +88,7 @@ export async function whois(origDomain, options = { fetch: fetch }) {
|
|
|
88
88
|
((_d = pubIds.find((id) => id.type === "IANA Registrar ID")) === null || _d === void 0 ? void 0 : _d.Identifier) ||
|
|
89
89
|
((_e = pubIds.find((id) => id.type === "IANA Registrar ID")) === null || _e === void 0 ? void 0 : _e.identifier);
|
|
90
90
|
if (reg) {
|
|
91
|
-
console.log(ent.vcardArray);
|
|
91
|
+
// console.log(ent.vcardArray);
|
|
92
92
|
const id = reg;
|
|
93
93
|
const name = (parseInt(id) == id
|
|
94
94
|
&& ((_f = (await ianaIdToRegistrar(parseInt(id)))) === null || _f === void 0 ? void 0 : _f.name))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleandns/whois-rdap",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/cleandns-inc/tool-whois#readme",
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@types/node": "^22.0.2",
|
|
22
23
|
"typescript": "^5.4.3"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ const eventMap = new Map<string, WhoisTimestampFields>([
|
|
|
15
15
|
|
|
16
16
|
export async function whois(
|
|
17
17
|
origDomain: string,
|
|
18
|
-
options: WhoisOptions = { fetch: fetch }
|
|
18
|
+
options: WhoisOptions = { fetch: fetch, thinOnly: false }
|
|
19
19
|
): Promise<WhoisResponse> {
|
|
20
20
|
const fetch = options.fetch!;
|
|
21
21
|
|
|
@@ -67,7 +67,7 @@ export async function whois(
|
|
|
67
67
|
|
|
68
68
|
let thickResponse: any = null;
|
|
69
69
|
|
|
70
|
-
if (thickRdap) {
|
|
70
|
+
if (!options.thinOnly && thickRdap) {
|
|
71
71
|
// console.log(`fetching thick RDAP: ${thickRdap}`);
|
|
72
72
|
thickResponse = await fetch(thickRdap)
|
|
73
73
|
.then((r) => r.json() as any)
|
|
@@ -117,7 +117,7 @@ export async function whois(
|
|
|
117
117
|
pubIds.find((id: any) => id.type === "IANA Registrar ID")?.identifier;
|
|
118
118
|
|
|
119
119
|
if (reg) {
|
|
120
|
-
console.log(ent.vcardArray);
|
|
120
|
+
// console.log(ent.vcardArray);
|
|
121
121
|
const id = reg;
|
|
122
122
|
const name =
|
|
123
123
|
(parseInt(id) == id
|