@rentman/rm-core 1.6.12 → 1.6.13-2
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 +493 -487
- package/dist/rm-core.js +5414 -5075
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/CollectionHandler.d.ts +5 -8
- package/dist/src/classes/ColumnSet.d.ts +5 -12
- package/dist/src/classes/ItemAdministrator.d.ts +4 -4
- package/dist/src/classes/LocalCache.d.ts +7 -12
- package/dist/src/classes/LocalCacheEventHandler.d.ts +19 -0
- package/dist/src/classes/index.d.ts +1 -0
- package/dist/src/factories/ColumnSetFactory.d.ts +6 -0
- package/dist/src/factories/LocalCacheFactory.d.ts +1 -2
- package/dist/src/types/ItemTypesCollection.d.ts +1 -18
- package/package.json +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { CollectionEntryOptions, CollectionViewResource, PromiseInterface } from '../';
|
|
2
2
|
import { BatchStatus, CollectionCache, CollectionEntryService, CollectionMatcher, ColumnExpansion, ColumnHandler, ColumnSet, ItemCache, ItemHandler, ItemRequestService, KeyService, QueryService } from '../classes';
|
|
3
|
-
import { ENTRY_STATUS } from '../constants';
|
|
4
3
|
import { BatchStatusFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, ColumnSetFactory, QueryParserFactory } from '../factories';
|
|
5
4
|
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
6
5
|
import { CollectionEntry, CollectionResource } from '../models';
|
|
7
|
-
import { ApiRequestColumn, CollectionEntryParentIdMap, CollectionResourceParentIdMap,
|
|
6
|
+
import { ApiRequestColumn, CollectionEntryParentIdMap, CollectionResourceParentIdMap, ItemEntryParentIdMap, ItemId, ItemResourceItemIdMap, ItemType, QueryCallback } from '../types';
|
|
8
7
|
export declare class CollectionHandler {
|
|
9
8
|
private batchStatusFactory;
|
|
10
9
|
private collectionCacheFactory;
|
|
@@ -44,12 +43,10 @@ export declare class CollectionHandler {
|
|
|
44
43
|
items?: ItemEntryParentIdMap;
|
|
45
44
|
}, localItems: ItemEntryParentIdMap): CollectionEntryParentIdMap;
|
|
46
45
|
fetch(itemType: ItemType, options: CollectionEntryOptions, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): PromiseInterface<CollectionEntry>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
getEntryStatus(itemType: ItemType, options: any, localEntries: CollectionCache, deferredEntries: CollectionCache): EntryStatus<CollectionEntry>;
|
|
46
|
+
private resolveCached;
|
|
47
|
+
private getCachedEntryStatus;
|
|
48
|
+
private getDeferredEntryStatus;
|
|
49
|
+
private getEntryStatus;
|
|
53
50
|
resolveLocal(collectionEntry: CollectionEntry, itemCache: ItemCache): PromiseInterface<CollectionEntry>;
|
|
54
51
|
resolveRemote(collectionEntry: CollectionEntry, itemCache: ItemCache): PromiseInterface<CollectionEntry>;
|
|
55
52
|
isLocal(options: any): boolean;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ColumnInfo, ColumnUtil, RequestColumnMergeResult } from '../classes';
|
|
2
|
+
import { ColumnSetFactory } from '../factories';
|
|
3
3
|
import { ApiRequestColumns, ColumnExpansionResult, ItemType, ResponseColumnMap } from '../types';
|
|
4
4
|
export declare class ColumnSet {
|
|
5
|
-
private columnHandler;
|
|
6
5
|
private columnUtil;
|
|
7
|
-
private columnInfoFactory;
|
|
8
6
|
private columnSetFactory;
|
|
9
7
|
itemType: ItemType;
|
|
10
|
-
request: ApiRequestColumns;
|
|
11
8
|
id: number;
|
|
9
|
+
request: ApiRequestColumns;
|
|
12
10
|
requestColumnsTrue: boolean;
|
|
13
11
|
response: ResponseColumnMap;
|
|
14
12
|
link: ColumnInfo | null;
|
|
@@ -25,19 +23,14 @@ export declare class ColumnSet {
|
|
|
25
23
|
searchable: ColumnInfo[];
|
|
26
24
|
item: ColumnInfo[];
|
|
27
25
|
notItem: ColumnInfo[];
|
|
28
|
-
constructor(
|
|
26
|
+
constructor(columnUtil: ColumnUtil, columnSetFactory: ColumnSetFactory, itemType: ItemType);
|
|
27
|
+
groupColumnInfo(columnInfo: ColumnInfo): void;
|
|
29
28
|
toJSON(): {
|
|
30
29
|
main: string[];
|
|
31
30
|
derived: string[];
|
|
32
31
|
};
|
|
33
|
-
resolve(responseColumns: ResponseColumnMap, enableCaching?: boolean, includeIdColumn?: boolean): this;
|
|
34
32
|
expandRequestColumns(columns: ApiRequestColumns): void;
|
|
35
33
|
isSupersetOf(columns: ApiRequestColumns): boolean;
|
|
36
|
-
private processResponseColumns;
|
|
37
|
-
private processRequestColumns;
|
|
38
|
-
private processColumnInfo;
|
|
39
|
-
private createRootColumnMap;
|
|
40
|
-
private groupColumnInfo;
|
|
41
34
|
private getMergedColumnSet;
|
|
42
35
|
mergeRequestColumns(requestColumns: ApiRequestColumns): RequestColumnMergeResult;
|
|
43
36
|
mergeResponseColumns(responseColumns: ResponseColumnMap): ResponseColumnMap;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CollectionCache, CollectionHandler, CollectionMatcher, ItemCache, ItemHandler, ItemRequestService, KeyService, LocalCache, ModuleChangesCompilationResult, QueryService } from '../classes';
|
|
1
|
+
import { CollectionCache, CollectionHandler, CollectionMatcher, ItemCache, ItemHandler, ItemRequestService, KeyService, LocalCache, LocalCacheCallbackCondition, LocalCacheCallbackType, ModuleChangesCompilationResult, QueryService } from '../classes';
|
|
2
2
|
import { CollectionMatcherFactory, ColumnSetFactory, LocalCacheFactory, ModuleChangesCompilationFactory } from '../factories';
|
|
3
3
|
import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
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,
|
|
5
|
+
import { ApiQuery, CollectionDefinition, CollectionOptionsInterface, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemOptionsInterface, ItemResourcesItemTypeMap, ItemType, LinkCollectionDefinition, LinkedItemEntryMap, PromiseInterface } from '../types';
|
|
6
6
|
export declare class ItemAdministrator {
|
|
7
7
|
private apiRequestService;
|
|
8
8
|
private authInterface;
|
|
@@ -236,6 +236,6 @@ export declare class ItemAdministrator {
|
|
|
236
236
|
remote: true;
|
|
237
237
|
}, isRoot: boolean): RemoteViewResource;
|
|
238
238
|
createItemResource(itemEntry: ItemEntry, options: ItemResourceOptionsInterface, isRoot: boolean): LocalViewResource;
|
|
239
|
-
onBeforeSave(key: string, callback:
|
|
240
|
-
onSaveSuccess(key: string, callback:
|
|
239
|
+
onBeforeSave(key: string, callback: LocalCacheCallbackType['onBeforeSave'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
240
|
+
onSaveSuccess(key: string, callback: LocalCacheCallbackType['onSaveSuccess'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
241
241
|
}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { CollectionCache, ItemCache, LockService } from '../classes';
|
|
1
|
+
import { CollectionCache, ItemCache, LocalCacheCallbackCondition, LocalCacheCallbackType, LockService } from '../classes';
|
|
2
2
|
import { ChangesProcessorFactory, CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, LocalViewResource, RemoteViewResource } from '../models';
|
|
5
|
-
import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, CreateRequestParameterMap, ItemIdConversionMap, ItemOptionsInterface,
|
|
5
|
+
import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, CreateRequestParameterMap, ItemIdConversionMap, ItemOptionsInterface, PromiseInterface } from '../types';
|
|
6
6
|
export declare class LocalCache {
|
|
7
7
|
private changesProcessorFactory;
|
|
8
|
-
private collectionCacheFactory;
|
|
9
8
|
private collectionResourceFactory;
|
|
10
9
|
private errorHandler;
|
|
11
|
-
private exceptionHandler;
|
|
12
|
-
private itemCacheFactory;
|
|
13
10
|
private itemResourceFactory;
|
|
14
11
|
private lockService;
|
|
15
12
|
private promiseService;
|
|
16
|
-
id
|
|
13
|
+
id?: string | undefined;
|
|
17
14
|
readonly items: ItemCache;
|
|
18
15
|
readonly collections: CollectionCache;
|
|
19
16
|
readonly deferredCollections: CollectionCache;
|
|
20
17
|
rootItem: ItemEntry | undefined;
|
|
21
18
|
tabRequestParameters: {};
|
|
22
19
|
isSaving: boolean;
|
|
23
|
-
private callbacks;
|
|
24
20
|
private changesInterval;
|
|
25
21
|
hasChanges: boolean;
|
|
26
|
-
|
|
22
|
+
private eventHandler;
|
|
23
|
+
constructor(exceptionHandler: ExceptionHandlerInterface, collectionCacheFactory: CollectionCacheFactory, itemCacheFactory: ItemCacheFactory, changesProcessorFactory: ChangesProcessorFactory, collectionResourceFactory: CollectionResourceFactory, errorHandler: ErrorHandlerInterface, itemResourceFactory: ItemResourceFactory, lockService: LockService, promiseService: PromiseLibraryInterface, id?: string | undefined);
|
|
27
24
|
createItemResource(itemEntry: ItemEntry, options: ItemOptionsInterface & {
|
|
28
25
|
edit: true;
|
|
29
26
|
}, isRoot?: boolean, isNew?: boolean): EditResource;
|
|
@@ -85,10 +82,8 @@ export declare class LocalCache {
|
|
|
85
82
|
private collectionHasChanges;
|
|
86
83
|
isLockable(): boolean;
|
|
87
84
|
save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): PromiseInterface<ItemIdConversionMap>;
|
|
88
|
-
onBeforeSave(key: string, callback:
|
|
89
|
-
onSaveSuccess(key: string, callback:
|
|
90
|
-
private executeCallbackEvent;
|
|
91
|
-
private executeCallbacks;
|
|
85
|
+
onBeforeSave(key: string, callback: LocalCacheCallbackType['onBeforeSave'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
86
|
+
onSaveSuccess(key: string, callback: LocalCacheCallbackType['onSaveSuccess'], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
92
87
|
enableChangesWatcher(): void;
|
|
93
88
|
disableChangesWatcher(): void;
|
|
94
89
|
onDeactivateItem(itemEntry: ItemEntry): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -24,6 +24,7 @@ export * from './ItemHandler';
|
|
|
24
24
|
export * from './ItemRequestService';
|
|
25
25
|
export * from './KeyService';
|
|
26
26
|
export * from './LocalCache';
|
|
27
|
+
export * from './LocalCacheEventHandler';
|
|
27
28
|
export * from './LockService';
|
|
28
29
|
export * from './ModuleChangesCompilation';
|
|
29
30
|
export * from './QueryMatcher';
|
|
@@ -7,5 +7,11 @@ export declare class ColumnSetFactory {
|
|
|
7
7
|
private columnInfoFactory;
|
|
8
8
|
constructor(columnHandler: ColumnHandler, columnUtil: ColumnUtil, columnInfoFactory: ColumnInfoFactory);
|
|
9
9
|
constructStub(itemType: ItemType, requestColumns: ApiRequestColumns): ColumnSet;
|
|
10
|
+
resolveStub(columnSet: ColumnSet, responseColumns: ResponseColumnMap, enableCaching?: boolean, includeIdColumn?: boolean): ColumnSet;
|
|
10
11
|
construct(itemType: ItemType, requestColumns: ApiRequestColumns, responseColumns: ResponseColumnMap, enableCaching?: boolean, includeIdColumn?: boolean): ColumnSet;
|
|
12
|
+
constructFromResponse(itemType: ItemType, responseColumns: ResponseColumnMap, enableCaching?: boolean): ColumnSet;
|
|
13
|
+
private processResponseColumns;
|
|
14
|
+
private processRequestColumns;
|
|
15
|
+
private processColumnInfo;
|
|
16
|
+
private expandRootColumnMap;
|
|
11
17
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LocalCache, LockService } from '../classes';
|
|
2
2
|
import { ChangesProcessorFactory, CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
|
-
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
import { ExceptionHandlerInterface } from '../interfaces/ExceptionHandlerInterface';
|
|
3
|
+
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
5
4
|
export declare class LocalCacheFactory {
|
|
6
5
|
private changesProcessorFactory;
|
|
7
6
|
private collectionCacheFactory;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResponseProcessor, CollectionMatcher, ColumnSet,
|
|
1
|
+
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, RequestColumnExpansion } from '../classes';
|
|
2
2
|
import { ENTRY_STATUS } from '../constants';
|
|
3
3
|
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface, ItemEntry, ItemEntryOptionsInterface, ItemResource, ItemResourceOptionsInterface } from '../models';
|
|
4
4
|
export declare type EntryParent = {
|
|
@@ -31,23 +31,6 @@ export declare type StateKey = {
|
|
|
31
31
|
template?: string;
|
|
32
32
|
itemId?: number;
|
|
33
33
|
};
|
|
34
|
-
export declare type OnSaveCallback = (localCache: LocalCache, conversionMap: ItemIdConversionMap) => any;
|
|
35
|
-
export declare enum LocalCacheCallbackCondition {
|
|
36
|
-
Always = "always",
|
|
37
|
-
OnClose = "onClose",
|
|
38
|
-
SkipOnClose = "skipOnClose"
|
|
39
|
-
}
|
|
40
|
-
export declare type LocalCacheCallbacks<T> = {
|
|
41
|
-
always: {
|
|
42
|
-
[key: string]: T;
|
|
43
|
-
};
|
|
44
|
-
onClose: {
|
|
45
|
-
[key: string]: T;
|
|
46
|
-
};
|
|
47
|
-
skipOnClose: {
|
|
48
|
-
[key: string]: T;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
34
|
export declare type SocketMessageType = 'event' | 'notification';
|
|
52
35
|
export interface SocketMessage {
|
|
53
36
|
header: {
|