@twin.org/identity-models 0.0.1-next.41 → 0.0.1-next.42
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 +7 -0
- package/docs/reference/classes/DocumentHelper.md +6 -6
- package/docs/reference/classes/VerificationHelper.md +9 -5
- package/docs/reference/interfaces/IIdentityComponent.md +10 -10
- package/docs/reference/interfaces/IIdentityConnector.md +3 -3
- package/docs/reference/interfaces/IIdentityProfileComponent.md +12 -8
- package/docs/reference/interfaces/IIdentityProfileConnector.md +10 -6
- package/package.json +1 -1
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @twin.org/identity-service-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
|
|
9
|
+
|
|
3
10
|
## [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)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -4,13 +4,13 @@ Helper methods for documents.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new DocumentHelper**():
|
|
9
|
+
> **new DocumentHelper**(): `DocumentHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`DocumentHelper`
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ The parsed document id.
|
|
|
54
54
|
|
|
55
55
|
### joinId()
|
|
56
56
|
|
|
57
|
-
> `static` **joinId**(`documentId`, `fragment
|
|
57
|
+
> `static` **joinId**(`documentId`, `fragment?`): `string`
|
|
58
58
|
|
|
59
59
|
Join the document id parts.
|
|
60
60
|
|
|
@@ -82,7 +82,7 @@ The full id.
|
|
|
82
82
|
|
|
83
83
|
### getVerificationMethod()
|
|
84
84
|
|
|
85
|
-
> `static` **getVerificationMethod**(`didDocument`, `methodName`, `methodType
|
|
85
|
+
> `static` **getVerificationMethod**(`didDocument`, `methodName`, `methodType?`): `IDidDocumentVerificationMethod`
|
|
86
86
|
|
|
87
87
|
Get a verification method from a DID document.
|
|
88
88
|
|
|
@@ -120,7 +120,7 @@ Error if the method is not found.
|
|
|
120
120
|
|
|
121
121
|
### getJwk()
|
|
122
122
|
|
|
123
|
-
> `static` **getJwk**(`didDocument`, `methodName`, `methodType
|
|
123
|
+
> `static` **getJwk**(`didDocument`, `methodName`, `methodType?`): `IJwk`
|
|
124
124
|
|
|
125
125
|
Gets a JWK from a DID document verification method.
|
|
126
126
|
|
|
@@ -4,13 +4,13 @@ Helper methods for verification.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new VerificationHelper**():
|
|
9
|
+
> **new VerificationHelper**(): `VerificationHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`VerificationHelper`
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
@@ -30,9 +30,13 @@ Verified the JWT.
|
|
|
30
30
|
|
|
31
31
|
#### Type Parameters
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
##### T
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
`T` *extends* `IJwtHeader`
|
|
36
|
+
|
|
37
|
+
##### U
|
|
38
|
+
|
|
39
|
+
`U` *extends* `IJwtPayload`
|
|
36
40
|
|
|
37
41
|
#### Parameters
|
|
38
42
|
|
|
@@ -10,7 +10,7 @@ Interface describing a contract which provides identity operations.
|
|
|
10
10
|
|
|
11
11
|
### identityCreate()
|
|
12
12
|
|
|
13
|
-
> **identityCreate**(`namespace
|
|
13
|
+
> **identityCreate**(`namespace?`, `controller?`): `Promise`\<`IDidDocument`\>
|
|
14
14
|
|
|
15
15
|
Create a new identity.
|
|
16
16
|
|
|
@@ -38,7 +38,7 @@ The created identity document.
|
|
|
38
38
|
|
|
39
39
|
### verificationMethodCreate()
|
|
40
40
|
|
|
41
|
-
> **verificationMethodCreate**(`identity`, `verificationMethodType`, `verificationMethodId
|
|
41
|
+
> **verificationMethodCreate**(`identity`, `verificationMethodType`, `verificationMethodId?`, `controller?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
42
42
|
|
|
43
43
|
Add a verification method to the document in JSON Web key Format.
|
|
44
44
|
|
|
@@ -86,7 +86,7 @@ NotSupportedError if the platform does not support multiple keys.
|
|
|
86
86
|
|
|
87
87
|
### verificationMethodRemove()
|
|
88
88
|
|
|
89
|
-
> **verificationMethodRemove**(`verificationMethodId`, `controller
|
|
89
|
+
> **verificationMethodRemove**(`verificationMethodId`, `controller?`): `Promise`\<`void`\>
|
|
90
90
|
|
|
91
91
|
Remove a verification method from the document.
|
|
92
92
|
|
|
@@ -122,7 +122,7 @@ NotSupportedError if the platform does not support multiple revocable keys.
|
|
|
122
122
|
|
|
123
123
|
### serviceCreate()
|
|
124
124
|
|
|
125
|
-
> **serviceCreate**(`identity`, `serviceId`, `serviceType`, `serviceEndpoint`, `controller
|
|
125
|
+
> **serviceCreate**(`identity`, `serviceId`, `serviceType`, `serviceEndpoint`, `controller?`): `Promise`\<`IDidService`\>
|
|
126
126
|
|
|
127
127
|
Add a service to the document.
|
|
128
128
|
|
|
@@ -172,7 +172,7 @@ NotFoundError if the id can not be resolved.
|
|
|
172
172
|
|
|
173
173
|
### serviceRemove()
|
|
174
174
|
|
|
175
|
-
> **serviceRemove**(`serviceId`, `controller
|
|
175
|
+
> **serviceRemove**(`serviceId`, `controller?`): `Promise`\<`void`\>
|
|
176
176
|
|
|
177
177
|
Remove a service from the document.
|
|
178
178
|
|
|
@@ -204,7 +204,7 @@ NotFoundError if the id can not be resolved.
|
|
|
204
204
|
|
|
205
205
|
### verifiableCredentialCreate()
|
|
206
206
|
|
|
207
|
-
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `revocationIndex
|
|
207
|
+
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `revocationIndex?`, `controller?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
208
208
|
|
|
209
209
|
Create a verifiable credential for a verification method.
|
|
210
210
|
|
|
@@ -276,7 +276,7 @@ The credential stored in the jwt and the revocation status.
|
|
|
276
276
|
|
|
277
277
|
### verifiableCredentialRevoke()
|
|
278
278
|
|
|
279
|
-
> **verifiableCredentialRevoke**(`issuerId`, `credentialIndex`, `controller
|
|
279
|
+
> **verifiableCredentialRevoke**(`issuerId`, `credentialIndex`, `controller?`): `Promise`\<`void`\>
|
|
280
280
|
|
|
281
281
|
Revoke verifiable credential.
|
|
282
282
|
|
|
@@ -310,7 +310,7 @@ Nothing.
|
|
|
310
310
|
|
|
311
311
|
### verifiableCredentialUnrevoke()
|
|
312
312
|
|
|
313
|
-
> **verifiableCredentialUnrevoke**(`issuerId`, `credentialIndex`, `controller
|
|
313
|
+
> **verifiableCredentialUnrevoke**(`issuerId`, `credentialIndex`, `controller?`): `Promise`\<`void`\>
|
|
314
314
|
|
|
315
315
|
Unrevoke verifiable credential.
|
|
316
316
|
|
|
@@ -344,7 +344,7 @@ Nothing.
|
|
|
344
344
|
|
|
345
345
|
### verifiablePresentationCreate()
|
|
346
346
|
|
|
347
|
-
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes
|
|
347
|
+
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes?`, `controller?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
348
348
|
|
|
349
349
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
350
350
|
|
|
@@ -428,7 +428,7 @@ The presentation stored in the jwt and the revocation status.
|
|
|
428
428
|
|
|
429
429
|
### proofCreate()
|
|
430
430
|
|
|
431
|
-
> **proofCreate**(`verificationMethodId`, `proofType`, `unsecureDocument`, `controller
|
|
431
|
+
> **proofCreate**(`verificationMethodId`, `proofType`, `unsecureDocument`, `controller?`): `Promise`\<`IProof`\>
|
|
432
432
|
|
|
433
433
|
Create a proof for a document with the specified verification method.
|
|
434
434
|
|
|
@@ -32,7 +32,7 @@ The created document.
|
|
|
32
32
|
|
|
33
33
|
### addVerificationMethod()
|
|
34
34
|
|
|
35
|
-
> **addVerificationMethod**(`controller`, `documentId`, `verificationMethodType`, `verificationMethodId
|
|
35
|
+
> **addVerificationMethod**(`controller`, `documentId`, `verificationMethodType`, `verificationMethodId?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
36
36
|
|
|
37
37
|
Add a verification method to the document in JSON Web key Format.
|
|
38
38
|
|
|
@@ -198,7 +198,7 @@ NotFoundError if the id can not be resolved.
|
|
|
198
198
|
|
|
199
199
|
### createVerifiableCredential()
|
|
200
200
|
|
|
201
|
-
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `subject`, `revocationIndex
|
|
201
|
+
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `subject`, `revocationIndex?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
202
202
|
|
|
203
203
|
Create a verifiable credential for a verification method.
|
|
204
204
|
|
|
@@ -338,7 +338,7 @@ Nothing.
|
|
|
338
338
|
|
|
339
339
|
### createVerifiablePresentation()
|
|
340
340
|
|
|
341
|
-
> **createVerifiablePresentation**(`controller`, `verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes
|
|
341
|
+
> **createVerifiablePresentation**(`controller`, `verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
342
342
|
|
|
343
343
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
344
344
|
|
|
@@ -8,15 +8,19 @@ Interface describing a contract which provides profile operations.
|
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### T
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`T` *extends* `IJsonLdDocument` = `IJsonLdDocument`
|
|
14
|
+
|
|
15
|
+
### U
|
|
16
|
+
|
|
17
|
+
`U` *extends* `IJsonLdDocument` = `IJsonLdDocument`
|
|
14
18
|
|
|
15
19
|
## Methods
|
|
16
20
|
|
|
17
21
|
### create()
|
|
18
22
|
|
|
19
|
-
> **create**(`publicProfile
|
|
23
|
+
> **create**(`publicProfile?`, `privateProfile?`, `identity?`): `Promise`\<`void`\>
|
|
20
24
|
|
|
21
25
|
Create the profile properties for an identity.
|
|
22
26
|
|
|
@@ -50,7 +54,7 @@ Nothing.
|
|
|
50
54
|
|
|
51
55
|
### get()
|
|
52
56
|
|
|
53
|
-
> **get**(`publicPropertyNames
|
|
57
|
+
> **get**(`publicPropertyNames?`, `privatePropertyNames?`, `identity?`): `Promise`\<\{ `identity`: `string`; `publicProfile`: `Partial`\<`T`\>; `privateProfile`: `Partial`\<`U`\>; \}\>
|
|
54
58
|
|
|
55
59
|
Get the profile properties for an identity.
|
|
56
60
|
|
|
@@ -84,7 +88,7 @@ The items identity and the properties.
|
|
|
84
88
|
|
|
85
89
|
### getPublic()
|
|
86
90
|
|
|
87
|
-
> **getPublic**(`identity`, `propertyNames
|
|
91
|
+
> **getPublic**(`identity`, `propertyNames?`): `Promise`\<`Partial`\<`T`\>\>
|
|
88
92
|
|
|
89
93
|
Get the public profile properties for an identity.
|
|
90
94
|
|
|
@@ -112,7 +116,7 @@ The items properties.
|
|
|
112
116
|
|
|
113
117
|
### update()
|
|
114
118
|
|
|
115
|
-
> **update**(`publicProfile
|
|
119
|
+
> **update**(`publicProfile?`, `privateProfile?`, `identity?`): `Promise`\<`void`\>
|
|
116
120
|
|
|
117
121
|
Update the profile properties of an identity.
|
|
118
122
|
|
|
@@ -146,7 +150,7 @@ Nothing.
|
|
|
146
150
|
|
|
147
151
|
### remove()
|
|
148
152
|
|
|
149
|
-
> **remove**(`identity
|
|
153
|
+
> **remove**(`identity?`): `Promise`\<`void`\>
|
|
150
154
|
|
|
151
155
|
Delete the profile for an identity.
|
|
152
156
|
|
|
@@ -168,7 +172,7 @@ Nothing.
|
|
|
168
172
|
|
|
169
173
|
### list()
|
|
170
174
|
|
|
171
|
-
> **list**(`publicFilters
|
|
175
|
+
> **list**(`publicFilters?`, `publicPropertyNames?`, `cursor?`, `pageSize?`): `Promise`\<\{ `items`: `object`[]; `cursor`: `string`; \}\>
|
|
172
176
|
|
|
173
177
|
Get a list of the requested identities.
|
|
174
178
|
|
|
@@ -8,15 +8,19 @@ Interface describing a contract which provides profile operations.
|
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### T
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`T` *extends* `IJsonLdDocument` = `IJsonLdDocument`
|
|
14
|
+
|
|
15
|
+
### U
|
|
16
|
+
|
|
17
|
+
`U` *extends* `IJsonLdDocument` = `IJsonLdDocument`
|
|
14
18
|
|
|
15
19
|
## Methods
|
|
16
20
|
|
|
17
21
|
### create()
|
|
18
22
|
|
|
19
|
-
> **create**(`identity`, `publicProfile
|
|
23
|
+
> **create**(`identity`, `publicProfile?`, `privateProfile?`): `Promise`\<`void`\>
|
|
20
24
|
|
|
21
25
|
Create the profile properties for an identity.
|
|
22
26
|
|
|
@@ -50,7 +54,7 @@ Nothing.
|
|
|
50
54
|
|
|
51
55
|
### get()
|
|
52
56
|
|
|
53
|
-
> **get**(`identity`, `publicPropertyNames
|
|
57
|
+
> **get**(`identity`, `publicPropertyNames?`, `privatePropertyNames?`): `Promise`\<\{ `publicProfile`: `Partial`\<`T`\>; `privateProfile`: `Partial`\<`U`\>; \}\>
|
|
54
58
|
|
|
55
59
|
Get the profile properties for an identity.
|
|
56
60
|
|
|
@@ -84,7 +88,7 @@ The identity profile, will only return private data if you have correct permissi
|
|
|
84
88
|
|
|
85
89
|
### update()
|
|
86
90
|
|
|
87
|
-
> **update**(`identity`, `publicProfile
|
|
91
|
+
> **update**(`identity`, `publicProfile?`, `privateProfile?`): `Promise`\<`void`\>
|
|
88
92
|
|
|
89
93
|
Update the profile properties of an identity.
|
|
90
94
|
|
|
@@ -140,7 +144,7 @@ Nothing.
|
|
|
140
144
|
|
|
141
145
|
### list()
|
|
142
146
|
|
|
143
|
-
> **list**(`publicFilters
|
|
147
|
+
> **list**(`publicFilters?`, `privateFilters?`, `publicPropertyNames?`, `privatePropertyNames?`, `cursor?`, `pageSize?`): `Promise`\<\{ `items`: `object`[]; `cursor`: `string`; \}\>
|
|
144
148
|
|
|
145
149
|
Get a list of the requested identities.
|
|
146
150
|
|