dymo-api 1.2.15 → 1.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/branches/private/functions/isValidEmail/index.cjs +5 -2
- package/dist/cjs/dymo-api.cjs +1 -1
- package/dist/esm/branches/private/functions/isValidEmail/index.js +5 -2
- package/dist/esm/dymo-api.js +1 -1
- package/dist/types/branches/private/functions/isValidEmail/index.d.ts +1 -1
- package/dist/types/lib/types/data-verifier.d.ts +5 -3
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ const basics_1 = require("../../../../utils/basics.cjs");
|
|
|
11
11
|
*
|
|
12
12
|
* Deny rules (some are premium ⚠️):
|
|
13
13
|
* - "FRAUD", "INVALID", "NO_MX_RECORDS" ⚠️, "PROXIED_EMAIL" ⚠️, "FREE_SUBDOMAIN" ⚠️,
|
|
14
|
-
* "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "HIGH_RISK_SCORE" ⚠️
|
|
14
|
+
* "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "NO_GRAVATAR" "HIGH_RISK_SCORE" ⚠️
|
|
15
15
|
*
|
|
16
16
|
* @returns {Promise<boolean>} True if the email passes all deny rules, false otherwise.
|
|
17
17
|
* @throws Error if token is null, rules are empty, or request fails.
|
|
@@ -39,7 +39,8 @@ const isValidEmail = async (axiosClient, email, rules) => {
|
|
|
39
39
|
plugins: [
|
|
40
40
|
rules.deny.includes("NO_MX_RECORDS") ? "mxRecords" : undefined,
|
|
41
41
|
rules.deny.includes("NO_REACHABLE") ? "reachability" : undefined,
|
|
42
|
-
rules.deny.includes("HIGH_RISK_SCORE") ? "riskScore" : undefined
|
|
42
|
+
rules.deny.includes("HIGH_RISK_SCORE") ? "riskScore" : undefined,
|
|
43
|
+
rules.deny.includes("NO_GRAVATAR") ? "gravatar" : undefined
|
|
43
44
|
].filter(Boolean)
|
|
44
45
|
}, { headers: { "Content-Type": "application/json" } })).data.email;
|
|
45
46
|
let reasons = [];
|
|
@@ -71,6 +72,8 @@ const isValidEmail = async (axiosClient, email, rules) => {
|
|
|
71
72
|
reasons.push("NO_REACHABLE");
|
|
72
73
|
if (rules.deny.includes("HIGH_RISK_SCORE") && responseEmail.plugins.riskScore >= 80)
|
|
73
74
|
reasons.push("HIGH_RISK_SCORE");
|
|
75
|
+
if (rules.deny.includes("NO_GRAVATAR") && !responseEmail.plugins.gravatar)
|
|
76
|
+
reasons.push("NO_GRAVATAR");
|
|
74
77
|
return {
|
|
75
78
|
email: responseEmail.email,
|
|
76
79
|
allow: reasons.length === 0,
|
package/dist/cjs/dymo-api.cjs
CHANGED
|
@@ -8,7 +8,7 @@ import { customError } from "../../../../utils/basics.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Deny rules (some are premium ⚠️):
|
|
10
10
|
* - "FRAUD", "INVALID", "NO_MX_RECORDS" ⚠️, "PROXIED_EMAIL" ⚠️, "FREE_SUBDOMAIN" ⚠️,
|
|
11
|
-
* "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "HIGH_RISK_SCORE" ⚠️
|
|
11
|
+
* "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "NO_GRAVATAR" "HIGH_RISK_SCORE" ⚠️
|
|
12
12
|
*
|
|
13
13
|
* @returns {Promise<boolean>} True if the email passes all deny rules, false otherwise.
|
|
14
14
|
* @throws Error if token is null, rules are empty, or request fails.
|
|
@@ -36,7 +36,8 @@ export const isValidEmail = async (axiosClient, email, rules) => {
|
|
|
36
36
|
plugins: [
|
|
37
37
|
rules.deny.includes("NO_MX_RECORDS") ? "mxRecords" : undefined,
|
|
38
38
|
rules.deny.includes("NO_REACHABLE") ? "reachability" : undefined,
|
|
39
|
-
rules.deny.includes("HIGH_RISK_SCORE") ? "riskScore" : undefined
|
|
39
|
+
rules.deny.includes("HIGH_RISK_SCORE") ? "riskScore" : undefined,
|
|
40
|
+
rules.deny.includes("NO_GRAVATAR") ? "gravatar" : undefined
|
|
40
41
|
].filter(Boolean)
|
|
41
42
|
}, { headers: { "Content-Type": "application/json" } })).data.email;
|
|
42
43
|
let reasons = [];
|
|
@@ -68,6 +69,8 @@ export const isValidEmail = async (axiosClient, email, rules) => {
|
|
|
68
69
|
reasons.push("NO_REACHABLE");
|
|
69
70
|
if (rules.deny.includes("HIGH_RISK_SCORE") && responseEmail.plugins.riskScore >= 80)
|
|
70
71
|
reasons.push("HIGH_RISK_SCORE");
|
|
72
|
+
if (rules.deny.includes("NO_GRAVATAR") && !responseEmail.plugins.gravatar)
|
|
73
|
+
reasons.push("NO_GRAVATAR");
|
|
71
74
|
return {
|
|
72
75
|
email: responseEmail.email,
|
|
73
76
|
allow: reasons.length === 0,
|
package/dist/esm/dymo-api.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as Interfaces from "../../../../lib/types/interfaces";
|
|
|
9
9
|
*
|
|
10
10
|
* Deny rules (some are premium ⚠️):
|
|
11
11
|
* - "FRAUD", "INVALID", "NO_MX_RECORDS" ⚠️, "PROXIED_EMAIL" ⚠️, "FREE_SUBDOMAIN" ⚠️,
|
|
12
|
-
* "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "HIGH_RISK_SCORE" ⚠️
|
|
12
|
+
* "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "NO_GRAVATAR" "HIGH_RISK_SCORE" ⚠️
|
|
13
13
|
*
|
|
14
14
|
* @returns {Promise<boolean>} True if the email passes all deny rules, false otherwise.
|
|
15
15
|
* @throws Error if token is null, rules are empty, or request fails.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MxRecord } from "dns";
|
|
2
2
|
import { Email, Phone, CreditCard } from "./primitives";
|
|
3
|
-
export type VerifyPlugins = "blocklist" | "compromiseDetector" | "mxRecords" | "nsfw" | "reputation" | "riskScore" | "torNetwork" | "typosquatting" | "urlShortener";
|
|
3
|
+
export type VerifyPlugins = "blocklist" | "gravatar" | "compromiseDetector" | "mxRecords" | "nsfw" | "reputation" | "riskScore" | "torNetwork" | "typosquatting" | "urlShortener";
|
|
4
4
|
export type ReputationPlugin = "low" | "medium" | "high" | "very-high" | "education" | "governmental" | "unknown";
|
|
5
5
|
export type TyposquattingPlugin = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
6
6
|
export interface Validator {
|
|
@@ -61,9 +61,9 @@ export type EmailValidator = Email;
|
|
|
61
61
|
*
|
|
62
62
|
* @description
|
|
63
63
|
* Values indicating why an email is considered negative.
|
|
64
|
-
* ⚠️ NO_MX_RECORDS, PROXIED_EMAIL, FREE_SUBDOMAIN, CORPORATE, and HIGH_RISK_SCORE are premium features.
|
|
64
|
+
* ⚠️ NO_MX_RECORDS, PROXIED_EMAIL, FREE_SUBDOMAIN, CORPORATE, NO_GRAVATAR, and HIGH_RISK_SCORE are premium features.
|
|
65
65
|
*/
|
|
66
|
-
export type NegativeEmailRules = "FRAUD" | "INVALID" | "NO_MX_RECORDS" | "PROXIED_EMAIL" | "FREE_SUBDOMAIN" | "PERSONAL_EMAIL" | "CORPORATE_EMAIL" | "NO_REPLY_EMAIL" | "ROLE_ACCOUNT" | "NO_REACHABLE" | "HIGH_RISK_SCORE";
|
|
66
|
+
export type NegativeEmailRules = "FRAUD" | "INVALID" | "NO_MX_RECORDS" | "PROXIED_EMAIL" | "FREE_SUBDOMAIN" | "PERSONAL_EMAIL" | "CORPORATE_EMAIL" | "NO_REPLY_EMAIL" | "ROLE_ACCOUNT" | "NO_GRAVATAR" | "NO_REACHABLE" | "HIGH_RISK_SCORE";
|
|
67
67
|
export type NegativeSensitiveInfoRules = "EMAIL" | "PHONE" | "CREDIT_CARD" | "URL" | "DOMAIN" | "IP" | "WALLET" | "USER_AGENT";
|
|
68
68
|
/**
|
|
69
69
|
* Response returned by the email validator.
|
|
@@ -121,6 +121,8 @@ export interface DataEmailValidationAnalysis {
|
|
|
121
121
|
plugins: {
|
|
122
122
|
/** Whether the email is blocked by a blocklist. */
|
|
123
123
|
blocklist?: boolean;
|
|
124
|
+
/** Gravatar URL for the email. */
|
|
125
|
+
gravatarUrl?: string;
|
|
124
126
|
/** Whether the email is flagged as a compromise. */
|
|
125
127
|
compromiseDetector?: boolean;
|
|
126
128
|
/** MX records for the email domain. */
|