dymo-api 1.2.22 → 1.2.24

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.
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidIP = void 0;
4
+ const basics_1 = require("../../../../utils/basics.cjs");
5
+ /**
6
+ * Validates an ip using a secure verification endpoint.
7
+ *
8
+ * @param {string | null} token - Authentication token (required).
9
+ * @param {Interfaces.IPValidator} ip - IP to validate.
10
+ * @param {Interfaces.IPValidatorRules} [rules] - Deny rules. Defaults to ["FRAUD", "INVALID", "TOR_NETWORK"].
11
+ *
12
+ * Deny rules (some are premium ⚠️):
13
+ * - "FRAUD", "INVALID", "TOR_NETWORK" ⚠️, "HIGH_RISK_SCORE" ⚠️
14
+ *
15
+ * @returns {Promise<boolean>} True if the IP passes all deny rules, false otherwise.
16
+ * @throws Error if token is null, rules are empty, or request fails.
17
+ *
18
+ * @example
19
+ * const valid = await isValidIP(apiToken, "52.94.236.248", { deny: ["FRAUD", "TOR_NETWORK", "COUNTRY:RU"] });
20
+ */
21
+ const isValidIP = async (axiosClient, ip, rules) => {
22
+ if (!axiosClient.defaults.headers?.Authorization)
23
+ throw (0, basics_1.customError)(3000, "Invalid private token.");
24
+ if (rules.deny.length === 0)
25
+ throw (0, basics_1.customError)(1500, "You must provide at least one deny rule.");
26
+ if (rules.mode === "DRY_RUN") {
27
+ console.warn("[Dymo API] DRY_RUN mode is enabled. No requests with real data will be processed until you switch to LIVE mode.");
28
+ return {
29
+ ip,
30
+ allow: true,
31
+ reasons: [],
32
+ response: "CHANGE TO LIVE MODE"
33
+ };
34
+ }
35
+ try {
36
+ const responseIP = (await axiosClient.post("/private/secure/verify", {
37
+ ip,
38
+ plugins: [
39
+ rules.deny.includes("TOR_NETWORK") ? "torNetwork" : undefined,
40
+ rules.deny.includes("HIGH_RISK_SCORE") ? "riskScore" : undefined
41
+ ].filter(Boolean)
42
+ }, { headers: { "Content-Type": "application/json" } })).data.ip;
43
+ let reasons = [];
44
+ if (rules.deny.includes("INVALID") && !responseIP.valid) {
45
+ return {
46
+ ip: responseIP.ip,
47
+ allow: false,
48
+ reasons: ["INVALID"],
49
+ response: responseIP
50
+ };
51
+ }
52
+ if (rules.deny.includes("FRAUD") && responseIP.fraud)
53
+ reasons.push("FRAUD");
54
+ if (rules.deny.includes("TOR_NETWORK") && !responseIP.plugins.gravatar)
55
+ reasons.push("TOR_NETWORK");
56
+ if (rules.deny.includes("HIGH_RISK_SCORE") && responseIP.plugins.riskScore >= 80)
57
+ reasons.push("HIGH_RISK_SCORE");
58
+ // Country block rules.
59
+ for (const rule of rules.deny) {
60
+ if (rule.startsWith("COUNTRY:")) {
61
+ const block = rule.split(":")[1]; // Extract country code.
62
+ if (responseIP.countryCode === block)
63
+ reasons.push(`COUNTRY:${block}`);
64
+ }
65
+ }
66
+ return {
67
+ ip: responseIP.ip,
68
+ allow: reasons.length === 0,
69
+ reasons,
70
+ response: responseIP
71
+ };
72
+ }
73
+ catch (error) {
74
+ const statusCode = error.response?.status || 500;
75
+ const errorMessage = error.response?.data?.message || error.message;
76
+ const errorDetails = JSON.stringify(error.response?.data || {});
77
+ throw (0, basics_1.customError)(5000, `Error ${statusCode}: ${errorMessage}. Details: ${errorDetails}`);
78
+ }
79
+ };
80
+ exports.isValidIP = isValidIP;
@@ -18,6 +18,7 @@ __exportStar(require("./functions/extractWithTextly/index.cjs"), exports);
18
18
  __exportStar(require("./functions/getRandom/index.cjs"), exports);
19
19
  __exportStar(require("./functions/isValidDataRaw/index.cjs"), exports);
20
20
  __exportStar(require("./functions/isValidEmail/index.cjs"), exports);
21
+ __exportStar(require("./functions/isValidIP/index.cjs"), exports);
21
22
  __exportStar(require("./functions/isValidPhone/index.cjs"), exports);
22
23
  __exportStar(require("./functions/protectReq/index.cjs"), exports);
23
24
  __exportStar(require("./functions/sendEmail/index.cjs"), exports);
@@ -62,6 +62,7 @@ class DymoAPI {
62
62
  constructor({ rootApiKey = null, apiKey = null, baseUrl = "https://api.tpeoficial.com", serverEmailConfig = undefined, rules = {} } = {}) {
63
63
  this.rules = {
64
64
  email: { mode: "LIVE", deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"] },
65
+ ip: { mode: "LIVE", deny: ["FRAUD", "INVALID", "TOR_NETWORK"] },
65
66
  phone: { mode: "LIVE", deny: ["FRAUD", "INVALID"] },
66
67
  sensitiveInfo: { mode: "LIVE", deny: ["EMAIL", "PHONE", "CREDIT_CARD"] },
67
68
  waf: { mode: "LIVE", allowBots: ["CURL", "CATEGORY:SEARCH_ENGINE", "CATEGORY:PREVIEW"], deny: ["FRAUD", "TOR_NETWORK"] },
@@ -77,7 +78,7 @@ class DymoAPI {
77
78
  headers: {
78
79
  "User-Agent": "DymoAPISDK/1.0.0",
79
80
  "X-Dymo-SDK-Env": "Node",
80
- "X-Dymo-SDK-Version": "1.2.22"
81
+ "X-Dymo-SDK-Version": "1.2.24"
81
82
  }
82
83
  });
83
84
  // We set the authorization in the Axios client to make requests.
@@ -161,6 +162,28 @@ class DymoAPI {
161
162
  return await PrivateAPI.isValidEmail(this.axiosClient, email, rules);
162
163
  }
163
164
  ;
165
+ /**
166
+ * Validates the given IP against the configured rules.
167
+ *
168
+ * This method requires either the root API key or the API key to be set.
169
+ * If neither is set, it will throw an error.
170
+ *
171
+ * @param {string} [ip] - IP address to validate.
172
+ * @param {NegativeEmailRules[]} [rules] - Optional rules for validation. Some rules are premium features.
173
+ * @important
174
+ * **⚠️ TOR_NETWORK and HIGH_RISK_SCORE are [PREMIUM](https://docs.tpeoficial.com/docs/dymo-api/private/data-verifier) features.**
175
+ * @returns {Promise<Interfaces.IPValidatorResponse>} Resolves with the validation response.
176
+ * @throws Will throw an error if validation cannot be performed.
177
+ *
178
+ * @example
179
+ * const valid = await isValidIP("52.94.236.248", { deny: ["FRAUD", "TOR_NETWORK", "COUNTRY:RU"] });
180
+ *
181
+ * @see [Documentation](https://docs.tpeoficial.com/docs/dymo-api/private/ip-validation)
182
+ */
183
+ async isValidIP(ip, rules = this.rules.ip) {
184
+ return await PrivateAPI.isValidIP(this.axiosClient, ip, rules);
185
+ }
186
+ ;
164
187
  /**
165
188
  * Validates the given email against the configured rules.
166
189
  *
@@ -0,0 +1,76 @@
1
+ import { customError } from "../../../../utils/basics.js";
2
+ /**
3
+ * Validates an ip using a secure verification endpoint.
4
+ *
5
+ * @param {string | null} token - Authentication token (required).
6
+ * @param {Interfaces.IPValidator} ip - IP to validate.
7
+ * @param {Interfaces.IPValidatorRules} [rules] - Deny rules. Defaults to ["FRAUD", "INVALID", "TOR_NETWORK"].
8
+ *
9
+ * Deny rules (some are premium ⚠️):
10
+ * - "FRAUD", "INVALID", "TOR_NETWORK" ⚠️, "HIGH_RISK_SCORE" ⚠️
11
+ *
12
+ * @returns {Promise<boolean>} True if the IP passes all deny rules, false otherwise.
13
+ * @throws Error if token is null, rules are empty, or request fails.
14
+ *
15
+ * @example
16
+ * const valid = await isValidIP(apiToken, "52.94.236.248", { deny: ["FRAUD", "TOR_NETWORK", "COUNTRY:RU"] });
17
+ */
18
+ export const isValidIP = async (axiosClient, ip, rules) => {
19
+ if (!axiosClient.defaults.headers?.Authorization)
20
+ throw customError(3000, "Invalid private token.");
21
+ if (rules.deny.length === 0)
22
+ throw customError(1500, "You must provide at least one deny rule.");
23
+ if (rules.mode === "DRY_RUN") {
24
+ console.warn("[Dymo API] DRY_RUN mode is enabled. No requests with real data will be processed until you switch to LIVE mode.");
25
+ return {
26
+ ip,
27
+ allow: true,
28
+ reasons: [],
29
+ response: "CHANGE TO LIVE MODE"
30
+ };
31
+ }
32
+ try {
33
+ const responseIP = (await axiosClient.post("/private/secure/verify", {
34
+ ip,
35
+ plugins: [
36
+ rules.deny.includes("TOR_NETWORK") ? "torNetwork" : undefined,
37
+ rules.deny.includes("HIGH_RISK_SCORE") ? "riskScore" : undefined
38
+ ].filter(Boolean)
39
+ }, { headers: { "Content-Type": "application/json" } })).data.ip;
40
+ let reasons = [];
41
+ if (rules.deny.includes("INVALID") && !responseIP.valid) {
42
+ return {
43
+ ip: responseIP.ip,
44
+ allow: false,
45
+ reasons: ["INVALID"],
46
+ response: responseIP
47
+ };
48
+ }
49
+ if (rules.deny.includes("FRAUD") && responseIP.fraud)
50
+ reasons.push("FRAUD");
51
+ if (rules.deny.includes("TOR_NETWORK") && !responseIP.plugins.gravatar)
52
+ reasons.push("TOR_NETWORK");
53
+ if (rules.deny.includes("HIGH_RISK_SCORE") && responseIP.plugins.riskScore >= 80)
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 (responseIP.countryCode === block)
60
+ reasons.push(`COUNTRY:${block}`);
61
+ }
62
+ }
63
+ return {
64
+ ip: responseIP.ip,
65
+ allow: reasons.length === 0,
66
+ reasons,
67
+ response: responseIP
68
+ };
69
+ }
70
+ catch (error) {
71
+ const statusCode = error.response?.status || 500;
72
+ const errorMessage = error.response?.data?.message || error.message;
73
+ const errorDetails = JSON.stringify(error.response?.data || {});
74
+ throw customError(5000, `Error ${statusCode}: ${errorMessage}. Details: ${errorDetails}`);
75
+ }
76
+ };
@@ -2,6 +2,7 @@ export * from "./functions/extractWithTextly";
2
2
  export * from "./functions/getRandom";
3
3
  export * from "./functions/isValidDataRaw";
4
4
  export * from "./functions/isValidEmail";
5
+ export * from "./functions/isValidIP";
5
6
  export * from "./functions/isValidPhone";
6
7
  export * from "./functions/protectReq";
7
8
  export * from "./functions/sendEmail";
@@ -24,6 +24,7 @@ class DymoAPI {
24
24
  constructor({ rootApiKey = null, apiKey = null, baseUrl = "https://api.tpeoficial.com", serverEmailConfig = undefined, rules = {} } = {}) {
25
25
  this.rules = {
26
26
  email: { mode: "LIVE", deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"] },
27
+ ip: { mode: "LIVE", deny: ["FRAUD", "INVALID", "TOR_NETWORK"] },
27
28
  phone: { mode: "LIVE", deny: ["FRAUD", "INVALID"] },
28
29
  sensitiveInfo: { mode: "LIVE", deny: ["EMAIL", "PHONE", "CREDIT_CARD"] },
29
30
  waf: { mode: "LIVE", allowBots: ["CURL", "CATEGORY:SEARCH_ENGINE", "CATEGORY:PREVIEW"], deny: ["FRAUD", "TOR_NETWORK"] },
@@ -39,7 +40,7 @@ class DymoAPI {
39
40
  headers: {
40
41
  "User-Agent": "DymoAPISDK/1.0.0",
41
42
  "X-Dymo-SDK-Env": "Node",
42
- "X-Dymo-SDK-Version": "1.2.22"
43
+ "X-Dymo-SDK-Version": "1.2.24"
43
44
  }
44
45
  });
45
46
  // We set the authorization in the Axios client to make requests.
@@ -123,6 +124,28 @@ class DymoAPI {
123
124
  return await PrivateAPI.isValidEmail(this.axiosClient, email, rules);
124
125
  }
125
126
  ;
127
+ /**
128
+ * Validates the given IP against the configured rules.
129
+ *
130
+ * This method requires either the root API key or the API key to be set.
131
+ * If neither is set, it will throw an error.
132
+ *
133
+ * @param {string} [ip] - IP address to validate.
134
+ * @param {NegativeEmailRules[]} [rules] - Optional rules for validation. Some rules are premium features.
135
+ * @important
136
+ * **⚠️ TOR_NETWORK and HIGH_RISK_SCORE are [PREMIUM](https://docs.tpeoficial.com/docs/dymo-api/private/data-verifier) features.**
137
+ * @returns {Promise<Interfaces.IPValidatorResponse>} Resolves with the validation response.
138
+ * @throws Will throw an error if validation cannot be performed.
139
+ *
140
+ * @example
141
+ * const valid = await isValidIP("52.94.236.248", { deny: ["FRAUD", "TOR_NETWORK", "COUNTRY:RU"] });
142
+ *
143
+ * @see [Documentation](https://docs.tpeoficial.com/docs/dymo-api/private/ip-validation)
144
+ */
145
+ async isValidIP(ip, rules = this.rules.ip) {
146
+ return await PrivateAPI.isValidIP(this.axiosClient, ip, rules);
147
+ }
148
+ ;
126
149
  /**
127
150
  * Validates the given email against the configured rules.
128
151
  *
@@ -0,0 +1,19 @@
1
+ import { type AxiosInstance } from "axios";
2
+ import * as Interfaces from "../../../../lib/types/interfaces";
3
+ /**
4
+ * Validates an ip using a secure verification endpoint.
5
+ *
6
+ * @param {string | null} token - Authentication token (required).
7
+ * @param {Interfaces.IPValidator} ip - IP to validate.
8
+ * @param {Interfaces.IPValidatorRules} [rules] - Deny rules. Defaults to ["FRAUD", "INVALID", "TOR_NETWORK"].
9
+ *
10
+ * Deny rules (some are premium ⚠️):
11
+ * - "FRAUD", "INVALID", "TOR_NETWORK" ⚠️, "HIGH_RISK_SCORE" ⚠️
12
+ *
13
+ * @returns {Promise<boolean>} True if the IP passes all deny rules, false otherwise.
14
+ * @throws Error if token is null, rules are empty, or request fails.
15
+ *
16
+ * @example
17
+ * const valid = await isValidIP(apiToken, "52.94.236.248", { deny: ["FRAUD", "TOR_NETWORK", "COUNTRY:RU"] });
18
+ */
19
+ export declare const isValidIP: (axiosClient: AxiosInstance, ip: Interfaces.IPValidator, rules: Interfaces.IPValidatorRules) => Promise<any>;
@@ -2,6 +2,7 @@ export * from "./functions/extractWithTextly";
2
2
  export * from "./functions/getRandom";
3
3
  export * from "./functions/isValidDataRaw";
4
4
  export * from "./functions/isValidEmail";
5
+ export * from "./functions/isValidIP";
5
6
  export * from "./functions/isValidPhone";
6
7
  export * from "./functions/protectReq";
7
8
  export * from "./functions/sendEmail";
@@ -96,6 +96,25 @@ declare class DymoAPI {
96
96
  * @see [Documentation](https://docs.tpeoficial.com/docs/dymo-api/private/email-validation)
97
97
  */
98
98
  isValidEmail(email: Interfaces.EmailValidator, rules?: Interfaces.EmailValidatorRules): Promise<Interfaces.EmailValidatorResponse>;
99
+ /**
100
+ * Validates the given IP against the configured rules.
101
+ *
102
+ * This method requires either the root API key or the API key to be set.
103
+ * If neither is set, it will throw an error.
104
+ *
105
+ * @param {string} [ip] - IP address to validate.
106
+ * @param {NegativeEmailRules[]} [rules] - Optional rules for validation. Some rules are premium features.
107
+ * @important
108
+ * **⚠️ TOR_NETWORK and HIGH_RISK_SCORE are [PREMIUM](https://docs.tpeoficial.com/docs/dymo-api/private/data-verifier) features.**
109
+ * @returns {Promise<Interfaces.IPValidatorResponse>} Resolves with the validation response.
110
+ * @throws Will throw an error if validation cannot be performed.
111
+ *
112
+ * @example
113
+ * const valid = await isValidIP("52.94.236.248", { deny: ["FRAUD", "TOR_NETWORK", "COUNTRY:RU"] });
114
+ *
115
+ * @see [Documentation](https://docs.tpeoficial.com/docs/dymo-api/private/ip-validation)
116
+ */
117
+ isValidIP(ip: Interfaces.IPValidator, rules?: Interfaces.IPValidatorRules): Promise<Interfaces.IPValidatorResponse>;
99
118
  /**
100
119
  * Validates the given email against the configured rules.
101
120
  *
@@ -262,4 +281,4 @@ declare class DymoAPI {
262
281
  isValidPwd(data: Interfaces.IsValidPwdData): Promise<Interfaces.PasswordValidationResult>;
263
282
  }
264
283
  export default DymoAPI;
265
- export type { EmailValidatorRules, WafRules, NegativeEmailRules, SensitiveInfoRules, DataEmailValidationAnalysis } from "./lib/types/interfaces";
284
+ export type { EmailValidatorRules, NegativeEmailRules, DataEmailValidationAnalysis, PhoneValidatorRules, NegativePhoneRules, DataPhoneValidationAnalysis, WafRules, SensitiveInfoRules } from "./lib/types/interfaces";
@@ -64,6 +64,15 @@ export type EmailValidator = Email;
64
64
  * ⚠️ NO_MX_RECORDS, PROXIED_EMAIL, FREE_SUBDOMAIN, CORPORATE, NO_GRAVATAR, and HIGH_RISK_SCORE are premium features.
65
65
  */
66
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
+ export type IPValidator = string;
68
+ /**
69
+ * @typedef {"FRAUD"|"INVALID"|"HIGH_RISK_SCORE"} NegativeIPRules
70
+ *
71
+ * @description
72
+ * Values indicating why an email is considered negative.
73
+ * ⚠️ TOR_NETWORK and HIGH_RISK_SCORE are premium features.
74
+ */
75
+ export type NegativeIPRules = "FRAUD" | "INVALID" | "TOR_NETWORK" | "HIGH_RISK_SCORE" | `COUNTRY:${string}${string}`;
67
76
  export type PhoneValidator = Phone;
68
77
  /**
69
78
  * @typedef {"FRAUD"|"INVALID"|"HIGH_RISK_SCORE"} NegativePhoneRules
@@ -86,6 +95,19 @@ export type EmailValidatorResponse = {
86
95
  /** Detailed analysis of the email validation result. */
87
96
  response: DataEmailValidationAnalysis;
88
97
  };
98
+ /**
99
+ * Response returned by the email validator.
100
+ */
101
+ export type IPValidatorResponse = {
102
+ /** The validated email address. */
103
+ ip: string;
104
+ /** Whether the email is allowed (not blocked/fraudulent). */
105
+ allow: boolean;
106
+ /** List of rules indicating why the email may be considered negative. */
107
+ reasons: NegativeIPRules[];
108
+ /** Detailed analysis of the email validation result. */
109
+ response: DataIPValidationAnalysis;
110
+ };
89
111
  /**
90
112
  * Response returned by the phone validator.
91
113
  */
@@ -162,6 +184,70 @@ export interface DataEmailValidationAnalysis {
162
184
  urlShortener?: boolean;
163
185
  };
164
186
  }
187
+ /**
188
+ * Detailed analysis of an IP validation.
189
+ */
190
+ export interface DataIPValidationAnalysis {
191
+ /** Whether the IP address is valid. */
192
+ valid: boolean;
193
+ /** The type of IP address. */
194
+ type: "IPv4" | "IPv6" | "Invalid";
195
+ /** The IP class for the IP address. */
196
+ class: "A" | "B" | "C" | "D" | "E" | "Unknown" | "None";
197
+ /** Whether the IP address is fraudulent. */
198
+ fraud: boolean;
199
+ /** The IP address being analyzed. */
200
+ ip: string;
201
+ /** The continent for the IP address. */
202
+ continent: string;
203
+ /** The continent code for the IP address. */
204
+ continentCode: string;
205
+ /** The country for the IP address. */
206
+ country: string;
207
+ /** The country code for the IP address. */
208
+ countryCode: string;
209
+ /** The region code for the IP address. */
210
+ region: string;
211
+ /** The region name for the IP address. */
212
+ regionName: string;
213
+ /** The city for the IP address. */
214
+ city: string;
215
+ /** The district for the IP address. */
216
+ district: string;
217
+ /** The postal code for the IP address. */
218
+ zipCode: string;
219
+ /** The latitude for the IP address. */
220
+ lat: number;
221
+ /** The longitude for the IP address. */
222
+ lon: number;
223
+ /** The timezone for the IP address. */
224
+ timezone: string;
225
+ /** The timezone offset for the IP address. */
226
+ offset: number;
227
+ /** The currency for the IP address. */
228
+ currency: string;
229
+ /** The ISP for the IP address. */
230
+ isp: string;
231
+ /** The organization for the IP address. */
232
+ org: string;
233
+ /** The AS number for the IP address. */
234
+ as: string;
235
+ /** The AS name for the IP address. */
236
+ asname: string;
237
+ /** Whether the IP address is a mobile device. */
238
+ mobile: boolean;
239
+ /** Whether the IP address is a proxy. */
240
+ proxy: boolean;
241
+ /** Whether the IP address is hosting a website. */
242
+ hosting: boolean;
243
+ /** Results from optional validation plugins. */
244
+ plugins: {
245
+ /** Whether the IP address is blocked by a blocklist. */
246
+ blocklist?: boolean;
247
+ /** The risk score for the IP address. */
248
+ riskScore?: number;
249
+ };
250
+ }
165
251
  /**
166
252
  * Detailed analysis of an phone validation.
167
253
  */
@@ -297,67 +383,7 @@ export interface DataValidationAnalysis {
297
383
  };
298
384
  };
299
385
  /** IP validation result. */
300
- ip: {
301
- /** Whether the IP address is valid. */
302
- valid: boolean;
303
- /** The type of IP address. */
304
- type: "IPv4" | "IPv6" | "Invalid";
305
- /** The IP class for the IP address. */
306
- class: "A" | "B" | "C" | "D" | "E" | "Unknown" | "None";
307
- /** Whether the IP address is fraudulent. */
308
- fraud: boolean;
309
- /** The IP address being analyzed. */
310
- ip: string;
311
- /** The continent for the IP address. */
312
- continent: string;
313
- /** The continent code for the IP address. */
314
- continentCode: string;
315
- /** The country for the IP address. */
316
- country: string;
317
- /** The country code for the IP address. */
318
- countryCode: string;
319
- /** The region code for the IP address. */
320
- region: string;
321
- /** The region name for the IP address. */
322
- regionName: string;
323
- /** The city for the IP address. */
324
- city: string;
325
- /** The district for the IP address. */
326
- district: string;
327
- /** The postal code for the IP address. */
328
- zipCode: string;
329
- /** The latitude for the IP address. */
330
- lat: number;
331
- /** The longitude for the IP address. */
332
- lon: number;
333
- /** The timezone for the IP address. */
334
- timezone: string;
335
- /** The timezone offset for the IP address. */
336
- offset: number;
337
- /** The currency for the IP address. */
338
- currency: string;
339
- /** The ISP for the IP address. */
340
- isp: string;
341
- /** The organization for the IP address. */
342
- org: string;
343
- /** The AS number for the IP address. */
344
- as: string;
345
- /** The AS name for the IP address. */
346
- asname: string;
347
- /** Whether the IP address is a mobile device. */
348
- mobile: boolean;
349
- /** Whether the IP address is a proxy. */
350
- proxy: boolean;
351
- /** Whether the IP address is hosting a website. */
352
- hosting: boolean;
353
- /** Results from optional validation plugins. */
354
- plugins: {
355
- /** Whether the IP address is blocked by a blocklist. */
356
- blocklist?: boolean;
357
- /** The risk score for the IP address. */
358
- riskScore?: number;
359
- };
360
- };
386
+ ip: DataIPValidationAnalysis;
361
387
  /** Wallet validation result. */
362
388
  wallet: {
363
389
  /** Whether the wallet is valid. */
@@ -1,5 +1,5 @@
1
1
  import * as WellKnownBots from "./well-known-bots";
2
- import { NegativeEmailRules, NegativePhoneRules, NegativeSensitiveInfoRules } from "./data-verifier";
2
+ import { NegativeEmailRules, NegativeIPRules, NegativePhoneRules, NegativeSensitiveInfoRules } from "./data-verifier";
3
3
  type Mode = "LIVE" | "DRY_RUN";
4
4
  export type NegativeWafRules = "FRAUD" | "VPN" | "PROXY" | "TOR_NETWORK";
5
5
  export interface WafRules {
@@ -11,6 +11,10 @@ export interface EmailValidatorRules {
11
11
  mode?: Mode;
12
12
  deny: NegativeEmailRules[];
13
13
  }
14
+ export interface IPValidatorRules {
15
+ mode?: Mode;
16
+ deny: NegativeIPRules[];
17
+ }
14
18
  export interface PhoneValidatorRules {
15
19
  mode?: Mode;
16
20
  deny: NegativePhoneRules[];
@@ -21,6 +25,7 @@ export interface SensitiveInfoRules {
21
25
  }
22
26
  export interface Rules {
23
27
  email?: EmailValidatorRules;
28
+ ip?: IPValidatorRules;
24
29
  phone?: PhoneValidatorRules;
25
30
  sensitiveInfo?: SensitiveInfoRules;
26
31
  waf?: WafRules;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dymo-api",
3
- "version": "1.2.22",
3
+ "version": "1.2.24",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/cjs/dymo-api.js",
6
6
  "module": "dist/esm/dymo-api.js",