@twin.org/immutable-proof-models 0.0.1-next.24 → 0.0.1-next.26
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 +7 -2
- package/dist/esm/index.mjs +7 -2
- package/dist/types/models/IImmutableProof.d.ts +6 -2
- package/dist/types/models/IImmutableProofComponent.d.ts +6 -6
- package/dist/types/models/api/IImmutableProofCreateRequest.d.ts +2 -2
- package/dist/types/models/immutableProofFailure.d.ts +1 -1
- package/docs/changelog.md +1 -1
- package/docs/reference/interfaces/IImmutableProof.md +9 -1
- package/docs/reference/interfaces/IImmutableProofComponent.md +7 -7
- package/docs/reference/interfaces/IImmutableProofCreateRequest.md +3 -3
- package/docs/reference/variables/ImmutableProofFailure.md +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -56,6 +56,10 @@ var properties = {
|
|
|
56
56
|
type: "string",
|
|
57
57
|
description: "The id of the proof."
|
|
58
58
|
},
|
|
59
|
+
nodeIdentity: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "The id of the node who created the proof."
|
|
62
|
+
},
|
|
59
63
|
userIdentity: {
|
|
60
64
|
type: "string",
|
|
61
65
|
description: "The id of the user who created the proof."
|
|
@@ -69,7 +73,7 @@ var properties = {
|
|
|
69
73
|
description: "The hash of the object associated with the proof."
|
|
70
74
|
},
|
|
71
75
|
proof: {
|
|
72
|
-
$ref: "https://schema.twindev.org/did/
|
|
76
|
+
$ref: "https://schema.twindev.org/did/DataIntegrityProof",
|
|
73
77
|
description: "The proof which can be undefined if it has not yet been issued."
|
|
74
78
|
},
|
|
75
79
|
immutableReceipt: {
|
|
@@ -81,6 +85,7 @@ var required = [
|
|
|
81
85
|
"@context",
|
|
82
86
|
"type",
|
|
83
87
|
"id",
|
|
88
|
+
"nodeIdentity",
|
|
84
89
|
"userIdentity",
|
|
85
90
|
"proofObjectHash"
|
|
86
91
|
];
|
|
@@ -120,7 +125,7 @@ class ImmutableProofDataTypes {
|
|
|
120
125
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
121
126
|
const ImmutableProofFailure = {
|
|
122
127
|
/**
|
|
123
|
-
* Proof not
|
|
128
|
+
* Proof not yet issued.
|
|
124
129
|
*/
|
|
125
130
|
NotIssued: "notIssued",
|
|
126
131
|
/**
|
package/dist/esm/index.mjs
CHANGED
|
@@ -54,6 +54,10 @@ var properties = {
|
|
|
54
54
|
type: "string",
|
|
55
55
|
description: "The id of the proof."
|
|
56
56
|
},
|
|
57
|
+
nodeIdentity: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "The id of the node who created the proof."
|
|
60
|
+
},
|
|
57
61
|
userIdentity: {
|
|
58
62
|
type: "string",
|
|
59
63
|
description: "The id of the user who created the proof."
|
|
@@ -67,7 +71,7 @@ var properties = {
|
|
|
67
71
|
description: "The hash of the object associated with the proof."
|
|
68
72
|
},
|
|
69
73
|
proof: {
|
|
70
|
-
$ref: "https://schema.twindev.org/did/
|
|
74
|
+
$ref: "https://schema.twindev.org/did/DataIntegrityProof",
|
|
71
75
|
description: "The proof which can be undefined if it has not yet been issued."
|
|
72
76
|
},
|
|
73
77
|
immutableReceipt: {
|
|
@@ -79,6 +83,7 @@ var required = [
|
|
|
79
83
|
"@context",
|
|
80
84
|
"type",
|
|
81
85
|
"id",
|
|
86
|
+
"nodeIdentity",
|
|
82
87
|
"userIdentity",
|
|
83
88
|
"proofObjectHash"
|
|
84
89
|
];
|
|
@@ -118,7 +123,7 @@ class ImmutableProofDataTypes {
|
|
|
118
123
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
119
124
|
const ImmutableProofFailure = {
|
|
120
125
|
/**
|
|
121
|
-
* Proof not
|
|
126
|
+
* Proof not yet issued.
|
|
122
127
|
*/
|
|
123
128
|
NotIssued: "notIssued",
|
|
124
129
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IDataIntegrityProof } from "@twin.org/standards-w3c-did";
|
|
3
3
|
import type { ImmutableProofTypes } from "./immutableProofTypes";
|
|
4
4
|
/**
|
|
5
5
|
* Interface describing an immutable proof state.
|
|
@@ -21,6 +21,10 @@ export interface IImmutableProof {
|
|
|
21
21
|
* The id of the proof.
|
|
22
22
|
*/
|
|
23
23
|
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* The id of the node who created the proof.
|
|
26
|
+
*/
|
|
27
|
+
nodeIdentity: string;
|
|
24
28
|
/**
|
|
25
29
|
* The id of the user who created the proof.
|
|
26
30
|
*/
|
|
@@ -36,7 +40,7 @@ export interface IImmutableProof {
|
|
|
36
40
|
/**
|
|
37
41
|
* The proof which can be undefined if it has not yet been issued.
|
|
38
42
|
*/
|
|
39
|
-
proof?:
|
|
43
|
+
proof?: IDataIntegrityProof;
|
|
40
44
|
/**
|
|
41
45
|
* The immutable receipt detail for where the proof is stored.
|
|
42
46
|
*/
|
|
@@ -7,22 +7,22 @@ import type { IImmutableProofVerification } from "./IImmutableProofVerification"
|
|
|
7
7
|
*/
|
|
8
8
|
export interface IImmutableProofComponent extends IComponent {
|
|
9
9
|
/**
|
|
10
|
-
* Create a new
|
|
11
|
-
* @param
|
|
10
|
+
* Create a new proof.
|
|
11
|
+
* @param document The document to create the proof for.
|
|
12
12
|
* @param userIdentity The identity to create the immutable proof operation with.
|
|
13
13
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
14
|
-
* @returns The id of the new
|
|
14
|
+
* @returns The id of the new proof.
|
|
15
15
|
*/
|
|
16
|
-
create(
|
|
16
|
+
create(document: IJsonLdNodeObject, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
17
17
|
/**
|
|
18
|
-
* Get
|
|
18
|
+
* Get a proof.
|
|
19
19
|
* @param id The id of the proof to get.
|
|
20
20
|
* @returns The proof.
|
|
21
21
|
* @throws NotFoundError if the proof is not found.
|
|
22
22
|
*/
|
|
23
23
|
get(id: string): Promise<IImmutableProof>;
|
|
24
24
|
/**
|
|
25
|
-
* Verify
|
|
25
|
+
* Verify a proof.
|
|
26
26
|
* @param id The id of the proof to verify.
|
|
27
27
|
* @returns The result of the verification and any failures.
|
|
28
28
|
* @throws NotFoundError if the proof is not found.
|
package/docs/changelog.md
CHANGED
|
@@ -28,6 +28,14 @@ The id of the proof.
|
|
|
28
28
|
|
|
29
29
|
***
|
|
30
30
|
|
|
31
|
+
### nodeIdentity
|
|
32
|
+
|
|
33
|
+
> **nodeIdentity**: `string`
|
|
34
|
+
|
|
35
|
+
The id of the node who created the proof.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
31
39
|
### userIdentity
|
|
32
40
|
|
|
33
41
|
> **userIdentity**: `string`
|
|
@@ -54,7 +62,7 @@ The hash of the object associated with the proof.
|
|
|
54
62
|
|
|
55
63
|
### proof?
|
|
56
64
|
|
|
57
|
-
> `optional` **proof**: `
|
|
65
|
+
> `optional` **proof**: `IDataIntegrityProof`
|
|
58
66
|
|
|
59
67
|
The proof which can be undefined if it has not yet been issued.
|
|
60
68
|
|
|
@@ -10,17 +10,17 @@ Interface describing an immutable proof contract.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`
|
|
13
|
+
> **create**(`document`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
|
-
Create a new
|
|
15
|
+
Create a new proof.
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
#####
|
|
19
|
+
##### document
|
|
20
20
|
|
|
21
21
|
`IJsonLdNodeObject`
|
|
22
22
|
|
|
23
|
-
The
|
|
23
|
+
The document to create the proof for.
|
|
24
24
|
|
|
25
25
|
##### userIdentity?
|
|
26
26
|
|
|
@@ -38,7 +38,7 @@ The node identity to use for vault operations.
|
|
|
38
38
|
|
|
39
39
|
`Promise`\<`string`\>
|
|
40
40
|
|
|
41
|
-
The id of the new
|
|
41
|
+
The id of the new proof.
|
|
42
42
|
|
|
43
43
|
***
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ The id of the new authentication proof.
|
|
|
46
46
|
|
|
47
47
|
> **get**(`id`): `Promise`\<[`IImmutableProof`](IImmutableProof.md)\>
|
|
48
48
|
|
|
49
|
-
Get
|
|
49
|
+
Get a proof.
|
|
50
50
|
|
|
51
51
|
#### Parameters
|
|
52
52
|
|
|
@@ -72,7 +72,7 @@ NotFoundError if the proof is not found.
|
|
|
72
72
|
|
|
73
73
|
> **verify**(`id`): `Promise`\<[`IImmutableProofVerification`](IImmutableProofVerification.md)\>
|
|
74
74
|
|
|
75
|
-
Verify
|
|
75
|
+
Verify a proof.
|
|
76
76
|
|
|
77
77
|
#### Parameters
|
|
78
78
|
|
|
@@ -10,8 +10,8 @@ Create a proof.
|
|
|
10
10
|
|
|
11
11
|
The parameters from the body.
|
|
12
12
|
|
|
13
|
-
####
|
|
13
|
+
#### document
|
|
14
14
|
|
|
15
|
-
> **
|
|
15
|
+
> **document**: `IJsonLdNodeObject`
|
|
16
16
|
|
|
17
|
-
The
|
|
17
|
+
The document to create the proof for.
|
package/package.json
CHANGED