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
27 changes: 27 additions & 0 deletions components/enrichley/actions/validate-email/validate-email.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import enrichley from "../../enrichley.app.mjs";

export default {
key: "enrichley-validate-email",
name: "Validate Email",
description: "Checks the validity of a single email address using Enrichley. [See the documentation](https://enrichley.readme.io/reference/validatesingleemail)",
version: "0.0.1",
type: "action",
props: {
enrichley,
email: {
type: "string",
label: "Email",
description: "The email address to validate",
},
},
async run({ $ }) {
const response = await this.enrichley.validateEmail({
$,
data: {
email: this.email,
},
});
$.export("$summary", `Successfully retrieved status for email: ${this.email}`);
return response;
},
};
31 changes: 26 additions & 5 deletions components/enrichley/enrichley.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "enrichley",
propDefinitions: {},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.enrichley.io/api/v1";
},
_makeRequest({
$ = this,
path,
...opts
}) {
return axios($, {
url: `${this._baseUrl()}${path}`,
headers: {
"Accept": "application/json",
"X-API-Key": `${this.$auth.api_key}`,
},
...opts,
});
},
validateEmail(opts = {}) {
return this._makeRequest({
method: "POST",
path: "/validate-single-email",
...opts,
});
},
},
};
};
7 changes: 5 additions & 2 deletions components/enrichley/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/enrichley",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Enrichley Components",
"main": "enrichley.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
}
107 changes: 55 additions & 52 deletions pnpm-lock.yaml

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

Loading