@j0hanz/superfetch 2.4.3 → 2.4.5
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/dist/cache.d.ts +8 -8
- package/dist/cache.js +277 -264
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -0
- package/dist/crypto.js +4 -3
- package/dist/dom-noise-removal.js +355 -297
- package/dist/fetch.d.ts +13 -7
- package/dist/fetch.js +636 -690
- package/dist/http-native.js +535 -474
- package/dist/instructions.md +38 -27
- package/dist/language-detection.js +190 -153
- package/dist/markdown-cleanup.js +171 -158
- package/dist/mcp.js +183 -2
- package/dist/resources.d.ts +2 -0
- package/dist/resources.js +44 -0
- package/dist/session.js +144 -105
- package/dist/tasks.d.ts +37 -0
- package/dist/tasks.js +66 -0
- package/dist/tools.d.ts +8 -12
- package/dist/tools.js +196 -147
- package/dist/transform.d.ts +3 -1
- package/dist/transform.js +680 -778
- package/package.json +6 -6
package/dist/fetch.d.ts
CHANGED
|
@@ -2,22 +2,25 @@ import type { Dispatcher } from 'undici';
|
|
|
2
2
|
export interface FetchOptions {
|
|
3
3
|
signal?: AbortSignal;
|
|
4
4
|
}
|
|
5
|
+
export interface TransformResult {
|
|
6
|
+
readonly url: string;
|
|
7
|
+
readonly transformed: boolean;
|
|
8
|
+
readonly platform?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Backwards-compatible export */
|
|
5
11
|
export declare function isBlockedIp(ip: string): boolean;
|
|
12
|
+
/** Backwards-compatible exports */
|
|
6
13
|
export declare function normalizeUrl(urlString: string): {
|
|
7
14
|
normalizedUrl: string;
|
|
8
15
|
hostname: string;
|
|
9
16
|
};
|
|
10
17
|
export declare function validateAndNormalizeUrl(urlString: string): string;
|
|
11
|
-
|
|
12
|
-
readonly url: string;
|
|
13
|
-
readonly transformed: boolean;
|
|
14
|
-
readonly platform?: string;
|
|
15
|
-
}
|
|
18
|
+
/** Backwards-compatible exports */
|
|
16
19
|
export declare function transformToRawUrl(url: string): TransformResult;
|
|
17
20
|
export declare function isRawTextContentUrl(url: string): boolean;
|
|
18
21
|
export declare const dispatcher: Dispatcher;
|
|
19
22
|
export declare function destroyAgents(): void;
|
|
20
|
-
interface FetchTelemetryContext {
|
|
23
|
+
export interface FetchTelemetryContext {
|
|
21
24
|
requestId: string;
|
|
22
25
|
startTime: number;
|
|
23
26
|
url: string;
|
|
@@ -25,16 +28,19 @@ interface FetchTelemetryContext {
|
|
|
25
28
|
contextRequestId?: string;
|
|
26
29
|
operationId?: string;
|
|
27
30
|
}
|
|
31
|
+
/** Backwards-compatible exports */
|
|
28
32
|
export declare function startFetchTelemetry(url: string, method: string): FetchTelemetryContext;
|
|
29
33
|
export declare function recordFetchResponse(context: FetchTelemetryContext, response: Response, contentSize?: number): void;
|
|
30
34
|
export declare function recordFetchError(context: FetchTelemetryContext, error: unknown, status?: number): void;
|
|
35
|
+
/** Backwards-compatible export */
|
|
31
36
|
export declare function fetchWithRedirects(url: string, init: RequestInit, maxRedirects: number): Promise<{
|
|
32
37
|
response: Response;
|
|
33
38
|
url: string;
|
|
34
39
|
}>;
|
|
40
|
+
/** Backwards-compatible export */
|
|
35
41
|
export declare function readResponseText(response: Response, url: string, maxBytes: number, signal?: AbortSignal): Promise<{
|
|
36
42
|
text: string;
|
|
37
43
|
size: number;
|
|
38
44
|
}>;
|
|
45
|
+
/** Backwards-compatible export */
|
|
39
46
|
export declare function fetchNormalizedUrl(normalizedUrl: string, options?: FetchOptions): Promise<string>;
|
|
40
|
-
export {};
|