rdapify 0.2.3 → 0.3.1
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/README.ar.md +572 -0
- package/README.md +74 -77
- package/dist/{application → cjs/application}/client/RDAPClient.js +197 -6
- package/dist/{application → cjs/application}/client/index.js +0 -1
- package/dist/{application → cjs/application}/deduplication/QueryDeduplicator.js +0 -1
- package/dist/{application → cjs/application}/hooks/MiddlewareHooks.js +0 -1
- package/dist/{application → cjs/application}/services/BatchProcessor.js +0 -1
- package/dist/{application → cjs/application}/services/QueryOrchestrator.js +0 -1
- package/dist/{application → cjs/application}/services/QueryPriority.js +0 -1
- package/dist/{application → cjs/application}/services/index.js +0 -1
- package/dist/{cli → cjs/cli}/index.js +0 -1
- package/dist/cjs/core/ports/bootstrap.port.js +2 -0
- package/dist/cjs/core/ports/cache.port.js +2 -0
- package/dist/cjs/core/ports/fetcher.port.js +2 -0
- package/dist/{core → cjs/core}/ports/index.js +0 -1
- package/dist/cjs/core/ports/normalizer.port.js +2 -0
- package/dist/cjs/core/ports/pii-redactor.port.js +2 -0
- package/dist/{index.js → cjs/index.js} +8 -4
- package/dist/{infrastructure → cjs/infrastructure}/cache/CacheManager.js +4 -1
- package/dist/{infrastructure → cjs/infrastructure}/cache/InMemoryCache.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/cache/PersistentCache.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/cache/RedisCache.js +0 -1
- package/dist/cjs/infrastructure/cache/StaleWhileRevalidateCache.js +47 -0
- package/dist/{infrastructure → cjs/infrastructure}/cache/index.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/AuthenticationManager.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/BootstrapDiscovery.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/BrowserFetcher.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/BunFetcher.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/CircuitBreaker.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/CloudflareWorkersFetcher.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/CompressionManager.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/ConnectionPool.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/DenoFetcher.js +0 -1
- package/dist/cjs/infrastructure/http/DistributedRateLimiter.js +26 -0
- package/dist/{infrastructure → cjs/infrastructure}/http/Fetcher.js +5 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/Normalizer.js +23 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/ProxyManager.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/RateLimiter.js +6 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/RetryStrategy.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/http/index.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/logging/AuditLogger.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/logging/Logger.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/monitoring/GrafanaDashboard.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/monitoring/MetricsCollector.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/monitoring/PrometheusExporter.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/monitoring/TelemetryExporter.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/native/NativeBackend.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/security/PIIRedactor.js +0 -1
- package/dist/{infrastructure → cjs/infrastructure}/security/SSRFProtection.js +23 -1
- package/dist/{infrastructure → cjs/infrastructure}/security/index.js +0 -1
- package/dist/cjs/infrastructure/telemetry/UsageTelemetry.js +89 -0
- package/dist/{infrastructure → cjs/infrastructure}/validation/ResponseValidator.js +0 -1
- package/dist/{integrations → cjs/integrations}/express.js +0 -1
- package/dist/{integrations → cjs/integrations}/graphql.js +0 -1
- package/dist/{integrations → cjs/integrations}/nestjs.js +0 -1
- package/dist/{shared → cjs/shared}/constants/http.constants.js +0 -1
- package/dist/{shared → cjs/shared}/constants/index.js +0 -1
- package/dist/{shared → cjs/shared}/constants/rdap.constants.js +0 -1
- package/dist/{shared → cjs/shared}/errors/base.error.js +7 -2
- package/dist/{shared → cjs/shared}/errors/index.js +0 -1
- package/dist/{shared → cjs/shared}/types/entities.js +0 -1
- package/dist/{shared → cjs/shared}/types/enums.js +0 -1
- package/dist/{shared → cjs/shared}/types/errors.js +0 -1
- package/dist/{shared → cjs/shared}/types/generics.js +0 -1
- package/dist/{shared → cjs/shared}/types/index.js +0 -1
- package/dist/{shared → cjs/shared}/types/options.js +5 -1
- package/dist/cjs/shared/types/responses.js +2 -0
- package/dist/{shared → cjs/shared}/utils/deprecation.js +0 -1
- package/dist/{shared → cjs/shared}/utils/enhanced-validators.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/async.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/cache.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/format.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/http.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/index.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/object.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/runtime.js +0 -1
- package/dist/{shared → cjs/shared}/utils/helpers/string.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/asn.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/config-validation.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/domain.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/entity.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/index.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/ip.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/nameserver.js +0 -1
- package/dist/{shared → cjs/shared}/utils/validators/network.js +0 -1
- package/dist/esm/application/client/RDAPClient.js +439 -0
- package/dist/esm/application/client/index.js +1 -0
- package/dist/esm/application/deduplication/QueryDeduplicator.js +41 -0
- package/dist/esm/application/hooks/MiddlewareHooks.js +79 -0
- package/dist/esm/application/services/BatchProcessor.js +145 -0
- package/dist/esm/application/services/QueryOrchestrator.js +615 -0
- package/dist/esm/application/services/QueryPriority.js +109 -0
- package/dist/esm/application/services/index.js +2 -0
- package/dist/esm/cli/index.js +297 -0
- package/dist/esm/core/ports/bootstrap.port.js +1 -0
- package/dist/esm/core/ports/cache.port.js +1 -0
- package/dist/esm/core/ports/fetcher.port.js +1 -0
- package/dist/esm/core/ports/index.js +5 -0
- package/dist/esm/core/ports/normalizer.port.js +1 -0
- package/dist/esm/core/ports/pii-redactor.port.js +1 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/infrastructure/cache/CacheManager.js +123 -0
- package/dist/esm/infrastructure/cache/InMemoryCache.js +91 -0
- package/dist/esm/infrastructure/cache/PersistentCache.js +188 -0
- package/dist/esm/infrastructure/cache/RedisCache.js +106 -0
- package/dist/esm/infrastructure/cache/StaleWhileRevalidateCache.js +43 -0
- package/dist/esm/infrastructure/cache/index.js +3 -0
- package/dist/esm/infrastructure/http/AuthenticationManager.js +94 -0
- package/dist/esm/infrastructure/http/BootstrapDiscovery.js +189 -0
- package/dist/esm/infrastructure/http/BrowserFetcher.js +42 -0
- package/dist/esm/infrastructure/http/BunFetcher.js +46 -0
- package/dist/esm/infrastructure/http/CircuitBreaker.js +98 -0
- package/dist/esm/infrastructure/http/CloudflareWorkersFetcher.js +39 -0
- package/dist/esm/infrastructure/http/CompressionManager.js +80 -0
- package/dist/esm/infrastructure/http/ConnectionPool.js +101 -0
- package/dist/esm/infrastructure/http/DenoFetcher.js +38 -0
- package/dist/esm/infrastructure/http/DistributedRateLimiter.js +22 -0
- package/dist/esm/infrastructure/http/Fetcher.js +127 -0
- package/dist/esm/infrastructure/http/Normalizer.js +233 -0
- package/dist/esm/infrastructure/http/ProxyManager.js +82 -0
- package/dist/esm/infrastructure/http/RateLimiter.js +102 -0
- package/dist/esm/infrastructure/http/RetryStrategy.js +131 -0
- package/dist/esm/infrastructure/http/index.js +3 -0
- package/dist/esm/infrastructure/logging/AuditLogger.js +187 -0
- package/dist/esm/infrastructure/logging/Logger.js +145 -0
- package/dist/esm/infrastructure/monitoring/GrafanaDashboard.js +115 -0
- package/dist/esm/infrastructure/monitoring/MetricsCollector.js +284 -0
- package/dist/esm/infrastructure/monitoring/PrometheusExporter.js +72 -0
- package/dist/esm/infrastructure/monitoring/TelemetryExporter.js +112 -0
- package/dist/esm/infrastructure/native/NativeBackend.js +86 -0
- package/dist/esm/infrastructure/security/PIIRedactor.js +85 -0
- package/dist/esm/infrastructure/security/SSRFProtection.js +162 -0
- package/dist/esm/infrastructure/security/index.js +2 -0
- package/dist/esm/infrastructure/telemetry/UsageTelemetry.js +84 -0
- package/dist/esm/infrastructure/validation/ResponseValidator.js +194 -0
- package/dist/esm/integrations/express.js +43 -0
- package/dist/esm/integrations/graphql.js +80 -0
- package/dist/esm/integrations/nestjs.js +23 -0
- package/dist/esm/shared/constants/http.constants.js +25 -0
- package/dist/esm/shared/constants/index.js +2 -0
- package/dist/esm/shared/constants/rdap.constants.js +17 -0
- package/dist/esm/shared/errors/base.error.js +140 -0
- package/dist/esm/shared/errors/index.js +1 -0
- package/dist/esm/shared/types/entities.js +1 -0
- package/dist/esm/shared/types/enums.js +1 -0
- package/dist/esm/shared/types/errors.js +82 -0
- package/dist/esm/shared/types/generics.js +1 -0
- package/dist/esm/shared/types/index.js +1 -0
- package/dist/esm/shared/types/options.js +66 -0
- package/dist/esm/shared/types/responses.js +1 -0
- package/dist/esm/shared/utils/deprecation.js +20 -0
- package/dist/esm/shared/utils/enhanced-validators.js +148 -0
- package/dist/esm/shared/utils/helpers/async.js +40 -0
- package/dist/esm/shared/utils/helpers/cache.js +3 -0
- package/dist/esm/shared/utils/helpers/format.js +17 -0
- package/dist/esm/shared/utils/helpers/http.js +13 -0
- package/dist/esm/shared/utils/helpers/index.js +7 -0
- package/dist/esm/shared/utils/helpers/object.js +19 -0
- package/dist/esm/shared/utils/helpers/runtime.js +34 -0
- package/dist/esm/shared/utils/helpers/string.js +23 -0
- package/dist/esm/shared/utils/validators/asn.js +25 -0
- package/dist/esm/shared/utils/validators/config-validation.js +93 -0
- package/dist/esm/shared/utils/validators/domain.js +29 -0
- package/dist/esm/shared/utils/validators/entity.js +22 -0
- package/dist/esm/shared/utils/validators/index.js +7 -0
- package/dist/esm/shared/utils/validators/ip.js +48 -0
- package/dist/esm/shared/utils/validators/nameserver.js +44 -0
- package/dist/esm/shared/utils/validators/network.js +42 -0
- package/dist/{application → types/application}/client/RDAPClient.d.ts +10 -1
- package/dist/types/application/client/RDAPClient.d.ts.map +1 -0
- package/dist/types/application/client/index.d.ts.map +1 -0
- package/dist/types/application/deduplication/QueryDeduplicator.d.ts.map +1 -0
- package/dist/types/application/hooks/MiddlewareHooks.d.ts.map +1 -0
- package/dist/types/application/services/BatchProcessor.d.ts.map +1 -0
- package/dist/types/application/services/QueryOrchestrator.d.ts.map +1 -0
- package/dist/types/application/services/QueryPriority.d.ts.map +1 -0
- package/dist/types/application/services/index.d.ts.map +1 -0
- package/dist/{cli → types/cli}/index.d.ts.map +1 -1
- package/dist/types/core/ports/bootstrap.port.d.ts.map +1 -0
- package/dist/types/core/ports/cache.port.d.ts.map +1 -0
- package/dist/types/core/ports/fetcher.port.d.ts.map +1 -0
- package/dist/types/core/ports/index.d.ts.map +1 -0
- package/dist/types/core/ports/normalizer.port.d.ts.map +1 -0
- package/dist/types/core/ports/pii-redactor.port.d.ts.map +1 -0
- package/dist/{index.d.ts → types/index.d.ts} +6 -3
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/infrastructure/cache/CacheManager.d.ts.map +1 -0
- package/dist/types/infrastructure/cache/InMemoryCache.d.ts.map +1 -0
- package/dist/types/infrastructure/cache/PersistentCache.d.ts.map +1 -0
- package/dist/types/infrastructure/cache/RedisCache.d.ts.map +1 -0
- package/dist/types/infrastructure/cache/StaleWhileRevalidateCache.d.ts +16 -0
- package/dist/types/infrastructure/cache/StaleWhileRevalidateCache.d.ts.map +1 -0
- package/dist/types/infrastructure/cache/index.d.ts.map +1 -0
- package/dist/types/infrastructure/http/AuthenticationManager.d.ts.map +1 -0
- package/dist/types/infrastructure/http/BootstrapDiscovery.d.ts.map +1 -0
- package/dist/types/infrastructure/http/BrowserFetcher.d.ts.map +1 -0
- package/dist/types/infrastructure/http/BunFetcher.d.ts.map +1 -0
- package/dist/types/infrastructure/http/CircuitBreaker.d.ts.map +1 -0
- package/dist/types/infrastructure/http/CloudflareWorkersFetcher.d.ts.map +1 -0
- package/dist/types/infrastructure/http/CompressionManager.d.ts.map +1 -0
- package/dist/types/infrastructure/http/ConnectionPool.d.ts.map +1 -0
- package/dist/types/infrastructure/http/DenoFetcher.d.ts.map +1 -0
- package/dist/types/infrastructure/http/DistributedRateLimiter.d.ts +12 -0
- package/dist/types/infrastructure/http/DistributedRateLimiter.d.ts.map +1 -0
- package/dist/{infrastructure → types/infrastructure}/http/Fetcher.d.ts +2 -0
- package/dist/types/infrastructure/http/Fetcher.d.ts.map +1 -0
- package/dist/types/infrastructure/http/Normalizer.d.ts.map +1 -0
- package/dist/types/infrastructure/http/ProxyManager.d.ts.map +1 -0
- package/dist/{infrastructure → types/infrastructure}/http/RateLimiter.d.ts +5 -0
- package/dist/types/infrastructure/http/RateLimiter.d.ts.map +1 -0
- package/dist/types/infrastructure/http/RetryStrategy.d.ts.map +1 -0
- package/dist/types/infrastructure/http/index.d.ts.map +1 -0
- package/dist/types/infrastructure/logging/AuditLogger.d.ts.map +1 -0
- package/dist/types/infrastructure/logging/Logger.d.ts.map +1 -0
- package/dist/{infrastructure → types/infrastructure}/monitoring/GrafanaDashboard.d.ts.map +1 -1
- package/dist/types/infrastructure/monitoring/MetricsCollector.d.ts.map +1 -0
- package/dist/types/infrastructure/monitoring/PrometheusExporter.d.ts.map +1 -0
- package/dist/types/infrastructure/monitoring/TelemetryExporter.d.ts.map +1 -0
- package/dist/types/infrastructure/native/NativeBackend.d.ts.map +1 -0
- package/dist/types/infrastructure/security/PIIRedactor.d.ts.map +1 -0
- package/dist/{infrastructure → types/infrastructure}/security/SSRFProtection.d.ts +1 -0
- package/dist/types/infrastructure/security/SSRFProtection.d.ts.map +1 -0
- package/dist/types/infrastructure/security/index.d.ts.map +1 -0
- package/dist/types/infrastructure/telemetry/UsageTelemetry.d.ts +13 -0
- package/dist/types/infrastructure/telemetry/UsageTelemetry.d.ts.map +1 -0
- package/dist/types/infrastructure/validation/ResponseValidator.d.ts.map +1 -0
- package/dist/types/integrations/express.d.ts.map +1 -0
- package/dist/types/integrations/graphql.d.ts.map +1 -0
- package/dist/types/integrations/nestjs.d.ts.map +1 -0
- package/dist/types/shared/constants/http.constants.d.ts.map +1 -0
- package/dist/types/shared/constants/index.d.ts.map +1 -0
- package/dist/types/shared/constants/rdap.constants.d.ts.map +1 -0
- package/dist/{shared → types/shared}/errors/base.error.d.ts +3 -0
- package/dist/types/shared/errors/base.error.d.ts.map +1 -0
- package/dist/types/shared/errors/index.d.ts.map +1 -0
- package/dist/types/shared/types/entities.d.ts.map +1 -0
- package/dist/{shared → types/shared}/types/enums.d.ts +1 -1
- package/dist/types/shared/types/enums.d.ts.map +1 -0
- package/dist/types/shared/types/errors.d.ts.map +1 -0
- package/dist/types/shared/types/generics.d.ts.map +1 -0
- package/dist/{shared → types/shared}/types/index.d.ts +1 -1
- package/dist/types/shared/types/index.d.ts.map +1 -0
- package/dist/{shared → types/shared}/types/options.d.ts +9 -0
- package/dist/types/shared/types/options.d.ts.map +1 -0
- package/dist/{shared → types/shared}/types/responses.d.ts +20 -0
- package/dist/types/shared/types/responses.d.ts.map +1 -0
- package/dist/types/shared/utils/deprecation.d.ts.map +1 -0
- package/dist/types/shared/utils/enhanced-validators.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/async.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/cache.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/format.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/http.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/index.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/object.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/runtime.d.ts.map +1 -0
- package/dist/types/shared/utils/helpers/string.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/asn.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/config-validation.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/domain.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/entity.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/index.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/ip.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/nameserver.d.ts.map +1 -0
- package/dist/types/shared/utils/validators/network.d.ts.map +1 -0
- package/package.json +29 -25
- package/dist/application/client/RDAPClient.d.ts.map +0 -1
- package/dist/application/client/RDAPClient.js.map +0 -1
- package/dist/application/client/index.d.ts.map +0 -1
- package/dist/application/client/index.js.map +0 -1
- package/dist/application/deduplication/QueryDeduplicator.d.ts.map +0 -1
- package/dist/application/deduplication/QueryDeduplicator.js.map +0 -1
- package/dist/application/hooks/MiddlewareHooks.d.ts.map +0 -1
- package/dist/application/hooks/MiddlewareHooks.js.map +0 -1
- package/dist/application/services/BatchProcessor.d.ts.map +0 -1
- package/dist/application/services/BatchProcessor.js.map +0 -1
- package/dist/application/services/QueryOrchestrator.d.ts.map +0 -1
- package/dist/application/services/QueryOrchestrator.js.map +0 -1
- package/dist/application/services/QueryPriority.d.ts.map +0 -1
- package/dist/application/services/QueryPriority.js.map +0 -1
- package/dist/application/services/index.d.ts.map +0 -1
- package/dist/application/services/index.js.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/core/ports/bootstrap.port.d.ts.map +0 -1
- package/dist/core/ports/bootstrap.port.js +0 -3
- package/dist/core/ports/bootstrap.port.js.map +0 -1
- package/dist/core/ports/cache.port.d.ts.map +0 -1
- package/dist/core/ports/cache.port.js +0 -3
- package/dist/core/ports/cache.port.js.map +0 -1
- package/dist/core/ports/fetcher.port.d.ts.map +0 -1
- package/dist/core/ports/fetcher.port.js +0 -3
- package/dist/core/ports/fetcher.port.js.map +0 -1
- package/dist/core/ports/index.d.ts.map +0 -1
- package/dist/core/ports/index.js.map +0 -1
- package/dist/core/ports/normalizer.port.d.ts.map +0 -1
- package/dist/core/ports/normalizer.port.js +0 -3
- package/dist/core/ports/normalizer.port.js.map +0 -1
- package/dist/core/ports/pii-redactor.port.d.ts.map +0 -1
- package/dist/core/ports/pii-redactor.port.js +0 -3
- package/dist/core/ports/pii-redactor.port.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infrastructure/cache/CacheManager.d.ts.map +0 -1
- package/dist/infrastructure/cache/CacheManager.js.map +0 -1
- package/dist/infrastructure/cache/InMemoryCache.d.ts.map +0 -1
- package/dist/infrastructure/cache/InMemoryCache.js.map +0 -1
- package/dist/infrastructure/cache/PersistentCache.d.ts.map +0 -1
- package/dist/infrastructure/cache/PersistentCache.js.map +0 -1
- package/dist/infrastructure/cache/RedisCache.d.ts.map +0 -1
- package/dist/infrastructure/cache/RedisCache.js.map +0 -1
- package/dist/infrastructure/cache/index.d.ts.map +0 -1
- package/dist/infrastructure/cache/index.js.map +0 -1
- package/dist/infrastructure/http/AuthenticationManager.d.ts.map +0 -1
- package/dist/infrastructure/http/AuthenticationManager.js.map +0 -1
- package/dist/infrastructure/http/BootstrapDiscovery.d.ts.map +0 -1
- package/dist/infrastructure/http/BootstrapDiscovery.js.map +0 -1
- package/dist/infrastructure/http/BrowserFetcher.d.ts.map +0 -1
- package/dist/infrastructure/http/BrowserFetcher.js.map +0 -1
- package/dist/infrastructure/http/BunFetcher.d.ts.map +0 -1
- package/dist/infrastructure/http/BunFetcher.js.map +0 -1
- package/dist/infrastructure/http/CircuitBreaker.d.ts.map +0 -1
- package/dist/infrastructure/http/CircuitBreaker.js.map +0 -1
- package/dist/infrastructure/http/CloudflareWorkersFetcher.d.ts.map +0 -1
- package/dist/infrastructure/http/CloudflareWorkersFetcher.js.map +0 -1
- package/dist/infrastructure/http/CompressionManager.d.ts.map +0 -1
- package/dist/infrastructure/http/CompressionManager.js.map +0 -1
- package/dist/infrastructure/http/ConnectionPool.d.ts.map +0 -1
- package/dist/infrastructure/http/ConnectionPool.js.map +0 -1
- package/dist/infrastructure/http/DenoFetcher.d.ts.map +0 -1
- package/dist/infrastructure/http/DenoFetcher.js.map +0 -1
- package/dist/infrastructure/http/Fetcher.d.ts.map +0 -1
- package/dist/infrastructure/http/Fetcher.js.map +0 -1
- package/dist/infrastructure/http/Normalizer.d.ts.map +0 -1
- package/dist/infrastructure/http/Normalizer.js.map +0 -1
- package/dist/infrastructure/http/ProxyManager.d.ts.map +0 -1
- package/dist/infrastructure/http/ProxyManager.js.map +0 -1
- package/dist/infrastructure/http/RateLimiter.d.ts.map +0 -1
- package/dist/infrastructure/http/RateLimiter.js.map +0 -1
- package/dist/infrastructure/http/RetryStrategy.d.ts.map +0 -1
- package/dist/infrastructure/http/RetryStrategy.js.map +0 -1
- package/dist/infrastructure/http/index.d.ts.map +0 -1
- package/dist/infrastructure/http/index.js.map +0 -1
- package/dist/infrastructure/logging/AuditLogger.d.ts.map +0 -1
- package/dist/infrastructure/logging/AuditLogger.js.map +0 -1
- package/dist/infrastructure/logging/Logger.d.ts.map +0 -1
- package/dist/infrastructure/logging/Logger.js.map +0 -1
- package/dist/infrastructure/monitoring/GrafanaDashboard.js.map +0 -1
- package/dist/infrastructure/monitoring/MetricsCollector.d.ts.map +0 -1
- package/dist/infrastructure/monitoring/MetricsCollector.js.map +0 -1
- package/dist/infrastructure/monitoring/PrometheusExporter.d.ts.map +0 -1
- package/dist/infrastructure/monitoring/PrometheusExporter.js.map +0 -1
- package/dist/infrastructure/monitoring/TelemetryExporter.d.ts.map +0 -1
- package/dist/infrastructure/monitoring/TelemetryExporter.js.map +0 -1
- package/dist/infrastructure/native/NativeBackend.d.ts.map +0 -1
- package/dist/infrastructure/native/NativeBackend.js.map +0 -1
- package/dist/infrastructure/security/PIIRedactor.d.ts.map +0 -1
- package/dist/infrastructure/security/PIIRedactor.js.map +0 -1
- package/dist/infrastructure/security/SSRFProtection.d.ts.map +0 -1
- package/dist/infrastructure/security/SSRFProtection.js.map +0 -1
- package/dist/infrastructure/security/index.d.ts.map +0 -1
- package/dist/infrastructure/security/index.js.map +0 -1
- package/dist/infrastructure/validation/ResponseValidator.d.ts.map +0 -1
- package/dist/infrastructure/validation/ResponseValidator.js.map +0 -1
- package/dist/integrations/express.d.ts.map +0 -1
- package/dist/integrations/express.js.map +0 -1
- package/dist/integrations/graphql.d.ts.map +0 -1
- package/dist/integrations/graphql.js.map +0 -1
- package/dist/integrations/nestjs.d.ts.map +0 -1
- package/dist/integrations/nestjs.js.map +0 -1
- package/dist/shared/constants/http.constants.d.ts.map +0 -1
- package/dist/shared/constants/http.constants.js.map +0 -1
- package/dist/shared/constants/index.d.ts.map +0 -1
- package/dist/shared/constants/index.js.map +0 -1
- package/dist/shared/constants/rdap.constants.d.ts.map +0 -1
- package/dist/shared/constants/rdap.constants.js.map +0 -1
- package/dist/shared/errors/base.error.d.ts.map +0 -1
- package/dist/shared/errors/base.error.js.map +0 -1
- package/dist/shared/errors/index.d.ts.map +0 -1
- package/dist/shared/errors/index.js.map +0 -1
- package/dist/shared/types/entities.d.ts.map +0 -1
- package/dist/shared/types/entities.js.map +0 -1
- package/dist/shared/types/enums.d.ts.map +0 -1
- package/dist/shared/types/enums.js.map +0 -1
- package/dist/shared/types/errors.d.ts.map +0 -1
- package/dist/shared/types/errors.js.map +0 -1
- package/dist/shared/types/generics.d.ts.map +0 -1
- package/dist/shared/types/generics.js.map +0 -1
- package/dist/shared/types/index.d.ts.map +0 -1
- package/dist/shared/types/index.js.map +0 -1
- package/dist/shared/types/options.d.ts.map +0 -1
- package/dist/shared/types/options.js.map +0 -1
- package/dist/shared/types/responses.d.ts.map +0 -1
- package/dist/shared/types/responses.js +0 -3
- package/dist/shared/types/responses.js.map +0 -1
- package/dist/shared/utils/deprecation.d.ts.map +0 -1
- package/dist/shared/utils/deprecation.js.map +0 -1
- package/dist/shared/utils/enhanced-validators.d.ts.map +0 -1
- package/dist/shared/utils/enhanced-validators.js.map +0 -1
- package/dist/shared/utils/helpers/async.d.ts.map +0 -1
- package/dist/shared/utils/helpers/async.js.map +0 -1
- package/dist/shared/utils/helpers/cache.d.ts.map +0 -1
- package/dist/shared/utils/helpers/cache.js.map +0 -1
- package/dist/shared/utils/helpers/format.d.ts.map +0 -1
- package/dist/shared/utils/helpers/format.js.map +0 -1
- package/dist/shared/utils/helpers/http.d.ts.map +0 -1
- package/dist/shared/utils/helpers/http.js.map +0 -1
- package/dist/shared/utils/helpers/index.d.ts.map +0 -1
- package/dist/shared/utils/helpers/index.js.map +0 -1
- package/dist/shared/utils/helpers/object.d.ts.map +0 -1
- package/dist/shared/utils/helpers/object.js.map +0 -1
- package/dist/shared/utils/helpers/runtime.d.ts.map +0 -1
- package/dist/shared/utils/helpers/runtime.js.map +0 -1
- package/dist/shared/utils/helpers/string.d.ts.map +0 -1
- package/dist/shared/utils/helpers/string.js.map +0 -1
- package/dist/shared/utils/validators/asn.d.ts.map +0 -1
- package/dist/shared/utils/validators/asn.js.map +0 -1
- package/dist/shared/utils/validators/config-validation.d.ts.map +0 -1
- package/dist/shared/utils/validators/config-validation.js.map +0 -1
- package/dist/shared/utils/validators/domain.d.ts.map +0 -1
- package/dist/shared/utils/validators/domain.js.map +0 -1
- package/dist/shared/utils/validators/entity.d.ts.map +0 -1
- package/dist/shared/utils/validators/entity.js.map +0 -1
- package/dist/shared/utils/validators/index.d.ts.map +0 -1
- package/dist/shared/utils/validators/index.js.map +0 -1
- package/dist/shared/utils/validators/ip.d.ts.map +0 -1
- package/dist/shared/utils/validators/ip.js.map +0 -1
- package/dist/shared/utils/validators/nameserver.d.ts.map +0 -1
- package/dist/shared/utils/validators/nameserver.js.map +0 -1
- package/dist/shared/utils/validators/network.d.ts.map +0 -1
- package/dist/shared/utils/validators/network.js.map +0 -1
- /package/dist/{application → types/application}/client/index.d.ts +0 -0
- /package/dist/{application → types/application}/deduplication/QueryDeduplicator.d.ts +0 -0
- /package/dist/{application → types/application}/hooks/MiddlewareHooks.d.ts +0 -0
- /package/dist/{application → types/application}/services/BatchProcessor.d.ts +0 -0
- /package/dist/{application → types/application}/services/QueryOrchestrator.d.ts +0 -0
- /package/dist/{application → types/application}/services/QueryPriority.d.ts +0 -0
- /package/dist/{application → types/application}/services/index.d.ts +0 -0
- /package/dist/{cli → types/cli}/index.d.ts +0 -0
- /package/dist/{core → types/core}/ports/bootstrap.port.d.ts +0 -0
- /package/dist/{core → types/core}/ports/cache.port.d.ts +0 -0
- /package/dist/{core → types/core}/ports/fetcher.port.d.ts +0 -0
- /package/dist/{core → types/core}/ports/index.d.ts +0 -0
- /package/dist/{core → types/core}/ports/normalizer.port.d.ts +0 -0
- /package/dist/{core → types/core}/ports/pii-redactor.port.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/cache/CacheManager.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/cache/InMemoryCache.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/cache/PersistentCache.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/cache/RedisCache.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/cache/index.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/AuthenticationManager.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/BootstrapDiscovery.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/BrowserFetcher.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/BunFetcher.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/CircuitBreaker.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/CloudflareWorkersFetcher.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/CompressionManager.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/ConnectionPool.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/DenoFetcher.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/Normalizer.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/ProxyManager.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/RetryStrategy.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/http/index.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/logging/AuditLogger.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/logging/Logger.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/monitoring/GrafanaDashboard.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/monitoring/MetricsCollector.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/monitoring/PrometheusExporter.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/monitoring/TelemetryExporter.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/native/NativeBackend.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/security/PIIRedactor.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/security/index.d.ts +0 -0
- /package/dist/{infrastructure → types/infrastructure}/validation/ResponseValidator.d.ts +0 -0
- /package/dist/{integrations → types/integrations}/express.d.ts +0 -0
- /package/dist/{integrations → types/integrations}/graphql.d.ts +0 -0
- /package/dist/{integrations → types/integrations}/nestjs.d.ts +0 -0
- /package/dist/{shared → types/shared}/constants/http.constants.d.ts +0 -0
- /package/dist/{shared → types/shared}/constants/index.d.ts +0 -0
- /package/dist/{shared → types/shared}/constants/rdap.constants.d.ts +0 -0
- /package/dist/{shared → types/shared}/errors/index.d.ts +0 -0
- /package/dist/{shared → types/shared}/types/entities.d.ts +0 -0
- /package/dist/{shared → types/shared}/types/errors.d.ts +0 -0
- /package/dist/{shared → types/shared}/types/generics.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/deprecation.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/enhanced-validators.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/async.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/cache.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/format.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/http.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/index.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/object.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/runtime.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/helpers/string.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/asn.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/config-validation.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/domain.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/entity.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/index.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/ip.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/nameserver.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils/validators/network.d.ts +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export class QueryPriorityQueue {
|
|
2
|
+
constructor(concurrency = 5, processor) {
|
|
3
|
+
this.highPriorityQueue = [];
|
|
4
|
+
this.normalPriorityQueue = [];
|
|
5
|
+
this.lowPriorityQueue = [];
|
|
6
|
+
this.processing = false;
|
|
7
|
+
this.activeCount = 0;
|
|
8
|
+
this.concurrency = concurrency;
|
|
9
|
+
this.processor = processor;
|
|
10
|
+
}
|
|
11
|
+
async enqueue(data, priority = 'normal') {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const item = {
|
|
14
|
+
id: `${Date.now()}-${Math.random()}`,
|
|
15
|
+
priority,
|
|
16
|
+
data,
|
|
17
|
+
timestamp: Date.now(),
|
|
18
|
+
resolve,
|
|
19
|
+
reject,
|
|
20
|
+
};
|
|
21
|
+
switch (priority) {
|
|
22
|
+
case 'high':
|
|
23
|
+
this.highPriorityQueue.push(item);
|
|
24
|
+
break;
|
|
25
|
+
case 'low':
|
|
26
|
+
this.lowPriorityQueue.push(item);
|
|
27
|
+
break;
|
|
28
|
+
case 'normal':
|
|
29
|
+
default:
|
|
30
|
+
this.normalPriorityQueue.push(item);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
this.processQueue();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async processQueue() {
|
|
37
|
+
if (this.processing)
|
|
38
|
+
return;
|
|
39
|
+
this.processing = true;
|
|
40
|
+
while (this.hasItems() && this.activeCount < this.concurrency) {
|
|
41
|
+
const item = this.dequeue();
|
|
42
|
+
if (!item)
|
|
43
|
+
break;
|
|
44
|
+
this.activeCount++;
|
|
45
|
+
this.processor(item.data)
|
|
46
|
+
.then((result) => {
|
|
47
|
+
item.resolve(result);
|
|
48
|
+
})
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
item.reject(error);
|
|
51
|
+
})
|
|
52
|
+
.finally(() => {
|
|
53
|
+
this.activeCount--;
|
|
54
|
+
this.processQueue();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
this.processing = false;
|
|
58
|
+
}
|
|
59
|
+
dequeue() {
|
|
60
|
+
if (this.highPriorityQueue.length > 0) {
|
|
61
|
+
return this.highPriorityQueue.shift();
|
|
62
|
+
}
|
|
63
|
+
if (this.normalPriorityQueue.length > 0) {
|
|
64
|
+
return this.normalPriorityQueue.shift();
|
|
65
|
+
}
|
|
66
|
+
if (this.lowPriorityQueue.length > 0) {
|
|
67
|
+
return this.lowPriorityQueue.shift();
|
|
68
|
+
}
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
hasItems() {
|
|
72
|
+
return (this.highPriorityQueue.length > 0 ||
|
|
73
|
+
this.normalPriorityQueue.length > 0 ||
|
|
74
|
+
this.lowPriorityQueue.length > 0);
|
|
75
|
+
}
|
|
76
|
+
getStats() {
|
|
77
|
+
return {
|
|
78
|
+
high: this.highPriorityQueue.length,
|
|
79
|
+
normal: this.normalPriorityQueue.length,
|
|
80
|
+
low: this.lowPriorityQueue.length,
|
|
81
|
+
total: this.highPriorityQueue.length +
|
|
82
|
+
this.normalPriorityQueue.length +
|
|
83
|
+
this.lowPriorityQueue.length,
|
|
84
|
+
active: this.activeCount,
|
|
85
|
+
concurrency: this.concurrency,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
clear() {
|
|
89
|
+
const rejectAll = (queue) => {
|
|
90
|
+
queue.forEach((item) => {
|
|
91
|
+
item.reject(new Error('Queue cleared'));
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
rejectAll(this.highPriorityQueue);
|
|
95
|
+
rejectAll(this.normalPriorityQueue);
|
|
96
|
+
rejectAll(this.lowPriorityQueue);
|
|
97
|
+
this.highPriorityQueue = [];
|
|
98
|
+
this.normalPriorityQueue = [];
|
|
99
|
+
this.lowPriorityQueue = [];
|
|
100
|
+
}
|
|
101
|
+
size() {
|
|
102
|
+
return (this.highPriorityQueue.length +
|
|
103
|
+
this.normalPriorityQueue.length +
|
|
104
|
+
this.lowPriorityQueue.length);
|
|
105
|
+
}
|
|
106
|
+
isEmpty() {
|
|
107
|
+
return this.size() === 0;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { RDAPClient, VERSION } from '../index';
|
|
3
|
+
const HELP_TEXT = `
|
|
4
|
+
RDAPify v${VERSION} — RDAP client CLI
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
rdapify domain <name> Query domain registration info
|
|
8
|
+
rdapify ip <address> Query IP address info
|
|
9
|
+
rdapify asn <number> Query ASN info
|
|
10
|
+
rdapify nameserver <hostname> Query nameserver info
|
|
11
|
+
rdapify entity <handle> --server <url> Query entity (contact/registrar) info
|
|
12
|
+
|
|
13
|
+
Options:
|
|
14
|
+
--json Output raw JSON
|
|
15
|
+
--no-cache Disable cache for this query
|
|
16
|
+
--timeout <ms> Request timeout in milliseconds (default: 10000)
|
|
17
|
+
--server <url> RDAP server base URL (required for entity queries)
|
|
18
|
+
--version, -v Show version
|
|
19
|
+
--help, -h Show this help message
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
rdapify domain example.com
|
|
23
|
+
rdapify ip 8.8.8.8
|
|
24
|
+
rdapify asn 15169
|
|
25
|
+
rdapify nameserver ns1.example.com
|
|
26
|
+
rdapify entity ARIN-HN-1 --server https://rdap.arin.net/registry
|
|
27
|
+
rdapify domain example.com --json
|
|
28
|
+
rdapify ip 1.1.1.1 --no-cache --timeout 5000
|
|
29
|
+
`.trimStart();
|
|
30
|
+
function parseArgs(argv) {
|
|
31
|
+
const result = {
|
|
32
|
+
command: null,
|
|
33
|
+
query: null,
|
|
34
|
+
json: false,
|
|
35
|
+
noCache: false,
|
|
36
|
+
timeout: 10000,
|
|
37
|
+
version: false,
|
|
38
|
+
help: false,
|
|
39
|
+
server: null,
|
|
40
|
+
};
|
|
41
|
+
let i = 0;
|
|
42
|
+
while (i < argv.length) {
|
|
43
|
+
const arg = argv[i];
|
|
44
|
+
if (arg === undefined) {
|
|
45
|
+
i++;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
switch (arg) {
|
|
49
|
+
case '--json':
|
|
50
|
+
result.json = true;
|
|
51
|
+
break;
|
|
52
|
+
case '--no-cache':
|
|
53
|
+
result.noCache = true;
|
|
54
|
+
break;
|
|
55
|
+
case '--timeout': {
|
|
56
|
+
const next = argv[i + 1];
|
|
57
|
+
if (next === undefined || next.startsWith('-')) {
|
|
58
|
+
fatal('--timeout requires a numeric value in milliseconds');
|
|
59
|
+
}
|
|
60
|
+
const ms = parseInt(next, 10);
|
|
61
|
+
if (isNaN(ms) || ms <= 0) {
|
|
62
|
+
fatal(`--timeout value must be a positive integer, got: ${next}`);
|
|
63
|
+
}
|
|
64
|
+
result.timeout = ms;
|
|
65
|
+
i++;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case '--server': {
|
|
69
|
+
const next = argv[i + 1];
|
|
70
|
+
if (next === undefined || next.startsWith('-')) {
|
|
71
|
+
fatal('--server requires a URL value');
|
|
72
|
+
}
|
|
73
|
+
result.server = next;
|
|
74
|
+
i++;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case '--version':
|
|
78
|
+
case '-v':
|
|
79
|
+
result.version = true;
|
|
80
|
+
break;
|
|
81
|
+
case '--help':
|
|
82
|
+
case '-h':
|
|
83
|
+
result.help = true;
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
if (!arg.startsWith('-')) {
|
|
87
|
+
if (result.command === null) {
|
|
88
|
+
if (arg !== 'domain' && arg !== 'ip' && arg !== 'asn' && arg !== 'nameserver' && arg !== 'entity') {
|
|
89
|
+
fatal(`Unknown command: "${arg}". Valid commands are: domain, ip, asn, nameserver, entity`);
|
|
90
|
+
}
|
|
91
|
+
result.command = arg;
|
|
92
|
+
}
|
|
93
|
+
else if (result.query === null) {
|
|
94
|
+
result.query = arg;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
fatal(`Unknown option: "${arg}". Run rdapify --help for usage.`);
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
i++;
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
function label(text, width = 13) {
|
|
107
|
+
return `${text}:`.padEnd(width);
|
|
108
|
+
}
|
|
109
|
+
function formatDate(iso) {
|
|
110
|
+
const d = new Date(iso);
|
|
111
|
+
if (isNaN(d.getTime()))
|
|
112
|
+
return iso;
|
|
113
|
+
return d.toISOString().slice(0, 10);
|
|
114
|
+
}
|
|
115
|
+
function getEventDate(events, eventType) {
|
|
116
|
+
if (!events)
|
|
117
|
+
return undefined;
|
|
118
|
+
const ev = events.find((e) => e.type === eventType);
|
|
119
|
+
return ev ? formatDate(ev.date) : undefined;
|
|
120
|
+
}
|
|
121
|
+
function printDomain(res) {
|
|
122
|
+
const name = res.ldhName ?? res.unicodeName ?? res.query;
|
|
123
|
+
const registrar = res.registrar?.name ?? '—';
|
|
124
|
+
const status = res.status?.join(', ') ?? '—';
|
|
125
|
+
const created = getEventDate(res.events, 'registration') ?? '—';
|
|
126
|
+
const expires = getEventDate(res.events, 'expiration') ?? '—';
|
|
127
|
+
const updated = getEventDate(res.events, 'last changed') ?? '—';
|
|
128
|
+
const nameservers = res.nameservers?.join(', ') ?? '—';
|
|
129
|
+
process.stdout.write([
|
|
130
|
+
`${label('Domain')}${name}`,
|
|
131
|
+
`${label('Registrar')}${registrar}`,
|
|
132
|
+
`${label('Status')}${status}`,
|
|
133
|
+
`${label('Created')}${created}`,
|
|
134
|
+
`${label('Expires')}${expires}`,
|
|
135
|
+
`${label('Updated')}${updated}`,
|
|
136
|
+
`${label('Nameservers')}${nameservers}`,
|
|
137
|
+
].join('\n') + '\n');
|
|
138
|
+
}
|
|
139
|
+
function printIP(res) {
|
|
140
|
+
const ip = res.query;
|
|
141
|
+
const type = res.ipVersion ? `IPv${res.ipVersion.slice(1)}` : '—';
|
|
142
|
+
const handle = res.handle ?? '—';
|
|
143
|
+
const name = res.name ?? '—';
|
|
144
|
+
const country = res.country ?? '—';
|
|
145
|
+
const status = res.status?.join(', ') ?? '—';
|
|
146
|
+
process.stdout.write([
|
|
147
|
+
`${label('IP Address')}${ip}`,
|
|
148
|
+
`${label('Type')}${type}`,
|
|
149
|
+
`${label('Handle')}${handle}`,
|
|
150
|
+
`${label('Name')}${name}`,
|
|
151
|
+
`${label('Country')}${country}`,
|
|
152
|
+
`${label('Status')}${status}`,
|
|
153
|
+
].join('\n') + '\n');
|
|
154
|
+
}
|
|
155
|
+
function printASN(res) {
|
|
156
|
+
const asn = res.startAutnum ?? res.query;
|
|
157
|
+
const handle = res.handle ?? '—';
|
|
158
|
+
const name = res.name ?? '—';
|
|
159
|
+
const country = res.country ?? '—';
|
|
160
|
+
const status = res.status?.join(', ') ?? '—';
|
|
161
|
+
process.stdout.write([
|
|
162
|
+
`${label('ASN')}${asn}`,
|
|
163
|
+
`${label('Handle')}${handle}`,
|
|
164
|
+
`${label('Name')}${name}`,
|
|
165
|
+
`${label('Country')}${country}`,
|
|
166
|
+
`${label('Status')}${status}`,
|
|
167
|
+
].join('\n') + '\n');
|
|
168
|
+
}
|
|
169
|
+
function printNameserver(res) {
|
|
170
|
+
const name = res.ldhName ?? res.unicodeName ?? res.query;
|
|
171
|
+
const handle = res.handle ?? '—';
|
|
172
|
+
const status = res.status?.join(', ') ?? '—';
|
|
173
|
+
const v4 = res.ipAddresses?.v4?.join(', ') || '—';
|
|
174
|
+
const v6 = res.ipAddresses?.v6?.join(', ') || '—';
|
|
175
|
+
process.stdout.write([
|
|
176
|
+
`${label('Nameserver')}${name}`,
|
|
177
|
+
`${label('Handle')}${handle}`,
|
|
178
|
+
`${label('Status')}${status}`,
|
|
179
|
+
`${label('IPv4')}${v4}`,
|
|
180
|
+
`${label('IPv6')}${v6}`,
|
|
181
|
+
].join('\n') + '\n');
|
|
182
|
+
}
|
|
183
|
+
function printEntity(res) {
|
|
184
|
+
const handle = res.handle ?? res.query;
|
|
185
|
+
const roles = res.roles?.join(', ') ?? '—';
|
|
186
|
+
const status = res.status?.join(', ') ?? '—';
|
|
187
|
+
let name = '—';
|
|
188
|
+
if (res.vcardArray && Array.isArray(res.vcardArray) && res.vcardArray.length >= 2) {
|
|
189
|
+
const vcard = res.vcardArray[1];
|
|
190
|
+
if (Array.isArray(vcard)) {
|
|
191
|
+
const fnField = vcard.find((field) => Array.isArray(field) && field[0] === 'fn');
|
|
192
|
+
if (fnField && Array.isArray(fnField) && fnField.length >= 4) {
|
|
193
|
+
name = fnField[3] ?? '—';
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
process.stdout.write([
|
|
198
|
+
`${label('Handle')}${handle}`,
|
|
199
|
+
`${label('Name')}${name}`,
|
|
200
|
+
`${label('Roles')}${roles}`,
|
|
201
|
+
`${label('Status')}${status}`,
|
|
202
|
+
].join('\n') + '\n');
|
|
203
|
+
}
|
|
204
|
+
function fatal(message, code = 1) {
|
|
205
|
+
process.stderr.write(`Error: ${message}\n`);
|
|
206
|
+
process.exit(code);
|
|
207
|
+
}
|
|
208
|
+
async function main() {
|
|
209
|
+
const argv = process.argv.slice(2);
|
|
210
|
+
const args = parseArgs(argv);
|
|
211
|
+
if (args.version) {
|
|
212
|
+
process.stdout.write(`rdapify v${VERSION}\n`);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (args.help) {
|
|
216
|
+
process.stdout.write(HELP_TEXT);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (args.command === null) {
|
|
220
|
+
process.stdout.write(HELP_TEXT);
|
|
221
|
+
process.exit(0);
|
|
222
|
+
}
|
|
223
|
+
if (args.query === null || args.query.trim() === '') {
|
|
224
|
+
fatal(`Missing argument for command "${args.command}". Example: rdapify ${args.command} <value>`);
|
|
225
|
+
}
|
|
226
|
+
const client = new RDAPClient({
|
|
227
|
+
cache: args.noCache ? false : true,
|
|
228
|
+
timeout: args.timeout,
|
|
229
|
+
});
|
|
230
|
+
const query = args.query.trim();
|
|
231
|
+
try {
|
|
232
|
+
switch (args.command) {
|
|
233
|
+
case 'domain': {
|
|
234
|
+
const result = await client.domain(query);
|
|
235
|
+
if (args.json) {
|
|
236
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
printDomain(result);
|
|
240
|
+
}
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
case 'ip': {
|
|
244
|
+
const result = await client.ip(query);
|
|
245
|
+
if (args.json) {
|
|
246
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
printIP(result);
|
|
250
|
+
}
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
case 'asn': {
|
|
254
|
+
const result = await client.asn(query);
|
|
255
|
+
if (args.json) {
|
|
256
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
printASN(result);
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
case 'nameserver': {
|
|
264
|
+
const result = await client.nameserver(query);
|
|
265
|
+
if (args.json) {
|
|
266
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
printNameserver(result);
|
|
270
|
+
}
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
case 'entity': {
|
|
274
|
+
if (!args.server) {
|
|
275
|
+
fatal('Entity queries require --server <url>. Example: rdapify entity ARIN-HN-1 --server https://rdap.arin.net/registry');
|
|
276
|
+
}
|
|
277
|
+
const result = await client.entity(query, args.server);
|
|
278
|
+
if (args.json) {
|
|
279
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
printEntity(result);
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
catch (err) {
|
|
289
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
290
|
+
fatal(message);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
main().catch((err) => {
|
|
294
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
295
|
+
process.stderr.write(`Fatal: ${message}\n`);
|
|
296
|
+
process.exit(1);
|
|
297
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { RDAPClient } from './application/client';
|
|
2
|
+
export { RDAPifyError, SSRFProtectionError, NetworkError, TimeoutError, RDAPServerError, NoServerFoundError, ValidationError, ParseError, CacheError, RateLimitError, SearchNotSupportedError, isRDAPifyError, isSSRFProtectionError, isNetworkError, isTimeoutError, isRateLimitError, } from './shared/errors';
|
|
3
|
+
export { validateDomain, validateIP, validateIPv4, validateIPv6, validateASN, validateNameserver, validateEntityHandle, isPrivateIP, isLocalhost, isLinkLocal, normalizeDomain, normalizeIP, normalizeASN, normalizeNameserver, normalizeEntityHandle, } from './shared/utils/validators';
|
|
4
|
+
export { UsageTelemetry } from './infrastructure/telemetry/UsageTelemetry';
|
|
5
|
+
export const VERSION = '0.3.1';
|
|
6
|
+
export { BatchProcessor } from './application/services/BatchProcessor';
|
|
7
|
+
export { RateLimiter } from './infrastructure/http/RateLimiter';
|
|
8
|
+
export { DistributedRateLimiter } from './infrastructure/http/DistributedRateLimiter';
|
|
9
|
+
export { ConnectionPool } from './infrastructure/http/ConnectionPool';
|
|
10
|
+
export { MetricsCollector } from './infrastructure/monitoring/MetricsCollector';
|
|
11
|
+
export { Logger } from './infrastructure/logging/Logger';
|
|
12
|
+
export { RetryStrategy } from './infrastructure/http/RetryStrategy';
|
|
13
|
+
export { QueryPriorityQueue } from './application/services/QueryPriority';
|
|
14
|
+
export { PersistentCache } from './infrastructure/cache/PersistentCache';
|
|
15
|
+
export { validateIdnDomain, validateIpv6WithZone, validateAsnRange, isIdnDomain, isPunycodeDomain, idnToAscii, asciiToIdn, } from './shared/utils/enhanced-validators';
|
|
16
|
+
export { AuthenticationManager } from './infrastructure/http/AuthenticationManager';
|
|
17
|
+
export { ProxyManager } from './infrastructure/http/ProxyManager';
|
|
18
|
+
export { CompressionManager } from './infrastructure/http/CompressionManager';
|
|
19
|
+
export { RedisCache } from './infrastructure/cache/RedisCache';
|
|
20
|
+
export { MiddlewareManager } from './application/hooks/MiddlewareHooks';
|
|
21
|
+
export { QueryDeduplicator } from './application/deduplication/QueryDeduplicator';
|
|
22
|
+
export { AuditLogger, InMemoryAuditAdapter, FileAuditAdapter, } from './infrastructure/logging/AuditLogger';
|
|
23
|
+
export { ResponseValidator } from './infrastructure/validation/ResponseValidator';
|
|
24
|
+
export { isNode, isBrowser, isDeno, isBun, isCloudflareWorkers, getRuntimeName, } from './shared/utils/helpers/runtime';
|
|
25
|
+
export { isNativeAvailable } from './infrastructure/native/NativeBackend';
|
|
26
|
+
export { CircuitBreaker, CircuitOpenError } from './infrastructure/http/CircuitBreaker';
|
|
27
|
+
export { QueryAbortedError } from './shared/errors';
|
|
28
|
+
export { BunFetcher } from './infrastructure/http/BunFetcher';
|
|
29
|
+
export { DenoFetcher } from './infrastructure/http/DenoFetcher';
|
|
30
|
+
export { CloudflareWorkersFetcher } from './infrastructure/http/CloudflareWorkersFetcher';
|
|
31
|
+
export { BrowserFetcher } from './infrastructure/http/BrowserFetcher';
|
|
32
|
+
export { createRdapifySchema, RDAPIFY_TYPE_DEFS } from './integrations/graphql';
|
|
33
|
+
export { rdapifyExpress, MinimalRouter } from './integrations/express';
|
|
34
|
+
export { RdapifyModule, InjectRdapClient, RDAPIFY_CLIENT_TOKEN } from './integrations/nestjs';
|
|
35
|
+
export { PrometheusExporter } from './infrastructure/monitoring/PrometheusExporter';
|
|
36
|
+
export { TelemetryExporter } from './infrastructure/monitoring/TelemetryExporter';
|
|
37
|
+
export { RDAPIFY_GRAFANA_DASHBOARD } from './infrastructure/monitoring/GrafanaDashboard';
|
|
38
|
+
export { deprecated } from './shared/utils/deprecation';
|
|
39
|
+
import { RDAPClient as RDAPClientClass } from './application/client';
|
|
40
|
+
export default RDAPClientClass;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { CacheError } from '../../shared/errors';
|
|
2
|
+
import { InMemoryCache } from './InMemoryCache';
|
|
3
|
+
import { RedisCache } from './RedisCache';
|
|
4
|
+
import { StaleWhileRevalidateCache } from './StaleWhileRevalidateCache';
|
|
5
|
+
export class CacheManager {
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
this.ttl = options.ttl || 3600;
|
|
8
|
+
this.enabled = options.strategy !== 'none';
|
|
9
|
+
switch (options.strategy) {
|
|
10
|
+
case 'memory':
|
|
11
|
+
default:
|
|
12
|
+
this.cache = new InMemoryCache(options.maxSize || 1000);
|
|
13
|
+
break;
|
|
14
|
+
case 'redis':
|
|
15
|
+
if (!options.redisClient) {
|
|
16
|
+
throw new CacheError('Redis strategy requires a "redisClient" option. Pass your Redis client instance (ioredis, redis, etc.).');
|
|
17
|
+
}
|
|
18
|
+
this.cache = new RedisCache(options.redisClient, {
|
|
19
|
+
keyPrefix: options.keyPrefix,
|
|
20
|
+
});
|
|
21
|
+
break;
|
|
22
|
+
case 'custom':
|
|
23
|
+
if (!options.customCache) {
|
|
24
|
+
throw new CacheError('Custom cache implementation required');
|
|
25
|
+
}
|
|
26
|
+
this.cache = options.customCache;
|
|
27
|
+
break;
|
|
28
|
+
case 'none':
|
|
29
|
+
this.cache = new NoOpCache();
|
|
30
|
+
break;
|
|
31
|
+
case 'stale-while-revalidate':
|
|
32
|
+
this.cache = new StaleWhileRevalidateCache(options.maxSize || 1000, options.revalidateCallback);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async get(key) {
|
|
37
|
+
if (!this.enabled)
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
return await this.cache.get(key);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.warn('Cache get error:', error);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async set(key, value, ttl) {
|
|
48
|
+
if (!this.enabled)
|
|
49
|
+
return;
|
|
50
|
+
try {
|
|
51
|
+
await this.cache.set(key, value, ttl || this.ttl);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.warn('Cache set error:', error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async delete(key) {
|
|
58
|
+
if (!this.enabled)
|
|
59
|
+
return;
|
|
60
|
+
try {
|
|
61
|
+
await this.cache.delete(key);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.warn('Cache delete error:', error);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async clear() {
|
|
68
|
+
if (!this.enabled)
|
|
69
|
+
return;
|
|
70
|
+
try {
|
|
71
|
+
await this.cache.clear();
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.warn('Cache clear error:', error);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async has(key) {
|
|
78
|
+
if (!this.enabled)
|
|
79
|
+
return false;
|
|
80
|
+
try {
|
|
81
|
+
return await this.cache.has(key);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.warn('Cache has error:', error);
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async size() {
|
|
89
|
+
if (!this.enabled)
|
|
90
|
+
return 0;
|
|
91
|
+
try {
|
|
92
|
+
return await this.cache.size();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.warn('Cache size error:', error);
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async getStats() {
|
|
100
|
+
return {
|
|
101
|
+
size: await this.size(),
|
|
102
|
+
enabled: this.enabled,
|
|
103
|
+
ttl: this.ttl,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
class NoOpCache {
|
|
108
|
+
async get() {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
async set() {
|
|
112
|
+
}
|
|
113
|
+
async delete() {
|
|
114
|
+
}
|
|
115
|
+
async clear() {
|
|
116
|
+
}
|
|
117
|
+
async has() {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
async size() {
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export class InMemoryCache {
|
|
2
|
+
constructor(maxSize = 1000) {
|
|
3
|
+
this.cache = new Map();
|
|
4
|
+
this.maxSize = maxSize;
|
|
5
|
+
this.accessOrder = [];
|
|
6
|
+
}
|
|
7
|
+
async get(key) {
|
|
8
|
+
const entry = this.cache.get(key);
|
|
9
|
+
if (!entry) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (Date.now() > entry.expiresAt) {
|
|
13
|
+
await this.delete(key);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
this.updateAccessOrder(key);
|
|
17
|
+
return entry.value;
|
|
18
|
+
}
|
|
19
|
+
async set(key, value, ttl = 3600) {
|
|
20
|
+
if (this.cache.size >= this.maxSize && !this.cache.has(key)) {
|
|
21
|
+
await this.evictLRU();
|
|
22
|
+
}
|
|
23
|
+
const expiresAt = Date.now() + ttl * 1000;
|
|
24
|
+
this.cache.set(key, {
|
|
25
|
+
value,
|
|
26
|
+
expiresAt,
|
|
27
|
+
});
|
|
28
|
+
this.updateAccessOrder(key);
|
|
29
|
+
}
|
|
30
|
+
async delete(key) {
|
|
31
|
+
this.cache.delete(key);
|
|
32
|
+
this.removeFromAccessOrder(key);
|
|
33
|
+
}
|
|
34
|
+
async clear() {
|
|
35
|
+
this.cache.clear();
|
|
36
|
+
this.accessOrder = [];
|
|
37
|
+
}
|
|
38
|
+
async has(key) {
|
|
39
|
+
const entry = this.cache.get(key);
|
|
40
|
+
if (!entry) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (Date.now() > entry.expiresAt) {
|
|
44
|
+
await this.delete(key);
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
async size() {
|
|
50
|
+
await this.cleanupExpired();
|
|
51
|
+
return this.cache.size;
|
|
52
|
+
}
|
|
53
|
+
updateAccessOrder(key) {
|
|
54
|
+
this.removeFromAccessOrder(key);
|
|
55
|
+
this.accessOrder.push(key);
|
|
56
|
+
}
|
|
57
|
+
removeFromAccessOrder(key) {
|
|
58
|
+
const index = this.accessOrder.indexOf(key);
|
|
59
|
+
if (index > -1) {
|
|
60
|
+
this.accessOrder.splice(index, 1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async evictLRU() {
|
|
64
|
+
if (this.accessOrder.length === 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const lruKey = this.accessOrder[0];
|
|
68
|
+
if (lruKey) {
|
|
69
|
+
await this.delete(lruKey);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async cleanupExpired() {
|
|
73
|
+
const now = Date.now();
|
|
74
|
+
const expiredKeys = [];
|
|
75
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
76
|
+
if (now > entry.expiresAt) {
|
|
77
|
+
expiredKeys.push(key);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const key of expiredKeys) {
|
|
81
|
+
await this.delete(key);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async getStats() {
|
|
85
|
+
await this.cleanupExpired();
|
|
86
|
+
return {
|
|
87
|
+
size: this.cache.size,
|
|
88
|
+
maxSize: this.maxSize,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|