@twin.org/immutable-proof-rest-client 0.0.1-next.1 → 0.0.1-next.3
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
|
@@ -64,6 +64,9 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
64
64
|
core.Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
65
65
|
core.Guards.object(this.CLASS_NAME, "proofObject", proofObject);
|
|
66
66
|
const response = await this.fetch("/:id", "POST", {
|
|
67
|
+
headers: {
|
|
68
|
+
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
69
|
+
},
|
|
67
70
|
pathParams: {
|
|
68
71
|
id
|
|
69
72
|
},
|
package/dist/esm/index.mjs
CHANGED
|
@@ -62,6 +62,9 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
62
62
|
Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
63
63
|
Guards.object(this.CLASS_NAME, "proofObject", proofObject);
|
|
64
64
|
const response = await this.fetch("/:id", "POST", {
|
|
65
|
+
headers: {
|
|
66
|
+
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
67
|
+
},
|
|
65
68
|
pathParams: {
|
|
66
69
|
id
|
|
67
70
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseRestClient } from "@twin.org/api-core";
|
|
2
2
|
import type { IBaseRestClientConfig } from "@twin.org/api-models";
|
|
3
3
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
4
|
-
import type { IImmutableProof, IImmutableProofComponent,
|
|
4
|
+
import type { IImmutableProof, IImmutableProofComponent, IImmutableProofVerification } from "@twin.org/immutable-proof-models";
|
|
5
5
|
/**
|
|
6
6
|
* Client for performing immutable proof through to REST endpoints.
|
|
7
7
|
*/
|
|
@@ -35,10 +35,7 @@ export declare class ImmutableProofClient extends BaseRestClient implements IImm
|
|
|
35
35
|
* @returns The result of the verification and any failures.
|
|
36
36
|
* @throws NotFoundError if the proof is not found.
|
|
37
37
|
*/
|
|
38
|
-
verify(id: string, proofObject: IJsonLdNodeObject): Promise<
|
|
39
|
-
verified: boolean;
|
|
40
|
-
failure?: ImmutableProofFailure;
|
|
41
|
-
}>;
|
|
38
|
+
verify(id: string, proofObject: IJsonLdNodeObject): Promise<IImmutableProofVerification>;
|
|
42
39
|
/**
|
|
43
40
|
* Remove the immutable storage for the proof.
|
|
44
41
|
* @param id The id of the proof to remove the storage from.
|
package/docs/changelog.md
CHANGED
|
@@ -100,7 +100,7 @@ NotFoundError if the proof is not found.
|
|
|
100
100
|
|
|
101
101
|
### verify()
|
|
102
102
|
|
|
103
|
-
> **verify**(`id`, `proofObject`): `Promise`\<`
|
|
103
|
+
> **verify**(`id`, `proofObject`): `Promise`\<`IImmutableProofVerification`\>
|
|
104
104
|
|
|
105
105
|
Verify an authentication proof.
|
|
106
106
|
|
|
@@ -116,18 +116,10 @@ The object to verify as JSON-LD.
|
|
|
116
116
|
|
|
117
117
|
#### Returns
|
|
118
118
|
|
|
119
|
-
`Promise`\<`
|
|
119
|
+
`Promise`\<`IImmutableProofVerification`\>
|
|
120
120
|
|
|
121
121
|
The result of the verification and any failures.
|
|
122
122
|
|
|
123
|
-
##### verified
|
|
124
|
-
|
|
125
|
-
> **verified**: `boolean`
|
|
126
|
-
|
|
127
|
-
##### failure?
|
|
128
|
-
|
|
129
|
-
> `optional` **failure**: `ImmutableProofFailure`
|
|
130
|
-
|
|
131
123
|
#### Throws
|
|
132
124
|
|
|
133
125
|
NotFoundError if the proof is not found.
|
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.3",
|
|
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.3",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next"
|
|
25
25
|
},
|