@rentman/rm-core 2.0.10 → 2.0.11

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