internetdata-web 1.0.0 → 1.2.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 -3
- package/dist/bogon.d.ts +2 -2
- package/dist/bogon.js +3 -3
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/sdk.gen.d.ts +4 -3
- package/dist/generated/sdk.gen.js +4 -3
- package/dist/generated/types.gen.d.ts +63 -4
- package/dist/shapes.d.ts +1 -1
- package/dist/shapes.js +13 -5
- package/dist/types.d.ts +12 -2
- package/dist/types.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,10 +7,10 @@ The official browser client library for the [InternetData](https://internetdata.
|
|
|
7
7
|
|
|
8
8
|
It looks up what every InternetData database says about an IP address, an AS or a domain.
|
|
9
9
|
|
|
10
|
-
**An API key in a web page is public.** Anyone who opens the page can read it from the page's source or its network requests and use it as you would: spend your plan's lookups and, if the key may download databases, download every database your organization is licensed for. In a page, use no key, or call the API from your own server and hand the page its answer. A key belongs only where the person it belongs to is the only one who can read it, such as their own browser extension or an internal tool, and there a key that may only look up.
|
|
11
|
-
|
|
12
10
|
## Getting Started
|
|
13
11
|
|
|
12
|
+
**An API key in a web page is public.** Anyone who opens the page can read it from the page's source or its network requests and use it as you would: spend your plan's lookups and, if the key may download databases, download every database your organization is licensed for. In a page, use no key, or call the API from your own server and hand the page its answer. A key belongs only where the person it belongs to is the only one who can read it, such as their own browser extension or an internal tool, and there a key that may only look up.
|
|
13
|
+
|
|
14
14
|
```bash
|
|
15
15
|
npm install internetdata-web
|
|
16
16
|
```
|
|
@@ -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 and
|
|
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.
|
|
77
77
|
|
|
78
78
|
### Your own address
|
|
79
79
|
|
|
@@ -89,6 +89,7 @@ It is never cached, since which address the browser is calling from is the quest
|
|
|
89
89
|
```js
|
|
90
90
|
const ent = await client.myEntitlement();
|
|
91
91
|
console.log(ent.plan.key); // starter
|
|
92
|
+
console.log(ent.plan.name); // Starter, the name to show
|
|
92
93
|
console.log(ent.usage.requests); // 580
|
|
93
94
|
console.log(ent.usage.window_end); // when the allowance resets
|
|
94
95
|
```
|
package/dist/bogon.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export declare function unmapped(ip: string): string;
|
|
|
22
22
|
* The answer a bogon gets, in the shape the API answers one on a paid plan:
|
|
23
23
|
* every flag present and false, every detail object present and empty (Web
|
|
24
24
|
* IP's list empty), `location`, `asn`, `company`, `abuse`, `whois` and `rwhois`
|
|
25
|
-
* with every key empty, `hostname` empty, `hosted_domains` 0, and
|
|
26
|
-
* true, as the API serves it.
|
|
25
|
+
* with every key empty, `hostname` empty, `hosted_domains` 0 with no domains, and
|
|
26
|
+
* `is_bogon` true, as the API serves it.
|
|
27
27
|
*
|
|
28
28
|
* Note this is the WIDEST shape regardless of your plan, so do not infer which
|
|
29
29
|
* fields your plan includes from a bogon answer.
|
package/dist/bogon.js
CHANGED
|
@@ -43,8 +43,8 @@ export function unmapped(ip) {
|
|
|
43
43
|
* The answer a bogon gets, in the shape the API answers one on a paid plan:
|
|
44
44
|
* every flag present and false, every detail object present and empty (Web
|
|
45
45
|
* IP's list empty), `location`, `asn`, `company`, `abuse`, `whois` and `rwhois`
|
|
46
|
-
* with every key empty, `hostname` empty, `hosted_domains` 0, and
|
|
47
|
-
* true, as the API serves it.
|
|
46
|
+
* with every key empty, `hostname` empty, `hosted_domains` 0 with no domains, and
|
|
47
|
+
* `is_bogon` true, as the API serves it.
|
|
48
48
|
*
|
|
49
49
|
* Note this is the WIDEST shape regardless of your plan, so do not infer which
|
|
50
50
|
* fields your plan includes from a bogon answer.
|
|
@@ -128,7 +128,7 @@ function bogonAnswer(ip) {
|
|
|
128
128
|
id: '', name: '', org: '', country: '', status: '', source: '', domain: '', abuse_email: '', asn: 0,
|
|
129
129
|
},
|
|
130
130
|
rwhois: { id: '', name: '', country: '', source: '', domain: '', abuse_email: '' },
|
|
131
|
-
hosted_domains: { total: 0 },
|
|
131
|
+
hosted_domains: { total: 0, domains: [] },
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
// Parsed once on first use rather than at import: a consumer that never looks
|
|
@@ -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, 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, 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';
|
|
@@ -81,9 +81,10 @@ export declare const lookupMyIp: <ThrowOnError extends boolean = false>(options?
|
|
|
81
81
|
* ASN lookup
|
|
82
82
|
*
|
|
83
83
|
* Answers what InternetData knows about one autonomous system: its registration on every plan,
|
|
84
|
-
* and on a paid one its ASN Whois record
|
|
85
|
-
* up to 20000 per address family
|
|
86
|
-
*
|
|
84
|
+
* and on a paid one its ASN Whois record, every prefix it announces in global BGP, with RPKI status,
|
|
85
|
+
* up to 20000 per address family, its rank, Tier 1 flag, upstreams, peers and downstreams from ASN
|
|
86
|
+
* Extended, up to 20000 each (the counts beside them are always whole), and the domains it hosts. An AS no
|
|
87
|
+
* database knows answers its number with empty values.
|
|
87
88
|
*
|
|
88
89
|
*/
|
|
89
90
|
export declare const lookupAsn: <ThrowOnError extends boolean = false>(options: Options<LookupAsnData, ThrowOnError>) => RequestResult<LookupAsnResponses, LookupAsnErrors, ThrowOnError>;
|
|
@@ -127,9 +127,10 @@ export const lookupMyIp = (options) => (options?.client ?? client).get({
|
|
|
127
127
|
* ASN lookup
|
|
128
128
|
*
|
|
129
129
|
* Answers what InternetData knows about one autonomous system: its registration on every plan,
|
|
130
|
-
* and on a paid one its ASN Whois record
|
|
131
|
-
* up to 20000 per address family
|
|
132
|
-
*
|
|
130
|
+
* and on a paid one its ASN Whois record, every prefix it announces in global BGP, with RPKI status,
|
|
131
|
+
* up to 20000 per address family, its rank, Tier 1 flag, upstreams, peers and downstreams from ASN
|
|
132
|
+
* Extended, up to 20000 each (the counts beside them are always whole), and the domains it hosts. An AS no
|
|
133
|
+
* database knows answers its number with empty values.
|
|
133
134
|
*
|
|
134
135
|
*/
|
|
135
136
|
export const lookupAsn = (options) => (options.client ?? client).get({
|
|
@@ -826,13 +826,30 @@ export type Rwhois = {
|
|
|
826
826
|
abuse_email: string;
|
|
827
827
|
};
|
|
828
828
|
/**
|
|
829
|
-
* From IP Hosted Domains:
|
|
829
|
+
* From IP Hosted Domains: how many registered domains resolve to the address, and the 10 most popular. Its database lists up to 1,000 an address. Paid plans and the trial.
|
|
830
830
|
*/
|
|
831
831
|
export type HostedDomains = {
|
|
832
832
|
/**
|
|
833
833
|
* How many registered domains resolve to the address.
|
|
834
834
|
*/
|
|
835
835
|
total: number;
|
|
836
|
+
/**
|
|
837
|
+
* Up to 10 of them, the most popular first; `[]` when none does.
|
|
838
|
+
*/
|
|
839
|
+
domains?: Array<string>;
|
|
840
|
+
};
|
|
841
|
+
/**
|
|
842
|
+
* From ASN Hosted Domains: how many registered domains the AS hosts, and the 10 most popular. Its database lists up to 1,000 an AS. Paid plans and the trial.
|
|
843
|
+
*/
|
|
844
|
+
export type AsnHostedDomains = {
|
|
845
|
+
/**
|
|
846
|
+
* How many registered domains resolve to an address the AS announces.
|
|
847
|
+
*/
|
|
848
|
+
total: number;
|
|
849
|
+
/**
|
|
850
|
+
* Up to 10 of them, the most popular first; `[]` when none does.
|
|
851
|
+
*/
|
|
852
|
+
domains?: Array<string>;
|
|
836
853
|
};
|
|
837
854
|
/**
|
|
838
855
|
* What every database says about one AS.
|
|
@@ -900,6 +917,39 @@ export type AsnLookupResponse = {
|
|
|
900
917
|
* What it announces, IPv4 then IPv6, up to 20000 a family. Paid plans and the trial.
|
|
901
918
|
*/
|
|
902
919
|
prefixes?: Array<AsnPrefix>;
|
|
920
|
+
/**
|
|
921
|
+
* Its rank in ASN Extended, by customer cone, 1 the largest; `0` for an AS seen in no AS path. Paid plans and the trial.
|
|
922
|
+
*/
|
|
923
|
+
rank?: number;
|
|
924
|
+
/**
|
|
925
|
+
* Whether it is one of the transit-free networks at the top of the hierarchy, which get transit from no one and peer with each other. Paid plans and the trial.
|
|
926
|
+
*/
|
|
927
|
+
tier1?: boolean;
|
|
928
|
+
/**
|
|
929
|
+
* How many AS numbers it gets transit from. Paid plans and the trial.
|
|
930
|
+
*/
|
|
931
|
+
num_upstreams?: number;
|
|
932
|
+
/**
|
|
933
|
+
* Those AS numbers, ascending, up to 20000. Paid plans and the trial.
|
|
934
|
+
*/
|
|
935
|
+
upstreams?: Array<number>;
|
|
936
|
+
/**
|
|
937
|
+
* How many AS numbers it exchanges its own and its customers' routes with. Paid plans and the trial.
|
|
938
|
+
*/
|
|
939
|
+
num_peers?: number;
|
|
940
|
+
/**
|
|
941
|
+
* Those AS numbers, ascending, up to 20000. Paid plans and the trial.
|
|
942
|
+
*/
|
|
943
|
+
peers?: Array<number>;
|
|
944
|
+
/**
|
|
945
|
+
* How many AS numbers it provides transit to. Paid plans and the trial.
|
|
946
|
+
*/
|
|
947
|
+
num_downstreams?: number;
|
|
948
|
+
/**
|
|
949
|
+
* Those AS numbers, ascending, up to 20000. Paid plans and the trial.
|
|
950
|
+
*/
|
|
951
|
+
downstreams?: Array<number>;
|
|
952
|
+
hosted_domains?: AsnHostedDomains;
|
|
903
953
|
/**
|
|
904
954
|
* 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.
|
|
905
955
|
*/
|
|
@@ -1169,15 +1219,24 @@ export type EntitlementApikey = {
|
|
|
1169
1219
|
};
|
|
1170
1220
|
export type EntitlementPlan = {
|
|
1171
1221
|
/**
|
|
1172
|
-
* The plan the organization is on
|
|
1173
|
-
*
|
|
1222
|
+
* The plan the organization is on, as an identifier that is never
|
|
1223
|
+
* renamed or reused: `free` for the free plan, or a paid plan's key.
|
|
1224
|
+
* Compare against it and show `name`. On `free`, usage counts the
|
|
1174
1225
|
* day's lookups answered with every field, its daily trial.
|
|
1175
1226
|
*
|
|
1176
1227
|
*/
|
|
1177
1228
|
key: string;
|
|
1229
|
+
/**
|
|
1230
|
+
* The plan's name, as the site and console show it: `Unlimited` for
|
|
1231
|
+
* the free plan. Show this rather than a name built from `key`: a
|
|
1232
|
+
* plan's name can change, and its key never does.
|
|
1233
|
+
*
|
|
1234
|
+
*/
|
|
1235
|
+
name: string;
|
|
1178
1236
|
/**
|
|
1179
1237
|
* The field tier, which decides how much of a lookup answer comes
|
|
1180
|
-
* back; `free` is the free plan's.
|
|
1238
|
+
* back; `free` is the free plan's. This list never gains a value: a
|
|
1239
|
+
* new plan reports one of these. What each tier includes is documented
|
|
1181
1240
|
* on the lookup endpoint rather than repeated here, so there is one
|
|
1182
1241
|
* place it can be wrong.
|
|
1183
1242
|
*
|
package/dist/shapes.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const BATCH_MEMBERS: readonly ["results", "errors"];
|
|
|
21
21
|
export declare const BATCH_ERROR_MEMBERS: readonly ["status", "error"];
|
|
22
22
|
export declare const ENTITLEMENT_MEMBERS: readonly ["org_id", "apikey", "plan", "usage"];
|
|
23
23
|
export declare const ENTITLEMENT_APIKEY_MEMBERS: readonly ["id", "allowed_cidrs"];
|
|
24
|
-
export declare const ENTITLEMENT_PLAN_MEMBERS: readonly ["key", "tier"];
|
|
24
|
+
export declare const ENTITLEMENT_PLAN_MEMBERS: readonly ["key", "name", "tier"];
|
|
25
25
|
export declare const ENTITLEMENT_USAGE_MEMBERS: readonly ["requests", "quota", "window_start", "window_end"];
|
|
26
26
|
type Kind = 'string' | 'integer' | 'number' | 'boolean' | 'object' | 'array' | 'date' | 'date-time';
|
|
27
27
|
export declare const LOOKUP_TYPES: Record<string, Kind>;
|
package/dist/shapes.js
CHANGED
|
@@ -41,7 +41,7 @@ export const BATCH_MEMBERS = ['results', 'errors'];
|
|
|
41
41
|
export const BATCH_ERROR_MEMBERS = ['status', 'error'];
|
|
42
42
|
export const ENTITLEMENT_MEMBERS = ['org_id', 'apikey', 'plan', 'usage'];
|
|
43
43
|
export const ENTITLEMENT_APIKEY_MEMBERS = ['id', 'allowed_cidrs'];
|
|
44
|
-
export const ENTITLEMENT_PLAN_MEMBERS = ['key', 'tier'];
|
|
44
|
+
export const ENTITLEMENT_PLAN_MEMBERS = ['key', 'name', 'tier'];
|
|
45
45
|
export const ENTITLEMENT_USAGE_MEMBERS = ['requests', 'quota', 'window_start', 'window_end'];
|
|
46
46
|
const FLAG = 'boolean';
|
|
47
47
|
export const LOOKUP_TYPES = {
|
|
@@ -118,11 +118,13 @@ export const WHOIS_TYPES = {
|
|
|
118
118
|
export const RWHOIS_TYPES = {
|
|
119
119
|
id: 'string', name: 'string', country: 'string', source: 'string', domain: 'string', abuse_email: 'string',
|
|
120
120
|
};
|
|
121
|
-
export const HOSTED_DOMAINS_TYPES = { total: 'integer' };
|
|
121
|
+
export const HOSTED_DOMAINS_TYPES = { total: 'integer', domains: 'array' };
|
|
122
122
|
export const ASN_LOOKUP_TYPES = {
|
|
123
123
|
asn: 'integer', name: 'string', country: 'string', registry: 'string', allocated: 'string', domain: 'string',
|
|
124
124
|
type: 'string', num_ips: 'integer', num_prefixes4: 'integer', num_prefixes6: 'integer', rpki_valid: 'integer',
|
|
125
|
-
rpki_invalid: 'integer', rpki_not_found: 'integer', whois: 'object', prefixes: 'array',
|
|
125
|
+
rpki_invalid: 'integer', rpki_not_found: 'integer', whois: 'object', prefixes: 'array', rank: 'integer',
|
|
126
|
+
tier1: FLAG, num_upstreams: 'integer', upstreams: 'array', num_peers: 'integer', peers: 'array',
|
|
127
|
+
num_downstreams: 'integer', downstreams: 'array', hosted_domains: 'object', trial_expired: FLAG,
|
|
126
128
|
};
|
|
127
129
|
export const ASN_PREFIX_TYPES = {
|
|
128
130
|
prefix: 'string', peer_count: 'integer', rpki_status: 'string', first_seen: 'string', country: 'string',
|
|
@@ -157,7 +159,7 @@ export const ENTITLEMENT_TYPES = {
|
|
|
157
159
|
export const ENTITLEMENT_APIKEY_TYPES = {
|
|
158
160
|
id: 'string', expires: 'date-time', allowed_cidrs: 'array',
|
|
159
161
|
};
|
|
160
|
-
export const ENTITLEMENT_PLAN_TYPES = { key: 'string', tier: 'string' };
|
|
162
|
+
export const ENTITLEMENT_PLAN_TYPES = { key: 'string', name: 'string', tier: 'string' };
|
|
161
163
|
export const ENTITLEMENT_USAGE_TYPES = {
|
|
162
164
|
requests: 'integer', quota: 'integer', hard_limit: 'integer', window_start: 'date-time',
|
|
163
165
|
window_end: 'date-time',
|
|
@@ -247,13 +249,19 @@ export function isLookup(data) {
|
|
|
247
249
|
&& optional(data['pubproxy'], (pubproxy) => lists(pubproxy, 'protocols', isString))
|
|
248
250
|
&& optional(data['bittorrent'], (bittorrent) => lists(bittorrent, 'clients', isString))
|
|
249
251
|
&& optional(data['web'], (web) => every(web, (row) => typed(row, WEB_DETAIL_MEMBERS, WEB_DETAIL_TYPES)))
|
|
252
|
+
&& optional(data['hosted_domains'], (hosted) => lists(hosted, 'domains', isString))
|
|
250
253
|
&& SHARED.every(([member, required, types]) => optional(data[member], (object) => typed(object, required, types)));
|
|
251
254
|
}
|
|
252
255
|
export function isAsnLookup(data) {
|
|
253
256
|
return typed(data, ASN_LOOKUP_MEMBERS, ASN_LOOKUP_TYPES)
|
|
254
257
|
&& optional(data['whois'], (whois) => values(whois, isString))
|
|
255
258
|
&& lists(data, 'prefixes', (prefix) => typed(prefix, ASN_PREFIX_MEMBERS, ASN_PREFIX_TYPES)
|
|
256
|
-
&& every(prefix['other_origins'], Number.isInteger))
|
|
259
|
+
&& every(prefix['other_origins'], Number.isInteger))
|
|
260
|
+
&& lists(data, 'upstreams', Number.isInteger)
|
|
261
|
+
&& lists(data, 'peers', Number.isInteger)
|
|
262
|
+
&& lists(data, 'downstreams', Number.isInteger)
|
|
263
|
+
&& optional(data['hosted_domains'], (hosted) => typed(hosted, HOSTED_DOMAINS_MEMBERS, HOSTED_DOMAINS_TYPES)
|
|
264
|
+
&& lists(hosted, 'domains', isString));
|
|
257
265
|
}
|
|
258
266
|
export function isDomainLookup(data) {
|
|
259
267
|
return typed(data, DOMAIN_LOOKUP_MEMBERS, DOMAIN_LOOKUP_TYPES)
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AbuseContact, Asn, 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, 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, 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, };
|
|
3
3
|
/**
|
|
4
4
|
* What a lookup answers about one address.
|
|
5
5
|
*
|
|
@@ -88,6 +88,16 @@ export interface AsnResult {
|
|
|
88
88
|
[key: string]: string;
|
|
89
89
|
};
|
|
90
90
|
prefixes?: AsnPrefix[];
|
|
91
|
+
/** Its rank in ASN Extended by customer cone, 1 the largest; `0` for an AS seen in no AS path. */
|
|
92
|
+
rank?: number;
|
|
93
|
+
tier1?: boolean;
|
|
94
|
+
numUpstreams?: number;
|
|
95
|
+
upstreams?: number[];
|
|
96
|
+
numPeers?: number;
|
|
97
|
+
peers?: number[];
|
|
98
|
+
numDownstreams?: number;
|
|
99
|
+
downstreams?: number[];
|
|
100
|
+
hostedDomains?: AsnHostedDomains;
|
|
91
101
|
trialExpired?: boolean;
|
|
92
102
|
/** The response exactly as it came off the wire, with its original names. */
|
|
93
103
|
raw: AsnLookupResponse;
|
package/dist/types.js
CHANGED
|
@@ -18,7 +18,9 @@ const ASN_RESULT_NAMES = {
|
|
|
18
18
|
asn: 'asn', name: 'name', country: 'country', registry: 'registry', allocated: 'allocated', domain: 'domain',
|
|
19
19
|
type: 'type', num_ips: 'numIps', num_prefixes4: 'numPrefixes4', num_prefixes6: 'numPrefixes6',
|
|
20
20
|
rpki_valid: 'rpkiValid', rpki_invalid: 'rpkiInvalid', rpki_not_found: 'rpkiNotFound', whois: 'whois',
|
|
21
|
-
prefixes: 'prefixes',
|
|
21
|
+
prefixes: 'prefixes', rank: 'rank', tier1: 'tier1', num_upstreams: 'numUpstreams', upstreams: 'upstreams',
|
|
22
|
+
num_peers: 'numPeers', peers: 'peers', num_downstreams: 'numDownstreams', downstreams: 'downstreams',
|
|
23
|
+
hosted_domains: 'hostedDomains', trial_expired: 'trialExpired',
|
|
22
24
|
};
|
|
23
25
|
const DOMAIN_RESULT_NAMES = {
|
|
24
26
|
domain: 'domain', is_registered: 'isRegistered', is_disposable: 'isDisposable', has_a: 'hasA',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "internetdata-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Official browser client library for the InternetData API. Look up IP addresses, ASes and domains from a page or a browser extension.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|