@rentman/rm-core 1.3.8 → 1.4.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 +347 -338
- package/dist/rm-core.js +7058 -6882
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/ApiFormatter.d.ts +40 -40
- package/dist/src/classes/ApiRequestService.d.ts +20 -20
- package/dist/src/classes/ApiResponseProcessor.d.ts +33 -33
- package/dist/src/classes/BatchStatus.d.ts +25 -19
- package/dist/src/classes/ChangesCompilation.d.ts +43 -43
- package/dist/src/classes/ChangesProcessor.d.ts +33 -33
- package/dist/src/classes/CollectionCache.d.ts +37 -37
- package/dist/src/classes/CollectionEntryService.d.ts +26 -26
- package/dist/src/classes/CollectionHandler.d.ts +56 -57
- package/dist/src/classes/CollectionMatcher.d.ts +30 -30
- package/dist/src/classes/CollectionResourceService.d.ts +5 -5
- package/dist/src/classes/ColumnCache.d.ts +21 -21
- package/dist/src/classes/ColumnExpansion.d.ts +18 -14
- package/dist/src/classes/ColumnHandler.d.ts +21 -21
- package/dist/src/classes/ColumnInfo.d.ts +14 -12
- package/dist/src/classes/ColumnSet.d.ts +46 -43
- package/dist/src/classes/ColumnUtil.d.ts +76 -76
- package/dist/src/classes/CreateRequest.d.ts +20 -20
- package/dist/src/classes/ItemAdministrator.d.ts +108 -103
- package/dist/src/classes/ItemCache.d.ts +22 -21
- package/dist/src/classes/ItemEntryService.d.ts +24 -23
- package/dist/src/classes/ItemHandler.d.ts +77 -76
- package/dist/src/classes/ItemRequestService.d.ts +23 -23
- package/dist/src/classes/ItemResourceService.d.ts +5 -5
- package/dist/src/classes/KeyService.d.ts +16 -16
- package/dist/src/classes/LocalCache.d.ts +50 -50
- package/dist/src/classes/LockService.d.ts +23 -23
- package/dist/src/classes/ModuleChangesCompilation.d.ts +21 -21
- package/dist/src/classes/QueryMatcher.d.ts +14 -14
- package/dist/src/classes/QueryParser.d.ts +16 -16
- package/dist/src/classes/QueryService.d.ts +19 -19
- package/dist/src/classes/RequestColumnExpansion.d.ts +12 -9
- package/dist/src/classes/SocketMessageHandler.d.ts +36 -32
- package/dist/src/classes/Util.d.ts +25 -25
- package/dist/src/classes/index.d.ts +34 -34
- package/dist/src/constants.d.ts +16 -16
- package/dist/src/core.d.ts +48 -48
- package/dist/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/src/factories/BatchStatusFactory.d.ts +8 -9
- package/dist/src/factories/ChangesCompilationFactory.d.ts +9 -9
- package/dist/src/factories/ChangesProcessorFactory.d.ts +18 -18
- package/dist/src/factories/CollectionCacheFactory.d.ts +7 -7
- package/dist/src/factories/CollectionEntryFactory.d.ts +18 -18
- package/dist/src/factories/CollectionMatcherFactory.d.ts +7 -7
- package/dist/src/factories/CollectionResourceFactory.d.ts +14 -14
- package/dist/src/factories/ColumnExpansionFactory.d.ts +9 -6
- package/dist/src/factories/ColumnInfoFactory.d.ts +6 -6
- package/dist/src/factories/ColumnSetFactory.d.ts +11 -11
- package/dist/src/factories/CreateRequestFactory.d.ts +11 -11
- package/dist/src/factories/ItemCacheFactory.d.ts +7 -7
- package/dist/src/factories/ItemEntryFactory.d.ts +19 -19
- package/dist/src/factories/ItemResourceFactory.d.ts +15 -15
- package/dist/src/factories/LocalCacheFactory.d.ts +16 -16
- package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +5 -5
- package/dist/src/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/src/factories/QueryParserFactory.d.ts +5 -5
- package/dist/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/src/factories/TemplateFactory.d.ts +10 -10
- package/dist/src/factories/index.d.ts +21 -21
- package/dist/src/index.d.ts +7 -7
- package/dist/src/interfaces/ApiRequestServiceInterface.d.ts +11 -11
- package/dist/src/interfaces/AuthInterface.d.ts +9 -9
- package/dist/src/interfaces/ErrorHandlerInterface.d.ts +5 -5
- package/dist/src/interfaces/LocalCacheManagerInterface.d.ts +5 -5
- package/dist/src/interfaces/PromiseLibraryInterface.d.ts +15 -15
- package/dist/src/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/src/interfaces/index.d.ts +6 -6
- package/dist/src/models/CollectionEditResource.d.ts +15 -15
- package/dist/src/models/CollectionEntry.d.ts +64 -64
- package/dist/src/models/CollectionResource.d.ts +40 -40
- package/dist/src/models/CollectionViewResource.d.ts +6 -6
- package/dist/src/models/EditResource.d.ts +18 -18
- package/dist/src/models/ItemEntry.d.ts +71 -69
- package/dist/src/models/ItemResource.d.ts +23 -23
- package/dist/src/models/Template.d.ts +11 -11
- package/dist/src/models/ViewResource.d.ts +4 -4
- package/dist/src/models/index.d.ts +9 -9
- package/dist/src/types/ItemTypesCollection.d.ts +176 -165
- package/dist/src/types/PromiseInterface.d.ts +2 -2
- package/dist/src/types/index.d.ts +2 -2
- package/package.json +35 -35
- package/readme.md +15 -15
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/// <reference types="moment" />
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare class ApiFormatter {
|
|
6
|
-
MOMENT_INVALID: string;
|
|
7
|
-
SERVER_DATETIME_FORMAT: string;
|
|
8
|
-
SERVER_TIME_FORMAT: string;
|
|
9
|
-
SERVER_DATE_FORMAT: string;
|
|
10
|
-
constructor();
|
|
11
|
-
formatResponse(fields: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
12
|
-
expandResponse(current: FieldMap, expanded: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
13
|
-
formatRequest(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
14
|
-
formatRequestLocal(fields: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
15
|
-
hasChanges(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): boolean;
|
|
16
|
-
getChanges(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
17
|
-
copyFields(source: FieldMap, destination: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
18
|
-
shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
19
|
-
setDefaultValues(destination: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
20
|
-
compareFields<T>(columnType: string, first: T, second: T): boolean;
|
|
21
|
-
compareFloats(a: any, b: any): boolean;
|
|
22
|
-
compareMomentObjects(first: any, second: any): boolean;
|
|
23
|
-
compareDurations(first: any, second: any): boolean;
|
|
24
|
-
formatResponseValue(columnType: any, value: any): any;
|
|
25
|
-
formatRequestValue(columnType: any, value: any): any;
|
|
26
|
-
formatResponseDate(value: any): moment.Moment;
|
|
27
|
-
formatResponseDuration(value: any): moment.Duration;
|
|
28
|
-
formatResponseColor(value: any): any;
|
|
29
|
-
formatRequestDateTime(value: any): any;
|
|
30
|
-
formatRequestDate(value: any): any;
|
|
31
|
-
formatRequestDuration(value: any): any;
|
|
32
|
-
formatRequestColor(value: any): any;
|
|
33
|
-
getDefaultValue(columnType: any): false |
|
|
34
|
-
isDefaultValue(columnType: any, value: any): boolean;
|
|
35
|
-
clone(columnType: any, value: any): any;
|
|
36
|
-
getCloneFunction(columnType: any): (date: any) => any;
|
|
37
|
-
cloneDuration(duration: any): moment.Duration;
|
|
38
|
-
cloneDate(date: any): any;
|
|
39
|
-
identity(input: any): any;
|
|
40
|
-
}
|
|
1
|
+
/// <reference types="moment" />
|
|
2
|
+
import * as moment from 'moment';
|
|
3
|
+
import { ColumnInfo } from '../classes';
|
|
4
|
+
import { FieldMap } from '../types';
|
|
5
|
+
export declare class ApiFormatter {
|
|
6
|
+
MOMENT_INVALID: string;
|
|
7
|
+
SERVER_DATETIME_FORMAT: string;
|
|
8
|
+
SERVER_TIME_FORMAT: string;
|
|
9
|
+
SERVER_DATE_FORMAT: string;
|
|
10
|
+
constructor();
|
|
11
|
+
formatResponse(fields: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
12
|
+
expandResponse(current: FieldMap, expanded: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
13
|
+
formatRequest(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
14
|
+
formatRequestLocal(fields: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
15
|
+
hasChanges(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): boolean;
|
|
16
|
+
getChanges(initial: FieldMap, modified: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
17
|
+
copyFields(source: FieldMap, destination: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
18
|
+
shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
19
|
+
setDefaultValues(destination: FieldMap, columns: ColumnInfo[]): FieldMap;
|
|
20
|
+
compareFields<T>(columnType: string, first: T, second: T): boolean;
|
|
21
|
+
compareFloats(a: any, b: any): boolean;
|
|
22
|
+
compareMomentObjects(first: any, second: any): boolean;
|
|
23
|
+
compareDurations(first: any, second: any): boolean;
|
|
24
|
+
formatResponseValue(columnType: any, value: any): any;
|
|
25
|
+
formatRequestValue(columnType: any, value: any): any;
|
|
26
|
+
formatResponseDate(value: any): moment.Moment;
|
|
27
|
+
formatResponseDuration(value: any): moment.Duration;
|
|
28
|
+
formatResponseColor(value: any): any;
|
|
29
|
+
formatRequestDateTime(value: any): any;
|
|
30
|
+
formatRequestDate(value: any): any;
|
|
31
|
+
formatRequestDuration(value: any): any;
|
|
32
|
+
formatRequestColor(value: any): any;
|
|
33
|
+
getDefaultValue(columnType: any): false | moment.Moment | 0 | moment.Duration | "" | "0" | "#000000" | null;
|
|
34
|
+
isDefaultValue(columnType: any, value: any): boolean;
|
|
35
|
+
clone(columnType: any, value: any): any;
|
|
36
|
+
getCloneFunction(columnType: any): (date: any) => any;
|
|
37
|
+
cloneDuration(duration: any): moment.Duration;
|
|
38
|
+
cloneDate(date: any): any;
|
|
39
|
+
identity(input: any): any;
|
|
40
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ApiResponseProcessor } from '../classes';
|
|
2
|
-
import { ApiResponseProcessorFactory } from '../factories';
|
|
3
|
-
import { ApiRequestServiceInterface } from '../interfaces';
|
|
4
|
-
import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ItemId, ItemType, PromiseInterface } from '../types';
|
|
5
|
-
export declare class ApiRequestService {
|
|
6
|
-
private externalApiRequestService;
|
|
7
|
-
private apiResponseProcessorFactory;
|
|
8
|
-
constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
|
|
9
|
-
template(itemType: ItemType, params: any): PromiseInterface<ApiResponseProcessor>;
|
|
10
|
-
create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
|
|
11
|
-
delete(itemType: ItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
|
|
12
|
-
updateItems(itemType: ItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
|
|
13
|
-
requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
|
|
14
|
-
moveItems(parentType: ItemType, parentId: ItemId, items: {
|
|
15
|
-
[itemType: string]: ItemId[];
|
|
16
|
-
}): PromiseInterface<ApiResponseProcessor>;
|
|
17
|
-
columns(itemType: ItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
|
|
18
|
-
query(itemType: ItemType, query: any, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
|
|
19
|
-
processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
|
|
20
|
-
}
|
|
1
|
+
import { ApiResponseProcessor } from '../classes';
|
|
2
|
+
import { ApiResponseProcessorFactory } from '../factories';
|
|
3
|
+
import { ApiRequestServiceInterface } from '../interfaces';
|
|
4
|
+
import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ItemId, ItemType, PromiseInterface } from '../types';
|
|
5
|
+
export declare class ApiRequestService {
|
|
6
|
+
private externalApiRequestService;
|
|
7
|
+
private apiResponseProcessorFactory;
|
|
8
|
+
constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
|
|
9
|
+
template(itemType: ItemType, params: any): PromiseInterface<ApiResponseProcessor>;
|
|
10
|
+
create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
|
|
11
|
+
delete(itemType: ItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
|
|
12
|
+
updateItems(itemType: ItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
|
|
13
|
+
requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
|
|
14
|
+
moveItems(parentType: ItemType, parentId: ItemId, items: {
|
|
15
|
+
[itemType: string]: ItemId[];
|
|
16
|
+
}): PromiseInterface<ApiResponseProcessor>;
|
|
17
|
+
columns(itemType: ItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
|
|
18
|
+
query(itemType: ItemType, query: any, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
|
|
19
|
+
processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
|
|
20
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ApiFormatter } from '../classes';
|
|
2
|
-
import { ItemTypeMap } from '../types';
|
|
3
|
-
export declare class ApiResponseProcessor {
|
|
4
|
-
apiFormatter: ApiFormatter;
|
|
5
|
-
response: any;
|
|
6
|
-
columns: ItemTypeMap;
|
|
7
|
-
items: ItemTypeMap;
|
|
8
|
-
links: ItemTypeMap;
|
|
9
|
-
cacheable: boolean;
|
|
10
|
-
map: any;
|
|
11
|
-
columnIndexMap: any;
|
|
12
|
-
columnMap: any;
|
|
13
|
-
constructor(apiFormatter: ApiFormatter, response: any);
|
|
14
|
-
createColumnMaps(): void;
|
|
15
|
-
fetchValue(itemType: any, itemId: any, columnId: any): any;
|
|
16
|
-
fetchDerivedObject(itemType: any, itemId: any, rootColumns: any): {};
|
|
17
|
-
fetchDerivedValues(value: any, column: any, destination: any): void;
|
|
18
|
-
fetchObject(itemType: any, itemId: any, includeLinks?: boolean): any;
|
|
19
|
-
fetchObjectArray(itemType: any, includeLinks: any, idArray: any): any;
|
|
20
|
-
fetchObjectMap(itemType: any, columnId: any, includeLinks: any, returnKeys: any): {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
};
|
|
23
|
-
fetchFieldMap(itemType: any, columnId: any): {};
|
|
24
|
-
fetchColumnArray(itemType: any): any[];
|
|
25
|
-
fetchColumnObject(itemType: any): any;
|
|
26
|
-
fetchColumnsObject(): any;
|
|
27
|
-
createResource(itemType: any, id: any): {
|
|
28
|
-
object: any;
|
|
29
|
-
links: any;
|
|
30
|
-
};
|
|
31
|
-
hasItems(itemType: any): boolean;
|
|
32
|
-
getIdArray(itemType: any): string[];
|
|
33
|
-
}
|
|
1
|
+
import { ApiFormatter } from '../classes';
|
|
2
|
+
import { ItemTypeMap } from '../types';
|
|
3
|
+
export declare class ApiResponseProcessor {
|
|
4
|
+
apiFormatter: ApiFormatter;
|
|
5
|
+
response: any;
|
|
6
|
+
columns: ItemTypeMap;
|
|
7
|
+
items: ItemTypeMap;
|
|
8
|
+
links: ItemTypeMap;
|
|
9
|
+
cacheable: boolean;
|
|
10
|
+
map: any;
|
|
11
|
+
columnIndexMap: any;
|
|
12
|
+
columnMap: any;
|
|
13
|
+
constructor(apiFormatter: ApiFormatter, response: any);
|
|
14
|
+
createColumnMaps(): void;
|
|
15
|
+
fetchValue(itemType: any, itemId: any, columnId: any): any;
|
|
16
|
+
fetchDerivedObject(itemType: any, itemId: any, rootColumns: any): {};
|
|
17
|
+
fetchDerivedValues(value: any, column: any, destination: any): void;
|
|
18
|
+
fetchObject(itemType: any, itemId: any, includeLinks?: boolean): any;
|
|
19
|
+
fetchObjectArray(itemType: any, includeLinks: any, idArray: any): any;
|
|
20
|
+
fetchObjectMap(itemType: any, columnId: any, includeLinks: any, returnKeys: any): {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
fetchFieldMap(itemType: any, columnId: any): {};
|
|
24
|
+
fetchColumnArray(itemType: any): any[];
|
|
25
|
+
fetchColumnObject(itemType: any): any;
|
|
26
|
+
fetchColumnsObject(): any;
|
|
27
|
+
createResource(itemType: any, id: any): {
|
|
28
|
+
object: any;
|
|
29
|
+
links: any;
|
|
30
|
+
};
|
|
31
|
+
hasItems(itemType: any): boolean;
|
|
32
|
+
getIdArray(itemType: any): string[];
|
|
33
|
+
}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import { ENTRY_STATUS } from '../constants';
|
|
2
|
-
import { PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly
|
|
10
|
-
entries:
|
|
11
|
-
constructor(promiseService: PromiseLibraryInterface, getItemId: (itemEntry:
|
|
12
|
-
add(entryStatus: EntryStatus<
|
|
13
|
-
hasEntries(statusArray: ENTRY_STATUS[]): boolean;
|
|
14
|
-
hasRequests(): boolean;
|
|
15
|
-
forEachEntry(statusArray: ENTRY_STATUS[], callback: (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { ENTRY_STATUS } from '../constants';
|
|
2
|
+
import { PromiseLibraryInterface } from '../interfaces';
|
|
3
|
+
import { EntryStatus, EntryStatusMap, ItemId, PromiseInterface } from '../types';
|
|
4
|
+
export declare class BatchStatus<T> {
|
|
5
|
+
private promiseService;
|
|
6
|
+
getItemId: (itemEntry: T) => ItemId;
|
|
7
|
+
getPromise: (itemEntry: T) => PromiseInterface<T>;
|
|
8
|
+
readonly requestStatus: ENTRY_STATUS[];
|
|
9
|
+
readonly remoteExpandStatus: ENTRY_STATUS[];
|
|
10
|
+
entries: EntryStatusMap<T>;
|
|
11
|
+
constructor(promiseService: PromiseLibraryInterface, getItemId: (itemEntry: T) => ItemId, getPromise: (itemEntry: T) => PromiseInterface<T>);
|
|
12
|
+
add(entryStatus: EntryStatus<T>): void;
|
|
13
|
+
hasEntries(statusArray: ENTRY_STATUS[]): boolean;
|
|
14
|
+
hasRequests(): boolean;
|
|
15
|
+
forEachEntry(statusArray: ENTRY_STATUS[], callback: (entry: T, itemId: ItemId) => void): void;
|
|
16
|
+
reduceEntries<U>(statusArray: ENTRY_STATUS[], callback: (entry: T, itemId: ItemId, destination: U) => void, destination: U): U;
|
|
17
|
+
reduceAllEntries<U>(callback: (entry: T, itemId: ItemId, destination: U) => void, destination: U): U;
|
|
18
|
+
getPromises(): PromiseInterface<T[]>;
|
|
19
|
+
getItemIds(statusArray: ENTRY_STATUS[]): ItemId[];
|
|
20
|
+
getRequestIds(): ItemId[];
|
|
21
|
+
getArray(statusArray?: ENTRY_STATUS[]): T[];
|
|
22
|
+
getMap(): {
|
|
23
|
+
[itemId: string]: T;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { CollectionCache, KeyService } from '../classes';
|
|
2
|
-
import { CollectionCacheFactory } from '../factories';
|
|
3
|
-
import { CollectionEntry, ItemEntry } from '../models';
|
|
4
|
-
import { EntryParent, EntryParentNull, ItemEntryMap, ItemId, ItemType } from '../types';
|
|
5
|
-
export declare type CreateCompilation = {
|
|
6
|
-
[parentType: string]: {
|
|
7
|
-
[parentId: number]: ItemEntryMap;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare type DeleteCompilation = {
|
|
11
|
-
[itemType: string]: ItemEntry[];
|
|
12
|
-
};
|
|
13
|
-
export declare type UpdateCompilation = ItemEntryMap;
|
|
14
|
-
export declare type MoveCompilation = {
|
|
15
|
-
[parentType: string]: {
|
|
16
|
-
[parentId: number]: ItemEntry[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare class ChangesCompilation {
|
|
20
|
-
private collectionCacheFactory;
|
|
21
|
-
private keyService;
|
|
22
|
-
singleItems: ItemEntry[];
|
|
23
|
-
compilation: {
|
|
24
|
-
create: CreateCompilation;
|
|
25
|
-
delete: DeleteCompilation;
|
|
26
|
-
update: UpdateCompilation;
|
|
27
|
-
move: MoveCompilation;
|
|
28
|
-
};
|
|
29
|
-
collections: CollectionCache;
|
|
30
|
-
private moveArray;
|
|
31
|
-
private deleteMap;
|
|
32
|
-
constructor(collectionCacheFactory: CollectionCacheFactory, keyService: KeyService, singleItems: ItemEntry[], collectionEntries: CollectionEntry[]);
|
|
33
|
-
getDefaultParent(): EntryParent;
|
|
34
|
-
addMoveEntry(itemEntry: ItemEntry): void;
|
|
35
|
-
addDeleteEntry(itemEntry: ItemEntry, parent: EntryParentNull): void;
|
|
36
|
-
addUpdateEntry(itemEntry: ItemEntry): void;
|
|
37
|
-
addCreateEntry(itemEntry: ItemEntry): void;
|
|
38
|
-
containsCreateEntry(itemType: ItemType, itemId: ItemId): boolean;
|
|
39
|
-
private createDeleteCompilation();
|
|
40
|
-
postProcess(): void;
|
|
41
|
-
private processSingleItems();
|
|
42
|
-
private processCollections(collectionEntries);
|
|
43
|
-
}
|
|
1
|
+
import { CollectionCache, KeyService } from '../classes';
|
|
2
|
+
import { CollectionCacheFactory } from '../factories';
|
|
3
|
+
import { CollectionEntry, ItemEntry } from '../models';
|
|
4
|
+
import { EntryParent, EntryParentNull, ItemEntryMap, ItemId, ItemType } from '../types';
|
|
5
|
+
export declare type CreateCompilation = {
|
|
6
|
+
[parentType: string]: {
|
|
7
|
+
[parentId: number]: ItemEntryMap;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare type DeleteCompilation = {
|
|
11
|
+
[itemType: string]: ItemEntry[];
|
|
12
|
+
};
|
|
13
|
+
export declare type UpdateCompilation = ItemEntryMap;
|
|
14
|
+
export declare type MoveCompilation = {
|
|
15
|
+
[parentType: string]: {
|
|
16
|
+
[parentId: number]: ItemEntry[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare class ChangesCompilation {
|
|
20
|
+
private collectionCacheFactory;
|
|
21
|
+
private keyService;
|
|
22
|
+
singleItems: ItemEntry[];
|
|
23
|
+
compilation: {
|
|
24
|
+
create: CreateCompilation;
|
|
25
|
+
delete: DeleteCompilation;
|
|
26
|
+
update: UpdateCompilation;
|
|
27
|
+
move: MoveCompilation;
|
|
28
|
+
};
|
|
29
|
+
collections: CollectionCache;
|
|
30
|
+
private moveArray;
|
|
31
|
+
private deleteMap;
|
|
32
|
+
constructor(collectionCacheFactory: CollectionCacheFactory, keyService: KeyService, singleItems: ItemEntry[], collectionEntries: CollectionEntry[]);
|
|
33
|
+
getDefaultParent(): EntryParent;
|
|
34
|
+
addMoveEntry(itemEntry: ItemEntry): void;
|
|
35
|
+
addDeleteEntry(itemEntry: ItemEntry, parent: EntryParentNull): void;
|
|
36
|
+
addUpdateEntry(itemEntry: ItemEntry): void;
|
|
37
|
+
addCreateEntry(itemEntry: ItemEntry): void;
|
|
38
|
+
containsCreateEntry(itemType: ItemType, itemId: ItemId): boolean;
|
|
39
|
+
private createDeleteCompilation();
|
|
40
|
+
postProcess(): void;
|
|
41
|
+
private processSingleItems();
|
|
42
|
+
private processCollections(collectionEntries);
|
|
43
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ApiFormatter, CollectionEntryService, CollectionHandler, ItemHandler } from '../classes';
|
|
2
|
-
import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
-
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
import { CollectionEntry, ItemEntry } from '../models';
|
|
5
|
-
import { CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
6
|
-
export declare class ChangesProcessor {
|
|
7
|
-
private apiFormatter;
|
|
8
|
-
private apiRequestService;
|
|
9
|
-
private changesCompilationFactory;
|
|
10
|
-
private collectionEntryService;
|
|
11
|
-
private collectionHandler;
|
|
12
|
-
private columnExpansionFactory;
|
|
13
|
-
private createRequestFactory;
|
|
14
|
-
private errorHandler;
|
|
15
|
-
private itemHandler;
|
|
16
|
-
private promiseService;
|
|
17
|
-
private requestColumnExpansionFactory;
|
|
18
|
-
constructor(apiFormatter: ApiFormatter, apiRequestService: ApiRequestServiceInterface, changesCompilationFactory: ChangesCompilationFactory, collectionEntryService: CollectionEntryService, collectionHandler: CollectionHandler, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory);
|
|
19
|
-
buildMoveRequest(compilationEntries: any): {};
|
|
20
|
-
getMapValue(itemType: ItemType, itemId: number | string, map: ItemIdConversionMap): ItemId | undefined;
|
|
21
|
-
private executeCreateRequests(changesCompilation, parameters, conversionMap, breakupByParent?, onAfterCreateCallback?);
|
|
22
|
-
private executeCreateRequest(requestResource, conversionMap);
|
|
23
|
-
private executeUpdateRequests(compilation, parameters);
|
|
24
|
-
private executeUpdateRequest(itemType, itemEntries, parameterMap);
|
|
25
|
-
private executeDeleteRequests(compilation);
|
|
26
|
-
private executeDeleteRequest(itemType, itemEntries);
|
|
27
|
-
private executeMoveRequests(compilation, conversionMap);
|
|
28
|
-
private processMoveResponse(compilationEntries);
|
|
29
|
-
private addCollectionMapEntry(collectionMap, parentId, itemEntry, value);
|
|
30
|
-
private forEachCollection(collectionMap, method);
|
|
31
|
-
private onItemsCreated(conversionMap, singleItems, collections);
|
|
32
|
-
execute(singleItems: ItemEntry[], collections: CollectionEntry[], parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): PromiseInterface<ItemIdConversionMap>;
|
|
33
|
-
}
|
|
1
|
+
import { ApiFormatter, CollectionEntryService, CollectionHandler, ItemHandler } from '../classes';
|
|
2
|
+
import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
+
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
+
import { CollectionEntry, ItemEntry } from '../models';
|
|
5
|
+
import { CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
6
|
+
export declare class ChangesProcessor {
|
|
7
|
+
private apiFormatter;
|
|
8
|
+
private apiRequestService;
|
|
9
|
+
private changesCompilationFactory;
|
|
10
|
+
private collectionEntryService;
|
|
11
|
+
private collectionHandler;
|
|
12
|
+
private columnExpansionFactory;
|
|
13
|
+
private createRequestFactory;
|
|
14
|
+
private errorHandler;
|
|
15
|
+
private itemHandler;
|
|
16
|
+
private promiseService;
|
|
17
|
+
private requestColumnExpansionFactory;
|
|
18
|
+
constructor(apiFormatter: ApiFormatter, apiRequestService: ApiRequestServiceInterface, changesCompilationFactory: ChangesCompilationFactory, collectionEntryService: CollectionEntryService, collectionHandler: CollectionHandler, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory);
|
|
19
|
+
buildMoveRequest(compilationEntries: any): {};
|
|
20
|
+
getMapValue(itemType: ItemType, itemId: number | string, map: ItemIdConversionMap): ItemId | undefined;
|
|
21
|
+
private executeCreateRequests(changesCompilation, parameters, conversionMap, breakupByParent?, onAfterCreateCallback?);
|
|
22
|
+
private executeCreateRequest(requestResource, conversionMap);
|
|
23
|
+
private executeUpdateRequests(compilation, parameters);
|
|
24
|
+
private executeUpdateRequest(itemType, itemEntries, parameterMap);
|
|
25
|
+
private executeDeleteRequests(compilation);
|
|
26
|
+
private executeDeleteRequest(itemType, itemEntries);
|
|
27
|
+
private executeMoveRequests(compilation, conversionMap);
|
|
28
|
+
private processMoveResponse(compilationEntries);
|
|
29
|
+
private addCollectionMapEntry(collectionMap, parentId, itemEntry, value);
|
|
30
|
+
private forEachCollection(collectionMap, method);
|
|
31
|
+
private onItemsCreated(conversionMap, singleItems, collections);
|
|
32
|
+
execute(singleItems: ItemEntry[], collections: CollectionEntry[], parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): PromiseInterface<ItemIdConversionMap>;
|
|
33
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { QueryMatcherFactory } from '../factories';
|
|
2
|
-
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
|
-
import { CollectionMatchResult, EntryParentNull, FieldMap, ItemType } from '../types';
|
|
4
|
-
export declare class CollectionCache {
|
|
5
|
-
private queryMatcherFactory;
|
|
6
|
-
entries: {
|
|
7
|
-
[itemType: string]: {
|
|
8
|
-
[collectionEntryId: number]: CollectionEntry;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
constructor(queryMatcherFactory: QueryMatcherFactory);
|
|
12
|
-
contains(collectionEntry: CollectionEntry): boolean;
|
|
13
|
-
some(callback: (entry: CollectionEntry) => boolean): boolean;
|
|
14
|
-
forEach(callback: (entry: CollectionEntry) => void): void;
|
|
15
|
-
toArray(): CollectionEntry[];
|
|
16
|
-
add(collectionEntry: CollectionEntry): CollectionEntry;
|
|
17
|
-
clear(collectionEntry?: CollectionEntry): boolean;
|
|
18
|
-
getByItemType(itemType: string): CollectionEntry[];
|
|
19
|
-
matchParent(collectionEntry: CollectionEntry, itemType: string, itemId: any): boolean;
|
|
20
|
-
getByParent(parentType: any, parentId: any, itemType: any): CollectionEntry | null;
|
|
21
|
-
getResourceByParent(parentType: any, parentId: any, itemType: any): CollectionResource | null;
|
|
22
|
-
getCollectionsByParent(parentType: any, parentId: any): CollectionEntry[];
|
|
23
|
-
/**
|
|
24
|
-
* Only resources
|
|
25
|
-
* @param {String} itemType
|
|
26
|
-
* @param {String|Integer} itemId
|
|
27
|
-
* @returns {Object} Array of collections.
|
|
28
|
-
*/
|
|
29
|
-
getByContainingItem(itemType: any, itemId: any): CollectionEntry[];
|
|
30
|
-
/**
|
|
31
|
-
* Returns an array of collections the item 'belongs' in.
|
|
32
|
-
*/
|
|
33
|
-
getByFittingItem(itemType: ItemType, fields: FieldMap, parent: EntryParentNull): CollectionMatchResult;
|
|
34
|
-
getByQuery(itemType: any, query: any): CollectionEntry | null;
|
|
35
|
-
getByKey(itemType: any, entryKey: any): CollectionEntry[];
|
|
36
|
-
getResourceByKey(itemType: any, resourceKey: any): CollectionResource[];
|
|
37
|
-
}
|
|
1
|
+
import { QueryMatcherFactory } from '../factories';
|
|
2
|
+
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
|
+
import { CollectionMatchResult, EntryParentNull, FieldMap, ItemType } from '../types';
|
|
4
|
+
export declare class CollectionCache {
|
|
5
|
+
private queryMatcherFactory;
|
|
6
|
+
entries: {
|
|
7
|
+
[itemType: string]: {
|
|
8
|
+
[collectionEntryId: number]: CollectionEntry;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
constructor(queryMatcherFactory: QueryMatcherFactory);
|
|
12
|
+
contains(collectionEntry: CollectionEntry): boolean;
|
|
13
|
+
some(callback: (entry: CollectionEntry) => boolean): boolean;
|
|
14
|
+
forEach(callback: (entry: CollectionEntry) => void): void;
|
|
15
|
+
toArray(): CollectionEntry[];
|
|
16
|
+
add(collectionEntry: CollectionEntry): CollectionEntry;
|
|
17
|
+
clear(collectionEntry?: CollectionEntry): boolean;
|
|
18
|
+
getByItemType(itemType: string): CollectionEntry[];
|
|
19
|
+
matchParent(collectionEntry: CollectionEntry, itemType: string, itemId: any): boolean;
|
|
20
|
+
getByParent(parentType: any, parentId: any, itemType: any): CollectionEntry | null;
|
|
21
|
+
getResourceByParent(parentType: any, parentId: any, itemType: any): CollectionResource | null;
|
|
22
|
+
getCollectionsByParent(parentType: any, parentId: any): CollectionEntry[];
|
|
23
|
+
/**
|
|
24
|
+
* Only resources
|
|
25
|
+
* @param {String} itemType
|
|
26
|
+
* @param {String|Integer} itemId
|
|
27
|
+
* @returns {Object} Array of collections.
|
|
28
|
+
*/
|
|
29
|
+
getByContainingItem(itemType: any, itemId: any): CollectionEntry[];
|
|
30
|
+
/**
|
|
31
|
+
* Returns an array of collections the item 'belongs' in.
|
|
32
|
+
*/
|
|
33
|
+
getByFittingItem(itemType: ItemType, fields: FieldMap, parent: EntryParentNull): CollectionMatchResult;
|
|
34
|
+
getByQuery(itemType: any, query: any): CollectionEntry | null;
|
|
35
|
+
getByKey(itemType: any, entryKey: any): CollectionEntry[];
|
|
36
|
+
getResourceByKey(itemType: any, resourceKey: any): CollectionResource[];
|
|
37
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { QueryService } from '../classes';
|
|
2
|
-
import { QueryParserFactory } from '../factories';
|
|
3
|
-
import { ItemEntry } from '../models';
|
|
4
|
-
import { ItemId } from '../types';
|
|
5
|
-
export declare class CollectionEntryService {
|
|
6
|
-
private queryParserFactory;
|
|
7
|
-
private queryService;
|
|
8
|
-
constructor(queryParserFactory: QueryParserFactory, queryService: QueryService);
|
|
9
|
-
cloneOptions(options: any, parent: any): any;
|
|
10
|
-
cloneQueryParams(parameters: any): {};
|
|
11
|
-
processOptions(options: any): any;
|
|
12
|
-
createQuery(options: any): {
|
|
13
|
-
object: any;
|
|
14
|
-
string: any;
|
|
15
|
-
};
|
|
16
|
-
getIdArray(itemEntries: ItemEntry[], accumulator: any): ItemId[];
|
|
17
|
-
/**
|
|
18
|
-
* @param {ItemEntry[]} itemEntries
|
|
19
|
-
* @param {(itemEntry: ItemEntry) => boolean} callback
|
|
20
|
-
* @returns {ItemEntry[]}
|
|
21
|
-
*
|
|
22
|
-
* filter an array according to the callback function. Return the entries that failed the condition
|
|
23
|
-
* Replace the given array with the entries that didn't fail the condition.
|
|
24
|
-
*/
|
|
25
|
-
filterArray(itemEntries: ItemEntry[], callback: (itemEntry: ItemEntry) => boolean): ItemEntry[];
|
|
26
|
-
}
|
|
1
|
+
import { QueryService } from '../classes';
|
|
2
|
+
import { QueryParserFactory } from '../factories';
|
|
3
|
+
import { ItemEntry } from '../models';
|
|
4
|
+
import { ItemId } from '../types';
|
|
5
|
+
export declare class CollectionEntryService {
|
|
6
|
+
private queryParserFactory;
|
|
7
|
+
private queryService;
|
|
8
|
+
constructor(queryParserFactory: QueryParserFactory, queryService: QueryService);
|
|
9
|
+
cloneOptions(options: any, parent: any): any;
|
|
10
|
+
cloneQueryParams(parameters: any): {};
|
|
11
|
+
processOptions(options: any): any;
|
|
12
|
+
createQuery(options: any): {
|
|
13
|
+
object: any;
|
|
14
|
+
string: any;
|
|
15
|
+
};
|
|
16
|
+
getIdArray(itemEntries: ItemEntry[], accumulator: any): ItemId[];
|
|
17
|
+
/**
|
|
18
|
+
* @param {ItemEntry[]} itemEntries
|
|
19
|
+
* @param {(itemEntry: ItemEntry) => boolean} callback
|
|
20
|
+
* @returns {ItemEntry[]}
|
|
21
|
+
*
|
|
22
|
+
* filter an array according to the callback function. Return the entries that failed the condition
|
|
23
|
+
* Replace the given array with the entries that didn't fail the condition.
|
|
24
|
+
*/
|
|
25
|
+
filterArray(itemEntries: ItemEntry[], callback: (itemEntry: ItemEntry) => boolean): ItemEntry[];
|
|
26
|
+
}
|