diff --git a/credentials/VerificarEmailApi.credentials.ts b/credentials/VerificarEmailApi.credentials.ts index e69de29..95da504 100644 --- a/credentials/VerificarEmailApi.credentials.ts +++ b/credentials/VerificarEmailApi.credentials.ts @@ -0,0 +1,46 @@ +import { + IAuthenticateGeneric, + Icon, + ICredentialTestRequest, + ICredentialType, + INodeProperties, +} from 'n8n-workflow'; + +export class VerificarEmailApi implements ICredentialType { + name = 'verificarEmailApi'; + displayName = 'Verificar Email API'; + icon: Icon = 'file:mail-mail-email.svg'; + // Uses the link to this tutorial as an example + // Replace with your own docs links when building your own nodes + documentationUrl = 'https://docs.n8n.io/integrations/creating-nodes/build/declarative-style-node/'; + properties: INodeProperties[] = [ + { + displayName: 'API Keyy', + name: 'apiKey', + typeOptions: { + password: true, + }, + type: 'string', + default: '', + }, + ]; + authenticate: IAuthenticateGeneric = { + type: 'generic', + properties: { + qs: { + 'api_key': '={{$credentials.apiKey}}' + } + }, + }; + + test: ICredentialTestRequest = { + request: { + method: 'GET', + url: 'https://api.emailable.com/v1/verify', // Replace with actual endpoint + qs: { + email: 'dylan.bohorquez@agrosoft.com.ec', // Example email for testing + api_key: '={{$credentials.apiKey}}' + } + }, + }; +} \ No newline at end of file diff --git a/nodes/VerificarEmail.node.json b/nodes/VerificarEmail.node.json deleted file mode 100644 index e69de29..0000000 diff --git a/nodes/VerificarEmail/VerificarEmail.node.json b/nodes/VerificarEmail/VerificarEmail.node.json new file mode 100644 index 0000000..ad03b4c --- /dev/null +++ b/nodes/VerificarEmail/VerificarEmail.node.json @@ -0,0 +1,20 @@ +{ + "node": "n8n-nodes-base.verificarEmail", + "nodeVersion": "1.0", + "codexVersion": "1.0", + "categories": [ + "Miscellaneous" + ], + "resources": { + "credentialDocumentation": [ + { + "url": "" + } + ], + "primaryDocumentation": [ + { + "url": "" + } + ] + } +} \ No newline at end of file diff --git a/nodes/VerificarEmail.node.ts b/nodes/VerificarEmail/VerificarEmail.node.ts similarity index 78% rename from nodes/VerificarEmail.node.ts rename to nodes/VerificarEmail/VerificarEmail.node.ts index 9eefb1c..2d654a7 100644 --- a/nodes/VerificarEmail.node.ts +++ b/nodes/VerificarEmail/VerificarEmail.node.ts @@ -1,7 +1,7 @@ import { INodeType, INodeTypeDescription, NodeConnectionTypes } from 'n8n-workflow'; export class VerificarEmail implements INodeType { description: INodeTypeDescription = { - displayName: 'Verificacion de Email', + displayName: 'Verificacion de Validez de Email', name: 'verificarEmail', icon: 'file:mail-mail-email.svg', group: ['transform'], @@ -15,12 +15,12 @@ export class VerificarEmail implements INodeType { outputs: [NodeConnectionTypes.Main], credentials: [ { - name: 'VerificarEmailApi', + name: 'verificarEmailApi', required: true, }, ], requestDefaults: { - baseURL: 'https://api.emailable.com/v1/verify', + baseURL: 'https://api.emailable.com/v1', // Solo el dominio. headers: { Accept: 'application/json', 'Content-Type': 'application/json', @@ -35,8 +35,11 @@ export class VerificarEmail implements INodeType { required: true, default: 'dylanbohorquez77@gmail.com', routing: { - qs: { - email: '={{$value}}', + request: { + url: '/verify', + qs: { + email: '={{$value}}', + }, }, }, }, diff --git a/nodes/mail-mail-email.svg b/nodes/VerificarEmail/mail-mail-email.svg similarity index 100% rename from nodes/mail-mail-email.svg rename to nodes/VerificarEmail/mail-mail-email.svg diff --git a/package.json b/package.json index 66b8c45..2ba5952 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "n8n-nodes-<...>", + "name": "n8n-nodes-VerificarEmail", "version": "0.1.0", - "description": "", + "description": "Nodo de n8n para verificar la validez de correos electrónicos utilizando una API externa (emailable.com)", "license": "MIT", "homepage": "", "keywords": [ "n8n-community-node-package" ], "author": { - "name": "", - "email": "" + "name": "Dylan Bohorquez", + "email": "dylan.bohorquez@agrosoft.com.ec" }, "repository": { "type": "git", @@ -31,12 +31,10 @@ "n8nNodesApiVersion": 1, "strict": true, "credentials": [ - "dist/credentials/GithubIssuesApi.credentials.js", - "dist/credentials/GithubIssuesOAuth2Api.credentials.js" + "dist/credentials/VerificarEmailApi.credentials.js" ], "nodes": [ - "dist/nodes/GithubIssues/GithubIssues.node.js", - "dist/nodes/Example/Example.node.js" + "dist/nodes/VerificarEmail/VerificarEmail.node.js" ] }, "devDependencies": {