@twin.org/entity 0.0.1-next.50 → 0.0.1-next.52
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 +28 -0
- package/docs/reference/classes/DecoratorHelper.md +9 -5
- package/docs/reference/classes/EntityConditions.md +10 -6
- package/docs/reference/classes/EntitySchemaHelper.md +19 -9
- package/docs/reference/classes/EntitySorter.md +10 -6
- package/docs/reference/functions/entity.md +1 -1
- package/docs/reference/interfaces/IComparatorGroup.md +3 -1
- package/docs/reference/interfaces/IEntitySchema.md +3 -1
- package/docs/reference/interfaces/IEntitySchemaProperty.md +3 -1
- package/docs/reference/interfaces/IEntitySort.md +3 -1
- package/docs/reference/type-aliases/ComparisonOperator.md +1 -1
- package/docs/reference/type-aliases/EntityCondition.md +4 -2
- package/docs/reference/type-aliases/EntitySchemaPropertyFormat.md +1 -1
- package/docs/reference/type-aliases/EntitySchemaPropertyType.md +1 -1
- package/docs/reference/type-aliases/LogicalOperator.md +1 -1
- package/docs/reference/type-aliases/SortDirection.md +1 -1
- package/package.json +2 -2
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @twin.org/entity - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.52](https://github.com/twinfoundation/framework/compare/entity-v0.0.1-next.51...entity-v0.0.1-next.52) (2025-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/core bumped from 0.0.1-next.51 to 0.0.1-next.52
|
|
16
|
+
|
|
17
|
+
## [0.0.1-next.51](https://github.com/twinfoundation/framework/compare/entity-v0.0.1-next.50...entity-v0.0.1-next.51) (2025-03-27)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **entity:** Synchronize repo versions
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/core bumped from 0.0.1-next.50 to 0.0.1-next.51
|
|
30
|
+
|
|
3
31
|
## [0.0.1-next.50](https://github.com/twinfoundation/framework/compare/entity-v0.0.1-next.49...entity-v0.0.1-next.50) (2025-03-26)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -4,13 +4,13 @@ Class to help with decorators.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new DecoratorHelper**():
|
|
9
|
+
> **new DecoratorHelper**(): `DecoratorHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`DecoratorHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -22,7 +22,9 @@ Get the schema from the reflection metadata.
|
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T` = `unknown`
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
@@ -48,7 +50,9 @@ Set the schema from the reflection metadata.
|
|
|
48
50
|
|
|
49
51
|
#### Type Parameters
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
##### T
|
|
54
|
+
|
|
55
|
+
`T` = `unknown`
|
|
52
56
|
|
|
53
57
|
#### Parameters
|
|
54
58
|
|
|
@@ -4,25 +4,27 @@ Class to perform condition checks.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new EntityConditions**():
|
|
9
|
+
> **new EntityConditions**(): `EntityConditions`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`EntityConditions`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### check()
|
|
18
18
|
|
|
19
|
-
> `static` **check**\<`T`\>(`entity`, `condition
|
|
19
|
+
> `static` **check**\<`T`\>(`entity`, `condition?`): `boolean`
|
|
20
20
|
|
|
21
21
|
See if the entity matches the conditions.
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T`
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
@@ -54,7 +56,9 @@ See if the entity matches the conditions.
|
|
|
54
56
|
|
|
55
57
|
#### Type Parameters
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
##### T
|
|
60
|
+
|
|
61
|
+
`T`
|
|
58
62
|
|
|
59
63
|
#### Parameters
|
|
60
64
|
|
|
@@ -4,13 +4,13 @@ Class to help with entity schema operations.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new EntitySchemaHelper**():
|
|
9
|
+
> **new EntitySchemaHelper**(): `EntitySchemaHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`EntitySchemaHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -22,7 +22,9 @@ Get the schema for the specified object.
|
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T` = `unknown`
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
@@ -48,7 +50,9 @@ Get the primary key from the entity schema.
|
|
|
48
50
|
|
|
49
51
|
#### Type Parameters
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
##### T
|
|
54
|
+
|
|
55
|
+
`T`
|
|
52
56
|
|
|
53
57
|
#### Parameters
|
|
54
58
|
|
|
@@ -78,7 +82,9 @@ Get the sort properties from the schema.
|
|
|
78
82
|
|
|
79
83
|
#### Type Parameters
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
##### T
|
|
86
|
+
|
|
87
|
+
`T`
|
|
82
88
|
|
|
83
89
|
#### Parameters
|
|
84
90
|
|
|
@@ -98,13 +104,15 @@ The sort keys from the schema or undefined if there are none.
|
|
|
98
104
|
|
|
99
105
|
### buildSortProperties()
|
|
100
106
|
|
|
101
|
-
> `static` **buildSortProperties**\<`T`\>(`entitySchema`, `overrideSortKeys
|
|
107
|
+
> `static` **buildSortProperties**\<`T`\>(`entitySchema`, `overrideSortKeys?`): `undefined` \| [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[]
|
|
102
108
|
|
|
103
109
|
Build sort properties from the schema and override if necessary.
|
|
104
110
|
|
|
105
111
|
#### Type Parameters
|
|
106
112
|
|
|
107
|
-
|
|
113
|
+
##### T
|
|
114
|
+
|
|
115
|
+
`T`
|
|
108
116
|
|
|
109
117
|
#### Parameters
|
|
110
118
|
|
|
@@ -136,7 +144,9 @@ Validate the entity against the schema.
|
|
|
136
144
|
|
|
137
145
|
#### Type Parameters
|
|
138
146
|
|
|
139
|
-
|
|
147
|
+
##### T
|
|
148
|
+
|
|
149
|
+
`T`
|
|
140
150
|
|
|
141
151
|
#### Parameters
|
|
142
152
|
|
|
@@ -4,25 +4,27 @@ Class to perform sort operations on entities.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new EntitySorter**():
|
|
9
|
+
> **new EntitySorter**(): `EntitySorter`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`EntitySorter`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### sort()
|
|
18
18
|
|
|
19
|
-
> `static` **sort**\<`T`\>(`entities`, `entitySorters
|
|
19
|
+
> `static` **sort**\<`T`\>(`entities`, `entitySorters?`): `T`[]
|
|
20
20
|
|
|
21
21
|
Sort a list of entities using multiple keys and direction.
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T`
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
@@ -54,7 +56,9 @@ Compare two properties.
|
|
|
54
56
|
|
|
55
57
|
#### Type Parameters
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
##### T
|
|
60
|
+
|
|
61
|
+
`T`
|
|
58
62
|
|
|
59
63
|
#### Parameters
|
|
60
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: ComparisonOperator
|
|
2
2
|
|
|
3
|
-
> **ComparisonOperator
|
|
3
|
+
> **ComparisonOperator** = *typeof* [`ComparisonOperator`](../variables/ComparisonOperator.md)\[keyof *typeof* [`ComparisonOperator`](../variables/ComparisonOperator.md)\]
|
|
4
4
|
|
|
5
5
|
The types of comparisons.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Type Alias: EntityCondition\<T\>
|
|
2
2
|
|
|
3
|
-
> **EntityCondition**\<`T
|
|
3
|
+
> **EntityCondition**\<`T`\> = [`IComparator`](../interfaces/IComparator.md) \| [`IComparatorGroup`](../interfaces/IComparatorGroup.md)\<`T`\>
|
|
4
4
|
|
|
5
5
|
Type defining condition for entities filtering.
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### T
|
|
10
|
+
|
|
11
|
+
`T`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: EntitySchemaPropertyFormat
|
|
2
2
|
|
|
3
|
-
> **EntitySchemaPropertyFormat
|
|
3
|
+
> **EntitySchemaPropertyFormat** = *typeof* [`EntitySchemaPropertyFormat`](../variables/EntitySchemaPropertyFormat.md)\[keyof *typeof* [`EntitySchemaPropertyFormat`](../variables/EntitySchemaPropertyFormat.md)\]
|
|
4
4
|
|
|
5
5
|
Definition of the entity property type's format.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: EntitySchemaPropertyType
|
|
2
2
|
|
|
3
|
-
> **EntitySchemaPropertyType
|
|
3
|
+
> **EntitySchemaPropertyType** = *typeof* [`EntitySchemaPropertyType`](../variables/EntitySchemaPropertyType.md)\[keyof *typeof* [`EntitySchemaPropertyType`](../variables/EntitySchemaPropertyType.md)\]
|
|
4
4
|
|
|
5
5
|
Definition of the entity property types.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: LogicalOperator
|
|
2
2
|
|
|
3
|
-
> **LogicalOperator
|
|
3
|
+
> **LogicalOperator** = *typeof* [`LogicalOperator`](../variables/LogicalOperator.md)\[keyof *typeof* [`LogicalOperator`](../variables/LogicalOperator.md)\]
|
|
4
4
|
|
|
5
5
|
The logical operators for condition combining.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: SortDirection
|
|
2
2
|
|
|
3
|
-
> **SortDirection
|
|
3
|
+
> **SortDirection** = *typeof* [`SortDirection`](../variables/SortDirection.md)\[keyof *typeof* [`SortDirection`](../variables/SortDirection.md)\]
|
|
4
4
|
|
|
5
5
|
The sort directions.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.52",
|
|
4
4
|
"description": "Helpers for defining and working with entities",
|
|
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/core": "0.0.1-next.
|
|
17
|
+
"@twin.org/core": "0.0.1-next.52",
|
|
18
18
|
"@twin.org/nameof": "next",
|
|
19
19
|
"reflect-metadata": "0.2.2"
|
|
20
20
|
},
|