vpndetection-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 +11 -10
- package/dist/client.d.ts +11 -7
- package/dist/client.js +8 -5
- package/dist/generated/sdk.gen.d.ts +18 -12
- package/dist/generated/sdk.gen.js +18 -12
- package/dist/generated/types.gen.d.ts +40 -20
- 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';
|
|
@@ -41,22 +41,22 @@ const me = await client.myIp();
|
|
|
41
41
|
console.log(me.isVpn); // is this visitor on a VPN?
|
|
42
42
|
|
|
43
43
|
const result = await client.lookup('45.83.91.1');
|
|
44
|
-
console.log(result.isVpn);
|
|
44
|
+
console.log(result.isVpn); // true
|
|
45
|
+
console.log(result.location?.country); // the ISO 3166 country code
|
|
46
|
+
console.log(result.asn?.name); // who runs the announcing network
|
|
45
47
|
```
|
|
46
48
|
|
|
47
49
|
### With an API key
|
|
48
50
|
|
|
49
|
-
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:
|
|
50
52
|
|
|
51
53
|
```js
|
|
52
54
|
const client = new VPNDetection({ apiKey: 'your-api-key' });
|
|
53
55
|
|
|
54
56
|
const result = await client.lookup('45.83.91.1');
|
|
55
57
|
console.log(result.isVpn); // true
|
|
56
|
-
console.log(result.location?.country); // the ISO 3166 country code
|
|
57
|
-
console.log(result.asn?.name); // who runs the announcing network
|
|
58
|
-
console.log(result.vpn?.provider); // on a paid plan
|
|
59
58
|
console.log(result.isHosting); // on a paid plan
|
|
59
|
+
console.log(result.vpn?.provider); // on a paid plan
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
An extension can sign its user in rather than ask them to paste a key: see Sign in with OAuth below.
|
|
@@ -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:
|
|
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']);
|
|
@@ -246,11 +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 // not in your plan
|
|
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
|
|
254
255
|
```
|
|
255
256
|
|
|
256
257
|
## Other Libraries
|
package/dist/client.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export interface CacheOptions {
|
|
|
18
18
|
}
|
|
19
19
|
export interface Options {
|
|
20
20
|
/**
|
|
21
|
-
* Your API key.
|
|
22
|
-
* `
|
|
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.
|
|
23
24
|
* A key in a web page is readable by anyone who opens the page.
|
|
24
25
|
*/
|
|
25
26
|
apiKey?: string;
|
|
@@ -120,10 +121,11 @@ export declare class VPNDetection {
|
|
|
120
121
|
* Unlike a lookup there is no useful unauthenticated answer, so a client
|
|
121
122
|
* built without a key gets an unauthorized error rather than a partial one.
|
|
122
123
|
*
|
|
123
|
-
* Usage counts against the ALLOWANCE WINDOW -
|
|
124
|
-
* subscription, not the calendar month and not the
|
|
125
|
-
*
|
|
126
|
-
*
|
|
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.
|
|
127
129
|
*
|
|
128
130
|
* Deliberately NOT cached: the whole point is what has been spent, and a
|
|
129
131
|
* cached answer is a wrong one within seconds of the next request.
|
|
@@ -145,7 +147,9 @@ export declare class VPNDetection {
|
|
|
145
147
|
* and a chunk that fails as a whole marks every address in it. A per-call
|
|
146
148
|
* `concurrency` below 1 is refused as `bad_request` before anything is sent.
|
|
147
149
|
* An IPv4-mapped address is looked up as the IPv4 address it carries, and its
|
|
148
|
-
* answer keyed as you passed it.
|
|
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).
|
|
149
153
|
*/
|
|
150
154
|
lookupBatch(ips: Iterable<string>, options?: BatchOptions): Promise<Map<string, Result | VPNDetectionError>>;
|
|
151
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,7 +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.
|
|
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).
|
|
198
201
|
*/
|
|
199
202
|
async lookupBatch(ips, options = {}) {
|
|
200
203
|
const concurrency = checkConcurrency(options.concurrency);
|
|
@@ -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` and
|
|
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,13 +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.
|
|
60
|
+
*
|
|
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.
|
|
59
65
|
*
|
|
60
66
|
*/
|
|
61
67
|
export declare const lookupBatch: <ThrowOnError extends boolean = false>(options: Options<LookupBatchData, ThrowOnError>) => RequestResult<LookupBatchResponses, LookupBatchErrors, ThrowOnError>;
|
|
@@ -82,7 +88,8 @@ export declare const oauthMetadata: <ThrowOnError extends boolean = false>(optio
|
|
|
82
88
|
/**
|
|
83
89
|
* Token
|
|
84
90
|
*
|
|
85
|
-
*
|
|
91
|
+
* Issues tokens for three grant types: a device code, an authorization
|
|
92
|
+
* code and a refresh token.
|
|
86
93
|
*
|
|
87
94
|
* `urn:ietf:params:oauth:grant-type:device_code` polls a device
|
|
88
95
|
* authorization. Until the person approves it answers
|
|
@@ -104,11 +111,10 @@ export declare const oauthToken: <ThrowOnError extends boolean = false>(options:
|
|
|
104
111
|
/**
|
|
105
112
|
* Revoke
|
|
106
113
|
*
|
|
107
|
-
* RFC 7009. Always answers 200,
|
|
108
|
-
*
|
|
109
|
-
* whether a stolen string is a live credential.
|
|
114
|
+
* RFC 7009. Always answers 200, even for a token that was never valid, so
|
|
115
|
+
* it can't be used to test whether a token is live.
|
|
110
116
|
*
|
|
111
|
-
* Revoking a
|
|
117
|
+
* Revoking a refresh token ends the whole authorization and takes its
|
|
112
118
|
* access tokens with it. Revoking an access token affects only that token.
|
|
113
119
|
*
|
|
114
120
|
*/
|
|
@@ -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` and
|
|
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,13 +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.
|
|
72
|
+
*
|
|
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.
|
|
71
77
|
*
|
|
72
78
|
*/
|
|
73
79
|
export const lookupBatch = (options) => (options.client ?? client).post({
|
|
@@ -122,7 +128,8 @@ export const oauthMetadata = (options) => (options?.client ?? client).get({ url:
|
|
|
122
128
|
/**
|
|
123
129
|
* Token
|
|
124
130
|
*
|
|
125
|
-
*
|
|
131
|
+
* Issues tokens for three grant types: a device code, an authorization
|
|
132
|
+
* code and a refresh token.
|
|
126
133
|
*
|
|
127
134
|
* `urn:ietf:params:oauth:grant-type:device_code` polls a device
|
|
128
135
|
* authorization. Until the person approves it answers
|
|
@@ -152,11 +159,10 @@ export const oauthToken = (options) => (options.client ?? client).post({
|
|
|
152
159
|
/**
|
|
153
160
|
* Revoke
|
|
154
161
|
*
|
|
155
|
-
* RFC 7009. Always answers 200,
|
|
156
|
-
*
|
|
157
|
-
* whether a stolen string is a live credential.
|
|
162
|
+
* RFC 7009. Always answers 200, even for a token that was never valid, so
|
|
163
|
+
* it can't be used to test whether a token is live.
|
|
158
164
|
*
|
|
159
|
-
* Revoking a
|
|
165
|
+
* Revoking a refresh token ends the whole authorization and takes its
|
|
160
166
|
* access tokens with it. Revoking an access token affects only that token.
|
|
161
167
|
*
|
|
162
168
|
*/
|
|
@@ -2,8 +2,9 @@ export type ClientOptions = {
|
|
|
2
2
|
baseUrl: 'https://api.vpndetection.io' | (string & {});
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
|
-
* The union of every
|
|
6
|
-
*
|
|
5
|
+
* The union of every tier's answer. Every answer carries `ip`, `is_vpn`,
|
|
6
|
+
* the Tor and relay members, `location` and `asn`, with or without a key;
|
|
7
|
+
* each remaining field is present when your tier includes it, and absent
|
|
7
8
|
* otherwise. A client that must work across plans should treat an absent
|
|
8
9
|
* flag as unknown rather than as `false`.
|
|
9
10
|
*
|
|
@@ -25,11 +26,11 @@ export type LookupResponse = {
|
|
|
25
26
|
*/
|
|
26
27
|
is_hosting?: boolean;
|
|
27
28
|
/**
|
|
28
|
-
* Whether the address is privacy relay or enterprise web gateway egress, such as iCloud Private Relay or Zscaler.
|
|
29
|
+
* Whether the address is privacy relay or enterprise web gateway egress, such as iCloud Private Relay or Zscaler. Every answer, with or without a key.
|
|
29
30
|
*/
|
|
30
31
|
is_relay?: boolean;
|
|
31
32
|
/**
|
|
32
|
-
* Whether the address is a Tor node.
|
|
33
|
+
* Whether the address is a Tor node. Every answer, with or without a key.
|
|
33
34
|
*/
|
|
34
35
|
is_tor?: boolean;
|
|
35
36
|
/**
|
|
@@ -41,7 +42,7 @@ export type LookupResponse = {
|
|
|
41
42
|
*/
|
|
42
43
|
is_resproxy?: boolean;
|
|
43
44
|
/**
|
|
44
|
-
* Whether the address
|
|
45
|
+
* Whether the address is one a datacenter proxy service sells or runs on, a proxy company's own ranges included. Paid plans.
|
|
45
46
|
*/
|
|
46
47
|
is_dcproxy?: boolean;
|
|
47
48
|
/**
|
|
@@ -62,12 +63,13 @@ export type LookupResponse = {
|
|
|
62
63
|
*/
|
|
63
64
|
hosting?: ClassDetail;
|
|
64
65
|
/**
|
|
65
|
-
* Detail for `is_relay`. Empty when false.
|
|
66
|
+
* Detail for `is_relay`. Empty when false. Every answer, with or without a key.
|
|
66
67
|
*/
|
|
67
68
|
relay?: ClassDetail;
|
|
68
69
|
/**
|
|
69
|
-
* Detail for `is_tor`. Empty when false.
|
|
70
|
-
* dataset carries no provider, so `provider` is always an
|
|
70
|
+
* Detail for `is_tor`. Empty when false. Every answer, with or without a
|
|
71
|
+
* key. The tor dataset carries no provider, so `provider` is always an
|
|
72
|
+
* empty string.
|
|
71
73
|
*
|
|
72
74
|
*/
|
|
73
75
|
tor?: ClassDetail;
|
|
@@ -93,6 +95,13 @@ export type LookupResponse = {
|
|
|
93
95
|
pubproxy?: PubproxyDetail;
|
|
94
96
|
location?: Location;
|
|
95
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;
|
|
96
105
|
};
|
|
97
106
|
export type BatchLookupRequest = {
|
|
98
107
|
/**
|
|
@@ -127,7 +136,7 @@ export type BatchLookupResponse = {
|
|
|
127
136
|
export type BatchLookupError = {
|
|
128
137
|
/**
|
|
129
138
|
* The HTTP status `GET /{ip}` would have answered for this entry: `400`
|
|
130
|
-
* 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,
|
|
131
140
|
* `500` when the VPN dataset could not be consulted. A `429` here is
|
|
132
141
|
* never a throttle; the whole call is refused instead.
|
|
133
142
|
*
|
|
@@ -286,9 +295,9 @@ export type PubproxyDetail = {
|
|
|
286
295
|
};
|
|
287
296
|
/**
|
|
288
297
|
* Where the address is, to the country: the fields of our IP Country
|
|
289
|
-
* database.
|
|
290
|
-
* object is, so an address in no country, or a private one,
|
|
291
|
-
* empty strings.
|
|
298
|
+
* database. Every answer, with or without a key. Each field is present
|
|
299
|
+
* whenever the object is, so an address in no country, or a private one,
|
|
300
|
+
* answers empty strings.
|
|
292
301
|
*
|
|
293
302
|
*/
|
|
294
303
|
export type Location = {
|
|
@@ -334,7 +343,8 @@ export type Location = {
|
|
|
334
343
|
flag_unicode: string;
|
|
335
344
|
};
|
|
336
345
|
/**
|
|
337
|
-
* The autonomous system that announces the address.
|
|
346
|
+
* The autonomous system that announces the address. Every answer, with or
|
|
347
|
+
* without a key.
|
|
338
348
|
* Each field is present whenever the object is: `asn` is 0 and the rest
|
|
339
349
|
* empty where no announcement covers the address.
|
|
340
350
|
*
|
|
@@ -399,13 +409,17 @@ export type EntitlementApikey = {
|
|
|
399
409
|
};
|
|
400
410
|
export type EntitlementPlan = {
|
|
401
411
|
/**
|
|
402
|
-
* 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
|
+
*
|
|
403
416
|
*/
|
|
404
417
|
key: string;
|
|
405
418
|
/**
|
|
406
419
|
* The field tier, which decides how much of a lookup answer comes
|
|
407
|
-
* back. What each tier includes is documented
|
|
408
|
-
* 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.
|
|
409
423
|
*
|
|
410
424
|
*/
|
|
411
425
|
tier: 'free' | 'starter' | 'scale' | 'max';
|
|
@@ -583,7 +597,7 @@ export type LookupIpErrors = {
|
|
|
583
597
|
*/
|
|
584
598
|
403: LookupError;
|
|
585
599
|
/**
|
|
586
|
-
* Either a
|
|
600
|
+
* Either a rate limit or a paid plan's overage cap. `Retry-After` is
|
|
587
601
|
* present for the former and absent for the latter, and is the only
|
|
588
602
|
* way to tell them apart.
|
|
589
603
|
*
|
|
@@ -624,7 +638,7 @@ export type LookupMyIpErrors = {
|
|
|
624
638
|
*/
|
|
625
639
|
403: LookupError;
|
|
626
640
|
/**
|
|
627
|
-
* Either a
|
|
641
|
+
* Either a rate limit or a paid plan's overage cap. `Retry-After` is
|
|
628
642
|
* present for the former and absent for the latter, and is the only
|
|
629
643
|
* way to tell them apart.
|
|
630
644
|
*
|
|
@@ -657,9 +671,15 @@ export type LookupBatchErrors = {
|
|
|
657
671
|
*/
|
|
658
672
|
400: LookupError;
|
|
659
673
|
/**
|
|
660
|
-
*
|
|
674
|
+
* No API key was presented, or the one presented is unknown, revoked, or expired.
|
|
661
675
|
*/
|
|
662
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;
|
|
663
683
|
/**
|
|
664
684
|
* The key restricts which source addresses may use it and this
|
|
665
685
|
* request came from none of them, or the key was sent over plain
|
|
@@ -674,7 +694,7 @@ export type LookupBatchErrors = {
|
|
|
674
694
|
413: LookupError;
|
|
675
695
|
/**
|
|
676
696
|
* The rate limit refused the whole call. Always transient and always
|
|
677
|
-
* with `Retry-After`; a
|
|
697
|
+
* with `Retry-After`; a reached overage cap is reported per entry in a
|
|
678
698
|
* `200` instead.
|
|
679
699
|
*
|
|
680
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