@rentman/rm-core 1.0.0 → 1.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/dist/definitions/classes/ApiFormatter.d.ts +36 -0
- package/dist/definitions/classes/BatchStatus.d.ts +16 -0
- package/dist/definitions/classes/ChangesCompiler.d.ts +34 -0
- package/dist/definitions/classes/ChangesProcessor.d.ts +46 -0
- package/dist/definitions/classes/CollectionCache.d.ts +39 -0
- package/dist/definitions/classes/CollectionEntryService.d.ts +15 -0
- package/dist/definitions/classes/CollectionHandler.d.ts +79 -0
- package/dist/definitions/classes/CollectionResourceService.d.ts +5 -0
- package/dist/definitions/classes/ColumnCache.d.ts +18 -0
- package/dist/definitions/classes/ColumnExpansion.d.ts +16 -0
- package/dist/definitions/classes/ColumnHandler.d.ts +19 -0
- package/dist/definitions/classes/ColumnSet.d.ts +54 -0
- package/dist/definitions/classes/ColumnUtil.d.ts +80 -0
- package/dist/definitions/classes/CreateRequest.d.ts +28 -0
- package/dist/definitions/classes/ItemAdministrator.d.ts +114 -0
- package/dist/definitions/classes/ItemCache.d.ts +22 -0
- package/dist/definitions/classes/ItemEntryService.d.ts +50 -0
- package/dist/definitions/classes/ItemHandler.d.ts +70 -0
- package/dist/definitions/classes/ItemRequestService.d.ts +31 -0
- package/dist/definitions/classes/ItemResourceService.d.ts +8 -0
- package/dist/definitions/classes/KeyService.d.ts +28 -0
- package/dist/definitions/classes/LockService.d.ts +25 -0
- package/dist/definitions/classes/ModuleChangesCompiler.d.ts +18 -0
- package/dist/definitions/classes/PromiseService.d.ts +10 -0
- package/dist/definitions/classes/QueryMatcher.d.ts +14 -0
- package/dist/definitions/classes/QueryParser.d.ts +16 -0
- package/dist/definitions/classes/QueryService.d.ts +19 -0
- package/dist/definitions/classes/RequestColumnExpansion.d.ts +9 -0
- package/dist/definitions/classes/ResourceCache.d.ts +78 -0
- package/dist/definitions/classes/Util.d.ts +25 -0
- package/dist/definitions/constants.d.ts +10 -0
- package/dist/definitions/factories/BatchStatusFactory.d.ts +8 -0
- package/dist/definitions/factories/ChangesCompilerFactory.d.ts +9 -0
- package/dist/definitions/factories/ChangesProcessorFactory.d.ts +31 -0
- package/{src/factories/CollectionCacheFactory.ts → dist/definitions/factories/CollectionCacheFactory.d.ts} +3 -11
- package/dist/definitions/factories/CollectionEntryFactory.d.ts +19 -0
- package/dist/definitions/factories/CollectionResourceFactory.d.ts +18 -0
- package/dist/definitions/factories/ColumnExpansionFactory.d.ts +11 -0
- package/dist/definitions/factories/ColumnSetFactory.d.ts +9 -0
- package/dist/definitions/factories/CreateRequestFactory.d.ts +13 -0
- package/dist/definitions/factories/ItemCacheFactory.d.ts +9 -0
- package/dist/definitions/factories/ItemEntryFactory.d.ts +6 -0
- package/dist/definitions/factories/ItemResourceFactory.d.ts +12 -0
- package/{src/factories/ModuleChangesCompilerFactory.ts → dist/definitions/factories/ModuleChangesCompilerFactory.d.ts} +3 -14
- package/dist/definitions/factories/QueryMatcherFactory.d.ts +7 -0
- package/dist/definitions/factories/QueryParserFactory.d.ts +5 -0
- package/{src/factories/RequestColumnExpansionFactory.ts → dist/definitions/factories/RequestColumnExpansionFactory.d.ts} +3 -11
- package/dist/definitions/factories/ResourceCacheFactory.d.ts +33 -0
- package/dist/definitions/index.d.ts +121 -0
- package/dist/definitions/interfaces/ApiRequestServiceInterface.d.ts +10 -0
- package/dist/definitions/interfaces/AuthInterface.d.ts +4 -0
- package/{src/interfaces/ErrorHandlerInterface.ts → dist/definitions/interfaces/ErrorHandlerInterface.d.ts} +2 -2
- package/dist/definitions/interfaces/ResourceCacheInterface.d.ts +6 -0
- package/dist/definitions/models/CollectionEditResource.d.ts +23 -0
- package/dist/definitions/models/CollectionEntry.d.ts +61 -0
- package/dist/definitions/models/CollectionResource.d.ts +29 -0
- package/{src/models/CollectionViewResource.ts → dist/definitions/models/CollectionViewResource.d.ts} +6 -13
- package/dist/definitions/models/EditResource.d.ts +7 -0
- package/dist/definitions/models/ItemEntry.d.ts +18 -0
- package/dist/definitions/models/ItemResource.d.ts +14 -0
- package/dist/definitions/models/ViewResource.d.ts +7 -0
- package/dist/rm-core.js +29 -0
- package/dist/rm-core.js.map +1 -0
- package/package.json +5 -1
- package/.editorconfig +0 -23
- package/src/classes/ApiFormatter.ts +0 -338
- package/src/classes/BatchStatus.ts +0 -86
- package/src/classes/ChangesCompiler.ts +0 -161
- package/src/classes/ChangesProcessor.ts +0 -475
- package/src/classes/CollectionCache.ts +0 -234
- package/src/classes/CollectionEntryService.ts +0 -83
- package/src/classes/CollectionHandler.ts +0 -619
- package/src/classes/CollectionResourceService.ts +0 -38
- package/src/classes/ColumnCache.ts +0 -114
- package/src/classes/ColumnExpansion.ts +0 -74
- package/src/classes/ColumnHandler.ts +0 -90
- package/src/classes/ColumnSet.ts +0 -181
- package/src/classes/ColumnUtil.ts +0 -589
- package/src/classes/CreateRequest.ts +0 -158
- package/src/classes/ItemAdministrator.ts +0 -571
- package/src/classes/ItemCache.ts +0 -158
- package/src/classes/ItemEntryService.ts +0 -488
- package/src/classes/ItemHandler.ts +0 -592
- package/src/classes/ItemRequestService.ts +0 -229
- package/src/classes/ItemResourceService.ts +0 -36
- package/src/classes/KeyService.ts +0 -76
- package/src/classes/LockService.ts +0 -184
- package/src/classes/ModuleChangesCompiler.ts +0 -123
- package/src/classes/PromiseService.ts +0 -19
- package/src/classes/QueryMatcher.ts +0 -135
- package/src/classes/QueryParser.ts +0 -209
- package/src/classes/QueryService.ts +0 -35
- package/src/classes/RequestColumnExpansion.ts +0 -31
- package/src/classes/ResourceCache.ts +0 -289
- package/src/classes/Util.ts +0 -422
- package/src/constants.ts +0 -11
- package/src/factories/BatchStatusFactory.ts +0 -18
- package/src/factories/ChangesCompilerFactory.ts +0 -20
- package/src/factories/ChangesProcessorFactory.ts +0 -53
- package/src/factories/CollectionEntryFactory.ts +0 -35
- package/src/factories/CollectionResourceFactory.ts +0 -36
- package/src/factories/ColumnExpansionFactory.ts +0 -25
- package/src/factories/ColumnSetFactory.ts +0 -24
- package/src/factories/CreateRequestFactory.ts +0 -28
- package/src/factories/ItemCacheFactory.ts +0 -18
- package/src/factories/ItemEntryFactory.ts +0 -18
- package/src/factories/ItemResourceFactory.ts +0 -28
- package/src/factories/QueryMatcherFactory.ts +0 -20
- package/src/factories/QueryParserFactory.ts +0 -10
- package/src/factories/ResourceCacheFactory.ts +0 -55
- package/src/index.ts +0 -188
- package/src/interfaces/ApiRequestServiceInterface.ts +0 -17
- package/src/interfaces/AuthInterface.ts +0 -5
- package/src/interfaces/ResourceCacheInterface.ts +0 -9
- package/src/models/CollectionEditResource.ts +0 -139
- package/src/models/CollectionEntry.ts +0 -448
- package/src/models/CollectionResource.ts +0 -223
- package/src/models/EditResource.ts +0 -15
- package/src/models/ItemEntry.ts +0 -24
- package/src/models/ItemResource.ts +0 -35
- package/src/models/ViewResource.ts +0 -14
- package/tsconfig.json +0 -12
- package/tslint.json +0 -63
- package/webpack.common.js +0 -35
- package/webpack.dev.js +0 -10
- package/webpack.prod.js +0 -17
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import ApiFormatter from './ApiFormatter';
|
|
2
|
+
import KeyService from './KeyService';
|
|
3
|
+
import PromiseService from "./PromiseService";
|
|
4
|
+
export default class ItemEntryService {
|
|
5
|
+
private apiFormatter;
|
|
6
|
+
private keyService;
|
|
7
|
+
private promiseService;
|
|
8
|
+
undefinedItemError: string;
|
|
9
|
+
ALL_PERMISSIONS: number;
|
|
10
|
+
constructor(apiFormatter: ApiFormatter, keyService: KeyService, promiseService: PromiseService);
|
|
11
|
+
resetDerived(itemEntry: any, columnIds: any): void;
|
|
12
|
+
defer(itemEntry: any, deferRequest: any): any;
|
|
13
|
+
resolve(itemEntry: any): any;
|
|
14
|
+
reject(itemEntry: any, error?: string): any;
|
|
15
|
+
clearResources(itemEntry: any): void;
|
|
16
|
+
deactivateResources(itemEntry: any): void;
|
|
17
|
+
getFields(itemEntry: any): any;
|
|
18
|
+
expand(entry: any, main: any, derived: any, expandResource: any): any;
|
|
19
|
+
processOptions(options: any): any;
|
|
20
|
+
getConversionValue(itemType: any, itemId: any, map: any): any;
|
|
21
|
+
updateFields(entry: any, source: any, overwrite?: boolean): any;
|
|
22
|
+
updateItemValue(entry: any, fields: any, apiColumn: any, conversionMap: any): void;
|
|
23
|
+
updateItemFields(entry: any, conversionMap: any): void;
|
|
24
|
+
process(entry: any): any;
|
|
25
|
+
formatRequest(entry: any): {};
|
|
26
|
+
setDisplayName(entry: any): void;
|
|
27
|
+
getDisplayName(entry: any): any;
|
|
28
|
+
getFullName(firstName: any, infix: any, lastName: any): any;
|
|
29
|
+
getTitleField(itemType: any): "serienummer" | "nummer" | "friendlyname" | "naamintern" | "omschrijving" | "code" | "naam" | "displayname";
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} entry
|
|
33
|
+
* @param {Boolean} returnAll Returns all initial values if true
|
|
34
|
+
* @returns {Object}
|
|
35
|
+
*/
|
|
36
|
+
getChanges(entry: any, returnAll: any): any[];
|
|
37
|
+
isLocal(entry: any): boolean;
|
|
38
|
+
isLockable(entry: any): boolean;
|
|
39
|
+
hasChanges(entry: any): boolean;
|
|
40
|
+
resetModified(entry: any): void;
|
|
41
|
+
setInitial(entry: any, values: any, enableCallbacks: any): any;
|
|
42
|
+
/**
|
|
43
|
+
* Does a shallow copy of values!
|
|
44
|
+
*/
|
|
45
|
+
setModified(entry: any, values?: any): any;
|
|
46
|
+
setDerived(entry: any, values: any): any;
|
|
47
|
+
processLocal(entry: any, initial: any, modified: any, derived: any, conversionMap: any): any;
|
|
48
|
+
setParent(entry: any, parentType: any, parentId: any): any;
|
|
49
|
+
callOnChange(entry: any, previous: any): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import BatchStatusFactory from "../factories/BatchStatusFactory";
|
|
2
|
+
import ColumnExpansionFactory from "../factories/ColumnExpansionFactory";
|
|
3
|
+
import ColumnSetFactory from "../factories/ColumnSetFactory";
|
|
4
|
+
import ItemCacheFactory from "../factories/ItemCacheFactory";
|
|
5
|
+
import ItemEntryFactory from "../factories/ItemEntryFactory";
|
|
6
|
+
import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
|
|
7
|
+
import AuthInterface from '../interfaces/AuthInterface';
|
|
8
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
9
|
+
import ItemEntry from "../models/ItemEntry";
|
|
10
|
+
import ApiFormatter from "./ApiFormatter";
|
|
11
|
+
import ColumnHandler from './ColumnHandler';
|
|
12
|
+
import ColumnUtil from './ColumnUtil';
|
|
13
|
+
import ItemCache from "./ItemCache";
|
|
14
|
+
import ItemEntryService from "./ItemEntryService";
|
|
15
|
+
import KeyService from "./KeyService";
|
|
16
|
+
import PromiseService from "./PromiseService";
|
|
17
|
+
export default class ItemHandler {
|
|
18
|
+
private apiRequestService;
|
|
19
|
+
private authInterface;
|
|
20
|
+
private errorHandler;
|
|
21
|
+
private itemEntryFactory;
|
|
22
|
+
private columnHandler;
|
|
23
|
+
private itemCacheFactory;
|
|
24
|
+
private batchStatusFactory;
|
|
25
|
+
private columnExpansionFactory;
|
|
26
|
+
private columnSetFactory;
|
|
27
|
+
private itemEntryService;
|
|
28
|
+
private apiFormatter;
|
|
29
|
+
private keyService;
|
|
30
|
+
private promiseService;
|
|
31
|
+
private columnUtil;
|
|
32
|
+
entries: ItemCache;
|
|
33
|
+
templates: {};
|
|
34
|
+
constructor(apiRequestService: ApiRequestServiceInterface, authInterface: AuthInterface, errorHandler: ErrorHandlerInterface, itemEntryFactory: ItemEntryFactory, columnHandler: ColumnHandler, itemCacheFactory: ItemCacheFactory, batchStatusFactory: BatchStatusFactory, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, apiFormatter: ApiFormatter, keyService: KeyService, promiseService: PromiseService, columnUtil: ColumnUtil);
|
|
35
|
+
getItemId(itemEntry: ItemEntry): number;
|
|
36
|
+
getPromise(itemEntry: ItemEntry): any;
|
|
37
|
+
fetchItem(itemType: string, itemId: number, options: any): any;
|
|
38
|
+
fetchItems(itemType: any, itemIds: any, options: any): Promise<any>;
|
|
39
|
+
resolveCached(itemEntry: ItemEntry, status: any, options: any): any;
|
|
40
|
+
resolveLocal(itemEntry: ItemEntry, parent: any, template: any): {
|
|
41
|
+
main: ItemEntry;
|
|
42
|
+
linked: any[];
|
|
43
|
+
};
|
|
44
|
+
resolveExpansion(itemEntry: any, columnExpansion: any, response: any): any;
|
|
45
|
+
resolveRemote(itemEntry: any, columnInfo: any, response: any): any;
|
|
46
|
+
fetchTemplate(itemType: string, templateOptions?: any, templateColumns?: any): Promise<any>;
|
|
47
|
+
getEntryStatus(itemType: string, itemId: number, options: any): {
|
|
48
|
+
entry: any;
|
|
49
|
+
status: string;
|
|
50
|
+
};
|
|
51
|
+
getCachedEntryStatus(itemEntry: ItemEntry, options: any): string;
|
|
52
|
+
createDeferredEntry(itemType: string, itemId: number, requestColumns: any, deferRequest: any): any;
|
|
53
|
+
createEntryStub(itemType: string, itemId: number): ItemEntry;
|
|
54
|
+
createEntry(itemId: number, initial: any, derived: any, columnInfo: any): any;
|
|
55
|
+
resolveDeferredEntry(itemEntry: any, initial: any, derived: any, columns: any): any;
|
|
56
|
+
batchResolve(itemType: any, batchStatus: any, requestColumns: any, resolved: any): any;
|
|
57
|
+
cloneItem(newItemId: any, itemEntry: any, conversionMap?: any): any;
|
|
58
|
+
createConversionMap(itemType: string, itemId: number, extend: boolean, response: any): {
|
|
59
|
+
[x: string]: {
|
|
60
|
+
[x: number]: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
createLocalEntries(parentType: string, localParentId: number, template: any, conversionMap: any): any[];
|
|
64
|
+
createLocalEntry(itemId: number, template: any, modified: any, derived: any, parent?: any): ItemEntry;
|
|
65
|
+
extendConversionMap(conversionMap: any, links: any, apiResponse: any): void;
|
|
66
|
+
fetchTitle(itemType: string, itemId: number, deferRequest?: boolean): any;
|
|
67
|
+
requestItem(itemType: string, itemId: number | number[], columns: any): Promise<any>;
|
|
68
|
+
updateItemId(itemEntry: any, itemId: any): ItemEntry;
|
|
69
|
+
private setCreator;
|
|
70
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import ColumnExpansionFactory from "../factories/ColumnExpansionFactory";
|
|
2
|
+
import ColumnSetFactory from "../factories/ColumnSetFactory";
|
|
3
|
+
import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
|
|
4
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
5
|
+
import CollectionEntry from "../models/CollectionEntry";
|
|
6
|
+
import ItemEntry from "../models/ItemEntry";
|
|
7
|
+
import ColumnExpansion from "./ColumnExpansion";
|
|
8
|
+
import ColumnHandler from "./ColumnHandler";
|
|
9
|
+
import ItemEntryService from "./ItemEntryService";
|
|
10
|
+
import ItemHandler from "./ItemHandler";
|
|
11
|
+
import PromiseService from "./PromiseService";
|
|
12
|
+
import QueryService from "./QueryService";
|
|
13
|
+
export default class ItemRequestService {
|
|
14
|
+
private apiRequestService;
|
|
15
|
+
private errorHandler;
|
|
16
|
+
private itemHandler;
|
|
17
|
+
private columnHandler;
|
|
18
|
+
private columnExpansionFactory;
|
|
19
|
+
private columnSetFactory;
|
|
20
|
+
private itemEntryService;
|
|
21
|
+
private queryService;
|
|
22
|
+
private promiseService;
|
|
23
|
+
constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, columnHandler: ColumnHandler, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, queryService: QueryService, promiseService: PromiseService);
|
|
24
|
+
requestItem(itemType: any, itemId: any, columns: any): Promise<any>;
|
|
25
|
+
requestItems(collectionEntry: CollectionEntry, query?: any, columns?: any): Promise<any>;
|
|
26
|
+
requestLinkItems(parentType: any, parentIdArray: any, itemType: any, query: any, columns: any): Promise<any>;
|
|
27
|
+
processExpansion(requestColumns: any, response: any, itemType: string, itemEntries: ItemEntry[]): ColumnExpansion;
|
|
28
|
+
processResponse(response: any, idArray: any, parent: any, columnInfo: any, columnExpansion?: any): Promise<ItemEntry[]>;
|
|
29
|
+
handleCachedItem(itemEntry: any, response: any, columnExpansion: ColumnExpansion): any;
|
|
30
|
+
processLinkResponse(response: any, parentType: any, parentIdArray: any, itemType: any, options: any): Promise<any>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ItemEntryService from "./ItemEntryService";
|
|
2
|
+
export default class ItemResourceService {
|
|
3
|
+
private itemEntryService;
|
|
4
|
+
constructor(itemEntryService: ItemEntryService);
|
|
5
|
+
processOptions(options: any): any;
|
|
6
|
+
compareOptions(first: any, second: any): boolean;
|
|
7
|
+
isNew(resource: any): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default class KeyService {
|
|
2
|
+
NEW_PREFIX: string;
|
|
3
|
+
DUPLICATE_PREFIX: string;
|
|
4
|
+
NEW_KEYWORD: string;
|
|
5
|
+
DUPLICATE_KEYWORD: string;
|
|
6
|
+
seperator: string;
|
|
7
|
+
constructor();
|
|
8
|
+
getSingleKey(itemType: string, itemId: number | string): string;
|
|
9
|
+
getCollectionCacheKey(parentType: string, parentId: number, childType: string): string;
|
|
10
|
+
getCssKey(): any;
|
|
11
|
+
parseStateKey(stateKey: string): {
|
|
12
|
+
type: string;
|
|
13
|
+
template: string;
|
|
14
|
+
itemId?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
type: string;
|
|
17
|
+
itemId: string;
|
|
18
|
+
template?: undefined;
|
|
19
|
+
};
|
|
20
|
+
getDuplicateStateKey(itemId: string | number): string;
|
|
21
|
+
getNewStateKey(templateType: string): string;
|
|
22
|
+
getLocalId(): number;
|
|
23
|
+
getLocalDuplicateId(): number;
|
|
24
|
+
getRandomString(): string;
|
|
25
|
+
isLocalId(itemId: number | string): boolean;
|
|
26
|
+
isNewId(itemId: number | string): boolean;
|
|
27
|
+
isDuplicateId(itemId: number | string): boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
|
|
2
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
3
|
+
import ItemEntry from "../models/ItemEntry";
|
|
4
|
+
import KeyService from "./KeyService";
|
|
5
|
+
import PromiseService from "./PromiseService";
|
|
6
|
+
export default class LockService {
|
|
7
|
+
private apiRequestService;
|
|
8
|
+
private errorHandler;
|
|
9
|
+
private keyService;
|
|
10
|
+
private promiseService;
|
|
11
|
+
lockItems: {};
|
|
12
|
+
promises: {};
|
|
13
|
+
constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, keyService: KeyService, promiseService: PromiseService);
|
|
14
|
+
getValue(itemEntry: ItemEntry, map: any): any;
|
|
15
|
+
setValue(itemEntry: ItemEntry, value: any, map: any): any;
|
|
16
|
+
getLocks(): {};
|
|
17
|
+
hasLock(lockTokenId: any): boolean;
|
|
18
|
+
isLocked(itemEntry: ItemEntry): any;
|
|
19
|
+
getMessage(itemEntry: any): any;
|
|
20
|
+
fetchCachedLock(itemEntry: ItemEntry): any;
|
|
21
|
+
fetchLock(itemEntry: ItemEntry): any;
|
|
22
|
+
requestLock(itemEntry: ItemEntry): any;
|
|
23
|
+
deleteLock(itemEntry: any): any;
|
|
24
|
+
clearLock(itemEntry: any): boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import ItemEntry from "../models/ItemEntry";
|
|
2
|
+
import CollectionCache from "./CollectionCache";
|
|
3
|
+
import ItemCache from "./ItemCache";
|
|
4
|
+
import ItemEntryService from "./ItemEntryService";
|
|
5
|
+
export default class ModuleChangesCompiler {
|
|
6
|
+
private itemEntryService;
|
|
7
|
+
private rootItemEntry;
|
|
8
|
+
private singleItemCache;
|
|
9
|
+
private collectionCache;
|
|
10
|
+
parentMap: any;
|
|
11
|
+
destination: any;
|
|
12
|
+
constructor(itemEntryService: ItemEntryService, rootItemEntry: ItemEntry, singleItemCache: ItemCache, collectionCache: CollectionCache);
|
|
13
|
+
process(): void;
|
|
14
|
+
private createParentMap;
|
|
15
|
+
private processItems;
|
|
16
|
+
private processItem;
|
|
17
|
+
private getItemsByParent;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ApiFormatter from './ApiFormatter';
|
|
2
|
+
export default class QueryMatcher {
|
|
3
|
+
private apiFormatter;
|
|
4
|
+
parentType: string;
|
|
5
|
+
parentId: number;
|
|
6
|
+
fields: object;
|
|
7
|
+
itemType?: string;
|
|
8
|
+
constructor(apiFormatter: ApiFormatter, parentType: string, parentId: number, fields: object, itemType?: string);
|
|
9
|
+
private compareValues;
|
|
10
|
+
matchQuery(query: any): boolean | string;
|
|
11
|
+
private matchLinkedToQuery;
|
|
12
|
+
private matchComplexQuery;
|
|
13
|
+
private matchSimpleQuery;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default class QueryParser {
|
|
2
|
+
query: any;
|
|
3
|
+
parameters: any;
|
|
4
|
+
constructor(query: any, parameters: any);
|
|
5
|
+
private processValue;
|
|
6
|
+
private compareParsedQueries;
|
|
7
|
+
parse(query?: any): any;
|
|
8
|
+
private parseSearchQuery;
|
|
9
|
+
private parseCustomQuery;
|
|
10
|
+
private parseCustomParameters;
|
|
11
|
+
private parseSimpleQuery;
|
|
12
|
+
private parseLinkedToQuery;
|
|
13
|
+
private parseComplexQuery;
|
|
14
|
+
private parseConditions;
|
|
15
|
+
private formatValue;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default class QueryService {
|
|
2
|
+
constructor();
|
|
3
|
+
addAndCondition(query: any, condition: any): {
|
|
4
|
+
conditions: any;
|
|
5
|
+
};
|
|
6
|
+
addOrCondition(query: any, condition: any): {
|
|
7
|
+
conditions: any;
|
|
8
|
+
operator?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
conditions: any[];
|
|
11
|
+
operator: string;
|
|
12
|
+
};
|
|
13
|
+
addParentCondition(query: any, parent: any): any;
|
|
14
|
+
createNotIn(idArray: any): {
|
|
15
|
+
comparator: string;
|
|
16
|
+
key: string;
|
|
17
|
+
value: any;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import ChangesProcessorFactory from "../factories/ChangesProcessorFactory";
|
|
2
|
+
import CollectionCacheFactory from "../factories/CollectionCacheFactory";
|
|
3
|
+
import CollectionResourceFactory from "../factories/CollectionResourceFactory";
|
|
4
|
+
import ItemCacheFactory from "../factories/ItemCacheFactory";
|
|
5
|
+
import ItemResourceFactory from "../factories/ItemResourceFactory";
|
|
6
|
+
import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
|
|
7
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
8
|
+
import CollectionEntry from "../models/CollectionEntry";
|
|
9
|
+
import CollectionResource from "../models/CollectionResource";
|
|
10
|
+
import ItemEntry from "../models/ItemEntry";
|
|
11
|
+
import ItemResource from "../models/ItemResource";
|
|
12
|
+
import CollectionCache from "./CollectionCache";
|
|
13
|
+
import CollectionHandler from "./CollectionHandler";
|
|
14
|
+
import ColumnHandler from "./ColumnHandler";
|
|
15
|
+
import ItemCache from './ItemCache';
|
|
16
|
+
import ItemEntryService from './ItemEntryService';
|
|
17
|
+
import ItemHandler from "./ItemHandler";
|
|
18
|
+
import ItemResourceService from './ItemResourceService';
|
|
19
|
+
import LockService from "./LockService";
|
|
20
|
+
import PromiseService from "./PromiseService";
|
|
21
|
+
export default class ResourceCache {
|
|
22
|
+
private apiRequestService;
|
|
23
|
+
private errorHandler;
|
|
24
|
+
private itemHandler;
|
|
25
|
+
private collectionHandler;
|
|
26
|
+
private columnHandler;
|
|
27
|
+
private lockService;
|
|
28
|
+
private itemResourceFactory;
|
|
29
|
+
private collectionCacheFactory;
|
|
30
|
+
private changesProcessorFactory;
|
|
31
|
+
private itemCacheFactory;
|
|
32
|
+
private collectionResourceFactory;
|
|
33
|
+
private itemEntryService;
|
|
34
|
+
private itemResourceService;
|
|
35
|
+
private promiseService;
|
|
36
|
+
collections: CollectionCache;
|
|
37
|
+
deferredCollections: CollectionCache;
|
|
38
|
+
items: ItemCache;
|
|
39
|
+
collectionOptions: {};
|
|
40
|
+
tabRequestParameters: {};
|
|
41
|
+
callbacks: {
|
|
42
|
+
onBeforeSave: {};
|
|
43
|
+
onSaveSuccess: {};
|
|
44
|
+
onSaveWithoutClosing: {};
|
|
45
|
+
};
|
|
46
|
+
changesInterval: null | number;
|
|
47
|
+
_hasChanges: boolean;
|
|
48
|
+
rootItem: ItemEntry;
|
|
49
|
+
constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, collectionHandler: CollectionHandler, columnHandler: ColumnHandler, lockService: LockService, itemResourceFactory: ItemResourceFactory, collectionCacheFactory: CollectionCacheFactory, changesProcessorFactory: ChangesProcessorFactory, itemCacheFactory: ItemCacheFactory, collectionResourceFactory: CollectionResourceFactory, itemEntryService: ItemEntryService, itemResourceService: ItemResourceService, promiseService: PromiseService);
|
|
50
|
+
addSingleItem(itemEntry: ItemEntry, options: any, isRoot: any): ItemResource;
|
|
51
|
+
addCollection(collectionEntry: CollectionEntry, resourceOptions: any): CollectionResource;
|
|
52
|
+
clearCollection(collectionResource: CollectionResource): void;
|
|
53
|
+
clearItem(itemResource: ItemResource): void;
|
|
54
|
+
clearResources(isSubTabChange?: boolean): void;
|
|
55
|
+
updateSingleItems(conversionMap: any): void;
|
|
56
|
+
revertChanges(): void;
|
|
57
|
+
resetCollection(collectionEntry: CollectionEntry): void;
|
|
58
|
+
hasChanges(): boolean;
|
|
59
|
+
detectChanges(): boolean;
|
|
60
|
+
collectionHasChanges(collectionEntry: CollectionEntry): boolean;
|
|
61
|
+
isLockable(): boolean;
|
|
62
|
+
save(closeTab: boolean, parameters: any, breakUpByParent: any, onAfterCreateCallback: any): any;
|
|
63
|
+
executeCallbacks(event: any, callbackParameter: any): Promise<any>;
|
|
64
|
+
enableChangesWatcher(): void;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
*/
|
|
68
|
+
enableWatcher(): void;
|
|
69
|
+
disableChangesWatcher(): void;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated
|
|
72
|
+
*/
|
|
73
|
+
disableWatcher(): void;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated
|
|
76
|
+
*/
|
|
77
|
+
registerCallback(event: string, key: string, callback: any): () => void;
|
|
78
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function shallowMerge(object: any, defaults: any): any;
|
|
2
|
+
export declare function hasProperties(object: any): boolean;
|
|
3
|
+
export declare function getFirstProperty(object: any): string;
|
|
4
|
+
export declare function inArray(needle: any, haystack: any): boolean;
|
|
5
|
+
export declare function filterArray(source: any, callback: any): boolean;
|
|
6
|
+
export declare function emptyArray(array: any): void;
|
|
7
|
+
export declare function pathExists(source: any, path: any): boolean;
|
|
8
|
+
export declare function createPath(object: any, path: any, defaults: any): any;
|
|
9
|
+
export declare function getPath(object: any, path: any, create?: boolean): any;
|
|
10
|
+
export declare function extend(dst: any, ...args: any[]): any;
|
|
11
|
+
export declare function merge(dst: any, ...args: any[]): any;
|
|
12
|
+
export declare function isObject(value: any): boolean;
|
|
13
|
+
export declare function isBlankObject(value: any): boolean;
|
|
14
|
+
export declare function isString(value: any): boolean;
|
|
15
|
+
export declare function isNumber(value: any): boolean;
|
|
16
|
+
export declare function isDate(value: any): boolean;
|
|
17
|
+
export declare const isArray: (arg: any) => arg is any[];
|
|
18
|
+
export declare function isFunction(value: any): boolean;
|
|
19
|
+
export declare function isRegExp(value: any): boolean;
|
|
20
|
+
export declare function isBoolean(value: any): boolean;
|
|
21
|
+
export declare function isElement(node: any): boolean;
|
|
22
|
+
export declare function isWindow(obj: any): boolean;
|
|
23
|
+
export declare function isDefined(value: any): boolean;
|
|
24
|
+
export declare function equals(o1: any, o2: any): boolean;
|
|
25
|
+
export declare function copy(source: any, destination?: any, maxDepth?: number): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BatchStatus from "../classes/BatchStatus";
|
|
2
|
+
import PromiseService from '../classes/PromiseService';
|
|
3
|
+
import ItemEntry from "../models/ItemEntry";
|
|
4
|
+
export default class BatchStatusFactory {
|
|
5
|
+
private promiseService;
|
|
6
|
+
constructor(promiseService: PromiseService);
|
|
7
|
+
construct(getItemId: (itemEntry: ItemEntry) => number, getPromise: (itemEntry: ItemEntry) => Promise<any>): BatchStatus;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ChangesCompiler from "../classes/ChangesCompiler";
|
|
2
|
+
import ItemEntryService from '../classes/ItemEntryService';
|
|
3
|
+
import CollectionEntry from "../models/CollectionEntry";
|
|
4
|
+
import ItemEntry from "../models/ItemEntry";
|
|
5
|
+
export default class ChangesCompilerFactory {
|
|
6
|
+
private itemEntryService;
|
|
7
|
+
constructor(itemEntryService: ItemEntryService);
|
|
8
|
+
construct(singleItems: ItemEntry[], collections: CollectionEntry[], collectionOptions: any): ChangesCompiler;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import ApiFormatter from '../classes/ApiFormatter';
|
|
2
|
+
import ChangesProcessor from "../classes/ChangesProcessor";
|
|
3
|
+
import CollectionEntryService from "../classes/CollectionEntryService";
|
|
4
|
+
import CollectionHandler from "../classes/CollectionHandler";
|
|
5
|
+
import ColumnHandler from "../classes/ColumnHandler";
|
|
6
|
+
import ItemEntryService from '../classes/ItemEntryService';
|
|
7
|
+
import ItemHandler from "../classes/ItemHandler";
|
|
8
|
+
import PromiseService from '../classes/PromiseService';
|
|
9
|
+
import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
|
|
10
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
11
|
+
import ChangesCompilerFactory from "./ChangesCompilerFactory";
|
|
12
|
+
import ColumnExpansionFactory from "./ColumnExpansionFactory";
|
|
13
|
+
import CreateRequestFactory from "./CreateRequestFactory";
|
|
14
|
+
import RequestColumnExpansionFactory from "./RequestColumnExpansionFactory";
|
|
15
|
+
export default class ChangesProcessorFactory {
|
|
16
|
+
private apiRequestService;
|
|
17
|
+
private errorHandler;
|
|
18
|
+
private itemHandler;
|
|
19
|
+
private collectionHandler;
|
|
20
|
+
private columnHandler;
|
|
21
|
+
private changesCompilerFactory;
|
|
22
|
+
private createRequestFactory;
|
|
23
|
+
private columnExpansionFactory;
|
|
24
|
+
private requestColumnExpansionFactory;
|
|
25
|
+
private collectionEntryService;
|
|
26
|
+
private itemEntryService;
|
|
27
|
+
private apiFormatter;
|
|
28
|
+
private promiseService;
|
|
29
|
+
constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, collectionHandler: CollectionHandler, columnHandler: ColumnHandler, changesCompilerFactory: ChangesCompilerFactory, createRequestFactory: CreateRequestFactory, columnExpansionFactory: ColumnExpansionFactory, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, itemEntryService: ItemEntryService, apiFormatter: ApiFormatter, promiseService: PromiseService);
|
|
30
|
+
construct(): ChangesProcessor;
|
|
31
|
+
}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import CollectionCache from "../classes/CollectionCache";
|
|
2
2
|
import QueryMatcherFactory from "./QueryMatcherFactory";
|
|
3
|
-
|
|
4
3
|
export default class CollectionCacheFactory {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
construct () {
|
|
11
|
-
return new CollectionCache(
|
|
12
|
-
this.queryMatcherFactory
|
|
13
|
-
);
|
|
14
|
-
}
|
|
4
|
+
private queryMatcherFactory;
|
|
5
|
+
constructor(queryMatcherFactory: QueryMatcherFactory);
|
|
6
|
+
construct(): CollectionCache;
|
|
15
7
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CollectionEntryService from "../classes/CollectionEntryService";
|
|
2
|
+
import ItemEntryService from '../classes/ItemEntryService';
|
|
3
|
+
import ItemRequestService from "../classes/ItemRequestService";
|
|
4
|
+
import KeyService from '../classes/KeyService';
|
|
5
|
+
import PromiseService from '../classes/PromiseService';
|
|
6
|
+
import QueryService from '../classes/QueryService';
|
|
7
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
8
|
+
import CollectionEntry from "../models/CollectionEntry";
|
|
9
|
+
export default class CollectionEntryFactory {
|
|
10
|
+
private errorHandler;
|
|
11
|
+
private collectionEntryService;
|
|
12
|
+
private itemRequestService;
|
|
13
|
+
private itemEntryService;
|
|
14
|
+
private keyService;
|
|
15
|
+
private queryService;
|
|
16
|
+
private promiseService;
|
|
17
|
+
constructor(errorHandler: ErrorHandlerInterface, collectionEntryService: CollectionEntryService, itemRequestService: ItemRequestService, itemEntryService: ItemEntryService, keyService: KeyService, queryService: QueryService, promiseService: PromiseService);
|
|
18
|
+
construct(itemType: string, options: any): CollectionEntry;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import ItemHandler from "../classes/ItemHandler";
|
|
2
|
+
import KeyService from '../classes/KeyService';
|
|
3
|
+
import PromiseService from '../classes/PromiseService';
|
|
4
|
+
import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
|
|
5
|
+
import CollectionEntry from "../models/CollectionEntry";
|
|
6
|
+
import CollectionResource from "../models/CollectionResource";
|
|
7
|
+
import ChangesProcessorFactory from './ChangesProcessorFactory';
|
|
8
|
+
import ItemResourceFactory from "./ItemResourceFactory";
|
|
9
|
+
export default class CollectionResourceFactory {
|
|
10
|
+
private errorHandler;
|
|
11
|
+
private itemHandler;
|
|
12
|
+
private itemResourceFactory;
|
|
13
|
+
private changesProcessorFactory;
|
|
14
|
+
private keyService;
|
|
15
|
+
private promiseService;
|
|
16
|
+
constructor(errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseService);
|
|
17
|
+
construct(collectionEntry: CollectionEntry, options: any): CollectionResource;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ColumnExpansion from "../classes/ColumnExpansion";
|
|
2
|
+
import ColumnHandler from "../classes/ColumnHandler";
|
|
3
|
+
import ColumnUtil from '../classes/ColumnUtil';
|
|
4
|
+
import ColumnSetFactory from "./ColumnSetFactory";
|
|
5
|
+
export default class ColumnExpansionFactory {
|
|
6
|
+
private columnHandler;
|
|
7
|
+
private columnSetFactory;
|
|
8
|
+
private columnUtil;
|
|
9
|
+
constructor(columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, columnUtil: ColumnUtil);
|
|
10
|
+
construct(itemType: string, requestColumns: any | boolean, responseColumns: any): ColumnExpansion;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ColumnHandler from "../classes/ColumnHandler";
|
|
2
|
+
import ColumnSet from "../classes/ColumnSet";
|
|
3
|
+
import ColumnUtil from '../classes/ColumnUtil';
|
|
4
|
+
export default class ColumnSetFactory {
|
|
5
|
+
private columnHandler;
|
|
6
|
+
private columnUtil;
|
|
7
|
+
constructor(columnHandler: ColumnHandler, columnUtil: ColumnUtil);
|
|
8
|
+
construct(itemType: string, requestColumns: any, responseColumns: any, enableCaching?: boolean, includeIdColumn?: boolean): ColumnSet;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import CollectionHandler from "../classes/CollectionHandler";
|
|
2
|
+
import CreateRequest from "../classes/CreateRequest";
|
|
3
|
+
import ItemEntryService from '../classes/ItemEntryService';
|
|
4
|
+
import KeyService from '../classes/KeyService';
|
|
5
|
+
import RequestColumnExpansionFactory from "./RequestColumnExpansionFactory";
|
|
6
|
+
export default class CreateRequestFactory {
|
|
7
|
+
private collectionHandler;
|
|
8
|
+
private requestColumnExpansionFactory;
|
|
9
|
+
private itemEntryService;
|
|
10
|
+
private keyService;
|
|
11
|
+
constructor(collectionHandler: CollectionHandler, requestColumnExpansionFactory: RequestColumnExpansionFactory, itemEntryService: ItemEntryService, keyService: KeyService);
|
|
12
|
+
construct(compilation: any, parameterMap: any, breakupByParent?: boolean): CreateRequest;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ItemCache from "../classes/ItemCache";
|
|
2
|
+
import ItemEntryService from '../classes/ItemEntryService';
|
|
3
|
+
import QueryMatcherFactory from "./QueryMatcherFactory";
|
|
4
|
+
export default class ItemCacheFactory {
|
|
5
|
+
private queryMatcherFactory;
|
|
6
|
+
private itemEntryService;
|
|
7
|
+
constructor(queryMatcherFactory: QueryMatcherFactory, itemEntryService: ItemEntryService);
|
|
8
|
+
construct(): ItemCache;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ItemEntry from "../models/ItemEntry";
|
|
2
|
+
import ItemResource from "../models/ItemResource";
|
|
3
|
+
export default class ItemEntryFactory {
|
|
4
|
+
constructor();
|
|
5
|
+
construct(itemType: string, itemId: number, columns?: any, initial?: {}, derived?: {}, resources?: ItemResource[]): ItemEntry;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ItemEntryService from '../classes/ItemEntryService';
|
|
2
|
+
import ItemResourceService from "../classes/ItemResourceService";
|
|
3
|
+
import { EditResource } from "../models/EditResource";
|
|
4
|
+
import ItemEntry from "../models/ItemEntry";
|
|
5
|
+
import ItemResource from "../models/ItemResource";
|
|
6
|
+
export default class ItemResourceFactory {
|
|
7
|
+
private itemEntryService;
|
|
8
|
+
private itemResourceService;
|
|
9
|
+
constructor(itemEntryService: ItemEntryService, itemResourceService: ItemResourceService);
|
|
10
|
+
getConstructor(options: any): (itemEntry: any) => EditResource;
|
|
11
|
+
construct(itemEntry: ItemEntry, options: any): ItemResource;
|
|
12
|
+
}
|
|
@@ -3,19 +3,8 @@ import ItemCache from "../classes/ItemCache";
|
|
|
3
3
|
import ItemEntryService from '../classes/ItemEntryService';
|
|
4
4
|
import ModuleChangesCompiler from "../classes/ModuleChangesCompiler";
|
|
5
5
|
import ItemEntry from "../models/ItemEntry";
|
|
6
|
-
|
|
7
6
|
export default class ModuleChangesCompilerFactory {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
construct (rootItem: ItemEntry, singleItemCache: ItemCache, collectionCache: CollectionCache) {
|
|
14
|
-
return new ModuleChangesCompiler(
|
|
15
|
-
this.itemEntryService,
|
|
16
|
-
rootItem,
|
|
17
|
-
singleItemCache,
|
|
18
|
-
collectionCache
|
|
19
|
-
);
|
|
20
|
-
}
|
|
7
|
+
private itemEntryService;
|
|
8
|
+
constructor(itemEntryService: ItemEntryService);
|
|
9
|
+
construct(rootItem: ItemEntry, singleItemCache: ItemCache, collectionCache: CollectionCache): ModuleChangesCompiler;
|
|
21
10
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import ApiFormatter from '../classes/ApiFormatter';
|
|
2
|
+
import QueryMatcher from "../classes/QueryMatcher";
|
|
3
|
+
export default class QueryMatcherFactory {
|
|
4
|
+
private apiFormatter;
|
|
5
|
+
constructor(apiFormatter: ApiFormatter);
|
|
6
|
+
construct(parentType: string, parentId: number, fields: object, itemType?: string): QueryMatcher;
|
|
7
|
+
}
|