@push.rocks/smartnetwork 4.5.2 β 4.7.0
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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/index.d.ts +2 -0
- package/dist_ts/index.js +2 -1
- package/dist_ts/smartnetwork.classes.domainintelligence.d.ts +170 -0
- package/dist_ts/smartnetwork.classes.domainintelligence.js +542 -0
- package/dist_ts/smartnetwork.classes.ipintelligence.d.ts +16 -0
- package/dist_ts/smartnetwork.classes.ipintelligence.js +100 -18
- package/dist_ts/smartnetwork.classes.smartnetwork.d.ts +23 -2
- package/dist_ts/smartnetwork.classes.smartnetwork.js +52 -8
- package/package.json +1 -1
- package/readme.md +115 -8
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/index.ts +2 -0
- package/ts/smartnetwork.classes.domainintelligence.ts +659 -0
- package/ts/smartnetwork.classes.ipintelligence.ts +119 -16
- package/ts/smartnetwork.classes.smartnetwork.ts +56 -7
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @push.rocks/smartnetwork π
|
|
2
2
|
|
|
3
|
-
Comprehensive network diagnostics and
|
|
3
|
+
Comprehensive network diagnostics and intelligence for Node.js β speed tests, port scanning, ICMP ping, traceroute, DNS, IP & domain RDAP, ASN lookups, geolocation, and DNS record enrichment in a single, promise-based toolkit.
|
|
4
4
|
|
|
5
5
|
## Issue Reporting and Security
|
|
6
6
|
|
|
@@ -14,9 +14,9 @@ pnpm install @push.rocks/smartnetwork --save
|
|
|
14
14
|
|
|
15
15
|
## π― Overview
|
|
16
16
|
|
|
17
|
-
**@push.rocks/smartnetwork** is your Swiss Army knife for network diagnostics in Node.js. Whether you're building monitoring dashboards, investigating IP ownership, or debugging connectivity β this library has you covered with a clean, async API and zero-config setup.
|
|
17
|
+
**@push.rocks/smartnetwork** is your Swiss Army knife for network diagnostics in Node.js. Whether you're building monitoring dashboards, investigating IP/domain ownership, or debugging connectivity β this library has you covered with a clean, async API and zero-config setup.
|
|
18
18
|
|
|
19
|
-
Under the hood, system-level operations (ICMP ping, traceroute, raw-socket port checks, gateway detection) are powered by a bundled **Rust binary** for maximum performance and cross-platform reliability. Everything else β speed tests, DNS, public IP discovery, IP intelligence, HTTP health checks β runs in pure TypeScript.
|
|
19
|
+
Under the hood, system-level operations (ICMP ping, traceroute, raw-socket port checks, gateway detection) are powered by a bundled **Rust binary** for maximum performance and cross-platform reliability. Everything else β speed tests, DNS, public IP discovery, IP & domain intelligence, HTTP health checks β runs in pure TypeScript.
|
|
20
20
|
|
|
21
21
|
### β¨ Key Features
|
|
22
22
|
|
|
@@ -27,6 +27,7 @@ Under the hood, system-level operations (ICMP ping, traceroute, raw-socket port
|
|
|
27
27
|
| π‘ **Connectivity** | ICMP ping with stats, hop-by-hop traceroute, HTTP/HTTPS health checks |
|
|
28
28
|
| π **DNS** | A, AAAA, MX resolution with system-first + DoH fallback strategy |
|
|
29
29
|
| π **IP Intelligence** | ASN, organization, geolocation, RDAP registration β all from free public sources |
|
|
30
|
+
| π’ **Domain Intelligence** | RDAP registrar/registrant, nameservers, events, DNSSEC, plus DNS enrichment (A/AAAA/MX/TXT/SOA) |
|
|
30
31
|
| π₯οΈ **Network Discovery** | Interfaces, default gateway, public IPv4/IPv6 |
|
|
31
32
|
| β‘ **Caching** | Built-in TTL cache for expensive lookups |
|
|
32
33
|
| π§ **Extensible** | Plugin architecture for custom functionality |
|
|
@@ -46,7 +47,7 @@ await network.start();
|
|
|
46
47
|
|
|
47
48
|
// ... use the network instance ...
|
|
48
49
|
|
|
49
|
-
// Clean up when done
|
|
50
|
+
// Clean up when done β tears down both the Rust bridge and the smartdns backend
|
|
50
51
|
await network.stop();
|
|
51
52
|
```
|
|
52
53
|
|
|
@@ -76,6 +77,7 @@ console.log(intel);
|
|
|
76
77
|
// registrantOrg: 'Google LLC',
|
|
77
78
|
// registrantCountry: 'United States',
|
|
78
79
|
// networkRange: '8.8.8.0/24',
|
|
80
|
+
// networkCidrs: ['8.8.8.0/24'],
|
|
79
81
|
// abuseContact: null,
|
|
80
82
|
// country: null,
|
|
81
83
|
// countryCode: 'US',
|
|
@@ -108,7 +110,8 @@ interface IIpIntelligenceResult {
|
|
|
108
110
|
// Registration (RDAP)
|
|
109
111
|
registrantOrg: string | null;
|
|
110
112
|
registrantCountry: string | null;
|
|
111
|
-
networkRange: string | null; // CIDR or range
|
|
113
|
+
networkRange: string | null; // primary CIDR, or legacy start-end range when multiple CIDRs are needed
|
|
114
|
+
networkCidrs: string[] | null; // canonical CIDR coverage for the RDAP network when available
|
|
112
115
|
abuseContact: string | null; // abuse email from RDAP
|
|
113
116
|
|
|
114
117
|
// Geolocation (MaxMind GeoLite2)
|
|
@@ -126,6 +129,104 @@ interface IIpIntelligenceResult {
|
|
|
126
129
|
|
|
127
130
|
---
|
|
128
131
|
|
|
132
|
+
### π’ Domain Intelligence
|
|
133
|
+
|
|
134
|
+
Get comprehensive domain registration and DNS data. Runs an **RDAP layer** and a **DNS layer** in parallel, then merges results:
|
|
135
|
+
|
|
136
|
+
- **RDAP** β queries the correct registry RDAP server (discovered via the [IANA DNS bootstrap](https://data.iana.org/rdap/dns.json)) for registrar, registrant, events, status flags, DNSSEC, and abuse contacts
|
|
137
|
+
- **DNS** β queries A, AAAA, NS, MX, TXT, and SOA records via `@push.rocks/smartdns` (system resolver first, DoH fallback)
|
|
138
|
+
|
|
139
|
+
For gTLDs (`.com`, `.org`, `.net`, etc.) you get the full picture from both layers. For ccTLDs without RDAP support (`.de`, `.fr`, `.nl`, etc.), the DNS layer fills in nameservers, resolved IPs, MX, TXT, and SOA β so you still get useful intelligence even when RDAP isn't available.
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
const info = await network.getDomainIntelligence('google.com');
|
|
143
|
+
|
|
144
|
+
console.log(info);
|
|
145
|
+
// {
|
|
146
|
+
// domain: 'google.com',
|
|
147
|
+
// handle: '2138514_DOMAIN_COM-VRSN',
|
|
148
|
+
// status: ['client delete prohibited', 'server transfer prohibited', ...],
|
|
149
|
+
// registrationDate: '1997-09-15T04:00:00Z',
|
|
150
|
+
// expirationDate: '2028-09-14T04:00:00Z',
|
|
151
|
+
// lastChangedDate: '2019-09-09T15:39:04Z',
|
|
152
|
+
// registrarName: 'MarkMonitor Inc.',
|
|
153
|
+
// registrarIanaId: 292,
|
|
154
|
+
// registrantOrg: null, // often redacted under GDPR
|
|
155
|
+
// registrantCountry: null,
|
|
156
|
+
// abuseEmail: 'abusecomplaints@markmonitor.com',
|
|
157
|
+
// abusePhone: '+1.2086851750',
|
|
158
|
+
// nameservers: ['ns1.google.com', 'ns2.google.com', 'ns3.google.com', 'ns4.google.com'],
|
|
159
|
+
// dnssec: false,
|
|
160
|
+
// nameserversSource: 'rdap',
|
|
161
|
+
// resolvedIpv4: ['142.251.20.102', '142.251.20.113', ...],
|
|
162
|
+
// resolvedIpv6: ['2a00:1450:4001:c15::8b', ...],
|
|
163
|
+
// mxRecords: [{ priority: 10, exchange: 'smtp.google.com' }],
|
|
164
|
+
// txtRecords: ['v=spf1 include:_spf.google.com ~all', ...],
|
|
165
|
+
// soaRecord: 'ns1.google.com dns-admin.google.com 895796075 900 900 1800 60'
|
|
166
|
+
// }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Works with ccTLDs that don't have RDAP (like `.de`):
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
const deInfo = await network.getDomainIntelligence('bund.de');
|
|
173
|
+
console.log(deInfo.registrarName); // null (no .de RDAP)
|
|
174
|
+
console.log(deInfo.nameservers); // ['bamberg.bund.de', 'argon.bund.de', ...]
|
|
175
|
+
console.log(deInfo.nameserversSource); // 'dns' β nameservers came from DNS, not RDAP
|
|
176
|
+
console.log(deInfo.resolvedIpv4); // ['80.245.156.34']
|
|
177
|
+
console.log(deInfo.mxRecords); // [{priority: 10, exchange: 'mx1.bund.de'}, ...]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Handles IDN (internationalized domain names) automatically:
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
const idn = await network.getDomainIntelligence('mΓΌnchen.de');
|
|
184
|
+
console.log(idn.domain); // 'xn--mnchen-3ya.de' β normalized to punycode
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The `IDomainIntelligenceResult` interface:
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
interface IDomainIntelligenceResult {
|
|
191
|
+
domain: string | null; // normalized ASCII form
|
|
192
|
+
handle: string | null; // registry handle
|
|
193
|
+
status: string[] | null; // EPP status codes
|
|
194
|
+
|
|
195
|
+
// Registration lifecycle (ISO 8601)
|
|
196
|
+
registrationDate: string | null;
|
|
197
|
+
expirationDate: string | null;
|
|
198
|
+
lastChangedDate: string | null;
|
|
199
|
+
|
|
200
|
+
// Registrar
|
|
201
|
+
registrarName: string | null;
|
|
202
|
+
registrarIanaId: number | null;
|
|
203
|
+
|
|
204
|
+
// Registrant (often redacted under GDPR)
|
|
205
|
+
registrantOrg: string | null;
|
|
206
|
+
registrantCountry: string | null;
|
|
207
|
+
|
|
208
|
+
// Abuse contact
|
|
209
|
+
abuseEmail: string | null;
|
|
210
|
+
abusePhone: string | null;
|
|
211
|
+
|
|
212
|
+
// Technical
|
|
213
|
+
nameservers: string[] | null;
|
|
214
|
+
dnssec: boolean | null; // secureDNS.delegationSigned from RDAP
|
|
215
|
+
nameserversSource: 'rdap' | 'dns' | null;
|
|
216
|
+
|
|
217
|
+
// DNS enrichment
|
|
218
|
+
resolvedIpv4: string[] | null; // A records
|
|
219
|
+
resolvedIpv6: string[] | null; // AAAA records
|
|
220
|
+
mxRecords: { priority: number | null; exchange: string }[] | null;
|
|
221
|
+
txtRecords: string[] | null; // SPF, DKIM, site verification, etc.
|
|
222
|
+
soaRecord: string | null; // raw SOA value
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
> π‘ **RDAP vs DNS nameservers**: When RDAP is available (most gTLDs), `nameservers` comes from the registry's authoritative parent-zone delegation (`nameserversSource: 'rdap'`). When RDAP is unavailable (many ccTLDs), the DNS layer fills in nameservers via NS record resolution (`nameserversSource: 'dns'`). The `nameserversSource` field tells you which source won.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
129
230
|
### ποΈ Speed Testing
|
|
130
231
|
|
|
131
232
|
Measure network performance via Cloudflare's global infrastructure:
|
|
@@ -263,7 +364,7 @@ console.log(`π IPv6: ${publicIps.v6 || 'N/A'}`);
|
|
|
263
364
|
|
|
264
365
|
### β‘ Caching
|
|
265
366
|
|
|
266
|
-
Caching applies to `getGateways()`, `getPublicIps()`, and `
|
|
367
|
+
Caching applies to `getGateways()`, `getPublicIps()`, `getIpIntelligence()`, and `getDomainIntelligence()`:
|
|
267
368
|
|
|
268
369
|
```typescript
|
|
269
370
|
const network = new SmartNetwork({ cacheTtl: 60000 }); // 60s
|
|
@@ -360,6 +461,11 @@ const monitor = async () => {
|
|
|
360
461
|
console.log(`AS${intel.asn} (${intel.asnOrg}) β ${intel.city || intel.countryCode}`);
|
|
361
462
|
}
|
|
362
463
|
|
|
464
|
+
// Domain recon
|
|
465
|
+
const domain = await network.getDomainIntelligence('example.com');
|
|
466
|
+
console.log(`Registrar: ${domain.registrarName}, expires: ${domain.expirationDate}`);
|
|
467
|
+
console.log(`Nameservers (${domain.nameserversSource}):`, domain.nameservers);
|
|
468
|
+
|
|
363
469
|
await network.stop();
|
|
364
470
|
};
|
|
365
471
|
```
|
|
@@ -368,7 +474,7 @@ const monitor = async () => {
|
|
|
368
474
|
|
|
369
475
|
| Method | Description | Requires Rust |
|
|
370
476
|
|--------|-------------|:---:|
|
|
371
|
-
| `start()` / `stop()` | Start/stop the Rust
|
|
477
|
+
| `start()` / `stop()` | Start/stop the Rust bridge and smartdns backend | β |
|
|
372
478
|
| `getSpeed(opts?)` | Cloudflare speed test (download + upload) | No |
|
|
373
479
|
| `ping(host, opts?)` | ICMP ping with optional multi-ping stats | Yes |
|
|
374
480
|
| `traceroute(host, opts?)` | Hop-by-hop network path analysis | Yes |
|
|
@@ -381,6 +487,7 @@ const monitor = async () => {
|
|
|
381
487
|
| `resolveDns(host)` | Resolve A, AAAA, MX records | No |
|
|
382
488
|
| `checkEndpoint(url, opts?)` | HTTP/HTTPS health check with RTT | No |
|
|
383
489
|
| `getIpIntelligence(ip)` | ASN + org + geo + RDAP registration | No |
|
|
490
|
+
| `getDomainIntelligence(domain)` | Registrar, nameservers, events, DNS records, DNSSEC | No |
|
|
384
491
|
|
|
385
492
|
## License and Legal Information
|
|
386
493
|
|
|
@@ -396,7 +503,7 @@ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark G
|
|
|
396
503
|
|
|
397
504
|
### Company Information
|
|
398
505
|
|
|
399
|
-
Task Venture Capital GmbH
|
|
506
|
+
Task Venture Capital GmbH
|
|
400
507
|
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
401
508
|
|
|
402
509
|
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/index.ts
CHANGED
|
@@ -4,5 +4,7 @@ export { RustNetworkBridge } from './smartnetwork.classes.rustbridge.js';
|
|
|
4
4
|
export { PublicIp } from './smartnetwork.classes.publicip.js';
|
|
5
5
|
export { IpIntelligence } from './smartnetwork.classes.ipintelligence.js';
|
|
6
6
|
export type { IIpIntelligenceResult, IIpIntelligenceOptions } from './smartnetwork.classes.ipintelligence.js';
|
|
7
|
+
export { DomainIntelligence } from './smartnetwork.classes.domainintelligence.js';
|
|
8
|
+
export type { IDomainIntelligenceResult, IDomainIntelligenceOptions } from './smartnetwork.classes.domainintelligence.js';
|
|
7
9
|
export { setLogger, getLogger } from './logging.js';
|
|
8
10
|
export { NetworkError, TimeoutError } from './errors.js';
|