Skip to content

Commit 9064111

Browse files
committed
[Components] hunter - new components
1 parent da4e8b8 commit 9064111

File tree

9 files changed

+418
-17
lines changed

9 files changed

+418
-17
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import app from "../../hunter.app.mjs";
2+
3+
export default {
4+
key: "hunter-account-information",
5+
name: "Account Information",
6+
description: "Get information about your Hunter account. [See the documentation](https://hunter.io/api-documentation/v2#account).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const response = await this.app.accountInformation({
14+
$,
15+
});
16+
17+
$.export("$summary", "Successfully retrieved account information");
18+
return response;
19+
},
20+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import app from "../../hunter.app.mjs";
2+
3+
export default {
4+
key: "hunter-combined-enrichment",
5+
name: "Combined Enrichment",
6+
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).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
email: {
12+
propDefinition: [
13+
app,
14+
"email",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const {
20+
app,
21+
email,
22+
} = this;
23+
24+
const response = await app.combinedEnrichment({
25+
$,
26+
params: {
27+
email,
28+
},
29+
});
30+
31+
$.export("$summary", "Successfully retrieved combined enrichment data");
32+
return response;
33+
},
34+
};
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import app from "../../hunter.app.mjs";
3+
4+
export default {
5+
key: "hunter-domain-search",
6+
name: "Domain Search",
7+
description: "Search all the email addresses corresponding to one website or company. [See the documentation](https://hunter.io/api-documentation/v2#domain-search).",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
domain: {
13+
propDefinition: [
14+
app,
15+
"domain",
16+
],
17+
optional: true,
18+
},
19+
company: {
20+
propDefinition: [
21+
app,
22+
"company",
23+
],
24+
optional: true,
25+
},
26+
limit: {
27+
propDefinition: [
28+
app,
29+
"limit",
30+
],
31+
},
32+
type: {
33+
propDefinition: [
34+
app,
35+
"type",
36+
],
37+
},
38+
seniority: {
39+
type: "string[]",
40+
label: "Seniority",
41+
description: "Get only email addresses for people with the selected seniority level(s).",
42+
options: [
43+
"junior",
44+
"senior",
45+
"executive",
46+
],
47+
optional: true,
48+
},
49+
department: {
50+
type: "string[]",
51+
label: "Department",
52+
description: "Get only email addresses for people working in the selected department(s).",
53+
options: [
54+
"executive",
55+
"it",
56+
"finance",
57+
"management",
58+
"sales",
59+
"legal",
60+
"support",
61+
"hr",
62+
"marketing",
63+
"communication",
64+
"education",
65+
"design",
66+
"health",
67+
"operations",
68+
],
69+
optional: true,
70+
},
71+
},
72+
async run({ $ }) {
73+
const {
74+
app,
75+
domain,
76+
company,
77+
type,
78+
seniority,
79+
department,
80+
} = this;
81+
82+
if (!domain && !company) {
83+
throw new ConfigurationError("You must provide either a **Domain** or **Company** name");
84+
}
85+
86+
const response = await app.domainSearch({
87+
$,
88+
params: {
89+
domain,
90+
company,
91+
type,
92+
...(Array.isArray(seniority) && seniority.length && {
93+
seniority: seniority.join(","),
94+
}),
95+
...(Array.isArray(department) && department.length && {
96+
department: department.join(","),
97+
}),
98+
limit: 100,
99+
},
100+
});
101+
102+
$.export("$summary", "Successfully searched for email addresses");
103+
return response;
104+
},
105+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import app from "../../hunter.app.mjs";
3+
4+
export default {
5+
key: "hunter-email-count",
6+
name: "Email Count",
7+
description: "Get the number of email addresses Hunter has for one domain or company. [See the documentation](https://hunter.io/api-documentation/v2#email-count).",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
domain: {
13+
propDefinition: [
14+
app,
15+
"domain",
16+
],
17+
optional: true,
18+
},
19+
company: {
20+
propDefinition: [
21+
app,
22+
"company",
23+
],
24+
optional: true,
25+
},
26+
type: {
27+
propDefinition: [
28+
app,
29+
"type",
30+
],
31+
},
32+
},
33+
async run({ $ }) {
34+
const {
35+
app,
36+
domain,
37+
company,
38+
type,
39+
} = this;
40+
41+
if (!domain && !company) {
42+
throw new ConfigurationError("You must provide either a **Domain** or **Company** name");
43+
}
44+
45+
const response = await app.emailCount({
46+
$,
47+
params: {
48+
domain,
49+
company,
50+
type,
51+
},
52+
});
53+
54+
$.export("$summary", "Successfully retrieved email count");
55+
return response;
56+
},
57+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import app from "../../hunter.app.mjs";
3+
4+
export default {
5+
key: "hunter-email-finder",
6+
name: "Email Finder",
7+
description: "Find the most likely email address from a domain name, a first name and a last name. [See the documentation](https://hunter.io/api-documentation/v2#email-finder).",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
domain: {
13+
propDefinition: [
14+
app,
15+
"domain",
16+
],
17+
optional: true,
18+
},
19+
company: {
20+
propDefinition: [
21+
app,
22+
"company",
23+
],
24+
optional: true,
25+
},
26+
firstName: {
27+
propDefinition: [
28+
app,
29+
"firstName",
30+
],
31+
},
32+
lastName: {
33+
propDefinition: [
34+
app,
35+
"lastName",
36+
],
37+
},
38+
},
39+
async run({ $ }) {
40+
const {
41+
app,
42+
domain,
43+
company,
44+
firstName,
45+
lastName,
46+
} = this;
47+
48+
if (!domain && !company) {
49+
throw new ConfigurationError("You must provide either a **Domain** or **Company** name");
50+
}
51+
52+
const response = await app.emailFinder({
53+
$,
54+
params: {
55+
domain,
56+
company,
57+
first_name: firstName,
58+
last_name: lastName,
59+
},
60+
});
61+
62+
$.export("$summary", "Successfully searched for email address");
63+
return response;
64+
},
65+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import app from "../../hunter.app.mjs";
2+
3+
export default {
4+
key: "hunter-email-verifier",
5+
name: "Email Verifier",
6+
description: "Check the deliverability of a given email address, verify if it has been found in Hunter's database, and return their sources. [See the documentation](https://hunter.io/api-documentation/v2#email-verifier).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
email: {
12+
propDefinition: [
13+
app,
14+
"email",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const {
20+
app,
21+
email,
22+
} = this;
23+
24+
const response = await app.emailVerifier({
25+
$,
26+
params: {
27+
email,
28+
},
29+
});
30+
31+
$.export("$summary", "Successfully verified email address");
32+
return response;
33+
},
34+
};

0 commit comments

Comments
 (0)