-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[Components] hunter - new components #17083
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
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions
20
components/hunter/actions/account-information/account-information.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,20 @@ | ||
import app from "../../hunter.app.mjs"; | ||
|
||
export default { | ||
key: "hunter-account-information", | ||
name: "Account Information", | ||
description: "Get information about your Hunter account. [See the documentation](https://hunter.io/api-documentation/v2#account).", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.app.accountInformation({ | ||
$, | ||
}); | ||
|
||
$.export("$summary", "Successfully retrieved account information"); | ||
return response; | ||
}, | ||
}; |
34 changes: 34 additions & 0 deletions
34
components/hunter/actions/combined-enrichment/combined-enrichment.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,34 @@ | ||
import app from "../../hunter.app.mjs"; | ||
|
||
export default { | ||
key: "hunter-combined-enrichment", | ||
name: "Combined Enrichment", | ||
description: "Returns all the information associated with an email address and its domain name. [See the documentation](https://hunter.io/api-documentation/v2#combined-enrichment).", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
email: { | ||
propDefinition: [ | ||
app, | ||
"email", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
app, | ||
email, | ||
} = this; | ||
|
||
const response = await app.combinedEnrichment({ | ||
$, | ||
params: { | ||
email, | ||
}, | ||
}); | ||
|
||
$.export("$summary", "Successfully retrieved combined enrichment data"); | ||
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,206 @@ | ||
import app from "../../hunter.app.mjs"; | ||
|
||
export default { | ||
key: "hunter-create-lead", | ||
name: "Create Lead", | ||
description: "Create a new lead in your Hunter account. [See the documentation](https://hunter.io/api-documentation/v2#create-lead).", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
email: { | ||
propDefinition: [ | ||
app, | ||
"email", | ||
], | ||
description: "The email address of the lead.", | ||
}, | ||
firstName: { | ||
propDefinition: [ | ||
app, | ||
"firstName", | ||
], | ||
description: "The first name of the lead.", | ||
optional: true, | ||
}, | ||
lastName: { | ||
propDefinition: [ | ||
app, | ||
"lastName", | ||
], | ||
description: "The last name of the lead.", | ||
optional: true, | ||
}, | ||
position: { | ||
propDefinition: [ | ||
app, | ||
"position", | ||
], | ||
description: "The job title of the lead.", | ||
optional: true, | ||
}, | ||
company: { | ||
propDefinition: [ | ||
app, | ||
"company", | ||
], | ||
description: "The name of the company the lead is working in.", | ||
optional: true, | ||
}, | ||
companyIndustry: { | ||
type: "string", | ||
label: "Company Industry", | ||
description: "The sector of the company.", | ||
options: [ | ||
"Animal", | ||
"Art & Entertainment", | ||
"Automotive", | ||
"Beauty & Fitness", | ||
"Books & Literature", | ||
"Education & Career", | ||
"Finance", | ||
"Food & Drink", | ||
"Game", | ||
"Health", | ||
"Hobby & Leisure", | ||
"Home & Garden", | ||
"Industry", | ||
"Internet & Telecom", | ||
"Law & Government", | ||
"Manufacturing", | ||
"News", | ||
"Real Estate", | ||
"Science", | ||
"Retail", | ||
"Sport", | ||
"Technology", | ||
"Travel", | ||
], | ||
optional: true, | ||
}, | ||
companySize: { | ||
propDefinition: [ | ||
app, | ||
"companySize", | ||
], | ||
description: "The size of the company the lead is working in.", | ||
optional: true, | ||
}, | ||
confidenceScore: { | ||
type: "integer", | ||
label: "Confidence Score", | ||
description: "Estimation of the probability the email address returned is correct, between 0 and 100.", | ||
min: 0, | ||
max: 100, | ||
optional: true, | ||
}, | ||
website: { | ||
propDefinition: [ | ||
app, | ||
"website", | ||
], | ||
description: "The domain name of the company.", | ||
optional: true, | ||
}, | ||
countryCode: { | ||
propDefinition: [ | ||
app, | ||
"countryCode", | ||
], | ||
description: "The country of the lead (ISO 3166-1 alpha-2 standard).", | ||
optional: true, | ||
}, | ||
linkedinUrl: { | ||
propDefinition: [ | ||
app, | ||
"linkedinUrl", | ||
], | ||
description: "The address of the public profile on LinkedIn.", | ||
optional: true, | ||
}, | ||
phoneNumber: { | ||
propDefinition: [ | ||
app, | ||
"phoneNumber", | ||
], | ||
description: "The phone number of the lead.", | ||
optional: true, | ||
}, | ||
twitter: { | ||
propDefinition: [ | ||
app, | ||
"twitter", | ||
], | ||
description: "The Twitter handle of the lead.", | ||
optional: true, | ||
}, | ||
notes: { | ||
type: "string", | ||
label: "Notes", | ||
description: "Some personal notes about the lead.", | ||
optional: true, | ||
}, | ||
source: { | ||
propDefinition: [ | ||
app, | ||
"source", | ||
], | ||
description: "The source where the lead has been found.", | ||
optional: true, | ||
}, | ||
leadsListId: { | ||
propDefinition: [ | ||
app, | ||
"leadsListId", | ||
], | ||
description: "The identifier of the list the lead belongs to. If not specified, the lead is saved in the last list created.", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
app, | ||
email, | ||
firstName, | ||
lastName, | ||
position, | ||
company, | ||
companyIndustry, | ||
companySize, | ||
confidenceScore, | ||
website, | ||
countryCode, | ||
linkedinUrl, | ||
phoneNumber, | ||
twitter, | ||
notes, | ||
source, | ||
leadsListId, | ||
} = this; | ||
|
||
const response = await app.createLead({ | ||
$, | ||
data: { | ||
email, | ||
first_name: firstName, | ||
last_name: lastName, | ||
position, | ||
company, | ||
company_industry: companyIndustry, | ||
company_size: companySize, | ||
confidence_score: confidenceScore, | ||
website, | ||
country_code: countryCode, | ||
linkedin_url: linkedinUrl, | ||
phone_number: phoneNumber, | ||
twitter, | ||
notes, | ||
source, | ||
leads_list_id: leadsListId, | ||
}, | ||
}); | ||
|
||
$.export("$summary", "Successfully created lead"); | ||
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 app from "../../hunter.app.mjs"; | ||
|
||
export default { | ||
key: "hunter-delete-lead", | ||
name: "Delete Lead", | ||
description: "Delete an existing lead from your Hunter account. [See the documentation](https://hunter.io/api-documentation/v2#delete-lead).", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
leadId: { | ||
propDefinition: [ | ||
app, | ||
"leadId", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
app, | ||
leadId, | ||
} = this; | ||
|
||
await app.deleteLead({ | ||
$, | ||
leadId, | ||
}); | ||
|
||
$.export("$summary", "Successfully deleted lead"); | ||
return { | ||
success: true, | ||
}; | ||
}, | ||
}; |
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.