@rentman/rm-core 8.1.6 → 8.1.8-dev1
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 +923 -914
- package/dist/rm-core.js +18307 -11022
- package/dist/rm-core.min.js +1 -16
- package/dist/types/classes/ApiFormatter.d.ts +73 -66
- package/dist/types/classes/ApiRequestService.d.ts +18 -21
- package/dist/types/classes/ApiResponseProcessor.d.ts +29 -30
- package/dist/types/classes/CacheSyncer.d.ts +36 -0
- package/dist/types/classes/ChangesCompilation.d.ts +33 -36
- package/dist/types/classes/ChangesDelta.d.ts +61 -68
- package/dist/types/classes/ChangesDeltaBase.d.ts +76 -79
- package/dist/types/classes/ChangesProcessor.d.ts +40 -45
- package/dist/types/classes/CollectionEntryService.d.ts +23 -27
- package/dist/types/classes/CollectionResourceService.d.ts +6 -7
- package/dist/types/classes/ColumnCache.d.ts +21 -22
- package/dist/types/classes/ColumnExpansion.d.ts +21 -23
- package/dist/types/classes/ColumnHandler.d.ts +20 -22
- package/dist/types/classes/ColumnInfo.d.ts +14 -14
- package/dist/types/classes/ColumnSet.d.ts +37 -39
- package/dist/types/classes/ColumnSubsetCache.d.ts +14 -15
- package/dist/types/classes/ColumnUtil.d.ts +100 -101
- package/dist/types/classes/ConversionMapService.d.ts +25 -28
- package/dist/types/classes/CreateRequest.d.ts +17 -20
- package/dist/types/classes/CreatedChangesDelta.d.ts +17 -18
- package/dist/types/classes/InternalChangesDelta.d.ts +47 -51
- package/dist/types/classes/ItemCache.d.ts +27 -30
- package/dist/types/classes/ItemCreateService.d.ts +18 -25
- package/dist/types/classes/ItemEntryService.d.ts +32 -35
- package/dist/types/classes/KeyService.d.ts +18 -18
- package/dist/types/classes/LockService.d.ts +29 -32
- package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -19
- package/dist/types/classes/ParentChangesDelta.d.ts +39 -47
- package/dist/types/classes/QueryColumnExtractor.d.ts +18 -20
- package/dist/types/classes/QueryContainsLocalIdParser.d.ts +15 -17
- package/dist/types/classes/QueryLinkedToParser.d.ts +15 -16
- package/dist/types/classes/QueryLocallyMatchableParser.d.ts +18 -19
- package/dist/types/classes/QueryMatcher.d.ts +18 -19
- package/dist/types/classes/QueryParser.d.ts +25 -26
- package/dist/types/classes/QueryParserBase.d.ts +20 -20
- package/dist/types/classes/QueryParserIdUpdater.d.ts +15 -16
- package/dist/types/classes/QueryService.d.ts +12 -13
- package/dist/types/classes/RequestBuffer.d.ts +24 -29
- package/dist/types/classes/RequestBufferManager.d.ts +20 -26
- package/dist/types/classes/RequestColumnExpansion.d.ts +15 -16
- package/dist/types/classes/SocketMessageHandler.d.ts +34 -43
- package/dist/types/classes/TemplateCache.d.ts +63 -70
- package/dist/types/classes/Util.d.ts +28 -31
- package/dist/types/classes/cache/AbstractCache.d.ts +95 -112
- package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +68 -75
- package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -106
- package/dist/types/classes/cache/server/ServerCache.d.ts +82 -94
- package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +25 -34
- package/dist/types/classes/cache/server/ServerItemHandler.d.ts +44 -53
- package/dist/types/classes/cache/transaction/TransactionCache.d.ts +319 -327
- package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +31 -30
- package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -30
- package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +21 -24
- package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +89 -97
- package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +33 -35
- package/dist/types/constants.d.ts +7 -7
- package/dist/types/core.d.ts +45 -51
- package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/types/factories/CacheSyncerFactory.d.ts +10 -0
- package/dist/types/factories/ChangesCompilationFactory.d.ts +5 -6
- package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -15
- package/dist/types/factories/ChangesProcessorFactory.d.ts +13 -19
- package/dist/types/factories/CollectionEntryFactory.d.ts +11 -14
- package/dist/types/factories/CollectionResourceFactory.d.ts +18 -22
- package/dist/types/factories/ColumnExpansionFactory.d.ts +7 -9
- package/dist/types/factories/ColumnInfoFactory.d.ts +7 -8
- package/dist/types/factories/ColumnSetFactory.d.ts +18 -20
- package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +8 -9
- package/dist/types/factories/CreateRequestFactory.d.ts +9 -11
- package/dist/types/factories/ItemCacheFactory.d.ts +6 -8
- package/dist/types/factories/ItemEntryFactory.d.ts +12 -15
- package/dist/types/factories/ItemResourceFactory.d.ts +11 -14
- package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +4 -5
- package/dist/types/factories/QueryMatcherFactory.d.ts +7 -8
- package/dist/types/factories/QueryParserFactory.d.ts +5 -6
- package/dist/types/factories/RequestColumnExpansionFactory.d.ts +8 -9
- package/dist/types/factories/TemplateFactory.d.ts +8 -11
- package/dist/types/factories/TransactionCacheFactory.d.ts +13 -15
- package/dist/types/index.d.ts +1 -7
- package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +36 -43
- 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 -7
- package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -21
- package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -27
- package/dist/types/internal.d.ts +104 -0
- package/dist/types/models/CachedQueryItem.d.ts +19 -0
- package/dist/types/models/CollectionEntry.d.ts +21 -24
- package/dist/types/models/CollectionOptions.d.ts +42 -24
- package/dist/types/models/CollectionResource.d.ts +87 -78
- package/dist/types/models/ItemEntry.d.ts +18 -19
- package/dist/types/models/ItemEntryOptions.d.ts +8 -8
- package/dist/types/models/ItemResource.d.ts +90 -88
- package/dist/types/models/Template.d.ts +11 -13
- package/dist/types/types/ItemTypesCollection.d.ts +343 -345
- package/dist/types/types/PromiseInterface.d.ts +2 -2
- package/package.json +48 -38
- package/readme.md +15 -15
- package/dist/types/classes/CollectionMatcherBase.d.ts +0 -22
- package/dist/types/classes/CollectionMatcherCachedCollectionProcessor.d.ts +0 -32
- package/dist/types/classes/cache/CollectionMatcherCachedQueryProcessor.d.ts +0 -36
- package/dist/types/classes/index.d.ts +0 -46
- package/dist/types/factories/CollectionMatcherFactory.d.ts +0 -19
- package/dist/types/factories/index.d.ts +0 -21
- package/dist/types/interfaces/index.d.ts +0 -11
- package/dist/types/models/index.d.ts +0 -7
- package/dist/types/types/index.d.ts +0 -2
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
-
import { AuthInterface } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
getTitleField(itemType: ApiEnumItemType): string;
|
|
34
|
-
getLocalDefaultValues<ItemTypeType extends ApiEnumItemType>(): FieldMap<ItemTypeType, ['permissions', 'creator', 'created']>;
|
|
35
|
-
}
|
|
1
|
+
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
+
import { AuthInterface, EntryParent, EntryParentNull, FieldMap, ItemEntry, ItemEntryOptions, ItemError, ItemOptionsInterface, LinkTreeServiceInterface } from '../internal';
|
|
3
|
+
export declare class ItemEntryService {
|
|
4
|
+
private authInterface;
|
|
5
|
+
private linkTreeService;
|
|
6
|
+
constructor(authInterface: AuthInterface, linkTreeService: LinkTreeServiceInterface);
|
|
7
|
+
matchParent(oldParent: EntryParentNull, newParent: EntryParentNull): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Gets the fields required to set the parent
|
|
11
|
+
*
|
|
12
|
+
* @remark
|
|
13
|
+
* Opposite of {@link ItemEntryService.getParentByFields ItemEntryService.getParentByFields}
|
|
14
|
+
*/
|
|
15
|
+
getLinkFieldsByParent<ParentItemType extends ApiEnumItemType, ItemTypeType extends ApiEnumItemType>(parent: EntryParent<ParentItemType>, itemType: ItemTypeType): Partial<FieldMap<ItemTypeType>>;
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* Gets an {@link EntryParent EntryParent} object from the fields
|
|
19
|
+
*
|
|
20
|
+
* @remark
|
|
21
|
+
* Opposite of {@link ItemEntryService.getLinkFieldsByParent ItemEntryService.getLinkFieldsByParent}
|
|
22
|
+
*/
|
|
23
|
+
getParentByFields<ItemTypeType extends ApiEnumItemType>(parentType: ApiEnumItemType, itemEntry: ItemEntry<ItemTypeType>, fields: FieldMap<ItemTypeType>): EntryParent;
|
|
24
|
+
getDisplayName<ItemEntryType extends ItemEntry>(itemEntry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>): string | undefined;
|
|
25
|
+
processOptions(options: ItemOptionsInterface): ItemEntryOptions;
|
|
26
|
+
createUnfoundRemoteItemError(): ItemError;
|
|
27
|
+
createUnfoundLocalItemError(itemType: ApiEnumItemType): ItemError;
|
|
28
|
+
createExistingLocalItemError(itemType: ApiEnumItemType): ItemError;
|
|
29
|
+
getFullName(firstName: string, infix: string, lastName: string): string | undefined;
|
|
30
|
+
getTitleField(itemType: ApiEnumItemType): string;
|
|
31
|
+
getLocalDefaultValues<ItemTypeType extends ApiEnumItemType>(): FieldMap<ItemTypeType, ['permissions', 'creator', 'created']>;
|
|
32
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ItemId } from '@rentman/backend-types';
|
|
2
|
-
import { StateKey } from '../
|
|
3
|
-
export declare class KeyService {
|
|
4
|
-
private separator;
|
|
5
|
-
private idCounter;
|
|
6
|
-
constructor();
|
|
7
|
-
getSingleKey(itemType: string, itemId: ItemId | string): string;
|
|
8
|
-
getCssKey(...args: any[]): string;
|
|
9
|
-
parseStateKey(stateKey: string): StateKey | null;
|
|
10
|
-
getDuplicateStateKey(itemId: string | ItemId): string;
|
|
11
|
-
getNewStateKey(templateType: string): string;
|
|
12
|
-
getLocalId(): ItemId;
|
|
13
|
-
getLocalDuplicateId(): ItemId;
|
|
14
|
-
getRandomString(): string;
|
|
15
|
-
isLocalId(itemId: any): boolean;
|
|
16
|
-
isNewId(itemId: any): boolean;
|
|
17
|
-
isDuplicateId(itemId: any): boolean;
|
|
18
|
-
}
|
|
1
|
+
import { ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { StateKey } from '../internal';
|
|
3
|
+
export declare class KeyService {
|
|
4
|
+
private separator;
|
|
5
|
+
private idCounter;
|
|
6
|
+
constructor();
|
|
7
|
+
getSingleKey(itemType: string, itemId: ItemId | string): string;
|
|
8
|
+
getCssKey(...args: any[]): string;
|
|
9
|
+
parseStateKey(stateKey: string): StateKey | null;
|
|
10
|
+
getDuplicateStateKey(itemId: string | ItemId): string;
|
|
11
|
+
getNewStateKey(templateType: string): string;
|
|
12
|
+
getLocalId(): ItemId;
|
|
13
|
+
getLocalDuplicateId(): ItemId;
|
|
14
|
+
getRandomString(): string;
|
|
15
|
+
isLocalId(itemId: any): boolean;
|
|
16
|
+
isNewId(itemId: any): boolean;
|
|
17
|
+
isDuplicateId(itemId: any): boolean;
|
|
18
|
+
}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
|
|
2
|
-
import { ApiRequestService, KeyService } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
isRemoteLock(token: LockToken): token is LockTokenError;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
1
|
+
import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ApiRequestService, ErrorHandlerInterface, FieldMap, ItemEntry, KeyService, PromiseInterface, PromiseLibraryInterface } from '../internal';
|
|
3
|
+
declare type LockTokenError = {
|
|
4
|
+
isForeign: true;
|
|
5
|
+
message: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type LockToken = FieldMap<ApiEnumItemType.Locktoken, ['token', 'id']> | LockTokenError;
|
|
8
|
+
export declare class LockService {
|
|
9
|
+
private apiRequestService;
|
|
10
|
+
private errorHandler;
|
|
11
|
+
private keyService;
|
|
12
|
+
private promiseService;
|
|
13
|
+
private lockItems;
|
|
14
|
+
private promises;
|
|
15
|
+
constructor(apiRequestService: ApiRequestService, errorHandler: ErrorHandlerInterface, keyService: KeyService, promiseService: PromiseLibraryInterface);
|
|
16
|
+
getLocks(): LockService['lockItems'];
|
|
17
|
+
hasLock(lockTokenId: ItemId): boolean;
|
|
18
|
+
isLocked(itemEntry: ItemEntry): boolean;
|
|
19
|
+
getMessage(itemEntry: ItemEntry): undefined | string;
|
|
20
|
+
fetchLock(itemEntry: ItemEntry): PromiseInterface<LockToken>;
|
|
21
|
+
deleteLock(itemEntry: ItemEntry): PromiseInterface<void>;
|
|
22
|
+
clearLock(itemEntry: ItemEntry): boolean;
|
|
23
|
+
private requestLock;
|
|
24
|
+
private fetchCachedLock;
|
|
25
|
+
private getValue;
|
|
26
|
+
private setValue;
|
|
27
|
+
isRemoteLock(token: LockToken): token is LockTokenError;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
|
|
2
|
-
import { ApiRequestItemMap } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ApiRequestItemMap, TransactionCache } from '../internal';
|
|
3
|
+
export declare type ModuleChangesCompilationResult = {
|
|
4
|
+
itemType: ApiEnumItemType;
|
|
5
|
+
itemId: ItemId;
|
|
6
|
+
items: ApiRequestItemMap;
|
|
7
|
+
};
|
|
8
|
+
export declare class ModuleChangesCompilation {
|
|
9
|
+
private transaction;
|
|
10
|
+
parentMap: any;
|
|
11
|
+
destination: ApiRequestItemMap;
|
|
12
|
+
constructor(transaction: TransactionCache);
|
|
13
|
+
process(): ModuleChangesCompilationResult;
|
|
14
|
+
private createParentMap;
|
|
15
|
+
private processItems;
|
|
16
|
+
private processItem;
|
|
17
|
+
private getItemsByParent;
|
|
18
|
+
}
|
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
-
import { ItemEntry } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
setItemCreated<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, fields: FieldMap<ItemTypeType>): void;
|
|
41
|
-
/**
|
|
42
|
-
* @remark
|
|
43
|
-
* Parent fields are non-writable so we need to keep track of moved entries another way (to do a linkTo request)
|
|
44
|
-
*/
|
|
45
|
-
setItemMoved(entry: ItemEntry, to: EntryParent): void;
|
|
46
|
-
isEmpty(): boolean;
|
|
47
|
-
}
|
|
1
|
+
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
+
import { ChangesDeltaBase, ChangesDeltaItemDeleteDelta, EntryParent, FieldMap, InternalCreateDelta, ItemEntry, ItemEntryService, ItemIdConversionMap } from '../internal';
|
|
3
|
+
export declare type ParentChangesDeltaItemDeleteDelta = ItemEntry;
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* ChangesDelta used internally by the core
|
|
7
|
+
*
|
|
8
|
+
* ----------
|
|
9
|
+
*
|
|
10
|
+
* The difference between {@link ParentChangesDelta ParentChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ParentChangesDelta
|
|
11
|
+
* assumes 'created' entries are already existing, and deletedEntries don't have changes (since you cannot undo an action that happened on a parent on a child transaction)
|
|
12
|
+
*
|
|
13
|
+
* Use this when calling {@link TransactionCache.applyChangesFromParent applyChangesFromParent}
|
|
14
|
+
*/
|
|
15
|
+
export declare class ParentChangesDelta extends ChangesDeltaBase {
|
|
16
|
+
created: {
|
|
17
|
+
[itemEntryId: string]: InternalCreateDelta;
|
|
18
|
+
};
|
|
19
|
+
deleted: {
|
|
20
|
+
[itemType: string]: ParentChangesDeltaItemDeleteDelta[];
|
|
21
|
+
};
|
|
22
|
+
moved: {
|
|
23
|
+
[itemEntryId: number]: {
|
|
24
|
+
entry: ItemEntry;
|
|
25
|
+
to: EntryParent;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
itemIdConversionMap: ItemIdConversionMap;
|
|
29
|
+
constructor(itemEntryService: ItemEntryService);
|
|
30
|
+
setItemDeleted(deleted: ChangesDeltaItemDeleteDelta): this;
|
|
31
|
+
setItemsDeleted(deleted: ChangesDeltaItemDeleteDelta[]): this;
|
|
32
|
+
setItemCreated<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, fields: FieldMap<ItemTypeType>): void;
|
|
33
|
+
/**
|
|
34
|
+
* @remark
|
|
35
|
+
* Parent fields are non-writable so we need to keep track of moved entries another way (to do a linkTo request)
|
|
36
|
+
*/
|
|
37
|
+
setItemMoved(entry: ItemEntry, to: EntryParent): void;
|
|
38
|
+
isEmpty(): boolean;
|
|
39
|
+
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { ApiEnumItemType, ApiQueryConditionLinkedTo, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
-
import { ApiQuery, ApiQueryConditionComparator, ApiQueryWithConditions, ApiRequestColumn } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
protected
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
16
|
-
protected
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
private parseConditions;
|
|
20
|
-
}
|
|
1
|
+
import { ApiEnumItemType, ApiQueryConditionLinkedTo, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
+
import { ApiQuery, ApiQueryConditionComparator, ApiQueryWithConditions, ApiRequestColumn, ColumnUtil, QueryParserBase } from '../internal';
|
|
3
|
+
export declare class QueryColumnExtractor extends QueryParserBase<ApiRequestColumn[]> {
|
|
4
|
+
private columnUtil;
|
|
5
|
+
private itemType;
|
|
6
|
+
constructor(columnUtil: ColumnUtil, itemType: ApiEnumItemType, query: ApiQuery);
|
|
7
|
+
protected parseEmptyQuery(): never[];
|
|
8
|
+
protected parseSubQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], subQuery: T['query']): {
|
|
9
|
+
[x: string]: ApiRequestColumn[];
|
|
10
|
+
}[];
|
|
11
|
+
protected parseSubFieldQuery(): never[];
|
|
12
|
+
protected parseSearchQuery(): never[];
|
|
13
|
+
protected parseCustomQuery(): never[];
|
|
14
|
+
protected parseSimpleQuery<T extends ApiQueryConditionComparator>(key: T['key']): T["key"][];
|
|
15
|
+
protected parseLinkedToQuery<T extends ApiQueryConditionLinkedTo>(linkedTo: T['linkedTo'], _query: T['query'], reverse: T['reverse']): ApiRequestColumn[];
|
|
16
|
+
protected parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions']): ApiRequestColumn[];
|
|
17
|
+
private parseConditions;
|
|
18
|
+
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { ApiQueryConditionLinkedTo, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
-
import { ApiQueryConditionComparator, ApiQueryWithConditions } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
protected
|
|
9
|
-
protected
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private parseConditions;
|
|
17
|
-
}
|
|
1
|
+
import { ApiQueryConditionLinkedTo, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
+
import { ApiQueryConditionComparator, ApiQueryWithConditions, KeyService, QueryParserBase } from '../internal';
|
|
3
|
+
export declare class QueryContainsLocalIdParser extends QueryParserBase<boolean> {
|
|
4
|
+
private keyService;
|
|
5
|
+
constructor(keyService: KeyService, query: any);
|
|
6
|
+
protected parseEmptyQuery(): boolean;
|
|
7
|
+
protected parseSubQuery<T extends ApiQueryConditionSubQuery>(_key: T['key'], subQuery: T['query']): boolean;
|
|
8
|
+
protected parseSubFieldQuery<T extends ApiQueryConditionSubQuery>(_key: T['key'], _itemType: T['itemType'], field: T['field'], query: T['query']): boolean;
|
|
9
|
+
protected parseSearchQuery(): boolean;
|
|
10
|
+
protected parseCustomQuery(): boolean;
|
|
11
|
+
protected parseSimpleQuery<T extends ApiQueryConditionComparator>(_key: T['key'], value: T['value']): boolean;
|
|
12
|
+
protected parseLinkedToQuery<T extends ApiQueryConditionLinkedTo>(_linkedTo: T['linkedTo'], query: T['query']): boolean;
|
|
13
|
+
protected parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions']): boolean;
|
|
14
|
+
private parseConditions;
|
|
15
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { ApiEnumItemType, ApiQueryConditionLinkedTo, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
-
import { ApiQuery, ApiQueryWithConditions } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
protected
|
|
8
|
-
protected
|
|
9
|
-
protected
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import { ApiEnumItemType, ApiQueryConditionLinkedTo, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
+
import { ApiQuery, ApiQueryWithConditions, QueryParserBase } from '../internal';
|
|
3
|
+
export declare class QueryLinkedToParser extends QueryParserBase<boolean> {
|
|
4
|
+
private callback;
|
|
5
|
+
constructor(callback: <ItemTypeType extends ApiEnumItemType>(linkedTo: ItemTypeType, query: ApiQuery<ItemTypeType>) => boolean, query: ApiQuery);
|
|
6
|
+
protected parseEmptyQuery(): boolean;
|
|
7
|
+
protected parseSubQuery<T extends ApiQueryConditionSubQuery>(_key: T['key'], subQuery: T['query']): boolean;
|
|
8
|
+
protected parseSubFieldQuery(): boolean;
|
|
9
|
+
protected parseSearchQuery(): boolean;
|
|
10
|
+
protected parseCustomQuery(): boolean;
|
|
11
|
+
protected parseSimpleQuery(): boolean;
|
|
12
|
+
protected parseLinkedToQuery<T extends ApiQueryConditionLinkedTo>(linkedTo: T['linkedTo'], query: T['query'], _reverse: T['reverse'], not?: T['not']): boolean;
|
|
13
|
+
protected parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions']): boolean;
|
|
14
|
+
private parseConditions;
|
|
15
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { ApiQueryConditionLinkedTo } from '@rentman/backend-types';
|
|
2
|
-
import { ApiQuery, ApiQueryWithConditions } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
16
|
-
protected
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
import { ApiQueryConditionLinkedTo } from '@rentman/backend-types';
|
|
2
|
+
import { ApiQuery, ApiQueryWithConditions, QueryParserBase } from '../internal';
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Returns whether or not a query can be parsed by the {@link QueryMatcher QueryMatcher}
|
|
6
|
+
*/
|
|
7
|
+
export declare class QueryLocallyMatchableParser extends QueryParserBase<boolean> {
|
|
8
|
+
constructor(query: ApiQuery);
|
|
9
|
+
protected parseEmptyQuery(): boolean;
|
|
10
|
+
protected parseSubQuery(): boolean;
|
|
11
|
+
protected parseSubFieldQuery(): boolean;
|
|
12
|
+
protected parseSearchQuery(): boolean;
|
|
13
|
+
protected parseCustomQuery(): boolean;
|
|
14
|
+
protected parseSimpleQuery(): boolean;
|
|
15
|
+
protected parseLinkedToQuery<T extends ApiQueryConditionLinkedTo>(_linkedTo: T['linkedTo'], _query: T['query'], reverse: T['reverse'], _not: T['not']): boolean;
|
|
16
|
+
protected parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions']): boolean;
|
|
17
|
+
private parseConditions;
|
|
18
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
-
import { ApiFormatter } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
import { ApiEnumItemType } from '@rentman/backend-types';
|
|
2
|
+
import { ApiFormatter, ApiQuery, EntryParentNull, FieldMap } from '../internal';
|
|
3
|
+
export declare class QueryMatcher {
|
|
4
|
+
private apiFormatter;
|
|
5
|
+
itemType: ApiEnumItemType;
|
|
6
|
+
fields: FieldMap;
|
|
7
|
+
parent: EntryParentNull;
|
|
8
|
+
constructor(apiFormatter: ApiFormatter, itemType: ApiEnumItemType, fields: FieldMap, parent?: EntryParentNull);
|
|
9
|
+
private compareValues;
|
|
10
|
+
/**
|
|
11
|
+
* @remark
|
|
12
|
+
* When changing this code also change {@link QueryLocallyMatchableParser QueryLocallyMatchableParser}
|
|
13
|
+
*/
|
|
14
|
+
matchQuery(query: ApiQuery): boolean | 'maybe';
|
|
15
|
+
private matchLinkedToQuery;
|
|
16
|
+
private matchComplexQuery;
|
|
17
|
+
private matchSimpleQuery;
|
|
18
|
+
}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { ApiQuery as BackendApiQuery, ApiQueryConditionInShort, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
-
import { ApiQuery, ApiQueryConditionComparator, ApiQueryWithConditions } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
14
|
-
protected
|
|
15
|
-
protected
|
|
16
|
-
protected
|
|
17
|
-
protected
|
|
18
|
-
protected
|
|
19
|
-
protected
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
1
|
+
import { ApiQuery as BackendApiQuery, ApiQueryConditionInShort, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
+
import { ApiQuery, ApiQueryConditionComparator, ApiQueryWithConditions, QueryParserBase } from '../internal';
|
|
3
|
+
export declare enum CONSTANTS {
|
|
4
|
+
OBJ = 0,
|
|
5
|
+
STR = 1,
|
|
6
|
+
SEP = ":"
|
|
7
|
+
}
|
|
8
|
+
declare type ReturnType = [BackendApiQuery, string];
|
|
9
|
+
export declare class QueryParser extends QueryParserBase<ReturnType> {
|
|
10
|
+
constructor(query: ApiQuery);
|
|
11
|
+
protected parseEmptyQuery(): ReturnType;
|
|
12
|
+
protected parseSubQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], subQuery: T['query'], not?: T['not']): ReturnType;
|
|
13
|
+
protected parseSubFieldQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], itemType: T['itemType'], field: T['field'], query: T['query'], not?: T['not']): ReturnType;
|
|
14
|
+
protected parseSearchQuery(value: any, not?: boolean): ReturnType;
|
|
15
|
+
protected parseCustomQuery(custom: string, parameters: any, not?: boolean): ReturnType;
|
|
16
|
+
protected parseCustomParameters(parameters: any): ReturnType;
|
|
17
|
+
protected parseSimpleQuery<T extends ApiQueryConditionComparator | ApiQueryConditionInShort<any, any>>(key: T['key'], value: T['value'], comparator: T['comparator'] | undefined, not?: T['not']): ReturnType;
|
|
18
|
+
protected parseLinkedToQuery(linkedTo: any, query?: ApiQuery, reverse?: boolean, not?: boolean): ReturnType;
|
|
19
|
+
protected parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions'], operator?: T['operator'], not?: T['not']): ReturnType;
|
|
20
|
+
private parseConditions;
|
|
21
|
+
private formatValue;
|
|
22
|
+
private processValue;
|
|
23
|
+
private compareParsedQueries;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ApiQueryConditionCustom, ApiQueryConditionLinkedTo, ApiQueryConditionSearch, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
-
import { ApiQuery, ApiQueryConditionComparator, ApiQueryWithConditions } from '../
|
|
3
|
-
export declare abstract class QueryParserBase<ReturnType extends any> {
|
|
4
|
-
protected query: ApiQuery;
|
|
5
|
-
protected constructor(query: ApiQuery);
|
|
6
|
-
parse(query?: ApiQuery): ReturnType;
|
|
7
|
-
protected abstract parseEmptyQuery(): ReturnType;
|
|
8
|
-
protected abstract parseSubQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], subQuery: T['query'], not: T['not'], queryPart: T): ReturnType;
|
|
9
|
-
protected abstract parseSubFieldQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], itemType: T['itemType'], field: T['field'], query: T['query'], not: T['not'], queryPart: T): ReturnType;
|
|
10
|
-
protected abstract parseSearchQuery<T extends ApiQueryConditionSearch>(value: T['search'], not: T['not'], queryPart: T): ReturnType;
|
|
11
|
-
protected abstract parseCustomQuery<T extends ApiQueryConditionCustom>(custom: T['custom'], parameters: T['parameters'], not: T['not'], queryPart: T): ReturnType;
|
|
12
|
-
protected abstract parseSimpleQuery<T extends ApiQueryConditionComparator>(key: T['key'], value: T['value'], comparator: T['comparator'], not: T['not'], queryPart: T): ReturnType;
|
|
13
|
-
protected abstract parseLinkedToQuery<T extends ApiQueryConditionLinkedTo>(linkedTo: T['linkedTo'], query: T['query'], reverse: T['reverse'], not: T['not'], queryPart: T): ReturnType;
|
|
14
|
-
protected abstract parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions'], operator: T['operator'], not: T['not'], queryPart: T): ReturnType;
|
|
15
|
-
protected isLinkedTo(query: ApiQuery): query is ApiQueryConditionLinkedTo;
|
|
16
|
-
protected isCustom(query: ApiQuery): query is ApiQueryConditionCustom;
|
|
17
|
-
protected isSearch(query: ApiQuery): query is ApiQueryConditionSearch;
|
|
18
|
-
protected isQueryWithConditions(query: ApiQuery): query is ApiQueryWithConditions;
|
|
19
|
-
protected isSub(query: ApiQuery): query is ApiQueryConditionSubQuery;
|
|
20
|
-
}
|
|
1
|
+
import { ApiQueryConditionCustom, ApiQueryConditionLinkedTo, ApiQueryConditionSearch, ApiQueryConditionSubQuery } from '@rentman/backend-types';
|
|
2
|
+
import { ApiQuery, ApiQueryConditionComparator, ApiQueryWithConditions } from '../internal';
|
|
3
|
+
export declare abstract class QueryParserBase<ReturnType extends any> {
|
|
4
|
+
protected query: ApiQuery;
|
|
5
|
+
protected constructor(query: ApiQuery);
|
|
6
|
+
parse(query?: ApiQuery): ReturnType;
|
|
7
|
+
protected abstract parseEmptyQuery(): ReturnType;
|
|
8
|
+
protected abstract parseSubQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], subQuery: T['query'], not: T['not'], queryPart: T): ReturnType;
|
|
9
|
+
protected abstract parseSubFieldQuery<T extends ApiQueryConditionSubQuery>(key: T['key'], itemType: T['itemType'], field: T['field'], query: T['query'], not: T['not'], queryPart: T): ReturnType;
|
|
10
|
+
protected abstract parseSearchQuery<T extends ApiQueryConditionSearch>(value: T['search'], not: T['not'], queryPart: T): ReturnType;
|
|
11
|
+
protected abstract parseCustomQuery<T extends ApiQueryConditionCustom>(custom: T['custom'], parameters: T['parameters'], not: T['not'], queryPart: T): ReturnType;
|
|
12
|
+
protected abstract parseSimpleQuery<T extends ApiQueryConditionComparator>(key: T['key'], value: T['value'], comparator: T['comparator'], not: T['not'], queryPart: T): ReturnType;
|
|
13
|
+
protected abstract parseLinkedToQuery<T extends ApiQueryConditionLinkedTo>(linkedTo: T['linkedTo'], query: T['query'], reverse: T['reverse'], not: T['not'], queryPart: T): ReturnType;
|
|
14
|
+
protected abstract parseComplexQuery<T extends ApiQueryWithConditions>(conditions: T['conditions'], operator: T['operator'], not: T['not'], queryPart: T): ReturnType;
|
|
15
|
+
protected isLinkedTo(query: ApiQuery): query is ApiQueryConditionLinkedTo;
|
|
16
|
+
protected isCustom(query: ApiQuery): query is ApiQueryConditionCustom;
|
|
17
|
+
protected isSearch(query: ApiQuery): query is ApiQueryConditionSearch;
|
|
18
|
+
protected isQueryWithConditions(query: ApiQuery): query is ApiQueryWithConditions;
|
|
19
|
+
protected isSub(query: ApiQuery): query is ApiQueryConditionSubQuery;
|
|
20
|
+
}
|