@twin.org/data-core 0.0.1-next.29 → 0.0.1-next.30
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/docs/changelog.md +7 -0
- package/docs/reference/classes/DataTypeHelper.md +4 -4
- package/docs/reference/classes/JsonSchemaHelper.md +8 -6
- package/docs/reference/interfaces/IDataTypeHandler.md +1 -1
- package/docs/reference/type-aliases/ISchemaValidationError.md +1 -1
- package/docs/reference/type-aliases/ValidationMode.md +1 -1
- package/package.json +1 -1
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @twin.org/data-core - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.30](https://github.com/twinfoundation/data/compare/data-core-v0.0.1-next.29...data-core-v0.0.1-next.30) (2025-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
|
|
9
|
+
|
|
3
10
|
## [0.0.1-next.29](https://github.com/twinfoundation/data/compare/data-core-v0.0.1-next.28...data-core-v0.0.1-next.29) (2025-03-28)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -4,19 +4,19 @@ Class to help with data types.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new DataTypeHelper**():
|
|
9
|
+
> **new DataTypeHelper**(): `DataTypeHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`DataTypeHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### validate()
|
|
18
18
|
|
|
19
|
-
> `static` **validate**(`propertyName`, `dataType`, `data`, `validationFailures`, `validationMode
|
|
19
|
+
> `static` **validate**(`propertyName`, `dataType`, `data`, `validationFailures`, `validationMode?`): `Promise`\<`boolean`\>
|
|
20
20
|
|
|
21
21
|
Validate a data type.
|
|
22
22
|
|
|
@@ -4,13 +4,13 @@ A helper for JSON schemas.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new JsonSchemaHelper**():
|
|
9
|
+
> **new JsonSchemaHelper**(): `JsonSchemaHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`JsonSchemaHelper`
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
@@ -24,13 +24,15 @@ The schema version.
|
|
|
24
24
|
|
|
25
25
|
### validate()
|
|
26
26
|
|
|
27
|
-
> `static` **validate**\<`T`\>(`schema`, `data`, `additionalTypes
|
|
27
|
+
> `static` **validate**\<`T`\>(`schema`, `data`, `additionalTypes?`): `Promise`\<[`ISchemaValidationResult`](../interfaces/ISchemaValidationResult.md)\>
|
|
28
28
|
|
|
29
29
|
Validates data against the schema.
|
|
30
30
|
|
|
31
31
|
#### Type Parameters
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
##### T
|
|
34
|
+
|
|
35
|
+
`T` = `unknown`
|
|
34
36
|
|
|
35
37
|
#### Parameters
|
|
36
38
|
|
|
@@ -88,7 +90,7 @@ The types of the property.
|
|
|
88
90
|
|
|
89
91
|
### entitySchemaToJsonSchema()
|
|
90
92
|
|
|
91
|
-
> `static` **entitySchemaToJsonSchema**(`entitySchema`, `baseDomain
|
|
93
|
+
> `static` **entitySchemaToJsonSchema**(`entitySchema`, `baseDomain?`): `JSONSchema7`
|
|
92
94
|
|
|
93
95
|
Convert an entity schema to JSON schema e.g https://example.com/schemas/.
|
|
94
96
|
|
|
@@ -36,7 +36,7 @@ The JSON schema for the data type.
|
|
|
36
36
|
|
|
37
37
|
### validate()?
|
|
38
38
|
|
|
39
|
-
> `optional` **validate**(`propertyName`, `value`, `failures`, `container
|
|
39
|
+
> `optional` **validate**(`propertyName`, `value`, `failures`, `container?`): `Promise`\<`boolean`\>
|
|
40
40
|
|
|
41
41
|
A method for validating the data type.
|
|
42
42
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: ValidationMode
|
|
2
2
|
|
|
3
|
-
> **ValidationMode
|
|
3
|
+
> **ValidationMode** = *typeof* [`ValidationMode`](../variables/ValidationMode.md)\[keyof *typeof* [`ValidationMode`](../variables/ValidationMode.md)\]
|
|
4
4
|
|
|
5
5
|
Validation modes for validating data types.
|