@lcap/nasl 0.3.9-beta → 0.3.10-beta.5
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/out/service/create/errHandles.js +7 -2
- package/out/service/create/errHandles.js.map +1 -1
- package/out/service/logic/logic.d.ts +50 -14
- package/out/service/logic/logic.js +26 -0
- package/out/service/logic/logic.js.map +1 -1
- package/out/service/page/element.d.ts +9 -0
- package/out/service/page/element.js +6 -0
- package/out/service/page/element.js.map +1 -1
- package/out/service/permission/api.d.ts +57 -0
- package/out/service/permission/api.js +41 -0
- package/out/service/permission/api.js.map +1 -0
- package/out/service/permission/index.d.ts +2 -0
- package/out/service/permission/index.js +17 -0
- package/out/service/permission/index.js.map +1 -0
- package/out/service/webFile/index.js +5 -0
- package/out/service/webFile/index.js.map +1 -1
- package/out/types/app/App.d.ts +4 -0
- package/out/types/app/App.js +30 -0
- package/out/types/app/App.js.map +1 -1
- package/out/types/app/Service.d.ts +2 -2
- package/out/types/app/Service.js +28 -3
- package/out/types/app/Service.js.map +1 -1
- package/out/types/cache.d.ts +6 -0
- package/out/types/cache.js +54 -0
- package/out/types/cache.js.map +1 -0
- package/out/types/cacheData.js.map +1 -1
- package/out/types/common/Vertex.d.ts +25 -0
- package/out/types/common/Vertex.js +40 -0
- package/out/types/common/Vertex.js.map +1 -1
- package/out/types/data/Entity.js +1 -0
- package/out/types/data/Entity.js.map +1 -1
- package/out/types/data/Enum.d.ts +5 -0
- package/out/types/data/Enum.js +5 -0
- package/out/types/data/Enum.js.map +1 -1
- package/out/types/data/Interface.js +5 -3
- package/out/types/data/Interface.js.map +1 -1
- package/out/types/data/dataTypes.js +1 -1
- package/out/types/data/dataTypes.js.map +1 -1
- package/out/types/data/genBlock/genCreateBlock.js +5 -5
- package/out/types/data/genBlock/genCreateBlock.js.map +1 -1
- package/out/types/data/genBlock/genCurdBlock.js +3 -3
- package/out/types/data/genBlock/genCurdBlock.js.map +1 -1
- package/out/types/data/genBlock/genEnumSelectBlock.d.ts +1 -1
- package/out/types/data/genBlock/genEnumSelectBlock.js +2 -2
- package/out/types/data/genBlock/genEnumSelectBlock.js.map +1 -1
- package/out/types/data/genBlock/genGridViewBlock.js +12 -1
- package/out/types/data/genBlock/genGridViewBlock.js.map +1 -1
- package/out/types/data/genBlock/genListViewBlock.js +2 -2
- package/out/types/data/genBlock/genSelectBlock.js +2 -2
- package/out/types/data/genBlock/genTableBlock.js +14 -3
- package/out/types/data/genBlock/genTableBlock.js.map +1 -1
- package/out/types/data/genBlock/genUpdateBlock.js +5 -5
- package/out/types/data/genBlock/genUpdateBlock.js.map +1 -1
- package/out/types/data/systemTypes.js +47 -0
- package/out/types/data/systemTypes.js.map +1 -1
- package/out/types/enum.d.ts +6 -0
- package/out/types/enum.js +11 -0
- package/out/types/enum.js.map +1 -0
- package/out/types/generator/hotReload.d.ts +2 -0
- package/out/types/generator/hotReload.js +12 -1
- package/out/types/generator/hotReload.js.map +1 -1
- package/out/types/index.d.ts +5 -1
- package/out/types/index.js +8 -2
- package/out/types/index.js.map +1 -1
- package/out/types/logic/Logic.d.ts +32 -0
- package/out/types/logic/Logic.js +142 -31
- package/out/types/logic/Logic.js.map +1 -1
- package/out/types/logic/LogicItem.d.ts +1 -0
- package/out/types/logic/LogicItem.js +43 -24
- package/out/types/logic/LogicItem.js.map +1 -1
- package/out/types/logic/Param.d.ts +1 -0
- package/out/types/logic/Param.js +40 -20
- package/out/types/logic/Param.js.map +1 -1
- package/out/types/logic/Return.js +14 -19
- package/out/types/logic/Return.js.map +1 -1
- package/out/types/logic/Variable.js +14 -19
- package/out/types/logic/Variable.js.map +1 -1
- package/out/types/logic/translator.js +39 -10
- package/out/types/logic/translator.js.map +1 -1
- package/out/types/nuims/Nuims.d.ts +1 -1
- package/out/types/nuims/Nuims.js +11 -4
- package/out/types/nuims/Nuims.js.map +1 -1
- package/out/types/page/Element.d.ts +16 -0
- package/out/types/page/Element.js +192 -129
- package/out/types/page/Element.js.map +1 -1
- package/out/types/page/Event.js.map +1 -1
- package/out/types/page/Page.d.ts +1 -0
- package/out/types/page/Page.js +71 -37
- package/out/types/page/Page.js.map +1 -1
- package/out/types/page/View.d.ts +9 -1
- package/out/types/page/View.js +86 -42
- package/out/types/page/View.js.map +1 -1
- package/out/types/page/ViewParam.d.ts +1 -0
- package/out/types/page/ViewParam.js +23 -4
- package/out/types/page/ViewParam.js.map +1 -1
- package/out/types/page/ViewVariable.js +13 -18
- package/out/types/page/ViewVariable.js.map +1 -1
- package/out/types/permission/Permission.d.ts +41 -0
- package/out/types/permission/Permission.js +122 -0
- package/out/types/permission/Permission.js.map +1 -0
- package/out/types/process/ProcessParam.js +3 -1
- package/out/types/process/ProcessParam.js.map +1 -1
- package/package.json +2 -3
- package/src/service/create/errHandles.js +6 -2
- package/src/service/developPermission/api.js +37 -0
- package/src/service/developPermission/index.js +13 -0
- package/src/service/logic/logic.js +26 -0
- package/src/service/page/element.js +6 -0
- package/src/service/permission/api.js +38 -0
- package/src/service/permission/index.js +13 -0
- package/src/service/webFile/index.js +6 -1
- package/src/types/app/App.ts +36 -1
- package/src/types/app/Service.ts +32 -3
- package/src/types/cache.ts +50 -0
- package/src/types/cacheData.ts +7 -7
- package/src/types/common/Vertex.ts +30 -0
- package/src/types/data/Entity.ts +1 -0
- package/src/types/data/Enum.ts +5 -0
- package/src/types/data/Interface.ts +4 -3
- package/src/types/data/dataTypes.ts +1 -1
- package/src/types/data/genBlock/genCreateBlock.ts +5 -5
- package/src/types/data/genBlock/genCurdBlock.ts +3 -3
- package/src/types/data/genBlock/genEnumSelectBlock.ts +2 -2
- package/src/types/data/genBlock/genGridViewBlock.ts +12 -1
- package/src/types/data/genBlock/genListViewBlock.ts +2 -2
- package/src/types/data/genBlock/genSelectBlock.ts +2 -2
- package/src/types/data/genBlock/genTableBlock.ts +14 -3
- package/src/types/data/genBlock/genUpdateBlock.ts +5 -5
- package/src/types/data/systemTypes.ts +47 -0
- package/src/types/enum.ts +6 -0
- package/src/types/generator/hotReload.ts +10 -0
- package/src/types/index.ts +5 -1
- package/src/types/logic/Logic.ts +138 -28
- package/src/types/logic/LogicItem.ts +48 -28
- package/src/types/logic/Param.ts +39 -18
- package/src/types/logic/Return.ts +4 -9
- package/src/types/logic/Variable.ts +4 -8
- package/src/types/logic/translator.js +41 -13
- package/src/types/logic/translator_backup.js +5 -16
- package/src/types/nuims/Nuims.ts +11 -5
- package/src/types/page/Element.ts +211 -133
- package/src/types/page/Event.ts +0 -3
- package/src/types/page/Page.ts +86 -49
- package/src/types/page/View.ts +90 -42
- package/src/types/page/ViewParam.ts +22 -3
- package/src/types/page/ViewVariable.ts +4 -8
- package/src/types/page/dist/View.js +727 -0
- package/src/types/permission/Permission.ts +112 -0
- package/src/types/process/ProcessParam.ts +4 -1
- package/out/test/units/config.spec.d.ts +0 -1
- package/out/test/units/config.spec.js +0 -12
- package/out/test/units/config.spec.js.map +0 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { immutable } from '../decorators';
|
|
2
|
+
import { View, Element } from '..';
|
|
3
|
+
import permissionService from '../../service/permission';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class Permission {
|
|
7
|
+
/**
|
|
8
|
+
* App Name
|
|
9
|
+
*/
|
|
10
|
+
@immutable()
|
|
11
|
+
public readonly domainName: string = undefined;
|
|
12
|
+
/**
|
|
13
|
+
* 上报权限后的资源id
|
|
14
|
+
*/
|
|
15
|
+
@immutable()
|
|
16
|
+
public readonly resourceId: string = undefined;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 应用 id
|
|
20
|
+
*/
|
|
21
|
+
@immutable()
|
|
22
|
+
public readonly serviceId: string = undefined;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* view
|
|
26
|
+
*/
|
|
27
|
+
@immutable()
|
|
28
|
+
public readonly view: View = undefined;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* element
|
|
32
|
+
*/
|
|
33
|
+
@immutable()
|
|
34
|
+
public readonly element: Element = undefined;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param source 需要合并的部分参数
|
|
38
|
+
*/
|
|
39
|
+
constructor(source?: Partial<Permission>) {
|
|
40
|
+
const { domainName } = source;
|
|
41
|
+
Object.assign(this, source);
|
|
42
|
+
if (!domainName) {
|
|
43
|
+
throw new Error('Permission need domainName!');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async createDefaultRoleFromRoleName(roleName: string) {
|
|
48
|
+
if (!roleName)
|
|
49
|
+
return;
|
|
50
|
+
return await permissionService.createRole({
|
|
51
|
+
body: {
|
|
52
|
+
name: roleName,
|
|
53
|
+
serviceId: this.serviceId,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async updateRoleName(roleId: string, roleName: string) {
|
|
59
|
+
return await permissionService.updateRole({
|
|
60
|
+
body: {
|
|
61
|
+
id: roleId,
|
|
62
|
+
name: roleName,
|
|
63
|
+
serviceId: this.serviceId,
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param query {
|
|
71
|
+
* resourceId
|
|
72
|
+
* roleId
|
|
73
|
+
* }
|
|
74
|
+
*/
|
|
75
|
+
async attachPermissionResource(query: Object) {
|
|
76
|
+
return await permissionService.attachPermissionResourceAction({ query });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async detachPermissionResource(query: Object) {
|
|
80
|
+
return await permissionService.detachPermissionResourceAction({ query });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async getInitRoles(resourceId: string) {
|
|
84
|
+
return await permissionService.getRoles({
|
|
85
|
+
query: {
|
|
86
|
+
serviceId: this.serviceId,
|
|
87
|
+
resourceId,
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async attachDevRole(resourceId: string) {
|
|
93
|
+
const data: any = await this.getInitRoles(resourceId)|| [];
|
|
94
|
+
let roleId;
|
|
95
|
+
data.forEach((item: any) => {
|
|
96
|
+
if (item.name === 'DEV-AdminRole') {
|
|
97
|
+
roleId = item.id;
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
// 获取权限树资源Id
|
|
101
|
+
if (roleId) {
|
|
102
|
+
// 默认角色开启
|
|
103
|
+
await this.attachPermissionResource({
|
|
104
|
+
resourceId,
|
|
105
|
+
roleId,
|
|
106
|
+
});
|
|
107
|
+
await this.getInitRoles(resourceId);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default Permission;
|
|
@@ -62,10 +62,13 @@ export class ProcessParam extends Param {
|
|
|
62
62
|
body,
|
|
63
63
|
});
|
|
64
64
|
this.assign(ProcessParam.from(result, this.process));
|
|
65
|
-
this.updateInterface();
|
|
65
|
+
await this.updateInterface();
|
|
66
66
|
|
|
67
67
|
await config.defaultApp?.history.load();
|
|
68
68
|
config.defaultApp?.emit('saved');
|
|
69
|
+
|
|
70
|
+
// 更新所有调用此Logic的LogicItem
|
|
71
|
+
await this.process.launchProcessInterface.logic.callLogicUpdate();
|
|
69
72
|
return this;
|
|
70
73
|
}
|
|
71
74
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const chai_1 = require("chai");
|
|
4
|
-
const types_1 = require("../../types");
|
|
5
|
-
describe('config', () => {
|
|
6
|
-
it('login successfully', async () => {
|
|
7
|
-
types_1.config.baseURL = 'http://defaulttenant.qa-ci.lcap.group';
|
|
8
|
-
const userInfo = await types_1.login('admin', 'Admin@123456');
|
|
9
|
-
chai_1.expect(userInfo.UserId).to.equal('28db2e05f7e54c3b90a9e41e5cfe2318');
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=config.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.spec.js","sourceRoot":"","sources":["../../../src/test/units/config.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,uCAA4C;AAE5C,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAChC,cAAM,CAAC,OAAO,GAAG,uCAAuC,CAAC;QACzD,MAAM,QAAQ,GAAG,MAAM,aAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACtD,aAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|