@rentman/rm-core 9.2.0 → 9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +1008 -1002
- package/dist/rm-core.js +1500 -1382
- package/dist/rm-core.min.js +1 -1
- package/dist/types/classes/ApiFormatter.d.ts +73 -73
- package/dist/types/classes/ApiRequestService.d.ts +18 -18
- package/dist/types/classes/ApiResponseProcessor.d.ts +29 -29
- package/dist/types/classes/CacheSyncer.d.ts +44 -44
- package/dist/types/classes/ChangesCompilation.d.ts +33 -33
- package/dist/types/classes/ChangesDelta.d.ts +61 -61
- package/dist/types/classes/ChangesDeltaBase.d.ts +78 -78
- package/dist/types/classes/ChangesProcessor.d.ts +40 -40
- package/dist/types/classes/CollectionEntryService.d.ts +24 -24
- package/dist/types/classes/CollectionResourceService.d.ts +6 -6
- package/dist/types/classes/ColumnCache.d.ts +19 -19
- package/dist/types/classes/ColumnExpansion.d.ts +19 -19
- package/dist/types/classes/ColumnHandler.d.ts +20 -20
- package/dist/types/classes/ColumnInfo.d.ts +15 -15
- package/dist/types/classes/ColumnSet.d.ts +37 -37
- package/dist/types/classes/ColumnSubsetCache.d.ts +14 -14
- package/dist/types/classes/ColumnUtil.d.ts +101 -101
- package/dist/types/classes/ConversionMapService.d.ts +25 -25
- package/dist/types/classes/CreateRequest.d.ts +17 -17
- package/dist/types/classes/CreatedChangesDelta.d.ts +17 -17
- package/dist/types/classes/InternalChangesDelta.d.ts +43 -43
- package/dist/types/classes/ItemCache.d.ts +27 -27
- package/dist/types/classes/ItemCreateService.d.ts +18 -18
- package/dist/types/classes/ItemEntryService.d.ts +32 -32
- package/dist/types/classes/KeyService.d.ts +18 -18
- package/dist/types/classes/LockService.d.ts +29 -29
- package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
- package/dist/types/classes/ParentChangesDelta.d.ts +39 -39
- package/dist/types/classes/QueryColumnExtractor.d.ts +18 -18
- package/dist/types/classes/QueryContainsLocalIdParser.d.ts +17 -17
- package/dist/types/classes/QueryLinkedToParser.d.ts +17 -17
- package/dist/types/classes/QueryLocallyMatchableParser.d.ts +20 -20
- package/dist/types/classes/QueryMatcher.d.ts +24 -24
- package/dist/types/classes/QueryParser.d.ts +25 -25
- package/dist/types/classes/QueryParserBase.d.ts +20 -20
- package/dist/types/classes/QueryParserIdUpdater.d.ts +17 -17
- package/dist/types/classes/QueryService.d.ts +12 -12
- package/dist/types/classes/RequestBuffer.d.ts +24 -24
- package/dist/types/classes/RequestBufferManager.d.ts +32 -32
- package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
- package/dist/types/classes/SocketMessageHandler.d.ts +34 -34
- package/dist/types/classes/TemplateCache.d.ts +62 -62
- package/dist/types/classes/Util.d.ts +28 -28
- package/dist/types/classes/cache/AbstractCache.d.ts +85 -85
- package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +68 -68
- package/dist/types/classes/cache/ItemHandlerBase.d.ts +102 -102
- package/dist/types/classes/cache/server/ServerCache.d.ts +78 -78
- package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +25 -25
- package/dist/types/classes/cache/server/ServerItemHandler.d.ts +43 -43
- package/dist/types/classes/cache/transaction/TransactionCache.d.ts +318 -318
- package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +37 -36
- package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
- package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
- package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +90 -90
- package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +33 -33
- package/dist/types/constants.d.ts +7 -7
- package/dist/types/core.d.ts +45 -45
- package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/types/factories/CacheSyncerFactory.d.ts +10 -10
- package/dist/types/factories/ChangesCompilationFactory.d.ts +5 -5
- package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -13
- package/dist/types/factories/ChangesProcessorFactory.d.ts +13 -13
- package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
- package/dist/types/factories/CollectionResourceFactory.d.ts +18 -18
- package/dist/types/factories/ColumnExpansionFactory.d.ts +7 -7
- package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
- package/dist/types/factories/ColumnSetFactory.d.ts +18 -18
- package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +8 -8
- package/dist/types/factories/CreateRequestFactory.d.ts +9 -9
- package/dist/types/factories/ItemCacheFactory.d.ts +6 -6
- package/dist/types/factories/ItemEntryFactory.d.ts +12 -12
- package/dist/types/factories/ItemResourceFactory.d.ts +11 -11
- package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +4 -4
- package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/types/factories/QueryParserFactory.d.ts +5 -5
- package/dist/types/factories/RequestColumnExpansionFactory.d.ts +8 -8
- package/dist/types/factories/TemplateFactory.d.ts +8 -8
- package/dist/types/factories/TransactionCacheFactory.d.ts +13 -13
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +36 -36
- package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +12 -12
- package/dist/types/interfaces/AuthInterface.d.ts +10 -10
- package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
- package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
- package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
- package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
- package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
- package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
- package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
- package/dist/types/internal.d.ts +104 -104
- package/dist/types/models/CachedQueryItem.d.ts +19 -19
- package/dist/types/models/CollectionEntry.d.ts +21 -21
- package/dist/types/models/CollectionOptions.d.ts +44 -44
- package/dist/types/models/CollectionResource.d.ts +87 -87
- package/dist/types/models/ItemEntry.d.ts +18 -18
- package/dist/types/models/ItemEntryOptions.d.ts +8 -8
- package/dist/types/models/ItemResource.d.ts +90 -90
- package/dist/types/models/Template.d.ts +11 -11
- package/dist/types/types/ItemTypesCollection.d.ts +345 -345
- package/dist/types/types/PromiseInterface.d.ts +2 -2
- package/package.json +50 -50
- package/readme.md +15 -15
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { ApiEnumApiType, ApiEnumItemType, ApiFields, ResponseColumn } from '@rentman/backend-types';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import { ApiEnumApiTypeToTsTypeMap, ColumnInfo, FieldMap, ItemTypeColumnIds } from '../internal';
|
|
4
|
-
declare type GetChangesResult<ItemTypeType extends ApiEnumItemType = any, ColumnId extends keyof ApiFields[ItemTypeType] = any> = {
|
|
5
|
-
oldValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
|
|
6
|
-
newValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
|
|
7
|
-
column: ResponseColumn<ItemTypeType, ColumnId>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* @description
|
|
11
|
-
* A service which provides functions to transform data that comes from/goes to the API
|
|
12
|
-
*
|
|
13
|
-
* @warning
|
|
14
|
-
* The code in these functions can be *very hot* on large databases, therefore performance must be kept in mind.
|
|
15
|
-
* This is also the reason why all column types are written out instead of using the enum
|
|
16
|
-
*/
|
|
17
|
-
export declare class ApiFormatter {
|
|
18
|
-
MOMENT_INVALID: string;
|
|
19
|
-
SERVER_DATETIME_FORMAT: string;
|
|
20
|
-
SERVER_TIME_FORMAT: string;
|
|
21
|
-
SERVER_DATE_FORMAT: string;
|
|
22
|
-
constructor();
|
|
23
|
-
/**
|
|
24
|
-
* @description
|
|
25
|
-
* Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
|
|
26
|
-
*
|
|
27
|
-
* ----
|
|
28
|
-
* @remarks
|
|
29
|
-
* Currently only used for Moment objects
|
|
30
|
-
*/
|
|
31
|
-
isExpensiveFormat(columnType: ApiEnumApiType): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @description
|
|
34
|
-
* Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
|
|
35
|
-
*/
|
|
36
|
-
mergeCopyFields<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(initial: FieldMap<ItemTypeType, ColumnIds>, changes: FieldMap<ItemTypeType, ColumnIds>, newInitial: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType, ColumnIds>;
|
|
37
|
-
formatRequest<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
|
|
38
|
-
[columnId: string]: any;
|
|
39
|
-
};
|
|
40
|
-
formatRequestLocal<ItemTypeType extends ApiEnumItemType>(fields: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
|
|
41
|
-
[columnId: string]: any;
|
|
42
|
-
};
|
|
43
|
-
hasChanges<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[], includeReadOnlyColumns?: boolean, forceCompare?: boolean): boolean;
|
|
44
|
-
getChanges<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(initial: FieldMap<ItemTypeType, ColumnIds>, modified: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): GetChangesResult<ItemTypeType, ColumnIds[number]>[];
|
|
45
|
-
copyFields<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(source: FieldMap<ItemTypeType, ColumnIds>, destination: Partial<FieldMap<ItemTypeType>>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): FieldMap<ItemTypeType, ColumnIds>;
|
|
46
|
-
shallowCopyFields<ItemTypeType extends ApiEnumItemType>(shallowSource: FieldMap<ItemTypeType>, deepSource: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
|
|
47
|
-
setDefaultValues<ItemTypeType extends ApiEnumItemType = any>(destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
|
|
48
|
-
/**
|
|
49
|
-
* @description
|
|
50
|
-
* Compares the given fields, returns `true` when the fields are equal
|
|
51
|
-
*/
|
|
52
|
-
compareFields<ColumnType extends ApiEnumApiType>(columnType: ColumnType, first?: ApiEnumApiTypeToTsTypeMap[ColumnType], second?: ApiEnumApiTypeToTsTypeMap[ColumnType]): boolean;
|
|
53
|
-
compareFloats(a: number, b: number): boolean;
|
|
54
|
-
compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
|
|
55
|
-
compareDurations(first: moment.Duration, second: moment.Duration): boolean;
|
|
56
|
-
formatResponseValue(columnType: string, value: any): any;
|
|
57
|
-
formatRequestValue(columnType: string, value: any): any;
|
|
58
|
-
formatResponseDate(value: null | any): moment.Moment;
|
|
59
|
-
formatResponseDuration(value: null | number): moment.Duration;
|
|
60
|
-
formatResponseColor(value: string): string;
|
|
61
|
-
formatRequestDateTime(value: moment.Moment): string | null;
|
|
62
|
-
formatRequestDate(value: moment.Moment): string | null;
|
|
63
|
-
formatRequestDuration(value: moment.Duration): number;
|
|
64
|
-
formatRequestColor(value: string): string;
|
|
65
|
-
getDefaultValue(columnType: ApiEnumApiType): any;
|
|
66
|
-
isDefaultValue(columnType: ApiEnumApiType, value: any): boolean;
|
|
67
|
-
clone(columnType: string, value: any): any;
|
|
68
|
-
getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
|
|
69
|
-
cloneDuration(duration: moment.Duration): moment.Duration;
|
|
70
|
-
cloneDate(date: moment.Moment): moment.Moment;
|
|
71
|
-
identity<T>(input: T): T;
|
|
72
|
-
}
|
|
73
|
-
export {};
|
|
1
|
+
import { ApiEnumApiType, ApiEnumItemType, ApiFields, ResponseColumn } from '@rentman/backend-types';
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
import { ApiEnumApiTypeToTsTypeMap, ColumnInfo, FieldMap, ItemTypeColumnIds } from '../internal';
|
|
4
|
+
declare type GetChangesResult<ItemTypeType extends ApiEnumItemType = any, ColumnId extends keyof ApiFields[ItemTypeType] = any> = {
|
|
5
|
+
oldValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
|
|
6
|
+
newValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
|
|
7
|
+
column: ResponseColumn<ItemTypeType, ColumnId>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @description
|
|
11
|
+
* A service which provides functions to transform data that comes from/goes to the API
|
|
12
|
+
*
|
|
13
|
+
* @warning
|
|
14
|
+
* The code in these functions can be *very hot* on large databases, therefore performance must be kept in mind.
|
|
15
|
+
* This is also the reason why all column types are written out instead of using the enum
|
|
16
|
+
*/
|
|
17
|
+
export declare class ApiFormatter {
|
|
18
|
+
MOMENT_INVALID: string;
|
|
19
|
+
SERVER_DATETIME_FORMAT: string;
|
|
20
|
+
SERVER_TIME_FORMAT: string;
|
|
21
|
+
SERVER_DATE_FORMAT: string;
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
|
|
26
|
+
*
|
|
27
|
+
* ----
|
|
28
|
+
* @remarks
|
|
29
|
+
* Currently only used for Moment objects
|
|
30
|
+
*/
|
|
31
|
+
isExpensiveFormat(columnType: ApiEnumApiType): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description
|
|
34
|
+
* Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
|
|
35
|
+
*/
|
|
36
|
+
mergeCopyFields<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(initial: FieldMap<ItemTypeType, ColumnIds>, changes: FieldMap<ItemTypeType, ColumnIds>, newInitial: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType, ColumnIds>;
|
|
37
|
+
formatRequest<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
|
|
38
|
+
[columnId: string]: any;
|
|
39
|
+
};
|
|
40
|
+
formatRequestLocal<ItemTypeType extends ApiEnumItemType>(fields: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
|
|
41
|
+
[columnId: string]: any;
|
|
42
|
+
};
|
|
43
|
+
hasChanges<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[], includeReadOnlyColumns?: boolean, forceCompare?: boolean): boolean;
|
|
44
|
+
getChanges<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(initial: FieldMap<ItemTypeType, ColumnIds>, modified: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): GetChangesResult<ItemTypeType, ColumnIds[number]>[];
|
|
45
|
+
copyFields<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(source: FieldMap<ItemTypeType, ColumnIds>, destination: Partial<FieldMap<ItemTypeType>>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): FieldMap<ItemTypeType, ColumnIds>;
|
|
46
|
+
shallowCopyFields<ItemTypeType extends ApiEnumItemType>(shallowSource: FieldMap<ItemTypeType>, deepSource: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
|
|
47
|
+
setDefaultValues<ItemTypeType extends ApiEnumItemType = any>(destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
|
|
48
|
+
/**
|
|
49
|
+
* @description
|
|
50
|
+
* Compares the given fields, returns `true` when the fields are equal
|
|
51
|
+
*/
|
|
52
|
+
compareFields<ColumnType extends ApiEnumApiType>(columnType: ColumnType, first?: ApiEnumApiTypeToTsTypeMap[ColumnType], second?: ApiEnumApiTypeToTsTypeMap[ColumnType]): boolean;
|
|
53
|
+
compareFloats(a: number, b: number): boolean;
|
|
54
|
+
compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
|
|
55
|
+
compareDurations(first: moment.Duration, second: moment.Duration): boolean;
|
|
56
|
+
formatResponseValue(columnType: string, value: any): any;
|
|
57
|
+
formatRequestValue(columnType: string, value: any): any;
|
|
58
|
+
formatResponseDate(value: null | any): moment.Moment;
|
|
59
|
+
formatResponseDuration(value: null | number): moment.Duration;
|
|
60
|
+
formatResponseColor(value: string): string;
|
|
61
|
+
formatRequestDateTime(value: moment.Moment): string | null;
|
|
62
|
+
formatRequestDate(value: moment.Moment): string | null;
|
|
63
|
+
formatRequestDuration(value: moment.Duration): number;
|
|
64
|
+
formatRequestColor(value: string): string;
|
|
65
|
+
getDefaultValue(columnType: ApiEnumApiType): any;
|
|
66
|
+
isDefaultValue(columnType: ApiEnumApiType, value: any): boolean;
|
|
67
|
+
clone(columnType: string, value: any): any;
|
|
68
|
+
getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
|
|
69
|
+
cloneDuration(duration: moment.Duration): moment.Duration;
|
|
70
|
+
cloneDate(date: moment.Moment): moment.Moment;
|
|
71
|
+
identity<T>(input: T): T;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ApiEnumItemType, ApiQuery, ItemId } from '@rentman/backend-types';
|
|
2
|
-
import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ApiRequestServiceInterface, ApiResponseProcessor, ApiResponseProcessorFactory, PromiseInterface } from '../internal';
|
|
3
|
-
export declare class ApiRequestService {
|
|
4
|
-
private externalApiRequestService;
|
|
5
|
-
private apiResponseProcessorFactory;
|
|
6
|
-
constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
|
|
7
|
-
template(itemType: ApiEnumItemType, params: any): PromiseInterface<ApiResponseProcessor>;
|
|
8
|
-
create(itemType: ApiEnumItemType, itemId: ItemId, values: any, parentType?: ApiEnumItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
|
|
9
|
-
delete(itemType: ApiEnumItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
|
|
10
|
-
updateItems(itemType: ApiEnumItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
|
|
11
|
-
requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
|
|
12
|
-
moveItems(parentType: ApiEnumItemType, parentId: ItemId, items: {
|
|
13
|
-
[itemType: string]: ItemId[];
|
|
14
|
-
}): PromiseInterface<ApiResponseProcessor>;
|
|
15
|
-
columns(itemType: ApiEnumItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
|
|
16
|
-
query<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery<ItemTypeType>, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
|
|
17
|
-
processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
|
|
18
|
-
}
|
|
1
|
+
import { ApiEnumItemType, ApiQuery, ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ApiRequestServiceInterface, ApiResponseProcessor, ApiResponseProcessorFactory, PromiseInterface } from '../internal';
|
|
3
|
+
export declare class ApiRequestService {
|
|
4
|
+
private externalApiRequestService;
|
|
5
|
+
private apiResponseProcessorFactory;
|
|
6
|
+
constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
|
|
7
|
+
template(itemType: ApiEnumItemType, params: any): PromiseInterface<ApiResponseProcessor>;
|
|
8
|
+
create(itemType: ApiEnumItemType, itemId: ItemId, values: any, parentType?: ApiEnumItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
|
|
9
|
+
delete(itemType: ApiEnumItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
|
|
10
|
+
updateItems(itemType: ApiEnumItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
|
|
11
|
+
requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
|
|
12
|
+
moveItems(parentType: ApiEnumItemType, parentId: ItemId, items: {
|
|
13
|
+
[itemType: string]: ItemId[];
|
|
14
|
+
}): PromiseInterface<ApiResponseProcessor>;
|
|
15
|
+
columns(itemType: ApiEnumItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
|
|
16
|
+
query<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery<ItemTypeType>, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
|
|
17
|
+
processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
|
|
18
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ApiEnumItemType, ItemId, ResponseColumn } from '@rentman/backend-types';
|
|
2
|
-
import { ApiFormatter, ApiResponse, ColumnInfo, FieldMap, ItemTypeMap, ResponseColumnItemTypeMap, ResponseColumnMap } from '../internal';
|
|
3
|
-
export declare class ApiResponseProcessor<RequestItemType extends ApiEnumItemType = any> {
|
|
4
|
-
apiFormatter: ApiFormatter;
|
|
5
|
-
response: ApiResponse;
|
|
6
|
-
itemType: RequestItemType;
|
|
7
|
-
columns: ItemTypeMap<ResponseColumn[]>;
|
|
8
|
-
links: ItemTypeMap<ItemId[]>;
|
|
9
|
-
cacheable: boolean;
|
|
10
|
-
map: any;
|
|
11
|
-
items: any;
|
|
12
|
-
columnIndexMap: {
|
|
13
|
-
[itemType: string]: {
|
|
14
|
-
[columnId: string]: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
columnMap: any;
|
|
18
|
-
constructor(apiFormatter: ApiFormatter, response: ApiResponse);
|
|
19
|
-
fetchColumnObject(itemType: ApiEnumItemType): ResponseColumnMap;
|
|
20
|
-
fetchValue(itemType: ApiEnumItemType, itemId: ItemId, columnId: string): any;
|
|
21
|
-
fetchColumnArray(itemType: ApiEnumItemType): ResponseColumn[];
|
|
22
|
-
fetchDerivedObject(itemType: ApiEnumItemType, itemId: ItemId, rootColumns: ColumnInfo[]): {};
|
|
23
|
-
fetchDerivedValues(value: any, column: ColumnInfo, destination: any): void;
|
|
24
|
-
fetchObject<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: string | ItemId): FieldMap<ItemTypeType> | undefined;
|
|
25
|
-
fetchObjectArray<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, idArray?: ItemId[] | null): FieldMap<ItemTypeType>[];
|
|
26
|
-
fetchColumnsObject(): ResponseColumnItemTypeMap;
|
|
27
|
-
private addLazyFormattingFunction;
|
|
28
|
-
private createColumnMaps;
|
|
29
|
-
}
|
|
1
|
+
import { ApiEnumItemType, ItemId, ResponseColumn } from '@rentman/backend-types';
|
|
2
|
+
import { ApiFormatter, ApiResponse, ColumnInfo, FieldMap, ItemTypeMap, ResponseColumnItemTypeMap, ResponseColumnMap } from '../internal';
|
|
3
|
+
export declare class ApiResponseProcessor<RequestItemType extends ApiEnumItemType = any> {
|
|
4
|
+
apiFormatter: ApiFormatter;
|
|
5
|
+
response: ApiResponse;
|
|
6
|
+
itemType: RequestItemType;
|
|
7
|
+
columns: ItemTypeMap<ResponseColumn[]>;
|
|
8
|
+
links: ItemTypeMap<ItemId[]>;
|
|
9
|
+
cacheable: boolean;
|
|
10
|
+
map: any;
|
|
11
|
+
items: any;
|
|
12
|
+
columnIndexMap: {
|
|
13
|
+
[itemType: string]: {
|
|
14
|
+
[columnId: string]: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
columnMap: any;
|
|
18
|
+
constructor(apiFormatter: ApiFormatter, response: ApiResponse);
|
|
19
|
+
fetchColumnObject(itemType: ApiEnumItemType): ResponseColumnMap;
|
|
20
|
+
fetchValue(itemType: ApiEnumItemType, itemId: ItemId, columnId: string): any;
|
|
21
|
+
fetchColumnArray(itemType: ApiEnumItemType): ResponseColumn[];
|
|
22
|
+
fetchDerivedObject(itemType: ApiEnumItemType, itemId: ItemId, rootColumns: ColumnInfo[]): {};
|
|
23
|
+
fetchDerivedValues(value: any, column: ColumnInfo, destination: any): void;
|
|
24
|
+
fetchObject<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: string | ItemId): FieldMap<ItemTypeType> | undefined;
|
|
25
|
+
fetchObjectArray<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, idArray?: ItemId[] | null): FieldMap<ItemTypeType>[];
|
|
26
|
+
fetchColumnsObject(): ResponseColumnItemTypeMap;
|
|
27
|
+
private addLazyFormattingFunction;
|
|
28
|
+
private createColumnMaps;
|
|
29
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
-
import { AbstractCache, ApiRequestService, CachedQueryItem, ChangesDeltaBase, CollectionQuery, CollectionResource, FieldMap, ItemEntry, ItemTypeMap, ParentChangesDelta, PromiseInterface, PromiseLibraryInterface, QueryMatcherFactory, QueryService } from '../internal';
|
|
3
|
-
export declare type CacheSyncerQueryMap = ItemTypeMap<{
|
|
4
|
-
[cachedQueryString: string]: {
|
|
5
|
-
cachedQueryItems: CachedQueryItem[];
|
|
6
|
-
collectionResources: CollectionResource[];
|
|
7
|
-
};
|
|
8
|
-
}>;
|
|
9
|
-
export declare type CacheSyncerMatches<ItemTypeType extends ApiEnumItemType> = {
|
|
10
|
-
[itemId: number]: {
|
|
11
|
-
item: ItemEntry<ItemTypeType>;
|
|
12
|
-
isMatch: boolean | 'maybe';
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare class CacheSyncer {
|
|
16
|
-
private queryService;
|
|
17
|
-
private queryMatcherFactory;
|
|
18
|
-
private apiRequestService;
|
|
19
|
-
private promiseService;
|
|
20
|
-
private transaction;
|
|
21
|
-
private cachedQueryMap;
|
|
22
|
-
private matchedItemEntryMap;
|
|
23
|
-
constructor(queryService: QueryService, queryMatcherFactory: QueryMatcherFactory, apiRequestService: ApiRequestService, promiseService: PromiseLibraryInterface, transaction: AbstractCache, cachedQueryMap: CacheSyncerQueryMap);
|
|
24
|
-
syncCollections(isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDeltaBase): PromiseInterface<void>;
|
|
25
|
-
syncCachedQueries(_isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDeltaBase): PromiseInterface<void[]>;
|
|
26
|
-
expand<ItemEntryType extends ItemEntry>(itemEntry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>): this;
|
|
27
|
-
processDelta(parentChangesDelta: ParentChangesDelta): this;
|
|
28
|
-
groupMatchedItemEntries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: CollectionQuery): {
|
|
29
|
-
[key in 'fitting' | 'notFitting' | 'maybe']: ItemEntry<ItemTypeType>[];
|
|
30
|
-
};
|
|
31
|
-
_expand<ItemTypeType extends ApiEnumItemType = any>(itemEntry: ItemEntry<ItemTypeType>, matchFunction: (itemType: ItemTypeType, parsedQuery: CollectionQuery) => boolean | 'maybe'): this;
|
|
32
|
-
/**
|
|
33
|
-
* Unlike the functions that use a promise accumulator, this function *can* result in a rejection. It should be handled
|
|
34
|
-
* by the caller.
|
|
35
|
-
*/
|
|
36
|
-
protected processMaybeMatches<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: CollectionQuery, maybeItemEntries: ItemEntry<ItemTypeType>[], changesDelta: ChangesDeltaBase | undefined): PromiseInterface<ItemEntry<ItemTypeType>[]>;
|
|
37
|
-
/**
|
|
38
|
-
* Returns null if none of the promises resulted in an exception, or the exception otherwise.
|
|
39
|
-
*/
|
|
40
|
-
private resolveAll;
|
|
41
|
-
private syncCollection;
|
|
42
|
-
private syncCachedQuery;
|
|
43
|
-
private addMatchedEntriesToCollections;
|
|
44
|
-
}
|
|
1
|
+
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
+
import { AbstractCache, ApiRequestService, CachedQueryItem, ChangesDeltaBase, CollectionQuery, CollectionResource, FieldMap, ItemEntry, ItemTypeMap, ParentChangesDelta, PromiseInterface, PromiseLibraryInterface, QueryMatcherFactory, QueryService } from '../internal';
|
|
3
|
+
export declare type CacheSyncerQueryMap = ItemTypeMap<{
|
|
4
|
+
[cachedQueryString: string]: {
|
|
5
|
+
cachedQueryItems: CachedQueryItem[];
|
|
6
|
+
collectionResources: CollectionResource[];
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
export declare type CacheSyncerMatches<ItemTypeType extends ApiEnumItemType> = {
|
|
10
|
+
[itemId: number]: {
|
|
11
|
+
item: ItemEntry<ItemTypeType>;
|
|
12
|
+
isMatch: boolean | 'maybe';
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare class CacheSyncer {
|
|
16
|
+
private queryService;
|
|
17
|
+
private queryMatcherFactory;
|
|
18
|
+
private apiRequestService;
|
|
19
|
+
private promiseService;
|
|
20
|
+
private transaction;
|
|
21
|
+
private cachedQueryMap;
|
|
22
|
+
private matchedItemEntryMap;
|
|
23
|
+
constructor(queryService: QueryService, queryMatcherFactory: QueryMatcherFactory, apiRequestService: ApiRequestService, promiseService: PromiseLibraryInterface, transaction: AbstractCache, cachedQueryMap: CacheSyncerQueryMap);
|
|
24
|
+
syncCollections(isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDeltaBase): PromiseInterface<void>;
|
|
25
|
+
syncCachedQueries(_isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDeltaBase): PromiseInterface<void[]>;
|
|
26
|
+
expand<ItemEntryType extends ItemEntry>(itemEntry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>): this;
|
|
27
|
+
processDelta(parentChangesDelta: ParentChangesDelta): this;
|
|
28
|
+
groupMatchedItemEntries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: CollectionQuery): {
|
|
29
|
+
[key in 'fitting' | 'notFitting' | 'maybe']: ItemEntry<ItemTypeType>[];
|
|
30
|
+
};
|
|
31
|
+
_expand<ItemTypeType extends ApiEnumItemType = any>(itemEntry: ItemEntry<ItemTypeType>, matchFunction: (itemType: ItemTypeType, parsedQuery: CollectionQuery) => boolean | 'maybe'): this;
|
|
32
|
+
/**
|
|
33
|
+
* Unlike the functions that use a promise accumulator, this function *can* result in a rejection. It should be handled
|
|
34
|
+
* by the caller.
|
|
35
|
+
*/
|
|
36
|
+
protected processMaybeMatches<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: CollectionQuery, maybeItemEntries: ItemEntry<ItemTypeType>[], changesDelta: ChangesDeltaBase | undefined): PromiseInterface<ItemEntry<ItemTypeType>[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Returns null if none of the promises resulted in an exception, or the exception otherwise.
|
|
39
|
+
*/
|
|
40
|
+
private resolveAll;
|
|
41
|
+
private syncCollection;
|
|
42
|
+
private syncCachedQuery;
|
|
43
|
+
private addMatchedEntriesToCollections;
|
|
44
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
-
import { InternalCreateDelta, ItemEntry, ItemEntryMap, ItemMap, TransactionCache } from '../internal';
|
|
3
|
-
export declare type CreateRequestCompilationParent = ApiEnumItemType | 'Void';
|
|
4
|
-
export declare type CreateCompilation = {
|
|
5
|
-
[parentType: string]: {
|
|
6
|
-
[parentId: number]: ItemMap<InternalCreateDelta>;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export declare type DeleteCompilation = {
|
|
10
|
-
[itemType: string]: ItemEntry[];
|
|
11
|
-
};
|
|
12
|
-
export declare type UpdateCompilation = ItemEntryMap;
|
|
13
|
-
export declare type MoveCompilation = {
|
|
14
|
-
[parentType: string]: {
|
|
15
|
-
[parentId: number]: ItemEntry[];
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare class ChangesCompilation {
|
|
19
|
-
private transaction;
|
|
20
|
-
compilation: {
|
|
21
|
-
create: CreateCompilation;
|
|
22
|
-
delete: DeleteCompilation;
|
|
23
|
-
update: UpdateCompilation;
|
|
24
|
-
move: MoveCompilation;
|
|
25
|
-
};
|
|
26
|
-
constructor(transaction: TransactionCache);
|
|
27
|
-
private processDelta;
|
|
28
|
-
private getDefaultParent;
|
|
29
|
-
private addMoveEntry;
|
|
30
|
-
private addDeleteEntry;
|
|
31
|
-
private addUpdateEntry;
|
|
32
|
-
private addCreateEntry;
|
|
33
|
-
}
|
|
1
|
+
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
+
import { InternalCreateDelta, ItemEntry, ItemEntryMap, ItemMap, TransactionCache } from '../internal';
|
|
3
|
+
export declare type CreateRequestCompilationParent = ApiEnumItemType | 'Void';
|
|
4
|
+
export declare type CreateCompilation = {
|
|
5
|
+
[parentType: string]: {
|
|
6
|
+
[parentId: number]: ItemMap<InternalCreateDelta>;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare type DeleteCompilation = {
|
|
10
|
+
[itemType: string]: ItemEntry[];
|
|
11
|
+
};
|
|
12
|
+
export declare type UpdateCompilation = ItemEntryMap;
|
|
13
|
+
export declare type MoveCompilation = {
|
|
14
|
+
[parentType: string]: {
|
|
15
|
+
[parentId: number]: ItemEntry[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare class ChangesCompilation {
|
|
19
|
+
private transaction;
|
|
20
|
+
compilation: {
|
|
21
|
+
create: CreateCompilation;
|
|
22
|
+
delete: DeleteCompilation;
|
|
23
|
+
update: UpdateCompilation;
|
|
24
|
+
move: MoveCompilation;
|
|
25
|
+
};
|
|
26
|
+
constructor(transaction: TransactionCache);
|
|
27
|
+
private processDelta;
|
|
28
|
+
private getDefaultParent;
|
|
29
|
+
private addMoveEntry;
|
|
30
|
+
private addDeleteEntry;
|
|
31
|
+
private addUpdateEntry;
|
|
32
|
+
private addCreateEntry;
|
|
33
|
+
}
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { ApiEnumItemType, ApiFields, ItemId } from '@rentman/backend-types';
|
|
2
|
-
import { ApiFormatter, ChangesDeltaBase, ColumnSet, CreatedChangesDelta, EntryParent, EntryParentNull, ErrorHandlerInterface, FieldMap, ItemCreateService, ItemEntry, ItemEntryService, PromiseInterface } from '../internal';
|
|
3
|
-
export declare type ChangesDeltaItemDeleteDelta = ItemEntry;
|
|
4
|
-
/**
|
|
5
|
-
* @description
|
|
6
|
-
* ChangesDelta used to apply changes from outside of the core to a transaction
|
|
7
|
-
*
|
|
8
|
-
* ----------
|
|
9
|
-
*
|
|
10
|
-
* The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
|
|
11
|
-
* assumes 'created' values have no itemEntries yet.
|
|
12
|
-
*
|
|
13
|
-
* Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
|
|
14
|
-
*/
|
|
15
|
-
export declare class ChangesDelta extends ChangesDeltaBase {
|
|
16
|
-
private errorHandler;
|
|
17
|
-
private itemCreateService;
|
|
18
|
-
created: CreatedChangesDelta;
|
|
19
|
-
deleted: {
|
|
20
|
-
[itemType: string]: ChangesDeltaItemDeleteDelta[];
|
|
21
|
-
};
|
|
22
|
-
constructor(errorHandler: ErrorHandlerInterface, itemCreateService: ItemCreateService, itemEntryService: ItemEntryService, apiFormatter: ApiFormatter);
|
|
23
|
-
/**
|
|
24
|
-
* @description
|
|
25
|
-
* Fetches a template for the passed itemType and processes the passed values and sets the item to be created when the delta is applied
|
|
26
|
-
*
|
|
27
|
-
* @remark
|
|
28
|
-
* - If the values don't contain an `id` a new one will be generated
|
|
29
|
-
* - If you want to set a parent set the proper field, you can't pass it as a separate object
|
|
30
|
-
*/
|
|
31
|
-
setItemCreated<ItemTypeType extends ApiEnumItemType, Fields extends Partial<FieldMap<ItemTypeType>>>(itemType: ItemTypeType, values: Fields): PromiseInterface<this>;
|
|
32
|
-
setItemDeleted(deleted: ChangesDeltaItemDeleteDelta): this;
|
|
33
|
-
setItemsDeleted(deleted: ChangesDeltaItemDeleteDelta[]): this;
|
|
34
|
-
/**
|
|
35
|
-
* @description
|
|
36
|
-
* Fetches a template for the passed itemType and processes the passed values and sets the items to be created when the delta is applied
|
|
37
|
-
*
|
|
38
|
-
* @remark
|
|
39
|
-
* - If the values don't contain an `id` a new one will be generated
|
|
40
|
-
* - If you want to set a parent set the proper field, you can't pass it as a separate object
|
|
41
|
-
*/
|
|
42
|
-
setItemsCreated<ItemTypeType extends ApiEnumItemType, ColumnIds extends (keyof ApiFields[ItemTypeType])[] = (keyof ApiFields[ItemTypeType])[]>(itemType: ItemTypeType, valuesArray: Partial<FieldMap<ItemTypeType, ColumnIds>>[]): PromiseInterface<this>;
|
|
43
|
-
/**
|
|
44
|
-
* @description
|
|
45
|
-
* Will create an {@link ItemEntry ItemEntry} when the delta is applied
|
|
46
|
-
* Does not always mean the item is local, just that it isn't cached yet
|
|
47
|
-
*
|
|
48
|
-
* @remark
|
|
49
|
-
* If you're calling this from the frontend you probably want to call `setItemCreated`, which will fetch a template and process the values for you
|
|
50
|
-
* If you don't, you have to make sure the values are all correct and all template items are processed
|
|
51
|
-
*
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
_setItemCreated<ItemTypeType extends ApiEnumItemType, Fields extends FieldMap<ItemTypeType>>(itemId: ItemId, fields: Fields, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull, isRoot?: boolean): this;
|
|
55
|
-
/**
|
|
56
|
-
* @description
|
|
57
|
-
* Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
|
|
58
|
-
*/
|
|
59
|
-
setItemMoved(entry: ItemEntry, to: EntryParent, updateModified?: boolean, updateInitial?: boolean): this;
|
|
60
|
-
isEmpty(): boolean;
|
|
61
|
-
}
|
|
1
|
+
import { ApiEnumItemType, ApiFields, ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ApiFormatter, ChangesDeltaBase, ColumnSet, CreatedChangesDelta, EntryParent, EntryParentNull, ErrorHandlerInterface, FieldMap, ItemCreateService, ItemEntry, ItemEntryService, PromiseInterface } from '../internal';
|
|
3
|
+
export declare type ChangesDeltaItemDeleteDelta = ItemEntry;
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* ChangesDelta used to apply changes from outside of the core to a transaction
|
|
7
|
+
*
|
|
8
|
+
* ----------
|
|
9
|
+
*
|
|
10
|
+
* The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
|
|
11
|
+
* assumes 'created' values have no itemEntries yet.
|
|
12
|
+
*
|
|
13
|
+
* Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
|
|
14
|
+
*/
|
|
15
|
+
export declare class ChangesDelta extends ChangesDeltaBase {
|
|
16
|
+
private errorHandler;
|
|
17
|
+
private itemCreateService;
|
|
18
|
+
created: CreatedChangesDelta;
|
|
19
|
+
deleted: {
|
|
20
|
+
[itemType: string]: ChangesDeltaItemDeleteDelta[];
|
|
21
|
+
};
|
|
22
|
+
constructor(errorHandler: ErrorHandlerInterface, itemCreateService: ItemCreateService, itemEntryService: ItemEntryService, apiFormatter: ApiFormatter);
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Fetches a template for the passed itemType and processes the passed values and sets the item to be created when the delta is applied
|
|
26
|
+
*
|
|
27
|
+
* @remark
|
|
28
|
+
* - If the values don't contain an `id` a new one will be generated
|
|
29
|
+
* - If you want to set a parent set the proper field, you can't pass it as a separate object
|
|
30
|
+
*/
|
|
31
|
+
setItemCreated<ItemTypeType extends ApiEnumItemType, Fields extends Partial<FieldMap<ItemTypeType>>>(itemType: ItemTypeType, values: Fields): PromiseInterface<this>;
|
|
32
|
+
setItemDeleted(deleted: ChangesDeltaItemDeleteDelta): this;
|
|
33
|
+
setItemsDeleted(deleted: ChangesDeltaItemDeleteDelta[]): this;
|
|
34
|
+
/**
|
|
35
|
+
* @description
|
|
36
|
+
* Fetches a template for the passed itemType and processes the passed values and sets the items to be created when the delta is applied
|
|
37
|
+
*
|
|
38
|
+
* @remark
|
|
39
|
+
* - If the values don't contain an `id` a new one will be generated
|
|
40
|
+
* - If you want to set a parent set the proper field, you can't pass it as a separate object
|
|
41
|
+
*/
|
|
42
|
+
setItemsCreated<ItemTypeType extends ApiEnumItemType, ColumnIds extends (keyof ApiFields[ItemTypeType])[] = (keyof ApiFields[ItemTypeType])[]>(itemType: ItemTypeType, valuesArray: Partial<FieldMap<ItemTypeType, ColumnIds>>[]): PromiseInterface<this>;
|
|
43
|
+
/**
|
|
44
|
+
* @description
|
|
45
|
+
* Will create an {@link ItemEntry ItemEntry} when the delta is applied
|
|
46
|
+
* Does not always mean the item is local, just that it isn't cached yet
|
|
47
|
+
*
|
|
48
|
+
* @remark
|
|
49
|
+
* If you're calling this from the frontend you probably want to call `setItemCreated`, which will fetch a template and process the values for you
|
|
50
|
+
* If you don't, you have to make sure the values are all correct and all template items are processed
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
_setItemCreated<ItemTypeType extends ApiEnumItemType, Fields extends FieldMap<ItemTypeType>>(itemId: ItemId, fields: Fields, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull, isRoot?: boolean): this;
|
|
55
|
+
/**
|
|
56
|
+
* @description
|
|
57
|
+
* Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
|
|
58
|
+
*/
|
|
59
|
+
setItemMoved(entry: ItemEntry, to: EntryParent, updateModified?: boolean, updateInitial?: boolean): this;
|
|
60
|
+
isEmpty(): boolean;
|
|
61
|
+
}
|