@rentman/rm-core 66.3.0 → 66.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rm-core.js +1 -1
- package/dist/rm-core.js.map +1 -1
- package/dist/types/src/classes/cache/AbstractCache.d.ts +2 -1
- package/dist/types/src/classes/cache/server/ServerCache.d.ts +1 -1
- package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +7 -3
- package/dist/types/src/classes/cache/transaction/TransactionItemHandler.d.ts +1 -1
- package/dist/types/src/core.d.ts +2 -1
- package/dist/types/src/factories/TransactionCacheFactory.d.ts +1 -1
- package/dist/types/src/interfaces/AbstractCacheDependencyInterface.d.ts +2 -0
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ export type TransactionOptions = {
|
|
|
7
7
|
* Sets the TransactionCache to 'transparent' mode, whenever {@link AbstractCache.createChild createChild} is called it will actually be called on the parent
|
|
8
8
|
*/
|
|
9
9
|
transparent: boolean;
|
|
10
|
+
autoSave: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare abstract class AbstractCache {
|
|
12
13
|
dependencies: AbstractCacheDependencyInterface;
|
|
@@ -18,7 +19,7 @@ export declare abstract class AbstractCache {
|
|
|
18
19
|
protected constructor(dependencies: AbstractCacheDependencyInterface, core: RmCore);
|
|
19
20
|
getChildren(): TransactionCache[];
|
|
20
21
|
getDescendantsIterator(): IterableIterator<TransactionCache>;
|
|
21
|
-
abstract createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
|
|
22
|
+
abstract createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>): TransactionCache;
|
|
22
23
|
onChildDestroy(transactionCache: TransactionCache): void;
|
|
23
24
|
/**
|
|
24
25
|
* @description
|
|
@@ -20,7 +20,7 @@ export declare class ServerCache extends AbstractCache {
|
|
|
20
20
|
constructor(dependencies: ServerCacheDependencyInterface, apiFieldsOnDeleteRule: typeof ApiFieldsOnDeleteRule, core: RmCore);
|
|
21
21
|
onDeltaApplied(callback: OnDeltaAppliedCallback): DeregFunction;
|
|
22
22
|
getServerCache(): ServerCache;
|
|
23
|
-
createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
|
|
23
|
+
createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>): TransactionCache;
|
|
24
24
|
getActiveItemEntries(): ActiveItemEntries;
|
|
25
25
|
processResponseByItemType<ItemTypeType extends ApiItemType>(itemType: ItemTypeType, requestColumns: ApiRequestColumns<ItemTypeType> | null, responseColumns: ResponseColumnItemTypeMap, responseItems: Iterable<FieldMap<ItemTypeType>>, changesDelta: ChangesDelta, itemUpdateModeMap?: {
|
|
26
26
|
[itemId: string]: ChangesDeltaItemUpdateMode;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WritableSignal } from '@angular/core';
|
|
2
2
|
import { ApiItemType, ItemId } from '@rentman/backend-types';
|
|
3
|
+
import moment from 'moment';
|
|
3
4
|
import { AbstractCache, AbstractCacheDependencyInterface, ApiQuery, ApiRequestColumnArray, ApiRequestColumns, CachedQueryItem, ChangesDelta, ChangesDeltaResult, ChildChangesDelta, ChildCollectionResources, CollectionQuery, CollectionResource, ConversionMap, CreateRequestParameterMap, DeregFunction, FieldMap, ItemAggregatedChangesListener, ItemChangesListener, ItemEntry, ItemIdConversionMap, ItemOptions, ItemResource, ItemResourcesItemTypeMap, ItemsByQueryOptions, ItemTypeMap, LimitedCollectionResource, ModuleChangesCompilationResult, NewItemOptions, OnAfterCreateCallback, ParentChangesDelta, ParentIdMap, RmCore, RootCollectionOptions, ServerCache, TimeoutPromiseHandler, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCachedQueryHandler, TransactionEventHandler, TransactionItemHandler, TransactionOptions, TransactionValidator, TransactionValidatorFactory } from '../../../internal';
|
|
4
5
|
import { TransactionValidatorWithDependencies } from './TransactionValidatorWithDependencies';
|
|
5
6
|
type ItemResourceLinks<ItemTypeType extends ApiItemType, ColumnIds extends ApiRequestColumnArray<ItemTypeType>, Children extends ChildCollectionResources | undefined> = {
|
|
@@ -101,10 +102,13 @@ export declare class TransactionCache extends AbstractCache {
|
|
|
101
102
|
readonly eventHandler: TransactionEventHandler;
|
|
102
103
|
readonly validator?: TransactionValidator;
|
|
103
104
|
validatorWithDependencies?: TransactionValidatorWithDependencies<any>;
|
|
104
|
-
|
|
105
|
+
readonly options: TransactionOptions;
|
|
106
|
+
lastSaveSignal: WritableSignal<moment.Moment | null>;
|
|
107
|
+
private autoSaveEffect?;
|
|
108
|
+
private autoSaveInFlightSignal;
|
|
105
109
|
private actionsQueue;
|
|
106
110
|
private pendingActionLabels;
|
|
107
|
-
|
|
111
|
+
readonly transactionStateSignal: WritableSignal<TransactionState>;
|
|
108
112
|
isPendingSignal: any;
|
|
109
113
|
isDestroyedSignal: WritableSignal<boolean>;
|
|
110
114
|
isValidSignal: import("@angular/core").Signal<boolean>;
|
|
@@ -167,7 +171,7 @@ export declare class TransactionCache extends AbstractCache {
|
|
|
167
171
|
* transaction while it is pending, use the `applyChangesDelta` parameter passed to the promise function.
|
|
168
172
|
*/
|
|
169
173
|
setPending<Result>(promise: Promise<Result> | ((applyChangesDelta: (changesDelta: ChangesDelta) => Promise<ChangesDeltaResult>) => Promise<Result>), isDoneByAi: boolean): Promise<Result>;
|
|
170
|
-
createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
|
|
174
|
+
createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>): TransactionCache;
|
|
171
175
|
createBusinessLogicChild(): TransactionCache;
|
|
172
176
|
destroy(): void;
|
|
173
177
|
/**
|
|
@@ -45,7 +45,7 @@ export declare class TransactionItemHandler extends ItemHandlerBase {
|
|
|
45
45
|
* The fields will come from the parent transaction, if avaiable.
|
|
46
46
|
*/
|
|
47
47
|
constructInitialProxy<ItemTypeType extends ApiItemType>(itemEntry: ItemEntry<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
48
|
-
getItemEntriesWithChangesIterator(): Generator<ItemEntry<any>>;
|
|
48
|
+
getItemEntriesWithChangesIterator(itemType?: ApiItemType): Generator<ItemEntry<any>>;
|
|
49
49
|
/**
|
|
50
50
|
* Processes the changes on the transaction, and stores the changes as well as the previous values in
|
|
51
51
|
* `parentChangesDelta`. Also handles changes listeners and validators.
|
package/dist/types/src/core.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
1
2
|
import { ApiFieldsOnDeleteRule, ItemId } from '@rentman/backend-types';
|
|
2
3
|
import { ApiRequestService } from './classes/ApiRequestService';
|
|
3
4
|
import { BusinessLogicManager } from './classes/BusinessLogicManager/BusinessLogicManager';
|
|
@@ -56,6 +57,6 @@ export declare class RmCore {
|
|
|
56
57
|
* We specify an `apiFieldsOnDeleteRule` parameter in order to easily mock it in unit tests. This prevents
|
|
57
58
|
* issues where a mocked API response does not contain required fields that are added at a later point in time.
|
|
58
59
|
*/
|
|
59
|
-
apiFieldsOnDeleteRule
|
|
60
|
+
apiFieldsOnDeleteRule: typeof ApiFieldsOnDeleteRule | undefined, rootInjector: Injector);
|
|
60
61
|
}
|
|
61
62
|
export declare function identity<T extends any>(value: T): T;
|
|
@@ -7,6 +7,6 @@ export declare class TransactionCacheFactory {
|
|
|
7
7
|
* Todo[cache] Store a map of all transactions by transaction id ?
|
|
8
8
|
*/
|
|
9
9
|
getById(id: string): TransactionCache | undefined;
|
|
10
|
-
construct(id?: string, validatorFactory?: TransactionValidatorFactory, transactionOptions?: TransactionOptions): TransactionCache;
|
|
10
|
+
construct(id?: string, validatorFactory?: TransactionValidatorFactory, transactionOptions?: Partial<TransactionOptions>): TransactionCache;
|
|
11
11
|
getServerCache(): ServerCache;
|
|
12
12
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
1
2
|
import { ApiRequestService } from '../classes/ApiRequestService';
|
|
2
3
|
import { BusinessLogicManager } from '../classes/BusinessLogicManager/BusinessLogicManager';
|
|
3
4
|
import { ColumnCache } from '../classes/ColumnCache';
|
|
@@ -43,4 +44,5 @@ export interface AbstractCacheDependencyInterface {
|
|
|
43
44
|
requestColumnExpansionFactory: RequestColumnExpansionFactory;
|
|
44
45
|
requestColumnsOperationsCacheFactory: RequestColumnsOperationsCacheFactory;
|
|
45
46
|
templateCache: TemplateCache;
|
|
47
|
+
rootInjector: Injector;
|
|
46
48
|
}
|