internetdata-web 1.0.0 → 1.1.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 +2 -2
- package/dist/bogon.d.ts +2 -2
- package/dist/bogon.js +3 -3
- package/dist/generated/types.gen.d.ts +5 -1
- package/dist/shapes.js +2 -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
|
```
|
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
|
|
@@ -826,13 +826,17 @@ 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>;
|
|
836
840
|
};
|
|
837
841
|
/**
|
|
838
842
|
* What every database says about one AS.
|
package/dist/shapes.js
CHANGED
|
@@ -118,7 +118,7 @@ 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',
|
|
@@ -247,6 +247,7 @@ export function isLookup(data) {
|
|
|
247
247
|
&& optional(data['pubproxy'], (pubproxy) => lists(pubproxy, 'protocols', isString))
|
|
248
248
|
&& optional(data['bittorrent'], (bittorrent) => lists(bittorrent, 'clients', isString))
|
|
249
249
|
&& optional(data['web'], (web) => every(web, (row) => typed(row, WEB_DETAIL_MEMBERS, WEB_DETAIL_TYPES)))
|
|
250
|
+
&& optional(data['hosted_domains'], (hosted) => lists(hosted, 'domains', isString))
|
|
250
251
|
&& SHARED.every(([member, required, types]) => optional(data[member], (object) => typed(object, required, types)));
|
|
251
252
|
}
|
|
252
253
|
export function isAsnLookup(data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "internetdata-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.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",
|