@twin.org/identity-models 0.0.1-next.23 → 0.0.1-next.25
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/dist/cjs/index.cjs +29 -5
- package/dist/esm/index.mjs +29 -5
- package/dist/types/index.d.ts +22 -0
- package/dist/types/models/IIdentityComponent.d.ts +22 -22
- package/dist/types/models/IIdentityConnector.d.ts +5 -5
- package/dist/types/models/api/identity/IIdentityCreateRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityProofCreateRequest.d.ts +27 -0
- package/dist/types/models/api/identity/IIdentityProofCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityProofVerifyRequest.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityProofVerifyResponse.d.ts +11 -0
- package/dist/types/models/api/identity/IIdentityServiceCreateRequest.d.ts +31 -0
- package/dist/types/models/api/identity/IIdentityServiceCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityServiceRemoveRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateRequest.d.ts +36 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateResponse.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyResponse.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateRequest.d.ts +45 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateResponse.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyResponse.d.ts +23 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodCreateRequest.d.ts +28 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodRemoveRequest.d.ts +18 -0
- package/dist/types/models/api/resolver/IIdentityResolveRequest.d.ts +1 -1
- package/dist/types/utils/documentHelper.d.ts +9 -2
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/DocumentHelper.md +32 -4
- package/docs/reference/classes/JwtHelper.md +2 -2
- package/docs/reference/index.md +22 -0
- package/docs/reference/interfaces/IIdentityComponent.md +70 -70
- package/docs/reference/interfaces/IIdentityConnector.md +9 -9
- package/docs/reference/interfaces/IIdentityCreateRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityProofCreateRequest.md +37 -0
- package/docs/reference/interfaces/IIdentityProofCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityProofVerifyRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityProofVerifyResponse.md +15 -0
- package/docs/reference/interfaces/IIdentityResolveRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityServiceCreateRequest.md +43 -0
- package/docs/reference/interfaces/IIdentityServiceCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityServiceRemoveRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +49 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialRevokeRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateRequest.md +61 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyResponse.md +29 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateRequest.md +37 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +23 -0
- package/docs/reference/variables/IdentityProfileConnectorFactory.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
|
|
2
|
+
/**
|
|
3
|
+
* Response to creating a verifiable presentation.
|
|
4
|
+
*/
|
|
5
|
+
export interface IIdentityVerifiablePresentationCreateResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The response payload.
|
|
8
|
+
*/
|
|
9
|
+
body: {
|
|
10
|
+
/**
|
|
11
|
+
* The verifiable presentation that was created.
|
|
12
|
+
*/
|
|
13
|
+
verifiablePresentation: IDidVerifiablePresentation;
|
|
14
|
+
/**
|
|
15
|
+
* The JWT token for the verifiable presentation.
|
|
16
|
+
*/
|
|
17
|
+
jwt: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IDidDocument, IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
|
|
2
|
+
/**
|
|
3
|
+
* Response to verifying a verifiable presentation.
|
|
4
|
+
*/
|
|
5
|
+
export interface IIdentityVerifiablePresentationVerifyResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The response payload.
|
|
8
|
+
*/
|
|
9
|
+
body: {
|
|
10
|
+
/**
|
|
11
|
+
* Has the presentation been revoked.
|
|
12
|
+
*/
|
|
13
|
+
revoked: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The verifiable presentation that was verified.
|
|
16
|
+
*/
|
|
17
|
+
verifiablePresentation?: IDidVerifiablePresentation;
|
|
18
|
+
/**
|
|
19
|
+
* The issuers of the presentation.
|
|
20
|
+
*/
|
|
21
|
+
issuers?: IDidDocument[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DidVerificationMethodType } from "@twin.org/standards-w3c-did";
|
|
2
|
+
/**
|
|
3
|
+
* Request to create a verification method.
|
|
4
|
+
*/
|
|
5
|
+
export interface IIdentityVerificationMethodCreateRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The path parameters.
|
|
8
|
+
*/
|
|
9
|
+
pathParams: {
|
|
10
|
+
/**
|
|
11
|
+
* The identity to create the verification method for.
|
|
12
|
+
*/
|
|
13
|
+
identity: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The data for the request.
|
|
17
|
+
*/
|
|
18
|
+
body: {
|
|
19
|
+
/**
|
|
20
|
+
* The type of the verification method to create.
|
|
21
|
+
*/
|
|
22
|
+
verificationMethodType: DidVerificationMethodType;
|
|
23
|
+
/**
|
|
24
|
+
* The optional id for the verification method, will be allocated if not supplied.
|
|
25
|
+
*/
|
|
26
|
+
verificationMethodId?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDidDocumentVerificationMethod } from "@twin.org/standards-w3c-did";
|
|
2
|
+
/**
|
|
3
|
+
* Response to creating a verification method.
|
|
4
|
+
*/
|
|
5
|
+
export interface IIdentityVerificationMethodCreateResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The response payload.
|
|
8
|
+
*/
|
|
9
|
+
body: IDidDocumentVerificationMethod;
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request to remove a verification method.
|
|
3
|
+
*/
|
|
4
|
+
export interface IIdentityVerificationMethodRemoveRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The path parameters.
|
|
7
|
+
*/
|
|
8
|
+
pathParams: {
|
|
9
|
+
/**
|
|
10
|
+
* The identity to remove the verification method from.
|
|
11
|
+
*/
|
|
12
|
+
identity: string;
|
|
13
|
+
/**
|
|
14
|
+
* The verification method to remove.
|
|
15
|
+
*/
|
|
16
|
+
verificationMethodId: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -7,8 +7,15 @@ export declare class DocumentHelper {
|
|
|
7
7
|
* @param documentId The full document id.
|
|
8
8
|
* @returns The parsed document id.
|
|
9
9
|
*/
|
|
10
|
-
static
|
|
10
|
+
static parseId(documentId: string): {
|
|
11
11
|
id: string;
|
|
12
|
-
|
|
12
|
+
fragment: string | undefined;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Join the document id parts.
|
|
16
|
+
* @param documentId The document id.
|
|
17
|
+
* @param fragment The fragment part for the identifier.
|
|
18
|
+
* @returns The full id.
|
|
19
|
+
*/
|
|
20
|
+
static joinId(documentId: string, fragment?: string): string;
|
|
14
21
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -14,9 +14,9 @@ Helper methods for documents.
|
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### parseId()
|
|
18
18
|
|
|
19
|
-
> `static` **
|
|
19
|
+
> `static` **parseId**(`documentId`): `object`
|
|
20
20
|
|
|
21
21
|
Parse the document id into its parts.
|
|
22
22
|
|
|
@@ -38,6 +38,34 @@ The parsed document id.
|
|
|
38
38
|
|
|
39
39
|
> **id**: `string`
|
|
40
40
|
|
|
41
|
-
#####
|
|
41
|
+
##### fragment
|
|
42
42
|
|
|
43
|
-
> **
|
|
43
|
+
> **fragment**: `undefined` \| `string`
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### joinId()
|
|
48
|
+
|
|
49
|
+
> `static` **joinId**(`documentId`, `fragment`?): `string`
|
|
50
|
+
|
|
51
|
+
Join the document id parts.
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
##### documentId
|
|
56
|
+
|
|
57
|
+
`string`
|
|
58
|
+
|
|
59
|
+
The document id.
|
|
60
|
+
|
|
61
|
+
##### fragment?
|
|
62
|
+
|
|
63
|
+
`string`
|
|
64
|
+
|
|
65
|
+
The fragment part for the identifier.
|
|
66
|
+
|
|
67
|
+
#### Returns
|
|
68
|
+
|
|
69
|
+
`string`
|
|
70
|
+
|
|
71
|
+
The full id.
|
|
@@ -24,7 +24,7 @@ Runtime name for the class.
|
|
|
24
24
|
|
|
25
25
|
### parse()
|
|
26
26
|
|
|
27
|
-
> `static` **parse**\<`U`, `T`\>(`jwt`, `paramsToCheck`?): `Promise`\<\{ `header`: `U`; `payload`: `T`; `signature`: `Uint8Array
|
|
27
|
+
> `static` **parse**\<`U`, `T`\>(`jwt`, `paramsToCheck`?): `Promise`\<\{ `header`: `U`; `payload`: `T`; `signature`: `Uint8Array`\<`ArrayBufferLike`\>; \}\>
|
|
28
28
|
|
|
29
29
|
Parse the token and check that the properties are valid.
|
|
30
30
|
|
|
@@ -50,7 +50,7 @@ Parameters to check they exist.
|
|
|
50
50
|
|
|
51
51
|
#### Returns
|
|
52
52
|
|
|
53
|
-
`Promise`\<\{ `header`: `U`; `payload`: `T`; `signature`: `Uint8Array
|
|
53
|
+
`Promise`\<\{ `header`: `U`; `payload`: `T`; `signature`: `Uint8Array`\<`ArrayBufferLike`\>; \}\>
|
|
54
54
|
|
|
55
55
|
The token components.
|
|
56
56
|
|
package/docs/reference/index.md
CHANGED
|
@@ -13,6 +13,28 @@
|
|
|
13
13
|
- [IIdentityProfileConnector](interfaces/IIdentityProfileConnector.md)
|
|
14
14
|
- [IIdentityResolverComponent](interfaces/IIdentityResolverComponent.md)
|
|
15
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
|
+
- [IIdentityServiceCreateRequest](interfaces/IIdentityServiceCreateRequest.md)
|
|
23
|
+
- [IIdentityServiceCreateResponse](interfaces/IIdentityServiceCreateResponse.md)
|
|
24
|
+
- [IIdentityServiceRemoveRequest](interfaces/IIdentityServiceRemoveRequest.md)
|
|
25
|
+
- [IIdentityVerifiableCredentialCreateRequest](interfaces/IIdentityVerifiableCredentialCreateRequest.md)
|
|
26
|
+
- [IIdentityVerifiableCredentialCreateResponse](interfaces/IIdentityVerifiableCredentialCreateResponse.md)
|
|
27
|
+
- [IIdentityVerifiableCredentialRevokeRequest](interfaces/IIdentityVerifiableCredentialRevokeRequest.md)
|
|
28
|
+
- [IIdentityVerifiableCredentialUnrevokeRequest](interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md)
|
|
29
|
+
- [IIdentityVerifiableCredentialVerifyRequest](interfaces/IIdentityVerifiableCredentialVerifyRequest.md)
|
|
30
|
+
- [IIdentityVerifiableCredentialVerifyResponse](interfaces/IIdentityVerifiableCredentialVerifyResponse.md)
|
|
31
|
+
- [IIdentityVerifiablePresentationCreateRequest](interfaces/IIdentityVerifiablePresentationCreateRequest.md)
|
|
32
|
+
- [IIdentityVerifiablePresentationCreateResponse](interfaces/IIdentityVerifiablePresentationCreateResponse.md)
|
|
33
|
+
- [IIdentityVerifiablePresentationVerifyRequest](interfaces/IIdentityVerifiablePresentationVerifyRequest.md)
|
|
34
|
+
- [IIdentityVerifiablePresentationVerifyResponse](interfaces/IIdentityVerifiablePresentationVerifyResponse.md)
|
|
35
|
+
- [IIdentityVerificationMethodCreateRequest](interfaces/IIdentityVerificationMethodCreateRequest.md)
|
|
36
|
+
- [IIdentityVerificationMethodCreateResponse](interfaces/IIdentityVerificationMethodCreateResponse.md)
|
|
37
|
+
- [IIdentityVerificationMethodRemoveRequest](interfaces/IIdentityVerificationMethodRemoveRequest.md)
|
|
16
38
|
- [IIdentityProfileCreateRequest](interfaces/IIdentityProfileCreateRequest.md)
|
|
17
39
|
- [IIdentityProfileGetPublicRequest](interfaces/IIdentityProfileGetPublicRequest.md)
|
|
18
40
|
- [IIdentityProfileGetPublicResponse](interfaces/IIdentityProfileGetPublicResponse.md)
|
|
@@ -10,23 +10,23 @@ Interface describing a contract which provides identity operations.
|
|
|
10
10
|
|
|
11
11
|
### identityCreate()
|
|
12
12
|
|
|
13
|
-
> **identityCreate**(`
|
|
13
|
+
> **identityCreate**(`namespace`?, `controller`?): `Promise`\<`IDidDocument`\>
|
|
14
14
|
|
|
15
15
|
Create a new identity.
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
#####
|
|
19
|
+
##### namespace?
|
|
20
20
|
|
|
21
21
|
`string`
|
|
22
22
|
|
|
23
|
-
The
|
|
23
|
+
The namespace of the connector to use for the identity, defaults to service configured namespace.
|
|
24
24
|
|
|
25
|
-
#####
|
|
25
|
+
##### controller?
|
|
26
26
|
|
|
27
27
|
`string`
|
|
28
28
|
|
|
29
|
-
The
|
|
29
|
+
The controller of the identity who can make changes.
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
@@ -38,18 +38,12 @@ The created identity document.
|
|
|
38
38
|
|
|
39
39
|
### verificationMethodCreate()
|
|
40
40
|
|
|
41
|
-
> **verificationMethodCreate**(`
|
|
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
|
|
|
45
45
|
#### Parameters
|
|
46
46
|
|
|
47
|
-
##### controller
|
|
48
|
-
|
|
49
|
-
`string`
|
|
50
|
-
|
|
51
|
-
The controller of the identity who can make changes.
|
|
52
|
-
|
|
53
47
|
##### identity
|
|
54
48
|
|
|
55
49
|
`string`
|
|
@@ -68,6 +62,12 @@ The type of the verification method to add.
|
|
|
68
62
|
|
|
69
63
|
The id of the verification method, if undefined uses the kid of the generated JWK.
|
|
70
64
|
|
|
65
|
+
##### controller?
|
|
66
|
+
|
|
67
|
+
`string`
|
|
68
|
+
|
|
69
|
+
The controller of the identity who can make changes.
|
|
70
|
+
|
|
71
71
|
#### Returns
|
|
72
72
|
|
|
73
73
|
`Promise`\<`IDidDocumentVerificationMethod`\>
|
|
@@ -86,23 +86,23 @@ NotSupportedError if the platform does not support multiple keys.
|
|
|
86
86
|
|
|
87
87
|
### verificationMethodRemove()
|
|
88
88
|
|
|
89
|
-
> **verificationMethodRemove**(`
|
|
89
|
+
> **verificationMethodRemove**(`verificationMethodId`, `controller`?): `Promise`\<`void`\>
|
|
90
90
|
|
|
91
91
|
Remove a verification method from the document.
|
|
92
92
|
|
|
93
93
|
#### Parameters
|
|
94
94
|
|
|
95
|
-
#####
|
|
95
|
+
##### verificationMethodId
|
|
96
96
|
|
|
97
97
|
`string`
|
|
98
98
|
|
|
99
|
-
The
|
|
99
|
+
The id of the verification method.
|
|
100
100
|
|
|
101
|
-
#####
|
|
101
|
+
##### controller?
|
|
102
102
|
|
|
103
103
|
`string`
|
|
104
104
|
|
|
105
|
-
The
|
|
105
|
+
The controller of the identity who can make changes.
|
|
106
106
|
|
|
107
107
|
#### Returns
|
|
108
108
|
|
|
@@ -122,18 +122,12 @@ NotSupportedError if the platform does not support multiple revocable keys.
|
|
|
122
122
|
|
|
123
123
|
### serviceCreate()
|
|
124
124
|
|
|
125
|
-
> **serviceCreate**(`
|
|
125
|
+
> **serviceCreate**(`identity`, `serviceId`, `serviceType`, `serviceEndpoint`, `controller`?): `Promise`\<`IDidService`\>
|
|
126
126
|
|
|
127
127
|
Add a service to the document.
|
|
128
128
|
|
|
129
129
|
#### Parameters
|
|
130
130
|
|
|
131
|
-
##### controller
|
|
132
|
-
|
|
133
|
-
`string`
|
|
134
|
-
|
|
135
|
-
The controller of the identity who can make changes.
|
|
136
|
-
|
|
137
131
|
##### identity
|
|
138
132
|
|
|
139
133
|
`string`
|
|
@@ -148,15 +142,21 @@ The id of the service.
|
|
|
148
142
|
|
|
149
143
|
##### serviceType
|
|
150
144
|
|
|
151
|
-
`string`
|
|
152
|
-
|
|
153
145
|
The type of the service.
|
|
154
146
|
|
|
147
|
+
`string` | `string`[]
|
|
148
|
+
|
|
155
149
|
##### serviceEndpoint
|
|
156
150
|
|
|
151
|
+
The endpoint for the service.
|
|
152
|
+
|
|
153
|
+
`string` | `string`[]
|
|
154
|
+
|
|
155
|
+
##### controller?
|
|
156
|
+
|
|
157
157
|
`string`
|
|
158
158
|
|
|
159
|
-
The
|
|
159
|
+
The controller of the identity who can make changes.
|
|
160
160
|
|
|
161
161
|
#### Returns
|
|
162
162
|
|
|
@@ -172,23 +172,23 @@ NotFoundError if the id can not be resolved.
|
|
|
172
172
|
|
|
173
173
|
### serviceRemove()
|
|
174
174
|
|
|
175
|
-
> **serviceRemove**(`
|
|
175
|
+
> **serviceRemove**(`serviceId`, `controller`?): `Promise`\<`void`\>
|
|
176
176
|
|
|
177
177
|
Remove a service from the document.
|
|
178
178
|
|
|
179
179
|
#### Parameters
|
|
180
180
|
|
|
181
|
-
#####
|
|
181
|
+
##### serviceId
|
|
182
182
|
|
|
183
183
|
`string`
|
|
184
184
|
|
|
185
|
-
The
|
|
185
|
+
The id of the service.
|
|
186
186
|
|
|
187
|
-
#####
|
|
187
|
+
##### controller?
|
|
188
188
|
|
|
189
189
|
`string`
|
|
190
190
|
|
|
191
|
-
The
|
|
191
|
+
The controller of the identity who can make changes.
|
|
192
192
|
|
|
193
193
|
#### Returns
|
|
194
194
|
|
|
@@ -204,18 +204,12 @@ NotFoundError if the id can not be resolved.
|
|
|
204
204
|
|
|
205
205
|
### verifiableCredentialCreate()
|
|
206
206
|
|
|
207
|
-
> **verifiableCredentialCreate**(`
|
|
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
|
|
|
211
211
|
#### Parameters
|
|
212
212
|
|
|
213
|
-
##### controller
|
|
214
|
-
|
|
215
|
-
`string`
|
|
216
|
-
|
|
217
|
-
The controller of the identity who can make changes.
|
|
218
|
-
|
|
219
213
|
##### verificationMethodId
|
|
220
214
|
|
|
221
215
|
`string`
|
|
@@ -228,11 +222,11 @@ The id of the credential.
|
|
|
228
222
|
|
|
229
223
|
`undefined` | `string`
|
|
230
224
|
|
|
231
|
-
#####
|
|
225
|
+
##### subject
|
|
232
226
|
|
|
233
227
|
`IJsonLdNodeObject`
|
|
234
228
|
|
|
235
|
-
The credential to store in the verifiable credential.
|
|
229
|
+
The credential subject to store in the verifiable credential.
|
|
236
230
|
|
|
237
231
|
##### revocationIndex?
|
|
238
232
|
|
|
@@ -240,6 +234,12 @@ The credential to store in the verifiable credential.
|
|
|
240
234
|
|
|
241
235
|
The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
242
236
|
|
|
237
|
+
##### controller?
|
|
238
|
+
|
|
239
|
+
`string`
|
|
240
|
+
|
|
241
|
+
The controller of the identity who can make changes.
|
|
242
|
+
|
|
243
243
|
#### Returns
|
|
244
244
|
|
|
245
245
|
`Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
@@ -276,18 +276,12 @@ The credential stored in the jwt and the revocation status.
|
|
|
276
276
|
|
|
277
277
|
### verifiableCredentialRevoke()
|
|
278
278
|
|
|
279
|
-
> **verifiableCredentialRevoke**(`
|
|
279
|
+
> **verifiableCredentialRevoke**(`issuerId`, `credentialIndex`, `controller`?): `Promise`\<`void`\>
|
|
280
280
|
|
|
281
281
|
Revoke verifiable credential.
|
|
282
282
|
|
|
283
283
|
#### Parameters
|
|
284
284
|
|
|
285
|
-
##### controller
|
|
286
|
-
|
|
287
|
-
`string`
|
|
288
|
-
|
|
289
|
-
The controller of the identity who can make changes.
|
|
290
|
-
|
|
291
285
|
##### issuerId
|
|
292
286
|
|
|
293
287
|
`string`
|
|
@@ -300,6 +294,12 @@ The id of the document to update the revocation list for.
|
|
|
300
294
|
|
|
301
295
|
The revocation bitmap index revoke.
|
|
302
296
|
|
|
297
|
+
##### controller?
|
|
298
|
+
|
|
299
|
+
`string`
|
|
300
|
+
|
|
301
|
+
The controller of the identity who can make changes.
|
|
302
|
+
|
|
303
303
|
#### Returns
|
|
304
304
|
|
|
305
305
|
`Promise`\<`void`\>
|
|
@@ -310,18 +310,12 @@ Nothing.
|
|
|
310
310
|
|
|
311
311
|
### verifiableCredentialUnrevoke()
|
|
312
312
|
|
|
313
|
-
> **verifiableCredentialUnrevoke**(`
|
|
313
|
+
> **verifiableCredentialUnrevoke**(`issuerId`, `credentialIndex`, `controller`?): `Promise`\<`void`\>
|
|
314
314
|
|
|
315
315
|
Unrevoke verifiable credential.
|
|
316
316
|
|
|
317
317
|
#### Parameters
|
|
318
318
|
|
|
319
|
-
##### controller
|
|
320
|
-
|
|
321
|
-
`string`
|
|
322
|
-
|
|
323
|
-
The controller of the identity who can make changes.
|
|
324
|
-
|
|
325
319
|
##### issuerId
|
|
326
320
|
|
|
327
321
|
`string`
|
|
@@ -334,6 +328,12 @@ The id of the document to update the revocation list for.
|
|
|
334
328
|
|
|
335
329
|
The revocation bitmap index to un revoke.
|
|
336
330
|
|
|
331
|
+
##### controller?
|
|
332
|
+
|
|
333
|
+
`string`
|
|
334
|
+
|
|
335
|
+
The controller of the identity who can make changes.
|
|
336
|
+
|
|
337
337
|
#### Returns
|
|
338
338
|
|
|
339
339
|
`Promise`\<`void`\>
|
|
@@ -344,19 +344,13 @@ Nothing.
|
|
|
344
344
|
|
|
345
345
|
### verifiablePresentationCreate()
|
|
346
346
|
|
|
347
|
-
> **verifiablePresentationCreate**(`
|
|
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
|
|
|
351
351
|
#### Parameters
|
|
352
352
|
|
|
353
|
-
#####
|
|
354
|
-
|
|
355
|
-
`string`
|
|
356
|
-
|
|
357
|
-
The controller of the identity who can make changes.
|
|
358
|
-
|
|
359
|
-
##### presentationMethodId
|
|
353
|
+
##### verificationMethodId
|
|
360
354
|
|
|
361
355
|
`string`
|
|
362
356
|
|
|
@@ -392,6 +386,12 @@ The credentials to use for creating the presentation in jwt format.
|
|
|
392
386
|
|
|
393
387
|
The time in minutes for the presentation to expire.
|
|
394
388
|
|
|
389
|
+
##### controller?
|
|
390
|
+
|
|
391
|
+
`string`
|
|
392
|
+
|
|
393
|
+
The controller of the identity who can make changes.
|
|
394
|
+
|
|
395
395
|
#### Returns
|
|
396
396
|
|
|
397
397
|
`Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
@@ -428,18 +428,12 @@ The presentation stored in the jwt and the revocation status.
|
|
|
428
428
|
|
|
429
429
|
### proofCreate()
|
|
430
430
|
|
|
431
|
-
> **proofCreate**(`
|
|
431
|
+
> **proofCreate**(`verificationMethodId`, `bytes`, `controller`?): `Promise`\<`IDidProof`\>
|
|
432
432
|
|
|
433
433
|
Create a proof for arbitrary data with the specified verification method.
|
|
434
434
|
|
|
435
435
|
#### Parameters
|
|
436
436
|
|
|
437
|
-
##### controller
|
|
438
|
-
|
|
439
|
-
`string`
|
|
440
|
-
|
|
441
|
-
The controller of the identity who can make changes.
|
|
442
|
-
|
|
443
437
|
##### verificationMethodId
|
|
444
438
|
|
|
445
439
|
`string`
|
|
@@ -452,6 +446,12 @@ The verification method id to use.
|
|
|
452
446
|
|
|
453
447
|
The data bytes to sign.
|
|
454
448
|
|
|
449
|
+
##### controller?
|
|
450
|
+
|
|
451
|
+
`string`
|
|
452
|
+
|
|
453
|
+
The controller of the identity who can make changes.
|
|
454
|
+
|
|
455
455
|
#### Returns
|
|
456
456
|
|
|
457
457
|
`Promise`\<`IDidProof`\>
|
|
@@ -142,16 +142,16 @@ The id of the service.
|
|
|
142
142
|
|
|
143
143
|
##### serviceType
|
|
144
144
|
|
|
145
|
-
`string`
|
|
146
|
-
|
|
147
145
|
The type of the service.
|
|
148
146
|
|
|
149
|
-
|
|
147
|
+
`string` | `string`[]
|
|
150
148
|
|
|
151
|
-
|
|
149
|
+
##### serviceEndpoint
|
|
152
150
|
|
|
153
151
|
The endpoint for the service.
|
|
154
152
|
|
|
153
|
+
`string` | `string`[]
|
|
154
|
+
|
|
155
155
|
#### Returns
|
|
156
156
|
|
|
157
157
|
`Promise`\<`IDidService`\>
|
|
@@ -198,7 +198,7 @@ NotFoundError if the id can not be resolved.
|
|
|
198
198
|
|
|
199
199
|
### createVerifiableCredential()
|
|
200
200
|
|
|
201
|
-
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `
|
|
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
|
|
|
@@ -222,11 +222,11 @@ The id of the credential.
|
|
|
222
222
|
|
|
223
223
|
`undefined` | `string`
|
|
224
224
|
|
|
225
|
-
#####
|
|
225
|
+
##### subject
|
|
226
226
|
|
|
227
227
|
`IJsonLdNodeObject`
|
|
228
228
|
|
|
229
|
-
The credential to store in the verifiable credential.
|
|
229
|
+
The credential subject to store in the verifiable credential.
|
|
230
230
|
|
|
231
231
|
##### revocationIndex?
|
|
232
232
|
|
|
@@ -338,7 +338,7 @@ Nothing.
|
|
|
338
338
|
|
|
339
339
|
### createVerifiablePresentation()
|
|
340
340
|
|
|
341
|
-
> **createVerifiablePresentation**(`controller`, `
|
|
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
|
|
|
@@ -350,7 +350,7 @@ Create a verifiable presentation from the supplied verifiable credentials.
|
|
|
350
350
|
|
|
351
351
|
The controller of the identity who can make changes.
|
|
352
352
|
|
|
353
|
-
#####
|
|
353
|
+
##### verificationMethodId
|
|
354
354
|
|
|
355
355
|
`string`
|
|
356
356
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IIdentityCreateRequest
|
|
2
|
+
|
|
3
|
+
Request to create an identity.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body?
|
|
8
|
+
|
|
9
|
+
> `optional` **body**: `object`
|
|
10
|
+
|
|
11
|
+
The data for the request.
|
|
12
|
+
|
|
13
|
+
#### namespace?
|
|
14
|
+
|
|
15
|
+
> `optional` **namespace**: `string`
|
|
16
|
+
|
|
17
|
+
The optional namespace to create the identity in.
|