vpndetection 1.0.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.
Files changed (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +158 -0
  3. package/dist/bogon.d.ts +19 -0
  4. package/dist/bogon.js +130 -0
  5. package/dist/bogon.js.map +1 -0
  6. package/dist/bogons.gen.d.ts +2 -0
  7. package/dist/bogons.gen.js +62 -0
  8. package/dist/bogons.gen.js.map +1 -0
  9. package/dist/client.d.ts +97 -0
  10. package/dist/client.js +201 -0
  11. package/dist/client.js.map +1 -0
  12. package/dist/errors.d.ts +21 -0
  13. package/dist/errors.js +69 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/generated/client/client.gen.d.ts +2 -0
  16. package/dist/generated/client/client.gen.js +217 -0
  17. package/dist/generated/client/client.gen.js.map +1 -0
  18. package/dist/generated/client/index.d.ts +10 -0
  19. package/dist/generated/client/index.js +7 -0
  20. package/dist/generated/client/index.js.map +1 -0
  21. package/dist/generated/client/types.gen.d.ts +120 -0
  22. package/dist/generated/client/types.gen.js +3 -0
  23. package/dist/generated/client/types.gen.js.map +1 -0
  24. package/dist/generated/client/utils.gen.d.ts +37 -0
  25. package/dist/generated/client/utils.gen.js +229 -0
  26. package/dist/generated/client/utils.gen.js.map +1 -0
  27. package/dist/generated/client.gen.d.ts +12 -0
  28. package/dist/generated/client.gen.js +4 -0
  29. package/dist/generated/client.gen.js.map +1 -0
  30. package/dist/generated/core/auth.gen.d.ts +25 -0
  31. package/dist/generated/core/auth.gen.js +15 -0
  32. package/dist/generated/core/auth.gen.js.map +1 -0
  33. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  34. package/dist/generated/core/bodySerializer.gen.js +58 -0
  35. package/dist/generated/core/bodySerializer.gen.js.map +1 -0
  36. package/dist/generated/core/params.gen.d.ts +43 -0
  37. package/dist/generated/core/params.gen.js +110 -0
  38. package/dist/generated/core/params.gen.js.map +1 -0
  39. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  40. package/dist/generated/core/pathSerializer.gen.js +107 -0
  41. package/dist/generated/core/pathSerializer.gen.js.map +1 -0
  42. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  43. package/dist/generated/core/queryKeySerializer.gen.js +93 -0
  44. package/dist/generated/core/queryKeySerializer.gen.js.map +1 -0
  45. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  46. package/dist/generated/core/serverSentEvents.gen.js +133 -0
  47. package/dist/generated/core/serverSentEvents.gen.js.map +1 -0
  48. package/dist/generated/core/types.gen.d.ts +83 -0
  49. package/dist/generated/core/types.gen.js +3 -0
  50. package/dist/generated/core/types.gen.js.map +1 -0
  51. package/dist/generated/core/utils.gen.d.ts +19 -0
  52. package/dist/generated/core/utils.gen.js +88 -0
  53. package/dist/generated/core/utils.gen.js.map +1 -0
  54. package/dist/generated/index.d.ts +2 -0
  55. package/dist/generated/index.js +3 -0
  56. package/dist/generated/index.js.map +1 -0
  57. package/dist/generated/sdk.gen.d.ts +51 -0
  58. package/dist/generated/sdk.gen.js +111 -0
  59. package/dist/generated/sdk.gen.js.map +1 -0
  60. package/dist/generated/types.gen.d.ts +466 -0
  61. package/dist/generated/types.gen.js +3 -0
  62. package/dist/generated/types.gen.js.map +1 -0
  63. package/dist/index.d.ts +7 -0
  64. package/dist/index.js +4 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/types.d.ts +39 -0
  67. package/dist/types.js +39 -0
  68. package/dist/types.js.map +1 -0
  69. package/package.json +61 -0
@@ -0,0 +1,466 @@
1
+ export type ClientOptions = {
2
+ baseUrl: 'https://api.vpndetection.io' | 'https://api-staging.vpndetection.io' | (string & {});
3
+ };
4
+ /**
5
+ * The union of every plan's answer. Only `ip` and `is_vpn` are guaranteed;
6
+ * each remaining field is present when your plan includes it, and absent
7
+ * otherwise. A client that must work across plans should treat an absent
8
+ * flag as unknown rather than as `false`.
9
+ *
10
+ */
11
+ export type LookupResponse = {
12
+ /**
13
+ * The address that was looked up, normalized.
14
+ */
15
+ ip: string;
16
+ /**
17
+ * Whether the address is VPN infrastructure. Keys off presence in the
18
+ * VPN dataset, so an unattributed range with no provider is still
19
+ * `true`.
20
+ *
21
+ */
22
+ is_vpn: boolean;
23
+ /**
24
+ * Whether the address belongs to a hosting or cloud provider. Starter and above.
25
+ */
26
+ is_hosting?: boolean;
27
+ /**
28
+ * Whether the address is a privacy relay egress. Starter and above.
29
+ */
30
+ is_relay?: boolean;
31
+ /**
32
+ * Whether the address is a Tor node. Starter and above.
33
+ */
34
+ is_tor?: boolean;
35
+ /**
36
+ * Whether the address belongs to a CDN. Starter and above.
37
+ */
38
+ is_cdn?: boolean;
39
+ /**
40
+ * Whether the address was seen in a residential proxy pool. Max only.
41
+ */
42
+ is_resproxy?: boolean;
43
+ /**
44
+ * Whether the address was seen in a datacenter proxy pool. Max only.
45
+ */
46
+ is_dcproxy?: boolean;
47
+ /**
48
+ * Whether the address was seen in a mobile proxy pool. Max only.
49
+ */
50
+ is_mobproxy?: boolean;
51
+ /**
52
+ * Detail for `is_vpn`. Empty when `is_vpn` is false. Starter and above.
53
+ *
54
+ */
55
+ vpn?: VpnDetail;
56
+ /**
57
+ * Detail for `is_hosting`. Empty when false. Scale and above.
58
+ */
59
+ hosting?: ClassDetail;
60
+ /**
61
+ * Detail for `is_relay`. Empty when false. Scale and above.
62
+ */
63
+ relay?: ClassDetail;
64
+ /**
65
+ * Detail for `is_tor`. Empty when false. Scale and above. The tor
66
+ * dataset carries no provider, so `provider` is always an empty string.
67
+ *
68
+ */
69
+ tor?: ClassDetail;
70
+ /**
71
+ * Detail for `is_cdn`. Empty when false. Scale and above.
72
+ */
73
+ cdn?: ClassDetail;
74
+ /**
75
+ * Detail for `is_resproxy`. Empty when false. Max only.
76
+ */
77
+ resproxy?: ProxyDetail;
78
+ /**
79
+ * Detail for `is_dcproxy`. Empty when false. Max only.
80
+ */
81
+ dcproxy?: ProxyDetail;
82
+ /**
83
+ * Detail for `is_mobproxy`. Empty when false. Max only.
84
+ */
85
+ mobproxy?: ProxyDetail;
86
+ };
87
+ /**
88
+ * What is known about the VPN attribution. Every key is present when the
89
+ * object is populated, empty values included; the object is `{}` when
90
+ * `is_vpn` is false. `confidence` and `method` are max only, so on a lower
91
+ * plan they are absent from a populated object rather than empty.
92
+ *
93
+ */
94
+ export type VpnDetail = {
95
+ /**
96
+ * The VPN provider, or an empty string for an unattributed range.
97
+ */
98
+ provider?: string;
99
+ /**
100
+ * The most recent date this address was observed as VPN infrastructure.
101
+ */
102
+ last_seen?: string;
103
+ /**
104
+ * How strongly the attribution is supported. Max only.
105
+ */
106
+ confidence?: string;
107
+ /**
108
+ * How the address was attributed to the provider. Max only.
109
+ */
110
+ method?: string;
111
+ };
112
+ /**
113
+ * The shared detail shape for the hosting, relay, tor and cdn datasets.
114
+ * Every key is present when the object is populated; the object is `{}`
115
+ * when its flag is false.
116
+ *
117
+ */
118
+ export type ClassDetail = {
119
+ /**
120
+ * The provider, or an empty string where the dataset has none.
121
+ */
122
+ provider?: string;
123
+ /**
124
+ * How strongly the classification is supported.
125
+ */
126
+ confidence?: string;
127
+ /**
128
+ * The most recent date this address was observed in this dataset.
129
+ */
130
+ last_seen?: string;
131
+ };
132
+ /**
133
+ * The shared detail shape for the residential, datacenter and mobile proxy
134
+ * families, measured over a rolling 90 day window. Every key is present
135
+ * when the object is populated; the object is `{}` when its flag is false.
136
+ *
137
+ */
138
+ export type ProxyDetail = {
139
+ /**
140
+ * The proxy network, or an empty string where unattributed.
141
+ */
142
+ provider?: string;
143
+ /**
144
+ * The earliest date within the window this address was seen in the pool.
145
+ */
146
+ first_seen?: string;
147
+ /**
148
+ * The most recent date within the window this address was seen in the pool.
149
+ */
150
+ last_seen?: string;
151
+ /**
152
+ * How many times the address was observed in the pool during the window.
153
+ */
154
+ hits?: number;
155
+ /**
156
+ * The share of days in the window on which the address was seen, as a
157
+ * percentage. A high value means a stable pool member rather than a
158
+ * one-off sighting.
159
+ *
160
+ */
161
+ hits_days_pct?: number;
162
+ /**
163
+ * How many distinct proxy networks this address was seen in.
164
+ */
165
+ providers_num?: number;
166
+ };
167
+ /**
168
+ * Every non-2xx response carries this shape.
169
+ */
170
+ export type LookupError = {
171
+ /**
172
+ * A human-readable explanation of the failure.
173
+ */
174
+ error: string;
175
+ };
176
+ export type Error = {
177
+ rc: string;
178
+ };
179
+ export type DatasetFormatSize = {
180
+ format: 'csvgz' | 'mmdb';
181
+ /**
182
+ * Size of the published file, or null when it has not been published yet
183
+ */
184
+ bytes: number | null;
185
+ };
186
+ export type LicensedDataset = {
187
+ id: string;
188
+ name: string;
189
+ summary?: string;
190
+ /**
191
+ * Licensed but no longer published. Talk to us.
192
+ */
193
+ retired?: boolean;
194
+ /**
195
+ * What your license permits you to do with the data
196
+ */
197
+ redistribution: 'evaluation' | 'internal' | 'redistribute';
198
+ starts?: string;
199
+ expires?: string | null;
200
+ /**
201
+ * False when the license has lapsed; downloads are refused
202
+ */
203
+ in_term: boolean;
204
+ formats: Array<DatasetFormatSize>;
205
+ };
206
+ export type Download = {
207
+ dataset_id: string;
208
+ format: string;
209
+ outcome: 'ok' | 'unauthorized' | 'denied' | 'expired' | 'unknown' | 'unavailable';
210
+ bytes?: number | null;
211
+ created: string;
212
+ };
213
+ export type DatasetMetadataColumn = {
214
+ name: string;
215
+ type: string;
216
+ description?: string;
217
+ };
218
+ export type DatasetMetadata = {
219
+ id: string;
220
+ /**
221
+ * How often a new build is published
222
+ */
223
+ update_freq?: string;
224
+ updated: string;
225
+ /**
226
+ * Row count in the current build
227
+ */
228
+ entries: number;
229
+ /**
230
+ * Columns, keyed by format
231
+ */
232
+ schema: {
233
+ [key: string]: Array<DatasetMetadataColumn>;
234
+ };
235
+ /**
236
+ * A few real rows, keyed by format
237
+ */
238
+ sample?: {
239
+ [key: string]: Array<{
240
+ [key: string]: unknown;
241
+ }>;
242
+ };
243
+ /**
244
+ * Bytes per format
245
+ */
246
+ size?: {
247
+ [key: string]: number;
248
+ };
249
+ };
250
+ export type LookupIpData = {
251
+ body?: never;
252
+ path: {
253
+ /**
254
+ * The IPv4 or IPv6 address to classify.
255
+ */
256
+ ip: string;
257
+ };
258
+ query?: never;
259
+ url: '/{ip}';
260
+ };
261
+ export type LookupIpErrors = {
262
+ /**
263
+ * The path segment is not a valid IP address.
264
+ */
265
+ 400: LookupError;
266
+ /**
267
+ * The presented API key is unknown, revoked, or expired.
268
+ */
269
+ 401: LookupError;
270
+ /**
271
+ * The key restricts which source addresses may use it, and this
272
+ * request did not come from one of them.
273
+ *
274
+ */
275
+ 403: LookupError;
276
+ /**
277
+ * Either a transient rate limit or a spent allowance. `Retry-After` is
278
+ * present for the former and absent for the latter, and is the only
279
+ * way to tell them apart.
280
+ *
281
+ */
282
+ 429: LookupError;
283
+ /**
284
+ * The VPN dataset could not be consulted.
285
+ */
286
+ 500: LookupError;
287
+ };
288
+ export type LookupIpError = LookupIpErrors[keyof LookupIpErrors];
289
+ export type LookupIpResponses = {
290
+ /**
291
+ * The classification. Present fields are those your plan includes; see
292
+ * the tier table in the API description.
293
+ *
294
+ */
295
+ 200: LookupResponse;
296
+ };
297
+ export type LookupIpResponse = LookupIpResponses[keyof LookupIpResponses];
298
+ export type ListDatabasesData = {
299
+ body?: never;
300
+ path?: never;
301
+ query?: never;
302
+ url: '/api/v1/database/list';
303
+ };
304
+ export type ListDatabasesErrors = {
305
+ /**
306
+ * Missing or invalid key, or the key lacks the db.download scope
307
+ */
308
+ 401: Error;
309
+ };
310
+ export type ListDatabasesError = ListDatabasesErrors[keyof ListDatabasesErrors];
311
+ export type ListDatabasesResponses = {
312
+ /**
313
+ * OK
314
+ */
315
+ 200: {
316
+ datasets: Array<LicensedDataset>;
317
+ };
318
+ };
319
+ export type ListDatabasesResponse = ListDatabasesResponses[keyof ListDatabasesResponses];
320
+ export type DownloadDatabaseData = {
321
+ body?: never;
322
+ path?: never;
323
+ query: {
324
+ /**
325
+ * Dataset id, e.g. vpn_ip_extended_v1
326
+ */
327
+ id: string;
328
+ /**
329
+ * Not every dataset is built in every format. The `_provider`
330
+ * catalogues are keyed by provider id rather than by IP range, so no
331
+ * MMDB exists for them.
332
+ *
333
+ */
334
+ format: 'csvgz' | 'mmdb';
335
+ };
336
+ url: '/api/v1/database/download';
337
+ };
338
+ export type DownloadDatabaseErrors = {
339
+ /**
340
+ * The dataset is not built in the requested format
341
+ */
342
+ 400: Error;
343
+ /**
344
+ * Missing or invalid key, or the key lacks the db.download scope
345
+ */
346
+ 401: Error;
347
+ /**
348
+ * Your organization holds no license for this dataset, or its term has ended
349
+ */
350
+ 403: Error;
351
+ /**
352
+ * No such dataset
353
+ */
354
+ 404: Error;
355
+ /**
356
+ * Licensed, but today's copy has not been published yet
357
+ */
358
+ 503: Error;
359
+ };
360
+ export type DownloadDatabaseError = DownloadDatabaseErrors[keyof DownloadDatabaseErrors];
361
+ export type DatabaseMetadataData = {
362
+ body?: never;
363
+ path?: never;
364
+ query: {
365
+ id: string;
366
+ };
367
+ url: '/api/v1/database/metadata';
368
+ };
369
+ export type DatabaseMetadataErrors = {
370
+ /**
371
+ * Missing or invalid key, or the key lacks the db.download scope
372
+ */
373
+ 401: Error;
374
+ /**
375
+ * Your organization holds no license for this dataset, or its term has ended
376
+ */
377
+ 403: Error;
378
+ /**
379
+ * No such dataset
380
+ */
381
+ 404: Error;
382
+ /**
383
+ * Licensed, but today's copy has not been published yet
384
+ */
385
+ 503: Error;
386
+ };
387
+ export type DatabaseMetadataError = DatabaseMetadataErrors[keyof DatabaseMetadataErrors];
388
+ export type DatabaseMetadataResponses = {
389
+ /**
390
+ * OK
391
+ */
392
+ 200: DatasetMetadata;
393
+ };
394
+ export type DatabaseMetadataResponse = DatabaseMetadataResponses[keyof DatabaseMetadataResponses];
395
+ export type DatabaseChecksumData = {
396
+ body?: never;
397
+ path?: never;
398
+ query: {
399
+ id: string;
400
+ format: 'csvgz' | 'mmdb';
401
+ };
402
+ url: '/api/v1/database/checksum';
403
+ };
404
+ export type DatabaseChecksumErrors = {
405
+ /**
406
+ * The dataset is not built in the requested format
407
+ */
408
+ 400: Error;
409
+ /**
410
+ * Missing or invalid key, or the key lacks the db.download scope
411
+ */
412
+ 401: Error;
413
+ /**
414
+ * Your organization holds no license for this dataset, or its term has ended
415
+ */
416
+ 403: Error;
417
+ /**
418
+ * No such dataset
419
+ */
420
+ 404: Error;
421
+ /**
422
+ * Licensed, but today's copy has not been published yet
423
+ */
424
+ 503: Error;
425
+ };
426
+ export type DatabaseChecksumError = DatabaseChecksumErrors[keyof DatabaseChecksumErrors];
427
+ export type DatabaseChecksumResponses = {
428
+ /**
429
+ * OK
430
+ */
431
+ 200: {
432
+ id: string;
433
+ format: string;
434
+ checksums: {
435
+ md5?: string;
436
+ sha1?: string;
437
+ sha256?: string;
438
+ sha512?: string;
439
+ };
440
+ };
441
+ };
442
+ export type DatabaseChecksumResponse = DatabaseChecksumResponses[keyof DatabaseChecksumResponses];
443
+ export type ListDownloadsData = {
444
+ body?: never;
445
+ path?: never;
446
+ query?: {
447
+ limit?: number;
448
+ };
449
+ url: '/api/v1/database/downloads';
450
+ };
451
+ export type ListDownloadsErrors = {
452
+ /**
453
+ * Missing or invalid key, or the key lacks the db.download scope
454
+ */
455
+ 401: Error;
456
+ };
457
+ export type ListDownloadsError = ListDownloadsErrors[keyof ListDownloadsErrors];
458
+ export type ListDownloadsResponses = {
459
+ /**
460
+ * OK
461
+ */
462
+ 200: {
463
+ downloads: Array<Download>;
464
+ };
465
+ };
466
+ export type ListDownloadsResponse = ListDownloadsResponses[keyof ListDownloadsResponses];
@@ -0,0 +1,3 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};
3
+ //# sourceMappingURL=types.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../src/generated/types.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD"}
@@ -0,0 +1,7 @@
1
+ export { VPNDetection, DatabaseApi, DEFAULT_BASE_URL } from './client.js';
2
+ export type { Options, CacheOptions, LookupOptions, BatchOptions } from './client.js';
3
+ export { isBogon } from './bogon.js';
4
+ export { VPNDetectionError } from './errors.js';
5
+ export type { ErrorKind } from './errors.js';
6
+ export type { Result, VpnDetail, ClassDetail, ProxyDetail, LookupResponse, } from './types.js';
7
+ export type { LicensedDataset, DatasetMetadata, DatasetMetadataColumn, DatasetFormatSize, Download, } from './generated/types.gen.js';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { VPNDetection, DatabaseApi, DEFAULT_BASE_URL } from './client.js';
2
+ export { isBogon } from './bogon.js';
3
+ export { VPNDetectionError } from './errors.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { ClassDetail, LookupResponse, ProxyDetail, VpnDetail } from './generated/types.gen.js';
2
+ export type { ClassDetail, ProxyDetail, VpnDetail, LookupResponse };
3
+ /**
4
+ * What a lookup answers.
5
+ *
6
+ * An **optional** member is one your plan does not include. It never means "we
7
+ * could not check", so `undefined` and `false` are genuinely different answers:
8
+ * `undefined` is "not in your plan", `false` is "checked, and no". Use
9
+ * `?? false` when you only care whether the address is flagged.
10
+ *
11
+ * A detail object that is present but empty (`{}`) means the flag above it is
12
+ * false. A populated one always carries every one of its keys.
13
+ */
14
+ export interface Result {
15
+ /** The address that was looked up, normalized. */
16
+ ip: string;
17
+ /** Whether the address is VPN infrastructure. Every plan includes this. */
18
+ isVpn: boolean;
19
+ /** Set when this answer was computed locally rather than served. */
20
+ isBogon: boolean;
21
+ isHosting?: boolean;
22
+ isRelay?: boolean;
23
+ isTor?: boolean;
24
+ isCdn?: boolean;
25
+ isResproxy?: boolean;
26
+ isDcproxy?: boolean;
27
+ isMobproxy?: boolean;
28
+ vpn?: VpnDetail;
29
+ hosting?: ClassDetail;
30
+ relay?: ClassDetail;
31
+ tor?: ClassDetail;
32
+ cdn?: ClassDetail;
33
+ resproxy?: ProxyDetail;
34
+ dcproxy?: ProxyDetail;
35
+ mobproxy?: ProxyDetail;
36
+ /** The response exactly as it came off the wire, with its original names. */
37
+ raw: LookupResponse;
38
+ }
39
+ export declare function toResult(body: LookupResponse): Result;
package/dist/types.js ADDED
@@ -0,0 +1,39 @@
1
+ // The one place the wire's snake_case becomes idiomatic camelCase. Every
2
+ // assignment is conditional on the key being PRESENT rather than truthy, so a
3
+ // plan that includes a field and answers `false` keeps it, and a plan that does
4
+ // not include it stays undefined.
5
+ export function toResult(body) {
6
+ const r = {
7
+ ip: body.ip,
8
+ isVpn: body.is_vpn,
9
+ isBogon: false,
10
+ raw: body,
11
+ };
12
+ copyFlag(body, r, 'is_hosting', 'isHosting');
13
+ copyFlag(body, r, 'is_relay', 'isRelay');
14
+ copyFlag(body, r, 'is_tor', 'isTor');
15
+ copyFlag(body, r, 'is_cdn', 'isCdn');
16
+ copyFlag(body, r, 'is_resproxy', 'isResproxy');
17
+ copyFlag(body, r, 'is_dcproxy', 'isDcproxy');
18
+ copyFlag(body, r, 'is_mobproxy', 'isMobproxy');
19
+ copyDetail(body, r, 'vpn', 'vpn');
20
+ copyDetail(body, r, 'hosting', 'hosting');
21
+ copyDetail(body, r, 'relay', 'relay');
22
+ copyDetail(body, r, 'tor', 'tor');
23
+ copyDetail(body, r, 'cdn', 'cdn');
24
+ copyDetail(body, r, 'resproxy', 'resproxy');
25
+ copyDetail(body, r, 'dcproxy', 'dcproxy');
26
+ copyDetail(body, r, 'mobproxy', 'mobproxy');
27
+ return r;
28
+ }
29
+ function copyFlag(body, out, from, to) {
30
+ if (from in body && body[from] !== undefined) {
31
+ out[to] = body[from];
32
+ }
33
+ }
34
+ function copyDetail(body, out, from, to) {
35
+ if (from in body && body[from] !== undefined) {
36
+ out[to] = body[from];
37
+ }
38
+ }
39
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA8CA,yEAAyE;AACzE,8EAA8E;AAC9E,gFAAgF;AAChF,kCAAkC;AAClC,MAAM,UAAU,QAAQ,CAAC,IAAoB;IACzC,MAAM,CAAC,GAAW;QACd,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,KAAK,EAAE,IAAI,CAAC,MAAM;QAClB,OAAO,EAAE,KAAK;QACd,GAAG,EAAE,IAAI;KACZ,CAAC;IACF,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;IAC/C,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1C,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC5C,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1C,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC5C,OAAO,CAAC,CAAC;AACb,CAAC;AAED,SAAS,QAAQ,CACb,IAAoB,EAAE,GAAW,EACjC,IAA0B,EAAE,EACmB;IAE/C,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3C,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAY,CAAC;IACpC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CACf,IAAoB,EAAE,GAAW,EACjC,IAA0B,EAC1B,EAAqF;IAErF,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3C,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAU,CAAC;IAClC,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "vpndetection",
3
+ "version": "1.0.0",
4
+ "description": "Official Node.js client library for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN IPs.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "homepage": "https://vpndetection.io",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/vpndetection-io/sdk-nodejs.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/vpndetection-io/sdk-nodejs/issues"
14
+ },
15
+ "keywords": [
16
+ "vpn",
17
+ "vpn-detection",
18
+ "proxy-detection",
19
+ "tor",
20
+ "ip-intelligence",
21
+ "ip-geolocation",
22
+ "fraud-prevention",
23
+ "residential-proxy",
24
+ "mobile-proxy",
25
+ "datacenter-proxy",
26
+ "hosting",
27
+ "cdn",
28
+ "relay"
29
+ ],
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ }
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "README.md",
41
+ "LICENSE"
42
+ ],
43
+ "engines": {
44
+ "node": ">=22"
45
+ },
46
+ "dependencies": {
47
+ "lru-cache": "^11.0.2",
48
+ "p-limit": "^6.2.0",
49
+ "p-retry": "^8.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@hey-api/openapi-ts": "^0.99.0",
53
+ "@types/node": "^26.2.0",
54
+ "typescript": "^5.9.3"
55
+ },
56
+ "scripts": {
57
+ "build": "rm -rf dist && openapi-ts && tsc",
58
+ "test": "pnpm run build && node --test test/*.test.mjs",
59
+ "generate": "openapi-ts"
60
+ }
61
+ }