@rentman/rm-core 1.1.19 → 1.2.0
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 +264 -254
- package/dist/dist/classes/ColumnExpansion.d.ts +3 -6
- package/dist/dist/classes/ColumnSet.d.ts +5 -3
- package/dist/dist/classes/ItemAdministrator.d.ts +1 -1
- package/dist/dist/classes/ItemHandler.d.ts +21 -13
- package/dist/dist/classes/SocketMessageHandler.d.ts +1 -1
- package/dist/dist/factories/CollectionEntryFactory.d.ts +5 -3
- package/dist/dist/factories/CollectionResourceFactory.d.ts +4 -6
- package/dist/dist/factories/ColumnExpansionFactory.d.ts +1 -3
- package/dist/dist/factories/ItemEntryFactory.d.ts +4 -4
- package/dist/dist/factories/TemplateFactory.d.ts +10 -0
- package/dist/dist/factories/index.d.ts +1 -0
- package/dist/dist/interfaces/PromiseInterface.d.ts +1 -1
- package/dist/dist/main.d.ts +26 -25
- package/dist/dist/models/CollectionEditResource.d.ts +4 -9
- package/dist/dist/models/CollectionEntry.d.ts +6 -3
- package/dist/dist/models/CollectionResource.d.ts +3 -1
- package/dist/dist/models/CollectionViewResource.d.ts +2 -1
- package/dist/dist/models/Template.d.ts +11 -0
- package/dist/dist/models/index.d.ts +1 -0
- package/dist/dist/types/ItemTypesCollection.d.ts +0 -9
- package/dist/rm-core.js +452 -325
- package/dist/rm-core.min.js +1 -1
- package/package.json +35 -35
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { ApiResponseProcessor, BatchStatus, ColumnExpansion, ColumnHandler, ColumnSet, ColumnUtil, ItemCache, ItemEntryService, KeyService } from '../classes';
|
|
1
|
+
import { ApiFormatter, ApiResponseProcessor, BatchStatus, ColumnExpansion, ColumnHandler, ColumnInfo, ColumnSet, ColumnUtil, ItemCache, ItemEntryService, KeyService } from '../classes';
|
|
2
2
|
import { ENTRY_STATUS } from '../constants';
|
|
3
|
-
import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ItemCacheFactory, ItemEntryFactory } from '../factories';
|
|
3
|
+
import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ItemCacheFactory, ItemEntryFactory, TemplateFactory } from '../factories';
|
|
4
4
|
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
5
|
-
import { ItemEntry } from '../models';
|
|
6
|
-
import { ApiResponse,
|
|
5
|
+
import { ItemEntry, Template } from '../models';
|
|
6
|
+
import { ApiResponse, EntryStatus, FieldMap, ItemId, ItemIdConversionMap, ItemType, RequestColumns, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
|
|
7
7
|
export declare class ItemHandler {
|
|
8
|
+
private apiFormatter;
|
|
8
9
|
private apiRequestService;
|
|
9
|
-
private errorHandler;
|
|
10
|
-
private itemEntryFactory;
|
|
11
|
-
private columnHandler;
|
|
12
|
-
private itemCacheFactory;
|
|
13
10
|
private batchStatusFactory;
|
|
14
11
|
private columnExpansionFactory;
|
|
12
|
+
private columnHandler;
|
|
15
13
|
private columnSetFactory;
|
|
14
|
+
private columnUtil;
|
|
15
|
+
private errorHandler;
|
|
16
|
+
private itemCacheFactory;
|
|
17
|
+
private itemEntryFactory;
|
|
16
18
|
private itemEntryService;
|
|
17
19
|
private keyService;
|
|
18
20
|
private promiseService;
|
|
19
|
-
private
|
|
21
|
+
private templateFactory;
|
|
20
22
|
entries: ItemCache;
|
|
21
|
-
templates:
|
|
22
|
-
|
|
23
|
+
templates: {
|
|
24
|
+
[itemType: string]: Template;
|
|
25
|
+
};
|
|
26
|
+
constructor(apiFormatter: ApiFormatter, apiRequestService: ApiRequestServiceInterface, batchStatusFactory: BatchStatusFactory, columnExpansionFactory: ColumnExpansionFactory, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, columnUtil: ColumnUtil, errorHandler: ErrorHandlerInterface, itemCacheFactory: ItemCacheFactory, itemEntryFactory: ItemEntryFactory, itemEntryService: ItemEntryService, keyService: KeyService, promiseService: PromiseInterface, templateFactory: TemplateFactory);
|
|
23
27
|
fetchItem(itemType: ItemType, itemId: ItemId, options: any, localItemCache: ItemCache): Promise<ItemEntry | TemplateResponseItemEntryMap>;
|
|
24
28
|
/**
|
|
25
29
|
*
|
|
@@ -31,7 +35,7 @@ export declare class ItemHandler {
|
|
|
31
35
|
* For every itemid find the status of the ItemEntry and resolve the promises so the result is
|
|
32
36
|
* a usable ItemEntry
|
|
33
37
|
*/
|
|
34
|
-
fetchItems(itemType:
|
|
38
|
+
fetchItems(itemType: ItemType, itemIds: ItemId[], options: any, localItemCache: ItemCache): Promise<ItemEntry[]>;
|
|
35
39
|
resolveCached(itemEntry: ItemEntry, status: ENTRY_STATUS, options: any): Promise<ItemEntry>;
|
|
36
40
|
resolveLocal(itemEntry: ItemEntry, parent: any, template: any, localItemCache: ItemCache): TemplateResponseItemEntryMap;
|
|
37
41
|
resolveExpansion(itemEntry: ItemEntry, columnExpansion: ColumnExpansion, response: ApiResponse): ItemEntry;
|
|
@@ -41,7 +45,7 @@ export declare class ItemHandler {
|
|
|
41
45
|
initial: FieldMap;
|
|
42
46
|
derived: FieldMap;
|
|
43
47
|
} | null;
|
|
44
|
-
fetchTemplate(itemType: string, templateOptions?: any, templateColumns?: any): Promise<
|
|
48
|
+
fetchTemplate(itemType: string, templateOptions?: any, templateColumns?: any): Promise<Template>;
|
|
45
49
|
getEntryStatus(itemType: ItemType, itemId: ItemId, options: any, localItemCache: ItemCache): EntryStatus<ItemEntry>;
|
|
46
50
|
isColumnSuperset(itemEntry: ItemEntry, columns: RequestColumns): any;
|
|
47
51
|
getCachedEntryStatus(itemEntry: ItemEntry, options: any): ENTRY_STATUS;
|
|
@@ -59,6 +63,10 @@ export declare class ItemHandler {
|
|
|
59
63
|
batchResolve(itemType: ItemType, batchStatus: BatchStatus, requestColumns: RequestColumns, resolved: any, localItemCache: ItemCache): ItemEntry[] | Promise<any>;
|
|
60
64
|
createLocalEntries(parentType: ItemType, localParentId: ItemId, template: any, itemIdConversion: ItemIdConversionMap, localItemCache: ItemCache, excludeItemTypes?: ItemType[]): TemplateResponseLinkedItemEntryMap[];
|
|
61
65
|
fetchTitle(itemType: ItemType, itemId: ItemId, deferRequest: boolean | undefined, localItemCache: ItemCache): Promise<any>;
|
|
66
|
+
resolveDerivedValues(itemEntries: ItemEntry[], columns: ColumnInfo[], localItemCache: ItemCache): Promise<ItemEntry[]>;
|
|
67
|
+
private getDefaultValuesByColumn(itemEntries, rootColumn);
|
|
68
|
+
private getItemIdByColumn(itemEntry, column);
|
|
69
|
+
private fetchDerivedValuesByColumn(itemEntries, rootColumn, localItemCache);
|
|
62
70
|
requestItem(itemEntry: ItemEntry, requestColumns?: RequestColumns): Promise<ApiResponseProcessor>;
|
|
63
71
|
requestItems(itemType: ItemType, itemIds: ItemId[], columns: RequestColumns): Promise<ApiResponseProcessor>;
|
|
64
72
|
}
|
|
@@ -27,6 +27,6 @@ export declare class SocketMessageHandler {
|
|
|
27
27
|
handleResponse(itemType: any, requestIds: any, requestColumns: any, response: any, collectionMap: any): {};
|
|
28
28
|
handleCreate(message: any): Promise<any> | undefined;
|
|
29
29
|
handleUpdate(message: any): Promise<any>;
|
|
30
|
-
handleDelete(message: any): Promise<
|
|
30
|
+
handleDelete(message: any): Promise<{}>;
|
|
31
31
|
handleLinkMove(): void;
|
|
32
32
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { CollectionEntryService, ItemEntryService, ItemRequestService, KeyService, QueryService } from '../classes';
|
|
2
|
-
import { ColumnSetFactory } from '../factories';
|
|
1
|
+
import { CollectionEntryService, ItemEntryService, ItemHandler, ItemRequestService, KeyService, QueryService } from '../classes';
|
|
2
|
+
import { ColumnSetFactory, ItemEntryFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry } from '../models/';
|
|
5
5
|
export declare class CollectionEntryFactory {
|
|
6
6
|
collectionEntryService: CollectionEntryService;
|
|
7
7
|
columnSetFactory: ColumnSetFactory;
|
|
8
8
|
errorHandler: ErrorHandlerInterface;
|
|
9
|
+
itemEntryFactory: ItemEntryFactory;
|
|
9
10
|
itemEntryService: ItemEntryService;
|
|
11
|
+
itemHandler: ItemHandler;
|
|
10
12
|
itemRequestService: ItemRequestService;
|
|
11
13
|
keyService: KeyService;
|
|
12
14
|
promiseService: PromiseInterface;
|
|
13
15
|
queryService: QueryService;
|
|
14
|
-
constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService);
|
|
16
|
+
constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryFactory: ItemEntryFactory, itemEntryService: ItemEntryService, itemHandler: ItemHandler, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService);
|
|
15
17
|
construct(itemType: string, options: any): CollectionEntry;
|
|
16
18
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { CollectionResourceService,
|
|
2
|
-
import { ChangesProcessorFactory,
|
|
1
|
+
import { CollectionResourceService, KeyService, LocalCache } from '../classes';
|
|
2
|
+
import { ChangesProcessorFactory, ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry, CollectionResource } from '../models';
|
|
5
5
|
export declare class CollectionResourceFactory {
|
|
6
6
|
errorHandler: ErrorHandlerInterface;
|
|
7
|
-
itemEntryFactory: ItemEntryFactory;
|
|
8
|
-
itemHandler: ItemHandler;
|
|
9
7
|
itemResourceFactory: ItemResourceFactory;
|
|
10
8
|
changesProcessorFactory: ChangesProcessorFactory;
|
|
11
9
|
keyService: KeyService;
|
|
12
10
|
promiseService: PromiseInterface;
|
|
13
11
|
collectionResourceService: CollectionResourceService;
|
|
14
|
-
constructor(errorHandler: ErrorHandlerInterface,
|
|
15
|
-
construct(collectionEntry: CollectionEntry, options: any): CollectionResource;
|
|
12
|
+
constructor(errorHandler: ErrorHandlerInterface, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseInterface, collectionResourceService: CollectionResourceService);
|
|
13
|
+
construct(collectionEntry: CollectionEntry, options: any, localCache: LocalCache): CollectionResource;
|
|
16
14
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ColumnExpansion, ColumnUtil } from '../classes';
|
|
2
|
-
import { ColumnSetFactory } from '../factories';
|
|
3
2
|
export declare class ColumnExpansionFactory {
|
|
4
|
-
private columnSetFactory;
|
|
5
3
|
private columnUtil;
|
|
6
|
-
constructor(
|
|
4
|
+
constructor(columnUtil: ColumnUtil);
|
|
7
5
|
construct(itemType: string, requestColumns: any | boolean, responseColumns: any): ColumnExpansion;
|
|
8
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiFormatter, ColumnSet, ItemEntryService, KeyService } from '../classes';
|
|
2
2
|
import { ColumnSetFactory } from '../factories';
|
|
3
3
|
import { AuthInterface, PromiseInterface } from '../interfaces';
|
|
4
|
-
import { ItemEntry } from '../models';
|
|
4
|
+
import { ItemEntry, Template } from '../models';
|
|
5
5
|
import { EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, RequestColumns } from '../types';
|
|
6
6
|
export declare class ItemEntryFactory {
|
|
7
7
|
authInterface: AuthInterface;
|
|
@@ -11,9 +11,9 @@ export declare class ItemEntryFactory {
|
|
|
11
11
|
keyService: KeyService;
|
|
12
12
|
promiseService: PromiseInterface;
|
|
13
13
|
constructor(authInterface: AuthInterface, apiFormatter: ApiFormatter, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, keyService: KeyService, promiseService: PromiseInterface);
|
|
14
|
-
constructStub(itemType: ItemType, itemId: ItemId, columnSetStub:
|
|
15
|
-
constructLocalLinked(itemType: ItemType,
|
|
16
|
-
constructLocal(itemId: ItemId, template:
|
|
14
|
+
constructStub(itemType: ItemType, itemId: ItemId, columnSetStub: ColumnSet): ItemEntry;
|
|
15
|
+
constructLocalLinked(itemType: ItemType, itemId: ItemId, initial: FieldMap, parent: EntryParentNull, columnSet: ColumnSet, conversionMap: ItemIdConversionMap): ItemEntry;
|
|
16
|
+
constructLocal(itemId: ItemId, template: Template, modified: FieldMap, derived: FieldMap, parent?: EntryParentNull, columnSet?: ColumnSet, conversionMap?: any): ItemEntry;
|
|
17
17
|
constructDeferred(itemType: ItemType, itemId: ItemId, requestColumns: RequestColumns, deferRequest: boolean): ItemEntry;
|
|
18
18
|
construct(itemId: ItemId, initial: FieldMap, derived: FieldMap, columnInfo: ColumnSet): ItemEntry;
|
|
19
19
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnUtil } from '../classes';
|
|
2
|
+
import { ColumnSetFactory } from '../factories';
|
|
3
|
+
import { Template } from '../models';
|
|
4
|
+
import { ApiResponse, ItemType, ResponseColumnMap } from '../types';
|
|
5
|
+
export declare class TemplateFactory {
|
|
6
|
+
columnSetFactory: ColumnSetFactory;
|
|
7
|
+
columnUtil: ColumnUtil;
|
|
8
|
+
constructor(columnSetFactory: ColumnSetFactory, columnUtil: ColumnUtil);
|
|
9
|
+
construct(itemType: ItemType, response: ApiResponse, additionalColumns: ResponseColumnMap): Template;
|
|
10
|
+
}
|
package/dist/dist/main.d.ts
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { ApiFormatter, ApiRequestService, CollectionEntryService, CollectionHandler, CollectionResourceService, ColumnCache, ColumnHandler, ColumnUtil, ItemAdministrator, ItemEntryService, ItemHandler, ItemRequestService, ItemResourceService, KeyService, LockService, QueryService, SocketMessageHandler } from './classes';
|
|
2
|
-
import { ApiResponseProcessorFactory, BatchStatusFactory, ChangesCompilationFactory, ChangesProcessorFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnInfoFactory, ColumnSetFactory, CreateRequestFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, LocalCacheFactory, ModuleChangesCompilationFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory } from './factories';
|
|
2
|
+
import { ApiResponseProcessorFactory, BatchStatusFactory, ChangesCompilationFactory, ChangesProcessorFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnInfoFactory, ColumnSetFactory, CreateRequestFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, LocalCacheFactory, ModuleChangesCompilationFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory, TemplateFactory } from './factories';
|
|
3
3
|
import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from './interfaces';
|
|
4
4
|
export declare class RmCore {
|
|
5
5
|
version: string;
|
|
6
6
|
noop: typeof noop;
|
|
7
7
|
apiFormatter: ApiFormatter;
|
|
8
|
-
|
|
9
|
-
queryService: QueryService;
|
|
10
|
-
columnUtil: ColumnUtil;
|
|
8
|
+
apiRequestService: ApiRequestService;
|
|
11
9
|
apiResponseProcessorFactory: ApiResponseProcessorFactory;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
itemRequestService: ItemRequestService;
|
|
16
|
-
columnCache: ColumnCache;
|
|
17
|
-
columnHandler: ColumnHandler;
|
|
18
|
-
itemEntryFactory: ItemEntryFactory;
|
|
19
|
-
collectionEntryFactory: CollectionEntryFactory;
|
|
10
|
+
batchStatusFactory: BatchStatusFactory;
|
|
11
|
+
changesCompilationFactory: ChangesCompilationFactory;
|
|
12
|
+
changesProcessorFactory: ChangesProcessorFactory;
|
|
20
13
|
collectionCacheFactory: CollectionCacheFactory;
|
|
21
|
-
|
|
22
|
-
itemHandler: ItemHandler;
|
|
23
|
-
collectionHandler: CollectionHandler;
|
|
24
|
-
lockService: LockService;
|
|
14
|
+
collectionEntryFactory: CollectionEntryFactory;
|
|
25
15
|
collectionEntryService: CollectionEntryService;
|
|
26
|
-
|
|
16
|
+
collectionHandler: CollectionHandler;
|
|
17
|
+
collectionMatcherFactory: CollectionMatcherFactory;
|
|
27
18
|
collectionResourceFactory: CollectionResourceFactory;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
31
|
-
changesCompilationFactory: ChangesCompilationFactory;
|
|
32
|
-
changesProcessorFactory: ChangesProcessorFactory;
|
|
19
|
+
collectionResourceService: CollectionResourceService;
|
|
20
|
+
columnCache: ColumnCache;
|
|
33
21
|
columnExpansionFactory: ColumnExpansionFactory;
|
|
34
|
-
|
|
22
|
+
columnHandler: ColumnHandler;
|
|
35
23
|
columnInfoFactory: ColumnInfoFactory;
|
|
24
|
+
columnSetFactory: ColumnSetFactory;
|
|
25
|
+
columnUtil: ColumnUtil;
|
|
36
26
|
createRequestFactory: CreateRequestFactory;
|
|
27
|
+
itemAdministrator: ItemAdministrator;
|
|
28
|
+
itemCacheFactory: ItemCacheFactory;
|
|
29
|
+
itemEntryFactory: ItemEntryFactory;
|
|
30
|
+
itemEntryService: ItemEntryService;
|
|
31
|
+
itemHandler: ItemHandler;
|
|
32
|
+
itemRequestService: ItemRequestService;
|
|
37
33
|
itemResourceFactory: ItemResourceFactory;
|
|
34
|
+
itemResourceService: ItemResourceService;
|
|
35
|
+
keyService: KeyService;
|
|
38
36
|
localCacheFactory: LocalCacheFactory;
|
|
37
|
+
lockService: LockService;
|
|
39
38
|
moduleChangesCompilationFactory: ModuleChangesCompilationFactory;
|
|
39
|
+
queryMatcherFactory: QueryMatcherFactory;
|
|
40
40
|
queryParserFactory: QueryParserFactory;
|
|
41
|
-
|
|
41
|
+
queryService: QueryService;
|
|
42
|
+
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
42
43
|
socketMessageHandler: SocketMessageHandler;
|
|
43
|
-
|
|
44
|
+
templateFactory: TemplateFactory;
|
|
44
45
|
constructor(externalApiRequestService: ApiRequestServiceInterface, localCacheManager: LocalCacheManagerInterface, authInterface: AuthInterface, errorHandlerInterface: ErrorHandlerInterface, promiseInterface: PromiseInterface);
|
|
45
46
|
}
|
|
46
47
|
export declare function noop(): void;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
1
2
|
import { CollectionResourceFactory } from '../factories';
|
|
2
3
|
import { CollectionEntry, CollectionResource, ItemResource } from '../models';
|
|
3
4
|
import { FieldMap, ItemId, ItemIdConversionMap } from '../types';
|
|
4
5
|
export declare class CollectionEditResource extends CollectionResource {
|
|
5
6
|
private factory;
|
|
6
|
-
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: any);
|
|
7
|
+
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: any, localCache: LocalCache);
|
|
7
8
|
save(): Promise<ItemIdConversionMap>;
|
|
8
9
|
moveItems(idArray: ItemId[], destination: CollectionResource, enableCallbacks?: boolean): ItemResource[];
|
|
9
10
|
removeItems(idArray: ItemId[], callOnRemove?: boolean): Promise<ItemResource[]>;
|
|
10
11
|
removeItem(itemId: ItemId, callOnRemove?: boolean): Promise<ItemResource>;
|
|
11
|
-
addItems(valuesArray:
|
|
12
|
-
|
|
13
|
-
derived: FieldMap;
|
|
14
|
-
}>, callOnAdd?: boolean, callOnActivate?: boolean): Promise<any>;
|
|
15
|
-
addItem(values: {
|
|
16
|
-
fields: FieldMap;
|
|
17
|
-
derived: FieldMap;
|
|
18
|
-
}, callOnAdd?: boolean, callOnActivate?: boolean): Promise<any>;
|
|
12
|
+
addItems(valuesArray: FieldMap[], callOnAdd?: boolean, callOnActivate?: boolean): Promise<ItemResource[]>;
|
|
13
|
+
addItem(values: FieldMap, callOnAdd?: boolean, callOnActivate?: boolean): Promise<ItemResource>;
|
|
19
14
|
clear(enableCallbacks: any): ItemResource[] | null;
|
|
20
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ColumnExpansion, ColumnInfo, ColumnSet } from '../classes';
|
|
1
|
+
import { ColumnExpansion, ColumnInfo, ColumnSet, ItemCache } from '../classes';
|
|
2
2
|
import { CollectionEntryFactory } from '../factories';
|
|
3
3
|
import { CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
4
|
-
import { EntryParentNull, ItemId, ItemIdConversionMap, ItemType, RequestColumns } from '../types';
|
|
4
|
+
import { EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, RequestColumns } from '../types';
|
|
5
5
|
export declare class CollectionEntry {
|
|
6
6
|
private factory;
|
|
7
7
|
itemType: ItemType;
|
|
@@ -9,6 +9,7 @@ export declare class CollectionEntry {
|
|
|
9
9
|
id: number;
|
|
10
10
|
query: any;
|
|
11
11
|
columns: ColumnSet;
|
|
12
|
+
templateColumns: ColumnSet | null;
|
|
12
13
|
parent: EntryParentNull;
|
|
13
14
|
initial: ItemEntry[];
|
|
14
15
|
items: ItemEntry[];
|
|
@@ -19,7 +20,7 @@ export declare class CollectionEntry {
|
|
|
19
20
|
hasEditResources: boolean;
|
|
20
21
|
hasItemEditResources: boolean;
|
|
21
22
|
constructor(factory: CollectionEntryFactory, itemType: ItemType, options: any);
|
|
22
|
-
defer():
|
|
23
|
+
defer(): this;
|
|
23
24
|
isDeferred(): boolean;
|
|
24
25
|
_resolve(): this;
|
|
25
26
|
resolve(itemEntryCompound: {
|
|
@@ -31,6 +32,8 @@ export declare class CollectionEntry {
|
|
|
31
32
|
forEach(callback: (itemEntry: ItemEntry) => void): void;
|
|
32
33
|
getItemById(itemId: any): ItemEntry | undefined;
|
|
33
34
|
getIdArray(accumulator?: ItemId[]): ItemId[];
|
|
35
|
+
createItems(valuesArray: FieldMap[]): Promise<ItemEntry[]>;
|
|
36
|
+
resolveDerivedValues(itemEntries: ItemEntry[], localItemCache: ItemCache): Promise<ItemEntry[]>;
|
|
34
37
|
addItems(itemEntries: ItemEntry[], resultResource?: CollectionResource | null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): ItemResource[] | null;
|
|
35
38
|
private handleAddedItemCallbacks(entriesAddedToInitial, entriesAddedToModified, resultResource?, callOnAdd?, callOnActivate?);
|
|
36
39
|
removeItems(idArray: ItemId[], resultResource?: CollectionResource | null, updateInitial?: boolean, callOnRemove?: boolean): ItemResource[] | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
1
2
|
import { ItemResourceFactory } from '../factories';
|
|
2
3
|
import { ItemEntry, ItemResource } from '../models';
|
|
3
4
|
import { ItemResourceItemIdMap } from '../types';
|
|
@@ -6,10 +7,11 @@ export declare class CollectionResource {
|
|
|
6
7
|
private itemResourceFactory;
|
|
7
8
|
entry: CollectionEntry;
|
|
8
9
|
options: any;
|
|
10
|
+
localCache: LocalCache;
|
|
9
11
|
items: ItemResource[];
|
|
10
12
|
itemIdMap: ItemResourceItemIdMap;
|
|
11
13
|
columns: any;
|
|
12
|
-
constructor(itemResourceFactory: ItemResourceFactory, entry: CollectionEntry, options: any);
|
|
14
|
+
constructor(itemResourceFactory: ItemResourceFactory, entry: CollectionEntry, options: any, localCache: LocalCache);
|
|
13
15
|
getItemById(itemId: number): ItemResource;
|
|
14
16
|
rebuildMap(): void;
|
|
15
17
|
addItemResources(itemEntries: ItemEntry[]): ItemResource[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
1
2
|
import { ItemResourceFactory } from '../factories';
|
|
2
3
|
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
4
|
export declare class CollectionViewResource extends CollectionResource {
|
|
4
|
-
constructor(itemResourceFactory: ItemResourceFactory, collectionEntry: CollectionEntry, options: any);
|
|
5
|
+
constructor(itemResourceFactory: ItemResourceFactory, collectionEntry: CollectionEntry, options: any, localCache: LocalCache);
|
|
5
6
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnSet } from '../classes';
|
|
2
|
+
import { TemplateFactory } from '../factories';
|
|
3
|
+
import { ApiResponse, FieldMap, ItemType, ResponseColumnMap } from '../types';
|
|
4
|
+
export declare class Template {
|
|
5
|
+
itemType: ItemType;
|
|
6
|
+
response: ApiResponse;
|
|
7
|
+
fields: FieldMap;
|
|
8
|
+
responseColumns: ResponseColumnMap;
|
|
9
|
+
columns: ColumnSet;
|
|
10
|
+
constructor(factory: TemplateFactory, itemType: ItemType, response: ApiResponse, additionalColumns: ResponseColumnMap);
|
|
11
|
+
}
|
|
@@ -94,12 +94,6 @@ export declare type ColumnExpansionResult = {
|
|
|
94
94
|
difference: ColumnSet;
|
|
95
95
|
};
|
|
96
96
|
export declare type ApiResponse = ApiResponseProcessor;
|
|
97
|
-
export interface ApiTemplate {
|
|
98
|
-
fields: any;
|
|
99
|
-
columns: any;
|
|
100
|
-
response: ApiResponse;
|
|
101
|
-
responseColumns: ResponseColumnMap;
|
|
102
|
-
}
|
|
103
97
|
export declare type TemplateResponseItemEntryMap = {
|
|
104
98
|
main: ItemEntry;
|
|
105
99
|
linked: TemplateResponseLinkedItemEntryMap[];
|
|
@@ -108,9 +102,6 @@ export declare type TemplateResponseLinkedItemEntryMap = {
|
|
|
108
102
|
itemType: string;
|
|
109
103
|
itemEntries: ItemEntry[];
|
|
110
104
|
};
|
|
111
|
-
export declare type ApiTemplateItemTypeMap = {
|
|
112
|
-
[itemType: string]: ApiTemplate;
|
|
113
|
-
};
|
|
114
105
|
export declare type ItemTypeMap = {
|
|
115
106
|
[itemType: string]: any;
|
|
116
107
|
};
|