@twin.org/standards-w3c-did 0.0.1-next.5 → 0.0.1-next.7

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.
@@ -1,5 +1,22 @@
1
1
  'use strict';
2
2
 
3
+ // Copyright 2024 IOTA Stiftung.
4
+ // SPDX-License-Identifier: Apache-2.0.
5
+ /**
6
+ * The contexts for DIDs.
7
+ */
8
+ // eslint-disable-next-line @typescript-eslint/naming-convention
9
+ const DidContexts = {
10
+ /**
11
+ * The context root for DID VC v1.
12
+ */
13
+ ContextV1: "https://www.w3.org/2018/credentials/v1",
14
+ /**
15
+ * The context root for DID VC v2.
16
+ */
17
+ ContextV2: "https://www.w3.org/ns/credentials/v2"
18
+ };
19
+
3
20
  /**
4
21
  * The types of verification method.
5
22
  */
@@ -31,4 +48,5 @@ const DidVerificationMethodType = {
31
48
  CapabilityDelegation: "capabilityDelegation"
32
49
  };
33
50
 
51
+ exports.DidContexts = DidContexts;
34
52
  exports.DidVerificationMethodType = DidVerificationMethodType;
@@ -1,3 +1,20 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The contexts for DIDs.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ const DidContexts = {
8
+ /**
9
+ * The context root for DID VC v1.
10
+ */
11
+ ContextV1: "https://www.w3.org/2018/credentials/v1",
12
+ /**
13
+ * The context root for DID VC v2.
14
+ */
15
+ ContextV2: "https://www.w3.org/ns/credentials/v2"
16
+ };
17
+
1
18
  /**
2
19
  * The types of verification method.
3
20
  */
@@ -29,4 +46,4 @@ const DidVerificationMethodType = {
29
46
  CapabilityDelegation: "capabilityDelegation"
30
47
  };
31
48
 
32
- export { DidVerificationMethodType };
49
+ export { DidContexts, DidVerificationMethodType };
@@ -1,3 +1,5 @@
1
+ export * from "./models/didContexts";
2
+ export * from "./models/didVerificationMethodType";
1
3
  export * from "./models/IDidCredentialStatus";
2
4
  export * from "./models/IDidDocument";
3
5
  export * from "./models/IDidDocumentVerificationMethod";
@@ -6,4 +8,3 @@ export * from "./models/IDidProof";
6
8
  export * from "./models/IDidService";
7
9
  export * from "./models/IDidVerifiableCredential";
8
10
  export * from "./models/IDidVerifiablePresentation";
9
- export * from "./models/didVerificationMethodType";
@@ -1,5 +1,6 @@
1
- import type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
+ import type { IJsonLdContextDefinitionRoot } from "@twin.org/data-json-ld";
2
2
  import type { IDidProof } from "./IDidProof";
3
+ import type { IDidVerifiableCredential } from "./IDidVerifiableCredential";
3
4
  /**
4
5
  * Interface describing a verifiable presentation.
5
6
  */
@@ -19,7 +20,7 @@ export interface IDidVerifiablePresentation {
19
20
  /**
20
21
  * The data for the verifiable credentials.
21
22
  */
22
- verifiableCredential: (string | IJsonLdNodeObject)[];
23
+ verifiableCredential: (string | IDidVerifiableCredential)[];
23
24
  /**
24
25
  * The entity generating the presentation.
25
26
  */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The contexts for DIDs.
3
+ */
4
+ export declare const DidContexts: {
5
+ /**
6
+ * The context root for DID VC v1.
7
+ */
8
+ readonly ContextV1: "https://www.w3.org/2018/credentials/v1";
9
+ /**
10
+ * The context root for DID VC v2.
11
+ */
12
+ readonly ContextV2: "https://www.w3.org/ns/credentials/v2";
13
+ };
14
+ /**
15
+ * The contexts for DIDs.
16
+ */
17
+ export type DidContexts = (typeof DidContexts)[keyof typeof DidContexts];
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/standards-w3c-did - Changelog
2
2
 
3
- ## v0.0.1-next.5
3
+ ## v0.0.1-next.7
4
4
 
5
5
  - Initial Release
@@ -13,8 +13,10 @@
13
13
 
14
14
  ## Type Aliases
15
15
 
16
+ - [DidContexts](type-aliases/DidContexts.md)
16
17
  - [DidVerificationMethodType](type-aliases/DidVerificationMethodType.md)
17
18
 
18
19
  ## Variables
19
20
 
21
+ - [DidContexts](variables/DidContexts.md)
20
22
  - [DidVerificationMethodType](variables/DidVerificationMethodType.md)
@@ -30,7 +30,7 @@ The types of the data stored in the verifiable credential.
30
30
 
31
31
  ### verifiableCredential
32
32
 
33
- > **verifiableCredential**: (`string` \| `IJsonLdNodeObject`)[]
33
+ > **verifiableCredential**: (`string` \| [`IDidVerifiableCredential`](IDidVerifiableCredential.md))[]
34
34
 
35
35
  The data for the verifiable credentials.
36
36
 
@@ -0,0 +1,5 @@
1
+ # Type Alias: DidContexts
2
+
3
+ > **DidContexts**: *typeof* [`DidContexts`](../variables/DidContexts.md)\[keyof *typeof* [`DidContexts`](../variables/DidContexts.md)\]
4
+
5
+ The contexts for DIDs.
@@ -0,0 +1,19 @@
1
+ # Variable: DidContexts
2
+
3
+ > `const` **DidContexts**: `object`
4
+
5
+ The contexts for DIDs.
6
+
7
+ ## Type declaration
8
+
9
+ ### ContextV1
10
+
11
+ > `readonly` **ContextV1**: `"https://www.w3.org/2018/credentials/v1"` = `"https://www.w3.org/2018/credentials/v1"`
12
+
13
+ The context root for DID VC v1.
14
+
15
+ ### ContextV2
16
+
17
+ > `readonly` **ContextV2**: `"https://www.w3.org/ns/credentials/v2"` = `"https://www.w3.org/ns/credentials/v2"`
18
+
19
+ The context root for DID VC v2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/standards-w3c-did",
3
- "version": "0.0.1-next.5",
3
+ "version": "0.0.1-next.7",
4
4
  "description": "Models which define the structure of W3C DID Standard",
5
5
  "repository": {
6
6
  "type": "git",