oak-domain 5.1.15 → 5.1.17

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 (99) hide show
  1. package/lib/base-app-domain/ActionAuth/Schema.d.ts +19 -171
  2. package/lib/base-app-domain/ActionAuth/Schema.js +2 -0
  3. package/lib/base-app-domain/ActionAuth/_baseSchema.d.ts +44 -0
  4. package/lib/base-app-domain/ActionAuth/_baseSchema.js +2 -0
  5. package/lib/base-app-domain/EntityDict.d.ts +695 -14
  6. package/lib/base-app-domain/I18n/Schema.d.ts +19 -129
  7. package/lib/base-app-domain/I18n/Schema.js +2 -0
  8. package/lib/base-app-domain/I18n/_baseSchema.d.ts +51 -0
  9. package/lib/base-app-domain/I18n/_baseSchema.js +2 -0
  10. package/lib/base-app-domain/Log/Schema.d.ts +19 -141
  11. package/lib/base-app-domain/Log/Schema.js +2 -0
  12. package/lib/base-app-domain/Log/Style.d.ts +2 -2
  13. package/lib/base-app-domain/Log/_baseSchema.d.ts +44 -0
  14. package/lib/base-app-domain/Log/_baseSchema.js +2 -0
  15. package/lib/base-app-domain/Modi/Schema.d.ts +19 -130
  16. package/lib/base-app-domain/Modi/Schema.js +2 -0
  17. package/lib/base-app-domain/Modi/Style.d.ts +2 -2
  18. package/lib/base-app-domain/Modi/_baseSchema.d.ts +61 -0
  19. package/lib/base-app-domain/Modi/_baseSchema.js +2 -0
  20. package/lib/base-app-domain/ModiEntity/Schema.d.ts +19 -367
  21. package/lib/base-app-domain/ModiEntity/Schema.js +2 -0
  22. package/lib/base-app-domain/ModiEntity/Storage.js +1 -2
  23. package/lib/base-app-domain/ModiEntity/_baseSchema.d.ts +44 -0
  24. package/lib/base-app-domain/ModiEntity/_baseSchema.js +2 -0
  25. package/lib/base-app-domain/Oper/Schema.d.ts +19 -201
  26. package/lib/base-app-domain/Oper/Schema.js +2 -0
  27. package/lib/base-app-domain/Oper/Style.d.ts +2 -2
  28. package/lib/base-app-domain/Oper/_baseSchema.d.ts +67 -0
  29. package/lib/base-app-domain/Oper/_baseSchema.js +2 -0
  30. package/lib/base-app-domain/OperEntity/Schema.d.ts +19 -367
  31. package/lib/base-app-domain/OperEntity/Schema.js +2 -0
  32. package/lib/base-app-domain/OperEntity/Storage.js +1 -2
  33. package/lib/base-app-domain/OperEntity/_baseSchema.d.ts +44 -0
  34. package/lib/base-app-domain/OperEntity/_baseSchema.js +2 -0
  35. package/lib/base-app-domain/Path/Schema.d.ts +19 -157
  36. package/lib/base-app-domain/Path/Schema.js +2 -0
  37. package/lib/base-app-domain/Path/_baseSchema.d.ts +52 -0
  38. package/lib/base-app-domain/Path/_baseSchema.js +2 -0
  39. package/lib/base-app-domain/Relation/Schema.d.ts +19 -198
  40. package/lib/base-app-domain/Relation/Schema.js +2 -0
  41. package/lib/base-app-domain/Relation/_baseSchema.d.ts +48 -0
  42. package/lib/base-app-domain/Relation/_baseSchema.js +2 -0
  43. package/lib/base-app-domain/RelationAuth/Schema.d.ts +19 -199
  44. package/lib/base-app-domain/RelationAuth/Schema.js +2 -0
  45. package/lib/base-app-domain/RelationAuth/_baseSchema.d.ts +41 -0
  46. package/lib/base-app-domain/RelationAuth/_baseSchema.js +2 -0
  47. package/lib/base-app-domain/User/Schema.d.ts +19 -222
  48. package/lib/base-app-domain/User/Schema.js +2 -0
  49. package/lib/base-app-domain/User/Style.d.ts +2 -2
  50. package/lib/base-app-domain/User/_baseSchema.d.ts +53 -0
  51. package/lib/base-app-domain/User/_baseSchema.js +2 -0
  52. package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +19 -264
  53. package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -0
  54. package/lib/base-app-domain/UserEntityClaim/_baseSchema.d.ts +49 -0
  55. package/lib/base-app-domain/UserEntityClaim/_baseSchema.js +2 -0
  56. package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +19 -136
  57. package/lib/base-app-domain/UserEntityGrant/Schema.js +2 -0
  58. package/lib/base-app-domain/UserEntityGrant/_baseSchema.d.ts +46 -0
  59. package/lib/base-app-domain/UserEntityGrant/_baseSchema.js +2 -0
  60. package/lib/base-app-domain/UserRelation/Schema.d.ts +19 -212
  61. package/lib/base-app-domain/UserRelation/Schema.js +2 -0
  62. package/lib/base-app-domain/UserRelation/_baseSchema.d.ts +47 -0
  63. package/lib/base-app-domain/UserRelation/_baseSchema.js +2 -0
  64. package/lib/compiler/localeBuilder.d.ts +1 -0
  65. package/lib/compiler/localeBuilder.js +9 -2
  66. package/lib/compiler/schemalBuilder.d.ts +1 -0
  67. package/lib/compiler/schemalBuilder.js +1368 -186
  68. package/lib/data/i18n.d.ts +3 -0
  69. package/lib/data/i18n.js +32 -0
  70. package/lib/store/CascadeStore.d.ts +3 -3
  71. package/lib/store/CascadeStore.js +60 -54
  72. package/lib/store/RelationAuth.d.ts +1 -1
  73. package/lib/store/RelationAuth.js +6 -6
  74. package/lib/store/TriggerExecutor.js +11 -5
  75. package/lib/store/checker.js +4 -4
  76. package/lib/store/filter.d.ts +11 -11
  77. package/lib/store/filter.js +14 -8
  78. package/lib/store/modi.d.ts +2 -2
  79. package/lib/store/modi.js +72 -70
  80. package/lib/store/triggers.js +14 -14
  81. package/lib/timers/vaccum.d.ts +1 -1
  82. package/lib/types/Auth.d.ts +6 -5
  83. package/lib/types/Cluster.d.ts +1 -0
  84. package/lib/types/Configuration.d.ts +9 -0
  85. package/lib/types/Entity.d.ts +5 -1
  86. package/lib/types/EntityDesc.d.ts +1 -1
  87. package/lib/types/Exception.d.ts +26 -21
  88. package/lib/types/Exception.js +81 -71
  89. package/lib/types/Expression.d.ts +4 -1
  90. package/lib/types/Port.d.ts +1 -1
  91. package/lib/types/Trigger.d.ts +1 -1
  92. package/lib/types/Watcher.d.ts +3 -3
  93. package/lib/utils/projection.d.ts +2 -2
  94. package/lib/utils/relationPath.d.ts +4 -4
  95. package/lib/utils/relationPath.js +1 -1
  96. package/lib/utils/row.d.ts +8 -0
  97. package/lib/utils/row.js +8 -0
  98. package/lib/utils/validator.d.ts +2 -2
  99. package/package.json +2 -2
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,136 +1,19 @@
1
- import { JsonProjection } from "../../types/DataType";
2
- import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, 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 { GenericAction } from "../../actions/action";
6
- import { String } from "../../types/DataType";
7
- import * as UserEntityClaim from "../UserEntityClaim/Schema";
8
- import * as ModiEntity from "../ModiEntity/Schema";
9
- import * as OperEntity from "../OperEntity/Schema";
10
- type RelationIds = string[];
11
- export type OpSchema = EntityShape & {
12
- relationEntity: String<32>;
13
- relationEntityFilter: Object;
14
- relationIds: RelationIds;
15
- };
16
- export type OpAttr = keyof OpSchema;
17
- type UserEntityClaim$uegAggr = "userEntityClaim$ueg$$aggr" | "userEntityClaim$ueg$$0$$aggr" | "userEntityClaim$ueg$$1$$aggr" | "userEntityClaim$ueg$$2$$aggr" | "userEntityClaim$ueg$$3$$aggr" | "userEntityClaim$ueg$$4$$aggr" | "userEntityClaim$ueg$$5$$aggr" | "userEntityClaim$ueg$$6$$aggr" | "userEntityClaim$ueg$$7$$aggr" | "userEntityClaim$ueg$$8$$aggr" | "userEntityClaim$ueg$$9$$aggr";
18
- type ModiEntity$entityAggr = "modiEntity$entity$$aggr" | "modiEntity$entity$$0$$aggr" | "modiEntity$entity$$1$$aggr" | "modiEntity$entity$$2$$aggr" | "modiEntity$entity$$3$$aggr" | "modiEntity$entity$$4$$aggr" | "modiEntity$entity$$5$$aggr" | "modiEntity$entity$$6$$aggr" | "modiEntity$entity$$7$$aggr" | "modiEntity$entity$$8$$aggr" | "modiEntity$entity$$9$$aggr";
19
- type OperEntity$entityAggr = "operEntity$entity$$aggr" | "operEntity$entity$$0$$aggr" | "operEntity$entity$$1$$aggr" | "operEntity$entity$$2$$aggr" | "operEntity$entity$$3$$aggr" | "operEntity$entity$$4$$aggr" | "operEntity$entity$$5$$aggr" | "operEntity$entity$$6$$aggr" | "operEntity$entity$$7$$aggr" | "operEntity$entity$$8$$aggr" | "operEntity$entity$$9$$aggr";
20
- export type Schema = OpSchema & {
21
- userEntityClaim$ueg?: Array<UserEntityClaim.Schema>;
22
- modiEntity$entity?: Array<ModiEntity.Schema>;
23
- operEntity$entity?: Array<OperEntity.Schema>;
24
- } & {
25
- [A in ExpressionKey]?: any;
26
- } & {
27
- [A in UserEntityClaim$uegAggr]?: AggregationResult<UserEntityClaim.Schema>;
28
- } & {
29
- [A in ModiEntity$entityAggr]?: AggregationResult<ModiEntity.Schema>;
30
- } & {
31
- [A in OperEntity$entityAggr]?: AggregationResult<OperEntity.Schema>;
32
- };
33
- type AttrFilter = {
34
- id: Q_StringValue;
35
- $$createAt$$: Q_DateValue;
36
- $$seq$$: Q_NumberValue;
37
- $$updateAt$$: Q_DateValue;
38
- relationEntity: Q_StringValue;
39
- relationEntityFilter: Object;
40
- relationIds: JsonFilter<RelationIds>;
41
- userEntityClaim$ueg: UserEntityClaim.Filter & SubQueryPredicateMetadata;
42
- modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
43
- operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
44
- };
45
- export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
46
- export type Projection = {
47
- "#id"?: NodeId;
48
- [k: string]: any;
49
- id?: number;
50
- $$createAt$$?: number;
51
- $$updateAt$$?: number;
52
- $$seq$$?: number;
53
- relationEntity?: number;
54
- relationEntityFilter?: number | Object;
55
- relationIds?: number | JsonProjection<RelationIds>;
56
- userEntityClaim$ueg?: UserEntityClaim.Selection & {
57
- $entity: "userEntityClaim";
58
- };
59
- modiEntity$entity?: ModiEntity.Selection & {
60
- $entity: "modiEntity";
61
- };
62
- operEntity$entity?: OperEntity.Selection & {
63
- $entity: "operEntity";
64
- };
65
- } & Partial<ExprOp<OpAttr | string>> & {
66
- [A in UserEntityClaim$uegAggr]?: UserEntityClaim.Aggregation & {
67
- $entity: "userEntityClaim";
68
- };
69
- } & {
70
- [A in ModiEntity$entityAggr]?: ModiEntity.Aggregation & {
71
- $entity: "modiEntity";
72
- };
73
- } & {
74
- [A in OperEntity$entityAggr]?: OperEntity.Aggregation & {
75
- $entity: "operEntity";
76
- };
77
- };
78
- type UserEntityGrantIdProjection = OneOf<{
79
- id: number;
80
- }>;
81
- export type SortAttr = {
82
- id: number;
83
- } | {
84
- $$createAt$$: number;
85
- } | {
86
- $$seq$$: number;
87
- } | {
88
- $$updateAt$$: number;
89
- } | {
90
- relationEntity: number;
91
- } | {
92
- relationIds: number;
93
- } | {
94
- [k: string]: any;
95
- } | OneOf<ExprOp<OpAttr | string>>;
96
- export type SortNode = {
97
- $attr: SortAttr;
98
- $direction?: "asc" | "desc";
99
- };
100
- export type Sorter = SortNode[];
101
- export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
102
- export type Selection<P extends Object = Projection> = SelectOperation<P>;
103
- export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
104
- export type CreateOperationData = FormCreateData<OpSchema> & {
105
- userEntityClaim$ueg?: OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "ueg" | "uegId">, Omit<UserEntityClaim.Filter, "ueg" | "uegId">> | OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "ueg" | "uegId">[]> | Array<OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "ueg" | "uegId">> | OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "ueg" | "uegId">, Omit<UserEntityClaim.Filter, "ueg" | "uegId">>>;
106
- modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
107
- operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
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
- userEntityClaim$ueg?: OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "ueg" | "uegId">, Omit<UserEntityClaim.Filter, "ueg" | "uegId">> | OakOperation<UserEntityClaim.RemoveOperation["action"], Omit<UserEntityClaim.RemoveOperationData, "ueg" | "uegId">, Omit<UserEntityClaim.Filter, "ueg" | "uegId">> | OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "ueg" | "uegId">[]> | Array<OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "ueg" | "uegId">> | OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "ueg" | "uegId">, Omit<UserEntityClaim.Filter, "ueg" | "uegId">> | OakOperation<UserEntityClaim.RemoveOperation["action"], Omit<UserEntityClaim.RemoveOperationData, "ueg" | "uegId">, Omit<UserEntityClaim.Filter, "ueg" | "uegId">>>;
115
- modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
116
- operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
117
- };
118
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
119
- export type RemoveOperationData = {};
120
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
121
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
122
- export type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
123
- export type EntityDef = {
124
- Schema: Schema;
125
- OpSchema: OpSchema;
126
- Action: OakMakeAction<GenericAction> | string;
127
- Selection: Selection;
128
- Aggregation: Aggregation;
129
- Operation: Operation;
130
- Create: CreateOperation;
131
- Update: UpdateOperation;
132
- Remove: RemoveOperation;
133
- CreateSingle: CreateSingleOperation;
134
- CreateMulti: CreateMultipleOperation;
135
- };
136
- export {};
1
+ export * from "./_baseSchema";
2
+ import { UserEntityGrant } from "../EntityDict";
3
+ export type Schema = UserEntityGrant["Schema"];
4
+ export type Action = UserEntityGrant["Action"];
5
+ export type Projection = UserEntityGrant["Projection"];
6
+ export type Filter = UserEntityGrant["Filter"];
7
+ export type SortNode = UserEntityGrant["SortNode"];
8
+ export type Sorter = UserEntityGrant["Sorter"];
9
+ export type Selection = UserEntityGrant["Selection"];
10
+ export type Aggregation = UserEntityGrant["Aggregation"];
11
+ export type CreateOperationData = UserEntityGrant["CreateOperationData"];
12
+ export type CreateSingle = UserEntityGrant["CreateSingle"];
13
+ export type CreateMulti = UserEntityGrant["CreateMulti"];
14
+ export type Create = UserEntityGrant["Create"];
15
+ export type UpdateOperationData = UserEntityGrant["UpdateOperationData"];
16
+ export type Update = UserEntityGrant["Update"];
17
+ export type RemoveOperationData = UserEntityGrant["RemoveOperationData"];
18
+ export type Remove = UserEntityGrant["Remove"];
19
+ export type Operation = UserEntityGrant["Operation"];
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./_baseSchema"), exports);
@@ -0,0 +1,46 @@
1
+ import { JsonProjection } from "../../types/DataType";
2
+ import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey, JsonFilter } from "../../types/Demand";
3
+ import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
4
+ import { GenericAction } from "../../actions/action";
5
+ import { String } from "../../types/DataType";
6
+ type RelationIds = string[];
7
+ export type OpSchema = EntityShape & {
8
+ relationEntity: String<32>;
9
+ relationEntityFilter: Object;
10
+ relationIds: RelationIds;
11
+ } & {
12
+ [A in ExpressionKey]?: any;
13
+ };
14
+ export type OpAttr = keyof OpSchema;
15
+ export type OpFilter = {
16
+ id: Q_StringValue;
17
+ $$createAt$$: Q_DateValue;
18
+ $$seq$$: Q_NumberValue;
19
+ $$updateAt$$: Q_DateValue;
20
+ relationEntity: Q_StringValue;
21
+ relationEntityFilter: Object;
22
+ relationIds: JsonFilter<RelationIds>;
23
+ } & ExprOp<OpAttr | string>;
24
+ export type OpProjection = {
25
+ "#id"?: NodeId;
26
+ [k: string]: any;
27
+ id?: number;
28
+ $$createAt$$?: number;
29
+ $$updateAt$$?: number;
30
+ $$seq$$?: number;
31
+ relationEntity?: number;
32
+ relationEntityFilter?: number | Object;
33
+ relationIds?: number | JsonProjection<RelationIds>;
34
+ } & Partial<ExprOp<OpAttr | string>>;
35
+ export type OpSortAttr = Partial<{
36
+ id: number;
37
+ $$createAt$$: number;
38
+ $$seq$$: number;
39
+ $$updateAt$$: number;
40
+ relationEntity: number;
41
+ relationIds: number;
42
+ [k: string]: any;
43
+ } | ExprOp<OpAttr | string>>;
44
+ export type OpAction = OakMakeAction<GenericAction | string>;
45
+ export type OpUpdateAction = "update" | string;
46
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,212 +1,19 @@
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 { GenericAction } from "../../actions/action";
6
- import { String } from "../../types/DataType";
7
- import * as User from "../User/Schema";
8
- import * as Relation from "../Relation/Schema";
9
- import * as UserEntityClaim from "../UserEntityClaim/Schema";
10
- import * as ModiEntity from "../ModiEntity/Schema";
11
- import * as OperEntity from "../OperEntity/Schema";
12
- export type OpSchema = EntityShape & {
13
- userId: ForeignKey<"user">;
14
- relationId: ForeignKey<"relation">;
15
- entity: String<32>;
16
- entityId: String<64>;
17
- };
18
- export type OpAttr = keyof OpSchema;
19
- type UserEntityClaim$userRelationAggr = "userEntityClaim$userRelation$$aggr" | "userEntityClaim$userRelation$$0$$aggr" | "userEntityClaim$userRelation$$1$$aggr" | "userEntityClaim$userRelation$$2$$aggr" | "userEntityClaim$userRelation$$3$$aggr" | "userEntityClaim$userRelation$$4$$aggr" | "userEntityClaim$userRelation$$5$$aggr" | "userEntityClaim$userRelation$$6$$aggr" | "userEntityClaim$userRelation$$7$$aggr" | "userEntityClaim$userRelation$$8$$aggr" | "userEntityClaim$userRelation$$9$$aggr";
20
- type ModiEntity$entityAggr = "modiEntity$entity$$aggr" | "modiEntity$entity$$0$$aggr" | "modiEntity$entity$$1$$aggr" | "modiEntity$entity$$2$$aggr" | "modiEntity$entity$$3$$aggr" | "modiEntity$entity$$4$$aggr" | "modiEntity$entity$$5$$aggr" | "modiEntity$entity$$6$$aggr" | "modiEntity$entity$$7$$aggr" | "modiEntity$entity$$8$$aggr" | "modiEntity$entity$$9$$aggr";
21
- type OperEntity$entityAggr = "operEntity$entity$$aggr" | "operEntity$entity$$0$$aggr" | "operEntity$entity$$1$$aggr" | "operEntity$entity$$2$$aggr" | "operEntity$entity$$3$$aggr" | "operEntity$entity$$4$$aggr" | "operEntity$entity$$5$$aggr" | "operEntity$entity$$6$$aggr" | "operEntity$entity$$7$$aggr" | "operEntity$entity$$8$$aggr" | "operEntity$entity$$9$$aggr";
22
- export type Schema = OpSchema & {
23
- user: User.Schema;
24
- relation: Relation.Schema;
25
- userEntityClaim$userRelation?: Array<UserEntityClaim.Schema>;
26
- modiEntity$entity?: Array<ModiEntity.Schema>;
27
- operEntity$entity?: Array<OperEntity.Schema>;
28
- } & {
29
- [A in ExpressionKey]?: any;
30
- } & {
31
- [A in UserEntityClaim$userRelationAggr]?: AggregationResult<UserEntityClaim.Schema>;
32
- } & {
33
- [A in ModiEntity$entityAggr]?: AggregationResult<ModiEntity.Schema>;
34
- } & {
35
- [A in OperEntity$entityAggr]?: AggregationResult<OperEntity.Schema>;
36
- };
37
- type AttrFilter = {
38
- id: Q_StringValue;
39
- $$createAt$$: Q_DateValue;
40
- $$seq$$: Q_NumberValue;
41
- $$updateAt$$: Q_DateValue;
42
- userId: Q_StringValue;
43
- user: User.Filter;
44
- relationId: Q_StringValue;
45
- relation: Relation.Filter;
46
- entity: Q_StringValue;
47
- entityId: Q_StringValue;
48
- userEntityClaim$userRelation: UserEntityClaim.Filter & SubQueryPredicateMetadata;
49
- modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
50
- operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
51
- };
52
- export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
53
- export type Projection = {
54
- "#id"?: NodeId;
55
- [k: string]: any;
56
- id?: number;
57
- $$createAt$$?: number;
58
- $$updateAt$$?: number;
59
- $$seq$$?: number;
60
- userId?: number;
61
- user?: User.Projection;
62
- relationId?: number;
63
- relation?: Relation.Projection;
64
- entity?: number;
65
- entityId?: number;
66
- userEntityClaim$userRelation?: UserEntityClaim.Selection & {
67
- $entity: "userEntityClaim";
68
- };
69
- modiEntity$entity?: ModiEntity.Selection & {
70
- $entity: "modiEntity";
71
- };
72
- operEntity$entity?: OperEntity.Selection & {
73
- $entity: "operEntity";
74
- };
75
- } & Partial<ExprOp<OpAttr | string>> & {
76
- [A in UserEntityClaim$userRelationAggr]?: UserEntityClaim.Aggregation & {
77
- $entity: "userEntityClaim";
78
- };
79
- } & {
80
- [A in ModiEntity$entityAggr]?: ModiEntity.Aggregation & {
81
- $entity: "modiEntity";
82
- };
83
- } & {
84
- [A in OperEntity$entityAggr]?: OperEntity.Aggregation & {
85
- $entity: "operEntity";
86
- };
87
- };
88
- type UserRelationIdProjection = OneOf<{
89
- id: number;
90
- }>;
91
- type UserIdProjection = OneOf<{
92
- userId: number;
93
- }>;
94
- type RelationIdProjection = OneOf<{
95
- relationId: number;
96
- }>;
97
- export type SortAttr = {
98
- id: number;
99
- } | {
100
- $$createAt$$: number;
101
- } | {
102
- $$seq$$: number;
103
- } | {
104
- $$updateAt$$: number;
105
- } | {
106
- userId: number;
107
- } | {
108
- user: User.SortAttr;
109
- } | {
110
- relationId: number;
111
- } | {
112
- relation: Relation.SortAttr;
113
- } | {
114
- entity: number;
115
- } | {
116
- entityId: number;
117
- } | {
118
- [k: string]: any;
119
- } | OneOf<ExprOp<OpAttr | string>>;
120
- export type SortNode = {
121
- $attr: SortAttr;
122
- $direction?: "asc" | "desc";
123
- };
124
- export type Sorter = SortNode[];
125
- export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
126
- export type Selection<P extends Object = Projection> = SelectOperation<P>;
127
- export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
128
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "userId" | "relationId">> & (({
129
- userId?: never;
130
- user: User.CreateSingleOperation;
131
- } | {
132
- userId: ForeignKey<"user">;
133
- user?: User.UpdateOperation;
134
- } | {
135
- user?: never;
136
- userId: ForeignKey<"user">;
137
- }) & ({
138
- relationId?: never;
139
- relation: Relation.CreateSingleOperation;
140
- } | {
141
- relationId: ForeignKey<"relation">;
142
- relation?: Relation.UpdateOperation;
143
- } | {
144
- relation?: never;
145
- relationId: ForeignKey<"relation">;
146
- })) & ({
147
- entity?: string;
148
- entityId?: string;
149
- [K: string]: any;
150
- }) & {
151
- userEntityClaim$userRelation?: OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "userRelation" | "userRelationId">, Omit<UserEntityClaim.Filter, "userRelation" | "userRelationId">> | OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "userRelation" | "userRelationId">[]> | Array<OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "userRelation" | "userRelationId">> | OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "userRelation" | "userRelationId">, Omit<UserEntityClaim.Filter, "userRelation" | "userRelationId">>>;
152
- modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
153
- operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
154
- };
155
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
156
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
157
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
158
- export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "relationId">> & (({
159
- user?: User.CreateSingleOperation;
160
- userId?: never;
161
- } | {
162
- user?: User.UpdateOperation;
163
- userId?: never;
164
- } | {
165
- user?: User.RemoveOperation;
166
- userId?: never;
167
- } | {
168
- user?: never;
169
- userId?: ForeignKey<"user">;
170
- }) & ({
171
- relation?: Relation.CreateSingleOperation;
172
- relationId?: never;
173
- } | {
174
- relation?: Relation.UpdateOperation;
175
- relationId?: never;
176
- } | {
177
- relation?: Relation.RemoveOperation;
178
- relationId?: never;
179
- } | {
180
- relation?: never;
181
- relationId?: ForeignKey<"relation">;
182
- })) & {
183
- [k: string]: any;
184
- userEntityClaim$userRelation?: OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "userRelation" | "userRelationId">, Omit<UserEntityClaim.Filter, "userRelation" | "userRelationId">> | OakOperation<UserEntityClaim.RemoveOperation["action"], Omit<UserEntityClaim.RemoveOperationData, "userRelation" | "userRelationId">, Omit<UserEntityClaim.Filter, "userRelation" | "userRelationId">> | OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "userRelation" | "userRelationId">[]> | Array<OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "userRelation" | "userRelationId">> | OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "userRelation" | "userRelationId">, Omit<UserEntityClaim.Filter, "userRelation" | "userRelationId">> | OakOperation<UserEntityClaim.RemoveOperation["action"], Omit<UserEntityClaim.RemoveOperationData, "userRelation" | "userRelationId">, Omit<UserEntityClaim.Filter, "userRelation" | "userRelationId">>>;
185
- modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
186
- operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
187
- };
188
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
189
- export type RemoveOperationData = {} & (({
190
- user?: User.UpdateOperation | User.RemoveOperation;
191
- }) & ({
192
- relation?: Relation.UpdateOperation | Relation.RemoveOperation;
193
- }));
194
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
195
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
196
- export type UserIdSubQuery = Selection<UserIdProjection>;
197
- export type RelationIdSubQuery = Selection<RelationIdProjection>;
198
- export type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
199
- export type EntityDef = {
200
- Schema: Schema;
201
- OpSchema: OpSchema;
202
- Action: OakMakeAction<GenericAction> | string;
203
- Selection: Selection;
204
- Aggregation: Aggregation;
205
- Operation: Operation;
206
- Create: CreateOperation;
207
- Update: UpdateOperation;
208
- Remove: RemoveOperation;
209
- CreateSingle: CreateSingleOperation;
210
- CreateMulti: CreateMultipleOperation;
211
- };
212
- export {};
1
+ export * from "./_baseSchema";
2
+ import { UserRelation } from "../EntityDict";
3
+ export type Schema = UserRelation["Schema"];
4
+ export type Action = UserRelation["Action"];
5
+ export type Projection = UserRelation["Projection"];
6
+ export type Filter = UserRelation["Filter"];
7
+ export type SortNode = UserRelation["SortNode"];
8
+ export type Sorter = UserRelation["Sorter"];
9
+ export type Selection = UserRelation["Selection"];
10
+ export type Aggregation = UserRelation["Aggregation"];
11
+ export type CreateOperationData = UserRelation["CreateOperationData"];
12
+ export type CreateSingle = UserRelation["CreateSingle"];
13
+ export type CreateMulti = UserRelation["CreateMulti"];
14
+ export type Create = UserRelation["Create"];
15
+ export type UpdateOperationData = UserRelation["UpdateOperationData"];
16
+ export type Update = UserRelation["Update"];
17
+ export type RemoveOperationData = UserRelation["RemoveOperationData"];
18
+ export type Remove = UserRelation["Remove"];
19
+ export type Operation = UserRelation["Operation"];
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./_baseSchema"), exports);
@@ -0,0 +1,47 @@
1
+ import { ForeignKey } from "../../types/DataType";
2
+ import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
3
+ import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
4
+ import { GenericAction } from "../../actions/action";
5
+ import { String } from "../../types/DataType";
6
+ export type OpSchema = EntityShape & {
7
+ userId: ForeignKey<"user">;
8
+ relationId: ForeignKey<"relation">;
9
+ entity: String<32>;
10
+ entityId: String<64>;
11
+ } & {
12
+ [A in ExpressionKey]?: any;
13
+ };
14
+ export type OpAttr = keyof OpSchema;
15
+ export type OpFilter = {
16
+ id: Q_StringValue;
17
+ $$createAt$$: Q_DateValue;
18
+ $$seq$$: Q_NumberValue;
19
+ $$updateAt$$: Q_DateValue;
20
+ userId: Q_StringValue;
21
+ relationId: Q_StringValue;
22
+ entity: Q_StringValue;
23
+ entityId: Q_StringValue;
24
+ } & ExprOp<OpAttr | string>;
25
+ export type OpProjection = {
26
+ "#id"?: NodeId;
27
+ [k: string]: any;
28
+ id?: number;
29
+ $$createAt$$?: number;
30
+ $$updateAt$$?: number;
31
+ $$seq$$?: number;
32
+ userId?: number;
33
+ relationId?: number;
34
+ entity?: number;
35
+ entityId?: number;
36
+ } & Partial<ExprOp<OpAttr | string>>;
37
+ export type OpSortAttr = Partial<{
38
+ id: number;
39
+ $$createAt$$: number;
40
+ $$seq$$: number;
41
+ $$updateAt$$: number;
42
+ entity: number;
43
+ entityId: number;
44
+ [k: string]: any;
45
+ } | ExprOp<OpAttr | string>>;
46
+ export type OpAction = OakMakeAction<GenericAction | string>;
47
+ export type OpUpdateAction = "update" | string;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,7 @@ export default class LocaleBuilder {
9
9
  pwd: string;
10
10
  locales: Record<string, [string, string, string, object]>;
11
11
  hash: Hash;
12
+ projectName?: string;
12
13
  constructor(asLib?: boolean);
13
14
  /**
14
15
  * 将locales输出成为data/i18n.ts中的数据
@@ -32,6 +32,7 @@ class LocaleBuilder {
32
32
  pwd;
33
33
  locales; // key: namespace, value: [module, position, language, data]
34
34
  hash;
35
+ projectName;
35
36
  constructor(asLib) {
36
37
  const pwd = process.cwd();
37
38
  this.pwd = pwd;
@@ -52,8 +53,9 @@ class LocaleBuilder {
52
53
  * 如果有Dependency需要引出来
53
54
  */
54
55
  outputDataFile() {
56
+ const appDomainDir = this.projectName === 'oak-domain' ? 'base-app-domain' : 'oak-app-domain';
55
57
  const statements = [
56
- factory.createImportDeclaration(undefined, factory.createImportClause(false, undefined, factory.createNamedImports([factory.createImportSpecifier(false, factory.createIdentifier("CreateOperationData"), factory.createIdentifier("I18n"))])), factory.createStringLiteral("../oak-app-domain/I18n/Schema"), undefined)
58
+ factory.createImportDeclaration(undefined, factory.createImportClause(false, undefined, factory.createNamedImports([factory.createImportSpecifier(false, factory.createIdentifier("CreateOperationData"), factory.createIdentifier("I18n"))])), factory.createStringLiteral(`../${appDomainDir}/I18n/Schema`), undefined)
57
59
  ];
58
60
  // 改为在初始化时合并
59
61
  /* if (this.dependencies) {
@@ -111,7 +113,11 @@ class LocaleBuilder {
111
113
  /* } */
112
114
  const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
113
115
  const result = printer.printList(ts.ListFormat.SourceFileStatements, factory.createNodeArray(statements), ts.createSourceFile("someFileName.ts", "", ts.ScriptTarget.Latest, false, ts.ScriptKind.TS));
114
- const filename = (0, path_1.join)(this.pwd, 'src', 'data', 'i18n.ts');
116
+ const dataDir = (0, path_1.join)(this.pwd, 'src', 'data');
117
+ if (!fs_1.default.existsSync(dataDir)) {
118
+ fs_1.default.mkdirSync(dataDir);
119
+ }
120
+ const filename = (0, path_1.join)(dataDir, 'i18n.ts');
115
121
  const result2 = (0, string_1.unescapeUnicode)(`// 本文件为自动编译产生,请勿直接修改\n\n${result}`);
116
122
  fs_1.default.writeFileSync(filename, result2, { flag: 'w' });
117
123
  }
@@ -168,6 +174,7 @@ class LocaleBuilder {
168
174
  buildProject(root, src, watch) {
169
175
  const packageJson = (0, path_1.join)(root, 'package.json');
170
176
  const { name } = require(packageJson);
177
+ this.projectName = name;
171
178
  const pagePath = (0, path_1.join)(src ? 'src' : 'es', 'pages');
172
179
  const pageAbsolutePath = (0, path_1.join)(root, pagePath); //编译i18时font中的componentPath缺少根目录导致编译不出
173
180
  if (fs_1.default.existsSync(pageAbsolutePath)) {
@@ -24,4 +24,5 @@ export declare function registerFixedDestinationPathMap(map: Record<string, stri
24
24
  */
25
25
  export declare function registerDeducedRelationMap(map: Record<string, string>): void;
26
26
  export declare function analyzeEntities(inputDir: string, relativePath?: string): void;
27
+ export declare function buildSchemaBackup(outputDir: string): void;
27
28
  export declare function buildSchema(outputDir: string): void;