@rentman/rm-core 1.1.15 → 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,212 +1,237 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ##v1.15
5
- - Fix `fetchItemTypesTranslations` function in `ColumnHandler` class.
6
- - Fix type definition of `PromiseInterface.all`.
7
-
8
- ##v1.14
9
- - The `ChangesCompiler` now always processes local collections. (Even if they don't have edit resources.) This fixes an
10
- issue with recurring appointments in the front-end.
11
-
12
- ##v1.13
13
- - Add option to exclude itemTypes during createLocalEntries.
14
-
15
- ##v1.12
16
- - **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
17
- `ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
18
- from the local cache inadvertently.
19
- - The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
20
- - When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
21
- are now respected. This fixes an issue where items where *not* removed from the local cache.
22
- - When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
23
- issue where changes were being detected continuously.
24
- - Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
25
- except when updating documents. This fixes several issues.
26
- - `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
27
- collection was added multiple times.
28
- - Updated all models to use dependency objects. This increases ease of debugging.
29
-
30
- ##v.1.11
31
- - Fixed issue that occurs when saving when having an existing item refer to a newly created item.
32
- - **Breaking:** Removed `ItemResourceService.isNewResource`.
33
- - **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
34
- - `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
35
- completed transactions.
36
-
37
- ##v.1.10
38
- - Fixed issue where changes on different subtabs were not detected.
39
-
40
- ##v1.1.9
41
- - Exposed `noop` function on `RmCore` class.
42
- > This is used in order to check whether a callback has a default value.
43
- - Added `copyRequestColumns` function to `ColumnUtil` class.
44
- - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
45
- - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
46
- `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
47
- `breakUpByParent` - `onAfterCreateCallback`.
48
-
49
- ##v1.1.8
50
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
51
-
52
- ##v1.1.7
53
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
54
-
55
- ##v1.1.6
56
- - Fixed issue with deferred item entries.
57
- - Re-enable changes watcher after save.
58
- - Added optional `id` parameter to `LocalCache` constructor.
59
-
60
- ##v1.1.5
61
- - Added `clearItem` function to `LocalCache` class.
62
-
63
- ##v.1.1.4
64
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
65
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
66
- the items to the local cache.
67
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
68
- doing it however can definitely be harmful.
69
-
70
- ##v.1.1.3
71
- - Fixed an issue where all collections in a local cache would be cleared.
72
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
73
- `LocalCacheManagerInterface`.
74
-
75
- ##v1.1.2
76
- - Fixed an issue concerning derived values.
77
-
78
- ## v1.1.1
79
- - Fixed an issue where changes wouldn't be detected.
80
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
81
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
82
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
83
- `disableChangesWatcher` instead.
84
-
85
- ## v1.1.0
86
- ### Development
87
-
88
- #### Strict TypeScript compilation
89
- Added the following TypeScript compiler options:
90
- - noImplicitThis
91
- - noImplicitReturns
92
- - strictNullChecks
93
- - noUnusedLocals
94
- - noUnusedParameters
95
-
96
- I would advise enabling these for all TypeScript projects from now on.
97
-
98
- #### Ordered imports and dependencies
99
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
100
- Please note that this also applies for imports from the folder the file is currently in.
101
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
102
- `import { ItemEntry } from '../models';`
103
-
104
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
105
- remove dependencies in the future.
106
-
107
- ### Breaking changes
108
-
109
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
110
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
111
- `moduleChangesCompilationFactory`.
112
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
113
- no longer supported in the back-end.
114
-
115
- #### Item and collection entries
116
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
117
- - Added the following functions to `ItemEntryService`:
118
- - `createLocalConversionMap`;
119
- - `expandLocalConversionMap`;
120
- - `expandConversionMap`;
121
- - `batchExpandConversionMap`;
122
- - `batchClone`.
123
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
124
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
125
-
126
- #### Rework item caching
127
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
128
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
129
- using the item administrator or when resources are created when adding the items to a collection.
130
-
131
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
132
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
133
- > pasting of items.
134
-
135
- Other changes:
136
-
137
- - Moved `saveLocal` to `ItemAdministrator`;
138
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
139
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
140
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
141
- already on the backend. (Use `getCollectionMatcher`.)
142
-
143
-
144
- ##v1.0.33
145
- - Really fix types path
146
-
147
- ##v1.0.33
148
- - Fix types path
149
-
150
- ##v1.0.32
151
- - Update `tsconfig.json` to put definitions in the root folder
152
- > The app had an issue with AOT compilation because of this
153
-
154
- ##v1.0.31
155
- - Fix `columnHandler.fetchItemTypeTranslations`
156
- > It incorrectly looped over the response map, it should now work again
157
-
158
- ##v1.0.30
159
- - Remove `updateTabParams` from LocalCacheManagerInterface
160
- > The function wasn't used
161
-
162
- - Reworked class export
163
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
164
-
165
- ##v1.0.29
166
- - Fix inverted inArray check in CollectionEntry.removeItems
167
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
168
-
169
- ##v1.0.28
170
- Bug fixes only
171
-
172
- ##v1.0.27
173
- - `ItemEntry.initial` is now undefined by default
174
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
175
-
176
- ##v1.0.26
177
- Bundle both minified and unminified code, include sourcemaps from dev build
178
-
179
- ##v1.0.24, v1.0.25
180
- ! Use version `v1.0.26` !
181
-
182
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
183
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
184
-
185
- - Rename `ItemEntry.entryId` to `ItemEntry.id
186
- > It used to be called `id`, but it was changed in the seperation of the core.
187
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
188
-
189
- - Rename ItemResource `startTransaction` to `start`
190
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
191
-
192
- - `SocketMessageHandler.onMessageReceived` now returns a promise
193
- > You can now use the updated items or hook into the result to update the ui for example
194
-
195
-
196
- ##v1.0.23
197
- - Rename ResourceCache to LocalCache
198
- > LocalCache only caches local items (name better reflects functionality)
199
-
200
- - Remove getter/setter for hasChanges
201
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
202
-
203
- - Remove `_getCollection` from ItemAdministrator
204
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
205
- > options and should not be given as a separate argument. This was included to support the frontend
206
-
207
- - Remove `saveCurrentTab` from ItemAdministrator
208
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
209
-
210
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
211
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
212
-
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;
@@ -33,5 +33,5 @@ export declare class ChangesProcessor {
33
33
  private addCollectionMapEntry(collectionMap, parentId, itemEntry, value);
34
34
  private forEachCollection(collectionMap, method);
35
35
  private onItemsCreated(conversionMap, singleItems, collections);
36
- execute(singleItems: ItemEntry[], collections: CollectionEntry[], parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): Promise<any>;
36
+ execute(singleItems: ItemEntry[], collections: CollectionEntry[], parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): Promise<ItemIdConversionMap>;
37
37
  }
@@ -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
  }