@twin.org/standards-w3c-did 0.0.1-next.10 → 0.0.1-next.12
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/cjs/index.cjs +35 -3
- package/dist/esm/index.mjs +35 -3
- package/dist/types/models/IDidDocument.d.ts +5 -0
- package/dist/types/models/IDidProof.d.ts +10 -4
- package/dist/types/models/IDidVerifiableCredential.d.ts +2 -2
- package/dist/types/models/IDidVerifiablePresentation.d.ts +2 -2
- package/dist/types/models/didContexts.d.ts +18 -2
- package/dist/types/models/didTypes.d.ts +16 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/interfaces/IDidDocument.md +8 -0
- package/docs/reference/interfaces/IDidProof.md +13 -5
- package/docs/reference/interfaces/IDidVerifiableCredential.md +1 -1
- package/docs/reference/interfaces/IDidVerifiablePresentation.md +1 -1
- package/docs/reference/variables/DidContexts.md +28 -4
- package/docs/reference/variables/DidTypes.md +24 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -7,14 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
9
|
const DidContexts = {
|
|
10
|
+
/**
|
|
11
|
+
* The context root for DID.
|
|
12
|
+
*/
|
|
13
|
+
Context: "https://www.w3.org/ns/did/v1",
|
|
10
14
|
/**
|
|
11
15
|
* The context root for DID VC v1.
|
|
12
16
|
*/
|
|
13
|
-
|
|
17
|
+
ContextVCv1: "https://www.w3.org/2018/credentials/v1",
|
|
14
18
|
/**
|
|
15
19
|
* The context root for DID VC v2.
|
|
16
20
|
*/
|
|
17
|
-
|
|
21
|
+
ContextVCv2: "https://www.w3.org/ns/credentials/v2",
|
|
22
|
+
/**
|
|
23
|
+
* The context root for security ed25519 suites.
|
|
24
|
+
*/
|
|
25
|
+
ContextSecurityEd25519: "https://w3id.org/security/suites/ed25519-2020/v1",
|
|
26
|
+
/**
|
|
27
|
+
* The context root for security jws-2020 suites.
|
|
28
|
+
*/
|
|
29
|
+
ContextSecurityJws2020: "https://w3id.org/security/suites/jws-2020/v1",
|
|
30
|
+
/**
|
|
31
|
+
* The context root for VC Data Integrity.
|
|
32
|
+
*/
|
|
33
|
+
ContextVCDataIntegrity: "https://w3id.org/security/data-integrity/v2"
|
|
18
34
|
};
|
|
19
35
|
|
|
20
36
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -31,7 +47,23 @@ const DidTypes = {
|
|
|
31
47
|
/**
|
|
32
48
|
* The type for Verifiable Presentation.
|
|
33
49
|
*/
|
|
34
|
-
VerifiablePresentation: "VerifiablePresentation"
|
|
50
|
+
VerifiablePresentation: "VerifiablePresentation",
|
|
51
|
+
/**
|
|
52
|
+
* The type for Data Integrity Proof.
|
|
53
|
+
*/
|
|
54
|
+
DataIntegrityProof: "DataIntegrityProof",
|
|
55
|
+
/**
|
|
56
|
+
* The type for Ed25519VerificationKey2020.
|
|
57
|
+
*/
|
|
58
|
+
Ed25519VerificationKey2020: "Ed25519VerificationKey2020",
|
|
59
|
+
/**
|
|
60
|
+
* The type for JsonWebKey2020.
|
|
61
|
+
*/
|
|
62
|
+
JsonWebKey2020: "JsonWebKey2020",
|
|
63
|
+
/**
|
|
64
|
+
* The type for LinkedDomains.
|
|
65
|
+
*/
|
|
66
|
+
LinkedDomains: "LinkedDomains"
|
|
35
67
|
};
|
|
36
68
|
|
|
37
69
|
/**
|
package/dist/esm/index.mjs
CHANGED
|
@@ -5,14 +5,30 @@
|
|
|
5
5
|
*/
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
7
|
const DidContexts = {
|
|
8
|
+
/**
|
|
9
|
+
* The context root for DID.
|
|
10
|
+
*/
|
|
11
|
+
Context: "https://www.w3.org/ns/did/v1",
|
|
8
12
|
/**
|
|
9
13
|
* The context root for DID VC v1.
|
|
10
14
|
*/
|
|
11
|
-
|
|
15
|
+
ContextVCv1: "https://www.w3.org/2018/credentials/v1",
|
|
12
16
|
/**
|
|
13
17
|
* The context root for DID VC v2.
|
|
14
18
|
*/
|
|
15
|
-
|
|
19
|
+
ContextVCv2: "https://www.w3.org/ns/credentials/v2",
|
|
20
|
+
/**
|
|
21
|
+
* The context root for security ed25519 suites.
|
|
22
|
+
*/
|
|
23
|
+
ContextSecurityEd25519: "https://w3id.org/security/suites/ed25519-2020/v1",
|
|
24
|
+
/**
|
|
25
|
+
* The context root for security jws-2020 suites.
|
|
26
|
+
*/
|
|
27
|
+
ContextSecurityJws2020: "https://w3id.org/security/suites/jws-2020/v1",
|
|
28
|
+
/**
|
|
29
|
+
* The context root for VC Data Integrity.
|
|
30
|
+
*/
|
|
31
|
+
ContextVCDataIntegrity: "https://w3id.org/security/data-integrity/v2"
|
|
16
32
|
};
|
|
17
33
|
|
|
18
34
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -29,7 +45,23 @@ const DidTypes = {
|
|
|
29
45
|
/**
|
|
30
46
|
* The type for Verifiable Presentation.
|
|
31
47
|
*/
|
|
32
|
-
VerifiablePresentation: "VerifiablePresentation"
|
|
48
|
+
VerifiablePresentation: "VerifiablePresentation",
|
|
49
|
+
/**
|
|
50
|
+
* The type for Data Integrity Proof.
|
|
51
|
+
*/
|
|
52
|
+
DataIntegrityProof: "DataIntegrityProof",
|
|
53
|
+
/**
|
|
54
|
+
* The type for Ed25519VerificationKey2020.
|
|
55
|
+
*/
|
|
56
|
+
Ed25519VerificationKey2020: "Ed25519VerificationKey2020",
|
|
57
|
+
/**
|
|
58
|
+
* The type for JsonWebKey2020.
|
|
59
|
+
*/
|
|
60
|
+
JsonWebKey2020: "JsonWebKey2020",
|
|
61
|
+
/**
|
|
62
|
+
* The type for LinkedDomains.
|
|
63
|
+
*/
|
|
64
|
+
LinkedDomains: "LinkedDomains"
|
|
33
65
|
};
|
|
34
66
|
|
|
35
67
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionRoot } from "@twin.org/data-json-ld";
|
|
1
2
|
import type { IDidDocumentVerificationMethod } from "./IDidDocumentVerificationMethod";
|
|
2
3
|
import type { IDidService } from "./IDidService";
|
|
3
4
|
/**
|
|
@@ -5,6 +6,10 @@ import type { IDidService } from "./IDidService";
|
|
|
5
6
|
* Spec https://www.w3.org/TR/did-core/#did-document-properties.
|
|
6
7
|
*/
|
|
7
8
|
export interface IDidDocument {
|
|
9
|
+
/**
|
|
10
|
+
* The context for the document.
|
|
11
|
+
*/
|
|
12
|
+
"@context"?: IJsonLdContextDefinitionRoot;
|
|
8
13
|
/**
|
|
9
14
|
* The id for the document.
|
|
10
15
|
*/
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import type { DidContexts } from "./didContexts";
|
|
2
|
+
import type { DidTypes } from "./didTypes";
|
|
1
3
|
/**
|
|
2
4
|
* Interface describing a did proof.
|
|
3
5
|
* https://www.w3.org/TR/vc-data-integrity/
|
|
4
6
|
*/
|
|
5
7
|
export interface IDidProof {
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
9
|
+
* JSON-LD Context.
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
"@context"?: typeof DidContexts.ContextVCDataIntegrity | [typeof DidContexts.ContextVCDataIntegrity, ...string[]];
|
|
12
|
+
/**
|
|
13
|
+
* JSON-LD Type.
|
|
14
|
+
*/
|
|
15
|
+
type: typeof DidTypes.DataIntegrityProof;
|
|
10
16
|
/**
|
|
11
|
-
* The
|
|
17
|
+
* The id of the proof.
|
|
12
18
|
*/
|
|
13
|
-
|
|
19
|
+
id?: string;
|
|
14
20
|
/**
|
|
15
21
|
* The purpose of the proof.
|
|
16
22
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { IJsonLdContextDefinitionRoot,
|
|
1
|
+
import type { IJsonLdContextDefinitionRoot, IJsonLdObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import type { IDidCredentialStatus } from "./IDidCredentialStatus";
|
|
3
3
|
import type { IDidProof } from "./IDidProof";
|
|
4
4
|
/**
|
|
5
5
|
* Interface describing a verifiable credential.
|
|
6
6
|
*/
|
|
7
|
-
export interface IDidVerifiableCredential<T extends
|
|
7
|
+
export interface IDidVerifiableCredential<T extends IJsonLdObject = IJsonLdObject> {
|
|
8
8
|
/**
|
|
9
9
|
* The context for the verifiable credential.
|
|
10
10
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { IJsonLdContextDefinitionRoot,
|
|
1
|
+
import type { IJsonLdContextDefinitionRoot, IJsonLdObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import type { IDidProof } from "./IDidProof";
|
|
3
3
|
import type { IDidVerifiableCredential } from "./IDidVerifiableCredential";
|
|
4
4
|
/**
|
|
5
5
|
* Interface describing a verifiable presentation.
|
|
6
6
|
*/
|
|
7
|
-
export interface IDidVerifiablePresentation<T extends
|
|
7
|
+
export interface IDidVerifiablePresentation<T extends IJsonLdObject = IJsonLdObject> {
|
|
8
8
|
/**
|
|
9
9
|
* The context for the verifiable credential.
|
|
10
10
|
*/
|
|
@@ -2,14 +2,30 @@
|
|
|
2
2
|
* The contexts for DIDs.
|
|
3
3
|
*/
|
|
4
4
|
export declare const DidContexts: {
|
|
5
|
+
/**
|
|
6
|
+
* The context root for DID.
|
|
7
|
+
*/
|
|
8
|
+
readonly Context: "https://www.w3.org/ns/did/v1";
|
|
5
9
|
/**
|
|
6
10
|
* The context root for DID VC v1.
|
|
7
11
|
*/
|
|
8
|
-
readonly
|
|
12
|
+
readonly ContextVCv1: "https://www.w3.org/2018/credentials/v1";
|
|
9
13
|
/**
|
|
10
14
|
* The context root for DID VC v2.
|
|
11
15
|
*/
|
|
12
|
-
readonly
|
|
16
|
+
readonly ContextVCv2: "https://www.w3.org/ns/credentials/v2";
|
|
17
|
+
/**
|
|
18
|
+
* The context root for security ed25519 suites.
|
|
19
|
+
*/
|
|
20
|
+
readonly ContextSecurityEd25519: "https://w3id.org/security/suites/ed25519-2020/v1";
|
|
21
|
+
/**
|
|
22
|
+
* The context root for security jws-2020 suites.
|
|
23
|
+
*/
|
|
24
|
+
readonly ContextSecurityJws2020: "https://w3id.org/security/suites/jws-2020/v1";
|
|
25
|
+
/**
|
|
26
|
+
* The context root for VC Data Integrity.
|
|
27
|
+
*/
|
|
28
|
+
readonly ContextVCDataIntegrity: "https://w3id.org/security/data-integrity/v2";
|
|
13
29
|
};
|
|
14
30
|
/**
|
|
15
31
|
* The contexts for DIDs.
|
|
@@ -10,6 +10,22 @@ export declare const DidTypes: {
|
|
|
10
10
|
* The type for Verifiable Presentation.
|
|
11
11
|
*/
|
|
12
12
|
readonly VerifiablePresentation: "VerifiablePresentation";
|
|
13
|
+
/**
|
|
14
|
+
* The type for Data Integrity Proof.
|
|
15
|
+
*/
|
|
16
|
+
readonly DataIntegrityProof: "DataIntegrityProof";
|
|
17
|
+
/**
|
|
18
|
+
* The type for Ed25519VerificationKey2020.
|
|
19
|
+
*/
|
|
20
|
+
readonly Ed25519VerificationKey2020: "Ed25519VerificationKey2020";
|
|
21
|
+
/**
|
|
22
|
+
* The type for JsonWebKey2020.
|
|
23
|
+
*/
|
|
24
|
+
readonly JsonWebKey2020: "JsonWebKey2020";
|
|
25
|
+
/**
|
|
26
|
+
* The type for LinkedDomains.
|
|
27
|
+
*/
|
|
28
|
+
readonly LinkedDomains: "LinkedDomains";
|
|
13
29
|
};
|
|
14
30
|
/**
|
|
15
31
|
* The types for DIDs.
|
package/docs/changelog.md
CHANGED
|
@@ -5,19 +5,27 @@ https://www.w3.org/TR/vc-data-integrity/
|
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
|
-
###
|
|
8
|
+
### @context?
|
|
9
9
|
|
|
10
|
-
> `optional`
|
|
10
|
+
> `optional` **@context**: `"https://w3id.org/security/data-integrity/v2"` \| [`"https://w3id.org/security/data-integrity/v2"`, `...string[]`]
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
JSON-LD Context.
|
|
13
13
|
|
|
14
14
|
***
|
|
15
15
|
|
|
16
16
|
### type
|
|
17
17
|
|
|
18
|
-
> **type**: `
|
|
18
|
+
> **type**: `"DataIntegrityProof"`
|
|
19
|
+
|
|
20
|
+
JSON-LD Type.
|
|
21
|
+
|
|
22
|
+
***
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
### id?
|
|
25
|
+
|
|
26
|
+
> `optional` **id**: `string`
|
|
27
|
+
|
|
28
|
+
The id of the proof.
|
|
21
29
|
|
|
22
30
|
***
|
|
23
31
|
|
|
@@ -6,14 +6,38 @@ The contexts for DIDs.
|
|
|
6
6
|
|
|
7
7
|
## Type declaration
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Context
|
|
10
10
|
|
|
11
|
-
> `readonly` **
|
|
11
|
+
> `readonly` **Context**: `"https://www.w3.org/ns/did/v1"` = `"https://www.w3.org/ns/did/v1"`
|
|
12
|
+
|
|
13
|
+
The context root for DID.
|
|
14
|
+
|
|
15
|
+
### ContextVCv1
|
|
16
|
+
|
|
17
|
+
> `readonly` **ContextVCv1**: `"https://www.w3.org/2018/credentials/v1"` = `"https://www.w3.org/2018/credentials/v1"`
|
|
12
18
|
|
|
13
19
|
The context root for DID VC v1.
|
|
14
20
|
|
|
15
|
-
###
|
|
21
|
+
### ContextVCv2
|
|
16
22
|
|
|
17
|
-
> `readonly` **
|
|
23
|
+
> `readonly` **ContextVCv2**: `"https://www.w3.org/ns/credentials/v2"` = `"https://www.w3.org/ns/credentials/v2"`
|
|
18
24
|
|
|
19
25
|
The context root for DID VC v2.
|
|
26
|
+
|
|
27
|
+
### ContextSecurityEd25519
|
|
28
|
+
|
|
29
|
+
> `readonly` **ContextSecurityEd25519**: `"https://w3id.org/security/suites/ed25519-2020/v1"` = `"https://w3id.org/security/suites/ed25519-2020/v1"`
|
|
30
|
+
|
|
31
|
+
The context root for security ed25519 suites.
|
|
32
|
+
|
|
33
|
+
### ContextSecurityJws2020
|
|
34
|
+
|
|
35
|
+
> `readonly` **ContextSecurityJws2020**: `"https://w3id.org/security/suites/jws-2020/v1"` = `"https://w3id.org/security/suites/jws-2020/v1"`
|
|
36
|
+
|
|
37
|
+
The context root for security jws-2020 suites.
|
|
38
|
+
|
|
39
|
+
### ContextVCDataIntegrity
|
|
40
|
+
|
|
41
|
+
> `readonly` **ContextVCDataIntegrity**: `"https://w3id.org/security/data-integrity/v2"` = `"https://w3id.org/security/data-integrity/v2"`
|
|
42
|
+
|
|
43
|
+
The context root for VC Data Integrity.
|
|
@@ -17,3 +17,27 @@ The type for Verifiable Credential.
|
|
|
17
17
|
> `readonly` **VerifiablePresentation**: `"VerifiablePresentation"` = `"VerifiablePresentation"`
|
|
18
18
|
|
|
19
19
|
The type for Verifiable Presentation.
|
|
20
|
+
|
|
21
|
+
### DataIntegrityProof
|
|
22
|
+
|
|
23
|
+
> `readonly` **DataIntegrityProof**: `"DataIntegrityProof"` = `"DataIntegrityProof"`
|
|
24
|
+
|
|
25
|
+
The type for Data Integrity Proof.
|
|
26
|
+
|
|
27
|
+
### Ed25519VerificationKey2020
|
|
28
|
+
|
|
29
|
+
> `readonly` **Ed25519VerificationKey2020**: `"Ed25519VerificationKey2020"` = `"Ed25519VerificationKey2020"`
|
|
30
|
+
|
|
31
|
+
The type for Ed25519VerificationKey2020.
|
|
32
|
+
|
|
33
|
+
### JsonWebKey2020
|
|
34
|
+
|
|
35
|
+
> `readonly` **JsonWebKey2020**: `"JsonWebKey2020"` = `"JsonWebKey2020"`
|
|
36
|
+
|
|
37
|
+
The type for JsonWebKey2020.
|
|
38
|
+
|
|
39
|
+
### LinkedDomains
|
|
40
|
+
|
|
41
|
+
> `readonly` **LinkedDomains**: `"LinkedDomains"` = `"LinkedDomains"`
|
|
42
|
+
|
|
43
|
+
The type for LinkedDomains.
|