@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.
Files changed (152) hide show
  1. package/out/service/create/errHandles.js +7 -2
  2. package/out/service/create/errHandles.js.map +1 -1
  3. package/out/service/logic/logic.d.ts +50 -14
  4. package/out/service/logic/logic.js +26 -0
  5. package/out/service/logic/logic.js.map +1 -1
  6. package/out/service/page/element.d.ts +9 -0
  7. package/out/service/page/element.js +6 -0
  8. package/out/service/page/element.js.map +1 -1
  9. package/out/service/permission/api.d.ts +57 -0
  10. package/out/service/permission/api.js +41 -0
  11. package/out/service/permission/api.js.map +1 -0
  12. package/out/service/permission/index.d.ts +2 -0
  13. package/out/service/permission/index.js +17 -0
  14. package/out/service/permission/index.js.map +1 -0
  15. package/out/service/webFile/index.js +5 -0
  16. package/out/service/webFile/index.js.map +1 -1
  17. package/out/types/app/App.d.ts +4 -0
  18. package/out/types/app/App.js +30 -0
  19. package/out/types/app/App.js.map +1 -1
  20. package/out/types/app/Service.d.ts +2 -2
  21. package/out/types/app/Service.js +28 -3
  22. package/out/types/app/Service.js.map +1 -1
  23. package/out/types/cache.d.ts +6 -0
  24. package/out/types/cache.js +54 -0
  25. package/out/types/cache.js.map +1 -0
  26. package/out/types/cacheData.js.map +1 -1
  27. package/out/types/common/Vertex.d.ts +25 -0
  28. package/out/types/common/Vertex.js +40 -0
  29. package/out/types/common/Vertex.js.map +1 -1
  30. package/out/types/data/Entity.js +1 -0
  31. package/out/types/data/Entity.js.map +1 -1
  32. package/out/types/data/Enum.d.ts +5 -0
  33. package/out/types/data/Enum.js +5 -0
  34. package/out/types/data/Enum.js.map +1 -1
  35. package/out/types/data/Interface.js +5 -3
  36. package/out/types/data/Interface.js.map +1 -1
  37. package/out/types/data/dataTypes.js +1 -1
  38. package/out/types/data/dataTypes.js.map +1 -1
  39. package/out/types/data/genBlock/genCreateBlock.js +5 -5
  40. package/out/types/data/genBlock/genCreateBlock.js.map +1 -1
  41. package/out/types/data/genBlock/genCurdBlock.js +3 -3
  42. package/out/types/data/genBlock/genCurdBlock.js.map +1 -1
  43. package/out/types/data/genBlock/genEnumSelectBlock.d.ts +1 -1
  44. package/out/types/data/genBlock/genEnumSelectBlock.js +2 -2
  45. package/out/types/data/genBlock/genEnumSelectBlock.js.map +1 -1
  46. package/out/types/data/genBlock/genGridViewBlock.js +12 -1
  47. package/out/types/data/genBlock/genGridViewBlock.js.map +1 -1
  48. package/out/types/data/genBlock/genListViewBlock.js +2 -2
  49. package/out/types/data/genBlock/genSelectBlock.js +2 -2
  50. package/out/types/data/genBlock/genTableBlock.js +14 -3
  51. package/out/types/data/genBlock/genTableBlock.js.map +1 -1
  52. package/out/types/data/genBlock/genUpdateBlock.js +5 -5
  53. package/out/types/data/genBlock/genUpdateBlock.js.map +1 -1
  54. package/out/types/data/systemTypes.js +47 -0
  55. package/out/types/data/systemTypes.js.map +1 -1
  56. package/out/types/enum.d.ts +6 -0
  57. package/out/types/enum.js +11 -0
  58. package/out/types/enum.js.map +1 -0
  59. package/out/types/generator/hotReload.d.ts +2 -0
  60. package/out/types/generator/hotReload.js +12 -1
  61. package/out/types/generator/hotReload.js.map +1 -1
  62. package/out/types/index.d.ts +5 -1
  63. package/out/types/index.js +8 -2
  64. package/out/types/index.js.map +1 -1
  65. package/out/types/logic/Logic.d.ts +32 -0
  66. package/out/types/logic/Logic.js +142 -31
  67. package/out/types/logic/Logic.js.map +1 -1
  68. package/out/types/logic/LogicItem.d.ts +1 -0
  69. package/out/types/logic/LogicItem.js +43 -24
  70. package/out/types/logic/LogicItem.js.map +1 -1
  71. package/out/types/logic/Param.d.ts +1 -0
  72. package/out/types/logic/Param.js +40 -20
  73. package/out/types/logic/Param.js.map +1 -1
  74. package/out/types/logic/Return.js +14 -19
  75. package/out/types/logic/Return.js.map +1 -1
  76. package/out/types/logic/Variable.js +14 -19
  77. package/out/types/logic/Variable.js.map +1 -1
  78. package/out/types/logic/translator.js +39 -10
  79. package/out/types/logic/translator.js.map +1 -1
  80. package/out/types/nuims/Nuims.d.ts +1 -1
  81. package/out/types/nuims/Nuims.js +11 -4
  82. package/out/types/nuims/Nuims.js.map +1 -1
  83. package/out/types/page/Element.d.ts +16 -0
  84. package/out/types/page/Element.js +192 -129
  85. package/out/types/page/Element.js.map +1 -1
  86. package/out/types/page/Event.js.map +1 -1
  87. package/out/types/page/Page.d.ts +1 -0
  88. package/out/types/page/Page.js +71 -37
  89. package/out/types/page/Page.js.map +1 -1
  90. package/out/types/page/View.d.ts +9 -1
  91. package/out/types/page/View.js +86 -42
  92. package/out/types/page/View.js.map +1 -1
  93. package/out/types/page/ViewParam.d.ts +1 -0
  94. package/out/types/page/ViewParam.js +23 -4
  95. package/out/types/page/ViewParam.js.map +1 -1
  96. package/out/types/page/ViewVariable.js +13 -18
  97. package/out/types/page/ViewVariable.js.map +1 -1
  98. package/out/types/permission/Permission.d.ts +41 -0
  99. package/out/types/permission/Permission.js +122 -0
  100. package/out/types/permission/Permission.js.map +1 -0
  101. package/out/types/process/ProcessParam.js +3 -1
  102. package/out/types/process/ProcessParam.js.map +1 -1
  103. package/package.json +2 -3
  104. package/src/service/create/errHandles.js +6 -2
  105. package/src/service/developPermission/api.js +37 -0
  106. package/src/service/developPermission/index.js +13 -0
  107. package/src/service/logic/logic.js +26 -0
  108. package/src/service/page/element.js +6 -0
  109. package/src/service/permission/api.js +38 -0
  110. package/src/service/permission/index.js +13 -0
  111. package/src/service/webFile/index.js +6 -1
  112. package/src/types/app/App.ts +36 -1
  113. package/src/types/app/Service.ts +32 -3
  114. package/src/types/cache.ts +50 -0
  115. package/src/types/cacheData.ts +7 -7
  116. package/src/types/common/Vertex.ts +30 -0
  117. package/src/types/data/Entity.ts +1 -0
  118. package/src/types/data/Enum.ts +5 -0
  119. package/src/types/data/Interface.ts +4 -3
  120. package/src/types/data/dataTypes.ts +1 -1
  121. package/src/types/data/genBlock/genCreateBlock.ts +5 -5
  122. package/src/types/data/genBlock/genCurdBlock.ts +3 -3
  123. package/src/types/data/genBlock/genEnumSelectBlock.ts +2 -2
  124. package/src/types/data/genBlock/genGridViewBlock.ts +12 -1
  125. package/src/types/data/genBlock/genListViewBlock.ts +2 -2
  126. package/src/types/data/genBlock/genSelectBlock.ts +2 -2
  127. package/src/types/data/genBlock/genTableBlock.ts +14 -3
  128. package/src/types/data/genBlock/genUpdateBlock.ts +5 -5
  129. package/src/types/data/systemTypes.ts +47 -0
  130. package/src/types/enum.ts +6 -0
  131. package/src/types/generator/hotReload.ts +10 -0
  132. package/src/types/index.ts +5 -1
  133. package/src/types/logic/Logic.ts +138 -28
  134. package/src/types/logic/LogicItem.ts +48 -28
  135. package/src/types/logic/Param.ts +39 -18
  136. package/src/types/logic/Return.ts +4 -9
  137. package/src/types/logic/Variable.ts +4 -8
  138. package/src/types/logic/translator.js +41 -13
  139. package/src/types/logic/translator_backup.js +5 -16
  140. package/src/types/nuims/Nuims.ts +11 -5
  141. package/src/types/page/Element.ts +211 -133
  142. package/src/types/page/Event.ts +0 -3
  143. package/src/types/page/Page.ts +86 -49
  144. package/src/types/page/View.ts +90 -42
  145. package/src/types/page/ViewParam.ts +22 -3
  146. package/src/types/page/ViewVariable.ts +4 -8
  147. package/src/types/page/dist/View.js +727 -0
  148. package/src/types/permission/Permission.ts +112 -0
  149. package/src/types/process/ProcessParam.ts +4 -1
  150. package/out/test/units/config.spec.d.ts +0 -1
  151. package/out/test/units/config.spec.js +0 -12
  152. 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"}