@twin.org/immutable-proof-rest-client 0.0.2-next.1 → 0.0.2-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +11 -9
- package/dist/esm/index.mjs +11 -9
- package/dist/types/{immutableProofClient.d.ts → immutableProofRestClient.d.ts} +3 -3
- package/dist/types/index.d.ts +1 -1
- package/docs/changelog.md +28 -0
- package/docs/reference/classes/{ImmutableProofClient.md → ImmutableProofRestClient.md} +5 -9
- package/docs/reference/index.md +1 -1
- package/locales/en.json +7 -1
- package/package.json +15 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -9,17 +9,17 @@ var web = require('@twin.org/web');
|
|
|
9
9
|
/**
|
|
10
10
|
* Client for performing immutable proof through to REST endpoints.
|
|
11
11
|
*/
|
|
12
|
-
class
|
|
12
|
+
class ImmutableProofRestClient extends apiCore.BaseRestClient {
|
|
13
13
|
/**
|
|
14
14
|
* Runtime name for the class.
|
|
15
15
|
*/
|
|
16
|
-
CLASS_NAME = "
|
|
16
|
+
static CLASS_NAME = "ImmutableProofRestClient";
|
|
17
17
|
/**
|
|
18
|
-
* Create a new instance of
|
|
18
|
+
* Create a new instance of ImmutableProofRestClient.
|
|
19
19
|
* @param config The configuration for the client.
|
|
20
20
|
*/
|
|
21
21
|
constructor(config) {
|
|
22
|
-
super("
|
|
22
|
+
super("ImmutableProofRestClient", config, "immutable-proof");
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Create a new proof.
|
|
@@ -27,7 +27,7 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
27
27
|
* @returns The id of the new proof.
|
|
28
28
|
*/
|
|
29
29
|
async create(document) {
|
|
30
|
-
core.Guards.object(
|
|
30
|
+
core.Guards.object(ImmutableProofRestClient.CLASS_NAME, "document", document);
|
|
31
31
|
const response = await this.fetch("/", "POST", {
|
|
32
32
|
body: {
|
|
33
33
|
document
|
|
@@ -42,7 +42,7 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
42
42
|
* @throws NotFoundError if the proof is not found.
|
|
43
43
|
*/
|
|
44
44
|
async get(id) {
|
|
45
|
-
core.Guards.stringValue(
|
|
45
|
+
core.Guards.stringValue(ImmutableProofRestClient.CLASS_NAME, "id", id);
|
|
46
46
|
const response = await this.fetch("/:id", "GET", {
|
|
47
47
|
headers: {
|
|
48
48
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -60,7 +60,7 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
60
60
|
* @throws NotFoundError if the proof is not found.
|
|
61
61
|
*/
|
|
62
62
|
async verify(id) {
|
|
63
|
-
core.Guards.stringValue(
|
|
63
|
+
core.Guards.stringValue(ImmutableProofRestClient.CLASS_NAME, "id", id);
|
|
64
64
|
const response = await this.fetch("/:id/verify", "GET", {
|
|
65
65
|
headers: {
|
|
66
66
|
[web.HeaderTypes.Accept]: web.MimeTypes.JsonLd
|
|
@@ -78,8 +78,10 @@ class ImmutableProofClient extends apiCore.BaseRestClient {
|
|
|
78
78
|
* @throws NotFoundError if the proof is not found.
|
|
79
79
|
*/
|
|
80
80
|
async removeVerifiable(id) {
|
|
81
|
-
throw new core.NotSupportedError(
|
|
81
|
+
throw new core.NotSupportedError(ImmutableProofRestClient.CLASS_NAME, "notSupportedOnClient", {
|
|
82
|
+
methodName: "removeVerifiable"
|
|
83
|
+
});
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
exports.
|
|
87
|
+
exports.ImmutableProofRestClient = ImmutableProofRestClient;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -7,17 +7,17 @@ import { HeaderTypes, MimeTypes } from '@twin.org/web';
|
|
|
7
7
|
/**
|
|
8
8
|
* Client for performing immutable proof through to REST endpoints.
|
|
9
9
|
*/
|
|
10
|
-
class
|
|
10
|
+
class ImmutableProofRestClient extends BaseRestClient {
|
|
11
11
|
/**
|
|
12
12
|
* Runtime name for the class.
|
|
13
13
|
*/
|
|
14
|
-
CLASS_NAME = "
|
|
14
|
+
static CLASS_NAME = "ImmutableProofRestClient";
|
|
15
15
|
/**
|
|
16
|
-
* Create a new instance of
|
|
16
|
+
* Create a new instance of ImmutableProofRestClient.
|
|
17
17
|
* @param config The configuration for the client.
|
|
18
18
|
*/
|
|
19
19
|
constructor(config) {
|
|
20
|
-
super("
|
|
20
|
+
super("ImmutableProofRestClient", config, "immutable-proof");
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Create a new proof.
|
|
@@ -25,7 +25,7 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
25
25
|
* @returns The id of the new proof.
|
|
26
26
|
*/
|
|
27
27
|
async create(document) {
|
|
28
|
-
Guards.object(
|
|
28
|
+
Guards.object(ImmutableProofRestClient.CLASS_NAME, "document", document);
|
|
29
29
|
const response = await this.fetch("/", "POST", {
|
|
30
30
|
body: {
|
|
31
31
|
document
|
|
@@ -40,7 +40,7 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
40
40
|
* @throws NotFoundError if the proof is not found.
|
|
41
41
|
*/
|
|
42
42
|
async get(id) {
|
|
43
|
-
Guards.stringValue(
|
|
43
|
+
Guards.stringValue(ImmutableProofRestClient.CLASS_NAME, "id", id);
|
|
44
44
|
const response = await this.fetch("/:id", "GET", {
|
|
45
45
|
headers: {
|
|
46
46
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -58,7 +58,7 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
58
58
|
* @throws NotFoundError if the proof is not found.
|
|
59
59
|
*/
|
|
60
60
|
async verify(id) {
|
|
61
|
-
Guards.stringValue(
|
|
61
|
+
Guards.stringValue(ImmutableProofRestClient.CLASS_NAME, "id", id);
|
|
62
62
|
const response = await this.fetch("/:id/verify", "GET", {
|
|
63
63
|
headers: {
|
|
64
64
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
@@ -76,8 +76,10 @@ class ImmutableProofClient extends BaseRestClient {
|
|
|
76
76
|
* @throws NotFoundError if the proof is not found.
|
|
77
77
|
*/
|
|
78
78
|
async removeVerifiable(id) {
|
|
79
|
-
throw new NotSupportedError(
|
|
79
|
+
throw new NotSupportedError(ImmutableProofRestClient.CLASS_NAME, "notSupportedOnClient", {
|
|
80
|
+
methodName: "removeVerifiable"
|
|
81
|
+
});
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
export {
|
|
85
|
+
export { ImmutableProofRestClient };
|
|
@@ -5,13 +5,13 @@ import type { IImmutableProof, IImmutableProofComponent, IImmutableProofVerifica
|
|
|
5
5
|
/**
|
|
6
6
|
* Client for performing immutable proof through to REST endpoints.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class ImmutableProofRestClient extends BaseRestClient implements IImmutableProofComponent {
|
|
9
9
|
/**
|
|
10
10
|
* Runtime name for the class.
|
|
11
11
|
*/
|
|
12
|
-
readonly CLASS_NAME: string;
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
13
|
/**
|
|
14
|
-
* Create a new instance of
|
|
14
|
+
* Create a new instance of ImmutableProofRestClient.
|
|
15
15
|
* @param config The configuration for the client.
|
|
16
16
|
*/
|
|
17
17
|
constructor(config: IBaseRestClientConfig);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./immutableProofRestClient";
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @twin.org/immutable-proof-rest-client - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add validate-locales ([d6a7c07](https://github.com/twinfoundation/immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/immutable-proof-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* eslint migration to flat config ([c8536f2](https://github.com/twinfoundation/immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/immutable-proof-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
30
|
+
|
|
3
31
|
## [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)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Class:
|
|
1
|
+
# Class: ImmutableProofRestClient
|
|
2
2
|
|
|
3
3
|
Client for performing immutable proof through to REST endpoints.
|
|
4
4
|
|
|
@@ -14,9 +14,9 @@ Client for performing immutable proof through to REST endpoints.
|
|
|
14
14
|
|
|
15
15
|
### Constructor
|
|
16
16
|
|
|
17
|
-
> **new
|
|
17
|
+
> **new ImmutableProofRestClient**(`config`): `ImmutableProofRestClient`
|
|
18
18
|
|
|
19
|
-
Create a new instance of
|
|
19
|
+
Create a new instance of ImmutableProofRestClient.
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
@@ -28,7 +28,7 @@ The configuration for the client.
|
|
|
28
28
|
|
|
29
29
|
#### Returns
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`ImmutableProofRestClient`
|
|
32
32
|
|
|
33
33
|
#### Overrides
|
|
34
34
|
|
|
@@ -38,14 +38,10 @@ The configuration for the client.
|
|
|
38
38
|
|
|
39
39
|
### CLASS\_NAME
|
|
40
40
|
|
|
41
|
-
> `readonly` **CLASS\_NAME**: `string`
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
43
43
|
Runtime name for the class.
|
|
44
44
|
|
|
45
|
-
#### Implementation of
|
|
46
|
-
|
|
47
|
-
`IImmutableProofComponent.CLASS_NAME`
|
|
48
|
-
|
|
49
45
|
## Methods
|
|
50
46
|
|
|
51
47
|
### create()
|
package/docs/reference/index.md
CHANGED
package/locales/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-rest-client",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.3",
|
|
4
4
|
"description": "Immutable Proof contract implementation which can connect to REST endpoints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/data-json-ld": "next",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
|
-
"@twin.org/immutable-proof-models": "0.0.2-next.
|
|
22
|
+
"@twin.org/immutable-proof-models": "0.0.2-next.3",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next"
|
|
25
25
|
},
|
|
@@ -40,5 +40,17 @@
|
|
|
40
40
|
"dist/types",
|
|
41
41
|
"locales",
|
|
42
42
|
"docs"
|
|
43
|
-
]
|
|
43
|
+
],
|
|
44
|
+
"keywords": [
|
|
45
|
+
"twin",
|
|
46
|
+
"trade",
|
|
47
|
+
"iota",
|
|
48
|
+
"framework",
|
|
49
|
+
"blockchain",
|
|
50
|
+
"immutable-proof"
|
|
51
|
+
],
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "git+https://github.com/twinfoundation/immutable-proof/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://twindev.org"
|
|
44
56
|
}
|