@twin.org/immutable-proof-rest-client 0.0.3-next.9 → 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 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,150 @@
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-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
+
5
+
6
+ ### Features
7
+
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)
4
148
 
5
149
 
6
150
  ### Miscellaneous Chores
@@ -14,12 +158,12 @@
14
158
  * dependencies
15
159
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.8 to 0.0.3-next.9
16
160
 
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)
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)
18
162
 
19
163
 
20
164
  ### Features
21
165
 
22
- * immutable proof as vc ([#31](https://github.com/twinfoundation/immutable-proof/issues/31)) ([79cdb03](https://github.com/twinfoundation/immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
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))
23
167
 
24
168
 
25
169
  ### Dependencies
@@ -28,7 +172,7 @@
28
172
  * dependencies
29
173
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.7 to 0.0.3-next.8
30
174
 
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)
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)
32
176
 
33
177
 
34
178
  ### Miscellaneous Chores
@@ -42,7 +186,7 @@
42
186
  * dependencies
43
187
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.6 to 0.0.3-next.7
44
188
 
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)
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)
46
190
 
47
191
 
48
192
  ### Miscellaneous Chores
@@ -56,7 +200,7 @@
56
200
  * dependencies
57
201
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.5 to 0.0.3-next.6
58
202
 
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)
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)
60
204
 
61
205
 
62
206
  ### Miscellaneous Chores
@@ -70,7 +214,7 @@
70
214
  * dependencies
71
215
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.4 to 0.0.3-next.5
72
216
 
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)
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)
74
218
 
75
219
 
76
220
  ### Miscellaneous Chores
@@ -84,7 +228,7 @@
84
228
  * dependencies
85
229
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.3 to 0.0.3-next.4
86
230
 
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)
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)
88
232
 
89
233
 
90
234
  ### Miscellaneous Chores
@@ -98,7 +242,7 @@
98
242
  * dependencies
99
243
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.2 to 0.0.3-next.3
100
244
 
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)
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)
102
246
 
103
247
 
104
248
  ### Miscellaneous Chores
@@ -112,17 +256,17 @@
112
256
  * dependencies
113
257
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.1 to 0.0.3-next.2
114
258
 
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)
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)
116
260
 
117
261
 
118
262
  ### Features
119
263
 
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))
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))
126
270
 
127
271
 
128
272
  ### Dependencies
@@ -131,12 +275,12 @@
131
275
  * dependencies
132
276
  * @twin.org/immutable-proof-models bumped from 0.0.3-next.0 to 0.0.3-next.1
133
277
 
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)
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)
135
279
 
136
280
 
137
281
  ### Features
138
282
 
139
- * add validate-locales ([d6a7c07](https://github.com/twinfoundation/immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
283
+ * add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
140
284
 
141
285
 
142
286
  ### Dependencies
@@ -145,12 +289,12 @@
145
289
  * dependencies
146
290
  * @twin.org/immutable-proof-models bumped from 0.0.2-next.2 to 0.0.2-next.3
147
291
 
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)
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)
149
293
 
150
294
 
151
295
  ### Features
152
296
 
153
- * eslint migration to flat config ([c8536f2](https://github.com/twinfoundation/immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
297
+ * eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
154
298
 
155
299
 
156
300
  ### Dependencies
@@ -159,14 +303,14 @@
159
303
  * dependencies
160
304
  * @twin.org/immutable-proof-models bumped from 0.0.2-next.1 to 0.0.2-next.2
161
305
 
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)
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)
163
307
 
164
308
 
165
309
  ### Features
166
310
 
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))
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))
170
314
 
171
315
 
172
316
  ### Dependencies
@@ -180,7 +324,7 @@
180
324
 
181
325
  ### Features
182
326
 
183
- * release to production ([cb7ecff](https://github.com/twinfoundation/immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
327
+ * release to production ([cb7ecff](https://github.com/iotaledger/twin-immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
184
328
 
185
329
 
186
330
  ### Dependencies
@@ -189,12 +333,12 @@
189
333
  * dependencies
190
334
  * @twin.org/immutable-proof-models bumped from ^0.0.0 to ^0.0.1
191
335
 
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)
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)
193
337
 
194
338
 
195
339
  ### Features
196
340
 
197
- * update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
341
+ * update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
198
342
 
199
343
 
200
344
  ### Dependencies
@@ -203,7 +347,7 @@
203
347
  * dependencies
204
348
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.34 to 0.0.1-next.35
205
349
 
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)
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)
207
351
 
208
352
 
209
353
  ### Miscellaneous Chores
@@ -217,7 +361,7 @@
217
361
  * dependencies
218
362
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.33 to 0.0.1-next.34
219
363
 
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)
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)
221
365
 
222
366
 
223
367
  ### Miscellaneous Chores
@@ -231,12 +375,12 @@
231
375
  * dependencies
232
376
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.32 to 0.0.1-next.33
233
377
 
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)
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)
235
379
 
236
380
 
237
381
  ### Features
238
382
 
239
- * use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
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))
240
384
 
241
385
 
242
386
  ### Dependencies
@@ -245,7 +389,7 @@
245
389
  * dependencies
246
390
  * @twin.org/immutable-proof-models bumped from 0.0.1-next.31 to 0.0.1-next.32
247
391
 
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)
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)
249
393
 
250
394
 
251
395
  ### 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-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/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-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/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
  }