Skip to content

New Components - whoisfreaks #15453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions components/whoisfreaks/actions/domain-lookup/domain-lookup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import whoisfreaks from "../../whoisfreaks.app.mjs";

export default {
key: "whoisfreaks-domain-lookup",
name: "Domain Lookup",
description: "Retrieve details about a domain name. [See the documentation](https://whoisfreaks.com/products/whois-api#live_lookup)",
version: "0.0.1",
type: "action",
props: {
whoisfreaks,
domainName: {
propDefinition: [
whoisfreaks,
"domainName",
],
},
lookupType: {
type: "string",
label: "Lookup Type",
description: "Whether to perform a `live` or `historical` lookup",
options: [
"live",
"historical",
],
},
format: {
propDefinition: [
whoisfreaks,
"format",
],
},
},
async run({ $ }) {
const response = await this.whoisfreaks.domainLookup({
$,
params: {
domainName: this.domainName,
whois: this.lookupType,
format: this.format,
},
});
$.export("$summary", `Successfully performed lookup for domain ${this.domainName}`);
return response;
},
};
34 changes: 34 additions & 0 deletions components/whoisfreaks/actions/ip-lookup/ip-lookup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import whoisfreaks from "../../whoisfreaks.app.mjs";

export default {
key: "whoisfreaks-ip-lookup",
name: "IP Lookup",
description: "Retrieve information about an IP address. [See the documentation](https://whoisfreaks.com/products/whois-api#ip_lookup)",
version: "0.0.1",
type: "action",
props: {
whoisfreaks,
ip: {
type: "string",
label: "IP",
description: "IPv4 or IPv6 address for the requested whois",
},
format: {
propDefinition: [
whoisfreaks,
"format",
],
},
},
async run({ $ }) {
const response = await this.whoisfreaks.ipLookup({
$,
params: {
ip: this.ip,
format: this.format,
},
});
$.export("$summary", `Successfully performed lookup for IP ${this.ip}`);
return response;
},
};
76 changes: 76 additions & 0 deletions components/whoisfreaks/actions/reverse-lookup/reverse-lookup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import whoisfreaks from "../../whoisfreaks.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
key: "whoisfreaks-reverse-lookup",
name: "Reverse Lookup",
description: "Retrieve details about a domain by keyword, email, registrant name or company. [See the documentation](https://whoisfreaks.com/products/whois-api#reverse_lookup)",
version: "0.0.1",
type: "action",
props: {
whoisfreaks,
keyword: {
type: "string",
label: "Keyword",
description: "Keyword search utilizes case-insensitive Pattern Matching search technique to search in our historical database. For example, `whoisfreaks` matches with any keyword that have the searched pattern like `mywhoisfreaks` and `whoisfreakscom`.",
optional: true,
},
email: {
type: "string",
label: "Email",
description: "Email search uses case-insensitive exact matching technique to search in our historical database. For example, `[email protected]` matches only with `[email protected]`.",
optional: true,
},
owner: {
type: "string",
label: "Owner",
description: "The owner name for requested whois",
optional: true,
},
company: {
type: "string",
label: "Company",
description: "Registrant name or Company search use full-text search technique to search in our historical database. For example, `whoisfreaks` matched with `whoisfreaks`, `whoisfreak`, `whois`, `mywhoisfreaks` and `whoisfreakscom`.",
optional: true,
},
format: {
propDefinition: [
whoisfreaks,
"format",
],
},
page: {
type: "integer",
label: "Page",
description: "For getting next or desired page of whois info. Default: `1`",
default: 1,
optional: true,
},
},
async run({ $ }) {
if ([
this.keyword,
this.email,
this.owner,
this.company,
].filter((v) => v !== undefined).length !== 1) {
throw new ConfigurationError("Must enter one and only one of `keyword`, `email`, `owner`, or `company`");
}

const response = await this.whoisfreaks.domainLookup({
$,
params: {
keyword: this.keyword,
email: this.email,
owner: this.owner,
company: this.company,
whois: "reverse",
format: this.format,
page: this.page,
},
});

$.export("$summary", "Successfully performed reverse lookup");
return response;
},
};
7 changes: 5 additions & 2 deletions components/whoisfreaks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/whoisfreaks",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream WhoisFreaks Components",
"main": "whoisfreaks.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
}
54 changes: 49 additions & 5 deletions components/whoisfreaks/whoisfreaks.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,55 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "whoisfreaks",
propDefinitions: {},
propDefinitions: {
domainName: {
type: "string",
label: "Domain Name",
description: "The domain name to lookup",
},
format: {
type: "string",
label: "Format",
description: "Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.",
options: [
"JSON",
"XML",
],
optional: true,
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.whoisfreaks.com/v1.0";
},
_makeRequest({
$ = this,
path,
params,
...opts
}) {
return axios($, {
url: `${this._baseUrl()}${path}`,
params: {
...params,
apiKey: this.$auth.api_key,
},
...opts,
});
},
domainLookup(opts = {}) {
return this._makeRequest({
path: "/whois",
...opts,
});
},
ipLookup(opts = {}) {
return this._makeRequest({
path: "/ip-whois",
...opts,
});
},
},
};
};
12 changes: 7 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading