@rentman/rm-core 12.1.2 → 12.1.3

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