@rentman/rm-core 2.0.11 → 2.0.12
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 +600 -595
- package/dist/rm-core.js +9348 -9342
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/ApiFormatter.d.ts +55 -55
- package/dist/src/classes/ApiRequestService.d.ts +20 -20
- package/dist/src/classes/ApiResponseProcessor.d.ts +29 -29
- package/dist/src/classes/ChangesCompilation.d.ts +34 -34
- package/dist/src/classes/ChangesDelta.d.ts +42 -42
- package/dist/src/classes/ChangesDeltaBase.d.ts +33 -33
- package/dist/src/classes/ChangesProcessor.d.ts +47 -47
- package/dist/src/classes/CollectionCache.d.ts +37 -37
- package/dist/src/classes/CollectionEntryService.d.ts +25 -25
- package/dist/src/classes/CollectionMatcher.d.ts +9 -9
- package/dist/src/classes/CollectionMatcherBase.d.ts +26 -26
- package/dist/src/classes/CollectionResourceService.d.ts +6 -6
- package/dist/src/classes/ColumnCache.d.ts +21 -21
- package/dist/src/classes/ColumnExpansion.d.ts +22 -22
- package/dist/src/classes/ColumnHandler.d.ts +21 -21
- package/dist/src/classes/ColumnInfo.d.ts +14 -14
- package/dist/src/classes/ColumnSet.d.ts +39 -39
- package/dist/src/classes/ColumnSubsetCache.d.ts +8 -8
- package/dist/src/classes/ColumnUtil.d.ts +99 -99
- package/dist/src/classes/CreateRequest.d.ts +19 -19
- package/dist/src/classes/InternalChangesDelta.d.ts +38 -38
- package/dist/src/classes/ItemCache.d.ts +29 -29
- package/dist/src/classes/ItemEntryService.d.ts +41 -41
- package/dist/src/classes/KeyService.d.ts +16 -16
- package/dist/src/classes/LockService.d.ts +32 -32
- package/dist/src/classes/ModuleChangesCompilation.d.ts +18 -18
- package/dist/src/classes/QueryColumnExtractor.d.ts +20 -20
- package/dist/src/classes/QueryMatcher.d.ts +14 -14
- package/dist/src/classes/QueryParser.d.ts +25 -25
- package/dist/src/classes/QueryParserBase.d.ts +29 -29
- package/dist/src/classes/QueryService.d.ts +14 -14
- package/dist/src/classes/RequestBuffer.d.ts +25 -25
- package/dist/src/classes/RequestBufferManager.d.ts +31 -31
- package/dist/src/classes/RequestColumnExpansion.d.ts +15 -15
- package/dist/src/classes/SocketMessageHandler.d.ts +31 -31
- package/dist/src/classes/TemplateCache.d.ts +63 -63
- package/dist/src/classes/Util.d.ts +28 -28
- package/dist/src/classes/cache/AbstractCache.d.ts +140 -140
- package/dist/src/classes/cache/CollectionHandlerBase.d.ts +64 -64
- package/dist/src/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -26
- package/dist/src/classes/cache/ItemHandlerBase.d.ts +95 -95
- package/dist/src/classes/cache/server/ServerCache.d.ts +98 -98
- package/dist/src/classes/cache/server/ServerCollectionHandler.d.ts +43 -43
- package/dist/src/classes/cache/server/ServerItemHandler.d.ts +50 -50
- package/dist/src/classes/cache/transaction/TransactionCache.d.ts +412 -412
- package/dist/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +72 -72
- package/dist/src/classes/cache/transaction/TransactionEventHandler.d.ts +19 -19
- package/dist/src/classes/cache/transaction/TransactionItemHandler.d.ts +114 -114
- package/dist/src/classes/index.d.ts +41 -41
- package/dist/src/constants.d.ts +7 -7
- package/dist/src/core.d.ts +49 -49
- package/dist/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/src/factories/ChangesCompilationFactory.d.ts +6 -6
- package/dist/src/factories/ChangesDeltaFactory.d.ts +9 -9
- package/dist/src/factories/ChangesProcessorFactory.d.ts +22 -22
- package/dist/src/factories/CollectionCacheFactory.d.ts +8 -8
- package/dist/src/factories/CollectionEntryFactory.d.ts +11 -11
- package/dist/src/factories/CollectionMatcherFactory.d.ts +9 -9
- package/dist/src/factories/CollectionResourceFactory.d.ts +34 -34
- package/dist/src/factories/ColumnExpansionFactory.d.ts +8 -8
- package/dist/src/factories/ColumnInfoFactory.d.ts +7 -7
- package/dist/src/factories/ColumnSetFactory.d.ts +19 -19
- package/dist/src/factories/ColumnSubsetCacheFactory.d.ts +6 -6
- package/dist/src/factories/CreateRequestFactory.d.ts +11 -11
- package/dist/src/factories/ItemCacheFactory.d.ts +8 -8
- package/dist/src/factories/ItemEntryFactory.d.ts +17 -17
- package/dist/src/factories/ItemResourceFactory.d.ts +32 -32
- 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 +6 -6
- package/dist/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/src/factories/TemplateFactory.d.ts +10 -10
- package/dist/src/factories/TransactionCacheFactory.d.ts +55 -55
- package/dist/src/factories/index.d.ts +22 -22
- 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/ExceptionHandlerInterface.d.ts +3 -3
- package/dist/src/interfaces/LinkTreeServiceInterface.d.ts +4 -4
- package/dist/src/interfaces/PromiseLibraryInterface.d.ts +25 -25
- package/dist/src/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/src/interfaces/index.d.ts +7 -7
- package/dist/src/models/CollectionEditResource.d.ts +17 -17
- package/dist/src/models/CollectionEntry.d.ts +27 -27
- package/dist/src/models/CollectionEntryOptions.d.ts +13 -13
- package/dist/src/models/CollectionResource.d.ts +52 -52
- package/dist/src/models/CollectionResourceOptions.d.ts +27 -27
- package/dist/src/models/CollectionViewResource.d.ts +7 -7
- package/dist/src/models/EditResource.d.ts +16 -16
- package/dist/src/models/ItemEntry.d.ts +19 -19
- package/dist/src/models/ItemEntryOptions.d.ts +9 -9
- package/dist/src/models/ItemResource.d.ts +87 -87
- package/dist/src/models/ItemResourceOptions.d.ts +9 -9
- package/dist/src/models/LocalViewResource.d.ts +7 -7
- package/dist/src/models/RemoteViewResource.d.ts +7 -7
- package/dist/src/models/Template.d.ts +11 -11
- package/dist/src/models/ViewResource.d.ts +8 -8
- package/dist/src/models/index.d.ts +15 -15
- package/dist/src/types/ItemTypesCollection.d.ts +262 -262
- package/dist/src/types/PromiseInterface.d.ts +2 -2
- package/dist/src/types/index.d.ts +2 -2
- package/package.json +36 -36
- package/readme.md +15 -15
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import * as moment from 'moment';
|
|
2
|
-
import { ColumnInfo } from '../classes';
|
|
3
|
-
import { FieldMap, ItemType } from '../types';
|
|
4
|
-
export declare class ApiFormatter {
|
|
5
|
-
MOMENT_INVALID: string;
|
|
6
|
-
SERVER_DATETIME_FORMAT: string;
|
|
7
|
-
SERVER_TIME_FORMAT: string;
|
|
8
|
-
SERVER_DATE_FORMAT: string;
|
|
9
|
-
constructor();
|
|
10
|
-
/**
|
|
11
|
-
* @description
|
|
12
|
-
* Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
|
|
13
|
-
*
|
|
14
|
-
* ----
|
|
15
|
-
* @remarks
|
|
16
|
-
* Currently only used for Moment objects
|
|
17
|
-
*/
|
|
18
|
-
isExpensiveFormat(columnType: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* @description
|
|
21
|
-
* Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
|
|
22
|
-
*/
|
|
23
|
-
mergeCopyFields<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, changes: FieldMap<ItemTypeType>, newInitial: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType>;
|
|
24
|
-
formatRequest<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
25
|
-
formatRequestLocal<ItemTypeType extends ItemType>(fields: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
26
|
-
hasChanges(initial: FieldMap, modified: FieldMap, columns: Array<ColumnInfo<any
|
|
27
|
-
getChanges<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
28
|
-
copyFields<ItemTypeType extends ItemType>(source: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
29
|
-
shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
|
|
30
|
-
setDefaultValues(destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
|
|
31
|
-
/**
|
|
32
|
-
* @description
|
|
33
|
-
* Compares the given fields, returns `true` when the fields are equal
|
|
34
|
-
*/
|
|
35
|
-
compareFields(columnType: string, first?: any, second?: any): boolean;
|
|
36
|
-
compareFloats(a: number, b: number): boolean;
|
|
37
|
-
compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
|
|
38
|
-
compareDurations(first: moment.Duration, second: moment.Duration): boolean;
|
|
39
|
-
formatResponseValue(columnType: string, value: any): any;
|
|
40
|
-
formatRequestValue(columnType: string, value: any): any;
|
|
41
|
-
formatResponseDate(value: null | any): moment.Moment;
|
|
42
|
-
formatResponseDuration(value: null | number): moment.Duration;
|
|
43
|
-
formatResponseColor(value: string): string;
|
|
44
|
-
formatRequestDateTime(value: moment.Moment): string | null;
|
|
45
|
-
formatRequestDate(value: moment.Moment): string | null;
|
|
46
|
-
formatRequestDuration(value: moment.Duration): number;
|
|
47
|
-
formatRequestColor(value: string): string;
|
|
48
|
-
getDefaultValue(columnType: string): any;
|
|
49
|
-
isDefaultValue(columnType: string, value: any): boolean;
|
|
50
|
-
clone(columnType: string, value: any): any;
|
|
51
|
-
getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
|
|
52
|
-
cloneDuration(duration: moment.Duration): moment.Duration;
|
|
53
|
-
cloneDate(date: moment.Moment): moment.Moment;
|
|
54
|
-
identity<T>(input: T): T;
|
|
55
|
-
}
|
|
1
|
+
import * as moment from 'moment';
|
|
2
|
+
import { ColumnInfo } from '../classes';
|
|
3
|
+
import { FieldMap, ItemType } from '../types';
|
|
4
|
+
export declare class ApiFormatter {
|
|
5
|
+
MOMENT_INVALID: string;
|
|
6
|
+
SERVER_DATETIME_FORMAT: string;
|
|
7
|
+
SERVER_TIME_FORMAT: string;
|
|
8
|
+
SERVER_DATE_FORMAT: string;
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* @description
|
|
12
|
+
* Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
|
|
13
|
+
*
|
|
14
|
+
* ----
|
|
15
|
+
* @remarks
|
|
16
|
+
* Currently only used for Moment objects
|
|
17
|
+
*/
|
|
18
|
+
isExpensiveFormat(columnType: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
|
|
22
|
+
*/
|
|
23
|
+
mergeCopyFields<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, changes: FieldMap<ItemTypeType>, newInitial: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType>;
|
|
24
|
+
formatRequest<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
25
|
+
formatRequestLocal<ItemTypeType extends ItemType>(fields: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
26
|
+
hasChanges(initial: FieldMap, modified: FieldMap, columns: Array<ColumnInfo<any>>): boolean;
|
|
27
|
+
getChanges<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
28
|
+
copyFields<ItemTypeType extends ItemType>(source: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
|
|
29
|
+
shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
|
|
30
|
+
setDefaultValues(destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
|
|
31
|
+
/**
|
|
32
|
+
* @description
|
|
33
|
+
* Compares the given fields, returns `true` when the fields are equal
|
|
34
|
+
*/
|
|
35
|
+
compareFields(columnType: string, first?: any, second?: any): boolean;
|
|
36
|
+
compareFloats(a: number, b: number): boolean;
|
|
37
|
+
compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
|
|
38
|
+
compareDurations(first: moment.Duration, second: moment.Duration): boolean;
|
|
39
|
+
formatResponseValue(columnType: string, value: any): any;
|
|
40
|
+
formatRequestValue(columnType: string, value: any): any;
|
|
41
|
+
formatResponseDate(value: null | any): moment.Moment;
|
|
42
|
+
formatResponseDuration(value: null | number): moment.Duration;
|
|
43
|
+
formatResponseColor(value: string): string;
|
|
44
|
+
formatRequestDateTime(value: moment.Moment): string | null;
|
|
45
|
+
formatRequestDate(value: moment.Moment): string | null;
|
|
46
|
+
formatRequestDuration(value: moment.Duration): number;
|
|
47
|
+
formatRequestColor(value: string): string;
|
|
48
|
+
getDefaultValue(columnType: string): any;
|
|
49
|
+
isDefaultValue(columnType: string, value: any): boolean;
|
|
50
|
+
clone(columnType: string, value: any): any;
|
|
51
|
+
getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
|
|
52
|
+
cloneDuration(duration: moment.Duration): moment.Duration;
|
|
53
|
+
cloneDate(date: moment.Moment): moment.Moment;
|
|
54
|
+
identity<T>(input: T): T;
|
|
55
|
+
}
|
|
@@ -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,29 +1,29 @@
|
|
|
1
|
-
import { ApiFormatter } from '../classes';
|
|
2
|
-
import { FieldMap, ItemId, ItemType, ItemTypeMap, ResponseColumn } from '../types';
|
|
3
|
-
export declare class ApiResponseProcessor {
|
|
4
|
-
apiFormatter: ApiFormatter;
|
|
5
|
-
response: any;
|
|
6
|
-
columns: ItemTypeMap<ResponseColumn[]>;
|
|
7
|
-
links: ItemTypeMap<ItemId[]>;
|
|
8
|
-
cacheable: boolean;
|
|
9
|
-
map: any;
|
|
10
|
-
items: any;
|
|
11
|
-
columnIndexMap: {
|
|
12
|
-
[itemType: string]: {
|
|
13
|
-
[columnId: string]: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
columnMap: any;
|
|
17
|
-
constructor(apiFormatter: ApiFormatter, response: any);
|
|
18
|
-
private createColumnMaps;
|
|
19
|
-
fetchColumnObject(itemType: ItemType): ResponseColumn;
|
|
20
|
-
fetchValue(itemType: ItemType, itemId: ItemId, columnId: string): any;
|
|
21
|
-
fetchColumnArray(itemType: ItemType): ResponseColumn[];
|
|
22
|
-
fetchDerivedObject(itemType: ItemType, itemId: ItemId, rootColumns: ResponseColumn[]): {};
|
|
23
|
-
fetchDerivedValues(value: any, column: ResponseColumn, destination: any): void;
|
|
24
|
-
fetchObject<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: string | ItemId, includeLinks?: boolean): FieldMap<ItemTypeType> | undefined;
|
|
25
|
-
fetchObjectArray<ItemTypeType extends ItemType>(itemType: ItemTypeType, includeLinks?: boolean, idArray?: ItemId[] | null): Array<FieldMap<ItemTypeType>>;
|
|
26
|
-
fetchColumnsObject(): {
|
|
27
|
-
[itemType: string]: ResponseColumn;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
1
|
+
import { ApiFormatter } from '../classes';
|
|
2
|
+
import { FieldMap, ItemId, ItemType, ItemTypeMap, ResponseColumn } from '../types';
|
|
3
|
+
export declare class ApiResponseProcessor {
|
|
4
|
+
apiFormatter: ApiFormatter;
|
|
5
|
+
response: any;
|
|
6
|
+
columns: ItemTypeMap<ResponseColumn[]>;
|
|
7
|
+
links: ItemTypeMap<ItemId[]>;
|
|
8
|
+
cacheable: boolean;
|
|
9
|
+
map: any;
|
|
10
|
+
items: any;
|
|
11
|
+
columnIndexMap: {
|
|
12
|
+
[itemType: string]: {
|
|
13
|
+
[columnId: string]: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
columnMap: any;
|
|
17
|
+
constructor(apiFormatter: ApiFormatter, response: any);
|
|
18
|
+
private createColumnMaps;
|
|
19
|
+
fetchColumnObject(itemType: ItemType): ResponseColumn;
|
|
20
|
+
fetchValue(itemType: ItemType, itemId: ItemId, columnId: string): any;
|
|
21
|
+
fetchColumnArray(itemType: ItemType): ResponseColumn[];
|
|
22
|
+
fetchDerivedObject(itemType: ItemType, itemId: ItemId, rootColumns: ResponseColumn[]): {};
|
|
23
|
+
fetchDerivedValues(value: any, column: ResponseColumn, destination: any): void;
|
|
24
|
+
fetchObject<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: string | ItemId, includeLinks?: boolean): FieldMap<ItemTypeType> | undefined;
|
|
25
|
+
fetchObjectArray<ItemTypeType extends ItemType>(itemType: ItemTypeType, includeLinks?: boolean, idArray?: ItemId[] | null): Array<FieldMap<ItemTypeType>>;
|
|
26
|
+
fetchColumnsObject(): {
|
|
27
|
+
[itemType: string]: ResponseColumn;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ItemEntry } from '../models';
|
|
2
|
-
import { ItemEntryMap, ItemMap, ItemType } from '../types';
|
|
3
|
-
import { TransactionCache } from './cache/transaction/TransactionCache';
|
|
4
|
-
import { InternalCreateDelta } from './InternalChangesDelta';
|
|
5
|
-
export declare type CreateCompilation = {
|
|
6
|
-
[parentType: string]: {
|
|
7
|
-
[parentId: number]: ItemMap<InternalCreateDelta>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare type DeleteCompilation = {
|
|
11
|
-
[itemType: string]: Array<ItemEntry<ItemType>>;
|
|
12
|
-
};
|
|
13
|
-
export declare type UpdateCompilation = ItemEntryMap<ItemType>;
|
|
14
|
-
export declare type MoveCompilation = {
|
|
15
|
-
[parentType: string]: {
|
|
16
|
-
[parentId: number]: ItemEntry[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare class ChangesCompilation {
|
|
20
|
-
private transaction;
|
|
21
|
-
compilation: {
|
|
22
|
-
create: CreateCompilation;
|
|
23
|
-
delete: DeleteCompilation;
|
|
24
|
-
update: UpdateCompilation;
|
|
25
|
-
move: MoveCompilation;
|
|
26
|
-
};
|
|
27
|
-
constructor(transaction: TransactionCache);
|
|
28
|
-
private processDelta;
|
|
29
|
-
private getDefaultParent;
|
|
30
|
-
private addMoveEntry;
|
|
31
|
-
private addDeleteEntry;
|
|
32
|
-
private addUpdateEntry;
|
|
33
|
-
private addCreateEntry;
|
|
34
|
-
}
|
|
1
|
+
import { ItemEntry } from '../models';
|
|
2
|
+
import { ItemEntryMap, ItemMap, ItemType } from '../types';
|
|
3
|
+
import { TransactionCache } from './cache/transaction/TransactionCache';
|
|
4
|
+
import { InternalCreateDelta } from './InternalChangesDelta';
|
|
5
|
+
export declare type CreateCompilation = {
|
|
6
|
+
[parentType: string]: {
|
|
7
|
+
[parentId: number]: ItemMap<InternalCreateDelta>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare type DeleteCompilation = {
|
|
11
|
+
[itemType: string]: Array<ItemEntry<ItemType>>;
|
|
12
|
+
};
|
|
13
|
+
export declare type UpdateCompilation = ItemEntryMap<ItemType>;
|
|
14
|
+
export declare type MoveCompilation = {
|
|
15
|
+
[parentType: string]: {
|
|
16
|
+
[parentId: number]: ItemEntry[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare class ChangesCompilation {
|
|
20
|
+
private transaction;
|
|
21
|
+
compilation: {
|
|
22
|
+
create: CreateCompilation;
|
|
23
|
+
delete: DeleteCompilation;
|
|
24
|
+
update: UpdateCompilation;
|
|
25
|
+
move: MoveCompilation;
|
|
26
|
+
};
|
|
27
|
+
constructor(transaction: TransactionCache);
|
|
28
|
+
private processDelta;
|
|
29
|
+
private getDefaultParent;
|
|
30
|
+
private addMoveEntry;
|
|
31
|
+
private addDeleteEntry;
|
|
32
|
+
private addUpdateEntry;
|
|
33
|
+
private addCreateEntry;
|
|
34
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { ItemEntry } from '../models';
|
|
2
|
-
import { EntryParent, EntryParentNull, FieldMap, ItemId, ItemType } from '../types';
|
|
3
|
-
import { ChangesDeltaBase } from './ChangesDeltaBase';
|
|
4
|
-
import { ColumnSet } from './ColumnSet';
|
|
5
|
-
import { ItemEntryService } from './ItemEntryService';
|
|
6
|
-
export declare type ChangesDeltaItemCreateDelta<ItemTypeType extends ItemType = any> = {
|
|
7
|
-
itemId: ItemId;
|
|
8
|
-
fields: FieldMap<ItemTypeType>;
|
|
9
|
-
columns: ColumnSet<ItemTypeType>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @description
|
|
13
|
-
* ChangesDelta used to apply changes from outside of the core to a transaction
|
|
14
|
-
*
|
|
15
|
-
* ----------
|
|
16
|
-
*
|
|
17
|
-
* The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
|
|
18
|
-
* assumes 'created' values have no itemEntries yet.
|
|
19
|
-
*
|
|
20
|
-
* Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
|
|
21
|
-
*/
|
|
22
|
-
export declare class ChangesDelta extends ChangesDeltaBase {
|
|
23
|
-
created: ChangesDeltaItemCreateDelta[];
|
|
24
|
-
constructor(itemEntryService: ItemEntryService);
|
|
25
|
-
/**
|
|
26
|
-
* @description
|
|
27
|
-
* Will create an {@link ItemEntry ItemEntry} when the delta is applied
|
|
28
|
-
* Does not always mean the item is local, just that it isn't cached yet
|
|
29
|
-
*
|
|
30
|
-
* ------
|
|
31
|
-
*
|
|
32
|
-
* @remark
|
|
33
|
-
* When the `parent` property is passed it will automatically set the proper fields to match the parent, this assumes the required parent columns are in the passed columns
|
|
34
|
-
* You can easily get the required columns by also passing the `parent` to the {@link TemplateCache.fetchTemplate template fetchCollectionEntry} call
|
|
35
|
-
*/
|
|
36
|
-
setItemCreated<ItemTypeType extends ItemType>(itemId: ItemId, fields: FieldMap<ItemTypeType>, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull): void;
|
|
37
|
-
/**
|
|
38
|
-
* @description
|
|
39
|
-
* Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
|
|
40
|
-
*/
|
|
41
|
-
setItemMoved(entry: ItemEntry, to: EntryParent): void;
|
|
42
|
-
}
|
|
1
|
+
import { ItemEntry } from '../models';
|
|
2
|
+
import { EntryParent, EntryParentNull, FieldMap, ItemId, ItemType } from '../types';
|
|
3
|
+
import { ChangesDeltaBase } from './ChangesDeltaBase';
|
|
4
|
+
import { ColumnSet } from './ColumnSet';
|
|
5
|
+
import { ItemEntryService } from './ItemEntryService';
|
|
6
|
+
export declare type ChangesDeltaItemCreateDelta<ItemTypeType extends ItemType = any> = {
|
|
7
|
+
itemId: ItemId;
|
|
8
|
+
fields: FieldMap<ItemTypeType>;
|
|
9
|
+
columns: ColumnSet<ItemTypeType>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @description
|
|
13
|
+
* ChangesDelta used to apply changes from outside of the core to a transaction
|
|
14
|
+
*
|
|
15
|
+
* ----------
|
|
16
|
+
*
|
|
17
|
+
* The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
|
|
18
|
+
* assumes 'created' values have no itemEntries yet.
|
|
19
|
+
*
|
|
20
|
+
* Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
|
|
21
|
+
*/
|
|
22
|
+
export declare class ChangesDelta extends ChangesDeltaBase {
|
|
23
|
+
created: ChangesDeltaItemCreateDelta[];
|
|
24
|
+
constructor(itemEntryService: ItemEntryService);
|
|
25
|
+
/**
|
|
26
|
+
* @description
|
|
27
|
+
* Will create an {@link ItemEntry ItemEntry} when the delta is applied
|
|
28
|
+
* Does not always mean the item is local, just that it isn't cached yet
|
|
29
|
+
*
|
|
30
|
+
* ------
|
|
31
|
+
*
|
|
32
|
+
* @remark
|
|
33
|
+
* When the `parent` property is passed it will automatically set the proper fields to match the parent, this assumes the required parent columns are in the passed columns
|
|
34
|
+
* You can easily get the required columns by also passing the `parent` to the {@link TemplateCache.fetchTemplate template fetchCollectionEntry} call
|
|
35
|
+
*/
|
|
36
|
+
setItemCreated<ItemTypeType extends ItemType>(itemId: ItemId, fields: FieldMap<ItemTypeType>, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull): void;
|
|
37
|
+
/**
|
|
38
|
+
* @description
|
|
39
|
+
* Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
|
|
40
|
+
*/
|
|
41
|
+
setItemMoved(entry: ItemEntry, to: EntryParent): void;
|
|
42
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ItemEntry } from '../models';
|
|
2
|
-
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemType } from '../types';
|
|
3
|
-
import { ItemEntryService } from './ItemEntryService';
|
|
4
|
-
export declare type ChangesDeltaResult = {
|
|
5
|
-
rollback: () => void;
|
|
6
|
-
created: ItemEntry[];
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @remark
|
|
10
|
-
* We explicitly keep track of the new parent, so we can set an item to moved if it isn't null (Needed for linkTo request)
|
|
11
|
-
*/
|
|
12
|
-
export declare type ChangesDeltaItemUpdateDelta<ItemTypeType extends ItemType = any> = {
|
|
13
|
-
entry: ItemEntry<ItemTypeType>;
|
|
14
|
-
changes: {
|
|
15
|
-
expandedColumns: ColumnExpansionResult<ItemTypeType> | null;
|
|
16
|
-
fields: FieldMap<ItemTypeType>;
|
|
17
|
-
parent: EntryParentNull;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare type ChangesDeltaItemDeleteDelta = ItemEntry[];
|
|
21
|
-
export declare abstract class ChangesDeltaBase {
|
|
22
|
-
protected itemEntryService: ItemEntryService;
|
|
23
|
-
updated: {
|
|
24
|
-
[itemEntryId: number]: ChangesDeltaItemUpdateDelta;
|
|
25
|
-
};
|
|
26
|
-
deleted: {
|
|
27
|
-
[itemType: string]: ChangesDeltaItemDeleteDelta;
|
|
28
|
-
};
|
|
29
|
-
protected constructor(itemEntryService: ItemEntryService);
|
|
30
|
-
setItemUpdated<ItemEntryType extends ItemEntry>(entry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>, columnExpansionResult?: ColumnExpansionResult<ItemEntryType['itemType']> | null, parent?: EntryParentNull): void;
|
|
31
|
-
setItemDeleted(deleted: ItemEntry): void;
|
|
32
|
-
setItemsDeleted(deleted: ItemEntry[]): void;
|
|
33
|
-
}
|
|
1
|
+
import { ItemEntry } from '../models';
|
|
2
|
+
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemType } from '../types';
|
|
3
|
+
import { ItemEntryService } from './ItemEntryService';
|
|
4
|
+
export declare type ChangesDeltaResult = {
|
|
5
|
+
rollback: () => void;
|
|
6
|
+
created: ItemEntry[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @remark
|
|
10
|
+
* We explicitly keep track of the new parent, so we can set an item to moved if it isn't null (Needed for linkTo request)
|
|
11
|
+
*/
|
|
12
|
+
export declare type ChangesDeltaItemUpdateDelta<ItemTypeType extends ItemType = any> = {
|
|
13
|
+
entry: ItemEntry<ItemTypeType>;
|
|
14
|
+
changes: {
|
|
15
|
+
expandedColumns: ColumnExpansionResult<ItemTypeType> | null;
|
|
16
|
+
fields: FieldMap<ItemTypeType>;
|
|
17
|
+
parent: EntryParentNull;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare type ChangesDeltaItemDeleteDelta = ItemEntry[];
|
|
21
|
+
export declare abstract class ChangesDeltaBase {
|
|
22
|
+
protected itemEntryService: ItemEntryService;
|
|
23
|
+
updated: {
|
|
24
|
+
[itemEntryId: number]: ChangesDeltaItemUpdateDelta;
|
|
25
|
+
};
|
|
26
|
+
deleted: {
|
|
27
|
+
[itemType: string]: ChangesDeltaItemDeleteDelta;
|
|
28
|
+
};
|
|
29
|
+
protected constructor(itemEntryService: ItemEntryService);
|
|
30
|
+
setItemUpdated<ItemEntryType extends ItemEntry>(entry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>, columnExpansionResult?: ColumnExpansionResult<ItemEntryType['itemType']> | null, parent?: EntryParentNull): void;
|
|
31
|
+
setItemDeleted(deleted: ItemEntry): void;
|
|
32
|
+
setItemsDeleted(deleted: ItemEntry[]): void;
|
|
33
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { ApiRequestService, CollectionEntryService, ItemEntryService } from '../classes';
|
|
2
|
-
import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
-
import { ChangesDeltaFactory } from '../factories/ChangesDeltaFactory';
|
|
4
|
-
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
5
|
-
import { ItemIdConversionMap, PromiseInterface } from '../types';
|
|
6
|
-
import { TransactionCache } from './cache/transaction/TransactionCache';
|
|
7
|
-
export declare type OnAfterCreateCallback = (conversionMap: ItemIdConversionMap) => void;
|
|
8
|
-
/**
|
|
9
|
-
* @description
|
|
10
|
-
* Executes the changes from a specific {@link TransactionCache transaction} and returns a {@link ChangesDelta ChangesDelta}
|
|
11
|
-
*/
|
|
12
|
-
export declare class ChangesProcessor {
|
|
13
|
-
private changesDeltaFactory;
|
|
14
|
-
private apiRequestService;
|
|
15
|
-
private changesCompilationFactory;
|
|
16
|
-
private columnExpansionFactory;
|
|
17
|
-
private createRequestFactory;
|
|
18
|
-
private errorHandler;
|
|
19
|
-
private promiseService;
|
|
20
|
-
private requestColumnExpansionFactory;
|
|
21
|
-
private collectionEntryService;
|
|
22
|
-
private itemEntryService;
|
|
23
|
-
private transaction;
|
|
24
|
-
private breakUpByParent?;
|
|
25
|
-
private onAfterCreateCallback?;
|
|
26
|
-
private itemIdConversionMap;
|
|
27
|
-
private serverCache;
|
|
28
|
-
constructor(changesDeltaFactory: ChangesDeltaFactory, apiRequestService: ApiRequestService, changesCompilationFactory: ChangesCompilationFactory, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, itemEntryService: ItemEntryService, transaction: TransactionCache, breakUpByParent?: boolean | undefined, onAfterCreateCallback?: OnAfterCreateCallback | undefined);
|
|
29
|
-
/**
|
|
30
|
-
* @description
|
|
31
|
-
* Executes the requests in the order of:
|
|
32
|
-
* 1. create
|
|
33
|
-
* 2. move
|
|
34
|
-
* 3. delete
|
|
35
|
-
* 4. update
|
|
36
|
-
*/
|
|
37
|
-
execute(): PromiseInterface<ItemIdConversionMap>;
|
|
38
|
-
private buildMoveRequest;
|
|
39
|
-
private getMapValue;
|
|
40
|
-
private executeCreateRequests;
|
|
41
|
-
private executeCreateRequest;
|
|
42
|
-
private executeUpdateRequests;
|
|
43
|
-
private executeUpdateRequest;
|
|
44
|
-
private executeDeleteRequests;
|
|
45
|
-
private executeDeleteRequest;
|
|
46
|
-
private executeMoveRequests;
|
|
47
|
-
}
|
|
1
|
+
import { ApiRequestService, CollectionEntryService, ItemEntryService } from '../classes';
|
|
2
|
+
import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
+
import { ChangesDeltaFactory } from '../factories/ChangesDeltaFactory';
|
|
4
|
+
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
5
|
+
import { ItemIdConversionMap, PromiseInterface } from '../types';
|
|
6
|
+
import { TransactionCache } from './cache/transaction/TransactionCache';
|
|
7
|
+
export declare type OnAfterCreateCallback = (conversionMap: ItemIdConversionMap) => void;
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Executes the changes from a specific {@link TransactionCache transaction} and returns a {@link ChangesDelta ChangesDelta}
|
|
11
|
+
*/
|
|
12
|
+
export declare class ChangesProcessor {
|
|
13
|
+
private changesDeltaFactory;
|
|
14
|
+
private apiRequestService;
|
|
15
|
+
private changesCompilationFactory;
|
|
16
|
+
private columnExpansionFactory;
|
|
17
|
+
private createRequestFactory;
|
|
18
|
+
private errorHandler;
|
|
19
|
+
private promiseService;
|
|
20
|
+
private requestColumnExpansionFactory;
|
|
21
|
+
private collectionEntryService;
|
|
22
|
+
private itemEntryService;
|
|
23
|
+
private transaction;
|
|
24
|
+
private breakUpByParent?;
|
|
25
|
+
private onAfterCreateCallback?;
|
|
26
|
+
private itemIdConversionMap;
|
|
27
|
+
private serverCache;
|
|
28
|
+
constructor(changesDeltaFactory: ChangesDeltaFactory, apiRequestService: ApiRequestService, changesCompilationFactory: ChangesCompilationFactory, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, itemEntryService: ItemEntryService, transaction: TransactionCache, breakUpByParent?: boolean | undefined, onAfterCreateCallback?: OnAfterCreateCallback | undefined);
|
|
29
|
+
/**
|
|
30
|
+
* @description
|
|
31
|
+
* Executes the requests in the order of:
|
|
32
|
+
* 1. create
|
|
33
|
+
* 2. move
|
|
34
|
+
* 3. delete
|
|
35
|
+
* 4. update
|
|
36
|
+
*/
|
|
37
|
+
execute(): PromiseInterface<ItemIdConversionMap>;
|
|
38
|
+
private buildMoveRequest;
|
|
39
|
+
private getMapValue;
|
|
40
|
+
private executeCreateRequests;
|
|
41
|
+
private executeCreateRequest;
|
|
42
|
+
private executeUpdateRequests;
|
|
43
|
+
private executeUpdateRequest;
|
|
44
|
+
private executeDeleteRequests;
|
|
45
|
+
private executeDeleteRequest;
|
|
46
|
+
private executeMoveRequests;
|
|
47
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { QueryMatcherFactory } from '../factories';
|
|
2
|
-
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
|
-
import { CollectionMatchResult, CollectionQuery, EntryParentNull, FieldMap, ItemId, ItemType } from '../types';
|
|
4
|
-
import { AbstractCache } from './cache/AbstractCache';
|
|
5
|
-
export declare class CollectionCache {
|
|
6
|
-
private queryMatcherFactory;
|
|
7
|
-
private transaction;
|
|
8
|
-
private entries;
|
|
9
|
-
constructor(queryMatcherFactory: QueryMatcherFactory, transaction: AbstractCache);
|
|
10
|
-
getByEntryId(collectionEntryId: CollectionEntry['id']): CollectionEntry | undefined;
|
|
11
|
-
contains(collectionEntry: CollectionEntry<any>): boolean;
|
|
12
|
-
some(callback: (entry: CollectionEntry<any>) => boolean): boolean;
|
|
13
|
-
forEach(callback: (entry: CollectionEntry<any>) => void): void;
|
|
14
|
-
toArray(): CollectionEntry<any>[];
|
|
15
|
-
add<T extends CollectionEntry<any>>(collectionEntry: T): T;
|
|
16
|
-
clear(collectionEntry?: CollectionEntry<any>): boolean;
|
|
17
|
-
getByItemType<ItemTypeType extends ItemType>(itemType: ItemTypeType): CollectionEntry<ItemTypeType>[];
|
|
18
|
-
matchParent(collectionEntry: CollectionEntry<any>, itemType: string, itemId: ItemId): boolean;
|
|
19
|
-
getByParent<ItemTypeType extends ItemType>(parentType: ItemType, parentId: ItemId, itemType: ItemTypeType): CollectionEntry<ItemTypeType> | null;
|
|
20
|
-
getCollectionsByParent(parentType: ItemType, parentId: ItemId): CollectionEntry<any>[];
|
|
21
|
-
/**
|
|
22
|
-
* @description
|
|
23
|
-
* Gets {@link CollectionEntry CollectionEntries} which contain the item with the passed ItemType/ItemId
|
|
24
|
-
*/
|
|
25
|
-
getByContainingItem<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId): CollectionEntry<ItemTypeType>[];
|
|
26
|
-
/**
|
|
27
|
-
* @description
|
|
28
|
-
* Checks if the passed fields would fit in the collections using the {@link QueryMatcher QueryMatcher}
|
|
29
|
-
*/
|
|
30
|
-
getByFittingItem<ItemTypeType extends ItemType>(itemType: ItemTypeType, fields: FieldMap, parent: EntryParentNull): CollectionMatchResult<ItemTypeType>;
|
|
31
|
-
getByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: CollectionQuery): CollectionEntry<ItemTypeType> | null;
|
|
32
|
-
getByKey<ItemTypeType extends ItemType>(itemType: ItemTypeType, entryKey: string): Array<CollectionEntry<ItemTypeType>>;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated
|
|
35
|
-
*/
|
|
36
|
-
getResourceByKey<ItemTypeType extends ItemType>(itemType: ItemTypeType, resourceKey: string): Array<CollectionResource<ItemTypeType>>;
|
|
37
|
-
}
|
|
1
|
+
import { QueryMatcherFactory } from '../factories';
|
|
2
|
+
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
|
+
import { CollectionMatchResult, CollectionQuery, EntryParentNull, FieldMap, ItemId, ItemType } from '../types';
|
|
4
|
+
import { AbstractCache } from './cache/AbstractCache';
|
|
5
|
+
export declare class CollectionCache {
|
|
6
|
+
private queryMatcherFactory;
|
|
7
|
+
private transaction;
|
|
8
|
+
private entries;
|
|
9
|
+
constructor(queryMatcherFactory: QueryMatcherFactory, transaction: AbstractCache);
|
|
10
|
+
getByEntryId(collectionEntryId: CollectionEntry['id']): CollectionEntry | undefined;
|
|
11
|
+
contains(collectionEntry: CollectionEntry<any>): boolean;
|
|
12
|
+
some(callback: (entry: CollectionEntry<any>) => boolean): boolean;
|
|
13
|
+
forEach(callback: (entry: CollectionEntry<any>) => void): void;
|
|
14
|
+
toArray(): CollectionEntry<any>[];
|
|
15
|
+
add<T extends CollectionEntry<any>>(collectionEntry: T): T;
|
|
16
|
+
clear(collectionEntry?: CollectionEntry<any>): boolean;
|
|
17
|
+
getByItemType<ItemTypeType extends ItemType>(itemType: ItemTypeType): CollectionEntry<ItemTypeType>[];
|
|
18
|
+
matchParent(collectionEntry: CollectionEntry<any>, itemType: string, itemId: ItemId): boolean;
|
|
19
|
+
getByParent<ItemTypeType extends ItemType>(parentType: ItemType, parentId: ItemId, itemType: ItemTypeType): CollectionEntry<ItemTypeType> | null;
|
|
20
|
+
getCollectionsByParent(parentType: ItemType, parentId: ItemId): CollectionEntry<any>[];
|
|
21
|
+
/**
|
|
22
|
+
* @description
|
|
23
|
+
* Gets {@link CollectionEntry CollectionEntries} which contain the item with the passed ItemType/ItemId
|
|
24
|
+
*/
|
|
25
|
+
getByContainingItem<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId): CollectionEntry<ItemTypeType>[];
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* Checks if the passed fields would fit in the collections using the {@link QueryMatcher QueryMatcher}
|
|
29
|
+
*/
|
|
30
|
+
getByFittingItem<ItemTypeType extends ItemType>(itemType: ItemTypeType, fields: FieldMap, parent: EntryParentNull): CollectionMatchResult<ItemTypeType>;
|
|
31
|
+
getByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: CollectionQuery): CollectionEntry<ItemTypeType> | null;
|
|
32
|
+
getByKey<ItemTypeType extends ItemType>(itemType: ItemTypeType, entryKey: string): Array<CollectionEntry<ItemTypeType>>;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
*/
|
|
36
|
+
getResourceByKey<ItemTypeType extends ItemType>(itemType: ItemTypeType, resourceKey: string): Array<CollectionResource<ItemTypeType>>;
|
|
37
|
+
}
|