oak-domain 4.2.3 → 4.2.4

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.
Files changed (53) hide show
  1. package/lib/base-app-domain/ActionDefDict.d.ts +8 -8
  2. package/lib/base-app-domain/Oper/Schema.d.ts +158 -158
  3. package/lib/base-app-domain/Oper/Storage.js +56 -56
  4. package/lib/base-app-domain/User/Action.d.ts +11 -11
  5. package/lib/base-app-domain/User/Action.js +12 -12
  6. package/lib/base-app-domain/UserEntityGrant/Action.d.ts +5 -5
  7. package/lib/base-app-domain/UserEntityGrant/Action.js +5 -5
  8. package/lib/compiler/schemalBuilder.js +4167 -4167
  9. package/lib/entities/Oper.d.ts +12 -12
  10. package/lib/entities/Oper.js +36 -36
  11. package/lib/entities/User.d.ts +18 -18
  12. package/lib/entities/User.js +32 -32
  13. package/lib/index.d.ts +1 -1
  14. package/lib/index.js +3 -3
  15. package/lib/store/AsyncRowStore.d.ts +66 -66
  16. package/lib/store/CascadeStore.d.ts +109 -109
  17. package/lib/store/CascadeStore.js +1728 -1728
  18. package/lib/store/RelationAuth.js +1209 -1209
  19. package/lib/store/TriggerExecutor.js +468 -468
  20. package/lib/store/actionDef.js +278 -278
  21. package/lib/store/checker.js +487 -487
  22. package/lib/store/relation.d.ts +12 -12
  23. package/lib/store/relation.js +74 -74
  24. package/lib/triggers/index.d.ts +5 -5
  25. package/lib/triggers/index.js +28 -28
  26. package/lib/types/Configuration.d.ts +42 -42
  27. package/lib/types/Configuration.js +3 -3
  28. package/lib/types/Connector.d.ts +39 -39
  29. package/lib/types/Entity.d.ts +209 -209
  30. package/lib/types/Sync.d.ts +74 -68
  31. package/lib/types/Sync.js +9 -9
  32. package/lib/types/index.d.ts +27 -27
  33. package/lib/types/index.js +30 -30
  34. package/lib/utils/SimpleConnector.d.ts +81 -81
  35. package/lib/utils/SimpleConnector.js +217 -217
  36. package/lib/utils/assert.d.ts +5 -5
  37. package/lib/utils/projection.d.ts +4 -4
  38. package/lib/utils/relationPath.d.ts +31 -31
  39. package/lib/utils/relationPath.js +202 -202
  40. package/package.json +51 -51
  41. package/src/entities/ActionAuth.ts +41 -41
  42. package/src/entities/I18n.ts +45 -45
  43. package/src/entities/Modi.ts +69 -69
  44. package/src/entities/ModiEntity.ts +26 -26
  45. package/src/entities/Oper.ts +48 -48
  46. package/src/entities/OperEntity.ts +27 -27
  47. package/src/entities/Path.ts +43 -43
  48. package/src/entities/Relation.ts +43 -43
  49. package/src/entities/RelationAuth.ts +44 -44
  50. package/src/entities/User.ts +48 -48
  51. package/src/entities/UserEntityClaim.ts +29 -29
  52. package/src/entities/UserEntityGrant.ts +24 -24
  53. package/src/entities/UserRelation.ts +50 -50
@@ -1,8 +1,8 @@
1
- export declare const ActionDefDict: {
2
- modi: {
3
- iState: import("../types").ActionDef<string, string>;
4
- };
5
- user: {
6
- userState: import("../types").ActionDef<string, string>;
7
- };
8
- };
1
+ export declare const ActionDefDict: {
2
+ modi: {
3
+ iState: import("../types").ActionDef<string, string>;
4
+ };
5
+ user: {
6
+ userState: import("../types").ActionDef<string, string>;
7
+ };
8
+ };
@@ -1,158 +1,158 @@
1
- import { ForeignKey } from "../../types/DataType";
2
- import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
3
- import { OneOf } from "../../types/Polyfill";
4
- import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "../../types/Entity";
5
- import { AppendOnlyAction } from "../../actions/action";
6
- import { String, Datetime } from "../../types/DataType";
7
- import * as User from "../User/Schema";
8
- import * as OperEntity from "../OperEntity/Schema";
9
- export type OpSchema = EntityShape & {
10
- action: String<16>;
11
- data: Object;
12
- filter?: Object | null;
13
- extra?: Object | null;
14
- operatorId?: ForeignKey<"user"> | null;
15
- targetEntity: String<32>;
16
- bornAt: Datetime;
17
- };
18
- export type OpAttr = keyof OpSchema;
19
- export type Schema = EntityShape & {
20
- action: String<16>;
21
- data: Object;
22
- filter?: Object | null;
23
- extra?: Object | null;
24
- operatorId?: ForeignKey<"user"> | null;
25
- targetEntity: String<32>;
26
- bornAt: Datetime;
27
- operator?: User.Schema | null;
28
- operEntity$oper?: Array<OperEntity.Schema>;
29
- operEntity$oper$$aggr?: AggregationResult<OperEntity.Schema>;
30
- } & {
31
- [A in ExpressionKey]?: any;
32
- };
33
- type AttrFilter = {
34
- id: Q_StringValue;
35
- $$createAt$$: Q_DateValue;
36
- $$seq$$: Q_NumberValue;
37
- $$updateAt$$: Q_DateValue;
38
- action: Q_StringValue;
39
- data: Object;
40
- filter: Object;
41
- extra: Object;
42
- operatorId: Q_StringValue;
43
- operator: User.Filter;
44
- targetEntity: Q_StringValue;
45
- bornAt: Q_DateValue;
46
- operEntity$oper: OperEntity.Filter & SubQueryPredicateMetadata;
47
- };
48
- export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
49
- export type Projection = {
50
- "#id"?: NodeId;
51
- [k: string]: any;
52
- id?: number;
53
- $$createAt$$?: number;
54
- $$updateAt$$?: number;
55
- $$seq$$?: number;
56
- action?: number;
57
- data?: number | Object;
58
- filter?: number | Object;
59
- extra?: number | Object;
60
- operatorId?: number;
61
- operator?: User.Projection;
62
- targetEntity?: number;
63
- bornAt?: number;
64
- operEntity$oper?: OperEntity.Selection & {
65
- $entity: "operEntity";
66
- };
67
- operEntity$oper$$aggr?: OperEntity.Aggregation & {
68
- $entity: "operEntity";
69
- };
70
- } & Partial<ExprOp<OpAttr | string>>;
71
- type OperIdProjection = OneOf<{
72
- id: number;
73
- }>;
74
- type UserIdProjection = OneOf<{
75
- operatorId: number;
76
- }>;
77
- export type SortAttr = {
78
- id: number;
79
- } | {
80
- $$createAt$$: number;
81
- } | {
82
- $$seq$$: number;
83
- } | {
84
- $$updateAt$$: number;
85
- } | {
86
- action: number;
87
- } | {
88
- operatorId: number;
89
- } | {
90
- operator: User.SortAttr;
91
- } | {
92
- targetEntity: number;
93
- } | {
94
- bornAt: number;
95
- } | {
96
- [k: string]: any;
97
- } | OneOf<ExprOp<OpAttr | string>>;
98
- export type SortNode = {
99
- $attr: SortAttr;
100
- $direction?: "asc" | "desc";
101
- };
102
- export type Sorter = SortNode[];
103
- export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
104
- export type Selection<P extends Object = Projection> = SelectOperation<P>;
105
- export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
106
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
107
- operatorId?: never;
108
- operator?: User.CreateSingleOperation;
109
- } | {
110
- operatorId: ForeignKey<"operator">;
111
- operator?: User.UpdateOperation;
112
- } | {
113
- operator?: never;
114
- operatorId?: ForeignKey<"operator">;
115
- })) & {
116
- operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
117
- };
118
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
119
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
120
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
121
- export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
122
- operator?: User.CreateSingleOperation;
123
- operatorId?: never;
124
- } | {
125
- operator?: User.UpdateOperation;
126
- operatorId?: never;
127
- } | {
128
- operator?: User.RemoveOperation;
129
- operatorId?: never;
130
- } | {
131
- operator?: never;
132
- operatorId?: ForeignKey<"operator"> | null;
133
- })) & {
134
- [k: string]: any;
135
- operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
136
- };
137
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
138
- export type RemoveOperationData = {} & (({
139
- operator?: User.UpdateOperation | User.RemoveOperation;
140
- }));
141
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
142
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
143
- export type UserIdSubQuery = Selection<UserIdProjection>;
144
- export type OperIdSubQuery = Selection<OperIdProjection>;
145
- export type EntityDef = {
146
- Schema: Schema;
147
- OpSchema: OpSchema;
148
- Action: OakMakeAction<AppendOnlyAction> | string;
149
- Selection: Selection;
150
- Aggregation: Aggregation;
151
- Operation: Operation;
152
- Create: CreateOperation;
153
- Update: UpdateOperation;
154
- Remove: RemoveOperation;
155
- CreateSingle: CreateSingleOperation;
156
- CreateMulti: CreateMultipleOperation;
157
- };
158
- export {};
1
+ import { ForeignKey } from "../../types/DataType";
2
+ import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
3
+ import { OneOf } from "../../types/Polyfill";
4
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "../../types/Entity";
5
+ import { AppendOnlyAction } from "../../actions/action";
6
+ import { String, Datetime } from "../../types/DataType";
7
+ import * as User from "../User/Schema";
8
+ import * as OperEntity from "../OperEntity/Schema";
9
+ export type OpSchema = EntityShape & {
10
+ action: String<16>;
11
+ data: Object;
12
+ filter?: Object | null;
13
+ extra?: Object | null;
14
+ operatorId?: ForeignKey<"user"> | null;
15
+ targetEntity: String<32>;
16
+ bornAt: Datetime;
17
+ };
18
+ export type OpAttr = keyof OpSchema;
19
+ export type Schema = EntityShape & {
20
+ action: String<16>;
21
+ data: Object;
22
+ filter?: Object | null;
23
+ extra?: Object | null;
24
+ operatorId?: ForeignKey<"user"> | null;
25
+ targetEntity: String<32>;
26
+ bornAt: Datetime;
27
+ operator?: User.Schema | null;
28
+ operEntity$oper?: Array<OperEntity.Schema>;
29
+ operEntity$oper$$aggr?: AggregationResult<OperEntity.Schema>;
30
+ } & {
31
+ [A in ExpressionKey]?: any;
32
+ };
33
+ type AttrFilter = {
34
+ id: Q_StringValue;
35
+ $$createAt$$: Q_DateValue;
36
+ $$seq$$: Q_NumberValue;
37
+ $$updateAt$$: Q_DateValue;
38
+ action: Q_StringValue;
39
+ data: Object;
40
+ filter: Object;
41
+ extra: Object;
42
+ operatorId: Q_StringValue;
43
+ operator: User.Filter;
44
+ targetEntity: Q_StringValue;
45
+ bornAt: Q_DateValue;
46
+ operEntity$oper: OperEntity.Filter & SubQueryPredicateMetadata;
47
+ };
48
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
49
+ export type Projection = {
50
+ "#id"?: NodeId;
51
+ [k: string]: any;
52
+ id?: number;
53
+ $$createAt$$?: number;
54
+ $$updateAt$$?: number;
55
+ $$seq$$?: number;
56
+ action?: number;
57
+ data?: number | Object;
58
+ filter?: number | Object;
59
+ extra?: number | Object;
60
+ operatorId?: number;
61
+ operator?: User.Projection;
62
+ targetEntity?: number;
63
+ bornAt?: number;
64
+ operEntity$oper?: OperEntity.Selection & {
65
+ $entity: "operEntity";
66
+ };
67
+ operEntity$oper$$aggr?: OperEntity.Aggregation & {
68
+ $entity: "operEntity";
69
+ };
70
+ } & Partial<ExprOp<OpAttr | string>>;
71
+ type OperIdProjection = OneOf<{
72
+ id: number;
73
+ }>;
74
+ type UserIdProjection = OneOf<{
75
+ operatorId: number;
76
+ }>;
77
+ export type SortAttr = {
78
+ id: number;
79
+ } | {
80
+ $$createAt$$: number;
81
+ } | {
82
+ $$seq$$: number;
83
+ } | {
84
+ $$updateAt$$: number;
85
+ } | {
86
+ action: number;
87
+ } | {
88
+ operatorId: number;
89
+ } | {
90
+ operator: User.SortAttr;
91
+ } | {
92
+ targetEntity: number;
93
+ } | {
94
+ bornAt: number;
95
+ } | {
96
+ [k: string]: any;
97
+ } | OneOf<ExprOp<OpAttr | string>>;
98
+ export type SortNode = {
99
+ $attr: SortAttr;
100
+ $direction?: "asc" | "desc";
101
+ };
102
+ export type Sorter = SortNode[];
103
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
104
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
105
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
106
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
107
+ operatorId?: never;
108
+ operator?: User.CreateSingleOperation;
109
+ } | {
110
+ operatorId: ForeignKey<"operator">;
111
+ operator?: User.UpdateOperation;
112
+ } | {
113
+ operator?: never;
114
+ operatorId?: ForeignKey<"operator">;
115
+ })) & {
116
+ operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
117
+ };
118
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
119
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
120
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
121
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
122
+ operator?: User.CreateSingleOperation;
123
+ operatorId?: never;
124
+ } | {
125
+ operator?: User.UpdateOperation;
126
+ operatorId?: never;
127
+ } | {
128
+ operator?: User.RemoveOperation;
129
+ operatorId?: never;
130
+ } | {
131
+ operator?: never;
132
+ operatorId?: ForeignKey<"operator"> | null;
133
+ })) & {
134
+ [k: string]: any;
135
+ operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
136
+ };
137
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
138
+ export type RemoveOperationData = {} & (({
139
+ operator?: User.UpdateOperation | User.RemoveOperation;
140
+ }));
141
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
142
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
143
+ export type UserIdSubQuery = Selection<UserIdProjection>;
144
+ export type OperIdSubQuery = Selection<OperIdProjection>;
145
+ export type EntityDef = {
146
+ Schema: Schema;
147
+ OpSchema: OpSchema;
148
+ Action: OakMakeAction<AppendOnlyAction> | string;
149
+ Selection: Selection;
150
+ Aggregation: Aggregation;
151
+ Operation: Operation;
152
+ Create: CreateOperation;
153
+ Update: UpdateOperation;
154
+ Remove: RemoveOperation;
155
+ CreateSingle: CreateSingleOperation;
156
+ CreateMulti: CreateMultipleOperation;
157
+ };
158
+ export {};
@@ -1,56 +1,56 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.desc = void 0;
4
- const action_1 = require("../../actions/action");
5
- exports.desc = {
6
- attributes: {
7
- action: {
8
- notNull: true,
9
- type: "varchar",
10
- params: {
11
- length: 16
12
- }
13
- },
14
- data: {
15
- notNull: true,
16
- type: "object"
17
- },
18
- filter: {
19
- type: "object"
20
- },
21
- extra: {
22
- type: "object"
23
- },
24
- operatorId: {
25
- type: "ref",
26
- ref: "user"
27
- },
28
- targetEntity: {
29
- notNull: true,
30
- type: "varchar",
31
- params: {
32
- length: 32
33
- }
34
- },
35
- bornAt: {
36
- notNull: true,
37
- type: "datetime"
38
- }
39
- },
40
- actionType: "appendOnly",
41
- actions: action_1.appendOnlyActions,
42
- indexes: [
43
- {
44
- name: 'index_bornAt_operatorId',
45
- attributes: [
46
- {
47
- name: 'bornAt',
48
- direction: 'DESC',
49
- },
50
- {
51
- name: "operatorId",
52
- },
53
- ]
54
- }
55
- ]
56
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.desc = void 0;
4
+ const action_1 = require("../../actions/action");
5
+ exports.desc = {
6
+ attributes: {
7
+ action: {
8
+ notNull: true,
9
+ type: "varchar",
10
+ params: {
11
+ length: 16
12
+ }
13
+ },
14
+ data: {
15
+ notNull: true,
16
+ type: "object"
17
+ },
18
+ filter: {
19
+ type: "object"
20
+ },
21
+ extra: {
22
+ type: "object"
23
+ },
24
+ operatorId: {
25
+ type: "ref",
26
+ ref: "user"
27
+ },
28
+ targetEntity: {
29
+ notNull: true,
30
+ type: "varchar",
31
+ params: {
32
+ length: 32
33
+ }
34
+ },
35
+ bornAt: {
36
+ notNull: true,
37
+ type: "datetime"
38
+ }
39
+ },
40
+ actionType: "appendOnly",
41
+ actions: action_1.appendOnlyActions,
42
+ indexes: [
43
+ {
44
+ name: 'index_bornAt_operatorId',
45
+ attributes: [
46
+ {
47
+ name: 'bornAt',
48
+ direction: 'DESC',
49
+ },
50
+ {
51
+ name: "operatorId",
52
+ },
53
+ ]
54
+ }
55
+ ]
56
+ };
@@ -1,11 +1,11 @@
1
- import { ActionDef } from "../../types/Action";
2
- import { GenericAction, RelationAction } from "../../actions/action";
3
- export type UserAction = 'mergeTo' | string;
4
- export type UserState = 'normal' | 'merged' | string;
5
- export type ParticularAction = UserAction;
6
- export declare const actions: string[];
7
- export declare const UserActionDef: ActionDef<UserAction, UserState>;
8
- export type Action = GenericAction | ParticularAction | RelationAction | string;
9
- export declare const ActionDefDict: {
10
- userState: ActionDef<string, string>;
11
- };
1
+ import { ActionDef } from "../../types/Action";
2
+ import { GenericAction, RelationAction } from "../../actions/action";
3
+ export type UserAction = 'mergeTo' | string;
4
+ export type UserState = 'normal' | 'merged' | string;
5
+ export type ParticularAction = UserAction;
6
+ export declare const actions: string[];
7
+ export declare const UserActionDef: ActionDef<UserAction, UserState>;
8
+ export type Action = GenericAction | ParticularAction | RelationAction | string;
9
+ export declare const ActionDefDict: {
10
+ userState: ActionDef<string, string>;
11
+ };
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionDefDict = exports.UserActionDef = exports.actions = void 0;
4
- exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "grant", "revoke", "mergeTo"];
5
- exports.UserActionDef = {
6
- stm: {
7
- mergeTo: ['normal', 'merged'],
8
- },
9
- };
10
- exports.ActionDefDict = {
11
- userState: exports.UserActionDef
12
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionDefDict = exports.UserActionDef = exports.actions = void 0;
4
+ exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "grant", "revoke", "mergeTo"];
5
+ exports.UserActionDef = {
6
+ stm: {
7
+ mergeTo: ['normal', 'merged'],
8
+ },
9
+ };
10
+ exports.ActionDefDict = {
11
+ userState: exports.UserActionDef
12
+ };
@@ -1,5 +1,5 @@
1
- import { GenericAction } from "../../actions/action";
2
- export type ParticularAction = 'confirm';
3
- export declare const actions: string[];
4
- export type Action = GenericAction | ParticularAction | string;
5
- export declare const ActionDefDict: {};
1
+ import { GenericAction } from "../../actions/action";
2
+ export type ParticularAction = 'confirm';
3
+ export declare const actions: string[];
4
+ export type Action = GenericAction | ParticularAction | string;
5
+ export declare const ActionDefDict: {};
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionDefDict = exports.actions = void 0;
4
- exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "confirm"];
5
- exports.ActionDefDict = {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionDefDict = exports.actions = void 0;
4
+ exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "confirm"];
5
+ exports.ActionDefDict = {};