@twin.org/core 0.0.3-next.31 → 0.0.3-next.33

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.
Files changed (58) hide show
  1. package/dist/es/errors/alreadyExistsError.js +1 -1
  2. package/dist/es/errors/alreadyExistsError.js.map +1 -1
  3. package/dist/es/errors/baseError.js +1 -1
  4. package/dist/es/errors/baseError.js.map +1 -1
  5. package/dist/es/errors/conflictError.js +1 -1
  6. package/dist/es/errors/conflictError.js.map +1 -1
  7. package/dist/es/errors/generalError.js +1 -1
  8. package/dist/es/errors/generalError.js.map +1 -1
  9. package/dist/es/errors/guardError.js +1 -1
  10. package/dist/es/errors/guardError.js.map +1 -1
  11. package/dist/es/errors/notFoundError.js +1 -1
  12. package/dist/es/errors/notFoundError.js.map +1 -1
  13. package/dist/es/errors/notSupportedError.js +1 -1
  14. package/dist/es/errors/notSupportedError.js.map +1 -1
  15. package/dist/es/errors/unauthorizedError.js +2 -2
  16. package/dist/es/errors/unauthorizedError.js.map +1 -1
  17. package/dist/es/errors/unprocessableError.js +1 -1
  18. package/dist/es/errors/unprocessableError.js.map +1 -1
  19. package/dist/es/index.js +2 -0
  20. package/dist/es/index.js.map +1 -1
  21. package/dist/es/models/IComponent.js +0 -2
  22. package/dist/es/models/IComponent.js.map +1 -1
  23. package/dist/es/models/IError.js.map +1 -1
  24. package/dist/es/models/IHealth.js +2 -0
  25. package/dist/es/models/IHealth.js.map +1 -0
  26. package/dist/es/models/healthStatus.js +21 -0
  27. package/dist/es/models/healthStatus.js.map +1 -0
  28. package/dist/types/errors/alreadyExistsError.d.ts +1 -1
  29. package/dist/types/errors/baseError.d.ts +1 -1
  30. package/dist/types/errors/conflictError.d.ts +1 -1
  31. package/dist/types/errors/generalError.d.ts +1 -1
  32. package/dist/types/errors/guardError.d.ts +1 -1
  33. package/dist/types/errors/notFoundError.d.ts +1 -1
  34. package/dist/types/errors/notSupportedError.d.ts +1 -1
  35. package/dist/types/errors/unauthorizedError.d.ts +2 -2
  36. package/dist/types/errors/unprocessableError.d.ts +1 -1
  37. package/dist/types/index.d.ts +2 -0
  38. package/dist/types/models/IComponent.d.ts +6 -0
  39. package/dist/types/models/IError.d.ts +1 -1
  40. package/dist/types/models/IHealth.d.ts +32 -0
  41. package/dist/types/models/healthStatus.d.ts +21 -0
  42. package/docs/changelog.md +328 -289
  43. package/docs/reference/classes/AlreadyExistsError.md +1 -1
  44. package/docs/reference/classes/BaseError.md +1 -1
  45. package/docs/reference/classes/ConflictError.md +1 -1
  46. package/docs/reference/classes/GeneralError.md +1 -1
  47. package/docs/reference/classes/GuardError.md +1 -1
  48. package/docs/reference/classes/NotFoundError.md +1 -1
  49. package/docs/reference/classes/NotSupportedError.md +1 -1
  50. package/docs/reference/classes/UnauthorizedError.md +2 -2
  51. package/docs/reference/classes/UnprocessableError.md +1 -1
  52. package/docs/reference/index.md +3 -0
  53. package/docs/reference/interfaces/IComponent.md +14 -0
  54. package/docs/reference/interfaces/IError.md +1 -1
  55. package/docs/reference/interfaces/IHealth.md +55 -0
  56. package/docs/reference/type-aliases/HealthStatus.md +5 -0
  57. package/docs/reference/variables/HealthStatus.md +25 -0
  58. package/package.json +2 -2
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### existingId?
32
32
 
@@ -49,7 +49,7 @@ The source of the error.
49
49
 
50
50
  `string`
51
51
 
52
- The message as a code.
52
+ The message as an i18n key.
53
53
 
54
54
  ##### properties?
55
55
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### conflictId?
32
32
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### properties?
32
32
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### propertyName
32
32
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### notFoundId?
32
32
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### properties?
32
32
 
@@ -1,6 +1,6 @@
1
1
  # Class: UnauthorizedError
2
2
 
3
- Class to handle errors which are triggered by access not being unauthorized.
3
+ Class to handle errors which are triggered by access not being authorized.
4
4
 
5
5
  ## Extends
6
6
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### properties?
32
32
 
@@ -26,7 +26,7 @@ The source of the error.
26
26
 
27
27
  `string`
28
28
 
29
- The message as a code.
29
+ The message as an i18n key.
30
30
 
31
31
  ##### properties?
32
32
 
@@ -46,6 +46,7 @@
46
46
 
47
47
  - [IComponent](interfaces/IComponent.md)
48
48
  - [IError](interfaces/IError.md)
49
+ - [IHealth](interfaces/IHealth.md)
49
50
  - [II18nShared](interfaces/II18nShared.md)
50
51
  - [IKeyValue](interfaces/IKeyValue.md)
51
52
  - [ILabelledValue](interfaces/ILabelledValue.md)
@@ -60,6 +61,7 @@
60
61
 
61
62
  - [CoerceType](type-aliases/CoerceType.md)
62
63
  - [CompressionType](type-aliases/CompressionType.md)
64
+ - [HealthStatus](type-aliases/HealthStatus.md)
63
65
  - [ObjectOrArray](type-aliases/ObjectOrArray.md)
64
66
  - [SingleOccurrenceArrayDepthHelper](type-aliases/SingleOccurrenceArrayDepthHelper.md)
65
67
  - [SingleOccurrenceArray](type-aliases/SingleOccurrenceArray.md)
@@ -69,3 +71,4 @@
69
71
  - [ComponentFactory](variables/ComponentFactory.md)
70
72
  - [CoerceType](variables/CoerceType.md)
71
73
  - [CompressionType](variables/CompressionType.md)
74
+ - [HealthStatus](variables/HealthStatus.md)
@@ -81,3 +81,17 @@ The node logging component type.
81
81
  `Promise`\<`void`\>
82
82
 
83
83
  Nothing.
84
+
85
+ ***
86
+
87
+ ### health()? {#health}
88
+
89
+ > `optional` **health**(): `Promise`\<[`IHealth`](IHealth.md)[]\>
90
+
91
+ Returns the health status of the component.
92
+
93
+ #### Returns
94
+
95
+ `Promise`\<[`IHealth`](IHealth.md)[]\>
96
+
97
+ The health status of the component, can return multiple entries for elements within the component.
@@ -16,7 +16,7 @@ The name for the error.
16
16
 
17
17
  > **message**: `string`
18
18
 
19
- The message for the error.
19
+ The message for the error as an i18n key.
20
20
 
21
21
  ***
22
22
 
@@ -0,0 +1,55 @@
1
+ # Interface: IHealth
2
+
3
+ Provides health information for a component.
4
+
5
+ ## Properties
6
+
7
+ ### name {#name}
8
+
9
+ > **name**: `string`
10
+
11
+ The name of the component.
12
+
13
+ ***
14
+
15
+ ### description? {#description}
16
+
17
+ > `optional` **description?**: `string`
18
+
19
+ The description of the component as an i18n key.
20
+
21
+ ***
22
+
23
+ ### isChild? {#ischild}
24
+
25
+ > `optional` **isChild?**: `boolean`
26
+
27
+ Whether this entry is a child of another entry, the parent entry will report the overall status of the component.
28
+
29
+ ***
30
+
31
+ ### status {#status}
32
+
33
+ > **status**: [`HealthStatus`](../type-aliases/HealthStatus.md)
34
+
35
+ The overall status of the component, the entries can also report their own health.
36
+
37
+ ***
38
+
39
+ ### details? {#details}
40
+
41
+ > `optional` **details?**: `string`
42
+
43
+ The details for the status if there are further details to provide as an i18n key.
44
+
45
+ ***
46
+
47
+ ### properties? {#properties}
48
+
49
+ > `optional` **properties?**: `object`
50
+
51
+ Properties to substitute in the i18n key for the details.
52
+
53
+ #### Index Signature
54
+
55
+ \[`id`: `string`\]: `unknown`
@@ -0,0 +1,5 @@
1
+ # Type Alias: HealthStatus
2
+
3
+ > **HealthStatus** = *typeof* [`HealthStatus`](../variables/HealthStatus.md)\[keyof *typeof* [`HealthStatus`](../variables/HealthStatus.md)\]
4
+
5
+ The health status of the component.
@@ -0,0 +1,25 @@
1
+ # Variable: HealthStatus
2
+
3
+ > `const` **HealthStatus**: `object`
4
+
5
+ The health status of the component.
6
+
7
+ ## Type Declaration
8
+
9
+ ### Ok {#ok}
10
+
11
+ > `readonly` **Ok**: `"ok"` = `"ok"`
12
+
13
+ OK.
14
+
15
+ ### Warning {#warning}
16
+
17
+ > `readonly` **Warning**: `"warning"` = `"warning"`
18
+
19
+ Warning.
20
+
21
+ ### Error {#error}
22
+
23
+ > `readonly` **Error**: `"error"` = `"error"`
24
+
25
+ Error.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/core",
3
- "version": "0.0.3-next.31",
3
+ "version": "0.0.3-next.33",
4
4
  "description": "Helper methods/classes for data type checking/validation/guarding/error handling",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/nameof": "0.0.3-next.31",
17
+ "@twin.org/nameof": "0.0.3-next.33",
18
18
  "intl-messageformat": "11.2.0",
19
19
  "rfc6902": "5.2.0"
20
20
  },