@twin.org/attestation-models 0.0.1-next.3 → 0.0.1-next.4
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 +5 -4
- package/dist/types/models/IAttestationConnector.d.ts +5 -4
- package/dist/types/models/IAttestationInformation.d.ts +3 -2
- 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 +7 -19
- package/docs/reference/interfaces/IAttestationConnector.md +7 -19
- package/docs/reference/interfaces/IAttestationInformation.md +2 -6
- 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,16 +14,16 @@ 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
|
17
|
+
attest(verificationMethodId: string, data: IJsonLdNodeObject, namespace?: string, identity?: string, nodeIdentity?: string): Promise<IAttestationInformation>;
|
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
|
23
|
+
verify(attestationId: string): Promise<{
|
23
24
|
verified: boolean;
|
24
25
|
failure?: string;
|
25
|
-
information?: Partial<IAttestationInformation
|
26
|
+
information?: Partial<IAttestationInformation>;
|
26
27
|
}>;
|
27
28
|
/**
|
28
29
|
* Transfer the attestation to a new holder.
|
@@ -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
|
35
|
+
transfer(attestationId: string, holderIdentity: string, identity?: string): Promise<IAttestationInformation>;
|
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,16 +13,16 @@ export interface IAttestationConnector extends IComponent {
|
|
12
13
|
* @param data The data to attest.
|
13
14
|
* @returns The collated attestation data.
|
14
15
|
*/
|
15
|
-
attest
|
16
|
+
attest(controller: string, address: string, verificationMethodId: string, data: IJsonLdNodeObject): Promise<IAttestationInformation>;
|
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
|
22
|
+
verify(attestationId: string): Promise<{
|
22
23
|
verified: boolean;
|
23
24
|
failure?: string;
|
24
|
-
information?: Partial<IAttestationInformation
|
25
|
+
information?: Partial<IAttestationInformation>;
|
25
26
|
}>;
|
26
27
|
/**
|
27
28
|
* Transfer the attestation to a new holder.
|
@@ -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
|
35
|
+
transfer(controller: string, attestationId: string, holderIdentity: string, holderAddress: string): Promise<IAttestationInformation>;
|
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
|
6
|
+
export interface IAttestationInformation {
|
6
7
|
/**
|
7
8
|
* The unique identifier of the attestation.
|
8
9
|
*/
|
@@ -26,7 +27,7 @@ export interface IAttestationInformation<T = unknown> {
|
|
26
27
|
/**
|
27
28
|
* The data that was attested.
|
28
29
|
*/
|
29
|
-
data:
|
30
|
+
data: IJsonLdNodeObject;
|
30
31
|
/**
|
31
32
|
* The proof for the attested data.
|
32
33
|
*/
|
@@ -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
@@ -10,21 +10,17 @@ Interface describing an attestation contract.
|
|
10
10
|
|
11
11
|
### attest()
|
12
12
|
|
13
|
-
> **attest
|
13
|
+
> **attest**(`verificationMethodId`, `data`, `namespace`?, `identity`?, `nodeIdentity`?): `Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
14
14
|
|
15
15
|
Attest the data and return the collated information.
|
16
16
|
|
17
|
-
#### Type Parameters
|
18
|
-
|
19
|
-
• **T** = `unknown`
|
20
|
-
|
21
17
|
#### Parameters
|
22
18
|
|
23
19
|
• **verificationMethodId**: `string`
|
24
20
|
|
25
21
|
The identity verification method to use for attesting the data.
|
26
22
|
|
27
|
-
• **data**: `
|
23
|
+
• **data**: `IJsonLdNodeObject`
|
28
24
|
|
29
25
|
The data to attest.
|
30
26
|
|
@@ -42,7 +38,7 @@ The node identity to include in the attestation.
|
|
42
38
|
|
43
39
|
#### Returns
|
44
40
|
|
45
|
-
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)
|
41
|
+
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
46
42
|
|
47
43
|
The collated attestation data.
|
48
44
|
|
@@ -50,14 +46,10 @@ The collated attestation data.
|
|
50
46
|
|
51
47
|
### verify()
|
52
48
|
|
53
|
-
> **verify
|
49
|
+
> **verify**(`attestationId`): `Promise`\<`object`\>
|
54
50
|
|
55
51
|
Resolve and verify the attestation id.
|
56
52
|
|
57
|
-
#### Type Parameters
|
58
|
-
|
59
|
-
• **T** = `unknown`
|
60
|
-
|
61
53
|
#### Parameters
|
62
54
|
|
63
55
|
• **attestationId**: `string`
|
@@ -80,20 +72,16 @@ The verified attestation details.
|
|
80
72
|
|
81
73
|
##### information?
|
82
74
|
|
83
|
-
> `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)
|
75
|
+
> `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
84
76
|
|
85
77
|
***
|
86
78
|
|
87
79
|
### transfer()
|
88
80
|
|
89
|
-
> **transfer
|
81
|
+
> **transfer**(`attestationId`, `holderIdentity`, `identity`?): `Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
90
82
|
|
91
83
|
Transfer the attestation to a new holder.
|
92
84
|
|
93
|
-
#### Type Parameters
|
94
|
-
|
95
|
-
• **T** = `unknown`
|
96
|
-
|
97
85
|
#### Parameters
|
98
86
|
|
99
87
|
• **attestationId**: `string`
|
@@ -110,7 +98,7 @@ The identity to perform the attestation operation with.
|
|
110
98
|
|
111
99
|
#### Returns
|
112
100
|
|
113
|
-
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)
|
101
|
+
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
114
102
|
|
115
103
|
The updated attestation details.
|
116
104
|
|
@@ -10,14 +10,10 @@ Interface describing an attestation connector.
|
|
10
10
|
|
11
11
|
### attest()
|
12
12
|
|
13
|
-
> **attest
|
13
|
+
> **attest**(`controller`, `address`, `verificationMethodId`, `data`): `Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
14
14
|
|
15
15
|
Attest the data and return the collated information.
|
16
16
|
|
17
|
-
#### Type Parameters
|
18
|
-
|
19
|
-
• **T** = `unknown`
|
20
|
-
|
21
17
|
#### Parameters
|
22
18
|
|
23
19
|
• **controller**: `string`
|
@@ -32,13 +28,13 @@ The controller address for the attestation.
|
|
32
28
|
|
33
29
|
The identity verification method to use for attesting the data.
|
34
30
|
|
35
|
-
• **data**: `
|
31
|
+
• **data**: `IJsonLdNodeObject`
|
36
32
|
|
37
33
|
The data to attest.
|
38
34
|
|
39
35
|
#### Returns
|
40
36
|
|
41
|
-
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)
|
37
|
+
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
42
38
|
|
43
39
|
The collated attestation data.
|
44
40
|
|
@@ -46,14 +42,10 @@ The collated attestation data.
|
|
46
42
|
|
47
43
|
### verify()
|
48
44
|
|
49
|
-
> **verify
|
45
|
+
> **verify**(`attestationId`): `Promise`\<`object`\>
|
50
46
|
|
51
47
|
Resolve and verify the attestation id.
|
52
48
|
|
53
|
-
#### Type Parameters
|
54
|
-
|
55
|
-
• **T** = `unknown`
|
56
|
-
|
57
49
|
#### Parameters
|
58
50
|
|
59
51
|
• **attestationId**: `string`
|
@@ -76,20 +68,16 @@ The verified attestation details.
|
|
76
68
|
|
77
69
|
##### information?
|
78
70
|
|
79
|
-
> `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)
|
71
|
+
> `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
80
72
|
|
81
73
|
***
|
82
74
|
|
83
75
|
### transfer()
|
84
76
|
|
85
|
-
> **transfer
|
77
|
+
> **transfer**(`controller`, `attestationId`, `holderIdentity`, `holderAddress`): `Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
86
78
|
|
87
79
|
Transfer the attestation to a new holder.
|
88
80
|
|
89
|
-
#### Type Parameters
|
90
|
-
|
91
|
-
• **T** = `unknown`
|
92
|
-
|
93
81
|
#### Parameters
|
94
82
|
|
95
83
|
• **controller**: `string`
|
@@ -110,7 +98,7 @@ The new controller address of the attestation belonging to the holder.
|
|
110
98
|
|
111
99
|
#### Returns
|
112
100
|
|
113
|
-
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)
|
101
|
+
`Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
|
114
102
|
|
115
103
|
The updated attestation details.
|
116
104
|
|
@@ -1,11 +1,7 @@
|
|
1
|
-
# Interface: IAttestationInformation
|
1
|
+
# Interface: IAttestationInformation
|
2
2
|
|
3
3
|
Interface describing the collated attestation information.
|
4
4
|
|
5
|
-
## Type Parameters
|
6
|
-
|
7
|
-
• **T** = `unknown`
|
8
|
-
|
9
5
|
## Properties
|
10
6
|
|
11
7
|
### id
|
@@ -50,7 +46,7 @@ The identity of the current holder, can be undefined if owner is still the holde
|
|
50
46
|
|
51
47
|
### data
|
52
48
|
|
53
|
-
> **data**: `
|
49
|
+
> **data**: `IJsonLdNodeObject`
|
54
50
|
|
55
51
|
The data that was attested.
|
56
52
|
|
@@ -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)
|
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)\>
|
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.4",
|
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",
|