@rentman/rm-core 1.3.8-1 → 1.4.0-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 +9 -0
- package/dist/rm-core.js +3456 -3280
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/ApiFormatter.d.ts +2 -2
- package/dist/src/classes/BatchStatus.d.ts +19 -13
- package/dist/src/classes/CollectionHandler.d.ts +19 -20
- package/dist/src/classes/ColumnExpansion.d.ts +7 -3
- package/dist/src/classes/ColumnInfo.d.ts +5 -3
- package/dist/src/classes/ColumnSet.d.ts +3 -0
- package/dist/src/classes/ColumnUtil.d.ts +4 -4
- package/dist/src/classes/ItemAdministrator.d.ts +9 -4
- package/dist/src/classes/ItemCache.d.ts +2 -1
- package/dist/src/classes/ItemEntryService.d.ts +1 -0
- package/dist/src/classes/ItemHandler.d.ts +4 -3
- package/dist/src/classes/RequestColumnExpansion.d.ts +7 -4
- package/dist/src/classes/SocketMessageHandler.d.ts +5 -1
- package/dist/src/factories/BatchStatusFactory.d.ts +1 -2
- package/dist/src/factories/ColumnExpansionFactory.d.ts +5 -2
- package/dist/src/models/ItemEntry.d.ts +4 -2
- package/dist/src/types/ItemTypesCollection.d.ts +24 -13
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="moment" />
|
|
2
2
|
import * as moment from 'moment';
|
|
3
|
+
import { ColumnInfo } from '../classes';
|
|
3
4
|
import { FieldMap } from '../types';
|
|
4
|
-
import { ColumnInfo } from './ColumnInfo';
|
|
5
5
|
export declare class ApiFormatter {
|
|
6
6
|
MOMENT_INVALID: string;
|
|
7
7
|
SERVER_DATETIME_FORMAT: string;
|
|
@@ -30,7 +30,7 @@ export declare class ApiFormatter {
|
|
|
30
30
|
formatRequestDate(value: any): any;
|
|
31
31
|
formatRequestDuration(value: any): any;
|
|
32
32
|
formatRequestColor(value: any): any;
|
|
33
|
-
getDefaultValue(columnType: any): false | 0 | "" | moment.Moment | moment.Duration | "
|
|
33
|
+
getDefaultValue(columnType: any): false | "" | 0 | "0" | moment.Moment | moment.Duration | "#000000" | null;
|
|
34
34
|
isDefaultValue(columnType: any, value: any): boolean;
|
|
35
35
|
clone(columnType: any, value: any): any;
|
|
36
36
|
getCloneFunction(columnType: any): (date: any) => any;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { ENTRY_STATUS } from '../constants';
|
|
2
2
|
import { PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare class BatchStatus {
|
|
3
|
+
import { EntryStatus, EntryStatusMap, ItemId, PromiseInterface } from '../types';
|
|
4
|
+
export declare class BatchStatus<T> {
|
|
6
5
|
private promiseService;
|
|
7
|
-
getItemId: (itemEntry:
|
|
8
|
-
getPromise: (itemEntry:
|
|
9
|
-
readonly
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
getItemId: (itemEntry: T) => ItemId;
|
|
7
|
+
getPromise: (itemEntry: T) => PromiseInterface<T>;
|
|
8
|
+
readonly requestStatus: ENTRY_STATUS[];
|
|
9
|
+
readonly remoteExpandStatus: ENTRY_STATUS[];
|
|
10
|
+
entries: EntryStatusMap<T>;
|
|
11
|
+
constructor(promiseService: PromiseLibraryInterface, getItemId: (itemEntry: T) => ItemId, getPromise: (itemEntry: T) => PromiseInterface<T>);
|
|
12
|
+
add(entryStatus: EntryStatus<T>): void;
|
|
13
13
|
hasEntries(statusArray: ENTRY_STATUS[]): boolean;
|
|
14
14
|
hasRequests(): boolean;
|
|
15
|
-
forEachEntry(statusArray: ENTRY_STATUS[], callback: (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
forEachEntry(statusArray: ENTRY_STATUS[], callback: (entry: T, itemId: ItemId) => void): void;
|
|
16
|
+
reduceEntries<U>(statusArray: ENTRY_STATUS[], callback: (entry: T, itemId: ItemId, destination: U) => void, destination: U): U;
|
|
17
|
+
reduceAllEntries<U>(callback: (entry: T, itemId: ItemId, destination: U) => void, destination: U): U;
|
|
18
|
+
getPromises(): PromiseInterface<T[]>;
|
|
19
|
+
getItemIds(statusArray: ENTRY_STATUS[]): ItemId[];
|
|
20
|
+
getRequestIds(): ItemId[];
|
|
21
|
+
getArray(statusArray?: ENTRY_STATUS[]): T[];
|
|
22
|
+
getMap(): {
|
|
23
|
+
[itemId: string]: T;
|
|
24
|
+
};
|
|
19
25
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { PromiseInterface } from '../';
|
|
2
|
-
import { CollectionCache, CollectionEntryService, CollectionMatcher, ColumnExpansion, ColumnHandler, ColumnSet, ItemCache, ItemRequestService, KeyService, QueryService } from '../classes';
|
|
2
|
+
import { BatchStatus, CollectionCache, CollectionEntryService, CollectionMatcher, ColumnExpansion, ColumnHandler, ColumnSet, ItemCache, ItemHandler, ItemRequestService, KeyService, QueryService } from '../classes';
|
|
3
3
|
import { ENTRY_STATUS } from '../constants';
|
|
4
|
-
import { CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, ColumnSetFactory, QueryParserFactory } from '../factories';
|
|
4
|
+
import { BatchStatusFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, ColumnSetFactory, QueryParserFactory } from '../factories';
|
|
5
5
|
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
6
6
|
import { CollectionEntry, CollectionResource, ItemResource } from '../models';
|
|
7
|
-
import { ApiRequestColumn,
|
|
7
|
+
import { ApiRequestColumn, CollectionEntryParentIdMap, EntryStatus, ItemEntryParentIdMap, ItemId, ItemResourceItemIdMap, ItemType } from '../types';
|
|
8
8
|
export declare class CollectionHandler {
|
|
9
|
-
private
|
|
10
|
-
private itemRequestService;
|
|
11
|
-
private columnHandler;
|
|
12
|
-
private columnSetFactory;
|
|
13
|
-
private collectionEntryFactory;
|
|
9
|
+
private batchStatusFactory;
|
|
14
10
|
private collectionCacheFactory;
|
|
15
|
-
private
|
|
11
|
+
private collectionEntryFactory;
|
|
16
12
|
private collectionEntryService;
|
|
13
|
+
private collectionMatcherFactory;
|
|
14
|
+
private columnHandler;
|
|
15
|
+
private columnSetFactory;
|
|
16
|
+
private errorHandler;
|
|
17
|
+
private itemHandler;
|
|
18
|
+
private itemRequestService;
|
|
17
19
|
private keyService;
|
|
18
20
|
private promiseService;
|
|
21
|
+
private queryParserFactory;
|
|
19
22
|
private queryService;
|
|
20
|
-
private collectionMatcherFactory;
|
|
21
23
|
entries: CollectionCache;
|
|
22
|
-
constructor(
|
|
23
|
-
getPromises(statusResource: CollectionEntryBatchStatusMap): CollectionEntry[];
|
|
24
|
-
getRequestIds(statusResource: any): number[];
|
|
24
|
+
constructor(batchStatusFactory: BatchStatusFactory, collectionCacheFactory: CollectionCacheFactory, collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, collectionMatcherFactory: CollectionMatcherFactory, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseLibraryInterface, queryParserFactory: QueryParserFactory, queryService: QueryService);
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated, use collectionMatcherFactory
|
|
27
27
|
*/
|
|
@@ -37,8 +37,12 @@ export declare class CollectionHandler {
|
|
|
37
37
|
addToCollections(collectionMap: any, updateInitial: boolean, resultResource?: CollectionResource | null): ItemResource[];
|
|
38
38
|
batchExpand(parentType: ItemType, itemType: ItemType, collections: CollectionResource[], newColumns: ApiRequestColumn[]): PromiseInterface<CollectionResource[]>;
|
|
39
39
|
batchExtend(parentType: string, itemType: string, options: any, queryCallback: any, collections: CollectionResource[], returnAllItems?: boolean): PromiseInterface<ItemResourceItemIdMap>;
|
|
40
|
-
batchFetch(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache):
|
|
41
|
-
|
|
40
|
+
batchFetch(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): Promise<CollectionEntryParentIdMap>;
|
|
41
|
+
handleBatchResponse(batchStatus: BatchStatus<CollectionEntry>, itemEntryCompound: {
|
|
42
|
+
columns: ColumnSet;
|
|
43
|
+
columnExpansion?: ColumnExpansion;
|
|
44
|
+
items?: ItemEntryParentIdMap;
|
|
45
|
+
}, localItems: ItemEntryParentIdMap): CollectionEntryParentIdMap;
|
|
42
46
|
fetch(itemType: ItemType, options: any, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): PromiseInterface<CollectionEntry>;
|
|
43
47
|
getCachedEntryStatus(collectionEntry: CollectionEntry, options: any): ENTRY_STATUS;
|
|
44
48
|
getDeferredEntryStatus(itemType: ItemType, options: any, query: any, deferredEntries: CollectionCache): {
|
|
@@ -46,11 +50,6 @@ export declare class CollectionHandler {
|
|
|
46
50
|
isDeferred: boolean;
|
|
47
51
|
};
|
|
48
52
|
getEntryStatus(itemType: ItemType, options: any, localEntries: CollectionCache, deferredEntries: CollectionCache): EntryStatus<CollectionEntry>;
|
|
49
|
-
handleBatchResponse(statusResource: any, itemEntryCompound: {
|
|
50
|
-
columns: ColumnSet;
|
|
51
|
-
columnExpansion?: ColumnExpansion;
|
|
52
|
-
items?: ItemEntryParentIdMap;
|
|
53
|
-
}, itemCache: ItemCache): CollectionEntryParentIdMap;
|
|
54
53
|
resolveLocal(collectionEntry: CollectionEntry, itemCache: ItemCache): PromiseInterface<CollectionEntry>;
|
|
55
54
|
resolveRemote(collectionEntry: CollectionEntry, itemCache: ItemCache): PromiseInterface<CollectionEntry>;
|
|
56
55
|
isLocal(options: any): boolean;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { ColumnSet, ColumnUtil } from '../classes';
|
|
1
|
+
import { ColumnInfo, ColumnSet, ColumnUtil } from '../classes';
|
|
2
2
|
import { ApiRequestColumn, ApiRequestColumns, ColumnExpansionResult, ItemType, ResponseColumnMap } from '../types';
|
|
3
3
|
export declare class ColumnExpansion {
|
|
4
|
+
private columnInfoFactory;
|
|
4
5
|
private columnUtil;
|
|
5
6
|
itemType: ItemType;
|
|
6
7
|
responseColumns: ResponseColumnMap;
|
|
7
8
|
expansionMap: {
|
|
8
|
-
[columnSetId: number]: ColumnExpansionResult;
|
|
9
|
+
[columnSetId: number]: ColumnExpansionResult | null;
|
|
9
10
|
};
|
|
10
11
|
requestColumnsTrue: boolean;
|
|
11
12
|
requestColumns: ApiRequestColumn[];
|
|
12
|
-
constructor(columnUtil: ColumnUtil, itemType: ItemType, requestColumns: ApiRequestColumns, responseColumns: ResponseColumnMap);
|
|
13
|
+
constructor(columnInfoFactory: any, columnUtil: ColumnUtil, itemType: ItemType, requestColumns: ApiRequestColumns, responseColumns: ResponseColumnMap);
|
|
13
14
|
run(columnSet: ColumnSet): ColumnExpansionResult | null;
|
|
15
|
+
aggregateRootColumns(): ColumnInfo[];
|
|
16
|
+
private expandRootColumnMap(columns, destination);
|
|
17
|
+
private processRootColumnMap(rootColumnMap, parent);
|
|
14
18
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { ItemType, ResponseColumn } from '../types';
|
|
1
2
|
export declare class ColumnInfo {
|
|
2
|
-
readonly apiColumn:
|
|
3
|
+
readonly apiColumn: ResponseColumn;
|
|
3
4
|
readonly parent: ColumnInfo | null;
|
|
4
5
|
id: string;
|
|
5
6
|
level: number;
|
|
6
7
|
path: string;
|
|
7
8
|
tailPath: string;
|
|
8
|
-
itemType:
|
|
9
|
+
itemType: ItemType | null;
|
|
9
10
|
children: ColumnInfo[];
|
|
10
11
|
isLeaf: boolean;
|
|
11
|
-
constructor(apiColumn:
|
|
12
|
+
constructor(apiColumn: ResponseColumn, parent?: ColumnInfo | null);
|
|
13
|
+
setChildren(itemType: ItemType, children: ColumnInfo[]): this;
|
|
12
14
|
}
|
|
@@ -39,5 +39,8 @@ export declare class ColumnSet {
|
|
|
39
39
|
private processRequestColumns(responseColumns, includeIdColumn);
|
|
40
40
|
private getRequestColumnInfo(requestColumn, itemType, parent, responseColumns);
|
|
41
41
|
private getColumnInfo(columnId, itemType, children, parent, responseColumns);
|
|
42
|
+
private getColumnSetExpansion(requestColumns, responseColumns);
|
|
43
|
+
private getMergedColumnSet(columnSetExpansion, requestColumnsTrue);
|
|
44
|
+
merge(columnSet: ColumnSet): ColumnSet;
|
|
42
45
|
expand(requestColumns: ApiRequestColumns, requestColumnsTrue: boolean, responseColumns: ResponseColumnMap): ColumnExpansionResult;
|
|
43
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiRequestColumn, ApiRequestColumns } from '../types';
|
|
1
|
+
import { ApiRequestColumn, ApiRequestColumns, ResponseColumnMap } from '../types';
|
|
2
2
|
export declare class ColumnUtil {
|
|
3
3
|
constructor();
|
|
4
4
|
getColumnPath(columns: any, renderAs: any): string;
|
|
@@ -54,9 +54,9 @@ export declare class ColumnUtil {
|
|
|
54
54
|
* @param {object} second
|
|
55
55
|
* @returns {object} An object containing a 'merged' and a 'difference' property.
|
|
56
56
|
*/
|
|
57
|
-
mergeResponseColumns(first:
|
|
58
|
-
merged:
|
|
59
|
-
difference:
|
|
57
|
+
mergeResponseColumns(first: ResponseColumnMap, second: ResponseColumnMap): {
|
|
58
|
+
merged: ResponseColumnMap;
|
|
59
|
+
difference: ResponseColumnMap;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* @param {array} first
|
|
@@ -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, PromiseLibraryInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
5
|
-
import { CollectionResourceParentIdMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemOptions,
|
|
5
|
+
import { CollectionResourceParentIdMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemOptions, ItemResourcesItemTypeMap, ItemType, LinkedItemEntryMap, LocalCacheCallbackCondition, OnSaveCallback, PromiseInterface, TemplateItemResourceMap } from '../types';
|
|
6
6
|
export declare class ItemAdministrator {
|
|
7
7
|
private apiRequestService;
|
|
8
8
|
private authInterface;
|
|
@@ -23,8 +23,8 @@ export declare class ItemAdministrator {
|
|
|
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: PromiseLibraryInterface, queryService: QueryService);
|
|
25
25
|
invalidateCache(): void;
|
|
26
|
-
getCollectionMatcher(itemEntries: ItemEntry[], addToTab
|
|
27
|
-
fetchTitle(itemType:
|
|
26
|
+
getCollectionMatcher(itemEntries: ItemEntry[], addToTab?: boolean): CollectionMatcher;
|
|
27
|
+
fetchTitle(itemType: ItemType, itemId: ItemId, deferRequest?: boolean): PromiseInterface<string>;
|
|
28
28
|
getItemById(itemType: ItemType, itemId: ItemId, options: ItemOptions, isRoot?: boolean): PromiseInterface<ItemResource>;
|
|
29
29
|
getItemsById(itemType: string, itemIds: number[], options: any): PromiseInterface<ItemResource[]>;
|
|
30
30
|
getItemsByQuery(itemType: string, query: any, options: any): PromiseInterface<ItemResource[]>;
|
|
@@ -89,7 +89,12 @@ export declare class ItemAdministrator {
|
|
|
89
89
|
addSingleItem(itemEntry: ItemEntry, options: ItemOptions, isRoot?: boolean, localCache?: LocalCache): ItemResource;
|
|
90
90
|
addSingleItems(itemEntries: ItemEntry[], options: ItemOptions): ItemResource[];
|
|
91
91
|
addCollection(collectionEntry: CollectionEntry, options: any): CollectionResource;
|
|
92
|
-
|
|
92
|
+
private createItemResources(itemType, itemEntries, options, localCache);
|
|
93
|
+
processLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptions, addToCollections?: boolean): ItemResourcesItemTypeMap;
|
|
94
|
+
expandProcessLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptions): Promise<ItemResourcesItemTypeMap>;
|
|
95
|
+
private constructOnItemsExpanded(itemType, itemEntries, itemOptions, localCache);
|
|
96
|
+
private expandAddToCollections(itemType, itemEntries, resultCollectionResource?, localCache?);
|
|
97
|
+
private getColumnSuperset(collectionEntries);
|
|
93
98
|
getLocalCache(): LocalCache;
|
|
94
99
|
resetLocalCache(): void;
|
|
95
100
|
addToCollections(itemEntries: ItemEntry[], resultCollectionResource?: CollectionResource): ItemResource[] | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryMatcherFactory } from '../factories';
|
|
2
2
|
import { ItemEntry } from '../models';
|
|
3
|
-
import { ItemEntryMap, ItemId, ItemType } from '../types';
|
|
3
|
+
import { ItemEntryMap, ItemEntryParentIdMap, ItemId, ItemType } from '../types';
|
|
4
4
|
export declare class ItemCache {
|
|
5
5
|
private queryMatcherFactory;
|
|
6
6
|
entries: ItemEntryMap;
|
|
@@ -10,6 +10,7 @@ export declare class ItemCache {
|
|
|
10
10
|
getByQuery(itemType: ItemType, query: any): ItemEntry[];
|
|
11
11
|
getLocalByQuery(itemType: ItemType, query: any): ItemEntry[];
|
|
12
12
|
getByParent(parentType: ItemType, parentId: ItemId, itemType: ItemType): ItemEntry[];
|
|
13
|
+
batchGetLocalByParent(parentType: ItemType, parentIds: ItemId[], itemType: ItemType, additionalQuery: any): ItemEntryParentIdMap;
|
|
13
14
|
forEach(callback: (itemEntry: ItemEntry) => void): void;
|
|
14
15
|
toArray(): ItemEntry[];
|
|
15
16
|
add(itemEntry: ItemEntry): ItemEntry;
|
|
@@ -20,4 +20,5 @@ export declare class ItemEntryService {
|
|
|
20
20
|
getFullName(firstName: any, infix: any, lastName: any): any;
|
|
21
21
|
getTitleField(itemType: any): "serienummer" | "nummer" | "friendlyname" | "naamintern" | "omschrijving" | "code" | "naam" | "displayname";
|
|
22
22
|
getLocalDefaultValues(): FieldMap;
|
|
23
|
+
hasLocalDefaultValue(columnId: string): boolean;
|
|
23
24
|
}
|
|
@@ -3,7 +3,7 @@ import { ENTRY_STATUS } from '../constants';
|
|
|
3
3
|
import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ItemCacheFactory, ItemEntryFactory, TemplateFactory } from '../factories';
|
|
4
4
|
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
5
5
|
import { ItemEntry, Template } from '../models';
|
|
6
|
-
import { ApiResponse, EntryStatus, FieldMap, ItemId, ItemIdConversionMap, ItemOptions, ItemType, PromiseInterface, ApiRequestColumns, TemplateItemEntryMap,
|
|
6
|
+
import { ApiResponse, EntryStatus, FieldMap, ItemId, ItemIdConversionMap, ItemOptions, ItemType, PromiseInterface, ApiRequestColumns, TemplateItemEntryMap, LinkedItemEntryMap } from '../types';
|
|
7
7
|
export declare class ItemHandler {
|
|
8
8
|
private apiFormatter;
|
|
9
9
|
private apiRequestService;
|
|
@@ -61,12 +61,13 @@ export declare class ItemHandler {
|
|
|
61
61
|
* for every type of entry status there is in this batch request make sure the entries get resolved.
|
|
62
62
|
* then return a array of the resulting ItemEntryArray
|
|
63
63
|
*/
|
|
64
|
-
batchResolve(itemType: ItemType, batchStatus: BatchStatus
|
|
64
|
+
batchResolve(itemType: ItemType, batchStatus: BatchStatus<ItemEntry>, requestColumns: ApiRequestColumns, resolved: {
|
|
65
65
|
entries: ItemEntry[];
|
|
66
66
|
requests?: ApiResponseProcessor;
|
|
67
67
|
}): ItemEntry[] | PromiseInterface<any>;
|
|
68
|
-
createLocalEntries(parentType: ItemType, localParentId: ItemId, template: any, itemIdConversion: ItemIdConversionMap, localItemCache: ItemCache, excludeItemTypes?: ItemType[]): TemplateLinkedItemEntryMap[];
|
|
69
68
|
fetchTitle(itemType: ItemType, itemId: ItemId, deferRequest: boolean | undefined, localItemCache: ItemCache): PromiseInterface<string>;
|
|
69
|
+
createLocalEntries(parentType: ItemType, localParentId: ItemId, template: Template, itemIdConversion: ItemIdConversionMap, localItemCache: ItemCache, filterItemEntry?: (itemEntry: ItemEntry) => boolean): LinkedItemEntryMap[];
|
|
70
|
+
expandLocalEntries(itemType: ItemType, itemEntries: ItemEntry[], columnSet: ColumnSet, localItemCache: ItemCache): Promise<ItemEntry[]>;
|
|
70
71
|
resolveDerivedValues(itemEntries: ItemEntry[], columns: ColumnInfo[], localItemCache: ItemCache): PromiseInterface<ItemEntry[]>;
|
|
71
72
|
private getDefaultValuesByColumn(itemEntries, rootColumn);
|
|
72
73
|
private getItemIdByColumn(itemEntry, column);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { ColumnUtil } from '
|
|
1
|
+
import { ColumnSet, ColumnUtil } from '../classes';
|
|
2
|
+
import { ApiRequestColumns } from '../types';
|
|
2
3
|
export declare class RequestColumnExpansion {
|
|
3
4
|
private columnUtil;
|
|
4
5
|
private columns;
|
|
5
|
-
private
|
|
6
|
+
private columnSetIdMap;
|
|
6
7
|
constructor(columnUtil: ColumnUtil);
|
|
7
|
-
expand(
|
|
8
|
-
get(): {
|
|
8
|
+
expand(columnSet: ColumnSet): void;
|
|
9
|
+
get(): {
|
|
10
|
+
[itemType: string]: ApiRequestColumns;
|
|
11
|
+
};
|
|
9
12
|
}
|
|
@@ -20,7 +20,11 @@ export declare class SocketMessageHandler {
|
|
|
20
20
|
[itemId: number]: CollectionMatchResult;
|
|
21
21
|
};
|
|
22
22
|
groupByCollectionId(itemType: any, collectionMap: any): GroupedExtendedCollectionMatchResult;
|
|
23
|
-
getRequestColumns(itemType: any, collectionMap: any): {
|
|
23
|
+
getRequestColumns(itemType: any, collectionMap: any): {
|
|
24
|
+
[itemType: string]: true | (string | {
|
|
25
|
+
[columnId: string]: (string | any)[];
|
|
26
|
+
})[];
|
|
27
|
+
};
|
|
24
28
|
deferEntry(itemEntry: any): any;
|
|
25
29
|
processMessage(body: any): PromiseInterface<GroupedExtendedCollectionMatchResult>;
|
|
26
30
|
processFunctionChangesResolve(body: any): Promise<any> | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BatchStatus } from '../classes';
|
|
2
2
|
import { PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import { ItemEntry } from '../models';
|
|
4
3
|
import { ItemId, PromiseInterface } from '../types';
|
|
5
4
|
export declare class BatchStatusFactory {
|
|
6
5
|
private promiseService;
|
|
7
6
|
constructor(promiseService: PromiseLibraryInterface);
|
|
8
|
-
construct(getItemId: (
|
|
7
|
+
construct<T>(getItemId: (entry: T) => ItemId, getPromise: (entry: T) => PromiseInterface<T>): BatchStatus<T>;
|
|
9
8
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ColumnExpansion, ColumnUtil } from '../classes';
|
|
2
|
+
import { ColumnInfoFactory } from '../factories';
|
|
3
|
+
import { ApiRequestColumns, ItemType, ResponseColumnMap } from '../types';
|
|
2
4
|
export declare class ColumnExpansionFactory {
|
|
5
|
+
private columnInfoFactory;
|
|
3
6
|
private columnUtil;
|
|
4
|
-
constructor(columnUtil: ColumnUtil);
|
|
5
|
-
construct(itemType:
|
|
7
|
+
constructor(columnInfoFactory: ColumnInfoFactory, columnUtil: ColumnUtil);
|
|
8
|
+
construct(itemType: ItemType, requestColumns: ApiRequestColumns, responseColumns: ResponseColumnMap): ColumnExpansion;
|
|
6
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColumnSet } from '../classes';
|
|
2
2
|
import { ItemEntryFactory } from '../factories';
|
|
3
3
|
import { ItemResource } from '../models';
|
|
4
|
-
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType
|
|
4
|
+
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType } from '../types';
|
|
5
5
|
export declare class ItemEntry {
|
|
6
6
|
private factory;
|
|
7
7
|
itemType: string;
|
|
@@ -31,12 +31,14 @@ export declare class ItemEntry {
|
|
|
31
31
|
deactivateResources(): this;
|
|
32
32
|
getFields(): FieldMap;
|
|
33
33
|
expand(main: FieldMap, derived: FieldMap, columnExpansionResult: ColumnExpansionResult): this;
|
|
34
|
+
expandLocal(columnExpansionResult: ColumnExpansionResult): this;
|
|
35
|
+
private setLocalValues(fields, columns);
|
|
34
36
|
/**
|
|
35
37
|
* This function assumes the initial, modified, derived properties are already set. It will update the values
|
|
36
38
|
* themselves to preserve references in existing item resources.
|
|
37
39
|
*/
|
|
38
40
|
updateFields(fields: FieldMap, derived?: FieldMap | null, overwrite?: boolean): this;
|
|
39
|
-
|
|
41
|
+
private updateItemValues(fields, itemColumns, conversionMap);
|
|
40
42
|
updateItemFields(conversionMap: ItemIdConversionMap, columns?: ColumnSet): this;
|
|
41
43
|
formatRequest(): FieldMap;
|
|
42
44
|
setDisplayName(): this;
|
|
@@ -39,8 +39,8 @@ export declare type LocalCacheCallbacks<T> = {
|
|
|
39
39
|
export declare type ItemResourceItemIdMap = {
|
|
40
40
|
[itemId: number]: ItemResource;
|
|
41
41
|
};
|
|
42
|
-
export declare type
|
|
43
|
-
[itemType: string]: ItemResource;
|
|
42
|
+
export declare type ItemResourcesItemTypeMap = {
|
|
43
|
+
[itemType: string]: ItemResource[];
|
|
44
44
|
};
|
|
45
45
|
export declare type ItemId = number;
|
|
46
46
|
export declare type ItemType = string;
|
|
@@ -49,8 +49,13 @@ export declare type ItemEntryMap = {
|
|
|
49
49
|
[itemId: number]: ItemEntry;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
export declare type
|
|
53
|
-
|
|
52
|
+
export declare type LinkedItemEntryMap = {
|
|
53
|
+
itemType: string;
|
|
54
|
+
itemEntries: ItemEntry[];
|
|
55
|
+
columnSet: ColumnSet;
|
|
56
|
+
};
|
|
57
|
+
export declare type EntryStatusMap<T> = {
|
|
58
|
+
[entryStatus: string]: T[];
|
|
54
59
|
};
|
|
55
60
|
export declare type ItemEntryParentIdMap = {
|
|
56
61
|
[parentId: number]: ItemEntry[];
|
|
@@ -65,9 +70,6 @@ export declare type CreateRequestParameterMap = {
|
|
|
65
70
|
[itemId: number]: any;
|
|
66
71
|
};
|
|
67
72
|
};
|
|
68
|
-
export declare type CollectionEntryBatchStatusMap = {
|
|
69
|
-
[status: string]: CollectionEntryParentIdMap;
|
|
70
|
-
};
|
|
71
73
|
export declare type CollectionEntryParentIdMap = {
|
|
72
74
|
[parentId: number]: CollectionEntry;
|
|
73
75
|
};
|
|
@@ -97,18 +99,27 @@ export declare type ColumnExpansionResult = {
|
|
|
97
99
|
merged: ColumnSet;
|
|
98
100
|
difference: ColumnSet;
|
|
99
101
|
};
|
|
102
|
+
export declare type ColumnSetExpansion = {
|
|
103
|
+
request: {
|
|
104
|
+
merged: ApiRequestColumns;
|
|
105
|
+
difference: ApiRequestColumns;
|
|
106
|
+
};
|
|
107
|
+
response: ResponseColumnMap;
|
|
108
|
+
};
|
|
109
|
+
export declare type RootColumnMap = {
|
|
110
|
+
[columnId: string]: {
|
|
111
|
+
apiColumn: ResponseColumn;
|
|
112
|
+
children: RootColumnMap;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
100
115
|
export declare type ApiResponse = ApiResponseProcessor;
|
|
101
116
|
export declare type TemplateItemResourceMap = {
|
|
102
117
|
main: ItemResource;
|
|
103
|
-
linked:
|
|
118
|
+
linked: ItemResourcesItemTypeMap;
|
|
104
119
|
};
|
|
105
120
|
export declare type TemplateItemEntryMap = {
|
|
106
121
|
main: ItemEntry;
|
|
107
|
-
linked:
|
|
108
|
-
};
|
|
109
|
-
export declare type TemplateLinkedItemEntryMap = {
|
|
110
|
-
itemType: string;
|
|
111
|
-
itemEntries: ItemEntry[];
|
|
122
|
+
linked: LinkedItemEntryMap[];
|
|
112
123
|
};
|
|
113
124
|
export declare type ItemTypeMap = {
|
|
114
125
|
[itemType: string]: any;
|