advanced-tls-client 1.0.2 → 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 +61 -25
- package/dist/index.js +598 -253
- package/package.json +1 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/readme.md +0 -375
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Readable } from 'stream';
|
|
1
|
+
import { Readable, PassThrough } from 'stream';
|
|
3
2
|
interface TLSFingerprint {
|
|
4
3
|
cipherSuites: number[];
|
|
5
4
|
extensions: number[];
|
|
@@ -41,6 +40,27 @@ interface HTTP2Fingerprint {
|
|
|
41
40
|
};
|
|
42
41
|
headerOrder: string[];
|
|
43
42
|
}
|
|
43
|
+
interface FullResponse {
|
|
44
|
+
statusCode: number;
|
|
45
|
+
headers: Record<string, string | string[]>;
|
|
46
|
+
body: Buffer;
|
|
47
|
+
text: string;
|
|
48
|
+
json?: any;
|
|
49
|
+
fingerprints: {
|
|
50
|
+
ja3: string;
|
|
51
|
+
ja3Hash: string;
|
|
52
|
+
akamai: string;
|
|
53
|
+
};
|
|
54
|
+
timing: {
|
|
55
|
+
socket: number;
|
|
56
|
+
lookup: number;
|
|
57
|
+
connect: number;
|
|
58
|
+
secureConnect: number;
|
|
59
|
+
response: number;
|
|
60
|
+
end: number;
|
|
61
|
+
total: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
44
64
|
interface ChromeProfile {
|
|
45
65
|
name: string;
|
|
46
66
|
version: string;
|
|
@@ -67,27 +87,37 @@ interface RequestOptions {
|
|
|
67
87
|
maxRedirects?: number;
|
|
68
88
|
timeout?: number;
|
|
69
89
|
stream?: boolean;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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;
|
|
91
121
|
}
|
|
92
122
|
declare class ProfileRegistry {
|
|
93
123
|
private static getGrease;
|
|
@@ -107,8 +137,14 @@ declare class AdvancedTLSClient {
|
|
|
107
137
|
private maxCachedSessions;
|
|
108
138
|
private sessionTimeout;
|
|
109
139
|
private cleanupInterval;
|
|
140
|
+
private defaults;
|
|
110
141
|
constructor(profileName?: string);
|
|
111
|
-
|
|
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;
|
|
112
148
|
destroy(): void;
|
|
113
149
|
}
|
|
114
|
-
export { AdvancedTLSClient, ProfileRegistry };
|
|
150
|
+
export { AdvancedTLSClient, ProfileRegistry, FullResponse };
|