-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathrecords.ts
More file actions
467 lines (455 loc) · 15.8 KB
/
records.ts
File metadata and controls
467 lines (455 loc) · 15.8 KB
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
import { ConnectionType } from './types';
/**
* The name of the place based on the locales list passed to the
* `WebServiceClient` constructor. Don't use any of these names as a database or
* dictionary key. Use the ID or relevant code instead.
*/
export interface Names {
readonly de?: string;
readonly en: string;
readonly es?: string;
readonly fr?: string;
readonly ja?: string;
readonly 'pt-BR'?: string;
readonly ru?: string;
readonly 'zh-CN'?: string;
}
/**
* Contains data related to your MaxMind account.
*/
export interface MaxMindRecord {
/**
* The number of remaining queries in your account for the web service end
* point. This will be null when using a local database.
*/
queriesRemaining: number;
}
/**
* City-level data associated with an IP address.
*/
export interface CityRecord {
/**
* A value from 0-100 indicating MaxMind's confidence that the city is
* correct. This value is only set when using the Insights web service or the
* Enterprise database.
*/
readonly confidence?: number;
/**
* The GeoName ID for the city.
*/
readonly geonameId: number;
/**
* An object of locale codes to the name in that locale. Don't use any of
* these names as a database or dictionary key. Use the ID or relevant code
* instead.
*/
readonly names: Names;
}
/**
* Contains data for the continent record associated with an IP address. Do not
* use any of the continent names as a database or dictionary key. Use the ID or
* relevant code instead.
*/
export interface ContinentRecord {
/**
* A two character continent code like "NA" (North America) or "OC" (Oceania).
*/
readonly code: 'AF' | 'AN' | 'AS' | 'EU' | 'NA' | 'OC' | 'SA';
/**
* The GeoName ID for the continent.
*/
readonly geonameId: number;
/**
* An object of locale codes to the name in that locale. Don't use any of
* these names as a database or dictionary key. Use the ID or relevant code
* instead.
*/
readonly names: Names;
}
/**
* Contains data for the registered country record associated with an IP address. Do not
* use any of the country names as a database or dictionary key. Use the ID or
* relevant code instead.
*/
export interface RegisteredCountryRecord {
/**
* The GeoName ID for the country.
*/
readonly geonameId: number;
/**
* This is true if the country is a member state of the European Union. This is available from all location services and databases.
*/
readonly isInEuropeanUnion: boolean;
/**
* The two-character ISO 3166-1 alpha code for the country.
*/
readonly isoCode: string;
/**
* An object of locale codes to the name in that locale. Don't use any of
* these names as a database or dictionary key. Use the ID or relevant code
* instead.
*/
readonly names: Names;
}
/**
* Contains data for the country record associated with an IP address. Do not
* use any of the country names as a database or dictionary key. Use the ID or
* relevant code instead.
*/
export interface CountryRecord extends RegisteredCountryRecord {
/**
* A value from 0-100 indicating MaxMind's confidence that the country is
* correct. This value is only set when using the Insights web service or the
* Enterprise database.
*/
readonly confidence?: number;
}
/**
* Contains data for the location record associated with an IP address.
*/
export interface LocationRecord {
/**
* The approximate accuracy radius in kilometers around the latitude and
* longitude for the IP address. This is the radius where we have a 67%
* confidence that the device using the IP address resides within the circle
* centered at the latitude and longitude with the provided radius.
*/
readonly accuracyRadius: number;
/**
* The average income in US dollars associated with the IP address.
*/
readonly averageIncome?: number;
/**
* The approximate latitude of the location associated with the IP address.
* This value is not precise and should not be used to identify a particular
* address or household.
*/
readonly latitude: number;
/**
* The approximate longitude of the location associated with the IP address.
* This value is not precise and should not be used to identify a particular
* address or household.
*/
readonly longitude: number;
/**
* The metro code is a no-longer-maintained code for targeting
* advertisements in Google.
* @category deprecated
* @deprecated
*/
readonly metroCode?: number;
/**
* The estimated number of people per square kilometer.
*/
readonly populationDensity?: number;
/**
* The time zone associated with location, as specified by the IANA Time Zone
* Database , e.g., "America/New_York".
*/
readonly timeZone?: string;
}
/**
* Contains data for the postal record associated with an IP address.
*/
export interface PostalRecord {
/**
* The postal code of the location. Postal codes are not available for all
* countries. In some countries, this will only contain part of the postal
* code.
*/
readonly code: string;
/**
* A value from 0-100 indicating MaxMind's confidence that the postal code is
* correct. This value is only set when using the Insights web service or the
* Enterprise database.
*/
readonly confidence?: number;
}
/**
* Contains data for the represented country associated with an IP address.
* This class contains the country-level data associated with an IP address for
* the IP's represented country. The represented country is the country
* represented by something like a military base. Do not use any of the country
* names as a database or dictionary key. Use the ID or relevant instead.
*/
export interface RepresentedCountryRecord extends RegisteredCountryRecord {
/**
* A string indicating the type of entity that is representing the country.
* Currently we only return military but this could expand to include other
* types in the future.
*/
readonly type: string;
}
/**
* Contains data for the subdivisions associated with an IP address. Do not use
* any of the subdivision names as a database or dictionary key. Use the ID or
* relevant instead.
*/
export interface SubdivisionsRecord {
/**
* This is a value from 0-100 indicating MaxMind's confidence that the
* subdivision is correct. This value is only set when using the Insights web
* service or the Enterprise database.
*/
readonly confidence?: number;
/**
* The GeoName ID for the subdivision.
*/
readonly geonameId: number;
/**
* This is a string up to three characters long contain the subdivision portion of the code.
*/
readonly isoCode: string;
/**
* An object of locale codes to the name in that locale. Don't use any of
* these names as a database or dictionary key. Use the ID or relevant code
* instead.
*/
readonly names: Names;
}
/**
* Contains data for the anonymizer record associated with an IP address.
* This record is only available from the GeoIP2 Insights web service.
*/
export interface AnonymizerRecord {
/**
* A score ranging from 1 to 99 that represents our percent confidence that
* the network is currently part of an actively used VPN service. This value
* is only available from GeoIP2 Insights.
*/
readonly confidence?: number;
/**
* This is true if the IP address belongs to any sort of anonymous network.
* This value is only available from GeoIP2 Insights.
*/
readonly isAnonymous: boolean;
/**
* This is true if the IP address is registered to an anonymous VPN provider.
* This value is only available from GeoIP2 Insights.
*/
readonly isAnonymousVpn: boolean;
/**
* This is true if the IP address belongs to a hosting or VPN provider (see
* description of `isAnonymousVpn` property). This value is only available from
* GeoIP2 Insights.
*/
readonly isHostingProvider: boolean;
/**
* This is true if the IP address belongs to a public proxy. This value is
* only available from GeoIP2 Insights.
*/
readonly isPublicProxy: boolean;
/**
* This is true if the IP address is on a suspected anonymizing network and
* belongs to a residential ISP. This value is only available from GeoIP2
* Insights.
*/
readonly isResidentialProxy: boolean;
/**
* This is true if the IP address belongs to a Tor exit node. This value is
* only available from GeoIP2 Insights.
*/
readonly isTorExitNode: boolean;
/**
* The last day that the network was sighted in our analysis of anonymized
* networks. The date is in ISO 8601 format (YYYY-MM-DD). This value is only
* available from GeoIP2 Insights.
*/
readonly networkLastSeen?: string;
/**
* The name of the identified VPN provider, such as "NordVPN" or "SurfShark".
* This value is only available from GeoIP2 Insights.
*/
readonly providerName?: string;
}
/**
* Contains data for the traits record associated with an IP address.
*/
export interface TraitsRecord {
/**
* The autonomous system number associated with the IP address. This value is
* only set when using the City Plus or Insights web service or the
* Enterprise database.
*/
readonly autonomousSystemNumber?: number;
/**
* The organization associated with the registered autonomous system number
* for the IP address. This value is only set when using the City Plus or
* Insights web service or the Enterprise database.
*/
readonly autonomousSystemOrganization?: string;
/**
* The connection type may take the following values:
* "Dialup", "Cable/DSL", "Corporate", "Cellular", and "Satellite".
* Additional values may be added in the future. This value is only set when
* using the City Plus or Insights web service or the Enterprise database.
*/
readonly connectionType?: ConnectionType;
/**
* The second level domain associated with the IP address. This will be
* something like "example.com" or "example.co.uk", not "foo.example.com".
* This value is only set when using the City Plus or Insights web service or
* the Enterprise database.
*/
readonly domain?: string;
/**
* The IP address that the data in the model is for. If you performed a "me"
* lookup against the web service, this will be the externally routable IP
* address for the system the code is running on. If the system is behind a
* NAT, this may differ from the IP address locally assigned to it.
*/
ipAddress?: string;
/**
* The risk associated with the IP address. The value ranges from 0.01 to 99,
* with a higher score indicating a higher risk. This value is only available
* from GeoIP2 Insights.
*
* Please note that the IP risk score provided in GeoIP products and services
* is more static than the IP risk score provided in minFraud and is not
* responsive to traffic on your network. If you need real-time IP risk
* scoring based on behavioral signals on your own network, please use
* minFraud.
*
* We do not provide an IP risk snapshot for low-risk networks. If this field
* is not populated, we either do not have signals for the network or the
* signals we have show that the network is low-risk. If you would like to get
* signals for low-risk networks, please use the minFraud web services.
*/
readonly ipRiskSnapshot?: number;
/**
* This is true if the IP address belongs to any sort of anonymous network.
* This value is only available from GeoIP2 Insights.
* @category deprecated
* @deprecated Use the `anonymizer` object instead.
*/
readonly isAnonymous: boolean;
/**
* This is true if the IP is an anonymous proxy. See MaxMind's GeoIP FAQ
* @category deprecated
* @deprecated
*/
readonly isAnonymousProxy: boolean;
/**
* This is true if the IP address is registered to an anonymous VPN provider.
* This value is only available from GeoIP2 Insights.
* @category deprecated
* @deprecated Use the `anonymizer` object instead.
*/
readonly isAnonymousVpn: boolean;
/**
* This is true if the IP address belongs to an anycast network.
* See https://en.wikipedia.org/wiki/Anycast.
*
* This is not available from GeoLite databases or web services.
*/
readonly isAnycast: boolean;
/**
* This is true if the IP address belongs to a hosting or VPN provider (see
* description of `IsAnonymousVpn` property). This value is only available from
* GeoIP2 Insights.
* @category deprecated
* @deprecated Use the `anonymizer` object instead.
*/
readonly isHostingProvider: boolean;
/**
* True if MaxMind believes this IP address to be a legitimate proxy, such as
* an internal VPN used by a corporation. This is only available in the
* GeoIP2 Enterprise database.
*/
readonly isLegitimateProxy: boolean;
/**
* This is true if the IP address belongs to a public proxy. This value is
* only available from GeoIP2 Insights.
* @category deprecated
* @deprecated Use the `anonymizer` object instead.
*/
readonly isPublicProxy: boolean;
/**
* This is true if the IP address is on a suspected anonymizing network and
* belongs to a residential ISP. This value is only available from GeoIP2
* Insights.
* @category deprecated
* @deprecated Use the `anonymizer` object instead.
*/
readonly isResidentialProxy: boolean;
/**
* This is true if the IP belong to a satellite Internet provider.
* @category deprecated
* @deprecated
*/
readonly isSatelliteProvider: boolean;
/**
* This is true if the IP address belongs to a Tor exit node. This value is
* only available from GeoIP2 Insights.
* @category deprecated
* @deprecated Use the `anonymizer` object instead.
*/
readonly isTorExitNode: boolean;
/**
* The network associated with the record. In particular, this is the largest
* network where all of the fields besides `ipAddress` have the same value.
*/
network?: string;
/**
* The name of the ISP associated with the IP address. This value is only set
* when using the City Plus or Insights web service or the Enterprise
* database.
*/
readonly isp?: string;
/**
* The mobile country code (MCC) associated with the IP address and ISP.
* See https://en.wikipedia.org/wiki/Mobile_country_code.
*
* This value is only set when using the City Plus or Insights web service or
* the Enterprise database.
*/
readonly mobileCountryCode?: string;
/**
* The mobile network code (MNC) associated with the IP address and ISP.
* See https://en.wikipedia.org/wiki/Mobile_country_code.
*
* This value is only set when using the City Plus or Insights web service or
* the Enterprise database.
*/
readonly mobileNetworkCode?: string;
/**
* The name of the organization associated with the IP address. This value is
* only set when using the City Plus or Insights web service or the
* Enterprise database.
*/
readonly organization?: string;
/**
* An indicator of how static or dynamic an IP address is. The value ranges
* from 0 to 99.99 with higher values meaning a greater static association.
* For example, many IP addresses with a `userType` of `cellular` have a lifetime
* under one. Static Cable/DSL IPs typically have a lifetime above thirty.
*/
readonly staticIpScore?: number;
/**
* The estimated number of users sharing the IP/network during the past 24
* hours. For IPv4, the count is for the individual IP. For IPv6, the count
* is for the /64 network. This value is only available from GeoIP2 Insights.
*/
readonly userCount?: number;
/**
* The user type associated with the IP address. This value is only set when
* using the City Plus or Insights web service or the Enterprise database.
*/
readonly userType?:
| 'business'
| 'cafe'
| 'cellular'
| 'college'
| 'consumer_privacy_network'
| 'content_delivery_network'
| 'dialup'
| 'government'
| 'hosting'
| 'library'
| 'military'
| 'residential'
| 'router'
| 'school'
| 'search_engine_spider'
| 'traveler';
}