@twin.org/web 0.0.1-next.9 → 0.0.2-next.3
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/dist/cjs/index.cjs +298 -94
- package/dist/esm/index.mjs +299 -96
- package/dist/types/index.d.ts +3 -1
- package/dist/types/models/IJwk.d.ts +2 -58
- package/dist/types/models/IJwtHeader.d.ts +2 -18
- package/dist/types/models/IJwtPayload.d.ts +2 -33
- package/dist/types/models/jwkCryptoKey.d.ts +4 -0
- package/dist/types/models/mimeTypes.d.ts +8 -0
- package/dist/types/utils/fetchHelper.d.ts +7 -0
- package/dist/types/utils/jwk.d.ts +41 -0
- package/dist/types/utils/jws.d.ts +22 -0
- package/dist/types/utils/jwt.d.ts +67 -29
- package/docs/changelog.md +480 -1
- package/docs/reference/classes/FetchError.md +16 -8
- package/docs/reference/classes/FetchHelper.md +104 -28
- package/docs/reference/classes/Jwk.md +129 -0
- package/docs/reference/classes/Jws.md +81 -0
- package/docs/reference/classes/Jwt.md +261 -105
- package/docs/reference/classes/MimeTypeHelper.md +9 -5
- package/docs/reference/index.md +3 -2
- package/docs/reference/interfaces/IHttpHeaders.md +1 -1
- package/docs/reference/interfaces/IJwk.md +2 -106
- package/docs/reference/interfaces/IJwtHeader.md +5 -23
- package/docs/reference/interfaces/IJwtPayload.md +5 -55
- package/docs/reference/type-aliases/HeaderTypes.md +1 -1
- package/docs/reference/type-aliases/HttpMethod.md +1 -1
- package/docs/reference/type-aliases/HttpStatusCode.md +1 -1
- package/docs/reference/type-aliases/JwkCryptoKey.md +5 -0
- package/docs/reference/type-aliases/MimeTypes.md +1 -1
- package/docs/reference/variables/MimeTypes.md +12 -0
- package/locales/en.json +11 -1
- package/package.json +7 -6
- package/dist/types/models/jwtAlgorithms.d.ts +0 -17
- package/docs/reference/type-aliases/JwtAlgorithms.md +0 -5
- package/docs/reference/variables/JwtAlgorithms.md +0 -19
|
@@ -1,42 +1,52 @@
|
|
|
1
1
|
# Class: Jwt
|
|
2
2
|
|
|
3
|
-
Class to
|
|
3
|
+
Class to handle JSON Web Tokens.
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Jwt**():
|
|
9
|
+
> **new Jwt**(): `Jwt`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Jwt`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### encode()
|
|
18
18
|
|
|
19
|
-
> `static` **encode**\<`
|
|
19
|
+
> `static` **encode**\<`T`, `U`\>(`header`, `payload`, `key`): `Promise`\<`string`\>
|
|
20
20
|
|
|
21
21
|
Encode a token.
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
28
|
+
|
|
29
|
+
##### U
|
|
30
|
+
|
|
31
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
28
32
|
|
|
29
33
|
#### Parameters
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
##### header
|
|
36
|
+
|
|
37
|
+
`T`
|
|
32
38
|
|
|
33
39
|
The header to encode.
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
##### payload
|
|
42
|
+
|
|
43
|
+
`U`
|
|
36
44
|
|
|
37
45
|
The payload to encode.
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
##### key
|
|
48
|
+
|
|
49
|
+
[`JwkCryptoKey`](../type-aliases/JwkCryptoKey.md)
|
|
40
50
|
|
|
41
51
|
The key for signing the token, can be omitted if a signer is provided.
|
|
42
52
|
|
|
@@ -50,27 +60,37 @@ The encoded token.
|
|
|
50
60
|
|
|
51
61
|
### encodeWithSigner()
|
|
52
62
|
|
|
53
|
-
> `static` **encodeWithSigner**\<`
|
|
63
|
+
> `static` **encodeWithSigner**\<`T`, `U`\>(`header`, `payload`, `signer`): `Promise`\<`string`\>
|
|
54
64
|
|
|
55
65
|
Encode a token.
|
|
56
66
|
|
|
57
67
|
#### Type Parameters
|
|
58
68
|
|
|
59
|
-
|
|
69
|
+
##### T
|
|
60
70
|
|
|
61
|
-
|
|
71
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
72
|
+
|
|
73
|
+
##### U
|
|
74
|
+
|
|
75
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
62
76
|
|
|
63
77
|
#### Parameters
|
|
64
78
|
|
|
65
|
-
|
|
79
|
+
##### header
|
|
80
|
+
|
|
81
|
+
`T`
|
|
66
82
|
|
|
67
83
|
The header to encode.
|
|
68
84
|
|
|
69
|
-
|
|
85
|
+
##### payload
|
|
86
|
+
|
|
87
|
+
`U`
|
|
70
88
|
|
|
71
89
|
The payload to encode.
|
|
72
90
|
|
|
73
|
-
|
|
91
|
+
##### signer
|
|
92
|
+
|
|
93
|
+
(`header`, `payload`, `key`) => `Promise`\<`string`\>
|
|
74
94
|
|
|
75
95
|
Custom signer method.
|
|
76
96
|
|
|
@@ -84,230 +104,366 @@ The encoded token.
|
|
|
84
104
|
|
|
85
105
|
### decode()
|
|
86
106
|
|
|
87
|
-
> `static` **decode**\<`
|
|
107
|
+
> `static` **decode**\<`T`, `U`\>(`token`): `Promise`\<\{ `header?`: `T`; `payload?`: `U`; `signature?`: `Uint8Array`\<`ArrayBufferLike`\>; \}\>
|
|
88
108
|
|
|
89
109
|
Decode a token.
|
|
90
110
|
|
|
91
111
|
#### Type Parameters
|
|
92
112
|
|
|
93
|
-
|
|
113
|
+
##### T
|
|
114
|
+
|
|
115
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
116
|
+
|
|
117
|
+
##### U
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
96
120
|
|
|
97
121
|
#### Parameters
|
|
98
122
|
|
|
99
|
-
|
|
123
|
+
##### token
|
|
124
|
+
|
|
125
|
+
`string`
|
|
100
126
|
|
|
101
127
|
The token to decode.
|
|
102
128
|
|
|
103
129
|
#### Returns
|
|
104
130
|
|
|
105
|
-
`Promise`\<`
|
|
131
|
+
`Promise`\<\{ `header?`: `T`; `payload?`: `U`; `signature?`: `Uint8Array`\<`ArrayBufferLike`\>; \}\>
|
|
106
132
|
|
|
107
133
|
The decoded payload.
|
|
108
134
|
|
|
109
|
-
|
|
135
|
+
***
|
|
110
136
|
|
|
111
|
-
|
|
137
|
+
### verify()
|
|
138
|
+
|
|
139
|
+
> `static` **verify**\<`T`, `U`\>(`token`, `key`): `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
112
140
|
|
|
113
|
-
|
|
141
|
+
Verify a token.
|
|
114
142
|
|
|
115
|
-
|
|
143
|
+
#### Type Parameters
|
|
116
144
|
|
|
117
|
-
#####
|
|
145
|
+
##### T
|
|
118
146
|
|
|
119
|
-
|
|
147
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
148
|
+
|
|
149
|
+
##### U
|
|
150
|
+
|
|
151
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
152
|
+
|
|
153
|
+
#### Parameters
|
|
154
|
+
|
|
155
|
+
##### token
|
|
156
|
+
|
|
157
|
+
`string`
|
|
158
|
+
|
|
159
|
+
The token to verify.
|
|
160
|
+
|
|
161
|
+
##### key
|
|
162
|
+
|
|
163
|
+
[`JwkCryptoKey`](../type-aliases/JwkCryptoKey.md)
|
|
164
|
+
|
|
165
|
+
The key for verifying the token
|
|
166
|
+
|
|
167
|
+
#### Returns
|
|
168
|
+
|
|
169
|
+
`Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
170
|
+
|
|
171
|
+
The decoded payload.
|
|
120
172
|
|
|
121
173
|
***
|
|
122
174
|
|
|
123
|
-
###
|
|
175
|
+
### verifyWithVerifier()
|
|
124
176
|
|
|
125
|
-
> `static` **
|
|
177
|
+
> `static` **verifyWithVerifier**\<`T`, `U`\>(`token`, `verifier`): `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
126
178
|
|
|
127
179
|
Verify a token.
|
|
128
180
|
|
|
129
181
|
#### Type Parameters
|
|
130
182
|
|
|
131
|
-
|
|
183
|
+
##### T
|
|
184
|
+
|
|
185
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
132
186
|
|
|
133
|
-
|
|
187
|
+
##### U
|
|
188
|
+
|
|
189
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
134
190
|
|
|
135
191
|
#### Parameters
|
|
136
192
|
|
|
137
|
-
|
|
193
|
+
##### token
|
|
194
|
+
|
|
195
|
+
`string`
|
|
138
196
|
|
|
139
197
|
The token to verify.
|
|
140
198
|
|
|
141
|
-
|
|
199
|
+
##### verifier
|
|
142
200
|
|
|
143
|
-
|
|
201
|
+
(`token`, `key`) => `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
202
|
+
|
|
203
|
+
Custom verification method.
|
|
144
204
|
|
|
145
205
|
#### Returns
|
|
146
206
|
|
|
147
|
-
`Promise
|
|
207
|
+
`Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
148
208
|
|
|
149
209
|
The decoded payload.
|
|
150
210
|
|
|
151
|
-
|
|
211
|
+
***
|
|
212
|
+
|
|
213
|
+
### verifySignature()
|
|
152
214
|
|
|
153
|
-
> **
|
|
215
|
+
> `static` **verifySignature**\<`T`, `U`\>(`token`, `key?`, `verifier?`): `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
154
216
|
|
|
155
|
-
|
|
217
|
+
Verify a token by parts.
|
|
156
218
|
|
|
157
|
-
|
|
219
|
+
#### Type Parameters
|
|
158
220
|
|
|
159
|
-
#####
|
|
221
|
+
##### T
|
|
160
222
|
|
|
161
|
-
|
|
223
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
162
224
|
|
|
163
|
-
#####
|
|
225
|
+
##### U
|
|
164
226
|
|
|
165
|
-
|
|
227
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
228
|
+
|
|
229
|
+
#### Parameters
|
|
230
|
+
|
|
231
|
+
##### token
|
|
232
|
+
|
|
233
|
+
`string`
|
|
234
|
+
|
|
235
|
+
The token to verify.
|
|
236
|
+
|
|
237
|
+
##### key?
|
|
238
|
+
|
|
239
|
+
[`JwkCryptoKey`](../type-aliases/JwkCryptoKey.md)
|
|
240
|
+
|
|
241
|
+
The key for verifying the token, if not provided no verification occurs.
|
|
242
|
+
|
|
243
|
+
##### verifier?
|
|
244
|
+
|
|
245
|
+
(`token`, `key`) => `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
246
|
+
|
|
247
|
+
Custom verification method.
|
|
248
|
+
|
|
249
|
+
#### Returns
|
|
250
|
+
|
|
251
|
+
`Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
252
|
+
|
|
253
|
+
True if the parts are verified.
|
|
166
254
|
|
|
167
255
|
***
|
|
168
256
|
|
|
169
|
-
###
|
|
257
|
+
### defaultSigner()
|
|
170
258
|
|
|
171
|
-
> `static` **
|
|
259
|
+
> `static` **defaultSigner**(`header`, `payload`, `key`): `Promise`\<`string`\>
|
|
172
260
|
|
|
173
|
-
|
|
261
|
+
The default signer for the JWT.
|
|
262
|
+
|
|
263
|
+
#### Parameters
|
|
264
|
+
|
|
265
|
+
##### header
|
|
266
|
+
|
|
267
|
+
[`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
268
|
+
|
|
269
|
+
The header to sign.
|
|
270
|
+
|
|
271
|
+
##### payload
|
|
272
|
+
|
|
273
|
+
[`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
274
|
+
|
|
275
|
+
The payload to sign.
|
|
276
|
+
|
|
277
|
+
##### key
|
|
278
|
+
|
|
279
|
+
The optional key to sign with.
|
|
280
|
+
|
|
281
|
+
`undefined` | [`JwkCryptoKey`](../type-aliases/JwkCryptoKey.md)
|
|
282
|
+
|
|
283
|
+
#### Returns
|
|
284
|
+
|
|
285
|
+
`Promise`\<`string`\>
|
|
286
|
+
|
|
287
|
+
The signature.
|
|
288
|
+
|
|
289
|
+
***
|
|
290
|
+
|
|
291
|
+
### defaultVerifier()
|
|
292
|
+
|
|
293
|
+
> `static` **defaultVerifier**\<`T`, `U`\>(`token`, `key`): `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
294
|
+
|
|
295
|
+
The default verifier for the JWT.
|
|
174
296
|
|
|
175
297
|
#### Type Parameters
|
|
176
298
|
|
|
177
|
-
|
|
299
|
+
##### T
|
|
300
|
+
|
|
301
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
178
302
|
|
|
179
|
-
|
|
303
|
+
##### U
|
|
304
|
+
|
|
305
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
180
306
|
|
|
181
307
|
#### Parameters
|
|
182
308
|
|
|
183
|
-
|
|
309
|
+
##### token
|
|
310
|
+
|
|
311
|
+
`string`
|
|
184
312
|
|
|
185
313
|
The token to verify.
|
|
186
314
|
|
|
187
|
-
|
|
315
|
+
##### key
|
|
188
316
|
|
|
189
|
-
|
|
317
|
+
The key to verify with.
|
|
318
|
+
|
|
319
|
+
`undefined` | [`JwkCryptoKey`](../type-aliases/JwkCryptoKey.md)
|
|
190
320
|
|
|
191
321
|
#### Returns
|
|
192
322
|
|
|
193
|
-
`Promise
|
|
323
|
+
`Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
194
324
|
|
|
195
|
-
The
|
|
325
|
+
The header and payload if verification successful.
|
|
196
326
|
|
|
197
|
-
|
|
327
|
+
***
|
|
198
328
|
|
|
199
|
-
|
|
329
|
+
### toSigningBytes()
|
|
200
330
|
|
|
201
|
-
|
|
331
|
+
> `static` **toSigningBytes**\<`T`, `U`\>(`header`, `payload`): `Uint8Array`
|
|
202
332
|
|
|
203
|
-
|
|
333
|
+
Create bytes for signing from header and payload.
|
|
204
334
|
|
|
205
|
-
|
|
335
|
+
#### Type Parameters
|
|
206
336
|
|
|
207
|
-
|
|
337
|
+
##### T
|
|
208
338
|
|
|
209
|
-
|
|
339
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
210
340
|
|
|
211
|
-
|
|
341
|
+
##### U
|
|
342
|
+
|
|
343
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
344
|
+
|
|
345
|
+
#### Parameters
|
|
346
|
+
|
|
347
|
+
##### header
|
|
348
|
+
|
|
349
|
+
`T`
|
|
350
|
+
|
|
351
|
+
The header.
|
|
352
|
+
|
|
353
|
+
##### payload
|
|
354
|
+
|
|
355
|
+
`U`
|
|
356
|
+
|
|
357
|
+
The payload.
|
|
358
|
+
|
|
359
|
+
#### Returns
|
|
360
|
+
|
|
361
|
+
`Uint8Array`
|
|
362
|
+
|
|
363
|
+
The bytes to sign.
|
|
212
364
|
|
|
213
365
|
***
|
|
214
366
|
|
|
215
|
-
###
|
|
367
|
+
### fromSigningBytes()
|
|
216
368
|
|
|
217
|
-
> `static` **
|
|
369
|
+
> `static` **fromSigningBytes**\<`T`, `U`\>(`signingBytes`): `object`
|
|
218
370
|
|
|
219
|
-
|
|
371
|
+
Create header and payload from signing bytes.
|
|
220
372
|
|
|
221
373
|
#### Type Parameters
|
|
222
374
|
|
|
223
|
-
|
|
375
|
+
##### T
|
|
224
376
|
|
|
225
|
-
|
|
377
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
226
378
|
|
|
227
|
-
|
|
379
|
+
##### U
|
|
380
|
+
|
|
381
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
228
382
|
|
|
229
|
-
|
|
383
|
+
#### Parameters
|
|
230
384
|
|
|
231
|
-
|
|
385
|
+
##### signingBytes
|
|
232
386
|
|
|
233
|
-
|
|
387
|
+
`Uint8Array`
|
|
234
388
|
|
|
235
|
-
The
|
|
389
|
+
The signing bytes from a token.
|
|
236
390
|
|
|
237
|
-
|
|
391
|
+
#### Returns
|
|
238
392
|
|
|
239
|
-
|
|
393
|
+
`object`
|
|
240
394
|
|
|
241
|
-
|
|
395
|
+
The header and payload.
|
|
242
396
|
|
|
243
|
-
|
|
397
|
+
##### header
|
|
244
398
|
|
|
245
|
-
|
|
399
|
+
> **header**: `T`
|
|
246
400
|
|
|
247
|
-
|
|
401
|
+
##### payload
|
|
248
402
|
|
|
249
|
-
|
|
403
|
+
> **payload**: `U`
|
|
250
404
|
|
|
251
|
-
|
|
405
|
+
#### Throws
|
|
252
406
|
|
|
253
|
-
|
|
407
|
+
If the signing bytes are invalid
|
|
254
408
|
|
|
255
409
|
***
|
|
256
410
|
|
|
257
|
-
###
|
|
411
|
+
### tokenFromBytes()
|
|
258
412
|
|
|
259
|
-
> `static` **
|
|
413
|
+
> `static` **tokenFromBytes**(`signingBytes`, `signature`): `string`
|
|
260
414
|
|
|
261
|
-
|
|
415
|
+
Convert signed bytes and signature bytes to token.
|
|
262
416
|
|
|
263
417
|
#### Parameters
|
|
264
418
|
|
|
265
|
-
|
|
419
|
+
##### signingBytes
|
|
266
420
|
|
|
267
|
-
|
|
421
|
+
`Uint8Array`
|
|
268
422
|
|
|
269
|
-
|
|
423
|
+
The signed bytes.
|
|
270
424
|
|
|
271
|
-
|
|
425
|
+
##### signature
|
|
272
426
|
|
|
273
|
-
|
|
427
|
+
`Uint8Array`
|
|
274
428
|
|
|
275
|
-
The
|
|
429
|
+
The signature.
|
|
276
430
|
|
|
277
431
|
#### Returns
|
|
278
432
|
|
|
279
|
-
`
|
|
433
|
+
`string`
|
|
280
434
|
|
|
281
|
-
The
|
|
435
|
+
The token.
|
|
282
436
|
|
|
283
437
|
***
|
|
284
438
|
|
|
285
|
-
###
|
|
439
|
+
### tokenToBytes()
|
|
286
440
|
|
|
287
|
-
> `static` **
|
|
441
|
+
> `static` **tokenToBytes**(`token`): `object`
|
|
288
442
|
|
|
289
|
-
|
|
443
|
+
Convert the token to signing bytes and signature bytes.
|
|
290
444
|
|
|
291
445
|
#### Parameters
|
|
292
446
|
|
|
293
|
-
|
|
447
|
+
##### token
|
|
294
448
|
|
|
295
|
-
|
|
449
|
+
`string`
|
|
296
450
|
|
|
297
|
-
|
|
451
|
+
The token to convert to bytes.
|
|
298
452
|
|
|
299
|
-
|
|
453
|
+
#### Returns
|
|
300
454
|
|
|
301
|
-
|
|
455
|
+
`object`
|
|
302
456
|
|
|
303
|
-
The
|
|
457
|
+
The decoded bytes.
|
|
304
458
|
|
|
305
|
-
|
|
459
|
+
##### signingBytes
|
|
306
460
|
|
|
307
|
-
|
|
461
|
+
> **signingBytes**: `Uint8Array`
|
|
308
462
|
|
|
309
|
-
|
|
463
|
+
##### signature
|
|
464
|
+
|
|
465
|
+
> **signature**: `Uint8Array`
|
|
310
466
|
|
|
311
|
-
|
|
467
|
+
#### Throws
|
|
312
468
|
|
|
313
|
-
|
|
469
|
+
If the token is invalid.
|
|
@@ -4,13 +4,13 @@ Class to help with mime types.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new MimeTypeHelper**():
|
|
9
|
+
> **new MimeTypeHelper**(): `MimeTypeHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`MimeTypeHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -22,7 +22,9 @@ Detect the mime type from a byte array.
|
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### data
|
|
26
|
+
|
|
27
|
+
`Uint8Array`
|
|
26
28
|
|
|
27
29
|
The data to test.
|
|
28
30
|
|
|
@@ -42,10 +44,12 @@ Return the default extension for a mime type.
|
|
|
42
44
|
|
|
43
45
|
#### Parameters
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
##### mimeType
|
|
46
48
|
|
|
47
49
|
The mimetype to get the extension for.
|
|
48
50
|
|
|
51
|
+
`undefined` | `string`
|
|
52
|
+
|
|
49
53
|
#### Returns
|
|
50
54
|
|
|
51
55
|
`undefined` \| `string`
|
package/docs/reference/index.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
- [FetchError](classes/FetchError.md)
|
|
6
6
|
- [FetchHelper](classes/FetchHelper.md)
|
|
7
|
+
- [Jwk](classes/Jwk.md)
|
|
8
|
+
- [Jws](classes/Jws.md)
|
|
7
9
|
- [Jwt](classes/Jwt.md)
|
|
8
10
|
- [MimeTypeHelper](classes/MimeTypeHelper.md)
|
|
9
11
|
|
|
@@ -20,7 +22,7 @@
|
|
|
20
22
|
- [HeaderTypes](type-aliases/HeaderTypes.md)
|
|
21
23
|
- [HttpMethod](type-aliases/HttpMethod.md)
|
|
22
24
|
- [HttpStatusCode](type-aliases/HttpStatusCode.md)
|
|
23
|
-
- [
|
|
25
|
+
- [JwkCryptoKey](type-aliases/JwkCryptoKey.md)
|
|
24
26
|
- [MimeTypes](type-aliases/MimeTypes.md)
|
|
25
27
|
|
|
26
28
|
## Variables
|
|
@@ -28,5 +30,4 @@
|
|
|
28
30
|
- [HeaderTypes](variables/HeaderTypes.md)
|
|
29
31
|
- [HttpMethod](variables/HttpMethod.md)
|
|
30
32
|
- [HttpStatusCode](variables/HttpStatusCode.md)
|
|
31
|
-
- [JwtAlgorithms](variables/JwtAlgorithms.md)
|
|
32
33
|
- [MimeTypes](variables/MimeTypes.md)
|