@twin.org/core 0.0.1-next.9 → 0.0.2-next.3

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 (77) hide show
  1. package/dist/cjs/index.cjs +1574 -833
  2. package/dist/esm/index.mjs +1571 -834
  3. package/dist/types/errors/baseError.d.ts +8 -1
  4. package/dist/types/factories/factory.d.ts +20 -1
  5. package/dist/types/helpers/arrayHelper.d.ts +13 -0
  6. package/dist/types/helpers/envHelper.d.ts +16 -0
  7. package/dist/types/helpers/errorHelper.d.ts +2 -1
  8. package/dist/types/helpers/jsonHelper.d.ts +30 -0
  9. package/dist/types/helpers/objectHelper.d.ts +25 -0
  10. package/dist/types/helpers/uint8ArrayHelper.d.ts +11 -0
  11. package/dist/types/index.d.ts +6 -0
  12. package/dist/types/models/IComponent.d.ts +12 -3
  13. package/dist/types/models/II18nShared.d.ts +29 -0
  14. package/dist/types/models/coerceType.d.ts +49 -0
  15. package/dist/types/models/compressionType.d.ts +1 -1
  16. package/dist/types/models/objectOrArray.d.ts +4 -0
  17. package/dist/types/utils/asyncCache.d.ts +10 -1
  18. package/dist/types/utils/coerce.d.ts +22 -0
  19. package/dist/types/utils/guards.d.ts +35 -0
  20. package/dist/types/utils/is.d.ts +12 -0
  21. package/dist/types/utils/sharedStore.d.ts +23 -0
  22. package/dist/types/utils/validation.d.ts +2 -0
  23. package/docs/changelog.md +323 -1
  24. package/docs/reference/classes/AlreadyExistsError.md +103 -27
  25. package/docs/reference/classes/ArrayHelper.md +71 -5
  26. package/docs/reference/classes/AsyncCache.md +75 -13
  27. package/docs/reference/classes/Base32.md +9 -5
  28. package/docs/reference/classes/Base58.md +9 -5
  29. package/docs/reference/classes/Base64.md +12 -6
  30. package/docs/reference/classes/Base64Url.md +9 -5
  31. package/docs/reference/classes/BaseError.md +101 -29
  32. package/docs/reference/classes/BitString.md +23 -11
  33. package/docs/reference/classes/Coerce.md +110 -12
  34. package/docs/reference/classes/Compression.md +19 -11
  35. package/docs/reference/classes/ConflictError.md +106 -28
  36. package/docs/reference/classes/Converter.md +72 -28
  37. package/docs/reference/classes/EnvHelper.md +45 -0
  38. package/docs/reference/classes/ErrorHelper.md +19 -7
  39. package/docs/reference/classes/Factory.md +95 -17
  40. package/docs/reference/classes/FilenameHelper.md +6 -4
  41. package/docs/reference/classes/GeneralError.md +101 -27
  42. package/docs/reference/classes/GuardError.md +106 -28
  43. package/docs/reference/classes/Guards.md +398 -80
  44. package/docs/reference/classes/HexHelper.md +18 -8
  45. package/docs/reference/classes/I18n.md +46 -20
  46. package/docs/reference/classes/Is.md +179 -51
  47. package/docs/reference/classes/JsonHelper.md +146 -10
  48. package/docs/reference/classes/NotFoundError.md +103 -27
  49. package/docs/reference/classes/NotImplementedError.md +97 -25
  50. package/docs/reference/classes/NotSupportedError.md +100 -26
  51. package/docs/reference/classes/ObjectHelper.md +197 -39
  52. package/docs/reference/classes/RandomHelper.md +6 -4
  53. package/docs/reference/classes/SharedStore.md +94 -0
  54. package/docs/reference/classes/StringHelper.md +54 -20
  55. package/docs/reference/classes/Uint8ArrayHelper.md +35 -0
  56. package/docs/reference/classes/UnauthorizedError.md +100 -26
  57. package/docs/reference/classes/UnprocessableError.md +101 -27
  58. package/docs/reference/classes/Url.md +37 -17
  59. package/docs/reference/classes/Urn.md +63 -27
  60. package/docs/reference/classes/Validation.md +349 -135
  61. package/docs/reference/classes/ValidationError.md +100 -26
  62. package/docs/reference/index.md +7 -0
  63. package/docs/reference/interfaces/IComponent.md +30 -8
  64. package/docs/reference/interfaces/IError.md +2 -2
  65. package/docs/reference/interfaces/II18nShared.md +47 -0
  66. package/docs/reference/interfaces/IKeyValue.md +3 -1
  67. package/docs/reference/interfaces/ILabelledValue.md +3 -1
  68. package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
  69. package/docs/reference/interfaces/IPatchOperation.md +1 -1
  70. package/docs/reference/interfaces/IValidationFailure.md +1 -1
  71. package/docs/reference/type-aliases/CoerceType.md +5 -0
  72. package/docs/reference/type-aliases/CompressionType.md +1 -1
  73. package/docs/reference/type-aliases/ObjectOrArray.md +11 -0
  74. package/docs/reference/variables/CoerceType.md +67 -0
  75. package/docs/reference/variables/CompressionType.md +1 -1
  76. package/locales/en.json +14 -1
  77. package/package.json +7 -7
@@ -8,33 +8,39 @@ Class to handle errors which are triggered by entity validation.
8
8
 
9
9
  ## Constructors
10
10
 
11
- ### new ValidationError()
11
+ ### Constructor
12
12
 
13
- > **new ValidationError**(`source`, `validationObject`, `validationFailures`): [`ValidationError`](ValidationError.md)
13
+ > **new ValidationError**(`source`, `validationObject`, `validationFailures`): `ValidationError`
14
14
 
15
15
  Create a new instance of ValidationError.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **source**: `string`
19
+ ##### source
20
+
21
+ `string`
20
22
 
21
23
  The source of the error.
22
24
 
23
- **validationObject**: `string`
25
+ ##### validationObject
26
+
27
+ `string`
24
28
 
25
29
  The object that failed validation.
26
30
 
27
- **validationFailures**: [`IValidationFailure`](../interfaces/IValidationFailure.md)[]
31
+ ##### validationFailures
32
+
33
+ [`IValidationFailure`](../interfaces/IValidationFailure.md)[]
28
34
 
29
35
  The validation failures.
30
36
 
31
37
  #### Returns
32
38
 
33
- [`ValidationError`](ValidationError.md)
39
+ `ValidationError`
34
40
 
35
41
  #### Overrides
36
42
 
37
- [`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructors)
43
+ [`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructor)
38
44
 
39
45
  ## Properties
40
46
 
@@ -58,7 +64,7 @@ Any additional information for the error.
58
64
 
59
65
  #### Index Signature
60
66
 
61
- \[`id`: `string`\]: `unknown`
67
+ \[`id`: `string`\]: `unknown`
62
68
 
63
69
  #### Inherited from
64
70
 
@@ -94,7 +100,9 @@ Construct an error from an existing one.
94
100
 
95
101
  #### Parameters
96
102
 
97
- **err**: `unknown`
103
+ ##### err
104
+
105
+ `unknown`
98
106
 
99
107
  The existing error.
100
108
 
@@ -118,7 +126,9 @@ Flatten an error tree.
118
126
 
119
127
  #### Parameters
120
128
 
121
- **err**: `unknown`
129
+ ##### err
130
+
131
+ `unknown`
122
132
 
123
133
  The starting error.
124
134
 
@@ -142,10 +152,12 @@ Expand an error tree.
142
152
 
143
153
  #### Parameters
144
154
 
145
- **errors**: `undefined` \| [`IError`](../interfaces/IError.md)[]
155
+ ##### errors
146
156
 
147
157
  The list of errors to expand.
148
158
 
159
+ `undefined` | [`IError`](../interfaces/IError.md)[]
160
+
149
161
  #### Returns
150
162
 
151
163
  `undefined` \| [`IError`](../interfaces/IError.md)
@@ -166,14 +178,18 @@ Test to see if the error has the specified error name.
166
178
 
167
179
  #### Parameters
168
180
 
169
- **error**: `unknown`
181
+ ##### error
182
+
183
+ `unknown`
170
184
 
171
185
  The error to test.
172
186
 
173
- **name**: `string` \| `RegExp`
187
+ ##### name
174
188
 
175
189
  The name to check for.
176
190
 
191
+ `string` | `RegExp`
192
+
177
193
  #### Returns
178
194
 
179
195
  `error is BaseError`
@@ -194,14 +210,18 @@ Test to see if the error has the specified error message.
194
210
 
195
211
  #### Parameters
196
212
 
197
- **error**: `unknown`
213
+ ##### error
214
+
215
+ `unknown`
198
216
 
199
217
  The error to test.
200
218
 
201
- **message**: `string` \| `RegExp`
219
+ ##### message
202
220
 
203
221
  The message to check for.
204
222
 
223
+ `string` | `RegExp`
224
+
205
225
  #### Returns
206
226
 
207
227
  `error is BaseError`
@@ -222,14 +242,18 @@ Test to see if the error has the specified error code.
222
242
 
223
243
  #### Parameters
224
244
 
225
- **error**: `unknown`
245
+ ##### error
246
+
247
+ `unknown`
226
248
 
227
249
  The error to test.
228
250
 
229
- **code**: `string` \| `RegExp`
251
+ ##### code
230
252
 
231
253
  The code to check for.
232
254
 
255
+ `string` | `RegExp`
256
+
233
257
  #### Returns
234
258
 
235
259
  `boolean`
@@ -250,14 +274,18 @@ Test to see if any of the errors or children have the given error name.
250
274
 
251
275
  #### Parameters
252
276
 
253
- **error**: `unknown`
277
+ ##### error
278
+
279
+ `unknown`
254
280
 
255
281
  The error to test.
256
282
 
257
- **name**: `string` \| `RegExp`
283
+ ##### name
258
284
 
259
285
  The name to check for.
260
286
 
287
+ `string` | `RegExp`
288
+
261
289
  #### Returns
262
290
 
263
291
  `error is BaseError`
@@ -278,14 +306,18 @@ Test to see if any of the errors or children have the given error message.
278
306
 
279
307
  #### Parameters
280
308
 
281
- **error**: `unknown`
309
+ ##### error
310
+
311
+ `unknown`
282
312
 
283
313
  The error to test.
284
314
 
285
- **message**: `string` \| `RegExp`
315
+ ##### message
286
316
 
287
317
  The message to check for.
288
318
 
319
+ `string` | `RegExp`
320
+
289
321
  #### Returns
290
322
 
291
323
  `error is BaseError`
@@ -306,11 +338,15 @@ Test to see if any of the errors or children are from a specific class.
306
338
 
307
339
  #### Parameters
308
340
 
309
- **error**: `unknown`
341
+ ##### error
342
+
343
+ `unknown`
310
344
 
311
345
  The error to test.
312
346
 
313
- **cls**: `string`
347
+ ##### cls
348
+
349
+ `string`
314
350
 
315
351
  The class to check for.
316
352
 
@@ -334,14 +370,18 @@ Test to see if any of the errors or children have the given error code.
334
370
 
335
371
  #### Parameters
336
372
 
337
- **error**: `unknown`
373
+ ##### error
374
+
375
+ `unknown`
338
376
 
339
377
  The error to test.
340
378
 
341
- **code**: `string` \| `RegExp`
379
+ ##### code
342
380
 
343
381
  The code to check for.
344
382
 
383
+ `string` | `RegExp`
384
+
345
385
  #### Returns
346
386
 
347
387
  `error is BaseError`
@@ -354,12 +394,46 @@ True if the error has the name.
354
394
 
355
395
  ***
356
396
 
397
+ ### isEmpty()
398
+
399
+ > `static` **isEmpty**(`err`): `boolean`
400
+
401
+ Is the error empty.
402
+
403
+ #### Parameters
404
+
405
+ ##### err
406
+
407
+ [`IError`](../interfaces/IError.md)
408
+
409
+ The error to check for being empty.
410
+
411
+ #### Returns
412
+
413
+ `boolean`
414
+
415
+ True if the error is empty.
416
+
417
+ #### Inherited from
418
+
419
+ [`BaseError`](BaseError.md).[`isEmpty`](BaseError.md#isempty)
420
+
421
+ ***
422
+
357
423
  ### toJsonObject()
358
424
 
359
- > **toJsonObject**(): [`IError`](../interfaces/IError.md)
425
+ > **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
360
426
 
361
427
  Serialize the error to the error model.
362
428
 
429
+ #### Parameters
430
+
431
+ ##### includeStackTrace?
432
+
433
+ `boolean`
434
+
435
+ Whether to include the error stack in the model, defaults to false.
436
+
363
437
  #### Returns
364
438
 
365
439
  [`IError`](../interfaces/IError.md)
@@ -19,6 +19,7 @@
19
19
  - [ValidationError](classes/ValidationError.md)
20
20
  - [Factory](classes/Factory.md)
21
21
  - [ArrayHelper](classes/ArrayHelper.md)
22
+ - [EnvHelper](classes/EnvHelper.md)
22
23
  - [ErrorHelper](classes/ErrorHelper.md)
23
24
  - [FilenameHelper](classes/FilenameHelper.md)
24
25
  - [HexHelper](classes/HexHelper.md)
@@ -26,6 +27,7 @@
26
27
  - [ObjectHelper](classes/ObjectHelper.md)
27
28
  - [RandomHelper](classes/RandomHelper.md)
28
29
  - [StringHelper](classes/StringHelper.md)
30
+ - [Uint8ArrayHelper](classes/Uint8ArrayHelper.md)
29
31
  - [BitString](classes/BitString.md)
30
32
  - [Url](classes/Url.md)
31
33
  - [Urn](classes/Urn.md)
@@ -36,12 +38,14 @@
36
38
  - [Guards](classes/Guards.md)
37
39
  - [I18n](classes/I18n.md)
38
40
  - [Is](classes/Is.md)
41
+ - [SharedStore](classes/SharedStore.md)
39
42
  - [Validation](classes/Validation.md)
40
43
 
41
44
  ## Interfaces
42
45
 
43
46
  - [IComponent](interfaces/IComponent.md)
44
47
  - [IError](interfaces/IError.md)
48
+ - [II18nShared](interfaces/II18nShared.md)
45
49
  - [IKeyValue](interfaces/IKeyValue.md)
46
50
  - [ILabelledValue](interfaces/ILabelledValue.md)
47
51
  - [ILocale](interfaces/ILocale.md)
@@ -53,9 +57,12 @@
53
57
 
54
58
  ## Type Aliases
55
59
 
60
+ - [CoerceType](type-aliases/CoerceType.md)
56
61
  - [CompressionType](type-aliases/CompressionType.md)
62
+ - [ObjectOrArray](type-aliases/ObjectOrArray.md)
57
63
 
58
64
  ## Variables
59
65
 
60
66
  - [ComponentFactory](variables/ComponentFactory.md)
67
+ - [CoerceType](variables/CoerceType.md)
61
68
  - [CompressionType](variables/CompressionType.md)
@@ -14,16 +14,22 @@ The name of the component.
14
14
 
15
15
  ### bootstrap()?
16
16
 
17
- > `optional` **bootstrap**(`nodeLoggingConnectorType`?): `Promise`\<`boolean`\>
17
+ > `optional` **bootstrap**(`nodeLoggingConnectorType`, `componentState?`): `Promise`\<`boolean`\>
18
18
 
19
19
  Bootstrap the component by creating and initializing any resources it needs.
20
20
 
21
21
  #### Parameters
22
22
 
23
- **nodeLoggingConnectorType?**: `string`
23
+ ##### nodeLoggingConnectorType
24
24
 
25
25
  The node logging connector type, defaults to "node-logging".
26
26
 
27
+ `undefined` | `string`
28
+
29
+ ##### componentState?
30
+
31
+ A persistent state which can be modified by the method.
32
+
27
33
  #### Returns
28
34
 
29
35
  `Promise`\<`boolean`\>
@@ -34,20 +40,28 @@ True if the bootstrapping process was successful.
34
40
 
35
41
  ### start()?
36
42
 
37
- > `optional` **start**(`nodeIdentity`, `nodeLoggingConnectorType`?): `Promise`\<`void`\>
43
+ > `optional` **start**(`nodeIdentity`, `nodeLoggingConnectorType`, `componentState?`): `Promise`\<`void`\>
38
44
 
39
45
  The component needs to be started when the node is initialized.
40
46
 
41
47
  #### Parameters
42
48
 
43
- **nodeIdentity**: `string`
49
+ ##### nodeIdentity
50
+
51
+ `string`
44
52
 
45
53
  The identity of the node starting the component.
46
54
 
47
- **nodeLoggingConnectorType?**: `string`
55
+ ##### nodeLoggingConnectorType
48
56
 
49
57
  The node logging connector type, defaults to "node-logging".
50
58
 
59
+ `undefined` | `string`
60
+
61
+ ##### componentState?
62
+
63
+ A persistent state which can be modified by the method.
64
+
51
65
  #### Returns
52
66
 
53
67
  `Promise`\<`void`\>
@@ -58,20 +72,28 @@ Nothing.
58
72
 
59
73
  ### stop()?
60
74
 
61
- > `optional` **stop**(`nodeIdentity`, `nodeLoggingConnectorType`?): `Promise`\<`void`\>
75
+ > `optional` **stop**(`nodeIdentity`, `nodeLoggingConnectorType`, `componentState?`): `Promise`\<`void`\>
62
76
 
63
77
  The component needs to be stopped when the node is closed.
64
78
 
65
79
  #### Parameters
66
80
 
67
- **nodeIdentity**: `string`
81
+ ##### nodeIdentity
82
+
83
+ `string`
68
84
 
69
85
  The identity of the node stopping the component.
70
86
 
71
- **nodeLoggingConnectorType?**: `string`
87
+ ##### nodeLoggingConnectorType
72
88
 
73
89
  The node logging connector type, defaults to "node-logging".
74
90
 
91
+ `undefined` | `string`
92
+
93
+ ##### componentState?
94
+
95
+ A persistent state which can be modified by the method.
96
+
75
97
  #### Returns
76
98
 
77
99
  `Promise`\<`void`\>
@@ -36,7 +36,7 @@ Any additional information for the error.
36
36
 
37
37
  #### Index Signature
38
38
 
39
- \[`id`: `string`\]: `unknown`
39
+ \[`id`: `string`\]: `unknown`
40
40
 
41
41
  ***
42
42
 
@@ -50,6 +50,6 @@ The stack trace for the error.
50
50
 
51
51
  ### inner?
52
52
 
53
- > `optional` **inner**: [`IError`](IError.md)
53
+ > `optional` **inner**: `IError`
54
54
 
55
55
  The inner error if there was one.
@@ -0,0 +1,47 @@
1
+ # Interface: II18nShared
2
+
3
+ The shared state for the I18n global.
4
+
5
+ ## Properties
6
+
7
+ ### localeDictionaries
8
+
9
+ > **localeDictionaries**: `object`
10
+
11
+ Dictionaries for lookups.
12
+
13
+ #### Index Signature
14
+
15
+ \[`locale`: `string`\]: `object`
16
+
17
+ ***
18
+
19
+ ### currentLocale
20
+
21
+ > **currentLocale**: `string`
22
+
23
+ The current locale.
24
+
25
+ ***
26
+
27
+ ### localeChangedHandlers
28
+
29
+ > **localeChangedHandlers**: `object`
30
+
31
+ Change handler for the locale being updated.
32
+
33
+ #### Index Signature
34
+
35
+ \[`id`: `string`\]: (`locale`) => `void`
36
+
37
+ ***
38
+
39
+ ### dictionaryChangedHandlers
40
+
41
+ > **dictionaryChangedHandlers**: `object`
42
+
43
+ Change handler for the dictionaries being updated.
44
+
45
+ #### Index Signature
46
+
47
+ \[`id`: `string`\]: (`locale`) => `void`
@@ -4,7 +4,9 @@ Interface describing a key/value pair.
4
4
 
5
5
  ## Type Parameters
6
6
 
7
- **T**
7
+ ### T
8
+
9
+ `T`
8
10
 
9
11
  ## Properties
10
12
 
@@ -4,7 +4,9 @@ Interface describing a label/value pair.
4
4
 
5
5
  ## Type Parameters
6
6
 
7
- **T**
7
+ ### T
8
+
9
+ `T`
8
10
 
9
11
  ## Properties
10
12
 
@@ -4,4 +4,4 @@ Type for the JSON locale dictionary files.
4
4
 
5
5
  ## Indexable
6
6
 
7
- \[`key`: `string`\]: `string` \| [`ILocaleDictionary`](ILocaleDictionary.md)
7
+ \[`key`: `string`\]: `string` \| `ILocaleDictionary`
@@ -6,7 +6,7 @@ Interface describing a patch operation to add a property.
6
6
 
7
7
  ### op
8
8
 
9
- > **op**: `"replace"` \| `"add"` \| `"remove"` \| `"copy"` \| `"move"` \| `"test"`
9
+ > **op**: `"add"` \| `"remove"` \| `"replace"` \| `"move"` \| `"copy"` \| `"test"`
10
10
 
11
11
  The operation that was performed on the item.
12
12
 
@@ -36,4 +36,4 @@ Additional properties for the validation failure.
36
36
 
37
37
  #### Index Signature
38
38
 
39
- \[`id`: `string`\]: `unknown`
39
+ \[`id`: `string`\]: `unknown`
@@ -0,0 +1,5 @@
1
+ # Type Alias: CoerceType
2
+
3
+ > **CoerceType** = *typeof* [`CoerceType`](../variables/CoerceType.md)\[keyof *typeof* [`CoerceType`](../variables/CoerceType.md)\]
4
+
5
+ The types the extracted data can be coerced to.
@@ -1,5 +1,5 @@
1
1
  # Type Alias: CompressionType
2
2
 
3
- > **CompressionType**: *typeof* [`CompressionType`](../variables/CompressionType.md)\[keyof *typeof* [`CompressionType`](../variables/CompressionType.md)\]
3
+ > **CompressionType** = *typeof* [`CompressionType`](../variables/CompressionType.md)\[keyof *typeof* [`CompressionType`](../variables/CompressionType.md)\]
4
4
 
5
5
  Compression types.
@@ -0,0 +1,11 @@
1
+ # Type Alias: ObjectOrArray\<T\>
2
+
3
+ > **ObjectOrArray**\<`T`\> = `T` \| `T`[]
4
+
5
+ Object or array data type
6
+
7
+ ## Type Parameters
8
+
9
+ ### T
10
+
11
+ `T` = `unknown`
@@ -0,0 +1,67 @@
1
+ # Variable: CoerceType
2
+
3
+ > `const` **CoerceType**: `object`
4
+
5
+ The types the extracted data can be coerced to.
6
+
7
+ ## Type declaration
8
+
9
+ ### String
10
+
11
+ > `readonly` **String**: `"string"` = `"string"`
12
+
13
+ String.
14
+
15
+ ### Number
16
+
17
+ > `readonly` **Number**: `"number"` = `"number"`
18
+
19
+ Number.
20
+
21
+ ### Integer
22
+
23
+ > `readonly` **Integer**: `"integer"` = `"integer"`
24
+
25
+ Integer.
26
+
27
+ ### Boolean
28
+
29
+ > `readonly` **Boolean**: `"boolean"` = `"boolean"`
30
+
31
+ Boolean.
32
+
33
+ ### BigInt
34
+
35
+ > `readonly` **BigInt**: `"bigint"` = `"bigint"`
36
+
37
+ Big Integer.
38
+
39
+ ### Date
40
+
41
+ > `readonly` **Date**: `"date"` = `"date"`
42
+
43
+ Date.
44
+
45
+ ### DateTime
46
+
47
+ > `readonly` **DateTime**: `"datetime"` = `"datetime"`
48
+
49
+ Date Time.
50
+
51
+ ### Time
52
+
53
+ > `readonly` **Time**: `"time"` = `"time"`
54
+
55
+ Time.
56
+
57
+ ### Object
58
+
59
+ > `readonly` **Object**: `"object"` = `"object"`
60
+
61
+ Object.
62
+
63
+ ### Uint8Array
64
+
65
+ > `readonly` **Uint8Array**: `"uint8array"` = `"uint8array"`
66
+
67
+ Uint8Array.
@@ -16,4 +16,4 @@ Gzip.
16
16
 
17
17
  > `readonly` **Deflate**: `"deflate"` = `"deflate"`
18
18
 
19
- deflate.
19
+ Deflate.
package/locales/en.json CHANGED
@@ -8,6 +8,10 @@
8
8
  "beTextMinMax": "{fieldName} must be longer than {minLength} and shorter than {maxLength} characters",
9
9
  "beTextMin": "{fieldName} must be longer than {minLength} characters",
10
10
  "beTextMax": "{fieldName} must be shorter than {maxLength} characters",
11
+ "beTextBase58": "{fieldName} must be text formatted using Base58 characters",
12
+ "beTextBase64": "{fieldName} must be text formatted using Base64 characters",
13
+ "beTextHex": "{fieldName} must be text formatted using Hex characters",
14
+ "beTextRegExp": "{fieldName} must be text formatted using the matching pattern {format}",
11
15
  "beNumber": "{fieldName} must be a number",
12
16
  "beNumberMinMax": "{fieldName} must be >= {minValue} and <= {maxValue}",
13
17
  "beNumberMin": "{fieldName} must be >= {minValue}",
@@ -44,8 +48,10 @@
44
48
  "stringEmpty": "Property \"{property}\" must have a value, it is empty",
45
49
  "stringBase64": "Property \"{property}\" must be a base64 encoded string, it is \"{value}\"",
46
50
  "stringBase64Url": "Property \"{property}\" must be a base64 url encoded string, it is \"{value}\"",
51
+ "stringBase58": "Property \"{property}\" must be a base58 encoded string, it is \"{value}\"",
47
52
  "stringHex": "Property \"{property}\" must be a hex string, it is \"{value}\"",
48
53
  "stringHexLength": "Property \"{property}\" must be a hex string of length \"{options}\", it is \"{value}\"",
54
+ "stringJson": "Property \"{property}\" must be a JSON string",
49
55
  "number": "Property \"{property}\" must be a number, it is \"{value}\"",
50
56
  "integer": "Property \"{property}\" must be an integer, it is \"{value}\"",
51
57
  "bigint": "Property \"{property}\" must be a bigint, it is \"{value}\"",
@@ -59,6 +65,8 @@
59
65
  "array": "Property \"{property}\" must be an array, it is \"{value}\"",
60
66
  "arrayValue": "Property \"{property}\" must be an array with at least one item",
61
67
  "arrayOneOf": "Property \"{property}\" must be one of [{options}], it is \"{value}\"",
68
+ "arrayStartsWith": "Property \"{property}\" must be an array starting with [{startValues}], it is \"{value}\"",
69
+ "arrayEndsWith": "Property \"{property}\" must be an array ending with [{endValues}], it is \"{value}\"",
62
70
  "uint8Array": "Property \"{property}\" must be a Uint8Array, it is \"{value}\"",
63
71
  "function": "Property \"{property}\" must be a function, it is \"{value}\"",
64
72
  "urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
@@ -66,7 +74,9 @@
66
74
  "email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\""
67
75
  },
68
76
  "objectHelper": {
69
- "failedBytesToJSON": "Failed converting bytes to JSON"
77
+ "failedBytesToJSON": "Failed converting bytes to JSON",
78
+ "cannotSetArrayIndex": "Cannot set property \"{property}\" using index \"{index}\" as it is not an array",
79
+ "cannotSetProperty": "Cannot set property \"{property}\" when the target is not an object"
70
80
  },
71
81
  "common": {
72
82
  "notImplementedMethod": "The method \"{method}\" has not been implemented",
@@ -87,6 +97,9 @@
87
97
  },
88
98
  "base58": {
89
99
  "invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
100
+ },
101
+ "jsonHelper": {
102
+ "failedPatch": "Failed to patch the JSON object, patch index \"{index}\" failed"
90
103
  }
91
104
  },
92
105
  "errorNames": {