@twin.org/immutable-proof-rest-client 0.0.1-next.9 → 0.0.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.
@@ -22,28 +22,28 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
22
22
  super("ImmutableProofClient", config, "immutable-proof");
23
23
  }
24
24
  /**
25
- * Create a new authentication proof.
26
- * @param proofObject The object for the proof as JSON-LD.
27
- * @returns The id of the new authentication proof.
25
+ * Create a new proof.
26
+ * @param document The document to create the proof for.
27
+ * @returns The id of the new proof.
28
28
  */
29
- async create(proofObject) {
30
- core.Guards.object(this.CLASS_NAME, "proofObject", proofObject);
29
+ async create(document) {
30
+ core.Guards.object(this.CLASS_NAME, "document", document);
31
31
  const response = await this.fetch("/", "POST", {
32
32
  body: {
33
- proofObject
33
+ document
34
34
  }
35
35
  });
36
36
  return response.headers[web.HeaderTypes.Location];
37
37
  }
38
38
  /**
39
- * Get an authentication proof.
39
+ * Get a proof.
40
40
  * @param id The id of the proof to get.
41
41
  * @returns The proof.
42
42
  * @throws NotFoundError if the proof is not found.
43
43
  */
44
44
  async get(id) {
45
45
  core.Guards.stringValue(this.CLASS_NAME, "id", id);
46
- const response = await this.fetch("/:id/:entryId", "GET", {
46
+ const response = await this.fetch("/:id", "GET", {
47
47
  headers: {
48
48
  [web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
49
49
  },
@@ -54,36 +54,31 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
54
54
  return response.body;
55
55
  }
56
56
  /**
57
- * Verify an authentication proof.
57
+ * Verify a proof.
58
58
  * @param id The id of the proof to verify.
59
- * @param proofObject The object to verify as JSON-LD.
60
59
  * @returns The result of the verification and any failures.
61
60
  * @throws NotFoundError if the proof is not found.
62
61
  */
63
- async verify(id, proofObject) {
62
+ async verify(id) {
64
63
  core.Guards.stringValue(this.CLASS_NAME, "id", id);
65
- core.Guards.object(this.CLASS_NAME, "proofObject", proofObject);
66
- const response = await this.fetch("/:id", "POST", {
64
+ const response = await this.fetch("/:id/verify", "GET", {
67
65
  headers: {
68
66
  [web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
69
67
  },
70
68
  pathParams: {
71
69
  id
72
- },
73
- body: {
74
- proofObject
75
70
  }
76
71
  });
77
72
  return response.body;
78
73
  }
79
74
  /**
80
- * Remove the immutable storage for the proof.
75
+ * Remove the verifiable storage for the proof.
81
76
  * @param id The id of the proof to remove the storage from.
82
77
  * @returns Nothing.
83
78
  * @throws NotFoundError if the proof is not found.
84
79
  */
85
- async removeImmutable(id) {
86
- throw new core.NotSupportedError(this.CLASS_NAME, "removeImmutable");
80
+ async removeVerifiable(id) {
81
+ throw new core.NotSupportedError(this.CLASS_NAME, "removeVerifiable");
87
82
  }
88
83
  }
89
84
 
@@ -20,28 +20,28 @@ class ImmutableProofClient extends BaseRestClient {
20
20
  super("ImmutableProofClient", config, "immutable-proof");
21
21
  }
22
22
  /**
23
- * Create a new authentication proof.
24
- * @param proofObject The object for the proof as JSON-LD.
25
- * @returns The id of the new authentication proof.
23
+ * Create a new proof.
24
+ * @param document The document to create the proof for.
25
+ * @returns The id of the new proof.
26
26
  */
27
- async create(proofObject) {
28
- Guards.object(this.CLASS_NAME, "proofObject", proofObject);
27
+ async create(document) {
28
+ Guards.object(this.CLASS_NAME, "document", document);
29
29
  const response = await this.fetch("/", "POST", {
30
30
  body: {
31
- proofObject
31
+ document
32
32
  }
33
33
  });
34
34
  return response.headers[HeaderTypes.Location];
35
35
  }
36
36
  /**
37
- * Get an authentication proof.
37
+ * Get a proof.
38
38
  * @param id The id of the proof to get.
39
39
  * @returns The proof.
40
40
  * @throws NotFoundError if the proof is not found.
41
41
  */
42
42
  async get(id) {
43
43
  Guards.stringValue(this.CLASS_NAME, "id", id);
44
- const response = await this.fetch("/:id/:entryId", "GET", {
44
+ const response = await this.fetch("/:id", "GET", {
45
45
  headers: {
46
46
  [HeaderTypes.Accept]: MimeTypes.JsonLd
47
47
  },
@@ -52,36 +52,31 @@ class ImmutableProofClient extends BaseRestClient {
52
52
  return response.body;
53
53
  }
54
54
  /**
55
- * Verify an authentication proof.
55
+ * Verify a proof.
56
56
  * @param id The id of the proof to verify.
57
- * @param proofObject The object to verify as JSON-LD.
58
57
  * @returns The result of the verification and any failures.
59
58
  * @throws NotFoundError if the proof is not found.
60
59
  */
61
- async verify(id, proofObject) {
60
+ async verify(id) {
62
61
  Guards.stringValue(this.CLASS_NAME, "id", id);
63
- Guards.object(this.CLASS_NAME, "proofObject", proofObject);
64
- const response = await this.fetch("/:id", "POST", {
62
+ const response = await this.fetch("/:id/verify", "GET", {
65
63
  headers: {
66
64
  [HeaderTypes.Accept]: MimeTypes.JsonLd
67
65
  },
68
66
  pathParams: {
69
67
  id
70
- },
71
- body: {
72
- proofObject
73
68
  }
74
69
  });
75
70
  return response.body;
76
71
  }
77
72
  /**
78
- * Remove the immutable storage for the proof.
73
+ * Remove the verifiable storage for the proof.
79
74
  * @param id The id of the proof to remove the storage from.
80
75
  * @returns Nothing.
81
76
  * @throws NotFoundError if the proof is not found.
82
77
  */
83
- async removeImmutable(id) {
84
- throw new NotSupportedError(this.CLASS_NAME, "removeImmutable");
78
+ async removeVerifiable(id) {
79
+ throw new NotSupportedError(this.CLASS_NAME, "removeVerifiable");
85
80
  }
86
81
  }
87
82
 
@@ -16,31 +16,30 @@ export declare class ImmutableProofClient extends BaseRestClient implements IImm
16
16
  */
17
17
  constructor(config: IBaseRestClientConfig);
18
18
  /**
19
- * Create a new authentication proof.
20
- * @param proofObject The object for the proof as JSON-LD.
21
- * @returns The id of the new authentication proof.
19
+ * Create a new proof.
20
+ * @param document The document to create the proof for.
21
+ * @returns The id of the new proof.
22
22
  */
23
- create(proofObject: IJsonLdNodeObject): Promise<string>;
23
+ create(document: IJsonLdNodeObject): Promise<string>;
24
24
  /**
25
- * Get an authentication proof.
25
+ * Get a proof.
26
26
  * @param id The id of the proof to get.
27
27
  * @returns The proof.
28
28
  * @throws NotFoundError if the proof is not found.
29
29
  */
30
30
  get(id: string): Promise<IImmutableProof>;
31
31
  /**
32
- * Verify an authentication proof.
32
+ * Verify a proof.
33
33
  * @param id The id of the proof to verify.
34
- * @param proofObject The object to verify as JSON-LD.
35
34
  * @returns The result of the verification and any failures.
36
35
  * @throws NotFoundError if the proof is not found.
37
36
  */
38
- verify(id: string, proofObject: IJsonLdNodeObject): Promise<IImmutableProofVerification>;
37
+ verify(id: string): Promise<IImmutableProofVerification>;
39
38
  /**
40
- * Remove the immutable storage for the proof.
39
+ * Remove the verifiable storage for the proof.
41
40
  * @param id The id of the proof to remove the storage from.
42
41
  * @returns Nothing.
43
42
  * @throws NotFoundError if the proof is not found.
44
43
  */
45
- removeImmutable(id: string): Promise<void>;
44
+ removeVerifiable(id: string): Promise<void>;
46
45
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # @twin.org/immutable-proof-rest-client - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## 0.0.1 (2025-07-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * release to production ([cb7ecff](https://github.com/twinfoundation/immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/immutable-proof-models bumped from ^0.0.0 to ^0.0.1
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Features
21
+
22
+ * update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @twin.org/immutable-proof-models bumped from 0.0.1-next.34 to 0.0.1-next.35
30
+
31
+ ## [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)
32
+
33
+
34
+ ### Miscellaneous Chores
35
+
36
+ * **immutable-proof-rest-client:** Synchronize repo versions
37
+
38
+
39
+ ### Dependencies
40
+
41
+ * The following workspace dependencies were updated
42
+ * dependencies
43
+ * @twin.org/immutable-proof-models bumped from 0.0.1-next.33 to 0.0.1-next.34
44
+
45
+ ## [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)
46
+
47
+
48
+ ### Miscellaneous Chores
49
+
50
+ * **immutable-proof-rest-client:** Synchronize repo versions
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * The following workspace dependencies were updated
56
+ * dependencies
57
+ * @twin.org/immutable-proof-models bumped from 0.0.1-next.32 to 0.0.1-next.33
58
+
59
+ ## [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)
60
+
61
+
62
+ ### Features
63
+
64
+ * use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
65
+
66
+
67
+ ### Dependencies
68
+
69
+ * The following workspace dependencies were updated
70
+ * dependencies
71
+ * @twin.org/immutable-proof-models bumped from 0.0.1-next.31 to 0.0.1-next.32
72
+
73
+ ## [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)
74
+
75
+
76
+ ### Miscellaneous Chores
77
+
78
+ * **immutable-proof-rest-client:** Synchronize repo versions
79
+
80
+
81
+ ### Dependencies
82
+
83
+ * The following workspace dependencies were updated
84
+ * dependencies
85
+ * @twin.org/immutable-proof-models bumped from 0.0.1-next.30 to 0.0.1-next.31
86
+
87
+ ## v0.0.1-next.30
4
88
 
5
89
  - Initial Release
@@ -12,21 +12,23 @@ Client for performing immutable proof through to REST endpoints.
12
12
 
13
13
  ## Constructors
14
14
 
15
- ### new ImmutableProofClient()
15
+ ### Constructor
16
16
 
17
- > **new ImmutableProofClient**(`config`): [`ImmutableProofClient`](ImmutableProofClient.md)
17
+ > **new ImmutableProofClient**(`config`): `ImmutableProofClient`
18
18
 
19
19
  Create a new instance of ImmutableProofClient.
20
20
 
21
21
  #### Parameters
22
22
 
23
- **config**: `IBaseRestClientConfig`
23
+ ##### config
24
+
25
+ `IBaseRestClientConfig`
24
26
 
25
27
  The configuration for the client.
26
28
 
27
29
  #### Returns
28
30
 
29
- [`ImmutableProofClient`](ImmutableProofClient.md)
31
+ `ImmutableProofClient`
30
32
 
31
33
  #### Overrides
32
34
 
@@ -48,21 +50,23 @@ Runtime name for the class.
48
50
 
49
51
  ### create()
50
52
 
51
- > **create**(`proofObject`): `Promise`\<`string`\>
53
+ > **create**(`document`): `Promise`\<`string`\>
52
54
 
53
- Create a new authentication proof.
55
+ Create a new proof.
54
56
 
55
57
  #### Parameters
56
58
 
57
- **proofObject**: `IJsonLdNodeObject`
59
+ ##### document
60
+
61
+ `IJsonLdNodeObject`
58
62
 
59
- The object for the proof as JSON-LD.
63
+ The document to create the proof for.
60
64
 
61
65
  #### Returns
62
66
 
63
67
  `Promise`\<`string`\>
64
68
 
65
- The id of the new authentication proof.
69
+ The id of the new proof.
66
70
 
67
71
  #### Implementation of
68
72
 
@@ -74,11 +78,13 @@ The id of the new authentication proof.
74
78
 
75
79
  > **get**(`id`): `Promise`\<`IImmutableProof`\>
76
80
 
77
- Get an authentication proof.
81
+ Get a proof.
78
82
 
79
83
  #### Parameters
80
84
 
81
- **id**: `string`
85
+ ##### id
86
+
87
+ `string`
82
88
 
83
89
  The id of the proof to get.
84
90
 
@@ -100,19 +106,17 @@ NotFoundError if the proof is not found.
100
106
 
101
107
  ### verify()
102
108
 
103
- > **verify**(`id`, `proofObject`): `Promise`\<`IImmutableProofVerification`\>
109
+ > **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
104
110
 
105
- Verify an authentication proof.
111
+ Verify a proof.
106
112
 
107
113
  #### Parameters
108
114
 
109
- **id**: `string`
115
+ ##### id
110
116
 
111
- The id of the proof to verify.
117
+ `string`
112
118
 
113
- **proofObject**: `IJsonLdNodeObject`
114
-
115
- The object to verify as JSON-LD.
119
+ The id of the proof to verify.
116
120
 
117
121
  #### Returns
118
122
 
@@ -130,15 +134,17 @@ NotFoundError if the proof is not found.
130
134
 
131
135
  ***
132
136
 
133
- ### removeImmutable()
137
+ ### removeVerifiable()
134
138
 
135
- > **removeImmutable**(`id`): `Promise`\<`void`\>
139
+ > **removeVerifiable**(`id`): `Promise`\<`void`\>
136
140
 
137
- Remove the immutable storage for the proof.
141
+ Remove the verifiable storage for the proof.
138
142
 
139
143
  #### Parameters
140
144
 
141
- **id**: `string`
145
+ ##### id
146
+
147
+ `string`
142
148
 
143
149
  The id of the proof to remove the storage from.
144
150
 
@@ -154,4 +160,4 @@ NotFoundError if the proof is not found.
154
160
 
155
161
  #### Implementation of
156
162
 
157
- `IImmutableProofComponent.removeImmutable`
163
+ `IImmutableProofComponent.removeVerifiable`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/immutable-proof-rest-client",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.1",
4
4
  "description": "Immutable Proof contract implementation which can connect to REST endpoints",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,23 +14,23 @@
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.1-next.9",
23
- "@twin.org/nameof": "next",
24
- "@twin.org/web": "next"
17
+ "@twin.org/api-core": "^0.0.2-next.1",
18
+ "@twin.org/api-models": "^0.0.2-next.1",
19
+ "@twin.org/core": "^0.0.1",
20
+ "@twin.org/data-json-ld": "^0.0.1",
21
+ "@twin.org/entity": "^0.0.1",
22
+ "@twin.org/immutable-proof-models": "^0.0.1",
23
+ "@twin.org/nameof": "^0.0.1",
24
+ "@twin.org/web": "^0.0.1"
25
25
  },
26
26
  "main": "./dist/cjs/index.cjs",
27
27
  "module": "./dist/esm/index.mjs",
28
28
  "types": "./dist/types/index.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
+ "types": "./dist/types/index.d.ts",
31
32
  "require": "./dist/cjs/index.cjs",
32
- "import": "./dist/esm/index.mjs",
33
- "types": "./dist/types/index.d.ts"
33
+ "import": "./dist/esm/index.mjs"
34
34
  },
35
35
  "./locales/*.json": "./locales/*.json"
36
36
  },