Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

email-marker-client

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

email-marker-client - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

lib/email-marker.error.d.ts

4

lib/email-marker.client.d.ts

@@ -1,6 +0,6 @@

import { EmailMarkerResult } from './email-marker.types';
import { EmailMarkerResponse } from './email-marker.types';
export declare class EmailMarkerClient {
private readonly apiKey;
constructor(apiKey: string);
verify(email: string): Promise<EmailMarkerResult>;
verify(email: string): Promise<EmailMarkerResponse>;
}

@@ -13,4 +13,4 @@ "use strict";

exports.EmailMarkerClient = void 0;
const axios_1 = require("axios");
const ALL_RESULTS = ['valid', 'invalid', 'unknown', 'processing_error'];
const cross_fetch_1 = require("cross-fetch");
const _1 = require(".");
class EmailMarkerClient {

@@ -22,12 +22,9 @@ constructor(apiKey) {

return __awaiter(this, void 0, void 0, function* () {
const url = `https://app.emailmarker.com/api/verify?apiKey=${this.apiKey}&email=${encodeURI(email)}`;
let status;
const res = yield axios_1.default.get(url);
if (typeof res.data === 'string' || res.status !== 200 || res.statusText !== 'OK') {
status = 'processing_error';
const res = yield cross_fetch_1.default(`https://app.emailmarker.com/api/verify?apiKey=${this.apiKey}&email=${encodeURI(email)}`);
if (res.ok) {
return (yield res.json());
}
else {
status = ALL_RESULTS.indexOf(res.data.result) > -1 ? res.data.result : 'processing_error';
throw new _1.EmailMarkerError(res);
}
return status;
});

@@ -34,0 +31,0 @@ }

@@ -1,1 +0,5 @@

export declare type EmailMarkerResult = 'valid' | 'invalid' | 'unknown' | 'processing_error';
export interface EmailMarkerResponse {
success: boolean;
result: 'valid' | 'invalid' | 'unknown';
message: string;
}
export * from './email-marker.client';
export * from './email-marker.types';
export * from './email-marker.error';

@@ -15,2 +15,3 @@ "use strict";

__exportStar(require("./email-marker.types"), exports);
__exportStar(require("./email-marker.error"), exports);
//# sourceMappingURL=index.js.map
{
"name": "email-marker-client",
"version": "1.0.1",
"version": "2.0.0",
"description": "Email Marker API client for Node.js and browser",

@@ -32,3 +32,2 @@ "main": "lib/index.js",

"devDependencies": {
"@types/axios": "^0.14.0",
"@typescript-eslint/eslint-plugin": "^3.7.1",

@@ -54,4 +53,4 @@ "@typescript-eslint/parser": "^3.7.1",

"dependencies": {
"axios": "^0.19.2"
"cross-fetch": "^3.0.5"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc