@rentman/rm-core 1.9.0 → 2.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 +7 -0
- package/dist/rm-core.js +7445 -6441
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/ApiFormatter.d.ts +25 -8
- package/dist/src/classes/ApiResponseProcessor.d.ts +10 -20
- package/dist/src/classes/ChangesCompilation.d.ts +14 -31
- package/dist/src/classes/ChangesDelta.d.ts +42 -0
- package/dist/src/classes/ChangesDeltaBase.d.ts +33 -0
- package/dist/src/classes/ChangesProcessor.d.ts +30 -16
- package/dist/src/classes/CollectionCache.d.ts +7 -2
- package/dist/src/classes/CollectionEntryService.d.ts +3 -0
- package/dist/src/classes/CollectionMatcher.d.ts +8 -41
- package/dist/src/classes/CollectionMatcherBase.d.ts +26 -0
- package/dist/src/classes/ColumnExpansion.d.ts +4 -0
- package/dist/src/classes/ColumnHandler.d.ts +3 -3
- package/dist/src/classes/ColumnUtil.d.ts +12 -1
- package/dist/src/classes/CreateRequest.d.ts +7 -8
- package/dist/src/classes/InternalChangesDelta.d.ts +38 -0
- package/dist/src/classes/ItemCache.d.ts +7 -1
- package/dist/src/classes/ItemEntryService.d.ts +23 -5
- package/dist/src/classes/LockService.d.ts +9 -9
- package/dist/src/classes/ModuleChangesCompilation.d.ts +4 -7
- package/dist/src/classes/QueryColumnExtractor.d.ts +20 -0
- package/dist/src/classes/QueryParser.d.ts +18 -27
- package/dist/src/classes/QueryParserBase.d.ts +29 -0
- package/dist/src/classes/QueryService.d.ts +1 -1
- package/dist/src/classes/RequestBuffer.d.ts +25 -0
- package/dist/src/classes/RequestBufferManager.d.ts +31 -0
- package/dist/src/classes/RequestColumnExpansion.d.ts +1 -0
- package/dist/src/classes/SocketMessageHandler.d.ts +19 -30
- package/dist/src/classes/TemplateCache.d.ts +63 -0
- package/dist/src/classes/cache/AbstractCache.d.ts +122 -0
- package/dist/src/classes/cache/CollectionHandlerBase.d.ts +64 -0
- package/dist/src/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -0
- package/dist/src/classes/cache/ItemHandlerBase.d.ts +86 -0
- package/dist/src/classes/cache/server/ServerCache.d.ts +87 -0
- package/dist/src/classes/cache/server/ServerCollectionHandler.d.ts +43 -0
- package/dist/src/classes/cache/server/ServerItemHandler.d.ts +49 -0
- package/dist/src/classes/cache/transaction/TransactionCache.d.ts +423 -0
- package/dist/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +72 -0
- package/dist/src/classes/cache/transaction/TransactionEventHandler.d.ts +19 -0
- package/dist/src/classes/cache/transaction/TransactionItemHandler.d.ts +113 -0
- package/dist/src/classes/index.d.ts +13 -7
- package/dist/src/constants.d.ts +0 -11
- package/dist/src/core.d.ts +12 -11
- package/dist/src/factories/ChangesCompilationFactory.d.ts +4 -8
- package/dist/src/factories/ChangesDeltaFactory.d.ts +9 -0
- package/dist/src/factories/ChangesProcessorFactory.d.ts +22 -0
- package/dist/src/factories/CollectionCacheFactory.d.ts +2 -1
- package/dist/src/factories/CollectionEntryFactory.d.ts +6 -18
- package/dist/src/factories/CollectionMatcherFactory.d.ts +3 -2
- package/dist/src/factories/CollectionResourceFactory.d.ts +11 -9
- package/dist/src/factories/ColumnSetFactory.d.ts +2 -0
- package/dist/src/factories/CreateRequestFactory.d.ts +7 -7
- package/dist/src/factories/ItemCacheFactory.d.ts +2 -1
- package/dist/src/factories/ItemEntryFactory.d.ts +3 -7
- package/dist/src/factories/ItemResourceFactory.d.ts +14 -10
- package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +3 -4
- package/dist/src/factories/TransactionCacheFactory.d.ts +55 -0
- package/dist/src/factories/index.d.ts +3 -2
- package/dist/src/interfaces/LinkTreeServiceInterface.d.ts +4 -0
- package/dist/src/interfaces/index.d.ts +1 -1
- package/dist/src/models/CollectionEditResource.d.ts +34 -11
- package/dist/src/models/CollectionEntry.d.ts +10 -70
- package/dist/src/models/CollectionEntryOptions.d.ts +1 -0
- package/dist/src/models/CollectionResource.d.ts +14 -14
- package/dist/src/models/CollectionResourceOptions.d.ts +6 -2
- package/dist/src/models/CollectionViewResource.d.ts +2 -2
- package/dist/src/models/EditResource.d.ts +8 -10
- package/dist/src/models/ItemEntry.d.ts +1 -58
- package/dist/src/models/ItemEntryOptions.d.ts +0 -1
- package/dist/src/models/ItemResource.d.ts +49 -16
- package/dist/src/models/LocalViewResource.d.ts +2 -2
- package/dist/src/models/RemoteViewResource.d.ts +2 -2
- package/dist/src/models/ViewResource.d.ts +2 -2
- package/dist/src/types/ItemTypesCollection.d.ts +81 -22
- package/package.json +1 -1
- package/dist/src/classes/BatchStatus.d.ts +0 -28
- package/dist/src/classes/CollectionHandler.d.ts +0 -54
- package/dist/src/classes/ItemAdministrator.d.ts +0 -228
- package/dist/src/classes/ItemHandler.d.ts +0 -60
- package/dist/src/classes/ItemRequestService.d.ts +0 -23
- package/dist/src/classes/LocalCache.d.ts +0 -112
- package/dist/src/classes/LocalCacheEventHandler.d.ts +0 -19
- package/dist/src/factories/BatchStatusFactory.d.ts +0 -9
- package/dist/src/factories/LocalCacheFactory.d.ts +0 -16
- package/dist/src/interfaces/LocalCacheManagerInterface.d.ts +0 -5
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { CollectionEntryOptions, CollectionViewResource, PromiseInterface } from '../';
|
|
2
|
-
import { BatchStatus, CollectionCache, CollectionEntryService, CollectionMatcher, ColumnExpansion, ColumnHandler, ColumnSet, ItemCache, ItemHandler, ItemRequestService, KeyService, QueryService } from '../classes';
|
|
3
|
-
import { BatchStatusFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, ColumnSetFactory, QueryParserFactory } from '../factories';
|
|
4
|
-
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
5
|
-
import { CollectionEntry, CollectionResource } from '../models';
|
|
6
|
-
import { ApiRequestColumn, CollectionEntryParentIdMap, CollectionResourceParentIdMap, ItemEntryParentIdMap, ItemId, ItemResourceItemIdMap, ItemType, QueryCallback } from '../types';
|
|
7
|
-
export declare class CollectionHandler {
|
|
8
|
-
private batchStatusFactory;
|
|
9
|
-
private collectionCacheFactory;
|
|
10
|
-
private collectionEntryFactory;
|
|
11
|
-
private collectionEntryService;
|
|
12
|
-
private collectionMatcherFactory;
|
|
13
|
-
private columnHandler;
|
|
14
|
-
private columnSetFactory;
|
|
15
|
-
private errorHandler;
|
|
16
|
-
private itemHandler;
|
|
17
|
-
private itemRequestService;
|
|
18
|
-
private keyService;
|
|
19
|
-
private promiseService;
|
|
20
|
-
private queryParserFactory;
|
|
21
|
-
private queryService;
|
|
22
|
-
entries: CollectionCache;
|
|
23
|
-
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);
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated use {@link CollectionMatcherFactory CollectionMatcherFactory}
|
|
26
|
-
*/
|
|
27
|
-
removeFromAndAddToCollections(collectionMap: any): void;
|
|
28
|
-
getCollectionMatcher<ItemTypeType extends ItemType>(): CollectionMatcher<ItemTypeType>;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated use {@link CollectionMatcherFactory CollectionMatcherFactory}
|
|
31
|
-
*/
|
|
32
|
-
removeFromCollections<T extends CollectionResource<any> = CollectionViewResource<any>>(collectionMap: any, updateInitial?: boolean, resultResource?: T | null): T['items'] | null;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated use {@link CollectionMatcherFactory CollectionMatcherFactory}
|
|
35
|
-
*/
|
|
36
|
-
addToCollections<T extends CollectionResource<any> = CollectionViewResource<any>>(collectionMap: any, updateInitial: boolean, resultResource?: T | null): T['items'];
|
|
37
|
-
batchExpand<ItemTypeType extends ItemType>(parentType: ItemType, itemType: ItemTypeType, collections: CollectionResourceParentIdMap, newColumns: ApiRequestColumn[]): PromiseInterface<CollectionResourceParentIdMap>;
|
|
38
|
-
batchExtend<T extends CollectionResourceParentIdMap>(parentType: ItemType, itemType: ItemType, options: CollectionEntryOptions, queryCallback: QueryCallback, collections: T, returnAllItems?: boolean, callOnAdd?: boolean): PromiseInterface<ItemResourceItemIdMap>;
|
|
39
|
-
batchFetch<ItemTypeType extends ItemType>(parentType: ItemType, parentIdArray: ItemId[] | (() => ItemId[]), itemType: ItemTypeType, options: CollectionEntryOptions, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): PromiseInterface<CollectionEntryParentIdMap<ItemTypeType>>;
|
|
40
|
-
handleBatchResponse<ItemTypeType extends ItemType>(batchStatus: BatchStatus<ItemTypeType, CollectionEntry<ItemTypeType>>, itemEntryCompound: {
|
|
41
|
-
columns: ColumnSet<ItemTypeType>;
|
|
42
|
-
columnExpansion?: ColumnExpansion<ItemTypeType>;
|
|
43
|
-
items?: ItemEntryParentIdMap<ItemTypeType>;
|
|
44
|
-
}, localItems: ItemEntryParentIdMap<ItemTypeType>): CollectionEntryParentIdMap<ItemTypeType>;
|
|
45
|
-
fetch<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionEntryOptions, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): PromiseInterface<CollectionEntry<ItemTypeType>>;
|
|
46
|
-
private resolveCached;
|
|
47
|
-
private getCachedEntryStatus;
|
|
48
|
-
private getDeferredEntryStatus;
|
|
49
|
-
private getEntryStatus;
|
|
50
|
-
resolveLocal<T extends CollectionEntry<any>>(collectionEntry: T, itemCache: ItemCache): PromiseInterface<T>;
|
|
51
|
-
resolveRemote<T extends CollectionEntry<any>>(collectionEntry: T, itemCache: ItemCache): PromiseInterface<T>;
|
|
52
|
-
isLocal(options: any): boolean;
|
|
53
|
-
private expandLocalItemEntries;
|
|
54
|
-
}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { CollectionCache, CollectionHandler, CollectionMatcher, ItemCache, ItemHandler, ItemRequestService, KeyService, LocalCache, LocalCacheCallbackCondition, LocalCacheCallbackType, ModuleChangesCompilationResult, QueryService } from '../classes';
|
|
2
|
-
import { CollectionMatcherFactory, ColumnSetFactory, ModuleChangesCompilationFactory } from '../factories';
|
|
3
|
-
import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, ItemResourceOptionsInterface, LocalViewResource, RemoteViewResource } from '../models';
|
|
5
|
-
import { ApiQuery, CollectionDefinition, CollectionOptionsInterface, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemOptionsInterface, ItemResourcesItemTypeMap, ItemType, LinkCollectionDefinition, LinkedItemEntryMap, PromiseInterface } from '../types';
|
|
6
|
-
declare type EditResourceLinks<ItemTypeType extends ItemType> = {
|
|
7
|
-
main: EditResource<ItemTypeType>;
|
|
8
|
-
linked: ItemResourcesItemTypeMap;
|
|
9
|
-
};
|
|
10
|
-
export declare class ItemAdministrator {
|
|
11
|
-
private apiRequestService;
|
|
12
|
-
private authInterface;
|
|
13
|
-
private collectionHandler;
|
|
14
|
-
private collectionMatcherFactory;
|
|
15
|
-
private columnSetFactory;
|
|
16
|
-
private errorHandler;
|
|
17
|
-
private itemHandler;
|
|
18
|
-
private itemRequestService;
|
|
19
|
-
private keyService;
|
|
20
|
-
private localCacheManager;
|
|
21
|
-
private moduleChangesCompilationFactory;
|
|
22
|
-
private promiseInterface;
|
|
23
|
-
private queryService;
|
|
24
|
-
constructor(apiRequestService: ApiRequestServiceInterface, authInterface: AuthInterface, collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemRequestService: ItemRequestService, keyService: KeyService, localCacheManager: LocalCacheManagerInterface, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, promiseInterface: PromiseLibraryInterface, queryService: QueryService);
|
|
25
|
-
invalidateCache(): void;
|
|
26
|
-
getCollectionMatcher<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, addToTab?: boolean, callOnAdd?: boolean): CollectionMatcher<ItemTypeType>;
|
|
27
|
-
fetchTitle(itemType: ItemType, itemId: ItemId, deferRequest?: boolean): PromiseInterface<string>;
|
|
28
|
-
getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface & {
|
|
29
|
-
edit: true;
|
|
30
|
-
}, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
|
|
31
|
-
getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface & {
|
|
32
|
-
remote: true;
|
|
33
|
-
}, isRoot?: boolean): PromiseInterface<RemoteViewResource<ItemTypeType>>;
|
|
34
|
-
getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource<ItemTypeType>>;
|
|
35
|
-
getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface & {
|
|
36
|
-
edit: true;
|
|
37
|
-
}): PromiseInterface<Array<EditResource<ItemTypeType>>>;
|
|
38
|
-
getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface & {
|
|
39
|
-
remote: true;
|
|
40
|
-
}): PromiseInterface<Array<RemoteViewResource<ItemTypeType>>>;
|
|
41
|
-
getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface): PromiseInterface<Array<LocalViewResource<ItemTypeType>>>;
|
|
42
|
-
getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface & {
|
|
43
|
-
edit: true;
|
|
44
|
-
}): PromiseInterface<Array<EditResource<ItemTypeType>>>;
|
|
45
|
-
getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface & {
|
|
46
|
-
remote: true;
|
|
47
|
-
}): PromiseInterface<Array<RemoteViewResource<ItemTypeType>>>;
|
|
48
|
-
getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface): PromiseInterface<Array<LocalViewResource<ItemTypeType>>>;
|
|
49
|
-
getNewResource<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
|
|
50
|
-
getNewResource<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
|
|
51
|
-
getNewResourceWithId<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
|
|
52
|
-
getNewResourceWithId<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
|
|
53
|
-
getDuplicateById<ItemTypeType extends ItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
|
|
54
|
-
getDuplicateById<ItemTypeType extends ItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
|
|
55
|
-
getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface & {
|
|
56
|
-
edit: true;
|
|
57
|
-
}, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
|
|
58
|
-
getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface & {
|
|
59
|
-
remote: true;
|
|
60
|
-
}, isRoot?: boolean): PromiseInterface<RemoteViewResource<ItemTypeType>>;
|
|
61
|
-
getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource<ItemTypeType>>;
|
|
62
|
-
getCollectionDef<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
|
|
63
|
-
getLinkCollectionsDef<ItemTypeType extends ItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
|
|
64
|
-
getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
65
|
-
editCollection: true;
|
|
66
|
-
editItems: true;
|
|
67
|
-
}): PromiseInterface<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>;
|
|
68
|
-
getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
69
|
-
editItems: true;
|
|
70
|
-
}): PromiseInterface<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>;
|
|
71
|
-
getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
72
|
-
editCollection: true;
|
|
73
|
-
remoteItems: true;
|
|
74
|
-
}): PromiseInterface<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
|
|
75
|
-
getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
76
|
-
remoteItems: true;
|
|
77
|
-
}): PromiseInterface<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
|
|
78
|
-
getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
79
|
-
editCollection: true;
|
|
80
|
-
}): PromiseInterface<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
|
|
81
|
-
getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
|
|
82
|
-
getCollectionFromDef<ItemTypeType extends ItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
|
|
83
|
-
getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
84
|
-
editItems: true;
|
|
85
|
-
editCollection: true;
|
|
86
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>>;
|
|
87
|
-
getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
88
|
-
remoteItems: true;
|
|
89
|
-
editCollection: true;
|
|
90
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
|
|
91
|
-
getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
92
|
-
editCollection: true;
|
|
93
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
|
|
94
|
-
getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
95
|
-
editItems: true;
|
|
96
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>>;
|
|
97
|
-
getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
98
|
-
remoteItems: true;
|
|
99
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
|
|
100
|
-
getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
|
|
101
|
-
getLinkCollectionsFromDef<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionResource<ItemTypeType>>>;
|
|
102
|
-
getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
103
|
-
editItems: true;
|
|
104
|
-
editCollection: true;
|
|
105
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>>;
|
|
106
|
-
getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
107
|
-
remoteItems: true;
|
|
108
|
-
editCollection: true;
|
|
109
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
|
|
110
|
-
getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
111
|
-
editCollection: true;
|
|
112
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
|
|
113
|
-
getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
114
|
-
editItems: true;
|
|
115
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>>;
|
|
116
|
-
getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
117
|
-
remoteItems: true;
|
|
118
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
|
|
119
|
-
getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
|
|
120
|
-
cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface & {
|
|
121
|
-
edit: true;
|
|
122
|
-
}): EditResource<ItemTypeType>;
|
|
123
|
-
cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface & {
|
|
124
|
-
remote: true;
|
|
125
|
-
}): RemoteViewResource<ItemTypeType>;
|
|
126
|
-
cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface): LocalViewResource<ItemTypeType>;
|
|
127
|
-
cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
128
|
-
editItems: true;
|
|
129
|
-
editCollection: true;
|
|
130
|
-
}, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
131
|
-
cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
132
|
-
remoteItems: true;
|
|
133
|
-
editCollection: true;
|
|
134
|
-
}, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
135
|
-
cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
136
|
-
editItems: true;
|
|
137
|
-
}, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
138
|
-
cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
139
|
-
remoteItems: true;
|
|
140
|
-
}, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
141
|
-
cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
|
|
142
|
-
editCollection: true;
|
|
143
|
-
}, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
144
|
-
cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType>, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
145
|
-
saveCurrentLocalCache(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): PromiseInterface<ItemIdConversionMap>;
|
|
146
|
-
getCurrentCollections(): CollectionCache;
|
|
147
|
-
getCurrentItems(): ItemCache;
|
|
148
|
-
getModuleChanges(localCache?: LocalCache): ModuleChangesCompilationResult;
|
|
149
|
-
addSingleItem<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemResourceOptionsInterface & {
|
|
150
|
-
edit: true;
|
|
151
|
-
}, isRoot?: boolean, localCache?: LocalCache): EditResource<ItemTypeType>;
|
|
152
|
-
addSingleItem<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemResourceOptionsInterface & {
|
|
153
|
-
remote: true;
|
|
154
|
-
}, isRoot?: boolean, localCache?: LocalCache): RemoteViewResource<ItemTypeType>;
|
|
155
|
-
addSingleItem<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemResourceOptionsInterface, isRoot?: boolean, localCache?: LocalCache): LocalViewResource<ItemTypeType>;
|
|
156
|
-
addSingleItems<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemResourceOptionsInterface & {
|
|
157
|
-
edit: true;
|
|
158
|
-
}): Array<EditResource<ItemTypeType>>;
|
|
159
|
-
addSingleItems<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemResourceOptionsInterface & {
|
|
160
|
-
remote: true;
|
|
161
|
-
}): Array<RemoteViewResource<ItemTypeType>>;
|
|
162
|
-
addSingleItems<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemResourceOptionsInterface): Array<LocalViewResource<ItemTypeType>>;
|
|
163
|
-
addCollection<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
164
|
-
editCollection: true;
|
|
165
|
-
editItems: true;
|
|
166
|
-
}): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
167
|
-
addCollection<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
168
|
-
editItems: true;
|
|
169
|
-
}): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
170
|
-
addCollection<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
171
|
-
editCollection: true;
|
|
172
|
-
remoteItems: true;
|
|
173
|
-
}): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
174
|
-
addCollection<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
175
|
-
remoteItems: true;
|
|
176
|
-
}): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
177
|
-
addCollection<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
178
|
-
editCollection: true;
|
|
179
|
-
}): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
180
|
-
addCollection<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptionsInterface<ItemTypeType>): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
181
|
-
private createItemResources;
|
|
182
|
-
processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: Array<LinkedItemEntryMap<ItemTypeType>>, options: ItemOptionsInterface & {
|
|
183
|
-
edit: true;
|
|
184
|
-
}, addToCollections?: boolean): ItemResourcesItemTypeMap<EditResource<ItemTypeType>>;
|
|
185
|
-
processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: Array<LinkedItemEntryMap<ItemTypeType>>, options: ItemOptionsInterface & {
|
|
186
|
-
remote: true;
|
|
187
|
-
}, addToCollections?: boolean): ItemResourcesItemTypeMap<RemoteViewResource<ItemTypeType>>;
|
|
188
|
-
processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: Array<LinkedItemEntryMap<ItemTypeType>>, options: ItemOptionsInterface, addToCollections?: boolean): ItemResourcesItemTypeMap<LocalViewResource<ItemTypeType>>;
|
|
189
|
-
expandProcessLinkedItems<ItemTypeType extends ItemType>(linkedEntries: Array<LinkedItemEntryMap<ItemTypeType>>): PromiseInterface<void>;
|
|
190
|
-
private constructOnItemsExpanded;
|
|
191
|
-
private expandAddToCollections;
|
|
192
|
-
private getColumnSuperset;
|
|
193
|
-
getLocalCache(): LocalCache;
|
|
194
|
-
addToCollections<ItemTypeType extends ItemType, T extends CollectionResource<ItemTypeType> = CollectionViewResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultCollectionResource: T, callOnAdd?: boolean): T['items'];
|
|
195
|
-
addToCollections<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultCollectionResource?: null, callOnAdd?: boolean): null;
|
|
196
|
-
removeFromCollections<ItemTypeType extends ItemType, T extends CollectionResource<ItemTypeType> = CollectionViewResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultCollectionResource: T): T['items'];
|
|
197
|
-
removeFromCollections<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultCollectionResource?: null): null;
|
|
198
|
-
saveLocal(itemResource: ItemResource<any>): PromiseInterface<ItemResource<any>>;
|
|
199
|
-
updateItemIdMap(collectionMap: any, conversionMap: ConversionMap): void;
|
|
200
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
201
|
-
editItems: true;
|
|
202
|
-
editCollection: true;
|
|
203
|
-
}): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
204
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
205
|
-
editItems: true;
|
|
206
|
-
}): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
207
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
208
|
-
remoteItems: true;
|
|
209
|
-
editCollection: true;
|
|
210
|
-
}): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
211
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
212
|
-
remoteItems: true;
|
|
213
|
-
}): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
214
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
215
|
-
editCollection: true;
|
|
216
|
-
}): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
217
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType>): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
218
|
-
createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemResourceOptionsInterface & {
|
|
219
|
-
edit: true;
|
|
220
|
-
}, isRoot?: boolean): EditResource<ItemTypeType>;
|
|
221
|
-
createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemResourceOptionsInterface & {
|
|
222
|
-
remote: true;
|
|
223
|
-
}, isRoot?: boolean): RemoteViewResource<ItemTypeType>;
|
|
224
|
-
createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemResourceOptionsInterface, isRoot?: boolean): LocalViewResource<ItemTypeType>;
|
|
225
|
-
onBeforeSave(key: string, callback: LocalCacheCallbackType['onBeforeSave'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
226
|
-
onSaveSuccess(key: string, callback: LocalCacheCallbackType['onSaveSuccess'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
227
|
-
}
|
|
228
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ApiFormatter, ApiResponseProcessor, BatchStatus, ColumnExpansion, ColumnHandler, ColumnInfo, ColumnSubsetCache, ColumnUtil, ItemCache, ItemEntryService, KeyService } from '../classes';
|
|
2
|
-
import { ENTRY_STATUS } from '../constants';
|
|
3
|
-
import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ColumnSubsetCacheFactory, ItemCacheFactory, ItemEntryFactory, TemplateFactory } from '../factories';
|
|
4
|
-
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
5
|
-
import { ItemEntry, ItemEntryOptions, Template } from '../models';
|
|
6
|
-
import { ApiRequestColumns, ApiResponse, EntryParentNull, EntryStatus, ItemId, ItemIdConversionMap, ItemType, LinkedItemEntryMap, PromiseInterface, ResponseColumnItemTypeMap, TemplateItemEntryMap } from '../types';
|
|
7
|
-
export declare class ItemHandler {
|
|
8
|
-
private apiFormatter;
|
|
9
|
-
private apiRequestService;
|
|
10
|
-
private batchStatusFactory;
|
|
11
|
-
private columnExpansionFactory;
|
|
12
|
-
private columnHandler;
|
|
13
|
-
private columnSetFactory;
|
|
14
|
-
private columnSubsetCacheFactory;
|
|
15
|
-
private columnUtil;
|
|
16
|
-
private errorHandler;
|
|
17
|
-
private itemCacheFactory;
|
|
18
|
-
private itemEntryFactory;
|
|
19
|
-
private itemEntryService;
|
|
20
|
-
private keyService;
|
|
21
|
-
private promiseService;
|
|
22
|
-
private templateFactory;
|
|
23
|
-
entries: ItemCache;
|
|
24
|
-
templates: {
|
|
25
|
-
[itemType: string]: Template<any>;
|
|
26
|
-
};
|
|
27
|
-
constructor(apiFormatter: ApiFormatter, apiRequestService: ApiRequestServiceInterface, batchStatusFactory: BatchStatusFactory, columnExpansionFactory: ColumnExpansionFactory, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, columnSubsetCacheFactory: ColumnSubsetCacheFactory, columnUtil: ColumnUtil, errorHandler: ErrorHandlerInterface, itemCacheFactory: ItemCacheFactory, itemEntryFactory: ItemEntryFactory, itemEntryService: ItemEntryService, keyService: KeyService, promiseService: PromiseLibraryInterface, templateFactory: TemplateFactory);
|
|
28
|
-
fetchItem<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemEntryOptions, localItemCache: ItemCache): PromiseInterface<ItemEntry<ItemTypeType>>;
|
|
29
|
-
fetchNewItem<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemEntryOptions, localItemCache: ItemCache): PromiseInterface<TemplateItemEntryMap<ItemTypeType>>;
|
|
30
|
-
createBatchStatus<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], parent: EntryParentNull, requestColumns: ApiRequestColumns, deferRequest: boolean, localItemCache: ItemCache, addToLocalCache: boolean): {
|
|
31
|
-
batchStatus: BatchStatus<ItemTypeType, ItemEntry<ItemTypeType>>;
|
|
32
|
-
success: boolean;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* @description
|
|
36
|
-
* For every {@link ItemEntry.itemId ItemId}, find the status of the {@link ItemEntry ItemEntry} and resolve the promises so the result is a usable {@link ItemEntry ItemEntry}
|
|
37
|
-
*/
|
|
38
|
-
fetchItems<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemEntryOptions, localItemCache: ItemCache): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
39
|
-
handleBatchResponse<ItemTypeType extends ItemType>(batchStatus: BatchStatus<ItemTypeType, ItemEntry<ItemTypeType>>, localItemCache: ItemCache, requestColumns: ApiRequestColumns, response: ApiResponseProcessor | null, responseColumns: ResponseColumnItemTypeMap | null, columnExpansion?: ColumnExpansion<ItemTypeType>): PromiseInterface<boolean>;
|
|
40
|
-
resolveCached<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, status: ENTRY_STATUS, options: ItemEntryOptions, localItemCache: ItemCache): PromiseInterface<ItemEntry<ItemTypeType>>;
|
|
41
|
-
private getColumnDifference;
|
|
42
|
-
resolveLocal<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, parent: EntryParentNull, template: Template<ItemTypeType>, localItemCache: ItemCache): TemplateItemEntryMap<ItemTypeType>;
|
|
43
|
-
resolveExpansion<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, columnExpansion: ColumnExpansion<ItemTypeType>, response: ApiResponse): ItemEntry<ItemTypeType>;
|
|
44
|
-
private clearItem;
|
|
45
|
-
private resolveRemote;
|
|
46
|
-
private resolveRemoteValues;
|
|
47
|
-
private getResponseFields;
|
|
48
|
-
fetchTemplate<ItemTypeType extends ItemType>(itemType: ItemTypeType, templateOptions?: any, templateColumns?: any): PromiseInterface<Template<ItemTypeType>>;
|
|
49
|
-
getEntryStatus<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, parent: EntryParentNull, deferRequest: boolean, localItemCache: ItemCache, addToLocalCache: boolean, columnSubsetCache: ColumnSubsetCache<ItemTypeType>): EntryStatus<ItemEntry<ItemTypeType>> | null;
|
|
50
|
-
getCachedEntryStatus<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, columnSubsetCache: ColumnSubsetCache<ItemTypeType>): ENTRY_STATUS;
|
|
51
|
-
fetchTitle(itemType: ItemType, itemId: ItemId, deferRequest: boolean | undefined, localItemCache: ItemCache): PromiseInterface<string>;
|
|
52
|
-
createLocalEntries(parentType: ItemType, localParentId: ItemId, template: Template<ItemType>, itemIdConversion: ItemIdConversionMap, localItemCache: ItemCache, filterItemEntry?: (itemEntry: ItemEntry<ItemType>) => boolean): Array<LinkedItemEntryMap<ItemType>>;
|
|
53
|
-
expandLocalEntries<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemEntries: Array<ItemEntry<ItemTypeType>>, requestColumns: ApiRequestColumns, responseColumns: ResponseColumnItemTypeMap, localItemCache: ItemCache): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
54
|
-
resolveDerivedValues<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, columns: Array<ColumnInfo<ItemTypeType>>, localItemCache: ItemCache): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
55
|
-
private setDefaultValuesByColumn;
|
|
56
|
-
private getItemIdByColumn;
|
|
57
|
-
private fetchDerivedValuesByColumn;
|
|
58
|
-
requestItem(itemEntry: ItemEntry<any>, requestColumns?: ApiRequestColumns): PromiseInterface<ApiResponseProcessor>;
|
|
59
|
-
requestItems(itemType: ItemType, itemIds: ItemId[], columns: ApiRequestColumns): PromiseInterface<ApiResponseProcessor>;
|
|
60
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ApiResponseProcessor, ColumnExpansion, ColumnSet, ItemHandler, QueryService } from '../classes';
|
|
2
|
-
import { ColumnExpansionFactory, ColumnSetFactory, ItemEntryFactory } from '../factories';
|
|
3
|
-
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
import { CollectionEntry, ItemEntry } from '../models';
|
|
5
|
-
import { ApiQuery, ApiRequestColumns, ApiResponse, EntryParentNull, ItemId, ItemType, PromiseInterface } from '../types';
|
|
6
|
-
export declare class ItemRequestService {
|
|
7
|
-
private apiRequestService;
|
|
8
|
-
private errorHandler;
|
|
9
|
-
private itemHandler;
|
|
10
|
-
private columnExpansionFactory;
|
|
11
|
-
private columnSetFactory;
|
|
12
|
-
private itemEntryFactory;
|
|
13
|
-
private queryService;
|
|
14
|
-
private promiseService;
|
|
15
|
-
constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryFactory: ItemEntryFactory, queryService: QueryService, promiseService: PromiseLibraryInterface);
|
|
16
|
-
requestItem(itemType: ItemType, itemId: ItemId, columns: ApiRequestColumns): PromiseInterface<ApiResponseProcessor>;
|
|
17
|
-
requestItems<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, query?: ApiQuery, columns?: ApiRequestColumns): PromiseInterface<ApiResponseProcessor>;
|
|
18
|
-
requestLinkItems(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, query: ApiQuery, columns: ApiRequestColumns): PromiseInterface<ApiResponseProcessor>;
|
|
19
|
-
processExpansion<ItemTypeType extends ItemType>(requestColumns: ApiRequestColumns, response: ApiResponse, itemType: ItemTypeType, itemEntries: Array<ItemEntry<ItemTypeType>>): ColumnExpansion<ItemTypeType>;
|
|
20
|
-
processResponse<ItemTypeType extends ItemType>(response: ApiResponse, idArray: ItemId[], parent: EntryParentNull, columnSet: ColumnSet<ItemTypeType>, columnExpansion?: ColumnExpansion<ItemTypeType>): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
21
|
-
handleCachedItem<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, response: ApiResponse, columnExpansion: ColumnExpansion<ItemTypeType>): ItemEntry<ItemTypeType>;
|
|
22
|
-
processLinkResponse<ItemTypeType extends ItemType>(response: ApiResponse, parentType: ItemType, parentIdArray: ItemId[], itemType: ItemTypeType, options: any): Promise<any>;
|
|
23
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { ChangesProcessor, CollectionCache, ItemCache, LocalCacheCallbackCondition, LocalCacheCallbackType, LockService } from '../classes';
|
|
2
|
-
import { CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
|
-
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, LocalViewResource, RemoteViewResource } from '../models';
|
|
5
|
-
import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, CreateRequestParameterMap, ItemIdConversionMap, ItemOptionsInterface, ItemType, PromiseInterface } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* @description
|
|
8
|
-
* The {@link LocalCache LocalCache} is responsible for keeping track of {@link ItemEntry ItemEntries} and {@link CollectionEntry CollectionEntries} which might have changes
|
|
9
|
-
* in order to save them efficiently.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* - Local entries are *not* stored in the global cache until they are saved.
|
|
13
|
-
* - Remote entries *are* stored in the global cache, and can also be stored in the LocalCache.
|
|
14
|
-
*/
|
|
15
|
-
export declare class LocalCache {
|
|
16
|
-
private changesProcessor;
|
|
17
|
-
private collectionResourceFactory;
|
|
18
|
-
private errorHandler;
|
|
19
|
-
private itemResourceFactory;
|
|
20
|
-
private lockService;
|
|
21
|
-
private promiseService;
|
|
22
|
-
id: string;
|
|
23
|
-
readonly items: ItemCache;
|
|
24
|
-
readonly collections: CollectionCache;
|
|
25
|
-
readonly deferredCollections: CollectionCache;
|
|
26
|
-
rootItem: ItemEntry<any> | undefined;
|
|
27
|
-
tabRequestParameters: {};
|
|
28
|
-
isSaving: boolean;
|
|
29
|
-
private changesInterval;
|
|
30
|
-
hasChanges: boolean;
|
|
31
|
-
private eventHandler;
|
|
32
|
-
constructor(exceptionHandler: ExceptionHandlerInterface, collectionCacheFactory: CollectionCacheFactory, itemCacheFactory: ItemCacheFactory, changesProcessor: ChangesProcessor, collectionResourceFactory: CollectionResourceFactory, errorHandler: ErrorHandlerInterface, itemResourceFactory: ItemResourceFactory, lockService: LockService, promiseService: PromiseLibraryInterface, id: string);
|
|
33
|
-
createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface & {
|
|
34
|
-
edit: true;
|
|
35
|
-
}, isRoot?: boolean, isNew?: boolean): EditResource<ItemTypeType>;
|
|
36
|
-
createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface & {
|
|
37
|
-
remote: true;
|
|
38
|
-
}, isRoot?: boolean, isNew?: boolean): RemoteViewResource<ItemTypeType>;
|
|
39
|
-
createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface, isRoot?: boolean, isNew?: boolean): LocalViewResource<ItemTypeType>;
|
|
40
|
-
createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface & {
|
|
41
|
-
edit: true;
|
|
42
|
-
}): Array<EditResource<ItemTypeType>>;
|
|
43
|
-
createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface & {
|
|
44
|
-
remote: true;
|
|
45
|
-
}): Array<RemoteViewResource<ItemTypeType>>;
|
|
46
|
-
createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface): Array<LocalViewResource<ItemTypeType>>;
|
|
47
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
48
|
-
editItems: true;
|
|
49
|
-
editCollection: true;
|
|
50
|
-
}): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
51
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
52
|
-
remoteItems: true;
|
|
53
|
-
editCollection: true;
|
|
54
|
-
}): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
55
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
56
|
-
editCollection: true;
|
|
57
|
-
}): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
58
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
59
|
-
editItems: true;
|
|
60
|
-
}): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
|
|
61
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
62
|
-
remoteItems: true;
|
|
63
|
-
}): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
|
|
64
|
-
createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType>): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
|
|
65
|
-
createCollectionResources<ItemTypeType extends ItemType>(collectionEntries: CollectionEntryParentIdMap<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
66
|
-
editItems: true;
|
|
67
|
-
editCollection: true;
|
|
68
|
-
}): CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>;
|
|
69
|
-
createCollectionResources<ItemTypeType extends ItemType>(collectionEntries: CollectionEntryParentIdMap<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
70
|
-
remoteItems: true;
|
|
71
|
-
editCollection: true;
|
|
72
|
-
}): CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
|
|
73
|
-
createCollectionResources<ItemTypeType extends ItemType>(collectionEntries: CollectionEntryParentIdMap<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
74
|
-
editCollection: true;
|
|
75
|
-
}): CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
|
|
76
|
-
createCollectionResources<ItemTypeType extends ItemType>(collectionEntries: CollectionEntryParentIdMap<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
77
|
-
editItems: true;
|
|
78
|
-
}): CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>;
|
|
79
|
-
createCollectionResources<ItemTypeType extends ItemType>(collectionEntries: CollectionEntryParentIdMap<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
|
|
80
|
-
remoteItems: true;
|
|
81
|
-
}): CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
|
|
82
|
-
createCollectionResources<ItemTypeType extends ItemType>(collectionEntries: CollectionEntryParentIdMap<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType>): CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
|
|
83
|
-
/**
|
|
84
|
-
* @description
|
|
85
|
-
* Removes an {@link ItemEntry ItemEntry} through an {@link ItemResource ItemResource} from the {@link LocalCache LocalCache} which means that changes on this entry will no longer be tracked.
|
|
86
|
-
*/
|
|
87
|
-
clearItem(itemResource: ItemResource<any>): void;
|
|
88
|
-
/**
|
|
89
|
-
* @description
|
|
90
|
-
* Removes an {@link ItemEntry ItemEntry} from the {@link LocalCache LocalCache} which means that changes on this entry will no longer be tracked.
|
|
91
|
-
*/
|
|
92
|
-
clearItemEntry(itemEntry: ItemEntry<any>): void;
|
|
93
|
-
/**
|
|
94
|
-
* @description
|
|
95
|
-
* Removes a {@link CollectionEntry CollectionEntry} through a {@link CollectionResource CollectionResource} from the {@link LocalCache LocalCache} which means that changes on this collection will no longer be tracked.
|
|
96
|
-
*/
|
|
97
|
-
clearCollection(collectionResource: CollectionResource<any>): void;
|
|
98
|
-
clearDeferredCollections(): void;
|
|
99
|
-
updateSingleItems(conversionMap: ItemIdConversionMap): void;
|
|
100
|
-
revertChanges(): PromiseInterface<void>;
|
|
101
|
-
resetCollection(collectionEntry: CollectionEntry<any>): void;
|
|
102
|
-
detectChanges(): boolean;
|
|
103
|
-
private collectionHasChanges;
|
|
104
|
-
isLockable(): boolean;
|
|
105
|
-
save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): PromiseInterface<ItemIdConversionMap>;
|
|
106
|
-
onBeforeSave(key: string, callback: LocalCacheCallbackType['onBeforeSave'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
107
|
-
onSaveSuccess(key: string, callback: LocalCacheCallbackType['onSaveSuccess'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
108
|
-
enableChangesWatcher(): void;
|
|
109
|
-
disableChangesWatcher(): void;
|
|
110
|
-
onDeactivateItem(itemEntry: ItemEntry<any>): void;
|
|
111
|
-
onActivateItem(itemEntry: ItemEntry<any>): void;
|
|
112
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import { ItemIdConversionMap, PromiseInterface } from '../types';
|
|
4
|
-
export declare type LocalCacheCallbackCondition = 'always' | 'onClose' | 'skipOnClose';
|
|
5
|
-
export declare type LocalCacheCallbackType = {
|
|
6
|
-
onBeforeSave: (localCache: LocalCache) => any;
|
|
7
|
-
onSaveSuccess: (localCache: LocalCache, conversionMap: ItemIdConversionMap) => any;
|
|
8
|
-
};
|
|
9
|
-
export declare class LocalCacheEventHandler {
|
|
10
|
-
private errorHandler;
|
|
11
|
-
private exceptionHandler;
|
|
12
|
-
private promiseService;
|
|
13
|
-
private callbacks;
|
|
14
|
-
constructor(errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, promiseService: PromiseLibraryInterface);
|
|
15
|
-
registerCallback<T extends keyof LocalCacheCallbackType>(type: T, key: string, callback: LocalCacheCallbackType[T], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
16
|
-
executeCallbacks<T extends keyof LocalCacheCallbackType>(type: T, execute: (callback: LocalCacheCallbackType[T]) => any, closeTab: boolean): PromiseInterface<any>;
|
|
17
|
-
private getPriorityLevel;
|
|
18
|
-
private executeCallbacksPriorityLevel;
|
|
19
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BatchStatus } from '../classes';
|
|
2
|
-
import { PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import { CollectionEntry, ItemEntry } from '../models';
|
|
4
|
-
import { ItemId, ItemType, PromiseInterface } from '../types';
|
|
5
|
-
export declare class BatchStatusFactory {
|
|
6
|
-
private promiseService;
|
|
7
|
-
constructor(promiseService: PromiseLibraryInterface);
|
|
8
|
-
construct<ItemTypeType extends ItemType, T extends ItemEntry<ItemTypeType> | CollectionEntry<ItemTypeType>>(itemType: ItemTypeType, getItemId: (entry: T) => ItemId, getPromise: (entry: T) => PromiseInterface<T>): BatchStatus<ItemTypeType, T>;
|
|
9
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ChangesProcessor, LocalCache, LockService } from '../classes';
|
|
2
|
-
import { CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
|
-
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
export declare class LocalCacheFactory {
|
|
5
|
-
private changesProcessor;
|
|
6
|
-
private collectionCacheFactory;
|
|
7
|
-
private collectionResourceFactory;
|
|
8
|
-
private errorHandler;
|
|
9
|
-
private exceptionHandler;
|
|
10
|
-
private itemCacheFactory;
|
|
11
|
-
private itemResourceFactory;
|
|
12
|
-
private lockService;
|
|
13
|
-
private promiseService;
|
|
14
|
-
constructor(changesProcessor: ChangesProcessor, collectionCacheFactory: CollectionCacheFactory, collectionResourceFactory: CollectionResourceFactory, errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, itemCacheFactory: ItemCacheFactory, itemResourceFactory: ItemResourceFactory, lockService: LockService, promiseService: PromiseLibraryInterface);
|
|
15
|
-
construct(id: string): LocalCache;
|
|
16
|
-
}
|