From e811d1792b094976cd8cc1a6b0430ae99fb2c64e Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Tue, 22 Jul 2025 13:52:19 -0400 Subject: [PATCH 1/2] new components --- .../dns-record-lookup/dns-record-lookup.mjs | 36 ++++++++ .../actions/ip-history/ip-history.mjs | 29 ++++++ .../reverse-ip-lookup/reverse-ip-lookup.mjs | 35 ++++++++ .../reverse-whois-lookup.mjs | 35 ++++++++ .../subdomain-discovery.mjs | 35 ++++++++ .../actions/whois-lookup/whois-lookup.mjs | 29 ++++++ components/viewdns_info/package.json | 7 +- components/viewdns_info/viewdns_info.app.mjs | 90 ++++++++++++++++++- 8 files changed, 291 insertions(+), 5 deletions(-) create mode 100644 components/viewdns_info/actions/dns-record-lookup/dns-record-lookup.mjs create mode 100644 components/viewdns_info/actions/ip-history/ip-history.mjs create mode 100644 components/viewdns_info/actions/reverse-ip-lookup/reverse-ip-lookup.mjs create mode 100644 components/viewdns_info/actions/reverse-whois-lookup/reverse-whois-lookup.mjs create mode 100644 components/viewdns_info/actions/subdomain-discovery/subdomain-discovery.mjs create mode 100644 components/viewdns_info/actions/whois-lookup/whois-lookup.mjs diff --git a/components/viewdns_info/actions/dns-record-lookup/dns-record-lookup.mjs b/components/viewdns_info/actions/dns-record-lookup/dns-record-lookup.mjs new file mode 100644 index 0000000000000..bdff660c6f50e --- /dev/null +++ b/components/viewdns_info/actions/dns-record-lookup/dns-record-lookup.mjs @@ -0,0 +1,36 @@ +import viewdnsInfo from "../../viewdns_info.app.mjs"; + +export default { + key: "viewdns_info-dns-record-lookup", + name: "DNS Record Lookup", + 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/)", + version: "0.0.1", + type: "action", + props: { + viewdnsInfo, + domain: { + type: "string", + label: "Domain", + description: "The hostname to retrieve DNS records for (e.g., example.com).", + }, + recordType: { + type: "string", + label: "Record Type", + description: "The type of DNS record to retrieve (e.g., A,AAAA,MX,TXT,ANY).", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.viewdnsInfo.dnsLookup({ + $, + params: { + domain: this.domain, + recordtype: this.recordType, + }, + }); + + $.export("$summary", `Retrieved DNS records for ${this.domain}.`); + + return response; + }, +}; diff --git a/components/viewdns_info/actions/ip-history/ip-history.mjs b/components/viewdns_info/actions/ip-history/ip-history.mjs new file mode 100644 index 0000000000000..257fb0ad978cb --- /dev/null +++ b/components/viewdns_info/actions/ip-history/ip-history.mjs @@ -0,0 +1,29 @@ +import viewdnsInfo from "../../viewdns_info.app.mjs"; + +export default { + key: "viewdns_info-ip-history", + name: "IP History", + description: "Retrieves the IP address history for a domain. [See the documentation](https://viewdns.info/api/ip-history/)", + version: "0.0.1", + type: "action", + props: { + viewdnsInfo, + domain: { + type: "string", + label: "Domain", + description: "The domain name to retrieve the historical IP addresses for (e.g., example.com).", + }, + }, + async run({ $ }) { + const response = await this.viewdnsInfo.ipHistory({ + $, + params: { + domain: this.domain, + }, + }); + + $.export("$summary", `Retrieved IP history for ${this.domain}.`); + + return response; + }, +}; diff --git a/components/viewdns_info/actions/reverse-ip-lookup/reverse-ip-lookup.mjs b/components/viewdns_info/actions/reverse-ip-lookup/reverse-ip-lookup.mjs new file mode 100644 index 0000000000000..3fdc4d3ea07ad --- /dev/null +++ b/components/viewdns_info/actions/reverse-ip-lookup/reverse-ip-lookup.mjs @@ -0,0 +1,35 @@ +import viewdnsInfo from "../../viewdns_info.app.mjs"; + +export default { + key: "viewdns_info-reverse-ip-lookup", + name: "Reverse IP Lookup", + 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/)", + version: "0.0.1", + type: "action", + props: { + viewdnsInfo, + host: { + type: "string", + label: "Host", + description: "The domain or IP to perform the reverse IP lookup on (e.g., example.com)", + }, + }, + async run({ $ }) { + const results = await this.viewdnsInfo.getPaginatedResources({ + fn: this.viewdnsInfo.reverseIpLookup, + args: { + $, + params: { + host: this.host, + }, + }, + resourceKey: "domains", + }); + + $.export("$summary", `Found ${results.length} domain${results.length === 1 + ? "" + : "s"} hosted on the IP address.`); + + return results; + }, +}; diff --git a/components/viewdns_info/actions/reverse-whois-lookup/reverse-whois-lookup.mjs b/components/viewdns_info/actions/reverse-whois-lookup/reverse-whois-lookup.mjs new file mode 100644 index 0000000000000..74bbd544c0809 --- /dev/null +++ b/components/viewdns_info/actions/reverse-whois-lookup/reverse-whois-lookup.mjs @@ -0,0 +1,35 @@ +import viewdnsInfo from "../../viewdns_info.app.mjs"; + +export default { + key: "viewdns_info-reverse-whois-lookup", + name: "Reverse Whois Lookup", + 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/)", + version: "0.0.1", + type: "action", + props: { + viewdnsInfo, + q: { + type: "string", + label: "Query", + description: "The registrant name or email address to search for (e.g., domain@example.com).", + }, + }, + async run({ $ }) { + const results = await this.viewdnsInfo.getPaginatedResources({ + fn: this.viewdnsInfo.reverseWhoisLookup, + args: { + $, + params: { + q: this.q, + }, + }, + resourceKey: "matches", + }); + + $.export("$summary", `Found ${results.length} domain${results.length === 1 + ? "" + : "s"} matching the query.`); + + return results; + }, +}; diff --git a/components/viewdns_info/actions/subdomain-discovery/subdomain-discovery.mjs b/components/viewdns_info/actions/subdomain-discovery/subdomain-discovery.mjs new file mode 100644 index 0000000000000..43bc73afad03a --- /dev/null +++ b/components/viewdns_info/actions/subdomain-discovery/subdomain-discovery.mjs @@ -0,0 +1,35 @@ +import viewdnsInfo from "../../viewdns_info.app.mjs"; + +export default { + key: "viewdns_info-subdomain-discovery", + name: "Subdomain Discovery", + description: "Discovers subdomains associated with a given domain. [See the documentation](https://viewdns.info/api/subdomain-discovery/)", + version: "0.0.1", + type: "action", + props: { + viewdnsInfo, + domain: { + type: "string", + label: "Domain", + description: "The domain name to retrieve subdomains for (e.g., example.com).", + }, + }, + async run({ $ }) { + const results = await this.viewdnsInfo.getPaginatedResources({ + fn: this.viewdnsInfo.subdomainDiscovery, + args: { + $, + params: { + domain: this.domain, + }, + }, + resourceKey: "subdomains", + }); + + $.export("$summary", `Found ${results.length} subdomain${results.length === 1 + ? "" + : "s"} for ${this.domain}.`); + + return results; + }, +}; diff --git a/components/viewdns_info/actions/whois-lookup/whois-lookup.mjs b/components/viewdns_info/actions/whois-lookup/whois-lookup.mjs new file mode 100644 index 0000000000000..4d2cae4d7064a --- /dev/null +++ b/components/viewdns_info/actions/whois-lookup/whois-lookup.mjs @@ -0,0 +1,29 @@ +import viewdnsInfo from "../../viewdns_info.app.mjs"; + +export default { + key: "viewdns_info-whois-lookup", + name: "Whois Lookup", + description: "Performs a WHOIS lookup to retrieve domain registration information. [See the documentation](https://viewdns.info/api/whois/)", + version: "0.0.1", + type: "action", + props: { + viewdnsInfo, + domain: { + type: "string", + label: "Domain", + description: "The domain or IP to perform a whois lookup on (e.g., example.com)", + }, + }, + async run({ $ }) { + const response = await this.viewdnsInfo.whoisLookup({ + $, + params: { + domain: this.domain, + }, + }); + + $.export("$summary", `Successfully retrieved WHOIS information for ${this.domain}`); + + return response; + }, +}; diff --git a/components/viewdns_info/package.json b/components/viewdns_info/package.json index 9445adfe52941..8230b91f9e7bc 100644 --- a/components/viewdns_info/package.json +++ b/components/viewdns_info/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/viewdns_info", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream ViewDNS.info Components", "main": "viewdns_info.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} diff --git a/components/viewdns_info/viewdns_info.app.mjs b/components/viewdns_info/viewdns_info.app.mjs index 24b2cb770b1e3..6162f4764374a 100644 --- a/components/viewdns_info/viewdns_info.app.mjs +++ b/components/viewdns_info/viewdns_info.app.mjs @@ -1,11 +1,95 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "viewdns_info", propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.viewdns.info"; + }, + _makeRequest({ + $ = this, path, params = {}, ...opts + }) { + return axios($, { + url: `${this._baseUrl()}${path}`, + params: { + ...params, + apikey: `${this.$auth.api_key}`, + output: "json", + }, + ...opts, + }); + }, + whoisLookup(opts = {}) { + return this._makeRequest({ + path: "/whois/v2", + ...opts, + }); + }, + reverseWhoisLookup(opts = {}) { + return this._makeRequest({ + path: "/reversewhois/", + ...opts, + }); + }, + subdomainDiscovery(opts = {}) { + return this._makeRequest({ + path: "/subdomains/", + ...opts, + }); + }, + reverseIpLookup(opts = {}) { + return this._makeRequest({ + path: "/reverseip/", + ...opts, + }); + }, + ipHistory(opts = {}) { + return this._makeRequest({ + path: "/iphistory/", + ...opts, + }); + }, + dnsLookup(opts = {}) { + return this._makeRequest({ + path: "/dnsrecord/", + ...opts, + }); + }, + async *paginate({ + fn, args, resourceKey, max, + }) { + args = { + ...args, + params: { + ...args?.params, + page: 1, + }, + }; + let totalPages, count = 0; + do { + const { response } = await fn(args); + const items = response[resourceKey]; + if (!items?.length) { + return; + } + for (const item of items) { + yield item; + if (max && ++count >= max) { + return; + } + } + totalPages = +response.total_pages; + args.params.page++; + } while (totalPages > args.params.page); + }, + async getPaginatedResources(opts) { + const results = []; + for await (const item of this.paginate(opts)) { + results.push(item); + } + return results; }, }, }; From 5eb5fab177239cfcb94181e92d32ec92b5f6900f Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Tue, 22 Jul 2025 13:53:14 -0400 Subject: [PATCH 2/2] pnpm-lock.yaml --- pnpm-lock.yaml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58a3859a8ef1e..158c2bf99e087 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1042,8 +1042,7 @@ importers: components/ascora: {} - components/ashby_job_postings_api: - specifiers: {} + components/ashby_job_postings_api: {} components/asin_data_api: {} @@ -2593,8 +2592,7 @@ importers: specifier: ^0.0.1-security version: 0.0.1-security - components/click_sign: - specifiers: {} + components/click_sign: {} components/clickfunnels: dependencies: @@ -6204,8 +6202,7 @@ importers: components/helpdesk: {} - components/helpdocs: - specifiers: {} + components/helpdocs: {} components/helper_functions: dependencies: @@ -14674,7 +14671,11 @@ importers: specifier: ^1.2.5 version: 1.2.7 - components/viewdns_info: {} + components/viewdns_info: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/vimeo: dependencies: @@ -16154,7 +16155,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.30))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.4)(typescript@5.7.2)(yaml@2.6.1) @@ -16197,7 +16198,7 @@ importers: version: 3.1.0 jest: specifier: ^29.1.2 - version: 29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0) type-fest: specifier: ^4.15.0 version: 4.27.0 @@ -37305,6 +37306,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: @@ -51386,7 +51389,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -51400,10 +51403,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 8.0.0-alpha.13 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) + babel-jest: 29.7.0(@babel/core@7.26.0) ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: