vpndetection-web 1.3.1 → 1.4.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 +4 -1
- package/dist/generated/types.gen.d.ts +12 -3
- package/dist/shapes.d.ts +1 -1
- package/dist/shapes.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,13 +74,16 @@ It is never cached, since which address the browser is calling from is the quest
|
|
|
74
74
|
|
|
75
75
|
```js
|
|
76
76
|
const ent = await client.myEntitlement();
|
|
77
|
-
console.log(ent.plan.
|
|
77
|
+
console.log(ent.plan.name); // Max, what to show
|
|
78
|
+
console.log(ent.plan.key); // max, what to compare against
|
|
78
79
|
console.log(ent.usage.requests); // 580
|
|
79
80
|
console.log(ent.usage.window_end); // when the allowance resets
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period, and against the UTC day on the free plan; it is the same number a lookup is gated on. `hard_limit` is null on an uncapped plan, which is not the same as zero. It needs a key, so it belongs where a key does.
|
|
83
84
|
|
|
85
|
+
Show `plan.name` and compare against `plan.key`: a plan's name can change, and its key never does. A `tier` the API adds later comes back as the string it served, so check for the values you know rather than assuming the list is complete.
|
|
86
|
+
|
|
84
87
|
### Batch lookup
|
|
85
88
|
|
|
86
89
|
Look up as many addresses as you like in one call. Bogons and cached answers are handled locally, and the rest go to the batch endpoint in chunks of up to 1000, in parallel. The batch endpoint needs a paid plan:
|
|
@@ -434,15 +434,24 @@ export type EntitlementApikey = {
|
|
|
434
434
|
};
|
|
435
435
|
export type EntitlementPlan = {
|
|
436
436
|
/**
|
|
437
|
-
* The plan the organization is on
|
|
438
|
-
*
|
|
437
|
+
* The plan the organization is on, as an identifier that is never
|
|
438
|
+
* renamed or reused: `free` for the free plan, or a paid plan's key.
|
|
439
|
+
* Compare against it and show `name`. On `free`, usage counts the
|
|
439
440
|
* day's lookups answered with every field, its daily trial.
|
|
440
441
|
*
|
|
441
442
|
*/
|
|
442
443
|
key: string;
|
|
444
|
+
/**
|
|
445
|
+
* The plan's name, as the site and console show it: `Unlimited` for
|
|
446
|
+
* the free plan. Show this rather than a name built from `key`: a
|
|
447
|
+
* plan's name can change, and its key never does.
|
|
448
|
+
*
|
|
449
|
+
*/
|
|
450
|
+
name: string;
|
|
443
451
|
/**
|
|
444
452
|
* The field tier, which decides how much of a lookup answer comes
|
|
445
|
-
* back; `free` is the free plan's.
|
|
453
|
+
* back; `free` is the free plan's. This list never gains a value: a
|
|
454
|
+
* new plan reports one of these. What each tier includes is documented
|
|
446
455
|
* on the lookup endpoint rather than repeated here, so there is one
|
|
447
456
|
* place it can be wrong.
|
|
448
457
|
*
|
package/dist/shapes.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const BATCH_MEMBERS: readonly ["results", "errors"];
|
|
|
5
5
|
export declare const BATCH_ERROR_MEMBERS: readonly ["status", "error"];
|
|
6
6
|
export declare const ENTITLEMENT_MEMBERS: readonly ["org_id", "apikey", "plan", "usage"];
|
|
7
7
|
export declare const ENTITLEMENT_APIKEY_MEMBERS: readonly ["id", "allowed_cidrs"];
|
|
8
|
-
export declare const ENTITLEMENT_PLAN_MEMBERS: readonly ["key", "tier"];
|
|
8
|
+
export declare const ENTITLEMENT_PLAN_MEMBERS: readonly ["key", "name", "tier"];
|
|
9
9
|
export declare const ENTITLEMENT_USAGE_MEMBERS: readonly ["requests", "quota", "window_start", "window_end"];
|
|
10
10
|
type Kind = 'string' | 'integer' | 'boolean' | 'object' | 'array' | 'date' | 'date-time';
|
|
11
11
|
export declare const LOOKUP_TYPES: Record<string, Kind>;
|
package/dist/shapes.js
CHANGED
|
@@ -12,7 +12,7 @@ export const BATCH_MEMBERS = ['results', 'errors'];
|
|
|
12
12
|
export const BATCH_ERROR_MEMBERS = ['status', 'error'];
|
|
13
13
|
export const ENTITLEMENT_MEMBERS = ['org_id', 'apikey', 'plan', 'usage'];
|
|
14
14
|
export const ENTITLEMENT_APIKEY_MEMBERS = ['id', 'allowed_cidrs'];
|
|
15
|
-
export const ENTITLEMENT_PLAN_MEMBERS = ['key', 'tier'];
|
|
15
|
+
export const ENTITLEMENT_PLAN_MEMBERS = ['key', 'name', 'tier'];
|
|
16
16
|
export const ENTITLEMENT_USAGE_MEMBERS = ['requests', 'quota', 'window_start', 'window_end'];
|
|
17
17
|
export const LOOKUP_TYPES = {
|
|
18
18
|
ip: 'string', is_bogon: 'boolean', is_vpn: 'boolean', is_hosting: 'boolean', is_relay: 'boolean', is_tor: 'boolean',
|
|
@@ -46,7 +46,7 @@ export const ENTITLEMENT_TYPES = {
|
|
|
46
46
|
export const ENTITLEMENT_APIKEY_TYPES = {
|
|
47
47
|
id: 'string', expires: 'date-time', allowed_cidrs: 'array',
|
|
48
48
|
};
|
|
49
|
-
export const ENTITLEMENT_PLAN_TYPES = { key: 'string', tier: 'string' };
|
|
49
|
+
export const ENTITLEMENT_PLAN_TYPES = { key: 'string', name: 'string', tier: 'string' };
|
|
50
50
|
export const ENTITLEMENT_USAGE_TYPES = {
|
|
51
51
|
requests: 'integer', quota: 'integer', hard_limit: 'integer', window_start: 'date-time',
|
|
52
52
|
window_end: 'date-time',
|
package/package.json
CHANGED