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