@rentman/rm-core 10.0.1 → 10.0.3
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 +9 -0
- package/dist/rm-core.js +111 -126
- package/dist/rm-core.min.js +1 -1
- package/dist/types/classes/ApiFormatter.d.ts +6 -2
- package/dist/types/classes/BusinessLogicManager/BusinessLogicManager.d.ts +2 -1
- package/dist/types/interfaces/PromiseLibraryInterface.d.ts +8 -0
- package/package.json +1 -1
|
@@ -31,9 +31,13 @@ export declare class ApiFormatter {
|
|
|
31
31
|
isExpensiveFormat(columnType: ApiEnumApiType): boolean;
|
|
32
32
|
/**
|
|
33
33
|
* @description
|
|
34
|
-
* Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same
|
|
34
|
+
* Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same and the parent transaction
|
|
35
|
+
* copied over the field (leaving user changes intact)
|
|
36
|
+
*
|
|
37
|
+
* We have to check the parent transaction because on a child transaction initial/modified can be equal (the copied field of the parent)
|
|
38
|
+
* and will then incorrectly be overwritten by applyChangesFromParent
|
|
35
39
|
*/
|
|
36
|
-
mergeCopyFields<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(
|
|
40
|
+
mergeCopyFields<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(parentChanges: FieldMap<ItemTypeType, ColumnIds>, changes: FieldMap<ItemTypeType, ColumnIds>, initial: FieldMap<ItemTypeType, ColumnIds>, newInitial: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType, ColumnIds>;
|
|
37
41
|
formatRequest<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
|
|
38
42
|
[columnId: string]: any;
|
|
39
43
|
};
|
|
@@ -2,6 +2,7 @@ import { ApiModuleFunctionLocalsGetLocals } from '@rentman/backend-types';
|
|
|
2
2
|
import { ChangesDeltaFactory } from '../../factories/ChangesDeltaFactory';
|
|
3
3
|
import { ErrorHandlerInterface } from '../../interfaces/ErrorHandlerInterface';
|
|
4
4
|
import { PromiseLibraryInterface } from '../../interfaces/PromiseLibraryInterface';
|
|
5
|
+
import { PromiseInterface } from '../../types/PromiseInterface';
|
|
5
6
|
import { ApiFormatter } from '../ApiFormatter';
|
|
6
7
|
import { TransactionCache } from '../cache/transaction/TransactionCache';
|
|
7
8
|
import { ChangesDelta } from '../ChangesDelta';
|
|
@@ -88,7 +89,7 @@ export declare class BusinessLogicManager {
|
|
|
88
89
|
*
|
|
89
90
|
* @private should only be called by the core
|
|
90
91
|
*/
|
|
91
|
-
handleBusinessLogic(transaction: TransactionCache, changesDelta: ChangesDelta):
|
|
92
|
+
handleBusinessLogic(transaction: TransactionCache, changesDelta: ChangesDelta): PromiseInterface<ChangesDelta>;
|
|
92
93
|
private waitForRuleApplication;
|
|
93
94
|
private waitForRuleDependencies;
|
|
94
95
|
private waitForRuleDependency;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { PromiseInterface } from '../internal';
|
|
2
|
+
export declare type AllSettledResult<T> = {
|
|
3
|
+
status: 'fulfilled';
|
|
4
|
+
value: T;
|
|
5
|
+
} | {
|
|
6
|
+
status: 'rejected';
|
|
7
|
+
reason: string;
|
|
8
|
+
};
|
|
2
9
|
export interface Deferred<T> {
|
|
3
10
|
promise: PromiseInterface<T>;
|
|
4
11
|
resolve(value?: T | PromiseInterface<T>): void;
|
|
@@ -22,4 +29,5 @@ export interface PromiseLibraryInterface {
|
|
|
22
29
|
when<T>(value?: PromiseInterface<T> | T): PromiseInterface<T>;
|
|
23
30
|
reject(value?: any): PromiseInterface<any>;
|
|
24
31
|
defer<T>(): Deferred<T>;
|
|
32
|
+
allSettled<T>(iterable: (PromiseInterface<any> | any)[]): PromiseInterface<AllSettledResult<T>[]>;
|
|
25
33
|
}
|