oak-domain 2.3.2 → 2.4.1
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/lib/actions/action.d.ts +16 -16
- package/lib/actions/action.js +17 -17
- package/lib/actions/relation.d.ts +5 -1
- package/lib/actions/relation.js +38 -2
- package/lib/base-app-domain/ActionDefDict.d.ts +5 -5
- package/lib/base-app-domain/ActionDefDict.js +7 -7
- package/lib/base-app-domain/EntityDict.d.ts +12 -12
- package/lib/base-app-domain/EntityDict.js +2 -2
- package/lib/base-app-domain/Modi/Action.d.ts +10 -10
- package/lib/base-app-domain/Modi/Action.js +14 -14
- package/lib/base-app-domain/Modi/Schema.d.ts +146 -148
- package/lib/base-app-domain/Modi/Schema.js +2 -2
- package/lib/base-app-domain/Modi/Storage.d.ts +3 -3
- package/lib/base-app-domain/Modi/Storage.js +60 -60
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +162 -164
- package/lib/base-app-domain/ModiEntity/Schema.js +2 -2
- package/lib/base-app-domain/ModiEntity/Storage.d.ts +3 -3
- package/lib/base-app-domain/ModiEntity/Storage.js +26 -26
- package/lib/base-app-domain/Oper/Schema.d.ts +144 -146
- package/lib/base-app-domain/Oper/Schema.js +2 -2
- package/lib/base-app-domain/Oper/Storage.d.ts +3 -3
- package/lib/base-app-domain/Oper/Storage.js +29 -29
- package/lib/base-app-domain/OperEntity/Schema.d.ts +178 -180
- package/lib/base-app-domain/OperEntity/Schema.js +2 -2
- package/lib/base-app-domain/OperEntity/Storage.d.ts +3 -3
- package/lib/base-app-domain/OperEntity/Storage.js +26 -26
- package/lib/base-app-domain/Storage.d.ts +3 -3
- package/lib/base-app-domain/Storage.js +15 -15
- package/lib/base-app-domain/User/Schema.d.ts +128 -130
- package/lib/base-app-domain/User/Schema.js +2 -2
- package/lib/base-app-domain/User/Storage.d.ts +3 -3
- package/lib/base-app-domain/User/Storage.js +25 -25
- package/lib/base-app-domain/_SubQuery.d.ts +36 -36
- package/lib/base-app-domain/_SubQuery.js +2 -2
- package/lib/base-app-domain/index.d.ts +3 -3
- package/lib/base-app-domain/index.js +6 -6
- package/lib/checkers/index.d.ts +5 -5
- package/lib/checkers/index.js +15 -13
- package/lib/compiler/env.d.ts +11 -11
- package/lib/compiler/env.js +39 -39
- package/lib/compiler/schemalBuilder.d.ts +2 -2
- package/lib/compiler/schemalBuilder.js +3301 -3245
- package/lib/compiler/uiBuilder.d.ts +1 -1
- package/lib/compiler/uiBuilder.js +3 -3
- package/lib/entities/Modi.d.ts +11 -11
- package/lib/entities/Modi.js +46 -46
- package/lib/entities/ModiEntity.d.ts +8 -8
- package/lib/entities/ModiEntity.js +15 -15
- package/lib/entities/Oper.d.ts +10 -10
- package/lib/entities/Oper.js +17 -17
- package/lib/entities/OperEntity.d.ts +8 -8
- package/lib/entities/OperEntity.js +15 -15
- package/lib/entities/User.d.ts +7 -7
- package/lib/entities/User.js +12 -12
- package/lib/store/AsyncRowStore.d.ts +48 -48
- package/lib/store/AsyncRowStore.js +183 -183
- package/lib/store/CascadeStore.d.ts +91 -91
- package/lib/store/CascadeStore.js +1594 -1594
- package/lib/store/SyncRowStore.d.ts +29 -29
- package/lib/store/SyncRowStore.js +48 -48
- package/lib/store/TriggerExecutor.d.ts +32 -32
- package/lib/store/TriggerExecutor.js +527 -508
- package/lib/store/actionDef.d.ts +9 -9
- package/lib/store/actionDef.js +135 -135
- package/lib/store/checker.d.ts +13 -7
- package/lib/store/checker.js +498 -391
- package/lib/store/filter.d.ts +109 -100
- package/lib/store/filter.js +893 -878
- package/lib/store/modi.d.ts +13 -13
- package/lib/store/modi.js +198 -206
- package/lib/store/relation.d.ts +13 -13
- package/lib/store/relation.js +66 -66
- package/lib/store/selection.d.ts +7 -7
- package/lib/store/selection.js +235 -235
- package/lib/triggers/index.d.ts +6 -6
- package/lib/triggers/index.js +11 -11
- package/lib/triggers/modi.d.ts +5 -5
- package/lib/triggers/modi.js +72 -72
- package/lib/types/Action.d.ts +18 -14
- package/lib/types/Action.js +2 -2
- package/lib/types/AppLoader.d.ts +11 -11
- package/lib/types/AppLoader.js +10 -10
- package/lib/types/Aspect.d.ts +12 -12
- package/lib/types/Aspect.js +4 -4
- package/lib/types/Auth.d.ts +66 -66
- package/lib/types/Auth.js +2 -2
- package/lib/types/Connector.d.ts +26 -26
- package/lib/types/Connector.js +9 -9
- package/lib/types/Context.d.ts +7 -7
- package/lib/types/Context.js +3 -3
- package/lib/types/DataType.d.ts +18 -18
- package/lib/types/DataType.js +5 -5
- package/lib/types/Demand.d.ts +77 -77
- package/lib/types/Demand.js +9 -9
- package/lib/types/Endpoint.d.ts +11 -0
- package/lib/types/Endpoint.js +3 -0
- package/lib/types/Entity.d.ts +176 -190
- package/lib/types/Entity.js +14 -15
- package/lib/types/Exception.d.ts +88 -83
- package/lib/types/Exception.js +267 -252
- package/lib/types/Expression.d.ts +163 -141
- package/lib/types/Expression.js +427 -402
- package/lib/types/Geo.d.ts +18 -18
- package/lib/types/Geo.js +2 -2
- package/lib/types/Locale.d.ts +24 -24
- package/lib/types/Locale.js +2 -2
- package/lib/types/Logger.d.ts +5 -5
- package/lib/types/Logger.js +3 -3
- package/lib/types/Polyfill.d.ts +23 -23
- package/lib/types/Polyfill.js +2 -2
- package/lib/types/Port.d.ts +17 -0
- package/lib/types/Port.js +2 -0
- package/lib/types/RowStore.d.ts +12 -12
- package/lib/types/RowStore.js +34 -34
- package/lib/types/Storage.d.ts +56 -56
- package/lib/types/Storage.js +2 -2
- package/lib/types/Timer.d.ts +13 -13
- package/lib/types/Timer.js +2 -2
- package/lib/types/Trigger.d.ts +100 -100
- package/lib/types/Trigger.js +39 -39
- package/lib/types/Txn.d.ts +2 -2
- package/lib/types/Txn.js +3 -3
- package/lib/types/Watcher.d.ts +19 -19
- package/lib/types/Watcher.js +4 -4
- package/lib/types/index.d.ts +21 -19
- package/lib/types/index.js +24 -22
- package/lib/types/schema/DataTypes.d.ts +32 -32
- package/lib/types/schema/DataTypes.js +3 -3
- package/lib/utils/SimpleConnector.d.ts +30 -30
- package/lib/utils/SimpleConnector.js +117 -117
- package/lib/utils/assert.d.ts +5 -5
- package/lib/utils/assert.js +9 -9
- package/lib/utils/concurrent.d.ts +15 -15
- package/lib/utils/concurrent.js +89 -89
- package/lib/utils/cron.d.ts +1 -1
- package/lib/utils/cron.js +18 -18
- package/lib/utils/date.d.ts +1 -0
- package/lib/utils/date.js +18 -0
- package/lib/utils/geo.d.ts +4 -4
- package/lib/utils/geo.js +24 -24
- package/lib/utils/lodash.d.ts +20 -20
- package/lib/utils/lodash.js +55 -55
- package/lib/utils/random/random.d.ts +1 -1
- package/lib/utils/random/random.js +24 -24
- package/lib/utils/random/random.mp.d.ts +1 -1
- package/lib/utils/random/random.mp.js +25 -25
- package/lib/utils/random/random.web.d.ts +1 -1
- package/lib/utils/random/random.web.js +17 -17
- package/lib/utils/string.d.ts +22 -22
- package/lib/utils/string.js +70 -70
- package/lib/utils/uuid.d.ts +12 -12
- package/lib/utils/uuid.js +194 -194
- package/lib/utils/validator.d.ts +23 -23
- package/lib/utils/validator.js +123 -123
- package/package.json +48 -48
- package/src/entities/Modi.ts +68 -68
- package/src/entities/ModiEntity.ts +24 -24
- package/src/entities/Oper.ts +28 -28
- package/src/entities/OperEntity.ts +24 -24
- package/src/entities/User.ts +19 -19
package/lib/types/Trigger.d.ts
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { SelectOption, CheckerType } from ".";
|
|
2
|
-
import { GenericAction } from "../actions/action";
|
|
3
|
-
import { AsyncContext } from "../store/AsyncRowStore";
|
|
4
|
-
import { SyncContext } from "../store/SyncRowStore";
|
|
5
|
-
import { EntityDict, OperateOption } from "../types/Entity";
|
|
6
|
-
import { EntityShape } from "../types/Entity";
|
|
7
|
-
interface TriggerBase<ED extends EntityDict, T extends keyof ED> {
|
|
8
|
-
checkerType?: CheckerType;
|
|
9
|
-
entity: T;
|
|
10
|
-
name: string;
|
|
11
|
-
priority?: number;
|
|
12
|
-
}
|
|
13
|
-
export interface CreateTriggerBase<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends TriggerBase<ED, T> {
|
|
14
|
-
action: 'create';
|
|
15
|
-
check?: (operation: ED[T]['Create']) => boolean;
|
|
16
|
-
fn: (event: {
|
|
17
|
-
operation: ED[T]['Create'];
|
|
18
|
-
}, context: Cxt, option: OperateOption) => Promise<number> | number;
|
|
19
|
-
}
|
|
20
|
-
export interface CreateTriggerInTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends CreateTriggerBase<ED, T, Cxt> {
|
|
21
|
-
when: 'before' | 'after';
|
|
22
|
-
}
|
|
23
|
-
export interface CreateTriggerCrossTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends CreateTriggerBase<ED, T, Cxt> {
|
|
24
|
-
when: 'commit';
|
|
25
|
-
strict?: 'takeEasy' | 'makeSure';
|
|
26
|
-
}
|
|
27
|
-
export
|
|
28
|
-
/**
|
|
29
|
-
* update trigger如果带有filter,说明只对存在限定条件的行起作用。此时系统在进行相应动作时,
|
|
30
|
-
* 会判定当前动作的filter条件和trigger所定义的filter是否有交集(即有同时满足两个条件的行)
|
|
31
|
-
* 只要有,就会触发trigger。要注意的是这个条件是exists而不是all
|
|
32
|
-
*/
|
|
33
|
-
export interface UpdateTriggerBase<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends TriggerBase<ED, T> {
|
|
34
|
-
action: Exclude<ED[T]['Action'], GenericAction> | 'update' | Array<Exclude<ED[T]['Action'], GenericAction> | 'update'>;
|
|
35
|
-
attributes?: keyof ED[T]['OpSchema'] | Array<keyof ED[T]['OpSchema']>;
|
|
36
|
-
check?: (operation: ED[T]['Update']) => boolean;
|
|
37
|
-
fn: (event: {
|
|
38
|
-
operation: ED[T]['Update'];
|
|
39
|
-
}, context: Cxt, option: OperateOption) => Promise<number> | number;
|
|
40
|
-
filter?: ED[T]['Update']['filter'] | ((operation: ED[T]['Update'], context: Cxt, option: OperateOption) => ED[T]['Update']['filter']);
|
|
41
|
-
}
|
|
42
|
-
export interface UpdateTriggerInTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends UpdateTriggerBase<ED, T, Cxt> {
|
|
43
|
-
when: 'before' | 'after';
|
|
44
|
-
}
|
|
45
|
-
export interface UpdateTriggerCrossTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends UpdateTriggerBase<ED, T, Cxt> {
|
|
46
|
-
when: 'commit';
|
|
47
|
-
strict?: 'takeEasy' | 'makeSure';
|
|
48
|
-
}
|
|
49
|
-
export
|
|
50
|
-
/**
|
|
51
|
-
* 同update trigger一样,remove trigger如果带有filter,说明只对存在限定条件的行起作用。此时系统在进行相应动作时,
|
|
52
|
-
* 会判定当前动作的filter条件和trigger所定义的filter是否有交集(即有同时满足两个条件的行)
|
|
53
|
-
* 只要有,就会触发trigger。要注意的是这个条件是exists而不是all
|
|
54
|
-
*/
|
|
55
|
-
export interface RemoveTriggerBase<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends TriggerBase<ED, T> {
|
|
56
|
-
action: 'remove';
|
|
57
|
-
check?: (operation: ED[T]['Remove']) => boolean;
|
|
58
|
-
fn: (event: {
|
|
59
|
-
operation: ED[T]['Remove'];
|
|
60
|
-
}, context: Cxt, option: OperateOption) => Promise<number> | number;
|
|
61
|
-
filter?: ED[T]['Remove']['filter'] | ((operation: ED[T]['Remove'], context: Cxt, option: OperateOption) => ED[T]['Remove']['filter']);
|
|
62
|
-
}
|
|
63
|
-
export interface RemoveTriggerInTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends RemoveTriggerBase<ED, T, Cxt> {
|
|
64
|
-
when: 'before' | 'after';
|
|
65
|
-
}
|
|
66
|
-
export interface RemoveTriggerCrossTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends RemoveTriggerBase<ED, T, Cxt> {
|
|
67
|
-
when: 'commit';
|
|
68
|
-
strict?: 'takeEasy' | 'makeSure';
|
|
69
|
-
}
|
|
70
|
-
export
|
|
71
|
-
export interface SelectTriggerBase<ED extends EntityDict, T extends keyof ED> extends TriggerBase<ED, T> {
|
|
72
|
-
action: 'select';
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* selection似乎不需要支持跨事务?没想清楚
|
|
76
|
-
* todo by Xc
|
|
77
|
-
*/
|
|
78
|
-
export interface SelectTriggerBefore<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends SelectTriggerBase<ED, T> {
|
|
79
|
-
when: 'before';
|
|
80
|
-
fn: (event: {
|
|
81
|
-
operation: ED[T]['Selection'];
|
|
82
|
-
}, context: Cxt, params?: SelectOption) => Promise<number> | number;
|
|
83
|
-
}
|
|
84
|
-
export interface SelectTriggerAfter<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends SelectTriggerBase<ED, T> {
|
|
85
|
-
when: 'after';
|
|
86
|
-
fn: (event: {
|
|
87
|
-
operation: ED[T]['Selection'];
|
|
88
|
-
result: Partial<ED[T]['Schema']>[];
|
|
89
|
-
}, context: Cxt, params?: SelectOption) => Promise<number> | number;
|
|
90
|
-
}
|
|
91
|
-
export
|
|
92
|
-
export
|
|
93
|
-
export interface TriggerEntityShape extends EntityShape {
|
|
94
|
-
$$triggerData$$?: {
|
|
95
|
-
name: string;
|
|
96
|
-
operation: object;
|
|
97
|
-
};
|
|
98
|
-
$$triggerTimestamp$$?: number;
|
|
99
|
-
}
|
|
100
|
-
export {};
|
|
1
|
+
import { SelectOption, CheckerType } from ".";
|
|
2
|
+
import { GenericAction } from "../actions/action";
|
|
3
|
+
import { AsyncContext } from "../store/AsyncRowStore";
|
|
4
|
+
import { SyncContext } from "../store/SyncRowStore";
|
|
5
|
+
import { EntityDict, OperateOption } from "../types/Entity";
|
|
6
|
+
import { EntityShape } from "../types/Entity";
|
|
7
|
+
interface TriggerBase<ED extends EntityDict, T extends keyof ED> {
|
|
8
|
+
checkerType?: CheckerType;
|
|
9
|
+
entity: T;
|
|
10
|
+
name: string;
|
|
11
|
+
priority?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateTriggerBase<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends TriggerBase<ED, T> {
|
|
14
|
+
action: 'create';
|
|
15
|
+
check?: (operation: ED[T]['Create']) => boolean;
|
|
16
|
+
fn: (event: {
|
|
17
|
+
operation: ED[T]['Create'];
|
|
18
|
+
}, context: Cxt, option: OperateOption) => Promise<number> | number;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateTriggerInTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends CreateTriggerBase<ED, T, Cxt> {
|
|
21
|
+
when: 'before' | 'after';
|
|
22
|
+
}
|
|
23
|
+
export interface CreateTriggerCrossTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends CreateTriggerBase<ED, T, Cxt> {
|
|
24
|
+
when: 'commit';
|
|
25
|
+
strict?: 'takeEasy' | 'makeSure';
|
|
26
|
+
}
|
|
27
|
+
export type CreateTrigger<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = CreateTriggerInTxn<ED, T, Cxt> | CreateTriggerCrossTxn<ED, T, Cxt>;
|
|
28
|
+
/**
|
|
29
|
+
* update trigger如果带有filter,说明只对存在限定条件的行起作用。此时系统在进行相应动作时,
|
|
30
|
+
* 会判定当前动作的filter条件和trigger所定义的filter是否有交集(即有同时满足两个条件的行)
|
|
31
|
+
* 只要有,就会触发trigger。要注意的是这个条件是exists而不是all
|
|
32
|
+
*/
|
|
33
|
+
export interface UpdateTriggerBase<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends TriggerBase<ED, T> {
|
|
34
|
+
action: Exclude<ED[T]['Action'], GenericAction> | 'update' | Array<Exclude<ED[T]['Action'], GenericAction> | 'update'>;
|
|
35
|
+
attributes?: keyof ED[T]['OpSchema'] | Array<keyof ED[T]['OpSchema']>;
|
|
36
|
+
check?: (operation: ED[T]['Update']) => boolean;
|
|
37
|
+
fn: (event: {
|
|
38
|
+
operation: ED[T]['Update'];
|
|
39
|
+
}, context: Cxt, option: OperateOption) => Promise<number> | number;
|
|
40
|
+
filter?: ED[T]['Update']['filter'] | ((operation: ED[T]['Update'], context: Cxt, option: OperateOption) => ED[T]['Update']['filter'] | Promise<ED[T]['Update']['filter']>);
|
|
41
|
+
}
|
|
42
|
+
export interface UpdateTriggerInTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends UpdateTriggerBase<ED, T, Cxt> {
|
|
43
|
+
when: 'before' | 'after';
|
|
44
|
+
}
|
|
45
|
+
export interface UpdateTriggerCrossTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends UpdateTriggerBase<ED, T, Cxt> {
|
|
46
|
+
when: 'commit';
|
|
47
|
+
strict?: 'takeEasy' | 'makeSure';
|
|
48
|
+
}
|
|
49
|
+
export type UpdateTrigger<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = UpdateTriggerInTxn<ED, T, Cxt> | UpdateTriggerCrossTxn<ED, T, Cxt>;
|
|
50
|
+
/**
|
|
51
|
+
* 同update trigger一样,remove trigger如果带有filter,说明只对存在限定条件的行起作用。此时系统在进行相应动作时,
|
|
52
|
+
* 会判定当前动作的filter条件和trigger所定义的filter是否有交集(即有同时满足两个条件的行)
|
|
53
|
+
* 只要有,就会触发trigger。要注意的是这个条件是exists而不是all
|
|
54
|
+
*/
|
|
55
|
+
export interface RemoveTriggerBase<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends TriggerBase<ED, T> {
|
|
56
|
+
action: 'remove';
|
|
57
|
+
check?: (operation: ED[T]['Remove']) => boolean;
|
|
58
|
+
fn: (event: {
|
|
59
|
+
operation: ED[T]['Remove'];
|
|
60
|
+
}, context: Cxt, option: OperateOption) => Promise<number> | number;
|
|
61
|
+
filter?: ED[T]['Remove']['filter'] | ((operation: ED[T]['Remove'], context: Cxt, option: OperateOption) => ED[T]['Remove']['filter'] | Promise<ED[T]['Remove']['filter']>);
|
|
62
|
+
}
|
|
63
|
+
export interface RemoveTriggerInTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends RemoveTriggerBase<ED, T, Cxt> {
|
|
64
|
+
when: 'before' | 'after';
|
|
65
|
+
}
|
|
66
|
+
export interface RemoveTriggerCrossTxn<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends RemoveTriggerBase<ED, T, Cxt> {
|
|
67
|
+
when: 'commit';
|
|
68
|
+
strict?: 'takeEasy' | 'makeSure';
|
|
69
|
+
}
|
|
70
|
+
export type RemoveTrigger<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = RemoveTriggerInTxn<ED, T, Cxt> | RemoveTriggerCrossTxn<ED, T, Cxt>;
|
|
71
|
+
export interface SelectTriggerBase<ED extends EntityDict, T extends keyof ED> extends TriggerBase<ED, T> {
|
|
72
|
+
action: 'select';
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* selection似乎不需要支持跨事务?没想清楚
|
|
76
|
+
* todo by Xc
|
|
77
|
+
*/
|
|
78
|
+
export interface SelectTriggerBefore<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends SelectTriggerBase<ED, T> {
|
|
79
|
+
when: 'before';
|
|
80
|
+
fn: (event: {
|
|
81
|
+
operation: ED[T]['Selection'];
|
|
82
|
+
}, context: Cxt, params?: SelectOption) => Promise<number> | number;
|
|
83
|
+
}
|
|
84
|
+
export interface SelectTriggerAfter<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> extends SelectTriggerBase<ED, T> {
|
|
85
|
+
when: 'after';
|
|
86
|
+
fn: (event: {
|
|
87
|
+
operation: ED[T]['Selection'];
|
|
88
|
+
result: Partial<ED[T]['Schema']>[];
|
|
89
|
+
}, context: Cxt, params?: SelectOption) => Promise<number> | number;
|
|
90
|
+
}
|
|
91
|
+
export type SelectTrigger<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = SelectTriggerBefore<ED, T, Cxt> | SelectTriggerAfter<ED, T, Cxt>;
|
|
92
|
+
export type Trigger<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = CreateTrigger<ED, T, Cxt> | UpdateTrigger<ED, T, Cxt> | RemoveTrigger<ED, T, Cxt> | SelectTrigger<ED, T, Cxt>;
|
|
93
|
+
export interface TriggerEntityShape extends EntityShape {
|
|
94
|
+
$$triggerData$$?: {
|
|
95
|
+
name: string;
|
|
96
|
+
operation: object;
|
|
97
|
+
};
|
|
98
|
+
$$triggerTimestamp$$?: number;
|
|
99
|
+
}
|
|
100
|
+
export {};
|
package/lib/types/Trigger.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
4
|
-
;
|
|
5
|
-
;
|
|
6
|
-
;
|
|
7
|
-
;
|
|
8
|
-
;
|
|
9
|
-
;
|
|
10
|
-
;
|
|
11
|
-
;
|
|
12
|
-
;
|
|
13
|
-
;
|
|
14
|
-
;
|
|
15
|
-
;
|
|
16
|
-
;
|
|
17
|
-
/* export abstract class Executor<ED extends EntityDict, Cxt extends AsyncContext<ED>> {
|
|
18
|
-
static dataAttr: TriggerDataAttribute = '$$triggerData$$';
|
|
19
|
-
static timestampAttr: TriggerTimestampAttribute = '$$triggerTimestamp$$';
|
|
20
|
-
|
|
21
|
-
abstract registerTrigger<T extends keyof ED>(trigger: Trigger<ED, T>): void;
|
|
22
|
-
|
|
23
|
-
abstract preOperation<T extends keyof ED>(
|
|
24
|
-
entity: T,
|
|
25
|
-
operation: ED[T]['Operation'] | ED[T]['Selection'] & { action: 'select' },
|
|
26
|
-
context: Cxt,
|
|
27
|
-
option: OperateOption | SelectOption
|
|
28
|
-
): Promise<void>;
|
|
29
|
-
|
|
30
|
-
abstract postOperation<T extends keyof ED>(
|
|
31
|
-
entity: T,
|
|
32
|
-
operation: ED[T]['Operation'] | ED[T]['Selection'] & { action: 'select' },
|
|
33
|
-
context: Cxt,
|
|
34
|
-
option: OperateOption | SelectOption,
|
|
35
|
-
result?: SelectRowShape<ED[T]['Schema'], ED[T]['Selection']['data']>[]
|
|
36
|
-
): Promise<void>;
|
|
37
|
-
|
|
38
|
-
abstract checkpoint(context: Cxt, timestamp: number): Promise<number>; // 将所有在timestamp之前存在不一致的数据进行恢复
|
|
39
|
-
} */
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
;
|
|
4
|
+
;
|
|
5
|
+
;
|
|
6
|
+
;
|
|
7
|
+
;
|
|
8
|
+
;
|
|
9
|
+
;
|
|
10
|
+
;
|
|
11
|
+
;
|
|
12
|
+
;
|
|
13
|
+
;
|
|
14
|
+
;
|
|
15
|
+
;
|
|
16
|
+
;
|
|
17
|
+
/* export abstract class Executor<ED extends EntityDict, Cxt extends AsyncContext<ED>> {
|
|
18
|
+
static dataAttr: TriggerDataAttribute = '$$triggerData$$';
|
|
19
|
+
static timestampAttr: TriggerTimestampAttribute = '$$triggerTimestamp$$';
|
|
20
|
+
|
|
21
|
+
abstract registerTrigger<T extends keyof ED>(trigger: Trigger<ED, T>): void;
|
|
22
|
+
|
|
23
|
+
abstract preOperation<T extends keyof ED>(
|
|
24
|
+
entity: T,
|
|
25
|
+
operation: ED[T]['Operation'] | ED[T]['Selection'] & { action: 'select' },
|
|
26
|
+
context: Cxt,
|
|
27
|
+
option: OperateOption | SelectOption
|
|
28
|
+
): Promise<void>;
|
|
29
|
+
|
|
30
|
+
abstract postOperation<T extends keyof ED>(
|
|
31
|
+
entity: T,
|
|
32
|
+
operation: ED[T]['Operation'] | ED[T]['Selection'] & { action: 'select' },
|
|
33
|
+
context: Cxt,
|
|
34
|
+
option: OperateOption | SelectOption,
|
|
35
|
+
result?: SelectRowShape<ED[T]['Schema'], ED[T]['Selection']['data']>[]
|
|
36
|
+
): Promise<void>;
|
|
37
|
+
|
|
38
|
+
abstract checkpoint(context: Cxt, timestamp: number): Promise<number>; // 将所有在timestamp之前存在不一致的数据进行恢复
|
|
39
|
+
} */
|
package/lib/types/Txn.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface Txn {
|
|
2
|
-
}
|
|
1
|
+
export interface Txn {
|
|
2
|
+
}
|
package/lib/types/Txn.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
;
|
package/lib/types/Watcher.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { AsyncContext } from "../store/AsyncRowStore";
|
|
2
|
-
import { EntityDict, OperationResult } from "./Entity";
|
|
3
|
-
|
|
4
|
-
export interface BBWatcher<ED extends EntityDict, T extends keyof ED> {
|
|
5
|
-
name: string;
|
|
6
|
-
entity: T;
|
|
7
|
-
filter: ED[T]['Selection']['filter'] | (() => ED[T]['Selection']['filter']);
|
|
8
|
-
action: ED[T]['Operation']['action'];
|
|
9
|
-
actionData: ActionData<ED, T> | (() => ActionData<ED, T>);
|
|
10
|
-
}
|
|
11
|
-
export interface WBWatcher<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> {
|
|
12
|
-
name: string;
|
|
13
|
-
entity: T;
|
|
14
|
-
filter: ED[T]['Selection']['filter'] | (() => Promise<ED[T]['Selection']['filter']>);
|
|
15
|
-
projection: ED[T]['Selection']['data'] | (() => Promise<ED[T]['Selection']['data']>);
|
|
16
|
-
fn: (context: Cxt, data: Partial<ED[T]['Schema']>[]) => Promise<OperationResult<ED>>;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
19
|
-
export {};
|
|
1
|
+
import { AsyncContext } from "../store/AsyncRowStore";
|
|
2
|
+
import { EntityDict, OperationResult } from "./Entity";
|
|
3
|
+
type ActionData<ED extends EntityDict, T extends keyof ED> = ED[T]['Update']['data'] | ED[T]['Remove']['data'];
|
|
4
|
+
export interface BBWatcher<ED extends EntityDict, T extends keyof ED> {
|
|
5
|
+
name: string;
|
|
6
|
+
entity: T;
|
|
7
|
+
filter: ED[T]['Selection']['filter'] | (() => ED[T]['Selection']['filter']);
|
|
8
|
+
action: ED[T]['Operation']['action'];
|
|
9
|
+
actionData: ActionData<ED, T> | (() => ActionData<ED, T>);
|
|
10
|
+
}
|
|
11
|
+
export interface WBWatcher<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> {
|
|
12
|
+
name: string;
|
|
13
|
+
entity: T;
|
|
14
|
+
filter: ED[T]['Selection']['filter'] | (() => Promise<ED[T]['Selection']['filter']>);
|
|
15
|
+
projection: ED[T]['Selection']['data'] | (() => Promise<ED[T]['Selection']['data']>);
|
|
16
|
+
fn: (context: Cxt, data: Partial<ED[T]['Schema']>[]) => Promise<OperationResult<ED>>;
|
|
17
|
+
}
|
|
18
|
+
export type Watcher<ED extends EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> = BBWatcher<ED, T> | WBWatcher<ED, T, Cxt>;
|
|
19
|
+
export {};
|
package/lib/types/Watcher.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
4
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
;
|
|
4
|
+
;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
export * from './Action';
|
|
2
|
-
export * from './Aspect';
|
|
3
|
-
export * from './Auth';
|
|
4
|
-
export * from './Context';
|
|
5
|
-
export * from './DataType';
|
|
6
|
-
export * from './Demand';
|
|
7
|
-
export * from './Entity';
|
|
8
|
-
export * from './Expression';
|
|
9
|
-
export * from './Geo';
|
|
10
|
-
export * from './Logger';
|
|
11
|
-
export * from './Polyfill';
|
|
12
|
-
export * from './RowStore';
|
|
13
|
-
export * from './Storage';
|
|
14
|
-
export * from './Trigger';
|
|
15
|
-
export * from './Exception';
|
|
16
|
-
export * from './Watcher';
|
|
17
|
-
export * from './AppLoader';
|
|
18
|
-
export * from './Connector';
|
|
19
|
-
export * from './Timer';
|
|
1
|
+
export * from './Action';
|
|
2
|
+
export * from './Aspect';
|
|
3
|
+
export * from './Auth';
|
|
4
|
+
export * from './Context';
|
|
5
|
+
export * from './DataType';
|
|
6
|
+
export * from './Demand';
|
|
7
|
+
export * from './Entity';
|
|
8
|
+
export * from './Expression';
|
|
9
|
+
export * from './Geo';
|
|
10
|
+
export * from './Logger';
|
|
11
|
+
export * from './Polyfill';
|
|
12
|
+
export * from './RowStore';
|
|
13
|
+
export * from './Storage';
|
|
14
|
+
export * from './Trigger';
|
|
15
|
+
export * from './Exception';
|
|
16
|
+
export * from './Watcher';
|
|
17
|
+
export * from './AppLoader';
|
|
18
|
+
export * from './Connector';
|
|
19
|
+
export * from './Timer';
|
|
20
|
+
export * from './Port';
|
|
21
|
+
export * from './Endpoint';
|
package/lib/types/index.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./Action"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./Aspect"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./Auth"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./Context"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./DataType"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./Demand"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./Entity"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./Expression"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./Geo"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./Logger"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./Polyfill"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./RowStore"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./Storage"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./Trigger"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./Exception"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./Watcher"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./AppLoader"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./Connector"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./Timer"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./Action"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./Aspect"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./Auth"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./Context"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./DataType"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./Demand"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./Entity"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./Expression"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./Geo"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./Logger"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./Polyfill"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./RowStore"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./Storage"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./Trigger"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./Exception"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./Watcher"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./AppLoader"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./Connector"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./Timer"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./Port"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./Endpoint"), exports);
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Column types used for @PrimaryGeneratedColumn() decorator.
|
|
3
|
-
*/
|
|
4
|
-
export
|
|
5
|
-
/**
|
|
6
|
-
* Column types where spatial properties are used.
|
|
7
|
-
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* Column types where precision and scale properties are used.
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* Column types where column length is used.
|
|
15
|
-
*/
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
/**
|
|
19
|
-
* All other regular column types.
|
|
20
|
-
*/
|
|
21
|
-
export
|
|
22
|
-
/**
|
|
23
|
-
* Any column type column can be.
|
|
24
|
-
*/
|
|
25
|
-
export
|
|
26
|
-
export interface DataTypeParams {
|
|
27
|
-
length?: number;
|
|
28
|
-
width?: number;
|
|
29
|
-
precision?: number;
|
|
30
|
-
scale?: number;
|
|
31
|
-
signed?: boolean;
|
|
32
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Column types used for @PrimaryGeneratedColumn() decorator.
|
|
3
|
+
*/
|
|
4
|
+
export type PrimaryGeneratedColumnType = "int" | "int2" | "int4" | "int8" | "integer" | "tinyint" | "smallint" | "mediumint" | "bigint" | "dec" | "decimal" | "smalldecimal" | "fixed" | "numeric" | "number";
|
|
5
|
+
/**
|
|
6
|
+
* Column types where spatial properties are used.
|
|
7
|
+
*/
|
|
8
|
+
export type SpatialColumnType = "geometry" | "geography" | "st_geometry" | "st_point";
|
|
9
|
+
/**
|
|
10
|
+
* Column types where precision and scale properties are used.
|
|
11
|
+
*/
|
|
12
|
+
export type WithPrecisionColumnType = "float" | "double" | "dec" | "decimal" | "smalldecimal" | "fixed" | "numeric" | "real" | "double precision" | "number" | "datetime" | "datetime2" | "datetimeoffset" | "time" | "time with time zone" | "time without time zone" | "timestamp" | "timestamp without time zone" | "timestamp with time zone" | "timestamp with local time zone";
|
|
13
|
+
/**
|
|
14
|
+
* Column types where column length is used.
|
|
15
|
+
*/
|
|
16
|
+
export type WithLengthColumnType = "character varying" | "varying character" | "char varying" | "nvarchar" | "national varchar" | "character" | "native character" | "varchar" | "char" | "nchar" | "national char" | "varchar2" | "nvarchar2" | "alphanum" | "shorttext" | "raw" | "binary" | "varbinary" | "string";
|
|
17
|
+
export type WithWidthColumnType = "tinyint" | "smallint" | "mediumint" | "int" | "bigint";
|
|
18
|
+
/**
|
|
19
|
+
* All other regular column types.
|
|
20
|
+
*/
|
|
21
|
+
export type SimpleColumnType = "simple-array" | "simple-json" | "simple-enum" | "int2" | "integer" | "int4" | "int8" | "int64" | "unsigned big int" | "float" | "float4" | "float8" | "smallmoney" | "money" | "boolean" | "bool" | "tinyblob" | "tinytext" | "mediumblob" | "mediumtext" | "blob" | "text" | "ntext" | "citext" | "hstore" | "longblob" | "longtext" | "alphanum" | "shorttext" | "bytes" | "bytea" | "long" | "raw" | "long raw" | "bfile" | "clob" | "nclob" | "image" | "timetz" | "timestamptz" | "timestamp with local time zone" | "smalldatetime" | "date" | "interval year to month" | "interval day to second" | "interval" | "year" | "seconddate" | "point" | "line" | "lseg" | "box" | "circle" | "path" | "polygon" | "geography" | "geometry" | "linestring" | "multipoint" | "multilinestring" | "multipolygon" | "geometrycollection" | "st_geometry" | "st_point" | "int4range" | "int8range" | "numrange" | "tsrange" | "tstzrange" | "daterange" | "enum" | "set" | "cidr" | "inet" | "macaddr" | "bit" | "bit varying" | "varbit" | "tsvector" | "tsquery" | "uuid" | "xml" | "json" | "jsonb" | "varbinary" | "hierarchyid" | "sql_variant" | "rowid" | "urowid" | "uniqueidentifier" | "rowversion" | "array" | "cube" | "ltree" | "object" | "array" | "function" | "sequence";
|
|
22
|
+
/**
|
|
23
|
+
* Any column type column can be.
|
|
24
|
+
*/
|
|
25
|
+
export type DataType = WithPrecisionColumnType | WithLengthColumnType | WithWidthColumnType | SpatialColumnType | SimpleColumnType;
|
|
26
|
+
export interface DataTypeParams {
|
|
27
|
+
length?: number;
|
|
28
|
+
width?: number;
|
|
29
|
+
precision?: number;
|
|
30
|
+
scale?: number;
|
|
31
|
+
signed?: boolean;
|
|
32
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingHttpHeaders } from "http";
|
|
3
|
-
import { AsyncContext, AsyncRowStore } from '../store/AsyncRowStore';
|
|
4
|
-
import { SyncContext } from '../store/SyncRowStore';
|
|
5
|
-
import { Connector, EntityDict, OakException, OpRecord } from "../types";
|
|
6
|
-
export declare class SimpleConnector<ED extends EntityDict, BackCxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>> extends Connector<ED, BackCxt, FrontCxt> {
|
|
7
|
-
static ROUTER: string;
|
|
8
|
-
private serverUrl;
|
|
9
|
-
private makeException;
|
|
10
|
-
private contextBuilder;
|
|
11
|
-
constructor(serverUrl: string, makeException: (exceptionData: any) => OakException, contextBuilder: (str: string | undefined) => (store: AsyncRowStore<ED, BackCxt>) => Promise<BackCxt>);
|
|
12
|
-
callAspect(name: string, params: any, context: FrontCxt): Promise<{
|
|
13
|
-
result: any;
|
|
14
|
-
opRecords: OpRecord<ED>[];
|
|
15
|
-
}>;
|
|
16
|
-
getRouter(): string;
|
|
17
|
-
parseRequest(headers: IncomingHttpHeaders, body: any, store: AsyncRowStore<ED, BackCxt>): Promise<{
|
|
18
|
-
name: string;
|
|
19
|
-
params: any;
|
|
20
|
-
context: BackCxt;
|
|
21
|
-
}>;
|
|
22
|
-
serializeResult(result: any, context: BackCxt, headers: IncomingHttpHeaders, body: any): {
|
|
23
|
-
body: any;
|
|
24
|
-
headers?: Record<string, any> | undefined;
|
|
25
|
-
};
|
|
26
|
-
serializeException(exception: OakException, headers: IncomingHttpHeaders, body: any): {
|
|
27
|
-
body: any;
|
|
28
|
-
headers?: Record<string, any> | undefined;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingHttpHeaders } from "http";
|
|
3
|
+
import { AsyncContext, AsyncRowStore } from '../store/AsyncRowStore';
|
|
4
|
+
import { SyncContext } from '../store/SyncRowStore';
|
|
5
|
+
import { Connector, EntityDict, OakException, OpRecord } from "../types";
|
|
6
|
+
export declare class SimpleConnector<ED extends EntityDict, BackCxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>> extends Connector<ED, BackCxt, FrontCxt> {
|
|
7
|
+
static ROUTER: string;
|
|
8
|
+
private serverUrl;
|
|
9
|
+
private makeException;
|
|
10
|
+
private contextBuilder;
|
|
11
|
+
constructor(serverUrl: string, makeException: (exceptionData: any) => OakException, contextBuilder: (str: string | undefined) => (store: AsyncRowStore<ED, BackCxt>) => Promise<BackCxt>);
|
|
12
|
+
callAspect(name: string, params: any, context: FrontCxt): Promise<{
|
|
13
|
+
result: any;
|
|
14
|
+
opRecords: OpRecord<ED>[];
|
|
15
|
+
}>;
|
|
16
|
+
getRouter(): string;
|
|
17
|
+
parseRequest(headers: IncomingHttpHeaders, body: any, store: AsyncRowStore<ED, BackCxt>): Promise<{
|
|
18
|
+
name: string;
|
|
19
|
+
params: any;
|
|
20
|
+
context: BackCxt;
|
|
21
|
+
}>;
|
|
22
|
+
serializeResult(result: any, context: BackCxt, headers: IncomingHttpHeaders, body: any): {
|
|
23
|
+
body: any;
|
|
24
|
+
headers?: Record<string, any> | undefined;
|
|
25
|
+
};
|
|
26
|
+
serializeException(exception: OakException, headers: IncomingHttpHeaders, body: any): {
|
|
27
|
+
body: any;
|
|
28
|
+
headers?: Record<string, any> | undefined;
|
|
29
|
+
};
|
|
30
|
+
}
|