@rentman/rm-core 0.0.0-RM4-44763
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rm-core.js +2 -0
- package/dist/rm-core.js.map +1 -0
- package/dist/types/src/classes/ApiFormatter.d.ts +66 -0
- package/dist/types/src/classes/ApiRequestService.d.ts +18 -0
- package/dist/types/src/classes/ApiResponseProcessor.d.ts +31 -0
- package/dist/types/src/classes/BusinessLogicManager/AantalBusinessLogicRuleBase.d.ts +36 -0
- package/dist/types/src/classes/BusinessLogicManager/AantaltotaalBusinessLogicRuleBase.d.ts +60 -0
- package/dist/types/src/classes/BusinessLogicManager/Afspraak/AfspraakRecureindBusinessLogicRule.d.ts +5 -0
- package/dist/types/src/classes/BusinessLogicManager/Beschikbaarheid/BeschikbaarheidRecureindBusinessLogicRule.d.ts +5 -0
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicManager.d.ts +66 -0
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +81 -0
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRuleApplyContext.d.ts +32 -0
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRuleConditionContext.d.ts +41 -0
- package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRuleContextBase.d.ts +58 -0
- package/dist/types/src/classes/BusinessLogicManager/Contact/ContactAddressBusinessLogicRule.d.ts +22 -0
- package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldLinkedItemTypeBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldTypeBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/DefaultContactPersonUpdateBusinessLogicRule.d.ts +30 -0
- package/dist/types/src/classes/BusinessLogicManager/Documents/DocumentTemplateBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Exemplaar/ExemplaarAanschafdatumBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/Exemplaar/ExemplaarBarcodeDeleteBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurBetalingsconditieBusinessLogicRule.d.ts +21 -0
- package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurDatumBusinessLogicRule.d.ts +23 -0
- package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurNumberseriesBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/Files/FilesNameExtensionBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieNaaminternBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieRecureindBusinessLogicRule.d.ts +5 -0
- package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/Functiegroep/FunctiegroepSubprojectBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/Inhuurmateriaal/InhuurmateriaalAantalBusinessLogicRule.d.ts +4 -0
- package/dist/types/src/classes/BusinessLogicManager/Inhuurmateriaal/InhuurmateriaalAantaltotaalBusinessLogicRule.d.ts +9 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalBulkToSerialBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalIsCombinationBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalIsPhysicalCombinationBulkBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalSerialToBulkBusinessLogicRule.d.ts +16 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalToPhysicalBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalToVirtualBusinessLogicRule.d.ts +22 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTypePropertiesBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule.d.ts +23 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemBusinessLogicRuleBase.d.ts +46 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemDurationBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemMateriaalCatBusinessLogicRule.d.ts +25 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemSubprojectBusinessLogicRule.d.ts +48 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemTimeSchemeBusinessLogicRule.d.ts +27 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemTimeSchemeStartBusinessLogicRule.d.ts +18 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/LinkedTimeItemTimeValueStartBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/MateriaalCatFunctieFunctiegroep/TimeColumnUtil.d.ts +132 -0
- package/dist/types/src/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +21 -0
- package/dist/types/src/classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule.d.ts +24 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalAantalBusinessLogicRule.d.ts +4 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalAantaltotaalBusinessLogicRule.d.ts +9 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalOptieBusinessLogicRule.d.ts +26 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalParentBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/Planningmateriaal/PlanningmateriaalStaysAtLocationBusinessLogicRule.d.ts +32 -0
- package/dist/types/src/classes/BusinessLogicManager/Project/ProjectClientChangedBusinessLogicRule.d.ts +31 -0
- package/dist/types/src/classes/BusinessLogicManager/Project/ProjectContactProjectNoteBusinessLogicRule.d.ts +25 -0
- package/dist/types/src/classes/BusinessLogicManager/Project/ProjectOneSubLocationAlignBusinessRule.d.ts +26 -0
- package/dist/types/src/classes/BusinessLogicManager/ProjectSubproject/ProjectSubprojectDefaultTimeBusinessLogicRule.d.ts +26 -0
- package/dist/types/src/classes/BusinessLogicManager/PurchaseOrder/PurchaseOrderApprovalStatusBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/PurchaseOrder/PurchaseOrderOwnerBusinessLogicRule.d.ts +16 -0
- package/dist/types/src/classes/BusinessLogicManager/Rate/RateUpdatedBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/RecurrentItem/RecurrentItemRecureindBusinessLogicRule.d.ts +28 -0
- package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarAantalBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieLostItemExemplaarLocationBusinessLogicRule.d.ts +21 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolFileAccessBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolPersoneelsplannerToegangBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts +21 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolPurchaseOrderAttachPlanningBusinessLogicRule.d.ts +19 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolVisibilityFinancialsBusinessLogicRule.d.ts +35 -0
- package/dist/types/src/classes/BusinessLogicManager/Rol/RolWarehosueTrackingLogAccessBusinessLogicRule.d.ts +20 -0
- package/dist/types/src/classes/BusinessLogicManager/Setinhoud/SetinhoudCreateFixedBusinessLogicRule.d.ts +21 -0
- package/dist/types/src/classes/BusinessLogicManager/Setinhoud/SetinhoudUpdateFixedBusinessLogicRule.d.ts +26 -0
- package/dist/types/src/classes/BusinessLogicManager/Subproject/SubprojectInPlanningBusinessLogicRule.d.ts +14 -0
- package/dist/types/src/classes/BusinessLogicManager/Subproject/SubprojectOneSubLocationAlignBusinessRule.d.ts +27 -0
- package/dist/types/src/classes/BusinessLogicManager/Subproject/SubprojectOneSubNameAlignBusinessRule.d.ts +22 -0
- package/dist/types/src/classes/BusinessLogicManager/Tijd/TijdNameChangedBusinessLogicRule.d.ts +21 -0
- package/dist/types/src/classes/BusinessLogicManager/Tijd/TijdSubprojectChangedBusinessLogicRule.d.ts +17 -0
- package/dist/types/src/classes/BusinessLogicManager/Uren/HoursTypeBusinessLogicRuleBase.d.ts +10 -0
- package/dist/types/src/classes/BusinessLogicManager/Uren/UrenCalculatedDurationBusinessLogicRule.d.ts +13 -0
- package/dist/types/src/classes/BusinessLogicManager/Uren/UrenCanHaveActivitiesBusinessLogicRule.d.ts +13 -0
- package/dist/types/src/classes/BusinessLogicManager/businessLogicRule.decorator.d.ts +13 -0
- package/dist/types/src/classes/BusinessLogicManager/registeredBusinessLogicRules.d.ts +66 -0
- package/dist/types/src/classes/ChangesCompilation.d.ts +26 -0
- package/dist/types/src/classes/ChangesDelta.d.ts +81 -0
- package/dist/types/src/classes/ChangesDeltaBase.d.ts +85 -0
- package/dist/types/src/classes/ChangesProcessor.d.ts +35 -0
- package/dist/types/src/classes/ChildChangesDelta.d.ts +38 -0
- package/dist/types/src/classes/ColumnCache.d.ts +22 -0
- package/dist/types/src/classes/ColumnExpansion.d.ts +18 -0
- package/dist/types/src/classes/ColumnHandler.d.ts +16 -0
- package/dist/types/src/classes/ColumnInfo.d.ts +16 -0
- package/dist/types/src/classes/ColumnSet.d.ts +79 -0
- package/dist/types/src/classes/ColumnUtil.d.ts +97 -0
- package/dist/types/src/classes/ConversionMapService.d.ts +23 -0
- package/dist/types/src/classes/CreateRequest.d.ts +16 -0
- package/dist/types/src/classes/CreatedChangesDelta.d.ts +22 -0
- package/dist/types/src/classes/ItemCache.d.ts +26 -0
- package/dist/types/src/classes/ItemCreateService.d.ts +14 -0
- package/dist/types/src/classes/ItemEntryService.d.ts +29 -0
- package/dist/types/src/classes/KeyService.d.ts +10 -0
- package/dist/types/src/classes/LockService.d.ts +28 -0
- package/dist/types/src/classes/ModuleChangesCompilation.d.ts +20 -0
- package/dist/types/src/classes/ParentChangesDelta.d.ts +42 -0
- package/dist/types/src/classes/QueryColumnExtractor.d.ts +16 -0
- package/dist/types/src/classes/QueryContainsLocalIdParser.d.ts +14 -0
- package/dist/types/src/classes/QueryParser.d.ts +18 -0
- package/dist/types/src/classes/QueryParserBase.d.ts +32 -0
- package/dist/types/src/classes/QueryParserIdUpdater.d.ts +16 -0
- package/dist/types/src/classes/QueryService.d.ts +10 -0
- package/dist/types/src/classes/RequestBuffer/RequestBuffer.d.ts +13 -0
- package/dist/types/src/classes/RequestBuffer/RequestBufferBase.d.ts +37 -0
- package/dist/types/src/classes/RequestBuffer/RequestBufferManager.d.ts +24 -0
- package/dist/types/src/classes/RequestBuffer/SingleQueryRequestBuffer.d.ts +18 -0
- package/dist/types/src/classes/RequestColumnExpansion.d.ts +11 -0
- package/dist/types/src/classes/RequestColumnsOperationsCache.d.ts +45 -0
- package/dist/types/src/classes/SocketMessageHandler.d.ts +28 -0
- package/dist/types/src/classes/TemplateCache.d.ts +61 -0
- package/dist/types/src/classes/Util.d.ts +36 -0
- package/dist/types/src/classes/cache/AbstractCache.d.ts +86 -0
- package/dist/types/src/classes/cache/CachedQueryHandlerBase.d.ts +145 -0
- package/dist/types/src/classes/cache/ItemHandlerBase.d.ts +97 -0
- package/dist/types/src/classes/cache/ItemMatcherBase.d.ts +90 -0
- package/dist/types/src/classes/cache/server/ServerCache.d.ts +83 -0
- package/dist/types/src/classes/cache/server/ServerCachedQueryHandler.d.ts +29 -0
- package/dist/types/src/classes/cache/server/ServerItemHandler.d.ts +35 -0
- package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +342 -0
- package/dist/types/src/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +111 -0
- package/dist/types/src/classes/cache/transaction/TransactionEventHandler.d.ts +17 -0
- package/dist/types/src/classes/cache/transaction/TransactionItemHandler.d.ts +121 -0
- package/dist/types/src/classes/cache/transaction/TransactionValidator.d.ts +25 -0
- package/dist/types/src/classes/cache/transaction/TransactionValidatorBase.d.ts +19 -0
- package/dist/types/src/classes/cache/transaction/TransactionValidatorWithDependencies.d.ts +15 -0
- package/dist/types/src/classes/changes/CollectionItemChangesListenerContext.d.ts +22 -0
- package/dist/types/src/classes/changes/ItemChangesListenerContext.d.ts +7 -0
- package/dist/types/src/classes/changes/ItemChangesListenerContextBase.d.ts +44 -0
- package/dist/types/src/classes/matcher/CompatorQueryNode.d.ts +24 -0
- package/dist/types/src/classes/matcher/CustomQueryNode.d.ts +8 -0
- package/dist/types/src/classes/matcher/GraphQueryParser.d.ts +34 -0
- package/dist/types/src/classes/matcher/IsComparatorQueryNode.d.ts +13 -0
- package/dist/types/src/classes/matcher/LinkedToQueryNode.d.ts +9 -0
- package/dist/types/src/classes/matcher/NonMatchableQueryNode.d.ts +9 -0
- package/dist/types/src/classes/matcher/NotIsComparatorQueryNode.d.ts +14 -0
- package/dist/types/src/classes/matcher/QueryNode.d.ts +49 -0
- package/dist/types/src/classes/matcher/RootQueryNode.d.ts +14 -0
- package/dist/types/src/classes/matcher/SearchQueryNode.d.ts +8 -0
- package/dist/types/src/classes/matcher/SubQueryNode.d.ts +8 -0
- package/dist/types/src/classes/matcher/ValueTransformers.d.ts +41 -0
- package/dist/types/src/classes/matcher/ValuelessEdgeQueryNode.d.ts +11 -0
- package/dist/types/src/classes/matcher/greater-smaller-than-comparator-query.node.d.ts +25 -0
- package/dist/types/src/constants.d.ts +2 -0
- package/dist/types/src/core.d.ts +63 -0
- package/dist/types/src/exceptions/CriticalBusinessLogicRuleException.d.ts +4 -0
- package/dist/types/src/exceptions/ItemAlreadyExistsException.d.ts +4 -0
- package/dist/types/src/exceptions/ItemLockedException.d.ts +2 -0
- package/dist/types/src/exceptions/ItemNotFoundException.d.ts +5 -0
- package/dist/types/src/exceptions/MissingColumnException.d.ts +6 -0
- package/dist/types/src/exceptions/SavingInProgressException.d.ts +2 -0
- package/dist/types/src/exceptions/TransactionPendingException.d.ts +2 -0
- package/dist/types/src/factories/ApiResponseProcessorFactory.d.ts +5 -0
- package/dist/types/src/factories/ChangesCompilationFactory.d.ts +5 -0
- package/dist/types/src/factories/ChangesDeltaFactory.d.ts +13 -0
- package/dist/types/src/factories/CollectionResourceFactory.d.ts +20 -0
- package/dist/types/src/factories/ColumnExpansionFactory.d.ts +7 -0
- package/dist/types/src/factories/ColumnInfoFactory.d.ts +7 -0
- package/dist/types/src/factories/ColumnSetFactory.d.ts +15 -0
- package/dist/types/src/factories/GraphQueryParserFactory.d.ts +10 -0
- package/dist/types/src/factories/ItemCacheFactory.d.ts +7 -0
- package/dist/types/src/factories/ItemResourceFactory.d.ts +7 -0
- package/dist/types/src/factories/ModuleChangesCompilationFactory.d.ts +6 -0
- package/dist/types/src/factories/RequestColumnExpansionFactory.d.ts +4 -0
- package/dist/types/src/factories/RequestColumnsOperationsCacheFactory.d.ts +7 -0
- package/dist/types/src/factories/TransactionCacheFactory.d.ts +12 -0
- package/dist/types/src/index.d.ts +11 -0
- package/dist/types/src/interfaces/AbstractCacheDependencyInterface.d.ts +46 -0
- package/dist/types/src/interfaces/ApiRequestServiceInterface.d.ts +14 -0
- package/dist/types/src/interfaces/ErrorHandlerInterface.d.ts +6 -0
- package/dist/types/src/interfaces/LinkTreeServiceInterface.d.ts +6 -0
- package/dist/types/src/interfaces/ServerCacheDependencyInterface.d.ts +6 -0
- package/dist/types/src/interfaces/SocketMessageInterface.d.ts +3 -0
- package/dist/types/src/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +15 -0
- package/dist/types/src/interfaces/TransactionItemHandlerDependencyInterface.d.ts +16 -0
- package/dist/types/src/internal.d.ts +110 -0
- package/dist/types/src/models/CachedQueryItem.d.ts +33 -0
- package/dist/types/src/models/CollectionEntry.d.ts +16 -0
- package/dist/types/src/models/CollectionOptions.d.ts +111 -0
- package/dist/types/src/models/CollectionResource.d.ts +175 -0
- package/dist/types/src/models/ItemEntry.d.ts +23 -0
- package/dist/types/src/models/ItemOptions.d.ts +25 -0
- package/dist/types/src/models/ItemResource.d.ts +135 -0
- package/dist/types/src/models/LimitedCollectionResource.d.ts +26 -0
- package/dist/types/src/models/OrderedCollectionResource.d.ts +19 -0
- package/dist/types/src/models/Template.d.ts +17 -0
- package/dist/types/src/services/rm-holidays.service.d.ts +31 -0
- package/dist/types/src/types/AggregatedChangesListener.d.ts +99 -0
- package/dist/types/src/types/ApiQuery.d.ts +95 -0
- package/dist/types/src/types/ItemTypesCollection.d.ts +416 -0
- package/package.json +56 -0
- package/readme.md +42 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
|
2
|
+
import { ApiItemType, ItemId } from '@rentman/backend-types';
|
|
3
|
+
import { AbstractCache, ChangesDeltaBase, ChangesDeltaItemCreateDelta, ColumnCache, ColumnInfo, DerivedStringToRequestColumnPath, ErrorHandlerInterface, FieldMap, GetFieldValueType, ItemCache, ItemCacheFactory, ItemEntry, ItemEntryService, ItemMatcherBase, ItemTypeColumnId, RequestColumnExpansionFactory, RequestColumnsOperationsCache, RequestColumnsOperationsCacheFactory, ResolveDerivedValue, ResolveDerivedValues, SignalFieldMap } from '../../internal';
|
|
4
|
+
import { GetField } from '../matcher/QueryNode';
|
|
5
|
+
export interface ItemEntryChangesTuple<ItemTypeType extends ApiItemType> {
|
|
6
|
+
entry: ItemEntry<ItemTypeType>;
|
|
7
|
+
changes: FieldMap<ItemTypeType>;
|
|
8
|
+
}
|
|
9
|
+
export interface ItemHandlerFieldsProxyTarget<ItemTypeType extends ApiItemType> {
|
|
10
|
+
itemEntry: ItemEntry<ItemTypeType>;
|
|
11
|
+
itemHandler: ItemHandlerBase;
|
|
12
|
+
}
|
|
13
|
+
export declare const fieldsSignalProxyHandler: ProxyHandler<ItemHandlerFieldsProxyTarget<any>>;
|
|
14
|
+
export declare abstract class ItemHandlerBase extends ItemMatcherBase {
|
|
15
|
+
protected columnCache: ColumnCache;
|
|
16
|
+
protected errorHandler: ErrorHandlerInterface;
|
|
17
|
+
protected requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
18
|
+
protected requestColumnsOperationsCacheFactory: RequestColumnsOperationsCacheFactory;
|
|
19
|
+
protected itemEntryService: ItemEntryService;
|
|
20
|
+
protected transaction: AbstractCache;
|
|
21
|
+
readonly entries: ItemCache;
|
|
22
|
+
itemChanges: {
|
|
23
|
+
[itemEntryId: number]: FieldMap<any>;
|
|
24
|
+
};
|
|
25
|
+
itemFieldSignals: {
|
|
26
|
+
[itemEntryId: number]: {
|
|
27
|
+
[columnId: string]: WritableSignal<any>;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
protected constructor(columnCache: ColumnCache, errorHandler: ErrorHandlerInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, requestColumnsOperationsCacheFactory: RequestColumnsOperationsCacheFactory, itemEntryService: ItemEntryService, transaction: AbstractCache, itemCacheFactory: ItemCacheFactory);
|
|
31
|
+
getItemFieldSignal<ItemTypeType extends ApiItemType, ColumnId extends ItemTypeColumnId<ItemTypeType>>(itemEntry: ItemEntry<ItemTypeType>, columnId: ColumnId): WritableSignal<GetFieldValueType<ItemTypeType, ColumnId>>;
|
|
32
|
+
getDisplayName<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): string;
|
|
33
|
+
constructGetField<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): GetField<ItemTypeType>;
|
|
34
|
+
/**
|
|
35
|
+
* Construct a proxy object for the fields of the item. Reading a field will traverse the transaction chain.
|
|
36
|
+
*/
|
|
37
|
+
constructFieldsProxy<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
38
|
+
constructSignalFieldsProxy<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): SignalFieldMap<ItemTypeType>;
|
|
39
|
+
lookUpItemField<ItemTypeType extends ApiItemType, ColumnId extends ItemTypeColumnId<ItemTypeType>>(entry: ItemEntry<ItemTypeType>, columnId: ColumnId): GetFieldValueType<ItemTypeType, ColumnId> | undefined;
|
|
40
|
+
collectFields<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
41
|
+
/**
|
|
42
|
+
* @description
|
|
43
|
+
* Copies the passed ItemEntryChanges into a format the implementing ItemHandler can put in his ItemChanges
|
|
44
|
+
* @param itemEntryChanges
|
|
45
|
+
* @param entry
|
|
46
|
+
*/
|
|
47
|
+
copyTransactionItemEntryChanges<ItemTypeType extends ApiItemType>(itemEntryChanges: FieldMap<ItemTypeType>, entry: ItemEntry<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
48
|
+
/**
|
|
49
|
+
* @description
|
|
50
|
+
* Recursively fetches derived values as separate requests, instead of as columns of a primary item
|
|
51
|
+
* Can be used when derived values of a local item have to be fetched, since a local item can't be used as root item of a query
|
|
52
|
+
*
|
|
53
|
+
* @param refreshAggregateColumns - See {@link fetchItemEntryData}.
|
|
54
|
+
*/
|
|
55
|
+
resolveDerivedValues<ItemTypeType extends ApiItemType>(itemEntries: ItemEntry<ItemTypeType>[], rootColumns: ColumnInfo<ItemTypeType>[], refreshAggregateColumns: boolean, changesDelta?: ChangesDeltaBase): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* @description
|
|
58
|
+
* Traverses the column path and returns the fields of the derived item, returns undefined if the item isn't found
|
|
59
|
+
*
|
|
60
|
+
* ---------------------
|
|
61
|
+
*
|
|
62
|
+
* @remark
|
|
63
|
+
* Assumes the derived item's values are already cached
|
|
64
|
+
*/
|
|
65
|
+
getDerivedValues<ItemTypeType extends ApiItemType, T extends readonly string[]>(itemEntry: ItemEntry<ItemTypeType>, columnPath: T): ResolveDerivedValues<ItemTypeType, T> | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* @description
|
|
68
|
+
* Returns the value of the columnPath, or undefined when the path couldn't be traversed
|
|
69
|
+
*
|
|
70
|
+
* @param itemEntry The root entry to start the path from
|
|
71
|
+
* @param columnPath Can either be an array of columnIds (['column', 'column2']) or a config column string ('column>column2')
|
|
72
|
+
*/
|
|
73
|
+
getDerivedValue<ItemTypeType extends ApiItemType, T extends string, DefaultValue = unknown>(itemEntry: ItemEntry<ItemTypeType>, columnPath: T, defaultValue?: DefaultValue): ResolveDerivedValue<ItemTypeType, DerivedStringToRequestColumnPath<T>>;
|
|
74
|
+
getDerivedValue<ItemTypeType extends ApiItemType, T extends readonly string[], DefaultValue = unknown>(itemEntry: ItemEntry<ItemTypeType>, columnPath: T, defaultValue?: DefaultValue): ResolveDerivedValue<ItemTypeType, T>;
|
|
75
|
+
/**
|
|
76
|
+
* @description
|
|
77
|
+
* Clears the entry from this transaction, removing it from the {@link ItemCache ItemCache} and removing all changes
|
|
78
|
+
*
|
|
79
|
+
* @returns The deleted item changes.
|
|
80
|
+
*/
|
|
81
|
+
clearItemEntry<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): FieldMap<ItemTypeType> | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* @param refreshAggregateColumns - Do a server request for aggregate columns even if we already have a cached value.
|
|
84
|
+
* This should be `true` when we actively request an item (e.g. using `getItemById`), but `false` when expanding an
|
|
85
|
+
* item for collection matching purposes.
|
|
86
|
+
* @param forceRequest - Always flush the request buffer when the timeout expires, ignoring request suspension,
|
|
87
|
+
* which could introduce an additional delay.
|
|
88
|
+
*/
|
|
89
|
+
abstract fetchItemEntryData<ItemTypeType extends ApiItemType>(itemType: ItemTypeType, itemIds: Iterable<ItemId>, columnsOperationsCache: RequestColumnsOperationsCache<ItemTypeType>, refreshAggregateColumns: boolean, forceRequest?: boolean): Promise<ItemEntry<ItemTypeType>[]>;
|
|
90
|
+
/**
|
|
91
|
+
* @description
|
|
92
|
+
* Creates a new {@link ItemEntry ItemEntry} from the passed {@link ChangesDeltaItemCreateDelta ChangesDeltaItemCreateDelta} and stores it in this transaction's {@link ItemCache ItemCache}
|
|
93
|
+
*/
|
|
94
|
+
createItemEntry(createTuple: ChangesDeltaItemCreateDelta): ItemEntry;
|
|
95
|
+
private getDerivedEntry;
|
|
96
|
+
private getDerivedColumn;
|
|
97
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ApiItemType } from '@rentman/backend-types';
|
|
2
|
+
import { ItemEntry } from '../../models/ItemEntry';
|
|
3
|
+
import { GetFieldValueType, ItemTypeColumnId } from '../../types/ItemTypesCollection';
|
|
4
|
+
import { GetField, LeafQueryNode, MatchesAccumulatorTuple } from '../matcher/QueryNode';
|
|
5
|
+
import { RootQueryNode } from '../matcher/RootQueryNode';
|
|
6
|
+
import { ParentChangesDelta } from '../ParentChangesDelta';
|
|
7
|
+
export type GetMergedQueryGraph = <ItemTypeType extends ApiItemType>(itemType: ItemTypeType) => RootQueryNode<ItemTypeType> | null;
|
|
8
|
+
export interface MatchingResultsAccumulatorTuple<ItemTypeType extends ApiItemType> extends MatchesAccumulatorTuple<ItemEntry<ItemTypeType>> {
|
|
9
|
+
false?: Set<ItemEntry<ItemTypeType>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* This type is similar to {@link MatchesAccumulator} by design, so we can pass it directly to the match function
|
|
13
|
+
* when matching created items.
|
|
14
|
+
*/
|
|
15
|
+
type MatchingResultsAccumulator<ItemTypeType extends ApiItemType> = Map<string, MatchingResultsAccumulatorTuple<ItemTypeType>>;
|
|
16
|
+
export type MatchingResultsAccumulatorMapType = {
|
|
17
|
+
[ItemType in ApiItemType]?: MatchingResultsAccumulator<ItemType>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A convenience class to group matches accumulators by item type.
|
|
21
|
+
*/
|
|
22
|
+
export declare class MatchesAccumulatorMap<ItemTypeMapType extends {
|
|
23
|
+
[ItemType in ApiItemType]?: any;
|
|
24
|
+
}> {
|
|
25
|
+
private entries;
|
|
26
|
+
get<ItemTypeType extends ApiItemType>(itemType: ItemTypeType): Exclude<ItemTypeMapType[ItemTypeType], undefined>;
|
|
27
|
+
[Symbol.iterator](): Generator<[
|
|
28
|
+
ApiItemType,
|
|
29
|
+
Exclude<ItemTypeMapType[ApiItemType], undefined>
|
|
30
|
+
]>;
|
|
31
|
+
}
|
|
32
|
+
export declare abstract class ItemMatcherBase {
|
|
33
|
+
/**
|
|
34
|
+
* Convenience method to quickly add items entries to a matching results accumulator tuple. Will create a tuple
|
|
35
|
+
* if none exists yet.
|
|
36
|
+
*
|
|
37
|
+
* The matching results accumulator is a map, so we can't define this on the class itself.
|
|
38
|
+
*/
|
|
39
|
+
private static addItemsToMatchingResults;
|
|
40
|
+
abstract constructGetField<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): GetField<ItemTypeType>;
|
|
41
|
+
abstract lookUpItemField<ItemTypeType extends ApiItemType, ColumnId extends ItemTypeColumnId<ItemTypeType>>(entry: ItemEntry<ItemTypeType>, columnId: ColumnId): GetFieldValueType<ItemTypeType, ColumnId> | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* For deleted items, we're determining the collections the item is currently in by matching using the current
|
|
44
|
+
* fields. This means this method should run *before* the fields are removed from the cache.
|
|
45
|
+
*
|
|
46
|
+
* In order to limit back-end requests, we treat 'maybe' matches as a proper match. This means we might try to
|
|
47
|
+
* remove items from collections that don't contain the item.
|
|
48
|
+
*/
|
|
49
|
+
matchItemsInDeletedChangesDelta(changesDelta: ParentChangesDelta, getMergedQueryGraph: GetMergedQueryGraph, matchingResultsAccumulatorMap: MatchesAccumulatorMap<MatchingResultsAccumulatorMapType>): void;
|
|
50
|
+
/**
|
|
51
|
+
* Convenience method to match multiple item entries to a single query graph. If you want to match item entries to
|
|
52
|
+
* multiple query graphs, it would be better to merge them first.
|
|
53
|
+
*/
|
|
54
|
+
matchItemsToQueryGraph<ItemTypeType extends ApiItemType>(queryGraph: RootQueryNode<ItemTypeType>, leafNode: LeafQueryNode, itemEntries: ItemEntry<ItemTypeType>[], matchesAccumulatorTuple?: MatchesAccumulatorTuple<ItemEntry<ItemTypeType>>): MatchesAccumulatorTuple<ItemEntry<ItemTypeType>>;
|
|
55
|
+
/**
|
|
56
|
+
* Empty updates (where `previous` is `null`) are used:
|
|
57
|
+
* - When adding items to newly created cached queries on the server cache;
|
|
58
|
+
* - When restoring previously deleted items.
|
|
59
|
+
*
|
|
60
|
+
* Note that this method:
|
|
61
|
+
* - Only adds items (because we technically don't have any changes).
|
|
62
|
+
* - Discards 'maybe' matches. (Again, because we technically don't have any changes. When populating a non-locally
|
|
63
|
+
* matchable query, the query results should be added to the query graph.)
|
|
64
|
+
* - Does not check whether the items are deleted (we don't store deleted items on the server cache and restored
|
|
65
|
+
* items are by definition no longer deleted).
|
|
66
|
+
*/
|
|
67
|
+
matchEmptyItemsInUpdatedChangesDelta(updatedChangesDelta: ParentChangesDelta['updated'], getMergedQueryGraph: GetMergedQueryGraph, matchingResultsAccumulatorMap: MatchesAccumulatorMap<MatchingResultsAccumulatorMapType>): void;
|
|
68
|
+
/**
|
|
69
|
+
* For updated items, we match using the current fields first, then using the updated fields.
|
|
70
|
+
* - When the item matches using the updated fields it will always be added. This is because on the server cache,
|
|
71
|
+
* we always want to add the item to possible newly created cached queries, even if there are changes. This means
|
|
72
|
+
* that we might add items to collections that already contain the item.
|
|
73
|
+
* - When the item matches using the current fields, but does not when using the updated ones, it should be removed.
|
|
74
|
+
* - In order to limit back-end requests, we consider 'maybe' only for the updated fields. For the current fields,
|
|
75
|
+
* we treat 'maybe' as a proper match. This means we might try to remove items from collections that don't contain
|
|
76
|
+
* the item.
|
|
77
|
+
*
|
|
78
|
+
* This method should be optimized for simple operations on large amounts of items, e.g. moving many Missings from
|
|
79
|
+
* an 'origin' to a 'destination' status. In this case:
|
|
80
|
+
* - A queries matched for the current and updated fields don't overlap;
|
|
81
|
+
* - No `maybe` matches should be involved.
|
|
82
|
+
*/
|
|
83
|
+
matchItemsInUpdatedChangesDelta(updatedChangesDelta: ParentChangesDelta['updated'], getMergedQueryGraph: GetMergedQueryGraph, matchingResultsAccumulatorMap: MatchesAccumulatorMap<MatchingResultsAccumulatorMapType>): void;
|
|
84
|
+
/**
|
|
85
|
+
* For created items, we can write directly to the matching results accumulator.
|
|
86
|
+
*/
|
|
87
|
+
matchItemsInCreatedChangesDelta(createdChangesDelta: ParentChangesDelta['created'], getMergedQueryGraph: GetMergedQueryGraph, matchingResultsAccumulatorMap: MatchesAccumulatorMap<MatchingResultsAccumulatorMapType>): void;
|
|
88
|
+
abstract itemIsDeleted<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): boolean;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ApiFieldsOnDeleteRule, ApiItemType } from '@rentman/backend-types';
|
|
2
|
+
import { AbstractCache, ApiRequestColumnMap, ApiRequestColumns, ApiResponseProcessor, CachedQueryItem, ChangesDelta, ChangesDeltaBase, ChangesDeltaItemUpdateMode, ChangesDeltaResult, CollectionQuery, CollectionResource, ConversionMap, DeregFunction, EntryParent, FieldMap, ItemEntry, ItemIdConversionMap, OnAfterCreateCallback, ParentChangesDelta, RequestBufferManager, RequestColumnExpansion, ResponseColumnItemTypeMap, ResponseItemUpdateModeMap, RmCore, ServerCacheDependencyInterface, ServerCachedQueryHandler, ServerItemHandler, TransactionCache, TransactionOptions, TransactionValidatorFactory } from '../../../internal';
|
|
3
|
+
type OnDeltaAppliedCallback = (delta: ChangesDeltaBase) => unknown;
|
|
4
|
+
export type ActiveItemEntries = Set<ItemEntry>;
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* The {@link ServerCache ServerCache} is responsible for keeping track of {@link ItemEntry ItemEntries} and {@link CollectionEntry CollectionEntries}
|
|
8
|
+
* which are saved on the server.
|
|
9
|
+
*
|
|
10
|
+
* It's basically a local representation of the database
|
|
11
|
+
*/
|
|
12
|
+
export declare class ServerCache extends AbstractCache {
|
|
13
|
+
dependencies: ServerCacheDependencyInterface;
|
|
14
|
+
private apiFieldsOnDeleteRule;
|
|
15
|
+
readonly requestBufferManager: RequestBufferManager;
|
|
16
|
+
readonly itemHandler: ServerItemHandler;
|
|
17
|
+
readonly cachedQueryHandler: ServerCachedQueryHandler;
|
|
18
|
+
onDeltaAppliedCallbacks: OnDeltaAppliedCallback[];
|
|
19
|
+
parent: null;
|
|
20
|
+
constructor(dependencies: ServerCacheDependencyInterface, apiFieldsOnDeleteRule: typeof ApiFieldsOnDeleteRule, core: RmCore);
|
|
21
|
+
onDeltaApplied(callback: OnDeltaAppliedCallback): DeregFunction;
|
|
22
|
+
getServerCache(): ServerCache;
|
|
23
|
+
createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
|
|
24
|
+
getActiveItemEntries(): ActiveItemEntries;
|
|
25
|
+
processResponseByItemType<ItemTypeType extends ApiItemType>(itemType: ItemTypeType, requestColumns: ApiRequestColumns<ItemTypeType> | null, responseColumns: ResponseColumnItemTypeMap, responseItems: Iterable<FieldMap<ItemTypeType>>, changesDelta: ChangesDelta, itemUpdateModeMap?: {
|
|
26
|
+
[itemId: string]: ChangesDeltaItemUpdateMode;
|
|
27
|
+
}, conversionMap?: ConversionMap): ChangesDelta;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param response
|
|
31
|
+
* @param requestColumnMap
|
|
32
|
+
* @param isCalledAfterSocketUpdate
|
|
33
|
+
* @param changesDelta
|
|
34
|
+
* @param conversionMap
|
|
35
|
+
* @param itemUpdateModeMap Allows you to overwrite the update mode for specific items, this is useful when you want to process the direct items of an update/create request
|
|
36
|
+
*/
|
|
37
|
+
processResponse(response: ApiResponseProcessor, requestColumnMap: ApiRequestColumnMap, changesDelta?: ChangesDelta, itemUpdateModeMap?: ResponseItemUpdateModeMap, conversionMap?: ItemIdConversionMap): ChangesDelta;
|
|
38
|
+
/**
|
|
39
|
+
* @description
|
|
40
|
+
* Applies changes to this transaction and its children
|
|
41
|
+
* ServerCache.applyChangesFromParent should be used when processing an API update/create/delete
|
|
42
|
+
*
|
|
43
|
+
* `applyChangesFromParent` assumes that all derived values are already fetched and won't attempt to resolve them
|
|
44
|
+
* (which `applyChangesDelta` does)
|
|
45
|
+
*/
|
|
46
|
+
applyChangesFromParent(changesDelta: ParentChangesDelta, isCalledAfterSocketUpdate?: boolean): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @description
|
|
49
|
+
* Gets the fields required to set the parent
|
|
50
|
+
*/
|
|
51
|
+
getLinkFieldsByParent<const ItemTypeType extends ApiItemType>(parent: EntryParent, itemType: ItemTypeType): Partial<FieldMap<ItemTypeType>>;
|
|
52
|
+
getCollectionChangesRecursively<const ItemTypeType extends ApiItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery<ItemTypeType>): CachedQueryItem<ItemTypeType> | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* @description
|
|
55
|
+
* Merges the passed changes from the child Transaction into this Transaction's own changes and then propagates
|
|
56
|
+
* them to all child Transactions
|
|
57
|
+
*/
|
|
58
|
+
applyChangesFromChild(transaction: TransactionCache, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): Promise<ItemIdConversionMap>;
|
|
59
|
+
/**
|
|
60
|
+
* @description
|
|
61
|
+
* Applies changes to this transaction and its children
|
|
62
|
+
* ServerCache.applyChangesDelta should be used when processing an API response which should create new entries on the ServerCache (such as a Query)
|
|
63
|
+
*
|
|
64
|
+
* `applyChangesDelta` also ensures any required derived values are properly fetched
|
|
65
|
+
* (which `applyChangesFromParent` doesn't)
|
|
66
|
+
*/
|
|
67
|
+
applyChangesDelta(changesDelta: ChangesDelta, isCalledAfterSocketUpdate?: boolean, conversionMap?: ItemIdConversionMap): Promise<ChangesDeltaResult>;
|
|
68
|
+
getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry;
|
|
69
|
+
getLocalItemEntryByItemId<const ItemTypeType extends ApiItemType>(itemType: ItemTypeType, itemId: ItemEntry<ItemTypeType>['itemId']): ItemEntry<ItemTypeType>;
|
|
70
|
+
containsLocalItemEntryByItemId(itemType: ApiItemType, itemId: ItemEntry['itemId']): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Merged the request columns with columns required for delete relations and the query matcher.
|
|
73
|
+
* This method is in the server cache because the queries contain the superset of all columns here.
|
|
74
|
+
*
|
|
75
|
+
* Please note that this function is usually called in the request columns operation cache.
|
|
76
|
+
*/
|
|
77
|
+
expandColumnsWithRequiredColumns<ItemTypeType extends ApiItemType>(itemType: ItemTypeType, requestColumns: ApiRequestColumns<ItemTypeType>): ApiRequestColumns<ItemTypeType>;
|
|
78
|
+
expandColumnExpansionWithRequiredColumns<ItemTypeType extends ApiItemType>(itemType: ItemTypeType, requestColumnExpansion: RequestColumnExpansion, cachedQueryItems: Iterable<CachedQueryItem<ItemTypeType>>, uncachedCollectionResources: Iterable<CollectionResource<ItemTypeType>>): ApiRequestColumns<ItemTypeType>;
|
|
79
|
+
private getColumnIdsWithRelations;
|
|
80
|
+
private callOnDeltaAppliedCallbacks;
|
|
81
|
+
private collectActiveItemEntriesBasedOnParentEntry;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ApiItemType } from '@rentman/backend-types';
|
|
2
|
+
import { GraphQueryParserFactory } from '../../../factories/GraphQueryParserFactory';
|
|
3
|
+
import { ApiRequestService, CachedQueryHandlerBase, CachedQueryItem, CachedQueryOptions, CollectionQuery, CollectionResource, ErrorHandlerInterface, LinkCollectionBatchQueryTuple, LinkTreeServiceInterface, QueryService, RequestColumnExpansionFactory, RequestColumnsOperationsCache, RequestColumnsOperationsCacheFactory, ServerCache } from '../../../internal';
|
|
4
|
+
export declare class ServerCachedQueryHandler extends CachedQueryHandlerBase {
|
|
5
|
+
protected transaction: ServerCache;
|
|
6
|
+
constructor(dependencies: {
|
|
7
|
+
apiRequestService: ApiRequestService;
|
|
8
|
+
errorHandler: ErrorHandlerInterface;
|
|
9
|
+
graphQueryParserFactory: GraphQueryParserFactory;
|
|
10
|
+
linkTreeService: LinkTreeServiceInterface;
|
|
11
|
+
queryService: QueryService;
|
|
12
|
+
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
13
|
+
requestColumnsOperationsCacheFactory: RequestColumnsOperationsCacheFactory;
|
|
14
|
+
}, transaction: ServerCache);
|
|
15
|
+
hasActiveCollectionsForQuery(itemType: ApiItemType, queryString: string): boolean;
|
|
16
|
+
markCachedQueriesOutdatedInAllTransactions(itemType: ApiItemType, queryString: string): void;
|
|
17
|
+
getUncachedCollectionsOnChildTransactionsIterator<ItemTypeType extends ApiItemType>(itemType: ItemTypeType): Generator<CollectionResource<ItemTypeType>>;
|
|
18
|
+
/**
|
|
19
|
+
* @description
|
|
20
|
+
* Expands the columns of the items in the cached query
|
|
21
|
+
*/
|
|
22
|
+
__maybeExpandCachedQuery<const ItemTypeType extends ApiItemType>(itemType: ItemTypeType, queryString: string, columnsOperationsCache: RequestColumnsOperationsCache<ItemTypeType>, batchedLinkedToQuery?: CollectionQuery<ItemTypeType>): Promise<CachedQueryItem<ItemTypeType>>;
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Fetches the data for the passed ItemType/options, will do nothing if the requested CollectionEntry/columns are already cached.
|
|
26
|
+
* Will create a new {@link CollectionEntry CollectionEntry} if the CollectionEntry didn't exist yet
|
|
27
|
+
*/
|
|
28
|
+
__fetchItemEntriesByQueryData<const ItemTypeType extends ApiItemType>(itemType: ItemTypeType, options: CachedQueryOptions<ItemTypeType>, columnsOperationsCache: RequestColumnsOperationsCache<ItemTypeType>, collectionQuery: CollectionQuery<ItemTypeType>, linkCollectionBatchQueryTuple?: LinkCollectionBatchQueryTuple<ItemTypeType>): Promise<CachedQueryItem<ItemTypeType>>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ApiItemType, ItemId } from '@rentman/backend-types';
|
|
2
|
+
import { ChangesDeltaBaseItemUpdateDelta, ChangesDeltaItemCreateDelta, ColumnCache, ErrorHandlerInterface, FieldMap, ItemCacheFactory, ItemEntry, ItemEntryService, ItemHandlerBase, ParentChangesDelta, RequestColumnExpansionFactory, RequestColumnsOperationsCache, RequestColumnsOperationsCacheFactory, ServerCache } from '../../../internal';
|
|
3
|
+
export declare class ServerItemHandler extends ItemHandlerBase {
|
|
4
|
+
protected transaction: ServerCache;
|
|
5
|
+
private itemFieldLastModified;
|
|
6
|
+
constructor(errorHandler: ErrorHandlerInterface, columnCache: ColumnCache, itemCacheFactory: ItemCacheFactory, itemEntryService: ItemEntryService, requestColumnExpansionFactory: RequestColumnExpansionFactory, requestColumnsOperationsCacheFactory: RequestColumnsOperationsCacheFactory, transaction: ServerCache);
|
|
7
|
+
createItemEntry(createTuple: ChangesDeltaItemCreateDelta): ItemEntry;
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Fetches the data for the passed ItemType/ItemId/columns, will do nothing if the requested ItemEntry/columns are already cached.
|
|
11
|
+
* Will create a new {@link ItemEntry ItemEntry} if the ItemEntry didn't exist yet
|
|
12
|
+
*/
|
|
13
|
+
fetchItemEntryData<ItemTypeType extends ApiItemType>(itemType: ItemTypeType, itemIds: Iterable<ItemId>, columnsOperationsCache: RequestColumnsOperationsCache<ItemTypeType>, refreshAggregateColumns: boolean, forceRequest?: boolean): Promise<ItemEntry<ItemTypeType>[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Processes the changes on the transaction, and stores the changes as well as the previous values in
|
|
16
|
+
* `parentChangesDelta`.
|
|
17
|
+
*
|
|
18
|
+
* Note: Even though both the server item handler and the transaction item handler have a
|
|
19
|
+
* {@link processUpdatesFromDelta} method, it is not defined on the superclass as the transaction item handler
|
|
20
|
+
* introduces the `createItemChangesIfNoneExist` parameter.
|
|
21
|
+
*/
|
|
22
|
+
processUpdatesFromDelta(updated: {
|
|
23
|
+
[itemEntryId: number]: ChangesDeltaBaseItemUpdateDelta<any>;
|
|
24
|
+
}, parentChangesDelta: ParentChangesDelta): void;
|
|
25
|
+
itemIsDeleted(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* Processes the passed {@link ChangesDeltaBaseItemUpdateDelta update delta} on the server cache. New
|
|
29
|
+
* {@link TransactionItemHandler.itemChanges item changes} will be created if none exist.
|
|
30
|
+
*
|
|
31
|
+
* @returns An object containing a previous value for each applied change. Because of the nature of item changes
|
|
32
|
+
* it may also include changes applied on ancestor transactions. Is `null` when no changes have been made.
|
|
33
|
+
*/
|
|
34
|
+
protected processItemEntryChanges<ItemTypeType extends ApiItemType>(itemEntryChangesTuple: ChangesDeltaBaseItemUpdateDelta<ItemTypeType>): Readonly<Partial<FieldMap<ItemTypeType>>> | null;
|
|
35
|
+
}
|