@twin.org/attestation-models 0.0.1-next.3 → 0.0.1-next.30
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/cjs/index.cjs +204 -0
- package/dist/esm/index.mjs +202 -1
- package/dist/types/dataTypes/attestationDataTypes.d.ts +9 -0
- package/dist/types/index.d.ts +9 -8
- package/dist/types/models/IAttestationComponent.d.ts +10 -13
- package/dist/types/models/IAttestationConnector.d.ts +7 -11
- package/dist/types/models/IAttestationInformation.d.ts +33 -9
- package/dist/types/models/IAttestationJwtProof.d.ts +20 -0
- package/dist/types/models/api/{IAttestationAttestRequest.d.ts → IAttestationCreateRequest.d.ts} +4 -7
- package/dist/types/models/api/IAttestationGetRequest.d.ts +21 -0
- package/dist/types/models/api/IAttestationGetResponse.d.ts +17 -0
- package/dist/types/models/api/IAttestationTransferRequest.d.ts +5 -1
- package/dist/types/models/attestationContexts.d.ts +17 -0
- package/dist/types/models/attestationTypes.d.ts +17 -0
- package/docs/changelog.md +43 -1
- package/docs/reference/classes/AttestationDataTypes.md +25 -0
- package/docs/reference/index.md +15 -6
- package/docs/reference/interfaces/IAttestationComponent.md +47 -49
- package/docs/reference/interfaces/IAttestationConnector.md +38 -46
- package/docs/reference/interfaces/{IAttestationAttestRequest.md → IAttestationCreateRequest.md} +4 -10
- package/docs/reference/interfaces/IAttestationGetRequest.md +29 -0
- package/docs/reference/interfaces/IAttestationGetResponse.md +23 -0
- package/docs/reference/interfaces/IAttestationInformation.md +44 -16
- package/docs/reference/interfaces/IAttestationJwtProof.md +27 -0
- package/docs/reference/interfaces/IAttestationTransferRequest.md +7 -1
- package/docs/reference/type-aliases/AttestationContexts.md +5 -0
- package/docs/reference/type-aliases/AttestationTypes.md +5 -0
- package/docs/reference/variables/AttestationContexts.md +19 -0
- package/docs/reference/variables/AttestationTypes.md +19 -0
- package/package.json +9 -31
- package/dist/types/models/IAttestationProof.d.ts +0 -13
- package/dist/types/models/api/IAttestationAttestResponse.d.ts +0 -12
- package/dist/types/models/api/IAttestationTransferResponse.d.ts +0 -15
- package/dist/types/models/api/IAttestationVerifyRequest.d.ts +0 -14
- package/dist/types/models/api/IAttestationVerifyResponse.d.ts +0 -23
- package/docs/reference/interfaces/IAttestationAttestResponse.md +0 -15
- package/docs/reference/interfaces/IAttestationProof.md +0 -19
- package/docs/reference/interfaces/IAttestationTransferResponse.md +0 -17
- package/docs/reference/interfaces/IAttestationVerifyRequest.md +0 -17
- package/docs/reference/interfaces/IAttestationVerifyResponse.md +0 -29
@@ -1,12 +1,24 @@
|
|
1
|
-
# Interface: IAttestationInformation
|
1
|
+
# Interface: IAttestationInformation
|
2
2
|
|
3
3
|
Interface describing the collated attestation information.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Properties
|
6
6
|
|
7
|
-
|
7
|
+
### @context
|
8
8
|
|
9
|
-
|
9
|
+
> **@context**: \[`"https://schema.twindev.org/attestation/"`, `"https://schema.twindev.org/common/"`, `"https://schema.org"`, `...IJsonLdContextDefinitionElement[]`\]
|
10
|
+
|
11
|
+
JSON-LD Context.
|
12
|
+
|
13
|
+
***
|
14
|
+
|
15
|
+
### type
|
16
|
+
|
17
|
+
> **type**: `"Information"`
|
18
|
+
|
19
|
+
JSON-LD Type.
|
20
|
+
|
21
|
+
***
|
10
22
|
|
11
23
|
### id
|
12
24
|
|
@@ -16,27 +28,27 @@ The unique identifier of the attestation.
|
|
16
28
|
|
17
29
|
***
|
18
30
|
|
19
|
-
###
|
31
|
+
### dateCreated
|
20
32
|
|
21
|
-
> **
|
33
|
+
> **dateCreated**: `string`
|
22
34
|
|
23
35
|
Created date/time of the attestation in ISO format.
|
24
36
|
|
25
37
|
***
|
26
38
|
|
27
|
-
###
|
39
|
+
### dateTransferred?
|
28
40
|
|
29
|
-
> **
|
41
|
+
> `optional` **dateTransferred**: `string`
|
30
42
|
|
31
|
-
|
43
|
+
Transferred date/time of the attestation in ISO format, can be blank if holder identity is owner.
|
32
44
|
|
33
45
|
***
|
34
46
|
|
35
|
-
###
|
47
|
+
### ownerIdentity
|
36
48
|
|
37
|
-
>
|
49
|
+
> **ownerIdentity**: `string`
|
38
50
|
|
39
|
-
|
51
|
+
The identity of the owner.
|
40
52
|
|
41
53
|
***
|
42
54
|
|
@@ -48,16 +60,32 @@ The identity of the current holder, can be undefined if owner is still the holde
|
|
48
60
|
|
49
61
|
***
|
50
62
|
|
51
|
-
###
|
63
|
+
### attestationObject
|
52
64
|
|
53
|
-
> **
|
65
|
+
> **attestationObject**: `IJsonLdNodeObject`
|
54
66
|
|
55
67
|
The data that was attested.
|
56
68
|
|
57
69
|
***
|
58
70
|
|
59
|
-
### proof
|
71
|
+
### proof?
|
60
72
|
|
61
|
-
> **proof**:
|
73
|
+
> `optional` **proof**: `IJsonLdNodeObject`
|
62
74
|
|
63
75
|
The proof for the attested data.
|
76
|
+
|
77
|
+
***
|
78
|
+
|
79
|
+
### verified?
|
80
|
+
|
81
|
+
> `optional` **verified**: `boolean`
|
82
|
+
|
83
|
+
Whether the attestation has been verified.
|
84
|
+
|
85
|
+
***
|
86
|
+
|
87
|
+
### verificationFailure?
|
88
|
+
|
89
|
+
> `optional` **verificationFailure**: `string`
|
90
|
+
|
91
|
+
The verification failure message.
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Interface: IAttestationJwtProof
|
2
|
+
|
3
|
+
Interface describing an attestation proof.
|
4
|
+
|
5
|
+
## Properties
|
6
|
+
|
7
|
+
### @context
|
8
|
+
|
9
|
+
> **@context**: `"https://schema.twindev.org/attestation/"` \| \[`"https://schema.twindev.org/attestation/"`, `...IJsonLdContextDefinitionElement[]`\]
|
10
|
+
|
11
|
+
JSON-LD Context.
|
12
|
+
|
13
|
+
***
|
14
|
+
|
15
|
+
### type
|
16
|
+
|
17
|
+
> **type**: `"JwtProof"`
|
18
|
+
|
19
|
+
The type of the proof.
|
20
|
+
|
21
|
+
***
|
22
|
+
|
23
|
+
### value
|
24
|
+
|
25
|
+
> **value**: `string`
|
26
|
+
|
27
|
+
The value of the proof.
|
@@ -14,7 +14,7 @@ The parameters to be used in the transfer.
|
|
14
14
|
|
15
15
|
> **id**: `string`
|
16
16
|
|
17
|
-
The attestation id to
|
17
|
+
The attestation id to transfer.
|
18
18
|
|
19
19
|
***
|
20
20
|
|
@@ -29,3 +29,9 @@ The parameters to be used in the transfer.
|
|
29
29
|
> **holderIdentity**: `string`
|
30
30
|
|
31
31
|
The new holder identity.
|
32
|
+
|
33
|
+
#### holderAddress
|
34
|
+
|
35
|
+
> **holderAddress**: `string`
|
36
|
+
|
37
|
+
The new holder address.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Variable: AttestationContexts
|
2
|
+
|
3
|
+
> `const` **AttestationContexts**: `object`
|
4
|
+
|
5
|
+
The contexts of attestation data.
|
6
|
+
|
7
|
+
## Type declaration
|
8
|
+
|
9
|
+
### ContextRoot
|
10
|
+
|
11
|
+
> `readonly` **ContextRoot**: `"https://schema.twindev.org/attestation/"` = `"https://schema.twindev.org/attestation/"`
|
12
|
+
|
13
|
+
The context root for the attestation types.
|
14
|
+
|
15
|
+
### ContextRootCommon
|
16
|
+
|
17
|
+
> `readonly` **ContextRootCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
|
18
|
+
|
19
|
+
The context root for the common types.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Variable: AttestationTypes
|
2
|
+
|
3
|
+
> `const` **AttestationTypes**: `object`
|
4
|
+
|
5
|
+
The types of attestation data.
|
6
|
+
|
7
|
+
## Type declaration
|
8
|
+
|
9
|
+
### Information
|
10
|
+
|
11
|
+
> `readonly` **Information**: `"Information"` = `"Information"`
|
12
|
+
|
13
|
+
Represents attestation information.
|
14
|
+
|
15
|
+
### JwtProof
|
16
|
+
|
17
|
+
> `readonly` **JwtProof**: `"JwtProof"` = `"JwtProof"`
|
18
|
+
|
19
|
+
Represents attestation JWT proof.
|
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.30",
|
4
4
|
"description": "Models which define the structure of the attestation connectors and services",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -13,48 +13,26 @@
|
|
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-core": "next",
|
19
|
+
"@twin.org/data-json-ld": "next",
|
31
20
|
"@twin.org/entity": "next",
|
32
21
|
"@twin.org/nameof": "next",
|
33
|
-
"@twin.org/standards-
|
34
|
-
|
35
|
-
|
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"
|
22
|
+
"@twin.org/standards-schema-org": "next",
|
23
|
+
"@twin.org/standards-w3c-did": "next",
|
24
|
+
"@twin.org/web": "next"
|
47
25
|
},
|
48
26
|
"main": "./dist/cjs/index.cjs",
|
49
27
|
"module": "./dist/esm/index.mjs",
|
50
28
|
"types": "./dist/types/index.d.ts",
|
51
29
|
"exports": {
|
52
30
|
".": {
|
31
|
+
"types": "./dist/types/index.d.ts",
|
53
32
|
"require": "./dist/cjs/index.cjs",
|
54
|
-
"import": "./dist/esm/index.mjs"
|
55
|
-
"types": "./dist/types/index.d.ts"
|
33
|
+
"import": "./dist/esm/index.mjs"
|
56
34
|
},
|
57
|
-
"./locales": "./locales"
|
35
|
+
"./locales/*.json": "./locales/*.json"
|
58
36
|
},
|
59
37
|
"files": [
|
60
38
|
"dist/cjs",
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { IAttestationInformation } from "../IAttestationInformation";
|
2
|
-
/**
|
3
|
-
* The response when creating the attestation for some data.
|
4
|
-
*/
|
5
|
-
export interface IAttestationAttestResponse {
|
6
|
-
/**
|
7
|
-
* The result of the attestation process.
|
8
|
-
*/
|
9
|
-
body: {
|
10
|
-
information: IAttestationInformation;
|
11
|
-
};
|
12
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { IAttestationInformation } from "../IAttestationInformation";
|
2
|
-
/**
|
3
|
-
* The response to transferring the attestation.
|
4
|
-
*/
|
5
|
-
export interface IAttestationTransferResponse {
|
6
|
-
/**
|
7
|
-
* The data returned from the transfer response.
|
8
|
-
*/
|
9
|
-
body: {
|
10
|
-
/**
|
11
|
-
* The updated attestation information.
|
12
|
-
*/
|
13
|
-
information: IAttestationInformation;
|
14
|
-
};
|
15
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Verify that the proof is valid for the attestation.
|
3
|
-
*/
|
4
|
-
export interface IAttestationVerifyRequest {
|
5
|
-
/**
|
6
|
-
* The parameters to be used in the verification.
|
7
|
-
*/
|
8
|
-
pathParams: {
|
9
|
-
/**
|
10
|
-
* The attestation id to verify.
|
11
|
-
*/
|
12
|
-
id: string;
|
13
|
-
};
|
14
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import type { IAttestationInformation } from "../IAttestationInformation";
|
2
|
-
/**
|
3
|
-
* The response to verifying the attestation.
|
4
|
-
*/
|
5
|
-
export interface IAttestationVerifyResponse {
|
6
|
-
/**
|
7
|
-
* The data returned from the verification response.
|
8
|
-
*/
|
9
|
-
body: {
|
10
|
-
/**
|
11
|
-
* Whether the attestation is verified.
|
12
|
-
*/
|
13
|
-
verified: boolean;
|
14
|
-
/**
|
15
|
-
* The failure message if the attestation is not verified.
|
16
|
-
*/
|
17
|
-
failure?: string;
|
18
|
-
/**
|
19
|
-
* The attestation information.
|
20
|
-
*/
|
21
|
-
information?: Partial<IAttestationInformation>;
|
22
|
-
};
|
23
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Interface: IAttestationAttestResponse
|
2
|
-
|
3
|
-
The response when creating the attestation for some data.
|
4
|
-
|
5
|
-
## Properties
|
6
|
-
|
7
|
-
### body
|
8
|
-
|
9
|
-
> **body**: `object`
|
10
|
-
|
11
|
-
The result of the attestation process.
|
12
|
-
|
13
|
-
#### information
|
14
|
-
|
15
|
-
> **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`unknown`\>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# Interface: IAttestationProof
|
2
|
-
|
3
|
-
Interface describing an attestation proof.
|
4
|
-
|
5
|
-
## Properties
|
6
|
-
|
7
|
-
### type
|
8
|
-
|
9
|
-
> **type**: `string`
|
10
|
-
|
11
|
-
The type of the proof.
|
12
|
-
|
13
|
-
***
|
14
|
-
|
15
|
-
### value
|
16
|
-
|
17
|
-
> **value**: `string`
|
18
|
-
|
19
|
-
The value of the proof.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# Interface: IAttestationTransferResponse
|
2
|
-
|
3
|
-
The response to transferring the attestation.
|
4
|
-
|
5
|
-
## Properties
|
6
|
-
|
7
|
-
### body
|
8
|
-
|
9
|
-
> **body**: `object`
|
10
|
-
|
11
|
-
The data returned from the transfer response.
|
12
|
-
|
13
|
-
#### information
|
14
|
-
|
15
|
-
> **information**: [`IAttestationInformation`](IAttestationInformation.md)\<`unknown`\>
|
16
|
-
|
17
|
-
The updated attestation information.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# Interface: IAttestationVerifyRequest
|
2
|
-
|
3
|
-
Verify that the proof is valid for the attestation.
|
4
|
-
|
5
|
-
## Properties
|
6
|
-
|
7
|
-
### pathParams
|
8
|
-
|
9
|
-
> **pathParams**: `object`
|
10
|
-
|
11
|
-
The parameters to be used in the verification.
|
12
|
-
|
13
|
-
#### id
|
14
|
-
|
15
|
-
> **id**: `string`
|
16
|
-
|
17
|
-
The attestation id to verify.
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Interface: IAttestationVerifyResponse
|
2
|
-
|
3
|
-
The response to verifying the attestation.
|
4
|
-
|
5
|
-
## Properties
|
6
|
-
|
7
|
-
### body
|
8
|
-
|
9
|
-
> **body**: `object`
|
10
|
-
|
11
|
-
The data returned from the verification response.
|
12
|
-
|
13
|
-
#### verified
|
14
|
-
|
15
|
-
> **verified**: `boolean`
|
16
|
-
|
17
|
-
Whether the attestation is verified.
|
18
|
-
|
19
|
-
#### failure?
|
20
|
-
|
21
|
-
> `optional` **failure**: `string`
|
22
|
-
|
23
|
-
The failure message if the attestation is not verified.
|
24
|
-
|
25
|
-
#### information?
|
26
|
-
|
27
|
-
> `optional` **information**: `Partial`\<[`IAttestationInformation`](IAttestationInformation.md)\<`unknown`\>\>
|
28
|
-
|
29
|
-
The attestation information.
|