@rentman/rm-core 9.2.2 → 9.2.4

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