dymo-api 1.2.2 → 1.2.4
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/dymo-api.cjs
CHANGED
|
@@ -57,17 +57,15 @@ class DymoAPI {
|
|
|
57
57
|
* apiKey: "4c8b7675-6b69-4f8d-9f43-5a6f7f02c6c5"
|
|
58
58
|
* });
|
|
59
59
|
*/
|
|
60
|
-
constructor({ rootApiKey = null, apiKey = null, baseUrl = "https://api.tpeoficial.com", serverEmailConfig = undefined, rules = {
|
|
61
|
-
|
|
62
|
-
deny: [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
} } = {}) {
|
|
60
|
+
constructor({ rootApiKey = null, apiKey = null, baseUrl = "https://api.tpeoficial.com", serverEmailConfig = undefined, rules = {} } = {}) {
|
|
61
|
+
this.rules = {
|
|
62
|
+
email: { deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"] },
|
|
63
|
+
sensitiveInfo: { deny: ["EMAIL", "PHONE", "CREDIT_CARD"] },
|
|
64
|
+
...rules
|
|
65
|
+
};
|
|
67
66
|
this.rootApiKey = rootApiKey;
|
|
68
67
|
this.apiKey = apiKey;
|
|
69
68
|
this.serverEmailConfig = serverEmailConfig;
|
|
70
|
-
this.rules = rules;
|
|
71
69
|
this.baseUrl = baseUrl;
|
|
72
70
|
(0, config_1.setBaseUrl)(baseUrl);
|
|
73
71
|
}
|
package/dist/esm/dymo-api.js
CHANGED
|
@@ -22,17 +22,15 @@ class DymoAPI {
|
|
|
22
22
|
* apiKey: "4c8b7675-6b69-4f8d-9f43-5a6f7f02c6c5"
|
|
23
23
|
* });
|
|
24
24
|
*/
|
|
25
|
-
constructor({ rootApiKey = null, apiKey = null, baseUrl = "https://api.tpeoficial.com", serverEmailConfig = undefined, rules = {
|
|
26
|
-
|
|
27
|
-
deny: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
} } = {}) {
|
|
25
|
+
constructor({ rootApiKey = null, apiKey = null, baseUrl = "https://api.tpeoficial.com", serverEmailConfig = undefined, rules = {} } = {}) {
|
|
26
|
+
this.rules = {
|
|
27
|
+
email: { deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"] },
|
|
28
|
+
sensitiveInfo: { deny: ["EMAIL", "PHONE", "CREDIT_CARD"] },
|
|
29
|
+
...rules
|
|
30
|
+
};
|
|
32
31
|
this.rootApiKey = rootApiKey;
|
|
33
32
|
this.apiKey = apiKey;
|
|
34
33
|
this.serverEmailConfig = serverEmailConfig;
|
|
35
|
-
this.rules = rules;
|
|
36
34
|
this.baseUrl = baseUrl;
|
|
37
35
|
setBaseUrl(baseUrl);
|
|
38
36
|
}
|
|
@@ -23,15 +23,18 @@ export type EmailValidator = Email;
|
|
|
23
23
|
* ⚠️ NO_MX_RECORDS, PROXIED_EMAIL, FREE_SUBDOMAIN, CORPORATE, and HIGH_RISK_SCORE are premium features.
|
|
24
24
|
*/
|
|
25
25
|
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";
|
|
26
|
-
export
|
|
27
|
-
deny: NegativeEmailRules[];
|
|
28
|
-
}
|
|
26
|
+
export type NegativeSensitiveInfoRules = "EMAIL" | "PHONE" | "CREDIT_CARD" | "URL" | "DOMAIN" | "IP" | "WALLET" | "USER_AGENT";
|
|
29
27
|
export type EmailValidatorResponse = {
|
|
30
28
|
email: string;
|
|
31
29
|
allow: boolean;
|
|
32
30
|
reasons: NegativeEmailRules[];
|
|
33
31
|
response: DataEmailValidationAnalysis;
|
|
34
32
|
};
|
|
33
|
+
export type SensitiveInfoResponse = {
|
|
34
|
+
input: string;
|
|
35
|
+
allow: boolean;
|
|
36
|
+
reasons: NegativeSensitiveInfoRules[];
|
|
37
|
+
};
|
|
35
38
|
interface DataEmailValidationAnalysis {
|
|
36
39
|
valid: boolean;
|
|
37
40
|
fraud: boolean;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { NegativeEmailRules } from "./data-verifier";
|
|
1
|
+
import { NegativeEmailRules, NegativeSensitiveInfoRules } from "./data-verifier";
|
|
2
|
+
export interface EmailValidatorRules {
|
|
3
|
+
deny: NegativeEmailRules[];
|
|
4
|
+
}
|
|
5
|
+
export interface SensitiveInfoRules {
|
|
6
|
+
deny: NegativeSensitiveInfoRules[];
|
|
7
|
+
}
|
|
2
8
|
export interface Rules {
|
|
3
|
-
email
|
|
4
|
-
|
|
5
|
-
};
|
|
9
|
+
email?: EmailValidatorRules;
|
|
10
|
+
sensitiveInfo?: SensitiveInfoRules;
|
|
6
11
|
}
|