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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +268 -2
  3. package/dist/bogon.d.ts +28 -0
  4. package/dist/bogon.js +164 -0
  5. package/dist/bogons.gen.d.ts +2 -0
  6. package/dist/bogons.gen.js +87 -0
  7. package/dist/client.d.ts +156 -0
  8. package/dist/client.js +386 -0
  9. package/dist/errors.d.ts +56 -0
  10. package/dist/errors.js +178 -0
  11. package/dist/generated/client/client.gen.d.ts +2 -0
  12. package/dist/generated/client/client.gen.js +216 -0
  13. package/dist/generated/client/index.d.ts +10 -0
  14. package/dist/generated/client/index.js +6 -0
  15. package/dist/generated/client/types.gen.d.ts +120 -0
  16. package/dist/generated/client/types.gen.js +2 -0
  17. package/dist/generated/client/utils.gen.d.ts +37 -0
  18. package/dist/generated/client/utils.gen.js +228 -0
  19. package/dist/generated/client.gen.d.ts +12 -0
  20. package/dist/generated/client.gen.js +3 -0
  21. package/dist/generated/core/auth.gen.d.ts +25 -0
  22. package/dist/generated/core/auth.gen.js +14 -0
  23. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  24. package/dist/generated/core/bodySerializer.gen.js +57 -0
  25. package/dist/generated/core/params.gen.d.ts +43 -0
  26. package/dist/generated/core/params.gen.js +109 -0
  27. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  28. package/dist/generated/core/pathSerializer.gen.js +106 -0
  29. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  30. package/dist/generated/core/queryKeySerializer.gen.js +92 -0
  31. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  32. package/dist/generated/core/serverSentEvents.gen.js +132 -0
  33. package/dist/generated/core/types.gen.d.ts +83 -0
  34. package/dist/generated/core/types.gen.js +2 -0
  35. package/dist/generated/core/utils.gen.d.ts +19 -0
  36. package/dist/generated/core/utils.gen.js +87 -0
  37. package/dist/generated/index.d.ts +2 -0
  38. package/dist/generated/index.js +2 -0
  39. package/dist/generated/sdk.gen.d.ts +118 -0
  40. package/dist/generated/sdk.gen.js +174 -0
  41. package/dist/generated/types.gen.d.ts +790 -0
  42. package/dist/generated/types.gen.js +2 -0
  43. package/dist/index.d.ts +10 -0
  44. package/dist/index.js +4 -0
  45. package/dist/oauth.d.ts +114 -0
  46. package/dist/oauth.js +245 -0
  47. package/dist/shapes.d.ts +28 -0
  48. package/dist/shapes.js +133 -0
  49. package/dist/store.d.ts +39 -0
  50. package/dist/store.js +64 -0
  51. package/dist/transport.d.ts +47 -0
  52. package/dist/transport.js +140 -0
  53. package/dist/types.d.ts +48 -0
  54. package/dist/types.js +42 -0
  55. package/package.json +65 -3
@@ -0,0 +1,174 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen.js';
3
+ import { urlSearchParamsBodySerializer } from './client/index.js';
4
+ /**
5
+ * Lookup
6
+ *
7
+ * Answers what is known about a single IPv4 or IPv6 address. Which fields
8
+ * come back is decided by the presented key; with no key the answer is
9
+ * `ip`, `is_vpn`, the Tor and relay members, `location` and `asn`.
10
+ *
11
+ */
12
+ export const lookupIp = (options) => (options.client ?? client).get({
13
+ security: [
14
+ {
15
+ in: 'query',
16
+ name: 'apikey',
17
+ type: 'apiKey'
18
+ },
19
+ { name: 'X-Api-Key', type: 'apiKey' },
20
+ { scheme: 'bearer', type: 'http' }
21
+ ],
22
+ url: '/{ip}',
23
+ ...options
24
+ });
25
+ /**
26
+ * My IP
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 presented key
30
+ * decides which fields come back, and the request counts against the same
31
+ * limit or 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 const lookupMyIp = (options) => (options?.client ?? client).get({
39
+ security: [
40
+ {
41
+ in: 'query',
42
+ name: 'apikey',
43
+ type: 'apiKey'
44
+ },
45
+ { name: 'X-Api-Key', type: 'apiKey' },
46
+ { scheme: 'bearer', type: 'http' }
47
+ ],
48
+ url: '/myip',
49
+ ...options
50
+ });
51
+ /**
52
+ * Batch
53
+ *
54
+ * Answers up to 1000 addresses in one call. Each distinct string in `ips`
55
+ * is one lookup: it costs exactly what `GET /{ip}` costs for that address
56
+ * and comes back with exactly the fields that call would carry for your
57
+ * plan. Exact duplicates collapse to one entry and one lookup.
58
+ *
59
+ * Both maps in the answer are keyed by the string you sent, so nothing has
60
+ * to be lined up by position; the `ip` inside each result is the
61
+ * normalized form. An address that could not be answered sits in `errors`
62
+ * with the status and message the single lookup would have given, and
63
+ * never disturbs the others: a string that is not an address is a `400`
64
+ * there, and an allowance that runs out part way through leaves the
65
+ * remaining entries as `429`s.
66
+ *
67
+ * The call itself fails only for the reasons below, and a `429` on the
68
+ * call always carries `Retry-After`: the batch is admitted or refused
69
+ * whole by the rate limit, so a per-entry `429` is always a spent
70
+ * allowance and never a throttle.
71
+ *
72
+ * A batch needs an API key, a free one included: without one the call is
73
+ * refused with `401`. Keyless lookups are one address at a time.
74
+ *
75
+ */
76
+ export const lookupBatch = (options) => (options.client ?? client).post({
77
+ security: [
78
+ {
79
+ in: 'query',
80
+ name: 'apikey',
81
+ type: 'apiKey'
82
+ },
83
+ { name: 'X-Api-Key', type: 'apiKey' },
84
+ { scheme: 'bearer', type: 'http' }
85
+ ],
86
+ url: '/batch',
87
+ ...options,
88
+ headers: {
89
+ 'Content-Type': 'application/json',
90
+ ...options.headers
91
+ }
92
+ });
93
+ /**
94
+ * Plan and usage
95
+ *
96
+ * Answers what the presented key is, what plan is behind it, and what has
97
+ * been spent against that plan's allowance in the current window.
98
+ *
99
+ */
100
+ export const myEntitlement = (options) => (options?.client ?? client).get({
101
+ security: [
102
+ {
103
+ in: 'query',
104
+ name: 'apikey',
105
+ type: 'apiKey'
106
+ },
107
+ { name: 'X-Api-Key', type: 'apiKey' },
108
+ { scheme: 'bearer', type: 'http' }
109
+ ],
110
+ url: '/api/v1/entitlement',
111
+ ...options
112
+ });
113
+ /**
114
+ * Discovery
115
+ *
116
+ * RFC 8414 authorization server metadata: the endpoints, the grant types
117
+ * and the scopes this server supports.
118
+ *
119
+ * Read this rather than hardcoding endpoints. It is also served at
120
+ * `/.well-known/openid-configuration`, identically, because several
121
+ * clients probe that path first.
122
+ *
123
+ */
124
+ export const oauthMetadata = (options) => (options?.client ?? client).get({ url: '/.well-known/oauth-authorization-server', ...options });
125
+ /**
126
+ * Token
127
+ *
128
+ * Issues tokens for three grant types: a device code, an authorization
129
+ * code and a refresh token.
130
+ *
131
+ * `urn:ietf:params:oauth:grant-type:device_code` polls a device
132
+ * authorization. Until the person approves it answers
133
+ * `authorization_pending`; poll faster than `interval` and it answers
134
+ * `slow_down`, which means widen your interval and keep it widened.
135
+ *
136
+ * `authorization_code` exchanges a code from `/oauth/authorize`, with the
137
+ * `code_verifier` matching the challenge you sent and the same
138
+ * `redirect_uri`. A code works once: presenting it again also revokes
139
+ * what the first exchange issued.
140
+ *
141
+ * `refresh_token` exchanges a refresh token. The presented token is
142
+ * consumed whatever happens next, so store the new one before using it.
143
+ * Presenting a consumed refresh token again ends the whole authorization,
144
+ * since it means the token was copied.
145
+ *
146
+ */
147
+ export const oauthToken = (options) => (options.client ?? client).post({
148
+ ...urlSearchParamsBodySerializer,
149
+ url: '/oauth/token',
150
+ ...options,
151
+ headers: {
152
+ 'Content-Type': 'application/x-www-form-urlencoded',
153
+ ...options.headers
154
+ }
155
+ });
156
+ /**
157
+ * Revoke
158
+ *
159
+ * RFC 7009. Always answers 200, even for a token that was never valid, so
160
+ * it can't be used to test whether a token is live.
161
+ *
162
+ * Revoking a refresh token ends the whole authorization and takes its
163
+ * access tokens with it. Revoking an access token affects only that token.
164
+ *
165
+ */
166
+ export const oauthRevoke = (options) => (options.client ?? client).post({
167
+ ...urlSearchParamsBodySerializer,
168
+ url: '/oauth/revoke',
169
+ ...options,
170
+ headers: {
171
+ 'Content-Type': 'application/x-www-form-urlencoded',
172
+ ...options.headers
173
+ }
174
+ });