oak-domain 4.1.0 → 4.2.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/lib/base-app-domain/ActionAuth/Schema.d.ts +185 -185
- package/lib/base-app-domain/ActionDefDict.d.ts +2 -2
- package/lib/base-app-domain/I18n/Schema.d.ts +128 -128
- package/lib/base-app-domain/Modi/Schema.d.ts +135 -135
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +383 -383
- package/lib/base-app-domain/Oper/Schema.d.ts +158 -152
- package/lib/base-app-domain/Oper/Storage.js +19 -1
- package/lib/base-app-domain/OperEntity/Schema.d.ts +372 -372
- package/lib/base-app-domain/Path/Schema.d.ts +148 -148
- package/lib/base-app-domain/Relation/Schema.d.ts +187 -187
- package/lib/base-app-domain/RelationAuth/Schema.d.ts +213 -213
- package/lib/base-app-domain/User/Action.d.ts +1 -0
- package/lib/base-app-domain/User/Action.js +3 -3
- package/lib/base-app-domain/User/Schema.d.ts +209 -209
- package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +263 -263
- package/lib/base-app-domain/UserEntityGrant/Action.d.ts +5 -5
- package/lib/base-app-domain/UserEntityGrant/Action.js +5 -5
- package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +130 -130
- package/lib/base-app-domain/UserRelation/Schema.d.ts +207 -207
- package/lib/compiler/localeBuilder.d.ts +27 -27
- package/lib/compiler/localeBuilder.js +215 -215
- package/lib/compiler/routerBuilder.js +263 -263
- package/lib/compiler/schemalBuilder.js +4167 -4160
- package/lib/entities/Oper.d.ts +2 -1
- package/lib/entities/Oper.js +16 -1
- package/lib/entities/User.d.ts +10 -0
- package/lib/entities/User.js +3 -2
- package/lib/index.d.ts +0 -22
- package/lib/index.js +1 -35
- package/lib/store/AsyncRowStore.d.ts +66 -65
- package/lib/store/AsyncRowStore.js +180 -180
- package/lib/store/CascadeStore.js +7 -31
- package/lib/store/RelationAuth.d.ts +103 -103
- package/lib/store/RelationAuth.js +1209 -1343
- package/lib/store/SyncRowStore.d.ts +29 -29
- package/lib/store/TriggerExecutor.js +468 -468
- package/lib/store/actionDef.js +278 -278
- package/lib/store/checker.js +487 -487
- package/lib/triggers/index.d.ts +2 -2
- package/lib/triggers/index.js +21 -1
- package/lib/types/Aspect.d.ts +13 -13
- package/lib/types/Configuration.d.ts +42 -0
- package/lib/types/Configuration.js +3 -0
- package/lib/types/Connector.d.ts +38 -38
- package/lib/types/Context.d.ts +7 -7
- package/lib/types/Entity.d.ts +4 -4
- package/lib/types/Environment.d.ts +93 -93
- package/lib/types/Exception.d.ts +155 -155
- package/lib/types/Exception.js +436 -436
- package/lib/types/Sync.d.ts +48 -0
- package/lib/types/Sync.js +8 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/utils/SimpleConnector.d.ts +64 -64
- package/lib/utils/SimpleConnector.js +206 -206
- package/lib/utils/assert.d.ts +5 -5
- package/lib/utils/projection.d.ts +1 -1
- package/lib/utils/relationPath.d.ts +31 -0
- package/lib/utils/relationPath.js +202 -0
- package/package.json +51 -51
- package/src/entities/ActionAuth.ts +41 -41
- package/src/entities/I18n.ts +45 -45
- package/src/entities/Modi.ts +69 -69
- package/src/entities/ModiEntity.ts +26 -26
- package/src/entities/Oper.ts +48 -32
- package/src/entities/OperEntity.ts +27 -27
- package/src/entities/Path.ts +43 -43
- package/src/entities/Relation.ts +43 -43
- package/src/entities/RelationAuth.ts +44 -44
- package/src/entities/User.ts +48 -48
- package/src/entities/UserEntityClaim.ts +29 -29
- package/src/entities/UserEntityGrant.ts +24 -24
- package/src/entities/UserRelation.ts +50 -50
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
|
|
2
|
-
import { OneOf } from "../../types/Polyfill";
|
|
3
|
-
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "../../types/Entity";
|
|
4
|
-
import { Action, ParticularAction, IState } from "./Action";
|
|
5
|
-
import { String } from "../../types/DataType";
|
|
6
|
-
import * as ModiEntity from "../ModiEntity/Schema";
|
|
7
|
-
export type OpSchema = EntityShape & {
|
|
8
|
-
targetEntity: String<32>;
|
|
9
|
-
entity: String<32>;
|
|
10
|
-
entityId: String<64>;
|
|
11
|
-
action: String<16>;
|
|
12
|
-
data: Object;
|
|
13
|
-
filter?: Object | null;
|
|
14
|
-
extra?: Object | null;
|
|
15
|
-
iState?: IState | null;
|
|
16
|
-
};
|
|
17
|
-
export type OpAttr = keyof OpSchema;
|
|
18
|
-
export type Schema = EntityShape & {
|
|
19
|
-
targetEntity: String<32>;
|
|
20
|
-
entity: String<32>;
|
|
21
|
-
entityId: String<64>;
|
|
22
|
-
action: String<16>;
|
|
23
|
-
data: Object;
|
|
24
|
-
filter?: Object | null;
|
|
25
|
-
extra?: Object | null;
|
|
26
|
-
iState?: IState | null;
|
|
27
|
-
modiEntity$modi?: Array<ModiEntity.Schema>;
|
|
28
|
-
modiEntity$modi$$aggr?: AggregationResult<ModiEntity.Schema>;
|
|
29
|
-
} & {
|
|
30
|
-
[A in ExpressionKey]?: any;
|
|
31
|
-
};
|
|
32
|
-
type AttrFilter = {
|
|
33
|
-
id: Q_StringValue;
|
|
34
|
-
$$createAt$$: Q_DateValue;
|
|
35
|
-
$$seq$$: Q_NumberValue;
|
|
36
|
-
$$updateAt$$: Q_DateValue;
|
|
37
|
-
targetEntity: Q_StringValue;
|
|
38
|
-
entity: Q_StringValue;
|
|
39
|
-
entityId: Q_StringValue;
|
|
40
|
-
action: Q_StringValue;
|
|
41
|
-
data: Object;
|
|
42
|
-
filter: Object;
|
|
43
|
-
extra: Object;
|
|
44
|
-
iState: Q_EnumValue<IState>;
|
|
45
|
-
modiEntity$modi: ModiEntity.Filter & SubQueryPredicateMetadata;
|
|
46
|
-
};
|
|
47
|
-
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
48
|
-
export type Projection = {
|
|
49
|
-
"#id"?: NodeId;
|
|
50
|
-
[k: string]: any;
|
|
51
|
-
id?: number;
|
|
52
|
-
$$createAt$$?: number;
|
|
53
|
-
$$updateAt$$?: number;
|
|
54
|
-
$$seq$$?: number;
|
|
55
|
-
targetEntity?: number;
|
|
56
|
-
entity?: number;
|
|
57
|
-
entityId?: number;
|
|
58
|
-
action?: number;
|
|
59
|
-
data?: number | Object;
|
|
60
|
-
filter?: number | Object;
|
|
61
|
-
extra?: number | Object;
|
|
62
|
-
iState?: number;
|
|
63
|
-
modiEntity$modi?: ModiEntity.Selection & {
|
|
64
|
-
$entity: "modiEntity";
|
|
65
|
-
};
|
|
66
|
-
modiEntity$modi$$aggr?: ModiEntity.Aggregation & {
|
|
67
|
-
$entity: "modiEntity";
|
|
68
|
-
};
|
|
69
|
-
} & Partial<ExprOp<OpAttr | string>>;
|
|
70
|
-
type ModiIdProjection = OneOf<{
|
|
71
|
-
id: number;
|
|
72
|
-
}>;
|
|
73
|
-
export type SortAttr = {
|
|
74
|
-
id: number;
|
|
75
|
-
} | {
|
|
76
|
-
$$createAt$$: number;
|
|
77
|
-
} | {
|
|
78
|
-
$$seq$$: number;
|
|
79
|
-
} | {
|
|
80
|
-
$$updateAt$$: number;
|
|
81
|
-
} | {
|
|
82
|
-
targetEntity: number;
|
|
83
|
-
} | {
|
|
84
|
-
entity: number;
|
|
85
|
-
} | {
|
|
86
|
-
entityId: number;
|
|
87
|
-
} | {
|
|
88
|
-
action: number;
|
|
89
|
-
} | {
|
|
90
|
-
iState: number;
|
|
91
|
-
} | {
|
|
92
|
-
[k: string]: any;
|
|
93
|
-
} | OneOf<ExprOp<OpAttr | string>>;
|
|
94
|
-
export type SortNode = {
|
|
95
|
-
$attr: SortAttr;
|
|
96
|
-
$direction?: "asc" | "desc";
|
|
97
|
-
};
|
|
98
|
-
export type Sorter = SortNode[];
|
|
99
|
-
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
100
|
-
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
101
|
-
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
102
|
-
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
|
103
|
-
entity?: string;
|
|
104
|
-
entityId?: string;
|
|
105
|
-
[K: string]: any;
|
|
106
|
-
}) & {
|
|
107
|
-
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
|
108
|
-
};
|
|
109
|
-
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
110
|
-
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
111
|
-
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
112
|
-
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
|
113
|
-
[k: string]: any;
|
|
114
|
-
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
|
115
|
-
};
|
|
116
|
-
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
|
117
|
-
export type RemoveOperationData = {};
|
|
118
|
-
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
119
|
-
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
120
|
-
export type ModiIdSubQuery = Selection<ModiIdProjection>;
|
|
121
|
-
export type EntityDef = {
|
|
122
|
-
Schema: Schema;
|
|
123
|
-
OpSchema: OpSchema;
|
|
124
|
-
Action: OakMakeAction<Action> | string;
|
|
125
|
-
Selection: Selection;
|
|
126
|
-
Aggregation: Aggregation;
|
|
127
|
-
Operation: Operation;
|
|
128
|
-
Create: CreateOperation;
|
|
129
|
-
Update: UpdateOperation;
|
|
130
|
-
Remove: RemoveOperation;
|
|
131
|
-
CreateSingle: CreateSingleOperation;
|
|
132
|
-
CreateMulti: CreateMultipleOperation;
|
|
133
|
-
ParticularAction: ParticularAction;
|
|
134
|
-
};
|
|
135
|
-
export {};
|
|
1
|
+
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
|
|
2
|
+
import { OneOf } from "../../types/Polyfill";
|
|
3
|
+
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "../../types/Entity";
|
|
4
|
+
import { Action, ParticularAction, IState } from "./Action";
|
|
5
|
+
import { String } from "../../types/DataType";
|
|
6
|
+
import * as ModiEntity from "../ModiEntity/Schema";
|
|
7
|
+
export type OpSchema = EntityShape & {
|
|
8
|
+
targetEntity: String<32>;
|
|
9
|
+
entity: String<32>;
|
|
10
|
+
entityId: String<64>;
|
|
11
|
+
action: String<16>;
|
|
12
|
+
data: Object;
|
|
13
|
+
filter?: Object | null;
|
|
14
|
+
extra?: Object | null;
|
|
15
|
+
iState?: IState | null;
|
|
16
|
+
};
|
|
17
|
+
export type OpAttr = keyof OpSchema;
|
|
18
|
+
export type Schema = EntityShape & {
|
|
19
|
+
targetEntity: String<32>;
|
|
20
|
+
entity: String<32>;
|
|
21
|
+
entityId: String<64>;
|
|
22
|
+
action: String<16>;
|
|
23
|
+
data: Object;
|
|
24
|
+
filter?: Object | null;
|
|
25
|
+
extra?: Object | null;
|
|
26
|
+
iState?: IState | null;
|
|
27
|
+
modiEntity$modi?: Array<ModiEntity.Schema>;
|
|
28
|
+
modiEntity$modi$$aggr?: AggregationResult<ModiEntity.Schema>;
|
|
29
|
+
} & {
|
|
30
|
+
[A in ExpressionKey]?: any;
|
|
31
|
+
};
|
|
32
|
+
type AttrFilter = {
|
|
33
|
+
id: Q_StringValue;
|
|
34
|
+
$$createAt$$: Q_DateValue;
|
|
35
|
+
$$seq$$: Q_NumberValue;
|
|
36
|
+
$$updateAt$$: Q_DateValue;
|
|
37
|
+
targetEntity: Q_StringValue;
|
|
38
|
+
entity: Q_StringValue;
|
|
39
|
+
entityId: Q_StringValue;
|
|
40
|
+
action: Q_StringValue;
|
|
41
|
+
data: Object;
|
|
42
|
+
filter: Object;
|
|
43
|
+
extra: Object;
|
|
44
|
+
iState: Q_EnumValue<IState>;
|
|
45
|
+
modiEntity$modi: ModiEntity.Filter & SubQueryPredicateMetadata;
|
|
46
|
+
};
|
|
47
|
+
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
48
|
+
export type Projection = {
|
|
49
|
+
"#id"?: NodeId;
|
|
50
|
+
[k: string]: any;
|
|
51
|
+
id?: number;
|
|
52
|
+
$$createAt$$?: number;
|
|
53
|
+
$$updateAt$$?: number;
|
|
54
|
+
$$seq$$?: number;
|
|
55
|
+
targetEntity?: number;
|
|
56
|
+
entity?: number;
|
|
57
|
+
entityId?: number;
|
|
58
|
+
action?: number;
|
|
59
|
+
data?: number | Object;
|
|
60
|
+
filter?: number | Object;
|
|
61
|
+
extra?: number | Object;
|
|
62
|
+
iState?: number;
|
|
63
|
+
modiEntity$modi?: ModiEntity.Selection & {
|
|
64
|
+
$entity: "modiEntity";
|
|
65
|
+
};
|
|
66
|
+
modiEntity$modi$$aggr?: ModiEntity.Aggregation & {
|
|
67
|
+
$entity: "modiEntity";
|
|
68
|
+
};
|
|
69
|
+
} & Partial<ExprOp<OpAttr | string>>;
|
|
70
|
+
type ModiIdProjection = OneOf<{
|
|
71
|
+
id: number;
|
|
72
|
+
}>;
|
|
73
|
+
export type SortAttr = {
|
|
74
|
+
id: number;
|
|
75
|
+
} | {
|
|
76
|
+
$$createAt$$: number;
|
|
77
|
+
} | {
|
|
78
|
+
$$seq$$: number;
|
|
79
|
+
} | {
|
|
80
|
+
$$updateAt$$: number;
|
|
81
|
+
} | {
|
|
82
|
+
targetEntity: number;
|
|
83
|
+
} | {
|
|
84
|
+
entity: number;
|
|
85
|
+
} | {
|
|
86
|
+
entityId: number;
|
|
87
|
+
} | {
|
|
88
|
+
action: number;
|
|
89
|
+
} | {
|
|
90
|
+
iState: number;
|
|
91
|
+
} | {
|
|
92
|
+
[k: string]: any;
|
|
93
|
+
} | OneOf<ExprOp<OpAttr | string>>;
|
|
94
|
+
export type SortNode = {
|
|
95
|
+
$attr: SortAttr;
|
|
96
|
+
$direction?: "asc" | "desc";
|
|
97
|
+
};
|
|
98
|
+
export type Sorter = SortNode[];
|
|
99
|
+
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
100
|
+
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
101
|
+
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
102
|
+
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
|
103
|
+
entity?: string;
|
|
104
|
+
entityId?: string;
|
|
105
|
+
[K: string]: any;
|
|
106
|
+
}) & {
|
|
107
|
+
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
|
108
|
+
};
|
|
109
|
+
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
110
|
+
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
111
|
+
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
112
|
+
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
|
113
|
+
[k: string]: any;
|
|
114
|
+
modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
|
|
115
|
+
};
|
|
116
|
+
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
|
117
|
+
export type RemoveOperationData = {};
|
|
118
|
+
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
119
|
+
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
120
|
+
export type ModiIdSubQuery = Selection<ModiIdProjection>;
|
|
121
|
+
export type EntityDef = {
|
|
122
|
+
Schema: Schema;
|
|
123
|
+
OpSchema: OpSchema;
|
|
124
|
+
Action: OakMakeAction<Action> | string;
|
|
125
|
+
Selection: Selection;
|
|
126
|
+
Aggregation: Aggregation;
|
|
127
|
+
Operation: Operation;
|
|
128
|
+
Create: CreateOperation;
|
|
129
|
+
Update: UpdateOperation;
|
|
130
|
+
Remove: RemoveOperation;
|
|
131
|
+
CreateSingle: CreateSingleOperation;
|
|
132
|
+
CreateMulti: CreateMultipleOperation;
|
|
133
|
+
ParticularAction: ParticularAction;
|
|
134
|
+
};
|
|
135
|
+
export {};
|