@twin.org/web 0.0.1-next.7 → 0.0.1-next.70

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 (35) hide show
  1. package/dist/cjs/index.cjs +288 -90
  2. package/dist/esm/index.mjs +289 -92
  3. package/dist/types/index.d.ts +3 -1
  4. package/dist/types/models/IJwk.d.ts +2 -58
  5. package/dist/types/models/IJwtHeader.d.ts +2 -18
  6. package/dist/types/models/IJwtPayload.d.ts +2 -33
  7. package/dist/types/models/jwkCryptoKey.d.ts +4 -0
  8. package/dist/types/models/mimeTypes.d.ts +8 -0
  9. package/dist/types/utils/fetchHelper.d.ts +7 -0
  10. package/dist/types/utils/jwk.d.ts +41 -0
  11. package/dist/types/utils/jws.d.ts +22 -0
  12. package/dist/types/utils/jwt.d.ts +67 -29
  13. package/docs/changelog.md +361 -1
  14. package/docs/reference/classes/FetchError.md +16 -8
  15. package/docs/reference/classes/FetchHelper.md +104 -28
  16. package/docs/reference/classes/Jwk.md +129 -0
  17. package/docs/reference/classes/Jws.md +81 -0
  18. package/docs/reference/classes/Jwt.md +261 -105
  19. package/docs/reference/classes/MimeTypeHelper.md +9 -5
  20. package/docs/reference/index.md +3 -2
  21. package/docs/reference/interfaces/IHttpHeaders.md +1 -1
  22. package/docs/reference/interfaces/IJwk.md +2 -106
  23. package/docs/reference/interfaces/IJwtHeader.md +5 -23
  24. package/docs/reference/interfaces/IJwtPayload.md +5 -55
  25. package/docs/reference/type-aliases/HeaderTypes.md +1 -1
  26. package/docs/reference/type-aliases/HttpMethod.md +1 -1
  27. package/docs/reference/type-aliases/HttpStatusCode.md +1 -1
  28. package/docs/reference/type-aliases/JwkCryptoKey.md +5 -0
  29. package/docs/reference/type-aliases/MimeTypes.md +1 -1
  30. package/docs/reference/variables/MimeTypes.md +12 -0
  31. package/locales/en.json +11 -1
  32. package/package.json +7 -6
  33. package/dist/types/models/jwtAlgorithms.d.ts +0 -17
  34. package/docs/reference/type-aliases/JwtAlgorithms.md +0 -5
  35. package/docs/reference/variables/JwtAlgorithms.md +0 -19
@@ -22,6 +22,10 @@ export declare const MimeTypes: {
22
22
  * JSON-LD - application/ld+json
23
23
  */
24
24
  readonly JsonLd: "application/ld+json";
25
+ /**
26
+ * JWT - application/jwt
27
+ */
28
+ readonly Jwt: "application/jwt";
25
29
  /**
26
30
  * XML - application/xml
27
31
  */
@@ -34,6 +38,10 @@ export declare const MimeTypes: {
34
38
  * Application GZIP - application/gzip
35
39
  */
36
40
  readonly Gzip: "application/gzip";
41
+ /**
42
+ * Application deflate - application/zlib
43
+ */
44
+ readonly Zlib: "application/zlib";
37
45
  /**
38
46
  * Application BZIP2 - application/x-bzip2
39
47
  */
@@ -44,6 +44,13 @@ export declare class FetchHelper {
44
44
  * @returns The cache entry if it exists.
45
45
  */
46
46
  static getCacheEntry<T>(url: string): Promise<T | undefined>;
47
+ /**
48
+ * Set a cache entry.
49
+ * @param url The url for the request.
50
+ * @param value The value to cache.
51
+ * @returns The cache entry if it exists.
52
+ */
53
+ static setCacheEntry<T>(url: string, value: T): Promise<void>;
47
54
  /**
48
55
  * Remove a cache entry.
49
56
  * @param url The url for the request.
@@ -0,0 +1,41 @@
1
+ import type { IJwk } from "../models/IJwk";
2
+ import type { JwkCryptoKey } from "../models/jwkCryptoKey";
3
+ /**
4
+ * Class to handle JSON Web Keys.
5
+ */
6
+ export declare class Jwk {
7
+ /**
8
+ * Convert the JWK to a crypto key.
9
+ * @param jwk The JWK to convert.
10
+ * @param alg The alg to be used, defaults to jwk.alg.
11
+ * @returns The crypto key.
12
+ */
13
+ static toCryptoKey(jwk: IJwk, alg?: string): Promise<JwkCryptoKey>;
14
+ /**
15
+ * Convert the Ed25519 private key to a crypto key.
16
+ * @param privateKey The private key to use.
17
+ * @returns The crypto key.
18
+ */
19
+ static fromEd25519Private(privateKey: Uint8Array): Promise<IJwk>;
20
+ /**
21
+ * Convert the Ed25519 public key to a crypto key.
22
+ * @param publicKey The private key to use.
23
+ * @returns The crypto key.
24
+ */
25
+ static fromEd25519Public(publicKey: Uint8Array): Promise<IJwk>;
26
+ /**
27
+ * Convert the JWK to raw keys.
28
+ * @param jwk The JWK to convert to raw.
29
+ * @returns The crypto key.
30
+ */
31
+ static toRaw(jwk: IJwk): Promise<{
32
+ publicKey?: Uint8Array;
33
+ privateKey?: Uint8Array;
34
+ }>;
35
+ /**
36
+ * Generate a KID for the JWK.
37
+ * @param jwk The JWK to generate a KID for.
38
+ * @returns The KID.
39
+ */
40
+ static generateKid(jwk: IJwk): Promise<string>;
41
+ }
@@ -0,0 +1,22 @@
1
+ import type { JwkCryptoKey } from "../models/jwkCryptoKey";
2
+ /**
3
+ * Class to handle JSON Web Signatures.
4
+ */
5
+ export declare class Jws {
6
+ /**
7
+ * Create a signature.
8
+ * @param privateKey The private key to use.
9
+ * @param hash The hash to sign.
10
+ * @param algOverride An optional algorithm override.
11
+ * @returns The signature.
12
+ */
13
+ static create(privateKey: JwkCryptoKey, hash: Uint8Array, algOverride?: string): Promise<string>;
14
+ /**
15
+ * Verify a signature.
16
+ * @param jws The signature to verify.
17
+ * @param publicKey The public key to verify the signature with.
18
+ * @param hash The hash to verify.
19
+ * @returns True if the signature was verified.
20
+ */
21
+ static verify(jws: string, publicKey: JwkCryptoKey, hash: Uint8Array): Promise<boolean>;
22
+ }
@@ -1,8 +1,8 @@
1
1
  import type { IJwtHeader } from "../models/IJwtHeader";
2
2
  import type { IJwtPayload } from "../models/IJwtPayload";
3
- import { JwtAlgorithms } from "../models/jwtAlgorithms";
3
+ import type { JwkCryptoKey } from "../models/jwkCryptoKey";
4
4
  /**
5
- * Class to encode and decode JSON Web Tokens.
5
+ * Class to handle JSON Web Tokens.
6
6
  */
7
7
  export declare class Jwt {
8
8
  /**
@@ -12,7 +12,7 @@ export declare class Jwt {
12
12
  * @param key The key for signing the token, can be omitted if a signer is provided.
13
13
  * @returns The encoded token.
14
14
  */
15
- static encode<U extends IJwtHeader, T extends IJwtPayload>(header: U, payload: T, key: Uint8Array): Promise<string>;
15
+ static encode<T extends IJwtHeader, U extends IJwtPayload>(header: T, payload: U, key: JwkCryptoKey): Promise<string>;
16
16
  /**
17
17
  * Encode a token.
18
18
  * @param header The header to encode.
@@ -20,15 +20,15 @@ export declare class Jwt {
20
20
  * @param signer Custom signer method.
21
21
  * @returns The encoded token.
22
22
  */
23
- static encodeWithSigner<U extends IJwtHeader, T extends IJwtPayload>(header: U, payload: T, signer: (alg: JwtAlgorithms, key: Uint8Array | undefined, payload: Uint8Array) => Promise<Uint8Array>): Promise<string>;
23
+ static encodeWithSigner<T extends IJwtHeader, U extends IJwtPayload>(header: T, payload: U, signer: (header: IJwtHeader, payload: IJwtPayload, key: JwkCryptoKey | undefined) => Promise<string>): Promise<string>;
24
24
  /**
25
25
  * Decode a token.
26
26
  * @param token The token to decode.
27
27
  * @returns The decoded payload.
28
28
  */
29
- static decode<U extends IJwtHeader, T extends IJwtPayload>(token: string): Promise<{
30
- header?: U;
31
- payload?: T;
29
+ static decode<T extends IJwtHeader, U extends IJwtPayload>(token: string): Promise<{
30
+ header?: T;
31
+ payload?: U;
32
32
  signature?: Uint8Array;
33
33
  }>;
34
34
  /**
@@ -37,11 +37,9 @@ export declare class Jwt {
37
37
  * @param key The key for verifying the token
38
38
  * @returns The decoded payload.
39
39
  */
40
- static verify<U extends IJwtHeader, T extends IJwtPayload>(token: string, key: Uint8Array): Promise<{
41
- verified: boolean;
42
- header?: U;
43
- payload?: T;
44
- signature?: Uint8Array;
40
+ static verify<T extends IJwtHeader, U extends IJwtPayload>(token: string, key: JwkCryptoKey): Promise<{
41
+ header: T;
42
+ payload: U;
45
43
  }>;
46
44
  /**
47
45
  * Verify a token.
@@ -49,37 +47,77 @@ export declare class Jwt {
49
47
  * @param verifier Custom verification method.
50
48
  * @returns The decoded payload.
51
49
  */
52
- static verifyWithVerifier<U extends IJwtHeader, T extends IJwtPayload>(token: string, verifier: (alg: JwtAlgorithms, key: Uint8Array | undefined, payload: Uint8Array, signature: Uint8Array) => Promise<boolean>): Promise<{
53
- verified: boolean;
54
- header?: U;
55
- payload?: T;
56
- signature?: Uint8Array;
50
+ static verifyWithVerifier<T extends IJwtHeader, U extends IJwtPayload>(token: string, verifier: (token: string, key: JwkCryptoKey | undefined) => Promise<{
51
+ header: T;
52
+ payload: U;
53
+ }>): Promise<{
54
+ header: T;
55
+ payload: U;
57
56
  }>;
58
57
  /**
59
58
  * Verify a token by parts.
60
- * @param header The header to verify.
61
- * @param payload The payload to verify.
62
- * @param signature The signature to verify.
59
+ * @param token The token to verify.
63
60
  * @param key The key for verifying the token, if not provided no verification occurs.
64
61
  * @param verifier Custom verification method.
65
62
  * @returns True if the parts are verified.
66
63
  */
67
- static verifySignature<U extends IJwtHeader, T extends IJwtPayload>(header?: U, payload?: T, signature?: Uint8Array, key?: Uint8Array, verifier?: (alg: JwtAlgorithms, key: Uint8Array | undefined, payload: Uint8Array, signature: Uint8Array) => Promise<boolean>): Promise<boolean>;
64
+ static verifySignature<T extends IJwtHeader, U extends IJwtPayload>(token: string, key?: JwkCryptoKey, verifier?: (token: string, key: JwkCryptoKey | undefined) => Promise<{
65
+ header: T;
66
+ payload: U;
67
+ }>): Promise<{
68
+ header: T;
69
+ payload: U;
70
+ }>;
68
71
  /**
69
72
  * The default signer for the JWT.
70
- * @param alg The algorithm to use.
71
- * @param key The key to sign with.
73
+ * @param header The header to sign.
72
74
  * @param payload The payload to sign.
75
+ * @param key The optional key to sign with.
73
76
  * @returns The signature.
74
77
  */
75
- static defaultSigner(alg: JwtAlgorithms, key: Uint8Array | undefined, payload: Uint8Array): Promise<Uint8Array>;
78
+ static defaultSigner(header: IJwtHeader, payload: IJwtPayload, key: JwkCryptoKey | undefined): Promise<string>;
76
79
  /**
77
80
  * The default verifier for the JWT.
78
- * @param alg The algorithm to use.
81
+ * @param token The token to verify.
79
82
  * @param key The key to verify with.
80
- * @param payload The payload to verify.
81
- * @param signature The signature to verify.
82
- * @returns True if the signature was verified.
83
+ * @returns The header and payload if verification successful.
84
+ */
85
+ static defaultVerifier<T extends IJwtHeader, U extends IJwtPayload>(token: string, key: JwkCryptoKey | undefined): Promise<{
86
+ header: T;
87
+ payload: U;
88
+ }>;
89
+ /**
90
+ * Create bytes for signing from header and payload.
91
+ * @param header The header.
92
+ * @param payload The payload.
93
+ * @returns The bytes to sign.
94
+ */
95
+ static toSigningBytes<T extends IJwtHeader, U extends IJwtPayload>(header: T, payload: U): Uint8Array;
96
+ /**
97
+ * Create header and payload from signing bytes.
98
+ * @param signingBytes The signing bytes from a token.
99
+ * @returns The header and payload.
100
+ * @throws If the signing bytes are invalid
101
+ */
102
+ static fromSigningBytes<T extends IJwtHeader, U extends IJwtPayload>(signingBytes: Uint8Array): {
103
+ header: T;
104
+ payload: U;
105
+ };
106
+ /**
107
+ * Convert signed bytes and signature bytes to token.
108
+ * @param signingBytes The signed bytes.
109
+ * @param signature The signature.
110
+ * @returns The token.
111
+ */
112
+ static tokenFromBytes(signingBytes: Uint8Array, signature: Uint8Array): string;
113
+ /**
114
+ * Convert the token to signing bytes and signature bytes.
115
+ * @param token The token to convert to bytes.
116
+ * @returns The decoded bytes.
117
+ * @throws If the token is invalid.
83
118
  */
84
- static defaultVerifier(alg: JwtAlgorithms, key: Uint8Array | undefined, payload: Uint8Array, signature: Uint8Array): Promise<boolean>;
119
+ static tokenToBytes(token: string): {
120
+ signingBytes: Uint8Array;
121
+ signature: Uint8Array;
122
+ };
85
123
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,365 @@
1
1
  # @twin.org/web - Changelog
2
2
 
3
- ## 0.0.1-next.7
3
+ ## [0.0.1-next.70](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.69...web-v0.0.1-next.70) (2025-07-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
9
+ * add kid method to Jwk ([bc9239e](https://github.com/twinfoundation/framework/commit/bc9239ed9896a053d83e00ca221e962704ebc277))
10
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
11
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
12
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
13
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
14
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
15
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
21
+
22
+
23
+ ### Dependencies
24
+
25
+ * The following workspace dependencies were updated
26
+ * dependencies
27
+ * @twin.org/core bumped from 0.0.1-next.69 to 0.0.1-next.70
28
+ * @twin.org/crypto bumped from 0.0.1-next.69 to 0.0.1-next.70
29
+ * @twin.org/nameof bumped from 0.0.1-next.69 to 0.0.1-next.70
30
+ * devDependencies
31
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.69 to 0.0.1-next.70
32
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.69 to 0.0.1-next.70
33
+
34
+ ## [0.0.1-next.69](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.68...web-v0.0.1-next.69) (2025-07-02)
35
+
36
+
37
+ ### Features
38
+
39
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
40
+ * add kid method to Jwk ([bc9239e](https://github.com/twinfoundation/framework/commit/bc9239ed9896a053d83e00ca221e962704ebc277))
41
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
42
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
43
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
44
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
45
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
46
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
52
+
53
+
54
+ ### Dependencies
55
+
56
+ * The following workspace dependencies were updated
57
+ * dependencies
58
+ * @twin.org/core bumped from 0.0.1-next.68 to 0.0.1-next.69
59
+ * @twin.org/crypto bumped from 0.0.1-next.68 to 0.0.1-next.69
60
+ * @twin.org/nameof bumped from 0.0.1-next.68 to 0.0.1-next.69
61
+ * devDependencies
62
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.68 to 0.0.1-next.69
63
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.68 to 0.0.1-next.69
64
+
65
+ ## [0.0.1-next.68](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.67...web-v0.0.1-next.68) (2025-07-02)
66
+
67
+
68
+ ### Features
69
+
70
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
71
+
72
+
73
+ ### Dependencies
74
+
75
+ * The following workspace dependencies were updated
76
+ * dependencies
77
+ * @twin.org/core bumped from 0.0.1-next.67 to 0.0.1-next.68
78
+ * @twin.org/crypto bumped from 0.0.1-next.67 to 0.0.1-next.68
79
+ * @twin.org/nameof bumped from 0.0.1-next.67 to 0.0.1-next.68
80
+ * devDependencies
81
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.67 to 0.0.1-next.68
82
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.67 to 0.0.1-next.68
83
+
84
+ ## [0.0.1-next.67](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.66...web-v0.0.1-next.67) (2025-06-26)
85
+
86
+
87
+ ### Miscellaneous Chores
88
+
89
+ * **web:** Synchronize repo versions
90
+
91
+
92
+ ### Dependencies
93
+
94
+ * The following workspace dependencies were updated
95
+ * dependencies
96
+ * @twin.org/core bumped from 0.0.1-next.66 to 0.0.1-next.67
97
+ * @twin.org/crypto bumped from 0.0.1-next.66 to 0.0.1-next.67
98
+
99
+ ## [0.0.1-next.66](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.65...web-v0.0.1-next.66) (2025-06-26)
100
+
101
+
102
+ ### Miscellaneous Chores
103
+
104
+ * **web:** Synchronize repo versions
105
+
106
+
107
+ ### Dependencies
108
+
109
+ * The following workspace dependencies were updated
110
+ * dependencies
111
+ * @twin.org/core bumped from 0.0.1-next.65 to 0.0.1-next.66
112
+ * @twin.org/crypto bumped from 0.0.1-next.65 to 0.0.1-next.66
113
+
114
+ ## [0.0.1-next.65](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.64...web-v0.0.1-next.65) (2025-06-19)
115
+
116
+
117
+ ### Miscellaneous Chores
118
+
119
+ * **web:** Synchronize repo versions
120
+
121
+
122
+ ### Dependencies
123
+
124
+ * The following workspace dependencies were updated
125
+ * dependencies
126
+ * @twin.org/core bumped from 0.0.1-next.64 to 0.0.1-next.65
127
+ * @twin.org/crypto bumped from 0.0.1-next.64 to 0.0.1-next.65
128
+
129
+ ## [0.0.1-next.64](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.63...web-v0.0.1-next.64) (2025-06-19)
130
+
131
+
132
+ ### Features
133
+
134
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
135
+
136
+
137
+ ### Dependencies
138
+
139
+ * The following workspace dependencies were updated
140
+ * dependencies
141
+ * @twin.org/core bumped from 0.0.1-next.63 to 0.0.1-next.64
142
+ * @twin.org/crypto bumped from 0.0.1-next.63 to 0.0.1-next.64
143
+
144
+ ## [0.0.1-next.63](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.62...web-v0.0.1-next.63) (2025-06-18)
145
+
146
+
147
+ ### Features
148
+
149
+ * add kid method to Jwk ([bc9239e](https://github.com/twinfoundation/framework/commit/bc9239ed9896a053d83e00ca221e962704ebc277))
150
+
151
+
152
+ ### Dependencies
153
+
154
+ * The following workspace dependencies were updated
155
+ * dependencies
156
+ * @twin.org/core bumped from 0.0.1-next.62 to 0.0.1-next.63
157
+ * @twin.org/crypto bumped from 0.0.1-next.62 to 0.0.1-next.63
158
+
159
+ ## [0.0.1-next.62](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.61...web-v0.0.1-next.62) (2025-06-17)
160
+
161
+
162
+ ### Features
163
+
164
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
165
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
166
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
167
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
168
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
169
+
170
+
171
+ ### Bug Fixes
172
+
173
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
174
+
175
+
176
+ ### Dependencies
177
+
178
+ * The following workspace dependencies were updated
179
+ * dependencies
180
+ * @twin.org/core bumped from 0.0.1-next.61 to 0.0.1-next.62
181
+ * @twin.org/crypto bumped from 0.0.1-next.61 to 0.0.1-next.62
182
+
183
+ ## [0.0.1-next.61](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.60...web-v0.0.1-next.61) (2025-06-17)
184
+
185
+
186
+ ### Miscellaneous Chores
187
+
188
+ * **web:** Synchronize repo versions
189
+
190
+
191
+ ### Dependencies
192
+
193
+ * The following workspace dependencies were updated
194
+ * dependencies
195
+ * @twin.org/core bumped from 0.0.1-next.60 to 0.0.1-next.61
196
+ * @twin.org/crypto bumped from 0.0.1-next.60 to 0.0.1-next.61
197
+
198
+ ## [0.0.1-next.60](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.59...web-v0.0.1-next.60) (2025-06-17)
199
+
200
+
201
+ ### Miscellaneous Chores
202
+
203
+ * **web:** Synchronize repo versions
204
+
205
+
206
+ ### Dependencies
207
+
208
+ * The following workspace dependencies were updated
209
+ * dependencies
210
+ * @twin.org/core bumped from 0.0.1-next.59 to 0.0.1-next.60
211
+ * @twin.org/crypto bumped from 0.0.1-next.59 to 0.0.1-next.60
212
+
213
+ ## [0.0.1-next.59](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.58...web-v0.0.1-next.59) (2025-06-17)
214
+
215
+
216
+ ### Features
217
+
218
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
219
+
220
+
221
+ ### Dependencies
222
+
223
+ * The following workspace dependencies were updated
224
+ * dependencies
225
+ * @twin.org/core bumped from 0.0.1-next.58 to 0.0.1-next.59
226
+ * @twin.org/crypto bumped from 0.0.1-next.58 to 0.0.1-next.59
227
+
228
+ ## [0.0.1-next.58](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.57...web-v0.0.1-next.58) (2025-06-13)
229
+
230
+
231
+ ### Miscellaneous Chores
232
+
233
+ * **web:** Synchronize repo versions
234
+
235
+
236
+ ### Dependencies
237
+
238
+ * The following workspace dependencies were updated
239
+ * dependencies
240
+ * @twin.org/core bumped from 0.0.1-next.57 to 0.0.1-next.58
241
+ * @twin.org/crypto bumped from 0.0.1-next.57 to 0.0.1-next.58
242
+
243
+ ## [0.0.1-next.57](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.56...web-v0.0.1-next.57) (2025-06-10)
244
+
245
+
246
+ ### Features
247
+
248
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
249
+
250
+
251
+ ### Dependencies
252
+
253
+ * The following workspace dependencies were updated
254
+ * dependencies
255
+ * @twin.org/core bumped from 0.0.1-next.56 to 0.0.1-next.57
256
+ * @twin.org/crypto bumped from 0.0.1-next.56 to 0.0.1-next.57
257
+
258
+ ## [0.0.1-next.56](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.55...web-v0.0.1-next.56) (2025-05-08)
259
+
260
+
261
+ ### Miscellaneous Chores
262
+
263
+ * **web:** Synchronize repo versions
264
+
265
+
266
+ ### Dependencies
267
+
268
+ * The following workspace dependencies were updated
269
+ * dependencies
270
+ * @twin.org/core bumped from 0.0.1-next.55 to 0.0.1-next.56
271
+ * @twin.org/crypto bumped from 0.0.1-next.55 to 0.0.1-next.56
272
+
273
+ ## [0.0.1-next.55](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.54...web-v0.0.1-next.55) (2025-05-07)
274
+
275
+
276
+ ### Features
277
+
278
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
279
+
280
+
281
+ ### Dependencies
282
+
283
+ * The following workspace dependencies were updated
284
+ * dependencies
285
+ * @twin.org/core bumped from 0.0.1-next.54 to 0.0.1-next.55
286
+ * @twin.org/crypto bumped from 0.0.1-next.54 to 0.0.1-next.55
287
+
288
+ ## [0.0.1-next.54](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.53...web-v0.0.1-next.54) (2025-05-06)
289
+
290
+
291
+ ### Bug Fixes
292
+
293
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
294
+
295
+
296
+ ### Dependencies
297
+
298
+ * The following workspace dependencies were updated
299
+ * dependencies
300
+ * @twin.org/core bumped from 0.0.1-next.53 to 0.0.1-next.54
301
+ * @twin.org/crypto bumped from 0.0.1-next.53 to 0.0.1-next.54
302
+
303
+ ## [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)
304
+
305
+
306
+ ### Miscellaneous Chores
307
+
308
+ * **web:** Synchronize repo versions
309
+
310
+
311
+ ### Dependencies
312
+
313
+ * The following workspace dependencies were updated
314
+ * dependencies
315
+ * @twin.org/core bumped from 0.0.1-next.52 to 0.0.1-next.53
316
+ * @twin.org/crypto bumped from 0.0.1-next.52 to 0.0.1-next.53
317
+
318
+ ## [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)
319
+
320
+
321
+ ### Features
322
+
323
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
324
+
325
+
326
+ ### Dependencies
327
+
328
+ * The following workspace dependencies were updated
329
+ * dependencies
330
+ * @twin.org/core bumped from 0.0.1-next.51 to 0.0.1-next.52
331
+ * @twin.org/crypto bumped from 0.0.1-next.51 to 0.0.1-next.52
332
+
333
+ ## [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)
334
+
335
+
336
+ ### Miscellaneous Chores
337
+
338
+ * **web:** Synchronize repo versions
339
+
340
+
341
+ ### Dependencies
342
+
343
+ * The following workspace dependencies were updated
344
+ * dependencies
345
+ * @twin.org/core bumped from 0.0.1-next.50 to 0.0.1-next.51
346
+ * @twin.org/crypto bumped from 0.0.1-next.50 to 0.0.1-next.51
347
+
348
+ ## [0.0.1-next.50](https://github.com/twinfoundation/framework/compare/web-v0.0.1-next.49...web-v0.0.1-next.50) (2025-03-26)
349
+
350
+
351
+ ### Features
352
+
353
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
354
+
355
+
356
+ ### Dependencies
357
+
358
+ * The following workspace dependencies were updated
359
+ * dependencies
360
+ * @twin.org/core bumped from 0.0.1-next.49 to 0.0.1-next.50
361
+ * @twin.org/crypto bumped from 0.0.1-next.49 to 0.0.1-next.50
362
+
363
+ ## 0.0.1-next.49
4
364
 
5
365
  - Initial Release
@@ -8,37 +8,45 @@ Class to represent errors from fetch.
8
8
 
9
9
  ## Constructors
10
10
 
11
- ### new FetchError()
11
+ ### Constructor
12
12
 
13
- > **new FetchError**(`source`, `message`, `httpStatus`, `properties`?, `inner`?): [`FetchError`](FetchError.md)
13
+ > **new FetchError**(`source`, `message`, `httpStatus`, `properties?`, `inner?`): `FetchError`
14
14
 
15
15
  Create a new instance of FetchError.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **source**: `string`
19
+ ##### source
20
+
21
+ `string`
20
22
 
21
23
  The source of the error.
22
24
 
23
- **message**: `string`
25
+ ##### message
26
+
27
+ `string`
24
28
 
25
29
  The message as a code.
26
30
 
27
- **httpStatus**: [`HttpStatusCode`](../type-aliases/HttpStatusCode.md)
31
+ ##### httpStatus
32
+
33
+ [`HttpStatusCode`](../type-aliases/HttpStatusCode.md)
28
34
 
29
35
  The http status code.
30
36
 
31
- **properties?**
37
+ ##### properties?
32
38
 
33
39
  Any additional information for the error.
34
40
 
35
- **inner?**: `unknown`
41
+ ##### inner?
42
+
43
+ `unknown`
36
44
 
37
45
  The inner error if we have wrapped another error.
38
46
 
39
47
  #### Returns
40
48
 
41
- [`FetchError`](FetchError.md)
49
+ `FetchError`
42
50
 
43
51
  #### Overrides
44
52