@twin.org/identity-models 0.0.1-next.9 → 0.0.2-next.1

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 (84) hide show
  1. package/dist/cjs/index.cjs +150 -21
  2. package/dist/esm/index.mjs +150 -22
  3. package/dist/types/factories/identityResolverConnectorFactory.d.ts +6 -0
  4. package/dist/types/index.d.ts +37 -11
  5. package/dist/types/models/IIdentityComponent.d.ts +134 -5
  6. package/dist/types/models/IIdentityConnector.d.ts +25 -29
  7. package/dist/types/models/IIdentityResolverComponent.d.ts +13 -0
  8. package/dist/types/models/IIdentityResolverConnector.d.ts +14 -0
  9. package/dist/types/models/api/identity/IIdentityCreateRequest.d.ts +14 -0
  10. package/dist/types/models/api/identity/IIdentityCreateResponse.d.ts +10 -0
  11. package/dist/types/models/api/identity/IIdentityProofCreateRequest.d.ts +33 -0
  12. package/dist/types/models/api/identity/IIdentityProofCreateResponse.d.ts +10 -0
  13. package/dist/types/models/api/identity/IIdentityProofVerifyRequest.d.ts +20 -0
  14. package/dist/types/models/api/identity/IIdentityProofVerifyResponse.d.ts +11 -0
  15. package/dist/types/models/api/identity/IIdentityRemoveRequest.d.ts +14 -0
  16. package/dist/types/models/api/identity/IIdentityServiceCreateRequest.d.ts +31 -0
  17. package/dist/types/models/api/identity/IIdentityServiceCreateResponse.d.ts +10 -0
  18. package/dist/types/models/api/identity/IIdentityServiceRemoveRequest.d.ts +18 -0
  19. package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateRequest.d.ts +36 -0
  20. package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateResponse.d.ts +19 -0
  21. package/dist/types/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.d.ts +18 -0
  22. package/dist/types/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.d.ts +18 -0
  23. package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyRequest.d.ts +14 -0
  24. package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyResponse.d.ts +19 -0
  25. package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateRequest.d.ts +45 -0
  26. package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateResponse.d.ts +19 -0
  27. package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyRequest.d.ts +14 -0
  28. package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyResponse.d.ts +23 -0
  29. package/dist/types/models/api/identity/IIdentityVerificationMethodCreateRequest.d.ts +28 -0
  30. package/dist/types/models/api/identity/IIdentityVerificationMethodCreateResponse.d.ts +10 -0
  31. package/dist/types/models/api/identity/IIdentityVerificationMethodRemoveRequest.d.ts +18 -0
  32. package/dist/types/models/api/{IIdentityProfileListRequest.d.ts → profile/IIdentityProfileListRequest.d.ts} +1 -1
  33. package/dist/types/models/api/{IIdentityResolveRequest.d.ts → resolver/IIdentityResolveRequest.d.ts} +2 -2
  34. package/dist/types/utils/documentHelper.d.ts +33 -2
  35. package/dist/types/utils/verificationHelper.d.ts +29 -0
  36. package/docs/changelog.md +169 -1
  37. package/docs/reference/classes/DocumentHelper.md +122 -8
  38. package/docs/reference/classes/VerificationHelper.md +87 -0
  39. package/docs/reference/index.md +27 -5
  40. package/docs/reference/interfaces/IIdentityComponent.md +500 -6
  41. package/docs/reference/interfaces/IIdentityConnector.md +150 -130
  42. package/docs/reference/interfaces/IIdentityCreateRequest.md +17 -0
  43. package/docs/reference/interfaces/IIdentityCreateResponse.md +11 -0
  44. package/docs/reference/interfaces/IIdentityProfileComponent.md +62 -50
  45. package/docs/reference/interfaces/IIdentityProfileConnector.md +60 -44
  46. package/docs/reference/interfaces/IIdentityProfileListRequest.md +1 -1
  47. package/docs/reference/interfaces/IIdentityProofCreateRequest.md +43 -0
  48. package/docs/reference/interfaces/IIdentityProofCreateResponse.md +11 -0
  49. package/docs/reference/interfaces/IIdentityProofVerifyRequest.md +23 -0
  50. package/docs/reference/interfaces/IIdentityProofVerifyResponse.md +15 -0
  51. package/docs/reference/interfaces/IIdentityRemoveRequest.md +17 -0
  52. package/docs/reference/interfaces/IIdentityResolveRequest.md +3 -3
  53. package/docs/reference/interfaces/IIdentityResolverComponent.md +29 -0
  54. package/docs/reference/interfaces/IIdentityResolverConnector.md +33 -0
  55. package/docs/reference/interfaces/IIdentityServiceCreateRequest.md +43 -0
  56. package/docs/reference/interfaces/IIdentityServiceCreateResponse.md +11 -0
  57. package/docs/reference/interfaces/IIdentityServiceRemoveRequest.md +23 -0
  58. package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +49 -0
  59. package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateResponse.md +23 -0
  60. package/docs/reference/interfaces/IIdentityVerifiableCredentialRevokeRequest.md +23 -0
  61. package/docs/reference/interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md +23 -0
  62. package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyRequest.md +17 -0
  63. package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyResponse.md +23 -0
  64. package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateRequest.md +61 -0
  65. package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateResponse.md +23 -0
  66. package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyRequest.md +17 -0
  67. package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyResponse.md +29 -0
  68. package/docs/reference/interfaces/IIdentityVerificationMethodCreateRequest.md +37 -0
  69. package/docs/reference/interfaces/IIdentityVerificationMethodCreateResponse.md +11 -0
  70. package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +23 -0
  71. package/docs/reference/variables/IdentityResolverConnectorFactory.md +5 -0
  72. package/locales/en.json +10 -4
  73. package/package.json +4 -4
  74. package/dist/types/models/identityRole.d.ts +0 -21
  75. package/docs/reference/type-aliases/IdentityRole.md +0 -5
  76. package/docs/reference/variables/IdentityRole.md +0 -25
  77. /package/dist/types/models/api/{IIdentityProfileCreateRequest.d.ts → profile/IIdentityProfileCreateRequest.d.ts} +0 -0
  78. /package/dist/types/models/api/{IIdentityProfileGetPublicRequest.d.ts → profile/IIdentityProfileGetPublicRequest.d.ts} +0 -0
  79. /package/dist/types/models/api/{IIdentityProfileGetPublicResponse.d.ts → profile/IIdentityProfileGetPublicResponse.d.ts} +0 -0
  80. /package/dist/types/models/api/{IIdentityProfileGetRequest.d.ts → profile/IIdentityProfileGetRequest.d.ts} +0 -0
  81. /package/dist/types/models/api/{IIdentityProfileGetResponse.d.ts → profile/IIdentityProfileGetResponse.d.ts} +0 -0
  82. /package/dist/types/models/api/{IIdentityProfileListResponse.d.ts → profile/IIdentityProfileListResponse.d.ts} +0 -0
  83. /package/dist/types/models/api/{IIdentityProfileUpdateRequest.d.ts → profile/IIdentityProfileUpdateRequest.d.ts} +0 -0
  84. /package/dist/types/models/api/{IIdentityResolveResponse.d.ts → resolver/IIdentityResolveResponse.d.ts} +0 -0
@@ -1,14 +1,45 @@
1
+ import { DidVerificationMethodType, type IDidDocumentVerificationMethod, type IDidDocument } from "@twin.org/standards-w3c-did";
2
+ import type { IJwk } from "@twin.org/web";
1
3
  /**
2
4
  * Helper methods for documents.
3
5
  */
4
6
  export declare class DocumentHelper {
7
+ /**
8
+ * Runtime name for the class.
9
+ */
10
+ static readonly CLASS_NAME: string;
5
11
  /**
6
12
  * Parse the document id into its parts.
7
13
  * @param documentId The full document id.
8
14
  * @returns The parsed document id.
9
15
  */
10
- static parse(documentId: string): {
16
+ static parseId(documentId: string): {
11
17
  id: string;
12
- hash: string | undefined;
18
+ fragment: string | undefined;
13
19
  };
20
+ /**
21
+ * Join the document id parts.
22
+ * @param documentId The document id.
23
+ * @param fragment The fragment part for the identifier.
24
+ * @returns The full id.
25
+ */
26
+ static joinId(documentId: string, fragment?: string): string;
27
+ /**
28
+ * Get a verification method from a DID document.
29
+ * @param didDocument The DID Document to get the method from.
30
+ * @param methodName The name of the method to get the JWK from.
31
+ * @param methodType The type of the method, defaults to verificationMethod.
32
+ * @returns The verification method if found.
33
+ * @throws Error if the method is not found.
34
+ */
35
+ static getVerificationMethod(didDocument: IDidDocument, methodName: string, methodType?: DidVerificationMethodType): IDidDocumentVerificationMethod;
36
+ /**
37
+ * Gets a JWK from a DID document verification method.
38
+ * @param didDocument The DID Document to get the method from.
39
+ * @param methodName The name of the method to get the JWK from.
40
+ * @param methodType The type of the method, defaults to verificationMethod.
41
+ * @returns The JWK if found.
42
+ * @throws Error if the method is not found.
43
+ */
44
+ static getJwk(didDocument: IDidDocument, methodName: string, methodType?: DidVerificationMethodType): IJwk;
14
45
  }
@@ -0,0 +1,29 @@
1
+ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import { type IJwtHeader, type IJwtPayload } from "@twin.org/web";
3
+ import type { IIdentityResolverComponent } from "../models/IIdentityResolverComponent";
4
+ /**
5
+ * Helper methods for verification.
6
+ */
7
+ export declare class VerificationHelper {
8
+ /**
9
+ * Runtime name for the class.
10
+ */
11
+ static readonly CLASS_NAME: string;
12
+ /**
13
+ * Verified the JWT.
14
+ * @param resolver The resolver to use for finding the document.
15
+ * @param jwt The token to verify.
16
+ * @returns The decoded payload.
17
+ */
18
+ static verifyJwt<T extends IJwtHeader, U extends IJwtPayload>(resolver: IIdentityResolverComponent, jwt: string): Promise<{
19
+ header: T;
20
+ payload: U;
21
+ }>;
22
+ /**
23
+ * Verified the proof for the document e.g. verifiable credential.
24
+ * @param resolver The resolver to use for finding the document.
25
+ * @param secureDocument The secure document to verify.
26
+ * @returns True if the verification is successful.
27
+ */
28
+ static verifyProof(resolver: IIdentityResolverComponent, secureDocument: IJsonLdNodeObject): Promise<boolean>;
29
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,173 @@
1
1
  # @twin.org/identity-service-models - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.2-next.0...identity-models-v0.0.2-next.1) (2025-08-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * add identity remove ([eebc13f](https://github.com/twinfoundation/identity/commit/eebc13f4c2cd994d2d9cce4da2128fb346c80ba7))
9
+ * identity key separator use slash ([1319d0d](https://github.com/twinfoundation/identity/commit/1319d0d07164a36b3ec279e6421b8835ffefc3d3))
10
+ * use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Import path and bump version ([#21](https://github.com/twinfoundation/identity/issues/21)) ([ccea845](https://github.com/twinfoundation/identity/commit/ccea845bf32562267280bc1b3dde1c9af1a00360))
16
+ * Install sdk-wasm ([#20](https://github.com/twinfoundation/identity/issues/20)) ([75ec14e](https://github.com/twinfoundation/identity/commit/75ec14e072f8c219863a1c028a3b0783802086e9))
17
+ * query params force coercion ([d9347d2](https://github.com/twinfoundation/identity/commit/d9347d29d4a9cc58759f30f5d8526de864ea7522))
18
+ * Use resolver component ([#22](https://github.com/twinfoundation/identity/issues/22)) ([d0b3a32](https://github.com/twinfoundation/identity/commit/d0b3a321c7f9f966d397a880d752e9f2c0a98a27))
19
+
20
+ ## 0.0.1 (2025-07-08)
21
+
22
+
23
+ ### Features
24
+
25
+ * release to production ([8450ad7](https://github.com/twinfoundation/identity/commit/8450ad727e0c4d665f2ce483e41798c2ff5b7d55))
26
+
27
+ ## [0.0.1-next.57](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.56...identity-models-v0.0.1-next.57) (2025-07-08)
28
+
29
+
30
+ ### Features
31
+
32
+ * add identity remove ([eebc13f](https://github.com/twinfoundation/identity/commit/eebc13f4c2cd994d2d9cce4da2128fb346c80ba7))
33
+
34
+ ## [0.0.1-next.56](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.55...identity-models-v0.0.1-next.56) (2025-06-30)
35
+
36
+
37
+ ### Miscellaneous Chores
38
+
39
+ * **identity-models:** Synchronize repo versions
40
+
41
+ ## [0.0.1-next.55](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.54...identity-models-v0.0.1-next.55) (2025-06-26)
42
+
43
+
44
+ ### Features
45
+
46
+ * identity key separator use slash ([1319d0d](https://github.com/twinfoundation/identity/commit/1319d0d07164a36b3ec279e6421b8835ffefc3d3))
47
+ * use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * Import path and bump version ([#21](https://github.com/twinfoundation/identity/issues/21)) ([ccea845](https://github.com/twinfoundation/identity/commit/ccea845bf32562267280bc1b3dde1c9af1a00360))
53
+ * Install sdk-wasm ([#20](https://github.com/twinfoundation/identity/issues/20)) ([75ec14e](https://github.com/twinfoundation/identity/commit/75ec14e072f8c219863a1c028a3b0783802086e9))
54
+ * query params force coercion ([d9347d2](https://github.com/twinfoundation/identity/commit/d9347d29d4a9cc58759f30f5d8526de864ea7522))
55
+ * Use resolver component ([#22](https://github.com/twinfoundation/identity/issues/22)) ([d0b3a32](https://github.com/twinfoundation/identity/commit/d0b3a321c7f9f966d397a880d752e9f2c0a98a27))
56
+
57
+ ## [0.0.1-next.54](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.53...identity-models-v0.0.1-next.54) (2025-06-26)
58
+
59
+
60
+ ### Miscellaneous Chores
61
+
62
+ * **identity-models:** Synchronize repo versions
63
+
64
+ ## [0.0.1-next.53](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.52...identity-models-v0.0.1-next.53) (2025-06-23)
65
+
66
+
67
+ ### Miscellaneous Chores
68
+
69
+ * **identity-models:** Synchronize repo versions
70
+
71
+ ## [0.0.1-next.52](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.51...identity-models-v0.0.1-next.52) (2025-06-20)
72
+
73
+
74
+ ### Bug Fixes
75
+
76
+ * query params force coercion ([d9347d2](https://github.com/twinfoundation/identity/commit/d9347d29d4a9cc58759f30f5d8526de864ea7522))
77
+
78
+ ## [0.0.1-next.51](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.50...identity-models-v0.0.1-next.51) (2025-06-19)
79
+
80
+
81
+ ### Miscellaneous Chores
82
+
83
+ * **identity-models:** Synchronize repo versions
84
+
85
+ ## [0.0.1-next.50](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.49...identity-models-v0.0.1-next.50) (2025-06-19)
86
+
87
+
88
+ ### Miscellaneous Chores
89
+
90
+ * **identity-models:** Synchronize repo versions
91
+
92
+ ## [0.0.1-next.49](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.48...identity-models-v0.0.1-next.49) (2025-06-18)
93
+
94
+
95
+ ### Miscellaneous Chores
96
+
97
+ * **identity-models:** Synchronize repo versions
98
+
99
+ ## [0.0.1-next.48](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.47...identity-models-v0.0.1-next.48) (2025-06-17)
100
+
101
+
102
+ ### Miscellaneous Chores
103
+
104
+ * **identity-models:** Synchronize repo versions
105
+
106
+ ## [0.0.1-next.47](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.46...identity-models-v0.0.1-next.47) (2025-06-12)
107
+
108
+
109
+ ### Features
110
+
111
+ * identity key separator use slash ([1319d0d](https://github.com/twinfoundation/identity/commit/1319d0d07164a36b3ec279e6421b8835ffefc3d3))
112
+
113
+ ## [0.0.1-next.46](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.45...identity-models-v0.0.1-next.46) (2025-05-20)
114
+
115
+
116
+ ### Features
117
+
118
+ * use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
119
+
120
+
121
+ ### Bug Fixes
122
+
123
+ * Import path and bump version ([#21](https://github.com/twinfoundation/identity/issues/21)) ([ccea845](https://github.com/twinfoundation/identity/commit/ccea845bf32562267280bc1b3dde1c9af1a00360))
124
+ * Install sdk-wasm ([#20](https://github.com/twinfoundation/identity/issues/20)) ([75ec14e](https://github.com/twinfoundation/identity/commit/75ec14e072f8c219863a1c028a3b0783802086e9))
125
+ * Use resolver component ([#22](https://github.com/twinfoundation/identity/issues/22)) ([d0b3a32](https://github.com/twinfoundation/identity/commit/d0b3a321c7f9f966d397a880d752e9f2c0a98a27))
126
+
127
+ ## [0.0.1-next.45](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.44...identity-models-v0.0.1-next.45) (2025-05-06)
128
+
129
+
130
+ ### Miscellaneous Chores
131
+
132
+ * **identity-models:** Synchronize repo versions
133
+
134
+ ## [0.0.1-next.44](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.43...identity-models-v0.0.1-next.44) (2025-04-30)
135
+
136
+
137
+ ### Miscellaneous Chores
138
+
139
+ * **identity-models:** Synchronize repo versions
140
+
141
+ ## [0.0.1-next.43](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.42...identity-models-v0.0.1-next.43) (2025-04-25)
142
+
143
+
144
+ ### Miscellaneous Chores
145
+
146
+ * **identity-models:** Synchronize repo versions
147
+
148
+ ## [0.0.1-next.42](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.41...identity-models-v0.0.1-next.42) (2025-04-17)
149
+
150
+
151
+ ### Features
152
+
153
+ * use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
154
+
155
+ ## [0.0.1-next.41](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.40...identity-models-v0.0.1-next.41) (2025-04-09)
156
+
157
+
158
+ ### Miscellaneous Chores
159
+
160
+ * **identity-models:** Synchronize repo versions
161
+
162
+ ## [0.0.1-next.40](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.1-next.39...identity-models-v0.0.1-next.40) (2025-03-28)
163
+
164
+
165
+ ### Bug Fixes
166
+
167
+ * Import path and bump version ([#21](https://github.com/twinfoundation/identity/issues/21)) ([ccea845](https://github.com/twinfoundation/identity/commit/ccea845bf32562267280bc1b3dde1c9af1a00360))
168
+ * Install sdk-wasm ([#20](https://github.com/twinfoundation/identity/issues/20)) ([75ec14e](https://github.com/twinfoundation/identity/commit/75ec14e072f8c219863a1c028a3b0783802086e9))
169
+ * Use resolver component ([#22](https://github.com/twinfoundation/identity/issues/22)) ([d0b3a32](https://github.com/twinfoundation/identity/commit/d0b3a321c7f9f966d397a880d752e9f2c0a98a27))
170
+
171
+ ## v0.0.1-next.39
4
172
 
5
173
  - Initial Release
@@ -4,25 +4,35 @@ Helper methods for documents.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new DocumentHelper()
7
+ ### Constructor
8
8
 
9
- > **new DocumentHelper**(): [`DocumentHelper`](DocumentHelper.md)
9
+ > **new DocumentHelper**(): `DocumentHelper`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`DocumentHelper`](DocumentHelper.md)
13
+ `DocumentHelper`
14
+
15
+ ## Properties
16
+
17
+ ### CLASS\_NAME
18
+
19
+ > `readonly` `static` **CLASS\_NAME**: `string`
20
+
21
+ Runtime name for the class.
14
22
 
15
23
  ## Methods
16
24
 
17
- ### parse()
25
+ ### parseId()
18
26
 
19
- > `static` **parse**(`documentId`): `object`
27
+ > `static` **parseId**(`documentId`): `object`
20
28
 
21
29
  Parse the document id into its parts.
22
30
 
23
31
  #### Parameters
24
32
 
25
- • **documentId**: `string`
33
+ ##### documentId
34
+
35
+ `string`
26
36
 
27
37
  The full document id.
28
38
 
@@ -36,6 +46,110 @@ The parsed document id.
36
46
 
37
47
  > **id**: `string`
38
48
 
39
- ##### hash
49
+ ##### fragment
50
+
51
+ > **fragment**: `undefined` \| `string`
52
+
53
+ ***
54
+
55
+ ### joinId()
56
+
57
+ > `static` **joinId**(`documentId`, `fragment?`): `string`
58
+
59
+ Join the document id parts.
60
+
61
+ #### Parameters
62
+
63
+ ##### documentId
64
+
65
+ `string`
66
+
67
+ The document id.
68
+
69
+ ##### fragment?
70
+
71
+ `string`
72
+
73
+ The fragment part for the identifier.
74
+
75
+ #### Returns
76
+
77
+ `string`
78
+
79
+ The full id.
80
+
81
+ ***
82
+
83
+ ### getVerificationMethod()
84
+
85
+ > `static` **getVerificationMethod**(`didDocument`, `methodName`, `methodType?`): `IDidDocumentVerificationMethod`
86
+
87
+ Get a verification method from a DID document.
88
+
89
+ #### Parameters
90
+
91
+ ##### didDocument
92
+
93
+ `IDidDocument`
94
+
95
+ The DID Document to get the method from.
96
+
97
+ ##### methodName
98
+
99
+ `string`
100
+
101
+ The name of the method to get the JWK from.
102
+
103
+ ##### methodType?
104
+
105
+ `DidVerificationMethodType`
106
+
107
+ The type of the method, defaults to verificationMethod.
108
+
109
+ #### Returns
110
+
111
+ `IDidDocumentVerificationMethod`
112
+
113
+ The verification method if found.
114
+
115
+ #### Throws
116
+
117
+ Error if the method is not found.
118
+
119
+ ***
120
+
121
+ ### getJwk()
122
+
123
+ > `static` **getJwk**(`didDocument`, `methodName`, `methodType?`): `IJwk`
124
+
125
+ Gets a JWK from a DID document verification method.
126
+
127
+ #### Parameters
128
+
129
+ ##### didDocument
130
+
131
+ `IDidDocument`
132
+
133
+ The DID Document to get the method from.
134
+
135
+ ##### methodName
136
+
137
+ `string`
138
+
139
+ The name of the method to get the JWK from.
140
+
141
+ ##### methodType?
142
+
143
+ `DidVerificationMethodType`
144
+
145
+ The type of the method, defaults to verificationMethod.
146
+
147
+ #### Returns
148
+
149
+ `IJwk`
150
+
151
+ The JWK if found.
152
+
153
+ #### Throws
40
154
 
41
- > **hash**: `undefined` \| `string`
155
+ Error if the method is not found.
@@ -0,0 +1,87 @@
1
+ # Class: VerificationHelper
2
+
3
+ Helper methods for verification.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new VerificationHelper**(): `VerificationHelper`
10
+
11
+ #### Returns
12
+
13
+ `VerificationHelper`
14
+
15
+ ## Properties
16
+
17
+ ### CLASS\_NAME
18
+
19
+ > `readonly` `static` **CLASS\_NAME**: `string`
20
+
21
+ Runtime name for the class.
22
+
23
+ ## Methods
24
+
25
+ ### verifyJwt()
26
+
27
+ > `static` **verifyJwt**\<`T`, `U`\>(`resolver`, `jwt`): `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
28
+
29
+ Verified the JWT.
30
+
31
+ #### Type Parameters
32
+
33
+ ##### T
34
+
35
+ `T` *extends* `IJwtHeader`
36
+
37
+ ##### U
38
+
39
+ `U` *extends* `IJwtPayload`
40
+
41
+ #### Parameters
42
+
43
+ ##### resolver
44
+
45
+ [`IIdentityResolverComponent`](../interfaces/IIdentityResolverComponent.md)
46
+
47
+ The resolver to use for finding the document.
48
+
49
+ ##### jwt
50
+
51
+ `string`
52
+
53
+ The token to verify.
54
+
55
+ #### Returns
56
+
57
+ `Promise`\<\{ `header`: `T`; `payload`: `U`; \}\>
58
+
59
+ The decoded payload.
60
+
61
+ ***
62
+
63
+ ### verifyProof()
64
+
65
+ > `static` **verifyProof**(`resolver`, `secureDocument`): `Promise`\<`boolean`\>
66
+
67
+ Verified the proof for the document e.g. verifiable credential.
68
+
69
+ #### Parameters
70
+
71
+ ##### resolver
72
+
73
+ [`IIdentityResolverComponent`](../interfaces/IIdentityResolverComponent.md)
74
+
75
+ The resolver to use for finding the document.
76
+
77
+ ##### secureDocument
78
+
79
+ `IJsonLdNodeObject`
80
+
81
+ The secure document to verify.
82
+
83
+ #### Returns
84
+
85
+ `Promise`\<`boolean`\>
86
+
87
+ True if the verification is successful.
@@ -3,6 +3,7 @@
3
3
  ## Classes
4
4
 
5
5
  - [DocumentHelper](classes/DocumentHelper.md)
6
+ - [VerificationHelper](classes/VerificationHelper.md)
6
7
 
7
8
  ## Interfaces
8
9
 
@@ -10,6 +11,31 @@
10
11
  - [IIdentityConnector](interfaces/IIdentityConnector.md)
11
12
  - [IIdentityProfileComponent](interfaces/IIdentityProfileComponent.md)
12
13
  - [IIdentityProfileConnector](interfaces/IIdentityProfileConnector.md)
14
+ - [IIdentityResolverComponent](interfaces/IIdentityResolverComponent.md)
15
+ - [IIdentityResolverConnector](interfaces/IIdentityResolverConnector.md)
16
+ - [IIdentityCreateRequest](interfaces/IIdentityCreateRequest.md)
17
+ - [IIdentityCreateResponse](interfaces/IIdentityCreateResponse.md)
18
+ - [IIdentityProofCreateRequest](interfaces/IIdentityProofCreateRequest.md)
19
+ - [IIdentityProofCreateResponse](interfaces/IIdentityProofCreateResponse.md)
20
+ - [IIdentityProofVerifyRequest](interfaces/IIdentityProofVerifyRequest.md)
21
+ - [IIdentityProofVerifyResponse](interfaces/IIdentityProofVerifyResponse.md)
22
+ - [IIdentityRemoveRequest](interfaces/IIdentityRemoveRequest.md)
23
+ - [IIdentityServiceCreateRequest](interfaces/IIdentityServiceCreateRequest.md)
24
+ - [IIdentityServiceCreateResponse](interfaces/IIdentityServiceCreateResponse.md)
25
+ - [IIdentityServiceRemoveRequest](interfaces/IIdentityServiceRemoveRequest.md)
26
+ - [IIdentityVerifiableCredentialCreateRequest](interfaces/IIdentityVerifiableCredentialCreateRequest.md)
27
+ - [IIdentityVerifiableCredentialCreateResponse](interfaces/IIdentityVerifiableCredentialCreateResponse.md)
28
+ - [IIdentityVerifiableCredentialRevokeRequest](interfaces/IIdentityVerifiableCredentialRevokeRequest.md)
29
+ - [IIdentityVerifiableCredentialUnrevokeRequest](interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md)
30
+ - [IIdentityVerifiableCredentialVerifyRequest](interfaces/IIdentityVerifiableCredentialVerifyRequest.md)
31
+ - [IIdentityVerifiableCredentialVerifyResponse](interfaces/IIdentityVerifiableCredentialVerifyResponse.md)
32
+ - [IIdentityVerifiablePresentationCreateRequest](interfaces/IIdentityVerifiablePresentationCreateRequest.md)
33
+ - [IIdentityVerifiablePresentationCreateResponse](interfaces/IIdentityVerifiablePresentationCreateResponse.md)
34
+ - [IIdentityVerifiablePresentationVerifyRequest](interfaces/IIdentityVerifiablePresentationVerifyRequest.md)
35
+ - [IIdentityVerifiablePresentationVerifyResponse](interfaces/IIdentityVerifiablePresentationVerifyResponse.md)
36
+ - [IIdentityVerificationMethodCreateRequest](interfaces/IIdentityVerificationMethodCreateRequest.md)
37
+ - [IIdentityVerificationMethodCreateResponse](interfaces/IIdentityVerificationMethodCreateResponse.md)
38
+ - [IIdentityVerificationMethodRemoveRequest](interfaces/IIdentityVerificationMethodRemoveRequest.md)
13
39
  - [IIdentityProfileCreateRequest](interfaces/IIdentityProfileCreateRequest.md)
14
40
  - [IIdentityProfileGetPublicRequest](interfaces/IIdentityProfileGetPublicRequest.md)
15
41
  - [IIdentityProfileGetPublicResponse](interfaces/IIdentityProfileGetPublicResponse.md)
@@ -21,12 +47,8 @@
21
47
  - [IIdentityResolveRequest](interfaces/IIdentityResolveRequest.md)
22
48
  - [IIdentityResolveResponse](interfaces/IIdentityResolveResponse.md)
23
49
 
24
- ## Type Aliases
25
-
26
- - [IdentityRole](type-aliases/IdentityRole.md)
27
-
28
50
  ## Variables
29
51
 
30
52
  - [IdentityConnectorFactory](variables/IdentityConnectorFactory.md)
31
53
  - [IdentityProfileConnectorFactory](variables/IdentityProfileConnectorFactory.md)
32
- - [IdentityRole](variables/IdentityRole.md)
54
+ - [IdentityResolverConnectorFactory](variables/IdentityResolverConnectorFactory.md)