@twin.org/entity 0.0.2-next.9 → 0.0.3-next.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 (60) hide show
  1. package/dist/es/decorators/entityDecorator.js +19 -0
  2. package/dist/es/decorators/entityDecorator.js.map +1 -0
  3. package/dist/es/decorators/propertyDecorator.js +31 -0
  4. package/dist/es/decorators/propertyDecorator.js.map +1 -0
  5. package/dist/es/factories/entitySchemaFactory.js +9 -0
  6. package/dist/es/factories/entitySchemaFactory.js.map +1 -0
  7. package/dist/es/index.js +22 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/models/IComparator.js +2 -0
  10. package/dist/es/models/IComparator.js.map +1 -0
  11. package/dist/es/models/IComparatorGroup.js +2 -0
  12. package/dist/es/models/IComparatorGroup.js.map +1 -0
  13. package/dist/es/models/IEntitySchema.js +2 -0
  14. package/dist/es/models/IEntitySchema.js.map +1 -0
  15. package/dist/es/models/IEntitySchemaOptions.js +4 -0
  16. package/dist/es/models/IEntitySchemaOptions.js.map +1 -0
  17. package/dist/es/models/IEntitySchemaProperty.js +2 -0
  18. package/dist/es/models/IEntitySchemaProperty.js.map +1 -0
  19. package/dist/es/models/IEntitySort.js +2 -0
  20. package/dist/es/models/IEntitySort.js.map +1 -0
  21. package/dist/es/models/comparisonOperator.js +52 -0
  22. package/dist/es/models/comparisonOperator.js.map +1 -0
  23. package/dist/es/models/entityCondition.js +2 -0
  24. package/dist/es/models/entityCondition.js.map +1 -0
  25. package/dist/es/models/entitySchemaPropertyFormat.js +77 -0
  26. package/dist/es/models/entitySchemaPropertyFormat.js.map +1 -0
  27. package/dist/es/models/entitySchemaPropertyType.js +33 -0
  28. package/dist/es/models/entitySchemaPropertyType.js.map +1 -0
  29. package/dist/es/models/logicalOperator.js +17 -0
  30. package/dist/es/models/logicalOperator.js.map +1 -0
  31. package/dist/es/models/sortDirection.js +17 -0
  32. package/dist/es/models/sortDirection.js.map +1 -0
  33. package/dist/es/utils/decoratorHelper.js +29 -0
  34. package/dist/es/utils/decoratorHelper.js.map +1 -0
  35. package/dist/es/utils/entityConditions.js +175 -0
  36. package/dist/es/utils/entityConditions.js.map +1 -0
  37. package/dist/es/utils/entitySchemaHelper.js +143 -0
  38. package/dist/es/utils/entitySchemaHelper.js.map +1 -0
  39. package/dist/es/utils/entitySorter.js +72 -0
  40. package/dist/es/utils/entitySorter.js.map +1 -0
  41. package/dist/types/decorators/entityDecorator.d.ts +1 -1
  42. package/dist/types/decorators/propertyDecorator.d.ts +1 -1
  43. package/dist/types/factories/entitySchemaFactory.d.ts +1 -1
  44. package/dist/types/index.d.ts +19 -19
  45. package/dist/types/models/IComparator.d.ts +1 -1
  46. package/dist/types/models/IComparatorGroup.d.ts +2 -2
  47. package/dist/types/models/IEntitySchema.d.ts +2 -2
  48. package/dist/types/models/IEntitySchemaProperty.d.ts +3 -3
  49. package/dist/types/models/IEntitySort.d.ts +2 -2
  50. package/dist/types/models/entityCondition.d.ts +2 -2
  51. package/dist/types/utils/decoratorHelper.d.ts +1 -1
  52. package/dist/types/utils/entityConditions.d.ts +2 -2
  53. package/dist/types/utils/entitySchemaHelper.d.ts +8 -4
  54. package/dist/types/utils/entitySorter.d.ts +3 -3
  55. package/docs/changelog.md +281 -0
  56. package/docs/reference/classes/EntitySchemaHelper.md +12 -4
  57. package/docs/reference/interfaces/IEntitySchema.md +1 -1
  58. package/package.json +19 -10
  59. package/dist/cjs/index.cjs +0 -673
  60. package/dist/esm/index.mjs +0 -660
package/docs/changelog.md CHANGED
@@ -1,5 +1,286 @@
1
1
  # @twin.org/entity - Changelog
2
2
 
3
+ ## [0.0.3-next.2](https://github.com/twinfoundation/framework/compare/entity-v0.0.3-next.1...entity-v0.0.3-next.2) (2025-11-12)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **entity:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/nameof bumped from 0.0.3-next.1 to 0.0.3-next.2
16
+ * @twin.org/core bumped from 0.0.3-next.1 to 0.0.3-next.2
17
+ * devDependencies
18
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.1 to 0.0.3-next.2
19
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.1 to 0.0.3-next.2
20
+ * @twin.org/validate-locales bumped from 0.0.3-next.1 to 0.0.3-next.2
21
+
22
+ ## [0.0.3-next.1](https://github.com/twinfoundation/framework/compare/entity-v0.0.3-next.0...entity-v0.0.3-next.1) (2025-11-10)
23
+
24
+
25
+ ### Features
26
+
27
+ * add context id features ([#206](https://github.com/twinfoundation/framework/issues/206)) ([ef0d4ee](https://github.com/twinfoundation/framework/commit/ef0d4ee11a4f5fc6cc6f52a4958ce905c04ee13b))
28
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
29
+ * eslint migration to flat config ([74427d7](https://github.com/twinfoundation/framework/commit/74427d78d342167f7850e49ab87269326355befe))
30
+ * locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
31
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
32
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
33
+ * use cause instead of inner for errors ([1f4acc4](https://github.com/twinfoundation/framework/commit/1f4acc4d7a6b71a134d9547da9bf40de1e1e49da))
34
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
35
+
36
+
37
+ ### Dependencies
38
+
39
+ * The following workspace dependencies were updated
40
+ * dependencies
41
+ * @twin.org/nameof bumped from 0.0.3-next.0 to 0.0.3-next.1
42
+ * @twin.org/core bumped from 0.0.3-next.0 to 0.0.3-next.1
43
+ * devDependencies
44
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.0 to 0.0.3-next.1
45
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.0 to 0.0.3-next.1
46
+ * @twin.org/validate-locales bumped from 0.0.3-next.0 to 0.0.3-next.1
47
+
48
+ ## [0.0.2-next.22](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.21...entity-v0.0.2-next.22) (2025-10-10)
49
+
50
+
51
+ ### Miscellaneous Chores
52
+
53
+ * **entity:** Synchronize repo versions
54
+
55
+
56
+ ### Dependencies
57
+
58
+ * The following workspace dependencies were updated
59
+ * dependencies
60
+ * @twin.org/nameof bumped from 0.0.2-next.21 to 0.0.2-next.22
61
+ * @twin.org/core bumped from 0.0.2-next.21 to 0.0.2-next.22
62
+ * devDependencies
63
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.21 to 0.0.2-next.22
64
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.21 to 0.0.2-next.22
65
+ * @twin.org/validate-locales bumped from 0.0.2-next.21 to 0.0.2-next.22
66
+
67
+ ## [0.0.2-next.21](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.20...entity-v0.0.2-next.21) (2025-10-09)
68
+
69
+
70
+ ### Features
71
+
72
+ * locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * The following workspace dependencies were updated
78
+ * dependencies
79
+ * @twin.org/nameof bumped from 0.0.2-next.20 to 0.0.2-next.21
80
+ * @twin.org/core bumped from 0.0.2-next.20 to 0.0.2-next.21
81
+ * devDependencies
82
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.20 to 0.0.2-next.21
83
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.20 to 0.0.2-next.21
84
+ * @twin.org/validate-locales bumped from 0.0.2-next.20 to 0.0.2-next.21
85
+
86
+ ## [0.0.2-next.20](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.19...entity-v0.0.2-next.20) (2025-10-02)
87
+
88
+
89
+ ### Miscellaneous Chores
90
+
91
+ * **entity:** Synchronize repo versions
92
+
93
+
94
+ ### Dependencies
95
+
96
+ * The following workspace dependencies were updated
97
+ * dependencies
98
+ * @twin.org/nameof bumped from 0.0.2-next.19 to 0.0.2-next.20
99
+ * @twin.org/core bumped from 0.0.2-next.19 to 0.0.2-next.20
100
+ * devDependencies
101
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.19 to 0.0.2-next.20
102
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.19 to 0.0.2-next.20
103
+
104
+ ## [0.0.2-next.19](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.18...entity-v0.0.2-next.19) (2025-09-30)
105
+
106
+
107
+ ### Miscellaneous Chores
108
+
109
+ * **entity:** Synchronize repo versions
110
+
111
+
112
+ ### Dependencies
113
+
114
+ * The following workspace dependencies were updated
115
+ * dependencies
116
+ * @twin.org/nameof bumped from 0.0.2-next.18 to 0.0.2-next.19
117
+ * @twin.org/core bumped from 0.0.2-next.18 to 0.0.2-next.19
118
+ * devDependencies
119
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.18 to 0.0.2-next.19
120
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.18 to 0.0.2-next.19
121
+
122
+ ## [0.0.2-next.18](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.17...entity-v0.0.2-next.18) (2025-09-29)
123
+
124
+
125
+ ### Miscellaneous Chores
126
+
127
+ * **entity:** Synchronize repo versions
128
+
129
+
130
+ ### Dependencies
131
+
132
+ * The following workspace dependencies were updated
133
+ * dependencies
134
+ * @twin.org/nameof bumped from 0.0.2-next.17 to 0.0.2-next.18
135
+ * @twin.org/core bumped from 0.0.2-next.17 to 0.0.2-next.18
136
+ * devDependencies
137
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.17 to 0.0.2-next.18
138
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.17 to 0.0.2-next.18
139
+
140
+ ## [0.0.2-next.17](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.16...entity-v0.0.2-next.17) (2025-09-29)
141
+
142
+
143
+ ### Miscellaneous Chores
144
+
145
+ * **entity:** Synchronize repo versions
146
+
147
+
148
+ ### Dependencies
149
+
150
+ * The following workspace dependencies were updated
151
+ * dependencies
152
+ * @twin.org/nameof bumped from 0.0.2-next.16 to 0.0.2-next.17
153
+ * @twin.org/core bumped from 0.0.2-next.16 to 0.0.2-next.17
154
+ * devDependencies
155
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.16 to 0.0.2-next.17
156
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.16 to 0.0.2-next.17
157
+
158
+ ## [0.0.2-next.16](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.15...entity-v0.0.2-next.16) (2025-09-28)
159
+
160
+
161
+ ### Miscellaneous Chores
162
+
163
+ * **entity:** Synchronize repo versions
164
+
165
+
166
+ ### Dependencies
167
+
168
+ * The following workspace dependencies were updated
169
+ * dependencies
170
+ * @twin.org/nameof bumped from 0.0.2-next.15 to 0.0.2-next.16
171
+ * @twin.org/core bumped from 0.0.2-next.15 to 0.0.2-next.16
172
+ * devDependencies
173
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.15 to 0.0.2-next.16
174
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.15 to 0.0.2-next.16
175
+
176
+ ## [0.0.2-next.15](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.14...entity-v0.0.2-next.15) (2025-09-22)
177
+
178
+
179
+ ### Miscellaneous Chores
180
+
181
+ * **entity:** Synchronize repo versions
182
+
183
+
184
+ ### Dependencies
185
+
186
+ * The following workspace dependencies were updated
187
+ * dependencies
188
+ * @twin.org/nameof bumped from 0.0.2-next.14 to 0.0.2-next.15
189
+ * @twin.org/core bumped from 0.0.2-next.14 to 0.0.2-next.15
190
+ * devDependencies
191
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.14 to 0.0.2-next.15
192
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.14 to 0.0.2-next.15
193
+
194
+ ## [0.0.2-next.14](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.13...entity-v0.0.2-next.14) (2025-09-22)
195
+
196
+
197
+ ### Miscellaneous Chores
198
+
199
+ * **entity:** Synchronize repo versions
200
+
201
+
202
+ ### Dependencies
203
+
204
+ * The following workspace dependencies were updated
205
+ * dependencies
206
+ * @twin.org/nameof bumped from 0.0.2-next.13 to 0.0.2-next.14
207
+ * @twin.org/core bumped from 0.0.2-next.13 to 0.0.2-next.14
208
+ * devDependencies
209
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.13 to 0.0.2-next.14
210
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.13 to 0.0.2-next.14
211
+
212
+ ## [0.0.2-next.13](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.12...entity-v0.0.2-next.13) (2025-09-22)
213
+
214
+
215
+ ### Miscellaneous Chores
216
+
217
+ * **entity:** Synchronize repo versions
218
+
219
+
220
+ ### Dependencies
221
+
222
+ * The following workspace dependencies were updated
223
+ * dependencies
224
+ * @twin.org/nameof bumped from 0.0.2-next.12 to 0.0.2-next.13
225
+ * @twin.org/core bumped from 0.0.2-next.12 to 0.0.2-next.13
226
+ * devDependencies
227
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.12 to 0.0.2-next.13
228
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.12 to 0.0.2-next.13
229
+
230
+ ## [0.0.2-next.12](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.11...entity-v0.0.2-next.12) (2025-09-15)
231
+
232
+
233
+ ### Miscellaneous Chores
234
+
235
+ * **entity:** Synchronize repo versions
236
+
237
+
238
+ ### Dependencies
239
+
240
+ * The following workspace dependencies were updated
241
+ * dependencies
242
+ * @twin.org/nameof bumped from 0.0.2-next.11 to 0.0.2-next.12
243
+ * @twin.org/core bumped from 0.0.2-next.11 to 0.0.2-next.12
244
+ * devDependencies
245
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.11 to 0.0.2-next.12
246
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.11 to 0.0.2-next.12
247
+
248
+ ## [0.0.2-next.11](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.10...entity-v0.0.2-next.11) (2025-09-15)
249
+
250
+
251
+ ### Miscellaneous Chores
252
+
253
+ * **entity:** Synchronize repo versions
254
+
255
+
256
+ ### Dependencies
257
+
258
+ * The following workspace dependencies were updated
259
+ * dependencies
260
+ * @twin.org/nameof bumped from 0.0.2-next.10 to 0.0.2-next.11
261
+ * @twin.org/core bumped from 0.0.2-next.10 to 0.0.2-next.11
262
+ * devDependencies
263
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.10 to 0.0.2-next.11
264
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.10 to 0.0.2-next.11
265
+
266
+ ## [0.0.2-next.10](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.9...entity-v0.0.2-next.10) (2025-09-11)
267
+
268
+
269
+ ### Miscellaneous Chores
270
+
271
+ * **entity:** Synchronize repo versions
272
+
273
+
274
+ ### Dependencies
275
+
276
+ * The following workspace dependencies were updated
277
+ * dependencies
278
+ * @twin.org/nameof bumped from 0.0.2-next.9 to 0.0.2-next.10
279
+ * @twin.org/core bumped from 0.0.2-next.9 to 0.0.2-next.10
280
+ * devDependencies
281
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.9 to 0.0.2-next.10
282
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.9 to 0.0.2-next.10
283
+
3
284
  ## [0.0.2-next.9](https://github.com/twinfoundation/framework/compare/entity-v0.0.2-next.8...entity-v0.0.2-next.9) (2025-09-08)
4
285
 
5
286
 
@@ -12,6 +12,14 @@ Class to help with entity schema operations.
12
12
 
13
13
  `EntitySchemaHelper`
14
14
 
15
+ ## Properties
16
+
17
+ ### CLASS\_NAME
18
+
19
+ > `readonly` `static` **CLASS\_NAME**: `string`
20
+
21
+ Runtime name for the class.
22
+
15
23
  ## Methods
16
24
 
17
25
  ### getSchema()
@@ -76,7 +84,7 @@ If no primary key was found, or more than one.
76
84
 
77
85
  ### getSortProperties()
78
86
 
79
- > `static` **getSortProperties**\<`T`\>(`entitySchema`): `undefined` \| [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[]
87
+ > `static` **getSortProperties**\<`T`\>(`entitySchema`): [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[] \| `undefined`
80
88
 
81
89
  Get the sort properties from the schema.
82
90
 
@@ -96,7 +104,7 @@ The entity schema to find the primary key from.
96
104
 
97
105
  #### Returns
98
106
 
99
- `undefined` \| [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[]
107
+ [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[] \| `undefined`
100
108
 
101
109
  The sort keys from the schema or undefined if there are none.
102
110
 
@@ -104,7 +112,7 @@ The sort keys from the schema or undefined if there are none.
104
112
 
105
113
  ### buildSortProperties()
106
114
 
107
- > `static` **buildSortProperties**\<`T`\>(`entitySchema`, `overrideSortKeys?`): `undefined` \| [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[]
115
+ > `static` **buildSortProperties**\<`T`\>(`entitySchema`, `overrideSortKeys?`): [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[] \| `undefined`
108
116
 
109
117
  Build sort properties from the schema and override if necessary.
110
118
 
@@ -130,7 +138,7 @@ The override sort keys.
130
138
 
131
139
  #### Returns
132
140
 
133
- `undefined` \| [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[]
141
+ [`IEntitySort`](../interfaces/IEntitySort.md)\<`T`\>[] \| `undefined`
134
142
 
135
143
  The finalised sort keys.
136
144
 
@@ -12,7 +12,7 @@ Definition for an entity schema.
12
12
 
13
13
  ### type
14
14
 
15
- > **type**: `undefined` \| `string`
15
+ > **type**: `string` \| `undefined`
16
16
 
17
17
  The type of the entity.
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity",
3
- "version": "0.0.2-next.9",
3
+ "version": "0.0.3-next.2",
4
4
  "description": "Helpers for defining and working with entities",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,26 +14,35 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.2-next.9",
18
- "@twin.org/nameof": "0.0.2-next.9",
17
+ "@twin.org/core": "0.0.3-next.2",
18
+ "@twin.org/nameof": "0.0.3-next.2",
19
19
  "reflect-metadata": "0.2.2"
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
+ ],
44
+ "bugs": {
45
+ "url": "git+https://github.com/twinfoundation/framework/issues"
46
+ },
47
+ "homepage": "https://twindev.org"
39
48
  }