@rentman/rm-core 8.2.0 → 8.2.2

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