recker 1.0.2-0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -2
- package/README.md +121 -72
- package/dist/cache/memory-storage.d.ts.map +1 -1
- package/dist/cache/memory-storage.js +7 -1
- package/dist/constants/http-status.d.ts +74 -0
- package/dist/constants/http-status.d.ts.map +1 -0
- package/dist/constants/http-status.js +156 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -6
- package/dist/cookies/memory-cookie-jar.d.ts +31 -0
- package/dist/cookies/memory-cookie-jar.d.ts.map +1 -0
- package/dist/cookies/memory-cookie-jar.js +210 -0
- package/dist/core/client.d.ts +9 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +252 -53
- package/dist/core/errors.d.ts +18 -2
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +66 -5
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +5 -0
- package/dist/core/request-promise.d.ts.map +1 -1
- package/dist/core/request-promise.js +8 -2
- package/dist/core/request.d.ts +7 -1
- package/dist/core/request.d.ts.map +1 -1
- package/dist/core/request.js +32 -0
- package/dist/core/response.d.ts +2 -0
- package/dist/core/response.d.ts.map +1 -1
- package/dist/core/response.js +44 -19
- package/dist/events/request-events.d.ts +48 -0
- package/dist/events/request-events.d.ts.map +1 -0
- package/dist/events/request-events.js +85 -0
- package/dist/index.d.ts +28 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -2
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +16 -5
- package/dist/mcp/contract.d.ts +77 -0
- package/dist/mcp/contract.d.ts.map +1 -0
- package/dist/mcp/contract.js +278 -0
- package/dist/mcp/types.d.ts +1 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/plugins/auth.d.ts +45 -0
- package/dist/plugins/auth.d.ts.map +1 -0
- package/dist/plugins/auth.js +268 -0
- package/dist/plugins/cache.d.ts +7 -1
- package/dist/plugins/cache.d.ts.map +1 -1
- package/dist/plugins/cache.js +470 -49
- package/dist/plugins/circuit-breaker.js +1 -1
- package/dist/plugins/compression.d.ts.map +1 -1
- package/dist/plugins/compression.js +3 -3
- package/dist/plugins/dedup.d.ts.map +1 -1
- package/dist/plugins/dedup.js +2 -1
- package/dist/plugins/graphql.d.ts +4 -3
- package/dist/plugins/graphql.d.ts.map +1 -1
- package/dist/plugins/graphql.js +24 -5
- package/dist/plugins/grpc-web.d.ts +80 -0
- package/dist/plugins/grpc-web.d.ts.map +1 -0
- package/dist/plugins/grpc-web.js +261 -0
- package/dist/plugins/har-player.d.ts.map +1 -1
- package/dist/plugins/har-player.js +11 -2
- package/dist/plugins/hls.d.ts +33 -0
- package/dist/plugins/hls.d.ts.map +1 -0
- package/dist/plugins/hls.js +225 -0
- package/dist/plugins/http2-push.d.ts +64 -0
- package/dist/plugins/http2-push.d.ts.map +1 -0
- package/dist/plugins/http2-push.js +274 -0
- package/dist/plugins/http3.d.ts +76 -0
- package/dist/plugins/http3.d.ts.map +1 -0
- package/dist/plugins/http3.js +231 -0
- package/dist/plugins/interface-rotator.d.ts +10 -0
- package/dist/plugins/interface-rotator.d.ts.map +1 -0
- package/dist/plugins/interface-rotator.js +57 -0
- package/dist/plugins/jsonrpc.d.ts +76 -0
- package/dist/plugins/jsonrpc.d.ts.map +1 -0
- package/dist/plugins/jsonrpc.js +143 -0
- package/dist/plugins/logger.d.ts +8 -5
- package/dist/plugins/logger.d.ts.map +1 -1
- package/dist/plugins/logger.js +66 -30
- package/dist/plugins/odata.d.ts +182 -0
- package/dist/plugins/odata.d.ts.map +1 -0
- package/dist/plugins/odata.js +561 -0
- package/dist/plugins/retry.d.ts +1 -0
- package/dist/plugins/retry.d.ts.map +1 -1
- package/dist/plugins/retry.js +26 -2
- package/dist/plugins/scrape.d.ts +22 -0
- package/dist/plugins/scrape.d.ts.map +1 -0
- package/dist/plugins/scrape.js +87 -0
- package/dist/plugins/soap.d.ts +73 -0
- package/dist/plugins/soap.d.ts.map +1 -0
- package/dist/plugins/soap.js +347 -0
- package/dist/plugins/user-agent.d.ts +8 -0
- package/dist/plugins/user-agent.d.ts.map +1 -0
- package/dist/plugins/user-agent.js +46 -0
- package/dist/plugins/xml.d.ts +10 -0
- package/dist/plugins/xml.d.ts.map +1 -0
- package/dist/plugins/xml.js +194 -0
- package/dist/presets/anthropic.d.ts +7 -0
- package/dist/presets/anthropic.d.ts.map +1 -0
- package/dist/presets/anthropic.js +17 -0
- package/dist/presets/azure-openai.d.ts +9 -0
- package/dist/presets/azure-openai.d.ts.map +1 -0
- package/dist/presets/azure-openai.js +25 -0
- package/dist/presets/cloudflare.d.ts +13 -0
- package/dist/presets/cloudflare.d.ts.map +1 -0
- package/dist/presets/cloudflare.js +39 -0
- package/dist/presets/cohere.d.ts +6 -0
- package/dist/presets/cohere.d.ts.map +1 -0
- package/dist/presets/cohere.js +16 -0
- package/dist/presets/deepseek.d.ts +6 -0
- package/dist/presets/deepseek.d.ts.map +1 -0
- package/dist/presets/deepseek.js +16 -0
- package/dist/presets/digitalocean.d.ts +6 -0
- package/dist/presets/digitalocean.d.ts.map +1 -0
- package/dist/presets/digitalocean.js +16 -0
- package/dist/presets/discord.d.ts +7 -0
- package/dist/presets/discord.d.ts.map +1 -0
- package/dist/presets/discord.js +17 -0
- package/dist/presets/fireworks.d.ts +6 -0
- package/dist/presets/fireworks.d.ts.map +1 -0
- package/dist/presets/fireworks.js +16 -0
- package/dist/presets/gemini.d.ts +6 -0
- package/dist/presets/gemini.d.ts.map +1 -0
- package/dist/presets/gemini.js +16 -0
- package/dist/presets/github.d.ts +7 -0
- package/dist/presets/github.d.ts.map +1 -0
- package/dist/presets/github.js +17 -0
- package/dist/presets/gitlab.d.ts +7 -0
- package/dist/presets/gitlab.d.ts.map +1 -0
- package/dist/presets/gitlab.js +16 -0
- package/dist/presets/groq.d.ts +6 -0
- package/dist/presets/groq.d.ts.map +1 -0
- package/dist/presets/groq.js +16 -0
- package/dist/presets/huggingface.d.ts +6 -0
- package/dist/presets/huggingface.d.ts.map +1 -0
- package/dist/presets/huggingface.js +16 -0
- package/dist/presets/index.d.ts +28 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +27 -0
- package/dist/presets/linear.d.ts +6 -0
- package/dist/presets/linear.d.ts.map +1 -0
- package/dist/presets/linear.js +16 -0
- package/dist/presets/mistral.d.ts +6 -0
- package/dist/presets/mistral.d.ts.map +1 -0
- package/dist/presets/mistral.js +16 -0
- package/dist/presets/notion.d.ts +7 -0
- package/dist/presets/notion.d.ts.map +1 -0
- package/dist/presets/notion.js +17 -0
- package/dist/presets/openai.d.ts +8 -0
- package/dist/presets/openai.d.ts.map +1 -0
- package/dist/presets/openai.js +23 -0
- package/dist/presets/perplexity.d.ts +6 -0
- package/dist/presets/perplexity.d.ts.map +1 -0
- package/dist/presets/perplexity.js +16 -0
- package/dist/presets/registry.d.ts +20 -0
- package/dist/presets/registry.d.ts.map +1 -0
- package/dist/presets/registry.js +311 -0
- package/dist/presets/replicate.d.ts +6 -0
- package/dist/presets/replicate.d.ts.map +1 -0
- package/dist/presets/replicate.js +16 -0
- package/dist/presets/slack.d.ts +6 -0
- package/dist/presets/slack.d.ts.map +1 -0
- package/dist/presets/slack.js +16 -0
- package/dist/presets/stripe.d.ts +8 -0
- package/dist/presets/stripe.d.ts.map +1 -0
- package/dist/presets/stripe.js +23 -0
- package/dist/presets/supabase.d.ts +7 -0
- package/dist/presets/supabase.d.ts.map +1 -0
- package/dist/presets/supabase.js +18 -0
- package/dist/presets/together.d.ts +6 -0
- package/dist/presets/together.d.ts.map +1 -0
- package/dist/presets/together.js +16 -0
- package/dist/presets/twilio.d.ts +7 -0
- package/dist/presets/twilio.d.ts.map +1 -0
- package/dist/presets/twilio.js +17 -0
- package/dist/presets/vercel.d.ts +7 -0
- package/dist/presets/vercel.d.ts.map +1 -0
- package/dist/presets/vercel.js +23 -0
- package/dist/presets/xai.d.ts +7 -0
- package/dist/presets/xai.d.ts.map +1 -0
- package/dist/presets/xai.js +17 -0
- package/dist/protocols/ftp.d.ts +63 -0
- package/dist/protocols/ftp.d.ts.map +1 -0
- package/dist/protocols/ftp.js +388 -0
- package/dist/protocols/index.d.ts +4 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/sftp.d.ts +65 -0
- package/dist/protocols/sftp.d.ts.map +1 -0
- package/dist/protocols/sftp.js +346 -0
- package/dist/protocols/telnet.d.ts +50 -0
- package/dist/protocols/telnet.d.ts.map +1 -0
- package/dist/protocols/telnet.js +139 -0
- package/dist/runner/request-runner.d.ts.map +1 -1
- package/dist/runner/request-runner.js +1 -0
- package/dist/scrape/document.d.ts +44 -0
- package/dist/scrape/document.d.ts.map +1 -0
- package/dist/scrape/document.js +198 -0
- package/dist/scrape/element.d.ts +50 -0
- package/dist/scrape/element.d.ts.map +1 -0
- package/dist/scrape/element.js +176 -0
- package/dist/scrape/extractors.d.ts +17 -0
- package/dist/scrape/extractors.d.ts.map +1 -0
- package/dist/scrape/extractors.js +356 -0
- package/dist/scrape/index.d.ts +5 -0
- package/dist/scrape/index.d.ts.map +1 -0
- package/dist/scrape/index.js +3 -0
- package/dist/scrape/types.d.ts +108 -0
- package/dist/scrape/types.d.ts.map +1 -0
- package/dist/scrape/types.js +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/dist/testing/mock.d.ts +58 -0
- package/dist/testing/mock.d.ts.map +1 -0
- package/dist/testing/mock.js +252 -0
- package/dist/transport/fetch.d.ts.map +1 -1
- package/dist/transport/fetch.js +12 -4
- package/dist/transport/undici.d.ts +17 -1
- package/dist/transport/undici.d.ts.map +1 -1
- package/dist/transport/undici.js +708 -47
- package/dist/types/index.d.ts +111 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/logger.d.ts +17 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/logger.js +66 -0
- package/dist/utils/agent-manager.d.ts.map +1 -1
- package/dist/utils/agent-manager.js +20 -4
- package/dist/utils/body.d.ts.map +1 -1
- package/dist/utils/body.js +14 -2
- package/dist/utils/charset.d.ts +16 -0
- package/dist/utils/charset.d.ts.map +1 -0
- package/dist/utils/charset.js +169 -0
- package/dist/utils/client-pool.d.ts +21 -0
- package/dist/utils/client-pool.d.ts.map +1 -0
- package/dist/utils/client-pool.js +49 -0
- package/dist/utils/concurrency.d.ts.map +1 -1
- package/dist/utils/concurrency.js +8 -4
- package/dist/utils/dns-toolkit.d.ts +13 -0
- package/dist/utils/dns-toolkit.d.ts.map +1 -0
- package/dist/utils/dns-toolkit.js +48 -0
- package/dist/utils/doh.d.ts.map +1 -1
- package/dist/utils/doh.js +16 -3
- package/dist/utils/download.d.ts +15 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/download.js +44 -0
- package/dist/utils/env-proxy.d.ts +13 -0
- package/dist/utils/env-proxy.d.ts.map +1 -0
- package/dist/utils/env-proxy.js +105 -0
- package/dist/utils/header-parser.d.ts +15 -1
- package/dist/utils/header-parser.d.ts.map +1 -1
- package/dist/utils/header-parser.js +161 -1
- package/dist/utils/link-header.d.ts +70 -0
- package/dist/utils/link-header.d.ts.map +1 -0
- package/dist/utils/link-header.js +190 -0
- package/dist/utils/progress.d.ts +7 -2
- package/dist/utils/progress.d.ts.map +1 -1
- package/dist/utils/progress.js +48 -15
- package/dist/utils/rdap.d.ts +17 -0
- package/dist/utils/rdap.d.ts.map +1 -0
- package/dist/utils/rdap.js +32 -0
- package/dist/utils/request-pool.d.ts.map +1 -1
- package/dist/utils/request-pool.js +4 -3
- package/dist/utils/sse.d.ts.map +1 -1
- package/dist/utils/sse.js +8 -2
- package/dist/utils/status-codes.d.ts +84 -0
- package/dist/utils/status-codes.d.ts.map +1 -0
- package/dist/utils/status-codes.js +204 -0
- package/dist/utils/streaming.d.ts.map +1 -1
- package/dist/utils/streaming.js +1 -0
- package/dist/utils/tls-inspector.d.ts +21 -0
- package/dist/utils/tls-inspector.d.ts.map +1 -0
- package/dist/utils/tls-inspector.js +39 -0
- package/dist/utils/try-fn.d.ts.map +1 -1
- package/dist/utils/try-fn.js +11 -5
- package/dist/utils/upload.d.ts +1 -0
- package/dist/utils/upload.d.ts.map +1 -1
- package/dist/utils/upload.js +20 -3
- package/dist/utils/user-agent.d.ts +9 -9
- package/dist/utils/user-agent.js +9 -9
- package/dist/utils/whois.d.ts.map +1 -1
- package/dist/utils/whois.js +11 -2
- package/dist/websocket/client.d.ts +29 -1
- package/dist/websocket/client.d.ts.map +1 -1
- package/dist/websocket/client.js +145 -13
- package/package.json +45 -8
package/dist/core/request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Method, ReckerRequest, RequestOptions, ProgressCallback } from '../types/index.js';
|
|
1
|
+
import { Method, ReckerRequest, RequestOptions, ProgressCallback, TimeoutOptions, RedirectInfo } from '../types/index.js';
|
|
2
2
|
export declare class HttpRequest implements ReckerRequest {
|
|
3
3
|
readonly url: string;
|
|
4
4
|
readonly method: Method;
|
|
@@ -6,8 +6,14 @@ export declare class HttpRequest implements ReckerRequest {
|
|
|
6
6
|
readonly body: BodyInit | null;
|
|
7
7
|
readonly signal?: AbortSignal;
|
|
8
8
|
readonly throwHttpErrors?: boolean;
|
|
9
|
+
readonly timeout?: TimeoutOptions;
|
|
9
10
|
readonly onUploadProgress?: ProgressCallback;
|
|
10
11
|
readonly onDownloadProgress?: ProgressCallback;
|
|
12
|
+
readonly maxResponseSize?: number;
|
|
13
|
+
readonly beforeRedirect?: (info: RedirectInfo) => void | false | string | Promise<void | false | string>;
|
|
14
|
+
readonly maxRedirects?: number;
|
|
15
|
+
readonly followRedirects?: boolean;
|
|
16
|
+
readonly http2?: boolean;
|
|
11
17
|
constructor(url: string, options?: RequestOptions);
|
|
12
18
|
withHeader(name: string, value: string): ReckerRequest;
|
|
13
19
|
withBody(body: BodyInit): ReckerRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/core/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/core/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAa1H,qBAAa,WAAY,YAAW,aAAa;IAC/C,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtC,SAAgB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrC,SAAgB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1C,SAAgB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzC,SAAgB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpD,SAAgB,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtD,SAAgB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzC,SAAgB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;IAChH,SAAgB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtC,SAAgB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1C,SAAgB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEpB,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB;IAiBrD,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa;IAoBtD,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa;CAiBxC"}
|
package/dist/core/request.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function normalizeTimeout(timeout) {
|
|
2
|
+
if (timeout === undefined)
|
|
3
|
+
return undefined;
|
|
4
|
+
if (typeof timeout === 'number') {
|
|
5
|
+
return { request: timeout };
|
|
6
|
+
}
|
|
7
|
+
return timeout;
|
|
8
|
+
}
|
|
1
9
|
export class HttpRequest {
|
|
2
10
|
url;
|
|
3
11
|
method;
|
|
@@ -5,8 +13,14 @@ export class HttpRequest {
|
|
|
5
13
|
body;
|
|
6
14
|
signal;
|
|
7
15
|
throwHttpErrors;
|
|
16
|
+
timeout;
|
|
8
17
|
onUploadProgress;
|
|
9
18
|
onDownloadProgress;
|
|
19
|
+
maxResponseSize;
|
|
20
|
+
beforeRedirect;
|
|
21
|
+
maxRedirects;
|
|
22
|
+
followRedirects;
|
|
23
|
+
http2;
|
|
10
24
|
constructor(url, options = {}) {
|
|
11
25
|
this.url = url;
|
|
12
26
|
this.method = options.method || 'GET';
|
|
@@ -14,8 +28,14 @@ export class HttpRequest {
|
|
|
14
28
|
this.body = options.body || null;
|
|
15
29
|
this.signal = options.signal;
|
|
16
30
|
this.throwHttpErrors = options.throwHttpErrors !== undefined ? options.throwHttpErrors : true;
|
|
31
|
+
this.timeout = normalizeTimeout(options.timeout);
|
|
17
32
|
this.onUploadProgress = options.onUploadProgress;
|
|
18
33
|
this.onDownloadProgress = options.onDownloadProgress;
|
|
34
|
+
this.maxResponseSize = options.maxResponseSize;
|
|
35
|
+
this.beforeRedirect = options.beforeRedirect;
|
|
36
|
+
this.maxRedirects = options.maxRedirects;
|
|
37
|
+
this.followRedirects = options.followRedirects;
|
|
38
|
+
this.http2 = options.http2;
|
|
19
39
|
}
|
|
20
40
|
withHeader(name, value) {
|
|
21
41
|
const newHeaders = new Headers(this.headers);
|
|
@@ -26,8 +46,14 @@ export class HttpRequest {
|
|
|
26
46
|
body: this.body,
|
|
27
47
|
signal: this.signal,
|
|
28
48
|
throwHttpErrors: this.throwHttpErrors,
|
|
49
|
+
timeout: this.timeout,
|
|
29
50
|
onUploadProgress: this.onUploadProgress,
|
|
30
51
|
onDownloadProgress: this.onDownloadProgress,
|
|
52
|
+
maxResponseSize: this.maxResponseSize,
|
|
53
|
+
beforeRedirect: this.beforeRedirect,
|
|
54
|
+
maxRedirects: this.maxRedirects,
|
|
55
|
+
followRedirects: this.followRedirects,
|
|
56
|
+
http2: this.http2,
|
|
31
57
|
});
|
|
32
58
|
}
|
|
33
59
|
withBody(body) {
|
|
@@ -37,8 +63,14 @@ export class HttpRequest {
|
|
|
37
63
|
body: body,
|
|
38
64
|
signal: this.signal,
|
|
39
65
|
throwHttpErrors: this.throwHttpErrors,
|
|
66
|
+
timeout: this.timeout,
|
|
40
67
|
onUploadProgress: this.onUploadProgress,
|
|
41
68
|
onDownloadProgress: this.onDownloadProgress,
|
|
69
|
+
maxResponseSize: this.maxResponseSize,
|
|
70
|
+
beforeRedirect: this.beforeRedirect,
|
|
71
|
+
maxRedirects: this.maxRedirects,
|
|
72
|
+
followRedirects: this.followRedirects,
|
|
73
|
+
http2: this.http2,
|
|
42
74
|
});
|
|
43
75
|
}
|
|
44
76
|
}
|
package/dist/core/response.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConnectionInfo, ReckerResponse, Timings, SSEEvent, ProgressEvent } from '../types/index.js';
|
|
2
2
|
import { Dispatcher } from 'undici';
|
|
3
3
|
import { type HeaderInfo, type CacheInfo, type RateLimitInfo } from '../utils/header-parser.js';
|
|
4
|
+
import { type LinkHeaderParser } from '../utils/link-header.js';
|
|
4
5
|
import type { Readable } from 'node:stream';
|
|
5
6
|
export declare class HttpResponse<T = unknown> implements ReckerResponse<T> {
|
|
6
7
|
readonly timings?: Timings;
|
|
@@ -17,6 +18,7 @@ export declare class HttpResponse<T = unknown> implements ReckerResponse<T> {
|
|
|
17
18
|
get url(): string;
|
|
18
19
|
get cache(): CacheInfo;
|
|
19
20
|
get rateLimit(): RateLimitInfo;
|
|
21
|
+
links(): LinkHeaderParser | null;
|
|
20
22
|
get headerInfo(): HeaderInfo;
|
|
21
23
|
json<R = T>(): Promise<R>;
|
|
22
24
|
text(): Promise<string>;
|
|
@@ -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,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAKpC,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
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,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAKpC,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC9G,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,qBAAa,YAAY,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,cAAc,CAAC,CAAC,CAAC;IACjE,SAAgB,OAAO,CAAC,E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ToNodeStream } from '../utils/streaming.js';
|
|
4
4
|
import { parseHeaders } from '../utils/header-parser.js';
|
|
5
|
+
import { parseLinkHeader } from '../utils/link-header.js';
|
|
6
|
+
import { ReckerError } from './errors.js';
|
|
5
7
|
export class HttpResponse {
|
|
6
8
|
timings;
|
|
7
9
|
connection;
|
|
@@ -41,6 +43,9 @@ export class HttpResponse {
|
|
|
41
43
|
get rateLimit() {
|
|
42
44
|
return parseHeaders(this.headers, this.status).rateLimit;
|
|
43
45
|
}
|
|
46
|
+
links() {
|
|
47
|
+
return parseLinkHeader(this.headers);
|
|
48
|
+
}
|
|
44
49
|
get headerInfo() {
|
|
45
50
|
return parseHeaders(this.headers, this.status);
|
|
46
51
|
}
|
|
@@ -69,7 +74,11 @@ export class HttpResponse {
|
|
|
69
74
|
async pipe(destination) {
|
|
70
75
|
const nodeStream = this.toNodeStream();
|
|
71
76
|
if (!nodeStream) {
|
|
72
|
-
throw new
|
|
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
|
+
]);
|
|
73
82
|
}
|
|
74
83
|
return new Promise((resolve, reject) => {
|
|
75
84
|
nodeStream.pipe(destination);
|
|
@@ -95,35 +104,51 @@ export class HttpResponse {
|
|
|
95
104
|
const total = contentLength ? parseInt(contentLength, 10) : undefined;
|
|
96
105
|
let loaded = 0;
|
|
97
106
|
const startTime = Date.now();
|
|
98
|
-
let lastUpdate =
|
|
107
|
+
let lastUpdate = 0;
|
|
108
|
+
let lastLoaded = 0;
|
|
109
|
+
let lastRateUpdate = startTime;
|
|
110
|
+
let smoothedRate = 0;
|
|
111
|
+
const rateSmoothingFactor = 0.3;
|
|
112
|
+
const createProgress = (isFinal) => {
|
|
113
|
+
const now = Date.now();
|
|
114
|
+
const intervalMs = now - lastRateUpdate;
|
|
115
|
+
const bytesInInterval = loaded - lastLoaded;
|
|
116
|
+
if (intervalMs > 0) {
|
|
117
|
+
const instantRate = (bytesInInterval / intervalMs) * 1000;
|
|
118
|
+
smoothedRate = smoothedRate === 0
|
|
119
|
+
? instantRate
|
|
120
|
+
: smoothedRate * (1 - rateSmoothingFactor) + instantRate * rateSmoothingFactor;
|
|
121
|
+
}
|
|
122
|
+
lastLoaded = loaded;
|
|
123
|
+
lastRateUpdate = now;
|
|
124
|
+
let percent;
|
|
125
|
+
if (total) {
|
|
126
|
+
percent = isFinal ? 100 : Math.min((loaded / total) * 100, 99.9);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
loaded,
|
|
130
|
+
transferred: loaded,
|
|
131
|
+
total,
|
|
132
|
+
percent,
|
|
133
|
+
rate: smoothedRate,
|
|
134
|
+
estimated: total && smoothedRate > 0 ? ((total - loaded) / smoothedRate) * 1000 : undefined,
|
|
135
|
+
direction: 'download',
|
|
136
|
+
};
|
|
137
|
+
};
|
|
99
138
|
const reader = this.raw.body.getReader();
|
|
100
139
|
try {
|
|
140
|
+
yield createProgress(false);
|
|
101
141
|
while (true) {
|
|
102
142
|
const { done, value } = await reader.read();
|
|
103
143
|
if (done) {
|
|
104
|
-
|
|
105
|
-
const rate = elapsed > 0 ? loaded / elapsed : 0;
|
|
106
|
-
yield {
|
|
107
|
-
loaded,
|
|
108
|
-
total,
|
|
109
|
-
percent: total ? 100 : undefined,
|
|
110
|
-
rate,
|
|
111
|
-
};
|
|
144
|
+
yield createProgress(true);
|
|
112
145
|
break;
|
|
113
146
|
}
|
|
114
147
|
if (value) {
|
|
115
148
|
loaded += value.byteLength;
|
|
116
149
|
const now = Date.now();
|
|
117
|
-
const elapsed = (now - startTime) / 1000;
|
|
118
|
-
const rate = elapsed > 0 ? loaded / elapsed : 0;
|
|
119
150
|
if (now - lastUpdate > 100) {
|
|
120
|
-
yield
|
|
121
|
-
loaded,
|
|
122
|
-
total,
|
|
123
|
-
percent: total ? (loaded / total) * 100 : undefined,
|
|
124
|
-
rate,
|
|
125
|
-
estimated: total && rate > 0 ? ((total - loaded) / rate) * 1000 : undefined,
|
|
126
|
-
};
|
|
151
|
+
yield createProgress(false);
|
|
127
152
|
lastUpdate = now;
|
|
128
153
|
}
|
|
129
154
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import type { ProgressEvent, ReckerResponse, ReckerRequest } from '../types/index.js';
|
|
3
|
+
export interface RequestEvents {
|
|
4
|
+
request: (request: ReckerRequest) => void;
|
|
5
|
+
response: (response: ResponseInfo) => void;
|
|
6
|
+
downloadProgress: (progress: ProgressEvent) => void;
|
|
7
|
+
uploadProgress: (progress: ProgressEvent) => void;
|
|
8
|
+
retry: (info: RetryInfo) => void;
|
|
9
|
+
redirect: (info: EventRedirectInfo) => void;
|
|
10
|
+
complete: (response: ReckerResponse) => void;
|
|
11
|
+
error: (error: Error) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface ResponseInfo {
|
|
14
|
+
status: number;
|
|
15
|
+
statusText: string;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
url: string;
|
|
18
|
+
}
|
|
19
|
+
export interface RetryInfo {
|
|
20
|
+
attempt: number;
|
|
21
|
+
maxAttempts: number;
|
|
22
|
+
error: Error;
|
|
23
|
+
delay: number;
|
|
24
|
+
}
|
|
25
|
+
export interface EventRedirectInfo {
|
|
26
|
+
from: string;
|
|
27
|
+
to: string;
|
|
28
|
+
status: number;
|
|
29
|
+
}
|
|
30
|
+
export declare class RequestEventEmitter extends EventEmitter {
|
|
31
|
+
on<E extends keyof RequestEvents>(event: E, listener: RequestEvents[E]): this;
|
|
32
|
+
once<E extends keyof RequestEvents>(event: E, listener: RequestEvents[E]): this;
|
|
33
|
+
emit<E extends keyof RequestEvents>(event: E, ...args: Parameters<RequestEvents[E]>): boolean;
|
|
34
|
+
off<E extends keyof RequestEvents>(event: E, listener: RequestEvents[E]): this;
|
|
35
|
+
removeListener<E extends keyof RequestEvents>(event: E, listener: RequestEvents[E]): this;
|
|
36
|
+
}
|
|
37
|
+
export declare function createRequestEvents(): RequestEventEmitter;
|
|
38
|
+
export declare function createEventStream(stream: ReadableStream<Uint8Array>, events: RequestEventEmitter, options: {
|
|
39
|
+
total?: number;
|
|
40
|
+
direction: 'upload' | 'download';
|
|
41
|
+
throttleMs?: number;
|
|
42
|
+
}): ReadableStream<Uint8Array>;
|
|
43
|
+
export interface StreamEventsConfig {
|
|
44
|
+
events: RequestEventEmitter;
|
|
45
|
+
total?: number;
|
|
46
|
+
throttleMs?: number;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=request-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-events.d.ts","sourceRoot":"","sources":["../../src/events/request-events.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKtF,MAAM,WAAW,aAAa;IAE5B,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAG1C,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAG3C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAGpD,cAAc,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAGlD,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAGjC,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAG5C,QAAQ,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAG7C,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,C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C;IACf,SAAS,EAAE,QAAQ,GAAG,UAAU,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,cAAc,CAAC,UAAU,CAAC,CA6E5B;AAKD,MAAM,WAAW,kBAAkB;IAEjC,MAAM,EAAE,mBAAmB,CAAC;IAG5B,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
export class RequestEventEmitter extends EventEmitter {
|
|
3
|
+
on(event, listener) {
|
|
4
|
+
return super.on(event, listener);
|
|
5
|
+
}
|
|
6
|
+
once(event, listener) {
|
|
7
|
+
return super.once(event, listener);
|
|
8
|
+
}
|
|
9
|
+
emit(event, ...args) {
|
|
10
|
+
return super.emit(event, ...args);
|
|
11
|
+
}
|
|
12
|
+
off(event, listener) {
|
|
13
|
+
return super.off(event, listener);
|
|
14
|
+
}
|
|
15
|
+
removeListener(event, listener) {
|
|
16
|
+
return super.removeListener(event, listener);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function createRequestEvents() {
|
|
20
|
+
return new RequestEventEmitter();
|
|
21
|
+
}
|
|
22
|
+
export function createEventStream(stream, events, options) {
|
|
23
|
+
const { total, direction, throttleMs = 100 } = options;
|
|
24
|
+
let loaded = 0;
|
|
25
|
+
let startTime = Date.now();
|
|
26
|
+
let lastUpdate = 0;
|
|
27
|
+
let lastLoaded = 0;
|
|
28
|
+
let lastRateUpdate = startTime;
|
|
29
|
+
let smoothedRate = 0;
|
|
30
|
+
const rateSmoothingFactor = 0.3;
|
|
31
|
+
const emitProgress = (now, isFinal) => {
|
|
32
|
+
const intervalMs = now - lastRateUpdate;
|
|
33
|
+
const bytesInInterval = loaded - lastLoaded;
|
|
34
|
+
if (intervalMs > 0) {
|
|
35
|
+
const instantRate = (bytesInInterval / intervalMs) * 1000;
|
|
36
|
+
smoothedRate = smoothedRate === 0
|
|
37
|
+
? instantRate
|
|
38
|
+
: smoothedRate * (1 - rateSmoothingFactor) + instantRate * rateSmoothingFactor;
|
|
39
|
+
}
|
|
40
|
+
lastLoaded = loaded;
|
|
41
|
+
lastRateUpdate = now;
|
|
42
|
+
let percent;
|
|
43
|
+
if (total) {
|
|
44
|
+
percent = isFinal ? 100 : Math.min((loaded / total) * 100, 99.9);
|
|
45
|
+
}
|
|
46
|
+
const progress = {
|
|
47
|
+
loaded,
|
|
48
|
+
transferred: loaded,
|
|
49
|
+
total,
|
|
50
|
+
percent,
|
|
51
|
+
rate: smoothedRate,
|
|
52
|
+
estimated: total && smoothedRate > 0 ? ((total - loaded) / smoothedRate) * 1000 : undefined,
|
|
53
|
+
direction,
|
|
54
|
+
};
|
|
55
|
+
const event = direction === 'download' ? 'downloadProgress' : 'uploadProgress';
|
|
56
|
+
events.emit(event, progress);
|
|
57
|
+
lastUpdate = now;
|
|
58
|
+
};
|
|
59
|
+
return new ReadableStream({
|
|
60
|
+
async start(controller) {
|
|
61
|
+
const reader = stream.getReader();
|
|
62
|
+
try {
|
|
63
|
+
emitProgress(Date.now(), false);
|
|
64
|
+
while (true) {
|
|
65
|
+
const { done, value } = await reader.read();
|
|
66
|
+
if (done) {
|
|
67
|
+
emitProgress(Date.now(), true);
|
|
68
|
+
controller.close();
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
loaded += value.byteLength;
|
|
72
|
+
const now = Date.now();
|
|
73
|
+
if (now - lastUpdate >= throttleMs || (total && loaded === total)) {
|
|
74
|
+
emitProgress(now, false);
|
|
75
|
+
}
|
|
76
|
+
controller.enqueue(value);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
controller.error(error);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './core/request-promise.js';
|
|
2
2
|
export * from './transport/undici.js';
|
|
3
|
+
export * from './utils/tls-inspector.js';
|
|
4
|
+
export * from './utils/rdap.js';
|
|
5
|
+
export * from './utils/dns-toolkit.js';
|
|
3
6
|
export * from './transport/fetch.js';
|
|
4
|
-
export * from './types/index.js';
|
|
5
7
|
export * from './core/errors.js';
|
|
6
8
|
export * from './core/client.js';
|
|
7
9
|
export * from './core/request.js';
|
|
@@ -12,6 +14,7 @@ export * from './plugins/dedup.js';
|
|
|
12
14
|
export * from './plugins/logger.js';
|
|
13
15
|
export * from './plugins/circuit-breaker.js';
|
|
14
16
|
export * from './plugins/cookie-jar.js';
|
|
17
|
+
export * from './cookies/memory-cookie-jar.js';
|
|
15
18
|
export * from './runner/request-runner.js';
|
|
16
19
|
export * from './contract/index.js';
|
|
17
20
|
export * from './cache/memory-storage.js';
|
|
@@ -22,19 +25,42 @@ export * from './plugins/compression.js';
|
|
|
22
25
|
export * from './utils/streaming.js';
|
|
23
26
|
export * from './utils/request-pool.js';
|
|
24
27
|
export * from './utils/header-parser.js';
|
|
28
|
+
export * from './utils/link-header.js';
|
|
25
29
|
export * from './websocket/client.js';
|
|
26
30
|
export * from './utils/whois.js';
|
|
27
31
|
export * from './utils/dns.js';
|
|
28
32
|
export * from './utils/cert.js';
|
|
29
33
|
export * from './utils/doh.js';
|
|
30
34
|
export * from './utils/upload.js';
|
|
35
|
+
export * from './utils/download.js';
|
|
31
36
|
export * from './utils/user-agent.js';
|
|
32
37
|
export * from './plugins/har-recorder.js';
|
|
33
38
|
export * from './plugins/har-player.js';
|
|
34
39
|
export * from './plugins/graphql.js';
|
|
40
|
+
export * from './plugins/xml.js';
|
|
41
|
+
export * from './plugins/scrape.js';
|
|
42
|
+
export * from './scrape/index.js';
|
|
35
43
|
export * from './plugins/server-timing.js';
|
|
44
|
+
export * from './plugins/auth.js';
|
|
36
45
|
export * from './plugins/proxy-rotator.js';
|
|
46
|
+
export * from './plugins/interface-rotator.js';
|
|
47
|
+
export * from './plugins/hls.js';
|
|
48
|
+
export * from './plugins/jsonrpc.js';
|
|
49
|
+
export * from './plugins/grpc-web.js';
|
|
50
|
+
export * from './plugins/soap.js';
|
|
51
|
+
export * from './plugins/odata.js';
|
|
52
|
+
export * from './plugins/http2-push.js';
|
|
53
|
+
export * from './plugins/http3.js';
|
|
37
54
|
export * from './cache/redis-storage.js';
|
|
38
|
-
export * from './
|
|
55
|
+
export * from './events/request-events.js';
|
|
56
|
+
export * from './constants/http-status.js';
|
|
57
|
+
export * from './utils/env-proxy.js';
|
|
58
|
+
export * from './utils/charset.js';
|
|
59
|
+
export * from './utils/client-pool.js';
|
|
60
|
+
export * as presets from './presets/index.js';
|
|
61
|
+
export * as testing from './testing/index.js';
|
|
62
|
+
export * as protocols from './protocols/index.js';
|
|
63
|
+
export * from './mcp/client.js';
|
|
64
|
+
export * from './mcp/contract.js';
|
|
39
65
|
export { Client as Recker } from './core/client.js';
|
|
40
66
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,q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AAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAGlD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './core/request-promise.js';
|
|
2
2
|
export * from './transport/undici.js';
|
|
3
|
+
export * from './utils/tls-inspector.js';
|
|
4
|
+
export * from './utils/rdap.js';
|
|
5
|
+
export * from './utils/dns-toolkit.js';
|
|
3
6
|
export * from './transport/fetch.js';
|
|
4
|
-
export * from './types/index.js';
|
|
5
7
|
export * from './core/errors.js';
|
|
6
8
|
export * from './core/client.js';
|
|
7
9
|
export * from './core/request.js';
|
|
@@ -12,6 +14,7 @@ export * from './plugins/dedup.js';
|
|
|
12
14
|
export * from './plugins/logger.js';
|
|
13
15
|
export * from './plugins/circuit-breaker.js';
|
|
14
16
|
export * from './plugins/cookie-jar.js';
|
|
17
|
+
export * from './cookies/memory-cookie-jar.js';
|
|
15
18
|
export * from './runner/request-runner.js';
|
|
16
19
|
export * from './contract/index.js';
|
|
17
20
|
export * from './cache/memory-storage.js';
|
|
@@ -22,18 +25,41 @@ export * from './plugins/compression.js';
|
|
|
22
25
|
export * from './utils/streaming.js';
|
|
23
26
|
export * from './utils/request-pool.js';
|
|
24
27
|
export * from './utils/header-parser.js';
|
|
28
|
+
export * from './utils/link-header.js';
|
|
25
29
|
export * from './websocket/client.js';
|
|
26
30
|
export * from './utils/whois.js';
|
|
27
31
|
export * from './utils/dns.js';
|
|
28
32
|
export * from './utils/cert.js';
|
|
29
33
|
export * from './utils/doh.js';
|
|
30
34
|
export * from './utils/upload.js';
|
|
35
|
+
export * from './utils/download.js';
|
|
31
36
|
export * from './utils/user-agent.js';
|
|
32
37
|
export * from './plugins/har-recorder.js';
|
|
33
38
|
export * from './plugins/har-player.js';
|
|
34
39
|
export * from './plugins/graphql.js';
|
|
40
|
+
export * from './plugins/xml.js';
|
|
41
|
+
export * from './plugins/scrape.js';
|
|
42
|
+
export * from './scrape/index.js';
|
|
35
43
|
export * from './plugins/server-timing.js';
|
|
44
|
+
export * from './plugins/auth.js';
|
|
36
45
|
export * from './plugins/proxy-rotator.js';
|
|
46
|
+
export * from './plugins/interface-rotator.js';
|
|
47
|
+
export * from './plugins/hls.js';
|
|
48
|
+
export * from './plugins/jsonrpc.js';
|
|
49
|
+
export * from './plugins/grpc-web.js';
|
|
50
|
+
export * from './plugins/soap.js';
|
|
51
|
+
export * from './plugins/odata.js';
|
|
52
|
+
export * from './plugins/http2-push.js';
|
|
53
|
+
export * from './plugins/http3.js';
|
|
37
54
|
export * from './cache/redis-storage.js';
|
|
38
|
-
export * from './
|
|
55
|
+
export * from './events/request-events.js';
|
|
56
|
+
export * from './constants/http-status.js';
|
|
57
|
+
export * from './utils/env-proxy.js';
|
|
58
|
+
export * from './utils/charset.js';
|
|
59
|
+
export * from './utils/client-pool.js';
|
|
60
|
+
export * as presets from './presets/index.js';
|
|
61
|
+
export * as testing from './testing/index.js';
|
|
62
|
+
export * as protocols from './protocols/index.js';
|
|
63
|
+
export * from './mcp/client.js';
|
|
64
|
+
export * from './mcp/contract.js';
|
|
39
65
|
export { Client as Recker } from './core/client.js';
|
package/dist/mcp/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/mcp/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/mcp/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,OAAO,KAAK,EAGV,aAAa,EACb,OAAO,EAEP,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAA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O,CAAC,aAAa,CAAC;oBAQhE,MAAM,KAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;MAIvD;IAEF,SAAgB,SAAS;oBACP,OAAO,CAAC,WAAW,EAAE,CAAC;oBAKpB,MAAM,KAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;yBAOjC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;2BAIpB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;MAG/C;IAEF,SAAgB,OAAO;oBACL,OAAO,CAAC,SAAS,EAAE,CAAC;oBAKlB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;MAOtF;IAEI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,aAAa,IAAI,aAAa,GAAG,SAAS;IAI1C,WAAW,IAAI,OAAO;YAIR,OAAO;YAgDP,UAAU;IAkBxB,OAAO,CAAC,cAAc;CAgCvB;AAYD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAEpE"}
|
package/dist/mcp/client.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { createClient } from '../core/client.js';
|
|
3
|
+
import { ReckerError } from '../core/errors.js';
|
|
4
|
+
import { consoleLogger } from '../types/logger.js';
|
|
3
5
|
export class MCPClient extends EventEmitter {
|
|
4
6
|
client;
|
|
5
7
|
endpoint;
|
|
@@ -34,9 +36,10 @@ export class MCPClient extends EventEmitter {
|
|
|
34
36
|
transport: options.transport,
|
|
35
37
|
});
|
|
36
38
|
if (this.options.debug) {
|
|
37
|
-
|
|
38
|
-
this.on('
|
|
39
|
-
this.on('
|
|
39
|
+
const logger = consoleLogger;
|
|
40
|
+
this.on('request', (req) => logger.debug({ type: 'mcp-request', data: req }, `[MCP Request] ${JSON.stringify(req)}`));
|
|
41
|
+
this.on('response', (res) => logger.debug({ type: 'mcp-response', data: res }, `[MCP Response] ${JSON.stringify(res)}`));
|
|
42
|
+
this.on('notification', (notif) => logger.debug({ type: 'mcp-notification', data: notif }, `[MCP Notification] ${JSON.stringify(notif)}`));
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
async connect() {
|
|
@@ -125,7 +128,11 @@ export class MCPClient extends EventEmitter {
|
|
|
125
128
|
}
|
|
126
129
|
async request(method, params) {
|
|
127
130
|
if (!this.initialized && method !== 'initialize') {
|
|
128
|
-
throw new
|
|
131
|
+
throw new ReckerError('MCP client not initialized. Call connect() first.', undefined, undefined, [
|
|
132
|
+
'Call connect() before invoking MCP methods.',
|
|
133
|
+
'Check for initialization errors in serverInfo.',
|
|
134
|
+
'Ensure the MCP server URL and credentials are correct.'
|
|
135
|
+
]);
|
|
129
136
|
}
|
|
130
137
|
const request = {
|
|
131
138
|
jsonrpc: '2.0',
|
|
@@ -139,7 +146,11 @@ export class MCPClient extends EventEmitter {
|
|
|
139
146
|
.json();
|
|
140
147
|
this.emit('response', response);
|
|
141
148
|
if (response.error) {
|
|
142
|
-
const error = new
|
|
149
|
+
const error = new ReckerError(response.error.message, undefined, undefined, [
|
|
150
|
+
'Inspect MCP server logs for the reported error.',
|
|
151
|
+
'Validate request params against the tool schema.',
|
|
152
|
+
'Retry if the error is transient.'
|
|
153
|
+
]);
|
|
143
154
|
error.code = response.error.code;
|
|
144
155
|
error.data = response.error.data;
|
|
145
156
|
throw error;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z, ZodSchema } from 'zod';
|
|
2
|
+
import type { MCPClient } from './client.js';
|
|
3
|
+
import type { MCPToolResult } from './types.js';
|
|
4
|
+
import type { Client } from '../core/client.js';
|
|
5
|
+
import type { SSEEvent } from '../utils/sse.js';
|
|
6
|
+
export interface MCPToolContract {
|
|
7
|
+
inputSchema?: ZodSchema;
|
|
8
|
+
outputSchema?: ZodSchema;
|
|
9
|
+
stream?: boolean;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
export type MCPContractDefinition = Record<string, MCPToolContract>;
|
|
13
|
+
type ToolFunction<T extends MCPToolContract> = (args: T['inputSchema'] extends ZodSchema ? z.infer<T['inputSchema']> : Record<string, unknown>) => Promise<T['outputSchema'] extends ZodSchema ? z.infer<T['outputSchema']> : MCPToolResult>;
|
|
14
|
+
type StreamingToolFunction<T extends MCPToolContract> = (args: T['inputSchema'] extends ZodSchema ? z.infer<T['inputSchema']> : Record<string, unknown>) => AsyncGenerator<string, void, unknown>;
|
|
15
|
+
type MCPToolFunction<T extends MCPToolContract> = T['stream'] extends true ? StreamingToolFunction<T> : ToolFunction<T>;
|
|
16
|
+
export type MCPContractClient<T extends MCPContractDefinition> = {
|
|
17
|
+
[K in keyof T]: MCPToolFunction<T[K]>;
|
|
18
|
+
} & {
|
|
19
|
+
raw: <K extends keyof T>(name: K, args: T[K]['inputSchema'] extends ZodSchema ? z.infer<T[K]['inputSchema']> : Record<string, unknown>) => Promise<MCPToolResult>;
|
|
20
|
+
list: () => Array<{
|
|
21
|
+
name: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
inputSchema?: ZodSchema;
|
|
24
|
+
}>;
|
|
25
|
+
has: (name: string) => boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare class MCPContractError extends Error {
|
|
28
|
+
toolName: string;
|
|
29
|
+
validationType: 'input' | 'output';
|
|
30
|
+
originalError: Error;
|
|
31
|
+
constructor(toolName: string, validationType: 'input' | 'output', originalError: Error);
|
|
32
|
+
}
|
|
33
|
+
export declare function createMCPContract<T extends MCPContractDefinition>(mcp: MCPClient, contract: T): MCPContractClient<T>;
|
|
34
|
+
export declare function createMCPStream(mcp: MCPClient, toolName: string, options?: {
|
|
35
|
+
inputParam?: string;
|
|
36
|
+
extraParams?: Record<string, unknown>;
|
|
37
|
+
}): MCPStreamFunction;
|
|
38
|
+
export interface MCPStreamFunction {
|
|
39
|
+
(input: string): AsyncGenerator<string>;
|
|
40
|
+
text(input: string): Promise<string>;
|
|
41
|
+
json<T = unknown>(input: string): Promise<T>;
|
|
42
|
+
}
|
|
43
|
+
export declare function createMCPBatch<T extends MCPContractDefinition>(mcp: MCPClient, contract: T): <K extends keyof T>(calls: Array<{
|
|
44
|
+
tool: K;
|
|
45
|
+
args?: T[K]["inputSchema"] extends ZodSchema ? z.infer<T[K]["inputSchema"]> : Record<string, unknown>;
|
|
46
|
+
}>) => Promise<Array<{
|
|
47
|
+
success: boolean;
|
|
48
|
+
result?: any;
|
|
49
|
+
error?: Error;
|
|
50
|
+
}>>;
|
|
51
|
+
export interface SSEStreamOptions {
|
|
52
|
+
inputParam?: string;
|
|
53
|
+
extraParams?: Record<string, unknown>;
|
|
54
|
+
eventType?: string | string[];
|
|
55
|
+
extractData?: (event: SSEEvent) => string | null;
|
|
56
|
+
signal?: AbortSignal;
|
|
57
|
+
timeout?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface SSEStreamFunction {
|
|
60
|
+
(input: string, options?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): AsyncGenerator<string>;
|
|
61
|
+
text(input: string, options?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): Promise<string>;
|
|
62
|
+
json<T = unknown>(input: string, options?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): Promise<T>;
|
|
63
|
+
events(input: string, options?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): AsyncGenerator<SSEEvent>;
|
|
64
|
+
}
|
|
65
|
+
export declare function createMCPSSEStream(client: Client, endpoint: string, options?: SSEStreamOptions): SSEStreamFunction;
|
|
66
|
+
export declare function createValidatedSSEStream<T extends ZodSchema>(client: Client, endpoint: string, options: SSEStreamOptions & {
|
|
67
|
+
inputSchema: T;
|
|
68
|
+
}): {
|
|
69
|
+
(args: z.infer<T>, callOptions?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): AsyncGenerator<string>;
|
|
70
|
+
text(args: z.infer<T>, callOptions?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): Promise<string>;
|
|
71
|
+
json<R = unknown>(args: z.infer<T>, callOptions?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): Promise<R>;
|
|
72
|
+
events(args: z.infer<T>, callOptions?: Pick<SSEStreamOptions, 'signal' | 'timeout'>): AsyncGenerator<SSEEvent>;
|
|
73
|
+
};
|
|
74
|
+
export declare function openAIExtractor(event: SSEEvent): string | null;
|
|
75
|
+
export declare function anthropicExtractor(event: SSEEvent): string | null;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/mcp/contract.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,WAAW,eAAe;IAE9B,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAMpE,KAAK,YAAY,CAAC,CAAC,SAAS,eAAe,IAAI,CAC7C,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,SAAS,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3F,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,SAAS,GAAG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