@twin.org/immutable-proof-rest-client 0.0.3-next.10 → 0.0.3-next.11
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/README.md +1 -1
- package/docs/changelog.md +15 -1
- package/docs/examples.md +59 -1
- package/docs/reference/classes/ImmutableProofRestClient.md +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN Immutable Proof REST Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package delivers a dedicated client for immutable proof HTTP endpoints. It provides a simple interface for creating proofs, loading proof credentials, and running verification calls without reimplementing request handling in each consuming project.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.3-next.11](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.10...immutable-proof-rest-client-v0.0.3-next.11) (2026-03-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
2
16
|
|
|
3
17
|
## [0.0.3-next.10](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.9...immutable-proof-rest-client-v0.0.3-next.10) (2026-02-25)
|
|
4
18
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Immutable Proof REST Client Examples
|
|
2
|
+
|
|
3
|
+
Use these snippets to connect to an API, create and retrieve proofs, and validate proofs through REST endpoints.
|
|
4
|
+
|
|
5
|
+
## ImmutableProofRestClient
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { ImmutableProofRestClient } from '@twin.org/immutable-proof-rest-client';
|
|
9
|
+
|
|
10
|
+
const client = new ImmutableProofRestClient({
|
|
11
|
+
endpoint: 'http://localhost:8080'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(client.className()); // ImmutableProofRestClient
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { ImmutableProofRestClient } from '@twin.org/immutable-proof-rest-client';
|
|
19
|
+
|
|
20
|
+
const client = new ImmutableProofRestClient({
|
|
21
|
+
endpoint: 'http://localhost:8080'
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const proofId = await client.create({
|
|
25
|
+
'@context': 'https://schema.org',
|
|
26
|
+
type: 'Person',
|
|
27
|
+
name: 'Alice Example'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
console.log(proofId); // immutable-proof:01JABCDEF1234567890
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { ImmutableProofRestClient } from '@twin.org/immutable-proof-rest-client';
|
|
35
|
+
|
|
36
|
+
const client = new ImmutableProofRestClient({
|
|
37
|
+
endpoint: 'http://localhost:8080'
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const proof = await client.get('immutable-proof:01JABCDEF1234567890');
|
|
41
|
+
const verification = await client.verify('immutable-proof:01JABCDEF1234567890');
|
|
42
|
+
|
|
43
|
+
console.log(proof.id); // immutable-proof:01JABCDEF1234567890
|
|
44
|
+
console.log(verification.verified); // true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { ImmutableProofRestClient } from '@twin.org/immutable-proof-rest-client';
|
|
49
|
+
|
|
50
|
+
const client = new ImmutableProofRestClient({
|
|
51
|
+
endpoint: 'http://localhost:8080'
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
await client.removeVerifiable('immutable-proof:01JABCDEF1234567890');
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.log(error instanceof Error); // true
|
|
58
|
+
}
|
|
59
|
+
```
|
|
@@ -36,7 +36,7 @@ The configuration for the client.
|
|
|
36
36
|
|
|
37
37
|
## Properties
|
|
38
38
|
|
|
39
|
-
### CLASS\_NAME
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
40
|
|
|
41
41
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ Runtime name for the class.
|
|
|
44
44
|
|
|
45
45
|
## Methods
|
|
46
46
|
|
|
47
|
-
### className()
|
|
47
|
+
### className() {#classname}
|
|
48
48
|
|
|
49
49
|
> **className**(): `string`
|
|
50
50
|
|
|
@@ -62,7 +62,7 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### create()
|
|
65
|
+
### create() {#create}
|
|
66
66
|
|
|
67
67
|
> **create**(`document`): `Promise`\<`string`\>
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ The id of the new proof.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### get()
|
|
91
|
+
### get() {#get}
|
|
92
92
|
|
|
93
93
|
> **get**(`id`): `Promise`\<`IDidVerifiableCredential`\>
|
|
94
94
|
|
|
@@ -118,7 +118,7 @@ NotFoundError if the proof is not found.
|
|
|
118
118
|
|
|
119
119
|
***
|
|
120
120
|
|
|
121
|
-
### verify()
|
|
121
|
+
### verify() {#verify}
|
|
122
122
|
|
|
123
123
|
> **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
|
|
124
124
|
|
|
@@ -148,7 +148,7 @@ NotFoundError if the proof is not found.
|
|
|
148
148
|
|
|
149
149
|
***
|
|
150
150
|
|
|
151
|
-
### removeVerifiable()
|
|
151
|
+
### removeVerifiable() {#removeverifiable}
|
|
152
152
|
|
|
153
153
|
> **removeVerifiable**(`id`): `Promise`\<`void`\>
|
|
154
154
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-rest-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.11",
|
|
4
|
+
"description": "HTTP client for calling immutable proof service endpoints from external components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/immutable-proof.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.3-next.
|
|
22
|
+
"@twin.org/immutable-proof-models": "0.0.3-next.11",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next"
|
|
25
25
|
},
|