Skip to content

Commit 8682e38

Browse files
committed
Added actions
1 parent 6a7ab4f commit 8682e38

File tree

5 files changed

+195
-65
lines changed

5 files changed

+195
-65
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import app from "../../emaillistverify.app.mjs";
2+
3+
export default {
4+
key: "emaillistverify-find-email",
5+
name: "Find Email",
6+
description: "Generate a series of potential email addresses by synthesizing first names, last names, and company domains. [See the documentation](https://emaillistverify.com/docs/#tag/Email-Validation-API/operation/find-contact)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
firstName: {
12+
propDefinition: [
13+
app,
14+
"firstName",
15+
],
16+
},
17+
lastName: {
18+
propDefinition: [
19+
app,
20+
"lastName",
21+
],
22+
},
23+
domain: {
24+
propDefinition: [
25+
app,
26+
"domain",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
const response = await this.app.findEmail({
32+
$,
33+
data: {
34+
first_name: this.firstName,
35+
last_name: this.lastName,
36+
domain: this.domain,
37+
},
38+
});
39+
40+
$.export("$summary", `Successfully generated ${response.length} email addresses`);
41+
42+
return response;
43+
},
44+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import app from "../../emaillistverify.app.mjs";
2+
3+
export default {
4+
key: "emaillistverify-verify-email",
5+
name: "Verify Email",
6+
description: "Verify an email. [See the documentation](https://emaillistverify.com/docs/#tag/Email-Validation-API/operation/verifyEmail)",
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 response = await this.app.verifyEmail({
20+
params: {
21+
email: this.email,
22+
},
23+
});
24+
25+
$.export("$summary", `Successfully verified the email. Result: '${response}'`);
26+
27+
return response;
28+
},
29+
};
Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,62 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "emaillistverify",
4-
propDefinitions: {},
6+
propDefinitions: {
7+
email: {
8+
type: "string",
9+
label: "Email",
10+
description: "Email to be verified",
11+
},
12+
firstName: {
13+
type: "string",
14+
label: "First Name",
15+
description: "The first name of the contact",
16+
},
17+
lastName: {
18+
type: "string",
19+
label: "Last Name",
20+
description: "The last name of the contact",
21+
},
22+
domain: {
23+
type: "string",
24+
label: "Email domain",
25+
description: "The domain to use for generating email addresses, i.e.: `gmail.com`",
26+
},
27+
},
528
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
29+
_baseUrl() {
30+
return "https://apps.emaillistverify.com/api";
31+
},
32+
async _makeRequest(opts = {}) {
33+
const {
34+
$ = this,
35+
path,
36+
params,
37+
...otherOpts
38+
} = opts;
39+
return axios($, {
40+
...otherOpts,
41+
url: this._baseUrl() + path,
42+
params: {
43+
...params,
44+
secret: `${this.$auth.api_key}`,
45+
},
46+
});
47+
},
48+
async verifyEmail(args = {}) {
49+
return this._makeRequest({
50+
path: "/verifyEmail",
51+
...args,
52+
});
53+
},
54+
async findEmail(args = {}) {
55+
return this._makeRequest({
56+
method: "post",
57+
path: "/find-contact",
58+
...args,
59+
});
960
},
1061
},
11-
};
62+
};

components/emaillistverify/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/emaillistverify",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream EmailListVerify Components",
55
"main": "emaillistverify.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
15-
}
18+
}

pnpm-lock.yaml

Lines changed: 61 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)