@rentman/rm-core 3.0.0 → 3.1.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 +668 -665
- package/dist/rm-core.js +9780 -9910
- package/dist/rm-core.min.js +2 -2
- package/dist/types/classes/ApiFormatter.d.ts +55 -55
- package/dist/types/classes/ApiRequestService.d.ts +20 -20
- package/dist/types/classes/ApiResponseProcessor.d.ts +31 -30
- package/dist/types/classes/ChangesCompilation.d.ts +34 -34
- package/dist/types/classes/ChangesDelta.d.ts +59 -62
- package/dist/types/classes/ChangesDeltaBase.d.ts +50 -49
- package/dist/types/classes/ChangesProcessor.d.ts +47 -47
- package/dist/types/classes/CollectionCache.d.ts +38 -38
- package/dist/types/classes/CollectionEntryService.d.ts +25 -25
- package/dist/types/classes/CollectionMatcher.d.ts +9 -9
- package/dist/types/classes/CollectionMatcherBase.d.ts +26 -26
- package/dist/types/classes/CollectionResourceService.d.ts +6 -6
- package/dist/types/classes/ColumnCache.d.ts +21 -21
- package/dist/types/classes/ColumnExpansion.d.ts +22 -22
- package/dist/types/classes/ColumnHandler.d.ts +21 -21
- package/dist/types/classes/ColumnInfo.d.ts +14 -14
- package/dist/types/classes/ColumnSet.d.ts +39 -39
- package/dist/types/classes/ColumnSubsetCache.d.ts +8 -8
- package/dist/types/classes/ColumnUtil.d.ts +99 -99
- package/dist/types/classes/ConversionMapService.d.ts +27 -0
- package/dist/types/classes/CreateRequest.d.ts +19 -19
- package/dist/types/classes/CreatedChangesDelta.d.ts +15 -0
- package/dist/types/classes/InternalChangesDelta.d.ts +39 -38
- package/dist/types/classes/ItemCache.d.ts +29 -29
- package/dist/types/classes/ItemCreateService.d.ts +24 -28
- package/dist/types/classes/ItemEntryService.d.ts +34 -41
- package/dist/types/classes/KeyService.d.ts +16 -16
- package/dist/types/classes/LockService.d.ts +32 -32
- package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
- package/dist/types/classes/QueryColumnExtractor.d.ts +20 -20
- package/dist/types/classes/QueryMatcher.d.ts +14 -14
- package/dist/types/classes/QueryParser.d.ts +25 -25
- package/dist/types/classes/QueryParserBase.d.ts +29 -29
- package/dist/types/classes/QueryService.d.ts +14 -14
- package/dist/types/classes/RequestBuffer.d.ts +28 -28
- package/dist/types/classes/RequestBufferManager.d.ts +24 -24
- package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
- package/dist/types/classes/SocketMessageHandler.d.ts +31 -31
- package/dist/types/classes/TemplateCache.d.ts +66 -66
- package/dist/types/classes/Util.d.ts +30 -30
- package/dist/types/classes/cache/AbstractCache.d.ts +101 -149
- package/dist/types/classes/cache/CollectionHandlerBase.d.ts +68 -68
- package/dist/types/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -26
- package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -95
- package/dist/types/classes/cache/server/ServerCache.d.ts +83 -100
- package/dist/types/classes/cache/server/ServerCollectionHandler.d.ts +44 -44
- package/dist/types/classes/cache/server/ServerItemHandler.d.ts +51 -50
- package/dist/types/classes/cache/transaction/TransactionCache.d.ts +344 -366
- package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +62 -73
- package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +24 -24
- package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +99 -110
- package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +28 -28
- package/dist/types/classes/index.d.ts +46 -44
- package/dist/types/constants.d.ts +7 -7
- package/dist/types/core.d.ts +52 -51
- package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/types/factories/ChangesCompilationFactory.d.ts +6 -6
- package/dist/types/factories/ChangesDeltaFactory.d.ts +11 -11
- package/dist/types/factories/ChangesProcessorFactory.d.ts +22 -22
- package/dist/types/factories/CollectionCacheFactory.d.ts +8 -8
- package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
- package/dist/types/factories/CollectionMatcherFactory.d.ts +9 -9
- package/dist/types/factories/CollectionResourceFactory.d.ts +16 -16
- package/dist/types/factories/ColumnExpansionFactory.d.ts +8 -8
- package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
- package/dist/types/factories/ColumnSetFactory.d.ts +19 -19
- package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +6 -6
- package/dist/types/factories/CreateRequestFactory.d.ts +11 -11
- package/dist/types/factories/ItemCacheFactory.d.ts +8 -8
- package/dist/types/factories/ItemEntryFactory.d.ts +15 -15
- package/dist/types/factories/ItemResourceFactory.d.ts +17 -17
- package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +5 -5
- package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/types/factories/QueryParserFactory.d.ts +6 -6
- package/dist/types/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/types/factories/TemplateFactory.d.ts +10 -10
- package/dist/types/factories/TransactionCacheFactory.d.ts +15 -58
- package/dist/types/factories/index.d.ts +22 -22
- package/dist/types/index.d.ts +7 -7
- package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +44 -0
- package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +11 -11
- package/dist/types/interfaces/AuthInterface.d.ts +9 -9
- package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
- package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
- package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
- package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
- package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +7 -0
- package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/types/interfaces/TransactionCacheDependencyInterface.d.ts +3 -0
- package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +20 -0
- package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +26 -0
- package/dist/types/interfaces/index.d.ts +12 -7
- package/dist/types/models/CollectionEntry.d.ts +27 -27
- package/dist/types/models/CollectionEntryOptions.d.ts +13 -13
- package/dist/types/models/CollectionResource.d.ts +62 -62
- package/dist/types/models/CollectionResourceOptions.d.ts +23 -23
- package/dist/types/models/ItemEntry.d.ts +19 -19
- package/dist/types/models/ItemEntryOptions.d.ts +8 -8
- package/dist/types/models/ItemResource.d.ts +93 -93
- package/dist/types/models/ItemResourceOptions.d.ts +6 -6
- package/dist/types/models/Template.d.ts +11 -11
- package/dist/types/models/index.d.ts +9 -9
- package/dist/types/types/ItemTypesCollection.d.ts +262 -262
- package/dist/types/types/PromiseInterface.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -2
- package/package.json +36 -36
- package/readme.md +15 -15
|
@@ -1,58 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private columnCache;
|
|
17
|
-
private requestBufferManager;
|
|
18
|
-
private requestColumnExpansionFactory;
|
|
19
|
-
private queryMatcherFactory;
|
|
20
|
-
private authInterface;
|
|
21
|
-
private changesDeltaFactory;
|
|
22
|
-
private changesProcessorFactory;
|
|
23
|
-
private lockService;
|
|
24
|
-
private moduleChangesCompilationFactory;
|
|
25
|
-
private collectionResourceFactory;
|
|
26
|
-
private itemResourceFactory;
|
|
27
|
-
private templateCache;
|
|
28
|
-
private itemCacheFactory;
|
|
29
|
-
private collectionCacheFactory;
|
|
30
|
-
private errorHandler;
|
|
31
|
-
private exceptionHandler;
|
|
32
|
-
private promiseService;
|
|
33
|
-
private apiFormatter;
|
|
34
|
-
private apiRequestService;
|
|
35
|
-
private columnExpansionFactory;
|
|
36
|
-
private columnHandler;
|
|
37
|
-
private columnSetFactory;
|
|
38
|
-
private columnSubsetCacheFactory;
|
|
39
|
-
private columnUtil;
|
|
40
|
-
private itemEntryFactory;
|
|
41
|
-
private itemEntryService;
|
|
42
|
-
private keyService;
|
|
43
|
-
private collectionEntryFactory;
|
|
44
|
-
private collectionEntryService;
|
|
45
|
-
private collectionMatcherFactory;
|
|
46
|
-
private queryParserFactory;
|
|
47
|
-
private queryService;
|
|
48
|
-
private linkTreeService;
|
|
49
|
-
private changesDeltaService;
|
|
50
|
-
private readonly serverCache;
|
|
51
|
-
constructor(core: RmCore, columnCache: ColumnCache, requestBufferManager: RequestBufferManager, requestColumnExpansionFactory: RequestColumnExpansionFactory, queryMatcherFactory: QueryMatcherFactory, authInterface: AuthInterface, changesDeltaFactory: ChangesDeltaFactory, changesProcessorFactory: ChangesProcessorFactory, lockService: LockService, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, collectionResourceFactory: CollectionResourceFactory, itemResourceFactory: ItemResourceFactory, templateCache: TemplateCache, itemCacheFactory: ItemCacheFactory, collectionCacheFactory: CollectionCacheFactory, errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, promiseService: PromiseLibraryInterface, apiFormatter: ApiFormatter, apiRequestService: ApiRequestService, columnExpansionFactory: ColumnExpansionFactory, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, columnSubsetCacheFactory: ColumnSubsetCacheFactory, columnUtil: ColumnUtil, itemEntryFactory: ItemEntryFactory, itemEntryService: ItemEntryService, keyService: KeyService, collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, collectionMatcherFactory: CollectionMatcherFactory, queryParserFactory: QueryParserFactory, queryService: QueryService, linkTreeService: LinkTreeServiceInterface, changesDeltaService: ItemCreateService);
|
|
52
|
-
/**
|
|
53
|
-
* Todo[cache] Store a map of all transactions by transaction id ?
|
|
54
|
-
*/
|
|
55
|
-
getById(id: string): TransactionCache | undefined;
|
|
56
|
-
construct(id?: string, validatorFactory?: TransactionValidatorFactory): TransactionCache;
|
|
57
|
-
getServerCache(): ServerCache;
|
|
58
|
-
}
|
|
1
|
+
import { ServerCache, TransactionCache, TransactionValidatorFactory } from '../classes';
|
|
2
|
+
import { RmCore } from '../core';
|
|
3
|
+
import { ServerCacheDependencyInterface } from '../interfaces';
|
|
4
|
+
export declare class TransactionCacheFactory {
|
|
5
|
+
private dependencies;
|
|
6
|
+
private core;
|
|
7
|
+
private readonly serverCache;
|
|
8
|
+
constructor(dependencies: ServerCacheDependencyInterface, core: RmCore);
|
|
9
|
+
/**
|
|
10
|
+
* Todo[cache] Store a map of all transactions by transaction id ?
|
|
11
|
+
*/
|
|
12
|
+
getById(id: string): TransactionCache | undefined;
|
|
13
|
+
construct(id?: string, validatorFactory?: TransactionValidatorFactory): TransactionCache;
|
|
14
|
+
getServerCache(): ServerCache;
|
|
15
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export * from './ApiResponseProcessorFactory';
|
|
2
|
-
export * from './ChangesCompilationFactory';
|
|
3
|
-
export * from './CollectionCacheFactory';
|
|
4
|
-
export * from './CollectionEntryFactory';
|
|
5
|
-
export * from './CollectionMatcherFactory';
|
|
6
|
-
export * from './CollectionResourceFactory';
|
|
7
|
-
export * from './ColumnExpansionFactory';
|
|
8
|
-
export * from './ColumnInfoFactory';
|
|
9
|
-
export * from './ColumnSetFactory';
|
|
10
|
-
export * from './ColumnSubsetCacheFactory';
|
|
11
|
-
export * from './CreateRequestFactory';
|
|
12
|
-
export * from './ItemCacheFactory';
|
|
13
|
-
export * from './ItemEntryFactory';
|
|
14
|
-
export * from './ItemResourceFactory';
|
|
15
|
-
export * from './TransactionCacheFactory';
|
|
16
|
-
export * from './ModuleChangesCompilationFactory';
|
|
17
|
-
export * from './QueryMatcherFactory';
|
|
18
|
-
export * from './QueryParserFactory';
|
|
19
|
-
export * from './RequestColumnExpansionFactory';
|
|
20
|
-
export * from './TemplateFactory';
|
|
21
|
-
export * from './ChangesDeltaFactory';
|
|
22
|
-
export * from './ChangesProcessorFactory';
|
|
1
|
+
export * from './ApiResponseProcessorFactory';
|
|
2
|
+
export * from './ChangesCompilationFactory';
|
|
3
|
+
export * from './CollectionCacheFactory';
|
|
4
|
+
export * from './CollectionEntryFactory';
|
|
5
|
+
export * from './CollectionMatcherFactory';
|
|
6
|
+
export * from './CollectionResourceFactory';
|
|
7
|
+
export * from './ColumnExpansionFactory';
|
|
8
|
+
export * from './ColumnInfoFactory';
|
|
9
|
+
export * from './ColumnSetFactory';
|
|
10
|
+
export * from './ColumnSubsetCacheFactory';
|
|
11
|
+
export * from './CreateRequestFactory';
|
|
12
|
+
export * from './ItemCacheFactory';
|
|
13
|
+
export * from './ItemEntryFactory';
|
|
14
|
+
export * from './ItemResourceFactory';
|
|
15
|
+
export * from './TransactionCacheFactory';
|
|
16
|
+
export * from './ModuleChangesCompilationFactory';
|
|
17
|
+
export * from './QueryMatcherFactory';
|
|
18
|
+
export * from './QueryParserFactory';
|
|
19
|
+
export * from './RequestColumnExpansionFactory';
|
|
20
|
+
export * from './TemplateFactory';
|
|
21
|
+
export * from './ChangesDeltaFactory';
|
|
22
|
+
export * from './ChangesProcessorFactory';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export * from './constants';
|
|
3
|
-
export * from './models';
|
|
4
|
-
export * from './interfaces';
|
|
5
|
-
export * from './classes';
|
|
6
|
-
export * from './factories';
|
|
7
|
-
export * from './types';
|
|
1
|
+
export * from './core';
|
|
2
|
+
export * from './constants';
|
|
3
|
+
export * from './models';
|
|
4
|
+
export * from './interfaces';
|
|
5
|
+
export * from './classes';
|
|
6
|
+
export * from './factories';
|
|
7
|
+
export * from './types';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ApiFormatter, ApiRequestService, CollectionEntryService, ColumnCache, ColumnHandler, ColumnUtil, ConversionMapService, ItemCreateService, ItemEntryService, KeyService, LockService, QueryService, RequestBufferManager } from '../classes';
|
|
2
|
+
import { TemplateCache } from '../classes/TemplateCache';
|
|
3
|
+
import { ChangesDeltaFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnSetFactory, ColumnSubsetCacheFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, ModuleChangesCompilationFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory } from '../factories';
|
|
4
|
+
import { AuthInterface } from './AuthInterface';
|
|
5
|
+
import { ErrorHandlerInterface } from './ErrorHandlerInterface';
|
|
6
|
+
import { ExceptionHandlerInterface } from './ExceptionHandlerInterface';
|
|
7
|
+
import { LinkTreeServiceInterface } from './LinkTreeServiceInterface';
|
|
8
|
+
import { PromiseLibraryInterface } from './PromiseLibraryInterface';
|
|
9
|
+
export interface AbstractCacheDependencyInterface {
|
|
10
|
+
apiFormatter: ApiFormatter;
|
|
11
|
+
apiRequestService: ApiRequestService;
|
|
12
|
+
authInterface: AuthInterface;
|
|
13
|
+
changesDeltaFactory: ChangesDeltaFactory;
|
|
14
|
+
collectionCacheFactory: CollectionCacheFactory;
|
|
15
|
+
collectionEntryFactory: CollectionEntryFactory;
|
|
16
|
+
collectionEntryService: CollectionEntryService;
|
|
17
|
+
collectionMatcherFactory: CollectionMatcherFactory;
|
|
18
|
+
collectionResourceFactory: CollectionResourceFactory;
|
|
19
|
+
columnCache: ColumnCache;
|
|
20
|
+
columnExpansionFactory: ColumnExpansionFactory;
|
|
21
|
+
columnHandler: ColumnHandler;
|
|
22
|
+
columnSetFactory: ColumnSetFactory;
|
|
23
|
+
columnSubsetCacheFactory: ColumnSubsetCacheFactory;
|
|
24
|
+
columnUtil: ColumnUtil;
|
|
25
|
+
conversionMapService: ConversionMapService;
|
|
26
|
+
errorHandler: ErrorHandlerInterface;
|
|
27
|
+
exceptionHandler: ExceptionHandlerInterface;
|
|
28
|
+
itemCacheFactory: ItemCacheFactory;
|
|
29
|
+
itemCreateService: ItemCreateService;
|
|
30
|
+
itemEntryFactory: ItemEntryFactory;
|
|
31
|
+
itemEntryService: ItemEntryService;
|
|
32
|
+
itemResourceFactory: ItemResourceFactory;
|
|
33
|
+
keyService: KeyService;
|
|
34
|
+
linkTreeService: LinkTreeServiceInterface;
|
|
35
|
+
lockService: LockService;
|
|
36
|
+
moduleChangesCompilationFactory: ModuleChangesCompilationFactory;
|
|
37
|
+
promiseService: PromiseLibraryInterface;
|
|
38
|
+
queryMatcherFactory: QueryMatcherFactory;
|
|
39
|
+
queryParserFactory: QueryParserFactory;
|
|
40
|
+
queryService: QueryService;
|
|
41
|
+
requestBufferManager: RequestBufferManager;
|
|
42
|
+
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
43
|
+
templateCache: TemplateCache;
|
|
44
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ApiRequestMoveItems, ItemId, ItemType, PromiseInterface } from '../types';
|
|
2
|
-
export interface ApiRequestServiceInterface {
|
|
3
|
-
template(itemType: ItemType, params: any): PromiseInterface<any>;
|
|
4
|
-
create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): PromiseInterface<any>;
|
|
5
|
-
delete(itemType: ItemType, itemIds: ItemId[]): PromiseInterface<any>;
|
|
6
|
-
updateItems(itemType: ItemType, items: ApiRequestItemMap, columns: ApiRequestColumnMap): PromiseInterface<any>;
|
|
7
|
-
requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<any>;
|
|
8
|
-
moveItems(parentType: ItemType, parentId: ItemId, items: ApiRequestMoveItems): PromiseInterface<any>;
|
|
9
|
-
columns(itemType: ItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<any>;
|
|
10
|
-
query(itemType: ItemType, query: any, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<any>;
|
|
11
|
-
}
|
|
1
|
+
import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ApiRequestMoveItems, ItemId, ItemType, PromiseInterface } from '../types';
|
|
2
|
+
export interface ApiRequestServiceInterface {
|
|
3
|
+
template(itemType: ItemType, params: any): PromiseInterface<any>;
|
|
4
|
+
create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): PromiseInterface<any>;
|
|
5
|
+
delete(itemType: ItemType, itemIds: ItemId[]): PromiseInterface<any>;
|
|
6
|
+
updateItems(itemType: ItemType, items: ApiRequestItemMap, columns: ApiRequestColumnMap): PromiseInterface<any>;
|
|
7
|
+
requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<any>;
|
|
8
|
+
moveItems(parentType: ItemType, parentId: ItemId, items: ApiRequestMoveItems): PromiseInterface<any>;
|
|
9
|
+
columns(itemType: ItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<any>;
|
|
10
|
+
query(itemType: ItemType, query: any, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<any>;
|
|
11
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface AuthInterface {
|
|
2
|
-
/**
|
|
3
|
-
* @returns {string} A uniquely identifying string for each user of the api
|
|
4
|
-
*/
|
|
5
|
-
getUniqueUserId(): string;
|
|
6
|
-
getUserId(): number;
|
|
7
|
-
getUserAccountname(): string;
|
|
8
|
-
getUserDisplayname(): string;
|
|
9
|
-
}
|
|
1
|
+
export interface AuthInterface {
|
|
2
|
+
/**
|
|
3
|
+
* @returns {string} A uniquely identifying string for each user of the api
|
|
4
|
+
*/
|
|
5
|
+
getUniqueUserId(): string;
|
|
6
|
+
getUserId(): number;
|
|
7
|
+
getUserAccountname(): string;
|
|
8
|
+
getUserDisplayname(): string;
|
|
9
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PromiseInterface } from '../types';
|
|
2
|
-
export interface ErrorHandlerInterface {
|
|
3
|
-
reject(error?: object): PromiseInterface<any>;
|
|
4
|
-
notifyError(error?: any): PromiseInterface<any>;
|
|
5
|
-
}
|
|
1
|
+
import { PromiseInterface } from '../types';
|
|
2
|
+
export interface ErrorHandlerInterface {
|
|
3
|
+
reject(error?: object): PromiseInterface<any>;
|
|
4
|
+
notifyError(error?: any): PromiseInterface<any>;
|
|
5
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface ExceptionHandlerInterface {
|
|
2
|
-
(exception: any): void;
|
|
3
|
-
}
|
|
1
|
+
export interface ExceptionHandlerInterface {
|
|
2
|
+
(exception: any): void;
|
|
3
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiLinkTree } from '../types';
|
|
2
|
-
export interface LinkTreeServiceInterface {
|
|
3
|
-
get: () => ApiLinkTree;
|
|
4
|
-
}
|
|
1
|
+
import { ApiLinkTree } from '../types';
|
|
2
|
+
export interface LinkTreeServiceInterface {
|
|
3
|
+
get: () => ApiLinkTree;
|
|
4
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { PromiseInterface } from '../types';
|
|
2
|
-
export interface Deferred<T> {
|
|
3
|
-
resolve(value?: T | PromiseInterface<T>): void;
|
|
4
|
-
reject(reason?: any): void;
|
|
5
|
-
promise: PromiseInterface<T>;
|
|
6
|
-
}
|
|
7
|
-
export interface PromiseLibraryInterface {
|
|
8
|
-
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>, T10 | PromiseInterface<T10>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
|
|
9
|
-
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
|
|
10
|
-
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8]>;
|
|
11
|
-
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7]>;
|
|
12
|
-
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>]): PromiseInterface<[T1, T2, T3, T4, T5, T6]>;
|
|
13
|
-
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>]): PromiseInterface<[T1, T2, T3, T4, T5]>;
|
|
14
|
-
all<T1, T2, T3, T4>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>]): PromiseInterface<[T1, T2, T3, T4]>;
|
|
15
|
-
all<T1, T2, T3>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>]): PromiseInterface<[T1, T2, T3]>;
|
|
16
|
-
all<T1, T2>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>]): PromiseInterface<[T1, T2]>;
|
|
17
|
-
all<TAll>(promises: Array<TAll | PromiseInterface<TAll>>): PromiseInterface<TAll[]>;
|
|
18
|
-
all(iterable: Array<PromiseInterface<any> | any>): PromiseInterface<any[]>;
|
|
19
|
-
all<T>(promises: {
|
|
20
|
-
[K in keyof T]: (PromiseInterface<T[K]> | T[K] | null);
|
|
21
|
-
}): PromiseInterface<T>;
|
|
22
|
-
when<T>(value?: PromiseInterface<T> | T): PromiseInterface<T>;
|
|
23
|
-
reject(value?: any): PromiseInterface<any>;
|
|
24
|
-
defer<T>(): Deferred<T>;
|
|
25
|
-
}
|
|
1
|
+
import { PromiseInterface } from '../types';
|
|
2
|
+
export interface Deferred<T> {
|
|
3
|
+
resolve(value?: T | PromiseInterface<T>): void;
|
|
4
|
+
reject(reason?: any): void;
|
|
5
|
+
promise: PromiseInterface<T>;
|
|
6
|
+
}
|
|
7
|
+
export interface PromiseLibraryInterface {
|
|
8
|
+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>, T10 | PromiseInterface<T10>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
|
|
9
|
+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
|
|
10
|
+
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8]>;
|
|
11
|
+
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7]>;
|
|
12
|
+
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>]): PromiseInterface<[T1, T2, T3, T4, T5, T6]>;
|
|
13
|
+
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>]): PromiseInterface<[T1, T2, T3, T4, T5]>;
|
|
14
|
+
all<T1, T2, T3, T4>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>]): PromiseInterface<[T1, T2, T3, T4]>;
|
|
15
|
+
all<T1, T2, T3>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>]): PromiseInterface<[T1, T2, T3]>;
|
|
16
|
+
all<T1, T2>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>]): PromiseInterface<[T1, T2]>;
|
|
17
|
+
all<TAll>(promises: Array<TAll | PromiseInterface<TAll>>): PromiseInterface<TAll[]>;
|
|
18
|
+
all(iterable: Array<PromiseInterface<any> | any>): PromiseInterface<any[]>;
|
|
19
|
+
all<T>(promises: {
|
|
20
|
+
[K in keyof T]: (PromiseInterface<T[K]> | T[K] | null);
|
|
21
|
+
}): PromiseInterface<T>;
|
|
22
|
+
when<T>(value?: PromiseInterface<T> | T): PromiseInterface<T>;
|
|
23
|
+
reject(value?: any): PromiseInterface<any>;
|
|
24
|
+
defer<T>(): Deferred<T>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ItemCreateService } from '../classes';
|
|
2
|
+
import { ChangesProcessorFactory } from '../factories';
|
|
3
|
+
import { AbstractCacheDependencyInterface } from './AbstractCacheDependencyInterface';
|
|
4
|
+
export interface ServerCacheDependencyInterface extends AbstractCacheDependencyInterface {
|
|
5
|
+
changesProcessorFactory: ChangesProcessorFactory;
|
|
6
|
+
itemCreateService: ItemCreateService;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface SocketMessageInterface {
|
|
2
|
-
on(event: string, messageHandler: (message: any) => void): () => boolean;
|
|
3
|
-
}
|
|
1
|
+
export interface SocketMessageInterface {
|
|
2
|
+
on(event: string, messageHandler: (message: any) => void): () => boolean;
|
|
3
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CollectionEntryService, ColumnHandler, ColumnUtil, KeyService } from '../classes';
|
|
2
|
+
import { ChangesDeltaFactory, CollectionCacheFactory, CollectionMatcherFactory, ColumnExpansionFactory, ColumnSubsetCacheFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
+
import { ErrorHandlerInterface } from './ErrorHandlerInterface';
|
|
4
|
+
import { ExceptionHandlerInterface } from './ExceptionHandlerInterface';
|
|
5
|
+
import { PromiseLibraryInterface } from './PromiseLibraryInterface';
|
|
6
|
+
export interface TransactionCollectionHandlerDependencyInterface {
|
|
7
|
+
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
8
|
+
columnUtil: ColumnUtil;
|
|
9
|
+
columnSubsetCacheFactory: ColumnSubsetCacheFactory;
|
|
10
|
+
columnExpansionFactory: ColumnExpansionFactory;
|
|
11
|
+
changesDeltaFactory: ChangesDeltaFactory;
|
|
12
|
+
collectionCacheFactory: CollectionCacheFactory;
|
|
13
|
+
collectionEntryService: CollectionEntryService;
|
|
14
|
+
collectionMatcherFactory: CollectionMatcherFactory;
|
|
15
|
+
columnHandler: ColumnHandler;
|
|
16
|
+
errorHandler: ErrorHandlerInterface;
|
|
17
|
+
keyService: KeyService;
|
|
18
|
+
promiseService: PromiseLibraryInterface;
|
|
19
|
+
exceptionHandler: ExceptionHandlerInterface;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ApiFormatter, ColumnHandler, ColumnUtil, ConversionMapService, ItemCreateService, ItemEntryService, KeyService } from '../classes';
|
|
2
|
+
import { TemplateCache } from '../classes/TemplateCache';
|
|
3
|
+
import { ChangesDeltaFactory, ColumnExpansionFactory, ColumnSetFactory, ColumnSubsetCacheFactory, ItemCacheFactory, ItemEntryFactory, RequestColumnExpansionFactory } from '../factories';
|
|
4
|
+
import { ErrorHandlerInterface } from './ErrorHandlerInterface';
|
|
5
|
+
import { ExceptionHandlerInterface } from './ExceptionHandlerInterface';
|
|
6
|
+
import { PromiseLibraryInterface } from './PromiseLibraryInterface';
|
|
7
|
+
export interface TransactionItemHandlerDependencyInterface {
|
|
8
|
+
apiFormatter: ApiFormatter;
|
|
9
|
+
changesDeltaFactory: ChangesDeltaFactory;
|
|
10
|
+
columnExpansionFactory: ColumnExpansionFactory;
|
|
11
|
+
columnHandler: ColumnHandler;
|
|
12
|
+
columnSetFactory: ColumnSetFactory;
|
|
13
|
+
columnSubsetCacheFactory: ColumnSubsetCacheFactory;
|
|
14
|
+
columnUtil: ColumnUtil;
|
|
15
|
+
conversionMapService: ConversionMapService;
|
|
16
|
+
errorHandler: ErrorHandlerInterface;
|
|
17
|
+
exceptionHandler: ExceptionHandlerInterface;
|
|
18
|
+
itemCacheFactory: ItemCacheFactory;
|
|
19
|
+
itemCreateService: ItemCreateService;
|
|
20
|
+
itemEntryFactory: ItemEntryFactory;
|
|
21
|
+
itemEntryService: ItemEntryService;
|
|
22
|
+
keyService: KeyService;
|
|
23
|
+
promiseService: PromiseLibraryInterface;
|
|
24
|
+
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
25
|
+
templateCache: TemplateCache;
|
|
26
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
export * from './PromiseLibraryInterface';
|
|
2
|
-
export * from './ErrorHandlerInterface';
|
|
3
|
-
export * from './ExceptionHandlerInterface';
|
|
4
|
-
export * from './AuthInterface';
|
|
5
|
-
export * from './ApiRequestServiceInterface';
|
|
6
|
-
export * from './SocketMessageInterface';
|
|
7
|
-
export * from './LinkTreeServiceInterface';
|
|
1
|
+
export * from './PromiseLibraryInterface';
|
|
2
|
+
export * from './ErrorHandlerInterface';
|
|
3
|
+
export * from './ExceptionHandlerInterface';
|
|
4
|
+
export * from './AuthInterface';
|
|
5
|
+
export * from './ApiRequestServiceInterface';
|
|
6
|
+
export * from './SocketMessageInterface';
|
|
7
|
+
export * from './LinkTreeServiceInterface';
|
|
8
|
+
export * from './AbstractCacheDependencyInterface';
|
|
9
|
+
export * from './TransactionCacheDependencyInterface';
|
|
10
|
+
export * from './TransactionItemHandlerDependencyInterface';
|
|
11
|
+
export * from './TransactionCollectionHandlerDependencyInterface';
|
|
12
|
+
export * from './ServerCacheDependencyInterface';
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { CollectionEntryService, ColumnExpansion, ColumnInfo, ColumnSet, KeyService } from '../classes';
|
|
2
|
-
import { ColumnSetFactory } from '../factories';
|
|
3
|
-
import { CollectionEntryOptions } from '../models';
|
|
4
|
-
import { ApiQuery, ApiRequestColumns, CollectionQuery, EntryParentNull, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
5
|
-
export declare class CollectionEntry<ItemTypeType extends ItemType = any> {
|
|
6
|
-
private collectionEntryService;
|
|
7
|
-
private columnSetFactory;
|
|
8
|
-
private keyService;
|
|
9
|
-
itemType: ItemTypeType;
|
|
10
|
-
options: CollectionEntryOptions;
|
|
11
|
-
id: number;
|
|
12
|
-
parent: EntryParentNull;
|
|
13
|
-
query: CollectionQuery;
|
|
14
|
-
columns: ColumnSet<ItemTypeType>;
|
|
15
|
-
reloadQueued: boolean;
|
|
16
|
-
promise: PromiseInterface<this>;
|
|
17
|
-
constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, keyService: KeyService, itemType: ItemTypeType, options: CollectionEntryOptions);
|
|
18
|
-
isLocal(): boolean;
|
|
19
|
-
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
20
|
-
extendQuery(callback?: QueryCallback): ApiQuery;
|
|
21
|
-
queueReload(): void;
|
|
22
|
-
expandColumns(columnExpansion: ColumnExpansion<ItemTypeType>): void;
|
|
23
|
-
expandRequestColumns(requestColumns: ApiRequestColumns): void;
|
|
24
|
-
getUpdatedItemColumns(conversionMap: ItemIdConversionMap): {
|
|
25
|
-
[columnId: string]: ColumnInfo<ItemTypeType>;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
1
|
+
import { CollectionEntryService, ColumnExpansion, ColumnInfo, ColumnSet, KeyService } from '../classes';
|
|
2
|
+
import { ColumnSetFactory } from '../factories';
|
|
3
|
+
import { CollectionEntryOptions } from '../models';
|
|
4
|
+
import { ApiQuery, ApiRequestColumns, CollectionQuery, EntryParentNull, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
5
|
+
export declare class CollectionEntry<ItemTypeType extends ItemType = any> {
|
|
6
|
+
private collectionEntryService;
|
|
7
|
+
private columnSetFactory;
|
|
8
|
+
private keyService;
|
|
9
|
+
itemType: ItemTypeType;
|
|
10
|
+
options: CollectionEntryOptions;
|
|
11
|
+
id: number;
|
|
12
|
+
parent: EntryParentNull;
|
|
13
|
+
query: CollectionQuery;
|
|
14
|
+
columns: ColumnSet<ItemTypeType>;
|
|
15
|
+
reloadQueued: boolean;
|
|
16
|
+
promise: PromiseInterface<this>;
|
|
17
|
+
constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, keyService: KeyService, itemType: ItemTypeType, options: CollectionEntryOptions);
|
|
18
|
+
isLocal(): boolean;
|
|
19
|
+
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
20
|
+
extendQuery(callback?: QueryCallback): ApiQuery;
|
|
21
|
+
queueReload(): void;
|
|
22
|
+
expandColumns(columnExpansion: ColumnExpansion<ItemTypeType>): void;
|
|
23
|
+
expandRequestColumns(requestColumns: ApiRequestColumns): void;
|
|
24
|
+
getUpdatedItemColumns(conversionMap: ItemIdConversionMap): {
|
|
25
|
+
[columnId: string]: ColumnInfo<ItemTypeType>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ApiQuery, ApiRequestColumns, ApiRequestLimit, EntryParentNull } from '../types';
|
|
2
|
-
export declare type CollectionEntryOptionsInterface = Partial<CollectionEntryOptions>;
|
|
3
|
-
export declare class CollectionEntryOptions {
|
|
4
|
-
columns: ApiRequestColumns;
|
|
5
|
-
query: ApiQuery | null;
|
|
6
|
-
queryParams: any;
|
|
7
|
-
queryColumns: ApiRequestColumns;
|
|
8
|
-
parent: EntryParentNull;
|
|
9
|
-
deferRequest: boolean;
|
|
10
|
-
limit: ApiRequestLimit | null;
|
|
11
|
-
entryKey: string | null;
|
|
12
|
-
constructor(values: CollectionEntryOptionsInterface);
|
|
13
|
-
}
|
|
1
|
+
import { ApiQuery, ApiRequestColumns, ApiRequestLimit, EntryParentNull } from '../types';
|
|
2
|
+
export declare type CollectionEntryOptionsInterface = Partial<CollectionEntryOptions>;
|
|
3
|
+
export declare class CollectionEntryOptions {
|
|
4
|
+
columns: ApiRequestColumns;
|
|
5
|
+
query: ApiQuery | null;
|
|
6
|
+
queryParams: any;
|
|
7
|
+
queryColumns: ApiRequestColumns;
|
|
8
|
+
parent: EntryParentNull;
|
|
9
|
+
deferRequest: boolean;
|
|
10
|
+
limit: ApiRequestLimit | null;
|
|
11
|
+
entryKey: string | null;
|
|
12
|
+
constructor(values: CollectionEntryOptionsInterface);
|
|
13
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
|
-
import { ChangesDeltaResult } from '../classes/ChangesDeltaBase';
|
|
3
|
-
import { CollectionResourceFactory } from '../factories';
|
|
4
|
-
import { CollectionEntry, CollectionResourceOptions, ItemEntry, ItemResource } from '../models';
|
|
5
|
-
import { FieldMap, ItemId, ItemResourceItemIdMap, ItemType, PromiseInterface, QueryCallback, ResponseColumnItemTypeMap } from '../types';
|
|
6
|
-
export declare class CollectionResource<ItemTypeType extends ItemType = any> {
|
|
7
|
-
protected factory: CollectionResourceFactory;
|
|
8
|
-
entry: CollectionEntry<ItemTypeType>;
|
|
9
|
-
options: CollectionResourceOptions<ItemTypeType>;
|
|
10
|
-
transaction: TransactionCache;
|
|
11
|
-
items: Array<ItemResource<ItemTypeType>>;
|
|
12
|
-
columns: ResponseColumnItemTypeMap;
|
|
13
|
-
protected itemIdMap: ItemResourceItemIdMap<ItemResource<ItemTypeType>>;
|
|
14
|
-
private readonly onChange;
|
|
15
|
-
constructor(factory: CollectionResourceFactory, entry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, transaction: TransactionCache);
|
|
16
|
-
onConstruct(): void;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated
|
|
19
|
-
* Use {@link ChangesDelta.setItemMoved ChangesDelta.setItemMoved}
|
|
20
|
-
*/
|
|
21
|
-
moveItems(itemEntries: Array<ItemEntry<ItemTypeType>>, destinationResource: CollectionResource<ItemTypeType>): void;
|
|
22
|
-
removeItems(idArray: ItemId[]): void;
|
|
23
|
-
removeItem(itemId: ItemId): void;
|
|
24
|
-
addItems(valuesArray: Array<FieldMap<ItemTypeType>>): PromiseInterface<ChangesDeltaResult>;
|
|
25
|
-
addItem(values: FieldMap<ItemTypeType>): PromiseInterface<ChangesDeltaResult>;
|
|
26
|
-
getIdArray(): ItemId[];
|
|
27
|
-
getItemById(itemId: number): ItemResource<ItemTypeType>;
|
|
28
|
-
addItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>, isInitialCall?: boolean): Array<ItemResource<ItemTypeType>>;
|
|
29
|
-
/**
|
|
30
|
-
* @description
|
|
31
|
-
* Returns the {@link ItemResource ItemResources} that where removed from the {@link CollectionResource collection}.
|
|
32
|
-
* Filters on {@link ItemResource ItemResource}.{@link ItemEntry entry} === {@link ItemEntry entry}
|
|
33
|
-
*/
|
|
34
|
-
removeItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): Array<ItemResource<ItemTypeType>>;
|
|
35
|
-
callOnAdd(itemResources: Array<ItemResource<ItemTypeType>>, isInitialCall?: boolean): void;
|
|
36
|
-
callOnRemove(itemResources: Array<ItemResource<ItemTypeType>>): void;
|
|
37
|
-
forEach(callback: (itemResource: ItemResource<ItemTypeType>) => void): void;
|
|
38
|
-
filter(callback: (itemResource: ItemResource<ItemTypeType>) => boolean): Array<ItemResource<ItemTypeType>>;
|
|
39
|
-
first(callback: (itemResource: ItemResource<ItemTypeType>) => boolean): ItemResource<ItemTypeType> | null;
|
|
40
|
-
some(callback: (itemResource: ItemResource<ItemTypeType>) => boolean): boolean;
|
|
41
|
-
groupBy(argument: string | ((itemResource: ItemResource<ItemTypeType>) => string | null)): {
|
|
42
|
-
[key: string]: Array<ItemResource<ItemTypeType>>;
|
|
43
|
-
};
|
|
44
|
-
map<U>(argument: string | ((itemResource: ItemResource<ItemTypeType>) => U)): U[];
|
|
45
|
-
reduce<U>(callback: (itemResource: ItemResource<ItemTypeType>, value: U) => U, value: U): U;
|
|
46
|
-
/**
|
|
47
|
-
* @description
|
|
48
|
-
* Fetches new items and adds them to the collection
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* - Used to return {@link ItemResource ItemResources}, but you should the {@link CollectionResource.onAdd onAdd) instead
|
|
52
|
-
*/
|
|
53
|
-
extend(queryCallback: QueryCallback): PromiseInterface<CollectionEntry<ItemTypeType>>;
|
|
54
|
-
/**
|
|
55
|
-
* @description
|
|
56
|
-
* Removes the reference to the {@link CollectionResource CollectionResource} from the {@link CollectionEntry CollectionEntry}
|
|
57
|
-
*
|
|
58
|
-
* @remarks
|
|
59
|
-
* - Doesn't revert changes on the items themselves
|
|
60
|
-
*/
|
|
61
|
-
clearResource(clearItems?: boolean): void;
|
|
62
|
-
}
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
|
+
import { ChangesDeltaResult } from '../classes/ChangesDeltaBase';
|
|
3
|
+
import { CollectionResourceFactory } from '../factories';
|
|
4
|
+
import { CollectionEntry, CollectionResourceOptions, ItemEntry, ItemResource } from '../models';
|
|
5
|
+
import { FieldMap, ItemId, ItemResourceItemIdMap, ItemType, PromiseInterface, QueryCallback, ResponseColumnItemTypeMap } from '../types';
|
|
6
|
+
export declare class CollectionResource<ItemTypeType extends ItemType = any> {
|
|
7
|
+
protected factory: CollectionResourceFactory;
|
|
8
|
+
entry: CollectionEntry<ItemTypeType>;
|
|
9
|
+
options: CollectionResourceOptions<ItemTypeType>;
|
|
10
|
+
transaction: TransactionCache;
|
|
11
|
+
items: Array<ItemResource<ItemTypeType>>;
|
|
12
|
+
columns: ResponseColumnItemTypeMap;
|
|
13
|
+
protected itemIdMap: ItemResourceItemIdMap<ItemResource<ItemTypeType>>;
|
|
14
|
+
private readonly onChange;
|
|
15
|
+
constructor(factory: CollectionResourceFactory, entry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, transaction: TransactionCache);
|
|
16
|
+
onConstruct(): void;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
* Use {@link ChangesDelta.setItemMoved ChangesDelta.setItemMoved}
|
|
20
|
+
*/
|
|
21
|
+
moveItems(itemEntries: Array<ItemEntry<ItemTypeType>>, destinationResource: CollectionResource<ItemTypeType>): void;
|
|
22
|
+
removeItems(idArray: ItemId[]): void;
|
|
23
|
+
removeItem(itemId: ItemId): void;
|
|
24
|
+
addItems(valuesArray: Array<FieldMap<ItemTypeType>>): PromiseInterface<ChangesDeltaResult>;
|
|
25
|
+
addItem(values: FieldMap<ItemTypeType>): PromiseInterface<ChangesDeltaResult>;
|
|
26
|
+
getIdArray(): ItemId[];
|
|
27
|
+
getItemById(itemId: number): ItemResource<ItemTypeType>;
|
|
28
|
+
addItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>, isInitialCall?: boolean): Array<ItemResource<ItemTypeType>>;
|
|
29
|
+
/**
|
|
30
|
+
* @description
|
|
31
|
+
* Returns the {@link ItemResource ItemResources} that where removed from the {@link CollectionResource collection}.
|
|
32
|
+
* Filters on {@link ItemResource ItemResource}.{@link ItemEntry entry} === {@link ItemEntry entry}
|
|
33
|
+
*/
|
|
34
|
+
removeItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): Array<ItemResource<ItemTypeType>>;
|
|
35
|
+
callOnAdd(itemResources: Array<ItemResource<ItemTypeType>>, isInitialCall?: boolean): void;
|
|
36
|
+
callOnRemove(itemResources: Array<ItemResource<ItemTypeType>>): void;
|
|
37
|
+
forEach(callback: (itemResource: ItemResource<ItemTypeType>) => void): void;
|
|
38
|
+
filter(callback: (itemResource: ItemResource<ItemTypeType>) => boolean): Array<ItemResource<ItemTypeType>>;
|
|
39
|
+
first(callback: (itemResource: ItemResource<ItemTypeType>) => boolean): ItemResource<ItemTypeType> | null;
|
|
40
|
+
some(callback: (itemResource: ItemResource<ItemTypeType>) => boolean): boolean;
|
|
41
|
+
groupBy(argument: string | ((itemResource: ItemResource<ItemTypeType>) => string | null)): {
|
|
42
|
+
[key: string]: Array<ItemResource<ItemTypeType>>;
|
|
43
|
+
};
|
|
44
|
+
map<U>(argument: string | ((itemResource: ItemResource<ItemTypeType>) => U)): U[];
|
|
45
|
+
reduce<U>(callback: (itemResource: ItemResource<ItemTypeType>, value: U) => U, value: U): U;
|
|
46
|
+
/**
|
|
47
|
+
* @description
|
|
48
|
+
* Fetches new items and adds them to the collection
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* - Used to return {@link ItemResource ItemResources}, but you should the {@link CollectionResource.onAdd onAdd) instead
|
|
52
|
+
*/
|
|
53
|
+
extend(queryCallback: QueryCallback): PromiseInterface<CollectionEntry<ItemTypeType>>;
|
|
54
|
+
/**
|
|
55
|
+
* @description
|
|
56
|
+
* Removes the reference to the {@link CollectionResource CollectionResource} from the {@link CollectionEntry CollectionEntry}
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* - Doesn't revert changes on the items themselves
|
|
60
|
+
*/
|
|
61
|
+
clearResource(clearItems?: boolean): void;
|
|
62
|
+
}
|