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.
- package/lib/base-app-domain/ActionDefDict.d.ts +6 -0
- package/lib/base-app-domain/ActionDefDict.js +8 -4
- package/lib/base-app-domain/EntityDict.d.ts +2 -0
- package/lib/base-app-domain/Log/Action.d.ts +12 -0
- package/lib/base-app-domain/Log/Action.js +14 -0
- package/lib/base-app-domain/Log/Schema.d.ts +135 -0
- package/lib/base-app-domain/Log/Schema.js +2 -0
- package/lib/base-app-domain/Log/Storage.d.ts +3 -0
- package/lib/base-app-domain/Log/Storage.js +28 -0
- package/lib/base-app-domain/Log/Style.d.ts +3 -0
- package/lib/base-app-domain/Log/Style.js +15 -0
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +34 -5
- package/lib/base-app-domain/ModiEntity/Storage.js +1 -1
- package/lib/base-app-domain/Oper/Action.d.ts +12 -0
- package/lib/base-app-domain/Oper/Action.js +14 -0
- package/lib/base-app-domain/Oper/Schema.d.ts +56 -6
- package/lib/base-app-domain/Oper/Storage.js +14 -3
- package/lib/base-app-domain/Oper/Style.d.ts +3 -0
- package/lib/base-app-domain/Oper/Style.js +15 -0
- package/lib/base-app-domain/OperEntity/Schema.d.ts +46 -6
- package/lib/base-app-domain/OperEntity/Storage.js +1 -1
- package/lib/base-app-domain/Storage.js +24 -22
- package/lib/base-app-domain/StyleDict.js +8 -4
- package/lib/base-app-domain/User/Schema.d.ts +2 -2
- package/lib/base-app-domain/_SubQuery.d.ts +12 -0
- package/lib/compiler/schemalBuilder.js +22 -1
- package/lib/entities/Log.d.ts +16 -0
- package/lib/entities/Log.js +45 -0
- package/lib/entities/Oper.d.ts +9 -0
- package/lib/entities/Oper.js +33 -3
- package/lib/store/AsyncRowStore.d.ts +3 -2
- package/lib/store/AsyncRowStore.js +6 -0
- package/lib/store/CascadeStore.d.ts +1 -1
- package/lib/store/CascadeStore.js +83 -46
- package/lib/store/IntrinsicCheckers.js +7 -2
- package/lib/store/IntrinsicLogics.js +2 -2
- package/lib/store/RelationAuth.js +9 -0
- package/lib/store/SyncRowStore.d.ts +3 -2
- package/lib/store/relation.d.ts +1 -1
- package/lib/store/relation.js +4 -4
- package/lib/store/triggers.d.ts +6 -0
- package/lib/store/triggers.js +351 -0
- package/lib/types/AppLoader.d.ts +2 -1
- package/lib/types/Aspect.d.ts +3 -2
- package/lib/types/Auth.d.ts +9 -8
- package/lib/types/Endpoint.d.ts +3 -2
- package/lib/types/Entity.d.ts +4 -0
- package/lib/types/EntityDesc.d.ts +1 -1
- package/lib/types/Exception.d.ts +6 -0
- package/lib/types/Exception.js +15 -1
- package/lib/types/Port.d.ts +3 -2
- package/lib/types/RowStore.d.ts +4 -3
- package/lib/types/Storage.d.ts +1 -0
- package/lib/types/Timer.d.ts +6 -5
- package/lib/types/Trigger.d.ts +21 -20
- package/lib/types/Trigger.js +1 -0
- package/lib/types/Watcher.d.ts +5 -4
- package/package.json +1 -1
- package/src/entities/Log.ts +59 -0
- package/src/entities/ModiEntity.ts +26 -26
- package/src/entities/Oper.ts +45 -4
- package/src/entities/OperEntity.ts +27 -27
- package/src/entities/Relation.ts +43 -43
- package/src/entities/UserEntityClaim.ts +29 -29
- package/src/entities/UserEntityGrant.ts +24 -24
- package/src/entities/UserRelation.ts +50 -50
- package/lib/store/actionAuth.d.ts +0 -4
- 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
|
+
};
|
package/lib/store/actionAuth.js
DELETED
|
@@ -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
|
-
];
|