zynor 0.0.77 → 0.0.85
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 +707 -15
- package/dist/index.js +3 -3
- package/dist/native.cjs +71567 -0
- package/dist/native.d.ts +3770 -0
- package/dist/native.js +71567 -0
- package/package.json +18 -2
- package/rust/zynor-native.darwin-arm64.node +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -673,6 +673,87 @@ export interface IResolver {
|
|
|
673
673
|
reverse(ip: string, options: AbortOptions): Promise<string[]>;
|
|
674
674
|
reverse(ip: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
|
|
675
675
|
}
|
|
676
|
+
declare class NativeProvider {
|
|
677
|
+
private queue;
|
|
678
|
+
private config;
|
|
679
|
+
/** Injected hickory binding, or null for the libuv path. Provided by the
|
|
680
|
+
* `'zynor/native'` entry; never loaded here. */
|
|
681
|
+
private rustBinding;
|
|
682
|
+
/**
|
|
683
|
+
* Creates a new native DNS provider instance.
|
|
684
|
+
*
|
|
685
|
+
* @param config - Provider config (concurrency, rate limiting, enabled).
|
|
686
|
+
* @param runtime - Internal: `rust` is the hickory binding injected by the
|
|
687
|
+
* `'zynor/native'` entry. When present, MX/A/AAAA/etc. route through it;
|
|
688
|
+
* when absent, everything uses libuv. Not part of the public surface.
|
|
689
|
+
*/
|
|
690
|
+
constructor(config?: ProviderConfig);
|
|
691
|
+
/**
|
|
692
|
+
* Updates the provider configuration.
|
|
693
|
+
*/
|
|
694
|
+
updateConfig(config: ProviderConfig): void;
|
|
695
|
+
get enabled(): boolean;
|
|
696
|
+
get queueSize(): number;
|
|
697
|
+
get concurrency(): number;
|
|
698
|
+
get isFull(): boolean;
|
|
699
|
+
/** Returns the injected hickory binding, or null for the libuv path.
|
|
700
|
+
* No loading happens here — the `'zynor/native'` entry injects (or
|
|
701
|
+
* refuses to construct, if the binary is missing). */
|
|
702
|
+
private rust;
|
|
703
|
+
/**
|
|
704
|
+
* Executes a function through the queue with abort/timeout support.
|
|
705
|
+
*/
|
|
706
|
+
private executeQueued;
|
|
707
|
+
/**
|
|
708
|
+
* @internal Bypasses PQueue and intervalCap. Reserved for the validator
|
|
709
|
+
* hot path. Dispatches to Rust when `useRust` is on (and binary loaded);
|
|
710
|
+
* otherwise to `dns.resolve`. Both paths remain abort-aware.
|
|
711
|
+
*/
|
|
712
|
+
_resolveDirect<T>(hostname: string, type: RecordType, options?: AbortOptions): Promise<T>;
|
|
713
|
+
/**
|
|
714
|
+
* Resolves A records for a hostname. TTL-aware variants stay on libuv.
|
|
715
|
+
*/
|
|
716
|
+
resolve4(hostname: string): Promise<string[]>;
|
|
717
|
+
resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
|
718
|
+
/** Resolves AAAA records for a hostname. TTL-aware variants stay on libuv. */
|
|
719
|
+
resolve6(hostname: string): Promise<string[]>;
|
|
720
|
+
resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
|
721
|
+
/** ANY records — Rust binding's shape doesn't mirror libuv's tagged union,
|
|
722
|
+
* so we always go through libuv. */
|
|
723
|
+
resolveAny(hostname: string, options?: AbortOptions): Promise<AnyRecord[]>;
|
|
724
|
+
resolveCaa(hostname: string, options?: AbortOptions): Promise<CaaRecord[]>;
|
|
725
|
+
resolveCname(hostname: string, options?: AbortOptions): Promise<string[]>;
|
|
726
|
+
resolveMx(hostname: string, options?: AbortOptions): Promise<MxRecord[]>;
|
|
727
|
+
resolveNaptr(hostname: string, options?: AbortOptions): Promise<NaptrRecord[]>;
|
|
728
|
+
resolveNs(hostname: string, options?: AbortOptions): Promise<string[]>;
|
|
729
|
+
resolvePtr(hostname: string, options?: AbortOptions): Promise<string[]>;
|
|
730
|
+
/** SOA. Rust returns `RustSoaRecord | null`; libuv throws on missing.
|
|
731
|
+
* Bridge: if Rust returns null, throw to match libuv contract. */
|
|
732
|
+
resolveSoa(hostname: string, options?: AbortOptions): Promise<SoaRecord>;
|
|
733
|
+
resolveSrv(hostname: string, options?: AbortOptions): Promise<SrvRecord[]>;
|
|
734
|
+
resolveTlsa(hostname: string, options?: AbortOptions): Promise<TlsaRecord[]>;
|
|
735
|
+
resolveTxt(hostname: string, options?: AbortOptions): Promise<string[][]>;
|
|
736
|
+
reverse(ip: string, options?: AbortOptions): Promise<string[]>;
|
|
737
|
+
/**
|
|
738
|
+
* Generic resolve method. Dispatches to the typed methods so that the
|
|
739
|
+
* Rust path is honored consistently — calling `resolve('gmail.com', 'MX')`
|
|
740
|
+
* with `useRust: true` goes through hickory just like `resolveMx` would.
|
|
741
|
+
*/
|
|
742
|
+
resolve(hostname: string): Promise<string[]>;
|
|
743
|
+
resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
|
744
|
+
resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
|
745
|
+
resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
|
746
|
+
resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
|
747
|
+
resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
|
748
|
+
resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
|
749
|
+
resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
|
750
|
+
resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
|
751
|
+
resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
|
752
|
+
resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
|
753
|
+
resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
|
754
|
+
resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
|
755
|
+
resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
|
756
|
+
}
|
|
676
757
|
declare const EmailProviders: readonly [
|
|
677
758
|
{
|
|
678
759
|
readonly name: "Gmail";
|
|
@@ -685,19 +766,60 @@ declare const EmailProviders: readonly [
|
|
|
685
766
|
readonly name: "Outlook";
|
|
686
767
|
readonly domains: readonly [
|
|
687
768
|
"@outlook.com",
|
|
769
|
+
"@outlook.com.au",
|
|
770
|
+
"@outlook.com.br",
|
|
771
|
+
"@outlook.cl",
|
|
772
|
+
"@outlook.cz",
|
|
773
|
+
"@outlook.de",
|
|
774
|
+
"@outlook.dk",
|
|
775
|
+
"@outlook.es",
|
|
776
|
+
"@outlook.fr",
|
|
777
|
+
"@outlook.hu",
|
|
778
|
+
"@outlook.ie",
|
|
779
|
+
"@outlook.in",
|
|
780
|
+
"@outlook.it",
|
|
781
|
+
"@outlook.jp",
|
|
782
|
+
"@outlook.kr",
|
|
783
|
+
"@outlook.lv",
|
|
784
|
+
"@outlook.my",
|
|
785
|
+
"@outlook.ph",
|
|
786
|
+
"@outlook.pt",
|
|
787
|
+
"@outlook.sa",
|
|
788
|
+
"@outlook.sg",
|
|
789
|
+
"@outlook.sk",
|
|
790
|
+
"@outlook.co.id",
|
|
791
|
+
"@outlook.co.th",
|
|
688
792
|
"@hotmail.com",
|
|
793
|
+
"@hotmail.com.ar",
|
|
794
|
+
"@hotmail.com.au",
|
|
795
|
+
"@hotmail.com.br",
|
|
689
796
|
"@hotmail.co.uk",
|
|
797
|
+
"@hotmail.de",
|
|
798
|
+
"@hotmail.es",
|
|
690
799
|
"@hotmail.fr",
|
|
800
|
+
"@hotmail.gr",
|
|
691
801
|
"@hotmail.it",
|
|
692
|
-
"@hotmail.
|
|
693
|
-
"@hotmail.
|
|
802
|
+
"@hotmail.jp",
|
|
803
|
+
"@hotmail.nl",
|
|
804
|
+
"@hotmail.no",
|
|
805
|
+
"@hotmail.se",
|
|
694
806
|
"@live.com",
|
|
807
|
+
"@live.com.ar",
|
|
808
|
+
"@live.com.au",
|
|
809
|
+
"@live.com.mx",
|
|
695
810
|
"@live.co.uk",
|
|
811
|
+
"@live.ca",
|
|
812
|
+
"@live.cl",
|
|
813
|
+
"@live.cn",
|
|
814
|
+
"@live.de",
|
|
815
|
+
"@live.dk",
|
|
696
816
|
"@live.fr",
|
|
697
|
-
"@live.nl",
|
|
698
817
|
"@live.it",
|
|
699
|
-
"@live.
|
|
700
|
-
"@live.
|
|
818
|
+
"@live.jp",
|
|
819
|
+
"@live.nl",
|
|
820
|
+
"@live.no",
|
|
821
|
+
"@live.ru",
|
|
822
|
+
"@live.se",
|
|
701
823
|
"@msn.com"
|
|
702
824
|
];
|
|
703
825
|
},
|
|
@@ -1612,6 +1734,338 @@ declare const EmailProviders: readonly [
|
|
|
1612
1734
|
"@tutamail.com",
|
|
1613
1735
|
"@keemail.me"
|
|
1614
1736
|
];
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
readonly name: "DuckDuckGo Email";
|
|
1740
|
+
readonly domains: readonly [
|
|
1741
|
+
"@duck.com"
|
|
1742
|
+
];
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
readonly name: "SimpleLogin";
|
|
1746
|
+
readonly domains: readonly [
|
|
1747
|
+
"@simplelogin.com",
|
|
1748
|
+
"@simplelogin.fr",
|
|
1749
|
+
"@simplelogin.co",
|
|
1750
|
+
"@simplelogin.io",
|
|
1751
|
+
"@aleeas.com",
|
|
1752
|
+
"@silomails.com",
|
|
1753
|
+
"@slmails.com",
|
|
1754
|
+
"@slmail.me"
|
|
1755
|
+
];
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
readonly name: "Addy.io";
|
|
1759
|
+
readonly domains: readonly [
|
|
1760
|
+
"@addy.io",
|
|
1761
|
+
"@anonaddy.com",
|
|
1762
|
+
"@anonaddy.me"
|
|
1763
|
+
];
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
readonly name: "Firefox Relay";
|
|
1767
|
+
readonly domains: readonly [
|
|
1768
|
+
"@mozmail.com"
|
|
1769
|
+
];
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
readonly name: "StartMail";
|
|
1773
|
+
readonly domains: readonly [
|
|
1774
|
+
"@startmail.com"
|
|
1775
|
+
];
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
readonly name: "Runbox";
|
|
1779
|
+
readonly domains: readonly [
|
|
1780
|
+
"@runbox.com"
|
|
1781
|
+
];
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
readonly name: "Disroot";
|
|
1785
|
+
readonly domains: readonly [
|
|
1786
|
+
"@disroot.org"
|
|
1787
|
+
];
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
readonly name: "Riseup";
|
|
1791
|
+
readonly domains: readonly [
|
|
1792
|
+
"@riseup.net"
|
|
1793
|
+
];
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
readonly name: "CounterMail";
|
|
1797
|
+
readonly domains: readonly [
|
|
1798
|
+
"@countermail.com"
|
|
1799
|
+
];
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
readonly name: "Soverin";
|
|
1803
|
+
readonly domains: readonly [
|
|
1804
|
+
"@soverin.net"
|
|
1805
|
+
];
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
readonly name: "WP";
|
|
1809
|
+
readonly domains: readonly [
|
|
1810
|
+
"@wp.pl",
|
|
1811
|
+
"@o2.pl",
|
|
1812
|
+
"@tlen.pl"
|
|
1813
|
+
];
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
readonly name: "Onet";
|
|
1817
|
+
readonly domains: readonly [
|
|
1818
|
+
"@onet.pl",
|
|
1819
|
+
"@op.pl",
|
|
1820
|
+
"@vp.pl",
|
|
1821
|
+
"@onet.eu"
|
|
1822
|
+
];
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
readonly name: "Interia";
|
|
1826
|
+
readonly domains: readonly [
|
|
1827
|
+
"@interia.pl",
|
|
1828
|
+
"@interia.eu",
|
|
1829
|
+
"@poczta.fm"
|
|
1830
|
+
];
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
readonly name: "Gazeta.pl";
|
|
1834
|
+
readonly domains: readonly [
|
|
1835
|
+
"@gazeta.pl"
|
|
1836
|
+
];
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
readonly name: "Seznam";
|
|
1840
|
+
readonly domains: readonly [
|
|
1841
|
+
"@seznam.cz",
|
|
1842
|
+
"@email.cz",
|
|
1843
|
+
"@post.cz"
|
|
1844
|
+
];
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
readonly name: "Centrum";
|
|
1848
|
+
readonly domains: readonly [
|
|
1849
|
+
"@centrum.cz",
|
|
1850
|
+
"@centrum.sk"
|
|
1851
|
+
];
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
readonly name: "Volny";
|
|
1855
|
+
readonly domains: readonly [
|
|
1856
|
+
"@volny.cz"
|
|
1857
|
+
];
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
readonly name: "Freemail HU";
|
|
1861
|
+
readonly domains: readonly [
|
|
1862
|
+
"@freemail.hu",
|
|
1863
|
+
"@citromail.hu"
|
|
1864
|
+
];
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
readonly name: "In.gr";
|
|
1868
|
+
readonly domains: readonly [
|
|
1869
|
+
"@in.gr"
|
|
1870
|
+
];
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
readonly name: "Sify";
|
|
1874
|
+
readonly domains: readonly [
|
|
1875
|
+
"@sifymail.com",
|
|
1876
|
+
"@sify.com"
|
|
1877
|
+
];
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
readonly name: "Indiatimes";
|
|
1881
|
+
readonly domains: readonly [
|
|
1882
|
+
"@indiatimes.com"
|
|
1883
|
+
];
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
readonly name: "BSNL";
|
|
1887
|
+
readonly domains: readonly [
|
|
1888
|
+
"@bsnl.in",
|
|
1889
|
+
"@dataone.in"
|
|
1890
|
+
];
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
readonly name: "Locaweb";
|
|
1894
|
+
readonly domains: readonly [
|
|
1895
|
+
"@lwmail.com.br"
|
|
1896
|
+
];
|
|
1897
|
+
},
|
|
1898
|
+
{
|
|
1899
|
+
readonly name: "Movistar";
|
|
1900
|
+
readonly domains: readonly [
|
|
1901
|
+
"@telefonica.net",
|
|
1902
|
+
"@movistar.es"
|
|
1903
|
+
];
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
readonly name: "Telkom SA";
|
|
1907
|
+
readonly domains: readonly [
|
|
1908
|
+
"@telkomsa.net",
|
|
1909
|
+
"@vodamail.co.za",
|
|
1910
|
+
"@webmail.co.za"
|
|
1911
|
+
];
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
readonly name: "BIGLOBE";
|
|
1915
|
+
readonly domains: readonly [
|
|
1916
|
+
"@biglobe.ne.jp"
|
|
1917
|
+
];
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
readonly name: "@nifty";
|
|
1921
|
+
readonly domains: readonly [
|
|
1922
|
+
"@nifty.com",
|
|
1923
|
+
"@nifty.ne.jp"
|
|
1924
|
+
];
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
readonly name: "OCN";
|
|
1928
|
+
readonly domains: readonly [
|
|
1929
|
+
"@ocn.ne.jp"
|
|
1930
|
+
];
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
readonly name: "Rakuten";
|
|
1934
|
+
readonly domains: readonly [
|
|
1935
|
+
"@rakuten.co.jp",
|
|
1936
|
+
"@gol.com"
|
|
1937
|
+
];
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
readonly name: "Excite Japan";
|
|
1941
|
+
readonly domains: readonly [
|
|
1942
|
+
"@excite.co.jp"
|
|
1943
|
+
];
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
readonly name: "So-net";
|
|
1947
|
+
readonly domains: readonly [
|
|
1948
|
+
"@so-net.ne.jp"
|
|
1949
|
+
];
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
readonly name: "Xtra";
|
|
1953
|
+
readonly domains: readonly [
|
|
1954
|
+
"@xtra.co.nz"
|
|
1955
|
+
];
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
readonly name: "Spectrum";
|
|
1959
|
+
readonly domains: readonly [
|
|
1960
|
+
"@spectrum.net"
|
|
1961
|
+
];
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
readonly name: "RoadRunner";
|
|
1965
|
+
readonly domains: readonly [
|
|
1966
|
+
"@rr.com",
|
|
1967
|
+
"@twc.com",
|
|
1968
|
+
"@roadrunner.com",
|
|
1969
|
+
"@nc.rr.com",
|
|
1970
|
+
"@sc.rr.com",
|
|
1971
|
+
"@socal.rr.com",
|
|
1972
|
+
"@tampabay.rr.com",
|
|
1973
|
+
"@cinci.rr.com",
|
|
1974
|
+
"@nycap.rr.com",
|
|
1975
|
+
"@neo.rr.com"
|
|
1976
|
+
];
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
readonly name: "Mediacom";
|
|
1980
|
+
readonly domains: readonly [
|
|
1981
|
+
"@mediacombb.net",
|
|
1982
|
+
"@mchsi.com"
|
|
1983
|
+
];
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
readonly name: "Optimum";
|
|
1987
|
+
readonly domains: readonly [
|
|
1988
|
+
"@optimum.net"
|
|
1989
|
+
];
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
readonly name: "Suddenlink";
|
|
1993
|
+
readonly domains: readonly [
|
|
1994
|
+
"@suddenlink.net"
|
|
1995
|
+
];
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
readonly name: "RCN";
|
|
1999
|
+
readonly domains: readonly [
|
|
2000
|
+
"@rcn.com"
|
|
2001
|
+
];
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
readonly name: "Breezeline";
|
|
2005
|
+
readonly domains: readonly [
|
|
2006
|
+
"@atlanticbb.net",
|
|
2007
|
+
"@breezeline.com"
|
|
2008
|
+
];
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
readonly name: "BT Internet";
|
|
2012
|
+
readonly domains: readonly [
|
|
2013
|
+
"@btinternet.com",
|
|
2014
|
+
"@btopenworld.com",
|
|
2015
|
+
"@talk21.com"
|
|
2016
|
+
];
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
readonly name: "Virgin Media";
|
|
2020
|
+
readonly domains: readonly [
|
|
2021
|
+
"@virginmedia.com",
|
|
2022
|
+
"@virgin.net"
|
|
2023
|
+
];
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
readonly name: "TalkTalk";
|
|
2027
|
+
readonly domains: readonly [
|
|
2028
|
+
"@talktalk.net"
|
|
2029
|
+
];
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
readonly name: "Plusnet";
|
|
2033
|
+
readonly domains: readonly [
|
|
2034
|
+
"@plus.net",
|
|
2035
|
+
"@force9.co.uk",
|
|
2036
|
+
"@free-online.net"
|
|
2037
|
+
];
|
|
2038
|
+
},
|
|
2039
|
+
{
|
|
2040
|
+
readonly name: "Rogers";
|
|
2041
|
+
readonly domains: readonly [
|
|
2042
|
+
"@rogers.com"
|
|
2043
|
+
];
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
readonly name: "Bell";
|
|
2047
|
+
readonly domains: readonly [
|
|
2048
|
+
"@bell.net"
|
|
2049
|
+
];
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
readonly name: "Telus";
|
|
2053
|
+
readonly domains: readonly [
|
|
2054
|
+
"@telus.net"
|
|
2055
|
+
];
|
|
2056
|
+
},
|
|
2057
|
+
{
|
|
2058
|
+
readonly name: "Videotron";
|
|
2059
|
+
readonly domains: readonly [
|
|
2060
|
+
"@videotron.ca",
|
|
2061
|
+
"@videotron.qc.ca"
|
|
2062
|
+
];
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
readonly name: "Cogeco";
|
|
2066
|
+
readonly domains: readonly [
|
|
2067
|
+
"@cogeco.ca"
|
|
2068
|
+
];
|
|
1615
2069
|
}
|
|
1616
2070
|
];
|
|
1617
2071
|
export type ProviderNames = typeof EmailProviders[number]["name"];
|
|
@@ -2095,7 +2549,7 @@ declare const records: readonly [
|
|
|
2095
2549
|
readonly mx: "..................";
|
|
2096
2550
|
}
|
|
2097
2551
|
];
|
|
2098
|
-
type
|
|
2552
|
+
export type EmailProviderName = typeof records[number]["name"] | ProviderNames;
|
|
2099
2553
|
/**
|
|
2100
2554
|
* Logger signature for debug output. Receives one preformatted line per event.
|
|
2101
2555
|
*/
|
|
@@ -2186,7 +2640,6 @@ export interface ValidateCacheEntry {
|
|
|
2186
2640
|
method?: "shallow" | "deep";
|
|
2187
2641
|
}
|
|
2188
2642
|
export declare class EmailValidator {
|
|
2189
|
-
private resolver;
|
|
2190
2643
|
private findIpKeys;
|
|
2191
2644
|
private roles;
|
|
2192
2645
|
private records;
|
|
@@ -2205,6 +2658,18 @@ export declare class EmailValidator {
|
|
|
2205
2658
|
options?: ValidationConfig;
|
|
2206
2659
|
dns?: Omit<ZynorConfig, "cache">;
|
|
2207
2660
|
});
|
|
2661
|
+
/**
|
|
2662
|
+
* @internal Overridable factory for the internal DNS resolver. Base
|
|
2663
|
+
* implementation returns a libuv-backed {@link Zynor} (quad9 off,
|
|
2664
|
+
* cache off). The subclass exported from `'zynor/native'` overrides
|
|
2665
|
+
* this to return a hickory-Rust-backed Zynor instead, so users of
|
|
2666
|
+
* that subpath get the Rust DNS engine without any public config
|
|
2667
|
+
* knob.
|
|
2668
|
+
*
|
|
2669
|
+
* Called from the constructor; JS method dispatch goes through the
|
|
2670
|
+
* actual class of `this`, so subclass overrides fire correctly.
|
|
2671
|
+
*/
|
|
2672
|
+
protected createDns(config?: Omit<ZynorConfig, "cache">): Zynor;
|
|
2208
2673
|
/**
|
|
2209
2674
|
* Creates or returns an existing instance of the EmailValidator (Singleton pattern)
|
|
2210
2675
|
* @param config - Configuration object for the EmailValidator
|
|
@@ -2347,6 +2812,66 @@ export declare class EmailValidator {
|
|
|
2347
2812
|
signal?: AbortSignal;
|
|
2348
2813
|
timeout?: number;
|
|
2349
2814
|
}): Promise<EmailResponse[]>;
|
|
2815
|
+
/**
|
|
2816
|
+
* Streams validation results as they complete, in completion order.
|
|
2817
|
+
*
|
|
2818
|
+
* Unlike {@link validateBulk}, which waits for every input before returning,
|
|
2819
|
+
* `each` invokes `onBatch` as soon as enough results have accumulated
|
|
2820
|
+
* (`returnBatch`, default 10) and continues until every input has been
|
|
2821
|
+
* processed. Designed for very large inputs (millions) where time-to-first
|
|
2822
|
+
* result matters and holding the entire result array in memory is wasteful.
|
|
2823
|
+
*
|
|
2824
|
+
* Concurrency is controlled here, not by the DNS layer: every validation
|
|
2825
|
+
* routes through the validator-internal direct path, which bypasses the
|
|
2826
|
+
* per-provider PQueue and rate limiter. DoH providers are load-balanced
|
|
2827
|
+
* round-robin per validation.
|
|
2828
|
+
*
|
|
2829
|
+
* Backpressure: `onBatch` is awaited serially. If the callback is slow and
|
|
2830
|
+
* the in-memory buffer reaches `10 * returnBatch`, workers pause picking
|
|
2831
|
+
* new emails until the buffer drains below the cap. This keeps memory
|
|
2832
|
+
* bounded for truly large inputs.
|
|
2833
|
+
*
|
|
2834
|
+
* Errors:
|
|
2835
|
+
* - Per-email errors become error-shaped {@link EmailResponse} entries in
|
|
2836
|
+
* the stream — they never abort the batch.
|
|
2837
|
+
* - An error thrown by `onBatch` aborts production: workers stop picking
|
|
2838
|
+
* new emails, in-flight work is awaited, and the returned promise
|
|
2839
|
+
* rejects with the first such error.
|
|
2840
|
+
*
|
|
2841
|
+
* Abort: when the supplied `signal` fires, workers stop picking new
|
|
2842
|
+
* emails, in-flight validations finish, the buffer is flushed via
|
|
2843
|
+
* `onBatch`, and the returned promise resolves cleanly.
|
|
2844
|
+
*
|
|
2845
|
+
* @param emails - The list of email addresses to validate
|
|
2846
|
+
* @param options - Streaming options
|
|
2847
|
+
* @param options.concurrency - Max parallel validations (default 500)
|
|
2848
|
+
* @param options.returnBatch - Min results buffered before invoking onBatch (default 10)
|
|
2849
|
+
* @param options.deep - Enable deep validation per email
|
|
2850
|
+
* @param options.logo - Fetch provider logo per email
|
|
2851
|
+
* @param options.signal - AbortSignal to cancel the batch
|
|
2852
|
+
* @param options.timeout - Per-validation timeout in ms
|
|
2853
|
+
* @param onBatch - Invoked with each completed batch; may return a Promise
|
|
2854
|
+
* @returns Resolves once every input has been processed and flushed
|
|
2855
|
+
*
|
|
2856
|
+
* @example
|
|
2857
|
+
* ```typescript
|
|
2858
|
+
* await validator.each(
|
|
2859
|
+
* emails, // could be millions
|
|
2860
|
+
* { concurrency: 500, returnBatch: 50, deep: true },
|
|
2861
|
+
* async (batch) => {
|
|
2862
|
+
* await db.insertMany(batch);
|
|
2863
|
+
* },
|
|
2864
|
+
* );
|
|
2865
|
+
* ```
|
|
2866
|
+
*/
|
|
2867
|
+
each(emails: string[], options: {
|
|
2868
|
+
concurrency?: number;
|
|
2869
|
+
returnBatch?: number;
|
|
2870
|
+
deep?: boolean;
|
|
2871
|
+
logo?: boolean;
|
|
2872
|
+
signal?: AbortSignal;
|
|
2873
|
+
timeout?: number;
|
|
2874
|
+
} | undefined, onBatch: (batch: EmailResponse[]) => void | Promise<void>): Promise<void>;
|
|
2350
2875
|
private is_wale4r_zimbra;
|
|
2351
2876
|
private is_zimbra;
|
|
2352
2877
|
private is_webmail;
|
|
@@ -2591,11 +3116,11 @@ export declare class EmailValidator {
|
|
|
2591
3116
|
* business/enterprise providers, and many others. See the provider list for complete coverage.
|
|
2592
3117
|
*
|
|
2593
3118
|
* @overload
|
|
2594
|
-
* @param {
|
|
3119
|
+
* @param {EmailProviderName} provider - The name of the email provider (e.g., "Gmail", "Yahoo", "Outlook").
|
|
2595
3120
|
* @returns {string | null} The webmail URL for the provider, or `null` if not found.
|
|
2596
3121
|
*
|
|
2597
3122
|
* @overload
|
|
2598
|
-
* @param {
|
|
3123
|
+
* @param {EmailProviderName} provider - The name of the email provider.
|
|
2599
3124
|
* @param {string} domainOrEmail - A domain name (e.g., "example.com") or email address (e.g., "user@example.com").
|
|
2600
3125
|
* Used as a fallback if the provider name doesn't have a direct URL mapping.
|
|
2601
3126
|
* @returns {string | null} The webmail URL for the provider/domain, or `null` if not found.
|
|
@@ -2635,8 +3160,8 @@ export declare class EmailValidator {
|
|
|
2635
3160
|
* validator.getProviderWebmailUrl("CustomProvider", "customdomain.com");
|
|
2636
3161
|
* // May return a URL if the domain is recognized as a free provider
|
|
2637
3162
|
*/
|
|
2638
|
-
getProviderWebmailUrl(provider:
|
|
2639
|
-
getProviderWebmailUrl(provider:
|
|
3163
|
+
getProviderWebmailUrl(provider: EmailProviderName): string | null;
|
|
3164
|
+
getProviderWebmailUrl(provider: EmailProviderName, domainOrEmail: string): string | null;
|
|
2640
3165
|
getProviderWebmailUrl(domainOrEmail: string): string | null;
|
|
2641
3166
|
/**
|
|
2642
3167
|
* Extract and validate email addresses from mixed HTML or plain-text content.
|
|
@@ -2671,7 +3196,7 @@ export declare class EmailValidator {
|
|
|
2671
3196
|
export interface Valid {
|
|
2672
3197
|
success: true;
|
|
2673
3198
|
data: {
|
|
2674
|
-
provider:
|
|
3199
|
+
provider: EmailProviderName;
|
|
2675
3200
|
isFree: boolean;
|
|
2676
3201
|
email: string;
|
|
2677
3202
|
role: boolean;
|
|
@@ -2687,7 +3212,7 @@ export interface Invalid {
|
|
|
2687
3212
|
email: string;
|
|
2688
3213
|
role: boolean;
|
|
2689
3214
|
}
|
|
2690
|
-
interface
|
|
3215
|
+
export interface EmailDisposable {
|
|
2691
3216
|
success: false;
|
|
2692
3217
|
type: "Disposable";
|
|
2693
3218
|
email: string;
|
|
@@ -2705,14 +3230,89 @@ export interface Syntax {
|
|
|
2705
3230
|
email: string;
|
|
2706
3231
|
role: boolean;
|
|
2707
3232
|
}
|
|
2708
|
-
interface
|
|
3233
|
+
export interface EmailError {
|
|
2709
3234
|
success: false;
|
|
2710
3235
|
type: "Error";
|
|
2711
3236
|
email: string;
|
|
2712
3237
|
message: string;
|
|
2713
3238
|
role: boolean;
|
|
2714
3239
|
}
|
|
2715
|
-
export type EmailResponse = Valid | Invalid | Rejected | Syntax |
|
|
3240
|
+
export type EmailResponse = Valid | Invalid | Rejected | Syntax | EmailError | EmailDisposable;
|
|
3241
|
+
export interface RustResolveOptions {
|
|
3242
|
+
/** Hard deadline in milliseconds. Rust task self-cancels at the
|
|
3243
|
+
* boundary; prevents orphan tasks if the JS caller's watchdog gives
|
|
3244
|
+
* up first. `| undefined` is explicit so callers can spread
|
|
3245
|
+
* `{ timeoutMs: options?.timeout }` under exactOptionalPropertyTypes. */
|
|
3246
|
+
timeoutMs?: number | undefined;
|
|
3247
|
+
}
|
|
3248
|
+
export interface RustMxRecord {
|
|
3249
|
+
exchange: string;
|
|
3250
|
+
priority: number;
|
|
3251
|
+
}
|
|
3252
|
+
export interface RustSrvRecord {
|
|
3253
|
+
priority: number;
|
|
3254
|
+
weight: number;
|
|
3255
|
+
port: number;
|
|
3256
|
+
name: string;
|
|
3257
|
+
}
|
|
3258
|
+
export interface RustSoaRecord {
|
|
3259
|
+
nsname: string;
|
|
3260
|
+
hostmaster: string;
|
|
3261
|
+
serial: number;
|
|
3262
|
+
refresh: number;
|
|
3263
|
+
retry: number;
|
|
3264
|
+
expire: number;
|
|
3265
|
+
minttl: number;
|
|
3266
|
+
}
|
|
3267
|
+
export interface RustCaaRecord {
|
|
3268
|
+
/** 128 when issuer-critical bit set, 0 otherwise (mirrors libuv). */
|
|
3269
|
+
critical: number;
|
|
3270
|
+
issue?: string;
|
|
3271
|
+
issuewild?: string;
|
|
3272
|
+
iodef?: string;
|
|
3273
|
+
}
|
|
3274
|
+
export interface RustNaptrRecord {
|
|
3275
|
+
order: number;
|
|
3276
|
+
preference: number;
|
|
3277
|
+
flags: string;
|
|
3278
|
+
service: string;
|
|
3279
|
+
regexp: string;
|
|
3280
|
+
replacement: string;
|
|
3281
|
+
}
|
|
3282
|
+
/** TLSA. Note: field is `matching` (not `match`); the validator-side
|
|
3283
|
+
* adapter renames if needed for the public TS type. */
|
|
3284
|
+
export interface RustTlsaRecord {
|
|
3285
|
+
certUsage: number;
|
|
3286
|
+
selector: number;
|
|
3287
|
+
matching: number;
|
|
3288
|
+
data: Uint8Array;
|
|
3289
|
+
}
|
|
3290
|
+
/** Generic envelope for `resolveAny`. Different shape from node:dns's
|
|
3291
|
+
* tagged union — `kind` is the record-type name ("A", "MX", …) and
|
|
3292
|
+
* `data` is hickory's textual rendering. The validator's hot path
|
|
3293
|
+
* doesn't use ANY, so divergence is acceptable. */
|
|
3294
|
+
export interface RustAnyRecord {
|
|
3295
|
+
kind: string;
|
|
3296
|
+
data: string;
|
|
3297
|
+
ttl: number;
|
|
3298
|
+
}
|
|
3299
|
+
export interface RustBinding {
|
|
3300
|
+
resolveMx(hostname: string, options?: RustResolveOptions | null): Promise<RustMxRecord[]>;
|
|
3301
|
+
resolveA(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
|
|
3302
|
+
resolveAaaa(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
|
|
3303
|
+
resolveCname(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
|
|
3304
|
+
resolveTxt(hostname: string, options?: RustResolveOptions | null): Promise<string[][]>;
|
|
3305
|
+
resolveNs(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
|
|
3306
|
+
resolvePtr(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
|
|
3307
|
+
resolveSrv(hostname: string, options?: RustResolveOptions | null): Promise<RustSrvRecord[]>;
|
|
3308
|
+
resolveSoa(hostname: string, options?: RustResolveOptions | null): Promise<RustSoaRecord | null>;
|
|
3309
|
+
resolveCaa(hostname: string, options?: RustResolveOptions | null): Promise<RustCaaRecord[]>;
|
|
3310
|
+
resolveNaptr(hostname: string, options?: RustResolveOptions | null): Promise<RustNaptrRecord[]>;
|
|
3311
|
+
resolveTlsa(hostname: string, options?: RustResolveOptions | null): Promise<RustTlsaRecord[]>;
|
|
3312
|
+
resolveAny(hostname: string, options?: RustResolveOptions | null): Promise<RustAnyRecord[]>;
|
|
3313
|
+
reverseLookup(ip: string, options?: RustResolveOptions | null): Promise<string[]>;
|
|
3314
|
+
buildInfo?(): string;
|
|
3315
|
+
}
|
|
2716
3316
|
/**
|
|
2717
3317
|
* Main DNS resolver class that aggregates multiple DNS providers.
|
|
2718
3318
|
*/
|
|
@@ -2722,6 +3322,25 @@ export declare class Zynor {
|
|
|
2722
3322
|
private dnsCache;
|
|
2723
3323
|
private dnsTtl;
|
|
2724
3324
|
private inflight;
|
|
3325
|
+
private rrIndex;
|
|
3326
|
+
protected rust: RustBinding | null;
|
|
3327
|
+
private dnsInFlight;
|
|
3328
|
+
/** Epoch-ms until which a DoH provider is considered failing and excluded
|
|
3329
|
+
* from {@link pickFreestProvider}. Native is never paused — libuv errors
|
|
3330
|
+
* are local concerns, not upstream-health signals. */
|
|
3331
|
+
private dohPausedUntil;
|
|
3332
|
+
/** Consecutive-failure counters per provider; reset on any success. We only
|
|
3333
|
+
* pause once a provider's streak exceeds {@link DOH_PAUSE_AFTER}, so single
|
|
3334
|
+
* transient errors don't cascade-pause healthy providers under high load. */
|
|
3335
|
+
private dohFailureStreak;
|
|
3336
|
+
private static readonly DOH_PAUSE_MS;
|
|
3337
|
+
private static readonly DOH_PAUSE_AFTER;
|
|
3338
|
+
/** Native's reported `concurrency` (default 50) is the PQueue limit, which
|
|
3339
|
+
* the validator path bypasses anyway. The *real* parallel ceiling is
|
|
3340
|
+
* libuv's getaddrinfo thread pool — defaults to 4 unless UV_THREADPOOL_SIZE
|
|
3341
|
+
* is set. {@link pickFreestProvider} uses this to weight native correctly
|
|
3342
|
+
* in load balancing instead of dumping 60%+ of traffic on libuv. */
|
|
3343
|
+
private static readonly NATIVE_EFFECTIVE_CONCURRENCY;
|
|
2725
3344
|
/**
|
|
2726
3345
|
* Creates a new Zynor resolver instance.
|
|
2727
3346
|
* @param config - Configuration for all providers
|
|
@@ -2774,6 +3393,18 @@ export declare class Zynor {
|
|
|
2774
3393
|
* Initializes all DNS providers with their configurations.
|
|
2775
3394
|
*/
|
|
2776
3395
|
private initializeProviders;
|
|
3396
|
+
/**
|
|
3397
|
+
* @internal Overridable factory for the `native` provider. Base
|
|
3398
|
+
* implementation returns a libuv-backed NativeProvider. The subclass
|
|
3399
|
+
* exported from `'zynor/native'` overrides this to inject `useRust: true`
|
|
3400
|
+
* so importers of that subpath get the hickory-dns binding.
|
|
3401
|
+
*
|
|
3402
|
+
* Called from {@link initializeProviders} during construction. JS method
|
|
3403
|
+
* dispatch resolves through the *actual* class of `this`, so subclass
|
|
3404
|
+
* overrides fire correctly even though the call site is in the base
|
|
3405
|
+
* constructor's code path.
|
|
3406
|
+
*/
|
|
3407
|
+
protected createNativeProvider(config?: ProviderConfig): NativeProvider;
|
|
2777
3408
|
/**
|
|
2778
3409
|
* Sets configuration for a specific provider.
|
|
2779
3410
|
* @param provider - The provider name
|
|
@@ -3000,6 +3631,41 @@ export declare class Zynor {
|
|
|
3000
3631
|
* ```
|
|
3001
3632
|
*/
|
|
3002
3633
|
resolve: IResolver["resolve"];
|
|
3634
|
+
/**
|
|
3635
|
+
* @internal Validator-only. Picks the enabled provider with the lowest
|
|
3636
|
+
* load ratio (`inFlight / effectiveCapacity`), which yields a distribution
|
|
3637
|
+
* proportional to each provider's capacity even when total in-flight far
|
|
3638
|
+
* exceeds total capacity. A simple slack-based picker over-saturates
|
|
3639
|
+
* everyone equally above their cap and effectively ignores weights; the
|
|
3640
|
+
* ratio formulation keeps weights honest at any load level.
|
|
3641
|
+
*
|
|
3642
|
+
* Native is included but its effective cap is clamped to libuv's
|
|
3643
|
+
* getaddrinfo pool ({@link NATIVE_EFFECTIVE_CONCURRENCY}, defaults to
|
|
3644
|
+
* UV_THREADPOOL_SIZE or 4) — otherwise the validator would dump 50+ in-
|
|
3645
|
+
* flight lookups onto a 4-thread pool. Paused DoH providers are excluded;
|
|
3646
|
+
* if every enabled provider is paused, the filter is dropped.
|
|
3647
|
+
*
|
|
3648
|
+
* RR breaks ties so even loads spread.
|
|
3649
|
+
*/
|
|
3650
|
+
private pickFreestProvider;
|
|
3651
|
+
/**
|
|
3652
|
+
* Distinguishes "this provider is broken/slow" from cases that don't
|
|
3653
|
+
* indicate provider health:
|
|
3654
|
+
* - DNS-level no-such-name answers (ENOTFOUND/NODATA): authoritative,
|
|
3655
|
+
* not the provider's fault.
|
|
3656
|
+
* - AbortError: caller-initiated cancellation or per-call timeout.
|
|
3657
|
+
* A user's tight deadline shouldn't make us blacklist a healthy provider.
|
|
3658
|
+
*/
|
|
3659
|
+
private isProviderFailure;
|
|
3660
|
+
/**
|
|
3661
|
+
* @internal Validator-only. Direct DNS path that bypasses the per-provider
|
|
3662
|
+
* PQueue and rate limiter while keeping LRU cache + singleflight. Provider
|
|
3663
|
+
* is chosen by least-loaded-first (the validator does not need to know or
|
|
3664
|
+
* pick); the in-flight counter is incremented inside the singleflight
|
|
3665
|
+
* closure so coalesced waiters don't overcount upstream load. Public
|
|
3666
|
+
* consumers must continue to use the queued resolve* methods.
|
|
3667
|
+
*/
|
|
3668
|
+
_resolveDirect<T>(hostname: string, type: RecordType, options?: AbortOptions): Promise<T>;
|
|
3003
3669
|
/**
|
|
3004
3670
|
* Returns the sum of concurrency limits across all enabled DNS providers.
|
|
3005
3671
|
* Used by `validateBulk` to determine default parallelism.
|
|
@@ -3029,6 +3695,32 @@ export declare class Zynor {
|
|
|
3029
3695
|
signal?: AbortSignal;
|
|
3030
3696
|
timeout?: number;
|
|
3031
3697
|
}): Promise<EmailResponse[]>;
|
|
3698
|
+
/**
|
|
3699
|
+
* Streams validation results as they complete. Forwards to
|
|
3700
|
+
* {@link EmailValidator.each} on the singleton validator. See `each` for
|
|
3701
|
+
* full semantics — defaults are `concurrency: 500`, `returnBatch: 10`, and
|
|
3702
|
+
* all validator-routed DNS calls bypass the per-provider queue.
|
|
3703
|
+
*
|
|
3704
|
+
* @param emails - The list of email addresses to validate
|
|
3705
|
+
* @param options - Streaming options (concurrency, returnBatch, deep, etc.)
|
|
3706
|
+
* @param onBatch - Callback invoked with each completed batch
|
|
3707
|
+
* @returns Resolves once every input has been processed and flushed
|
|
3708
|
+
*
|
|
3709
|
+
* @example
|
|
3710
|
+
* ```typescript
|
|
3711
|
+
* await Zynor.each(emails, { returnBatch: 50 }, async (batch) => {
|
|
3712
|
+
* await db.insertMany(batch);
|
|
3713
|
+
* });
|
|
3714
|
+
* ```
|
|
3715
|
+
*/
|
|
3716
|
+
static each(emails: string[], options: {
|
|
3717
|
+
concurrency?: number;
|
|
3718
|
+
returnBatch?: number;
|
|
3719
|
+
deep?: boolean;
|
|
3720
|
+
logo?: boolean;
|
|
3721
|
+
signal?: AbortSignal;
|
|
3722
|
+
timeout?: number;
|
|
3723
|
+
} | undefined, onBatch: Parameters<EmailValidator["each"]>[2]): Promise<void>;
|
|
3032
3724
|
}
|
|
3033
3725
|
/**
|
|
3034
3726
|
* Resets the default resolver instance.
|