rdapify 0.3.0 → 0.3.2
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/CHANGELOG.md +17 -0
- 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 +15 -2
- 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 +126 -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 +30 -26
- 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,187 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
export class InMemoryAuditAdapter {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.events = [];
|
|
5
|
+
this.maxEvents = options?.maxEvents ?? 10000;
|
|
6
|
+
this.retentionMs = (options?.retentionHours ?? 24) * 60 * 60 * 1000;
|
|
7
|
+
}
|
|
8
|
+
write(event) {
|
|
9
|
+
this.evict();
|
|
10
|
+
this.events.push(event);
|
|
11
|
+
if (this.events.length > this.maxEvents) {
|
|
12
|
+
this.events = this.events.slice(-this.maxEvents);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
getEvents(since) {
|
|
16
|
+
if (!since) {
|
|
17
|
+
return [...this.events];
|
|
18
|
+
}
|
|
19
|
+
const sinceMs = new Date(since).getTime();
|
|
20
|
+
return this.events.filter((e) => new Date(e.timestamp).getTime() >= sinceMs);
|
|
21
|
+
}
|
|
22
|
+
getEventsByType(type) {
|
|
23
|
+
return this.events.filter((e) => e.eventType === type);
|
|
24
|
+
}
|
|
25
|
+
clear() {
|
|
26
|
+
this.events = [];
|
|
27
|
+
}
|
|
28
|
+
size() {
|
|
29
|
+
return this.events.length;
|
|
30
|
+
}
|
|
31
|
+
evict() {
|
|
32
|
+
const cutoff = Date.now() - this.retentionMs;
|
|
33
|
+
this.events = this.events.filter((e) => new Date(e.timestamp).getTime() >= cutoff);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class FileAuditAdapter {
|
|
37
|
+
constructor(filePath) {
|
|
38
|
+
this.filePath = filePath;
|
|
39
|
+
}
|
|
40
|
+
async write(event) {
|
|
41
|
+
const line = JSON.stringify(event) + '\n';
|
|
42
|
+
await fs.appendFile(this.filePath, line, 'utf8');
|
|
43
|
+
}
|
|
44
|
+
async flush() {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export class AuditLogger {
|
|
48
|
+
constructor(options) {
|
|
49
|
+
this.eventsLogged = 0;
|
|
50
|
+
this.enabled = options?.enabled ?? true;
|
|
51
|
+
this.adapter = options?.adapter ?? new InMemoryAuditAdapter({
|
|
52
|
+
retentionHours: options?.retentionHours ?? 24,
|
|
53
|
+
});
|
|
54
|
+
this.includeRequestHeaders = options?.includeRequestHeaders ?? false;
|
|
55
|
+
this.includeResponseSize = options?.includeResponseSize ?? false;
|
|
56
|
+
this.sessionId = options?.sessionId;
|
|
57
|
+
this.clientId = options?.clientId;
|
|
58
|
+
this.tags = options?.tags;
|
|
59
|
+
}
|
|
60
|
+
log(event) {
|
|
61
|
+
if (!this.enabled)
|
|
62
|
+
return;
|
|
63
|
+
const fullEvent = {
|
|
64
|
+
...event,
|
|
65
|
+
id: this.generateId(),
|
|
66
|
+
timestamp: new Date().toISOString(),
|
|
67
|
+
};
|
|
68
|
+
if (!this.includeRequestHeaders) {
|
|
69
|
+
delete fullEvent.requestHeaders;
|
|
70
|
+
}
|
|
71
|
+
if (!this.includeResponseSize) {
|
|
72
|
+
delete fullEvent.responseSize;
|
|
73
|
+
}
|
|
74
|
+
if (this.tags) {
|
|
75
|
+
fullEvent.tags = { ...this.tags, ...fullEvent.tags };
|
|
76
|
+
}
|
|
77
|
+
this.adapter.write(fullEvent);
|
|
78
|
+
this.eventsLogged++;
|
|
79
|
+
}
|
|
80
|
+
logQueryStart(params) {
|
|
81
|
+
this.log({
|
|
82
|
+
eventType: 'QUERY_START',
|
|
83
|
+
queryType: params.queryType,
|
|
84
|
+
query: params.query,
|
|
85
|
+
success: false,
|
|
86
|
+
durationMs: 0,
|
|
87
|
+
cached: false,
|
|
88
|
+
sessionId: params.sessionId ?? this.sessionId,
|
|
89
|
+
clientId: params.clientId ?? this.clientId,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
logQuerySuccess(params) {
|
|
93
|
+
this.log({
|
|
94
|
+
eventType: 'QUERY_SUCCESS',
|
|
95
|
+
queryType: params.queryType,
|
|
96
|
+
query: params.query,
|
|
97
|
+
normalizedQuery: params.normalizedQuery,
|
|
98
|
+
success: true,
|
|
99
|
+
durationMs: params.durationMs,
|
|
100
|
+
cached: params.cached,
|
|
101
|
+
serverUrl: params.serverUrl,
|
|
102
|
+
responseSize: this.includeResponseSize ? params.responseSize : undefined,
|
|
103
|
+
sessionId: this.sessionId,
|
|
104
|
+
clientId: this.clientId,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
logQueryFailure(params) {
|
|
108
|
+
this.log({
|
|
109
|
+
eventType: 'QUERY_FAILURE',
|
|
110
|
+
queryType: params.queryType,
|
|
111
|
+
query: params.query,
|
|
112
|
+
success: false,
|
|
113
|
+
durationMs: params.durationMs,
|
|
114
|
+
cached: false,
|
|
115
|
+
errorCode: params.errorCode,
|
|
116
|
+
errorMessage: params.errorMessage,
|
|
117
|
+
sessionId: this.sessionId,
|
|
118
|
+
clientId: this.clientId,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
logCacheHit(params) {
|
|
122
|
+
this.log({
|
|
123
|
+
eventType: 'CACHE_HIT',
|
|
124
|
+
queryType: params.queryType,
|
|
125
|
+
query: params.query,
|
|
126
|
+
success: true,
|
|
127
|
+
durationMs: 0,
|
|
128
|
+
cached: true,
|
|
129
|
+
sessionId: this.sessionId,
|
|
130
|
+
clientId: this.clientId,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
logRateLimitExceeded(params) {
|
|
134
|
+
this.log({
|
|
135
|
+
eventType: 'RATE_LIMIT_EXCEEDED',
|
|
136
|
+
queryType: params.queryType,
|
|
137
|
+
query: params.query,
|
|
138
|
+
success: false,
|
|
139
|
+
durationMs: 0,
|
|
140
|
+
cached: false,
|
|
141
|
+
sessionId: this.sessionId,
|
|
142
|
+
clientId: this.clientId,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
logSSRFBlocked(params) {
|
|
146
|
+
this.log({
|
|
147
|
+
eventType: 'SSRF_BLOCKED',
|
|
148
|
+
queryType: 'domain',
|
|
149
|
+
query: params.url,
|
|
150
|
+
success: false,
|
|
151
|
+
durationMs: 0,
|
|
152
|
+
cached: false,
|
|
153
|
+
sessionId: this.sessionId,
|
|
154
|
+
clientId: this.clientId,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
logPIIRedacted(params) {
|
|
158
|
+
this.log({
|
|
159
|
+
eventType: 'PII_REDACTED',
|
|
160
|
+
queryType: params.queryType,
|
|
161
|
+
query: params.query,
|
|
162
|
+
success: true,
|
|
163
|
+
durationMs: 0,
|
|
164
|
+
cached: false,
|
|
165
|
+
tags: { fieldsRedacted: String(params.fieldsRedacted) },
|
|
166
|
+
sessionId: this.sessionId,
|
|
167
|
+
clientId: this.clientId,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
async flush() {
|
|
171
|
+
if (this.adapter.flush) {
|
|
172
|
+
await this.adapter.flush();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
isEnabled() {
|
|
176
|
+
return this.enabled;
|
|
177
|
+
}
|
|
178
|
+
getStats() {
|
|
179
|
+
return {
|
|
180
|
+
enabled: this.enabled,
|
|
181
|
+
eventsLogged: this.eventsLogged,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
generateId() {
|
|
185
|
+
return Date.now().toString(36) + Math.random().toString(36).slice(2, 9);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export class Logger {
|
|
2
|
+
constructor(options = {}) {
|
|
3
|
+
this.logs = [];
|
|
4
|
+
this.maxLogs = 1000;
|
|
5
|
+
this.levelPriority = {
|
|
6
|
+
debug: 0,
|
|
7
|
+
info: 1,
|
|
8
|
+
warn: 2,
|
|
9
|
+
error: 3,
|
|
10
|
+
};
|
|
11
|
+
this.level = options.level || 'info';
|
|
12
|
+
this.enabled = options.enabled ?? true;
|
|
13
|
+
this.logRequests = options.logRequests ?? true;
|
|
14
|
+
this.logResponses = options.logResponses ?? true;
|
|
15
|
+
this.format = options.format || 'text';
|
|
16
|
+
this.output = options.output || this.defaultOutput.bind(this);
|
|
17
|
+
}
|
|
18
|
+
debug(message, context) {
|
|
19
|
+
this.log('debug', message, context);
|
|
20
|
+
}
|
|
21
|
+
info(message, context) {
|
|
22
|
+
this.log('info', message, context);
|
|
23
|
+
}
|
|
24
|
+
warn(message, context) {
|
|
25
|
+
this.log('warn', message, context);
|
|
26
|
+
}
|
|
27
|
+
error(message, context) {
|
|
28
|
+
this.log('error', message, context);
|
|
29
|
+
}
|
|
30
|
+
logRequest(type, query, context) {
|
|
31
|
+
if (!this.logRequests)
|
|
32
|
+
return;
|
|
33
|
+
this.info(`REQUEST → ${type}: ${query}`, {
|
|
34
|
+
queryType: type,
|
|
35
|
+
queryValue: query,
|
|
36
|
+
...context,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
logResponse(type, query, success, duration, context) {
|
|
40
|
+
if (!this.logResponses)
|
|
41
|
+
return;
|
|
42
|
+
const status = success ? '✓' : '✗';
|
|
43
|
+
const message = `RESPONSE ${status} ${type}: ${query} (${duration}ms)`;
|
|
44
|
+
if (success) {
|
|
45
|
+
this.info(message, {
|
|
46
|
+
queryType: type,
|
|
47
|
+
queryValue: query,
|
|
48
|
+
success,
|
|
49
|
+
durationMs: duration,
|
|
50
|
+
...context,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.warn(message, {
|
|
55
|
+
queryType: type,
|
|
56
|
+
queryValue: query,
|
|
57
|
+
success,
|
|
58
|
+
durationMs: duration,
|
|
59
|
+
...context,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
logPerformance(operation, duration, context) {
|
|
64
|
+
this.debug(`PERFORMANCE: ${operation} took ${duration}ms`, {
|
|
65
|
+
operation,
|
|
66
|
+
durationMs: duration,
|
|
67
|
+
...context,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
logCache(operation, key, context) {
|
|
71
|
+
const emoji = operation === 'hit' ? '✓' : operation === 'miss' ? '✗' : '→';
|
|
72
|
+
this.debug(`CACHE ${emoji} ${operation}: ${key}`, {
|
|
73
|
+
operation,
|
|
74
|
+
cacheKey: key,
|
|
75
|
+
...context,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
log(level, message, context) {
|
|
79
|
+
if (!this.enabled)
|
|
80
|
+
return;
|
|
81
|
+
if (this.levelPriority[level] < this.levelPriority[this.level])
|
|
82
|
+
return;
|
|
83
|
+
const entry = {
|
|
84
|
+
level,
|
|
85
|
+
message,
|
|
86
|
+
timestamp: Date.now(),
|
|
87
|
+
context,
|
|
88
|
+
};
|
|
89
|
+
this.logs.push(entry);
|
|
90
|
+
if (this.logs.length > this.maxLogs) {
|
|
91
|
+
this.logs = this.logs.slice(-this.maxLogs);
|
|
92
|
+
}
|
|
93
|
+
this.output(entry);
|
|
94
|
+
}
|
|
95
|
+
defaultOutput(entry) {
|
|
96
|
+
if (this.format === 'json') {
|
|
97
|
+
console.log(JSON.stringify(entry));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const timestamp = new Date(entry.timestamp).toISOString();
|
|
101
|
+
const level = entry.level.toUpperCase().padEnd(5);
|
|
102
|
+
const contextStr = entry.context ? ` ${JSON.stringify(entry.context)}` : '';
|
|
103
|
+
const colors = {
|
|
104
|
+
debug: '\x1b[36m',
|
|
105
|
+
info: '\x1b[32m',
|
|
106
|
+
warn: '\x1b[33m',
|
|
107
|
+
error: '\x1b[31m',
|
|
108
|
+
};
|
|
109
|
+
const reset = '\x1b[0m';
|
|
110
|
+
const color = colors[entry.level];
|
|
111
|
+
console.log(`${color}[${timestamp}] ${level}${reset} ${entry.message}${contextStr}`);
|
|
112
|
+
}
|
|
113
|
+
getLogs(count) {
|
|
114
|
+
return count ? this.logs.slice(-count) : [...this.logs];
|
|
115
|
+
}
|
|
116
|
+
getLogsByLevel(level) {
|
|
117
|
+
return this.logs.filter((log) => log.level === level);
|
|
118
|
+
}
|
|
119
|
+
getLogsInRange(startTime, endTime) {
|
|
120
|
+
return this.logs.filter((log) => log.timestamp >= startTime && log.timestamp <= endTime);
|
|
121
|
+
}
|
|
122
|
+
clear() {
|
|
123
|
+
this.logs = [];
|
|
124
|
+
}
|
|
125
|
+
export() {
|
|
126
|
+
return [...this.logs];
|
|
127
|
+
}
|
|
128
|
+
getStats() {
|
|
129
|
+
const logsByLevel = {
|
|
130
|
+
debug: 0,
|
|
131
|
+
info: 0,
|
|
132
|
+
warn: 0,
|
|
133
|
+
error: 0,
|
|
134
|
+
};
|
|
135
|
+
this.logs.forEach((log) => {
|
|
136
|
+
logsByLevel[log.level]++;
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
enabled: this.enabled,
|
|
140
|
+
level: this.level,
|
|
141
|
+
totalLogs: this.logs.length,
|
|
142
|
+
logsByLevel,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export const RDAPIFY_GRAFANA_DASHBOARD = {
|
|
2
|
+
__inputs: [
|
|
3
|
+
{
|
|
4
|
+
name: 'DS_PROMETHEUS',
|
|
5
|
+
label: 'Prometheus',
|
|
6
|
+
description: '',
|
|
7
|
+
type: 'datasource',
|
|
8
|
+
pluginId: 'prometheus',
|
|
9
|
+
pluginName: 'Prometheus',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
__requires: [
|
|
13
|
+
{ type: 'grafana', id: 'grafana', name: 'Grafana', version: '9.0.0' },
|
|
14
|
+
{ type: 'datasource', id: 'prometheus', name: 'Prometheus', version: '1.0.0' },
|
|
15
|
+
{ type: 'panel', id: 'timeseries', name: 'Time series', version: '' },
|
|
16
|
+
{ type: 'panel', id: 'stat', name: 'Stat', version: '' },
|
|
17
|
+
{ type: 'panel', id: 'gauge', name: 'Gauge', version: '' },
|
|
18
|
+
],
|
|
19
|
+
annotations: { list: [{ builtIn: 1, datasource: { type: 'grafana', uid: '-- Grafana --' }, enable: true, hide: true, iconColor: 'rgba(0, 211, 255, 1)', name: 'Annotations & Alerts', type: 'dashboard' }] },
|
|
20
|
+
description: 'RDAPify RDAP client metrics — query rates, cache performance, and error tracking',
|
|
21
|
+
editable: true,
|
|
22
|
+
fiscalYearStartMonth: 0,
|
|
23
|
+
graphTooltip: 1,
|
|
24
|
+
id: null,
|
|
25
|
+
links: [],
|
|
26
|
+
liveNow: false,
|
|
27
|
+
panels: [
|
|
28
|
+
{
|
|
29
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
30
|
+
fieldConfig: { defaults: { color: { mode: 'thresholds' }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'green', value: null }] }, unit: 'short' }, overrides: [] },
|
|
31
|
+
gridPos: { h: 4, w: 4, x: 0, y: 0 },
|
|
32
|
+
id: 1,
|
|
33
|
+
options: { colorMode: 'background', graphMode: 'area', justifyMode: 'auto', orientation: 'auto', reduceOptions: { calcs: ['lastNotNull'], fields: '', values: false }, textMode: 'auto' },
|
|
34
|
+
title: 'Total Queries',
|
|
35
|
+
type: 'stat',
|
|
36
|
+
targets: [{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_queries_total', legendFormat: 'Queries', refId: 'A' }],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
40
|
+
fieldConfig: { defaults: { color: { mode: 'thresholds' }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'red', value: null }, { color: 'orange', value: 0.8 }, { color: 'green', value: 0.95 }] }, unit: 'percentunit', max: 1, min: 0 }, overrides: [] },
|
|
41
|
+
gridPos: { h: 4, w: 4, x: 4, y: 0 },
|
|
42
|
+
id: 2,
|
|
43
|
+
options: { colorMode: 'background', graphMode: 'none', justifyMode: 'auto', orientation: 'auto', reduceOptions: { calcs: ['lastNotNull'], fields: '', values: false }, textMode: 'auto' },
|
|
44
|
+
title: 'Success Rate',
|
|
45
|
+
type: 'stat',
|
|
46
|
+
targets: [{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_success_rate', legendFormat: 'Success Rate', refId: 'A' }],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
50
|
+
fieldConfig: { defaults: { color: { mode: 'thresholds' }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'red', value: null }, { color: 'orange', value: 0.3 }, { color: 'green', value: 0.7 }] }, unit: 'percentunit', max: 1, min: 0 }, overrides: [] },
|
|
51
|
+
gridPos: { h: 4, w: 4, x: 8, y: 0 },
|
|
52
|
+
id: 3,
|
|
53
|
+
options: { colorMode: 'background', graphMode: 'none', justifyMode: 'auto', orientation: 'auto', reduceOptions: { calcs: ['lastNotNull'], fields: '', values: false }, textMode: 'auto' },
|
|
54
|
+
title: 'Cache Hit Rate',
|
|
55
|
+
type: 'stat',
|
|
56
|
+
targets: [{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_cache_hit_rate', legendFormat: 'Cache Hit Rate', refId: 'A' }],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
60
|
+
fieldConfig: { defaults: { color: { mode: 'thresholds' }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'green', value: null }, { color: 'orange', value: 500 }, { color: 'red', value: 2000 }] }, unit: 'ms' }, overrides: [] },
|
|
61
|
+
gridPos: { h: 4, w: 4, x: 12, y: 0 },
|
|
62
|
+
id: 4,
|
|
63
|
+
options: { colorMode: 'value', graphMode: 'area', justifyMode: 'auto', orientation: 'auto', reduceOptions: { calcs: ['lastNotNull'], fields: '', values: false }, textMode: 'auto' },
|
|
64
|
+
title: 'Avg Response Time',
|
|
65
|
+
type: 'stat',
|
|
66
|
+
targets: [{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_response_time_avg_ms', legendFormat: 'Avg', refId: 'A' }],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
70
|
+
fieldConfig: { defaults: { color: { mode: 'palette-classic' }, custom: { axisCenteredZero: false, axisColorMode: 'text', axisLabel: '', axisPlacement: 'auto', barAlignment: 0, drawStyle: 'line', fillOpacity: 10, gradientMode: 'none', hideFrom: { legend: false, tooltip: false, viz: false }, lineInterpolation: 'linear', lineWidth: 1, pointSize: 5, scaleDistribution: { type: 'linear' }, showPoints: 'auto', spanNulls: false, stacking: { group: 'A', mode: 'none' }, thresholdsStyle: { mode: 'off' } }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'green', value: null }, { color: 'red', value: 80 }] }, unit: 'ms' }, overrides: [] },
|
|
71
|
+
gridPos: { h: 8, w: 12, x: 0, y: 4 },
|
|
72
|
+
id: 5,
|
|
73
|
+
options: { legend: { calcs: [], displayMode: 'list', placement: 'bottom', showLegend: true }, tooltip: { mode: 'single', sort: 'none' } },
|
|
74
|
+
title: 'Response Time Percentiles',
|
|
75
|
+
type: 'timeseries',
|
|
76
|
+
targets: [
|
|
77
|
+
{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_response_time_p50_ms', legendFormat: 'P50', refId: 'A' },
|
|
78
|
+
{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_response_time_p90_ms', legendFormat: 'P90', refId: 'B' },
|
|
79
|
+
{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_response_time_p99_ms', legendFormat: 'P99', refId: 'C' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
84
|
+
fieldConfig: { defaults: { color: { mode: 'palette-classic' }, custom: { axisCenteredZero: false, axisColorMode: 'text', axisLabel: '', axisPlacement: 'auto', barAlignment: 0, drawStyle: 'line', fillOpacity: 10, gradientMode: 'none', hideFrom: { legend: false, tooltip: false, viz: false }, lineInterpolation: 'linear', lineWidth: 1, pointSize: 5, scaleDistribution: { type: 'linear' }, showPoints: 'auto', spanNulls: false, stacking: { group: 'A', mode: 'none' }, thresholdsStyle: { mode: 'off' } }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'green', value: null }] }, unit: 'short' }, overrides: [] },
|
|
85
|
+
gridPos: { h: 8, w: 12, x: 12, y: 4 },
|
|
86
|
+
id: 6,
|
|
87
|
+
options: { legend: { calcs: [], displayMode: 'list', placement: 'bottom', showLegend: true }, tooltip: { mode: 'single', sort: 'none' } },
|
|
88
|
+
title: 'Queries by Type',
|
|
89
|
+
type: 'timeseries',
|
|
90
|
+
targets: [{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_queries_by_type_total', legendFormat: '{{type}}', refId: 'A' }],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' },
|
|
94
|
+
fieldConfig: { defaults: { color: { mode: 'palette-classic' }, custom: { axisCenteredZero: false, axisColorMode: 'text', axisLabel: '', axisPlacement: 'auto', barAlignment: 0, drawStyle: 'bars', fillOpacity: 80, gradientMode: 'none', hideFrom: { legend: false, tooltip: false, viz: false }, lineInterpolation: 'linear', lineWidth: 1, pointSize: 5, scaleDistribution: { type: 'linear' }, showPoints: 'auto', spanNulls: false, stacking: { group: 'A', mode: 'normal' }, thresholdsStyle: { mode: 'off' } }, mappings: [], thresholds: { mode: 'absolute', steps: [{ color: 'green', value: null }] }, unit: 'short' }, overrides: [] },
|
|
95
|
+
gridPos: { h: 8, w: 24, x: 0, y: 12 },
|
|
96
|
+
id: 7,
|
|
97
|
+
options: { legend: { calcs: [], displayMode: 'list', placement: 'bottom', showLegend: true }, tooltip: { mode: 'single', sort: 'none' } },
|
|
98
|
+
title: 'Errors by Type',
|
|
99
|
+
type: 'timeseries',
|
|
100
|
+
targets: [{ datasource: { type: 'prometheus', uid: '${DS_PROMETHEUS}' }, expr: 'rdapify_errors_by_type_total', legendFormat: '{{error_type}}', refId: 'A' }],
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
refresh: '30s',
|
|
104
|
+
schemaVersion: 38,
|
|
105
|
+
style: 'dark',
|
|
106
|
+
tags: ['rdapify', 'rdap'],
|
|
107
|
+
templating: { list: [] },
|
|
108
|
+
time: { from: 'now-1h', to: 'now' },
|
|
109
|
+
timepicker: {},
|
|
110
|
+
timezone: '',
|
|
111
|
+
title: 'RDAPify',
|
|
112
|
+
uid: 'rdapify-dashboard',
|
|
113
|
+
version: 1,
|
|
114
|
+
weekStart: '',
|
|
115
|
+
};
|