recker 1.0.15-next.50d74b2 → 1.0.15-next.64a2dc9

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 (108) hide show
  1. package/README.md +10 -1
  2. package/dist/ai/providers/anthropic.d.ts.map +1 -1
  3. package/dist/ai/providers/anthropic.js +4 -1
  4. package/dist/ai/providers/base.d.ts.map +1 -1
  5. package/dist/ai/providers/base.js +7 -2
  6. package/dist/ai/rate-limiter.d.ts.map +1 -1
  7. package/dist/ai/rate-limiter.js +4 -1
  8. package/dist/bench/generator.d.ts.map +1 -1
  9. package/dist/bench/generator.js +7 -3
  10. package/dist/bench/stats.d.ts.map +1 -1
  11. package/dist/bench/stats.js +43 -10
  12. package/dist/cache/memory-storage.d.ts.map +1 -1
  13. package/dist/cache/memory-storage.js +3 -2
  14. package/dist/cli/handler.js +14 -14
  15. package/dist/cli/index.js +582 -49
  16. package/dist/cli/presets.js +5 -5
  17. package/dist/cli/tui/ai-chat.js +10 -10
  18. package/dist/cli/tui/load-dashboard.d.ts.map +1 -1
  19. package/dist/cli/tui/load-dashboard.js +96 -55
  20. package/dist/cli/tui/scroll-buffer.d.ts +1 -1
  21. package/dist/cli/tui/scroll-buffer.d.ts.map +1 -1
  22. package/dist/cli/tui/scroll-buffer.js +2 -2
  23. package/dist/cli/tui/shell.d.ts +3 -0
  24. package/dist/cli/tui/shell.d.ts.map +1 -1
  25. package/dist/cli/tui/shell.js +173 -10
  26. package/dist/cli/tui/websocket.js +17 -17
  27. package/dist/core/client.d.ts.map +1 -1
  28. package/dist/core/client.js +18 -26
  29. package/dist/core/errors.d.ts +109 -1
  30. package/dist/core/errors.d.ts.map +1 -1
  31. package/dist/core/errors.js +214 -1
  32. package/dist/core/request-promise.d.ts.map +1 -1
  33. package/dist/core/request-promise.js +5 -6
  34. package/dist/core/response.d.ts.map +1 -1
  35. package/dist/core/response.js +5 -6
  36. package/dist/dns/propagation.d.ts +3 -1
  37. package/dist/dns/propagation.d.ts.map +1 -1
  38. package/dist/dns/propagation.js +99 -59
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -0
  42. package/dist/mcp/client.d.ts.map +1 -1
  43. package/dist/mcp/client.js +10 -11
  44. package/dist/mcp/embeddings-loader.d.ts.map +1 -1
  45. package/dist/mcp/embeddings-loader.js +12 -2
  46. package/dist/mcp/geoip-loader.d.ts +11 -0
  47. package/dist/mcp/geoip-loader.d.ts.map +1 -0
  48. package/dist/mcp/geoip-loader.js +107 -0
  49. package/dist/mcp/ip-intel.d.ts +28 -0
  50. package/dist/mcp/ip-intel.d.ts.map +1 -0
  51. package/dist/mcp/ip-intel.js +209 -0
  52. package/dist/mcp/search/hybrid-search.d.ts.map +1 -1
  53. package/dist/mcp/search/hybrid-search.js +5 -1
  54. package/dist/mcp/search/math.d.ts.map +1 -1
  55. package/dist/mcp/search/math.js +5 -1
  56. package/dist/mcp/server.d.ts +4 -0
  57. package/dist/mcp/server.d.ts.map +1 -1
  58. package/dist/mcp/server.js +114 -1
  59. package/dist/plugins/compression.js +4 -2
  60. package/dist/plugins/har-player.d.ts.map +1 -1
  61. package/dist/plugins/har-player.js +8 -11
  62. package/dist/plugins/odata.d.ts.map +1 -1
  63. package/dist/plugins/odata.js +5 -2
  64. package/dist/protocols/ftp.d.ts.map +1 -1
  65. package/dist/protocols/ftp.js +69 -16
  66. package/dist/protocols/sftp.d.ts.map +1 -1
  67. package/dist/protocols/sftp.js +13 -3
  68. package/dist/protocols/telnet.d.ts.map +1 -1
  69. package/dist/protocols/telnet.js +25 -6
  70. package/dist/transport/base-udp.d.ts.map +1 -1
  71. package/dist/transport/base-udp.js +7 -4
  72. package/dist/transport/udp-response.d.ts.map +1 -1
  73. package/dist/transport/udp-response.js +10 -3
  74. package/dist/transport/udp.d.ts.map +1 -1
  75. package/dist/transport/udp.js +5 -1
  76. package/dist/transport/undici.d.ts.map +1 -1
  77. package/dist/transport/undici.js +75 -63
  78. package/dist/utils/agent-manager.d.ts +1 -0
  79. package/dist/utils/agent-manager.d.ts.map +1 -1
  80. package/dist/utils/agent-manager.js +11 -0
  81. package/dist/utils/client-pool.d.ts.map +1 -1
  82. package/dist/utils/client-pool.js +4 -1
  83. package/dist/utils/dns-toolkit.d.ts +88 -1
  84. package/dist/utils/dns-toolkit.d.ts.map +1 -1
  85. package/dist/utils/dns-toolkit.js +704 -6
  86. package/dist/utils/doh.d.ts.map +1 -1
  87. package/dist/utils/doh.js +13 -16
  88. package/dist/utils/download.d.ts.map +1 -1
  89. package/dist/utils/download.js +10 -11
  90. package/dist/utils/rdap.d.ts +9 -0
  91. package/dist/utils/rdap.d.ts.map +1 -1
  92. package/dist/utils/rdap.js +78 -9
  93. package/dist/utils/security-grader.d.ts +47 -0
  94. package/dist/utils/security-grader.d.ts.map +1 -0
  95. package/dist/utils/security-grader.js +637 -0
  96. package/dist/utils/sparkline.d.ts +18 -0
  97. package/dist/utils/sparkline.d.ts.map +1 -0
  98. package/dist/utils/sparkline.js +55 -0
  99. package/dist/utils/sse.d.ts.map +1 -1
  100. package/dist/utils/sse.js +5 -6
  101. package/dist/utils/system-metrics.d.ts +26 -0
  102. package/dist/utils/system-metrics.d.ts.map +1 -0
  103. package/dist/utils/system-metrics.js +81 -0
  104. package/dist/webrtc/index.d.ts.map +1 -1
  105. package/dist/webrtc/index.js +21 -7
  106. package/dist/websocket/client.d.ts.map +1 -1
  107. package/dist/websocket/client.js +13 -16
  108. package/package.json +2 -1
@@ -1,24 +1,24 @@
1
1
  import readline from 'node:readline';
2
2
  import { createClient } from '../../core/client.js';
3
- import pc from '../../utils/colors.js';
3
+ import colors from '../../utils/colors.js';
4
4
  export async function startInteractiveWebSocket(url, headers) {
5
- console.log(pc.gray('--------------------------------------------------'));
6
- console.log(pc.cyan(`Connecting to ${pc.bold(url)}...`));
7
- console.log(pc.gray('Commands: /quit to exit, /ping to send heartbeat'));
8
- console.log(pc.gray('--------------------------------------------------\n'));
5
+ console.log(colors.gray('--------------------------------------------------'));
6
+ console.log(colors.cyan(`Connecting to ${colors.bold(url)}...`));
7
+ console.log(colors.gray('Commands: /quit to exit, /ping to send heartbeat'));
8
+ console.log(colors.gray('--------------------------------------------------\n'));
9
9
  const client = createClient();
10
10
  let ws;
11
11
  try {
12
12
  ws = client.websocket(url, { headers });
13
13
  }
14
14
  catch (error) {
15
- console.error(pc.red(`Error creating WebSocket: ${error.message}`));
15
+ console.error(colors.red(`Error creating WebSocket: ${error.message}`));
16
16
  return;
17
17
  }
18
18
  const rl = readline.createInterface({
19
19
  input: process.stdin,
20
20
  output: process.stdout,
21
- prompt: pc.green('>> '),
21
+ prompt: colors.green('>> '),
22
22
  });
23
23
  const printIncoming = (text) => {
24
24
  readline.cursorTo(process.stdout, 0);
@@ -27,37 +27,37 @@ export async function startInteractiveWebSocket(url, headers) {
27
27
  rl.prompt(true);
28
28
  };
29
29
  ws.on('open', () => {
30
- printIncoming(pc.green('✔ Connected!'));
30
+ printIncoming(colors.green('✔ Connected!'));
31
31
  rl.prompt();
32
32
  });
33
33
  ws.on('close', (code, reason) => {
34
- printIncoming(pc.red(`✖ Disconnected (Code: ${code}${reason ? `, Reason: ${reason}` : ''})`));
34
+ printIncoming(colors.red(`✖ Disconnected (Code: ${code}${reason ? `, Reason: ${reason}` : ''})`));
35
35
  rl.close();
36
36
  process.exit(0);
37
37
  });
38
38
  ws.on('error', (err) => {
39
- printIncoming(pc.red(`⚠ Error: ${err.message}`));
39
+ printIncoming(colors.red(`⚠ Error: ${err.message}`));
40
40
  });
41
41
  ws.on('message', (msg) => {
42
42
  const content = msg.isBinary
43
- ? pc.yellow(`<Binary ${msg.data.length} bytes>`)
43
+ ? colors.yellow(`<Binary ${msg.data.length} bytes>`)
44
44
  : msg.data.toString();
45
- printIncoming(`${pc.cyan('<<')} ${content}`);
45
+ printIncoming(`${colors.cyan('<<')} ${content}`);
46
46
  });
47
47
  rl.on('line', (line) => {
48
48
  const input = line.trim();
49
49
  readline.moveCursor(process.stdout, 0, -1);
50
50
  readline.clearLine(process.stdout, 0);
51
- console.log(`${pc.green('>>')} ${input}`);
51
+ console.log(`${colors.green('>>')} ${input}`);
52
52
  if (input === '/quit' || input === '/exit') {
53
- console.log(pc.gray('Closing connection...'));
53
+ console.log(colors.gray('Closing connection...'));
54
54
  ws.close();
55
55
  rl.close();
56
56
  return;
57
57
  }
58
58
  if (input === '/ping') {
59
59
  ws.ping();
60
- console.log(pc.gray('(ping sent)'));
60
+ console.log(colors.gray('(ping sent)'));
61
61
  rl.prompt();
62
62
  return;
63
63
  }
@@ -66,11 +66,11 @@ export async function startInteractiveWebSocket(url, headers) {
66
66
  ws.send(input);
67
67
  }
68
68
  catch (err) {
69
- console.error(pc.red(`Failed to send: ${err.message}`));
69
+ console.error(colors.red(`Failed to send: ${err.message}`));
70
70
  }
71
71
  }
72
72
  else if (input && !ws.isConnected) {
73
- console.log(pc.yellow('Not connected.'));
73
+ console.log(colors.yellow('Not connected.'));
74
74
  }
75
75
  rl.prompt();
76
76
  });
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAgB,aAAa,EAAE,cAAc,EAAE,cAAc,EAAa,YAAY,EAAyC,UAAU,EAAmD,MAAM,mBAAmB,CAAC;AAIxP,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAStD,OAAO,EAAY,iBAAiB,EAAe,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAS,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAS,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAS,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAO1D,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAA4C,KAAK,YAAY,EAAE,KAAK,WA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AAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAclE,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlF;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,qBAA0B,UAE/D"}
@@ -2,7 +2,7 @@ import { consoleLogger } from '../types/index.js';
2
2
  import { HttpRequest } from './request.js';
3
3
  import { UndiciTransport } from '../transport/undici.js';
4
4
  import { RequestPromise } from './request-promise.js';
5
- import { HttpError, MaxSizeExceededError, ReckerError } from '../core/errors.js';
5
+ import { HttpError, MaxSizeExceededError, ConfigurationError, ValidationError, TimeoutError } from '../core/errors.js';
6
6
  import { processBody, createFormData, isPlainObject } from '../utils/body.js';
7
7
  import { AgentManager } from '../utils/agent-manager.js';
8
8
  import { RequestPool } from '../utils/request-pool.js';
@@ -94,11 +94,9 @@ export class Client {
94
94
  });
95
95
  }
96
96
  else {
97
- throw new ReckerError('baseUrl is required for default UndiciTransport, or provide a custom transport.', undefined, undefined, [
98
- 'Set baseUrl when using the built-in Undici transport.',
99
- 'Pass an absolute URL to each request.',
100
- 'Provide a custom transport if you need to handle relative paths differently.'
101
- ]);
97
+ throw new ConfigurationError('baseUrl is required for default UndiciTransport, or provide a custom transport.', {
98
+ configKey: 'baseUrl',
99
+ });
102
100
  }
103
101
  if (options.retry) {
104
102
  retry(options.retry)(this);
@@ -375,11 +373,10 @@ export class Client {
375
373
  usedParams.add(paramName);
376
374
  return encodeURIComponent(String(mergedParams[paramName]));
377
375
  }
378
- throw new ReckerError(`Missing required path parameter: ${paramName}`, undefined, undefined, [
379
- `Provide '${paramName}' in request params or defaults.`,
380
- 'Ensure the path template matches the provided params.',
381
- 'If optional, remove the placeholder from the path.'
382
- ]);
376
+ throw new ValidationError(`Missing required path parameter: ${paramName}`, {
377
+ field: paramName,
378
+ value: undefined,
379
+ });
383
380
  });
384
381
  }
385
382
  let finalUrl;
@@ -392,11 +389,9 @@ export class Client {
392
389
  finalUrl = base + p;
393
390
  }
394
391
  else {
395
- throw new ReckerError('Relative path provided without a baseUrl or explicit transport.', undefined, undefined, [
396
- 'Set baseUrl when creating the client.',
397
- 'Use an absolute URL in request().',
398
- 'Provide a custom transport that resolves relative paths.'
399
- ]);
392
+ throw new ConfigurationError('Relative path provided without a baseUrl or explicit transport.', {
393
+ configKey: 'baseUrl',
394
+ });
400
395
  }
401
396
  const remainingKeys = Object.keys(mergedParams).filter((k) => !usedParams.has(k));
402
397
  if (remainingKeys.length > 0) {
@@ -446,11 +441,10 @@ export class Client {
446
441
  if (timeout) {
447
442
  const totalTimeout = typeof timeout === 'number' ? timeout : timeout.request;
448
443
  if (totalTimeout) {
449
- timeoutId = setTimeout(() => controller.abort(new ReckerError('Request timed out (total timeout reached)', req, undefined, [
450
- 'Increase the timeout value for long-running requests.',
451
- 'Check upstream performance or network latency.',
452
- 'Use per-phase timeouts to pinpoint where the delay occurs.'
453
- ])), totalTimeout);
444
+ timeoutId = setTimeout(() => controller.abort(new TimeoutError(req, {
445
+ phase: 'request',
446
+ timeout: totalTimeout,
447
+ })), totalTimeout);
454
448
  }
455
449
  }
456
450
  }
@@ -645,11 +639,9 @@ export class Client {
645
639
  wsUrl = new URL(path, base).toString();
646
640
  }
647
641
  else {
648
- throw new ReckerError('WebSocket requires either a full ws:// URL or a baseUrl', undefined, undefined, [
649
- 'Pass a full ws:// or wss:// URL to websocket().',
650
- 'Configure baseUrl so relative websocket paths can be resolved.',
651
- 'Ensure the baseUrl uses http/https so it can be converted to ws/wss.'
652
- ]);
642
+ throw new ConfigurationError('WebSocket requires either a full ws:// URL or a baseUrl', {
643
+ configKey: 'baseUrl',
644
+ });
653
645
  }
654
646
  const headersObj = {};
655
647
  if (this.defaultHeaders) {
@@ -11,7 +11,7 @@ export declare class HttpError extends ReckerError {
11
11
  statusText: string;
12
12
  constructor(response: ReckerResponse, request?: ReckerRequest);
13
13
  }
14
- export type TimeoutPhase = 'lookup' | 'connect' | 'secureConnect' | 'socket' | 'send' | 'response' | 'request';
14
+ export type TimeoutPhase = 'lookup' | 'connect' | 'secureConnect' | 'socket' | 'send' | 'response' | 'request' | 'webrtc-connect';
15
15
  export declare class TimeoutError extends ReckerError {
16
16
  phase: TimeoutPhase;
17
17
  timeout: number;
@@ -32,4 +32,112 @@ export declare class MaxSizeExceededError extends ReckerError {
32
32
  actualSize?: number;
33
33
  constructor(maxSize: number, actualSize?: number, request?: ReckerRequest);
34
34
  }
35
+ export declare class AbortError extends ReckerError {
36
+ reason?: string;
37
+ constructor(reason?: string, request?: ReckerRequest);
38
+ }
39
+ export declare class ConnectionError extends ReckerError {
40
+ host?: string;
41
+ port?: number;
42
+ code?: string;
43
+ constructor(message: string, options?: {
44
+ host?: string;
45
+ port?: number;
46
+ code?: string;
47
+ retriable?: boolean;
48
+ request?: ReckerRequest;
49
+ });
50
+ }
51
+ export declare class AuthenticationError extends ReckerError {
52
+ authType?: string;
53
+ constructor(message: string, options?: {
54
+ authType?: string;
55
+ request?: ReckerRequest;
56
+ });
57
+ }
58
+ export declare class ProtocolError extends ReckerError {
59
+ protocol: string;
60
+ code?: string | number;
61
+ phase?: string;
62
+ constructor(message: string, options: {
63
+ protocol: string;
64
+ code?: string | number;
65
+ phase?: string;
66
+ retriable?: boolean;
67
+ request?: ReckerRequest;
68
+ });
69
+ }
70
+ export declare class NotFoundError extends ReckerError {
71
+ resource?: string;
72
+ constructor(message: string, options?: {
73
+ resource?: string;
74
+ request?: ReckerRequest;
75
+ });
76
+ }
77
+ export declare class StateError extends ReckerError {
78
+ expectedState?: string;
79
+ actualState?: string;
80
+ constructor(message: string, options?: {
81
+ expectedState?: string;
82
+ actualState?: string;
83
+ request?: ReckerRequest;
84
+ });
85
+ }
86
+ export declare class ValidationError extends ReckerError {
87
+ field?: string;
88
+ value?: unknown;
89
+ constructor(message: string, options?: {
90
+ field?: string;
91
+ value?: unknown;
92
+ request?: ReckerRequest;
93
+ });
94
+ }
95
+ export declare class ConfigurationError extends ReckerError {
96
+ configKey?: string;
97
+ constructor(message: string, options?: {
98
+ configKey?: string;
99
+ request?: ReckerRequest;
100
+ });
101
+ }
102
+ export declare class UnsupportedError extends ReckerError {
103
+ feature?: string;
104
+ constructor(message: string, options?: {
105
+ feature?: string;
106
+ request?: ReckerRequest;
107
+ });
108
+ }
109
+ export declare class ParseError extends ReckerError {
110
+ format?: string;
111
+ position?: number;
112
+ constructor(message: string, options?: {
113
+ format?: string;
114
+ position?: number;
115
+ request?: ReckerRequest;
116
+ });
117
+ }
118
+ export declare class QueueCancelledError extends ReckerError {
119
+ queueName?: string;
120
+ constructor(message?: string, options?: {
121
+ queueName?: string;
122
+ request?: ReckerRequest;
123
+ });
124
+ }
125
+ export declare class StreamError extends ReckerError {
126
+ streamType?: string;
127
+ constructor(message: string, options?: {
128
+ streamType?: string;
129
+ retriable?: boolean;
130
+ request?: ReckerRequest;
131
+ });
132
+ }
133
+ export declare class DownloadError extends ReckerError {
134
+ url?: string;
135
+ statusCode?: number;
136
+ constructor(message: string, options?: {
137
+ url?: string;
138
+ statusCode?: number;
139
+ retriable?: boolean;
140
+ request?: ReckerRequest;
141
+ });
142
+ }
35
143
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAElE,qBAAa,WAAY,SAAQ,KAAK;IACpC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;gBAGjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa,EACvB,QAAQ,CAAC,EAAE,cAAc,EACzB,WAAW,GAAE,MAAM,EAAO,EAC1B,SAAS,U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AE,aAAa,CAAC;KACzB;CAiBJ;AAKD,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;gBAGjB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB;CAgBJ;AAKD,qBAAa,WAAY,SAAQ,WAAW;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;gBAGlB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB;CAgBJ;AAKD,qBAAa,aAAc,SAAQ,WAAW;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;gBAGlB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB;CAmBJ"}
@@ -38,7 +38,8 @@ export class TimeoutError extends ReckerError {
38
38
  socket: 'Socket assignment timed out (connection pool exhausted)',
39
39
  send: 'Request body upload timed out',
40
40
  response: 'Waiting for response timed out (TTFB)',
41
- request: 'Request timed out (total time exceeded)'
41
+ request: 'Request timed out (total time exceeded)',
42
+ 'webrtc-connect': 'WebRTC peer connection timed out'
42
43
  };
43
44
  let message = phaseMessages[phase];
44
45
  if (timeout !== undefined) {
@@ -93,3 +94,215 @@ export class MaxSizeExceededError extends ReckerError {
93
94
  function isRetryableStatus(status) {
94
95
  return [408, 425, 429, 500, 502, 503, 504].includes(status);
95
96
  }
97
+ export class AbortError extends ReckerError {
98
+ reason;
99
+ constructor(reason, request) {
100
+ super(reason || 'Request was aborted', request, undefined, [
101
+ 'Check if the abort was intentional (user-triggered or timeout).',
102
+ 'Increase timeout if the request needs more time to complete.',
103
+ 'Ensure AbortController is not being triggered prematurely.'
104
+ ], true);
105
+ this.name = 'AbortError';
106
+ this.reason = reason;
107
+ }
108
+ }
109
+ export class ConnectionError extends ReckerError {
110
+ host;
111
+ port;
112
+ code;
113
+ constructor(message, options) {
114
+ super(message, options?.request, undefined, [
115
+ 'Verify the host and port are correct and the service is running.',
116
+ 'Check network connectivity and firewall rules.',
117
+ 'Ensure the service is accepting connections on the specified port.'
118
+ ], options?.retriable ?? true);
119
+ this.name = 'ConnectionError';
120
+ this.host = options?.host;
121
+ this.port = options?.port;
122
+ this.code = options?.code;
123
+ }
124
+ }
125
+ export class AuthenticationError extends ReckerError {
126
+ authType;
127
+ constructor(message, options) {
128
+ super(message, options?.request, undefined, [
129
+ 'Verify credentials (username/password, API key, or certificate).',
130
+ 'Check if the account is active and has proper permissions.',
131
+ 'Ensure the authentication method matches what the server expects.'
132
+ ], false);
133
+ this.name = 'AuthenticationError';
134
+ this.authType = options?.authType;
135
+ }
136
+ }
137
+ export class ProtocolError extends ReckerError {
138
+ protocol;
139
+ code;
140
+ phase;
141
+ constructor(message, options) {
142
+ const protocolSuggestions = {
143
+ ftp: [
144
+ 'Ensure the FTP server is running and accessible.',
145
+ 'Check file/directory permissions on the server.',
146
+ 'Verify the path exists and is correct.'
147
+ ],
148
+ sftp: [
149
+ 'Verify SSH credentials and key permissions.',
150
+ 'Check that the SFTP subsystem is enabled on the server.',
151
+ 'Ensure the target path exists and is accessible.'
152
+ ],
153
+ telnet: [
154
+ 'Verify the Telnet service is running on the target host.',
155
+ 'Check login credentials and terminal settings.',
156
+ 'Ensure the expected prompts match the server output.'
157
+ ],
158
+ udp: [
159
+ 'UDP is connectionless - verify the target is listening.',
160
+ 'Check firewall rules for UDP traffic.',
161
+ 'Ensure the message format matches what the server expects.'
162
+ ],
163
+ webrtc: [
164
+ 'Verify the signaling server is reachable.',
165
+ 'Check ICE server configuration (STUN/TURN).',
166
+ 'Ensure both peers have compatible codecs and capabilities.'
167
+ ],
168
+ dns: [
169
+ 'Verify the DNS server is reachable.',
170
+ 'Check if the domain exists and has the requested record type.',
171
+ 'Try an alternative DNS resolver.'
172
+ ],
173
+ tls: [
174
+ 'Verify the certificate is valid and not expired.',
175
+ 'Check that the hostname matches the certificate.',
176
+ 'Ensure TLS version and cipher suites are compatible.'
177
+ ]
178
+ };
179
+ const suggestions = protocolSuggestions[options.protocol.toLowerCase()] || [
180
+ 'Check the protocol-specific documentation.',
181
+ 'Verify the server supports the requested operation.',
182
+ 'Review the error code for specific guidance.'
183
+ ];
184
+ super(message, options.request, undefined, suggestions, options.retriable ?? false);
185
+ this.name = 'ProtocolError';
186
+ this.protocol = options.protocol;
187
+ this.code = options.code;
188
+ this.phase = options.phase;
189
+ }
190
+ }
191
+ export class NotFoundError extends ReckerError {
192
+ resource;
193
+ constructor(message, options) {
194
+ super(message, options?.request, undefined, [
195
+ 'Verify the resource path or identifier is correct.',
196
+ 'Check if the resource was deleted or moved.',
197
+ 'Ensure you have permission to access this resource.'
198
+ ], false);
199
+ this.name = 'NotFoundError';
200
+ this.resource = options?.resource;
201
+ }
202
+ }
203
+ export class StateError extends ReckerError {
204
+ expectedState;
205
+ actualState;
206
+ constructor(message, options) {
207
+ super(message, options?.request, undefined, [
208
+ 'Ensure the required setup/initialization step was performed.',
209
+ 'Check that operations are called in the correct order.',
210
+ 'Verify the connection or resource is still valid.'
211
+ ], false);
212
+ this.name = 'StateError';
213
+ this.expectedState = options?.expectedState;
214
+ this.actualState = options?.actualState;
215
+ }
216
+ }
217
+ export class ValidationError extends ReckerError {
218
+ field;
219
+ value;
220
+ constructor(message, options) {
221
+ super(message, options?.request, undefined, [
222
+ 'Check the input format and constraints.',
223
+ 'Refer to the API documentation for valid values.',
224
+ 'Ensure required fields are provided.'
225
+ ], false);
226
+ this.name = 'ValidationError';
227
+ this.field = options?.field;
228
+ this.value = options?.value;
229
+ }
230
+ }
231
+ export class ConfigurationError extends ReckerError {
232
+ configKey;
233
+ constructor(message, options) {
234
+ super(message, options?.request, undefined, [
235
+ 'Check the configuration file or environment variables.',
236
+ 'Ensure all required configuration keys are set.',
237
+ 'Verify the configuration values are in the correct format.'
238
+ ], false);
239
+ this.name = 'ConfigurationError';
240
+ this.configKey = options?.configKey;
241
+ }
242
+ }
243
+ export class UnsupportedError extends ReckerError {
244
+ feature;
245
+ constructor(message, options) {
246
+ super(message, options?.request, undefined, [
247
+ 'Check if this feature is supported in the current context.',
248
+ 'Refer to the documentation for supported operations.',
249
+ 'Consider using an alternative approach.'
250
+ ], false);
251
+ this.name = 'UnsupportedError';
252
+ this.feature = options?.feature;
253
+ }
254
+ }
255
+ export class ParseError extends ReckerError {
256
+ format;
257
+ position;
258
+ constructor(message, options) {
259
+ super(message, options?.request, undefined, [
260
+ 'Verify the input is in the expected format.',
261
+ 'Check for malformed or corrupted data.',
262
+ 'Ensure the encoding is correct (UTF-8, etc.).'
263
+ ], false);
264
+ this.name = 'ParseError';
265
+ this.format = options?.format;
266
+ this.position = options?.position;
267
+ }
268
+ }
269
+ export class QueueCancelledError extends ReckerError {
270
+ queueName;
271
+ constructor(message, options) {
272
+ super(message || 'Queue operation was cancelled', options?.request, undefined, [
273
+ 'This is typically expected during shutdown.',
274
+ 'Check if the queue was manually cleared.',
275
+ 'Retry the operation if the queue is still active.'
276
+ ], true);
277
+ this.name = 'QueueCancelledError';
278
+ this.queueName = options?.queueName;
279
+ }
280
+ }
281
+ export class StreamError extends ReckerError {
282
+ streamType;
283
+ constructor(message, options) {
284
+ super(message, options?.request, undefined, [
285
+ 'Check if the stream was prematurely closed.',
286
+ 'Verify the data source is still available.',
287
+ 'Ensure proper error handling for stream events.'
288
+ ], options?.retriable ?? false);
289
+ this.name = 'StreamError';
290
+ this.streamType = options?.streamType;
291
+ }
292
+ }
293
+ export class DownloadError extends ReckerError {
294
+ url;
295
+ statusCode;
296
+ constructor(message, options) {
297
+ super(message, options?.request, undefined, [
298
+ 'Verify the URL is correct and accessible.',
299
+ 'Check network connectivity.',
300
+ options?.statusCode
301
+ ? `HTTP ${options.statusCode} - check server response.`
302
+ : 'Retry the download if the error is transient.'
303
+ ], options?.retriable ?? true);
304
+ this.name = 'DownloadError';
305
+ this.url = options?.url;
306
+ this.statusCode = options?.statusCode;
307
+ }
308
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"request-promise.d.ts","sourceRoot":"","sources":["../../src/core/request-promise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAOrC,qBAAa,cAAc,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAkB;gBAE9B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe;IAKlF,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,WAEvB;IAED,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,EACjD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,EACrF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,GACtE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAI/B,KAAK,CAAC,OAAO,GAAG,KAAK,EACnB,UAAU,CAAC,EAAE,C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IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAKlD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBlC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAK1C,IAAI,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;IAKtD,GAAG,IAAI,cAAc,CAAC,QAAQ,CAAC;IAK/B,QAAQ,IAAI,cAAc,CAAC,aAAa,CAAC;IAKzC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;CAI5D"}
@@ -2,7 +2,7 @@ import { createWriteStream } from 'node:fs';
2
2
  import { pipeline } from 'node:stream/promises';
3
3
  import { Readable } from 'node:stream';
4
4
  import { tryFn } from '../utils/try-fn.js';
5
- import { ReckerError } from './errors.js';
5
+ import { StreamError } from './errors.js';
6
6
  export class RequestPromise {
7
7
  promise;
8
8
  abortController;
@@ -51,11 +51,10 @@ export class RequestPromise {
51
51
  const response = await this.promise;
52
52
  const body = response.read();
53
53
  if (!body) {
54
- throw new ReckerError('Response has no body to write', undefined, response, [
55
- 'Ensure the request returned a body (avoid HEAD/204).',
56
- 'Check if the request was aborted before the body streamed.',
57
- 'Verify upstream is not sending an empty response.'
58
- ]);
54
+ throw new StreamError('Response has no body to write', {
55
+ streamType: 'response',
56
+ retriable: true,
57
+ });
59
58
  }
60
59
  const nodeStream = Readable.fromWeb(body);
61
60
  const fileStream = createWriteStream(path);
@@ -1 +1 @@
1
- {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/core/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrG,O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AgB,GAAG,IAAI;IAOhC,IAAI,UAAU,IAAI,UAAU,CAE3B;IAEK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC;IAIzB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAK5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,IAAI,IAAI,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI;IAqBzC,YAAY,IAAI,QAAQ,GAAG,IAAI;IAmBzB,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7D,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC;IAO1B,GAAG,IAAI,cAAc,CAAC,QAAQ,CAAC;IAgBxB,QAAQ,IAAI,cAAc,CAAC,aAAa,CAAC;IA2EzC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC;CAe5D"}
@@ -3,7 +3,7 @@ import { cleanHtml } from '../utils/html-cleaner.js';
3
3
  import { webToNodeStream } from '../utils/streaming.js';
4
4
  import { parseHeaders } from '../utils/header-parser.js';
5
5
  import { parseLinkHeader } from '../utils/link-header.js';
6
- import { ReckerError } from './errors.js';
6
+ import { StreamError } from './errors.js';
7
7
  export class HttpResponse {
8
8
  timings;
9
9
  connection;
@@ -74,11 +74,10 @@ export class HttpResponse {
74
74
  async pipe(destination) {
75
75
  const nodeStream = this.toNodeStream();
76
76
  if (!nodeStream) {
77
- throw new ReckerError('Response has no body to pipe', undefined, this, [
78
- 'Ensure the request method returns a body (e.g., not HEAD).',
79
- 'Check the upstream response status and headers.',
80
- 'Verify the request was not aborted before receiving a body.'
81
- ]);
77
+ throw new StreamError('Response has no body to pipe', {
78
+ streamType: 'response',
79
+ retriable: true,
80
+ });
82
81
  }
83
82
  return new Promise((resolve, reject) => {
84
83
  nodeStream.pipe(destination);
@@ -13,7 +13,9 @@ export interface PropagationResult {
13
13
  latency: number;
14
14
  error?: string;
15
15
  location?: string;
16
+ minTTL?: number;
16
17
  }
17
- export declare function checkPropagation(domain: string, type?: string): Promise<PropagationResult[]>;
18
+ export declare function getTypeName(typeId: number): string;
19
+ export declare function checkPropagation(domainInput: string, type?: string): Promise<PropagationResult[]>;
18
20
  export declare function formatPropagationReport(results: PropagationResult[], domain: string, type: string): string;
19
21
  //# sourceMappingURL=propagation.d.ts.map