@rentman/rm-core 1.1.6 → 1.1.8-1

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,161 +1,167 @@
1
- #Changelog
2
- Contains new features, breaking changes and their reasoning
3
-
4
- ##v1.1.6
5
- - Fixed issue with deferred item entries.
6
- - Re-enable changes watcher after save.
7
- - Added optional `id` parameter to `LocalCache` constructor.
8
-
9
- ##v1.1.5
10
- - Added `clearItem` function to `LocalCache` class.
11
-
12
- ##v.1.1.4
13
- - Fix issue where items where not added to the local cache automatically when they where added to a collection.
14
- > This depends on the `callOnActivate` parameter. I've added this mainly because extending collections should *not* add
15
- the items to the local cache.
16
- > In other instances this might be debatable because it doesn't do any real harm. *Not*
17
- doing it however can definitely be harmful.
18
-
19
- ##v.1.1.3
20
- - Fixed an issue where all collections in a local cache would be cleared.
21
- - **Breaking:** Renamed `getCacheManager` to `getCurrentLocalCache` and `setCacheManager` to `setCurrentLocalCache` in
22
- `LocalCacheManagerInterface`.
23
-
24
- ##v1.1.2
25
- - Fixed an issue concerning derived values.
26
-
27
- ## v1.1.1
28
- - Fixed an issue where changes wouldn't be detected.
29
- - **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
30
- call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
31
- - **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
32
- `disableChangesWatcher` instead.
33
-
34
- ## v1.1.0
35
- ### Development
36
-
37
- #### Strict TypeScript compilation
38
- Added the following TypeScript compiler options:
39
- - noImplicitThis
40
- - noImplicitReturns
41
- - strictNullChecks
42
- - noUnusedLocals
43
- - noUnusedParameters
44
-
45
- I would advise enabling these for all TypeScript projects from now on.
46
-
47
- #### Ordered imports and dependencies
48
- Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
49
- Please note that this also applies for imports from the folder the file is currently in.
50
- For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
51
- `import { ItemEntry } from '../models';`
52
-
53
- Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
54
- remove dependencies in the future.
55
-
56
- ### Breaking changes
57
-
58
- - Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
59
- `moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
60
- `moduleChangesCompilationFactory`.
61
- - Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
62
- no longer supported in the back-end.
63
-
64
- #### Item and collection entries
65
- - Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
66
- - Added the following functions to `ItemEntryService`:
67
- - `createLocalConversionMap`;
68
- - `expandLocalConversionMap`;
69
- - `expandConversionMap`;
70
- - `batchExpandConversionMap`;
71
- - `batchClone`.
72
- - Cloning of item entries now works slightly differently. The function will attempt to generate a new
73
- item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
74
-
75
- #### Rework item caching
76
- Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
77
- All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
78
- using the item administrator or when resources are created when adding the items to a collection.
79
-
80
- > This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
81
- > allow for the creation item and collection entries without caching them directly. This is required for the copying and
82
- > pasting of items.
83
-
84
- Other changes:
85
-
86
- - Moved `saveLocal` to `ItemAdministrator`;
87
- - `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
88
- - The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
89
- called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
90
- already on the backend. (Use `getCollectionMatcher`.)
91
-
92
-
93
- ##v1.0.33
94
- - Really fix types path
95
-
96
- ##v1.0.33
97
- - Fix types path
98
-
99
- ##v1.0.32
100
- - Update `tsconfig.json` to put definitions in the root folder
101
- > The app had an issue with AOT compilation because of this
102
-
103
- ##v1.0.31
104
- - Fix `columnHandler.fetchItemTypeTranslations`
105
- > It incorrectly looped over the response map, it should now work again
106
-
107
- ##v1.0.30
108
- - Remove `updateTabParams` from LocalCacheManagerInterface
109
- > The function wasn't used
110
-
111
- - Reworked class export
112
- > Imports are now done from @rentman/rm-core, old imports are broken. This is because the old export structure didn't always work
113
-
114
- ##v1.0.29
115
- - Fix inverted inArray check in CollectionEntry.removeItems
116
- > A delete message from the socket deleted all BUT the deleted items, this should now be fixed
117
-
118
- ##v1.0.28
119
- Bug fixes only
120
-
121
- ##v1.0.27
122
- - `ItemEntry.initial` is now undefined by default
123
- > In the SocketMessageHandler we use this check to see if an ItemEntry is a stub
124
-
125
- ##v1.0.26
126
- Bundle both minified and unminified code, include sourcemaps from dev build
127
-
128
- ##v1.0.24, v1.0.25
129
- ! Use version `v1.0.26` !
130
-
131
- - The core now expects a `promiseInterface` that should implement the provided `promiseInterface`
132
- > We need to be able to hook into the promises in order to call a digest cycle to update the ui in the frontend
133
-
134
- - Rename `ItemEntry.entryId` to `ItemEntry.id
135
- > It used to be called `id`, but it was changed in the seperation of the core.
136
- > You can use the `id` to uniquely identify an entry, since itemId can be updated (local to saved id)
137
-
138
- - Rename ItemResource `startTransaction` to `start`
139
- > Other functions are called `commit` and `rollback` so having 'transaction' only for start doesn't make much sense
140
-
141
- - `SocketMessageHandler.onMessageReceived` now returns a promise
142
- > You can now use the updated items or hook into the result to update the ui for example
143
-
144
-
145
- ##v1.0.23
146
- - Rename ResourceCache to LocalCache
147
- > LocalCache only caches local items (name better reflects functionality)
148
-
149
- - Remove getter/setter for hasChanges
150
- > hasChanges is called in a digest loop in the frontend, so for performance reasons we don't want to recompute the value every time
151
-
152
- - Remove `_getCollection` from ItemAdministrator
153
- > `_getCollection` is now named `getCollection` and the old `getCollection` is removed. The query is part of the
154
- > options and should not be given as a separate argument. This was included to support the frontend
155
-
156
- - Remove `saveCurrentTab` from ItemAdministrator
157
- > `saveCurrentTab` makes no sense because the core has no concept of tabs, you should use `saveCurrentLocalCache` instead
158
-
159
- - Remove `getTabEntry` and `resetTabEntry` from ItemAdministrator
160
- > `getTabEntry` and `resetTabEntry` make no sense because the core has no concept of tabs, you should use `getLocalCache` and `resetLocalCache` instead
161
-
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
+
@@ -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,24 +1,24 @@
1
- import { CollectionCache, CollectionEntryService, CollectionMatcher, ColumnHandler, ColumnUtil, ItemCache, ItemRequestService, KeyService, QueryService } from '../classes';
1
+ import { CollectionCache, CollectionEntryService, CollectionMatcher, ColumnExpansion, ColumnHandler, ColumnSet, ItemCache, ItemRequestService, KeyService, QueryService } from '../classes';
2
+ import { ENTRY_STATUS } from '../constants';
2
3
  import { CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, ColumnSetFactory, QueryParserFactory } from '../factories';
3
4
  import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
5
  import { CollectionEntry, CollectionResource, ItemResource } from '../models';
5
- import { CollectionEntryBatchStatusMap, CollectionEntryParentIdMap, EntryStatus, ItemResourceItemIdMap } from '../types';
6
+ import { CollectionEntryBatchStatusMap, CollectionEntryParentIdMap, EntryStatus, ItemEntryParentIdMap, ItemId, ItemResourceItemIdMap, ItemType } from '../types';
6
7
  export declare class CollectionHandler {
7
8
  private errorHandler;
8
9
  private itemRequestService;
9
10
  private columnHandler;
11
+ private columnSetFactory;
10
12
  private collectionEntryFactory;
11
13
  private collectionCacheFactory;
12
14
  private queryParserFactory;
13
15
  private collectionEntryService;
14
- private columnSetFactory;
15
16
  private keyService;
16
17
  private promiseService;
17
18
  private queryService;
18
- private columnUtil;
19
19
  private collectionMatcherFactory;
20
20
  entries: CollectionCache;
21
- constructor(errorHandler: ErrorHandlerInterface, itemRequestService: ItemRequestService, columnHandler: ColumnHandler, collectionEntryFactory: CollectionEntryFactory, collectionCacheFactory: CollectionCacheFactory, queryParserFactory: QueryParserFactory, collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService, columnUtil: ColumnUtil, collectionMatcherFactory: CollectionMatcherFactory);
21
+ constructor(errorHandler: ErrorHandlerInterface, itemRequestService: ItemRequestService, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, collectionEntryFactory: CollectionEntryFactory, collectionCacheFactory: CollectionCacheFactory, queryParserFactory: QueryParserFactory, collectionEntryService: CollectionEntryService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService, collectionMatcherFactory: CollectionMatcherFactory);
22
22
  getPromises(statusResource: CollectionEntryBatchStatusMap): CollectionEntry[];
23
23
  getRequestIds(statusResource: any): number[];
24
24
  /**
@@ -36,14 +36,21 @@ export declare class CollectionHandler {
36
36
  addToCollections(collectionMap: any, updateInitial: boolean, resultResource?: CollectionResource | null): ItemResource[];
37
37
  batchExpand(parentType: string, itemType: string, collections: CollectionResource[], newColumns: any): Promise<CollectionResource[]>;
38
38
  batchExtend(parentType: string, itemType: string, options: any, queryCallback: any, collections: CollectionResource[], returnAllItems?: boolean): Promise<ItemResourceItemIdMap>;
39
- batchFetch(parentType: string, parentIdArray: number[], itemType: string, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntryParentIdMap>;
40
- createStatusResource(parentType: string, parentIdArray: number[], itemType: string, options: any, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): CollectionEntryBatchStatusMap;
41
- fetch(itemType: string, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntry>;
42
- getDeferredEntryStatus(collectionEntry: CollectionEntry, options: any): EntryStatus<CollectionEntry>;
43
- getEntryStatus(itemType: string, options: any, localEntries: CollectionCache, deferredEntries: CollectionCache): EntryStatus<CollectionEntry>;
44
- getNewEntryStatus(itemType: string, query: any, options: any, localEntries: CollectionCache, deferredEntries: CollectionCache): EntryStatus<CollectionEntry>;
45
- handleBatchResponse(statusResource: any, itemEntryResource: any, itemCache: ItemCache): CollectionEntryParentIdMap;
46
- resolveLocal(collectionEntry: CollectionEntry, itemCache: any): Promise<CollectionEntry>;
47
- resolveRemote(collectionEntry: any, itemCache: any): Promise<CollectionEntry>;
39
+ batchFetch(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntryParentIdMap>;
40
+ createStatusResource(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): CollectionEntryBatchStatusMap;
41
+ fetch(itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntry>;
42
+ getCachedEntryStatus(collectionEntry: CollectionEntry, options: any): ENTRY_STATUS;
43
+ getDeferredEntryStatus(itemType: ItemType, options: any, query: any, deferredEntries: any): {
44
+ entry: CollectionEntry;
45
+ isDeferred: boolean;
46
+ };
47
+ getEntryStatus(itemType: ItemType, options: any, localEntries: CollectionCache, deferredEntries: CollectionCache): EntryStatus<CollectionEntry>;
48
+ handleBatchResponse(statusResource: any, itemEntryCompound: {
49
+ columns: ColumnSet;
50
+ columnExpansion?: ColumnExpansion;
51
+ items?: ItemEntryParentIdMap;
52
+ }, itemCache: ItemCache): CollectionEntryParentIdMap;
53
+ resolveLocal(collectionEntry: CollectionEntry, itemCache: ItemCache): Promise<CollectionEntry>;
54
+ resolveRemote(collectionEntry: CollectionEntry, itemCache: ItemCache): Promise<CollectionEntry>;
48
55
  isLocal(options: any): boolean;
49
56
  }
@@ -18,7 +18,7 @@ export declare class CollectionMatcher {
18
18
  };
19
19
  };
20
20
  constructor(queryMatcherFactory: QueryMatcherFactory, collectionCaches: CollectionCache[], updateInitial: boolean, callOnActivate: boolean);
21
- expand(itemEntry: ItemEntry): Window;
21
+ expand(itemEntry: ItemEntry): this;
22
22
  getCollectionsWithFittingItems(): CollectionEntry[];
23
23
  addToCollections(resultResource?: CollectionResource | null): ItemResource[] | null;
24
24
  removeFromCollections(resultResource?: CollectionResource | null): ItemResource[] | null;
@@ -1,14 +1,17 @@
1
- import { ColumnUtil } from '../classes';
1
+ import { ColumnSet, ColumnUtil } from '../classes';
2
2
  import { ColumnSetFactory } from '../factories';
3
+ import { ColumnExpansionResult, ItemType, RequestColumns, ResponseColumnMap } from '../types';
3
4
  export declare class ColumnExpansion {
4
5
  private columnSetFactory;
5
6
  private columnUtil;
6
- itemType: string;
7
- requestColumns: any | boolean;
8
- responseColumns: any;
9
- expansionMap: any;
7
+ itemType: ItemType;
8
+ requestColumns: RequestColumns;
9
+ responseColumns: ResponseColumnMap;
10
+ expansionMap: {
11
+ [columnSetId: number]: ColumnExpansionResult;
12
+ };
10
13
  requestColumnsTrue: boolean;
11
- constructor(columnSetFactory: ColumnSetFactory, columnUtil: ColumnUtil, itemType: string, requestColumns: any | boolean, responseColumns: any);
12
- run(columnInfo: any, returnExpansionResult: boolean): any;
14
+ constructor(columnSetFactory: ColumnSetFactory, columnUtil: ColumnUtil, itemType: ItemType, requestColumns: RequestColumns, responseColumns: ResponseColumnMap);
15
+ run(columnSet: ColumnSet): ColumnExpansionResult | null;
13
16
  private expandColumnInfo(columnSet);
14
17
  }
@@ -10,7 +10,9 @@ export declare class ColumnHandler {
10
10
  setColumn(itemType: any, responseColumn: any): any;
11
11
  setColumns(itemType: any, requestColumns: any, responseColumns: any): {};
12
12
  fetchItemTypeTranslations(itemTypes: any): Promise<any>;
13
- request(itemType: any, columns: any, params?: {}): Promise<any>;
14
- fetch(itemType: any, requestColumns: any, params?: {}): Promise<any>;
13
+ request(itemType: any, columns: any, params?: {
14
+ filter: boolean;
15
+ }): Promise<any>;
16
+ fetch(itemType: any, requestColumns: any, params?: any): Promise<any>;
15
17
  fetchAll(itemType: any): Promise<any>;
16
18
  }
@@ -27,6 +27,8 @@ export declare class ColumnSet {
27
27
  enableCaching: boolean;
28
28
  constructor(columnHandler: ColumnHandler, columnUtil: ColumnUtil, columnInfoFactory: ColumnInfoFactory, itemType: any, request: RequestColumns);
29
29
  resolve(responseColumns: ResponseColumnMap, enableCaching?: boolean, includeIdColumn?: boolean): this;
30
+ expandRequestColumns(columns: RequestColumns): void;
31
+ isSupersetOf(columns: RequestColumns): any;
30
32
  private processResponseColumns(responseColumns);
31
33
  private processRequestColumns(responseColumns, includeIdColumn);
32
34
  private getRequestColumnInfo(requestColumn, itemType, parent, responseColumns);
@@ -1,9 +1,11 @@
1
- import { ApiResponseProcessor, BatchStatus, ColumnHandler, ColumnSet, ColumnUtil, ItemCache, ItemEntryService, KeyService } from '../classes';
1
+ import { ApiResponseProcessor, BatchStatus, ColumnHandler, ColumnUtil, ItemCache, ItemEntryService, KeyService } from '../classes';
2
2
  import { ENTRY_STATUS } from '../constants';
3
3
  import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ItemCacheFactory, ItemEntryFactory } from '../factories';
4
4
  import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
5
5
  import { ItemEntry } from '../models';
6
- import { ApiTemplateItemTypeMap, EntryStatus, ItemId, ItemIdConversionMap, ItemType, RequestColumns, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
6
+ import { ApiResponse, ApiTemplateItemTypeMap, EntryStatus, ItemId, ItemIdConversionMap, ItemType, RequestColumns, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
7
+ import { ColumnExpansion } from './ColumnExpansion';
8
+ import { ColumnSet } from './ColumnSet';
7
9
  export declare class ItemHandler {
8
10
  private apiRequestService;
9
11
  private errorHandler;
@@ -34,12 +36,11 @@ export declare class ItemHandler {
34
36
  fetchItems(itemType: any, itemIds: any, options: any, localItemCache: ItemCache): Promise<ItemEntry[]>;
35
37
  resolveCached(itemEntry: ItemEntry, status: ENTRY_STATUS, options: any): Promise<ItemEntry>;
36
38
  resolveLocal(itemEntry: ItemEntry, parent: any, template: any, localItemCache: ItemCache): TemplateResponseItemEntryMap;
37
- resolveExpansion(itemEntry: any, columnExpansion: any, response: any): ItemEntry;
38
- resolveRemote(itemEntry: any, columnInfo: any, response: any): any;
39
+ resolveExpansion(itemEntry: ItemEntry, columnExpansion: ColumnExpansion, response: ApiResponse): ItemEntry;
40
+ resolveRemote(itemEntry: ItemEntry, columnSet: ColumnSet, response: ApiResponse): ItemEntry | null;
39
41
  fetchTemplate(itemType: string, templateOptions?: any, templateColumns?: any): Promise<any>;
40
42
  getEntryStatus(itemType: ItemType, itemId: ItemId, options: any, localItemCache: ItemCache): EntryStatus<ItemEntry>;
41
- isColumnSubset(itemEntry: ItemEntry, columns: RequestColumns): any;
42
- expandColumnSetStub(columnSet: ColumnSet, columns: RequestColumns): void;
43
+ isColumnSuperset(itemEntry: ItemEntry, columns: RequestColumns): any;
43
44
  getCachedEntryStatus(itemEntry: ItemEntry, options: any): ENTRY_STATUS;
44
45
  /**
45
46
  *
@@ -1,7 +1,8 @@
1
- import { ApiResponseProcessor, ColumnExpansion, ItemHandler, QueryService } from '../classes';
1
+ import { ApiResponseProcessor, ColumnExpansion, ColumnSet, ItemHandler, QueryService } from '../classes';
2
2
  import { ColumnExpansionFactory, ColumnSetFactory, ItemEntryFactory } from '../factories';
3
3
  import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
4
  import { CollectionEntry, ItemEntry } from '../models';
5
+ import { ApiResponse, EntryParentNull, ItemId, ItemType } from '../types';
5
6
  export declare class ItemRequestService {
6
7
  private apiRequestService;
7
8
  private errorHandler;
@@ -16,7 +17,7 @@ export declare class ItemRequestService {
16
17
  requestItems(collectionEntry: CollectionEntry, query?: any, columns?: any): Promise<ApiResponseProcessor>;
17
18
  requestLinkItems(parentType: any, parentIdArray: any, itemType: any, query: any, columns: any): Promise<ApiResponseProcessor>;
18
19
  processExpansion(requestColumns: any, response: any, itemType: string, itemEntries: ItemEntry[]): ColumnExpansion;
19
- processResponse(response: any, idArray: any, parent: any, columnInfo: any, columnExpansion?: any): Promise<ItemEntry[]>;
20
+ processResponse(response: ApiResponse, idArray: ItemId[], parent: EntryParentNull, columnSet: ColumnSet, columnExpansion?: ColumnExpansion): Promise<ItemEntry[]>;
20
21
  handleCachedItem(itemEntry: any, response: any, columnExpansion: ColumnExpansion): any;
21
- processLinkResponse(response: any, parentType: any, parentIdArray: any, itemType: any, options: any): Promise<any>;
22
+ processLinkResponse(response: ApiResponse, parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any): Promise<any>;
22
23
  }
@@ -1,14 +1,16 @@
1
1
  import { CollectionEntryService, ItemEntryService, ItemRequestService, KeyService, QueryService } from '../classes';
2
+ import { ColumnSetFactory } from '../factories';
2
3
  import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
3
4
  import { CollectionEntry } from '../models/';
4
5
  export declare class CollectionEntryFactory {
5
6
  private collectionEntryService;
7
+ private columnSetFactory;
6
8
  private errorHandler;
7
9
  private itemEntryService;
8
10
  private itemRequestService;
9
11
  private keyService;
10
12
  private promiseService;
11
13
  private queryService;
12
- constructor(collectionEntryService: CollectionEntryService, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService);
14
+ constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService);
13
15
  construct(itemType: string, options: any): CollectionEntry;
14
16
  }
@@ -1,11 +1,12 @@
1
- import { CollectionEntryService, ColumnInfo, ColumnSet, ItemEntryService, ItemRequestService, KeyService, QueryService } from '../classes';
2
- import { CollectionEntryFactory } from '../factories';
1
+ import { CollectionEntryService, ColumnExpansion, ColumnInfo, ColumnSet, ItemEntryService, ItemRequestService, KeyService, QueryService } from '../classes';
2
+ import { CollectionEntryFactory, ColumnSetFactory } from '../factories';
3
3
  import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
4
  import { CollectionResource, ItemEntry, ItemResource } from '../models';
5
- import { EntryParentNull, ItemId, ItemIdConversionMap, ItemType } from '../types';
5
+ import { EntryParentNull, ItemId, ItemIdConversionMap, ItemType, RequestColumns } from '../types';
6
6
  export declare class CollectionEntry {
7
7
  private collectionEntryFactory;
8
8
  private collectionEntryService;
9
+ private columnSetFactory;
9
10
  private errorHandler;
10
11
  private itemEntryService;
11
12
  private itemRequestService;
@@ -24,9 +25,12 @@ export declare class CollectionEntry {
24
25
  deferred: any;
25
26
  promise: Promise<CollectionEntry>;
26
27
  reloadQueued: boolean;
27
- constructor(collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService, itemType: ItemType, options: any);
28
+ constructor(collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService, itemType: ItemType, options: any);
28
29
  isDeferred(): boolean;
29
- resolve(itemEntryCompound: any): CollectionEntry;
30
+ resolve(itemEntryCompound: {
31
+ columns: ColumnSet;
32
+ items: ItemEntry[];
33
+ }): CollectionEntry;
30
34
  isLocal(): boolean;
31
35
  matchParent(itemType: any, itemId: any): boolean;
32
36
  forEach(callback: (itemEntry: ItemEntry) => void): void;
@@ -40,7 +44,8 @@ export declare class CollectionEntry {
40
44
  extendQuery(callback: any): any;
41
45
  extend(queryCallback: any, collectionResource: any, callOnAdd?: any, updateInitial?: any): Promise<any>;
42
46
  queueReload(): void;
43
- updateColumns(columnExpansion: any): void;
47
+ expandColumns(columnExpansion: ColumnExpansion): void;
48
+ expandRequestColumns(requestColumns: RequestColumns): void;
44
49
  getAddedItems(returnItemIds?: boolean): (number | ItemEntry)[];
45
50
  getRemovedItems(returnItemIds?: boolean): (number | ItemEntry)[];
46
51
  getUpdatedItems(): ItemEntry[];
@@ -1,4 +1,4 @@
1
- import { CollectionMatcher, RequestColumnExpansion } from '../classes';
1
+ import { CollectionMatcher, ColumnSet, RequestColumnExpansion } from '../classes';
2
2
  import { ENTRY_STATUS } from '../constants';
3
3
  import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
4
4
  export declare type EntryParent = {
@@ -20,6 +20,9 @@ export declare type ItemType = string;
20
20
  export declare type ItemEntryEntryStatusMap = {
21
21
  [entryStatus: string]: ItemEntry[];
22
22
  };
23
+ export declare type ItemEntryParentIdMap = {
24
+ [parentId: number]: ItemEntry[];
25
+ };
23
26
  export declare type ItemIdConversionMap = {
24
27
  [itemType: string]: {
25
28
  [itemId: number]: number;
@@ -50,6 +53,10 @@ export declare type ResponseColumnMap = {
50
53
  };
51
54
  };
52
55
  export declare type LocalColumn = object;
56
+ export declare type ColumnExpansionResult = {
57
+ merged: ColumnSet;
58
+ difference: ColumnSet;
59
+ };
53
60
  export declare type ApiResponse = any;
54
61
  export interface ApiTemplate {
55
62
  fields: any;