@twin.org/immutable-proof-rest-client 0.0.3-next.8 → 0.9.0-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/README.md +1 -1
- package/dist/es/immutableProofRestClient.js +30 -10
- package/dist/es/immutableProofRestClient.js.map +1 -1
- package/dist/types/immutableProofRestClient.d.ts +19 -9
- package/docs/changelog.md +190 -32
- package/docs/examples.md +59 -1
- package/docs/reference/classes/ImmutableProofRestClient.md +55 -15
- package/locales/en.json +1 -7
- package/package.json +12 -12
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
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { BaseRestClient } from "@twin.org/api-core";
|
|
4
|
-
import { Guards
|
|
4
|
+
import { Guards } from "@twin.org/core";
|
|
5
5
|
import { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
6
6
|
/**
|
|
7
7
|
* Client for performing immutable proof through to REST endpoints.
|
|
@@ -12,7 +12,7 @@ export class ImmutableProofRestClient extends BaseRestClient {
|
|
|
12
12
|
*/
|
|
13
13
|
static CLASS_NAME = "ImmutableProofRestClient";
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Creates an instance of ImmutableProofRestClient.
|
|
16
16
|
* @param config The configuration for the client.
|
|
17
17
|
*/
|
|
18
18
|
constructor(config) {
|
|
@@ -28,13 +28,16 @@ export class ImmutableProofRestClient extends BaseRestClient {
|
|
|
28
28
|
/**
|
|
29
29
|
* Create a new proof.
|
|
30
30
|
* @param document The document to create the proof for.
|
|
31
|
+
* @param options Optional settings for the proof.
|
|
32
|
+
* @param options.deleteLock An ISO 8601 date-time string specifying when the notarization lock expires; if omitted no lock is applied.
|
|
31
33
|
* @returns The id of the new proof.
|
|
32
34
|
*/
|
|
33
|
-
async create(document) {
|
|
35
|
+
async create(document, options) {
|
|
34
36
|
Guards.object(ImmutableProofRestClient.CLASS_NAME, "document", document);
|
|
35
37
|
const response = await this.fetch("/", "POST", {
|
|
36
38
|
body: {
|
|
37
|
-
document
|
|
39
|
+
document,
|
|
40
|
+
options
|
|
38
41
|
}
|
|
39
42
|
});
|
|
40
43
|
return response.headers[HeaderTypes.Location];
|
|
@@ -76,14 +79,31 @@ export class ImmutableProofRestClient extends BaseRestClient {
|
|
|
76
79
|
return response.body;
|
|
77
80
|
}
|
|
78
81
|
/**
|
|
79
|
-
* Remove the
|
|
80
|
-
* @param id The id of the proof to remove
|
|
81
|
-
* @returns
|
|
82
|
+
* Remove the proof and its notarization.
|
|
83
|
+
* @param id The id of the proof to remove.
|
|
84
|
+
* @returns A promise that resolves when the proof and its notarization have been removed.
|
|
82
85
|
* @throws NotFoundError if the proof is not found.
|
|
83
86
|
*/
|
|
84
|
-
async
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
async remove(id) {
|
|
88
|
+
Guards.stringValue(ImmutableProofRestClient.CLASS_NAME, "id", id);
|
|
89
|
+
await this.fetch("/:id", "DELETE", {
|
|
90
|
+
pathParams: {
|
|
91
|
+
id
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Remove only the notarization for the proof, keeping the proof entity.
|
|
97
|
+
* @param id The id of the proof to remove the notarization from.
|
|
98
|
+
* @returns A promise that resolves when the notarization has been removed.
|
|
99
|
+
* @throws NotFoundError if the proof is not found.
|
|
100
|
+
*/
|
|
101
|
+
async removeNotarization(id) {
|
|
102
|
+
Guards.stringValue(ImmutableProofRestClient.CLASS_NAME, "id", id);
|
|
103
|
+
await this.fetch("/:id/notarization", "DELETE", {
|
|
104
|
+
pathParams: {
|
|
105
|
+
id
|
|
106
|
+
}
|
|
87
107
|
});
|
|
88
108
|
}
|
|
89
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutableProofRestClient.js","sourceRoot":"","sources":["../../src/immutableProofRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"immutableProofRestClient.js","sourceRoot":"","sources":["../../src/immutableProofRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAexC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC3D;;OAEG;IACI,MAAM,CAAU,UAAU,8BAA8C;IAE/E;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,6BAAqC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,wBAAwB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CAClB,QAA2B,EAC3B,OAAiC;QAEjC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,UAAU,cAAoB,QAAQ,CAAC,CAAC;QAE/E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAAiD,GAAG,EAAE,MAAM,EAAE;YAC9F,IAAI,EAAE;gBACL,QAAQ;gBACR,OAAO;aACP;SACD,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CAAC,EAAU;QAC1B,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,UAAU,QAAc,EAAE,CAAC,CAAC;QAExE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAChC,MAAM,EACN,KAAK,EACL;YACC,OAAO,EAAE;gBACR,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM;aACtC;YACD,UAAU,EAAE;gBACX,EAAE;aACF;SACD,CACD,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,EAAU;QAC7B,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,UAAU,QAAc,EAAE,CAAC,CAAC;QAExE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAChC,aAAa,EACb,KAAK,EACL;YACC,OAAO,EAAE;gBACR,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM;aACtC;YACD,UAAU,EAAE;gBACX,EAAE;aACF;SACD,CACD,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,EAAU;QAC7B,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,UAAU,QAAc,EAAE,CAAC,CAAC;QAExE,MAAM,IAAI,CAAC,KAAK,CAAmD,MAAM,EAAE,QAAQ,EAAE;YACpF,UAAU,EAAE;gBACX,EAAE;aACF;SACD,CAAC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,kBAAkB,CAAC,EAAU;QACzC,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,UAAU,QAAc,EAAE,CAAC,CAAC;QAExE,MAAM,IAAI,CAAC,KAAK,CACf,mBAAmB,EACnB,QAAQ,EACR;YACC,UAAU,EAAE;gBACX,EAAE;aACF;SACD,CACD,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type {\n\tIBaseRestClientConfig,\n\tICreatedResponse,\n\tINoContentResponse\n} from \"@twin.org/api-models\";\nimport { Guards } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tIImmutableProofComponent,\n\tIImmutableProofCreateRequest,\n\tIImmutableProofCredential,\n\tIImmutableProofGetRequest,\n\tIImmutableProofGetResponse,\n\tIImmutableProofRemoveNotarizationRequest,\n\tIImmutableProofRemoveRequest,\n\tIImmutableProofVerification,\n\tIImmutableProofVerifyRequest,\n\tIImmutableProofVerifyResponse\n} from \"@twin.org/immutable-proof-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing immutable proof through to REST endpoints.\n */\nexport class ImmutableProofRestClient extends BaseRestClient implements IImmutableProofComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<ImmutableProofRestClient>();\n\n\t/**\n\t * Creates an instance of ImmutableProofRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<ImmutableProofRestClient>(), config, \"immutable-proof\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn ImmutableProofRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create a new proof.\n\t * @param document The document to create the proof for.\n\t * @param options Optional settings for the proof.\n\t * @param options.deleteLock An ISO 8601 date-time string specifying when the notarization lock expires; if omitted no lock is applied.\n\t * @returns The id of the new proof.\n\t */\n\tpublic async create(\n\t\tdocument: IJsonLdNodeObject,\n\t\toptions?: { deleteLock?: string }\n\t): Promise<string> {\n\t\tGuards.object(ImmutableProofRestClient.CLASS_NAME, nameof(document), document);\n\n\t\tconst response = await this.fetch<IImmutableProofCreateRequest, ICreatedResponse>(\"/\", \"POST\", {\n\t\t\tbody: {\n\t\t\t\tdocument,\n\t\t\t\toptions\n\t\t\t}\n\t\t});\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\n\n\t/**\n\t * Get a proof.\n\t * @param id The id of the proof to get.\n\t * @returns The proof.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tpublic async get(id: string): Promise<IImmutableProofCredential> {\n\t\tGuards.stringValue(ImmutableProofRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<IImmutableProofGetRequest, IImmutableProofGetResponse>(\n\t\t\t\"/:id\",\n\t\t\t\"GET\",\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t\t},\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Verify a proof.\n\t * @param id The id of the proof to verify.\n\t * @returns The result of the verification and any failures.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tpublic async verify(id: string): Promise<IImmutableProofVerification> {\n\t\tGuards.stringValue(ImmutableProofRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<IImmutableProofVerifyRequest, IImmutableProofVerifyResponse>(\n\t\t\t\"/:id/verify\",\n\t\t\t\"GET\",\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t\t},\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Remove the proof and its notarization.\n\t * @param id The id of the proof to remove.\n\t * @returns A promise that resolves when the proof and its notarization have been removed.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tpublic async remove(id: string): Promise<void> {\n\t\tGuards.stringValue(ImmutableProofRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tawait this.fetch<IImmutableProofRemoveRequest, INoContentResponse>(\"/:id\", \"DELETE\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Remove only the notarization for the proof, keeping the proof entity.\n\t * @param id The id of the proof to remove the notarization from.\n\t * @returns A promise that resolves when the notarization has been removed.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tpublic async removeNotarization(id: string): Promise<void> {\n\t\tGuards.stringValue(ImmutableProofRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tawait this.fetch<IImmutableProofRemoveNotarizationRequest, INoContentResponse>(\n\t\t\t\"/:id/notarization\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,8 +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 { IImmutableProofComponent, IImmutableProofVerification } from "@twin.org/immutable-proof-models";
|
|
5
|
-
import type { IDidVerifiableCredential } from "@twin.org/standards-w3c-did";
|
|
4
|
+
import type { IImmutableProofComponent, IImmutableProofCredential, IImmutableProofVerification } from "@twin.org/immutable-proof-models";
|
|
6
5
|
/**
|
|
7
6
|
* Client for performing immutable proof through to REST endpoints.
|
|
8
7
|
*/
|
|
@@ -12,7 +11,7 @@ export declare class ImmutableProofRestClient extends BaseRestClient implements
|
|
|
12
11
|
*/
|
|
13
12
|
static readonly CLASS_NAME: string;
|
|
14
13
|
/**
|
|
15
|
-
*
|
|
14
|
+
* Creates an instance of ImmutableProofRestClient.
|
|
16
15
|
* @param config The configuration for the client.
|
|
17
16
|
*/
|
|
18
17
|
constructor(config: IBaseRestClientConfig);
|
|
@@ -24,16 +23,20 @@ export declare class ImmutableProofRestClient extends BaseRestClient implements
|
|
|
24
23
|
/**
|
|
25
24
|
* Create a new proof.
|
|
26
25
|
* @param document The document to create the proof for.
|
|
26
|
+
* @param options Optional settings for the proof.
|
|
27
|
+
* @param options.deleteLock An ISO 8601 date-time string specifying when the notarization lock expires; if omitted no lock is applied.
|
|
27
28
|
* @returns The id of the new proof.
|
|
28
29
|
*/
|
|
29
|
-
create(document: IJsonLdNodeObject
|
|
30
|
+
create(document: IJsonLdNodeObject, options?: {
|
|
31
|
+
deleteLock?: string;
|
|
32
|
+
}): Promise<string>;
|
|
30
33
|
/**
|
|
31
34
|
* Get a proof.
|
|
32
35
|
* @param id The id of the proof to get.
|
|
33
36
|
* @returns The proof.
|
|
34
37
|
* @throws NotFoundError if the proof is not found.
|
|
35
38
|
*/
|
|
36
|
-
get(id: string): Promise<
|
|
39
|
+
get(id: string): Promise<IImmutableProofCredential>;
|
|
37
40
|
/**
|
|
38
41
|
* Verify a proof.
|
|
39
42
|
* @param id The id of the proof to verify.
|
|
@@ -42,10 +45,17 @@ export declare class ImmutableProofRestClient extends BaseRestClient implements
|
|
|
42
45
|
*/
|
|
43
46
|
verify(id: string): Promise<IImmutableProofVerification>;
|
|
44
47
|
/**
|
|
45
|
-
* Remove the
|
|
46
|
-
* @param id The id of the proof to remove
|
|
47
|
-
* @returns
|
|
48
|
+
* Remove the proof and its notarization.
|
|
49
|
+
* @param id The id of the proof to remove.
|
|
50
|
+
* @returns A promise that resolves when the proof and its notarization have been removed.
|
|
48
51
|
* @throws NotFoundError if the proof is not found.
|
|
49
52
|
*/
|
|
50
|
-
|
|
53
|
+
remove(id: string): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Remove only the notarization for the proof, keeping the proof entity.
|
|
56
|
+
* @param id The id of the proof to remove the notarization from.
|
|
57
|
+
* @returns A promise that resolves when the notarization has been removed.
|
|
58
|
+
* @throws NotFoundError if the proof is not found.
|
|
59
|
+
*/
|
|
60
|
+
removeNotarization(id: string): Promise<void>;
|
|
51
61
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,11 +1,169 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0
|
|
3
|
+
## [0.9.0-next.1](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.9.0-next.0...immutable-proof-rest-client-v0.9.0-next.1) (2026-06-24)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
*
|
|
8
|
+
* add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
|
|
9
|
+
* add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
10
|
+
* eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
11
|
+
* immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
|
|
12
|
+
* replace verifiable storage with notarization as immutable proof ([#41](https://github.com/iotaledger/twin-immutable-proof/issues/41)) ([54f2154](https://github.com/iotaledger/twin-immutable-proof/commit/54f215469b0bdc9ea94cad572ca13b8533144104))
|
|
13
|
+
* typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
|
|
14
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
15
|
+
* update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
16
|
+
* update remove methods ([#45](https://github.com/iotaledger/twin-immutable-proof/issues/45)) ([9db19bb](https://github.com/iotaledger/twin-immutable-proof/commit/9db19bb4c8e6f5d66139755e8b8a8071a77c4887))
|
|
17
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Dependencies
|
|
21
|
+
|
|
22
|
+
* The following workspace dependencies were updated
|
|
23
|
+
* dependencies
|
|
24
|
+
* @twin.org/immutable-proof-models bumped from 0.9.0-next.0 to 0.9.0-next.1
|
|
25
|
+
|
|
26
|
+
## [0.0.3-next.17](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.16...immutable-proof-rest-client-v0.0.3-next.17) (2026-06-11)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Miscellaneous Chores
|
|
30
|
+
|
|
31
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* dependencies
|
|
38
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.16 to 0.0.3-next.17
|
|
39
|
+
|
|
40
|
+
## [0.0.3-next.16](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.15...immutable-proof-rest-client-v0.0.3-next.16) (2026-05-29)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Features
|
|
44
|
+
|
|
45
|
+
* add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
|
|
46
|
+
* add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
47
|
+
* eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
48
|
+
* immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
|
|
49
|
+
* replace verifiable storage with notarization as immutable proof ([#41](https://github.com/iotaledger/twin-immutable-proof/issues/41)) ([54f2154](https://github.com/iotaledger/twin-immutable-proof/commit/54f215469b0bdc9ea94cad572ca13b8533144104))
|
|
50
|
+
* typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
|
|
51
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
52
|
+
* update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
53
|
+
* update remove methods ([#45](https://github.com/iotaledger/twin-immutable-proof/issues/45)) ([9db19bb](https://github.com/iotaledger/twin-immutable-proof/commit/9db19bb4c8e6f5d66139755e8b8a8071a77c4887))
|
|
54
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Dependencies
|
|
58
|
+
|
|
59
|
+
* The following workspace dependencies were updated
|
|
60
|
+
* dependencies
|
|
61
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.15 to 0.0.3-next.16
|
|
62
|
+
|
|
63
|
+
## [0.0.3-next.15](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.14...immutable-proof-rest-client-v0.0.3-next.15) (2026-05-29)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* update remove methods ([#45](https://github.com/iotaledger/twin-immutable-proof/issues/45)) ([9db19bb](https://github.com/iotaledger/twin-immutable-proof/commit/9db19bb4c8e6f5d66139755e8b8a8071a77c4887))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Dependencies
|
|
72
|
+
|
|
73
|
+
* The following workspace dependencies were updated
|
|
74
|
+
* dependencies
|
|
75
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.14 to 0.0.3-next.15
|
|
76
|
+
|
|
77
|
+
## [0.0.3-next.14](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.13...immutable-proof-rest-client-v0.0.3-next.14) (2026-05-28)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* replace verifiable storage with notarization as immutable proof ([#41](https://github.com/iotaledger/twin-immutable-proof/issues/41)) ([54f2154](https://github.com/iotaledger/twin-immutable-proof/commit/54f215469b0bdc9ea94cad572ca13b8533144104))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Dependencies
|
|
86
|
+
|
|
87
|
+
* The following workspace dependencies were updated
|
|
88
|
+
* dependencies
|
|
89
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
90
|
+
|
|
91
|
+
## [0.0.3-next.13](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.12...immutable-proof-rest-client-v0.0.3-next.13) (2026-05-20)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Miscellaneous Chores
|
|
95
|
+
|
|
96
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Dependencies
|
|
100
|
+
|
|
101
|
+
* The following workspace dependencies were updated
|
|
102
|
+
* dependencies
|
|
103
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.12 to 0.0.3-next.13
|
|
104
|
+
|
|
105
|
+
## [0.0.3-next.12](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.11...immutable-proof-rest-client-v0.0.3-next.12) (2026-05-12)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Features
|
|
109
|
+
|
|
110
|
+
* typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### Dependencies
|
|
114
|
+
|
|
115
|
+
* The following workspace dependencies were updated
|
|
116
|
+
* dependencies
|
|
117
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.11 to 0.0.3-next.12
|
|
118
|
+
|
|
119
|
+
## [0.0.3-next.11](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.10...immutable-proof-rest-client-v0.0.3-next.11) (2026-03-25)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Miscellaneous Chores
|
|
123
|
+
|
|
124
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Dependencies
|
|
128
|
+
|
|
129
|
+
* The following workspace dependencies were updated
|
|
130
|
+
* dependencies
|
|
131
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
132
|
+
|
|
133
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.9...immutable-proof-rest-client-v0.0.3-next.10) (2026-02-25)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Miscellaneous Chores
|
|
137
|
+
|
|
138
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### Dependencies
|
|
142
|
+
|
|
143
|
+
* The following workspace dependencies were updated
|
|
144
|
+
* dependencies
|
|
145
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
146
|
+
|
|
147
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.8...immutable-proof-rest-client-v0.0.3-next.9) (2026-02-13)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Miscellaneous Chores
|
|
151
|
+
|
|
152
|
+
* **immutable-proof-rest-client:** Synchronize repo versions
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Dependencies
|
|
156
|
+
|
|
157
|
+
* The following workspace dependencies were updated
|
|
158
|
+
* dependencies
|
|
159
|
+
* @twin.org/immutable-proof-models bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
160
|
+
|
|
161
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.7...immutable-proof-rest-client-v0.0.3-next.8) (2026-02-10)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Features
|
|
165
|
+
|
|
166
|
+
* immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
|
|
9
167
|
|
|
10
168
|
|
|
11
169
|
### Dependencies
|
|
@@ -14,7 +172,7 @@
|
|
|
14
172
|
* dependencies
|
|
15
173
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
16
174
|
|
|
17
|
-
## [0.0.3-next.7](https://github.com/
|
|
175
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.6...immutable-proof-rest-client-v0.0.3-next.7) (2026-02-05)
|
|
18
176
|
|
|
19
177
|
|
|
20
178
|
### Miscellaneous Chores
|
|
@@ -28,7 +186,7 @@
|
|
|
28
186
|
* dependencies
|
|
29
187
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
30
188
|
|
|
31
|
-
## [0.0.3-next.6](https://github.com/
|
|
189
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.5...immutable-proof-rest-client-v0.0.3-next.6) (2026-01-21)
|
|
32
190
|
|
|
33
191
|
|
|
34
192
|
### Miscellaneous Chores
|
|
@@ -42,7 +200,7 @@
|
|
|
42
200
|
* dependencies
|
|
43
201
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
44
202
|
|
|
45
|
-
## [0.0.3-next.5](https://github.com/
|
|
203
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.4...immutable-proof-rest-client-v0.0.3-next.5) (2026-01-14)
|
|
46
204
|
|
|
47
205
|
|
|
48
206
|
### Miscellaneous Chores
|
|
@@ -56,7 +214,7 @@
|
|
|
56
214
|
* dependencies
|
|
57
215
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
58
216
|
|
|
59
|
-
## [0.0.3-next.4](https://github.com/
|
|
217
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.3...immutable-proof-rest-client-v0.0.3-next.4) (2026-01-07)
|
|
60
218
|
|
|
61
219
|
|
|
62
220
|
### Miscellaneous Chores
|
|
@@ -70,7 +228,7 @@
|
|
|
70
228
|
* dependencies
|
|
71
229
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
72
230
|
|
|
73
|
-
## [0.0.3-next.3](https://github.com/
|
|
231
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.2...immutable-proof-rest-client-v0.0.3-next.3) (2025-11-28)
|
|
74
232
|
|
|
75
233
|
|
|
76
234
|
### Miscellaneous Chores
|
|
@@ -84,7 +242,7 @@
|
|
|
84
242
|
* dependencies
|
|
85
243
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
86
244
|
|
|
87
|
-
## [0.0.3-next.2](https://github.com/
|
|
245
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.1...immutable-proof-rest-client-v0.0.3-next.2) (2025-11-28)
|
|
88
246
|
|
|
89
247
|
|
|
90
248
|
### Miscellaneous Chores
|
|
@@ -98,17 +256,17 @@
|
|
|
98
256
|
* dependencies
|
|
99
257
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
100
258
|
|
|
101
|
-
## [0.0.3-next.1](https://github.com/
|
|
259
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.0...immutable-proof-rest-client-v0.0.3-next.1) (2025-11-12)
|
|
102
260
|
|
|
103
261
|
|
|
104
262
|
### Features
|
|
105
263
|
|
|
106
|
-
* add context id features ([#14](https://github.com/
|
|
107
|
-
* add validate-locales ([d6a7c07](https://github.com/
|
|
108
|
-
* eslint migration to flat config ([c8536f2](https://github.com/
|
|
109
|
-
* update dependencies ([7d6b321](https://github.com/
|
|
110
|
-
* update framework core ([e708d4d](https://github.com/
|
|
111
|
-
* use shared store mechanism ([#3](https://github.com/
|
|
264
|
+
* add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
|
|
265
|
+
* add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
266
|
+
* eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
267
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
268
|
+
* update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
269
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
112
270
|
|
|
113
271
|
|
|
114
272
|
### Dependencies
|
|
@@ -117,12 +275,12 @@
|
|
|
117
275
|
* dependencies
|
|
118
276
|
* @twin.org/immutable-proof-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
119
277
|
|
|
120
|
-
## [0.0.2-next.3](https://github.com/
|
|
278
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.2...immutable-proof-rest-client-v0.0.2-next.3) (2025-10-09)
|
|
121
279
|
|
|
122
280
|
|
|
123
281
|
### Features
|
|
124
282
|
|
|
125
|
-
* add validate-locales ([d6a7c07](https://github.com/
|
|
283
|
+
* add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
126
284
|
|
|
127
285
|
|
|
128
286
|
### Dependencies
|
|
@@ -131,12 +289,12 @@
|
|
|
131
289
|
* dependencies
|
|
132
290
|
* @twin.org/immutable-proof-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
133
291
|
|
|
134
|
-
## [0.0.2-next.2](https://github.com/
|
|
292
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.1...immutable-proof-rest-client-v0.0.2-next.2) (2025-08-29)
|
|
135
293
|
|
|
136
294
|
|
|
137
295
|
### Features
|
|
138
296
|
|
|
139
|
-
* eslint migration to flat config ([c8536f2](https://github.com/
|
|
297
|
+
* eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
140
298
|
|
|
141
299
|
|
|
142
300
|
### Dependencies
|
|
@@ -145,14 +303,14 @@
|
|
|
145
303
|
* dependencies
|
|
146
304
|
* @twin.org/immutable-proof-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
147
305
|
|
|
148
|
-
## [0.0.2-next.1](https://github.com/
|
|
306
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.0...immutable-proof-rest-client-v0.0.2-next.1) (2025-08-20)
|
|
149
307
|
|
|
150
308
|
|
|
151
309
|
### Features
|
|
152
310
|
|
|
153
|
-
* update dependencies ([7d6b321](https://github.com/
|
|
154
|
-
* update framework core ([e708d4d](https://github.com/
|
|
155
|
-
* use shared store mechanism ([#3](https://github.com/
|
|
311
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
312
|
+
* update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
313
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
156
314
|
|
|
157
315
|
|
|
158
316
|
### Dependencies
|
|
@@ -166,7 +324,7 @@
|
|
|
166
324
|
|
|
167
325
|
### Features
|
|
168
326
|
|
|
169
|
-
* release to production ([cb7ecff](https://github.com/
|
|
327
|
+
* release to production ([cb7ecff](https://github.com/iotaledger/twin-immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
|
|
170
328
|
|
|
171
329
|
|
|
172
330
|
### Dependencies
|
|
@@ -175,12 +333,12 @@
|
|
|
175
333
|
* dependencies
|
|
176
334
|
* @twin.org/immutable-proof-models bumped from ^0.0.0 to ^0.0.1
|
|
177
335
|
|
|
178
|
-
## [0.0.1-next.35](https://github.com/
|
|
336
|
+
## [0.0.1-next.35](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.34...immutable-proof-rest-client-v0.0.1-next.35) (2025-06-12)
|
|
179
337
|
|
|
180
338
|
|
|
181
339
|
### Features
|
|
182
340
|
|
|
183
|
-
* update dependencies ([7d6b321](https://github.com/
|
|
341
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
184
342
|
|
|
185
343
|
|
|
186
344
|
### Dependencies
|
|
@@ -189,7 +347,7 @@
|
|
|
189
347
|
* dependencies
|
|
190
348
|
* @twin.org/immutable-proof-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
191
349
|
|
|
192
|
-
## [0.0.1-next.34](https://github.com/
|
|
350
|
+
## [0.0.1-next.34](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.33...immutable-proof-rest-client-v0.0.1-next.34) (2025-06-03)
|
|
193
351
|
|
|
194
352
|
|
|
195
353
|
### Miscellaneous Chores
|
|
@@ -203,7 +361,7 @@
|
|
|
203
361
|
* dependencies
|
|
204
362
|
* @twin.org/immutable-proof-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
205
363
|
|
|
206
|
-
## [0.0.1-next.33](https://github.com/
|
|
364
|
+
## [0.0.1-next.33](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.32...immutable-proof-rest-client-v0.0.1-next.33) (2025-05-28)
|
|
207
365
|
|
|
208
366
|
|
|
209
367
|
### Miscellaneous Chores
|
|
@@ -217,12 +375,12 @@
|
|
|
217
375
|
* dependencies
|
|
218
376
|
* @twin.org/immutable-proof-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
219
377
|
|
|
220
|
-
## [0.0.1-next.32](https://github.com/
|
|
378
|
+
## [0.0.1-next.32](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.31...immutable-proof-rest-client-v0.0.1-next.32) (2025-04-17)
|
|
221
379
|
|
|
222
380
|
|
|
223
381
|
### Features
|
|
224
382
|
|
|
225
|
-
* use shared store mechanism ([#3](https://github.com/
|
|
383
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
226
384
|
|
|
227
385
|
|
|
228
386
|
### Dependencies
|
|
@@ -231,7 +389,7 @@
|
|
|
231
389
|
* dependencies
|
|
232
390
|
* @twin.org/immutable-proof-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
233
391
|
|
|
234
|
-
## [0.0.1-next.31](https://github.com/
|
|
392
|
+
## [0.0.1-next.31](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.30...immutable-proof-rest-client-v0.0.1-next.31) (2025-03-28)
|
|
235
393
|
|
|
236
394
|
|
|
237
395
|
### Miscellaneous Chores
|
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
|
+
```
|
|
@@ -16,7 +16,7 @@ Client for performing immutable proof through to REST endpoints.
|
|
|
16
16
|
|
|
17
17
|
> **new ImmutableProofRestClient**(`config`): `ImmutableProofRestClient`
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Creates an instance of ImmutableProofRestClient.
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
@@ -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,9 +62,9 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### create()
|
|
65
|
+
### create() {#create}
|
|
66
66
|
|
|
67
|
-
> **create**(`document`): `Promise`\<`string`\>
|
|
67
|
+
> **create**(`document`, `options?`): `Promise`\<`string`\>
|
|
68
68
|
|
|
69
69
|
Create a new proof.
|
|
70
70
|
|
|
@@ -76,6 +76,16 @@ Create a new proof.
|
|
|
76
76
|
|
|
77
77
|
The document to create the proof for.
|
|
78
78
|
|
|
79
|
+
##### options?
|
|
80
|
+
|
|
81
|
+
Optional settings for the proof.
|
|
82
|
+
|
|
83
|
+
###### deleteLock?
|
|
84
|
+
|
|
85
|
+
`string`
|
|
86
|
+
|
|
87
|
+
An ISO 8601 date-time string specifying when the notarization lock expires; if omitted no lock is applied.
|
|
88
|
+
|
|
79
89
|
#### Returns
|
|
80
90
|
|
|
81
91
|
`Promise`\<`string`\>
|
|
@@ -88,9 +98,9 @@ The id of the new proof.
|
|
|
88
98
|
|
|
89
99
|
***
|
|
90
100
|
|
|
91
|
-
### get()
|
|
101
|
+
### get() {#get}
|
|
92
102
|
|
|
93
|
-
> **get**(`id`): `Promise`\<`
|
|
103
|
+
> **get**(`id`): `Promise`\<`IImmutableProofCredential`\>
|
|
94
104
|
|
|
95
105
|
Get a proof.
|
|
96
106
|
|
|
@@ -104,7 +114,7 @@ The id of the proof to get.
|
|
|
104
114
|
|
|
105
115
|
#### Returns
|
|
106
116
|
|
|
107
|
-
`Promise`\<`
|
|
117
|
+
`Promise`\<`IImmutableProofCredential`\>
|
|
108
118
|
|
|
109
119
|
The proof.
|
|
110
120
|
|
|
@@ -118,7 +128,7 @@ NotFoundError if the proof is not found.
|
|
|
118
128
|
|
|
119
129
|
***
|
|
120
130
|
|
|
121
|
-
### verify()
|
|
131
|
+
### verify() {#verify}
|
|
122
132
|
|
|
123
133
|
> **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
|
|
124
134
|
|
|
@@ -148,11 +158,41 @@ NotFoundError if the proof is not found.
|
|
|
148
158
|
|
|
149
159
|
***
|
|
150
160
|
|
|
151
|
-
###
|
|
161
|
+
### remove() {#remove}
|
|
162
|
+
|
|
163
|
+
> **remove**(`id`): `Promise`\<`void`\>
|
|
164
|
+
|
|
165
|
+
Remove the proof and its notarization.
|
|
166
|
+
|
|
167
|
+
#### Parameters
|
|
168
|
+
|
|
169
|
+
##### id
|
|
170
|
+
|
|
171
|
+
`string`
|
|
172
|
+
|
|
173
|
+
The id of the proof to remove.
|
|
174
|
+
|
|
175
|
+
#### Returns
|
|
176
|
+
|
|
177
|
+
`Promise`\<`void`\>
|
|
178
|
+
|
|
179
|
+
A promise that resolves when the proof and its notarization have been removed.
|
|
180
|
+
|
|
181
|
+
#### Throws
|
|
182
|
+
|
|
183
|
+
NotFoundError if the proof is not found.
|
|
184
|
+
|
|
185
|
+
#### Implementation of
|
|
186
|
+
|
|
187
|
+
`IImmutableProofComponent.remove`
|
|
188
|
+
|
|
189
|
+
***
|
|
190
|
+
|
|
191
|
+
### removeNotarization() {#removenotarization}
|
|
152
192
|
|
|
153
|
-
> **
|
|
193
|
+
> **removeNotarization**(`id`): `Promise`\<`void`\>
|
|
154
194
|
|
|
155
|
-
Remove the
|
|
195
|
+
Remove only the notarization for the proof, keeping the proof entity.
|
|
156
196
|
|
|
157
197
|
#### Parameters
|
|
158
198
|
|
|
@@ -160,13 +200,13 @@ Remove the verifiable storage for the proof.
|
|
|
160
200
|
|
|
161
201
|
`string`
|
|
162
202
|
|
|
163
|
-
The id of the proof to remove the
|
|
203
|
+
The id of the proof to remove the notarization from.
|
|
164
204
|
|
|
165
205
|
#### Returns
|
|
166
206
|
|
|
167
207
|
`Promise`\<`void`\>
|
|
168
208
|
|
|
169
|
-
|
|
209
|
+
A promise that resolves when the notarization has been removed.
|
|
170
210
|
|
|
171
211
|
#### Throws
|
|
172
212
|
|
|
@@ -174,4 +214,4 @@ NotFoundError if the proof is not found.
|
|
|
174
214
|
|
|
175
215
|
#### Implementation of
|
|
176
216
|
|
|
177
|
-
`IImmutableProofComponent.
|
|
217
|
+
`IImmutableProofComponent.removeNotarization`
|
package/locales/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-rest-client",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.0-next.1",
|
|
4
|
+
"description": "HTTP client for calling immutable proof service endpoints from external components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/twin-immutable-proof.git",
|
|
8
8
|
"directory": "packages/immutable-proof-rest-client"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-core": "next",
|
|
18
|
-
"@twin.org/api-models": "next",
|
|
19
|
-
"@twin.org/core": "next",
|
|
20
|
-
"@twin.org/data-json-ld": "next",
|
|
21
|
-
"@twin.org/entity": "next",
|
|
22
|
-
"@twin.org/immutable-proof-models": "0.0
|
|
23
|
-
"@twin.org/nameof": "next",
|
|
24
|
-
"@twin.org/web": "next"
|
|
17
|
+
"@twin.org/api-core": "0.9.0-next.1",
|
|
18
|
+
"@twin.org/api-models": "0.9.0-next.1",
|
|
19
|
+
"@twin.org/core": "0.9.0-next.1",
|
|
20
|
+
"@twin.org/data-json-ld": "0.9.0-next.1",
|
|
21
|
+
"@twin.org/entity": "0.9.0-next.1",
|
|
22
|
+
"@twin.org/immutable-proof-models": "0.9.0-next.1",
|
|
23
|
+
"@twin.org/nameof": "0.9.0-next.1",
|
|
24
|
+
"@twin.org/web": "0.9.0-next.1"
|
|
25
25
|
},
|
|
26
26
|
"main": "./dist/es/index.js",
|
|
27
27
|
"types": "./dist/types/index.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"immutable-proof"
|
|
49
49
|
],
|
|
50
50
|
"bugs": {
|
|
51
|
-
"url": "git+https://github.com/
|
|
51
|
+
"url": "git+https://github.com/iotaledger/twin-immutable-proof/issues"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://twindev.org"
|
|
54
54
|
}
|