Skip to content
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
46 changes: 46 additions & 0 deletions components/prospeo/actions/extract-data/extract-data.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { ConfigurationError } from "@pipedream/platform";
import prospeo from "../../prospeo.app.mjs";

export default {
name: "Extract Data",
version: "0.0.1",
key: "prospeo-extract-data",
description: "Extract data from any LinkedIn profile in real-time, as well as all the data from the company page, and also find a valid verified email from the lead. [See the documentation](https://prospeo.io/api/social-url-enrichment)",
type: "action",
props: {
prospeo,
linkedinUrl: {
type: "string",
label: "LinkedIn URL",
description: "The LinkedIn profile URL.This endpoint is only compatible with public LinkedIn URL, and will not work with special IDs starting in `ACw..`, or `ACo...`",
},
profileOnly: {
type: "boolean",
label: "Profile Only",
description: "If true, only the profile data will be returned. If false, the company data will also be returned.",
optional: true,
},
},
async run({ $ }) {
try {
const response = await this.prospeo.extractData({
$,
data: {
url: this.linkedinUrl,
profile_only: this.profileOnly,
},
});

$.export("$summary", `Successfully extracted data for **${this.linkedinUrl}**`);

return response;
} catch ({ response }) {
if (response.data.message === "NO_RESULT") {
$.export("$summary", `No data found for **${this.linkedinUrl}**`);
return {};
} else {
throw new ConfigurationError(response.data.message);
}
}
},
};
45 changes: 45 additions & 0 deletions components/prospeo/actions/find-email/find-email.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ConfigurationError } from "@pipedream/platform";
import prospeo from "../../prospeo.app.mjs";

export default {
name: "Find Email",
version: "0.0.1",
key: "prospeo-find-email",
description: "Find an email address. [See the documentation](https://prospeo.io/api/email-finder)",
type: "action",
props: {
prospeo,
fullName: {
type: "string",
label: "Full Name",
description: "The person's full name. Prospeo advises you to submit the first and last name for higher accuracy.",
},
company: {
type: "string",
label: "Company Domain/Name",
description: "The company domain, website, or name. Using a domain or website is recommended for better accuracy. If submitting a company name, it needs to be between 3 to 75 characters.",
},
},
async run({ $ }) {
try {
const response = await this.prospeo.findEmail({
$,
data: {
company: this.company,
full_name: this.fullName,
},
});

$.export("$summary", `Successfully found email for **${this.fullName}** at **${this.company}**`);

return response;
} catch ({ response }) {
if (response.data.message === "NO_RESULT") {
$.export("$summary", `No results found for **${this.fullName}** at ${this.company}`);
return {};
} else {
throw new ConfigurationError(response.data);
}
}
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { ConfigurationError } from "@pipedream/platform";
import prospeo from "../../prospeo.app.mjs";

export default {
name: "Find Mobile Number",
version: "0.0.1",
key: "prospeo-find-mobile-number",
description: "Discover mobile numbers associated with a LinkedIn profile URL. [See the documentation](https://prospeo.io/api/mobile-finder)",
type: "action",
props: {
prospeo,
linkedinUrl: {
type: "string",
label: "LinkedIn URL",
description: "The LinkedIn profile URL.This endpoint is only compatible with public LinkedIn URL, and will not work with special IDs starting in `ACw..`, or `ACo...`",
},
},
async run({ $ }) {
try {
const response = await this.prospeo.findMobile({
$,
data: {
url: this.linkedinUrl,
},
});

$.export("$summary", `Successfully found mobile number for **${this.linkedinUrl}**`);

return response;
} catch ({ response }) {
if (response.data.message === "NO_RESULT") {
$.export("$summary", `No results found for **${this.linkedinUrl}**`);
return {};
} else {
throw new ConfigurationError(response.data.message);
}
}
},
};
61 changes: 61 additions & 0 deletions components/prospeo/actions/search-domain/search-domain.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { ConfigurationError } from "@pipedream/platform";
import { EMAIL_TYPE_OPTIONS } from "../../common/constants.mjs";
import prospeo from "../../prospeo.app.mjs";

export default {
name: "Search Domain",
version: "0.0.1",
key: "prospeo-search-domain",
description: "Discover email addresses associated with a domain name, website, or company name. [See the documentation](https://prospeo.io/api/domain-search)",
type: "action",
props: {
prospeo,
company: {
type: "string",
label: "Company Domain/Name",
description: "The company domain, website, or name. Using a domain or website is recommended for better accuracy. If submitting a company name, it needs to be between 3 to 75 characters.",
},
limit: {
type: "integer",
label: "Limit",
description: "How many emails you need. The default value is `50`. You will be charged 1 credit every 50 emails. For example, 35 emails will be charged 1 credit while 65 emails will be charged 2 credits.",
optional: true,
},
emailType: {
type: "string",
label: "Email Type",
description: "Indicates what type of email you want to get. `generic` refers to role-based emails such as `info@example.com`, while `professional` are emails of people working at the company.",
options: EMAIL_TYPE_OPTIONS,
optional: true,
},
companyEnrichment: {
type: "boolean",
label: "Company Enrichment",
description: "Indicates if you want the company details in the response. It is `false` by default. Turning it to `true` might slow-down the response time as we gather the company details.",
},
},
async run({ $ }) {
try {
const response = await this.prospeo.searchDomain({
$,
data: {
company: this.company,
limit: this.limit,
email_type: this.emailType,
enrich_company: this.companyEnrichment,
},
});

$.export("$summary", `Successfully searched domain: ${this.company}`);

return response;
} catch ({ response }) {
if (response.data.message === "NO_RESULT") {
$.export("$summary", `No results found for **${this.company}**`);
return {};
} else {
throw new ConfigurationError(response.data.message);
}
}
},
};
50 changes: 50 additions & 0 deletions components/prospeo/actions/verify-email/verify-email.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { ConfigurationError } from "@pipedream/platform";
import prospeo from "../../prospeo.app.mjs";

export default {
name: "Verify Email",
version: "0.0.1",
key: "prospeo-verify-email",
description: "Verify the validity of an email address. [See the documentation](https://prospeo.io/api/email-verifier)",
type: "action",
props: {
prospeo,
email: {
type: "string",
label: "Email",
description: "The email address to verify",
optional: true,
},
emailAnonId: {
type: "string",
label: "Email Anon ID",
description: "The ID of the email obtained from the `Search Domain` action.",
optional: true,
},
},
async run({ $ }) {
if (!this.email && !this.emailAnonId) {
throw new ConfigurationError("Either email or emailAnonId is required");
}
try {
const response = await this.prospeo.verifyEmail({
$,
data: {
email: this.email,
email_anon_id: this.emailAnonId,
},
});

$.export("$summary", `Successfully verified: ${this.email || this.emailAnonId}`);

return response;
} catch ({ response }) {
if (response.data.message === "NO_RESULT") {
$.export("$summary", `No results found for **${this.email || this.emailAnonId}**`);
return {};
} else {
throw new ConfigurationError(response.data.message);
}
}
},
};
10 changes: 10 additions & 0 deletions components/prospeo/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const EMAIL_TYPE_OPTIONS = [
{
label: "Generic",
value: "generic",
},
{
label: "Professional",
value: "professional",
},
];
7 changes: 5 additions & 2 deletions components/prospeo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/prospeo",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Prospeo Components",
"main": "prospeo.app.mjs",
"keywords": [
Expand All @@ -9,7 +9,10 @@
],
"homepage": "https://pipedream.com/apps/prospeo",
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
"dependencies": {
"@pipedream/platform": "^3.0.3"
},
"publishConfig": {
"access": "public"
}
}
}
60 changes: 55 additions & 5 deletions components/prospeo/prospeo.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,61 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "prospeo",
propDefinitions: {},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.prospeo.io";
},
_headers() {
return {
"x-key": `${this.$auth.api_key}`,
"Content-Type": "application/json",
};
},
_makeRequest({
$ = this, path, ...opts
}) {
return axios($, {
url: this._baseUrl() + path,
headers: this._headers(),
...opts,
});
},
findEmail(args = {}) {
return this._makeRequest({
method: "POST",
path: "/email-finder",
...args,
});
},
findMobile(args = {}) {
return this._makeRequest({
method: "POST",
path: "/mobile-finder",
...args,
});
},
extractData(args = {}) {
return this._makeRequest({
method: "POST",
path: "/social-url-enrichment",
...args,
});
},
searchDomain(args = {}) {
return this._makeRequest({
method: "POST",
path: "/domain-search",
...args,
});
},
verifyEmail(args = {}) {
return this._makeRequest({
method: "POST",
path: "/email-verifier",
...args,
});
},
},
};
};
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

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

Loading