@rentman/rm-core 1.1.8-4 → 1.1.9

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,167 +1,176 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ##v1.1.8
5
- - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
6
-
7
- ##v1.1.7
8
- - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
9
-
10
- ##v1.1.6
11
- - Fixed issue with deferred item entries.
12
- - Re-enable changes watcher after save.
13
- - Added optional `id` parameter to `LocalCache` constructor.
14
-
15
- ##v1.1.5
16
- - Added `clearItem` function to `LocalCache` class.
17
-
18
- ##v.1.1.4
19
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
20
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
21
- the items to the local cache.
22
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
23
- doing it however can definitely be harmful.
24
-
25
- ##v.1.1.3
26
- - Fixed an issue where all collections in a local cache would be cleared.
27
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
28
- `LocalCacheManagerInterface`.
29
-
30
- ##v1.1.2
31
- - Fixed an issue concerning derived values.
32
-
33
- ## v1.1.1
34
- - Fixed an issue where changes wouldn't be detected.
35
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
36
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
37
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
38
- `disableChangesWatcher` instead.
39
-
40
- ## v1.1.0
41
- ### Development
42
-
43
- #### Strict TypeScript compilation
44
- Added the following TypeScript compiler options:
45
- - noImplicitThis
46
- - noImplicitReturns
47
- - strictNullChecks
48
- - noUnusedLocals
49
- - noUnusedParameters
50
-
51
- I would advise enabling these for all TypeScript projects from now on.
52
-
53
- #### Ordered imports and dependencies
54
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
55
- Please note that this also applies for imports from the folder the file is currently in.
56
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
57
- `import { ItemEntry } from '../models';`
58
-
59
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
60
- remove dependencies in the future.
61
-
62
- ### Breaking changes
63
-
64
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
65
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
66
- `moduleChangesCompilationFactory`.
67
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
68
- no longer supported in the back-end.
69
-
70
- #### Item and collection entries
71
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
72
- - Added the following functions to `ItemEntryService`:
73
- - `createLocalConversionMap`;
74
- - `expandLocalConversionMap`;
75
- - `expandConversionMap`;
76
- - `batchExpandConversionMap`;
77
- - `batchClone`.
78
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
79
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
80
-
81
- #### Rework item caching
82
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
83
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
84
- using the item administrator or when resources are created when adding the items to a collection.
85
-
86
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
87
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
88
- > pasting of items.
89
-
90
- Other changes:
91
-
92
- - Moved `saveLocal` to `ItemAdministrator`;
93
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
94
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
95
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
96
- already on the backend. (Use `getCollectionMatcher`.)
97
-
98
-
99
- ##v1.0.33
100
- - Really fix types path
101
-
102
- ##v1.0.33
103
- - Fix types path
104
-
105
- ##v1.0.32
106
- - Update `tsconfig.json` to put definitions in the root folder
107
- > The app had an issue with AOT compilation because of this
108
-
109
- ##v1.0.31
110
- - Fix `columnHandler.fetchItemTypeTranslations`
111
- > It incorrectly looped over the response map, it should now work again
112
-
113
- ##v1.0.30
114
- - Remove `updateTabParams` from LocalCacheManagerInterface
115
- > The function wasn't used
116
-
117
- - Reworked class export
118
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
119
-
120
- ##v1.0.29
121
- - Fix inverted inArray check in CollectionEntry.removeItems
122
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
123
-
124
- ##v1.0.28
125
- Bug fixes only
126
-
127
- ##v1.0.27
128
- - `ItemEntry.initial` is now undefined by default
129
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
130
-
131
- ##v1.0.26
132
- Bundle both minified and unminified code, include sourcemaps from dev build
133
-
134
- ##v1.0.24, v1.0.25
135
- ! Use version `v1.0.26` !
136
-
137
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
138
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
139
-
140
- - Rename `ItemEntry.entryId` to `ItemEntry.id
141
- > It used to be called `id`, but it was changed in the seperation of the core.
142
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
143
-
144
- - Rename ItemResource `startTransaction` to `start`
145
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
146
-
147
- - `SocketMessageHandler.onMessageReceived` now returns a promise
148
- > You can now use the updated items or hook into the result to update the ui for example
149
-
150
-
151
- ##v1.0.23
152
- - Rename ResourceCache to LocalCache
153
- > LocalCache only caches local items (name better reflects functionality)
154
-
155
- - Remove getter/setter for hasChanges
156
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
157
-
158
- - Remove `_getCollection` from ItemAdministrator
159
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
160
- > options and should not be given as a separate argument. This was included to support the frontend
161
-
162
- - Remove `saveCurrentTab` from ItemAdministrator
163
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
164
-
165
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
166
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
167
-
1
+ #Changelog
2
+ Contains new features, breaking changes and their reasoning
3
+
4
+ ##v1.1.9
5
+ - Exposed `noop` function on `RmCore` class.
6
+ > This is used in order to check whether a callback has a default value.
7
+ - Added `copyRequestColumns` function to `ColumnUtil` class.
8
+ - Made parameters of `ItemAdministrator.saveCurrentLocalCache` and `LocalCache.save` optional.
9
+ - **Breaking:** Reordered parameters of `ChangesProcessor.execute` to be consistent with
10
+ `ItemAdministrator.saveCurrentLocalCache`. The new order is `singleItems` - `collections` - `parameters` -
11
+ `breakUpByParent` - `onAfterCreateCallback`.
12
+
13
+ ##v1.1.8
14
+ - Set default value for `params` to `{filter: false}` in `request` function in `ColumnHandler` class.
15
+
16
+ ##v1.1.7
17
+ - Fixed issue where cached item entries or collection entries wouldn't be added to the local cache.
18
+
19
+ ##v1.1.6
20
+ - Fixed issue with deferred item entries.
21
+ - Re-enable changes watcher after save.
22
+ - Added optional `id` parameter to `LocalCache` constructor.
23
+
24
+ ##v1.1.5
25
+ - Added `clearItem` function to `LocalCache` class.
26
+
27
+ ##v.1.1.4
28
+ - Fix issue where items where not added to the local cache automatically when they where added to a collection.
29
+ > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
30
+ the items to the local cache.
31
+ > In other instances this might be debatable because it doesn't do any real harm. *Not*
32
+ doing it however can definitely be harmful.
33
+
34
+ ##v.1.1.3
35
+ - Fixed an issue where all collections in a local cache would be cleared.
36
+ - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
37
+ `LocalCacheManagerInterface`.
38
+
39
+ ##v1.1.2
40
+ - Fixed an issue concerning derived values.
41
+
42
+ ## v1.1.1
43
+ - Fixed an issue where changes wouldn't be detected.
44
+ - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
45
+ call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
46
+ - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
47
+ `disableChangesWatcher` instead.
48
+
49
+ ## v1.1.0
50
+ ### Development
51
+
52
+ #### Strict TypeScript compilation
53
+ Added the following TypeScript compiler options:
54
+ - noImplicitThis
55
+ - noImplicitReturns
56
+ - strictNullChecks
57
+ - noUnusedLocals
58
+ - noUnusedParameters
59
+
60
+ I would advise enabling these for all TypeScript projects from now on.
61
+
62
+ #### Ordered imports and dependencies
63
+ Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
64
+ Please note that this also applies for imports from the folder the file is currently in.
65
+ For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
66
+ `import { ItemEntry } from '../models';`
67
+
68
+ Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
69
+ remove dependencies in the future.
70
+
71
+ ### Breaking changes
72
+
73
+ - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
74
+ `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
75
+ `moduleChangesCompilationFactory`.
76
+ - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
77
+ no longer supported in the back-end.
78
+
79
+ #### Item and collection entries
80
+ - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
81
+ - Added the following functions to `ItemEntryService`:
82
+ - `createLocalConversionMap`;
83
+ - `expandLocalConversionMap`;
84
+ - `expandConversionMap`;
85
+ - `batchExpandConversionMap`;
86
+ - `batchClone`.
87
+ - Cloning of item entries now works slightly differently. The function will attempt to generate a new
88
+ item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
89
+
90
+ #### Rework item caching
91
+ Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
92
+ All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
93
+ using the item administrator or when resources are created when adding the items to a collection.
94
+
95
+ > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
96
+ > allow for the creation item and collection entries without caching them directly. This is required for the copying and
97
+ > pasting of items.
98
+
99
+ Other changes:
100
+
101
+ - Moved `saveLocal` to `ItemAdministrator`;
102
+ - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
103
+ - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
104
+ called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
105
+ already on the backend. (Use `getCollectionMatcher`.)
106
+
107
+
108
+ ##v1.0.33
109
+ - Really fix types path
110
+
111
+ ##v1.0.33
112
+ - Fix types path
113
+
114
+ ##v1.0.32
115
+ - Update `tsconfig.json` to put definitions in the root folder
116
+ > The app had an issue with AOT compilation because of this
117
+
118
+ ##v1.0.31
119
+ - Fix `columnHandler.fetchItemTypeTranslations`
120
+ > It incorrectly looped over the response map, it should now work again
121
+
122
+ ##v1.0.30
123
+ - Remove `updateTabParams` from LocalCacheManagerInterface
124
+ > The function wasn't used
125
+
126
+ - Reworked class export
127
+ > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
128
+
129
+ ##v1.0.29
130
+ - Fix inverted inArray check in CollectionEntry.removeItems
131
+ > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
132
+
133
+ ##v1.0.28
134
+ Bug fixes only
135
+
136
+ ##v1.0.27
137
+ - `ItemEntry.initial` is now undefined by default
138
+ > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
139
+
140
+ ##v1.0.26
141
+ Bundle both minified and unminified code, include sourcemaps from dev build
142
+
143
+ ##v1.0.24, v1.0.25
144
+ ! Use version `v1.0.26` !
145
+
146
+ - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
147
+ > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
148
+
149
+ - Rename `ItemEntry.entryId` to `ItemEntry.id
150
+ > It used to be called `id`, but it was changed in the seperation of the core.
151
+ > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
152
+
153
+ - Rename ItemResource `startTransaction` to `start`
154
+ > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
155
+
156
+ - `SocketMessageHandler.onMessageReceived` now returns a promise
157
+ > You can now use the updated items or hook into the result to update the ui for example
158
+
159
+
160
+ ##v1.0.23
161
+ - Rename ResourceCache to LocalCache
162
+ > LocalCache only caches local items (name better reflects functionality)
163
+
164
+ - Remove getter/setter for hasChanges
165
+ > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
166
+
167
+ - Remove `_getCollection` from ItemAdministrator
168
+ > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
169
+ > options and should not be given as a separate argument. This was included to support the frontend
170
+
171
+ - Remove `saveCurrentTab` from ItemAdministrator
172
+ > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
173
+
174
+ - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
175
+ > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
176
+
@@ -27,7 +27,7 @@ export declare class ApiFormatter {
27
27
  formatRequestDate(value: any): any;
28
28
  formatRequestDuration(value: any): any;
29
29
  formatRequestColor(value: any): any;
30
- getDefaultValue(columnType: any): false | 0 | "" | moment.Moment | moment.Duration | "0" | "#000000" | null;
30
+ getDefaultValue(columnType: any): false | moment.Moment | 0 | moment.Duration | "" | "0" | "#000000" | null;
31
31
  isDefaultValue(columnType: any, value: any): any;
32
32
  clone(columnType: any, value: any): any;
33
33
  getCloneFunction(columnType: any): (date: any) => any;
@@ -1,6 +1,8 @@
1
1
  import { ApiFormatter, CollectionEntryService, CollectionHandler, ItemHandler } from '../classes';
2
2
  import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
3
3
  import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
+ import { CollectionEntry, ItemEntry } from '../models';
5
+ import { CreateRequestParameterMap, ItemIdConversionMap } from '../types';
4
6
  export declare class ChangesProcessor {
5
7
  private apiRequestService;
6
8
  private itemHandler;
@@ -17,8 +19,7 @@ export declare class ChangesProcessor {
17
19
  getItemTypeUpdatePriority(itemType: any): 0 | 1 | 2;
18
20
  buildMoveRequest(compilationEntries: any): {};
19
21
  getMapValue(itemType: any, itemId: any, map: any): any;
20
- execute(singleItems: any, collections: any, breakupByParent?: boolean, parameters?: any, onAfterCreateCallback?: any): Promise<any>;
21
- private executeCreateRequests(changesCompilation, parameters, conversionMap, breakupByParent, onAfterCreateCallback);
22
+ private executeCreateRequests(changesCompilation, parameters, conversionMap, breakupByParent?, onAfterCreateCallback?);
22
23
  private executeCreateRequest(requestResource, conversionMap);
23
24
  private prioritizeUpdateRequests(compilation, parameters);
24
25
  private executeUpdateRequests(itemTypes, compilation, parameters);
@@ -30,5 +31,5 @@ export declare class ChangesProcessor {
30
31
  private addCollectionMapEntry(collectionMap, parentId, itemEntry, value);
31
32
  private forEachCollection(collectionMap, method);
32
33
  private onItemsCreated(conversionMap, singleItems, collections);
33
- private executeRequests(changesCompilation, parameters, breakupByParent, onAfterCreateCallback);
34
+ execute(singleItems: ItemEntry[], collections: CollectionEntry[], parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): Promise<any>;
34
35
  }
@@ -1,4 +1,4 @@
1
- import { RequestColumns } from '../types';
1
+ import { RequestColumn, RequestColumns } from '../types';
2
2
  export declare class ColumnUtil {
3
3
  constructor();
4
4
  getColumnPath(columns: any, renderAs: any): string;
@@ -31,20 +31,22 @@ export declare class ColumnUtil {
31
31
  isColumnSubset(first: any, second: any, secondTrue: any): any;
32
32
  containsColumn(requestColumn: any, destination: any): boolean;
33
33
  responseColumnsAvailable(itemType: any, requestColumns: any, responseColumnMap: any): boolean;
34
+ copyRequestColumns(columns: RequestColumns): RequestColumns;
35
+ copyRequestColumn(requestColumn: RequestColumn): RequestColumn;
34
36
  /**
35
37
  * Difference: columns that are in second, but not in first
36
38
  * @param {Array} first
37
39
  * @param {Array} second
38
40
  * @returns {Object} An object containing 'merged' and 'difference' properties
39
41
  */
40
- mergeRequestColumns(first: any, second: any): {
42
+ mergeRequestColumns(first: RequestColumns, second: RequestColumns): {
41
43
  merged: RequestColumns;
42
44
  difference: RequestColumns;
43
45
  };
44
46
  mergeRequestColumn(requestColumn: any, destination: any): any;
45
47
  parseRequestColumn(requestColumn: any): {
46
- id: any;
47
- children: any;
48
+ id: string;
49
+ children: RequestColumn[];
48
50
  };
49
51
  /**
50
52
  * Merges two sets of response columns.
@@ -68,8 +70,8 @@ export declare class ColumnUtil {
68
70
  isLocalColumnId(columnId: any): boolean;
69
71
  processConfigColumns(columns: any): never[];
70
72
  processLocalConfigColumns(configColumns: any, localColumns: any, remoteColumnCallback: any, localColumnCallback: any): void;
71
- consolidateColumns(configColumns: any, localColumns: any, addRequestColumns: any): {
72
- request: any;
73
+ consolidateColumns(configColumns: any, localColumns: any, addRequestColumns: RequestColumn[]): {
74
+ request: RequestColumn[];
73
75
  local: object[];
74
76
  };
75
77
  parseConfigColumn(column: any): any;
@@ -1,6 +1,6 @@
1
- import { CollectionCache, CollectionHandler, KeyService } from '../classes';
1
+ import { ChangesCompilation, CollectionCache, CollectionHandler, KeyService } from '../classes';
2
2
  import { CollectionMatcherFactory, RequestColumnExpansionFactory } from '../factories';
3
- import { CreateRequestEntry } from '../types';
3
+ import { CreateRequestEntry, CreateRequestParameterMap } from '../types';
4
4
  export declare class CreateRequest {
5
5
  private collectionHandler;
6
6
  private collectionMatcherFactory;
@@ -11,7 +11,7 @@ export declare class CreateRequest {
11
11
  private parameterMap;
12
12
  private breakupByParent;
13
13
  requests: CreateRequestEntry[];
14
- constructor(collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, keyService: KeyService, requestColumnExpansionFactory: RequestColumnExpansionFactory, compilation: any, localCollectionCache: CollectionCache, parameterMap: any, breakupByParent?: boolean);
14
+ constructor(collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, keyService: KeyService, requestColumnExpansionFactory: RequestColumnExpansionFactory, compilation: ChangesCompilation, localCollectionCache: CollectionCache, parameterMap: CreateRequestParameterMap, breakupByParent?: boolean);
15
15
  finalizeRequest(requestResource: CreateRequestEntry): CreateRequestEntry;
16
16
  setRequestParent(parentType: any, requestResource: any): boolean;
17
17
  run(): CreateRequestEntry[];
@@ -2,7 +2,7 @@ import { CollectionCache, CollectionEntryService, CollectionHandler, CollectionM
2
2
  import { CollectionMatcherFactory, ColumnSetFactory, LocalCacheFactory, ModuleChangesCompilationFactory } from '../factories';
3
3
  import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from '../interfaces';
4
4
  import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
5
- import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, ItemId, ItemResourceItemTypeMap, ItemType, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
5
+ import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemResourceItemTypeMap, ItemType, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
6
6
  export declare class ItemAdministrator {
7
7
  private apiRequestService;
8
8
  private authInterface;
@@ -73,7 +73,7 @@ export declare class ItemAdministrator {
73
73
  getItemByDef(definition: any, isRoot: boolean): Promise<any>;
74
74
  cloneItem(itemResource: ItemResource, options: any): ItemResource;
75
75
  cloneCollection(collectionResource: CollectionResource, options: any, conversionMap: any): CollectionResource;
76
- saveCurrentLocalCache(closeTab: boolean, parameters: any, breakupByParent: boolean | undefined, onAfterCreateCallback: any): any;
76
+ saveCurrentLocalCache(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): any;
77
77
  getCurrentCollections(): CollectionCache;
78
78
  getCurrentItems(): ItemCache;
79
79
  getCurrentChanges(): {
@@ -91,8 +91,8 @@ export declare class ItemAdministrator {
91
91
  removeFromCollections(itemEntries: ItemEntry[], resultCollectionResource?: CollectionResource): ItemResource[] | null;
92
92
  saveLocal(itemResource: ItemResource): Promise<any>;
93
93
  updateItemIdMap(collectionMap: any, conversionMap: any): void;
94
- createCollectionResource(collectionEntry: any, resourceOptions: any, processOptions?: boolean): CollectionResource;
95
- createItemResource(itemEntry: any, options: any, isRoot: boolean): ItemResource;
94
+ createCollectionResource(collectionEntry: CollectionEntry, resourceOptions: any, processOptions?: boolean): CollectionResource;
95
+ createItemResource(itemEntry: ItemEntry, options: any, isRoot: boolean): ItemResource;
96
96
  onBeforeSave(key: string, callback: any): () => boolean;
97
97
  onSaveSuccess(key: string, callback: any): () => boolean;
98
98
  onSaveWithoutClosing(key: string, callback: any): () => boolean;
@@ -2,7 +2,7 @@ import { CollectionCache, ItemCache, ItemResourceService, LockService } from '..
2
2
  import { ChangesProcessorFactory, CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
3
3
  import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
4
  import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
5
- import { CollectionEntryParentIdMap } from '../types';
5
+ import { CollectionEntryParentIdMap, CreateRequestParameterMap, ItemIdConversionMap } from '../types';
6
6
  export declare class LocalCache {
7
7
  private errorHandler;
8
8
  private lockService;
@@ -41,7 +41,7 @@ export declare class LocalCache {
41
41
  detectChanges(): boolean;
42
42
  private collectionHasChanges(collectionEntry);
43
43
  isLockable(): boolean;
44
- save(closeTab: boolean | undefined, parameters: any, breakUpByParent: any, onAfterCreateCallback: any): any;
44
+ save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): any;
45
45
  private executeCallbacks(event, ...args);
46
46
  enableChangesWatcher(): void;
47
47
  disableChangesWatcher(): void;
@@ -6,5 +6,5 @@ export declare class CreateRequestFactory {
6
6
  private keyService;
7
7
  private requestColumnExpansionFactory;
8
8
  constructor(collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, keyService: KeyService, requestColumnExpansionFactory: RequestColumnExpansionFactory);
9
- construct(compilation: any, collectionEntries: any, parameterMap: any, breakupByParent?: boolean): CreateRequest;
9
+ construct(compilation: any, collectionEntries: any, parameterMap: any, breakupByParent?: any): CreateRequest;
10
10
  }
@@ -3,6 +3,7 @@ import { ApiResponseProcessorFactory, BatchStatusFactory, ChangesCompilationFact
3
3
  import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from './interfaces';
4
4
  export declare class RmCore {
5
5
  version: string;
6
+ noop: typeof noop;
6
7
  apiFormatter: ApiFormatter;
7
8
  keyService: KeyService;
8
9
  queryService: QueryService;
@@ -1,7 +1,8 @@
1
1
  import { ItemHandler, KeyService } from '../classes';
2
2
  import { ChangesProcessorFactory, ItemEntryFactory, ItemResourceFactory } from '../factories';
3
3
  import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
- import { CollectionEntry, CollectionResource, ItemResource } from '../models';
4
+ import { CollectionEntry } from './CollectionEntry';
5
+ import { CollectionResource } from './CollectionResource';
5
6
  export declare class CollectionEditResource extends CollectionResource {
6
7
  private errorHandler;
7
8
  private itemHandler;
@@ -11,10 +12,10 @@ export declare class CollectionEditResource extends CollectionResource {
11
12
  private itemEntryFactory;
12
13
  constructor(errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseInterface, itemEntryFactory: ItemEntryFactory, collectionEntry: CollectionEntry, options: any);
13
14
  save(): Promise<any>;
14
- moveItems(idArray: any, destination: any, enableCallbacks: any): ItemResource[];
15
+ moveItems(idArray: any, destination: any, enableCallbacks: any): any;
15
16
  removeItems(idArray: any, enableCallbacks: any): Promise<any>;
16
17
  removeItem(itemId: any, enableCallbacks: any): Promise<any>;
17
18
  addItems(valuesArray: any, enableCallbacks?: boolean): Promise<any>;
18
19
  addItem(values: any, enableCallbacks: any): Promise<any>;
19
- clear(enableCallbacks: any): ItemResource[] | null;
20
+ clear(enableCallbacks: any): any;
20
21
  }
@@ -36,13 +36,10 @@ export declare class CollectionEntry {
36
36
  forEach(callback: (itemEntry: ItemEntry) => void): void;
37
37
  getItemById(itemId: any): ItemEntry | undefined;
38
38
  getIdArray(accumulator?: never[]): ItemId[];
39
- revertChanges(): void;
40
- addItems(itemEntries: ItemEntry[], resultResource?: CollectionResource | null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): ItemResource[] | null;
41
- private handleAddedItemCallbacks(entriesAddedToInitial, entriesAddedToModified, resultResource?, callOnAdd?, callOnActivate?);
42
- removeItems(idArray: any, resultResource: any, updateInitial: any, enableCallback?: any): ItemResource[] | null;
43
- clear(resultResource: any, updateInitial: any, enableCallback?: any): ItemResource[] | null;
44
- handleRemovedItems(filterFunction: (itemEntry: ItemEntry) => boolean, resultResource?: CollectionResource | null, updateInitial?: boolean, enableCallback?: boolean): ItemResource[] | null;
45
- private handleRemovedItemCallbacks(removedFromInitial, removedFromModified, resultResource?, callOnRemove?);
39
+ addItems(itemEntries: any, resultResource: any, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): ItemResource[] | null;
40
+ removeItems(idArray: any, resultResource: any, updateInitial: any, enableCallback?: any): any;
41
+ clear(resultResource: any, updateInitial: any, enableCallback?: any): any;
42
+ handleRemovedItems(filterFunction: any, resultResource: any, updateInitial: any, enableCallback?: boolean): any;
46
43
  expand(newColumns: any): Promise<any>;
47
44
  extendQuery(callback: any): any;
48
45
  extend(queryCallback: any, collectionResource: any, callOnAdd?: any, updateInitial?: any): Promise<any>;
@@ -57,6 +54,7 @@ export declare class CollectionEntry {
57
54
  hasUpdatedItems(): boolean;
58
55
  getCurrentResource(): CollectionResource;
59
56
  clearResources(isSubtabChange?: boolean): void;
57
+ revertChanges(): void;
60
58
  onItemsCreated(conversionMap: any): void;
61
59
  getUpdatedItemColumns(conversionMap: any): {
62
60
  [columnId: string]: ColumnInfo;
@@ -12,8 +12,8 @@ export declare class EditResource extends ItemResource {
12
12
  transactions: number;
13
13
  constructor(apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, errorHandler: ErrorHandlerInterface, promiseService: PromiseInterface, entry: ItemEntry, options: any);
14
14
  start(): void;
15
- rollback(callOnDeactivate?: boolean): void;
16
- commit(initial: any): void;
15
+ rollback(): void;
16
+ commit(initial?: boolean): void;
17
17
  getLocalCopy(): FieldMap | null;
18
18
  copyFields(destination?: any): any;
19
19
  setFields(values: any, callOnChange: any): this;
@@ -28,6 +28,11 @@ export declare type ItemIdConversionMap = {
28
28
  [itemId: number]: number;
29
29
  };
30
30
  };
31
+ export declare type CreateRequestParameterMap = {
32
+ [itemType: string]: {
33
+ [itemId: number]: object;
34
+ };
35
+ };
31
36
  export declare type CollectionEntryBatchStatusMap = {
32
37
  [status: string]: CollectionEntryParentIdMap;
33
38
  };
@@ -45,7 +50,8 @@ export declare type CollectionMatchResult = {
45
50
  notfitting: CollectionEntry[];
46
51
  maybe: CollectionEntry[];
47
52
  };
48
- export declare type RequestColumns = Array<string | object> | true;
53
+ export declare type RequestColumn = string | object;
54
+ export declare type RequestColumns = RequestColumn[] | true;
49
55
  export declare type ResponseColumn = any;
50
56
  export declare type ResponseColumnMap = {
51
57
  [itemType: string]: {