@twin.org/standards-w3c-did 0.9.2 → 0.9.3-next.2

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.
Files changed (28) hide show
  1. package/dist/es/dataTypes/didDataTypes.js +111 -2
  2. package/dist/es/dataTypes/didDataTypes.js.map +1 -1
  3. package/dist/es/models/didTypes.js +77 -1
  4. package/dist/es/models/didTypes.js.map +1 -1
  5. package/dist/es/schemas/DataIntegrityProof.json +116 -0
  6. package/dist/es/schemas/DidCredentialSchema.json +21 -0
  7. package/dist/es/schemas/DidCredentialStatus.json +22 -0
  8. package/dist/es/schemas/DidCryptoSuites.json +16 -0
  9. package/dist/es/schemas/DidDocumentVerificationMethod.json +45 -0
  10. package/dist/es/schemas/DidLabel.json +25 -0
  11. package/dist/es/schemas/DidPresentationVerification.json +38 -0
  12. package/dist/es/schemas/DidService.json +46 -0
  13. package/dist/es/schemas/DidTypes.json +112 -0
  14. package/dist/es/schemas/DidVerifiableCredentialCommon.json +173 -0
  15. package/dist/es/schemas/DidVerifiableCredentialV1.json +52 -0
  16. package/dist/es/schemas/DidVerifiableCredentialV2.json +52 -0
  17. package/dist/es/schemas/DidVerifiablePresentationCommon.json +48 -0
  18. package/dist/es/schemas/DidVerifiablePresentationV1.json +58 -0
  19. package/dist/es/schemas/DidVerifiablePresentationV2.json +58 -0
  20. package/dist/es/schemas/DidVerificationMethodType.json +32 -0
  21. package/dist/es/schemas/JsonWebSignature2020Proof.json +60 -0
  22. package/dist/es/schemas/Multikey.json +90 -0
  23. package/dist/es/schemas/Proof.json +14 -0
  24. package/dist/es/schemas/ProofTypes.json +16 -0
  25. package/dist/types/models/didTypes.d.ts +76 -0
  26. package/docs/changelog.md +62 -0
  27. package/docs/reference/variables/DidTypes.md +114 -0
  28. package/package.json +7 -7
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidTypes",
4
+ "title": "DidTypes",
5
+ "description": "The types for DIDs.",
6
+ "anyOf": [
7
+ {
8
+ "const": "Document",
9
+ "description": "The type for Document."
10
+ },
11
+ {
12
+ "const": "VerifiableCredential",
13
+ "description": "The type for Verifiable Credential."
14
+ },
15
+ {
16
+ "const": "VerifiablePresentation",
17
+ "description": "The type for Verifiable Presentation."
18
+ },
19
+ {
20
+ "const": "Ed25519VerificationKey2020",
21
+ "description": "The type for Ed25519VerificationKey2020."
22
+ },
23
+ {
24
+ "const": "JsonWebKey2020",
25
+ "description": "The type for JsonWebKey2020."
26
+ },
27
+ {
28
+ "const": "LinkedDomains",
29
+ "description": "The type for LinkedDomains."
30
+ },
31
+ {
32
+ "const": "Multikey",
33
+ "description": "The type for Multikey."
34
+ },
35
+ {
36
+ "const": "CredentialSchema",
37
+ "description": "The type for CredentialSchema."
38
+ },
39
+ {
40
+ "const": "CredentialStatus",
41
+ "description": "The type for CredentialStatus."
42
+ },
43
+ {
44
+ "const": "CryptoSuites",
45
+ "description": "The type for CryptoSuites."
46
+ },
47
+ {
48
+ "const": "DataIntegrityProof",
49
+ "description": "The type for DataIntegrityProof."
50
+ },
51
+ {
52
+ "const": "DocumentVerificationMethod",
53
+ "description": "The type for DocumentVerificationMethod."
54
+ },
55
+ {
56
+ "const": "JsonWebSignature2020Proof",
57
+ "description": "The type for JsonWebSignature2020Proof."
58
+ },
59
+ {
60
+ "const": "Label",
61
+ "description": "The type for Label."
62
+ },
63
+ {
64
+ "const": "PresentationVerification",
65
+ "description": "The type for PresentationVerification."
66
+ },
67
+ {
68
+ "const": "Proof",
69
+ "description": "The type for Proof."
70
+ },
71
+ {
72
+ "const": "ProofTypes",
73
+ "description": "The type for ProofTypes."
74
+ },
75
+ {
76
+ "const": "Service",
77
+ "description": "The type for Service."
78
+ },
79
+ {
80
+ "const": "Types",
81
+ "description": "The type for Types."
82
+ },
83
+ {
84
+ "const": "VerifiableCredentialCommon",
85
+ "description": "The type for VerifiableCredentialCommon."
86
+ },
87
+ {
88
+ "const": "VerifiableCredentialV1",
89
+ "description": "The type for VerifiableCredentialV1."
90
+ },
91
+ {
92
+ "const": "VerifiableCredentialV2",
93
+ "description": "The type for VerifiableCredentialV2."
94
+ },
95
+ {
96
+ "const": "VerifiablePresentationCommon",
97
+ "description": "The type for VerifiablePresentationCommon."
98
+ },
99
+ {
100
+ "const": "VerifiablePresentationV1",
101
+ "description": "The type for VerifiablePresentationV1."
102
+ },
103
+ {
104
+ "const": "VerifiablePresentationV2",
105
+ "description": "The type for VerifiablePresentationV2."
106
+ },
107
+ {
108
+ "const": "VerificationMethodType",
109
+ "description": "The type for VerificationMethodType."
110
+ }
111
+ ]
112
+ }
@@ -0,0 +1,173 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialCommon",
4
+ "title": "DidVerifiableCredentialCommon",
5
+ "description": "Common properties shared by all verifiable credential versions.",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "type": "string",
10
+ "description": "The identifier for the verifiable credential."
11
+ },
12
+ "type": {
13
+ "anyOf": [
14
+ {
15
+ "type": "string"
16
+ },
17
+ {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "string"
21
+ }
22
+ }
23
+ ],
24
+ "description": "The types of the data stored in the verifiable credential."
25
+ },
26
+ "credentialSubject": {
27
+ "anyOf": [
28
+ {
29
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
30
+ },
31
+ {
32
+ "type": "array",
33
+ "items": {
34
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
35
+ }
36
+ }
37
+ ],
38
+ "description": "The data for the verifiable credential."
39
+ },
40
+ "credentialStatus": {
41
+ "anyOf": [
42
+ {
43
+ "$ref": "https://schema.twindev.org/w3c-did/DidCredentialStatus"
44
+ },
45
+ {
46
+ "type": "array",
47
+ "items": {
48
+ "$ref": "https://schema.twindev.org/w3c-did/DidCredentialStatus"
49
+ }
50
+ }
51
+ ],
52
+ "description": "Used to discover information about the current status of the\nverifiable credential, such as whether it is suspended or revoked."
53
+ },
54
+ "credentialSchema": {
55
+ "anyOf": [
56
+ {
57
+ "$ref": "https://schema.twindev.org/w3c-did/DidCredentialSchema"
58
+ },
59
+ {
60
+ "type": "array",
61
+ "items": {
62
+ "$ref": "https://schema.twindev.org/w3c-did/DidCredentialSchema"
63
+ }
64
+ }
65
+ ],
66
+ "description": "Annotate type definitions or lock them to specific versions of the vocabulary."
67
+ },
68
+ "issuer": {
69
+ "anyOf": [
70
+ {
71
+ "type": "string"
72
+ },
73
+ {
74
+ "type": "object",
75
+ "properties": {
76
+ "id": {
77
+ "type": "string"
78
+ },
79
+ "name": {
80
+ "anyOf": [
81
+ {
82
+ "type": "string"
83
+ },
84
+ {
85
+ "type": "array",
86
+ "items": {
87
+ "$ref": "https://schema.twindev.org/w3c-did/DidLabel"
88
+ }
89
+ }
90
+ ]
91
+ },
92
+ "description": {
93
+ "anyOf": [
94
+ {
95
+ "type": "string"
96
+ },
97
+ {
98
+ "type": "array",
99
+ "items": {
100
+ "$ref": "https://schema.twindev.org/w3c-did/DidLabel"
101
+ }
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ "required": [
107
+ "id"
108
+ ]
109
+ }
110
+ ],
111
+ "description": "The issuing identity."
112
+ },
113
+ "name": {
114
+ "anyOf": [
115
+ {
116
+ "type": "string"
117
+ },
118
+ {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "https://schema.twindev.org/w3c-did/DidLabel"
122
+ }
123
+ }
124
+ ],
125
+ "description": "The name of the credential."
126
+ },
127
+ "description": {
128
+ "anyOf": [
129
+ {
130
+ "type": "string"
131
+ },
132
+ {
133
+ "type": "array",
134
+ "items": {
135
+ "$ref": "https://schema.twindev.org/w3c-did/DidLabel"
136
+ }
137
+ }
138
+ ],
139
+ "description": "The description of the credential."
140
+ },
141
+ "evidence": {
142
+ "anyOf": [
143
+ {
144
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
145
+ },
146
+ {
147
+ "type": "array",
148
+ "items": {
149
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
150
+ }
151
+ }
152
+ ],
153
+ "description": "Evidence associated with the Credential."
154
+ },
155
+ "proof": {
156
+ "anyOf": [
157
+ {
158
+ "$ref": "https://schema.twindev.org/w3c-did/Proof"
159
+ },
160
+ {
161
+ "type": "array",
162
+ "items": {
163
+ "$ref": "https://schema.twindev.org/w3c-did/Proof"
164
+ }
165
+ }
166
+ ],
167
+ "description": "Proofs that the verifiable credential is valid.\nOptional if a different proof method is used, such as JWT."
168
+ }
169
+ },
170
+ "required": [
171
+ "type"
172
+ ]
173
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialV1",
4
+ "title": "DidVerifiableCredentialV1",
5
+ "description": "Interface describing a verifiable credential.\nhttps://www.w3.org/TR/vc-data-model-1.1",
6
+ "type": "object",
7
+ "properties": {
8
+ "@context": {
9
+ "anyOf": [
10
+ {
11
+ "const": "https://www.w3.org/2018/credentials/v1"
12
+ },
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "anyOf": [
17
+ {
18
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
19
+ },
20
+ {
21
+ "const": "https://www.w3.org/2018/credentials/v1"
22
+ }
23
+ ]
24
+ },
25
+ "contains": {
26
+ "const": "https://www.w3.org/2018/credentials/v1"
27
+ },
28
+ "minContains": 1,
29
+ "maxContains": 1,
30
+ "minItems": 1
31
+ }
32
+ ],
33
+ "description": "The context for the verifiable credential."
34
+ },
35
+ "issuanceDate": {
36
+ "type": "string",
37
+ "description": "The date the verifiable credential was issued, depending on version validFrom might be set instead."
38
+ },
39
+ "expirationDate": {
40
+ "type": "string",
41
+ "description": "The date the verifiable credential expires, depending on version validUntil might be set instead."
42
+ }
43
+ },
44
+ "required": [
45
+ "@context"
46
+ ],
47
+ "allOf": [
48
+ {
49
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialCommon"
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialV2",
4
+ "title": "DidVerifiableCredentialV2",
5
+ "description": "Interface describing a verifiable credential.\nhttps://www.w3.org/TR/vc-data-model-2.0",
6
+ "type": "object",
7
+ "properties": {
8
+ "@context": {
9
+ "anyOf": [
10
+ {
11
+ "const": "https://www.w3.org/ns/credentials/v2"
12
+ },
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "anyOf": [
17
+ {
18
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
19
+ },
20
+ {
21
+ "const": "https://www.w3.org/ns/credentials/v2"
22
+ }
23
+ ]
24
+ },
25
+ "contains": {
26
+ "const": "https://www.w3.org/ns/credentials/v2"
27
+ },
28
+ "minContains": 1,
29
+ "maxContains": 1,
30
+ "minItems": 1
31
+ }
32
+ ],
33
+ "description": "The context for the verifiable credential."
34
+ },
35
+ "validFrom": {
36
+ "type": "string",
37
+ "description": "The date the verifiable credential is valid from."
38
+ },
39
+ "validUntil": {
40
+ "type": "string",
41
+ "description": "The date the verifiable credential is valid until."
42
+ }
43
+ },
44
+ "required": [
45
+ "@context"
46
+ ],
47
+ "allOf": [
48
+ {
49
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialCommon"
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerifiablePresentationCommon",
4
+ "title": "DidVerifiablePresentationCommon",
5
+ "description": "Interface describing a verifiable presentation.",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "type": "string",
10
+ "description": "Provide a unique identifier for the presentation."
11
+ },
12
+ "type": {
13
+ "anyOf": [
14
+ {
15
+ "type": "string"
16
+ },
17
+ {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "string"
21
+ }
22
+ }
23
+ ],
24
+ "description": "The types of the data stored in the verifiable credential."
25
+ },
26
+ "holder": {
27
+ "type": "string",
28
+ "description": "The entity generating the presentation."
29
+ },
30
+ "proof": {
31
+ "anyOf": [
32
+ {
33
+ "$ref": "https://schema.twindev.org/w3c-did/Proof"
34
+ },
35
+ {
36
+ "type": "array",
37
+ "items": {
38
+ "$ref": "https://schema.twindev.org/w3c-did/Proof"
39
+ }
40
+ }
41
+ ],
42
+ "description": "Proofs that the verifiable presentation is valid.\nOptional if a different proof method is used, such as JWT."
43
+ }
44
+ },
45
+ "required": [
46
+ "type"
47
+ ]
48
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerifiablePresentationV1",
4
+ "title": "DidVerifiablePresentationV1",
5
+ "description": "Interface describing a verifiable presentation.",
6
+ "type": "object",
7
+ "properties": {
8
+ "@context": {
9
+ "anyOf": [
10
+ {
11
+ "const": "https://www.w3.org/2018/credentials/v1"
12
+ },
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "anyOf": [
17
+ {
18
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
19
+ },
20
+ {
21
+ "const": "https://www.w3.org/2018/credentials/v1"
22
+ }
23
+ ]
24
+ },
25
+ "contains": {
26
+ "const": "https://www.w3.org/2018/credentials/v1"
27
+ },
28
+ "minContains": 1,
29
+ "maxContains": 1,
30
+ "minItems": 1
31
+ }
32
+ ],
33
+ "description": "The context for the verifiable presentation."
34
+ },
35
+ "verifiableCredential": {
36
+ "type": "array",
37
+ "items": {
38
+ "anyOf": [
39
+ {
40
+ "type": "string"
41
+ },
42
+ {
43
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialV1"
44
+ }
45
+ ]
46
+ },
47
+ "description": "The data for the verifiable credentials."
48
+ }
49
+ },
50
+ "required": [
51
+ "@context"
52
+ ],
53
+ "allOf": [
54
+ {
55
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiablePresentationCommon"
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerifiablePresentationV2",
4
+ "title": "DidVerifiablePresentationV2",
5
+ "description": "Interface describing a verifiable presentation.",
6
+ "type": "object",
7
+ "properties": {
8
+ "@context": {
9
+ "anyOf": [
10
+ {
11
+ "const": "https://www.w3.org/ns/credentials/v2"
12
+ },
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "anyOf": [
17
+ {
18
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
19
+ },
20
+ {
21
+ "const": "https://www.w3.org/ns/credentials/v2"
22
+ }
23
+ ]
24
+ },
25
+ "contains": {
26
+ "const": "https://www.w3.org/ns/credentials/v2"
27
+ },
28
+ "minContains": 1,
29
+ "maxContains": 1,
30
+ "minItems": 1
31
+ }
32
+ ],
33
+ "description": "The context for the verifiable presentation."
34
+ },
35
+ "verifiableCredential": {
36
+ "type": "array",
37
+ "items": {
38
+ "anyOf": [
39
+ {
40
+ "type": "string"
41
+ },
42
+ {
43
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiableCredentialV2"
44
+ }
45
+ ]
46
+ },
47
+ "description": "The data for the verifiable credentials."
48
+ }
49
+ },
50
+ "required": [
51
+ "@context"
52
+ ],
53
+ "allOf": [
54
+ {
55
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiablePresentationCommon"
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/DidVerificationMethodType",
4
+ "title": "DidVerificationMethodType",
5
+ "description": "The types of verification method.",
6
+ "anyOf": [
7
+ {
8
+ "const": "verificationMethod",
9
+ "description": "VerificationMethod."
10
+ },
11
+ {
12
+ "const": "authentication",
13
+ "description": "Authentication."
14
+ },
15
+ {
16
+ "const": "assertionMethod",
17
+ "description": "Assertion Method."
18
+ },
19
+ {
20
+ "const": "keyAgreement",
21
+ "description": "Key Agreement."
22
+ },
23
+ {
24
+ "const": "capabilityInvocation",
25
+ "description": "Capability Invocation."
26
+ },
27
+ {
28
+ "const": "capabilityDelegation",
29
+ "description": "Capability Delegation."
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/w3c-did/JsonWebSignature2020Proof",
4
+ "title": "JsonWebSignature2020Proof",
5
+ "description": "Interface describing a did proof in JSON Web Signature 2020 Format.\nhttps://www.w3.org/TR/vc-jws-2020/",
6
+ "type": "object",
7
+ "properties": {
8
+ "@context": {
9
+ "anyOf": [
10
+ {
11
+ "const": "https://w3id.org/security/suites/jws-2020/v1"
12
+ },
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "anyOf": [
17
+ {
18
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
19
+ },
20
+ {
21
+ "const": "https://w3id.org/security/suites/jws-2020/v1"
22
+ }
23
+ ]
24
+ },
25
+ "contains": {
26
+ "const": "https://w3id.org/security/suites/jws-2020/v1"
27
+ },
28
+ "minContains": 1,
29
+ "maxContains": 1,
30
+ "minItems": 1
31
+ }
32
+ ],
33
+ "description": "JSON-LD Context."
34
+ },
35
+ "type": {
36
+ "const": "JsonWebSignature2020",
37
+ "description": "JSON-LD Type."
38
+ },
39
+ "proofPurpose": {
40
+ "type": "string",
41
+ "description": "The reason the proof was created."
42
+ },
43
+ "verificationMethod": {
44
+ "type": "string",
45
+ "description": "The verification method of the proof."
46
+ },
47
+ "created": {
48
+ "type": "string",
49
+ "description": "The iso date of when the proof was created."
50
+ },
51
+ "jws": {
52
+ "type": "string",
53
+ "description": "The JSON Web Signature."
54
+ }
55
+ },
56
+ "required": [
57
+ "type",
58
+ "proofPurpose"
59
+ ]
60
+ }