rdapify 0.1.3 → 0.1.7

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +139 -94
  2. package/README.md +168 -146
  3. package/dist/application/client/RDAPClient.d.ts +16 -1
  4. package/dist/application/client/RDAPClient.d.ts.map +1 -1
  5. package/dist/application/client/RDAPClient.js +46 -1
  6. package/dist/application/client/RDAPClient.js.map +1 -1
  7. package/dist/application/deduplication/QueryDeduplicator.d.ts +20 -0
  8. package/dist/application/deduplication/QueryDeduplicator.d.ts.map +1 -0
  9. package/dist/application/deduplication/QueryDeduplicator.js +46 -0
  10. package/dist/application/deduplication/QueryDeduplicator.js.map +1 -0
  11. package/dist/application/hooks/MiddlewareHooks.d.ts +48 -0
  12. package/dist/application/hooks/MiddlewareHooks.d.ts.map +1 -0
  13. package/dist/application/hooks/MiddlewareHooks.js +46 -0
  14. package/dist/application/hooks/MiddlewareHooks.js.map +1 -0
  15. package/dist/application/services/BatchProcessor.d.ts +1 -0
  16. package/dist/application/services/BatchProcessor.d.ts.map +1 -1
  17. package/dist/application/services/BatchProcessor.js +9 -0
  18. package/dist/application/services/BatchProcessor.js.map +1 -1
  19. package/dist/application/services/QueryOrchestrator.d.ts +14 -1
  20. package/dist/application/services/QueryOrchestrator.d.ts.map +1 -1
  21. package/dist/application/services/QueryOrchestrator.js +446 -38
  22. package/dist/application/services/QueryOrchestrator.js.map +1 -1
  23. package/dist/cli/index.d.ts +3 -0
  24. package/dist/cli/index.d.ts.map +1 -0
  25. package/dist/cli/index.js +300 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/index.d.ts +13 -3
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +26 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/infrastructure/cache/CacheManager.d.ts.map +1 -1
  32. package/dist/infrastructure/cache/CacheManager.js +8 -1
  33. package/dist/infrastructure/cache/CacheManager.js.map +1 -1
  34. package/dist/infrastructure/cache/RedisCache.d.ts +35 -0
  35. package/dist/infrastructure/cache/RedisCache.d.ts.map +1 -0
  36. package/dist/infrastructure/cache/RedisCache.js +75 -0
  37. package/dist/infrastructure/cache/RedisCache.js.map +1 -0
  38. package/dist/infrastructure/cache/index.d.ts +1 -0
  39. package/dist/infrastructure/cache/index.d.ts.map +1 -1
  40. package/dist/infrastructure/cache/index.js +3 -1
  41. package/dist/infrastructure/cache/index.js.map +1 -1
  42. package/dist/infrastructure/http/BootstrapDiscovery.d.ts +1 -0
  43. package/dist/infrastructure/http/BootstrapDiscovery.d.ts.map +1 -1
  44. package/dist/infrastructure/http/BootstrapDiscovery.js +19 -0
  45. package/dist/infrastructure/http/BootstrapDiscovery.js.map +1 -1
  46. package/dist/infrastructure/http/Fetcher.d.ts +2 -0
  47. package/dist/infrastructure/http/Fetcher.d.ts.map +1 -1
  48. package/dist/infrastructure/http/Fetcher.js +5 -3
  49. package/dist/infrastructure/http/Fetcher.js.map +1 -1
  50. package/dist/infrastructure/http/Normalizer.d.ts +2 -0
  51. package/dist/infrastructure/http/Normalizer.d.ts.map +1 -1
  52. package/dist/infrastructure/http/Normalizer.js +57 -0
  53. package/dist/infrastructure/http/Normalizer.js.map +1 -1
  54. package/dist/infrastructure/logging/AuditLogger.d.ts +114 -0
  55. package/dist/infrastructure/logging/AuditLogger.d.ts.map +1 -0
  56. package/dist/infrastructure/logging/AuditLogger.js +195 -0
  57. package/dist/infrastructure/logging/AuditLogger.js.map +1 -0
  58. package/dist/infrastructure/logging/Logger.d.ts.map +1 -1
  59. package/dist/infrastructure/logging/Logger.js +29 -5
  60. package/dist/infrastructure/logging/Logger.js.map +1 -1
  61. package/dist/infrastructure/monitoring/MetricsCollector.d.ts +39 -2
  62. package/dist/infrastructure/monitoring/MetricsCollector.d.ts.map +1 -1
  63. package/dist/infrastructure/monitoring/MetricsCollector.js +179 -0
  64. package/dist/infrastructure/monitoring/MetricsCollector.js.map +1 -1
  65. package/dist/infrastructure/security/PIIRedactor.js +1 -1
  66. package/dist/infrastructure/security/PIIRedactor.js.map +1 -1
  67. package/dist/infrastructure/validation/ResponseValidator.d.ts +38 -0
  68. package/dist/infrastructure/validation/ResponseValidator.d.ts.map +1 -0
  69. package/dist/infrastructure/validation/ResponseValidator.js +200 -0
  70. package/dist/infrastructure/validation/ResponseValidator.js.map +1 -0
  71. package/dist/shared/constants/rdap.constants.d.ts +1 -1
  72. package/dist/shared/constants/rdap.constants.js +1 -1
  73. package/dist/shared/errors/base.error.d.ts +8 -0
  74. package/dist/shared/errors/base.error.d.ts.map +1 -1
  75. package/dist/shared/errors/base.error.js +30 -1
  76. package/dist/shared/errors/base.error.js.map +1 -1
  77. package/dist/shared/types/generics.d.ts +6 -3
  78. package/dist/shared/types/generics.d.ts.map +1 -1
  79. package/dist/shared/types/index.d.ts +1 -1
  80. package/dist/shared/types/index.d.ts.map +1 -1
  81. package/dist/shared/types/options.d.ts +21 -2
  82. package/dist/shared/types/options.d.ts.map +1 -1
  83. package/dist/shared/types/options.js +6 -1
  84. package/dist/shared/types/options.js.map +1 -1
  85. package/dist/shared/types/responses.d.ts +42 -2
  86. package/dist/shared/types/responses.d.ts.map +1 -1
  87. package/dist/shared/utils/helpers/index.d.ts +1 -1
  88. package/dist/shared/utils/helpers/index.d.ts.map +1 -1
  89. package/dist/shared/utils/helpers/index.js +2 -1
  90. package/dist/shared/utils/helpers/index.js.map +1 -1
  91. package/dist/shared/utils/helpers/runtime.d.ts +1 -0
  92. package/dist/shared/utils/helpers/runtime.d.ts.map +1 -1
  93. package/dist/shared/utils/helpers/runtime.js +11 -1
  94. package/dist/shared/utils/helpers/runtime.js.map +1 -1
  95. package/dist/shared/utils/validators/config-validation.d.ts +3 -0
  96. package/dist/shared/utils/validators/config-validation.d.ts.map +1 -0
  97. package/dist/shared/utils/validators/config-validation.js +97 -0
  98. package/dist/shared/utils/validators/config-validation.js.map +1 -0
  99. package/dist/shared/utils/validators/entity.d.ts +3 -0
  100. package/dist/shared/utils/validators/entity.d.ts.map +1 -0
  101. package/dist/shared/utils/validators/entity.js +27 -0
  102. package/dist/shared/utils/validators/entity.js.map +1 -0
  103. package/dist/shared/utils/validators/index.d.ts +3 -0
  104. package/dist/shared/utils/validators/index.d.ts.map +1 -1
  105. package/dist/shared/utils/validators/index.js +9 -1
  106. package/dist/shared/utils/validators/index.js.map +1 -1
  107. package/dist/shared/utils/validators/nameserver.d.ts +3 -0
  108. package/dist/shared/utils/validators/nameserver.d.ts.map +1 -0
  109. package/dist/shared/utils/validators/nameserver.js +49 -0
  110. package/dist/shared/utils/validators/nameserver.js.map +1 -0
  111. package/package.json +9 -10
package/README.md CHANGED
@@ -1,16 +1,24 @@
1
- # RDAPify - Unified, Secure, High-Performance RDAP Client for Enterprise Applications
2
-
3
- > **🎉 LATEST RELEASE**: v0.1.2 — Production-ready with interactive playground, advanced features including authentication, proxy support, compression, retry strategies, and comprehensive monitoring. See [What's New in v0.1.2](#-whats-new-in-v012) below.
4
-
5
- > **⚠️ UPGRADE NOTICE**: If you're using v0.1.0 or v0.1.1, please upgrade to v0.1.2 for new features and bug fixes. **No breaking changes** - seamless upgrade! See [Migration Guide](./MIGRATION_TO_0.1.2.md) or simply run: `npm install rdapify@latest`
1
+ <p align="center">
2
+ <img src="website/static/img/logo-512.png" alt="RDAPify" width="80" />
3
+ </p>
4
+ <h1 align="center">RDAPify</h1>
5
+ <p align="center"><strong>Unified, Secure, High-Performance RDAP Client</strong></p>
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/rdapify?style=flat-square)](https://www.npmjs.com/package/rdapify)
8
+ [![npm downloads](https://img.shields.io/npm/dm/rdapify?style=flat-square)](https://www.npmjs.com/package/rdapify)
8
9
  [![License](https://img.shields.io/npm/l/rdapify?style=flat-square)](LICENSE)
10
+ [![CI](https://img.shields.io/github/actions/workflow/status/rdapify/RDAPify/ci.yml?style=flat-square&label=CI)](https://github.com/rdapify/RDAPify/actions/workflows/ci.yml)
11
+ [![Coverage](https://img.shields.io/codecov/c/github/rdapify/RDAPify?style=flat-square)](https://codecov.io/gh/rdapify/RDAPify)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
13
+ [![Project Status](https://img.shields.io/badge/status-alpha-orange?style=flat-square)](https://github.com/rdapify/RDAPify/blob/main/CHANGELOG.md)
9
14
  [![Security](https://img.shields.io/badge/security-SSRF%20Protected-brightgreen?style=flat-square)](SECURITY.md)
10
- [![Tests](https://img.shields.io/badge/tests-145%20passing-brightgreen?style=flat-square)](#)
11
15
  [![Website](https://img.shields.io/badge/website-rdapify.com-blue?style=flat-square)](https://rdapify.com)
12
16
  [![GitHub](https://img.shields.io/github/stars/rdapify/RDAPify?style=flat-square)](https://github.com/rdapify/RDAPify)
13
17
 
18
+ > **Alpha software**
19
+ >
20
+ > RDAPify is under active development. Core functionality (RDAP queries, caching, SSRF protection) is stable and tested, but APIs and interfaces may change before v1.0. We welcome [issues](https://github.com/rdapify/RDAPify/issues) and [feedback](https://github.com/rdapify/RDAPify/discussions) from the community while the project evolves.
21
+
14
22
  **RDAPify** unifies RDAP queries across all global registries (Verisign, ARIN, RIPE, APNIC, LACNIC) with robust security protection, exceptional performance, and an integrated developer experience. This isn't just another RDAP client — it's a complete platform for processing registration data securely.
15
23
 
16
24
  > **Note:** This project eliminates the need for traditional WHOIS protocol, while maintaining backward compatibility when needed.
@@ -24,7 +32,7 @@ Direct RDAP queries are complex — each registry uses different formats, rate l
24
32
  - Manually handling registry differences
25
33
  - Constant worry about SSRF vulnerabilities
26
34
  - Unpredictable performance without caching
27
- + One unified solution, rigorously tested, production-ready
35
+ + One unified solution, rigorously tested, open source
28
36
  ```
29
37
 
30
38
  RDAPify intelligently addresses these challenges:
@@ -32,7 +40,7 @@ RDAPify intelligently addresses these challenges:
32
40
  - ✅ **Data Normalization**: Consistent response regardless of source registry
33
41
  - ✅ **SSRF Protection**: Prevent attacks on internal infrastructure
34
42
  - ✅ **Exceptional Performance**: Smart caching, parallel processing, memory optimization
35
- - ✅ **Node.js Compatibility**: Verified working on Node.js (target: 16+; Bun, Deno, Cloudflare Workers: untested)
43
+ - ✅ **Node.js Compatibility**: Verified working on Node.js 20+; Bun, Deno, and Cloudflare Workers also supported
36
44
  - ✅ **GDPR-ready**: Built-in tools for automatically redacting personal data
37
45
 
38
46
  ## 📦 Quick Installation
@@ -48,9 +56,8 @@ yarn add rdapify
48
56
  pnpm add rdapify
49
57
  ```
50
58
 
51
- **Experimental (untested):**
52
59
  ```bash
53
- # Using Bun (untested)
60
+ # Using Bun
54
61
  bun add rdapify
55
62
  ```
56
63
 
@@ -93,10 +100,12 @@ const client = new RDAPClient({
93
100
  },
94
101
  });
95
102
 
96
- // Query domain, IP, or ASN
103
+ // Query domain, IP, ASN, nameserver, or entity
97
104
  const domain = await client.domain('example.com');
98
105
  const ip = await client.ip('8.8.8.8');
99
106
  const asn = await client.asn('AS15169');
107
+ const ns = await client.nameserver('ns1.example.com');
108
+ const entity = await client.entity('ARIN-HN-1', 'https://rdap.arin.net/registry');
100
109
  ```
101
110
 
102
111
  **Example Output:**
@@ -112,6 +121,25 @@ const asn = await client.asn('AS15169');
112
121
  }
113
122
  ```
114
123
 
124
+ ### With Nameserver & Entity Queries (v0.1.7+)
125
+
126
+ ```typescript
127
+ import { RDAPClient } from 'rdapify';
128
+
129
+ const client = new RDAPClient();
130
+
131
+ // Query a nameserver — auto-discovers server via IANA DNS bootstrap
132
+ const ns = await client.nameserver('ns1.example.com');
133
+ console.log(ns.ldhName); // "ns1.example.com"
134
+ console.log(ns.ipAddresses); // { v4: ['93.184.216.34'], v6: [...] }
135
+ console.log(ns.status); // ['active']
136
+
137
+ // Query an entity — requires explicit server URL (no global IANA bootstrap)
138
+ const entity = await client.entity('ARIN-HN-1', 'https://rdap.arin.net/registry');
139
+ console.log(entity.handle); // "ARIN-HN-1"
140
+ console.log(entity.roles); // ['registrar', 'technical']
141
+ ```
142
+
115
143
  ### With Monitoring & Metrics (v0.1.2+)
116
144
 
117
145
  ```typescript
@@ -237,19 +265,19 @@ const compression = new CompressionManager({
237
265
  - **Certificate Validation**: Reject insecure connections to RDAP servers
238
266
  - **Rate Limiting**: Prevent service blocking due to excessive requests
239
267
  - **Secure Data Handling**: PII redaction according to GDPR/CCPA requirements
240
- - **Authentication Support** (v0.1.2+): Basic, Bearer Token, API Key, OAuth2
241
- - **Proxy Support** (v0.1.2+): HTTP/HTTPS/SOCKS4/SOCKS5 with authentication
268
+ - **Authentication Support** (v0.1.1+): Basic, Bearer Token, API Key, OAuth2
269
+ - **Proxy Support** (v0.1.1+): HTTP/HTTPS/SOCKS4/SOCKS5 with authentication
242
270
  - **Full Audit Trail**: Track all critical operations for compliance purposes
243
271
 
244
272
  ### ⚡ Exceptional Performance
245
273
 
246
274
  - **Smart Caching**: In-memory LRU cache with configurable TTL
247
- - **Persistent Cache** (v0.1.2+): File-based cache that survives restarts
275
+ - **Persistent Cache** (v0.1.1+): File-based cache that survives restarts
248
276
  - **Connection Pooling** (v0.1.2+): HTTP connection reuse for 30-40% performance improvement
249
277
  - **Batch Processing**: Process multiple queries efficiently (5-10x faster)
250
- - **Response Compression** (v0.1.2+): gzip/brotli support for 60-80% bandwidth reduction
251
- - **Retry Strategies** (v0.1.2+): Circuit breaker with exponential backoff
252
- - **Query Prioritization** (v0.1.2+): High/normal/low priority queue
278
+ - **Response Compression** (v0.1.1+): gzip/brotli support for 60-80% bandwidth reduction
279
+ - **Retry Strategies** (v0.1.1+): Circuit breaker with exponential backoff
280
+ - **Query Prioritization** (v0.1.1+): High/normal/low priority queue
253
281
  - **Registry Discovery**: Automatic IANA Bootstrap for finding the correct registry
254
282
  - **Optimized Parsing**: Fast JSONPath-based normalization
255
283
 
@@ -265,10 +293,11 @@ const compression = new CompressionManager({
265
293
  ### 🧩 Seamless Integration
266
294
 
267
295
  - **Full TypeScript Support**: Strongly typed with embedded documentation
268
- - **Node.js Support**: Verified working (target: Node.js 20+)
269
- - **Enhanced Validation** (v0.1.2+): IDN domains, IPv6 zones, ASN ranges
270
- - **Interactive CLI**: For quick queries and testing (planned)
271
- - **Web Playground**: Try the library directly in your browser (planned)
296
+ - **Node.js 20+ Support**: Verified working (Node.js, Bun, Deno, Cloudflare Workers)
297
+ - **Enhanced Validation** (v0.1.1+): IDN domains, IPv6 zones, ASN ranges
298
+ - **Nameserver & Entity Queries** (v0.1.7+): `client.nameserver()` and `client.entity()` with full RDAP support
299
+ - **CLI Tool** (v0.1.7+): `rdapify domain/ip/asn/nameserver/entity` with `--json`, `--no-cache`, `--timeout`, `--server` flags
300
+ - **Web Playground**: Try RDAPify live at [rdapify.com/playground](https://rdapify.com/playground)
272
301
  - **Pre-built Templates**: For AWS Lambda, Azure Functions, Kubernetes, and more (planned)
273
302
 
274
303
  ### 📊 Advanced Analytics (Planned)
@@ -327,7 +356,7 @@ RDAPify provides comprehensive documentation in the repository:
327
356
 
328
357
  ## 🌐 Interactive Playground
329
358
 
330
- > **Coming Soon**: Interactive playground is planned for a future release. For now, install the package and try the examples in the [docs/](docs/) directory.
359
+ Try RDAPify directly in your browser no installation required: **[rdapify.com/playground](https://rdapify.com/playground)**
331
360
 
332
361
  ## 📊 Performance Benchmarks
333
362
 
@@ -352,7 +381,6 @@ RDAPify is an open source project. Get help or contribute:
352
381
  - **[CONTRIBUTING.md](CONTRIBUTING.md)** - Contribution guidelines
353
382
  - **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** - Community standards
354
383
 
355
- > **Enterprise Support**: For SLA-backed support, consulting, or custom features, contact enterprise@rdapify.com
356
384
 
357
385
  ## 🤝 Contributing
358
386
 
@@ -367,85 +395,88 @@ Start by reading our [Contribution Guide](CONTRIBUTING.md) and [Code of Conduct]
367
395
 
368
396
  ## 🚧 Project Status
369
397
 
370
- **Current Release**: v0.1.2 (Production Ready)
398
+ **Current Release**: v0.1.7 (Alpha)
371
399
 
372
- ### 🎉 What's New in v0.1.2
400
+ ### 🎉 What's New in v0.1.7
373
401
 
374
- **Interactive Playground & Developer Experience**
375
- - ✅ **Try Before Install**: Interactive playground at rdapify.com/playground
376
- - ✅ **Client ID Tracking**: Stable browser identification with localStorage
377
- - ✅ **Quota Management**: Real-time quota display (remainingToday, resetAt)
378
- - ✅ **Rate Limit Handling**: Graceful 429 responses with retry hints
379
- - ✅ **Multi-Package Manager**: npm, yarn, and pnpm install commands
380
- - ✅ **Website Integration**: Playground accessible from main navigation
381
- - ✅ **Code Quality**: ESLint errors resolved (6 issues fixed)
402
+ **Nameserver & Entity Query Support**
403
+ - ✅ **Nameserver Queries**: `client.nameserver('ns1.example.com')` auto-discovery via IANA DNS bootstrap
404
+ - ✅ **Entity Queries**: `client.entity('ARIN-HN-1', serverUrl)` contact/registrant/registrar lookup
405
+ - ✅ **CLI Extended**: `rdapify nameserver <hostname>`, `rdapify entity <handle> --server <url>`
406
+ - ✅ **New Types**: `NameserverResponse` and `EntityResponse` exported from main entry point
407
+ - ✅ **New Validators**: `validateNameserver`, `validateEntityHandle`, `normalizeNameserver`, `normalizeEntityHandle`
408
+ - ✅ **All query types** now support full pipeline: caching, middleware hooks, metrics, deduplication, PII redaction
382
409
 
383
- **Previous Releases**
410
+ ### v0.1.6 — CLI Tool & Runtime Support
411
+ - ✅ **CLI Tool**: `rdapify domain <name>`, `rdapify ip <addr>`, `rdapify asn <num>` — zero external dependencies
412
+ - ✅ **CLI Flags**: `--json`, `--no-cache`, `--timeout <ms>`, `--version/-v`, `--help/-h`
413
+ - ✅ **Cloudflare Workers**: Full runtime detection and support (`isCloudflareWorkers()`)
414
+ - ✅ **Critical Redis Fix**: `RedisCache.clear()` no longer wipes the entire database
384
415
 
385
- **Phase 3: Authentication & Network** (52 new tests - v0.1.1+)
386
- - ✅ **Authentication Support**: Basic, Bearer Token, API Key, OAuth2
387
- - ✅ **Proxy Support**: HTTP/HTTPS/SOCKS4/SOCKS5 with bypass lists
388
- - ✅ **Response Compression**: gzip, brotli, deflate (60-80% bandwidth reduction)
416
+ **v0.1.5 Compliance & Middleware**
417
+ - ✅ **Redis Cache**: Production-ready Redis adapter with peer-dependency pattern
418
+ - ✅ **Middleware Hooks**: `beforeQuery`, `afterQuery`, `onError`, `onCacheHit`, `onCacheMiss`, `onRetry` lifecycle hooks
419
+ - ✅ **Query Deduplicator**: Collapses concurrent identical in-flight requests into a single Promise
420
+ - ✅ **Audit Logger**: GDPR/SOC2/CCPA-compliant audit trail with in-memory and file (NDJSON) adapters
421
+ - ✅ **Response Validator**: RFC 7483 schema validation with strict/lenient/off modes
389
422
 
390
- **Phase 2: Advanced Features** (55 new tests)
391
- - ✅ **Retry Strategies**: Circuit breaker with exponential backoff
392
- - ✅ **Query Prioritization**: High/normal/low priority queue
393
- - ✅ **Enhanced Validation**: IDN domains, IPv6 zones, ASN ranges
394
- - ✅ **Persistent Cache**: File-based storage that survives restarts
423
+ **v0.1.4 TypeScript Strict Mode**
424
+ - ✅ TypeScript strict mode throughout the entire codebase
395
425
 
396
- **Phase 1: Core Improvements** (38 new tests)
397
- - ✅ **Connection Pooling**: 30-40% performance improvement
398
- - ✅ **Metrics & Monitoring**: Comprehensive query tracking
399
- - ✅ **Request/Response Logging**: Detailed debugging capabilities
426
+ **v0.1.3 15+ Defensive Bug Fixes**
427
+ - ✅ Normalizer null checks, BootstrapDiscovery NaN guard, Fetcher redirect validation
428
+ - ✅ ConnectionPool acquire timeout, PIIRedactor `structuredClone`, SSRFProtection IPv6 brackets
429
+ - ✅ MetricsCollector division-by-zero protection
400
430
 
401
- **Total Improvements**: 11 major features, 145+ tests (all passing)
431
+ **Previous Releases (v0.1.0–v0.1.2)**
432
+ - ✅ Authentication (Basic/Bearer/API Key/OAuth2), Proxy (HTTP/HTTPS/SOCKS4/SOCKS5), Compression (gzip/brotli/deflate)
433
+ - ✅ Retry strategies with circuit breaker, query prioritization, enhanced validation (IDN, IPv6 zones, ASN ranges)
434
+ - ✅ Connection pooling (30-40% faster), metrics & monitoring, request/response logging
435
+ - ✅ Persistent cache (file-based), interactive playground
402
436
 
403
- See [ALL_PHASES_COMPLETE.md](./docs/releases/ALL_PHASES_COMPLETE.md) for detailed documentation.
437
+ See [CHANGELOG.md](CHANGELOG.md) for detailed version history.
404
438
 
405
- ### ✅ What's Ready in v0.1.2
439
+ ### ✅ Full Feature Set (v0.1.7)
406
440
 
407
- Core functionality is production-ready and fully tested:
408
-
409
- - ✅ **Interactive Playground**: Try RDAPify without installing (rdapify.com/playground)
410
- - ✅ **RDAP Client**: Domain, IP, and ASN queries with automatic bootstrap discovery
411
- - ✅ **SSRF Protection**: Blocks private IPs, localhost, link-local, with proper CIDR matching (IPv4/IPv6)
441
+ - **RDAP Client**: Domain, IP, ASN, Nameserver, and Entity queries with automatic IANA bootstrap discovery
442
+ - ✅ **CLI Tool**: Command-line interface with human-readable and JSON output (`domain`, `ip`, `asn`, `nameserver`, `entity`)
443
+ - ✅ **SSRF Protection**: Blocks private IPs, localhost, link-local, CIDR matching (IPv4/IPv6)
412
444
  - ✅ **Data Normalization**: Consistent response format across all registries
413
- - ✅ **PII Redaction**: Automatic redaction of emails, phones, addresses
414
- - ✅ **In-Memory Caching**: LRU cache with TTL support
445
+ - ✅ **PII Redaction**: Automatic redaction of emails, phones, addresses (GDPR/CCPA)
446
+ - ✅ **Audit Logging**: Compliance-grade audit trail (GDPR/SOC2/CCPA) with NDJSON file adapter
447
+ - ✅ **In-Memory Cache**: LRU cache with TTL support
415
448
  - ✅ **Persistent Cache**: File-based cache that survives restarts
449
+ - ✅ **Redis Cache**: Production-ready Redis adapter
416
450
  - ✅ **Connection Pooling**: HTTP connection reuse (30-40% faster)
417
451
  - ✅ **Metrics & Monitoring**: Comprehensive query tracking and analysis
418
- - ✅ **Request/Response Logging**: Detailed logging with multiple levels
419
- - ✅ **Retry Strategies**: Circuit breaker with exponential backoff
452
+ - ✅ **Request/Response Logging**: Structured logging with configurable levels
453
+ - ✅ **Retry Strategies**: Circuit breaker (closed/open/half-open) with exponential backoff
420
454
  - ✅ **Query Prioritization**: High/normal/low priority queue
455
+ - ✅ **Query Deduplication**: Collapse concurrent identical requests into one
456
+ - ✅ **Middleware Hooks**: Lifecycle hooks for query pipeline customization
457
+ - ✅ **Response Validation**: RFC 7483 schema validation
421
458
  - ✅ **Enhanced Validation**: IDN domains, IPv6 zones, ASN ranges
422
- - ✅ **Authentication Support**: Basic, Bearer, API Key, OAuth2
423
- - ✅ **Proxy Support**: HTTP/HTTPS/SOCKS4/SOCKS5
424
- - ✅ **Response Compression**: gzip, brotli, deflate
425
- - ✅ **Error Handling**: Structured errors with retry logic
426
- - ✅ **TypeScript Support**: Full type definitions and strict mode
427
- - ✅ **Test Coverage**: 145+ new tests passing (unit + integration)
428
- - ✅ **Node.js Support**: Verified working (Node.js 20+)
429
-
430
- ### 🔄 Planned Features
431
-
432
- These features are planned for future releases:
433
-
434
- - ⏳ **Redis/External Cache**: External cache adapters coming in v0.2.0
435
- - ⏳ **CLI Tool**: Command-line interface planned
436
- - ⏳ **Bun/Deno/Cloudflare Workers**: Additional runtime support
437
- - ⏳ **Advanced Analytics**: Dashboard and reporting features
438
- - ⏳ **Geo-distributed Caching**: Multi-region cache support
439
- - ⏳ **Smart Caching**: Predictive caching with adaptive TTL
440
- - ⏳ **Real-time Updates**: WebSocket/SSE support
459
+ - ✅ **Authentication**: Basic, Bearer, API Key, OAuth2
460
+ - ✅ **Proxy Support**: HTTP/HTTPS/SOCKS4/SOCKS5 with bypass patterns
461
+ - ✅ **Response Compression**: gzip, brotli, deflate (60-80% bandwidth reduction)
462
+ - ✅ **Multi-runtime**: Node.js 20+, Bun, Deno, Cloudflare Workers
463
+ - ✅ **TypeScript Strict**: Full type definitions with strict mode
464
+ - ✅ **Test Coverage**: 34 test files, 620+ tests (unit + integration)
465
+
466
+ ### 🔜 Coming in v0.1.8
467
+
468
+ - ⏳ **Domain Availability**: `client.checkAvailability('example.com')` — instant availability check via RDAP
469
+ - **Bulk Availability**: `client.checkAvailabilityBatch(['a.com', 'b.com'])` — check multiple domains at once
470
+ - ⏳ **Live Integration Tests**: opt-in via `LIVE_TESTS=1` against real RDAP servers
471
+ - ⏳ **Advanced Bootstrap Config**: custom bootstrap servers, TTL overrides, redundancy fallback
441
472
 
442
473
  ### 📋 Roadmap to v0.2.0
443
474
 
444
- - Redis cache adapter
445
- - CLI tool with interactive mode
446
- - Rate limiting improvements
447
- - Batch processing optimization
448
- - Bun/Deno runtime compatibility testing
475
+ - RDAP Testing CLI (`rdapify test server`, `rdapify test benchmark`)
476
+ - RDAP Extensions Registry (REGEXT support)
477
+ - Bootstrap Store Adapters (File, Redis, Database)
478
+ - Advanced Reporting (`client.generateReport()`)
479
+ - RFC 9083 / RFC 9535 support
449
480
 
450
481
  See [ROADMAP.md](ROADMAP.md) for the complete roadmap and [CHANGELOG.md](CHANGELOG.md) for detailed version history.
451
482
 
@@ -455,76 +486,68 @@ RDAPify follows a clean, modular architecture with clear separation of concerns:
455
486
 
456
487
  ### Source Structure (`/src`)
457
488
 
489
+ RDAPify follows a hexagonal (ports & adapters) architecture:
490
+
458
491
  ```
459
492
  src/
460
- ├── client/ # Client orchestration layer
461
- │ ├── RDAPClient.ts # Main client (242 LOC)
462
- │ └── QueryOrchestrator.ts # Query pattern extraction (169 LOC)
493
+ ├── application/ # Application layer
494
+ │ ├── client/
495
+ └── RDAPClient.ts # Main client entry point
496
+ │ ├── services/
497
+ │ │ ├── QueryOrchestrator.ts # Query pipeline orchestration
498
+ │ │ ├── BatchProcessor.ts # Concurrent batch processing
499
+ │ │ └── QueryPriority.ts # Priority queue (high/normal/low)
500
+ │ ├── hooks/
501
+ │ │ └── MiddlewareHooks.ts # Lifecycle hooks
502
+ │ └── deduplication/
503
+ │ └── QueryDeduplicator.ts # In-flight request deduplication
463
504
 
464
- ├── fetcher/ # HTTP and registry discovery
465
- │ ├── Fetcher.ts # HTTP client (196 LOC)
466
- │ ├── BootstrapDiscovery.ts # IANA bootstrap (224 LOC)
467
- └── SSRFProtection.ts # Security validation (219 LOC)
505
+ ├── infrastructure/ # Infrastructure layer
506
+ │ ├── http/
507
+ ├── Fetcher.ts # HTTP client with SSRF validation
508
+ │ ├── BootstrapDiscovery.ts # IANA bootstrap registry discovery
509
+ │ │ ├── Normalizer.ts # Raw → normalized response transform
510
+ │ │ ├── RateLimiter.ts # Token-bucket rate limiter
511
+ │ │ ├── ConnectionPool.ts # HTTP connection reuse
512
+ │ │ ├── RetryStrategy.ts # Retry + circuit breaker
513
+ │ │ ├── AuthenticationManager.ts # Basic/Bearer/APIKey/OAuth2
514
+ │ │ ├── ProxyManager.ts # HTTP/HTTPS/SOCKS proxy support
515
+ │ │ └── CompressionManager.ts # gzip/brotli/deflate
516
+ │ ├── cache/
517
+ │ │ ├── InMemoryCache.ts # LRU in-memory cache with TTL
518
+ │ │ ├── CacheManager.ts # Cache backend dispatcher
519
+ │ │ ├── PersistentCache.ts # File-backed JSON cache
520
+ │ │ └── RedisCache.ts # Redis adapter (peer-dependency)
521
+ │ ├── security/
522
+ │ │ ├── SSRFProtection.ts # RFC 1918 / link-local blocking
523
+ │ │ └── PIIRedactor.ts # GDPR/CCPA PII redaction
524
+ │ ├── logging/
525
+ │ │ ├── Logger.ts # Structured request/response logging
526
+ │ │ └── AuditLogger.ts # Compliance audit trail (NDJSON)
527
+ │ ├── monitoring/
528
+ │ │ └── MetricsCollector.ts # Query latency, success/error rates
529
+ │ └── validation/
530
+ │ └── ResponseValidator.ts # RFC 7483 schema validation
468
531
 
469
- ├── normalizer/ # Data transformation
470
- │ ├── Normalizer.ts # Response normalization (239 LOC)
471
- └── PIIRedactor.ts # Privacy protection (140 LOC)
532
+ ├── shared/ # Shared kernel
533
+ │ ├── types/ # TypeScript types and interfaces
534
+ ├── errors/ # Typed error hierarchy (11 error classes)
535
+ │ └── utils/ # Validators, helpers, constants
472
536
 
473
- ├── cache/ # Caching layer
474
- │ ├── CacheManager.ts # Cache orchestration (188 LOC)
475
- │ └── InMemoryCache.ts # LRU implementation (185 LOC)
537
+ ├── core/ports/ # Interface contracts (hexagonal ports)
476
538
 
477
- ├── types/ # TypeScript definitions
478
- │ ├── enums.ts # Type aliases (87 LOC)
479
- │ ├── entities.ts # Entity interfaces (74 LOC)
480
- │ ├── responses.ts # Response types (100 LOC)
481
- │ ├── errors.ts # Error classes (154 LOC)
482
- │ ├── options.ts # Configuration types (201 LOC)
483
- │ └── index.ts # Barrel export (36 LOC)
484
-
485
- └── utils/ # Utilities
486
- ├── validators/ # Input validation
487
- │ ├── domain.ts # Domain validation (55 LOC)
488
- │ ├── ip.ts # IP validation (86 LOC)
489
- │ ├── asn.ts # ASN validation (42 LOC)
490
- │ └── network.ts # Network utilities (76 LOC)
491
-
492
- └── helpers/ # Helper functions
493
- ├── async.ts # Async utilities (77 LOC)
494
- ├── string.ts # String manipulation (38 LOC)
495
- ├── object.ts # Object utilities (33 LOC)
496
- ├── cache.ts # Cache helpers (11 LOC)
497
- ├── http.ts # HTTP utilities (25 LOC)
498
- ├── format.ts # Formatting (27 LOC)
499
- └── runtime.ts # Runtime detection (47 LOC)
539
+ └── cli/
540
+ └── index.ts # CLI binary (rdapify domain/ip/asn)
500
541
  ```
501
542
 
502
543
  ### Key Design Principles
503
544
 
504
- 1. **Modular Architecture**: Each file has a single, clear responsibility
505
- 2. **Small Files**: All files <250 LOC for easy maintenance
506
- 3. **Type Safety**: Strict TypeScript with explicit types throughout
507
- 4. **Testability**: 146 tests with >90% coverage
508
- 5. **Security First**: SSRF protection and PII redaction built-in
509
- 6. **Performance**: Smart caching and optimized parsing
510
-
511
- ### Recent Improvements (Phase 2 Refactoring)
512
-
513
- - ✅ Extracted QueryOrchestrator from RDAPClient (-29% LOC)
514
- - ✅ Split validators into focused modules (-87% in main file)
515
- - ✅ Split helpers into focused modules (-80% in main file)
516
- - ✅ Split types into enums, entities, responses (-87% in main file)
517
- - ✅ 712 lines of duplication eliminated
518
- - ✅ 100% backward compatible (re-export shims)
519
-
520
- See [REFACTOR_STATUS.md](REFACTOR_STATUS.md) for detailed refactoring progress.
521
-
522
- ### 📋 Roadmap to v0.2.0 (Continued)
523
- - Live integration tests (optional via LIVE_TESTS=1)
524
- - Performance benchmarks with real data
525
- - Advanced analytics dashboard
526
-
527
- **Want to contribute?** Check out our [CONTRIBUTING.md](CONTRIBUTING.md) and [ROADMAP.md](ROADMAP.md)!
545
+ 1. **Hexagonal Architecture**: Clean separation between application, infrastructure, and shared layers
546
+ 2. **Ports & Adapters**: Interface-driven design for easy testing and swappable backends
547
+ 3. **Security First**: SSRF protection and PII redaction built into the query pipeline
548
+ 4. **Type Safety**: Strict TypeScript with explicit types throughout
549
+ 5. **Compliance Ready**: Audit logging for GDPR/SOC2/CCPA requirements
550
+ 6. **Multi-runtime**: Works on Node.js 20+, Bun, Deno, and Cloudflare Workers
528
551
 
529
552
  ## 📚 Additional Documentation
530
553
 
@@ -592,10 +615,9 @@ We're looking for early adopters and beta testers! If you're interested in:
592
615
 
593
616
  ### Known Issues & Limitations
594
617
 
595
- - Bun/Deno/Cloudflare Workers compatibility not yet tested
596
618
  - Live RDAP server tests disabled by default (use `LIVE_TESTS=1` to enable)
597
- - CLI tool not yet available (programmatic API only)
598
- - Redis cache adapter planned for v0.2.0
619
+ - Advanced analytics dashboard planned for v0.2.0
620
+ - Geo-distributed caching planned for v0.2.0
599
621
 
600
622
  ## 📜 License
601
623
 
@@ -1,8 +1,10 @@
1
1
  import { RateLimiter } from '../../infrastructure/http/RateLimiter';
2
2
  import { Logger } from '../../infrastructure/logging/Logger';
3
- import type { DomainResponse, IPResponse, ASNResponse } from '../../shared/types';
3
+ import type { DomainResponse, IPResponse, ASNResponse, NameserverResponse, EntityResponse } from '../../shared/types';
4
4
  import type { RDAPClientOptions } from '../../shared/types/options';
5
5
  import { BatchProcessor } from '../services/BatchProcessor';
6
+ import { MiddlewareManager } from '../hooks/MiddlewareHooks';
7
+ import type { MiddlewareOptions } from '../hooks/MiddlewareHooks';
6
8
  export declare class RDAPClient {
7
9
  private readonly options;
8
10
  private readonly cache;
@@ -17,10 +19,16 @@ export declare class RDAPClient {
17
19
  private readonly connectionPool;
18
20
  private readonly metricsCollector;
19
21
  private readonly logger;
22
+ private readonly middlewareManager;
23
+ private readonly queryDeduplicator;
24
+ private readonly debugEnabled;
25
+ private readonly debugLogger?;
20
26
  constructor(options?: RDAPClientOptions);
21
27
  domain(domain: string): Promise<DomainResponse>;
22
28
  ip(ip: string): Promise<IPResponse>;
23
29
  asn(asn: string | number): Promise<ASNResponse>;
30
+ nameserver(nameserver: string): Promise<NameserverResponse>;
31
+ entity(handle: string, serverUrl: string): Promise<EntityResponse>;
24
32
  private fetchWithRetry;
25
33
  private normalizeOptions;
26
34
  clearCache(): Promise<void>;
@@ -45,6 +53,13 @@ export declare class RDAPClient {
45
53
  idleConnections: number;
46
54
  hosts: number;
47
55
  };
56
+ use(hooks: Partial<MiddlewareOptions>): this;
57
+ getMiddlewareManager(): MiddlewareManager;
58
+ getDeduplicatorStats(): {
59
+ enabled: boolean;
60
+ inflight: number;
61
+ windowMs: number;
62
+ };
48
63
  getLogger(): Logger;
49
64
  getLogs(count?: number): import("../../infrastructure/logging/Logger").LogEntry[];
50
65
  clearAll(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"RDAPClient.d.ts","sourceRoot":"","sources":["../../../src/application/client/RDAPClient.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAIpE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGlF,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAgB5D,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC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;IAOzC,oBAAoB;;;;;IAOpB,SAAS,IAAI,MAAM;IAOnB,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM;IAOhB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B,OAAO,IAAI,IAAI;CAIhB"}
@@ -13,6 +13,8 @@ const options_1 = require("../../shared/types/options");
13
13
  const helpers_1 = require("../../shared/utils/helpers");
14
14
  const services_1 = require("../services");
15
15
  const BatchProcessor_1 = require("../services/BatchProcessor");
16
+ const MiddlewareHooks_1 = require("../hooks/MiddlewareHooks");
17
+ const QueryDeduplicator_1 = require("../deduplication/QueryDeduplicator");
16
18
  class RDAPClient {
17
19
  constructor(options = {}) {
18
20
  this.options = this.normalizeOptions(options);
@@ -33,6 +35,15 @@ class RDAPClient {
33
35
  followRedirects: this.options.followRedirects,
34
36
  maxRedirects: this.options.maxRedirects,
35
37
  ssrfProtection: this.ssrfProtection,
38
+ logRedirect: (fromUrl, toUrl) => {
39
+ this.logger?.warn(`Redirect: ${fromUrl} → ${toUrl}`);
40
+ if (this.debugEnabled && this.debugLogger) {
41
+ this.debugLogger.debug('Redirect occurred', {
42
+ fromUrl,
43
+ toUrl,
44
+ });
45
+ }
46
+ },
36
47
  });
37
48
  this.bootstrap = new http_1.BootstrapDiscovery(this.options.bootstrapUrl, this.fetcher);
38
49
  const cacheOptions = typeof this.options.cache === 'boolean'
@@ -60,12 +71,26 @@ class RDAPClient {
60
71
  enabled: true,
61
72
  maxMetrics: 10000,
62
73
  });
74
+ const validLogLevels = ['debug', 'info', 'warn', 'error'];
75
+ const configuredLevel = this.options.logging?.level;
76
+ const logLevel = configuredLevel && validLogLevels.includes(configuredLevel)
77
+ ? configuredLevel
78
+ : 'info';
63
79
  this.logger = new Logger_1.Logger({
64
- level: this.options.logging?.level || 'info',
80
+ level: logLevel,
65
81
  enabled: true,
66
82
  logRequests: true,
67
83
  logResponses: true,
68
84
  });
85
+ const debugOptions = this.options.debug;
86
+ this.debugEnabled = typeof debugOptions === 'boolean' ? debugOptions : debugOptions?.enabled ?? false;
87
+ this.debugLogger = typeof debugOptions === 'object' && debugOptions?.logger ? debugOptions.logger : undefined;
88
+ const middlewareOpts = this.options.middleware;
89
+ this.middlewareManager = new MiddlewareHooks_1.MiddlewareManager(middlewareOpts);
90
+ const dedupOpts = this.options.deduplication;
91
+ this.queryDeduplicator = new QueryDeduplicator_1.QueryDeduplicator(typeof dedupOpts === 'boolean'
92
+ ? { enabled: dedupOpts }
93
+ : dedupOpts);
69
94
  this.batchProcessor = new BatchProcessor_1.BatchProcessor(this);
70
95
  this.orchestrator = new services_1.QueryOrchestrator({
71
96
  cache: this.cache,
@@ -78,6 +103,10 @@ class RDAPClient {
78
103
  rateLimiter: this.rateLimiter,
79
104
  metricsCollector: this.metricsCollector,
80
105
  logger: this.logger,
106
+ debugEnabled: this.debugEnabled,
107
+ debugLogger: this.debugLogger,
108
+ middleware: this.middlewareManager,
109
+ deduplicator: this.queryDeduplicator,
81
110
  });
82
111
  }
83
112
  async domain(domain) {
@@ -89,6 +118,12 @@ class RDAPClient {
89
118
  async asn(asn) {
90
119
  return this.orchestrator.queryASN(asn);
91
120
  }
121
+ async nameserver(nameserver) {
122
+ return this.orchestrator.queryNameserver(nameserver);
123
+ }
124
+ async entity(handle, serverUrl) {
125
+ return this.orchestrator.queryEntity(handle, serverUrl);
126
+ }
92
127
  async fetchWithRetry(url) {
93
128
  const retryOptions = typeof this.options.retry === 'boolean'
94
129
  ? this.options.retry
@@ -142,6 +177,16 @@ class RDAPClient {
142
177
  getConnectionPoolStats() {
143
178
  return this.connectionPool.getStats();
144
179
  }
180
+ use(hooks) {
181
+ this.middlewareManager.use(hooks);
182
+ return this;
183
+ }
184
+ getMiddlewareManager() {
185
+ return this.middlewareManager;
186
+ }
187
+ getDeduplicatorStats() {
188
+ return this.queryDeduplicator.getStats();
189
+ }
145
190
  getLogger() {
146
191
  return this.logger;
147
192
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RDAPClient.js","source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