@rentman/rm-core 8.1.8-dev1 → 8.1.8

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