@twin.org/identity-models 0.0.2-next.2 → 0.0.2-next.4
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/types/models/IIdentityComponent.d.ts +7 -2
- package/dist/types/models/IIdentityConnector.d.ts +7 -2
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateRequest.d.ts +4 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/interfaces/IIdentityComponent.md +12 -2
- package/docs/reference/interfaces/IIdentityConnector.md +12 -2
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +6 -0
- package/package.json +1 -1
|
@@ -63,12 +63,17 @@ export interface IIdentityComponent extends IComponent {
|
|
|
63
63
|
* @param verificationMethodId The verification method id to use.
|
|
64
64
|
* @param id The id of the credential.
|
|
65
65
|
* @param subject The credential subject to store in the verifiable credential.
|
|
66
|
-
* @param
|
|
66
|
+
* @param options Additional options for creating the verifiable credential.
|
|
67
|
+
* @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
68
|
+
* @param options.expirationDate The date the verifiable credential is valid until.
|
|
67
69
|
* @param controller The controller of the identity who can make changes.
|
|
68
70
|
* @returns The created verifiable credential and its token.
|
|
69
71
|
* @throws NotFoundError if the id can not be resolved.
|
|
70
72
|
*/
|
|
71
|
-
verifiableCredentialCreate(verificationMethodId: string, id: string | undefined, subject: IJsonLdNodeObject,
|
|
73
|
+
verifiableCredentialCreate(verificationMethodId: string, id: string | undefined, subject: IJsonLdNodeObject, options?: {
|
|
74
|
+
revocationIndex?: number;
|
|
75
|
+
expirationDate?: Date;
|
|
76
|
+
}, controller?: string): Promise<{
|
|
72
77
|
verifiableCredential: IDidVerifiableCredential;
|
|
73
78
|
jwt: string;
|
|
74
79
|
}>;
|
|
@@ -63,11 +63,16 @@ export interface IIdentityConnector extends IComponent {
|
|
|
63
63
|
* @param verificationMethodId The verification method id to use.
|
|
64
64
|
* @param id The id of the credential.
|
|
65
65
|
* @param subject The credential subject to store in the verifiable credential.
|
|
66
|
-
* @param
|
|
66
|
+
* @param options Additional options for creating the verifiable credential.
|
|
67
|
+
* @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
68
|
+
* @param options.expirationDate The date the verifiable credential is valid until.
|
|
67
69
|
* @returns The created verifiable credential and its token.
|
|
68
70
|
* @throws NotFoundError if the id can not be resolved.
|
|
69
71
|
*/
|
|
70
|
-
createVerifiableCredential(controller: string, verificationMethodId: string, id: string | undefined, subject: IJsonLdNodeObject,
|
|
72
|
+
createVerifiableCredential(controller: string, verificationMethodId: string, id: string | undefined, subject: IJsonLdNodeObject, options?: {
|
|
73
|
+
revocationIndex?: number;
|
|
74
|
+
expirationDate?: Date;
|
|
75
|
+
}): Promise<{
|
|
71
76
|
verifiableCredential: IDidVerifiableCredential;
|
|
72
77
|
jwt: string;
|
|
73
78
|
}>;
|
|
@@ -32,5 +32,9 @@ export interface IIdentityVerifiableCredentialCreateRequest {
|
|
|
32
32
|
* The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
33
33
|
*/
|
|
34
34
|
revocationIndex?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The date the verifiable credential is valid until.
|
|
37
|
+
*/
|
|
38
|
+
expirationDate?: string;
|
|
35
39
|
};
|
|
36
40
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/identity-service-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.2-next.3...identity-models-v0.0.2-next.4) (2025-09-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add expiration date option to vc creation ([73e05e1](https://github.com/twinfoundation/identity/commit/73e05e1ae61112c7e056889969751f4ff82d9f29))
|
|
9
|
+
|
|
10
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.2-next.2...identity-models-v0.0.2-next.3) (2025-08-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* eslint migration to flat config ([fd6246d](https://github.com/twinfoundation/identity/commit/fd6246d566280b6d5d10a108eb1e92c4b510f2f2))
|
|
16
|
+
|
|
3
17
|
## [0.0.2-next.2](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.2-next.1...identity-models-v0.0.2-next.2) (2025-08-20)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -232,7 +232,7 @@ NotFoundError if the id can not be resolved.
|
|
|
232
232
|
|
|
233
233
|
### verifiableCredentialCreate()
|
|
234
234
|
|
|
235
|
-
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `
|
|
235
|
+
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `options?`, `controller?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
236
236
|
|
|
237
237
|
Create a verifiable credential for a verification method.
|
|
238
238
|
|
|
@@ -256,12 +256,22 @@ The id of the credential.
|
|
|
256
256
|
|
|
257
257
|
The credential subject to store in the verifiable credential.
|
|
258
258
|
|
|
259
|
-
#####
|
|
259
|
+
##### options?
|
|
260
|
+
|
|
261
|
+
Additional options for creating the verifiable credential.
|
|
262
|
+
|
|
263
|
+
###### revocationIndex?
|
|
260
264
|
|
|
261
265
|
`number`
|
|
262
266
|
|
|
263
267
|
The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
264
268
|
|
|
269
|
+
###### expirationDate?
|
|
270
|
+
|
|
271
|
+
`Date`
|
|
272
|
+
|
|
273
|
+
The date the verifiable credential is valid until.
|
|
274
|
+
|
|
265
275
|
##### controller?
|
|
266
276
|
|
|
267
277
|
`string`
|
|
@@ -226,7 +226,7 @@ NotFoundError if the id can not be resolved.
|
|
|
226
226
|
|
|
227
227
|
### createVerifiableCredential()
|
|
228
228
|
|
|
229
|
-
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `subject`, `
|
|
229
|
+
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `subject`, `options?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
230
230
|
|
|
231
231
|
Create a verifiable credential for a verification method.
|
|
232
232
|
|
|
@@ -256,12 +256,22 @@ The id of the credential.
|
|
|
256
256
|
|
|
257
257
|
The credential subject to store in the verifiable credential.
|
|
258
258
|
|
|
259
|
-
#####
|
|
259
|
+
##### options?
|
|
260
|
+
|
|
261
|
+
Additional options for creating the verifiable credential.
|
|
262
|
+
|
|
263
|
+
###### revocationIndex?
|
|
260
264
|
|
|
261
265
|
`number`
|
|
262
266
|
|
|
263
267
|
The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
264
268
|
|
|
269
|
+
###### expirationDate?
|
|
270
|
+
|
|
271
|
+
`Date`
|
|
272
|
+
|
|
273
|
+
The date the verifiable credential is valid until.
|
|
274
|
+
|
|
265
275
|
#### Returns
|
|
266
276
|
|
|
267
277
|
`Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
@@ -47,3 +47,9 @@ The credential subject to store in the verifiable credential.
|
|
|
47
47
|
> `optional` **revocationIndex**: `number`
|
|
48
48
|
|
|
49
49
|
The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
50
|
+
|
|
51
|
+
#### expirationDate?
|
|
52
|
+
|
|
53
|
+
> `optional` **expirationDate**: `string`
|
|
54
|
+
|
|
55
|
+
The date the verifiable credential is valid until.
|