@twin.org/attestation-models 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,4 +1,5 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
+ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
3
  import type { IAttestationInformation } from "./IAttestationInformation";
3
4
  /**
4
5
  * Interface describing an attestation contract.
@@ -13,13 +14,13 @@ export interface IAttestationComponent extends IComponent {
13
14
  * @param nodeIdentity The node identity to include in the attestation.
14
15
  * @returns The collated attestation data.
15
16
  */
16
- attest<T = unknown>(verificationMethodId: string, data: T, namespace?: string, identity?: string, nodeIdentity?: string): Promise<IAttestationInformation<T>>;
17
+ attest<T extends IJsonLdNodeObject = IJsonLdNodeObject>(verificationMethodId: string, data: T, namespace?: string, identity?: string, nodeIdentity?: string): Promise<IAttestationInformation<T>>;
17
18
  /**
18
19
  * Resolve and verify the attestation id.
19
20
  * @param attestationId The attestation id to verify.
20
21
  * @returns The verified attestation details.
21
22
  */
22
- verify<T = unknown>(attestationId: string): Promise<{
23
+ verify<T extends IJsonLdNodeObject = IJsonLdNodeObject>(attestationId: string): Promise<{
23
24
  verified: boolean;
24
25
  failure?: string;
25
26
  information?: Partial<IAttestationInformation<T>>;
@@ -31,7 +32,7 @@ export interface IAttestationComponent extends IComponent {
31
32
  * @param identity The identity to perform the attestation operation with.
32
33
  * @returns The updated attestation details.
33
34
  */
34
- transfer<T = unknown>(attestationId: string, holderIdentity: string, identity?: string): Promise<IAttestationInformation<T>>;
35
+ transfer<T extends IJsonLdNodeObject = IJsonLdNodeObject>(attestationId: string, holderIdentity: string, identity?: string): Promise<IAttestationInformation<T>>;
35
36
  /**
36
37
  * Destroy the attestation.
37
38
  * @param attestationId The attestation to transfer.
@@ -1,4 +1,5 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
+ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
3
  import type { IAttestationInformation } from "./IAttestationInformation";
3
4
  /**
4
5
  * Interface describing an attestation connector.
@@ -12,13 +13,13 @@ export interface IAttestationConnector extends IComponent {
12
13
  * @param data The data to attest.
13
14
  * @returns The collated attestation data.
14
15
  */
15
- attest<T = unknown>(controller: string, address: string, verificationMethodId: string, data: T): Promise<IAttestationInformation<T>>;
16
+ attest<T extends IJsonLdNodeObject = IJsonLdNodeObject>(controller: string, address: string, verificationMethodId: string, data: T): Promise<IAttestationInformation<T>>;
16
17
  /**
17
18
  * Resolve and verify the attestation id.
18
19
  * @param attestationId The attestation id to verify.
19
20
  * @returns The verified attestation details.
20
21
  */
21
- verify<T = unknown>(attestationId: string): Promise<{
22
+ verify<T extends IJsonLdNodeObject = IJsonLdNodeObject>(attestationId: string): Promise<{
22
23
  verified: boolean;
23
24
  failure?: string;
24
25
  information?: Partial<IAttestationInformation<T>>;
@@ -31,7 +32,7 @@ export interface IAttestationConnector extends IComponent {
31
32
  * @param holderAddress The new controller address of the attestation belonging to the holder.
32
33
  * @returns The updated attestation details.
33
34
  */
34
- transfer<T = unknown>(controller: string, attestationId: string, holderIdentity: string, holderAddress: string): Promise<IAttestationInformation<T>>;
35
+ transfer<T extends IJsonLdNodeObject = IJsonLdNodeObject>(controller: string, attestationId: string, holderIdentity: string, holderAddress: string): Promise<IAttestationInformation<T>>;
35
36
  /**
36
37
  * Destroy the attestation.
37
38
  * @param controller The controller identity of the user to access the vault keys.
@@ -1,8 +1,9 @@
1
+ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
2
  import type { IAttestationProof } from "./IAttestationProof";
2
3
  /**
3
4
  * Interface describing the collated attestation information.
4
5
  */
5
- export interface IAttestationInformation<T = unknown> {
6
+ export interface IAttestationInformation<T extends IJsonLdNodeObject = IJsonLdNodeObject> {
6
7
  /**
7
8
  * The unique identifier of the attestation.
8
9
  */
@@ -1,3 +1,4 @@
1
+ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
2
  /**
2
3
  * Attest the data and return the collated attestation details.
3
4
  */
@@ -13,7 +14,7 @@ export interface IAttestationAttestRequest {
13
14
  /**
14
15
  * The data object to attest.
15
16
  */
16
- data: unknown;
17
+ data: IJsonLdNodeObject;
17
18
  /**
18
19
  * The namespace of the connector to use for the attestation, defaults to component configured namespace.
19
20
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/attestation-models - Changelog
2
2
 
3
- ## v0.0.1-next.3
3
+ ## v0.0.1-next.5
4
4
 
5
5
  - Initial Release
@@ -18,7 +18,7 @@ The identity verification method to use for attesting the data.
18
18
 
19
19
  #### data
20
20
 
21
- > **data**: `unknown`
21
+ > **data**: `IJsonLdNodeObject`
22
22
 
23
23
  The data object to attest.
24
24
 
@@ -12,4 +12,4 @@ The result of the attestation process.
12
12
 
13
13
  #### information
14
14
 
15
- > **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`unknown`\>
15
+ > **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`IJsonLdNodeObject`\>
@@ -16,7 +16,7 @@ Attest the data and return the collated information.
16
16
 
17
17
  #### Type Parameters
18
18
 
19
- • **T** = `unknown`
19
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
20
20
 
21
21
  #### Parameters
22
22
 
@@ -56,7 +56,7 @@ Resolve and verify the attestation id.
56
56
 
57
57
  #### Type Parameters
58
58
 
59
- • **T** = `unknown`
59
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
60
60
 
61
61
  #### Parameters
62
62
 
@@ -92,7 +92,7 @@ Transfer the attestation to a new holder.
92
92
 
93
93
  #### Type Parameters
94
94
 
95
- • **T** = `unknown`
95
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
96
96
 
97
97
  #### Parameters
98
98
 
@@ -16,7 +16,7 @@ Attest the data and return the collated information.
16
16
 
17
17
  #### Type Parameters
18
18
 
19
- • **T** = `unknown`
19
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
20
20
 
21
21
  #### Parameters
22
22
 
@@ -52,7 +52,7 @@ Resolve and verify the attestation id.
52
52
 
53
53
  #### Type Parameters
54
54
 
55
- • **T** = `unknown`
55
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
56
56
 
57
57
  #### Parameters
58
58
 
@@ -88,7 +88,7 @@ Transfer the attestation to a new holder.
88
88
 
89
89
  #### Type Parameters
90
90
 
91
- • **T** = `unknown`
91
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
92
92
 
93
93
  #### Parameters
94
94
 
@@ -4,7 +4,7 @@ Interface describing the collated attestation information.
4
4
 
5
5
  ## Type Parameters
6
6
 
7
- • **T** = `unknown`
7
+ • **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
8
8
 
9
9
  ## Properties
10
10
 
@@ -12,6 +12,6 @@ The data returned from the transfer response.
12
12
 
13
13
  #### information
14
14
 
15
- > **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`unknown`\>
15
+ > **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`IJsonLdNodeObject`\>
16
16
 
17
17
  The updated attestation information.
@@ -24,6 +24,6 @@ The failure message if the attestation is not verified.
24
24
 
25
25
  #### information?
26
26
 
27
- > `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)\<`unknown`\>\>
27
+ > `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)\<`IJsonLdNodeObject`\>\>
28
28
 
29
29
  The attestation information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/attestation-models",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "description": "Models which define the structure of the attestation connectors and services",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,38 +13,13 @@
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": {
30
17
  "@twin.org/core": "next",
18
+ "@twin.org/data-json-ld": "next",
31
19
  "@twin.org/entity": "next",
32
20
  "@twin.org/nameof": "next",
33
21
  "@twin.org/standards-w3c-did": "next"
34
22
  },
35
- "devDependencies": {
36
- "@twin.org/nameof-transformer": "next",
37
- "@vitest/coverage-v8": "2.1.1",
38
- "copyfiles": "2.4.1",
39
- "rimraf": "6.0.1",
40
- "rollup": "4.22.0",
41
- "rollup-plugin-typescript2": "0.36.0",
42
- "ts-patch": "3.2.1",
43
- "typedoc": "0.26.7",
44
- "typedoc-plugin-markdown": "4.2.7",
45
- "typescript": "5.6.2",
46
- "vitest": "2.1.1"
47
- },
48
23
  "main": "./dist/cjs/index.cjs",
49
24
  "module": "./dist/esm/index.mjs",
50
25
  "types": "./dist/types/index.d.ts",