@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.
- package/dist/es/dataTypes/didDataTypes.js +111 -2
- package/dist/es/dataTypes/didDataTypes.js.map +1 -1
- package/dist/es/models/didTypes.js +77 -1
- package/dist/es/models/didTypes.js.map +1 -1
- package/dist/es/schemas/DataIntegrityProof.json +116 -0
- package/dist/es/schemas/DidCredentialSchema.json +21 -0
- package/dist/es/schemas/DidCredentialStatus.json +22 -0
- package/dist/es/schemas/DidCryptoSuites.json +16 -0
- package/dist/es/schemas/DidDocumentVerificationMethod.json +45 -0
- package/dist/es/schemas/DidLabel.json +25 -0
- package/dist/es/schemas/DidPresentationVerification.json +38 -0
- package/dist/es/schemas/DidService.json +46 -0
- package/dist/es/schemas/DidTypes.json +112 -0
- package/dist/es/schemas/DidVerifiableCredentialCommon.json +173 -0
- package/dist/es/schemas/DidVerifiableCredentialV1.json +52 -0
- package/dist/es/schemas/DidVerifiableCredentialV2.json +52 -0
- package/dist/es/schemas/DidVerifiablePresentationCommon.json +48 -0
- package/dist/es/schemas/DidVerifiablePresentationV1.json +58 -0
- package/dist/es/schemas/DidVerifiablePresentationV2.json +58 -0
- package/dist/es/schemas/DidVerificationMethodType.json +32 -0
- package/dist/es/schemas/JsonWebSignature2020Proof.json +60 -0
- package/dist/es/schemas/Multikey.json +90 -0
- package/dist/es/schemas/Proof.json +14 -0
- package/dist/es/schemas/ProofTypes.json +16 -0
- package/dist/types/models/didTypes.d.ts +76 -0
- package/docs/changelog.md +62 -0
- package/docs/reference/variables/DidTypes.md +114 -0
- package/package.json +7 -7
|
@@ -3,9 +3,29 @@
|
|
|
3
3
|
import { DataTypeHelper } from "@twin.org/data-core";
|
|
4
4
|
import { DidContexts } from "../models/didContexts.js";
|
|
5
5
|
import { DidTypes } from "../models/didTypes.js";
|
|
6
|
+
import DataIntegrityProofSchema from "../schemas/DataIntegrityProof.json" with { type: "json" };
|
|
7
|
+
import DidCredentialSchemaSchema from "../schemas/DidCredentialSchema.json" with { type: "json" };
|
|
8
|
+
import DidCredentialStatusSchema from "../schemas/DidCredentialStatus.json" with { type: "json" };
|
|
9
|
+
import DidCryptoSuitesSchema from "../schemas/DidCryptoSuites.json" with { type: "json" };
|
|
6
10
|
import DidDocumentSchema from "../schemas/DidDocument.json" with { type: "json" };
|
|
11
|
+
import DidDocumentVerificationMethodSchema from "../schemas/DidDocumentVerificationMethod.json" with { type: "json" };
|
|
12
|
+
import DidLabelSchema from "../schemas/DidLabel.json" with { type: "json" };
|
|
13
|
+
import DidPresentationVerificationSchema from "../schemas/DidPresentationVerification.json" with { type: "json" };
|
|
14
|
+
import DidServiceSchema from "../schemas/DidService.json" with { type: "json" };
|
|
15
|
+
import DidTypesSchema from "../schemas/DidTypes.json" with { type: "json" };
|
|
7
16
|
import DidVerifiableCredentialSchema from "../schemas/DidVerifiableCredential.json" with { type: "json" };
|
|
17
|
+
import DidVerifiableCredentialCommonSchema from "../schemas/DidVerifiableCredentialCommon.json" with { type: "json" };
|
|
18
|
+
import DidVerifiableCredentialV1Schema from "../schemas/DidVerifiableCredentialV1.json" with { type: "json" };
|
|
19
|
+
import DidVerifiableCredentialV2Schema from "../schemas/DidVerifiableCredentialV2.json" with { type: "json" };
|
|
8
20
|
import DidVerifiablePresentationSchema from "../schemas/DidVerifiablePresentation.json" with { type: "json" };
|
|
21
|
+
import DidVerifiablePresentationCommonSchema from "../schemas/DidVerifiablePresentationCommon.json" with { type: "json" };
|
|
22
|
+
import DidVerifiablePresentationV1Schema from "../schemas/DidVerifiablePresentationV1.json" with { type: "json" };
|
|
23
|
+
import DidVerifiablePresentationV2Schema from "../schemas/DidVerifiablePresentationV2.json" with { type: "json" };
|
|
24
|
+
import DidVerificationMethodTypeSchema from "../schemas/DidVerificationMethodType.json" with { type: "json" };
|
|
25
|
+
import JsonWebSignature2020ProofSchema from "../schemas/JsonWebSignature2020Proof.json" with { type: "json" };
|
|
26
|
+
import MultikeySchema from "../schemas/Multikey.json" with { type: "json" };
|
|
27
|
+
import ProofSchema from "../schemas/Proof.json" with { type: "json" };
|
|
28
|
+
import ProofTypesSchema from "../schemas/ProofTypes.json" with { type: "json" };
|
|
9
29
|
/**
|
|
10
30
|
* Handles data type registration for DID.
|
|
11
31
|
*/
|
|
@@ -15,13 +35,103 @@ export class DidDataTypes {
|
|
|
15
35
|
*/
|
|
16
36
|
static registerTypes() {
|
|
17
37
|
const types = [
|
|
38
|
+
{
|
|
39
|
+
type: DidTypes.DataIntegrityProof,
|
|
40
|
+
schema: DataIntegrityProofSchema
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: DidTypes.CredentialSchema,
|
|
44
|
+
schema: DidCredentialSchemaSchema
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: DidTypes.CredentialStatus,
|
|
48
|
+
schema: DidCredentialStatusSchema
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: DidTypes.CryptoSuites,
|
|
52
|
+
schema: DidCryptoSuitesSchema
|
|
53
|
+
},
|
|
18
54
|
{
|
|
19
55
|
type: DidTypes.Document,
|
|
20
56
|
schema: DidDocumentSchema
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: DidTypes.DocumentVerificationMethod,
|
|
60
|
+
schema: DidDocumentVerificationMethodSchema
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: DidTypes.Label,
|
|
64
|
+
schema: DidLabelSchema
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: DidTypes.PresentationVerification,
|
|
68
|
+
schema: DidPresentationVerificationSchema
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: DidTypes.Service,
|
|
72
|
+
schema: DidServiceSchema
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: DidTypes.Types,
|
|
76
|
+
schema: DidTypesSchema
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: DidTypes.VerifiableCredential,
|
|
80
|
+
schema: DidVerifiableCredentialSchema
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: DidTypes.VerifiableCredentialCommon,
|
|
84
|
+
schema: DidVerifiableCredentialCommonSchema
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: DidTypes.VerifiableCredentialV1,
|
|
88
|
+
schema: DidVerifiableCredentialV1Schema
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: DidTypes.VerifiableCredentialV2,
|
|
92
|
+
schema: DidVerifiableCredentialV2Schema
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: DidTypes.VerifiablePresentation,
|
|
96
|
+
schema: DidVerifiablePresentationSchema
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: DidTypes.VerifiablePresentationCommon,
|
|
100
|
+
schema: DidVerifiablePresentationCommonSchema
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: DidTypes.VerifiablePresentationV1,
|
|
104
|
+
schema: DidVerifiablePresentationV1Schema
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: DidTypes.VerifiablePresentationV2,
|
|
108
|
+
schema: DidVerifiablePresentationV2Schema
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: DidTypes.VerificationMethodType,
|
|
112
|
+
schema: DidVerificationMethodTypeSchema
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: DidTypes.JsonWebSignature2020Proof,
|
|
116
|
+
schema: JsonWebSignature2020ProofSchema
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: DidTypes.Multikey,
|
|
120
|
+
schema: MultikeySchema
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: DidTypes.Proof,
|
|
124
|
+
schema: ProofSchema
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: DidTypes.ProofTypes,
|
|
128
|
+
schema: ProofTypesSchema
|
|
21
129
|
}
|
|
22
130
|
];
|
|
23
131
|
DataTypeHelper.registerTypes(DidContexts.Namespace, undefined, types);
|
|
24
|
-
|
|
132
|
+
// The schema titles are not all the DID type prefixed with "Did", so the schemas
|
|
133
|
+
// are registered under their own titles, which is what the $refs between them use.
|
|
134
|
+
DataTypeHelper.registerTypes(DidContexts.JsonSchemaNamespace, undefined, types.map(t => ({ type: t.schema.title, schema: t.schema })));
|
|
25
135
|
const typesCredentials = [
|
|
26
136
|
{
|
|
27
137
|
type: DidTypes.VerifiableCredential,
|
|
@@ -34,7 +144,6 @@ export class DidDataTypes {
|
|
|
34
144
|
];
|
|
35
145
|
DataTypeHelper.registerTypes(DidContexts.NamespaceVCv1, undefined, typesCredentials);
|
|
36
146
|
DataTypeHelper.registerTypes(DidContexts.NamespaceVCv2, undefined, typesCredentials);
|
|
37
|
-
DataTypeHelper.registerTypes(DidContexts.JsonSchemaNamespace, undefined, typesCredentials.map(t => ({ type: `Did${t.type}`, schema: t.schema })));
|
|
38
147
|
}
|
|
39
148
|
}
|
|
40
149
|
//# sourceMappingURL=didDataTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/didDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,iBAAiB,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClF,OAAO,6BAA6B,MAAM,yCAAyC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1G,OAAO,+BAA+B,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE9G;;GAEG;AACH,MAAM,OAAgB,YAAY;IACjC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,MAAM,KAAK,GAAG;YACb;gBACC,IAAI,EAAE,QAAQ,CAAC,QAAQ;gBACvB,MAAM,EAAE,iBAAiB;aACzB;SACD,CAAC;QAEF,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACtE,cAAc,CAAC,aAAa,CAC3B,WAAW,CAAC,mBAAmB,EAC/B,SAAS,EACT,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAC5D,CAAC;QAEF,MAAM,gBAAgB,GAAG;YACxB;gBACC,IAAI,EAAE,QAAQ,CAAC,oBAAoB;gBACnC,MAAM,EAAE,6BAA6B;aACrC;YACD;gBACC,IAAI,EAAE,QAAQ,CAAC,sBAAsB;gBACrC,MAAM,EAAE,+BAA+B;aACvC;SACD,CAAC;QAEF,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACrF,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACrF,cAAc,CAAC,aAAa,CAC3B,WAAW,CAAC,mBAAmB,EAC/B,SAAS,EACT,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CACvE,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHelper } from \"@twin.org/data-core\";\nimport { DidContexts } from \"../models/didContexts.js\";\nimport { DidTypes } from \"../models/didTypes.js\";\nimport DidDocumentSchema from \"../schemas/DidDocument.json\" with { type: \"json\" };\nimport DidVerifiableCredentialSchema from \"../schemas/DidVerifiableCredential.json\" with { type: \"json\" };\nimport DidVerifiablePresentationSchema from \"../schemas/DidVerifiablePresentation.json\" with { type: \"json\" };\n\n/**\n * Handles data type registration for DID.\n */\nexport abstract class DidDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tconst types = [\n\t\t\t{\n\t\t\t\ttype: DidTypes.Document,\n\t\t\t\tschema: DidDocumentSchema\n\t\t\t}\n\t\t];\n\n\t\tDataTypeHelper.registerTypes(DidContexts.Namespace, undefined, types);\n\t\tDataTypeHelper.registerTypes(\n\t\t\tDidContexts.JsonSchemaNamespace,\n\t\t\tundefined,\n\t\t\ttypes.map(t => ({ type: `Did${t.type}`, schema: t.schema }))\n\t\t);\n\n\t\tconst typesCredentials = [\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiableCredential,\n\t\t\t\tschema: DidVerifiableCredentialSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiablePresentation,\n\t\t\t\tschema: DidVerifiablePresentationSchema\n\t\t\t}\n\t\t];\n\n\t\tDataTypeHelper.registerTypes(DidContexts.NamespaceVCv1, undefined, typesCredentials);\n\t\tDataTypeHelper.registerTypes(DidContexts.NamespaceVCv2, undefined, typesCredentials);\n\t\tDataTypeHelper.registerTypes(\n\t\t\tDidContexts.JsonSchemaNamespace,\n\t\t\tundefined,\n\t\t\ttypesCredentials.map(t => ({ type: `Did${t.type}`, schema: t.schema }))\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"didDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/didDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OA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,QAAQ,CAAC,UAAU;gBACzB,MAAM,EAAE,gBAAgB;aACxB;SACD,CAAC;QAEF,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAEtE,iFAAiF;QACjF,mFAAmF;QACnF,cAAc,CAAC,aAAa,CAC3B,WAAW,CAAC,mBAAmB,EAC/B,SAAS,EACT,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAC5D,CAAC;QAEF,MAAM,gBAAgB,GAAG;YACxB;gBACC,IAAI,EAAE,QAAQ,CAAC,oBAAoB;gBACnC,MAAM,EAAE,6BAA6B;aACrC;YACD;gBACC,IAAI,EAAE,QAAQ,CAAC,sBAAsB;gBACrC,MAAM,EAAE,+BAA+B;aACvC;SACD,CAAC;QAEF,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACrF,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IACtF,CAAC;CACD","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHelper } from \"@twin.org/data-core\";\nimport { DidContexts } from \"../models/didContexts.js\";\nimport { DidTypes } from \"../models/didTypes.js\";\nimport DataIntegrityProofSchema from \"../schemas/DataIntegrityProof.json\" with { type: \"json\" };\nimport DidCredentialSchemaSchema from \"../schemas/DidCredentialSchema.json\" with { type: \"json\" };\nimport DidCredentialStatusSchema from \"../schemas/DidCredentialStatus.json\" with { type: \"json\" };\nimport DidCryptoSuitesSchema from \"../schemas/DidCryptoSuites.json\" with { type: \"json\" };\nimport DidDocumentSchema from \"../schemas/DidDocument.json\" with { type: \"json\" };\nimport DidDocumentVerificationMethodSchema from \"../schemas/DidDocumentVerificationMethod.json\" with { type: \"json\" };\nimport DidLabelSchema from \"../schemas/DidLabel.json\" with { type: \"json\" };\nimport DidPresentationVerificationSchema from \"../schemas/DidPresentationVerification.json\" with { type: \"json\" };\nimport DidServiceSchema from \"../schemas/DidService.json\" with { type: \"json\" };\nimport DidTypesSchema from \"../schemas/DidTypes.json\" with { type: \"json\" };\nimport DidVerifiableCredentialSchema from \"../schemas/DidVerifiableCredential.json\" with { type: \"json\" };\nimport DidVerifiableCredentialCommonSchema from \"../schemas/DidVerifiableCredentialCommon.json\" with { type: \"json\" };\nimport DidVerifiableCredentialV1Schema from \"../schemas/DidVerifiableCredentialV1.json\" with { type: \"json\" };\nimport DidVerifiableCredentialV2Schema from \"../schemas/DidVerifiableCredentialV2.json\" with { type: \"json\" };\nimport DidVerifiablePresentationSchema from \"../schemas/DidVerifiablePresentation.json\" with { type: \"json\" };\nimport DidVerifiablePresentationCommonSchema from \"../schemas/DidVerifiablePresentationCommon.json\" with { type: \"json\" };\nimport DidVerifiablePresentationV1Schema from \"../schemas/DidVerifiablePresentationV1.json\" with { type: \"json\" };\nimport DidVerifiablePresentationV2Schema from \"../schemas/DidVerifiablePresentationV2.json\" with { type: \"json\" };\nimport DidVerificationMethodTypeSchema from \"../schemas/DidVerificationMethodType.json\" with { type: \"json\" };\nimport JsonWebSignature2020ProofSchema from \"../schemas/JsonWebSignature2020Proof.json\" with { type: \"json\" };\nimport MultikeySchema from \"../schemas/Multikey.json\" with { type: \"json\" };\nimport ProofSchema from \"../schemas/Proof.json\" with { type: \"json\" };\nimport ProofTypesSchema from \"../schemas/ProofTypes.json\" with { type: \"json\" };\n\n/**\n * Handles data type registration for DID.\n */\nexport abstract class DidDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tconst types = [\n\t\t\t{\n\t\t\t\ttype: DidTypes.DataIntegrityProof,\n\t\t\t\tschema: DataIntegrityProofSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.CredentialSchema,\n\t\t\t\tschema: DidCredentialSchemaSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.CredentialStatus,\n\t\t\t\tschema: DidCredentialStatusSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.CryptoSuites,\n\t\t\t\tschema: DidCryptoSuitesSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.Document,\n\t\t\t\tschema: DidDocumentSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.DocumentVerificationMethod,\n\t\t\t\tschema: DidDocumentVerificationMethodSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.Label,\n\t\t\t\tschema: DidLabelSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.PresentationVerification,\n\t\t\t\tschema: DidPresentationVerificationSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.Service,\n\t\t\t\tschema: DidServiceSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.Types,\n\t\t\t\tschema: DidTypesSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiableCredential,\n\t\t\t\tschema: DidVerifiableCredentialSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiableCredentialCommon,\n\t\t\t\tschema: DidVerifiableCredentialCommonSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiableCredentialV1,\n\t\t\t\tschema: DidVerifiableCredentialV1Schema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiableCredentialV2,\n\t\t\t\tschema: DidVerifiableCredentialV2Schema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiablePresentation,\n\t\t\t\tschema: DidVerifiablePresentationSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiablePresentationCommon,\n\t\t\t\tschema: DidVerifiablePresentationCommonSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiablePresentationV1,\n\t\t\t\tschema: DidVerifiablePresentationV1Schema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiablePresentationV2,\n\t\t\t\tschema: DidVerifiablePresentationV2Schema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerificationMethodType,\n\t\t\t\tschema: DidVerificationMethodTypeSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.JsonWebSignature2020Proof,\n\t\t\t\tschema: JsonWebSignature2020ProofSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.Multikey,\n\t\t\t\tschema: MultikeySchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.Proof,\n\t\t\t\tschema: ProofSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.ProofTypes,\n\t\t\t\tschema: ProofTypesSchema\n\t\t\t}\n\t\t];\n\n\t\tDataTypeHelper.registerTypes(DidContexts.Namespace, undefined, types);\n\n\t\t// The schema titles are not all the DID type prefixed with \"Did\", so the schemas\n\t\t// are registered under their own titles, which is what the $refs between them use.\n\t\tDataTypeHelper.registerTypes(\n\t\t\tDidContexts.JsonSchemaNamespace,\n\t\t\tundefined,\n\t\t\ttypes.map(t => ({ type: t.schema.title, schema: t.schema }))\n\t\t);\n\n\t\tconst typesCredentials = [\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiableCredential,\n\t\t\t\tschema: DidVerifiableCredentialSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: DidTypes.VerifiablePresentation,\n\t\t\t\tschema: DidVerifiablePresentationSchema\n\t\t\t}\n\t\t];\n\n\t\tDataTypeHelper.registerTypes(DidContexts.NamespaceVCv1, undefined, typesCredentials);\n\t\tDataTypeHelper.registerTypes(DidContexts.NamespaceVCv2, undefined, typesCredentials);\n\t}\n}\n"]}
|
|
@@ -32,6 +32,82 @@ export const DidTypes = {
|
|
|
32
32
|
/**
|
|
33
33
|
* The type for Multikey.
|
|
34
34
|
*/
|
|
35
|
-
Multikey: "Multikey"
|
|
35
|
+
Multikey: "Multikey",
|
|
36
|
+
/**
|
|
37
|
+
* The type for CredentialSchema.
|
|
38
|
+
*/
|
|
39
|
+
CredentialSchema: "CredentialSchema",
|
|
40
|
+
/**
|
|
41
|
+
* The type for CredentialStatus.
|
|
42
|
+
*/
|
|
43
|
+
CredentialStatus: "CredentialStatus",
|
|
44
|
+
/**
|
|
45
|
+
* The type for CryptoSuites.
|
|
46
|
+
*/
|
|
47
|
+
CryptoSuites: "CryptoSuites",
|
|
48
|
+
/**
|
|
49
|
+
* The type for DataIntegrityProof.
|
|
50
|
+
*/
|
|
51
|
+
DataIntegrityProof: "DataIntegrityProof",
|
|
52
|
+
/**
|
|
53
|
+
* The type for DocumentVerificationMethod.
|
|
54
|
+
*/
|
|
55
|
+
DocumentVerificationMethod: "DocumentVerificationMethod",
|
|
56
|
+
/**
|
|
57
|
+
* The type for JsonWebSignature2020Proof.
|
|
58
|
+
*/
|
|
59
|
+
JsonWebSignature2020Proof: "JsonWebSignature2020Proof",
|
|
60
|
+
/**
|
|
61
|
+
* The type for Label.
|
|
62
|
+
*/
|
|
63
|
+
Label: "Label",
|
|
64
|
+
/**
|
|
65
|
+
* The type for PresentationVerification.
|
|
66
|
+
*/
|
|
67
|
+
PresentationVerification: "PresentationVerification",
|
|
68
|
+
/**
|
|
69
|
+
* The type for Proof.
|
|
70
|
+
*/
|
|
71
|
+
Proof: "Proof",
|
|
72
|
+
/**
|
|
73
|
+
* The type for ProofTypes.
|
|
74
|
+
*/
|
|
75
|
+
ProofTypes: "ProofTypes",
|
|
76
|
+
/**
|
|
77
|
+
* The type for Service.
|
|
78
|
+
*/
|
|
79
|
+
Service: "Service",
|
|
80
|
+
/**
|
|
81
|
+
* The type for Types.
|
|
82
|
+
*/
|
|
83
|
+
Types: "Types",
|
|
84
|
+
/**
|
|
85
|
+
* The type for VerifiableCredentialCommon.
|
|
86
|
+
*/
|
|
87
|
+
VerifiableCredentialCommon: "VerifiableCredentialCommon",
|
|
88
|
+
/**
|
|
89
|
+
* The type for VerifiableCredentialV1.
|
|
90
|
+
*/
|
|
91
|
+
VerifiableCredentialV1: "VerifiableCredentialV1",
|
|
92
|
+
/**
|
|
93
|
+
* The type for VerifiableCredentialV2.
|
|
94
|
+
*/
|
|
95
|
+
VerifiableCredentialV2: "VerifiableCredentialV2",
|
|
96
|
+
/**
|
|
97
|
+
* The type for VerifiablePresentationCommon.
|
|
98
|
+
*/
|
|
99
|
+
VerifiablePresentationCommon: "VerifiablePresentationCommon",
|
|
100
|
+
/**
|
|
101
|
+
* The type for VerifiablePresentationV1.
|
|
102
|
+
*/
|
|
103
|
+
VerifiablePresentationV1: "VerifiablePresentationV1",
|
|
104
|
+
/**
|
|
105
|
+
* The type for VerifiablePresentationV2.
|
|
106
|
+
*/
|
|
107
|
+
VerifiablePresentationV2: "VerifiablePresentationV2",
|
|
108
|
+
/**
|
|
109
|
+
* The type for VerificationMethodType.
|
|
110
|
+
*/
|
|
111
|
+
VerificationMethodType: "VerificationMethodType"
|
|
36
112
|
};
|
|
37
113
|
//# sourceMappingURL=didTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didTypes.js","sourceRoot":"","sources":["../../../src/models/didTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;OAEG;IACH,sBAAsB,EAAE,wBAAwB;IAEhD;;OAEG;IACH,0BAA0B,EAAE,4BAA4B;IAExD;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAEh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AE,0BAA0B;IAEpD;;OAEG;IACH,sBAAsB,EAAE,wBAAwB;CACvC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types for DIDs.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DidTypes = {\n\t/**\n\t * The type for Document.\n\t */\n\tDocument: \"Document\",\n\n\t/**\n\t * The type for Verifiable Credential.\n\t */\n\tVerifiableCredential: \"VerifiableCredential\",\n\n\t/**\n\t * The type for Verifiable Presentation.\n\t */\n\tVerifiablePresentation: \"VerifiablePresentation\",\n\n\t/**\n\t * The type for Ed25519VerificationKey2020.\n\t */\n\tEd25519VerificationKey2020: \"Ed25519VerificationKey2020\",\n\n\t/**\n\t * The type for JsonWebKey2020.\n\t */\n\tJsonWebKey2020: \"JsonWebKey2020\",\n\n\t/**\n\t * The type for LinkedDomains.\n\t */\n\tLinkedDomains: \"LinkedDomains\",\n\n\t/**\n\t * The type for Multikey.\n\t */\n\tMultikey: \"Multikey\",\n\n\t/**\n\t * The type for CredentialSchema.\n\t */\n\tCredentialSchema: \"CredentialSchema\",\n\n\t/**\n\t * The type for CredentialStatus.\n\t */\n\tCredentialStatus: \"CredentialStatus\",\n\n\t/**\n\t * The type for CryptoSuites.\n\t */\n\tCryptoSuites: \"CryptoSuites\",\n\n\t/**\n\t * The type for DataIntegrityProof.\n\t */\n\tDataIntegrityProof: \"DataIntegrityProof\",\n\n\t/**\n\t * The type for DocumentVerificationMethod.\n\t */\n\tDocumentVerificationMethod: \"DocumentVerificationMethod\",\n\n\t/**\n\t * The type for JsonWebSignature2020Proof.\n\t */\n\tJsonWebSignature2020Proof: \"JsonWebSignature2020Proof\",\n\n\t/**\n\t * The type for Label.\n\t */\n\tLabel: \"Label\",\n\n\t/**\n\t * The type for PresentationVerification.\n\t */\n\tPresentationVerification: \"PresentationVerification\",\n\n\t/**\n\t * The type for Proof.\n\t */\n\tProof: \"Proof\",\n\n\t/**\n\t * The type for ProofTypes.\n\t */\n\tProofTypes: \"ProofTypes\",\n\n\t/**\n\t * The type for Service.\n\t */\n\tService: \"Service\",\n\n\t/**\n\t * The type for Types.\n\t */\n\tTypes: \"Types\",\n\n\t/**\n\t * The type for VerifiableCredentialCommon.\n\t */\n\tVerifiableCredentialCommon: \"VerifiableCredentialCommon\",\n\n\t/**\n\t * The type for VerifiableCredentialV1.\n\t */\n\tVerifiableCredentialV1: \"VerifiableCredentialV1\",\n\n\t/**\n\t * The type for VerifiableCredentialV2.\n\t */\n\tVerifiableCredentialV2: \"VerifiableCredentialV2\",\n\n\t/**\n\t * The type for VerifiablePresentationCommon.\n\t */\n\tVerifiablePresentationCommon: \"VerifiablePresentationCommon\",\n\n\t/**\n\t * The type for VerifiablePresentationV1.\n\t */\n\tVerifiablePresentationV1: \"VerifiablePresentationV1\",\n\n\t/**\n\t * The type for VerifiablePresentationV2.\n\t */\n\tVerifiablePresentationV2: \"VerifiablePresentationV2\",\n\n\t/**\n\t * The type for VerificationMethodType.\n\t */\n\tVerificationMethodType: \"VerificationMethodType\"\n} as const;\n\n/**\n * The types for DIDs.\n */\nexport type DidTypes = (typeof DidTypes)[keyof typeof DidTypes];\n"]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DataIntegrityProof",
|
|
4
|
+
"title": "DataIntegrityProof",
|
|
5
|
+
"description": "Interface describing a did proof.\nhttps://www.w3.org/TR/vc-data-integrity/",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"@context": {
|
|
9
|
+
"anyOf": [
|
|
10
|
+
{
|
|
11
|
+
"const": "https://w3id.org/security/data-integrity/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://w3id.org/security/data-integrity/v2"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"contains": {
|
|
26
|
+
"const": "https://w3id.org/security/data-integrity/v2"
|
|
27
|
+
},
|
|
28
|
+
"minContains": 1,
|
|
29
|
+
"maxContains": 1,
|
|
30
|
+
"minItems": 1
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"description": "JSON-LD Context."
|
|
34
|
+
},
|
|
35
|
+
"type": {
|
|
36
|
+
"const": "DataIntegrityProof",
|
|
37
|
+
"description": "JSON-LD Type."
|
|
38
|
+
},
|
|
39
|
+
"cryptosuite": {
|
|
40
|
+
"anyOf": [
|
|
41
|
+
{
|
|
42
|
+
"$ref": "https://schema.twindev.org/w3c-did/DidCryptoSuites"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "string"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"description": "An identifier for the cryptographic suite that can be used to verify the proof."
|
|
49
|
+
},
|
|
50
|
+
"id": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The id of the proof."
|
|
53
|
+
},
|
|
54
|
+
"proofPurpose": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "The reason the proof was created."
|
|
57
|
+
},
|
|
58
|
+
"proofValue": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "Contains the base-encoded binary data necessary to verify the\ndigital proof using the verificationMethod specified."
|
|
61
|
+
},
|
|
62
|
+
"verificationMethod": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "The verification method of the proof."
|
|
65
|
+
},
|
|
66
|
+
"created": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"description": "The iso date of when the proof was created."
|
|
69
|
+
},
|
|
70
|
+
"expires": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "The iso date of when the proof expires."
|
|
73
|
+
},
|
|
74
|
+
"domain": {
|
|
75
|
+
"anyOf": [
|
|
76
|
+
{
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "array",
|
|
81
|
+
"items": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"description": "One or more security domains in which the proof is meant to be used."
|
|
87
|
+
},
|
|
88
|
+
"challenge": {
|
|
89
|
+
"anyOf": [
|
|
90
|
+
{
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"description": "Provided to mitigate replay attacks on domains."
|
|
101
|
+
},
|
|
102
|
+
"previousProof": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "Identifies another data integrity proof that MUST verify before\nthe current proof is processed"
|
|
105
|
+
},
|
|
106
|
+
"nonce": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "Use of this field is to increase privacy by decreasing linkability\nthat is the result of deterministically generated signatures."
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": [
|
|
112
|
+
"type",
|
|
113
|
+
"cryptosuite",
|
|
114
|
+
"proofPurpose"
|
|
115
|
+
]
|
|
116
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidCredentialSchema",
|
|
4
|
+
"title": "DidCredentialSchema",
|
|
5
|
+
"description": "Interface describing a DID credential schema.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The URI id."
|
|
11
|
+
},
|
|
12
|
+
"type": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The credential schema type."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": [
|
|
18
|
+
"id",
|
|
19
|
+
"type"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidCredentialStatus",
|
|
4
|
+
"title": "DidCredentialStatus",
|
|
5
|
+
"description": "Interface describing a DID credential status.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The URI id."
|
|
11
|
+
},
|
|
12
|
+
"type": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The credential status type."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": {},
|
|
18
|
+
"required": [
|
|
19
|
+
"id",
|
|
20
|
+
"type"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidCryptoSuites",
|
|
4
|
+
"title": "DidCryptoSuites",
|
|
5
|
+
"description": "The types for DID Proof crypto suites.",
|
|
6
|
+
"anyOf": [
|
|
7
|
+
{
|
|
8
|
+
"const": "eddsa-jcs-2022",
|
|
9
|
+
"description": "The type for EdDSA crypto suite for JSON Canonicalization Scheme [RFC8785].\nhttps://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"const": "eddsa-rdfc-2022",
|
|
13
|
+
"description": "The type for EdDSA crypto suite for RDF Dataset Canonicalization.\nhttps://www.w3.org/TR/vc-di-eddsa/#eddsa-rdfc-2022"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod",
|
|
4
|
+
"title": "DidDocumentVerificationMethod",
|
|
5
|
+
"description": "Interface describing a DID document verification method.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The id of the entry."
|
|
11
|
+
},
|
|
12
|
+
"controller": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The controller for the entry."
|
|
15
|
+
},
|
|
16
|
+
"type": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The type of the entry."
|
|
19
|
+
},
|
|
20
|
+
"publicKeyMultibase": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The public key for the entry.\nSpec https://datatracker.ietf.org/doc/html/draft-multiformats-multibase-03 ."
|
|
23
|
+
},
|
|
24
|
+
"publicKeyJwk": {
|
|
25
|
+
"allOf": [
|
|
26
|
+
{
|
|
27
|
+
"$ref": "https://schema.twindev.org/framework/Jwk"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"description": "The public key for the entry as a JWK.\nSpec https://datatracker.ietf.org/doc/html/rfc7517 ."
|
|
34
|
+
},
|
|
35
|
+
"revocation": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Multi key partial revocation."
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": [
|
|
41
|
+
"id",
|
|
42
|
+
"controller",
|
|
43
|
+
"type"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidLabel",
|
|
4
|
+
"title": "DidLabel",
|
|
5
|
+
"description": "Interface describing a DID Label.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"@value": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The value for the label."
|
|
11
|
+
},
|
|
12
|
+
"@language": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The language for the label."
|
|
15
|
+
},
|
|
16
|
+
"@direction": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The direction of the label."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"@value",
|
|
23
|
+
"@language"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidPresentationVerification",
|
|
4
|
+
"title": "DidPresentationVerification",
|
|
5
|
+
"description": "Interface describing the result of checking verifiable presentation.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"isVerified": {
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"description": "Is the whole presentation verified."
|
|
11
|
+
},
|
|
12
|
+
"holder": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The id of the holder."
|
|
18
|
+
},
|
|
19
|
+
"isVerified": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "Is the holder verified."
|
|
22
|
+
},
|
|
23
|
+
"document": {
|
|
24
|
+
"$ref": "https://schema.twindev.org/w3c-did/DidDocument",
|
|
25
|
+
"description": "The DID document for the holder."
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"id",
|
|
30
|
+
"isVerified"
|
|
31
|
+
],
|
|
32
|
+
"description": "Who was the holder."
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": [
|
|
36
|
+
"isVerified"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-did/DidService",
|
|
4
|
+
"title": "DidService",
|
|
5
|
+
"description": "Interface describing a did document service.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The id of the service."
|
|
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 type of the service."
|
|
25
|
+
},
|
|
26
|
+
"serviceEndpoint": {
|
|
27
|
+
"anyOf": [
|
|
28
|
+
{
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"description": "The endpoint for the service."
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": [
|
|
42
|
+
"id",
|
|
43
|
+
"type",
|
|
44
|
+
"serviceEndpoint"
|
|
45
|
+
]
|
|
46
|
+
}
|