deno.land / x / ip2proxy@3.0.1 / src / ip2proxy.d.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
export class IP2Proxy { /** * Reads bytes from file into buffer. * * @param readBytes The number of bytes to read. * @param position The file offset to start reading. * @returns buffer containing the read bytes. */ readRow(readBytes: number, position: number): any; /** * Reads bytes from file and convert to specified data type. * * @param readBytes The number of bytes to read. * @param position The file offset to start reading. * @param readType The data type to convert the bytes to. (Valid values: int8|int32|uint32|float|str|int128) * @param isBigInt Whether to convert to BigInteger object. * @returns The value of the specified data type. */ readBin(readBytes: number, position: number, readType: string, isBigInt: boolean): any; /** * Reads unsigned 8-bit integer from file. * * @param position The file offset to start reading. * @returns Unsigned 8-bit integer. */ read8(position: number): number; /** * Reads unsigned 8-bit integer from buffer. * * @param position The buffer offset to start reading. * @param buffer The buffer containing the data. * @returns Unsigned 8-bit integer. */ read8Row(position: number, buffer: any): number; /** * Reads unsigned 32-bit integer from file. * * @param position The file offset to start reading. * @param isBigInt Whether to convert to BigInteger object. * @returns Unsigned 32-bit integer. */ read32(position: number, isBigInt: boolean): number; /** * Reads unsigned 32-bit integer from buffer. * * @param position The buffer offset to start reading. * @param buffer The buffer containing the data. * @returns Unsigned 32-bit integer. */ read32Row(position: number, buffer: any): number; /** * Reads unsigned 128-bit integer from buffer. * * @param position The buffer offset to start reading. * @param buffer The buffer containing the data. * @returns BigInteger object. */ read128Row(position: number, buffer: any): any; /** * Reads either unsigned 32-bit or 128-bit integer from buffer. * * @param position The buffer offset to start reading. * @param buffer The buffer containing the data. * @param len The number of bytes to read. * @returns BigInteger object or unsigned 32-bit integer. */ read32Or128Row(position: number, buffer: any, len: number): any; /** * Reads either unsigned 32-bit or 128-bit integer from file. * * @param position The file offset to start reading. * @param ipType 4 for IPv4 or 6 for IPv6. * @returns BigInteger object or unsigned 32-bit integer. */ read32Or128(position: number, ipType: number): any; /** * Reads unsigned 128-bit integer from file. * * @param position The file offset to start reading. * @returns BigInteger object. */ read128(position: number): any; /** * Reads string from file. * * @param position The file offset to start reading. * @returns String. */ readStr(position: number): string; /** * Reads BIN file metadata. * * @returns Whether metadata read successfully. */ loadBin(): boolean; /** * Initializes with BIN file path and pre-loads metadata. * * @param binPath The path to the BIN file. * @returns 0 if successful else -1 for errors. */ open(binPath: string): 0 | -1; /** * Resets metadata and closes file handle. * * @returns 0 if successful else -1 for errors. */ close(): 0 | -1; /** * Retrieves proxy data into supplied object. * * @param myIP The IP address to query. * @param ipType 4 for IPv4 or 6 for IPv6. * @param data The object to store the results. * @param mode The fields to read. */ proxyQueryData(myIP: string, ipType: number, data: any, mode: any): void; /** * Performs validations and returns proxy data. * * @param myIP The IP address to query. * @param mode The fields to read. * @returns The proxy data. */ proxyQuery(myIP: string, mode: any): { ip: string; ipNo: string; isProxy: number; proxyType: string; countryShort: string; countryLong: string; region: string; city: string; isp: string; domain: string; usageType: string; asn: string; as: string; lastSeen: string; threat: string; provider: string; }; /** * Returns the module version. * * @returns The module version. */ getModuleVersion(): string; /** * Returns the database package. * * @returns The database package. */ getPackageVersion(): number; /** * Returns the database version. * * @returns The database version. */ getDatabaseVersion(): string; /** * Whether IP is a proxy server. * * @param myIP The IP address to query. * @returns -1 if error, 0 if not a proxy, 1 if proxy except DCH and SES, 2 if proxy and DCH or SES */ isProxy(myIP: string): number; /** * Returns the ISO 3166 country code. * * @param myIP The IP address to query. * @returns The country code. */ getCountryShort(myIP: string): string; /** * Returns the country name. * * @param myIP The IP address to query. * @returns The country name. */ getCountryLong(myIP: string): string; /** * Returns the region or state. * * @param myIP The IP address to query. * @returns The region or state. */ getRegion(myIP: string): string; /** * Returns the city. * * @param myIP The IP address to query. * @returns The city. */ getCity(myIP: string): string; /** * Returns the Internet Service Provider. * * @param myIP The IP address to query. * @returns The ISP. */ getISP(myIP: string): string; /** * Returns the proxy type. * * @param myIP The IP address to query. * @returns The proxy type. */ getProxyType(myIP: string): string; /** * Returns the domain name. * * @param myIP The IP address to query. * @returns The domain name. */ getDomain(myIP: string): string; /** * Returns the usage type. * * @param myIP The IP address to query. * @returns The usage type. */ getUsageType(myIP: string): string; /** * Returns the autonomous system number. * * @param myIP The IP address to query. * @returns The ASN. */ getASN(myIP: string): string; /** * Returns the autonomous system name. * * @param myIP The IP address to query. * @returns The AS. */ getAS(myIP: string): string; /** * Returns the number of days ago the proxy was last seen. * * @param myIP The IP address to query. * @returns The number of days ago the proxy was last seen. */ getLastSeen(myIP: string): string; /** * Returns the security threat reported. * * @param myIP The IP address to query. * @returns SPAM if spammer, SCANNER if network scanner, BOTNET if malware infected device. */ getThreat(myIP: string): string; /** * Returns the name of the VPN provider. * * @param myIP The IP address to query. * @returns The name of the VPN provider. */ getProvider(myIP: string): string; /** * Returns all fields. * * @param myIP The IP address to query. * @returns All proxy fields. */ getAll(myIP: string): { ip: string; ipNo: string; isProxy: number; proxyType: string; countryShort: string; countryLong: string; region: string; city: string; isp: string; domain: string; usageType: string; asn: string; as: string; lastSeen: string; threat: string; provider: string; }; #private;}export class IP2ProxyWebService { /** * Initializes with the IP2Proxy Web Service API key and the package to query. * * @param apiKey The IP2Proxy Web Service API key. * @param apiPackage The web service package to query. * @param useSSL Whether to use SSL to call the web service. */ open(apiKey: string, apiPackage: string, useSSL?: boolean): void; /** * Performs parameter validations. * */ checkParams(): void; /** * Queries the IP2Proxy Web Service for proxy data on the IP address. * * @param myIP The IP address to query. * @param callback Callback function to receive the proxy data. */ lookup(myIP: string, callback: any): void; /** * Queries the IP2Proxy Web Service for credit balance. * * @param callback Callback function to receive the credit balance. */ getCredit(callback: any): void; #private;}
ip2proxy

Version Info

Tagged at
a year ago