vpndetection-web 0.0.0-stage → 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 (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +267 -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 +153 -0
  8. package/dist/client.js +384 -0
  9. package/dist/errors.d.ts +55 -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 +115 -0
  40. package/dist/generated/sdk.gen.js +171 -0
  41. package/dist/generated/types.gen.d.ts +787 -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,171 @@
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` and `is_vpn`.
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
+ * 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
+ */
73
+ export const lookupBatch = (options) => (options.client ?? client).post({
74
+ security: [
75
+ {
76
+ in: 'query',
77
+ name: 'apikey',
78
+ type: 'apiKey'
79
+ },
80
+ { name: 'X-Api-Key', type: 'apiKey' },
81
+ { scheme: 'bearer', type: 'http' }
82
+ ],
83
+ url: '/batch',
84
+ ...options,
85
+ headers: {
86
+ 'Content-Type': 'application/json',
87
+ ...options.headers
88
+ }
89
+ });
90
+ /**
91
+ * Plan and usage
92
+ *
93
+ * Answers what the presented key is, what plan is behind it, and what has
94
+ * been spent against that plan's allowance in the current window.
95
+ *
96
+ */
97
+ export const myEntitlement = (options) => (options?.client ?? client).get({
98
+ security: [
99
+ {
100
+ in: 'query',
101
+ name: 'apikey',
102
+ type: 'apiKey'
103
+ },
104
+ { name: 'X-Api-Key', type: 'apiKey' },
105
+ { scheme: 'bearer', type: 'http' }
106
+ ],
107
+ url: '/api/v1/entitlement',
108
+ ...options
109
+ });
110
+ /**
111
+ * Discovery
112
+ *
113
+ * RFC 8414 authorization server metadata: the endpoints, the grant types
114
+ * and the scopes this server supports.
115
+ *
116
+ * Read this rather than hardcoding endpoints. It is also served at
117
+ * `/.well-known/openid-configuration`, identically, because several
118
+ * clients probe that path first.
119
+ *
120
+ */
121
+ export const oauthMetadata = (options) => (options?.client ?? client).get({ url: '/.well-known/oauth-authorization-server', ...options });
122
+ /**
123
+ * Token
124
+ *
125
+ * Three grant types.
126
+ *
127
+ * `urn:ietf:params:oauth:grant-type:device_code` polls a device
128
+ * authorization. Until the person approves it answers
129
+ * `authorization_pending`; poll faster than `interval` and it answers
130
+ * `slow_down`, which means widen your interval and keep it widened.
131
+ *
132
+ * `authorization_code` exchanges a code from `/oauth/authorize`, with the
133
+ * `code_verifier` matching the challenge you sent and the same
134
+ * `redirect_uri`. A code works once: presenting it again also revokes
135
+ * what the first exchange issued.
136
+ *
137
+ * `refresh_token` exchanges a refresh token. The presented token is
138
+ * consumed whatever happens next, so store the new one before using it.
139
+ * Presenting a consumed refresh token again ends the whole authorization,
140
+ * since it means the token was copied.
141
+ *
142
+ */
143
+ export const oauthToken = (options) => (options.client ?? client).post({
144
+ ...urlSearchParamsBodySerializer,
145
+ url: '/oauth/token',
146
+ ...options,
147
+ headers: {
148
+ 'Content-Type': 'application/x-www-form-urlencoded',
149
+ ...options.headers
150
+ }
151
+ });
152
+ /**
153
+ * Revoke
154
+ *
155
+ * RFC 7009. Always answers 200, including for a token that was never
156
+ * valid - an endpoint that distinguished the two would be a way to test
157
+ * whether a stolen string is a live credential.
158
+ *
159
+ * Revoking a REFRESH token ends the whole authorization and takes its
160
+ * access tokens with it. Revoking an access token affects only that token.
161
+ *
162
+ */
163
+ export const oauthRevoke = (options) => (options.client ?? client).post({
164
+ ...urlSearchParamsBodySerializer,
165
+ url: '/oauth/revoke',
166
+ ...options,
167
+ headers: {
168
+ 'Content-Type': 'application/x-www-form-urlencoded',
169
+ ...options.headers
170
+ }
171
+ });