@internetdata/internetdata 2.8.1 → 2.9.1
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 +176 -24
- package/dist/bogon.d.ts +31 -0
- package/dist/bogon.js +215 -0
- package/dist/bogon.js.map +1 -0
- package/dist/bogons.gen.d.ts +2 -0
- package/dist/bogons.gen.js +88 -0
- package/dist/bogons.gen.js.map +1 -0
- package/dist/client.d.ts +150 -13
- package/dist/client.js +340 -36
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +12 -1
- package/dist/errors.js +19 -3
- package/dist/errors.js.map +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/sdk.gen.d.ts +57 -1
- package/dist/generated/sdk.gen.js +276 -18
- package/dist/generated/sdk.gen.js.map +1 -1
- package/dist/generated/types.gen.d.ts +1336 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/shapes.d.ts +67 -1
- package/dist/shapes.js +231 -4
- package/dist/shapes.js.map +1 -1
- package/dist/transport.d.ts +14 -0
- package/dist/transport.js +32 -0
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +115 -2
- package/dist/types.js +46 -0
- package/dist/types.js.map +1 -1
- package/package.json +7 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Database, DatabaseFormat, DatabaseMetadata, DatabaseMetadataColumn, DatabaseVersion, DbChecksums, Download, Standing } from './generated/types.gen.js';
|
|
2
|
-
export type { Database, DatabaseFormat, DatabaseMetadata, DatabaseMetadataColumn, DatabaseVersion, DbChecksums, Download, Standing, };
|
|
1
|
+
import type { AbuseContact, Asn, AsnLookupResponse, AsnPrefix, BitTorrentDetail, CarrierDetail, ClassDetail, Company, Database, DatabaseFormat, DatabaseMetadata, DatabaseMetadataColumn, DatabaseVersion, DbChecksums, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainDns, DomainIpRange, DomainIpRanges, DomainLookupResponse, Download, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupResponse, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, Standing, WebDetail, Whois } from './generated/types.gen.js';
|
|
2
|
+
export type { AbuseContact, Asn, AsnLookupResponse, AsnPrefix, BitTorrentDetail, CarrierDetail, ClassDetail, Company, Database, DatabaseFormat, DatabaseMetadata, DatabaseMetadataColumn, DatabaseVersion, DbChecksums, DisposableDetail, DnsAddressRecord, DnsCnameRecord, DnsMxRecord, DnsNsRecord, DnsResolverDetail, DomainDns, DomainIpRange, DomainIpRanges, DomainLookupResponse, Download, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, HostedDomains, Location, LookupResponse, ProxyDetail, PubproxyDetail, Rwhois, SatelliteDetail, SmtpDetail, SshDetail, Standing, WebDetail, Whois, };
|
|
3
3
|
/** What a license permits you to do with the data. `null` when there is none. */
|
|
4
4
|
export type LicenseType = Database['license_type'];
|
|
5
5
|
/**
|
|
@@ -13,3 +13,116 @@ export declare const DATABASE_FORMATS: readonly DatabaseFormat[];
|
|
|
13
13
|
export declare const DATASET_FORMATS: readonly DatabaseFormat[];
|
|
14
14
|
export declare const STANDINGS: readonly Standing[];
|
|
15
15
|
export declare const LICENSE_TYPES: readonly NonNullable<LicenseType>[];
|
|
16
|
+
/**
|
|
17
|
+
* What a lookup answers about one address.
|
|
18
|
+
*
|
|
19
|
+
* An **optional** member is one your plan does not include. It never means "we
|
|
20
|
+
* could not check", so `undefined` and `false` are genuinely different answers:
|
|
21
|
+
* `undefined` is "not in your plan", `false` is "checked, and no". Use
|
|
22
|
+
* `?? false` when you only care whether the address is flagged. The same holds
|
|
23
|
+
* inside `location`, `asn`, `company` and `abuse`, whose paid members are
|
|
24
|
+
* absent on Unlimited.
|
|
25
|
+
*
|
|
26
|
+
* A detail object that is present but empty (`{}`, and Web IP's `[]`) means the
|
|
27
|
+
* flag above it is false. A populated one always carries every one of its keys.
|
|
28
|
+
*/
|
|
29
|
+
export interface Result {
|
|
30
|
+
/** The address that was looked up, as parsed: `::ffff:a.b.c.d` answers as `a.b.c.d`. */
|
|
31
|
+
ip: string;
|
|
32
|
+
/** Reserved space, answered from the address alone. Such an address never reaches the network. */
|
|
33
|
+
isBogon: boolean;
|
|
34
|
+
isVpn?: boolean;
|
|
35
|
+
isTor: boolean;
|
|
36
|
+
isRelay: boolean;
|
|
37
|
+
isResproxy?: boolean;
|
|
38
|
+
isDcproxy?: boolean;
|
|
39
|
+
isMobproxy?: boolean;
|
|
40
|
+
isPubproxy?: boolean;
|
|
41
|
+
isHosting?: boolean;
|
|
42
|
+
isCdn?: boolean;
|
|
43
|
+
isAnycast: boolean;
|
|
44
|
+
isCarrier: boolean;
|
|
45
|
+
isSatellite: boolean;
|
|
46
|
+
isSsh: boolean;
|
|
47
|
+
isSmtp: boolean;
|
|
48
|
+
isWeb: boolean;
|
|
49
|
+
isDnsResolver: boolean;
|
|
50
|
+
isBittorrent: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* On answers to a key on the free plan only: `false` while the day's trial of
|
|
53
|
+
* every field lasts, `true` once the answer has Unlimited's.
|
|
54
|
+
*/
|
|
55
|
+
trialExpired?: boolean;
|
|
56
|
+
vpn?: ClassDetail;
|
|
57
|
+
tor: ClassDetail;
|
|
58
|
+
relay: ClassDetail;
|
|
59
|
+
resproxy?: ProxyDetail;
|
|
60
|
+
dcproxy?: ProxyDetail;
|
|
61
|
+
mobproxy?: ProxyDetail;
|
|
62
|
+
pubproxy?: PubproxyDetail;
|
|
63
|
+
hosting?: ClassDetail;
|
|
64
|
+
cdn?: ClassDetail;
|
|
65
|
+
carrier?: CarrierDetail;
|
|
66
|
+
satellite?: SatelliteDetail;
|
|
67
|
+
ssh?: SshDetail;
|
|
68
|
+
smtp?: SmtpDetail;
|
|
69
|
+
/** A row per port that answered, lowest first. */
|
|
70
|
+
web?: WebDetail[];
|
|
71
|
+
dnsResolver?: DnsResolverDetail;
|
|
72
|
+
bittorrent?: BitTorrentDetail;
|
|
73
|
+
location: Location;
|
|
74
|
+
asn: Asn;
|
|
75
|
+
company: Company;
|
|
76
|
+
/** The name the address's reverse DNS (PTR) record points to, empty when it has none. */
|
|
77
|
+
hostname: string;
|
|
78
|
+
abuse: AbuseContact;
|
|
79
|
+
whois?: Whois;
|
|
80
|
+
rwhois?: Rwhois;
|
|
81
|
+
hostedDomains?: HostedDomains;
|
|
82
|
+
/** The response exactly as it came off the wire, with its original names. */
|
|
83
|
+
raw: LookupResponse;
|
|
84
|
+
}
|
|
85
|
+
/** What `lookupAsn` answers. An optional member is one your plan does not include, as on `Result`. */
|
|
86
|
+
export interface AsnResult {
|
|
87
|
+
asn: number;
|
|
88
|
+
name: string;
|
|
89
|
+
country: string;
|
|
90
|
+
registry: string;
|
|
91
|
+
allocated: string;
|
|
92
|
+
domain: string;
|
|
93
|
+
type?: string;
|
|
94
|
+
numIps?: number;
|
|
95
|
+
numPrefixes4?: number;
|
|
96
|
+
numPrefixes6?: number;
|
|
97
|
+
rpkiValid?: number;
|
|
98
|
+
rpkiInvalid?: number;
|
|
99
|
+
rpkiNotFound?: number;
|
|
100
|
+
whois?: {
|
|
101
|
+
[key: string]: string;
|
|
102
|
+
};
|
|
103
|
+
prefixes?: AsnPrefix[];
|
|
104
|
+
trialExpired?: boolean;
|
|
105
|
+
/** The response exactly as it came off the wire, with its original names. */
|
|
106
|
+
raw: AsnLookupResponse;
|
|
107
|
+
}
|
|
108
|
+
/** What `lookupDomain` answers. An optional member is one your plan does not include, as on `Result`. */
|
|
109
|
+
export interface DomainResult {
|
|
110
|
+
domain: string;
|
|
111
|
+
isRegistered: boolean;
|
|
112
|
+
isDisposable?: boolean;
|
|
113
|
+
hasA: boolean;
|
|
114
|
+
hasAaaa: boolean;
|
|
115
|
+
hasMx: boolean;
|
|
116
|
+
hasNs: boolean;
|
|
117
|
+
hasCname: boolean;
|
|
118
|
+
dns?: DomainDns;
|
|
119
|
+
ipRanges?: DomainIpRanges;
|
|
120
|
+
/** `{}` when `isDisposable` is false. */
|
|
121
|
+
disposable?: DisposableDetail;
|
|
122
|
+
trialExpired?: boolean;
|
|
123
|
+
/** The response exactly as it came off the wire, with its original names. */
|
|
124
|
+
raw: DomainLookupResponse;
|
|
125
|
+
}
|
|
126
|
+
export declare function toResult(body: LookupResponse): Result;
|
|
127
|
+
export declare function toAsnResult(body: AsnLookupResponse): AsnResult;
|
|
128
|
+
export declare function toDomainResult(body: DomainLookupResponse): DomainResult;
|
package/dist/types.js
CHANGED
|
@@ -9,4 +9,50 @@ export const STANDINGS = ['licensed', 'expired', 'unlicensed'];
|
|
|
9
9
|
export const LICENSE_TYPES = [
|
|
10
10
|
'evaluation', 'standard', 'redistribute',
|
|
11
11
|
];
|
|
12
|
+
// The one place the wire's snake_case becomes idiomatic camelCase. Every member
|
|
13
|
+
// is copied when its key is PRESENT rather than truthy, so a plan that includes a
|
|
14
|
+
// field and answers `false` keeps it, and a plan that does not include it stays
|
|
15
|
+
// undefined. A member the spec adds fails to compile here until it is named.
|
|
16
|
+
const RESULT_NAMES = {
|
|
17
|
+
ip: 'ip', is_bogon: 'isBogon', is_vpn: 'isVpn', is_tor: 'isTor', is_relay: 'isRelay',
|
|
18
|
+
is_resproxy: 'isResproxy', is_dcproxy: 'isDcproxy', is_mobproxy: 'isMobproxy', is_pubproxy: 'isPubproxy',
|
|
19
|
+
is_hosting: 'isHosting', is_cdn: 'isCdn', is_anycast: 'isAnycast', is_carrier: 'isCarrier',
|
|
20
|
+
is_satellite: 'isSatellite', is_ssh: 'isSsh', is_smtp: 'isSmtp', is_web: 'isWeb',
|
|
21
|
+
is_dns_resolver: 'isDnsResolver', is_bittorrent: 'isBittorrent', trial_expired: 'trialExpired',
|
|
22
|
+
vpn: 'vpn', tor: 'tor', relay: 'relay', resproxy: 'resproxy', dcproxy: 'dcproxy', mobproxy: 'mobproxy',
|
|
23
|
+
pubproxy: 'pubproxy', hosting: 'hosting', cdn: 'cdn', carrier: 'carrier', satellite: 'satellite', ssh: 'ssh',
|
|
24
|
+
smtp: 'smtp', web: 'web', dns_resolver: 'dnsResolver', bittorrent: 'bittorrent', location: 'location',
|
|
25
|
+
asn: 'asn', company: 'company', hostname: 'hostname', abuse: 'abuse', whois: 'whois', rwhois: 'rwhois',
|
|
26
|
+
hosted_domains: 'hostedDomains',
|
|
27
|
+
};
|
|
28
|
+
const ASN_RESULT_NAMES = {
|
|
29
|
+
asn: 'asn', name: 'name', country: 'country', registry: 'registry', allocated: 'allocated', domain: 'domain',
|
|
30
|
+
type: 'type', num_ips: 'numIps', num_prefixes4: 'numPrefixes4', num_prefixes6: 'numPrefixes6',
|
|
31
|
+
rpki_valid: 'rpkiValid', rpki_invalid: 'rpkiInvalid', rpki_not_found: 'rpkiNotFound', whois: 'whois',
|
|
32
|
+
prefixes: 'prefixes', trial_expired: 'trialExpired',
|
|
33
|
+
};
|
|
34
|
+
const DOMAIN_RESULT_NAMES = {
|
|
35
|
+
domain: 'domain', is_registered: 'isRegistered', is_disposable: 'isDisposable', has_a: 'hasA',
|
|
36
|
+
has_aaaa: 'hasAaaa', has_mx: 'hasMx', has_ns: 'hasNs', has_cname: 'hasCname', dns: 'dns',
|
|
37
|
+
ip_ranges: 'ipRanges', disposable: 'disposable', trial_expired: 'trialExpired',
|
|
38
|
+
};
|
|
39
|
+
export function toResult(body) {
|
|
40
|
+
return renamed(body, RESULT_NAMES);
|
|
41
|
+
}
|
|
42
|
+
export function toAsnResult(body) {
|
|
43
|
+
return renamed(body, ASN_RESULT_NAMES);
|
|
44
|
+
}
|
|
45
|
+
export function toDomainResult(body) {
|
|
46
|
+
return renamed(body, DOMAIN_RESULT_NAMES);
|
|
47
|
+
}
|
|
48
|
+
function renamed(body, names) {
|
|
49
|
+
const out = {};
|
|
50
|
+
for (const [from, to] of Object.entries(names)) {
|
|
51
|
+
if (from in body && body[from] !== undefined) {
|
|
52
|
+
out[to] = body[from];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
out['raw'] = body;
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
12
58
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4BA,+EAA+E;AAC/E,0EAA0E;AAC1E,gFAAgF;AAChF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAE7E,gDAAgD;AAChD,MAAM,CAAC,MAAM,eAAe,GAA8B,gBAAgB,CAAC;AAC3E,MAAM,CAAC,MAAM,SAAS,GAAwB,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,aAAa,GAAwC;IAC9D,YAAY,EAAE,UAAU,EAAE,cAAc;CAC3C,CAAC;AAqHF,gFAAgF;AAChF,kFAAkF;AAClF,gFAAgF;AAChF,6EAA6E;AAC7E,MAAM,YAAY,GAA+D;IAC7E,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS;IACpF,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY;IACxG,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW;IAC1F,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE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AK,EAAE,MAAM;IAC7F,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK;IACxF,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc;CACjF,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,IAAoB;IACzC,OAAO,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAuB;IAC/C,OAAO,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAA0B;IACrD,OAAO,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,OAAO,CAAyC,IAAO,EAAE,KAA8B;IAC5F,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAS,KAAK,CAAC,EAAE,CAAC;QACrD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAe,CAAC,KAAK,SAAS,EAAE,CAAC;YACtD,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAe,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;IACD,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAClB,OAAO,GAAQ,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internetdata/internetdata",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Official Node.js client library for the InternetData API.
|
|
3
|
+
"version": "2.9.1",
|
|
4
|
+
"description": "Official Node.js client library for the InternetData API. Look up IP addresses, ASes and domains, and download licensed IP database files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://internetdata.io",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"keywords": [
|
|
16
16
|
"ip-database",
|
|
17
17
|
"ip-intelligence",
|
|
18
|
+
"ip-lookup",
|
|
19
|
+
"ip-geolocation",
|
|
20
|
+
"domain-lookup",
|
|
18
21
|
"ip-data",
|
|
19
22
|
"mmdb",
|
|
20
23
|
"maxmind-db",
|
|
@@ -47,6 +50,8 @@
|
|
|
47
50
|
"node": ">=22"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
53
|
+
"lru-cache": "^11.0.2",
|
|
54
|
+
"p-limit": "^6.2.0",
|
|
50
55
|
"p-retry": "^8.0.0"
|
|
51
56
|
},
|
|
52
57
|
"devDependencies": {
|