@rentman/rm-core 1.1.16 → 1.1.17

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.
package/changelog.md CHANGED
@@ -1,218 +1,237 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ##v1.16
5
- - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
6
- project financial values in the front-end. [RM4-9577]
7
- - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
8
- from being added to the local cache.
9
-
10
- ##v1.15
11
- - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
12
- - Fix type definition of `PromiseInterface.all`.
13
-
14
- ##v1.14
15
- - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
16
- issue with recurring appointments in the front-end.
17
-
18
- ##v1.13
19
- - Add option to exclude itemTypes during createLocalEntries.
20
-
21
- ##v1.12
22
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
23
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
24
- from the local cache inadvertently.
25
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
26
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
27
- are now respected. This fixes an issue where items where *not* removed from the local cache.
28
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
29
- issue where changes were being detected continuously.
30
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
31
- except when updating documents. This fixes several issues.
32
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
33
- collection was added multiple times.
34
- - Updated all models to use dependency objects. This increases ease of debugging.
35
-
36
- ##v.1.11
37
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
38
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
39
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
40
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
41
- completed transactions.
42
-
43
- ##v.1.10
44
- - Fixed issue where changes on different subtabs were not detected.
45
-
46
- ##v1.1.9
47
- - Exposed `noop` function on `RmCore` class.
48
- > This is used in order to check whether a callback has a default value.
49
- - Added `copyRequestColumns` function to `ColumnUtil` class.
50
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
51
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
52
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
53
- `breakUpByParent` - `onAfterCreateCallback`.
54
-
55
- ##v1.1.8
56
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
57
-
58
- ##v1.1.7
59
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
60
-
61
- ##v1.1.6
62
- - Fixed issue with deferred item entries.
63
- - Re-enable changes watcher after save.
64
- - Added optional `id` parameter to `LocalCache` constructor.
65
-
66
- ##v1.1.5
67
- - Added `clearItem` function to `LocalCache` class.
68
-
69
- ##v.1.1.4
70
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
71
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
72
- the items to the local cache.
73
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
74
- doing it however can definitely be harmful.
75
-
76
- ##v.1.1.3
77
- - Fixed an issue where all collections in a local cache would be cleared.
78
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
79
- `LocalCacheManagerInterface`.
80
-
81
- ##v1.1.2
82
- - Fixed an issue concerning derived values.
83
-
84
- ## v1.1.1
85
- - Fixed an issue where changes wouldn't be detected.
86
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
87
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
88
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
89
- `disableChangesWatcher` instead.
90
-
91
- ## v1.1.0
92
- ### Development
93
-
94
- #### Strict TypeScript compilation
95
- Added the following TypeScript compiler options:
96
- - noImplicitThis
97
- - noImplicitReturns
98
- - strictNullChecks
99
- - noUnusedLocals
100
- - noUnusedParameters
101
-
102
- I would advise enabling these for all TypeScript projects from now on.
103
-
104
- #### Ordered imports and dependencies
105
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
106
- Please note that this also applies for imports from the folder the file is currently in.
107
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
108
- `import { ItemEntry } from '../models';`
109
-
110
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
111
- remove dependencies in the future.
112
-
113
- ### Breaking changes
114
-
115
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
116
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
117
- `moduleChangesCompilationFactory`.
118
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
119
- no longer supported in the back-end.
120
-
121
- #### Item and collection entries
122
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
123
- - Added the following functions to `ItemEntryService`:
124
- - `createLocalConversionMap`;
125
- - `expandLocalConversionMap`;
126
- - `expandConversionMap`;
127
- - `batchExpandConversionMap`;
128
- - `batchClone`.
129
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
130
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
131
-
132
- #### Rework item caching
133
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
134
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
135
- using the item administrator or when resources are created when adding the items to a collection.
136
-
137
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
138
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
139
- > pasting of items.
140
-
141
- Other changes:
142
-
143
- - Moved `saveLocal` to `ItemAdministrator`;
144
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
145
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
146
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
147
- already on the backend. (Use `getCollectionMatcher`.)
148
-
149
-
150
- ##v1.0.33
151
- - Really fix types path
152
-
153
- ##v1.0.33
154
- - Fix types path
155
-
156
- ##v1.0.32
157
- - Update `tsconfig.json` to put definitions in the root folder
158
- > The app had an issue with AOT compilation because of this
159
-
160
- ##v1.0.31
161
- - Fix `columnHandler.fetchItemTypeTranslations`
162
- > It incorrectly looped over the response map, it should now work again
163
-
164
- ##v1.0.30
165
- - Remove `updateTabParams` from LocalCacheManagerInterface
166
- > The function wasn't used
167
-
168
- - Reworked class export
169
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
170
-
171
- ##v1.0.29
172
- - Fix inverted inArray check in CollectionEntry.removeItems
173
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
174
-
175
- ##v1.0.28
176
- Bug fixes only
177
-
178
- ##v1.0.27
179
- - `ItemEntry.initial` is now undefined by default
180
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
181
-
182
- ##v1.0.26
183
- Bundle both minified and unminified code, include sourcemaps from dev build
184
-
185
- ##v1.0.24, v1.0.25
186
- ! Use version `v1.0.26` !
187
-
188
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
189
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
190
-
191
- - Rename `ItemEntry.entryId` to `ItemEntry.id
192
- > It used to be called `id`, but it was changed in the seperation of the core.
193
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
194
-
195
- - Rename ItemResource `startTransaction` to `start`
196
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
197
-
198
- - `SocketMessageHandler.onMessageReceived` now returns a promise
199
- > You can now use the updated items or hook into the result to update the ui for example
200
-
201
-
202
- ##v1.0.23
203
- - Rename ResourceCache to LocalCache
204
- > LocalCache only caches local items (name better reflects functionality)
205
-
206
- - Remove getter/setter for hasChanges
207
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
208
-
209
- - Remove `_getCollection` from ItemAdministrator
210
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
211
- > options and should not be given as a separate argument. This was included to support the frontend
212
-
213
- - Remove `saveCurrentTab` from ItemAdministrator
214
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
215
-
216
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
217
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
218
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ## v1.1.17
5
+ - Fixed issue where the `getLocalByQuery` function in the `ItemCache` class wouldn't return any items.
6
+ - When batch resolving collection entries, `CollectionHandler` now looks for matching items using `getByQuery` instead
7
+ of `getByParent`.
8
+
9
+ ### Cache invalidation
10
+ - Added `queueReload` function to `ItemEntry` class. This will reload the item when the item entry itself or a
11
+ collection entry containing the item is requested.
12
+ - The `queueReload` function in the `CollectionEntry` class no longer directly defers the item.
13
+ - Added `invalidateCache` function to the `ItemAdministrator` class. This will call `queueReload` on all item entries
14
+ and collection entries.
15
+
16
+ ### Item entry refactoring
17
+ - Renamed `process` to `setFields`.
18
+ - Replaced `processLocal` with `setLocalFields`. This function no longer has a `modified` parameter.
19
+ - `setModified` now also sets local default values.
20
+ - Removed `setCreator`. This function was called twice in some instances.
21
+ - **Breaking:** Added `derived` parameter to `updateFields`
22
+
23
+ ##v1.16
24
+ - Pass `hasChanges` as second argument to `onBeforeSave` callbacks in the `LocalCache` class. This fixes an issue with
25
+ project financial values in the front-end. [RM4-9577]
26
+ - Added `callOnActivate` parameter to `addItems` function in `CollectionEditResource` class. Use this to prevent items
27
+ from being added to the local cache.
28
+
29
+ ##v1.15
30
+ - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
31
+ - Fix type definition of `PromiseInterface.all`.
32
+
33
+ ##v1.14
34
+ - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
35
+ issue with recurring appointments in the front-end.
36
+
37
+ ##v1.13
38
+ - Add option to exclude itemTypes during createLocalEntries.
39
+
40
+ ##v1.12
41
+ - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
42
+ `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
43
+ from the local cache inadvertently.
44
+ - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
45
+ - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
46
+ are now respected. This fixes an issue where items where *not* removed from the local cache.
47
+ - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
48
+ issue where changes were being detected continuously.
49
+ - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
50
+ except when updating documents. This fixes several issues.
51
+ - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
52
+ collection was added multiple times.
53
+ - Updated all models to use dependency objects. This increases ease of debugging.
54
+
55
+ ##v.1.11
56
+ - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
57
+ - **Breaking:** Removed `ItemResourceService.isNewResource`.
58
+ - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
59
+ - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
60
+ completed transactions.
61
+
62
+ ##v.1.10
63
+ - Fixed issue where changes on different subtabs were not detected.
64
+
65
+ ##v1.1.9
66
+ - Exposed `noop` function on `RmCore` class.
67
+ > This is used in order to check whether a callback has a default value.
68
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
69
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
70
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
71
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
72
+ `breakUpByParent` - `onAfterCreateCallback`.
73
+
74
+ ##v1.1.8
75
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
76
+
77
+ ##v1.1.7
78
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
79
+
80
+ ##v1.1.6
81
+ - Fixed issue with deferred item entries.
82
+ - Re-enable changes watcher after save.
83
+ - Added optional `id` parameter to `LocalCache` constructor.
84
+
85
+ ##v1.1.5
86
+ - Added `clearItem` function to `LocalCache` class.
87
+
88
+ ##v.1.1.4
89
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
90
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
91
+ the items to the local cache.
92
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
93
+ doing it however can definitely be harmful.
94
+
95
+ ##v.1.1.3
96
+ - Fixed an issue where all collections in a local cache would be cleared.
97
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
98
+ `LocalCacheManagerInterface`.
99
+
100
+ ##v1.1.2
101
+ - Fixed an issue concerning derived values.
102
+
103
+ ## v1.1.1
104
+ - Fixed an issue where changes wouldn't be detected.
105
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
106
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
107
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
108
+ `disableChangesWatcher` instead.
109
+
110
+ ## v1.1.0
111
+ ### Development
112
+
113
+ #### Strict TypeScript compilation
114
+ Added the following TypeScript compiler options:
115
+ - noImplicitThis
116
+ - noImplicitReturns
117
+ - strictNullChecks
118
+ - noUnusedLocals
119
+ - noUnusedParameters
120
+
121
+ I would advise enabling these for all TypeScript projects from now on.
122
+
123
+ #### Ordered imports and dependencies
124
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
125
+ Please note that this also applies for imports from the folder the file is currently in.
126
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
127
+ `import { ItemEntry } from '../models';`
128
+
129
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
130
+ remove dependencies in the future.
131
+
132
+ ### Breaking changes
133
+
134
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
135
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
136
+ `moduleChangesCompilationFactory`.
137
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
138
+ no longer supported in the back-end.
139
+
140
+ #### Item and collection entries
141
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
142
+ - Added the following functions to `ItemEntryService`:
143
+ - `createLocalConversionMap`;
144
+ - `expandLocalConversionMap`;
145
+ - `expandConversionMap`;
146
+ - `batchExpandConversionMap`;
147
+ - `batchClone`.
148
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
149
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
150
+
151
+ #### Rework item caching
152
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
153
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
154
+ using the item administrator or when resources are created when adding the items to a collection.
155
+
156
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
157
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
158
+ > pasting of items.
159
+
160
+ Other changes:
161
+
162
+ - Moved `saveLocal` to `ItemAdministrator`;
163
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
164
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
165
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
166
+ already on the backend. (Use `getCollectionMatcher`.)
167
+
168
+
169
+ ##v1.0.33
170
+ - Really fix types path
171
+
172
+ ##v1.0.33
173
+ - Fix types path
174
+
175
+ ##v1.0.32
176
+ - Update `tsconfig.json` to put definitions in the root folder
177
+ > The app had an issue with AOT compilation because of this
178
+
179
+ ##v1.0.31
180
+ - Fix `columnHandler.fetchItemTypeTranslations`
181
+ > It incorrectly looped over the response map, it should now work again
182
+
183
+ ##v1.0.30
184
+ - Remove `updateTabParams` from LocalCacheManagerInterface
185
+ > The function wasn't used
186
+
187
+ - Reworked class export
188
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
189
+
190
+ ##v1.0.29
191
+ - Fix inverted inArray check in CollectionEntry.removeItems
192
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
193
+
194
+ ##v1.0.28
195
+ Bug fixes only
196
+
197
+ ##v1.0.27
198
+ - `ItemEntry.initial` is now undefined by default
199
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
200
+
201
+ ##v1.0.26
202
+ Bundle both minified and unminified code, include sourcemaps from dev build
203
+
204
+ ##v1.0.24, v1.0.25
205
+ ! Use version `v1.0.26` !
206
+
207
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
208
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
209
+
210
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
211
+ > It used to be called `id`, but it was changed in the seperation of the core.
212
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
213
+
214
+ - Rename ItemResource `startTransaction` to `start`
215
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
216
+
217
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
218
+ > You can now use the updated items or hook into the result to update the ui for example
219
+
220
+
221
+ ##v1.0.23
222
+ - Rename ResourceCache to LocalCache
223
+ > LocalCache only caches local items (name better reflects functionality)
224
+
225
+ - Remove getter/setter for hasChanges
226
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
227
+
228
+ - Remove `_getCollection` from ItemAdministrator
229
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
230
+ > options and should not be given as a separate argument. This was included to support the frontend
231
+
232
+ - Remove `saveCurrentTab` from ItemAdministrator
233
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
234
+
235
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
236
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
237
+
@@ -1,22 +1,25 @@
1
1
  /// <reference types="moment" />
2
2
  import * as moment from 'moment';
3
+ import { FieldMap } from '../types';
4
+ import { ColumnInfo } from './ColumnInfo';
3
5
  export declare class ApiFormatter {
4
6
  MOMENT_INVALID: string;
5
7
  SERVER_DATETIME_FORMAT: string;
6
8
  SERVER_TIME_FORMAT: string;
7
9
  SERVER_DATE_FORMAT: string;
8
10
  constructor();
9
- formatResponse(fields: any, columns: any): void;
10
- expandResponse(current: any, expanded: any, columns: any): void;
11
- formatRequest(initial: any, modified: any, columns: any): {};
12
- hasChanges(initial: any, modified: any, columns: any): boolean;
13
- getChanges(initial: any, modified: any, columns: any): object[];
14
- copyFields(source: any, destination: any, columns: any): any;
15
- shallowCopyFields(shallowSource: any, deepSource: any, destination: any, columns: any): any;
16
- setDefaultValues(destination: any, columns: any): any;
17
- compareFields(columnType: any, first: any, second: any): any;
11
+ formatResponse(fields: FieldMap, columns: ColumnInfo[]): FieldMap;
12
+ expandResponse(current: FieldMap, expanded: FieldMap, columns: ColumnInfo[]): FieldMap;
13
+ formatRequest(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): FieldMap;
14
+ formatRequestLocal(fields: FieldMap, columns: ColumnInfo[]): FieldMap;
15
+ hasChanges(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): boolean;
16
+ getChanges(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): FieldMap;
17
+ copyFields(source: FieldMap, destination: FieldMap, columns: ColumnInfo[]): FieldMap;
18
+ shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: ColumnInfo[]): FieldMap;
19
+ setDefaultValues(destination: FieldMap, columns: ColumnInfo[]): FieldMap;
20
+ compareFields<T>(columnType: string, first: T, second: T): boolean;
18
21
  compareFloats(a: any, b: any): boolean;
19
- compareMomentObjects(first: any, second: any): any;
22
+ compareMomentObjects(first: any, second: any): boolean;
20
23
  compareDurations(first: any, second: any): boolean;
21
24
  formatResponseValue(columnType: any, value: any): any;
22
25
  formatRequestValue(columnType: any, value: any): any;
@@ -27,8 +30,8 @@ export declare class ApiFormatter {
27
30
  formatRequestDate(value: any): any;
28
31
  formatRequestDuration(value: any): any;
29
32
  formatRequestColor(value: any): any;
30
- getDefaultValue(columnType: any): false | 0 | "" | moment.Moment | moment.Duration | "0" | "#000000" | null;
31
- isDefaultValue(columnType: any, value: any): any;
33
+ getDefaultValue(columnType: any): false | "" | 0 | moment.Moment | moment.Duration | "0" | "#000000" | null;
34
+ isDefaultValue(columnType: any, value: any): boolean;
32
35
  clone(columnType: any, value: any): any;
33
36
  getCloneFunction(columnType: any): (date: any) => any;
34
37
  cloneDuration(duration: any): moment.Duration;
@@ -6,6 +6,7 @@ export declare class BatchStatus {
6
6
  private promiseService;
7
7
  getItemId: (itemEntry: ItemEntry) => ItemId;
8
8
  getPromise: (itemEntry: ItemEntry) => Promise<ItemEntry>;
9
+ readonly requestStatusArray: ENTRY_STATUS[];
9
10
  entries: ItemEntryEntryStatusMap;
10
11
  constructor(promiseService: PromiseInterface, getItemId: (itemEntry: ItemEntry) => ItemId, getPromise: (itemEntry: ItemEntry) => Promise<ItemEntry>);
11
12
  add(entryStatus: EntryStatus<ItemEntry>): void;
@@ -3,7 +3,7 @@ import { ENTRY_STATUS } from '../constants';
3
3
  import { CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, ColumnSetFactory, QueryParserFactory } from '../factories';
4
4
  import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
5
5
  import { CollectionEntry, CollectionResource, ItemResource } from '../models';
6
- import { CollectionEntryBatchStatusMap, CollectionEntryParentIdMap, EntryStatus, ItemEntryParentIdMap, ItemId, ItemResourceItemIdMap, ItemType } from '../types';
6
+ import { CollectionEntryBatchStatusMap, CollectionEntryParentIdMap, EntryStatus, ItemEntryParentIdMap, ItemId, ItemResourceItemIdMap, ItemType, RequestColumn } from '../types';
7
7
  export declare class CollectionHandler {
8
8
  private errorHandler;
9
9
  private itemRequestService;
@@ -34,13 +34,13 @@ export declare class CollectionHandler {
34
34
  * @deprecated, use collectionMatcherFactory
35
35
  */
36
36
  addToCollections(collectionMap: any, updateInitial: boolean, resultResource?: CollectionResource | null): ItemResource[];
37
- batchExpand(parentType: string, itemType: string, collections: CollectionResource[], newColumns: any): Promise<CollectionResource[]>;
37
+ batchExpand(parentType: ItemType, itemType: ItemType, collections: CollectionResource[], newColumns: RequestColumn[]): Promise<CollectionResource[]>;
38
38
  batchExtend(parentType: string, itemType: string, options: any, queryCallback: any, collections: CollectionResource[], returnAllItems?: boolean): Promise<ItemResourceItemIdMap>;
39
39
  batchFetch(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntryParentIdMap>;
40
40
  createStatusResource(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): CollectionEntryBatchStatusMap;
41
41
  fetch(itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntry>;
42
42
  getCachedEntryStatus(collectionEntry: CollectionEntry, options: any): ENTRY_STATUS;
43
- getDeferredEntryStatus(itemType: ItemType, options: any, query: any, deferredEntries: any): {
43
+ getDeferredEntryStatus(itemType: ItemType, options: any, query: any, deferredEntries: CollectionCache): {
44
44
  entry: CollectionEntry;
45
45
  isDeferred: boolean;
46
46
  };
@@ -22,6 +22,7 @@ export declare class ItemAdministrator {
22
22
  private promiseInterface;
23
23
  private queryService;
24
24
  constructor(apiRequestService: ApiRequestServiceInterface, authInterface: AuthInterface, collectionEntryService: CollectionEntryService, collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, collectionResourceService: CollectionResourceService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemHandler: ItemHandler, itemRequestService: ItemRequestService, keyService: KeyService, localCacheFactory: LocalCacheFactory, localCacheManager: LocalCacheManagerInterface, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, promiseInterface: PromiseInterface, queryService: QueryService);
25
+ invalidateCache(): void;
25
26
  getItemDefinition(itemType: ItemType, stateKey: number | string, options: ItemOptions): ItemDefinition;
26
27
  getCollectionMatcher(itemEntries: ItemEntry[], addToTab: boolean): CollectionMatcher;
27
28
  fetchTitle(itemType: any, itemId: any, deferRequest: any): Promise<any>;
@@ -13,12 +13,12 @@ export declare class ItemCache {
13
13
  getByItemType(itemType: ItemType): ItemEntry[];
14
14
  getByQuery(itemType: ItemType, query: any): ItemEntry[];
15
15
  getLocalByQuery(itemType: ItemType, query: any): ItemEntry[];
16
+ getByParent(parentType: ItemType, parentId: ItemId, itemType: ItemType): ItemEntry[];
16
17
  forEach(callback: (itemEntry: ItemEntry) => void): void;
17
18
  toArray(): ItemEntry[];
18
19
  add(itemEntry: ItemEntry): ItemEntry;
19
20
  get(itemType: ItemType, itemId: ItemId | string): any;
20
21
  contains(itemType: ItemType, itemId: ItemId | string): boolean;
21
- getByParent(parentType: ItemType, parentId: ItemId, itemType: ItemType): ItemEntry[];
22
22
  updateItemId(itemEntry: ItemEntry, oldItemId: any): ItemEntry;
23
23
  clear(itemEntry: ItemEntry): boolean;
24
24
  matchQuery(itemEntry: ItemEntry, query: any): boolean;
@@ -1,11 +1,13 @@
1
1
  import { KeyService } from '../classes';
2
+ import { AuthInterface } from '../interfaces';
2
3
  import { ItemEntry } from '../models';
3
- import { ApiResponse, ItemId, ItemIdConversionMap, ItemType } from '../types';
4
+ import { ApiResponse, FieldMap, ItemId, ItemIdConversionMap, ItemType } from '../types';
4
5
  export declare class ItemEntryService {
6
+ private authInterface;
5
7
  private keyService;
6
8
  undefinedItemError: string;
7
9
  ALL_PERMISSIONS: number;
8
- constructor(keyService: KeyService);
10
+ constructor(authInterface: AuthInterface, keyService: KeyService);
9
11
  processOptions(options: any): any;
10
12
  createLocalConversionMap(itemType: ItemType, itemId: ItemId, doExtend: boolean | undefined, apiResponse: ApiResponse): ItemIdConversionMap;
11
13
  expandLocalConversionMap(parentType: ItemType, parentId: ItemId, apiResponse: ApiResponse, conversionMap: ItemIdConversionMap): void;
@@ -15,4 +17,5 @@ export declare class ItemEntryService {
15
17
  batchClone(itemEntries: ItemEntry[], conversionMap?: ItemIdConversionMap): ItemEntry[];
16
18
  getFullName(firstName: any, infix: any, lastName: any): any;
17
19
  getTitleField(itemType: any): "serienummer" | "nummer" | "friendlyname" | "naamintern" | "omschrijving" | "code" | "naam" | "displayname";
20
+ getLocalDefaultValues(): FieldMap;
18
21
  }