🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

n8n-nodes-quickemailverification

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n8n-nodes-quickemailverification - npm Package Compare versions

Comparing version

to
1.2.0

71

dist/nodes/QuickEmailVerification/QuickEmailVerificationApi.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickEmailVerificationApi = void 0;
const axios_1 = __importDefault(require("axios"));
class QuickEmailVerificationApi {

@@ -37,17 +18,12 @@ apiKey;

}
const options = {
method: 'GET',
uri: `${this.baseUrl}?email=${encodeURIComponent(email)}&apikey=${encodeURIComponent(this.apiKey)}`,
json: true,
resolveWithFullResponse: true,
};
const url = `${this.baseUrl}?email=${encodeURIComponent(email)}&apikey=${encodeURIComponent(this.apiKey)}`;
try {
const fullResponse = await this.makeRequest(options);
const response = fullResponse.body;
if (!response.success) {
throw new Error(response.message || 'Email verification failed');
const response = await this.makeRequest(url);
const responseData = response.data;
if (!responseData.success) {
throw new Error(responseData.message || 'Email verification failed');
}
const remainingCredits = fullResponse.headers['x-qev-remaining-credits'];
const remainingCredits = response.headers['x-qev-remaining-credits'];
return {
...response,
...responseData,
remainingCredits: remainingCredits ? Number.parseInt(remainingCredits.toString(), 10) : undefined,

@@ -57,17 +33,26 @@ };

catch (error) {
const err = error;
if (err.statusCode === 401) {
throw new Error('Invalid API key');
if (axios_1.default.isAxiosError(error)) {
if (error.response?.status === 401) {
throw new Error('Invalid API key');
}
if (error.response?.status === 429) {
throw new Error('Rate limit exceeded');
}
}
if (err.statusCode === 429) {
throw new Error('Rate limit exceeded');
}
throw error;
}
}
async makeRequest(options) {
const { default: request } = await Promise.resolve().then(() => __importStar(require('request-promise-native')));
return request(options);
async makeRequest(url) {
const response = await axios_1.default.get(url, {
headers: {
'Accept': 'application/json',
'User-Agent': 'n8n-nodes-quickemailverification'
}
});
return {
data: response.data,
headers: response.headers
};
}
}
exports.QuickEmailVerificationApi = QuickEmailVerificationApi;

@@ -26,4 +26,4 @@ {

"scripts": {
"build": "tsc --module commonjs --moduleResolution node && gulp build:icons",
"dev": "tsc --watch --module commonjs --moduleResolution node",
"build": "tsc && gulp build:icons",
"dev": "tsc --watch",
"format": "prettier --write .",

@@ -30,0 +30,0 @@ "lint": "eslint .",

{
"name": "n8n-nodes-quickemailverification",
"version": "1.1.0",
"version": "1.2.0",
"engines": {

@@ -52,3 +52,2 @@ "node": ">=18.10",

"@types/node": "^18.16.16",
"@types/request-promise-native": "~1.0.18",
"@typescript-eslint/eslint-plugin": "^5.59.8",

@@ -66,6 +65,5 @@ "@typescript-eslint/parser": "^5.59.8",

"dependencies": {
"axios": "^1.8.4",
"keyv": "^4.5.3",
"keyv-file": "5.1.1",
"request": "^2.88.2",
"request-promise-native": "^1.0.9"
"keyv-file": "5.1.1"
},

@@ -72,0 +70,0 @@ "peerDependencies": {

@@ -0,0 +0,0 @@ # n8n-nodes-quickemailverification

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet