@rentman/rm-core 12.1.1 → 12.1.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 (146) hide show
  1. package/changelog.md +1495 -1492
  2. package/dist/rm-core.js +815 -815
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/types/src/FieldLookupProxy.d.ts +4 -4
  5. package/dist/types/src/classes/ApiFormatter.d.ts +76 -76
  6. package/dist/types/src/classes/ApiRequestService.d.ts +18 -18
  7. package/dist/types/src/classes/ApiResponseProcessor.d.ts +29 -29
  8. package/dist/types/src/classes/BusinessLogicManager/BusinessLogicManager.d.ts +100 -100
  9. package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +93 -93
  10. package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldTypeBusinessLogicRule.d.ts +17 -17
  11. package/dist/types/src/classes/BusinessLogicManager/Documents/DocumentTemplateBusinessLogicRule.d.ts +24 -24
  12. package/dist/types/src/classes/BusinessLogicManager/Exemplaar/ExemplaarAanschafdatumBusinessLogicRule.d.ts +13 -13
  13. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurBetalingsconditieBusinessLogicRule.d.ts +19 -19
  14. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurDatumBusinessLogicRule.d.ts +18 -18
  15. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurNumberseriesBusinessLogicRule.d.ts +13 -13
  16. package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieNaaminternBusinessLogicRule.d.ts +17 -17
  17. package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogicRule.d.ts +13 -13
  18. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTelexemplarenBusinessLogicRule.d.ts +15 -15
  19. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTypeBusinessLogicRule.d.ts +17 -17
  20. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule.d.ts +17 -17
  21. package/dist/types/src/classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule.d.ts +18 -18
  22. package/dist/types/src/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +25 -25
  23. package/dist/types/src/classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule.d.ts +28 -28
  24. package/dist/types/src/classes/BusinessLogicManager/Project/ProjectClientNoteBusinessLogicRule.d.ts +22 -22
  25. package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarAantalBusinessLogicRule.d.ts +13 -13
  26. package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarLocationBusinessLogicRule.d.ts +23 -23
  27. package/dist/types/src/classes/BusinessLogicManager/Rol/RolDocumentAccessBusinessLogicRule.d.ts +17 -17
  28. package/dist/types/src/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts +17 -17
  29. package/dist/types/src/classes/BusinessLogicManager/Rol/RolFileAccessBusinessLogicRule.d.ts +17 -17
  30. package/dist/types/src/classes/BusinessLogicManager/Rol/RolPersoneelsplannerToegangBusinessLogicRule.d.ts +17 -17
  31. package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts +17 -17
  32. package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts +17 -17
  33. package/dist/types/src/classes/CacheSyncer.d.ts +71 -71
  34. package/dist/types/src/classes/ChangesCompilation.d.ts +33 -33
  35. package/dist/types/src/classes/ChangesDelta.d.ts +65 -65
  36. package/dist/types/src/classes/ChangesDeltaBase.d.ts +88 -88
  37. package/dist/types/src/classes/ChangesProcessor.d.ts +40 -40
  38. package/dist/types/src/classes/CollectionEntryService.d.ts +24 -24
  39. package/dist/types/src/classes/CollectionResourceService.d.ts +6 -6
  40. package/dist/types/src/classes/ColumnCache.d.ts +19 -19
  41. package/dist/types/src/classes/ColumnExpansion.d.ts +19 -19
  42. package/dist/types/src/classes/ColumnHandler.d.ts +20 -20
  43. package/dist/types/src/classes/ColumnInfo.d.ts +15 -15
  44. package/dist/types/src/classes/ColumnSet.d.ts +37 -37
  45. package/dist/types/src/classes/ColumnUtil.d.ts +108 -108
  46. package/dist/types/src/classes/ConversionMapService.d.ts +25 -25
  47. package/dist/types/src/classes/CreateRequest.d.ts +17 -17
  48. package/dist/types/src/classes/CreatedChangesDelta.d.ts +17 -17
  49. package/dist/types/src/classes/InternalChangesDelta.d.ts +44 -44
  50. package/dist/types/src/classes/ItemCache.d.ts +27 -27
  51. package/dist/types/src/classes/ItemCreateService.d.ts +18 -18
  52. package/dist/types/src/classes/ItemEntryService.d.ts +32 -32
  53. package/dist/types/src/classes/KeyService.d.ts +18 -18
  54. package/dist/types/src/classes/LockService.d.ts +28 -28
  55. package/dist/types/src/classes/ModuleChangesCompilation.d.ts +17 -17
  56. package/dist/types/src/classes/ParentChangesDelta.d.ts +41 -41
  57. package/dist/types/src/classes/QueryColumnExtractor.d.ts +18 -18
  58. package/dist/types/src/classes/QueryContainsLocalIdParser.d.ts +17 -17
  59. package/dist/types/src/classes/QueryLinkedToParser.d.ts +17 -17
  60. package/dist/types/src/classes/QueryLocallyMatchableParser.d.ts +20 -20
  61. package/dist/types/src/classes/QueryMatcher.d.ts +25 -25
  62. package/dist/types/src/classes/QueryParser.d.ts +25 -25
  63. package/dist/types/src/classes/QueryParserBase.d.ts +20 -20
  64. package/dist/types/src/classes/QueryParserIdUpdater.d.ts +17 -17
  65. package/dist/types/src/classes/QueryService.d.ts +12 -12
  66. package/dist/types/src/classes/RequestBuffer.d.ts +26 -26
  67. package/dist/types/src/classes/RequestBufferManager.d.ts +21 -21
  68. package/dist/types/src/classes/RequestColumnExpansion.d.ts +13 -13
  69. package/dist/types/src/classes/RequestColumnsOperationsCache.d.ts +46 -46
  70. package/dist/types/src/classes/SocketMessageHandler.d.ts +34 -34
  71. package/dist/types/src/classes/TemplateCache.d.ts +64 -64
  72. package/dist/types/src/classes/Util.d.ts +28 -28
  73. package/dist/types/src/classes/cache/AbstractCache.d.ts +85 -85
  74. package/dist/types/src/classes/cache/CachedQueryHandlerBase.d.ts +70 -70
  75. package/dist/types/src/classes/cache/ItemHandlerBase.d.ts +107 -107
  76. package/dist/types/src/classes/cache/server/ServerCache.d.ts +65 -65
  77. package/dist/types/src/classes/cache/server/ServerCachedQueryHandler.d.ts +27 -27
  78. package/dist/types/src/classes/cache/server/ServerItemHandler.d.ts +39 -39
  79. package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +298 -298
  80. package/dist/types/src/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +50 -50
  81. package/dist/types/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
  82. package/dist/types/src/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
  83. package/dist/types/src/classes/cache/transaction/TransactionItemHandler.d.ts +80 -80
  84. package/dist/types/src/classes/cache/transaction/TransactionValidator.d.ts +33 -33
  85. package/dist/types/src/constants.d.ts +7 -7
  86. package/dist/types/src/core.d.ts +48 -48
  87. package/dist/types/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
  88. package/dist/types/src/factories/CacheSyncerFactory.d.ts +14 -14
  89. package/dist/types/src/factories/ChangesCompilationFactory.d.ts +5 -5
  90. package/dist/types/src/factories/ChangesDeltaFactory.d.ts +13 -13
  91. package/dist/types/src/factories/ChangesProcessorFactory.d.ts +13 -13
  92. package/dist/types/src/factories/CollectionEntryFactory.d.ts +11 -11
  93. package/dist/types/src/factories/CollectionResourceFactory.d.ts +18 -18
  94. package/dist/types/src/factories/ColumnExpansionFactory.d.ts +7 -7
  95. package/dist/types/src/factories/ColumnInfoFactory.d.ts +7 -7
  96. package/dist/types/src/factories/ColumnSetFactory.d.ts +18 -18
  97. package/dist/types/src/factories/CreateRequestFactory.d.ts +9 -9
  98. package/dist/types/src/factories/ItemCacheFactory.d.ts +6 -6
  99. package/dist/types/src/factories/ItemEntryFactory.d.ts +12 -12
  100. package/dist/types/src/factories/ItemResourceFactory.d.ts +11 -11
  101. package/dist/types/src/factories/ModuleChangesCompilationFactory.d.ts +6 -6
  102. package/dist/types/src/factories/QueryMatcherFactory.d.ts +8 -8
  103. package/dist/types/src/factories/QueryParserFactory.d.ts +5 -5
  104. package/dist/types/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
  105. package/dist/types/src/factories/RequestColumnsOperationsCacheFactory.d.ts +8 -8
  106. package/dist/types/src/factories/TemplateFactory.d.ts +8 -8
  107. package/dist/types/src/factories/TransactionCacheFactory.d.ts +13 -13
  108. package/dist/types/src/index.d.ts +1 -1
  109. package/dist/types/src/interfaces/AbstractCacheDependencyInterface.d.ts +38 -38
  110. package/dist/types/src/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  111. package/dist/types/src/interfaces/AuthInterface.d.ts +10 -10
  112. package/dist/types/src/interfaces/ErrorHandlerInterface.d.ts +6 -6
  113. package/dist/types/src/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  114. package/dist/types/src/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  115. package/dist/types/src/interfaces/PromiseLibraryInterface.d.ts +33 -33
  116. package/dist/types/src/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
  117. package/dist/types/src/interfaces/SocketMessageInterface.d.ts +3 -3
  118. package/dist/types/src/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
  119. package/dist/types/src/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
  120. package/dist/types/src/internal.d.ts +128 -128
  121. package/dist/types/src/models/CachedQueryItem.d.ts +40 -40
  122. package/dist/types/src/models/CollectionEntry.d.ts +22 -22
  123. package/dist/types/src/models/CollectionOptions.d.ts +44 -44
  124. package/dist/types/src/models/CollectionResource.d.ts +87 -87
  125. package/dist/types/src/models/ItemEntry.d.ts +19 -19
  126. package/dist/types/src/models/ItemEntryOptions.d.ts +8 -8
  127. package/dist/types/src/models/ItemResource.d.ts +95 -95
  128. package/dist/types/src/models/Template.d.ts +11 -11
  129. package/dist/types/src/types/ItemTypesCollection.d.ts +361 -361
  130. package/dist/types/src/types/PromiseInterface.d.ts +2 -2
  131. package/dist/types/tests/integration/core.test.d.ts +1 -1
  132. package/dist/types/tests/integration/helpers/helpers.d.ts +32 -32
  133. package/dist/types/tests/integration/transactions/field_lookup.test.d.ts +1 -1
  134. package/dist/types/tests/integration/transactions/get_by.test.d.ts +1 -1
  135. package/dist/types/tests/integration/transactions/updates.test.d.ts +1 -1
  136. package/dist/types/tests/mocks/ApiMocked.d.ts +19 -19
  137. package/dist/types/tests/mocks/PromiseLibrary.mocked.d.ts +2 -2
  138. package/dist/types/tests/regression/RM4_17754.test.d.ts +1 -1
  139. package/dist/types/tests/regression/RM4_18216.test.d.ts +1 -1
  140. package/dist/types/tests/unit/query_contains_local_id_parser.test.d.ts +1 -1
  141. package/dist/types/tests/unit/query_linked_to_parser.test.d.ts +1 -1
  142. package/dist/types/tests/unit/query_matcher.test.d.ts +1 -1
  143. package/dist/types/tests/unit/query_parser_id_updater.test.d.ts +1 -1
  144. package/dist/types/tests/unit/query_service.test.d.ts +1 -1
  145. package/package.json +57 -57
  146. package/readme.md +16 -16
package/changelog.md CHANGED
@@ -1,1492 +1,1495 @@
1
- # Changelog
2
-
3
- Contains new features, breaking changes and their reasoning
4
-
5
- ## 12.1.1
6
-
7
- - Remove `getParentFast`, refactor `getParent` to use the (correct) logic from `getParentFast`
8
- - Add `ItemResource.collectFields` which is an alias for `ItemResource.transaction.itemHandler.collectFields`
9
-
10
- ## 12.1.0
11
-
12
- - Added business logic rule to automatically sync `asset_location` field between Reparatie items and the selected
13
- Exemplaar.
14
-
15
- ## 12.0.5
16
-
17
- - Rename ChangesDeltaItemUpdateMode modes
18
- - Treat socket messages as `CLEAR_WHEN_SAME` update type
19
- - Properly propagate server changes as updates by setting `didChangeAnyField`
20
-
21
- ## 12.0.4
22
-
23
- - Fix incorrect changes processing for local items in `TransactionItemHandler.processItemEntryChanges` which could cause
24
- infinite loops with `onChange` hooks
25
-
26
- ## 12.0.3
27
-
28
- - Remove setting of locally created `displayname`s on the transaction changes and construct it when looking up
29
- `displayname` in the fields proxy instead
30
-
31
- > The `displayname` is a readonly column so it does not belong on the transaction, it was also causing issues because it
32
- > was incorrectly marking the transaction as having changes
33
-
34
- - Speed up `ItemEntryService.getDisplayname` by only looking up the required fields instead of calling `collectFields`
35
-
36
- ## 12.0.2
37
-
38
- - Fix `ModuleChangesCompilation` result and improve speed of it
39
-
40
- ## 12.0.1
41
-
42
- - Bugfixes for item changes caching
43
-
44
- ## 12.0.0
45
-
46
- - Replace `ColumnSubSetCache` with `RequestColumnsOperationCache`, implement `RequestColumnsOperationCache` to reduce
47
- calls to `mergeRequestColumns`.
48
-
49
- > This should improve performance when batch requesting collections.
50
-
51
- - **Breaking:** Make request columns read only by default. Introduce `ApiRequestColumnsArray` (which is read-only) and
52
- `MutableApiRequestColumnsArray` (which is not) convenience types to facilitate this.
53
- - When handling responses of query and update requests, only match the items of the request item type. This prevents
54
- items being used for derived values (with incomplete column sets) being matched.
55
-
56
- - Completely rewrite how item changes are stored on transactions so that it now only tracks the actual changes this
57
- should reduce memory footprint and increase performance
58
-
59
- ## 11.0.4
60
-
61
- - Fixed a bug where the QueryContainsLocalIdParser could break queries with an `IN` query with a mix of local and
62
- non-local IDs.
63
- - Fixed a bug in QueryContainsLocalIdParser that would not correctly find local IDs in subqueries of a linkedTo query.
64
-
65
- ## 11.0.3
66
-
67
- - Fixed a bug where the QueryParserIdUpdater could break queries with an `IN` with a single ID in it causing everything
68
- that used that query afterwards (QueryMatcher etc) to fail
69
-
70
- ## 11.0.2
71
-
72
- - Copy cached queries to server cache in `TransactionCache.updateLocalItemIdReferences`. This ensures that remote cached
73
- queries are present on the server cache after saving.
74
-
75
- ## 11.0.1
76
-
77
- - Include item type and query in 'non-existing query' error in `__expandCachedQuery`.
78
-
79
- ## 11.0.0
80
-
81
- - **Breaking:** Remove `priorityBufferSettings` collection option, replace with `usePrivateBuffer`.
82
-
83
- > This option forces the use of a buffer just for the collection query. This allows for optimized matching and keeps
84
- > the requested columns in check, because no other items will be added to the buffer.
85
-
86
- - Fix issue where cached queries were expanded on the current transaction only. This would lead to data being requested
87
- unnecessarily.
88
- - Fix issue where columns needed for the query matcher weren't included when requesting cached queries.
89
- - Add tracking of match attempts on CachedQueryItems
90
- - Add tracking of cache hits on CachedQueryItems
91
- - Add `custom` collection option back in. This was removed in the testing branch, but is still being used by the
92
- front-end.
93
-
94
- ## 10.1.0
95
-
96
- - Performance: Removed caching of non-matchable queries, we now lose the ability to automatically add new items to these
97
- collections (they still update upon re-requesting them)
98
- but this saves a ton of matching requests.
99
-
100
- ## 10.0.6
101
-
102
- - Fixed issue where multiple locktockens could be requested when multiple calls to `fetchLocktoken` were made in quick
103
- succession.
104
-
105
- ## 10.0.5
106
-
107
- - Refactor mapping of deleted entries in ChangesDeltas to be a map instead of an array
108
- - Prevent setting items as updated on ChangesDeltas if it's also in deleted entries
109
- - Remove updated and restored entries in ChangesDeltas if it's also in deleted entries
110
-
111
- ## 10.0.4
112
-
113
- - Fixed a bug introduced in 10.0.3 when trying to load a local item
114
-
115
- ## 10.0.3
116
-
117
- - Fixed a bug in which remotely fetched changes could overwrite changes of a parent transaction if there was a child
118
- transaction
119
-
120
- ## 10.0.2
121
-
122
- - Use the promise library instead of native promises in BusinessLogicManager
123
-
124
- ## 10.0.1
125
-
126
- - Add the `MateriaalTelexemplarenBusinessLogicRule` to the core
127
-
128
- ## 10.0.0
129
-
130
- - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
131
-
132
- ## 10.0.0-alpha.3
133
-
134
- - Only set invoice module permissions when project permissions change if 'projecten_facturen_maken' is enabled
135
-
136
- ## 10.0.0-alpha.2
137
-
138
- - Fix infinite loop in Rol business logic
139
-
140
- ## 10.0.0-alpha.1
141
-
142
- - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
143
-
144
- ## 9.3.1
145
-
146
- - Fixed a bug where items that were both moved and updated could end up in a collection twice
147
-
148
- ## 9.3.0
149
-
150
- - Added order to the CacheSyncer functions ensuring that it's always in order of 1. removing 2. adding
151
-
152
- ## 9.2.4
153
-
154
- - Fixed a bug where incorrect request columns where added because of the query (in reverse linkedTo queries)
155
-
156
- ## 9.2.3
157
-
158
- - Fixed a bug in which multiple requests for the same item could result in incorrect expanded columns
159
- - Increased performance of ColumnUtil by using string comparison over enums
160
- - Increased performance of caching new items (in ChangesDelta._setItemCreated) by not creating default local values for
161
- items from API responses
162
-
163
- ## 9.2.2
164
-
165
- - Optimize requests for collection trees with three levels. (E.g. MateriaalCat -> Planningmateriaal -> Missing)
166
-
167
- ## 9.2.1
168
-
169
- - Fix bug in 9.2.0 that caused updates of date fields not to be processed.
170
-
171
- ## 9.2.0
172
-
173
- - Greatly speed up core processing on large datasets
174
- - Refactor the way ChangesDeltaBase.setItemUpdated processes fields to reduce `Object.getOwnPropertyDescriptor`
175
- calls
176
- - Refactor the way CacheSyncer.processDelta processes updated values to prevent unneeded field copying
177
- and `Object.getOwnPropertyDescriptor` calls
178
- - Add `RequestBufferManagerPrioritySettings` to give finer control over request buffering to the caller
179
-
180
- ## 9.1.2
181
-
182
- - Delete item lock when transaction is destroyed
183
-
184
- > We never deleted item locks causing the items to be locked forever, even though a user wasn't editing them anymore
185
-
186
- ## 9.1.1
187
-
188
- - Fix handling of multiple create requests in one transaction
189
-
190
- ## 9.1.0
191
-
192
- - Implement cascading deletes based on backend delete relations
193
-
194
- ## 9.0.5
195
-
196
- - Prevent an error occurring when `fetchItemEntryData` did not return an itemEntry
197
-
198
- ## 9.0.4
199
-
200
- - Remove `MAYBE` matches that did not get returned after the API query from cached queries and collections
201
- in `CacheSyncer`
202
-
203
- ## 9.0.3
204
-
205
- - Check for empty changesDeltas in `TransactionCache.applyChangesFromParent` to prevent unnecessary calls
206
-
207
- ## 9.0.2
208
-
209
- - Improve the way `getLinkCollections` fetches its data to greatly improve performance
210
-
211
- ## 9.0.1
212
-
213
- - Accept any version (apposed to `latest`) for @rentman/backend-types
214
-
215
- ## 9.0.0
216
-
217
- - **Breaking:** Align item changes in server cache and transaction cache: add `fields` property in server item changes,
218
- rename `changes` in transaction item changes to fields. Remove `getChangesFromItemChanges`.
219
-
220
- ## 8.2.11
221
-
222
- - Only copy over cachedQueries when saving child transactions if the parent transaction doesn't have one with the query
223
- yet
224
-
225
- ## 8.2.10
226
-
227
- - Fix displayname for 'CustomfieldGroup'
228
- - Also set displayname when creating ItemEntries
229
-
230
- ## 8.2.9
231
-
232
- - Fixes a bug in which items on the ServerCache would not properly be added to collections
233
-
234
- ## 8.2.8
235
-
236
- - Fixes a bug in which newly created items do not appear in collections caused in 8.2.6
237
-
238
- ## 8.2.7
239
-
240
- - Merge tabRequestParameters when saving a TransactionCache into another TransactionCache
241
-
242
- ## 8.2.6
243
-
244
- - Fixed issue where deleted equipment re-appear
245
-
246
- ## 8.2.5
247
-
248
- - Skipped
249
-
250
- ## 8.2.4
251
-
252
- - Fixed issue where non-local items were expanded locally.
253
- - Fixed hypothetical situation where an item entry in a local cached query could have an incomplete column set.
254
-
255
- ## 8.2.3
256
-
257
- - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
258
-
259
- ## 8.2.2
260
-
261
- - Fixed a bug where derived values would not be fetched for newly created local items
262
- - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
263
-
264
- ## 8.2.1
265
-
266
- - Skipped
267
-
268
- ## 8.2.0
269
-
270
- - Added support for collection trees. Now, when requesting a collection you can add the `children` property, which is a
271
- map of collection options. The collection resources will be available in the item resources of the resulting
272
- collection resource. For more information,
273
- see [Confluence](https://rentman.atlassian.net/wiki/spaces/~652789241/pages/948404231/Child+collections).
274
-
275
- ## 8.1.9
276
-
277
- - RM4-16796 Fixed a bug where loading the same query in quick succession would cause columns/data to be missing
278
-
279
- ## 8.1.8
280
-
281
- - Reorganize imports: move all exports to `internal.ts`. This is the only place where things should be exported. All
282
- files should import from this file. Resolve duplicate declaration of `InternalCreateDelta` type.
283
- - Improve performance of copying over values in `ChangesDelta`s and `CollectionMatcherBase`
284
- - Merge all `CollectionMatcher` classes into one `CacheSyncer`, so that `processDelta` only has to be done once
285
- - Increase performance of the ApiFormatter on large datasets
286
-
287
- ## 8.1.7
288
-
289
- - Fixed a bug where copied over CachedQueryItems weren't resolved (causing them to hang forever)
290
-
291
- ## 8.1.6
292
-
293
- - Add missing return statement in ServerCache.applyChangesDelta
294
-
295
- ## 8.1.5
296
-
297
- - Only extend missing derived values while resolving local items
298
- in `TransactionCachedQueryHandler.__fetchItemEntriesByQueryData`
299
-
300
- ## 8.1.4
301
-
302
- - Remove non-created items if they are not returned in the response of a Create request
303
-
304
- > If a create would fail, the whole request would fail. So we can assume that if an item isn't returned from a create
305
- > request, the backend has left it out on purpose
306
-
307
- - Move cached queries to parent transactions only when saving a child transaction
308
-
309
- > Only then you know for sure that items that matched on the child transaction will also match in the parent transaction,
310
- > since you're taking over the changes, this behaviour was changed somewhere in a refactor but was incorrect
311
-
312
- - No longer move cached queries to the ServerCache when saving a root transaction
313
-
314
- > You probably don't need the result of *all* those cached queries anymore (and it's also inefficient to keep them because the matcher keeps the up-to-date)
315
-
316
- - No longer wait for child transactions to sync when applying changes in a parent
317
-
318
- > A child transaction can only influence a parent transaction by calling `TransactionCache.save`, which doens't happen whilst applying changes,
319
- > so you don't have to wait for child transactions when applying changes in a parent
320
-
321
- ## 8.1.3
322
-
323
- - Allow passing TransactionOptions to TransactionCacheFactory.construct
324
-
325
- ## 8.1.2
326
-
327
- - Fixed a bug in which derived values for local items wouldn't be properly be fetched
328
-
329
- ## 8.1.1
330
-
331
- - Fixed a bug in which a `Template` request's columns weren't processed
332
-
333
- ## 8.1.0
334
-
335
- - Add `cloneCreatedChanges` function to `ChangesDeltaFactory`. This function clone the `created` component of a changes
336
- delta into a destination changes delta.
337
- - Add `TransactionOptions`, implement `transparent` transaction option
338
- - Allow core-mapped TS types instead of backend-mapped TS types in `ApiFormatter.compareFields`
339
- - Fixed a bug where empty update requests where sometimes done
340
- - Fixed a bug where derived values of items returned in a Template request weren't properly resolved
341
-
342
- ## 8.0.3
343
-
344
- - Changed the flow of a create request so that it includes all the required columns for all transactions and also
345
- processes additionally returned (derived) items
346
- - Fixed a bug where fields referencing local items would already be updated in the `previous` before the `onChange`
347
- callbacks were called
348
- - Moved logic of updating IDs in cached queries/collections to TransactionCachedQueryHandler and
349
- TransactionCollectionHandler
350
-
351
- ## 8.0.2
352
-
353
- - Fixed a bug where deleted entries on a child transaction where not handled properly
354
- - Fixed a bug where saving a child transaction, and then undoing those changes and saving again would not update the
355
- parent transaction
356
-
357
- ## 8.0.1
358
-
359
- - Uppercase operators and comparators in QueryMatcher, QueryParser and QueryService
360
- - Fix parsing short-hand `IN` queryies
361
-
362
- ## 8.0.0
363
-
364
- - Implement `@rentman/backend-types`
365
-
366
- > You will now have autocomplete and typing checking on all columns/fields 🥳
367
-
368
- - Remove `ChangesDeltaResult.rollback`
369
-
370
- > It was never really used/implemented
371
-
372
- ## 7.2.0
373
-
374
- - Add the `preventCaching` option to `CollectionOptions`
375
-
376
- > Prevents a CachedQueryItem from being cached (the CollectionResource will still be cached), you can use this when you fetch an Itemtype for which the backend doesn't send socket messages (so it never automatically updates)
377
-
378
- ## 7.1.1
379
-
380
- - Properly handle moved items in ServerCache.applyChangesFromParent (technically the backend won't ever generate a
381
- linkTo (only updates)) but it can happen when manually syncing the server cache (by
382
- doing `InternalChangesDelta.setItemMoved`)
383
-
384
- ## 7.1.0
385
-
386
- - Automatically keep aggregated values up-to-date by always refetching them
387
-
388
- ## 7.0.15
389
-
390
- - Remove an accidentally left in place debugger
391
-
392
- ## 7.0.14
393
-
394
- - Take into account collections with a 'limit' (of which the query result isn't cached) when matching socket items
395
-
396
- ## 7.0.13
397
-
398
- - Only overwrite the displayname if the required columns are present, instead of defaulting to an empty string
399
-
400
- ## 7.0.12
401
-
402
- - Fixed a bug where the core would try to update the cache key (ID) of `fieldChangeCallbacks` even when there were no
403
- callbacks for the given itemType
404
-
405
- ## 7.0.11
406
-
407
- - Fixed a bug where date values would not be compared if the descriptor was uncalled, this could lead to problems when
408
- applying changes from a parent transaction
409
-
410
- ## 7.0.10
411
-
412
- - Update references to local IDs in other items when a local ID gets updated
413
-
414
- ## 7.0.9
415
-
416
- - Take over `tabRequestParameters` when saving TransactionCache -> TransactionCache
417
-
418
- ## 7.0.8
419
-
420
- - Fixed a race condition and loop iteration error which in very rare cases caused itemEntries to be `undefined` and
421
- erroring
422
- - Add missing error handling in transaction functions
423
-
424
- ## 7.0.7
425
-
426
- - Properly handle `reverse` linkedTo's in QueryColumnExtractor and QueryLocallyMatchableParser
427
- - Implement refreshing of cached queries/collections
428
-
429
- ## 7.0.6
430
-
431
- Move fetching of lock from `TransactionItemHandler.processItemEntryChanges` to `TransactionCache.appyChangesDelta` to
432
- also capture creates and deletes.
433
-
434
- ## 7.0.5
435
-
436
- - Remove automatic fetching of derived values for not-yet-created items
437
-
438
- ## 7.0.4
439
-
440
- - Automatically resolve derived values when a new item is created
441
- - Fixed a bug where `AbstractCache.getParentFromFields` would still return `null` incorrectly
442
-
443
- ## 7.0.3
444
-
445
- - Fixed a bug where `AbstractCache.getParentFromFields` would still return `undefined` parent values
446
-
447
- ## 7.0.2
448
-
449
- - Check if any of the parent fields (`itemtype`, `item`) is `null`, in which case it won't be treated as a valid parent
450
- in `AbstractCache.getParentFromFields`
451
-
452
- ## 7.0.1
453
-
454
- - Ignore columns in ApiFormatter::hasChanges if the `modified` object does not contain a value for it.
455
-
456
- ## 7.0.0
457
-
458
- - **Breaking**: Remove `enableChangesWatcher` and `disableChangesWatcher` in `TransactionCache`.
459
- - Fetch lock token in `TransactionItemHandler.processItemEntryChanges`.
460
-
461
- ## 6.3.10
462
-
463
- - Only call `onRemove` of a collection if there are actually any items removed
464
- - Expand cached columns anyways if there are no items to expand in `TransactionCachedQueryHandler.__expandCachedQuery`
465
-
466
- ## 6.3.9
467
-
468
- - Fixed a bug where deleted local items would still appear as unsaved changes
469
-
470
- ## 6.3.8
471
-
472
- - Always fetch 'id' and 'permissions' columns so that they are always available
473
-
474
- ## 6.3.7
475
-
476
- - Fixed a bug where items in a socket message that _might_ fit (`MAYBE`) in a collection would not be checked/added.
477
-
478
- ## 6.3.6
479
-
480
- - Fixed a bug where `AbstractCache.fetchUpdatedDerivedValuesFromDelta` would attempt to use ItemChanges not cached on
481
- the transaction resulting in an error
482
-
483
- ## 6.3.5
484
-
485
- - Fixed a bug where after creating items derived values would needlessly be refetched
486
-
487
- > The core now properly detect that even though an ItemId is updated (after a create) it's still the same item so no request has to be done
488
-
489
- - Fixed a bug where ItemEntry's would not be re-cached under their new ItemIds
490
-
491
- ## 6.3.4
492
-
493
- - Fixed a bug where already cached itemEntries would not properly be detected when calling `ServerCache.processResponse`
494
- - Fixed a bug where calling `CreatedChangesDelta.remove` would add `empty` values in the array instead of removing the
495
- entry
496
-
497
- ## 6.3.3
498
-
499
- - Fixed a bug where local ItemEntries were not properly updated after saving
500
-
501
- ## 6.3.2
502
-
503
- - Fixed updating item entry itemId field after processing changes
504
-
505
- ## 6.3.1
506
-
507
- - Fixed a bug where query with a local ID would do a request to the server
508
-
509
- ```
510
- // This example should now no longer do a request
511
- transaction.getItemsByQuery(
512
- 'Tijd',
513
- {
514
- project: -11,
515
- }
516
- );
517
- ```
518
-
519
- ## 6.3.0
520
-
521
- - Allow strict typing of `FieldMap`
522
-
523
- ## 6.2.5
524
-
525
- - Remove overwriting itemType with itemType of rootItem during create
526
-
527
- ## 6.2.4
528
-
529
- - Fixed a bug where items would not appear in a collection after changes propagated from a parent transaction
530
-
531
- ## 6.2.3
532
-
533
- - Fixed a bug where `previous` would actually contain new values because the `previous` object was made after the values
534
- were already synced
535
-
536
- ## 6.2.2
537
-
538
- - Fixed a bug in syncing of initial values after saving an item causing the item to still be marked having changes
539
-
540
- ## 6.2.1
541
-
542
- - Fixed a bug where `ItemEntry`s created on the `ServerCache` where not matched on child `TransactionCache`s
543
-
544
- ## 6.2.0
545
-
546
- - Fixed a bug where synchronous validators would leave the validator in `pending` state
547
- - Only re-match items when values are actually changed
548
- - Removed `defered` from `CachedQueryItem` and added `resolve` and `reject`
549
- - Check if ItemEntries are already created before creating new ones, if that is the case treat it like an update
550
-
551
- > What could happen was that a faster request created an ItemEntry for the same item as another request
552
- > which caused the double creation of an ItemEntry
553
-
554
- ## 6.1.3
555
-
556
- - Add `isPending` function to `TransactionValidator`
557
- - `TransactionCache`s will now be invalid until all pending transaction validators are done
558
-
559
- ## 6.1.2
560
-
561
- - Check if an error key exists before deleting it in `TransactionCache.clearItemError`
562
-
563
- ## 6.1.1
564
-
565
- - Correctly pass `ErrorHandlerInterface` to `ChangesDeltaFactory`.
566
-
567
- ## 6.1.0
568
-
569
- - Return `ChangesDelta` instance in `setItemUpdated`, `setItemDeleted`, `setItemsDeleted` methods, and a promise that
570
- resolves to the instance in `setItemCreated` and `setItemsCreated`.
571
-
572
- ## 6.0.2
573
-
574
- - Update `query` parameter of `getByQuery`, `getLocalByQuery`, `batchGetLocalByParent`, and `matchQuery` in `ItemCache`.
575
-
576
- ## 6.0.1
577
-
578
- - Fixed a bug where a local item wouldn't be found when using `TransactionCache.getItemByState` on a child transaction
579
-
580
- ## 6.0.0
581
-
582
- - Refactored query caching structure
583
- - Properly implemented `limit` in collections
584
- - Removed extending of collections
585
-
586
- ## 5.0.1
587
-
588
- - Add 'icon' column type to non-selectable column types
589
-
590
- ## 5.0.0
591
-
592
- - Fixed a bug where created, creator and permissions was always set to default values
593
- - **Breaking:** Remove `onItemsCreated` collection callback.
594
-
595
- ## 4.0.4
596
-
597
- - Fixed a bug where ModuleChangesCompilation wouldn't include all changes
598
-
599
- ## 4.0.3
600
-
601
- - Local collections are now correctly identified when using a local ID in a linkTo request instead of the `parent`
602
- option
603
- - Fix issue where local collection entries were not moved to server cache after save.
604
-
605
- ## 4.0.2
606
-
607
- - Fixed a bug where clearing collections would error after saving a transaction
608
-
609
- ## 4.0.1
610
-
611
- - Remove thrown error in `ItemResource.callOnChange`
612
-
613
- > The frontend still relied on this and we won't refactor that at this point
614
-
615
- ## 4.0.0
616
-
617
- - Removed `ItemResourceOptions.onChange`, this is replaced by `TransactionCache.registerFieldChangeCallback`
618
-
619
- > Because the `onChange` is no longer stored on the ItemResource, the ItemResource doesn't have to be cached.
620
- > This way you don't have to call `ItemResource.clearResource` anymore (you do need to deregister the fieldChange callbacks)
621
-
622
- ## 3.1.0
623
-
624
- - **Breaking:** Remove `fields` property, add `getFields` method in `Template` class.
625
- - **Breaking:** Add `ConversionMapService`. Update `updateItemValues` to take a `source` and `destination` parameter.
626
- - Update `entry.itemId` for items created items in `TransactionCache.getDelta`.
627
-
628
- > This fixes an issue with updating IDs of local items.
629
-
630
- - Add dependency interfaces for `AbstractCache`, `ServerCache`, `TransactionCache`, `TransactionCollectionHandler`
631
- , `TransactionItemHandler`.
632
- - Add `CreatedChangesDelta` class, which replaces the `created` component of the `ChangesDelta` and includes some query
633
- methods. Add `isEmpty` method to `ChangesDelta`.
634
-
635
- ## 3.0.1
636
-
637
- - Fixed a bug where the `StateKeyType` enum couldn't be used when imported
638
-
639
- ## 3.0.0
640
-
641
- - Remove ViewResource, EditResource, CollectionViewResource and CollectionEditResource
642
-
643
- > There was no real distinction between them anymore since the core 2.0 update.
644
- > You can now use the base ItemResource and CollectionResource types instead
645
-
646
- ## 2.4.0
647
-
648
- - Update Typescript version to `3.7.2`, also update other plugins
649
-
650
- ## 2.3.0
651
-
652
- - Add callbacks when errors are set/cleared to `TransactionEventHandler`
653
- - Added the possibility to differentiate between errors to display below a field and on the save button
654
- in `TransactionValidator`
655
- - Changed the format of the error translations from `string` to `() => string` in `TransactionValidator`
656
-
657
- > Now the translation function will only be called when the error is actually set, not when it's cleared
658
-
659
- ## 2.2.1
660
-
661
- - Fixed a bug where resolving derived values for new items (in `TransactionCache.applyChangesDelta`) would sometimes
662
- error
663
-
664
- ## 2.2.0
665
-
666
- - `ChangesDelta.setItem(s)Created` will now accept incomplete input values
667
-
668
- > It will now fetch a template for you and process the items, so you no longer need to do that yourself
669
-
670
- ## 2.1.2
671
-
672
- - Fixed a bug where deleted ItemEntries weren't picked up when detecting transaction changes
673
-
674
- ## 2.1.1
675
-
676
- - Fixed a bug where an ItemEntry's errors wouldn't be deleted when the ItemEntry was deleted on a transaction
677
-
678
- ## 2.1.0
679
-
680
- - Refactor `TransactionCache.getItemsByQuery` to check cached entries (just like a collection)
681
- - Add `TransactionValidator`, allow passing of a `TransactionValidatorFactory` to a transaction
682
-
683
- > You can use these validators to set errors using `setItemError` and `setGlobalError`
684
-
685
- - Fixed a bug where `TransactionItemHandler.cloneItemEntry` could only clone entry with changes on the target
686
- transaction.
687
-
688
- > It will not look for changes recursively on the transaction change
689
-
690
- ## 2.0.19
691
-
692
- - Ensure all requestColumns for newly created ItemEntries from a template are available
693
- - Ensure derived values for newly created ItemEntries from a template are available
694
-
695
- ## 2.0.18
696
-
697
- - Include read-only columns when detecting changes in TransactionItemHandler.processItemEntryChanges
698
-
699
- > Read-only columns shouldn't count as changes on the tab, but they should be taking into account when deciding whether or not to call `onChange`
700
-
701
- ## 2.0.17
702
-
703
- - Fixed a bug where deleting an item that isn't in the transaction's item entry cache would result in an error
704
- - Fixed a bug where response columns weren't set for newly created local CollectionEntries
705
- - Fixed a bug where items weren't matched for newly created local CollectionEntries
706
-
707
- ## 2.0.16
708
-
709
- - Fixed a bug where queries with a link to a local parent item weren't updated on save
710
-
711
- ## 2.0.15
712
-
713
- - Cache ItemEntries that fit collections on the CollectionEntry's query instead of the CollectionEntry's id
714
- - Add a 'hint' to ChangesDeltas which allows skipping the extra request to validate `maybe` query matches
715
- - Create transaction changes for ItemEntry updates in the changesDelta if non exist yet when
716
- calling `TransactionCache.applyChangesDelta`
717
-
718
- > This allows you to update values on a transaction without having to fetch a resource for it by calling
719
- > `ChangesDelta.setItemUpdated()`
720
-
721
- ## 2.0.14
722
-
723
- - Fixed reading of derived values in `getItemIdByColumn` when a ChangesDelta is passed
724
-
725
- ## 2.0.13
726
-
727
- - Fixed a bug where the incorrect fields where applied to the ChangesDelta in `TransactionItemHandler.cloneItemEntry`
728
- - A RequestBuffer's promise will now resolve after the ServerCache.processResponse promise is done, ensuring all values
729
- are present before continuing
730
- - Request columns for the request ItemType will now properly be taken into account in ServerCache.processResponse
731
- ensuring root columns are always properly set. (This is used to update derived values)
732
-
733
- ## 2.0.12
734
-
735
- - Fixed a bug where created changes weren't copied to the itemchanges
736
- - Only take readonly parent columns instead of all readonly columns in `ApiFormatter.hasChanges`
737
- - Fixed a bug where ItemEntry's where still in `ItemCache.entriesByEntryId` after clearing them
738
-
739
- ## 2.0.11
740
-
741
- - Fixed a bug where changes weren't copied to the itemchanges
742
- - Fixed correct isCalledAfterApiSave values on calls to ServerCache.processResponse
743
-
744
- ## 2.0.10
745
-
746
- - Construct `ColumnSet` with proper `requestColumns` when creating a `Template` with additional columns
747
-
748
- ## 2.0.9
749
-
750
- - Properly process linked items from the template request in `TransactionItemHandler.createItems`
751
-
752
- ## 2.0.8
753
-
754
- - Fixed a bug where not all fields where available even tough an ItemResource with specific columns was created
755
-
756
- ## 2.0.7
757
-
758
- - Define abstract copyTransactionItemEntryChanges on ItemHandlerBase
759
- - Implement copyTransactionItemEntryChanges on TransactionItemHandler and ServerItemHandler
760
- - Fix AbstractCache/ServerCache/TransactionCache `getParent` function arguments
761
-
762
- > With the newly added arguments the function definitions didn't align anymore causing typescript errors
763
- > Even though the arguments aren't used in the `ServerCache` they're added in there
764
-
765
- ## 2.0.6
766
-
767
- - Remove `ApiFormatter.lazyClone`
768
-
769
- > You can't lazily clone moment objects because the moment you wanted to clone could be changed in the time the getter isn't invoked, resulting in a different value
770
-
771
- - Create a copy of the child transaction's field instead of copying the object reference
772
- in `TransactionCache.applyChangeFromChild` and `ChangesProcessor.executeCreateRequest`
773
-
774
- > When writing to the object references you're changing multiple transactions at once, while this should be handled by applyCHangesFromParent
775
-
776
- ## 2.0.5
777
-
778
- - Add `callOnAddWithInitialItems` option to `CollectionResourceOptions`
779
-
780
- > If `true` the `onAdd` callback will be called with the initial set of items
781
-
782
- ## 2.0.4
783
-
784
- - Add `isCalledAfterSocketUpdate` to `onAdd`, `onRemove` and `onChange` callbacks
785
-
786
- > You can use this if a data change should only trigger an action when the user caused it himself
787
-
788
- ## 2.0.3
789
-
790
- - Fix `CollectionEditResource.removeItems`
791
- - Move `getCurrentCollectionEntryCache` and `getCurrentItemEntryCache` from `TransactionCache` to `AbstractCache`
792
-
793
- ## 2.0.2
794
-
795
- - Fix marking entries as deleted and compiling this into a request
796
-
797
- ## 2.0.1
798
-
799
- - Expand CollectionEntry's columns in `ServerCollectionHandler.fetchCollectionData`
800
-
801
- ## 2.0.0 - Major caching refactor
802
-
803
- - Completely reworked internal caching structure,
804
- see [this Confluence page](https://rentman.atlassian.net/wiki/spaces/DEV/pages/704872456/) for the motivations behind
805
- it.
806
-
807
- ## 1.9.0
808
-
809
- - Don't create ItemResources when not returning links in `ItemAdministrator.getNewResourceWithId` and
810
- in `ItemAdministrator.constructOnItemsExpanded`
811
-
812
- ## 1.8.0
813
-
814
- - Remove `ResourceCache` and `resourceLevel`
815
-
816
- > You should now manually call `resource.clearResource` when you no longer need a resource
817
-
818
- - Add `onConstruct` function to `ItemResource` and `CollectionResource`
819
-
820
- > This is overwritten by the frontend to track resource creation
821
-
822
- ## 1.7.6
823
-
824
- - Add priority parameter to local cache callbacks. The callback condition (`always` / `onClose` / `skipOnClose`) no
825
- longer has any effect on the order in which the callbacks get executed.
826
- - **Breaking:** Remove `LocalCacheCallbackCondition` enum.
827
- - Add `itemId` parameter to `ItemHandler.fetchNewItem`. An error is thrown when an ID already exists.
828
- Add `getNewResourceWithId` to ItemAdministrator. Deprecate `getItemByState`.
829
-
830
- ## 1.7.5
831
-
832
- - For template column sets it is no longer assumed all columns are present. This fixes an issue with incomplete column
833
- sets in the front-end.
834
- - Fix issue where `changesProcessor` instance was undefined in `itemResourceFactory` and `collectionResourceFactory`.
835
- Create variables for each core service in order to get a TypeScript error when a dependency hasn't been initialized
836
- yet.
837
-
838
- ## 1.7.4
839
-
840
- - Add support for strict ItemType type checking in `FieldMap`
841
-
842
- ## 1.7.3
843
-
844
- - Add support for strict ItemType type checking
845
-
846
- > This is temporarily defaulted to `any` to prevent compile errors in the frontend
847
-
848
- ## 1.7.2
849
-
850
- - Fix some typing issues in:
851
- - ApiResponseProcessor
852
- - ItemCache
853
- - KeyService
854
-
855
- ## 1.7.1
856
-
857
- - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
858
-
859
- ## 1.7.0
860
-
861
- - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
862
-
863
- ### Resource caching
864
-
865
- - **Breaking:** the following properties are removed:
866
- - On `ItemEntry`: `clearResources`, `deactivateResources`.
867
- - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
868
- - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
869
- - An additional `level` parameter has been added to all methods that return resources.
870
- - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
871
- A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
872
- - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection and
873
- collection resources with a level of `level` or higher will be removed.
874
- - The `clearResources` method has been removed from `LocalCache`.
875
- - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
876
-
877
- ## 1.6.13
878
-
879
- - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
880
- promise has been resolved.
881
-
882
- > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
883
-
884
- ## 1.6.12
885
-
886
- - Fix error that occurs when trying to resolve a non-deferred collection entry.
887
-
888
- ## 1.6.11
889
-
890
- - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
891
-
892
- ## 1.6.10
893
-
894
- - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
895
- `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
896
-
897
- ## 1.6.9
898
-
899
- - Redeploy of `1.6.8`
900
-
901
- ## 1.6.8
902
-
903
- - Add support for `not` in queries
904
-
905
- ## 1.6.7
906
-
907
- - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
908
-
909
- ## 1.6.6
910
-
911
- - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial`
912
- parameter in `CollectionEntry.extend`, as it should always be true.
913
-
914
- > The `extend` function only concerns itself with remote items, so no local changes should be generated.
915
-
916
- ## 1.6.5
917
-
918
- - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
919
-
920
- > This could lead to instances where a different column would be set to the value of the parent.
921
-
922
- ## 1.6.4
923
-
924
- - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
925
- - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for
926
- the `resultCollectionResource`.
927
-
928
- ## 1.6.3
929
-
930
- - Properly type ApiResponseProcessor - fetchObjectArray
931
-
932
- ## 1.6.2
933
-
934
- - Fix issue where the collection handler would return collection entries before they were resolved when
935
- calling `batchFetch`.
936
-
937
- ## 1.6.1-3
938
-
939
- - Check for linkedTo before checking for subqueries in QueryMatcher
940
-
941
- > Linkedto also has `.query` and was incorrectly marked as a subquery
942
-
943
- ## 1.6.1-2
944
-
945
- - Fixed shorthand query with null values
946
-
947
- > The QueryParser would incorrectly identify subqueries when using null in a shorthand
948
-
949
- ## 1.6.1-1
950
-
951
- - Fixed shorthand query with Moment values
952
-
953
- > The QueryParser would incorrectly identify Moment objects as a subquery
954
-
955
- ## 1.6.1
956
-
957
- - Added support for subqueries in QueryParser and QueryMatcher
958
-
959
- > Collections using subqueries will always return 'maybe' in the QueryMatcher
960
-
961
- ## 1.6.0
962
-
963
- - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core
964
- functionality.
965
- - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
966
-
967
- ## 1.5.9
968
-
969
- - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column. Catch exceptions that
970
- might occur when resolving an `ItemEntry`.
971
- - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a
972
- collection, add them to the collection.
973
-
974
- ## 1.5.8
975
-
976
- - Introduce `RemoteViewResource` and `LocalViewResource`.
977
-
978
- > The `fields` property of a `RemoteViewResource` represents server values, while the `fields` property of a `LocalViewResource` represents local values.
979
-
980
- - The `fields` property of a `ViewResource` is now read only.
981
-
982
- ## 1.5.7-1
983
-
984
- - Make ItemResource/CollectionResource base class abstract
985
- - Add missing overload functions in some places
986
- - Fix default comparator `QueryMatcher.parseSimpleQuery`
987
- - Fix `ExtendedCollectionMatchResult` `collection` property type
988
-
989
- ## 1.5.7
990
-
991
- - Properly type Collections & ItemResources (and return values) in the whole core.
992
-
993
- > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
994
- > You can now also type the expected collection type
995
-
996
- ```
997
- // Expects a collection with editCollection and editItems both `true`
998
- // Will properly return EditResources for all collection functions
999
- const collection: CollectionEditResource<EditResource>;
1000
-
1001
- // other variations are:
1002
- // CollectionViewResource<ViewResource>
1003
- // CollectionViewResource<EditResource>
1004
- // CollectionEditResource<ViewResource>
1005
-
1006
- this.core.itemAdministrator.getCollection(
1007
- 'Notitie',
1008
- {
1009
- editCollection: true, // Will return a CollectionEditResource
1010
- editItems: true // Will return EditResources instead of ViewResources in `.items`
1011
- }
1012
- )
1013
- ```
1014
-
1015
- ## 1.5.6
1016
-
1017
- - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
1018
-
1019
- ## 1.5.5
1020
-
1021
- - Add 'order' column type handling to ApiFormatter functions
1022
-
1023
- ## 1.5.4
1024
-
1025
- - Fix issue where parent would be incorrectly set when cloning a single item.
1026
- - Type functions related to expansion maps in `ItemEntryService`.
1027
-
1028
- ## 1.5.3
1029
-
1030
- - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
1031
- calling `save` on a collection resource where this option was not explicitly set.
1032
-
1033
- ## 1.5.2
1034
-
1035
- - Type functions in `ColumnUtil` class.
1036
- - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
1037
-
1038
- > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
1039
-
1040
- - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
1041
- - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
1042
-
1043
- ## 1.5.1
1044
-
1045
- - Properly remove item entry stub from (local) cache when request fails.
1046
- - Fix issue where item or collection options could be set to undefined.
1047
-
1048
- ## 1.5.0
1049
-
1050
- - Add `SocketMessage` type and add types to `SocketMessageHandler`
1051
- - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
1052
- (`fetchItem` or `fetchItems` in `ItemHandler`.)
1053
- - Implement expanding of local collections. This no longer leads to invalid requests.
1054
- - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
1055
- - **Warning:** This version contains major changes.
1056
-
1057
- ### Introduce typing of item and collection options
1058
-
1059
- - **Breaking:** Removed `QueryItemType` collection entry option.
1060
- - **Breaking:** Removed `ItemResourceService`.
1061
- - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
1062
- `addCollection`.
1063
- - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
1064
- collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
1065
- still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
1066
-
1067
- ## v1.4.0
1068
-
1069
- - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
1070
- `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
1071
- They have a slightly different type signature.
1072
- - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
1073
- necessary.
1074
- - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
1075
- - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
1076
-
1077
- ## v1.3.8
1078
-
1079
- - Add `isSaving` to `LocalCache`
1080
-
1081
- > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
1082
-
1083
- ## v1.3.7
1084
-
1085
- - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the
1086
- parent.
1087
- - Remove slip workarounds
1088
- - Add api request types
1089
- - Add types to `ModuleChangesCompilation`
1090
-
1091
- ## v1.3.6
1092
-
1093
- - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
1094
-
1095
- ## v1.3.5
1096
-
1097
- - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
1098
-
1099
- ## v1.3.4
1100
-
1101
- - Add country to isFilteredColumn in ColumnUtil
1102
-
1103
- ## v1.3.3
1104
-
1105
- - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
1106
-
1107
- > These functions are specifically used for rendering ui-grid in the frontend, so there's no reason to have them in the core
1108
-
1109
- ## v1.3.2
1110
-
1111
- - Fix types path in package.json
1112
-
1113
- ## v1.3.1
1114
-
1115
- - Fix types path in package.json
1116
-
1117
- ## v1.3.0
1118
-
1119
- - Rename PromiseInterface to PromiseLibraryInterface
1120
-
1121
- > PromiseInterface is now used for the internal promise type
1122
-
1123
- - Use PromiseInterface instead of Promise as internal promise type
1124
-
1125
- > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
1126
-
1127
- ## v1.2.9
1128
-
1129
- - Call processOptions in fetchDerivedValuesByColumn
1130
-
1131
- > Bug was introduced earlier but got enabled in v1.2.7
1132
-
1133
- ## v1.2.8
1134
-
1135
- - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
1136
-
1137
- ## v1.2.7
1138
-
1139
- - Set itemEntry parent when generating a stub
1140
-
1141
- ## v1.2.6
1142
-
1143
- - Fix an issue introduced in v1.2.5.
1144
-
1145
- ## v1.2.5
1146
-
1147
- - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
1148
- solves an issue with refreshing on a local edit view.
1149
-
1150
- ## v1.2.4
1151
-
1152
- - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
1153
- is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
1154
- - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
1155
- - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
1156
- `TemplateLinkedItemEntryMap`.
1157
- - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
1158
-
1159
- ## v1.2.3
1160
-
1161
- - Fixed issue where derived values deeper than one layer couldn't be resolved.
1162
-
1163
- ## v1.2.2
1164
-
1165
- - Fixed issue where in derived values weren't set after create request.
1166
-
1167
- ## v1.2.1
1168
-
1169
- - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
1170
- function of the `EditResource` class.
1171
- - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
1172
- - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`)
1173
- when `modInstant` is set to true.
1174
-
1175
- ## v1.2.0
1176
-
1177
- - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
1178
- resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
1179
- `{key: 'value'}` should now be used as argument when calling these functions.
1180
- - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
1181
-
1182
- ## v1.1.20
1183
-
1184
- - Fixed minor issue where collection wouldn't be deferred properly before expanding.
1185
- - `onChange` is now called automatically when when calling `commit` on an edit resource.
1186
-
1187
- ## v1.1.19
1188
-
1189
- - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
1190
- `localCache` parameter.
1191
-
1192
- ### Local cache callback refactoring
1193
-
1194
- - Removed `onSaveWithoutClosing` event.
1195
- - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
1196
- `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
1197
- callbacks.
1198
- - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
1199
- to `onSaveSuccess` callback functions.
1200
-
1201
- ## v1.1.18
1202
-
1203
- - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
1204
- - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
1205
- collection entries.
1206
-
1207
- ## v1.1.17
1208
-
1209
- - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
1210
- - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
1211
- of `getByParent`.
1212
-
1213
- ### Cache invalidation
1214
-
1215
- - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
1216
- collection entry containing the item is requested.
1217
- - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
1218
- - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
1219
- and collection entries.
1220
-
1221
- ### Item entry refactoring
1222
-
1223
- - Renamed `process` to `setFields`.
1224
- - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
1225
- - `setModified` now also sets local default values.
1226
- - Removed `setCreator`. This function was called twice in some instances.
1227
- - **Breaking:** Added `derived` parameter to `updateFields`
1228
-
1229
- ## v1.16
1230
-
1231
- - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
1232
- project financial values in the front-end. [RM4-9577]
1233
- - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
1234
- from being added to the local cache.
1235
-
1236
- ## v1.15
1237
-
1238
- - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
1239
- - Fix type definition of `PromiseInterface.all`.
1240
-
1241
- ## v1.14
1242
-
1243
- - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
1244
- issue with recurring appointments in the front-end.
1245
-
1246
- ## v1.13
1247
-
1248
- - Add option to exclude itemTypes during createLocalEntries.
1249
-
1250
- ## v1.12
1251
-
1252
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
1253
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
1254
- from the local cache inadvertently.
1255
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate
1256
- chaining.
1257
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
1258
- are now respected. This fixes an issue where items where *not* removed from the local cache.
1259
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
1260
- issue where changes were being detected continuously.
1261
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
1262
- except when updating documents. This fixes several issues.
1263
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
1264
- collection was added multiple times.
1265
- - Updated all models to use dependency objects. This increases ease of debugging.
1266
-
1267
- ## v.1.11
1268
-
1269
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
1270
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
1271
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
1272
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
1273
- completed transactions.
1274
-
1275
- ## v.1.10
1276
-
1277
- - Fixed issue where changes on different subtabs were not detected.
1278
-
1279
- ## v1.1.9
1280
-
1281
- - Exposed `noop` function on `RmCore` class.
1282
-
1283
- > This is used in order to check whether a callback has a default value.
1284
-
1285
- - Added `copyRequestColumns` function to `ColumnUtil` class.
1286
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
1287
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
1288
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
1289
- `breakUpByParent` - `onAfterCreateCallback`.
1290
-
1291
- ## v1.1.8
1292
-
1293
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
1294
-
1295
- ## v1.1.7
1296
-
1297
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
1298
-
1299
- ## v1.1.6
1300
-
1301
- - Fixed issue with deferred item entries.
1302
- - Re-enable changes watcher after save.
1303
- - Added optional `id` parameter to `LocalCache` constructor.
1304
-
1305
- ## v1.1.5
1306
-
1307
- - Added `clearItem` function to `LocalCache` class.
1308
-
1309
- ## v.1.1.4
1310
-
1311
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
1312
-
1313
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add the items to the local cache.
1314
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
1315
- doing it however can definitely be harmful.
1316
-
1317
- ## v.1.1.3
1318
-
1319
- - Fixed an issue where all collections in a local cache would be cleared.
1320
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
1321
- `LocalCacheManagerInterface`.
1322
-
1323
- ## v1.1.2
1324
-
1325
- - Fixed an issue concerning derived values.
1326
-
1327
- ## v1.1.1
1328
-
1329
- - Fixed an issue where changes wouldn't be detected.
1330
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
1331
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
1332
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
1333
- `disableChangesWatcher` instead.
1334
-
1335
- ## v1.1.0
1336
-
1337
- ### Development
1338
-
1339
- #### Strict TypeScript compilation
1340
-
1341
- Added the following TypeScript compiler options:
1342
-
1343
- - noImplicitThis
1344
- - noImplicitReturns
1345
- - strictNullChecks
1346
- - noUnusedLocals
1347
- - noUnusedParameters
1348
-
1349
- I would advise enabling these for all TypeScript projects from now on.
1350
-
1351
- #### Ordered imports and dependencies
1352
-
1353
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this. Please note that
1354
- this also applies for imports from the folder the file is currently in. For example, in `models/ItemResource.ts`
1355
- , `itemEntry` should be imported like so:
1356
- `import { ItemEntry } from '../models';`
1357
-
1358
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
1359
- remove dependencies in the future.
1360
-
1361
- ### Breaking changes
1362
-
1363
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
1364
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
1365
- `moduleChangesCompilationFactory`.
1366
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is no
1367
- longer supported in the back-end.
1368
-
1369
- #### Item and collection entries
1370
-
1371
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
1372
- - Added the following functions to `ItemEntryService`:
1373
- - `createLocalConversionMap`;
1374
- - `expandLocalConversionMap`;
1375
- - `expandConversionMap`;
1376
- - `batchExpandConversionMap`;
1377
- - `batchClone`.
1378
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new item ID, and
1379
- update the conversion map accordingly, but will respect the item ID that is already there.
1380
-
1381
- #### Rework item caching
1382
-
1383
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default. All
1384
- entries are added to the global cache on save. Item entries are added to the local cache when resources are created
1385
- using the item administrator or when resources are created when adding the items to a collection.
1386
-
1387
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
1388
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
1389
- > pasting of items.
1390
-
1391
- Other changes:
1392
-
1393
- - Moved `saveLocal` to `ItemAdministrator`;
1394
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
1395
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
1396
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
1397
- already on the backend. (Use `getCollectionMatcher`.)
1398
-
1399
- ## v1.0.33
1400
-
1401
- - Really fix types path
1402
-
1403
- ## v1.0.33
1404
-
1405
- - Fix types path
1406
-
1407
- ## v1.0.32
1408
-
1409
- - Update `tsconfig.json` to put definitions in the root folder
1410
-
1411
- > The app had an issue with AOT compilation because of this
1412
-
1413
- ## v1.0.31
1414
-
1415
- - Fix `columnHandler.fetchItemTypeTranslations`
1416
-
1417
- > It incorrectly looped over the response map, it should now work again
1418
-
1419
- ## v1.0.30
1420
-
1421
- - Remove `updateTabParams` from LocalCacheManagerInterface
1422
-
1423
- > The function wasn't used
1424
-
1425
- - Reworked class export
1426
-
1427
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
1428
-
1429
- ## v1.0.29
1430
-
1431
- - Fix inverted inArray check in CollectionEntry.removeItems
1432
-
1433
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
1434
-
1435
- ## v1.0.28
1436
-
1437
- Bug fixes only
1438
-
1439
- ## v1.0.27
1440
-
1441
- - `ItemEntry.initial` is now undefined by default
1442
-
1443
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
1444
-
1445
- ## v1.0.26
1446
-
1447
- Bundle both minified and unminified code, include sourcemaps from dev build
1448
-
1449
- ## v1.0.24, v1.0.25
1450
-
1451
- ! Use version `v1.0.26` !
1452
-
1453
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
1454
-
1455
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
1456
-
1457
- - Rename `ItemEntry.entryId` to `ItemEntry.id
1458
-
1459
- > It used to be called `id`, but it was changed in the seperation of the core.
1460
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
1461
-
1462
- - Rename ItemResource `startTransaction` to `start`
1463
-
1464
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
1465
-
1466
- - `SocketMessageHandler.onMessageReceived` now returns a promise
1467
-
1468
- > You can now use the updated items or hook into the result to update the ui for example
1469
-
1470
- ## v1.0.23
1471
-
1472
- - Rename ResourceCache to LocalCache
1473
-
1474
- > LocalCache only caches local items (name better reflects functionality)
1475
-
1476
- - Remove getter/setter for hasChanges
1477
-
1478
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
1479
-
1480
- - Remove `_getCollection` from ItemAdministrator
1481
-
1482
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
1483
- > options and should not be given as a separate argument. This was included to support the frontend
1484
-
1485
- - Remove `saveCurrentTab` from ItemAdministrator
1486
-
1487
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
1488
-
1489
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
1490
-
1491
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
1492
-
1
+ # Changelog
2
+
3
+ Contains new features, breaking changes and their reasoning
4
+
5
+ ## 12.1.2
6
+ - Fix issue where link columns where not included in `TransactionCachedQueryHandler.__fetchLinkedCachedQueryItems`.
7
+
8
+ ## 12.1.1
9
+
10
+ - Remove `getParentFast`, refactor `getParent` to use the (correct) logic from `getParentFast`
11
+ - Add `ItemResource.collectFields` which is an alias for `ItemResource.transaction.itemHandler.collectFields`
12
+
13
+ ## 12.1.0
14
+
15
+ - Added business logic rule to automatically sync `asset_location` field between Reparatie items and the selected
16
+ Exemplaar.
17
+
18
+ ## 12.0.5
19
+
20
+ - Rename ChangesDeltaItemUpdateMode modes
21
+ - Treat socket messages as `CLEAR_WHEN_SAME` update type
22
+ - Properly propagate server changes as updates by setting `didChangeAnyField`
23
+
24
+ ## 12.0.4
25
+
26
+ - Fix incorrect changes processing for local items in `TransactionItemHandler.processItemEntryChanges` which could cause
27
+ infinite loops with `onChange` hooks
28
+
29
+ ## 12.0.3
30
+
31
+ - Remove setting of locally created `displayname`s on the transaction changes and construct it when looking up
32
+ `displayname` in the fields proxy instead
33
+
34
+ > The `displayname` is a readonly column so it does not belong on the transaction, it was also causing issues because it
35
+ > was incorrectly marking the transaction as having changes
36
+
37
+ - Speed up `ItemEntryService.getDisplayname` by only looking up the required fields instead of calling `collectFields`
38
+
39
+ ## 12.0.2
40
+
41
+ - Fix `ModuleChangesCompilation` result and improve speed of it
42
+
43
+ ## 12.0.1
44
+
45
+ - Bugfixes for item changes caching
46
+
47
+ ## 12.0.0
48
+
49
+ - Replace `ColumnSubSetCache` with `RequestColumnsOperationCache`, implement `RequestColumnsOperationCache` to reduce
50
+ calls to `mergeRequestColumns`.
51
+
52
+ > This should improve performance when batch requesting collections.
53
+
54
+ - **Breaking:** Make request columns read only by default. Introduce `ApiRequestColumnsArray` (which is read-only) and
55
+ `MutableApiRequestColumnsArray` (which is not) convenience types to facilitate this.
56
+ - When handling responses of query and update requests, only match the items of the request item type. This prevents
57
+ items being used for derived values (with incomplete column sets) being matched.
58
+
59
+ - Completely rewrite how item changes are stored on transactions so that it now only tracks the actual changes this
60
+ should reduce memory footprint and increase performance
61
+
62
+ ## 11.0.4
63
+
64
+ - Fixed a bug where the QueryContainsLocalIdParser could break queries with an `IN` query with a mix of local and
65
+ non-local IDs.
66
+ - Fixed a bug in QueryContainsLocalIdParser that would not correctly find local IDs in subqueries of a linkedTo query.
67
+
68
+ ## 11.0.3
69
+
70
+ - Fixed a bug where the QueryParserIdUpdater could break queries with an `IN` with a single ID in it causing everything
71
+ that used that query afterwards (QueryMatcher etc) to fail
72
+
73
+ ## 11.0.2
74
+
75
+ - Copy cached queries to server cache in `TransactionCache.updateLocalItemIdReferences`. This ensures that remote cached
76
+ queries are present on the server cache after saving.
77
+
78
+ ## 11.0.1
79
+
80
+ - Include item type and query in 'non-existing query' error in `__expandCachedQuery`.
81
+
82
+ ## 11.0.0
83
+
84
+ - **Breaking:** Remove `priorityBufferSettings` collection option, replace with `usePrivateBuffer`.
85
+
86
+ > This option forces the use of a buffer just for the collection query. This allows for optimized matching and keeps
87
+ > the requested columns in check, because no other items will be added to the buffer.
88
+
89
+ - Fix issue where cached queries were expanded on the current transaction only. This would lead to data being requested
90
+ unnecessarily.
91
+ - Fix issue where columns needed for the query matcher weren't included when requesting cached queries.
92
+ - Add tracking of match attempts on CachedQueryItems
93
+ - Add tracking of cache hits on CachedQueryItems
94
+ - Add `custom` collection option back in. This was removed in the testing branch, but is still being used by the
95
+ front-end.
96
+
97
+ ## 10.1.0
98
+
99
+ - Performance: Removed caching of non-matchable queries, we now lose the ability to automatically add new items to these
100
+ collections (they still update upon re-requesting them)
101
+ but this saves a ton of matching requests.
102
+
103
+ ## 10.0.6
104
+
105
+ - Fixed issue where multiple locktockens could be requested when multiple calls to `fetchLocktoken` were made in quick
106
+ succession.
107
+
108
+ ## 10.0.5
109
+
110
+ - Refactor mapping of deleted entries in ChangesDeltas to be a map instead of an array
111
+ - Prevent setting items as updated on ChangesDeltas if it's also in deleted entries
112
+ - Remove updated and restored entries in ChangesDeltas if it's also in deleted entries
113
+
114
+ ## 10.0.4
115
+
116
+ - Fixed a bug introduced in 10.0.3 when trying to load a local item
117
+
118
+ ## 10.0.3
119
+
120
+ - Fixed a bug in which remotely fetched changes could overwrite changes of a parent transaction if there was a child
121
+ transaction
122
+
123
+ ## 10.0.2
124
+
125
+ - Use the promise library instead of native promises in BusinessLogicManager
126
+
127
+ ## 10.0.1
128
+
129
+ - Add the `MateriaalTelexemplarenBusinessLogicRule` to the core
130
+
131
+ ## 10.0.0
132
+
133
+ - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
134
+
135
+ ## 10.0.0-alpha.3
136
+
137
+ - Only set invoice module permissions when project permissions change if 'projecten_facturen_maken' is enabled
138
+
139
+ ## 10.0.0-alpha.2
140
+
141
+ - Fix infinite loop in Rol business logic
142
+
143
+ ## 10.0.0-alpha.1
144
+
145
+ - Introduce `BusinessLogicManager` and `BusinessLogicRule`s to the core
146
+
147
+ ## 9.3.1
148
+
149
+ - Fixed a bug where items that were both moved and updated could end up in a collection twice
150
+
151
+ ## 9.3.0
152
+
153
+ - Added order to the CacheSyncer functions ensuring that it's always in order of 1. removing 2. adding
154
+
155
+ ## 9.2.4
156
+
157
+ - Fixed a bug where incorrect request columns where added because of the query (in reverse linkedTo queries)
158
+
159
+ ## 9.2.3
160
+
161
+ - Fixed a bug in which multiple requests for the same item could result in incorrect expanded columns
162
+ - Increased performance of ColumnUtil by using string comparison over enums
163
+ - Increased performance of caching new items (in ChangesDelta._setItemCreated) by not creating default local values for
164
+ items from API responses
165
+
166
+ ## 9.2.2
167
+
168
+ - Optimize requests for collection trees with three levels. (E.g. MateriaalCat -> Planningmateriaal -> Missing)
169
+
170
+ ## 9.2.1
171
+
172
+ - Fix bug in 9.2.0 that caused updates of date fields not to be processed.
173
+
174
+ ## 9.2.0
175
+
176
+ - Greatly speed up core processing on large datasets
177
+ - Refactor the way ChangesDeltaBase.setItemUpdated processes fields to reduce `Object.getOwnPropertyDescriptor`
178
+ calls
179
+ - Refactor the way CacheSyncer.processDelta processes updated values to prevent unneeded field copying
180
+ and `Object.getOwnPropertyDescriptor` calls
181
+ - Add `RequestBufferManagerPrioritySettings` to give finer control over request buffering to the caller
182
+
183
+ ## 9.1.2
184
+
185
+ - Delete item lock when transaction is destroyed
186
+
187
+ > We never deleted item locks causing the items to be locked forever, even though a user wasn't editing them anymore
188
+
189
+ ## 9.1.1
190
+
191
+ - Fix handling of multiple create requests in one transaction
192
+
193
+ ## 9.1.0
194
+
195
+ - Implement cascading deletes based on backend delete relations
196
+
197
+ ## 9.0.5
198
+
199
+ - Prevent an error occurring when `fetchItemEntryData` did not return an itemEntry
200
+
201
+ ## 9.0.4
202
+
203
+ - Remove `MAYBE` matches that did not get returned after the API query from cached queries and collections
204
+ in `CacheSyncer`
205
+
206
+ ## 9.0.3
207
+
208
+ - Check for empty changesDeltas in `TransactionCache.applyChangesFromParent` to prevent unnecessary calls
209
+
210
+ ## 9.0.2
211
+
212
+ - Improve the way `getLinkCollections` fetches its data to greatly improve performance
213
+
214
+ ## 9.0.1
215
+
216
+ - Accept any version (apposed to `latest`) for @rentman/backend-types
217
+
218
+ ## 9.0.0
219
+
220
+ - **Breaking:** Align item changes in server cache and transaction cache: add `fields` property in server item changes,
221
+ rename `changes` in transaction item changes to fields. Remove `getChangesFromItemChanges`.
222
+
223
+ ## 8.2.11
224
+
225
+ - Only copy over cachedQueries when saving child transactions if the parent transaction doesn't have one with the query
226
+ yet
227
+
228
+ ## 8.2.10
229
+
230
+ - Fix displayname for 'CustomfieldGroup'
231
+ - Also set displayname when creating ItemEntries
232
+
233
+ ## 8.2.9
234
+
235
+ - Fixes a bug in which items on the ServerCache would not properly be added to collections
236
+
237
+ ## 8.2.8
238
+
239
+ - Fixes a bug in which newly created items do not appear in collections caused in 8.2.6
240
+
241
+ ## 8.2.7
242
+
243
+ - Merge tabRequestParameters when saving a TransactionCache into another TransactionCache
244
+
245
+ ## 8.2.6
246
+
247
+ - Fixed issue where deleted equipment re-appear
248
+
249
+ ## 8.2.5
250
+
251
+ - Skipped
252
+
253
+ ## 8.2.4
254
+
255
+ - Fixed issue where non-local items were expanded locally.
256
+ - Fixed hypothetical situation where an item entry in a local cached query could have an incomplete column set.
257
+
258
+ ## 8.2.3
259
+
260
+ - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
261
+
262
+ ## 8.2.2
263
+
264
+ - Fixed a bug where derived values would not be fetched for newly created local items
265
+ - Did a performance optimization which will cause aggregated columns not to be re-fetched unnecessarily
266
+
267
+ ## 8.2.1
268
+
269
+ - Skipped
270
+
271
+ ## 8.2.0
272
+
273
+ - Added support for collection trees. Now, when requesting a collection you can add the `children` property, which is a
274
+ map of collection options. The collection resources will be available in the item resources of the resulting
275
+ collection resource. For more information,
276
+ see [Confluence](https://rentman.atlassian.net/wiki/spaces/~652789241/pages/948404231/Child+collections).
277
+
278
+ ## 8.1.9
279
+
280
+ - RM4-16796 Fixed a bug where loading the same query in quick succession would cause columns/data to be missing
281
+
282
+ ## 8.1.8
283
+
284
+ - Reorganize imports: move all exports to `internal.ts`. This is the only place where things should be exported. All
285
+ files should import from this file. Resolve duplicate declaration of `InternalCreateDelta` type.
286
+ - Improve performance of copying over values in `ChangesDelta`s and `CollectionMatcherBase`
287
+ - Merge all `CollectionMatcher` classes into one `CacheSyncer`, so that `processDelta` only has to be done once
288
+ - Increase performance of the ApiFormatter on large datasets
289
+
290
+ ## 8.1.7
291
+
292
+ - Fixed a bug where copied over CachedQueryItems weren't resolved (causing them to hang forever)
293
+
294
+ ## 8.1.6
295
+
296
+ - Add missing return statement in ServerCache.applyChangesDelta
297
+
298
+ ## 8.1.5
299
+
300
+ - Only extend missing derived values while resolving local items
301
+ in `TransactionCachedQueryHandler.__fetchItemEntriesByQueryData`
302
+
303
+ ## 8.1.4
304
+
305
+ - Remove non-created items if they are not returned in the response of a Create request
306
+
307
+ > If a create would fail, the whole request would fail. So we can assume that if an item isn't returned from a create
308
+ > request, the backend has left it out on purpose
309
+
310
+ - Move cached queries to parent transactions only when saving a child transaction
311
+
312
+ > Only then you know for sure that items that matched on the child transaction will also match in the parent transaction,
313
+ > since you're taking over the changes, this behaviour was changed somewhere in a refactor but was incorrect
314
+
315
+ - No longer move cached queries to the ServerCache when saving a root transaction
316
+
317
+ > You probably don't need the result of *all* those cached queries anymore (and it's also inefficient to keep them because the matcher keeps the up-to-date)
318
+
319
+ - No longer wait for child transactions to sync when applying changes in a parent
320
+
321
+ > A child transaction can only influence a parent transaction by calling `TransactionCache.save`, which doens't happen whilst applying changes,
322
+ > so you don't have to wait for child transactions when applying changes in a parent
323
+
324
+ ## 8.1.3
325
+
326
+ - Allow passing TransactionOptions to TransactionCacheFactory.construct
327
+
328
+ ## 8.1.2
329
+
330
+ - Fixed a bug in which derived values for local items wouldn't be properly be fetched
331
+
332
+ ## 8.1.1
333
+
334
+ - Fixed a bug in which a `Template` request's columns weren't processed
335
+
336
+ ## 8.1.0
337
+
338
+ - Add `cloneCreatedChanges` function to `ChangesDeltaFactory`. This function clone the `created` component of a changes
339
+ delta into a destination changes delta.
340
+ - Add `TransactionOptions`, implement `transparent` transaction option
341
+ - Allow core-mapped TS types instead of backend-mapped TS types in `ApiFormatter.compareFields`
342
+ - Fixed a bug where empty update requests where sometimes done
343
+ - Fixed a bug where derived values of items returned in a Template request weren't properly resolved
344
+
345
+ ## 8.0.3
346
+
347
+ - Changed the flow of a create request so that it includes all the required columns for all transactions and also
348
+ processes additionally returned (derived) items
349
+ - Fixed a bug where fields referencing local items would already be updated in the `previous` before the `onChange`
350
+ callbacks were called
351
+ - Moved logic of updating IDs in cached queries/collections to TransactionCachedQueryHandler and
352
+ TransactionCollectionHandler
353
+
354
+ ## 8.0.2
355
+
356
+ - Fixed a bug where deleted entries on a child transaction where not handled properly
357
+ - Fixed a bug where saving a child transaction, and then undoing those changes and saving again would not update the
358
+ parent transaction
359
+
360
+ ## 8.0.1
361
+
362
+ - Uppercase operators and comparators in QueryMatcher, QueryParser and QueryService
363
+ - Fix parsing short-hand `IN` queryies
364
+
365
+ ## 8.0.0
366
+
367
+ - Implement `@rentman/backend-types`
368
+
369
+ > You will now have autocomplete and typing checking on all columns/fields 🥳
370
+
371
+ - Remove `ChangesDeltaResult.rollback`
372
+
373
+ > It was never really used/implemented
374
+
375
+ ## 7.2.0
376
+
377
+ - Add the `preventCaching` option to `CollectionOptions`
378
+
379
+ > Prevents a CachedQueryItem from being cached (the CollectionResource will still be cached), you can use this when you fetch an Itemtype for which the backend doesn't send socket messages (so it never automatically updates)
380
+
381
+ ## 7.1.1
382
+
383
+ - Properly handle moved items in ServerCache.applyChangesFromParent (technically the backend won't ever generate a
384
+ linkTo (only updates)) but it can happen when manually syncing the server cache (by
385
+ doing `InternalChangesDelta.setItemMoved`)
386
+
387
+ ## 7.1.0
388
+
389
+ - Automatically keep aggregated values up-to-date by always refetching them
390
+
391
+ ## 7.0.15
392
+
393
+ - Remove an accidentally left in place debugger
394
+
395
+ ## 7.0.14
396
+
397
+ - Take into account collections with a 'limit' (of which the query result isn't cached) when matching socket items
398
+
399
+ ## 7.0.13
400
+
401
+ - Only overwrite the displayname if the required columns are present, instead of defaulting to an empty string
402
+
403
+ ## 7.0.12
404
+
405
+ - Fixed a bug where the core would try to update the cache key (ID) of `fieldChangeCallbacks` even when there were no
406
+ callbacks for the given itemType
407
+
408
+ ## 7.0.11
409
+
410
+ - Fixed a bug where date values would not be compared if the descriptor was uncalled, this could lead to problems when
411
+ applying changes from a parent transaction
412
+
413
+ ## 7.0.10
414
+
415
+ - Update references to local IDs in other items when a local ID gets updated
416
+
417
+ ## 7.0.9
418
+
419
+ - Take over `tabRequestParameters` when saving TransactionCache -> TransactionCache
420
+
421
+ ## 7.0.8
422
+
423
+ - Fixed a race condition and loop iteration error which in very rare cases caused itemEntries to be `undefined` and
424
+ erroring
425
+ - Add missing error handling in transaction functions
426
+
427
+ ## 7.0.7
428
+
429
+ - Properly handle `reverse` linkedTo's in QueryColumnExtractor and QueryLocallyMatchableParser
430
+ - Implement refreshing of cached queries/collections
431
+
432
+ ## 7.0.6
433
+
434
+ Move fetching of lock from `TransactionItemHandler.processItemEntryChanges` to `TransactionCache.appyChangesDelta` to
435
+ also capture creates and deletes.
436
+
437
+ ## 7.0.5
438
+
439
+ - Remove automatic fetching of derived values for not-yet-created items
440
+
441
+ ## 7.0.4
442
+
443
+ - Automatically resolve derived values when a new item is created
444
+ - Fixed a bug where `AbstractCache.getParentFromFields` would still return `null` incorrectly
445
+
446
+ ## 7.0.3
447
+
448
+ - Fixed a bug where `AbstractCache.getParentFromFields` would still return `undefined` parent values
449
+
450
+ ## 7.0.2
451
+
452
+ - Check if any of the parent fields (`itemtype`, `item`) is `null`, in which case it won't be treated as a valid parent
453
+ in `AbstractCache.getParentFromFields`
454
+
455
+ ## 7.0.1
456
+
457
+ - Ignore columns in ApiFormatter::hasChanges if the `modified` object does not contain a value for it.
458
+
459
+ ## 7.0.0
460
+
461
+ - **Breaking**: Remove `enableChangesWatcher` and `disableChangesWatcher` in `TransactionCache`.
462
+ - Fetch lock token in `TransactionItemHandler.processItemEntryChanges`.
463
+
464
+ ## 6.3.10
465
+
466
+ - Only call `onRemove` of a collection if there are actually any items removed
467
+ - Expand cached columns anyways if there are no items to expand in `TransactionCachedQueryHandler.__expandCachedQuery`
468
+
469
+ ## 6.3.9
470
+
471
+ - Fixed a bug where deleted local items would still appear as unsaved changes
472
+
473
+ ## 6.3.8
474
+
475
+ - Always fetch 'id' and 'permissions' columns so that they are always available
476
+
477
+ ## 6.3.7
478
+
479
+ - Fixed a bug where items in a socket message that _might_ fit (`MAYBE`) in a collection would not be checked/added.
480
+
481
+ ## 6.3.6
482
+
483
+ - Fixed a bug where `AbstractCache.fetchUpdatedDerivedValuesFromDelta` would attempt to use ItemChanges not cached on
484
+ the transaction resulting in an error
485
+
486
+ ## 6.3.5
487
+
488
+ - Fixed a bug where after creating items derived values would needlessly be refetched
489
+
490
+ > The core now properly detect that even though an ItemId is updated (after a create) it's still the same item so no request has to be done
491
+
492
+ - Fixed a bug where ItemEntry's would not be re-cached under their new ItemIds
493
+
494
+ ## 6.3.4
495
+
496
+ - Fixed a bug where already cached itemEntries would not properly be detected when calling `ServerCache.processResponse`
497
+ - Fixed a bug where calling `CreatedChangesDelta.remove` would add `empty` values in the array instead of removing the
498
+ entry
499
+
500
+ ## 6.3.3
501
+
502
+ - Fixed a bug where local ItemEntries were not properly updated after saving
503
+
504
+ ## 6.3.2
505
+
506
+ - Fixed updating item entry itemId field after processing changes
507
+
508
+ ## 6.3.1
509
+
510
+ - Fixed a bug where query with a local ID would do a request to the server
511
+
512
+ ```
513
+ // This example should now no longer do a request
514
+ transaction.getItemsByQuery(
515
+ 'Tijd',
516
+ {
517
+ project: -11,
518
+ }
519
+ );
520
+ ```
521
+
522
+ ## 6.3.0
523
+
524
+ - Allow strict typing of `FieldMap`
525
+
526
+ ## 6.2.5
527
+
528
+ - Remove overwriting itemType with itemType of rootItem during create
529
+
530
+ ## 6.2.4
531
+
532
+ - Fixed a bug where items would not appear in a collection after changes propagated from a parent transaction
533
+
534
+ ## 6.2.3
535
+
536
+ - Fixed a bug where `previous` would actually contain new values because the `previous` object was made after the values
537
+ were already synced
538
+
539
+ ## 6.2.2
540
+
541
+ - Fixed a bug in syncing of initial values after saving an item causing the item to still be marked having changes
542
+
543
+ ## 6.2.1
544
+
545
+ - Fixed a bug where `ItemEntry`s created on the `ServerCache` where not matched on child `TransactionCache`s
546
+
547
+ ## 6.2.0
548
+
549
+ - Fixed a bug where synchronous validators would leave the validator in `pending` state
550
+ - Only re-match items when values are actually changed
551
+ - Removed `defered` from `CachedQueryItem` and added `resolve` and `reject`
552
+ - Check if ItemEntries are already created before creating new ones, if that is the case treat it like an update
553
+
554
+ > What could happen was that a faster request created an ItemEntry for the same item as another request
555
+ > which caused the double creation of an ItemEntry
556
+
557
+ ## 6.1.3
558
+
559
+ - Add `isPending` function to `TransactionValidator`
560
+ - `TransactionCache`s will now be invalid until all pending transaction validators are done
561
+
562
+ ## 6.1.2
563
+
564
+ - Check if an error key exists before deleting it in `TransactionCache.clearItemError`
565
+
566
+ ## 6.1.1
567
+
568
+ - Correctly pass `ErrorHandlerInterface` to `ChangesDeltaFactory`.
569
+
570
+ ## 6.1.0
571
+
572
+ - Return `ChangesDelta` instance in `setItemUpdated`, `setItemDeleted`, `setItemsDeleted` methods, and a promise that
573
+ resolves to the instance in `setItemCreated` and `setItemsCreated`.
574
+
575
+ ## 6.0.2
576
+
577
+ - Update `query` parameter of `getByQuery`, `getLocalByQuery`, `batchGetLocalByParent`, and `matchQuery` in `ItemCache`.
578
+
579
+ ## 6.0.1
580
+
581
+ - Fixed a bug where a local item wouldn't be found when using `TransactionCache.getItemByState` on a child transaction
582
+
583
+ ## 6.0.0
584
+
585
+ - Refactored query caching structure
586
+ - Properly implemented `limit` in collections
587
+ - Removed extending of collections
588
+
589
+ ## 5.0.1
590
+
591
+ - Add 'icon' column type to non-selectable column types
592
+
593
+ ## 5.0.0
594
+
595
+ - Fixed a bug where created, creator and permissions was always set to default values
596
+ - **Breaking:** Remove `onItemsCreated` collection callback.
597
+
598
+ ## 4.0.4
599
+
600
+ - Fixed a bug where ModuleChangesCompilation wouldn't include all changes
601
+
602
+ ## 4.0.3
603
+
604
+ - Local collections are now correctly identified when using a local ID in a linkTo request instead of the `parent`
605
+ option
606
+ - Fix issue where local collection entries were not moved to server cache after save.
607
+
608
+ ## 4.0.2
609
+
610
+ - Fixed a bug where clearing collections would error after saving a transaction
611
+
612
+ ## 4.0.1
613
+
614
+ - Remove thrown error in `ItemResource.callOnChange`
615
+
616
+ > The frontend still relied on this and we won't refactor that at this point
617
+
618
+ ## 4.0.0
619
+
620
+ - Removed `ItemResourceOptions.onChange`, this is replaced by `TransactionCache.registerFieldChangeCallback`
621
+
622
+ > Because the `onChange` is no longer stored on the ItemResource, the ItemResource doesn't have to be cached.
623
+ > This way you don't have to call `ItemResource.clearResource` anymore (you do need to deregister the fieldChange callbacks)
624
+
625
+ ## 3.1.0
626
+
627
+ - **Breaking:** Remove `fields` property, add `getFields` method in `Template` class.
628
+ - **Breaking:** Add `ConversionMapService`. Update `updateItemValues` to take a `source` and `destination` parameter.
629
+ - Update `entry.itemId` for items created items in `TransactionCache.getDelta`.
630
+
631
+ > This fixes an issue with updating IDs of local items.
632
+
633
+ - Add dependency interfaces for `AbstractCache`, `ServerCache`, `TransactionCache`, `TransactionCollectionHandler`
634
+ , `TransactionItemHandler`.
635
+ - Add `CreatedChangesDelta` class, which replaces the `created` component of the `ChangesDelta` and includes some query
636
+ methods. Add `isEmpty` method to `ChangesDelta`.
637
+
638
+ ## 3.0.1
639
+
640
+ - Fixed a bug where the `StateKeyType` enum couldn't be used when imported
641
+
642
+ ## 3.0.0
643
+
644
+ - Remove ViewResource, EditResource, CollectionViewResource and CollectionEditResource
645
+
646
+ > There was no real distinction between them anymore since the core 2.0 update.
647
+ > You can now use the base ItemResource and CollectionResource types instead
648
+
649
+ ## 2.4.0
650
+
651
+ - Update Typescript version to `3.7.2`, also update other plugins
652
+
653
+ ## 2.3.0
654
+
655
+ - Add callbacks when errors are set/cleared to `TransactionEventHandler`
656
+ - Added the possibility to differentiate between errors to display below a field and on the save button
657
+ in `TransactionValidator`
658
+ - Changed the format of the error translations from `string` to `() => string` in `TransactionValidator`
659
+
660
+ > Now the translation function will only be called when the error is actually set, not when it's cleared
661
+
662
+ ## 2.2.1
663
+
664
+ - Fixed a bug where resolving derived values for new items (in `TransactionCache.applyChangesDelta`) would sometimes
665
+ error
666
+
667
+ ## 2.2.0
668
+
669
+ - `ChangesDelta.setItem(s)Created` will now accept incomplete input values
670
+
671
+ > It will now fetch a template for you and process the items, so you no longer need to do that yourself
672
+
673
+ ## 2.1.2
674
+
675
+ - Fixed a bug where deleted ItemEntries weren't picked up when detecting transaction changes
676
+
677
+ ## 2.1.1
678
+
679
+ - Fixed a bug where an ItemEntry's errors wouldn't be deleted when the ItemEntry was deleted on a transaction
680
+
681
+ ## 2.1.0
682
+
683
+ - Refactor `TransactionCache.getItemsByQuery` to check cached entries (just like a collection)
684
+ - Add `TransactionValidator`, allow passing of a `TransactionValidatorFactory` to a transaction
685
+
686
+ > You can use these validators to set errors using `setItemError` and `setGlobalError`
687
+
688
+ - Fixed a bug where `TransactionItemHandler.cloneItemEntry` could only clone entry with changes on the target
689
+ transaction.
690
+
691
+ > It will not look for changes recursively on the transaction change
692
+
693
+ ## 2.0.19
694
+
695
+ - Ensure all requestColumns for newly created ItemEntries from a template are available
696
+ - Ensure derived values for newly created ItemEntries from a template are available
697
+
698
+ ## 2.0.18
699
+
700
+ - Include read-only columns when detecting changes in TransactionItemHandler.processItemEntryChanges
701
+
702
+ > Read-only columns shouldn't count as changes on the tab, but they should be taking into account when deciding whether or not to call `onChange`
703
+
704
+ ## 2.0.17
705
+
706
+ - Fixed a bug where deleting an item that isn't in the transaction's item entry cache would result in an error
707
+ - Fixed a bug where response columns weren't set for newly created local CollectionEntries
708
+ - Fixed a bug where items weren't matched for newly created local CollectionEntries
709
+
710
+ ## 2.0.16
711
+
712
+ - Fixed a bug where queries with a link to a local parent item weren't updated on save
713
+
714
+ ## 2.0.15
715
+
716
+ - Cache ItemEntries that fit collections on the CollectionEntry's query instead of the CollectionEntry's id
717
+ - Add a 'hint' to ChangesDeltas which allows skipping the extra request to validate `maybe` query matches
718
+ - Create transaction changes for ItemEntry updates in the changesDelta if non exist yet when
719
+ calling `TransactionCache.applyChangesDelta`
720
+
721
+ > This allows you to update values on a transaction without having to fetch a resource for it by calling
722
+ > `ChangesDelta.setItemUpdated()`
723
+
724
+ ## 2.0.14
725
+
726
+ - Fixed reading of derived values in `getItemIdByColumn` when a ChangesDelta is passed
727
+
728
+ ## 2.0.13
729
+
730
+ - Fixed a bug where the incorrect fields where applied to the ChangesDelta in `TransactionItemHandler.cloneItemEntry`
731
+ - A RequestBuffer's promise will now resolve after the ServerCache.processResponse promise is done, ensuring all values
732
+ are present before continuing
733
+ - Request columns for the request ItemType will now properly be taken into account in ServerCache.processResponse
734
+ ensuring root columns are always properly set. (This is used to update derived values)
735
+
736
+ ## 2.0.12
737
+
738
+ - Fixed a bug where created changes weren't copied to the itemchanges
739
+ - Only take readonly parent columns instead of all readonly columns in `ApiFormatter.hasChanges`
740
+ - Fixed a bug where ItemEntry's where still in `ItemCache.entriesByEntryId` after clearing them
741
+
742
+ ## 2.0.11
743
+
744
+ - Fixed a bug where changes weren't copied to the itemchanges
745
+ - Fixed correct isCalledAfterApiSave values on calls to ServerCache.processResponse
746
+
747
+ ## 2.0.10
748
+
749
+ - Construct `ColumnSet` with proper `requestColumns` when creating a `Template` with additional columns
750
+
751
+ ## 2.0.9
752
+
753
+ - Properly process linked items from the template request in `TransactionItemHandler.createItems`
754
+
755
+ ## 2.0.8
756
+
757
+ - Fixed a bug where not all fields where available even tough an ItemResource with specific columns was created
758
+
759
+ ## 2.0.7
760
+
761
+ - Define abstract copyTransactionItemEntryChanges on ItemHandlerBase
762
+ - Implement copyTransactionItemEntryChanges on TransactionItemHandler and ServerItemHandler
763
+ - Fix AbstractCache/ServerCache/TransactionCache `getParent` function arguments
764
+
765
+ > With the newly added arguments the function definitions didn't align anymore causing typescript errors
766
+ > Even though the arguments aren't used in the `ServerCache` they're added in there
767
+
768
+ ## 2.0.6
769
+
770
+ - Remove `ApiFormatter.lazyClone`
771
+
772
+ > You can't lazily clone moment objects because the moment you wanted to clone could be changed in the time the getter isn't invoked, resulting in a different value
773
+
774
+ - Create a copy of the child transaction's field instead of copying the object reference
775
+ in `TransactionCache.applyChangeFromChild` and `ChangesProcessor.executeCreateRequest`
776
+
777
+ > When writing to the object references you're changing multiple transactions at once, while this should be handled by applyCHangesFromParent
778
+
779
+ ## 2.0.5
780
+
781
+ - Add `callOnAddWithInitialItems` option to `CollectionResourceOptions`
782
+
783
+ > If `true` the `onAdd` callback will be called with the initial set of items
784
+
785
+ ## 2.0.4
786
+
787
+ - Add `isCalledAfterSocketUpdate` to `onAdd`, `onRemove` and `onChange` callbacks
788
+
789
+ > You can use this if a data change should only trigger an action when the user caused it himself
790
+
791
+ ## 2.0.3
792
+
793
+ - Fix `CollectionEditResource.removeItems`
794
+ - Move `getCurrentCollectionEntryCache` and `getCurrentItemEntryCache` from `TransactionCache` to `AbstractCache`
795
+
796
+ ## 2.0.2
797
+
798
+ - Fix marking entries as deleted and compiling this into a request
799
+
800
+ ## 2.0.1
801
+
802
+ - Expand CollectionEntry's columns in `ServerCollectionHandler.fetchCollectionData`
803
+
804
+ ## 2.0.0 - Major caching refactor
805
+
806
+ - Completely reworked internal caching structure,
807
+ see [this Confluence page](https://rentman.atlassian.net/wiki/spaces/DEV/pages/704872456/) for the motivations behind
808
+ it.
809
+
810
+ ## 1.9.0
811
+
812
+ - Don't create ItemResources when not returning links in `ItemAdministrator.getNewResourceWithId` and
813
+ in `ItemAdministrator.constructOnItemsExpanded`
814
+
815
+ ## 1.8.0
816
+
817
+ - Remove `ResourceCache` and `resourceLevel`
818
+
819
+ > You should now manually call `resource.clearResource` when you no longer need a resource
820
+
821
+ - Add `onConstruct` function to `ItemResource` and `CollectionResource`
822
+
823
+ > This is overwritten by the frontend to track resource creation
824
+
825
+ ## 1.7.6
826
+
827
+ - Add priority parameter to local cache callbacks. The callback condition (`always` / `onClose` / `skipOnClose`) no
828
+ longer has any effect on the order in which the callbacks get executed.
829
+ - **Breaking:** Remove `LocalCacheCallbackCondition` enum.
830
+ - Add `itemId` parameter to `ItemHandler.fetchNewItem`. An error is thrown when an ID already exists.
831
+ Add `getNewResourceWithId` to ItemAdministrator. Deprecate `getItemByState`.
832
+
833
+ ## 1.7.5
834
+
835
+ - For template column sets it is no longer assumed all columns are present. This fixes an issue with incomplete column
836
+ sets in the front-end.
837
+ - Fix issue where `changesProcessor` instance was undefined in `itemResourceFactory` and `collectionResourceFactory`.
838
+ Create variables for each core service in order to get a TypeScript error when a dependency hasn't been initialized
839
+ yet.
840
+
841
+ ## 1.7.4
842
+
843
+ - Add support for strict ItemType type checking in `FieldMap`
844
+
845
+ ## 1.7.3
846
+
847
+ - Add support for strict ItemType type checking
848
+
849
+ > This is temporarily defaulted to `any` to prevent compile errors in the frontend
850
+
851
+ ## 1.7.2
852
+
853
+ - Fix some typing issues in:
854
+ - ApiResponseProcessor
855
+ - ItemCache
856
+ - KeyService
857
+
858
+ ## 1.7.1
859
+
860
+ - Fix issue where `CreateRequestFactory` would be undefined in `ChangesProcessor`.
861
+
862
+ ## 1.7.0
863
+
864
+ - **Breaking:** remove `ChangesProcessorFactory`. Add `ChangesProcessor` instance to core directly.
865
+
866
+ ### Resource caching
867
+
868
+ - **Breaking:** the following properties are removed:
869
+ - On `ItemEntry`: `clearResources`, `deactivateResources`.
870
+ - On `CollectionEntry`: `clearResources`, `getCurrentResource`.
871
+ - On `CollectionResourceOptions`: `clearOnTabChange`, `clearOnSubTabChange`.
872
+ - An additional `level` parameter has been added to all methods that return resources.
873
+ - When creating resources using `ItemResourceFactory` or `CollectionResourceFactory`, this parameter is mandatory.
874
+ A `defaultResourceLevel` parameter has been added to the `LocalCache` constructor.
875
+ - A `clearResources` method has been added to `ItemAdministrator`. When calling this method, all item / collection and
876
+ collection resources with a level of `level` or higher will be removed.
877
+ - The `clearResources` method has been removed from `LocalCache`.
878
+ - The `setCurrentLocalCache` function has been removed from `LocalCacheManagerInterface`.
879
+
880
+ ## 1.6.13
881
+
882
+ - When encountering a collection entry with `PROMISED_EXPAND` status, call `getCachedEntryStatus` after the initial
883
+ promise has been resolved.
884
+
885
+ > This is the likely cause of the issue where `_resolve` is called on a non-deferred collection entry.
886
+
887
+ ## 1.6.12
888
+
889
+ - Fix error that occurs when trying to resolve a non-deferred collection entry.
890
+
891
+ ## 1.6.11
892
+
893
+ - Fix issue where `QueryMatcher.matchComplexQuery` would return the wrong value.
894
+
895
+ ## 1.6.10
896
+
897
+ - **Breaking**: Remove `linkType`, `linkIdArray` properties from `LinkCollectionDefinition`. Add `linkType`,
898
+ `linkIdArray` parameters to `ItemAdministrator.getLinkCollectionsFromDef`.
899
+
900
+ ## 1.6.9
901
+
902
+ - Redeploy of `1.6.8`
903
+
904
+ ## 1.6.8
905
+
906
+ - Add support for `not` in queries
907
+
908
+ ## 1.6.7
909
+
910
+ - Fix issue where `CollectionMatcher.addToCollections` wouldn't return the correct type.
911
+
912
+ ## 1.6.6
913
+
914
+ - Add `callOnAdd` parameter in `CollectionHandler.batchExtend`. Set `updateInitial` to true. Remove `updateInitial`
915
+ parameter in `CollectionEntry.extend`, as it should always be true.
916
+
917
+ > The `extend` function only concerns itself with remote items, so no local changes should be generated.
918
+
919
+ ## 1.6.5
920
+
921
+ - Fix issue where a derived column could be marked as the `link` (parent) column in the column set.
922
+
923
+ > This could lead to instances where a different column would be set to the value of the parent.
924
+
925
+ ## 1.6.4
926
+
927
+ - Fix issue where the `onChange` collection callback would not be called when updating it in the options.
928
+ - Add `callOnAdd` parameter to collection matcher. When set to `false`, `onAdd` is not called for
929
+ the `resultCollectionResource`.
930
+
931
+ ## 1.6.3
932
+
933
+ - Properly type ApiResponseProcessor - fetchObjectArray
934
+
935
+ ## 1.6.2
936
+
937
+ - Fix issue where the collection handler would return collection entries before they were resolved when
938
+ calling `batchFetch`.
939
+
940
+ ## 1.6.1-3
941
+
942
+ - Check for linkedTo before checking for subqueries in QueryMatcher
943
+
944
+ > Linkedto also has `.query` and was incorrectly marked as a subquery
945
+
946
+ ## 1.6.1-2
947
+
948
+ - Fixed shorthand query with null values
949
+
950
+ > The QueryParser would incorrectly identify subqueries when using null in a shorthand
951
+
952
+ ## 1.6.1-1
953
+
954
+ - Fixed shorthand query with Moment values
955
+
956
+ > The QueryParser would incorrectly identify Moment objects as a subquery
957
+
958
+ ## 1.6.1
959
+
960
+ - Added support for subqueries in QueryParser and QueryMatcher
961
+
962
+ > Collections using subqueries will always return 'maybe' in the QueryMatcher
963
+
964
+ ## 1.6.0
965
+
966
+ - All external callbacks are now wrapped in a `try ... catch` block. This prevents them from breaking core
967
+ functionality.
968
+ - **Breaking**: Add `ExceptionHandlerInterface` parameter to core constructor.
969
+
970
+ ## 1.5.9
971
+
972
+ - Fix issue that occurs when trying to resolve a `ColumnSet` using a single non-existing column. Catch exceptions that
973
+ might occur when resolving an `ItemEntry`.
974
+ - Add `mergeRequestColumns`, `mergeResponseColumns` to `ColumnSet`. When encountering new items while expanding a
975
+ collection, add them to the collection.
976
+
977
+ ## 1.5.8
978
+
979
+ - Introduce `RemoteViewResource` and `LocalViewResource`.
980
+
981
+ > The `fields` property of a `RemoteViewResource` represents server values, while the `fields` property of a `LocalViewResource` represents local values.
982
+
983
+ - The `fields` property of a `ViewResource` is now read only.
984
+
985
+ ## 1.5.7-1
986
+
987
+ - Make ItemResource/CollectionResource base class abstract
988
+ - Add missing overload functions in some places
989
+ - Fix default comparator `QueryMatcher.parseSimpleQuery`
990
+ - Fix `ExtendedCollectionMatchResult` `collection` property type
991
+
992
+ ## 1.5.7
993
+
994
+ - Properly type Collections & ItemResources (and return values) in the whole core.
995
+
996
+ > The core will now properly return Collections & ItemResources based on the passed CollectionOptions.
997
+ > You can now also type the expected collection type
998
+
999
+ ```
1000
+ // Expects a collection with editCollection and editItems both `true`
1001
+ // Will properly return EditResources for all collection functions
1002
+ const collection: CollectionEditResource<EditResource>;
1003
+
1004
+ // other variations are:
1005
+ // CollectionViewResource<ViewResource>
1006
+ // CollectionViewResource<EditResource>
1007
+ // CollectionEditResource<ViewResource>
1008
+
1009
+ this.core.itemAdministrator.getCollection(
1010
+ 'Notitie',
1011
+ {
1012
+ editCollection: true, // Will return a CollectionEditResource
1013
+ editItems: true // Will return EditResources instead of ViewResources in `.items`
1014
+ }
1015
+ )
1016
+ ```
1017
+
1018
+ ## 1.5.6
1019
+
1020
+ - Add `getAllLocalCaches` to `LocalCacheManagerInterface`, remove item entries from all local caches on socket delete.
1021
+
1022
+ ## 1.5.5
1023
+
1024
+ - Add 'order' column type handling to ApiFormatter functions
1025
+
1026
+ ## 1.5.4
1027
+
1028
+ - Fix issue where parent would be incorrectly set when cloning a single item.
1029
+ - Type functions related to expansion maps in `ItemEntryService`.
1030
+
1031
+ ## 1.5.3
1032
+
1033
+ - Fix issue where the `enableSave` collection resource option would default to `false`. This would throw an error when
1034
+ calling `save` on a collection resource where this option was not explicitly set.
1035
+
1036
+ ## 1.5.2
1037
+
1038
+ - Type functions in `ColumnUtil` class.
1039
+ - Add `getRequestColumnId` and `containsDerivedColumns` to `ColumnUtil`.
1040
+
1041
+ > `getRequestColumnId` should be used instead of `Util.getFirstProperty` when retrieving a column ID.
1042
+
1043
+ - **Breaking:** Remove `ColumnUtil.isColumnSubset`. Use `ColumnSet.isSuperSetOf` instead.
1044
+ - Remove `findColumnObject`. Rename `findColumn` to `findRequestColumn`.
1045
+
1046
+ ## 1.5.1
1047
+
1048
+ - Properly remove item entry stub from (local) cache when request fails.
1049
+ - Fix issue where item or collection options could be set to undefined.
1050
+
1051
+ ## 1.5.0
1052
+
1053
+ - Add `SocketMessage` type and add types to `SocketMessageHandler`
1054
+ - Expand local items requested using `getItemById` or `getItemsById` in `ItemAdministrator`.
1055
+ (`fetchItem` or `fetchItems` in `ItemHandler`.)
1056
+ - Implement expanding of local collections. This no longer leads to invalid requests.
1057
+ - **Breaking:** The `expand` function in `CollectionEntry` now has an `ItemCache` parameter.
1058
+ - **Warning:** This version contains major changes.
1059
+
1060
+ ### Introduce typing of item and collection options
1061
+
1062
+ - **Breaking:** Removed `QueryItemType` collection entry option.
1063
+ - **Breaking:** Removed `ItemResourceService`.
1064
+ - Removed `processOptions` parameter from `createCollectionResource` (`ItemAdministrator`). It is now equivalent to
1065
+ `addCollection`.
1066
+ - When creating an item resource using `ItemResourceFactory`, a collection entry using `CollectionResourceFactory` or a
1067
+ collection resource using `CollectionResourceFactory` it is no longer necessary to process options beforehand. It is
1068
+ still necessary when interacting with `CollectionHandler` or `ItemHandler` directly.
1069
+
1070
+ ## v1.4.0
1071
+
1072
+ - Add `expandProcessLinkedItems` and `expandAddToCollections` to `ItemAdministrator`. These are analogues to
1073
+ `processLinkedItems` and `addToCollections`, but also expand the items with (derived) values and columns as necessary.
1074
+ They have a slightly different type signature.
1075
+ - Whenever a collection is requested, the `CollectionHandler` now makes sure that added local items are expanded as
1076
+ necessary.
1077
+ - **Breaking:** Last parameter of `ItemHandler.createLocalEntries` is now a callback function.
1078
+ - **Breaking:** Rename `TemplateLinkedItemEntryMap` type to `TemplateItemEntryMap`.
1079
+
1080
+ ## v1.3.8
1081
+
1082
+ - Add `isSaving` to `LocalCache`
1083
+
1084
+ > We use this to disable the cancel/save buttons while the localCache is saving in the frontend
1085
+
1086
+ ## v1.3.7
1087
+
1088
+ - Fix issues that generate invalid requests / changes when moving existing item to another collection, then deleting the
1089
+ parent.
1090
+ - Remove slip workarounds
1091
+ - Add api request types
1092
+ - Add types to `ModuleChangesCompilation`
1093
+
1094
+ ## v1.3.6
1095
+
1096
+ - Skip add / remove collection callbacks when calling `revertChanges` (`LocalCache`).
1097
+
1098
+ ## v1.3.5
1099
+
1100
+ - Fix issue where items added to collections when resolving wouldn't be removed in `revertChanges` (`LocalCache`).
1101
+
1102
+ ## v1.3.4
1103
+
1104
+ - Add country to isFilteredColumn in ColumnUtil
1105
+
1106
+ ## v1.3.3
1107
+
1108
+ - Move processLocalConfigColumns and consolidateColumns from ColumnUtil to frontend
1109
+
1110
+ > These functions are specifically used for rendering ui-grid in the frontend, so there's no reason to have them in the core
1111
+
1112
+ ## v1.3.2
1113
+
1114
+ - Fix types path in package.json
1115
+
1116
+ ## v1.3.1
1117
+
1118
+ - Fix types path in package.json
1119
+
1120
+ ## v1.3.0
1121
+
1122
+ - Rename PromiseInterface to PromiseLibraryInterface
1123
+
1124
+ > PromiseInterface is now used for the internal promise type
1125
+
1126
+ - Use PromiseInterface instead of Promise as internal promise type
1127
+
1128
+ > This allows us to overwrite the PromiseInterface definition in the frontend indicate usage of ng.IPromise
1129
+
1130
+ ## v1.2.9
1131
+
1132
+ - Call processOptions in fetchDerivedValuesByColumn
1133
+
1134
+ > Bug was introduced earlier but got enabled in v1.2.7
1135
+
1136
+ ## v1.2.8
1137
+
1138
+ - Add toJSON methods for ItemResources, ItemEntries, and ColumnSets to fix circular dependencies in JSON.stringify
1139
+
1140
+ ## v1.2.7
1141
+
1142
+ - Set itemEntry parent when generating a stub
1143
+
1144
+ ## v1.2.6
1145
+
1146
+ - Fix an issue introduced in v1.2.5.
1147
+
1148
+ ## v1.2.5
1149
+
1150
+ - When a local item cannot by found, return a newly created item in `getItemByState` (`ItemAdministrator`) only. This
1151
+ solves an issue with refreshing on a local edit view.
1152
+
1153
+ ## v1.2.4
1154
+
1155
+ - **Breaking:** When a local item cannot by found, instead of a new item being created an error is thrown. This means it
1156
+ is no longer possible to create local items using `getItemById` or `getItemsById` in the `ItemAdministrator` class.
1157
+ - **Breaking:** Removed `getItemDefinition` and `getItemByDef` in the `ItemAdministrator` class. Added `getItemByState`.
1158
+ - Renamed types `TemplateResponseItemEntryMap` to `TemplateItemEntryMap` and `TemplateResponseLinkedItemEntryMap` to
1159
+ `TemplateLinkedItemEntryMap`.
1160
+ - Removed `getCollectionCacheKey` in `KeyService`. (Legacy code.)
1161
+
1162
+ ## v1.2.3
1163
+
1164
+ - Fixed issue where derived values deeper than one layer couldn't be resolved.
1165
+
1166
+ ## v1.2.2
1167
+
1168
+ - Fixed issue where in derived values weren't set after create request.
1169
+
1170
+ ## v1.2.1
1171
+
1172
+ - **Breaking:** Replaced the `initial` parameter with the `callOnChange` parameter (`true` by default) in the `commit`
1173
+ function of the `EditResource` class.
1174
+ - Fixed issue in `setLocalFields` (`ItemEntry`) where some values were wrongly assumed to be present in `initialValues`.
1175
+ - Optimization: Disabled automatic resolution of derived values in `addItems` (`CollectionEditResource`)
1176
+ when `modInstant` is set to true.
1177
+
1178
+ ## v1.2.0
1179
+
1180
+ - **Breaking:** When calling `addItems` or `addItem` on the `CollectionEditResource` class derived values are now
1181
+ resolved automatically. Instead of a compound object like `{fields: {key: 'value'}, derived: {}}` an object like
1182
+ `{key: 'value'}` should now be used as argument when calling these functions.
1183
+ - **Breaking:** Added `localCache` parameter to `CollectionResource` constructor.
1184
+
1185
+ ## v1.1.20
1186
+
1187
+ - Fixed minor issue where collection wouldn't be deferred properly before expanding.
1188
+ - `onChange` is now called automatically when when calling `commit` on an edit resource.
1189
+
1190
+ ## v1.1.19
1191
+
1192
+ - **Breaking:** Renamed `getCurrentChanges` to `getModuleChanges` in the `ItemAdministrator` class. Added optional
1193
+ `localCache` parameter.
1194
+
1195
+ ### Local cache callback refactoring
1196
+
1197
+ - Removed `onSaveWithoutClosing` event.
1198
+ - Added `condition` parameter to `onBeforeSave` and `onSaveSuccess` (possible values are `always`, `onClose` or
1199
+ `skipOnClose`, defaults to `always`). Callbacks registered with `condition: always` will get executed before other
1200
+ callbacks.
1201
+ - Pass the local cache itself to all registered callback functions. Pass the item ID conversion map as second argument
1202
+ to `onSaveSuccess` callback functions.
1203
+
1204
+ ## v1.1.18
1205
+
1206
+ - Calling `expand` on a `CollectionEntry` manually no longer defers the collection entry.
1207
+ - The `batchFetch` and `batchExpand` functions in the `CollectionHandler` class now properly defer and resolve the
1208
+ collection entries.
1209
+
1210
+ ## v1.1.17
1211
+
1212
+ - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
1213
+ - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
1214
+ of `getByParent`.
1215
+
1216
+ ### Cache invalidation
1217
+
1218
+ - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
1219
+ collection entry containing the item is requested.
1220
+ - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
1221
+ - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
1222
+ and collection entries.
1223
+
1224
+ ### Item entry refactoring
1225
+
1226
+ - Renamed `process` to `setFields`.
1227
+ - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
1228
+ - `setModified` now also sets local default values.
1229
+ - Removed `setCreator`. This function was called twice in some instances.
1230
+ - **Breaking:** Added `derived` parameter to `updateFields`
1231
+
1232
+ ## v1.16
1233
+
1234
+ - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
1235
+ project financial values in the front-end. [RM4-9577]
1236
+ - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
1237
+ from being added to the local cache.
1238
+
1239
+ ## v1.15
1240
+
1241
+ - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
1242
+ - Fix type definition of `PromiseInterface.all`.
1243
+
1244
+ ## v1.14
1245
+
1246
+ - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
1247
+ issue with recurring appointments in the front-end.
1248
+
1249
+ ## v1.13
1250
+
1251
+ - Add option to exclude itemTypes during createLocalEntries.
1252
+
1253
+ ## v1.12
1254
+
1255
+ - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
1256
+ `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
1257
+ from the local cache inadvertently.
1258
+ - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate
1259
+ chaining.
1260
+ - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
1261
+ are now respected. This fixes an issue where items where *not* removed from the local cache.
1262
+ - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
1263
+ issue where changes were being detected continuously.
1264
+ - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
1265
+ except when updating documents. This fixes several issues.
1266
+ - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
1267
+ collection was added multiple times.
1268
+ - Updated all models to use dependency objects. This increases ease of debugging.
1269
+
1270
+ ## v.1.11
1271
+
1272
+ - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
1273
+ - **Breaking:** Removed `ItemResourceService.isNewResource`.
1274
+ - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
1275
+ - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
1276
+ completed transactions.
1277
+
1278
+ ## v.1.10
1279
+
1280
+ - Fixed issue where changes on different subtabs were not detected.
1281
+
1282
+ ## v1.1.9
1283
+
1284
+ - Exposed `noop` function on `RmCore` class.
1285
+
1286
+ > This is used in order to check whether a callback has a default value.
1287
+
1288
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
1289
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
1290
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
1291
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
1292
+ `breakUpByParent` - `onAfterCreateCallback`.
1293
+
1294
+ ## v1.1.8
1295
+
1296
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
1297
+
1298
+ ## v1.1.7
1299
+
1300
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
1301
+
1302
+ ## v1.1.6
1303
+
1304
+ - Fixed issue with deferred item entries.
1305
+ - Re-enable changes watcher after save.
1306
+ - Added optional `id` parameter to `LocalCache` constructor.
1307
+
1308
+ ## v1.1.5
1309
+
1310
+ - Added `clearItem` function to `LocalCache` class.
1311
+
1312
+ ## v.1.1.4
1313
+
1314
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
1315
+
1316
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add the items to the local cache.
1317
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
1318
+ doing it however can definitely be harmful.
1319
+
1320
+ ## v.1.1.3
1321
+
1322
+ - Fixed an issue where all collections in a local cache would be cleared.
1323
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
1324
+ `LocalCacheManagerInterface`.
1325
+
1326
+ ## v1.1.2
1327
+
1328
+ - Fixed an issue concerning derived values.
1329
+
1330
+ ## v1.1.1
1331
+
1332
+ - Fixed an issue where changes wouldn't be detected.
1333
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
1334
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
1335
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
1336
+ `disableChangesWatcher` instead.
1337
+
1338
+ ## v1.1.0
1339
+
1340
+ ### Development
1341
+
1342
+ #### Strict TypeScript compilation
1343
+
1344
+ Added the following TypeScript compiler options:
1345
+
1346
+ - noImplicitThis
1347
+ - noImplicitReturns
1348
+ - strictNullChecks
1349
+ - noUnusedLocals
1350
+ - noUnusedParameters
1351
+
1352
+ I would advise enabling these for all TypeScript projects from now on.
1353
+
1354
+ #### Ordered imports and dependencies
1355
+
1356
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this. Please note that
1357
+ this also applies for imports from the folder the file is currently in. For example, in `models/ItemResource.ts`
1358
+ , `itemEntry` should be imported like so:
1359
+ `import { ItemEntry } from '../models';`
1360
+
1361
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
1362
+ remove dependencies in the future.
1363
+
1364
+ ### Breaking changes
1365
+
1366
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
1367
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
1368
+ `moduleChangesCompilationFactory`.
1369
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is no
1370
+ longer supported in the back-end.
1371
+
1372
+ #### Item and collection entries
1373
+
1374
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
1375
+ - Added the following functions to `ItemEntryService`:
1376
+ - `createLocalConversionMap`;
1377
+ - `expandLocalConversionMap`;
1378
+ - `expandConversionMap`;
1379
+ - `batchExpandConversionMap`;
1380
+ - `batchClone`.
1381
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new item ID, and
1382
+ update the conversion map accordingly, but will respect the item ID that is already there.
1383
+
1384
+ #### Rework item caching
1385
+
1386
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default. All
1387
+ entries are added to the global cache on save. Item entries are added to the local cache when resources are created
1388
+ using the item administrator or when resources are created when adding the items to a collection.
1389
+
1390
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
1391
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
1392
+ > pasting of items.
1393
+
1394
+ Other changes:
1395
+
1396
+ - Moved `saveLocal` to `ItemAdministrator`;
1397
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
1398
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
1399
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
1400
+ already on the backend. (Use `getCollectionMatcher`.)
1401
+
1402
+ ## v1.0.33
1403
+
1404
+ - Really fix types path
1405
+
1406
+ ## v1.0.33
1407
+
1408
+ - Fix types path
1409
+
1410
+ ## v1.0.32
1411
+
1412
+ - Update `tsconfig.json` to put definitions in the root folder
1413
+
1414
+ > The app had an issue with AOT compilation because of this
1415
+
1416
+ ## v1.0.31
1417
+
1418
+ - Fix `columnHandler.fetchItemTypeTranslations`
1419
+
1420
+ > It incorrectly looped over the response map, it should now work again
1421
+
1422
+ ## v1.0.30
1423
+
1424
+ - Remove `updateTabParams` from LocalCacheManagerInterface
1425
+
1426
+ > The function wasn't used
1427
+
1428
+ - Reworked class export
1429
+
1430
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
1431
+
1432
+ ## v1.0.29
1433
+
1434
+ - Fix inverted inArray check in CollectionEntry.removeItems
1435
+
1436
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
1437
+
1438
+ ## v1.0.28
1439
+
1440
+ Bug fixes only
1441
+
1442
+ ## v1.0.27
1443
+
1444
+ - `ItemEntry.initial` is now undefined by default
1445
+
1446
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
1447
+
1448
+ ## v1.0.26
1449
+
1450
+ Bundle both minified and unminified code, include sourcemaps from dev build
1451
+
1452
+ ## v1.0.24, v1.0.25
1453
+
1454
+ ! Use version `v1.0.26` !
1455
+
1456
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
1457
+
1458
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
1459
+
1460
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
1461
+
1462
+ > It used to be called `id`, but it was changed in the seperation of the core.
1463
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
1464
+
1465
+ - Rename ItemResource `startTransaction` to `start`
1466
+
1467
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
1468
+
1469
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
1470
+
1471
+ > You can now use the updated items or hook into the result to update the ui for example
1472
+
1473
+ ## v1.0.23
1474
+
1475
+ - Rename ResourceCache to LocalCache
1476
+
1477
+ > LocalCache only caches local items (name better reflects functionality)
1478
+
1479
+ - Remove getter/setter for hasChanges
1480
+
1481
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
1482
+
1483
+ - Remove `_getCollection` from ItemAdministrator
1484
+
1485
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
1486
+ > options and should not be given as a separate argument. This was included to support the frontend
1487
+
1488
+ - Remove `saveCurrentTab` from ItemAdministrator
1489
+
1490
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
1491
+
1492
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
1493
+
1494
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
1495
+