vpndetection 2.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,6 +42,24 @@ console.log(result.isHosting); // true
42
42
  console.log(result.hosting?.provider);
43
43
  ```
44
44
 
45
+ ### Your own address
46
+
47
+ ```js
48
+ const result = await client.myIp();
49
+ console.log(result.ip); // the address we saw this call come from
50
+ ```
51
+
52
+ ### Your plan and usage
53
+
54
+ ```js
55
+ const acct = await client.me();
56
+ console.log(acct.plan.key); // max
57
+ console.log(acct.usage.requests); // 580
58
+ console.log(acct.usage.window_end); // when the allowance resets
59
+ ```
60
+
61
+ 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.
62
+
45
63
  ### Batch lookup
46
64
 
47
65
  You can do batch lookups with a list, which parallelizes requests for you efficiently:
package/dist/client.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import type { Writable } from 'node:stream';
2
2
  import type { Client } from './generated/client/index.js';
3
- import type { Database, DatabaseMetadata, DbChecksums, Download } from './generated/types.gen.js';
3
+ import type { AccountMe, Database, DatabaseFormat, DatabaseMetadata, DbChecksums, Download } from './generated/types.gen.js';
4
4
  import { VPNDetectionError } from './errors.js';
5
5
  import { type Result } from './types.js';
6
- /** The formats a database is published in. Not every database is built in both. */
7
- export type DatasetFormat = 'csvgz' | 'mmdb';
8
6
  /**
9
7
  * Where `download` puts the bytes: a path to write, or a stream you opened
10
8
  * yourself and will close yourself.
@@ -88,6 +86,34 @@ export declare class VPNDetection {
88
86
  * else is served, then cached for this instance.
89
87
  */
90
88
  lookup(ip: string, options?: LookupOptions): Promise<Result>;
89
+ /**
90
+ * Classify the address this client is calling from.
91
+ *
92
+ * The same answer `lookup` would give for that address, at the same cost
93
+ * against your allowance. The address is the one our edge observed, so a
94
+ * call made through a proxy or a VPN reports the exit it left through -
95
+ * usually the point of asking.
96
+ *
97
+ * Deliberately NOT cached. The cache is keyed by address, and which
98
+ * address this is IS the question: a machine that moves between networks
99
+ * would otherwise be told where it used to be.
100
+ */
101
+ myIp(options?: LookupOptions): Promise<Result>;
102
+ /**
103
+ * What this client's key is entitled to, and how much of it has been used.
104
+ *
105
+ * Unlike a lookup there is no useful unauthenticated answer, so a client
106
+ * built without a key gets an unauthorized error rather than a partial one.
107
+ *
108
+ * Usage counts against the ALLOWANCE WINDOW - the anniversary of the
109
+ * subscription, not the calendar month and not the billing period - and it
110
+ * is the same number a lookup is gated on. It can lag by a few seconds,
111
+ * because requests are counted in memory and flushed in aggregate.
112
+ *
113
+ * Deliberately NOT cached: the whole point is what has been spent, and a
114
+ * cached answer is a wrong one within seconds of the next request.
115
+ */
116
+ me(options?: LookupOptions): Promise<AccountMe>;
91
117
  /**
92
118
  * Classify many addresses concurrently.
93
119
  *
@@ -114,7 +140,7 @@ export declare class DatabaseApi {
114
140
  * publishes is the API's choice, not ours, and picking one here is how the
115
141
  * previous version came to return `undefined`.
116
142
  */
117
- checksums(id: string, format: DatasetFormat): Promise<DbChecksums>;
143
+ checksums(id: string, format: DatabaseFormat): Promise<DbChecksums>;
118
144
  /**
119
145
  * Your organization's recent download attempts, newest first.
120
146
  *
@@ -130,7 +156,7 @@ export declare class DatabaseApi {
130
156
  * runs to gigabytes; the link authorizes the START of a transfer, so one
131
157
  * already running is not interrupted when it lapses.
132
158
  */
133
- downloadUrl(id: string, format: DatasetFormat): Promise<string>;
159
+ downloadUrl(id: string, format: DatabaseFormat): Promise<string>;
134
160
  /**
135
161
  * Download one dataset file, streaming it to `destination`.
136
162
  *
@@ -147,7 +173,7 @@ export declare class DatabaseApi {
147
173
  * than a `VPNDetectionError`: a reset socket and a full disk are different
148
174
  * problems and only one of them is ours.
149
175
  */
150
- download(id: string, format: DatasetFormat, destination: DownloadDestination): Promise<number>;
176
+ download(id: string, format: DatabaseFormat, destination: DownloadDestination): Promise<number>;
151
177
  /**
152
178
  * Download one dataset file and hand back its bytes.
153
179
  *
@@ -159,6 +185,6 @@ export declare class DatabaseApi {
159
185
  * at the small end, where the bytes are going straight into a parser; use
160
186
  * `download` for anything you have not measured.
161
187
  */
162
- downloadBytes(id: string, format: DatasetFormat): Promise<Uint8Array>;
163
- private fetchDatasetFile;
188
+ downloadBytes(id: string, format: DatabaseFormat): Promise<Uint8Array>;
189
+ private fetchDatabaseFile;
164
190
  }
package/dist/client.js CHANGED
@@ -2,7 +2,7 @@ import { LRUCache } from 'lru-cache';
2
2
  import pLimit from 'p-limit';
3
3
  import pRetry from 'p-retry';
4
4
  import { createClient, createConfig } from './generated/client/index.js';
5
- import { databaseChecksum, databaseMetadata, downloadDatabase as downloadRedirect, listDatabases, listDownloads, lookupIp, } from './generated/sdk.gen.js';
5
+ import { accountMe, databaseChecksum, databaseMetadata, downloadDatabase as downloadRedirect, listDatabases, listDownloads, lookupIp, lookupMyIp, } from './generated/sdk.gen.js';
6
6
  import { bogonResult, isBogon } from './bogon.js';
7
7
  import { errorFromResponse, VPNDetectionError } from './errors.js';
8
8
  import { toResult } from './types.js';
@@ -81,6 +81,50 @@ export class VPNDetection {
81
81
  this.cache?.set(ip, result);
82
82
  return result;
83
83
  }
84
+ /**
85
+ * Classify the address this client is calling from.
86
+ *
87
+ * The same answer `lookup` would give for that address, at the same cost
88
+ * against your allowance. The address is the one our edge observed, so a
89
+ * call made through a proxy or a VPN reports the exit it left through -
90
+ * usually the point of asking.
91
+ *
92
+ * Deliberately NOT cached. The cache is keyed by address, and which
93
+ * address this is IS the question: a machine that moves between networks
94
+ * would otherwise be told where it used to be.
95
+ */
96
+ async myIp(options = {}) {
97
+ const timeoutMs = options.timeoutMs ?? this.timeoutMs;
98
+ return withRetry(options.retries ?? this.retries, async () => {
99
+ const res = await deadline(timeoutMs, (signal) => lookupMyIp({
100
+ client: this.client, signal: signal,
101
+ }));
102
+ return toResult(unwrap(res));
103
+ });
104
+ }
105
+ /**
106
+ * What this client's key is entitled to, and how much of it has been used.
107
+ *
108
+ * Unlike a lookup there is no useful unauthenticated answer, so a client
109
+ * built without a key gets an unauthorized error rather than a partial one.
110
+ *
111
+ * Usage counts against the ALLOWANCE WINDOW - the anniversary of the
112
+ * subscription, not the calendar month and not the billing period - and it
113
+ * is the same number a lookup is gated on. It can lag by a few seconds,
114
+ * because requests are counted in memory and flushed in aggregate.
115
+ *
116
+ * Deliberately NOT cached: the whole point is what has been spent, and a
117
+ * cached answer is a wrong one within seconds of the next request.
118
+ */
119
+ async me(options = {}) {
120
+ const timeoutMs = options.timeoutMs ?? this.timeoutMs;
121
+ return withRetry(options.retries ?? this.retries, async () => {
122
+ const res = await deadline(timeoutMs, (signal) => accountMe({
123
+ client: this.client, signal: signal,
124
+ }));
125
+ return unwrap(res);
126
+ });
127
+ }
84
128
  /**
85
129
  * Classify many addresses concurrently.
86
130
  *
@@ -213,7 +257,7 @@ export class DatabaseApi {
213
257
  * problems and only one of them is ours.
214
258
  */
215
259
  async download(id, format, destination) {
216
- const res = await this.fetchDatasetFile(id, format);
260
+ const res = await this.fetchDatabaseFile(id, format);
217
261
  if (res.body === null) {
218
262
  throw new VPNDetectionError('server_error', 'object storage answered with no body', res.status);
219
263
  }
@@ -258,13 +302,13 @@ export class DatabaseApi {
258
302
  * `download` for anything you have not measured.
259
303
  */
260
304
  async downloadBytes(id, format) {
261
- const res = await this.fetchDatasetFile(id, format);
305
+ const res = await this.fetchDatabaseFile(id, format);
262
306
  return new Uint8Array(await res.arrayBuffer());
263
307
  }
264
308
  // Follows the 302 as a SECOND, unauthenticated request: the presigned URL
265
309
  // carries its own authorization, so forwarding the API key would hand a
266
310
  // credential to a host that has no business holding it.
267
- async fetchDatasetFile(id, format) {
311
+ async fetchDatabaseFile(id, format) {
268
312
  const url = await this.downloadUrl(id, format);
269
313
  return withRetry(this.retries, async () => {
270
314
  const res = await this.fetchImpl(url);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"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AAS,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;oBACvC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC5D,CAAC;YACL,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CAAC,GAAY;IACzB,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;QACnC,OAAO,GAAG,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAI,GAA2B,EAAE,KAAK,CAAC;IAClD,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9F,CAAC"}
@@ -1,2 +1,2 @@
1
- export { databaseChecksum, databaseMetadata, downloadDatabase, listDatabases, listDownloads, lookupIp, type Options } from './sdk.gen.js';
2
- export type { ClassDetail, ClientOptions, Database, DatabaseChecksumData, DatabaseChecksumError, DatabaseChecksumErrors, DatabaseChecksumResponse, DatabaseChecksumResponses, DatabaseFormatSize, DatabaseMetadata, DatabaseMetadataColumn, DatabaseMetadataData, DatabaseMetadataError, DatabaseMetadataErrors, DatabaseMetadataResponse, DatabaseMetadataResponses, DatabaseVersion, DbChecksums, Download, DownloadDatabaseData, DownloadDatabaseError, DownloadDatabaseErrors, Error, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDownloadsData, ListDownloadsError, ListDownloadsErrors, ListDownloadsResponse, ListDownloadsResponses, LookupError, LookupIpData, LookupIpError, LookupIpErrors, LookupIpResponse, LookupIpResponses, LookupResponse, ProxyDetail, VpnDetail } from './types.gen.js';
1
+ export { accountMe, databaseChecksum, databaseMetadata, downloadDatabase, listDatabases, listDownloads, lookupIp, lookupMyIp, type Options } from './sdk.gen.js';
2
+ export type { AccountApikey, AccountError, AccountMe, AccountMeData, AccountMeError, AccountMeErrors, AccountMeResponse, AccountMeResponses, AccountPlan, AccountUsage, ClassDetail, ClientOptions, Database, DatabaseChecksumData, DatabaseChecksumError, DatabaseChecksumErrors, DatabaseChecksumResponse, DatabaseChecksumResponses, DatabaseFormat, DatabaseFormatSize, DatabaseMetadata, DatabaseMetadataColumn, DatabaseMetadataData, DatabaseMetadataError, DatabaseMetadataErrors, DatabaseMetadataResponse, DatabaseMetadataResponses, DatabaseVersion, DbChecksums, Download, DownloadDatabaseData, DownloadDatabaseError, DownloadDatabaseErrors, Error, LicenseType, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDownloadsData, ListDownloadsError, ListDownloadsErrors, ListDownloadsResponse, ListDownloadsResponses, LookupError, LookupIpData, LookupIpError, LookupIpErrors, LookupIpResponse, LookupIpResponses, LookupMyIpData, LookupMyIpError, LookupMyIpErrors, LookupMyIpResponse, LookupMyIpResponses, LookupResponse, ProxyDetail, Standing, VpnDetail } from './types.gen.js';
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- export { databaseChecksum, databaseMetadata, downloadDatabase, listDatabases, listDownloads, lookupIp } from './sdk.gen.js';
2
+ export { accountMe, databaseChecksum, databaseMetadata, downloadDatabase, listDatabases, listDownloads, lookupIp, lookupMyIp } from './sdk.gen.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
- import type { DatabaseChecksumData, DatabaseChecksumErrors, DatabaseChecksumResponses, DatabaseMetadataData, DatabaseMetadataErrors, DatabaseMetadataResponses, DownloadDatabaseData, DownloadDatabaseErrors, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListDownloadsData, ListDownloadsErrors, ListDownloadsResponses, LookupIpData, LookupIpErrors, LookupIpResponses } from './types.gen.js';
2
+ import type { AccountMeData, AccountMeErrors, AccountMeResponses, DatabaseChecksumData, DatabaseChecksumErrors, DatabaseChecksumResponses, DatabaseMetadataData, DatabaseMetadataErrors, DatabaseMetadataResponses, DownloadDatabaseData, DownloadDatabaseErrors, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListDownloadsData, ListDownloadsErrors, ListDownloadsResponses, LookupIpData, LookupIpErrors, LookupIpResponses, LookupMyIpData, LookupMyIpErrors, LookupMyIpResponses } from './types.gen.js';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -22,10 +22,24 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
22
22
  *
23
23
  */
24
24
  export declare const lookupIp: <ThrowOnError extends boolean = false>(options: Options<LookupIpData, ThrowOnError>) => RequestResult<LookupIpResponses, LookupIpErrors, ThrowOnError>;
25
+ /**
26
+ * Lookup your own address
27
+ *
28
+ * Answers what is known about the address this request came from, which is
29
+ * the same answer `GET /{ip}` gives for that address: the plan behind the
30
+ * presented key decides which fields come back, and the request counts
31
+ * against the same allowance.
32
+ *
33
+ * The address is the one our edge observed, so a request through a proxy
34
+ * or a VPN reports the exit it left through rather than the machine that
35
+ * made it. That is usually the point of asking.
36
+ *
37
+ */
38
+ export declare const lookupMyIp: <ThrowOnError extends boolean = false>(options?: Options<LookupMyIpData, ThrowOnError>) => RequestResult<LookupMyIpResponses, LookupMyIpErrors, ThrowOnError>;
25
39
  /**
26
40
  * List
27
41
  *
28
- * Every dataset this organization holds a licence for, with the term and the license_type right beside each one.
42
+ * Every database this organization holds a licence for, with the term and the license_type right beside each one.
29
43
  *
30
44
  */
31
45
  export declare const listDatabases: <ThrowOnError extends boolean = false>(options?: Options<ListDatabasesData, ThrowOnError>) => RequestResult<ListDatabasesResponses, ListDatabasesErrors, ThrowOnError>;
@@ -42,7 +56,7 @@ export declare const downloadDatabase: <ThrowOnError extends boolean = false>(op
42
56
  * Poll this to decide whether today's build is worth fetching: it carries
43
57
  * `updated` and `entries` without downloading anything.
44
58
  *
45
- * No `format` parameter - one document describes every format the dataset
59
+ * No `format` parameter - one document describes every format the database
46
60
  * is built in.
47
61
  *
48
62
  */
@@ -61,3 +75,11 @@ export declare const databaseChecksum: <ThrowOnError extends boolean = false>(op
61
75
  *
62
76
  */
63
77
  export declare const listDownloads: <ThrowOnError extends boolean = false>(options?: Options<ListDownloadsData, ThrowOnError>) => RequestResult<ListDownloadsResponses, ListDownloadsErrors, ThrowOnError>;
78
+ /**
79
+ * Your key, plan and usage
80
+ *
81
+ * Answers what the presented key is, what plan is behind it, and what has
82
+ * been spent against that plan's allowance in the current window.
83
+ *
84
+ */
85
+ export declare const accountMe: <ThrowOnError extends boolean = false>(options?: Options<AccountMeData, ThrowOnError>) => RequestResult<AccountMeResponses, AccountMeErrors, ThrowOnError>;
@@ -21,10 +21,36 @@ export const lookupIp = (options) => (options.client ?? client).get({
21
21
  url: '/{ip}',
22
22
  ...options
23
23
  });
24
+ /**
25
+ * Lookup your own address
26
+ *
27
+ * Answers what is known about the address this request came from, which is
28
+ * the same answer `GET /{ip}` gives for that address: the plan behind the
29
+ * presented key decides which fields come back, and the request counts
30
+ * against the same allowance.
31
+ *
32
+ * The address is the one our edge observed, so a request through a proxy
33
+ * or a VPN reports the exit it left through rather than the machine that
34
+ * made it. That is usually the point of asking.
35
+ *
36
+ */
37
+ export const lookupMyIp = (options) => (options?.client ?? client).get({
38
+ security: [
39
+ {
40
+ in: 'query',
41
+ name: 'apikey',
42
+ type: 'apiKey'
43
+ },
44
+ { name: 'X-Api-Key', type: 'apiKey' },
45
+ { scheme: 'bearer', type: 'http' }
46
+ ],
47
+ url: '/myip',
48
+ ...options
49
+ });
24
50
  /**
25
51
  * List
26
52
  *
27
- * Every dataset this organization holds a licence for, with the term and the license_type right beside each one.
53
+ * Every database this organization holds a licence for, with the term and the license_type right beside each one.
28
54
  *
29
55
  */
30
56
  export const listDatabases = (options) => (options?.client ?? client).get({
@@ -65,7 +91,7 @@ export const downloadDatabase = (options) => (options.client ?? client).get({
65
91
  * Poll this to decide whether today's build is worth fetching: it carries
66
92
  * `updated` and `entries` without downloading anything.
67
93
  *
68
- * No `format` parameter - one document describes every format the dataset
94
+ * No `format` parameter - one document describes every format the database
69
95
  * is built in.
70
96
  *
71
97
  */
@@ -120,4 +146,24 @@ export const listDownloads = (options) => (options?.client ?? client).get({
120
146
  url: '/api/v1/database/downloads',
121
147
  ...options
122
148
  });
149
+ /**
150
+ * Your key, plan and usage
151
+ *
152
+ * Answers what the presented key is, what plan is behind it, and what has
153
+ * been spent against that plan's allowance in the current window.
154
+ *
155
+ */
156
+ export const accountMe = (options) => (options?.client ?? client).get({
157
+ security: [
158
+ {
159
+ in: 'query',
160
+ name: 'apikey',
161
+ type: 'apiKey'
162
+ },
163
+ { name: 'X-Api-Key', type: 'apiKey' },
164
+ { scheme: 'bearer', type: 'http' }
165
+ ],
166
+ url: '/api/v1/account/me',
167
+ ...options
168
+ });
123
169
  //# sourceMappingURL=sdk.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.gen.js","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAkBzC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAuC,OAA4C,EAAkE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,GAAG,CAAkD;IAC5P,QAAQ,EAAE;QACN;YACI,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACjB;QACD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;KACrC;IACD,GAAG,EAAE,OAAO;IACZ,GAAG,OAAO;CACb,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAuC,OAAkD,EAA4E,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC,GAAG,CAA4D;IAC5R,QAAQ,EAAE;QACN;YACI,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACjB;QACD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;KACrC;IACD,GAAG,EAAE,uBAAuB;IAC5B,GAAG,OAAO;CACb,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAuC,OAAoD,EAAgE,EAAE,CAAC,CAAC,OAAO,CAAC,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G,CAAuC,OAA8C,EAAoE,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC,GAAG,CAAoD;IACpQ,QAAQ,EAAE;QACN;YACI,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACjB;QACD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;KACrC;IACD,GAAG,EAAE,oBAAoB;IACzB,GAAG,OAAO;CACb,CAAC,CAAC"}
@@ -185,30 +185,44 @@ export type LookupError = {
185
185
  export type Error = {
186
186
  rc: string;
187
187
  };
188
+ /**
189
+ * What a license permits you to do with the data. Always present on this
190
+ * endpoint: it lists families you hold a license for and nothing else.
191
+ *
192
+ */
193
+ export type LicenseType = 'evaluation' | 'standard' | 'redistribute';
194
+ /**
195
+ * Where your license for a database family stands today. `licensed` is a
196
+ * live grant, `expired` one whose term has ended, and `unlicensed` a
197
+ * database published but never bought.
198
+ *
199
+ */
200
+ export type Standing = 'expired' | 'licensed' | 'unlicensed';
201
+ /**
202
+ * A file format a database version is published in.
203
+ */
204
+ export type DatabaseFormat = 'csvgz' | 'mmdb';
188
205
  export type DatabaseFormatSize = {
189
- format: 'csvgz' | 'mmdb';
206
+ format: DatabaseFormat;
190
207
  /**
191
208
  * Size of the published file, or null when it has not been published yet
192
209
  */
193
210
  bytes: number | null;
194
211
  };
195
212
  /**
196
- * One dataset FAMILY your organization is licensed for. A license covers
213
+ * One database FAMILY your organization is licensed for. A license covers
197
214
  * the family, while a download names a specific version, so the ids you
198
215
  * pass to the download and checksum endpoints come from `versions`.
199
216
  *
200
217
  */
201
218
  export type Database = {
202
219
  /**
203
- * The dataset family, e.g. `vpn_ip`. What the license is held against.
220
+ * The database family, e.g. `vpn_ip`. What the license is held against.
204
221
  */
205
222
  base: string;
206
223
  name: string;
207
224
  summary: string;
208
- /**
209
- * What your license permits you to do with the data.
210
- */
211
- license_type: 'evaluation' | 'standard' | 'redistribute';
225
+ license_type: LicenseType;
212
226
  starts: string | null;
213
227
  /**
214
228
  * A hard stop. Null when the license has no end date, which is the normal case for a rolling agreement, and when there is no license. A rolling license reports its turnover date in renews_at instead.
@@ -226,12 +240,7 @@ export type Database = {
226
240
  * False when the license has lapsed; downloads are refused.
227
241
  */
228
242
  in_term: boolean;
229
- /**
230
- * `licensed` is a live grant, `expired` one whose term has ended, and
231
- * `unlicensed` a dataset published but never bought.
232
- *
233
- */
234
- standing: 'expired' | 'licensed' | 'unlicensed';
243
+ standing: Standing;
235
244
  /**
236
245
  * Every published version of this family. The `id` here is what the
237
246
  * download and checksum endpoints take.
@@ -241,7 +250,7 @@ export type Database = {
241
250
  };
242
251
  export type DatabaseVersion = {
243
252
  /**
244
- * The versioned dataset id, e.g. `vpn_ip_v1`. Pass this to download.
253
+ * The versioned database id, e.g. `vpn_ip_v1`. Pass this to download.
245
254
  */
246
255
  id: string;
247
256
  version: number;
@@ -250,7 +259,7 @@ export type DatabaseVersion = {
250
259
  /**
251
260
  * The formats an evaluation sample is published in, if any.
252
261
  */
253
- sample_formats?: Array<'csvgz' | 'mmdb'>;
262
+ sample_formats?: Array<DatabaseFormat>;
254
263
  };
255
264
  /**
256
265
  * One download ATTEMPT, refusals included - a denial is what answers "it
@@ -338,6 +347,76 @@ export type DatabaseMetadata = {
338
347
  */
339
348
  sample_entries?: number;
340
349
  };
350
+ export type AccountMe = {
351
+ /**
352
+ * The organization the key belongs to.
353
+ */
354
+ org_id: string;
355
+ apikey: AccountApikey;
356
+ plan: AccountPlan;
357
+ usage: AccountUsage;
358
+ };
359
+ /**
360
+ * The credential itself. The key is never echoed - only its id, which is
361
+ * what the console shows and what you can act on.
362
+ *
363
+ */
364
+ export type AccountApikey = {
365
+ id: string;
366
+ /**
367
+ * Null for a key with no end date, which is the normal case.
368
+ */
369
+ expires: string | null;
370
+ /**
371
+ * The source addresses this key may be used from. EMPTY means
372
+ * unrestricted, never "deny all".
373
+ *
374
+ */
375
+ allowed_cidrs: Array<string>;
376
+ };
377
+ export type AccountPlan = {
378
+ /**
379
+ * The plan the organization is on.
380
+ */
381
+ key: string;
382
+ /**
383
+ * The field tier, which decides how much of a lookup answer comes
384
+ * back. What each tier includes is documented on the lookup endpoint
385
+ * rather than repeated here, so there is one place it can be wrong.
386
+ *
387
+ */
388
+ tier: 'free' | 'starter' | 'scale' | 'max';
389
+ };
390
+ export type AccountUsage = {
391
+ /**
392
+ * Requests counted in the current window. The same number the lookup
393
+ * API gates on, and it can lag by a few seconds.
394
+ *
395
+ */
396
+ requests: number;
397
+ /**
398
+ * What the plan includes. Zero on a plan that includes none.
399
+ */
400
+ quota: number;
401
+ /**
402
+ * Where we stop serving. NULL means never, which is the normal state
403
+ * of an uncapped paid plan and is not the same as zero. Above the
404
+ * quota and below this, requests are served and billed as overage.
405
+ *
406
+ */
407
+ hard_limit: number | null;
408
+ /**
409
+ * When the current allowance period began.
410
+ */
411
+ window_start: string;
412
+ /**
413
+ * When the allowance next resets.
414
+ */
415
+ window_end: string;
416
+ };
417
+ export type AccountError = {
418
+ error: string;
419
+ };
341
420
  export type LookupIpData = {
342
421
  body?: never;
343
422
  path: {
@@ -386,6 +465,44 @@ export type LookupIpResponses = {
386
465
  200: LookupResponse;
387
466
  };
388
467
  export type LookupIpResponse = LookupIpResponses[keyof LookupIpResponses];
468
+ export type LookupMyIpData = {
469
+ body?: never;
470
+ path?: never;
471
+ query?: never;
472
+ url: '/myip';
473
+ };
474
+ export type LookupMyIpErrors = {
475
+ /**
476
+ * The presented API key is unknown, revoked, or expired.
477
+ */
478
+ 401: LookupError;
479
+ /**
480
+ * The key restricts which source addresses may use it, and this
481
+ * request did not come from one of them.
482
+ *
483
+ */
484
+ 403: LookupError;
485
+ /**
486
+ * Either the request rate was too high, or an allowance is spent.
487
+ * The two are told apart by the message, not the status.
488
+ *
489
+ */
490
+ 429: LookupError;
491
+ /**
492
+ * The VPN dataset could not be consulted.
493
+ */
494
+ 500: LookupError;
495
+ };
496
+ export type LookupMyIpError = LookupMyIpErrors[keyof LookupMyIpErrors];
497
+ export type LookupMyIpResponses = {
498
+ /**
499
+ * The classification of your own address. Present fields are those
500
+ * your plan includes; see the tier table in the API description.
501
+ *
502
+ */
503
+ 200: LookupResponse;
504
+ };
505
+ export type LookupMyIpResponse = LookupMyIpResponses[keyof LookupMyIpResponses];
389
506
  export type ListDatabasesData = {
390
507
  body?: never;
391
508
  path?: never;
@@ -417,18 +534,18 @@ export type DownloadDatabaseData = {
417
534
  */
418
535
  id: string;
419
536
  /**
420
- * Not every dataset is built in every format. The `_provider`
537
+ * Not every database is built in every format. The `_provider`
421
538
  * catalogues are keyed by provider id rather than by IP range, so no
422
539
  * MMDB exists for them.
423
540
  *
424
541
  */
425
- format: 'csvgz' | 'mmdb';
542
+ format: DatabaseFormat;
426
543
  };
427
544
  url: '/api/v1/database/download';
428
545
  };
429
546
  export type DownloadDatabaseErrors = {
430
547
  /**
431
- * The dataset is not built in the requested format
548
+ * The database is not built in the requested format
432
549
  */
433
550
  400: Error;
434
551
  /**
@@ -436,11 +553,11 @@ export type DownloadDatabaseErrors = {
436
553
  */
437
554
  401: Error;
438
555
  /**
439
- * Your organization holds no license for this dataset, or its term has ended
556
+ * Your organization holds no license for this database, or its term has ended
440
557
  */
441
558
  403: Error;
442
559
  /**
443
- * No such dataset
560
+ * No such database
444
561
  */
445
562
  404: Error;
446
563
  /**
@@ -463,11 +580,11 @@ export type DatabaseMetadataErrors = {
463
580
  */
464
581
  401: Error;
465
582
  /**
466
- * Your organization holds no license for this dataset, or its term has ended
583
+ * Your organization holds no license for this database, or its term has ended
467
584
  */
468
585
  403: Error;
469
586
  /**
470
- * No such dataset
587
+ * No such database
471
588
  */
472
589
  404: Error;
473
590
  /**
@@ -488,13 +605,13 @@ export type DatabaseChecksumData = {
488
605
  path?: never;
489
606
  query: {
490
607
  id: string;
491
- format: 'csvgz' | 'mmdb';
608
+ format: DatabaseFormat;
492
609
  };
493
610
  url: '/api/v1/database/checksum';
494
611
  };
495
612
  export type DatabaseChecksumErrors = {
496
613
  /**
497
- * The dataset is not built in the requested format
614
+ * The database is not built in the requested format
498
615
  */
499
616
  400: Error;
500
617
  /**
@@ -502,11 +619,11 @@ export type DatabaseChecksumErrors = {
502
619
  */
503
620
  401: Error;
504
621
  /**
505
- * Your organization holds no license for this dataset, or its term has ended
622
+ * Your organization holds no license for this database, or its term has ended
506
623
  */
507
624
  403: Error;
508
625
  /**
509
- * No such dataset
626
+ * No such database
510
627
  */
511
628
  404: Error;
512
629
  /**
@@ -550,3 +667,36 @@ export type ListDownloadsResponses = {
550
667
  };
551
668
  };
552
669
  export type ListDownloadsResponse = ListDownloadsResponses[keyof ListDownloadsResponses];
670
+ export type AccountMeData = {
671
+ body?: never;
672
+ path?: never;
673
+ query?: never;
674
+ url: '/api/v1/account/me';
675
+ };
676
+ export type AccountMeErrors = {
677
+ /**
678
+ * No key was presented, or it is unknown, revoked or expired.
679
+ */
680
+ 401: AccountError;
681
+ /**
682
+ * The key restricts which source addresses may use it, and this
683
+ * request did not come from one of them.
684
+ *
685
+ */
686
+ 403: AccountError;
687
+ /**
688
+ * The usage counters could not be read. Reported rather than guessed
689
+ * at: the whole answer is the number, and a confident zero would read
690
+ * as "you have used nothing".
691
+ *
692
+ */
693
+ 503: AccountError;
694
+ };
695
+ export type AccountMeError = AccountMeErrors[keyof AccountMeErrors];
696
+ export type AccountMeResponses = {
697
+ /**
698
+ * The key's entitlements and consumption.
699
+ */
700
+ 200: AccountMe;
701
+ };
702
+ export type AccountMeResponse = AccountMeResponses[keyof AccountMeResponses];
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export { VPNDetection, DatabaseApi, DEFAULT_BASE_URL } from './client.js';
2
- export type { Options, CacheOptions, LookupOptions, BatchOptions, DownloadsOptions, DatasetFormat, DownloadDestination, } from './client.js';
2
+ export type { Options, CacheOptions, LookupOptions, BatchOptions, DownloadsOptions, DownloadDestination, } from './client.js';
3
3
  export { isBogon } from './bogon.js';
4
4
  export { VPNDetectionError } from './errors.js';
5
5
  export type { ErrorKind } from './errors.js';
6
6
  export type { Result, VpnDetail, ClassDetail, ProxyDetail, LookupResponse, } from './types.js';
7
- export type { Database, DatabaseVersion, DatabaseMetadata, DatabaseMetadataColumn, DatabaseFormatSize, DbChecksums, Download, } from './generated/types.gen.js';
7
+ export type { Database, DatabaseFormat, DatabaseFormatSize, DatabaseMetadata, DatabaseMetadataColumn, DatabaseVersion, DbChecksums, Download, LicenseType, Standing, } from './generated/types.gen.js';
8
+ export type { AccountMe, AccountApikey, AccountPlan, AccountUsage, } from './generated/types.gen.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpndetection",
3
- "version": "2.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Official Node.js client library for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN IPs.",
5
5
  "type": "module",
6
6
  "license": "MIT",