@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.
- package/dist/es/errors/alreadyExistsError.js +1 -1
- package/dist/es/errors/alreadyExistsError.js.map +1 -1
- package/dist/es/errors/baseError.js +1 -1
- package/dist/es/errors/baseError.js.map +1 -1
- package/dist/es/errors/conflictError.js +1 -1
- package/dist/es/errors/conflictError.js.map +1 -1
- package/dist/es/errors/generalError.js +1 -1
- package/dist/es/errors/generalError.js.map +1 -1
- package/dist/es/errors/guardError.js +1 -1
- package/dist/es/errors/guardError.js.map +1 -1
- package/dist/es/errors/notFoundError.js +1 -1
- package/dist/es/errors/notFoundError.js.map +1 -1
- package/dist/es/errors/notSupportedError.js +1 -1
- package/dist/es/errors/notSupportedError.js.map +1 -1
- package/dist/es/errors/unauthorizedError.js +2 -2
- package/dist/es/errors/unauthorizedError.js.map +1 -1
- package/dist/es/errors/unprocessableError.js +1 -1
- package/dist/es/errors/unprocessableError.js.map +1 -1
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IComponent.js +0 -2
- package/dist/es/models/IComponent.js.map +1 -1
- package/dist/es/models/IError.js.map +1 -1
- package/dist/es/models/IHealth.js +2 -0
- package/dist/es/models/IHealth.js.map +1 -0
- package/dist/es/models/healthStatus.js +21 -0
- package/dist/es/models/healthStatus.js.map +1 -0
- package/dist/types/errors/alreadyExistsError.d.ts +1 -1
- package/dist/types/errors/baseError.d.ts +1 -1
- package/dist/types/errors/conflictError.d.ts +1 -1
- package/dist/types/errors/generalError.d.ts +1 -1
- package/dist/types/errors/guardError.d.ts +1 -1
- package/dist/types/errors/notFoundError.d.ts +1 -1
- package/dist/types/errors/notSupportedError.d.ts +1 -1
- package/dist/types/errors/unauthorizedError.d.ts +2 -2
- package/dist/types/errors/unprocessableError.d.ts +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/models/IComponent.d.ts +6 -0
- package/dist/types/models/IError.d.ts +1 -1
- package/dist/types/models/IHealth.d.ts +32 -0
- package/dist/types/models/healthStatus.d.ts +21 -0
- package/docs/changelog.md +328 -289
- package/docs/reference/classes/AlreadyExistsError.md +1 -1
- package/docs/reference/classes/BaseError.md +1 -1
- package/docs/reference/classes/ConflictError.md +1 -1
- package/docs/reference/classes/GeneralError.md +1 -1
- package/docs/reference/classes/GuardError.md +1 -1
- package/docs/reference/classes/NotFoundError.md +1 -1
- package/docs/reference/classes/NotSupportedError.md +1 -1
- package/docs/reference/classes/UnauthorizedError.md +2 -2
- package/docs/reference/classes/UnprocessableError.md +1 -1
- package/docs/reference/index.md +3 -0
- package/docs/reference/interfaces/IComponent.md +14 -0
- package/docs/reference/interfaces/IError.md +1 -1
- package/docs/reference/interfaces/IHealth.md +55 -0
- package/docs/reference/type-aliases/HealthStatus.md +5 -0
- package/docs/reference/variables/HealthStatus.md +25 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Class: UnauthorizedError
|
|
2
2
|
|
|
3
|
-
Class to handle errors which are triggered by access not being
|
|
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
|
|
29
|
+
The message as an i18n key.
|
|
30
30
|
|
|
31
31
|
##### properties?
|
|
32
32
|
|
package/docs/reference/index.md
CHANGED
|
@@ -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.
|
|
@@ -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,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.
|
|
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.
|
|
17
|
+
"@twin.org/nameof": "0.0.3-next.33",
|
|
18
18
|
"intl-messageformat": "11.2.0",
|
|
19
19
|
"rfc6902": "5.2.0"
|
|
20
20
|
},
|