@rentman/rm-core 6.0.1 → 6.1.1

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