@putuofc/fastp 0.0.1 → 3.0.1
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/index.d.ts +133 -24
- package/dist/index.js +1260 -113
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,56 @@
|
|
|
1
|
-
import { Readable } from 'stream';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { Readable, PassThrough } from 'stream';
|
|
2
|
+
interface TLSFingerprint {
|
|
3
|
+
cipherSuites: number[];
|
|
4
|
+
extensions: number[];
|
|
5
|
+
supportedGroups: number[];
|
|
6
|
+
signatureAlgorithms: number[];
|
|
7
|
+
supportedVersions: number[];
|
|
8
|
+
ecPointFormats: number[];
|
|
9
|
+
alpnProtocols: string[];
|
|
10
|
+
pskKeyExchangeModes: number[];
|
|
11
|
+
compressionMethods: number[];
|
|
12
|
+
grease: boolean;
|
|
13
|
+
recordSizeLimit?: number;
|
|
14
|
+
certificateCompression?: number[];
|
|
15
|
+
ocspStapling?: boolean;
|
|
16
|
+
signedCertificateTimestamp?: boolean;
|
|
17
|
+
delegatedCredentials?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface HTTP2Fingerprint {
|
|
20
|
+
windowUpdate: number;
|
|
21
|
+
headerTableSize: number;
|
|
22
|
+
maxConcurrentStreams?: number;
|
|
23
|
+
initialWindowSize: number;
|
|
24
|
+
maxFrameSize?: number;
|
|
25
|
+
maxHeaderListSize?: number;
|
|
26
|
+
enablePush: number;
|
|
27
|
+
settingsOrder: number[];
|
|
28
|
+
connectionPreface: Buffer;
|
|
29
|
+
priorityFrames: Array<{
|
|
30
|
+
streamId: number;
|
|
31
|
+
weight: number;
|
|
32
|
+
dependency: number;
|
|
33
|
+
exclusive: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
pseudoHeaderOrder: string[];
|
|
36
|
+
headerPriority?: {
|
|
37
|
+
streamDep: number;
|
|
38
|
+
exclusive: boolean;
|
|
39
|
+
weight: number;
|
|
40
|
+
};
|
|
41
|
+
headerOrder: string[];
|
|
13
42
|
}
|
|
14
|
-
interface
|
|
43
|
+
interface FullResponse {
|
|
15
44
|
statusCode: number;
|
|
16
45
|
headers: Record<string, string | string[]>;
|
|
17
|
-
body: Buffer
|
|
18
|
-
text
|
|
46
|
+
body: Buffer;
|
|
47
|
+
text: string;
|
|
19
48
|
json?: any;
|
|
49
|
+
fingerprints: {
|
|
50
|
+
ja3: string;
|
|
51
|
+
ja3Hash: string;
|
|
52
|
+
akamai: string;
|
|
53
|
+
};
|
|
20
54
|
timing: {
|
|
21
55
|
socket: number;
|
|
22
56
|
lookup: number;
|
|
@@ -26,16 +60,91 @@ interface Response extends EventEmitter {
|
|
|
26
60
|
end: number;
|
|
27
61
|
total: number;
|
|
28
62
|
};
|
|
29
|
-
fingerprints: {
|
|
30
|
-
ja3: string;
|
|
31
|
-
ja3Hash: string;
|
|
32
|
-
akamai: string;
|
|
33
|
-
};
|
|
34
63
|
}
|
|
35
|
-
|
|
64
|
+
interface ChromeProfile {
|
|
65
|
+
name: string;
|
|
66
|
+
version: string;
|
|
67
|
+
tls: TLSFingerprint;
|
|
68
|
+
http2: HTTP2Fingerprint;
|
|
69
|
+
userAgent: string;
|
|
70
|
+
secChUa: string;
|
|
71
|
+
secChUaPlatform: string;
|
|
72
|
+
secChUaMobile: string;
|
|
73
|
+
secFetchSite: string;
|
|
74
|
+
secFetchMode: string;
|
|
75
|
+
secFetchDest: string;
|
|
76
|
+
upgradeInsecureRequests?: string;
|
|
77
|
+
acceptLanguage?: string;
|
|
78
|
+
priority?: string;
|
|
79
|
+
}
|
|
80
|
+
interface RequestOptions {
|
|
81
|
+
method?: string;
|
|
82
|
+
headers?: Record<string, string>;
|
|
83
|
+
body?: string | Buffer | Readable;
|
|
84
|
+
cookies?: Record<string, string>;
|
|
85
|
+
decompress?: boolean;
|
|
86
|
+
followRedirects?: boolean;
|
|
87
|
+
maxRedirects?: number;
|
|
88
|
+
timeout?: number;
|
|
89
|
+
stream?: boolean;
|
|
90
|
+
open_timeout?: number;
|
|
91
|
+
response_timeout?: number;
|
|
92
|
+
read_timeout?: number;
|
|
93
|
+
follow_max?: number;
|
|
94
|
+
proxy?: string;
|
|
95
|
+
username?: string;
|
|
96
|
+
password?: string;
|
|
97
|
+
auth?: 'basic' | 'digest' | 'auto';
|
|
98
|
+
agent?: any;
|
|
99
|
+
json?: boolean;
|
|
100
|
+
multipart?: boolean;
|
|
101
|
+
boundary?: string;
|
|
102
|
+
encoding?: string;
|
|
103
|
+
parse_response?: boolean | 'json' | 'xml';
|
|
104
|
+
compressed?: boolean;
|
|
105
|
+
decode_response?: boolean;
|
|
106
|
+
parse_cookies?: boolean;
|
|
107
|
+
follow_set_cookies?: boolean;
|
|
108
|
+
follow_set_referer?: boolean;
|
|
109
|
+
follow_keep_method?: boolean;
|
|
110
|
+
follow_if_same_host?: boolean;
|
|
111
|
+
follow_if_same_protocol?: boolean;
|
|
112
|
+
follow_if_same_location?: boolean;
|
|
113
|
+
use_proxy_from_env_var?: boolean;
|
|
114
|
+
output?: string;
|
|
115
|
+
localAddress?: string;
|
|
116
|
+
lookup?: Function;
|
|
117
|
+
signal?: AbortSignal;
|
|
118
|
+
connection?: string;
|
|
119
|
+
content_type?: string;
|
|
120
|
+
uri_modifier?: Function;
|
|
121
|
+
}
|
|
122
|
+
declare class ProfileRegistry {
|
|
123
|
+
private static getGrease;
|
|
124
|
+
static chromeMobile143Android(): ChromeProfile;
|
|
125
|
+
static chrome133PSK(): ChromeProfile;
|
|
126
|
+
static chrome133(): ChromeProfile;
|
|
127
|
+
static firefox117(): ChromeProfile;
|
|
128
|
+
static safariIOS18(): ChromeProfile;
|
|
129
|
+
static get(name: string): ChromeProfile;
|
|
130
|
+
static get latest(): ChromeProfile;
|
|
131
|
+
static get latestMobile(): ChromeProfile;
|
|
132
|
+
}
|
|
133
|
+
declare class AdvancedTLSClient {
|
|
134
|
+
private profile;
|
|
135
|
+
private sessionCache;
|
|
36
136
|
private cookieJar;
|
|
37
|
-
|
|
38
|
-
|
|
137
|
+
private maxCachedSessions;
|
|
138
|
+
private sessionTimeout;
|
|
139
|
+
private cleanupInterval;
|
|
140
|
+
private defaults;
|
|
141
|
+
constructor(profileName?: string);
|
|
142
|
+
setup(uri: string, options: RequestOptions): any;
|
|
143
|
+
request(uri: string, data?: any, options?: RequestOptions, callback?: Function): Promise<FullResponse | PassThrough>;
|
|
144
|
+
private generateJA3;
|
|
145
|
+
private buildMultipart;
|
|
146
|
+
private generateMultipart;
|
|
147
|
+
private flatten;
|
|
39
148
|
destroy(): void;
|
|
40
149
|
}
|
|
41
|
-
export {};
|
|
150
|
+
export { AdvancedTLSClient, ProfileRegistry, FullResponse };
|