dymo-api 1.2.28 → 1.2.30
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/isValidPhone/index.cjs +8 -0
- package/dist/cjs/dymo-api.cjs +1 -1
- package/dist/esm/branches/private/functions/isValidPhone/index.js +8 -0
- package/dist/esm/dymo-api.js +1 -1
- package/dist/types/dymo-api.d.ts +1 -1
- package/dist/types/lib/types/data-verifier.d.ts +4 -4
- package/dist/types/lib/types/primitives.d.ts +1 -0
- package/package.json +1 -1
|
@@ -52,6 +52,14 @@ const isValidPhone = async (axiosClient, phone, rules) => {
|
|
|
52
52
|
reasons.push("FRAUD");
|
|
53
53
|
if (rules.deny.includes("HIGH_RISK_SCORE") && responsePhone.plugins.riskScore >= 80)
|
|
54
54
|
reasons.push("HIGH_RISK_SCORE");
|
|
55
|
+
// Country block rules.
|
|
56
|
+
for (const rule of rules.deny) {
|
|
57
|
+
if (rule.startsWith("COUNTRY:")) {
|
|
58
|
+
const block = rule.split(":")[1]; // Extract country code.
|
|
59
|
+
if (responsePhone.countryCode === block)
|
|
60
|
+
reasons.push(`COUNTRY:${block}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
return {
|
|
56
64
|
phone: responsePhone.phone,
|
|
57
65
|
allow: reasons.length === 0,
|
package/dist/cjs/dymo-api.cjs
CHANGED
|
@@ -49,6 +49,14 @@ export const isValidPhone = async (axiosClient, phone, rules) => {
|
|
|
49
49
|
reasons.push("FRAUD");
|
|
50
50
|
if (rules.deny.includes("HIGH_RISK_SCORE") && responsePhone.plugins.riskScore >= 80)
|
|
51
51
|
reasons.push("HIGH_RISK_SCORE");
|
|
52
|
+
// Country block rules.
|
|
53
|
+
for (const rule of rules.deny) {
|
|
54
|
+
if (rule.startsWith("COUNTRY:")) {
|
|
55
|
+
const block = rule.split(":")[1]; // Extract country code.
|
|
56
|
+
if (responsePhone.countryCode === block)
|
|
57
|
+
reasons.push(`COUNTRY:${block}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
52
60
|
return {
|
|
53
61
|
phone: responsePhone.phone,
|
|
54
62
|
allow: reasons.length === 0,
|
package/dist/esm/dymo-api.js
CHANGED
package/dist/types/dymo-api.d.ts
CHANGED
|
@@ -281,4 +281,4 @@ declare class DymoAPI {
|
|
|
281
281
|
isValidPwd(data: Interfaces.IsValidPwdData): Promise<Interfaces.PasswordValidationResult>;
|
|
282
282
|
}
|
|
283
283
|
export default DymoAPI;
|
|
284
|
-
export type { EmailValidatorRules, NegativeEmailRules, DataEmailValidationAnalysis, PhoneValidatorRules, NegativePhoneRules, DataPhoneValidationAnalysis, WafRules, SensitiveInfoRules } from "./lib/types/interfaces";
|
|
284
|
+
export type { EmailValidatorRules, NegativeEmailRules, DataEmailValidationAnalysis, IPValidatorRules, NegativeIPRules, DataIPValidationAnalysis, PhoneValidatorRules, NegativePhoneRules, DataPhoneValidationAnalysis, WafRules, SensitiveInfoRules } from "./lib/types/interfaces";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MxRecord } from "dns";
|
|
2
|
-
import { Email, Phone, CreditCard } from "./primitives";
|
|
2
|
+
import { Email, Phone, CreditCard, Char } from "./primitives";
|
|
3
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;
|
|
@@ -69,10 +69,10 @@ export type IPValidator = string;
|
|
|
69
69
|
* @typedef {"FRAUD"|"INVALID"|"HIGH_RISK_SCORE"} NegativeIPRules
|
|
70
70
|
*
|
|
71
71
|
* @description
|
|
72
|
-
* Values indicating why an
|
|
72
|
+
* Values indicating why an IP is considered negative.
|
|
73
73
|
* ⚠️ TOR_NETWORK and HIGH_RISK_SCORE are premium features.
|
|
74
74
|
*/
|
|
75
|
-
export type NegativeIPRules = "FRAUD" | "INVALID" | "TOR_NETWORK" | "HIGH_RISK_SCORE" | `COUNTRY:${
|
|
75
|
+
export type NegativeIPRules = "FRAUD" | "INVALID" | "TOR_NETWORK" | "HIGH_RISK_SCORE" | `COUNTRY:${Char}${Char}`;
|
|
76
76
|
export type PhoneValidator = Phone;
|
|
77
77
|
/**
|
|
78
78
|
* @typedef {"FRAUD"|"INVALID"|"HIGH_RISK_SCORE"} NegativePhoneRules
|
|
@@ -80,7 +80,7 @@ export type PhoneValidator = Phone;
|
|
|
80
80
|
* @description
|
|
81
81
|
* Values indicating why an phone is considered negative.
|
|
82
82
|
*/
|
|
83
|
-
export type NegativePhoneRules = "FRAUD" | "INVALID" | "HIGH_RISK_SCORE"
|
|
83
|
+
export type NegativePhoneRules = "FRAUD" | "INVALID" | "HIGH_RISK_SCORE" | `COUNTRY:${Char}${Char}`;
|
|
84
84
|
export type NegativeSensitiveInfoRules = "EMAIL" | "PHONE" | "CREDIT_CARD" | "URL" | "DOMAIN" | "IP" | "WALLET" | "USER_AGENT";
|
|
85
85
|
/**
|
|
86
86
|
* Response returned by the email validator.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type Email = `${string}@${string}.${string}` | string;
|
|
2
2
|
type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
3
|
+
export type Char = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
|
|
3
4
|
export type Phone = {
|
|
4
5
|
/** The country code of the phone number. */
|
|
5
6
|
iso: any;
|