@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 +237 -212
- package/dist/dist/classes/ApiFormatter.d.ts +15 -12
- package/dist/dist/classes/BatchStatus.d.ts +1 -0
- package/dist/dist/classes/ChangesProcessor.d.ts +1 -1
- package/dist/dist/classes/CollectionHandler.d.ts +3 -3
- package/dist/dist/classes/ItemAdministrator.d.ts +1 -0
- package/dist/dist/classes/ItemCache.d.ts +1 -1
- package/dist/dist/classes/ItemEntryService.d.ts +5 -2
- package/dist/dist/classes/ItemHandler.d.ts +10 -6
- package/dist/dist/constants.d.ts +1 -0
- package/dist/dist/models/CollectionEditResource.d.ts +13 -6
- package/dist/dist/models/CollectionEntry.d.ts +4 -3
- package/dist/dist/models/CollectionResource.d.ts +5 -3
- package/dist/dist/models/ItemEntry.d.ts +22 -17
- package/dist/dist/types/ItemTypesCollection.d.ts +4 -4
- package/dist/rm-core.js +268 -187
- package/dist/rm-core.min.js +1 -1
- package/package.json +35 -35
package/changelog.md
CHANGED
|
@@ -1,212 +1,237 @@
|
|
|
1
|
-
#Changelog
|
|
2
|
-
Contains new features, breaking changes and their reasoning
|
|
3
|
-
|
|
4
|
-
##v1.
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
- `
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- `
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
##
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
##v1.
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
`
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
##
|
|
56
|
-
- Fixed issue
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
`
|
|
84
|
-
|
|
85
|
-
##
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
##v1.0.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
##v1.0.
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
##v1.0.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
>
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
>
|
|
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:
|
|
10
|
-
expandResponse(current:
|
|
11
|
-
formatRequest(initial:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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):
|
|
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 |
|
|
31
|
-
isDefaultValue(columnType: any, value: 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<
|
|
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:
|
|
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:
|
|
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
|
}
|