@twin.org/immutable-proof-models 0.0.1-next.2 → 0.0.1-next.20
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 +19 -1
- package/dist/esm/index.mjs +19 -2
- package/dist/types/index.d.ts +3 -1
- package/dist/types/models/IImmutableProof.d.ts +6 -1
- package/dist/types/models/IImmutableProofComponent.d.ts +1 -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/immutableProofTopics.d.ts +13 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/index.md +3 -0
- package/docs/reference/interfaces/IImmutableProof.md +9 -1
- package/docs/reference/interfaces/IImmutableProofComponent.md +22 -12
- package/docs/reference/interfaces/IImmutableProofEventBusProofCreated.md +11 -0
- package/docs/reference/interfaces/IImmutableProofVerifyRequest.md +0 -14
- package/docs/reference/type-aliases/ImmutableProofTopics.md +5 -0
- package/docs/reference/variables/ImmutableProofTopics.md +13 -0
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ var properties = {
|
|
|
41
41
|
}
|
|
42
42
|
],
|
|
43
43
|
additionalItems: {
|
|
44
|
-
|
|
44
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
],
|
|
@@ -71,6 +71,10 @@ var properties = {
|
|
|
71
71
|
proof: {
|
|
72
72
|
$ref: "https://schema.twindev.org/did/DidProof",
|
|
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 = [
|
|
@@ -137,6 +141,20 @@ const ImmutableProofFailure = {
|
|
|
137
141
|
SignatureMismatch: "signatureMismatch"
|
|
138
142
|
};
|
|
139
143
|
|
|
144
|
+
// Copyright 2024 IOTA Stiftung.
|
|
145
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
146
|
+
/**
|
|
147
|
+
* The topics for immutable proof event bus notifications.
|
|
148
|
+
*/
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
150
|
+
const ImmutableProofTopics = {
|
|
151
|
+
/**
|
|
152
|
+
* A proof was created.
|
|
153
|
+
*/
|
|
154
|
+
ProofCreated: "immutable-proof:proof-created"
|
|
155
|
+
};
|
|
156
|
+
|
|
140
157
|
exports.ImmutableProofDataTypes = ImmutableProofDataTypes;
|
|
141
158
|
exports.ImmutableProofFailure = ImmutableProofFailure;
|
|
159
|
+
exports.ImmutableProofTopics = ImmutableProofTopics;
|
|
142
160
|
exports.ImmutableProofTypes = ImmutableProofTypes;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ var properties = {
|
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
additionalItems: {
|
|
42
|
-
|
|
42
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
],
|
|
@@ -69,6 +69,10 @@ var properties = {
|
|
|
69
69
|
proof: {
|
|
70
70
|
$ref: "https://schema.twindev.org/did/DidProof",
|
|
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 = [
|
|
@@ -135,4 +139,17 @@ const ImmutableProofFailure = {
|
|
|
135
139
|
SignatureMismatch: "signatureMismatch"
|
|
136
140
|
};
|
|
137
141
|
|
|
138
|
-
|
|
142
|
+
// Copyright 2024 IOTA Stiftung.
|
|
143
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
144
|
+
/**
|
|
145
|
+
* The topics for immutable proof event bus notifications.
|
|
146
|
+
*/
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
148
|
+
const ImmutableProofTopics = {
|
|
149
|
+
/**
|
|
150
|
+
* A proof was created.
|
|
151
|
+
*/
|
|
152
|
+
ProofCreated: "immutable-proof:proof-created"
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export { ImmutableProofDataTypes, ImmutableProofFailure, ImmutableProofTopics, ImmutableProofTypes };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ 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";
|
|
10
11
|
export * from "./models/immutableProofFailure";
|
|
12
|
+
export * from "./models/immutableProofTopics";
|
|
11
13
|
export * from "./models/immutableProofTypes";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
1
2
|
import type { IDidProof } from "@twin.org/standards-w3c-did";
|
|
2
3
|
import type { ImmutableProofTypes } from "./immutableProofTypes";
|
|
3
4
|
/**
|
|
@@ -7,7 +8,7 @@ export interface IImmutableProof {
|
|
|
7
8
|
/**
|
|
8
9
|
* JSON-LD Context.
|
|
9
10
|
*/
|
|
10
|
-
"@context": typeof ImmutableProofTypes.ContextRoot | [typeof ImmutableProofTypes.ContextRoot, ...
|
|
11
|
+
"@context": typeof ImmutableProofTypes.ContextRoot | [typeof ImmutableProofTypes.ContextRoot, ...IJsonLdContextDefinitionElement[]];
|
|
11
12
|
/**
|
|
12
13
|
* JSON-LD Type.
|
|
13
14
|
*/
|
|
@@ -32,4 +33,8 @@ export interface IImmutableProof {
|
|
|
32
33
|
* The proof which can be undefined if it has not yet been issued.
|
|
33
34
|
*/
|
|
34
35
|
proof?: IDidProof;
|
|
36
|
+
/**
|
|
37
|
+
* The immutable receipt detail for where the proof is stored.
|
|
38
|
+
*/
|
|
39
|
+
immutableReceipt?: IJsonLdNodeObject;
|
|
35
40
|
}
|
|
@@ -24,11 +24,10 @@ export interface IImmutableProofComponent extends IComponent {
|
|
|
24
24
|
/**
|
|
25
25
|
* Verify an authentication 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
32
|
* Remove the immutable storage for the proof.
|
|
34
33
|
* @param id The id of the proof to remove the storage from.
|
|
@@ -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,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];
|
package/docs/changelog.md
CHANGED
package/docs/reference/index.md
CHANGED
|
@@ -14,13 +14,16 @@
|
|
|
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
|
|
|
20
21
|
- [ImmutableProofFailure](type-aliases/ImmutableProofFailure.md)
|
|
22
|
+
- [ImmutableProofTopics](type-aliases/ImmutableProofTopics.md)
|
|
21
23
|
- [ImmutableProofTypes](type-aliases/ImmutableProofTypes.md)
|
|
22
24
|
|
|
23
25
|
## Variables
|
|
24
26
|
|
|
25
27
|
- [ImmutableProofFailure](variables/ImmutableProofFailure.md)
|
|
28
|
+
- [ImmutableProofTopics](variables/ImmutableProofTopics.md)
|
|
26
29
|
- [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/"` \| [`"https://schema.twindev.org/immutable-proof/"`, `...
|
|
9
|
+
> **@context**: `"https://schema.twindev.org/immutable-proof/"` \| \[`"https://schema.twindev.org/immutable-proof/"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
10
10
|
|
|
11
11
|
JSON-LD Context.
|
|
12
12
|
|
|
@@ -57,3 +57,11 @@ The hash of the object associated with the proof.
|
|
|
57
57
|
> `optional` **proof**: `IDidProof`
|
|
58
58
|
|
|
59
59
|
The proof which can be undefined if it has not yet been issued.
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### immutableReceipt?
|
|
64
|
+
|
|
65
|
+
> `optional` **immutableReceipt**: `IJsonLdNodeObject`
|
|
66
|
+
|
|
67
|
+
The immutable receipt detail for where the proof is stored.
|
|
@@ -16,15 +16,21 @@ Create a new authentication proof.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### proofObject
|
|
20
|
+
|
|
21
|
+
`IJsonLdNodeObject`
|
|
20
22
|
|
|
21
23
|
The object for the proof as JSON-LD.
|
|
22
24
|
|
|
23
|
-
|
|
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
|
|
|
@@ -44,7 +50,9 @@ Get an authentication 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
75
|
Verify an authentication 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
|
|
|
@@ -96,11 +102,15 @@ Remove the immutable 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
|
|
|
@@ -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: 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,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.
|
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.20",
|
|
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",
|