@twin.org/immutable-proof-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 +55 -18
- package/dist/esm/index.mjs +54 -19
- package/dist/types/index.d.ts +4 -1
- package/dist/types/models/IImmutableProof.d.ts +21 -3
- package/dist/types/models/IImmutableProofComponent.d.ts +9 -10
- package/dist/types/models/IImmutableProofVerification.d.ts +2 -1
- package/dist/types/models/api/IImmutableProofCreateRequest.d.ts +2 -2
- package/dist/types/models/api/IImmutableProofVerifyRequest.d.ts +0 -10
- package/dist/types/models/eventBus/IImmutableProofEventBusProofCreated.d.ts +9 -0
- package/dist/types/models/immutableProofContexts.d.ts +17 -0
- package/dist/types/models/immutableProofFailure.d.ts +1 -1
- package/dist/types/models/immutableProofTopics.d.ts +13 -0
- package/dist/types/models/immutableProofTypes.d.ts +0 -4
- package/docs/changelog.md +1 -1
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IImmutableProof.md +26 -2
- package/docs/reference/interfaces/IImmutableProofComponent.md +31 -21
- package/docs/reference/interfaces/IImmutableProofCreateRequest.md +3 -3
- package/docs/reference/interfaces/IImmutableProofEventBusProofCreated.md +11 -0
- package/docs/reference/interfaces/IImmutableProofVerifyRequest.md +0 -14
- package/docs/reference/type-aliases/ImmutableProofContexts.md +5 -0
- package/docs/reference/type-aliases/ImmutableProofTopics.md +5 -0
- package/docs/reference/variables/ImmutableProofContexts.md +19 -0
- package/docs/reference/variables/ImmutableProofFailure.md +1 -1
- package/docs/reference/variables/ImmutableProofTopics.md +13 -0
- package/docs/reference/variables/ImmutableProofTypes.md +0 -6
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -9,10 +9,6 @@ var dataCore = require('@twin.org/data-core');
|
|
|
9
9
|
*/
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
11
|
const ImmutableProofTypes = {
|
|
12
|
-
/**
|
|
13
|
-
* The context root for the immutable proof types.
|
|
14
|
-
*/
|
|
15
|
-
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
16
12
|
/**
|
|
17
13
|
* Represents Immutable Proof.
|
|
18
14
|
*/
|
|
@@ -26,25 +22,21 @@ const ImmutableProofTypes = {
|
|
|
26
22
|
var type = "object";
|
|
27
23
|
var properties = {
|
|
28
24
|
"@context": {
|
|
29
|
-
|
|
25
|
+
type: "array",
|
|
26
|
+
minItems: 2,
|
|
27
|
+
items: [
|
|
30
28
|
{
|
|
31
29
|
type: "string",
|
|
32
30
|
"const": "https://schema.twindev.org/immutable-proof/"
|
|
33
31
|
},
|
|
34
32
|
{
|
|
35
|
-
type: "
|
|
36
|
-
|
|
37
|
-
items: [
|
|
38
|
-
{
|
|
39
|
-
type: "string",
|
|
40
|
-
"const": "https://schema.twindev.org/immutable-proof/"
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
additionalItems: {
|
|
44
|
-
type: "string"
|
|
45
|
-
}
|
|
33
|
+
type: "string",
|
|
34
|
+
"const": "https://schema.twindev.org/common/"
|
|
46
35
|
}
|
|
47
36
|
],
|
|
37
|
+
additionalItems: {
|
|
38
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
39
|
+
},
|
|
48
40
|
description: "JSON-LD Context."
|
|
49
41
|
},
|
|
50
42
|
type: {
|
|
@@ -56,6 +48,10 @@ var properties = {
|
|
|
56
48
|
type: "string",
|
|
57
49
|
description: "The id of the proof."
|
|
58
50
|
},
|
|
51
|
+
nodeIdentity: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "The id of the node who created the proof."
|
|
54
|
+
},
|
|
59
55
|
userIdentity: {
|
|
60
56
|
type: "string",
|
|
61
57
|
description: "The id of the user who created the proof."
|
|
@@ -68,15 +64,24 @@ var properties = {
|
|
|
68
64
|
type: "string",
|
|
69
65
|
description: "The hash of the object associated with the proof."
|
|
70
66
|
},
|
|
67
|
+
verifiableStorageId: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "The verifiable storage id for where the proof is stored."
|
|
70
|
+
},
|
|
71
71
|
proof: {
|
|
72
|
-
$ref: "https://schema.twindev.org/did/
|
|
72
|
+
$ref: "https://schema.twindev.org/did/DataIntegrityProof",
|
|
73
73
|
description: "The proof which can be undefined if it has not yet been issued."
|
|
74
|
+
},
|
|
75
|
+
immutableReceipt: {
|
|
76
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
77
|
+
description: "The immutable receipt detail for where the proof is stored."
|
|
74
78
|
}
|
|
75
79
|
};
|
|
76
80
|
var required = [
|
|
77
81
|
"@context",
|
|
78
82
|
"type",
|
|
79
83
|
"id",
|
|
84
|
+
"nodeIdentity",
|
|
80
85
|
"userIdentity",
|
|
81
86
|
"proofObjectHash"
|
|
82
87
|
];
|
|
@@ -108,6 +113,23 @@ class ImmutableProofDataTypes {
|
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
|
|
116
|
+
// Copyright 2024 IOTA Stiftung.
|
|
117
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
118
|
+
/**
|
|
119
|
+
* The contexts of immutable proof data.
|
|
120
|
+
*/
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
122
|
+
const ImmutableProofContexts = {
|
|
123
|
+
/**
|
|
124
|
+
* The context root for the immutable proof types.
|
|
125
|
+
*/
|
|
126
|
+
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
127
|
+
/**
|
|
128
|
+
* The context root for the common types.
|
|
129
|
+
*/
|
|
130
|
+
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
131
|
+
};
|
|
132
|
+
|
|
111
133
|
// Copyright 2024 IOTA Stiftung.
|
|
112
134
|
// SPDX-License-Identifier: Apache-2.0.
|
|
113
135
|
/**
|
|
@@ -116,7 +138,7 @@ class ImmutableProofDataTypes {
|
|
|
116
138
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
117
139
|
const ImmutableProofFailure = {
|
|
118
140
|
/**
|
|
119
|
-
* Proof not
|
|
141
|
+
* Proof not yet issued.
|
|
120
142
|
*/
|
|
121
143
|
NotIssued: "notIssued",
|
|
122
144
|
/**
|
|
@@ -137,6 +159,21 @@ const ImmutableProofFailure = {
|
|
|
137
159
|
SignatureMismatch: "signatureMismatch"
|
|
138
160
|
};
|
|
139
161
|
|
|
162
|
+
// Copyright 2024 IOTA Stiftung.
|
|
163
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
164
|
+
/**
|
|
165
|
+
* The topics for immutable proof event bus notifications.
|
|
166
|
+
*/
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
168
|
+
const ImmutableProofTopics = {
|
|
169
|
+
/**
|
|
170
|
+
* A proof was created.
|
|
171
|
+
*/
|
|
172
|
+
ProofCreated: "immutable-proof:proof-created"
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
exports.ImmutableProofContexts = ImmutableProofContexts;
|
|
140
176
|
exports.ImmutableProofDataTypes = ImmutableProofDataTypes;
|
|
141
177
|
exports.ImmutableProofFailure = ImmutableProofFailure;
|
|
178
|
+
exports.ImmutableProofTopics = ImmutableProofTopics;
|
|
142
179
|
exports.ImmutableProofTypes = ImmutableProofTypes;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -7,10 +7,6 @@ import { DataTypeHandlerFactory } from '@twin.org/data-core';
|
|
|
7
7
|
*/
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
9
|
const ImmutableProofTypes = {
|
|
10
|
-
/**
|
|
11
|
-
* The context root for the immutable proof types.
|
|
12
|
-
*/
|
|
13
|
-
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
14
10
|
/**
|
|
15
11
|
* Represents Immutable Proof.
|
|
16
12
|
*/
|
|
@@ -24,25 +20,21 @@ const ImmutableProofTypes = {
|
|
|
24
20
|
var type = "object";
|
|
25
21
|
var properties = {
|
|
26
22
|
"@context": {
|
|
27
|
-
|
|
23
|
+
type: "array",
|
|
24
|
+
minItems: 2,
|
|
25
|
+
items: [
|
|
28
26
|
{
|
|
29
27
|
type: "string",
|
|
30
28
|
"const": "https://schema.twindev.org/immutable-proof/"
|
|
31
29
|
},
|
|
32
30
|
{
|
|
33
|
-
type: "
|
|
34
|
-
|
|
35
|
-
items: [
|
|
36
|
-
{
|
|
37
|
-
type: "string",
|
|
38
|
-
"const": "https://schema.twindev.org/immutable-proof/"
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
additionalItems: {
|
|
42
|
-
type: "string"
|
|
43
|
-
}
|
|
31
|
+
type: "string",
|
|
32
|
+
"const": "https://schema.twindev.org/common/"
|
|
44
33
|
}
|
|
45
34
|
],
|
|
35
|
+
additionalItems: {
|
|
36
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
37
|
+
},
|
|
46
38
|
description: "JSON-LD Context."
|
|
47
39
|
},
|
|
48
40
|
type: {
|
|
@@ -54,6 +46,10 @@ var properties = {
|
|
|
54
46
|
type: "string",
|
|
55
47
|
description: "The id of the proof."
|
|
56
48
|
},
|
|
49
|
+
nodeIdentity: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "The id of the node who created the proof."
|
|
52
|
+
},
|
|
57
53
|
userIdentity: {
|
|
58
54
|
type: "string",
|
|
59
55
|
description: "The id of the user who created the proof."
|
|
@@ -66,15 +62,24 @@ var properties = {
|
|
|
66
62
|
type: "string",
|
|
67
63
|
description: "The hash of the object associated with the proof."
|
|
68
64
|
},
|
|
65
|
+
verifiableStorageId: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "The verifiable storage id for where the proof is stored."
|
|
68
|
+
},
|
|
69
69
|
proof: {
|
|
70
|
-
$ref: "https://schema.twindev.org/did/
|
|
70
|
+
$ref: "https://schema.twindev.org/did/DataIntegrityProof",
|
|
71
71
|
description: "The proof which can be undefined if it has not yet been issued."
|
|
72
|
+
},
|
|
73
|
+
immutableReceipt: {
|
|
74
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
75
|
+
description: "The immutable receipt detail for where the proof is stored."
|
|
72
76
|
}
|
|
73
77
|
};
|
|
74
78
|
var required = [
|
|
75
79
|
"@context",
|
|
76
80
|
"type",
|
|
77
81
|
"id",
|
|
82
|
+
"nodeIdentity",
|
|
78
83
|
"userIdentity",
|
|
79
84
|
"proofObjectHash"
|
|
80
85
|
];
|
|
@@ -106,6 +111,23 @@ class ImmutableProofDataTypes {
|
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
|
|
114
|
+
// Copyright 2024 IOTA Stiftung.
|
|
115
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
116
|
+
/**
|
|
117
|
+
* The contexts of immutable proof data.
|
|
118
|
+
*/
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
120
|
+
const ImmutableProofContexts = {
|
|
121
|
+
/**
|
|
122
|
+
* The context root for the immutable proof types.
|
|
123
|
+
*/
|
|
124
|
+
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
125
|
+
/**
|
|
126
|
+
* The context root for the common types.
|
|
127
|
+
*/
|
|
128
|
+
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
129
|
+
};
|
|
130
|
+
|
|
109
131
|
// Copyright 2024 IOTA Stiftung.
|
|
110
132
|
// SPDX-License-Identifier: Apache-2.0.
|
|
111
133
|
/**
|
|
@@ -114,7 +136,7 @@ class ImmutableProofDataTypes {
|
|
|
114
136
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
115
137
|
const ImmutableProofFailure = {
|
|
116
138
|
/**
|
|
117
|
-
* Proof not
|
|
139
|
+
* Proof not yet issued.
|
|
118
140
|
*/
|
|
119
141
|
NotIssued: "notIssued",
|
|
120
142
|
/**
|
|
@@ -135,4 +157,17 @@ const ImmutableProofFailure = {
|
|
|
135
157
|
SignatureMismatch: "signatureMismatch"
|
|
136
158
|
};
|
|
137
159
|
|
|
138
|
-
|
|
160
|
+
// Copyright 2024 IOTA Stiftung.
|
|
161
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
162
|
+
/**
|
|
163
|
+
* The topics for immutable proof event bus notifications.
|
|
164
|
+
*/
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
166
|
+
const ImmutableProofTopics = {
|
|
167
|
+
/**
|
|
168
|
+
* A proof was created.
|
|
169
|
+
*/
|
|
170
|
+
ProofCreated: "immutable-proof:proof-created"
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export { ImmutableProofContexts, ImmutableProofDataTypes, ImmutableProofFailure, ImmutableProofTopics, ImmutableProofTypes };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,8 +4,11 @@ export * from "./models/api/IImmutableProofGetRequest";
|
|
|
4
4
|
export * from "./models/api/IImmutableProofGetResponse";
|
|
5
5
|
export * from "./models/api/IImmutableProofVerifyRequest";
|
|
6
6
|
export * from "./models/api/IImmutableProofVerifyResponse";
|
|
7
|
+
export * from "./models/eventBus/IImmutableProofEventBusProofCreated";
|
|
7
8
|
export * from "./models/IImmutableProof";
|
|
8
|
-
export * from "./models/IImmutableProofVerification";
|
|
9
9
|
export * from "./models/IImmutableProofComponent";
|
|
10
|
+
export * from "./models/IImmutableProofVerification";
|
|
11
|
+
export * from "./models/immutableProofContexts";
|
|
10
12
|
export * from "./models/immutableProofFailure";
|
|
13
|
+
export * from "./models/immutableProofTopics";
|
|
11
14
|
export * from "./models/immutableProofTypes";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { IDataIntegrityProof } from "@twin.org/standards-w3c-did";
|
|
3
|
+
import type { ImmutableProofContexts } from "./immutableProofContexts";
|
|
2
4
|
import type { ImmutableProofTypes } from "./immutableProofTypes";
|
|
3
5
|
/**
|
|
4
6
|
* Interface describing an immutable proof state.
|
|
@@ -7,7 +9,11 @@ export interface IImmutableProof {
|
|
|
7
9
|
/**
|
|
8
10
|
* JSON-LD Context.
|
|
9
11
|
*/
|
|
10
|
-
"@context":
|
|
12
|
+
"@context": [
|
|
13
|
+
typeof ImmutableProofContexts.ContextRoot,
|
|
14
|
+
typeof ImmutableProofContexts.ContextRootCommon,
|
|
15
|
+
...IJsonLdContextDefinitionElement[]
|
|
16
|
+
];
|
|
11
17
|
/**
|
|
12
18
|
* JSON-LD Type.
|
|
13
19
|
*/
|
|
@@ -16,6 +22,10 @@ export interface IImmutableProof {
|
|
|
16
22
|
* The id of the proof.
|
|
17
23
|
*/
|
|
18
24
|
id: string;
|
|
25
|
+
/**
|
|
26
|
+
* The id of the node who created the proof.
|
|
27
|
+
*/
|
|
28
|
+
nodeIdentity: string;
|
|
19
29
|
/**
|
|
20
30
|
* The id of the user who created the proof.
|
|
21
31
|
*/
|
|
@@ -28,8 +38,16 @@ export interface IImmutableProof {
|
|
|
28
38
|
* The hash of the object associated with the proof.
|
|
29
39
|
*/
|
|
30
40
|
proofObjectHash: string;
|
|
41
|
+
/**
|
|
42
|
+
* The verifiable storage id for where the proof is stored.
|
|
43
|
+
*/
|
|
44
|
+
verifiableStorageId?: string;
|
|
31
45
|
/**
|
|
32
46
|
* The proof which can be undefined if it has not yet been issued.
|
|
33
47
|
*/
|
|
34
|
-
proof?:
|
|
48
|
+
proof?: IDataIntegrityProof;
|
|
49
|
+
/**
|
|
50
|
+
* The immutable receipt detail for where the proof is stored.
|
|
51
|
+
*/
|
|
52
|
+
immutableReceipt?: IJsonLdNodeObject;
|
|
35
53
|
}
|
|
@@ -7,34 +7,33 @@ 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
|
-
* @param proofObject The object to verify as JSON-LD.
|
|
28
27
|
* @returns The result of the verification and any failures.
|
|
29
28
|
* @throws NotFoundError if the proof is not found.
|
|
30
29
|
*/
|
|
31
|
-
verify(id: string
|
|
30
|
+
verify(id: string): Promise<IImmutableProofVerification>;
|
|
32
31
|
/**
|
|
33
|
-
* Remove the
|
|
32
|
+
* Remove the verifiable storage for the proof.
|
|
34
33
|
* @param id The id of the proof to remove the storage from.
|
|
35
34
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
36
35
|
* @returns Nothing.
|
|
37
36
|
* @throws NotFoundError if the proof is not found.
|
|
38
37
|
*/
|
|
39
|
-
|
|
38
|
+
removeVerifiable(id: string, nodeIdentity?: string): Promise<void>;
|
|
40
39
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ImmutableProofContexts } from "./immutableProofContexts";
|
|
1
2
|
import type { ImmutableProofFailure } from "./immutableProofFailure";
|
|
2
3
|
import type { ImmutableProofTypes } from "./immutableProofTypes";
|
|
3
4
|
/**
|
|
@@ -7,7 +8,7 @@ export interface IImmutableProofVerification {
|
|
|
7
8
|
/**
|
|
8
9
|
* JSON-LD Context.
|
|
9
10
|
*/
|
|
10
|
-
"@context": typeof
|
|
11
|
+
"@context": typeof ImmutableProofContexts.ContextRoot;
|
|
11
12
|
/**
|
|
12
13
|
* JSON-LD Type.
|
|
13
14
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
1
|
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
3
2
|
/**
|
|
4
3
|
* Verify a proof.
|
|
@@ -19,13 +18,4 @@ export interface IImmutableProofVerifyRequest {
|
|
|
19
18
|
*/
|
|
20
19
|
id: string;
|
|
21
20
|
};
|
|
22
|
-
/**
|
|
23
|
-
* The parameters from the body.
|
|
24
|
-
*/
|
|
25
|
-
body: {
|
|
26
|
-
/**
|
|
27
|
-
* The proof object to verify.
|
|
28
|
-
*/
|
|
29
|
-
proofObject: IJsonLdNodeObject;
|
|
30
|
-
};
|
|
31
21
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts of immutable proof data.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ImmutableProofContexts: {
|
|
5
|
+
/**
|
|
6
|
+
* The context root for the immutable proof types.
|
|
7
|
+
*/
|
|
8
|
+
readonly ContextRoot: "https://schema.twindev.org/immutable-proof/";
|
|
9
|
+
/**
|
|
10
|
+
* The context root for the common types.
|
|
11
|
+
*/
|
|
12
|
+
readonly ContextRootCommon: "https://schema.twindev.org/common/";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The contexts of immutable proof data.
|
|
16
|
+
*/
|
|
17
|
+
export type ImmutableProofContexts = (typeof ImmutableProofContexts)[keyof typeof ImmutableProofContexts];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The topics for immutable proof event bus notifications.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ImmutableProofTopics: {
|
|
5
|
+
/**
|
|
6
|
+
* A proof was created.
|
|
7
|
+
*/
|
|
8
|
+
readonly ProofCreated: "immutable-proof:proof-created";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The topics for immutable proof event bus notifications.
|
|
12
|
+
*/
|
|
13
|
+
export type ImmutableProofTopics = (typeof ImmutableProofTopics)[keyof typeof ImmutableProofTopics];
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
* The types of immutable proof data.
|
|
3
3
|
*/
|
|
4
4
|
export declare const ImmutableProofTypes: {
|
|
5
|
-
/**
|
|
6
|
-
* The context root for the immutable proof types.
|
|
7
|
-
*/
|
|
8
|
-
readonly ContextRoot: "https://schema.twindev.org/immutable-proof/";
|
|
9
5
|
/**
|
|
10
6
|
* Represents Immutable Proof.
|
|
11
7
|
*/
|
package/docs/changelog.md
CHANGED
package/docs/reference/index.md
CHANGED
|
@@ -14,13 +14,18 @@
|
|
|
14
14
|
- [IImmutableProofGetResponse](interfaces/IImmutableProofGetResponse.md)
|
|
15
15
|
- [IImmutableProofVerifyRequest](interfaces/IImmutableProofVerifyRequest.md)
|
|
16
16
|
- [IImmutableProofVerifyResponse](interfaces/IImmutableProofVerifyResponse.md)
|
|
17
|
+
- [IImmutableProofEventBusProofCreated](interfaces/IImmutableProofEventBusProofCreated.md)
|
|
17
18
|
|
|
18
19
|
## Type Aliases
|
|
19
20
|
|
|
21
|
+
- [ImmutableProofContexts](type-aliases/ImmutableProofContexts.md)
|
|
20
22
|
- [ImmutableProofFailure](type-aliases/ImmutableProofFailure.md)
|
|
23
|
+
- [ImmutableProofTopics](type-aliases/ImmutableProofTopics.md)
|
|
21
24
|
- [ImmutableProofTypes](type-aliases/ImmutableProofTypes.md)
|
|
22
25
|
|
|
23
26
|
## Variables
|
|
24
27
|
|
|
28
|
+
- [ImmutableProofContexts](variables/ImmutableProofContexts.md)
|
|
25
29
|
- [ImmutableProofFailure](variables/ImmutableProofFailure.md)
|
|
30
|
+
- [ImmutableProofTopics](variables/ImmutableProofTopics.md)
|
|
26
31
|
- [ImmutableProofTypes](variables/ImmutableProofTypes.md)
|
|
@@ -6,7 +6,7 @@ Interface describing an immutable proof state.
|
|
|
6
6
|
|
|
7
7
|
### @context
|
|
8
8
|
|
|
9
|
-
> **@context**: `"https://schema.twindev.org/immutable-proof/"
|
|
9
|
+
> **@context**: \[`"https://schema.twindev.org/immutable-proof/"`, `"https://schema.twindev.org/common/"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
10
10
|
|
|
11
11
|
JSON-LD Context.
|
|
12
12
|
|
|
@@ -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`
|
|
@@ -52,8 +60,24 @@ The hash of the object associated with the proof.
|
|
|
52
60
|
|
|
53
61
|
***
|
|
54
62
|
|
|
63
|
+
### verifiableStorageId?
|
|
64
|
+
|
|
65
|
+
> `optional` **verifiableStorageId**: `string`
|
|
66
|
+
|
|
67
|
+
The verifiable storage id for where the proof is stored.
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
55
71
|
### proof?
|
|
56
72
|
|
|
57
|
-
> `optional` **proof**: `
|
|
73
|
+
> `optional` **proof**: `IDataIntegrityProof`
|
|
58
74
|
|
|
59
75
|
The proof which can be undefined if it has not yet been issued.
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### immutableReceipt?
|
|
80
|
+
|
|
81
|
+
> `optional` **immutableReceipt**: `IJsonLdNodeObject`
|
|
82
|
+
|
|
83
|
+
The immutable receipt detail for where the proof is stored.
|
|
@@ -10,21 +10,27 @@ 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
|
-
|
|
23
|
+
The document to create the proof for.
|
|
24
|
+
|
|
25
|
+
##### userIdentity?
|
|
26
|
+
|
|
27
|
+
`string`
|
|
24
28
|
|
|
25
29
|
The identity to create the immutable proof operation with.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
##### nodeIdentity?
|
|
32
|
+
|
|
33
|
+
`string`
|
|
28
34
|
|
|
29
35
|
The node identity to use for vault operations.
|
|
30
36
|
|
|
@@ -32,7 +38,7 @@ The node identity to use for vault operations.
|
|
|
32
38
|
|
|
33
39
|
`Promise`\<`string`\>
|
|
34
40
|
|
|
35
|
-
The id of the new
|
|
41
|
+
The id of the new proof.
|
|
36
42
|
|
|
37
43
|
***
|
|
38
44
|
|
|
@@ -40,11 +46,13 @@ The id of the new authentication proof.
|
|
|
40
46
|
|
|
41
47
|
> **get**(`id`): `Promise`\<[`IImmutableProof`](IImmutableProof.md)\>
|
|
42
48
|
|
|
43
|
-
Get
|
|
49
|
+
Get a proof.
|
|
44
50
|
|
|
45
51
|
#### Parameters
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
##### id
|
|
54
|
+
|
|
55
|
+
`string`
|
|
48
56
|
|
|
49
57
|
The id of the proof to get.
|
|
50
58
|
|
|
@@ -62,19 +70,17 @@ NotFoundError if the proof is not found.
|
|
|
62
70
|
|
|
63
71
|
### verify()
|
|
64
72
|
|
|
65
|
-
> **verify**(`id
|
|
73
|
+
> **verify**(`id`): `Promise`\<[`IImmutableProofVerification`](IImmutableProofVerification.md)\>
|
|
66
74
|
|
|
67
|
-
Verify
|
|
75
|
+
Verify a proof.
|
|
68
76
|
|
|
69
77
|
#### Parameters
|
|
70
78
|
|
|
71
|
-
|
|
79
|
+
##### id
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
`string`
|
|
74
82
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
The object to verify as JSON-LD.
|
|
83
|
+
The id of the proof to verify.
|
|
78
84
|
|
|
79
85
|
#### Returns
|
|
80
86
|
|
|
@@ -88,19 +94,23 @@ NotFoundError if the proof is not found.
|
|
|
88
94
|
|
|
89
95
|
***
|
|
90
96
|
|
|
91
|
-
###
|
|
97
|
+
### removeVerifiable()
|
|
92
98
|
|
|
93
|
-
> **
|
|
99
|
+
> **removeVerifiable**(`id`, `nodeIdentity`?): `Promise`\<`void`\>
|
|
94
100
|
|
|
95
|
-
Remove the
|
|
101
|
+
Remove the verifiable storage for the proof.
|
|
96
102
|
|
|
97
103
|
#### Parameters
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
##### id
|
|
106
|
+
|
|
107
|
+
`string`
|
|
100
108
|
|
|
101
109
|
The id of the proof to remove the storage from.
|
|
102
110
|
|
|
103
|
-
|
|
111
|
+
##### nodeIdentity?
|
|
112
|
+
|
|
113
|
+
`string`
|
|
104
114
|
|
|
105
115
|
The node identity to use for vault operations.
|
|
106
116
|
|
|
@@ -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.
|
|
@@ -27,17 +27,3 @@ The parameters from the path.
|
|
|
27
27
|
> **id**: `string`
|
|
28
28
|
|
|
29
29
|
The id of the immutable proof to verify.
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
|
-
### body
|
|
34
|
-
|
|
35
|
-
> **body**: `object`
|
|
36
|
-
|
|
37
|
-
The parameters from the body.
|
|
38
|
-
|
|
39
|
-
#### proofObject
|
|
40
|
-
|
|
41
|
-
> **proofObject**: `IJsonLdNodeObject`
|
|
42
|
-
|
|
43
|
-
The proof object to verify.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: ImmutableProofContexts
|
|
2
|
+
|
|
3
|
+
> **ImmutableProofContexts**: *typeof* [`ImmutableProofContexts`](../variables/ImmutableProofContexts.md)\[keyof *typeof* [`ImmutableProofContexts`](../variables/ImmutableProofContexts.md)\]
|
|
4
|
+
|
|
5
|
+
The contexts of immutable proof data.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: ImmutableProofTopics
|
|
2
|
+
|
|
3
|
+
> **ImmutableProofTopics**: *typeof* [`ImmutableProofTopics`](../variables/ImmutableProofTopics.md)\[keyof *typeof* [`ImmutableProofTopics`](../variables/ImmutableProofTopics.md)\]
|
|
4
|
+
|
|
5
|
+
The topics for immutable proof event bus notifications.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Variable: ImmutableProofContexts
|
|
2
|
+
|
|
3
|
+
> `const` **ImmutableProofContexts**: `object`
|
|
4
|
+
|
|
5
|
+
The contexts of immutable proof data.
|
|
6
|
+
|
|
7
|
+
## Type declaration
|
|
8
|
+
|
|
9
|
+
### ContextRoot
|
|
10
|
+
|
|
11
|
+
> `readonly` **ContextRoot**: `"https://schema.twindev.org/immutable-proof/"` = `"https://schema.twindev.org/immutable-proof/"`
|
|
12
|
+
|
|
13
|
+
The context root for the immutable proof 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,13 @@
|
|
|
1
|
+
# Variable: ImmutableProofTopics
|
|
2
|
+
|
|
3
|
+
> `const` **ImmutableProofTopics**: `object`
|
|
4
|
+
|
|
5
|
+
The topics for immutable proof event bus notifications.
|
|
6
|
+
|
|
7
|
+
## Type declaration
|
|
8
|
+
|
|
9
|
+
### ProofCreated
|
|
10
|
+
|
|
11
|
+
> `readonly` **ProofCreated**: `"immutable-proof:proof-created"` = `"immutable-proof:proof-created"`
|
|
12
|
+
|
|
13
|
+
A proof was created.
|
|
@@ -6,12 +6,6 @@ The types of immutable proof data.
|
|
|
6
6
|
|
|
7
7
|
## Type declaration
|
|
8
8
|
|
|
9
|
-
### ContextRoot
|
|
10
|
-
|
|
11
|
-
> `readonly` **ContextRoot**: `"https://schema.twindev.org/immutable-proof/"` = `"https://schema.twindev.org/immutable-proof/"`
|
|
12
|
-
|
|
13
|
-
The context root for the immutable proof types.
|
|
14
|
-
|
|
15
9
|
### ImmutableProof
|
|
16
10
|
|
|
17
11
|
> `readonly` **ImmutableProof**: `"ImmutableProof"` = `"ImmutableProof"`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-models",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.30",
|
|
4
4
|
"description": "Models which define the structure of the immutable proof connectors and services",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"types": "./dist/types/index.d.ts",
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
|
+
"types": "./dist/types/index.d.ts",
|
|
30
31
|
"require": "./dist/cjs/index.cjs",
|
|
31
|
-
"import": "./dist/esm/index.mjs"
|
|
32
|
-
"types": "./dist/types/index.d.ts"
|
|
32
|
+
"import": "./dist/esm/index.mjs"
|
|
33
33
|
},
|
|
34
|
-
"./locales": "./locales"
|
|
34
|
+
"./locales/*.json": "./locales/*.json"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist/cjs",
|