-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
New Components - whoisfreaks #15453
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
components/whoisfreaks/actions/domain-lookup/domain-lookup.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
76
components/whoisfreaks/actions/reverse-lookup/reverse-lookup.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [ | ||
|
@@ -11,5 +11,8 @@ | |
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pipedream/platform": "^3.0.3" | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
domainLookup(opts = {}) { | ||
return this._makeRequest({ | ||
path: "/whois", | ||
...opts, | ||
}); | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ipLookup(opts = {}) { | ||
return this._makeRequest({ | ||
path: "/ip-whois", | ||
...opts, | ||
}); | ||
}, | ||
}, | ||
}; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.