@twin.org/immutable-proof-rest-client 0.0.3-next.9 → 0.9.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # TWIN Immutable Proof REST Client
2
2
 
3
- Immutable Proof contract implementation which can connect to REST endpoints.
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, NotSupportedError } from "@twin.org/core";
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
- * Create a new instance of ImmutableProofRestClient.
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 verifiable storage for the proof.
80
- * @param id The id of the proof to remove the storage from.
81
- * @returns Nothing.
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 removeVerifiable(id) {
85
- throw new NotSupportedError(ImmutableProofRestClient.CLASS_NAME, "notSupportedOnClient", {
86
- methodName: "removeVerifiable"
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;AAEpD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAa3D,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;;;;OAIG;IACI,KAAK,CAAC,MAAM,CAAC,QAA2B;QAC9C,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;aACR;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,gBAAgB,CAAC,EAAU;QACvC,MAAM,IAAI,iBAAiB,CAAC,wBAAwB,CAAC,UAAU,EAAE,sBAAsB,EAAE;YACxF,UAAU,EAAE,kBAAkB;SAC9B,CAAC,CAAC;IACJ,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig, ICreatedResponse } from \"@twin.org/api-models\";\nimport { Guards, NotSupportedError } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tIImmutableProofComponent,\n\tIImmutableProofCreateRequest,\n\tIImmutableProofGetRequest,\n\tIImmutableProofGetResponse,\n\tIImmutableProofVerification,\n\tIImmutableProofVerifyRequest,\n\tIImmutableProofVerifyResponse\n} from \"@twin.org/immutable-proof-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IDidVerifiableCredential } from \"@twin.org/standards-w3c-did\";\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 * Create a new 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 * @returns The id of the new proof.\n\t */\n\tpublic async create(document: IJsonLdNodeObject): 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}\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<IDidVerifiableCredential> {\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 verifiable storage for the proof.\n\t * @param id The id of the proof to remove the storage from.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tpublic async removeVerifiable(id: string): Promise<void> {\n\t\tthrow new NotSupportedError(ImmutableProofRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"removeVerifiable\"\n\t\t});\n\t}\n}\n"]}
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
- * Create a new instance of ImmutableProofRestClient.
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): Promise<string>;
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<IDidVerifiableCredential>;
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 verifiable storage for the proof.
46
- * @param id The id of the proof to remove the storage from.
47
- * @returns Nothing.
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
- removeVerifiable(id: string): Promise<void>;
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,6 +1,158 @@
1
- # @twin.org/immutable-proof-rest-client - Changelog
1
+ # Changelog
2
2
 
3
- ## [0.0.3-next.9](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.8...immutable-proof-rest-client-v0.0.3-next.9) (2026-02-13)
3
+ ## [0.9.0](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-rest-client-v0.9.0...immutable-proof-rest-client-v0.9.0) (2026-06-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * release to production ([cb7ecff](https://github.com/iotaledger/twin-immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
9
+ * release to production ([#58](https://github.com/iotaledger/twin-immutable-proof/issues/58)) ([e1d8c04](https://github.com/iotaledger/twin-immutable-proof/commit/e1d8c04c4d2c764980ed44b320c3ce6218c9b70b))
10
+
11
+ ## [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)
12
+
13
+
14
+ ### Features
15
+
16
+ * add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
17
+ * add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
18
+ * eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
19
+ * immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
20
+ * 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))
21
+ * typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
22
+ * update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
23
+ * update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
24
+ * update remove methods ([#45](https://github.com/iotaledger/twin-immutable-proof/issues/45)) ([9db19bb](https://github.com/iotaledger/twin-immutable-proof/commit/9db19bb4c8e6f5d66139755e8b8a8071a77c4887))
25
+ * use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
26
+
27
+
28
+ ### Dependencies
29
+
30
+ * The following workspace dependencies were updated
31
+ * dependencies
32
+ * @twin.org/immutable-proof-models bumped from 0.9.0-next.0 to 0.9.0-next.1
33
+
34
+ ## [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)
35
+
36
+
37
+ ### Miscellaneous Chores
38
+
39
+ * **immutable-proof-rest-client:** Synchronize repo versions
40
+
41
+
42
+ ### Dependencies
43
+
44
+ * The following workspace dependencies were updated
45
+ * dependencies
46
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.16 to 0.0.3-next.17
47
+
48
+ ## [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)
49
+
50
+
51
+ ### Features
52
+
53
+ * add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
54
+ * add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
55
+ * eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
56
+ * immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
57
+ * 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))
58
+ * typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
59
+ * update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
60
+ * update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
61
+ * update remove methods ([#45](https://github.com/iotaledger/twin-immutable-proof/issues/45)) ([9db19bb](https://github.com/iotaledger/twin-immutable-proof/commit/9db19bb4c8e6f5d66139755e8b8a8071a77c4887))
62
+ * use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
63
+
64
+
65
+ ### Dependencies
66
+
67
+ * The following workspace dependencies were updated
68
+ * dependencies
69
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.15 to 0.0.3-next.16
70
+
71
+ ## [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)
72
+
73
+
74
+ ### Features
75
+
76
+ * update remove methods ([#45](https://github.com/iotaledger/twin-immutable-proof/issues/45)) ([9db19bb](https://github.com/iotaledger/twin-immutable-proof/commit/9db19bb4c8e6f5d66139755e8b8a8071a77c4887))
77
+
78
+
79
+ ### Dependencies
80
+
81
+ * The following workspace dependencies were updated
82
+ * dependencies
83
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.14 to 0.0.3-next.15
84
+
85
+ ## [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)
86
+
87
+
88
+ ### Features
89
+
90
+ * 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))
91
+
92
+
93
+ ### Dependencies
94
+
95
+ * The following workspace dependencies were updated
96
+ * dependencies
97
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.13 to 0.0.3-next.14
98
+
99
+ ## [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)
100
+
101
+
102
+ ### Miscellaneous Chores
103
+
104
+ * **immutable-proof-rest-client:** Synchronize repo versions
105
+
106
+
107
+ ### Dependencies
108
+
109
+ * The following workspace dependencies were updated
110
+ * dependencies
111
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.12 to 0.0.3-next.13
112
+
113
+ ## [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)
114
+
115
+
116
+ ### Features
117
+
118
+ * typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
119
+
120
+
121
+ ### Dependencies
122
+
123
+ * The following workspace dependencies were updated
124
+ * dependencies
125
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.11 to 0.0.3-next.12
126
+
127
+ ## [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)
128
+
129
+
130
+ ### Miscellaneous Chores
131
+
132
+ * **immutable-proof-rest-client:** Synchronize repo versions
133
+
134
+
135
+ ### Dependencies
136
+
137
+ * The following workspace dependencies were updated
138
+ * dependencies
139
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.10 to 0.0.3-next.11
140
+
141
+ ## [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)
142
+
143
+
144
+ ### Miscellaneous Chores
145
+
146
+ * **immutable-proof-rest-client:** Synchronize repo versions
147
+
148
+
149
+ ### Dependencies
150
+
151
+ * The following workspace dependencies were updated
152
+ * dependencies
153
+ * @twin.org/immutable-proof-models bumped from 0.0.3-next.9 to 0.0.3-next.10
154
+
155
+ ## [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)
4
156
 
5
157
 
6
158
  ### Miscellaneous Chores
@@ -14,12 +166,12 @@
14
166
  * dependencies
15
167
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.8 to 0.0.3-next.9
16
168
 
17
- ## [0.0.3-next.8](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.7...immutable-proof-rest-client-v0.0.3-next.8) (2026-02-10)
169
+ ## [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)
18
170
 
19
171
 
20
172
  ### Features
21
173
 
22
- * immutable proof as vc ([#31](https://github.com/twinfoundation/immutable-proof/issues/31)) ([79cdb03](https://github.com/twinfoundation/immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
174
+ * immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
23
175
 
24
176
 
25
177
  ### Dependencies
@@ -28,7 +180,7 @@
28
180
  * dependencies
29
181
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.7 to 0.0.3-next.8
30
182
 
31
- ## [0.0.3-next.7](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.6...immutable-proof-rest-client-v0.0.3-next.7) (2026-02-05)
183
+ ## [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)
32
184
 
33
185
 
34
186
  ### Miscellaneous Chores
@@ -42,7 +194,7 @@
42
194
  * dependencies
43
195
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.6 to 0.0.3-next.7
44
196
 
45
- ## [0.0.3-next.6](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.5...immutable-proof-rest-client-v0.0.3-next.6) (2026-01-21)
197
+ ## [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)
46
198
 
47
199
 
48
200
  ### Miscellaneous Chores
@@ -56,7 +208,7 @@
56
208
  * dependencies
57
209
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.5 to 0.0.3-next.6
58
210
 
59
- ## [0.0.3-next.5](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.4...immutable-proof-rest-client-v0.0.3-next.5) (2026-01-14)
211
+ ## [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)
60
212
 
61
213
 
62
214
  ### Miscellaneous Chores
@@ -70,7 +222,7 @@
70
222
  * dependencies
71
223
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.4 to 0.0.3-next.5
72
224
 
73
- ## [0.0.3-next.4](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.3...immutable-proof-rest-client-v0.0.3-next.4) (2026-01-07)
225
+ ## [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)
74
226
 
75
227
 
76
228
  ### Miscellaneous Chores
@@ -84,7 +236,7 @@
84
236
  * dependencies
85
237
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.3 to 0.0.3-next.4
86
238
 
87
- ## [0.0.3-next.3](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.2...immutable-proof-rest-client-v0.0.3-next.3) (2025-11-28)
239
+ ## [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)
88
240
 
89
241
 
90
242
  ### Miscellaneous Chores
@@ -98,7 +250,7 @@
98
250
  * dependencies
99
251
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.2 to 0.0.3-next.3
100
252
 
101
- ## [0.0.3-next.2](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.1...immutable-proof-rest-client-v0.0.3-next.2) (2025-11-28)
253
+ ## [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)
102
254
 
103
255
 
104
256
  ### Miscellaneous Chores
@@ -112,17 +264,17 @@
112
264
  * dependencies
113
265
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.1 to 0.0.3-next.2
114
266
 
115
- ## [0.0.3-next.1](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.3-next.0...immutable-proof-rest-client-v0.0.3-next.1) (2025-11-12)
267
+ ## [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)
116
268
 
117
269
 
118
270
  ### Features
119
271
 
120
- * add context id features ([#14](https://github.com/twinfoundation/immutable-proof/issues/14)) ([ed5a594](https://github.com/twinfoundation/immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
121
- * add validate-locales ([d6a7c07](https://github.com/twinfoundation/immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
122
- * eslint migration to flat config ([c8536f2](https://github.com/twinfoundation/immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
123
- * update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
124
- * update framework core ([e708d4d](https://github.com/twinfoundation/immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
125
- * use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
272
+ * add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
273
+ * add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
274
+ * eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
275
+ * update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
276
+ * update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
277
+ * use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
126
278
 
127
279
 
128
280
  ### Dependencies
@@ -131,12 +283,12 @@
131
283
  * dependencies
132
284
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.0 to 0.0.3-next.1
133
285
 
134
- ## [0.0.2-next.3](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.2...immutable-proof-rest-client-v0.0.2-next.3) (2025-10-09)
286
+ ## [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)
135
287
 
136
288
 
137
289
  ### Features
138
290
 
139
- * add validate-locales ([d6a7c07](https://github.com/twinfoundation/immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
291
+ * add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
140
292
 
141
293
 
142
294
  ### Dependencies
@@ -145,12 +297,12 @@
145
297
  * dependencies
146
298
  * @twin.org/immutable-proof-models bumped from 0.0.2-next.2 to 0.0.2-next.3
147
299
 
148
- ## [0.0.2-next.2](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.1...immutable-proof-rest-client-v0.0.2-next.2) (2025-08-29)
300
+ ## [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)
149
301
 
150
302
 
151
303
  ### Features
152
304
 
153
- * eslint migration to flat config ([c8536f2](https://github.com/twinfoundation/immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
305
+ * eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
154
306
 
155
307
 
156
308
  ### Dependencies
@@ -159,14 +311,14 @@
159
311
  * dependencies
160
312
  * @twin.org/immutable-proof-models bumped from 0.0.2-next.1 to 0.0.2-next.2
161
313
 
162
- ## [0.0.2-next.1](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.2-next.0...immutable-proof-rest-client-v0.0.2-next.1) (2025-08-20)
314
+ ## [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)
163
315
 
164
316
 
165
317
  ### Features
166
318
 
167
- * update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
168
- * update framework core ([e708d4d](https://github.com/twinfoundation/immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
169
- * use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
319
+ * update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
320
+ * update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
321
+ * use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
170
322
 
171
323
 
172
324
  ### Dependencies
@@ -180,7 +332,7 @@
180
332
 
181
333
  ### Features
182
334
 
183
- * release to production ([cb7ecff](https://github.com/twinfoundation/immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
335
+ * release to production ([cb7ecff](https://github.com/iotaledger/twin-immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
184
336
 
185
337
 
186
338
  ### Dependencies
@@ -189,12 +341,12 @@
189
341
  * dependencies
190
342
  * @twin.org/immutable-proof-models bumped from ^0.0.0 to ^0.0.1
191
343
 
192
- ## [0.0.1-next.35](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.34...immutable-proof-rest-client-v0.0.1-next.35) (2025-06-12)
344
+ ## [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)
193
345
 
194
346
 
195
347
  ### Features
196
348
 
197
- * update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
349
+ * update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
198
350
 
199
351
 
200
352
  ### Dependencies
@@ -203,7 +355,7 @@
203
355
  * dependencies
204
356
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.34 to 0.0.1-next.35
205
357
 
206
- ## [0.0.1-next.34](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.33...immutable-proof-rest-client-v0.0.1-next.34) (2025-06-03)
358
+ ## [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)
207
359
 
208
360
 
209
361
  ### Miscellaneous Chores
@@ -217,7 +369,7 @@
217
369
  * dependencies
218
370
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.33 to 0.0.1-next.34
219
371
 
220
- ## [0.0.1-next.33](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.32...immutable-proof-rest-client-v0.0.1-next.33) (2025-05-28)
372
+ ## [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)
221
373
 
222
374
 
223
375
  ### Miscellaneous Chores
@@ -231,12 +383,12 @@
231
383
  * dependencies
232
384
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.32 to 0.0.1-next.33
233
385
 
234
- ## [0.0.1-next.32](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.31...immutable-proof-rest-client-v0.0.1-next.32) (2025-04-17)
386
+ ## [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)
235
387
 
236
388
 
237
389
  ### Features
238
390
 
239
- * use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
391
+ * use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
240
392
 
241
393
 
242
394
  ### Dependencies
@@ -245,7 +397,7 @@
245
397
  * dependencies
246
398
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.31 to 0.0.1-next.32
247
399
 
248
- ## [0.0.1-next.31](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-rest-client-v0.0.1-next.30...immutable-proof-rest-client-v0.0.1-next.31) (2025-03-28)
400
+ ## [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)
249
401
 
250
402
 
251
403
  ### Miscellaneous Chores
package/docs/examples.md CHANGED
@@ -1 +1,59 @@
1
- # @twin.org/immutable-proof-rest-client - Examples
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
- Create a new instance of ImmutableProofRestClient.
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`\<`IDidVerifiableCredential`\>
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`\<`IDidVerifiableCredential`\>
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
- ### removeVerifiable()
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
- > **removeVerifiable**(`id`): `Promise`\<`void`\>
193
+ > **removeNotarization**(`id`): `Promise`\<`void`\>
154
194
 
155
- Remove the verifiable storage for the proof.
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 storage from.
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
- Nothing.
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.removeVerifiable`
217
+ `IImmutableProofComponent.removeNotarization`
package/locales/en.json CHANGED
@@ -1,7 +1 @@
1
- {
2
- "error": {
3
- "immutableProofRestClient": {
4
- "notSupportedOnClient": "The method \"{methodName}\" is not supported on the REST client, it can only be used on a server side component"
5
- }
6
- }
7
- }
1
+ {}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/immutable-proof-rest-client",
3
- "version": "0.0.3-next.9",
4
- "description": "Immutable Proof contract implementation which can connect to REST endpoints",
3
+ "version": "0.9.0",
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/twinfoundation/immutable-proof.git",
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.3-next.9",
23
- "@twin.org/nameof": "next",
24
- "@twin.org/web": "next"
17
+ "@twin.org/api-core": "^0.9.0",
18
+ "@twin.org/api-models": "^0.9.0",
19
+ "@twin.org/core": "^0.9.0",
20
+ "@twin.org/data-json-ld": "^0.9.0",
21
+ "@twin.org/entity": "^0.9.0",
22
+ "@twin.org/immutable-proof-models": "^0.9.0",
23
+ "@twin.org/nameof": "^0.9.0",
24
+ "@twin.org/web": "^0.9.0"
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/twinfoundation/immutable-proof/issues"
51
+ "url": "git+https://github.com/iotaledger/twin-immutable-proof/issues"
52
52
  },
53
53
  "homepage": "https://twindev.org"
54
54
  }