internetdata-web 1.3.2 → 1.4.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 CHANGED
@@ -48,7 +48,7 @@ console.log(result.company.name); // who the address belongs to
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_vpn`, `is_hosting`, `is_cdn` and the four proxy flags as well, city-level location, the whois records and the detail behind each flag. The plans differ only in how many lookups they include, and a free account tries every field, 100 lookups a day. Create a key in the [console](https://app.internetdata.io), then pass it in:
51
+ Where the key stays private (see above), every paid plan answers every field: `is_vpn`, `is_hosting`, `is_cdn` and the four proxy flags as well, city-level location, the whois records and the 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.internetdata.io), then pass it in:
52
52
 
53
53
  ```js
54
54
  const client = new InternetData({ apiKey: 'your-api-key' });
@@ -73,7 +73,7 @@ console.log(domain.isRegistered); // true
73
73
  console.log(domain.dns?.mx); // on a paid plan
74
74
  ```
75
75
 
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 and whether it is disposable. Neither lookup is cached or batched, and `lookup` refuses an AS or a domain before sending it.
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, 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
77
 
78
78
  ### Your own address
79
79
 
@@ -94,7 +94,7 @@ console.log(ent.usage.requests); // 580
94
94
  console.log(ent.usage.window_end); // when the allowance resets
95
95
  ```
96
96
 
97
- Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period, and against the UTC day on the free plan; 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.
97
+ 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
98
 
99
99
  ### Batch lookup
100
100
 
@@ -141,7 +141,7 @@ const client = new InternetData({ cache: { max: 50_000, ttlMs: 6 * 60 * 60 * 100
141
141
  const clientNoCache = new InternetData({ cache: false });
142
142
  ```
143
143
 
144
- An answer with `trialExpired` or `capReached` true is cached for a minute at most, in memory and in a `store`, so a new day's trial or a raised cap reaches you within a minute.
144
+ An answer with `trialExpired` or `capReached` true is cached for a minute at most, in memory and in a `store`, so a renewed trial or a raised cap reaches you within a minute.
145
145
 
146
146
  ### Keeping answers across a reload
147
147
 
@@ -263,12 +263,12 @@ The library is ES2022 and needs only what a browser has, `fetch` and, for PKCE,
263
263
 
264
264
  ### Absent is not false
265
265
 
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 daily 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".
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
267
 
268
268
  ```js
269
269
  result.isVpn ?? false // when you only want the flag
270
270
  result.isVpn === undefined // on Unlimited: not in your plan
271
- result.trialExpired === true // a free-plan key's daily trial is spent
271
+ result.trialExpired === true // a free-plan key's trial is spent
272
272
  result.capReached === true // a paid key is past its overage cap
273
273
  ```
274
274
 
package/dist/client.d.ts CHANGED
@@ -21,8 +21,8 @@ export interface CacheOptions {
21
21
  }
22
22
  export interface Options {
23
23
  /**
24
- * Your API key. Without one a lookup is on Unlimited, the free plan, limited
25
- * per address per minute, and no `Authorization` header is sent at all. A
24
+ * Your API key. Without one a lookup is on Unlimited, the free plan, with no
25
+ * daily or monthly cap, and no `Authorization` header is sent at all. A
26
26
  * batch needs a key on a paid plan.
27
27
  * A key in a web page is readable by anyone who opens the page.
28
28
  */
@@ -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, 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, 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 organization's IP ranges and whether it is a disposable email domain. An internationalized
97
- * name is answered under its punycode spelling.
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 organization's IP ranges and whether it is a disposable email domain. An internationalized
164
- * name is answered under its punycode spelling.
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({
@@ -271,7 +271,7 @@ export type LookupResponse = {
271
271
  rwhois?: Rwhois;
272
272
  hosted_domains?: HostedDomains;
273
273
  /**
274
- * On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields.
274
+ * 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
275
  */
276
276
  trial_expired?: boolean;
277
277
  /**
@@ -693,11 +693,11 @@ export type Asn = {
693
693
  */
694
694
  prefix: string;
695
695
  /**
696
- * The country its registry assigned it to. Paid plans and the trial.
696
+ * The country its registry assigned it to.
697
697
  */
698
698
  country?: string;
699
699
  /**
700
- * The announcement's RPKI status. Paid plans and the trial.
700
+ * The announcement's RPKI status.
701
701
  */
702
702
  rpki_status?: string;
703
703
  };
@@ -955,7 +955,7 @@ export type AsnLookupResponse = {
955
955
  downstreams?: Array<number>;
956
956
  hosted_domains?: AsnHostedDomains;
957
957
  /**
958
- * On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields.
958
+ * 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.
959
959
  */
960
960
  trial_expired?: boolean;
961
961
  /**
@@ -1030,13 +1030,21 @@ export type DomainLookupResponse = {
1030
1030
  */
1031
1031
  has_cname: boolean;
1032
1032
  dns?: DomainDns;
1033
+ /**
1034
+ * 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.
1035
+ */
1036
+ hosting?: Array<DomainHost>;
1037
+ cohosted_domains?: CohostedDomains;
1033
1038
  ip_ranges?: DomainIpRanges;
1034
1039
  /**
1035
1040
  * `{}` when `is_disposable` is false. Paid plans and the trial.
1036
1041
  */
1037
1042
  disposable?: DisposableDetail;
1043
+ web?: DomainWeb;
1044
+ redirects?: DomainRedirects;
1045
+ backlinks?: DomainBacklinks;
1038
1046
  /**
1039
- * On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields.
1047
+ * 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
1048
  */
1041
1049
  trial_expired?: boolean;
1042
1050
  /**
@@ -1044,6 +1052,97 @@ export type DomainLookupResponse = {
1044
1052
  */
1045
1053
  cap_reached?: boolean;
1046
1054
  };
1055
+ /**
1056
+ * An address the domain resolves to and the network announcing it.
1057
+ */
1058
+ export type DomainHost = {
1059
+ /**
1060
+ * One address the domain resolves to.
1061
+ */
1062
+ ip: string;
1063
+ /**
1064
+ * The network announcing it, as an address lookup's `asn`; every member empty where IP ASN holds none.
1065
+ */
1066
+ asn: Asn;
1067
+ };
1068
+ /**
1069
+ * 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.
1070
+ */
1071
+ export type CohostedDomains = {
1072
+ /**
1073
+ * The domain's first IPv4 address, `''` where it has none.
1074
+ */
1075
+ ip: string;
1076
+ /**
1077
+ * How many other registered domains resolve to it.
1078
+ */
1079
+ total: number;
1080
+ /**
1081
+ * Up to 10 of them, the most popular first, the domain itself left out; `[]` when none does.
1082
+ */
1083
+ domains: Array<string>;
1084
+ };
1085
+ /**
1086
+ * What our crawl last read of the domain's own home page, every member empty where it holds none. Paid plans and the trial.
1087
+ */
1088
+ export type DomainWeb = {
1089
+ /**
1090
+ * The URL of the home page read.
1091
+ */
1092
+ url: string;
1093
+ /**
1094
+ * An English page's title.
1095
+ */
1096
+ title: string;
1097
+ /**
1098
+ * An English page's description.
1099
+ */
1100
+ description: string;
1101
+ /**
1102
+ * The day it was last read.
1103
+ */
1104
+ last_seen: string;
1105
+ links: DomainWebLinks;
1106
+ };
1107
+ /**
1108
+ * The external hosts the home page links to.
1109
+ */
1110
+ export type DomainWebLinks = {
1111
+ /**
1112
+ * How many external hosts the home page links to.
1113
+ */
1114
+ total: number;
1115
+ /**
1116
+ * Up to 10 of them; `[]` when it links to none.
1117
+ */
1118
+ hosts: Array<string>;
1119
+ };
1120
+ /**
1121
+ * The registered domains whose home page redirects to this one, how many and the 10 most popular. Paid plans and the trial.
1122
+ */
1123
+ export type DomainRedirects = {
1124
+ /**
1125
+ * How many registered domains have a home page that redirects to this domain.
1126
+ */
1127
+ total: number;
1128
+ /**
1129
+ * Up to 10 of them, the most popular first; `[]` when none does.
1130
+ */
1131
+ domains: Array<string>;
1132
+ };
1133
+ /**
1134
+ * The registered domains whose home page links to this one, how many and the 10 most popular. Paid plans and the trial.
1135
+ */
1136
+ export type DomainBacklinks = {
1137
+ /**
1138
+ * How many registered domains have a home page that links to this domain.
1139
+ */
1140
+ total: number;
1141
+ /**
1142
+ * Up to 10 of them, the most popular first; `[]` when none does.
1143
+ */
1144
+ domains: Array<string>;
1145
+ };
1047
1146
  /**
1048
1147
  * Its records in Domain DNS, up to 100 a type. Paid plans and the trial.
1049
1148
  */
@@ -1233,8 +1332,8 @@ export type EntitlementPlan = {
1233
1332
  /**
1234
1333
  * The plan the organization is on, as an identifier that is never
1235
1334
  * renamed or reused: `free` for the free plan, or a paid plan's key.
1236
- * Compare against it and show `name`. On `free`, usage counts the
1237
- * day's lookups answered with every field, its daily trial.
1335
+ * Compare against it and show `name`. On `free`, usage counts its
1336
+ * trial, the lookups answered with every field.
1238
1337
  *
1239
1338
  */
1240
1339
  key: string;
@@ -1376,9 +1475,9 @@ export type LookupIpErrors = {
1376
1475
  */
1377
1476
  403: LookupError;
1378
1477
  /**
1379
- * A rate limit, always with `Retry-After`: this API protecting itself, or Unlimited's
1380
- * per-minute limit. A paid plan's overage cap is never a `429`: it answers `200` with
1381
- * Unlimited's fields and `cap_reached` `true`.
1478
+ * A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
1479
+ * lookups. A paid plan's overage cap is never a `429`: it answers `200` with Unlimited's
1480
+ * fields and `cap_reached` `true`.
1382
1481
  *
1383
1482
  */
1384
1483
  429: LookupError;
@@ -1413,9 +1512,9 @@ export type LookupMyIpErrors = {
1413
1512
  */
1414
1513
  403: LookupError;
1415
1514
  /**
1416
- * A rate limit, always with `Retry-After`: this API protecting itself, or Unlimited's
1417
- * per-minute limit. A paid plan's overage cap is never a `429`: it answers `200` with
1418
- * Unlimited's fields and `cap_reached` `true`.
1515
+ * A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
1516
+ * lookups. A paid plan's overage cap is never a `429`: it answers `200` with Unlimited's
1517
+ * fields and `cap_reached` `true`.
1419
1518
  *
1420
1519
  */
1421
1520
  429: LookupError;
@@ -1459,9 +1558,9 @@ export type LookupAsnErrors = {
1459
1558
  */
1460
1559
  403: LookupError;
1461
1560
  /**
1462
- * A rate limit, always with `Retry-After`: this API protecting itself, or Unlimited's
1463
- * per-minute limit. A paid plan's overage cap is never a `429`: it answers `200` with
1464
- * Unlimited's fields and `cap_reached` `true`.
1561
+ * A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
1562
+ * lookups. A paid plan's overage cap is never a `429`: it answers `200` with Unlimited's
1563
+ * fields and `cap_reached` `true`.
1465
1564
  *
1466
1565
  */
1467
1566
  429: LookupError;
@@ -1505,9 +1604,9 @@ export type LookupDomainErrors = {
1505
1604
  */
1506
1605
  403: LookupError;
1507
1606
  /**
1508
- * A rate limit, always with `Retry-After`: this API protecting itself, or Unlimited's
1509
- * per-minute limit. A paid plan's overage cap is never a `429`: it answers `200` with
1510
- * Unlimited's fields and `cap_reached` `true`.
1607
+ * A rate limit, always with `Retry-After`: this API protecting itself, or a burst of Unlimited
1608
+ * lookups. A paid plan's overage cap is never a `429`: it answers `200` with Unlimited's
1609
+ * fields and `cap_reached` `true`.
1511
1610
  *
1512
1611
  */
1513
1612
  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, } from './types.js';
package/dist/shapes.d.ts CHANGED
@@ -17,6 +17,12 @@ export declare const DNS_NS_RECORD_MEMBERS: readonly ["host", "last_seen"];
17
17
  export declare const DNS_CNAME_RECORD_MEMBERS: readonly ["target", "last_seen"];
18
18
  export declare const DOMAIN_IP_RANGES_MEMBERS: readonly ["domain", "redirects_to", "total", "ipv4", "ranges"];
19
19
  export declare const DOMAIN_IP_RANGE_MEMBERS: readonly ["range", "name", "country"];
20
+ export declare const DOMAIN_HOST_MEMBERS: readonly ["ip", "asn"];
21
+ export declare const COHOSTED_DOMAINS_MEMBERS: readonly ["ip", "total", "domains"];
22
+ export declare const DOMAIN_WEB_MEMBERS: readonly ["url", "title", "description", "last_seen", "links"];
23
+ export declare const DOMAIN_WEB_LINKS_MEMBERS: readonly ["total", "hosts"];
24
+ export declare const DOMAIN_REDIRECTS_MEMBERS: readonly ["total", "domains"];
25
+ export declare const DOMAIN_BACKLINKS_MEMBERS: readonly ["total", "domains"];
20
26
  export declare const BATCH_MEMBERS: readonly ["results", "errors"];
21
27
  export declare const BATCH_ERROR_MEMBERS: readonly ["status", "error"];
22
28
  export declare const ENTITLEMENT_MEMBERS: readonly ["org_id", "apikey", "plan", "usage"];
@@ -52,6 +58,12 @@ export declare const DNS_NS_RECORD_TYPES: Record<string, Kind>;
52
58
  export declare const DNS_CNAME_RECORD_TYPES: Record<string, Kind>;
53
59
  export declare const DOMAIN_IP_RANGES_TYPES: Record<string, Kind>;
54
60
  export declare const DOMAIN_IP_RANGE_TYPES: Record<string, Kind>;
61
+ export declare const DOMAIN_HOST_TYPES: Record<string, Kind>;
62
+ export declare const COHOSTED_DOMAINS_TYPES: Record<string, Kind>;
63
+ export declare const DOMAIN_WEB_TYPES: Record<string, Kind>;
64
+ export declare const DOMAIN_WEB_LINKS_TYPES: Record<string, Kind>;
65
+ export declare const DOMAIN_REDIRECTS_TYPES: Record<string, Kind>;
66
+ export declare const DOMAIN_BACKLINKS_TYPES: Record<string, Kind>;
55
67
  export declare const DISPOSABLE_DETAIL_TYPES: Record<string, Kind>;
56
68
  export declare const BATCH_ERROR_TYPES: Record<string, Kind>;
57
69
  export declare const ENTITLEMENT_TYPES: Record<string, Kind>;
package/dist/shapes.js CHANGED
@@ -37,6 +37,12 @@ export const DNS_NS_RECORD_MEMBERS = ['host', 'last_seen'];
37
37
  export const DNS_CNAME_RECORD_MEMBERS = ['target', 'last_seen'];
38
38
  export const DOMAIN_IP_RANGES_MEMBERS = ['domain', 'redirects_to', 'total', 'ipv4', 'ranges'];
39
39
  export const DOMAIN_IP_RANGE_MEMBERS = ['range', 'name', 'country'];
40
+ export const DOMAIN_HOST_MEMBERS = ['ip', 'asn'];
41
+ export const COHOSTED_DOMAINS_MEMBERS = ['ip', 'total', 'domains'];
42
+ export const DOMAIN_WEB_MEMBERS = ['url', 'title', 'description', 'last_seen', 'links'];
43
+ export const DOMAIN_WEB_LINKS_MEMBERS = ['total', 'hosts'];
44
+ export const DOMAIN_REDIRECTS_MEMBERS = ['total', 'domains'];
45
+ export const DOMAIN_BACKLINKS_MEMBERS = ['total', 'domains'];
40
46
  export const BATCH_MEMBERS = ['results', 'errors'];
41
47
  export const BATCH_ERROR_MEMBERS = ['status', 'error'];
42
48
  export const ENTITLEMENT_MEMBERS = ['org_id', 'apikey', 'plan', 'usage'];
@@ -133,7 +139,8 @@ export const ASN_PREFIX_TYPES = {
133
139
  };
134
140
  export const DOMAIN_LOOKUP_TYPES = {
135
141
  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', trial_expired: FLAG,
142
+ has_ns: FLAG, has_cname: FLAG, dns: 'object', ip_ranges: 'object', disposable: 'object', hosting: 'array',
143
+ cohosted_domains: 'object', web: 'object', redirects: 'object', backlinks: 'object', trial_expired: FLAG,
137
144
  cap_reached: FLAG,
138
145
  };
139
146
  export const DOMAIN_DNS_TYPES = {
@@ -151,6 +158,14 @@ export const DOMAIN_IP_RANGES_TYPES = {
151
158
  export const DOMAIN_IP_RANGE_TYPES = {
152
159
  range: 'string', name: 'string', country: 'string',
153
160
  };
161
+ export const DOMAIN_HOST_TYPES = { ip: 'string', asn: 'object' };
162
+ export const COHOSTED_DOMAINS_TYPES = { ip: 'string', total: 'integer', domains: 'array' };
163
+ export const DOMAIN_WEB_TYPES = {
164
+ url: 'string', title: 'string', description: 'string', last_seen: 'string', links: 'object',
165
+ };
166
+ export const DOMAIN_WEB_LINKS_TYPES = { total: 'integer', hosts: 'array' };
167
+ export const DOMAIN_REDIRECTS_TYPES = { total: 'integer', domains: 'array' };
168
+ export const DOMAIN_BACKLINKS_TYPES = { total: 'integer', domains: 'array' };
154
169
  export const DISPOSABLE_DETAIL_TYPES = {
155
170
  confidence: 'string', providers: 'array', first_seen: 'string', last_seen: 'string',
156
171
  };
@@ -275,7 +290,18 @@ export function isDomainLookup(data) {
275
290
  && every(dns['cname'], (r) => typed(r, DNS_CNAME_RECORD_MEMBERS, DNS_CNAME_RECORD_TYPES)))
276
291
  && 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
292
  && optional(data['disposable'], (d) => typed(d, [], DISPOSABLE_DETAIL_TYPES)
278
- && lists(d, 'providers', isString));
293
+ && lists(d, 'providers', isString))
294
+ && optional(data['hosting'], (hosting) => every(hosting, (h) => typed(h, DOMAIN_HOST_MEMBERS, DOMAIN_HOST_TYPES)
295
+ && typed(h['asn'], ASN_MEMBERS, ASN_TYPES)))
296
+ && optional(data['cohosted_domains'], (c) => typed(c, COHOSTED_DOMAINS_MEMBERS, COHOSTED_DOMAINS_TYPES)
297
+ && every(c['domains'], isString))
298
+ && optional(data['web'], (web) => typed(web, DOMAIN_WEB_MEMBERS, DOMAIN_WEB_TYPES)
299
+ && typed(web['links'], DOMAIN_WEB_LINKS_MEMBERS, DOMAIN_WEB_LINKS_TYPES)
300
+ && every(web['links']['hosts'], isString))
301
+ && optional(data['redirects'], (r) => typed(r, DOMAIN_REDIRECTS_MEMBERS, DOMAIN_REDIRECTS_TYPES)
302
+ && every(r['domains'], isString))
303
+ && optional(data['backlinks'], (b) => typed(b, DOMAIN_BACKLINKS_MEMBERS, DOMAIN_BACKLINKS_TYPES)
304
+ && every(b['domains'], isString));
279
305
  }
280
306
  /** Both maps present. An entry in either is judged on its own, as that address's answer. */
281
307
  export function isBatch(data) {
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
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, 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, };
1
+ import type { AbuseContact, Asn, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BitTorrentDetail, CarrierDetail, ClassDetail, Company, CohostedDomains, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainBacklinks, DomainDns, DomainHost, DomainIpRange, DomainIpRanges, DomainLookupResponse, DomainRedirects, DomainWeb, DomainWebLinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupResponse, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, WebDetail, Whois } from './generated/types.gen.js';
2
+ export type { AbuseContact, Asn, AsnHostedDomains, AsnLookupResponse, AsnPrefix, BitTorrentDetail, CarrierDetail, ClassDetail, Company, CohostedDomains, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainBacklinks, DomainDns, DomainHost, DomainIpRange, DomainIpRanges, DomainLookupResponse, DomainRedirects, DomainWeb, DomainWebLinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupResponse, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, WebDetail, Whois, };
3
3
  /**
4
4
  * What a lookup answers about one address.
5
5
  *
@@ -36,8 +36,8 @@ export interface Result {
36
36
  isDnsResolver: boolean;
37
37
  isBittorrent: boolean;
38
38
  /**
39
- * On answers to a key on the free plan only: `false` while the day's trial of
40
- * every field lasts, `true` once the answer has Unlimited's.
39
+ * On answers to a key on the free plan only: `false` while its organization's
40
+ * trial of every field lasts, `true` once the answer has Unlimited's.
41
41
  */
42
42
  trialExpired?: boolean;
43
43
  /**
@@ -123,6 +123,16 @@ export interface DomainResult {
123
123
  ipRanges?: DomainIpRanges;
124
124
  /** `{}` when `isDisposable` is false. */
125
125
  disposable?: DisposableDetail;
126
+ /** The network announcing each address in `dns.a`, then `dns.aaaa`. */
127
+ hosting?: DomainHost[];
128
+ /** The other registered domains on its first IPv4 address. */
129
+ cohostedDomains?: CohostedDomains;
130
+ /** What its home page said of itself, and the hosts it links to, when last read. */
131
+ web?: DomainWeb;
132
+ /** The registered domains whose home page redirects to it. */
133
+ redirects?: DomainRedirects;
134
+ /** The registered domains whose home page links to it. */
135
+ backlinks?: DomainBacklinks;
126
136
  trialExpired?: boolean;
127
137
  capReached?: boolean;
128
138
  /** The response exactly as it came off the wire, with its original names. */
package/dist/types.js CHANGED
@@ -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', trial_expired: 'trialExpired',
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.2",
3
+ "version": "1.4.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",