@aristid/leav-types 1.14.0-968a7666 → 1.14.0-d78e1c6f
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.
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { type IValueDomain } from '../value/valueDomain';
|
|
2
|
+
import { type IRecordDomain } from '../record/recordDomain';
|
|
3
|
+
import { type ITreeDomain } from '../tree/treeDomain';
|
|
2
4
|
import { type IQueryInfos } from '../../_types/queryInfos';
|
|
3
5
|
import { type IRecord } from '../../_types/record';
|
|
4
6
|
import { type IValue } from '../../_types/value';
|
|
5
7
|
import { type ITreeNode } from '../../_types/tree';
|
|
8
|
+
import { type IConfig } from '../../_types/config';
|
|
6
9
|
import { type JexlContext, type JexlRecordContext, type JexlRootContext, type JexlTreeNodeContext, type JexlValueContext } from './types';
|
|
7
10
|
interface IDeps {
|
|
8
11
|
'core.domain.value': IValueDomain;
|
|
12
|
+
'core.domain.record': IRecordDomain;
|
|
13
|
+
'core.domain.tree': ITreeDomain;
|
|
14
|
+
config: IConfig;
|
|
9
15
|
}
|
|
10
16
|
export interface IJexlDomain {
|
|
11
17
|
eval<Return = unknown, Ctx extends JexlContext = JexlContext>(expression: string, context?: Ctx): Promise<Return>;
|
|
@@ -15,5 +21,5 @@ export interface IJexlDomain {
|
|
|
15
21
|
buildTreeNodeContext: (treeNode: ITreeNode, ctx: IQueryInfos) => JexlTreeNodeContext;
|
|
16
22
|
buildValuesContext: (values: IValue[], ctx: IQueryInfos) => JexlValueContext[];
|
|
17
23
|
}
|
|
18
|
-
export default function ({ 'core.domain.value': valueDomain }: IDeps): IJexlDomain;
|
|
24
|
+
export default function ({ 'core.domain.value': valueDomain, 'core.domain.record': recordDomain, 'core.domain.tree': treeDomain, config, }: IDeps): IJexlDomain;
|
|
19
25
|
export {};
|
|
@@ -35,3 +35,9 @@ export type JexlUserContext = JexlContext<JexlContextType.USER> & {
|
|
|
35
35
|
lang?: string;
|
|
36
36
|
};
|
|
37
37
|
export type JexlValueContext = IStandardValue['payload'] | JexlRecordContext | JexlTreeNodeContext;
|
|
38
|
+
export type JexlContextByType = {
|
|
39
|
+
[JexlContextType.ROOT]: JexlRootContext;
|
|
40
|
+
[JexlContextType.RECORD]: JexlRecordContext;
|
|
41
|
+
[JexlContextType.TREE_NODE]: JexlTreeNodeContext;
|
|
42
|
+
[JexlContextType.USER]: JexlUserContext;
|
|
43
|
+
};
|
|
@@ -29,4 +29,7 @@ export interface IAutomationRuleRepoDeps {
|
|
|
29
29
|
'core.infra.db.dbService': IDbService;
|
|
30
30
|
'core.infra.db.dbUtils': IDbUtils;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export interface IAutomationRuleRepoParams {
|
|
33
|
+
collectionName?: string;
|
|
34
|
+
}
|
|
35
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils }: IAutomationRuleRepoDeps, repoParams?: IAutomationRuleRepoParams): IAutomationRuleRepo;
|