@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.
- package/dist/types/models/IAttestationComponent.d.ts +4 -3
- package/dist/types/models/IAttestationConnector.d.ts +4 -3
- package/dist/types/models/IAttestationInformation.d.ts +2 -1
- package/dist/types/models/api/IAttestationAttestRequest.d.ts +2 -1
- package/docs/changelog.md +1 -1
- package/docs/reference/interfaces/IAttestationAttestRequest.md +1 -1
- package/docs/reference/interfaces/IAttestationAttestResponse.md +1 -1
- package/docs/reference/interfaces/IAttestationComponent.md +3 -3
- package/docs/reference/interfaces/IAttestationConnector.md +3 -3
- package/docs/reference/interfaces/IAttestationInformation.md +1 -1
- package/docs/reference/interfaces/IAttestationTransferResponse.md +1 -1
- package/docs/reference/interfaces/IAttestationVerifyResponse.md +1 -1
- package/package.json +2 -27
@@ -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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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:
|
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
@@ -16,7 +16,7 @@ Attest the data and return the collated information.
|
|
16
16
|
|
17
17
|
#### Type Parameters
|
18
18
|
|
19
|
-
• **T** = `
|
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** = `
|
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** = `
|
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** = `
|
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** = `
|
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** = `
|
91
|
+
• **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
|
92
92
|
|
93
93
|
#### Parameters
|
94
94
|
|
@@ -12,6 +12,6 @@ The data returned from the transfer response.
|
|
12
12
|
|
13
13
|
#### information
|
14
14
|
|
15
|
-
> **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`
|
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)\<`
|
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
|
+
"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",
|