@twin.org/web 0.0.1-next.51 → 0.0.1-next.53
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/docs/changelog.md +30 -0
- package/docs/reference/classes/FetchError.md +3 -3
- package/docs/reference/classes/FetchHelper.md +21 -11
- package/docs/reference/classes/Jwk.md +3 -3
- package/docs/reference/classes/Jws.md +4 -4
- package/docs/reference/classes/Jwt.md +58 -22
- package/docs/reference/classes/MimeTypeHelper.md +3 -3
- package/docs/reference/interfaces/IJwtHeader.md +2 -0
- package/docs/reference/interfaces/IJwtPayload.md +2 -0
- 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 +1 -1
- package/docs/reference/type-aliases/MimeTypes.md +1 -1
- package/package.json +4 -4
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @twin.org/web - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.53](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.52...web-v0.0.1-next.53) (2025-05-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **web:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/core bumped from 0.0.1-next.52 to 0.0.1-next.53
|
|
16
|
+
* @twin.org/crypto bumped from 0.0.1-next.52 to 0.0.1-next.53
|
|
17
|
+
|
|
18
|
+
## [0.0.1-next.52](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.51...web-v0.0.1-next.52) (2025-04-17)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/core bumped from 0.0.1-next.51 to 0.0.1-next.52
|
|
31
|
+
* @twin.org/crypto bumped from 0.0.1-next.51 to 0.0.1-next.52
|
|
32
|
+
|
|
3
33
|
## [0.0.1-next.51](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.50...web-v0.0.1-next.51) (2025-03-27)
|
|
4
34
|
|
|
5
35
|
|
|
@@ -8,9 +8,9 @@ Class to represent errors from fetch.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new FetchError**(`source`, `message`, `httpStatus`, `properties
|
|
13
|
+
> **new FetchError**(`source`, `message`, `httpStatus`, `properties?`, `inner?`): `FetchError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of FetchError.
|
|
16
16
|
|
|
@@ -46,7 +46,7 @@ The inner error if we have wrapped another error.
|
|
|
46
46
|
|
|
47
47
|
#### Returns
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
`FetchError`
|
|
50
50
|
|
|
51
51
|
#### Overrides
|
|
52
52
|
|
|
@@ -4,19 +4,19 @@ Class to helper with fetch operations.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new FetchHelper**():
|
|
9
|
+
> **new FetchHelper**(): `FetchHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`FetchHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### fetch()
|
|
18
18
|
|
|
19
|
-
> `static` **fetch**(`source`, `url`, `method`, `body
|
|
19
|
+
> `static` **fetch**(`source`, `url`, `method`, `body?`, `options?`): `Promise`\<`Response`\>
|
|
20
20
|
|
|
21
21
|
Perform a fetch request.
|
|
22
22
|
|
|
@@ -62,15 +62,19 @@ The response.
|
|
|
62
62
|
|
|
63
63
|
### fetchJson()
|
|
64
64
|
|
|
65
|
-
> `static` **fetchJson**\<`T`, `U`\>(`source`, `url`, `method`, `requestData
|
|
65
|
+
> `static` **fetchJson**\<`T`, `U`\>(`source`, `url`, `method`, `requestData?`, `options?`): `Promise`\<`U`\>
|
|
66
66
|
|
|
67
67
|
Perform a request in json format.
|
|
68
68
|
|
|
69
69
|
#### Type Parameters
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
##### T
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
`T`
|
|
74
|
+
|
|
75
|
+
##### U
|
|
76
|
+
|
|
77
|
+
`U`
|
|
74
78
|
|
|
75
79
|
#### Parameters
|
|
76
80
|
|
|
@@ -114,13 +118,15 @@ The response.
|
|
|
114
118
|
|
|
115
119
|
### fetchBinary()
|
|
116
120
|
|
|
117
|
-
> `static` **fetchBinary**\<`T`\>(`source`, `url`, `method`, `requestData
|
|
121
|
+
> `static` **fetchBinary**\<`T`\>(`source`, `url`, `method`, `requestData?`, `options?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\> \| `T`\>
|
|
118
122
|
|
|
119
123
|
Perform a request for binary data.
|
|
120
124
|
|
|
121
125
|
#### Type Parameters
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
##### T
|
|
128
|
+
|
|
129
|
+
`T`
|
|
124
130
|
|
|
125
131
|
#### Parameters
|
|
126
132
|
|
|
@@ -182,7 +188,9 @@ Get a cache entry.
|
|
|
182
188
|
|
|
183
189
|
#### Type Parameters
|
|
184
190
|
|
|
185
|
-
|
|
191
|
+
##### T
|
|
192
|
+
|
|
193
|
+
`T`
|
|
186
194
|
|
|
187
195
|
#### Parameters
|
|
188
196
|
|
|
@@ -208,7 +216,9 @@ Set a cache entry.
|
|
|
208
216
|
|
|
209
217
|
#### Type Parameters
|
|
210
218
|
|
|
211
|
-
|
|
219
|
+
##### T
|
|
220
|
+
|
|
221
|
+
`T`
|
|
212
222
|
|
|
213
223
|
#### Parameters
|
|
214
224
|
|
|
@@ -4,19 +4,19 @@ Class to handle JSON Web Signatures.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Jws**():
|
|
9
|
+
> **new Jws**(): `Jws`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Jws`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### create()
|
|
18
18
|
|
|
19
|
-
> `static` **create**(`privateKey`, `hash`, `algOverride
|
|
19
|
+
> `static` **create**(`privateKey`, `hash`, `algOverride?`): `Promise`\<`string`\>
|
|
20
20
|
|
|
21
21
|
Create a signature.
|
|
22
22
|
|
|
@@ -4,13 +4,13 @@ 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
|
|
|
@@ -22,9 +22,13 @@ 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
|
|
|
@@ -62,9 +66,13 @@ Encode a token.
|
|
|
62
66
|
|
|
63
67
|
#### Type Parameters
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
##### T
|
|
70
|
+
|
|
71
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
66
72
|
|
|
67
|
-
|
|
73
|
+
##### U
|
|
74
|
+
|
|
75
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
68
76
|
|
|
69
77
|
#### Parameters
|
|
70
78
|
|
|
@@ -102,9 +110,13 @@ Decode a token.
|
|
|
102
110
|
|
|
103
111
|
#### Type Parameters
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
##### T
|
|
114
|
+
|
|
115
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
106
116
|
|
|
107
|
-
|
|
117
|
+
##### U
|
|
118
|
+
|
|
119
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
108
120
|
|
|
109
121
|
#### Parameters
|
|
110
122
|
|
|
@@ -130,9 +142,13 @@ Verify a token.
|
|
|
130
142
|
|
|
131
143
|
#### Type Parameters
|
|
132
144
|
|
|
133
|
-
|
|
145
|
+
##### T
|
|
146
|
+
|
|
147
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
134
148
|
|
|
135
|
-
|
|
149
|
+
##### U
|
|
150
|
+
|
|
151
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
136
152
|
|
|
137
153
|
#### Parameters
|
|
138
154
|
|
|
@@ -164,9 +180,13 @@ Verify a token.
|
|
|
164
180
|
|
|
165
181
|
#### Type Parameters
|
|
166
182
|
|
|
167
|
-
|
|
183
|
+
##### T
|
|
184
|
+
|
|
185
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
168
186
|
|
|
169
|
-
|
|
187
|
+
##### U
|
|
188
|
+
|
|
189
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
170
190
|
|
|
171
191
|
#### Parameters
|
|
172
192
|
|
|
@@ -192,15 +212,19 @@ The decoded payload.
|
|
|
192
212
|
|
|
193
213
|
### verifySignature()
|
|
194
214
|
|
|
195
|
-
> `static` **verifySignature**\<`T`, `U`\>(`token`, `key
|
|
215
|
+
> `static` **verifySignature**\<`T`, `U`\>(`token`, `key?`, `verifier?`): `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
|
|
196
216
|
|
|
197
217
|
Verify a token by parts.
|
|
198
218
|
|
|
199
219
|
#### Type Parameters
|
|
200
220
|
|
|
201
|
-
|
|
221
|
+
##### T
|
|
222
|
+
|
|
223
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
224
|
+
|
|
225
|
+
##### U
|
|
202
226
|
|
|
203
|
-
|
|
227
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
204
228
|
|
|
205
229
|
#### Parameters
|
|
206
230
|
|
|
@@ -272,9 +296,13 @@ The default verifier for the JWT.
|
|
|
272
296
|
|
|
273
297
|
#### Type Parameters
|
|
274
298
|
|
|
275
|
-
|
|
299
|
+
##### T
|
|
300
|
+
|
|
301
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
302
|
+
|
|
303
|
+
##### U
|
|
276
304
|
|
|
277
|
-
|
|
305
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
278
306
|
|
|
279
307
|
#### Parameters
|
|
280
308
|
|
|
@@ -306,9 +334,13 @@ Create bytes for signing from header and payload.
|
|
|
306
334
|
|
|
307
335
|
#### Type Parameters
|
|
308
336
|
|
|
309
|
-
|
|
337
|
+
##### T
|
|
310
338
|
|
|
311
|
-
|
|
339
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
340
|
+
|
|
341
|
+
##### U
|
|
342
|
+
|
|
343
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
312
344
|
|
|
313
345
|
#### Parameters
|
|
314
346
|
|
|
@@ -340,9 +372,13 @@ Create header and payload from signing bytes.
|
|
|
340
372
|
|
|
341
373
|
#### Type Parameters
|
|
342
374
|
|
|
343
|
-
|
|
375
|
+
##### T
|
|
376
|
+
|
|
377
|
+
`T` *extends* [`IJwtHeader`](../interfaces/IJwtHeader.md)
|
|
378
|
+
|
|
379
|
+
##### U
|
|
344
380
|
|
|
345
|
-
|
|
381
|
+
`U` *extends* [`IJwtPayload`](../interfaces/IJwtPayload.md)
|
|
346
382
|
|
|
347
383
|
#### Parameters
|
|
348
384
|
|
|
@@ -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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: HeaderTypes
|
|
2
2
|
|
|
3
|
-
> **HeaderTypes
|
|
3
|
+
> **HeaderTypes** = *typeof* [`HeaderTypes`](../variables/HeaderTypes.md)\[keyof *typeof* [`HeaderTypes`](../variables/HeaderTypes.md)\]
|
|
4
4
|
|
|
5
5
|
Common http header types.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: HttpMethod
|
|
2
2
|
|
|
3
|
-
> **HttpMethod
|
|
3
|
+
> **HttpMethod** = *typeof* [`HttpMethod`](../variables/HttpMethod.md)\[keyof *typeof* [`HttpMethod`](../variables/HttpMethod.md)\]
|
|
4
4
|
|
|
5
5
|
The HTTP Methods.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: HttpStatusCode
|
|
2
2
|
|
|
3
|
-
> **HttpStatusCode
|
|
3
|
+
> **HttpStatusCode** = *typeof* [`HttpStatusCode`](../variables/HttpStatusCode.md)\[keyof *typeof* [`HttpStatusCode`](../variables/HttpStatusCode.md)\]
|
|
4
4
|
|
|
5
5
|
Standard HTTP status codes.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: MimeTypes
|
|
2
2
|
|
|
3
|
-
> **MimeTypes
|
|
3
|
+
> **MimeTypes** = *typeof* [`MimeTypes`](../variables/MimeTypes.md)\[keyof *typeof* [`MimeTypes`](../variables/MimeTypes.md)\]
|
|
4
4
|
|
|
5
5
|
Common mime types.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/web",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.53",
|
|
4
4
|
"description": "Contains classes for use with web operations",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/core": "0.0.1-next.
|
|
18
|
-
"@twin.org/crypto": "0.0.1-next.
|
|
17
|
+
"@twin.org/core": "0.0.1-next.53",
|
|
18
|
+
"@twin.org/crypto": "0.0.1-next.53",
|
|
19
19
|
"@twin.org/nameof": "next",
|
|
20
|
-
"jose": "6.0.
|
|
20
|
+
"jose": "6.0.10"
|
|
21
21
|
},
|
|
22
22
|
"main": "./dist/cjs/index.cjs",
|
|
23
23
|
"module": "./dist/esm/index.mjs",
|