Skip to content

Commit 0e2a7b9

Browse files
committed
add props to people-enrichment
1 parent 70aca9e commit 0e2a7b9

File tree

2 files changed

+90
-2
lines changed

2 files changed

+90
-2
lines changed

components/apollo_io/actions/people-enrichment/people-enrichment.mjs

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "People Enrichment",
66
description: "Enriches a person's information, the more information you pass in, the more likely we can find a match. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#people-enrichment)",
77
type: "action",
8-
version: "0.0.4",
8+
version: "0.0.5",
99
props: {
1010
app,
1111
firstName: {
@@ -20,20 +20,92 @@ export default {
2020
description: "The person's last name",
2121
optional: true,
2222
},
23+
name: {
24+
type: "string",
25+
label: "Name",
26+
description: "The full name of the person",
27+
optional: true,
28+
},
2329
email: {
2430
type: "string",
2531
label: "Email",
2632
description: "The person's email",
2733
optional: true,
2834
},
35+
hashedEmail: {
36+
type: "string",
37+
label: "Hashed Email",
38+
description: "The hashed email of the person. The email should adhere to either the MD5 or SHA-256 hash format. Example: `8d935115b9ff4489f2d1f9249503cadf` (MD5) or `97817c0c49994eb500ad0a5e7e2d8aed51977b26424d508f66e4e8887746a152` (SHA-256)",
39+
optional: true,
40+
},
2941
organizationName: {
3042
type: "string",
3143
label: "Organization Name",
3244
description: "The person's company name",
3345
optional: true,
3446
},
47+
domain: {
48+
type: "string",
49+
label: "Domain",
50+
description: "The domain name for the person's employer. This can be the current employer or a previous employer. Do not include `www.`, the `@` symbol, or similar. Example: `apollo.io` or `microsoft.com`",
51+
optional: true,
52+
},
53+
personId: {
54+
type: "string",
55+
label: "Person ID",
56+
description: "The Apollo ID for the person",
57+
optional: true,
58+
async options({ page }) {
59+
const { people } = await this.peopleSearch({
60+
params: {
61+
page: page + 1,
62+
},
63+
});
64+
return people?.map(({
65+
id: value, name: label,
66+
}) => ({
67+
value,
68+
label,
69+
})) || [];
70+
},
71+
},
72+
linkedinUrl: {
73+
type: "string",
74+
label: "LinkedIn URL",
75+
description: "The URL for the person's LinkedIn profile",
76+
optional: true,
77+
},
78+
revealPersonalEmails: {
79+
type: "boolean",
80+
label: "Reveal Personal Emails",
81+
description: "Set to `true` if you want to enrich the person's data with personal emails",
82+
optional: true,
83+
},
84+
revealPhoneNumber: {
85+
type: "boolean",
86+
label: "Reveal Phone Number",
87+
description: "Set to `true` if you want to enrich the person's data with all available phone numbers, including mobile phone numbers",
88+
optional: true,
89+
reloadProps: true,
90+
},
91+
},
92+
async additionalProps() {
93+
const props = {};
94+
if (this.revealPhoneNumber) {
95+
props.webhookUrl = {
96+
type: "string",
97+
label: "Webhook URL",
98+
description: "Enter the webhook URL that specifies where Apollo should send a JSON response that includes the phone number you requested. Required if \"Reveal Phone Number\" is set to `true`",
99+
};
100+
}
101+
return props;
35102
},
36103
methods: {
104+
peopleSearch() {
105+
return this.app.post({
106+
path: "/people/search",
107+
});
108+
},
37109
peopleEnrichment(args = {}) {
38110
return this.app.post({
39111
path: "/people/match",
@@ -46,17 +118,33 @@ export default {
46118
peopleEnrichment,
47119
firstName,
48120
lastName,
121+
name,
49122
email,
123+
hashedEmail,
50124
organizationName,
125+
domain,
126+
personId,
127+
linkedinUrl,
128+
revealPersonalEmails,
129+
revealPhoneNumber,
130+
webhookUrl,
51131
} = this;
52132

53133
const response = await peopleEnrichment({
54134
step,
55135
data: {
56136
first_name: firstName,
57137
last_name: lastName,
138+
name,
58139
email,
140+
hashed_email: hashedEmail,
59141
organization_name: organizationName,
142+
domain,
143+
id: personId,
144+
linkedin_url: linkedinUrl,
145+
reveal_personal_emails: revealPersonalEmails,
146+
reveal_phone_number: revealPhoneNumber,
147+
webhook_url: webhookUrl,
60148
},
61149
});
62150

components/apollo_io/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/apollo_io",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Pipedream Apollo.io Components",
55
"main": "apollo_io.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)