rdapify 0.1.1 → 0.1.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 (77) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/README.md +206 -18
  3. package/dist/application/client/RDAPClient.d.ts +21 -0
  4. package/dist/application/client/RDAPClient.d.ts.map +1 -1
  5. package/dist/application/client/RDAPClient.js +60 -6
  6. package/dist/application/client/RDAPClient.js.map +1 -1
  7. package/dist/application/services/BatchProcessor.d.ts +27 -0
  8. package/dist/application/services/BatchProcessor.d.ts.map +1 -0
  9. package/dist/application/services/BatchProcessor.js +89 -0
  10. package/dist/application/services/BatchProcessor.js.map +1 -0
  11. package/dist/application/services/QueryOrchestrator.d.ts +7 -3
  12. package/dist/application/services/QueryOrchestrator.d.ts.map +1 -1
  13. package/dist/application/services/QueryOrchestrator.js +183 -41
  14. package/dist/application/services/QueryOrchestrator.js.map +1 -1
  15. package/dist/application/services/QueryPriority.d.ts +35 -0
  16. package/dist/application/services/QueryPriority.d.ts.map +1 -0
  17. package/dist/application/services/QueryPriority.js +114 -0
  18. package/dist/application/services/QueryPriority.js.map +1 -0
  19. package/dist/application/services/index.d.ts +1 -0
  20. package/dist/application/services/index.d.ts.map +1 -1
  21. package/dist/application/services/index.js +3 -1
  22. package/dist/application/services/index.js.map +1 -1
  23. package/dist/index.d.ts +16 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +31 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/infrastructure/cache/PersistentCache.d.ts +39 -0
  28. package/dist/infrastructure/cache/PersistentCache.d.ts.map +1 -0
  29. package/dist/infrastructure/cache/PersistentCache.js +194 -0
  30. package/dist/infrastructure/cache/PersistentCache.js.map +1 -0
  31. package/dist/infrastructure/http/AuthenticationManager.d.ts +38 -0
  32. package/dist/infrastructure/http/AuthenticationManager.d.ts.map +1 -0
  33. package/dist/infrastructure/http/AuthenticationManager.js +99 -0
  34. package/dist/infrastructure/http/AuthenticationManager.js.map +1 -0
  35. package/dist/infrastructure/http/CompressionManager.d.ts +30 -0
  36. package/dist/infrastructure/http/CompressionManager.d.ts.map +1 -0
  37. package/dist/infrastructure/http/CompressionManager.js +86 -0
  38. package/dist/infrastructure/http/CompressionManager.js.map +1 -0
  39. package/dist/infrastructure/http/ConnectionPool.d.ts +25 -0
  40. package/dist/infrastructure/http/ConnectionPool.d.ts.map +1 -0
  41. package/dist/infrastructure/http/ConnectionPool.js +101 -0
  42. package/dist/infrastructure/http/ConnectionPool.js.map +1 -0
  43. package/dist/infrastructure/http/ProxyManager.d.ts +43 -0
  44. package/dist/infrastructure/http/ProxyManager.d.ts.map +1 -0
  45. package/dist/infrastructure/http/ProxyManager.js +87 -0
  46. package/dist/infrastructure/http/ProxyManager.js.map +1 -0
  47. package/dist/infrastructure/http/RateLimiter.d.ts +28 -0
  48. package/dist/infrastructure/http/RateLimiter.d.ts.map +1 -0
  49. package/dist/infrastructure/http/RateLimiter.js +101 -0
  50. package/dist/infrastructure/http/RateLimiter.js.map +1 -0
  51. package/dist/infrastructure/http/RetryStrategy.d.ts +58 -0
  52. package/dist/infrastructure/http/RetryStrategy.d.ts.map +1 -0
  53. package/dist/infrastructure/http/RetryStrategy.js +136 -0
  54. package/dist/infrastructure/http/RetryStrategy.js.map +1 -0
  55. package/dist/infrastructure/logging/Logger.d.ts +49 -0
  56. package/dist/infrastructure/logging/Logger.d.ts.map +1 -0
  57. package/dist/infrastructure/logging/Logger.js +126 -0
  58. package/dist/infrastructure/logging/Logger.js.map +1 -0
  59. package/dist/infrastructure/monitoring/MetricsCollector.d.ts +53 -0
  60. package/dist/infrastructure/monitoring/MetricsCollector.d.ts.map +1 -0
  61. package/dist/infrastructure/monitoring/MetricsCollector.js +109 -0
  62. package/dist/infrastructure/monitoring/MetricsCollector.js.map +1 -0
  63. package/dist/infrastructure/security/SSRFProtection.js +1 -1
  64. package/dist/infrastructure/security/SSRFProtection.js.map +1 -1
  65. package/dist/shared/errors/base.error.d.ts +11 -6
  66. package/dist/shared/errors/base.error.d.ts.map +1 -1
  67. package/dist/shared/errors/base.error.js +42 -11
  68. package/dist/shared/errors/base.error.js.map +1 -1
  69. package/dist/shared/types/generics.d.ts +32 -0
  70. package/dist/shared/types/generics.d.ts.map +1 -0
  71. package/dist/shared/types/generics.js +3 -0
  72. package/dist/shared/types/generics.js.map +1 -0
  73. package/dist/shared/utils/enhanced-validators.d.ts +18 -0
  74. package/dist/shared/utils/enhanced-validators.d.ts.map +1 -0
  75. package/dist/shared/utils/enhanced-validators.js +162 -0
  76. package/dist/shared/utils/enhanced-validators.js.map +1 -0
  77. package/package.json +20 -3
@@ -0,0 +1,27 @@
1
+ import type { RDAPClient } from '../client/RDAPClient';
2
+ import type { QueryTypeLiteral, BatchQueryResult } from '../../shared/types/generics';
3
+ export interface BatchQueryRequest<T extends QueryTypeLiteral = QueryTypeLiteral> {
4
+ type: T;
5
+ query: string;
6
+ id?: string;
7
+ }
8
+ export interface BatchOptions {
9
+ concurrency?: number;
10
+ continueOnError?: boolean;
11
+ timeout?: number;
12
+ }
13
+ export declare class BatchProcessor {
14
+ private readonly client;
15
+ constructor(client: RDAPClient);
16
+ processBatch<T extends QueryTypeLiteral>(requests: BatchQueryRequest<T>[], options?: BatchOptions): Promise<BatchQueryResult<T>[]>;
17
+ processBatchWithTimeout<T extends QueryTypeLiteral>(requests: BatchQueryRequest<T>[], timeoutMs: number, options?: Omit<BatchOptions, 'timeout'>): Promise<BatchQueryResult<T>[]>;
18
+ analyzeBatchResults<T extends QueryTypeLiteral>(results: BatchQueryResult<T>[]): {
19
+ total: number;
20
+ successful: number;
21
+ failed: number;
22
+ averageDuration: number;
23
+ totalDuration: number;
24
+ successRate: number;
25
+ };
26
+ }
27
+ //# sourceMappingURL=BatchProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchProcessor.d.ts","sourceRoot":"","sources":["../../../src/application/services/BatchProcessor.ts"],"names":[],"mappings":"AA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+1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BatchProcessor = void 0;
4
+ class BatchProcessor {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ async processBatch(requests, options = {}) {
9
+ const { concurrency = 5, continueOnError = true, } = options;
10
+ const results = [];
11
+ const queue = [...requests];
12
+ const inProgress = [];
13
+ const processOne = async (request) => {
14
+ const startTime = Date.now();
15
+ try {
16
+ let result;
17
+ switch (request.type) {
18
+ case 'domain':
19
+ result = await this.client.domain(request.query);
20
+ break;
21
+ case 'ip':
22
+ result = await this.client.ip(request.query);
23
+ break;
24
+ case 'asn':
25
+ result = await this.client.asn(request.query);
26
+ break;
27
+ default:
28
+ throw new Error(`Unknown query type: ${request.type}`);
29
+ }
30
+ results.push({
31
+ type: request.type,
32
+ query: request.query,
33
+ result,
34
+ duration: Date.now() - startTime,
35
+ });
36
+ }
37
+ catch (error) {
38
+ results.push({
39
+ type: request.type,
40
+ query: request.query,
41
+ error: error,
42
+ duration: Date.now() - startTime,
43
+ });
44
+ if (!continueOnError) {
45
+ throw error;
46
+ }
47
+ }
48
+ };
49
+ while (queue.length > 0 || inProgress.length > 0) {
50
+ while (inProgress.length < concurrency && queue.length > 0) {
51
+ const request = queue.shift();
52
+ const promise = processOne(request);
53
+ inProgress.push(promise);
54
+ promise.finally(() => {
55
+ const index = inProgress.indexOf(promise);
56
+ if (index > -1) {
57
+ inProgress.splice(index, 1);
58
+ }
59
+ });
60
+ }
61
+ if (inProgress.length > 0) {
62
+ await Promise.race(inProgress);
63
+ }
64
+ }
65
+ return results;
66
+ }
67
+ async processBatchWithTimeout(requests, timeoutMs, options = {}) {
68
+ return Promise.race([
69
+ this.processBatch(requests, options),
70
+ new Promise((_, reject) => setTimeout(() => reject(new Error(`Batch processing timeout after ${timeoutMs}ms`)), timeoutMs)),
71
+ ]);
72
+ }
73
+ analyzeBatchResults(results) {
74
+ const successful = results.filter((r) => !r.error).length;
75
+ const failed = results.filter((r) => r.error).length;
76
+ const totalDuration = results.reduce((sum, r) => sum + r.duration, 0);
77
+ const averageDuration = results.length > 0 ? totalDuration / results.length : 0;
78
+ return {
79
+ total: results.length,
80
+ successful,
81
+ failed,
82
+ averageDuration,
83
+ totalDuration,
84
+ successRate: results.length > 0 ? (successful / results.length) * 100 : 0,
85
+ };
86
+ }
87
+ }
88
+ exports.BatchProcessor = BatchProcessor;
89
+ //# sourceMappingURL=BatchProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchProcessor.js","sourceRoot":"","sources":["../../../src/application/services/BatchProcessor.ts"],"names":[],"mappings":";;;AAgCA,MAAa,cAAc;IAGzB,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAKD,KAAK,CAAC,YAAY,CAChB,QAAgC,EAChC,UAAwB,EAAE;QAE1B,MAAM,EACJ,WAAW,GAAG,CAAC,EACf,eAAe,GAAG,IAAI,GACvB,GAAG,OAAO,CAAC;QAEZ,MAAM,OAAO,GAA0B,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC5B,MAAM,UAAU,GAAoB,EAAE,CAAC;QAEvC,MAAM,UAAU,GAAG,KAAK,EAAE,OAA6B,EAAiB,EAAE;YACxE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAE7B,IAAI,CAAC;gBACH,IAAI,MAAsB,CAAC;gBAE3B,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;oBACrB,KAAK,QAAQ;wBACX,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAmB,CAAC;wBACnE,MAAM;oBACR,KAAK,IAAI;wBACP,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAmB,CAAC;wBAC/D,MAAM;oBACR,KAAK,KAAK;wB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AO;YACL,KAAK,EAAE,OAAO,CAAC,MAAM;YACrB,UAAU;YACV,MAAM;YACN,eAAe;YACf,aAAa;YACb,WAAW,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;SAC1E,CAAC;IACJ,CAAC;CACF;AApID,wCAoIC"}
@@ -1,8 +1,9 @@
1
1
  import type { CacheManager } from '../../infrastructure/cache';
2
- import type { BootstrapDiscovery } from '../../infrastructure/http';
3
- import type { Fetcher } from '../../infrastructure/http';
4
- import type { Normalizer } from '../../infrastructure/http';
2
+ import type { BootstrapDiscovery, Fetcher, Normalizer } from '../../infrastructure/http';
3
+ import type { RateLimiter } from '../../infrastructure/http/RateLimiter';
5
4
  import type { PIIRedactor } from '../../infrastructure/security';
5
+ import type { MetricsCollector } from '../../infrastructure/monitoring/MetricsCollector';
6
+ import type { Logger } from '../../infrastructure/logging/Logger';
6
7
  import type { DomainResponse, IPResponse, ASNResponse } from '../../shared/types';
7
8
  export interface QueryOrchestratorConfig {
8
9
  cache: CacheManager;
@@ -12,6 +13,9 @@ export interface QueryOrchestratorConfig {
12
13
  piiRedactor: PIIRedactor;
13
14
  includeRaw: boolean;
14
15
  fetchWithRetry: (url: string) => Promise<any>;
16
+ rateLimiter?: RateLimiter;
17
+ metricsCollector?: MetricsCollector;
18
+ logger?: Logger;
15
19
  }
16
20
  export declare class QueryOrchestrator {
17
21
  private readonly config;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryOrchestrator.d.ts","sourceRoot":"","sources":["../../../src/application/services/QueryOrchestrator.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACz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,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAclF,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;gBAErC,MAAM,EAAE,uBAAuB;IAOrC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAwGpD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA2GxC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAqG3D"}
@@ -8,51 +8,193 @@ class QueryOrchestrator {
8
8
  this.config = config;
9
9
  }
10
10
  async queryDomain(domain) {
11
- (0, validators_1.validateDomain)(domain);
12
- const normalized = (0, validators_1.normalizeDomain)(domain);
13
- const cacheKey = (0, helpers_1.generateCacheKey)('domain', normalized);
14
- const cached = await this.config.cache.get(cacheKey);
15
- if (cached && cached.objectClass === 'domain') {
16
- return this.config.piiRedactor.redact(cached);
17
- }
18
- const serverUrl = await this.config.bootstrap.discoverDomain(normalized);
19
- const queryUrl = `${serverUrl}/domain/${normalized}`;
20
- const raw = await this.config.fetchWithRetry(queryUrl);
21
- const response = this.config.normalizer.normalize(raw, normalized, serverUrl, false, this.config.includeRaw);
22
- await this.config.cache.set(cacheKey, response);
23
- return this.config.piiRedactor.redact(response);
11
+ const startTime = Date.now();
12
+ this.config.logger?.logRequest('domain', domain);
13
+ if (this.config.rateLimiter) {
14
+ await this.config.rateLimiter.checkLimit();
15
+ }
16
+ try {
17
+ (0, validators_1.validateDomain)(domain);
18
+ const normalized = (0, validators_1.normalizeDomain)(domain);
19
+ const cacheKey = (0, helpers_1.generateCacheKey)('domain', normalized);
20
+ const cached = await this.config.cache.get(cacheKey);
21
+ if (cached && cached.objectClass === 'domain') {
22
+ this.config.logger?.logCache('hit', cacheKey);
23
+ const duration = Date.now() - startTime;
24
+ this.config.metricsCollector?.record({
25
+ type: 'domain',
26
+ query: normalized,
27
+ success: true,
28
+ duration,
29
+ cached: true,
30
+ timestamp: Date.now(),
31
+ });
32
+ this.config.logger?.logResponse('domain', normalized, true, duration);
33
+ return this.config.piiRedactor.redact(cached);
34
+ }
35
+ this.config.logger?.logCache('miss', cacheKey);
36
+ const serverUrl = await this.config.bootstrap.discoverDomain(normalized);
37
+ this.config.logger?.debug(`Discovered server: ${serverUrl}`);
38
+ const queryUrl = `${serverUrl}/domain/${normalized}`;
39
+ const raw = await this.config.fetchWithRetry(queryUrl);
40
+ const response = this.config.normalizer.normalize(raw, normalized, serverUrl, false, this.config.includeRaw);
41
+ await this.config.cache.set(cacheKey, response);
42
+ this.config.logger?.logCache('set', cacheKey);
43
+ const duration = Date.now() - startTime;
44
+ this.config.metricsCollector?.record({
45
+ type: 'domain',
46
+ query: normalized,
47
+ success: true,
48
+ duration,
49
+ cached: false,
50
+ timestamp: Date.now(),
51
+ });
52
+ this.config.logger?.logResponse('domain', normalized, true, duration);
53
+ return this.config.piiRedactor.redact(response);
54
+ }
55
+ catch (error) {
56
+ const duration = Date.now() - startTime;
57
+ this.config.metricsCollector?.record({
58
+ type: 'domain',
59
+ query: domain,
60
+ success: false,
61
+ duration,
62
+ cached: false,
63
+ timestamp: Date.now(),
64
+ error: error instanceof Error ? error.name : 'Unknown',
65
+ });
66
+ this.config.logger?.logResponse('domain', domain, false, duration, {
67
+ error: error instanceof Error ? error.message : 'Unknown error',
68
+ });
69
+ throw error;
70
+ }
24
71
  }
25
72
  async queryIP(ip) {
26
- const version = (0, validators_1.validateIP)(ip);
27
- const normalized = (0, validators_1.normalizeIP)(ip);
28
- const cacheKey = (0, helpers_1.generateCacheKey)('ip', normalized);
29
- const cached = await this.config.cache.get(cacheKey);
30
- if (cached && cached.objectClass === 'ip network') {
31
- return this.config.piiRedactor.redact(cached);
32
- }
33
- const serverUrl = version === 'v4'
34
- ? await this.config.bootstrap.discoverIPv4(normalized)
35
- : await this.config.bootstrap.discoverIPv6(normalized);
36
- const queryUrl = `${serverUrl}/ip/${normalized}`;
37
- const raw = await this.config.fetchWithRetry(queryUrl);
38
- const response = this.config.normalizer.normalize(raw, normalized, serverUrl, false, this.config.includeRaw);
39
- await this.config.cache.set(cacheKey, response);
40
- return this.config.piiRedactor.redact(response);
73
+ const startTime = Date.now();
74
+ this.config.logger?.logRequest('ip', ip);
75
+ if (this.config.rateLimiter) {
76
+ await this.config.rateLimiter.checkLimit();
77
+ }
78
+ try {
79
+ const version = (0, validators_1.validateIP)(ip);
80
+ const normalized = (0, validators_1.normalizeIP)(ip);
81
+ const cacheKey = (0, helpers_1.generateCacheKey)('ip', normalized);
82
+ const cached = await this.config.cache.get(cacheKey);
83
+ if (cached && cached.objectClass === 'ip network') {
84
+ this.config.logger?.logCache('hit', cacheKey);
85
+ const duration = Date.now() - startTime;
86
+ this.config.metricsCollector?.record({
87
+ type: 'ip',
88
+ query: normalized,
89
+ success: true,
90
+ duration,
91
+ cached: true,
92
+ timestamp: Date.now(),
93
+ });
94
+ this.config.logger?.logResponse('ip', normalized, true, duration);
95
+ return this.config.piiRedactor.redact(cached);
96
+ }
97
+ this.config.logger?.logCache('miss', cacheKey);
98
+ const serverUrl = version === 'v4'
99
+ ? await this.config.bootstrap.discoverIPv4(normalized)
100
+ : await this.config.bootstrap.discoverIPv6(normalized);
101
+ this.config.logger?.debug(`Discovered server: ${serverUrl}`);
102
+ const queryUrl = `${serverUrl}/ip/${normalized}`;
103
+ const raw = await this.config.fetchWithRetry(queryUrl);
104
+ const response = this.config.normalizer.normalize(raw, normalized, serverUrl, false, this.config.includeRaw);
105
+ await this.config.cache.set(cacheKey, response);
106
+ this.config.logger?.logCache('set', cacheKey);
107
+ const duration = Date.now() - startTime;
108
+ this.config.metricsCollector?.record({
109
+ type: 'ip',
110
+ query: normalized,
111
+ success: true,
112
+ duration,
113
+ cached: false,
114
+ timestamp: Date.now(),
115
+ });
116
+ this.config.logger?.logResponse('ip', normalized, true, duration);
117
+ return this.config.piiRedactor.redact(response);
118
+ }
119
+ catch (error) {
120
+ const duration = Date.now() - startTime;
121
+ this.config.metricsCollector?.record({
122
+ type: 'ip',
123
+ query: ip,
124
+ success: false,
125
+ duration,
126
+ cached: false,
127
+ timestamp: Date.now(),
128
+ error: error instanceof Error ? error.name : 'Unknown',
129
+ });
130
+ this.config.logger?.logResponse('ip', ip, false, duration, {
131
+ error: error instanceof Error ? error.message : 'Unknown error',
132
+ });
133
+ throw error;
134
+ }
41
135
  }
42
136
  async queryASN(asn) {
43
- const asnNumber = (0, validators_1.validateASN)(asn);
44
- const normalized = (0, validators_1.normalizeASN)(asnNumber);
45
- const cacheKey = (0, helpers_1.generateCacheKey)('asn', normalized);
46
- const cached = await this.config.cache.get(cacheKey);
47
- if (cached && cached.objectClass === 'autnum') {
48
- return this.config.piiRedactor.redact(cached);
49
- }
50
- const serverUrl = await this.config.bootstrap.discoverASN(asnNumber);
51
- const queryUrl = `${serverUrl}/autnum/${asnNumber}`;
52
- const raw = await this.config.fetchWithRetry(queryUrl);
53
- const response = this.config.normalizer.normalize(raw, normalized, serverUrl, false, this.config.includeRaw);
54
- await this.config.cache.set(cacheKey, response);
55
- return this.config.piiRedactor.redact(response);
137
+ const startTime = Date.now();
138
+ const asnStr = typeof asn === 'number' ? `AS${asn}` : asn;
139
+ this.config.logger?.logRequest('asn', asnStr);
140
+ if (this.config.rateLimiter) {
141
+ await this.config.rateLimiter.checkLimit();
142
+ }
143
+ try {
144
+ const asnNumber = (0, validators_1.validateASN)(asn);
145
+ const normalized = (0, validators_1.normalizeASN)(asnNumber);
146
+ const cacheKey = (0, helpers_1.generateCacheKey)('asn', normalized);
147
+ const cached = await this.config.cache.get(cacheKey);
148
+ if (cached && cached.objectClass === 'autnum') {
149
+ this.config.logger?.logCache('hit', cacheKey);
150
+ const duration = Date.now() - startTime;
151
+ this.config.metricsCollector?.record({
152
+ type: 'asn',
153
+ query: normalized,
154
+ success: true,
155
+ duration,
156
+ cached: true,
157
+ timestamp: Date.now(),
158
+ });
159
+ this.config.logger?.logResponse('asn', normalized, true, duration);
160
+ return this.config.piiRedactor.redact(cached);
161
+ }
162
+ this.config.logger?.logCache('miss', cacheKey);
163
+ const serverUrl = await this.config.bootstrap.discoverASN(asnNumber);
164
+ this.config.logger?.debug(`Discovered server: ${serverUrl}`);
165
+ const queryUrl = `${serverUrl}/autnum/${asnNumber}`;
166
+ const raw = await this.config.fetchWithRetry(queryUrl);
167
+ const response = this.config.normalizer.normalize(raw, normalized, serverUrl, false, this.config.includeRaw);
168
+ await this.config.cache.set(cacheKey, response);
169
+ this.config.logger?.logCache('set', cacheKey);
170
+ const duration = Date.now() - startTime;
171
+ this.config.metricsCollector?.record({
172
+ type: 'asn',
173
+ query: normalized,
174
+ success: true,
175
+ duration,
176
+ cached: false,
177
+ timestamp: Date.now(),
178
+ });
179
+ this.config.logger?.logResponse('asn', normalized, true, duration);
180
+ return this.config.piiRedactor.redact(response);
181
+ }
182
+ catch (error) {
183
+ const duration = Date.now() - startTime;
184
+ this.config.metricsCollector?.record({
185
+ type: 'asn',
186
+ query: asnStr,
187
+ success: false,
188
+ duration,
189
+ cached: false,
190
+ timestamp: Date.now(),
191
+ error: error instanceof Error ? error.name : 'Unknown',
192
+ });
193
+ this.config.logger?.logResponse('asn', asnStr, false, duration, {
194
+ error: error instanceof Error ? error.message : 'Unknown error',
195
+ });
196
+ throw error;
197
+ }
56
198
  }
57
199
  }
58
200
  exports.QueryOrchestrator = QueryOrchestrator;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryOrchestrator.js","sourceRoot":"","sources":["../../../src/application/services/QueryOrchestrator.ts"],"names":[],"mappings":";;;AAYA,wDAA8D;AAC9D,8DAOuC;AAmBvC,MAAa,iBAAiB;IAG5B,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAKD,KAAK,CAAC,WAAW,CAAC,MAAc;QAE9B,IAAA,2BAAc,EAAC,MAAM,CAAC,CAAC;QACvB,MAAM,UAAU,GAAG,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QAG3C,MAAM,QAAQ,GAAG,IAAA,0BAAgB,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAmB,CAAC;QAClE,CAAC;QAGD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAGzE,MAAM,QAAQ,GAAG,GAAG,SAAS,WAAW,UAAU,EAAE,CAAC;QAGrD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAGvD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAC/C,GAAG,EACH,UAAU,EACV,SAAS,EACT,KAAK,EACL,IAAI,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ACrB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;aACvD,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;gBAC9D,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAChE,CAAC,CAAC;YAEH,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAlUD,8CAkUC"}
@@ -0,0 +1,35 @@
1
+ export type Priority = 'high' | 'normal' | 'low';
2
+ export interface PriorityQueueItem<T> {
3
+ id: string;
4
+ priority: Priority;
5
+ data: T;
6
+ timestamp: number;
7
+ resolve: (value: any) => void;
8
+ reject: (error: Error) => void;
9
+ }
10
+ export declare class QueryPriorityQueue<T = any> {
11
+ private highPriorityQueue;
12
+ private normalPriorityQueue;
13
+ private lowPriorityQueue;
14
+ private processing;
15
+ private concurrency;
16
+ private activeCount;
17
+ private processor;
18
+ constructor(concurrency: number | undefined, processor: (item: T) => Promise<any>);
19
+ enqueue(data: T, priority?: Priority): Promise<any>;
20
+ private processQueue;
21
+ private dequeue;
22
+ private hasItems;
23
+ getStats(): {
24
+ high: number;
25
+ normal: number;
26
+ low: number;
27
+ total: number;
28
+ active: number;
29
+ concurrency: number;
30
+ };
31
+ clear(): void;
32
+ size(): number;
33
+ isEmpty(): boolean;
34
+ }
35
+ //# sourceMappingURL=QueryPriority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryPriority.d.ts","sourceRoot":"","sources":["../../../src/application/services/QueryPriority.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEjD,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,CAAC,CAAC;IACR,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC;AAKD,qBAAa,kBAAkB,CAAC,CAAC,GAAG,GAAG;IACrC,OAAO,CAAC,iBAAiB,CAA8B;IACvD,OAAO,CAAC,mBAAmB,CAA8B;IACzD,OAAO,CAAC,gBAAgB,CAA8B;IACtD,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,SAAS,CAA4B;gBAEjC,WAAW,EAAE,MAAM,YAAI,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC;IAQnE,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,GAAE,QAAmB,GAAG,OAAO,CAAC,GAAG,CAAC;YAiCrD,YAAY;IA8B1B,OAAO,CAAC,OAAO;IAsBf,OAAO,CAAC,QAAQ;IAWhB,QAAQ,IAAI;QACV,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB;IAiBD,KAAK,IAAI,IAAI;IAoBb,IAAI,IAAI,MAAM;IAWd,OAAO,IAAI,OAAO;CAGnB"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryPriorityQueue = void 0;
4
+ class QueryPriorityQueue {
5
+ constructor(concurrency = 5, processor) {
6
+ this.highPriorityQueue = [];
7
+ this.normalPriorityQueue = [];
8
+ this.lowPriorityQueue = [];
9
+ this.processing = false;
10
+ this.activeCount = 0;
11
+ this.concurrency = concurrency;
12
+ this.processor = processor;
13
+ }
14
+ async enqueue(data, priority = 'normal') {
15
+ return new Promise((resolve, reject) => {
16
+ const item = {
17
+ id: `${Date.now()}-${Math.random()}`,
18
+ priority,
19
+ data,
20
+ timestamp: Date.now(),
21
+ resolve,
22
+ reject,
23
+ };
24
+ switch (priority) {
25
+ case 'high':
26
+ this.highPriorityQueue.push(item);
27
+ break;
28
+ case 'low':
29
+ this.lowPriorityQueue.push(item);
30
+ break;
31
+ case 'normal':
32
+ default:
33
+ this.normalPriorityQueue.push(item);
34
+ break;
35
+ }
36
+ this.processQueue();
37
+ });
38
+ }
39
+ async processQueue() {
40
+ if (this.processing)
41
+ return;
42
+ this.processing = true;
43
+ while (this.hasItems() && this.activeCount < this.concurrency) {
44
+ const item = this.dequeue();
45
+ if (!item)
46
+ break;
47
+ this.activeCount++;
48
+ this.processor(item.data)
49
+ .then((result) => {
50
+ item.resolve(result);
51
+ })
52
+ .catch((error) => {
53
+ item.reject(error);
54
+ })
55
+ .finally(() => {
56
+ this.activeCount--;
57
+ this.processQueue();
58
+ });
59
+ }
60
+ this.processing = false;
61
+ }
62
+ dequeue() {
63
+ if (this.highPriorityQueue.length > 0) {
64
+ return this.highPriorityQueue.shift();
65
+ }
66
+ if (this.normalPriorityQueue.length > 0) {
67
+ return this.normalPriorityQueue.shift();
68
+ }
69
+ if (this.lowPriorityQueue.length > 0) {
70
+ return this.lowPriorityQueue.shift();
71
+ }
72
+ return undefined;
73
+ }
74
+ hasItems() {
75
+ return (this.highPriorityQueue.length > 0 ||
76
+ this.normalPriorityQueue.length > 0 ||
77
+ this.lowPriorityQueue.length > 0);
78
+ }
79
+ getStats() {
80
+ return {
81
+ high: this.highPriorityQueue.length,
82
+ normal: this.normalPriorityQueue.length,
83
+ low: this.lowPriorityQueue.length,
84
+ total: this.highPriorityQueue.length +
85
+ this.normalPriorityQueue.length +
86
+ this.lowPriorityQueue.length,
87
+ active: this.activeCount,
88
+ concurrency: this.concurrency,
89
+ };
90
+ }
91
+ clear() {
92
+ const rejectAll = (queue) => {
93
+ queue.forEach((item) => {
94
+ item.reject(new Error('Queue cleared'));
95
+ });
96
+ };
97
+ rejectAll(this.highPriorityQueue);
98
+ rejectAll(this.normalPriorityQueue);
99
+ rejectAll(this.lowPriorityQueue);
100
+ this.highPriorityQueue = [];
101
+ this.normalPriorityQueue = [];
102
+ this.lowPriorityQueue = [];
103
+ }
104
+ size() {
105
+ return (this.highPriorityQueue.length +
106
+ this.normalPriorityQueue.length +
107
+ this.lowPriorityQueue.length);
108
+ }
109
+ isEmpty() {
110
+ return this.size() === 0;
111
+ }
112
+ }
113
+ exports.QueryPriorityQueue = QueryPriorityQueue;
114
+ //# sourceMappingURL=QueryPriority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryPriority.js","sourceRoot":"","sources":["../../../src/application/services/QueryPriority.ts"],"names":[],"mappings":";;;AAmBA,MAAa,kBAAkB;IAS7B,YAAY,cAAsB,CAAC,EAAE,SAAoC;QARjE,sBAAiB,GAA2B,EAAE,CAAC;QAC/C,wBAAmB,GAA2B,EAAE,CAAC;QACjD,qBAAgB,GAA2B,EAAE,CAAC;QAC9C,eAAU,GAAY,KAAK,CAAC;QAE5B,gBAAW,GAAW,CAAC,CAAC;QAI9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAKD,KAAK,CAAC,OAAO,CAAC,IAAO,EAAE,WAAqB,QAAQ;QAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,IAAI,GAAyB;gBACjC,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;gBACpC,QAAQ;gBACR,IAAI;gBACJ,SAAS,EAAE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IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAClC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACpC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEjC,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC7B,CAAC;IAKD,IAAI;QACF,OAAO,CACL,IAAI,CAAC,iBAAiB,CAAC,MAAM;YAC7B,IAAI,CAAC,mBAAmB,CAAC,MAAM;YAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAC7B,CAAC;IACJ,CAAC;IAKD,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF;AA3KD,gDA2KC"}
@@ -1,2 +1,3 @@
1
1
  export { QueryOrchestrator, type QueryOrchestratorConfig } from './QueryOrchestrator';
2
+ export { BatchProcessor, type BatchQueryRequest, type BatchOptions } from './BatchProcessor';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/services/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/services/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryOrchestrator = void 0;
3
+ exports.BatchProcessor = exports.QueryOrchestrator = void 0;
4
4
  var QueryOrchestrator_1 = require("./QueryOrchestrator");
5
5
  Object.defineProperty(exports, "QueryOrchestrator", { enumerable: true, get: function () { return QueryOrchestrator_1.QueryOrchestrator; } });
6
+ var BatchProcessor_1 = require("./BatchProcessor");
7
+ Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return BatchProcessor_1.BatchProcessor; } });
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/services/index.ts"],"names":[],"mappings":";;;AAKA,yDAAsF;AAA7E,sHAAA,iBAAiB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/services/index.ts"],"names":[],"mappings":";;;AAKA,yDAAsF;AAA7E,sHAAA,iBAAiB,OAAA;AAC1B,mDAA6F;AAApF,gHAAA,cAAc,OAAA"}