@pipedream/viewdns_info 0.0.1 → 0.1.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/actions/dns-record-lookup/dns-record-lookup.mjs +42 -0
- package/actions/ip-history/ip-history.mjs +34 -0
- package/actions/reverse-ip-lookup/reverse-ip-lookup.mjs +40 -0
- package/actions/reverse-whois-lookup/reverse-whois-lookup.mjs +40 -0
- package/actions/subdomain-discovery/subdomain-discovery.mjs +40 -0
- package/actions/whois-lookup/whois-lookup.mjs +34 -0
- package/package.json +4 -1
- package/viewdns_info.app.mjs +88 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import viewdnsInfo from "../../viewdns_info.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "viewdns_info-dns-record-lookup",
|
|
5
|
+
name: "DNS Record Lookup",
|
|
6
|
+
description: "Performs a DNS record lookup to retrieve various DNS record types for a domain. [See the documentation](https://viewdns.info/api/dns-record-lookup/)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
ai: "optimized",
|
|
15
|
+
props: {
|
|
16
|
+
viewdnsInfo,
|
|
17
|
+
domain: {
|
|
18
|
+
type: "string",
|
|
19
|
+
label: "Domain",
|
|
20
|
+
description: "The hostname to retrieve DNS records for (e.g., example.com).",
|
|
21
|
+
},
|
|
22
|
+
recordType: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Record Type",
|
|
25
|
+
description: "The type of DNS record to retrieve (e.g., A,AAAA,MX,TXT,ANY).",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
async run({ $ }) {
|
|
30
|
+
const response = await this.viewdnsInfo.dnsLookup({
|
|
31
|
+
$,
|
|
32
|
+
params: {
|
|
33
|
+
domain: this.domain,
|
|
34
|
+
recordtype: this.recordType,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
$.export("$summary", `Retrieved DNS records for ${this.domain}.`);
|
|
39
|
+
|
|
40
|
+
return response;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import viewdnsInfo from "../../viewdns_info.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "viewdns_info-ip-history",
|
|
5
|
+
name: "IP History",
|
|
6
|
+
description: "Retrieves the IP address history for a domain. [See the documentation](https://viewdns.info/api/ip-history/)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
viewdnsInfo,
|
|
16
|
+
domain: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Domain",
|
|
19
|
+
description: "The domain name to retrieve the historical IP addresses for (e.g., example.com).",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const response = await this.viewdnsInfo.ipHistory({
|
|
24
|
+
$,
|
|
25
|
+
params: {
|
|
26
|
+
domain: this.domain,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
$.export("$summary", `Retrieved IP history for ${this.domain}.`);
|
|
31
|
+
|
|
32
|
+
return response;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import viewdnsInfo from "../../viewdns_info.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "viewdns_info-reverse-ip-lookup",
|
|
5
|
+
name: "Reverse IP Lookup",
|
|
6
|
+
description: "Performs a reverse IP lookup to find domains hosted on the same IP address. [See the documentation](https://viewdns.info/api/reverse-ip-lookup/)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
viewdnsInfo,
|
|
16
|
+
host: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Host",
|
|
19
|
+
description: "The domain or IP to perform the reverse IP lookup on (e.g., example.com)",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const results = await this.viewdnsInfo.getPaginatedResources({
|
|
24
|
+
fn: this.viewdnsInfo.reverseIpLookup,
|
|
25
|
+
args: {
|
|
26
|
+
$,
|
|
27
|
+
params: {
|
|
28
|
+
host: this.host,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
resourceKey: "domains",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
$.export("$summary", `Found ${results.length} domain${results.length === 1
|
|
35
|
+
? ""
|
|
36
|
+
: "s"} hosted on the IP address.`);
|
|
37
|
+
|
|
38
|
+
return results;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import viewdnsInfo from "../../viewdns_info.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "viewdns_info-reverse-whois-lookup",
|
|
5
|
+
name: "Reverse Whois Lookup",
|
|
6
|
+
description: "Performs a reverse WHOIS search to find domains registered by the same person or organization. [See the documentation](https://viewdns.info/api/reverse-whois-lookup/)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
viewdnsInfo,
|
|
16
|
+
q: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Query",
|
|
19
|
+
description: "The registrant name or email address to search for (e.g., domain@example.com).",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const results = await this.viewdnsInfo.getPaginatedResources({
|
|
24
|
+
fn: this.viewdnsInfo.reverseWhoisLookup,
|
|
25
|
+
args: {
|
|
26
|
+
$,
|
|
27
|
+
params: {
|
|
28
|
+
q: this.q,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
resourceKey: "matches",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
$.export("$summary", `Found ${results.length} domain${results.length === 1
|
|
35
|
+
? ""
|
|
36
|
+
: "s"} matching the query.`);
|
|
37
|
+
|
|
38
|
+
return results;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import viewdnsInfo from "../../viewdns_info.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "viewdns_info-subdomain-discovery",
|
|
5
|
+
name: "Subdomain Discovery",
|
|
6
|
+
description: "Discovers subdomains associated with a given domain. [See the documentation](https://viewdns.info/api/subdomain-discovery/)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
viewdnsInfo,
|
|
16
|
+
domain: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Domain",
|
|
19
|
+
description: "The domain name to retrieve subdomains for (e.g., example.com).",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const results = await this.viewdnsInfo.getPaginatedResources({
|
|
24
|
+
fn: this.viewdnsInfo.subdomainDiscovery,
|
|
25
|
+
args: {
|
|
26
|
+
$,
|
|
27
|
+
params: {
|
|
28
|
+
domain: this.domain,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
resourceKey: "subdomains",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
$.export("$summary", `Found ${results.length} subdomain${results.length === 1
|
|
35
|
+
? ""
|
|
36
|
+
: "s"} for ${this.domain}.`);
|
|
37
|
+
|
|
38
|
+
return results;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import viewdnsInfo from "../../viewdns_info.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "viewdns_info-whois-lookup",
|
|
5
|
+
name: "Whois Lookup",
|
|
6
|
+
description: "Performs a WHOIS lookup to retrieve domain registration information. [See the documentation](https://viewdns.info/api/whois/)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
viewdnsInfo,
|
|
16
|
+
domain: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Domain",
|
|
19
|
+
description: "The domain or IP to perform a whois lookup on (e.g., example.com)",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const response = await this.viewdnsInfo.whoisLookup({
|
|
24
|
+
$,
|
|
25
|
+
params: {
|
|
26
|
+
domain: this.domain,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
$.export("$summary", `Successfully retrieved WHOIS information for ${this.domain}`);
|
|
31
|
+
|
|
32
|
+
return response;
|
|
33
|
+
},
|
|
34
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/viewdns_info",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Pipedream ViewDNS.info Components",
|
|
5
5
|
"main": "viewdns_info.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^3.1.1"
|
|
14
17
|
}
|
|
15
18
|
}
|
package/viewdns_info.app.mjs
CHANGED
|
@@ -1,11 +1,95 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
type: "app",
|
|
3
5
|
app: "viewdns_info",
|
|
4
6
|
propDefinitions: {},
|
|
5
7
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
_baseUrl() {
|
|
9
|
+
return "https://api.viewdns.info";
|
|
10
|
+
},
|
|
11
|
+
_makeRequest({
|
|
12
|
+
$ = this, path, params = {}, ...opts
|
|
13
|
+
}) {
|
|
14
|
+
return axios($, {
|
|
15
|
+
url: `${this._baseUrl()}${path}`,
|
|
16
|
+
params: {
|
|
17
|
+
...params,
|
|
18
|
+
apikey: `${this.$auth.api_key}`,
|
|
19
|
+
output: "json",
|
|
20
|
+
},
|
|
21
|
+
...opts,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
whoisLookup(opts = {}) {
|
|
25
|
+
return this._makeRequest({
|
|
26
|
+
path: "/whois/v2",
|
|
27
|
+
...opts,
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
reverseWhoisLookup(opts = {}) {
|
|
31
|
+
return this._makeRequest({
|
|
32
|
+
path: "/reversewhois/",
|
|
33
|
+
...opts,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
subdomainDiscovery(opts = {}) {
|
|
37
|
+
return this._makeRequest({
|
|
38
|
+
path: "/subdomains/",
|
|
39
|
+
...opts,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
reverseIpLookup(opts = {}) {
|
|
43
|
+
return this._makeRequest({
|
|
44
|
+
path: "/reverseip/",
|
|
45
|
+
...opts,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
ipHistory(opts = {}) {
|
|
49
|
+
return this._makeRequest({
|
|
50
|
+
path: "/iphistory/",
|
|
51
|
+
...opts,
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
dnsLookup(opts = {}) {
|
|
55
|
+
return this._makeRequest({
|
|
56
|
+
path: "/dnsrecord/",
|
|
57
|
+
...opts,
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
async *paginate({
|
|
61
|
+
fn, args, resourceKey, max,
|
|
62
|
+
}) {
|
|
63
|
+
args = {
|
|
64
|
+
...args,
|
|
65
|
+
params: {
|
|
66
|
+
...args?.params,
|
|
67
|
+
page: 1,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
let totalPages, count = 0;
|
|
71
|
+
do {
|
|
72
|
+
const { response } = await fn(args);
|
|
73
|
+
const items = response[resourceKey];
|
|
74
|
+
if (!items?.length) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
for (const item of items) {
|
|
78
|
+
yield item;
|
|
79
|
+
if (max && ++count >= max) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
totalPages = +response.total_pages;
|
|
84
|
+
args.params.page++;
|
|
85
|
+
} while (totalPages > args.params.page);
|
|
86
|
+
},
|
|
87
|
+
async getPaginatedResources(opts) {
|
|
88
|
+
const results = [];
|
|
89
|
+
for await (const item of this.paginate(opts)) {
|
|
90
|
+
results.push(item);
|
|
91
|
+
}
|
|
92
|
+
return results;
|
|
9
93
|
},
|
|
10
94
|
},
|
|
11
|
-
};
|
|
95
|
+
};
|