oak-domain 2.4.3 → 2.5.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.
Files changed (35) hide show
  1. package/lib/base-app-domain/ActionDefDict.d.ts +4 -1
  2. package/lib/base-app-domain/ActionDefDict.js +3 -1
  3. package/lib/base-app-domain/EntityDict.d.ts +2 -0
  4. package/lib/base-app-domain/Modi/Action.d.ts +4 -4
  5. package/lib/base-app-domain/ModiEntity/Schema.d.ts +31 -4
  6. package/lib/base-app-domain/ModiEntity/Storage.js +2 -1
  7. package/lib/base-app-domain/OperEntity/Schema.d.ts +31 -4
  8. package/lib/base-app-domain/OperEntity/Storage.js +2 -1
  9. package/lib/base-app-domain/Storage.js +3 -1
  10. package/lib/base-app-domain/User/Action.d.ts +10 -0
  11. package/lib/base-app-domain/User/Action.js +12 -0
  12. package/lib/base-app-domain/User/Schema.d.ts +60 -8
  13. package/lib/base-app-domain/User/Storage.js +12 -1
  14. package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +121 -0
  15. package/lib/base-app-domain/UserEntityGrant/Schema.js +2 -0
  16. package/lib/base-app-domain/UserEntityGrant/Storage.d.ts +3 -0
  17. package/lib/base-app-domain/UserEntityGrant/Storage.js +28 -0
  18. package/lib/base-app-domain/_SubQuery.d.ts +8 -0
  19. package/lib/checkers/index.js +1 -0
  20. package/lib/compiler/schemalBuilder.js +58 -6
  21. package/lib/entities/User.d.ts +1 -0
  22. package/lib/entities/User.js +16 -0
  23. package/lib/entities/UserEntityGrant.d.ts +7 -0
  24. package/lib/entities/UserEntityGrant.js +12 -0
  25. package/lib/store/TriggerExecutor.js +7 -2
  26. package/lib/store/checker.d.ts +13 -0
  27. package/lib/store/checker.js +228 -1
  28. package/lib/store/modi.js +33 -15
  29. package/lib/types/Auth.d.ts +3 -3
  30. package/lib/types/Storage.d.ts +1 -1
  31. package/lib/types/Trigger.d.ts +9 -0
  32. package/lib/types/Trigger.js +10 -0
  33. package/package.json +1 -1
  34. package/src/entities/User.ts +26 -1
  35. package/src/entities/UserEntityGrant.ts +24 -0
@@ -1,5 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REMOVE_CASCADE_PRIORITY = exports.CHECKER_DEFAULT_PRIORITY = exports.DATA_CHECKER_DEFAULT_PRIORITY = exports.TRIGGER_MAX_PRIORITY = exports.TRIGGER_MIN_PRIORITY = exports.TRIGGER_DEFAULT_PRIORITY = void 0;
4
+ /**
5
+ * 优先级越小,越早执行。定义在1~99之间
6
+ */
7
+ exports.TRIGGER_DEFAULT_PRIORITY = 50;
8
+ exports.TRIGGER_MIN_PRIORITY = 1;
9
+ exports.TRIGGER_MAX_PRIORITY = 99;
10
+ exports.DATA_CHECKER_DEFAULT_PRIORITY = 60;
11
+ exports.CHECKER_DEFAULT_PRIORITY = 99;
12
+ exports.REMOVE_CASCADE_PRIORITY = 70;
3
13
  ;
4
14
  ;
5
15
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-domain",
3
- "version": "2.4.3",
3
+ "version": "2.5.1",
4
4
  "author": {
5
5
  "name": "XuChang"
6
6
  },
@@ -1,20 +1,45 @@
1
1
  import { String, Int, Text, Image, Datetime } from '../types/DataType';
2
2
  import { LocaleDef } from '../types/Locale';
3
3
  import { EntityShape } from '../types/Entity';
4
+ import { ActionDef } from '../types/Action';
4
5
 
5
6
  export interface Schema extends EntityShape {
6
7
  name?: String<16>;
7
8
  nickname?: String<64>;
8
9
  password?: Text;
10
+ ref?: Schema;
9
11
  };
10
12
 
13
+ type UserAction = 'mergeTo';
14
+ type UserState = 'normal' | 'merged';
11
15
 
12
- const locale: LocaleDef<Schema, '', '', {}> = {
16
+ type Action = UserAction;
17
+
18
+ const UserActionDef: ActionDef<UserAction, UserState> = {
19
+ stm: {
20
+ mergeTo: ['normal', 'merged'],
21
+ },
22
+ };
23
+
24
+ const locale: LocaleDef<Schema, Action, '', {
25
+ userState: UserState;
26
+ }> = {
13
27
  zh_CN: {
14
28
  attr: {
15
29
  name: '姓名',
16
30
  nickname: '昵称',
17
31
  password: '密码',
32
+ ref: '指向用户',
33
+ userState: '状态',
34
+ },
35
+ action: {
36
+ mergeTo: '合并',
18
37
  },
38
+ v: {
39
+ userState: {
40
+ normal: '正常',
41
+ merged: '已被合并',
42
+ },
43
+ }
19
44
  },
20
45
  };
@@ -0,0 +1,24 @@
1
+ import { String } from '../types/DataType';
2
+ import { LocaleDef } from '../types/Locale';
3
+ import { EntityShape } from '../types/Entity';
4
+
5
+ export interface Schema extends EntityShape {
6
+ entity: String<32>;
7
+ entityId: String<64>;
8
+ relation: String<32>;
9
+ };
10
+
11
+ const locale: LocaleDef<
12
+ Schema,
13
+ '',
14
+ '',
15
+ {}
16
+ > = {
17
+ zh_CN: {
18
+ attr: {
19
+ relation: '关系',
20
+ entity: '关联对象',
21
+ entityId: '关联对象id',
22
+ },
23
+ },
24
+ };