@rentman/rm-core 8.2.11 → 9.0.0

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