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

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,13 +1,14 @@
1
+ import type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
2
  import type { IDidCredentialStatus } from "./IDidCredentialStatus";
2
3
  import type { IDidProof } from "./IDidProof";
3
4
  /**
4
5
  * Interface describing a verifiable credential.
5
6
  */
6
- export interface IDidVerifiableCredential<T = unknown> {
7
+ export interface IDidVerifiableCredential {
7
8
  /**
8
9
  * The context for the verifiable credential.
9
10
  */
10
- "@context": string | string[];
11
+ "@context": IJsonLdContextDefinitionRoot;
11
12
  /**
12
13
  * The identifier for the verifiable credential.
13
14
  */
@@ -19,7 +20,7 @@ export interface IDidVerifiableCredential<T = unknown> {
19
20
  /**
20
21
  * The data for the verifiable credential.
21
22
  */
22
- credentialSubject: T | T[];
23
+ credentialSubject: IJsonLdNodeObject | IJsonLdNodeObject[];
23
24
  /**
24
25
  * Used to discover information about the current status of the
25
26
  * verifiable credential, such as whether it is suspended or revoked.
@@ -1,3 +1,4 @@
1
+ import type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
2
  import type { IDidProof } from "./IDidProof";
2
3
  /**
3
4
  * Interface describing a verifiable presentation.
@@ -6,7 +7,7 @@ export interface IDidVerifiablePresentation {
6
7
  /**
7
8
  * The context for the verifiable credential.
8
9
  */
9
- "@context": string | string[];
10
+ "@context": IJsonLdContextDefinitionRoot;
10
11
  /**
11
12
  * Provide a unique identifier for the presentation.
12
13
  */
@@ -18,7 +19,7 @@ export interface IDidVerifiablePresentation {
18
19
  /**
19
20
  * The data for the verifiable credentials.
20
21
  */
21
- verifiableCredential: string[];
22
+ verifiableCredential: (string | IJsonLdNodeObject)[];
22
23
  /**
23
24
  * The entity generating the presentation.
24
25
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/standards-w3c-did - Changelog
2
2
 
3
- ## v0.0.1-next.3
3
+ ## v0.0.1-next.5
4
4
 
5
5
  - Initial Release
@@ -1,16 +1,12 @@
1
- # Interface: IDidVerifiableCredential\<T\>
1
+ # Interface: IDidVerifiableCredential
2
2
 
3
3
  Interface describing a verifiable credential.
4
4
 
5
- ## Type Parameters
6
-
7
- • **T** = `unknown`
8
-
9
5
  ## Properties
10
6
 
11
7
  ### @context
12
8
 
13
- > **@context**: `string` \| `string`[]
9
+ > **@context**: `IJsonLdContextDefinitionRoot`
14
10
 
15
11
  The context for the verifiable credential.
16
12
 
@@ -34,7 +30,7 @@ The types of the data stored in the verifiable credential.
34
30
 
35
31
  ### credentialSubject
36
32
 
37
- > **credentialSubject**: `T` \| `T`[]
33
+ > **credentialSubject**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
38
34
 
39
35
  The data for the verifiable credential.
40
36
 
@@ -6,7 +6,7 @@ Interface describing a verifiable presentation.
6
6
 
7
7
  ### @context
8
8
 
9
- > **@context**: `string` \| `string`[]
9
+ > **@context**: `IJsonLdContextDefinitionRoot`
10
10
 
11
11
  The context for the verifiable credential.
12
12
 
@@ -30,7 +30,7 @@ The types of the data stored in the verifiable credential.
30
30
 
31
31
  ### verifiableCredential
32
32
 
33
- > **verifiableCredential**: `string`[]
33
+ > **verifiableCredential**: (`string` \| `IJsonLdNodeObject`)[]
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.3",
3
+ "version": "0.0.1-next.5",
4
4
  "description": "Models which define the structure of W3C DID Standard",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,35 +13,10 @@
13
13
  "engines": {
14
14
  "node": ">=20.0.0"
15
15
  },
16
- "scripts": {
17
- "clean": "rimraf dist coverage docs/reference",
18
- "build": "tspc",
19
- "test": "vitest --run --config ./vitest.config.ts --no-cache",
20
- "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
21
- "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
22
- "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
23
- "bundle": "npm run bundle:esm && npm run bundle:cjs",
24
- "docs:clean": "rimraf docs/reference",
25
- "docs:generate": "typedoc",
26
- "docs": "npm run docs:clean && npm run docs:generate",
27
- "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs"
28
- },
29
16
  "dependencies": {
17
+ "@twin.org/data-json-ld": "next",
30
18
  "@twin.org/web": "next"
31
19
  },
32
- "devDependencies": {
33
- "@twin.org/nameof-transformer": "next",
34
- "@vitest/coverage-v8": "2.1.1",
35
- "copyfiles": "2.4.1",
36
- "rimraf": "6.0.1",
37
- "rollup": "4.22.0",
38
- "rollup-plugin-typescript2": "0.36.0",
39
- "ts-patch": "3.2.1",
40
- "typedoc": "0.26.7",
41
- "typedoc-plugin-markdown": "4.2.7",
42
- "typescript": "5.6.2",
43
- "vitest": "2.1.1"
44
- },
45
20
  "main": "./dist/cjs/index.cjs",
46
21
  "module": "./dist/esm/index.mjs",
47
22
  "types": "./dist/types/index.d.ts",