@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.
@@ -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";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Interface describing a DID credential schema.
3
+ */
4
+ export interface IDidCredentialSchema {
5
+ /**
6
+ * The URI id.
7
+ */
8
+ id: string;
9
+ /**
10
+ * The credential schema type.
11
+ */
12
+ type: string;
13
+ }
@@ -10,7 +10,7 @@ export interface IDidDocument {
10
10
  /**
11
11
  * The context for the document.
12
12
  */
13
- "@context"?: typeof DidContexts.Context | [typeof DidContexts.Context, IJsonLdContextDefinitionElement];
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": typeof DidContexts.ContextVCDataIntegrity | [typeof DidContexts.ContextVCDataIntegrity, IJsonLdContextDefinitionElement];
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: IJsonLdNodeObject | IJsonLdNodeObject[];
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: (string | IDidVerifiableCredential)[];
24
+ verifiableCredential?: (string | IDidVerifiableCredential)[];
25
25
  /**
26
26
  * The entity generating the presentation.
27
27
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/standards-w3c-did - Changelog
2
2
 
3
- ## v0.0.1-next.22
3
+ ## v0.0.1-next.24
4
4
 
5
5
  - Initial Release
@@ -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)
@@ -0,0 +1,19 @@
1
+ # Interface: IDidCredentialSchema
2
+
3
+ Interface describing a DID credential schema.
4
+
5
+ ## Properties
6
+
7
+ ### id
8
+
9
+ > **id**: `string`
10
+
11
+ The URI id.
12
+
13
+ ***
14
+
15
+ ### type
16
+
17
+ > **type**: `string`
18
+
19
+ The credential schema type.
@@ -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
- > `optional` **@context**: `"https://www.w3.org/ns/did/v1"` \| \[`"https://www.w3.org/ns/did/v1"`, `IJsonLdContextDefinitionElement`\]
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"`, `IJsonLdContextDefinitionElement`\]
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**: `"DataIntegrityProof"`
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"`, `IJsonLdContextDefinitionElement`\]
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"`, `IJsonLdContextDefinitionElement`\]
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/standards-w3c-did",
3
- "version": "0.0.1-next.22",
3
+ "version": "0.0.1-next.24",
4
4
  "description": "Models which define the structure of W3C DID Standard",
5
5
  "repository": {
6
6
  "type": "git",