@twin.org/core 0.0.3-next.34 → 0.0.3-next.36

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.
@@ -1 +1 @@
1
- {"version":3,"file":"IComponent.js","sourceRoot":"","sources":["../../../src/models/IComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHealth } from \"./IHealth.js\";\n\n/**\n * Interface describing a component which can be bootstrapped, started and stopped.\n */\nexport interface IComponent {\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tclassName(): string;\n\n\t/**\n\t * Bootstrap the component by creating and initializing any resources it needs.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns True if the bootstrapping process was successful.\n\t */\n\tbootstrap?(nodeLoggingComponentType?: string): Promise<boolean>;\n\n\t/**\n\t * The component needs to be started when the node is initialized.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns Nothing.\n\t */\n\tstart?(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * The component needs to be stopped when the node is closed.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns Nothing.\n\t */\n\tstop?(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * Returns the health status of the component.\n\t * @returns The health status of the component, can return multiple entries for elements within the component.\n\t */\n\thealth?(): Promise<IHealth[]>;\n}\n"]}
1
+ {"version":3,"file":"IComponent.js","sourceRoot":"","sources":["../../../src/models/IComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHealth } from \"./IHealth.js\";\n\n/**\n * Interface describing a component which can be bootstrapped, started and stopped.\n */\nexport interface IComponent {\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tclassName(): string;\n\n\t/**\n\t * Bootstrap the component by creating and initializing any resources it needs.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns True if the bootstrapping process was successful.\n\t */\n\tbootstrap?(nodeLoggingComponentType?: string): Promise<boolean>;\n\n\t/**\n\t * Teardown the component by releasing any resources it holds.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns True if the teardown process was successful.\n\t */\n\tteardown?(nodeLoggingComponentType?: string): Promise<boolean>;\n\n\t/**\n\t * The component needs to be started when the node is initialized.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns Nothing.\n\t */\n\tstart?(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * The component needs to be stopped when the node is closed.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns Nothing.\n\t */\n\tstop?(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * Returns the health status of the component.\n\t * @returns The health status of the component, can return multiple entries for elements within the component.\n\t */\n\thealth?(): Promise<IHealth[]>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IHealth.js","sourceRoot":"","sources":["../../../src/models/IHealth.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HealthStatus } from \"./healthStatus.js\";\n\n/**\n * Provides health information for a component.\n */\nexport interface IHealth {\n\t/**\n\t * The name of the component.\n\t */\n\tname: string;\n\n\t/**\n\t * The description of the component as an i18n key.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * The overall status of the component, the entries can also report their own health.\n\t */\n\tstatus: HealthStatus;\n\n\t/**\n\t * The details for the status if there are further details to provide as an i18n key.\n\t */\n\tdetails?: string;\n\n\t/**\n\t * Properties to substitute in the i18n key for the details.\n\t */\n\tproperties?: { [id: string]: unknown };\n\n\t/**\n\t * The grouped child components, if any.\n\t */\n\tgrouped?: IHealth[];\n}\n"]}
1
+ {"version":3,"file":"IHealth.js","sourceRoot":"","sources":["../../../src/models/IHealth.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HealthStatus } from \"./healthStatus.js\";\n\n/**\n * Provides health information for a component.\n */\nexport interface IHealth {\n\t/**\n\t * The source of the health information.\n\t */\n\tsource: string;\n\n\t/**\n\t * The description of the component as an i18n key.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * The overall status of the component, the entries can also report their own health.\n\t */\n\tstatus: HealthStatus;\n\n\t/**\n\t * The message for the status if there are further details to provide as an i18n key.\n\t */\n\tmessage?: string;\n\n\t/**\n\t * Data to substitute in the i18n key for the message.\n\t */\n\tdata?: { [id: string]: unknown };\n\n\t/**\n\t * The grouped child components, if any.\n\t */\n\tgrouped?: IHealth[];\n}\n"]}
@@ -14,6 +14,12 @@ export interface IComponent {
14
14
  * @returns True if the bootstrapping process was successful.
15
15
  */
16
16
  bootstrap?(nodeLoggingComponentType?: string): Promise<boolean>;
17
+ /**
18
+ * Teardown the component by releasing any resources it holds.
19
+ * @param nodeLoggingComponentType The node logging component type.
20
+ * @returns True if the teardown process was successful.
21
+ */
22
+ teardown?(nodeLoggingComponentType?: string): Promise<boolean>;
17
23
  /**
18
24
  * The component needs to be started when the node is initialized.
19
25
  * @param nodeLoggingComponentType The node logging component type.
@@ -4,9 +4,9 @@ import type { HealthStatus } from "./healthStatus.js";
4
4
  */
5
5
  export interface IHealth {
6
6
  /**
7
- * The name of the component.
7
+ * The source of the health information.
8
8
  */
9
- name: string;
9
+ source: string;
10
10
  /**
11
11
  * The description of the component as an i18n key.
12
12
  */
@@ -16,13 +16,13 @@ export interface IHealth {
16
16
  */
17
17
  status: HealthStatus;
18
18
  /**
19
- * The details for the status if there are further details to provide as an i18n key.
19
+ * The message for the status if there are further details to provide as an i18n key.
20
20
  */
21
- details?: string;
21
+ message?: string;
22
22
  /**
23
- * Properties to substitute in the i18n key for the details.
23
+ * Data to substitute in the i18n key for the message.
24
24
  */
25
- properties?: {
25
+ data?: {
26
26
  [id: string]: unknown;
27
27
  };
28
28
  /**
package/docs/changelog.md CHANGED
@@ -1,11 +1,46 @@
1
1
  # Changelog
2
2
 
3
- ## [0.0.3-next.34](https://github.com/twinfoundation/twin-framework/compare/core-v0.0.3-next.33...core-v0.0.3-next.34) (2026-05-06)
3
+ ## [0.0.3-next.36](https://github.com/iotaledger/twin-framework/compare/core-v0.0.3-next.35...core-v0.0.3-next.36) (2026-05-07)
4
4
 
5
5
 
6
6
  ### Features
7
7
 
8
- * health status grouping ([5007c29](https://github.com/twinfoundation/twin-framework/commit/5007c29fe4123fe56f754450b993dbe5dc32a057))
8
+ * add teardown to IComponent interface ([32c173c](https://github.com/iotaledger/twin-framework/commit/32c173cda115c20d3b4cee14b8a29cdc08e91555))
9
+ * add teardown to IComponent interface ([98ce864](https://github.com/iotaledger/twin-framework/commit/98ce8648e709310c4435de334825b381fb4e32cb))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @twin.org/nameof bumped from 0.0.3-next.35 to 0.0.3-next.36
17
+ * devDependencies
18
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.35 to 0.0.3-next.36
19
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.35 to 0.0.3-next.36
20
+
21
+ ## [0.0.3-next.35](https://github.com/iotaledger/twin-framework/compare/core-v0.0.3-next.34...core-v0.0.3-next.35) (2026-05-06)
22
+
23
+
24
+ ### Features
25
+
26
+ * add support for health i18n validation ([7a286dd](https://github.com/iotaledger/twin-framework/commit/7a286ddb0c1bfa498bf3a77126cd589042bad6de))
27
+
28
+
29
+ ### Dependencies
30
+
31
+ * The following workspace dependencies were updated
32
+ * dependencies
33
+ * @twin.org/nameof bumped from 0.0.3-next.34 to 0.0.3-next.35
34
+ * devDependencies
35
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.34 to 0.0.3-next.35
36
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.34 to 0.0.3-next.35
37
+
38
+ ## [0.0.3-next.34](https://github.com/iotaledger/twin-framework/compare/core-v0.0.3-next.33...core-v0.0.3-next.34) (2026-05-06)
39
+
40
+
41
+ ### Features
42
+
43
+ * health status grouping ([5007c29](https://github.com/iotaledger/twin-framework/commit/5007c29fe4123fe56f754450b993dbe5dc32a057))
9
44
 
10
45
 
11
46
  ### Dependencies
@@ -17,17 +52,17 @@
17
52
  * @twin.org/nameof-transformer bumped from 0.0.3-next.33 to 0.0.3-next.34
18
53
  * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.33 to 0.0.3-next.34
19
54
 
20
- ## [0.0.3-next.33](https://github.com/twinfoundation/twin-framework/compare/core-v0.0.3-next.32...core-v0.0.3-next.33) (2026-05-05)
55
+ ## [0.0.3-next.33](https://github.com/iotaledger/twin-framework/compare/core-v0.0.3-next.32...core-v0.0.3-next.33) (2026-05-05)
21
56
 
22
57
 
23
58
  ### Features
24
59
 
25
- * add health method to components ([a88016d](https://github.com/twinfoundation/twin-framework/commit/a88016d90d172413e5bc5238dc1b3e35f82fcc2c))
60
+ * add health method to components ([a88016d](https://github.com/iotaledger/twin-framework/commit/a88016d90d172413e5bc5238dc1b3e35f82fcc2c))
26
61
 
27
62
 
28
63
  ### Bug Fixes
29
64
 
30
- * improve jsdoc comments ([f7c8e43](https://github.com/twinfoundation/twin-framework/commit/f7c8e43fab9803dffa6461950d5b9979e25bcd24))
65
+ * improve jsdoc comments ([f7c8e43](https://github.com/iotaledger/twin-framework/commit/f7c8e43fab9803dffa6461950d5b9979e25bcd24))
31
66
 
32
67
 
33
68
  ### Dependencies
@@ -39,7 +74,7 @@
39
74
  * @twin.org/nameof-transformer bumped from 0.0.3-next.32 to 0.0.3-next.33
40
75
  * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.32 to 0.0.3-next.33
41
76
 
42
- ## [0.0.3-next.32](https://github.com/twinfoundation/twin-framework/compare/core-v0.0.3-next.31...core-v0.0.3-next.32) (2026-04-30)
77
+ ## [0.0.3-next.32](https://github.com/iotaledger/twin-framework/compare/core-v0.0.3-next.31...core-v0.0.3-next.32) (2026-04-30)
43
78
 
44
79
 
45
80
  ### Miscellaneous Chores
@@ -40,6 +40,28 @@ True if the bootstrapping process was successful.
40
40
 
41
41
  ***
42
42
 
43
+ ### teardown()? {#teardown}
44
+
45
+ > `optional` **teardown**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
46
+
47
+ Teardown the component by releasing any resources it holds.
48
+
49
+ #### Parameters
50
+
51
+ ##### nodeLoggingComponentType?
52
+
53
+ `string`
54
+
55
+ The node logging component type.
56
+
57
+ #### Returns
58
+
59
+ `Promise`\<`boolean`\>
60
+
61
+ True if the teardown process was successful.
62
+
63
+ ***
64
+
43
65
  ### start()? {#start}
44
66
 
45
67
  > `optional` **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
@@ -4,11 +4,11 @@ Provides health information for a component.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### name {#name}
7
+ ### source {#source}
8
8
 
9
- > **name**: `string`
9
+ > **source**: `string`
10
10
 
11
- The name of the component.
11
+ The source of the health information.
12
12
 
13
13
  ***
14
14
 
@@ -28,19 +28,19 @@ The overall status of the component, the entries can also report their own healt
28
28
 
29
29
  ***
30
30
 
31
- ### details? {#details}
31
+ ### message? {#message}
32
32
 
33
- > `optional` **details?**: `string`
33
+ > `optional` **message?**: `string`
34
34
 
35
- The details for the status if there are further details to provide as an i18n key.
35
+ The message for the status if there are further details to provide as an i18n key.
36
36
 
37
37
  ***
38
38
 
39
- ### properties? {#properties}
39
+ ### data? {#data}
40
40
 
41
- > `optional` **properties?**: `object`
41
+ > `optional` **data?**: `object`
42
42
 
43
- Properties to substitute in the i18n key for the details.
43
+ Data to substitute in the i18n key for the message.
44
44
 
45
45
  #### Index Signature
46
46
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/core",
3
- "version": "0.0.3-next.34",
3
+ "version": "0.0.3-next.36",
4
4
  "description": "Helper methods/classes for data type checking/validation/guarding/error handling",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/twinfoundation/framework.git",
7
+ "url": "git+https://github.com/iotaledger/framework.git",
8
8
  "directory": "packages/core"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -14,7 +14,7 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/nameof": "0.0.3-next.34",
17
+ "@twin.org/nameof": "0.0.3-next.36",
18
18
  "intl-messageformat": "11.2.0",
19
19
  "rfc6902": "5.2.0"
20
20
  },
@@ -45,7 +45,7 @@
45
45
  "utilities"
46
46
  ],
47
47
  "bugs": {
48
- "url": "git+https://github.com/twinfoundation/framework/issues"
48
+ "url": "git+https://github.com/iotaledger/framework/issues"
49
49
  },
50
50
  "homepage": "https://twindev.org"
51
51
  }