vpndetection-web 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +268 -2
- package/dist/bogon.d.ts +28 -0
- package/dist/bogon.js +164 -0
- package/dist/bogons.gen.d.ts +2 -0
- package/dist/bogons.gen.js +87 -0
- package/dist/client.d.ts +156 -0
- package/dist/client.js +386 -0
- package/dist/errors.d.ts +56 -0
- package/dist/errors.js +178 -0
- package/dist/generated/client/client.gen.d.ts +2 -0
- package/dist/generated/client/client.gen.js +216 -0
- package/dist/generated/client/index.d.ts +10 -0
- package/dist/generated/client/index.js +6 -0
- package/dist/generated/client/types.gen.d.ts +120 -0
- package/dist/generated/client/types.gen.js +2 -0
- package/dist/generated/client/utils.gen.d.ts +37 -0
- package/dist/generated/client/utils.gen.js +228 -0
- package/dist/generated/client.gen.d.ts +12 -0
- package/dist/generated/client.gen.js +3 -0
- package/dist/generated/core/auth.gen.d.ts +25 -0
- package/dist/generated/core/auth.gen.js +14 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/generated/core/bodySerializer.gen.js +57 -0
- package/dist/generated/core/params.gen.d.ts +43 -0
- package/dist/generated/core/params.gen.js +109 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/generated/core/pathSerializer.gen.js +106 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/generated/core/types.gen.d.ts +83 -0
- package/dist/generated/core/types.gen.js +2 -0
- package/dist/generated/core/utils.gen.d.ts +19 -0
- package/dist/generated/core/utils.gen.js +87 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.js +2 -0
- package/dist/generated/sdk.gen.d.ts +118 -0
- package/dist/generated/sdk.gen.js +174 -0
- package/dist/generated/types.gen.d.ts +790 -0
- package/dist/generated/types.gen.js +2 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +4 -0
- package/dist/oauth.d.ts +114 -0
- package/dist/oauth.js +245 -0
- package/dist/shapes.d.ts +28 -0
- package/dist/shapes.js +133 -0
- package/dist/store.d.ts +39 -0
- package/dist/store.js +64 -0
- package/dist/transport.d.ts +47 -0
- package/dist/transport.js +140 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.js +42 -0
- package/package.json +65 -3
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: 'https://api.vpndetection.io' | (string & {});
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* The union of every plan'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 key includes it, and absent
|
|
8
|
+
* otherwise. A client that must work across plans should treat an absent
|
|
9
|
+
* flag as unknown rather than as `false`.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export type LookupResponse = {
|
|
13
|
+
/**
|
|
14
|
+
* The address that was looked up, normalized.
|
|
15
|
+
*/
|
|
16
|
+
ip: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the address is VPN infrastructure. Keys off presence in the
|
|
19
|
+
* VPN dataset, so an unattributed range with no provider is still
|
|
20
|
+
* `true`.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
is_vpn: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the address belongs to a hosting or cloud provider. Free and paid plans.
|
|
26
|
+
*/
|
|
27
|
+
is_hosting?: boolean;
|
|
28
|
+
/**
|
|
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.
|
|
30
|
+
*/
|
|
31
|
+
is_relay?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the address is a Tor node. Every answer, with or without a key.
|
|
34
|
+
*/
|
|
35
|
+
is_tor?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the address belongs to a CDN. Free and paid plans.
|
|
38
|
+
*/
|
|
39
|
+
is_cdn?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the address was seen in a residential proxy pool. Free and paid plans.
|
|
42
|
+
*/
|
|
43
|
+
is_resproxy?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the address is one a datacenter proxy service sells or runs on, a proxy company's own ranges included. Free and paid plans.
|
|
46
|
+
*/
|
|
47
|
+
is_dcproxy?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the address was seen in a mobile proxy pool. Free and paid plans.
|
|
50
|
+
*/
|
|
51
|
+
is_mobproxy?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether a public proxy, one anyone can connect through, listens on the address or sends its traffic out from it. Free and paid plans.
|
|
54
|
+
*/
|
|
55
|
+
is_pubproxy?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Detail for `is_vpn`. Empty when `is_vpn` is false. Paid plans.
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
vpn?: VpnDetail;
|
|
61
|
+
/**
|
|
62
|
+
* Detail for `is_hosting`. Empty when false. Paid plans.
|
|
63
|
+
*/
|
|
64
|
+
hosting?: ClassDetail;
|
|
65
|
+
/**
|
|
66
|
+
* Detail for `is_relay`. Empty when false. Every answer, with or without a key.
|
|
67
|
+
*/
|
|
68
|
+
relay?: ClassDetail;
|
|
69
|
+
/**
|
|
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.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
tor?: ClassDetail;
|
|
76
|
+
/**
|
|
77
|
+
* Detail for `is_cdn`. Empty when false. Paid plans.
|
|
78
|
+
*/
|
|
79
|
+
cdn?: ClassDetail;
|
|
80
|
+
/**
|
|
81
|
+
* Detail for `is_resproxy`. Empty when false. Paid plans.
|
|
82
|
+
*/
|
|
83
|
+
resproxy?: ProxyDetail;
|
|
84
|
+
/**
|
|
85
|
+
* Detail for `is_dcproxy`. Empty when false. Paid plans.
|
|
86
|
+
*/
|
|
87
|
+
dcproxy?: ProxyDetail;
|
|
88
|
+
/**
|
|
89
|
+
* Detail for `is_mobproxy`. Empty when false. Paid plans.
|
|
90
|
+
*/
|
|
91
|
+
mobproxy?: ProxyDetail;
|
|
92
|
+
/**
|
|
93
|
+
* Detail for `is_pubproxy`. Empty when false. Paid plans.
|
|
94
|
+
*/
|
|
95
|
+
pubproxy?: PubproxyDetail;
|
|
96
|
+
location?: Location;
|
|
97
|
+
asn?: Asn;
|
|
98
|
+
};
|
|
99
|
+
export type BatchLookupRequest = {
|
|
100
|
+
/**
|
|
101
|
+
* The addresses to classify, 1 to 1000 per call, counted before
|
|
102
|
+
* duplicates collapse. Each distinct string is one lookup.
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
ips: Array<string>;
|
|
106
|
+
};
|
|
107
|
+
export type BatchLookupResponse = {
|
|
108
|
+
/**
|
|
109
|
+
* One answer per input string that was classified, keyed by the string
|
|
110
|
+
* as you sent it; the `ip` inside is the normalized form. Each value is
|
|
111
|
+
* exactly what `GET /{ip}` answers for your plan.
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
results: {
|
|
115
|
+
[key: string]: LookupResponse;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* One entry per input string that could not be classified, keyed the
|
|
119
|
+
* same way. Empty when every entry was answered.
|
|
120
|
+
*
|
|
121
|
+
*/
|
|
122
|
+
errors: {
|
|
123
|
+
[key: string]: BatchLookupError;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Why one entry of a batch was not answered, as the single lookup would have reported it.
|
|
128
|
+
*/
|
|
129
|
+
export type BatchLookupError = {
|
|
130
|
+
/**
|
|
131
|
+
* The HTTP status `GET /{ip}` would have answered for this entry: `400`
|
|
132
|
+
* for a string that is not an address, `429` for a spent allowance,
|
|
133
|
+
* `500` when the VPN dataset could not be consulted. A `429` here is
|
|
134
|
+
* never a throttle; the whole call is refused instead.
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
137
|
+
status: number;
|
|
138
|
+
/**
|
|
139
|
+
* The same message the single lookup carries for that status.
|
|
140
|
+
*/
|
|
141
|
+
error: string;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* What is known about the VPN attribution. Every key is present when the
|
|
145
|
+
* object is populated, empty values included; the object is `{}` when
|
|
146
|
+
* `is_vpn` is false.
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
export type VpnDetail = {
|
|
150
|
+
/**
|
|
151
|
+
* The VPN provider, or an empty string for an unattributed range.
|
|
152
|
+
*/
|
|
153
|
+
provider?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The most recent date this address was observed as VPN infrastructure.
|
|
156
|
+
*/
|
|
157
|
+
last_seen?: string;
|
|
158
|
+
/**
|
|
159
|
+
* How strongly the attribution is supported.
|
|
160
|
+
*/
|
|
161
|
+
confidence?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Never returned since 2026-10-20: no plan is answered with the class of
|
|
164
|
+
* evidence an attribution rests on. Declared so that a client typed
|
|
165
|
+
* against it keeps compiling; read `confidence` instead.
|
|
166
|
+
*
|
|
167
|
+
*
|
|
168
|
+
* @deprecated
|
|
169
|
+
*/
|
|
170
|
+
method?: string;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* The shared detail shape for the hosting, relay, tor and cdn datasets.
|
|
174
|
+
* Every key is present when the object is populated; the object is `{}`
|
|
175
|
+
* when its flag is false.
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
178
|
+
export type ClassDetail = {
|
|
179
|
+
/**
|
|
180
|
+
* The provider, or an empty string where the dataset has none.
|
|
181
|
+
*/
|
|
182
|
+
provider?: string;
|
|
183
|
+
/**
|
|
184
|
+
* How strongly the classification is supported.
|
|
185
|
+
*/
|
|
186
|
+
confidence?: string;
|
|
187
|
+
/**
|
|
188
|
+
* The most recent date this address was observed in this dataset.
|
|
189
|
+
*/
|
|
190
|
+
last_seen?: string;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* The shared detail shape for the residential, datacenter and mobile proxy
|
|
194
|
+
* families, measured over a rolling 90 day window. An address that leaves
|
|
195
|
+
* the window keeps its flag and the values of its last day in it, so
|
|
196
|
+
* `last_seen` is what says how recent they are. Every key is present when
|
|
197
|
+
* the object is populated; the object is `{}` when its flag is false.
|
|
198
|
+
*
|
|
199
|
+
*/
|
|
200
|
+
export type ProxyDetail = {
|
|
201
|
+
/**
|
|
202
|
+
* The proxy network, or an empty string where unattributed.
|
|
203
|
+
*/
|
|
204
|
+
provider?: string;
|
|
205
|
+
/**
|
|
206
|
+
* The earliest date within the window this address was seen in the
|
|
207
|
+
* pool, as of its last day in the window once it has left.
|
|
208
|
+
*
|
|
209
|
+
*/
|
|
210
|
+
first_seen?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The most recent date this address was seen in the pool. An address
|
|
213
|
+
* that leaves the window keeps its flag, so this date is what says how
|
|
214
|
+
* recent the sighting is.
|
|
215
|
+
*
|
|
216
|
+
*/
|
|
217
|
+
last_seen?: string;
|
|
218
|
+
/**
|
|
219
|
+
* How many times the address was observed in the pool during the
|
|
220
|
+
* window, as of its last day in it once it has left.
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
hits?: number;
|
|
224
|
+
/**
|
|
225
|
+
* The percentage of days in the window on which the address was seen,
|
|
226
|
+
* as of its last day in it once it has left. A high value means a
|
|
227
|
+
* stable pool member rather than a one-off sighting.
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
hits_days_pct?: number;
|
|
231
|
+
/**
|
|
232
|
+
* How many distinct proxy networks this address was seen in.
|
|
233
|
+
*/
|
|
234
|
+
providers_num?: number;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* The address in Public Proxy IP, open proxies anyone can connect
|
|
238
|
+
* through, measured over a rolling 90 day window. An address that leaves
|
|
239
|
+
* the window keeps its flag and the values of its last day in it, so
|
|
240
|
+
* `last_seen` is what says how recent they are. An address is either
|
|
241
|
+
* end of a proxy, or both: where it listens, and where its traffic
|
|
242
|
+
* leaves from. Every key is present when the object is populated; the
|
|
243
|
+
* object is `{}` when `is_pubproxy` is false.
|
|
244
|
+
*
|
|
245
|
+
*/
|
|
246
|
+
export type PubproxyDetail = {
|
|
247
|
+
/**
|
|
248
|
+
* Whether a public proxy listens on this address.
|
|
249
|
+
*/
|
|
250
|
+
entry?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Whether a public proxy's traffic leaves from this address.
|
|
253
|
+
*/
|
|
254
|
+
exit?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* The protocols of the proxies listening on or leaving from this
|
|
257
|
+
* address: `http`, `https` (an HTTP proxy that also tunnels HTTPS),
|
|
258
|
+
* `socks4` or `socks5`. Empty where only the address is known.
|
|
259
|
+
*
|
|
260
|
+
*/
|
|
261
|
+
protocols?: Array<string>;
|
|
262
|
+
/**
|
|
263
|
+
* How many distinct ports a public proxy listens on at this address;
|
|
264
|
+
* 0 when it is only an exit, or its port is not known.
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
num_ports?: number;
|
|
268
|
+
/**
|
|
269
|
+
* How many distinct public proxies' traffic left from this address;
|
|
270
|
+
* 0 when it is only an entry.
|
|
271
|
+
*
|
|
272
|
+
*/
|
|
273
|
+
num_proxies?: number;
|
|
274
|
+
/**
|
|
275
|
+
* The most recent date a proxy on this address was seen. An address
|
|
276
|
+
* that leaves the window keeps its flag, so this date is what says how
|
|
277
|
+
* recent the sighting is.
|
|
278
|
+
*
|
|
279
|
+
*/
|
|
280
|
+
last_seen?: string;
|
|
281
|
+
/**
|
|
282
|
+
* The most recent date within the window a request through a proxy on
|
|
283
|
+
* this address was answered, as YYYY-MM-DD, or an empty string when
|
|
284
|
+
* none was, as of its last day in the window once it has left.
|
|
285
|
+
*
|
|
286
|
+
*/
|
|
287
|
+
last_usable?: string;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Where the address is, to the country: the fields of our IP Country
|
|
291
|
+
* database. Every answer, with or without a key. Each field is present
|
|
292
|
+
* whenever the object is, so an address in no country, or a private one,
|
|
293
|
+
* answers empty strings.
|
|
294
|
+
*
|
|
295
|
+
*/
|
|
296
|
+
export type Location = {
|
|
297
|
+
/**
|
|
298
|
+
* Continent code: AF, AN (Antarctica), AS, EU, NA, OC or SA.
|
|
299
|
+
*/
|
|
300
|
+
continent: string;
|
|
301
|
+
/**
|
|
302
|
+
* Continent name.
|
|
303
|
+
*/
|
|
304
|
+
continent_name: string;
|
|
305
|
+
/**
|
|
306
|
+
* ISO 3166-1 alpha-2 country code.
|
|
307
|
+
*/
|
|
308
|
+
country: string;
|
|
309
|
+
/**
|
|
310
|
+
* Country name.
|
|
311
|
+
*/
|
|
312
|
+
country_name: string;
|
|
313
|
+
/**
|
|
314
|
+
* IANA timezone of the address.
|
|
315
|
+
*/
|
|
316
|
+
timezone: string;
|
|
317
|
+
/**
|
|
318
|
+
* ISO 4217 code of the country's currency, where there is one.
|
|
319
|
+
*/
|
|
320
|
+
currency_code: string;
|
|
321
|
+
/**
|
|
322
|
+
* Name of the country's currency, where there is one.
|
|
323
|
+
*/
|
|
324
|
+
currency_name: string;
|
|
325
|
+
/**
|
|
326
|
+
* Symbol of the country's currency, where known.
|
|
327
|
+
*/
|
|
328
|
+
currency_symbol: string;
|
|
329
|
+
/**
|
|
330
|
+
* The country's flag, as an emoji.
|
|
331
|
+
*/
|
|
332
|
+
flag_emoji: string;
|
|
333
|
+
/**
|
|
334
|
+
* The Unicode code points of the flag emoji.
|
|
335
|
+
*/
|
|
336
|
+
flag_unicode: string;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* The autonomous system that announces the address. Every answer, with or
|
|
340
|
+
* without a key.
|
|
341
|
+
* Each field is present whenever the object is: `asn` is 0 and the rest
|
|
342
|
+
* empty where no announcement covers the address.
|
|
343
|
+
*
|
|
344
|
+
*/
|
|
345
|
+
export type Asn = {
|
|
346
|
+
/**
|
|
347
|
+
* The AS number, 0 when no announcement covers the address.
|
|
348
|
+
*/
|
|
349
|
+
asn: number;
|
|
350
|
+
/**
|
|
351
|
+
* Name of the organization that operates the AS.
|
|
352
|
+
*/
|
|
353
|
+
name: string;
|
|
354
|
+
/**
|
|
355
|
+
* The AS operator's own registrable domain.
|
|
356
|
+
*/
|
|
357
|
+
domain: string;
|
|
358
|
+
/**
|
|
359
|
+
* The kind of network the AS runs: isp, hosting, education, government or business.
|
|
360
|
+
*/
|
|
361
|
+
type: string;
|
|
362
|
+
/**
|
|
363
|
+
* The announced BGP prefix that covers the address, the most specific when several do.
|
|
364
|
+
*/
|
|
365
|
+
prefix: string;
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Every non-2xx response carries this shape.
|
|
369
|
+
*/
|
|
370
|
+
export type LookupError = {
|
|
371
|
+
/**
|
|
372
|
+
* A human-readable explanation of the failure.
|
|
373
|
+
*/
|
|
374
|
+
error: string;
|
|
375
|
+
};
|
|
376
|
+
export type Entitlement = {
|
|
377
|
+
/**
|
|
378
|
+
* The organization the key belongs to.
|
|
379
|
+
*/
|
|
380
|
+
org_id: string;
|
|
381
|
+
apikey: EntitlementApikey;
|
|
382
|
+
plan: EntitlementPlan;
|
|
383
|
+
usage: EntitlementUsage;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* The credential itself. The key is never echoed - only its ID, which is
|
|
387
|
+
* what the console shows and what you can act on.
|
|
388
|
+
*
|
|
389
|
+
*/
|
|
390
|
+
export type EntitlementApikey = {
|
|
391
|
+
id: string;
|
|
392
|
+
/**
|
|
393
|
+
* Null for a key with no end date, which is the normal case.
|
|
394
|
+
*/
|
|
395
|
+
expires: string | null;
|
|
396
|
+
/**
|
|
397
|
+
* The source addresses this key may be used from. EMPTY means
|
|
398
|
+
* unrestricted, never "deny all".
|
|
399
|
+
*
|
|
400
|
+
*/
|
|
401
|
+
allowed_cidrs: Array<string>;
|
|
402
|
+
};
|
|
403
|
+
export type EntitlementPlan = {
|
|
404
|
+
/**
|
|
405
|
+
* The plan the organization is on.
|
|
406
|
+
*/
|
|
407
|
+
key: string;
|
|
408
|
+
/**
|
|
409
|
+
* The field tier, which decides how much of a lookup answer comes
|
|
410
|
+
* back. What each tier includes is documented on the lookup endpoint
|
|
411
|
+
* rather than repeated here, so there is one place it can be wrong.
|
|
412
|
+
*
|
|
413
|
+
*/
|
|
414
|
+
tier: 'free' | 'starter' | 'scale' | 'max';
|
|
415
|
+
};
|
|
416
|
+
export type EntitlementUsage = {
|
|
417
|
+
/**
|
|
418
|
+
* Requests counted in the current window. The same number the lookup
|
|
419
|
+
* API gates on, and it can lag by a few seconds.
|
|
420
|
+
*
|
|
421
|
+
*/
|
|
422
|
+
requests: number;
|
|
423
|
+
/**
|
|
424
|
+
* What the plan includes. Zero on a plan that includes none.
|
|
425
|
+
*/
|
|
426
|
+
quota: number;
|
|
427
|
+
/**
|
|
428
|
+
* Where we stop serving. NULL means never, which is the normal state
|
|
429
|
+
* of an uncapped paid plan and is not the same as zero. Above the
|
|
430
|
+
* quota and below this, requests are served and billed as overage.
|
|
431
|
+
*
|
|
432
|
+
*/
|
|
433
|
+
hard_limit: number | null;
|
|
434
|
+
/**
|
|
435
|
+
* When the current allowance period began.
|
|
436
|
+
*/
|
|
437
|
+
window_start: string;
|
|
438
|
+
/**
|
|
439
|
+
* When the allowance next resets.
|
|
440
|
+
*/
|
|
441
|
+
window_end: string;
|
|
442
|
+
};
|
|
443
|
+
export type EntitlementError = {
|
|
444
|
+
error: string;
|
|
445
|
+
};
|
|
446
|
+
export type OauthMetadata = {
|
|
447
|
+
issuer: string;
|
|
448
|
+
authorization_endpoint: string;
|
|
449
|
+
token_endpoint: string;
|
|
450
|
+
device_authorization_endpoint?: string;
|
|
451
|
+
revocation_endpoint?: string;
|
|
452
|
+
scopes_supported?: Array<string>;
|
|
453
|
+
response_types_supported?: Array<string>;
|
|
454
|
+
grant_types_supported?: Array<string>;
|
|
455
|
+
code_challenge_methods_supported?: Array<string>;
|
|
456
|
+
/**
|
|
457
|
+
* Any client may sign in with an https `client_id` serving its own metadata.
|
|
458
|
+
*/
|
|
459
|
+
client_id_metadata_document_supported?: boolean;
|
|
460
|
+
/**
|
|
461
|
+
* RFC 7591 dynamic client registration, for a client that cannot serve its own metadata.
|
|
462
|
+
*/
|
|
463
|
+
registration_endpoint?: string;
|
|
464
|
+
/**
|
|
465
|
+
* Always `none`. Every client is public and has no secret.
|
|
466
|
+
*/
|
|
467
|
+
token_endpoint_auth_methods_supported?: Array<string>;
|
|
468
|
+
/**
|
|
469
|
+
* RFC 9207. A redirect back from the authorization endpoint carries `iss`.
|
|
470
|
+
*/
|
|
471
|
+
authorization_response_iss_parameter_supported?: boolean;
|
|
472
|
+
service_documentation?: string;
|
|
473
|
+
};
|
|
474
|
+
export type TokenRequest = {
|
|
475
|
+
/**
|
|
476
|
+
* `urn:ietf:params:oauth:grant-type:device_code`, `authorization_code` or `refresh_token`.
|
|
477
|
+
*/
|
|
478
|
+
grant_type: string;
|
|
479
|
+
client_id: string;
|
|
480
|
+
/**
|
|
481
|
+
* Required by the device code grant.
|
|
482
|
+
*/
|
|
483
|
+
device_code?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Required by the authorization code grant.
|
|
486
|
+
*/
|
|
487
|
+
code?: string;
|
|
488
|
+
/**
|
|
489
|
+
* Required by the authorization code grant.
|
|
490
|
+
*/
|
|
491
|
+
code_verifier?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Required by the authorization code grant: the `redirect_uri` the code was issued against, exactly.
|
|
494
|
+
*/
|
|
495
|
+
redirect_uri?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Authorization code grant, optional: RFC 8707, and it must name what was authorized.
|
|
498
|
+
*/
|
|
499
|
+
resource?: string;
|
|
500
|
+
/**
|
|
501
|
+
* Required by the refresh token grant.
|
|
502
|
+
*/
|
|
503
|
+
refresh_token?: string;
|
|
504
|
+
};
|
|
505
|
+
export type TokenResponse = {
|
|
506
|
+
access_token: string;
|
|
507
|
+
/**
|
|
508
|
+
* Always `Bearer`.
|
|
509
|
+
*/
|
|
510
|
+
token_type: string;
|
|
511
|
+
/**
|
|
512
|
+
* Seconds until the access token expires.
|
|
513
|
+
*/
|
|
514
|
+
expires_in: number;
|
|
515
|
+
/**
|
|
516
|
+
* Always returned. A refresh consumes the token it presents, so keep this one.
|
|
517
|
+
*/
|
|
518
|
+
refresh_token?: string;
|
|
519
|
+
/**
|
|
520
|
+
* What was actually granted, which may be narrower than what was asked for.
|
|
521
|
+
*/
|
|
522
|
+
scope?: string;
|
|
523
|
+
/**
|
|
524
|
+
* Not part of OAuth, and only for our own clients. The ID of the API
|
|
525
|
+
* key the person picked when they approved, returned by every grant
|
|
526
|
+
* while this authorization may still read that key back. Absent when
|
|
527
|
+
* no key was picked, or when the person's role no longer allows
|
|
528
|
+
* reading keys back.
|
|
529
|
+
*
|
|
530
|
+
*/
|
|
531
|
+
'mslm:apikey_id'?: string;
|
|
532
|
+
/**
|
|
533
|
+
* Not part of OAuth, and only for our own clients: a client that signed
|
|
534
|
+
* in with a Client ID Metadata Document or registered itself never
|
|
535
|
+
* receives a key. The API
|
|
536
|
+
* key itself, so a device ends up holding an ordinary key. Returned by
|
|
537
|
+
* the device code and authorization code grants only, never by a
|
|
538
|
+
* refresh, and only alongside
|
|
539
|
+
* `mslm:apikey_id`. Absent when that key's secret cannot be read back,
|
|
540
|
+
* which is the case for a key created before keys could be shown again
|
|
541
|
+
* in the console; a rotated key can be.
|
|
542
|
+
*
|
|
543
|
+
*/
|
|
544
|
+
'mslm:apikey'?: string;
|
|
545
|
+
};
|
|
546
|
+
export type RevokeRequest = {
|
|
547
|
+
/**
|
|
548
|
+
* An access token or a refresh token.
|
|
549
|
+
*/
|
|
550
|
+
token: string;
|
|
551
|
+
/**
|
|
552
|
+
* Accepted and not checked.
|
|
553
|
+
*/
|
|
554
|
+
client_id?: string;
|
|
555
|
+
};
|
|
556
|
+
export type OauthError = {
|
|
557
|
+
error: string;
|
|
558
|
+
error_description?: string;
|
|
559
|
+
};
|
|
560
|
+
export type LookupIpData = {
|
|
561
|
+
body?: never;
|
|
562
|
+
path: {
|
|
563
|
+
/**
|
|
564
|
+
* The IPv4 or IPv6 address to classify.
|
|
565
|
+
*/
|
|
566
|
+
ip: string;
|
|
567
|
+
};
|
|
568
|
+
query?: never;
|
|
569
|
+
url: '/{ip}';
|
|
570
|
+
};
|
|
571
|
+
export type LookupIpErrors = {
|
|
572
|
+
/**
|
|
573
|
+
* The path segment is not a valid IP address.
|
|
574
|
+
*/
|
|
575
|
+
400: LookupError;
|
|
576
|
+
/**
|
|
577
|
+
* The presented API key is unknown, revoked, or expired.
|
|
578
|
+
*/
|
|
579
|
+
401: LookupError;
|
|
580
|
+
/**
|
|
581
|
+
* The key restricts which source addresses may use it and this
|
|
582
|
+
* request came from none of them, or the key was sent over plain
|
|
583
|
+
* HTTP, where anyone on the network path could read it. Rotate a key
|
|
584
|
+
* that was.
|
|
585
|
+
*
|
|
586
|
+
*/
|
|
587
|
+
403: LookupError;
|
|
588
|
+
/**
|
|
589
|
+
* Either a rate limit or a spent allowance. `Retry-After` is present
|
|
590
|
+
* for the former and absent for the latter, and is the only way to
|
|
591
|
+
* tell them apart.
|
|
592
|
+
*
|
|
593
|
+
*/
|
|
594
|
+
429: LookupError;
|
|
595
|
+
/**
|
|
596
|
+
* The VPN dataset could not be consulted.
|
|
597
|
+
*/
|
|
598
|
+
500: LookupError;
|
|
599
|
+
};
|
|
600
|
+
export type LookupIpError = LookupIpErrors[keyof LookupIpErrors];
|
|
601
|
+
export type LookupIpResponses = {
|
|
602
|
+
/**
|
|
603
|
+
* The classification. Present fields are those your plan includes; see
|
|
604
|
+
* the tier table in the API description.
|
|
605
|
+
*
|
|
606
|
+
*/
|
|
607
|
+
200: LookupResponse;
|
|
608
|
+
};
|
|
609
|
+
export type LookupIpResponse = LookupIpResponses[keyof LookupIpResponses];
|
|
610
|
+
export type LookupMyIpData = {
|
|
611
|
+
body?: never;
|
|
612
|
+
path?: never;
|
|
613
|
+
query?: never;
|
|
614
|
+
url: '/myip';
|
|
615
|
+
};
|
|
616
|
+
export type LookupMyIpErrors = {
|
|
617
|
+
/**
|
|
618
|
+
* The presented API key is unknown, revoked, or expired.
|
|
619
|
+
*/
|
|
620
|
+
401: LookupError;
|
|
621
|
+
/**
|
|
622
|
+
* The key restricts which source addresses may use it and this
|
|
623
|
+
* request came from none of them, or the key was sent over plain
|
|
624
|
+
* HTTP, where anyone on the network path could read it. Rotate a key
|
|
625
|
+
* that was.
|
|
626
|
+
*
|
|
627
|
+
*/
|
|
628
|
+
403: LookupError;
|
|
629
|
+
/**
|
|
630
|
+
* Either a rate limit or a spent allowance. `Retry-After` is present
|
|
631
|
+
* for the former and absent for the latter, and is the only way to
|
|
632
|
+
* tell them apart.
|
|
633
|
+
*
|
|
634
|
+
*/
|
|
635
|
+
429: LookupError;
|
|
636
|
+
/**
|
|
637
|
+
* The VPN dataset could not be consulted.
|
|
638
|
+
*/
|
|
639
|
+
500: LookupError;
|
|
640
|
+
};
|
|
641
|
+
export type LookupMyIpError = LookupMyIpErrors[keyof LookupMyIpErrors];
|
|
642
|
+
export type LookupMyIpResponses = {
|
|
643
|
+
/**
|
|
644
|
+
* The classification of your own address. Present fields are those
|
|
645
|
+
* your plan includes; see the tier table in the API description.
|
|
646
|
+
*
|
|
647
|
+
*/
|
|
648
|
+
200: LookupResponse;
|
|
649
|
+
};
|
|
650
|
+
export type LookupMyIpResponse = LookupMyIpResponses[keyof LookupMyIpResponses];
|
|
651
|
+
export type LookupBatchData = {
|
|
652
|
+
body: BatchLookupRequest;
|
|
653
|
+
path?: never;
|
|
654
|
+
query?: never;
|
|
655
|
+
url: '/batch';
|
|
656
|
+
};
|
|
657
|
+
export type LookupBatchErrors = {
|
|
658
|
+
/**
|
|
659
|
+
* The body is not a batch, or names too few or too many addresses.
|
|
660
|
+
*/
|
|
661
|
+
400: LookupError;
|
|
662
|
+
/**
|
|
663
|
+
* No API key was presented, or the one presented is unknown, revoked, or expired.
|
|
664
|
+
*/
|
|
665
|
+
401: LookupError;
|
|
666
|
+
/**
|
|
667
|
+
* The key restricts which source addresses may use it and this
|
|
668
|
+
* request came from none of them, or the key was sent over plain
|
|
669
|
+
* HTTP, where anyone on the network path could read it. Rotate a key
|
|
670
|
+
* that was.
|
|
671
|
+
*
|
|
672
|
+
*/
|
|
673
|
+
403: LookupError;
|
|
674
|
+
/**
|
|
675
|
+
* The body is larger than any batch of 1000 addresses can be.
|
|
676
|
+
*/
|
|
677
|
+
413: LookupError;
|
|
678
|
+
/**
|
|
679
|
+
* The rate limit refused the whole call. Always transient and always
|
|
680
|
+
* with `Retry-After`; a spent allowance is reported per entry in a
|
|
681
|
+
* `200` instead.
|
|
682
|
+
*
|
|
683
|
+
*/
|
|
684
|
+
429: LookupError;
|
|
685
|
+
};
|
|
686
|
+
export type LookupBatchError = LookupBatchErrors[keyof LookupBatchErrors];
|
|
687
|
+
export type LookupBatchResponses = {
|
|
688
|
+
/**
|
|
689
|
+
* One entry per distinct input string, in `results` or in `errors`.
|
|
690
|
+
* Present fields within a result are those your plan includes; see the
|
|
691
|
+
* tier table in the API description.
|
|
692
|
+
*
|
|
693
|
+
*/
|
|
694
|
+
200: BatchLookupResponse;
|
|
695
|
+
};
|
|
696
|
+
export type LookupBatchResponse = LookupBatchResponses[keyof LookupBatchResponses];
|
|
697
|
+
export type MyEntitlementData = {
|
|
698
|
+
body?: never;
|
|
699
|
+
path?: never;
|
|
700
|
+
query?: never;
|
|
701
|
+
url: '/api/v1/entitlement';
|
|
702
|
+
};
|
|
703
|
+
export type MyEntitlementErrors = {
|
|
704
|
+
/**
|
|
705
|
+
* No key was presented, or it is unknown, revoked or expired.
|
|
706
|
+
*/
|
|
707
|
+
401: EntitlementError;
|
|
708
|
+
/**
|
|
709
|
+
* The key restricts which source addresses may use it, and this
|
|
710
|
+
* request did not come from one of them.
|
|
711
|
+
*
|
|
712
|
+
*/
|
|
713
|
+
403: EntitlementError;
|
|
714
|
+
/**
|
|
715
|
+
* The usage counters could not be read. Reported rather than guessed
|
|
716
|
+
* at: the whole answer is the number, and a confident zero would read
|
|
717
|
+
* as "you have used nothing".
|
|
718
|
+
*
|
|
719
|
+
*/
|
|
720
|
+
503: EntitlementError;
|
|
721
|
+
};
|
|
722
|
+
export type MyEntitlementError = MyEntitlementErrors[keyof MyEntitlementErrors];
|
|
723
|
+
export type MyEntitlementResponses = {
|
|
724
|
+
/**
|
|
725
|
+
* The key's entitlements and consumption.
|
|
726
|
+
*/
|
|
727
|
+
200: Entitlement;
|
|
728
|
+
};
|
|
729
|
+
export type MyEntitlementResponse = MyEntitlementResponses[keyof MyEntitlementResponses];
|
|
730
|
+
export type OauthMetadataData = {
|
|
731
|
+
body?: never;
|
|
732
|
+
path?: never;
|
|
733
|
+
query?: never;
|
|
734
|
+
url: '/.well-known/oauth-authorization-server';
|
|
735
|
+
};
|
|
736
|
+
export type OauthMetadataResponses = {
|
|
737
|
+
/**
|
|
738
|
+
* The server's metadata.
|
|
739
|
+
*/
|
|
740
|
+
200: OauthMetadata;
|
|
741
|
+
};
|
|
742
|
+
export type OauthMetadataResponse = OauthMetadataResponses[keyof OauthMetadataResponses];
|
|
743
|
+
export type OauthTokenData = {
|
|
744
|
+
body: TokenRequest;
|
|
745
|
+
path?: never;
|
|
746
|
+
query?: never;
|
|
747
|
+
url: '/oauth/token';
|
|
748
|
+
};
|
|
749
|
+
export type OauthTokenErrors = {
|
|
750
|
+
/**
|
|
751
|
+
* An RFC 6749 error. `authorization_pending` and `slow_down` are
|
|
752
|
+
* normal answers while polling a device authorization, not failures.
|
|
753
|
+
* `access_denied` means the person refused, and `expired_token` that
|
|
754
|
+
* the device code is no longer valid: it expired, or it was already
|
|
755
|
+
* exchanged or refused. `invalid_grant` means the code, device code or
|
|
756
|
+
* refresh token is not valid for this `client_id`. `invalid_target`
|
|
757
|
+
* means `resource` names something other than what was authorized.
|
|
758
|
+
* `slow_down` also answers any grant when this address sends too many
|
|
759
|
+
* requests.
|
|
760
|
+
*
|
|
761
|
+
*/
|
|
762
|
+
400: OauthError;
|
|
763
|
+
/**
|
|
764
|
+
* `invalid_client`: the `client_id` is not registered.
|
|
765
|
+
*/
|
|
766
|
+
401: OauthError;
|
|
767
|
+
};
|
|
768
|
+
export type OauthTokenError = OauthTokenErrors[keyof OauthTokenErrors];
|
|
769
|
+
export type OauthTokenResponses = {
|
|
770
|
+
/**
|
|
771
|
+
* Tokens.
|
|
772
|
+
*/
|
|
773
|
+
200: TokenResponse;
|
|
774
|
+
};
|
|
775
|
+
export type OauthTokenResponse = OauthTokenResponses[keyof OauthTokenResponses];
|
|
776
|
+
export type OauthRevokeData = {
|
|
777
|
+
body: RevokeRequest;
|
|
778
|
+
path?: never;
|
|
779
|
+
query?: never;
|
|
780
|
+
url: '/oauth/revoke';
|
|
781
|
+
};
|
|
782
|
+
export type OauthRevokeResponses = {
|
|
783
|
+
/**
|
|
784
|
+
* Always, whatever was presented.
|
|
785
|
+
*/
|
|
786
|
+
200: {
|
|
787
|
+
[key: string]: unknown;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
export type OauthRevokeResponse = OauthRevokeResponses[keyof OauthRevokeResponses];
|