@twin.org/immutable-proof-rest-client 0.0.1-next.2 → 0.0.1-next.20
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
|
@@ -43,7 +43,7 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
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
|
},
|
|
@@ -56,22 +56,17 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
56
56
|
/**
|
|
57
57
|
* Verify an authentication 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;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -41,7 +41,7 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
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
|
},
|
|
@@ -54,22 +54,17 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
54
54
|
/**
|
|
55
55
|
* Verify an authentication 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;
|
|
@@ -31,11 +31,10 @@ export declare class ImmutableProofClient extends BaseRestClient implements IImm
|
|
|
31
31
|
/**
|
|
32
32
|
* Verify an authentication 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
39
|
* Remove the immutable storage for the proof.
|
|
41
40
|
* @param id The id of the proof to remove the storage from.
|
package/docs/changelog.md
CHANGED
|
@@ -20,7 +20,9 @@ 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
|
|
|
@@ -54,7 +56,9 @@ Create a new authentication proof.
|
|
|
54
56
|
|
|
55
57
|
#### Parameters
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
##### proofObject
|
|
60
|
+
|
|
61
|
+
`IJsonLdNodeObject`
|
|
58
62
|
|
|
59
63
|
The object for the proof as JSON-LD.
|
|
60
64
|
|
|
@@ -78,7 +82,9 @@ Get an authentication 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
111
|
Verify an authentication 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
|
|
|
@@ -138,7 +142,9 @@ Remove the immutable 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
|
|
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.20",
|
|
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.20",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next"
|
|
25
25
|
},
|
|
@@ -28,11 +28,11 @@
|
|
|
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
|
-
"./locales": "./locales"
|
|
35
|
+
"./locales/*.json": "./locales/*.json"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist/cjs",
|