zynor 0.0.46 → 0.0.48
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/index.cjs +3 -3
- package/dist/index.d.ts +20 -115
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2001,6 +2001,12 @@ export interface ValidationConfig {
|
|
|
2001
2001
|
* @default false
|
|
2002
2002
|
*/
|
|
2003
2003
|
ipApi?: boolean;
|
|
2004
|
+
/**
|
|
2005
|
+
* @description This is 100% but might throagth that's why we have a fallback to findip.net
|
|
2006
|
+
* if you want to use this feature, change to true enable it
|
|
2007
|
+
* @default false
|
|
2008
|
+
*/
|
|
2009
|
+
ipWhoIs?: boolean;
|
|
2004
2010
|
};
|
|
2005
2011
|
deepValidationOptions?: {
|
|
2006
2012
|
/** Max total time (ms) for the entire deep validation phase. @default 3000 */
|
|
@@ -2048,6 +2054,7 @@ export declare class EmailValidator {
|
|
|
2048
2054
|
* @param config.options.ipResolver - Configure IP resolution settings
|
|
2049
2055
|
* @param config.options.ipResolver.findip - Settings for findip.net API
|
|
2050
2056
|
* @param config.options.ipResolver.ipApi - Enable/disable ipApi service
|
|
2057
|
+
* @param config.options.ipResolver.ipWhoIs - Enable/disable ipWhoIs service
|
|
2051
2058
|
* @param config.dns - Optional DNS configuration settings
|
|
2052
2059
|
* @returns The singleton instance of EmailValidator
|
|
2053
2060
|
* @example
|
|
@@ -2157,10 +2164,21 @@ export declare class EmailValidator {
|
|
|
2157
2164
|
webmail?: string;
|
|
2158
2165
|
}>;
|
|
2159
2166
|
private resolveA;
|
|
2167
|
+
private getIpCache;
|
|
2160
2168
|
private dnsLookup;
|
|
2161
2169
|
private returnDNS;
|
|
2162
|
-
protected ipApi(ip: string, abortOptions?: AbortOptions): Promise<
|
|
2163
|
-
|
|
2170
|
+
protected ipApi(ip: string, abortOptions?: AbortOptions): Promise<[
|
|
2171
|
+
string,
|
|
2172
|
+
string
|
|
2173
|
+
] | null>;
|
|
2174
|
+
protected ipWhoIs(ip: string, abortOptions?: AbortOptions): Promise<[
|
|
2175
|
+
string,
|
|
2176
|
+
string
|
|
2177
|
+
] | null>;
|
|
2178
|
+
protected findIp(ip: string, abortOptions?: AbortOptions): Promise<[
|
|
2179
|
+
string,
|
|
2180
|
+
string
|
|
2181
|
+
] | null>;
|
|
2164
2182
|
/**
|
|
2165
2183
|
* Checks if the given string is a valid email address according to advanced validation rules.
|
|
2166
2184
|
*
|
|
@@ -2248,26 +2266,6 @@ export declare class EmailValidator {
|
|
|
2248
2266
|
type: string;
|
|
2249
2267
|
webmail?: string;
|
|
2250
2268
|
}>;
|
|
2251
|
-
/**
|
|
2252
|
-
* Looks up IP address info using ipApi and/or findIp services.
|
|
2253
|
-
* Returns ISP, organization, geolocation, and hosting details.
|
|
2254
|
-
*
|
|
2255
|
-
* Works independently of `enableDeepValidation`. Only requires `ipResolver` config:
|
|
2256
|
-
* - `ipResolver.ipApi: true` for ip-api.com lookups
|
|
2257
|
-
* - `ipResolver.findip: { enabled: true, apiKey: [...] }` for findip.net fallback
|
|
2258
|
-
*
|
|
2259
|
-
* @param ip - The IP address to look up (e.g. "93.184.216.34")
|
|
2260
|
-
* @param abortOptions - Optional signal/timeout to cancel the operation
|
|
2261
|
-
* @returns IP info object from ipApi or findIp, or null if lookup is disabled/fails
|
|
2262
|
-
*
|
|
2263
|
-
* @example
|
|
2264
|
-
* const validator = EmailValidator.create({
|
|
2265
|
-
* options: { ipResolver: { ipApi: true } }
|
|
2266
|
-
* });
|
|
2267
|
-
* const info = await validator.lookupIpInfo('93.184.216.34');
|
|
2268
|
-
* // { status: 'success', isp: 'Edgecast Inc.', org: 'Verizon', ... }
|
|
2269
|
-
*/
|
|
2270
|
-
lookupIpInfo(ip: string, abortOptions?: AbortOptions): Promise<IPResponseData | IPResponseDataFindIp | null>;
|
|
2271
2269
|
/**
|
|
2272
2270
|
* Detects the hosting provider for a domain by resolving its A records and looking up IP info.
|
|
2273
2271
|
* Identifies providers like AWS, Microsoft, DigitalOcean, Oracle, IBM, Alibaba, and Aruba.
|
|
@@ -2472,99 +2470,6 @@ export declare class EmailValidator {
|
|
|
2472
2470
|
*/
|
|
2473
2471
|
extractEmails(content: string): string[];
|
|
2474
2472
|
}
|
|
2475
|
-
export type IPResponseData = {
|
|
2476
|
-
status: string;
|
|
2477
|
-
continent: string;
|
|
2478
|
-
continentCode: string;
|
|
2479
|
-
country: string;
|
|
2480
|
-
countryCode: string;
|
|
2481
|
-
region: string;
|
|
2482
|
-
regionName: string;
|
|
2483
|
-
city: string;
|
|
2484
|
-
zip: string;
|
|
2485
|
-
lat: number;
|
|
2486
|
-
lon: number;
|
|
2487
|
-
timezone: string;
|
|
2488
|
-
currency: string;
|
|
2489
|
-
isp: string;
|
|
2490
|
-
org: string;
|
|
2491
|
-
as: string;
|
|
2492
|
-
reverse: string;
|
|
2493
|
-
mobile: boolean;
|
|
2494
|
-
proxy: boolean;
|
|
2495
|
-
hosting: boolean;
|
|
2496
|
-
query: string;
|
|
2497
|
-
};
|
|
2498
|
-
export type IPResponseDataFindIp = {
|
|
2499
|
-
city: {
|
|
2500
|
-
geoname_id: number;
|
|
2501
|
-
names: {
|
|
2502
|
-
de: string;
|
|
2503
|
-
en: string;
|
|
2504
|
-
es: string;
|
|
2505
|
-
fa: string;
|
|
2506
|
-
fr: string;
|
|
2507
|
-
ja: string;
|
|
2508
|
-
ko: string;
|
|
2509
|
-
"pt-BR": string;
|
|
2510
|
-
ru: string;
|
|
2511
|
-
"zh-CN": string;
|
|
2512
|
-
};
|
|
2513
|
-
};
|
|
2514
|
-
continent: {
|
|
2515
|
-
code: string;
|
|
2516
|
-
geoname_id: number;
|
|
2517
|
-
names: {
|
|
2518
|
-
de: string;
|
|
2519
|
-
en: string;
|
|
2520
|
-
es: string;
|
|
2521
|
-
fa: string;
|
|
2522
|
-
fr: string;
|
|
2523
|
-
ja: string;
|
|
2524
|
-
ko: string;
|
|
2525
|
-
"pt-BR": string;
|
|
2526
|
-
ru: string;
|
|
2527
|
-
"zh-CN": string;
|
|
2528
|
-
};
|
|
2529
|
-
};
|
|
2530
|
-
country: {
|
|
2531
|
-
geoname_id: number;
|
|
2532
|
-
is_in_european_union: boolean;
|
|
2533
|
-
iso_code: string;
|
|
2534
|
-
names: {
|
|
2535
|
-
de: string;
|
|
2536
|
-
en: string;
|
|
2537
|
-
es: string;
|
|
2538
|
-
fa: string;
|
|
2539
|
-
fr: string;
|
|
2540
|
-
ja: string;
|
|
2541
|
-
ko: string;
|
|
2542
|
-
"pt-BR": string;
|
|
2543
|
-
ru: string;
|
|
2544
|
-
"zh-CN": string;
|
|
2545
|
-
};
|
|
2546
|
-
};
|
|
2547
|
-
location: {
|
|
2548
|
-
latitude: number;
|
|
2549
|
-
longitude: number;
|
|
2550
|
-
time_zone: string;
|
|
2551
|
-
weather_code: string;
|
|
2552
|
-
};
|
|
2553
|
-
subdivisions: Array<{
|
|
2554
|
-
geoname_id: number;
|
|
2555
|
-
iso_code?: string;
|
|
2556
|
-
names: {
|
|
2557
|
-
en: string;
|
|
2558
|
-
};
|
|
2559
|
-
}>;
|
|
2560
|
-
traits: {
|
|
2561
|
-
autonomous_system_number: number;
|
|
2562
|
-
autonomous_system_organization: string;
|
|
2563
|
-
connection_type: string;
|
|
2564
|
-
isp: string;
|
|
2565
|
-
user_type: string;
|
|
2566
|
-
};
|
|
2567
|
-
};
|
|
2568
2473
|
export interface Valid {
|
|
2569
2474
|
success: true;
|
|
2570
2475
|
data: {
|