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.
Files changed (500) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.ar.md +572 -0
  3. package/README.md +74 -77
  4. package/dist/{application → cjs/application}/client/RDAPClient.js +197 -6
  5. package/dist/{application → cjs/application}/client/index.js +0 -1
  6. package/dist/{application → cjs/application}/deduplication/QueryDeduplicator.js +0 -1
  7. package/dist/{application → cjs/application}/hooks/MiddlewareHooks.js +0 -1
  8. package/dist/{application → cjs/application}/services/BatchProcessor.js +0 -1
  9. package/dist/{application → cjs/application}/services/QueryOrchestrator.js +0 -1
  10. package/dist/{application → cjs/application}/services/QueryPriority.js +0 -1
  11. package/dist/{application → cjs/application}/services/index.js +0 -1
  12. package/dist/{cli → cjs/cli}/index.js +0 -1
  13. package/dist/cjs/core/ports/bootstrap.port.js +2 -0
  14. package/dist/cjs/core/ports/cache.port.js +2 -0
  15. package/dist/cjs/core/ports/fetcher.port.js +2 -0
  16. package/dist/{core → cjs/core}/ports/index.js +0 -1
  17. package/dist/cjs/core/ports/normalizer.port.js +2 -0
  18. package/dist/cjs/core/ports/pii-redactor.port.js +2 -0
  19. package/dist/{index.js → cjs/index.js} +8 -4
  20. package/dist/{infrastructure → cjs/infrastructure}/cache/CacheManager.js +4 -1
  21. package/dist/{infrastructure → cjs/infrastructure}/cache/InMemoryCache.js +0 -1
  22. package/dist/{infrastructure → cjs/infrastructure}/cache/PersistentCache.js +0 -1
  23. package/dist/{infrastructure → cjs/infrastructure}/cache/RedisCache.js +0 -1
  24. package/dist/cjs/infrastructure/cache/StaleWhileRevalidateCache.js +47 -0
  25. package/dist/{infrastructure → cjs/infrastructure}/cache/index.js +0 -1
  26. package/dist/{infrastructure → cjs/infrastructure}/http/AuthenticationManager.js +0 -1
  27. package/dist/{infrastructure → cjs/infrastructure}/http/BootstrapDiscovery.js +0 -1
  28. package/dist/{infrastructure → cjs/infrastructure}/http/BrowserFetcher.js +0 -1
  29. package/dist/{infrastructure → cjs/infrastructure}/http/BunFetcher.js +0 -1
  30. package/dist/{infrastructure → cjs/infrastructure}/http/CircuitBreaker.js +0 -1
  31. package/dist/{infrastructure → cjs/infrastructure}/http/CloudflareWorkersFetcher.js +0 -1
  32. package/dist/{infrastructure → cjs/infrastructure}/http/CompressionManager.js +0 -1
  33. package/dist/{infrastructure → cjs/infrastructure}/http/ConnectionPool.js +0 -1
  34. package/dist/{infrastructure → cjs/infrastructure}/http/DenoFetcher.js +0 -1
  35. package/dist/cjs/infrastructure/http/DistributedRateLimiter.js +26 -0
  36. package/dist/{infrastructure → cjs/infrastructure}/http/Fetcher.js +5 -1
  37. package/dist/{infrastructure → cjs/infrastructure}/http/Normalizer.js +23 -1
  38. package/dist/{infrastructure → cjs/infrastructure}/http/ProxyManager.js +0 -1
  39. package/dist/{infrastructure → cjs/infrastructure}/http/RateLimiter.js +6 -1
  40. package/dist/{infrastructure → cjs/infrastructure}/http/RetryStrategy.js +0 -1
  41. package/dist/{infrastructure → cjs/infrastructure}/http/index.js +0 -1
  42. package/dist/{infrastructure → cjs/infrastructure}/logging/AuditLogger.js +0 -1
  43. package/dist/{infrastructure → cjs/infrastructure}/logging/Logger.js +0 -1
  44. package/dist/{infrastructure → cjs/infrastructure}/monitoring/GrafanaDashboard.js +0 -1
  45. package/dist/{infrastructure → cjs/infrastructure}/monitoring/MetricsCollector.js +0 -1
  46. package/dist/{infrastructure → cjs/infrastructure}/monitoring/PrometheusExporter.js +0 -1
  47. package/dist/{infrastructure → cjs/infrastructure}/monitoring/TelemetryExporter.js +15 -2
  48. package/dist/{infrastructure → cjs/infrastructure}/native/NativeBackend.js +0 -1
  49. package/dist/{infrastructure → cjs/infrastructure}/security/PIIRedactor.js +0 -1
  50. package/dist/{infrastructure → cjs/infrastructure}/security/SSRFProtection.js +23 -1
  51. package/dist/{infrastructure → cjs/infrastructure}/security/index.js +0 -1
  52. package/dist/cjs/infrastructure/telemetry/UsageTelemetry.js +89 -0
  53. package/dist/{infrastructure → cjs/infrastructure}/validation/ResponseValidator.js +0 -1
  54. package/dist/{integrations → cjs/integrations}/express.js +0 -1
  55. package/dist/{integrations → cjs/integrations}/graphql.js +0 -1
  56. package/dist/{integrations → cjs/integrations}/nestjs.js +0 -1
  57. package/dist/{shared → cjs/shared}/constants/http.constants.js +0 -1
  58. package/dist/{shared → cjs/shared}/constants/index.js +0 -1
  59. package/dist/{shared → cjs/shared}/constants/rdap.constants.js +0 -1
  60. package/dist/{shared → cjs/shared}/errors/base.error.js +7 -2
  61. package/dist/{shared → cjs/shared}/errors/index.js +0 -1
  62. package/dist/{shared → cjs/shared}/types/entities.js +0 -1
  63. package/dist/{shared → cjs/shared}/types/enums.js +0 -1
  64. package/dist/{shared → cjs/shared}/types/errors.js +0 -1
  65. package/dist/{shared → cjs/shared}/types/generics.js +0 -1
  66. package/dist/{shared → cjs/shared}/types/index.js +0 -1
  67. package/dist/{shared → cjs/shared}/types/options.js +5 -1
  68. package/dist/cjs/shared/types/responses.js +2 -0
  69. package/dist/{shared → cjs/shared}/utils/deprecation.js +0 -1
  70. package/dist/{shared → cjs/shared}/utils/enhanced-validators.js +0 -1
  71. package/dist/{shared → cjs/shared}/utils/helpers/async.js +0 -1
  72. package/dist/{shared → cjs/shared}/utils/helpers/cache.js +0 -1
  73. package/dist/{shared → cjs/shared}/utils/helpers/format.js +0 -1
  74. package/dist/{shared → cjs/shared}/utils/helpers/http.js +0 -1
  75. package/dist/{shared → cjs/shared}/utils/helpers/index.js +0 -1
  76. package/dist/{shared → cjs/shared}/utils/helpers/object.js +0 -1
  77. package/dist/{shared → cjs/shared}/utils/helpers/runtime.js +0 -1
  78. package/dist/{shared → cjs/shared}/utils/helpers/string.js +0 -1
  79. package/dist/{shared → cjs/shared}/utils/validators/asn.js +0 -1
  80. package/dist/{shared → cjs/shared}/utils/validators/config-validation.js +0 -1
  81. package/dist/{shared → cjs/shared}/utils/validators/domain.js +0 -1
  82. package/dist/{shared → cjs/shared}/utils/validators/entity.js +0 -1
  83. package/dist/{shared → cjs/shared}/utils/validators/index.js +0 -1
  84. package/dist/{shared → cjs/shared}/utils/validators/ip.js +0 -1
  85. package/dist/{shared → cjs/shared}/utils/validators/nameserver.js +0 -1
  86. package/dist/{shared → cjs/shared}/utils/validators/network.js +0 -1
  87. package/dist/esm/application/client/RDAPClient.js +439 -0
  88. package/dist/esm/application/client/index.js +1 -0
  89. package/dist/esm/application/deduplication/QueryDeduplicator.js +41 -0
  90. package/dist/esm/application/hooks/MiddlewareHooks.js +79 -0
  91. package/dist/esm/application/services/BatchProcessor.js +145 -0
  92. package/dist/esm/application/services/QueryOrchestrator.js +615 -0
  93. package/dist/esm/application/services/QueryPriority.js +109 -0
  94. package/dist/esm/application/services/index.js +2 -0
  95. package/dist/esm/cli/index.js +297 -0
  96. package/dist/esm/core/ports/bootstrap.port.js +1 -0
  97. package/dist/esm/core/ports/cache.port.js +1 -0
  98. package/dist/esm/core/ports/fetcher.port.js +1 -0
  99. package/dist/esm/core/ports/index.js +5 -0
  100. package/dist/esm/core/ports/normalizer.port.js +1 -0
  101. package/dist/esm/core/ports/pii-redactor.port.js +1 -0
  102. package/dist/esm/index.js +40 -0
  103. package/dist/esm/infrastructure/cache/CacheManager.js +123 -0
  104. package/dist/esm/infrastructure/cache/InMemoryCache.js +91 -0
  105. package/dist/esm/infrastructure/cache/PersistentCache.js +188 -0
  106. package/dist/esm/infrastructure/cache/RedisCache.js +106 -0
  107. package/dist/esm/infrastructure/cache/StaleWhileRevalidateCache.js +43 -0
  108. package/dist/esm/infrastructure/cache/index.js +3 -0
  109. package/dist/esm/infrastructure/http/AuthenticationManager.js +94 -0
  110. package/dist/esm/infrastructure/http/BootstrapDiscovery.js +189 -0
  111. package/dist/esm/infrastructure/http/BrowserFetcher.js +42 -0
  112. package/dist/esm/infrastructure/http/BunFetcher.js +46 -0
  113. package/dist/esm/infrastructure/http/CircuitBreaker.js +98 -0
  114. package/dist/esm/infrastructure/http/CloudflareWorkersFetcher.js +39 -0
  115. package/dist/esm/infrastructure/http/CompressionManager.js +80 -0
  116. package/dist/esm/infrastructure/http/ConnectionPool.js +101 -0
  117. package/dist/esm/infrastructure/http/DenoFetcher.js +38 -0
  118. package/dist/esm/infrastructure/http/DistributedRateLimiter.js +22 -0
  119. package/dist/esm/infrastructure/http/Fetcher.js +127 -0
  120. package/dist/esm/infrastructure/http/Normalizer.js +233 -0
  121. package/dist/esm/infrastructure/http/ProxyManager.js +82 -0
  122. package/dist/esm/infrastructure/http/RateLimiter.js +102 -0
  123. package/dist/esm/infrastructure/http/RetryStrategy.js +131 -0
  124. package/dist/esm/infrastructure/http/index.js +3 -0
  125. package/dist/esm/infrastructure/logging/AuditLogger.js +187 -0
  126. package/dist/esm/infrastructure/logging/Logger.js +145 -0
  127. package/dist/esm/infrastructure/monitoring/GrafanaDashboard.js +115 -0
  128. package/dist/esm/infrastructure/monitoring/MetricsCollector.js +284 -0
  129. package/dist/esm/infrastructure/monitoring/PrometheusExporter.js +72 -0
  130. package/dist/esm/infrastructure/monitoring/TelemetryExporter.js +126 -0
  131. package/dist/esm/infrastructure/native/NativeBackend.js +86 -0
  132. package/dist/esm/infrastructure/security/PIIRedactor.js +85 -0
  133. package/dist/esm/infrastructure/security/SSRFProtection.js +162 -0
  134. package/dist/esm/infrastructure/security/index.js +2 -0
  135. package/dist/esm/infrastructure/telemetry/UsageTelemetry.js +84 -0
  136. package/dist/esm/infrastructure/validation/ResponseValidator.js +194 -0
  137. package/dist/esm/integrations/express.js +43 -0
  138. package/dist/esm/integrations/graphql.js +80 -0
  139. package/dist/esm/integrations/nestjs.js +23 -0
  140. package/dist/esm/shared/constants/http.constants.js +25 -0
  141. package/dist/esm/shared/constants/index.js +2 -0
  142. package/dist/esm/shared/constants/rdap.constants.js +17 -0
  143. package/dist/esm/shared/errors/base.error.js +140 -0
  144. package/dist/esm/shared/errors/index.js +1 -0
  145. package/dist/esm/shared/types/entities.js +1 -0
  146. package/dist/esm/shared/types/enums.js +1 -0
  147. package/dist/esm/shared/types/errors.js +82 -0
  148. package/dist/esm/shared/types/generics.js +1 -0
  149. package/dist/esm/shared/types/index.js +1 -0
  150. package/dist/esm/shared/types/options.js +66 -0
  151. package/dist/esm/shared/types/responses.js +1 -0
  152. package/dist/esm/shared/utils/deprecation.js +20 -0
  153. package/dist/esm/shared/utils/enhanced-validators.js +148 -0
  154. package/dist/esm/shared/utils/helpers/async.js +40 -0
  155. package/dist/esm/shared/utils/helpers/cache.js +3 -0
  156. package/dist/esm/shared/utils/helpers/format.js +17 -0
  157. package/dist/esm/shared/utils/helpers/http.js +13 -0
  158. package/dist/esm/shared/utils/helpers/index.js +7 -0
  159. package/dist/esm/shared/utils/helpers/object.js +19 -0
  160. package/dist/esm/shared/utils/helpers/runtime.js +34 -0
  161. package/dist/esm/shared/utils/helpers/string.js +23 -0
  162. package/dist/esm/shared/utils/validators/asn.js +25 -0
  163. package/dist/esm/shared/utils/validators/config-validation.js +93 -0
  164. package/dist/esm/shared/utils/validators/domain.js +29 -0
  165. package/dist/esm/shared/utils/validators/entity.js +22 -0
  166. package/dist/esm/shared/utils/validators/index.js +7 -0
  167. package/dist/esm/shared/utils/validators/ip.js +48 -0
  168. package/dist/esm/shared/utils/validators/nameserver.js +44 -0
  169. package/dist/esm/shared/utils/validators/network.js +42 -0
  170. package/dist/{application → types/application}/client/RDAPClient.d.ts +10 -1
  171. package/dist/types/application/client/RDAPClient.d.ts.map +1 -0
  172. package/dist/types/application/client/index.d.ts.map +1 -0
  173. package/dist/types/application/deduplication/QueryDeduplicator.d.ts.map +1 -0
  174. package/dist/types/application/hooks/MiddlewareHooks.d.ts.map +1 -0
  175. package/dist/types/application/services/BatchProcessor.d.ts.map +1 -0
  176. package/dist/types/application/services/QueryOrchestrator.d.ts.map +1 -0
  177. package/dist/types/application/services/QueryPriority.d.ts.map +1 -0
  178. package/dist/types/application/services/index.d.ts.map +1 -0
  179. package/dist/{cli → types/cli}/index.d.ts.map +1 -1
  180. package/dist/types/core/ports/bootstrap.port.d.ts.map +1 -0
  181. package/dist/types/core/ports/cache.port.d.ts.map +1 -0
  182. package/dist/types/core/ports/fetcher.port.d.ts.map +1 -0
  183. package/dist/types/core/ports/index.d.ts.map +1 -0
  184. package/dist/types/core/ports/normalizer.port.d.ts.map +1 -0
  185. package/dist/types/core/ports/pii-redactor.port.d.ts.map +1 -0
  186. package/dist/{index.d.ts → types/index.d.ts} +6 -3
  187. package/dist/types/index.d.ts.map +1 -0
  188. package/dist/types/infrastructure/cache/CacheManager.d.ts.map +1 -0
  189. package/dist/types/infrastructure/cache/InMemoryCache.d.ts.map +1 -0
  190. package/dist/types/infrastructure/cache/PersistentCache.d.ts.map +1 -0
  191. package/dist/types/infrastructure/cache/RedisCache.d.ts.map +1 -0
  192. package/dist/types/infrastructure/cache/StaleWhileRevalidateCache.d.ts +16 -0
  193. package/dist/types/infrastructure/cache/StaleWhileRevalidateCache.d.ts.map +1 -0
  194. package/dist/types/infrastructure/cache/index.d.ts.map +1 -0
  195. package/dist/types/infrastructure/http/AuthenticationManager.d.ts.map +1 -0
  196. package/dist/types/infrastructure/http/BootstrapDiscovery.d.ts.map +1 -0
  197. package/dist/types/infrastructure/http/BrowserFetcher.d.ts.map +1 -0
  198. package/dist/types/infrastructure/http/BunFetcher.d.ts.map +1 -0
  199. package/dist/types/infrastructure/http/CircuitBreaker.d.ts.map +1 -0
  200. package/dist/types/infrastructure/http/CloudflareWorkersFetcher.d.ts.map +1 -0
  201. package/dist/types/infrastructure/http/CompressionManager.d.ts.map +1 -0
  202. package/dist/types/infrastructure/http/ConnectionPool.d.ts.map +1 -0
  203. package/dist/types/infrastructure/http/DenoFetcher.d.ts.map +1 -0
  204. package/dist/types/infrastructure/http/DistributedRateLimiter.d.ts +12 -0
  205. package/dist/types/infrastructure/http/DistributedRateLimiter.d.ts.map +1 -0
  206. package/dist/{infrastructure → types/infrastructure}/http/Fetcher.d.ts +2 -0
  207. package/dist/types/infrastructure/http/Fetcher.d.ts.map +1 -0
  208. package/dist/types/infrastructure/http/Normalizer.d.ts.map +1 -0
  209. package/dist/types/infrastructure/http/ProxyManager.d.ts.map +1 -0
  210. package/dist/{infrastructure → types/infrastructure}/http/RateLimiter.d.ts +5 -0
  211. package/dist/types/infrastructure/http/RateLimiter.d.ts.map +1 -0
  212. package/dist/types/infrastructure/http/RetryStrategy.d.ts.map +1 -0
  213. package/dist/types/infrastructure/http/index.d.ts.map +1 -0
  214. package/dist/types/infrastructure/logging/AuditLogger.d.ts.map +1 -0
  215. package/dist/types/infrastructure/logging/Logger.d.ts.map +1 -0
  216. package/dist/{infrastructure → types/infrastructure}/monitoring/GrafanaDashboard.d.ts.map +1 -1
  217. package/dist/types/infrastructure/monitoring/MetricsCollector.d.ts.map +1 -0
  218. package/dist/types/infrastructure/monitoring/PrometheusExporter.d.ts.map +1 -0
  219. package/dist/types/infrastructure/monitoring/TelemetryExporter.d.ts.map +1 -0
  220. package/dist/types/infrastructure/native/NativeBackend.d.ts.map +1 -0
  221. package/dist/types/infrastructure/security/PIIRedactor.d.ts.map +1 -0
  222. package/dist/{infrastructure → types/infrastructure}/security/SSRFProtection.d.ts +1 -0
  223. package/dist/types/infrastructure/security/SSRFProtection.d.ts.map +1 -0
  224. package/dist/types/infrastructure/security/index.d.ts.map +1 -0
  225. package/dist/types/infrastructure/telemetry/UsageTelemetry.d.ts +13 -0
  226. package/dist/types/infrastructure/telemetry/UsageTelemetry.d.ts.map +1 -0
  227. package/dist/types/infrastructure/validation/ResponseValidator.d.ts.map +1 -0
  228. package/dist/types/integrations/express.d.ts.map +1 -0
  229. package/dist/types/integrations/graphql.d.ts.map +1 -0
  230. package/dist/types/integrations/nestjs.d.ts.map +1 -0
  231. package/dist/types/shared/constants/http.constants.d.ts.map +1 -0
  232. package/dist/types/shared/constants/index.d.ts.map +1 -0
  233. package/dist/types/shared/constants/rdap.constants.d.ts.map +1 -0
  234. package/dist/{shared → types/shared}/errors/base.error.d.ts +3 -0
  235. package/dist/types/shared/errors/base.error.d.ts.map +1 -0
  236. package/dist/types/shared/errors/index.d.ts.map +1 -0
  237. package/dist/types/shared/types/entities.d.ts.map +1 -0
  238. package/dist/{shared → types/shared}/types/enums.d.ts +1 -1
  239. package/dist/types/shared/types/enums.d.ts.map +1 -0
  240. package/dist/types/shared/types/errors.d.ts.map +1 -0
  241. package/dist/types/shared/types/generics.d.ts.map +1 -0
  242. package/dist/{shared → types/shared}/types/index.d.ts +1 -1
  243. package/dist/types/shared/types/index.d.ts.map +1 -0
  244. package/dist/{shared → types/shared}/types/options.d.ts +9 -0
  245. package/dist/types/shared/types/options.d.ts.map +1 -0
  246. package/dist/{shared → types/shared}/types/responses.d.ts +20 -0
  247. package/dist/types/shared/types/responses.d.ts.map +1 -0
  248. package/dist/types/shared/utils/deprecation.d.ts.map +1 -0
  249. package/dist/types/shared/utils/enhanced-validators.d.ts.map +1 -0
  250. package/dist/types/shared/utils/helpers/async.d.ts.map +1 -0
  251. package/dist/types/shared/utils/helpers/cache.d.ts.map +1 -0
  252. package/dist/types/shared/utils/helpers/format.d.ts.map +1 -0
  253. package/dist/types/shared/utils/helpers/http.d.ts.map +1 -0
  254. package/dist/types/shared/utils/helpers/index.d.ts.map +1 -0
  255. package/dist/types/shared/utils/helpers/object.d.ts.map +1 -0
  256. package/dist/types/shared/utils/helpers/runtime.d.ts.map +1 -0
  257. package/dist/types/shared/utils/helpers/string.d.ts.map +1 -0
  258. package/dist/types/shared/utils/validators/asn.d.ts.map +1 -0
  259. package/dist/types/shared/utils/validators/config-validation.d.ts.map +1 -0
  260. package/dist/types/shared/utils/validators/domain.d.ts.map +1 -0
  261. package/dist/types/shared/utils/validators/entity.d.ts.map +1 -0
  262. package/dist/types/shared/utils/validators/index.d.ts.map +1 -0
  263. package/dist/types/shared/utils/validators/ip.d.ts.map +1 -0
  264. package/dist/types/shared/utils/validators/nameserver.d.ts.map +1 -0
  265. package/dist/types/shared/utils/validators/network.d.ts.map +1 -0
  266. package/package.json +30 -26
  267. package/dist/application/client/RDAPClient.d.ts.map +0 -1
  268. package/dist/application/client/RDAPClient.js.map +0 -1
  269. package/dist/application/client/index.d.ts.map +0 -1
  270. package/dist/application/client/index.js.map +0 -1
  271. package/dist/application/deduplication/QueryDeduplicator.d.ts.map +0 -1
  272. package/dist/application/deduplication/QueryDeduplicator.js.map +0 -1
  273. package/dist/application/hooks/MiddlewareHooks.d.ts.map +0 -1
  274. package/dist/application/hooks/MiddlewareHooks.js.map +0 -1
  275. package/dist/application/services/BatchProcessor.d.ts.map +0 -1
  276. package/dist/application/services/BatchProcessor.js.map +0 -1
  277. package/dist/application/services/QueryOrchestrator.d.ts.map +0 -1
  278. package/dist/application/services/QueryOrchestrator.js.map +0 -1
  279. package/dist/application/services/QueryPriority.d.ts.map +0 -1
  280. package/dist/application/services/QueryPriority.js.map +0 -1
  281. package/dist/application/services/index.d.ts.map +0 -1
  282. package/dist/application/services/index.js.map +0 -1
  283. package/dist/cli/index.js.map +0 -1
  284. package/dist/core/ports/bootstrap.port.d.ts.map +0 -1
  285. package/dist/core/ports/bootstrap.port.js +0 -3
  286. package/dist/core/ports/bootstrap.port.js.map +0 -1
  287. package/dist/core/ports/cache.port.d.ts.map +0 -1
  288. package/dist/core/ports/cache.port.js +0 -3
  289. package/dist/core/ports/cache.port.js.map +0 -1
  290. package/dist/core/ports/fetcher.port.d.ts.map +0 -1
  291. package/dist/core/ports/fetcher.port.js +0 -3
  292. package/dist/core/ports/fetcher.port.js.map +0 -1
  293. package/dist/core/ports/index.d.ts.map +0 -1
  294. package/dist/core/ports/index.js.map +0 -1
  295. package/dist/core/ports/normalizer.port.d.ts.map +0 -1
  296. package/dist/core/ports/normalizer.port.js +0 -3
  297. package/dist/core/ports/normalizer.port.js.map +0 -1
  298. package/dist/core/ports/pii-redactor.port.d.ts.map +0 -1
  299. package/dist/core/ports/pii-redactor.port.js +0 -3
  300. package/dist/core/ports/pii-redactor.port.js.map +0 -1
  301. package/dist/index.d.ts.map +0 -1
  302. package/dist/index.js.map +0 -1
  303. package/dist/infrastructure/cache/CacheManager.d.ts.map +0 -1
  304. package/dist/infrastructure/cache/CacheManager.js.map +0 -1
  305. package/dist/infrastructure/cache/InMemoryCache.d.ts.map +0 -1
  306. package/dist/infrastructure/cache/InMemoryCache.js.map +0 -1
  307. package/dist/infrastructure/cache/PersistentCache.d.ts.map +0 -1
  308. package/dist/infrastructure/cache/PersistentCache.js.map +0 -1
  309. package/dist/infrastructure/cache/RedisCache.d.ts.map +0 -1
  310. package/dist/infrastructure/cache/RedisCache.js.map +0 -1
  311. package/dist/infrastructure/cache/index.d.ts.map +0 -1
  312. package/dist/infrastructure/cache/index.js.map +0 -1
  313. package/dist/infrastructure/http/AuthenticationManager.d.ts.map +0 -1
  314. package/dist/infrastructure/http/AuthenticationManager.js.map +0 -1
  315. package/dist/infrastructure/http/BootstrapDiscovery.d.ts.map +0 -1
  316. package/dist/infrastructure/http/BootstrapDiscovery.js.map +0 -1
  317. package/dist/infrastructure/http/BrowserFetcher.d.ts.map +0 -1
  318. package/dist/infrastructure/http/BrowserFetcher.js.map +0 -1
  319. package/dist/infrastructure/http/BunFetcher.d.ts.map +0 -1
  320. package/dist/infrastructure/http/BunFetcher.js.map +0 -1
  321. package/dist/infrastructure/http/CircuitBreaker.d.ts.map +0 -1
  322. package/dist/infrastructure/http/CircuitBreaker.js.map +0 -1
  323. package/dist/infrastructure/http/CloudflareWorkersFetcher.d.ts.map +0 -1
  324. package/dist/infrastructure/http/CloudflareWorkersFetcher.js.map +0 -1
  325. package/dist/infrastructure/http/CompressionManager.d.ts.map +0 -1
  326. package/dist/infrastructure/http/CompressionManager.js.map +0 -1
  327. package/dist/infrastructure/http/ConnectionPool.d.ts.map +0 -1
  328. package/dist/infrastructure/http/ConnectionPool.js.map +0 -1
  329. package/dist/infrastructure/http/DenoFetcher.d.ts.map +0 -1
  330. package/dist/infrastructure/http/DenoFetcher.js.map +0 -1
  331. package/dist/infrastructure/http/Fetcher.d.ts.map +0 -1
  332. package/dist/infrastructure/http/Fetcher.js.map +0 -1
  333. package/dist/infrastructure/http/Normalizer.d.ts.map +0 -1
  334. package/dist/infrastructure/http/Normalizer.js.map +0 -1
  335. package/dist/infrastructure/http/ProxyManager.d.ts.map +0 -1
  336. package/dist/infrastructure/http/ProxyManager.js.map +0 -1
  337. package/dist/infrastructure/http/RateLimiter.d.ts.map +0 -1
  338. package/dist/infrastructure/http/RateLimiter.js.map +0 -1
  339. package/dist/infrastructure/http/RetryStrategy.d.ts.map +0 -1
  340. package/dist/infrastructure/http/RetryStrategy.js.map +0 -1
  341. package/dist/infrastructure/http/index.d.ts.map +0 -1
  342. package/dist/infrastructure/http/index.js.map +0 -1
  343. package/dist/infrastructure/logging/AuditLogger.d.ts.map +0 -1
  344. package/dist/infrastructure/logging/AuditLogger.js.map +0 -1
  345. package/dist/infrastructure/logging/Logger.d.ts.map +0 -1
  346. package/dist/infrastructure/logging/Logger.js.map +0 -1
  347. package/dist/infrastructure/monitoring/GrafanaDashboard.js.map +0 -1
  348. package/dist/infrastructure/monitoring/MetricsCollector.d.ts.map +0 -1
  349. package/dist/infrastructure/monitoring/MetricsCollector.js.map +0 -1
  350. package/dist/infrastructure/monitoring/PrometheusExporter.d.ts.map +0 -1
  351. package/dist/infrastructure/monitoring/PrometheusExporter.js.map +0 -1
  352. package/dist/infrastructure/monitoring/TelemetryExporter.d.ts.map +0 -1
  353. package/dist/infrastructure/monitoring/TelemetryExporter.js.map +0 -1
  354. package/dist/infrastructure/native/NativeBackend.d.ts.map +0 -1
  355. package/dist/infrastructure/native/NativeBackend.js.map +0 -1
  356. package/dist/infrastructure/security/PIIRedactor.d.ts.map +0 -1
  357. package/dist/infrastructure/security/PIIRedactor.js.map +0 -1
  358. package/dist/infrastructure/security/SSRFProtection.d.ts.map +0 -1
  359. package/dist/infrastructure/security/SSRFProtection.js.map +0 -1
  360. package/dist/infrastructure/security/index.d.ts.map +0 -1
  361. package/dist/infrastructure/security/index.js.map +0 -1
  362. package/dist/infrastructure/validation/ResponseValidator.d.ts.map +0 -1
  363. package/dist/infrastructure/validation/ResponseValidator.js.map +0 -1
  364. package/dist/integrations/express.d.ts.map +0 -1
  365. package/dist/integrations/express.js.map +0 -1
  366. package/dist/integrations/graphql.d.ts.map +0 -1
  367. package/dist/integrations/graphql.js.map +0 -1
  368. package/dist/integrations/nestjs.d.ts.map +0 -1
  369. package/dist/integrations/nestjs.js.map +0 -1
  370. package/dist/shared/constants/http.constants.d.ts.map +0 -1
  371. package/dist/shared/constants/http.constants.js.map +0 -1
  372. package/dist/shared/constants/index.d.ts.map +0 -1
  373. package/dist/shared/constants/index.js.map +0 -1
  374. package/dist/shared/constants/rdap.constants.d.ts.map +0 -1
  375. package/dist/shared/constants/rdap.constants.js.map +0 -1
  376. package/dist/shared/errors/base.error.d.ts.map +0 -1
  377. package/dist/shared/errors/base.error.js.map +0 -1
  378. package/dist/shared/errors/index.d.ts.map +0 -1
  379. package/dist/shared/errors/index.js.map +0 -1
  380. package/dist/shared/types/entities.d.ts.map +0 -1
  381. package/dist/shared/types/entities.js.map +0 -1
  382. package/dist/shared/types/enums.d.ts.map +0 -1
  383. package/dist/shared/types/enums.js.map +0 -1
  384. package/dist/shared/types/errors.d.ts.map +0 -1
  385. package/dist/shared/types/errors.js.map +0 -1
  386. package/dist/shared/types/generics.d.ts.map +0 -1
  387. package/dist/shared/types/generics.js.map +0 -1
  388. package/dist/shared/types/index.d.ts.map +0 -1
  389. package/dist/shared/types/index.js.map +0 -1
  390. package/dist/shared/types/options.d.ts.map +0 -1
  391. package/dist/shared/types/options.js.map +0 -1
  392. package/dist/shared/types/responses.d.ts.map +0 -1
  393. package/dist/shared/types/responses.js +0 -3
  394. package/dist/shared/types/responses.js.map +0 -1
  395. package/dist/shared/utils/deprecation.d.ts.map +0 -1
  396. package/dist/shared/utils/deprecation.js.map +0 -1
  397. package/dist/shared/utils/enhanced-validators.d.ts.map +0 -1
  398. package/dist/shared/utils/enhanced-validators.js.map +0 -1
  399. package/dist/shared/utils/helpers/async.d.ts.map +0 -1
  400. package/dist/shared/utils/helpers/async.js.map +0 -1
  401. package/dist/shared/utils/helpers/cache.d.ts.map +0 -1
  402. package/dist/shared/utils/helpers/cache.js.map +0 -1
  403. package/dist/shared/utils/helpers/format.d.ts.map +0 -1
  404. package/dist/shared/utils/helpers/format.js.map +0 -1
  405. package/dist/shared/utils/helpers/http.d.ts.map +0 -1
  406. package/dist/shared/utils/helpers/http.js.map +0 -1
  407. package/dist/shared/utils/helpers/index.d.ts.map +0 -1
  408. package/dist/shared/utils/helpers/index.js.map +0 -1
  409. package/dist/shared/utils/helpers/object.d.ts.map +0 -1
  410. package/dist/shared/utils/helpers/object.js.map +0 -1
  411. package/dist/shared/utils/helpers/runtime.d.ts.map +0 -1
  412. package/dist/shared/utils/helpers/runtime.js.map +0 -1
  413. package/dist/shared/utils/helpers/string.d.ts.map +0 -1
  414. package/dist/shared/utils/helpers/string.js.map +0 -1
  415. package/dist/shared/utils/validators/asn.d.ts.map +0 -1
  416. package/dist/shared/utils/validators/asn.js.map +0 -1
  417. package/dist/shared/utils/validators/config-validation.d.ts.map +0 -1
  418. package/dist/shared/utils/validators/config-validation.js.map +0 -1
  419. package/dist/shared/utils/validators/domain.d.ts.map +0 -1
  420. package/dist/shared/utils/validators/domain.js.map +0 -1
  421. package/dist/shared/utils/validators/entity.d.ts.map +0 -1
  422. package/dist/shared/utils/validators/entity.js.map +0 -1
  423. package/dist/shared/utils/validators/index.d.ts.map +0 -1
  424. package/dist/shared/utils/validators/index.js.map +0 -1
  425. package/dist/shared/utils/validators/ip.d.ts.map +0 -1
  426. package/dist/shared/utils/validators/ip.js.map +0 -1
  427. package/dist/shared/utils/validators/nameserver.d.ts.map +0 -1
  428. package/dist/shared/utils/validators/nameserver.js.map +0 -1
  429. package/dist/shared/utils/validators/network.d.ts.map +0 -1
  430. package/dist/shared/utils/validators/network.js.map +0 -1
  431. /package/dist/{application → types/application}/client/index.d.ts +0 -0
  432. /package/dist/{application → types/application}/deduplication/QueryDeduplicator.d.ts +0 -0
  433. /package/dist/{application → types/application}/hooks/MiddlewareHooks.d.ts +0 -0
  434. /package/dist/{application → types/application}/services/BatchProcessor.d.ts +0 -0
  435. /package/dist/{application → types/application}/services/QueryOrchestrator.d.ts +0 -0
  436. /package/dist/{application → types/application}/services/QueryPriority.d.ts +0 -0
  437. /package/dist/{application → types/application}/services/index.d.ts +0 -0
  438. /package/dist/{cli → types/cli}/index.d.ts +0 -0
  439. /package/dist/{core → types/core}/ports/bootstrap.port.d.ts +0 -0
  440. /package/dist/{core → types/core}/ports/cache.port.d.ts +0 -0
  441. /package/dist/{core → types/core}/ports/fetcher.port.d.ts +0 -0
  442. /package/dist/{core → types/core}/ports/index.d.ts +0 -0
  443. /package/dist/{core → types/core}/ports/normalizer.port.d.ts +0 -0
  444. /package/dist/{core → types/core}/ports/pii-redactor.port.d.ts +0 -0
  445. /package/dist/{infrastructure → types/infrastructure}/cache/CacheManager.d.ts +0 -0
  446. /package/dist/{infrastructure → types/infrastructure}/cache/InMemoryCache.d.ts +0 -0
  447. /package/dist/{infrastructure → types/infrastructure}/cache/PersistentCache.d.ts +0 -0
  448. /package/dist/{infrastructure → types/infrastructure}/cache/RedisCache.d.ts +0 -0
  449. /package/dist/{infrastructure → types/infrastructure}/cache/index.d.ts +0 -0
  450. /package/dist/{infrastructure → types/infrastructure}/http/AuthenticationManager.d.ts +0 -0
  451. /package/dist/{infrastructure → types/infrastructure}/http/BootstrapDiscovery.d.ts +0 -0
  452. /package/dist/{infrastructure → types/infrastructure}/http/BrowserFetcher.d.ts +0 -0
  453. /package/dist/{infrastructure → types/infrastructure}/http/BunFetcher.d.ts +0 -0
  454. /package/dist/{infrastructure → types/infrastructure}/http/CircuitBreaker.d.ts +0 -0
  455. /package/dist/{infrastructure → types/infrastructure}/http/CloudflareWorkersFetcher.d.ts +0 -0
  456. /package/dist/{infrastructure → types/infrastructure}/http/CompressionManager.d.ts +0 -0
  457. /package/dist/{infrastructure → types/infrastructure}/http/ConnectionPool.d.ts +0 -0
  458. /package/dist/{infrastructure → types/infrastructure}/http/DenoFetcher.d.ts +0 -0
  459. /package/dist/{infrastructure → types/infrastructure}/http/Normalizer.d.ts +0 -0
  460. /package/dist/{infrastructure → types/infrastructure}/http/ProxyManager.d.ts +0 -0
  461. /package/dist/{infrastructure → types/infrastructure}/http/RetryStrategy.d.ts +0 -0
  462. /package/dist/{infrastructure → types/infrastructure}/http/index.d.ts +0 -0
  463. /package/dist/{infrastructure → types/infrastructure}/logging/AuditLogger.d.ts +0 -0
  464. /package/dist/{infrastructure → types/infrastructure}/logging/Logger.d.ts +0 -0
  465. /package/dist/{infrastructure → types/infrastructure}/monitoring/GrafanaDashboard.d.ts +0 -0
  466. /package/dist/{infrastructure → types/infrastructure}/monitoring/MetricsCollector.d.ts +0 -0
  467. /package/dist/{infrastructure → types/infrastructure}/monitoring/PrometheusExporter.d.ts +0 -0
  468. /package/dist/{infrastructure → types/infrastructure}/monitoring/TelemetryExporter.d.ts +0 -0
  469. /package/dist/{infrastructure → types/infrastructure}/native/NativeBackend.d.ts +0 -0
  470. /package/dist/{infrastructure → types/infrastructure}/security/PIIRedactor.d.ts +0 -0
  471. /package/dist/{infrastructure → types/infrastructure}/security/index.d.ts +0 -0
  472. /package/dist/{infrastructure → types/infrastructure}/validation/ResponseValidator.d.ts +0 -0
  473. /package/dist/{integrations → types/integrations}/express.d.ts +0 -0
  474. /package/dist/{integrations → types/integrations}/graphql.d.ts +0 -0
  475. /package/dist/{integrations → types/integrations}/nestjs.d.ts +0 -0
  476. /package/dist/{shared → types/shared}/constants/http.constants.d.ts +0 -0
  477. /package/dist/{shared → types/shared}/constants/index.d.ts +0 -0
  478. /package/dist/{shared → types/shared}/constants/rdap.constants.d.ts +0 -0
  479. /package/dist/{shared → types/shared}/errors/index.d.ts +0 -0
  480. /package/dist/{shared → types/shared}/types/entities.d.ts +0 -0
  481. /package/dist/{shared → types/shared}/types/errors.d.ts +0 -0
  482. /package/dist/{shared → types/shared}/types/generics.d.ts +0 -0
  483. /package/dist/{shared → types/shared}/utils/deprecation.d.ts +0 -0
  484. /package/dist/{shared → types/shared}/utils/enhanced-validators.d.ts +0 -0
  485. /package/dist/{shared → types/shared}/utils/helpers/async.d.ts +0 -0
  486. /package/dist/{shared → types/shared}/utils/helpers/cache.d.ts +0 -0
  487. /package/dist/{shared → types/shared}/utils/helpers/format.d.ts +0 -0
  488. /package/dist/{shared → types/shared}/utils/helpers/http.d.ts +0 -0
  489. /package/dist/{shared → types/shared}/utils/helpers/index.d.ts +0 -0
  490. /package/dist/{shared → types/shared}/utils/helpers/object.d.ts +0 -0
  491. /package/dist/{shared → types/shared}/utils/helpers/runtime.d.ts +0 -0
  492. /package/dist/{shared → types/shared}/utils/helpers/string.d.ts +0 -0
  493. /package/dist/{shared → types/shared}/utils/validators/asn.d.ts +0 -0
  494. /package/dist/{shared → types/shared}/utils/validators/config-validation.d.ts +0 -0
  495. /package/dist/{shared → types/shared}/utils/validators/domain.d.ts +0 -0
  496. /package/dist/{shared → types/shared}/utils/validators/entity.d.ts +0 -0
  497. /package/dist/{shared → types/shared}/utils/validators/index.d.ts +0 -0
  498. /package/dist/{shared → types/shared}/utils/validators/ip.d.ts +0 -0
  499. /package/dist/{shared → types/shared}/utils/validators/nameserver.d.ts +0 -0
  500. /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,2 @@
1
+ export { QueryOrchestrator } from './QueryOrchestrator';
2
+ export { BatchProcessor } from './BatchProcessor';
@@ -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,5 @@
1
+ export * from './cache.port';
2
+ export * from './fetcher.port';
3
+ export * from './normalizer.port';
4
+ export * from './bootstrap.port';
5
+ export * from './pii-redactor.port';
@@ -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.2';
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
+ }