@twin.org/core 0.0.2-next.8 → 0.0.2

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 (225) hide show
  1. package/README.md +1 -9
  2. package/dist/es/encoding/base32.js +75 -0
  3. package/dist/es/encoding/base32.js.map +1 -0
  4. package/dist/es/encoding/base58.js +124 -0
  5. package/dist/es/encoding/base58.js.map +1 -0
  6. package/dist/es/encoding/base64.js +231 -0
  7. package/dist/es/encoding/base64.js.map +1 -0
  8. package/dist/es/encoding/base64Url.js +42 -0
  9. package/dist/es/encoding/base64Url.js.map +1 -0
  10. package/dist/es/errors/alreadyExistsError.js +22 -0
  11. package/dist/es/errors/alreadyExistsError.js.map +1 -0
  12. package/dist/es/errors/baseError.js +257 -0
  13. package/dist/es/errors/baseError.js.map +1 -0
  14. package/dist/es/errors/conflictError.js +23 -0
  15. package/dist/es/errors/conflictError.js.map +1 -0
  16. package/dist/es/errors/generalError.js +21 -0
  17. package/dist/es/errors/generalError.js.map +1 -0
  18. package/dist/es/errors/guardError.js +27 -0
  19. package/dist/es/errors/guardError.js.map +1 -0
  20. package/dist/es/errors/notFoundError.js +22 -0
  21. package/dist/es/errors/notFoundError.js.map +1 -0
  22. package/dist/es/errors/notImplementedError.js +24 -0
  23. package/dist/es/errors/notImplementedError.js.map +1 -0
  24. package/dist/es/errors/notSupportedError.js +21 -0
  25. package/dist/es/errors/notSupportedError.js.map +1 -0
  26. package/dist/es/errors/unauthorizedError.js +21 -0
  27. package/dist/es/errors/unauthorizedError.js.map +1 -0
  28. package/dist/es/errors/unprocessableError.js +21 -0
  29. package/dist/es/errors/unprocessableError.js.map +1 -0
  30. package/dist/es/errors/validationError.js +23 -0
  31. package/dist/es/errors/validationError.js.map +1 -0
  32. package/dist/es/factories/componentFactory.js +9 -0
  33. package/dist/es/factories/componentFactory.js.map +1 -0
  34. package/dist/es/factories/factory.js +297 -0
  35. package/dist/es/factories/factory.js.map +1 -0
  36. package/dist/es/helpers/arrayHelper.js +46 -0
  37. package/dist/es/helpers/arrayHelper.js.map +1 -0
  38. package/dist/es/helpers/envHelper.js +39 -0
  39. package/dist/es/helpers/envHelper.js.map +1 -0
  40. package/dist/es/helpers/errorHelper.js +100 -0
  41. package/dist/es/helpers/errorHelper.js.map +1 -0
  42. package/dist/es/helpers/filenameHelper.js +32 -0
  43. package/dist/es/helpers/filenameHelper.js.map +1 -0
  44. package/dist/es/helpers/hexHelper.js +45 -0
  45. package/dist/es/helpers/hexHelper.js.map +1 -0
  46. package/dist/es/helpers/jsonHelper.js +163 -0
  47. package/dist/es/helpers/jsonHelper.js.map +1 -0
  48. package/dist/es/helpers/numberHelper.js +30 -0
  49. package/dist/es/helpers/numberHelper.js.map +1 -0
  50. package/dist/es/helpers/objectHelper.js +309 -0
  51. package/dist/es/helpers/objectHelper.js.map +1 -0
  52. package/dist/es/helpers/randomHelper.js +66 -0
  53. package/dist/es/helpers/randomHelper.js.map +1 -0
  54. package/dist/es/helpers/stringHelper.js +252 -0
  55. package/dist/es/helpers/stringHelper.js.map +1 -0
  56. package/dist/es/helpers/uint8ArrayHelper.js +26 -0
  57. package/dist/es/helpers/uint8ArrayHelper.js.map +1 -0
  58. package/dist/es/index.js +60 -0
  59. package/dist/es/index.js.map +1 -0
  60. package/dist/es/models/IComponent.js +2 -0
  61. package/dist/es/models/IComponent.js.map +1 -0
  62. package/dist/es/models/IError.js +4 -0
  63. package/dist/es/models/IError.js.map +1 -0
  64. package/dist/es/models/IHealth.js +2 -0
  65. package/dist/es/models/IHealth.js.map +1 -0
  66. package/dist/es/models/II18nShared.js +2 -0
  67. package/dist/es/models/II18nShared.js.map +1 -0
  68. package/dist/es/models/IKeyValue.js +2 -0
  69. package/dist/es/models/IKeyValue.js.map +1 -0
  70. package/dist/es/models/ILabelledValue.js +2 -0
  71. package/dist/es/models/ILabelledValue.js.map +1 -0
  72. package/dist/es/models/ILocale.js +2 -0
  73. package/dist/es/models/ILocale.js.map +1 -0
  74. package/dist/es/models/ILocaleDictionary.js +4 -0
  75. package/dist/es/models/ILocaleDictionary.js.map +1 -0
  76. package/dist/es/models/ILocalesIndex.js +2 -0
  77. package/dist/es/models/ILocalesIndex.js.map +1 -0
  78. package/dist/es/models/IPatchOperation.js +4 -0
  79. package/dist/es/models/IPatchOperation.js.map +1 -0
  80. package/dist/es/models/IUrlParts.js +4 -0
  81. package/dist/es/models/IUrlParts.js.map +1 -0
  82. package/dist/es/models/IValidationFailure.js +2 -0
  83. package/dist/es/models/IValidationFailure.js.map +1 -0
  84. package/dist/es/models/coerceType.js +49 -0
  85. package/dist/es/models/coerceType.js.map +1 -0
  86. package/dist/es/models/compressionType.js +17 -0
  87. package/dist/es/models/compressionType.js.map +1 -0
  88. package/dist/es/models/healthStatus.js +21 -0
  89. package/dist/es/models/healthStatus.js.map +1 -0
  90. package/dist/es/types/bitString.js +98 -0
  91. package/dist/es/types/bitString.js.map +1 -0
  92. package/dist/es/types/objectOrArray.js +2 -0
  93. package/dist/es/types/objectOrArray.js.map +1 -0
  94. package/dist/es/types/singleOccurrenceArray.js +2 -0
  95. package/dist/es/types/singleOccurrenceArray.js.map +1 -0
  96. package/dist/es/types/url.js +144 -0
  97. package/dist/es/types/url.js.map +1 -0
  98. package/dist/es/types/urn.js +211 -0
  99. package/dist/es/types/urn.js.map +1 -0
  100. package/dist/es/utils/asyncCache.js +206 -0
  101. package/dist/es/utils/asyncCache.js.map +1 -0
  102. package/dist/es/utils/coerce.js +269 -0
  103. package/dist/es/utils/coerce.js.map +1 -0
  104. package/dist/es/utils/compression.js +49 -0
  105. package/dist/es/utils/compression.js.map +1 -0
  106. package/dist/es/utils/converter.js +256 -0
  107. package/dist/es/utils/converter.js.map +1 -0
  108. package/dist/es/utils/guards.js +385 -0
  109. package/dist/es/utils/guards.js.map +1 -0
  110. package/dist/es/utils/i18n.js +243 -0
  111. package/dist/es/utils/i18n.js.map +1 -0
  112. package/dist/es/utils/is.js +367 -0
  113. package/dist/es/utils/is.js.map +1 -0
  114. package/dist/es/utils/sharedStore.js +48 -0
  115. package/dist/es/utils/sharedStore.js.map +1 -0
  116. package/dist/es/utils/validation.js +774 -0
  117. package/dist/es/utils/validation.js.map +1 -0
  118. package/dist/types/encoding/base32.d.ts +5 -1
  119. package/dist/types/encoding/base58.d.ts +4 -0
  120. package/dist/types/encoding/base64.d.ts +4 -0
  121. package/dist/types/encoding/base64Url.d.ts +4 -0
  122. package/dist/types/errors/alreadyExistsError.d.ts +6 -3
  123. package/dist/types/errors/baseError.d.ts +2 -2
  124. package/dist/types/errors/conflictError.d.ts +6 -3
  125. package/dist/types/errors/generalError.d.ts +2 -2
  126. package/dist/types/errors/guardError.d.ts +2 -2
  127. package/dist/types/errors/notFoundError.d.ts +6 -3
  128. package/dist/types/errors/notImplementedError.d.ts +6 -2
  129. package/dist/types/errors/notSupportedError.d.ts +6 -3
  130. package/dist/types/errors/unauthorizedError.d.ts +7 -4
  131. package/dist/types/errors/unprocessableError.d.ts +2 -2
  132. package/dist/types/errors/validationError.d.ts +2 -2
  133. package/dist/types/factories/componentFactory.d.ts +2 -2
  134. package/dist/types/factories/factory.d.ts +27 -1
  135. package/dist/types/helpers/arrayHelper.d.ts +1 -8
  136. package/dist/types/helpers/errorHelper.d.ts +1 -1
  137. package/dist/types/helpers/jsonHelper.d.ts +5 -1
  138. package/dist/types/helpers/numberHelper.d.ts +17 -0
  139. package/dist/types/helpers/objectHelper.d.ts +24 -6
  140. package/dist/types/helpers/randomHelper.d.ts +16 -0
  141. package/dist/types/helpers/stringHelper.d.ts +12 -6
  142. package/dist/types/index.d.ts +57 -53
  143. package/dist/types/models/IComponent.d.ts +18 -7
  144. package/dist/types/models/IError.d.ts +1 -1
  145. package/dist/types/models/IHealth.d.ts +32 -0
  146. package/dist/types/models/ILocalesIndex.d.ts +1 -1
  147. package/dist/types/models/IValidationFailure.d.ts +0 -4
  148. package/dist/types/models/healthStatus.d.ts +21 -0
  149. package/dist/types/types/bitString.d.ts +4 -0
  150. package/dist/types/types/singleOccurrenceArray.d.ts +9 -0
  151. package/dist/types/types/url.d.ts +8 -3
  152. package/dist/types/types/urn.d.ts +7 -2
  153. package/dist/types/utils/asyncCache.d.ts +7 -0
  154. package/dist/types/utils/coerce.d.ts +1 -1
  155. package/dist/types/utils/compression.d.ts +5 -1
  156. package/dist/types/utils/guards.d.ts +11 -3
  157. package/dist/types/utils/i18n.d.ts +16 -1
  158. package/dist/types/utils/is.d.ts +8 -1
  159. package/dist/types/utils/validation.d.ts +1 -1
  160. package/docs/changelog.md +1240 -130
  161. package/docs/examples.md +308 -1
  162. package/docs/reference/classes/AlreadyExistsError.md +43 -39
  163. package/docs/reference/classes/ArrayHelper.md +10 -44
  164. package/docs/reference/classes/AsyncCache.md +12 -12
  165. package/docs/reference/classes/Base32.md +11 -3
  166. package/docs/reference/classes/Base58.md +10 -2
  167. package/docs/reference/classes/Base64.md +11 -3
  168. package/docs/reference/classes/Base64Url.md +10 -2
  169. package/docs/reference/classes/BaseError.md +37 -37
  170. package/docs/reference/classes/BitString.md +13 -5
  171. package/docs/reference/classes/Coerce.md +31 -31
  172. package/docs/reference/classes/Compression.md +10 -2
  173. package/docs/reference/classes/ConflictError.md +43 -39
  174. package/docs/reference/classes/Converter.md +18 -18
  175. package/docs/reference/classes/EnvHelper.md +1 -1
  176. package/docs/reference/classes/ErrorHelper.md +5 -5
  177. package/docs/reference/classes/Factory.md +122 -20
  178. package/docs/reference/classes/FilenameHelper.md +1 -1
  179. package/docs/reference/classes/GeneralError.md +38 -38
  180. package/docs/reference/classes/GuardError.md +38 -38
  181. package/docs/reference/classes/Guards.md +80 -34
  182. package/docs/reference/classes/HexHelper.md +6 -6
  183. package/docs/reference/classes/I18n.md +66 -14
  184. package/docs/reference/classes/Is.md +77 -43
  185. package/docs/reference/classes/JsonHelper.md +17 -9
  186. package/docs/reference/classes/NotFoundError.md +43 -39
  187. package/docs/reference/classes/NotImplementedError.md +48 -38
  188. package/docs/reference/classes/NotSupportedError.md +43 -39
  189. package/docs/reference/classes/NumberHelper.md +55 -0
  190. package/docs/reference/classes/ObjectHelper.md +163 -51
  191. package/docs/reference/classes/RandomHelper.md +53 -1
  192. package/docs/reference/classes/SharedStore.md +5 -5
  193. package/docs/reference/classes/StringHelper.md +52 -30
  194. package/docs/reference/classes/Uint8ArrayHelper.md +1 -1
  195. package/docs/reference/classes/UnauthorizedError.md +44 -40
  196. package/docs/reference/classes/UnprocessableError.md +38 -38
  197. package/docs/reference/classes/Url.md +24 -10
  198. package/docs/reference/classes/Urn.md +42 -28
  199. package/docs/reference/classes/Validation.md +27 -27
  200. package/docs/reference/classes/ValidationError.md +37 -37
  201. package/docs/reference/index.md +6 -0
  202. package/docs/reference/interfaces/IComponent.md +57 -27
  203. package/docs/reference/interfaces/IError.md +11 -11
  204. package/docs/reference/interfaces/IHealth.md +55 -0
  205. package/docs/reference/interfaces/II18nShared.md +4 -4
  206. package/docs/reference/interfaces/IKeyValue.md +2 -2
  207. package/docs/reference/interfaces/ILabelledValue.md +2 -2
  208. package/docs/reference/interfaces/ILocale.md +2 -2
  209. package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
  210. package/docs/reference/interfaces/ILocalesIndex.md +1 -1
  211. package/docs/reference/interfaces/IPatchOperation.md +6 -6
  212. package/docs/reference/interfaces/IUrlParts.md +9 -9
  213. package/docs/reference/interfaces/IValidationFailure.md +4 -12
  214. package/docs/reference/type-aliases/HealthStatus.md +5 -0
  215. package/docs/reference/type-aliases/SingleOccurrenceArray.md +15 -0
  216. package/docs/reference/type-aliases/SingleOccurrenceArrayDepthHelper.md +19 -0
  217. package/docs/reference/variables/CoerceType.md +10 -10
  218. package/docs/reference/variables/CompressionType.md +2 -2
  219. package/docs/reference/variables/HealthStatus.md +25 -0
  220. package/locales/.validate-ignore +1 -0
  221. package/locales/en.json +9 -7
  222. package/package.json +24 -12
  223. package/dist/cjs/index.cjs +0 -5175
  224. package/dist/esm/index.mjs +0 -5133
  225. /package/dist/types/{models → types}/objectOrArray.d.ts +0 -0
@@ -0,0 +1,55 @@
1
+ # Interface: IHealth
2
+
3
+ Provides health information for a component.
4
+
5
+ ## Properties
6
+
7
+ ### source {#source}
8
+
9
+ > **source**: `string`
10
+
11
+ The source of the health information.
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
+ ### status {#status}
24
+
25
+ > **status**: [`HealthStatus`](../type-aliases/HealthStatus.md)
26
+
27
+ The overall status of the component, the entries can also report their own health.
28
+
29
+ ***
30
+
31
+ ### message? {#message}
32
+
33
+ > `optional` **message?**: `string`
34
+
35
+ The message for the status if there are further details to provide as an i18n key.
36
+
37
+ ***
38
+
39
+ ### data? {#data}
40
+
41
+ > `optional` **data?**: `object`
42
+
43
+ Data to substitute in the i18n key for the message.
44
+
45
+ #### Index Signature
46
+
47
+ \[`id`: `string`\]: `unknown`
48
+
49
+ ***
50
+
51
+ ### grouped? {#grouped}
52
+
53
+ > `optional` **grouped?**: `IHealth`[]
54
+
55
+ The grouped child components, if any.
@@ -4,7 +4,7 @@ The shared state for the I18n global.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### localeDictionaries
7
+ ### localeDictionaries {#localedictionaries}
8
8
 
9
9
  > **localeDictionaries**: `object`
10
10
 
@@ -16,7 +16,7 @@ Dictionaries for lookups.
16
16
 
17
17
  ***
18
18
 
19
- ### currentLocale
19
+ ### currentLocale {#currentlocale}
20
20
 
21
21
  > **currentLocale**: `string`
22
22
 
@@ -24,7 +24,7 @@ The current locale.
24
24
 
25
25
  ***
26
26
 
27
- ### localeChangedHandlers
27
+ ### localeChangedHandlers {#localechangedhandlers}
28
28
 
29
29
  > **localeChangedHandlers**: `object`
30
30
 
@@ -36,7 +36,7 @@ Change handler for the locale being updated.
36
36
 
37
37
  ***
38
38
 
39
- ### dictionaryChangedHandlers
39
+ ### dictionaryChangedHandlers {#dictionarychangedhandlers}
40
40
 
41
41
  > **dictionaryChangedHandlers**: `object`
42
42
 
@@ -10,7 +10,7 @@ Interface describing a key/value pair.
10
10
 
11
11
  ## Properties
12
12
 
13
- ### key
13
+ ### key {#key}
14
14
 
15
15
  > **key**: `string`
16
16
 
@@ -18,7 +18,7 @@ The key for the item.
18
18
 
19
19
  ***
20
20
 
21
- ### value
21
+ ### value {#value}
22
22
 
23
23
  > **value**: `T`
24
24
 
@@ -10,7 +10,7 @@ Interface describing a label/value pair.
10
10
 
11
11
  ## Properties
12
12
 
13
- ### label
13
+ ### label {#label}
14
14
 
15
15
  > **label**: `string`
16
16
 
@@ -18,7 +18,7 @@ The label for the item.
18
18
 
19
19
  ***
20
20
 
21
- ### value
21
+ ### value {#value}
22
22
 
23
23
  > **value**: `T`
24
24
 
@@ -4,7 +4,7 @@ Model for a local.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### label
7
+ ### label {#label}
8
8
 
9
9
  > **label**: `string`
10
10
 
@@ -12,7 +12,7 @@ The label.
12
12
 
13
13
  ***
14
14
 
15
- ### code
15
+ ### code {#code}
16
16
 
17
17
  > **code**: `string`
18
18
 
@@ -4,4 +4,4 @@ Type for the JSON locale dictionary files.
4
4
 
5
5
  ## Indexable
6
6
 
7
- \[`key`: `string`\]: `string` \| `ILocaleDictionary`
7
+ > \[`key`: `string`\]: `string` \| `ILocaleDictionary`
@@ -4,7 +4,7 @@ Model for a locales index.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### locales
7
+ ### locales {#locales}
8
8
 
9
9
  > **locales**: [`ILocale`](ILocale.md)[]
10
10
 
@@ -4,7 +4,7 @@ Interface describing a patch operation to add a property.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### op
7
+ ### op {#op}
8
8
 
9
9
  > **op**: `"add"` \| `"remove"` \| `"replace"` \| `"move"` \| `"copy"` \| `"test"`
10
10
 
@@ -12,7 +12,7 @@ The operation that was performed on the item.
12
12
 
13
13
  ***
14
14
 
15
- ### path
15
+ ### path {#path}
16
16
 
17
17
  > **path**: `string`
18
18
 
@@ -20,16 +20,16 @@ The path to the object that was changed.
20
20
 
21
21
  ***
22
22
 
23
- ### from?
23
+ ### from? {#from}
24
24
 
25
- > `optional` **from**: `string`
25
+ > `optional` **from?**: `string`
26
26
 
27
27
  The path the value was copied or moved from.
28
28
 
29
29
  ***
30
30
 
31
- ### value?
31
+ ### value? {#value}
32
32
 
33
- > `optional` **value**: `unknown`
33
+ > `optional` **value?**: `unknown`
34
34
 
35
35
  The value to add.
@@ -4,7 +4,7 @@ Model to describe the parts of a url.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### schema
7
+ ### schema {#schema}
8
8
 
9
9
  > **schema**: `string`
10
10
 
@@ -12,7 +12,7 @@ The schema for the url.
12
12
 
13
13
  ***
14
14
 
15
- ### host
15
+ ### host {#host}
16
16
 
17
17
  > **host**: `string`
18
18
 
@@ -20,15 +20,15 @@ The host for the url.
20
20
 
21
21
  ***
22
22
 
23
- ### port?
23
+ ### port? {#port}
24
24
 
25
- > `optional` **port**: `number`
25
+ > `optional` **port?**: `number`
26
26
 
27
27
  The port for the url.
28
28
 
29
29
  ***
30
30
 
31
- ### path
31
+ ### path {#path}
32
32
 
33
33
  > **path**: `string`
34
34
 
@@ -36,16 +36,16 @@ The path for the url.
36
36
 
37
37
  ***
38
38
 
39
- ### params?
39
+ ### params? {#params}
40
40
 
41
- > `optional` **params**: `string`
41
+ > `optional` **params?**: `string`
42
42
 
43
43
  The params for the url.
44
44
 
45
45
  ***
46
46
 
47
- ### hash?
47
+ ### hash? {#hash}
48
48
 
49
- > `optional` **hash**: `string`
49
+ > `optional` **hash?**: `string`
50
50
 
51
51
  The hash for the url.
@@ -4,7 +4,7 @@ Interface describing the reason a validation failed.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### property
7
+ ### property {#property}
8
8
 
9
9
  > **property**: `string`
10
10
 
@@ -12,7 +12,7 @@ The property that failed validation.
12
12
 
13
13
  ***
14
14
 
15
- ### reason
15
+ ### reason {#reason}
16
16
 
17
17
  > **reason**: `string`
18
18
 
@@ -20,17 +20,9 @@ The reason the validation failed as an i18 resource error.
20
20
 
21
21
  ***
22
22
 
23
- ### fieldName?
23
+ ### properties? {#properties}
24
24
 
25
- > `optional` **fieldName**: `string`
26
-
27
- The optional human readable name for the field as an i18 resource.
28
-
29
- ***
30
-
31
- ### properties?
32
-
33
- > `optional` **properties**: `object`
25
+ > `optional` **properties?**: `object`
34
26
 
35
27
  Additional properties for the validation failure.
36
28
 
@@ -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,15 @@
1
+ # Type Alias: SingleOccurrenceArray\<T, U\>
2
+
3
+ > **SingleOccurrenceArray**\<`T`, `U`\> = [`SingleOccurrenceArrayDepthHelper`](SingleOccurrenceArrayDepthHelper.md)\<`T`, `U`, \[\]\>
4
+
5
+ Utility type to create a non-empty array with values of type T and exactly one value of type U.
6
+
7
+ ## Type Parameters
8
+
9
+ ### T
10
+
11
+ `T` = `unknown`
12
+
13
+ ### U
14
+
15
+ `U` = `never`
@@ -0,0 +1,19 @@
1
+ # Type Alias: SingleOccurrenceArrayDepthHelper\<T, U, Depth\>
2
+
3
+ > **SingleOccurrenceArrayDepthHelper**\<`T`, `U`, `Depth`\> = `Depth`\[`"length"`\] *extends* `16` ? \[`U`, `...T[]`\] : \[`U`, `...T[]`\] \| \[`T`, `...SingleOccurrenceArrayDepthHelper<T, U, [0, ...Depth]>`\]
4
+
5
+ Helper with bounded recursion depth to keep type instantiation tractable.
6
+
7
+ ## Type Parameters
8
+
9
+ ### T
10
+
11
+ `T`
12
+
13
+ ### U
14
+
15
+ `U`
16
+
17
+ ### Depth
18
+
19
+ `Depth` *extends* `0`[]
@@ -6,61 +6,61 @@ The types the extracted data can be coerced to.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### String
9
+ ### String {#string}
10
10
 
11
11
  > `readonly` **String**: `"string"` = `"string"`
12
12
 
13
13
  String.
14
14
 
15
- ### Number
15
+ ### Number {#number}
16
16
 
17
17
  > `readonly` **Number**: `"number"` = `"number"`
18
18
 
19
19
  Number.
20
20
 
21
- ### Integer
21
+ ### Integer {#integer}
22
22
 
23
23
  > `readonly` **Integer**: `"integer"` = `"integer"`
24
24
 
25
25
  Integer.
26
26
 
27
- ### Boolean
27
+ ### Boolean {#boolean}
28
28
 
29
29
  > `readonly` **Boolean**: `"boolean"` = `"boolean"`
30
30
 
31
31
  Boolean.
32
32
 
33
- ### BigInt
33
+ ### BigInt {#bigint}
34
34
 
35
35
  > `readonly` **BigInt**: `"bigint"` = `"bigint"`
36
36
 
37
37
  Big Integer.
38
38
 
39
- ### Date
39
+ ### Date {#date}
40
40
 
41
41
  > `readonly` **Date**: `"date"` = `"date"`
42
42
 
43
43
  Date.
44
44
 
45
- ### DateTime
45
+ ### DateTime {#datetime}
46
46
 
47
47
  > `readonly` **DateTime**: `"datetime"` = `"datetime"`
48
48
 
49
49
  Date Time.
50
50
 
51
- ### Time
51
+ ### Time {#time}
52
52
 
53
53
  > `readonly` **Time**: `"time"` = `"time"`
54
54
 
55
55
  Time.
56
56
 
57
- ### Object
57
+ ### Object {#object}
58
58
 
59
59
  > `readonly` **Object**: `"object"` = `"object"`
60
60
 
61
61
  Object.
62
62
 
63
- ### Uint8Array
63
+ ### Uint8Array {#uint8array}
64
64
 
65
65
  > `readonly` **Uint8Array**: `"uint8array"` = `"uint8array"`
66
66
 
@@ -6,13 +6,13 @@ Compression types.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### Gzip
9
+ ### Gzip {#gzip}
10
10
 
11
11
  > `readonly` **Gzip**: `"gzip"` = `"gzip"`
12
12
 
13
13
  Gzip.
14
14
 
15
- ### Deflate
15
+ ### Deflate {#deflate}
16
16
 
17
17
  > `readonly` **Deflate**: `"deflate"` = `"deflate"`
18
18
 
@@ -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.
@@ -0,0 +1 @@
1
+ ^errorNames.*$
package/locales/en.json CHANGED
@@ -38,9 +38,7 @@
38
38
  "beUrn": "{fieldName} must be a correctly formatted urn",
39
39
  "beUrl": "{fieldName} must be a correctly formatted url",
40
40
  "beJSON": "{fieldName} must be correctly formatted JSON",
41
- "beEmail": "{fieldName} must be a correctly formatted e-mail address",
42
- "failed": "Validation failed",
43
- "failedObject": "Validation of \"{objectName}\" failed"
41
+ "beEmail": "{fieldName} must be a correctly formatted e-mail address"
44
42
  },
45
43
  "guard": {
46
44
  "undefined": "Property \"{property}\" must be defined, it is \"{value}\"",
@@ -71,7 +69,9 @@
71
69
  "function": "Property \"{property}\" must be a function, it is \"{value}\"",
72
70
  "urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
73
71
  "url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
74
- "email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\""
72
+ "email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
73
+ "uuidV7": "Property \"{property}\" must be a UUIDv7 formatted string, it is \"{value}\"",
74
+ "uuidV7Compact": "Property \"{property}\" must be a UUIDv7 formatted string in compact mode, it is \"{value}\""
75
75
  },
76
76
  "objectHelper": {
77
77
  "failedBytesToJSON": "Failed converting bytes to JSON",
@@ -84,10 +84,11 @@
84
84
  },
85
85
  "factory": {
86
86
  "noUnregister": "There is no {typeName} registered with the name \"{name}\"",
87
- "noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
87
+ "noGet": "The requested {typeName} \"{name}\" does not exist in the factory",
88
+ "noCreate": "The requested {typeName} \"{name}\" cannot be created by the factory, with params \"{params}\""
88
89
  },
89
90
  "bitString": {
90
- "outOfRange": "The index should be >= 0 and less than the length of the bit string"
91
+ "outOfRange": "The index should be >= 0 and less than the length of the bit string, the index is \"{index}\" and the number of bit is \"{numberBits}\""
91
92
  },
92
93
  "base32": {
93
94
  "invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
@@ -112,7 +113,8 @@
112
113
  "alreadyExistsError": "Already Exists",
113
114
  "notImplementedError": "Not Implemented",
114
115
  "validationError": "Validation",
115
- "unprocessableError": "Unprocessable"
116
+ "unprocessableError": "Unprocessable",
117
+ "unauthorizedError": "Unauthorized"
116
118
  },
117
119
  "validation": {
118
120
  "defaultFieldName": "The field"
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/core",
3
- "version": "0.0.2-next.8",
3
+ "version": "0.0.2",
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,26 +14,38 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/nameof": "0.0.2-next.8",
18
- "intl-messageformat": "10.7.16",
19
- "rfc6902": "5.1.2"
17
+ "@twin.org/nameof": "0.0.2",
18
+ "intl-messageformat": "11.2.6",
19
+ "rfc6902": "5.2.0"
20
20
  },
21
- "main": "./dist/cjs/index.cjs",
22
- "module": "./dist/esm/index.mjs",
21
+ "main": "./dist/es/index.js",
23
22
  "types": "./dist/types/index.d.ts",
24
23
  "exports": {
25
24
  ".": {
26
25
  "types": "./dist/types/index.d.ts",
27
- "require": "./dist/cjs/index.cjs",
28
- "import": "./dist/esm/index.mjs"
26
+ "import": "./dist/es/index.js",
27
+ "default": "./dist/es/index.js"
29
28
  },
30
29
  "./locales/*.json": "./locales/*.json"
31
30
  },
32
31
  "files": [
33
- "dist/cjs",
34
- "dist/esm",
32
+ "dist/es",
35
33
  "dist/types",
36
34
  "locales",
37
35
  "docs"
38
- ]
36
+ ],
37
+ "keywords": [
38
+ "twin",
39
+ "trade",
40
+ "iota",
41
+ "framework",
42
+ "blockchain",
43
+ "core",
44
+ "foundation",
45
+ "utilities"
46
+ ],
47
+ "bugs": {
48
+ "url": "git+https://github.com/iotaledger/framework/issues"
49
+ },
50
+ "homepage": "https://twindev.org"
39
51
  }