@twin.org/standards-w3c-did 0.0.1-next.22 → 0.0.1-next.24
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/index.d.ts +1 -0
- package/dist/types/models/IDidCredentialSchema.d.ts +13 -0
- package/dist/types/models/IDidDocument.d.ts +1 -1
- package/dist/types/models/IDidProof.d.ts +2 -2
- package/dist/types/models/IDidVerifiableCredential.d.ts +28 -4
- package/dist/types/models/IDidVerifiablePresentation.d.ts +3 -3
- package/docs/changelog.md +1 -1
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IDidCredentialSchema.md +19 -0
- package/docs/reference/interfaces/IDidDocument.md +2 -2
- package/docs/reference/interfaces/IDidProof.md +3 -3
- package/docs/reference/interfaces/IDidVerifiableCredential.md +29 -5
- package/docs/reference/interfaces/IDidVerifiablePresentation.md +4 -4
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./models/didContexts";
|
|
|
2
2
|
export * from "./models/didCryptoSuites";
|
|
3
3
|
export * from "./models/didTypes";
|
|
4
4
|
export * from "./models/didVerificationMethodType";
|
|
5
|
+
export * from "./models/IDidCredentialSchema";
|
|
5
6
|
export * from "./models/IDidCredentialStatus";
|
|
6
7
|
export * from "./models/IDidDocument";
|
|
7
8
|
export * from "./models/IDidDocumentVerificationMethod";
|
|
@@ -10,7 +10,7 @@ export interface IDidDocument {
|
|
|
10
10
|
/**
|
|
11
11
|
* The context for the document.
|
|
12
12
|
*/
|
|
13
|
-
"@context"
|
|
13
|
+
"@context": typeof DidContexts.Context | [typeof DidContexts.Context, ...IJsonLdContextDefinitionElement[]];
|
|
14
14
|
/**
|
|
15
15
|
* The id for the document.
|
|
16
16
|
*/
|
|
@@ -10,11 +10,11 @@ export interface IDidProof {
|
|
|
10
10
|
/**
|
|
11
11
|
* JSON-LD Context.
|
|
12
12
|
*/
|
|
13
|
-
"@context"
|
|
13
|
+
"@context"?: typeof DidContexts.ContextVCDataIntegrity | [typeof DidContexts.ContextVCDataIntegrity, ...IJsonLdContextDefinitionElement[]];
|
|
14
14
|
/**
|
|
15
15
|
* JSON-LD Type.
|
|
16
16
|
*/
|
|
17
|
-
type: typeof DidTypes.DataIntegrityProof;
|
|
17
|
+
type: typeof DidTypes.DataIntegrityProof | string;
|
|
18
18
|
/**
|
|
19
19
|
* An identifier for the cryptographic suite that can be used to verify the proof.
|
|
20
20
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import type { DidContexts } from "./didContexts";
|
|
3
|
+
import type { IDidCredentialSchema } from "./IDidCredentialSchema";
|
|
3
4
|
import type { IDidCredentialStatus } from "./IDidCredentialStatus";
|
|
4
5
|
import type { IDidProof } from "./IDidProof";
|
|
5
6
|
/**
|
|
@@ -10,7 +11,7 @@ export interface IDidVerifiableCredential {
|
|
|
10
11
|
/**
|
|
11
12
|
* The context for the verifiable credential.
|
|
12
13
|
*/
|
|
13
|
-
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, IJsonLdContextDefinitionElement];
|
|
14
|
+
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, ...IJsonLdContextDefinitionElement[]];
|
|
14
15
|
/**
|
|
15
16
|
* The identifier for the verifiable credential.
|
|
16
17
|
*/
|
|
@@ -22,20 +23,43 @@ export interface IDidVerifiableCredential {
|
|
|
22
23
|
/**
|
|
23
24
|
* The data for the verifiable credential.
|
|
24
25
|
*/
|
|
25
|
-
credentialSubject
|
|
26
|
+
credentialSubject?: IJsonLdNodeObject | IJsonLdNodeObject[];
|
|
26
27
|
/**
|
|
27
28
|
* Used to discover information about the current status of the
|
|
28
29
|
* verifiable credential, such as whether it is suspended or revoked.
|
|
29
30
|
*/
|
|
30
|
-
credentialStatus?: IDidCredentialStatus;
|
|
31
|
+
credentialStatus?: IDidCredentialStatus | IDidCredentialStatus[];
|
|
32
|
+
/**
|
|
33
|
+
* Annotate type definitions or lock them to specific versions of the vocabulary.
|
|
34
|
+
*/
|
|
35
|
+
credentialSchema?: IDidCredentialSchema | IDidCredentialSchema[];
|
|
31
36
|
/**
|
|
32
37
|
* The issuing identity.
|
|
33
38
|
*/
|
|
34
|
-
issuer?: string
|
|
39
|
+
issuer?: string | {
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
id: string;
|
|
42
|
+
};
|
|
35
43
|
/**
|
|
36
44
|
* The date the verifiable credential was issued.
|
|
37
45
|
*/
|
|
38
46
|
issuanceDate?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The name of the credential.
|
|
49
|
+
*/
|
|
50
|
+
name?: string | {
|
|
51
|
+
"@value": string;
|
|
52
|
+
"@language": string;
|
|
53
|
+
"@direction"?: string;
|
|
54
|
+
}[];
|
|
55
|
+
/**
|
|
56
|
+
* The description of the credential.
|
|
57
|
+
*/
|
|
58
|
+
description?: string | {
|
|
59
|
+
"@value": string;
|
|
60
|
+
"@language": string;
|
|
61
|
+
"@direction"?: string;
|
|
62
|
+
}[];
|
|
39
63
|
/**
|
|
40
64
|
* The date the verifiable credential is valid from.
|
|
41
65
|
*/
|
|
@@ -9,7 +9,7 @@ export interface IDidVerifiablePresentation {
|
|
|
9
9
|
/**
|
|
10
10
|
* The context for the verifiable presentation.
|
|
11
11
|
*/
|
|
12
|
-
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, IJsonLdContextDefinitionElement];
|
|
12
|
+
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, ...IJsonLdContextDefinitionElement[]];
|
|
13
13
|
/**
|
|
14
14
|
* Provide a unique identifier for the presentation.
|
|
15
15
|
*/
|
|
@@ -17,11 +17,11 @@ export interface IDidVerifiablePresentation {
|
|
|
17
17
|
/**
|
|
18
18
|
* The types of the data stored in the verifiable credential.
|
|
19
19
|
*/
|
|
20
|
-
type: string[];
|
|
20
|
+
type: string | string[];
|
|
21
21
|
/**
|
|
22
22
|
* The data for the verifiable credentials.
|
|
23
23
|
*/
|
|
24
|
-
verifiableCredential
|
|
24
|
+
verifiableCredential?: (string | IDidVerifiableCredential)[];
|
|
25
25
|
/**
|
|
26
26
|
* The entity generating the presentation.
|
|
27
27
|
*/
|
package/docs/changelog.md
CHANGED
package/docs/reference/index.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Interfaces
|
|
4
4
|
|
|
5
|
+
- [IDidCredentialSchema](interfaces/IDidCredentialSchema.md)
|
|
5
6
|
- [IDidCredentialStatus](interfaces/IDidCredentialStatus.md)
|
|
6
7
|
- [IDidDocument](interfaces/IDidDocument.md)
|
|
7
8
|
- [IDidDocumentVerificationMethod](interfaces/IDidDocumentVerificationMethod.md)
|
|
@@ -5,9 +5,9 @@ Spec https://www.w3.org/TR/did-core/#did-document-properties.
|
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
|
-
### @context
|
|
8
|
+
### @context
|
|
9
9
|
|
|
10
|
-
>
|
|
10
|
+
> **@context**: `"https://www.w3.org/ns/did/v1"` \| \[`"https://www.w3.org/ns/did/v1"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
11
11
|
|
|
12
12
|
The context for the document.
|
|
13
13
|
|
|
@@ -5,9 +5,9 @@ https://www.w3.org/TR/vc-data-integrity/
|
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
|
-
### @context
|
|
8
|
+
### @context?
|
|
9
9
|
|
|
10
|
-
> **@context**: `"https://w3id.org/security/data-integrity/v2"` \| \[`"https://w3id.org/security/data-integrity/v2"`,
|
|
10
|
+
> `optional` **@context**: `"https://w3id.org/security/data-integrity/v2"` \| \[`"https://w3id.org/security/data-integrity/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
11
11
|
|
|
12
12
|
JSON-LD Context.
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ JSON-LD Context.
|
|
|
15
15
|
|
|
16
16
|
### type
|
|
17
17
|
|
|
18
|
-
> **type**: `
|
|
18
|
+
> **type**: `string`
|
|
19
19
|
|
|
20
20
|
JSON-LD Type.
|
|
21
21
|
|
|
@@ -7,7 +7,7 @@ https://www.w3.org/TR/vc-data-model-2.0
|
|
|
7
7
|
|
|
8
8
|
### @context
|
|
9
9
|
|
|
10
|
-
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`,
|
|
10
|
+
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
11
11
|
|
|
12
12
|
The context for the verifiable credential.
|
|
13
13
|
|
|
@@ -29,9 +29,9 @@ The types of the data stored in the verifiable credential.
|
|
|
29
29
|
|
|
30
30
|
***
|
|
31
31
|
|
|
32
|
-
### credentialSubject
|
|
32
|
+
### credentialSubject?
|
|
33
33
|
|
|
34
|
-
> **credentialSubject**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
34
|
+
> `optional` **credentialSubject**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
35
35
|
|
|
36
36
|
The data for the verifiable credential.
|
|
37
37
|
|
|
@@ -39,16 +39,24 @@ The data for the verifiable credential.
|
|
|
39
39
|
|
|
40
40
|
### credentialStatus?
|
|
41
41
|
|
|
42
|
-
> `optional` **credentialStatus**: [`IDidCredentialStatus`](IDidCredentialStatus.md)
|
|
42
|
+
> `optional` **credentialStatus**: [`IDidCredentialStatus`](IDidCredentialStatus.md) \| [`IDidCredentialStatus`](IDidCredentialStatus.md)[]
|
|
43
43
|
|
|
44
44
|
Used to discover information about the current status of the
|
|
45
45
|
verifiable credential, such as whether it is suspended or revoked.
|
|
46
46
|
|
|
47
47
|
***
|
|
48
48
|
|
|
49
|
+
### credentialSchema?
|
|
50
|
+
|
|
51
|
+
> `optional` **credentialSchema**: [`IDidCredentialSchema`](IDidCredentialSchema.md) \| [`IDidCredentialSchema`](IDidCredentialSchema.md)[]
|
|
52
|
+
|
|
53
|
+
Annotate type definitions or lock them to specific versions of the vocabulary.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
49
57
|
### issuer?
|
|
50
58
|
|
|
51
|
-
> `optional` **issuer**: `string`
|
|
59
|
+
> `optional` **issuer**: `string` \| \{ `[key: string]`: `unknown`; `id`: `string`; \}
|
|
52
60
|
|
|
53
61
|
The issuing identity.
|
|
54
62
|
|
|
@@ -62,6 +70,22 @@ The date the verifiable credential was issued.
|
|
|
62
70
|
|
|
63
71
|
***
|
|
64
72
|
|
|
73
|
+
### name?
|
|
74
|
+
|
|
75
|
+
> `optional` **name**: `string` \| `object`[]
|
|
76
|
+
|
|
77
|
+
The name of the credential.
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### description?
|
|
82
|
+
|
|
83
|
+
> `optional` **description**: `string` \| `object`[]
|
|
84
|
+
|
|
85
|
+
The description of the credential.
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
65
89
|
### validFrom?
|
|
66
90
|
|
|
67
91
|
> `optional` **validFrom**: `string`
|
|
@@ -6,7 +6,7 @@ Interface describing a verifiable presentation.
|
|
|
6
6
|
|
|
7
7
|
### @context
|
|
8
8
|
|
|
9
|
-
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`,
|
|
9
|
+
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
10
10
|
|
|
11
11
|
The context for the verifiable presentation.
|
|
12
12
|
|
|
@@ -22,15 +22,15 @@ Provide a unique identifier for the presentation.
|
|
|
22
22
|
|
|
23
23
|
### type
|
|
24
24
|
|
|
25
|
-
> **type**: `string`[]
|
|
25
|
+
> **type**: `string` \| `string`[]
|
|
26
26
|
|
|
27
27
|
The types of the data stored in the verifiable credential.
|
|
28
28
|
|
|
29
29
|
***
|
|
30
30
|
|
|
31
|
-
### verifiableCredential
|
|
31
|
+
### verifiableCredential?
|
|
32
32
|
|
|
33
|
-
> **verifiableCredential**: (`string` \| [`IDidVerifiableCredential`](IDidVerifiableCredential.md))[]
|
|
33
|
+
> `optional` **verifiableCredential**: (`string` \| [`IDidVerifiableCredential`](IDidVerifiableCredential.md))[]
|
|
34
34
|
|
|
35
35
|
The data for the verifiable credentials.
|
|
36
36
|
|