vpndetection-web 1.1.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 +9 -9
- package/dist/client.d.ts +11 -10
- package/dist/client.js +8 -7
- package/dist/errors.d.ts +4 -5
- package/dist/generated/sdk.gen.d.ts +12 -9
- package/dist/generated/sdk.gen.js +12 -9
- package/dist/generated/types.gen.d.ts +36 -19
- package/dist/shapes.js +1 -1
- package/dist/types.d.ts +8 -3
- package/dist/types.js +1 -0
- 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.**
|
|
33
|
+
**No API key needed to start.** The Unlimited tier answers `ip`, `is_vpn`, Tor and relay detection, `location` and `asn`, 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 { VPNDetection } from 'vpndetection-web';
|
|
@@ -48,14 +48,14 @@ console.log(result.asn?.name); // who runs the announcing network
|
|
|
48
48
|
|
|
49
49
|
### With an API key
|
|
50
50
|
|
|
51
|
-
Where the key stays private (see above),
|
|
51
|
+
Where the key stays private (see above), every paid plan answers every field: `is_hosting`, `is_cdn` and the four proxy flags as well, and the provider, confidence and last-seen detail behind each flag. The plans differ only in how many lookups they include, and a new account can try every field, 100 lookups a day. Create a key in the [console](https://app.vpndetection.io), then pass it in:
|
|
52
52
|
|
|
53
53
|
```js
|
|
54
54
|
const client = new VPNDetection({ apiKey: 'your-api-key' });
|
|
55
55
|
|
|
56
56
|
const result = await client.lookup('45.83.91.1');
|
|
57
57
|
console.log(result.isVpn); // true
|
|
58
|
-
console.log(result.isHosting); //
|
|
58
|
+
console.log(result.isHosting); // on a paid plan
|
|
59
59
|
console.log(result.vpn?.provider); // on a paid plan
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -79,11 +79,11 @@ console.log(ent.usage.requests); // 580
|
|
|
79
79
|
console.log(ent.usage.window_end); // when the allowance resets
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Usage counts against the anniversary of your subscription, not the calendar month and not the billing period, and 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.
|
|
82
|
+
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 a trial key; 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.
|
|
83
83
|
|
|
84
84
|
### Batch lookup
|
|
85
85
|
|
|
86
|
-
Look up as many addresses as you like in one call. Bogons and cached answers are handled locally, and the rest go to the batch endpoint in chunks of up to 1000, in parallel. The batch endpoint needs
|
|
86
|
+
Look up as many addresses as you like in one call. Bogons and cached answers are handled locally, and the rest go to the batch endpoint in chunks of up to 1000, in parallel. The batch endpoint needs a paid plan:
|
|
87
87
|
|
|
88
88
|
```js
|
|
89
89
|
const results = await client.lookupBatch(['45.83.91.1', '8.8.8.8', '1.1.1.1']);
|
|
@@ -206,7 +206,7 @@ try {
|
|
|
206
206
|
|
|
207
207
|
`kind` is one of `bad_request`, `unauthorized`, `forbidden`, `rate_limited`, `quota_exceeded`, `server_error` or `network`.
|
|
208
208
|
|
|
209
|
-
Note that `rate_limited` and `quota_exceeded` both arrive as HTTP 429 and are not the same thing. A rate limit is when the API faces extreme traffic bursts
|
|
209
|
+
Note that `rate_limited` and `quota_exceeded` both arrive as HTTP 429 and are not the same thing. A rate limit is when the API faces extreme traffic bursts and so retrying later works; but a spent quota needs your allowance raised or the window to roll over. The library retries rate limits for you, but not if your quota is exceeded.
|
|
210
210
|
|
|
211
211
|
A request the browser never got an answer to is a retryable `network` error carrying what the browser said: offline, blocked by an extension, or refused by the page's Content-Security-Policy.
|
|
212
212
|
|
|
@@ -246,12 +246,12 @@ The library is ES2022 and needs only what a browser has, `fetch` and, for PKCE,
|
|
|
246
246
|
|
|
247
247
|
### Absent is not false
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
The Unlimited tier leaves out `isHosting`, `isCdn` and the four proxy flags, and of the detail behind each flag it answers only Tor's and relay's; a trial key's answer carries `trialExpired`, true once its day of full answers is spent. A field your key does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
|
|
250
250
|
|
|
251
251
|
```js
|
|
252
252
|
result.isHosting ?? false // when you only want the flag
|
|
253
|
-
result.isHosting === undefined //
|
|
254
|
-
result.
|
|
253
|
+
result.isHosting === undefined // on the Unlimited tier: not in your plan
|
|
254
|
+
result.trialExpired === true // a trial key's day of full answers is spent
|
|
255
255
|
```
|
|
256
256
|
|
|
257
257
|
## Other Libraries
|
package/dist/client.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ export interface CacheOptions {
|
|
|
18
18
|
}
|
|
19
19
|
export interface Options {
|
|
20
20
|
/**
|
|
21
|
-
* Your API key.
|
|
22
|
-
* `
|
|
23
|
-
*
|
|
21
|
+
* Your API key. Without one a lookup is on the Unlimited tier: `ip`,
|
|
22
|
+
* `is_vpn`, the Tor and relay members, `location` and `asn`, with no daily
|
|
23
|
+
* or monthly cap. A batch needs a key on a paid plan.
|
|
24
24
|
* A key in a web page is readable by anyone who opens the page.
|
|
25
25
|
*/
|
|
26
26
|
apiKey?: string;
|
|
@@ -121,10 +121,11 @@ export declare class VPNDetection {
|
|
|
121
121
|
* Unlike a lookup there is no useful unauthenticated answer, so a client
|
|
122
122
|
* built without a key gets an unauthorized error rather than a partial one.
|
|
123
123
|
*
|
|
124
|
-
* Usage counts against the ALLOWANCE WINDOW -
|
|
125
|
-
* subscription, not the calendar month and not the
|
|
126
|
-
*
|
|
127
|
-
*
|
|
124
|
+
* Usage counts against the ALLOWANCE WINDOW - on a paid plan the
|
|
125
|
+
* anniversary of the subscription, not the calendar month and not the
|
|
126
|
+
* billing period, and on a trial key the UTC day - and it is the same
|
|
127
|
+
* number a lookup is gated on. It can lag by a few seconds, because
|
|
128
|
+
* requests are counted in memory and flushed in aggregate.
|
|
128
129
|
*
|
|
129
130
|
* Deliberately NOT cached: the whole point is what has been spent, and a
|
|
130
131
|
* cached answer is a wrong one within seconds of the next request.
|
|
@@ -146,9 +147,9 @@ export declare class VPNDetection {
|
|
|
146
147
|
* and a chunk that fails as a whole marks every address in it. A per-call
|
|
147
148
|
* `concurrency` below 1 is refused as `bad_request` before anything is sent.
|
|
148
149
|
* An IPv4-mapped address is looked up as the IPv4 address it carries, and its
|
|
149
|
-
* answer keyed as you passed it. The batch endpoint needs
|
|
150
|
-
*
|
|
151
|
-
* `
|
|
150
|
+
* answer keyed as you passed it. The batch endpoint needs a paid plan:
|
|
151
|
+
* without a key every address sent to it carries an `unauthorized` error,
|
|
152
|
+
* and a trial key's batch of two or more a `bad_request` (HTTP 402).
|
|
152
153
|
*/
|
|
153
154
|
lookupBatch(ips: Iterable<string>, options?: BatchOptions): Promise<Map<string, Result | VPNDetectionError>>;
|
|
154
155
|
private unstored;
|
package/dist/client.js
CHANGED
|
@@ -161,10 +161,11 @@ export class VPNDetection {
|
|
|
161
161
|
* Unlike a lookup there is no useful unauthenticated answer, so a client
|
|
162
162
|
* built without a key gets an unauthorized error rather than a partial one.
|
|
163
163
|
*
|
|
164
|
-
* Usage counts against the ALLOWANCE WINDOW -
|
|
165
|
-
* subscription, not the calendar month and not the
|
|
166
|
-
*
|
|
167
|
-
*
|
|
164
|
+
* Usage counts against the ALLOWANCE WINDOW - on a paid plan the
|
|
165
|
+
* anniversary of the subscription, not the calendar month and not the
|
|
166
|
+
* billing period, and on a trial key the UTC day - and it is the same
|
|
167
|
+
* number a lookup is gated on. It can lag by a few seconds, because
|
|
168
|
+
* requests are counted in memory and flushed in aggregate.
|
|
168
169
|
*
|
|
169
170
|
* Deliberately NOT cached: the whole point is what has been spent, and a
|
|
170
171
|
* cached answer is a wrong one within seconds of the next request.
|
|
@@ -194,9 +195,9 @@ export class VPNDetection {
|
|
|
194
195
|
* and a chunk that fails as a whole marks every address in it. A per-call
|
|
195
196
|
* `concurrency` below 1 is refused as `bad_request` before anything is sent.
|
|
196
197
|
* An IPv4-mapped address is looked up as the IPv4 address it carries, and its
|
|
197
|
-
* answer keyed as you passed it. The batch endpoint needs
|
|
198
|
-
*
|
|
199
|
-
* `
|
|
198
|
+
* answer keyed as you passed it. The batch endpoint needs a paid plan:
|
|
199
|
+
* without a key every address sent to it carries an `unauthorized` error,
|
|
200
|
+
* and a trial key's batch of two or more a `bad_request` (HTTP 402).
|
|
200
201
|
*/
|
|
201
202
|
async lookupBatch(ips, options = {}) {
|
|
202
203
|
const concurrency = checkConcurrency(options.concurrency);
|
package/dist/errors.d.ts
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* Why a request failed.
|
|
3
3
|
*
|
|
4
4
|
* `rate_limited` and `quota_exceeded` both arrive as HTTP 429 and are NOT the
|
|
5
|
-
* same thing. A rate limit is the API protecting itself
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* distinguishes them.
|
|
5
|
+
* same thing. A rate limit is the API protecting itself and carries
|
|
6
|
+
* `Retry-After`; retrying works. A spent quota carries no such header and
|
|
7
|
+
* retrying will not help until the window rolls over or the limit is raised.
|
|
8
|
+
* The header is the only thing that distinguishes them.
|
|
10
9
|
*/
|
|
11
10
|
export type ErrorKind = 'bad_request' | 'unauthorized' | 'forbidden' | 'rate_limited' | 'quota_exceeded' | 'server_error' | 'network';
|
|
12
11
|
export declare class VPNDetectionError extends Error {
|
|
@@ -17,8 +17,9 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
17
17
|
* Lookup
|
|
18
18
|
*
|
|
19
19
|
* Answers what is known about a single IPv4 or IPv6 address. Which fields
|
|
20
|
-
* come back is decided by the presented key; with no key the
|
|
21
|
-
* `ip`, `is_vpn`, the Tor and relay members,
|
|
20
|
+
* come back is decided by the presented key; with no key, the Unlimited
|
|
21
|
+
* tier, the answer is `ip`, `is_vpn`, the Tor and relay members,
|
|
22
|
+
* `location` and `asn`.
|
|
22
23
|
*
|
|
23
24
|
*/
|
|
24
25
|
export declare const lookupIp: <ThrowOnError extends boolean = false>(options: Options<LookupIpData, ThrowOnError>) => RequestResult<LookupIpResponses, LookupIpErrors, ThrowOnError>;
|
|
@@ -28,7 +29,7 @@ export declare const lookupIp: <ThrowOnError extends boolean = false>(options: O
|
|
|
28
29
|
* Answers what is known about the address this request came from, which is
|
|
29
30
|
* the same answer `GET /{ip}` gives for that address: the presented key
|
|
30
31
|
* decides which fields come back, and the request counts against the same
|
|
31
|
-
*
|
|
32
|
+
* limits.
|
|
32
33
|
*
|
|
33
34
|
* The address is the one our edge observed, so a request through a proxy
|
|
34
35
|
* or a VPN reports the exit it left through rather than the machine that
|
|
@@ -49,16 +50,18 @@ export declare const lookupMyIp: <ThrowOnError extends boolean = false>(options?
|
|
|
49
50
|
* normalized form. An address that could not be answered sits in `errors`
|
|
50
51
|
* with the status and message the single lookup would have given, and
|
|
51
52
|
* never disturbs the others: a string that is not an address is a `400`
|
|
52
|
-
* there, and an
|
|
53
|
-
*
|
|
53
|
+
* there, and an overage cap reached part way through leaves the remaining
|
|
54
|
+
* entries as `429`s.
|
|
54
55
|
*
|
|
55
56
|
* The call itself fails only for the reasons below, and a `429` on the
|
|
56
57
|
* call always carries `Retry-After`: the batch is admitted or refused
|
|
57
|
-
* whole by the rate limit, so a per-entry `429` is always
|
|
58
|
-
*
|
|
58
|
+
* whole by the rate limit, so a per-entry `429` is always the overage cap
|
|
59
|
+
* and never a throttle.
|
|
59
60
|
*
|
|
60
|
-
* A batch needs
|
|
61
|
-
*
|
|
61
|
+
* A batch needs a paid plan: without a key the call is refused with `401`,
|
|
62
|
+
* and with a trial key with `402`, unless it names one address, which is
|
|
63
|
+
* answered as `GET /{ip}` would answer it. Unlimited and a trial look up
|
|
64
|
+
* one address at a time.
|
|
62
65
|
*
|
|
63
66
|
*/
|
|
64
67
|
export declare const lookupBatch: <ThrowOnError extends boolean = false>(options: Options<LookupBatchData, ThrowOnError>) => RequestResult<LookupBatchResponses, LookupBatchErrors, ThrowOnError>;
|
|
@@ -5,8 +5,9 @@ import { urlSearchParamsBodySerializer } from './client/index.js';
|
|
|
5
5
|
* Lookup
|
|
6
6
|
*
|
|
7
7
|
* Answers what is known about a single IPv4 or IPv6 address. Which fields
|
|
8
|
-
* come back is decided by the presented key; with no key the
|
|
9
|
-
* `ip`, `is_vpn`, the Tor and relay members,
|
|
8
|
+
* come back is decided by the presented key; with no key, the Unlimited
|
|
9
|
+
* tier, the answer is `ip`, `is_vpn`, the Tor and relay members,
|
|
10
|
+
* `location` and `asn`.
|
|
10
11
|
*
|
|
11
12
|
*/
|
|
12
13
|
export const lookupIp = (options) => (options.client ?? client).get({
|
|
@@ -28,7 +29,7 @@ export const lookupIp = (options) => (options.client ?? client).get({
|
|
|
28
29
|
* Answers what is known about the address this request came from, which is
|
|
29
30
|
* the same answer `GET /{ip}` gives for that address: the presented key
|
|
30
31
|
* decides which fields come back, and the request counts against the same
|
|
31
|
-
*
|
|
32
|
+
* limits.
|
|
32
33
|
*
|
|
33
34
|
* The address is the one our edge observed, so a request through a proxy
|
|
34
35
|
* or a VPN reports the exit it left through rather than the machine that
|
|
@@ -61,16 +62,18 @@ export const lookupMyIp = (options) => (options?.client ?? client).get({
|
|
|
61
62
|
* normalized form. An address that could not be answered sits in `errors`
|
|
62
63
|
* with the status and message the single lookup would have given, and
|
|
63
64
|
* never disturbs the others: a string that is not an address is a `400`
|
|
64
|
-
* there, and an
|
|
65
|
-
*
|
|
65
|
+
* there, and an overage cap reached part way through leaves the remaining
|
|
66
|
+
* entries as `429`s.
|
|
66
67
|
*
|
|
67
68
|
* The call itself fails only for the reasons below, and a `429` on the
|
|
68
69
|
* call always carries `Retry-After`: the batch is admitted or refused
|
|
69
|
-
* whole by the rate limit, so a per-entry `429` is always
|
|
70
|
-
*
|
|
70
|
+
* whole by the rate limit, so a per-entry `429` is always the overage cap
|
|
71
|
+
* and never a throttle.
|
|
71
72
|
*
|
|
72
|
-
* A batch needs
|
|
73
|
-
*
|
|
73
|
+
* A batch needs a paid plan: without a key the call is refused with `401`,
|
|
74
|
+
* and with a trial key with `402`, unless it names one address, which is
|
|
75
|
+
* answered as `GET /{ip}` would answer it. Unlimited and a trial look up
|
|
76
|
+
* one address at a time.
|
|
74
77
|
*
|
|
75
78
|
*/
|
|
76
79
|
export const lookupBatch = (options) => (options.client ?? client).post({
|
|
@@ -2,9 +2,9 @@ export type ClientOptions = {
|
|
|
2
2
|
baseUrl: 'https://api.vpndetection.io' | (string & {});
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
|
-
* The union of every
|
|
5
|
+
* The union of every tier's answer. Every answer carries `ip`, `is_vpn`,
|
|
6
6
|
* the Tor and relay members, `location` and `asn`, with or without a key;
|
|
7
|
-
* each remaining field is present when your
|
|
7
|
+
* each remaining field is present when your tier includes it, and absent
|
|
8
8
|
* otherwise. A client that must work across plans should treat an absent
|
|
9
9
|
* flag as unknown rather than as `false`.
|
|
10
10
|
*
|
|
@@ -22,7 +22,7 @@ export type LookupResponse = {
|
|
|
22
22
|
*/
|
|
23
23
|
is_vpn: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* Whether the address belongs to a hosting or cloud provider.
|
|
25
|
+
* Whether the address belongs to a hosting or cloud provider. Paid plans.
|
|
26
26
|
*/
|
|
27
27
|
is_hosting?: boolean;
|
|
28
28
|
/**
|
|
@@ -34,23 +34,23 @@ export type LookupResponse = {
|
|
|
34
34
|
*/
|
|
35
35
|
is_tor?: boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Whether the address belongs to a CDN.
|
|
37
|
+
* Whether the address belongs to a CDN. Paid plans.
|
|
38
38
|
*/
|
|
39
39
|
is_cdn?: boolean;
|
|
40
40
|
/**
|
|
41
|
-
* Whether the address was seen in a residential proxy pool.
|
|
41
|
+
* Whether the address was seen in a residential proxy pool. Paid plans.
|
|
42
42
|
*/
|
|
43
43
|
is_resproxy?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
* Whether the address is one a datacenter proxy service sells or runs on, a proxy company's own ranges included.
|
|
45
|
+
* Whether the address is one a datacenter proxy service sells or runs on, a proxy company's own ranges included. Paid plans.
|
|
46
46
|
*/
|
|
47
47
|
is_dcproxy?: boolean;
|
|
48
48
|
/**
|
|
49
|
-
* Whether the address was seen in a mobile proxy pool.
|
|
49
|
+
* Whether the address was seen in a mobile proxy pool. Paid plans.
|
|
50
50
|
*/
|
|
51
51
|
is_mobproxy?: boolean;
|
|
52
52
|
/**
|
|
53
|
-
* Whether a public proxy, one anyone can connect through, listens on the address or sends its traffic out from it.
|
|
53
|
+
* Whether a public proxy, one anyone can connect through, listens on the address or sends its traffic out from it. Paid plans.
|
|
54
54
|
*/
|
|
55
55
|
is_pubproxy?: boolean;
|
|
56
56
|
/**
|
|
@@ -95,6 +95,13 @@ export type LookupResponse = {
|
|
|
95
95
|
pubproxy?: PubproxyDetail;
|
|
96
96
|
location?: Location;
|
|
97
97
|
asn?: Asn;
|
|
98
|
+
/**
|
|
99
|
+
* On every answer to a trial key, an organization on no paid plan, and
|
|
100
|
+
* on no other: `false` while the organization's 100 full answers for
|
|
101
|
+
* the UTC day last, `true` once the answer is Unlimited's.
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
trial_expired?: boolean;
|
|
98
105
|
};
|
|
99
106
|
export type BatchLookupRequest = {
|
|
100
107
|
/**
|
|
@@ -129,7 +136,7 @@ export type BatchLookupResponse = {
|
|
|
129
136
|
export type BatchLookupError = {
|
|
130
137
|
/**
|
|
131
138
|
* The HTTP status `GET /{ip}` would have answered for this entry: `400`
|
|
132
|
-
* for a string that is not an address, `429` for a
|
|
139
|
+
* for a string that is not an address, `429` for a reached overage cap,
|
|
133
140
|
* `500` when the VPN dataset could not be consulted. A `429` here is
|
|
134
141
|
* never a throttle; the whole call is refused instead.
|
|
135
142
|
*
|
|
@@ -402,13 +409,17 @@ export type EntitlementApikey = {
|
|
|
402
409
|
};
|
|
403
410
|
export type EntitlementPlan = {
|
|
404
411
|
/**
|
|
405
|
-
* The plan the organization is on
|
|
412
|
+
* The plan the organization is on, or `trial` on none: a trial
|
|
413
|
+
* answers every field for the organization's first 100 lookups each
|
|
414
|
+
* UTC day, and Unlimited's answer after them.
|
|
415
|
+
*
|
|
406
416
|
*/
|
|
407
417
|
key: string;
|
|
408
418
|
/**
|
|
409
419
|
* The field tier, which decides how much of a lookup answer comes
|
|
410
|
-
* back. What each tier includes is documented
|
|
411
|
-
* rather than repeated here, so there is one
|
|
420
|
+
* back; `free` is a trial's. What each tier includes is documented
|
|
421
|
+
* on the lookup endpoint rather than repeated here, so there is one
|
|
422
|
+
* place it can be wrong.
|
|
412
423
|
*
|
|
413
424
|
*/
|
|
414
425
|
tier: 'free' | 'starter' | 'scale' | 'max';
|
|
@@ -586,9 +597,9 @@ export type LookupIpErrors = {
|
|
|
586
597
|
*/
|
|
587
598
|
403: LookupError;
|
|
588
599
|
/**
|
|
589
|
-
* Either a rate limit or a
|
|
590
|
-
* for the former and absent for the latter, and is the only
|
|
591
|
-
* tell them apart.
|
|
600
|
+
* Either a rate limit or a paid plan's overage cap. `Retry-After` is
|
|
601
|
+
* present for the former and absent for the latter, and is the only
|
|
602
|
+
* way to tell them apart.
|
|
592
603
|
*
|
|
593
604
|
*/
|
|
594
605
|
429: LookupError;
|
|
@@ -627,9 +638,9 @@ export type LookupMyIpErrors = {
|
|
|
627
638
|
*/
|
|
628
639
|
403: LookupError;
|
|
629
640
|
/**
|
|
630
|
-
* Either a rate limit or a
|
|
631
|
-
* for the former and absent for the latter, and is the only
|
|
632
|
-
* tell them apart.
|
|
641
|
+
* Either a rate limit or a paid plan's overage cap. `Retry-After` is
|
|
642
|
+
* present for the former and absent for the latter, and is the only
|
|
643
|
+
* way to tell them apart.
|
|
633
644
|
*
|
|
634
645
|
*/
|
|
635
646
|
429: LookupError;
|
|
@@ -663,6 +674,12 @@ export type LookupBatchErrors = {
|
|
|
663
674
|
* No API key was presented, or the one presented is unknown, revoked, or expired.
|
|
664
675
|
*/
|
|
665
676
|
401: LookupError;
|
|
677
|
+
/**
|
|
678
|
+
* The key is a trial's, an organization on no paid plan, and the batch
|
|
679
|
+
* names more than one address: a batch needs a paid plan.
|
|
680
|
+
*
|
|
681
|
+
*/
|
|
682
|
+
402: LookupError;
|
|
666
683
|
/**
|
|
667
684
|
* The key restricts which source addresses may use it and this
|
|
668
685
|
* request came from none of them, or the key was sent over plain
|
|
@@ -677,7 +694,7 @@ export type LookupBatchErrors = {
|
|
|
677
694
|
413: LookupError;
|
|
678
695
|
/**
|
|
679
696
|
* The rate limit refused the whole call. Always transient and always
|
|
680
|
-
* with `Retry-After`; a
|
|
697
|
+
* with `Retry-After`; a reached overage cap is reported per entry in a
|
|
681
698
|
* `200` instead.
|
|
682
699
|
*
|
|
683
700
|
*/
|
package/dist/shapes.js
CHANGED
|
@@ -19,7 +19,7 @@ export const LOOKUP_TYPES = {
|
|
|
19
19
|
is_cdn: 'boolean', is_resproxy: 'boolean', is_dcproxy: 'boolean', is_mobproxy: 'boolean',
|
|
20
20
|
is_pubproxy: 'boolean', vpn: 'object', hosting: 'object', relay: 'object', tor: 'object', cdn: 'object',
|
|
21
21
|
resproxy: 'object', dcproxy: 'object', mobproxy: 'object', pubproxy: 'object', location: 'object',
|
|
22
|
-
asn: 'object',
|
|
22
|
+
asn: 'object', trial_expired: 'boolean',
|
|
23
23
|
};
|
|
24
24
|
export const VPN_DETAIL_TYPES = {
|
|
25
25
|
provider: 'string', last_seen: 'date', confidence: 'string', method: 'string',
|
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ export interface Result {
|
|
|
26
26
|
isDcproxy?: boolean;
|
|
27
27
|
isMobproxy?: boolean;
|
|
28
28
|
isPubproxy?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* On a Trial key's answers only: `false` while the organization's 100 full answers for the
|
|
31
|
+
* UTC day last, `true` once the answer is Unlimited's.
|
|
32
|
+
*/
|
|
33
|
+
trialExpired?: boolean;
|
|
29
34
|
vpn?: VpnDetail;
|
|
30
35
|
hosting?: ClassDetail;
|
|
31
36
|
relay?: ClassDetail;
|
|
@@ -36,11 +41,11 @@ export interface Result {
|
|
|
36
41
|
mobproxy?: ProxyDetail;
|
|
37
42
|
pubproxy?: PubproxyDetail;
|
|
38
43
|
/**
|
|
39
|
-
* Where the address is, on every
|
|
40
|
-
* not known.
|
|
44
|
+
* Where the address is, on every answer, with or without a key: every key present, empty
|
|
45
|
+
* strings where it is not known.
|
|
41
46
|
*/
|
|
42
47
|
location?: Location;
|
|
43
|
-
/** The AS announcing the address, on every
|
|
48
|
+
/** The AS announcing the address, on every answer, with or without a key: `asn` is 0 where none does. */
|
|
44
49
|
asn?: Asn;
|
|
45
50
|
/** The response exactly as it came off the wire, with its original names. */
|
|
46
51
|
raw: LookupResponse;
|
package/dist/types.js
CHANGED
|
@@ -17,6 +17,7 @@ export function toResult(body) {
|
|
|
17
17
|
copyFlag(body, r, 'is_dcproxy', 'isDcproxy');
|
|
18
18
|
copyFlag(body, r, 'is_mobproxy', 'isMobproxy');
|
|
19
19
|
copyFlag(body, r, 'is_pubproxy', 'isPubproxy');
|
|
20
|
+
copyFlag(body, r, 'trial_expired', 'trialExpired');
|
|
20
21
|
copyDetail(body, r, 'vpn', 'vpn');
|
|
21
22
|
copyDetail(body, r, 'hosting', 'hosting');
|
|
22
23
|
copyDetail(body, r, 'relay', 'relay');
|
package/package.json
CHANGED