internetdata-web 1.3.3 → 1.5.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 +5 -4
- package/dist/bogon.js +2 -0
- package/dist/client.d.ts +3 -3
- package/dist/client.js +18 -3
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/sdk.gen.d.ts +4 -2
- package/dist/generated/sdk.gen.js +4 -2
- package/dist/generated/types.gen.d.ts +195 -12
- package/dist/index.d.ts +1 -1
- package/dist/shapes.d.ts +17 -2
- package/dist/shapes.js +50 -13
- package/dist/store.d.ts +1 -1
- package/dist/store.js +1 -1
- package/dist/types.d.ts +36 -2
- package/dist/types.js +4 -3
- 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 Tor, relay, anycast, carrier, satellite and the five service flags (SSH, SMTP, web, DNS resolver and BitTorrent), reverse DNS, country-level `location`, `asn`, the company's name and domain and the abuse email, 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 Tor, relay, bot, anycast, carrier, satellite and the five service flags (SSH, SMTP, web, DNS resolver and BitTorrent), reverse DNS, country-level `location`, `asn`, the company's name and domain and the abuse email, 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 { InternetData } from 'internetdata-web';
|
|
@@ -57,6 +57,7 @@ const result = await client.lookup('146.70.116.130');
|
|
|
57
57
|
console.log(result.isVpn); // on a paid plan
|
|
58
58
|
console.log(result.vpn?.provider); // on a paid plan
|
|
59
59
|
console.log(result.location.city); // on a paid plan
|
|
60
|
+
console.log(result.bot?.agents); // ['Googlebot'] for a crawler's address, on a paid plan
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
An extension can sign its user in rather than ask them to paste a key: see Sign in with OAuth below.
|
|
@@ -73,7 +74,7 @@ console.log(domain.isRegistered); // true
|
|
|
73
74
|
console.log(domain.dns?.mx); // on a paid plan
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
Unlimited answers an AS's registration, and whether a domain is registered and which record types it has. A paid plan adds the AS's whois record, prefixes, rank, Tier 1 flag, upstreams, peers, downstreams and hosted domains, and the domain's records, IP ranges
|
|
77
|
+
Unlimited answers an AS's registration, and whether a domain is registered and which record types it has. A paid plan adds the AS's whois record, prefixes, rank, Tier 1 flag, upstreams, peers, downstreams and hosted domains, and the domain's records, IP ranges, whether it is disposable, the network behind each of its addresses, the other domains on its first IPv4 address, what its home page says and links to, and the domains whose home pages redirect or link to it. Neither lookup is cached or batched, and `lookup` refuses an AS or a domain before sending it.
|
|
77
78
|
|
|
78
79
|
### Your own address
|
|
79
80
|
|
|
@@ -94,7 +95,7 @@ console.log(ent.usage.requests); // 580
|
|
|
94
95
|
console.log(ent.usage.window_end); // when the allowance resets
|
|
95
96
|
```
|
|
96
97
|
|
|
97
|
-
Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period
|
|
98
|
+
Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period; it is the same number a lookup is gated on. `hard_limit` is null on an uncapped plan, which is not the same as zero. It needs a key, so it belongs where a key does.
|
|
98
99
|
|
|
99
100
|
### Batch lookup
|
|
100
101
|
|
|
@@ -263,7 +264,7 @@ The library is ES2022 and needs only what a browser has, `fetch` and, for PKCE,
|
|
|
263
264
|
|
|
264
265
|
### Absent is not false
|
|
265
266
|
|
|
266
|
-
Unlimited leaves out `isVpn`, `isHosting`, `isCdn` and the four proxy flags, the detail behind them, and the paid members inside `location`, `asn`, `company` and `abuse`, such as `location.city`; a free-plan key's answer carries `trialExpired`, true once its trial is spent. A paid key's carries `capReached`, true once its organization's overage cap is reached, when the answer has Unlimited's fields and isn't billed. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
|
|
267
|
+
Unlimited leaves out `isVpn`, `isHosting`, `isCdn` and the four proxy flags, the detail behind them, `bot` (whose bot it is, behind `isBot`), and the paid members inside `location`, `asn`, `company` and `abuse`, such as `location.city`; a free-plan key's answer carries `trialExpired`, true once its trial is spent. A paid key's carries `capReached`, true once its organization's overage cap is reached, when the answer has Unlimited's fields and isn't billed. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
|
|
267
268
|
|
|
268
269
|
```js
|
|
269
270
|
result.isVpn ?? false // when you only want the flag
|
package/dist/bogon.js
CHANGED
|
@@ -65,6 +65,7 @@ function bogonAnswer(ip) {
|
|
|
65
65
|
is_pubproxy: false,
|
|
66
66
|
is_hosting: false,
|
|
67
67
|
is_cdn: false,
|
|
68
|
+
is_bot: false,
|
|
68
69
|
is_anycast: false,
|
|
69
70
|
is_carrier: false,
|
|
70
71
|
is_satellite: false,
|
|
@@ -82,6 +83,7 @@ function bogonAnswer(ip) {
|
|
|
82
83
|
pubproxy: {},
|
|
83
84
|
hosting: {},
|
|
84
85
|
cdn: {},
|
|
86
|
+
bot: {},
|
|
85
87
|
carrier: {},
|
|
86
88
|
satellite: {},
|
|
87
89
|
ssh: {},
|
package/dist/client.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { type CacheStore } from './store.js';
|
|
|
5
5
|
import { type AsnResult, type DomainResult, type Result } from './types.js';
|
|
6
6
|
export declare const DEFAULT_BASE_URL = "https://api.internetdata.io";
|
|
7
7
|
export interface CacheOptions {
|
|
8
|
-
/** Maximum number of addresses held in memory. Default 10000. */
|
|
8
|
+
/** Maximum number of addresses held in memory, a whole number from 1. Default 10000. */
|
|
9
9
|
max?: number;
|
|
10
10
|
/**
|
|
11
|
-
* How long an answer stays fresh, in milliseconds. Default 1 hour. An answer
|
|
11
|
+
* How long an answer stays fresh, in whole milliseconds from 1. Default 1 hour. An answer
|
|
12
12
|
* marked `trialExpired` or `capReached` stays a minute at most.
|
|
13
13
|
*/
|
|
14
14
|
ttlMs?: number;
|
|
@@ -150,7 +150,7 @@ export declare class InternetData {
|
|
|
150
150
|
*
|
|
151
151
|
* Usage counts against the ALLOWANCE WINDOW - on a paid plan the
|
|
152
152
|
* anniversary of the subscription, not the calendar month and not the
|
|
153
|
-
* billing period, and on the free plan the UTC
|
|
153
|
+
* billing period, and on the free plan the UTC month - and it is the same
|
|
154
154
|
* number a lookup is gated on. It can lag by a few seconds, because
|
|
155
155
|
* requests are counted in memory and flushed in aggregate.
|
|
156
156
|
*
|
package/dist/client.js
CHANGED
|
@@ -56,9 +56,9 @@ export class InternetData {
|
|
|
56
56
|
this.timeoutMs = checkTimeout(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS;
|
|
57
57
|
this.limit = pLimit(checkConcurrency(options.concurrency) ?? 8);
|
|
58
58
|
const cache = options.cache === false ? null : (options.cache ?? {});
|
|
59
|
-
const ttlMs = cache?.ttlMs ?? 60 * 60 * 1000;
|
|
59
|
+
const ttlMs = checkCacheOption('ttlMs', cache?.ttlMs) ?? 60 * 60 * 1000;
|
|
60
60
|
this.cache = cache === null ? null : new LRUCache({
|
|
61
|
-
max: cache.max ?? 10_000,
|
|
61
|
+
max: checkCacheOption('max', cache.max) ?? 10_000,
|
|
62
62
|
ttl: ttlMs,
|
|
63
63
|
// Concurrent misses for one address share one request: every
|
|
64
64
|
// `fetch()` while it is in flight gets the same promise, and a
|
|
@@ -214,7 +214,7 @@ export class InternetData {
|
|
|
214
214
|
*
|
|
215
215
|
* Usage counts against the ALLOWANCE WINDOW - on a paid plan the
|
|
216
216
|
* anniversary of the subscription, not the calendar month and not the
|
|
217
|
-
* billing period, and on the free plan the UTC
|
|
217
|
+
* billing period, and on the free plan the UTC month - and it is the same
|
|
218
218
|
* number a lookup is gated on. It can lag by a few seconds, because
|
|
219
219
|
* requests are counted in memory and flushed in aggregate.
|
|
220
220
|
*
|
|
@@ -430,6 +430,21 @@ function checkApiKey(apiKey) {
|
|
|
430
430
|
function apexOf(baseUrl) {
|
|
431
431
|
return baseUrl.replace(/^(https?:\/\/)api(?:-([^./:@]+))?\./i, (_, scheme, env) => (env === undefined ? scheme : `${scheme}${env}.`));
|
|
432
432
|
}
|
|
433
|
+
/**
|
|
434
|
+
* A cache size or TTL refused where it is set, `null` reading as unset. lru-cache
|
|
435
|
+
* reads a zero or NaN TTL as none, which would keep every answer for good, a spent
|
|
436
|
+
* trial's included, and a zero size as no bound; anything else not whole it throws
|
|
437
|
+
* a bare TypeError for.
|
|
438
|
+
*/
|
|
439
|
+
function checkCacheOption(name, value) {
|
|
440
|
+
if (value === undefined || value === null) {
|
|
441
|
+
return undefined;
|
|
442
|
+
}
|
|
443
|
+
if (!(typeof value === 'number' && Number.isSafeInteger(value) && value >= 1)) {
|
|
444
|
+
throw new InternetDataError('bad_request', `cache.${name} must be a whole number from 1, got ${String(value)}`);
|
|
445
|
+
}
|
|
446
|
+
return value;
|
|
447
|
+
}
|
|
433
448
|
function unreadableEntry(ip) {
|
|
434
449
|
return new InternetDataError('server_error', `unreadable batch answer for ${ip}, status 200`, 200);
|
|
435
450
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { lookupAsn, lookupBatch, lookupDomain, lookupIp, lookupMyIp, myEntitlement, oauthMetadata, oauthRevoke, oauthToken, type Options } from './sdk.gen.js';
|
|
2
|
-
export type { AbuseContact, Asn, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BatchLookupError, BatchLookupRequest, BatchLookupResponse, BitTorrentDetail, CarrierDetail, ClassDetail, ClientOptions, Company, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainDns, DomainIpRange, DomainIpRanges, DomainLookupResponse, Entitlement, EntitlementApikey, EntitlementError, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupAsnData, LookupAsnError, LookupAsnErrors, LookupAsnResponse, LookupAsnResponses, LookupBatchData, LookupBatchError, LookupBatchErrors, LookupBatchResponse, LookupBatchResponses, LookupDomainData, LookupDomainError, LookupDomainErrors, LookupDomainResponse, LookupDomainResponses, 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, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, TokenRequest, TokenResponse, WebDetail, Whois } from './types.gen.js';
|
|
2
|
+
export type { AbuseContact, Asn, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BatchLookupError, BatchLookupRequest, BatchLookupResponse, BitTorrentDetail, BotDetail, CarrierDetail, ClassDetail, ClientOptions, CohostedDomains, Company, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainBacklinks, DomainDns, DomainHost, DomainIpRange, DomainIpRanges, DomainLookupResponse, DomainRedirects, DomainWeb, DomainWebLinks, Entitlement, EntitlementApikey, EntitlementError, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupAsnData, LookupAsnError, LookupAsnErrors, LookupAsnResponse, LookupAsnResponses, LookupBatchData, LookupBatchError, LookupBatchErrors, LookupBatchResponse, LookupBatchResponses, LookupDomainData, LookupDomainError, LookupDomainErrors, LookupDomainResponse, LookupDomainResponses, 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, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, TokenRequest, TokenResponse, UserAgentVerdict, WebDetail, Whois } from './types.gen.js';
|
|
@@ -93,8 +93,10 @@ export declare const lookupAsn: <ThrowOnError extends boolean = false>(options:
|
|
|
93
93
|
*
|
|
94
94
|
* Answers what InternetData knows about one domain from its latest snapshots: on every plan
|
|
95
95
|
* whether it is registered and which DNS record types it has; on a paid one the records themselves, up to
|
|
96
|
-
* 100 a type, the
|
|
97
|
-
*
|
|
96
|
+
* 100 a type, the network announcing each address, the other domains on its first IPv4 address, the
|
|
97
|
+
* organization's IP ranges, whether it is a disposable email domain, what its home page says of itself and
|
|
98
|
+
* links to, and the domains whose home page redirects or links to it. An internationalized name is answered
|
|
99
|
+
* under its punycode spelling.
|
|
98
100
|
*
|
|
99
101
|
*/
|
|
100
102
|
export declare const lookupDomain: <ThrowOnError extends boolean = false>(options: Options<LookupDomainData, ThrowOnError>) => RequestResult<LookupDomainResponses, LookupDomainErrors, ThrowOnError>;
|
|
@@ -160,8 +160,10 @@ export const lookupAsn = (options) => (options.client ?? client).get({
|
|
|
160
160
|
*
|
|
161
161
|
* Answers what InternetData knows about one domain from its latest snapshots: on every plan
|
|
162
162
|
* whether it is registered and which DNS record types it has; on a paid one the records themselves, up to
|
|
163
|
-
* 100 a type, the
|
|
164
|
-
*
|
|
163
|
+
* 100 a type, the network announcing each address, the other domains on its first IPv4 address, the
|
|
164
|
+
* organization's IP ranges, whether it is a disposable email domain, what its home page says of itself and
|
|
165
|
+
* links to, and the domains whose home page redirects or links to it. An internationalized name is answered
|
|
166
|
+
* under its punycode spelling.
|
|
165
167
|
*
|
|
166
168
|
*/
|
|
167
169
|
export const lookupDomain = (options) => (options.client ?? client).get({
|
|
@@ -163,6 +163,10 @@ export type LookupResponse = {
|
|
|
163
163
|
* In CDN IP: a content delivery network. Paid plans and the trial.
|
|
164
164
|
*/
|
|
165
165
|
is_cdn?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* In Bot IP: an automated client's 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.
|
|
168
|
+
*/
|
|
169
|
+
is_bot: boolean;
|
|
166
170
|
/**
|
|
167
171
|
* In Anycast IP: announced from many places at once.
|
|
168
172
|
*/
|
|
@@ -231,6 +235,10 @@ export type LookupResponse = {
|
|
|
231
235
|
* `{}` when `is_cdn` is false. Paid plans and the trial.
|
|
232
236
|
*/
|
|
233
237
|
cdn?: ClassDetail;
|
|
238
|
+
/**
|
|
239
|
+
* `{}` when `is_bot` is false. Paid plans and the trial.
|
|
240
|
+
*/
|
|
241
|
+
bot?: BotDetail;
|
|
234
242
|
/**
|
|
235
243
|
* `{}` when `is_carrier` is false. Paid plans and the trial.
|
|
236
244
|
*/
|
|
@@ -270,6 +278,10 @@ export type LookupResponse = {
|
|
|
270
278
|
whois?: Whois;
|
|
271
279
|
rwhois?: Rwhois;
|
|
272
280
|
hosted_domains?: HostedDomains;
|
|
281
|
+
/**
|
|
282
|
+
* When the request sent `user_agent`, with every field, the agent it names and whether this address bears it out. Absent otherwise.
|
|
283
|
+
*/
|
|
284
|
+
user_agent?: UserAgentVerdict;
|
|
273
285
|
/**
|
|
274
286
|
* On every answer to a key on the free plan, and on no other: `false` while its organization's trial of every field lasts, `true` once the answer has Unlimited's fields.
|
|
275
287
|
*/
|
|
@@ -409,6 +421,62 @@ export type SatelliteDetail = {
|
|
|
409
421
|
*/
|
|
410
422
|
confidence?: string;
|
|
411
423
|
};
|
|
424
|
+
export type UserAgentVerdict = {
|
|
425
|
+
/**
|
|
426
|
+
* The agent the user agent names, such as `Googlebot` or `Chrome`; `Unknown` where it names none.
|
|
427
|
+
*/
|
|
428
|
+
agent: string;
|
|
429
|
+
/**
|
|
430
|
+
* `browser`, `inapp`, `automation`, `bot`, `ai-bot`, `http-client` or `unknown`: what kind of client the user agent says it is.
|
|
431
|
+
*/
|
|
432
|
+
kind: string;
|
|
433
|
+
/**
|
|
434
|
+
* `verified`: the agent's operator vouches for this address as it. `spoofed`: the operator of a bot that publishes its addresses, or whose registered space it uses, does not vouch for this one, or this address posed as the bot before. `unverifiable`: a bot no published list or registered space can confirm. `not_bot`: a browser, an app or a script.
|
|
435
|
+
*/
|
|
436
|
+
verdict: 'verified' | 'spoofed' | 'unverifiable' | 'not_bot';
|
|
437
|
+
};
|
|
438
|
+
export type BotDetail = {
|
|
439
|
+
/**
|
|
440
|
+
* The bot operator's ID in Bot Provider, empty where no operator is known.
|
|
441
|
+
*/
|
|
442
|
+
provider?: string;
|
|
443
|
+
/**
|
|
444
|
+
* The operator's name, empty where no operator is known.
|
|
445
|
+
*/
|
|
446
|
+
provider_name?: string;
|
|
447
|
+
/**
|
|
448
|
+
* 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.
|
|
449
|
+
*/
|
|
450
|
+
agents?: Array<string>;
|
|
451
|
+
/**
|
|
452
|
+
* 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.
|
|
453
|
+
*/
|
|
454
|
+
categories?: Array<string>;
|
|
455
|
+
/**
|
|
456
|
+
* Whether the operator vouches for the address, so the bots in `agents` really are its.
|
|
457
|
+
*/
|
|
458
|
+
verified?: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* `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).
|
|
461
|
+
*/
|
|
462
|
+
identity?: string;
|
|
463
|
+
/**
|
|
464
|
+
* 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.
|
|
465
|
+
*/
|
|
466
|
+
verified_by?: string;
|
|
467
|
+
/**
|
|
468
|
+
* `high`, `medium` or `low`: how sure we are the address is what the row says.
|
|
469
|
+
*/
|
|
470
|
+
confidence?: string;
|
|
471
|
+
/**
|
|
472
|
+
* The first day the address was seen as such.
|
|
473
|
+
*/
|
|
474
|
+
first_seen?: string;
|
|
475
|
+
/**
|
|
476
|
+
* The last day it was.
|
|
477
|
+
*/
|
|
478
|
+
last_seen?: string;
|
|
479
|
+
};
|
|
412
480
|
export type SshDetail = {
|
|
413
481
|
/**
|
|
414
482
|
* The port the server answered on.
|
|
@@ -695,11 +763,11 @@ export type Asn = {
|
|
|
695
763
|
/**
|
|
696
764
|
* The country its registry assigned it to.
|
|
697
765
|
*/
|
|
698
|
-
country
|
|
766
|
+
country: string;
|
|
699
767
|
/**
|
|
700
768
|
* The announcement's RPKI status.
|
|
701
769
|
*/
|
|
702
|
-
rpki_status
|
|
770
|
+
rpki_status: string;
|
|
703
771
|
};
|
|
704
772
|
/**
|
|
705
773
|
* Who uses the address, from IP Company.
|
|
@@ -1030,11 +1098,19 @@ export type DomainLookupResponse = {
|
|
|
1030
1098
|
*/
|
|
1031
1099
|
has_cname: boolean;
|
|
1032
1100
|
dns?: DomainDns;
|
|
1101
|
+
/**
|
|
1102
|
+
* The network announcing each address in `dns.a` and then `dns.aaaa`, from IP ASN; `[]` where it resolves to none. Paid plans and the trial.
|
|
1103
|
+
*/
|
|
1104
|
+
hosting?: Array<DomainHost>;
|
|
1105
|
+
cohosted_domains?: CohostedDomains;
|
|
1033
1106
|
ip_ranges?: DomainIpRanges;
|
|
1034
1107
|
/**
|
|
1035
1108
|
* `{}` when `is_disposable` is false. Paid plans and the trial.
|
|
1036
1109
|
*/
|
|
1037
1110
|
disposable?: DisposableDetail;
|
|
1111
|
+
web?: DomainWeb;
|
|
1112
|
+
redirects?: DomainRedirects;
|
|
1113
|
+
backlinks?: DomainBacklinks;
|
|
1038
1114
|
/**
|
|
1039
1115
|
* On every answer to a key on the free plan, and on no other: `false` while its organization's trial of every field lasts, `true` once the answer has Unlimited's fields.
|
|
1040
1116
|
*/
|
|
@@ -1044,6 +1120,97 @@ export type DomainLookupResponse = {
|
|
|
1044
1120
|
*/
|
|
1045
1121
|
cap_reached?: boolean;
|
|
1046
1122
|
};
|
|
1123
|
+
/**
|
|
1124
|
+
* An address the domain resolves to and the network announcing it.
|
|
1125
|
+
*/
|
|
1126
|
+
export type DomainHost = {
|
|
1127
|
+
/**
|
|
1128
|
+
* One address the domain resolves to.
|
|
1129
|
+
*/
|
|
1130
|
+
ip: string;
|
|
1131
|
+
/**
|
|
1132
|
+
* The network announcing it, as an address lookup's `asn`; every member empty where IP ASN holds none.
|
|
1133
|
+
*/
|
|
1134
|
+
asn: Asn;
|
|
1135
|
+
};
|
|
1136
|
+
/**
|
|
1137
|
+
* From IP Hosted Domains: the other registered domains on the domain's first IPv4 address, how many and the 10 most popular. Paid plans and the trial.
|
|
1138
|
+
*/
|
|
1139
|
+
export type CohostedDomains = {
|
|
1140
|
+
/**
|
|
1141
|
+
* The domain's first IPv4 address, `''` where it has none.
|
|
1142
|
+
*/
|
|
1143
|
+
ip: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* How many other registered domains resolve to it.
|
|
1146
|
+
*/
|
|
1147
|
+
total: number;
|
|
1148
|
+
/**
|
|
1149
|
+
* Up to 10 of them, the most popular first, the domain itself left out; `[]` when none does.
|
|
1150
|
+
*/
|
|
1151
|
+
domains: Array<string>;
|
|
1152
|
+
};
|
|
1153
|
+
/**
|
|
1154
|
+
* What our crawl last read of the domain's own home page, every member empty where it holds none. Paid plans and the trial.
|
|
1155
|
+
*/
|
|
1156
|
+
export type DomainWeb = {
|
|
1157
|
+
/**
|
|
1158
|
+
* The URL of the home page read.
|
|
1159
|
+
*/
|
|
1160
|
+
url: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* An English page's title.
|
|
1163
|
+
*/
|
|
1164
|
+
title: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* An English page's description.
|
|
1167
|
+
*/
|
|
1168
|
+
description: string;
|
|
1169
|
+
/**
|
|
1170
|
+
* The day it was last read.
|
|
1171
|
+
*/
|
|
1172
|
+
last_seen: string;
|
|
1173
|
+
links: DomainWebLinks;
|
|
1174
|
+
};
|
|
1175
|
+
/**
|
|
1176
|
+
* The external hosts the home page links to.
|
|
1177
|
+
*/
|
|
1178
|
+
export type DomainWebLinks = {
|
|
1179
|
+
/**
|
|
1180
|
+
* How many external hosts the home page links to.
|
|
1181
|
+
*/
|
|
1182
|
+
total: number;
|
|
1183
|
+
/**
|
|
1184
|
+
* Up to 10 of them; `[]` when it links to none.
|
|
1185
|
+
*/
|
|
1186
|
+
hosts: Array<string>;
|
|
1187
|
+
};
|
|
1188
|
+
/**
|
|
1189
|
+
* The registered domains whose home page redirects to this one, how many and the 10 most popular. Paid plans and the trial.
|
|
1190
|
+
*/
|
|
1191
|
+
export type DomainRedirects = {
|
|
1192
|
+
/**
|
|
1193
|
+
* How many registered domains have a home page that redirects to this domain.
|
|
1194
|
+
*/
|
|
1195
|
+
total: number;
|
|
1196
|
+
/**
|
|
1197
|
+
* Up to 10 of them, the most popular first; `[]` when none does.
|
|
1198
|
+
*/
|
|
1199
|
+
domains: Array<string>;
|
|
1200
|
+
};
|
|
1201
|
+
/**
|
|
1202
|
+
* The registered domains whose home page links to this one, how many and the 10 most popular. Paid plans and the trial.
|
|
1203
|
+
*/
|
|
1204
|
+
export type DomainBacklinks = {
|
|
1205
|
+
/**
|
|
1206
|
+
* How many registered domains have a home page that links to this domain.
|
|
1207
|
+
*/
|
|
1208
|
+
total: number;
|
|
1209
|
+
/**
|
|
1210
|
+
* Up to 10 of them, the most popular first; `[]` when none does.
|
|
1211
|
+
*/
|
|
1212
|
+
domains: Array<string>;
|
|
1213
|
+
};
|
|
1047
1214
|
/**
|
|
1048
1215
|
* Its records in Domain DNS, up to 100 a type. Paid plans and the trial.
|
|
1049
1216
|
*/
|
|
@@ -1171,6 +1338,12 @@ export type BatchLookupRequest = {
|
|
|
1171
1338
|
* Domains.
|
|
1172
1339
|
*/
|
|
1173
1340
|
domains?: Array<string>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Each address's `User-Agent`, keyed by the string it is sent as in `ips`. With every field, that address's answer then carries `user_agent`, as a single lookup's does. Never kept.
|
|
1343
|
+
*/
|
|
1344
|
+
user_agents?: {
|
|
1345
|
+
[key: string]: string;
|
|
1346
|
+
};
|
|
1174
1347
|
};
|
|
1175
1348
|
export type BatchLookupResponse = {
|
|
1176
1349
|
/**
|
|
@@ -1357,7 +1530,12 @@ export type LookupIpData = {
|
|
|
1357
1530
|
*/
|
|
1358
1531
|
ip: string;
|
|
1359
1532
|
};
|
|
1360
|
-
query?:
|
|
1533
|
+
query?: {
|
|
1534
|
+
/**
|
|
1535
|
+
* The `User-Agent` header of the request you are deciding on. With every field, on a paid plan or the trial, the answer then carries `user_agent`, the agent it names and whether this address bears that out. Never kept, and nothing sent with a lookup feeds our data.
|
|
1536
|
+
*/
|
|
1537
|
+
user_agent?: string;
|
|
1538
|
+
};
|
|
1361
1539
|
url: '/{ip}';
|
|
1362
1540
|
};
|
|
1363
1541
|
export type LookupIpErrors = {
|
|
@@ -1377,8 +1555,8 @@ export type LookupIpErrors = {
|
|
|
1377
1555
|
403: LookupError;
|
|
1378
1556
|
/**
|
|
1379
1557
|
* A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
|
|
1380
|
-
* lookups. A paid plan's overage cap is never a `429
|
|
1381
|
-
* fields and `cap_reached` `true
|
|
1558
|
+
* lookups. A paid plan's overage cap is never a `429` by itself: it answers `200` with
|
|
1559
|
+
* Unlimited's fields and `cap_reached` `true`, and a burst past it pays Unlimited's rate limit.
|
|
1382
1560
|
*
|
|
1383
1561
|
*/
|
|
1384
1562
|
429: LookupError;
|
|
@@ -1398,7 +1576,12 @@ export type LookupIpResponse = LookupIpResponses[keyof LookupIpResponses];
|
|
|
1398
1576
|
export type LookupMyIpData = {
|
|
1399
1577
|
body?: never;
|
|
1400
1578
|
path?: never;
|
|
1401
|
-
query?:
|
|
1579
|
+
query?: {
|
|
1580
|
+
/**
|
|
1581
|
+
* The `User-Agent` header of the request you are deciding on. With every field, on a paid plan or the trial, the answer then carries `user_agent`, the agent it names and whether this address bears that out. Never kept, and nothing sent with a lookup feeds our data.
|
|
1582
|
+
*/
|
|
1583
|
+
user_agent?: string;
|
|
1584
|
+
};
|
|
1402
1585
|
url: '/myip';
|
|
1403
1586
|
};
|
|
1404
1587
|
export type LookupMyIpErrors = {
|
|
@@ -1414,8 +1597,8 @@ export type LookupMyIpErrors = {
|
|
|
1414
1597
|
403: LookupError;
|
|
1415
1598
|
/**
|
|
1416
1599
|
* A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
|
|
1417
|
-
* lookups. A paid plan's overage cap is never a `429
|
|
1418
|
-
* fields and `cap_reached` `true
|
|
1600
|
+
* lookups. A paid plan's overage cap is never a `429` by itself: it answers `200` with
|
|
1601
|
+
* Unlimited's fields and `cap_reached` `true`, and a burst past it pays Unlimited's rate limit.
|
|
1419
1602
|
*
|
|
1420
1603
|
*/
|
|
1421
1604
|
429: LookupError;
|
|
@@ -1460,8 +1643,8 @@ export type LookupAsnErrors = {
|
|
|
1460
1643
|
403: LookupError;
|
|
1461
1644
|
/**
|
|
1462
1645
|
* A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
|
|
1463
|
-
* lookups. A paid plan's overage cap is never a `429
|
|
1464
|
-
* fields and `cap_reached` `true
|
|
1646
|
+
* lookups. A paid plan's overage cap is never a `429` by itself: it answers `200` with
|
|
1647
|
+
* Unlimited's fields and `cap_reached` `true`, and a burst past it pays Unlimited's rate limit.
|
|
1465
1648
|
*
|
|
1466
1649
|
*/
|
|
1467
1650
|
429: LookupError;
|
|
@@ -1506,8 +1689,8 @@ export type LookupDomainErrors = {
|
|
|
1506
1689
|
403: LookupError;
|
|
1507
1690
|
/**
|
|
1508
1691
|
* A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
|
|
1509
|
-
* lookups. A paid plan's overage cap is never a `429
|
|
1510
|
-
* fields and `cap_reached` `true
|
|
1692
|
+
* lookups. A paid plan's overage cap is never a `429` by itself: it answers `200` with
|
|
1693
|
+
* Unlimited's fields and `cap_reached` `true`, and a burst past it pays Unlimited's rate limit.
|
|
1511
1694
|
*
|
|
1512
1695
|
*/
|
|
1513
1696
|
429: LookupError;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export type { OauthOptions, AuthorizationUrlOptions, OauthMetadata, TokenRespons
|
|
|
6
6
|
export { isBogon } from './bogon.js';
|
|
7
7
|
export { InternetDataError, OauthError, OauthAccessDeniedError, OauthExpiredTokenError, } from './errors.js';
|
|
8
8
|
export type { ErrorKind } from './errors.js';
|
|
9
|
-
export type { Result, AsnResult, DomainResult, LookupResponse, AsnLookupResponse, DomainLookupResponse, ClassDetail, ProxyDetail, PubproxyDetail, CarrierDetail, SatelliteDetail, SshDetail, SmtpDetail, WebDetail, DnsResolverDetail, BitTorrentDetail, Location, Asn, Company, AbuseContact, Whois, Rwhois, HostedDomains, AsnPrefix, DomainDns, DnsAddressRecord, DnsMxRecord, DnsNsRecord, DnsCnameRecord, DomainIpRanges, DomainIpRange, DisposableDetail, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, } from './types.js';
|
|
9
|
+
export type { Result, AsnResult, DomainResult, LookupResponse, AsnLookupResponse, DomainLookupResponse, ClassDetail, ProxyDetail, PubproxyDetail, CarrierDetail, SatelliteDetail, SshDetail, SmtpDetail, WebDetail, DnsResolverDetail, BitTorrentDetail, Location, Asn, Company, AbuseContact, Whois, Rwhois, HostedDomains, AsnPrefix, DomainDns, DnsAddressRecord, DnsMxRecord, DnsNsRecord, DnsCnameRecord, DomainIpRanges, DomainIpRange, DisposableDetail, DomainHost, CohostedDomains, DomainWeb, DomainWebLinks, DomainRedirects, DomainBacklinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, BotDetail, UserAgentVerdict, } from './types.js';
|
package/dist/shapes.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare const LOOKUP_MEMBERS: readonly ["ip", "is_bogon", "is_tor", "is_relay", "is_anycast", "is_carrier", "is_satellite", "is_ssh", "is_smtp", "is_web", "is_dns_resolver", "is_bittorrent", "tor", "relay", "location", "asn", "company", "hostname", "abuse"];
|
|
1
|
+
export declare const LOOKUP_MEMBERS: readonly ["ip", "is_bogon", "is_tor", "is_relay", "is_bot", "is_anycast", "is_carrier", "is_satellite", "is_ssh", "is_smtp", "is_web", "is_dns_resolver", "is_bittorrent", "tor", "relay", "location", "asn", "company", "hostname", "abuse"];
|
|
2
2
|
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"];
|
|
3
3
|
export declare const LOCATION_MEMBERS: readonly ["continent", "continent_name", "country", "country_name", "timezone", "currency_code", "currency_name", "currency_symbol", "flag_emoji", "flag_unicode"];
|
|
4
|
-
export declare const ASN_MEMBERS: readonly ["asn", "name", "domain", "type", "prefix"];
|
|
4
|
+
export declare const ASN_MEMBERS: readonly ["asn", "name", "domain", "type", "prefix", "country", "rpki_status"];
|
|
5
5
|
export declare const COMPANY_MEMBERS: readonly ["name", "domain"];
|
|
6
|
+
export declare const USER_AGENT_VERDICT_MEMBERS: readonly ["agent", "kind", "verdict"];
|
|
6
7
|
export declare const ABUSE_CONTACT_MEMBERS: readonly ["email"];
|
|
7
8
|
export declare const WHOIS_MEMBERS: readonly ["id", "name", "org", "country", "status", "source", "domain", "abuse_email", "asn"];
|
|
8
9
|
export declare const RWHOIS_MEMBERS: readonly ["id", "name", "country", "source", "domain", "abuse_email"];
|
|
@@ -17,6 +18,12 @@ export declare const DNS_NS_RECORD_MEMBERS: readonly ["host", "last_seen"];
|
|
|
17
18
|
export declare const DNS_CNAME_RECORD_MEMBERS: readonly ["target", "last_seen"];
|
|
18
19
|
export declare const DOMAIN_IP_RANGES_MEMBERS: readonly ["domain", "redirects_to", "total", "ipv4", "ranges"];
|
|
19
20
|
export declare const DOMAIN_IP_RANGE_MEMBERS: readonly ["range", "name", "country"];
|
|
21
|
+
export declare const DOMAIN_HOST_MEMBERS: readonly ["ip", "asn"];
|
|
22
|
+
export declare const COHOSTED_DOMAINS_MEMBERS: readonly ["ip", "total", "domains"];
|
|
23
|
+
export declare const DOMAIN_WEB_MEMBERS: readonly ["url", "title", "description", "last_seen", "links"];
|
|
24
|
+
export declare const DOMAIN_WEB_LINKS_MEMBERS: readonly ["total", "hosts"];
|
|
25
|
+
export declare const DOMAIN_REDIRECTS_MEMBERS: readonly ["total", "domains"];
|
|
26
|
+
export declare const DOMAIN_BACKLINKS_MEMBERS: readonly ["total", "domains"];
|
|
20
27
|
export declare const BATCH_MEMBERS: readonly ["results", "errors"];
|
|
21
28
|
export declare const BATCH_ERROR_MEMBERS: readonly ["status", "error"];
|
|
22
29
|
export declare const ENTITLEMENT_MEMBERS: readonly ["org_id", "apikey", "plan", "usage"];
|
|
@@ -28,6 +35,8 @@ export declare const LOOKUP_TYPES: Record<string, Kind>;
|
|
|
28
35
|
export declare const CLASS_DETAIL_TYPES: Record<string, Kind>;
|
|
29
36
|
export declare const PROXY_DETAIL_TYPES: Record<string, Kind>;
|
|
30
37
|
export declare const PUBPROXY_DETAIL_TYPES: Record<string, Kind>;
|
|
38
|
+
export declare const BOT_DETAIL_TYPES: Record<string, Kind>;
|
|
39
|
+
export declare const USER_AGENT_VERDICT_TYPES: Record<string, Kind>;
|
|
31
40
|
export declare const CARRIER_DETAIL_TYPES: Record<string, Kind>;
|
|
32
41
|
export declare const SATELLITE_DETAIL_TYPES: Record<string, Kind>;
|
|
33
42
|
export declare const SSH_DETAIL_TYPES: Record<string, Kind>;
|
|
@@ -52,6 +61,12 @@ export declare const DNS_NS_RECORD_TYPES: Record<string, Kind>;
|
|
|
52
61
|
export declare const DNS_CNAME_RECORD_TYPES: Record<string, Kind>;
|
|
53
62
|
export declare const DOMAIN_IP_RANGES_TYPES: Record<string, Kind>;
|
|
54
63
|
export declare const DOMAIN_IP_RANGE_TYPES: Record<string, Kind>;
|
|
64
|
+
export declare const DOMAIN_HOST_TYPES: Record<string, Kind>;
|
|
65
|
+
export declare const COHOSTED_DOMAINS_TYPES: Record<string, Kind>;
|
|
66
|
+
export declare const DOMAIN_WEB_TYPES: Record<string, Kind>;
|
|
67
|
+
export declare const DOMAIN_WEB_LINKS_TYPES: Record<string, Kind>;
|
|
68
|
+
export declare const DOMAIN_REDIRECTS_TYPES: Record<string, Kind>;
|
|
69
|
+
export declare const DOMAIN_BACKLINKS_TYPES: Record<string, Kind>;
|
|
55
70
|
export declare const DISPOSABLE_DETAIL_TYPES: Record<string, Kind>;
|
|
56
71
|
export declare const BATCH_ERROR_TYPES: Record<string, Kind>;
|
|
57
72
|
export declare const ENTITLEMENT_TYPES: Record<string, Kind>;
|
package/dist/shapes.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// generated types, so a member the spec adds fails the suite until it is here.
|
|
4
4
|
import { hasMembers } from './transport.js';
|
|
5
5
|
export const LOOKUP_MEMBERS = [
|
|
6
|
-
'ip', 'is_bogon', 'is_tor', 'is_relay', 'is_anycast', 'is_carrier', 'is_satellite', 'is_ssh',
|
|
7
|
-
'is_web', 'is_dns_resolver', 'is_bittorrent', 'tor', 'relay', 'location', 'asn', 'company',
|
|
8
|
-
'abuse',
|
|
6
|
+
'ip', 'is_bogon', 'is_tor', 'is_relay', 'is_bot', 'is_anycast', 'is_carrier', 'is_satellite', 'is_ssh',
|
|
7
|
+
'is_smtp', 'is_web', 'is_dns_resolver', 'is_bittorrent', 'tor', 'relay', 'location', 'asn', 'company',
|
|
8
|
+
'hostname', 'abuse',
|
|
9
9
|
];
|
|
10
10
|
export const WEB_DETAIL_MEMBERS = [
|
|
11
11
|
'port', 'tls_ok', 'session_ok', 'status_code', 'server', 'location', 'title', 'cert_subject_cn',
|
|
@@ -15,8 +15,9 @@ export const LOCATION_MEMBERS = [
|
|
|
15
15
|
'continent', 'continent_name', 'country', 'country_name', 'timezone', 'currency_code', 'currency_name',
|
|
16
16
|
'currency_symbol', 'flag_emoji', 'flag_unicode',
|
|
17
17
|
];
|
|
18
|
-
export const ASN_MEMBERS = ['asn', 'name', 'domain', 'type', 'prefix'];
|
|
18
|
+
export const ASN_MEMBERS = ['asn', 'name', 'domain', 'type', 'prefix', 'country', 'rpki_status'];
|
|
19
19
|
export const COMPANY_MEMBERS = ['name', 'domain'];
|
|
20
|
+
export const USER_AGENT_VERDICT_MEMBERS = ['agent', 'kind', 'verdict'];
|
|
20
21
|
export const ABUSE_CONTACT_MEMBERS = ['email'];
|
|
21
22
|
export const WHOIS_MEMBERS = [
|
|
22
23
|
'id', 'name', 'org', 'country', 'status', 'source', 'domain', 'abuse_email', 'asn',
|
|
@@ -37,6 +38,12 @@ export const DNS_NS_RECORD_MEMBERS = ['host', 'last_seen'];
|
|
|
37
38
|
export const DNS_CNAME_RECORD_MEMBERS = ['target', 'last_seen'];
|
|
38
39
|
export const DOMAIN_IP_RANGES_MEMBERS = ['domain', 'redirects_to', 'total', 'ipv4', 'ranges'];
|
|
39
40
|
export const DOMAIN_IP_RANGE_MEMBERS = ['range', 'name', 'country'];
|
|
41
|
+
export const DOMAIN_HOST_MEMBERS = ['ip', 'asn'];
|
|
42
|
+
export const COHOSTED_DOMAINS_MEMBERS = ['ip', 'total', 'domains'];
|
|
43
|
+
export const DOMAIN_WEB_MEMBERS = ['url', 'title', 'description', 'last_seen', 'links'];
|
|
44
|
+
export const DOMAIN_WEB_LINKS_MEMBERS = ['total', 'hosts'];
|
|
45
|
+
export const DOMAIN_REDIRECTS_MEMBERS = ['total', 'domains'];
|
|
46
|
+
export const DOMAIN_BACKLINKS_MEMBERS = ['total', 'domains'];
|
|
40
47
|
export const BATCH_MEMBERS = ['results', 'errors'];
|
|
41
48
|
export const BATCH_ERROR_MEMBERS = ['status', 'error'];
|
|
42
49
|
export const ENTITLEMENT_MEMBERS = ['org_id', 'apikey', 'plan', 'usage'];
|
|
@@ -46,13 +53,14 @@ export const ENTITLEMENT_USAGE_MEMBERS = ['requests', 'quota', 'window_start', '
|
|
|
46
53
|
const FLAG = 'boolean';
|
|
47
54
|
export const LOOKUP_TYPES = {
|
|
48
55
|
ip: 'string', is_bogon: FLAG, is_vpn: FLAG, is_tor: FLAG, is_relay: FLAG, is_resproxy: FLAG, is_dcproxy: FLAG,
|
|
49
|
-
is_mobproxy: FLAG, is_pubproxy: FLAG, is_hosting: FLAG, is_cdn: FLAG,
|
|
50
|
-
is_satellite: FLAG, is_ssh: FLAG, is_smtp: FLAG, is_web: FLAG, is_dns_resolver: FLAG,
|
|
56
|
+
is_mobproxy: FLAG, is_pubproxy: FLAG, is_hosting: FLAG, is_cdn: FLAG, is_bot: FLAG, is_anycast: FLAG,
|
|
57
|
+
is_carrier: FLAG, is_satellite: FLAG, is_ssh: FLAG, is_smtp: FLAG, is_web: FLAG, is_dns_resolver: FLAG,
|
|
58
|
+
is_bittorrent: FLAG,
|
|
51
59
|
vpn: 'object', tor: 'object', relay: 'object', resproxy: 'object', dcproxy: 'object', mobproxy: 'object',
|
|
52
|
-
pubproxy: 'object', hosting: 'object', cdn: 'object',
|
|
53
|
-
smtp: 'object', web: 'array', dns_resolver: 'object', bittorrent: 'object', location: 'object', asn: 'object',
|
|
60
|
+
pubproxy: 'object', hosting: 'object', cdn: 'object', bot: 'object', carrier: 'object', satellite: 'object',
|
|
61
|
+
ssh: 'object', smtp: 'object', web: 'array', dns_resolver: 'object', bittorrent: 'object', location: 'object', asn: 'object',
|
|
54
62
|
company: 'object', hostname: 'string', abuse: 'object', whois: 'object', rwhois: 'object',
|
|
55
|
-
hosted_domains: 'object', trial_expired: FLAG, cap_reached: FLAG,
|
|
63
|
+
hosted_domains: 'object', user_agent: 'object', trial_expired: FLAG, cap_reached: FLAG,
|
|
56
64
|
};
|
|
57
65
|
export const CLASS_DETAIL_TYPES = {
|
|
58
66
|
provider: 'string', provider_name: 'string', confidence: 'string', last_seen: 'string',
|
|
@@ -65,6 +73,13 @@ export const PUBPROXY_DETAIL_TYPES = {
|
|
|
65
73
|
entry: 'boolean', exit: 'boolean', protocols: 'array', num_ports: 'integer', num_proxies: 'integer',
|
|
66
74
|
last_seen: 'string', last_usable: 'string',
|
|
67
75
|
};
|
|
76
|
+
export const BOT_DETAIL_TYPES = {
|
|
77
|
+
provider: 'string', provider_name: 'string', agents: 'array', categories: 'array', verified: 'boolean',
|
|
78
|
+
identity: 'string', verified_by: 'string', confidence: 'string', first_seen: 'string', last_seen: 'string',
|
|
79
|
+
};
|
|
80
|
+
export const USER_AGENT_VERDICT_TYPES = {
|
|
81
|
+
agent: 'string', kind: 'string', verdict: 'string',
|
|
82
|
+
};
|
|
68
83
|
export const CARRIER_DETAIL_TYPES = {
|
|
69
84
|
name: 'string', mcc: 'string', mnc: 'string', country: 'string', confidence: 'string',
|
|
70
85
|
};
|
|
@@ -133,7 +148,8 @@ export const ASN_PREFIX_TYPES = {
|
|
|
133
148
|
};
|
|
134
149
|
export const DOMAIN_LOOKUP_TYPES = {
|
|
135
150
|
domain: 'string', is_registered: FLAG, is_disposable: FLAG, has_a: FLAG, has_aaaa: FLAG, has_mx: FLAG,
|
|
136
|
-
has_ns: FLAG, has_cname: FLAG, dns: 'object', ip_ranges: 'object', disposable: 'object',
|
|
151
|
+
has_ns: FLAG, has_cname: FLAG, dns: 'object', ip_ranges: 'object', disposable: 'object', hosting: 'array',
|
|
152
|
+
cohosted_domains: 'object', web: 'object', redirects: 'object', backlinks: 'object', trial_expired: FLAG,
|
|
137
153
|
cap_reached: FLAG,
|
|
138
154
|
};
|
|
139
155
|
export const DOMAIN_DNS_TYPES = {
|
|
@@ -151,6 +167,14 @@ export const DOMAIN_IP_RANGES_TYPES = {
|
|
|
151
167
|
export const DOMAIN_IP_RANGE_TYPES = {
|
|
152
168
|
range: 'string', name: 'string', country: 'string',
|
|
153
169
|
};
|
|
170
|
+
export const DOMAIN_HOST_TYPES = { ip: 'string', asn: 'object' };
|
|
171
|
+
export const COHOSTED_DOMAINS_TYPES = { ip: 'string', total: 'integer', domains: 'array' };
|
|
172
|
+
export const DOMAIN_WEB_TYPES = {
|
|
173
|
+
url: 'string', title: 'string', description: 'string', last_seen: 'string', links: 'object',
|
|
174
|
+
};
|
|
175
|
+
export const DOMAIN_WEB_LINKS_TYPES = { total: 'integer', hosts: 'array' };
|
|
176
|
+
export const DOMAIN_REDIRECTS_TYPES = { total: 'integer', domains: 'array' };
|
|
177
|
+
export const DOMAIN_BACKLINKS_TYPES = { total: 'integer', domains: 'array' };
|
|
154
178
|
export const DISPOSABLE_DETAIL_TYPES = {
|
|
155
179
|
confidence: 'string', providers: 'array', first_seen: 'string', last_seen: 'string',
|
|
156
180
|
};
|
|
@@ -231,8 +255,8 @@ const DETAILS = [
|
|
|
231
255
|
['vpn', CLASS_DETAIL_TYPES], ['tor', CLASS_DETAIL_TYPES], ['relay', CLASS_DETAIL_TYPES],
|
|
232
256
|
['resproxy', PROXY_DETAIL_TYPES], ['dcproxy', PROXY_DETAIL_TYPES], ['mobproxy', PROXY_DETAIL_TYPES],
|
|
233
257
|
['pubproxy', PUBPROXY_DETAIL_TYPES], ['hosting', CLASS_DETAIL_TYPES], ['cdn', CLASS_DETAIL_TYPES],
|
|
234
|
-
['
|
|
235
|
-
['smtp', SMTP_DETAIL_TYPES], ['dns_resolver', DNS_RESOLVER_DETAIL_TYPES],
|
|
258
|
+
['bot', BOT_DETAIL_TYPES], ['carrier', CARRIER_DETAIL_TYPES], ['satellite', SATELLITE_DETAIL_TYPES],
|
|
259
|
+
['ssh', SSH_DETAIL_TYPES], ['smtp', SMTP_DETAIL_TYPES], ['dns_resolver', DNS_RESOLVER_DETAIL_TYPES],
|
|
236
260
|
['bittorrent', BITTORRENT_DETAIL_TYPES],
|
|
237
261
|
];
|
|
238
262
|
// Required where the lookup itself requires them, and optional otherwise.
|
|
@@ -250,6 +274,8 @@ export function isLookup(data) {
|
|
|
250
274
|
&& DETAILS.every(([member, types]) => optional(data[member], (detail) => typed(detail, [], types)))
|
|
251
275
|
&& optional(data['pubproxy'], (pubproxy) => lists(pubproxy, 'protocols', isString))
|
|
252
276
|
&& optional(data['bittorrent'], (bittorrent) => lists(bittorrent, 'clients', isString))
|
|
277
|
+
&& optional(data['bot'], (bot) => lists(bot, 'agents', isString) && lists(bot, 'categories', isString))
|
|
278
|
+
&& optional(data['user_agent'], (verdict) => typed(verdict, USER_AGENT_VERDICT_MEMBERS, USER_AGENT_VERDICT_TYPES))
|
|
253
279
|
&& optional(data['web'], (web) => every(web, (row) => typed(row, WEB_DETAIL_MEMBERS, WEB_DETAIL_TYPES)))
|
|
254
280
|
&& optional(data['hosted_domains'], (hosted) => lists(hosted, 'domains', isString))
|
|
255
281
|
&& SHARED.every(([member, required, types]) => optional(data[member], (object) => typed(object, required, types)));
|
|
@@ -275,7 +301,18 @@ export function isDomainLookup(data) {
|
|
|
275
301
|
&& every(dns['cname'], (r) => typed(r, DNS_CNAME_RECORD_MEMBERS, DNS_CNAME_RECORD_TYPES)))
|
|
276
302
|
&& optional(data['ip_ranges'], (ranges) => typed(ranges, DOMAIN_IP_RANGES_MEMBERS, DOMAIN_IP_RANGES_TYPES) && every(ranges['ranges'], (r) => typed(r, DOMAIN_IP_RANGE_MEMBERS, DOMAIN_IP_RANGE_TYPES)))
|
|
277
303
|
&& optional(data['disposable'], (d) => typed(d, [], DISPOSABLE_DETAIL_TYPES)
|
|
278
|
-
&& lists(d, 'providers', isString))
|
|
304
|
+
&& lists(d, 'providers', isString))
|
|
305
|
+
&& optional(data['hosting'], (hosting) => every(hosting, (h) => typed(h, DOMAIN_HOST_MEMBERS, DOMAIN_HOST_TYPES)
|
|
306
|
+
&& typed(h['asn'], ASN_MEMBERS, ASN_TYPES)))
|
|
307
|
+
&& optional(data['cohosted_domains'], (c) => typed(c, COHOSTED_DOMAINS_MEMBERS, COHOSTED_DOMAINS_TYPES)
|
|
308
|
+
&& every(c['domains'], isString))
|
|
309
|
+
&& optional(data['web'], (web) => typed(web, DOMAIN_WEB_MEMBERS, DOMAIN_WEB_TYPES)
|
|
310
|
+
&& typed(web['links'], DOMAIN_WEB_LINKS_MEMBERS, DOMAIN_WEB_LINKS_TYPES)
|
|
311
|
+
&& every(web['links']['hosts'], isString))
|
|
312
|
+
&& optional(data['redirects'], (r) => typed(r, DOMAIN_REDIRECTS_MEMBERS, DOMAIN_REDIRECTS_TYPES)
|
|
313
|
+
&& every(r['domains'], isString))
|
|
314
|
+
&& optional(data['backlinks'], (b) => typed(b, DOMAIN_BACKLINKS_MEMBERS, DOMAIN_BACKLINKS_TYPES)
|
|
315
|
+
&& every(b['domains'], isString));
|
|
279
316
|
}
|
|
280
317
|
/** Both maps present. An entry in either is judged on its own, as that address's answer. */
|
|
281
318
|
export function isBatch(data) {
|
package/dist/store.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class StoreTier {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* How long an answer stays cached: the TTL, or at most a minute for one marked
|
|
34
|
-
* `trialExpired` or `capReached`, which a new UTC
|
|
34
|
+
* `trialExpired` or `capReached`, which a new UTC month or a raised cap ends. Still
|
|
35
35
|
* cached, so a busy page past its trial does not send every repeat to the API.
|
|
36
36
|
*/
|
|
37
37
|
export declare function lifeMs(result: Result, ttlMs: number): number;
|
package/dist/store.js
CHANGED
|
@@ -44,7 +44,7 @@ export class StoreTier {
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* How long an answer stays cached: the TTL, or at most a minute for one marked
|
|
47
|
-
* `trialExpired` or `capReached`, which a new UTC
|
|
47
|
+
* `trialExpired` or `capReached`, which a new UTC month or a raised cap ends. Still
|
|
48
48
|
* cached, so a busy page past its trial does not send every repeat to the API.
|
|
49
49
|
*/
|
|
50
50
|
export function lifeMs(result, ttlMs) {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import type { AbuseContact, Asn, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BitTorrentDetail, CarrierDetail, ClassDetail, Company, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainDns, DomainIpRange, DomainIpRanges, DomainLookupResponse, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupResponse, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, WebDetail, Whois } from './generated/types.gen.js';
|
|
2
|
-
export type { AbuseContact,
|
|
1
|
+
import type { AbuseContact, Asn as WireAsn, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BitTorrentDetail, BotDetail, CarrierDetail, ClassDetail, Company, CohostedDomains, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainBacklinks, DomainDns, DomainHost as WireDomainHost, DomainIpRange, DomainIpRanges, DomainLookupResponse as WireDomainLookupResponse, DomainRedirects, DomainWeb, DomainWebLinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupResponse as WireLookupResponse, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, UserAgentVerdict, WebDetail, Whois } from './generated/types.gen.js';
|
|
2
|
+
export type { AbuseContact, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BitTorrentDetail, BotDetail, CarrierDetail, ClassDetail, Company, CohostedDomains, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainBacklinks, DomainDns, DomainIpRange, DomainIpRanges, DomainRedirects, DomainWeb, DomainWebLinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, UserAgentVerdict, WebDetail, Whois, };
|
|
3
|
+
/** The network 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
|
+
/** A lookup's answer as it came off the wire. Every answer carries `is_bot`. */
|
|
6
|
+
export type LookupResponse = Omit<WireLookupResponse, 'asn' | 'is_bot'> & {
|
|
7
|
+
asn: Asn;
|
|
8
|
+
} & Partial<Pick<WireLookupResponse, 'is_bot'>>;
|
|
9
|
+
/** An address the domain resolves to, and the network announcing it. */
|
|
10
|
+
export type DomainHost = Omit<WireDomainHost, 'asn'> & {
|
|
11
|
+
asn: Asn;
|
|
12
|
+
};
|
|
13
|
+
/** A domain lookup's answer as it came off the wire. */
|
|
14
|
+
export type DomainLookupResponse = Omit<WireDomainLookupResponse, 'hosting'> & {
|
|
15
|
+
hosting?: DomainHost[];
|
|
16
|
+
};
|
|
3
17
|
/**
|
|
4
18
|
* What a lookup answers about one address.
|
|
5
19
|
*
|
|
@@ -27,6 +41,12 @@ export interface Result {
|
|
|
27
41
|
isPubproxy?: boolean;
|
|
28
42
|
isHosting?: boolean;
|
|
29
43
|
isCdn?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* In Bot IP: an automated client's address, such as a search engine's or an AI
|
|
46
|
+
* company's crawler. Every answer carries it, on every plan; `bot` says whose.
|
|
47
|
+
* Optional in this type only so a `Result` written out by hand still compiles.
|
|
48
|
+
*/
|
|
49
|
+
isBot?: boolean;
|
|
30
50
|
isAnycast: boolean;
|
|
31
51
|
isCarrier: boolean;
|
|
32
52
|
isSatellite: boolean;
|
|
@@ -55,6 +75,8 @@ export interface Result {
|
|
|
55
75
|
pubproxy?: PubproxyDetail;
|
|
56
76
|
hosting?: ClassDetail;
|
|
57
77
|
cdn?: ClassDetail;
|
|
78
|
+
/** Whose bot uses the address, what it does and whether its operator vouches for it. `{}` when `isBot` is false. */
|
|
79
|
+
bot?: BotDetail;
|
|
58
80
|
carrier?: CarrierDetail;
|
|
59
81
|
satellite?: SatelliteDetail;
|
|
60
82
|
ssh?: SshDetail;
|
|
@@ -72,6 +94,8 @@ export interface Result {
|
|
|
72
94
|
whois?: Whois;
|
|
73
95
|
rwhois?: Rwhois;
|
|
74
96
|
hostedDomains?: HostedDomains;
|
|
97
|
+
/** Only on an answer to a request that sent a user agent: the agent it names, and whether this address bears it out. */
|
|
98
|
+
userAgent?: UserAgentVerdict;
|
|
75
99
|
/** The response exactly as it came off the wire, with its original names. */
|
|
76
100
|
raw: LookupResponse;
|
|
77
101
|
}
|
|
@@ -123,6 +147,16 @@ export interface DomainResult {
|
|
|
123
147
|
ipRanges?: DomainIpRanges;
|
|
124
148
|
/** `{}` when `isDisposable` is false. */
|
|
125
149
|
disposable?: DisposableDetail;
|
|
150
|
+
/** The network announcing each address in `dns.a`, then `dns.aaaa`. */
|
|
151
|
+
hosting?: DomainHost[];
|
|
152
|
+
/** The other registered domains on its first IPv4 address. */
|
|
153
|
+
cohostedDomains?: CohostedDomains;
|
|
154
|
+
/** What its home page said of itself, and the hosts it links to, when last read. */
|
|
155
|
+
web?: DomainWeb;
|
|
156
|
+
/** The registered domains whose home page redirects to it. */
|
|
157
|
+
redirects?: DomainRedirects;
|
|
158
|
+
/** The registered domains whose home page links to it. */
|
|
159
|
+
backlinks?: DomainBacklinks;
|
|
126
160
|
trialExpired?: boolean;
|
|
127
161
|
capReached?: boolean;
|
|
128
162
|
/** The response exactly as it came off the wire, with its original names. */
|
package/dist/types.js
CHANGED
|
@@ -7,8 +7,8 @@ const RESULT_NAMES = {
|
|
|
7
7
|
is_resproxy: 'isResproxy', is_dcproxy: 'isDcproxy', is_mobproxy: 'isMobproxy', is_pubproxy: 'isPubproxy',
|
|
8
8
|
is_hosting: 'isHosting', is_cdn: 'isCdn', is_anycast: 'isAnycast', is_carrier: 'isCarrier',
|
|
9
9
|
is_satellite: 'isSatellite', is_ssh: 'isSsh', is_smtp: 'isSmtp', is_web: 'isWeb',
|
|
10
|
-
is_dns_resolver: 'isDnsResolver', is_bittorrent: 'isBittorrent', trial_expired: 'trialExpired',
|
|
11
|
-
cap_reached: 'capReached',
|
|
10
|
+
is_dns_resolver: 'isDnsResolver', is_bittorrent: 'isBittorrent', is_bot: 'isBot', trial_expired: 'trialExpired',
|
|
11
|
+
cap_reached: 'capReached', bot: 'bot', user_agent: 'userAgent',
|
|
12
12
|
vpn: 'vpn', tor: 'tor', relay: 'relay', resproxy: 'resproxy', dcproxy: 'dcproxy', mobproxy: 'mobproxy',
|
|
13
13
|
pubproxy: 'pubproxy', hosting: 'hosting', cdn: 'cdn', carrier: 'carrier', satellite: 'satellite', ssh: 'ssh',
|
|
14
14
|
smtp: 'smtp', web: 'web', dns_resolver: 'dnsResolver', bittorrent: 'bittorrent', location: 'location',
|
|
@@ -26,7 +26,8 @@ const ASN_RESULT_NAMES = {
|
|
|
26
26
|
const DOMAIN_RESULT_NAMES = {
|
|
27
27
|
domain: 'domain', is_registered: 'isRegistered', is_disposable: 'isDisposable', has_a: 'hasA',
|
|
28
28
|
has_aaaa: 'hasAaaa', has_mx: 'hasMx', has_ns: 'hasNs', has_cname: 'hasCname', dns: 'dns',
|
|
29
|
-
ip_ranges: 'ipRanges', disposable: 'disposable',
|
|
29
|
+
ip_ranges: 'ipRanges', disposable: 'disposable', hosting: 'hosting', cohosted_domains: 'cohostedDomains',
|
|
30
|
+
web: 'web', redirects: 'redirects', backlinks: 'backlinks', trial_expired: 'trialExpired',
|
|
30
31
|
cap_reached: 'capReached',
|
|
31
32
|
};
|
|
32
33
|
export function toResult(body) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "internetdata-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Official browser client library for the InternetData API. Look up IP addresses, ASNs and domains from a page or a browser extension.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|