oak-domain 5.0.20 → 5.1.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 (68) hide show
  1. package/lib/base-app-domain/ActionDefDict.d.ts +6 -0
  2. package/lib/base-app-domain/ActionDefDict.js +8 -4
  3. package/lib/base-app-domain/EntityDict.d.ts +2 -0
  4. package/lib/base-app-domain/Log/Action.d.ts +12 -0
  5. package/lib/base-app-domain/Log/Action.js +14 -0
  6. package/lib/base-app-domain/Log/Schema.d.ts +135 -0
  7. package/lib/base-app-domain/Log/Schema.js +2 -0
  8. package/lib/base-app-domain/Log/Storage.d.ts +3 -0
  9. package/lib/base-app-domain/Log/Storage.js +28 -0
  10. package/lib/base-app-domain/Log/Style.d.ts +3 -0
  11. package/lib/base-app-domain/Log/Style.js +15 -0
  12. package/lib/base-app-domain/ModiEntity/Schema.d.ts +34 -5
  13. package/lib/base-app-domain/ModiEntity/Storage.js +1 -1
  14. package/lib/base-app-domain/Oper/Action.d.ts +12 -0
  15. package/lib/base-app-domain/Oper/Action.js +14 -0
  16. package/lib/base-app-domain/Oper/Schema.d.ts +56 -6
  17. package/lib/base-app-domain/Oper/Storage.js +14 -3
  18. package/lib/base-app-domain/Oper/Style.d.ts +3 -0
  19. package/lib/base-app-domain/Oper/Style.js +15 -0
  20. package/lib/base-app-domain/OperEntity/Schema.d.ts +46 -6
  21. package/lib/base-app-domain/OperEntity/Storage.js +1 -1
  22. package/lib/base-app-domain/Storage.js +24 -22
  23. package/lib/base-app-domain/StyleDict.js +8 -4
  24. package/lib/base-app-domain/User/Schema.d.ts +2 -2
  25. package/lib/base-app-domain/_SubQuery.d.ts +12 -0
  26. package/lib/compiler/schemalBuilder.js +22 -1
  27. package/lib/entities/Log.d.ts +16 -0
  28. package/lib/entities/Log.js +45 -0
  29. package/lib/entities/Oper.d.ts +9 -0
  30. package/lib/entities/Oper.js +33 -3
  31. package/lib/store/AsyncRowStore.d.ts +3 -2
  32. package/lib/store/AsyncRowStore.js +6 -0
  33. package/lib/store/CascadeStore.d.ts +1 -1
  34. package/lib/store/CascadeStore.js +83 -46
  35. package/lib/store/IntrinsicCheckers.js +7 -2
  36. package/lib/store/IntrinsicLogics.js +2 -2
  37. package/lib/store/RelationAuth.js +9 -0
  38. package/lib/store/SyncRowStore.d.ts +3 -2
  39. package/lib/store/relation.d.ts +1 -1
  40. package/lib/store/relation.js +4 -4
  41. package/lib/store/triggers.d.ts +6 -0
  42. package/lib/store/triggers.js +351 -0
  43. package/lib/types/AppLoader.d.ts +2 -1
  44. package/lib/types/Aspect.d.ts +3 -2
  45. package/lib/types/Auth.d.ts +9 -8
  46. package/lib/types/Endpoint.d.ts +3 -2
  47. package/lib/types/Entity.d.ts +4 -0
  48. package/lib/types/EntityDesc.d.ts +1 -1
  49. package/lib/types/Exception.d.ts +6 -0
  50. package/lib/types/Exception.js +15 -1
  51. package/lib/types/Port.d.ts +3 -2
  52. package/lib/types/RowStore.d.ts +4 -3
  53. package/lib/types/Storage.d.ts +1 -0
  54. package/lib/types/Timer.d.ts +6 -5
  55. package/lib/types/Trigger.d.ts +21 -20
  56. package/lib/types/Trigger.js +1 -0
  57. package/lib/types/Watcher.d.ts +5 -4
  58. package/package.json +1 -1
  59. package/src/entities/Log.ts +59 -0
  60. package/src/entities/ModiEntity.ts +26 -26
  61. package/src/entities/Oper.ts +45 -4
  62. package/src/entities/OperEntity.ts +27 -27
  63. package/src/entities/Relation.ts +43 -43
  64. package/src/entities/UserEntityClaim.ts +29 -29
  65. package/src/entities/UserEntityGrant.ts +24 -24
  66. package/src/entities/UserRelation.ts +50 -50
  67. package/lib/store/actionAuth.d.ts +0 -4
  68. package/lib/store/actionAuth.js +0 -25
@@ -1,50 +1,50 @@
1
- import { String } from '../types/DataType';
2
- import { LocaleDef } from '../types/Locale';
3
- import { EntityShape } from '../types/Entity';
4
- import { Index } from '../types/Storage';
5
- import { Schema as User } from './User';
6
- import { Schema as Relation } from './Relation';
7
- import { EntityDesc } from '../types/EntityDesc';
8
-
9
- export interface Schema extends EntityShape {
10
- user: User;
11
- relation: Relation;
12
- entity: String<32>;
13
- entityId: String<64>;
14
- };
15
-
16
- const entityDesc: EntityDesc<Schema> = {
17
- locales: {
18
- zh_CN: {
19
- name: '用户对象关系',
20
- attr: {
21
- user: '关系',
22
- relation: '目标关系',
23
- entity: '目标对象',
24
- entityId: '目标对象ID',
25
- },
26
- },
27
- },
28
- indexes: [
29
- {
30
- name: 'index_user_entity_entityId_relation',
31
- attributes: [
32
- {
33
- name: 'user',
34
- },
35
- {
36
- name: 'entity',
37
- },
38
- {
39
- name: 'entityId',
40
- },
41
- {
42
- name: 'relation',
43
- },
44
- ],
45
- config: {
46
- unique: true,
47
- },
48
- },
49
- ]
50
- };
1
+ import { String } from '../types/DataType';
2
+ import { LocaleDef } from '../types/Locale';
3
+ import { EntityShape } from '../types/Entity';
4
+ import { Index } from '../types/Storage';
5
+ import { Schema as User } from './User';
6
+ import { Schema as Relation } from './Relation';
7
+ import { EntityDesc } from '../types/EntityDesc';
8
+
9
+ export interface Schema extends EntityShape {
10
+ user: User;
11
+ relation: Relation;
12
+ entity: String<32>;
13
+ entityId: String<64>;
14
+ };
15
+
16
+ const entityDesc: EntityDesc<Schema> = {
17
+ locales: {
18
+ zh_CN: {
19
+ name: '用户对象关系',
20
+ attr: {
21
+ user: '关系',
22
+ relation: '目标关系',
23
+ entity: '目标对象',
24
+ entityId: '目标对象ID',
25
+ },
26
+ },
27
+ },
28
+ indexes: [
29
+ {
30
+ name: 'index_user_entity_entityId_relation',
31
+ attributes: [
32
+ {
33
+ name: 'user',
34
+ },
35
+ {
36
+ name: 'entity',
37
+ },
38
+ {
39
+ name: 'entityId',
40
+ },
41
+ {
42
+ name: 'relation',
43
+ },
44
+ ],
45
+ config: {
46
+ unique: true,
47
+ },
48
+ },
49
+ ]
50
+ };
@@ -1,4 +0,0 @@
1
- import { EntityDict } from '../types/Entity';
2
- import { Trigger } from '../types';
3
- import { AsyncContext } from './AsyncRowStore';
4
- export declare const triggers: Trigger<EntityDict, 'actionAuth', AsyncContext<EntityDict>>[];
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.triggers = void 0;
4
- const uuid_1 = require("../utils/uuid");
5
- exports.triggers = [
6
- {
7
- name: '当actionAuth的deActions被置空后,删除此条数据',
8
- entity: 'actionAuth',
9
- action: 'update',
10
- fn: async ({ operation }, context, option) => {
11
- const { data, filter } = operation;
12
- if (data.deActions && data.deActions.length === 0) {
13
- await context.operate('actionAuth', {
14
- id: await (0, uuid_1.generateNewIdAsync)(),
15
- action: 'remove',
16
- data: {},
17
- filter,
18
- }, option);
19
- return 1;
20
- }
21
- return 0;
22
- },
23
- when: 'after',
24
- }
25
- ];