@twin.org/immutable-proof-service 0.0.1-next.8 → 0.0.1
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 +193 -208
- package/dist/esm/index.mjs +198 -213
- package/dist/types/entities/immutableProof.d.ts +2 -2
- package/dist/types/immutableProofService.d.ts +11 -25
- package/dist/types/index.d.ts +2 -1
- package/dist/types/models/IImmutableProofServiceConfig.d.ts +2 -7
- package/dist/types/models/IImmutableProofServiceConstructorOptions.d.ts +34 -0
- package/docs/changelog.md +91 -1
- package/docs/open-api/spec.json +709 -732
- package/docs/reference/classes/ImmutableProof.md +6 -6
- package/docs/reference/classes/ImmutableProofService.md +38 -50
- package/docs/reference/functions/generateRestRoutesImmutableProof.md +8 -4
- package/docs/reference/functions/immutableProofCreate.md +9 -3
- package/docs/reference/functions/immutableProofGet.md +9 -3
- package/docs/reference/functions/immutableProofVerify.md +9 -3
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IImmutableProofServiceConfig.md +3 -17
- package/docs/reference/interfaces/IImmutableProofServiceConstructorOptions.md +75 -0
- package/locales/en.json +1 -1
- package/package.json +20 -20
|
@@ -4,13 +4,13 @@ Class describing the immutable proof.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new ImmutableProof**():
|
|
9
|
+
> **new ImmutableProof**(): `ImmutableProof`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`ImmutableProof`
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
@@ -62,8 +62,8 @@ The associated hash for the item.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### verifiableStorageId?
|
|
66
66
|
|
|
67
|
-
> `optional` **
|
|
67
|
+
> `optional` **verifiableStorageId**: `string`
|
|
68
68
|
|
|
69
|
-
The
|
|
69
|
+
The verifiable storage id.
|
|
@@ -8,45 +8,23 @@ Class for performing immutable proof operations.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new ImmutableProofService**(`options
|
|
13
|
+
> **new ImmutableProofService**(`options?`): `ImmutableProofService`
|
|
14
14
|
|
|
15
15
|
Create a new instance of ImmutableProofService.
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### options?
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
• **options.vaultConnectorType?**: `string`
|
|
24
|
-
|
|
25
|
-
The vault connector type, defaults to "vault".
|
|
26
|
-
|
|
27
|
-
• **options.immutableProofEntityStorageType?**: `string`
|
|
28
|
-
|
|
29
|
-
The entity storage for proofs, defaults to "immutable-proof".
|
|
30
|
-
|
|
31
|
-
• **options.immutableStorageType?**: `string`
|
|
32
|
-
|
|
33
|
-
The immutable storage, defaults to "immutable-storage".
|
|
34
|
-
|
|
35
|
-
• **options.identityConnectorType?**: `string`
|
|
36
|
-
|
|
37
|
-
The identity connector type, defaults to "identity".
|
|
38
|
-
|
|
39
|
-
• **options.backgroundTaskConnectorType?**: `string`
|
|
40
|
-
|
|
41
|
-
The background task connector type, defaults to "background-task".
|
|
21
|
+
[`IImmutableProofServiceConstructorOptions`](../interfaces/IImmutableProofServiceConstructorOptions.md)
|
|
42
22
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
The configuration for the connector.
|
|
23
|
+
The dependencies for the immutable proof connector.
|
|
46
24
|
|
|
47
25
|
#### Returns
|
|
48
26
|
|
|
49
|
-
|
|
27
|
+
`ImmutableProofService`
|
|
50
28
|
|
|
51
29
|
## Properties
|
|
52
30
|
|
|
@@ -72,21 +50,27 @@ Runtime name for the class.
|
|
|
72
50
|
|
|
73
51
|
### create()
|
|
74
52
|
|
|
75
|
-
> **create**(`
|
|
53
|
+
> **create**(`document`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`string`\>
|
|
76
54
|
|
|
77
|
-
Create a new
|
|
55
|
+
Create a new proof.
|
|
78
56
|
|
|
79
57
|
#### Parameters
|
|
80
58
|
|
|
81
|
-
|
|
59
|
+
##### document
|
|
60
|
+
|
|
61
|
+
`IJsonLdNodeObject`
|
|
82
62
|
|
|
83
|
-
The
|
|
63
|
+
The document to create the proof for.
|
|
84
64
|
|
|
85
|
-
|
|
65
|
+
##### userIdentity?
|
|
66
|
+
|
|
67
|
+
`string`
|
|
86
68
|
|
|
87
69
|
The identity to create the immutable proof operation with.
|
|
88
70
|
|
|
89
|
-
|
|
71
|
+
##### nodeIdentity?
|
|
72
|
+
|
|
73
|
+
`string`
|
|
90
74
|
|
|
91
75
|
The node identity to use for vault operations.
|
|
92
76
|
|
|
@@ -94,7 +78,7 @@ The node identity to use for vault operations.
|
|
|
94
78
|
|
|
95
79
|
`Promise`\<`string`\>
|
|
96
80
|
|
|
97
|
-
The id of the new
|
|
81
|
+
The id of the new proof.
|
|
98
82
|
|
|
99
83
|
#### Implementation of
|
|
100
84
|
|
|
@@ -106,11 +90,13 @@ The id of the new authentication proof.
|
|
|
106
90
|
|
|
107
91
|
> **get**(`id`): `Promise`\<`IImmutableProof`\>
|
|
108
92
|
|
|
109
|
-
Get
|
|
93
|
+
Get a proof.
|
|
110
94
|
|
|
111
95
|
#### Parameters
|
|
112
96
|
|
|
113
|
-
|
|
97
|
+
##### id
|
|
98
|
+
|
|
99
|
+
`string`
|
|
114
100
|
|
|
115
101
|
The id of the proof to get.
|
|
116
102
|
|
|
@@ -132,19 +118,17 @@ NotFoundError if the proof is not found.
|
|
|
132
118
|
|
|
133
119
|
### verify()
|
|
134
120
|
|
|
135
|
-
> **verify**(`id
|
|
121
|
+
> **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
|
|
136
122
|
|
|
137
|
-
Verify
|
|
123
|
+
Verify a proof.
|
|
138
124
|
|
|
139
125
|
#### Parameters
|
|
140
126
|
|
|
141
|
-
|
|
127
|
+
##### id
|
|
142
128
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
• **proofObject**: `IJsonLdNodeObject`
|
|
129
|
+
`string`
|
|
146
130
|
|
|
147
|
-
The
|
|
131
|
+
The id of the proof to verify.
|
|
148
132
|
|
|
149
133
|
#### Returns
|
|
150
134
|
|
|
@@ -162,19 +146,23 @@ NotFoundError if the proof is not found.
|
|
|
162
146
|
|
|
163
147
|
***
|
|
164
148
|
|
|
165
|
-
###
|
|
149
|
+
### removeVerifiable()
|
|
166
150
|
|
|
167
|
-
> **
|
|
151
|
+
> **removeVerifiable**(`id`, `nodeIdentity?`): `Promise`\<`void`\>
|
|
168
152
|
|
|
169
|
-
Remove the
|
|
153
|
+
Remove the verifiable storage for the proof.
|
|
170
154
|
|
|
171
155
|
#### Parameters
|
|
172
156
|
|
|
173
|
-
|
|
157
|
+
##### id
|
|
158
|
+
|
|
159
|
+
`string`
|
|
174
160
|
|
|
175
161
|
The id of the proof to remove the storage from.
|
|
176
162
|
|
|
177
|
-
|
|
163
|
+
##### nodeIdentity?
|
|
164
|
+
|
|
165
|
+
`string`
|
|
178
166
|
|
|
179
167
|
The node identity to use for vault operations.
|
|
180
168
|
|
|
@@ -190,4 +178,4 @@ NotFoundError if the proof is not found.
|
|
|
190
178
|
|
|
191
179
|
#### Implementation of
|
|
192
180
|
|
|
193
|
-
`IImmutableProofComponent.
|
|
181
|
+
`IImmutableProofComponent.removeVerifiable`
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
# Function: generateRestRoutesImmutableProof()
|
|
2
2
|
|
|
3
|
-
> **generateRestRoutesImmutableProof**(`baseRouteName`, `componentName`): `IRestRoute`[]
|
|
3
|
+
> **generateRestRoutesImmutableProof**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
|
|
4
4
|
|
|
5
5
|
The REST routes for immutable proof.
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### baseRouteName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
10
12
|
|
|
11
13
|
Prefix to prepend to the paths.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes stored in the ComponentFactory.
|
|
16
20
|
|
|
17
21
|
## Returns
|
|
18
22
|
|
|
19
|
-
`IRestRoute`[]
|
|
23
|
+
`IRestRoute`\<`any`, `any`\>[]
|
|
20
24
|
|
|
21
25
|
The generated routes.
|
|
@@ -6,15 +6,21 @@ Create a proof.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`IImmutableProofCreateRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Get the proof.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`IImmutableProofGetRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Verify the proof.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`IImmutableProofVerifyRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
package/docs/reference/index.md
CHANGED
|
@@ -4,28 +4,14 @@ Configuration for the immutable proof service.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### verificationMethodId?
|
|
8
8
|
|
|
9
|
-
> `optional` **
|
|
9
|
+
> `optional` **verificationMethodId**: `string`
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The verification method id to use for the proof.
|
|
12
12
|
|
|
13
13
|
#### Default
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
immutable-proof-assertion
|
|
17
17
|
```
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### proofHashKeyId?
|
|
22
|
-
|
|
23
|
-
> `optional` **proofHashKeyId**: `string`
|
|
24
|
-
|
|
25
|
-
The key to use in the proof hash.
|
|
26
|
-
|
|
27
|
-
#### Default
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
immutable-proof-hash
|
|
31
|
-
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Interface: IImmutableProofServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the immutable proof service constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### immutableProofEntityStorageType?
|
|
8
|
+
|
|
9
|
+
> `optional` **immutableProofEntityStorageType**: `string`
|
|
10
|
+
|
|
11
|
+
The entity storage for proofs.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
immutable-proof
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### verifiableStorageType?
|
|
22
|
+
|
|
23
|
+
> `optional` **verifiableStorageType**: `string`
|
|
24
|
+
|
|
25
|
+
The verifiable storage.
|
|
26
|
+
|
|
27
|
+
#### Default
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
verifiable-storage
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### identityConnectorType?
|
|
36
|
+
|
|
37
|
+
> `optional` **identityConnectorType**: `string`
|
|
38
|
+
|
|
39
|
+
The identity connector type.
|
|
40
|
+
|
|
41
|
+
#### Default
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
identity
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### backgroundTaskConnectorType?
|
|
50
|
+
|
|
51
|
+
> `optional` **backgroundTaskConnectorType**: `string`
|
|
52
|
+
|
|
53
|
+
The background task connector type.
|
|
54
|
+
|
|
55
|
+
#### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
background-task
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### eventBusComponentType?
|
|
64
|
+
|
|
65
|
+
> `optional` **eventBusComponentType**: `string`
|
|
66
|
+
|
|
67
|
+
The event bus component type, defaults to no event bus.
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
71
|
+
### config?
|
|
72
|
+
|
|
73
|
+
> `optional` **config**: [`IImmutableProofServiceConfig`](IImmutableProofServiceConfig.md)
|
|
74
|
+
|
|
75
|
+
The configuration for the connector.
|
package/locales/en.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"createFailed": "Creating the proof failed",
|
|
6
6
|
"getFailed": "Getting the proof failed",
|
|
7
7
|
"verifyFailed": "Verifying the proof failed",
|
|
8
|
-
"
|
|
8
|
+
"removeVerifiableFailed": "Removing verifiable entry from the Immutable Proof failed",
|
|
9
9
|
"proofNotFound": "The proof with the Id \"{notFoundId}\" was not found"
|
|
10
10
|
}
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-service",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Immutable proof contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,33 +14,33 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "next",
|
|
18
|
-
"@twin.org/background-task-models": "
|
|
19
|
-
"@twin.org/core": "
|
|
20
|
-
"@twin.org/crypto": "
|
|
21
|
-
"@twin.org/data-json-ld": "
|
|
22
|
-
"@twin.org/
|
|
23
|
-
"@twin.org/entity": "
|
|
24
|
-
"@twin.org/
|
|
25
|
-
"@twin.org/identity-models": "
|
|
26
|
-
"@twin.org/immutable-proof-models": "0.0.1
|
|
27
|
-
"@twin.org/immutable-
|
|
28
|
-
"@twin.org/nameof": "
|
|
29
|
-
"@twin.org/standards-w3c-did": "
|
|
30
|
-
"@twin.org/vault-models": "
|
|
31
|
-
"@twin.org/
|
|
32
|
-
"
|
|
17
|
+
"@twin.org/api-models": "^0.0.2-next.1",
|
|
18
|
+
"@twin.org/background-task-models": "^0.0.1",
|
|
19
|
+
"@twin.org/core": "^0.0.1",
|
|
20
|
+
"@twin.org/crypto": "^0.0.1",
|
|
21
|
+
"@twin.org/data-json-ld": "^0.0.1",
|
|
22
|
+
"@twin.org/entity": "^0.0.1",
|
|
23
|
+
"@twin.org/entity-storage-models": "^0.0.1",
|
|
24
|
+
"@twin.org/event-bus-models": "^0.0.1",
|
|
25
|
+
"@twin.org/identity-models": "^0.0.1",
|
|
26
|
+
"@twin.org/immutable-proof-models": "^0.0.1",
|
|
27
|
+
"@twin.org/immutable-proof-task": "^0.0.1",
|
|
28
|
+
"@twin.org/nameof": "^0.0.1",
|
|
29
|
+
"@twin.org/standards-w3c-did": "^0.0.1",
|
|
30
|
+
"@twin.org/vault-models": "^0.0.1",
|
|
31
|
+
"@twin.org/verifiable-storage-models": "^0.0.1",
|
|
32
|
+
"@twin.org/web": "^0.0.1"
|
|
33
33
|
},
|
|
34
34
|
"main": "./dist/cjs/index.cjs",
|
|
35
35
|
"module": "./dist/esm/index.mjs",
|
|
36
36
|
"types": "./dist/types/index.d.ts",
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
|
39
|
+
"types": "./dist/types/index.d.ts",
|
|
39
40
|
"require": "./dist/cjs/index.cjs",
|
|
40
|
-
"import": "./dist/esm/index.mjs"
|
|
41
|
-
"types": "./dist/types/index.d.ts"
|
|
41
|
+
"import": "./dist/esm/index.mjs"
|
|
42
42
|
},
|
|
43
|
-
"./locales": "./locales"
|
|
43
|
+
"./locales/*.json": "./locales/*.json"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist/cjs",
|