@twin.org/immutable-proof-rest-client 0.0.1-next.24 → 0.0.1-next.26
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
CHANGED
|
@@ -22,21 +22,21 @@ 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.
|
|
@@ -54,7 +54,7 @@ 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
59
|
* @returns The result of the verification and any failures.
|
|
60
60
|
* @throws NotFoundError if the proof is not found.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -20,21 +20,21 @@ 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.
|
|
@@ -52,7 +52,7 @@ 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
57
|
* @returns The result of the verification and any failures.
|
|
58
58
|
* @throws NotFoundError if the proof is not found.
|
|
@@ -16,20 +16,20 @@ 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
34
|
* @returns The result of the verification and any failures.
|
|
35
35
|
* @throws NotFoundError if the proof is not found.
|
package/docs/changelog.md
CHANGED
|
@@ -50,23 +50,23 @@ Runtime name for the class.
|
|
|
50
50
|
|
|
51
51
|
### create()
|
|
52
52
|
|
|
53
|
-
> **create**(`
|
|
53
|
+
> **create**(`document`): `Promise`\<`string`\>
|
|
54
54
|
|
|
55
|
-
Create a new
|
|
55
|
+
Create a new proof.
|
|
56
56
|
|
|
57
57
|
#### Parameters
|
|
58
58
|
|
|
59
|
-
#####
|
|
59
|
+
##### document
|
|
60
60
|
|
|
61
61
|
`IJsonLdNodeObject`
|
|
62
62
|
|
|
63
|
-
The
|
|
63
|
+
The document to create the proof for.
|
|
64
64
|
|
|
65
65
|
#### Returns
|
|
66
66
|
|
|
67
67
|
`Promise`\<`string`\>
|
|
68
68
|
|
|
69
|
-
The id of the new
|
|
69
|
+
The id of the new proof.
|
|
70
70
|
|
|
71
71
|
#### Implementation of
|
|
72
72
|
|
|
@@ -78,7 +78,7 @@ The id of the new authentication proof.
|
|
|
78
78
|
|
|
79
79
|
> **get**(`id`): `Promise`\<`IImmutableProof`\>
|
|
80
80
|
|
|
81
|
-
Get
|
|
81
|
+
Get a proof.
|
|
82
82
|
|
|
83
83
|
#### Parameters
|
|
84
84
|
|
|
@@ -108,7 +108,7 @@ NotFoundError if the proof is not found.
|
|
|
108
108
|
|
|
109
109
|
> **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
|
|
110
110
|
|
|
111
|
-
Verify
|
|
111
|
+
Verify a proof.
|
|
112
112
|
|
|
113
113
|
#### Parameters
|
|
114
114
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-rest-client",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.26",
|
|
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.1-next.
|
|
22
|
+
"@twin.org/immutable-proof-models": "0.0.1-next.26",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next"
|
|
25
25
|
},
|