vpndetection 1.2.0 → 1.3.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
@@ -152,6 +152,15 @@ const bytes = await client.database.downloadBytes('cdn_ip_v1', 'csvgz');
152
152
 
153
153
  `downloadBytes` holds the whole file in memory, and the catalog runs from `cdn_ip_v1` at 10 KB to `resproxy_ip_90d_v1` at 1.79 GB, so use `download` for anything you have not measured.
154
154
 
155
+ ### Absent is not false
156
+
157
+ Only `ip` and `isVpn` come back on every plan. A field your plan does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
158
+
159
+ ```js
160
+ result.isHosting ?? false // when you only want the flag
161
+ result.isHosting === undefined // not in your plan
162
+ ```
163
+
155
164
  ## Other Libraries
156
165
 
157
166
  There are official VPNDetection client libraries available for many languages including PHP, Python, Go, Java, Ruby, and many popular frameworks such as Django, Rails, and Laravel. See our GitHub at https://github.com/vpndetection-io for more.
@@ -235,11 +235,34 @@ export type LicensedVersion = {
235
235
  */
236
236
  sampleFormats?: Array<'csvgz' | 'mmdb'>;
237
237
  };
238
+ /**
239
+ * One download ATTEMPT, refusals included - a denial is what answers "it
240
+ * stopped working", so they are listed rather than dropped.
241
+ *
242
+ */
238
243
  export type Download = {
239
244
  dataset_id: string;
240
245
  format: string;
241
246
  outcome: 'ok' | 'unauthorized' | 'denied' | 'expired' | 'unknown' | 'unavailable';
242
- bytes?: number | null;
247
+ /**
248
+ * The evaluation sample rather than the database itself.
249
+ */
250
+ sample: boolean;
251
+ /**
252
+ * Object size at redirect time, NOT bytes delivered: the transfer is a
253
+ * presigned redirect straight to object storage, so we never observe it.
254
+ *
255
+ */
256
+ bytes: number | null;
257
+ http_status: number | null;
258
+ /**
259
+ * The key that made the request. Null when the org acted through the
260
+ * console rather than through a key.
261
+ *
262
+ */
263
+ apikey_id: string | null;
264
+ client_ip: string | null;
265
+ user_agent: string | null;
243
266
  created: string;
244
267
  };
245
268
  export type DatasetMetadataColumn = {
@@ -278,6 +301,16 @@ export type DatasetMetadata = {
278
301
  size?: {
279
302
  [key: string]: number;
280
303
  };
304
+ /**
305
+ * Bytes per format of the evaluation sample, where one is published
306
+ */
307
+ sample_size?: {
308
+ [key: string]: number;
309
+ };
310
+ /**
311
+ * Row count in the evaluation sample
312
+ */
313
+ sample_entries?: number;
281
314
  };
282
315
  export type LookupIpData = {
283
316
  body?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpndetection",
3
- "version": "1.2.0",
3
+ "version": "1.3.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",