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