@lcap/nasl 1.0.0-alpha.9 → 1.0.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 (481) hide show
  1. package/out/automate/engine/index.d.ts +3 -0
  2. package/out/automate/engine/index.js +414 -0
  3. package/out/automate/engine/index.js.map +1 -0
  4. package/out/automate/engine/operators.d.ts +13 -0
  5. package/out/automate/engine/operators.js +63 -0
  6. package/out/automate/engine/operators.js.map +1 -0
  7. package/out/automate/engine/uniqueName.d.ts +6 -0
  8. package/out/automate/engine/uniqueName.js +39 -0
  9. package/out/automate/engine/uniqueName.js.map +1 -0
  10. package/out/automate/engine/utils.d.ts +24 -0
  11. package/out/automate/engine/utils.js +379 -0
  12. package/out/automate/engine/utils.js.map +1 -0
  13. package/out/common/BaseNode.d.ts +21 -1
  14. package/out/common/BaseNode.js +232 -84
  15. package/out/common/BaseNode.js.map +1 -1
  16. package/out/concepts/App__.d.ts +19 -1
  17. package/out/concepts/App__.js +88 -45
  18. package/out/concepts/App__.js.map +1 -1
  19. package/out/concepts/Argument__.d.ts +5 -1
  20. package/out/concepts/Argument__.js +21 -3
  21. package/out/concepts/Argument__.js.map +1 -1
  22. package/out/concepts/Assignee__.d.ts +201 -0
  23. package/out/concepts/Assignee__.js +298 -0
  24. package/out/concepts/Assignee__.js.map +1 -0
  25. package/out/concepts/Assignment__.js +5 -0
  26. package/out/concepts/Assignment__.js.map +1 -1
  27. package/out/concepts/BinaryExpression__.js +8 -7
  28. package/out/concepts/BinaryExpression__.js.map +1 -1
  29. package/out/concepts/BindAttribute__.d.ts +19 -0
  30. package/out/concepts/BindAttribute__.js +55 -10
  31. package/out/concepts/BindAttribute__.js.map +1 -1
  32. package/out/concepts/BindDirective__.js +23 -3
  33. package/out/concepts/BindDirective__.js.map +1 -1
  34. package/out/concepts/BindEvent__.d.ts +2 -2
  35. package/out/concepts/BindEvent__.js +67 -34
  36. package/out/concepts/BindEvent__.js.map +1 -1
  37. package/out/concepts/BooleanLiteral__.d.ts +2 -0
  38. package/out/concepts/BooleanLiteral__.js +10 -0
  39. package/out/concepts/BooleanLiteral__.js.map +1 -1
  40. package/out/concepts/CallFunction__.js +58 -25
  41. package/out/concepts/CallFunction__.js.map +1 -1
  42. package/out/concepts/CallInterface__.d.ts +5 -0
  43. package/out/concepts/CallInterface__.js +238 -31
  44. package/out/concepts/CallInterface__.js.map +1 -1
  45. package/out/concepts/CallLogic__.d.ts +4 -4
  46. package/out/concepts/CallLogic__.js +107 -50
  47. package/out/concepts/CallLogic__.js.map +1 -1
  48. package/out/concepts/CallQueryComponent__.d.ts +38 -3
  49. package/out/concepts/CallQueryComponent__.js +329 -75
  50. package/out/concepts/CallQueryComponent__.js.map +1 -1
  51. package/out/concepts/Comment__.js +6 -2
  52. package/out/concepts/Comment__.js.map +1 -1
  53. package/out/concepts/CompletionProperty__.d.ts +3 -1
  54. package/out/concepts/CompletionProperty__.js +2 -0
  55. package/out/concepts/CompletionProperty__.js.map +1 -1
  56. package/out/concepts/ConfigGroup__.js +3 -3
  57. package/out/concepts/ConfigGroup__.js.map +1 -1
  58. package/out/concepts/ConfigProperty__.js +3 -3
  59. package/out/concepts/ConfigProperty__.js.map +1 -1
  60. package/out/concepts/Configuration__.js +3 -3
  61. package/out/concepts/Configuration__.js.map +1 -1
  62. package/out/concepts/Constant__.d.ts +1 -0
  63. package/out/concepts/Constant__.js +16 -2
  64. package/out/concepts/Constant__.js.map +1 -1
  65. package/out/concepts/Destination__.d.ts +12 -0
  66. package/out/concepts/Destination__.js +115 -22
  67. package/out/concepts/Destination__.js.map +1 -1
  68. package/out/concepts/End__.js +9 -1
  69. package/out/concepts/End__.js.map +1 -1
  70. package/out/concepts/EntityIndex__.js +4 -2
  71. package/out/concepts/EntityIndex__.js.map +1 -1
  72. package/out/concepts/EntityProperty__.d.ts +11 -0
  73. package/out/concepts/EntityProperty__.js +71 -5
  74. package/out/concepts/EntityProperty__.js.map +1 -1
  75. package/out/concepts/Entity__.d.ts +5 -4
  76. package/out/concepts/Entity__.js +35 -19
  77. package/out/concepts/Entity__.js.map +1 -1
  78. package/out/concepts/Enum__.d.ts +5 -0
  79. package/out/concepts/Enum__.js +24 -12
  80. package/out/concepts/Enum__.js.map +1 -1
  81. package/out/concepts/Event__.js +3 -3
  82. package/out/concepts/Event__.js.map +1 -1
  83. package/out/concepts/ForEachStatement__.d.ts +1 -1
  84. package/out/concepts/ForEachStatement__.js +11 -15
  85. package/out/concepts/ForEachStatement__.js.map +1 -1
  86. package/out/concepts/Function__.js +13 -13
  87. package/out/concepts/Function__.js.map +1 -1
  88. package/out/concepts/Identifier__.d.ts +3 -0
  89. package/out/concepts/Identifier__.js +77 -30
  90. package/out/concepts/Identifier__.js.map +1 -1
  91. package/out/concepts/IfStatement__.js +4 -4
  92. package/out/concepts/IfStatement__.js.map +1 -1
  93. package/out/concepts/InterfaceParam__.d.ts +6 -4
  94. package/out/concepts/InterfaceParam__.js +57 -19
  95. package/out/concepts/InterfaceParam__.js.map +1 -1
  96. package/out/concepts/Interface__.d.ts +42 -30
  97. package/out/concepts/Interface__.js +133 -17
  98. package/out/concepts/Interface__.js.map +1 -1
  99. package/out/concepts/JSBlock__.d.ts +1 -0
  100. package/out/concepts/JSBlock__.js +3 -0
  101. package/out/concepts/JSBlock__.js.map +1 -1
  102. package/out/concepts/LogicItem__.d.ts +2 -1
  103. package/out/concepts/LogicItem__.js +14 -0
  104. package/out/concepts/LogicItem__.js.map +1 -1
  105. package/out/concepts/Logic__.d.ts +20 -1
  106. package/out/concepts/Logic__.js +194 -37
  107. package/out/concepts/Logic__.js.map +1 -1
  108. package/out/concepts/MemberExpression__.d.ts +2 -0
  109. package/out/concepts/MemberExpression__.js +49 -13
  110. package/out/concepts/MemberExpression__.js.map +1 -1
  111. package/out/concepts/Module__.d.ts +126 -120
  112. package/out/concepts/Module__.js +36 -26
  113. package/out/concepts/Module__.js.map +1 -1
  114. package/out/concepts/Namespace__.d.ts +5 -1
  115. package/out/concepts/Namespace__.js +48 -37
  116. package/out/concepts/Namespace__.js.map +1 -1
  117. package/out/concepts/NullLiteral__.d.ts +3 -0
  118. package/out/concepts/NullLiteral__.js +11 -1
  119. package/out/concepts/NullLiteral__.js.map +1 -1
  120. package/out/concepts/NumericLiteral__.d.ts +1 -1
  121. package/out/concepts/NumericLiteral__.js +17 -6
  122. package/out/concepts/NumericLiteral__.js.map +1 -1
  123. package/out/concepts/Param__.d.ts +7 -3
  124. package/out/concepts/Param__.js +64 -28
  125. package/out/concepts/Param__.js.map +1 -1
  126. package/out/concepts/ProcessComponent__.js +6 -6
  127. package/out/concepts/ProcessComponent__.js.map +1 -1
  128. package/out/concepts/ProcessElement__.d.ts +0 -4
  129. package/out/concepts/ProcessElement__.js +123 -54
  130. package/out/concepts/ProcessElement__.js.map +1 -1
  131. package/out/concepts/ProcessOutcome__.js +1 -1
  132. package/out/concepts/ProcessOutcome__.js.map +1 -1
  133. package/out/concepts/Process__.d.ts +7 -1
  134. package/out/concepts/Process__.js +81 -85
  135. package/out/concepts/Process__.js.map +1 -1
  136. package/out/concepts/QueryAggregateExpression__.js +1 -1
  137. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  138. package/out/concepts/QueryFieldExpression__.d.ts +1 -0
  139. package/out/concepts/QueryFieldExpression__.js +3 -0
  140. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  141. package/out/concepts/QueryFromExpression__.js +2 -2
  142. package/out/concepts/QueryFromExpression__.js.map +1 -1
  143. package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
  144. package/out/concepts/QueryGroupByExpression__.js +20 -0
  145. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  146. package/out/concepts/QueryJoinExpression__.js +5 -5
  147. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  148. package/out/concepts/QueryLimitExpression__.js +2 -2
  149. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  150. package/out/concepts/QuerySelectExpression__.js +3 -3
  151. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  152. package/out/concepts/Return__.d.ts +4 -1
  153. package/out/concepts/Return__.js +74 -23
  154. package/out/concepts/Return__.js.map +1 -1
  155. package/out/concepts/Role__.d.ts +4 -0
  156. package/out/concepts/Role__.js +13 -4
  157. package/out/concepts/Role__.js.map +1 -1
  158. package/out/concepts/SqlQueryComponent__.js +2 -2
  159. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  160. package/out/concepts/StringLiteral__.d.ts +1 -1
  161. package/out/concepts/StringLiteral__.js +22 -39
  162. package/out/concepts/StringLiteral__.js.map +1 -1
  163. package/out/concepts/StructureProperty__.d.ts +5 -4
  164. package/out/concepts/StructureProperty__.js +55 -26
  165. package/out/concepts/StructureProperty__.js.map +1 -1
  166. package/out/concepts/Structure__.d.ts +44 -30
  167. package/out/concepts/Structure__.js +44 -12
  168. package/out/concepts/Structure__.js.map +1 -1
  169. package/out/concepts/SwitchCase__.js +4 -4
  170. package/out/concepts/SwitchCase__.js.map +1 -1
  171. package/out/concepts/SwitchStatement__.js +2 -2
  172. package/out/concepts/SwitchStatement__.js.map +1 -1
  173. package/out/concepts/TypeAnnotation__.d.ts +5 -5
  174. package/out/concepts/TypeAnnotation__.js +82 -20
  175. package/out/concepts/TypeAnnotation__.js.map +1 -1
  176. package/out/concepts/UnaryExpression__.js +10 -8
  177. package/out/concepts/UnaryExpression__.js.map +1 -1
  178. package/out/concepts/Unparsed__.js +1 -1
  179. package/out/concepts/Unparsed__.js.map +1 -1
  180. package/out/concepts/ValidationRule__.d.ts +1 -0
  181. package/out/concepts/ValidationRule__.js +48 -13
  182. package/out/concepts/ValidationRule__.js.map +1 -1
  183. package/out/concepts/Variable__.d.ts +10 -1
  184. package/out/concepts/Variable__.js +77 -20
  185. package/out/concepts/Variable__.js.map +1 -1
  186. package/out/concepts/ViewComponent__.js +15 -15
  187. package/out/concepts/ViewComponent__.js.map +1 -1
  188. package/out/concepts/ViewElement__.d.ts +17 -11
  189. package/out/concepts/ViewElement__.js +302 -204
  190. package/out/concepts/ViewElement__.js.map +1 -1
  191. package/out/concepts/View__.d.ts +13 -12
  192. package/out/concepts/View__.js +124 -102
  193. package/out/concepts/View__.js.map +1 -1
  194. package/out/concepts/WhileStatement__.js +3 -3
  195. package/out/concepts/WhileStatement__.js.map +1 -1
  196. package/out/concepts/basics/stdlib/index.js +4 -1
  197. package/out/concepts/basics/stdlib/index.js.map +1 -1
  198. package/out/concepts/basics/stdlib/{nasl.validate.d.ts → nasl.auth.d.ts} +0 -0
  199. package/out/concepts/basics/stdlib/nasl.auth.js +30 -0
  200. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
  201. package/out/concepts/basics/stdlib/nasl.browser.d.ts +3 -0
  202. package/out/concepts/basics/stdlib/nasl.browser.js +41 -0
  203. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -0
  204. package/out/concepts/basics/stdlib/nasl.configuration.d.ts +3 -0
  205. package/out/concepts/basics/stdlib/nasl.configuration.js +25 -0
  206. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
  207. package/out/concepts/basics/stdlib/nasl.interface.d.ts +2 -0
  208. package/out/concepts/basics/stdlib/nasl.interface.js +4 -4
  209. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  210. package/out/concepts/basics/stdlib/nasl.ui.js +20 -0
  211. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  212. package/out/concepts/basics/stdlib/nasl.util.js +138 -18
  213. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  214. package/out/concepts/basics/stdlib/nasl.validation.js +54 -20
  215. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  216. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
  217. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
  218. package/out/concepts/basics/types/coreTypeList.js +11 -10
  219. package/out/concepts/basics/types/coreTypeList.js.map +1 -1
  220. package/out/concepts/basics/types/index.d.ts +1 -0
  221. package/out/concepts/basics/types/index.js +3 -1
  222. package/out/concepts/basics/types/index.js.map +1 -1
  223. package/out/concepts/index__.d.ts +1 -0
  224. package/out/concepts/index__.js +1 -0
  225. package/out/concepts/index__.js.map +1 -1
  226. package/out/config.d.ts +1 -2
  227. package/out/config.js +1 -2
  228. package/out/config.js.map +1 -1
  229. package/out/enums/KEYWORDS.d.ts +3 -0
  230. package/out/enums/KEYWORDS.js +1199 -0
  231. package/out/enums/KEYWORDS.js.map +1 -0
  232. package/out/{terms → enums}/LEVEL_NAME_MAP.d.ts +0 -0
  233. package/out/{terms → enums}/LEVEL_NAME_MAP.js +0 -0
  234. package/out/{terms → enums}/LEVEL_NAME_MAP.js.map +1 -1
  235. package/out/eventBus.d.ts +3 -0
  236. package/out/eventBus.js +7 -0
  237. package/out/eventBus.js.map +1 -0
  238. package/out/generator/genBundleFiles.d.ts +7 -2
  239. package/out/generator/genBundleFiles.js +168 -27
  240. package/out/generator/genBundleFiles.js.map +1 -1
  241. package/out/generator/genMetaData.d.ts +20 -20
  242. package/out/generator/genMetaData.js +50 -15
  243. package/out/generator/genMetaData.js.map +1 -1
  244. package/out/index.d.ts +2 -0
  245. package/out/index.js +2 -0
  246. package/out/index.js.map +1 -1
  247. package/out/manager/diagnostic.d.ts +2 -2
  248. package/out/server/createUiTs.d.ts +1 -0
  249. package/out/server/createUiTs.js +49 -5
  250. package/out/server/createUiTs.js.map +1 -1
  251. package/out/server/entity2LogicNamespace.js +38 -23
  252. package/out/server/entity2LogicNamespace.js.map +1 -1
  253. package/out/server/extendBaseNode.d.ts +1 -0
  254. package/out/server/extendBaseNode.js +323 -0
  255. package/out/server/extendBaseNode.js.map +1 -0
  256. package/out/server/getExtensionModules.js +2 -0
  257. package/out/server/getExtensionModules.js.map +1 -1
  258. package/out/server/getFunctions.d.ts +1 -0
  259. package/out/server/getFunctions.js +7 -1
  260. package/out/server/getFunctions.js.map +1 -1
  261. package/out/server/getLogics.js +84 -18
  262. package/out/server/getLogics.js.map +1 -1
  263. package/out/server/getMemberIdentifier.d.ts +16 -1
  264. package/out/server/getMemberIdentifier.js +326 -38
  265. package/out/server/getMemberIdentifier.js.map +1 -1
  266. package/out/server/getProcesses.d.ts +8 -1
  267. package/out/server/getProcesses.js +383 -1
  268. package/out/server/getProcesses.js.map +1 -1
  269. package/out/server/getScope.d.ts +13 -0
  270. package/out/server/getScope.js +61 -0
  271. package/out/server/getScope.js.map +1 -0
  272. package/out/server/index.d.ts +1 -0
  273. package/out/server/index.js +5 -0
  274. package/out/server/index.js.map +1 -1
  275. package/out/server/naslServer.d.ts +36 -57
  276. package/out/server/naslServer.js +689 -615
  277. package/out/server/naslServer.js.map +1 -1
  278. package/out/server/process2LogicNamespace.d.ts +10 -0
  279. package/out/server/process2LogicNamespace.js +29 -1
  280. package/out/server/process2LogicNamespace.js.map +1 -1
  281. package/out/server/translator.d.ts +22 -3
  282. package/out/server/translator.js +369 -123
  283. package/out/server/translator.js.map +1 -1
  284. package/out/service/creator/add.configs.d.ts +1 -0
  285. package/out/service/creator/add.configs.js +68 -0
  286. package/out/service/creator/add.configs.js.map +1 -0
  287. package/out/service/creator/errHandles.d.ts +18 -0
  288. package/out/service/creator/errHandles.js +60 -0
  289. package/out/service/creator/errHandles.js.map +1 -0
  290. package/out/service/creator/index.d.ts +1 -0
  291. package/out/service/creator/index.js +72 -0
  292. package/out/service/creator/index.js.map +1 -0
  293. package/out/service/storage/api.d.ts +18 -0
  294. package/out/service/storage/api.js +17 -0
  295. package/out/service/storage/api.js.map +1 -0
  296. package/out/service/storage/init.js +221 -37
  297. package/out/service/storage/init.js.map +1 -1
  298. package/out/service/storage/service.d.ts +2 -0
  299. package/out/service/storage/service.js +10 -0
  300. package/out/service/storage/service.js.map +1 -0
  301. package/out/service/storage/storagePoint.d.ts +1 -14
  302. package/out/service/storage/storagePoint.js +16 -16
  303. package/out/service/storage/storagePoint.js.map +1 -1
  304. package/out/templator/genCreateBlock.js +6 -6
  305. package/out/templator/genCreateBlock.js.map +1 -1
  306. package/out/templator/genCurdEditMultipleKeyBlock.js +13 -17
  307. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  308. package/out/templator/genCurdMultipleKeyBlock.js +11 -11
  309. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  310. package/out/templator/genEditTableBlock.js +5 -5
  311. package/out/templator/genEditTableBlock.js.map +1 -1
  312. package/out/templator/genEnumSelectBlock.js +2 -2
  313. package/out/templator/genEnumSelectBlock.js.map +1 -1
  314. package/out/templator/genGetBlock.js +6 -4
  315. package/out/templator/genGetBlock.js.map +1 -1
  316. package/out/templator/genGridViewBlock.d.ts +3 -1
  317. package/out/templator/genGridViewBlock.js +61 -6
  318. package/out/templator/genGridViewBlock.js.map +1 -1
  319. package/out/templator/genQueryComponent.d.ts +2 -0
  320. package/out/templator/genQueryComponent.js +34 -18
  321. package/out/templator/genQueryComponent.js.map +1 -1
  322. package/out/templator/genSelectBlock.js +5 -15
  323. package/out/templator/genSelectBlock.js.map +1 -1
  324. package/out/templator/genTableBlock.d.ts +1 -1
  325. package/out/templator/genTableBlock.js +4 -5
  326. package/out/templator/genTableBlock.js.map +1 -1
  327. package/out/templator/genUpdateBlock.js +10 -11
  328. package/out/templator/genUpdateBlock.js.map +1 -1
  329. package/out/templator/utils.d.ts +16 -5
  330. package/out/templator/utils.js +10 -5
  331. package/out/templator/utils.js.map +1 -1
  332. package/out/test/fixtures/env.js +0 -1
  333. package/out/test/fixtures/env.js.map +1 -1
  334. package/out/test/units/page/Element.spec.js +3 -3
  335. package/out/test/units/page/Element.spec.js.map +1 -1
  336. package/out/test/units/temp/temp.spec.js +1 -1
  337. package/out/test/units/temp/temp.spec.js.map +1 -1
  338. package/out/utils/index.d.ts +6 -0
  339. package/out/utils/index.js +25 -1
  340. package/out/utils/index.js.map +1 -1
  341. package/out/utils/string.d.ts +1 -1
  342. package/out/utils/string.js +38 -9
  343. package/out/utils/string.js.map +1 -1
  344. package/package.json +2 -2
  345. package/src/automate/engine/index.js +95 -119
  346. package/src/automate/engine/operators.js +63 -0
  347. package/src/automate/engine/uniqueName.js +36 -0
  348. package/src/automate/engine/utils.js +63 -19
  349. package/src/common/BaseNode.ts +229 -74
  350. package/src/concepts/App__.ts +92 -85
  351. package/src/concepts/Argument__.ts +23 -3
  352. package/src/concepts/Assignee__.ts +467 -0
  353. package/src/concepts/Assignment__.ts +4 -1
  354. package/src/concepts/BinaryExpression__.ts +9 -7
  355. package/src/concepts/BindAttribute__.ts +69 -9
  356. package/src/concepts/BindDirective__.ts +22 -3
  357. package/src/concepts/BindEvent__.ts +67 -23
  358. package/src/concepts/BooleanLiteral__.ts +8 -0
  359. package/src/concepts/CallFunction__.ts +55 -23
  360. package/src/concepts/CallInterface__.ts +236 -26
  361. package/src/concepts/CallLogic__.ts +111 -52
  362. package/src/concepts/CallQueryComponent__.ts +315 -67
  363. package/src/concepts/Comment__.ts +6 -2
  364. package/src/concepts/CompletionProperty__.ts +5 -1
  365. package/src/concepts/ConfigGroup__.ts +3 -3
  366. package/src/concepts/ConfigProperty__.ts +3 -3
  367. package/src/concepts/Configuration__.ts +3 -3
  368. package/src/concepts/Constant__.ts +14 -2
  369. package/src/concepts/Destination__.ts +123 -37
  370. package/src/concepts/End__.ts +8 -1
  371. package/src/concepts/EntityIndex__.ts +4 -2
  372. package/src/concepts/EntityProperty__.ts +56 -5
  373. package/src/concepts/Entity__.ts +38 -21
  374. package/src/concepts/Enum__.ts +23 -26
  375. package/src/concepts/Event__.ts +3 -3
  376. package/src/concepts/ForEachStatement__.ts +16 -21
  377. package/src/concepts/Function__.ts +13 -13
  378. package/src/concepts/Identifier__.ts +84 -42
  379. package/src/concepts/IfStatement__.ts +4 -4
  380. package/src/concepts/InterfaceParam__.ts +57 -16
  381. package/src/concepts/Interface__.ts +130 -16
  382. package/src/concepts/JSBlock__.ts +4 -0
  383. package/src/concepts/LogicItem__.ts +16 -1
  384. package/src/concepts/Logic__.ts +192 -39
  385. package/src/concepts/MemberExpression__.ts +58 -15
  386. package/src/concepts/Module__.ts +35 -24
  387. package/src/concepts/Namespace__.ts +49 -37
  388. package/src/concepts/NullLiteral__.ts +8 -1
  389. package/src/concepts/NumericLiteral__.ts +17 -6
  390. package/src/concepts/Param__.ts +64 -16
  391. package/src/concepts/ProcessComponent__.ts +6 -6
  392. package/src/concepts/ProcessElement__.ts +149 -44
  393. package/src/concepts/ProcessOutcome__.ts +1 -1
  394. package/src/concepts/Process__.ts +85 -98
  395. package/src/concepts/QueryAggregateExpression__.ts +1 -1
  396. package/src/concepts/QueryFieldExpression__.ts +4 -0
  397. package/src/concepts/QueryFromExpression__.ts +2 -2
  398. package/src/concepts/QueryGroupByExpression__.ts +23 -0
  399. package/src/concepts/QueryJoinExpression__.ts +5 -5
  400. package/src/concepts/QueryLimitExpression__.ts +2 -2
  401. package/src/concepts/QuerySelectExpression__.ts +3 -3
  402. package/src/concepts/Return__.ts +69 -17
  403. package/src/concepts/Role__.ts +5 -4
  404. package/src/concepts/SqlQueryComponent__.ts +2 -2
  405. package/src/concepts/StringLiteral__.ts +21 -39
  406. package/src/concepts/StructureProperty__.ts +50 -18
  407. package/src/concepts/Structure__.ts +32 -10
  408. package/src/concepts/SwitchCase__.ts +4 -4
  409. package/src/concepts/SwitchStatement__.ts +2 -2
  410. package/src/concepts/TypeAnnotation__.ts +66 -15
  411. package/src/concepts/UnaryExpression__.ts +10 -8
  412. package/src/concepts/Unparsed__.ts +1 -1
  413. package/src/concepts/ValidationRule__.ts +44 -14
  414. package/src/concepts/Variable__.ts +70 -16
  415. package/src/concepts/ViewComponent__.ts +15 -15
  416. package/src/concepts/ViewElement__.ts +289 -166
  417. package/src/concepts/View__.ts +135 -69
  418. package/src/concepts/WhileStatement__.ts +4 -4
  419. package/src/concepts/basics/stdlib/index.ts +4 -2
  420. package/src/concepts/basics/stdlib/nasl.auth.ts +26 -0
  421. package/src/concepts/basics/stdlib/nasl.browser.ts +37 -0
  422. package/src/concepts/basics/stdlib/nasl.configuration.ts +21 -0
  423. package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
  424. package/src/concepts/basics/stdlib/nasl.ui.ts +20 -1
  425. package/src/concepts/basics/stdlib/nasl.util.ts +140 -18
  426. package/src/concepts/basics/stdlib/nasl.validation.ts +45 -11
  427. package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
  428. package/src/concepts/basics/types/coreTypeList.ts +11 -11
  429. package/src/concepts/basics/types/index.ts +1 -0
  430. package/src/concepts/index__.ts +1 -0
  431. package/src/config.ts +1 -2
  432. package/src/enums/KEYWORDS.ts +1197 -0
  433. package/src/{terms → enums}/LEVEL_NAME_MAP.ts +0 -0
  434. package/src/eventBus.ts +5 -0
  435. package/src/generator/genBundleFiles.ts +182 -30
  436. package/src/generator/genMetaData.ts +72 -21
  437. package/src/index.ts +2 -0
  438. package/src/manager/diagnostic.ts +2 -2
  439. package/src/server/createUiTs.ts +45 -7
  440. package/src/server/entity2LogicNamespace.ts +41 -25
  441. package/src/server/extendBaseNode.ts +318 -0
  442. package/src/server/getExtensionModules.ts +2 -0
  443. package/src/server/getFunctions.ts +6 -0
  444. package/src/server/getLogics.ts +87 -19
  445. package/src/server/getMemberIdentifier.ts +282 -65
  446. package/src/server/getProcesses.ts +397 -4
  447. package/src/server/getScope.ts +67 -0
  448. package/src/server/index.ts +13 -1
  449. package/src/server/naslServer.ts +694 -632
  450. package/src/server/process2LogicNamespace.ts +30 -2
  451. package/src/server/translator.ts +425 -128
  452. package/src/service/config/index.js +1 -1
  453. package/src/service/creator/errHandles.js +5 -2
  454. package/src/service/creator/index.js +0 -6
  455. package/src/service/storage/api.js +14 -0
  456. package/src/service/storage/init.ts +218 -45
  457. package/src/service/storage/service.ts +6 -0
  458. package/src/service/storage/storagePoint.ts +16 -16
  459. package/src/templator/genCreateBlock.ts +6 -6
  460. package/src/templator/genCurdEditMultipleKeyBlock.ts +29 -30
  461. package/src/templator/genCurdMultipleKeyBlock.ts +11 -11
  462. package/src/templator/genEditTableBlock.ts +5 -5
  463. package/src/templator/genEnumSelectBlock.ts +2 -2
  464. package/src/templator/genGetBlock.ts +7 -9
  465. package/src/templator/genGridViewBlock.ts +59 -9
  466. package/src/templator/genQueryComponent.ts +46 -32
  467. package/src/templator/genSelectBlock.ts +5 -15
  468. package/src/templator/genTableBlock.ts +5 -9
  469. package/src/templator/genUpdateBlock.ts +10 -12
  470. package/src/templator/utils.ts +12 -6
  471. package/src/test/fixtures/env.ts +0 -2
  472. package/src/test/units/page/Element.spec.ts +3 -3
  473. package/src/test/units/temp/temp.spec.ts +1 -1
  474. package/src/utils/index.ts +24 -0
  475. package/src/utils/string.ts +39 -9
  476. package/out/concepts/basics/stdlib/nasl.validate.js +0 -527
  477. package/out/concepts/basics/stdlib/nasl.validate.js.map +0 -1
  478. package/out/data/Module.d.ts +0 -34
  479. package/out/data/Module.js +0 -53
  480. package/out/data/Module.js.map +0 -1
  481. package/src/automate/engine/index.d.ts +0 -3
@@ -85,6 +85,18 @@ export class App extends BaseNode {
85
85
  @property()
86
86
  scope: 'pc' | 'h5' = undefined;
87
87
 
88
+ /**
89
+ * 制品应用标题
90
+ */
91
+ @property()
92
+ documentTitle: string = undefined;
93
+
94
+ /**
95
+ * 制品应用图标
96
+ */
97
+ @property()
98
+ documentIcon: string = undefined;
99
+
88
100
  /**
89
101
  * 是否有用户中心
90
102
  */
@@ -175,8 +187,6 @@ export class App extends BaseNode {
175
187
  @property('Module')
176
188
  componentDependencies: Array<Module> = [];
177
189
 
178
-
179
-
180
190
  /**
181
191
  * @param source 需要合并的部分参数
182
192
  */
@@ -201,14 +211,36 @@ export class App extends BaseNode {
201
211
  }
202
212
  return params;
203
213
  }
204
-
214
+ /**
215
+ * 设置制品应用标题
216
+ */
217
+ setDocumentTitle(documentTitle: string) {
218
+ const object = {
219
+ documentTitle,
220
+ };
221
+ this.update({
222
+ ...object,
223
+ });
224
+ }
225
+
226
+ /**
227
+ * 设置制品应用图标
228
+ */
229
+ setDocumentIcon(documentIcon: string) {
230
+ const object = {
231
+ documentIcon,
232
+ };
233
+ this.update({
234
+ ...object,
235
+ });
236
+ }
205
237
 
206
- getEntityExistingNames(excludedList: Array<Entity> = []) {
238
+ getEntityExistingNames(excludedList: Array<Entity> = []) {
207
239
  const excludedSet = new Set(excludedList);
208
240
  return (this.entities || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
209
241
  }
210
242
  getEntityUniqueName(name = 'Entity1') {
211
- return utils.unique(name, this.getEntityExistingNames());
243
+ return utils.unique(name, this.getEntityExistingNames(), undefined, true);
212
244
  }
213
245
 
214
246
  /**
@@ -247,7 +279,7 @@ export class App extends BaseNode {
247
279
  name: options,
248
280
  }, this, 'entities');
249
281
  } else if (options instanceof Entity) {
250
- options.delete(); // 同一实例不支持多处存在
282
+ options.ensureDelete(); // 同一实例不支持多处存在
251
283
  entity = options;
252
284
  Object.assign(entity, relationOptions);
253
285
  } else {
@@ -335,7 +367,7 @@ export class App extends BaseNode {
335
367
 
336
368
  addEntity(options?: string | Partial<Entity> | Entity) {
337
369
  const node = this._addEntity(options as any);
338
- const index = 0;
370
+ const index = this.entities.indexOf(node);
339
371
  node.create({
340
372
  index,
341
373
  parentNode: this,
@@ -344,13 +376,12 @@ export class App extends BaseNode {
344
376
  return node;
345
377
  }
346
378
 
347
-
348
379
  getStructureExistingNames(excludedList: Array<Structure> = []) {
349
380
  const excludedSet = new Set(excludedList);
350
381
  return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
351
382
  }
352
383
  getStructureUniqueName(name = 'Structure1') {
353
- return utils.unique(name, this.getStructureExistingNames());
384
+ return utils.unique(name, this.getStructureExistingNames(), undefined, true);
354
385
  }
355
386
 
356
387
  /**
@@ -389,7 +420,7 @@ export class App extends BaseNode {
389
420
  name: options,
390
421
  }, this, 'structures');
391
422
  } else if (options instanceof Structure) {
392
- options.delete(); // 同一实例不支持多处存在
423
+ options.ensureDelete(); // 同一实例不支持多处存在
393
424
  structure = options;
394
425
  Object.assign(structure, relationOptions);
395
426
  } else {
@@ -477,7 +508,7 @@ export class App extends BaseNode {
477
508
 
478
509
  addStructure(options?: string | Partial<Structure> | Structure) {
479
510
  const node = this._addStructure(options as any);
480
- const index = 0;
511
+ const index = this.structures.indexOf(node);
481
512
  node.create({
482
513
  index,
483
514
  parentNode: this,
@@ -486,13 +517,12 @@ export class App extends BaseNode {
486
517
  return node;
487
518
  }
488
519
 
489
-
490
520
  getEnumExistingNames(excludedList: Array<Enum> = []) {
491
521
  const excludedSet = new Set(excludedList);
492
522
  return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
493
523
  }
494
524
  getEnumUniqueName(name = 'Enum1') {
495
- return utils.unique(name, this.getEnumExistingNames());
525
+ return utils.unique(name, this.getEnumExistingNames(), undefined, true);
496
526
  }
497
527
 
498
528
  /**
@@ -531,7 +561,7 @@ export class App extends BaseNode {
531
561
  name: options,
532
562
  }, this, 'enums');
533
563
  } else if (options instanceof Enum) {
534
- options.delete(); // 同一实例不支持多处存在
564
+ options.ensureDelete(); // 同一实例不支持多处存在
535
565
  enumeration = options;
536
566
  Object.assign(enumeration, relationOptions);
537
567
  } else {
@@ -619,7 +649,7 @@ export class App extends BaseNode {
619
649
 
620
650
  addEnum(options?: string | Partial<Enum> | Enum) {
621
651
  const node = this._addEnum(options as any);
622
- const index = 0;
652
+ const index = this.enums.indexOf(node);
623
653
  node.create({
624
654
  index,
625
655
  parentNode: this,
@@ -628,13 +658,12 @@ export class App extends BaseNode {
628
658
  return node;
629
659
  }
630
660
 
631
-
632
661
  getLogicExistingNames(excludedList: Array<Logic> = []) {
633
662
  const excludedSet = new Set(excludedList);
634
663
  return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
635
664
  }
636
665
  getLogicUniqueName(name = 'logic1') {
637
- return utils.unique(name, this.getLogicExistingNames());
666
+ return utils.unique(name, this.getLogicExistingNames(), undefined, true);
638
667
  }
639
668
 
640
669
  /**
@@ -673,7 +702,7 @@ export class App extends BaseNode {
673
702
  name: options,
674
703
  }, this, 'logics');
675
704
  } else if (options instanceof Logic) {
676
- options.delete(); // 同一实例不支持多处存在
705
+ options.ensureDelete(); // 同一实例不支持多处存在
677
706
  logic = options;
678
707
  Object.assign(logic, relationOptions);
679
708
  } else {
@@ -761,7 +790,7 @@ export class App extends BaseNode {
761
790
 
762
791
  addLogic(options?: string | Partial<Logic> | Logic) {
763
792
  const node = this._addLogic(options as any);
764
- const index = 0;
793
+ const index = this.logics.indexOf(node);
765
794
  node.create({
766
795
  index,
767
796
  parentNode: this,
@@ -770,13 +799,12 @@ export class App extends BaseNode {
770
799
  return node;
771
800
  }
772
801
 
773
-
774
802
  getInterfaceExistingNames(excludedList: Array<Interface> = []) {
775
803
  const excludedSet = new Set(excludedList);
776
804
  return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
777
805
  }
778
806
  getInterfaceUniqueName(name = 'Interface1') {
779
- return utils.unique(name, this.getInterfaceExistingNames());
807
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
780
808
  }
781
809
 
782
810
  /**
@@ -815,7 +843,7 @@ export class App extends BaseNode {
815
843
  name: options,
816
844
  }, this, 'interfaces');
817
845
  } else if (options instanceof Interface) {
818
- options.delete(); // 同一实例不支持多处存在
846
+ options.ensureDelete(); // 同一实例不支持多处存在
819
847
  itface = options;
820
848
  Object.assign(itface, relationOptions);
821
849
  } else {
@@ -903,7 +931,7 @@ export class App extends BaseNode {
903
931
 
904
932
  addInterface(options?: string | Partial<Interface> | Interface) {
905
933
  const node = this._addInterface(options as any);
906
- const index = 0;
934
+ const index = this.interfaces.indexOf(node);
907
935
  node.create({
908
936
  index,
909
937
  parentNode: this,
@@ -912,13 +940,12 @@ export class App extends BaseNode {
912
940
  return node;
913
941
  }
914
942
 
915
-
916
943
  getViewExistingNames(excludedList: Array<View> = []) {
917
944
  const excludedSet = new Set(excludedList);
918
945
  return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
919
946
  }
920
947
  getViewUniqueName(name = 'view1') {
921
- return utils.unique(name, this.getViewExistingNames());
948
+ return utils.unique(name, this.getViewExistingNames(), undefined, true);
922
949
  }
923
950
 
924
951
  /**
@@ -957,7 +984,7 @@ export class App extends BaseNode {
957
984
  name: options,
958
985
  }, this, 'views');
959
986
  } else if (options instanceof View) {
960
- options.delete(); // 同一实例不支持多处存在
987
+ options.ensureDelete(); // 同一实例不支持多处存在
961
988
  view = options;
962
989
  Object.assign(view, relationOptions);
963
990
  } else {
@@ -1045,7 +1072,7 @@ export class App extends BaseNode {
1045
1072
 
1046
1073
  addView(options?: string | Partial<View> | View) {
1047
1074
  const node = this._addView(options as any);
1048
- const index = this.views.length;
1075
+ const index = this.views.indexOf(node);
1049
1076
  node.create({
1050
1077
  index,
1051
1078
  parentNode: this,
@@ -1054,13 +1081,12 @@ export class App extends BaseNode {
1054
1081
  return node;
1055
1082
  }
1056
1083
 
1057
-
1058
1084
  getProcessExistingNames(excludedList: Array<Process> = []) {
1059
1085
  const excludedSet = new Set(excludedList);
1060
1086
  return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1061
1087
  }
1062
1088
  getProcessUniqueName(name = 'Process1') {
1063
- return utils.unique(name, this.getProcessExistingNames());
1089
+ return utils.unique(name, this.getProcessExistingNames(), undefined, true);
1064
1090
  }
1065
1091
 
1066
1092
  /**
@@ -1099,7 +1125,7 @@ export class App extends BaseNode {
1099
1125
  name: options,
1100
1126
  }, this, 'processes');
1101
1127
  } else if (options instanceof Process) {
1102
- options.delete(); // 同一实例不支持多处存在
1128
+ options.ensureDelete(); // 同一实例不支持多处存在
1103
1129
  process = options;
1104
1130
  Object.assign(process, relationOptions);
1105
1131
  } else {
@@ -1187,7 +1213,7 @@ export class App extends BaseNode {
1187
1213
 
1188
1214
  addProcess(options?: string | Partial<Process> | Process) {
1189
1215
  const node = this._addProcess(options as any);
1190
- const index = 0;
1216
+ const index = this.processes.indexOf(node);
1191
1217
  node.create({
1192
1218
  index,
1193
1219
  parentNode: this,
@@ -1196,13 +1222,12 @@ export class App extends BaseNode {
1196
1222
  return node;
1197
1223
  }
1198
1224
 
1199
-
1200
1225
  getRoleExistingNames(excludedList: Array<Role> = []) {
1201
1226
  const excludedSet = new Set(excludedList);
1202
1227
  return (this.roles || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1203
1228
  }
1204
1229
  getRoleUniqueName(name = 'role1') {
1205
- return utils.unique(name, this.getRoleExistingNames());
1230
+ return utils.unique(name, this.getRoleExistingNames(), undefined, true);
1206
1231
  }
1207
1232
 
1208
1233
  /**
@@ -1241,7 +1266,7 @@ export class App extends BaseNode {
1241
1266
  name: options,
1242
1267
  }, this, 'roles');
1243
1268
  } else if (options instanceof Role) {
1244
- options.delete(); // 同一实例不支持多处存在
1269
+ options.ensureDelete(); // 同一实例不支持多处存在
1245
1270
  role = options;
1246
1271
  Object.assign(role, relationOptions);
1247
1272
  } else {
@@ -1329,7 +1354,7 @@ export class App extends BaseNode {
1329
1354
 
1330
1355
  addRole(options?: string | Partial<Role> | Role) {
1331
1356
  const node = this._addRole(options as any);
1332
- const index = this.roles.length;
1357
+ const index = this.roles.indexOf(node);
1333
1358
  node.create({
1334
1359
  index,
1335
1360
  parentNode: this,
@@ -1338,13 +1363,12 @@ export class App extends BaseNode {
1338
1363
  return node;
1339
1364
  }
1340
1365
 
1341
-
1342
1366
  getModuleExistingNames(excludedList: Array<Module> = []) {
1343
1367
  const excludedSet = new Set(excludedList);
1344
1368
  return (this.dependencies || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1345
1369
  }
1346
1370
  getModuleUniqueName(name = 'module1') {
1347
- return utils.unique(name, this.getModuleExistingNames());
1371
+ return utils.unique(name, this.getModuleExistingNames(), undefined, false);
1348
1372
  }
1349
1373
 
1350
1374
  /**
@@ -1383,7 +1407,7 @@ export class App extends BaseNode {
1383
1407
  name: options,
1384
1408
  }, this, 'dependencies');
1385
1409
  } else if (options instanceof Module) {
1386
- options.delete(); // 同一实例不支持多处存在
1410
+ options.ensureDelete(); // 同一实例不支持多处存在
1387
1411
  module = options;
1388
1412
  Object.assign(module, relationOptions);
1389
1413
  } else {
@@ -1471,7 +1495,7 @@ export class App extends BaseNode {
1471
1495
 
1472
1496
  addModuleInDependencies(options?: string | Partial<Module> | Module) {
1473
1497
  const node = this._addModuleInDependencies(options as any);
1474
- const index = this.dependencies.length;
1498
+ const index = this.dependencies.indexOf(node);
1475
1499
  node.create({
1476
1500
  index,
1477
1501
  parentNode: this,
@@ -1516,7 +1540,7 @@ export class App extends BaseNode {
1516
1540
  name: options,
1517
1541
  }, this, 'interfaceDependencies');
1518
1542
  } else if (options instanceof Module) {
1519
- options.delete(); // 同一实例不支持多处存在
1543
+ options.ensureDelete(); // 同一实例不支持多处存在
1520
1544
  module = options;
1521
1545
  Object.assign(module, relationOptions);
1522
1546
  } else {
@@ -1604,7 +1628,7 @@ export class App extends BaseNode {
1604
1628
 
1605
1629
  addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
1606
1630
  const node = this._addModuleInInterfaceDependencies(options as any);
1607
- const index = this.interfaceDependencies.length;
1631
+ const index = this.interfaceDependencies.indexOf(node);
1608
1632
  node.create({
1609
1633
  index,
1610
1634
  parentNode: this,
@@ -1649,7 +1673,7 @@ export class App extends BaseNode {
1649
1673
  name: options,
1650
1674
  }, this, 'componentDependencies');
1651
1675
  } else if (options instanceof Module) {
1652
- options.delete(); // 同一实例不支持多处存在
1676
+ options.ensureDelete(); // 同一实例不支持多处存在
1653
1677
  module = options;
1654
1678
  Object.assign(module, relationOptions);
1655
1679
  } else {
@@ -1737,7 +1761,7 @@ export class App extends BaseNode {
1737
1761
 
1738
1762
  addModuleInComponentDependencies(options?: string | Partial<Module> | Module) {
1739
1763
  const node = this._addModuleInComponentDependencies(options as any);
1740
- const index = this.componentDependencies.length;
1764
+ const index = this.componentDependencies.indexOf(node);
1741
1765
  node.create({
1742
1766
  index,
1743
1767
  parentNode: this,
@@ -1746,9 +1770,6 @@ export class App extends BaseNode {
1746
1770
  return node;
1747
1771
  }
1748
1772
 
1749
-
1750
-
1751
-
1752
1773
  /**
1753
1774
  * 删除实体
1754
1775
  * @param name 实体名称
@@ -1797,8 +1818,6 @@ export class App extends BaseNode {
1797
1818
  return params;
1798
1819
  }
1799
1820
 
1800
-
1801
-
1802
1821
  /**
1803
1822
  * 删除数据结构
1804
1823
  * @param name 数据结构名称
@@ -1847,8 +1866,6 @@ export class App extends BaseNode {
1847
1866
  return params;
1848
1867
  }
1849
1868
 
1850
-
1851
-
1852
1869
  /**
1853
1870
  * 删除枚举
1854
1871
  * @param name 枚举名称
@@ -1897,8 +1914,6 @@ export class App extends BaseNode {
1897
1914
  return params;
1898
1915
  }
1899
1916
 
1900
-
1901
-
1902
1917
  /**
1903
1918
  * 删除逻辑
1904
1919
  * @param name 逻辑名称
@@ -1947,8 +1962,6 @@ export class App extends BaseNode {
1947
1962
  return params;
1948
1963
  }
1949
1964
 
1950
-
1951
-
1952
1965
  /**
1953
1966
  * 删除接口
1954
1967
  * @param name 接口名称
@@ -1997,8 +2010,6 @@ export class App extends BaseNode {
1997
2010
  return params;
1998
2011
  }
1999
2012
 
2000
-
2001
-
2002
2013
  /**
2003
2014
  * 删除页面
2004
2015
  * @param name 页面名称
@@ -2047,8 +2058,6 @@ export class App extends BaseNode {
2047
2058
  return params;
2048
2059
  }
2049
2060
 
2050
-
2051
-
2052
2061
  /**
2053
2062
  * 删除流程
2054
2063
  * @param name 流程名称
@@ -2097,8 +2106,6 @@ export class App extends BaseNode {
2097
2106
  return params;
2098
2107
  }
2099
2108
 
2100
-
2101
-
2102
2109
  /**
2103
2110
  * 删除角色
2104
2111
  * @param name 角色名称
@@ -2147,8 +2154,6 @@ export class App extends BaseNode {
2147
2154
  return params;
2148
2155
  }
2149
2156
 
2150
-
2151
-
2152
2157
  /**
2153
2158
  * 删除主题
2154
2159
  * @param name 主题名称
@@ -2197,8 +2202,6 @@ export class App extends BaseNode {
2197
2202
  return params;
2198
2203
  }
2199
2204
 
2200
-
2201
-
2202
2205
  /**
2203
2206
  * 删除配置管理
2204
2207
  * @param name 配置管理名称
@@ -2247,8 +2250,6 @@ export class App extends BaseNode {
2247
2250
  return params;
2248
2251
  }
2249
2252
 
2250
-
2251
-
2252
2253
  /**
2253
2254
  * 删除模块
2254
2255
  * @param name 模块名称
@@ -2274,8 +2275,6 @@ export class App extends BaseNode {
2274
2275
  return module.delete();
2275
2276
  }
2276
2277
 
2277
-
2278
-
2279
2278
  /**
2280
2279
  * 删除模块
2281
2280
  * @param name 模块名称
@@ -2301,8 +2300,6 @@ export class App extends BaseNode {
2301
2300
  return module.delete();
2302
2301
  }
2303
2302
 
2304
-
2305
-
2306
2303
  /**
2307
2304
  * 删除模块
2308
2305
  * @param name 模块名称
@@ -2436,6 +2433,10 @@ export class App extends BaseNode {
2436
2433
  return `app`;
2437
2434
  }
2438
2435
 
2436
+ getTsNamespace() {
2437
+ return `app`;
2438
+ }
2439
+
2439
2440
  findNodeByPath(nodePath: string) {
2440
2441
  const pathArr = nodePath?.split('.') || [];
2441
2442
  let pathItem = pathArr.shift();
@@ -2446,7 +2447,7 @@ export class App extends BaseNode {
2446
2447
  const arrOption = matchArr && matchArr[1] && matchArr[1].split('=');
2447
2448
  if (node && arrayPropertyKey && arrayPropertyKey !== 'app') {
2448
2449
  node = node[arrayPropertyKey];
2449
- if (Array.isArray(arrOption) && arrOption.length && Array.isArray(node) && node.length) {
2450
+ if (Array.isArray(arrOption) && arrOption.length && Array.isArray(node)) {
2450
2451
  if (arrOption.length === 2) {
2451
2452
  node = node.filter((nodeItem) => nodeItem[arrOption[0]] === arrOption[1])[0];
2452
2453
  } else {
@@ -2476,26 +2477,30 @@ export class App extends BaseNode {
2476
2477
  return arr.length ? subView.findViewByPath(arr.join('/')) : subView;
2477
2478
  }
2478
2479
 
2480
+ findViewByName(name: string): View {
2481
+ return utils.traverse((current) => {
2482
+ if (current.node.name === name)
2483
+ return current.node;
2484
+ }, { node: { name: '', children: this.views } });
2485
+ }
2486
+
2479
2487
  loadEnvList() {
2480
2488
  this.envList = ['dev', 'online'];
2481
2489
  }
2482
2490
 
2483
- public readonly packageInfo: {
2491
+ // 必须先 loadPackageInfo 之后再生成代码
2492
+ public packageInfo: {
2484
2493
  template: { name: string; version: string };
2485
2494
  ui: { name: string; version: string };
2486
- } = {
2487
- template: {
2488
- name: 'lcap-pc-template',
2489
- version: '0.4.13-beta',
2490
- },
2491
- ui: {
2492
- name: 'cloud-ui.vusion',
2493
- version: '0.14.8',
2494
- },
2495
- };
2495
+ } = null;
2496
2496
 
2497
2497
  loadPackageInfo() {
2498
2498
  const dependencyMap = (window as any).globalData.ideVersionDetail.dependencies;
2499
+ this.packageInfo = {
2500
+ template: { name: '', version: '' },
2501
+ ui: { name: '', version: '' },
2502
+ };
2503
+
2499
2504
  this.packageInfo.template.name = this.scope === 'h5' ? '@lcap/mobile-template' : 'lcap-pc-template';
2500
2505
  this.packageInfo.template.version = this.scope === 'h5' ? dependencyMap.FrontendArchH5.version : dependencyMap.FrontendArchPC.version;
2501
2506
  this.packageInfo.ui.name = this.scope === 'h5' ? '@lcap/mobile-ui' : 'cloud-ui.vusion';
@@ -2521,7 +2526,7 @@ export class App extends BaseNode {
2521
2526
 
2522
2527
  scope === 'h5' ? `${prefix}/packages/@lcap/mobile-ui@${packageInfo.ui.version}/dist-theme/index.js` : `${prefix}/packages/cloud-ui.vusion@${packageInfo.ui.version}/dist-theme/index.js`,
2523
2528
 
2524
- scope === 'h5' ? `${prefix}/packages/@lcap/mobile-template@0.7.10-beta/cloudAdminDesigner.umd.min.js` : `${prefix}/packages/lcap-pc-template@0.4.13-beta/cloudAdminDesigner.umd.min.js`,
2529
+ scope === 'h5' ? `${prefix}/packages/@lcap/mobile-template@${packageInfo.template.version}/cloudAdminDesigner.umd.min.js` : `${prefix}/packages/lcap-pc-template@${packageInfo.template.version}/cloudAdminDesigner.umd.min.js`,
2525
2530
  ],
2526
2531
  css: [
2527
2532
  scope === 'h5' ? `${prefix}/packages/@lcap/mobile-ui@${packageInfo.ui.version}/dist-theme/index.css` : `${prefix}/packages/cloud-ui.vusion@${packageInfo.ui.version}/dist-theme/index.css`,
@@ -2537,7 +2542,9 @@ export class App extends BaseNode {
2537
2542
  this.componentDependencies.forEach((dep) => {
2538
2543
  const { name, version } = dep;
2539
2544
  result.custom.js.push(`${prefix}/packages/${name}@${version}/dist-theme/index.js`);
2540
- result.custom.css.push(`${prefix}/packages/${name}@${version}/dist-theme/index.css`);
2545
+ if (utils.shouldLoadCss(name, version)) {
2546
+ result.custom.css.push(`${prefix}/packages/${name}@${version}/dist-theme/index.css`);
2547
+ }
2541
2548
  result.custom.names.push(name);
2542
2549
  });
2543
2550
  return result;
@@ -2560,7 +2567,7 @@ ${keys.map((key) => ` ${key}: ${this.theme?.variableMap[key]};`).join('\n')}
2560
2567
  //================================================================================
2561
2568
  }
2562
2569
 
2563
- classMap['App'] = App;
2570
+ classMap.App = App;
2564
2571
  export default App;
2565
2572
  //================================================================================
2566
2573
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -1,5 +1,6 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
2
  import { ElementToVueOptions } from './ViewElement__';
3
+ import StringLiteral from './StringLiteral__';
3
4
  //================================================================================
4
5
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
5
6
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -172,13 +173,32 @@ export class Argument extends LogicItem {
172
173
  return code;
173
174
  }
174
175
 
176
+ /**
177
+ * 获取当前的TsName
178
+ */
179
+ get tsKeyword() {
180
+ if (this.keyword) {
181
+ let tsName = this.keyword;
182
+ // 匹配所有特殊字符都转为_
183
+ tsName = tsName.replace(/\W/g, '_');
184
+ if (/^\d/.test(tsName)) {
185
+ tsName = '$' + tsName;
186
+ }
187
+ return tsName;
188
+ }
189
+ return '';
190
+ }
191
+
175
192
  @withSourceMap()
176
- toEmbeddedTS(state?: TranslatorState): string {
193
+ toEmbeddedTS(state?: TranslatorState, isRequired: boolean = true, isHaveKeyWord?: boolean): string {
177
194
  let code = this.spread ? '...' : '';
195
+ if (isHaveKeyWord) {
196
+ code += `${this.tsKeyword}:`;
197
+ }
178
198
  if (this.expression) {
179
- code += this.expression.toEmbeddedTS(shiftState(state, code));
199
+ code += (this.expression as StringLiteral).toEmbeddedTS(shiftState(state, code), isRequired);
180
200
  } else {
181
- code += '__IDENTIFIER__';
201
+ code += isRequired ? '__IDENTIFIER__' : 'undefined';
182
202
  }
183
203
  return code;
184
204
  }