@twin.org/api-rest-client 0.0.3-next.6 → 0.0.3-next.8
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.
|
@@ -72,7 +72,9 @@ export class InformationRestClient extends BaseRestClient {
|
|
|
72
72
|
* @returns Nothing.
|
|
73
73
|
*/
|
|
74
74
|
async setComponentHealth(name, status, details) {
|
|
75
|
-
throw new NotSupportedError(InformationRestClient.CLASS_NAME, "
|
|
75
|
+
throw new NotSupportedError(InformationRestClient.CLASS_NAME, "notSupportedOnClient", {
|
|
76
|
+
methodName: "setComponentHealth"
|
|
77
|
+
});
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
78
80
|
* Remove the status of a component.
|
|
@@ -80,7 +82,9 @@ export class InformationRestClient extends BaseRestClient {
|
|
|
80
82
|
* @returns Nothing.
|
|
81
83
|
*/
|
|
82
84
|
async removeComponentHealth(name) {
|
|
83
|
-
throw new NotSupportedError(InformationRestClient.CLASS_NAME, "
|
|
85
|
+
throw new NotSupportedError(InformationRestClient.CLASS_NAME, "notSupportedOnClient", {
|
|
86
|
+
methodName: "removeComponentHealth"
|
|
87
|
+
});
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
//# sourceMappingURL=informationRestClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"informationRestClient.js","sourceRoot":"","sources":["../../src/informationRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAcpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,cAAc;IACxD;;OAEG;IACI,MAAM,CAAU,UAAU,2BAA2C;IAE5E;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,0BAAkC,MAAM,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;;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,MAAoB,EACpB,OAAgB;QAEhB,MAAM,IAAI,iBAAiB,CAAC,qBAAqB,CAAC,UAAU,EAAE,sBAAsB,EAAE;YACrF,UAAU,EAAE,oBAAoB;SAChC,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,qBAAqB,CAAC,IAAY;QAC9C,MAAM,IAAI,iBAAiB,CAAC,qBAAqB,CAAC,UAAU,EAAE,sBAAsB,EAAE;YACrF,UAAU,EAAE,uBAAuB;SACnC,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 {\n\tHealthStatus,\n\tIBaseRestClientConfig,\n\tIHealthInfo,\n\tIInformationComponent,\n\tINoContentRequest,\n\tIServerFavIconResponse,\n\tIServerHealthResponse,\n\tIServerInfo,\n\tIServerInfoResponse,\n\tIServerRootResponse,\n\tIServerSpecResponse\n} from \"@twin.org/api-models\";\nimport { NotSupportedError } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * The client to connect to the information service.\n */\nexport class InformationRestClient extends BaseRestClient implements IInformationComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<InformationRestClient>();\n\n\t/**\n\t * Create a new instance of InformationRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<InformationRestClient>(), config, \"\");\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 InformationRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Get the server root.\n\t * @returns The root root.\n\t */\n\tpublic async root(): Promise<string> {\n\t\tconst response = await this.fetch<INoContentRequest, IServerRootResponse>(\"/\", \"GET\");\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get the server information.\n\t * @returns The service information.\n\t */\n\tpublic async info(): Promise<IServerInfo> {\n\t\tconst response = await this.fetch<INoContentRequest, IServerInfoResponse>(\"/info\", \"GET\");\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get the favicon.\n\t * @returns The favicon.\n\t */\n\tpublic async favicon(): Promise<Uint8Array | undefined> {\n\t\tconst response = await this.fetch<INoContentRequest, IServerFavIconResponse>(\n\t\t\t\"/favicon.ico\",\n\t\t\t\"GET\"\n\t\t);\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get the OpenAPI spec.\n\t * @returns The OpenAPI spec.\n\t */\n\tpublic async spec(): Promise<unknown> {\n\t\tconst response = await this.fetch<INoContentRequest, IServerSpecResponse>(\"/spec\", \"GET\");\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get the server health.\n\t * @returns The service health.\n\t */\n\tpublic async health(): Promise<IHealthInfo> {\n\t\tconst response = await this.fetch<INoContentRequest, IServerHealthResponse>(\"/health\", \"GET\");\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Set the status of a component.\n\t * @param name The component name.\n\t * @param status The status of the component.\n\t * @param details The details for the status.\n\t * @returns Nothing.\n\t */\n\tpublic async setComponentHealth(\n\t\tname: string,\n\t\tstatus: HealthStatus,\n\t\tdetails?: string\n\t): Promise<void> {\n\t\tthrow new NotSupportedError(InformationRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"setComponentHealth\"\n\t\t});\n\t}\n\n\t/**\n\t * Remove the status of a component.\n\t * @param name The component name.\n\t * @returns Nothing.\n\t */\n\tpublic async removeComponentHealth(name: string): Promise<void> {\n\t\tthrow new NotSupportedError(InformationRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"removeComponentHealth\"\n\t\t});\n\t}\n}\n"]}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @twin.org/api-rest-client - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/api/compare/api-rest-client-v0.0.3-next.7...api-rest-client-v0.0.3-next.8) (2025-12-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* not supported error handling ([5cc1a50](https://github.com/twinfoundation/api/commit/5cc1a507243f37fda5855acb622b2a3f4d91080f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/api-core bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
16
|
+
* @twin.org/api-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/api/compare/api-rest-client-v0.0.3-next.6...api-rest-client-v0.0.3-next.7) (2025-11-26)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **api-rest-client:** Synchronize repo versions
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/api-core bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
31
|
+
* @twin.org/api-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
32
|
+
|
|
3
33
|
## [0.0.3-next.6](https://github.com/twinfoundation/api/compare/api-rest-client-v0.0.3-next.5...api-rest-client-v0.0.3-next.6) (2025-11-20)
|
|
4
34
|
|
|
5
35
|
|
package/locales/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-rest-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.8",
|
|
4
4
|
"description": "Information contract implementation which can connect to REST endpoints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-core": "0.0.3-next.
|
|
18
|
-
"@twin.org/api-models": "0.0.3-next.
|
|
17
|
+
"@twin.org/api-core": "0.0.3-next.8",
|
|
18
|
+
"@twin.org/api-models": "0.0.3-next.8",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next"
|