@twin.org/immutable-proof-rest-client 0.0.1-next.9 → 0.0.2-next.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 +14 -19
- package/dist/esm/index.mjs +14 -19
- package/dist/types/immutableProofClient.d.ts +9 -10
- package/docs/changelog.md +101 -1
- package/docs/reference/classes/ImmutableProofClient.md +29 -23
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -22,28 +22,28 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
22
22
|
super("ImmutableProofClient", config, "immutable-proof");
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Create a new
|
|
26
|
-
* @param
|
|
27
|
-
* @returns The id of the new
|
|
25
|
+
* Create a new proof.
|
|
26
|
+
* @param document The document to create the proof for.
|
|
27
|
+
* @returns The id of the new proof.
|
|
28
28
|
*/
|
|
29
|
-
async create(
|
|
30
|
-
core.Guards.object(this.CLASS_NAME, "
|
|
29
|
+
async create(document) {
|
|
30
|
+
core.Guards.object(this.CLASS_NAME, "document", document);
|
|
31
31
|
const response = await this.fetch("/", "POST", {
|
|
32
32
|
body: {
|
|
33
|
-
|
|
33
|
+
document
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
return response.headers[web.HeaderTypes.Location];
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Get
|
|
39
|
+
* Get a proof.
|
|
40
40
|
* @param id The id of the proof to get.
|
|
41
41
|
* @returns The proof.
|
|
42
42
|
* @throws NotFoundError if the proof is not found.
|
|
43
43
|
*/
|
|
44
44
|
async get(id) {
|
|
45
45
|
core.Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
46
|
-
const response = await this.fetch("/:id
|
|
46
|
+
const response = await this.fetch("/:id", "GET", {
|
|
47
47
|
headers: {
|
|
48
48
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
49
49
|
},
|
|
@@ -54,36 +54,31 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
54
54
|
return response.body;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Verify
|
|
57
|
+
* Verify a proof.
|
|
58
58
|
* @param id The id of the proof to verify.
|
|
59
|
-
* @param proofObject The object to verify as JSON-LD.
|
|
60
59
|
* @returns The result of the verification and any failures.
|
|
61
60
|
* @throws NotFoundError if the proof is not found.
|
|
62
61
|
*/
|
|
63
|
-
async verify(id
|
|
62
|
+
async verify(id) {
|
|
64
63
|
core.Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
65
|
-
|
|
66
|
-
const response = await this.fetch("/:id", "POST", {
|
|
64
|
+
const response = await this.fetch("/:id/verify", "GET", {
|
|
67
65
|
headers: {
|
|
68
66
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
69
67
|
},
|
|
70
68
|
pathParams: {
|
|
71
69
|
id
|
|
72
|
-
},
|
|
73
|
-
body: {
|
|
74
|
-
proofObject
|
|
75
70
|
}
|
|
76
71
|
});
|
|
77
72
|
return response.body;
|
|
78
73
|
}
|
|
79
74
|
/**
|
|
80
|
-
* Remove the
|
|
75
|
+
* Remove the verifiable storage for the proof.
|
|
81
76
|
* @param id The id of the proof to remove the storage from.
|
|
82
77
|
* @returns Nothing.
|
|
83
78
|
* @throws NotFoundError if the proof is not found.
|
|
84
79
|
*/
|
|
85
|
-
async
|
|
86
|
-
throw new core.NotSupportedError(this.CLASS_NAME, "
|
|
80
|
+
async removeVerifiable(id) {
|
|
81
|
+
throw new core.NotSupportedError(this.CLASS_NAME, "removeVerifiable");
|
|
87
82
|
}
|
|
88
83
|
}
|
|
89
84
|
|
package/dist/esm/index.mjs
CHANGED
|
@@ -20,28 +20,28 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
20
20
|
super("ImmutableProofClient", config, "immutable-proof");
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Create a new
|
|
24
|
-
* @param
|
|
25
|
-
* @returns The id of the new
|
|
23
|
+
* Create a new proof.
|
|
24
|
+
* @param document The document to create the proof for.
|
|
25
|
+
* @returns The id of the new proof.
|
|
26
26
|
*/
|
|
27
|
-
async create(
|
|
28
|
-
Guards.object(this.CLASS_NAME, "
|
|
27
|
+
async create(document) {
|
|
28
|
+
Guards.object(this.CLASS_NAME, "document", document);
|
|
29
29
|
const response = await this.fetch("/", "POST", {
|
|
30
30
|
body: {
|
|
31
|
-
|
|
31
|
+
document
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
return response.headers[HeaderTypes.Location];
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Get
|
|
37
|
+
* Get a proof.
|
|
38
38
|
* @param id The id of the proof to get.
|
|
39
39
|
* @returns The proof.
|
|
40
40
|
* @throws NotFoundError if the proof is not found.
|
|
41
41
|
*/
|
|
42
42
|
async get(id) {
|
|
43
43
|
Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
44
|
-
const response = await this.fetch("/:id
|
|
44
|
+
const response = await this.fetch("/:id", "GET", {
|
|
45
45
|
headers: {
|
|
46
46
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
47
47
|
},
|
|
@@ -52,36 +52,31 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
52
52
|
return response.body;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* Verify
|
|
55
|
+
* Verify a proof.
|
|
56
56
|
* @param id The id of the proof to verify.
|
|
57
|
-
* @param proofObject The object to verify as JSON-LD.
|
|
58
57
|
* @returns The result of the verification and any failures.
|
|
59
58
|
* @throws NotFoundError if the proof is not found.
|
|
60
59
|
*/
|
|
61
|
-
async verify(id
|
|
60
|
+
async verify(id) {
|
|
62
61
|
Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
63
|
-
|
|
64
|
-
const response = await this.fetch("/:id", "POST", {
|
|
62
|
+
const response = await this.fetch("/:id/verify", "GET", {
|
|
65
63
|
headers: {
|
|
66
64
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
67
65
|
},
|
|
68
66
|
pathParams: {
|
|
69
67
|
id
|
|
70
|
-
},
|
|
71
|
-
body: {
|
|
72
|
-
proofObject
|
|
73
68
|
}
|
|
74
69
|
});
|
|
75
70
|
return response.body;
|
|
76
71
|
}
|
|
77
72
|
/**
|
|
78
|
-
* Remove the
|
|
73
|
+
* Remove the verifiable storage for the proof.
|
|
79
74
|
* @param id The id of the proof to remove the storage from.
|
|
80
75
|
* @returns Nothing.
|
|
81
76
|
* @throws NotFoundError if the proof is not found.
|
|
82
77
|
*/
|
|
83
|
-
async
|
|
84
|
-
throw new NotSupportedError(this.CLASS_NAME, "
|
|
78
|
+
async removeVerifiable(id) {
|
|
79
|
+
throw new NotSupportedError(this.CLASS_NAME, "removeVerifiable");
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
82
|
|
|
@@ -16,31 +16,30 @@ export declare class ImmutableProofClient extends BaseRestClient implements IImm
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(config: IBaseRestClientConfig);
|
|
18
18
|
/**
|
|
19
|
-
* Create a new
|
|
20
|
-
* @param
|
|
21
|
-
* @returns The id of the new
|
|
19
|
+
* Create a new proof.
|
|
20
|
+
* @param document The document to create the proof for.
|
|
21
|
+
* @returns The id of the new proof.
|
|
22
22
|
*/
|
|
23
|
-
create(
|
|
23
|
+
create(document: IJsonLdNodeObject): Promise<string>;
|
|
24
24
|
/**
|
|
25
|
-
* Get
|
|
25
|
+
* Get a proof.
|
|
26
26
|
* @param id The id of the proof to get.
|
|
27
27
|
* @returns The proof.
|
|
28
28
|
* @throws NotFoundError if the proof is not found.
|
|
29
29
|
*/
|
|
30
30
|
get(id: string): Promise<IImmutableProof>;
|
|
31
31
|
/**
|
|
32
|
-
* Verify
|
|
32
|
+
* Verify a proof.
|
|
33
33
|
* @param id The id of the proof to verify.
|
|
34
|
-
* @param proofObject The object to verify as JSON-LD.
|
|
35
34
|
* @returns The result of the verification and any failures.
|
|
36
35
|
* @throws NotFoundError if the proof is not found.
|
|
37
36
|
*/
|
|
38
|
-
verify(id: string
|
|
37
|
+
verify(id: string): Promise<IImmutableProofVerification>;
|
|
39
38
|
/**
|
|
40
|
-
* Remove the
|
|
39
|
+
* Remove the verifiable storage for the proof.
|
|
41
40
|
* @param id The id of the proof to remove the storage from.
|
|
42
41
|
* @returns Nothing.
|
|
43
42
|
* @throws NotFoundError if the proof is not found.
|
|
44
43
|
*/
|
|
45
|
-
|
|
44
|
+
removeVerifiable(id: string): Promise<void>;
|
|
46
45
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,105 @@
|
|
|
1
1
|
# @twin.org/immutable-proof-rest-client - Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [0.0.2-next.1](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.0...immutable-proof-rest-client-v0.0.2-next.1) (2025-08-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
9
|
+
* update framework core ([e708d4d](https://github.com/twinfoundation/immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
10
|
+
* use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* The following workspace dependencies were updated
|
|
16
|
+
* dependencies
|
|
17
|
+
* @twin.org/immutable-proof-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
18
|
+
|
|
19
|
+
## 0.0.1 (2025-07-09)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* release to production ([cb7ecff](https://github.com/twinfoundation/immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @twin.org/immutable-proof-models bumped from ^0.0.0 to ^0.0.1
|
|
32
|
+
|
|
33
|
+
## [0.0.1-next.35](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.34...immutable-proof-rest-client-v0.0.1-next.35) (2025-06-12)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
* The following workspace dependencies were updated
|
|
44
|
+
* dependencies
|
|
45
|
+
* @twin.org/immutable-proof-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
46
|
+
|
|
47
|
+
## [0.0.1-next.34](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.33...immutable-proof-rest-client-v0.0.1-next.34) (2025-06-03)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Miscellaneous Chores
|
|
51
|
+
|
|
52
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Dependencies
|
|
56
|
+
|
|
57
|
+
* The following workspace dependencies were updated
|
|
58
|
+
* dependencies
|
|
59
|
+
* @twin.org/immutable-proof-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
60
|
+
|
|
61
|
+
## [0.0.1-next.33](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.32...immutable-proof-rest-client-v0.0.1-next.33) (2025-05-28)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Miscellaneous Chores
|
|
65
|
+
|
|
66
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Dependencies
|
|
70
|
+
|
|
71
|
+
* The following workspace dependencies were updated
|
|
72
|
+
* dependencies
|
|
73
|
+
* @twin.org/immutable-proof-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
74
|
+
|
|
75
|
+
## [0.0.1-next.32](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.31...immutable-proof-rest-client-v0.0.1-next.32) (2025-04-17)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Features
|
|
79
|
+
|
|
80
|
+
* use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Dependencies
|
|
84
|
+
|
|
85
|
+
* The following workspace dependencies were updated
|
|
86
|
+
* dependencies
|
|
87
|
+
* @twin.org/immutable-proof-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
88
|
+
|
|
89
|
+
## [0.0.1-next.31](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.30...immutable-proof-rest-client-v0.0.1-next.31) (2025-03-28)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### Miscellaneous Chores
|
|
93
|
+
|
|
94
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Dependencies
|
|
98
|
+
|
|
99
|
+
* The following workspace dependencies were updated
|
|
100
|
+
* dependencies
|
|
101
|
+
* @twin.org/immutable-proof-models bumped from 0.0.1-next.30 to 0.0.1-next.31
|
|
102
|
+
|
|
103
|
+
## v0.0.1-next.30
|
|
4
104
|
|
|
5
105
|
- Initial Release
|
|
@@ -12,21 +12,23 @@ Client for performing immutable proof through to REST endpoints.
|
|
|
12
12
|
|
|
13
13
|
## Constructors
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Constructor
|
|
16
16
|
|
|
17
|
-
> **new ImmutableProofClient**(`config`):
|
|
17
|
+
> **new ImmutableProofClient**(`config`): `ImmutableProofClient`
|
|
18
18
|
|
|
19
19
|
Create a new instance of ImmutableProofClient.
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
##### config
|
|
24
|
+
|
|
25
|
+
`IBaseRestClientConfig`
|
|
24
26
|
|
|
25
27
|
The configuration for the client.
|
|
26
28
|
|
|
27
29
|
#### Returns
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
`ImmutableProofClient`
|
|
30
32
|
|
|
31
33
|
#### Overrides
|
|
32
34
|
|
|
@@ -48,21 +50,23 @@ Runtime name for the class.
|
|
|
48
50
|
|
|
49
51
|
### create()
|
|
50
52
|
|
|
51
|
-
> **create**(`
|
|
53
|
+
> **create**(`document`): `Promise`\<`string`\>
|
|
52
54
|
|
|
53
|
-
Create a new
|
|
55
|
+
Create a new proof.
|
|
54
56
|
|
|
55
57
|
#### Parameters
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
##### document
|
|
60
|
+
|
|
61
|
+
`IJsonLdNodeObject`
|
|
58
62
|
|
|
59
|
-
The
|
|
63
|
+
The document to create the proof for.
|
|
60
64
|
|
|
61
65
|
#### Returns
|
|
62
66
|
|
|
63
67
|
`Promise`\<`string`\>
|
|
64
68
|
|
|
65
|
-
The id of the new
|
|
69
|
+
The id of the new proof.
|
|
66
70
|
|
|
67
71
|
#### Implementation of
|
|
68
72
|
|
|
@@ -74,11 +78,13 @@ The id of the new authentication proof.
|
|
|
74
78
|
|
|
75
79
|
> **get**(`id`): `Promise`\<`IImmutableProof`\>
|
|
76
80
|
|
|
77
|
-
Get
|
|
81
|
+
Get a proof.
|
|
78
82
|
|
|
79
83
|
#### Parameters
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
##### id
|
|
86
|
+
|
|
87
|
+
`string`
|
|
82
88
|
|
|
83
89
|
The id of the proof to get.
|
|
84
90
|
|
|
@@ -100,19 +106,17 @@ NotFoundError if the proof is not found.
|
|
|
100
106
|
|
|
101
107
|
### verify()
|
|
102
108
|
|
|
103
|
-
> **verify**(`id
|
|
109
|
+
> **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
|
|
104
110
|
|
|
105
|
-
Verify
|
|
111
|
+
Verify a proof.
|
|
106
112
|
|
|
107
113
|
#### Parameters
|
|
108
114
|
|
|
109
|
-
|
|
115
|
+
##### id
|
|
110
116
|
|
|
111
|
-
|
|
117
|
+
`string`
|
|
112
118
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
The object to verify as JSON-LD.
|
|
119
|
+
The id of the proof to verify.
|
|
116
120
|
|
|
117
121
|
#### Returns
|
|
118
122
|
|
|
@@ -130,15 +134,17 @@ NotFoundError if the proof is not found.
|
|
|
130
134
|
|
|
131
135
|
***
|
|
132
136
|
|
|
133
|
-
###
|
|
137
|
+
### removeVerifiable()
|
|
134
138
|
|
|
135
|
-
> **
|
|
139
|
+
> **removeVerifiable**(`id`): `Promise`\<`void`\>
|
|
136
140
|
|
|
137
|
-
Remove the
|
|
141
|
+
Remove the verifiable storage for the proof.
|
|
138
142
|
|
|
139
143
|
#### Parameters
|
|
140
144
|
|
|
141
|
-
|
|
145
|
+
##### id
|
|
146
|
+
|
|
147
|
+
`string`
|
|
142
148
|
|
|
143
149
|
The id of the proof to remove the storage from.
|
|
144
150
|
|
|
@@ -154,4 +160,4 @@ NotFoundError if the proof is not found.
|
|
|
154
160
|
|
|
155
161
|
#### Implementation of
|
|
156
162
|
|
|
157
|
-
`IImmutableProofComponent.
|
|
163
|
+
`IImmutableProofComponent.removeVerifiable`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-rest-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next.1",
|
|
4
4
|
"description": "Immutable Proof contract implementation which can connect to REST endpoints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/data-json-ld": "next",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
|
-
"@twin.org/immutable-proof-models": "0.0.
|
|
22
|
+
"@twin.org/immutable-proof-models": "0.0.2-next.1",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next"
|
|
25
25
|
},
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"types": "./dist/types/index.d.ts",
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
31
32
|
"require": "./dist/cjs/index.cjs",
|
|
32
|
-
"import": "./dist/esm/index.mjs"
|
|
33
|
-
"types": "./dist/types/index.d.ts"
|
|
33
|
+
"import": "./dist/esm/index.mjs"
|
|
34
34
|
},
|
|
35
35
|
"./locales/*.json": "./locales/*.json"
|
|
36
36
|
},
|