oak-domain 4.2.2 → 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.
- package/lib/base-app-domain/ActionDefDict.d.ts +8 -8
- package/lib/base-app-domain/Oper/Schema.d.ts +158 -158
- package/lib/base-app-domain/Oper/Storage.js +56 -56
- package/lib/base-app-domain/User/Action.d.ts +11 -11
- package/lib/base-app-domain/User/Action.js +12 -12
- package/lib/base-app-domain/UserEntityGrant/Action.d.ts +5 -5
- package/lib/base-app-domain/UserEntityGrant/Action.js +5 -5
- package/lib/compiler/schemalBuilder.js +4167 -4167
- package/lib/entities/Oper.d.ts +12 -12
- package/lib/entities/Oper.js +36 -36
- package/lib/entities/User.d.ts +18 -18
- package/lib/entities/User.js +32 -32
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -3
- package/lib/store/AsyncRowStore.d.ts +66 -66
- package/lib/store/CascadeStore.d.ts +109 -109
- package/lib/store/CascadeStore.js +1728 -1726
- package/lib/store/RelationAuth.js +1209 -1209
- package/lib/store/TriggerExecutor.js +468 -468
- package/lib/store/actionDef.js +278 -278
- package/lib/store/checker.js +487 -487
- package/lib/store/relation.d.ts +12 -12
- package/lib/store/relation.js +74 -74
- package/lib/triggers/index.d.ts +5 -5
- package/lib/triggers/index.js +28 -28
- package/lib/types/Configuration.d.ts +42 -42
- package/lib/types/Configuration.js +3 -3
- package/lib/types/Connector.d.ts +39 -38
- package/lib/types/Entity.d.ts +209 -209
- package/lib/types/Sync.d.ts +74 -69
- package/lib/types/Sync.js +9 -9
- package/lib/types/index.d.ts +27 -27
- package/lib/types/index.js +30 -30
- package/lib/utils/SimpleConnector.d.ts +81 -64
- package/lib/utils/SimpleConnector.js +217 -206
- package/lib/utils/assert.d.ts +5 -5
- package/lib/utils/projection.d.ts +4 -4
- package/lib/utils/relationPath.d.ts +31 -31
- package/lib/utils/relationPath.js +202 -202
- package/package.json +51 -51
- package/src/entities/ActionAuth.ts +41 -41
- package/src/entities/I18n.ts +45 -45
- package/src/entities/Modi.ts +69 -69
- package/src/entities/ModiEntity.ts +26 -26
- package/src/entities/Oper.ts +48 -48
- package/src/entities/OperEntity.ts +27 -27
- package/src/entities/Path.ts +43 -43
- package/src/entities/Relation.ts +43 -43
- package/src/entities/RelationAuth.ts +44 -44
- package/src/entities/User.ts +48 -48
- package/src/entities/UserEntityClaim.ts +29 -29
- package/src/entities/UserEntityGrant.ts +24 -24
- package/src/entities/UserRelation.ts +50 -50
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { String } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { Schema as Relation } from './Relation';
|
|
4
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
-
import { Schema as Path } from './Path';
|
|
6
|
-
|
|
7
|
-
// destRelation需要有sourceRelation才能授权/除权
|
|
8
|
-
export interface Schema extends EntityShape {
|
|
9
|
-
sourceRelation: Relation;
|
|
10
|
-
path: Path;
|
|
11
|
-
destRelation: Relation;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const entityDesc: EntityDesc<Schema> = {
|
|
15
|
-
indexes: [
|
|
16
|
-
{
|
|
17
|
-
name: 'index_entity_relation_path',
|
|
18
|
-
attributes: [
|
|
19
|
-
{
|
|
20
|
-
name: 'sourceRelation',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'path',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'destRelation',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
config: {
|
|
30
|
-
unique: true,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
locales: {
|
|
35
|
-
zh_CN: {
|
|
36
|
-
name: '用户授权',
|
|
37
|
-
attr: {
|
|
38
|
-
sourceRelation: '源关系',
|
|
39
|
-
path: '路径',
|
|
40
|
-
destRelation: '目标关系',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
};
|
|
1
|
+
import { String } from '../types/DataType';
|
|
2
|
+
import { EntityShape } from '../types/Entity';
|
|
3
|
+
import { Schema as Relation } from './Relation';
|
|
4
|
+
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
+
import { Schema as Path } from './Path';
|
|
6
|
+
|
|
7
|
+
// destRelation需要有sourceRelation才能授权/除权
|
|
8
|
+
export interface Schema extends EntityShape {
|
|
9
|
+
sourceRelation: Relation;
|
|
10
|
+
path: Path;
|
|
11
|
+
destRelation: Relation;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const entityDesc: EntityDesc<Schema> = {
|
|
15
|
+
indexes: [
|
|
16
|
+
{
|
|
17
|
+
name: 'index_entity_relation_path',
|
|
18
|
+
attributes: [
|
|
19
|
+
{
|
|
20
|
+
name: 'sourceRelation',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'path',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'destRelation',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
config: {
|
|
30
|
+
unique: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
locales: {
|
|
35
|
+
zh_CN: {
|
|
36
|
+
name: '用户授权',
|
|
37
|
+
attr: {
|
|
38
|
+
sourceRelation: '源关系',
|
|
39
|
+
path: '路径',
|
|
40
|
+
destRelation: '目标关系',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
};
|
package/src/entities/User.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { String, Int, Text, Image, Datetime } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { ActionDef } from '../types/Action';
|
|
4
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
-
|
|
6
|
-
export interface Schema extends EntityShape {
|
|
7
|
-
name?: String<16>;
|
|
8
|
-
nickname?: String<64>;
|
|
9
|
-
password?: Text;
|
|
10
|
-
ref?: Schema;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type UserAction = 'mergeTo';
|
|
14
|
-
type UserState = 'normal' | 'merged';
|
|
15
|
-
|
|
16
|
-
export type Action = UserAction;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export const UserActionDef: ActionDef<UserAction, UserState> = {
|
|
20
|
-
stm: {
|
|
21
|
-
mergeTo: ['normal', 'merged'],
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const entityDesc: EntityDesc<Schema, Action, '', {
|
|
26
|
-
userState: UserState,
|
|
27
|
-
}> = {
|
|
28
|
-
locales: {
|
|
29
|
-
zh_CN: {
|
|
30
|
-
name: '用户',
|
|
31
|
-
attr: {
|
|
32
|
-
name: '姓名',
|
|
33
|
-
nickname: '昵称',
|
|
34
|
-
password: '密码',
|
|
35
|
-
ref: '指向用户',
|
|
36
|
-
userState: '状态',
|
|
37
|
-
},
|
|
38
|
-
action: {
|
|
39
|
-
mergeTo: '合并',
|
|
40
|
-
},
|
|
41
|
-
v: {
|
|
42
|
-
userState: {
|
|
43
|
-
normal: '正常',
|
|
44
|
-
merged: '已被合并',
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
},
|
|
1
|
+
import { String, Int, Text, Image, Datetime } from '../types/DataType';
|
|
2
|
+
import { EntityShape } from '../types/Entity';
|
|
3
|
+
import { ActionDef } from '../types/Action';
|
|
4
|
+
import { EntityDesc } from '../types/EntityDesc';
|
|
5
|
+
|
|
6
|
+
export interface Schema extends EntityShape {
|
|
7
|
+
name?: String<16>;
|
|
8
|
+
nickname?: String<64>;
|
|
9
|
+
password?: Text;
|
|
10
|
+
ref?: Schema;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type UserAction = 'mergeTo';
|
|
14
|
+
type UserState = 'normal' | 'merged';
|
|
15
|
+
|
|
16
|
+
export type Action = UserAction;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export const UserActionDef: ActionDef<UserAction, UserState> = {
|
|
20
|
+
stm: {
|
|
21
|
+
mergeTo: ['normal', 'merged'],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const entityDesc: EntityDesc<Schema, Action, '', {
|
|
26
|
+
userState: UserState,
|
|
27
|
+
}> = {
|
|
28
|
+
locales: {
|
|
29
|
+
zh_CN: {
|
|
30
|
+
name: '用户',
|
|
31
|
+
attr: {
|
|
32
|
+
name: '姓名',
|
|
33
|
+
nickname: '昵称',
|
|
34
|
+
password: '密码',
|
|
35
|
+
ref: '指向用户',
|
|
36
|
+
userState: '状态',
|
|
37
|
+
},
|
|
38
|
+
action: {
|
|
39
|
+
mergeTo: '合并',
|
|
40
|
+
},
|
|
41
|
+
v: {
|
|
42
|
+
userState: {
|
|
43
|
+
normal: '正常',
|
|
44
|
+
merged: '已被合并',
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
49
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { String } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
4
|
-
import { Schema as UserEntityGrant } from './UserEntityGrant';
|
|
5
|
-
import { Schema as User } from './User';
|
|
6
|
-
import { Schema as Relation } from './Relation';
|
|
7
|
-
import { Schema as UserRelation } from './UserRelation';
|
|
8
|
-
|
|
9
|
-
export interface Schema extends EntityShape {
|
|
10
|
-
ueg: UserEntityGrant;
|
|
11
|
-
user: User;
|
|
12
|
-
relation: Relation;
|
|
13
|
-
claimEntityId: String<64>;
|
|
14
|
-
userRelation: UserRelation;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const entityDesc: EntityDesc<Schema, ''> = {
|
|
18
|
-
locales: {
|
|
19
|
-
zh_CN: {
|
|
20
|
-
name: '用户授权领取',
|
|
21
|
-
attr: {
|
|
22
|
-
ueg: '授权',
|
|
23
|
-
user: '用户',
|
|
24
|
-
relation: '关系',
|
|
25
|
-
claimEntityId: '对象Id',
|
|
26
|
-
userRelation: '用户关系',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
1
|
+
import { String } from '../types/DataType';
|
|
2
|
+
import { EntityShape } from '../types/Entity';
|
|
3
|
+
import { EntityDesc } from '../types/EntityDesc';
|
|
4
|
+
import { Schema as UserEntityGrant } from './UserEntityGrant';
|
|
5
|
+
import { Schema as User } from './User';
|
|
6
|
+
import { Schema as Relation } from './Relation';
|
|
7
|
+
import { Schema as UserRelation } from './UserRelation';
|
|
8
|
+
|
|
9
|
+
export interface Schema extends EntityShape {
|
|
10
|
+
ueg: UserEntityGrant;
|
|
11
|
+
user: User;
|
|
12
|
+
relation: Relation;
|
|
13
|
+
claimEntityId: String<64>;
|
|
14
|
+
userRelation: UserRelation;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const entityDesc: EntityDesc<Schema, ''> = {
|
|
18
|
+
locales: {
|
|
19
|
+
zh_CN: {
|
|
20
|
+
name: '用户授权领取',
|
|
21
|
+
attr: {
|
|
22
|
+
ueg: '授权',
|
|
23
|
+
user: '用户',
|
|
24
|
+
relation: '关系',
|
|
25
|
+
claimEntityId: '对象Id',
|
|
26
|
+
userRelation: '用户关系',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
30
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { String } from '../types/DataType';
|
|
2
|
-
import { EntityShape } from '../types/Entity';
|
|
3
|
-
import { EntityDesc } from '../types/EntityDesc';
|
|
4
|
-
|
|
5
|
-
type RelationIds = string[];
|
|
6
|
-
|
|
7
|
-
export interface Schema extends EntityShape {
|
|
8
|
-
relationEntity: String<32>;
|
|
9
|
-
relationEntityFilter: Object;
|
|
10
|
-
relationIds: RelationIds;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const entityDesc: EntityDesc<Schema, ''> = {
|
|
14
|
-
locales: {
|
|
15
|
-
zh_CN: {
|
|
16
|
-
name: '用户授权',
|
|
17
|
-
attr: {
|
|
18
|
-
relationIds: '关系',
|
|
19
|
-
relationEntity: '关联对象',
|
|
20
|
-
relationEntityFilter: '对象限定条件',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
};
|
|
1
|
+
import { String } from '../types/DataType';
|
|
2
|
+
import { EntityShape } from '../types/Entity';
|
|
3
|
+
import { EntityDesc } from '../types/EntityDesc';
|
|
4
|
+
|
|
5
|
+
type RelationIds = string[];
|
|
6
|
+
|
|
7
|
+
export interface Schema extends EntityShape {
|
|
8
|
+
relationEntity: String<32>;
|
|
9
|
+
relationEntityFilter: Object;
|
|
10
|
+
relationIds: RelationIds;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const entityDesc: EntityDesc<Schema, ''> = {
|
|
14
|
+
locales: {
|
|
15
|
+
zh_CN: {
|
|
16
|
+
name: '用户授权',
|
|
17
|
+
attr: {
|
|
18
|
+
relationIds: '关系',
|
|
19
|
+
relationEntity: '关联对象',
|
|
20
|
+
relationEntityFilter: '对象限定条件',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -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
|
+
};
|