internetdata-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 +282 -2
  3. package/dist/bogon.d.ts +31 -0
  4. package/dist/bogon.js +214 -0
  5. package/dist/bogons.gen.d.ts +2 -0
  6. package/dist/bogons.gen.js +87 -0
  7. package/dist/client.d.ts +183 -0
  8. package/dist/client.js +446 -0
  9. package/dist/errors.d.ts +66 -0
  10. package/dist/errors.js +185 -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 +117 -0
  40. package/dist/generated/sdk.gen.js +251 -0
  41. package/dist/generated/types.gen.d.ts +1523 -0
  42. package/dist/generated/types.gen.js +2 -0
  43. package/dist/index.d.ts +9 -0
  44. package/dist/index.js +4 -0
  45. package/dist/oauth.d.ts +119 -0
  46. package/dist/oauth.js +247 -0
  47. package/dist/shapes.d.ts +68 -0
  48. package/dist/shapes.js +283 -0
  49. package/dist/store.d.ts +39 -0
  50. package/dist/store.js +64 -0
  51. package/dist/transport.d.ts +51 -0
  52. package/dist/transport.js +147 -0
  53. package/dist/types.d.ts +115 -0
  54. package/dist/types.js +46 -0
  55. package/package.json +65 -3
@@ -0,0 +1,251 @@
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
+ * Discovery
6
+ *
7
+ * RFC 8414 authorization server metadata: the endpoints, the grant types
8
+ * and the scopes this server supports.
9
+ *
10
+ * Read this rather than hardcoding endpoints. It is also served at
11
+ * `/.well-known/openid-configuration`, identically, because several
12
+ * clients probe that path first.
13
+ *
14
+ */
15
+ export const oauthMetadata = (options) => (options?.client ?? client).get({ url: '/.well-known/oauth-authorization-server', ...options });
16
+ /**
17
+ * Token
18
+ *
19
+ * Issues tokens for three grant types: a device code, an authorization
20
+ * code and a refresh token.
21
+ *
22
+ * `urn:ietf:params:oauth:grant-type:device_code` polls a device
23
+ * authorization. Until the person approves it answers
24
+ * `authorization_pending`; poll faster than `interval` and it answers
25
+ * `slow_down`, which means widen your interval and keep it widened.
26
+ *
27
+ * `authorization_code` exchanges a code from `/oauth/authorize`, with the
28
+ * `code_verifier` matching the challenge you sent and the same
29
+ * `redirect_uri`. A code works once: presenting it again also revokes
30
+ * what the first exchange issued.
31
+ *
32
+ * `refresh_token` exchanges a refresh token. The presented token is
33
+ * consumed whatever happens next, so store the new one before using it.
34
+ * Presenting a consumed refresh token again ends the whole authorization,
35
+ * since it means the token was copied.
36
+ *
37
+ */
38
+ export const oauthToken = (options) => (options.client ?? client).post({
39
+ ...urlSearchParamsBodySerializer,
40
+ url: '/oauth/token',
41
+ ...options,
42
+ headers: {
43
+ 'Content-Type': 'application/x-www-form-urlencoded',
44
+ ...options.headers
45
+ }
46
+ });
47
+ /**
48
+ * Revoke
49
+ *
50
+ * RFC 7009. Always answers 200, even for a token that was never valid, so
51
+ * it can't be used to test whether a token is live.
52
+ *
53
+ * Revoking a refresh token ends the whole authorization and takes its
54
+ * access tokens with it. Revoking an access token affects only that token.
55
+ *
56
+ */
57
+ export const oauthRevoke = (options) => (options.client ?? client).post({
58
+ ...urlSearchParamsBodySerializer,
59
+ url: '/oauth/revoke',
60
+ ...options,
61
+ headers: {
62
+ 'Content-Type': 'application/x-www-form-urlencoded',
63
+ ...options.headers
64
+ }
65
+ });
66
+ /**
67
+ * IP lookup
68
+ *
69
+ * Answers what every database says about one IPv4 or IPv6 address. Which fields come back is
70
+ * decided by the presented key; with no key, on Unlimited, the free plan, the answer carries the fields in
71
+ * the address table's unlimited column. The path also takes `AS15169` or a domain, as internetdata.io's
72
+ * pages do, and then answers as `GET /asn/{asn}` or `GET /domain/{domain}` would.
73
+ *
74
+ */
75
+ export const lookupIp = (options) => (options.client ?? client).get({
76
+ security: [
77
+ {
78
+ key: 'apiKeyQuery',
79
+ in: 'query',
80
+ name: 'apikey',
81
+ type: 'apiKey'
82
+ },
83
+ {
84
+ key: 'apiKeyHeader',
85
+ name: 'X-Api-Key',
86
+ type: 'apiKey'
87
+ },
88
+ {
89
+ key: 'bearerAuth',
90
+ scheme: 'bearer',
91
+ type: 'http'
92
+ }
93
+ ],
94
+ url: '/{ip}',
95
+ ...options
96
+ });
97
+ /**
98
+ * My IP
99
+ *
100
+ * The address you are calling from, answered as `GET /{ip}` would answer it, and charged as
101
+ * that lookup is.
102
+ *
103
+ */
104
+ export const lookupMyIp = (options) => (options?.client ?? client).get({
105
+ security: [
106
+ {
107
+ key: 'apiKeyQuery',
108
+ in: 'query',
109
+ name: 'apikey',
110
+ type: 'apiKey'
111
+ },
112
+ {
113
+ key: 'apiKeyHeader',
114
+ name: 'X-Api-Key',
115
+ type: 'apiKey'
116
+ },
117
+ {
118
+ key: 'bearerAuth',
119
+ scheme: 'bearer',
120
+ type: 'http'
121
+ }
122
+ ],
123
+ url: '/myip',
124
+ ...options
125
+ });
126
+ /**
127
+ * ASN lookup
128
+ *
129
+ * Answers what InternetData knows about one autonomous system: its registration on every plan,
130
+ * and on a paid one its ASN Whois record and every prefix it announces in global BGP, with RPKI status,
131
+ * up to 20000 per address family (the counts beside them are always whole). An AS no database knows answers
132
+ * its number with empty values.
133
+ *
134
+ */
135
+ export const lookupAsn = (options) => (options.client ?? client).get({
136
+ security: [
137
+ {
138
+ key: 'apiKeyQuery',
139
+ in: 'query',
140
+ name: 'apikey',
141
+ type: 'apiKey'
142
+ },
143
+ {
144
+ key: 'apiKeyHeader',
145
+ name: 'X-Api-Key',
146
+ type: 'apiKey'
147
+ },
148
+ {
149
+ key: 'bearerAuth',
150
+ scheme: 'bearer',
151
+ type: 'http'
152
+ }
153
+ ],
154
+ url: '/asn/{asn}',
155
+ ...options
156
+ });
157
+ /**
158
+ * Domain lookup
159
+ *
160
+ * Answers what InternetData knows about one domain from its latest snapshots: on every plan
161
+ * whether it is registered and which DNS record types it has; on a paid one the records themselves, up to
162
+ * 100 a type, the organization's IP ranges and whether it is a disposable email domain. An internationalized
163
+ * name is answered under its punycode spelling.
164
+ *
165
+ */
166
+ export const lookupDomain = (options) => (options.client ?? client).get({
167
+ security: [
168
+ {
169
+ key: 'apiKeyQuery',
170
+ in: 'query',
171
+ name: 'apikey',
172
+ type: 'apiKey'
173
+ },
174
+ {
175
+ key: 'apiKeyHeader',
176
+ name: 'X-Api-Key',
177
+ type: 'apiKey'
178
+ },
179
+ {
180
+ key: 'bearerAuth',
181
+ scheme: 'bearer',
182
+ type: 'http'
183
+ }
184
+ ],
185
+ url: '/domain/{domain}',
186
+ ...options
187
+ });
188
+ /**
189
+ * Batch
190
+ *
191
+ * Up to 1000 addresses, AS numbers and domains in one call, each answered exactly as its own
192
+ * lookup would be and each counted as one lookup. Answers and failures are keyed by the string you sent, in
193
+ * the order you sent them; duplicates collapse. Needs a paid plan: a batch of one item is answered as the
194
+ * lookup it is on any plan.
195
+ *
196
+ */
197
+ export const lookupBatch = (options) => (options.client ?? client).post({
198
+ security: [
199
+ {
200
+ key: 'apiKeyQuery',
201
+ in: 'query',
202
+ name: 'apikey',
203
+ type: 'apiKey'
204
+ },
205
+ {
206
+ key: 'apiKeyHeader',
207
+ name: 'X-Api-Key',
208
+ type: 'apiKey'
209
+ },
210
+ {
211
+ key: 'bearerAuth',
212
+ scheme: 'bearer',
213
+ type: 'http'
214
+ }
215
+ ],
216
+ url: '/batch',
217
+ ...options,
218
+ headers: {
219
+ 'Content-Type': 'application/json',
220
+ ...options.headers
221
+ }
222
+ });
223
+ /**
224
+ * Plan and usage
225
+ *
226
+ * Answers what the presented key is, what plan is behind it, and what has
227
+ * been spent against that plan's allowance in the current window.
228
+ *
229
+ */
230
+ export const myEntitlement = (options) => (options?.client ?? client).get({
231
+ security: [
232
+ {
233
+ key: 'apiKeyQuery',
234
+ in: 'query',
235
+ name: 'apikey',
236
+ type: 'apiKey'
237
+ },
238
+ {
239
+ key: 'apiKeyHeader',
240
+ name: 'X-Api-Key',
241
+ type: 'apiKey'
242
+ },
243
+ {
244
+ key: 'bearerAuth',
245
+ scheme: 'bearer',
246
+ type: 'http'
247
+ }
248
+ ],
249
+ url: '/api/v1/entitlement',
250
+ ...options
251
+ });