@lcap/nasl 3.7.3-beta.1 → 3.8.0-beta.2

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 (370) hide show
  1. package/.mocharc.js +0 -1
  2. package/out/automate/engine/utils.js +6 -1
  3. package/out/automate/engine/utils.js.map +1 -1
  4. package/out/bak/translator.js +37 -0
  5. package/out/bak/translator.js.map +1 -1
  6. package/out/breakpoint/shared/utils.d.ts +1 -0
  7. package/out/breakpoint/shared/utils.js +1 -1
  8. package/out/breakpoint/shared/utils.js.map +1 -1
  9. package/out/common/BaseNode.d.ts +11 -0
  10. package/out/common/BaseNode.js +101 -5
  11. package/out/common/BaseNode.js.map +1 -1
  12. package/out/concepts/Annotatable__.d.ts +109 -0
  13. package/out/concepts/Annotatable__.js +161 -0
  14. package/out/concepts/Annotatable__.js.map +1 -0
  15. package/out/concepts/AnnotationProperty__.d.ts +48 -0
  16. package/out/concepts/AnnotationProperty__.js +74 -0
  17. package/out/concepts/AnnotationProperty__.js.map +1 -0
  18. package/out/concepts/Annotation__.d.ts +128 -0
  19. package/out/concepts/Annotation__.js +248 -0
  20. package/out/concepts/Annotation__.js.map +1 -0
  21. package/out/concepts/App__.d.ts +14 -26
  22. package/out/concepts/App__.js +50 -20
  23. package/out/concepts/App__.js.map +1 -1
  24. package/out/concepts/ApplyAnnotation__.d.ts +87 -0
  25. package/out/concepts/ApplyAnnotation__.js +140 -0
  26. package/out/concepts/ApplyAnnotation__.js.map +1 -0
  27. package/out/concepts/Argument__.d.ts +19 -0
  28. package/out/concepts/Argument__.js +126 -0
  29. package/out/concepts/Argument__.js.map +1 -1
  30. package/out/concepts/AssigneeV2__.d.ts +169 -0
  31. package/out/concepts/AssigneeV2__.js +176 -1
  32. package/out/concepts/AssigneeV2__.js.map +1 -1
  33. package/out/concepts/AuthLogicForCallInterface__.js +1 -1
  34. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  35. package/out/concepts/AuthLogic__.js +1 -1
  36. package/out/concepts/AuthLogic__.js.map +1 -1
  37. package/out/concepts/BooleanLiteral__.d.ts +1 -0
  38. package/out/concepts/BooleanLiteral__.js +9 -0
  39. package/out/concepts/BooleanLiteral__.js.map +1 -1
  40. package/out/concepts/BusinessLogic__.js +1 -1
  41. package/out/concepts/BusinessLogic__.js.map +1 -1
  42. package/out/concepts/CallFunction__.js +1 -1
  43. package/out/concepts/CallFunction__.js.map +1 -1
  44. package/out/concepts/CallLogic__.d.ts +15 -0
  45. package/out/concepts/CallLogic__.js +149 -17
  46. package/out/concepts/CallLogic__.js.map +1 -1
  47. package/out/concepts/ConnectorLogic__.js +1 -1
  48. package/out/concepts/ConnectorLogic__.js.map +1 -1
  49. package/out/concepts/DatabaseTypeAnnotation__.d.ts +0 -2
  50. package/out/concepts/DatabaseTypeAnnotation__.js +0 -20
  51. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  52. package/out/concepts/DepartmentManagerV2__.d.ts +29 -0
  53. package/out/concepts/DepartmentManagerV2__.js +56 -0
  54. package/out/concepts/DepartmentManagerV2__.js.map +1 -0
  55. package/out/concepts/DepartmentV2__.d.ts +33 -0
  56. package/out/concepts/DepartmentV2__.js +63 -0
  57. package/out/concepts/DepartmentV2__.js.map +1 -0
  58. package/out/concepts/DirectManagerV2__.d.ts +25 -0
  59. package/out/concepts/DirectManagerV2__.js +53 -0
  60. package/out/concepts/DirectManagerV2__.js.map +1 -0
  61. package/out/concepts/End__.js +9 -1
  62. package/out/concepts/End__.js.map +1 -1
  63. package/out/concepts/EntityProperty__.js +0 -2
  64. package/out/concepts/EntityProperty__.js.map +1 -1
  65. package/out/concepts/Entity__.d.ts +2 -2
  66. package/out/concepts/Entity__.js +4 -7
  67. package/out/concepts/Entity__.js.map +1 -1
  68. package/out/concepts/EnumItem__.d.ts +1 -12
  69. package/out/concepts/EnumItem__.js +17 -49
  70. package/out/concepts/EnumItem__.js.map +1 -1
  71. package/out/concepts/EnumSelectSetter__.d.ts +4 -0
  72. package/out/concepts/EnumSelectSetter__.js +7 -0
  73. package/out/concepts/EnumSelectSetter__.js.map +1 -1
  74. package/out/concepts/Enum__.js +1 -4
  75. package/out/concepts/Enum__.js.map +1 -1
  76. package/out/concepts/ForEachStatement__.js +1 -1
  77. package/out/concepts/ForEachStatement__.js.map +1 -1
  78. package/out/concepts/FrontendLibrary__.d.ts +52 -48
  79. package/out/concepts/FrontendLibrary__.js +45 -36
  80. package/out/concepts/FrontendLibrary__.js.map +1 -1
  81. package/out/concepts/FrontendType__.d.ts +4 -0
  82. package/out/concepts/FrontendType__.js +7 -0
  83. package/out/concepts/FrontendType__.js.map +1 -1
  84. package/out/concepts/Frontend__.d.ts +2 -0
  85. package/out/concepts/Frontend__.js +21 -2
  86. package/out/concepts/Frontend__.js.map +1 -1
  87. package/out/concepts/HistoryProcessV2__.js +4 -1
  88. package/out/concepts/HistoryProcessV2__.js.map +1 -1
  89. package/out/concepts/I18nInfo__.d.ts +0 -1
  90. package/out/concepts/I18nInfo__.js +0 -7
  91. package/out/concepts/I18nInfo__.js.map +1 -1
  92. package/out/concepts/Identifier__.d.ts +2 -0
  93. package/out/concepts/Identifier__.js +31 -0
  94. package/out/concepts/Identifier__.js.map +1 -1
  95. package/out/concepts/IfStatement__.js +2 -2
  96. package/out/concepts/IfStatement__.js.map +1 -1
  97. package/out/concepts/Interface__.js +1 -4
  98. package/out/concepts/Interface__.js.map +1 -1
  99. package/out/concepts/LogicItem__.d.ts +1 -1
  100. package/out/concepts/LogicItem__.js.map +1 -1
  101. package/out/concepts/Logic__.d.ts +16 -1
  102. package/out/concepts/Logic__.js +133 -15
  103. package/out/concepts/Logic__.js.map +1 -1
  104. package/out/concepts/ManagerV2__.d.ts +34 -0
  105. package/out/concepts/ManagerV2__.js +61 -0
  106. package/out/concepts/ManagerV2__.js.map +1 -0
  107. package/out/concepts/MatchCase__.d.ts +2 -2
  108. package/out/concepts/MatchCase__.js +7 -7
  109. package/out/concepts/MatchCase__.js.map +1 -1
  110. package/out/concepts/MemberExpression__.js +1 -0
  111. package/out/concepts/MemberExpression__.js.map +1 -1
  112. package/out/concepts/Module__.d.ts +88 -0
  113. package/out/concepts/Module__.js +85 -0
  114. package/out/concepts/Module__.js.map +1 -1
  115. package/out/concepts/OperatePermissionV2__.d.ts +1 -1
  116. package/out/concepts/OperatePermissionV2__.js.map +1 -1
  117. package/out/concepts/Param__.d.ts +4 -0
  118. package/out/concepts/Param__.js +13 -21
  119. package/out/concepts/Param__.js.map +1 -1
  120. package/out/concepts/ProcessElementV2__.d.ts +6 -1
  121. package/out/concepts/ProcessElementV2__.js +20 -0
  122. package/out/concepts/ProcessElementV2__.js.map +1 -1
  123. package/out/concepts/ProcessElement__.d.ts +7 -0
  124. package/out/concepts/ProcessElement__.js +47 -0
  125. package/out/concepts/ProcessElement__.js.map +1 -1
  126. package/out/concepts/ProcessV2__.d.ts +1 -34
  127. package/out/concepts/ProcessV2__.js +3 -70
  128. package/out/concepts/ProcessV2__.js.map +1 -1
  129. package/out/concepts/QueryFromExpression__.js +2 -2
  130. package/out/concepts/QueryFromExpression__.js.map +1 -1
  131. package/out/concepts/QueryJoinExpression__.js +2 -2
  132. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  133. package/out/concepts/StaticString__.d.ts +0 -4
  134. package/out/concepts/StaticString__.js +0 -11
  135. package/out/concepts/StaticString__.js.map +1 -1
  136. package/out/concepts/StructureProperty__.d.ts +1 -0
  137. package/out/concepts/StructureProperty__.js +14 -5
  138. package/out/concepts/StructureProperty__.js.map +1 -1
  139. package/out/concepts/Structure__.d.ts +4 -0
  140. package/out/concepts/Structure__.js +6 -9
  141. package/out/concepts/Structure__.js.map +1 -1
  142. package/out/concepts/SubLogic__.d.ts +418 -0
  143. package/out/concepts/SubLogic__.js +992 -0
  144. package/out/concepts/SubLogic__.js.map +1 -0
  145. package/out/concepts/Theme__.d.ts +9 -0
  146. package/out/concepts/Theme__.js +10 -0
  147. package/out/concepts/Theme__.js.map +1 -1
  148. package/out/concepts/Transactional__.d.ts +0 -1
  149. package/out/concepts/Transactional__.js +0 -7
  150. package/out/concepts/Transactional__.js.map +1 -1
  151. package/out/concepts/TypeAnnotation__.js +18 -0
  152. package/out/concepts/TypeAnnotation__.js.map +1 -1
  153. package/out/concepts/TypeParam__.d.ts +1 -0
  154. package/out/concepts/TypeParam__.js.map +1 -1
  155. package/out/concepts/ValidationRule__.d.ts +6 -1
  156. package/out/concepts/ValidationRule__.js +6 -1
  157. package/out/concepts/ValidationRule__.js.map +1 -1
  158. package/out/concepts/ViewElement__.d.ts +8 -2
  159. package/out/concepts/ViewElement__.js +213 -32
  160. package/out/concepts/ViewElement__.js.map +1 -1
  161. package/out/concepts/View__.d.ts +10 -2
  162. package/out/concepts/View__.js +129 -17
  163. package/out/concepts/View__.js.map +1 -1
  164. package/out/concepts/basics/stdlib/nasl.processV2.d.ts +2 -0
  165. package/out/concepts/basics/stdlib/nasl.processV2.js +50 -4
  166. package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
  167. package/out/concepts/basics/types/index.d.ts +1 -1
  168. package/out/concepts/basics/types/index.js +2 -1
  169. package/out/concepts/basics/types/index.js.map +1 -1
  170. package/out/concepts/index__.d.ts +9 -0
  171. package/out/concepts/index__.js +9 -0
  172. package/out/concepts/index__.js.map +1 -1
  173. package/out/concepts/utils/asserts.d.ts +409 -0
  174. package/out/concepts/utils/asserts.js +564 -14
  175. package/out/concepts/utils/asserts.js.map +1 -1
  176. package/out/concepts/utils/types.d.ts +33 -2
  177. package/out/generator/genBundleFiles.d.ts +13 -9
  178. package/out/generator/genBundleFiles.js +383 -63
  179. package/out/generator/genBundleFiles.js.map +1 -1
  180. package/out/generator/genMetaData.js +2 -0
  181. package/out/generator/genMetaData.js.map +1 -1
  182. package/out/generator/release-body/body.js +1 -0
  183. package/out/generator/release-body/body.js.map +1 -1
  184. package/out/generator/release-body/utils.d.ts +15 -7
  185. package/out/generator/release-body/utils.js +50 -7
  186. package/out/generator/release-body/utils.js.map +1 -1
  187. package/out/natural/genNaturalTS.js +2 -4
  188. package/out/natural/genNaturalTS.js.map +1 -1
  189. package/out/natural/getContext/index.js +0 -2
  190. package/out/natural/getContext/index.js.map +1 -1
  191. package/out/natural/transformTS2UI.js.map +1 -1
  192. package/out/natural/transformTSCode.d.ts +1 -1
  193. package/out/natural/transformTSCode.js.map +1 -1
  194. package/out/server/extendBaseNode.js +9 -0
  195. package/out/server/extendBaseNode.js.map +1 -1
  196. package/out/server/getLogics.js +10 -6
  197. package/out/server/getLogics.js.map +1 -1
  198. package/out/server/getMemberIdentifier.js +6 -0
  199. package/out/server/getMemberIdentifier.js.map +1 -1
  200. package/out/server/getProcessesV2.d.ts +3 -2
  201. package/out/server/getProcessesV2.js +15 -6
  202. package/out/server/getProcessesV2.js.map +1 -1
  203. package/out/server/naslServer.d.ts +5 -1
  204. package/out/server/naslServer.js +120 -30
  205. package/out/server/naslServer.js.map +1 -1
  206. package/out/server/translator.js +4 -0
  207. package/out/server/translator.js.map +1 -1
  208. package/out/service/storage/init.d.ts +2 -1
  209. package/out/service/storage/init.js +28 -71
  210. package/out/service/storage/init.js.map +1 -1
  211. package/out/templator/genCreateBlock.d.ts +6 -2
  212. package/out/templator/genCreateBlock.js +25 -8
  213. package/out/templator/genCreateBlock.js.map +1 -1
  214. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +22 -0
  215. package/out/templator/genCurdEditMultipleKeyBlock.js +60 -1
  216. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  217. package/out/templator/genCurdMultipleKeyBlock.d.ts +13 -3
  218. package/out/templator/genCurdMultipleKeyBlock.js +29 -23
  219. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  220. package/out/templator/genGetBlock.d.ts +1 -1
  221. package/out/templator/genGetBlock.js +3 -2
  222. package/out/templator/genGetBlock.js.map +1 -1
  223. package/out/templator/genListViewBlock.d.ts +1 -1
  224. package/out/templator/genListViewBlock.js +3 -2
  225. package/out/templator/genListViewBlock.js.map +1 -1
  226. package/out/templator/genSelectBlock.d.ts +1 -1
  227. package/out/templator/genSelectBlock.js +3 -2
  228. package/out/templator/genSelectBlock.js.map +1 -1
  229. package/out/templator/genTableBlock.d.ts +9 -4
  230. package/out/templator/genTableBlock.js +31 -17
  231. package/out/templator/genTableBlock.js.map +1 -1
  232. package/out/templator/genUpdateBlock.d.ts +2 -2
  233. package/out/templator/genUpdateBlock.js +11 -11
  234. package/out/templator/genUpdateBlock.js.map +1 -1
  235. package/out/translator/types.d.ts +0 -4
  236. package/out/translator/utils.d.ts +0 -1
  237. package/out/translator/utils.js +1 -6
  238. package/out/translator/utils.js.map +1 -1
  239. package/out/utils/delay/index.d.ts +0 -0
  240. package/out/utils/delay/index.js +1 -0
  241. package/out/utils/delay/index.js.map +1 -0
  242. package/out/utils/env.d.ts +0 -4
  243. package/out/utils/env.js +3 -6
  244. package/out/utils/env.js.map +1 -1
  245. package/out/utils/index.d.ts +3 -2
  246. package/out/utils/index.js +18 -14
  247. package/out/utils/index.js.map +1 -1
  248. package/out/utils/time-slicing/controller.js.map +1 -1
  249. package/out/utils/types.d.ts +0 -17
  250. package/package.json +27 -20
  251. package/sandbox/stdlib/extension.component.ts +29 -0
  252. package/sandbox/stdlib/nasl.process.ts +17 -0
  253. package/sandbox/stdlib/nasl.processV2.ts +10 -5
  254. package/sandbox/stdlib/nasl.util.ts +3 -1
  255. package/src/automate/engine/utils.js +7 -2
  256. package/src/bak/translator.js +42 -1
  257. package/src/breakpoint/shared/utils.ts +2 -1
  258. package/src/common/BaseNode.ts +117 -5
  259. package/src/concepts/Annotatable__.ts +263 -0
  260. package/src/concepts/AnnotationProperty__.ts +102 -0
  261. package/src/concepts/Annotation__.ts +344 -0
  262. package/src/concepts/App__.ts +917 -26
  263. package/src/concepts/ApplyAnnotation__.ts +198 -0
  264. package/src/concepts/Argument__.ts +145 -1
  265. package/src/concepts/AssigneeV2__.ts +387 -1
  266. package/src/concepts/AuthLogicForCallInterface__.ts +1 -1
  267. package/src/concepts/AuthLogic__.ts +1 -1
  268. package/src/concepts/BooleanLiteral__.ts +9 -1
  269. package/src/concepts/BusinessLogic__.ts +1 -1
  270. package/src/concepts/CallFunction__.ts +1 -1
  271. package/src/concepts/CallLogic__.ts +153 -16
  272. package/src/concepts/ConnectorLogic__.ts +1 -1
  273. package/src/concepts/DatabaseTypeAnnotation__.ts +0 -11
  274. package/src/concepts/DepartmentManagerV2__.ts +70 -0
  275. package/src/concepts/DepartmentV2__.ts +75 -0
  276. package/src/concepts/DirectManagerV2__.ts +65 -0
  277. package/src/concepts/End__.ts +10 -1
  278. package/src/concepts/EntityProperty__.ts +0 -5
  279. package/src/concepts/Entity__.ts +5 -9
  280. package/src/concepts/EnumItem__.ts +16 -65
  281. package/src/concepts/EnumSelectSetter__.ts +6 -0
  282. package/src/concepts/Enum__.ts +1 -6
  283. package/src/concepts/ForEachStatement__.ts +1 -1
  284. package/src/concepts/FrontendLibrary__.ts +88 -80
  285. package/src/concepts/FrontendType__.ts +6 -0
  286. package/src/concepts/Frontend__.ts +26 -3
  287. package/src/concepts/HistoryProcessV2__.ts +5 -0
  288. package/src/concepts/I18nInfo__.ts +0 -5
  289. package/src/concepts/Identifier__.ts +32 -0
  290. package/src/concepts/IfStatement__.ts +2 -2
  291. package/src/concepts/Interface__.ts +1 -6
  292. package/src/concepts/LogicItem__.ts +1 -0
  293. package/src/concepts/Logic__.ts +140 -17
  294. package/src/concepts/ManagerV2__.ts +78 -0
  295. package/src/concepts/MatchCase__.ts +9 -8
  296. package/src/concepts/MemberExpression__.ts +1 -0
  297. package/src/concepts/Module__.ts +194 -0
  298. package/src/concepts/OperatePermissionV2__.ts +1 -1
  299. package/src/concepts/Param__.ts +17 -20
  300. package/src/concepts/ProcessElementV2__.ts +23 -0
  301. package/src/concepts/ProcessElement__.ts +18 -0
  302. package/src/concepts/ProcessV2__.ts +4 -70
  303. package/src/concepts/QueryFromExpression__.ts +2 -2
  304. package/src/concepts/QueryJoinExpression__.ts +2 -2
  305. package/src/concepts/StaticString__.ts +0 -13
  306. package/src/concepts/StructureProperty__.ts +16 -7
  307. package/src/concepts/Structure__.ts +10 -11
  308. package/src/concepts/SubLogic__.ts +1516 -0
  309. package/src/concepts/Theme__.ts +9 -0
  310. package/src/concepts/Transactional__.ts +0 -5
  311. package/src/concepts/TriggerLauncher__.ts +1 -1
  312. package/src/concepts/TypeAnnotation__.ts +17 -0
  313. package/src/concepts/TypeParam__.ts +3 -0
  314. package/src/concepts/ValidationRule__.ts +6 -1
  315. package/src/concepts/ViewElement__.ts +224 -34
  316. package/src/concepts/View__.ts +135 -22
  317. package/src/concepts/basics/stdlib/nasl.processV2.ts +56 -3
  318. package/src/concepts/basics/types/index.ts +1 -1
  319. package/src/concepts/index__.ts +9 -0
  320. package/src/concepts/utils/asserts.ts +595 -0
  321. package/src/concepts/utils/types.ts +53 -0
  322. package/src/generator/genBundleFiles.ts +408 -68
  323. package/src/generator/genMetaData.ts +3 -0
  324. package/src/generator/release-body/body.ts +1 -0
  325. package/src/generator/release-body/utils.ts +159 -55
  326. package/src/natural/genNaturalTS.ts +3 -5
  327. package/src/natural/getContext/index.ts +0 -2
  328. package/src/natural/transformTS2UI.ts +5 -2
  329. package/src/natural/transformTSCode.ts +2 -2
  330. package/src/server/extendBaseNode.ts +11 -2
  331. package/src/server/getLogics.ts +9 -7
  332. package/src/server/getMemberIdentifier.ts +7 -0
  333. package/src/server/getProcessesV2.ts +16 -6
  334. package/src/server/naslServer.ts +133 -30
  335. package/src/server/translator.ts +4 -0
  336. package/src/service/storage/init.ts +52 -97
  337. package/src/templator/genCreateBlock.ts +35 -14
  338. package/src/templator/genCurdEditMultipleKeyBlock.ts +65 -1
  339. package/src/templator/genCurdMultipleKeyBlock.ts +42 -23
  340. package/src/templator/genGetBlock.ts +4 -3
  341. package/src/templator/genListViewBlock.ts +3 -3
  342. package/src/templator/genSelectBlock.ts +4 -2
  343. package/src/templator/genTableBlock.ts +32 -17
  344. package/src/templator/genUpdateBlock.ts +21 -18
  345. package/src/translator/types.ts +0 -4
  346. package/src/translator/utils.ts +0 -6
  347. package/src/utils/delay/index.ts +0 -0
  348. package/src/utils/env.ts +4 -5
  349. package/src/utils/index.ts +16 -4
  350. package/src/utils/time-slicing/controller.ts +1 -0
  351. package/src/utils/types.ts +0 -20
  352. package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +2 -1
  353. package/ts-worker/bundle.js +1 -1
  354. package/ts-worker/src/index.js +1 -0
  355. package/out/utils/language-cache/constant.d.ts +0 -18
  356. package/out/utils/language-cache/constant.js +0 -35
  357. package/out/utils/language-cache/constant.js.map +0 -1
  358. package/out/utils/language-cache/index.d.ts +0 -2
  359. package/out/utils/language-cache/index.js +0 -19
  360. package/out/utils/language-cache/index.js.map +0 -1
  361. package/out/utils/language-cache/nasl.d.ts +0 -10
  362. package/out/utils/language-cache/nasl.js +0 -98
  363. package/out/utils/language-cache/nasl.js.map +0 -1
  364. package/out/utils/language-cache/types.d.ts +0 -44
  365. package/out/utils/language-cache/types.js +0 -4
  366. package/out/utils/language-cache/types.js.map +0 -1
  367. package/src/utils/language-cache/constant.ts +0 -37
  368. package/src/utils/language-cache/index.ts +0 -2
  369. package/src/utils/language-cache/nasl.ts +0 -83
  370. package/src/utils/language-cache/types.ts +0 -48
@@ -1,16 +1,19 @@
1
- import type {
2
- App,
3
- Role,
4
- View,
5
- ViewElement,
6
- Frontend,
7
- FrontendType,
8
- } from '../../concepts';
1
+ import type { App, Role, View, ViewElement, Frontend, FrontendType } from '../../concepts';
9
2
 
10
3
  import { AxiosInstance } from 'axios';
11
4
  import * as asserts from '../../concepts/utils/asserts';
12
5
  import { ReleaseData, ReleaseMode } from './types';
13
- import { HttpData, VersionDetail, MaterialData, EnvData, TenantData, AppDetailData, Asset } from './internal';
6
+ import {
7
+ HttpData,
8
+ VersionDetail,
9
+ MaterialData,
10
+ EnvData,
11
+ TenantData,
12
+ AppDetailData,
13
+ Asset,
14
+ } from './internal';
15
+ import { sliceTagContent } from '../../utils';
16
+ import * as utils from '../../utils';
14
17
 
15
18
  /**
16
19
  * 权限上报数据
@@ -19,7 +22,12 @@ export function getAuthReport(app: App, frontends: Array<Frontend>) {
19
22
  const result = {
20
23
  roleList: [] as Array<Role>,
21
24
  resourceList: [] as Array<string>,
22
- resourceDataList: [] as Array<{ value: string; description: string; type: 'page' | 'component' | 'logic'; clientType?: string }>,
25
+ resourceDataList: [] as Array<{
26
+ value: string;
27
+ description: string;
28
+ type: 'page' | 'component' | 'logic';
29
+ clientType?: string;
30
+ }>,
23
31
  roleResourceMappingList: [] as Array<{ roleName: string; resourcePath: string }>,
24
32
  };
25
33
 
@@ -96,7 +104,11 @@ export function findAllReportIdList(app: App, frontends: Array<Frontend>) {
96
104
  return [...new Set(reportIds)].filter(Boolean);
97
105
  }
98
106
 
99
- export function replaceAssetUrl(files: Array<{ name: string; content: string }>, oldUrlWithoutProtocol: string, newUrlWithProtocol: string) {
107
+ export function replaceAssetUrl(
108
+ files: Array<{ name: string; content: string }>,
109
+ oldUrlWithoutProtocol: string,
110
+ newUrlWithProtocol: string
111
+ ) {
100
112
  const newUrlWithoutProtocol = newUrlWithProtocol.replace(/^https?:/, '');
101
113
  if (newUrlWithoutProtocol === oldUrlWithoutProtocol) return files;
102
114
 
@@ -105,14 +117,18 @@ export function replaceAssetUrl(files: Array<{ name: string; content: string }>,
105
117
  for (const file of files) {
106
118
  // 清除 query 参数
107
119
  file.content = file.content.replace(reg, (...args) => args[0].split('?')[0]);
108
- file.content = file.content.replace(reg2, (whole, protocol) => (protocol ? newUrlWithProtocol : newUrlWithoutProtocol));
109
- file.name = file.name.replace(reg2, (whole, protocol) => (protocol ? newUrlWithProtocol : newUrlWithoutProtocol));
120
+ file.content = file.content.replace(reg2, (whole, protocol) =>
121
+ protocol ? newUrlWithProtocol : newUrlWithoutProtocol
122
+ );
123
+ file.name = file.name.replace(reg2, (whole, protocol) =>
124
+ protocol ? newUrlWithProtocol : newUrlWithoutProtocol
125
+ );
110
126
  }
111
127
  return files;
112
128
  }
113
129
 
114
130
  export function getFrontendByTypes(frontendTypes: FrontendType[] = []) {
115
- return (frontendTypes?.map((frontendType) => (frontendType?.frontends || [])) || []).flat(2);
131
+ return (frontendTypes?.map((frontendType) => frontendType?.frontends || []) || []).flat(2);
116
132
  }
117
133
 
118
134
  /**
@@ -152,7 +168,13 @@ export async function getUsedAssets(axios: AxiosInstance, id: string, frontends:
152
168
  return Array.from(assetSet);
153
169
  }
154
170
 
155
- export async function staticResourceSync(axios: AxiosInstance, assets: Array<Asset>, id: string, env: string, frontends: Frontend[]) {
171
+ export async function staticResourceSync(
172
+ axios: AxiosInstance,
173
+ assets: Array<Asset>,
174
+ id: string,
175
+ env: string,
176
+ frontends: Frontend[]
177
+ ) {
156
178
  const urlNameMap: Record<string, string> = {};
157
179
  const assetSet = new Set<string>();
158
180
 
@@ -172,23 +194,31 @@ export async function staticResourceSync(axios: AxiosInstance, assets: Array<Ass
172
194
  // 发起资源同步请求,传递nasl使用到的资源名称
173
195
  const needSyncResourceNameList = Array.from(assetSet);
174
196
  const { data: res } = await axios.post(
175
- '/api/v1/app/env/staticResourceSync',
176
- {
177
- needSyncResourceNameList,
178
- },
179
- {
180
- params: {
181
- appId: id,
182
- env: env,
183
- },
197
+ '/api/v1/app/env/staticResourceSync',
198
+ {
199
+ needSyncResourceNameList,
200
+ },
201
+ {
202
+ params: {
203
+ appId: id,
204
+ env: env,
184
205
  },
206
+ }
185
207
  );
186
208
 
187
209
  return (res as any).result.ossUrlPrefixExcludeProtocol;
188
210
  }
189
211
 
190
- export async function getPackageInfos(axios: AxiosInstance, app: App, dependencies: VersionDetail['dependencies'], staticUrl: string, fullVersion: string) {
191
- const { data: materialCode } = await axios.get<string>(`${staticUrl}/packages/@lcap/mdd-ide@${fullVersion}/dist-mdd-ide/material.config.js`);
212
+ export async function getPackageInfos(
213
+ axios: AxiosInstance,
214
+ app: App,
215
+ dependencies: VersionDetail['dependencies'],
216
+ staticUrl: string,
217
+ fullVersion: string
218
+ ) {
219
+ const { data: materialCode } = await axios.get<string>(
220
+ `${staticUrl}/packages/@lcap/mdd-ide@${fullVersion}/dist-mdd-ide/material.config.js`
221
+ );
192
222
  const window = {} as { LCAP_MATERIALS: MaterialData };
193
223
  eval(materialCode);
194
224
  return app.loadPackageInfos(window.LCAP_MATERIALS);
@@ -196,7 +226,17 @@ export async function getPackageInfos(axios: AxiosInstance, app: App, dependenci
196
226
 
197
227
  export async function getAppInfo(axios: AxiosInstance, releaseData: ReleaseData) {
198
228
  const { config } = releaseData;
199
- const [{ data: { result: env } }, { data: { result: appData } }, { data: { result: tenant } }] = await Promise.all([
229
+ const [
230
+ {
231
+ data: { result: env },
232
+ },
233
+ {
234
+ data: { result: appData },
235
+ },
236
+ {
237
+ data: { result: tenant },
238
+ },
239
+ ] = await Promise.all([
200
240
  axios.get<HttpData<EnvData>>('/api/v1/env/config'),
201
241
  axios.get<HttpData<AppDetailData>>('/api/v1/lcpapp/getLcpAppByAppId', {
202
242
  params: {
@@ -221,7 +261,7 @@ export async function getAppInfo(axios: AxiosInstance, releaseData: ReleaseData)
221
261
  isPreviewFe: config.mode === ReleaseMode.ExportTemplate,
222
262
  realRelease: config.mode === ReleaseMode.Release,
223
263
  debug: config.debug,
224
- STATIC_URL: isExport ? '' : (env.STATIC_URL || 'https://static-vusion.163yun.com'),
264
+ STATIC_URL: isExport ? '' : env.STATIC_URL || 'https://static-vusion.163yun.com',
225
265
  extendedConfig: appData?.extendedConfig,
226
266
  ...tenant,
227
267
  };
@@ -229,33 +269,41 @@ export async function getAppInfo(axios: AxiosInstance, releaseData: ReleaseData)
229
269
 
230
270
  export async function getVersionDetail(axios: AxiosInstance, app: any) {
231
271
  const sampleVersion = app.ideVersion as string;
232
- const { data: versionData } = await axios.get<HttpData<VersionDetail>>(`/api/v1/ide/version/user/detail?version=${sampleVersion}`);
272
+ const { data: versionData } = await axios.get<HttpData<VersionDetail>>(
273
+ `/api/v1/ide/version/user/detail?version=${sampleVersion}`
274
+ );
233
275
  const fullVersion = versionData.result.version;
234
276
 
235
277
  return {
236
- version: sampleVersion,
237
- fullVersion: fullVersion,
238
- dependencies: versionData.result.dependencies,
278
+ version: sampleVersion,
279
+ fullVersion: fullVersion,
280
+ dependencies: versionData.result.dependencies,
239
281
  };
240
282
  }
241
283
 
242
- export async function getValidationRules(axios: AxiosInstance, ideVersion: string, frontends: FrontendType[]) {
284
+ export async function getValidationRules(
285
+ axios: AxiosInstance,
286
+ ideVersion: string,
287
+ frontends: FrontendType[]
288
+ ) {
243
289
  const formData = new FormData();
244
- formData.append('file', new Blob([JSON.stringify(frontends.map((view) => view.toJSON()))], { type: 'application/json' }));
245
- const validations = await axios({
290
+ formData.append(
291
+ 'file',
292
+ new Blob([JSON.stringify(frontends.map((view) => view.toJSON()))], { type: 'application/json' })
293
+ );
294
+ const validations = await axios<HttpData>({
246
295
  method: 'post',
247
296
  url: `/api/v1/ide/nasl/frontend/call-logic/validations/batch`,
248
297
  headers: {
249
- ideVersion: ideVersion,
250
- 'Content-Type': 'multipart/form-data',
298
+ ideVersion: ideVersion,
299
+ 'Content-Type': 'multipart/form-data',
251
300
  },
252
301
  data: formData,
253
302
  }).catch((e) => e);
254
303
 
255
304
  if (!validations.data?.success) {
256
305
  return `获取服务端验证器配置失败:${validations.data?.msg ?? ''}`;
257
- }
258
- else {
306
+ } else {
259
307
  return validations.data.result;
260
308
  }
261
309
  }
@@ -295,6 +343,47 @@ export function getContentType(fileName: string) {
295
343
  }
296
344
  }
297
345
 
346
+ /**
347
+ * 生成流程表单
348
+ * @param entity
349
+ * @param view
350
+ * @returns
351
+ * @description 生成流程表单代码,逻辑比较定制化,由于封闭形态下表单修改不容易同步更新审批页流程表单,所以流程页表单在预览生成时补充生成
352
+ */
353
+ export function genProcessFormCode(view: View) {
354
+ const processV2 = view.getDestinationProcessV2();
355
+ let res = '';
356
+ if (!processV2?.composedBy) {
357
+ return res;
358
+ }
359
+
360
+ const entity = processV2.currentBindEntity,
361
+ nodes = view.app.getCompose(processV2.composedBy)?.nodes || [],
362
+ form = nodes.find((node) => node.name === node.composedBy[0]),
363
+ frontendType = view.frontend.type,
364
+ processName = processV2.name,
365
+ tagPrefix = frontendType === 'pc' ? 'u' : 'van';
366
+ // res = sliceTagContent(form.toVue(), `${tagPrefix}-form`);
367
+ // 定义正则表达式
368
+ const regex = frontendType === 'pc' ? /<u-form\b[^>]*>([\s\S]*?)<\/u-form>/i : /<van-form\b[^>]*>([\s\S]*?)<\/van-form>/i;
369
+
370
+ // 使用正则表达式匹配内容
371
+ const matches = regex.exec(form.toVue({filterAttr:['processHidden']}));
372
+
373
+ // 获取匹配到的内容
374
+ res = matches[1];
375
+ res = res.replaceAll(entity.name, `processDetailFormData.data`); // TODO: 这样替换可能有问题,需要进一步测试
376
+ if (frontendType === 'pc') {
377
+ // 删除最后的btns
378
+ let startIndex = res.lastIndexOf('<u-grid-layout-column');
379
+ let endIndex = res.lastIndexOf('</u-grid-layout-column>') + '</u-grid-layout-column>'.length;
380
+ res = res.substring(0, startIndex) + res.substring(endIndex);
381
+ } else {
382
+ res = res.replace(/<van-button[^>]*>.*<\/van-button>/g, '');
383
+ }
384
+ return res;
385
+ }
386
+
298
387
  /**
299
388
  * 权限上报表单定义数据
300
389
  */
@@ -302,20 +391,19 @@ export function getProcessFormDefinitions(app: App) {
302
391
  let res: any = [];
303
392
  const processV2s = app?.processV2s || [];
304
393
  processV2s.forEach((process) => {
305
-
306
- const itemPC: { keys: string[], content: string} = {
394
+ const itemPC: { keys: string[]; content: string } = {
307
395
  keys: [],
308
- content:'',
396
+ content: '',
309
397
  };
310
398
 
311
- const itemH5: { keys: string[], content: string} = {
399
+ const itemH5: { keys: string[]; content: string } = {
312
400
  keys: [],
313
- content:'',
401
+ content: '',
314
402
  };
315
403
 
316
404
  process.elements.forEach((element) => {
317
405
  const attrPC = element?.bindAttrs.find((attr) => attr.name === 'destination-pc'),
318
- attrH5 = element?.bindAttrs.find((attr) => attr.name === 'destination-m');
406
+ attrH5 = element?.bindAttrs.find((attr) => attr.name === 'destination-m');
319
407
 
320
408
  const patchKey = (attr: any, type: string, item: any) => {
321
409
  if (attr) {
@@ -327,19 +415,37 @@ export function getProcessFormDefinitions(app: App) {
327
415
  if (!item.content && form) {
328
416
  formDefinition = form.toVue();
329
417
  const processPrefix = form.getBindAttribute('processPrefix')?.value;
330
- formDefinition = formDefinition.replaceAll(`${processPrefix}.`, 'processDetailFormData.');
331
- formDefinition = formDefinition.replaceAll(`${process.name}.`, 'processDetailFormData.');
332
- formDefinition = formDefinition.replace(/:ref="([^"]+)"/g, (match: any, p1: string) => {
333
- // ref-name加上方便制品找表单
334
- return `:ref="${p1}" ref-name="${p1.replace(/^`+|`+$/g, "")}" `;
335
- });
336
-
418
+ formDefinition = formDefinition.replaceAll(
419
+ `${processPrefix}.`,
420
+ 'processDetailFormData.'
421
+ );
422
+ formDefinition = formDefinition.replaceAll(
423
+ `${process.name}.`,
424
+ 'processDetailFormData.'
425
+ );
426
+ formDefinition = formDefinition.replace(
427
+ /:ref="([^"]+)"/g,
428
+ (match: any, p1: string) => {
429
+ // ref-name加上方便制品找表单
430
+ return `:ref="${p1}" ref-name="${p1.replace(/^`+|`+$/g, '')}" `;
431
+ }
432
+ );
433
+
434
+ if (process?.composedBy) {
435
+ const formInfo = genProcessFormCode(view);
436
+ console.log('formInfo: ', formInfo);
437
+ // 往form内塞入内容
438
+ if (type === 'pc')
439
+ formDefinition = formDefinition.replace(/<\/u-form>/, `${formInfo}</u-form>`);
440
+ else
441
+ formDefinition = formDefinition.replace(/<\/van-form>/, `${formInfo}</van-form>`);
442
+ }
337
443
  item.content = formDefinition;
338
444
  }
339
445
  item.keys.push(key);
340
446
  }
341
447
  }
342
- }
448
+ };
343
449
  attrPC && patchKey(attrPC, 'pc', itemPC);
344
450
  attrH5 && patchKey(attrH5, 'm', itemH5);
345
451
  });
@@ -351,9 +457,7 @@ export function getProcessFormDefinitions(app: App) {
351
457
  if (itemH5.keys.length && itemH5.content) {
352
458
  res.push(itemH5);
353
459
  }
354
-
355
460
  });
356
461
 
357
462
  return res;
358
463
  }
359
-
@@ -96,10 +96,8 @@ export function genNaturalTSContextForLogic(
96
96
  code += getFrontendViews(frontend, state, currentNode, true).code;
97
97
  }
98
98
 
99
- if (focusedNodePath) {
100
- code += '\n### 当前逻辑上下文\n';
101
- code += getCurrentNodeContext(currentNode, focusedNodePath).code;
102
- }
99
+ code += '\n### 当前逻辑上下文\n';
100
+ code += getCurrentNodeContext(currentNode, focusedNodePath).code;
103
101
  return code;
104
102
  }
105
103
 
@@ -251,4 +249,4 @@ export function genNaturalTSContextJSONForUI(
251
249
  };
252
250
  }
253
251
 
254
- export * as getNaturalContext from './getContext';
252
+ export * as getNaturalContext from './getContext';
@@ -418,8 +418,6 @@ export function getFrontendViews(frontend: Frontend, state: TranslatorState, cur
418
418
  rename,
419
419
  });
420
420
  code += tempCode;
421
- if (state.descriptionComment)
422
- code += `/* ${description} */`;
423
421
  code += `\n`;
424
422
  data.push({ description, code: tempCode });
425
423
  const prefix = `${namespace}.${view?.name}_view`;
@@ -6,6 +6,7 @@ import * as babelTypes from '@babel/types';
6
6
  import generate from '@babel/generator';
7
7
  import * as naslTypes from '../concepts';
8
8
  import { genHash } from '../generator';
9
+ import { type ParseResult } from '@babel/parser';
9
10
 
10
11
  const DEBUG = false;
11
12
  function throwError(message: string) {
@@ -1155,10 +1156,12 @@ function transformNode2ViewConstruct(node: babelTypes.Node): naslTypes.ViewEleme
1155
1156
  return null;
1156
1157
  }
1157
1158
 
1159
+ type ParseResultFile = ParseResult<babel.types.File>;
1160
+
1158
1161
  /**
1159
1162
  * 转换Node为View
1160
1163
  */
1161
- function transformNode2View(node: babelTypes.FunctionDeclaration, root?: babelTypes.File): { view: naslTypes.View, json: any; } {
1164
+ function transformNode2View(node: babelTypes.FunctionDeclaration, root?: ParseResultFile): { view: naslTypes.View, json: any; } {
1162
1165
  const parameters: babelTypes.Identifier[] = node.params as babelTypes.Identifier[];
1163
1166
  let statements: babelTypes.Statement[] = node.body.body;
1164
1167
  const currentPositionComment = root?.comments.find((comment) => comment.type === 'CommentLine' && comment.value === ' 当前页面');
@@ -1208,7 +1211,7 @@ const transformTS2View = (tsCode: string): any => {
1208
1211
  const root = babel.parseSync(tsCode, {
1209
1212
  filename: 'result.ts',
1210
1213
  presets: [require('@babel/preset-typescript')],
1211
- }) as babelTypes.File;
1214
+ });
1212
1215
 
1213
1216
  let func: babelTypes.FunctionDeclaration;
1214
1217
  if (root.program?.body[0]?.type === 'ExportNamedDeclaration') {
@@ -16,7 +16,7 @@ export function tryParseTS(tsCode: string) {
16
16
  const root = babel.parseSync(tsCode, {
17
17
  filename: 'result.ts',
18
18
  presets: [require('@babel/preset-typescript')],
19
- }) as babelTypes.File;
19
+ });
20
20
  // console.log((root as any).program.body[0].body.body.map((item) => item.trailingComments));
21
21
  return root;
22
22
  } catch (e) {
@@ -970,7 +970,7 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
970
970
  const root = babel.parseSync(tsCode, {
971
971
  filename: 'result.ts',
972
972
  presets: [require('@babel/preset-typescript')],
973
- }) as babelTypes.File;
973
+ });
974
974
 
975
975
  let parameters: babelTypes.Identifier[] = [];
976
976
  let statements: babelTypes.Statement[] = [];
@@ -29,13 +29,14 @@ import {
29
29
  ProcessV2,
30
30
  ProcessBindV2,
31
31
  FieldPermissionV2,
32
+ Argument,
32
33
  } from '../concepts';
33
34
  import { FileNode, traverse } from '../utils';
34
35
  import { EventPayload, invokeCommand, registerCommand } from '../common';
35
36
  import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
36
37
 
37
38
  import { extendSentryMonitorNaslNode } from '../sentry';
38
- import { isAuthLogicForCallInterface, isParam } from '../concepts/utils/asserts';
39
+ import { isAuthLogicForCallInterface, isParam, isSubLogic } from '../concepts/utils/asserts';
39
40
 
40
41
  interface SetNameNode extends BaseNode {
41
42
  setName(name: string): any;
@@ -613,7 +614,14 @@ BaseNode.prototype.prepareDelete = async function prepareDelete(cb?: Function) {
613
614
  );
614
615
  this.delete();
615
616
  (this as any).app.emit('collect:end');
616
- } else {
617
+ } else if (isSubLogic(node)) {
618
+ (this as any).app.emit('collect:start', {
619
+ actionMsg: `删除子逻辑`,
620
+ });
621
+ (this?.parentNode as Argument).resetExpression();
622
+ // this.delete();
623
+ (this as any).app.emit('collect:end');
624
+ }else {
617
625
  this.delete();
618
626
  }
619
627
  };
@@ -875,6 +883,7 @@ BaseNode.prototype.addParamsPrepare = async function addParamsPrepare(needAdd =
875
883
  const app = this.getAncestor('App');
876
884
  const naslServer = (app as any).naslServer as NaslServer;
877
885
  const refsList = await naslServer._isHaveRef(this);
886
+ console.log('------------addParamsPrepare------------', refsList, needAdd)
878
887
  return naslServer._addParamsPrepare(this, refsList, needAdd);
879
888
  } catch (err) {
880
889
  console.log(err);
@@ -188,9 +188,9 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
188
188
  // 连接器 相关迁移到了 conenctorDependencies 下,因此这边需要扩展
189
189
  const dependencies = [
190
190
  ...app.dependencies,
191
- ...(app.connectorDependencies || [])
191
+ // ...(app.connectorDependencies || [])
192
192
  ]; //.filter((d) => d.enable);
193
- const extensions = [...app.dependencies, ...(app.connectorDependencies || [])]
193
+ const extensions = [...app.dependencies]
194
194
  .map((dep) => moduleToLogicNamesapce(dep, app.overriddenLogics))
195
195
  .filter((item) => item.logics && item.logics.length);
196
196
  const dependEntityNs: Namespace[] = [];
@@ -279,7 +279,7 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
279
279
  new Namespace({
280
280
  name: 'category',
281
281
  title: '流程处理',
282
- logics: processV2Logics.filter((logic) => ['approveTask', 'rejectTask', 'submitTask', 'reassignTask', 'revertTask', 'withdrawTask', 'terminateProcess'].includes(logic.name)),
282
+ logics: processV2Logics.filter((logic) => ['approveTask', 'rejectTask', 'submitTask', 'reassignTask', 'revertTask', 'withdrawTask', 'addSignTask', 'terminateProcess'].includes(logic.name)),
283
283
  expanded: false,
284
284
  }),
285
285
  new Namespace({
@@ -328,7 +328,7 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
328
328
  path: `nasl`,
329
329
  title: '系统逻辑',
330
330
  children: [
331
- processLogicsTree,
331
+ currentProcessLogics,
332
332
  new Namespace({
333
333
  name: 'category',
334
334
  path: `browser`,
@@ -463,14 +463,15 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
463
463
  name: 'category',
464
464
  path: 'dependencies',
465
465
  title: item.name,
466
- logics: fed.logics,
466
+ logics: fed.logics as unknown as Logic[], // FIXME
467
467
  expanded: false,
468
468
  })
469
469
  );
470
470
  }
471
471
  });
472
472
 
473
- if (!app.processes.length) systemTree.children.shift();
473
+ if (!app.processes.length && !app.newProcessVersion) systemTree.children.shift();
474
+ else if (!app.processV2s.length && app.newProcessVersion) systemTree.children.shift();
474
475
 
475
476
  systemTree.expanded = false;
476
477
  systemTree.children.forEach((child) => (child.expanded = false));
@@ -500,7 +501,8 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
500
501
  ],
501
502
  expanded: false,
502
503
  });
503
- if (!(app.processes?.length) && !(app.processV2s?.length)) systemTree.children.shift();
504
+ if (!app.processes.length && !app.newProcessVersion) systemTree.children.shift();
505
+ else if (!app.processV2s.length && app.newProcessVersion) systemTree.children.shift();
504
506
 
505
507
  systemTree.expanded = false;
506
508
  systemTree.children.forEach((child) => (child.expanded = false));
@@ -17,6 +17,7 @@ import {
17
17
  PAGE_COMPONENT_INCLUDE_TAG_MAP,
18
18
  ComponentCompletionPropertyMap,
19
19
  configurationEnums,
20
+ processV2Enums,
20
21
  } from '..';
21
22
  import { formatVariableData, formatFrontEndVariables, formatConfigProperties, formatBackendVariables } from './formatTsUtils';
22
23
 
@@ -306,6 +307,12 @@ export function getEnumsIdentifier(node: BaseNode): CompletionProperty[] {
306
307
  concept: 'category',
307
308
  children: formatEnums(configurationEnums),
308
309
  });
310
+ // 增加流程枚举
311
+ extensionEnums.push({
312
+ name: '流程',
313
+ concept: 'category',
314
+ children: formatEnums(processV2Enums),
315
+ });
309
316
  return newEnums.concat(extensionEnums);
310
317
  }
311
318
  // 获取后端全局变量
@@ -21,6 +21,7 @@ type CompletionData = {
21
21
  name: string;
22
22
  concept: string;
23
23
  value: string;
24
+ rootName: string;
24
25
  selectable?: boolean;
25
26
  children: Array<any>;
26
27
  };
@@ -153,6 +154,7 @@ export function getProcessSystemVariables(processEle: ProcessElementV2) {
153
154
  const startNode = {
154
155
  name: processV2.name,
155
156
  value: processV2.name,
157
+ title: processV2.name,
156
158
  expanded: true,
157
159
  icon: 'process',
158
160
  children: transformIdentifier([{ value: '流程实例发起人', name: 'processSystem.procInstStartBy' }]),
@@ -160,11 +162,12 @@ export function getProcessSystemVariables(processEle: ProcessElementV2) {
160
162
  const prefixNode: any = {
161
163
  name: '上一任务节点',
162
164
  value: '上一任务节点',
165
+ title: '上一任务节点',
163
166
  expanded: true,
164
167
  icon: 'ApprovalTask',
165
168
  children: transformIdentifier([
166
- { value: '上一节点(审批)参与人', name: 'processSystem.pre.nodeParticipants' },
167
- { value: '上一节点(审批)完成人', name: 'processSystem.pre.nodeAssignees' },
169
+ { value: '节点参与人', name: 'processSystem.pre.nodeParticipants' },
170
+ { value: '节点完成人', name: 'processSystem.pre.nodeAssignees' },
168
171
  ]),
169
172
  }
170
173
  const elements: ProcessElementV2[] = getPreviousTask(processEle);
@@ -172,6 +175,7 @@ export function getProcessSystemVariables(processEle: ProcessElementV2) {
172
175
  return {
173
176
  name: item.name,
174
177
  value: item.name,
178
+ title: item.title,
175
179
  expanded: true,
176
180
  icon: item.type,
177
181
  isProcess: true,
@@ -185,6 +189,9 @@ export function getProcessSystemVariables(processEle: ProcessElementV2) {
185
189
 
186
190
  const { properties = [] } = processV2.currentBindEntity || {};
187
191
  let customs: EntityProperty[] | MemberExpression[] = properties.filter(({ typeAnnotation }) => ['String', 'List<String>'].includes(typeAnnotation?.sign))
192
+ if(processV2.composedBy) {
193
+ customs = customs.filter((item) => !['procInstId','status'].includes(item.name))
194
+ }
188
195
 
189
196
  customs = transformIdentifier(
190
197
  customs.map(({ name, label, typeAnnotation }) => {
@@ -194,7 +201,7 @@ export function getProcessSystemVariables(processEle: ProcessElementV2) {
194
201
 
195
202
  const systempVars = [
196
203
  {
197
- name: '流程变量',
204
+ title: '流程变量',
198
205
  value: processV2.name,
199
206
  children: [
200
207
  startNode,
@@ -203,7 +210,7 @@ export function getProcessSystemVariables(processEle: ProcessElementV2) {
203
210
  icon: 'category',
204
211
  },
205
212
  {
206
- name: '流程数据',
213
+ title: '流程数据',
207
214
  value: '流程数据',
208
215
  children: [
209
216
  ...customs
@@ -247,7 +254,7 @@ export function getFlowSystemVariables(processEle: ProcessElementV2) {
247
254
  const elements: ProcessElementV2[] = getPreviousTask(prefixElement);
248
255
  const prevtasksVar = elements.map((item) => {
249
256
  return {
250
- label: item.name,
257
+ label: item.title,
251
258
  value: item.name,
252
259
  icon: item.type,
253
260
  children: [
@@ -547,6 +554,7 @@ function genCurNodeVariable(prefix: string[] = []) {
547
554
  const curr = new CompletionProperty({
548
555
  name: 'curr',
549
556
  value: 'curr',
557
+ expression: genMemberExpression([...prefix, 'curr'].join('.')),
550
558
  children: genConstants([...prefix, 'curr'], [
551
559
  // 当前节点标题
552
560
  'nodeTitle',
@@ -582,6 +590,7 @@ function genPreNodeVariable(prefix: string[] = []) {
582
590
  const pre = new CompletionProperty({
583
591
  name: 'pre',
584
592
  value: 'pre',
593
+ expression: genMemberExpression([...prefix, 'pre'].join('.')),
585
594
  children: genConstants([...prefix, 'pre'], [
586
595
  // 上一节点(审批)标识
587
596
  'nodeTitle',
@@ -639,6 +648,7 @@ export function getProcessVariableSuggestions(node: LogicItem): CompletionProper
639
648
  name: processV2.name,
640
649
  value: 'processSystem',
641
650
  concept: 'processV2',
651
+ rootName: 'processSystem',
642
652
  selectable: false,
643
653
  children: [
644
654
  // 生成流程变量
@@ -679,6 +689,7 @@ export function getProcessVariableSuggestions(node: LogicItem): CompletionProper
679
689
  name: processV2.name,
680
690
  value: 'custom',
681
691
  concept: 'processV2',
692
+ rootName: 'custom',
682
693
  selectable: false,
683
694
  children: [],
684
695
  };
@@ -694,6 +705,5 @@ export function getProcessVariableSuggestions(node: LogicItem): CompletionProper
694
705
  });
695
706
  list.push(customVariable);
696
707
  }
697
- console.log(list[0])
698
708
  return list;
699
709
  }