@twin.org/web 0.0.1-next.36 → 0.0.1-next.38

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.
@@ -2,110 +2,6 @@
2
2
 
3
3
  The fields in a JSON Web Key.
4
4
 
5
- ## Indexable
5
+ ## Extends
6
6
 
7
- \[`key`: `string`\]: `unknown`
8
-
9
- ## Properties
10
-
11
- ### alg?
12
-
13
- > `optional` **alg**: [`JwtAlgorithms`](../type-aliases/JwtAlgorithms.md)
14
-
15
- The cryptographic algorithm for the key.
16
-
17
- ***
18
-
19
- ### use?
20
-
21
- > `optional` **use**: `string`
22
-
23
- The intended use for the key.
24
-
25
- ***
26
-
27
- ### key\_ops?
28
-
29
- > `optional` **key\_ops**: `string`[]
30
-
31
- The operation(s) that the key is intended to be used for.
32
-
33
- ***
34
-
35
- ### kty
36
-
37
- > **kty**: `string`
38
-
39
- The key type parameter.
40
-
41
- ***
42
-
43
- ### n?
44
-
45
- > `optional` **n**: `string`
46
-
47
- The public key parameters.
48
-
49
- ***
50
-
51
- ### e?
52
-
53
- > `optional` **e**: `string`
54
-
55
- Exponent parameter.
56
-
57
- ***
58
-
59
- ### d?
60
-
61
- > `optional` **d**: `string`
62
-
63
- The private key parameters.
64
-
65
- ***
66
-
67
- ### p?
68
-
69
- > `optional` **p**: `string`
70
-
71
- The private key parameters.
72
-
73
- ***
74
-
75
- ### q?
76
-
77
- > `optional` **q**: `string`
78
-
79
- The private key parameters.
80
-
81
- ***
82
-
83
- ### dp?
84
-
85
- > `optional` **dp**: `string`
86
-
87
- The private key parameters.
88
-
89
- ***
90
-
91
- ### dq?
92
-
93
- > `optional` **dq**: `string`
94
-
95
- The private key parameters.
96
-
97
- ***
98
-
99
- ### qi?
100
-
101
- > `optional` **qi**: `string`
102
-
103
- The private key parameters.
104
-
105
- ***
106
-
107
- ### kid?
108
-
109
- > `optional` **kid**: `string`
110
-
111
- The key ID.
7
+ - `JWK`
@@ -2,30 +2,10 @@
2
2
 
3
3
  The fields in a JSON Web Token header.
4
4
 
5
- ## Indexable
6
-
7
- \[`key`: `string`\]: `unknown`
8
-
9
- ## Properties
10
-
11
- ### typ?
12
-
13
- > `optional` **typ**: `string`
14
-
15
- The type of the token.
5
+ ## Extends
16
6
 
17
- ***
7
+ - `JWTHeaderParameters`
18
8
 
19
- ### alg
20
-
21
- > **alg**: [`JwtAlgorithms`](../type-aliases/JwtAlgorithms.md)
22
-
23
- The algorithm used to sign the token.
24
-
25
- ***
26
-
27
- ### kid?
28
-
29
- > `optional` **kid**: `string`
9
+ ## Indexable
30
10
 
31
- The key ID.
11
+ \[`propName`: `string`\]: `unknown`
@@ -2,62 +2,10 @@
2
2
 
3
3
  The fields in a JSON Web Token payload.
4
4
 
5
- ## Indexable
6
-
7
- \[`key`: `string`\]: `unknown`
8
-
9
- ## Properties
10
-
11
- ### iss?
12
-
13
- > `optional` **iss**: `string`
14
-
15
- The issuer of the token.
16
-
17
- ***
18
-
19
- ### sub?
20
-
21
- > `optional` **sub**: `string`
22
-
23
- The subject of the token.
24
-
25
- ***
26
-
27
- ### aud?
28
-
29
- > `optional` **aud**: `string`
30
-
31
- The audience of the token.
5
+ ## Extends
32
6
 
33
- ***
7
+ - `JWTPayload`
34
8
 
35
- ### exp?
36
-
37
- > `optional` **exp**: `number`
38
-
39
- The expiration time of the token.
40
-
41
- ***
42
-
43
- ### nbf?
44
-
45
- > `optional` **nbf**: `number`
46
-
47
- The not before time of the token.
48
-
49
- ***
50
-
51
- ### iat?
52
-
53
- > `optional` **iat**: `number`
54
-
55
- The issued at time of the token.
56
-
57
- ***
58
-
59
- ### jti?
60
-
61
- > `optional` **jti**: `string`
9
+ ## Indexable
62
10
 
63
- The JWT ID.
11
+ \[`propName`: `string`\]: `unknown`
@@ -0,0 +1,5 @@
1
+ # Type Alias: JwkCryptoKey
2
+
3
+ > **JwkCryptoKey**: `CryptoKey` \| `Uint8Array`
4
+
5
+ The crypto key for a JWK.
package/locales/en.json CHANGED
@@ -9,7 +9,11 @@
9
9
  },
10
10
  "jwt": {
11
11
  "noKeyOrSigner": "No key or signer was provided for JWT creation",
12
- "noKeyOrVerifier": "No key or verifier was provided for JWT creation"
12
+ "noKeyOrVerifier": "No key or verifier was provided for JWT creation",
13
+ "verifyFailed": "Failed to verify JWT"
14
+ },
15
+ "jwk": {
16
+ "jwkImportFailed": "Failed to import JWK"
13
17
  }
14
18
  },
15
19
  "errorMessages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/web",
3
- "version": "0.0.1-next.36",
3
+ "version": "0.0.1-next.38",
4
4
  "description": "Contains classes for use with web operations",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,9 +14,10 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.1-next.36",
18
- "@twin.org/crypto": "0.0.1-next.36",
19
- "@twin.org/nameof": "next"
17
+ "@twin.org/core": "0.0.1-next.38",
18
+ "@twin.org/crypto": "0.0.1-next.38",
19
+ "@twin.org/nameof": "next",
20
+ "jose": "6.0.8"
20
21
  },
21
22
  "main": "./dist/cjs/index.cjs",
22
23
  "module": "./dist/esm/index.mjs",
@@ -1,17 +0,0 @@
1
- /**
2
- * The cryptographic algorithms supported for JSON Web Tokens and JSON Web Keys.
3
- */
4
- export declare const JwtAlgorithms: {
5
- /**
6
- * HMAC using SHA-256.
7
- */
8
- readonly HS256: "HS256";
9
- /**
10
- * EdDSA using Ed25519.
11
- */
12
- readonly EdDSA: "EdDSA";
13
- };
14
- /**
15
- * The cryptographic algorithms supported for JSON Web Tokens and JSON Web Keys.
16
- */
17
- export type JwtAlgorithms = (typeof JwtAlgorithms)[keyof typeof JwtAlgorithms];
@@ -1,5 +0,0 @@
1
- # Type Alias: JwtAlgorithms
2
-
3
- > **JwtAlgorithms**: *typeof* [`JwtAlgorithms`](../variables/JwtAlgorithms.md)\[keyof *typeof* [`JwtAlgorithms`](../variables/JwtAlgorithms.md)\]
4
-
5
- The cryptographic algorithms supported for JSON Web Tokens and JSON Web Keys.
@@ -1,19 +0,0 @@
1
- # Variable: JwtAlgorithms
2
-
3
- > `const` **JwtAlgorithms**: `object`
4
-
5
- The cryptographic algorithms supported for JSON Web Tokens and JSON Web Keys.
6
-
7
- ## Type declaration
8
-
9
- ### HS256
10
-
11
- > `readonly` **HS256**: `"HS256"` = `"HS256"`
12
-
13
- HMAC using SHA-256.
14
-
15
- ### EdDSA
16
-
17
- > `readonly` **EdDSA**: `"EdDSA"` = `"EdDSA"`
18
-
19
- EdDSA using Ed25519.