vpndetection-web 1.6.1 → 1.7.0
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/README.md +4 -4
- package/dist/bogon.js +2 -0
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/types.gen.d.ts +112 -4
- package/dist/index.d.ts +1 -1
- package/dist/shapes.d.ts +2 -1
- package/dist/shapes.js +8 -2
- package/dist/types.d.ts +21 -2
- package/dist/types.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ It runs in Chrome and Edge 109, Firefox 115 ESR and Safari 16.4 or newer. TypeSc
|
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
|
-
**No API key needed to start.** Unlimited, the free plan, answers `ip`, `is_vpn`, Tor and relay detection, `is_anycast`, `hostname` (the reverse DNS name), country-level `location` and `asn` with the AS's country and RPKI status, with no daily or monthly cap, with a key or without one. In a page the address calling is the visitor's, so `myIp` tells you about the visitor:
|
|
33
|
+
**No API key needed to start.** Unlimited, the free plan, answers `ip`, `is_vpn`, Tor and relay detection, `is_bot` (whether a bot such as a crawler uses the address), `is_anycast`, `hostname` (the reverse DNS name), country-level `location` and `asn` with the AS's country and RPKI status, with no daily or monthly cap, with a key or without one. In a page the address calling is the visitor's, so `myIp` tells you about the visitor:
|
|
34
34
|
|
|
35
35
|
```js
|
|
36
36
|
import { VPNDetection } from 'vpndetection-web';
|
|
@@ -48,7 +48,7 @@ console.log(result.asn?.name); // who runs the announcing network
|
|
|
48
48
|
|
|
49
49
|
### With an API key
|
|
50
50
|
|
|
51
|
-
Where the key stays private (see above), every paid plan answers every field: `is_hosting`, `is_cdn` and the four proxy flags as well, the carrier and satellite flags, the five service flags (SSH, SMTP, web, DNS resolver and BitTorrent), city-level `location`, the `company` and the `abuse` contact, and the provider (its ID and its name), confidence and last-seen detail behind each flag. The plans differ only in how many lookups they include, and a free account tries every field. Create a key in the [console](https://app.vpndetection.io), then pass it in:
|
|
51
|
+
Where the key stays private (see above), every paid plan answers every field: `is_hosting`, `is_cdn` and the four proxy flags as well, the carrier and satellite flags, the five service flags (SSH, SMTP, web, DNS resolver and BitTorrent), `bot` (whose bot it is and whether its operator vouches for the address), city-level `location`, the `company` and the `abuse` contact, and the provider (its ID and its name), confidence and last-seen detail behind each flag. The plans differ only in how many lookups they include, and a free account tries every field. Create a key in the [console](https://app.vpndetection.io), then pass it in:
|
|
52
52
|
|
|
53
53
|
```js
|
|
54
54
|
const client = new VPNDetection({ apiKey: 'your-api-key' });
|
|
@@ -122,7 +122,7 @@ const result2 = await client.lookup('45.83.91.1');
|
|
|
122
122
|
console.log(result2.isVpn); // true, no API request, result was cached
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
You can change the default cache variables (max size, TTL, etc) on initialization, or even disable it:
|
|
125
|
+
You can change the default cache variables (max size, TTL, etc) on initialization, or even disable it. Each is a whole number from 1:
|
|
126
126
|
|
|
127
127
|
```js
|
|
128
128
|
const client = new VPNDetection({ cache: { max: 50_000, ttlMs: 6 * 60 * 60 * 1000 } });
|
|
@@ -251,7 +251,7 @@ The library is ES2022 and needs only what a browser has, `fetch` and, for PKCE,
|
|
|
251
251
|
|
|
252
252
|
### Absent is not false
|
|
253
253
|
|
|
254
|
-
Unlimited leaves out `isHosting`, `isCdn`, the four proxy flags, the carrier, satellite and service flags, `company` and `abuse`, and of the detail behind each flag it answers only Tor's and relay's; a free-plan key's answer carries `trialExpired`, true once its trial is spent, and a paid key's carries `capReached`, true once its organization's overage cap is reached and the answer has Unlimited's. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
|
|
254
|
+
Unlimited leaves out `isHosting`, `isCdn`, the four proxy flags, the carrier, satellite and service flags, `bot`, `company` and `abuse`, and of the detail behind each flag it answers only Tor's and relay's; a free-plan key's answer carries `trialExpired`, true once its trial is spent, and a paid key's carries `capReached`, true once its organization's overage cap is reached and the answer has Unlimited's. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
|
|
255
255
|
|
|
256
256
|
```js
|
|
257
257
|
result.isHosting ?? false // when you only want the flag
|
package/dist/bogon.js
CHANGED
|
@@ -64,6 +64,7 @@ export function bogonResult(ip) {
|
|
|
64
64
|
isWeb: false,
|
|
65
65
|
isDnsResolver: false,
|
|
66
66
|
isBittorrent: false,
|
|
67
|
+
isBot: false,
|
|
67
68
|
vpn: {},
|
|
68
69
|
hosting: {},
|
|
69
70
|
relay: {},
|
|
@@ -80,6 +81,7 @@ export function bogonResult(ip) {
|
|
|
80
81
|
web: [],
|
|
81
82
|
dnsResolver: {},
|
|
82
83
|
bittorrent: {},
|
|
84
|
+
bot: {},
|
|
83
85
|
location: {
|
|
84
86
|
continent: '',
|
|
85
87
|
continent_name: '',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { lookupBatch, lookupIp, lookupMyIp, myEntitlement, oauthMetadata, oauthRevoke, oauthToken, type Options } from './sdk.gen.js';
|
|
2
|
-
export type { AbuseContact, Asn, BatchLookupError, BatchLookupRequest, BatchLookupResponse, BitTorrentDetail, CarrierDetail, ClassDetail, ClientOptions, Company, DnsResolverDetail, Entitlement, EntitlementApikey, EntitlementError, EntitlementPlan, EntitlementUsage, Location, LookupBatchData, LookupBatchError, LookupBatchErrors, LookupBatchResponse, LookupBatchResponses, LookupError, LookupIpData, LookupIpError, LookupIpErrors, LookupIpResponse, LookupIpResponses, LookupMyIpData, LookupMyIpError, LookupMyIpErrors, LookupMyIpResponse, LookupMyIpResponses, LookupResponse, MyEntitlementData, MyEntitlementError, MyEntitlementErrors, MyEntitlementResponse, MyEntitlementResponses, OauthError, OauthMetadata, OauthMetadataData, OauthMetadataResponse, OauthMetadataResponses, OauthRevokeData, OauthRevokeResponse, OauthRevokeResponses, OauthTokenData, OauthTokenError, OauthTokenErrors, OauthTokenResponse, OauthTokenResponses, ProxyDetail, PubproxyDetail, RevokeRequest, SatelliteDetail, SmtpDetail, SshDetail, TokenRequest, TokenResponse, VpnDetail, WebDetail } from './types.gen.js';
|
|
2
|
+
export type { AbuseContact, Asn, BatchLookupError, BatchLookupRequest, BatchLookupResponse, BitTorrentDetail, BotDetail, CarrierDetail, ClassDetail, ClientOptions, Company, DnsResolverDetail, Entitlement, EntitlementApikey, EntitlementError, EntitlementPlan, EntitlementUsage, Location, LookupBatchData, LookupBatchError, LookupBatchErrors, LookupBatchResponse, LookupBatchResponses, LookupError, LookupIpData, LookupIpError, LookupIpErrors, LookupIpResponse, LookupIpResponses, LookupMyIpData, LookupMyIpError, LookupMyIpErrors, LookupMyIpResponse, LookupMyIpResponses, LookupResponse, MyEntitlementData, MyEntitlementError, MyEntitlementErrors, MyEntitlementResponse, MyEntitlementResponses, OauthError, OauthMetadata, OauthMetadataData, OauthMetadataResponse, OauthMetadataResponses, OauthRevokeData, OauthRevokeResponse, OauthRevokeResponses, OauthTokenData, OauthTokenError, OauthTokenErrors, OauthTokenResponse, OauthTokenResponses, ProxyDetail, PubproxyDetail, RevokeRequest, SatelliteDetail, SmtpDetail, SshDetail, TokenRequest, TokenResponse, UserAgentVerdict, VpnDetail, WebDetail } from './types.gen.js';
|
|
@@ -45,6 +45,10 @@ export type LookupResponse = {
|
|
|
45
45
|
* Whether the address belongs to a CDN. Paid plans.
|
|
46
46
|
*/
|
|
47
47
|
is_cdn?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether an automated client uses the address, such as a search engine's or an AI company's crawler, an uptime monitor, an internet scanner or a webhook sender. `bot` says whose, what it does and whether its operator vouches for the address. Every answer, with or without a key.
|
|
50
|
+
*/
|
|
51
|
+
is_bot?: boolean;
|
|
48
52
|
/**
|
|
49
53
|
* Whether the address was seen in a residential proxy pool. Paid plans.
|
|
50
54
|
*/
|
|
@@ -117,6 +121,10 @@ export type LookupResponse = {
|
|
|
117
121
|
* Detail for `is_cdn`. Empty when false. Paid plans.
|
|
118
122
|
*/
|
|
119
123
|
cdn?: ClassDetail;
|
|
124
|
+
/**
|
|
125
|
+
* Detail for `is_bot`. Empty when false. Paid plans.
|
|
126
|
+
*/
|
|
127
|
+
bot?: BotDetail;
|
|
120
128
|
/**
|
|
121
129
|
* Detail for `is_resproxy`. Empty when false. Paid plans.
|
|
122
130
|
*/
|
|
@@ -169,6 +177,12 @@ export type LookupResponse = {
|
|
|
169
177
|
*/
|
|
170
178
|
hostname?: string;
|
|
171
179
|
abuse?: AbuseContact;
|
|
180
|
+
/**
|
|
181
|
+
* When the request sent `user_agent`, with every field: the agent it
|
|
182
|
+
* names and whether this address bears it out. Absent otherwise.
|
|
183
|
+
*
|
|
184
|
+
*/
|
|
185
|
+
user_agent?: UserAgentVerdict;
|
|
172
186
|
/**
|
|
173
187
|
* On every answer to a key on the free plan, and on no other: `false`
|
|
174
188
|
* while its organization's trial of every field lasts, `true` once the
|
|
@@ -193,6 +207,15 @@ export type BatchLookupRequest = {
|
|
|
193
207
|
*
|
|
194
208
|
*/
|
|
195
209
|
ips: Array<string>;
|
|
210
|
+
/**
|
|
211
|
+
* Each address's `User-Agent`, keyed by the string it is sent as in
|
|
212
|
+
* `ips`. With every field, that address's answer then carries
|
|
213
|
+
* `user_agent`, as a single lookup's does. Never kept.
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
user_agents?: {
|
|
217
|
+
[key: string]: string;
|
|
218
|
+
};
|
|
196
219
|
};
|
|
197
220
|
export type BatchLookupResponse = {
|
|
198
221
|
/**
|
|
@@ -514,11 +537,78 @@ export type Asn = {
|
|
|
514
537
|
/**
|
|
515
538
|
* The country the AS's registry assigned it to.
|
|
516
539
|
*/
|
|
517
|
-
country
|
|
540
|
+
country: string;
|
|
518
541
|
/**
|
|
519
542
|
* The announcement's RPKI status: valid, invalid or not_found.
|
|
520
543
|
*/
|
|
521
|
-
rpki_status
|
|
544
|
+
rpki_status: string;
|
|
545
|
+
};
|
|
546
|
+
export type UserAgentVerdict = {
|
|
547
|
+
/**
|
|
548
|
+
* The agent the user agent names, such as `Googlebot` or `Chrome`; `Unknown` where it names none.
|
|
549
|
+
*/
|
|
550
|
+
agent: string;
|
|
551
|
+
/**
|
|
552
|
+
* `browser`, `inapp`, `automation`, `bot`, `ai-bot`, `http-client` or
|
|
553
|
+
* `unknown`: what kind of client the user agent says it is.
|
|
554
|
+
*
|
|
555
|
+
*/
|
|
556
|
+
kind: string;
|
|
557
|
+
/**
|
|
558
|
+
* `verified`: the agent's operator vouches for this address as it.
|
|
559
|
+
* `spoofed`: the operator of a bot that publishes its addresses, or
|
|
560
|
+
* whose registered space it uses, does not vouch for this one, or this
|
|
561
|
+
* address posed as the bot before. `unverifiable`: a bot no published
|
|
562
|
+
* list or registered space can confirm. `not_bot`: a browser, an app or
|
|
563
|
+
* a script.
|
|
564
|
+
*
|
|
565
|
+
*/
|
|
566
|
+
verdict: 'verified' | 'spoofed' | 'unverifiable' | 'not_bot';
|
|
567
|
+
};
|
|
568
|
+
/**
|
|
569
|
+
* Bot IP's row: whose bot uses the address, the bots it serves or claimed to be, what they do, and how that is known.
|
|
570
|
+
*/
|
|
571
|
+
export type BotDetail = {
|
|
572
|
+
/**
|
|
573
|
+
* The bot operator's ID; for an address that is not verified, the operator its claim named. Empty where no operator is known.
|
|
574
|
+
*/
|
|
575
|
+
provider?: string;
|
|
576
|
+
/**
|
|
577
|
+
* That operator's name, empty where no operator is known.
|
|
578
|
+
*/
|
|
579
|
+
provider_name?: string;
|
|
580
|
+
/**
|
|
581
|
+
* The bots the address serves, as their user agents name them (`Googlebot`, `GPTBot`); for an address that is not verified, the bots it claimed to be. One address can serve several, and `[]` means none is named.
|
|
582
|
+
*/
|
|
583
|
+
agents?: Array<string>;
|
|
584
|
+
/**
|
|
585
|
+
* What those bots do: `search_engine`, `ai_training`, `ai_search`, `ai_assistant`, `ai_agent`, `seo`, `ads`, `preview`, `feed`, `monitoring`, `archiver`, `scanner`, `link_security`, `webhook` or `other`; `[]` where unknown.
|
|
586
|
+
*/
|
|
587
|
+
categories?: Array<string>;
|
|
588
|
+
/**
|
|
589
|
+
* Whether the operator vouches for the address, so the bots in `agents` really are its.
|
|
590
|
+
*/
|
|
591
|
+
verified?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* `verified` (the operator vouches for the address), `declared` (it names itself a bot that cannot be verified), `spoofed` (it claimed a bot whose operator vouches for other addresses) or `undeclared` (it hides as a browser and behaves as automation).
|
|
594
|
+
*/
|
|
595
|
+
identity?: string;
|
|
596
|
+
/**
|
|
597
|
+
* How a verified address verified: `list` (the operator publishes it), `rdns` (its reverse DNS name ends in a suffix the operator documents and resolves back) or `owner` (the operator's own space, seen claiming its bot); empty when not verified.
|
|
598
|
+
*/
|
|
599
|
+
verified_by?: string;
|
|
600
|
+
/**
|
|
601
|
+
* `high`, `medium` or `low`: how sure we are the address is what the row says.
|
|
602
|
+
*/
|
|
603
|
+
confidence?: string;
|
|
604
|
+
/**
|
|
605
|
+
* The first day the address was seen as such.
|
|
606
|
+
*/
|
|
607
|
+
first_seen?: string;
|
|
608
|
+
/**
|
|
609
|
+
* The last day it was.
|
|
610
|
+
*/
|
|
611
|
+
last_seen?: string;
|
|
522
612
|
};
|
|
523
613
|
/**
|
|
524
614
|
* The mobile network whose space the address is, from our Carrier IP
|
|
@@ -1066,7 +1156,16 @@ export type LookupIpData = {
|
|
|
1066
1156
|
*/
|
|
1067
1157
|
ip: string;
|
|
1068
1158
|
};
|
|
1069
|
-
query?:
|
|
1159
|
+
query?: {
|
|
1160
|
+
/**
|
|
1161
|
+
* The `User-Agent` header of the request you are deciding on. With
|
|
1162
|
+
* every field, on a paid plan or the trial, the answer then carries
|
|
1163
|
+
* `user_agent`: the agent it names, and whether this address bears
|
|
1164
|
+
* that out. Never kept, and nothing sent with a lookup feeds our data.
|
|
1165
|
+
*
|
|
1166
|
+
*/
|
|
1167
|
+
user_agent?: string;
|
|
1168
|
+
};
|
|
1070
1169
|
url: '/{ip}';
|
|
1071
1170
|
};
|
|
1072
1171
|
export type LookupIpErrors = {
|
|
@@ -1112,7 +1211,16 @@ export type LookupIpResponse = LookupIpResponses[keyof LookupIpResponses];
|
|
|
1112
1211
|
export type LookupMyIpData = {
|
|
1113
1212
|
body?: never;
|
|
1114
1213
|
path?: never;
|
|
1115
|
-
query?:
|
|
1214
|
+
query?: {
|
|
1215
|
+
/**
|
|
1216
|
+
* The `User-Agent` header of the request you are deciding on. With
|
|
1217
|
+
* every field, on a paid plan or the trial, the answer then carries
|
|
1218
|
+
* `user_agent`: the agent it names, and whether this address bears
|
|
1219
|
+
* that out. Never kept, and nothing sent with a lookup feeds our data.
|
|
1220
|
+
*
|
|
1221
|
+
*/
|
|
1222
|
+
user_agent?: string;
|
|
1223
|
+
};
|
|
1116
1224
|
url: '/myip';
|
|
1117
1225
|
};
|
|
1118
1226
|
export type LookupMyIpErrors = {
|
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export type { OauthOptions, AuthorizationUrlOptions, OauthMetadata, TokenRespons
|
|
|
6
6
|
export { isBogon } from './bogon.js';
|
|
7
7
|
export { VPNDetectionError, OauthError, OauthAccessDeniedError, OauthExpiredTokenError, } from './errors.js';
|
|
8
8
|
export type { ErrorKind } from './errors.js';
|
|
9
|
-
export type { Result, VpnDetail, ClassDetail, ProxyDetail, PubproxyDetail, CarrierDetail, SatelliteDetail, SshDetail, SmtpDetail, WebDetail, DnsResolverDetail, BitTorrentDetail, Location, Asn, Company, AbuseContact, LookupResponse, } from './types.js';
|
|
9
|
+
export type { Result, VpnDetail, ClassDetail, ProxyDetail, PubproxyDetail, CarrierDetail, SatelliteDetail, SshDetail, SmtpDetail, WebDetail, DnsResolverDetail, BitTorrentDetail, BotDetail, Location, Asn, Company, AbuseContact, LookupResponse, } from './types.js';
|
|
10
10
|
export type { Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, } from './generated/types.gen.js';
|
package/dist/shapes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const LOOKUP_MEMBERS: readonly ["ip", "is_vpn"];
|
|
2
2
|
export declare const LOCATION_MEMBERS: readonly ["continent", "continent_name", "country", "country_name", "timezone", "currency_code", "currency_name", "currency_symbol", "flag_emoji", "flag_unicode"];
|
|
3
|
-
export declare const ASN_MEMBERS: readonly ["asn", "name", "domain", "type", "prefix"];
|
|
3
|
+
export declare const ASN_MEMBERS: readonly ["asn", "name", "domain", "type", "prefix", "country", "rpki_status"];
|
|
4
4
|
export declare const COMPANY_MEMBERS: readonly ["name", "domain"];
|
|
5
5
|
export declare const ABUSE_CONTACT_MEMBERS: readonly ["email"];
|
|
6
6
|
export declare const WEB_DETAIL_MEMBERS: readonly ["port", "tls_ok", "session_ok", "status_code", "server", "location", "title", "cert_subject_cn", "cert_subject_o", "cert_issuer_dn", "cert_browser_trusted", "tls_version", "first_seen", "last_seen"];
|
|
@@ -16,6 +16,7 @@ export declare const VPN_DETAIL_TYPES: Record<string, Kind>;
|
|
|
16
16
|
export declare const CLASS_DETAIL_TYPES: Record<string, Kind>;
|
|
17
17
|
export declare const PROXY_DETAIL_TYPES: Record<string, Kind>;
|
|
18
18
|
export declare const PUBPROXY_DETAIL_TYPES: Record<string, Kind>;
|
|
19
|
+
export declare const BOT_DETAIL_TYPES: Record<string, Kind>;
|
|
19
20
|
export declare const CARRIER_DETAIL_TYPES: Record<string, Kind>;
|
|
20
21
|
export declare const SATELLITE_DETAIL_TYPES: Record<string, Kind>;
|
|
21
22
|
export declare const SSH_DETAIL_TYPES: Record<string, Kind>;
|
package/dist/shapes.js
CHANGED
|
@@ -7,7 +7,7 @@ export const LOCATION_MEMBERS = [
|
|
|
7
7
|
'continent', 'continent_name', 'country', 'country_name', 'timezone', 'currency_code', 'currency_name',
|
|
8
8
|
'currency_symbol', 'flag_emoji', 'flag_unicode',
|
|
9
9
|
];
|
|
10
|
-
export const ASN_MEMBERS = ['asn', 'name', 'domain', 'type', 'prefix'];
|
|
10
|
+
export const ASN_MEMBERS = ['asn', 'name', 'domain', 'type', 'prefix', 'country', 'rpki_status'];
|
|
11
11
|
export const COMPANY_MEMBERS = ['name', 'domain'];
|
|
12
12
|
export const ABUSE_CONTACT_MEMBERS = ['email'];
|
|
13
13
|
export const WEB_DETAIL_MEMBERS = [
|
|
@@ -29,6 +29,7 @@ export const LOOKUP_TYPES = {
|
|
|
29
29
|
mobproxy: 'object', pubproxy: 'object', carrier: 'object', satellite: 'object', ssh: 'object', smtp: 'object',
|
|
30
30
|
web: 'array', dns_resolver: 'object', bittorrent: 'object', location: 'object', asn: 'object',
|
|
31
31
|
company: 'object', hostname: 'string', abuse: 'object', trial_expired: 'boolean', cap_reached: 'boolean',
|
|
32
|
+
is_bot: 'boolean', bot: 'object', user_agent: 'object',
|
|
32
33
|
};
|
|
33
34
|
export const VPN_DETAIL_TYPES = {
|
|
34
35
|
provider: 'string', provider_name: 'string', last_seen: 'date', confidence: 'string', method: 'string',
|
|
@@ -44,6 +45,10 @@ export const PUBPROXY_DETAIL_TYPES = {
|
|
|
44
45
|
entry: 'boolean', exit: 'boolean', protocols: 'array', num_ports: 'integer', num_proxies: 'integer',
|
|
45
46
|
last_seen: 'date', last_usable: 'string',
|
|
46
47
|
};
|
|
48
|
+
export const BOT_DETAIL_TYPES = {
|
|
49
|
+
provider: 'string', provider_name: 'string', agents: 'array', categories: 'array', verified: 'boolean',
|
|
50
|
+
identity: 'string', verified_by: 'string', confidence: 'string', first_seen: 'string', last_seen: 'string',
|
|
51
|
+
};
|
|
47
52
|
export const CARRIER_DETAIL_TYPES = {
|
|
48
53
|
name: 'string', mcc: 'string', mnc: 'string', country: 'string', confidence: 'string',
|
|
49
54
|
};
|
|
@@ -166,7 +171,7 @@ const DETAILS = [
|
|
|
166
171
|
['dcproxy', PROXY_DETAIL_TYPES], ['mobproxy', PROXY_DETAIL_TYPES], ['pubproxy', PUBPROXY_DETAIL_TYPES],
|
|
167
172
|
['carrier', CARRIER_DETAIL_TYPES], ['satellite', SATELLITE_DETAIL_TYPES], ['ssh', SSH_DETAIL_TYPES],
|
|
168
173
|
['smtp', SMTP_DETAIL_TYPES], ['dns_resolver', DNS_RESOLVER_DETAIL_TYPES],
|
|
169
|
-
['bittorrent', BITTORRENT_DETAIL_TYPES],
|
|
174
|
+
['bittorrent', BITTORRENT_DETAIL_TYPES], ['bot', BOT_DETAIL_TYPES],
|
|
170
175
|
];
|
|
171
176
|
const SHARED = [
|
|
172
177
|
['location', LOCATION_MEMBERS, LOCATION_TYPES],
|
|
@@ -179,6 +184,7 @@ export function isLookup(data) {
|
|
|
179
184
|
&& DETAILS.every(([member, types]) => optional(data[member], (detail) => typed(detail, [], types)))
|
|
180
185
|
&& optional(data['pubproxy'], (pubproxy) => lists(pubproxy, 'protocols', isString))
|
|
181
186
|
&& optional(data['bittorrent'], (bittorrent) => lists(bittorrent, 'clients', isString))
|
|
187
|
+
&& optional(data['bot'], (bot) => lists(bot, 'agents', isString) && lists(bot, 'categories', isString))
|
|
182
188
|
&& optional(data['web'], (web) => every(web, (row) => typed(row, WEB_DETAIL_MEMBERS, WEB_DETAIL_TYPES)))
|
|
183
189
|
&& SHARED.every(([member, required, types]) => optional(data[member], (o) => typed(o, required, types)));
|
|
184
190
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type { AbuseContact, Asn, BitTorrentDetail, CarrierDetail, ClassDetail, Company, DnsResolverDetail, Location, LookupResponse, ProxyDetail, PubproxyDetail, SatelliteDetail, SmtpDetail, SshDetail, VpnDetail, WebDetail } from './generated/types.gen.js';
|
|
2
|
-
export type { AbuseContact,
|
|
1
|
+
import type { AbuseContact, Asn as WireAsn, BitTorrentDetail, BotDetail, CarrierDetail, ClassDetail, Company, DnsResolverDetail, Location, LookupResponse as WireLookupResponse, ProxyDetail, PubproxyDetail, SatelliteDetail, SmtpDetail, SshDetail, VpnDetail, WebDetail } from './generated/types.gen.js';
|
|
2
|
+
export type { AbuseContact, BitTorrentDetail, BotDetail, CarrierDetail, ClassDetail, Company, DnsResolverDetail, Location, ProxyDetail, PubproxyDetail, SatelliteDetail, SmtpDetail, SshDetail, VpnDetail, WebDetail, };
|
|
3
|
+
/** The AS announcing an address. Every answer carries `country` and `rpki_status`. */
|
|
4
|
+
export type Asn = Omit<WireAsn, 'country' | 'rpki_status'> & Partial<Pick<WireAsn, 'country' | 'rpki_status'>>;
|
|
5
|
+
/**
|
|
6
|
+
* A lookup's answer as it came off the wire. `user_agent` is left out: it answers
|
|
7
|
+
* a user agent sent with the lookup, which this client sends none of.
|
|
8
|
+
*/
|
|
9
|
+
export type LookupResponse = Omit<WireLookupResponse, 'asn' | 'user_agent'> & {
|
|
10
|
+
asn?: Asn;
|
|
11
|
+
};
|
|
3
12
|
/**
|
|
4
13
|
* What a lookup answers.
|
|
5
14
|
*
|
|
@@ -39,6 +48,11 @@ export interface Result {
|
|
|
39
48
|
isWeb?: boolean;
|
|
40
49
|
isDnsResolver?: boolean;
|
|
41
50
|
isBittorrent?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether an automated client uses the address, such as a search engine's or an AI company's
|
|
53
|
+
* crawler, an uptime monitor or a webhook sender. Every plan includes this; `bot` says whose.
|
|
54
|
+
*/
|
|
55
|
+
isBot?: boolean;
|
|
42
56
|
/**
|
|
43
57
|
* On answers to a key on the free plan only: `false` while its organization's trial of every
|
|
44
58
|
* field lasts, `true` once the answer has Unlimited's.
|
|
@@ -67,6 +81,11 @@ export interface Result {
|
|
|
67
81
|
web?: WebDetail[];
|
|
68
82
|
dnsResolver?: DnsResolverDetail;
|
|
69
83
|
bittorrent?: BitTorrentDetail;
|
|
84
|
+
/**
|
|
85
|
+
* Whose bot uses the address, what it does and whether its operator vouches for the address.
|
|
86
|
+
* Paid plans. `agents` and `categories` keep the API's order.
|
|
87
|
+
*/
|
|
88
|
+
bot?: BotDetail;
|
|
70
89
|
/**
|
|
71
90
|
* Where the address is, on every answer, with or without a key: every key present, empty
|
|
72
91
|
* strings where it is not known. The region, city, postal code, coordinates and the rest
|
package/dist/types.js
CHANGED
|
@@ -7,7 +7,7 @@ const RESULT_NAMES = {
|
|
|
7
7
|
is_resproxy: 'isResproxy', is_dcproxy: 'isDcproxy', is_mobproxy: 'isMobproxy', is_pubproxy: 'isPubproxy',
|
|
8
8
|
is_anycast: 'isAnycast', is_carrier: 'isCarrier', is_satellite: 'isSatellite', is_ssh: 'isSsh',
|
|
9
9
|
is_smtp: 'isSmtp', is_web: 'isWeb', is_dns_resolver: 'isDnsResolver', is_bittorrent: 'isBittorrent',
|
|
10
|
-
trial_expired: 'trialExpired', cap_reached: 'capReached',
|
|
10
|
+
is_bot: 'isBot', trial_expired: 'trialExpired', cap_reached: 'capReached', bot: 'bot',
|
|
11
11
|
vpn: 'vpn', hosting: 'hosting', relay: 'relay', tor: 'tor', cdn: 'cdn', resproxy: 'resproxy', dcproxy: 'dcproxy',
|
|
12
12
|
mobproxy: 'mobproxy', pubproxy: 'pubproxy', carrier: 'carrier', satellite: 'satellite', ssh: 'ssh', smtp: 'smtp',
|
|
13
13
|
web: 'web', dns_resolver: 'dnsResolver', bittorrent: 'bittorrent', location: 'location', asn: 'asn',
|
package/package.json
CHANGED