diff --git a/components/email_verifier_api/actions/verify-email/verify-email.mjs b/components/email_verifier_api/actions/verify-email/verify-email.mjs new file mode 100644 index 0000000000000..1a356cea1e7cb --- /dev/null +++ b/components/email_verifier_api/actions/verify-email/verify-email.mjs @@ -0,0 +1,25 @@ +import emailVerifierApi from "../../email_verifier_api.app.mjs"; + +export default { + key: "email_verifier_api-verify-email", + name: "Verify Email", + description: "Verify an email address with Email Verifier API. [See the documentation](https://www.emailverifierapi.com/app/v2-api-documentation/)", + version: "0.0.1", + type: "action", + props: { + emailVerifierApi, + email: { + type: "string", + label: "Email", + description: "The email address to verify", + }, + }, + async run({ $ }) { + const response = await this.emailVerifierApi.verifyEmail({ + $, + email: this.email, + }); + $.export("$summary", `Successfully retrieved verification data for email address \`${this.email}\``); + return response; + }, +}; diff --git a/components/email_verifier_api/email_verifier_api.app.mjs b/components/email_verifier_api/email_verifier_api.app.mjs index 4a286ad6fd2ea..679b00cba604e 100644 --- a/components/email_verifier_api/email_verifier_api.app.mjs +++ b/components/email_verifier_api/email_verifier_api.app.mjs @@ -1,11 +1,36 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "email_verifier_api", propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://emailverifierapi.com/v2/"; + }, + _makeRequest({ + $ = this, + params, + ...opts + }) { + return axios($, { + url: this._baseUrl(), + params: { + ...params, + apiKey: this.$auth.api_key, + }, + ...opts, + }); + }, + verifyEmail({ + $, email, + }) { + return this._makeRequest({ + $, + params: { + email, + }, + }); }, }, -}; \ No newline at end of file +}; diff --git a/components/email_verifier_api/package.json b/components/email_verifier_api/package.json index 53538d1aa143b..7e3ed1ab8ff4b 100644 --- a/components/email_verifier_api/package.json +++ b/components/email_verifier_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/email_verifier_api", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Email Verifier Api Components", "main": "email_verifier_api.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be12ad6b860ee..94d1d68f8b87a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3277,7 +3277,11 @@ importers: components/elorus: {} - components/email_verifier_api: {} + components/email_verifier_api: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/emailable: dependencies: @@ -5694,8 +5698,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/klipy: - specifiers: {} + components/klipy: {} components/knack: dependencies: